@registrucentras/rc-ses-react-components 2.0.0-rc.0 → 2.0.0-rc.1

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 (84) hide show
  1. package/README.md +5 -1
  2. package/dist/assets/icons/CaretUpBoldIcon.d.ts +3 -0
  3. package/dist/assets/icons/CaretUpIcon.d.ts +3 -0
  4. package/dist/assets/icons/ListIcon.d.ts +3 -0
  5. package/dist/assets/icons/MinusIcon.d.ts +3 -0
  6. package/dist/assets/icons/NotePencilIcon.d.ts +3 -0
  7. package/dist/assets/icons/PlusIcon.d.ts +3 -0
  8. package/dist/assets/icons/TrashIcon.d.ts +3 -0
  9. package/dist/assets/icons/UserIcon.d.ts +3 -0
  10. package/dist/components/common/AdvancedList/components/AdvancedListItem/AdvancedListItem.types.d.ts +106 -0
  11. package/dist/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemLeading.d.ts +12 -0
  12. package/dist/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemTrailing.d.ts +7 -0
  13. package/dist/components/common/AdvancedList/components/AdvancedListItem/hooks/usePrefersReducedMotion.d.ts +2 -0
  14. package/dist/components/common/AdvancedList/components/AdvancedListItem/index.d.ts +4 -0
  15. package/dist/components/common/AdvancedList/index.d.ts +11 -0
  16. package/dist/components/common/Button/index.d.ts +13 -3
  17. package/dist/components/common/SelectableCardList/components/SelectableCardListItem.d.ts +4 -1
  18. package/dist/components/common/SelectableCardList/index.d.ts +4 -1
  19. package/dist/components/common/Tooltip/index.d.ts +20 -0
  20. package/dist/library/icons.d.ts +9 -1
  21. package/dist/library/index.d.ts +5 -0
  22. package/dist/library/types.d.ts +2 -1
  23. package/dist/registrucentras-rc-ses-react-components.cjs +1 -1
  24. package/dist/registrucentras-rc-ses-react-components.js +4107 -3246
  25. package/dist/stories/components/actions/Button.stories.d.ts +4 -3
  26. package/dist/stories/components/display/AdvancedList.stories.d.ts +32 -0
  27. package/dist/stories/components/display/AdvancedListItem.stories.d.ts +33 -0
  28. package/dist/stories/components/display/SelectableCardList.stories.d.ts +8 -1
  29. package/dist/stories/components/display/Tooltip.stories.d.ts +48 -0
  30. package/dist/stories/components/inputs/DatePicker.stories.d.ts +23 -0
  31. package/dist/stories/components/loaders/LoadingSpinner.stories.d.ts +3 -3
  32. package/dist/stories/components/overlays/Dialog.stories.d.ts +6 -0
  33. package/dist/stories/components/overlays/Popover.stories.d.ts +12 -0
  34. package/dist/stories/theme/ThemedMuiComponents.stories.d.ts +25 -0
  35. package/dist/theme/light/MuiTooltip.d.ts +3 -0
  36. package/dist/theme/motion.d.ts +16 -0
  37. package/package.json +2 -1
  38. package/src/assets/icons/CaretUpBoldIcon.tsx +17 -0
  39. package/src/assets/icons/CaretUpIcon.tsx +9 -0
  40. package/src/assets/icons/ListIcon.tsx +17 -0
  41. package/src/assets/icons/MinusIcon.tsx +9 -0
  42. package/src/assets/icons/NotePencilIcon.tsx +9 -0
  43. package/src/assets/icons/PlusIcon.tsx +9 -0
  44. package/src/assets/icons/TrashIcon.tsx +23 -0
  45. package/src/assets/icons/UserIcon.tsx +17 -0
  46. package/src/components/common/AdvancedList/components/AdvancedListItem/AdvancedListItem.types.ts +100 -0
  47. package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemLeading.tsx +224 -0
  48. package/src/components/common/AdvancedList/components/AdvancedListItem/components/AdvancedListItemTrailing.tsx +263 -0
  49. package/src/components/common/AdvancedList/components/AdvancedListItem/hooks/usePrefersReducedMotion.test.ts +80 -0
  50. package/src/components/common/AdvancedList/components/AdvancedListItem/hooks/usePrefersReducedMotion.ts +28 -0
  51. package/src/components/common/AdvancedList/components/AdvancedListItem/index.test.tsx +631 -0
  52. package/src/components/common/AdvancedList/components/AdvancedListItem/index.tsx +332 -0
  53. package/src/components/common/AdvancedList/index.test.tsx +97 -0
  54. package/src/components/common/AdvancedList/index.tsx +52 -0
  55. package/src/components/common/Button/index.tsx +15 -1
  56. package/src/components/common/ListWithIcons/components/ListWithIconsItem.tsx +7 -5
  57. package/src/components/common/SelectableCardList/components/SelectableCardListItem.test.tsx +50 -0
  58. package/src/components/common/SelectableCardList/components/SelectableCardListItem.tsx +34 -0
  59. package/src/components/common/SelectableCardList/index.test.tsx +56 -2
  60. package/src/components/common/SelectableCardList/index.tsx +29 -10
  61. package/src/components/common/Tooltip/index.test.tsx +85 -0
  62. package/src/components/common/Tooltip/index.tsx +168 -0
  63. package/src/components/form/inputs/Select/index.test.tsx +102 -0
  64. package/src/components/form/inputs/Select/index.tsx +105 -52
  65. package/src/i18n/namespaces/common/en.json +14 -0
  66. package/src/i18n/namespaces/common/lt.json +14 -0
  67. package/src/library/icons.ts +16 -0
  68. package/src/library/index.ts +5 -0
  69. package/src/library/types.ts +2 -0
  70. package/src/setupTests.ts +7 -1
  71. package/src/stories/components/display/AdvancedList.stories.tsx +529 -0
  72. package/src/stories/components/display/AdvancedListItem.stories.tsx +653 -0
  73. package/src/stories/components/display/SelectableCardList.stories.tsx +19 -0
  74. package/src/stories/components/display/Tooltip.stories.tsx +67 -0
  75. package/src/stories/components/inputs/DatePicker.stories.tsx +36 -1
  76. package/src/stories/components/inputs/Select.stories.tsx +38 -2
  77. package/src/stories/components/overlays/Dialog.stories.tsx +34 -0
  78. package/src/stories/components/overlays/Popover.stories.tsx +65 -0
  79. package/src/stories/theme/ThemedMuiComponents.stories.tsx +177 -0
  80. package/src/theme/light/MuiAutocomplete.ts +3 -1
  81. package/src/theme/light/MuiInputBase.ts +4 -0
  82. package/src/theme/light/MuiTooltip.ts +40 -0
  83. package/src/theme/light/index.tsx +2 -0
  84. package/src/theme/motion.tsx +10 -0
