@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
@@ -5,49 +5,64 @@ import { useTranslation } from 'react-i18next'
5
5
  import { v4 as uuidv4 } from 'uuid'
6
6
 
7
7
  import { MinusBoldIcon, PlusBoldIcon } from '@/assets/icons/phosphorIcons'
8
- import palette from '@/theme/palette'
8
+ import { borderTokens } from '@/theme/borderTokens'
9
+ import { colorTokens } from '@/theme/colorTokens'
10
+ import { sizeTokens } from '@/theme/sizeTokens'
11
+ import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
9
12
 
10
13
  import RcSesFormControlWrapper, {
11
14
  RcSesFormControlWrapperProps,
12
15
  } from '../components/FormControlWrapper'
13
16
 
17
+ // Figma has no segment hover state and no role matches the existing tint,
18
+ // so the primitive stays local.
19
+ const stepperHoverBackground = 'var(--rc-color-neutrals-200)'
20
+
14
21
  const NumberInput = styled(OutlinedInput)({
15
- paddingRight: '0 !important',
22
+ paddingRight: `${spacingRoleBasedTokens['space-0']} !important`,
23
+ gap: spacingRoleBasedTokens['space-0'],
16
24
 
17
25
  'input[type=number]': {
18
26
  MozAppearance: 'textfield',
19
27
  },
20
28
  'input[type=number]::-webkit-outer-spin-button': {
21
29
  WebkitAppearance: 'none',
22
- margin: 0,
30
+ margin: spacingRoleBasedTokens['space-0'],
23
31
  },
24
32
  'input[type=number]::-webkit-inner-spin-button': {
25
33
  WebkitAppearance: 'none',
26
- margin: 0,
34
+ margin: spacingRoleBasedTokens['space-0'],
27
35
  },
28
36
 
29
37
  '.MuiButtonBase-root': {
30
- backgroundColor: palette.grey['100'],
38
+ alignSelf: 'stretch',
39
+ height: 'auto',
40
+ backgroundColor: colorTokens['surface-sunken'],
31
41
  borderRightStyle: 'none !important',
32
42
 
33
43
  '&:last-of-type': {
34
- borderTopRightRadius: '.5rem',
35
- borderBottomRightRadius: '.5rem',
44
+ borderTopRightRadius: borderTokens['radius-input'],
45
+ borderBottomRightRadius: borderTokens['radius-input'],
36
46
  },
37
47
 
38
48
  '&:hover:not(:disabled)': {
39
- backgroundColor: palette.grey['200'],
49
+ backgroundColor: stepperHoverBackground,
40
50
  },
41
51
 
42
52
  '&.Mui-disabled': {
43
- backgroundColor: `${palette.grey['100']} !important`,
44
- borderLeftColor: `${palette.grey['600']} !important`,
53
+ borderWidth: `${borderTokens['stroke-0']} ${borderTokens['stroke-0']} ${borderTokens['stroke-0']} ${borderTokens['stroke-1']}`,
54
+ backgroundColor: `${colorTokens['surface-sunken']} !important`,
55
+ borderLeftColor: `${colorTokens['border-subtle']} !important`,
45
56
 
46
57
  'svg path': {
47
- fill: palette.grey['600'],
58
+ fill: colorTokens['text-muted'],
48
59
  },
49
60
  },
50
61
  },
62
+
63
+ '&.Mui-disabled .MuiButtonBase-root.Mui-disabled': {
64
+ borderLeftColor: `${colorTokens['border-subtle']} !important`,
65
+ },
51
66
  })
52
67
 
