@registrucentras/rc-ses-react-components 2.7.3 → 3.0.0-rc.0

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 (289) hide show
  1. package/dist/assets/icons/phosphorIcons.d.ts +4 -0
  2. package/dist/components/common/Accordion/hooks/useAccordionController.d.ts +2 -1
  3. package/dist/components/common/Accordion/index.d.ts +18 -4
  4. package/dist/components/common/Accordion/types/AccordionControllerState.d.ts +1 -0
  5. package/dist/components/common/Card/index.d.ts +3 -0
  6. package/dist/components/common/CheckboxMark/index.d.ts +8 -0
  7. package/dist/components/common/DataPagination/components/ExpandButton.d.ts +7 -0
  8. package/dist/components/common/DataPagination/components/PaginationButton.d.ts +2 -1
  9. package/dist/components/common/DataPagination/index.d.ts +13 -3
  10. package/dist/components/common/DataPagination/paginationModel.d.ts +4 -0
  11. package/dist/components/common/Divider/index.d.ts +6 -0
  12. package/dist/components/common/EmptyState/index.d.ts +21 -0
  13. package/dist/components/common/IconWithSquareBackground/index.d.ts +2 -2
  14. package/dist/components/common/ImageCard/index.d.ts +5 -0
  15. package/dist/components/common/LinkTile/index.d.ts +11 -0
  16. package/dist/components/common/RadioMark/index.d.ts +8 -0
  17. package/dist/components/common/StepCard/StepCardFooter/index.d.ts +1 -1
  18. package/dist/components/common/TitleBlock/types.d.ts +4 -2
  19. package/dist/components/form/components/FormControlWrapper/index.d.ts +2 -1
  20. package/dist/components/form/inputs/Datepicker/RangeDatepicker.d.ts +23 -0
  21. package/dist/components/form/inputs/Datepicker/SingleDatepicker.d.ts +24 -0
  22. package/dist/components/form/inputs/Datepicker/components/CalendarViewsHeader.d.ts +18 -0
  23. package/dist/components/form/inputs/Datepicker/index.d.ts +10 -14
  24. package/dist/components/form/inputs/Datepicker/rangeModel.d.ts +4 -0
  25. package/dist/components/form/inputs/FileDropzone.d.ts +2 -2
  26. package/dist/components/form/inputs/RadioButtonGroup.d.ts +1 -0
  27. package/dist/components/form/inputs/Select/Select.styles.d.ts +84 -0
  28. package/dist/components/form/inputs/Select/components/OptionCheckbox.d.ts +2 -1
  29. package/dist/components/form/inputs/TextField.d.ts +27 -12
  30. package/dist/components/form/inputs/TextField.styles.d.ts +101 -0
  31. package/dist/components/layout/ServiceWizardStepper/stepperTokens.d.ts +5 -0
  32. package/dist/components/loaders/Loader/index.d.ts +12 -9
  33. package/dist/components/overlays/BottomSheet/index.d.ts +3 -2
  34. package/dist/components/overlays/Dialog/index.d.ts +1 -1
  35. package/dist/components/storybook/FileUploadTokenPreview.d.ts +4 -0
  36. package/dist/components/storybook/TabsTokenPreview.d.ts +3 -0
  37. package/dist/components/storybook/TokenDocs.d.ts +74 -0
  38. package/dist/library/index.d.ts +30 -1
  39. package/dist/registrucentras-rc-ses-react-components.cjs +2 -2
  40. package/dist/registrucentras-rc-ses-react-components.js +11143 -8378
  41. package/dist/theme/backdropTokens.d.ts +6 -0
  42. package/dist/theme/borderTokens.d.ts +33 -0
  43. package/dist/theme/cards.d.ts +42 -73
  44. package/dist/theme/colorTokens.d.ts +146 -0
  45. package/dist/theme/effectTokens.d.ts +9 -0
  46. package/dist/theme/layoutTokens.d.ts +12 -0
  47. package/dist/theme/light/MuiAccordion.d.ts +2 -2
  48. package/dist/theme/light/MuiAccordionSummary.d.ts +19 -0
  49. package/dist/theme/light/MuiButton.d.ts +7 -0
  50. package/dist/theme/light/MuiInputBase.d.ts +2 -0
  51. package/dist/theme/light/MuiPickerPopper.d.ts +3 -0
  52. package/dist/theme/light/MuiTypography.d.ts +0 -14
  53. package/dist/theme/palette.d.ts +8 -0
  54. package/dist/theme/sizeTokens.d.ts +20 -0
  55. package/dist/theme/spacingRoleBasedTokens.d.ts +38 -0
  56. package/dist/theme/spacingTokens.d.ts +97 -0
  57. package/dist/theme/tokenTheme.d.ts +13 -0
  58. package/dist/theme/typographyTokens.d.ts +104 -0
  59. package/package.json +2 -2
  60. package/src/assets/icons/phosphorIcons.ts +1 -0
  61. package/src/components/common/Accordion/hooks/useAccordionController.tsx +39 -7
  62. package/src/components/common/Accordion/index.test.tsx +132 -0
  63. package/src/components/common/Accordion/index.tsx +302 -25
  64. package/src/components/common/Accordion/types/AccordionControllerState.ts +1 -0
  65. package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemLeading.tsx +3 -3
  66. package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemTrailing.tsx +8 -3
  67. package/src/components/common/AdvancedList/components/AdvancedListItem/index.tsx +3 -2
  68. package/src/components/common/AdvancedList/components/AdvancedListItemShell/index.test.tsx +3 -3
  69. package/src/components/common/AdvancedList/components/AdvancedListItemShell/index.tsx +23 -19
  70. package/src/components/common/AdvancedList/index.test.tsx +4 -2
  71. package/src/components/common/Alert/index.tsx +10 -6
  72. package/src/components/common/Badge/index.tsx +50 -37
  73. package/src/components/common/Button/index.tsx +12 -10
  74. package/src/components/common/Card/index.tsx +6 -1
  75. package/src/components/common/CardShell/index.test.tsx +16 -6
  76. package/src/components/common/CheckboxMark/index.tsx +86 -0
  77. package/src/components/common/DataPagination/components/DataPaginationSkeleton.tsx +9 -7
  78. package/src/components/common/DataPagination/components/ExpandButton.tsx +48 -0
  79. package/src/components/common/DataPagination/components/PaginationButton.tsx +48 -21
  80. package/src/components/common/DataPagination/index.test.tsx +229 -12
  81. package/src/components/common/DataPagination/index.tsx +135 -60
  82. package/src/components/common/DataPagination/paginationModel.ts +35 -0
  83. package/src/components/common/Divider/index.test.tsx +33 -0
  84. package/src/components/common/Divider/index.tsx +52 -0
  85. package/src/components/common/EmptyState/index.test.tsx +56 -0
  86. package/src/components/common/EmptyState/index.tsx +211 -0
  87. package/src/components/common/FilterChip/index.tsx +24 -19
  88. package/src/components/common/IconWithCircularBackground.tsx +24 -6
  89. package/src/components/common/IconWithSquareBackground/index.test.tsx +14 -2
  90. package/src/components/common/IconWithSquareBackground/index.tsx +36 -17
  91. package/src/components/common/ImageCard/index.test.tsx +16 -0
  92. package/src/components/common/ImageCard/index.tsx +54 -1
  93. package/src/components/common/LinkTile/index.test.tsx +57 -0
  94. package/src/components/common/LinkTile/index.tsx +136 -0
  95. package/src/components/common/ListWithIcons/components/ListWithIconsItem.tsx +39 -23
  96. package/src/components/common/ListWithIcons/index.test.tsx +20 -9
  97. package/src/components/common/ListWithIcons/index.tsx +6 -6
  98. package/src/components/common/Popover/index.tsx +11 -1
  99. package/src/components/common/RadioMark/index.tsx +76 -0
  100. package/src/components/common/SegmentedControl/components/SegmentButton/index.tsx +49 -25
  101. package/src/components/common/SegmentedControl/index.tsx +10 -6
  102. package/src/components/common/SelectableCardList/components/SelectableCardListItem.tsx +7 -5
  103. package/src/components/common/SelectableCardList/index.test.tsx +8 -6
  104. package/src/components/common/SelectionMarks.test.tsx +92 -0
  105. package/src/components/common/ServiceLinks/ServiceLinkItem/index.tsx +20 -11
  106. package/src/components/common/ServiceLinks/index.tsx +3 -3
  107. package/src/components/common/SideNav/SideNavLayout.tsx +6 -1
  108. package/src/components/common/SideNav/components/SideNavPill.tsx +24 -12
  109. package/src/components/common/SideNav/components/SideNavPillList.tsx +18 -12
  110. package/src/components/common/SideNav/components/SideNavRow.tsx +22 -15
  111. package/src/components/common/SideNav/index.tsx +10 -9
  112. package/src/components/common/Snackbar/config.ts +27 -8
  113. package/src/components/common/Snackbar/index.tsx +39 -16
  114. package/src/components/common/StepCard/StepCardFooter/index.tsx +28 -6
  115. package/src/components/common/StepCard/index.tsx +18 -6
  116. package/src/components/common/Switch/index.tsx +10 -4
  117. package/src/components/common/Tabs/TabPanel.tsx +6 -3
  118. package/src/components/common/Tabs/TabsWrapper.tsx +15 -7
  119. package/src/components/common/TitleBlock/index.test.tsx +14 -17
  120. package/src/components/common/TitleBlock/index.tsx +120 -15
  121. package/src/components/common/TitleBlock/types.ts +4 -2
  122. package/src/components/common/Tooltip/index.tsx +32 -3
  123. package/src/components/form/components/FormControlWrapper/index.tsx +43 -14
  124. package/src/components/form/inputs/CheckboxFormControl.tsx +25 -13
  125. package/src/components/form/inputs/Datepicker/RangeDatepicker.tsx +356 -0
  126. package/src/components/form/inputs/Datepicker/SingleDatepicker.tsx +207 -0
  127. package/src/components/form/inputs/Datepicker/components/CalendarViewsHeader.tsx +335 -0
  128. package/src/components/form/inputs/Datepicker/components/RcSesDatepickerCalendarHeader.tsx +22 -10
  129. package/src/components/form/inputs/Datepicker/index.test.tsx +23 -18
  130. package/src/components/form/inputs/Datepicker/index.tsx +20 -150
  131. package/src/components/form/inputs/Datepicker/rangeModel.test.ts +35 -0
  132. package/src/components/form/inputs/Datepicker/rangeModel.ts +25 -0
  133. package/src/components/form/inputs/FileDropzone.tsx +73 -46
  134. package/src/components/form/inputs/FileUpload.tsx +25 -16
  135. package/src/components/form/inputs/NumberStepper.tsx +36 -14
  136. package/src/components/form/inputs/PhoneInputFormControl/components/AutocompleteInput.tsx +10 -5
  137. package/src/components/form/inputs/PhoneInputFormControl/components/ListboxComponent.tsx +7 -1
  138. package/src/components/form/inputs/PhoneInputFormControl/components/PopperComponent.tsx +5 -2
  139. package/src/components/form/inputs/PhoneInputFormControl/components/RowComponent.tsx +9 -5
  140. package/src/components/form/inputs/PhoneInputFormControl/index.tsx +48 -24
  141. package/src/components/form/inputs/RadioButtonGroup.tsx +14 -6
  142. package/src/components/form/inputs/Select/Select.styles.ts +76 -0
  143. package/src/components/form/inputs/Select/components/OptionCheckbox.tsx +6 -33
  144. package/src/components/form/inputs/Select/index.tsx +124 -86
  145. package/src/components/form/inputs/SimpleCheckbox.tsx +10 -3
  146. package/src/components/form/inputs/TextField.presets.test.tsx +284 -0
  147. package/src/components/form/inputs/TextField.styles.ts +96 -0
  148. package/src/components/form/inputs/TextField.test.tsx +153 -0
  149. package/src/components/form/inputs/TextField.tsx +315 -42
  150. package/src/components/layout/Footer/index.test.tsx +1 -1
  151. package/src/components/layout/Footer/index.tsx +17 -7
  152. package/src/components/layout/ServiceFormActions.tsx +5 -1
  153. package/src/components/layout/ServiceFormContainer/AccordionFormContainer/index.tsx +3 -3
  154. package/src/components/layout/ServiceHeader.tsx +19 -19
  155. package/src/components/layout/ServiceWizardStepper/ServiceWizardStepper.css +10 -10
  156. package/src/components/layout/ServiceWizardStepper/StepConnector.tsx +8 -5
  157. package/src/components/layout/ServiceWizardStepper/components/CustomStepIcon.tsx +22 -7
  158. package/src/components/layout/ServiceWizardStepper/components/HorizontalStepperButton.tsx +15 -11
  159. package/src/components/layout/ServiceWizardStepper/components/StyledStepLabel.tsx +28 -11
  160. package/src/components/layout/ServiceWizardStepper/stepperTokens.ts +8 -0
  161. package/src/components/loaders/FullPageLoader/index.test.tsx +18 -7
  162. package/src/components/loaders/FullPageLoader/index.tsx +14 -9
  163. package/src/components/loaders/Loader/index.tsx +48 -17
  164. package/src/components/overlays/BottomSheet/index.test.tsx +36 -3
  165. package/src/components/overlays/BottomSheet/index.tsx +54 -21
  166. package/src/components/overlays/Dialog/index.tsx +5 -23
  167. package/src/components/overlays/Drawer/index.tsx +29 -14
  168. package/src/components/overlays/Modal/index.tsx +46 -8
  169. package/src/components/storybook/FileUploadTokenPreview.tsx +68 -0
  170. package/src/components/storybook/TabsTokenPreview.tsx +58 -0
  171. package/src/components/storybook/TokenDocs.tsx +347 -0
  172. package/src/examples/MultipleStepForm/components/TermsAndConditionsForm.tsx +5 -1
  173. package/src/i18n/namespaces/input/en.json +48 -4
  174. package/src/i18n/namespaces/input/lt.json +48 -4
  175. package/src/library/index.ts +50 -0
  176. package/src/stories/atoms/Badge.stories.tsx +2 -1
  177. package/src/stories/atoms/Button.stories.tsx +124 -6
  178. package/src/stories/atoms/CheckboxMark.stories.tsx +79 -0
  179. package/src/stories/atoms/Divider.stories.tsx +129 -0
  180. package/src/stories/atoms/FilterChip.stories.tsx +9 -1
  181. package/src/stories/atoms/IconWithSquareBackground.stories.tsx +7 -7
  182. package/src/stories/atoms/Icons.stories.tsx +1 -1
  183. package/src/stories/atoms/NumberStepper.stories.tsx +44 -0
  184. package/src/stories/atoms/PhoneInput.stories.tsx +42 -0
  185. package/src/stories/atoms/RadioMark.stories.tsx +132 -0
  186. package/src/stories/atoms/Select.stories.tsx +139 -2
  187. package/src/stories/atoms/SimpleCheckbox.stories.tsx +74 -0
  188. package/src/stories/atoms/Switch.stories.tsx +46 -1
  189. package/src/stories/atoms/TextField.stories.tsx +508 -0
  190. package/src/stories/atoms/Tooltip.stories.tsx +5 -0
  191. package/src/stories/fixtures/foundations/Borders.stories.tsx +84 -0
  192. package/src/stories/fixtures/foundations/Effects.stories.tsx +204 -0
  193. package/src/stories/fixtures/foundations/Layout.stories.tsx +76 -0
  194. package/src/stories/fixtures/foundations/Sizes.stories.tsx +42 -0
  195. package/src/stories/fixtures/foundations/Spacing.stories.tsx +48 -0
  196. package/src/stories/fixtures/foundations/Typography.stories.tsx +49 -0
  197. package/src/stories/foundations/Borders.stories.tsx +179 -0
  198. package/src/stories/foundations/Colors.stories.tsx +253 -0
  199. package/src/stories/foundations/Effects.stories.tsx +116 -0
  200. package/src/stories/foundations/Layout.stories.tsx +177 -0
  201. package/src/stories/foundations/Sizes.stories.tsx +123 -0
  202. package/src/stories/foundations/Spacing.stories.tsx +159 -0
  203. package/src/stories/foundations/ThemeAdapter.stories.tsx +389 -0
  204. package/src/stories/foundations/Typography.stories.tsx +148 -0
  205. package/src/stories/molecules/Alert.stories.tsx +18 -0
  206. package/src/stories/molecules/Breadcrumbs.stories.tsx +51 -0
  207. package/src/stories/molecules/Card.stories.tsx +1 -1
  208. package/src/stories/molecules/CardShell.stories.tsx +1 -0
  209. package/src/stories/molecules/DatePicker.stories.tsx +133 -3
  210. package/src/stories/molecules/EmptyState.stories.tsx +106 -0
  211. package/src/stories/molecules/FormControlWrapper.stories.tsx +59 -0
  212. package/src/stories/molecules/LinkTile.stories.tsx +151 -0
  213. package/src/stories/molecules/ListWithIcons.stories.tsx +27 -2
  214. package/src/stories/molecules/RadioButtonGroup.stories.tsx +23 -0
  215. package/src/stories/molecules/SegmentedControl.stories.tsx +62 -1
  216. package/src/stories/molecules/Tabs.stories.tsx +4 -0
  217. package/src/stories/molecules/TitleBlock.stories.tsx +16 -16
  218. package/src/stories/organisms/Accordion.stories.tsx +132 -0
  219. package/src/stories/organisms/AdvancedListItemShell.stories.tsx +63 -23
  220. package/src/stories/organisms/BottomSheet.stories.tsx +48 -1
  221. package/src/stories/organisms/DataPagination.stories.tsx +127 -3
  222. package/src/stories/organisms/Dialog.stories.tsx +13 -0
  223. package/src/stories/organisms/FileDropzone.stories.tsx +6 -0
  224. package/src/stories/organisms/FileUpload.stories.tsx +4 -0
  225. package/src/stories/organisms/Footer.stories.tsx +20 -0
  226. package/src/stories/organisms/Modal.stories.tsx +53 -0
  227. package/src/stories/organisms/ServiceHeader.stories.tsx +25 -3
  228. package/src/stories/organisms/ServiceLinks.stories.tsx +1 -1
  229. package/src/stories/organisms/ServiceWizardStepper.stories.tsx +37 -1
  230. package/src/stories/organisms/SideNav.stories.tsx +8 -1
  231. package/src/theme/backdropTokens.test.ts +11 -0
  232. package/src/theme/backdropTokens.ts +11 -0
  233. package/src/theme/borderTokens.test.ts +59 -0
  234. package/src/theme/borderTokens.ts +36 -0
  235. package/src/theme/cards.ts +28 -28
  236. package/src/theme/colorTokens.test.ts +66 -0
  237. package/src/theme/colorTokens.ts +87 -0
  238. package/src/theme/effectTokens.test.ts +29 -0
  239. package/src/theme/effectTokens.ts +11 -0
  240. package/src/theme/layoutTokens.test.ts +42 -0
  241. package/src/theme/layoutTokens.ts +14 -0
  242. package/src/theme/light/MuiAccordion.tsx +30 -26
  243. package/src/theme/light/MuiAccordionDetails.ts +10 -5
  244. package/src/theme/light/MuiAccordionSummary.tsx +31 -17
  245. package/src/theme/light/MuiAlert.tsx +42 -65
  246. package/src/theme/light/MuiAutocomplete.ts +14 -7
  247. package/src/theme/light/MuiBreadcrumbs.tsx +17 -9
  248. package/src/theme/light/MuiButton.tsx +213 -204
  249. package/src/theme/light/MuiCard.tsx +5 -4
  250. package/src/theme/light/MuiCheckbox.ts +45 -14
  251. package/src/theme/light/MuiChip.tsx +3 -1
  252. package/src/theme/light/MuiDialog.ts +45 -6
  253. package/src/theme/light/MuiFormControl.ts +19 -9
  254. package/src/theme/light/MuiFormControlLabel.ts +16 -25
  255. package/src/theme/light/MuiFormGroup.ts +29 -26
  256. package/src/theme/light/MuiFormHelperText.ts +15 -4
  257. package/src/theme/light/MuiFormLabel.ts +20 -20
  258. package/src/theme/light/MuiInputBase.ts +49 -84
  259. package/src/theme/light/MuiOutlinedInput.ts +50 -6
  260. package/src/theme/light/MuiPagination.ts +21 -21
  261. package/src/theme/light/MuiPickerPopper.ts +17 -0
  262. package/src/theme/light/MuiPickersLayout.ts +63 -34
  263. package/src/theme/light/MuiPickersOutlinedInput.ts +38 -38
  264. package/src/theme/light/MuiPopover.ts +3 -1
  265. package/src/theme/light/MuiRadio.tsx +35 -52
  266. package/src/theme/light/MuiStepper.ts +21 -17
  267. package/src/theme/light/MuiSwitch.tsx +27 -23
  268. package/src/theme/light/MuiTab.tsx +27 -18
  269. package/src/theme/light/MuiTableCell.ts +4 -2
  270. package/src/theme/light/MuiTabs.tsx +11 -9
  271. package/src/theme/light/MuiTooltip.ts +2 -1
  272. package/src/theme/light/MuiTypography.tsx +0 -17
  273. package/src/theme/light/index.tsx +2 -0
  274. package/src/theme/light/themePalette.tsx +1 -0
  275. package/src/theme/palette.tsx +9 -0
  276. package/src/theme/sizeTokens.test.ts +37 -0
  277. package/src/theme/sizeTokens.ts +21 -0
  278. package/src/theme/spacingRoleBasedTokens.ts +41 -0
  279. package/src/theme/spacingTokens.test.ts +58 -0
  280. package/src/theme/spacingTokens.ts +114 -0
  281. package/src/theme/tokenTheme.test.tsx +402 -0
  282. package/src/theme/tokenTheme.ts +429 -0
  283. package/src/theme/tokens.css +476 -0
  284. package/src/theme/tokens.test.ts +174 -0
  285. package/src/theme/typographyTokens.test.ts +120 -0
  286. package/src/theme/typographyTokens.ts +119 -0
  287. package/dist/theme/spacing.d.ts +0 -4
  288. package/src/stories/foundations/Colors.mdx +0 -127
  289. package/src/theme/spacing.ts +0 -5
