@taiv/ui 1.7.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/components/Inputs/Buttons/Button/Button.d.ts +2 -2
  2. package/dist/components/Inputs/Buttons/Button/Button.d.ts.map +1 -1
  3. package/dist/components/Inputs/Buttons/Button/Button.js +3 -3
  4. package/dist/components/Inputs/Buttons/Button/Button.stories.d.ts.map +1 -1
  5. package/dist/components/Inputs/Buttons/Button/Button.stories.js +10 -1
  6. package/dist/components/Inputs/Buttons/IconButton/IconButton.d.ts +18 -0
  7. package/dist/components/Inputs/Buttons/IconButton/IconButton.d.ts.map +1 -0
  8. package/dist/components/Inputs/Buttons/IconButton/IconButton.js +34 -0
  9. package/dist/components/Inputs/Buttons/IconButton/IconButton.stories.d.ts +14 -0
  10. package/dist/components/Inputs/Buttons/IconButton/IconButton.stories.d.ts.map +1 -0
  11. package/dist/components/Inputs/Buttons/IconButton/IconButton.stories.js +180 -0
  12. package/dist/components/Inputs/Buttons/IconButton/sizes.d.ts +19 -0
  13. package/dist/components/Inputs/Buttons/IconButton/sizes.d.ts.map +1 -0
  14. package/dist/components/Inputs/Buttons/IconButton/sizes.js +6 -0
  15. package/dist/components/Inputs/Buttons/shared/variants.d.ts +382 -0
  16. package/dist/components/Inputs/Buttons/shared/variants.d.ts.map +1 -0
  17. package/dist/components/Inputs/Buttons/{Button → shared}/variants.js +58 -1
  18. package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.d.ts.map +1 -1
  19. package/dist/components/Inputs/TextInputs/AutoComplete/AutoComplete.js +8 -1
  20. package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.d.ts +12 -0
  21. package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.d.ts.map +1 -0
  22. package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.js +63 -0
  23. package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.stories.d.ts +12 -0
  24. package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.stories.d.ts.map +1 -0
  25. package/dist/components/Inputs/TextInputs/NumberInput/NumberInput.stories.js +245 -0
  26. package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.d.ts.map +1 -1
  27. package/dist/components/Inputs/TextInputs/PasswordInput/PasswordInput.js +14 -1
  28. package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.d.ts.map +1 -1
  29. package/dist/components/Inputs/TextInputs/SearchBar/SearchBar.js +8 -1
  30. package/dist/components/Inputs/TextInputs/TextArea/TextArea.d.ts.map +1 -1
  31. package/dist/components/Inputs/TextInputs/TextArea/TextArea.js +9 -1
  32. package/dist/components/Inputs/TextInputs/TextInput/TextInput.d.ts.map +1 -1
  33. package/dist/components/Inputs/TextInputs/TextInput/TextInput.js +9 -1
  34. package/dist/components/Layout/Table/Table.d.ts +15 -0
  35. package/dist/components/Layout/Table/Table.d.ts.map +1 -0
  36. package/dist/components/Layout/Table/Table.js +48 -0
  37. package/dist/components/Layout/Table/Table.stories.d.ts +10 -0
  38. package/dist/components/Layout/Table/Table.stories.d.ts.map +1 -0
  39. package/dist/components/Layout/Table/Table.stories.js +257 -0
  40. package/dist/components/index.d.ts +4 -0
  41. package/dist/components/index.d.ts.map +1 -1
  42. package/dist/components/index.js +3 -0
  43. package/dist/constants/colors.d.ts +2 -0
  44. package/dist/constants/colors.d.ts.map +1 -1
  45. package/dist/constants/colors.js +2 -0
  46. package/package.json +5 -1
  47. package/dist/components/Inputs/Buttons/Button/variants.d.ts +0 -191
  48. package/dist/components/Inputs/Buttons/Button/variants.d.ts.map +0 -1
