@ngrok/mantle 0.78.0 → 0.79.1

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 (54) hide show
  1. package/dist/agent.json +1 -1
  2. package/dist/alert-dialog.d.ts +85 -46
  3. package/dist/alert-dialog.js +1 -1
  4. package/dist/alert.d.ts +24 -16
  5. package/dist/alert.js +1 -1
  6. package/dist/button-ClC60Nzg.js +1 -0
  7. package/dist/{button-Bw9MpShl.d.ts → button-DcXOWUYo.d.ts} +49 -7
  8. package/dist/button.d.ts +6 -5
  9. package/dist/button.js +1 -1
  10. package/dist/calendar.js +1 -1
  11. package/dist/centered-layout.d.ts +17 -5
  12. package/dist/code-block.js +1 -1
  13. package/dist/command.d.ts +12 -12
  14. package/dist/command.js +1 -1
  15. package/dist/data-table.d.ts +36 -10
  16. package/dist/data-table.js +1 -1
  17. package/dist/{dialog-DVDFVT_-.js → dialog-ZCgG41hx.js} +1 -1
  18. package/dist/dialog.d.ts +72 -54
  19. package/dist/dialog.js +1 -1
  20. package/dist/dropdown-menu-Bt1aKF1g.js +1 -0
  21. package/dist/{dropdown-menu-DT30TQzL.d.ts → dropdown-menu-DP_Ne9Mr.d.ts} +7 -4
  22. package/dist/dropdown-menu.d.ts +2 -2
  23. package/dist/dropdown-menu.js +1 -1
  24. package/dist/empty.d.ts +12 -12
  25. package/dist/field.d.ts +19 -2
  26. package/dist/field.js +1 -1
  27. package/dist/hover-card.d.ts +9 -7
  28. package/dist/{icon-button-DuRSCsPh.d.ts → icon-button-B7uEj1qq.d.ts} +68 -5
  29. package/dist/icon-button-DV2-GZHf.js +1 -0
  30. package/dist/{index-CDwfBOAA.d.ts → index-BivvYYs-.d.ts} +5 -5
  31. package/dist/index-g2rfwNCH.d.ts +1 -0
  32. package/dist/intents-DdSKSj1c.d.ts +28 -0
  33. package/dist/llms.txt +1 -1
  34. package/dist/pagination.d.ts +1 -1
  35. package/dist/pagination.js +1 -1
  36. package/dist/popover.d.ts +11 -11
  37. package/dist/{primitive-wm7Wk-gy.js → primitive-M-kZdNIS.js} +1 -1
  38. package/dist/sheet.d.ts +81 -52
  39. package/dist/sheet.js +1 -1
  40. package/dist/{sizes-Dje_rwKc.d.ts → sizes-BCoI4bhP.d.ts} +2 -2
  41. package/dist/split-button.d.ts +8 -7
  42. package/dist/split-button.js +1 -1
  43. package/dist/theme-switcher.d.ts +150 -21
  44. package/dist/theme-switcher.js +1 -1
  45. package/dist/toast-D3ntBmn4.js +1 -0
  46. package/dist/toast.d.ts +19 -13
  47. package/dist/toast.js +1 -1
  48. package/dist/tooltip.d.ts +6 -6
  49. package/package.json +1 -1
  50. package/dist/button-AS5Ir3DE.js +0 -1
  51. package/dist/dropdown-menu-ByUQkAvJ.js +0 -1
  52. package/dist/icon-button-CxVsZ2N1.js +0 -1
  53. package/dist/index-BnI3OppC.d.ts +0 -1
  54. package/dist/toast-RkhbliFh.js +0 -1
package/dist/dialog.d.ts CHANGED
@@ -1,5 +1,6 @@
1
+ import { t as ButtonIntent } from "./intents-DdSKSj1c.js";
1
2
  import { n as isDialogOverlayTarget, t as Root } from "./primitive-C64-m48O.js";
2
- import { n as IconButtonProps } from "./icon-button-DuRSCsPh.js";
3
+ import { n as IconButtonAppearance, r as IconButtonProps } from "./icon-button-B7uEj1qq.js";
3
4
  import { ComponentProps } from "react";
4
5
  //#region src/components/dialog/dialog.d.ts
5
6
  /**
@@ -11,7 +12,7 @@ import { ComponentProps } from "react";
11
12
  * ```tsx
12
13
  * <Dialog.Root>
13
14
  * <Dialog.Trigger asChild>
14
- * <Button type="button" appearance="outlined">Open Dialog</Button>
15
+ * <Button type="button" appearance="filled" intent="neutral">Open Dialog</Button>
15
16
  * </Dialog.Trigger>
16
17
  * <Dialog.Content>
17
18
  * <Dialog.Header>
@@ -24,9 +25,9 @@ import { ComponentProps } from "react";
24
25
  * </Dialog.Body>
25
26
  * <Dialog.Footer>
26
27
  * <Dialog.Close asChild>
27
- * <Button type="button" appearance="outlined">Cancel</Button>
28
+ * <Button type="button" appearance="outlined" intent="neutral">Cancel</Button>
28
29
  * </Dialog.Close>
29
- * <Button type="button" appearance="filled">Save</Button>
30
+ * <Button type="button" appearance="filled" intent="neutral">Save</Button>
30
31
  * </Dialog.Footer>
31
32
  * </Dialog.Content>
32
33
  * </Dialog.Root>
@@ -36,7 +37,24 @@ declare const Header: {
36
37
  ({ className, children, ...props }: ComponentProps<"div">): import("react").JSX.Element;
37
38
  displayName: string;
38
39
  };
39
- type CloseIconButtonProps = Partial<Omit<IconButtonProps, "icon">>;
40
+ type CloseIconButtonProps = Partial<Omit<IconButtonProps, "appearance" | "icon" | "intent">> & {
41
+ /**
42
+ * The visual style of the close icon button. Optional here —
43
+ * `Dialog.CloseIconButton` defaults to `"ghost"` so the close affordance
44
+ * stays visually quiet in the dialog header.
45
+ *
46
+ * @default "ghost"
47
+ */
48
+ appearance?: IconButtonAppearance;
49
+ /**
50
+ * The tone of the close icon button. Optional here —
51
+ * `Dialog.CloseIconButton` defaults to `"neutral"`, the workhorse tone for
52
+ * routine actions like dismissing a dialog.
53
+ *
54
+ * @default "neutral"
55
+ */
56
+ intent?: ButtonIntent;
57
+ };
40
58
  /**
41
59
  * An icon button that closes the dialog when clicked.
42
60
  *
@@ -46,7 +64,7 @@ type CloseIconButtonProps = Partial<Omit<IconButtonProps, "icon">>;
46
64
  * ```tsx
47
65
  * <Dialog.Root>
48
66
  * <Dialog.Trigger asChild>
49
- * <Button type="button" appearance="outlined">Open Dialog</Button>
67
+ * <Button type="button" appearance="filled" intent="neutral">Open Dialog</Button>
50
68
  * </Dialog.Trigger>
51
69
  * <Dialog.Content>
52
70
  * <Dialog.Header>
@@ -59,16 +77,16 @@ type CloseIconButtonProps = Partial<Omit<IconButtonProps, "icon">>;
59
77
  * </Dialog.Body>
60
78
  * <Dialog.Footer>
61
79
  * <Dialog.Close asChild>
62
- * <Button type="button" appearance="outlined">Cancel</Button>
80
+ * <Button type="button" appearance="outlined" intent="neutral">Cancel</Button>
63
81
  * </Dialog.Close>
64
- * <Button type="button" appearance="filled">Save</Button>
82
+ * <Button type="button" appearance="filled" intent="neutral">Save</Button>
65
83
  * </Dialog.Footer>
66
84
  * </Dialog.Content>
67
85
  * </Dialog.Root>
68
86
  * ```
69
87
  */