@@ -1,4 +1,9 @@
1
- import palette, { common } from '@/theme/palette'
1
+ import { borderTokens } from '@/theme/borderTokens'
2
+ import { colorTokens } from '@/theme/colorTokens'
3
+ import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
4
+ import { spacingTokens } from '@/theme/spacingTokens'
5
+
6
+ import './tokens.css'
2
7
 
3
8
  /**
4
9
  * Card surface tokens - Figma `Cards/card/*` and `Cards/subcard/*`.
@@ -7,54 +12,49 @@ import palette, { common } from '@/theme/palette'
7
12
  * anything needing a boxed row reads the same values instead of copying them.
8
13
  * `MuiCard` keeps its own radius until `RcSesCard` is deprecated.
9
14
  */
10
- const borderWidth = '1px'
15
+ const borderWidth = borderTokens['stroke-1']
11
16
 
12
17
  const card = {
13
- borderRadius: '0.75rem',
14
- gap: { xs: '1rem', md: '1.5rem' },
15
- footerGap: '0.5rem',
16
- padding: { xs: '1.25rem 1.5rem', md: '1.5rem 2rem' },
18
+ borderRadius: borderTokens['radius-card'],
19
+ gap: spacingTokens['spacing-aliases-cards-card-section-gap'],
20
+ footerGap: spacingTokens['spacing-aliases-cards-card-section-gap'],
21
+ padding: spacingTokens['spacing-aliases-cards-card-padding'],
17
22
  }
