@wow-two-beta/ui 0.0.4 → 0.0.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/dist/actions/index.d.ts +240 -2
- package/dist/actions/index.js +2 -1
- package/dist/chunk-33IOXQYO.js +47 -0
- package/dist/chunk-33IOXQYO.js.map +1 -0
- package/dist/chunk-4CIRBYYP.js +120 -0
- package/dist/chunk-4CIRBYYP.js.map +1 -0
- package/dist/{chunk-AOHZGL6F.js → chunk-6NYTRHP7.js} +4 -3
- package/dist/chunk-6NYTRHP7.js.map +1 -0
- package/dist/{chunk-KDXJQNB6.js → chunk-77WSI427.js} +5 -9
- package/dist/chunk-77WSI427.js.map +1 -0
- package/dist/{chunk-T3JN5Y3E.js → chunk-JCMV6IT4.js} +7 -71
- package/dist/chunk-JCMV6IT4.js.map +1 -0
- package/dist/chunk-JTJEI6MF.js +11 -0
- package/dist/chunk-JTJEI6MF.js.map +1 -0
- package/dist/chunk-KSJE3JAI.js +604 -0
- package/dist/chunk-KSJE3JAI.js.map +1 -0
- package/dist/chunk-MP4OTUFA.js +318 -0
- package/dist/chunk-MP4OTUFA.js.map +1 -0
- package/dist/chunk-Q27NAHVB.js +34 -0
- package/dist/chunk-Q27NAHVB.js.map +1 -0
- package/dist/chunk-SYG6ZE42.js +218 -0
- package/dist/chunk-SYG6ZE42.js.map +1 -0
- package/dist/chunk-YLN7VMYU.js +275 -0
- package/dist/chunk-YLN7VMYU.js.map +1 -0
- package/dist/display/index.d.ts +805 -1
- package/dist/display/index.js +6 -1
- package/dist/feedback/index.d.ts +506 -1
- package/dist/feedback/index.js +5 -1
- package/dist/forms/index.d.ts +217 -1
- package/dist/forms/index.js +8 -1
- package/dist/hooks/index.js +3 -2
- package/dist/index.d.ts +5 -1
- package/dist/index.js +11 -8
- package/dist/layout/index.d.ts +605 -1
- package/dist/layout/index.js +5 -1
- package/dist/primitives/index.js +5 -2
- package/package.json +1 -1
- package/dist/chunk-A2OBJDIK.js +0 -3
- package/dist/chunk-A2OBJDIK.js.map +0 -1
- package/dist/chunk-AOHZGL6F.js.map +0 -1
- package/dist/chunk-KDXJQNB6.js.map +0 -1
- package/dist/chunk-OEEYNBEO.js +0 -41
- package/dist/chunk-OEEYNBEO.js.map +0 -1
- package/dist/chunk-PSDQXPUE.js +0 -3
- package/dist/chunk-PSDQXPUE.js.map +0 -1
- package/dist/chunk-T3JN5Y3E.js.map +0 -1
- package/dist/chunk-YP4MAZRQ.js +0 -3
- package/dist/chunk-YP4MAZRQ.js.map +0 -1
- package/dist/chunk-ZDU7SROW.js +0 -3
- package/dist/chunk-ZDU7SROW.js.map +0 -1
package/dist/layout/index.d.ts
CHANGED
|
@@ -1,2 +1,606 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentPropsWithoutRef, ElementType } from 'react';
|
|
3
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
4
|
+
import { VariantProps } from 'tailwind-variants';
|
|
5
|
+
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
1
6
|
|
|
2
|
-
|
|
7
|
+
interface BoxProps extends Omit<ComponentPropsWithoutRef<'div'>, 'as'> {
|
|
8
|
+
/** HTML element to render. Default `div`. */
|
|
9
|
+
as?: ElementType;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The lowest-level layout primitive. Renders any element (default `div`)
|
|
13
|
+
* with className passthrough. Use as a styling shell when no other layout
|
|
14
|
+
* atom fits.
|
|
15
|
+
*/
|
|
16
|
+
declare const Box: react.ForwardRefExoticComponent<BoxProps & react.RefAttributes<HTMLElement>>;
|
|
17
|
+
|
|
18
|
+
declare const stackVariants: tailwind_variants.TVReturnType<{
|
|
19
|
+
direction: {
|
|
20
|
+
row: string;
|
|
21
|
+
column: string;
|
|
22
|
+
'row-reverse': string;
|
|
23
|
+
'column-reverse': string;
|
|
24
|
+
};
|
|
25
|
+
align: {
|
|
26
|
+
start: string;
|
|
27
|
+
center: string;
|
|
28
|
+
end: string;
|
|
29
|
+
stretch: string;
|
|
30
|
+
baseline: string;
|
|
31
|
+
};
|
|
32
|
+
justify: {
|
|
33
|
+
start: string;
|
|
34
|
+
center: string;
|
|
35
|
+
end: string;
|
|
36
|
+
between: string;
|
|
37
|
+
around: string;
|
|
38
|
+
evenly: string;
|
|
39
|
+
};
|
|
40
|
+
gap: {
|
|
41
|
+
'0': string;
|
|
42
|
+
'1': string;
|
|
43
|
+
'2': string;
|
|
44
|
+
'3': string;
|
|
45
|
+
'4': string;
|
|
46
|
+
'5': string;
|
|
47
|
+
'6': string;
|
|
48
|
+
'8': string;
|
|
49
|
+
'10': string;
|
|
50
|
+
'12': string;
|
|
51
|
+
};
|
|
52
|
+
wrap: {
|
|
53
|
+
wrap: string;
|
|
54
|
+
nowrap: string;
|
|
55
|
+
'wrap-reverse': string;
|
|
56
|
+
};
|
|
57
|
+
}, undefined, "flex", tailwind_variants_dist_config_js.TVConfig<{
|
|
58
|
+
direction: {
|
|
59
|
+
row: string;
|
|
60
|
+
column: string;
|
|
61
|
+
'row-reverse': string;
|
|
62
|
+
'column-reverse': string;
|
|
63
|
+
};
|
|
64
|
+
align: {
|
|
65
|
+
start: string;
|
|
66
|
+
center: string;
|
|
67
|
+
end: string;
|
|
68
|
+
stretch: string;
|
|
69
|
+
baseline: string;
|
|
70
|
+
};
|
|
71
|
+
justify: {
|
|
72
|
+
start: string;
|
|
73
|
+
center: string;
|
|
74
|
+
end: string;
|
|
75
|
+
between: string;
|
|
76
|
+
around: string;
|
|
77
|
+
evenly: string;
|
|
78
|
+
};
|
|
79
|
+
gap: {
|
|
80
|
+
'0': string;
|
|
81
|
+
'1': string;
|
|
82
|
+
'2': string;
|
|
83
|
+
'3': string;
|
|
84
|
+
'4': string;
|
|
85
|
+
'5': string;
|
|
86
|
+
'6': string;
|
|
87
|
+
'8': string;
|
|
88
|
+
'10': string;
|
|
89
|
+
'12': string;
|
|
90
|
+
};
|
|
91
|
+
wrap: {
|
|
92
|
+
wrap: string;
|
|
93
|
+
nowrap: string;
|
|
94
|
+
'wrap-reverse': string;
|
|
95
|
+
};
|
|
96
|
+
}, {
|
|
97
|
+
direction: {
|
|
98
|
+
row: string;
|
|
99
|
+
column: string;
|
|
100
|
+
'row-reverse': string;
|
|
101
|
+
'column-reverse': string;
|
|
102
|
+
};
|
|
103
|
+
align: {
|
|
104
|
+
start: string;
|
|
105
|
+
center: string;
|
|
106
|
+
end: string;
|
|
107
|
+
stretch: string;
|
|
108
|
+
baseline: string;
|
|
109
|
+
};
|
|
110
|
+
justify: {
|
|
111
|
+
start: string;
|
|
112
|
+
center: string;
|
|
113
|
+
end: string;
|
|
114
|
+
between: string;
|
|
115
|
+
around: string;
|
|
116
|
+
evenly: string;
|
|
117
|
+
};
|
|
118
|
+
gap: {
|
|
119
|
+
'0': string;
|
|
120
|
+
'1': string;
|
|
121
|
+
'2': string;
|
|
122
|
+
'3': string;
|
|
123
|
+
'4': string;
|
|
124
|
+
'5': string;
|
|
125
|
+
'6': string;
|
|
126
|
+
'8': string;
|
|
127
|
+
'10': string;
|
|
128
|
+
'12': string;
|
|
129
|
+
};
|
|
130
|
+
wrap: {
|
|
131
|
+
wrap: string;
|
|
132
|
+
nowrap: string;
|
|
133
|
+
'wrap-reverse': string;
|
|
134
|
+
};
|
|
135
|
+
}>, {
|
|
136
|
+
direction: {
|
|
137
|
+
row: string;
|
|
138
|
+
column: string;
|
|
139
|
+
'row-reverse': string;
|
|
140
|
+
'column-reverse': string;
|
|
141
|
+
};
|
|
142
|
+
align: {
|
|
143
|
+
start: string;
|
|
144
|
+
center: string;
|
|
145
|
+
end: string;
|
|
146
|
+
stretch: string;
|
|
147
|
+
baseline: string;
|
|
148
|
+
};
|
|
149
|
+
justify: {
|
|
150
|
+
start: string;
|
|
151
|
+
center: string;
|
|
152
|
+
end: string;
|
|
153
|
+
between: string;
|
|
154
|
+
around: string;
|
|
155
|
+
evenly: string;
|
|
156
|
+
};
|
|
157
|
+
gap: {
|
|
158
|
+
'0': string;
|
|
159
|
+
'1': string;
|
|
160
|
+
'2': string;
|
|
161
|
+
'3': string;
|
|
162
|
+
'4': string;
|
|
163
|
+
'5': string;
|
|
164
|
+
'6': string;
|
|
165
|
+
'8': string;
|
|
166
|
+
'10': string;
|
|
167
|
+
'12': string;
|
|
168
|
+
};
|
|
169
|
+
wrap: {
|
|
170
|
+
wrap: string;
|
|
171
|
+
nowrap: string;
|
|
172
|
+
'wrap-reverse': string;
|
|
173
|
+
};
|
|
174
|
+
}, undefined, tailwind_variants.TVReturnType<{
|
|
175
|
+
direction: {
|
|
176
|
+
row: string;
|
|
177
|
+
column: string;
|
|
178
|
+
'row-reverse': string;
|
|
179
|
+
'column-reverse': string;
|
|
180
|
+
};
|
|
181
|
+
align: {
|
|
182
|
+
start: string;
|
|
183
|
+
center: string;
|
|
184
|
+
end: string;
|
|
185
|
+
stretch: string;
|
|
186
|
+
baseline: string;
|
|
187
|
+
};
|
|
188
|
+
justify: {
|
|
189
|
+
start: string;
|
|
190
|
+
center: string;
|
|
191
|
+
end: string;
|
|
192
|
+
between: string;
|
|
193
|
+
around: string;
|
|
194
|
+
evenly: string;
|
|
195
|
+
};
|
|
196
|
+
gap: {
|
|
197
|
+
'0': string;
|
|
198
|
+
'1': string;
|
|
199
|
+
'2': string;
|
|
200
|
+
'3': string;
|
|
201
|
+
'4': string;
|
|
202
|
+
'5': string;
|
|
203
|
+
'6': string;
|
|
204
|
+
'8': string;
|
|
205
|
+
'10': string;
|
|
206
|
+
'12': string;
|
|
207
|
+
};
|
|
208
|
+
wrap: {
|
|
209
|
+
wrap: string;
|
|
210
|
+
nowrap: string;
|
|
211
|
+
'wrap-reverse': string;
|
|
212
|
+
};
|
|
213
|
+
}, undefined, "flex", tailwind_variants_dist_config_js.TVConfig<{
|
|
214
|
+
direction: {
|
|
215
|
+
row: string;
|
|
216
|
+
column: string;
|
|
217
|
+
'row-reverse': string;
|
|
218
|
+
'column-reverse': string;
|
|
219
|
+
};
|
|
220
|
+
align: {
|
|
221
|
+
start: string;
|
|
222
|
+
center: string;
|
|
223
|
+
end: string;
|
|
224
|
+
stretch: string;
|
|
225
|
+
baseline: string;
|
|
226
|
+
};
|
|
227
|
+
justify: {
|
|
228
|
+
start: string;
|
|
229
|
+
center: string;
|
|
230
|
+
end: string;
|
|
231
|
+
between: string;
|
|
232
|
+
around: string;
|
|
233
|
+
evenly: string;
|
|
234
|
+
};
|
|
235
|
+
gap: {
|
|
236
|
+
'0': string;
|
|
237
|
+
'1': string;
|
|
238
|
+
'2': string;
|
|
239
|
+
'3': string;
|
|
240
|
+
'4': string;
|
|
241
|
+
'5': string;
|
|
242
|
+
'6': string;
|
|
243
|
+
'8': string;
|
|
244
|
+
'10': string;
|
|
245
|
+
'12': string;
|
|
246
|
+
};
|
|
247
|
+
wrap: {
|
|
248
|
+
wrap: string;
|
|
249
|
+
nowrap: string;
|
|
250
|
+
'wrap-reverse': string;
|
|
251
|
+
};
|
|
252
|
+
}, {
|
|
253
|
+
direction: {
|
|
254
|
+
row: string;
|
|
255
|
+
column: string;
|
|
256
|
+
'row-reverse': string;
|
|
257
|
+
'column-reverse': string;
|
|
258
|
+
};
|
|
259
|
+
align: {
|
|
260
|
+
start: string;
|
|
261
|
+
center: string;
|
|
262
|
+
end: string;
|
|
263
|
+
stretch: string;
|
|
264
|
+
baseline: string;
|
|
265
|
+
};
|
|
266
|
+
justify: {
|
|
267
|
+
start: string;
|
|
268
|
+
center: string;
|
|
269
|
+
end: string;
|
|
270
|
+
between: string;
|
|
271
|
+
around: string;
|
|
272
|
+
evenly: string;
|
|
273
|
+
};
|
|
274
|
+
gap: {
|
|
275
|
+
'0': string;
|
|
276
|
+
'1': string;
|
|
277
|
+
'2': string;
|
|
278
|
+
'3': string;
|
|
279
|
+
'4': string;
|
|
280
|
+
'5': string;
|
|
281
|
+
'6': string;
|
|
282
|
+
'8': string;
|
|
283
|
+
'10': string;
|
|
284
|
+
'12': string;
|
|
285
|
+
};
|
|
286
|
+
wrap: {
|
|
287
|
+
wrap: string;
|
|
288
|
+
nowrap: string;
|
|
289
|
+
'wrap-reverse': string;
|
|
290
|
+
};
|
|
291
|
+
}>, unknown, unknown, undefined>>;
|
|
292
|
+
type StackVariants = VariantProps<typeof stackVariants>;
|
|
293
|
+
|
|
294
|
+
interface StackProps extends Omit<ComponentPropsWithoutRef<'div'>, 'as'>, StackVariants {
|
|
295
|
+
as?: ElementType;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Vertical (default) or horizontal flex container with gap and alignment
|
|
299
|
+
* variants. For row preset use `HStack`, for column use `VStack`.
|
|
300
|
+
*/
|
|
301
|
+
declare const Stack: react.ForwardRefExoticComponent<StackProps & react.RefAttributes<HTMLElement>>;
|
|
302
|
+
|
|
303
|
+
type HStackProps = Omit<StackProps, 'direction'>;
|
|
304
|
+
/** Stack preset: `direction="row"`. */
|
|
305
|
+
declare const HStack: react.ForwardRefExoticComponent<HStackProps & react.RefAttributes<HTMLElement>>;
|
|
306
|
+
|
|
307
|
+
type VStackProps = Omit<StackProps, 'direction'>;
|
|
308
|
+
/** Stack preset: `direction="column"` (default). Provided for symmetry with HStack. */
|
|
309
|
+
declare const VStack: react.ForwardRefExoticComponent<VStackProps & react.RefAttributes<HTMLElement>>;
|
|
310
|
+
|
|
311
|
+
declare const gridVariants: tailwind_variants.TVReturnType<{
|
|
312
|
+
columns: {
|
|
313
|
+
'1': string;
|
|
314
|
+
'2': string;
|
|
315
|
+
'3': string;
|
|
316
|
+
'4': string;
|
|
317
|
+
'5': string;
|
|
318
|
+
'6': string;
|
|
319
|
+
'8': string;
|
|
320
|
+
'12': string;
|
|
321
|
+
};
|
|
322
|
+
gap: {
|
|
323
|
+
'0': string;
|
|
324
|
+
'1': string;
|
|
325
|
+
'2': string;
|
|
326
|
+
'3': string;
|
|
327
|
+
'4': string;
|
|
328
|
+
'5': string;
|
|
329
|
+
'6': string;
|
|
330
|
+
'8': string;
|
|
331
|
+
'10': string;
|
|
332
|
+
'12': string;
|
|
333
|
+
};
|
|
334
|
+
}, undefined, "grid", tailwind_variants_dist_config_js.TVConfig<{
|
|
335
|
+
columns: {
|
|
336
|
+
'1': string;
|
|
337
|
+
'2': string;
|
|
338
|
+
'3': string;
|
|
339
|
+
'4': string;
|
|
340
|
+
'5': string;
|
|
341
|
+
'6': string;
|
|
342
|
+
'8': string;
|
|
343
|
+
'12': string;
|
|
344
|
+
};
|
|
345
|
+
gap: {
|
|
346
|
+
'0': string;
|
|
347
|
+
'1': string;
|
|
348
|
+
'2': string;
|
|
349
|
+
'3': string;
|
|
350
|
+
'4': string;
|
|
351
|
+
'5': string;
|
|
352
|
+
'6': string;
|
|
353
|
+
'8': string;
|
|
354
|
+
'10': string;
|
|
355
|
+
'12': string;
|
|
356
|
+
};
|
|
357
|
+
}, {
|
|
358
|
+
columns: {
|
|
359
|
+
'1': string;
|
|
360
|
+
'2': string;
|
|
361
|
+
'3': string;
|
|
362
|
+
'4': string;
|
|
363
|
+
'5': string;
|
|
364
|
+
'6': string;
|
|
365
|
+
'8': string;
|
|
366
|
+
'12': string;
|
|
367
|
+
};
|
|
368
|
+
gap: {
|
|
369
|
+
'0': string;
|
|
370
|
+
'1': string;
|
|
371
|
+
'2': string;
|
|
372
|
+
'3': string;
|
|
373
|
+
'4': string;
|
|
374
|
+
'5': string;
|
|
375
|
+
'6': string;
|
|
376
|
+
'8': string;
|
|
377
|
+
'10': string;
|
|
378
|
+
'12': string;
|
|
379
|
+
};
|
|
380
|
+
}>, {
|
|
381
|
+
columns: {
|
|
382
|
+
'1': string;
|
|
383
|
+
'2': string;
|
|
384
|
+
'3': string;
|
|
385
|
+
'4': string;
|
|
386
|
+
'5': string;
|
|
387
|
+
'6': string;
|
|
388
|
+
'8': string;
|
|
389
|
+
'12': string;
|
|
390
|
+
};
|
|
391
|
+
gap: {
|
|
392
|
+
'0': string;
|
|
393
|
+
'1': string;
|
|
394
|
+
'2': string;
|
|
395
|
+
'3': string;
|
|
396
|
+
'4': string;
|
|
397
|
+
'5': string;
|
|
398
|
+
'6': string;
|
|
399
|
+
'8': string;
|
|
400
|
+
'10': string;
|
|
401
|
+
'12': string;
|
|
402
|
+
};
|
|
403
|
+
}, undefined, tailwind_variants.TVReturnType<{
|
|
404
|
+
columns: {
|
|
405
|
+
'1': string;
|
|
406
|
+
'2': string;
|
|
407
|
+
'3': string;
|
|
408
|
+
'4': string;
|
|
409
|
+
'5': string;
|
|
410
|
+
'6': string;
|
|
411
|
+
'8': string;
|
|
412
|
+
'12': string;
|
|
413
|
+
};
|
|
414
|
+
gap: {
|
|
415
|
+
'0': string;
|
|
416
|
+
'1': string;
|
|
417
|
+
'2': string;
|
|
418
|
+
'3': string;
|
|
419
|
+
'4': string;
|
|
420
|
+
'5': string;
|
|
421
|
+
'6': string;
|
|
422
|
+
'8': string;
|
|
423
|
+
'10': string;
|
|
424
|
+
'12': string;
|
|
425
|
+
};
|
|
426
|
+
}, undefined, "grid", tailwind_variants_dist_config_js.TVConfig<{
|
|
427
|
+
columns: {
|
|
428
|
+
'1': string;
|
|
429
|
+
'2': string;
|
|
430
|
+
'3': string;
|
|
431
|
+
'4': string;
|
|
432
|
+
'5': string;
|
|
433
|
+
'6': string;
|
|
434
|
+
'8': string;
|
|
435
|
+
'12': string;
|
|
436
|
+
};
|
|
437
|
+
gap: {
|
|
438
|
+
'0': string;
|
|
439
|
+
'1': string;
|
|
440
|
+
'2': string;
|
|
441
|
+
'3': string;
|
|
442
|
+
'4': string;
|
|
443
|
+
'5': string;
|
|
444
|
+
'6': string;
|
|
445
|
+
'8': string;
|
|
446
|
+
'10': string;
|
|
447
|
+
'12': string;
|
|
448
|
+
};
|
|
449
|
+
}, {
|
|
450
|
+
columns: {
|
|
451
|
+
'1': string;
|
|
452
|
+
'2': string;
|
|
453
|
+
'3': string;
|
|
454
|
+
'4': string;
|
|
455
|
+
'5': string;
|
|
456
|
+
'6': string;
|
|
457
|
+
'8': string;
|
|
458
|
+
'12': string;
|
|
459
|
+
};
|
|
460
|
+
gap: {
|
|
461
|
+
'0': string;
|
|
462
|
+
'1': string;
|
|
463
|
+
'2': string;
|
|
464
|
+
'3': string;
|
|
465
|
+
'4': string;
|
|
466
|
+
'5': string;
|
|
467
|
+
'6': string;
|
|
468
|
+
'8': string;
|
|
469
|
+
'10': string;
|
|
470
|
+
'12': string;
|
|
471
|
+
};
|
|
472
|
+
}>, unknown, unknown, undefined>>;
|
|
473
|
+
type GridVariants = VariantProps<typeof gridVariants>;
|
|
474
|
+
|
|
475
|
+
interface GridProps extends Omit<ComponentPropsWithoutRef<'div'>, 'as'>, GridVariants {
|
|
476
|
+
as?: ElementType;
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* CSS grid container with column and gap variants. For non-uniform tracks
|
|
480
|
+
* pass an explicit `style={{ gridTemplateColumns }}` — the variant covers
|
|
481
|
+
* the equal-column case.
|
|
482
|
+
*/
|
|
483
|
+
declare const Grid: react.ForwardRefExoticComponent<GridProps & react.RefAttributes<HTMLElement>>;
|
|
484
|
+
|
|
485
|
+
declare const containerVariants: tailwind_variants.TVReturnType<{
|
|
486
|
+
size: {
|
|
487
|
+
sm: string;
|
|
488
|
+
md: string;
|
|
489
|
+
lg: string;
|
|
490
|
+
xl: string;
|
|
491
|
+
'2xl': string;
|
|
492
|
+
full: string;
|
|
493
|
+
};
|
|
494
|
+
}, undefined, "mx-auto w-full px-4", tailwind_variants_dist_config_js.TVConfig<{
|
|
495
|
+
size: {
|
|
496
|
+
sm: string;
|
|
497
|
+
md: string;
|
|
498
|
+
lg: string;
|
|
499
|
+
xl: string;
|
|
500
|
+
'2xl': string;
|
|
501
|
+
full: string;
|
|
502
|
+
};
|
|
503
|
+
}, {
|
|
504
|
+
size: {
|
|
505
|
+
sm: string;
|
|
506
|
+
md: string;
|
|
507
|
+
lg: string;
|
|
508
|
+
xl: string;
|
|
509
|
+
'2xl': string;
|
|
510
|
+
full: string;
|
|
511
|
+
};
|
|
512
|
+
}>, {
|
|
513
|
+
size: {
|
|
514
|
+
sm: string;
|
|
515
|
+
md: string;
|
|
516
|
+
lg: string;
|
|
517
|
+
xl: string;
|
|
518
|
+
'2xl': string;
|
|
519
|
+
full: string;
|
|
520
|
+
};
|
|
521
|
+
}, undefined, tailwind_variants.TVReturnType<{
|
|
522
|
+
size: {
|
|
523
|
+
sm: string;
|
|
524
|
+
md: string;
|
|
525
|
+
lg: string;
|
|
526
|
+
xl: string;
|
|
527
|
+
'2xl': string;
|
|
528
|
+
full: string;
|
|
529
|
+
};
|
|
530
|
+
}, undefined, "mx-auto w-full px-4", tailwind_variants_dist_config_js.TVConfig<{
|
|
531
|
+
size: {
|
|
532
|
+
sm: string;
|
|
533
|
+
md: string;
|
|
534
|
+
lg: string;
|
|
535
|
+
xl: string;
|
|
536
|
+
'2xl': string;
|
|
537
|
+
full: string;
|
|
538
|
+
};
|
|
539
|
+
}, {
|
|
540
|
+
size: {
|
|
541
|
+
sm: string;
|
|
542
|
+
md: string;
|
|
543
|
+
lg: string;
|
|
544
|
+
xl: string;
|
|
545
|
+
'2xl': string;
|
|
546
|
+
full: string;
|
|
547
|
+
};
|
|
548
|
+
}>, unknown, unknown, undefined>>;
|
|
549
|
+
type ContainerVariants = VariantProps<typeof containerVariants>;
|
|
550
|
+
|
|
551
|
+
interface ContainerProps extends Omit<ComponentPropsWithoutRef<'div'>, 'as'>, ContainerVariants {
|
|
552
|
+
as?: ElementType;
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Centered max-width wrapper with horizontal padding. Use at page-level to
|
|
556
|
+
* constrain content width.
|
|
557
|
+
*/
|
|
558
|
+
declare const Container: react.ForwardRefExoticComponent<ContainerProps & react.RefAttributes<HTMLElement>>;
|
|
559
|
+
|
|
560
|
+
interface FlexProps extends Omit<ComponentPropsWithoutRef<'div'>, 'as'> {
|
|
561
|
+
as?: ElementType;
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Bare flex container — no opinions on direction, gap, or alignment.
|
|
565
|
+
* Use for one-off flex layouts that don't fit `Stack`'s variant matrix.
|
|
566
|
+
*/
|
|
567
|
+
declare const Flex: react.ForwardRefExoticComponent<FlexProps & react.RefAttributes<HTMLElement>>;
|
|
568
|
+
|
|
569
|
+
interface AspectRatioProps extends ComponentPropsWithoutRef<'div'> {
|
|
570
|
+
/** Numeric ratio (width/height). Default 1 (square). */
|
|
571
|
+
ratio?: number;
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Constrain children to an aspect ratio (width / height). Children are
|
|
575
|
+
* absolutely positioned and stretched to fill — typically pass a single
|
|
576
|
+
* `<img>`, `<video>`, or `<iframe>` with `className="absolute inset-0 w-full h-full"`.
|
|
577
|
+
*/
|
|
578
|
+
declare const AspectRatio: react.ForwardRefExoticComponent<AspectRatioProps & react.RefAttributes<HTMLDivElement>>;
|
|
579
|
+
|
|
580
|
+
interface SpacerProps extends ComponentPropsWithoutRef<'div'> {
|
|
581
|
+
/** Optional explicit size (CSS length). When inside a flex/grid parent,
|
|
582
|
+
* the default `flex: 1` already pushes siblings apart. */
|
|
583
|
+
size?: number | string;
|
|
584
|
+
axis?: 'horizontal' | 'vertical';
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* A flexible empty box. In a flex parent it expands (`flex: 1`) and pushes
|
|
588
|
+
* siblings to opposite ends. Pass `size` for a fixed gap.
|
|
589
|
+
*/
|
|
590
|
+
declare const Spacer: react.ForwardRefExoticComponent<SpacerProps & react.RefAttributes<HTMLDivElement>>;
|
|
591
|
+
|
|
592
|
+
type CenterProps = ComponentPropsWithoutRef<'div'>;
|
|
593
|
+
/** Flex shorthand that centers its children both axes. */
|
|
594
|
+
declare const Center: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
595
|
+
|
|
596
|
+
interface ScrollAreaProps extends ComponentPropsWithoutRef<'div'> {
|
|
597
|
+
axis?: 'vertical' | 'horizontal' | 'both';
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Native scrollable container with stable visuals. For custom-styled
|
|
601
|
+
* scrollbars (track + thumb separately animated) use the L5 ScrollArea
|
|
602
|
+
* organism. This atom exists for the common case.
|
|
603
|
+
*/
|
|
604
|
+
declare const ScrollArea: react.ForwardRefExoticComponent<ScrollAreaProps & react.RefAttributes<HTMLDivElement>>;
|
|
605
|
+
|
|
606
|
+
export { AspectRatio, type AspectRatioProps, Box, type BoxProps, Center, type CenterProps, Container, type ContainerProps, type ContainerVariants, Flex, type FlexProps, Grid, type GridProps, type GridVariants, HStack, type HStackProps, ScrollArea, type ScrollAreaProps, Spacer, type SpacerProps, Stack, type StackProps, type StackVariants, VStack, type VStackProps, containerVariants, gridVariants, stackVariants };
|
package/dist/layout/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
export { AspectRatio, Box, Center, Container, Flex, Grid, HStack, ScrollArea, Spacer, Stack, VStack, containerVariants, gridVariants, stackVariants } from '../chunk-SYG6ZE42.js';
|
|
2
|
+
import '../chunk-BMBIZLO4.js';
|
|
3
|
+
import '../chunk-DN7WBRIV.js';
|
|
4
|
+
import '../chunk-KZ4VFY2T.js';
|
|
5
|
+
import '../chunk-PZ5AY32C.js';
|
|
2
6
|
//# sourceMappingURL=index.js.map
|
|
3
7
|
//# sourceMappingURL=index.js.map
|
package/dist/primitives/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
export { AccessibleIcon, AnchoredPositioner, DirectionProvider, DismissableLayer, FocusScope,
|
|
2
|
-
|
|
1
|
+
export { AccessibleIcon, AnchoredPositioner, DirectionProvider, DismissableLayer, FocusScope, Portal, Presence, RovingFocusGroup, ScrollLockProvider, VisuallyHidden, createCollection, useDirection, useRovingFocusItem } from '../chunk-JCMV6IT4.js';
|
|
2
|
+
export { FormControlProvider, useFormControl } from '../chunk-Q27NAHVB.js';
|
|
3
|
+
import '../chunk-77WSI427.js';
|
|
4
|
+
import '../chunk-JTJEI6MF.js';
|
|
5
|
+
export { Slot } from '../chunk-33IOXQYO.js';
|
|
3
6
|
import '../chunk-DN7WBRIV.js';
|
|
4
7
|
import '../chunk-KZ4VFY2T.js';
|
|
5
8
|
import '../chunk-PZ5AY32C.js';
|
package/package.json
CHANGED
package/dist/chunk-A2OBJDIK.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-A2OBJDIK.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/index.ts","../src/hooks/useControlled.ts","../src/hooks/useDisclosure.ts","../src/hooks/useEventListener.ts","../src/hooks/useOutsideClick.ts","../src/hooks/useEscape.ts","../src/hooks/useFocusTrap.ts","../src/hooks/useResizeObserver.ts","../src/hooks/useMediaQuery.ts"],"names":["useState","useCallback","useRef","useEffect"],"mappings":";;;;;AAAA,IAAA,aAAA,GAAA;AAAA,QAAA,CAAA,aAAA,EAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,EAAA,SAAA,EAAA,MAAA,SAAA;AAAA,EAAA,gBAAA,EAAA,MAAA,gBAAA;AAAA,EAAA,YAAA,EAAA,MAAA,YAAA;AAAA,EAAA,KAAA,EAAA,MAAA,KAAA;AAAA,EAAA,aAAA,EAAA,MAAA,aAAA;AAAA,EAAA,eAAA,EAAA,MAAA,eAAA;AAAA,EAAA,iBAAA,EAAA,MAAA,iBAAA;AAAA,EAAA,aAAA,EAAA,MAAA;AAAA,CAAA,CAAA;ACgBO,SAAS,aAAA,CAAiB;AAAA,EAC/B,UAAA;AAAA,EACA,OAAA,EAAS,YAAA;AAAA,EACT;AACF,CAAA,EAAqD;AACnD,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,CAAA,GAAI,SAAY,YAAY,CAAA;AAChE,EAAA,MAAM,W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IAAA,OAAO,MAAM,GAAA,CAAI,mBAAA,CAAoB,QAAA,EAAU,QAAQ,CAAA;AAAA,EACzD,CAAA,EAAG,CAAC,KAAK,CAAC,CAAA;AAEV,EAAA,OAAO,OAAA;AACT","file":"chunk-AOHZGL6F.js","sourcesContent":["export { useId } from './useId';\nexport { useControlled } from './useControlled';\nexport { useDisclosure, type DisclosureControls } from './useDisclosure';\nexport { useEventListener } from './useEventListener';\nexport { useOutsideClick } from './useOutsideClick';\nexport { useEscape } from './useEscape';\nexport { useFocusTrap } from './useFocusTrap';\nexport { useScrollLock } from './useScrollLock';\nexport { useResizeObserver } from './useResizeObserver';\nexport { useMediaQuery } from './useMediaQuery';\n","import { useCallback, useRef, useState } from 'react';\n\ninterface UseControlledOptions<T> {\n controlled: T | undefined;\n default: T;\n onChange?: (value: T) => void;\n}\n\n/**\n * Standard controlled/uncontrolled pattern.\n *\n * - If `controlled` is defined, the component is controlled — internal state is\n * ignored, `setValue` only fires `onChange`.\n * - Otherwise the component owns its state, `setValue` updates it, and `onChange`\n * still fires for consumers that want to observe changes.\n */\nexport function useControlled<T>({\n controlled,\n default: defaultValue,\n onChange,\n}: UseControlledOptions<T>): [T, (value: T) => void] {\n const [uncontrolled, setUncontrolled] = useState<T>(defaultValue);\n const onChangeRef = useRef(onChange);\n onChangeRef.current = onChange;\n\n const isControlled = controlled !== undefined;\n const value = isControlled ? controlled : uncontrolled;\n\n const setValue = useCallback(\n (next: T) => {\n if (!isControlled) setUncontrolled(next);\n onChangeRef.current?.(next);\n },\n [isControlled],\n );\n\n return [value, setValue];\n}\n","import { useCallback, useState } from 'react';\n\nexport interface DisclosureControls {\n isOpen: boolean;\n open: () => void;\n close: () => void;\n toggle: () => void;\n setOpen: (next: boolean) => void;\n}\n\n/**\n * Minimal open/close state with stable callbacks. The standard backbone for\n * Modal, Drawer, Popover, Menu, Accordion, etc. Use `useControlled` underneath\n * when the consumer may also pass a controlled `open` prop.\n */\nexport function useDisclosure(initial = false): DisclosureControls {\n const [isOpen, setIsOpen] = useState(initial);\n const open = useCallback(() => setIsOpen(true), []);\n const close = useCallback(() => setIsOpen(false), []);\n const toggle = useCallback(() => setIsOpen((o) => !o), []);\n return { isOpen, open, close, toggle, setOpen: setIsOpen };\n}\n","import { useEffect, useLayoutEffect, useRef } from 'react';\n\ntype Target = Window | Document | HTMLElement | null;\n\n/**\n * Add an event listener and clean it up automatically. Handler is read from\n * a ref so consumers don't need to memoize it.\n */\nexport function useEventListener<K extends string>(\n event: K,\n handler: (event: Event) => void,\n target: Target = document,\n options?: boolean | AddEventListenerOptions,\n): void {\n const handlerRef = useRef(handler);\n useLayoutEffect(() => {\n handlerRef.current = handler;\n }, [handler]);\n\n useEffect(() => {\n if (!target) return;\n const listener = (e: Event) => handlerRef.current(e);\n target.addEventListener(event, listener, options);\n return () => target.removeEventListener(event, listener, options);\n }, [event, target, options]);\n}\n","import { useEffect, useRef, type RefObject } from 'react';\n\n/**\n * Fire `handler` when the user clicks outside any of the provided refs.\n * Uses `pointerdown` so it fires before focus shifts (avoids losing focus\n * inside an overlay before a click on a trigger registers).\n */\nexport function useOutsideClick(\n refs: RefObject<HTMLElement | null> | RefObject<HTMLElement | null>[],\n handler: (event: PointerEvent) => void,\n enabled = true,\n): void {\n const handlerRef = useRef(handler);\n handlerRef.current = handler;\n\n useEffect(() => {\n if (!enabled) return;\n const refList = Array.isArray(refs) ? refs : [refs];\n\n const onPointerDown = (e: PointerEvent) => {\n const target = e.target as Node | null;\n if (!target) return;\n for (const ref of refList) {\n if (ref.current && ref.current.contains(target)) return;\n }\n handlerRef.current(e);\n };\n\n document.addEventListener('pointerdown', onPointerDown, true);\n return () => document.removeEventListener('pointerdown', onPointerDown, true);\n }, [refs, enabled]);\n}\n","import { useEffect, useRef } from 'react';\n\n/**\n * Fire `handler` when the Escape key is pressed at the document level.\n * For nested overlays, the topmost should call `event.stopPropagation()` in\n * its handler — `DismissableLayer` handles this stack-style.\n */\nexport function useEscape(handler: (event: KeyboardEvent) => void, enabled = true): void {\n const handlerRef = useRef(handler);\n handlerRef.current = handler;\n\n useEffect(() => {\n if (!enabled) return;\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape') handlerRef.current(e);\n };\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [enabled]);\n}\n","import { useEffect, type RefObject } from 'react';\n\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n '[contenteditable=\"true\"]',\n].join(',');\n\nfunction getFocusable(container: HTMLElement): HTMLElement[] {\n return Array.from(container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)).filter(\n (el) => !el.hasAttribute('aria-hidden') && el.offsetParent !== null,\n );\n}\n\n/**\n * Trap Tab / Shift+Tab focus inside the referenced element. On mount, focuses\n * the first focusable child (unless already focused inside). On unmount,\n * returns focus to the element that had it before mounting.\n *\n * For richer behavior (sentinels, nested traps), wrap `FocusScope` instead —\n * this hook is the lower primitive.\n */\nexport function useFocusTrap(ref: RefObject<HTMLElement | null>, enabled = true): void {\n useEffect(() => {\n if (!enabled || !ref.current) return;\n const container = ref.current;\n const previouslyFocused = document.activeElement as HTMLElement | null;\n\n const focusables = getFocusable(container);\n if (focusables.length > 0 && !container.contains(document.activeElement)) {\n focusables[0]?.focus();\n } else if (focusables.length === 0) {\n container.tabIndex = -1;\n container.focus();\n }\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (e.key !== 'Tab') return;\n const items = getFocusable(container);\n if (items.length === 0) {\n e.preventDefault();\n return;\n }\n const first = items[0];\n const last = items[items.length - 1];\n if (!first || !last) return;\n const active = document.activeElement;\n if (e.shiftKey && active === first) {\n e.preventDefault();\n last.focus();\n } else if (!e.shiftKey && active === last) {\n e.preventDefault();\n first.focus();\n }\n };\n\n container.addEventListener('keydown', onKeyDown);\n return () => {\n container.removeEventListener('keydown', onKeyDown);\n previouslyFocused?.focus?.();\n };\n }, [ref, enabled]);\n}\n","import { useEffect, useRef, type RefObject } from 'react';\n\n/**\n * Run `callback` whenever the referenced element's size changes. Returns\n * synchronously after layout, before paint. Cleans up automatically.\n */\nexport function useResizeObserver<T extends HTMLElement>(\n ref: RefObject<T | null>,\n callback: (entry: ResizeObserverEntry) => void,\n enabled = true,\n): void {\n const callbackRef = useRef(callback);\n callbackRef.current = callback;\n\n useEffect(() => {\n if (!enabled || !ref.current || typeof ResizeObserver === 'undefined') return;\n const element = ref.current;\n const observer = new ResizeObserver((entries) => {\n const entry = entries[0];\n if (entry) callbackRef.current(entry);\n });\n observer.observe(element);\n return () => observer.disconnect();\n }, [ref, enabled]);\n}\n","import { useEffect, useState } from 'react';\n\n/**\n * Reactively follow a CSS media query. Pass a query string like\n * `'(min-width: 768px)'` or `'(prefers-reduced-motion: reduce)'`.\n */\nexport function useMediaQuery(query: string): boolean {\n const [matches, setMatches] = useState(() => window.matchMedia(query).matches);\n\n useEffect(() => {\n const mql = window.matchMedia(query);\n setMatches(mql.matches);\n const onChange = (e: MediaQueryListEvent) => setMatches(e.matches);\n mql.addEventListener('change', onChange);\n return () => mql.removeEventListener('change', onChange);\n }, [query]);\n\n return matches;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/useId.ts","../src/hooks/useScrollLock.ts"],"names":["useReactId"],"mappings":";;;AAMO,SAAS,MAAM,MAAA,EAAyB;AAC7C,EAAA,MAAM,KAAKA,OAAA,EAAW;AACtB,EAAA,OAAO,MAAA,GAAS,CAAA,EAAG,EAAE,CAAA,CAAA,EAAI,MAAM,CAAA,CAAA,GAAK,EAAA;AACtC;ACPA,IAAI,SAAA,GAAY,CAAA;AAChB,IAAI,gBAAA,GAAkC,IAAA;AACtC,IAAI,oBAAA,GAAsC,IAAA;AAE1C,SAAS,iBAAA,GAA4B;AACnC,EAAA,OAAO,MAAA,CAAO,UAAA,GAAa,QAAA,CAAS,eAAA,CAAgB,WAAA;AACtD;AAOO,SAAS,aAAA,CAAc,UAAU,IAAA,EAAY;AAClD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,OAAA,EAAS;AACd,IAAA,IAAI,cAAc,CAAA,EAAG;AACnB,MAAA,MAAM,OAAO,QAAA,CAAS,IAAA;AACtB,MAAA,MAAM,iBAAiB,iBAAA,EAAkB;AACzC,MAAA,gBAAA,GAAmB,KAAK,KAAA,CAAM,QAAA;AAC9B,MAAA,oBAAA,GAAuB,KAAK,KAAA,CAAM,YAAA;AAClC,MAAA,IAAA,CAAK,MAAM,QAAA,GAAW,QAAA;AACtB,MAAA,IAAI,iBAAiB,CAAA,EAAG;AACtB,QAAA,IAAA,CAAK,KAAA,CAAM,YAAA,GAAe,CAAA,EAAG,cAAc,CAAA,EAAA,CAAA;AAAA,MAC7C;AAAA,IACF;AACA,IAAA,SAAA,IAAa,CAAA;AAEb,IAAA,OAAO,MAAM;AACX,MAAA,SAAA,IAAa,CAAA;AACb,MAAA,IAAI,cAAc,CAAA,EAAG;AACnB,QAAA,MAAM,OAAO,QAAA,CAAS,IAAA;AACtB,QAAA,IAAA,CAAK,KAAA,CAAM,WAAW,gBAAA,IAAoB,EAAA;AAC1C,QAAA,IAAA,CAAK,KAAA,CAAM,eAAe,oBAAA,IAAwB,EAAA;AAClD,QAAA,gBAAA,GAAmB,IAAA;AACnB,QAAA,oBAAA,GAAuB,IAAA;AAAA,MACzB;AAAA,IACF,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,OAAO,CAAC,CAAA;AACd","file":"chunk-KDXJQNB6.js","sourcesContent":["import { useId as useReactId } from 'react';\n\n/**\n * Wraps React 19's `useId`. Optionally accepts a stable prefix so generated\n * IDs are easier to spot in DevTools (e.g. `useId('checkbox')` → `:r2:-checkbox`).\n */\nexport function useId(prefix?: string): string {\n const id = useReactId();\n return prefix ? `${id}-${prefix}` : id;\n}\n","import { useEffect } from 'react';\n\nlet lockCount = 0;\nlet originalOverflow: string | null = null;\nlet originalPaddingRight: string | null = null;\n\nfunction getScrollbarWidth(): number {\n return window.innerWidth - document.documentElement.clientWidth;\n}\n\n/**\n * Prevent body scroll while at least one consumer has the lock active.\n * Internally counted — multiple overlays may lock; only the last unlock restores.\n * Compensates for scrollbar width to avoid layout shift.\n */\nexport function useScrollLock(enabled = true): void {\n useEffect(() => {\n if (!enabled) return;\n if (lockCount === 0) {\n const body = document.body;\n const scrollbarWidth = getScrollbarWidth();\n originalOverflow = body.style.overflow;\n originalPaddingRight = body.style.paddingRight;\n body.style.overflow = 'hidden';\n if (scrollbarWidth > 0) {\n body.style.paddingRight = `${scrollbarWidth}px`;\n }\n }\n lockCount += 1;\n\n return () => {\n lockCount -= 1;\n if (lockCount === 0) {\n const body = document.body;\n body.style.overflow = originalOverflow ?? '';\n body.style.paddingRight = originalPaddingRight ?? '';\n originalOverflow = null;\n originalPaddingRight = null;\n }\n };\n }, [enabled]);\n}\n"]}
|