@deepnoid/ui 0.0.87 → 0.0.89

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 (169) hide show
  1. package/dist/{chunk-4DLTBZUQ.mjs → chunk-3DRIHQOM.mjs} +7 -5
  2. package/dist/{chunk-4SWFYTMR.mjs → chunk-6YE26GOI.mjs} +10 -8
  3. package/dist/{chunk-QX6VJLEM.mjs → chunk-7HHFRKJU.mjs} +2 -2
  4. package/dist/{chunk-H2HUJ4N2.mjs → chunk-A3RWT3JJ.mjs} +9 -4
  5. package/dist/{chunk-BE2OG6M4.mjs → chunk-ANYPMQH4.mjs} +28 -21
  6. package/dist/{chunk-5HSZ5AYM.mjs → chunk-B4KZBOGT.mjs} +16 -16
  7. package/dist/{chunk-QIZOXBOY.mjs → chunk-DWROPKZW.mjs} +4 -4
  8. package/dist/{chunk-PHQY5T3E.mjs → chunk-HFVZFUC3.mjs} +7 -14
  9. package/dist/{chunk-IOV7MEPG.mjs → chunk-IOCRFIQF.mjs} +30 -0
  10. package/dist/{chunk-4VIEZ5FT.mjs → chunk-JN7EGKJL.mjs} +8 -7
  11. package/dist/{chunk-SFNR4F3J.mjs → chunk-L6BQA6GI.mjs} +2 -2
  12. package/dist/{chunk-PRUAIZTU.mjs → chunk-LCI6RPWE.mjs} +1 -1
  13. package/dist/{chunk-IZOMH2SL.mjs → chunk-MOINJECK.mjs} +16 -15
  14. package/dist/{chunk-QVGXHUYW.mjs → chunk-N2JULHST.mjs} +9 -9
  15. package/dist/chunk-OJ2OEI5B.mjs +202 -0
  16. package/dist/{chunk-2COCX2VX.mjs → chunk-PXUBPWKU.mjs} +2 -2
  17. package/dist/{chunk-PCIONGEJ.mjs → chunk-QWFOYO3D.mjs} +37 -19
  18. package/dist/{chunk-LY6LJRUX.mjs → chunk-RZZWHI6O.mjs} +1 -1
  19. package/dist/chunk-UR64ZUAU.mjs +671 -0
  20. package/dist/{chunk-PUFNT5LS.mjs → chunk-VG4644BG.mjs} +1 -1
  21. package/dist/components/accordion/accordion.d.mts +1 -1
  22. package/dist/components/accordion/accordion.d.ts +1 -1
  23. package/dist/components/accordion/accordion.test.mjs +3 -3
  24. package/dist/components/accordion/accordionItem.d.mts +1 -1
  25. package/dist/components/accordion/accordionItem.d.ts +1 -1
  26. package/dist/components/accordion/accordionItem.js +31 -1
  27. package/dist/components/accordion/accordionItem.mjs +3 -3
  28. package/dist/components/accordion/index.js +31 -1
  29. package/dist/components/accordion/index.mjs +3 -3
  30. package/dist/components/button/button-group.test.js +4103 -167
  31. package/dist/components/button/button-group.test.mjs +7 -3
  32. package/dist/components/button/button.d.mts +360 -12
  33. package/dist/components/button/button.d.ts +360 -12
  34. package/dist/components/button/button.js +4054 -110
  35. package/dist/components/button/button.mjs +5 -1
  36. package/dist/components/button/button.test.js +4059 -125
  37. package/dist/components/button/button.test.mjs +7 -3
  38. package/dist/components/button/index.d.mts +3 -0
  39. package/dist/components/button/index.d.ts +3 -0
  40. package/dist/components/button/index.js +4046 -112
  41. package/dist/components/button/index.mjs +5 -1
  42. package/dist/components/card/card.d.mts +1 -1
  43. package/dist/components/card/card.d.ts +1 -1
  44. package/dist/components/checkbox/checkbox.d.mts +69 -69
  45. package/dist/components/checkbox/checkbox.d.ts +69 -69
  46. package/dist/components/checkbox/checkbox.js +28 -21
  47. package/dist/components/checkbox/checkbox.mjs +1 -1
  48. package/dist/components/checkbox/checkbox.test.js +28 -21
  49. package/dist/components/checkbox/checkbox.test.mjs +3 -3
  50. package/dist/components/checkbox/index.js +28 -21
  51. package/dist/components/checkbox/index.mjs +1 -1
  52. package/dist/components/icon/Icon.d.mts +4 -0
  53. package/dist/components/icon/Icon.d.ts +4 -0
  54. package/dist/components/icon/Icon.js +30 -0
  55. package/dist/components/icon/Icon.mjs +2 -2
  56. package/dist/components/icon/index.js +30 -0
  57. package/dist/components/icon/index.mjs +2 -2
  58. package/dist/components/icon/template.d.mts +1 -0
  59. package/dist/components/icon/template.d.ts +1 -0
  60. package/dist/components/icon/template.js +30 -0
  61. package/dist/components/icon/template.mjs +1 -1
  62. package/dist/components/input/index.js +36 -4
  63. package/dist/components/input/index.mjs +3 -3
  64. package/dist/components/input/input.d.mts +7 -2
  65. package/dist/components/input/input.d.ts +7 -2
  66. package/dist/components/input/input.js +36 -4
  67. package/dist/components/input/input.mjs +3 -3
  68. package/dist/components/input/input.test.js +36 -4
  69. package/dist/components/input/input.test.mjs +4 -4
  70. package/dist/components/list/list.d.mts +1 -1
  71. package/dist/components/list/list.d.ts +1 -1
  72. package/dist/components/list/listItem.d.mts +1 -1
  73. package/dist/components/list/listItem.d.ts +1 -1
  74. package/dist/components/modal/index.js +505 -127
  75. package/dist/components/modal/index.mjs +5 -4
  76. package/dist/components/modal/modal.js +505 -127
  77. package/dist/components/modal/modal.mjs +5 -4
  78. package/dist/components/modal/modal.test.js +497 -129
  79. package/dist/components/modal/modal.test.mjs +5 -4
  80. package/dist/components/pagination/index.js +16 -16
  81. package/dist/components/pagination/index.mjs +1 -1
  82. package/dist/components/pagination/pagination.js +16 -16
  83. package/dist/components/pagination/pagination.mjs +1 -1
  84. package/dist/components/pagination/pagination.test.js +16 -16
  85. package/dist/components/pagination/pagination.test.mjs +1 -1
  86. package/dist/components/progress/index.js +9 -9
  87. package/dist/components/progress/index.mjs +1 -1
  88. package/dist/components/progress/progress.d.mts +33 -33
  89. package/dist/components/progress/progress.d.ts +33 -33
  90. package/dist/components/progress/progress.js +9 -9
  91. package/dist/components/progress/progress.mjs +1 -1
  92. package/dist/components/progress/progress.test.js +9 -9
  93. package/dist/components/progress/progress.test.mjs +1 -1
  94. package/dist/components/radio/index.js +37 -19
  95. package/dist/components/radio/index.mjs +1 -1
  96. package/dist/components/radio/radio.d.mts +33 -33
  97. package/dist/components/radio/radio.d.ts +33 -33
  98. package/dist/components/radio/radio.js +37 -19
  99. package/dist/components/radio/radio.mjs +1 -1
  100. package/dist/components/radio/radio.test.js +37 -19
  101. package/dist/components/radio/radio.test.mjs +1 -1
  102. package/dist/components/select/index.js +36 -5
  103. package/dist/components/select/index.mjs +4 -4
  104. package/dist/components/select/option.js +30 -0
  105. package/dist/components/select/option.mjs +3 -3
  106. package/dist/components/select/select.d.mts +2 -2
  107. package/dist/components/select/select.d.ts +2 -2
  108. package/dist/components/select/select.js +36 -5
  109. package/dist/components/select/select.mjs +4 -4
  110. package/dist/components/select/select.test.js +36 -5
  111. package/dist/components/select/select.test.mjs +7 -7
  112. package/dist/components/slider/index.js +9 -4
  113. package/dist/components/slider/index.mjs +1 -1
  114. package/dist/components/slider/slider.d.mts +26 -0
  115. package/dist/components/slider/slider.d.ts +26 -0
  116. package/dist/components/slider/slider.js +9 -4
  117. package/dist/components/slider/slider.mjs +1 -1
  118. package/dist/components/slider/slider.test.js +9 -4
  119. package/dist/components/slider/slider.test.mjs +1 -1
  120. package/dist/components/switch/index.js +16 -15
  121. package/dist/components/switch/index.mjs +1 -1
  122. package/dist/components/switch/switch.d.mts +48 -48
  123. package/dist/components/switch/switch.d.ts +48 -48
  124. package/dist/components/switch/switch.js +16 -15
  125. package/dist/components/switch/switch.mjs +1 -1
  126. package/dist/components/switch/switch.test.js +16 -15
  127. package/dist/components/switch/switch.test.mjs +1 -1
  128. package/dist/components/table/index.js +66 -27
  129. package/dist/components/table/index.mjs +6 -6
  130. package/dist/components/table/table-body.js +60 -23
  131. package/dist/components/table/table-body.mjs +4 -4
  132. package/dist/components/table/table-head.js +28 -21
  133. package/dist/components/table/table-head.mjs +2 -2
  134. package/dist/components/table/table.d.mts +21 -7
  135. package/dist/components/table/table.d.ts +21 -7
  136. package/dist/components/table/table.js +66 -27
  137. package/dist/components/table/table.mjs +6 -6
  138. package/dist/components/table/table.test.js +66 -27
  139. package/dist/components/table/table.test.mjs +6 -6
  140. package/dist/components/tabs/tabs.d.mts +1 -1
  141. package/dist/components/tabs/tabs.d.ts +1 -1
  142. package/dist/components/tabs/tabs.test.mjs +3 -3
  143. package/dist/components/textarea/index.d.mts +3 -0
  144. package/dist/components/textarea/index.d.ts +3 -0
  145. package/dist/components/textarea/index.js +89 -30
  146. package/dist/components/textarea/index.mjs +2 -1
  147. package/dist/components/textarea/textarea.d.mts +510 -9
  148. package/dist/components/textarea/textarea.d.ts +510 -9
  149. package/dist/components/textarea/textarea.js +89 -30
  150. package/dist/components/textarea/textarea.mjs +2 -1
  151. package/dist/components/textarea/textarea.test.js +89 -30
  152. package/dist/components/textarea/textarea.test.mjs +3 -2
  153. package/dist/components/toast/index.js +32 -2
  154. package/dist/components/toast/index.mjs +4 -4
  155. package/dist/components/toast/toast.js +31 -1
  156. package/dist/components/toast/toast.mjs +3 -3
  157. package/dist/components/toast/toast.test.js +31 -1
  158. package/dist/components/toast/toast.test.mjs +3 -3
  159. package/dist/components/toast/use-toast.js +32 -2
  160. package/dist/components/toast/use-toast.mjs +4 -4
  161. package/dist/components/tooltip/tooltip.test.js +4034 -118
  162. package/dist/components/tooltip/tooltip.test.mjs +6 -3
  163. package/dist/index.d.mts +1 -1
  164. package/dist/index.d.ts +1 -1
  165. package/dist/index.js +2773 -2334
  166. package/dist/index.mjs +33 -33
  167. package/package.json +1 -1
  168. package/dist/chunk-66WCZEEU.mjs +0 -320
  169. package/dist/chunk-WOX3SLJB.mjs +0 -162