@@ -0,0 +1,382 @@
1
+ export declare const buttonVariants: {
2
+ readonly primary: {
3
+ readonly background: "linear-gradient(to right, #0081CE, #00A6F4)";
4
+ readonly color: "white";
5
+ readonly '&:hover': {
6
+ readonly background: "linear-gradient(to right, #0081CE, #0081CE)";
7
+ readonly transition: "background 0.3s ease-in-out";
8
+ };
9
+ readonly '&:active': {
10
+ readonly background: "white";
11
+ readonly border: "1px solid #00A6F4";
12
+ readonly color: "#00A6F4";
13
+ };
14
+ readonly '&:toggled': {
15
+ readonly background: "linear-gradient(to right, #0081CE, #0081CE)";
16
+ readonly color: "white";
17
+ };
18
+ readonly '&:disabled': {
19
+ readonly background: "#EDEDED";
20
+ readonly color: "#D9D9D9";
21
+ };
22
+ readonly '&[data-loading]': {
23
+ readonly '& .mantine-Button-icon svg': {
24
+ readonly stroke: "white";
25
+ };
26
+ };
27
+ };
28
+ readonly secondary: {
29
+ readonly background: "white";
30
+ readonly color: "#6D6D6D";
31
+ readonly border: "1px solid #6D6D6D";
32
+ readonly '&:hover': {
33
+ readonly background: "#D9D9D9";
34
+ readonly border: "1px solid #D9D9D9";
35
+ readonly color: "white";
36
+ };
37
+ readonly '&:active': {
38
+ readonly background: "#D9D9D9";
39
+ readonly border: "1px solid #6D6D6D";
40
+ readonly color: "#6D6D6D";
41
+ };
42
+ readonly '&:toggled': {
43
+ readonly background: "#D9D9D9";
44
+ readonly color: "neutral[200]";
45
+ };
46
+ readonly '&:disabled': {
47
+ readonly background: "#EDEDED";
48
+ readonly border: "1px solid #EDEDED";
49
+ readonly color: "#D9D9D9";
50
+ };
51
+ readonly '&[data-loading]': {
52
+ readonly '& .mantine-Button-icon svg': {
53
+ readonly stroke: "#6D6D6D";
54
+ };
55
+ };
56
+ };
57
+ readonly cancel: {
58
+ readonly background: "#C10007";
59
+ readonly color: "white";
60
+ readonly '&:hover': {
61
+ readonly background: "#FB2C36";
62
+ };
63
+ readonly '&:active': {
64
+ readonly background: "white";
65
+ readonly border: "1px solid #C10007";
66
+ readonly color: "#C10007";
67
+ };
68
+ readonly '&:toggled': {
69
+ readonly background: "#FB2C36";
70
+ readonly color: "white";
71
+ };
72
+ readonly '&:disabled': {
73
+ readonly background: "#FFD7D9";
74
+ readonly border: "1px solid #FFD7D9";
75
+ readonly color: "white";
76
+ };
77
+ readonly '&[data-loading]': {
78
+ readonly '& .mantine-Button-icon svg': {
79
+ readonly stroke: "white";
80
+ };
81
+ };
82
+ };
83
+ readonly success: {
84
+ readonly background: "#00A63E";
85
+ readonly color: "white";
86
+ readonly '&:hover': {
87
+ readonly background: "#00C951";
88
+ };
89
+ readonly '&:active': {
90
+ readonly background: "white";
91
+ readonly border: "1px solid #00A63E";
92
+ readonly color: "#00A63E";
93
+ };
94
+ readonly '&:toggled': {
95
+ readonly background: "#00C951";
96
+ };
97
+ readonly '&:disabled': {
98
+ readonly background: "#E6F4E7";
99
+ readonly border: "1px solid #E6F4E7";
100
+ readonly color: "white";
101
+ };
102
+ readonly '&[data-loading]': {
103
+ readonly '& .mantine-Button-icon svg': {
104
+ readonly stroke: "white";
105
+ };
106
+ };
107
+ };
108
+ readonly warning: {
109
+ readonly background: "#E17100";
110
+ readonly color: "white";
111
+ readonly '&:hover': {
112
+ readonly background: "#FE9A00";
113
+ };
114
+ readonly '&:active': {
115
+ readonly background: "white";
116
+ readonly border: "1px solid #E17100";
117
+ readonly color: "#E17100";
118
+ };
119
+ readonly '&:toggled': {
120
+ readonly background: "#FE9A00";
121
+ };
122
+ readonly '&:disabled': {
123
+ readonly background: "#FFE5B4";
124
+ readonly border: "1px solid #FFE5B4";
125
+ readonly color: "white";
126
+ };
127
+ readonly '&[data-loading]': {
128
+ readonly '& .mantine-Button-icon svg': {
129
+ readonly stroke: "white";
130
+ };
131
+ };
132
+ };
133
+ readonly text: {
134
+ readonly background: "transparent";
135
+ readonly color: "#6D6D6D";
136
+ readonly border: "none";
137
+ readonly padding: "0";
138
+ readonly height: "auto";
139
+ readonly minWidth: "unset";
140
+ readonly '&:hover': {
141
+ readonly background: "transparent";
142
+ readonly color: "#0081CE";
143
+ };
144
+ readonly '&:active': {
145
+ readonly background: "transparent";
146
+ readonly color: "#00A6F4";
147
+ };
148
+ readonly '&:toggled': {
149
+ readonly background: "transparent";
150
+ readonly color: "#0081CE";
151
+ };
152
+ readonly '&:disabled': {
153
+ readonly background: "transparent";
154
+ readonly color: "#D9D9D9";
155
+ };
156
+ readonly '&[data-loading]': {
157
+ readonly '& .mantine-Button-icon svg': {
158
+ readonly stroke: "#6D6D6D";
159
+ };
160
+ };
161
+ };
162
+ readonly nav: {
163
+ readonly background: "white";
164
+ readonly paddingLeft: "0.8rem";
165
+ readonly color: "#6D6D6D";
166
+ readonly '& .mantine-Button-inner': {
167
+ readonly justifyContent: "flex-start";
168
+ };
169
+ readonly '&:hover': {
170
+ readonly background: "#EDEDED";
171
+ };
172
+ readonly '&:active': {
173
+ readonly background: "#D9D9D9";
174
+ readonly color: "#6D6D6D";
175
+ };
176
+ readonly '&:toggled': {
177
+ readonly background: "#EDEDED";
178
+ readonly color: "#6D6D6D";
179
+ };
180
+ readonly '&:disabled': {
181
+ readonly background: "#EDEDED";
182
+ readonly color: "#D9D9D9";
183
+ };
184
+ readonly '&[data-loading]': {
185
+ readonly '& .mantine-Button-icon svg': {
186
+ readonly stroke: "#6D6D6D";
187
+ };
188
+ };
189
+ };
190
+ };
191
+ export declare const subtleVariants: {
192
+ readonly primary: {
193
+ readonly background: "white";
194
+ readonly color: "#00A6F4";
195
+ readonly '&:hover': {
196
+ readonly background: "#74D4FF";
197
+ readonly transition: "background 0.3s ease-in-out";
198
+ };
199
+ readonly '&:active': {
200
+ readonly background: "white";
201
+ readonly border: "1px solid #00A6F4";
202
+ readonly color: "#00A6F4";
203
+ };
204
+ readonly '&:toggled': {
205
+ readonly background: "#0081CE";
206
+ readonly color: "white";
207
+ };
208
+ readonly '&:disabled': {
209
+ readonly background: "#EDEDED";
210
+ readonly color: "#D9D9D9";
211
+ };
212
+ readonly '&[data-loading]': {
213
+ readonly '& .mantine-Button-icon svg': {
214
+ readonly stroke: "white";
215
+ };
216
+ };
217
+ };
218
+ readonly secondary: {
219
+ readonly background: "white";
220
+ readonly color: "#6D6D6D";
221
+ readonly border: "1px solid #EDEDED";
222
+ readonly '&:hover': {
223
+ readonly background: "#D9D9D9";
224
+ readonly border: "1px solid #D9D9D9";
225
+ readonly color: "white";
226
+ };
227
+ readonly '&:active': {
228
+ readonly background: "#D9D9D9";
229
+ readonly border: "1px solid #6D6D6D";
230
+ readonly color: "#6D6D6D";
231
+ };
232
+ readonly '&:toggled': {
233
+ readonly background: "#D9D9D9";
234
+ readonly color: "neutral[200]";
235
+ };
236
+ readonly '&:disabled': {
237
+ readonly background: "#EDEDED";
238
+ readonly border: "1px solid #EDEDED";
239
+ readonly color: "#D9D9D9";
240
+ };
241
+ readonly '&[data-loading]': {
242
+ readonly '& .mantine-Button-icon svg': {
243
+ readonly stroke: "#6D6D6D";
244
+ };
245
+ };
246
+ };
247
+ readonly cancel: {
248
+ readonly background: "white";
249
+ readonly color: "#C10007";
250
+ readonly '&:hover': {
251
+ readonly background: "#FB2C36";
252
+ };
253
+ readonly '&:active': {
254
+ readonly background: "white";
255
+ readonly border: "1px solid #C10007";
256
+ readonly color: "#C10007";
257
+ };
258
+ readonly '&:toggled': {
259
+ readonly background: "#FB2C36";
260
+ readonly color: "white";
261
+ };
262
+ readonly '&:disabled': {
263
+ readonly background: "#FFD7D9";
264
+ readonly border: "1px solid #FFD7D9";
265
+ readonly color: "white";
266
+ };
267
+ readonly '&[data-loading]': {
268
+ readonly '& .mantine-Button-icon svg': {
269
+ readonly stroke: "white";
270
+ };
271
+ };
272
+ };
273
+ readonly success: {
274
+ readonly background: "white";
275
+ readonly color: "#00A63E";
276
+ readonly '&:hover': {
277
+ readonly background: "#00C951";
278
+ };
279
+ readonly '&:active': {
280
+ readonly background: "white";
281
+ readonly border: "1px solid #00A63E";
282
+ readonly color: "#00A63E";
283
+ };
284
+ readonly '&:toggled': {
285
+ readonly background: "#00C951";
286
+ };
287
+ readonly '&:disabled': {
288
+ readonly background: "#E6F4E7";
289
+ readonly border: "1px solid #E6F4E7";
290
+ readonly color: "white";
291
+ };
292
+ readonly '&[data-loading]': {
293
+ readonly '& .mantine-Button-icon svg': {
294
+ readonly stroke: "white";
295
+ };
296
+ };
297
+ };
298
+ readonly warning: {
299
+ readonly background: "white";
300
+ readonly color: "#E17100";
301
+ readonly '&:hover': {
302
+ readonly background: "#FE9A00";
303
+ };
304
+ readonly '&:active': {
305
+ readonly background: "white";
306
+ readonly border: "1px solid #E17100";
307
+ readonly color: "#E17100";
308
+ };
309
+ readonly '&:toggled': {
310
+ readonly background: "#FE9A00";
311
+ };
312
+ readonly '&:disabled': {
313
+ readonly background: "#FFE5B4";
314
+ readonly border: "1px solid #FFE5B4";
315
+ readonly color: "white";
316
+ };
317
+ readonly '&[data-loading]': {
318
+ readonly '& .mantine-Button-icon svg': {
319
+ readonly stroke: "white";
320
+ };
321
+ };
322
+ };
323
+ readonly text: {
324
+ readonly background: "transparent";
325
+ readonly color: "#6D6D6D";
326
+ readonly border: "none";
327
+ readonly padding: "0";
328
+ readonly height: "auto";
329
+ readonly minWidth: "unset";
330
+ readonly '&:hover': {
331
+ readonly background: "transparent";
332
+ readonly color: "#0081CE";
333
+ };
334
+ readonly '&:active': {
335
+ readonly background: "transparent";
336
+ readonly color: "#00A6F4";
337
+ };
338
+ readonly '&:toggled': {
339
+ readonly background: "transparent";
340
+ readonly color: "#0081CE";
341
+ };
342
+ readonly '&:disabled': {
343
+ readonly background: "transparent";
344
+ readonly color: "#D9D9D9";
345
+ };
346
+ readonly '&[data-loading]': {
347
+ readonly '& .mantine-Button-icon svg': {
348
+ readonly stroke: "#6D6D6D";
349
+ };
350
+ };
351
+ };
352
+ readonly nav: {
353
+ readonly background: "white";
354
+ readonly paddingLeft: "0.8rem";
355
+ readonly color: "#6D6D6D";
356
+ readonly border: "none";
357
+ readonly '& .mantine-Button-inner': {
358
+ readonly justifyContent: "flex-start";
359
+ };
360
+ readonly '&:hover': {
361
+ readonly background: "#EDEDED";
362
+ };
363
+ readonly '&:active': {
364
+ readonly background: "#D9D9D9";
365
+ readonly color: "#6D6D6D";
366
+ };
367
+ readonly '&:toggled': {
368
+ readonly background: "#EDEDED";
369
+ readonly color: "#6D6D6D";
370
+ };
371
+ readonly '&:disabled': {
372
+ readonly background: "#EDEDED";
373
+ readonly color: "#D9D9D9";
374
+ };
375
+ readonly '&[data-loading]': {
376
+ readonly '& .mantine-Button-icon svg': {
377
+ readonly stroke: "#6D6D6D";
378
+ };
379
+ };
380
+ };
381
+ };
382
+ //# sourceMappingURL=variants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/Buttons/shared/variants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6LjB,CAAC;AAEX,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwDjB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { primary, neutral, error, success, warning } from '../../../../constants/colors';
2
- export const componentVariants = {
2
+ export const buttonVariants = {
3
3
  primary: {
4
4
  background: `linear-gradient(to right, ${primary[300]}, ${primary[200]})`,
5
5
  color: 'white',
@@ -189,3 +189,60 @@ export const componentVariants = {
189
189
  },
190
190
  },
191
191
  };
192
+ export const subtleVariants = {
193
+ primary: {
194
+ ...buttonVariants.primary,
195
+ background: 'white',
196
+ color: primary[200],
197
+ '&:hover': {
198
+ background: primary[100],
199
+ transition: 'background 0.3s ease-in-out',
200
+ },
201
+ '&:active': {
202
+ background: 'white',
203
+ border: `1px solid ${primary[200]}`,
204
+ color: primary[200],
205
+ },
206
+ '&:toggled': {
207
+ background: primary[300],
208
+ color: 'white',
209
+ },
210
+ },
211
+ secondary: {
212
+ ...buttonVariants.secondary,
213
+ background: 'white',
214
+ color: neutral[200],
215
+ border: `1px solid ${neutral[50]}`,
216
+ },
217
+ cancel: {
218
+ ...buttonVariants.cancel,
219
+ background: 'white',
220
+ color: error[200],
221
+ },
222
+ success: {
223
+ ...buttonVariants.success,
224
+ background: 'white',
225
+ color: success[200],
226
+ },
227
+ warning: {
228
+ ...buttonVariants.warning,
229
+ background: 'white',
230
+ color: warning[200],
231
+ },
232
+ text: {
233
+ ...buttonVariants.text,
234
+ background: 'transparent',
235
+ color: neutral[200],
236
+ border: 'none',
237
+ padding: '0',
238
+ height: 'auto',
239
+ minWidth: 'unset',
240
+ },
241
+ nav: {
242
+ ...buttonVariants.nav,
243
+ background: 'white',
244
+ paddingLeft: '0.8rem',
245
+ color: neutral[200],
246
+ border: 'none',
247
+ },
248
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"AutoComplete.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/TextInputs/AutoComplete/AutoComplete.tsx"],"names":[],"mappings":"AACA,OAAO,EAAuC,iBAAiB,IAAI,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACnH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,iBAAkB,SAAQ,wBAAwB;IACjE,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,YAAY,GAAI,2DAA+F,iBAAiB,4CAqD5I,CAAC"}
1
+ {"version":3,"file":"AutoComplete.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/TextInputs/AutoComplete/AutoComplete.tsx"],"names":[],"mappings":"AACA,OAAO,EAAuC,iBAAiB,IAAI,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACnH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,iBAAkB,SAAQ,wBAAwB;IACjE,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,YAAY,GAAI,2DAA+F,iBAAiB,4CA4D5I,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Autocomplete as MantineAutocomplete } from '@mantine/core';
3
- import { neutral } from '../../../../constants/colors';
3
+ import { neutral, red } from '../../../../constants/colors';
4
4
  import { fontBase } from '../../../../constants/font';
