@registrucentras/rc-ses-react-components 2.2.0 → 2.4.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.
Files changed (164) hide show
  1. package/dist/assets/icons/createIcon.d.ts +18 -0
  2. package/dist/assets/icons/phosphorIcons.d.ts +217 -0
  3. package/dist/components/common/AdvancedList/components/AdvancedListItem/index.d.ts +3 -0
  4. package/dist/components/common/AdvancedList/components/AdvancedListItemShell/AdvancedListItemShell.types.d.ts +31 -0
  5. package/dist/components/common/AdvancedList/components/AdvancedListItemShell/index.d.ts +11 -0
  6. package/dist/library/icons.d.ts +2 -48
  7. package/dist/library/index.d.ts +2 -1
  8. package/dist/library/types.d.ts +2 -0
  9. package/dist/registrucentras-rc-ses-react-components.cjs +1 -1
  10. package/dist/registrucentras-rc-ses-react-components.js +3031 -3240
  11. package/package.json +1 -1
  12. package/src/assets/icons/createIcon.test.tsx +49 -0
  13. package/src/assets/icons/createIcon.tsx +49 -0
  14. package/src/assets/icons/phosphorIcons.ts +160 -0
  15. package/src/components/common/Accordion/index.tsx +1 -1
  16. package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemLeading.tsx +1 -3
  17. package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemTrailing.tsx +6 -4
  18. package/src/components/common/AdvancedList/components/AdvancedListItem/index.test.tsx +5 -3
  19. package/src/components/common/AdvancedList/components/AdvancedListItem/index.tsx +4 -0
  20. package/src/components/common/AdvancedList/components/AdvancedListItemShell/AdvancedListItemShell.types.ts +35 -0
  21. package/src/components/common/AdvancedList/components/AdvancedListItemShell/index.test.tsx +350 -0
  22. package/src/components/common/AdvancedList/components/AdvancedListItemShell/index.tsx +247 -0
  23. package/src/components/common/Alert/index.tsx +1 -1
  24. package/src/components/common/Badge/index.tsx +1 -2
  25. package/src/components/common/Button/ButtonWithPopover.tsx +1 -2
  26. package/src/components/common/DataPagination/index.tsx +1 -2
  27. package/src/components/common/IconWithSquareBackground/index.test.tsx +1 -1
  28. package/src/components/common/ServiceLinks/ServiceLinkItem/index.tsx +1 -1
  29. package/src/components/common/Snackbar/index.tsx +1 -1
  30. package/src/components/common/StepCard/StepCardFooter/index.tsx +5 -3
  31. package/src/components/common/Tooltip/index.tsx +1 -1
  32. package/src/components/form/inputs/CheckboxFormControl.tsx +1 -2
  33. package/src/components/form/inputs/Datepicker/components/RcSesDatepickerCalendarHeader.tsx +6 -4
  34. package/src/components/form/inputs/Datepicker/index.tsx +1 -2
  35. package/src/components/form/inputs/FileDropzone.tsx +1 -2
  36. package/src/components/form/inputs/FileUpload.tsx +1 -1
  37. package/src/components/form/inputs/NumberStepper.tsx +1 -2
  38. package/src/components/form/inputs/PhoneInputFormControl/components/AutocompleteInput.tsx +1 -1
  39. package/src/components/form/inputs/PhoneInputFormControl/index.tsx +1 -1
  40. package/src/components/form/inputs/SearchInput/index.tsx +1 -2
  41. package/src/components/form/inputs/SearchableField.tsx +1 -2
  42. package/src/components/form/inputs/Select/components/OptionCheckbox.tsx +1 -1
  43. package/src/components/form/inputs/Select/index.tsx +1 -2
  44. package/src/components/form/inputs/SimpleCheckbox.tsx +1 -2
  45. package/src/components/layout/ServiceFormActions.tsx +1 -2
  46. package/src/components/layout/ServiceFormContainer/AccordionFormContainer/components/AccordionCollapseControls.tsx +1 -2
  47. package/src/components/layout/ServiceWizardStepper/components/CustomStepIcon.tsx +1 -2
  48. package/src/components/layout/ServiceWizardStepper/components/HorizontalStepperButton.tsx +1 -2
  49. package/src/components/overlays/BottomSheet/index.tsx +1 -1
  50. package/src/components/overlays/Modal/index.tsx +6 -4
  51. package/src/library/icons.ts +3 -100
  52. package/src/library/index.ts +2 -1
  53. package/src/library/types.ts +10 -0
  54. package/src/stories/atoms/Button.stories.tsx +1 -1
  55. package/src/stories/atoms/IconWithCircularBackground.stories.tsx +1 -1
  56. package/src/stories/atoms/IconWithSquareBackground.stories.tsx +1 -1
  57. package/src/stories/atoms/Icons.stories.tsx +40 -38
  58. package/src/stories/molecules/Card.stories.tsx +5 -3
  59. package/src/stories/molecules/CardShell.stories.tsx +1 -1
  60. package/src/stories/molecules/ImageCard.stories.tsx +1 -1
  61. package/src/stories/molecules/ListWithIcons.stories.tsx +1 -2
  62. package/src/stories/molecules/TitleBlock.stories.tsx +6 -3
  63. package/src/stories/organisms/AdvancedList.stories.tsx +6 -4
  64. package/src/stories/organisms/AdvancedListItem.stories.tsx +2 -4
  65. package/src/stories/organisms/AdvancedListItemShell.stories.tsx +865 -0
  66. package/src/stories/organisms/SelectableCardList.stories.tsx +1 -3
  67. package/src/stories/organisms/ServiceLinks.stories.tsx +1 -1
  68. package/src/theme/light/MuiAccordionSummary.tsx +1 -1
  69. package/src/theme/light/MuiAlert.tsx +7 -5
  70. package/src/theme/light/MuiTypography.tsx +24 -24
  71. package/dist/assets/icons/ArrowLeftIcon.d.ts +0 -3
  72. package/dist/assets/icons/ArrowRightIcon.d.ts +0 -3
  73. package/dist/assets/icons/ArrowsClockwiseIcon.d.ts +0 -3
  74. package/dist/assets/icons/BarcodeIcon.d.ts +0 -3
  75. package/dist/assets/icons/CalendarBlankIcon.d.ts +0 -3
  76. package/dist/assets/icons/CaretDoubleLeftBoldIcon.d.ts +0 -3
  77. package/dist/assets/icons/CaretDoubleRightBoldIcon.d.ts +0 -3
  78. package/dist/assets/icons/CaretDownBoldIcon.d.ts +0 -3
  79. package/dist/assets/icons/CaretDownFill.d.ts +0 -3
  80. package/dist/assets/icons/CaretDownIcon.d.ts +0 -3
  81. package/dist/assets/icons/CaretLeftBoldIcon.d.ts +0 -3
  82. package/dist/assets/icons/CaretLeftIcon.d.ts +0 -3
  83. package/dist/assets/icons/CaretRightBoldIcon.d.ts +0 -3
  84. package/dist/assets/icons/CaretUpBoldIcon.d.ts +0 -3
  85. package/dist/assets/icons/CaretUpIcon.d.ts +0 -3
  86. package/dist/assets/icons/CheckBoldIcon.d.ts +0 -3
  87. package/dist/assets/icons/CheckCircleFillIcon.d.ts +0 -3
  88. package/dist/assets/icons/CheckIcon.d.ts +0 -3
  89. package/dist/assets/icons/CheckUncheckedBoldIcon.d.ts +0 -3
  90. package/dist/assets/icons/CircleFilledIcon.d.ts +0 -3
  91. package/dist/assets/icons/CloseIcon.d.ts +0 -3
  92. package/dist/assets/icons/CollapseChevronsIcon.d.ts +0 -3
  93. package/dist/assets/icons/CopyIcon.d.ts +0 -3
  94. package/dist/assets/icons/ExpandChevronsIcon.d.ts +0 -3
  95. package/dist/assets/icons/InfoFillIcon.d.ts +0 -3
  96. package/dist/assets/icons/ListIcon.d.ts +0 -3
  97. package/dist/assets/icons/MagnifyingGlassIcon.d.ts +0 -3
  98. package/dist/assets/icons/MapPinAreaIcon.d.ts +0 -3
  99. package/dist/assets/icons/MinusBoldIcon.d.ts +0 -3
  100. package/dist/assets/icons/MinusIcon.d.ts +0 -3
  101. package/dist/assets/icons/NotePencilIcon.d.ts +0 -3
  102. package/dist/assets/icons/PencilSimpleLineIcon.d.ts +0 -3
  103. package/dist/assets/icons/PlusBoldIcon.d.ts +0 -3
  104. package/dist/assets/icons/PlusIcon.d.ts +0 -3
  105. package/dist/assets/icons/QuestionFillIcon.d.ts +0 -3
  106. package/dist/assets/icons/QuestionIcon.d.ts +0 -3
  107. package/dist/assets/icons/ScalesIcon.d.ts +0 -3
  108. package/dist/assets/icons/ScrollIcon.d.ts +0 -3
  109. package/dist/assets/icons/ShoppingCartIcon.d.ts +0 -3
  110. package/dist/assets/icons/SpinnerGapBoldIcon.d.ts +0 -3
  111. package/dist/assets/icons/TrashIcon.d.ts +0 -3
  112. package/dist/assets/icons/UploadSimpleIcon.d.ts +0 -3
  113. package/dist/assets/icons/UserIcon.d.ts +0 -3
  114. package/dist/assets/icons/WarningCircleIcon.d.ts +0 -3
  115. package/dist/assets/icons/WarningDiamondFillIcon.d.ts +0 -3
  116. package/dist/assets/icons/WarningFillIcon.d.ts +0 -3
  117. package/dist/assets/icons/XCircleFillIcon.d.ts +0 -3
  118. package/src/assets/icons/ArrowLeftIcon.tsx +0 -16
  119. package/src/assets/icons/ArrowRightIcon.tsx +0 -17
  120. package/src/assets/icons/ArrowsClockwiseIcon.tsx +0 -16
  121. package/src/assets/icons/BarcodeIcon.tsx +0 -9
  122. package/src/assets/icons/CalendarBlankIcon.tsx +0 -9
  123. package/src/assets/icons/CaretDoubleLeftBoldIcon.tsx +0 -22
  124. package/src/assets/icons/CaretDoubleRightBoldIcon.tsx +0 -22
  125. package/src/assets/icons/CaretDownBoldIcon.tsx +0 -17
  126. package/src/assets/icons/CaretDownFill.tsx +0 -17
  127. package/src/assets/icons/CaretDownIcon.tsx +0 -9
  128. package/src/assets/icons/CaretLeftBoldIcon.tsx +0 -17
  129. package/src/assets/icons/CaretLeftIcon.tsx +0 -9
  130. package/src/assets/icons/CaretRightBoldIcon.tsx +0 -17
  131. package/src/assets/icons/CaretUpBoldIcon.tsx +0 -17
  132. package/src/assets/icons/CaretUpIcon.tsx +0 -9
  133. package/src/assets/icons/CheckBoldIcon.tsx +0 -17
  134. package/src/assets/icons/CheckCircleFillIcon.tsx +0 -23
  135. package/src/assets/icons/CheckIcon.tsx +0 -23
  136. package/src/assets/icons/CheckUncheckedBoldIcon.tsx +0 -9
  137. package/src/assets/icons/CircleFilledIcon.tsx +0 -11
  138. package/src/assets/icons/CloseIcon.tsx +0 -9
  139. package/src/assets/icons/CollapseChevronsIcon.tsx +0 -17
  140. package/src/assets/icons/CopyIcon.tsx +0 -23
  141. package/src/assets/icons/ExpandChevronsIcon.tsx +0 -17
  142. package/src/assets/icons/InfoFillIcon.tsx +0 -17
  143. package/src/assets/icons/ListIcon.tsx +0 -17
  144. package/src/assets/icons/MagnifyingGlassIcon.tsx +0 -9
  145. package/src/assets/icons/MapPinAreaIcon.tsx +0 -9
  146. package/src/assets/icons/MinusBoldIcon.tsx +0 -11
  147. package/src/assets/icons/MinusIcon.tsx +0 -9
  148. package/src/assets/icons/NotePencilIcon.tsx +0 -9
  149. package/src/assets/icons/PencilSimpleLineIcon.tsx +0 -23
  150. package/src/assets/icons/PlusBoldIcon.tsx +0 -11
  151. package/src/assets/icons/PlusIcon.tsx +0 -9
  152. package/src/assets/icons/QuestionFillIcon.tsx +0 -23
  153. package/src/assets/icons/QuestionIcon.tsx +0 -9
  154. package/src/assets/icons/ScalesIcon.tsx +0 -9
  155. package/src/assets/icons/ScrollIcon.tsx +0 -9
  156. package/src/assets/icons/ShoppingCartIcon.tsx +0 -16
  157. package/src/assets/icons/SpinnerGapBoldIcon.tsx +0 -17
  158. package/src/assets/icons/TrashIcon.tsx +0 -23
  159. package/src/assets/icons/UploadSimpleIcon.tsx +0 -9
  160. package/src/assets/icons/UserIcon.tsx +0 -17
  161. package/src/assets/icons/WarningCircleIcon.tsx +0 -22
  162. package/src/assets/icons/WarningDiamondFillIcon.tsx +0 -17
  163. package/src/assets/icons/WarningFillIcon.tsx +0 -22
  164. package/src/assets/icons/XCircleFillIcon.tsx +0 -17
