norma-library 0.4.3 → 0.4.6

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.
Files changed (300) hide show
  1. package/.babelrc.json +18 -0
  2. package/buildcache/front-end +1 -0
  3. package/dist/esm/components/Accordion.d.ts +3 -0
  4. package/dist/esm/components/Accordion.js +24 -0
  5. package/dist/esm/components/Accordion.js.map +1 -0
  6. package/dist/esm/components/Button.d.ts +3 -0
  7. package/dist/esm/components/Button.js +22 -0
  8. package/dist/esm/components/Button.js.map +1 -0
  9. package/dist/esm/components/Card.d.ts +7 -0
  10. package/dist/esm/components/Card.js +31 -0
  11. package/dist/esm/components/Card.js.map +1 -0
  12. package/dist/esm/components/CheckBox.d.ts +3 -0
  13. package/dist/esm/components/CheckBox.js +13 -0
  14. package/dist/esm/components/CheckBox.js.map +1 -0
  15. package/dist/esm/components/DropDown.d.ts +3 -0
  16. package/dist/esm/components/DropDown.js +17 -0
  17. package/dist/esm/components/DropDown.js.map +1 -0
  18. package/dist/esm/components/IconButton.d.ts +3 -0
  19. package/dist/esm/components/IconButton.js +31 -0
  20. package/dist/esm/components/IconButton.js.map +1 -0
  21. package/dist/esm/components/Icons.d.ts +7 -0
  22. package/dist/esm/components/Icons.js +49 -0
  23. package/dist/esm/components/Icons.js.map +1 -0
  24. package/dist/esm/components/Modal.d.ts +4 -0
  25. package/dist/esm/components/Modal.js +32 -0
  26. package/dist/esm/components/Modal.js.map +1 -0
  27. package/dist/esm/components/Paper.d.ts +3 -0
  28. package/dist/esm/components/Paper.js +14 -0
  29. package/dist/esm/components/Paper.js.map +1 -0
  30. package/dist/esm/components/ProgressBar.d.ts +6 -0
  31. package/dist/esm/components/ProgressBar.js +31 -0
  32. package/dist/esm/components/ProgressBar.js.map +1 -0
  33. package/dist/esm/components/RadioGroup.d.ts +3 -0
  34. package/dist/esm/components/RadioGroup.js +18 -0
  35. package/dist/esm/components/RadioGroup.js.map +1 -0
  36. package/dist/esm/components/RangerSlider.d.ts +3 -0
  37. package/dist/esm/components/RangerSlider.js +64 -0
  38. package/dist/esm/components/RangerSlider.js.map +1 -0
  39. package/dist/esm/components/Select.d.ts +3 -0
  40. package/dist/esm/components/Select.js +45 -0
  41. package/dist/esm/components/Select.js.map +1 -0
  42. package/dist/{components/icon/norma.d.ts → esm/components/Svgs.d.ts} +29 -30
  43. package/dist/esm/components/Svgs.js +102 -0
  44. package/dist/esm/components/Svgs.js.map +1 -0
  45. package/dist/esm/components/Tabs.d.ts +3 -0
  46. package/dist/esm/components/Tabs.js +78 -0
  47. package/dist/esm/components/Tabs.js.map +1 -0
  48. package/dist/esm/components/Tag.d.ts +3 -0
  49. package/dist/esm/components/Tag.js +27 -0
  50. package/dist/esm/components/Tag.js.map +1 -0
  51. package/dist/esm/components/TextField.d.ts +3 -0
  52. package/dist/esm/components/TextField.js +18 -0
  53. package/dist/esm/components/TextField.js.map +1 -0
  54. package/dist/esm/components/index.d.ts +16 -0
  55. package/dist/esm/components/index.js +17 -0
  56. package/dist/esm/components/index.js.map +1 -0
  57. package/dist/esm/helpers/alignments.d.ts +2 -0
  58. package/dist/esm/helpers/alignments.js +14 -0
  59. package/dist/esm/helpers/alignments.js.map +1 -0
  60. package/dist/esm/helpers/borders.d.ts +2 -0
  61. package/dist/esm/helpers/borders.js +18 -0
  62. package/dist/esm/helpers/borders.js.map +1 -0
  63. package/dist/{helpers → esm/helpers}/colors.d.ts +172 -174
  64. package/dist/esm/helpers/colors.js +156 -0
  65. package/dist/esm/helpers/colors.js.map +1 -0
  66. package/dist/esm/helpers/index.d.ts +5 -0
  67. package/dist/esm/helpers/index.js +6 -0
  68. package/dist/esm/helpers/index.js.map +1 -0
  69. package/dist/esm/helpers/radios.d.ts +2 -0
  70. package/dist/esm/helpers/radios.js +24 -0
  71. package/dist/esm/helpers/radios.js.map +1 -0
  72. package/dist/esm/helpers/sizes.d.ts +11 -0
  73. package/dist/esm/helpers/sizes.js +67 -0
  74. package/dist/esm/helpers/sizes.js.map +1 -0
  75. package/dist/esm/index.d.ts +17 -0
  76. package/dist/esm/index.js +18 -0
  77. package/dist/esm/index.js.map +1 -0
  78. package/dist/esm/interfaces/Accordion.d.ts +12 -0
  79. package/dist/esm/interfaces/Accordion.js +2 -0
  80. package/dist/esm/interfaces/Accordion.js.map +1 -0
  81. package/dist/esm/interfaces/Button.d.ts +14 -0
  82. package/dist/esm/interfaces/Button.js +2 -0
  83. package/dist/esm/interfaces/Button.js.map +1 -0
  84. package/dist/esm/interfaces/Card.d.ts +11 -0
  85. package/dist/esm/interfaces/Card.js +2 -0
  86. package/dist/esm/interfaces/Card.js.map +1 -0
  87. package/dist/esm/interfaces/CheckBox.d.ts +19 -0
  88. package/dist/esm/interfaces/CheckBox.js +2 -0
  89. package/dist/esm/interfaces/CheckBox.js.map +1 -0
  90. package/dist/esm/interfaces/DropDown.d.ts +11 -0
  91. package/dist/esm/interfaces/DropDown.js +2 -0
  92. package/dist/esm/interfaces/DropDown.js.map +1 -0
  93. package/dist/esm/interfaces/IconButton.d.ts +14 -0
  94. package/dist/esm/interfaces/IconButton.js +2 -0
  95. package/dist/esm/interfaces/IconButton.js.map +1 -0
  96. package/dist/esm/interfaces/Icons.d.ts +15 -0
  97. package/dist/esm/interfaces/Icons.js +2 -0
  98. package/dist/esm/interfaces/Icons.js.map +1 -0
  99. package/dist/esm/interfaces/Modal.d.ts +15 -0
  100. package/dist/esm/interfaces/Modal.js +2 -0
  101. package/dist/esm/interfaces/Modal.js.map +1 -0
  102. package/dist/esm/interfaces/Paper.d.ts +12 -0
  103. package/dist/esm/interfaces/Paper.js +2 -0
  104. package/dist/esm/interfaces/Paper.js.map +1 -0
  105. package/dist/esm/interfaces/ProgressBar.d.ts +17 -0
  106. package/dist/esm/interfaces/ProgressBar.js +2 -0
  107. package/dist/esm/interfaces/ProgressBar.js.map +1 -0
  108. package/dist/esm/interfaces/RadioGroup.d.ts +15 -0
  109. package/dist/esm/interfaces/RadioGroup.js +2 -0
  110. package/dist/esm/interfaces/RadioGroup.js.map +1 -0
  111. package/dist/esm/interfaces/RangerSlider.d.ts +18 -0
  112. package/dist/esm/interfaces/RangerSlider.js +2 -0
  113. package/dist/esm/interfaces/RangerSlider.js.map +1 -0
  114. package/dist/esm/interfaces/Select.d.ts +17 -0
  115. package/dist/esm/interfaces/Select.js +2 -0
  116. package/dist/esm/interfaces/Select.js.map +1 -0
  117. package/dist/esm/interfaces/Tabs.d.ts +18 -0
  118. package/dist/esm/interfaces/Tabs.js +2 -0
  119. package/dist/esm/interfaces/Tabs.js.map +1 -0
  120. package/dist/esm/interfaces/Tag.d.ts +18 -0
  121. package/dist/esm/interfaces/Tag.js +2 -0
  122. package/dist/esm/interfaces/Tag.js.map +1 -0
  123. package/dist/esm/interfaces/TextField.d.ts +40 -0
  124. package/dist/esm/interfaces/TextField.js +2 -0
  125. package/dist/esm/interfaces/TextField.js.map +1 -0
  126. package/dist/esm/interfaces/index.d.ts +17 -0
  127. package/dist/esm/interfaces/index.js +18 -0
  128. package/dist/esm/interfaces/index.js.map +1 -0
  129. package/dist/esm/types/index.d.ts +78 -0
  130. package/dist/esm/types/index.js +10 -0
  131. package/dist/esm/types/index.js.map +1 -0
  132. package/norma-library.tar +0 -0
  133. package/package.json +75 -90
  134. package/postcss.config.js +6 -0
  135. package/src/components/Accordion.tsx +64 -0
  136. package/src/components/Button.tsx +38 -0
  137. package/src/components/Card.tsx +47 -0
  138. package/src/components/CheckBox.tsx +35 -0
  139. package/src/components/DropDown.tsx +38 -0
  140. package/src/components/IconButton.tsx +58 -0
  141. package/src/components/Icons.tsx +87 -0
  142. package/src/components/Modal.tsx +123 -0
  143. package/src/components/Paper.tsx +22 -0
  144. package/src/components/ProgressBar.tsx +62 -0
  145. package/src/components/RadioGroup.tsx +55 -0
  146. package/src/components/RangerSlider.tsx +81 -0
  147. package/src/components/Select.tsx +98 -0
  148. package/src/components/{icon/norma.tsx → Svgs.tsx} +54 -55
  149. package/src/components/Tabs.tsx +140 -0
  150. package/src/components/Tag.tsx +45 -0
  151. package/src/components/TextField.tsx +35 -0
  152. package/src/components/index.ts +16 -8
  153. package/src/helpers/alignments.ts +14 -0
  154. package/src/helpers/borders.ts +18 -0
  155. package/src/helpers/colors.ts +173 -209
  156. package/src/helpers/index.ts +5 -3
  157. package/src/helpers/radios.ts +24 -0
  158. package/src/helpers/sizes.ts +79 -26
  159. package/src/index.css +2 -0
  160. package/src/index.ts +36 -0
  161. package/src/interfaces/Accordion.ts +12 -0
  162. package/src/interfaces/Button.ts +27 -0
  163. package/src/interfaces/Card.ts +11 -0
  164. package/src/interfaces/CheckBox.ts +33 -0
  165. package/src/interfaces/DropDown.ts +14 -0
  166. package/src/interfaces/IconButton.ts +27 -0
  167. package/src/interfaces/Icons.ts +17 -0
  168. package/src/interfaces/Modal.ts +15 -0
  169. package/src/interfaces/Paper.ts +12 -0
  170. package/src/interfaces/ProgressBar.ts +25 -0
  171. package/src/interfaces/RadioGroup.ts +28 -0
  172. package/src/interfaces/RangerSlider.ts +32 -0
  173. package/src/interfaces/Select.ts +17 -0
  174. package/src/interfaces/Tabs.ts +24 -0
  175. package/src/interfaces/Tag.ts +17 -0
  176. package/src/interfaces/TextField.ts +63 -0
  177. package/src/interfaces/index.ts +17 -0
  178. package/src/stories/Accordion.stories.tsx +65 -0
  179. package/src/stories/Button.stories.tsx +99 -0
  180. package/src/stories/Card.stories.tsx +55 -0
  181. package/src/stories/CheckBox.stories.tsx +94 -0
  182. package/src/stories/Colors.stories.mdx +127 -0
  183. package/src/stories/DropDown.stories.tsx +57 -0
  184. package/src/stories/IconButton.stories.tsx +114 -0
  185. package/src/stories/Icons.stories.mdx +27 -0
  186. package/src/stories/Modal.stories.tsx +190 -0
  187. package/src/stories/Paper.stories.tsx +53 -0
  188. package/src/stories/ProgressBar.stories.tsx +139 -0
  189. package/src/stories/RadioGroup.stories.tsx +94 -0
  190. package/src/stories/RangerSlider.stories.tsx +68 -0
  191. package/src/stories/Select.stories.tsx +128 -0
  192. package/src/stories/Tabs.stories.tsx +62 -0
  193. package/src/stories/Tag.stories.tsx +76 -0
  194. package/src/{components/textfield/textfield.stories.tsx → stories/TextField.stories.tsx} +445 -376
  195. package/src/styles/custom.css +5 -0
  196. package/src/styles/globals.css +21 -0
  197. package/src/types/index.ts +220 -0
  198. package/tailwind.config.js +58 -0
  199. package/tsconfig.json +32 -0
  200. package/README.md +0 -160
  201. package/dist/components/button/button.d.ts +0 -3
  202. package/dist/components/button/index.d.ts +0 -1
  203. package/dist/components/button/types.d.ts +0 -18
  204. package/dist/components/card/card-header.d.ts +0 -3
  205. package/dist/components/card/card.d.ts +0 -3
  206. package/dist/components/card/index.d.ts +0 -1
  207. package/dist/components/card/styles.d.ts +0 -811
  208. package/dist/components/card/types.d.ts +0 -12
  209. package/dist/components/checkbox/checkbox.d.ts +0 -3
  210. package/dist/components/checkbox/index.d.ts +0 -1
  211. package/dist/components/checkbox/types.d.ts +0 -23
  212. package/dist/components/icon/default.d.ts +0 -210
  213. package/dist/components/icon/defaultIcon.d.ts +0 -5
  214. package/dist/components/icon/icons-ia.d.ts +0 -71
  215. package/dist/components/icon/index.d.ts +0 -234
  216. package/dist/components/icon/normaIcon.d.ts +0 -13
  217. package/dist/components/icon/styles.d.ts +0 -481
  218. package/dist/components/icon/svg.d.ts +0 -6
  219. package/dist/components/icon/types.d.ts +0 -12
  220. package/dist/components/index.d.ts +0 -8
  221. package/dist/components/modal/index.d.ts +0 -1
  222. package/dist/components/modal/modal.d.ts +0 -3
  223. package/dist/components/modal/modalFooter.d.ts +0 -3
  224. package/dist/components/modal/modalHeader.d.ts +0 -3
  225. package/dist/components/modal/styles.d.ts +0 -540
  226. package/dist/components/modal/types.d.ts +0 -27
  227. package/dist/components/progress-bar/index.d.ts +0 -1
  228. package/dist/components/progress-bar/progress-bar.d.ts +0 -7
  229. package/dist/components/progress-bar/styles.d.ts +0 -272
  230. package/dist/components/progress-bar/types.d.ts +0 -22
  231. package/dist/components/radio/index.d.ts +0 -1
  232. package/dist/components/radio/radio.d.ts +0 -3
  233. package/dist/components/radio/types.d.ts +0 -16
  234. package/dist/components/tag/index.d.ts +0 -1
  235. package/dist/components/tag/tag.d.ts +0 -3
  236. package/dist/components/tag/types.d.ts +0 -25
  237. package/dist/components/textfield/index.d.ts +0 -1
  238. package/dist/components/textfield/textfield.d.ts +0 -3
  239. package/dist/components/textfield/types.d.ts +0 -42
  240. package/dist/helpers/clients.d.ts +0 -5
  241. package/dist/helpers/index.d.ts +0 -3
  242. package/dist/helpers/sizes.d.ts +0 -6
  243. package/dist/helpers/variants.d.ts +0 -2
  244. package/dist/index.d.ts +0 -1
  245. package/dist/index.js +0 -8
  246. package/dist/norma-library.cjs.development.js +0 -1286
  247. package/dist/norma-library.cjs.development.js.map +0 -1
  248. package/dist/norma-library.cjs.production.min.js +0 -2
  249. package/dist/norma-library.cjs.production.min.js.map +0 -1
  250. package/dist/norma-library.esm.js +0 -1274
  251. package/dist/norma-library.esm.js.map +0 -1
  252. package/src/components/button/button.stories.tsx +0 -44
  253. package/src/components/button/button.tsx +0 -18
  254. package/src/components/button/index.ts +0 -1
  255. package/src/components/button/types.ts +0 -48
  256. package/src/components/card/card-header.tsx +0 -8
  257. package/src/components/card/card.stories.tsx +0 -28
  258. package/src/components/card/card.tsx +0 -13
  259. package/src/components/card/index.ts +0 -1
  260. package/src/components/card/styles.tsx +0 -29
  261. package/src/components/card/types.ts +0 -14
  262. package/src/components/checkbox/checkbox.stories.tsx +0 -66
  263. package/src/components/checkbox/checkbox.tsx +0 -13
  264. package/src/components/checkbox/index.ts +0 -1
  265. package/src/components/checkbox/types.ts +0 -30
  266. package/src/components/icon/default.tsx +0 -1459
  267. package/src/components/icon/defaultIcon.tsx +0 -82
  268. package/src/components/icon/icon.stories.tsx +0 -44
  269. package/src/components/icon/icons-ia.tsx +0 -107
  270. package/src/components/icon/index.ts +0 -11
  271. package/src/components/icon/normaIcon.tsx +0 -94
  272. package/src/components/icon/styles.ts +0 -11
  273. package/src/components/icon/svg.tsx +0 -24
  274. package/src/components/icon/types.ts +0 -14
  275. package/src/components/modal/index.ts +0 -1
  276. package/src/components/modal/modal.stories.tsx +0 -55
  277. package/src/components/modal/modal.tsx +0 -42
  278. package/src/components/modal/modalFooter.tsx +0 -32
  279. package/src/components/modal/modalHeader.tsx +0 -46
  280. package/src/components/modal/styles.tsx +0 -13
  281. package/src/components/modal/types.ts +0 -47
  282. package/src/components/progress-bar/index.ts +0 -1
  283. package/src/components/progress-bar/progress-bar.stories.tsx +0 -68
  284. package/src/components/progress-bar/progress-bar.tsx +0 -38
  285. package/src/components/progress-bar/styles.tsx +0 -27
  286. package/src/components/progress-bar/types.ts +0 -35
  287. package/src/components/radio/index.ts +0 -1
  288. package/src/components/radio/radio.stories.tsx +0 -150
  289. package/src/components/radio/radio.tsx +0 -13
  290. package/src/components/radio/types.ts +0 -27
  291. package/src/components/tag/index.ts +0 -1
  292. package/src/components/tag/tag.stories.tsx +0 -80
  293. package/src/components/tag/tag.tsx +0 -13
  294. package/src/components/tag/types.ts +0 -47
  295. package/src/components/textfield/index.ts +0 -1
  296. package/src/components/textfield/textfield.tsx +0 -23
  297. package/src/components/textfield/types.ts +0 -93
  298. package/src/helpers/clients.ts +0 -6
  299. package/src/helpers/variants.ts +0 -3
  300. package/src/index.tsx +0 -1