@@ -1,17 +1,518 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import { VariantProps } from 'tailwind-variants';
3
+ import * as tailwind_variants_dist_config from 'tailwind-variants/dist/config';
1
4
  import * as react from 'react';
2
5
  import { ComponentProps } from 'react';
6
+ import { SlotsToClasses } from '../../utils/types.js';
3
7
 
4
- interface TextareaProps extends Omit<ComponentProps<"textarea">, "size"> {
5
- color?: "primary" | "secondary";
6
- size?: "sm" | "md" | "lg";
7
- variant?: "solid" | "line";
8
- radius?: "default" | "full" | "none";
8
+ interface Props extends Omit<ComponentProps<"textarea">, "size"> {
9
9
  label?: string;
10
10
  errorMessage?: string;
11
- fullWidth?: boolean;
12
- isDisabled?: boolean;
13
- isRequired?: boolean;
11
+ classNames?: SlotsToClasses<TextareaSlots>;
14
12
  }
13
+ type TextareaProps = Props & TextareaVariantProps;
15
14
  declare const Textarea: react.ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & react.RefAttributes<HTMLTextAreaElement>>;
16
15
 
17
- export { type TextareaProps, Textarea as default };
16
+ declare const textareaStyle: tailwind_variants.TVReturnType<{
17
+ variant: {
18
+ solid: {
19
+ textareaWrapper: string[];
20
+ };
21
+ line: {
22
+ textareaWrapper: string[];
23
+ };
24
+ };
25
+ color: {
26
+ primary: {};
27
+ secondary: {};
28
+ };
29
+ size: {
30
+ sm: {
31
+ base: string;
32
+ textareaWrapper: string;
33
+ textarea: string;
34
+ label: string;
35
+ errorMessage: string;
36
+ };
37
+ md: {
38
+ base: string;
39
+ textareaWrapper: string;
40
+ textarea: string;
41
+ label: string;
42
+ errorMessage: string;
43
+ };
44
+ lg: {
45
+ base: string;
46
+ textareaWrapper: string;
47
+ textarea: string;
48
+ label: string;
49
+ errorMessage: string;
50
+ };
51
+ };
52
+ radius: {
53
+ default: {};
54
+ none: {
55
+ textareaWrapper: string;
56
+ textarea: string;
57
+ };
58
+ full: {
59
+ textareaWrapper: string;
60
+ textarea: string;
61
+ };
62
+ };
63
+ fullWidth: {
64
+ true: {
65
+ base: string;
66
+ textareaWrapper: string;
67
+ textarea: string;
68
+ };
69
+ };
70
+ isDisabled: {
71
+ true: {
72
+ base: string[];
73
+ textareaWrapper: string[];
74
+ textarea: string[];
75
+ label: string[];
76
+ errorMessage: string;
77
+ };
78
+ };
79
+ isRequired: {
80
+ true: {
81
+ label: string[];
82
+ };
83
+ };
84
+ }, {
85
+ base: string[];
86
+ label: string[];
87
+ innerWrapper: string[];
88
+ textareaWrapper: string[];
89
+ textarea: string[];
90
+ errorMessage: string[];
91
+ }, undefined, tailwind_variants_dist_config.TVConfig<{
92
+ variant: {
93
+ solid: {
94
+ textareaWrapper: string[];
95
+ };
96
+ line: {
97
+ textareaWrapper: string[];
98
+ };
99
+ };
100
+ color: {
101
+ primary: {};
102
+ secondary: {};
103
+ };
104
+ size: {
105
+ sm: {
106
+ base: string;
107
+ textareaWrapper: string;
108
+ textarea: string;
109
+ label: string;
110
+ errorMessage: string;
111
+ };
112
+ md: {
113
+ base: string;
114
+ textareaWrapper: string;
115
+ textarea: string;
116
+ label: string;
117
+ errorMessage: string;
118
+ };
119
+ lg: {
120
+ base: string;
121
+ textareaWrapper: string;
122
+ textarea: string;
123
+ label: string;
124
+ errorMessage: string;
125
+ };
126
+ };
127
+ radius: {
128
+ default: {};
129
+ none: {
130
+ textareaWrapper: string;
131
+ textarea: string;
132
+ };
133
+ full: {
134
+ textareaWrapper: string;
135
+ textarea: string;
136
+ };
137
+ };
138
+ fullWidth: {
139
+ true: {
140
+ base: string;
141
+ textareaWrapper: string;
142
+ textarea: string;
143
+ };
144
+ };
145
+ isDisabled: {
146
+ true: {
147
+ base: string[];
148
+ textareaWrapper: string[];
149
+ textarea: string[];
150
+ label: string[];
151
+ errorMessage: string;
152
+ };
153
+ };
154
+ isRequired: {
155
+ true: {
156
+ label: string[];
157
+ };
158
+ };
159
+ }, {
160
+ variant: {
161
+ solid: {
162
+ textareaWrapper: string[];
163
+ };
164
+ line: {
165
+ textareaWrapper: string[];
166
+ };
167
+ };
168
+ color: {
169
+ primary: {};
170
+ secondary: {};
171
+ };
172
+ size: {
173
+ sm: {
174
+ base: string;
175
+ textareaWrapper: string;
176
+ textarea: string;
177
+ label: string;
178
+ errorMessage: string;
179
+ };
180
+ md: {
181
+ base: string;
182
+ textareaWrapper: string;
183
+ textarea: string;
184
+ label: string;
185
+ errorMessage: string;
186
+ };
187
+ lg: {
188
+ base: string;
189
+ textareaWrapper: string;
190
+ textarea: string;
191
+ label: string;
192
+ errorMessage: string;
193
+ };
194
+ };
195
+ radius: {
196
+ default: {};
197
+ none: {
198
+ textareaWrapper: string;
199
+ textarea: string;
200
+ };
201
+ full: {
202
+ textareaWrapper: string;
203
+ textarea: string;
204
+ };
205
+ };
206
+ fullWidth: {
207
+ true: {
208
+ base: string;
209
+ textareaWrapper: string;
210
+ textarea: string;
211
+ };
212
+ };
213
+ isDisabled: {
214
+ true: {
215
+ base: string[];
216
+ textareaWrapper: string[];
217
+ textarea: string[];
218
+ label: string[];
219
+ errorMessage: string;
220
+ };
221
+ };
222
+ isRequired: {
223
+ true: {
224
+ label: string[];
225
+ };
226
+ };
227
+ }>, {
228
+ variant: {
229
+ solid: {
230
+ textareaWrapper: string[];
231
+ };
232
+ line: {
233
+ textareaWrapper: string[];
234
+ };
235
+ };
236
+ color: {
237
+ primary: {};
238
+ secondary: {};
239
+ };
240
+ size: {
241
+ sm: {
242
+ base: string;
243
+ textareaWrapper: string;
244
+ textarea: string;
245
+ label: string;
246
+ errorMessage: string;
247
+ };
248
+ md: {
249
+ base: string;
250
+ textareaWrapper: string;
251
+ textarea: string;
252
+ label: string;
253
+ errorMessage: string;
254
+ };
255
+ lg: {
256
+ base: string;
257
+ textareaWrapper: string;
258
+ textarea: string;
259
+ label: string;
260
+ errorMessage: string;
261
+ };
262
+ };
263
+ radius: {
264
+ default: {};
265
+ none: {
266
+ textareaWrapper: string;
267
+ textarea: string;
268
+ };
269
+ full: {
270
+ textareaWrapper: string;
271
+ textarea: string;
272
+ };
273
+ };
274
+ fullWidth: {
275
+ true: {
276
+ base: string;
277
+ textareaWrapper: string;
278
+ textarea: string;
279
+ };
280
+ };
281
+ isDisabled: {
282
+ true: {
283
+ base: string[];
284
+ textareaWrapper: string[];
285
+ textarea: string[];
286
+ label: string[];
287
+ errorMessage: string;
288
+ };
289
+ };
290
+ isRequired: {
291
+ true: {
292
+ label: string[];
293
+ };
294
+ };
295
+ }, {
296
+ base: string[];
297
+ label: string[];
298
+ innerWrapper: string[];
299
+ textareaWrapper: string[];
300
+ textarea: string[];
301
+ errorMessage: string[];
302
+ }, tailwind_variants.TVReturnType<{
303
+ variant: {
304
+ solid: {
305
+ textareaWrapper: string[];
306
+ };
307
+ line: {
308
+ textareaWrapper: string[];
309
+ };
310
+ };
311
+ color: {
312
+ primary: {};
313
+ secondary: {};
314
+ };
315
+ size: {
316
+ sm: {
317
+ base: string;
318
+ textareaWrapper: string;
319
+ textarea: string;
320
+ label: string;
321
+ errorMessage: string;
322
+ };
323
+ md: {
324
+ base: string;
325
+ textareaWrapper: string;
326
+ textarea: string;
327
+ label: string;
328
+ errorMessage: string;
329
+ };
330
+ lg: {
331
+ base: string;
332
+ textareaWrapper: string;
333
+ textarea: string;
334
+ label: string;
335
+ errorMessage: string;
336
+ };
337
+ };
338
+ radius: {
339
+ default: {};
340
+ none: {
341
+ textareaWrapper: string;
342
+ textarea: string;
343
+ };
344
+ full: {
345
+ textareaWrapper: string;
346
+ textarea: string;
347
+ };
348
+ };
349
+ fullWidth: {
350
+ true: {
351
+ base: string;
352
+ textareaWrapper: string;
353
+ textarea: string;
354
+ };
355
+ };
356
+ isDisabled: {
357
+ true: {
358
+ base: string[];
359
+ textareaWrapper: string[];
360
+ textarea: string[];
361
+ label: string[];
362
+ errorMessage: string;
363
+ };
364
+ };
365
+ isRequired: {
366
+ true: {
367
+ label: string[];
368
+ };
369
+ };
370
+ }, {
371
+ base: string[];
372
+ label: string[];
373
+ innerWrapper: string[];
374
+ textareaWrapper: string[];
375
+ textarea: string[];
376
+ errorMessage: string[];
377
+ }, undefined, tailwind_variants_dist_config.TVConfig<{
378
+ variant: {
379
+ solid: {
380
+ textareaWrapper: string[];
381
+ };
382
+ line: {
383
+ textareaWrapper: string[];
384
+ };
385
+ };
386
+ color: {
387
+ primary: {};
388
+ secondary: {};
389
+ };
390
+ size: {
391
+ sm: {
392
+ base: string;
393
+ textareaWrapper: string;
394
+ textarea: string;
395
+ label: string;
396
+ errorMessage: string;
397
+ };
398
+ md: {
399
+ base: string;
400
+ textareaWrapper: string;
401
+ textarea: string;
402
+ label: string;
403
+ errorMessage: string;
404
+ };
405
+ lg: {
406
+ base: string;
407
+ textareaWrapper: string;
408
+ textarea: string;
409
+ label: string;
410
+ errorMessage: string;
411
+ };
412
+ };
413
+ radius: {
414
+ default: {};
415
+ none: {
416
+ textareaWrapper: string;
417
+ textarea: string;
418
+ };
419
+ full: {
420
+ textareaWrapper: string;
421
+ textarea: string;
422
+ };
423
+ };
424
+ fullWidth: {
425
+ true: {
426
+ base: string;
427
+ textareaWrapper: string;
428
+ textarea: string;
429
+ };
430
+ };
431
+ isDisabled: {
432
+ true: {
433
+ base: string[];
434
+ textareaWrapper: string[];
435
+ textarea: string[];
436
+ label: string[];
437
+ errorMessage: string;
438
+ };
439
+ };
440
+ isRequired: {
441
+ true: {
442
+ label: string[];
443
+ };
444
+ };
445
+ }, {
446
+ variant: {
447
+ solid: {
448
+ textareaWrapper: string[];
449
+ };
450
+ line: {
451
+ textareaWrapper: string[];
452
+ };
453
+ };
454
+ color: {
455
+ primary: {};
456
+ secondary: {};
457
+ };
458
+ size: {
459
+ sm: {
460
+ base: string;
461
+ textareaWrapper: string;
462
+ textarea: string;
463
+ label: string;
464
+ errorMessage: string;
465
+ };
466
+ md: {
467
+ base: string;
468
+ textareaWrapper: string;
469
+ textarea: string;
470
+ label: string;
471
+ errorMessage: string;
472
+ };
473
+ lg: {
474
+ base: string;
475
+ textareaWrapper: string;
476
+ textarea: string;
477
+ label: string;
478
+ errorMessage: string;
479
+ };
480
+ };
481
+ radius: {
482
+ default: {};
483
+ none: {
484
+ textareaWrapper: string;
485
+ textarea: string;
486
+ };
487
+ full: {
488
+ textareaWrapper: string;
489
+ textarea: string;
490
+ };
491
+ };
492
+ fullWidth: {
493
+ true: {
494
+ base: string;
495
+ textareaWrapper: string;
496
+ textarea: string;
497
+ };
498
+ };
499
+ isDisabled: {
500
+ true: {
501
+ base: string[];
502
+ textareaWrapper: string[];
503
+ textarea: string[];
504
+ label: string[];
505
+ errorMessage: string;
506
+ };
507
+ };
508
+ isRequired: {
509
+ true: {
510
+ label: string[];
511
+ };
512
+ };
513
+ }>, unknown, unknown, undefined>>;
514
+ type TextareaVariantProps = VariantProps<typeof textareaStyle>;
515
+ type TextareaSlots = keyof ReturnType<typeof textareaStyle>;
516
+ type TextareaReturnType = ReturnType<typeof textareaStyle>;
517
+
518
+ export { type Props, type TextareaProps, type TextareaReturnType, type TextareaSlots, type TextareaVariantProps, Textarea as default };
@@ -26,24 +26,79 @@ __export(textarea_exports, {
26
26
  module.exports = __toCommonJS(textarea_exports);
27
27
  var import_react = require("react");
28
28
  var import_tailwind_variants = require("tailwind-variants");
29
+
30
+ // src/utils/props.ts
31
+ var mapPropsVariants = (props, variantKeys, removeVariantProps = true) => {
32
+ if (!variantKeys) {
33
+ return [props, {}];
34
+ }
35
+ const picked = variantKeys.reduce((acc, key) => {
36
+ if (key in props) {
37
+ return { ...acc, [key]: props[key] };
38
+ } else {
39
+ return acc;
40
+ }
41
+ }, {});
42
+ if (removeVariantProps) {
43
+ const omitted = Object.keys(props).filter((key) => !variantKeys.includes(key)).reduce((acc, key) => ({ ...acc, [key]: props[key] }), {});
44
+ return [omitted, picked];
45
+ } else {
46
+ return [props, picked];
47
+ }
48
+ };
49
+
50
+ // src/components/textarea/textarea.tsx
29
51
  var import_jsx_runtime = require("react/jsx-runtime");
30
- var Textarea = (0, import_react.forwardRef)((props, ref) => {
31
- const { base, label, textareaWrapper, textarea, innerWrapper, errorMessageText } = textareaStyle(props);
32
- const { errorMessage, isRequired, isDisabled, ...textareaProps } = props;
33
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: base(), children: [
34
- props.label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: label(), children: props.label }),
35
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: innerWrapper(), children: [
36
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: textareaWrapper(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
37
- "textarea",
38
- {
39
- ref,
40
- className: textarea(),
41
- disabled: props.isDisabled,
42
- required: props.isRequired,
43
- ...textareaProps
44
- }
45
- ) }),
46
- props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: errorMessageText(), children: props.errorMessage })
52
+ var Textarea = (0, import_react.forwardRef)((originalProps, ref) => {
53
+ const [props, variantProps] = mapPropsVariants(originalProps, textareaStyle.variantKeys);
54
+ const { classNames, label, errorMessage, ...textareaProps } = props;
55
+ const slots = (0, import_react.useMemo)(() => textareaStyle({ ...variantProps }), [variantProps]);
56
+ const getBaseProps = (0, import_react.useCallback)(
57
+ () => ({
58
+ className: slots.base({ class: classNames == null ? void 0 : classNames.base })
59
+ }),
60
+ [slots, classNames]
61
+ );
62
+ const getLabelProps = (0, import_react.useCallback)(
63
+ () => ({
64
+ className: slots.label({ class: classNames == null ? void 0 : classNames.label })
65
+ }),
66
+ [slots, classNames]
67
+ );
68
+ const getInnerWrapperProps = (0, import_react.useCallback)(
69
+ () => ({
70
+ className: slots.innerWrapper({ class: classNames == null ? void 0 : classNames.innerWrapper })
71
+ }),
72
+ [slots, classNames]
73
+ );
74
+ const getTextareaWrapperProps = (0, import_react.useCallback)(
75
+ () => ({
76
+ className: slots.textareaWrapper({ class: classNames == null ? void 0 : classNames.textareaWrapper })
77
+ }),
78
+ [slots, classNames]
79
+ );
80
+ const getTextareaProps = (0, import_react.useCallback)(
81
+ () => ({
82
+ ...textareaProps,
83
+ ref,
84
+ className: slots.textarea({ class: classNames == null ? void 0 : classNames.textarea }),
85
+ disabled: originalProps.isDisabled,
86
+ required: originalProps.isRequired,
87
+ size: 0
88
+ }),
89
+ [textareaProps, ref, slots, classNames == null ? void 0 : classNames.textarea, originalProps.isDisabled, originalProps.isRequired]
90
+ );
91
+ const getErrorMessageProps = (0, import_react.useCallback)(
92
+ () => ({
93
+ className: slots.errorMessage({ class: classNames == null ? void 0 : classNames.errorMessage })
94
+ }),
95
+ [slots, classNames]
96
+ );
97
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ...getBaseProps(), children: [
98
+ props.label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { ...getLabelProps(), children: props.label }),
99
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ...getInnerWrapperProps(), children: [
100
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...getTextareaWrapperProps(), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("textarea", { ...getTextareaProps() }) }),
101
+ props.errorMessage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { ...getErrorMessageProps(), children: props.errorMessage })
47
102
  ] })