@@ -0,0 +1,865 @@
1
+ import { Avatar, Radio, Stack, Typography } from '@mui/material'
2
+ import type { Meta, StoryObj } from '@storybook/react-vite'
3
+ import { useState } from 'react'
4
+
5
+ import { NotePencilIcon, TrashIcon } from '@/assets/icons/phosphorIcons'
6
+ import AdvancedListItemShell from '@/components/common/AdvancedList/components/AdvancedListItemShell'
7
+ import RcSesBadge from '@/components/common/Badge'
8
+ import RcSesButton from '@/components/common/Button'
9
+ import RcSesSwitch from '@/components/common/Switch'
10
+ import palette from '@/theme/palette'
11
+
12
+ const ACTION_BUTTON_SX = {
13
+ height: 'auto',
14
+ padding: '0.5rem 0.25rem',
15
+ fontWeight: 500,
16
+ lineHeight: '1.25rem',
17
+ color: palette.primary[700],
18
+ } as const
19
+
20
+ const meta = {
21
+ title: 'Organisms/AdvancedListItemShell',
22
+ component: AdvancedListItemShell,
23
+ tags: ['autodocs'],
24
+ argTypes: {
25
+ leading: { control: false },
26
+ content: { control: false },
27
+ trailing: { control: false },
28
+ expanded: { control: false },
29
+ onClick: { control: false },
30
+ testIds: { control: false },
31
+ },
32
+ args: {
33
+ content: (
34
+ <Stack sx={{ gap: '0.5rem' }}>
35
+ <Typography variant='body2' sx={{ fontWeight: 600 }}>
36
+ Įrašo pavadinimas
37
+ </Typography>
38
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
39
+ a.k. 3880819****
40
+ </Typography>
41
+ </Stack>
42
+ ),
43
+ state: 'rest',
44
+ },
45
+ } satisfies Meta<typeof AdvancedListItemShell>
46
+
47
+ export default meta
48
+
49
+ type Story = StoryObj<typeof meta>
50
+
51
+ export const Main: Story = {
52
+ parameters: {
53
+ docs: {
54
+ description: {
55
+ story:
56
+ 'Only the required `content` slot is filled. `leading`, `trailing` and `expanded` are all omitted, so those are not rendered at all.',
57
+ },
58
+ source: {
59
+ code: `<AdvancedListItemShell
60
+ content={
61
+ <Stack sx={{ gap: '0.5rem' }}>
62
+ <Typography variant='body2' sx={{ fontWeight: 600 }}>
63
+ Įrašo pavadinimas
64
+ </Typography>
65
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
66
+ a.k. 3880819****
67
+ </Typography>
68
+ </Stack>
69
+ }
70
+ />`,
71
+ },
72
+ },
73
+ },
74
+ }
75
+
76
+ export const Selected: Story = {
77
+ args: { state: 'selected' },
78
+ parameters: {
79
+ docs: {
80
+ description: {
81
+ story:
82
+ 'Same slots as `Main`, but `state` is set to `selected`. The shell only changes its own border/background styling — slot content is untouched.',
83
+ },
84
+ source: {
85
+ code: `<AdvancedListItemShell
86
+ state='selected'
87
+ content={
88
+ <Stack sx={{ gap: '0.5rem' }}>
89
+ <Typography variant='body2' sx={{ fontWeight: 600 }}>
90
+ Įrašo pavadinimas
91
+ </Typography>
92
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
93
+ a.k. 3880819****
94
+ </Typography>
95
+ </Stack>
96
+ }
97
+ />`,
98
+ },
99
+ },
100
+ },
101
+ }
102
+
103
+ export const Disabled: Story = {
104
+ args: { state: 'disabled' },
105
+ parameters: {
106
+ docs: {
107
+ description: {
108
+ story:
109
+ '`state` is set to `disabled`. The shell dims itself, ignores `onClick`, and marks its root `inert` so any controls rendered into the slots are also removed from the tab order and assistive tech, not just visually blocked from the mouse.',
110
+ },
111
+ source: {
112
+ code: `<AdvancedListItemShell
113
+ state='disabled'
114
+ content={
115
+ <Stack sx={{ gap: '0.5rem' }}>
116
+ <Typography variant='body2' sx={{ fontWeight: 600 }}>
117
+ Įrašo pavadinimas
118
+ </Typography>
119
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
120
+ a.k. 3880819****
121
+ </Typography>
122
+ </Stack>
123
+ }
124
+ />`,
125
+ },
126
+ },
127
+ },
128
+ }
129
+
130
+ export const ErrorState: Story = {
131
+ args: { state: 'error' },
132
+ parameters: {
133
+ docs: {
134
+ description: {
135
+ story:
136
+ '`state` is set to `error`, which only swaps the border color token used by the shell. No slot content or layout changes are needed to represent this state.',
137
+ },
138
+ source: {
139
+ code: `<AdvancedListItemShell
140
+ state='error'
141
+ content={
142
+ <Stack sx={{ gap: '0.5rem' }}>
143
+ <Typography variant='body2' sx={{ fontWeight: 600 }}>
144
+ Įrašo pavadinimas
145
+ </Typography>
146
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
147
+ a.k. 3880819****
148
+ </Typography>
149
+ </Stack>
150
+ }
151
+ />`,
152
+ },
153
+ },
154
+ },
155
+ }
156
+
157
+ export const WithLeadingAndTrailing: Story = {
158
+ args: {
159
+ leading: <Avatar>AB</Avatar>,
160
+ trailing: (
161
+ <Stack direction='row' sx={{ gap: '0.5rem', alignItems: 'center' }}>
162
+ <RcSesButton
163
+ variant='link'
164
+ startIcon={<NotePencilIcon size={20} />}
165
+ onClick={() => {}}
166
+ sx={ACTION_BUTTON_SX}
167
+ >
168
+ Keisti
169
+ </RcSesButton>
170
+ <RcSesButton
171
+ variant='link'
172
+ startIcon={<TrashIcon size={20} />}
173
+ onClick={() => {}}
174
+ sx={ACTION_BUTTON_SX}
175
+ >
176
+ Pašalinti
177
+ </RcSesButton>
178
+ </Stack>
179
+ ),
180
+ },
181
+ parameters: {
182
+ docs: {
183
+ description: {
184
+ story:
185
+ 'Passes plain elements directly as the `leading` (an avatar) and `trailing` (a `Stack` of `RcSesButton` link-style action buttons, the same look `AdvancedListItem` uses for its `actions` trailing type) slots.',
186
+ },
187
+ source: {
188
+ code: `<AdvancedListItemShell
189
+ content={
190
+ <Stack sx={{ gap: '0.5rem' }}>
191
+ <Typography variant='body2' sx={{ fontWeight: 600 }}>
192
+ Įrašo pavadinimas
193
+ </Typography>
194
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
195
+ a.k. 3880819****
196
+ </Typography>
197
+ </Stack>
198
+ }
199
+ leading={<Avatar>AB</Avatar>}
200
+ trailing={
201
+ <Stack direction='row' sx={{ gap: '0.5rem', alignItems: 'center' }}>
202
+ <RcSesButton variant='link' startIcon={<NotePencilIcon size={20} />} onClick={() => {}} sx={ACTION_BUTTON_SX}>
203
+ Keisti
204
+ </RcSesButton>
205
+ <RcSesButton variant='link' startIcon={<TrashIcon size={20} />} onClick={() => {}} sx={ACTION_BUTTON_SX}>
206
+ Pašalinti
207
+ </RcSesButton>
208
+ </Stack>
209
+ }
210
+ />`,
211
+ },
212
+ },
213
+ },
214
+ }
215
+
216
+ export const RowContainer: Story = {
217
+ args: {
218
+ container: 'row',
219
+ leading: <Avatar>AB</Avatar>,
220
+ trailing: (
221
+ <Stack direction='row' sx={{ gap: '0.5rem', alignItems: 'center' }}>
222
+ <RcSesButton
223
+ variant='link'
224
+ startIcon={<NotePencilIcon size={20} />}
225
+ onClick={() => {}}
226
+ sx={ACTION_BUTTON_SX}
227
+ >
228
+ Keisti
229
+ </RcSesButton>
230
+ <RcSesButton
231
+ variant='link'
232
+ startIcon={<TrashIcon size={20} />}
233
+ onClick={() => {}}
234
+ sx={ACTION_BUTTON_SX}
235
+ >
236
+ Pašalinti
237
+ </RcSesButton>
238
+ </Stack>
239
+ ),
240
+ },
241
+ parameters: {
242
+ docs: {
243
+ description: {
244
+ story:
245
+ '`container` is set to `"row"`, the flush-list-row look: no border or corner radius, just a bottom divider in the same state-driven color the `"card"` look uses for its border. Useful when several shells are stacked directly against each other, like rows in a table.',
246
+ },
247
+ source: {
248
+ code: `<AdvancedListItemShell
249
+ container='row'
250
+ content={
251
+ <Stack sx={{ gap: '0.5rem' }}>
252
+ <Typography variant='body2' sx={{ fontWeight: 600 }}>
253
+ Įrašo pavadinimas
254
+ </Typography>
255
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
256
+ a.k. 3880819****
257
+ </Typography>
258
+ </Stack>
259
+ }
260
+ leading={<Avatar>AB</Avatar>}
261
+ trailing={
262
+ <Stack direction='row' sx={{ gap: '0.5rem', alignItems: 'center' }}>
263
+ <RcSesButton variant='link' startIcon={<NotePencilIcon size={20} />} onClick={() => {}} sx={ACTION_BUTTON_SX}>
264
+ Keisti
265
+ </RcSesButton>
266
+ <RcSesButton variant='link' startIcon={<TrashIcon size={20} />} onClick={() => {}} sx={ACTION_BUTTON_SX}>
267
+ Pašalinti
268
+ </RcSesButton>
269
+ </Stack>
270
+ }
271
+ />`,
272
+ },
273
+ },
274
+ },
275
+ }
276
+
277
+ export const RowContainerSelected: Story = {
278
+ args: {
279
+ container: 'row',
280
+ state: 'selected',
281
+ leading: <Avatar>AB</Avatar>,
282
+ trailing: (
283
+ <Stack direction='row' sx={{ gap: '0.5rem', alignItems: 'center' }}>
284
+ <RcSesButton
285
+ variant='link'
286
+ startIcon={<NotePencilIcon size={20} />}
287
+ onClick={() => {}}
288
+ sx={ACTION_BUTTON_SX}
289
+ >
290
+ Keisti
291
+ </RcSesButton>
292
+ <RcSesButton
293
+ variant='link'
294
+ startIcon={<TrashIcon size={20} />}
295
+ onClick={() => {}}
296
+ sx={ACTION_BUTTON_SX}
297
+ >
298
+ Pašalinti
299
+ </RcSesButton>
300
+ </Stack>
301
+ ),
302
+ },
303
+ parameters: {
304
+ docs: {
305
+ description: {
306
+ story:
307
+ '`container` is set to `"row"` and `state` is `"selected"`. Shows the row layout with selected state styling — full border in primary color and cyan background tint.',
308
+ },
309
+ source: {
310
+ code: `<AdvancedListItemShell
311
+ container='row'
312
+ state='selected'
313
+ content={
314
+ <Stack sx={{ gap: '0.5rem' }}>
315
+ <Typography variant='body2' sx={{ fontWeight: 600 }}>
316
+ Įrašo pavadinimas
317
+ </Typography>
318
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
319
+ a.k. 3880819****
320
+ </Typography>
321
+ </Stack>
322
+ }
323
+ leading={<Avatar>AB</Avatar>}
324
+ trailing={
325
+ <Stack direction='row' sx={{ gap: '0.5rem', alignItems: 'center' }}>
326
+ <RcSesButton variant='link' startIcon={<NotePencilIcon size={20} />} onClick={() => {}} sx={ACTION_BUTTON_SX}>
327
+ Keisti
328
+ </RcSesButton>
329
+ <RcSesButton variant='link' startIcon={<TrashIcon size={20} />} onClick={() => {}} sx={ACTION_BUTTON_SX}>
330
+ Pašalinti
331
+ </RcSesButton>
332
+ </Stack>
333
+ }
334
+ />`,
335
+ },
336
+ },
337
+ },
338
+ }
339
+
340
+ export const RowContainerError: Story = {
341
+ args: {
342
+ container: 'row',
343
+ state: 'error',
344
+ leading: <Avatar>AB</Avatar>,
345
+ trailing: (
346
+ <Stack direction='row' sx={{ gap: '0.5rem', alignItems: 'center' }}>
347
+ <RcSesButton
348
+ variant='link'
349
+ startIcon={<NotePencilIcon size={20} />}
350
+ onClick={() => {}}
351
+ sx={ACTION_BUTTON_SX}
352
+ >
353
+ Keisti
354
+ </RcSesButton>
355
+ <RcSesButton
356
+ variant='link'
357
+ startIcon={<TrashIcon size={20} />}
358
+ onClick={() => {}}
359
+ sx={ACTION_BUTTON_SX}
360
+ >
361
+ Pašalinti
362
+ </RcSesButton>
363
+ </Stack>
364
+ ),
365
+ },
366
+ parameters: {
367
+ docs: {
368
+ description: {
369
+ story:
370
+ '`container` is set to `"row"` and `state` is `"error"`. Shows the row layout with error state styling — full border in error color.',
371
+ },
372
+ source: {
373
+ code: `<AdvancedListItemShell
374
+ container='row'
375
+ state='error'
376
+ content={
377
+ <Stack sx={{ gap: '0.5rem' }}>
378
+ <Typography variant='body2' sx={{ fontWeight: 600 }}>
379
+ Įrašo pavadinimas
380
+ </Typography>
381
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
382
+ a.k. 3880819****
383
+ </Typography>
384
+ </Stack>
385
+ }
386
+ leading={<Avatar>AB</Avatar>}
387
+ trailing={
388
+ <Stack direction='row' sx={{ gap: '0.5rem', alignItems: 'center' }}>
389
+ <RcSesButton variant='link' startIcon={<NotePencilIcon size={20} />} onClick={() => {}} sx={ACTION_BUTTON_SX}>
390
+ Keisti
391
+ </RcSesButton>
392
+ <RcSesButton variant='link' startIcon={<TrashIcon size={20} />} onClick={() => {}} sx={ACTION_BUTTON_SX}>
393
+ Pašalinti
394
+ </RcSesButton>
395
+ </Stack>
396
+ }
397
+ />`,
398
+ },
399
+ },
400
+ },
401
+ }
402
+
403
+ export const RowContainerExpandable: Story = {
404
+ render: (args) => {
405
+ const [isExpanded, setIsExpanded] = useState(true)
406
+
407
+ return (
408
+ <AdvancedListItemShell
409
+ {...args}
410
+ isExpanded={isExpanded}
411
+ onClick={() => setIsExpanded((prev) => !prev)}
412
+ expanded={
413
+ <Stack sx={{ gap: '0.5rem' }}>
414
+ <Typography variant='body2'>Papildoma informacija apie šį įrašą.</Typography>
415
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
416
+ Antra papildomos informacijos eilutė.
417
+ </Typography>
418
+ </Stack>
419
+ }
420
+ />
421
+ )
422
+ },
423
+ args: {
424
+ container: 'row',
425
+ leading: <Avatar>AB</Avatar>,
426
+ trailing: (
427
+ <Stack direction='row' sx={{ gap: '0.5rem', alignItems: 'center' }}>
428
+ <RcSesButton
429
+ variant='link'
430
+ startIcon={<NotePencilIcon size={20} />}
431
+ onClick={() => {}}
432
+ sx={ACTION_BUTTON_SX}
433
+ >
434
+ Keisti
435
+ </RcSesButton>
436
+ <RcSesButton
437
+ variant='link'
438
+ startIcon={<TrashIcon size={20} />}
439
+ onClick={() => {}}
440
+ sx={ACTION_BUTTON_SX}
441
+ >
442
+ Pašalinti
443
+ </RcSesButton>
444
+ </Stack>
445
+ ),
446
+ },
447
+ parameters: {
448
+ docs: {
449
+ description: {
450
+ story:
451
+ 'Combines `container="row"` with `isExpanded`/`onClick` to show a row-style expandable. Clicks the main row content to expand/collapse; clicking inside the expanded section does not collapse.',
452
+ },
453
+ source: {
454
+ code: `const [isExpanded, setIsExpanded] = useState(false)
455
+
456
+ <AdvancedListItemShell
457
+ container='row'
458
+ content={
459
+ <Stack sx={{ gap: '0.5rem' }}>
460
+ <Typography variant='body2' sx={{ fontWeight: 600 }}>
461
+ Įrašo pavadinimas
462
+ </Typography>
463
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
464
+ a.k. 3880819****
465
+ </Typography>
466
+ </Stack>
467
+ }
468
+ leading={<Avatar>AB</Avatar>}
469
+ trailing={
470
+ <Stack direction='row' sx={{ gap: '0.5rem', alignItems: 'center' }}>
471
+ <RcSesButton variant='link' startIcon={<NotePencilIcon size={20} />} onClick={() => {}} sx={ACTION_BUTTON_SX}>
472
+ Keisti
473
+ </RcSesButton>
474
+ <RcSesButton variant='link' startIcon={<TrashIcon size={20} />} onClick={() => {}} sx={ACTION_BUTTON_SX}>
475
+ Pašalinti
476
+ </RcSesButton>
477
+ </Stack>
478
+ }
479
+ isExpanded={isExpanded}
480
+ onClick={() => setIsExpanded((prev) => !prev)}
481
+ expanded={
482
+ <Stack sx={{ gap: '0.5rem' }}>
483
+ <Typography variant='body2'>Papildoma informacija apie šį įrašą.</Typography>
484
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
485
+ Antra papildomos informacijos eilutė.
486
+ </Typography>
487
+ </Stack>
488
+ }
489
+ />`,
490
+ },
491
+ },
492
+ },
493
+ }
494
+
495
+ export const Expandable: Story = {
496
+ render: (args) => {
497
+ const [isExpanded, setIsExpanded] = useState(false)
498
+
499
+ return (
500
+ <AdvancedListItemShell
501
+ {...args}
502
+ isExpanded={isExpanded}
503
+ onClick={() => setIsExpanded((prev) => !prev)}
504
+ expanded={
505
+ <Stack sx={{ gap: '0.5rem' }}>
506
+ <Typography variant='body2'>Papildoma informacija apie šį įrašą.</Typography>
507
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
508
+ Antra papildomos informacijos eilutė.
509
+ </Typography>
510
+ </Stack>
511
+ }
512
+ />
513
+ )
514
+ },
515
+ parameters: {
516
+ docs: {
517
+ description: {
518
+ story:
519
+ 'Uses a custom `render` with local `useState` to own the `isExpanded` boolean. `onClick` toggles it and is wired to the root element by the shell; the `expanded` slot content stays the same node the whole time.',
520
+ },
521
+ source: {
522
+ code: `const [isExpanded, setIsExpanded] = useState(false)
523
+
524
+ <AdvancedListItemShell
525
+ content={
526
+ <Stack sx={{ gap: '0.5rem' }}>
527
+ <Typography variant='body2' sx={{ fontWeight: 600 }}>
528
+ Įrašo pavadinimas
529
+ </Typography>
530
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
531
+ a.k. 3880819****
532
+ </Typography>
533
+ </Stack>
534
+ }
535
+ isExpanded={isExpanded}
536
+ onClick={() => setIsExpanded((prev) => !prev)}
537
+ expanded={
538
+ <Stack sx={{ gap: '0.5rem' }}>
539
+ <Typography variant='body2'>Papildoma informacija apie šį įrašą.</Typography>
540
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
541
+ Antra papildomos informacijos eilutė.
542
+ </Typography>
543
+ </Stack>
544
+ }
545
+ />`,
546
+ },
547
+ },
548
+ },
549
+ }
550
+
551
+ /**
552
+ * Renders already expanded (no click needed) so the visual regression suite,
553
+ * which only screenshots each story's initial render, gets a baseline of the
554
+ * expanded open state.
555
+ */
556
+ export const ExpandedOpen: Story = {
557
+ args: {
558
+ isExpanded: true,
559
+ expanded: (
560
+ <Stack sx={{ gap: '0.5rem' }}>
561
+ <Typography variant='body2'>Papildoma informacija apie šį įrašą.</Typography>
562
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
563
+ Antra papildomos informacijos eilutė.
564
+ </Typography>
565
+ </Stack>
566
+ ),
567
+ },
568
+ parameters: {
569
+ docs: {
570
+ description: {
571
+ story:
572
+ 'Same `expanded` slot content as `Expandable`, but with `isExpanded` set to `true` directly in `args` instead of via local state, so the story renders open from the first paint — used as the visual-regression baseline for the expanded state.',
573
+ },
574
+ source: {
575
+ code: `<AdvancedListItemShell
576
+ content={
577
+ <Stack sx={{ gap: '0.5rem' }}>
578
+ <Typography variant='body2' sx={{ fontWeight: 600 }}>
579
+ Įrašo pavadinimas
580
+ </Typography>
581
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
582
+ a.k. 3880819****
583
+ </Typography>
584
+ </Stack>
585
+ }
586
+ isExpanded
587
+ expanded={
588
+ <Stack sx={{ gap: '0.5rem' }}>
589
+ <Typography variant='body2'>Papildoma informacija apie šį įrašą.</Typography>
590
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
591
+ Antra papildomos informacijos eilutė.
592
+ </Typography>
593
+ </Stack>
594
+ }
595
+ />`,
596
+ },
597
+ },
598
+ },
599
+ }
600
+
601
+ export const RadioSelectionWithActions: Story = {
602
+ render: (args) => {
603
+ const [selected, setSelected] = useState(false)
604
+
605
+ return (
606
+ <AdvancedListItemShell
607
+ {...args}
608
+ state={selected ? 'selected' : 'rest'}
609
+ onClick={() => setSelected((prev) => !prev)}
610
+ leading={
611
+ <Radio
612
+ checked={selected}
613
+ onChange={() => setSelected((prev) => !prev)}
614
+ slotProps={{ input: { 'aria-label': 'Pažymėti elementą' } }}
615
+ sx={{
616
+ width: '1.375rem',
617
+ height: '1.375rem',
618
+ margin: 0,
619
+ padding: '0.0625rem',
620
+ '& svg': { width: '1.25rem', height: '1.25rem' },
621
+ }}
622
+ />
623
+ }
624
+ trailing={
625
+ <RcSesButton
626
+ variant='link'
627
+ startIcon={<TrashIcon size={20} />}
628
+ onClick={() => {}}
629
+ sx={ACTION_BUTTON_SX}
630
+ >
631
+ Pašalinti
632
+ </RcSesButton>
633
+ }
634
+ />
635
+ )
636
+ },
637
+ parameters: {
638
+ docs: {
639
+ description: {
640
+ story:
641
+ '`leading` is a `Radio`, `content` is a title + subtitle, and `trailing` has an action.',
642
+ },
643
+ source: {
644
+ code: `const [selected, setSelected] = useState(false)
645
+
646
+ <AdvancedListItemShell
647
+ state={selected ? 'selected' : 'rest'}
648
+ onClick={() => setSelected((prev) => !prev)}
649
+ leading={
650
+ <Radio
651
+ checked={selected}
652
+ onChange={() => setSelected((prev) => !prev)}
653
+ slotProps={{ input: { 'aria-label': 'Pažymėti elementą' } }}
654
+ sx={{
655
+ width: '1.375rem',
656
+ height: '1.375rem',
657
+ margin: 0,
658
+ padding: '0.0625rem',
659
+ '& svg': { width: '1.25rem', height: '1.25rem' },
660
+ }}
661
+ />
662
+ }
663
+ content={
664
+ <Stack sx={{ gap: '0.4375rem' }}>
665
+ <Typography variant='body1' sx={{ fontWeight: 600 }}>
666
+ UAB Pavyzdys
667
+ </Typography>
668
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
669
+ Kodas 300xxxxxx
670
+ </Typography>
671
+ </Stack>
672
+ }
673
+ trailing={
674
+ <RcSesButton variant='link' startIcon={<TrashIcon size={20} />} onClick={() => {}} sx={ACTION_BUTTON_SX}>
675
+ Pašalinti
676
+ </RcSesButton>
677
+ }
678
+ />`,
679
+ },
680
+ },
681
+ },
682
+ }
683
+
684
+ export const ExpandableWithRadioAndSwitch: Story = {
685
+ render: (args) => {
686
+ const [isExpanded, setIsExpanded] = useState(false)
687
+ const [sendCopy, setSendCopy] = useState(false)
688
+
689
+ return (
690
+ <AdvancedListItemShell
691
+ {...args}
692
+ isExpanded={isExpanded}
693
+ onClick={() => setIsExpanded((prev) => !prev)}
694
+ leading={
695
+ <Radio
696
+ checked={isExpanded}
697
+ onChange={() => setIsExpanded((prev) => !prev)}
698
+ slotProps={{ input: { 'aria-label': 'Rodyti daugiau informacijos' } }}
699
+ sx={{
700
+ width: '1.375rem',
701
+ height: '1.375rem',
702
+ margin: 0,
703
+ padding: '0.0625rem',
704
+ '& svg': { width: '1.25rem', height: '1.25rem' },
705
+ }}
706
+ />
707
+ }
708
+ content={
709
+ <Stack sx={{ gap: '0.25rem' }}>
710
+ <Typography
711
+ sx={{
712
+ fontSize: '1rem',
713
+ fontWeight: 500,
714
+ lineHeight: '1.375rem',
715
+ }}
716
+ >
717
+ Registrų centro savitarnoje
718
+ </Typography>
719
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
720
+ Rezultatą matysite iš karto savitarnoje
721
+ </Typography>
722
+ <Typography
723
+ sx={{
724
+ color: palette.grey[600],
725
+ fontSize: '0.8125rem',
726
+ fontWeight: 400,
727
+ lineHeight: '1.125rem',
728
+ }}
729
+ >
730
+ Nemokama
731
+ </Typography>
732
+ </Stack>
733
+ }
734
+ trailing={
735
+ <RcSesBadge
736
+ label='3 darbo dienos'
737
+ variant='neutral'
738
+ size='small'
739
+ showIcon={false}
740
+ />
741
+ }
742
+ expanded={
743
+ <Stack direction='row' sx={{ alignItems: 'center', gap: '0.625rem' }}>
744
+ <RcSesSwitch
745
+ ariaLabel='Gauti kopiją į el. paštą'
746
+ checked={sendCopy}
747
+ onChange={(_, checked) => setSendCopy(checked)}
748
+ />
749
+ <Stack sx={{ gap: '0.25rem' }}>
750
+ <Typography
751
+ sx={{
752
+ color: palette.grey[900],
753
+ fontSize: '0.875rem',
754
+ fontWeight: 600,
755
+ lineHeight: '1.25rem',
756
+ }}
757
+ >
758
+ Gauti kopiją į el. paštą
759
+ </Typography>
760
+ <Typography
761
+ sx={{
762
+ color: palette.grey[600],
763
+ fontSize: '0.875rem',
764
+ fontWeight: 400,
765
+ lineHeight: '1.25rem',
766
+ }}
767
+ >
768
+ Bus atsiųsta į Jūsų el. paštą vardas.pavarde@gmail.com
769
+ </Typography>
770
+ </Stack>
771
+ </Stack>
772
+ }
773
+ />
774
+ )
775
+ },
776
+ parameters: {
777
+ docs: {
778
+ description: {
779
+ story:
780
+ '`leading` is a `Radio`, `content` is 3 text lines, `trailing` holds an `RcSesBadge` and the `expanded` slot holds an `RcSesSwitch` toggle plus explanatory text.',
781
+ },
782
+ source: {
783
+ code: `const [isExpanded, setIsExpanded] = useState(false)
784
+ const [sendCopy, setSendCopy] = useState(false)
785
+
786
+ <AdvancedListItemShell
787
+ isExpanded={isExpanded}
788
+ onClick={() => setIsExpanded((prev) => !prev)}
789
+ leading={
790
+ <Radio
791
+ checked={isExpanded}
792
+ onChange={() => setIsExpanded((prev) => !prev)}
793
+ slotProps={{ input: { 'aria-label': 'Rodyti daugiau informacijos' } }}
794
+ sx={{
795
+ width: '1.375rem',
796
+ height: '1.375rem',
797
+ margin: 0,
798
+ padding: '0.0625rem',
799
+ '& svg': { width: '1.25rem', height: '1.25rem' },
800
+ }}
801
+ />
802
+ }
803
+ content={
804
+ <Stack sx={{ gap: '0.25rem' }}>
805
+ <Typography
806
+ sx={{
807
+ fontSize: '1rem',
808
+ fontWeight: 500,
809
+ lineHeight: '1.375rem',
810
+ }}
811
+ >
812
+ Registrų centro savitarnoje
813
+ </Typography>
814
+ <Typography variant='body2' sx={{ color: palette.grey[600] }}>
815
+ Rezultatą matysite iš karto savitarnoje
816
+ </Typography>
817
+ <Typography
818
+ sx={{
819
+ color: palette.grey[600],
820
+ fontSize: '0.8125rem',
821
+ fontWeight: 400,
822
+ lineHeight: '1.125rem',
823
+ }}
824
+ >
825
+ Nemokama
826
+ </Typography>
827
+ </Stack>
828
+ }
829
+ trailing={<RcSesBadge label='3 darbo dienos' variant='neutral' size='small' showIcon={false} />}
830
+ expanded={
831
+ <Stack direction='row' sx={{ alignItems: 'center', gap: '0.625rem' }}>
832
+ <RcSesSwitch
833
+ ariaLabel='Gauti kopiją į el. paštą'
834
+ checked={sendCopy}
835
+ onChange={(_, checked) => setSendCopy(checked)}
836
+ />
837
+ <Stack sx={{ gap: '0.25rem' }}>
838
+ <Typography
839
+ sx={{
840
+ color: palette.grey[900],
841
+ fontSize: '0.875rem',
842
+ fontWeight: 600,
843
+ lineHeight: '1.25rem',
844
+ }}
845
+ >
846
+ Gauti kopiją į el. paštą
847
+ </Typography>
848
+ <Typography
849
+ sx={{
850
+ color: palette.grey[600],
851
+ fontSize: '0.875rem',
852
+ fontWeight: 400,
853
+ lineHeight: '1.25rem',
854
+ }}
855
+ >
856
+ Bus atsiųsta į Jūsų el. paštą vardas.pavarde@gmail.com
857
+ </Typography>
858
+ </Stack>
859
+ </Stack>
860
+ }
861
+ />`,
862
+ },
863
+ },
864
+ },
865
+ }