@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
@@ -7,8 +7,10 @@ import { lt } from 'date-fns/locale/lt'
7
7
  import { useForm } from 'react-hook-form'
8
8
  import { describe, expect, test } from 'vitest'
9
9
 
10
+ import { borderTokens } from '@/theme/borderTokens'
11
+ import { colorTokens } from '@/theme/colorTokens'
10
12
  import theme from '@/theme/light'
11
- import palette, { common } from '@/theme/palette'
13
+ import { typographyTokens } from '@/theme/typographyTokens'
12
14
 
13
15
  import RcSesDatepicker from '.'
14
16
 
@@ -47,28 +49,30 @@ function Harness({ value = null, maxDate }: HarnessProps) {
47
49
  )
48
50
  }
49
51
 
50
- const rgb = (hex: string) => {
51
- const n = parseInt(hex.slice(1), 16)
52
- // eslint-disable-next-line no-bitwise
53
- return `rgb(${(n >> 16) & 255}, ${(n >> 8) & 255}, ${n & 255})`
54
- }
55
-
52
+ // JSDOM preserves var() references; resolved colours and live updates are tested in Playwright.
56
53
  const dayColour = (label: string) =>
57
54
  window.getComputedStyle(screen.getByRole('gridcell', { name: label })).color
58
55
 
