@registrucentras/rc-ses-react-components 2.7.2 → 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 +24 -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 +11144 -8374
  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 +11 -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
@@ -60,7 +60,7 @@ describe('SelectableCardList', () => {
60
60
  test('navigating to next page shows the next set of items', () => {
61
61
  renderList(<SelectableCardList items={makeItems(8)} onSelect={vi.fn()} />)
62
62
 
63
- fireEvent.click(screen.getByRole('button', { name: 'Kitas' }))
63
+ fireEvent.click(screen.getByRole('button', { name: 'Kitas puslapis' }))
64
64
 
65
65
  expect(screen.getByText('Item 6')).toBeInTheDocument()
66
66
  expect(screen.getByText('Item 7')).toBeInTheDocument()
@@ -76,9 +76,11 @@ describe('SelectableCardList', () => {
76
76
  expect(screen.getByText('Item 1')).toBeInTheDocument()
77
77
  expect(screen.getByText('Item 3')).toBeInTheDocument()
78
78
  expect(screen.queryByText('Item 4')).not.toBeInTheDocument()
79
- expect(screen.getByRole('button', { name: 'page 1' })).toBeInTheDocument()
80
- expect(screen.getByRole('button', { name: 'Go to page 3' })).toBeInTheDocument()
81
- expect(screen.queryByRole('button', { name: 'Go to page 4' })).not.toBeInTheDocument()
79
+ expect(screen.getByRole('button', { name: 'Eiti į 1 puslapį' })).toBeInTheDocument()
80
+ expect(screen.getByRole('button', { name: 'Eiti į 3 puslapį' })).toBeInTheDocument()
81
+ expect(
82
+ screen.queryByRole('button', { name: 'Eiti į 4 puslapį' }),
83
+ ).not.toBeInTheDocument()
82
84
  })
83
85
 
84
86
  test('resets to page 1 when switching from desktop to mobile page size', () => {
@@ -86,7 +88,7 @@ describe('SelectableCardList', () => {
86
88
  <SelectableCardList items={makeItems(8)} onSelect={vi.fn()} />,
87
89
  )
88
90
 
89
- fireEvent.click(screen.getByRole('button', { name: 'Kitas' }))
91
+ fireEvent.click(screen.getByRole('button', { name: 'Kitas puslapis' }))
90
92
  expect(screen.getByText('Item 6')).toBeInTheDocument()
91
93
 
92
94
  mockedUseMediaQuery.mockReturnValue(true)
@@ -107,7 +109,7 @@ describe('SelectableCardList', () => {
107
109
  <SelectableCardList items={makeItems(8)} onSelect={vi.fn()} />,
108
110
  )
109
111
 
110
- fireEvent.click(screen.getByRole('button', { name: 'Go to page 3' }))
112
+ fireEvent.click(screen.getByRole('button', { name: 'Eiti į 3 puslapį' }))
111
113
  expect(screen.getByText('Item 7')).toBeInTheDocument()
112
114
 
113
115
  mockedUseMediaQuery.mockReturnValue(false)
@@ -0,0 +1,92 @@
1
+ import {
2
+ Checkbox,
3
+ FormControlLabel,
4
+ Radio,
5
+ RadioGroup,
6
+ ThemeProvider,
7
+ } from '@mui/material'
8
+ import { fireEvent, render, screen } from '@testing-library/react'
9
+ import { describe, expect, it } from 'vitest'
10
+
11
+ import SimpleCheckbox from '@/components/form/inputs/SimpleCheckbox'
12
+ import theme from '@/theme/light'
13
+
14
+ import CheckboxMark from './CheckboxMark'
15
+ import RadioMark from './RadioMark'
16
+
17
+ describe('selection marks', () => {
18
+ it('renders decorative marks without inputs, labels or focusable elements', () => {
19
+ const { container } = render(
20
+ <>
21
+ <CheckboxMark />
22
+ <RadioMark />
23
+ </>,
24
+ )
25
+ expect(container.querySelectorAll('[aria-hidden="true"]')).toHaveLength(2)
26
+ expect(container.querySelector('input, button, [tabindex]')).toBeNull()
27
+ expect(screen.queryByRole('checkbox')).not.toBeInTheDocument()
28
+ expect(screen.queryByRole('radio')).not.toBeInTheDocument()
29
+ expect(container.textContent).toBe('')
30
+ })
31
+
32
+ it('distinguishes checked and mixed glyphs from an empty box', () => {
33
+ const { container, rerender } = render(<CheckboxMark />)
34
+ expect(container.querySelector('svg')).toBeNull()
35
+ rerender(<CheckboxMark type='checked' />)
36
+ const checkPath = container.querySelector('path')?.getAttribute('d')
37
+ expect(checkPath).toBeTruthy()
38
+ rerender(<CheckboxMark type='indeterminate' />)
39
+ expect(container.querySelector('path')?.getAttribute('d')).not.toBe(checkPath)
40
+ })
41
+
42
+ it('adds a visible radio dot only for the selected state', () => {
43
+ const { container, rerender } = render(<RadioMark />)
44
+ expect(container.querySelector('[data-rc-radio-dot]')).toBeNull()
45
+ rerender(<RadioMark type='selected' disabled />)
46
+ expect(container.querySelector('[data-rc-radio-dot]')).not.toBeNull()
47
+ expect(container.querySelector('[data-rc-checkbox-mark]')).toBeNull()
48
+ })
49
+
50
+ it('native checkbox selection and mixed state use the shared marks', () => {
51
+ const { container, rerender } = render(
52
+ <ThemeProvider theme={theme}>
53
+ <Checkbox slotProps={{ input: { 'aria-label': 'Select item' } }} />
54
+ </ThemeProvider>,
55
+ )
56
+ const input = screen.getByRole('checkbox', { name: 'Select item' })
57
+ fireEvent.click(input)
58
+ expect(input).toBeChecked()
59
+ expect(container.querySelector('[data-rc-checkbox-mark="checked"]')).not.toBeNull()
60
+ rerender(
61
+ <ThemeProvider theme={theme}>
62
+ <Checkbox indeterminate />
63
+ </ThemeProvider>,
64
+ )
65
+ expect(
66
+ container.querySelector('[data-rc-checkbox-mark="indeterminate"]'),
67
+ ).not.toBeNull()
68
+ })
69
+
70
+ it('native radio selection switches independent radio marks', () => {
71
+ const { container } = render(
72
+ <ThemeProvider theme={theme}>
73
+ <RadioGroup defaultValue='a'>
74
+ <FormControlLabel control={<Radio />} value='a' label='A' />
75
+ <FormControlLabel control={<Radio />} value='b' label='B' />
76
+ </RadioGroup>
77
+ </ThemeProvider>,
78
+ )
79
+ fireEvent.click(screen.getByRole('radio', { name: 'B' }))
80
+ expect(screen.getByRole('radio', { name: 'B' })).toBeChecked()
81
+ expect(screen.getByRole('radio', { name: 'A' })).not.toBeChecked()
82
+ expect(container.querySelectorAll('[data-rc-radio-mark="selected"]')).toHaveLength(1)
83
+ })
84
+
85
+ it('preserves loading placeholders and caller-supplied checkbox icons', () => {
86
+ const { container, rerender } = render(<SimpleCheckbox loading indeterminate />)
87
+ expect(container.querySelector('.MuiSkeleton-root')).not.toBeNull()
88
+ expect(container.querySelector('[data-rc-checkbox-mark]')).toBeNull()
89
+ rerender(<SimpleCheckbox icon={<span data-testid='custom-icon' />} />)
90
+ expect(screen.getByTestId('custom-icon')).toBeInTheDocument()
91
+ })
92
+ })
@@ -2,18 +2,22 @@ import { Box, Skeleton, Stack, Typography } from '@mui/material'
2
2
  import { ElementType } from 'react'
3
3
 
4
4
  import { ArrowRightIcon } from '@/assets/icons/phosphorIcons'
5
+ import { borderTokens } from '@/theme/borderTokens'
5
6
  import { subcard } from '@/theme/cards'
6
- import palette from '@/theme/palette'
7
+ import { colorTokens } from '@/theme/colorTokens'
8
+ import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
9
+ import { spacingTokens } from '@/theme/spacingTokens'
10
+ import { typographyTokens } from '@/theme/typographyTokens'
7
11
 
8
12
  import { RcSesServiceLinkItem, RcSesServiceLinksTestIds } from '../types'
9
13
 
10
14
  const linkRow = {
11
15
  borderRadius: subcard.borderRadius,
12
- gap: '1rem',
16
+ gap: spacingTokens['spacing-aliases-service-list-item-gap'],
13
17
  iconSize: 20,
14
- labelFontWeight: 500,
15
- lineHeight: '1.5rem',
16
- paddingBlock: '0.75rem',
18
+ labelFontWeight: typographyTokens['font-weight-body-regular'],
19
+ lineHeight: typographyTokens['line-height-body-regular'],
20
+ paddingBlock: spacingTokens['spacing-aliases-service-list-item-padding-y'],
17
21
  }
18
22
 
19
23
  type Props = RcSesServiceLinkItem & {
@@ -51,7 +55,11 @@ function ServiceLinkItem({
51
55
  }}
52
56
  >
53
57
  <Skeleton
54
- sx={{ borderRadius: 1, height: '1rem', width: '60%' }}
58
+ sx={{
59
+ borderRadius: 1,
60
+ height: spacingRoleBasedTokens['space-16'],
61
+ width: '60%',
62
+ }}
55
63
  variant='rounded'
56
64
  />
57
65
  <Skeleton
@@ -117,13 +125,13 @@ function ServiceLinkItem({
117
125
  width: '100%',
118
126
 
119
127
  '&:focus-visible': {
120
- outline: `2px solid ${palette.primary[500]}`,
121
- outlineOffset: '2px',
128
+ outline: `${borderTokens['border-focus']} solid ${colorTokens['border-focus']}`,
129
+ outlineOffset: borderTokens['border-focus'],
122
130
  },
123
131
 
124
132
  ...(isInteractive && {
125
133
  '&:hover .RcSesServiceLink-label, &:hover .RcSesServiceLink-icon': {
126
- color: palette.primary[600],
134
+ color: colorTokens['text-link-hover'],
127
135
  },
128
136
  '&:hover .RcSesServiceLink-icon': {
129
137
  transform: 'translateX(2px)',
@@ -146,7 +154,8 @@ function ServiceLinkItem({
146
154
  data-testid={testIds?.itemLabel}
147
155
  variant='body1'
148
156
  sx={{
149
- color: palette.primary[700],
157
+ color: colorTokens['text-link'],
158
+ fontSize: typographyTokens['font-size-body-regular'],
150
159
  fontWeight: linkRow.labelFontWeight,
151
160
  lineHeight: linkRow.lineHeight,
152
161
  minWidth: 0,
@@ -162,7 +171,7 @@ function ServiceLinkItem({
162
171
  className='RcSesServiceLink-icon'
163
172
  data-testid={testIds?.itemIcon}
164
173
  sx={{
165
- color: palette.primary[600],
174
+ color: colorTokens['text-link'],
166
175
  display: 'flex',
167
176
  flexShrink: 0,
168
177
  transition: 'color 150ms ease, transform 150ms ease',
@@ -1,7 +1,7 @@
1
1
  import { Box, Divider } from '@mui/material'
2
2
  import { Fragment } from 'react'
3
3
 
4
- import palette from '@/theme/palette'
4
+ import { colorTokens } from '@/theme/colorTokens'
5
5
 
6
6
  import ServiceLinkItem from './ServiceLinkItem'
7
7
  import { RcSesServiceLinksProps } from './types'
@@ -35,7 +35,7 @@ function RcSesServiceLinks({
35
35
  // eslint-disable-next-line react/no-array-index-key
36
36
  <Fragment key={`skeleton-${index}`}>
37
37
  {dividers && index > 0 ? (
38
- <Divider sx={{ borderColor: palette.grey[200] }} />
38
+ <Divider sx={{ borderColor: colorTokens['border-subtle'] }} />
39
39
  ) : null}
40
40
  <ServiceLinkItem label='' isLoading testIds={testIds} />
41
41
  </Fragment>
@@ -49,7 +49,7 @@ function RcSesServiceLinks({
49
49
  return (
50
50
  <Fragment key={key}>
51
51
  {dividers && index > 0 ? (
52
- <Divider sx={{ borderColor: palette.grey[200] }} />
52
+ <Divider sx={{ borderColor: colorTokens['border-subtle'] }} />
53
53
  ) : null}
54
54
  <ServiceLinkItem
55
55
  {...itemProps}
@@ -2,6 +2,7 @@ import { Box } from '@mui/material'
2
2
  import { CSSProperties, useRef, useState } from 'react'
3
3
 
4
4
  import normalizeSx from '@/components/utils/normalizeSx'
5
+ import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
5
6
 
6
7
  import RcSesSideNav from '.'
7
8
  import { RcSesSideNavLayoutProps } from './SideNav.types'
@@ -46,7 +47,11 @@ function RcSesSideNavLayout({
46
47
  return (
47
48
  <Box
48
49
  sx={[
49
- { display: 'flex', flexDirection: { xs: 'column', md: 'row' }, gap: '2rem' },
50
+ {
51
+ display: 'flex',
52
+ flexDirection: { xs: 'column', md: 'row' },
53
+ gap: spacingRoleBasedTokens['space-32'],
54
+ },
50
55
  ...normalizeSx(sx),
51
56
  ]}
52
57
  >
@@ -1,6 +1,9 @@
1
1
  import { Box, Typography } from '@mui/material'
2
2
 
3
- import palette, { common } from '@/theme/palette'
3
+ import { borderTokens } from '@/theme/borderTokens'
4
+ import { colorTokens } from '@/theme/colorTokens'
5
+ import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
6
+ import { typographyTokens } from '@/theme/typographyTokens'
4
7
 
5
8
  interface Props {
6
9
  label: string
@@ -21,28 +24,32 @@ function SideNavPill({ label, count, ariaLabel, active, onClick }: Props) {
21
24
  sx={{
22
25
  display: 'flex',
23
26
  alignItems: 'center',
24
- gap: '0.5rem',
27
+ gap: spacingRoleBasedTokens['space-8'],
25
28
  flexShrink: 0,
26
29
  whiteSpace: 'nowrap',
27
30
  margin: 0,
28
- borderRadius: '9999px',
29
- border: `0.0625rem solid ${active ? palette.primary.main : palette.grey[200]}`,
30
- backgroundColor: active ? palette.primary[50] : common.white,
31
- padding: '0.5rem 1rem',
31
+ borderRadius: borderTokens['radius-pill'],
32
+ border: `${borderTokens['border-default']} solid ${active ? colorTokens['border-focus'] : colorTokens['border-subtle']}`,
33
+ backgroundColor: active
34
+ ? colorTokens['surface-brand-subtle']
35
+ : colorTokens['surface-base'],
36
+ paddingX: spacingRoleBasedTokens['space-16'],
37
+ paddingY: spacingRoleBasedTokens['space-8'],
32
38
  cursor: onClick ? 'pointer' : 'default',
33
39
  WebkitTapHighlightColor: 'transparent',
34
40
  '&:focus-visible': {
35
- outline: `0.125rem solid ${palette.primary.main}`,
36
- outlineOffset: '0.125rem',
41
+ outline: `${borderTokens['border-focus']} solid ${colorTokens['border-focus']}`,
42
+ outlineOffset: borderTokens['border-focus'],
37
43
  },
38
44
  }}
39
45
  >
40
46
  <Typography
41
47
  component='span'
42
48
  sx={{
43
- fontSize: '0.875rem',
44
- lineHeight: '1.25rem',
45
- color: active ? palette.grey[900] : palette.grey[600],
49
+ fontSize: typographyTokens['font-size-body-small'],
50
+ lineHeight: typographyTokens['line-height-body-small'],
51
+ fontWeight: typographyTokens['font-weight-body-small'],
52
+ color: active ? colorTokens['text-default'] : colorTokens['text-secondary'],
46
53
  }}
47
54
  >
48
55
  {label}
@@ -50,7 +57,12 @@ function SideNavPill({ label, count, ariaLabel, active, onClick }: Props) {
50
57
  {count !== undefined && (
51
58
  <Typography
52
59
  component='span'
53
- sx={{ fontSize: '0.8125rem', lineHeight: '1.125rem', color: palette.grey[500] }}
60
+ sx={{
61
+ fontSize: typographyTokens['font-size-body-caption'],
62
+ lineHeight: typographyTokens['line-height-body-caption'],
63
+ fontWeight: typographyTokens['font-weight-body-caption'],
64
+ color: colorTokens['text-muted'],
65
+ }}
54
66
  >
55
67
  {count}
56
68
  </Typography>
@@ -1,13 +1,18 @@
1
1
  import { Box } from '@mui/material'
2
2
  import { useCallback, useEffect, useRef, useState } from 'react'
3
3
 
4
- import palette, { common } from '@/theme/palette'
4
+ import { borderTokens } from '@/theme/borderTokens'
5
+ import { colorTokens } from '@/theme/colorTokens'
6
+ import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
5
7
 
6
8
  import { RcSesSideNavItem } from '../SideNav.types'
7
9
  import useKeepActiveItemInView from '../hooks/useKeepActiveItemInView'
8
10
  import SideNavPill from './SideNavPill'
9
11
 
10
- const FADE_WIDTH = '2rem'
12
+ const FADE_WIDTH = spacingRoleBasedTokens['space-32']
13
+ // The mobile scroll indicator is not in Figma; no semantic role matches these.
14
+ const SCROLL_TRACK_BG = 'var(--rc-color-neutrals-200)'
15
+ const SCROLL_THUMB_BG = 'var(--rc-color-neutrals-400)'
11
16
  const SCROLL_EPSILON = 1
12
17
 
13
18
  interface Props {
@@ -104,12 +109,13 @@ function SideNavPillList({ items, activeItemId, onItemClick, getItemAriaLabel }:
104
109
  onScroll={updateScrollState}
105
110
  sx={{
106
111
  display: 'flex',
107
- gap: '0.5rem',
112
+ gap: spacingRoleBasedTokens['space-8'],
108
113
  overflowX: 'auto',
109
114
  overflowY: 'hidden',
110
115
  scrollbarWidth: 'none',
111
116
  '&::-webkit-scrollbar': { display: 'none' },
112
- padding: '0.5rem 0.75rem',
117
+ paddingX: spacingRoleBasedTokens['space-12'],
118
+ paddingY: spacingRoleBasedTokens['space-8'],
113
119
  }}
114
120
  >
115
121
  {items.map((item) => (
@@ -135,7 +141,7 @@ function SideNavPillList({ items, activeItemId, onItemClick, getItemAriaLabel }:
135
141
  right: `-${scrollState.edgeBleed}px`,
136
142
  width: `calc(${FADE_WIDTH} + ${scrollState.edgeBleed}px)`,
137
143
  // Stop at FADE_WIDTH, not 100%, so the bleed stays solid.
138
- background: `linear-gradient(to right, ${common.white}00, ${common.white} ${FADE_WIDTH})`,
144
+ background: `linear-gradient(to right, transparent, ${colorTokens['surface-base']} ${FADE_WIDTH})`,
139
145
  pointerEvents: 'none',
140
146
  }}
141
147
  />
@@ -147,11 +153,11 @@ function SideNavPillList({ items, activeItemId, onItemClick, getItemAriaLabel }:
147
153
  aria-hidden
148
154
  sx={{
149
155
  position: 'relative',
150
- height: '0.25rem',
151
- marginX: '0.75rem',
152
- marginTop: '0.25rem',
153
- borderRadius: '9999px',
154
- backgroundColor: palette.grey[200],
156
+ height: spacingRoleBasedTokens['space-4'],
157
+ marginX: spacingRoleBasedTokens['space-12'],
158
+ marginTop: spacingRoleBasedTokens['space-4'],
159
+ borderRadius: borderTokens['radius-pill'],
160
+ backgroundColor: SCROLL_TRACK_BG,
155
161
  overflow: 'hidden',
156
162
  }}
157
163
  >
@@ -162,8 +168,8 @@ function SideNavPillList({ items, activeItemId, onItemClick, getItemAriaLabel }:
162
168
  bottom: 0,
163
169
  left: `${scrollState.thumbOffset}%`,
164
170
  width: `${scrollState.thumbWidth}%`,
165
- borderRadius: '9999px',
166
- backgroundColor: palette.grey[400],
171
+ borderRadius: borderTokens['radius-pill'],
172
+ backgroundColor: SCROLL_THUMB_BG,
167
173
  }}
168
174
  />
169
175
  </Box>
@@ -1,8 +1,12 @@
1
1
  import { Box, Typography } from '@mui/material'
2
2
 
3
- import palette from '@/theme/palette'
3
+ import { borderTokens } from '@/theme/borderTokens'
4
+ import { colorTokens } from '@/theme/colorTokens'
5
+ import { spacingTokens } from '@/theme/spacingTokens'
6
+ import { typographyTokens } from '@/theme/typographyTokens'
4
7
 
5
- const BORDER_WIDTH = '0.125rem'
8
+ // Figma's .Side-nav-row has no hover state; no semantic role matches the tint.
9
+ const ROW_HOVER_BG = 'var(--rc-color-neutrals-50)'
6
10
 
7
11
  interface Props {
8
12
  itemId: string
@@ -25,22 +29,23 @@ function SideNavRow({ itemId, label, count, ariaLabel, active, onClick }: Props)
25
29
  sx={{
26
30
  display: 'flex',
27
31
  alignItems: 'center',
28
- gap: '0.5rem',
32
+ gap: spacingTokens['spacing-aliases-side-nav-gap'],
29
33
  width: '100%',
30
34
  boxSizing: 'border-box',
31
35
  margin: 0,
32
36
  border: 'none',
33
- borderLeft: `${BORDER_WIDTH} solid ${active ? palette.primary.main : 'transparent'}`,
34
- backgroundColor: active ? palette.primary[50] : 'transparent',
35
- padding: '0.75rem 1rem',
37
+ borderLeft: `${borderTokens['border-focus']} solid ${active ? colorTokens['border-focus'] : 'transparent'}`,
38
+ backgroundColor: active ? colorTokens['surface-brand-subtle'] : 'transparent',
39
+ paddingX: spacingTokens['spacing-aliases-side-nav-row-padding-x'],
40
+ paddingY: spacingTokens['spacing-aliases-side-nav-row-padding-y'],
36
41
  textAlign: 'left',
37
42
  // A scrolling list (overflow='scroll') must not shrink its rows to fit.
38
43
  flexShrink: 0,
39
44
  cursor: onClick ? 'pointer' : 'default',
40
- '&:hover': onClick && !active ? { backgroundColor: palette.grey[50] } : undefined,
45
+ '&:hover': onClick && !active ? { backgroundColor: ROW_HOVER_BG } : undefined,
41
46
  '&:focus-visible': {
42
- outline: `${BORDER_WIDTH} solid ${palette.primary.main}`,
43
- outlineOffset: '-2px',
47
+ outline: `${borderTokens['border-focus']} solid ${colorTokens['border-focus']}`,
48
+ outlineOffset: `calc(-1 * ${borderTokens['border-focus']})`,
44
49
  },
45
50
  }}
46
51
  >
@@ -49,9 +54,10 @@ function SideNavRow({ itemId, label, count, ariaLabel, active, onClick }: Props)
49
54
  sx={{
50
55
  flex: '1 1 0%',
51
56
  minWidth: 0,
52
- fontSize: '0.9375rem',
53
- lineHeight: '1.375rem',
54
- color: active ? palette.grey[900] : palette.primary[700],
57
+ fontSize: typographyTokens['font-size-body-regular'],
58
+ lineHeight: typographyTokens['line-height-body-regular'],
59
+ fontWeight: typographyTokens['font-weight-body-regular'],
60
+ color: active ? colorTokens['text-default'] : colorTokens['text-link'],
55
61
  }}
56
62
  >
57
63
  {label}
@@ -61,9 +67,10 @@ function SideNavRow({ itemId, label, count, ariaLabel, active, onClick }: Props)
61
67
  component='span'
62
68
  sx={{
63
69
  flexShrink: 0,
64
- fontSize: '0.8125rem',
65
- lineHeight: '1.125rem',
66
- color: palette.grey[500],
70
+ fontSize: typographyTokens['font-size-body-caption'],
71
+ lineHeight: typographyTokens['line-height-body-caption'],
72
+ fontWeight: typographyTokens['font-weight-body-caption'],
73
+ color: colorTokens['text-muted'],
67
74
  }}
68
75
  >
69
76
  {count}
@@ -3,7 +3,9 @@ import { useEffect, useRef } from 'react'
3
3
  import { useTranslation } from 'react-i18next'
4
4
 
5
5
  import normalizeSx from '@/components/utils/normalizeSx'
6
- import palette, { common } from '@/theme/palette'
6
+ import { colorTokens } from '@/theme/colorTokens'
7
+ import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
8
+ import { typographyTokens } from '@/theme/typographyTokens'
7
9
 
8
10
  import { RcSesSideNavItem, RcSesSideNavProps } from './SideNav.types'
9
11
  import SideNavPillList from './components/SideNavPillList'
@@ -11,8 +13,6 @@ import SideNavRow from './components/SideNavRow'
11
13
  import useElementHeight from './hooks/useElementHeight'
12
14
  import useKeepActiveItemInView from './hooks/useKeepActiveItemInView'
13
15
 
14
- const ROW_GAP = '0.25rem'
15
-
16
16
  function RcSesSideNav({
17
17
  items,
18
18
  activeItemId,
@@ -57,7 +57,7 @@ function RcSesSideNav({
57
57
  {
58
58
  width: '100%',
59
59
  // Only the mobile bar overlays scrolling content.
60
- backgroundColor: { xs: common.white, md: 'transparent' },
60
+ backgroundColor: { xs: colorTokens['surface-base'], md: 'transparent' },
61
61
  // Above content setting zIndex: 1 - the nav precedes it in DOM order.
62
62
  zIndex: 2,
63
63
  },
@@ -68,7 +68,7 @@ function RcSesSideNav({
68
68
  sx={{
69
69
  display: { xs: 'none', md: 'flex' },
70
70
  flexDirection: 'column',
71
- gap: ROW_GAP,
71
+ gap: spacingRoleBasedTokens['space-4'],
72
72
  // Capped to what is left of the viewport below the sticky header, so
73
73
  // the list can never run past the bottom of the screen. The title stays
74
74
  // put and only the rows scroll, hence minHeight: 0 on this flex column.
@@ -78,9 +78,10 @@ function RcSesSideNav({
78
78
  <Typography
79
79
  sx={{
80
80
  width: '100%',
81
- fontSize: '0.875rem',
82
- lineHeight: '1.25rem',
83
- color: palette.grey[600],
81
+ fontSize: typographyTokens['font-size-body-small'],
82
+ lineHeight: typographyTokens['line-height-body-small'],
83
+ fontWeight: typographyTokens['font-weight-body-small'],
84
+ color: colorTokens['text-secondary'],
84
85
  }}
85
86
  >
86
87
  {navTitle}
@@ -90,7 +91,7 @@ function RcSesSideNav({
90
91
  sx={{
91
92
  display: 'flex',
92
93
  flexDirection: 'column',
93
- gap: ROW_GAP,
94
+ gap: spacingRoleBasedTokens['space-4'],
94
95
  ...(isScrollable && { overflowY: 'auto', minHeight: 0 }),
95
96
  }}
96
97
  >
@@ -7,7 +7,8 @@ import {
7
7
  WarningFillIcon,
8
8
  XCircleFillIcon,
9
9
  } from '@/library/icons'
10
- import { error, primary, secondary, warning } from '@/theme/palette'
10
+ import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
11
+ import { spacingTokens } from '@/theme/spacingTokens'
11
12
 
12
13
  import { type SnackbarSize, type SnackbarState } from './types'
13
14
 
@@ -15,6 +16,24 @@ export const SNACKBAR_DURATION = 10000 // 10s
15
16
 
16
17
  export const SNACKBAR_ICON_SIZE = { width: 18, height: 20 }
17
18
 
19
+ // Figma binds the state icons to the 400 primitives, which read on the dark
20
+ // surface; the status-*-icon roles are meant for light backgrounds.
21
+ const STATE_ICON_COLORS = {
22
+ success: 'var(--rc-color-greens-400)',
23
+ error: 'var(--rc-color-red-400)',
24
+ warning: 'var(--rc-color-yellows-400)',
25
+ info: 'var(--rc-color-cyans-400)',
26
+ }
27
+
28
+ // Figma uses the same padding for both sizes: the Snackbar aliases on the
29
+ // top, bottom and left, 12px on the right next to the close button.
30
+ const SNACKBAR_PADDING = [
31
+ spacingTokens['spacing-aliases-snackbar-padding-y'],
32
+ spacingRoleBasedTokens['space-12'],
33
+ spacingTokens['spacing-aliases-snackbar-padding-y'],
34
+ spacingTokens['spacing-aliases-snackbar-padding-x'],
35
+ ].join(' ')
36
+
18
37
  export const SNACKBAR_CHAR_LIMITS: Record<SnackbarSize, number> = {
19
38
  standard: 120,
20
39
  compact: 60,
@@ -31,31 +50,31 @@ export const stateConfig: Record<
31
50
  > = {
32
51
  success: {
33
52
  icon: CheckCircleFillIcon,
34
- color: secondary['400'],
53
+ color: STATE_ICON_COLORS.success,
35
54
  severity: 'success',
36
55
  ariaLive: 'polite',
37
56
  },
38
57
  error: {
39
58
  icon: XCircleFillIcon,
40
- color: error['400'],
59
+ color: STATE_ICON_COLORS.error,
41
60
  severity: 'error',
42
61
  ariaLive: 'assertive',
43
62
  },
44
63
  warning: {
45
64
  icon: WarningFillIcon,
46
- color: warning['400'],
65
+ color: STATE_ICON_COLORS.warning,
47
66
  severity: 'warning',
48
67
  ariaLive: 'polite',
49
68
  },
50
69
  info: {
51
70
  icon: InfoFillIcon,
52
- color: primary['400'],
71
+ color: STATE_ICON_COLORS.info,
53
72
  severity: 'info',
54
73
  ariaLive: 'polite',
55
74
  },
56
75
  'action-needed': {
57
76
  icon: ScrollIcon,
58
- color: primary['400'],
77
+ color: STATE_ICON_COLORS.info,
59
78
  severity: 'info',
60
79
  ariaLive: 'assertive',
61
80
  },
@@ -72,11 +91,11 @@ export const sizeConfig: Record<
72
91
  standard: {
73
92
  maxHeight: 120,
74
93
  width: 400,
75
- padding: '12px 16px',
94
+ padding: SNACKBAR_PADDING,
76
95
  },
77
96
  compact: {
78
97
  maxHeight: 96,
79
98
  width: 320,
80
- padding: '8px 12px',
99
+ padding: SNACKBAR_PADDING,
81
100
  },
82
101
  }