norma-library 0.4.2 → 0.4.5
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/.babelrc.json +18 -0
- package/buildcache/front-end +1 -0
- package/dist/esm/components/Accordion.d.ts +3 -0
- package/dist/esm/components/Accordion.js +24 -0
- package/dist/esm/components/Accordion.js.map +1 -0
- package/dist/esm/components/Button.d.ts +3 -0
- package/dist/esm/components/Button.js +22 -0
- package/dist/esm/components/Button.js.map +1 -0
- package/dist/esm/components/Card.d.ts +7 -0
- package/dist/esm/components/Card.js +31 -0
- package/dist/esm/components/Card.js.map +1 -0
- package/dist/esm/components/CheckBox.d.ts +3 -0
- package/dist/esm/components/CheckBox.js +13 -0
- package/dist/esm/components/CheckBox.js.map +1 -0
- package/dist/esm/components/DropDown.d.ts +3 -0
- package/dist/esm/components/DropDown.js +17 -0
- package/dist/esm/components/DropDown.js.map +1 -0
- package/dist/esm/components/IconButton.d.ts +3 -0
- package/dist/esm/components/IconButton.js +31 -0
- package/dist/esm/components/IconButton.js.map +1 -0
- package/dist/esm/components/Icons.d.ts +7 -0
- package/dist/esm/components/Icons.js +49 -0
- package/dist/esm/components/Icons.js.map +1 -0
- package/dist/esm/components/Modal.d.ts +4 -0
- package/dist/esm/components/Modal.js +32 -0
- package/dist/esm/components/Modal.js.map +1 -0
- package/dist/esm/components/Paper.d.ts +3 -0
- package/dist/esm/components/Paper.js +14 -0
- package/dist/esm/components/Paper.js.map +1 -0
- package/dist/esm/components/ProgressBar.d.ts +6 -0
- package/dist/esm/components/ProgressBar.js +31 -0
- package/dist/esm/components/ProgressBar.js.map +1 -0
- package/dist/esm/components/RadioGroup.d.ts +3 -0
- package/dist/esm/components/RadioGroup.js +18 -0
- package/dist/esm/components/RadioGroup.js.map +1 -0
- package/dist/esm/components/RangerSlider.d.ts +3 -0
- package/dist/esm/components/RangerSlider.js +64 -0
- package/dist/esm/components/RangerSlider.js.map +1 -0
- package/dist/esm/components/Select.d.ts +3 -0
- package/dist/esm/components/Select.js +45 -0
- package/dist/esm/components/Select.js.map +1 -0
- package/dist/esm/components/Svgs.d.ts +29 -0
- package/dist/esm/components/Svgs.js +102 -0
- package/dist/esm/components/Svgs.js.map +1 -0
- package/dist/esm/components/Tabs.d.ts +3 -0
- package/dist/esm/components/Tabs.js +78 -0
- package/dist/esm/components/Tabs.js.map +1 -0
- package/dist/esm/components/Tag.d.ts +3 -0
- package/dist/esm/components/Tag.js +27 -0
- package/dist/esm/components/Tag.js.map +1 -0
- package/dist/esm/components/TextField.d.ts +3 -0
- package/dist/esm/components/TextField.js +18 -0
- package/dist/esm/components/TextField.js.map +1 -0
- package/dist/esm/components/button/index.d.ts +3 -0
- package/dist/esm/components/button/index.js +22 -0
- package/dist/esm/components/button/index.js.map +1 -0
- package/dist/esm/components/checkbox/index.d.ts +3 -0
- package/dist/esm/components/checkbox/index.js +13 -0
- package/dist/esm/components/checkbox/index.js.map +1 -0
- package/dist/esm/components/icons/index.d.ts +7 -0
- package/dist/esm/components/icons/index.js +49 -0
- package/dist/esm/components/icons/index.js.map +1 -0
- package/dist/esm/components/icons/svgs.d.ts +29 -0
- package/dist/esm/components/icons/svgs.js +102 -0
- package/dist/esm/components/icons/svgs.js.map +1 -0
- package/dist/esm/components/index.d.ts +16 -0
- package/dist/esm/components/index.js +17 -0
- package/dist/esm/components/index.js.map +1 -0
- package/dist/esm/components/textfield/index.d.ts +3 -0
- package/dist/esm/components/textfield/index.js +18 -0
- package/dist/esm/components/textfield/index.js.map +1 -0
- package/dist/esm/helpers/alignments.d.ts +2 -0
- package/dist/esm/helpers/alignments.js +14 -0
- package/dist/esm/helpers/alignments.js.map +1 -0
- package/dist/esm/helpers/borders.d.ts +2 -0
- package/dist/esm/helpers/borders.js +18 -0
- package/dist/esm/helpers/borders.js.map +1 -0
- package/dist/esm/helpers/colors.d.ts +172 -0
- package/dist/esm/helpers/colors.js +156 -0
- package/dist/esm/helpers/colors.js.map +1 -0
- package/dist/esm/helpers/index.d.ts +5 -0
- package/dist/esm/helpers/index.js +6 -0
- package/dist/esm/helpers/index.js.map +1 -0
- package/dist/esm/helpers/radios.d.ts +2 -0
- package/dist/esm/helpers/radios.js +24 -0
- package/dist/esm/helpers/radios.js.map +1 -0
- package/dist/esm/helpers/sizes.d.ts +11 -0
- package/dist/esm/helpers/sizes.js +67 -0
- package/dist/esm/helpers/sizes.js.map +1 -0
- package/dist/esm/index.d.ts +17 -0
- package/dist/esm/index.js +18 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/interfaces/Accordion.d.ts +12 -0
- package/dist/esm/interfaces/Accordion.js +2 -0
- package/dist/esm/interfaces/Accordion.js.map +1 -0
- package/dist/esm/interfaces/Button.d.ts +14 -0
- package/dist/esm/interfaces/Button.js +2 -0
- package/dist/esm/interfaces/Button.js.map +1 -0
- package/dist/esm/interfaces/Card.d.ts +11 -0
- package/dist/esm/interfaces/Card.js +2 -0
- package/dist/esm/interfaces/Card.js.map +1 -0
- package/dist/esm/interfaces/CheckBox.d.ts +19 -0
- package/dist/esm/interfaces/CheckBox.js +2 -0
- package/dist/esm/interfaces/CheckBox.js.map +1 -0
- package/dist/esm/interfaces/DropDown.d.ts +11 -0
- package/dist/esm/interfaces/DropDown.js +2 -0
- package/dist/esm/interfaces/DropDown.js.map +1 -0
- package/dist/esm/interfaces/Icon.d.ts +15 -0
- package/dist/esm/interfaces/Icon.js +2 -0
- package/dist/esm/interfaces/Icon.js.map +1 -0
- package/dist/esm/interfaces/IconButton.d.ts +14 -0
- package/dist/esm/interfaces/IconButton.js +2 -0
- package/dist/esm/interfaces/IconButton.js.map +1 -0
- package/dist/esm/interfaces/Icons.d.ts +15 -0
- package/dist/esm/interfaces/Icons.js +2 -0
- package/dist/esm/interfaces/Icons.js.map +1 -0
- package/dist/esm/interfaces/Modal.d.ts +15 -0
- package/dist/esm/interfaces/Modal.js +2 -0
- package/dist/esm/interfaces/Modal.js.map +1 -0
- package/dist/esm/interfaces/Paper.d.ts +12 -0
- package/dist/esm/interfaces/Paper.js +2 -0
- package/dist/esm/interfaces/Paper.js.map +1 -0
- package/dist/esm/interfaces/ProgressBar.d.ts +17 -0
- package/dist/esm/interfaces/ProgressBar.js +2 -0
- package/dist/esm/interfaces/ProgressBar.js.map +1 -0
- package/dist/esm/interfaces/RadioGroup.d.ts +15 -0
- package/dist/esm/interfaces/RadioGroup.js +2 -0
- package/dist/esm/interfaces/RadioGroup.js.map +1 -0
- package/dist/esm/interfaces/RangerSlider.d.ts +18 -0
- package/dist/esm/interfaces/RangerSlider.js +2 -0
- package/dist/esm/interfaces/RangerSlider.js.map +1 -0
- package/dist/esm/interfaces/Select.d.ts +17 -0
- package/dist/esm/interfaces/Select.js +2 -0
- package/dist/esm/interfaces/Select.js.map +1 -0
- package/dist/esm/interfaces/Tabs.d.ts +18 -0
- package/dist/esm/interfaces/Tabs.js +2 -0
- package/dist/esm/interfaces/Tabs.js.map +1 -0
- package/dist/esm/interfaces/Tag.d.ts +18 -0
- package/dist/esm/interfaces/Tag.js +2 -0
- package/dist/esm/interfaces/Tag.js.map +1 -0
- package/dist/esm/interfaces/TextField.d.ts +40 -0
- package/dist/esm/interfaces/TextField.js +2 -0
- package/dist/esm/interfaces/TextField.js.map +1 -0
- package/dist/esm/interfaces/index.d.ts +17 -0
- package/dist/esm/interfaces/index.js +18 -0
- package/dist/esm/interfaces/index.js.map +1 -0
- package/dist/esm/types/index.d.ts +78 -0
- package/dist/esm/types/index.js +10 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/index.css +8363 -0
- package/norma-library.tar +0 -0
- package/package.json +75 -90
- package/postcss.config.js +6 -0
- package/src/components/Accordion.tsx +64 -0
- package/src/components/Button.tsx +38 -0
- package/src/components/Card.tsx +47 -0
- package/src/components/CheckBox.tsx +35 -0
- package/src/components/DropDown.tsx +38 -0
- package/src/components/IconButton.tsx +58 -0
- package/src/components/Icons.tsx +87 -0
- package/src/components/Modal.tsx +123 -0
- package/src/components/Paper.tsx +22 -0
- package/src/components/ProgressBar.tsx +62 -0
- package/src/components/RadioGroup.tsx +55 -0
- package/src/components/RangerSlider.tsx +81 -0
- package/src/components/Select.tsx +98 -0
- package/src/components/Svgs.tsx +522 -0
- package/src/components/Tabs.tsx +140 -0
- package/src/components/Tag.tsx +45 -0
- package/src/components/TextField.tsx +35 -0
- package/src/components/index.ts +16 -0
- package/src/helpers/alignments.ts +14 -0
- package/src/helpers/borders.ts +18 -0
- package/src/helpers/colors.ts +173 -0
- package/src/helpers/index.ts +5 -0
- package/src/helpers/radios.ts +24 -0
- package/src/helpers/sizes.ts +79 -0
- package/src/index.css +2 -0
- package/src/index.ts +36 -0
- package/src/interfaces/Accordion.ts +12 -0
- package/src/interfaces/Button.ts +27 -0
- package/src/interfaces/Card.ts +11 -0
- package/src/interfaces/CheckBox.ts +33 -0
- package/src/interfaces/DropDown.ts +14 -0
- package/src/interfaces/IconButton.ts +27 -0
- package/src/interfaces/Icons.ts +17 -0
- package/src/interfaces/Modal.ts +15 -0
- package/src/interfaces/Paper.ts +12 -0
- package/src/interfaces/ProgressBar.ts +25 -0
- package/src/interfaces/RadioGroup.ts +28 -0
- package/src/interfaces/RangerSlider.ts +32 -0
- package/src/interfaces/Select.ts +17 -0
- package/src/interfaces/Tabs.ts +24 -0
- package/src/interfaces/Tag.ts +17 -0
- package/src/interfaces/TextField.ts +63 -0
- package/src/interfaces/index.ts +17 -0
- package/src/stories/Accordion.stories.tsx +65 -0
- package/src/stories/Button.stories.tsx +99 -0
- package/src/stories/Card.stories.tsx +55 -0
- package/src/stories/CheckBox.stories.tsx +94 -0
- package/src/stories/Colors.stories.mdx +127 -0
- package/src/stories/DropDown.stories.tsx +57 -0
- package/src/stories/IconButton.stories.tsx +114 -0
- package/src/stories/Icons.stories.mdx +27 -0
- package/src/stories/Modal.stories.tsx +190 -0
- package/src/stories/Paper.stories.tsx +53 -0
- package/src/stories/ProgressBar.stories.tsx +139 -0
- package/src/stories/RadioGroup.stories.tsx +94 -0
- package/src/stories/RangerSlider.stories.tsx +68 -0
- package/src/stories/Select.stories.tsx +128 -0
- package/src/stories/Tabs.stories.tsx +62 -0
- package/src/stories/Tag.stories.tsx +76 -0
- package/src/stories/TextField.stories.tsx +445 -0
- package/src/styles/custom.css +5 -0
- package/src/styles/globals.css +21 -0
- package/src/types/index.ts +220 -0
- package/tailwind.config.js +58 -0
- package/tsconfig.json +32 -0
- package/README.md +0 -160
- package/dist/index.js +0 -8
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import Box from "@mui/material/Box";
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
5
|
+
import { TextField } from "../components";
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
title: "Form/TextField",
|
|
9
|
+
component: TextField,
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: "centered",
|
|
12
|
+
},
|
|
13
|
+
tags: ["autodocs"],
|
|
14
|
+
argTypes: {},
|
|
15
|
+
} satisfies Meta<typeof TextField>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
|
|
21
|
+
const defaultArgs = {
|
|
22
|
+
disabled: false,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const Playground: Story = {
|
|
26
|
+
args: {
|
|
27
|
+
label: "Nome",
|
|
28
|
+
id: "input-demo",
|
|
29
|
+
color: "primary",
|
|
30
|
+
variant: "standard",
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const TextFieldVariant = () => (
|
|
35
|
+
<>
|
|
36
|
+
<TextField variant="standard" label="Variant text" />
|
|
37
|
+
<TextField variant="filled" label="Variant Contained" />
|
|
38
|
+
<TextField variant="outlined" label="Variant Outlined" />
|
|
39
|
+
</>
|
|
40
|
+
);
|
|
41
|
+
TextFieldVariant.storyName = "TextField Variants";
|
|
42
|
+
|
|
43
|
+
export const TextFieldValidation = () => (
|
|
44
|
+
<div style={{ display: "flex", gap: "1rem", margin: 15 }}>
|
|
45
|
+
<Box
|
|
46
|
+
component="form"
|
|
47
|
+
sx={{
|
|
48
|
+
"& .MuiTextField-root": { m: 1, width: "100%" },
|
|
49
|
+
}}
|
|
50
|
+
noValidate
|
|
51
|
+
autoComplete="off"
|
|
52
|
+
>
|
|
53
|
+
<div>
|
|
54
|
+
<TextField
|
|
55
|
+
error
|
|
56
|
+
id="outlined-error"
|
|
57
|
+
label="Error"
|
|
58
|
+
defaultValue="Hello World"
|
|
59
|
+
/>
|
|
60
|
+
<TextField
|
|
61
|
+
error
|
|
62
|
+
id="outlined-error-helper-text"
|
|
63
|
+
label="Error"
|
|
64
|
+
defaultValue="Hello World"
|
|
65
|
+
helperText="Incorrect entry."
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
<div>
|
|
69
|
+
<TextField
|
|
70
|
+
error
|
|
71
|
+
id="filled-error"
|
|
72
|
+
label="Error"
|
|
73
|
+
defaultValue="Hello World"
|
|
74
|
+
variant="filled"
|
|
75
|
+
/>
|
|
76
|
+
<TextField
|
|
77
|
+
error
|
|
78
|
+
id="filled-error-helper-text"
|
|
79
|
+
label="Error"
|
|
80
|
+
defaultValue="Hello World"
|
|
81
|
+
helperText="Incorrect entry."
|
|
82
|
+
variant="filled"
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
<div>
|
|
86
|
+
<TextField
|
|
87
|
+
error
|
|
88
|
+
id="standard-error"
|
|
89
|
+
label="Error"
|
|
90
|
+
defaultValue="Hello World"
|
|
91
|
+
variant="standard"
|
|
92
|
+
/>
|
|
93
|
+
<TextField
|
|
94
|
+
error
|
|
95
|
+
id="standard-error-helper-text"
|
|
96
|
+
label="Error"
|
|
97
|
+
defaultValue="Hello World"
|
|
98
|
+
helperText="Incorrect entry."
|
|
99
|
+
variant="standard"
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
</Box>
|
|
103
|
+
</div>
|
|
104
|
+
);
|
|
105
|
+
TextFieldValidation.storyName = "TextField Validation";
|
|
106
|
+
|
|
107
|
+
export const TextFieldMultiline = () => (
|
|
108
|
+
<div style={{ display: "flex", gap: "1rem", margin: 15 }}>
|
|
109
|
+
<Box
|
|
110
|
+
component="form"
|
|
111
|
+
sx={{
|
|
112
|
+
"& .MuiTextField-root": { m: 1, width: "100%" },
|
|
113
|
+
}}
|
|
114
|
+
noValidate
|
|
115
|
+
autoComplete="off"
|
|
116
|
+
>
|
|
117
|
+
<div>
|
|
118
|
+
<TextField
|
|
119
|
+
id="outlined-multiline-flexible"
|
|
120
|
+
label="Multiline"
|
|
121
|
+
multiline
|
|
122
|
+
maxRows={4}
|
|
123
|
+
/>
|
|
124
|
+
<TextField
|
|
125
|
+
id="outlined-textarea"
|
|
126
|
+
label="Multiline Placeholder"
|
|
127
|
+
placeholder="Placeholder"
|
|
128
|
+
multiline
|
|
129
|
+
/>
|
|
130
|
+
<TextField
|
|
131
|
+
id="outlined-multiline-static"
|
|
132
|
+
label="Multiline"
|
|
133
|
+
multiline
|
|
134
|
+
rows={4}
|
|
135
|
+
defaultValue="Default Value"
|
|
136
|
+
/>
|
|
137
|
+
</div>
|
|
138
|
+
<div>
|
|
139
|
+
<TextField
|
|
140
|
+
id="filled-multiline-flexible"
|
|
141
|
+
label="Multiline"
|
|
142
|
+
multiline
|
|
143
|
+
maxRows={4}
|
|
144
|
+
variant="filled"
|
|
145
|
+
/>
|
|
146
|
+
<TextField
|
|
147
|
+
id="filled-textarea"
|
|
148
|
+
label="Multiline Placeholder"
|
|
149
|
+
placeholder="Placeholder"
|
|
150
|
+
multiline
|
|
151
|
+
variant="filled"
|
|
152
|
+
/>
|
|
153
|
+
<TextField
|
|
154
|
+
id="filled-multiline-static"
|
|
155
|
+
label="Multiline"
|
|
156
|
+
multiline
|
|
157
|
+
rows={4}
|
|
158
|
+
defaultValue="Default Value"
|
|
159
|
+
variant="filled"
|
|
160
|
+
/>
|
|
161
|
+
</div>
|
|
162
|
+
<div>
|
|
163
|
+
<TextField
|
|
164
|
+
id="standard-multiline-flexible"
|
|
165
|
+
label="Multiline"
|
|
166
|
+
multiline
|
|
167
|
+
maxRows={4}
|
|
168
|
+
variant="standard"
|
|
169
|
+
/>
|
|
170
|
+
<TextField
|
|
171
|
+
id="standard-textarea"
|
|
172
|
+
label="Multiline Placeholder"
|
|
173
|
+
placeholder="Placeholder"
|
|
174
|
+
multiline
|
|
175
|
+
variant="standard"
|
|
176
|
+
/>
|
|
177
|
+
<TextField
|
|
178
|
+
id="standard-multiline-static"
|
|
179
|
+
label="Multiline"
|
|
180
|
+
multiline
|
|
181
|
+
rows={4}
|
|
182
|
+
defaultValue="Default Value"
|
|
183
|
+
variant="standard"
|
|
184
|
+
/>
|
|
185
|
+
</div>
|
|
186
|
+
</Box>
|
|
187
|
+
</div>
|
|
188
|
+
);
|
|
189
|
+
TextFieldMultiline.storyName = "TextField Multiline";
|
|
190
|
+
|
|
191
|
+
export const TextFieldSizes = () => (
|
|
192
|
+
<div style={{ display: "flex", gap: "1rem", margin: 15 }}>
|
|
193
|
+
<Box
|
|
194
|
+
component="form"
|
|
195
|
+
sx={{
|
|
196
|
+
"& .MuiTextField-root": { m: 1, width: "100%" },
|
|
197
|
+
}}
|
|
198
|
+
noValidate
|
|
199
|
+
autoComplete="off"
|
|
200
|
+
>
|
|
201
|
+
<div>
|
|
202
|
+
<TextField
|
|
203
|
+
label="Size"
|
|
204
|
+
id="outlined-size-small"
|
|
205
|
+
defaultValue="Small"
|
|
206
|
+
size="small"
|
|
207
|
+
/>
|
|
208
|
+
<TextField
|
|
209
|
+
label="Size"
|
|
210
|
+
id="outlined-size-normal"
|
|
211
|
+
defaultValue="Normal"
|
|
212
|
+
/>
|
|
213
|
+
</div>
|
|
214
|
+
<div>
|
|
215
|
+
<TextField
|
|
216
|
+
label="Size"
|
|
217
|
+
id="filled-size-small"
|
|
218
|
+
defaultValue="Small"
|
|
219
|
+
variant="filled"
|
|
220
|
+
size="small"
|
|
221
|
+
/>
|
|
222
|
+
<TextField
|
|
223
|
+
label="Size"
|
|
224
|
+
id="filled-size-normal"
|
|
225
|
+
defaultValue="Normal"
|
|
226
|
+
variant="filled"
|
|
227
|
+
/>
|
|
228
|
+
</div>
|
|
229
|
+
<div>
|
|
230
|
+
<TextField
|
|
231
|
+
label="Size"
|
|
232
|
+
id="standard-size-small"
|
|
233
|
+
defaultValue="Small"
|
|
234
|
+
size="small"
|
|
235
|
+
variant="standard"
|
|
236
|
+
/>
|
|
237
|
+
<TextField
|
|
238
|
+
label="Size"
|
|
239
|
+
id="standard-size-normal"
|
|
240
|
+
defaultValue="Normal"
|
|
241
|
+
variant="standard"
|
|
242
|
+
/>
|
|
243
|
+
</div>
|
|
244
|
+
</Box>
|
|
245
|
+
</div>
|
|
246
|
+
);
|
|
247
|
+
TextFieldSizes.storyName = "TextField Sizes";
|
|
248
|
+
|
|
249
|
+
export const TextFieldColors = () => (
|
|
250
|
+
<div style={{ display: "flex", gap: "1rem", margin: 15 }}>
|
|
251
|
+
<Box
|
|
252
|
+
component="form"
|
|
253
|
+
sx={{
|
|
254
|
+
"& > :not(style)": { m: 1, width: "100%" },
|
|
255
|
+
}}
|
|
256
|
+
noValidate
|
|
257
|
+
autoComplete="off"
|
|
258
|
+
>
|
|
259
|
+
<TextField label="Outlined Primary" color="primary" focused />
|
|
260
|
+
<TextField label="Outlined secondary" color="secondary" focused />
|
|
261
|
+
<TextField
|
|
262
|
+
label="Filled success"
|
|
263
|
+
variant="filled"
|
|
264
|
+
color="success"
|
|
265
|
+
focused
|
|
266
|
+
/>
|
|
267
|
+
<TextField
|
|
268
|
+
label="Standard warning"
|
|
269
|
+
variant="standard"
|
|
270
|
+
color="warning"
|
|
271
|
+
focused
|
|
272
|
+
/>
|
|
273
|
+
</Box>
|
|
274
|
+
</div>
|
|
275
|
+
);
|
|
276
|
+
TextFieldColors.storyName = "TextField Colors";
|
|
277
|
+
|
|
278
|
+
export const TextFieldProps = () => (
|
|
279
|
+
<div style={{ display: "flex", gap: "1rem", margin: 15 }}>
|
|
280
|
+
<Box
|
|
281
|
+
component="form"
|
|
282
|
+
sx={{
|
|
283
|
+
"& .MuiTextField-root": { m: 1, width: "100%" },
|
|
284
|
+
display: "flex",
|
|
285
|
+
gap: "1rem",
|
|
286
|
+
margin: 15,
|
|
287
|
+
}}
|
|
288
|
+
noValidate
|
|
289
|
+
autoComplete="off"
|
|
290
|
+
>
|
|
291
|
+
<div>
|
|
292
|
+
<TextField
|
|
293
|
+
required
|
|
294
|
+
id="outlined-required"
|
|
295
|
+
label="Required"
|
|
296
|
+
defaultValue="Hello World"
|
|
297
|
+
/>
|
|
298
|
+
<TextField
|
|
299
|
+
disabled
|
|
300
|
+
id="outlined-disabled"
|
|
301
|
+
label="Disabled"
|
|
302
|
+
defaultValue="Hello World"
|
|
303
|
+
/>
|
|
304
|
+
<TextField
|
|
305
|
+
id="outlined-password-input"
|
|
306
|
+
label="Password"
|
|
307
|
+
type="password"
|
|
308
|
+
autoComplete="current-password"
|
|
309
|
+
/>
|
|
310
|
+
<TextField
|
|
311
|
+
id="outlined-read-only-input"
|
|
312
|
+
label="Read Only"
|
|
313
|
+
defaultValue="Hello World"
|
|
314
|
+
InputProps={{
|
|
315
|
+
readOnly: true,
|
|
316
|
+
}}
|
|
317
|
+
/>
|
|
318
|
+
<TextField
|
|
319
|
+
id="outlined-number"
|
|
320
|
+
label="Number"
|
|
321
|
+
type="number"
|
|
322
|
+
InputLabelProps={{
|
|
323
|
+
shrink: true,
|
|
324
|
+
}}
|
|
325
|
+
/>
|
|
326
|
+
<TextField id="outlined-search" label="Search field" type="search" />
|
|
327
|
+
<TextField
|
|
328
|
+
id="outlined-helperText"
|
|
329
|
+
label="Helper text"
|
|
330
|
+
defaultValue="Default Value"
|
|
331
|
+
helperText="Some important text"
|
|
332
|
+
/>
|
|
333
|
+
</div>
|
|
334
|
+
<div>
|
|
335
|
+
<TextField
|
|
336
|
+
required
|
|
337
|
+
id="filled-required"
|
|
338
|
+
label="Required"
|
|
339
|
+
defaultValue="Hello World"
|
|
340
|
+
variant="filled"
|
|
341
|
+
/>
|
|
342
|
+
<TextField
|
|
343
|
+
disabled
|
|
344
|
+
id="filled-disabled"
|
|
345
|
+
label="Disabled"
|
|
346
|
+
defaultValue="Hello World"
|
|
347
|
+
variant="filled"
|
|
348
|
+
/>
|
|
349
|
+
<TextField
|
|
350
|
+
id="filled-password-input"
|
|
351
|
+
label="Password"
|
|
352
|
+
type="password"
|
|
353
|
+
autoComplete="current-password"
|
|
354
|
+
variant="filled"
|
|
355
|
+
/>
|
|
356
|
+
<TextField
|
|
357
|
+
id="filled-read-only-input"
|
|
358
|
+
label="Read Only"
|
|
359
|
+
defaultValue="Hello World"
|
|
360
|
+
InputProps={{
|
|
361
|
+
readOnly: true,
|
|
362
|
+
}}
|
|
363
|
+
variant="filled"
|
|
364
|
+
/>
|
|
365
|
+
<TextField
|
|
366
|
+
id="filled-number"
|
|
367
|
+
label="Number"
|
|
368
|
+
type="number"
|
|
369
|
+
InputLabelProps={{
|
|
370
|
+
shrink: true,
|
|
371
|
+
}}
|
|
372
|
+
variant="filled"
|
|
373
|
+
/>
|
|
374
|
+
<TextField
|
|
375
|
+
id="filled-search"
|
|
376
|
+
label="Search field"
|
|
377
|
+
type="search"
|
|
378
|
+
variant="filled"
|
|
379
|
+
/>
|
|
380
|
+
<TextField
|
|
381
|
+
id="filled-helperText"
|
|
382
|
+
label="Helper text"
|
|
383
|
+
defaultValue="Default Value"
|
|
384
|
+
helperText="Some important text"
|
|
385
|
+
variant="filled"
|
|
386
|
+
/>
|
|
387
|
+
</div>
|
|
388
|
+
<div>
|
|
389
|
+
<TextField
|
|
390
|
+
required
|
|
391
|
+
id="standard-required"
|
|
392
|
+
label="Required"
|
|
393
|
+
defaultValue="Hello World"
|
|
394
|
+
variant="standard"
|
|
395
|
+
/>
|
|
396
|
+
<TextField
|
|
397
|
+
disabled
|
|
398
|
+
id="standard-disabled"
|
|
399
|
+
label="Disabled"
|
|
400
|
+
defaultValue="Hello World"
|
|
401
|
+
variant="standard"
|
|
402
|
+
/>
|
|
403
|
+
<TextField
|
|
404
|
+
id="standard-password-input"
|
|
405
|
+
label="Password"
|
|
406
|
+
type="password"
|
|
407
|
+
autoComplete="current-password"
|
|
408
|
+
variant="standard"
|
|
409
|
+
/>
|
|
410
|
+
<TextField
|
|
411
|
+
id="standard-read-only-input"
|
|
412
|
+
label="Read Only"
|
|
413
|
+
defaultValue="Hello World"
|
|
414
|
+
InputProps={{
|
|
415
|
+
readOnly: true,
|
|
416
|
+
}}
|
|
417
|
+
variant="standard"
|
|
418
|
+
/>
|
|
419
|
+
<TextField
|
|
420
|
+
id="standard-number"
|
|
421
|
+
label="Number"
|
|
422
|
+
type="number"
|
|
423
|
+
InputLabelProps={{
|
|
424
|
+
shrink: true,
|
|
425
|
+
}}
|
|
426
|
+
variant="standard"
|
|
427
|
+
/>
|
|
428
|
+
<TextField
|
|
429
|
+
id="standard-search"
|
|
430
|
+
label="Search field"
|
|
431
|
+
type="search"
|
|
432
|
+
variant="standard"
|
|
433
|
+
/>
|
|
434
|
+
<TextField
|
|
435
|
+
id="standard-helperText"
|
|
436
|
+
label="Helper text"
|
|
437
|
+
defaultValue="Default Value"
|
|
438
|
+
helperText="Some important text"
|
|
439
|
+
variant="standard"
|
|
440
|
+
/>
|
|
441
|
+
</div>
|
|
442
|
+
</Box>
|
|
443
|
+
</div>
|
|
444
|
+
);
|
|
445
|
+
TextFieldProps.storyName = "TextField Props";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
:root {
|
|
6
|
+
--transparent: transparent;
|
|
7
|
+
--current: currentColor;
|
|
8
|
+
--primary: #fe761c;
|
|
9
|
+
--secondary: #43bbf2;
|
|
10
|
+
--error: #d63643;
|
|
11
|
+
--warning: #ffc300;
|
|
12
|
+
--info: #71d5f7;
|
|
13
|
+
--success: #6bc235;
|
|
14
|
+
--helper: #5a2a79;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.appearance-none {
|
|
18
|
+
-webkit-appearance: none;
|
|
19
|
+
-moz-appearance: none;
|
|
20
|
+
appearance: none;
|
|
21
|
+
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ButtonProps as MuiButtonProps,
|
|
3
|
+
IconButtonProps as MuiIconButtonProps,
|
|
4
|
+
TextFieldProps as MuiTextFieldProps,
|
|
5
|
+
CheckboxProps as MuiCheckBoxProps,
|
|
6
|
+
MenuProps as MuiDropDownProps,
|
|
7
|
+
ChipProps as MuiChipProps,
|
|
8
|
+
LinearProgressProps as MuiLinearProgressProps,
|
|
9
|
+
SliderProps as MuiSliderProps,
|
|
10
|
+
AccordionProps as MuiAccordionProps,
|
|
11
|
+
TabsProps as MuiTabsProps,
|
|
12
|
+
SelectProps as MuiSelectProps,
|
|
13
|
+
PaperProps as MuiPaperProps,
|
|
14
|
+
SvgIconProps,
|
|
15
|
+
ModalProps,
|
|
16
|
+
CardProps as MuiCardProps,
|
|
17
|
+
} from "@mui/material";
|
|
18
|
+
|
|
19
|
+
import { SwitchBaseProps as MuiSwitchBaseProps } from "@mui/material/internal/SwitchBase";
|
|
20
|
+
|
|
21
|
+
import { iconsSVG } from "../components/Svgs";
|
|
22
|
+
|
|
23
|
+
export type ColorVariant =
|
|
24
|
+
| "inherit"
|
|
25
|
+
| "primary"
|
|
26
|
+
| "secondary"
|
|
27
|
+
| "success"
|
|
28
|
+
| "error"
|
|
29
|
+
| "info"
|
|
30
|
+
| "warning";
|
|
31
|
+
|
|
32
|
+
export type TextFieldColorVariant =
|
|
33
|
+
| "primary"
|
|
34
|
+
| "secondary"
|
|
35
|
+
| "error"
|
|
36
|
+
| "info"
|
|
37
|
+
| "success"
|
|
38
|
+
| "warning";
|
|
39
|
+
|
|
40
|
+
export type CheckBoxColorVariant =
|
|
41
|
+
| "primary"
|
|
42
|
+
| "secondary"
|
|
43
|
+
| "error"
|
|
44
|
+
| "info"
|
|
45
|
+
| "success"
|
|
46
|
+
| "warning"
|
|
47
|
+
| "default";
|
|
48
|
+
|
|
49
|
+
export type SizeVariant = "small" | "medium" | "large";
|
|
50
|
+
export type ButtonVariant = "text" | "outlined" | "contained";
|
|
51
|
+
export type DropVariant = "menu" | "selectedMenu";
|
|
52
|
+
export type TagVariant = "outlined" | "contained";
|
|
53
|
+
export type TabsVariant = "standard" | "scrollable" | "fullWidth";
|
|
54
|
+
export type ProgressVariant =
|
|
55
|
+
| "determinate"
|
|
56
|
+
| "indeterminate"
|
|
57
|
+
| "buffer"
|
|
58
|
+
| "query";
|
|
59
|
+
|
|
60
|
+
export type MuiButtonBaseProps = Omit<
|
|
61
|
+
MuiButtonProps,
|
|
62
|
+
"sx" | "color" | "size" | "variant"
|
|
63
|
+
>;
|
|
64
|
+
|
|
65
|
+
export type MuiIconButtonBaseProps = Omit<
|
|
66
|
+
MuiIconButtonProps,
|
|
67
|
+
"sx" | "color" | "size" | "variant"
|
|
68
|
+
>;
|
|
69
|
+
|
|
70
|
+
export type TextFieldValue = string | number;
|
|
71
|
+
export type TextFieldVariant = "standard" | "outlined" | "filled";
|
|
72
|
+
export type TextFieldSizeVariant = "small" | "medium";
|
|
73
|
+
export type DirectionVariant = "vertical" | "horizontal";
|
|
74
|
+
export type PaperVariant = "elevation" | "outlined";
|
|
75
|
+
|
|
76
|
+
export type MuiTextFieldBaseProps = Omit<
|
|
77
|
+
MuiTextFieldProps,
|
|
78
|
+
| "onChange"
|
|
79
|
+
| "onBlur"
|
|
80
|
+
| "onFocus"
|
|
81
|
+
| "defaultValue"
|
|
82
|
+
| "size"
|
|
83
|
+
| "value"
|
|
84
|
+
| "id"
|
|
85
|
+
| "fullWidth"
|
|
86
|
+
| "helperText"
|
|
87
|
+
| "type"
|
|
88
|
+
| "InputProps"
|
|
89
|
+
| "InputLabelProps"
|
|
90
|
+
| "autoComplete"
|
|
91
|
+
| "label"
|
|
92
|
+
| "helperText"
|
|
93
|
+
| "InputLabelProps"
|
|
94
|
+
| "margin"
|
|
95
|
+
| "maxRows"
|
|
96
|
+
| "minRows"
|
|
97
|
+
| "multiline"
|
|
98
|
+
| "name"
|
|
99
|
+
| "placeholder"
|
|
100
|
+
| "rows"
|
|
101
|
+
| "select"
|
|
102
|
+
| "SelectProps"
|
|
103
|
+
| "sx"
|
|
104
|
+
| "autoFocus"
|
|
105
|
+
| "error"
|
|
106
|
+
| "classes"
|
|
107
|
+
| "children"
|
|
108
|
+
| "color"
|
|
109
|
+
| "variant"
|
|
110
|
+
>;
|
|
111
|
+
|
|
112
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
113
|
+
export interface CheckboxPropsSizeOverrides {}
|
|
114
|
+
|
|
115
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
116
|
+
export interface CheckboxPropsColorOverrides {}
|
|
117
|
+
|
|
118
|
+
export type MuiCheckBoxBaseProps = Omit<MuiCheckBoxProps, "sx">;
|
|
119
|
+
export type MuiModalBaseProps = Omit<ModalProps, "sx">;
|
|
120
|
+
export type MuiCardBaseProps = Omit<MuiCardProps, "sx">;
|
|
121
|
+
export type MuiDropDownBaseProps = Omit<MuiDropDownProps, "sx" | "variant">;
|
|
122
|
+
export type MuiTagBaseProps = Omit<MuiChipProps, "sx" | "color">;
|
|
123
|
+
export type MuiRangerSliderBaseProps = Omit<MuiSliderProps, "sx" | "color">;
|
|
124
|
+
export type MuiProgressBarBaseProps = Omit<MuiLinearProgressProps, "sx">;
|
|
125
|
+
export type MuiTabsBaseProps = Omit<
|
|
126
|
+
MuiTabsProps,
|
|
127
|
+
"sx" | "children" | "onChange" | "variant" | "value"
|
|
128
|
+
>;
|
|
129
|
+
export type MuiAccordionBaseProps = Omit<
|
|
130
|
+
MuiAccordionProps,
|
|
131
|
+
"sx" | "children" | "defaultExpanded" | "onChange"
|
|
132
|
+
>;
|
|
133
|
+
export type MuiSelectBaseProps = Omit<
|
|
134
|
+
MuiSelectProps,
|
|
135
|
+
"sx" | "value" | "onClose" | "onOpen" | "input" | "label"
|
|
136
|
+
>;
|
|
137
|
+
|
|
138
|
+
export type MuiPaperBaseProps = Omit<MuiPaperProps, "sx">;
|
|
139
|
+
|
|
140
|
+
export type IconScale =
|
|
141
|
+
| "xsmall"
|
|
142
|
+
| "small"
|
|
143
|
+
| "medium"
|
|
144
|
+
| "large"
|
|
145
|
+
| "xlarge"
|
|
146
|
+
| "2xlarge"
|
|
147
|
+
| "3xlarge";
|
|
148
|
+
|
|
149
|
+
export type IconColors =
|
|
150
|
+
| "inherit"
|
|
151
|
+
| "primary"
|
|
152
|
+
| "secondary"
|
|
153
|
+
| "error"
|
|
154
|
+
| "info"
|
|
155
|
+
| "success"
|
|
156
|
+
| "warning"
|
|
157
|
+
| "white"
|
|
158
|
+
| "black";
|
|
159
|
+
|
|
160
|
+
export const scaleSize: Record<IconScale, number> = {
|
|
161
|
+
xsmall: 14,
|
|
162
|
+
small: 20,
|
|
163
|
+
medium: 24,
|
|
164
|
+
large: 28,
|
|
165
|
+
xlarge: 32,
|
|
166
|
+
"2xlarge": 36,
|
|
167
|
+
"3xlarge": 40,
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export type SVGIconProps = {
|
|
171
|
+
icon: React.ReactNode;
|
|
172
|
+
} & SvgIconProps;
|
|
173
|
+
|
|
174
|
+
export type IconType = keyof typeof iconsSVG;
|
|
175
|
+
export type IconKey = keyof typeof iconsSVG;
|
|
176
|
+
|
|
177
|
+
export type MuiRadioBaseProps = Omit<
|
|
178
|
+
MuiSwitchBaseProps,
|
|
179
|
+
"checkedIcon" | "color" | "icon" | "type" | "checked" | "size"
|
|
180
|
+
>;
|
|
181
|
+
|
|
182
|
+
export type OptionsRadios = {
|
|
183
|
+
label: string;
|
|
184
|
+
value: string;
|
|
185
|
+
size?: TextFieldSizeVariant;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
export type OnAction = {
|
|
189
|
+
label: string;
|
|
190
|
+
action: React.ReactEventHandler<{}>;
|
|
191
|
+
color?: ColorVariant;
|
|
192
|
+
size?: SizeVariant;
|
|
193
|
+
variant?: ButtonVariant;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
export type DataAccordion = {
|
|
197
|
+
label: string;
|
|
198
|
+
id: string;
|
|
199
|
+
children: NonNullable<React.ReactNode>;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
export type DataTabs = {
|
|
203
|
+
label: string;
|
|
204
|
+
id: string;
|
|
205
|
+
children: NonNullable<React.ReactNode>;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
export type DataSelect = {
|
|
209
|
+
label: string;
|
|
210
|
+
value: string | number;
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
export type RenderProps<E extends HTMLElement = HTMLElement> = {
|
|
214
|
+
focusRef?: React.MutableRefObject<E | null>;
|
|
215
|
+
id?: string;
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
export type StyledProgressBarProps = {
|
|
219
|
+
colorCustom?: string;
|
|
220
|
+
};
|