53
68
  interface ArrowButtonProps {
@@ -66,11 +81,18 @@ function ArrowButton({ ariaLabel, onClick, disabled, direction }: ArrowButtonPro
66
81
  disabled={disabled}
67
82
  variant='outlined'
68
83
  sx={{
69
- color: 'grey.900',
70
- borderRadius: 0,
71
- borderWidth: '0 0 0 1px',
84
+ color: colorTokens['text-default'],
85
+ borderRadius: borderTokens['radius-0'],
86
+ borderWidth: `${borderTokens['stroke-0']} ${borderTokens['stroke-0']} ${borderTokens['stroke-0']} ${borderTokens['stroke-1']}`,
87
+ '&&': { borderLeftColor: colorTokens['border-subtle'] },
88
+ // No stepper width/padding roles exist; retain the existing 44px/13px values.
72
89
  minWidth: '2.75rem',
73
90
  padding: '.8125rem !important',
91
+ // No stepper icon role exists; retain the existing 16px icon size.
92
+ '& > svg': {
93
+ width: sizeTokens['icon-size-16'],
94
+ height: sizeTokens['icon-size-16'],
95
+ },
74
96
 
75
97
  '&::before': {
76
98
  content: 'unset',
@@ -4,7 +4,9 @@ import TextField from '@mui/material/TextField'
4
4
  import { useTranslation } from 'react-i18next'
5
5
 
6
6
  import { MagnifyingGlassIcon } from '@/assets/icons/phosphorIcons'
7
- import palette from '@/theme/palette'
7
+ import { borderTokens } from '@/theme/borderTokens'
8
+ import { colorTokens } from '@/theme/colorTokens'
9
+ import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
8
10
 
9
11
  function AutocompleteInput(props: AutocompleteRenderInputParams) {
10
12
  const { t } = useTranslation('input', {
@@ -25,16 +27,19 @@ function AutocompleteInput(props: AutocompleteRenderInputParams) {
25
27
  ...slotProps.input,
26
28
  endAdornment: null,
27
29
  startAdornment: (
28
- <InputAdornment position='start' sx={{ pl: 1 }}>
29
- <MagnifyingGlassIcon fillColor={palette.grey[900]} />
30
+ <InputAdornment
31
+ position='start'
32
+ sx={{ pl: spacingRoleBasedTokens['space-8'] }}
33
+ >
34
+ <MagnifyingGlassIcon fillColor={colorTokens['text-muted']} />
30
35
  </InputAdornment>
31
36
  ),
32
37
  },
33
38
  }}
34
39
  placeholder={t('search')}
35
40
  sx={{
36
- borderBottom: '1px solid #eaecef',
37
- padding: '.75rem 1rem',
41
+ borderBottom: `${borderTokens['stroke-1']} solid ${colorTokens['border-subtle']}`,
42
+ padding: `${spacingRoleBasedTokens['space-12']} ${spacingRoleBasedTokens['space-16']}`,
38
43
  width: '100%',
39
44
  }}
40
45
  />
@@ -2,6 +2,8 @@ import Box from '@mui/material/Box'
2
2
  import React from 'react'
3
3
  import { List } from 'react-window'
4
4
 
5
+ import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
6
+
5
7
  import RowComponent from './RowComponent'
6
8
 
7
9
  const ROW_HEIGHT = 44
@@ -37,7 +39,11 @@ const ListboxComponent = React.forwardRef<
37
39
  )
38
40
 
39
41
  return (
40
- <Box lang='en' ref={ref} sx={{ m: 0.75, ul: { m: 0, p: 0, width: 'auto' } }}>
42
+ <Box
43
+ lang='en'
44
+ ref={ref}
45
+ sx={{ m: spacingRoleBasedTokens['space-6'], ul: { m: 0, p: 0, width: 'auto' } }}
46
+ >
41
47
  <List
42
48
  {...other}
43
49
  overscanCount={5}
@@ -1,6 +1,9 @@
1
1
  import { autocompleteClasses } from '@mui/material/Autocomplete'
2
2
  import Box from '@mui/material/Box'
3
3
 
4
+ import { colorTokens } from '@/theme/colorTokens'
5
+ import { typographyTokens } from '@/theme/typographyTokens'
6
+
4
7
  interface Props {
5
8
  anchorEl?: any
6
9
  disablePortal?: boolean
@@ -17,12 +20,12 @@ function PopperComponent(props: Props) {
17
20
  [`& .${autocompleteClasses.paper}`]: {
18
21
  boxShadow: 'none',
19
22
  color: 'inherit',
20
- fontSize: 13,
23
+ fontSize: typographyTokens['font-size-body-caption'],
21
24
  margin: 0,
22
25
  width: 'auto',
23
26
  },
24
27
  [`& .${autocompleteClasses.listbox}`]: {
25
- backgroundColor: '#fff',
28
+ backgroundColor: colorTokens['surface-base'],
26
29
  padding: 0,
27
30
  scrollbarWidth: 'thin',
28
31
  },
@@ -3,6 +3,10 @@ import Stack from '@mui/material/Stack'
3
3
  import Typography from '@mui/material/Typography'
4
4
  import type { RowComponentProps } from 'react-window'
5
5
 
6
+ import { borderTokens } from '@/theme/borderTokens'
7
+ import { sizeTokens } from '@/theme/sizeTokens'
8
+ import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
9
+
6
10
  // react-window 2 passes `index` and `style` plus whatever is given in `rowProps`,
7
11
  // replacing v1's single `data` array.
8
12
  type Props = RowComponentProps<{ items: any[] }>
@@ -18,9 +22,9 @@ function RowComponent(props: Props) {
18
22
  sx={{
19
23
  alignItems: 'center !important',
20
24
  backgroundSize: 'auto',
21
- borderRadius: '.375rem',
25
+ borderRadius: borderTokens['radius-6'],
22
26
  flexDirection: 'row !important',
23
- gap: 1.5,
27
+ gap: spacingRoleBasedTokens['space-12'],
24
28
  right: 0,
25
29
  m: '0 !important',
26
30
  }}
@@ -32,11 +36,11 @@ function RowComponent(props: Props) {
32
36
  component='span'
33
37
  sx={{
34
38
  backgroundSize: '2.25rem auto',
35
- borderRadius: '50%',
39
+ borderRadius: borderTokens['radius-full'],
36
40
  flexShrink: 0,
37
- height: '1.5rem',
41
+ height: sizeTokens['icon-size-24'],
38
42
  objectFit: 'cover',
39
- width: '1.5rem',
43
+ width: sizeTokens['icon-size-24'],
40
44
  }}
41
45
  title={option?.name}
42
46
  />
@@ -15,14 +15,18 @@ import Autocomplete, {
15
15
  } from '@mui/material/Autocomplete'
16
16
  import countriesList from 'countries-phone-masks'
17
17
  import { Mask } from 'maska'
18
- import React, { useMemo } from 'react'
18
+ import React, { useId, useMemo } from 'react'
19
19
  import { UseControllerProps, useController } from 'react-hook-form'
20
20
  import { useTranslation } from 'react-i18next'
21
21
 
22
22
  import { CaretDownFill } from '@/assets/icons/phosphorIcons'
23
23
  import '@/i18n/i18n'
24
+ import { borderTokens } from '@/theme/borderTokens'
25
+ import { colorTokens } from '@/theme/colorTokens'
26
+ import { effectTokens } from '@/theme/effectTokens'
24
27
  import theme from '@/theme/light'
25
- import palette from '@/theme/palette'
28
+ import { sizeTokens } from '@/theme/sizeTokens'
29
+ import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
26
30
 
27
31
  import { RcSesFormControlWrapperProps } from '../../components/FormControlWrapper'
28
32
  import AutocompleteInput from './components/AutocompleteInput'
@@ -65,7 +69,7 @@ function RcSesPhoneInputFormControl(props: Props) {
65
69
  keyPrefix: 'components.RcSesPhoneInputFormControl',
66
70
  })
67
71
 
68
- const { id, control, name, rules, slotProps } = props
72
+ const { id, control, name, rules, slotProps, disabled, errors } = props
69
73
 
70
74
  const [country, setCountry] = React.useState<Country>(DEFAULT_COUNTRY)
71
75
 
@@ -108,7 +112,7 @@ function RcSesPhoneInputFormControl(props: Props) {
108
112
  }
109
113
 
110
114
  const open = Boolean(anchorEl)
111
- const popperId = open ? 'phoneNumberAutocomplete' : undefined
115
+ const popperId = useId()
112
116
 
113
117
  const countryOptions = React.useMemo(
114
118
  () =>
@@ -124,6 +128,8 @@ function RcSesPhoneInputFormControl(props: Props) {
124
128
  <TextField
125
129
  {...controllerProps}
126
130
  fullWidth
131
+ disabled={disabled}
132
+ error={!!errors}
127
133
  slotProps={{
128
134
  // Was inputProps: targets the native <input>.
129
135
  htmlInput: {
@@ -141,28 +147,32 @@ function RcSesPhoneInputFormControl(props: Props) {
141
147
  >
142
148
  <InputAdornment position='start' sx={{ mr: 0 }}>
143
149
  <Button
144
- aria-describedby={popperId}
150
+ aria-controls={popperId}
151
+ aria-expanded={open}
145
152
  aria-label={t('aria.countrySelectorLabel')}
146
- aria-haspopup
147
153
  color='inherit'
154
+ disabled={disabled}
148
155
  onClick={handleClick}
149
156
  sx={{
150
- backgroundColor: 'white',
157
+ backgroundColor: colorTokens['surface-base'],
151
158
  minWidth: 'unset',
152
- px: 1.5,
159
+ px: spacingRoleBasedTokens['space-12'],
153
160
  }}
154
161
  >
155
162
  <Box
156
163
  className={`flag-sprite-map flag-${country?.iso}`}
157
164
  sx={{
158
165
  backgroundSize: '2rem auto',
159
- borderRadius: '50%',
160
- height: '1.25rem',
161
- width: '1.25rem',
166
+ borderRadius: borderTokens['radius-full'],
167
+ height: sizeTokens['icon-size-20'],
168
+ width: sizeTokens['icon-size-20'],
162
169
  }}
163
170
  title={country?.name}
164
171
  />
165
- <Box component='span' sx={{ display: 'flex', ml: 1 }}>
172
+ <Box
173
+ component='span'
174
+ sx={{ display: 'flex', ml: spacingRoleBasedTokens['space-8'] }}
175
+ >
166
176
  <CaretDownFill aria-hidden size={12} />
167
177
  </Box>
168
178
  </Button>
@@ -172,14 +182,17 @@ function RcSesPhoneInputFormControl(props: Props) {
172
182
  <Divider
173
183
  orientation='vertical'
174
184
  sx={{
175
- borderColor: palette.grey[500],
176
- height: '1.25rem',
185
+ borderColor: colorTokens['border-default'],
186
+ height: sizeTokens['icon-size-20'],
177
187
  }}
178
188
  />
179
189
  </InputAdornment>
180
190
 
181
191
  <InputAdornment position='start'>
182
- <Typography sx={{ color: palette.grey[900] }} component='span'>
192
+ <Typography
193
+ sx={{ color: colorTokens['text-default'] }}
194
+ component='span'
195
+ >
183
196
  {country.code}
184
197
  </Typography>
185
198
  </InputAdornment>
@@ -198,23 +211,28 @@ function RcSesPhoneInputFormControl(props: Props) {
198
211
  />
199
212
  <Popper
200
213
  anchorEl={anchorEl}
201
- id={popperId}
202
214
  open={open}
203
215
  placement='bottom-start'
204
- role='menu'
216
+ modifiers={[
217
+ {
218
+ name: 'offset',
219
+ options: {
220
+ offset: [0, 8],
221
+ },
222
+ },
223
+ ]}
205
224
  sx={{
206
- backgroundColor: 'white',
207
- border: '.0625rem solid #e1e4e8',
208
- borderRadius: 1,
209
- boxShadow: `0 .25rem 1rem 0 rgba(9, 30, 66, .24), 0 .5rem 1rem 0 rgba(9, 30, 66, .1)`,
210
-
211
- color: '#24292e',
225
+ backgroundColor: colorTokens['surface-base'],
226
+ border: `${borderTokens['stroke-1']} solid ${colorTokens['border-subtle']}`,
227
+ borderRadius: borderTokens['radius-8'],
228
+ boxShadow: effectTokens['elevation-md'],
229
+ color: colorTokens['text-default'],
212
230
  width: '18.75rem',
213
231
  zIndex: theme.zIndex.modal,
214
232
  }}
215
233
  >
216
234
  <ClickAwayListener onClickAway={handleClose}>
217
- <Box>
235
+ <Box id={popperId} role='dialog' aria-label={t('aria.countrySelectorLabel')}>
218
236
  <Autocomplete
219
237
  disableClearable
220
238
  disableListWrap
@@ -230,6 +248,12 @@ function RcSesPhoneInputFormControl(props: Props) {
230
248
  setCountry(selection)
231
249
  controllerProps.onChange('')
232
250
  }}
251
+ onKeyDown={(e) => {
252
+ // ESC closes the popup
253
+ if (e.key === 'Escape') {
254
+ handleClose()
255
+ }
256
+ }}
233
257
  open
234
258
  options={countryOptions}
235
259
  renderInput={AutocompleteInput}
@@ -9,7 +9,9 @@ import { useMemo } from 'react'
9
9
  import { UseControllerProps, useController } from 'react-hook-form'
10
10
  import { v4 as uuidv4 } from 'uuid'
11
11
 
12
- import palette from '@/theme/palette'
12
+ import { borderTokens } from '@/theme/borderTokens'
13
+ import { colorTokens } from '@/theme/colorTokens'
14
+ import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
13
15
 
14
16
  import RcSesFormControlWrapper, {
15
17
  RcSesFormControlWrapperProps,
@@ -18,6 +20,7 @@ import RcSesFormControlWrapper, {
18
20
  export interface RadioOption {
19
21
  label: string
20
22
  value: string
23
+ disabled?: boolean
21
24
  }
22
25
 
23
26
  type TControllerProps = UseControllerProps<any, any>
@@ -85,6 +88,7 @@ function UnstyledRcSesRadioButtonGroup(props: Props) {
85
88
  {options.map((option) => (
86
89
  <FormControlLabel
87
90
  control={<Radio />}
91
+ disabled={option.disabled}
88
92
  id={id}
89
93
  key={option.label}
90
94
  label={option.label}
@@ -99,13 +103,17 @@ function UnstyledRcSesRadioButtonGroup(props: Props) {
99
103
 
100
104
  const RcSesRadioButtonGroup = styled(UnstyledRcSesRadioButtonGroup)((props) => ({
101
105
  '.rc-ses-form-field-wrapper': {
102
- backgroundColor: props.variant === 'filled' ? palette.grey['100'] : 'transparent',
103
- borderColor: props.variant === 'outlined' ? palette.grey['500'] : 'transparent',
106
+ backgroundColor:
107
+ props.variant === 'filled' ? colorTokens['surface-muted'] : 'transparent',
108
+ borderColor:
109
+ props.variant === 'outlined' ? colorTokens['control-border'] : 'transparent',
104
110
  borderStyle: 'solid',
105
- borderWidth: props.variant === 'outlined' ? '1px' : 0,
106
- borderRadius: '.5rem',
111
+ borderWidth: props.variant === 'outlined' ? borderTokens['stroke-1'] : 0,
112
+ borderRadius: borderTokens['radius-input'],
107
113
  margin: 0,
108
- padding: props.hideNativeRadio ? undefined : '.25rem .75rem',
114
+ padding: props.hideNativeRadio
115
+ ? undefined
116
+ : `${spacingRoleBasedTokens['space-4']} ${spacingRoleBasedTokens['space-12']}`,
109
117
  },
110
118
  }))
111
119
 
@@ -0,0 +1,76 @@
1
+ import { borderTokens } from '@/theme/borderTokens'
2
+ import { colorTokens } from '@/theme/colorTokens'
3
+ import { effectTokens } from '@/theme/effectTokens'
4
+ import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
5
+ import { typographyTokens } from '@/theme/typographyTokens'
6
+
7
+ const body = {
8
+ fontSize: typographyTokens['font-size-body-regular'],
9
+ lineHeight: typographyTokens['line-height-body-regular'],
10
+ }
11
+ const small = {
12
+ fontSize: typographyTokens['font-size-body-small'],
13
+ lineHeight: typographyTokens['line-height-body-small'],
14
+ }
15
+
16
+ // Shared Input states come from the theme; only Select parts are styled here.
17
+ export const selectStyle = {
18
+ ...body,
19
+ '& .rc-ses-select-single-value': { ...body, color: colorTokens['text-default'] },
20
+ '& .MuiOutlinedInput-root.Mui-disabled .rc-ses-select-single-value': {
21
+ color: colorTokens['text-disabled'],
22
+ },
23
+ '& .MuiChip-root': {
24
+ ...small,
25
+ bgcolor: colorTokens['surface-brand-subtle'],
26
+ color: colorTokens['text-link'],
27
+ borderRadius: borderTokens['radius-chip'],
28
+ '& .MuiChip-deleteIcon': { color: colorTokens['text-secondary'] },
29
+ },
30
+ '& .MuiAutocomplete-clearIndicator, & .MuiAutocomplete-popupIndicator': {
31
+ color: colorTokens['text-secondary'],
32
+ },
33
+ }
34
+
35
+ export const paperStyle = {
36
+ ...body,
37
+ bgcolor: colorTokens['surface-base'],
38
+ color: colorTokens['text-default'],
39
+ border: `${borderTokens['border-default']} solid ${colorTokens['border-subtle']}`,
40
+ // The existing popup radius has no dedicated DS role; retain its primitive.
41
+ borderRadius: borderTokens['radius-12'],
42
+ boxShadow: effectTokens['elevation-md'],
43
+ '& .MuiAutocomplete-listbox': {
44
+ py: spacingRoleBasedTokens['space-8'],
45
+ '& .MuiAutocomplete-groupLabel': {
46
+ ...small,
47
+ color: colorTokens['text-default'],
48
+ padding: `${spacingRoleBasedTokens['padding-sm']} ${spacingRoleBasedTokens['padding-md']}`,
49
+ },
50
+ '& .MuiAutocomplete-option': {
51
+ ...body,
52
+ color: colorTokens['text-default'],
53
+ padding: `${spacingRoleBasedTokens['padding-sm']} ${spacingRoleBasedTokens['padding-md']}`,
54
+ '&:hover': { bgcolor: colorTokens['surface-muted'] },
55
+ '&.Mui-focused:not(:hover)': {
56
+ bgcolor: 'transparent',
57
+ boxShadow: `inset 0 0 0 ${borderTokens['border-focus']} ${colorTokens['border-focus']}`,
58
+ },
59
+ '&.Mui-selected, &[aria-selected="true"]': {
60
+ bgcolor: colorTokens['surface-brand-subtle'],
61
+ '&:hover, &.Mui-focused': { bgcolor: colorTokens['surface-brand-subtle'] },
62
+ },
63
+ '&[aria-disabled="true"]': { color: colorTokens['text-disabled'] },
64
+ '&.rc-ses-select-option--indent-single': { pl: spacingRoleBasedTokens['space-40'] },
65
+ '&.rc-ses-select-option--indent-multi': { pl: spacingRoleBasedTokens['space-32'] },
66
+ '& .rc-ses-select-option-label': { ...body },
67
+ '&.Mui-selected .rc-ses-select-option-label': { color: colorTokens['text-link'] },
68
+ '& .rc-ses-select-option-description': {
69
+ fontSize: typographyTokens['font-size-body-micro'],
70
+ lineHeight: typographyTokens['line-height-body-micro'],
71
+ color: colorTokens['text-secondary'],
72
+ mt: spacingRoleBasedTokens['gap-xs'],
73
+ },
74
+ },
75
+ },
76
+ }
@@ -1,44 +1,17 @@
1
1
  import { Box } from '@mui/material'
2
2
 
3
- import { CheckIcon } from '@/assets/icons/phosphorIcons'
4
- import palette from '@/theme/palette'
3
+ import RcSesCheckboxMark from '@/components/common/CheckboxMark'
4
+ import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
5
5
 
6
6
  interface Props {
7
7
  checked: boolean
8
+ disabled?: boolean
8
9
  }
9
10
 
10
- function OptionCheckbox({ checked }: Props) {
11
+ function OptionCheckbox({ checked, disabled }: Props) {
11
12
  return (
12
- <Box aria-hidden sx={{ flexShrink: 0, py: '.5rem' }}>
13
- <Box
14
- sx={{
15
- alignItems: 'center',
16
- boxSizing: 'border-box',
17
- display: 'flex',
18
- height: '1.5rem',
19
- justifyContent: 'center',
20
- padding: '.125rem',
21
- width: '1.5rem',
22
- }}
23
- >
24
- <Box
25
- sx={{
26
- alignItems: 'center',
27
- backgroundColor: checked ? palette.primary.main : 'white',
28
- border: checked
29
- ? `1px solid ${palette.primary.main}`
30
- : `2px solid ${palette.grey['500']}`,
31
- borderRadius: '.25rem',
32
- boxSizing: 'border-box',
33
- display: 'flex',
34
- height: '1.25rem',
35
- justifyContent: 'center',
36
- width: '1.25rem',
37
- }}
38
- >
39
- {checked && <CheckIcon size={14} weight='bold' fillColor='white' />}
40
- </Box>
41
- </Box>
13
+ <Box aria-hidden sx={{ flexShrink: 0, py: spacingRoleBasedTokens['space-8'] }}>
14
+ <RcSesCheckboxMark type={checked ? 'checked' : 'unchecked'} disabled={disabled} />
42
15
  </Box>
43
16
  )
44
17
  }