@registrucentras/rc-ses-react-components 2.0.0-rc.9 → 2.1.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/README.md +4 -0
- package/dist/assets/icons/ShoppingCartIcon.d.ts +3 -0
- package/dist/components/common/CardShell/index.d.ts +1 -1
- package/dist/components/common/CardShell/types.d.ts +10 -0
- package/dist/components/common/ListWithIcons/ListWithIcons.types.d.ts +4 -1
- package/dist/components/common/StepCard/StepCardFooter/index.d.ts +34 -0
- package/dist/components/common/StepCard/index.d.ts +3 -0
- package/dist/components/common/StepCard/types.d.ts +39 -0
- package/dist/components/common/TitleBlock/types.d.ts +1 -1
- package/dist/components/layout/ServiceFormContainer/CardFormContainer/index.d.ts +3 -0
- package/dist/components/loaders/LoadingSpinner/index.d.ts +1 -4
- package/dist/library/icons.d.ts +2 -1
- package/dist/library/index.d.ts +2 -1
- package/dist/library/types.d.ts +4 -3
- package/dist/registrucentras-rc-ses-react-components.cjs +1 -1
- package/dist/registrucentras-rc-ses-react-components.js +2091 -1888
- package/dist/theme/cards.d.ts +12 -12
- package/dist/theme/light/MuiTypography.d.ts +14 -0
- package/dist/theme/palette.d.ts +124 -124
- package/dist/theme/spacing.d.ts +4 -0
- package/package.json +2 -1
- package/src/assets/icons/ShoppingCartIcon.tsx +16 -0
- package/src/components/common/Button/index.test.tsx +20 -11
- package/src/components/common/Button/index.tsx +8 -44
- package/src/components/common/CardShell/index.tsx +6 -2
- package/src/components/common/CardShell/types.ts +10 -0
- package/src/components/common/ListWithIcons/ListWithIcons.types.ts +22 -1
- package/src/components/common/ListWithIcons/components/ListWithIconsItem.tsx +13 -4
- package/src/components/common/ListWithIcons/index.test.tsx +42 -0
- package/src/components/common/StepCard/StepCardFooter/index.test.tsx +162 -0
- package/src/components/common/StepCard/StepCardFooter/index.tsx +120 -0
- package/src/components/common/StepCard/index.test.tsx +120 -0
- package/src/components/common/StepCard/index.tsx +74 -0
- package/src/components/common/StepCard/types.ts +45 -0
- package/src/components/common/TitleBlock/types.ts +1 -1
- package/src/components/form/inputs/SearchableField.test.tsx +1 -1
- package/src/components/layout/ServiceFormContainer/CardFormContainer/index.tsx +3 -0
- package/src/components/loaders/LoadingSpinner/index.tsx +3 -26
- package/src/examples/ListWithPagination/index.tsx +2 -1
- package/src/i18n/namespaces/common/en.json +7 -0
- package/src/i18n/namespaces/common/lt.json +7 -0
- package/src/library/icons.ts +2 -0
- package/src/library/index.ts +2 -0
- package/src/library/types.ts +17 -2
- package/src/stories/atoms/Button.stories.tsx +202 -497
- package/src/stories/foundations/ThemedMuiComponents.stories.tsx +2 -2
- package/src/stories/molecules/CardShell.stories.tsx +36 -2
- package/src/stories/molecules/DatePicker.stories.tsx +1 -2
- package/src/stories/molecules/ListWithIcons.stories.tsx +26 -0
- package/src/stories/molecules/Popover.stories.tsx +1 -1
- package/src/stories/molecules/StepCard.stories.tsx +181 -0
- package/src/stories/molecules/TitleBlock.stories.tsx +2 -2
- package/src/stories/organisms/AdvancedListItem.stories.tsx +80 -0
- package/src/stories/organisms/CardFormContainer.stories.tsx +1 -1
- package/src/stories/organisms/Dialog.stories.tsx +1 -2
- package/src/theme/light/MuiButton.tsx +54 -0
- package/src/theme/light/MuiCard.tsx +9 -7
- package/src/theme/light/MuiTypography.tsx +17 -0
- package/src/theme/palette.tsx +7 -7
- package/src/theme/spacing.ts +5 -0
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* Coverage stories for theme slots no other story puts on the page
|
|
21
|
-
*
|
|
20
|
+
* Coverage stories for theme slots no other story puts on the page.
|
|
21
|
+
* `visual/theme-slots.spec.ts` fails if one is missing.
|
|
22
22
|
*
|
|
23
23
|
* Two reasons a slot ends up here:
|
|
24
24
|
*
|
|
@@ -31,6 +31,8 @@ const meta: Meta<typeof RcSesCardShell> = {
|
|
|
31
31
|
'theme',
|
|
32
32
|
'fullHeight',
|
|
33
33
|
'borderless',
|
|
34
|
+
'contentGap',
|
|
35
|
+
'footerGap',
|
|
34
36
|
'header',
|
|
35
37
|
'children',
|
|
36
38
|
'footer',
|
|
@@ -57,6 +59,14 @@ const meta: Meta<typeof RcSesCardShell> = {
|
|
|
57
59
|
control: 'boolean',
|
|
58
60
|
description: 'Renders the shell without any border',
|
|
59
61
|
},
|
|
62
|
+
contentGap: {
|
|
63
|
+
control: 'text',
|
|
64
|
+
description: "Overrides the variant preset's header-to-content gap (e.g. '1.5rem')",
|
|
65
|
+
},
|
|
66
|
+
footerGap: {
|
|
67
|
+
control: 'text',
|
|
68
|
+
description: "Overrides the variant preset's content-to-footer gap (e.g. '1.5rem')",
|
|
69
|
+
},
|
|
60
70
|
header: {
|
|
61
71
|
control: false,
|
|
62
72
|
description: 'Header content (ReactNode)',
|
|
@@ -91,6 +101,10 @@ const SampleContent = () => (
|
|
|
91
101
|
<Box
|
|
92
102
|
sx={{
|
|
93
103
|
alignItems: 'center',
|
|
104
|
+
backgroundColor: 'grey.100',
|
|
105
|
+
borderRadius: 1,
|
|
106
|
+
border: '1px dashed',
|
|
107
|
+
borderColor: 'grey.300',
|
|
94
108
|
color: 'text.primary',
|
|
95
109
|
display: 'flex',
|
|
96
110
|
justifyContent: 'center',
|
|
@@ -218,8 +232,28 @@ export const FullHeight: Story = {
|
|
|
218
232
|
fullHeight: true,
|
|
219
233
|
header: <SampleHeader />,
|
|
220
234
|
children: (
|
|
221
|
-
<Box
|
|
222
|
-
|
|
235
|
+
<Box
|
|
236
|
+
sx={{
|
|
237
|
+
alignItems: 'center',
|
|
238
|
+
backgroundColor: 'grey.100',
|
|
239
|
+
border: '1px dashed',
|
|
240
|
+
borderColor: 'grey.300',
|
|
241
|
+
borderRadius: 1,
|
|
242
|
+
display: 'flex',
|
|
243
|
+
flexDirection: 'column',
|
|
244
|
+
gap: 1,
|
|
245
|
+
height: '100%',
|
|
246
|
+
justifyContent: 'center',
|
|
247
|
+
px: 3,
|
|
248
|
+
}}
|
|
249
|
+
>
|
|
250
|
+
<Typography align='center' variant='h6'>
|
|
251
|
+
Pilno aukščio turinys
|
|
252
|
+
</Typography>
|
|
253
|
+
<Typography align='center' variant='body2' sx={{ color: 'text.secondary' }}>
|
|
254
|
+
Šis blokas užpildo visą turimą aukštį tarp antraštės ir poraštės, nepriklausomai
|
|
255
|
+
nuo turinio kiekio.
|
|
256
|
+
</Typography>
|
|
223
257
|
</Box>
|
|
224
258
|
),
|
|
225
259
|
footer: <SampleFooter />,
|
|
@@ -115,8 +115,7 @@ export const Main = {
|
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
117
|
* The calendar popup carries the `MuiPickersLayout` theme overrides, and it only
|
|
118
|
-
* mounts once the picker is opened - so nothing covered them until this story
|
|
119
|
-
* (SAV-5648 / LIB-02).
|
|
118
|
+
* mounts once the picker is opened - so nothing covered them until this story.
|
|
120
119
|
*/
|
|
121
120
|
export const CalendarOpen = {
|
|
122
121
|
render: (args: any) => <DatePickerDemo {...args} />,
|
|
@@ -4,6 +4,7 @@ import CheckCircleFillIcon from '@/assets/icons/CheckCircleFillIcon'
|
|
|
4
4
|
import WarningFillIcon from '@/assets/icons/WarningFillIcon'
|
|
5
5
|
import ListWithIcons from '@/components/common/ListWithIcons'
|
|
6
6
|
import { type ListWithIconsItemData } from '@/components/common/ListWithIcons/ListWithIcons.types'
|
|
7
|
+
import { secondary } from '@/theme/palette'
|
|
7
8
|
|
|
8
9
|
const baseItems: ListWithIconsItemData[] = [
|
|
9
10
|
{
|
|
@@ -68,3 +69,28 @@ export const Loading: Story = {
|
|
|
68
69
|
isLoading: true,
|
|
69
70
|
},
|
|
70
71
|
}
|
|
72
|
+
|
|
73
|
+
const toneItems: ListWithIconsItemData[] = [
|
|
74
|
+
{ text: 'Default', textColor: 'default' },
|
|
75
|
+
{ text: 'Secondary', textColor: 'secondary' },
|
|
76
|
+
{ text: 'Muted', textColor: 'muted' },
|
|
77
|
+
{ text: 'Link', textColor: 'link' },
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
export const TextTones: Story = {
|
|
81
|
+
name: 'Text tones (DS "Text" tokens)',
|
|
82
|
+
args: {
|
|
83
|
+
items: toneItems,
|
|
84
|
+
},
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const customColorItems: ListWithIconsItemData[] = [
|
|
88
|
+
{ text: 'Custom palette color', textColor: secondary['700'] },
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
export const CustomColor: Story = {
|
|
92
|
+
name: 'Custom color (palette variant instead of a named tone)',
|
|
93
|
+
args: {
|
|
94
|
+
items: customColorItems,
|
|
95
|
+
},
|
|
96
|
+
}
|
|
@@ -6,7 +6,7 @@ import RcSesPopover from '@/components/common/Popover'
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* `RcSesButtonWithPopover` owns the popover's open state internally and starts
|
|
9
|
-
* closed, so `MuiPopover` never reached a visual baseline
|
|
9
|
+
* closed, so `MuiPopover` never reached a visual baseline.
|
|
10
10
|
* These stories render the popover itself, already open against a fixed anchor.
|
|
11
11
|
*/
|
|
12
12
|
const meta: Meta<typeof RcSesPopover> = {
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { Box, Button, Typography } from '@mui/material'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
3
|
+
import { ComponentProps, useState } from 'react'
|
|
4
|
+
|
|
5
|
+
import RcSesCardFooter from '@/components/common/CardShell/CardFooter'
|
|
6
|
+
import RcSesStepCard from '@/components/common/StepCard'
|
|
7
|
+
import FieldView from '@/components/storybook/FieldView'
|
|
8
|
+
import Fields from '@/components/storybook/Fields'
|
|
9
|
+
|
|
10
|
+
const STEP_COUNT = 3
|
|
11
|
+
|
|
12
|
+
const meta: Meta<typeof RcSesStepCard> = {
|
|
13
|
+
title: 'Molecules/StepCard',
|
|
14
|
+
component: RcSesStepCard,
|
|
15
|
+
tags: ['autodocs'],
|
|
16
|
+
parameters: {
|
|
17
|
+
viewport: {
|
|
18
|
+
options: {
|
|
19
|
+
mobile375: { name: 'Mobile 375', styles: { height: '900px', width: '375px' } },
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
args: {
|
|
24
|
+
title: 'Antraštės tekstas',
|
|
25
|
+
description: 'Papildomas aprašymo tekstas',
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default meta
|
|
30
|
+
|
|
31
|
+
const DemoContent = () => (
|
|
32
|
+
<Box
|
|
33
|
+
sx={{
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
backgroundColor: 'grey.100',
|
|
36
|
+
border: '1px dashed',
|
|
37
|
+
borderColor: 'grey.300',
|
|
38
|
+
borderRadius: 1,
|
|
39
|
+
display: 'flex',
|
|
40
|
+
height: 140,
|
|
41
|
+
justifyContent: 'center',
|
|
42
|
+
width: '100%',
|
|
43
|
+
}}
|
|
44
|
+
>
|
|
45
|
+
<Typography variant='body2'>Turinys (Body slot)</Typography>
|
|
46
|
+
</Box>
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
type Story = StoryObj<typeof RcSesStepCard>
|
|
50
|
+
|
|
51
|
+
type StepCardDemoProps = Omit<
|
|
52
|
+
ComponentProps<typeof RcSesStepCard>,
|
|
53
|
+
'activeStep' | 'stepCount' | 'onNext' | 'onBack' | 'onCancel'
|
|
54
|
+
>
|
|
55
|
+
|
|
56
|
+
function StepCardDemo(args: StepCardDemoProps) {
|
|
57
|
+
const [activeStep, setActiveStep] = useState(0)
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<Fields>
|
|
61
|
+
<FieldView>
|
|
62
|
+
<RcSesStepCard
|
|
63
|
+
{...args}
|
|
64
|
+
activeStep={activeStep}
|
|
65
|
+
stepCount={STEP_COUNT}
|
|
66
|
+
onNext={() => setActiveStep((prev) => Math.min(prev + 1, STEP_COUNT - 1))}
|
|
67
|
+
onBack={() => setActiveStep((prev) => Math.max(prev - 1, 0))}
|
|
68
|
+
onCancel={() => setActiveStep(0)}
|
|
69
|
+
>
|
|
70
|
+
<DemoContent />
|
|
71
|
+
</RcSesStepCard>
|
|
72
|
+
</FieldView>
|
|
73
|
+
</Fields>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Interactive wizard: walks through Atšaukti/Tęsti → Atgal/Tęsti → Atgal/Į krepšelį. */
|
|
78
|
+
export const Default: Story = {
|
|
79
|
+
render: (args) => <StepCardDemo {...args} />,
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** First step → footer shows `Atšaukti` + `Tęsti`. */
|
|
83
|
+
export const FirstStep: Story = {
|
|
84
|
+
render: (args) => (
|
|
85
|
+
<Fields>
|
|
86
|
+
<FieldView>
|
|
87
|
+
<RcSesStepCard {...args} activeStep={0} stepCount={STEP_COUNT}>
|
|
88
|
+
<DemoContent />
|
|
89
|
+
</RcSesStepCard>
|
|
90
|
+
</FieldView>
|
|
91
|
+
</Fields>
|
|
92
|
+
),
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** Middle step → footer shows `Atgal` + `Tęsti`. */
|
|
96
|
+
export const MiddleStep: Story = {
|
|
97
|
+
render: (args) => (
|
|
98
|
+
<Fields>
|
|
99
|
+
<FieldView>
|
|
100
|
+
<RcSesStepCard {...args} activeStep={1} stepCount={STEP_COUNT}>
|
|
101
|
+
<DemoContent />
|
|
102
|
+
</RcSesStepCard>
|
|
103
|
+
</FieldView>
|
|
104
|
+
</Fields>
|
|
105
|
+
),
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** Last step → footer shows `Atgal` + `Suma be PVM` total + `Pridėti į krepšelį`. */
|
|
109
|
+
export const LastStep: Story = {
|
|
110
|
+
render: (args) => (
|
|
111
|
+
<Fields>
|
|
112
|
+
<FieldView>
|
|
113
|
+
<RcSesStepCard
|
|
114
|
+
{...args}
|
|
115
|
+
activeStep={STEP_COUNT - 1}
|
|
116
|
+
stepCount={STEP_COUNT}
|
|
117
|
+
totalPrice='4,01 €'
|
|
118
|
+
>
|
|
119
|
+
<DemoContent />
|
|
120
|
+
</RcSesStepCard>
|
|
121
|
+
</FieldView>
|
|
122
|
+
</Fields>
|
|
123
|
+
),
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Custom footer → the `footer` prop replaces the default step-position row
|
|
128
|
+
* entirely. Use when a step needs bespoke actions.
|
|
129
|
+
*/
|
|
130
|
+
export const CustomFooter: Story = {
|
|
131
|
+
render: (args) => (
|
|
132
|
+
<Fields>
|
|
133
|
+
<FieldView>
|
|
134
|
+
<RcSesStepCard
|
|
135
|
+
{...args}
|
|
136
|
+
activeStep={1}
|
|
137
|
+
stepCount={STEP_COUNT}
|
|
138
|
+
footer={
|
|
139
|
+
<RcSesCardFooter align='between'>
|
|
140
|
+
<Button variant='contained' color='grey'>
|
|
141
|
+
Išsaugoti juodraštį
|
|
142
|
+
</Button>
|
|
143
|
+
<Button variant='contained'>Pateikti peržiūrai</Button>
|
|
144
|
+
</RcSesCardFooter>
|
|
145
|
+
}
|
|
146
|
+
>
|
|
147
|
+
<DemoContent />
|
|
148
|
+
</RcSesStepCard>
|
|
149
|
+
</FieldView>
|
|
150
|
+
</Fields>
|
|
151
|
+
),
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Last-step footer pinned at a 375px viewport - the trailing CTA + price
|
|
156
|
+
* summary stack above the leading button and the price row goes inline, per
|
|
157
|
+
* the mobile Figma spec.
|
|
158
|
+
*/
|
|
159
|
+
export const MobileViewport: Story = {
|
|
160
|
+
render: (args) => (
|
|
161
|
+
<Fields>
|
|
162
|
+
<FieldView>
|
|
163
|
+
<RcSesStepCard
|
|
164
|
+
{...args}
|
|
165
|
+
activeStep={STEP_COUNT - 1}
|
|
166
|
+
stepCount={STEP_COUNT}
|
|
167
|
+
totalPrice='4,01 €'
|
|
168
|
+
>
|
|
169
|
+
<DemoContent />
|
|
170
|
+
</RcSesStepCard>
|
|
171
|
+
</FieldView>
|
|
172
|
+
</Fields>
|
|
173
|
+
),
|
|
174
|
+
// Two separate mechanisms, deliberately: the tag sets Playwright's browser
|
|
175
|
+
// width for the visual baseline, the global sets the canvas iframe width for
|
|
176
|
+
// anyone reviewing in Storybook. Docs pages render stories inline at the
|
|
177
|
+
// container's width, where neither applies, so this one is kept out of the
|
|
178
|
+
// docs page rather than showing a desktop card under a mobile heading.
|
|
179
|
+
tags: ['viewport-375', '!autodocs'],
|
|
180
|
+
globals: { viewport: { value: 'mobile375' } },
|
|
181
|
+
}
|
|
@@ -533,8 +533,8 @@ export const BodyScaleTitleInCard: Story = {
|
|
|
533
533
|
},
|
|
534
534
|
}
|
|
535
535
|
|
|
536
|
-
// Responsive baselines for
|
|
537
|
-
//
|
|
536
|
+
// Responsive baselines for the 375 / 768 / 1440 responsive check. Exercises
|
|
537
|
+
// the mobile stacking of the actions slot
|
|
538
538
|
// (direction={{ xs: 'column', sm: 'row' }}) so both the two-action and
|
|
539
539
|
// vertical-grid layouts get pinned baselines at 375 and 768.
|
|
540
540
|
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
RadioGroup,
|
|
8
8
|
Stack,
|
|
9
9
|
TextField,
|
|
10
|
+
Typography,
|
|
10
11
|
} from '@mui/material'
|
|
11
12
|
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
12
13
|
import { useState } from 'react'
|
|
@@ -15,6 +16,7 @@ import NotePencilIcon from '@/assets/icons/NotePencilIcon'
|
|
|
15
16
|
import TrashIcon from '@/assets/icons/TrashIcon'
|
|
16
17
|
import UserIcon from '@/assets/icons/UserIcon'
|
|
17
18
|
import AdvancedListItem from '@/components/common/AdvancedList/components/AdvancedListItem'
|
|
19
|
+
import { secondary } from '@/theme/palette'
|
|
18
20
|
|
|
19
21
|
const meta = {
|
|
20
22
|
title: 'Organisms/AdvancedListItem',
|
|
@@ -651,3 +653,81 @@ export const KrepselisWithDeletePreset: Story = {
|
|
|
651
653
|
name: 'Preset: Krepšelis (su trynimu)',
|
|
652
654
|
render: () => <KrepselisWithDeleteStory />,
|
|
653
655
|
}
|
|
656
|
+
|
|
657
|
+
export const MetaInfoTones: Story = {
|
|
658
|
+
name: 'Meta info: textColor tokens (default/secondary/muted/disabled/link/linkHover)',
|
|
659
|
+
render: () => (
|
|
660
|
+
<Stack
|
|
661
|
+
sx={{
|
|
662
|
+
gap: 2,
|
|
663
|
+
width: '100%',
|
|
664
|
+
maxWidth: '32rem',
|
|
665
|
+
}}
|
|
666
|
+
>
|
|
667
|
+
<Stack sx={{ gap: 0.5 }}>
|
|
668
|
+
<Typography variant='caption' sx={{ color: 'text.secondary' }}>
|
|
669
|
+
textColor: default
|
|
670
|
+
</Typography>
|
|
671
|
+
<AdvancedListItem
|
|
672
|
+
title='Prašymas pateiktas'
|
|
673
|
+
subtitle='Reg. Nr. 4400-1234-5678'
|
|
674
|
+
metaItems={[{ text: 'Sukurta 2026-01-05', textColor: 'default' }]}
|
|
675
|
+
/>
|
|
676
|
+
</Stack>
|
|
677
|
+
<Stack sx={{ gap: 0.5 }}>
|
|
678
|
+
<Typography variant='caption' sx={{ color: 'text.secondary' }}>
|
|
679
|
+
textColor: secondary
|
|
680
|
+
</Typography>
|
|
681
|
+
<AdvancedListItem
|
|
682
|
+
title='Papildoma informacija'
|
|
683
|
+
subtitle='Reg. Nr. 4400-1234-5678'
|
|
684
|
+
metaItems={[{ text: 'Antrinis tekstas', textColor: 'secondary' }]}
|
|
685
|
+
/>
|
|
686
|
+
</Stack>
|
|
687
|
+
<Stack sx={{ gap: 0.5 }}>
|
|
688
|
+
<Typography variant='caption' sx={{ color: 'text.secondary' }}>
|
|
689
|
+
textColor: muted
|
|
690
|
+
</Typography>
|
|
691
|
+
<AdvancedListItem
|
|
692
|
+
title='Archyvuotas įrašas'
|
|
693
|
+
subtitle='Reg. Nr. 4400-1234-5678'
|
|
694
|
+
metaItems={[{ text: 'Nebeaktualu', textColor: 'muted' }]}
|
|
695
|
+
/>
|
|
696
|
+
</Stack>
|
|
697
|
+
<Stack sx={{ gap: 0.5 }}>
|
|
698
|
+
<Typography variant='caption' sx={{ color: 'text.secondary' }}>
|
|
699
|
+
textColor: link
|
|
700
|
+
</Typography>
|
|
701
|
+
<AdvancedListItem
|
|
702
|
+
title='Nuoroda'
|
|
703
|
+
subtitle='Reg. Nr. 4400-1234-5678'
|
|
704
|
+
metaItems={[{ text: 'Peržiūrėti dokumentą', textColor: 'link' }]}
|
|
705
|
+
/>
|
|
706
|
+
</Stack>
|
|
707
|
+
<Stack sx={{ gap: 0.5 }}>
|
|
708
|
+
<Typography variant='caption' sx={{ color: 'text.secondary' }}>
|
|
709
|
+
textColor: default + secondary + link (multiple meta items in one row)
|
|
710
|
+
</Typography>
|
|
711
|
+
<AdvancedListItem
|
|
712
|
+
title='Keli meta elementai vienoje eilutėje'
|
|
713
|
+
subtitle='Reg. Nr. 4400-1234-5678'
|
|
714
|
+
metaItems={[
|
|
715
|
+
{ text: 'Sukurta 2026-01-05', textColor: 'default' },
|
|
716
|
+
{ text: 'Antrinis tekstas', textColor: 'secondary' },
|
|
717
|
+
{ text: 'Peržiūrėti dokumentą', textColor: 'link' },
|
|
718
|
+
]}
|
|
719
|
+
/>
|
|
720
|
+
</Stack>
|
|
721
|
+
<Stack sx={{ gap: 0.5 }}>
|
|
722
|
+
<Typography variant='caption' sx={{ color: 'text.secondary' }}>
|
|
723
|
+
textColor: custom color from the palette
|
|
724
|
+
</Typography>
|
|
725
|
+
<AdvancedListItem
|
|
726
|
+
title='JADIS pažymėjimas'
|
|
727
|
+
subtitle='Reg. Nr. 4400-1234-5678'
|
|
728
|
+
metaItems={[{ text: 'Peržiūrėti dokumentą', textColor: secondary['700'] }]}
|
|
729
|
+
/>
|
|
730
|
+
</Stack>
|
|
731
|
+
</Stack>
|
|
732
|
+
),
|
|
733
|
+
}
|
|
@@ -24,7 +24,7 @@ const longSteps: StepItem[] = [
|
|
|
24
24
|
const meta: Meta<typeof RcSesCardFormContainer> = {
|
|
25
25
|
title: 'Organisms/CardFormContainer',
|
|
26
26
|
component: RcSesCardFormContainer,
|
|
27
|
-
tags: ['autodocs'],
|
|
27
|
+
tags: ['autodocs', 'deprecated'],
|
|
28
28
|
argTypes: {
|
|
29
29
|
steps: { table: { disable: true } },
|
|
30
30
|
onStepClick: { table: { disable: true } },
|
|
@@ -104,8 +104,7 @@ export function BasicDialog() {
|
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
106
|
* Every other story here starts closed behind a trigger button, so the dialog
|
|
107
|
-
* itself never reached a visual baseline
|
|
108
|
-
* it open.
|
|
107
|
+
* itself never reached a visual baseline. This one renders it open.
|
|
109
108
|
*/
|
|
110
109
|
export const Open: Story = {
|
|
111
110
|
render: (args) => (
|
|
@@ -94,6 +94,20 @@ const MuiButton: Components['MuiButton'] = {
|
|
|
94
94
|
'.MuiButton-endIcon': {
|
|
95
95
|
marginLeft: '.25rem',
|
|
96
96
|
},
|
|
97
|
+
|
|
98
|
+
// MUI absolutely positions the start/end loading indicator at
|
|
99
|
+
// `left/right: 14px` to sit inside the root's default horizontal
|
|
100
|
+
// padding. Link variant has zero horizontal padding, so 14px lands
|
|
101
|
+
// on top of the label. Reserve room on the loading side and pin the
|
|
102
|
+
// indicator to the edge so spinner and label sit side by side.
|
|
103
|
+
'&.MuiButton-loadingPositionStart.MuiButton-loading': {
|
|
104
|
+
paddingLeft: '1.5rem',
|
|
105
|
+
'.MuiButton-loadingIndicatorStart': { left: 0 },
|
|
106
|
+
},
|
|
107
|
+
'&.MuiButton-loadingPositionEnd.MuiButton-loading': {
|
|
108
|
+
paddingRight: '1.5rem',
|
|
109
|
+
'.MuiButton-loadingIndicatorEnd': { right: 0 },
|
|
110
|
+
},
|
|
97
111
|
},
|
|
98
112
|
},
|
|
99
113
|
{
|
|
@@ -147,6 +161,22 @@ const MuiButton: Components['MuiButton'] = {
|
|
|
147
161
|
position: 'relative',
|
|
148
162
|
textTransform: 'none',
|
|
149
163
|
|
|
164
|
+
// MUI hard-codes the centered loading indicator to
|
|
165
|
+
// `palette.action.disabled` (rgba(0,0,0,0.26)) which fails WCAG 1.4.11
|
|
166
|
+
// on every light-surface variant (~1.85:1). Override to grey[600] here —
|
|
167
|
+
// (0,3,0) specificity beats MUI's single-class rule, while the more
|
|
168
|
+
// specific colorLight / colorGhost blocks below still win on dark
|
|
169
|
+
// surfaces. The `.Mui-disabled` half is dropped: `loadingPositionCenter`
|
|
170
|
+
// is only applied while `loading` is truthy.
|
|
171
|
+
'&.MuiButton-loadingPositionCenter.MuiButton-loading': {
|
|
172
|
+
color: 'transparent !important',
|
|
173
|
+
'& .MuiButton-startIcon, & .MuiButton-endIcon': {
|
|
174
|
+
visibility: 'hidden',
|
|
175
|
+
},
|
|
176
|
+
'& .MuiButton-loadingIndicator': {
|
|
177
|
+
color: grey[600],
|
|
178
|
+
},
|
|
179
|
+
},
|
|
150
180
|
'&.MuiButton-contained:focus-visible:not(:active)::before, &.MuiButton-outlined:focus-visible:not(:active)::before':
|
|
151
181
|
{
|
|
152
182
|
background: 'transparent',
|
|
@@ -378,6 +408,14 @@ const MuiButton: Components['MuiButton'] = {
|
|
|
378
408
|
'&.Mui-disabled': {
|
|
379
409
|
borderColor: `${grey[500]} !important`,
|
|
380
410
|
color: `${grey[500]} !important`,
|
|
411
|
+
// Same reasoning as ghost - MUI hard-codes the loading indicator to
|
|
412
|
+
// `palette.action.disabled` which is invisible on dark surfaces.
|
|
413
|
+
'& .MuiButton-loadingIndicator': {
|
|
414
|
+
color: grey[500],
|
|
415
|
+
},
|
|
416
|
+
'&.MuiButton-loadingPositionCenter': {
|
|
417
|
+
color: 'transparent !important',
|
|
418
|
+
},
|
|
381
419
|
},
|
|
382
420
|
},
|
|
383
421
|
|
|
@@ -394,6 +432,22 @@ const MuiButton: Components['MuiButton'] = {
|
|
|
394
432
|
},
|
|
395
433
|
'&.Mui-disabled': {
|
|
396
434
|
borderColor: `transparent !important`,
|
|
435
|
+
// Ghost buttons live on dark surfaces; the root outlined
|
|
436
|
+
// `.Mui-disabled` rule paints text `grey[600]`, which disappears on
|
|
437
|
+
// a near-black background. Keep the light color and, importantly,
|
|
438
|
+
// override MUI's `.MuiButton-loadingIndicator { color: action.disabled }`
|
|
439
|
+
// (dark grey ~ #0000000042) so the spinner stays visible while loading.
|
|
440
|
+
color: `${grey[300]} !important`,
|
|
441
|
+
'& .MuiButton-loadingIndicator': {
|
|
442
|
+
color: grey[300],
|
|
443
|
+
},
|
|
444
|
+
// The root `.MuiButton-loadingPositionCenter` transparent rule loses
|
|
445
|
+
// the specificity fight against the color override above (nested
|
|
446
|
+
// inside `.MuiButton-colorGhost`), so re-apply it here to hide the
|
|
447
|
+
// label/icon while the centered spinner shows.
|
|
448
|
+
'&.MuiButton-loadingPositionCenter': {
|
|
449
|
+
color: 'transparent !important',
|
|
450
|
+
},
|
|
397
451
|
},
|
|
398
452
|
},
|
|
399
453
|
},
|
|
@@ -10,16 +10,18 @@ const MuiCard: Components['MuiCard'] = {
|
|
|
10
10
|
styleOverrides: {
|
|
11
11
|
root: {
|
|
12
12
|
borderRadius: '1rem',
|
|
13
|
+
// Paint the default outlined border on the root instead of a
|
|
14
|
+
// `variants[{ variant: 'outlined' }]` entry. `styleOverrides` deep-
|
|
15
|
+
// merges when a consumer calls `createTheme(RcSesTheme, {...})`, but
|
|
16
|
+
// arrays like `variants` are replaced wholesale - so a consumer theme
|
|
17
|
+
// that declares its own MuiCard variants would otherwise strip our
|
|
18
|
+
// outlined-border rule and leave every card borderless.
|
|
19
|
+
borderWidth: 1,
|
|
20
|
+
borderStyle: 'solid',
|
|
21
|
+
borderColor: Colors.grey['300'],
|
|
13
22
|
},
|
|
14
23
|
},
|
|
15
24
|
variants: [
|
|
16
|
-
{
|
|
17
|
-
props: { variant: 'outlined' },
|
|
18
|
-
style: {
|
|
19
|
-
border: '1px solid',
|
|
20
|
-
borderColor: Colors.grey['300'],
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
25
|
{
|
|
24
26
|
props: { variant: 'elevation' },
|
|
25
27
|
style: {
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import { Components } from '@mui/material'
|
|
2
2
|
|
|
3
|
+
import palette from '@/theme/palette'
|
|
4
|
+
|
|
5
|
+
export const typography = {
|
|
6
|
+
bodyRegularMuted: {
|
|
7
|
+
color: palette.grey[500],
|
|
8
|
+
fontSize: '0.9375rem',
|
|
9
|
+
fontWeight: 400,
|
|
10
|
+
lineHeight: '1.375rem',
|
|
11
|
+
},
|
|
12
|
+
priceEmphasis: {
|
|
13
|
+
color: palette.grey[900],
|
|
14
|
+
fontSize: '1.125rem',
|
|
15
|
+
fontWeight: 500,
|
|
16
|
+
lineHeight: '1.5rem',
|
|
17
|
+
},
|
|
18
|
+
}
|
|
19
|
+
|
|
3
20
|
const MuiTypography: Components['MuiTypography'] = {
|
|
4
21
|
styleOverrides: {
|
|
5
22
|
root: {},
|
package/src/theme/palette.tsx
CHANGED
|
@@ -11,7 +11,7 @@ const primary = {
|
|
|
11
11
|
'900': '#164763',
|
|
12
12
|
'950': '#082d44',
|
|
13
13
|
main: '#06a0d4',
|
|
14
|
-
}
|
|
14
|
+
} as const
|
|
15
15
|
|
|
16
16
|
const secondary = {
|
|
17
17
|
'50': '#ecfdf6',
|
|
@@ -26,7 +26,7 @@ const secondary = {
|
|
|
26
26
|
'900': '#004e3d',
|
|
27
27
|
'950': '#002c24',
|
|
28
28
|
main: '#00c288',
|
|
29
|
-
}
|
|
29
|
+
} as const
|
|
30
30
|
|
|
31
31
|
const grey = {
|
|
32
32
|
'50': '#f9fafb',
|
|
@@ -41,7 +41,7 @@ const grey = {
|
|
|
41
41
|
'900': '#1f2733',
|
|
42
42
|
'950': '#10161f',
|
|
43
43
|
main: '#8e959e',
|
|
44
|
-
}
|
|
44
|
+
} as const
|
|
45
45
|
|
|
46
46
|
const warning = {
|
|
47
47
|
'50': '#fef9ef',
|
|
@@ -56,7 +56,7 @@ const warning = {
|
|
|
56
56
|
'900': '#4a3504',
|
|
57
57
|
'950': '#312303',
|
|
58
58
|
main: '#f9b311',
|
|
59
|
-
}
|
|
59
|
+
} as const
|
|
60
60
|
|
|
61
61
|
const error = {
|
|
62
62
|
'50': '#fef4f2',
|
|
@@ -71,17 +71,17 @@ const error = {
|
|
|
71
71
|
'900': '#4a1a14',
|
|
72
72
|
'950': '#31110d',
|
|
73
73
|
main: '#fa5a46',
|
|
74
|
-
}
|
|
74
|
+
} as const
|
|
75
75
|
|
|
76
76
|
const overlays = {
|
|
77
77
|
'200': '#ffffff14',
|
|
78
78
|
'300': '#ffffff29',
|
|
79
79
|
main: '#ffffff14',
|
|
80
|
-
}
|
|
80
|
+
} as const
|
|
81
81
|
|
|
82
82
|
const common = {
|
|
83
83
|
white: '#ffffff',
|
|
84
|
-
}
|
|
84
|
+
} as const
|
|
85
85
|
|
|
86
86
|
export { primary, secondary, grey, warning, error, overlays, common }
|
|
87
87
|
export default { primary, secondary, grey, warning, error }
|