@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
|
@@ -1,46 +1,323 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
Accordion,
|
|
3
|
+
AccordionDetails,
|
|
4
|
+
AccordionSummary,
|
|
5
|
+
Box,
|
|
6
|
+
Link,
|
|
7
|
+
AccordionProps as MuiAccordionProps,
|
|
8
|
+
useMediaQuery,
|
|
9
|
+
} from '@mui/material'
|
|
10
|
+
import React, { useEffect, useRef, useState } from 'react'
|
|
3
11
|
|
|
4
|
-
import
|
|
12
|
+
import IconProps from '@/assets/IconProps'
|
|
13
|
+
import { ArrowRightIcon, CaretDownIcon } from '@/assets/icons/phosphorIcons'
|
|
14
|
+
import RcSesButton from '@/components/common/Button'
|
|
15
|
+
import IconWithSquareBackground from '@/components/common/IconWithSquareBackground'
|
|
16
|
+
import normalizeSx from '@/components/utils/normalizeSx'
|
|
17
|
+
import { borderTokens } from '@/theme/borderTokens'
|
|
18
|
+
import { colorTokens } from '@/theme/colorTokens'
|
|
19
|
+
import { accordionSummaryRootStyles } from '@/theme/light/MuiAccordionSummary'
|
|
20
|
+
import { duration, easing } from '@/theme/motion'
|
|
21
|
+
import { sizeTokens } from '@/theme/sizeTokens'
|
|
22
|
+
import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
|
|
23
|
+
import '@/theme/tokens.css'
|
|
24
|
+
import { typographyTokens } from '@/theme/typographyTokens'
|
|
5
25
|
|
|
6
26
|
import useAccordionController from './hooks/useAccordionController'
|
|
7
27
|
|
|
8
|
-
|
|
28
|
+
export interface AccordionMenuItem {
|
|
29
|
+
label: string
|
|
30
|
+
href: string
|
|
31
|
+
current?: boolean
|
|
32
|
+
onClick?: React.MouseEventHandler<HTMLAnchorElement>
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface AccordionProps extends Omit<MuiAccordionProps, 'children'> {
|
|
9
36
|
id: string
|
|
10
37
|
controller: ReturnType<typeof useAccordionController>
|
|
38
|
+
type?: 'default' | 'menu'
|
|
39
|
+
description?: React.ReactNode
|
|
40
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6
|
|
41
|
+
Icon?: React.JSXElementConstructor<IconProps>
|
|
42
|
+
menuItems?: AccordionMenuItem[]
|
|
43
|
+
allLink?: AccordionMenuItem
|
|
44
|
+
children?: React.ReactNode
|
|
11
45
|
}
|
|
12
46
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
47
|
+
const bodyText = {
|
|
48
|
+
fontFamily: typographyTokens['font-family'],
|
|
49
|
+
fontSize: typographyTokens['font-size-body-regular'],
|
|
50
|
+
lineHeight: typographyTokens['line-height-body-regular'],
|
|
51
|
+
fontWeight: typographyTokens['font-weight-body-regular'],
|
|
52
|
+
letterSpacing: typographyTokens['letter-spacing-body-regular'],
|
|
53
|
+
}
|
|
16
54
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
55
|
+
function RcSesAccordion({
|
|
56
|
+
children,
|
|
57
|
+
controller,
|
|
58
|
+
id,
|
|
59
|
+
onChange,
|
|
60
|
+
type = 'default',
|
|
61
|
+
description,
|
|
62
|
+
headingLevel = 3,
|
|
63
|
+
Icon,
|
|
64
|
+
menuItems = [],
|
|
65
|
+
allLink,
|
|
66
|
+
disabled: disabledProp,
|
|
67
|
+
expanded: expandedProp,
|
|
68
|
+
slots,
|
|
69
|
+
slotProps,
|
|
70
|
+
sx,
|
|
71
|
+
...accordionProps
|
|
72
|
+
}: AccordionProps) {
|
|
73
|
+
const menu = type === 'menu'
|
|
74
|
+
const [touchPressed, setTouchPressed] = useState(false)
|
|
75
|
+
const item = controller.state[id]
|
|
76
|
+
const canToggle = menu || item?.canToggle !== false
|
|
77
|
+
const disabled = !menu && (disabledProp ?? item?.disabled ?? false)
|
|
78
|
+
const expanded = !canToggle || (expandedProp ?? item?.expanded ?? false)
|
|
79
|
+
const title = item?.title ?? ''
|
|
80
|
+
const subtitle = description === undefined ? item?.description : description
|
|
81
|
+
const reducedMotion = useMediaQuery('(prefers-reduced-motion: reduce)')
|
|
82
|
+
const currentHref = menu
|
|
83
|
+
? (menuItems.find((link) => link.current)?.href ??
|
|
84
|
+
(allLink?.current ? allLink.href : undefined))
|
|
85
|
+
: undefined
|
|
86
|
+
const currentKey = currentHref ? `${id}:${currentHref}` : undefined
|
|
87
|
+
const previousCurrentHref = useRef<string | undefined>(undefined)
|
|
21
88
|
|
|
22
|
-
|
|
23
|
-
if (
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
if (currentKey && currentKey !== previousCurrentHref.current) controller.open(id)
|
|
91
|
+
previousCurrentHref.current = currentKey
|
|
92
|
+
}, [controller, currentKey, id])
|
|
24
93
|
|
|
25
|
-
|
|
26
|
-
if (
|
|
94
|
+
const handleOnChange = (event: React.SyntheticEvent, isExpanded: boolean) => {
|
|
95
|
+
if (!canToggle || disabled) return
|
|
96
|
+
if (menu && isExpanded) controller.open(id)
|
|
97
|
+
else controller.toggleAccordion(id, isExpanded)
|
|
98
|
+
onChange?.(event, isExpanded)
|
|
27
99
|
}
|
|
28
100
|
|
|
101
|
+
const text = (
|
|
102
|
+
<Box
|
|
103
|
+
component='span'
|
|
104
|
+
sx={{
|
|
105
|
+
display: 'flex',
|
|
106
|
+
minWidth: 0,
|
|
107
|
+
flex: 1,
|
|
108
|
+
flexDirection: 'column',
|
|
109
|
+
gap: spacingRoleBasedTokens['space-4'],
|
|
110
|
+
overflowWrap: 'anywhere',
|
|
111
|
+
textAlign: 'left',
|
|
112
|
+
}}
|
|
113
|
+
>
|
|
114
|
+
<Box component='span' sx={menu ? bodyText : undefined}>
|
|
115
|
+
{title}
|
|
116
|
+
</Box>
|
|
117
|
+
{!menu && subtitle && (
|
|
118
|
+
<Box
|
|
119
|
+
component='span'
|
|
120
|
+
sx={{
|
|
121
|
+
color: disabled
|
|
122
|
+
? colorTokens['text-disabled']
|
|
123
|
+
: colorTokens['text-secondary'],
|
|
124
|
+
fontSize: typographyTokens['font-size-body-small'],
|
|
125
|
+
lineHeight: typographyTokens['line-height-body-small'],
|
|
126
|
+
fontWeight: typographyTokens['font-weight-body-small'],
|
|
127
|
+
letterSpacing: typographyTokens['letter-spacing-body-small'],
|
|
128
|
+
}}
|
|
129
|
+
>
|
|
130
|
+
{subtitle}
|
|
131
|
+
</Box>
|
|
132
|
+
)}
|
|
133
|
+
</Box>
|
|
134
|
+
)
|
|
135
|
+
|
|
29
136
|
return (
|
|
30
137
|
<Accordion
|
|
31
|
-
disabled={disabled === true}
|
|
32
|
-
expanded={expanded === true}
|
|
33
138
|
{...accordionProps}
|
|
139
|
+
disabled={disabled}
|
|
140
|
+
expanded={expanded}
|
|
34
141
|
onChange={handleOnChange}
|
|
142
|
+
data-accordion-type={type}
|
|
143
|
+
slots={{ ...slots, heading: menu ? 'div' : `h${headingLevel}` }}
|
|
144
|
+
slotProps={{
|
|
145
|
+
...slotProps,
|
|
146
|
+
region: (ownerState) => ({
|
|
147
|
+
...(typeof slotProps?.region === 'function'
|
|
148
|
+
? slotProps.region(ownerState)
|
|
149
|
+
: slotProps?.region),
|
|
150
|
+
id: `${id}-content`,
|
|
151
|
+
'aria-labelledby': menu ? undefined : `${id}-header`,
|
|
152
|
+
role: menu ? 'presentation' : 'region',
|
|
153
|
+
}),
|
|
154
|
+
transition: (ownerState) => ({
|
|
155
|
+
...(typeof slotProps?.transition === 'function'
|
|
156
|
+
? slotProps.transition(ownerState)
|
|
157
|
+
: slotProps?.transition),
|
|
158
|
+
timeout: reducedMotion ? 0 : duration.standard,
|
|
159
|
+
easing: easing.standard,
|
|
160
|
+
}),
|
|
161
|
+
}}
|
|
162
|
+
sx={[
|
|
163
|
+
menu
|
|
164
|
+
? {
|
|
165
|
+
border: 0,
|
|
166
|
+
borderRadius: 0,
|
|
167
|
+
margin: 0,
|
|
168
|
+
'&&': { margin: 0 },
|
|
169
|
+
'&.Mui-expanded': { margin: 0 },
|
|
170
|
+
'&:has(.MuiAccordionSummary-root.Mui-focusVisible)': { outline: 'none' },
|
|
171
|
+
'& .MuiAccordionSummary-root': {
|
|
172
|
+
minHeight: '64px',
|
|
173
|
+
padding: spacingRoleBasedTokens['space-16'],
|
|
174
|
+
borderRadius: 0,
|
|
175
|
+
backgroundColor: colorTokens['surface-base'],
|
|
176
|
+
borderBottom: `${borderTokens['stroke-1']} solid ${colorTokens['border-subtle']}`,
|
|
177
|
+
'&:hover:not(.Mui-disabled), &:active, &[data-touch-pressed="true"]:not(.Mui-disabled)':
|
|
178
|
+
{
|
|
179
|
+
backgroundColor: colorTokens['surface-sunken'],
|
|
180
|
+
},
|
|
181
|
+
'&.Mui-focusVisible': {
|
|
182
|
+
backgroundColor: colorTokens['surface-base'],
|
|
183
|
+
outline: `${borderTokens['border-focus']} solid ${colorTokens['border-focus']}`,
|
|
184
|
+
outlineOffset: `calc(-1 * ${borderTokens['border-focus']})`,
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
'& .MuiAccordionSummary-content': {
|
|
188
|
+
alignItems: 'center',
|
|
189
|
+
gap: spacingRoleBasedTokens['space-12'],
|
|
190
|
+
minWidth: 0,
|
|
191
|
+
},
|
|
192
|
+
'& .MuiAccordionDetails-root': {
|
|
193
|
+
backgroundColor: colorTokens['surface-sunken'],
|
|
194
|
+
padding: `0 ${spacingRoleBasedTokens['space-16']} ${spacingRoleBasedTokens['space-8']}`,
|
|
195
|
+
borderBottom: `${borderTokens['stroke-1']} solid ${colorTokens['border-subtle']}`,
|
|
196
|
+
},
|
|
197
|
+
}
|
|
198
|
+
: {},
|
|
199
|
+
{
|
|
200
|
+
'& .MuiAccordionSummary-expandIconWrapper': {
|
|
201
|
+
color: disabled ? colorTokens['text-disabled'] : colorTokens['text-default'],
|
|
202
|
+
flexShrink: 0,
|
|
203
|
+
},
|
|
204
|
+
'& .MuiAccordionSummary-expandIconWrapper svg': {
|
|
205
|
+
width: sizeTokens['icon-size-24'],
|
|
206
|
+
height: sizeTokens['icon-size-24'],
|
|
207
|
+
},
|
|
208
|
+
'@media (prefers-reduced-motion: reduce)': {
|
|
209
|
+
'& *, & *::before, & *::after': {
|
|
210
|
+
transition: 'none !important',
|
|
211
|
+
animation: 'none !important',
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
...normalizeSx(sx),
|
|
216
|
+
]}
|
|
35
217
|
>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
218
|
+
{canToggle ? (
|
|
219
|
+
<AccordionSummary
|
|
220
|
+
data-touch-pressed={menu && touchPressed ? true : undefined}
|
|
221
|
+
onTouchStart={menu ? () => setTouchPressed(true) : undefined}
|
|
222
|
+
onTouchMove={menu ? () => setTouchPressed(false) : undefined}
|
|
223
|
+
onTouchEnd={menu ? () => setTouchPressed(false) : undefined}
|
|
224
|
+
onTouchCancel={menu ? () => setTouchPressed(false) : undefined}
|
|
225
|
+
id={`${id}-header`}
|
|
226
|
+
aria-controls={`${id}-content`}
|
|
227
|
+
aria-label={menu ? title : undefined}
|
|
228
|
+
expandIcon={<CaretDownIcon aria-hidden='true' focusable='false' />}
|
|
229
|
+
>
|
|
230
|
+
{menu && Icon && (
|
|
231
|
+
<Box component='span' aria-hidden='true'>
|
|
232
|
+
<IconWithSquareBackground Icon={Icon} size={24} variant='cyan' />
|
|
233
|
+
</Box>
|
|
234
|
+
)}
|
|
235
|
+
{text}
|
|
236
|
+
</AccordionSummary>
|
|
237
|
+
) : (
|
|
238
|
+
<Box
|
|
239
|
+
id={`${id}-header`}
|
|
240
|
+
className={`MuiAccordionSummary-root${disabled ? ' Mui-disabled' : ''}`}
|
|
241
|
+
aria-disabled={disabled || undefined}
|
|
242
|
+
sx={{
|
|
243
|
+
...accordionSummaryRootStyles,
|
|
244
|
+
display: 'flex',
|
|
245
|
+
'&:hover:not(.Mui-disabled)': {
|
|
246
|
+
backgroundColor: colorTokens['surface-sunken'],
|
|
247
|
+
},
|
|
248
|
+
fontSize: typographyTokens['font-size-heading-card-title'],
|
|
249
|
+
fontWeight: typographyTokens['font-weight-heading-card-title'],
|
|
250
|
+
lineHeight: typographyTokens['line-height-heading-card-title'],
|
|
251
|
+
letterSpacing: typographyTokens['letter-spacing-heading-card-title'],
|
|
252
|
+
}}
|
|
253
|
+
>
|
|
254
|
+
{text}
|
|
255
|
+
</Box>
|
|
256
|
+
)}
|
|
257
|
+
<AccordionDetails>
|
|
258
|
+
{menu ? (
|
|
259
|
+
<Box component='ul' sx={{ listStyle: 'none', padding: 0, margin: 0 }}>
|
|
260
|
+
{menuItems.map((link) => (
|
|
261
|
+
<Box component='li' key={link.href}>
|
|
262
|
+
<Link
|
|
263
|
+
href={link.href}
|
|
264
|
+
onClick={link.onClick}
|
|
265
|
+
aria-current={link.current ? 'page' : undefined}
|
|
266
|
+
underline='none'
|
|
267
|
+
sx={{
|
|
268
|
+
...bodyText,
|
|
269
|
+
display: 'block',
|
|
270
|
+
minHeight: '44px',
|
|
271
|
+
padding: `${spacingRoleBasedTokens['space-16']} ${spacingRoleBasedTokens['space-8']}`,
|
|
272
|
+
overflowWrap: 'anywhere',
|
|
273
|
+
color: link.current
|
|
274
|
+
? colorTokens['control-selected']
|
|
275
|
+
: colorTokens['text-default'],
|
|
276
|
+
boxShadow: link.current
|
|
277
|
+
? `inset 0 calc(-1 * ${borderTokens['stroke-2']}) ${colorTokens['control-selected']}`
|
|
278
|
+
: 'none',
|
|
279
|
+
'&:hover': {
|
|
280
|
+
color: colorTokens['text-link-hover'],
|
|
281
|
+
backgroundColor: colorTokens['surface-sunken'],
|
|
282
|
+
},
|
|
283
|
+
'&:focus-visible': {
|
|
284
|
+
outline: `${borderTokens['border-focus']} solid ${colorTokens['border-focus']}`,
|
|
285
|
+
outlineOffset: `calc(-1 * ${borderTokens['border-focus']})`,
|
|
286
|
+
},
|
|
287
|
+
}}
|
|
288
|
+
>
|
|
289
|
+
{link.label}
|
|
290
|
+
</Link>
|
|
291
|
+
</Box>
|
|
292
|
+
))}
|
|
293
|
+
{children}
|
|
294
|
+
{allLink && (
|
|
295
|
+
<Box component='li' sx={{ pl: spacingRoleBasedTokens['space-4'] }}>
|
|
296
|
+
<RcSesButton
|
|
297
|
+
component='a'
|
|
298
|
+
variant='link'
|
|
299
|
+
href={allLink.href}
|
|
300
|
+
onClick={allLink.onClick}
|
|
301
|
+
aria-current={allLink.current ? 'page' : undefined}
|
|
302
|
+
endIcon={<ArrowRightIcon aria-hidden='true' />}
|
|
303
|
+
sx={{
|
|
304
|
+
maxWidth: '100%',
|
|
305
|
+
height: 'auto',
|
|
306
|
+
minHeight: '44px',
|
|
307
|
+
whiteSpace: 'normal',
|
|
308
|
+
overflowWrap: 'anywhere',
|
|
309
|
+
textAlign: 'left',
|
|
310
|
+
}}
|
|
311
|
+
>
|
|
312
|
+
{allLink.label}
|
|
313
|
+
</RcSesButton>
|
|
314
|
+
</Box>
|
|
315
|
+
)}
|
|
316
|
+
</Box>
|
|
317
|
+
) : (
|
|
318
|
+
children
|
|
319
|
+
)}
|
|
320
|
+
</AccordionDetails>
|
|
44
321
|
</Accordion>
|
|
45
322
|
)
|
|
46
323
|
}
|
|
@@ -5,6 +5,7 @@ import { useTranslation } from 'react-i18next'
|
|
|
5
5
|
import { CaretDownIcon, CaretUpIcon, ListIcon } from '@/assets/icons/phosphorIcons'
|
|
6
6
|
import RcSesSimpleCheckbox from '@/components/form/inputs/SimpleCheckbox'
|
|
7
7
|
import palette from '@/theme/palette'
|
|
8
|
+
import { typographyTokens } from '@/theme/typographyTokens'
|
|
8
9
|
|
|
9
10
|
import { AdvancedListItemLeading as AdvancedListItemLeadingData } from '../AdvancedListItem.types'
|
|
10
11
|
|
|
@@ -133,7 +134,7 @@ const AdvancedListItemLeading = ({
|
|
|
133
134
|
backgroundColor: palette.grey[100],
|
|
134
135
|
color: palette.grey[600],
|
|
135
136
|
fontSize: '0.8125rem',
|
|
136
|
-
fontWeight:
|
|
137
|
+
fontWeight: typographyTokens['font-weight-body-caption'],
|
|
137
138
|
lineHeight: '1.125rem',
|
|
138
139
|
}}
|
|
139
140
|
>
|
|
@@ -158,7 +159,7 @@ const AdvancedListItemLeading = ({
|
|
|
158
159
|
sx={{
|
|
159
160
|
color: palette.grey[600],
|
|
160
161
|
fontSize: '0.9375rem',
|
|
161
|
-
fontWeight:
|
|
162
|
+
fontWeight: typographyTokens['font-weight-body-regular'],
|
|
162
163
|
lineHeight: '1.375rem',
|
|
163
164
|
}}
|
|
164
165
|
>
|
|
@@ -193,7 +194,6 @@ const AdvancedListItemLeading = ({
|
|
|
193
194
|
/>
|
|
194
195
|
)
|
|
195
196
|
}
|
|
196
|
-
// change to RcSesRadio when it is implemented
|
|
197
197
|
if (leading.type === 'radio') {
|
|
198
198
|
return (
|
|
199
199
|
<Radio
|
|
@@ -12,6 +12,7 @@ import RcSesButton from '@/components/common/Button'
|
|
|
12
12
|
import RcSesSwitch from '@/components/common/Switch'
|
|
13
13
|
import RcSesSimpleCheckbox from '@/components/form/inputs/SimpleCheckbox'
|
|
14
14
|
import palette from '@/theme/palette'
|
|
15
|
+
import { typographyTokens } from '@/theme/typographyTokens'
|
|
15
16
|
|
|
16
17
|
import {
|
|
17
18
|
AdvancedListItemStatusColor,
|
|
@@ -51,7 +52,7 @@ const PRICE_BLOCK_SX = {
|
|
|
51
52
|
const ACTION_BUTTON_SX = {
|
|
52
53
|
height: 'auto',
|
|
53
54
|
padding: '0.5rem 0.25rem',
|
|
54
|
-
fontWeight:
|
|
55
|
+
fontWeight: typographyTokens['font-weight-button-regular'],
|
|
55
56
|
lineHeight: '1.25rem',
|
|
56
57
|
color: palette.primary[700],
|
|
57
58
|
'&:not(.Mui-disabled) svg path': {
|
|
@@ -151,7 +152,7 @@ const AdvancedListItemTrailing = ({ trailing, disabled }: Props) => {
|
|
|
151
152
|
sx={{
|
|
152
153
|
color: palette.grey[900],
|
|
153
154
|
fontSize: '1rem',
|
|
154
|
-
fontWeight:
|
|
155
|
+
fontWeight: typographyTokens['font-weight-semibold'],
|
|
155
156
|
lineHeight: '1.375rem',
|
|
156
157
|
}}
|
|
157
158
|
>
|
|
@@ -249,7 +250,11 @@ const AdvancedListItemTrailing = ({ trailing, disabled }: Props) => {
|
|
|
249
250
|
<Typography
|
|
250
251
|
aria-label={trailing['aria-label']}
|
|
251
252
|
variant='body2'
|
|
252
|
-
sx={{
|
|
253
|
+
sx={{
|
|
254
|
+
minWidth: '1.5rem',
|
|
255
|
+
textAlign: 'center',
|
|
256
|
+
fontWeight: typographyTokens['font-weight-semibold'],
|
|
257
|
+
}}
|
|
253
258
|
>
|
|
254
259
|
{value}
|
|
255
260
|
</Typography>
|
|
@@ -5,6 +5,7 @@ import RcSesBadge from '@/components/common/Badge'
|
|
|
5
5
|
import ListWithIcons from '@/components/common/ListWithIcons'
|
|
6
6
|
import motion from '@/theme/motion'
|
|
7
7
|
import palette from '@/theme/palette'
|
|
8
|
+
import { typographyTokens } from '@/theme/typographyTokens'
|
|
8
9
|
|
|
9
10
|
import {
|
|
10
11
|
AdvancedListItemLeading as AdvancedListItemLeadingData,
|
|
@@ -274,7 +275,7 @@ const AdvancedListItem = ({
|
|
|
274
275
|
sx={{
|
|
275
276
|
color: palette.grey[900],
|
|
276
277
|
fontSize: '1rem',
|
|
277
|
-
fontWeight:
|
|
278
|
+
fontWeight: typographyTokens['font-weight-semibold'],
|
|
278
279
|
lineHeight: '1.375rem',
|
|
279
280
|
}}
|
|
280
281
|
>
|
|
@@ -289,7 +290,7 @@ const AdvancedListItem = ({
|
|
|
289
290
|
sx={{
|
|
290
291
|
color: palette.grey[600],
|
|
291
292
|
fontSize: '0.875rem',
|
|
292
|
-
fontWeight:
|
|
293
|
+
fontWeight: typographyTokens['font-weight-body-small'],
|
|
293
294
|
lineHeight: '1.25rem',
|
|
294
295
|
}}
|
|
295
296
|
>
|
|
@@ -35,7 +35,7 @@ describe('AdvancedListItemShell', () => {
|
|
|
35
35
|
)
|
|
36
36
|
|
|
37
37
|
const root = screen.getByTestId('root')
|
|
38
|
-
expect(root).
|
|
38
|
+
expect(getComputedStyle(root).borderRadius).toBe('var(--rc-radius-8)')
|
|
39
39
|
expect(root.style.border).not.toBe('none')
|
|
40
40
|
})
|
|
41
41
|
|
|
@@ -80,8 +80,8 @@ describe('AdvancedListItemShell', () => {
|
|
|
80
80
|
)
|
|
81
81
|
|
|
82
82
|
const root = screen.getByTestId('root')
|
|
83
|
-
|
|
84
|
-
expect(
|
|
83
|
+
const computed = getComputedStyle(root)
|
|
84
|
+
expect(computed.borderRadius).toBe('var(--rc-radius-0)')
|
|
85
85
|
})
|
|
86
86
|
|
|
87
87
|
it('renders leading and trailing slots when provided', () => {
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { Box, Collapse, Stack } from '@mui/material'
|
|
2
2
|
import { ReactNode, useEffect, useId, useRef } from 'react'
|
|
3
3
|
|
|
4
|
+
import { borderTokens } from '@/theme/borderTokens'
|
|
5
|
+
import { colorTokens } from '@/theme/colorTokens'
|
|
4
6
|
import motion from '@/theme/motion'
|
|
5
|
-
import
|
|
7
|
+
import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
|
|
8
|
+
import { spacingTokens } from '@/theme/spacingTokens'
|
|
6
9
|
|
|
7
10
|
import usePrefersReducedMotion from '../AdvancedListItem/hooks/usePrefersReducedMotion'
|
|
8
11
|
import {
|
|
@@ -12,15 +15,15 @@ import {
|
|
|
12
15
|
AdvancedListItemShellTestIds,
|
|
13
16
|
} from './AdvancedListItemShell.types'
|
|
14
17
|
|
|
15
|
-
const BORDER_RADIUS = '
|
|
16
|
-
const BORDER_WIDTH = '
|
|
17
|
-
const FOCUS_RING_WIDTH = '
|
|
18
|
+
const BORDER_RADIUS = borderTokens['radius-8']
|
|
19
|
+
const BORDER_WIDTH = borderTokens['stroke-1']
|
|
20
|
+
const FOCUS_RING_WIDTH = borderTokens['stroke-1']
|
|
18
21
|
|
|
19
22
|
const STATE_BORDER_COLOR: Record<AdvancedListItemShellState, string> = {
|
|
20
|
-
rest:
|
|
21
|
-
selected:
|
|
22
|
-
disabled:
|
|
23
|
-
error:
|
|
23
|
+
rest: colorTokens['border-subtle'],
|
|
24
|
+
selected: colorTokens['border-focus'],
|
|
25
|
+
disabled: colorTokens['border-subtle'],
|
|
26
|
+
error: colorTokens['status-error-border'],
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
// A conditional slot renders as false rather than as nothing, so false is absent
|
|
@@ -59,8 +62,9 @@ const AdvancedListItemShell = ({
|
|
|
59
62
|
const expandedId = useId()
|
|
60
63
|
|
|
61
64
|
const borderColor = STATE_BORDER_COLOR[state]
|
|
62
|
-
const backgroundColor =
|
|
63
|
-
|
|
65
|
+
const backgroundColor =
|
|
66
|
+
state === 'selected' ? colorTokens['surface-brand-subtle'] : undefined
|
|
67
|
+
const focusRingShadow = `0 0 0 ${FOCUS_RING_WIDTH} ${colorTokens['border-focus']}`
|
|
64
68
|
const transitionTiming = `${motion.duration.standard}ms ${motion.easing.standard}`
|
|
65
69
|
|
|
66
70
|
useEffect(() => {
|
|
@@ -163,8 +167,8 @@ const AdvancedListItemShell = ({
|
|
|
163
167
|
borderBottom:
|
|
164
168
|
isRow && state === 'rest' ? `${BORDER_WIDTH} solid ${borderColor}` : undefined,
|
|
165
169
|
backgroundColor,
|
|
166
|
-
borderRadius: isRow ? '
|
|
167
|
-
padding: '
|
|
170
|
+
borderRadius: isRow ? borderTokens['radius-0'] : BORDER_RADIUS,
|
|
171
|
+
padding: `${spacingTokens['spacing-aliases-selectable-area-padding-y']} ${spacingTokens['spacing-aliases-selectable-area-padding-x']}`,
|
|
168
172
|
opacity: isDisabled ? 0.5 : 1,
|
|
169
173
|
pointerEvents: isDisabled ? 'none' : 'auto',
|
|
170
174
|
cursor: isClickable ? 'pointer' : 'default',
|
|
@@ -175,11 +179,11 @@ const AdvancedListItemShell = ({
|
|
|
175
179
|
'&:hover':
|
|
176
180
|
isClickable && state !== 'selected'
|
|
177
181
|
? {
|
|
178
|
-
backgroundColor:
|
|
182
|
+
backgroundColor: colorTokens['surface-muted'],
|
|
179
183
|
}
|
|
180
184
|
: undefined,
|
|
181
185
|
'&:has(:focus-visible), &:focus-visible': !isDisabled
|
|
182
|
-
? { borderColor:
|
|
186
|
+
? { borderColor: colorTokens['border-focus'], boxShadow: focusRingShadow }
|
|
183
187
|
: undefined,
|
|
184
188
|
}}
|
|
185
189
|
>
|
|
@@ -188,7 +192,7 @@ const AdvancedListItemShell = ({
|
|
|
188
192
|
sx={{
|
|
189
193
|
alignItems: 'center',
|
|
190
194
|
flexWrap: { xs: 'wrap', md: 'nowrap' },
|
|
191
|
-
gap: '
|
|
195
|
+
gap: spacingTokens['spacing-aliases-list-item-gap'],
|
|
192
196
|
}}
|
|
193
197
|
>
|
|
194
198
|
{hasLeading && (
|
|
@@ -229,11 +233,11 @@ const AdvancedListItemShell = ({
|
|
|
229
233
|
id={expandedId}
|
|
230
234
|
data-testid={testIds?.expanded}
|
|
231
235
|
sx={{
|
|
232
|
-
margin: '
|
|
233
|
-
backgroundColor:
|
|
236
|
+
margin: `${spacingRoleBasedTokens['space-20']} ${spacingRoleBasedTokens['space-12']}`,
|
|
237
|
+
backgroundColor: colorTokens['surface-sunken'],
|
|
234
238
|
borderRadius: BORDER_RADIUS,
|
|
235
|
-
border: `${BORDER_WIDTH} solid ${
|
|
236
|
-
padding: '
|
|
239
|
+
border: `${BORDER_WIDTH} solid ${colorTokens['border-subtle']}`,
|
|
240
|
+
padding: spacingRoleBasedTokens['space-12'],
|
|
237
241
|
}}
|
|
238
242
|
>
|
|
239
243
|
{expanded}
|
|
@@ -53,7 +53,7 @@ describe('AdvancedList', () => {
|
|
|
53
53
|
test('navigating to next page shows the next set of items', () => {
|
|
54
54
|
renderList(<AdvancedList items={makeItems(8)} />)
|
|
55
55
|
|
|
56
|
-
fireEvent.click(screen.getByRole('button', { name: 'Kitas' }))
|
|
56
|
+
fireEvent.click(screen.getByRole('button', { name: 'Kitas puslapis' }))
|
|
57
57
|
|
|
58
58
|
expect(screen.getByText('Item 6')).toBeInTheDocument()
|
|
59
59
|
expect(screen.getByText('Item 7')).toBeInTheDocument()
|
|
@@ -92,6 +92,8 @@ describe('AdvancedList', () => {
|
|
|
92
92
|
test('does not render pagination controls when everything fits on one page', () => {
|
|
93
93
|
renderList(<AdvancedList items={makeItems(2)} />)
|
|
94
94
|
|
|
95
|
-
expect(
|
|
95
|
+
expect(
|
|
96
|
+
screen.queryByRole('button', { name: 'Kitas puslapis' }),
|
|
97
|
+
).not.toBeInTheDocument()
|
|
96
98
|
})
|
|
97
99
|
})
|
|
@@ -9,6 +9,9 @@ import {
|
|
|
9
9
|
import { useTranslation } from 'react-i18next'
|
|
10
10
|
|
|
11
11
|
import { CloseIcon } from '@/assets/icons/phosphorIcons'
|
|
12
|
+
import { sizeTokens } from '@/theme/sizeTokens'
|
|
13
|
+
import { spacingRoleBasedTokens } from '@/theme/spacingRoleBasedTokens'
|
|
14
|
+
import { spacingTokens } from '@/theme/spacingTokens'
|
|
12
15
|
|
|
13
16
|
type Props = Omit<MuiAlertProps, 'onClose'> & {
|
|
14
17
|
container?: boolean | ContainerProps
|
|
@@ -29,8 +32,8 @@ const closeButtonStyles = {
|
|
|
29
32
|
display: 'inline-flex',
|
|
30
33
|
alignItems: 'center',
|
|
31
34
|
justifyContent: 'center',
|
|
32
|
-
minHeight: '
|
|
33
|
-
minWidth: '
|
|
35
|
+
minHeight: sizeTokens['icon-size-20'],
|
|
36
|
+
minWidth: sizeTokens['icon-size-20'],
|
|
34
37
|
padding: 0,
|
|
35
38
|
border: 'none',
|
|
36
39
|
background: 'none',
|
|
@@ -43,7 +46,7 @@ const closeButtonStyles = {
|
|
|
43
46
|
const actionContainerStyles = {
|
|
44
47
|
display: 'inline-flex',
|
|
45
48
|
alignItems: 'center',
|
|
46
|
-
gap: '
|
|
49
|
+
gap: spacingRoleBasedTokens['space-12'],
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
// Only the alert body and its CTA form a row; the message slot itself stays a plain
|
|
@@ -53,7 +56,7 @@ const messageRowStyles = (theme: Theme) => ({
|
|
|
53
56
|
flexWrap: 'wrap',
|
|
54
57
|
alignItems: 'center',
|
|
55
58
|
justifyContent: 'space-between',
|
|
56
|
-
gap: '
|
|
59
|
+
gap: spacingRoleBasedTokens['space-12'],
|
|
57
60
|
|
|
58
61
|
[theme.breakpoints.up('md')]: {
|
|
59
62
|
flexWrap: 'nowrap',
|
|
@@ -106,7 +109,7 @@ function RcSesAlert({
|
|
|
106
109
|
aria-label={t('close')}
|
|
107
110
|
sx={closeButtonStyles}
|
|
108
111
|
>
|
|
109
|
-
<CloseIcon size={
|
|
112
|
+
<CloseIcon size={20} fillColor='currentColor' focusable={false} aria-hidden />
|
|
110
113
|
</Box>
|
|
111
114
|
) : null
|
|
112
115
|
|
|
@@ -189,10 +192,11 @@ function RcSesAlert({
|
|
|
189
192
|
<Box sx={{ minWidth: 0 }}>{children}</Box>
|
|
190
193
|
<Button
|
|
191
194
|
variant='link'
|
|
195
|
+
size='small'
|
|
192
196
|
onClick={onActionClick}
|
|
193
197
|
sx={(theme) => ({
|
|
194
198
|
flexBasis: '100%',
|
|
195
|
-
padding: '
|
|
199
|
+
padding: `${spacingTokens['spacing-aliases-button-padding-y-small']} ${spacingTokens['spacing-aliases-button-padding-x-link']}`,
|
|
196
200
|
[theme.breakpoints.up('md')]: {
|
|
197
201
|
flexBasis: 'auto',
|
|
198
202
|
},
|