18
23
 
19
24
  const subcard = {
20
- borderRadius: '0.5rem',
21
- gap: { xs: '0.75rem', md: '1rem' },
22
- footerGap: '0.5rem',
23
- padding: { xs: '1rem', md: '1.25rem 1.5rem' },
25
+ borderRadius: borderTokens['radius-subcard'],
26
+ gap: spacingTokens['spacing-aliases-cards-subcard-section-gap'],
27
+ footerGap: spacingTokens['spacing-aliases-cards-subcard-section-gap'],
28
+ padding: spacingTokens['spacing-aliases-cards-subcard-padding'],
24
29
  }
25
30
 
26
31
  /**
27
- * Card header values. Two of them are departures from the type scale: the title
28
- * is `h6` at weight 600 rather than 500, and the description is `body2` on a
29
- * 1.25rem line. The three gaps follow the surrounding components - the row gap
30
- * matches the card gap and the actions gap matches the footer - rather than a
31
- * measured token. All six are pending confirmation against the DS.
32
+ * Card header values.
33
+ * All spacing and typography line-height values use design tokens.
32
34
  */
33
35
  const header = {
34
- actionsGap: '0.75rem',
35
- badgeGap: '0.5rem',
36
- descriptionLineHeight: '1.25rem',
37
- gap: '0.25rem',
38
- rowGap: '1rem',
39
- titleFontWeight: 600,
36
+ actionsGap: spacingRoleBasedTokens['space-12'],
37
+ badgeGap: spacingRoleBasedTokens['space-8'],
38
+ gap: spacingTokens['spacing-aliases-cards-card-heading-gap'],
39
+ rowGap: spacingRoleBasedTokens['space-16'],
40
40
  }
