@registrucentras/rc-ses-react-components 1.6.6 → 1.7.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/SearchHelpIcon.d.ts +3 -0
- package/dist/assets/icons/SearchXIcon.d.ts +3 -0
- package/dist/components/common/Breadcrumbs/index.d.ts +3 -1
- package/dist/components/common/Snackbar/SnackbarProvider.d.ts +22 -0
- package/dist/components/common/Snackbar/config.d.ts +22 -0
- package/dist/components/common/Snackbar/index.d.ts +16 -0
- package/dist/components/common/Snackbar/types.d.ts +2 -0
- package/dist/components/form/inputs/CheckboxFormControl.d.ts +2 -0
- package/dist/components/form/inputs/FormControlLabel.d.ts +10 -0
- package/dist/components/form/inputs/SimpleCheckbox.d.ts +6 -0
- package/dist/components/layout/ServiceHeader.d.ts +3 -2
- package/dist/components/utils/loading.d.ts +3 -0
- package/dist/library/icons.d.ts +4 -1
- package/dist/library/index.d.ts +9 -2
- package/dist/library/types.d.ts +3 -1
- package/dist/registrucentras-rc-ses-react-components.cjs +10 -27
- package/dist/registrucentras-rc-ses-react-components.js +3190 -2784
- package/dist/stories/components/actions/Button.stories.d.ts +5 -0
- package/dist/stories/components/{SelectableCardList.stories.d.ts → display/SelectableCardList.stories.d.ts} +1 -1
- package/dist/stories/components/feedback/Snackbar.stories.d.ts +143 -0
- package/dist/stories/components/form/CheckboxFormControl.stories.d.ts +3 -0
- package/dist/stories/components/form/SimpleCheckbox.stories.d.ts +19 -0
- package/dist/stories/components/layout/ServiceHeader.stories.d.ts +1 -0
- package/dist/theme/light/index.d.ts +6 -0
- package/dist/theme/palette.d.ts +9 -1
- package/package.json +1 -1
- package/src/assets/icons/CheckIcon.tsx +1 -1
- package/src/assets/icons/SearchHelpIcon.tsx +44 -0
- package/src/assets/icons/SearchXIcon.tsx +41 -0
- package/src/components/common/Breadcrumbs/index.tsx +4 -3
- package/src/components/common/ListWithIcons/components/ListWithIconsItem.tsx +5 -3
- package/src/components/common/ListWithIcons/index.tsx +1 -1
- package/src/components/common/SelectableCardList/components/SelectableCardListItem.tsx +3 -1
- package/src/components/common/Snackbar/SnackbarProvider.tsx +78 -0
- package/src/components/common/Snackbar/config.ts +82 -0
- package/src/components/common/Snackbar/index.test.tsx +119 -0
- package/src/components/common/Snackbar/index.tsx +196 -0
- package/src/components/common/Snackbar/types.ts +2 -0
- package/src/components/form/inputs/Checkbox.tsx +2 -2
- package/src/components/form/inputs/CheckboxFormControl.test.tsx +68 -0
- package/src/components/form/inputs/CheckboxFormControl.tsx +48 -29
- package/src/components/form/inputs/FormControlLabel.tsx +36 -0
- package/src/components/form/inputs/SimpleCheckbox.tsx +23 -0
- package/src/components/layout/ServiceHeader.tsx +21 -9
- package/src/components/utils/loading.tsx +9 -0
- package/src/i18n/namespaces/input/en.json +6 -0
- package/src/i18n/namespaces/input/lt.json +6 -0
- package/src/library/icons.ts +6 -0
- package/src/library/index.ts +13 -1
- package/src/library/types.ts +9 -1
- package/src/stories/Colors.mdx +127 -0
- package/src/stories/components/actions/Button.stories.tsx +130 -0
- package/src/stories/components/{SelectableCardList.stories.tsx → display/SelectableCardList.stories.tsx} +36 -19
- package/src/stories/components/feedback/Snackbar.stories.tsx +504 -0
- package/src/stories/components/form/CheckboxFormControl.stories.tsx +312 -2
- package/src/stories/components/form/SimpleCheckbox.stories.tsx +52 -0
- package/src/stories/components/icons/Icons.stories.tsx +35 -0
- package/src/stories/components/layout/ServiceHeader.stories.tsx +36 -8
- package/src/theme/light/MuiButton.tsx +34 -1
- package/src/theme/light/index.tsx +6 -0
- package/src/theme/light/themePalette.tsx +2 -0
- package/src/theme/palette.tsx +11 -1
|
@@ -2,6 +2,8 @@ import { Meta, StoryContext, StoryObj } from '@storybook/react'
|
|
|
2
2
|
import { useForm } from 'react-hook-form'
|
|
3
3
|
|
|
4
4
|
import RcSesCheckboxFormControl from '@/components/form/inputs/CheckboxFormControl'
|
|
5
|
+
import RcSesFormControlLabel from '@/components/form/inputs/FormControlLabel'
|
|
6
|
+
import RcSesSimpleCheckbox from '@/components/form/inputs/SimpleCheckbox'
|
|
5
7
|
import FieldView from '@/components/storybook/FieldView'
|
|
6
8
|
import Fields from '@/components/storybook/Fields'
|
|
7
9
|
|
|
@@ -18,8 +20,19 @@ const meta: Meta<typeof RcSesCheckboxFormControl> = {
|
|
|
18
20
|
defaultValue: { summary: 'outlined' },
|
|
19
21
|
},
|
|
20
22
|
},
|
|
23
|
+
loading: {
|
|
24
|
+
control: 'boolean',
|
|
25
|
+
table: {
|
|
26
|
+
defaultValue: { summary: 'false' },
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
children: {
|
|
30
|
+
control: 'text',
|
|
31
|
+
table: {
|
|
32
|
+
defaultValue: { summary: 'This is body' },
|
|
33
|
+
},
|
|
34
|
+
},
|
|
21
35
|
slotProps: { table: { disable: true } },
|
|
22
|
-
loading: { table: { disable: true } },
|
|
23
36
|
id: { table: { disable: true } },
|
|
24
37
|
errors: { table: { disable: true } },
|
|
25
38
|
onBlur: { table: { disable: true } },
|
|
@@ -42,7 +55,7 @@ export default meta
|
|
|
42
55
|
type Story = StoryObj<typeof RcSesCheckboxFormControl>
|
|
43
56
|
|
|
44
57
|
function CheckboxFormControlDemo(args: any) {
|
|
45
|
-
const { variant, children } = args
|
|
58
|
+
const { variant, children, loading } = args
|
|
46
59
|
const {
|
|
47
60
|
control,
|
|
48
61
|
formState: { errors },
|
|
@@ -62,6 +75,7 @@ function CheckboxFormControlDemo(args: any) {
|
|
|
62
75
|
control={control}
|
|
63
76
|
errors={errors?.agreement}
|
|
64
77
|
variant={variant}
|
|
78
|
+
loading={loading}
|
|
65
79
|
>
|
|
66
80
|
{children}
|
|
67
81
|
</RcSesCheckboxFormControl>
|
|
@@ -105,6 +119,7 @@ export const Main: Story = {
|
|
|
105
119
|
label: 'This is label',
|
|
106
120
|
children: 'This is body',
|
|
107
121
|
variant: 'outlined',
|
|
122
|
+
loading: false,
|
|
108
123
|
},
|
|
109
124
|
parameters: {
|
|
110
125
|
docs: {
|
|
@@ -116,3 +131,298 @@ export const Main: Story = {
|
|
|
116
131
|
},
|
|
117
132
|
},
|
|
118
133
|
}
|
|
134
|
+
|
|
135
|
+
function CheckboxLoadingDemo() {
|
|
136
|
+
const { control } = useForm<FormModel>({
|
|
137
|
+
mode: 'all',
|
|
138
|
+
defaultValues: {
|
|
139
|
+
agreement: '',
|
|
140
|
+
},
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<Fields>
|
|
145
|
+
<FieldView>
|
|
146
|
+
<RcSesCheckboxFormControl
|
|
147
|
+
id='agreement-loading'
|
|
148
|
+
name='agreement'
|
|
149
|
+
control={control}
|
|
150
|
+
loading
|
|
151
|
+
>
|
|
152
|
+
Accept terms and conditions
|
|
153
|
+
</RcSesCheckboxFormControl>
|
|
154
|
+
</FieldView>
|
|
155
|
+
</Fields>
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export const Loading: Story = {
|
|
160
|
+
render: () => <CheckboxLoadingDemo />,
|
|
161
|
+
parameters: {
|
|
162
|
+
docs: {
|
|
163
|
+
description: {
|
|
164
|
+
story: 'Loading state - shows skeleton animation on checkbox and label.',
|
|
165
|
+
},
|
|
166
|
+
source: {
|
|
167
|
+
type: 'code',
|
|
168
|
+
code: `<RcSesCheckboxFormControl
|
|
169
|
+
id='agreement'
|
|
170
|
+
name='agreement'
|
|
171
|
+
control={control}
|
|
172
|
+
loading
|
|
173
|
+
>
|
|
174
|
+
Accept terms and conditions
|
|
175
|
+
</RcSesCheckboxFormControl>`,
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
type IndeterminateFormModel = {
|
|
182
|
+
parent: boolean
|
|
183
|
+
child1: boolean
|
|
184
|
+
child2: boolean
|
|
185
|
+
child3: boolean
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function CheckboxIndeterminateDemo() {
|
|
189
|
+
const { control, watch, setValue } = useForm<IndeterminateFormModel>({
|
|
190
|
+
mode: 'all',
|
|
191
|
+
defaultValues: {
|
|
192
|
+
parent: false,
|
|
193
|
+
child1: false,
|
|
194
|
+
child2: false,
|
|
195
|
+
child3: false,
|
|
196
|
+
},
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
const child1Value = watch('child1')
|
|
200
|
+
const child2Value = watch('child2')
|
|
201
|
+
const child3Value = watch('child3')
|
|
202
|
+
|
|
203
|
+
const childValues = [child1Value, child2Value, child3Value]
|
|
204
|
+
|
|
205
|
+
const handleParentChange = (newChildValues: boolean[]) => {
|
|
206
|
+
setValue('child1', newChildValues[0])
|
|
207
|
+
setValue('child2', newChildValues[1])
|
|
208
|
+
setValue('child3', newChildValues[2])
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return (
|
|
212
|
+
<Fields>
|
|
213
|
+
<FieldView>
|
|
214
|
+
<div>
|
|
215
|
+
<RcSesCheckboxFormControl
|
|
216
|
+
id='parent'
|
|
217
|
+
name='parent'
|
|
218
|
+
control={control}
|
|
219
|
+
variant='flat'
|
|
220
|
+
childValues={childValues}
|
|
221
|
+
onChildValuesChange={handleParentChange}
|
|
222
|
+
>
|
|
223
|
+
<strong>Pasirinkti visus</strong>
|
|
224
|
+
</RcSesCheckboxFormControl>
|
|
225
|
+
<div
|
|
226
|
+
style={{
|
|
227
|
+
paddingLeft: '2rem',
|
|
228
|
+
display: 'flex',
|
|
229
|
+
flexDirection: 'column',
|
|
230
|
+
}}
|
|
231
|
+
>
|
|
232
|
+
<RcSesFormControlLabel
|
|
233
|
+
control={
|
|
234
|
+
<RcSesSimpleCheckbox
|
|
235
|
+
checked={child1Value}
|
|
236
|
+
onChange={(e) => setValue('child1', e.target.checked)}
|
|
237
|
+
/>
|
|
238
|
+
}
|
|
239
|
+
label='Pasirinkimas 1'
|
|
240
|
+
/>
|
|
241
|
+
<RcSesFormControlLabel
|
|
242
|
+
control={
|
|
243
|
+
<RcSesSimpleCheckbox
|
|
244
|
+
checked={child2Value}
|
|
245
|
+
onChange={(e) => setValue('child2', e.target.checked)}
|
|
246
|
+
/>
|
|
247
|
+
}
|
|
248
|
+
label='Pasirinkimas 2'
|
|
249
|
+
/>
|
|
250
|
+
<RcSesFormControlLabel
|
|
251
|
+
control={
|
|
252
|
+
<RcSesSimpleCheckbox
|
|
253
|
+
checked={child3Value}
|
|
254
|
+
onChange={(e) => setValue('child3', e.target.checked)}
|
|
255
|
+
/>
|
|
256
|
+
}
|
|
257
|
+
label='Pasirinkimas 3'
|
|
258
|
+
/>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
</FieldView>
|
|
262
|
+
</Fields>
|
|
263
|
+
)
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export const Indeterminate: Story = {
|
|
267
|
+
render: () => <CheckboxIndeterminateDemo />,
|
|
268
|
+
parameters: {
|
|
269
|
+
docs: {
|
|
270
|
+
description: {
|
|
271
|
+
story:
|
|
272
|
+
'Indeterminate (mixed) status is determined by the state of child checkboxes.',
|
|
273
|
+
},
|
|
274
|
+
source: {
|
|
275
|
+
type: 'code',
|
|
276
|
+
code: `<RcSesCheckboxFormControl
|
|
277
|
+
id='parent'
|
|
278
|
+
variant='flat'
|
|
279
|
+
childValues={[child1, child2, child3]}
|
|
280
|
+
onChildValuesChange={handleParentChange}
|
|
281
|
+
>
|
|
282
|
+
<strong>Pasirinkti visus</strong>
|
|
283
|
+
</RcSesCheckboxFormControl>
|
|
284
|
+
|
|
285
|
+
<div style={{ paddingLeft: '2rem', display: 'flex', flexDirection: 'column' }}>
|
|
286
|
+
<RcSesFormControlLabel
|
|
287
|
+
control={<RcSesSimpleCheckbox checked={child1} onChange={(e) => setChild1(e.target.checked)} />}
|
|
288
|
+
label='Pasirinkimas 1'
|
|
289
|
+
/>
|
|
290
|
+
<RcSesFormControlLabel
|
|
291
|
+
control={<RcSesSimpleCheckbox checked={child2} onChange={(e) => setChild2(e.target.checked)} />}
|
|
292
|
+
label='Pasirinkimas 2'
|
|
293
|
+
/>
|
|
294
|
+
<RcSesFormControlLabel
|
|
295
|
+
control={<RcSesSimpleCheckbox checked={child3} onChange={(e) => setChild3(e.target.checked)} />}
|
|
296
|
+
label='Pasirinkimas 3'
|
|
297
|
+
/>
|
|
298
|
+
</div>`,
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function CheckboxIndeterminateLoadingDemo() {
|
|
305
|
+
const { control, watch, setValue } = useForm<IndeterminateFormModel>({
|
|
306
|
+
mode: 'all',
|
|
307
|
+
defaultValues: {
|
|
308
|
+
parent: false,
|
|
309
|
+
child1: false,
|
|
310
|
+
child2: false,
|
|
311
|
+
child3: false,
|
|
312
|
+
},
|
|
313
|
+
})
|
|
314
|
+
|
|
315
|
+
const child1Value = watch('child1')
|
|
316
|
+
const child2Value = watch('child2')
|
|
317
|
+
const child3Value = watch('child3')
|
|
318
|
+
|
|
319
|
+
const childValues = [child1Value, child2Value, child3Value]
|
|
320
|
+
|
|
321
|
+
const handleParentChange = (newChildValues: boolean[]) => {
|
|
322
|
+
setValue('child1', newChildValues[0])
|
|
323
|
+
setValue('child2', newChildValues[1])
|
|
324
|
+
setValue('child3', newChildValues[2])
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
return (
|
|
328
|
+
<Fields>
|
|
329
|
+
<FieldView>
|
|
330
|
+
<div>
|
|
331
|
+
<RcSesCheckboxFormControl
|
|
332
|
+
id='parent'
|
|
333
|
+
name='parent'
|
|
334
|
+
control={control}
|
|
335
|
+
variant='flat'
|
|
336
|
+
childValues={childValues}
|
|
337
|
+
onChildValuesChange={handleParentChange}
|
|
338
|
+
loading
|
|
339
|
+
>
|
|
340
|
+
<strong>Pasirinkti visus</strong>
|
|
341
|
+
</RcSesCheckboxFormControl>
|
|
342
|
+
<div
|
|
343
|
+
style={{
|
|
344
|
+
paddingLeft: '2rem',
|
|
345
|
+
display: 'flex',
|
|
346
|
+
flexDirection: 'column',
|
|
347
|
+
}}
|
|
348
|
+
>
|
|
349
|
+
<RcSesFormControlLabel
|
|
350
|
+
control={
|
|
351
|
+
<RcSesSimpleCheckbox
|
|
352
|
+
checked={child1Value}
|
|
353
|
+
onChange={(e) => setValue('child1', e.target.checked)}
|
|
354
|
+
loading
|
|
355
|
+
/>
|
|
356
|
+
}
|
|
357
|
+
label='Pasirinkimas 1'
|
|
358
|
+
loading
|
|
359
|
+
/>
|
|
360
|
+
<RcSesFormControlLabel
|
|
361
|
+
control={
|
|
362
|
+
<RcSesSimpleCheckbox
|
|
363
|
+
checked={child2Value}
|
|
364
|
+
onChange={(e) => setValue('child2', e.target.checked)}
|
|
365
|
+
loading
|
|
366
|
+
/>
|
|
367
|
+
}
|
|
368
|
+
label='Pasirinkimas 2'
|
|
369
|
+
loading
|
|
370
|
+
/>
|
|
371
|
+
<RcSesFormControlLabel
|
|
372
|
+
control={
|
|
373
|
+
<RcSesSimpleCheckbox
|
|
374
|
+
checked={child3Value}
|
|
375
|
+
onChange={(e) => setValue('child3', e.target.checked)}
|
|
376
|
+
loading
|
|
377
|
+
/>
|
|
378
|
+
}
|
|
379
|
+
label='Pasirinkimas 3'
|
|
380
|
+
loading
|
|
381
|
+
/>
|
|
382
|
+
</div>
|
|
383
|
+
</div>
|
|
384
|
+
</FieldView>
|
|
385
|
+
</Fields>
|
|
386
|
+
)
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export const ParentChildLogicLoading: Story = {
|
|
390
|
+
render: () => <CheckboxIndeterminateLoadingDemo />,
|
|
391
|
+
parameters: {
|
|
392
|
+
docs: {
|
|
393
|
+
description: {
|
|
394
|
+
story: 'Parent-child logic with loading state - shows skeleton while loading.',
|
|
395
|
+
},
|
|
396
|
+
source: {
|
|
397
|
+
type: 'code',
|
|
398
|
+
code: `<RcSesCheckboxFormControl
|
|
399
|
+
id='parent'
|
|
400
|
+
variant='flat'
|
|
401
|
+
childValues={[child1, child2, child3]}
|
|
402
|
+
onChildValuesChange={handleParentChange}
|
|
403
|
+
loading
|
|
404
|
+
>
|
|
405
|
+
<strong>Pasirinkti visus</strong>
|
|
406
|
+
</RcSesCheckboxFormControl>
|
|
407
|
+
|
|
408
|
+
<div style={{ paddingLeft: '2rem', display: 'flex', flexDirection: 'column' }}>
|
|
409
|
+
<RcSesFormControlLabel
|
|
410
|
+
control={<RcSesSimpleCheckbox checked={child1} onChange={(e) => setChild1(e.target.checked)} loading />}
|
|
411
|
+
label='Pasirinkimas 1'
|
|
412
|
+
loading
|
|
413
|
+
/>
|
|
414
|
+
<RcSesFormControlLabel
|
|
415
|
+
control={<RcSesSimpleCheckbox checked={child2} onChange={(e) => setChild2(e.target.checked)} loading />}
|
|
416
|
+
label='Pasirinkimas 2'
|
|
417
|
+
loading
|
|
418
|
+
/>
|
|
419
|
+
<RcSesFormControlLabel
|
|
420
|
+
control={<RcSesSimpleCheckbox checked={child3} onChange={(e) => setChild3(e.target.checked)} loading />}
|
|
421
|
+
label='Pasirinkimas 3'
|
|
422
|
+
loading
|
|
423
|
+
/>
|
|
424
|
+
</div>`,
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
},
|
|
428
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
+
import { useState } from 'react'
|
|
3
|
+
|
|
4
|
+
import SimpleCheckbox from '@/components/form/inputs/SimpleCheckbox'
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'components/inputs/SimpleCheckbox',
|
|
8
|
+
component: SimpleCheckbox,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'centered',
|
|
11
|
+
docs: {
|
|
12
|
+
description: {
|
|
13
|
+
component:
|
|
14
|
+
'Lightweight checkbox without form wrapper. Use as children in CheckboxFormControl or anywhere you need a plain checkbox without form wrapper overhead.',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
tags: ['autodocs'],
|
|
19
|
+
} satisfies Meta<typeof SimpleCheckbox>
|
|
20
|
+
|
|
21
|
+
export default meta
|
|
22
|
+
type Story = StoryObj<typeof meta>
|
|
23
|
+
|
|
24
|
+
function BasicDemo() {
|
|
25
|
+
const [checked, setChecked] = useState(false)
|
|
26
|
+
return (
|
|
27
|
+
<SimpleCheckbox checked={checked} onChange={(e) => setChecked(e.target.checked)} />
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function LoadingDemo() {
|
|
32
|
+
return <SimpleCheckbox checked loading />
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const Basic: Story = {
|
|
36
|
+
render: () => <BasicDemo />,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const Loading: Story = {
|
|
40
|
+
render: () => <LoadingDemo />,
|
|
41
|
+
parameters: {
|
|
42
|
+
docs: {
|
|
43
|
+
description: {
|
|
44
|
+
story: 'Loading state - shows skeleton icon animation.',
|
|
45
|
+
},
|
|
46
|
+
source: {
|
|
47
|
+
type: 'code',
|
|
48
|
+
code: `<SimpleCheckbox checked={true} loading />`,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
}
|
|
@@ -5,7 +5,9 @@ import { useMemo, useState } from 'react'
|
|
|
5
5
|
import type { ReactElement } from 'react'
|
|
6
6
|
|
|
7
7
|
import type IconProps from '@/assets/IconProps'
|
|
8
|
+
import ArrowLeftIcon from '@/assets/icons/ArrowLeftIcon'
|
|
8
9
|
import ArrowRightIcon from '@/assets/icons/ArrowRightIcon'
|
|
10
|
+
import ArrowsClockwiseIcon from '@/assets/icons/ArrowsClockwiseIcon'
|
|
9
11
|
import BarcodeIcon from '@/assets/icons/BarcodeIcon'
|
|
10
12
|
import CalendarBlankIcon from '@/assets/icons/CalendarBlankIcon'
|
|
11
13
|
import CaretDoubleLeftBoldIcon from '@/assets/icons/CaretDoubleLeftBoldIcon'
|
|
@@ -18,6 +20,7 @@ import CaretLeftIcon from '@/assets/icons/CaretLeftIcon'
|
|
|
18
20
|
import CaretRightBoldIcon from '@/assets/icons/CaretRightBoldIcon'
|
|
19
21
|
import CheckBoldIcon from '@/assets/icons/CheckBoldIcon'
|
|
20
22
|
import CheckCircleFillIcon from '@/assets/icons/CheckCircleFillIcon'
|
|
23
|
+
import CheckIcon from '@/assets/icons/CheckIcon'
|
|
21
24
|
import CheckUncheckedBoldIcon from '@/assets/icons/CheckUncheckedBoldIcon'
|
|
22
25
|
import CircleFilledIcon from '@/assets/icons/CircleFilledIcon'
|
|
23
26
|
import CloseIcon from '@/assets/icons/CloseIcon'
|
|
@@ -28,13 +31,17 @@ import InfoFillIcon from '@/assets/icons/InfoFillIcon'
|
|
|
28
31
|
import MagnifyingGlassIcon from '@/assets/icons/MagnifyingGlassIcon'
|
|
29
32
|
import MapPinAreaIcon from '@/assets/icons/MapPinAreaIcon'
|
|
30
33
|
import MinusBoldIcon from '@/assets/icons/MinusBoldIcon'
|
|
34
|
+
import PencilSimpleLineIcon from '@/assets/icons/PencilSimpleLineIcon'
|
|
31
35
|
import PlusBoldIcon from '@/assets/icons/PlusBoldIcon'
|
|
32
36
|
import QuestionFillIcon from '@/assets/icons/QuestionFillIcon'
|
|
33
37
|
import QuestionIcon from '@/assets/icons/QuestionIcon'
|
|
34
38
|
import ScalesIcon from '@/assets/icons/ScalesIcon'
|
|
35
39
|
import ScrollIcon from '@/assets/icons/ScrollIcon'
|
|
40
|
+
import SearchHelpIcon from '@/assets/icons/SearchHelpIcon'
|
|
41
|
+
import SearchXIcon from '@/assets/icons/SearchXIcon'
|
|
36
42
|
import SpinnerGapBoldIcon from '@/assets/icons/SpinnerGapBoldIcon'
|
|
37
43
|
import UploadSimpleIcon from '@/assets/icons/UploadSimpleIcon'
|
|
44
|
+
import WarningCircleIcon from '@/assets/icons/WarningCircleIcon'
|
|
38
45
|
import WarningDiamondFillIcon from '@/assets/icons/WarningDiamondFillIcon'
|
|
39
46
|
import WarningFillIcon from '@/assets/icons/WarningFillIcon'
|
|
40
47
|
import XCircleFillIcon from '@/assets/icons/XCircleFillIcon'
|
|
@@ -95,10 +102,18 @@ const renderIcon =
|
|
|
95
102
|
)
|
|
96
103
|
|
|
97
104
|
const iconItems: IconStoryItem[] = [
|
|
105
|
+
{
|
|
106
|
+
name: 'ArrowLeftIcon',
|
|
107
|
+
render: renderIcon(ArrowLeftIcon),
|
|
108
|
+
},
|
|
98
109
|
{
|
|
99
110
|
name: 'ArrowRightIcon',
|
|
100
111
|
render: renderIcon(ArrowRightIcon),
|
|
101
112
|
},
|
|
113
|
+
{
|
|
114
|
+
name: 'ArrowsClockwiseIcon',
|
|
115
|
+
render: renderIcon(ArrowsClockwiseIcon),
|
|
116
|
+
},
|
|
102
117
|
{
|
|
103
118
|
name: 'BarcodeIcon',
|
|
104
119
|
render: renderIcon(BarcodeIcon),
|
|
@@ -147,6 +162,10 @@ const iconItems: IconStoryItem[] = [
|
|
|
147
162
|
name: 'CheckCircleFillIcon',
|
|
148
163
|
render: renderIcon(CheckCircleFillIcon),
|
|
149
164
|
},
|
|
165
|
+
{
|
|
166
|
+
name: 'CheckIcon',
|
|
167
|
+
render: renderIcon(CheckIcon),
|
|
168
|
+
},
|
|
150
169
|
{
|
|
151
170
|
name: 'CheckUncheckedBoldIcon',
|
|
152
171
|
render: renderIcon(CheckUncheckedBoldIcon),
|
|
@@ -187,6 +206,10 @@ const iconItems: IconStoryItem[] = [
|
|
|
187
206
|
name: 'MinusBoldIcon',
|
|
188
207
|
render: renderIcon(MinusBoldIcon),
|
|
189
208
|
},
|
|
209
|
+
{
|
|
210
|
+
name: 'PencilSimpleLineIcon',
|
|
211
|
+
render: renderIcon(PencilSimpleLineIcon),
|
|
212
|
+
},
|
|
190
213
|
{
|
|
191
214
|
name: 'PlusBoldIcon',
|
|
192
215
|
render: renderIcon(PlusBoldIcon),
|
|
@@ -207,6 +230,14 @@ const iconItems: IconStoryItem[] = [
|
|
|
207
230
|
name: 'ScrollIcon',
|
|
208
231
|
render: renderIcon(ScrollIcon),
|
|
209
232
|
},
|
|
233
|
+
{
|
|
234
|
+
name: 'SearchHelpIcon',
|
|
235
|
+
render: renderIcon(SearchHelpIcon),
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: 'SearchXIcon',
|
|
239
|
+
render: renderIcon(SearchXIcon),
|
|
240
|
+
},
|
|
210
241
|
{
|
|
211
242
|
name: 'SpinnerGapBoldIcon',
|
|
212
243
|
render: renderIcon(SpinnerGapBoldIcon),
|
|
@@ -215,6 +246,10 @@ const iconItems: IconStoryItem[] = [
|
|
|
215
246
|
name: 'UploadSimpleIcon',
|
|
216
247
|
render: renderIcon(UploadSimpleIcon),
|
|
217
248
|
},
|
|
249
|
+
{
|
|
250
|
+
name: 'WarningCircleIcon',
|
|
251
|
+
render: renderIcon(WarningCircleIcon),
|
|
252
|
+
},
|
|
218
253
|
{
|
|
219
254
|
name: 'WarningDiamondFillIcon',
|
|
220
255
|
render: renderIcon(WarningDiamondFillIcon),
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import Typography from '@mui/material/Typography'
|
|
2
2
|
import { Meta, StoryObj } from '@storybook/react'
|
|
3
|
+
import React from 'react'
|
|
3
4
|
|
|
4
5
|
import RcSesServiceHeader from '@/components/layout/ServiceHeader'
|
|
6
|
+
import { common, grey } from '@/theme/palette'
|
|
5
7
|
|
|
6
8
|
const meta: Meta<typeof RcSesServiceHeader> = {
|
|
7
9
|
title: 'components/layout/ServiceHeader',
|
|
@@ -10,26 +12,52 @@ const meta: Meta<typeof RcSesServiceHeader> = {
|
|
|
10
12
|
argTypes: {
|
|
11
13
|
title: { control: 'text' },
|
|
12
14
|
children: { control: 'text' },
|
|
15
|
+
backgroundColor: { control: 'text' },
|
|
13
16
|
},
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
export default meta
|
|
17
20
|
type Story = StoryObj<typeof meta>
|
|
18
21
|
|
|
22
|
+
const breadcrumbs = {
|
|
23
|
+
path: [
|
|
24
|
+
{ label: 'Home', path: '/' },
|
|
25
|
+
{ label: 'Services', path: '/services' },
|
|
26
|
+
{ label: 'Service Title', path: '/services/service' },
|
|
27
|
+
],
|
|
28
|
+
}
|
|
29
|
+
|
|
19
30
|
export const Default: Story = {
|
|
20
31
|
args: {
|
|
21
32
|
title: 'Service Title',
|
|
22
33
|
children: 'This is a description of the service.',
|
|
23
|
-
breadcrumbsProps:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
breadcrumbsProps: breadcrumbs,
|
|
35
|
+
backgroundColor: common.white,
|
|
36
|
+
},
|
|
37
|
+
render: (args) => (
|
|
38
|
+
<RcSesServiceHeader
|
|
39
|
+
title={args.title}
|
|
40
|
+
breadcrumbsProps={args.breadcrumbsProps}
|
|
41
|
+
backgroundColor={args.backgroundColor}
|
|
42
|
+
>
|
|
43
|
+
{args.children && <Typography variant='body1'>{args.children}</Typography>}
|
|
44
|
+
</RcSesServiceHeader>
|
|
45
|
+
),
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const CustomBackground: Story = {
|
|
49
|
+
args: {
|
|
50
|
+
title: 'Service Title',
|
|
51
|
+
children: 'This is a description of the service with custom background.',
|
|
52
|
+
breadcrumbsProps: breadcrumbs,
|
|
53
|
+
backgroundColor: grey['100'],
|
|
30
54
|
},
|
|
31
55
|
render: (args) => (
|
|
32
|
-
<RcSesServiceHeader
|
|
56
|
+
<RcSesServiceHeader
|
|
57
|
+
title={args.title}
|
|
58
|
+
breadcrumbsProps={args.breadcrumbsProps}
|
|
59
|
+
backgroundColor={args.backgroundColor}
|
|
60
|
+
>
|
|
33
61
|
{args.children && <Typography variant='body1'>{args.children}</Typography>}
|
|
34
62
|
</RcSesServiceHeader>
|
|
35
63
|
),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Components } from '@mui/material'
|
|
2
2
|
|
|
3
|
-
import palette, { error, grey, primary, secondary, warning } from '../palette'
|
|
3
|
+
import palette, { error, grey, overlays, primary, secondary, warning } from '../palette'
|
|
4
4
|
|
|
5
5
|
const MuiButton: Components['MuiButton'] = {
|
|
6
6
|
variants: [
|
|
@@ -357,6 +357,39 @@ const MuiButton: Components['MuiButton'] = {
|
|
|
357
357
|
backgroundColor: error[100],
|
|
358
358
|
},
|
|
359
359
|
},
|
|
360
|
+
|
|
361
|
+
'&.MuiButton-colorLight': {
|
|
362
|
+
borderColor: grey[50],
|
|
363
|
+
color: grey[50],
|
|
364
|
+
backgroundColor: 'transparent',
|
|
365
|
+
|
|
366
|
+
'&:hover': {
|
|
367
|
+
backgroundColor: overlays['200'],
|
|
368
|
+
},
|
|
369
|
+
'&:active': {
|
|
370
|
+
backgroundColor: overlays['300'],
|
|
371
|
+
},
|
|
372
|
+
'&.Mui-disabled': {
|
|
373
|
+
borderColor: `${grey[500]} !important`,
|
|
374
|
+
color: `${grey[500]} !important`,
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
|
|
378
|
+
'&.MuiButton-colorGhost': {
|
|
379
|
+
borderColor: 'transparent',
|
|
380
|
+
color: grey[50],
|
|
381
|
+
backgroundColor: 'transparent',
|
|
382
|
+
|
|
383
|
+
'&:hover': {
|
|
384
|
+
backgroundColor: overlays['200'],
|
|
385
|
+
},
|
|
386
|
+
'&:active': {
|
|
387
|
+
backgroundColor: overlays['300'],
|
|
388
|
+
},
|
|
389
|
+
'&.Mui-disabled': {
|
|
390
|
+
borderColor: `transparent !important`,
|
|
391
|
+
},
|
|
392
|
+
},
|
|
360
393
|
},
|
|
361
394
|
text: {
|
|
362
395
|
'&.MuiButton-colorGrey': {
|
|
@@ -47,11 +47,15 @@ declare module '@mui/material/styles' {
|
|
|
47
47
|
interface Palette {
|
|
48
48
|
dark: Palette['grey']
|
|
49
49
|
grey: Palette['grey']
|
|
50
|
+
light: Palette['grey']
|
|
51
|
+
ghost: Palette['grey']
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
interface PaletteOptions {
|
|
53
55
|
dark?: PaletteOptions['grey']
|
|
54
56
|
grey?: PaletteOptions['grey']
|
|
57
|
+
light?: PaletteOptions['grey']
|
|
58
|
+
ghost?: PaletteOptions['grey']
|
|
55
59
|
}
|
|
56
60
|
}
|
|
57
61
|
|
|
@@ -73,6 +77,8 @@ declare module '@mui/material' {
|
|
|
73
77
|
interface ButtonPropsColorOverrides {
|
|
74
78
|
grey: any
|
|
75
79
|
dark: any
|
|
80
|
+
light: any
|
|
81
|
+
ghost: any
|
|
76
82
|
}
|
|
77
83
|
|
|
78
84
|
interface RadioPropsColorOverrides {
|
package/src/theme/palette.tsx
CHANGED
|
@@ -73,5 +73,15 @@ const error = {
|
|
|
73
73
|
main: '#fa5a46',
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
const overlays = {
|
|
77
|
+
'200': '#ffffff14',
|
|
78
|
+
'300': '#ffffff29',
|
|
79
|
+
main: '#ffffff14',
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const common = {
|
|
83
|
+
white: '#ffffff',
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export { primary, secondary, grey, warning, error, overlays, common }
|
|
77
87
|
export default { primary, secondary, grey, warning, error }
|