@cdx-ui/components 0.3.4 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/README.md +1 -1
  2. package/coverage.svg +1 -1
  3. package/docs/components/bar-chart/content.md +703 -0
  4. package/docs/components/content.md +9 -1
  5. package/docs/components/line-chart/content.md +567 -0
  6. package/docs/components/pie-chart/content.md +493 -0
  7. package/docs/components/progress-segmented/content.md +1 -1
  8. package/docs/components/select/content.md +144 -2
  9. package/docs/components/stepper/content.md +599 -0
  10. package/docs/components/system-alert/content.md +533 -0
  11. package/docs/foundations/expressions/icons/content.md +1 -1
  12. package/docs/foundations/styles/tokens/all-tokens/content.md +2 -1
  13. package/docs/llms.txt +10 -0
  14. package/docs/patterns/content.md +1 -0
  15. package/docs/patterns/dashboard/content.md +423 -19
  16. package/docs/patterns/insights/content.md +590 -0
  17. package/docs/resources/release-notes/0.3.4/content.md +27 -0
  18. package/docs/resources/release-notes/0.3.5/content.md +7 -0
  19. package/docs/resources/release-notes/content.md +2 -0
  20. package/lib/commonjs/components/BarChart/geometry.js +1130 -0
  21. package/lib/commonjs/components/BarChart/geometry.js.map +1 -0
  22. package/lib/commonjs/components/BarChart/index.js +942 -0
  23. package/lib/commonjs/components/BarChart/index.js.map +1 -0
  24. package/lib/commonjs/components/BarChart/styles.js +26 -0
  25. package/lib/commonjs/components/BarChart/styles.js.map +1 -0
  26. package/lib/commonjs/components/Button/index.js +2 -2
  27. package/lib/commonjs/components/Button/index.js.map +1 -1
  28. package/lib/commonjs/components/Chip/styles.js +3 -1
  29. package/lib/commonjs/components/Chip/styles.js.map +1 -1
  30. package/lib/commonjs/components/LineChart/geometry.js +698 -0
  31. package/lib/commonjs/components/LineChart/geometry.js.map +1 -0
  32. package/lib/commonjs/components/LineChart/index.js +747 -0
  33. package/lib/commonjs/components/LineChart/index.js.map +1 -0
  34. package/lib/commonjs/components/LineChart/styles.js +25 -0
  35. package/lib/commonjs/components/LineChart/styles.js.map +1 -0
  36. package/lib/commonjs/components/PieChart/geometry.js +216 -0
  37. package/lib/commonjs/components/PieChart/geometry.js.map +1 -0
  38. package/lib/commonjs/components/PieChart/index.js +476 -0
  39. package/lib/commonjs/components/PieChart/index.js.map +1 -0
  40. package/lib/commonjs/components/PieChart/styles.js +88 -0
  41. package/lib/commonjs/components/PieChart/styles.js.map +1 -0
  42. package/lib/commonjs/components/ProgressCircle/ProgressCircleRing.js +9 -31
  43. package/lib/commonjs/components/ProgressCircle/ProgressCircleRing.js.map +1 -1
  44. package/lib/commonjs/components/ProgressCircle/ProgressRing.js +52 -0
  45. package/lib/commonjs/components/ProgressCircle/ProgressRing.js.map +1 -0
  46. package/lib/commonjs/components/ScrollShadow/useScrollShadow.js +8 -7
  47. package/lib/commonjs/components/ScrollShadow/useScrollShadow.js.map +1 -1
  48. package/lib/commonjs/components/Stepper/index.js +369 -0
  49. package/lib/commonjs/components/Stepper/index.js.map +1 -0
  50. package/lib/commonjs/components/Stepper/styles.js +211 -0
  51. package/lib/commonjs/components/Stepper/styles.js.map +1 -0
  52. package/lib/commonjs/components/Stepper/useStepperLabelFit.js +22 -0
  53. package/lib/commonjs/components/Stepper/useStepperLabelFit.js.map +1 -0
  54. package/lib/commonjs/components/Stepper/useStepperLabelFit.web.js +52 -0
  55. package/lib/commonjs/components/Stepper/useStepperLabelFit.web.js.map +1 -0
  56. package/lib/commonjs/components/Stepper/useStepperRingColors.js +31 -0
  57. package/lib/commonjs/components/Stepper/useStepperRingColors.js.map +1 -0
  58. package/lib/commonjs/components/SystemAlert/animation.js +218 -0
  59. package/lib/commonjs/components/SystemAlert/animation.js.map +1 -0
  60. package/lib/commonjs/components/SystemAlert/index.js +525 -0
  61. package/lib/commonjs/components/SystemAlert/index.js.map +1 -0
  62. package/lib/commonjs/components/SystemAlert/styles.js +178 -0
  63. package/lib/commonjs/components/SystemAlert/styles.js.map +1 -0
  64. package/lib/commonjs/components/SystemAlert/useSystemAlertStatusBarStyle.js +53 -0
  65. package/lib/commonjs/components/SystemAlert/useSystemAlertStatusBarStyle.js.map +1 -0
  66. package/lib/commonjs/components/Tabs/index.js +4 -0
  67. package/lib/commonjs/components/Tabs/index.js.map +1 -1
  68. package/lib/commonjs/components/Tabs/styles.js +1 -1
  69. package/lib/commonjs/components/Tabs/styles.js.map +1 -1
  70. package/lib/commonjs/components/chart/ChartInspector.js +610 -0
  71. package/lib/commonjs/components/chart/ChartInspector.js.map +1 -0
  72. package/lib/commonjs/components/chart/format.js +93 -0
  73. package/lib/commonjs/components/chart/format.js.map +1 -0
  74. package/lib/commonjs/components/chart/index.js +2 -0
  75. package/lib/commonjs/components/chart/index.js.map +1 -0
  76. package/lib/commonjs/components/chart/motion.js +97 -0
  77. package/lib/commonjs/components/chart/motion.js.map +1 -0
  78. package/lib/commonjs/components/chart/palette.js +178 -0
  79. package/lib/commonjs/components/chart/palette.js.map +1 -0
  80. package/lib/commonjs/components/chart/size.js +34 -0
  81. package/lib/commonjs/components/chart/size.js.map +1 -0
  82. package/lib/commonjs/components/chart/ticks.js +59 -0
  83. package/lib/commonjs/components/chart/ticks.js.map +1 -0
  84. package/lib/commonjs/components/chart/types.js +6 -0
  85. package/lib/commonjs/components/chart/types.js.map +1 -0
  86. package/lib/commonjs/components/chart/useChartHostWidth.js +27 -0
  87. package/lib/commonjs/components/chart/useChartHostWidth.js.map +1 -0
  88. package/lib/commonjs/components/index.js +60 -0
  89. package/lib/commonjs/components/index.js.map +1 -1
  90. package/lib/commonjs/figma/SystemAlert.Button.figma.js +28 -0
  91. package/lib/commonjs/figma/SystemAlert.Button.figma.js.map +1 -0
  92. package/lib/commonjs/figma/SystemAlert.Close.figma.js +22 -0
  93. package/lib/commonjs/figma/SystemAlert.Close.figma.js.map +1 -0
  94. package/lib/commonjs/figma/SystemAlert.Description.figma.js +20 -0
  95. package/lib/commonjs/figma/SystemAlert.Description.figma.js.map +1 -0
  96. package/lib/commonjs/figma/SystemAlert.IconButton.figma.js +31 -0
  97. package/lib/commonjs/figma/SystemAlert.IconButton.figma.js.map +1 -0
  98. package/lib/commonjs/figma/SystemAlert.figma.js +48 -0
  99. package/lib/commonjs/figma/SystemAlert.figma.js.map +1 -0
  100. package/lib/module/components/BarChart/geometry.js +1110 -0
  101. package/lib/module/components/BarChart/geometry.js.map +1 -0
  102. package/lib/module/components/BarChart/index.js +936 -0
  103. package/lib/module/components/BarChart/index.js.map +1 -0
  104. package/lib/module/components/BarChart/styles.js +22 -0
  105. package/lib/module/components/BarChart/styles.js.map +1 -0
  106. package/lib/module/components/Button/index.js +2 -2
  107. package/lib/module/components/Button/index.js.map +1 -1
  108. package/lib/module/components/Chip/styles.js +3 -1
  109. package/lib/module/components/Chip/styles.js.map +1 -1
  110. package/lib/module/components/LineChart/geometry.js +685 -0
  111. package/lib/module/components/LineChart/geometry.js.map +1 -0
  112. package/lib/module/components/LineChart/index.js +741 -0
  113. package/lib/module/components/LineChart/index.js.map +1 -0
  114. package/lib/module/components/LineChart/styles.js +21 -0
  115. package/lib/module/components/LineChart/styles.js.map +1 -0
  116. package/lib/module/components/PieChart/geometry.js +209 -0
  117. package/lib/module/components/PieChart/geometry.js.map +1 -0
  118. package/lib/module/components/PieChart/index.js +471 -0
  119. package/lib/module/components/PieChart/index.js.map +1 -0
  120. package/lib/module/components/PieChart/styles.js +84 -0
  121. package/lib/module/components/PieChart/styles.js.map +1 -0
  122. package/lib/module/components/ProgressCircle/ProgressCircleRing.js +10 -32
  123. package/lib/module/components/ProgressCircle/ProgressCircleRing.js.map +1 -1
  124. package/lib/module/components/ProgressCircle/ProgressRing.js +48 -0
  125. package/lib/module/components/ProgressCircle/ProgressRing.js.map +1 -0
  126. package/lib/module/components/ScrollShadow/useScrollShadow.js +8 -7
  127. package/lib/module/components/ScrollShadow/useScrollShadow.js.map +1 -1
  128. package/lib/module/components/Stepper/index.js +360 -0
  129. package/lib/module/components/Stepper/index.js.map +1 -0
  130. package/lib/module/components/Stepper/styles.js +206 -0
  131. package/lib/module/components/Stepper/styles.js.map +1 -0
  132. package/lib/module/components/Stepper/useStepperLabelFit.js +18 -0
  133. package/lib/module/components/Stepper/useStepperLabelFit.js.map +1 -0
  134. package/lib/module/components/Stepper/useStepperLabelFit.web.js +48 -0
  135. package/lib/module/components/Stepper/useStepperLabelFit.web.js.map +1 -0
  136. package/lib/module/components/Stepper/useStepperRingColors.js +28 -0
  137. package/lib/module/components/Stepper/useStepperRingColors.js.map +1 -0
  138. package/lib/module/components/SystemAlert/animation.js +213 -0
  139. package/lib/module/components/SystemAlert/animation.js.map +1 -0
  140. package/lib/module/components/SystemAlert/index.js +515 -0
  141. package/lib/module/components/SystemAlert/index.js.map +1 -0
  142. package/lib/module/components/SystemAlert/styles.js +174 -0
  143. package/lib/module/components/SystemAlert/styles.js.map +1 -0
  144. package/lib/module/components/SystemAlert/useSystemAlertStatusBarStyle.js +49 -0
  145. package/lib/module/components/SystemAlert/useSystemAlertStatusBarStyle.js.map +1 -0
  146. package/lib/module/components/Tabs/index.js +4 -0
  147. package/lib/module/components/Tabs/index.js.map +1 -1
  148. package/lib/module/components/Tabs/styles.js +1 -1
  149. package/lib/module/components/Tabs/styles.js.map +1 -1
  150. package/lib/module/components/chart/ChartInspector.js +600 -0
  151. package/lib/module/components/chart/ChartInspector.js.map +1 -0
  152. package/lib/module/components/chart/format.js +84 -0
  153. package/lib/module/components/chart/format.js.map +1 -0
  154. package/lib/module/components/chart/index.js +2 -0
  155. package/lib/module/components/chart/index.js.map +1 -0
  156. package/lib/module/components/chart/motion.js +89 -0
  157. package/lib/module/components/chart/motion.js.map +1 -0
  158. package/lib/module/components/chart/palette.js +168 -0
  159. package/lib/module/components/chart/palette.js.map +1 -0
  160. package/lib/module/components/chart/size.js +29 -0
  161. package/lib/module/components/chart/size.js.map +1 -0
  162. package/lib/module/components/chart/ticks.js +55 -0
  163. package/lib/module/components/chart/ticks.js.map +1 -0
  164. package/lib/module/components/chart/types.js +4 -0
  165. package/lib/module/components/chart/types.js.map +1 -0
  166. package/lib/module/components/chart/useChartHostWidth.js +23 -0
  167. package/lib/module/components/chart/useChartHostWidth.js.map +1 -0
  168. package/lib/module/components/index.js +5 -0
  169. package/lib/module/components/index.js.map +1 -1
  170. package/lib/module/figma/SystemAlert.Button.figma.js +22 -0
  171. package/lib/module/figma/SystemAlert.Button.figma.js.map +1 -0
  172. package/lib/module/figma/SystemAlert.Close.figma.js +18 -0
  173. package/lib/module/figma/SystemAlert.Close.figma.js.map +1 -0
  174. package/lib/module/figma/SystemAlert.Description.figma.js +14 -0
  175. package/lib/module/figma/SystemAlert.Description.figma.js.map +1 -0
  176. package/lib/module/figma/SystemAlert.IconButton.figma.js +25 -0
  177. package/lib/module/figma/SystemAlert.IconButton.figma.js.map +1 -0
  178. package/lib/module/figma/SystemAlert.figma.js +42 -0
  179. package/lib/module/figma/SystemAlert.figma.js.map +1 -0
  180. package/lib/typescript/components/BarChart/geometry.d.ts +236 -0
  181. package/lib/typescript/components/BarChart/geometry.d.ts.map +1 -0
  182. package/lib/typescript/components/BarChart/index.d.ts +193 -0
  183. package/lib/typescript/components/BarChart/index.d.ts.map +1 -0
  184. package/lib/typescript/components/BarChart/styles.d.ts +32 -0
  185. package/lib/typescript/components/BarChart/styles.d.ts.map +1 -0
  186. package/lib/typescript/components/Chip/styles.d.ts.map +1 -1
  187. package/lib/typescript/components/LineChart/geometry.d.ts +248 -0
  188. package/lib/typescript/components/LineChart/geometry.d.ts.map +1 -0
  189. package/lib/typescript/components/LineChart/index.d.ts +105 -0
  190. package/lib/typescript/components/LineChart/index.d.ts.map +1 -0
  191. package/lib/typescript/components/LineChart/styles.d.ts +12 -0
  192. package/lib/typescript/components/LineChart/styles.d.ts.map +1 -0
  193. package/lib/typescript/components/PieChart/geometry.d.ts +43 -0
  194. package/lib/typescript/components/PieChart/geometry.d.ts.map +1 -0
  195. package/lib/typescript/components/PieChart/index.d.ts +147 -0
  196. package/lib/typescript/components/PieChart/index.d.ts.map +1 -0
  197. package/lib/typescript/components/PieChart/styles.d.ts +27 -0
  198. package/lib/typescript/components/PieChart/styles.d.ts.map +1 -0
  199. package/lib/typescript/components/ProgressCircle/ProgressCircleRing.d.ts.map +1 -1
  200. package/lib/typescript/components/ProgressCircle/ProgressRing.d.ts +17 -0
  201. package/lib/typescript/components/ProgressCircle/ProgressRing.d.ts.map +1 -0
  202. package/lib/typescript/components/ScrollShadow/useScrollShadow.d.ts.map +1 -1
  203. package/lib/typescript/components/Stepper/index.d.ts +68 -0
  204. package/lib/typescript/components/Stepper/index.d.ts.map +1 -0
  205. package/lib/typescript/components/Stepper/styles.d.ts +46 -0
  206. package/lib/typescript/components/Stepper/styles.d.ts.map +1 -0
  207. package/lib/typescript/components/Stepper/useStepperLabelFit.d.ts +15 -0
  208. package/lib/typescript/components/Stepper/useStepperLabelFit.d.ts.map +1 -0
  209. package/lib/typescript/components/Stepper/useStepperLabelFit.web.d.ts +10 -0
  210. package/lib/typescript/components/Stepper/useStepperLabelFit.web.d.ts.map +1 -0
  211. package/lib/typescript/components/Stepper/useStepperRingColors.d.ts +6 -0
  212. package/lib/typescript/components/Stepper/useStepperRingColors.d.ts.map +1 -0
  213. package/lib/typescript/components/SystemAlert/animation.d.ts +56 -0
  214. package/lib/typescript/components/SystemAlert/animation.d.ts.map +1 -0
  215. package/lib/typescript/components/SystemAlert/index.d.ts +110 -0
  216. package/lib/typescript/components/SystemAlert/index.d.ts.map +1 -0
  217. package/lib/typescript/components/SystemAlert/styles.d.ts +38 -0
  218. package/lib/typescript/components/SystemAlert/styles.d.ts.map +1 -0
  219. package/lib/typescript/components/SystemAlert/useSystemAlertStatusBarStyle.d.ts +14 -0
  220. package/lib/typescript/components/SystemAlert/useSystemAlertStatusBarStyle.d.ts.map +1 -0
  221. package/lib/typescript/components/Tabs/index.d.ts.map +1 -1
  222. package/lib/typescript/components/chart/ChartInspector.d.ts +101 -0
  223. package/lib/typescript/components/chart/ChartInspector.d.ts.map +1 -0
  224. package/lib/typescript/components/chart/format.d.ts +16 -0
  225. package/lib/typescript/components/chart/format.d.ts.map +1 -0
  226. package/lib/typescript/components/chart/index.d.ts +3 -0
  227. package/lib/typescript/components/chart/index.d.ts.map +1 -0
  228. package/lib/typescript/components/chart/motion.d.ts +27 -0
  229. package/lib/typescript/components/chart/motion.d.ts.map +1 -0
  230. package/lib/typescript/components/chart/palette.d.ts +44 -0
  231. package/lib/typescript/components/chart/palette.d.ts.map +1 -0
  232. package/lib/typescript/components/chart/size.d.ts +25 -0
  233. package/lib/typescript/components/chart/size.d.ts.map +1 -0
  234. package/lib/typescript/components/chart/ticks.d.ts +3 -0
  235. package/lib/typescript/components/chart/ticks.d.ts.map +1 -0
  236. package/lib/typescript/components/chart/types.d.ts +163 -0
  237. package/lib/typescript/components/chart/types.d.ts.map +1 -0
  238. package/lib/typescript/components/chart/useChartHostWidth.d.ts +9 -0
  239. package/lib/typescript/components/chart/useChartHostWidth.d.ts.map +1 -0
  240. package/lib/typescript/components/index.d.ts +5 -0
  241. package/lib/typescript/components/index.d.ts.map +1 -1
  242. package/lib/typescript/figma/SystemAlert.Button.figma.d.ts +11 -0
  243. package/lib/typescript/figma/SystemAlert.Button.figma.d.ts.map +1 -0
  244. package/lib/typescript/figma/SystemAlert.Close.figma.d.ts +11 -0
  245. package/lib/typescript/figma/SystemAlert.Close.figma.d.ts.map +1 -0
  246. package/lib/typescript/figma/SystemAlert.Description.figma.d.ts +8 -0
  247. package/lib/typescript/figma/SystemAlert.Description.figma.d.ts.map +1 -0
  248. package/lib/typescript/figma/SystemAlert.IconButton.figma.d.ts +11 -0
  249. package/lib/typescript/figma/SystemAlert.IconButton.figma.d.ts.map +1 -0
  250. package/lib/typescript/figma/SystemAlert.figma.d.ts +8 -0
  251. package/lib/typescript/figma/SystemAlert.figma.d.ts.map +1 -0
  252. package/package.json +5 -5
  253. package/src/components/BarChart/geometry.ts +1469 -0
  254. package/src/components/BarChart/index.tsx +1424 -0
  255. package/src/components/BarChart/styles.ts +31 -0
  256. package/src/components/Button/index.tsx +1 -1
  257. package/src/components/Chip/styles.ts +3 -1
  258. package/src/components/LineChart/geometry.ts +957 -0
  259. package/src/components/LineChart/index.tsx +1109 -0
  260. package/src/components/LineChart/styles.ts +26 -0
  261. package/src/components/PieChart/geometry.ts +295 -0
  262. package/src/components/PieChart/index.tsx +715 -0
  263. package/src/components/PieChart/styles.ts +101 -0
  264. package/src/components/ProgressCircle/ProgressCircleRing.tsx +10 -39
  265. package/src/components/ProgressCircle/ProgressRing.tsx +60 -0
  266. package/src/components/ScrollShadow/useScrollShadow.ts +12 -11
  267. package/src/components/Stepper/index.tsx +452 -0
  268. package/src/components/Stepper/styles.ts +234 -0
  269. package/src/components/Stepper/useStepperLabelFit.ts +21 -0
  270. package/src/components/Stepper/useStepperLabelFit.web.ts +53 -0
  271. package/src/components/Stepper/useStepperRingColors.ts +29 -0
  272. package/src/components/SystemAlert/animation.ts +252 -0
  273. package/src/components/SystemAlert/index.tsx +684 -0
  274. package/src/components/SystemAlert/styles.ts +212 -0
  275. package/src/components/SystemAlert/useSystemAlertStatusBarStyle.ts +57 -0
  276. package/src/components/Tabs/index.tsx +4 -0
  277. package/src/components/Tabs/styles.ts +1 -1
  278. package/src/components/chart/ChartInspector.tsx +726 -0
  279. package/src/components/chart/format.ts +95 -0
  280. package/src/components/chart/index.ts +24 -0
  281. package/src/components/chart/motion.ts +98 -0
  282. package/src/components/chart/palette.tsx +247 -0
  283. package/src/components/chart/size.ts +21 -0
  284. package/src/components/chart/ticks.ts +53 -0
  285. package/src/components/chart/types.ts +183 -0
  286. package/src/components/chart/useChartHostWidth.ts +26 -0
  287. package/src/components/index.ts +5 -0
