@registrucentras/rc-ses-react-components 1.8.0 → 1.9.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/dist/components/loaders/FullPageLoader/index.d.ts +9 -0
- package/dist/components/loaders/Loader/index.d.ts +26 -0
- package/dist/library/index.d.ts +4 -2
- package/dist/library/types.d.ts +4 -2
- package/dist/registrucentras-rc-ses-react-components.cjs +8 -8
- package/dist/registrucentras-rc-ses-react-components.js +1365 -1271
- package/dist/stories/components/loaders/FullPageLoader.stories.d.ts +37 -0
- package/dist/stories/components/loaders/Loader.stories.d.ts +36 -0
- package/dist/stories/components/{spinner → loaders}/LoadingSpinner.stories.d.ts +4 -4
- package/package.json +1 -1
- package/src/components/common/Button/index.tsx +1 -3
- package/src/components/common/Snackbar/index.test.tsx +10 -4
- package/src/components/form/inputs/CheckboxFormControl.test.tsx +11 -7
- package/src/components/loaders/FullPageLoader/index.test.tsx +80 -0
- package/src/components/loaders/FullPageLoader/index.tsx +68 -0
- package/src/components/loaders/Loader/index.test.tsx +58 -0
- package/src/components/loaders/Loader/index.tsx +65 -0
- package/src/components/{LoadingSpinner/LoadingSpinner.test.tsx → loaders/LoadingSpinner/index.test.tsx} +1 -1
- package/src/components/{LoadingSpinner/LoadingSpinner.tsx → loaders/LoadingSpinner/index.tsx} +1 -1
- package/src/components/overlays/Dialog/index.test.tsx +1 -1
- package/src/i18n/namespaces/common/en.json +3 -0
- package/src/i18n/namespaces/common/lt.json +3 -0
- package/src/library/index.ts +5 -1
- package/src/library/types.ts +13 -4
- package/src/setupTests.ts +13 -0
- package/src/stories/components/loaders/FullPageLoader.stories.tsx +126 -0
- package/src/stories/components/loaders/Loader.stories.tsx +76 -0
- package/src/stories/components/{spinner → loaders}/LoadingSpinner.stories.tsx +2 -2
- /package/dist/components/{LoadingSpinner/LoadingSpinner.d.ts → loaders/LoadingSpinner/index.d.ts} +0 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Box, Stack } from '@mui/material'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
+
|
|
4
|
+
import RcSesFullPageLoader from '@/components/loaders/FullPageLoader'
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'components/loaders/FullPageLoader/FullPageLoader',
|
|
8
|
+
component: RcSesFullPageLoader,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
parameters: {
|
|
11
|
+
controls: {
|
|
12
|
+
include: ['backdrop', 'label', 'showLabel'],
|
|
13
|
+
},
|
|
14
|
+
docs: {
|
|
15
|
+
story: {
|
|
16
|
+
inline: false,
|
|
17
|
+
height: 400,
|
|
18
|
+
},
|
|
19
|
+
description: {
|
|
20
|
+
component:
|
|
21
|
+
'Full-page loader overlay built on top of RcSesLoader with two backdrop variants: dark and light.',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
argTypes: {
|
|
26
|
+
backdrop: {
|
|
27
|
+
control: 'radio',
|
|
28
|
+
options: ['dark', 'light'],
|
|
29
|
+
},
|
|
30
|
+
label: {
|
|
31
|
+
control: 'text',
|
|
32
|
+
},
|
|
33
|
+
showLabel: {
|
|
34
|
+
control: 'boolean',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
} satisfies Meta<typeof RcSesFullPageLoader>
|
|
38
|
+
|
|
39
|
+
export default meta
|
|
40
|
+
|
|
41
|
+
type Story = StoryObj<typeof meta>
|
|
42
|
+
|
|
43
|
+
const FULL_PAGE_LOADER_USAGE_EXAMPLE =
|
|
44
|
+
"<RcSesFullPageLoader label='Kraunama...' showLabel />"
|
|
45
|
+
|
|
46
|
+
const FULL_PAGE_LOADER_DARK_USAGE_EXAMPLE =
|
|
47
|
+
"<RcSesFullPageLoader backdrop='dark' label='Kraunama...' showLabel />"
|
|
48
|
+
|
|
49
|
+
function PageMock() {
|
|
50
|
+
return (
|
|
51
|
+
<Stack spacing={2} sx={{ p: 4 }}>
|
|
52
|
+
<Box
|
|
53
|
+
sx={{ backgroundColor: 'grey.200', borderRadius: 1, height: 12, width: '35%' }}
|
|
54
|
+
/>
|
|
55
|
+
<Box
|
|
56
|
+
sx={{ backgroundColor: 'grey.200', borderRadius: 1, height: 12, width: '48%' }}
|
|
57
|
+
/>
|
|
58
|
+
<Box
|
|
59
|
+
sx={{ backgroundColor: 'grey.200', borderRadius: 1, height: 12, width: '42%' }}
|
|
60
|
+
/>
|
|
61
|
+
<Box
|
|
62
|
+
sx={{
|
|
63
|
+
backgroundColor: 'grey.200',
|
|
64
|
+
borderRadius: 1,
|
|
65
|
+
height: 112,
|
|
66
|
+
mt: 1,
|
|
67
|
+
width: '100%',
|
|
68
|
+
}}
|
|
69
|
+
/>
|
|
70
|
+
<Box
|
|
71
|
+
sx={{ backgroundColor: 'grey.200', borderRadius: 1, height: 88, width: '100%' }}
|
|
72
|
+
/>
|
|
73
|
+
<Box
|
|
74
|
+
sx={{ backgroundColor: 'grey.200', borderRadius: 1, height: 56, width: '65%' }}
|
|
75
|
+
/>
|
|
76
|
+
</Stack>
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const renderPreview: Story['render'] = (args) => (
|
|
81
|
+
<Stack spacing={1.5} sx={{ width: '100%' }}>
|
|
82
|
+
<Box
|
|
83
|
+
sx={{
|
|
84
|
+
backgroundColor: '#f4f6f8',
|
|
85
|
+
borderRadius: 1,
|
|
86
|
+
minHeight: 360,
|
|
87
|
+
overflow: 'hidden',
|
|
88
|
+
position: 'relative',
|
|
89
|
+
width: '100%',
|
|
90
|
+
}}
|
|
91
|
+
>
|
|
92
|
+
<PageMock />
|
|
93
|
+
<RcSesFullPageLoader {...args} />
|
|
94
|
+
</Box>
|
|
95
|
+
</Stack>
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
export const Default: Story = {
|
|
99
|
+
render: renderPreview,
|
|
100
|
+
parameters: {
|
|
101
|
+
docs: {
|
|
102
|
+
source: {
|
|
103
|
+
code: FULL_PAGE_LOADER_USAGE_EXAMPLE,
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
args: {
|
|
108
|
+
label: 'Kraunama...',
|
|
109
|
+
showLabel: true,
|
|
110
|
+
},
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export const DarkBackdrop: Story = {
|
|
114
|
+
render: renderPreview,
|
|
115
|
+
parameters: {
|
|
116
|
+
docs: {
|
|
117
|
+
source: {
|
|
118
|
+
code: FULL_PAGE_LOADER_DARK_USAGE_EXAMPLE,
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
args: {
|
|
123
|
+
backdrop: 'dark',
|
|
124
|
+
label: 'Kraunama...',
|
|
125
|
+
},
|
|
126
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
|
|
3
|
+
import RcSesLoader from '@/components/loaders/Loader'
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'components/loaders/Loader/Loader',
|
|
7
|
+
component: RcSesLoader,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
parameters: {
|
|
10
|
+
controls: {
|
|
11
|
+
include: ['label', 'showLabel', 'size'],
|
|
12
|
+
},
|
|
13
|
+
docs: {
|
|
14
|
+
description: {
|
|
15
|
+
component:
|
|
16
|
+
'Reusable loader built on top of RcSesLoadingSpinner. Supports three standard sizes for inline (small), section (medium), and full-page (large) loading states.',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
argTypes: {
|
|
21
|
+
label: {
|
|
22
|
+
control: 'text',
|
|
23
|
+
},
|
|
24
|
+
showLabel: {
|
|
25
|
+
control: 'boolean',
|
|
26
|
+
},
|
|
27
|
+
size: {
|
|
28
|
+
control: 'radio',
|
|
29
|
+
options: ['small', 'medium', 'large'],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
} satisfies Meta<typeof RcSesLoader>
|
|
33
|
+
|
|
34
|
+
export default meta
|
|
35
|
+
|
|
36
|
+
type Story = StoryObj<typeof meta>
|
|
37
|
+
|
|
38
|
+
export const Default: Story = {
|
|
39
|
+
args: {
|
|
40
|
+
label: 'Kraunama...',
|
|
41
|
+
showLabel: true,
|
|
42
|
+
size: 'medium',
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const Small: Story = {
|
|
47
|
+
args: {
|
|
48
|
+
label: 'Kraunama...',
|
|
49
|
+
showLabel: true,
|
|
50
|
+
size: 'small',
|
|
51
|
+
},
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const Medium: Story = {
|
|
55
|
+
args: {
|
|
56
|
+
label: 'Kraunama...',
|
|
57
|
+
showLabel: true,
|
|
58
|
+
size: 'medium',
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const Large: Story = {
|
|
63
|
+
args: {
|
|
64
|
+
label: 'Kraunama...',
|
|
65
|
+
showLabel: true,
|
|
66
|
+
size: 'large',
|
|
67
|
+
},
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const WithoutLabel: Story = {
|
|
71
|
+
args: {
|
|
72
|
+
label: 'Kraunama...',
|
|
73
|
+
showLabel: false,
|
|
74
|
+
size: 'medium',
|
|
75
|
+
},
|
|
76
|
+
}
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'
|
|
|
2
2
|
|
|
3
3
|
import RcSesLoadingSpinner, {
|
|
4
4
|
RcSesSpinnerColor,
|
|
5
|
-
} from '@/components/
|
|
5
|
+
} from '@/components/loaders/LoadingSpinner'
|
|
6
6
|
|
|
7
7
|
const colorOptions: RcSesSpinnerColor[] = [
|
|
8
8
|
'primary',
|
|
@@ -17,7 +17,7 @@ const colorOptions: RcSesSpinnerColor[] = [
|
|
|
17
17
|
const sizeOptions = ['small', 'medium', 'large']
|
|
18
18
|
|
|
19
19
|
const meta = {
|
|
20
|
-
title: 'components/
|
|
20
|
+
title: 'components/loaders/LoadingSpinner/LoadingSpinner',
|
|
21
21
|
component: RcSesLoadingSpinner,
|
|
22
22
|
parameters: {
|
|
23
23
|
layout: 'centered',
|
/package/dist/components/{LoadingSpinner/LoadingSpinner.d.ts → loaders/LoadingSpinner/index.d.ts}
RENAMED
|
File without changes
|