70
88
  declare const CloseIconButton: {
71
- ({ size, type, label, appearance, ...props }: CloseIconButtonProps): import("react").JSX.Element;
89
+ ({ size, type, label, appearance, intent, ...props }: CloseIconButtonProps): import("react").JSX.Element;
72
90
  displayName: string;
73
91
  };
74
92
  /**
@@ -80,7 +98,7 @@ declare const CloseIconButton: {
80
98
  * ```tsx
81
99
  * <Dialog.Root>
82
100
  * <Dialog.Trigger asChild>
83
- * <Button type="button" appearance="outlined">Open Dialog</Button>
101
+ * <Button type="button" appearance="filled" intent="neutral">Open Dialog</Button>
84
102
  * </Dialog.Trigger>
85
103
  * <Dialog.Content>
86
104
  * <Dialog.Header>
@@ -93,9 +111,9 @@ declare const CloseIconButton: {
93
111
  * </Dialog.Body>
94
112
  * <Dialog.Footer>
95
113
  * <Dialog.Close asChild>
96
- * <Button type="button" appearance="outlined">Cancel</Button>
114
+ * <Button type="button" appearance="outlined" intent="neutral">Cancel</Button>
97
115
  * </Dialog.Close>
98
- * <Button type="button" appearance="filled">Save</Button>
116
+ * <Button type="button" appearance="filled" intent="neutral">Save</Button>
99
117
  * </Dialog.Footer>
100
118
  * </Dialog.Content>
101
119
  * </Dialog.Root>
@@ -114,7 +132,7 @@ declare const Body: {
114
132
  * ```tsx
115
133
  * <Dialog.Root>
116
134
  * <Dialog.Trigger asChild>
117
- * <Button type="button" appearance="outlined">Open Dialog</Button>
135
+ * <Button type="button" appearance="filled" intent="neutral">Open Dialog</Button>
118
136
  * </Dialog.Trigger>
119
137
  * <Dialog.Content>
120
138
  * <Dialog.Header>
@@ -127,9 +145,9 @@ declare const Body: {
127
145
  * </Dialog.Body>
128
146
  * <Dialog.Footer>
129
147
  * <Dialog.Close asChild>
130
- * <Button type="button" appearance="outlined">Cancel</Button>
148
+ * <Button type="button" appearance="outlined" intent="neutral">Cancel</Button>
131
149
  * </Dialog.Close>
132
- * <Button type="button" appearance="filled">Save</Button>
150
+ * <Button type="button" appearance="filled" intent="neutral">Save</Button>
133
151
  * </Dialog.Footer>
134
152
  * </Dialog.Content>
135
153
  * </Dialog.Root>
@@ -172,7 +190,7 @@ declare const Footer: {
172
190
  * ```tsx
173
191
  * <Dialog.Root>
174
192
  * <Dialog.Trigger asChild>
175
- * <Button type="button" appearance="outlined">Open Dialog</Button>
193
+ * <Button type="button" appearance="filled" intent="neutral">Open Dialog</Button>
176
194
  * </Dialog.Trigger>
177
195
  * <Dialog.Content>
178
196
  * <Dialog.Header>
@@ -185,9 +203,9 @@ declare const Footer: {
185
203
  * </Dialog.Body>
186
204
  * <Dialog.Footer>
187
205
  * <Dialog.Close asChild>
188
- * <Button type="button" appearance="outlined">Cancel</Button>
206
+ * <Button type="button" appearance="outlined" intent="neutral">Cancel</Button>
189
207
  * </Dialog.Close>
190
- * <Button type="button" appearance="filled">Save</Button>
208
+ * <Button type="button" appearance="filled" intent="neutral">Save</Button>
191
209
  * </Dialog.Footer>
192
210
  * </Dialog.Content>
193
211
  * </Dialog.Root>
@@ -208,7 +226,7 @@ declare const Dialog: {
208
226
  * ```tsx
209
227
  * <Dialog.Root>
210
228
  * <Dialog.Trigger asChild>
211
- * <Button type="button" appearance="outlined">Open Dialog</Button>
229
+ * <Button type="button" appearance="filled" intent="neutral">Open Dialog</Button>
212
230
  * </Dialog.Trigger>
213
231
  * <Dialog.Content>
214
232
  * <Dialog.Header>
@@ -221,9 +239,9 @@ declare const Dialog: {
221
239
  * </Dialog.Body>
222
240
  * <Dialog.Footer>
223
241
  * <Dialog.Close asChild>
224
- * <Button type="button" appearance="outlined">Cancel</Button>
242
+ * <Button type="button" appearance="outlined" intent="neutral">Cancel</Button>
225
243
  * </Dialog.Close>
226
- * <Button type="button" appearance="filled">Save</Button>
244
+ * <Button type="button" appearance="filled" intent="neutral">Save</Button>
227
245
  * </Dialog.Footer>
228
246
  * </Dialog.Content>
229
247
  * </Dialog.Root>
@@ -239,7 +257,7 @@ declare const Dialog: {
239
257
  * ```tsx
240
258
  * <Dialog.Root>
241
259
  * <Dialog.Trigger asChild>
242
- * <Button type="button" appearance="outlined">Open Dialog</Button>
260
+ * <Button type="button" appearance="filled" intent="neutral">Open Dialog</Button>
243
261
  * </Dialog.Trigger>
244
262
  * <Dialog.Content>
245
263
  * <Dialog.Header>
@@ -252,9 +270,9 @@ declare const Dialog: {
252
270
  * </Dialog.Body>
253
271
  * <Dialog.Footer>
254
272
  * <Dialog.Close asChild>
255
- * <Button type="button" appearance="outlined">Cancel</Button>
273
+ * <Button type="button" appearance="outlined" intent="neutral">Cancel</Button>
256
274
  * </Dialog.Close>
257
- * <Button type="button" appearance="filled">Save</Button>
275
+ * <Button type="button" appearance="filled" intent="neutral">Save</Button>
258
276
  * </Dialog.Footer>
259
277
  * </Dialog.Content>
260
278
  * </Dialog.Root>
@@ -270,7 +288,7 @@ declare const Dialog: {
270
288
  * ```tsx
271
289
  * <Dialog.Root>
272
290
  * <Dialog.Trigger asChild>
273
- * <Button type="button" appearance="outlined">Open Dialog</Button>
291
+ * <Button type="button" appearance="filled" intent="neutral">Open Dialog</Button>
274
292
  * </Dialog.Trigger>
275
293
  * <Dialog.Content>
276
294
  * <Dialog.Header>
@@ -283,9 +301,9 @@ declare const Dialog: {
283
301
  * </Dialog.Body>
284
302
  * <Dialog.Footer>
285
303
  * <Dialog.Close asChild>
286
- * <Button type="button" appearance="outlined">Cancel</Button>
304
+ * <Button type="button" appearance="outlined" intent="neutral">Cancel</Button>
287
305
  * </Dialog.Close>
288
- * <Button type="button" appearance="filled">Save</Button>
306
+ * <Button type="button" appearance="filled" intent="neutral">Save</Button>
289
307
  * </Dialog.Footer>
290
308
  * </Dialog.Content>
291
309
  * </Dialog.Root>
@@ -301,7 +319,7 @@ declare const Dialog: {
301
319
  * ```tsx
302
320
  * <Dialog.Root>
303
321
  * <Dialog.Trigger asChild>
304
- * <Button type="button" appearance="outlined">Open Dialog</Button>
322
+ * <Button type="button" appearance="filled" intent="neutral">Open Dialog</Button>
305
323
  * </Dialog.Trigger>
306
324
  * <Dialog.Content>
307
325
  * <Dialog.Header>
@@ -314,9 +332,9 @@ declare const Dialog: {
314
332
  * </Dialog.Body>
315
333
  * <Dialog.Footer>
316
334
  * <Dialog.Close asChild>
317
- * <Button type="button" appearance="outlined">Cancel</Button>
335
+ * <Button type="button" appearance="outlined" intent="neutral">Cancel</Button>
318
336
  * </Dialog.Close>
319
- * <Button type="button" appearance="filled">Save</Button>
337
+ * <Button type="button" appearance="filled" intent="neutral">Save</Button>
320
338
  * </Dialog.Footer>
321
339
  * </Dialog.Content>
322
340
  * </Dialog.Root>
@@ -337,7 +355,7 @@ declare const Dialog: {
337
355
  * ```tsx
338
356
  * <Dialog.Root>
339
357
  * <Dialog.Trigger asChild>
340
- * <Button type="button" appearance="outlined">Open Dialog</Button>
358
+ * <Button type="button" appearance="filled" intent="neutral">Open Dialog</Button>
341
359
  * </Dialog.Trigger>
342
360
  * <Dialog.Content>
343
361
  * <Dialog.Header>
@@ -350,9 +368,9 @@ declare const Dialog: {
350
368
  * </Dialog.Body>
351
369
  * <Dialog.Footer>
352
370
  * <Dialog.Close asChild>
353
- * <Button type="button" appearance="outlined">Cancel</Button>
371
+ * <Button type="button" appearance="outlined" intent="neutral">Cancel</Button>
354
372
  * </Dialog.Close>
355
- * <Button type="button" appearance="filled">Save</Button>
373
+ * <Button type="button" appearance="filled" intent="neutral">Save</Button>
356
374
  * </Dialog.Footer>
357
375
  * </Dialog.Content>
358
376
  * </Dialog.Root>
@@ -378,7 +396,7 @@ declare const Dialog: {
378
396
  * ```tsx
379
397
  * <Dialog.Root>
380
398
  * <Dialog.Trigger asChild>
381
- * <Button type="button" appearance="outlined">Open Dialog</Button>
399
+ * <Button type="button" appearance="filled" intent="neutral">Open Dialog</Button>
382
400
  * </Dialog.Trigger>
383
401
  * <Dialog.Content>
384
402
  * <Dialog.Header>
@@ -391,9 +409,9 @@ declare const Dialog: {
391
409
  * </Dialog.Body>
392
410
  * <Dialog.Footer>
393
411
  * <Dialog.Close asChild>
394
- * <Button type="button" appearance="outlined">Cancel</Button>
412
+ * <Button type="button" appearance="outlined" intent="neutral">Cancel</Button>
395
413
  * </Dialog.Close>
396
- * <Button type="button" appearance="filled">Save</Button>
414
+ * <Button type="button" appearance="filled" intent="neutral">Save</Button>
397
415
  * </Dialog.Footer>
398
416
  * </Dialog.Content>
399
417
  * </Dialog.Root>
@@ -409,7 +427,7 @@ declare const Dialog: {
409
427
  * ```tsx
410
428
  * <Dialog.Root>
411
429
  * <Dialog.Trigger asChild>
412
- * <Button type="button" appearance="outlined">Open Dialog</Button>
430
+ * <Button type="button" appearance="filled" intent="neutral">Open Dialog</Button>
413
431
  * </Dialog.Trigger>
414
432
  * <Dialog.Content>
415
433
  * <Dialog.Header>
@@ -422,9 +440,9 @@ declare const Dialog: {
422
440
  * </Dialog.Body>
423
441
  * <Dialog.Footer>
424
442
  * <Dialog.Close asChild>
425
- * <Button type="button" appearance="outlined">Cancel</Button>
443
+ * <Button type="button" appearance="outlined" intent="neutral">Cancel</Button>
426
444
  * </Dialog.Close>
427
- * <Button type="button" appearance="filled">Save</Button>
445
+ * <Button type="button" appearance="filled" intent="neutral">Save</Button>
428
446
  * </Dialog.Footer>
429
447
  * </Dialog.Content>
430
448
  * </Dialog.Root>
@@ -440,7 +458,7 @@ declare const Dialog: {
440
458
  * ```tsx
441
459
  * <Dialog.Root>
442
460
  * <Dialog.Trigger asChild>
443
- * <Button type="button" appearance="outlined">Open Dialog</Button>
461
+ * <Button type="button" appearance="filled" intent="neutral">Open Dialog</Button>
444
462
  * </Dialog.Trigger>
445
463
  * <Dialog.Content>
446
464
  * <Dialog.Header>
@@ -453,9 +471,9 @@ declare const Dialog: {
453
471
  * </Dialog.Body>
454
472
  * <Dialog.Footer>
455
473
  * <Dialog.Close asChild>
456
- * <Button type="button" appearance="outlined">Cancel</Button>
474
+ * <Button type="button" appearance="outlined" intent="neutral">Cancel</Button>
457
475
  * </Dialog.Close>
458
- * <Button type="button" appearance="filled">Save</Button>
476
+ * <Button type="button" appearance="filled" intent="neutral">Save</Button>
459
477
  * </Dialog.Footer>
460
478
  * </Dialog.Content>
461
479
  * </Dialog.Root>
@@ -471,7 +489,7 @@ declare const Dialog: {
471
489
  * ```tsx
472
490
  * <Dialog.Root>
473
491
  * <Dialog.Trigger asChild>
474
- * <Button type="button" appearance="outlined">Open Dialog</Button>
492
+ * <Button type="button" appearance="filled" intent="neutral">Open Dialog</Button>
475
493
  * </Dialog.Trigger>
476
494
  * <Dialog.Portal>
477
495
  * <Dialog.Overlay />
@@ -486,9 +504,9 @@ declare const Dialog: {
486
504
  * </Dialog.Body>
487
505
  * <Dialog.Footer>
488
506
  * <Dialog.Close asChild>
489
- * <Button type="button" appearance="outlined">Cancel</Button>
507
+ * <Button type="button" appearance="outlined" intent="neutral">Cancel</Button>
490
508
  * </Dialog.Close>
491
- * <Button type="button" appearance="filled">Save</Button>
509
+ * <Button type="button" appearance="filled" intent="neutral">Save</Button>
492
510
  * </Dialog.Footer>
493
511
  * </Dialog.Content>
494
512
  * </Dialog.Portal>
@@ -505,7 +523,7 @@ declare const Dialog: {
505
523
  * ```tsx
506
524
  * <Dialog.Root>
507
525
  * <Dialog.Trigger asChild>
508
- * <Button type="button" appearance="outlined">Open Dialog</Button>
526
+ * <Button type="button" appearance="filled" intent="neutral">Open Dialog</Button>
509
527
  * </Dialog.Trigger>
510
528
  * <Dialog.Portal>
511
529
  * <Dialog.Overlay />
@@ -520,9 +538,9 @@ declare const Dialog: {
520
538
  * </Dialog.Body>
521
539
  * <Dialog.Footer>
522
540
  * <Dialog.Close asChild>
523
- * <Button type="button" appearance="outlined">Cancel</Button>
541
+ * <Button type="button" appearance="outlined" intent="neutral">Cancel</Button>
524
542
  * </Dialog.Close>
525
- * <Button type="button" appearance="filled">Save</Button>
543
+ * <Button type="button" appearance="filled" intent="neutral">Save</Button>
526
544
  * </Dialog.Footer>
527
545
  * </Dialog.Content>
528
546
  * </Dialog.Portal>
@@ -539,7 +557,7 @@ declare const Dialog: {
539
557
  * ```tsx
540
558
  * <Dialog.Root>
541
559
  * <Dialog.Trigger asChild>
542
- * <Button type="button" appearance="outlined">Open Dialog</Button>
560
+ * <Button type="button" appearance="filled" intent="neutral">Open Dialog</Button>
543
561
  * </Dialog.Trigger>
544
562
  * <Dialog.Content>
545
563
  * <Dialog.Header>
@@ -552,9 +570,9 @@ declare const Dialog: {
552
570
  * </Dialog.Body>
553
571
  * <Dialog.Footer>
554
572
  * <Dialog.Close asChild>
555
- * <Button type="button" appearance="outlined">Cancel</Button>
573
+ * <Button type="button" appearance="outlined" intent="neutral">Cancel</Button>
556
574
  * </Dialog.Close>
557
- * <Button type="button" appearance="filled">Save</Button>
575
+ * <Button type="button" appearance="filled" intent="neutral">Save</Button>
558
576
  * </Dialog.Footer>
559
577
  * </Dialog.Content>
560
578
  * </Dialog.Root>
@@ -570,7 +588,7 @@ declare const Dialog: {
570
588
  * ```tsx
571
589
  * <Dialog.Root>
572
590
  * <Dialog.Trigger asChild>
573
- * <Button type="button" appearance="outlined">Open Dialog</Button>
591
+ * <Button type="button" appearance="filled" intent="neutral">Open Dialog</Button>
574
592
  * </Dialog.Trigger>
575
593
  * <Dialog.Content>
576
594
  * <Dialog.Header>
@@ -583,9 +601,9 @@ declare const Dialog: {
583
601
  * </Dialog.Body>
584
602
  * <Dialog.Footer>
585
603
  * <Dialog.Close asChild>
586
- * <Button type="button" appearance="outlined">Cancel</Button>
604
+ * <Button type="button" appearance="outlined" intent="neutral">Cancel</Button>
587
605
  * </Dialog.Close>
588
- * <Button type="button" appearance="filled">Save</Button>
606
+ * <Button type="button" appearance="filled" intent="neutral">Save</Button>
589
607
  * </Dialog.Footer>
590
608
  * </Dialog.Content>
591
609
  * </Dialog.Root>
package/dist/dialog.js CHANGED
@@ -1 +1 @@
1
- import{l as e}from"./primitive-wm7Wk-gy.js";import{t}from"./dialog-DVDFVT_-.js";export{t as Dialog,e as isDialogOverlayTarget};
1
+ import{l as e}from"./primitive-M-kZdNIS.js";import{t}from"./dialog-ZCgG41hx.js";export{t as Dialog,e as isDialogOverlayTarget};
@@ -0,0 +1 @@
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CDtYjF_H.js";import{n}from"./slot-DmPrjM7N.js";import{n as r}from"./separator-kBnnv3Cw.js";import{forwardRef as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{CaretRightIcon as s}from"@phosphor-icons/react/CaretRight";import{CheckIcon as c}from"@phosphor-icons/react/Check";import*as l from"@radix-ui/react-dropdown-menu";const u=l.Root;u.displayName=`DropdownMenu`;const d=i((e,t)=>a(l.Trigger,{ref:t,"data-slot":`dropdown-menu-trigger`,...e}));d.displayName=`DropdownMenuTrigger`;const f=i(({className:t,...n},r)=>a(l.Group,{ref:r,"data-slot":`dropdown-menu-group`,className:e(`space-y-px`,t),...n}));f.displayName=`DropdownMenuGroup`;const p=l.Portal;p.displayName=`DropdownMenuPortal`;const m=l.Sub;m.displayName=`DropdownMenuSub`;const h=i(({className:t,...n},r)=>a(l.RadioGroup,{ref:r,"data-slot":`dropdown-menu-radio-group`,className:e(`space-y-px`,t),...n}));h.displayName=`DropdownMenuRadioGroup`;const g=i(({className:n,inset:r,children:i,...c},u)=>o(l.SubTrigger,{"data-slot":`dropdown-menu-sub-trigger`,className:e(`focus:bg-accent data-state-open:bg-accent relative flex select-none items-center rounded-md py-1.5 pl-2 pr-9 text-sm outline-hidden`,`data-highlighted:bg-active-menu-item data-state-open:bg-active-menu-item`,`[&>svg]:size-5 [&_svg]:shrink-0`,r&&`pl-8`,n),ref:u,...c,children:[i,a(`span`,{className:`absolute right-2 flex items-center`,children:a(t,{svg:a(s,{weight:`bold`}),className:`size-4`})})]}));g.displayName=`DropdownMenuSubTrigger`;const _=i(({className:t,loop:n=!0,...r},i)=>a(p,{children:a(l.SubContent,{"data-slot":`dropdown-menu-sub-content`,className:e(`scrollbar`,`text-popover-foreground border-popover bg-popover p-1.25 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden rounded-md border shadow-xl space-y-px font-sans`,`my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)-16px)] overflow-auto`,t),loop:n,ref:i,...r})}));_.displayName=`DropdownMenuSubContent`;const v=i(({className:t,"data-slot":r,onClick:i,loop:o=!0,width:s,...c},u)=>a(p,{children:a(l.Content,{ref:u,"data-slot":n(r,`dropdown-menu-content`),className:e(`scrollbar`,`text-popover-foreground border-popover bg-popover p-1.25 z-50 min-w-32 overflow-hidden rounded-md border shadow-xl outline-hidden space-y-px font-sans`,`data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95`,`my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)-16px)] overflow-auto`,s===`trigger`&&`w-(--radix-dropdown-menu-trigger-width)`,t),loop:o,onClick:e=>{e.stopPropagation(),i?.(e)},...c})}));v.displayName=`DropdownMenuContent`;const y=i(({className:t,inset:n,...r},i)=>a(l.Item,{ref:i,"data-slot":`dropdown-menu-item`,className:e(`relative flex cursor-pointer select-none items-center rounded-md px-2 py-1.5 text-strong text-sm font-normal outline-hidden transition-colors`,`data-highlighted:bg-active-menu-item`,`focus:bg-accent focus:text-accent-foreground`,`data-disabled:cursor-default data-disabled:opacity-50`,`[&>svg]:size-5 [&_svg]:shrink-0`,n&&`pl-8`,t),...r}));y.displayName=`DropdownMenuItem`;const b=i(({className:n,children:r,checked:i,...s},u)=>o(l.CheckboxItem,{ref:u,"data-slot":`dropdown-menu-checkbox-item`,className:e(`text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded-md py-1.5 pl-2 pr-9 text-sm font-normal outline-hidden`,`data-highlighted:bg-active-menu-item`,`aria-checked:bg-selected-menu-item`,`data-highlighted:aria-checked:bg-active-selected-menu-item!`,`[&>svg]:size-5 [&_svg]:shrink-0`,n),checked:i,...s,children:[a(`span`,{className:`absolute right-2 flex items-center`,children:a(l.ItemIndicator,{children:a(t,{svg:a(c,{weight:`bold`}),className:`size-4 text-accent-600`})})}),r]}));b.displayName=`DropdownMenuCheckboxItem`;const x=i(({className:n,children:r,...i},s)=>o(l.RadioItem,{"data-slot":`dropdown-menu-radio-item`,className:e(`group/dropdown-menu-radio-item`,`text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded-md py-1.5 px-2 text-sm font-normal outline-none`,`data-highlighted:bg-active-menu-item`,`aria-checked:bg-selected-menu-item aria-checked:pr-9`,`data-highlighted:aria-checked:bg-active-selected-menu-item!`,`[&>svg]:size-5 [&_svg]:shrink-0`,n),ref:s,...i,children:[a(`span`,{className:`absolute right-2 items-center hidden group-aria-checked/dropdown-menu-radio-item:flex`,children:a(l.ItemIndicator,{children:a(t,{svg:a(c,{weight:`bold`}),className:`size-4 text-accent-600`})})}),r]}));x.displayName=`DropdownMenuRadioItem`;const S=i(({className:t,inset:n,...r},i)=>a(l.Label,{ref:i,"data-slot":`dropdown-menu-label`,className:e(`px-2 py-1.5 text-sm font-medium`,n&&`pl-8`,t),...r}));S.displayName=`DropdownMenuLabel`;const C=i(({className:t,...n},i)=>a(r,{ref:i,"data-slot":`dropdown-menu-separator`,className:e(`-mx-1.25 my-1 w-auto`,t),...n}));C.displayName=`DropdownMenuSeparator`;const w=({className:t,...n})=>a(`span`,{"data-slot":`dropdown-menu-shortcut`,className:e(`ml-auto text-xs tracking-widest opacity-60`,t),...n});w.displayName=`DropdownMenuShortcut`;const T={Root:u,CheckboxItem:b,Content:v,Group:f,Item:y,Label:S,RadioGroup:h,RadioItem:x,Separator:C,Shortcut:w,Sub:m,SubContent:_,SubTrigger:g,Trigger:d};export{T as t};
@@ -1,4 +1,5 @@
1
1
  import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
2
+ import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
2
3
  import { ComponentProps } from "react";
3
4
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
4
5
  //#region src/components/dropdown-menu/dropdown-menu.d.ts
@@ -38,7 +39,7 @@ declare const Shortcut: {
38
39
  * ```tsx
39
40
  * <DropdownMenu.Root>
40
41
  * <DropdownMenu.Trigger asChild>
41
- * <Button type="button" appearance="outlined">
42
+ * <Button type="button" appearance="outlined" intent="neutral">
42
43
  * Open Menu
43
44
  * </Button>
44
45
  * </DropdownMenu.Trigger>
@@ -63,7 +64,9 @@ declare const DropdownMenu: {
63
64
  * ```tsx
64
65
  * <DropdownMenu.Root>
65
66
  * <DropdownMenu.Trigger asChild>
66
- * <Button>Open Menu</Button>
67
+ * <Button type="button" appearance="outlined" intent="neutral">
68
+ * Open Menu
69
+ * </Button>
67
70
  * </DropdownMenu.Trigger>
68
71
  * <DropdownMenu.Content>
69
72
  * <DropdownMenu.Item>Item 1</DropdownMenu.Item>
@@ -110,7 +113,7 @@ declare const DropdownMenu: {
110
113
  * </DropdownMenu.Root>
111
114
  * ```
112
115
  */
