@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.
- package/dist/assets/icons/phosphorIcons.d.ts +4 -0
- package/dist/components/common/Accordion/hooks/useAccordionController.d.ts +2 -1
- package/dist/components/common/Accordion/index.d.ts +18 -4
- package/dist/components/common/Accordion/types/AccordionControllerState.d.ts +1 -0
- package/dist/components/common/Card/index.d.ts +3 -0
- package/dist/components/common/CheckboxMark/index.d.ts +8 -0
- package/dist/components/common/DataPagination/components/ExpandButton.d.ts +7 -0
- package/dist/components/common/DataPagination/components/PaginationButton.d.ts +2 -1
- package/dist/components/common/DataPagination/index.d.ts +13 -3
- package/dist/components/common/DataPagination/paginationModel.d.ts +4 -0
- package/dist/components/common/Divider/index.d.ts +6 -0
- package/dist/components/common/EmptyState/index.d.ts +21 -0
- package/dist/components/common/IconWithSquareBackground/index.d.ts +2 -2
- package/dist/components/common/ImageCard/index.d.ts +5 -0
- package/dist/components/common/LinkTile/index.d.ts +11 -0
- package/dist/components/common/RadioMark/index.d.ts +8 -0
- package/dist/components/common/StepCard/StepCardFooter/index.d.ts +1 -1
- package/dist/components/common/TitleBlock/types.d.ts +4 -2
- package/dist/components/form/components/FormControlWrapper/index.d.ts +2 -1
- package/dist/components/form/inputs/Datepicker/RangeDatepicker.d.ts +23 -0
- package/dist/components/form/inputs/Datepicker/SingleDatepicker.d.ts +24 -0
- package/dist/components/form/inputs/Datepicker/components/CalendarViewsHeader.d.ts +18 -0
- package/dist/components/form/inputs/Datepicker/index.d.ts +10 -14
- package/dist/components/form/inputs/Datepicker/rangeModel.d.ts +4 -0
- package/dist/components/form/inputs/FileDropzone.d.ts +2 -2
- package/dist/components/form/inputs/RadioButtonGroup.d.ts +1 -0
- package/dist/components/form/inputs/Select/Select.styles.d.ts +84 -0
- package/dist/components/form/inputs/Select/components/OptionCheckbox.d.ts +2 -1
- package/dist/components/form/inputs/TextField.d.ts +27 -12
- package/dist/components/form/inputs/TextField.styles.d.ts +101 -0
- package/dist/components/layout/ServiceWizardStepper/stepperTokens.d.ts +5 -0
- package/dist/components/loaders/Loader/index.d.ts +12 -9
- package/dist/components/overlays/BottomSheet/index.d.ts +3 -2
- package/dist/components/overlays/Dialog/index.d.ts +1 -1
- package/dist/components/storybook/FileUploadTokenPreview.d.ts +4 -0
- package/dist/components/storybook/TabsTokenPreview.d.ts +3 -0
- package/dist/components/storybook/TokenDocs.d.ts +74 -0
- package/dist/library/index.d.ts +30 -1
- package/dist/registrucentras-rc-ses-react-components.cjs +2 -2
- package/dist/registrucentras-rc-ses-react-components.js +11143 -8378
- package/dist/theme/backdropTokens.d.ts +6 -0
- package/dist/theme/borderTokens.d.ts +33 -0
- package/dist/theme/cards.d.ts +42 -73
- package/dist/theme/colorTokens.d.ts +146 -0
- package/dist/theme/effectTokens.d.ts +9 -0
- package/dist/theme/layoutTokens.d.ts +12 -0
- package/dist/theme/light/MuiAccordion.d.ts +2 -2
- package/dist/theme/light/MuiAccordionSummary.d.ts +19 -0
- package/dist/theme/light/MuiButton.d.ts +7 -0
- package/dist/theme/light/MuiInputBase.d.ts +2 -0
- package/dist/theme/light/MuiPickerPopper.d.ts +3 -0
- package/dist/theme/light/MuiTypography.d.ts +0 -14
- package/dist/theme/palette.d.ts +8 -0
- package/dist/theme/sizeTokens.d.ts +20 -0
- package/dist/theme/spacingRoleBasedTokens.d.ts +38 -0
- package/dist/theme/spacingTokens.d.ts +97 -0
- package/dist/theme/tokenTheme.d.ts +13 -0
- package/dist/theme/typographyTokens.d.ts +104 -0
- package/package.json +2 -2
- package/src/assets/icons/phosphorIcons.ts +1 -0
- package/src/components/common/Accordion/hooks/useAccordionController.tsx +39 -7
- package/src/components/common/Accordion/index.test.tsx +132 -0
- package/src/components/common/Accordion/index.tsx +302 -25
- package/src/components/common/Accordion/types/AccordionControllerState.ts +1 -0
- package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemLeading.tsx +3 -3
- package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemTrailing.tsx +8 -3
- package/src/components/common/AdvancedList/components/AdvancedListItem/index.tsx +3 -2
- package/src/components/common/AdvancedList/components/AdvancedListItemShell/index.test.tsx +3 -3
- package/src/components/common/AdvancedList/components/AdvancedListItemShell/index.tsx +23 -19
- package/src/components/common/AdvancedList/index.test.tsx +4 -2
- package/src/components/common/Alert/index.tsx +10 -6
- package/src/components/common/Badge/index.tsx +50 -37
- package/src/components/common/Button/index.tsx +12 -10
- package/src/components/common/Card/index.tsx +6 -1
- package/src/components/common/CardShell/index.test.tsx +16 -6
- package/src/components/common/CheckboxMark/index.tsx +86 -0
- package/src/components/common/DataPagination/components/DataPaginationSkeleton.tsx +9 -7
- package/src/components/common/DataPagination/components/ExpandButton.tsx +48 -0
- package/src/components/common/DataPagination/components/PaginationButton.tsx +48 -21
- package/src/components/common/DataPagination/index.test.tsx +229 -12
- package/src/components/common/DataPagination/index.tsx +135 -60
- package/src/components/common/DataPagination/paginationModel.ts +35 -0
- package/src/components/common/Divider/index.test.tsx +33 -0
- package/src/components/common/Divider/index.tsx +52 -0
- package/src/components/common/EmptyState/index.test.tsx +56 -0
- package/src/components/common/EmptyState/index.tsx +211 -0
- package/src/components/common/FilterChip/index.tsx +24 -19
- package/src/components/common/IconWithCircularBackground.tsx +24 -6
- package/src/components/common/IconWithSquareBackground/index.test.tsx +14 -2
- package/src/components/common/IconWithSquareBackground/index.tsx +36 -17
- package/src/components/common/ImageCard/index.test.tsx +16 -0
- package/src/components/common/ImageCard/index.tsx +54 -1
- package/src/components/common/LinkTile/index.test.tsx +57 -0
- package/src/components/common/LinkTile/index.tsx +136 -0
- package/src/components/common/ListWithIcons/components/ListWithIconsItem.tsx +39 -23
- package/src/components/common/ListWithIcons/index.test.tsx +20 -9
- package/src/components/common/ListWithIcons/index.tsx +6 -6
- package/src/components/common/Popover/index.tsx +11 -1
- package/src/components/common/RadioMark/index.tsx +76 -0
- package/src/components/common/SegmentedControl/components/SegmentButton/index.tsx +49 -25
- package/src/components/common/SegmentedControl/index.tsx +10 -6
- package/src/components/common/SelectableCardList/components/SelectableCardListItem.tsx +7 -5
- package/src/components/common/SelectableCardList/index.test.tsx +8 -6
- package/src/components/common/SelectionMarks.test.tsx +92 -0
- package/src/components/common/ServiceLinks/ServiceLinkItem/index.tsx +20 -11
- package/src/components/common/ServiceLinks/index.tsx +3 -3
- package/src/components/common/SideNav/SideNavLayout.tsx +6 -1
- package/src/components/common/SideNav/components/SideNavPill.tsx +24 -12
- package/src/components/common/SideNav/components/SideNavPillList.tsx +18 -12
- package/src/components/common/SideNav/components/SideNavRow.tsx +22 -15
- package/src/components/common/SideNav/index.tsx +10 -9
- package/src/components/common/Snackbar/config.ts +27 -8
- package/src/components/common/Snackbar/index.tsx +39 -16
- package/src/components/common/StepCard/StepCardFooter/index.tsx +28 -6
- package/src/components/common/StepCard/index.tsx +18 -6
- package/src/components/common/Switch/index.tsx +10 -4
- package/src/components/common/Tabs/TabPanel.tsx +6 -3
- package/src/components/common/Tabs/TabsWrapper.tsx +15 -7
- package/src/components/common/TitleBlock/index.test.tsx +14 -17
- package/src/components/common/TitleBlock/index.tsx +120 -15
- package/src/components/common/TitleBlock/types.ts +4 -2
- package/src/components/common/Tooltip/index.tsx +32 -3
- package/src/components/form/components/FormControlWrapper/index.tsx +43 -14
- package/src/components/form/inputs/CheckboxFormControl.tsx +25 -13
- package/src/components/form/inputs/Datepicker/RangeDatepicker.tsx +356 -0
- package/src/components/form/inputs/Datepicker/SingleDatepicker.tsx +207 -0
- package/src/components/form/inputs/Datepicker/components/CalendarViewsHeader.tsx +335 -0
- package/src/components/form/inputs/Datepicker/components/RcSesDatepickerCalendarHeader.tsx +22 -10
- package/src/components/form/inputs/Datepicker/index.test.tsx +23 -18
- package/src/components/form/inputs/Datepicker/index.tsx +20 -150
- package/src/components/form/inputs/Datepicker/rangeModel.test.ts +35 -0
- package/src/components/form/inputs/Datepicker/rangeModel.ts +25 -0
- package/src/components/form/inputs/FileDropzone.tsx +73 -46
- package/src/components/form/inputs/FileUpload.tsx +25 -16
- package/src/components/form/inputs/NumberStepper.tsx +36 -14
- package/src/components/form/inputs/PhoneInputFormControl/components/AutocompleteInput.tsx +10 -5
- package/src/components/form/inputs/PhoneInputFormControl/components/ListboxComponent.tsx +7 -1
- package/src/components/form/inputs/PhoneInputFormControl/components/PopperComponent.tsx +5 -2
- package/src/components/form/inputs/PhoneInputFormControl/components/RowComponent.tsx +9 -5
- package/src/components/form/inputs/PhoneInputFormControl/index.tsx +48 -24
- package/src/components/form/inputs/RadioButtonGroup.tsx +14 -6
- package/src/components/form/inputs/Select/Select.styles.ts +76 -0
- package/src/components/form/inputs/Select/components/OptionCheckbox.tsx +6 -33
- package/src/components/form/inputs/Select/index.tsx +124 -86
- package/src/components/form/inputs/SimpleCheckbox.tsx +10 -3
- package/src/components/form/inputs/TextField.presets.test.tsx +284 -0
- package/src/components/form/inputs/TextField.styles.ts +96 -0
- package/src/components/form/inputs/TextField.test.tsx +153 -0
- package/src/components/form/inputs/TextField.tsx +315 -42
- package/src/components/layout/Footer/index.test.tsx +1 -1
- package/src/components/layout/Footer/index.tsx +17 -7
- package/src/components/layout/ServiceFormActions.tsx +5 -1
- package/src/components/layout/ServiceFormContainer/AccordionFormContainer/index.tsx +3 -3
- package/src/components/layout/ServiceHeader.tsx +19 -19
- package/src/components/layout/ServiceWizardStepper/ServiceWizardStepper.css +10 -10
- package/src/components/layout/ServiceWizardStepper/StepConnector.tsx +8 -5
- package/src/components/layout/ServiceWizardStepper/components/CustomStepIcon.tsx +22 -7
- package/src/components/layout/ServiceWizardStepper/components/HorizontalStepperButton.tsx +15 -11
- package/src/components/layout/ServiceWizardStepper/components/StyledStepLabel.tsx +28 -11
- package/src/components/layout/ServiceWizardStepper/stepperTokens.ts +8 -0
- package/src/components/loaders/FullPageLoader/index.test.tsx +18 -7
- package/src/components/loaders/FullPageLoader/index.tsx +14 -9
- package/src/components/loaders/Loader/index.tsx +48 -17
- package/src/components/overlays/BottomSheet/index.test.tsx +36 -3
- package/src/components/overlays/BottomSheet/index.tsx +54 -21
- package/src/components/overlays/Dialog/index.tsx +5 -23
- package/src/components/overlays/Drawer/index.tsx +29 -14
- package/src/components/overlays/Modal/index.tsx +46 -8
- package/src/components/storybook/FileUploadTokenPreview.tsx +68 -0
- package/src/components/storybook/TabsTokenPreview.tsx +58 -0
- package/src/components/storybook/TokenDocs.tsx +347 -0
- package/src/examples/MultipleStepForm/components/TermsAndConditionsForm.tsx +5 -1
- package/src/i18n/namespaces/input/en.json +48 -4
- package/src/i18n/namespaces/input/lt.json +48 -4
- package/src/library/index.ts +50 -0
- package/src/stories/atoms/Badge.stories.tsx +2 -1
- package/src/stories/atoms/Button.stories.tsx +124 -6
- package/src/stories/atoms/CheckboxMark.stories.tsx +79 -0
- package/src/stories/atoms/Divider.stories.tsx +129 -0
- package/src/stories/atoms/FilterChip.stories.tsx +9 -1
- package/src/stories/atoms/IconWithSquareBackground.stories.tsx +7 -7
- package/src/stories/atoms/Icons.stories.tsx +1 -1
- package/src/stories/atoms/NumberStepper.stories.tsx +44 -0
- package/src/stories/atoms/PhoneInput.stories.tsx +42 -0
- package/src/stories/atoms/RadioMark.stories.tsx +132 -0
- package/src/stories/atoms/Select.stories.tsx +139 -2
- package/src/stories/atoms/SimpleCheckbox.stories.tsx +74 -0
- package/src/stories/atoms/Switch.stories.tsx +46 -1
- package/src/stories/atoms/TextField.stories.tsx +508 -0
- package/src/stories/atoms/Tooltip.stories.tsx +5 -0
- package/src/stories/fixtures/foundations/Borders.stories.tsx +84 -0
- package/src/stories/fixtures/foundations/Effects.stories.tsx +204 -0
- package/src/stories/fixtures/foundations/Layout.stories.tsx +76 -0
- package/src/stories/fixtures/foundations/Sizes.stories.tsx +42 -0
- package/src/stories/fixtures/foundations/Spacing.stories.tsx +48 -0
- package/src/stories/fixtures/foundations/Typography.stories.tsx +49 -0
- package/src/stories/foundations/Borders.stories.tsx +179 -0
- package/src/stories/foundations/Colors.stories.tsx +253 -0
- package/src/stories/foundations/Effects.stories.tsx +116 -0
- package/src/stories/foundations/Layout.stories.tsx +177 -0
- package/src/stories/foundations/Sizes.stories.tsx +123 -0
- package/src/stories/foundations/Spacing.stories.tsx +159 -0
- package/src/stories/foundations/ThemeAdapter.stories.tsx +389 -0
- package/src/stories/foundations/Typography.stories.tsx +148 -0
- package/src/stories/molecules/Alert.stories.tsx +18 -0
- package/src/stories/molecules/Breadcrumbs.stories.tsx +51 -0
- package/src/stories/molecules/Card.stories.tsx +1 -1
- package/src/stories/molecules/CardShell.stories.tsx +1 -0
- package/src/stories/molecules/DatePicker.stories.tsx +133 -3
- package/src/stories/molecules/EmptyState.stories.tsx +106 -0
- package/src/stories/molecules/FormControlWrapper.stories.tsx +59 -0
- package/src/stories/molecules/LinkTile.stories.tsx +151 -0
- package/src/stories/molecules/ListWithIcons.stories.tsx +27 -2
- package/src/stories/molecules/RadioButtonGroup.stories.tsx +23 -0
- package/src/stories/molecules/SegmentedControl.stories.tsx +62 -1
- package/src/stories/molecules/Tabs.stories.tsx +4 -0
- package/src/stories/molecules/TitleBlock.stories.tsx +16 -16
- package/src/stories/organisms/Accordion.stories.tsx +132 -0
- package/src/stories/organisms/AdvancedListItemShell.stories.tsx +63 -23
- package/src/stories/organisms/BottomSheet.stories.tsx +48 -1
- package/src/stories/organisms/DataPagination.stories.tsx +127 -3
- package/src/stories/organisms/Dialog.stories.tsx +13 -0
- package/src/stories/organisms/FileDropzone.stories.tsx +6 -0
- package/src/stories/organisms/FileUpload.stories.tsx +4 -0
- package/src/stories/organisms/Footer.stories.tsx +20 -0
- package/src/stories/organisms/Modal.stories.tsx +53 -0
- package/src/stories/organisms/ServiceHeader.stories.tsx +25 -3
- package/src/stories/organisms/ServiceLinks.stories.tsx +1 -1
- package/src/stories/organisms/ServiceWizardStepper.stories.tsx +37 -1
- package/src/stories/organisms/SideNav.stories.tsx +8 -1
- package/src/theme/backdropTokens.test.ts +11 -0
- package/src/theme/backdropTokens.ts +11 -0
- package/src/theme/borderTokens.test.ts +59 -0
- package/src/theme/borderTokens.ts +36 -0
- package/src/theme/cards.ts +28 -28
- package/src/theme/colorTokens.test.ts +66 -0
- package/src/theme/colorTokens.ts +87 -0
- package/src/theme/effectTokens.test.ts +29 -0
- package/src/theme/effectTokens.ts +11 -0
- package/src/theme/layoutTokens.test.ts +42 -0
- package/src/theme/layoutTokens.ts +14 -0
- package/src/theme/light/MuiAccordion.tsx +30 -26
- package/src/theme/light/MuiAccordionDetails.ts +10 -5
- package/src/theme/light/MuiAccordionSummary.tsx +31 -17
- package/src/theme/light/MuiAlert.tsx +42 -65
- package/src/theme/light/MuiAutocomplete.ts +14 -7
- package/src/theme/light/MuiBreadcrumbs.tsx +17 -9
- package/src/theme/light/MuiButton.tsx +213 -204
- package/src/theme/light/MuiCard.tsx +5 -4
- package/src/theme/light/MuiCheckbox.ts +45 -14
- package/src/theme/light/MuiChip.tsx +3 -1
- package/src/theme/light/MuiDialog.ts +45 -6
- package/src/theme/light/MuiFormControl.ts +19 -9
- package/src/theme/light/MuiFormControlLabel.ts +16 -25
- package/src/theme/light/MuiFormGroup.ts +29 -26
- package/src/theme/light/MuiFormHelperText.ts +15 -4
- package/src/theme/light/MuiFormLabel.ts +20 -20
- package/src/theme/light/MuiInputBase.ts +49 -84
- package/src/theme/light/MuiOutlinedInput.ts +50 -6
- package/src/theme/light/MuiPagination.ts +21 -21
- package/src/theme/light/MuiPickerPopper.ts +17 -0
- package/src/theme/light/MuiPickersLayout.ts +63 -34
- package/src/theme/light/MuiPickersOutlinedInput.ts +38 -38
- package/src/theme/light/MuiPopover.ts +3 -1
- package/src/theme/light/MuiRadio.tsx +35 -52
- package/src/theme/light/MuiStepper.ts +21 -17
- package/src/theme/light/MuiSwitch.tsx +27 -23
- package/src/theme/light/MuiTab.tsx +27 -18
- package/src/theme/light/MuiTableCell.ts +4 -2
- package/src/theme/light/MuiTabs.tsx +11 -9
- package/src/theme/light/MuiTooltip.ts +2 -1
- package/src/theme/light/MuiTypography.tsx +0 -17
- package/src/theme/light/index.tsx +2 -0
- package/src/theme/light/themePalette.tsx +1 -0
- package/src/theme/palette.tsx +9 -0
- package/src/theme/sizeTokens.test.ts +37 -0
- package/src/theme/sizeTokens.ts +21 -0
- package/src/theme/spacingRoleBasedTokens.ts +41 -0
- package/src/theme/spacingTokens.test.ts +58 -0
- package/src/theme/spacingTokens.ts +114 -0
- package/src/theme/tokenTheme.test.tsx +402 -0
- package/src/theme/tokenTheme.ts +429 -0
- package/src/theme/tokens.css +476 -0
- package/src/theme/tokens.test.ts +174 -0
- package/src/theme/typographyTokens.test.ts +120 -0
- package/src/theme/typographyTokens.ts +119 -0
- package/dist/theme/spacing.d.ts +0 -4
- package/src/stories/foundations/Colors.mdx +0 -127
- package/src/theme/spacing.ts +0 -5
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { Box, Link, LinkProps } from '@mui/material'
|
|
2
|
+
import { JSXElementConstructor, forwardRef, useState } from 'react'
|
|
3
|
+
|
|
4
|
+
import IconProps from '@/assets/IconProps'
|
|
5
|
+
import IconWithSquareBackground from '@/components/common/IconWithSquareBackground'
|
|
6
|
+
import normalizeSx from '@/components/utils/normalizeSx'
|
|
7
|
+
import { borderTokens } from '@/theme/borderTokens'
|
|
8
|
+
import { colorTokens } from '@/theme/colorTokens'
|
|
9
|
+
import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
|
|
10
|
+
import '@/theme/tokens.css'
|
|
11
|
+
import { typographyTokens } from '@/theme/typographyTokens'
|
|
12
|
+
|
|
13
|
+
export interface LinkTileProps extends Omit<
|
|
14
|
+
LinkProps,
|
|
15
|
+
'children' | 'component' | 'href' | 'aria-label' | 'aria-labelledby'
|
|
16
|
+
> {
|
|
17
|
+
href: string
|
|
18
|
+
label: string
|
|
19
|
+
Icon: JSXElementConstructor<IconProps>
|
|
20
|
+
current?: boolean
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const RcSesLinkTile = forwardRef<HTMLAnchorElement, LinkTileProps>(
|
|
24
|
+
(
|
|
25
|
+
{
|
|
26
|
+
href,
|
|
27
|
+
label,
|
|
28
|
+
Icon,
|
|
29
|
+
current = false,
|
|
30
|
+
sx,
|
|
31
|
+
target,
|
|
32
|
+
rel,
|
|
33
|
+
onTouchStart,
|
|
34
|
+
onTouchMove,
|
|
35
|
+
onTouchEnd,
|
|
36
|
+
onTouchCancel,
|
|
37
|
+
'aria-current': ariaCurrent,
|
|
38
|
+
...props
|
|
39
|
+
},
|
|
40
|
+
ref,
|
|
41
|
+
) => {
|
|
42
|
+
const [touchPressed, setTouchPressed] = useState(false)
|
|
43
|
+
const isCurrent = current || ariaCurrent === 'page'
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<Link
|
|
47
|
+
{...props}
|
|
48
|
+
ref={ref}
|
|
49
|
+
href={href}
|
|
50
|
+
target={target}
|
|
51
|
+
rel={rel ?? (target === '_blank' ? 'noopener noreferrer' : undefined)}
|
|
52
|
+
aria-current={isCurrent ? 'page' : ariaCurrent}
|
|
53
|
+
data-touch-pressed={touchPressed || undefined}
|
|
54
|
+
onTouchStart={(event) => {
|
|
55
|
+
setTouchPressed(true)
|
|
56
|
+
onTouchStart?.(event)
|
|
57
|
+
}}
|
|
58
|
+
onTouchMove={(event) => {
|
|
59
|
+
setTouchPressed(false)
|
|
60
|
+
onTouchMove?.(event)
|
|
61
|
+
}}
|
|
62
|
+
onTouchEnd={(event) => {
|
|
63
|
+
setTouchPressed(false)
|
|
64
|
+
onTouchEnd?.(event)
|
|
65
|
+
}}
|
|
66
|
+
onTouchCancel={(event) => {
|
|
67
|
+
setTouchPressed(false)
|
|
68
|
+
onTouchCancel?.(event)
|
|
69
|
+
}}
|
|
70
|
+
underline='none'
|
|
71
|
+
sx={[
|
|
72
|
+
{
|
|
73
|
+
position: 'relative',
|
|
74
|
+
boxSizing: 'border-box',
|
|
75
|
+
display: 'flex',
|
|
76
|
+
flexDirection: 'column',
|
|
77
|
+
alignItems: 'center',
|
|
78
|
+
justifyContent: 'center',
|
|
79
|
+
width: '100%',
|
|
80
|
+
minWidth: 0,
|
|
81
|
+
minHeight: '8.75rem',
|
|
82
|
+
paddingBlock: spacingRoleBasedTokens['space-20'],
|
|
83
|
+
paddingInline: spacingRoleBasedTokens['space-12'],
|
|
84
|
+
gap: spacingRoleBasedTokens['space-12'],
|
|
85
|
+
border: `${borderTokens['stroke-1']} solid ${isCurrent ? colorTokens['border-focus'] : colorTokens['border-subtle']}`,
|
|
86
|
+
borderRadius: borderTokens['radius-16'],
|
|
87
|
+
backgroundColor: isCurrent
|
|
88
|
+
? colorTokens['surface-brand-subtle']
|
|
89
|
+
: colorTokens['surface-base'],
|
|
90
|
+
boxShadow: isCurrent
|
|
91
|
+
? `inset 0 0 0 ${borderTokens['stroke-1']} ${colorTokens['border-focus']}`
|
|
92
|
+
: 'none',
|
|
93
|
+
color: colorTokens['text-default'],
|
|
94
|
+
textDecoration: 'none',
|
|
95
|
+
textAlign: 'center',
|
|
96
|
+
whiteSpace: 'normal',
|
|
97
|
+
overflowWrap: 'anywhere',
|
|
98
|
+
cursor: 'pointer',
|
|
99
|
+
fontFamily: typographyTokens['font-family'],
|
|
100
|
+
fontSize: typographyTokens['font-size-body-large'],
|
|
101
|
+
fontWeight: typographyTokens['font-weight-body-large'],
|
|
102
|
+
lineHeight: typographyTokens['line-height-body-large'],
|
|
103
|
+
letterSpacing: typographyTokens['letter-spacing-body-large'],
|
|
104
|
+
'&:hover, &:active, &[data-touch-pressed="true"]': {
|
|
105
|
+
backgroundColor: isCurrent
|
|
106
|
+
? colorTokens['surface-brand-subtle']
|
|
107
|
+
: colorTokens['surface-sunken'],
|
|
108
|
+
borderColor: isCurrent ? colorTokens['border-focus'] : 'transparent',
|
|
109
|
+
textDecoration: 'none',
|
|
110
|
+
},
|
|
111
|
+
'&:focus-visible': {
|
|
112
|
+
outline: `${borderTokens['border-focus']} solid ${colorTokens['border-focus']}`,
|
|
113
|
+
outlineOffset: 0,
|
|
114
|
+
borderColor: isCurrent ? colorTokens['border-focus'] : 'transparent',
|
|
115
|
+
backgroundColor: isCurrent
|
|
116
|
+
? colorTokens['surface-brand-subtle']
|
|
117
|
+
: colorTokens['surface-base'],
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
...normalizeSx(sx),
|
|
121
|
+
]}
|
|
122
|
+
>
|
|
123
|
+
<Box aria-hidden='true' sx={{ display: 'inline-flex', flexShrink: 0 }}>
|
|
124
|
+
<IconWithSquareBackground Icon={Icon} size={40} variant='cyan' />
|
|
125
|
+
</Box>
|
|
126
|
+
<Box component='span' sx={{ width: '100%', minWidth: 0, whiteSpace: 'pre-line' }}>
|
|
127
|
+
{label}
|
|
128
|
+
</Box>
|
|
129
|
+
</Link>
|
|
130
|
+
)
|
|
131
|
+
},
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
RcSesLinkTile.displayName = 'RcSesLinkTile'
|
|
135
|
+
|
|
136
|
+
export default RcSesLinkTile
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { Box, Skeleton, Tooltip, Typography } from '@mui/material'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { borderTokens } from '@/theme/borderTokens'
|
|
4
|
+
import { colorTokens } from '@/theme/colorTokens'
|
|
5
|
+
import { effectTokens } from '@/theme/effectTokens'
|
|
6
|
+
import { sizeTokens } from '@/theme/sizeTokens'
|
|
7
|
+
import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
|
|
8
|
+
import { spacingTokens } from '@/theme/spacingTokens'
|
|
9
|
+
import { typographyTokens } from '@/theme/typographyTokens'
|
|
4
10
|
|
|
5
11
|
import { ListWithIconsItemData, ListWithIconsItemTone } from '../ListWithIcons.types'
|
|
6
12
|
|
|
@@ -9,10 +15,10 @@ interface Props extends ListWithIconsItemData {
|
|
|
9
15
|
}
|
|
10
16
|
|
|
11
17
|
const TEXT_TONE_COLORS: Record<ListWithIconsItemTone, string> = {
|
|
12
|
-
default:
|
|
13
|
-
secondary:
|
|
14
|
-
muted:
|
|
15
|
-
link:
|
|
18
|
+
default: colorTokens['text-default'],
|
|
19
|
+
secondary: colorTokens['text-secondary'],
|
|
20
|
+
muted: colorTokens['text-muted'],
|
|
21
|
+
link: colorTokens['text-link'],
|
|
16
22
|
}
|
|
17
23
|
|
|
18
24
|
const ListWithIconsItem = ({
|
|
@@ -32,21 +38,31 @@ const ListWithIconsItem = ({
|
|
|
32
38
|
sx={{
|
|
33
39
|
display: 'flex',
|
|
34
40
|
alignItems: 'flex-start',
|
|
35
|
-
gap:
|
|
41
|
+
gap: spacingTokens['spacing-aliases-meta-icon-text-gap'],
|
|
36
42
|
maxWidth: '100%',
|
|
37
43
|
}}
|
|
38
44
|
>
|
|
39
45
|
{Icon && (
|
|
40
|
-
<Box
|
|
46
|
+
<Box
|
|
47
|
+
sx={{
|
|
48
|
+
display: 'flex',
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
height: typographyTokens['line-height-body-caption'],
|
|
51
|
+
'& > svg': {
|
|
52
|
+
width: sizeTokens['icon-size-inline'],
|
|
53
|
+
height: sizeTokens['icon-size-inline'],
|
|
54
|
+
},
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
41
57
|
<Icon fillColor={resolvedColor} size={16} />
|
|
42
58
|
</Box>
|
|
43
59
|
)}
|
|
44
60
|
<Typography
|
|
45
61
|
variant='body2'
|
|
46
62
|
sx={{
|
|
47
|
-
fontSize: '
|
|
48
|
-
lineHeight: '
|
|
49
|
-
fontWeight:
|
|
63
|
+
fontSize: typographyTokens['font-size-body-caption'],
|
|
64
|
+
lineHeight: typographyTokens['line-height-body-caption'],
|
|
65
|
+
fontWeight: typographyTokens['font-weight-body-caption'],
|
|
50
66
|
whiteSpace: 'normal',
|
|
51
67
|
wordBreak: 'break-word',
|
|
52
68
|
color: resolvedColor,
|
|
@@ -65,17 +81,17 @@ const ListWithIconsItem = ({
|
|
|
65
81
|
slotProps={{
|
|
66
82
|
tooltip: {
|
|
67
83
|
sx: {
|
|
68
|
-
bgcolor:
|
|
69
|
-
color: 'text
|
|
70
|
-
fontSize: '
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
borderRadius: '
|
|
75
|
-
boxShadow: '
|
|
84
|
+
bgcolor: colorTokens['surface-base'],
|
|
85
|
+
color: colorTokens['text-default'],
|
|
86
|
+
fontSize: typographyTokens['font-size-body-small'],
|
|
87
|
+
lineHeight: typographyTokens['line-height-body-small'],
|
|
88
|
+
fontWeight: typographyTokens['font-weight-body-small'],
|
|
89
|
+
p: spacingTokens['spacing-aliases-tooltip-padding'],
|
|
90
|
+
borderRadius: borderTokens['radius-8'],
|
|
91
|
+
boxShadow: effectTokens['elevation-md'],
|
|
76
92
|
},
|
|
77
93
|
},
|
|
78
|
-
arrow: { sx: { color:
|
|
94
|
+
arrow: { sx: { color: colorTokens['surface-base'] } },
|
|
79
95
|
}}
|
|
80
96
|
>
|
|
81
97
|
{content}
|
|
@@ -92,8 +108,8 @@ const ListWithIconsItem = ({
|
|
|
92
108
|
alignItems: 'center',
|
|
93
109
|
width: { xs: '100%', md: isLoading ? '120px' : 'auto' },
|
|
94
110
|
maxWidth: '100%',
|
|
95
|
-
gap:
|
|
96
|
-
minHeight: 20,
|
|
111
|
+
gap: spacingRoleBasedTokens['space-4'],
|
|
112
|
+
minHeight: spacingRoleBasedTokens['space-20'],
|
|
97
113
|
opacity: disabled ? 0.5 : 1,
|
|
98
114
|
pointerEvents: disabled ? 'none' : 'auto',
|
|
99
115
|
}}
|
|
@@ -103,8 +119,8 @@ const ListWithIconsItem = ({
|
|
|
103
119
|
variant='rectangular'
|
|
104
120
|
sx={{
|
|
105
121
|
flex: 1,
|
|
106
|
-
height: 16,
|
|
107
|
-
borderRadius:
|
|
122
|
+
height: spacingRoleBasedTokens['space-16'],
|
|
123
|
+
borderRadius: borderTokens['radius-4'],
|
|
108
124
|
width: { xs: '100%', md: 120 },
|
|
109
125
|
}}
|
|
110
126
|
/>
|
|
@@ -3,8 +3,8 @@ import { fireEvent, render, screen } from '@testing-library/react'
|
|
|
3
3
|
import { type ReactElement } from 'react'
|
|
4
4
|
import { describe, expect, test } from 'vitest'
|
|
5
5
|
|
|
6
|
+
import { colorTokens } from '@/theme/colorTokens'
|
|
6
7
|
import theme from '@/theme/light'
|
|
7
|
-
import { grey, primary, secondary } from '@/theme/palette'
|
|
8
8
|
|
|
9
9
|
import ListWithIcons from '.'
|
|
10
10
|
|
|
@@ -76,10 +76,16 @@ describe('ListWithIcons', () => {
|
|
|
76
76
|
/>,
|
|
77
77
|
)
|
|
78
78
|
|
|
79
|
-
expect(screen.getByText('Default text')).toHaveStyle({
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
expect(screen.getByText('
|
|
79
|
+
expect(screen.getByText('Default text')).toHaveStyle({
|
|
80
|
+
color: colorTokens['text-default'],
|
|
81
|
+
})
|
|
82
|
+
expect(screen.getByText('Secondary text')).toHaveStyle({
|
|
83
|
+
color: colorTokens['text-secondary'],
|
|
84
|
+
})
|
|
85
|
+
expect(screen.getByText('Muted text')).toHaveStyle({
|
|
86
|
+
color: colorTokens['text-muted'],
|
|
87
|
+
})
|
|
88
|
+
expect(screen.getByText('Link text')).toHaveStyle({ color: colorTokens['text-link'] })
|
|
83
89
|
})
|
|
84
90
|
|
|
85
91
|
test('falls back to the secondary tone color/icon fill when textColor is omitted', () => {
|
|
@@ -93,15 +99,20 @@ describe('ListWithIcons', () => {
|
|
|
93
99
|
<ListWithIcons items={[{ icon: StubIcon, text: 'No explicit color' }]} />,
|
|
94
100
|
)
|
|
95
101
|
|
|
96
|
-
expect(screen.getByText('No explicit color')).toHaveStyle({
|
|
97
|
-
|
|
102
|
+
expect(screen.getByText('No explicit color')).toHaveStyle({
|
|
103
|
+
color: colorTokens['text-secondary'],
|
|
104
|
+
})
|
|
105
|
+
expect(screen.getByTestId('stub-icon')).toHaveAttribute(
|
|
106
|
+
'data-fill-color',
|
|
107
|
+
colorTokens['text-secondary'],
|
|
108
|
+
)
|
|
98
109
|
})
|
|
99
110
|
|
|
100
111
|
test('accepts a raw palette color value for textColor, not just a named tone', () => {
|
|
101
112
|
renderListWithIcons(
|
|
102
|
-
<ListWithIcons items={[{ text: 'Custom colored', textColor:
|
|
113
|
+
<ListWithIcons items={[{ text: 'Custom colored', textColor: '#008561' }]} />,
|
|
103
114
|
)
|
|
104
115
|
|
|
105
|
-
expect(screen.getByText('Custom colored')).toHaveStyle({ color:
|
|
116
|
+
expect(screen.getByText('Custom colored')).toHaveStyle({ color: '#008561' })
|
|
106
117
|
})
|
|
107
118
|
})
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Box } from '@mui/material'
|
|
2
2
|
|
|
3
|
+
import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
|
|
4
|
+
import { spacingTokens } from '@/theme/spacingTokens'
|
|
5
|
+
|
|
3
6
|
import { ListWithIconsItemData } from './ListWithIcons.types'
|
|
4
7
|
import ListWithIconsItem from './components/ListWithIconsItem'
|
|
5
8
|
|
|
@@ -19,8 +22,8 @@ const ListWithIcons = ({
|
|
|
19
22
|
<Box
|
|
20
23
|
component='ul'
|
|
21
24
|
sx={{
|
|
22
|
-
p: 0,
|
|
23
|
-
m: 0,
|
|
25
|
+
p: spacingRoleBasedTokens['space-0'],
|
|
26
|
+
m: spacingRoleBasedTokens['space-0'],
|
|
24
27
|
width: '100%',
|
|
25
28
|
minWidth: { md: '7.5rem' },
|
|
26
29
|
display: 'flex',
|
|
@@ -29,10 +32,7 @@ const ListWithIcons = ({
|
|
|
29
32
|
md: layout === 'horizontal' ? 'row' : 'column',
|
|
30
33
|
},
|
|
31
34
|
flexWrap: layout === 'horizontal' ? 'wrap' : 'nowrap',
|
|
32
|
-
gap:
|
|
33
|
-
xs: '0.25rem',
|
|
34
|
-
md: layout === 'horizontal' ? '0.25rem 1rem' : '0.5rem',
|
|
35
|
-
},
|
|
35
|
+
gap: spacingTokens['spacing-aliases-meta-item-gap'],
|
|
36
36
|
}}
|
|
37
37
|
>
|
|
38
38
|
{isLoading ? (
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Box, Popover } from '@mui/material'
|
|
2
2
|
import type { PopoverProps } from '@mui/material'
|
|
3
3
|
|
|
4
|
+
import { typographyTokens } from '@/theme/typographyTokens'
|
|
5
|
+
|
|
4
6
|
type Props = Exclude<PopoverProps, 'content'> & {
|
|
5
7
|
header?: React.ReactNode
|
|
6
8
|
}
|
|
@@ -10,7 +12,15 @@ function RcSesPopover(props: Props) {
|
|
|
10
12
|
return (
|
|
11
13
|
<Popover {...popoverProps}>
|
|
12
14
|
{!!header && (
|
|
13
|
-
<Box
|
|
15
|
+
<Box
|
|
16
|
+
sx={{
|
|
17
|
+
fontWeight: typographyTokens['font-weight-semibold'],
|
|
18
|
+
lineHeight: '1.12rem',
|
|
19
|
+
mb: 1,
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
22
|
+
{header}
|
|
23
|
+
</Box>
|
|
14
24
|
)}
|
|
15
25
|
{children}
|
|
16
26
|
</Popover>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { styled } from '@mui/material/styles'
|
|
2
|
+
import { CSSProperties } from 'react'
|
|
3
|
+
|
|
4
|
+
import { borderTokens } from '@/theme/borderTokens'
|
|
5
|
+
import { colorTokens } from '@/theme/colorTokens'
|
|
6
|
+
import { sizeTokens } from '@/theme/sizeTokens'
|
|
7
|
+
import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
|
|
8
|
+
|
|
9
|
+
export interface RadioMarkProps {
|
|
10
|
+
type?: 'unselected' | 'selected'
|
|
11
|
+
disabled?: boolean
|
|
12
|
+
className?: string
|
|
13
|
+
style?: CSSProperties
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const Mark = styled('span')({
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
display: 'inline-flex',
|
|
19
|
+
flexShrink: 0,
|
|
20
|
+
height: sizeTokens['icon-size-24'],
|
|
21
|
+
justifyContent: 'center',
|
|
22
|
+
pointerEvents: 'none',
|
|
23
|
+
verticalAlign: 'middle',
|
|
24
|
+
width: sizeTokens['icon-size-24'],
|
|
25
|
+
'& > span': {
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
borderRadius: borderTokens['radius-full'],
|
|
28
|
+
borderStyle: 'solid',
|
|
29
|
+
boxSizing: 'border-box',
|
|
30
|
+
display: 'inline-flex',
|
|
31
|
+
height: sizeTokens['icon-size-control'],
|
|
32
|
+
justifyContent: 'center',
|
|
33
|
+
width: sizeTokens['icon-size-control'],
|
|
34
|
+
},
|
|
35
|
+
'& [data-rc-radio-dot]': {
|
|
36
|
+
backgroundColor: colorTokens['control-foreground'],
|
|
37
|
+
borderRadius: borderTokens['radius-full'],
|
|
38
|
+
height: spacingRoleBasedTokens['space-10'],
|
|
39
|
+
width: spacingRoleBasedTokens['space-10'],
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
export default function RcSesRadioMark({
|
|
44
|
+
type = 'unselected',
|
|
45
|
+
disabled = false,
|
|
46
|
+
...props
|
|
47
|
+
}: RadioMarkProps) {
|
|
48
|
+
const selected = type === 'selected'
|
|
49
|
+
// --rc-mark-* are component hooks set by the MuiCheckbox/MuiRadio/MuiFormControl
|
|
50
|
+
// themes for hover, error and disabled states; they are not DS tokens.
|
|
51
|
+
const selectedColor = disabled
|
|
52
|
+
? colorTokens['control-disabled-selected']
|
|
53
|
+
: `var(--rc-mark-selected, ${colorTokens['control-selected']})`
|
|
54
|
+
const surface = disabled
|
|
55
|
+
? colorTokens['control-disabled']
|
|
56
|
+
: `var(--rc-mark-surface, ${colorTokens['surface-base']})`
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<Mark {...props} aria-hidden='true' data-rc-radio-mark={type}>
|
|
60
|
+
<span
|
|
61
|
+
data-rc-mark-shape
|
|
62
|
+
style={{
|
|
63
|
+
backgroundColor: selected ? selectedColor : surface,
|
|
64
|
+
borderColor: selected
|
|
65
|
+
? selectedColor
|
|
66
|
+
: `var(--rc-mark-border, ${colorTokens['control-border']})`,
|
|
67
|
+
borderWidth: selected
|
|
68
|
+
? borderTokens['border-default']
|
|
69
|
+
: borderTokens['border-focus'],
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
72
|
+
{selected && <span data-rc-radio-dot />}
|
|
73
|
+
</span>
|
|
74
|
+
</Mark>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
import { Button as MuiButton } from '@mui/material'
|
|
2
2
|
import React, { useCallback, useMemo } from 'react'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { borderTokens } from '@/theme/borderTokens'
|
|
5
|
+
import { colorTokens } from '@/theme/colorTokens'
|
|
6
|
+
import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
|
|
7
|
+
import { typographyTokens } from '@/theme/typographyTokens'
|
|
5
8
|
|
|
6
9
|
const SIZE_STYLES: Record<'small' | 'regular', React.CSSProperties> = {
|
|
7
10
|
small: {
|
|
8
11
|
width: 'auto',
|
|
9
|
-
maxWidth: '
|
|
10
|
-
minHeight: '
|
|
11
|
-
padding: '
|
|
12
|
-
fontSize: '
|
|
13
|
-
lineHeight: '
|
|
12
|
+
maxWidth: '100%',
|
|
13
|
+
minHeight: spacingRoleBasedTokens['space-36'],
|
|
14
|
+
padding: `calc(${spacingRoleBasedTokens['space-8']} - ${borderTokens['border-focus']}) calc(${spacingRoleBasedTokens['space-16']} - ${borderTokens['border-focus']})`,
|
|
15
|
+
fontSize: typographyTokens['font-size-button-compact'],
|
|
16
|
+
lineHeight: typographyTokens['line-height-button-compact'],
|
|
14
17
|
},
|
|
15
18
|
regular: {
|
|
16
19
|
width: 'auto',
|
|
17
|
-
maxWidth: '
|
|
20
|
+
maxWidth: '100%',
|
|
18
21
|
minHeight: '44px',
|
|
19
|
-
padding: '
|
|
20
|
-
fontSize: '
|
|
21
|
-
lineHeight: '
|
|
22
|
+
padding: `calc(${spacingRoleBasedTokens['space-12']} - ${borderTokens['border-focus']}) calc(${spacingRoleBasedTokens['space-20']} - ${borderTokens['border-focus']})`,
|
|
23
|
+
fontSize: typographyTokens['font-size-button-regular'],
|
|
24
|
+
lineHeight: typographyTokens['line-height-button-regular'],
|
|
22
25
|
},
|
|
23
26
|
}
|
|
24
27
|
|
|
@@ -49,33 +52,36 @@ const RcSesSegmentButton = React.forwardRef<HTMLButtonElement, RcSesSegmentButto
|
|
|
49
52
|
const sizeStyles = SIZE_STYLES[size]
|
|
50
53
|
|
|
51
54
|
const textColor = useMemo(() => {
|
|
52
|
-
if (isDisabled)
|
|
53
|
-
|
|
54
|
-
return
|
|
55
|
+
if (isDisabled)
|
|
56
|
+
return isSelected ? colorTokens['text-secondary'] : colorTokens['text-disabled']
|
|
57
|
+
if (isSelected) return colorTokens['text-default']
|
|
58
|
+
return colorTokens['text-link']
|
|
55
59
|
}, [isDisabled, isSelected])
|
|
56
60
|
|
|
57
61
|
const buttonStyles = useMemo(
|
|
58
62
|
() => ({
|
|
59
|
-
flex: '
|
|
63
|
+
flex: '1 1 auto',
|
|
60
64
|
minWidth: '0',
|
|
61
65
|
height: 'auto',
|
|
62
66
|
wordBreak: 'break-word',
|
|
63
|
-
fontFamily: '"Public Sans", sans-serif
|
|
64
|
-
border:
|
|
67
|
+
fontFamily: '"Public Sans", sans-serif',
|
|
68
|
+
border: `${borderTokens['border-focus']} solid ${
|
|
69
|
+
isSelected
|
|
70
|
+
? colorTokens[isDisabled ? 'control-disabled-selected' : 'border-focus']
|
|
71
|
+
: 'transparent'
|
|
72
|
+
}`,
|
|
65
73
|
|
|
66
|
-
backgroundColor: isSelected
|
|
67
|
-
? `${primary['50']} !important`
|
|
68
|
-
: 'transparent !important',
|
|
74
|
+
backgroundColor: isSelected ? colorTokens['surface-brand-subtle'] : 'transparent',
|
|
69
75
|
|
|
70
76
|
color: textColor,
|
|
71
77
|
cursor: isDisabled ? 'not-allowed' : 'pointer',
|
|
72
|
-
fontWeight:
|
|
73
|
-
borderRadius: '
|
|
78
|
+
fontWeight: typographyTokens['font-weight-button-regular'],
|
|
79
|
+
borderRadius: borderTokens['radius-button'],
|
|
74
80
|
transition: 'all 150ms ease-in-out',
|
|
75
81
|
whiteSpace: 'normal',
|
|
76
82
|
...sizeStyles,
|
|
77
83
|
}),
|
|
78
|
-
[sizeStyles, isDisabled, isSelected,
|
|
84
|
+
[sizeStyles, isDisabled, isSelected, textColor],
|
|
79
85
|
)
|
|
80
86
|
|
|
81
87
|
const handleClick = useCallback(() => {
|
|
@@ -85,6 +91,7 @@ const RcSesSegmentButton = React.forwardRef<HTMLButtonElement, RcSesSegmentButto
|
|
|
85
91
|
return (
|
|
86
92
|
<MuiButton
|
|
87
93
|
ref={ref}
|
|
94
|
+
variant='text'
|
|
88
95
|
type='button'
|
|
89
96
|
onClick={handleClick}
|
|
90
97
|
onKeyDown={onKeyDown}
|
|
@@ -96,9 +103,26 @@ const RcSesSegmentButton = React.forwardRef<HTMLButtonElement, RcSesSegmentButto
|
|
|
96
103
|
aria-controls={option.panelId}
|
|
97
104
|
tabIndex={isFocused && !isDisabled ? 0 : -1}
|
|
98
105
|
sx={{
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
106
|
+
'&&': {
|
|
107
|
+
...buttonStyles,
|
|
108
|
+
'&:hover, &:active': {
|
|
109
|
+
color: textColor,
|
|
110
|
+
backgroundColor: isSelected
|
|
111
|
+
? colorTokens['surface-brand-subtle']
|
|
112
|
+
: colorTokens['surface-base'],
|
|
113
|
+
},
|
|
114
|
+
'&:focus-visible': {
|
|
115
|
+
borderColor: colorTokens['border-focus'],
|
|
116
|
+
color: isSelected
|
|
117
|
+
? colorTokens['text-default']
|
|
118
|
+
: colorTokens['text-secondary'],
|
|
119
|
+
},
|
|
120
|
+
'&.Mui-disabled': {
|
|
121
|
+
color: textColor,
|
|
122
|
+
backgroundColor: isSelected
|
|
123
|
+
? colorTokens['surface-brand-subtle']
|
|
124
|
+
: 'transparent',
|
|
125
|
+
},
|
|
102
126
|
},
|
|
103
127
|
}}
|
|
104
128
|
>
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React, { useCallback, useImperativeHandle, useMemo, useRef, useState } from 'react'
|
|
2
2
|
import { useTranslation } from 'react-i18next'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { borderTokens } from '@/theme/borderTokens'
|
|
5
|
+
import { colorTokens } from '@/theme/colorTokens'
|
|
6
|
+
import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
|
|
7
|
+
import { spacingTokens } from '@/theme/spacingTokens'
|
|
5
8
|
|
|
6
9
|
import RcSesSegmentButton, { type RcSesSegmentOption } from './components/SegmentButton'
|
|
7
10
|
|
|
@@ -148,11 +151,12 @@ const RcSesSegmentedControl = React.forwardRef<
|
|
|
148
151
|
() => ({
|
|
149
152
|
display: 'flex',
|
|
150
153
|
flexWrap: 'wrap',
|
|
151
|
-
gap: '
|
|
152
|
-
padding: '
|
|
153
|
-
backgroundColor: disableBg ? 'transparent' :
|
|
154
|
-
width: '
|
|
155
|
-
|
|
154
|
+
gap: `${spacingRoleBasedTokens['space-8']} ${spacingTokens['spacing-aliases-segmented-segment-gap']}`,
|
|
155
|
+
padding: spacingTokens['spacing-aliases-segmented-track-padding'],
|
|
156
|
+
backgroundColor: disableBg ? 'transparent' : colorTokens['surface-sunken'],
|
|
157
|
+
width: 'max-content',
|
|
158
|
+
maxWidth: '100%',
|
|
159
|
+
borderRadius: borderTokens['radius-12'],
|
|
156
160
|
}),
|
|
157
161
|
[disableBg],
|
|
158
162
|
)
|
|
@@ -4,6 +4,8 @@ import RcSesButton from '@/components/common/Button'
|
|
|
4
4
|
import RcSesCard from '@/components/common/Card'
|
|
5
5
|
import ListWithIcons from '@/components/common/ListWithIcons'
|
|
6
6
|
import palette from '@/theme/palette'
|
|
7
|
+
import { sizeTokens } from '@/theme/sizeTokens'
|
|
8
|
+
import { typographyTokens } from '@/theme/typographyTokens'
|
|
7
9
|
|
|
8
10
|
import { ListWithIconsItemData } from '../../ListWithIcons/ListWithIcons.types'
|
|
9
11
|
|
|
@@ -66,8 +68,8 @@ const SelectableCardListItem = ({
|
|
|
66
68
|
}}
|
|
67
69
|
sx={{
|
|
68
70
|
p: 0,
|
|
69
|
-
height: '
|
|
70
|
-
width: '
|
|
71
|
+
height: sizeTokens['icon-size-24'],
|
|
72
|
+
width: sizeTokens['icon-size-24'],
|
|
71
73
|
margin: '0.125rem 0rem',
|
|
72
74
|
}}
|
|
73
75
|
/>
|
|
@@ -76,7 +78,7 @@ const SelectableCardListItem = ({
|
|
|
76
78
|
variant='h3'
|
|
77
79
|
sx={{
|
|
78
80
|
fontSize: '1rem',
|
|
79
|
-
fontWeight:
|
|
81
|
+
fontWeight: typographyTokens['font-weight-semibold'],
|
|
80
82
|
lineHeight: '1.5rem',
|
|
81
83
|
paddingRight: '0.25rem',
|
|
82
84
|
}}
|
|
@@ -88,7 +90,7 @@ const SelectableCardListItem = ({
|
|
|
88
90
|
variant='body2'
|
|
89
91
|
sx={{
|
|
90
92
|
fontSize: '1rem',
|
|
91
|
-
fontWeight:
|
|
93
|
+
fontWeight: typographyTokens['font-weight-light'],
|
|
92
94
|
lineHeight: '1.5rem',
|
|
93
95
|
color: palette.grey[800],
|
|
94
96
|
}}
|
|
@@ -147,7 +149,7 @@ const SelectableCardListItem = ({
|
|
|
147
149
|
title: {
|
|
148
150
|
sx: {
|
|
149
151
|
fontSize: '1rem',
|
|
150
|
-
fontWeight:
|
|
152
|
+
fontWeight: typographyTokens['font-weight-semibold'],
|
|
151
153
|
lineHeight: '1.5rem',
|
|
152
154
|
},
|
|
153
155
|
},
|