@registrucentras/rc-ses-react-components 2.0.0-rc.7 → 2.0.0-rc.9
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/components/common/Accordion/hooks/useAccordionController.d.ts +2 -2
- package/dist/components/common/Accordion/types/AccordionControllerState.d.ts +2 -2
- package/dist/components/common/AdvancedList/components/AdvancedListItem/AdvancedListItem.types.d.ts +2 -2
- package/dist/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemLeading.d.ts +2 -2
- package/dist/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemTrailing.d.ts +2 -2
- package/dist/components/common/Badge/index.d.ts +2 -2
- package/dist/components/common/Breadcrumbs/index.d.ts +4 -4
- package/dist/components/common/Card/index.d.ts +2 -2
- package/dist/components/common/CardShell/CardFooter/index.d.ts +1 -1
- package/dist/components/common/CardShell/CardFooter/types.d.ts +4 -9
- package/dist/components/common/CardShell/types.d.ts +4 -4
- package/dist/components/common/IconWithCircularBackground.d.ts +2 -2
- package/dist/components/common/IconWithSquareBackground/index.d.ts +2 -2
- package/dist/components/common/ImageCard/index.d.ts +2 -2
- package/dist/components/common/SelectableCardList/components/SelectableCardListItem.d.ts +2 -2
- package/dist/components/common/SelectableCardList/index.d.ts +2 -2
- package/dist/components/common/ServiceLinks/types.d.ts +6 -6
- package/dist/components/common/SideNav/SideNav.types.d.ts +9 -6
- package/dist/components/common/SideNav/SideNavLayout.d.ts +1 -1
- package/dist/components/common/SideNav/components/SideNavPill.d.ts +2 -2
- package/dist/components/common/SideNav/components/SideNavPillList.d.ts +2 -2
- package/dist/components/common/SideNav/components/SideNavRow.d.ts +4 -3
- package/dist/components/common/SideNav/hooks/useElementHeight.d.ts +11 -0
- package/dist/components/common/SideNav/hooks/useKeepActiveItemInView.d.ts +19 -0
- package/dist/components/common/SideNav/hooks/useSideNavScrollSpy.d.ts +2 -2
- package/dist/components/common/SideNav/index.d.ts +2 -2
- package/dist/components/common/Tabs/TabPanel.d.ts +2 -2
- package/dist/components/common/Tabs/TabsWrapper.d.ts +2 -2
- package/dist/components/common/TitleBlock/types.d.ts +4 -4
- package/dist/components/form/components/FormControlWrapper/components/FieldSuffix.d.ts +2 -2
- package/dist/components/form/components/FormControlWrapper/index.d.ts +2 -2
- package/dist/components/form/inputs/RadioButtonGroup.d.ts +3 -3
- package/dist/components/form/inputs/SearchableField.d.ts +2 -2
- package/dist/components/form/inputs/Select/Select.types.d.ts +2 -2
- package/dist/components/layout/Footer/index.d.ts +2 -2
- package/dist/components/layout/ServiceFormActions.d.ts +2 -2
- package/dist/components/layout/ServiceFormContainer/AccordionFormContainer/components/AccordionCollapseControls.d.ts +2 -2
- package/dist/components/layout/ServiceFormContainer/AccordionFormContainer/index.d.ts +2 -2
- package/dist/components/layout/ServiceHeader.d.ts +2 -2
- package/dist/components/layout/ServicePage.d.ts +2 -2
- package/dist/components/utils/normalizeSx.d.ts +1 -1
- package/dist/library/types.d.ts +2 -2
- package/dist/registrucentras-rc-ses-react-components.cjs +1 -1
- package/dist/registrucentras-rc-ses-react-components.js +1660 -1589
- package/dist/types/assets/IconProps.d.ts +2 -2
- package/dist/types/cards/CardServiceProps.d.ts +2 -2
- package/dist/types/common/QuickLinkType.d.ts +2 -2
- package/dist/types/inputs/InputIconProps.d.ts +2 -2
- package/dist/types/lists/ListNewsItemType.d.ts +2 -2
- package/dist/types/lists/ListServicesItemType.d.ts +3 -3
- package/package.json +2 -1
- package/src/components/common/Accordion/hooks/useAccordionController.tsx +1 -1
- package/src/components/common/Accordion/index.tsx +1 -4
- package/src/components/common/Accordion/types/AccordionControllerState.ts +1 -1
- package/src/components/common/AdvancedList/components/AdvancedListItem/AdvancedListItem.types.ts +1 -1
- package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemLeading.tsx +1 -1
- package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemTrailing.tsx +1 -1
- package/src/components/common/AdvancedList/components/AdvancedListItem/index.test.tsx +2 -2
- package/src/components/common/Badge/index.tsx +3 -3
- package/src/components/common/Breadcrumbs/index.tsx +5 -2
- package/src/components/common/Card/index.tsx +1 -1
- package/src/components/common/CardShell/CardFooter/index.tsx +6 -13
- package/src/components/common/CardShell/CardFooter/types.ts +2 -7
- package/src/components/common/CardShell/types.ts +2 -2
- package/src/components/common/IconWithCircularBackground.tsx +7 -8
- package/src/components/common/IconWithSquareBackground/index.tsx +7 -8
- package/src/components/common/ImageCard/index.tsx +1 -1
- package/src/components/common/SegmentedControl/components/SegmentButton/index.tsx +18 -19
- package/src/components/common/SelectableCardList/components/SelectableCardListItem.tsx +1 -1
- package/src/components/common/SelectableCardList/index.tsx +1 -1
- package/src/components/common/ServiceLinks/types.ts +3 -3
- package/src/components/common/SideNav/SideNav.types.ts +22 -4
- package/src/components/common/SideNav/SideNavLayout.test.tsx +52 -0
- package/src/components/common/SideNav/SideNavLayout.tsx +23 -3
- package/src/components/common/SideNav/components/SideNavPill.tsx +1 -1
- package/src/components/common/SideNav/components/SideNavPillList.tsx +8 -23
- package/src/components/common/SideNav/components/SideNavRow.tsx +6 -2
- package/src/components/common/SideNav/hooks/useElementHeight.test.ts +135 -0
- package/src/components/common/SideNav/hooks/useElementHeight.ts +46 -0
- package/src/components/common/SideNav/hooks/useKeepActiveItemInView.test.ts +258 -0
- package/src/components/common/SideNav/hooks/useKeepActiveItemInView.ts +80 -0
- package/src/components/common/SideNav/hooks/useSideNavScrollSpy.test.ts +9 -2
- package/src/components/common/SideNav/hooks/useSideNavScrollSpy.ts +4 -3
- package/src/components/common/SideNav/index.test.tsx +51 -0
- package/src/components/common/SideNav/index.tsx +58 -13
- package/src/components/common/Snackbar/index.test.tsx +40 -0
- package/src/components/common/Snackbar/index.tsx +9 -3
- package/src/components/common/Tabs/TabPanel.tsx +1 -1
- package/src/components/common/Tabs/TabsWrapper.tsx +1 -1
- package/src/components/common/TitleBlock/index.test.tsx +9 -7
- package/src/components/common/TitleBlock/index.tsx +13 -9
- package/src/components/common/TitleBlock/types.ts +2 -2
- package/src/components/form/components/FormControlWrapper/components/FieldSuffix.tsx +1 -1
- package/src/components/form/components/FormControlWrapper/index.tsx +1 -1
- package/src/components/form/inputs/Datepicker/index.test.tsx +1 -1
- package/src/components/form/inputs/FileDropzone.tsx +1 -4
- package/src/components/form/inputs/NumberStepper.test.tsx +83 -0
- package/src/components/form/inputs/NumberStepper.tsx +7 -8
- package/src/components/form/inputs/RadioButtonGroup.test.tsx +1 -1
- package/src/components/form/inputs/RadioButtonGroup.tsx +2 -2
- package/src/components/form/inputs/SearchInput/index.tsx +1 -1
- package/src/components/form/inputs/SearchableField.test.tsx +2 -2
- package/src/components/form/inputs/SearchableField.tsx +1 -1
- package/src/components/form/inputs/Select/Select.types.ts +1 -1
- package/src/components/form/inputs/Select/index.test.tsx +3 -3
- package/src/components/layout/Footer/index.tsx +1 -1
- package/src/components/layout/ServiceFormActions.tsx +1 -1
- package/src/components/layout/ServiceFormContainer/AccordionFormContainer/components/AccordionCollapseControls.tsx +1 -1
- package/src/components/layout/ServiceFormContainer/AccordionFormContainer/index.tsx +1 -1
- package/src/components/layout/ServiceHeader.tsx +1 -1
- package/src/components/layout/ServicePage.tsx +1 -1
- package/src/components/utils/normalizeSx.ts +2 -4
- package/src/examples/ListWithPagination/index.tsx +0 -2
- package/src/examples/MultipleStepForm/components/AdditionalServicesForm.tsx +1 -1
- package/src/examples/MultipleStepForm/components/ServiceIssuanceForm.tsx +1 -1
- package/src/examples/MultipleStepForm/components/TermsAndConditionsForm.tsx +1 -1
- package/src/examples/MultipleStepForm/types/MultiStepFormModel.ts +1 -1
- package/src/examples/SingleStepForm/components/ObjectIdentifierSearchModal.tsx +2 -2
- package/src/examples/SingleStepForm/types/SingleStepFormModel.ts +1 -1
- package/src/library/types.ts +2 -1
- package/src/stories/atoms/Button.stories.tsx +9 -14
- package/src/stories/atoms/Checkbox.stories.tsx +1 -1
- package/src/stories/atoms/Icons.stories.tsx +1 -1
- package/src/stories/atoms/NumberStepper.stories.tsx +1 -1
- package/src/stories/atoms/PhoneInput.stories.tsx +1 -1
- package/src/stories/atoms/Select.stories.tsx +7 -9
- package/src/stories/atoms/Switch.stories.tsx +1 -1
- package/src/stories/molecules/Alert.stories.tsx +2 -2
- package/src/stories/molecules/CardShell.stories.tsx +4 -4
- package/src/stories/molecules/CheckboxFormControl.stories.tsx +13 -21
- package/src/stories/molecules/RadioButtonGroup.stories.tsx +1 -1
- package/src/stories/molecules/Snackbar.stories.tsx +2 -2
- package/src/stories/molecules/TitleBlock.stories.tsx +40 -1
- package/src/stories/organisms/AdvancedList.stories.tsx +4 -4
- package/src/stories/organisms/FileDropzone.stories.tsx +1 -1
- package/src/stories/organisms/FileUpload.stories.tsx +1 -1
- package/src/stories/organisms/SideNav.stories.tsx +41 -3
- package/src/stubs/Component.tsx +4 -4
- package/src/types/assets/IconProps.tsx +1 -1
- package/src/types/cards/CardServiceProps.tsx +1 -1
- package/src/types/common/QuickLinkType.tsx +1 -1
- package/src/types/inputs/InputIconProps.tsx +1 -1
- package/src/types/lists/ListNewsItemType.tsx +1 -1
- package/src/types/lists/ListServicesItemType.tsx +2 -2
- package/src/vite-env.d.ts +2 -2
- package/dist/stories/atoms/Badge.stories.d.ts +0 -9
- package/dist/stories/atoms/Button.stories.d.ts +0 -107
- package/dist/stories/atoms/Checkbox.stories.d.ts +0 -21
- package/dist/stories/atoms/IconWithCircularBackground.stories.d.ts +0 -6
- package/dist/stories/atoms/IconWithSquareBackground.stories.d.ts +0 -7
- package/dist/stories/atoms/Icons.stories.d.ts +0 -7
- package/dist/stories/atoms/Loader.stories.d.ts +0 -36
- package/dist/stories/atoms/LoadingSpinner.stories.d.ts +0 -62
- package/dist/stories/atoms/Logo.stories.d.ts +0 -12
- package/dist/stories/atoms/NumberStepper.stories.d.ts +0 -6
- package/dist/stories/atoms/PhoneInput.stories.d.ts +0 -10
- package/dist/stories/atoms/SearchInput.stories.d.ts +0 -11
- package/dist/stories/atoms/Select.stories.d.ts +0 -7
- package/dist/stories/atoms/SimpleCheckbox.stories.d.ts +0 -19
- package/dist/stories/atoms/Switch.stories.d.ts +0 -17
- package/dist/stories/atoms/Tab.stories.d.ts +0 -8
- package/dist/stories/atoms/TextField.stories.d.ts +0 -6
- package/dist/stories/atoms/Tooltip.stories.d.ts +0 -48
- package/dist/stories/foundations/ThemedMuiComponents.stories.d.ts +0 -25
- package/dist/stories/molecules/Alert.stories.d.ts +0 -14
- package/dist/stories/molecules/Breadcrumbs.stories.d.ts +0 -6
- package/dist/stories/molecules/ButtonWithPopover.stories.d.ts +0 -7
- package/dist/stories/molecules/Card.stories.d.ts +0 -8
- package/dist/stories/molecules/CardShell.stories.d.ts +0 -18
- package/dist/stories/molecules/CheckboxFormControl.stories.d.ts +0 -9
- package/dist/stories/molecules/DatePicker.stories.d.ts +0 -152
- package/dist/stories/molecules/FormControlWrapper.stories.d.ts +0 -7
- package/dist/stories/molecules/ImageCard.stories.d.ts +0 -8
- package/dist/stories/molecules/ListWithIcons.stories.d.ts +0 -34
- package/dist/stories/molecules/PhoneInputFormControl.stories.d.ts +0 -6
- package/dist/stories/molecules/Popover.stories.d.ts +0 -12
- package/dist/stories/molecules/RadioButtonGroup.stories.d.ts +0 -6
- package/dist/stories/molecules/SearchableField.stories.d.ts +0 -6
- package/dist/stories/molecules/SegmentedControl.stories.d.ts +0 -202
- package/dist/stories/molecules/Snackbar.stories.d.ts +0 -143
- package/dist/stories/molecules/TabPanel.stories.d.ts +0 -7
- package/dist/stories/molecules/Tabs.stories.d.ts +0 -7
- package/dist/stories/molecules/TabsWrapper.stories.d.ts +0 -6
- package/dist/stories/molecules/TitleBlock.stories.d.ts +0 -22
- package/dist/stories/organisms/Accordion.stories.d.ts +0 -18
- package/dist/stories/organisms/AdvancedList.stories.d.ts +0 -33
- package/dist/stories/organisms/AdvancedListItem.stories.d.ts +0 -33
- package/dist/stories/organisms/CardFormContainer.stories.d.ts +0 -7
- package/dist/stories/organisms/DataPagination.stories.d.ts +0 -47
- package/dist/stories/organisms/Dialog.stories.d.ts +0 -15
- package/dist/stories/organisms/FileDropzone.stories.d.ts +0 -6
- package/dist/stories/organisms/FileUpload.stories.d.ts +0 -18
- package/dist/stories/organisms/Footer.stories.d.ts +0 -6
- package/dist/stories/organisms/FullPageLoader.stories.d.ts +0 -37
- package/dist/stories/organisms/Modal.stories.d.ts +0 -10
- package/dist/stories/organisms/SelectableCardList.stories.d.ts +0 -37
- package/dist/stories/organisms/ServiceFormActions.stories.d.ts +0 -6
- package/dist/stories/organisms/ServiceFormContainer.stories.d.ts +0 -15
- package/dist/stories/organisms/ServiceHeader.stories.d.ts +0 -7
- package/dist/stories/organisms/ServiceLinks.stories.d.ts +0 -28
- package/dist/stories/organisms/ServiceWizardStepper.stories.d.ts +0 -7
- package/dist/stories/organisms/SideNav.stories.d.ts +0 -7
- package/dist/stories/templates/ServicePage.stories.d.ts +0 -6
|
@@ -7,7 +7,7 @@ import theme from '@/theme/light'
|
|
|
7
7
|
|
|
8
8
|
import RcSesSelect from '.'
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
interface TestWrapperProps {
|
|
11
11
|
defaultValue?: string | null
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -22,13 +22,13 @@ const options = [
|
|
|
22
22
|
},
|
|
23
23
|
]
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
interface UnregisterTestWrapperProps {
|
|
26
26
|
shouldUnregister?: boolean
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
const UnregisterTestWrapper = ({ shouldUnregister }: UnregisterTestWrapperProps) => {
|
|
30
30
|
const { control, getValues } = useForm({
|
|
31
|
-
defaultValues: { selection: 'short-option'
|
|
31
|
+
defaultValues: { selection: 'short-option' },
|
|
32
32
|
})
|
|
33
33
|
const [mounted, setMounted] = useState(true)
|
|
34
34
|
const [formValues, setFormValues] = useState('')
|
|
@@ -5,7 +5,7 @@ import ExpandChevronsIcon from '@/assets/icons/ExpandChevronsIcon'
|
|
|
5
5
|
import useAccordionController from '@/components/common/Accordion/hooks/useAccordionController'
|
|
6
6
|
import Button from '@/components/common/Button'
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
interface Props {
|
|
9
9
|
controller: ReturnType<typeof useAccordionController>
|
|
10
10
|
}
|
|
11
11
|
function AccordionCollapseControls({ controller }: Props) {
|
|
@@ -9,7 +9,7 @@ import ServiceWizardStepper from '../../ServiceWizardStepper'
|
|
|
9
9
|
import AccordionCollapseControls from './components/AccordionCollapseControls'
|
|
10
10
|
import mapAccordionStateToSteps from './utils'
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
interface Props {
|
|
13
13
|
accordionController: ReturnType<typeof useAccordionController>
|
|
14
14
|
children: React.ReactNode
|
|
15
15
|
showAccordionCollapseControls?: boolean
|
|
@@ -5,7 +5,7 @@ import RcSesBreadcrumbs from '@/components/common/Breadcrumbs'
|
|
|
5
5
|
import theme from '@/theme/light'
|
|
6
6
|
import { common } from '@/theme/palette'
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
interface Props {
|
|
9
9
|
breadcrumbsProps: React.ComponentProps<typeof RcSesBreadcrumbs>
|
|
10
10
|
children?: React.ReactNode
|
|
11
11
|
title: string
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { SxProps, Theme } from '@mui/material'
|
|
2
2
|
|
|
3
3
|
type SxEntry =
|
|
4
|
-
Extract<SxProps<Theme>,
|
|
5
|
-
? T
|
|
6
|
-
: never
|
|
4
|
+
Extract<SxProps<Theme>, readonly unknown[]> extends readonly (infer T)[] ? T : never
|
|
7
5
|
|
|
8
|
-
function isSxArray(sx: SxProps<Theme>): sx is
|
|
6
|
+
function isSxArray(sx: SxProps<Theme>): sx is readonly SxEntry[] {
|
|
9
7
|
return Array.isArray(sx)
|
|
10
8
|
}
|
|
11
9
|
|
|
@@ -58,8 +58,6 @@ function ListWithPagination() {
|
|
|
58
58
|
const [selectedItemId, setSelectedItemId] = useState<string | null>(null)
|
|
59
59
|
|
|
60
60
|
useEffect(() => {
|
|
61
|
-
setIsLoading(true)
|
|
62
|
-
|
|
63
61
|
const timer = setTimeout(() => {
|
|
64
62
|
setData(mapToSelectableItems(mockApiData))
|
|
65
63
|
setIsLoading(false)
|
|
@@ -4,7 +4,7 @@ import RcSesAlert from '@/components/common/Alert'
|
|
|
4
4
|
import RcSesRadioButtonGroup from '@/components/form/inputs/RadioButtonGroup'
|
|
5
5
|
import RcSesSelect from '@/components/form/inputs/Select'
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
interface FormModel {
|
|
8
8
|
issuanceMethod: string
|
|
9
9
|
rcBranch: string
|
|
10
10
|
}
|
|
@@ -19,7 +19,7 @@ import { useForm } from 'react-hook-form'
|
|
|
19
19
|
|
|
20
20
|
import RcSesTextField from '@/components/form/inputs/TextField'
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
interface FormModel {
|
|
23
23
|
city: string
|
|
24
24
|
street: string
|
|
25
25
|
addressNo: string
|
|
@@ -27,7 +27,7 @@ type FormModel = {
|
|
|
27
27
|
aptNo: string
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
interface Props {
|
|
31
31
|
open: boolean
|
|
32
32
|
onSubmit: (value: string) => void
|
|
33
33
|
onClose: () => void
|
package/src/library/types.ts
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
RcSesServiceLinksProps,
|
|
23
23
|
RcSesServiceLinksTestIds,
|
|
24
24
|
} from '@/components/common/ServiceLinks/types'
|
|
25
|
-
import { RcSesSideNavItem } from '@/components/common/SideNav'
|
|
25
|
+
import { RcSesSideNavItem, RcSesSideNavOverflow } from '@/components/common/SideNav'
|
|
26
26
|
import { RcSesSideNavLayoutProps } from '@/components/common/SideNav/SideNavLayout'
|
|
27
27
|
import {
|
|
28
28
|
RcSesTitleBlockProps,
|
|
@@ -81,6 +81,7 @@ export type {
|
|
|
81
81
|
RcSesTooltipProps,
|
|
82
82
|
RcSesSideNavItem,
|
|
83
83
|
RcSesSideNavLayoutProps,
|
|
84
|
+
RcSesSideNavOverflow,
|
|
84
85
|
}
|
|
85
86
|
export type { RcSesDialogProps, DialogSize }
|
|
86
87
|
export type { RcSesModalProps, ModalVariant }
|
|
@@ -6,12 +6,7 @@ import Button from '@/components/common/Button'
|
|
|
6
6
|
import { grey } from '@/theme/palette'
|
|
7
7
|
import { ButtonProps } from '@/types/buttons/ButtonProps'
|
|
8
8
|
|
|
9
|
-
const variantOptions:
|
|
10
|
-
'contained',
|
|
11
|
-
'outlined',
|
|
12
|
-
'link',
|
|
13
|
-
'text',
|
|
14
|
-
]
|
|
9
|
+
const variantOptions: ButtonProps['variant'][] = ['contained', 'outlined', 'link', 'text']
|
|
15
10
|
const colorOptions = [
|
|
16
11
|
'primary',
|
|
17
12
|
'secondary',
|
|
@@ -249,7 +244,7 @@ export const ErrorOutlined: Story = {
|
|
|
249
244
|
export const LightOutlined: Story = {
|
|
250
245
|
args: {
|
|
251
246
|
variant: 'outlined',
|
|
252
|
-
color: 'light'
|
|
247
|
+
color: 'light',
|
|
253
248
|
children: 'Light Button',
|
|
254
249
|
},
|
|
255
250
|
decorators: [
|
|
@@ -273,7 +268,7 @@ export const LightOutlined: Story = {
|
|
|
273
268
|
export const LightOutlinedWithIcon: Story = {
|
|
274
269
|
args: {
|
|
275
270
|
variant: 'outlined',
|
|
276
|
-
color: 'light'
|
|
271
|
+
color: 'light',
|
|
277
272
|
startIcon: <PlusBoldIcon />,
|
|
278
273
|
children: 'Light Button with Icon',
|
|
279
274
|
},
|
|
@@ -298,7 +293,7 @@ export const LightOutlinedWithIcon: Story = {
|
|
|
298
293
|
export const LightOutlinedDisabled: Story = {
|
|
299
294
|
args: {
|
|
300
295
|
variant: 'outlined',
|
|
301
|
-
color: 'light'
|
|
296
|
+
color: 'light',
|
|
302
297
|
children: 'Light Button Disabled',
|
|
303
298
|
disabled: true,
|
|
304
299
|
},
|
|
@@ -324,7 +319,7 @@ export const GhostOutlinedIconOnly: Story = {
|
|
|
324
319
|
args: {
|
|
325
320
|
'aria-label': 'Close',
|
|
326
321
|
children: <PlusBoldIcon />,
|
|
327
|
-
color: 'ghost'
|
|
322
|
+
color: 'ghost',
|
|
328
323
|
iconOnly: true,
|
|
329
324
|
variant: 'outlined',
|
|
330
325
|
},
|
|
@@ -350,7 +345,7 @@ export const GhostOutlinedIconOnlyDisabled: Story = {
|
|
|
350
345
|
args: {
|
|
351
346
|
'aria-label': 'Close',
|
|
352
347
|
children: <PlusBoldIcon />,
|
|
353
|
-
color: 'ghost'
|
|
348
|
+
color: 'ghost',
|
|
354
349
|
disabled: true,
|
|
355
350
|
iconOnly: true,
|
|
356
351
|
variant: 'outlined',
|
|
@@ -491,7 +486,7 @@ export const ErrorOutlinedLoading: Story = {
|
|
|
491
486
|
export const LightOutlinedLoading: Story = {
|
|
492
487
|
args: {
|
|
493
488
|
variant: 'outlined',
|
|
494
|
-
color: 'light'
|
|
489
|
+
color: 'light',
|
|
495
490
|
children: 'Light Button',
|
|
496
491
|
loading: true,
|
|
497
492
|
},
|
|
@@ -516,7 +511,7 @@ export const LightOutlinedLoading: Story = {
|
|
|
516
511
|
export const LightOutlinedWithIconLoading: Story = {
|
|
517
512
|
args: {
|
|
518
513
|
variant: 'outlined',
|
|
519
|
-
color: 'light'
|
|
514
|
+
color: 'light',
|
|
520
515
|
startIcon: <PlusBoldIcon />,
|
|
521
516
|
children: 'Light Button with Icon',
|
|
522
517
|
loading: true,
|
|
@@ -543,7 +538,7 @@ export const GhostOutlinedIconOnlyLoading: Story = {
|
|
|
543
538
|
args: {
|
|
544
539
|
'aria-label': 'Close',
|
|
545
540
|
children: <PlusBoldIcon />,
|
|
546
|
-
color: 'ghost'
|
|
541
|
+
color: 'ghost',
|
|
547
542
|
iconOnly: true,
|
|
548
543
|
variant: 'outlined',
|
|
549
544
|
loading: true,
|
|
@@ -7,7 +7,7 @@ import FieldView from '@/components/storybook/FieldView'
|
|
|
7
7
|
import Fields from '@/components/storybook/Fields'
|
|
8
8
|
import PreviewTitle from '@/components/storybook/PreviewTitle'
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
interface FormModel {
|
|
11
11
|
countable: number
|
|
12
12
|
countable2: number
|
|
13
13
|
countable3: number
|
|
@@ -7,7 +7,7 @@ import FieldView from '@/components/storybook/FieldView'
|
|
|
7
7
|
import Fields from '@/components/storybook/Fields'
|
|
8
8
|
import PreviewTitle from '@/components/storybook/PreviewTitle'
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
interface FormModel {
|
|
11
11
|
phone: string
|
|
12
12
|
phoneDisabled: string
|
|
13
13
|
phoneError: string
|
|
@@ -237,7 +237,7 @@ export const Main: Story = {
|
|
|
237
237
|
},
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
|
|
240
|
+
interface VariantsFormModel {
|
|
241
241
|
singleSelect: string | null
|
|
242
242
|
groupedSelect: string | null
|
|
243
243
|
singleSearchSelect: string | null
|
|
@@ -266,14 +266,12 @@ const variantOptions = [
|
|
|
266
266
|
},
|
|
267
267
|
]
|
|
268
268
|
|
|
269
|
-
const groupedVariantOptions:
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
}
|
|
276
|
-
> = [
|
|
269
|
+
const groupedVariantOptions: ({
|
|
270
|
+
group: string
|
|
271
|
+
} & {
|
|
272
|
+
value: string
|
|
273
|
+
label: string
|
|
274
|
+
})[] = [
|
|
277
275
|
{ value: 'group-1-option-1', label: '1st option', group: 'GROUP 1' },
|
|
278
276
|
{ value: 'group-1-option-2', label: '2st option', group: 'GROUP 1' },
|
|
279
277
|
{ value: 'group-1-option-3', label: '3rd option', group: 'GROUP 1' },
|
|
@@ -11,7 +11,7 @@ import PreviewTitle from '@/components/storybook/PreviewTitle'
|
|
|
11
11
|
const lorem =
|
|
12
12
|
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard."
|
|
13
13
|
|
|
14
|
-
const severities:
|
|
14
|
+
const severities: ('grey' | 'info' | 'success' | 'warning' | 'error')[] = [
|
|
15
15
|
'grey',
|
|
16
16
|
'info',
|
|
17
17
|
'success',
|
|
@@ -180,7 +180,7 @@ export const Toggles: Story = {
|
|
|
180
180
|
|
|
181
181
|
function DismissibleTemplate() {
|
|
182
182
|
const [visibleSeverities, setVisibleSeverities] = useState<
|
|
183
|
-
|
|
183
|
+
(typeof severities)[number][]
|
|
184
184
|
>([...severities])
|
|
185
185
|
|
|
186
186
|
return (
|
|
@@ -262,9 +262,9 @@ export const TabletViewport: Story = {
|
|
|
262
262
|
globals: { viewport: { value: 'tablet768' } },
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
// Pins the CardFooter align='start' + single-action
|
|
266
|
-
//
|
|
267
|
-
//
|
|
265
|
+
// Pins the CardFooter align='start' + single-action path at 375, so the
|
|
266
|
+
// mobile left-align regression the FooterLink helper depends on stays
|
|
267
|
+
// covered by the visual suite.
|
|
268
268
|
export const LeftAlignedFooterMobileViewport: Story = {
|
|
269
269
|
args: {
|
|
270
270
|
variant: 'card',
|
|
@@ -272,7 +272,7 @@ export const LeftAlignedFooterMobileViewport: Story = {
|
|
|
272
272
|
header: <SampleHeader />,
|
|
273
273
|
children: <SampleContent />,
|
|
274
274
|
footer: (
|
|
275
|
-
<RcSesCardFooter align='start'
|
|
275
|
+
<RcSesCardFooter align='start'>
|
|
276
276
|
<RcSesButton variant='link'>Peržiūrėti DUK</RcSesButton>
|
|
277
277
|
</RcSesCardFooter>
|
|
278
278
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta, StoryContext, StoryObj } from '@storybook/react-vite'
|
|
2
|
-
import { useForm } from 'react-hook-form'
|
|
2
|
+
import { useForm, useWatch } from 'react-hook-form'
|
|
3
3
|
|
|
4
4
|
import RcSesCheckboxFormControl from '@/components/form/inputs/CheckboxFormControl'
|
|
5
5
|
import RcSesFormControlLabel from '@/components/form/inputs/FormControlLabel'
|
|
@@ -46,7 +46,7 @@ const meta: Meta<typeof RcSesCheckboxFormControl> = {
|
|
|
46
46
|
tags: ['autodocs'],
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
interface FormModel {
|
|
50
50
|
agreement: string
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -178,7 +178,7 @@ export const Loading: Story = {
|
|
|
178
178
|
},
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
interface IndeterminateFormModel {
|
|
182
182
|
parent: boolean
|
|
183
183
|
child1: boolean
|
|
184
184
|
child2: boolean
|
|
@@ -186,7 +186,7 @@ type IndeterminateFormModel = {
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
function CheckboxIndeterminateDemo() {
|
|
189
|
-
const { control,
|
|
189
|
+
const { control, setValue } = useForm<IndeterminateFormModel>({
|
|
190
190
|
mode: 'all',
|
|
191
191
|
defaultValues: {
|
|
192
192
|
parent: false,
|
|
@@ -196,11 +196,7 @@ function CheckboxIndeterminateDemo() {
|
|
|
196
196
|
},
|
|
197
197
|
})
|
|
198
198
|
|
|
199
|
-
const
|
|
200
|
-
const child2Value = watch('child2')
|
|
201
|
-
const child3Value = watch('child3')
|
|
202
|
-
|
|
203
|
-
const childValues = [child1Value, child2Value, child3Value]
|
|
199
|
+
const childValues = useWatch({ control, name: ['child1', 'child2', 'child3'] })
|
|
204
200
|
|
|
205
201
|
const handleParentChange = (newChildValues: boolean[]) => {
|
|
206
202
|
setValue('child1', newChildValues[0])
|
|
@@ -232,7 +228,7 @@ function CheckboxIndeterminateDemo() {
|
|
|
232
228
|
<RcSesFormControlLabel
|
|
233
229
|
control={
|
|
234
230
|
<RcSesSimpleCheckbox
|
|
235
|
-
checked={
|
|
231
|
+
checked={childValues[0]}
|
|
236
232
|
onChange={(e) => setValue('child1', e.target.checked)}
|
|
237
233
|
/>
|
|
238
234
|
}
|
|
@@ -241,7 +237,7 @@ function CheckboxIndeterminateDemo() {
|
|
|
241
237
|
<RcSesFormControlLabel
|
|
242
238
|
control={
|
|
243
239
|
<RcSesSimpleCheckbox
|
|
244
|
-
checked={
|
|
240
|
+
checked={childValues[1]}
|
|
245
241
|
onChange={(e) => setValue('child2', e.target.checked)}
|
|
246
242
|
/>
|
|
247
243
|
}
|
|
@@ -250,7 +246,7 @@ function CheckboxIndeterminateDemo() {
|
|
|
250
246
|
<RcSesFormControlLabel
|
|
251
247
|
control={
|
|
252
248
|
<RcSesSimpleCheckbox
|
|
253
|
-
checked={
|
|
249
|
+
checked={childValues[2]}
|
|
254
250
|
onChange={(e) => setValue('child3', e.target.checked)}
|
|
255
251
|
/>
|
|
256
252
|
}
|
|
@@ -302,7 +298,7 @@ export const Indeterminate: Story = {
|
|
|
302
298
|
}
|
|
303
299
|
|
|
304
300
|
function CheckboxIndeterminateLoadingDemo() {
|
|
305
|
-
const { control,
|
|
301
|
+
const { control, setValue } = useForm<IndeterminateFormModel>({
|
|
306
302
|
mode: 'all',
|
|
307
303
|
defaultValues: {
|
|
308
304
|
parent: false,
|
|
@@ -312,11 +308,7 @@ function CheckboxIndeterminateLoadingDemo() {
|
|
|
312
308
|
},
|
|
313
309
|
})
|
|
314
310
|
|
|
315
|
-
const
|
|
316
|
-
const child2Value = watch('child2')
|
|
317
|
-
const child3Value = watch('child3')
|
|
318
|
-
|
|
319
|
-
const childValues = [child1Value, child2Value, child3Value]
|
|
311
|
+
const childValues = useWatch({ control, name: ['child1', 'child2', 'child3'] })
|
|
320
312
|
|
|
321
313
|
const handleParentChange = (newChildValues: boolean[]) => {
|
|
322
314
|
setValue('child1', newChildValues[0])
|
|
@@ -349,7 +341,7 @@ function CheckboxIndeterminateLoadingDemo() {
|
|
|
349
341
|
<RcSesFormControlLabel
|
|
350
342
|
control={
|
|
351
343
|
<RcSesSimpleCheckbox
|
|
352
|
-
checked={
|
|
344
|
+
checked={childValues[0]}
|
|
353
345
|
onChange={(e) => setValue('child1', e.target.checked)}
|
|
354
346
|
loading
|
|
355
347
|
/>
|
|
@@ -360,7 +352,7 @@ function CheckboxIndeterminateLoadingDemo() {
|
|
|
360
352
|
<RcSesFormControlLabel
|
|
361
353
|
control={
|
|
362
354
|
<RcSesSimpleCheckbox
|
|
363
|
-
checked={
|
|
355
|
+
checked={childValues[1]}
|
|
364
356
|
onChange={(e) => setValue('child2', e.target.checked)}
|
|
365
357
|
loading
|
|
366
358
|
/>
|
|
@@ -371,7 +363,7 @@ function CheckboxIndeterminateLoadingDemo() {
|
|
|
371
363
|
<RcSesFormControlLabel
|
|
372
364
|
control={
|
|
373
365
|
<RcSesSimpleCheckbox
|
|
374
|
-
checked={
|
|
366
|
+
checked={childValues[2]}
|
|
375
367
|
onChange={(e) => setValue('child3', e.target.checked)}
|
|
376
368
|
loading
|
|
377
369
|
/>
|
|
@@ -160,7 +160,7 @@ function SnackbarDemoCompactWithText() {
|
|
|
160
160
|
<Button
|
|
161
161
|
key={snackbarState}
|
|
162
162
|
variant='contained'
|
|
163
|
-
color={getButtonColor(snackbarState)
|
|
163
|
+
color={getButtonColor(snackbarState)}
|
|
164
164
|
startIcon={<Icon />}
|
|
165
165
|
onClick={() =>
|
|
166
166
|
showSnackbar({ state: snackbarState, message, size: 'compact' })
|
|
@@ -233,7 +233,7 @@ function SnackbarDemoStandardWithButtons() {
|
|
|
233
233
|
<Button
|
|
234
234
|
key={snackbarState}
|
|
235
235
|
variant='contained'
|
|
236
|
-
color={getButtonColor(snackbarState)
|
|
236
|
+
color={getButtonColor(snackbarState)}
|
|
237
237
|
startIcon={<Icon />}
|
|
238
238
|
onClick={() =>
|
|
239
239
|
showSnackbar({
|
|
@@ -30,7 +30,7 @@ export default meta
|
|
|
30
30
|
type Story = StoryObj<typeof RcSesTitleBlock>
|
|
31
31
|
|
|
32
32
|
const FooterLink = ({ label, href }: { label: string; href: string }) => (
|
|
33
|
-
<RcSesCardFooter align='start'
|
|
33
|
+
<RcSesCardFooter align='start'>
|
|
34
34
|
<RcSesButton
|
|
35
35
|
variant='link'
|
|
36
36
|
href={href}
|
|
@@ -221,6 +221,45 @@ export const RowListWithIcons: Story = {
|
|
|
221
221
|
},
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
+
export const RowListWithIconsAndLongText: Story = {
|
|
225
|
+
render: () => {
|
|
226
|
+
const rowAId = 'row-list-long-text-a'
|
|
227
|
+
const rowBId = 'row-list-long-text-b'
|
|
228
|
+
return (
|
|
229
|
+
<Stack divider={<Divider flexItem />} spacing={3}>
|
|
230
|
+
<RcSesTitleBlock
|
|
231
|
+
headingId={rowAId}
|
|
232
|
+
title='Santuoką liudijančio įrašo, patvirtinančio santuokos sudarymo faktą užsienio valstybėje, užsakymas su visomis papildomomis pastabomis'
|
|
233
|
+
description='Oficialus santuokos faktą patvirtinantis įrašas, apimantis visus civilinės metrikacijos duomenis, reikalingus tolimesnėms teisinėms procedūroms tiek Lietuvoje, tiek užsienyje. Įrašas gali būti pateikiamas įvairioms institucijoms ir naudojamas kaip oficialus patvirtinimas.'
|
|
234
|
+
titleTone='brand'
|
|
235
|
+
icon={<RcSesIconWithSquareBackground Icon={InfoIcon} variant='soft' />}
|
|
236
|
+
actions={
|
|
237
|
+
<RcSesButton
|
|
238
|
+
variant='link'
|
|
239
|
+
id={`${rowAId}-cta`}
|
|
240
|
+
aria-labelledby={`${rowAId}-cta ${rowAId}`}
|
|
241
|
+
>
|
|
242
|
+
Plačiau
|
|
243
|
+
</RcSesButton>
|
|
244
|
+
}
|
|
245
|
+
/>
|
|
246
|
+
<RcSesTitleBlock
|
|
247
|
+
headingId={rowBId}
|
|
248
|
+
title='Pažymos, patvirtinančios, kad nėra kliūčių Lietuvos Respublikos piliečiui sudaryti santuoką užsienio valstybėje, užsakymas'
|
|
249
|
+
description='Ši pažyma reikalinga tais atvejais, kai Lietuvos Respublikos pilietis planuoja sudaryti santuoką užsienio valstybėje ir vietos civilinės metrikacijos institucija reikalauja oficialaus patvirtinimo, kad asmens šeiminė padėtis Lietuvoje neturi kliūčių santuokos sudarymui.'
|
|
250
|
+
titleTone='brand'
|
|
251
|
+
icon={<RcSesIconWithSquareBackground Icon={InfoIcon} variant='soft' />}
|
|
252
|
+
actions={
|
|
253
|
+
<RcSesButton id={`${rowBId}-cta`} aria-labelledby={`${rowBId}-cta ${rowBId}`}>
|
|
254
|
+
Užsakyti
|
|
255
|
+
</RcSesButton>
|
|
256
|
+
}
|
|
257
|
+
/>
|
|
258
|
+
</Stack>
|
|
259
|
+
)
|
|
260
|
+
},
|
|
261
|
+
}
|
|
262
|
+
|
|
224
263
|
export const RowListWithIconsAndTwoActions: Story = {
|
|
225
264
|
render: () => {
|
|
226
265
|
const rowAId = 'row-list-two-actions-a'
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from '@mui/material'
|
|
14
14
|
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
15
15
|
import { useState } from 'react'
|
|
16
|
-
import { useForm } from 'react-hook-form'
|
|
16
|
+
import { useForm, useWatch } from 'react-hook-form'
|
|
17
17
|
|
|
18
18
|
import InfoFillIcon from '@/assets/icons/InfoFillIcon'
|
|
19
19
|
import NotePencilIcon from '@/assets/icons/NotePencilIcon'
|
|
@@ -196,7 +196,7 @@ export const OwnerTypeExpand: Story = {
|
|
|
196
196
|
render: () => <OwnerTypeExpandStory />,
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
|
|
199
|
+
interface OwnerBranchFormModel {
|
|
200
200
|
individual: { municipality: string | null }
|
|
201
201
|
legalEntity: { legalForm: string | null }
|
|
202
202
|
}
|
|
@@ -224,14 +224,14 @@ const RadioBranchFormStory = () => {
|
|
|
224
224
|
const [ownerTypeId, setOwnerTypeId] = useState(OWNER_TYPE_OPTIONS[0].id)
|
|
225
225
|
const [shouldUnregister, setShouldUnregister] = useState(true)
|
|
226
226
|
|
|
227
|
-
const { control
|
|
227
|
+
const { control } = useForm<OwnerBranchFormModel>({
|
|
228
228
|
defaultValues: {
|
|
229
229
|
individual: { municipality: null },
|
|
230
230
|
legalEntity: { legalForm: null },
|
|
231
231
|
},
|
|
232
232
|
})
|
|
233
233
|
|
|
234
|
-
const formState =
|
|
234
|
+
const formState = useWatch({ control })
|
|
235
235
|
|
|
236
236
|
// The non-selected branch stays in form state when shouldUnregister is off, so the
|
|
237
237
|
// submitted payload is built from the selected branch instead of the whole form.
|
|
@@ -7,7 +7,7 @@ import FieldView from '@/components/storybook/FieldView'
|
|
|
7
7
|
import Fields from '@/components/storybook/Fields'
|
|
8
8
|
import PreviewTitle from '@/components/storybook/PreviewTitle'
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
interface FormModel {
|
|
11
11
|
documents: File[]
|
|
12
12
|
documentsDisabled: File[]
|
|
13
13
|
documentsError: File[]
|
|
@@ -7,7 +7,7 @@ import FieldView from '@/components/storybook/FieldView'
|
|
|
7
7
|
import Fields from '@/components/storybook/Fields'
|
|
8
8
|
import PreviewTitle from '@/components/storybook/PreviewTitle'
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
interface FormModel {
|
|
11
11
|
uploadFile: string
|
|
12
12
|
uploadFile2: string
|
|
13
13
|
uploadFile3: string
|