Repository navigation
Return undefined instead of null from class name helpers (#695) - #767
Conversation
52aef6b to
ea8ab9c
Compare
|
ea8ab9c to
56d0543
Compare
adamkudrna
left a comment
There was a problem hiding this comment.
So this is a unification with the props approach, right?
Yes. Side effect is that also fixed my statement from the #695:
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The changed fallback contract lacks the repository-required regression tests.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Updates class-name helpers to return undefined, matching React’s className type and API conventions.
Changes:
- Replaces
nullfallbacks across ten class-name helpers. - Documents empty-value conventions.
- Regression tests are missing.
| File | Description |
|---|---|
src/docs/contribute/api.md |
Documents empty-value rules. |
src/components/Text/_helpers/getRootWordWrappingClassName.ts |
Returns undefined when unset. |
src/components/Text/_helpers/getRootHyphensClassName.ts |
Returns undefined when unset. |
src/components/Text/_helpers/getRootClampClassName.ts |
Returns undefined when unset. |
src/components/Modal/_helpers/getScrollingClassName.ts |
Returns undefined when unset. |
src/components/Modal/_helpers/getPositionClassName.ts |
Returns undefined when unset. |
src/components/Button/helpers/getRootLabelVisibilityClassName.ts |
Returns undefined when unset. |
src/components/_helpers/getRootValidationStateClassName.ts |
Returns undefined when unset. |
src/components/_helpers/getRootSizeClassName.ts |
Returns undefined when unset. |
src/components/_helpers/getRootPriorityClassName.ts |
Returns undefined when unset. |
src/components/_helpers/getRootColorClassName.ts |
Returns undefined when unset. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
56d0543 to
9742ca2
Compare

Class name helpers now return
undefinedinstead ofnullwhen no class applies, and the rule is documented in the API Guidelines.Closes #695