@registrucentras/rc-ses-react-components 1.3.0 → 1.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.
- package/README.md +3 -1
- package/dist/assets/IconProps.d.ts +4 -2
- package/dist/assets/icons/ArrowLeftIcon.d.ts +3 -0
- package/dist/assets/icons/ArrowRightIcon.d.ts +1 -1
- package/dist/assets/icons/BarcodeIcon.d.ts +3 -0
- package/dist/assets/icons/CalendarBlankIcon.d.ts +1 -1
- package/dist/assets/icons/CaretDoubleLeftBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CaretDoubleRightBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CaretDownBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CaretDownFill.d.ts +2 -2
- package/dist/assets/icons/CaretDownIcon.d.ts +1 -1
- package/dist/assets/icons/CaretLeftBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CaretLeftIcon.d.ts +1 -1
- package/dist/assets/icons/CaretRightBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CheckBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CheckCircleFillIcon.d.ts +2 -2
- package/dist/assets/icons/CheckUncheckedBoldIcon.d.ts +1 -1
- package/dist/assets/icons/CircleFilledIcon.d.ts +3 -0
- package/dist/assets/icons/CloseIcon.d.ts +1 -1
- package/dist/assets/icons/CollapseChevronsIcon.d.ts +1 -1
- package/dist/assets/icons/DotCircleFilledIcon.d.ts +3 -0
- package/dist/assets/icons/ExpandChevronsIcon.d.ts +1 -1
- package/dist/assets/icons/InfoFillIcon.d.ts +1 -1
- package/dist/assets/icons/MagnifyingGlassIcon.d.ts +2 -2
- package/dist/assets/icons/MapPinAreaIcon.d.ts +3 -0
- package/dist/assets/icons/MinusBoldIcon.d.ts +1 -1
- package/dist/assets/icons/PlusBoldIcon.d.ts +1 -1
- package/dist/assets/icons/QuestionFillIcon.d.ts +1 -1
- package/dist/assets/icons/QuestionIcon.d.ts +1 -1
- package/dist/assets/icons/ScalesIcon.d.ts +3 -0
- package/dist/assets/icons/ScrollIcon.d.ts +1 -1
- package/dist/assets/icons/SpinnerGapBoldIcon.d.ts +1 -1
- package/dist/assets/icons/UploadSimpleIcon.d.ts +1 -1
- package/dist/assets/icons/WarningDiamondFillIcon.d.ts +1 -1
- package/dist/assets/icons/WarningFillIcon.d.ts +1 -1
- package/dist/assets/icons/XCircleFillIcon.d.ts +2 -2
- package/dist/components/common/Button/index.d.ts +2 -2
- package/dist/components/common/Card/index.d.ts +31 -0
- package/dist/components/common/DataPagination/components/PaginationButton.d.ts +8 -0
- package/dist/components/common/DataPagination/index.d.ts +10 -0
- package/dist/components/layout/ServiceFormContainer/utils.d.ts +4 -0
- package/dist/components/layout/ServiceWizardStepper/StepConnector.d.ts +7 -0
- package/dist/components/layout/ServiceWizardStepper/StepperTypes.d.ts +7 -0
- package/dist/components/layout/ServiceWizardStepper/components/CustomStepIcon.d.ts +3 -0
- package/dist/components/layout/ServiceWizardStepper/components/DesktopStepper.d.ts +9 -0
- package/dist/components/layout/ServiceWizardStepper/components/HorizontalStepperButton.d.ts +6 -0
- package/dist/components/layout/ServiceWizardStepper/components/MobileStepper.d.ts +8 -0
- package/dist/components/layout/ServiceWizardStepper/components/StyledStepLabel.d.ts +11 -0
- package/dist/components/layout/ServiceWizardStepper/index.d.ts +6 -5
- package/dist/library/icons.d.ts +27 -3
- package/dist/library/index.d.ts +6 -2
- package/dist/registrucentras-rc-ses-react-components.cjs +12 -12
- package/dist/registrucentras-rc-ses-react-components.js +3893 -2677
- package/dist/stories/ServiceWizardStepper.stories.d.ts +7 -0
- package/dist/stories/components/Accordion.stories.d.ts +2 -2
- package/dist/stories/components/Card.stories.d.ts +24 -0
- package/dist/stories/components/DataPagination.stories.d.ts +47 -0
- package/dist/stories/components/Icons.stories.d.ts +6 -0
- package/dist/stories/components/buttons/Button.stories.d.ts +10 -0
- package/dist/stories/components/form/CheckboxFormControl.stories.d.ts +2 -2
- package/dist/stories/components/inputs/Checkbox.stories.d.ts +2 -2
- package/dist/stories/components/inputs/FileUpload.stories.d.ts +2 -2
- package/dist/stories/components/inputs/NumberStepper.stories.d.ts +2 -2
- package/dist/stories/components/inputs/SearchableField.stories.d.ts +60 -60
- package/dist/stories/components/inputs/Select.stories.d.ts +126 -126
- package/dist/stories/components/inputs/TextField.stories.d.ts +113 -113
- package/dist/theme/light/MuiPagination.d.ts +2 -1
- package/package.json +2 -1
- package/src/App.tsx +8 -0
- package/src/assets/IconProps.ts +5 -2
- package/src/assets/icons/ArrowLeftIcon.tsx +16 -0
- package/src/assets/icons/ArrowRightIcon.tsx +8 -13
- package/src/assets/icons/BarcodeIcon.tsx +9 -0
- package/src/assets/icons/CalendarBlankIcon.tsx +4 -16
- package/src/assets/icons/CaretDoubleLeftBoldIcon.tsx +14 -12
- package/src/assets/icons/CaretDoubleRightBoldIcon.tsx +14 -12
- package/src/assets/icons/CaretDownBoldIcon.tsx +9 -12
- package/src/assets/icons/CaretDownFill.tsx +11 -10
- package/src/assets/icons/CaretDownIcon.tsx +4 -16
- package/src/assets/icons/CaretLeftBoldIcon.tsx +9 -12
- package/src/assets/icons/CaretLeftIcon.tsx +4 -16
- package/src/assets/icons/CaretRightBoldIcon.tsx +9 -12
- package/src/assets/icons/CheckBoldIcon.tsx +9 -24
- package/src/assets/icons/CheckCircleFillIcon.tsx +10 -14
- package/src/assets/icons/CheckUncheckedBoldIcon.tsx +4 -23
- package/src/assets/icons/CircleFilledIcon.tsx +11 -0
- package/src/assets/icons/CloseIcon.tsx +4 -16
- package/src/assets/icons/CollapseChevronsIcon.tsx +9 -13
- package/src/assets/icons/DotCircleFilledIcon.tsx +23 -0
- package/src/assets/icons/ExpandChevronsIcon.tsx +9 -13
- package/src/assets/icons/InfoFillIcon.tsx +4 -14
- package/src/assets/icons/MagnifyingGlassIcon.tsx +5 -12
- package/src/assets/icons/MapPinAreaIcon.tsx +9 -0
- package/src/assets/icons/MinusBoldIcon.tsx +4 -14
- package/src/assets/icons/PlusBoldIcon.tsx +4 -14
- package/src/assets/icons/QuestionFillIcon.tsx +9 -13
- package/src/assets/icons/QuestionIcon.tsx +4 -16
- package/src/assets/icons/ScalesIcon.tsx +9 -0
- package/src/assets/icons/ScrollIcon.tsx +4 -16
- package/src/assets/icons/SpinnerGapBoldIcon.tsx +9 -12
- package/src/assets/icons/UploadSimpleIcon.tsx +4 -16
- package/src/assets/icons/WarningDiamondFillIcon.tsx +9 -13
- package/src/assets/icons/WarningFillIcon.tsx +9 -13
- package/src/assets/icons/XCircleFillIcon.tsx +11 -10
- package/src/components/common/Alert/index.test.tsx +3 -10
- package/src/components/common/Alert/index.tsx +44 -16
- package/src/components/common/Button/index.tsx +34 -3
- package/src/components/common/Card/index.test.tsx +136 -0
- package/src/components/common/Card/index.tsx +231 -0
- package/src/components/common/DataPagination/components/PaginationButton.tsx +63 -0
- package/src/components/common/DataPagination/index.test.tsx +122 -0
- package/src/components/common/DataPagination/index.tsx +70 -0
- package/src/components/form/inputs/CheckboxFormControl.tsx +1 -11
- package/src/components/form/inputs/PhoneInputFormControl/components/AutocompleteInput.tsx +1 -1
- package/src/components/form/inputs/PhoneInputFormControl/index.tsx +3 -4
- package/src/components/layout/ServiceFormContainer/index.tsx +5 -1
- package/src/components/layout/ServiceFormContainer/utils.ts +12 -0
- package/src/components/layout/ServiceWizardStepper/ServiceWizardStepper.css +69 -0
- package/src/components/layout/ServiceWizardStepper/StepConnector.tsx +29 -0
- package/src/components/layout/ServiceWizardStepper/StepperTypes.ts +7 -0
- package/src/components/layout/ServiceWizardStepper/components/CustomStepIcon.test.tsx +22 -0
- package/src/components/layout/ServiceWizardStepper/components/CustomStepIcon.tsx +41 -0
- package/src/components/layout/ServiceWizardStepper/components/DesktopStepper.test.tsx +40 -0
- package/src/components/layout/ServiceWizardStepper/components/DesktopStepper.tsx +48 -0
- package/src/components/layout/ServiceWizardStepper/components/HorizontalStepperButton.test.tsx +24 -0
- package/src/components/layout/ServiceWizardStepper/components/HorizontalStepperButton.tsx +46 -0
- package/src/components/layout/ServiceWizardStepper/components/MobileStepper.test.tsx +21 -0
- package/src/components/layout/ServiceWizardStepper/components/MobileStepper.tsx +54 -0
- package/src/components/layout/ServiceWizardStepper/components/StyledStepLabel.tsx +53 -0
- package/src/components/layout/ServiceWizardStepper/index.tsx +56 -37
- package/src/examples/HorizontalMultiStepForm/index.tsx +64 -0
- package/src/examples/ListWithPagination/index.tsx +44 -0
- package/src/library/icons.ts +51 -4
- package/src/library/index.ts +6 -2
- package/src/main.tsx +10 -0
- package/src/stories/ServiceWizardStepper.stories.tsx +39 -0
- package/src/stories/components/Alert.stories.tsx +1 -8
- package/src/stories/components/Card.stories.tsx +51 -0
- package/src/stories/components/Card.test.tsx +18 -0
- package/src/stories/components/DataPagination.stories.tsx +75 -0
- package/src/stories/components/Icons.stories.tsx +352 -0
- package/src/stories/components/buttons/Button.stories.tsx +30 -0
- package/src/theme/light/MuiAlert.tsx +10 -10
- package/src/theme/light/MuiButton.tsx +42 -15
- package/src/theme/light/MuiCard.tsx +2 -2
- package/src/theme/light/MuiPagination.ts +40 -12
- package/src/theme/light/index.tsx +2 -1
- package/src/types/buttons/ButtonProps.tsx +3 -1
- package/dist/assets/icons/CheckBoldDisabledIcon.d.ts +0 -3
- package/dist/components/layout/ServiceWizardStepper/components/ActiveStepIcon.d.ts +0 -2
- package/dist/components/layout/ServiceWizardStepper/components/CompletedStepIcon.d.ts +0 -2
- package/dist/components/layout/ServiceWizardStepper/components/PendingStepIcon.d.ts +0 -2
- package/src/assets/icons/CheckBoldDisabledIcon.tsx +0 -32
- package/src/components/layout/ServiceWizardStepper/components/ActiveStepIcon.tsx +0 -15
- package/src/components/layout/ServiceWizardStepper/components/CompletedStepIcon.tsx +0 -19
- package/src/components/layout/ServiceWizardStepper/components/PendingStepIcon.tsx +0 -15
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
/* eslint-disable react/function-component-definition, react/prop-types */
|
|
2
|
+
import { Box, FormControl, MenuItem, Select, Typography } from '@mui/material'
|
|
3
|
+
import type { Meta, StoryFn } from '@storybook/react'
|
|
4
|
+
import { useMemo, useState } from 'react'
|
|
5
|
+
import type { ReactElement } from 'react'
|
|
6
|
+
|
|
7
|
+
import type IconProps from '@/assets/IconProps'
|
|
8
|
+
import ArrowRightIcon from '@/assets/icons/ArrowRightIcon'
|
|
9
|
+
import BarcodeIcon from '@/assets/icons/BarcodeIcon'
|
|
10
|
+
import CalendarBlankIcon from '@/assets/icons/CalendarBlankIcon'
|
|
11
|
+
import CaretDoubleLeftBoldIcon from '@/assets/icons/CaretDoubleLeftBoldIcon'
|
|
12
|
+
import CaretDoubleRightBoldIcon from '@/assets/icons/CaretDoubleRightBoldIcon'
|
|
13
|
+
import CaretDownBoldIcon from '@/assets/icons/CaretDownBoldIcon'
|
|
14
|
+
import CaretDownFill from '@/assets/icons/CaretDownFill'
|
|
15
|
+
import CaretDownIcon from '@/assets/icons/CaretDownIcon'
|
|
16
|
+
import CaretLeftBoldIcon from '@/assets/icons/CaretLeftBoldIcon'
|
|
17
|
+
import CaretLeftIcon from '@/assets/icons/CaretLeftIcon'
|
|
18
|
+
import CaretRightBoldIcon from '@/assets/icons/CaretRightBoldIcon'
|
|
19
|
+
import CheckBoldIcon from '@/assets/icons/CheckBoldIcon'
|
|
20
|
+
import CheckCircleFillIcon from '@/assets/icons/CheckCircleFillIcon'
|
|
21
|
+
import CheckUncheckedBoldIcon from '@/assets/icons/CheckUncheckedBoldIcon'
|
|
22
|
+
import CircleFilledIcon from '@/assets/icons/CircleFilledIcon'
|
|
23
|
+
import CloseIcon from '@/assets/icons/CloseIcon'
|
|
24
|
+
import CollapseChevronsIcon from '@/assets/icons/CollapseChevronsIcon'
|
|
25
|
+
import DotCircleFilledIcon from '@/assets/icons/DotCircleFilledIcon'
|
|
26
|
+
import ExpandChevronsIcon from '@/assets/icons/ExpandChevronsIcon'
|
|
27
|
+
import InfoFillIcon from '@/assets/icons/InfoFillIcon'
|
|
28
|
+
import MagnifyingGlassIcon from '@/assets/icons/MagnifyingGlassIcon'
|
|
29
|
+
import MapPinAreaIcon from '@/assets/icons/MapPinAreaIcon'
|
|
30
|
+
import MinusBoldIcon from '@/assets/icons/MinusBoldIcon'
|
|
31
|
+
import PlusBoldIcon from '@/assets/icons/PlusBoldIcon'
|
|
32
|
+
import QuestionFillIcon from '@/assets/icons/QuestionFillIcon'
|
|
33
|
+
import QuestionIcon from '@/assets/icons/QuestionIcon'
|
|
34
|
+
import ScalesIcon from '@/assets/icons/ScalesIcon'
|
|
35
|
+
import ScrollIcon from '@/assets/icons/ScrollIcon'
|
|
36
|
+
import SpinnerGapBoldIcon from '@/assets/icons/SpinnerGapBoldIcon'
|
|
37
|
+
import UploadSimpleIcon from '@/assets/icons/UploadSimpleIcon'
|
|
38
|
+
import WarningDiamondFillIcon from '@/assets/icons/WarningDiamondFillIcon'
|
|
39
|
+
import WarningFillIcon from '@/assets/icons/WarningFillIcon'
|
|
40
|
+
import XCircleFillIcon from '@/assets/icons/XCircleFillIcon'
|
|
41
|
+
import palette from '@/theme/palette'
|
|
42
|
+
|
|
43
|
+
// import resolvePaletteColorPath from '@/assets/resolvePaletteColorPath'
|
|
44
|
+
|
|
45
|
+
type StoryArgs = IconProps
|
|
46
|
+
|
|
47
|
+
type IconStoryItem = {
|
|
48
|
+
name: string
|
|
49
|
+
render: (args: StoryArgs) => ReactElement
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
type PaletteColorOptions = Record<string, string | undefined>
|
|
53
|
+
type PaletteColorLabels = Record<string, string>
|
|
54
|
+
|
|
55
|
+
// const defaultStoryFillColor = resolvePaletteColorPath('primary.400')
|
|
56
|
+
// const defaultStoryStrokeColor = resolvePaletteColorPath('white')
|
|
57
|
+
|
|
58
|
+
const paletteColorOptions: PaletteColorOptions = {
|
|
59
|
+
default: undefined,
|
|
60
|
+
white: '#ffffff',
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const paletteColorLabels: PaletteColorLabels = {
|
|
64
|
+
default: 'default',
|
|
65
|
+
white: 'white (#ffffff)',
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
Object.entries(palette).forEach(([colorGroupName, colorGroup]) => {
|
|
69
|
+
Object.entries(colorGroup).forEach(([colorName, colorValue]) => {
|
|
70
|
+
const tokenName = `${colorGroupName}.${colorName}`
|
|
71
|
+
paletteColorOptions[tokenName] = colorValue
|
|
72
|
+
paletteColorLabels[tokenName] = `${tokenName} (${colorValue})`
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
const paletteTokenItems = Object.entries(paletteColorOptions).map(
|
|
77
|
+
([tokenName, colorValue]) => ({
|
|
78
|
+
colorValue,
|
|
79
|
+
tokenName,
|
|
80
|
+
}),
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
const resolveTokenNameByColor = (color: string | undefined): string => {
|
|
84
|
+
const resolvedTokenName = Object.entries(paletteColorOptions).find(
|
|
85
|
+
([, colorValue]) => colorValue === color,
|
|
86
|
+
)?.[0]
|
|
87
|
+
|
|
88
|
+
return resolvedTokenName ?? 'default'
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const renderIcon =
|
|
92
|
+
(IconComponent: (props: IconProps) => ReactElement) =>
|
|
93
|
+
({ className, fillColor, size }: StoryArgs): ReactElement => (
|
|
94
|
+
<IconComponent className={className} fillColor={fillColor} size={size} />
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
const iconItems: IconStoryItem[] = [
|
|
98
|
+
{
|
|
99
|
+
name: 'ArrowRightIcon',
|
|
100
|
+
render: renderIcon(ArrowRightIcon),
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'BarcodeIcon',
|
|
104
|
+
render: renderIcon(BarcodeIcon),
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'CalendarBlankIcon',
|
|
108
|
+
render: renderIcon(CalendarBlankIcon),
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'CaretDoubleLeftBoldIcon',
|
|
112
|
+
render: renderIcon(CaretDoubleLeftBoldIcon),
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'CaretDoubleRightBoldIcon',
|
|
116
|
+
render: renderIcon(CaretDoubleRightBoldIcon),
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: 'CaretDownBoldIcon',
|
|
120
|
+
render: renderIcon(CaretDownBoldIcon),
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'CaretDownFill',
|
|
124
|
+
render: renderIcon(CaretDownFill),
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'CaretDownIcon',
|
|
128
|
+
render: renderIcon(CaretDownIcon),
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: 'CaretLeftBoldIcon',
|
|
132
|
+
render: renderIcon(CaretLeftBoldIcon),
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'CaretLeftIcon',
|
|
136
|
+
render: renderIcon(CaretLeftIcon),
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'CaretRightBoldIcon',
|
|
140
|
+
render: renderIcon(CaretRightBoldIcon),
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: 'CheckBoldIcon',
|
|
144
|
+
render: renderIcon(CheckBoldIcon),
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: 'CheckCircleFillIcon',
|
|
148
|
+
render: renderIcon(CheckCircleFillIcon),
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: 'CheckUncheckedBoldIcon',
|
|
152
|
+
render: renderIcon(CheckUncheckedBoldIcon),
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: 'CircleFilledIcon',
|
|
156
|
+
render: renderIcon(CircleFilledIcon),
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: 'CloseIcon',
|
|
160
|
+
render: renderIcon(CloseIcon),
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: 'CollapseChevronsIcon',
|
|
164
|
+
render: renderIcon(CollapseChevronsIcon),
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: 'DotCircleFilledIcon',
|
|
168
|
+
render: renderIcon(DotCircleFilledIcon),
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: 'ExpandChevronsIcon',
|
|
172
|
+
render: renderIcon(ExpandChevronsIcon),
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: 'InfoFillIcon',
|
|
176
|
+
render: renderIcon(InfoFillIcon),
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
name: 'MagnifyingGlassIcon',
|
|
180
|
+
render: renderIcon(MagnifyingGlassIcon),
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: 'MapPinAreaIcon',
|
|
184
|
+
render: renderIcon(MapPinAreaIcon),
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: 'MinusBoldIcon',
|
|
188
|
+
render: renderIcon(MinusBoldIcon),
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: 'PlusBoldIcon',
|
|
192
|
+
render: renderIcon(PlusBoldIcon),
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: 'QuestionFillIcon',
|
|
196
|
+
render: renderIcon(QuestionFillIcon),
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
name: 'QuestionIcon',
|
|
200
|
+
render: renderIcon(QuestionIcon),
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: 'ScalesIcon',
|
|
204
|
+
render: renderIcon(ScalesIcon),
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: 'ScrollIcon',
|
|
208
|
+
render: renderIcon(ScrollIcon),
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: 'SpinnerGapBoldIcon',
|
|
212
|
+
render: renderIcon(SpinnerGapBoldIcon),
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: 'UploadSimpleIcon',
|
|
216
|
+
render: renderIcon(UploadSimpleIcon),
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: 'WarningDiamondFillIcon',
|
|
220
|
+
render: renderIcon(WarningDiamondFillIcon),
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: 'WarningFillIcon',
|
|
224
|
+
render: renderIcon(WarningFillIcon),
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
name: 'XCircleFillIcon',
|
|
228
|
+
render: renderIcon(XCircleFillIcon),
|
|
229
|
+
},
|
|
230
|
+
]
|
|
231
|
+
|
|
232
|
+
const meta: Meta<StoryArgs> = {
|
|
233
|
+
title: 'components/common/Icons',
|
|
234
|
+
tags: ['autodocs'],
|
|
235
|
+
args: {
|
|
236
|
+
className: '',
|
|
237
|
+
fillColor: undefined,
|
|
238
|
+
size: 24,
|
|
239
|
+
},
|
|
240
|
+
argTypes: {
|
|
241
|
+
className: { control: 'text' },
|
|
242
|
+
size: {
|
|
243
|
+
control: { min: 8, max: 128, step: 1, type: 'number' },
|
|
244
|
+
table: {
|
|
245
|
+
defaultValue: { summary: '24' },
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export default meta
|
|
252
|
+
|
|
253
|
+
const GalleryComponent = ({ className, size, fillColor }: StoryArgs) => {
|
|
254
|
+
const [selectedFillToken, setSelectedFillToken] = useState(
|
|
255
|
+
resolveTokenNameByColor(fillColor),
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
const selectedFillColor = useMemo(
|
|
259
|
+
() => paletteColorOptions[selectedFillToken],
|
|
260
|
+
[selectedFillToken],
|
|
261
|
+
)
|
|
262
|
+
|
|
263
|
+
return (
|
|
264
|
+
<Box>
|
|
265
|
+
<Box
|
|
266
|
+
sx={{
|
|
267
|
+
display: 'grid',
|
|
268
|
+
gap: 2,
|
|
269
|
+
gridTemplateColumns: 'repeat(auto-fill, minmax(180px, 1fr))',
|
|
270
|
+
mb: 2,
|
|
271
|
+
}}
|
|
272
|
+
>
|
|
273
|
+
{iconItems.map((icon) => (
|
|
274
|
+
<Box
|
|
275
|
+
key={icon.name}
|
|
276
|
+
sx={{
|
|
277
|
+
alignItems: 'center',
|
|
278
|
+
border: '1px solid',
|
|
279
|
+
borderColor: 'divider',
|
|
280
|
+
borderRadius: 1,
|
|
281
|
+
color: selectedFillColor,
|
|
282
|
+
display: 'flex',
|
|
283
|
+
flexDirection: 'column',
|
|
284
|
+
gap: 1,
|
|
285
|
+
minHeight: 96,
|
|
286
|
+
p: 1.5,
|
|
287
|
+
}}
|
|
288
|
+
>
|
|
289
|
+
{icon.render({
|
|
290
|
+
className,
|
|
291
|
+
fillColor: selectedFillColor,
|
|
292
|
+
size,
|
|
293
|
+
})}
|
|
294
|
+
<Typography
|
|
295
|
+
align='center'
|
|
296
|
+
sx={{
|
|
297
|
+
color: 'text.secondary',
|
|
298
|
+
fontFamily: 'monospace',
|
|
299
|
+
fontSize: '0.75rem',
|
|
300
|
+
}}
|
|
301
|
+
>
|
|
302
|
+
{icon.name}
|
|
303
|
+
</Typography>
|
|
304
|
+
</Box>
|
|
305
|
+
))}
|
|
306
|
+
</Box>
|
|
307
|
+
|
|
308
|
+
<Box
|
|
309
|
+
sx={{
|
|
310
|
+
display: 'grid',
|
|
311
|
+
gap: 2,
|
|
312
|
+
gridTemplateColumns: 'repeat(auto-fill, minmax(260px, 1fr))',
|
|
313
|
+
mt: 3,
|
|
314
|
+
}}
|
|
315
|
+
>
|
|
316
|
+
<FormControl size='small'>
|
|
317
|
+
<Typography sx={{ color: 'text.secondary', fontSize: '0.75rem', mb: 0.5 }}>
|
|
318
|
+
fillColor
|
|
319
|
+
</Typography>
|
|
320
|
+
<Select
|
|
321
|
+
onChange={(event) => {
|
|
322
|
+
setSelectedFillToken(event.target.value)
|
|
323
|
+
}}
|
|
324
|
+
value={selectedFillToken}
|
|
325
|
+
>
|
|
326
|
+
{paletteTokenItems.map(({ colorValue, tokenName }) => (
|
|
327
|
+
<MenuItem key={tokenName} value={tokenName}>
|
|
328
|
+
<Box sx={{ alignItems: 'center', display: 'flex', gap: 1 }}>
|
|
329
|
+
<Box
|
|
330
|
+
sx={{
|
|
331
|
+
backgroundColor: colorValue ?? 'transparent',
|
|
332
|
+
border: '1px solid',
|
|
333
|
+
borderColor: 'divider',
|
|
334
|
+
borderRadius: '4px',
|
|
335
|
+
height: 12,
|
|
336
|
+
width: 12,
|
|
337
|
+
}}
|
|
338
|
+
/>
|
|
339
|
+
<Typography sx={{ fontFamily: 'monospace', fontSize: '0.75rem' }}>
|
|
340
|
+
{paletteColorLabels[tokenName]}
|
|
341
|
+
</Typography>
|
|
342
|
+
</Box>
|
|
343
|
+
</MenuItem>
|
|
344
|
+
))}
|
|
345
|
+
</Select>
|
|
346
|
+
</FormControl>
|
|
347
|
+
</Box>
|
|
348
|
+
</Box>
|
|
349
|
+
)
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export const Gallery: StoryFn<StoryArgs> = (args) => <GalleryComponent {...args} />
|
|
@@ -15,6 +15,7 @@ const colorOptions = [
|
|
|
15
15
|
'primary',
|
|
16
16
|
'secondary',
|
|
17
17
|
'grey',
|
|
18
|
+
'dark',
|
|
18
19
|
'error',
|
|
19
20
|
'inherit',
|
|
20
21
|
'success',
|
|
@@ -59,6 +60,14 @@ const meta = {
|
|
|
59
60
|
defaultValue: {},
|
|
60
61
|
},
|
|
61
62
|
},
|
|
63
|
+
iconOnly: {
|
|
64
|
+
control: {
|
|
65
|
+
type: 'boolean',
|
|
66
|
+
},
|
|
67
|
+
table: {
|
|
68
|
+
defaultValue: {},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
62
71
|
},
|
|
63
72
|
tags: ['autodocs'],
|
|
64
73
|
args: {
|
|
@@ -117,6 +126,16 @@ export const PrimaryContainedWithSuffixIcon: Story = {
|
|
|
117
126
|
},
|
|
118
127
|
}
|
|
119
128
|
|
|
129
|
+
export const PrimaryContainedIconOnly: Story = {
|
|
130
|
+
args: {
|
|
131
|
+
'aria-label': 'Add',
|
|
132
|
+
children: <PlusBoldIcon />,
|
|
133
|
+
color: 'primary',
|
|
134
|
+
iconOnly: true,
|
|
135
|
+
variant: 'contained',
|
|
136
|
+
},
|
|
137
|
+
}
|
|
138
|
+
|
|
120
139
|
export const PrimaryOutlined: Story = {
|
|
121
140
|
parameters: disableColorContrast,
|
|
122
141
|
args: {
|
|
@@ -143,6 +162,17 @@ export const PrimaryOutlinedWithSuffixIcon: Story = {
|
|
|
143
162
|
},
|
|
144
163
|
}
|
|
145
164
|
|
|
165
|
+
export const PrimaryOutlinedIconOnly: Story = {
|
|
166
|
+
parameters: disableColorContrast,
|
|
167
|
+
args: {
|
|
168
|
+
'aria-label': 'Add',
|
|
169
|
+
children: <PlusBoldIcon />,
|
|
170
|
+
color: 'primary',
|
|
171
|
+
iconOnly: true,
|
|
172
|
+
variant: 'outlined',
|
|
173
|
+
},
|
|
174
|
+
}
|
|
175
|
+
|
|
146
176
|
export const SecondaryContained: Story = {
|
|
147
177
|
args: {
|
|
148
178
|
color: 'secondary',
|
|
@@ -212,40 +212,40 @@ const MuiAlert: Components['MuiAlert'] = {
|
|
|
212
212
|
backgroundColor: palette.grey['50'],
|
|
213
213
|
borderColor: palette.grey['200'],
|
|
214
214
|
|
|
215
|
-
'.MuiAlert-icon
|
|
216
|
-
|
|
215
|
+
'.MuiAlert-icon': {
|
|
216
|
+
color: palette.grey['600'],
|
|
217
217
|
},
|
|
218
218
|
},
|
|
219
219
|
outlinedError: {
|
|
220
220
|
backgroundColor: palette.error['50'],
|
|
221
221
|
borderColor: palette.error['200'],
|
|
222
222
|
|
|
223
|
-
'.MuiAlert-icon
|
|
224
|
-
|
|
223
|
+
'.MuiAlert-icon': {
|
|
224
|
+
color: palette.error['600'],
|
|
225
225
|
},
|
|
226
226
|
},
|
|
227
227
|
outlinedInfo: {
|
|
228
228
|
backgroundColor: palette.primary['50'],
|
|
229
229
|
borderColor: palette.primary['300'],
|
|
230
230
|
|
|
231
|
-
'.MuiAlert-icon
|
|
232
|
-
|
|
231
|
+
'.MuiAlert-icon': {
|
|
232
|
+
color: palette.primary['500'],
|
|
233
233
|
},
|
|
234
234
|
},
|
|
235
235
|
outlinedSuccess: {
|
|
236
236
|
backgroundColor: palette.secondary['100'],
|
|
237
237
|
borderColor: palette.secondary['300'],
|
|
238
238
|
|
|
239
|
-
'.MuiAlert-icon
|
|
240
|
-
|
|
239
|
+
'.MuiAlert-icon': {
|
|
240
|
+
color: palette.secondary['600'],
|
|
241
241
|
},
|
|
242
242
|
},
|
|
243
243
|
outlinedWarning: {
|
|
244
244
|
backgroundColor: palette.warning['100'],
|
|
245
245
|
borderColor: palette.warning['300'],
|
|
246
246
|
|
|
247
|
-
'.MuiAlert-icon
|
|
248
|
-
|
|
247
|
+
'.MuiAlert-icon': {
|
|
248
|
+
color: palette.warning['600'],
|
|
249
249
|
},
|
|
250
250
|
},
|
|
251
251
|
},
|
|
@@ -59,12 +59,12 @@ const MuiButton: Components['MuiButton'] = {
|
|
|
59
59
|
background: 'transparent',
|
|
60
60
|
border: '2px solid',
|
|
61
61
|
borderColor: grey[950],
|
|
62
|
-
borderRadius: '.
|
|
63
|
-
height: 'calc(100% +
|
|
64
|
-
left: '-
|
|
62
|
+
borderRadius: '0.75rem',
|
|
63
|
+
height: 'calc(100% + 8px)',
|
|
64
|
+
left: '-4px',
|
|
65
65
|
position: 'absolute',
|
|
66
|
-
top: '-
|
|
67
|
-
width: 'calc(100% +
|
|
66
|
+
top: '-4px',
|
|
67
|
+
width: 'calc(100% + 8px)',
|
|
68
68
|
zIndex: 1,
|
|
69
69
|
},
|
|
70
70
|
},
|
|
@@ -132,7 +132,7 @@ const MuiButton: Components['MuiButton'] = {
|
|
|
132
132
|
},
|
|
133
133
|
styleOverrides: {
|
|
134
134
|
root: {
|
|
135
|
-
borderRadius: '.
|
|
135
|
+
borderRadius: '0.5rem',
|
|
136
136
|
fontSize: '.9375rem',
|
|
137
137
|
height: '2.75rem',
|
|
138
138
|
letterSpacing: 0,
|
|
@@ -146,22 +146,43 @@ const MuiButton: Components['MuiButton'] = {
|
|
|
146
146
|
background: 'transparent',
|
|
147
147
|
border: '2px solid',
|
|
148
148
|
borderColor: grey[950],
|
|
149
|
-
borderRadius: '.
|
|
149
|
+
borderRadius: '0.75rem',
|
|
150
150
|
content: '""',
|
|
151
|
-
height: 'calc(100% +
|
|
152
|
-
left: '-
|
|
151
|
+
height: 'calc(100% + 8px)',
|
|
152
|
+
left: '-4px',
|
|
153
153
|
position: 'absolute',
|
|
154
|
-
top: '-
|
|
155
|
-
width: 'calc(100% +
|
|
154
|
+
top: '-4px',
|
|
155
|
+
width: 'calc(100% + 8px)',
|
|
156
156
|
zIndex: 1,
|
|
157
157
|
},
|
|
158
158
|
|
|
159
159
|
'&.MuiButton-outlined:focus-visible:not(:active)::before': {
|
|
160
|
+
borderRadius: '0.75rem',
|
|
160
161
|
height: 'calc(100% + 8px)',
|
|
161
162
|
left: '-4px',
|
|
162
163
|
top: '-4px',
|
|
163
164
|
width: 'calc(100% + 8px)',
|
|
164
165
|
},
|
|
166
|
+
|
|
167
|
+
'.MuiButton-startIcon, .MuiButton-endIcon, & > svg': {
|
|
168
|
+
color: 'inherit',
|
|
169
|
+
|
|
170
|
+
'svg [fill]:not([fill="none"])': {
|
|
171
|
+
fill: 'currentColor',
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
'svg [stroke]:not([stroke="none"])': {
|
|
175
|
+
stroke: 'currentColor',
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
'& [fill]:not([fill="none"])': {
|
|
179
|
+
fill: 'currentColor',
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
'& [stroke]:not([stroke="none"])': {
|
|
183
|
+
stroke: 'currentColor',
|
|
184
|
+
},
|
|
185
|
+
},
|
|
165
186
|
},
|
|
166
187
|
|
|
167
188
|
sizeSmall: {
|
|
@@ -176,7 +197,8 @@ const MuiButton: Components['MuiButton'] = {
|
|
|
176
197
|
contained: {
|
|
177
198
|
'&.Mui-disabled': {
|
|
178
199
|
backgroundColor: `${grey[100]} !important`,
|
|
179
|
-
color: `${grey[
|
|
200
|
+
color: `${grey[600]} !important`,
|
|
201
|
+
opacity: 1,
|
|
180
202
|
},
|
|
181
203
|
|
|
182
204
|
'&.MuiButton-colorPrimary': {
|
|
@@ -254,16 +276,21 @@ const MuiButton: Components['MuiButton'] = {
|
|
|
254
276
|
'&:focus-visible:not(:active)::before, &.MuiButton-outlined:focus-visible:not(:active)::before':
|
|
255
277
|
{
|
|
256
278
|
borderColor: error[700],
|
|
279
|
+
borderRadius: '0.75rem',
|
|
257
280
|
},
|
|
258
281
|
},
|
|
259
282
|
},
|
|
260
283
|
},
|
|
261
284
|
|
|
262
285
|
outlined: {
|
|
286
|
+
borderColor: grey[300],
|
|
287
|
+
borderWidth: '1px',
|
|
288
|
+
|
|
263
289
|
'&.Mui-disabled': {
|
|
264
290
|
backgroundColor: `transparent !important`,
|
|
265
|
-
borderColor: `${grey[
|
|
266
|
-
color: `${grey[
|
|
291
|
+
borderColor: `${grey[300]} !important`,
|
|
292
|
+
color: `${grey[600]} !important`,
|
|
293
|
+
opacity: 1,
|
|
267
294
|
},
|
|
268
295
|
|
|
269
296
|
'&.MuiButton-colorPrimary': {
|
|
@@ -280,7 +307,7 @@ const MuiButton: Components['MuiButton'] = {
|
|
|
280
307
|
},
|
|
281
308
|
|
|
282
309
|
'&.MuiButton-colorGrey': {
|
|
283
|
-
borderColor: grey[
|
|
310
|
+
borderColor: grey[300],
|
|
284
311
|
color: grey[900],
|
|
285
312
|
backgroundColor: 'transparent',
|
|
286
313
|
|
|
@@ -5,27 +5,55 @@ import palette from '../palette'
|
|
|
5
5
|
const MuiPagination: Components['MuiPagination'] = {
|
|
6
6
|
defaultProps: {
|
|
7
7
|
hidePrevButton: true,
|
|
8
|
-
|
|
8
|
+
hideNextButton: true,
|
|
9
9
|
},
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const MuiPaginationItem: Components['MuiPaginationItem'] = {
|
|
10
13
|
styleOverrides: {
|
|
11
14
|
root: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
borderRadius: 8,
|
|
16
|
+
height: 40,
|
|
17
|
+
width: 40,
|
|
18
|
+
fontSize: 14,
|
|
19
|
+
fontWeight: 300,
|
|
20
|
+
color: palette.grey[800],
|
|
21
|
+
|
|
22
|
+
'&:hover': {
|
|
23
|
+
backgroundColor: palette.grey[200],
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
'&:active': {
|
|
27
|
+
backgroundColor: palette.grey[300],
|
|
28
|
+
},
|
|
15
29
|
|
|
16
|
-
|
|
30
|
+
'&.Mui-focusVisible': {
|
|
31
|
+
border: `2px solid ${palette.grey[950]}`,
|
|
32
|
+
backgroundColor: palette.grey[50],
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
'&.Mui-disabled': {
|
|
36
|
+
backgroundColor: palette.grey[100],
|
|
37
|
+
color: palette.grey[500],
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
'&.Mui-selected': {
|
|
41
|
+
backgroundColor: palette.grey[800],
|
|
42
|
+
color: '#fff',
|
|
43
|
+
|
|
44
|
+
'&:hover': {
|
|
17
45
|
backgroundColor: palette.grey[800],
|
|
18
|
-
color: 'white',
|
|
19
|
-
fontSize: '.9275rem',
|
|
20
|
-
lineHeight: '1.125rem',
|
|
21
46
|
},
|
|
22
47
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
48
|
+
'&.MuiPaginationItem-ellipsis': {
|
|
49
|
+
display: 'flex',
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
justifyContent: 'center',
|
|
52
|
+
pointerEvents: 'none',
|
|
53
|
+
fontSize: 14,
|
|
26
54
|
},
|
|
27
55
|
},
|
|
28
56
|
},
|
|
29
57
|
}
|
|
30
58
|
|
|
31
|
-
export
|
|
59
|
+
export { MuiPagination, MuiPaginationItem }
|
|
@@ -40,7 +40,7 @@ import MuiTextField from '@/theme/light/MuiTextField'
|
|
|
40
40
|
import MuiTypography from '@/theme/light/MuiTypography'
|
|
41
41
|
import themePalette from '@/theme/light/themePalette'
|
|
42
42
|
|
|
43
|
-
import MuiPagination from './MuiPagination'
|
|
43
|
+
import { MuiPagination, MuiPaginationItem } from './MuiPagination'
|
|
44
44
|
|
|
45
45
|
declare module '@mui/material/styles' {
|
|
46
46
|
interface Palette {
|
|
@@ -110,6 +110,7 @@ const theme = createTheme(themePalette, ltLT, enUS, {
|
|
|
110
110
|
MuiLinearProgress,
|
|
111
111
|
MuiPickersLayout,
|
|
112
112
|
MuiPagination,
|
|
113
|
+
MuiPaginationItem,
|
|
113
114
|
MuiPopover,
|
|
114
115
|
MuiRadio,
|
|
115
116
|
MuiSelect,
|