@registrucentras/rc-ses-react-components 2.0.0-rc.2 → 2.0.0-rc.4
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/ArrowRightIcon.d.ts +1 -1
- package/dist/components/common/CardShell/CardFooter/index.d.ts +3 -0
- package/dist/components/common/CardShell/CardFooter/types.d.ts +21 -0
- package/dist/components/common/CardShell/index.d.ts +5 -0
- package/dist/components/common/CardShell/types.d.ts +26 -0
- package/dist/components/common/IconWithSquareBackground/index.d.ts +12 -0
- package/dist/components/common/ServiceLinks/ServiceLinkItem/index.d.ts +15 -0
- package/dist/components/common/ServiceLinks/index.d.ts +3 -0
- package/dist/components/common/ServiceLinks/types.d.ts +34 -0
- package/dist/components/common/SideNav/SideNav.types.d.ts +20 -0
- package/dist/components/common/SideNav/SideNavLayout.d.ts +4 -0
- package/dist/components/common/SideNav/components/SideNavPill.d.ts +9 -0
- package/dist/components/common/SideNav/components/SideNavPillList.d.ts +9 -0
- package/dist/components/common/SideNav/components/SideNavRow.d.ts +9 -0
- package/dist/components/common/SideNav/hooks/useSideNavScrollSpy.d.ts +12 -0
- package/dist/components/common/SideNav/index.d.ts +4 -0
- package/dist/components/common/TitleBlock/index.d.ts +3 -0
- package/dist/components/common/TitleBlock/types.d.ts +73 -0
- package/dist/components/utils/normalizeSx.d.ts +4 -0
- package/dist/library/index.d.ts +10 -1
- package/dist/library/types.d.ts +8 -1
- package/dist/registrucentras-rc-ses-react-components.cjs +1 -1
- package/dist/registrucentras-rc-ses-react-components.js +3535 -2563
- package/dist/stories/components/display/CardShell.stories.d.ts +17 -0
- package/dist/stories/components/display/SelectableCardList.stories.d.ts +1 -0
- package/dist/stories/components/display/ServiceLinks.stories.d.ts +28 -0
- package/dist/stories/components/display/TitleBlock.stories.d.ts +20 -0
- package/dist/stories/components/form/FormControlWrapper.stories.d.ts +1 -0
- package/dist/stories/components/icons/IconWithSquareBackground.stories.d.ts +7 -0
- package/dist/stories/components/inputs/DatePicker.stories.d.ts +107 -0
- package/dist/stories/components/navigation/SideNav.stories.d.ts +7 -0
- package/dist/theme/cards.d.ts +114 -0
- package/dist/theme/light/MuiPickersOutlinedInput.d.ts +8 -0
- package/package.json +1 -1
- package/src/assets/icons/ArrowRightIcon.tsx +2 -1
- package/src/components/common/AdvancedList/components/AdvancedListItem/index.tsx +8 -6
- package/src/components/common/Card/index.tsx +1 -23
- package/src/components/common/CardShell/CardFooter/index.test.tsx +52 -0
- package/src/components/common/CardShell/CardFooter/index.tsx +38 -0
- package/src/components/common/CardShell/CardFooter/types.ts +24 -0
- package/src/components/common/CardShell/index.test.tsx +137 -0
- package/src/components/common/CardShell/index.tsx +78 -0
- package/src/components/common/CardShell/types.ts +30 -0
- package/src/components/common/IconWithSquareBackground/index.test.tsx +55 -0
- package/src/components/common/IconWithSquareBackground/index.tsx +83 -0
- package/src/components/common/ServiceLinks/ServiceLinkItem/index.tsx +177 -0
- package/src/components/common/ServiceLinks/index.test.tsx +166 -0
- package/src/components/common/ServiceLinks/index.tsx +66 -0
- package/src/components/common/ServiceLinks/types.ts +37 -0
- package/src/components/common/SideNav/SideNav.types.ts +24 -0
- package/src/components/common/SideNav/SideNavLayout.test.tsx +113 -0
- package/src/components/common/SideNav/SideNavLayout.tsx +67 -0
- package/src/components/common/SideNav/components/SideNavPill.tsx +62 -0
- package/src/components/common/SideNav/components/SideNavPillList.tsx +190 -0
- package/src/components/common/SideNav/components/SideNavRow.tsx +72 -0
- package/src/components/common/SideNav/hooks/useSideNavScrollSpy.test.ts +457 -0
- package/src/components/common/SideNav/hooks/useSideNavScrollSpy.ts +154 -0
- package/src/components/common/SideNav/index.test.tsx +99 -0
- package/src/components/common/SideNav/index.tsx +83 -0
- package/src/components/common/TitleBlock/index.test.tsx +366 -0
- package/src/components/common/TitleBlock/index.tsx +144 -0
- package/src/components/common/TitleBlock/types.ts +82 -0
- package/src/components/form/inputs/Datepicker/index.test.tsx +117 -0
- package/src/components/utils/normalizeSx.ts +24 -0
- package/src/i18n/namespaces/common/en.json +4 -0
- package/src/i18n/namespaces/common/lt.json +4 -0
- package/src/library/index.ts +12 -0
- package/src/library/types.ts +38 -0
- package/src/stories/components/display/CardShell.stories.tsx +263 -0
- package/src/stories/components/display/SelectableCardList.stories.tsx +33 -1
- package/src/stories/components/display/ServiceLinks.stories.tsx +154 -0
- package/src/stories/components/display/TitleBlock.stories.tsx +506 -0
- package/src/stories/components/form/FormControlWrapper.stories.tsx +23 -0
- package/src/stories/components/icons/IconWithSquareBackground.stories.tsx +60 -0
- package/src/stories/components/inputs/DatePicker.stories.tsx +105 -9
- package/src/stories/components/navigation/SideNav.stories.tsx +110 -0
- package/src/theme/cards.ts +60 -0
- package/src/theme/light/MuiButton.tsx +6 -0
- package/src/theme/light/MuiPickersLayout.ts +10 -1
- package/src/theme/light/MuiPickersOutlinedInput.ts +88 -0
- package/src/theme/light/index.tsx +2 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { BriefcaseIcon } from '@phosphor-icons/react'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
3
|
+
|
|
4
|
+
import RcSesButton from '@/components/common/Button'
|
|
5
|
+
import RcSesCardShell from '@/components/common/CardShell'
|
|
6
|
+
import RcSesCardFooter from '@/components/common/CardShell/CardFooter'
|
|
7
|
+
import RcSesIconWithSquareBackground from '@/components/common/IconWithSquareBackground'
|
|
8
|
+
import RcSesServiceLinks from '@/components/common/ServiceLinks'
|
|
9
|
+
import {
|
|
10
|
+
RcSesServiceLinkItem,
|
|
11
|
+
RcSesServiceLinksProps,
|
|
12
|
+
} from '@/components/common/ServiceLinks/types'
|
|
13
|
+
import RcSesTitleBlock from '@/components/common/TitleBlock'
|
|
14
|
+
|
|
15
|
+
const baseItems: RcSesServiceLinkItem[] = [
|
|
16
|
+
{ label: 'Juridinių asmenų registro (JAR) išrašas', href: '#jar' },
|
|
17
|
+
{ label: 'Juridinio asmens steigimas', href: '#steigimas' },
|
|
18
|
+
{ label: 'Dalyvių sąrašo teikimas (JADIS)', href: '#jadis' },
|
|
19
|
+
{ label: 'Įmonių ir organizacijų dokumentų kopijos', href: '#kopijos' },
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
const meta: Meta<typeof RcSesServiceLinks> = {
|
|
23
|
+
title: 'components/display/ServiceLinks',
|
|
24
|
+
component: RcSesServiceLinks,
|
|
25
|
+
tags: ['autodocs'],
|
|
26
|
+
parameters: {
|
|
27
|
+
docs: {
|
|
28
|
+
description: {
|
|
29
|
+
component:
|
|
30
|
+
'ServiceLinks is a standalone, vertical list of navigational service links, each row pairing a label with a trailing arrow. It carries no card shell of its own and is intended to be placed inside a CardShell content, could be together with a CardHeader and CardFooter.',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
viewport: {
|
|
34
|
+
options: {
|
|
35
|
+
mobile375: { name: 'Mobile 375', styles: { height: '900px', width: '375px' } },
|
|
36
|
+
tablet768: { name: 'Tablet 768', styles: { height: '900px', width: '768px' } },
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
argTypes: {
|
|
41
|
+
items: { control: false },
|
|
42
|
+
dividers: { control: 'boolean' },
|
|
43
|
+
isLoading: { control: 'boolean' },
|
|
44
|
+
skeletonCount: { control: 'number' },
|
|
45
|
+
linkComponent: { control: false },
|
|
46
|
+
testIds: { control: false },
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default meta
|
|
51
|
+
|
|
52
|
+
type Story = StoryObj<typeof RcSesServiceLinks>
|
|
53
|
+
|
|
54
|
+
export const Default: Story = {
|
|
55
|
+
args: {
|
|
56
|
+
items: baseItems,
|
|
57
|
+
dividers: true,
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const WithoutDividers: Story = {
|
|
62
|
+
args: {
|
|
63
|
+
items: baseItems,
|
|
64
|
+
dividers: false,
|
|
65
|
+
},
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const WithDisabledItem: Story = {
|
|
69
|
+
args: {
|
|
70
|
+
items: [...baseItems.slice(0, 3), { label: 'Netrukus (neaktyvus)', disabled: true }],
|
|
71
|
+
dividers: true,
|
|
72
|
+
},
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const Loading: Story = {
|
|
76
|
+
args: {
|
|
77
|
+
items: [],
|
|
78
|
+
isLoading: true,
|
|
79
|
+
skeletonCount: 4,
|
|
80
|
+
},
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Items with `target='_blank'` open in a new tab. The shell automatically
|
|
85
|
+
* adds `rel='noopener noreferrer'` on those rows for safety; other rows get
|
|
86
|
+
* no `rel` attribute.
|
|
87
|
+
*/
|
|
88
|
+
export const ExternalLinks: Story = {
|
|
89
|
+
args: {
|
|
90
|
+
items: [
|
|
91
|
+
{ label: 'Vidinė nuoroda', href: '#internal' },
|
|
92
|
+
{
|
|
93
|
+
label: 'Išorinė nuoroda (naujame lange)',
|
|
94
|
+
href: 'https://example.com',
|
|
95
|
+
target: '_blank',
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
dividers: true,
|
|
99
|
+
},
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Passing a `linkComponent` renders every navigable row through it. The shell
|
|
104
|
+
* forwards `href`, `onClick`, and (when the item sets `target='_blank'`) also
|
|
105
|
+
* `target` and `rel='noopener noreferrer'`. Adapt a router `Link` with a
|
|
106
|
+
* one-line wrapper — as long as it renders a real `<a>` underneath,
|
|
107
|
+
* middle-click and "open in new tab" keep working.
|
|
108
|
+
*/
|
|
109
|
+
export const WithRouterLink: Story = {
|
|
110
|
+
args: {
|
|
111
|
+
items: baseItems,
|
|
112
|
+
dividers: true,
|
|
113
|
+
linkComponent: ({ href, children, ...rest }: React.ComponentProps<'a'>) => (
|
|
114
|
+
// Stand-in for a router `Link`; a real adapter would forward `href`
|
|
115
|
+
// as `to`, e.g. `<RouterLink to={href!} {...rest}>{children}</RouterLink>`.
|
|
116
|
+
<a href={href} {...rest} data-router-link>
|
|
117
|
+
{children}
|
|
118
|
+
</a>
|
|
119
|
+
),
|
|
120
|
+
},
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The intended composition: ServiceLinks placed inside a CardShell as the
|
|
125
|
+
* content slot, framed by a CardHeader and a CardFooter.
|
|
126
|
+
*/
|
|
127
|
+
export const InsideCardShell: Story = {
|
|
128
|
+
render: (args: RcSesServiceLinksProps) => (
|
|
129
|
+
<RcSesCardShell
|
|
130
|
+
theme='brand'
|
|
131
|
+
borderless
|
|
132
|
+
header={
|
|
133
|
+
<RcSesTitleBlock
|
|
134
|
+
icon={<RcSesIconWithSquareBackground Icon={BriefcaseIcon} variant='solid' />}
|
|
135
|
+
title='Įmonėms ir organizacijoms'
|
|
136
|
+
titleVariant='h5'
|
|
137
|
+
/>
|
|
138
|
+
}
|
|
139
|
+
footer={
|
|
140
|
+
<RcSesCardFooter align='start'>
|
|
141
|
+
<RcSesButton variant='contained' color='primary'>
|
|
142
|
+
Žiūrėti visas
|
|
143
|
+
</RcSesButton>
|
|
144
|
+
</RcSesCardFooter>
|
|
145
|
+
}
|
|
146
|
+
>
|
|
147
|
+
<RcSesServiceLinks {...args} />
|
|
148
|
+
</RcSesCardShell>
|
|
149
|
+
),
|
|
150
|
+
args: {
|
|
151
|
+
items: baseItems,
|
|
152
|
+
dividers: true,
|
|
153
|
+
},
|
|
154
|
+
}
|
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
import { Box, ButtonBase, Divider, Stack } from '@mui/material'
|
|
2
|
+
import { InfoIcon, PhoneCallIcon } from '@phosphor-icons/react'
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
4
|
+
|
|
5
|
+
import ArrowRightIcon from '@/assets/icons/ArrowRightIcon'
|
|
6
|
+
import CalendarBlankIcon from '@/assets/icons/CalendarBlankIcon'
|
|
7
|
+
import RcSesButton from '@/components/common/Button'
|
|
8
|
+
import RcSesCardShell from '@/components/common/CardShell'
|
|
9
|
+
import RcSesCardFooter from '@/components/common/CardShell/CardFooter'
|
|
10
|
+
import RcSesIconWithSquareBackground from '@/components/common/IconWithSquareBackground'
|
|
11
|
+
import RcSesTitleBlock from '@/components/common/TitleBlock'
|
|
12
|
+
import palette from '@/theme/palette'
|
|
13
|
+
|
|
14
|
+
const meta: Meta<typeof RcSesTitleBlock> = {
|
|
15
|
+
title: 'components/display/TitleBlock',
|
|
16
|
+
component: RcSesTitleBlock,
|
|
17
|
+
tags: ['autodocs'],
|
|
18
|
+
parameters: {
|
|
19
|
+
docs: {
|
|
20
|
+
description: {
|
|
21
|
+
component:
|
|
22
|
+
'TitleBlock lays out an optional icon, a title, an optional description and up to two trailing actions. It is the primitive that can be dropped into any row that needs a titled unit (card headers, list items, section rows, modal headers).',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default meta
|
|
29
|
+
|
|
30
|
+
type Story = StoryObj<typeof RcSesTitleBlock>
|
|
31
|
+
|
|
32
|
+
const FooterLink = ({ label, href }: { label: string; href: string }) => (
|
|
33
|
+
<RcSesCardFooter align='start' stretchOnMobile={false}>
|
|
34
|
+
<RcSesButton
|
|
35
|
+
variant='link'
|
|
36
|
+
href={href}
|
|
37
|
+
endIcon={<ArrowRightIcon fillColor={palette.primary[600]} size={20} />}
|
|
38
|
+
>
|
|
39
|
+
{label}
|
|
40
|
+
</RcSesButton>
|
|
41
|
+
</RcSesCardFooter>
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
// Decorative chevron sitting on the right edge of horizontal tile rows.
|
|
45
|
+
// aria-hidden because the row is announced by the heading (and, when the
|
|
46
|
+
// whole row is clickable, by the wrapping ButtonBase's accessible name).
|
|
47
|
+
const TrailingArrow = () => (
|
|
48
|
+
<Box
|
|
49
|
+
aria-hidden
|
|
50
|
+
sx={{
|
|
51
|
+
alignItems: 'center',
|
|
52
|
+
alignSelf: 'stretch',
|
|
53
|
+
color: palette.primary[600],
|
|
54
|
+
display: 'flex',
|
|
55
|
+
flexShrink: 0,
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
<ArrowRightIcon fillColor={palette.primary[600]} size={20} />
|
|
59
|
+
</Box>
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
export const TitleBlock: Story = {
|
|
63
|
+
render: () => (
|
|
64
|
+
<RcSesTitleBlock
|
|
65
|
+
title='Pažymos santuokai sudaryti užsienyje užsakymas'
|
|
66
|
+
description='Pažyma, kad nėra kliūčių sudaryti santuoką užsienio valstybėje.'
|
|
67
|
+
titleTone='brand'
|
|
68
|
+
/>
|
|
69
|
+
),
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const WithPrimaryAction: Story = {
|
|
73
|
+
render: () => {
|
|
74
|
+
const headingId = 'title-block-with-primary-action'
|
|
75
|
+
return (
|
|
76
|
+
<RcSesTitleBlock
|
|
77
|
+
headingId={headingId}
|
|
78
|
+
title='Pažymos santuokai sudaryti užsienyje užsakymas'
|
|
79
|
+
description='Pažyma, kad nėra kliūčių sudaryti santuoką užsienio valstybėje.'
|
|
80
|
+
titleTone='brand'
|
|
81
|
+
actions={
|
|
82
|
+
<RcSesButton
|
|
83
|
+
id={`${headingId}-cta`}
|
|
84
|
+
aria-labelledby={`${headingId}-cta ${headingId}`}
|
|
85
|
+
>
|
|
86
|
+
Užsakyti
|
|
87
|
+
</RcSesButton>
|
|
88
|
+
}
|
|
89
|
+
/>
|
|
90
|
+
)
|
|
91
|
+
},
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const WithLinkAction: Story = {
|
|
95
|
+
render: () => {
|
|
96
|
+
const headingId = 'title-block-with-link-action'
|
|
97
|
+
return (
|
|
98
|
+
<RcSesTitleBlock
|
|
99
|
+
headingId={headingId}
|
|
100
|
+
title='Santuoką liudijančio įrašo užsakymas'
|
|
101
|
+
description='Oficialus santuokos faktą patvirtinantis įrašas.'
|
|
102
|
+
titleTone='brand'
|
|
103
|
+
actions={
|
|
104
|
+
<RcSesButton
|
|
105
|
+
variant='link'
|
|
106
|
+
id={`${headingId}-cta`}
|
|
107
|
+
aria-labelledby={`${headingId}-cta ${headingId}`}
|
|
108
|
+
>
|
|
109
|
+
Plačiau
|
|
110
|
+
</RcSesButton>
|
|
111
|
+
}
|
|
112
|
+
/>
|
|
113
|
+
)
|
|
114
|
+
},
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const WithPrimaryAndSecondaryActions: Story = {
|
|
118
|
+
render: () => {
|
|
119
|
+
const headingId = 'title-block-with-primary-and-secondary'
|
|
120
|
+
return (
|
|
121
|
+
<RcSesTitleBlock
|
|
122
|
+
headingId={headingId}
|
|
123
|
+
title='Pažymos santuokai sudaryti užsienyje užsakymas'
|
|
124
|
+
description='Pažyma, kad nėra kliūčių sudaryti santuoką užsienio valstybėje.'
|
|
125
|
+
titleTone='brand'
|
|
126
|
+
actions={
|
|
127
|
+
<>
|
|
128
|
+
<RcSesButton
|
|
129
|
+
id={`${headingId}-order`}
|
|
130
|
+
aria-labelledby={`${headingId}-order ${headingId}`}
|
|
131
|
+
>
|
|
132
|
+
Užsakyti
|
|
133
|
+
</RcSesButton>
|
|
134
|
+
<RcSesButton
|
|
135
|
+
variant='link'
|
|
136
|
+
id={`${headingId}-more`}
|
|
137
|
+
aria-labelledby={`${headingId}-more ${headingId}`}
|
|
138
|
+
>
|
|
139
|
+
Plačiau
|
|
140
|
+
</RcSesButton>
|
|
141
|
+
</>
|
|
142
|
+
}
|
|
143
|
+
/>
|
|
144
|
+
)
|
|
145
|
+
},
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export const RowList: Story = {
|
|
149
|
+
render: () => {
|
|
150
|
+
const rowAId = 'row-list-a'
|
|
151
|
+
const rowBId = 'row-list-b'
|
|
152
|
+
return (
|
|
153
|
+
<Stack divider={<Divider flexItem />} spacing={3}>
|
|
154
|
+
<RcSesTitleBlock
|
|
155
|
+
headingId={rowAId}
|
|
156
|
+
title='Santuoką liudijančio įrašo užsakymas'
|
|
157
|
+
description='Oficialus santuokos faktą patvirtinantis įrašas.'
|
|
158
|
+
titleTone='brand'
|
|
159
|
+
actions={
|
|
160
|
+
<RcSesButton
|
|
161
|
+
variant='link'
|
|
162
|
+
id={`${rowAId}-cta`}
|
|
163
|
+
aria-labelledby={`${rowAId}-cta ${rowAId}`}
|
|
164
|
+
>
|
|
165
|
+
Plačiau
|
|
166
|
+
</RcSesButton>
|
|
167
|
+
}
|
|
168
|
+
/>
|
|
169
|
+
<RcSesTitleBlock
|
|
170
|
+
headingId={rowBId}
|
|
171
|
+
title='Pažymos santuokai sudaryti užsienyje užsakymas'
|
|
172
|
+
description='Pažyma, kad nėra kliūčių sudaryti santuoką užsienio valstybėje.'
|
|
173
|
+
titleTone='brand'
|
|
174
|
+
actions={
|
|
175
|
+
<RcSesButton id={`${rowBId}-cta`} aria-labelledby={`${rowBId}-cta ${rowBId}`}>
|
|
176
|
+
Užsakyti
|
|
177
|
+
</RcSesButton>
|
|
178
|
+
}
|
|
179
|
+
/>
|
|
180
|
+
</Stack>
|
|
181
|
+
)
|
|
182
|
+
},
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export const RowListWithIcons: Story = {
|
|
186
|
+
render: () => {
|
|
187
|
+
const rowAId = 'row-list-with-icons-a'
|
|
188
|
+
const rowBId = 'row-list-with-icons-b'
|
|
189
|
+
return (
|
|
190
|
+
<Stack divider={<Divider flexItem />} spacing={3}>
|
|
191
|
+
<RcSesTitleBlock
|
|
192
|
+
headingId={rowAId}
|
|
193
|
+
title='Santuoką liudijančio įrašo užsakymas'
|
|
194
|
+
description='Oficialus santuokos faktą patvirtinantis įrašas.'
|
|
195
|
+
titleTone='brand'
|
|
196
|
+
icon={<RcSesIconWithSquareBackground Icon={InfoIcon} variant='soft' />}
|
|
197
|
+
actions={
|
|
198
|
+
<RcSesButton
|
|
199
|
+
variant='link'
|
|
200
|
+
id={`${rowAId}-cta`}
|
|
201
|
+
aria-labelledby={`${rowAId}-cta ${rowAId}`}
|
|
202
|
+
>
|
|
203
|
+
Plačiau
|
|
204
|
+
</RcSesButton>
|
|
205
|
+
}
|
|
206
|
+
/>
|
|
207
|
+
<RcSesTitleBlock
|
|
208
|
+
headingId={rowBId}
|
|
209
|
+
title='Pažymos santuokai sudaryti užsienyje užsakymas'
|
|
210
|
+
description='Pažyma, kad nėra kliūčių sudaryti santuoką užsienio valstybėje.'
|
|
211
|
+
titleTone='brand'
|
|
212
|
+
icon={<RcSesIconWithSquareBackground Icon={InfoIcon} variant='soft' />}
|
|
213
|
+
actions={
|
|
214
|
+
<RcSesButton id={`${rowBId}-cta`} aria-labelledby={`${rowBId}-cta ${rowBId}`}>
|
|
215
|
+
Užsakyti
|
|
216
|
+
</RcSesButton>
|
|
217
|
+
}
|
|
218
|
+
/>
|
|
219
|
+
</Stack>
|
|
220
|
+
)
|
|
221
|
+
},
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export const RowListWithIconsAndTwoActions: Story = {
|
|
225
|
+
render: () => {
|
|
226
|
+
const rowAId = 'row-list-two-actions-a'
|
|
227
|
+
const rowBId = 'row-list-two-actions-b'
|
|
228
|
+
return (
|
|
229
|
+
<Stack divider={<Divider flexItem />} spacing={3}>
|
|
230
|
+
<RcSesTitleBlock
|
|
231
|
+
headingId={rowAId}
|
|
232
|
+
title='Santuoką liudijančio įrašo užsakymas'
|
|
233
|
+
description='Oficialus santuokos faktą patvirtinantis įrašas.'
|
|
234
|
+
titleTone='brand'
|
|
235
|
+
icon={<RcSesIconWithSquareBackground Icon={InfoIcon} variant='soft' />}
|
|
236
|
+
actions={
|
|
237
|
+
<>
|
|
238
|
+
<RcSesButton
|
|
239
|
+
id={`${rowAId}-order`}
|
|
240
|
+
aria-labelledby={`${rowAId}-order ${rowAId}`}
|
|
241
|
+
>
|
|
242
|
+
Užsakyti
|
|
243
|
+
</RcSesButton>
|
|
244
|
+
<RcSesButton
|
|
245
|
+
variant='link'
|
|
246
|
+
id={`${rowAId}-more`}
|
|
247
|
+
aria-labelledby={`${rowAId}-more ${rowAId}`}
|
|
248
|
+
>
|
|
249
|
+
Plačiau
|
|
250
|
+
</RcSesButton>
|
|
251
|
+
</>
|
|
252
|
+
}
|
|
253
|
+
/>
|
|
254
|
+
<RcSesTitleBlock
|
|
255
|
+
headingId={rowBId}
|
|
256
|
+
title='Pažymos santuokai sudaryti užsienyje užsakymas'
|
|
257
|
+
description='Pažyma, kad nėra kliūčių sudaryti santuoką užsienio valstybėje.'
|
|
258
|
+
titleTone='brand'
|
|
259
|
+
icon={<RcSesIconWithSquareBackground Icon={InfoIcon} variant='soft' />}
|
|
260
|
+
actions={
|
|
261
|
+
<>
|
|
262
|
+
<RcSesButton
|
|
263
|
+
id={`${rowBId}-order`}
|
|
264
|
+
aria-labelledby={`${rowBId}-order ${rowBId}`}
|
|
265
|
+
>
|
|
266
|
+
Užsakyti
|
|
267
|
+
</RcSesButton>
|
|
268
|
+
<RcSesButton
|
|
269
|
+
variant='link'
|
|
270
|
+
id={`${rowBId}-more`}
|
|
271
|
+
aria-labelledby={`${rowBId}-more ${rowBId}`}
|
|
272
|
+
>
|
|
273
|
+
Plačiau
|
|
274
|
+
</RcSesButton>
|
|
275
|
+
</>
|
|
276
|
+
}
|
|
277
|
+
/>
|
|
278
|
+
</Stack>
|
|
279
|
+
)
|
|
280
|
+
},
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export const HorizontalTitleBlockWithIconAndArrow: Story = {
|
|
284
|
+
render: () => (
|
|
285
|
+
<Stack direction='row' spacing={2} sx={{ alignItems: 'center', width: '100%' }}>
|
|
286
|
+
<Box sx={{ alignSelf: 'center', flex: 1, minWidth: 0 }}>
|
|
287
|
+
<RcSesTitleBlock
|
|
288
|
+
title='Paslaugos pavadinimas'
|
|
289
|
+
description='Trumpas paslaugos paaiškinimas'
|
|
290
|
+
titleTone='brand'
|
|
291
|
+
icon={<RcSesIconWithSquareBackground Icon={InfoIcon} variant='soft' />}
|
|
292
|
+
/>
|
|
293
|
+
</Box>
|
|
294
|
+
<TrailingArrow />
|
|
295
|
+
</Stack>
|
|
296
|
+
),
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export const HorizontalTitleBlockWithArrowAndBrandCardShellTheme: Story = {
|
|
300
|
+
render: () => (
|
|
301
|
+
<RcSesCardShell variant='card' theme='brand'>
|
|
302
|
+
<Stack direction='row' spacing={2} sx={{ alignItems: 'center', width: '100%' }}>
|
|
303
|
+
<Box sx={{ alignSelf: 'center', flex: 1, minWidth: 0 }}>
|
|
304
|
+
<RcSesTitleBlock
|
|
305
|
+
title='Paslaugos pavadinimas'
|
|
306
|
+
description='Trumpas paslaugos paaiškinimas'
|
|
307
|
+
titleTone='brand'
|
|
308
|
+
/>
|
|
309
|
+
</Box>
|
|
310
|
+
<TrailingArrow />
|
|
311
|
+
</Stack>
|
|
312
|
+
</RcSesCardShell>
|
|
313
|
+
),
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
export const HorizontalTitleBlockWithArrowAndSunkenCardShellTheme: Story = {
|
|
317
|
+
render: () => (
|
|
318
|
+
<RcSesCardShell variant='card' theme='sunken'>
|
|
319
|
+
<Stack direction='row' spacing={2} sx={{ alignItems: 'center', width: '100%' }}>
|
|
320
|
+
<Box sx={{ alignSelf: 'center', flex: 1, minWidth: 0 }}>
|
|
321
|
+
<RcSesTitleBlock
|
|
322
|
+
title='Paslaugos pavadinimas'
|
|
323
|
+
description='Trumpas paslaugos paaiškinimas'
|
|
324
|
+
titleTone='brand'
|
|
325
|
+
/>
|
|
326
|
+
</Box>
|
|
327
|
+
<TrailingArrow />
|
|
328
|
+
</Stack>
|
|
329
|
+
</RcSesCardShell>
|
|
330
|
+
),
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
export const ClickableHorizontalTitleBlockWithCardShellBase: Story = {
|
|
334
|
+
render: () => (
|
|
335
|
+
<RcSesCardShell variant='card' theme='default'>
|
|
336
|
+
<ButtonBase
|
|
337
|
+
component='a'
|
|
338
|
+
href='#'
|
|
339
|
+
sx={{
|
|
340
|
+
borderRadius: 'inherit',
|
|
341
|
+
display: 'block',
|
|
342
|
+
textAlign: 'left',
|
|
343
|
+
width: '100%',
|
|
344
|
+
}}
|
|
345
|
+
>
|
|
346
|
+
<Stack direction='row' spacing={2} sx={{ alignItems: 'center', width: '100%' }}>
|
|
347
|
+
<Box sx={{ alignSelf: 'center', flex: 1, minWidth: 0 }}>
|
|
348
|
+
<RcSesTitleBlock
|
|
349
|
+
title='Paslaugos sutartiniams klientams'
|
|
350
|
+
description='Peržiūrėkite pagrindinius duomenis be užsakymo - dažniausias pirmas žingsnis.'
|
|
351
|
+
icon={<RcSesIconWithSquareBackground Icon={InfoIcon} variant='soft' />}
|
|
352
|
+
/>
|
|
353
|
+
</Box>
|
|
354
|
+
<TrailingArrow />
|
|
355
|
+
</Stack>
|
|
356
|
+
</ButtonBase>
|
|
357
|
+
</RcSesCardShell>
|
|
358
|
+
),
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export const VerticalTitleBlockWithCardShellBase: Story = {
|
|
362
|
+
render: () => (
|
|
363
|
+
<RcSesCardShell
|
|
364
|
+
variant='card'
|
|
365
|
+
theme='default'
|
|
366
|
+
footer={<FooterLink label='Peržiūrėti DUK' href='#' />}
|
|
367
|
+
>
|
|
368
|
+
<RcSesTitleBlock
|
|
369
|
+
orientation='vertical'
|
|
370
|
+
title='DUK'
|
|
371
|
+
description='Atsakymai į dažniausiai užduodamus klausimus apie paslaugas ir savitarną.'
|
|
372
|
+
icon={<RcSesIconWithSquareBackground Icon={InfoIcon} variant='soft' />}
|
|
373
|
+
/>
|
|
374
|
+
</RcSesCardShell>
|
|
375
|
+
),
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export const VerticalTitleBlock: Story = {
|
|
379
|
+
render: () => (
|
|
380
|
+
<Box
|
|
381
|
+
sx={{
|
|
382
|
+
display: 'grid',
|
|
383
|
+
gap: 2,
|
|
384
|
+
gridTemplateColumns: { xs: '1fr', md: 'repeat(3, 1fr)' },
|
|
385
|
+
}}
|
|
386
|
+
>
|
|
387
|
+
<RcSesCardShell
|
|
388
|
+
variant='card'
|
|
389
|
+
theme='default'
|
|
390
|
+
fullHeight
|
|
391
|
+
footer={<FooterLink label='Peržiūrėti DUK' href='#' />}
|
|
392
|
+
>
|
|
393
|
+
<RcSesTitleBlock
|
|
394
|
+
orientation='vertical'
|
|
395
|
+
title='DUK'
|
|
396
|
+
description='Atsakymai į dažniausiai užduodamus klausimus apie paslaugas ir savitarną.'
|
|
397
|
+
icon={<RcSesIconWithSquareBackground Icon={InfoIcon} variant='soft' />}
|
|
398
|
+
/>
|
|
399
|
+
</RcSesCardShell>
|
|
400
|
+
<RcSesCardShell
|
|
401
|
+
variant='card'
|
|
402
|
+
theme='default'
|
|
403
|
+
fullHeight
|
|
404
|
+
footer={<FooterLink label='Visi kontaktai' href='#' />}
|
|
405
|
+
>
|
|
406
|
+
<RcSesTitleBlock
|
|
407
|
+
orientation='vertical'
|
|
408
|
+
title='Kontaktai'
|
|
409
|
+
description='Konsultacijos telefonu (0 5) 268 8262 darbo dienomis 8:00-17:00.'
|
|
410
|
+
icon={<RcSesIconWithSquareBackground Icon={PhoneCallIcon} variant='soft' />}
|
|
411
|
+
/>
|
|
412
|
+
</RcSesCardShell>
|
|
413
|
+
<RcSesCardShell
|
|
414
|
+
variant='card'
|
|
415
|
+
theme='default'
|
|
416
|
+
fullHeight
|
|
417
|
+
footer={<FooterLink label='Pradėkite registraciją' href='#' />}
|
|
418
|
+
>
|
|
419
|
+
<RcSesTitleBlock
|
|
420
|
+
orientation='vertical'
|
|
421
|
+
title='Registracija vizitui'
|
|
422
|
+
description='Užduokite klausimą konsultantui pokalbių lange - atsakome darbo metu.'
|
|
423
|
+
icon={<RcSesIconWithSquareBackground Icon={CalendarBlankIcon} variant='soft' />}
|
|
424
|
+
/>
|
|
425
|
+
</RcSesCardShell>
|
|
426
|
+
</Box>
|
|
427
|
+
),
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// Responsive baselines for SAV-6509 / SAV-6480 DoD ("Responsive patikra 375 /
|
|
431
|
+
// 768 / 1440"). Exercises the mobile stacking of the actions slot
|
|
432
|
+
// (direction={{ xs: 'column', sm: 'row' }}) so both the two-action and
|
|
433
|
+
// vertical-grid layouts get pinned baselines at 375 and 768.
|
|
434
|
+
|
|
435
|
+
const responsiveRowAId = 'responsive-row-a'
|
|
436
|
+
const responsiveRowBId = 'responsive-row-b'
|
|
437
|
+
|
|
438
|
+
const ResponsiveTwoActionsRowList = () => (
|
|
439
|
+
<Stack divider={<Divider flexItem />} spacing={3}>
|
|
440
|
+
<RcSesTitleBlock
|
|
441
|
+
headingId={responsiveRowAId}
|
|
442
|
+
title='Santuoką liudijančio įrašo užsakymas'
|
|
443
|
+
description='Oficialus santuokos faktą patvirtinantis įrašas.'
|
|
444
|
+
titleTone='brand'
|
|
445
|
+
icon={<RcSesIconWithSquareBackground Icon={InfoIcon} variant='soft' />}
|
|
446
|
+
actions={
|
|
447
|
+
<>
|
|
448
|
+
<RcSesButton
|
|
449
|
+
id={`${responsiveRowAId}-order`}
|
|
450
|
+
aria-labelledby={`${responsiveRowAId}-order ${responsiveRowAId}`}
|
|
451
|
+
>
|
|
452
|
+
Užsakyti
|
|
453
|
+
</RcSesButton>
|
|
454
|
+
<RcSesButton
|
|
455
|
+
variant='link'
|
|
456
|
+
id={`${responsiveRowAId}-more`}
|
|
457
|
+
aria-labelledby={`${responsiveRowAId}-more ${responsiveRowAId}`}
|
|
458
|
+
>
|
|
459
|
+
Plačiau
|
|
460
|
+
</RcSesButton>
|
|
461
|
+
</>
|
|
462
|
+
}
|
|
463
|
+
/>
|
|
464
|
+
<RcSesTitleBlock
|
|
465
|
+
headingId={responsiveRowBId}
|
|
466
|
+
title='Pažymos santuokai sudaryti užsienyje užsakymas'
|
|
467
|
+
description='Pažyma, kad nėra kliūčių sudaryti santuoką užsienio valstybėje.'
|
|
468
|
+
titleTone='brand'
|
|
469
|
+
icon={<RcSesIconWithSquareBackground Icon={InfoIcon} variant='soft' />}
|
|
470
|
+
actions={
|
|
471
|
+
<>
|
|
472
|
+
<RcSesButton
|
|
473
|
+
id={`${responsiveRowBId}-order`}
|
|
474
|
+
aria-labelledby={`${responsiveRowBId}-order ${responsiveRowBId}`}
|
|
475
|
+
>
|
|
476
|
+
Užsakyti
|
|
477
|
+
</RcSesButton>
|
|
478
|
+
<RcSesButton
|
|
479
|
+
variant='link'
|
|
480
|
+
id={`${responsiveRowBId}-more`}
|
|
481
|
+
aria-labelledby={`${responsiveRowBId}-more ${responsiveRowBId}`}
|
|
482
|
+
>
|
|
483
|
+
Plačiau
|
|
484
|
+
</RcSesButton>
|
|
485
|
+
</>
|
|
486
|
+
}
|
|
487
|
+
/>
|
|
488
|
+
</Stack>
|
|
489
|
+
)
|
|
490
|
+
|
|
491
|
+
export const MobileViewport: Story = {
|
|
492
|
+
render: () => <ResponsiveTwoActionsRowList />,
|
|
493
|
+
// Two separate mechanisms, deliberately: the tag sets Playwright's browser
|
|
494
|
+
// width for the baseline, the global sets the canvas iframe width for anyone
|
|
495
|
+
// reviewing in Storybook. Docs pages render stories inline at the container's
|
|
496
|
+
// width, where neither applies, so this one is kept out of the docs page
|
|
497
|
+
// rather than showing a desktop row list under a mobile heading.
|
|
498
|
+
tags: ['viewport-375', '!autodocs'],
|
|
499
|
+
globals: { viewport: { value: 'mobile375' } },
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
export const TabletViewport: Story = {
|
|
503
|
+
render: () => <ResponsiveTwoActionsRowList />,
|
|
504
|
+
tags: ['viewport-768', '!autodocs'],
|
|
505
|
+
globals: { viewport: { value: 'tablet768' } },
|
|
506
|
+
}
|
|
@@ -33,3 +33,26 @@ export const Default: Story = {
|
|
|
33
33
|
</RcSesFormControlWrapper>
|
|
34
34
|
),
|
|
35
35
|
}
|
|
36
|
+
|
|
37
|
+
export const WithError: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
label: 'Label',
|
|
40
|
+
hideLabel: false,
|
|
41
|
+
labelOnTop: false,
|
|
42
|
+
required: true,
|
|
43
|
+
errors: { type: 'required', message: 'This field is required' },
|
|
44
|
+
},
|
|
45
|
+
render: (args) => (
|
|
46
|
+
<RcSesFormControlWrapper {...args}>
|
|
47
|
+
<TextField id='input' placeholder='Type text here' size='small' fullWidth error />
|
|
48
|
+
</RcSesFormControlWrapper>
|
|
49
|
+
),
|
|
50
|
+
parameters: {
|
|
51
|
+
docs: {
|
|
52
|
+
description: {
|
|
53
|
+
story:
|
|
54
|
+
'Pass the react-hook-form `fieldState.error` as `errors` and the message renders below the field, leaving the field itself untouched. This is the validation pattern for any wrapped control, including ones that are not inputs - see `SelectableCardList` → `ValidationError`. When `errors.type` is `required` and no `message` is set, a translated fallback is shown instead.',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
}
|