@registrucentras/rc-ses-react-components 2.4.0 → 2.5.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.
- package/dist/assets/icons/phosphorIcons.d.ts +4 -0
- package/dist/components/common/Badge/index.d.ts +1 -0
- package/dist/components/overlays/Drawer/Drawer.types.d.ts +30 -0
- package/dist/components/overlays/Drawer/index.d.ts +9 -0
- package/dist/library/index.d.ts +2 -1
- package/dist/library/types.d.ts +2 -0
- package/dist/registrucentras-rc-ses-react-components.cjs +1 -1
- package/dist/registrucentras-rc-ses-react-components.js +2054 -1866
- package/package.json +5 -5
- package/src/assets/icons/phosphorIcons.ts +2 -0
- package/src/components/common/AdvancedList/components/AdvancedListItemShell/index.test.tsx +23 -0
- package/src/components/common/AdvancedList/components/AdvancedListItemShell/index.tsx +6 -0
- package/src/components/common/Badge/index.test.tsx +16 -0
- package/src/components/common/Badge/index.tsx +34 -10
- package/src/components/form/inputs/Select/index.tsx +3 -1
- package/src/components/overlays/Drawer/Drawer.types.ts +32 -0
- package/src/components/overlays/Drawer/index.test.tsx +174 -0
- package/src/components/overlays/Drawer/index.tsx +192 -0
- package/src/i18n/namespaces/common/en.json +3 -0
- package/src/i18n/namespaces/common/lt.json +3 -0
- package/src/library/index.ts +2 -0
- package/src/library/types.ts +2 -0
- package/src/stories/atoms/Badge.stories.tsx +40 -0
- package/src/stories/atoms/Icons.stories.tsx +133 -226
- package/src/stories/foundations/ThemedMuiComponents.stories.tsx +31 -0
- package/src/stories/organisms/AdvancedListItemShell.stories.tsx +93 -3
- package/src/stories/organisms/Drawer.stories.tsx +90 -0
- package/src/theme/light/MuiAutocomplete.ts +5 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Stack, Typography } from '@mui/material'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
3
|
+
import { useState } from 'react'
|
|
4
|
+
|
|
5
|
+
import RcSesButton from '@/components/common/Button'
|
|
6
|
+
import RcSesDrawer from '@/components/overlays/Drawer'
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Organisms/Drawer',
|
|
10
|
+
component: RcSesDrawer,
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
argTypes: {
|
|
13
|
+
children: { control: false },
|
|
14
|
+
onClose: { control: false },
|
|
15
|
+
onPrimaryAction: { control: false },
|
|
16
|
+
onSecondaryAction: { control: false },
|
|
17
|
+
},
|
|
18
|
+
args: {
|
|
19
|
+
title: 'Filtrai',
|
|
20
|
+
secondaryActionLabel: 'Išvalyti',
|
|
21
|
+
primaryActionLabel: 'Rodyti paslaugas',
|
|
22
|
+
children: (
|
|
23
|
+
<Stack sx={{ gap: '1rem' }}>
|
|
24
|
+
<Typography variant='body2'>
|
|
25
|
+
Turinys (slot) - filtrai, paieška, sąrašas
|
|
26
|
+
</Typography>
|
|
27
|
+
</Stack>
|
|
28
|
+
),
|
|
29
|
+
},
|
|
30
|
+
} satisfies Meta<typeof RcSesDrawer>
|
|
31
|
+
|
|
32
|
+
export default meta
|
|
33
|
+
|
|
34
|
+
type Story = StoryObj<typeof meta>
|
|
35
|
+
|
|
36
|
+
export const Default: Story = {
|
|
37
|
+
args: {
|
|
38
|
+
isOpen: true,
|
|
39
|
+
onClose: () => {},
|
|
40
|
+
},
|
|
41
|
+
render: (args) => {
|
|
42
|
+
const [isOpen, setIsOpen] = useState(true)
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div
|
|
46
|
+
style={{
|
|
47
|
+
display: 'flex',
|
|
48
|
+
flexDirection: 'column',
|
|
49
|
+
justifyContent: 'center',
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
}}
|
|
52
|
+
>
|
|
53
|
+
<RcSesButton variant='contained' onClick={() => setIsOpen(true)}>
|
|
54
|
+
Open Drawer
|
|
55
|
+
</RcSesButton>
|
|
56
|
+
<RcSesDrawer {...args} isOpen={isOpen} onClose={() => setIsOpen(false)} />
|
|
57
|
+
</div>
|
|
58
|
+
)
|
|
59
|
+
},
|
|
60
|
+
parameters: {
|
|
61
|
+
docs: {
|
|
62
|
+
description: {
|
|
63
|
+
story:
|
|
64
|
+
'Basic drawer that slides in from the right. Use the trigger button to open; close with the close button, Escape key, or backdrop click. Footer action buttons are optional and configurable via primaryActionLabel/onPrimaryAction and secondaryActionLabel/onSecondaryAction. Supports keyboard navigation (Tab/Shift+Tab focus trap, Esc to close).',
|
|
65
|
+
},
|
|
66
|
+
source: {
|
|
67
|
+
code: `const [isOpen, setIsOpen] = useState(true)
|
|
68
|
+
|
|
69
|
+
<div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center' }}>
|
|
70
|
+
<RcSesButton variant='contained' onClick={() => setIsOpen(true)}>
|
|
71
|
+
Open Drawer
|
|
72
|
+
</RcSesButton>
|
|
73
|
+
<RcSesDrawer
|
|
74
|
+
isOpen={isOpen}
|
|
75
|
+
onClose={() => setIsOpen(false)}
|
|
76
|
+
title='Filtrai'
|
|
77
|
+
secondaryActionLabel='Išvalyti'
|
|
78
|
+
primaryActionLabel='Rodyti paslaugas'
|
|
79
|
+
>
|
|
80
|
+
<Stack sx={{ gap: '1rem' }}>
|
|
81
|
+
<Typography variant='body2'>
|
|
82
|
+
Turinys (slot) - filtrai, paieška, sąrašas
|
|
83
|
+
</Typography>
|
|
84
|
+
</Stack>
|
|
85
|
+
</RcSesDrawer>
|
|
86
|
+
</div>`,
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
}
|
|
@@ -48,8 +48,12 @@ const MuiAutocomplete: Components['MuiAutocomplete'] = {
|
|
|
48
48
|
textTransform: 'none',
|
|
49
49
|
},
|
|
50
50
|
|
|
51
|
+
// Options stack as a column here, so alignItems is the horizontal
|
|
52
|
+
// axis: 'center' would centre the text of every consumer's
|
|
53
|
+
// Autocomplete. Components that lay options out as a row (Select,
|
|
54
|
+
// PhoneInput) set their own vertical centring.
|
|
51
55
|
'.MuiAutocomplete-option': {
|
|
52
|
-
alignItems: '
|
|
56
|
+
alignItems: 'flex-start',
|
|
53
57
|
backgroundColor: 'transparent',
|
|
54
58
|
borderRadius: 0,
|
|
55
59
|
color: palette.grey['900'],
|