59
56
  describe('RcSesDatepicker calendar day colours', () => {
57
+ test('day numbers use the Body/Regular typography role', () => {
58
+ render(<Harness />)
59
+ const style = window.getComputedStyle(screen.getByRole('gridcell', { name: '19' }))
60
+ expect(style.fontSize).toBe(typographyTokens['font-size-body-regular'])
61
+ expect(style.lineHeight).toBe(typographyTokens['line-height-body-regular'])
62
+ })
63
+
60
64
  // Pinned here rather than left to the visual suite: a colour-only change on a
61
65
  // few glyphs stays under its diff budget.
62
66
  test('a selectable weekday uses the default day colour', () => {
63
67
  render(<Harness maxDate={MAX} />)
64
68
 
65
- expect(dayColour('19')).toBe(rgb(palette.grey['900']))
69
+ expect(dayColour('19')).toBe(colorTokens['text-default'])
66
70
  })
67
71
 
68
72
  test('a disabled weekday is greyed out', () => {
69
73
  render(<Harness maxDate={MAX} />)
70
74
 
71
- expect(dayColour('21')).toBe(rgb(palette.grey['400']))
75
+ expect(dayColour('21')).toBe(colorTokens['text-muted'])
72
76
  })
73
77
 
74
78
  // 1.x paints it white; v9 lost that to the theme's day colour.
@@ -78,14 +82,14 @@ describe('RcSesDatepicker calendar day colours', () => {
78
82
  const selected = document.querySelector('.Mui-selected') as HTMLElement
79
83
  const cs = window.getComputedStyle(selected)
80
84
 
81
- expect(cs.backgroundColor).toBe(rgb(palette.primary['500']))
82
- expect(cs.color).toBe(rgb(common.white))
85
+ expect(cs.backgroundColor).toBe(colorTokens['control-selected'])
86
+ expect(cs.color).toBe(colorTokens['text-inverse'])
83
87
  })
84
88
 
85
- test('a disabled weekend day stays red, as in 1.x', () => {
89
+ test('a disabled weekend preserves the existing red distinction through a token', () => {
86
90
  render(<Harness maxDate={MAX} />)
87
91
 
88
- expect(dayColour('24')).toBe(rgb(palette.error['600']))
92
+ expect(dayColour('24')).toBe('var(--rc-color-red-600)')
89
93
  })
90
94
  })
91
95
 
@@ -98,8 +102,8 @@ describe('RcSesDatepicker field styling', () => {
98
102
  const field = document.querySelector('.MuiPickersInputBase-root') as HTMLElement
99
103
  const cs = window.getComputedStyle(field)
100
104
 
101
- expect(cs.borderRadius).toBe('0.5rem')
102
- expect(cs.backgroundColor).toBe(rgb(common.white))
105
+ expect(cs.borderRadius).toBe(borderTokens['radius-input'])
106
+ expect(cs.backgroundColor).toBe(colorTokens['surface-base'])
103
107
  })
104
108
 
105
109
  test('the value text matches a plain input', () => {
@@ -110,8 +114,9 @@ describe('RcSesDatepicker field styling', () => {
110
114
  ) as HTMLElement
111
115
  const cs = window.getComputedStyle(sections)
112
116
 
113
- expect(cs.fontSize).toBe('0.9375rem')
114
- expect(cs.height).toBe('1.125rem')
115
- expect(cs.color).toBe(rgb(palette.grey['900']))
117
+ expect(cs.fontSize).toBe(typographyTokens['font-size-body-regular'])
118
+ expect(cs.lineHeight).toBe(typographyTokens['line-height-body-regular'])
119
+ expect(cs.height).toBe(typographyTokens['line-height-body-regular'])
120
+ expect(cs.color).toBe(colorTokens['text-default'])
116
121
  })
117
122
  })
@@ -1,153 +1,23 @@
1
- import { IconButton, InputAdornment, useMediaQuery } from '@mui/material'
2
- import type { DatePickerProps } from '@mui/x-date-pickers/DatePicker'
3
- import { DatePicker } from '@mui/x-date-pickers/DatePicker'
4
- import { usePickerAdapter } from '@mui/x-date-pickers/hooks'
5
- import { parseISO } from 'date-fns'
6
- import { fromZonedTime } from 'date-fns-tz'
7
- import React, { useEffect, useMemo } from 'react'
8
- import { UseControllerProps, useController } from 'react-hook-form'
9
- import { useTranslation } from 'react-i18next'
10
- import { v4 as uuidv4 } from 'uuid'
11
-
12
- import { CalendarBlankIcon, XCircleFillIcon } from '@/assets/icons/phosphorIcons'
13
- import theme from '@/theme/light'
14
-
15
- import RcSesFormControlWrapper, {
16
- RcSesFormControlWrapperProps,
17
- } from '../../components/FormControlWrapper'
18
- import RcSesDatepickerActionBar from './components/RcSesDatepickerActionBar'
19
- import RcSesDatepickerCalendarHeader from './components/RcSesDatepickerCalendarHeader'
20
-
21
- type TFieldProps = UseControllerProps<any, any>
22
- type TWrapperProps = RcSesFormControlWrapperProps
23
- type ImmediateWrapperProps = 'label' | 'errors'
24
-
25
- type Props = TFieldProps &
26
- Pick<TWrapperProps, ImmediateWrapperProps> & {
27
- id?: string
28
- clearable?: boolean
29
- slotProps?: {
30
- datepicker?: DatePickerProps
31
- wrapper?: Partial<Omit<TWrapperProps, ImmediateWrapperProps>>
1
+ import React from 'react'
2
+
3
+ import RangeDatepicker, { RangeDatepickerProps } from './RangeDatepicker'
4
+ import SingleDatepicker, { SingleDatepickerProps } from './SingleDatepicker'
5
+
6
+ export type { DateRangeValue } from './rangeModel'
7
+ export type { RangeDatepickerProps }
8
+ export type DatepickerProps =
9
+ | (SingleDatepickerProps & { selection?: 'single' })
10
+ | (RangeDatepickerProps & { selection: 'range' })
11
+
12
+ const RcSesDatepicker = React.forwardRef<HTMLInputElement, DatepickerProps>(
13
+ (props, ref) => {
14
+ if (props.selection === 'range') {
15
+ const { selection, ...rangeProps } = props
16
+ return <RangeDatepicker {...rangeProps} ref={ref} />
32
17
  }
33
- }
34
-
35
- const RcSesDatepicker = React.forwardRef<HTMLInputElement, Props>((props, ref) => {
36
- const { t } = useTranslation('input', { keyPrefix: 'components.RcSesDatepicker' })
37
- const upMd = useMediaQuery(theme.breakpoints.up('md'))
38
-
39
- const { id: idProp, clearable, errors, label, slotProps, ...controllerProps } = props
40
-
41
- // v9 no longer exports MuiPickersAdapterContext from LocalizationProvider;
42
- // usePickerAdapter is the public replacement for the `utils` adapter.
43
- const dateAdapter = usePickerAdapter()
44
-
45
- const {
46
- field: { onChange, value, disabled },
47
- } = useController(controllerProps)
48
-
49
- const id = useMemo(() => idProp ?? uuidv4(), [idProp])
50
-
51
- const [modelValue, setModelValue] = React.useState<Date | null>(
52
- value ? parseISO(value) : null,
53
- )
54
-
55
- const handleOnChange = (newValue: Date | null) => {
56
- try {
57
- onChange((newValue && fromZonedTime(newValue, 'UTC').toISOString()) ?? '')
58
- } catch {
59
- onChange(null)
60
- }
61
- }
62
-
63
- useEffect(() => {
64
- if (value !== modelValue) setModelValue(value ? parseISO(value) : null)
65
- // eslint-disable-next-line react-hooks/exhaustive-deps
66
- }, [value])
67
-
68
- return (
69
- <RcSesFormControlWrapper
70
- id={id}
71
- errors={errors}
72
- label={label}
73
- required={!!props?.rules?.required}
74
- {...slotProps?.wrapper}
75
- >
76
- <DatePicker
77
- inputRef={ref}
78
- closeOnSelect
79
- dayOfWeekFormatter={(date: Date) =>
80
- dateAdapter.format(date, 'weekdayShort').substring(0, 2)
81
- }
82
- disabled={disabled}
83
- onChange={handleOnChange}
84
- openTo='day'
85
- showDaysOutsideCurrentMonth
86
- slots={{
87
- actionBar: RcSesDatepickerActionBar,
88
- calendarHeader: RcSesDatepickerCalendarHeader,
89
- openPickerIcon: CalendarBlankIcon,
90
- }}
91
- {...(slotProps?.datepicker ?? {})}
92
- slotProps={{
93
- actionBar: {
94
- actions: ['cancel'],
95
- ...(slotProps?.datepicker?.slotProps?.actionBar ?? {}),
96
- },
97
- inputAdornment: {
98
- position: 'start',
99
- sx: { mr: '0 !important' },
100
- ...(slotProps?.datepicker?.slotProps?.inputAdornment ?? {}),
101
- },
102
- textField: {
103
- id,
104
- error: !!errors,
105
- fullWidth: true,
106
- ...(slotProps?.datepicker?.slotProps?.textField ?? {}),
107
-
108
- slotProps: {
109
- input: {
110
- ...(!upMd
111
- ? {
112
- startAdornment: (
113
- <InputAdornment
114
- aria-label={t('aria.openCalendar')}
115
- position='start'
116
- sx={{ mr: 0 }}
117
- >
118
- <IconButton>
119
- <CalendarBlankIcon />
120
- </IconButton>
121
- </InputAdornment>
122
- ),
123
- }
124
- : {}),
125
- endAdornment: !!value && clearable && (
126
- <InputAdornment position='end'>
127
- <IconButton
128
- aria-label={t('aria.clearValue')}
129
- onClick={() => handleOnChange(null)}
130
- >
131
- <XCircleFillIcon />
132
- </IconButton>
133
- </InputAdornment>
134
- ),
135
- },
136
- },
137
- },
138
- toolbar: { hidden: true },
139
- }}
140
- value={modelValue}
141
- sx={{
142
- '.MuiInputBase-input': {
143
- paddingLeft: 0,
144
- paddingRight: 0,
145
- },
146
- ...(slotProps?.datepicker?.sx ?? {}),
147
- }}
148
- />
149
- </RcSesFormControlWrapper>
150
- )
151
- })
18
+ const { selection, ...singleProps } = props
19
+ return <SingleDatepicker {...singleProps} ref={ref} />
20
+ },
21
+ )
152
22
 
153
23
  export default RcSesDatepicker
@@ -0,0 +1,35 @@
1
+ import { describe, expect, test } from 'vitest'
2
+
3
+ import { readRange, selectRange } from './rangeModel'
4
+
5
+ describe('DatePicker range model', () => {
6
+ test('starts a new range and preserves a partial selection', () => {
7
+ expect(selectRange([null, null], new Date(2026, 5, 10))).toEqual(['2026-06-10', null])
8
+ expect(readRange(['2026-06-10', null])).toEqual(['2026-06-10', null])
9
+ })
10
+ test('normalizes reverse selection and supports one-day ranges', () => {
11
+ expect(selectRange(['2026-06-17', null], new Date(2026, 5, 10))).toEqual([
12
+ '2026-06-10',
13
+ '2026-06-17',
14
+ ])
15
+ expect(selectRange(['2026-06-10', null], new Date(2026, 5, 10))).toEqual([
16
+ '2026-06-10',
17
+ '2026-06-10',
18
+ ])
19
+ })
20
+ test('restarts after a complete selection and spans years', () => {
21
+ expect(selectRange(['2026-06-10', '2026-06-17'], new Date(2026, 11, 31))).toEqual([
22
+ '2026-12-31',
23
+ null,
24
+ ])
25
+ expect(selectRange(['2026-12-31', null], new Date(2027, 0, 5))).toEqual([
26
+ '2026-12-31',
27
+ '2027-01-05',
28
+ ])
29
+ })
30
+ test('rejects malformed form values without crashing', () => {
31
+ expect(readRange(undefined)).toEqual([null, null])
32
+ expect(readRange(['invalid', '2026-06-10'])).toEqual([null, null])
33
+ expect(readRange(['2026-06-17', '2026-06-10'])).toEqual(['2026-06-10', '2026-06-17'])
34
+ })
35
+ })
@@ -0,0 +1,25 @@
1
+ import { format, isValid, parseISO } from 'date-fns'
2
+
3
+ /** Local calendar dates, without timezone conversion. Partial selection is supported. */
4
+ export type DateRangeValue = [string | null, string | null]
5
+
6
+ export function readRange(value: unknown): DateRangeValue {
7
+ if (!Array.isArray(value)) return [null, null]
8
+ const valid = (item: unknown) =>
9
+ typeof item === 'string' &&
10
+ /^\d{4}-\d{2}-\d{2}$/.test(item) &&
11
+ isValid(parseISO(item))
12
+ ? item
13
+ : null
14
+ const start = valid(value[0])
15
+ const end = valid(value[1])
16
+ if (!start) return [null, null]
17
+ return end && end < start ? [end, start] : [start, end]
18
+ }
19
+
20
+ export function selectRange(value: DateRangeValue, day: Date): DateRangeValue {
21
+ const next = format(day, 'yyyy-MM-dd')
22
+ const [start, end] = value
23
+ if (!start || end) return [next, null]
24
+ return next < start ? [next, start] : [start, next]
25
+ }
@@ -1,4 +1,4 @@
1
- import { Box, IconButton, Stack, Typography, styled } from '@mui/material'
1
+ import { Box, IconButton, Stack, Typography } from '@mui/material'
2
2
  import React, { useCallback, useMemo } from 'react'
3
3
  import type { DropzoneOptions } from 'react-dropzone'
4
4
  import { useDropzone } from 'react-dropzone'
@@ -8,21 +8,20 @@ import { v4 as uuidv4 } from 'uuid'
8
8
 
9
9
  import { UploadSimpleIcon, XCircleFillIcon } from '@/assets/icons/phosphorIcons'
10
10
  import IconWithCircularBackground from '@/components/common/IconWithCircularBackground'
11
- import palette from '@/theme/palette'
11
+ import { borderTokens } from '@/theme/borderTokens'
12
+ import { colorTokens } from '@/theme/colorTokens'
13
+ import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
14
+ import { typographyTokens } from '@/theme/typographyTokens'
12
15
 
13
16
  import RcSesFormControlWrapper, {
14
17
  RcSesFormControlWrapperProps,
15
18
  } from '../components/FormControlWrapper'
16
19
 
17
- const StyledCloseIcon = styled(XCircleFillIcon)({
18
- 'path fill': palette.grey[950],
19
- })
20
-
21
20
  type TControllerProps = UseControllerProps<any, any>
22
- type ImmediateControllerProps = 'control' | 'rules'
21
+ type ImmediateControllerProps = 'control' | 'disabled' | 'rules'
23
22
 
24
23
  type TFieldProps = React.InputHTMLAttributes<HTMLInputElement>
25
- type ImmediateFieldProps = 'onChange' | 'onBlur' | 'disabled' | 'name'
24
+ type ImmediateFieldProps = 'onChange' | 'onBlur' | 'name'
26
25
 
27
26
  type TWrapperProps = RcSesFormControlWrapperProps
28
27
  type ImmediateWrapperProps = 'label' | 'errors'
@@ -42,7 +41,7 @@ type Props = Pick<TControllerProps, ImmediateControllerProps> &
42
41
  function RcSesFileDropzone(props: Props) {
43
42
  const { t } = useTranslation('input', { keyPrefix: 'components.RcSesFileDropzone' })
44
43
 
45
- const { control, errors, label, rules, slotProps, ...fieldProps } = props
44
+ const { control, disabled, errors, label, rules, slotProps, ...fieldProps } = props
46
45
  const { name } = fieldProps
47
46
  const { description, ...wrapperProps } = slotProps?.wrapper ?? {}
48
47
 
@@ -63,6 +62,7 @@ function RcSesFileDropzone(props: Props) {
63
62
  }, [])
64
63
 
65
64
  const { getRootProps, getInputProps, isDragActive } = useDropzone({
65
+ disabled,
66
66
  onDrop,
67
67
  ...slotProps?.dropzone,
68
68
  })
@@ -88,44 +88,60 @@ function RcSesFileDropzone(props: Props) {
88
88
  >
89
89
  <Box
90
90
  {...getRootProps()}
91
+ aria-describedby={description ? `${id}-description` : undefined}
92
+ aria-invalid={!!errors}
93
+ aria-label={t('aria.dropzoneLabel')}
94
+ tabIndex={disabled ? -1 : 0}
91
95
  sx={{
92
96
  backgroundColor: () => {
93
- if (fieldProps.disabled) return 'white'
94
- return isDragActive ? palette.primary[50] : 'white'
97
+ if (disabled) return colorTokens['surface-sunken']
98
+ return isDragActive
99
+ ? colorTokens['surface-brand-subtle']
100
+ : colorTokens['surface-base']
95
101
  },
96
102
  borderColor: () => {
97
- if (errors) return palette.error[600]
98
- if (fieldProps.disabled) return palette.grey[300]
99
- return isDragActive ? palette.primary[500] : palette.grey[500]
103
+ if (errors) return colorTokens['status-error-border']
104
+ if (disabled) return colorTokens['border-subtle']
105
+ return isDragActive
106
+ ? colorTokens['border-focus']
107
+ : colorTokens['border-default']
100
108
  },
101
- borderRadius: '.5rem',
109
+ borderRadius: borderTokens['radius-input'],
102
110
  borderStyle: 'dashed',
103
- borderWidth: 1,
104
- px: 5.5,
105
- py: 5,
111
+ borderWidth: borderTokens['stroke-1'],
112
+ px: `calc(${spacingRoleBasedTokens['space-40']} + ${spacingRoleBasedTokens['space-4']})`,
113
+ py: spacingRoleBasedTokens['space-40'],
106
114
 
107
115
  '&:hover': {
108
116
  borderColor: () => {
109
- if (fieldProps.disabled) return palette.grey[300]
110
- return palette.primary[300]
117
+ if (disabled) return colorTokens['border-subtle']
118
+ return colorTokens['border-focus']
111
119
  },
112
- cursor: fieldProps.disabled ? 'default' : 'pointer',
120
+ cursor: disabled ? 'default' : 'pointer',
113
121
  },
114
122
  }}
115
123
  >
116
- <input {...getInputProps()} id={id} name={fieldControlProps.name} />
117
-
118
- <Stack direction='row' sx={{ alignItems: 'center', gap: 2 }}>
124
+ <input
125
+ {...getInputProps()}
126
+ disabled={disabled}
127
+ id={id}
128
+ name={fieldControlProps.name}
129
+ />
130
+
131
+ <Stack
132
+ direction='row'
133
+ sx={{ alignItems: 'center', gap: spacingRoleBasedTokens['space-16'] }}
134
+ >
119
135
  <IconWithCircularBackground
120
- color={!fieldProps.disabled && isDragActive ? 'primary' : 'grey'}
121
- bgShade={!fieldProps.disabled && isDragActive ? '100' : '50'}
122
- iconShade={fieldProps.disabled ? '500' : '900'}
136
+ color={!disabled && isDragActive ? 'primary' : 'grey'}
137
+ bgShade={!disabled && isDragActive ? '100' : '50'}
138
+ iconShade={disabled ? '500' : '900'}
123
139
  Icon={UploadSimpleIcon}
124
140
  />
125
141
 
126
142
  <Stack
127
143
  sx={{
128
- gap: 0.5,
144
+ gap: spacingRoleBasedTokens['space-4'],
129
145
  flexGrow: 1,
130
146
  }}
131
147
  >
@@ -136,20 +152,26 @@ function RcSesFileDropzone(props: Props) {
136
152
  // eslint-disable-next-line react/no-array-index-key
137
153
  key={index}
138
154
  direction='row'
139
- sx={{ alignItems: 'center', gap: 1 }}
155
+ sx={{ alignItems: 'center', gap: spacingRoleBasedTokens['space-8'] }}
140
156
  >
141
157
  <Typography
142
158
  sx={{
143
- color: palette.grey[fieldProps.disabled ? 600 : 900],
144
- fontSize: '.875rem',
145
- fontWeight: 600,
146
- lineHeight: '1.125rem',
159
+ color: disabled
160
+ ? colorTokens['text-secondary']
161
+ : colorTokens['text-default'],
162
+ fontSize: typographyTokens['font-size-body-small'],
163
+ fontWeight: typographyTokens['font-weight-semibold'],
164
+ lineHeight: typographyTokens['line-height-body-small'],
147
165
  }}
148
166
  >
149
167
  {file.name}
150
168
  <Typography
151
169
  component='span'
152
- sx={{ color: palette.grey[600], fontSize: '.75rem', ml: 1 }}
170
+ sx={{
171
+ color: colorTokens['text-secondary'],
172
+ fontSize: typographyTokens['font-size-body-micro'],
173
+ ml: spacingRoleBasedTokens['space-8'],
174
+ }}
153
175
  >
154
176
  ({Math.round(file.size / 1024)} KB)
155
177
  </Typography>
@@ -157,7 +179,7 @@ function RcSesFileDropzone(props: Props) {
157
179
 
158
180
  <Box sx={{ ml: 'auto' }}>
159
181
  <IconButton size='small' onClick={(e) => onRemoveFile(e, index)}>
160
- <StyledCloseIcon />
182
+ <XCircleFillIcon fillColor={colorTokens['text-default']} />
161
183
  </IconButton>
162
184
  </Box>
163
185
  </Stack>
@@ -169,8 +191,10 @@ function RcSesFileDropzone(props: Props) {
169
191
  <>
170
192
  <Typography
171
193
  sx={{
172
- color: palette.grey[fieldProps.disabled ? 500 : 900],
173
- fontWeight: 600,
194
+ color: disabled
195
+ ? colorTokens['text-disabled']
196
+ : colorTokens['text-default'],
197
+ fontWeight: typographyTokens['font-weight-semibold'],
174
198
  }}
175
199
  >
176
200
  <Trans t={t} i18nKey='label'>
@@ -178,12 +202,12 @@ function RcSesFileDropzone(props: Props) {
178
202
  <Typography
179
203
  component='span'
180
204
  sx={{
181
- color: fieldProps.disabled
182
- ? palette.grey[500]
183
- : palette.primary[600],
184
- fontSize: '.875rem',
185
- fontWeight: 600,
186
- lineHeight: '1.125rem',
205
+ color: disabled
206
+ ? colorTokens['text-disabled']
207
+ : colorTokens['text-link'],
208
+ fontSize: typographyTokens['font-size-body-small'],
209
+ fontWeight: typographyTokens['font-weight-semibold'],
210
+ lineHeight: typographyTokens['line-height-body-small'],
187
211
  textDecoration: 'underline',
188
212
  }}
189
213
  >
@@ -195,11 +219,14 @@ function RcSesFileDropzone(props: Props) {
195
219
 
196
220
  {!!description && (
197
221
  <Typography
222
+ id={`${id}-description`}
198
223
  sx={{
199
- color: palette.grey[fieldProps.disabled ? 500 : 600],
200
- fontSize: '.75rem',
224
+ color: disabled
225
+ ? colorTokens['text-disabled']
226
+ : colorTokens['text-secondary'],
227
+ fontSize: typographyTokens['font-size-body-micro'],
201
228
  fontStyle: 'italic',
202
- lineHeight: '1rem',
229
+ lineHeight: typographyTokens['line-height-body-micro'],
203
230
  }}
204
231
  >
205
232
  {description}
@@ -5,7 +5,10 @@ import { useTranslation } from 'react-i18next'
5
5
  import { v4 as uuidv4 } from 'uuid'
6
6
 
7
7
  import { UploadSimpleIcon } from '@/assets/icons/phosphorIcons'
8
- import palette from '@/theme/palette'
8
+ import { borderTokens } from '@/theme/borderTokens'
9
+ import { colorTokens } from '@/theme/colorTokens'
10
+ import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
11
+ import { typographyTokens } from '@/theme/typographyTokens'
9
12
 
10
13
  import RcSesFormControlWrapper, {
11
14
  RcSesFormControlWrapperProps,
@@ -76,23 +79,23 @@ function RcSesFileUpload(props: Props) {
76
79
  fullWidth
77
80
  role={undefined}
78
81
  sx={{
79
- backgroundColor: 'white !important',
80
- borderRadius: '0.5rem',
82
+ backgroundColor: `${colorTokens['surface-base']} !important`,
83
+ borderRadius: borderTokens['radius-input'],
81
84
  display: 'flex',
82
85
  justifyContent: 'space-between',
83
86
  minHeight: '2.75rem',
84
87
  overflow: 'hidden',
85
88
  p: 0,
86
- pl: 1.25,
89
+ pl: spacingRoleBasedTokens['space-10'],
87
90
  pr: 0,
88
91
  position: 'relative',
89
92
 
90
93
  'input:focus-visible ~ .faux-button::after': {
91
94
  content: '""',
92
95
  background: 'transparent',
93
- border: '2px solid',
94
- borderColor: palette.grey[950],
95
- borderRadius: '.5rem',
96
+ border: `${borderTokens['border-focus']} solid`,
97
+ borderColor: colorTokens['border-focus'],
98
+ borderRadius: borderTokens['radius-input'],
96
99
  height: 'calc(100% + 6px)',
97
100
  left: '-3px',
98
101
  position: 'absolute',
@@ -121,24 +124,30 @@ function RcSesFileUpload(props: Props) {
121
124
  sx={{
122
125
  alignItems: 'center',
123
126
  alignSelf: 'stretch',
124
- backgroundColor: palette.grey['100'],
125
- borderColor: palette.grey['500'],
126
- borderBottomRightRadius: 'calc(0.5rem - 1px)',
127
+ backgroundColor: colorTokens['surface-sunken'],
128
+ borderColor: colorTokens['border-default'],
129
+ borderBottomRightRadius: `calc(${borderTokens['radius-input']} - ${borderTokens['stroke-1']})`,
127
130
  borderLeftStyle: 'solid',
128
- borderLeftWidth: '1px',
129
- borderTopRightRadius: 'calc(0.5rem - 1px)',
130
- color: palette.grey['900'],
131
+ borderLeftWidth: borderTokens['stroke-1'],
132
+ borderTopRightRadius: `calc(${borderTokens['radius-input']} - ${borderTokens['stroke-1']})`,
133
+ color: colorTokens['text-default'],
131
134
  display: 'flex',
132
135
  flexShrink: 0,
133
136
  position: 'relative',
134
- px: 2,
137
+ px: spacingRoleBasedTokens['space-16'],
135
138
  ':hover': {
136
- backgroundColor: palette.grey['200'],
139
+ backgroundColor: colorTokens['surface-muted'],
137
140
  },
138
141
  }}
139
142
  >
140
143
  <UploadSimpleIcon />
141
- <Typography variant='body1' sx={{ fontWeight: 600, ml: 1 }}>
144
+ <Typography
145
+ variant='body1'
146
+ sx={{
147
+ fontWeight: typographyTokens['font-weight-semibold'],
148
+ ml: spacingRoleBasedTokens['space-8'],
149
+ }}
150
+ >
142
151
  {t('label')}
143
152
  </Typography>
144
153
  </Box>