@@ -0,0 +1,529 @@
1
+ import {
2
+ Avatar,
3
+ FormControl,
4
+ FormControlLabel,
5
+ FormLabel,
6
+ Radio,
7
+ RadioGroup,
8
+ Stack,
9
+ TextField,
10
+ } from '@mui/material'
11
+ import type { Meta, StoryObj } from '@storybook/react-vite'
12
+ import { useState } from 'react'
13
+
14
+ import InfoFillIcon from '@/assets/icons/InfoFillIcon'
15
+ import NotePencilIcon from '@/assets/icons/NotePencilIcon'
16
+ import TrashIcon from '@/assets/icons/TrashIcon'
17
+ import UserIcon from '@/assets/icons/UserIcon'
18
+ import AdvancedList, { type AdvancedListItemData } from '@/components/common/AdvancedList'
19
+
20
+ const buildItems = (): AdvancedListItemData[] =>
21
+ Array.from({ length: 8 }, (_, index) => ({
22
+ id: `item-${index + 1}`,
23
+ title: `Service option ${index + 1}`,
24
+ subtitle: index % 2 === 0 ? 'Recommended for most users' : 'Alternative flow',
25
+ }))
26
+
27
+ const meta = {
28
+ title: 'components/display/AdvancedList',
29
+ component: AdvancedList,
30
+ tags: ['autodocs'],
31
+ args: {
32
+ items: buildItems(),
33
+ error: undefined,
34
+ },
35
+ argTypes: {
36
+ items: {
37
+ control: false,
38
+ },
39
+ error: {
40
+ control: false,
41
+ },
42
+ },
43
+ } satisfies Meta<typeof AdvancedList>
44
+
45
+ export default meta
46
+
47
+ type Story = StoryObj<typeof meta>
48
+
49
+ const MainStory = () => {
50
+ const [selectedId, setSelectedId] = useState('item-1')
51
+
52
+ const items: AdvancedListItemData[] = buildItems().map((item) => ({
53
+ ...item,
54
+ state: selectedId === item.id ? 'selected' : 'rest',
55
+ leading: {
56
+ type: 'radio',
57
+ name: 'service-option',
58
+ checked: selectedId === item.id,
59
+ onChange: () => setSelectedId(item.id),
60
+ },
61
+ }))
62
+
63
+ return <AdvancedList items={items} />
64
+ }
65
+
66
+ export const Main: Story = {
67
+ render: () => <MainStory />,
68
+ }
69
+
70
+ export const Error: Story = {
71
+ args: {
72
+ error: 'Unable to load list items. Please try again.',
73
+ },
74
+ }
75
+
76
+ const OWNER_TYPE_OPTIONS = [
77
+ { id: 'owner-individual', title: 'Savininkas fizinis asmuo' },
78
+ { id: 'owner-legal', title: 'Savininkas juridinis asmuo' },
79
+ ]
80
+
81
+ const KitchenSinkStory = () => {
82
+ const [igaliotojaiChecked, setIgaliotojaiChecked] = useState(false)
83
+ const [signatoryToggle, setSignatoryToggle] = useState(false)
84
+ const [propertyChecked, setPropertyChecked] = useState(true)
85
+
86
+ const items: AdvancedListItemData[] = [
87
+ {
88
+ id: 'igaliotojai',
89
+ title: 'Jonas Jonaitis',
90
+ subtitle: 'a.k. 3850.........',
91
+ state: igaliotojaiChecked ? 'selected' : 'rest',
92
+ leadingMedia: <Avatar sx={{ width: '2rem', height: '2rem' }}>JJ</Avatar>,
93
+ leading: {
94
+ type: 'checkbox',
95
+ checked: igaliotojaiChecked,
96
+ onChange: setIgaliotojaiChecked,
97
+ },
98
+ trailing: {
99
+ type: 'actions',
100
+ actions: [
101
+ { label: 'Keisti', icon: NotePencilIcon, onClick: () => {} },
102
+ { label: 'Pašalinti', icon: TrashIcon, onClick: () => {} },
103
+ ],
104
+ },
105
+ },
106
+ {
107
+ id: 'ja-atstovai-redaguojama',
108
+ title: 'Petras Petraitis',
109
+ subtitle: 'Vadovas',
110
+ leading: { type: 'reorder', onMoveUp: () => {}, onMoveDown: () => {} },
111
+ trailing: {
112
+ type: 'toggle',
113
+ checked: signatoryToggle,
114
+ onChange: setSignatoryToggle,
115
+ },
116
+ },
117
+ {
118
+ id: 'ja-atstovai-perziura',
119
+ title: 'Ona Onaitė',
120
+ subtitle: 'a.k. 3850.........',
121
+ trailing: { type: 'status', label: 'Laukiama parašo', color: 'warning' },
122
+ },
123
+ {
124
+ id: 'pasirenkamas-sarasas',
125
+ title: 'Nekilnojamasis daiktas',
126
+ subtitle: 'Unikalus Nr. 4400.....',
127
+ state: propertyChecked ? 'selected' : 'rest',
128
+ leading: {
129
+ type: 'checkbox',
130
+ checked: propertyChecked,
131
+ onChange: setPropertyChecked,
132
+ },
133
+ },
134
+ {
135
+ id: 'krepselis',
136
+ title: 'NTR išrašas (objekto)',
137
+ subtitle: 'Elektroninis dokumentas (PDF)',
138
+ trailing: { type: 'price', amount: '12,00 €', caption: 'su PVM' },
139
+ },
140
+ ]
141
+
142
+ return <AdvancedList items={items} />
143
+ }
144
+
145
+ export const KitchenSink: Story = {
146
+ name: 'Presetai: 5 realūs naudojimo atvejai',
147
+ render: () => <KitchenSinkStory />,
148
+ }
149
+
150
+ const OwnerTypeExpandStory = () => {
151
+ const [ownerTypeId, setOwnerTypeId] = useState(OWNER_TYPE_OPTIONS[0].id)
152
+ const [declaration, setDeclaration] = useState('yes')
153
+
154
+ const items: AdvancedListItemData[] = OWNER_TYPE_OPTIONS.map((option) => ({
155
+ id: option.id,
156
+ title: option.title,
157
+ state: ownerTypeId === option.id ? 'selected' : 'rest',
158
+ leading: {
159
+ type: 'radio',
160
+ name: 'owner-type',
161
+ checked: ownerTypeId === option.id,
162
+ onChange: () => setOwnerTypeId(option.id),
163
+ },
164
+ expanded: ownerTypeId === option.id,
165
+ expandedContent:
166
+ option.id === 'owner-legal' ? (
167
+ <Stack sx={{ gap: 1.5 }}>
168
+ <TextField label='Įmonės pavadinimas' size='small' />
169
+ <TextField label='Įmonės kodas' size='small' />
170
+ <TextField label='Adresas' size='small' />
171
+ <FormControl>
172
+ <FormLabel id='declaration-label'>Deklaracija teikiama</FormLabel>
173
+ <RadioGroup
174
+ aria-labelledby='declaration-label'
175
+ value={declaration}
176
+ onChange={(e) => setDeclaration(e.target.value)}
177
+ >
178
+ <FormControlLabel value='yes' control={<Radio />} label='Taip' />
179
+ <FormControlLabel value='no' control={<Radio />} label='Ne' />
180
+ </RadioGroup>
181
+ </FormControl>
182
+ </Stack>
183
+ ) : undefined,
184
+ }))
185
+
186
+ return <AdvancedList items={items} />
187
+ }
188
+
189
+ export const OwnerTypeExpand: Story = {
190
+ name: 'Preset: savininko tipas (radio + expand)',
191
+ render: () => <OwnerTypeExpandStory />,
192
+ }
193
+
194
+ const FigmaAnatomyStory = () => {
195
+ const [selectedId, setSelectedId] = useState<string | null>(null)
196
+
197
+ const items: AdvancedListItemData[] = ['anatomy-1', 'anatomy-2', 'anatomy-3'].map(
198
+ (id) => ({
199
+ id,
200
+ title: 'Įrašo pavadinimas',
201
+ label: 'Label',
202
+ subtitle: 'a.k. 3850.........',
203
+ metaItems: [
204
+ { icon: InfoFillIcon, text: 'Meta info 1' },
205
+ { icon: InfoFillIcon, text: 'Meta info 2' },
206
+ { icon: InfoFillIcon, text: 'Meta info 3' },
207
+ ],
208
+ state: selectedId === id ? 'selected' : 'rest',
209
+ leading: {
210
+ type: 'radio',
211
+ name: 'anatomy-demo',
212
+ checked: selectedId === id,
213
+ onChange: () => setSelectedId(id),
214
+ },
215
+ trailing: {
216
+ type: 'actions',
217
+ actions: [
218
+ { label: 'Keisti', icon: NotePencilIcon, onClick: () => {} },
219
+ { label: 'Pašalinti', icon: TrashIcon, onClick: () => {} },
220
+ ],
221
+ },
222
+ expanded: selectedId === id,
223
+ expandedContent: 'Išplėstas turinys — pakeiskite čia (pvz. JA atstovų sąrašas)',
224
+ }),
225
+ )
226
+
227
+ return <AdvancedList items={items} />
228
+ }
229
+
230
+ export const FigmaAnatomy: Story = {
231
+ name: 'Anatomija: Leading × Trailing × Label × Meta × Expand',
232
+ render: () => <FigmaAnatomyStory />,
233
+ }
234
+
235
+ const LeadingOptionsStory = () => {
236
+ const [checked, setChecked] = useState(false)
237
+ const [selected, setSelected] = useState(false)
238
+
239
+ const items: AdvancedListItemData[] = [
240
+ {
241
+ id: 'leading-none',
242
+ title: 'Nėra',
243
+ subtitle: 'Show-leading: nėra (leading praleistas)',
244
+ },
245
+ {
246
+ id: 'leading-reorder-both',
247
+ title: 'Reorder (abu)',
248
+ subtitle: 'Show-leading: reorder-both',
249
+ leading: { type: 'reorder', onMoveUp: () => {}, onMoveDown: () => {} },
250
+ },
251
+ {
252
+ id: 'leading-reorder-up',
253
+ title: 'Reorder (aukštyn)',
254
+ subtitle: 'Show-leading: reorder-up',
255
+ leading: { type: 'reorder', onMoveUp: () => {} },
256
+ },
257
+ {
258
+ id: 'leading-reorder-down',
259
+ title: 'Reorder (žemyn)',
260
+ subtitle: 'Show-leading: reorder-down',
261
+ leading: { type: 'reorder', onMoveDown: () => {} },
262
+ },
263
+ {
264
+ id: 'leading-checkbox',
265
+ title: 'Checkbox',
266
+ subtitle: 'Show-leading: checkbox',
267
+ leading: { type: 'checkbox', checked, onChange: setChecked },
268
+ },
269
+ {
270
+ id: 'leading-radio',
271
+ title: 'Radio',
272
+ subtitle: 'Show-leading: radio',
273
+ leading: { type: 'radio', checked: selected, onChange: setSelected },
274
+ },
275
+ {
276
+ id: 'leading-drag',
277
+ title: 'Drag',
278
+ subtitle: 'Show-leading: drag',
279
+ leading: { type: 'drag', 'aria-label': 'Vilkti ir pertvarkyti' },
280
+ },
281
+ {
282
+ id: 'leading-icon',
283
+ title: 'Icon',
284
+ subtitle: 'Show-leading: icon',
285
+ leading: { type: 'icon', icon: UserIcon, 'aria-label': 'Naudotojas' },
286
+ },
287
+ {
288
+ id: 'leading-avatar',
289
+ title: 'Avatar',
290
+ subtitle: 'Show-leading: avatar',
291
+ leading: { type: 'avatar', initials: 'JP' },
292
+ },
293
+ {
294
+ id: 'leading-index',
295
+ title: 'Index',
296
+ subtitle: 'Show-leading: index',
297
+ leading: { type: 'index', index: 1 },
298
+ },
299
+ ]
300
+
301
+ return <AdvancedList items={items} />
302
+ }
303
+
304
+ export const LeadingOptions: Story = {
305
+ name: 'Kitchen sink: visos Leading parinktys (paginuota)',
306
+ render: () => <LeadingOptionsStory />,
307
+ }
308
+
309
+ const TrailingOptionsStory = () => {
310
+ const [toggleChecked, setToggleChecked] = useState(false)
311
+ const [checkboxChecked, setCheckboxChecked] = useState(false)
312
+ const [radioChecked, setRadioChecked] = useState(false)
313
+ const [stepperValue, setStepperValue] = useState(1)
314
+
315
+ const items: AdvancedListItemData[] = [
316
+ {
317
+ id: 'trailing-none',
318
+ title: 'Nėra',
319
+ subtitle: 'Show-trailing: nėra (trailing praleistas)',
320
+ },
321
+ {
322
+ id: 'trailing-actions',
323
+ title: 'Actions',
324
+ subtitle: 'Show-trailing: actions',
325
+ trailing: {
326
+ type: 'actions',
327
+ actions: [
328
+ { label: 'Keisti', icon: NotePencilIcon, onClick: () => {} },
329
+ { label: 'Pašalinti', icon: TrashIcon, onClick: () => {} },
330
+ ],
331
+ },
332
+ },
333
+ {
334
+ id: 'trailing-toggle',
335
+ title: 'Toggle',
336
+ subtitle: 'Show-trailing: toggle',
337
+ trailing: { type: 'toggle', checked: toggleChecked, onChange: setToggleChecked },
338
+ },
339
+ {
340
+ id: 'trailing-status',
341
+ title: 'Status',
342
+ subtitle: 'Show-trailing: status',
343
+ trailing: { type: 'status', label: 'Laukiama parašo', color: 'warning' },
344
+ },
345
+ {
346
+ id: 'trailing-checkbox',
347
+ title: 'Checkbox',
348
+ subtitle: 'Show-trailing: checkbox',
349
+ trailing: {
350
+ type: 'checkbox',
351
+ checked: checkboxChecked,
352
+ onChange: setCheckboxChecked,
353
+ },
354
+ },
355
+ {
356
+ id: 'trailing-radio',
357
+ title: 'Radio',
358
+ subtitle: 'Show-trailing: radio',
359
+ trailing: { type: 'radio', checked: radioChecked, onChange: setRadioChecked },
360
+ },
361
+ {
362
+ id: 'trailing-chevron',
363
+ title: 'Chevron',
364
+ subtitle: 'Show-trailing: chevron',
365
+ trailing: { type: 'chevron' },
366
+ onClick: () => console.log('Chevron row clicked — navigate to details'),
367
+ },
368
+ {
369
+ id: 'trailing-price',
370
+ title: 'Price',
371
+ subtitle: 'Show-trailing: price',
372
+ trailing: { type: 'price', amount: '12,00 €', caption: 'su PVM' },
373
+ },
374
+ {
375
+ id: 'trailing-stepper',
376
+ title: 'Stepper',
377
+ subtitle: 'Show-trailing: stepper',
378
+ trailing: {
379
+ type: 'stepper',
380
+ value: stepperValue,
381
+ onChange: setStepperValue,
382
+ min: 0,
383
+ 'aria-label': 'Kiekis',
384
+ },
385
+ },
386
+ ]
387
+
388
+ return <AdvancedList items={items} />
389
+ }
390
+
391
+ export const TrailingOptions: Story = {
392
+ name: 'Kitchen sink: visos Trailing parinktys (paginuota)',
393
+ render: () => <TrailingOptionsStory />,
394
+ }
395
+
396
+ const STATE_VARIANTS = ['rest', 'selected', 'disabled', 'error'] as const
397
+
398
+ const StateShowcaseStory = () => {
399
+ const items: AdvancedListItemData[] = STATE_VARIANTS.map((state) => ({
400
+ id: `state-${state}`,
401
+ title: 'Pavyzdys',
402
+ state,
403
+ leading: { type: 'radio', checked: state === 'selected', onChange: () => {} },
404
+ trailing: {
405
+ type: 'actions',
406
+ actions: [
407
+ { label: 'Keisti', icon: NotePencilIcon, onClick: () => {} },
408
+ { label: 'Pašalinti', icon: TrashIcon, onClick: () => {} },
409
+ ],
410
+ },
411
+ }))
412
+
413
+ return <AdvancedList items={items} />
414
+ }
415
+
416
+ export const StateShowcase: Story = {
417
+ name: 'Kitchen sink: visi state (rest/selected/disabled/error)',
418
+ render: () => <StateShowcaseStory />,
419
+ }
420
+
421
+ const UNIVERSAL_PRESET_OPTIONS = [
422
+ { id: 'with-name', title: 'Rodyti su asmens vardu, pavarde ir gimimo data' },
423
+ {
424
+ id: 'anonymised',
425
+ title: 'Nuasmenintas (be asmens vardo, pavardės, gimimo datos ir asmens kodo)',
426
+ },
427
+ ]
428
+
429
+ const UniversalPresetListStory = () => {
430
+ const [selectedId, setSelectedId] = useState(UNIVERSAL_PRESET_OPTIONS[0].id)
431
+
432
+ const items: AdvancedListItemData[] = UNIVERSAL_PRESET_OPTIONS.map((option) => ({
433
+ ...option,
434
+ state: selectedId === option.id ? 'selected' : 'rest',
435
+ leading: {
436
+ type: 'radio',
437
+ name: 'universal-preset',
438
+ checked: selectedId === option.id,
439
+ onChange: () => setSelectedId(option.id),
440
+ },
441
+ }))
442
+
443
+ return <AdvancedList items={items} />
444
+ }
445
+
446
+ export const UniversalPresetList: Story = {
447
+ name: 'Preset: pasirenkamų radijo eilučių sąrašas (universalus)',
448
+ render: () => <UniversalPresetListStory />,
449
+ }
450
+
451
+ const PAYMENT_TILE_BANKS = [
452
+ { id: 'swedbank', title: 'Swedbank', initials: 'SW' },
453
+ { id: 'seb', title: 'SEB bankas', initials: 'SE' },
454
+ { id: 'luminor', title: 'Luminor', initials: 'Lu' },
455
+ ]
456
+
457
+ const PaymentTileListStory = () => {
458
+ const [paymentMethodId, setPaymentMethodId] = useState(PAYMENT_TILE_BANKS[0].id)
459
+
460
+ const items: AdvancedListItemData[] = PAYMENT_TILE_BANKS.map((bank) => ({
461
+ id: bank.id,
462
+ title: bank.title,
463
+ state: paymentMethodId === bank.id ? 'selected' : 'rest',
464
+ leadingMedia: (
465
+ <Avatar
466
+ variant='rounded'
467
+ sx={{ width: '2rem', height: '2rem', bgcolor: 'grey.200', color: 'grey.700' }}
468
+ >
469
+ {bank.initials}
470
+ </Avatar>
471
+ ),
472
+ leading: {
473
+ type: 'radio',
474
+ name: 'payment-method',
475
+ checked: paymentMethodId === bank.id,
476
+ onChange: () => setPaymentMethodId(bank.id),
477
+ },
478
+ }))
479
+
480
+ return <AdvancedList items={items} />
481
+ }
482
+
483
+ export const PaymentTileList: Story = {
484
+ name: 'Preset: Payment tile (Card + Radio + Leading-media logo)',
485
+ render: () => <PaymentTileListStory />,
486
+ }
487
+
488
+ const CART_ITEMS_SOURCE = [
489
+ {
490
+ id: 'ntr-israsas',
491
+ title: 'NTR išrašas (objekto)',
492
+ subtitle: 'Reg. Nr. 4400-1234-5678',
493
+ amount: '12,00 €',
494
+ },
495
+ {
496
+ id: 'jar-israsas',
497
+ title: 'JAR išrašas',
498
+ subtitle: 'Įmonės kodas 300000000',
499
+ amount: '8,00 €',
500
+ },
501
+ {
502
+ id: 'kadastro-israsas',
503
+ title: 'Kadastro žemėlapio ištrauka',
504
+ subtitle: 'Reg. Nr. 4400-9876-5432',
505
+ amount: '5,00 €',
506
+ },
507
+ ]
508
+
509
+ const CartWithDeleteListStory = () => {
510
+ const items: AdvancedListItemData[] = CART_ITEMS_SOURCE.map((item) => ({
511
+ id: item.id,
512
+ title: item.title,
513
+ subtitle: item.subtitle,
514
+ trailing: {
515
+ type: 'price',
516
+ amount: item.amount,
517
+ caption: 'su PVM',
518
+ onDelete: () => {},
519
+ deleteAriaLabel: `Pašalinti "${item.title}" iš krepšelio`,
520
+ },
521
+ }))
522
+
523
+ return <AdvancedList items={items} />
524
+ }
525
+
526
+ export const CartWithDeleteList: Story = {
527
+ name: 'Preset: Krepšelis (su trynimu)',
528
+ render: () => <CartWithDeleteListStory />,
529
+ }