5
5
  import { componentSizes } from '../../Dropdowns/shared/sizes';
6
6
  export const AutoComplete = ({ size = 'md', width, fullWidth = false, placeholder = 'Select an option', styles, ...props }) => {
@@ -15,6 +15,13 @@ export const AutoComplete = ({ size = 'md', width, fullWidth = false, placeholde
15
15
  color: neutral[300],
16
16
  transition: 'all 200ms ease-in-out',
17
17
  borderRadius: '8px',
18
+ '&[data-invalid]': {
19
+ borderColor: red[200],
20
+ color: neutral[200],
21
+ '&::placeholder': {
22
+ color: red[200],
23
+ },
24
+ },
18
25
  },
19
26
  label: {
20
27
  ...fontBase,
@@ -0,0 +1,12 @@
1
+ import { NumberInputProps as MantineNumberInputProps } from '@mantine/core';
2
+ import { CSSObject } from '@mantine/styles';
3
+ import { componentSizes } from '../shared/sizes';
4
+ interface NumberInputProps extends MantineNumberInputProps {
5
+ size?: keyof typeof componentSizes;
6
+ width?: string | number;
7
+ fullWidth?: boolean;
8
+ styles?: Record<string, CSSObject>;
9
+ }
10
+ declare const NumberInput: ({ size, width, fullWidth, styles, step, ...props }: NumberInputProps) => import("react/jsx-runtime").JSX.Element;
11
+ export { NumberInput };
12
+ //# sourceMappingURL=NumberInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/TextInputs/NumberInput/NumberInput.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,gBAAgB,IAAI,uBAAuB,EAC5C,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,UAAU,gBAAiB,SAAQ,uBAAuB;IACxD,IAAI,CAAC,EAAE,MAAM,OAAO,cAAc,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CACpC;AAED,QAAA,MAAM,WAAW,GAAI,oDAOlB,gBAAgB,4CAoElB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { NumberInput as MantineNumberInput, } from '@mantine/core';
3
+ import { neutral, red } from '../../../../constants/colors';
4
+ import { fontBase } from '../../../../constants/font';
5
+ import { componentSizes } from '../shared/sizes';
6
+ const NumberInput = ({ size = 'md', width, fullWidth = false, styles, step = 1, ...props }) => {
7
+ const selectedSize = componentSizes[size];
8
+ const computedWidth = fullWidth ? '100%' : width || `${selectedSize.width}rem`;
9
+ const hasError = !!props.error;
10
+ const style = {
11
+ input: {
12
+ height: `${selectedSize.height}rem`,
13
+ fontSize: selectedSize.fontSize,
14
+ padding: '0 1rem',
15
+ ...fontBase,
16
+ color: neutral[200],
17
+ transition: 'all 200ms ease-in-out',
18
+ borderRadius: '8px',
19
+ '&[data-invalid]': {
20
+ borderColor: red[200],
21
+ color: neutral[200],
22
+ '&::placeholder': {
23
+ color: red[200],
24
+ },
25
+ },
26
+ },
27
+ rightSection: {
28
+ height: 'auto',
29
+ margin: 'auto 0',
30
+ gap: 0,
31
+ width: '4.8rem',
32
+ alignItems: 'center',
33
+ },
34
+ control: {
35
+ color: hasError ? red[200] : neutral[200],
36
+ border: 'none',
37
+ background: 'transparent',
38
+ width: '2rem',
39
+ height: '1.2rem',
40
+ flex: '0 0 auto',
41
+ '& svg': {
42
+ width: '2rem',
43
+ height: '1.2rem',
44
+ },
45
+ '&:hover': {
46
+ cursor: 'pointer',
47
+ },
48
+ },
49
+ label: {
50
+ ...fontBase,
51
+ fontSize: `calc(${selectedSize.fontSize} - 0.05rem)`,
52
+ color: neutral[200],
53
+ },
54
+ error: {
55
+ ...fontBase,
56
+ fontSize: `calc(${selectedSize.fontSize} - 0.05rem)`,
57
+ color: red[200],
58
+ },
59
+ ...styles,
60
+ };
61
+ return (_jsx(MantineNumberInput, { w: computedWidth, size: size, step: step, hideControls: false, styles: style, type: "number", ...props }));
62
+ };
63
+ export { NumberInput };
@@ -0,0 +1,12 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { NumberInput } from './NumberInput';
3
+ declare const meta: Meta<typeof NumberInput>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof meta>;
6
+ export declare const Default: Story;
7
+ export declare const Variants: Story;
8
+ export declare const Sizes: Story;
9
+ export declare const States: Story;
10
+ export declare const AdditionalFunctionality: Story;
11
+ export declare const CustomStyling: Story;
12
+ //# sourceMappingURL=NumberInput.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumberInput.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Inputs/TextInputs/NumberInput/NumberInput.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAuHlC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KA2BrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAetB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAgBnB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAiBpB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,KAiCrC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KA6C3B,CAAC"}