@@ -1,376 +1,445 @@
1
- import React from "react"
2
- import type { StoryDefault, Story } from '@ladle/react'
3
- import { TextField } from './textfield'
4
- import Box from '@mui/material/Box'
5
-
6
- export default {
7
- title: 'Form / TextField',
8
- meta: {
9
- key: 'button',
10
- },
11
- } satisfies StoryDefault
12
-
13
- export const TextFieldVariant: Story = () => (
14
- <div style={{ display: 'flex', gap: '1rem', margin: 15 }}>
15
- <TextField variant="standard" label="Variant text" />
16
- <TextField variant="filled" label="Variant Contained" />
17
- <TextField variant="outlined" label="Variant Outlined" />
18
- </div>
19
- )
20
-
21
- TextFieldVariant.storyName = 'Textfield Variants'
22
-
23
- export const TextFieldProps: Story = () => (
24
- <div style={{ display: 'flex', gap: '1rem', margin: 15 }}>
25
- <Box
26
- component="form"
27
- sx={{
28
- '& .MuiTextField-root': { m: 1, width: '100%' },
29
- display: 'flex',
30
- gap: '1rem',
31
- margin: 15,
32
- }}
33
- noValidate
34
- autoComplete="off"
35
- >
36
- <div>
37
- <TextField required id="outlined-required" label="Required" defaultValue="Hello World" />
38
- <TextField disabled id="outlined-disabled" label="Disabled" defaultValue="Hello World" />
39
- <TextField
40
- id="outlined-password-input"
41
- label="Password"
42
- type="password"
43
- autoComplete="current-password"
44
- />
45
- <TextField
46
- id="outlined-read-only-input"
47
- label="Read Only"
48
- defaultValue="Hello World"
49
- InputProps={{
50
- readOnly: true,
51
- }}
52
- />
53
- <TextField
54
- id="outlined-number"
55
- label="Number"
56
- type="number"
57
- InputLabelProps={{
58
- shrink: true,
59
- }}
60
- />
61
- <TextField id="outlined-search" label="Search field" type="search" />
62
- <TextField
63
- id="outlined-helperText"
64
- label="Helper text"
65
- defaultValue="Default Value"
66
- helperText="Some important text"
67
- />
68
- </div>
69
- <div>
70
- <TextField
71
- required
72
- id="filled-required"
73
- label="Required"
74
- defaultValue="Hello World"
75
- variant="filled"
76
- />
77
- <TextField
78
- disabled
79
- id="filled-disabled"
80
- label="Disabled"
81
- defaultValue="Hello World"
82
- variant="filled"
83
- />
84
- <TextField
85
- id="filled-password-input"
86
- label="Password"
87
- type="password"
88
- autoComplete="current-password"
89
- variant="filled"
90
- />
91
- <TextField
92
- id="filled-read-only-input"
93
- label="Read Only"
94
- defaultValue="Hello World"
95
- InputProps={{
96
- readOnly: true,
97
- }}
98
- variant="filled"
99
- />
100
- <TextField
101
- id="filled-number"
102
- label="Number"
103
- type="number"
104
- InputLabelProps={{
105
- shrink: true,
106
- }}
107
- variant="filled"
108
- />
109
- <TextField id="filled-search" label="Search field" type="search" variant="filled" />
110
- <TextField
111
- id="filled-helperText"
112
- label="Helper text"
113
- defaultValue="Default Value"
114
- helperText="Some important text"
115
- variant="filled"
116
- />
117
- </div>
118
- <div>
119
- <TextField
120
- required
121
- id="standard-required"
122
- label="Required"
123
- defaultValue="Hello World"
124
- variant="standard"
125
- />
126
- <TextField
127
- disabled
128
- id="standard-disabled"
129
- label="Disabled"
130
- defaultValue="Hello World"
131
- variant="standard"
132
- />
133
- <TextField
134
- id="standard-password-input"
135
- label="Password"
136
- type="password"
137
- autoComplete="current-password"
138
- variant="standard"
139
- />
140
- <TextField
141
- id="standard-read-only-input"
142
- label="Read Only"
143
- defaultValue="Hello World"
144
- InputProps={{
145
- readOnly: true,
146
- }}
147
- variant="standard"
148
- />
149
- <TextField
150
- id="standard-number"
151
- label="Number"
152
- type="number"
153
- InputLabelProps={{
154
- shrink: true,
155
- }}
156
- variant="standard"
157
- />
158
- <TextField id="standard-search" label="Search field" type="search" variant="standard" />
159
- <TextField
160
- id="standard-helperText"
161
- label="Helper text"
162
- defaultValue="Default Value"
163
- helperText="Some important text"
164
- variant="standard"
165
- />
166
- </div>
167
- </Box>
168
- </div>
169
- )
170
-
171
- TextFieldProps.storyName = 'Textfield props'
172
-
173
- export const TextFieldValidation: Story = () => (
174
- <div style={{ display: 'flex', gap: '1rem', margin: 15 }}>
175
- <Box
176
- component="form"
177
- sx={{
178
- '& .MuiTextField-root': { m: 1, width: '100%' },
179
- }}
180
- noValidate
181
- autoComplete="off"
182
- >
183
- <div>
184
- <TextField error id="outlined-error" label="Error" defaultValue="Hello World" />
185
- <TextField
186
- error
187
- id="outlined-error-helper-text"
188
- label="Error"
189
- defaultValue="Hello World"
190
- helperText="Incorrect entry."
191
- />
192
- </div>
193
- <div>
194
- <TextField
195
- error
196
- id="filled-error"
197
- label="Error"
198
- defaultValue="Hello World"
199
- variant="filled"
200
- />
201
- <TextField
202
- error
203
- id="filled-error-helper-text"
204
- label="Error"
205
- defaultValue="Hello World"
206
- helperText="Incorrect entry."
207
- variant="filled"
208
- />
209
- </div>
210
- <div>
211
- <TextField
212
- error
213
- id="standard-error"
214
- label="Error"
215
- defaultValue="Hello World"
216
- variant="standard"
217
- />
218
- <TextField
219
- error
220
- id="standard-error-helper-text"
221
- label="Error"
222
- defaultValue="Hello World"
223
- helperText="Incorrect entry."
224
- variant="standard"
225
- />
226
- </div>
227
- </Box>
228
- </div>
229
- )
230
-
231
- TextFieldValidation.storyName = 'Textfield Validation'
232
-
233
- export const TextFieldMultiline: Story = () => (
234
- <div style={{ display: 'flex', gap: '1rem', margin: 15 }}>
235
- <Box
236
- component="form"
237
- sx={{
238
- '& .MuiTextField-root': { m: 1, width: '100%' },
239
- }}
240
- noValidate
241
- autoComplete="off"
242
- >
243
- <div>
244
- <TextField id="outlined-multiline-flexible" label="Multiline" multiline maxRows={4} />
245
- <TextField
246
- id="outlined-textarea"
247
- label="Multiline Placeholder"
248
- placeholder="Placeholder"
249
- multiline
250
- />
251
- <TextField
252
- id="outlined-multiline-static"
253
- label="Multiline"
254
- multiline
255
- rows={4}
256
- defaultValue="Default Value"
257
- />
258
- </div>
259
- <div>
260
- <TextField
261
- id="filled-multiline-flexible"
262
- label="Multiline"
263
- multiline
264
- maxRows={4}
265
- variant="filled"
266
- />
267
- <TextField
268
- id="filled-textarea"
269
- label="Multiline Placeholder"
270
- placeholder="Placeholder"
271
- multiline
272
- variant="filled"
273
- />
274
- <TextField
275
- id="filled-multiline-static"
276
- label="Multiline"
277
- multiline
278
- rows={4}
279
- defaultValue="Default Value"
280
- variant="filled"
281
- />
282
- </div>
283
- <div>
284
- <TextField
285
- id="standard-multiline-flexible"
286
- label="Multiline"
287
- multiline
288
- maxRows={4}
289
- variant="standard"
290
- />
291
- <TextField
292
- id="standard-textarea"
293
- label="Multiline Placeholder"
294
- placeholder="Placeholder"
295
- multiline
296
- variant="standard"
297
- />
298
- <TextField
299
- id="standard-multiline-static"
300
- label="Multiline"
301
- multiline
302
- rows={4}
303
- defaultValue="Default Value"
304
- variant="standard"
305
- />
306
- </div>
307
- </Box>
308
- </div>
309
- )
310
-
311
- TextFieldMultiline.storyName = 'Textfield Multiline'
312
-
313
- export const TextFieldSizes: Story = () => (
314
- <div style={{ display: 'flex', gap: '1rem', margin: 15 }}>
315
- <Box
316
- component="form"
317
- sx={{
318
- '& .MuiTextField-root': { m: 1, width: '100%' },
319
- }}
320
- noValidate
321
- autoComplete="off"
322
- >
323
- <div>
324
- <TextField label="Size" id="outlined-size-small" defaultValue="Small" size="small" />
325
- <TextField label="Size" id="outlined-size-normal" defaultValue="Normal" />
326
- </div>
327
- <div>
328
- <TextField
329
- label="Size"
330
- id="filled-size-small"
331
- defaultValue="Small"
332
- variant="filled"
333
- size="small"
334
- />
335
- <TextField label="Size" id="filled-size-normal" defaultValue="Normal" variant="filled" />
336
- </div>
337
- <div>
338
- <TextField
339
- label="Size"
340
- id="standard-size-small"
341
- defaultValue="Small"
342
- size="small"
343
- variant="standard"
344
- />
345
- <TextField
346
- label="Size"
347
- id="standard-size-normal"
348
- defaultValue="Normal"
349
- variant="standard"
350
- />
351
- </div>
352
- </Box>
353
- </div>
354
- )
355
-
356
- TextFieldSizes.storyName = 'Textfield Sizes'
357
-
358
- export const TextFieldColors: Story = () => (
359
- <div style={{ display: 'flex', gap: '1rem', margin: 15 }}>
360
- <Box
361
- component="form"
362
- sx={{
363
- '& > :not(style)': { m: 1, width: '100%' },
364
- }}
365
- noValidate
366
- autoComplete="off"
367
- >
368
- <TextField label="Outlined Primary" color="primary" focused />
369
- <TextField label="Outlined secondary" color="secondary" focused />
370
- <TextField label="Filled success" variant="filled" color="success" focused />
371
- <TextField label="Standard warning" variant="standard" color="warning" focused />
372
- </Box>
373
- </div>
374
- )
375
-
376
- TextFieldColors.storyName = 'Textfield Colors'
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";