48
103
  ] });
49
104
  });
@@ -51,15 +106,15 @@ Textarea.displayName = "Textarea";
51
106
  var textarea_default = Textarea;
52
107
  var textareaStyle = (0, import_tailwind_variants.tv)({
53
108
  slots: {
54
- base: ["group", "flex", "flex-col", "gap-[10px]"],
109
+ base: ["group/textarea", "flex", "flex-col", "gap-[10px]", "select-none"],
55
110
  label: ["flex", "items-center"],
56
111
  innerWrapper: ["flex", "flex-col", "gap-[6px]"],
57
112
  textareaWrapper: [
58
113
  "flex",
59
114
  "bg-transparent",
60
115
  "border-neutral-main",
61
- "p-[10px]",
62
- "group-has-[p]:border-danger-main",
116
+ "group-has-[p]/textarea:border-danger-main",
117
+ "group-has-[p]/textarea:bg-danger-soft",
63
118
  "transition duration-200"
64
119
  ],
65
120
  textarea: [
@@ -69,7 +124,7 @@ var textareaStyle = (0, import_tailwind_variants.tv)({
69
124
  "focus-visible:outline-none",
70
125
  "resize-none"
71
126
  ],
72
- errorMessageText: ["text-s", "text-danger-main"]
127
+ errorMessage: ["text-danger-main"]
73
128
  },
74
129
  variants: {
75
130
  variant: {
@@ -87,21 +142,24 @@ var textareaStyle = (0, import_tailwind_variants.tv)({
87
142
  size: {
88
143
  sm: {
89
144
  base: "gap-[6px]",
90
- textareaWrapper: "w-[240px] rounded-sm",
145
+ textareaWrapper: "w-[240px] rounded-sm p-[6px]",
91
146
  textarea: "text-sm rounded-sm",
92
- label: "text-sm"
147
+ label: "text-sm",
148
+ errorMessage: "text-sm"
93
149
  },
94
150
  md: {
95
151
  base: "gap-[8px]",
96
- textareaWrapper: "w-[240px] rounded-md",
152
+ textareaWrapper: "w-[240px] rounded-md p-[8px]",
97
153
  textarea: "text-md rounded-md",
98
- label: "text-md"
154
+ label: "text-md",
155
+ errorMessage: "text-md"
99
156
  },
100
157
  lg: {
101
158
  base: "gap-[10px]",
102
- textareaWrapper: "w-[240px] rounded-lg",
159
+ textareaWrapper: "w-[240px] rounded-lg p-[10px]",
103
160
  textarea: "text-lg rounded-lg",
104
- label: "text-lg"
161
+ label: "text-lg",
162
+ errorMessage: "text-lg"
105
163
  }
106
164
  },
107
165
  radius: {
@@ -125,9 +183,10 @@ var textareaStyle = (0, import_tailwind_variants.tv)({
125
183
  isDisabled: {
126
184
  true: {
127
185
  base: ["opacity-disabled", "pointer-events-none"],
128
- textareaWrapper: ["border-neutral-light", "pointer-events-none"],
129
- textarea: ["bg-neutral-soft", "text-neutral-light placeholder:text-neutral-light", "border-neutral-light"],
130
- label: ["text-neutral-light", "pointer-events-none"]
186
+ textareaWrapper: ["bg-neutral-soft", "border-neutral-light", "pointer-events-none"],
187
+ textarea: ["text-neutral-light placeholder:text-neutral-light", "border-neutral-light"],
188
+ label: ["text-neutral-light", "pointer-events-none"],
189
+ errorMessage: "text-danger-light"
131
190
  }
132
191
  },
133
192
  isRequired: {
@@ -1,7 +1,8 @@
1
1
  "use client";
2
2
  import {
3
3
  textarea_default
4
- } from "../../chunk-WOX3SLJB.mjs";
4
+ } from "../../chunk-OJ2OEI5B.mjs";
5
+ import "../../chunk-E3G5QXSH.mjs";
5
6
  import "../../chunk-IZ6II3QA.mjs";
6
7
  export {
7
8
  textarea_default as default