41
41
 
42
42
  const footer = {
43
- gap: '0.75rem',
43
+ gap: spacingTokens['spacing-aliases-button-group-gap'],
44
44
  }
45
45
 
46
46
  const themes = {
47
47
  brand: {
48
- backgroundColor: palette.primary[50],
49
- borderColor: palette.primary[200],
48
+ backgroundColor: colorTokens['surface-brand-subtle'],
49
+ borderColor: colorTokens['border-brand-subtle'],
50
50
  },
51
51
  default: {
52
- backgroundColor: common.white,
53
- borderColor: palette.grey[300],
52
+ backgroundColor: colorTokens['surface-base'],
53
+ borderColor: colorTokens['border-subtle'],
54
54
  },
55
55
  sunken: {
56
- backgroundColor: palette.grey[100],
57
- borderColor: palette.grey[200],
56
+ backgroundColor: colorTokens['surface-sunken'],
57
+ borderColor: colorTokens['surface-sunken'],
58
58
  },
59
59
  }
60
60
 
@@ -0,0 +1,66 @@
1
+ import { readFileSync } from 'node:fs'
2
+ import { describe, expect, test } from 'vitest'
3
+
4
+ import { colorPrimitives, colorTokens } from './colorTokens'
5
+
6
+ const css = readFileSync('src/theme/tokens.css', 'utf8')
7
+ const primitives = new Map(
8
+ Array.from(
9
+ css.matchAll(/(--rc-color-[\w-]+): (?!var\()([^;]+);/g),
10
+ ([, key, value]) => [key, value],
11
+ ),
12
+ )
13
+ const semantics = new Map(
14
+ Array.from(
15
+ css.matchAll(/(--rc-color-[\w-]+): var\((--rc-[\w-]+)\);/g),
16
+ ([, key, value]) => [key, value],
17
+ ),
18
+ )
19
+
20
+ describe('Figma Light color foundations', () => {
21
+ test('all 60 primitives and 64 semantic aliases exist and aliases resolve without cycles', () => {
22
+ expect(primitives.size).toBe(60)
23
+ expect(semantics.size).toBe(64)
24
+ const references = Object.values(colorTokens).map((value) => value.slice(4, -1))
25
+ expect(references).toHaveLength(64)
26
+ references.forEach((reference) => {
27
+ expect(semantics.has(reference)).toBe(true)
28
+ })
29
+ semantics.forEach((target, key) => {
30
+ const visited = new Set([key])
31
+ let current = target
32
+ while (semantics.has(current)) {
33
+ expect(visited.has(current)).toBe(false)
34
+ visited.add(current)
35
+ current = semantics.get(current)!
36
+ }
37
+ expect(primitives.has(current)).toBe(true)
38
+ })
39
+ })
40
+ test('sunken and muted remain distinct and secondary text uses neutral 600', () => {
41
+ expect(semantics.get('--rc-color-surface-sunken')).toBe('--rc-color-neutrals-50')
42
+ expect(semantics.get('--rc-color-surface-muted')).toBe('--rc-color-neutrals-100')
43
+ expect(semantics.get('--rc-color-text-secondary')).toBe('--rc-color-neutrals-600')
44
+ expect(colorPrimitives.neutrals[50]).toBe('#f9fafb')
45
+ expect(colorPrimitives.neutrals[600]).toBe('#6b747f')
46
+ })
47
+ test('controls, borders and icons use the accessible Figma primitives', () => {
48
+ Object.entries({
49
+ 'text-muted': 'neutrals-600',
50
+ 'border-strong': 'neutrals-600',
51
+ 'border-focus': 'cyans-600',
52
+ 'border-focus-error': 'red-600',
53
+ 'border-brand-subtle': 'cyans-200',
54
+ 'control-border': 'neutrals-600',
55
+ 'control-unselected': 'neutrals-600',
56
+ 'control-unselected-hover': 'neutrals-700',
57
+ 'control-selected': 'cyans-600',
58
+ 'control-selected-hover': 'cyans-700',
59
+ 'status-info-icon': 'cyans-800',
60
+ 'status-success-icon': 'greens-800',
61
+ 'status-warning-icon': 'yellows-800',
62
+ }).forEach(([role, primitive]) => {
63
+ expect(semantics.get(`--rc-color-${role}`), role).toBe(`--rc-color-${primitive}`)
64
+ })
65
+ })
66
+ })
@@ -0,0 +1,87 @@
1
+ import { common, error, grey, overlays, primary, secondary, warning } from './palette'
2
+
3
+ const { main: primaryMain, ...cyans } = primary
4
+ const { main: secondaryMain, ...greens } = secondary
5
+ const { main: greyMain, ...neutrals } = grey
6
+ const { main: warningMain, ...yellows } = warning
7
+ const { main: errorMain, ...red } = error
8
+
9
+ export const colorPrimitives = {
10
+ cyans,
11
+ greens,
12
+ neutrals,
13
+ yellows,
14
+ red,
15
+ white: common.white,
16
+ overlays: { black: overlays.black, white: overlays.white },
17
+ } as const
18
+
19
+ const colorTokens = {
20
+ 'action-destructive-bg': 'var(--rc-color-action-destructive-bg)',
21
+ 'action-destructive-bg-hover': 'var(--rc-color-action-destructive-bg-hover)',
22
+ 'action-destructive-bg-pressed': 'var(--rc-color-action-destructive-bg-pressed)',
23
+ 'action-destructive-text': 'var(--rc-color-action-destructive-text)',
24
+ 'action-link-text': 'var(--rc-color-action-link-text)',
25
+ 'action-link-text-hover': 'var(--rc-color-action-link-text-hover)',
26
+ 'action-primary-bg': 'var(--rc-color-action-primary-bg)',
27
+ 'action-primary-bg-disabled': 'var(--rc-color-action-primary-bg-disabled)',
28
+ 'action-primary-bg-hover': 'var(--rc-color-action-primary-bg-hover)',
29
+ 'action-primary-bg-pressed': 'var(--rc-color-action-primary-bg-pressed)',
30
+ 'action-primary-text': 'var(--rc-color-action-primary-text)',
31
+ 'action-primary-text-disabled': 'var(--rc-color-action-primary-text-disabled)',
32
+ 'action-secondary-bg': 'var(--rc-color-action-secondary-bg)',
33
+ 'action-secondary-bg-hover': 'var(--rc-color-action-secondary-bg-hover)',
34
+ 'action-secondary-border': 'var(--rc-color-action-secondary-border)',
35
+ 'action-secondary-border-hover': 'var(--rc-color-action-secondary-border-hover)',
36
+ 'action-secondary-text': 'var(--rc-color-action-secondary-text)',
37
+ 'border-brand-subtle': 'var(--rc-color-border-brand-subtle)',
38
+ 'border-default': 'var(--rc-color-border-default)',
39
+ 'border-focus': 'var(--rc-color-border-focus)',
40
+ 'border-focus-error': 'var(--rc-color-border-focus-error)',
41
+ 'border-inverse': 'var(--rc-color-border-inverse)',
42
+ 'border-strong': 'var(--rc-color-border-strong)',
43
+ 'border-subtle': 'var(--rc-color-border-subtle)',
44
+ 'control-border': 'var(--rc-color-control-border)',
45
+ 'control-disabled': 'var(--rc-color-control-disabled)',
46
+ 'control-disabled-selected': 'var(--rc-color-control-disabled-selected)',
47
+ 'control-foreground': 'var(--rc-color-control-foreground)',
48
+ 'control-selected': 'var(--rc-color-control-selected)',
49
+ 'control-selected-hover': 'var(--rc-color-control-selected-hover)',
50
+ 'control-unselected': 'var(--rc-color-control-unselected)',
51
+ 'control-unselected-hover': 'var(--rc-color-control-unselected-hover)',
52
+ 'flow-destructive': 'var(--rc-color-flow-destructive)',
53
+ 'flow-edge': 'var(--rc-color-flow-edge)',
54
+ 'flow-progress': 'var(--rc-color-flow-progress)',
55
+ 'status-error-bg': 'var(--rc-color-status-error-bg)',
56
+ 'status-error-border': 'var(--rc-color-status-error-border)',
57
+ 'status-error-icon': 'var(--rc-color-status-error-icon)',
58
+ 'status-error-text': 'var(--rc-color-status-error-text)',
59
+ 'status-info-bg': 'var(--rc-color-status-info-bg)',
60
+ 'status-info-border': 'var(--rc-color-status-info-border)',
61
+ 'status-info-icon': 'var(--rc-color-status-info-icon)',
62
+ 'status-info-text': 'var(--rc-color-status-info-text)',
63
+ 'status-success-bg': 'var(--rc-color-status-success-bg)',
64
+ 'status-success-border': 'var(--rc-color-status-success-border)',
65
+ 'status-success-icon': 'var(--rc-color-status-success-icon)',
66
+ 'status-success-text': 'var(--rc-color-status-success-text)',
67
+ 'status-warning-bg': 'var(--rc-color-status-warning-bg)',
68
+ 'status-warning-border': 'var(--rc-color-status-warning-border)',
69
+ 'status-warning-icon': 'var(--rc-color-status-warning-icon)',
70
+ 'status-warning-text': 'var(--rc-color-status-warning-text)',
71
+ 'surface-base': 'var(--rc-color-surface-base)',
72
+ 'surface-brand-subtle': 'var(--rc-color-surface-brand-subtle)',
73
+ 'surface-inverse': 'var(--rc-color-surface-inverse)',
74
+ 'surface-muted': 'var(--rc-color-surface-muted)',
75
+ 'surface-raised': 'var(--rc-color-surface-raised)',
76
+ 'surface-sunken': 'var(--rc-color-surface-sunken)',
77
+ 'text-default': 'var(--rc-color-text-default)',
78
+ 'text-disabled': 'var(--rc-color-text-disabled)',
79
+ 'text-inverse': 'var(--rc-color-text-inverse)',
80
+ 'text-link': 'var(--rc-color-text-link)',
81
+ 'text-link-hover': 'var(--rc-color-text-link-hover)',
82
+ 'text-muted': 'var(--rc-color-text-muted)',
83
+ 'text-secondary': 'var(--rc-color-text-secondary)',
84
+ } as const
85
+
86
+ export { colorTokens }
87
+ export default colorTokens
@@ -0,0 +1,29 @@
1
+ import { readFileSync } from 'node:fs'
2
+ import { expect, test } from 'vitest'
3
+
4
+ import { effectTokens } from './effectTokens'
5
+
6
+ test('five effects match the supplied Figma Dev Mode CSS, including shadow layer order', () => {
7
+ const expected = {
8
+ 'elevation-sm': '0 4px 6px 0 #00000014, 0 1px 3px 0 #0000000f',
9
+ 'elevation-md': '0 4px 16px 0 #00000014',
10
+ 'elevation-lg': '0 8px 16px 0 #0000001f',
11
+ 'focus-ring-default': '0 0 0 2px var(--rc-color-border-focus)',
12
+ 'focus-ring-error': '0 0 0 2px var(--rc-color-border-focus-error)',
13
+ }
14
+ const blocks = readFileSync('src/theme/tokens.css', 'utf8').split('@media')
15
+ const declarations = Object.fromEntries(
16
+ Array.from(
17
+ blocks[0].matchAll(/--rc-((?:elevation|focus-ring)-[\w-]+): ([^;]+);/g),
18
+ ([, name, value]) => [name, value],
19
+ ),
20
+ )
21
+ expect(declarations).toEqual(expected)
22
+ expect(Object.keys(effectTokens).sort()).toEqual(Object.keys(expected).sort())
23
+ Object.entries(effectTokens).forEach(([name, reference]) => {
24
+ expect(reference).toBe(`var(--rc-${name})`)
25
+ })
26
+ blocks
27
+ .slice(1)
28
+ .forEach((block) => expect(block).not.toMatch(/--rc-(?:elevation|focus-ring)-/))
29
+ })
@@ -0,0 +1,11 @@
1
+ // CSS variable references; values live in tokens.css.
2
+ const effectTokens = {
3
+ 'elevation-sm': 'var(--rc-elevation-sm)',
4
+ 'elevation-md': 'var(--rc-elevation-md)',
5
+ 'elevation-lg': 'var(--rc-elevation-lg)',
6
+ 'focus-ring-default': 'var(--rc-focus-ring-default)',
7
+ 'focus-ring-error': 'var(--rc-focus-ring-error)',
8
+ } as const
9
+
10
+ export { effectTokens }
11
+ export default effectTokens
@@ -0,0 +1,42 @@
1
+ import { readFileSync } from 'node:fs'
2
+ import { expect, test } from 'vitest'
3
+
4
+ import { layoutTokens } from './layoutTokens'
5
+
6
+ // Layout.zip: xs, sm, md, lg. All 8 exported values are dimensions, in px.
7
+ const expected = {
8
+ 'column-width': [72, 72, 72, 72],
9
+ 'container-narrow-width': [343, 720, 744, 744],
10
+ 'container-medium-width': [343, 720, 936, 936],
11
+ 'container-wide-width': [343, 720, 1128, 1128],
12
+ 'grid-width-lg': [1128, 1128, 1128, 1128],
13
+ gutter: [16, 16, 24, 24],
14
+ 'outer-container-max-width': [1200, 1200, 1200, 1200],
15
+ 'outer-padding': [16, 24, 24, 36],
16
+ } as const
17
+
18
+ test('all 8 layout dimensions match Figma in rem across four CSS modes', () => {
19
+ const blocks = readFileSync('src/theme/tokens.css', 'utf8').split('@media')
20
+ expect(blocks).toHaveLength(4)
21
+ expect(blocks[1]).toContain('min-width: 600px')
22
+ expect(blocks[2]).toContain('min-width: 900px')
23
+ expect(blocks[3]).toContain('min-width: 1200px')
24
+ expect(Object.keys(layoutTokens).sort()).toEqual(Object.keys(expected).sort())
25
+ const declarations = new Map<string, string>()
26
+ blocks.forEach((block, mode) => {
27
+ const changes = new Map(
28
+ Array.from(block.matchAll(/--rc-layout-([\w-]+): ([^;]+);/g), ([, key, value]) => [
29
+ key,
30
+ value,
31
+ ]),
32
+ )
33
+ changes.forEach((value, key) => declarations.set(key, value))
34
+ expect(declarations.size).toBe(8)
35
+ Object.entries(expected).forEach(([key, values]) => {
36
+ expect(declarations.get(key)).toBe(`${values[mode] / 16}rem`)
37
+ expect(layoutTokens[key as keyof typeof layoutTokens]).toBe(
38
+ `var(--rc-layout-${key})`,
39
+ )
40
+ })
41
+ })
42
+ })
@@ -0,0 +1,14 @@
1
+ // CSS variable references. Values and responsive modes live in tokens.css.
2
+ const layoutTokens = {
3
+ 'column-width': 'var(--rc-layout-column-width)',
4
+ 'container-medium-width': 'var(--rc-layout-container-medium-width)',
5
+ 'container-narrow-width': 'var(--rc-layout-container-narrow-width)',
6
+ 'container-wide-width': 'var(--rc-layout-container-wide-width)',
7
+ 'grid-width-lg': 'var(--rc-layout-grid-width-lg)',
8
+ gutter: 'var(--rc-layout-gutter)',
9
+ 'outer-container-max-width': 'var(--rc-layout-outer-container-max-width)',
10
+ 'outer-padding': 'var(--rc-layout-outer-padding)',
11
+ } as const
12
+
13
+ export { layoutTokens }
14
+ export default layoutTokens
@@ -1,49 +1,53 @@
1
- import { Components } from '@mui/material'
1
+ import { Components, Theme } from '@mui/material'
2
2
 
3
- import palette from '../palette'
3
+ import { borderTokens } from '../borderTokens'
4
+ import { colorTokens } from '../colorTokens'
5
+ import { spacingRoleBasedTokens } from '../spacingRoleBasedTokens'
4
6
 
5
- const MuiAccordion: Components['MuiAccordion'] = {
7
+ const MuiAccordion: Components<Theme>['MuiAccordion'] = {
6
8
  defaultProps: {
7
9
  elevation: 0,
8
10
  disableGutters: true,
9
- sx: {
10
- borderWidth: {
11
- xs: 0,
12
- md: '1px',
13
- },
14
- borderRadius: {
15
- xs: 0,
16
- md: '.375rem',
17
- },
18
- margin: {
19
- xs: '.5rem 0',
20
- md: '1rem 0',
21
- },
22
- },
11
+ // MUI's rounded variant sets its own first/last-of-type radii, which outrank
12
+ // the radius below.
13
+ square: true,
23
14
  },
24
15
  styleOverrides: {
25
- root: {
26
- borderColor: palette.grey['400'],
27
- // borderRadius: '.375rem',
16
+ root: ({ theme }) => ({
17
+ borderWidth: borderTokens['stroke-1'],
18
+ borderRadius: borderTokens['radius-card'],
19
+ margin: `${spacingRoleBasedTokens['space-8']} 0`,
20
+ [theme.breakpoints.up('md')]: {
21
+ margin: `${spacingRoleBasedTokens['space-16']} 0`,
22
+ },
23
+ backgroundColor: colorTokens['surface-base'],
24
+ borderColor: colorTokens['border-default'],
28
25
  borderStyle: 'solid',
29
- // boderWidth: 1,
30
26
  padding: 0,
27
+ '& > .MuiAccordion-heading': { margin: 0, font: 'inherit' },
31
28
 
32
29
  ':before': {
33
30
  content: 'unset',
34
31
  },
35
32
 
36
- '&.Mui-expanded': {
37
- '.MuiAccordionSummary-content': {
38
- margin: '1rem 0',
39
- },
33
+ // Figma draws keyboard focus on the whole section, not just its header.
34
+ '&:has(.MuiAccordionSummary-root.Mui-focusVisible)': {
35
+ outline: `${borderTokens['border-focus']} solid ${colorTokens['border-focus']}`,
36
+ outlineOffset: 0,
37
+ },
40
38
 
39
+ '&.Mui-disabled': {
40
+ backgroundColor: colorTokens['surface-base'],
41
+ opacity: 1,
42
+ },
43
+
44
+ '&.Mui-expanded': {
41
45
  '.MuiAccordionSummary-root': {
42
46
  borderBottomLeftRadius: 0,
43
47
  borderBottomRightRadius: 0,
44
48
  },
45
49
  },
46
- },
50
+ }),
47
51
  },
48
52
  }
49
53
 
@@ -1,16 +1,21 @@
1
1
  import { Components } from '@mui/material'
2
2
 
3
+ import { spacingTokens } from '../spacingTokens'
4
+
3
5
  const MuiAccordionDetails: Components['MuiAccordionDetails'] = {
4
6
  defaultProps: {
5
7
  sx: {
6
- padding: {
7
- xs: '1.25rem 1rem 2.5rem',
8
- md: '2.5rem 2rem 4rem',
9
- },
8
+ paddingBottom: spacingTokens['spacing-aliases-card-padding-bottom'],
9
+ paddingInline: spacingTokens['spacing-aliases-card-padding-x'],
10
+ paddingTop: spacingTokens['spacing-aliases-card-padding-top'],
10
11
  },
11
12
  },
12
13
  styleOverrides: {
13
- root: {},
14
+ root: {
15
+ display: 'flex',
16
+ flexDirection: 'column',
17
+ gap: spacingTokens['spacing-aliases-form-field-gap'],
18
+ },
14
19
  },
15
20
  }
16
21
 
@@ -2,32 +2,46 @@ import { Components } from '@mui/material'
2
2
 
3
3
  import { CaretDownIcon } from '@/assets/icons/phosphorIcons'
4
4
 
5
- import palette from '../palette'
5
+ import { borderTokens } from '../borderTokens'
6
+ import { colorTokens } from '../colorTokens'
7
+ import { spacingRoleBasedTokens } from '../spacingRoleBasedTokens'
8
+ import { spacingTokens } from '../spacingTokens'
9
+ import { typographyTokens } from '../typographyTokens'
10
+
11
+ // The header sits inside the section's 1px border, so its corners use the
12
+ // card radius minus that border.
13
+ const HEADER_RADIUS = `calc(${borderTokens['radius-card']} - ${borderTokens['stroke-1']})`
14
+
15
+ export const accordionSummaryRootStyles = {
16
+ fontFamily: typographyTokens['font-family'],
17
+ gap: spacingTokens['spacing-aliases-stack-default'],
18
+ paddingBlock: spacingRoleBasedTokens['space-20'],
19
+ paddingInline: spacingTokens['spacing-aliases-card-padding-x'],
20
+ backgroundColor: colorTokens['surface-sunken'],
21
+ borderRadius: HEADER_RADIUS,
22
+ minHeight: '44px',
23
+ '&:hover:not(.Mui-disabled)': { backgroundColor: colorTokens['surface-muted'] },
24
+ '&.Mui-focusVisible': { backgroundColor: colorTokens['surface-sunken'] },
25
+ '&.Mui-disabled': { color: colorTokens['text-disabled'], opacity: 1 },
26
+ }
6
27
 
7
28
  const MuiAccordionSummary: Components['MuiAccordionSummary'] = {
8
29
  defaultProps: {
9
30
  expandIcon: <CaretDownIcon />,
10
31
  sx: {
11
- backgroundColor: {
12
- xs: 'white',
13
- md: palette.grey['50'],
14
- },
15
- borderRadius: {
16
- xs: 0,
17
- md: '.375rem',
18
- },
32
+ backgroundColor: colorTokens['surface-sunken'],
33
+ borderRadius: HEADER_RADIUS,
19
34
  },
20
35
  },
21
36
  styleOverrides: {
22
- root: {
23
- paddingLeft: '1.5rem',
24
- },
37
+ root: accordionSummaryRootStyles,
25
38
  content: {
26
- fontSize: '1.25rem',
27
- fontWeight: 500,
28
- lineHeight: '1.5rem',
29
- margin: '1rem 0 1rem 0',
30
- padding: '.5rem 0',
39
+ color: 'inherit',
40
+ fontSize: typographyTokens['font-size-heading-card-title'],
41
+ fontWeight: typographyTokens['font-weight-heading-card-title'],
42
+ lineHeight: typographyTokens['line-height-heading-card-title'],
43
+ letterSpacing: typographyTokens['letter-spacing-heading-card-title'],
44
+ margin: 0,
31
45
  },
32
46
  },
33
47
  }