113
- readonly Content: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
116
+ readonly Content: import("react").ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & WithDataSlot & {
114
117
  /**
115
118
  * Whether the DropdownMenuContent should match the width of the trigger or use the intrinsic content width.
116
119
  */
@@ -343,7 +346,7 @@ declare const DropdownMenu: {
343
346
  * ```tsx
344
347
  * <DropdownMenu.Root>
345
348
  * <DropdownMenu.Trigger asChild>
346
- * <Button type="button" appearance="outlined">
349
+ * <Button type="button" appearance="outlined" intent="neutral">
347
350
  * Open Menu
348
351
  * </Button>
349
352
  * </DropdownMenu.Trigger>
@@ -1,3 +1,3 @@
1
- import { t as DropdownMenu } from "./dropdown-menu-DT30TQzL.js";
2
- import "./index-BnI3OppC.js";
1
+ import { t as DropdownMenu } from "./dropdown-menu-DP_Ne9Mr.js";
2
+ import "./index-g2rfwNCH.js";
3
3
  export { DropdownMenu };
@@ -1 +1 @@
1
- import{t as e}from"./dropdown-menu-ByUQkAvJ.js";export{e as DropdownMenu};
1
+ import{t as e}from"./dropdown-menu-Bt1aKF1g.js";export{e as DropdownMenu};
package/dist/empty.d.ts CHANGED
@@ -15,7 +15,7 @@ import { ComponentProps, HTMLAttributes, ReactNode } from "react";
15
15
  * <Empty.Title>No results found</Empty.Title>
16
16
  * <Empty.Description>Try adjusting your search or filters.</Empty.Description>
17
17
  * <Empty.Actions>
18
- * <Button>Clear filters</Button>
18
+ * <Button appearance="outlined" intent="neutral">Clear filters</Button>
19
19
  * </Empty.Actions>
20
20
  * </Empty.Root>
21
21
  * ```
@@ -43,7 +43,7 @@ type EmptyIconProps = Omit<SvgAttributes, "children"> & {
43
43
  * <Empty.Title>No endpoints yet</Empty.Title>
44
44
  * <Empty.Description>Create your first endpoint to get started.</Empty.Description>
45
45
  * <Empty.Actions>
46
- * <Button>Create endpoint</Button>
46
+ * <Button appearance="filled" intent="neutral">Create endpoint</Button>
47
47
  * </Empty.Actions>
48
48
  * </Empty.Root>
49
49
  * ```
@@ -65,7 +65,7 @@ declare const Icon: {
65
65
  * <Empty.Title>No endpoints yet</Empty.Title>
66
66
  * <Empty.Description>Create your first endpoint to get started.</Empty.Description>
67
67
  * <Empty.Actions>
68
- * <Button>Create endpoint</Button>
68
+ * <Button appearance="filled" intent="neutral">Create endpoint</Button>
69
69
  * </Empty.Actions>
70
70
  * </Empty.Root>
71
71
  *
@@ -92,7 +92,7 @@ declare const Title: {
92
92
  * <Empty.Title>No endpoints yet</Empty.Title>
93
93
  * <Empty.Description>Create your first endpoint to get started.</Empty.Description>
94
94
  * <Empty.Actions>
95
- * <Button>Create endpoint</Button>
95
+ * <Button appearance="filled" intent="neutral">Create endpoint</Button>
96
96
  * </Empty.Actions>
97
97
  * </Empty.Root>
98
98
  *
@@ -118,8 +118,8 @@ declare const Description: {
118
118
  * <Empty.Title>No endpoints yet</Empty.Title>
119
119
  * <Empty.Description>Create your first endpoint to get started.</Empty.Description>
120
120
  * <Empty.Actions>
121
- * <Button>Create endpoint</Button>
122
- * <Button appearance="outlined">Go back</Button>
121
+ * <Button appearance="filled" intent="neutral">Create endpoint</Button>
122
+ * <Button appearance="outlined" intent="neutral">Go back</Button>
123
123
  * </Empty.Actions>
124
124
  * </Empty.Root>
125
125
  * ```
@@ -153,7 +153,7 @@ declare const Actions: {
153
153
  * Create your first endpoint to get started.
154
154
  * </Empty.Description>
155
155
  * <Empty.Actions>
156
- * <Button>Create endpoint</Button>
156
+ * <Button appearance="filled" intent="neutral">Create endpoint</Button>
157
157
  * </Empty.Actions>
158
158
  * </Empty.Root>
159
159
  * ```
@@ -172,7 +172,7 @@ declare const Empty: {
172
172
  * <Empty.Title>No endpoints yet</Empty.Title>
173
173
  * <Empty.Description>Create your first endpoint to get started.</Empty.Description>
174
174
  * <Empty.Actions>
175
- * <Button>Create endpoint</Button>
175
+ * <Button appearance="filled" intent="neutral">Create endpoint</Button>
176
176
  * </Empty.Actions>
177
177
  * </Empty.Root>
178
178
  * ```
@@ -191,7 +191,7 @@ declare const Empty: {
191
191
  * <Empty.Title>No endpoints yet</Empty.Title>
192
192
  * <Empty.Description>Create your first endpoint to get started.</Empty.Description>
193
193
  * <Empty.Actions>
194
- * <Button>Create endpoint</Button>
194
+ * <Button appearance="filled" intent="neutral">Create endpoint</Button>
195
195
  * </Empty.Actions>
196
196
  * </Empty.Root>
197
197
  * ```
@@ -210,7 +210,7 @@ declare const Empty: {
210
210
  * <Empty.Title>No endpoints yet</Empty.Title>
211
211
  * <Empty.Description>Create your first endpoint to get started.</Empty.Description>
212
212
  * <Empty.Actions>
213
- * <Button>Create endpoint</Button>
213
+ * <Button appearance="filled" intent="neutral">Create endpoint</Button>
214
214
  * </Empty.Actions>
215
215
  * </Empty.Root>
216
216
  *
@@ -234,7 +234,7 @@ declare const Empty: {
234
234
  * <Empty.Title>No endpoints yet</Empty.Title>
235
235
  * <Empty.Description>Create your first endpoint to get started.</Empty.Description>
236
236
  * <Empty.Actions>
237
- * <Button>Create endpoint</Button>
237
+ * <Button appearance="filled" intent="neutral">Create endpoint</Button>
238
238
  * </Empty.Actions>
239
239
  * </Empty.Root>
240
240
  * ```
@@ -252,7 +252,7 @@ declare const Empty: {
252
252
  * <Empty.Title>No endpoints yet</Empty.Title>
253
253
  * <Empty.Description>Create your first endpoint to get started.</Empty.Description>
254
254
  * <Empty.Actions>
255
- * <Button>Create endpoint</Button>
255
+ * <Button appearance="filled" intent="neutral">Create endpoint</Button>
256
256
  * </Empty.Actions>
257
257
  * </Empty.Root>
258
258
  * ```
package/dist/field.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
2
- import { n as IconButtonProps } from "./icon-button-DuRSCsPh.js";
2
+ import { t as ButtonIntent } from "./intents-DdSKSj1c.js";
3
+ import { n as IconButtonAppearance, r as IconButtonProps } from "./icon-button-B7uEj1qq.js";
3
4
  import { a as ValidationState, c as parseValidation, i as ValidationProp, l as resolveValidation, n as ParsedValidation, o as WithValidation, r as Validation, s as isAriaInvalid, t as AriaInvalid } from "./validation-7QeiTFwl.js";
4
5
  import { t as Slot } from "./index-Rv8RL7xy.js";
5
6
  import { ComponentProps, ReactElement, ReactNode } from "react";
@@ -465,12 +466,28 @@ declare const Field: {
465
466
  * </Field.Group>
466
467
  * ```
467
468
  */
468
- readonly HelpTrigger: import("react").ForwardRefExoticComponent<Partial<Omit<IconButtonProps, "icon" | "label">> & Pick<IconButtonProps, "label"> & {
469
+ readonly HelpTrigger: import("react").ForwardRefExoticComponent<Partial<Omit<IconButtonProps, "appearance" | "icon" | "intent" | "label">> & Pick<IconButtonProps, "label"> & {
470
+ /**
471
+ * The visual style of the trigger button. Optional here —
472
+ * `Field.HelpTrigger` defaults to `"ghost"` so the help affordance reads
473
+ * as subtle metadata next to the label.
474
+ *
475
+ * @default "ghost"
476
+ */
477
+ appearance?: IconButtonAppearance;
469
478
  /**
470
479
  * The icon to render inside the trigger button. Defaults to a Phosphor
471
480
  * `QuestionIcon` so the most common case only needs a contextual label.
472
481
  */
473
482
  icon?: ReactNode;
483
+ /**
484
+ * The tone of the trigger button. Optional here — `Field.HelpTrigger`
485
+ * defaults to `"neutral"` because opening contextual help is a routine
486
+ * action.
487
+ *
488
+ * @default "neutral"
489
+ */
490
+ intent?: ButtonIntent;
474
491
  } & import("react").RefAttributes<HTMLButtonElement>>;
475
492
  /**
476
493
  * Body of a `Field.Help` popover. Re-exports `Popover.Content` so all
package/dist/field.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./slot-DmPrjM7N.js";import{t as r}from"./icon-button-CxVsZ2N1.js";import{i,n as a,r as o,t as s}from"./validation-Bpptk_9t.js";import{n as c,r as l,t as u}from"./field-context-BR01g789.js";import{t as d}from"./label-BMlHW_2D.js";import{t as f}from"./popover-D5WxxnBY.js";import{Children as p,Fragment as m,cloneElement as h,forwardRef as g,isValidElement as _,useCallback as v,useContext as y,useId as b,useMemo as x,useState as S}from"react";import C from"tiny-invariant";import{jsx as w}from"react/jsx-runtime";import{QuestionIcon as T}from"@phosphor-icons/react/Question";const E=e=>{let t=[],n=new Set;for(let r of e??[]){if(typeof r!=`string`)continue;let e=r.trim();e.length===0||n.has(e)||(n.add(e),t.push(e))}return t},D=e=>!(e==null||typeof e==`boolean`||typeof e==`string`&&e.trim().length===0),O=({children:e,errorItemType:t})=>{let n=!1;return p.forEach(e,e=>{if(!(n||e==null||typeof e==`boolean`)){if(typeof e==`string`){e.trim().length>0&&(n=!0);return}if(!_(e)){n=!0;return}if(e.type===t){n=D(e.props.children);return}if(e.type===m){n=O({children:e.props.children,errorItemType:t});return}n=!0}}),n},k=g(({className:e,...n},r)=>w(`fieldset`,{ref:r,"data-slot":`field-set`,className:t(`flex w-full min-w-0 flex-col gap-4 border-0 p-0`,e),...n}));k.displayName=`FieldSet`;const A=g(({className:e,...n},r)=>w(`legend`,{ref:r,"data-slot":`field-legend`,className:t(`text-strong mb-1.5 text-sm font-medium font-sans`,e),...n}));A.displayName=`FieldLegend`;const j=g(({htmlFor:e,...t},n)=>{let r=y(c);return w(d,{ref:n,htmlFor:e??r?.controlId,...t})});j.displayName=`FieldLabel`;const M=g(({asChild:e,className:r,...i},a)=>w(e?n:`p`,{ref:a,"data-slot":`field-label-text`,className:t(`text-strong text-sm font-medium font-sans`,r),...i}));M.displayName=`FieldLabelText`;const N=g(({asChild:e,className:r,...i},a)=>w(e?n:`div`,{ref:a,"data-slot":`field-label-row`,className:t(`flex items-center gap-1`,r),...i}));N.displayName=`FieldLabelRow`;const P=f.Root,F=w(T,{}),I=g(({appearance:e=`ghost`,className:n,icon:i=F,label:a,size:o=`xs`,type:s=`button`,...c},l)=>w(f.Trigger,{asChild:!0,children:w(r,{ref:l,appearance:e,className:t(`text-body -my-0.5`,n),icon:i,label:a,size:o,type:s,...c})}));I.displayName=`FieldHelpTrigger`;const L=g((e,t)=>w(f.Content,{ref:t,"data-slot":`field-help-content`,...e}));L.displayName=`FieldHelpContent`;const R=g(({asChild:e,children:r,className:i,...a},o)=>w(e?n:`span`,{ref:o,"data-slot":`field-optional`,className:t(`text-muted text-sm font-normal font-sans`,i),...a,children:r??`(Optional)`}));R.displayName=`FieldOptional`;const z=g(({asChild:e,className:r,...i},a)=>w(e?n:`div`,{ref:a,"data-slot":`field-group`,className:t(`flex w-full flex-col gap-4`,r),...i}));z.displayName=`FieldGroup`;const B=g(({asChild:e,children:r,className:a,name:o,validation:l,...u},d)=>{let f=e?n:`div`,p=b(),m=b(),h=b(),[g,_]=S(!1),y=i(l??(g?`error`:void 0)),C=v(()=>(_(!0),()=>{_(!1)}),[]),T=x(()=>({controlId:p,descriptionId:m,errorId:h,hasErrors:g,name:o,registerError:C,validation:y}),[p,m,h,g,o,C,y]);return w(c.Provider,{value:T,children:w(s,{validation:y,children:w(f,{ref:d,"data-slot":`field-item`,"data-validation":y,className:t(`flex w-full flex-col gap-1.5`,a),...u,children:r})})})});B.displayName=`FieldItem`;const V=g(({children:e,...t},r)=>{let i=y(c),a=l({context:i});return typeof e==`function`?w(s,{validation:a.validation,children:w(u.Provider,{value:i?a.ariaProps:null,children:e(a.ariaProps)})}):(C(_(e),`Field.Control expects a single React element child (or a render-prop function). Got a non-element value (string, array, fragment, null, or undefined). Wrap the control in a single element, or use the function child form: <Field.Control>{(props) => <YourControl {...props} />}</Field.Control>.`),w(s,{validation:a.validation,children:w(u.Provider,{value:i?a.ariaProps:null,children:w(n,{ref:r,...t,children:h(e,a.ariaProps)})})}))});V.displayName=`FieldControl`;const H=g(({asChild:e,className:r,...i},a)=>w(e?n:`p`,{ref:a,"data-slot":`field-description`,id:y(c)?.descriptionId,className:t(`text-body text-sm leading-4`,`[:where([data-slot=field-error-list]+&)]:-mt-1.5`,r),...i}));H.displayName=`FieldDescription`;const U=g(({children:e,className:n,...r},i)=>D(e)?w(`li`,{ref:i,"data-slot":`field-error`,className:t(`text-danger-600 text-sm leading-4`,n),...r,children:e}):null);U.displayName=`FieldErrorItem`;const W=g(({messages:e,...t},n)=>w(G,{ref:n,...t,children:E(e).map(e=>w(U,{children:e},e))}));W.displayName=`FieldErrors`;const G=g(({asChild:r,children:i,className:a,...o},s)=>{let l=O({children:i,errorItemType:U}),u=y(c),d=u?.registerError;return e(()=>{if(!(!l||d==null))return d()},[l,d]),l?w(r?n:`ul`,{ref:s,"data-slot":`field-error-list`,id:u?.errorId,role:`list`,className:t(`m-0 flex w-full flex-col list-none p-0`,a),...o,children:i}):null});G.displayName=`FieldErrorList`;const K={Item:B,Control:V,Group:z,Set:k,Legend:A,Label:j,LabelText:M,LabelRow:N,Help:P,HelpTrigger:I,HelpContent:L,Optional:R,Description:H,Errors:W,ErrorList:G,ErrorItem:U},q=e=>E(e?.map(e=>typeof e==`string`||!e?e:e.message));export{K as Field,a as isAriaInvalid,o as parseValidation,i as resolveValidation,q as toErrorMessages};
1
+ import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./slot-DmPrjM7N.js";import{t as r}from"./icon-button-DV2-GZHf.js";import{i,n as a,r as o,t as s}from"./validation-Bpptk_9t.js";import{n as c,r as l,t as u}from"./field-context-BR01g789.js";import{t as d}from"./label-BMlHW_2D.js";import{t as f}from"./popover-D5WxxnBY.js";import{Children as p,Fragment as m,cloneElement as h,forwardRef as g,isValidElement as _,useCallback as v,useContext as y,useId as b,useMemo as x,useState as S}from"react";import C from"tiny-invariant";import{jsx as w}from"react/jsx-runtime";import{QuestionIcon as T}from"@phosphor-icons/react/Question";const E=e=>{let t=[],n=new Set;for(let r of e??[]){if(typeof r!=`string`)continue;let e=r.trim();e.length===0||n.has(e)||(n.add(e),t.push(e))}return t},D=e=>!(e==null||typeof e==`boolean`||typeof e==`string`&&e.trim().length===0),O=({children:e,errorItemType:t})=>{let n=!1;return p.forEach(e,e=>{if(!(n||e==null||typeof e==`boolean`)){if(typeof e==`string`){e.trim().length>0&&(n=!0);return}if(!_(e)){n=!0;return}if(e.type===t){n=D(e.props.children);return}if(e.type===m){n=O({children:e.props.children,errorItemType:t});return}n=!0}}),n},k=g(({className:e,...n},r)=>w(`fieldset`,{ref:r,"data-slot":`field-set`,className:t(`flex w-full min-w-0 flex-col gap-4 border-0 p-0`,e),...n}));k.displayName=`FieldSet`;const A=g(({className:e,...n},r)=>w(`legend`,{ref:r,"data-slot":`field-legend`,className:t(`text-strong mb-1.5 text-sm font-medium font-sans`,e),...n}));A.displayName=`FieldLegend`;const j=g(({htmlFor:e,...t},n)=>{let r=y(c);return w(d,{ref:n,htmlFor:e??r?.controlId,...t})});j.displayName=`FieldLabel`;const M=g(({asChild:e,className:r,...i},a)=>w(e?n:`p`,{ref:a,"data-slot":`field-label-text`,className:t(`text-strong text-sm font-medium font-sans`,r),...i}));M.displayName=`FieldLabelText`;const N=g(({asChild:e,className:r,...i},a)=>w(e?n:`div`,{ref:a,"data-slot":`field-label-row`,className:t(`flex items-center gap-1`,r),...i}));N.displayName=`FieldLabelRow`;const P=f.Root,F=w(T,{}),I=g(({appearance:e=`ghost`,className:n,icon:i=F,intent:a=`neutral`,label:o,size:s=`xs`,type:c=`button`,...l},u)=>w(f.Trigger,{asChild:!0,children:w(r,{ref:u,appearance:e,className:t(`text-body -my-0.5`,n),icon:i,intent:a,label:o,size:s,type:c,...l})}));I.displayName=`FieldHelpTrigger`;const L=g((e,t)=>w(f.Content,{ref:t,"data-slot":`field-help-content`,...e}));L.displayName=`FieldHelpContent`;const R=g(({asChild:e,children:r,className:i,...a},o)=>w(e?n:`span`,{ref:o,"data-slot":`field-optional`,className:t(`text-muted text-sm font-normal font-sans`,i),...a,children:r??`(Optional)`}));R.displayName=`FieldOptional`;const z=g(({asChild:e,className:r,...i},a)=>w(e?n:`div`,{ref:a,"data-slot":`field-group`,className:t(`flex w-full flex-col gap-4`,r),...i}));z.displayName=`FieldGroup`;const B=g(({asChild:e,children:r,className:a,name:o,validation:l,...u},d)=>{let f=e?n:`div`,p=b(),m=b(),h=b(),[g,_]=S(!1),y=i(l??(g?`error`:void 0)),C=v(()=>(_(!0),()=>{_(!1)}),[]),T=x(()=>({controlId:p,descriptionId:m,errorId:h,hasErrors:g,name:o,registerError:C,validation:y}),[p,m,h,g,o,C,y]);return w(c.Provider,{value:T,children:w(s,{validation:y,children:w(f,{ref:d,"data-slot":`field-item`,"data-validation":y,className:t(`flex w-full flex-col gap-1.5`,a),...u,children:r})})})});B.displayName=`FieldItem`;const V=g(({children:e,...t},r)=>{let i=y(c),a=l({context:i});return typeof e==`function`?w(s,{validation:a.validation,children:w(u.Provider,{value:i?a.ariaProps:null,children:e(a.ariaProps)})}):(C(_(e),`Field.Control expects a single React element child (or a render-prop function). Got a non-element value (string, array, fragment, null, or undefined). Wrap the control in a single element, or use the function child form: <Field.Control>{(props) => <YourControl {...props} />}</Field.Control>.`),w(s,{validation:a.validation,children:w(u.Provider,{value:i?a.ariaProps:null,children:w(n,{ref:r,...t,children:h(e,a.ariaProps)})})}))});V.displayName=`FieldControl`;const H=g(({asChild:e,className:r,...i},a)=>w(e?n:`p`,{ref:a,"data-slot":`field-description`,id:y(c)?.descriptionId,className:t(`text-body text-sm leading-4`,`[:where([data-slot=field-error-list]+&)]:-mt-1.5`,r),...i}));H.displayName=`FieldDescription`;const U=g(({children:e,className:n,...r},i)=>D(e)?w(`li`,{ref:i,"data-slot":`field-error`,className:t(`text-danger-600 text-sm leading-4`,n),...r,children:e}):null);U.displayName=`FieldErrorItem`;const W=g(({messages:e,...t},n)=>w(G,{ref:n,...t,children:E(e).map(e=>w(U,{children:e},e))}));W.displayName=`FieldErrors`;const G=g(({asChild:r,children:i,className:a,...o},s)=>{let l=O({children:i,errorItemType:U}),u=y(c),d=u?.registerError;return e(()=>{if(!(!l||d==null))return d()},[l,d]),l?w(r?n:`ul`,{ref:s,"data-slot":`field-error-list`,id:u?.errorId,role:`list`,className:t(`m-0 flex w-full flex-col list-none p-0`,a),...o,children:i}):null});G.displayName=`FieldErrorList`;const K={Item:B,Control:V,Group:z,Set:k,Legend:A,Label:j,LabelText:M,LabelRow:N,Help:P,HelpTrigger:I,HelpContent:L,Optional:R,Description:H,Errors:W,ErrorList:G,ErrorItem:U},q=e=>E(e?.map(e=>typeof e==`string`||!e?e:e.message));export{K as Field,a as isAriaInvalid,o as parseValidation,i as resolveValidation,q as toErrorMessages};