@@ -0,0 +1,452 @@
1
+ import {
2
+ Children,
3
+ createContext,
4
+ forwardRef,
5
+ isValidElement,
6
+ useContext,
7
+ useMemo,
8
+ type ReactElement,
9
+ type ReactNode,
10
+ } from 'react';
11
+ import { Text, View, type TextProps, type ViewProps } from 'react-native';
12
+ import {
13
+ Slot,
14
+ StepperRoot,
15
+ StepperStep,
16
+ StepperStepTrigger,
17
+ dataAttributes,
18
+ mergeDataAttributes,
19
+ useStepperContext,
20
+ useStepperIndex,
21
+ useStepperStep,
22
+ type IStepperProps,
23
+ type IStepperStepProps,
24
+ } from '@cdx-ui/primitives';
25
+ import { CheckCircle } from '@cdx-ui/icons';
26
+ import { cn, flattenChildren, mergeRefs } from '@cdx-ui/utils';
27
+ import { Icon } from '../Icon';
28
+ import { ProgressRing } from '../ProgressCircle/ProgressRing';
29
+ import {
30
+ getStepperLayout,
31
+ STEPPER_INDICATOR_SIZE,
32
+ STEPPER_RING_STROKE_WIDTH,
33
+ stepperContentVariants,
34
+ stepperDescriptionVariants,
35
+ stepperIndicatorCheckVariants,
36
+ stepperIndicatorDiscVariants,
37
+ stepperIndicatorNumeralVariants,
38
+ stepperIndicatorRingVariants,
39
+ stepperIndicatorVariants,
40
+ stepperSeparatorVariants,
41
+ stepperStepBodyVariants,
42
+ stepperStepLabelVariants,
43
+ stepperStepMainVariants,
44
+ stepperStepTriggerVariants,
45
+ stepperStepVariants,
46
+ stepperTitleVariants,
47
+ stepperVariants,
48
+ } from './styles';
49
+ import { useStepperLabelFit, type StepperLabelFit } from './useStepperLabelFit';
50
+ import { useStepperRingColors } from './useStepperRingColors';
51
+
52
+ export { useStepperStep } from '@cdx-ui/primitives';
53
+ export type {
54
+ StepperLabelPlacement,
55
+ StepperOrientation,
56
+ StepperStepState,
57
+ } from '@cdx-ui/primitives';
58
+
59
+ const StepperLabelFitContext = createContext<StepperLabelFit>('shrink');
60
+
61
+ /** Counts steps the way `StepperRoot` numbers them, so the label-fit decision resets with them. */
62
+ function countSteps(children: ReactNode, asChild: boolean | undefined): number {
63
+ const source =
64
+ asChild && isValidElement<{ children?: ReactNode }>(children)
65
+ ? children.props.children
66
+ : children;
67
+ return flattenChildren(source).filter((child) => isValidElement(child)).length;
68
+ }
69
+
70
+ const HIDDEN_FROM_AT = {
71
+ 'aria-hidden': true,
72
+ accessibilityElementsHidden: true,
73
+ importantForAccessibility: 'no-hide-descendants',
74
+ } as const;
75
+
76
+ // =============================================================================
77
+ // ROOT
78
+ // =============================================================================
79
+
80
+ export interface StepperProps extends IStepperProps {
81
+ readonly className?: string;
82
+ /**
83
+ * `Stepper.Step` elements. Every direct element child is a step and is numbered by position;
84
+ * arrays and fragments are unwrapped, and `false`/`null` children are skipped.
85
+ */
86
+ readonly children?: ReactNode;
87
+ }
88
+
89
+ const StepperRootComponent = forwardRef<View, StepperProps>(
90
+ (
91
+ { className, style, orientation = 'vertical', labelPlacement = 'end', children, ...props },
92
+ ref,
93
+ ) => {
94
+ const layout = getStepperLayout(orientation, labelPlacement);
95
+ const { fit, measureRef } = useStepperLabelFit(
96
+ layout === 'horizontal-end',
97
+ countSteps(children, props.asChild),
98
+ );
99
+ const rootRef = useMemo(
100
+ () => (measureRef === undefined ? ref : mergeRefs(ref, measureRef)),
101
+ [ref, measureRef],
102
+ );
103
+
104
+ return (
105
+ <StepperLabelFitContext.Provider value={fit}>
106
+ <StepperRoot
107
+ ref={rootRef}
108
+ className={cn(stepperVariants({ layout }), className)}
109
+ style={style}
110
+ orientation={orientation}
111
+ labelPlacement={labelPlacement}
112
+ {...props}
113
+ {...mergeDataAttributes(props, dataAttributes({ slot: 'stepper' }))}
114
+ >
115
+ {children}
116
+ </StepperRoot>
117
+ </StepperLabelFitContext.Provider>
118
+ );
119
+ },
120
+ );
121
+
122
+ StepperRootComponent.displayName = 'Stepper';
123
+
124
+ // =============================================================================
125
+ // STEP
126
+ // =============================================================================
127
+
128
+ export interface StepperStepProps extends IStepperStepProps {
129
+ readonly className?: string;
130
+ /**
131
+ * `Stepper.Indicator`, `Stepper.Title`, `Stepper.Description`, `Stepper.Content` and
132
+ * `Stepper.Separator`. They must be **direct** children: the step sorts them into regions by
133
+ * component identity, so a `memo()`/HOC wrapper is not recognized and renders as content.
134
+ * Only the first of each slot is used. `asChild` skips the sorting.
135
+ */
136
+ readonly children?: ReactNode;
137
+ }
138
+
139
+ function isSlot(child: ReactNode, type: unknown): child is ReactElement {
140
+ return isValidElement(child) && child.type === type;
141
+ }
142
+
143
+ const StepperStepComponent = forwardRef<View, StepperStepProps>(
144
+ ({ asChild, className, style, children, ...props }, ref) => {
145
+ const { orientation, labelPlacement, count } = useStepperContext();
146
+ const layout = getStepperLayout(orientation, labelPlacement);
147
+ const labelFit = useContext(StepperLabelFitContext);
148
+ const isLast = useStepperIndex() === count - 1;
149
+ const stepClass = cn(stepperStepVariants({ layout, isLast, labelFit }), className);
150
+ const slotAttributes = mergeDataAttributes(props, dataAttributes({ slot: 'stepper-step' }));
151
+
152
+ if (asChild) {
153
+ return (
154
+ <StepperStep
155
+ ref={ref}
156
+ asChild
157
+ className={stepClass}
158
+ style={style}
159
+ {...props}
160
+ {...slotAttributes}
161
+ >
162
+ {children}
163
+ </StepperStep>
164
+ );
165
+ }
166
+
167
+ // Indicator, Title and Description form the step trigger, which carries the accessible
168
+ // name; everything else is the body below the title. The Separator sits in the indicator
169
+ // track: before the main column when vertical, after it when horizontal.
170
+ const childArray = Children.toArray(children);
171
+ const indicator = childArray.find((child) => isSlot(child, StepperIndicatorComponent));
172
+ const title = childArray.find((child) => isSlot(child, StepperTitleComponent));
173
+ const description = childArray.find((child) => isSlot(child, StepperDescriptionComponent));
174
+ const separator = childArray.find((child) => isSlot(child, StepperSeparatorComponent));
175
+ const body = childArray.filter(
176
+ (child) =>
177
+ !isSlot(child, StepperIndicatorComponent) &&
178
+ !isSlot(child, StepperTitleComponent) &&
179
+ !isSlot(child, StepperDescriptionComponent) &&
180
+ !isSlot(child, StepperSeparatorComponent),
181
+ );
182
+ const hasLabel = title !== undefined || description !== undefined;
183
+
184
+ return (
185
+ <StepperStep ref={ref} className={stepClass} style={style} {...props} {...slotAttributes}>
186
+ {layout === 'vertical' ? separator : null}
187
+ <View className={cn(stepperStepMainVariants({ layout, labelFit }))}>
188
+ <StepperStepTrigger
189
+ className={stepperStepTriggerVariants({ layout })}
190
+ {...dataAttributes({ slot: 'stepper-step-trigger' })}
191
+ >
192
+ {indicator}
193
+ {hasLabel ? (
194
+ <View className={cn(stepperStepLabelVariants({ layout, labelFit }))}>
195
+ {title}
196
+ {description}
197
+ </View>
198
+ ) : null}
199
+ </StepperStepTrigger>
200
+ {body.length > 0 ? (
201
+ <View className={stepperStepBodyVariants({ layout })}>{body}</View>
202
+ ) : null}
203
+ </View>
204
+ {layout === 'vertical' ? null : separator}
205
+ </StepperStep>
206
+ );
207
+ },
208
+ );
209
+
210
+ StepperStepComponent.displayName = 'Stepper.Step';
211
+
212
+ // =============================================================================
213
+ // INDICATOR
214
+ // =============================================================================
215
+
216
+ export interface StepperIndicatorProps extends ViewProps {
217
+ /** Replaces the whole indicator with the child element via `Slot`. */
218
+ readonly asChild?: boolean;
219
+ readonly className?: string;
220
+ /**
221
+ * Replaces the glyph inside the disc. The disc, tone and progress ring still render.
222
+ * Defaults to a check when the step is complete, otherwise the 1-based step number.
223
+ */
224
+ readonly children?: ReactNode;
225
+ }
226
+
227
+ const StepperIndicatorComponent = forwardRef<View, StepperIndicatorProps>(
228
+ ({ asChild, className, style, children, ...props }, ref) => {
229
+ const { index, isCurrent, isComplete, hasProgress, progress } = useStepperStep();
230
+ const ringColors = useStepperRingColors(isCurrent);
231
+ const currentAttribute = dataAttributes({ current: isCurrent });
232
+ const indicatorClass = cn(stepperIndicatorVariants(), className);
233
+ const indicatorAttributes = mergeDataAttributes(
234
+ props,
235
+ dataAttributes({
236
+ slot: 'stepper-indicator',
237
+ current: isCurrent,
238
+ complete: isComplete,
239
+ progress: hasProgress,
240
+ }),
241
+ );
242
+
243
+ if (asChild) {
244
+ return (
245
+ <Slot
246
+ ref={ref}
247
+ className={indicatorClass}
248
+ style={style}
249
+ {...props}
250
+ {...HIDDEN_FROM_AT}
251
+ {...indicatorAttributes}
252
+ >
253
+ {children}
254
+ </Slot>
255
+ );
256
+ }
257
+
258
+ const hasCustomGlyph = children !== undefined && children !== null;
259
+
260
+ return (
261
+ <View
262
+ ref={ref}
263
+ className={indicatorClass}
264
+ style={style}
265
+ {...props}
266
+ {...HIDDEN_FROM_AT}
267
+ {...indicatorAttributes}
268
+ >
269
+ {hasProgress ? (
270
+ <View className={stepperIndicatorRingVariants()}>
271
+ <ProgressRing
272
+ size={STEPPER_INDICATOR_SIZE}
273
+ strokeWidth={STEPPER_RING_STROKE_WIDTH}
274
+ value={progress}
275
+ trackColor={ringColors.track}
276
+ indicatorColor={ringColors.indicator}
277
+ />
278
+ </View>
279
+ ) : null}
280
+ {isComplete && !hasCustomGlyph ? (
281
+ <Icon
282
+ as={CheckCircle}
283
+ filled
284
+ className={stepperIndicatorCheckVariants()}
285
+ {...currentAttribute}
286
+ />
287
+ ) : (
288
+ <View className={stepperIndicatorDiscVariants()} {...currentAttribute}>
289
+ {hasCustomGlyph ? (
290
+ children
291
+ ) : (
292
+ <Text className={stepperIndicatorNumeralVariants()} {...currentAttribute}>
293
+ {String(index + 1)}
294
+ </Text>
295
+ )}
296
+ </View>
297
+ )}
298
+ </View>
299
+ );
300
+ },
301
+ );
302
+
303
+ StepperIndicatorComponent.displayName = 'Stepper.Indicator';
304
+
305
+ // =============================================================================
306
+ // TITLE
307
+ // =============================================================================
308
+
309
+ export interface StepperTitleProps extends TextProps {
310
+ readonly asChild?: boolean;
311
+ readonly className?: string;
312
+ readonly children?: ReactNode;
313
+ }
314
+
315
+ const StepperTitleComponent = forwardRef<Text, StepperTitleProps>(
316
+ ({ asChild, className, style, ...props }, ref) => {
317
+ const { isCurrent, orientation, labelPlacement } = useStepperStep();
318
+ const isCentered = getStepperLayout(orientation, labelPlacement) === 'horizontal-bottom';
319
+ const Comp = asChild ? Slot : Text;
320
+
321
+ return (
322
+ <Comp
323
+ ref={ref}
324
+ className={cn(stepperTitleVariants({ isCentered }), className)}
325
+ style={style}
326
+ {...props}
327
+ {...mergeDataAttributes(
328
+ props,
329
+ dataAttributes({ slot: 'stepper-title', current: isCurrent }),
330
+ )}
331
+ />
332
+ );
333
+ },
334
+ );
335
+
336
+ StepperTitleComponent.displayName = 'Stepper.Title';
337
+
338
+ // =============================================================================
339
+ // DESCRIPTION
340
+ // =============================================================================
341
+
342
+ export interface StepperDescriptionProps extends TextProps {
343
+ readonly asChild?: boolean;
344
+ readonly className?: string;
345
+ readonly children?: ReactNode;
346
+ }
347
+
348
+ const StepperDescriptionComponent = forwardRef<Text, StepperDescriptionProps>(
349
+ ({ asChild, className, style, ...props }, ref) => {
350
+ const { orientation, labelPlacement } = useStepperStep();
351
+ const isCentered = getStepperLayout(orientation, labelPlacement) === 'horizontal-bottom';
352
+ const Comp = asChild ? Slot : Text;
353
+
354
+ return (
355
+ <Comp
356
+ ref={ref}
357
+ className={cn(stepperDescriptionVariants({ isCentered }), className)}
358
+ style={style}
359
+ {...props}
360
+ {...mergeDataAttributes(props, dataAttributes({ slot: 'stepper-description' }))}
361
+ />
362
+ );
363
+ },
364
+ );
365
+
366
+ StepperDescriptionComponent.displayName = 'Stepper.Description';
367
+
368
+ // =============================================================================
369
+ // CONTENT
370
+ // =============================================================================
371
+
372
+ export interface StepperContentProps extends ViewProps {
373
+ readonly asChild?: boolean;
374
+ readonly className?: string;
375
+ }
376
+
377
+ const StepperContentComponent = forwardRef<View, StepperContentProps>(
378
+ ({ asChild, className, style, ...props }, ref) => {
379
+ const Comp = asChild ? Slot : View;
380
+
381
+ return (
382
+ <Comp
383
+ ref={ref}
384
+ className={cn(stepperContentVariants(), className)}
385
+ style={style}
386
+ {...props}
387
+ {...mergeDataAttributes(props, dataAttributes({ slot: 'stepper-content' }))}
388
+ />
389
+ );
390
+ },
391
+ );
392
+
393
+ StepperContentComponent.displayName = 'Stepper.Content';
394
+
395
+ // =============================================================================
396
+ // SEPARATOR
397
+ // =============================================================================
398
+
399
+ export interface StepperSeparatorProps extends ViewProps {
400
+ readonly asChild?: boolean;
401
+ readonly className?: string;
402
+ }
403
+
404
+ const StepperSeparatorComponent = forwardRef<View, StepperSeparatorProps>(
405
+ ({ asChild, className, style, ...props }, ref) => {
406
+ const { isLast, orientation, labelPlacement } = useStepperStep();
407
+
408
+ if (isLast) {
409
+ return null;
410
+ }
411
+
412
+ const Comp = asChild ? Slot : View;
413
+
414
+ return (
415
+ <Comp
416
+ ref={ref}
417
+ className={cn(
418
+ stepperSeparatorVariants({ layout: getStepperLayout(orientation, labelPlacement) }),
419
+ className,
420
+ )}
421
+ style={style}
422
+ {...props}
423
+ {...HIDDEN_FROM_AT}
424
+ {...mergeDataAttributes(props, dataAttributes({ slot: 'stepper-separator' }))}
425
+ />
426
+ );
427
+ },
428
+ );
429
+
430
+ StepperSeparatorComponent.displayName = 'Stepper.Separator';
431
+
432
+ // =============================================================================
433
+ // COMPOUND EXPORT
434
+ // =============================================================================
435
+
436
+ type StepperCompoundComponent = typeof StepperRootComponent & {
437
+ Step: typeof StepperStepComponent;
438
+ Indicator: typeof StepperIndicatorComponent;
439
+ Title: typeof StepperTitleComponent;
440
+ Description: typeof StepperDescriptionComponent;
441
+ Content: typeof StepperContentComponent;
442
+ Separator: typeof StepperSeparatorComponent;
443
+ };
444
+
445
+ export const Stepper = Object.assign(StepperRootComponent, {
446
+ Step: StepperStepComponent,
447
+ Indicator: StepperIndicatorComponent,
448
+ Title: StepperTitleComponent,
449
+ Description: StepperDescriptionComponent,
450
+ Content: StepperContentComponent,
451
+ Separator: StepperSeparatorComponent,
452
+ }) as StepperCompoundComponent;
@@ -0,0 +1,234 @@
1
+ import { Platform } from 'react-native';
2
+ import type { StepperLabelPlacement, StepperOrientation } from '@cdx-ui/primitives';
3
+ import { cva, type VariantProps } from '@cdx-ui/utils';
4
+ import { TRANSITION_COLORS } from '../../styles/constants';
5
+
6
+ /** Indicator frame in px. The ring is drawn at this size around the 24px disc. */
7
+ export const STEPPER_INDICATOR_SIZE = 34;
8
+ export const STEPPER_RING_STROKE_WIDTH = 3;
9
+
10
+ export type StepperLayout = 'vertical' | 'horizontal-end' | 'horizontal-bottom';
11
+
12
+ export function getStepperLayout(
13
+ orientation: StepperOrientation,
14
+ labelPlacement: StepperLabelPlacement,
15
+ ): StepperLayout {
16
+ if (orientation === 'vertical') {
17
+ return 'vertical';
18
+ }
19
+ return labelPlacement === 'bottom' ? 'horizontal-bottom' : 'horizontal-end';
20
+ }
21
+
22
+ // Horizontal layouts:
23
+ // - `horizontal-end` (label after the indicator): steps start at their content width and every
24
+ // step but the last grows; that growth goes to its in-flow separator. With `labelFit: 'words'`
25
+ // (web, while the row fits) steps keep their min-content width so labels wrap between words;
26
+ // with `'shrink'` RN Web's `min-width: 0` lets them shrink further so the row never overflows.
27
+ // - `horizontal-bottom` (label centered below): equal columns; the separator is absolute, so it
28
+ // never affects column layout.
29
+ export const stepperVariants = cva([], {
30
+ variants: {
31
+ layout: {
32
+ vertical: 'flex-col',
33
+ 'horizontal-end': 'w-full flex-row items-start',
34
+ 'horizontal-bottom': 'w-full flex-row items-start',
35
+ },
36
+ },
37
+ defaultVariants: {
38
+ layout: 'vertical',
39
+ },
40
+ });
41
+
42
+ export const stepperStepVariants = cva([], {
43
+ variants: {
44
+ layout: {
45
+ vertical: 'flex-row',
46
+ 'horizontal-end': 'min-w-0 flex-row items-start',
47
+ 'horizontal-bottom': 'relative min-w-0 flex-1 basis-0 items-center',
48
+ },
49
+ isLast: {
50
+ true: '',
51
+ false: '',
52
+ },
53
+ labelFit: {
54
+ words: '',
55
+ shrink: '',
56
+ },
57
+ },
58
+ compoundVariants: [
59
+ { layout: 'horizontal-end', isLast: false, className: 'grow shrink basis-auto pe-2' },
60
+ { layout: 'horizontal-end', isLast: true, className: 'shrink' },
61
+ { layout: 'horizontal-end', labelFit: 'words', className: 'min-w-auto' },
62
+ ],
63
+ defaultVariants: {
64
+ layout: 'vertical',
65
+ isLast: false,
66
+ labelFit: 'shrink',
67
+ },
68
+ });
69
+
70
+ // Unexported layout wrappers inside `Stepper.Step` (no `data-slot`).
71
+ export const stepperStepMainVariants = cva(['min-w-0'], {
72
+ variants: {
73
+ layout: {
74
+ vertical: 'flex-1',
75
+ 'horizontal-end': 'shrink',
76
+ 'horizontal-bottom': 'items-center self-stretch px-2',
77
+ },
78
+ labelFit: {
79
+ words: '',
80
+ shrink: '',
81
+ },
82
+ },
83
+ compoundVariants: [{ layout: 'horizontal-end', labelFit: 'words', className: 'min-w-auto' }],
84
+ defaultVariants: {
85
+ layout: 'vertical',
86
+ labelFit: 'shrink',
87
+ },
88
+ });
89
+
90
+ // Each layout pads the hover and press fill and cancels it with an equal negative margin, so a
91
+ // step keeps its geometry when it becomes clickable. The 24px disc sits 5px inside its 34px
92
+ // frame, so sides bounded by the disc get 4px and sides bounded by text get 9px; the fill then
93
+ // looks evenly padded. Each layout aligns the trigger to its content (`self-start`, or
94
+ // `self-center` under a centered label) so the fill hugs the indicator and label instead of
95
+ // spanning the step. Hover, press and focus-visible use the `Tabs` hover tokens and the Forge
96
+ // focus ring until the designer specifies clickable-step states.
97
+ export const stepperStepTriggerVariants = cva(
98
+ [
99
+ 'rounded-md',
100
+ TRANSITION_COLORS,
101
+ Platform.select({
102
+ default: 'data-[active=true]:bg-surface-secondary-active',
103
+ web: [
104
+ 'outline-none data-[clickable=true]:cursor-pointer',
105
+ 'data-[hover=true]:bg-surface-secondary-hover data-[active=true]:data-[hover=true]:bg-surface-secondary-active',
106
+ 'web:data-[focus-visible=true]:ring-2 web:data-[focus-visible=true]:ring-stroke-focus web:data-[focus-visible=true]:ring-offset-2',
107
+ ].join(' '),
108
+ }),
109
+ ],
110
+ {
111
+ variants: {
112
+ layout: {
113
+ vertical: 'flex-row items-start self-start gap-2 -my-1 -ms-1 -me-[9px] py-1 ps-1 pe-[9px]',
114
+ 'horizontal-end':
115
+ 'flex-row items-start self-start gap-2 -my-1 -ms-1 -me-[9px] py-1 ps-1 pe-[9px]',
116
+ 'horizontal-bottom':
117
+ 'min-w-0 items-center self-center gap-1 -mx-[9px] -mt-1 -mb-[9px] px-[9px] pt-1 pb-[9px]',
118
+ },
119
+ },
120
+ defaultVariants: {
121
+ layout: 'vertical',
122
+ },
123
+ },
124
+ );
125
+
126
+ export const stepperStepLabelVariants = cva(['min-w-0'], {
127
+ variants: {
128
+ layout: {
129
+ vertical: 'shrink py-[7px]',
130
+ 'horizontal-end': 'shrink py-[7px]',
131
+ 'horizontal-bottom': 'self-stretch',
132
+ },
133
+ labelFit: {
134
+ words: '',
135
+ shrink: '',
136
+ },
137
+ },
138
+ compoundVariants: [{ layout: 'horizontal-end', labelFit: 'words', className: 'min-w-auto' }],
139
+ defaultVariants: {
140
+ layout: 'vertical',
141
+ labelFit: 'shrink',
142
+ },
143
+ });
144
+
145
+ export const stepperStepBodyVariants = cva([], {
146
+ variants: {
147
+ layout: {
148
+ vertical: 'ps-[42px]',
149
+ 'horizontal-end': 'ps-[42px]',
150
+ 'horizontal-bottom': 'self-stretch',
151
+ },
152
+ },
153
+ defaultVariants: {
154
+ layout: 'vertical',
155
+ },
156
+ });
157
+
158
+ // Indicator, disc, numeral and check each emit their own `data-current` because native
159
+ // Uniwind cannot style a child from its parent's data attributes.
160
+ export const stepperIndicatorVariants = cva([
161
+ 'relative size-[34px] shrink-0 items-center justify-center',
162
+ ]);
163
+
164
+ export const stepperIndicatorRingVariants = cva(['pointer-events-none absolute inset-0']);
165
+
166
+ export const stepperIndicatorDiscVariants = cva([
167
+ 'size-6 items-center justify-center rounded-full',
168
+ 'bg-surface-neutral-strong data-[current=true]:bg-surface-brand-strong',
169
+ ]);
170
+
171
+ export const stepperIndicatorNumeralVariants = cva([
172
+ 'body-sm font-medium',
173
+ 'text-content-neutral-on-strong data-[current=true]:text-content-brand-on-strong',
174
+ ]);
175
+
176
+ export const stepperIndicatorCheckVariants = cva([
177
+ 'size-7 text-content-neutral data-[current=true]:text-content-brand',
178
+ ]);
179
+
180
+ // Native text alignment does not inherit from a parent `View`, so centered labels set it on
181
+ // each text part.
182
+ export const stepperTitleVariants = cva(
183
+ [
184
+ 'body-md text-content-secondary',
185
+ 'data-[current=true]:font-medium data-[current=true]:text-content-primary',
186
+ ],
187
+ {
188
+ variants: {
189
+ isCentered: {
190
+ true: 'text-center',
191
+ false: '',
192
+ },
193
+ },
194
+ defaultVariants: {
195
+ isCentered: false,
196
+ },
197
+ },
198
+ );
199
+
200
+ export const stepperDescriptionVariants = cva(['body-sm text-content-secondary'], {
201
+ variants: {
202
+ isCentered: {
203
+ true: 'text-center',
204
+ false: '',
205
+ },
206
+ },
207
+ defaultVariants: {
208
+ isCentered: false,
209
+ },
210
+ });
211
+
212
+ export const stepperContentVariants = cva(['gap-2 py-2']);
213
+
214
+ // Vertical: rendered before the step's main column with zero net width, centered under the
215
+ // 34px frame; `self-stretch` follows the title and content.
216
+ // `horizontal-end`: in flow after the label, centered on the frame's height; it takes the
217
+ // step's growth, and the step's `pe-2` leaves 8px before the next indicator.
218
+ // `horizontal-bottom`: absolute from this column's center to the next one's (columns are equal
219
+ // and have no gap), inset 25px at each end: half the 34px frame plus 8px.
220
+ // `z-10` keeps the line above a clickable trigger's hover and press fill.
221
+ export const stepperSeparatorVariants = cva(['z-10 bg-stroke-secondary'], {
222
+ variants: {
223
+ layout: {
224
+ vertical: 'relative mt-[34px] min-h-6 w-px self-stretch ms-[16.5px] -me-[17.5px]',
225
+ 'horizontal-end': 'relative mt-[16.5px] h-px min-w-6 flex-1 ms-2',
226
+ 'horizontal-bottom': 'absolute top-[16.5px] start-[50%] end-[-50%] h-px ms-[25px] me-[25px]',
227
+ },
228
+ },
229
+ defaultVariants: {
230
+ layout: 'vertical',
231
+ },
232
+ });
233
+
234
+ export type StepperVariantProps = VariantProps<typeof stepperVariants>;
@@ -0,0 +1,21 @@
1
+ import type { RefCallback } from 'react';
2
+ import type { View } from 'react-native';
3
+
4
+ /**
5
+ * How `horizontal-end` labels give way when the row runs out of room. `'words'` keeps each
6
+ * step at least as wide as its longest word, so labels wrap only between words; `'shrink'` lets
7
+ * steps shrink below that so the row never overflows.
8
+ */
9
+ export type StepperLabelFit = 'words' | 'shrink';
10
+
11
+ export interface StepperLabelFitResult {
12
+ readonly fit: StepperLabelFit;
13
+ readonly measureRef: RefCallback<View> | undefined;
14
+ }
15
+
16
+ const NATIVE_RESULT: StepperLabelFitResult = { fit: 'shrink', measureRef: undefined };
17
+
18
+ /** Native layout has no min-content sizing, so steps always shrink to fit. */
19
+ export function useStepperLabelFit(_enabled: boolean, _count: number): StepperLabelFitResult {
20
+ return NATIVE_RESULT;
21
+ }