@ngrok/mantle 0.87.0 → 0.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion.d.ts +10 -9
- package/dist/accordion.js +1 -1
- package/dist/agent.json +2 -1
- package/dist/{alert-DCVfviBx.d.ts → alert-BzPDUaU7.d.ts} +16 -15
- package/dist/alert-CZYYlx9q.js +1 -0
- package/dist/alert-center.d.ts +7 -7
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.d.ts +17 -16
- package/dist/alert-dialog.js +1 -1
- package/dist/alert-vfeV_hso.js +1 -0
- package/dist/alert.d.ts +1 -1
- package/dist/alert.js +1 -1
- package/dist/anchor-CgcbWEUs.js +1 -0
- package/dist/anchor.js +1 -1
- package/dist/app-layout.d.ts +1128 -45
- package/dist/app-layout.js +1 -1
- package/dist/area-chart.d.ts +41 -18
- package/dist/area-chart.js +1 -1
- package/dist/avatar.js +1 -1
- package/dist/badge.d.ts +3 -2
- package/dist/badge.js +1 -1
- package/dist/bar-chart.d.ts +37 -13
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/browser-only.js +1 -1
- package/dist/button-69InNC_m.js +1 -0
- package/dist/button-BMfUxs_j.js +1 -0
- package/dist/{button-DO53OA70.d.ts → button-CHoYpOzx.d.ts} +5 -4
- package/dist/{button-B52_vczK.js → button-D8rr-1AB.js} +1 -1
- package/dist/{button-crUf0hbR.d.ts → button-DL7V4bzW.d.ts} +5 -4
- package/dist/button-b2HKEIE2.js +1 -0
- package/dist/{button-B5i9n7Qp.d.ts → button-mzUR1U0Y.d.ts} +5 -4
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +3 -2
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +8 -7
- package/dist/card.js +1 -1
- package/dist/centered-layout.js +1 -1
- package/dist/{chart-DgaWVBqi.d.ts → chart-23KQ1ZNO.d.ts} +128 -62
- package/dist/chart-BRkJfptA.js +2 -0
- package/dist/checkbox-C3N2afhB.js +1 -0
- package/dist/checkbox.d.ts +3 -2
- package/dist/checkbox.js +1 -1
- package/dist/{choice-PESu-9s8.d.ts → choice-BCiyqLgO.d.ts} +12 -11
- package/dist/choice-DQmecLfy.js +1 -0
- package/dist/choice.d.ts +1 -1
- package/dist/choice.js +1 -1
- package/dist/code-block-4Esx_gV-.js +12 -0
- package/dist/code-block.d.ts +17 -16
- package/dist/code-block.js +6 -6
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.d.ts +2 -1
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +15 -14
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +13 -13
- package/dist/command.js +1 -1
- package/dist/cx-CK7o_rVv.js +1 -0
- package/dist/cx.js +1 -1
- package/dist/data-table.d.ts +32 -31
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +10 -6
- package/dist/description-list.js +1 -1
- package/dist/dialog-BDzapPLR.js +1 -0
- package/dist/{dialog-DXpqpdJj.d.ts → dialog-DQdeqvq-.d.ts} +28 -15
- package/dist/dialog.d.ts +1 -1
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu-CWUzGFgf.d.ts +1 -0
- package/dist/{dropdown-menu-BloQKE_y.d.ts → dropdown-menu-CpRsyt_F.d.ts} +17 -17
- package/dist/dropdown-menu-CutWQ0bl.js +1 -0
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +7 -6
- package/dist/empty.js +1 -1
- package/dist/field.d.ts +16 -15
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +3 -2
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +36 -1
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +5 -4
- package/dist/hover-card.js +1 -1
- package/dist/icon-BudQMD2S.js +1 -0
- package/dist/icon-kK0c-POG.js +1 -0
- package/dist/{icon-w0HUe7tr.d.ts → icon-r2NvfTWW.d.ts} +3 -2
- package/dist/{icon-BmJ57Tgh.d.ts → icon-ucVgZeXn.d.ts} +3 -2
- package/dist/icon.d.ts +2 -2
- package/dist/icon.js +1 -1
- package/dist/icons-BMZnm4hM.js +1 -0
- package/dist/{icons-Bu-2boul.js → icons-CH3tD_wq.js} +1 -1
- package/dist/icons-CSwTVV2m.js +1 -0
- package/dist/icons.js +1 -1
- package/dist/in-view-Dxv_GrUU.js +1 -0
- package/dist/input-D_DjD9lT.js +1 -0
- package/dist/{input-DpnC3Xgj.d.ts → input-bbB1tC0h.d.ts} +3 -2
- package/dist/input.d.ts +5 -4
- package/dist/input.js +1 -1
- package/dist/kbd-CLHsJ99p.js +1 -0
- package/dist/kbd.d.ts +2 -1
- package/dist/kbd.js +1 -1
- package/dist/label-5T8i7I4X.js +1 -0
- package/dist/{label-Bnfe9YJ6.d.ts → label-C-KbNls8.d.ts} +3 -2
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/{layer-container-R7aux3n8.js → layer-container-DLf-6eBz.js} +1 -1
- package/dist/layer-container.js +1 -1
- package/dist/line-chart.d.ts +40 -15
- package/dist/line-chart.js +1 -1
- package/dist/list-DOVZoz9t.js +1 -0
- package/dist/list.d.ts +3 -2
- package/dist/list.js +1 -1
- package/dist/live-region-DQ1QLv3L.js +1 -0
- package/dist/live-region.d.ts +3 -2
- package/dist/live-region.js +1 -1
- package/dist/llms.txt +2 -1
- package/dist/{main-Dv2zuT_b.js → main-CC1L9IsH.js} +1 -1
- package/dist/main.js +1 -1
- package/dist/mantle.css +12 -20
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +23 -22
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +9 -8
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +9 -8
- package/dist/pagination.js +1 -1
- package/dist/{popover-Cco1nw8I.d.ts → popover-Dvls7-j4.d.ts} +5 -4
- package/dist/popover-oQDUvcZ2.js +1 -0
- package/dist/popover.d.ts +1 -1
- package/dist/popover.js +1 -1
- package/dist/primitive-B-6XILB2.js +1 -0
- package/dist/progress.d.ts +9 -8
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +9 -8
- package/dist/qr-code.js +1 -1
- package/dist/radio-group.d.ts +19 -18
- package/dist/radio-group.js +1 -1
- package/dist/sandbar.d.ts +7 -7
- package/dist/sandbar.js +1 -1
- package/dist/{sandboxed-on-click-BLvvSqOP.js → sandboxed-on-click-C7pPu-2M.js} +1 -1
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/scatter-plot.d.ts +39 -14
- package/dist/scatter-plot.js +1 -1
- package/dist/{select-BITJP7I5.d.ts → select-CxXb3aiC.d.ts} +3 -3
- package/dist/select-DcL0-duV.js +1 -0
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +16 -15
- package/dist/selectable-list.js +1 -1
- package/dist/separator-DvPe27fH.js +1 -0
- package/dist/{separator-Bo4nY_3M.d.ts → separator-HzGvuD0B.d.ts} +4 -3
- package/dist/separator.d.ts +1 -1
- package/dist/separator.js +1 -1
- package/dist/sheet-DND_KjmS.js +1 -0
- package/dist/sheet.d.ts +13 -12
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +149 -95
- package/dist/sidebar.js +1 -1
- package/dist/skeleton-zfqoDAxT.js +1 -0
- package/dist/skeleton.d.ts +3 -2
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.d.ts +3 -2
- package/dist/slider.js +1 -1
- package/dist/{slot-BsvE2ntj.js → slot-DdYN1L1C.js} +1 -1
- package/dist/{slot-DdgxmuI5.d.ts → slot-Q996Hqk9.d.ts} +1 -1
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/split-button.d.ts +6 -5
- package/dist/split-button.js +1 -1
- package/dist/switch.d.ts +3 -2
- package/dist/switch.js +1 -1
- package/dist/{table-DEI-qvSC.d.ts → table-BhzITa19.d.ts} +10 -9
- package/dist/table-DBbKqOVq.js +1 -0
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +172 -33
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +3 -2
- package/dist/text-area.js +1 -1
- package/dist/theme-BlCZHClJ.js +1 -0
- package/dist/theme-switcher.d.ts +3 -3
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +10 -9
- package/dist/toast.js +1 -1
- package/dist/{tooltip-nuUCoqq8.d.ts → tooltip-CngH7Kl6.d.ts} +7 -6
- package/dist/tooltip-NhYXqStK.js +1 -0
- package/dist/tooltip.d.ts +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/truncated-text.d.ts +138 -0
- package/dist/truncated-text.js +1 -0
- package/dist/types.js +1 -1
- package/dist/{use-breakpoint-CjyNk0fi.js → use-breakpoint--mo7kr9d.js} +1 -1
- package/dist/use-is-hydrated-after-paint-r9Cl2mGp.js +1 -0
- package/dist/utils.js +1 -1
- package/dist/visually-hidden.d.ts +2 -1
- package/dist/visually-hidden.js +1 -1
- package/dist/well.d.ts +3 -2
- package/dist/well.js +1 -1
- package/package.json +17 -16
- package/dist/alert-OP_-aGJD.js +0 -1
- package/dist/anchor-BnMhJYS4.js +0 -1
- package/dist/button-BFpCB99R.js +0 -1
- package/dist/button-Dij5vCQG.js +0 -1
- package/dist/button-pwkdtR3U.js +0 -1
- package/dist/chart-aZLMj4xx.js +0 -2
- package/dist/checkbox-DbJSqSNN.js +0 -1
- package/dist/choice-SRyLguqU.js +0 -1
- package/dist/code-block-BE3Q0iAo.js +0 -12
- package/dist/cx-0HCjnNv1.js +0 -1
- package/dist/dialog-HIdb5d3I.js +0 -1
- package/dist/dropdown-menu-BR_AQNMj.js +0 -1
- package/dist/dropdown-menu-Dlpb7600.d.ts +0 -1
- package/dist/icon-BT8FnkkJ.js +0 -1
- package/dist/icon-U24NfYv7.js +0 -1
- package/dist/icons-BQRcOU6J.js +0 -1
- package/dist/icons-C3rVfpx9.js +0 -1
- package/dist/in-view-T_AAYaaF.js +0 -1
- package/dist/input-yq0jLE4e.js +0 -1
- package/dist/kbd-CJ8hNZfS.js +0 -1
- package/dist/label-BAy0Mg59.js +0 -1
- package/dist/list-BleZ-43e.js +0 -1
- package/dist/live-region-B2vJRvPH.js +0 -1
- package/dist/popover-BJ5XNwzD.js +0 -1
- package/dist/primitive-w3wFk2La.js +0 -1
- package/dist/select-CUWLEeuf.js +0 -1
- package/dist/separator-D98be0gY.js +0 -1
- package/dist/sheet-B5x8EO9Y.js +0 -1
- package/dist/skeleton-bVDP8BzY.js +0 -1
- package/dist/table-D2jh52KA.js +0 -1
- package/dist/theme-C1kFFdIk.js +0 -1
- package/dist/tooltip-H03l7E4Y.js +0 -1
- /package/dist/{types-D85fCNV3.js → css-properties-D85fCNV3.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
2
|
-
import { n as Separator } from "./separator-
|
|
2
|
+
import { n as Separator } from "./separator-HzGvuD0B.js";
|
|
3
3
|
import { ComponentProps } from "react";
|
|
4
4
|
import { CheckboxItem, Content, Group, Item, Label, RadioGroup, RadioItem, SubContent, SubTrigger, Trigger } from "@radix-ui/react-dropdown-menu";
|
|
5
5
|
//#region src/components/dropdown-menu/dropdown-menu.d.ts
|
|
@@ -22,7 +22,7 @@ import { CheckboxItem, Content, Group, Item, Label, RadioGroup, RadioItem, SubCo
|
|
|
22
22
|
* </DropdownMenu.Root>
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
|
-
declare const Trigger$1: (props: ComponentProps<typeof Trigger>) => import("react").JSX.Element;
|
|
25
|
+
declare const Trigger$1: ({ "data-slot": dataSlot, ...props }: ComponentProps<typeof Trigger> & WithDataSlot) => import("react").JSX.Element;
|
|
26
26
|
/**
|
|
27
27
|
* A group container for organizing related dropdown menu items.
|
|
28
28
|
*
|
|
@@ -42,7 +42,7 @@ declare const Trigger$1: (props: ComponentProps<typeof Trigger>) => import("reac
|
|
|
42
42
|
* </DropdownMenu.Root>
|
|
43
43
|
* ```
|
|
44
44
|
*/
|
|
45
|
-
declare const Group$1: ({ className, ...props }: ComponentProps<typeof Group>) => import("react").JSX.Element;
|
|
45
|
+
declare const Group$1: ({ "data-slot": dataSlot, className, ...props }: ComponentProps<typeof Group> & WithDataSlot) => import("react").JSX.Element;
|
|
46
46
|
/**
|
|
47
47
|
* A radio group container for exclusive selection within the dropdown menu.
|
|
48
48
|
*
|
|
@@ -61,13 +61,13 @@ declare const Group$1: ({ className, ...props }: ComponentProps<typeof Group>) =
|
|
|
61
61
|
* </DropdownMenu.Root>
|
|
62
62
|
* ```
|
|
63
63
|
*/
|
|
64
|
-
declare const RadioGroup$1: ({ className, ...props }: ComponentProps<typeof RadioGroup>) => import("react").JSX.Element;
|
|
64
|
+
declare const RadioGroup$1: ({ "data-slot": dataSlot, className, ...props }: ComponentProps<typeof RadioGroup> & WithDataSlot) => import("react").JSX.Element;
|
|
65
65
|
/**
|
|
66
66
|
* Props for `DropdownMenu.SubTrigger`.
|
|
67
67
|
*/
|
|
68
68
|
type DropdownMenuSubTriggerProps = ComponentProps<typeof SubTrigger> & {
|
|
69
69
|
inset?: boolean;
|
|
70
|
-
};
|
|
70
|
+
} & WithDataSlot;
|
|
71
71
|
/**
|
|
72
72
|
* A trigger for a dropdown menu sub-menu. It opens the submenu on hover, or on
|
|
73
73
|
* ArrowRight or Enter.
|
|
@@ -112,7 +112,7 @@ type DropdownMenuSubTriggerProps = ComponentProps<typeof SubTrigger> & {
|
|
|
112
112
|
* </DropdownMenu.Root>
|
|
113
113
|
* ```
|
|
114
114
|
*/
|
|
115
|
-
declare const SubTrigger$1: ({ className, inset, children, ...props }: DropdownMenuSubTriggerProps) => import("react").JSX.Element;
|
|
115
|
+
declare const SubTrigger$1: ({ "data-slot": dataSlot, className, inset, children, ...props }: DropdownMenuSubTriggerProps) => import("react").JSX.Element;
|
|
116
116
|
/**
|
|
117
117
|
* The content container for a dropdown menu sub-menu.
|
|
118
118
|
*
|
|
@@ -141,7 +141,7 @@ declare const SubTrigger$1: ({ className, inset, children, ...props }: DropdownM
|
|
|
141
141
|
* </DropdownMenu.Root>
|
|
142
142
|
* ```
|
|
143
143
|
*/
|
|
144
|
-
declare const SubContent$1: ({ className, loop, ...props }: ComponentProps<typeof SubContent>) => import("react").JSX.Element;
|
|
144
|
+
declare const SubContent$1: ({ "data-slot": dataSlot, className, loop, ...props }: ComponentProps<typeof SubContent> & WithDataSlot) => import("react").JSX.Element;
|
|
145
145
|
type DropdownMenuContentProps = ComponentProps<typeof Content> & WithDataSlot & {
|
|
146
146
|
/**
|
|
147
147
|
* Whether the DropdownMenuContent should match the width of the trigger or use the intrinsic content width.
|
|
@@ -196,13 +196,13 @@ declare const Content$1: ({ className, "data-slot": dataSlot, onClick, loop, wid
|
|
|
196
196
|
* </DropdownMenu.Root>
|
|
197
197
|
* ```
|
|
198
198
|
*/
|
|
199
|
-
declare const Item$1: ({ className, inset, ...props }: ComponentProps<typeof Item> & {
|
|
199
|
+
declare const Item$1: ({ "data-slot": dataSlot, className, inset, ...props }: ComponentProps<typeof Item> & {
|
|
200
200
|
inset?: boolean;
|
|
201
|
-
}) => import("react").JSX.Element;
|
|
201
|
+
} & WithDataSlot) => import("react").JSX.Element;
|
|
202
202
|
/**
|
|
203
203
|
* Props for `DropdownMenu.CheckboxItem`.
|
|
204
204
|
*/
|
|
205
|
-
type DropdownMenuCheckboxItemProps = ComponentProps<typeof CheckboxItem
|
|
205
|
+
type DropdownMenuCheckboxItemProps = ComponentProps<typeof CheckboxItem> & WithDataSlot;
|
|
206
206
|
/**
|
|
207
207
|
* A menu item with a checkbox that can be controlled or uncontrolled.
|
|
208
208
|
*
|
|
@@ -242,14 +242,14 @@ type DropdownMenuCheckboxItemProps = ComponentProps<typeof CheckboxItem>;
|
|
|
242
242
|
* </DropdownMenu.Root>
|
|
243
243
|
* ```
|
|
244
244
|
*/
|
|
245
|
-
declare const CheckboxItem$1: ({ className, children, checked, ...props }: DropdownMenuCheckboxItemProps) => import("react").JSX.Element;
|
|
245
|
+
declare const CheckboxItem$1: ({ "data-slot": dataSlot, className, children, checked, ...props }: DropdownMenuCheckboxItemProps) => import("react").JSX.Element;
|
|
246
246
|
/**
|
|
247
247
|
* Props for `DropdownMenu.RadioItem`.
|
|
248
248
|
*/
|
|
249
249
|
type DropdownMenuRadioItemProps = ComponentProps<typeof RadioItem> & {
|
|
250
250
|
name?: string;
|
|
251
251
|
id?: string;
|
|
252
|
-
};
|
|
252
|
+
} & WithDataSlot;
|
|
253
253
|
/**
|
|
254
254
|
* A menu item with a radio button that can be controlled or uncontrolled.
|
|
255
255
|
* Used within a RadioGroup to create a set of mutually exclusive options.
|
|
@@ -292,7 +292,7 @@ type DropdownMenuRadioItemProps = ComponentProps<typeof RadioItem> & {
|
|
|
292
292
|
* </DropdownMenu.Root>
|
|
293
293
|
* ```
|
|
294
294
|
*/
|
|
295
|
-
declare const RadioItem$1: ({ className, children, ...props }: DropdownMenuRadioItemProps) => import("react").JSX.Element;
|
|
295
|
+
declare const RadioItem$1: ({ "data-slot": dataSlot, className, children, ...props }: DropdownMenuRadioItemProps) => import("react").JSX.Element;
|
|
296
296
|
/**
|
|
297
297
|
* A label for a group of dropdown menu items.
|
|
298
298
|
*
|
|
@@ -310,9 +310,9 @@ declare const RadioItem$1: ({ className, children, ...props }: DropdownMenuRadio
|
|
|
310
310
|
* </DropdownMenu.Root>
|
|
311
311
|
* ```
|
|
312
312
|
*/
|
|
313
|
-
declare const Label$1: ({ className, inset, ...props }: ComponentProps<typeof Label> & {
|
|
313
|
+
declare const Label$1: ({ "data-slot": dataSlot, className, inset, ...props }: ComponentProps<typeof Label> & {
|
|
314
314
|
inset?: boolean;
|
|
315
|
-
}) => import("react").JSX.Element;
|
|
315
|
+
} & WithDataSlot) => import("react").JSX.Element;
|
|
316
316
|
/**
|
|
317
317
|
* A visual separator between dropdown menu items or groups.
|
|
318
318
|
*
|
|
@@ -331,7 +331,7 @@ declare const Label$1: ({ className, inset, ...props }: ComponentProps<typeof La
|
|
|
331
331
|
* </DropdownMenu.Root>
|
|
332
332
|
* ```
|
|
333
333
|
*/
|
|
334
|
-
declare const DropdownSeparator: ({ className, ...props }: ComponentProps<typeof Separator>) => import("react").JSX.Element;
|
|
334
|
+
declare const DropdownSeparator: ({ "data-slot": dataSlot, className, ...props }: ComponentProps<typeof Separator> & WithDataSlot) => import("react").JSX.Element;
|
|
335
335
|
/**
|
|
336
336
|
* A keyboard shortcut indicator for dropdown menu items. It locks
|
|
337
337
|
* `translate="no"`, because a translated key name names the wrong key.
|
|
@@ -351,7 +351,7 @@ declare const DropdownSeparator: ({ className, ...props }: ComponentProps<typeof
|
|
|
351
351
|
* </DropdownMenu.Root>
|
|
352
352
|
* ```
|
|
353
353
|
*/
|
|
354
|
-
declare const Shortcut: ({ className, ...props }: Omit<ComponentProps<"span">, "translate">) => import("react").JSX.Element;
|
|
354
|
+
declare const Shortcut: ({ "data-slot": dataSlot, className, ...props }: Omit<ComponentProps<"span">, "translate"> & WithDataSlot) => import("react").JSX.Element;
|
|
355
355
|
/**
|
|
356
356
|
* A menu of options or actions, triggered by a button.
|
|
357
357
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-kK0c-POG.js";import{r}from"./layer-container-DLf-6eBz.js";import{n as i}from"./separator-DvPe27fH.js";import{c as a}from"react/compiler-runtime";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{Slottable as c}from"@radix-ui/react-slot";import{CheckIcon as l}from"@phosphor-icons/react/Check";import{CaretRightIcon as u}from"@phosphor-icons/react/CaretRight";import{CheckboxItem as d,Content as f,Group as p,Item as m,ItemIndicator as h,Label as g,Portal as _,RadioGroup as v,RadioItem as y,Root as b,Sub as x,SubContent as S,SubTrigger as C,Trigger as w}from"@radix-ui/react-dropdown-menu";const T=b,E=e=>{let n=a(8),r,i;n[0]===e?(r=n[1],i=n[2]):({"data-slot":r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let s;n[3]===r?s=n[4]:(s=t(r,`dropdown-menu-trigger`),n[3]=r,n[4]=s);let c;return n[5]!==i||n[6]!==s?(c=/* @__PURE__ */ o(w,{"data-slot":s,...i}),n[5]=i,n[6]=s,n[7]=c):c=n[7],c},D=n=>{let r=a(12),i,s,c;r[0]===n?(i=r[1],s=r[2],c=r[3]):({"data-slot":s,className:i,...c}=n,r[0]=n,r[1]=i,r[2]=s,r[3]=c);let l;r[4]===s?l=r[5]:(l=t(s,`dropdown-menu-group`),r[4]=s,r[5]=l);let u;r[6]===i?u=r[7]:(u=e(`space-y-px`,i),r[6]=i,r[7]=u);let d;return r[8]!==c||r[9]!==l||r[10]!==u?(d=/* @__PURE__ */ o(p,{"data-slot":l,className:u,...c}),r[8]=c,r[9]=l,r[10]=u,r[11]=d):d=r[11],d},O=e=>{let t=a(6),n,i;t[0]===e?(n=t[1],i=t[2]):({container:n,...i}=e,t[0]=e,t[1]=n,t[2]=i);let s=r(),c=n??s,l;return t[3]!==i||t[4]!==c?(l=/* @__PURE__ */ o(_,{container:c,...i}),t[3]=i,t[4]=c,t[5]=l):l=t[5],l},k={Root:T,CheckboxItem:r=>{let i=a(19),u,f,p,m,g;i[0]===r?(u=i[1],f=i[2],p=i[3],m=i[4],g=i[5]):({"data-slot":m,className:p,children:f,checked:u,...g}=r,i[0]=r,i[1]=u,i[2]=f,i[3]=p,i[4]=m,i[5]=g);let _;i[6]===m?_=i[7]:(_=t(m,`dropdown-menu-checkbox-item`),i[6]=m,i[7]=_);let v;i[8]===p?v=i[9]:(v=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!`,`[&>[data-slot=dropdown-menu-checkbox-item-label]>svg]:size-5 [&_svg]:shrink-0`,p),i[8]=p,i[9]=v);let y;i[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=/* @__PURE__ */ o(`span`,{className:`absolute right-2 flex items-center`,children:/* @__PURE__ */ o(h,{children:/* @__PURE__ */ o(n,{svg:/* @__PURE__ */ o(l,{weight:`bold`}),className:`size-4 text-accent-600`})})}),i[10]=y):y=i[10];let b;i[11]===f?b=i[12]:(b=/* @__PURE__ */ o(c,{child:f,children:j}),i[11]=f,i[12]=b);let x;return i[13]!==u||i[14]!==g||i[15]!==_||i[16]!==v||i[17]!==b?(x=/* @__PURE__ */ s(d,{"data-slot":_,className:v,checked:u,...g,children:[y,b]}),i[13]=u,i[14]=g,i[15]=_,i[16]=v,i[17]=b,i[18]=x):x=i[18],x},Content:n=>{let r=a(20),i,s,c,l,u,d;r[0]===n?(i=r[1],s=r[2],c=r[3],l=r[4],u=r[5],d=r[6]):({className:i,"data-slot":s,onClick:c,loop:u,width:d,...l}=n,r[0]=n,r[1]=i,r[2]=s,r[3]=c,r[4]=l,r[5]=u,r[6]=d);let p=u===void 0||u,m;r[7]===s?m=r[8]:(m=t(s,`dropdown-menu-content`),r[7]=s,r[8]=m);let h=d===`trigger`&&`w-(--radix-dropdown-menu-trigger-width)`,g;r[9]!==i||r[10]!==h?(g=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`,h,i),r[9]=i,r[10]=h,r[11]=g):g=r[11];let _;r[12]===c?_=r[13]:(_=e=>{e.stopPropagation(),c?.(e)},r[12]=c,r[13]=_);let v;return r[14]!==p||r[15]!==l||r[16]!==m||r[17]!==g||r[18]!==_?(v=/* @__PURE__ */ o(O,{children:/* @__PURE__ */ o(f,{"data-slot":m,className:g,loop:p,onClick:_,...l})}),r[14]=p,r[15]=l,r[16]=m,r[17]=g,r[18]=_,r[19]=v):v=r[19],v},Group:D,Item:n=>{let r=a(14),i,s,c,l;r[0]===n?(i=r[1],s=r[2],c=r[3],l=r[4]):({"data-slot":s,className:i,inset:c,...l}=n,r[0]=n,r[1]=i,r[2]=s,r[3]=c,r[4]=l);let u;r[5]===s?u=r[6]:(u=t(s,`dropdown-menu-item`),r[5]=s,r[6]=u);let d=c&&`pl-8`,f;r[7]!==i||r[8]!==d?(f=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`,d,i),r[7]=i,r[8]=d,r[9]=f):f=r[9];let p;return r[10]!==l||r[11]!==u||r[12]!==f?(p=/* @__PURE__ */ o(m,{"data-slot":u,className:f,...l}),r[10]=l,r[11]=u,r[12]=f,r[13]=p):p=r[13],p},Label:n=>{let r=a(14),i,s,c,l;r[0]===n?(i=r[1],s=r[2],c=r[3],l=r[4]):({"data-slot":s,className:i,inset:c,...l}=n,r[0]=n,r[1]=i,r[2]=s,r[3]=c,r[4]=l);let u;r[5]===s?u=r[6]:(u=t(s,`dropdown-menu-label`),r[5]=s,r[6]=u);let d=c&&`pl-8`,f;r[7]!==i||r[8]!==d?(f=e(`px-2 py-1.5 text-sm font-medium`,d,i),r[7]=i,r[8]=d,r[9]=f):f=r[9];let p;return r[10]!==l||r[11]!==u||r[12]!==f?(p=/* @__PURE__ */ o(g,{"data-slot":u,className:f,...l}),r[10]=l,r[11]=u,r[12]=f,r[13]=p):p=r[13],p},RadioGroup:n=>{let r=a(12),i,s,c;r[0]===n?(i=r[1],s=r[2],c=r[3]):({"data-slot":s,className:i,...c}=n,r[0]=n,r[1]=i,r[2]=s,r[3]=c);let l;r[4]===s?l=r[5]:(l=t(s,`dropdown-menu-radio-group`),r[4]=s,r[5]=l);let u;r[6]===i?u=r[7]:(u=e(`space-y-px`,i),r[6]=i,r[7]=u);let d;return r[8]!==c||r[9]!==l||r[10]!==u?(d=/* @__PURE__ */ o(v,{"data-slot":l,className:u,...c}),r[8]=c,r[9]=l,r[10]=u,r[11]=d):d=r[11],d},RadioItem:r=>{let i=a(17),u,d,f,p;i[0]===r?(u=i[1],d=i[2],f=i[3],p=i[4]):({"data-slot":f,className:d,children:u,...p}=r,i[0]=r,i[1]=u,i[2]=d,i[3]=f,i[4]=p);let m;i[5]===f?m=i[6]:(m=t(f,`dropdown-menu-radio-item`),i[5]=f,i[6]=m);let g;i[7]===d?g=i[8]:(g=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!`,`[&>[data-slot=dropdown-menu-radio-item-label]>svg]:size-5 [&_svg]:shrink-0`,d),i[7]=d,i[8]=g);let _;i[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=/* @__PURE__ */ o(`span`,{className:`absolute right-2 items-center hidden group-aria-checked/dropdown-menu-radio-item:flex`,children:/* @__PURE__ */ o(h,{children:/* @__PURE__ */ o(n,{svg:/* @__PURE__ */ o(l,{weight:`bold`}),className:`size-4 text-accent-600`})})}),i[9]=_):_=i[9];let v;i[10]===u?v=i[11]:(v=/* @__PURE__ */ o(c,{child:u,children:M}),i[10]=u,i[11]=v);let b;return i[12]!==p||i[13]!==m||i[14]!==g||i[15]!==v?(b=/* @__PURE__ */ s(y,{"data-slot":m,className:g,...p,children:[_,v]}),i[12]=p,i[13]=m,i[14]=g,i[15]=v,i[16]=b):b=i[16],b},Separator:n=>{let r=a(12),s,c,l;r[0]===n?(s=r[1],c=r[2],l=r[3]):({"data-slot":c,className:s,...l}=n,r[0]=n,r[1]=s,r[2]=c,r[3]=l);let u;r[4]===c?u=r[5]:(u=t(c,`dropdown-menu-separator`),r[4]=c,r[5]=u);let d;r[6]===s?d=r[7]:(d=e(`-mx-1.25 my-1 w-auto`,s),r[6]=s,r[7]=d);let f;return r[8]!==l||r[9]!==u||r[10]!==d?(f=/* @__PURE__ */ o(i,{"data-slot":u,className:d,...l}),r[8]=l,r[9]=u,r[10]=d,r[11]=f):f=r[11],f},Shortcut:n=>{let r=a(12),i,s,c;r[0]===n?(i=r[1],s=r[2],c=r[3]):({"data-slot":s,className:i,...c}=n,r[0]=n,r[1]=i,r[2]=s,r[3]=c);let l;r[4]===s?l=r[5]:(l=t(s,`dropdown-menu-shortcut`),r[4]=s,r[5]=l);let u;r[6]===i?u=r[7]:(u=e(`ml-auto text-xs tracking-widest opacity-60`,i),r[6]=i,r[7]=u);let d;return r[8]!==c||r[9]!==l||r[10]!==u?(d=/* @__PURE__ */ o(`span`,{"data-slot":l,className:u,...c,translate:`no`}),r[8]=c,r[9]=l,r[10]=u,r[11]=d):d=r[11],d},Sub:x,SubContent:n=>{let r=a(14),i,s,c,l;r[0]===n?(i=r[1],s=r[2],c=r[3],l=r[4]):({"data-slot":s,className:i,loop:l,...c}=n,r[0]=n,r[1]=i,r[2]=s,r[3]=c,r[4]=l);let u=l===void 0||l,d;r[5]===s?d=r[6]:(d=t(s,`dropdown-menu-sub-content`),r[5]=s,r[6]=d);let f;r[7]===i?f=r[8]:(f=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`,i),r[7]=i,r[8]=f);let p;return r[9]!==u||r[10]!==c||r[11]!==d||r[12]!==f?(p=/* @__PURE__ */ o(O,{children:/* @__PURE__ */ o(S,{"data-slot":d,className:f,loop:u,...c})}),r[9]=u,r[10]=c,r[11]=d,r[12]=f,r[13]=p):p=r[13],p},SubTrigger:r=>{let i=a(19),l,d,f,p,m;i[0]===r?(l=i[1],d=i[2],f=i[3],p=i[4],m=i[5]):({"data-slot":f,className:d,inset:p,children:l,...m}=r,i[0]=r,i[1]=l,i[2]=d,i[3]=f,i[4]=p,i[5]=m);let h;i[6]===f?h=i[7]:(h=t(f,`dropdown-menu-sub-trigger`),i[6]=f,i[7]=h);let g=p&&`pl-8`,_;i[8]!==d||i[9]!==g?(_=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`,`[&>[data-slot=dropdown-menu-sub-trigger-label]>svg]:size-5 [&_svg]:shrink-0`,g,d),i[8]=d,i[9]=g,i[10]=_):_=i[10];let v;i[11]===l?v=i[12]:(v=/* @__PURE__ */ o(c,{child:l,children:A}),i[11]=l,i[12]=v);let y;i[13]===Symbol.for(`react.memo_cache_sentinel`)?(y=/* @__PURE__ */ o(`span`,{className:`absolute right-2 flex items-center`,children:/* @__PURE__ */ o(n,{svg:/* @__PURE__ */ o(u,{weight:`bold`}),className:`size-4`})}),i[13]=y):y=i[13];let b;return i[14]!==m||i[15]!==h||i[16]!==_||i[17]!==v?(b=/* @__PURE__ */ s(C,{"data-slot":h,className:_,...m,children:[v,y]}),i[14]=m,i[15]=h,i[16]=_,i[17]=v,i[18]=b):b=i[18],b},Trigger:E};function A(e){return/* @__PURE__ */ o(`span`,{"data-slot":`dropdown-menu-sub-trigger-label`,className:`contents`,children:e})}function j(e){return/* @__PURE__ */ o(`span`,{"data-slot":`dropdown-menu-checkbox-item-label`,className:`contents`,children:e})}function M(e){return/* @__PURE__ */ o(`span`,{"data-slot":`dropdown-menu-radio-item-label`,className:`contents`,children:e})}export{k as t};
|
package/dist/dropdown-menu.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as DropdownMenu } from "./dropdown-menu-
|
|
2
|
-
import "./dropdown-menu-
|
|
1
|
+
import { t as DropdownMenu } from "./dropdown-menu-CpRsyt_F.js";
|
|
2
|
+
import "./dropdown-menu-CWUzGFgf.js";
|
|
3
3
|
export { DropdownMenu };
|
package/dist/dropdown-menu.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{t as DropdownMenu}from"./dropdown-menu-CutWQ0bl.js";
|
package/dist/empty.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
|
+
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
2
3
|
import { t as SvgAttributes } from "./icon-D1RY5Tcj.js";
|
|
3
4
|
import { ComponentProps, ReactNode } from "react";
|
|
4
5
|
//#region src/components/empty/empty.d.ts
|
|
@@ -20,13 +21,13 @@ import { ComponentProps, ReactNode } from "react";
|
|
|
20
21
|
* </Empty.Root>
|
|
21
22
|
* ```
|
|
22
23
|
*/
|
|
23
|
-
declare const Root: ({ asChild, children, className, ...props }: ComponentProps<"div"> & WithAsChild) => import("react").JSX.Element;
|
|
24
|
+
declare const Root: ({ "data-slot": dataSlot, asChild, children, className, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
24
25
|
type EmptyIconProps = Omit<SvgAttributes, "children"> & {
|
|
25
26
|
/**
|
|
26
27
|
* A single SVG icon element.
|
|
27
28
|
*/
|
|
28
29
|
svg: ReactNode;
|
|
29
|
-
};
|
|
30
|
+
} & WithDataSlot;
|
|
30
31
|
/**
|
|
31
32
|
* Renders a large icon for the empty state. Pass a single SVG icon element
|
|
32
33
|
* via the `svg` prop (e.g. from `@phosphor-icons/react`).
|
|
@@ -45,7 +46,7 @@ type EmptyIconProps = Omit<SvgAttributes, "children"> & {
|
|
|
45
46
|
* </Empty.Root>
|
|
46
47
|
* ```
|
|
47
48
|
*/
|
|
48
|
-
declare const Icon: ({ className, svg, ...props }: EmptyIconProps) => import("react").JSX.Element;
|
|
49
|
+
declare const Icon: ({ "data-slot": dataSlot, className, svg, ...props }: EmptyIconProps) => import("react").JSX.Element;
|
|
49
50
|
/**
|
|
50
51
|
* The heading text for the empty state. Renders as an `h3` by default. Use the
|
|
51
52
|
* `asChild` prop to render as a different heading level (e.g. `h1`, `h2`).
|
|
@@ -68,7 +69,7 @@ declare const Icon: ({ className, svg, ...props }: EmptyIconProps) => import("re
|
|
|
68
69
|
* </Empty.Title>
|
|
69
70
|
* ```
|
|
70
71
|
*/
|
|
71
|
-
declare const Title: ({ asChild, children, className, ...props }: ComponentProps<"h3"> & WithAsChild) => import("react").JSX.Element;
|
|
72
|
+
declare const Title: ({ "data-slot": dataSlot, asChild, children, className, ...props }: ComponentProps<"h3"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
72
73
|
/**
|
|
73
74
|
* Supporting descriptive text below the title. Renders as a `div` with
|
|
74
75
|
* `space-y-4` so multiple paragraphs can be placed inside. Use the `asChild`
|
|
@@ -93,7 +94,7 @@ declare const Title: ({ asChild, children, className, ...props }: ComponentProps
|
|
|
93
94
|
* </Empty.Description>
|
|
94
95
|
* ```
|
|
95
96
|
*/
|
|
96
|
-
declare const Description: ({ asChild, children, className, ...props }: ComponentProps<"div"> & WithAsChild) => import("react").JSX.Element;
|
|
97
|
+
declare const Description: ({ "data-slot": dataSlot, asChild, children, className, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
97
98
|
/**
|
|
98
99
|
* A container for action buttons or links in the empty state.
|
|
99
100
|
*
|
|
@@ -112,7 +113,7 @@ declare const Description: ({ asChild, children, className, ...props }: Componen
|
|
|
112
113
|
* </Empty.Root>
|
|
113
114
|
* ```
|
|
114
115
|
*/
|
|
115
|
-
declare const Actions: ({ asChild, children, className, ...props }: ComponentProps<"div"> & WithAsChild) => import("react").JSX.Element;
|
|
116
|
+
declare const Actions: ({ "data-slot": dataSlot, asChild, children, className, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
116
117
|
/**
|
|
117
118
|
* Compound component for rendering empty states. Use with `Empty.Root`,
|
|
118
119
|
* `Empty.Icon`, `Empty.Title`, `Empty.Description`, and `Empty.Actions`.
|
package/dist/empty.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-BudQMD2S.js";import{t as r}from"./slot-DdYN1L1C.js";import{c as i}from"react/compiler-runtime";import{jsx as a}from"react/jsx-runtime";const o={Root:n=>{let o=i(16),s,c,l,u,d;o[0]===n?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({"data-slot":u,asChild:s,children:c,className:l,...d}=n,o[0]=n,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?r:`div`,p;o[6]===u?p=o[7]:(p=t(u,`empty`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`mx-auto flex max-w-lg flex-col items-center p-6 text-center`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ a(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Icon:r=>{let o=i(14),s,c,l,u;o[0]===r?(s=o[1],c=o[2],l=o[3],u=o[4]):({"data-slot":c,className:s,svg:u,...l}=r,o[0]=r,o[1]=s,o[2]=c,o[3]=l,o[4]=u);let d;o[5]===c?d=o[6]:(d=t(c,`empty-icon`),o[5]=c,o[6]=d);let f;o[7]===s?f=o[8]:(f=e(`mb-1 size-10 text-neutral-400`,s),o[7]=s,o[8]=f);let p;return o[9]!==l||o[10]!==u||o[11]!==d||o[12]!==f?(p=/* @__PURE__ */ a(n,{"data-slot":d,className:f,svg:u,...l}),o[9]=l,o[10]=u,o[11]=d,o[12]=f,o[13]=p):p=o[13],p},Title:n=>{let o=i(16),s,c,l,u,d;o[0]===n?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({"data-slot":u,asChild:s,children:c,className:l,...d}=n,o[0]=n,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?r:`h3`,p;o[6]===u?p=o[7]:(p=t(u,`empty-title`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`text-strong text-sm font-medium font-sans`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ a(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Description:n=>{let o=i(16),s,c,l,u,d;o[0]===n?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({"data-slot":u,asChild:s,children:c,className:l,...d}=n,o[0]=n,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?r:`div`,p;o[6]===u?p=o[7]:(p=t(u,`empty-description`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`text-muted space-y-4 text-sm font-sans`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ a(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Actions:n=>{let o=i(16),s,c,l,u,d;o[0]===n?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({"data-slot":u,asChild:s,children:c,className:l,...d}=n,o[0]=n,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?r:`div`,p;o[6]===u?p=o[7]:(p=t(u,`empty-actions`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`mt-4 flex items-center gap-2`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ a(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h}};export{o as Empty};
|
package/dist/field.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
|
-
import {
|
|
2
|
+
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
3
|
+
import { i as IconButtonIntent, n as IconButtonProps, r as IconButtonAppearance } from "./button-DL7V4bzW.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 "./field-7QeiTFwl.js";
|
|
4
|
-
import { t as Label } from "./label-
|
|
5
|
-
import { t as Slot } from "./slot-
|
|
6
|
-
import { t as Popover } from "./popover-
|
|
5
|
+
import { t as Label } from "./label-C-KbNls8.js";
|
|
6
|
+
import { t as Slot } from "./slot-Q996Hqk9.js";
|
|
7
|
+
import { t as Popover } from "./popover-Dvls7-j4.js";
|
|
7
8
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
8
9
|
//#region src/components/field/field-context.d.ts
|
|
9
10
|
/**
|
|
@@ -69,7 +70,7 @@ type FieldErrorMessage = string | null | undefined | false;
|
|
|
69
70
|
* </Field.Set>
|
|
70
71
|
* ```
|
|
71
72
|
*/
|
|
72
|
-
declare const FieldSet: ({ className, ref, ...props }: ComponentProps<"fieldset">) => import("react").JSX.Element;
|
|
73
|
+
declare const FieldSet: ({ "data-slot": dataSlot, className, ref, ...props }: ComponentProps<"fieldset"> & WithDataSlot) => import("react").JSX.Element;
|
|
73
74
|
/**
|
|
74
75
|
* The caption for a `Field.Set`. Always renders a semantic `<legend>` styled
|
|
75
76
|
* to match the `Label` component so a fieldset reads like a section header,
|
|
@@ -180,7 +181,7 @@ declare const FieldLabel: ({ ref, ...props }: FieldLabelProps) => import("react"
|
|
|
180
181
|
* </Field.Item>
|
|
181
182
|
* ```
|
|
182
183
|
*/
|
|
183
|
-
declare const LabelText: ({ asChild, className, ref, ...props }: ComponentProps<"p"> & WithAsChild) => import("react").JSX.Element;
|
|
184
|
+
declare const LabelText: ({ "data-slot": dataSlot, asChild, className, ref, ...props }: ComponentProps<"p"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
184
185
|
/**
|
|
185
186
|
* Horizontal layout container for the label area of a field. Aligns a
|
|
186
187
|
* `<Field.Label>` (which may contain `Field.Optional`) with adjacent affordances
|
|
@@ -219,7 +220,7 @@ declare const LabelText: ({ asChild, className, ref, ...props }: ComponentProps<
|
|
|
219
220
|
* </Field.Group>
|
|
220
221
|
* ```
|
|
221
222
|
*/
|
|
222
|
-
declare const LabelRow: ({ asChild, className, ref, ...props }: ComponentProps<"div"> & WithAsChild) => import("react").JSX.Element;
|
|
223
|
+
declare const LabelRow: ({ "data-slot": dataSlot, asChild, className, ref, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
223
224
|
/**
|
|
224
225
|
* Props for the default help popover trigger. A contextual label is required
|
|
225
226
|
* so repeated help affordances do not all share the same accessible name.
|
|
@@ -316,7 +317,7 @@ declare const HelpTrigger: ({ appearance, className, icon, intent, label, ref, s
|
|
|
316
317
|
* </Field.Group>
|
|
317
318
|
* ```
|
|
318
319
|
*/
|
|
319
|
-
declare const HelpContent: ({ ref, ...props }: ComponentProps<typeof Popover.Content>) => import("react").JSX.Element;
|
|
320
|
+
declare const HelpContent: ({ "data-slot": dataSlot, ref, ...props }: ComponentProps<typeof Popover.Content> & WithDataSlot) => import("react").JSX.Element;
|
|
320
321
|
/**
|
|
321
322
|
* Inline "(Optional)" suffix to mark a field as optional. Defaults to the
|
|
322
323
|
* literal string `(Optional)` so the common case is `<Field.Optional />` with
|
|
@@ -352,7 +353,7 @@ declare const HelpContent: ({ ref, ...props }: ComponentProps<typeof Popover.Con
|
|
|
352
353
|
* </Field.Group>
|
|
353
354
|
* ```
|
|
354
355
|
*/
|
|
355
|
-
declare const Optional: ({ asChild, children, className, ref, ...props }: ComponentProps<"span"> & WithAsChild) => import("react").JSX.Element;
|
|
356
|
+
declare const Optional: ({ "data-slot": dataSlot, asChild, children, className, ref, ...props }: ComponentProps<"span"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
356
357
|
/**
|
|
357
358
|
* Layout container that stacks multiple `Field.Item`s vertically with
|
|
358
359
|
* `gap-4` between them. This is the default way to compose multiple fields
|
|
@@ -384,7 +385,7 @@ declare const Optional: ({ asChild, children, className, ref, ...props }: Compon
|
|
|
384
385
|
* </Field.Group>
|
|
385
386
|
* ```
|
|
386
387
|
*/
|
|
387
|
-
declare const Group: ({ asChild, className, ref, ...props }: ComponentProps<"div"> & WithAsChild) => import("react").JSX.Element;
|
|
388
|
+
declare const Group: ({ "data-slot": dataSlot, asChild, className, ref, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
388
389
|
/**
|
|
389
390
|
* Props for `Field.Item`.
|
|
390
391
|
*/
|
|
@@ -403,7 +404,7 @@ type FieldItemProps = Omit<ComponentProps<"div">, "id"> & WithAsChild & WithVali
|
|
|
403
404
|
* generated control id used by `Field.Label`'s `htmlFor`.
|
|
404
405
|
*/
|
|
405
406
|
name: string;
|
|
406
|
-
};
|
|
407
|
+
} & WithDataSlot;
|
|
407
408
|
/**
|
|
408
409
|
* A single form field — `Label`, a control (`Input`, `Select`, `Checkbox`,
|
|
409
410
|
* etc.), and any `Field.Description`, `Field.Errors`, or `Field.ErrorList` siblings stacked
|
|
@@ -460,7 +461,7 @@ type FieldItemProps = Omit<ComponentProps<"div">, "id"> & WithAsChild & WithVali
|
|
|
460
461
|
* </Field.Group>
|
|
461
462
|
* ```
|
|
462
463
|
*/
|
|
463
|
-
declare const Item: ({ asChild, children, className, id: idProp, name, ref, validation: validationProp, ...props }: FieldItemProps) => import("react").JSX.Element;
|
|
464
|
+
declare const Item: ({ "data-slot": dataSlot, asChild, children, className, id: idProp, name, ref, validation: validationProp, ...props }: FieldItemProps) => import("react").JSX.Element;
|
|
464
465
|
type FieldControlSlotProps = Omit<ComponentProps<typeof Slot>, "aria-describedby" | "aria-errormessage" | "aria-invalid" | "children" | "id">;
|
|
465
466
|
/**
|
|
466
467
|
* Element-child form of `Field.Control`. Renders via `Slot`, so it accepts
|
|
@@ -604,7 +605,7 @@ declare const Control: ({ children, ref, ...props }: FieldControlProps) => impor
|
|
|
604
605
|
* </Field.Group>
|
|
605
606
|
* ```
|
|
606
607
|
*/
|
|
607
|
-
declare const Description: ({ asChild, className, ref, ...props }: Omit<ComponentProps<"p">, "id"> & WithAsChild) => import("react").JSX.Element;
|
|
608
|
+
declare const Description: ({ "data-slot": dataSlot, asChild, className, ref, ...props }: Omit<ComponentProps<"p">, "id"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
|
|
608
609
|
/**
|
|
609
610
|
* A single error message list item for a field. Renders an `<li>` in
|
|
610
611
|
* `text-danger-600` so it stands out from a sibling `Field.Description`.
|
|
@@ -630,7 +631,7 @@ declare const Description: ({ asChild, className, ref, ...props }: Omit<Componen
|
|
|
630
631
|
* </Field.Group>
|
|
631
632
|
* ```
|
|
632
633
|
*/
|
|
633
|
-
declare const FieldErrorItem: ({ children, className, ref, ...props }: ComponentProps<"li">) => import("react").JSX.Element | null;
|
|
634
|
+
declare const FieldErrorItem: ({ "data-slot": dataSlot, children, className, ref, ...props }: ComponentProps<"li"> & WithDataSlot) => import("react").JSX.Element | null;
|
|
634
635
|
/**
|
|
635
636
|
* Props for the `Field.Errors` convenience renderer. It owns its generated
|
|
636
637
|
* children, so use `Field.ErrorList` / `Field.ErrorItem` directly when custom
|
|
@@ -728,7 +729,7 @@ declare const FieldErrors: ({ messages, ref, ...props }: FieldErrorsProps) => im
|
|
|
728
729
|
* </Field.Group>
|
|
729
730
|
* ```
|
|
730
731
|
*/
|
|
731
|
-
declare const FieldErrorList: ({ asChild, children, className, ref, ...props }: Omit<ComponentProps<"ul">, "id"> & WithAsChild) => import("react").JSX.Element | null;
|
|
732
|
+
declare const FieldErrorList: ({ "data-slot": dataSlot, asChild, children, className, ref, ...props }: Omit<ComponentProps<"ul">, "id"> & WithAsChild & WithDataSlot) => import("react").JSX.Element | null;
|
|
732
733
|
/**
|
|
733
734
|
* Compound component for semantic, accessible form fields. Composes a
|
|
734
735
|
* `Field.Label`, control (`Input`, `Select`, etc.), `Field.Description`, and
|
package/dist/field.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./cx-0HCjnNv1.js";import{t as n}from"./slot-BsvE2ntj.js";import{t as r}from"./button-pwkdtR3U.js";import{i,n as a,r as o,t as s}from"./field-Bpptk_9t.js";import{n as c,r as l,t as u}from"./field-B1wqeZr4.js";import{t as d}from"./label-BAy0Mg59.js";import{t as f}from"./popover-BJ5XNwzD.js";import{c as p}from"react/compiler-runtime";import{Children as m,Fragment as h,cloneElement as g,isValidElement as _,useContext as v,useId as y,useState as b}from"react";import x from"tiny-invariant";import{jsx as S}from"react/jsx-runtime";import{QuestionIcon as C}from"@phosphor-icons/react/Question";const w=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},T=e=>!(e==null||typeof e==`boolean`||typeof e==`string`&&e.trim().length===0),E=({children:e,errorItemType:t})=>{let n=!1;return m.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=T(e.props.children);return}if(e.type===h){n=E({children:e.props.children,errorItemType:t});return}n=!0}}),n},D=e=>{let n=p(10),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,ref:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===r?o=n[5]:(o=t(`flex w-full min-w-0 flex-col gap-4 border-0 p-0`,r),n[4]=r,n[5]=o);let s;return n[6]!==i||n[7]!==a||n[8]!==o?(s=S(`fieldset`,{ref:a,"data-slot":`field-set`,className:o,...i}),n[6]=i,n[7]=a,n[8]=o,n[9]=s):s=n[9],s},O=e=>{let n=p(10),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,ref:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===r?o=n[5]:(o=t(`text-strong mb-1.5 text-sm font-medium font-sans`,r),n[4]=r,n[5]=o);let s;return n[6]!==i||n[7]!==a||n[8]!==o?(s=S(`legend`,{ref:a,"data-slot":`field-legend`,className:o,...i}),n[6]=i,n[7]=a,n[8]=o,n[9]=s):s=n[9],s},k=e=>{let t=p(7),n,r;t[0]===e?(n=t[1],r=t[2]):({ref:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=v(c)?.controlId,a;return t[3]!==n||t[4]!==r||t[5]!==i?(a=S(d,{ref:r,...n,htmlFor:i}),t[3]=n,t[4]=r,t[5]=i,t[6]=a):a=t[6],a},A=e=>{let r=p(12),i,a,o,s;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4]):({asChild:i,className:a,ref:s,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c=i?n:`p`,l;r[5]===a?l=r[6]:(l=t(`text-strong text-sm font-medium font-sans`,a),r[5]=a,r[6]=l);let u;return r[7]!==c||r[8]!==o||r[9]!==s||r[10]!==l?(u=S(c,{ref:s,"data-slot":`field-label-text`,className:l,...o}),r[7]=c,r[8]=o,r[9]=s,r[10]=l,r[11]=u):u=r[11],u},j=e=>{let r=p(12),i,a,o,s;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4]):({asChild:i,className:a,ref:s,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c=i?n:`div`,l;r[5]===a?l=r[6]:(l=t(`flex items-center gap-1`,a),r[5]=a,r[6]=l);let u;return r[7]!==c||r[8]!==o||r[9]!==s||r[10]!==l?(u=S(c,{ref:s,"data-slot":`field-label-row`,className:l,...o}),r[7]=c,r[8]=o,r[9]=s,r[10]=l,r[11]=u):u=r[11],u},M=f.Root,N=S(C,{}),P=e=>{let n=p(22),i,a,o,s,c,l,u,d,m;n[0]===e?(i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7],d=n[8],m=n[9]):({appearance:c,className:i,icon:l,intent:u,label:a,ref:s,size:d,type:m,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=s,n[5]=c,n[6]=l,n[7]=u,n[8]=d,n[9]=m);let h=c===void 0?`ghost`:c,g=l===void 0?N:l,_=u===void 0?`neutral`:u,v=d===void 0?`xs`:d,y=m===void 0?`button`:m,b;n[10]===i?b=n[11]:(b=t(`text-body -my-0.5`,i),n[10]=i,n[11]=b);let x;return n[12]!==h||n[13]!==g||n[14]!==_||n[15]!==a||n[16]!==o||n[17]!==s||n[18]!==v||n[19]!==b||n[20]!==y?(x=S(f.Trigger,{asChild:!0,children:S(r,{ref:s,appearance:h,className:b,icon:g,intent:_,label:a,size:v,type:y,...o})}),n[12]=h,n[13]=g,n[14]=_,n[15]=a,n[16]=o,n[17]=s,n[18]=v,n[19]=b,n[20]=y,n[21]=x):x=n[21],x},F=e=>{let t=p(6),n,r;t[0]===e?(n=t[1],r=t[2]):({ref:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=S(f.Content,{ref:r,"data-slot":`field-help-content`,...n}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i},I=e=>{let r=p(14),i,a,o,s,c;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5]):({asChild:i,children:a,className:o,ref:c,...s}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c);let l=i?n:`span`,u;r[6]===o?u=r[7]:(u=t(`text-muted text-sm font-normal font-sans`,o),r[6]=o,r[7]=u);let d=a??`(Optional)`,f;return r[8]!==l||r[9]!==s||r[10]!==c||r[11]!==u||r[12]!==d?(f=S(l,{ref:c,"data-slot":`field-optional`,className:u,...s,children:d}),r[8]=l,r[9]=s,r[10]=c,r[11]=u,r[12]=d,r[13]=f):f=r[13],f},L=e=>{let r=p(12),i,a,o,s;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4]):({asChild:i,className:a,ref:s,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c=i?n:`div`,l;r[5]===a?l=r[6]:(l=t(`flex w-full flex-col gap-4`,a),r[5]=a,r[6]=l);let u;return r[7]!==c||r[8]!==o||r[9]!==s||r[10]!==l?(u=S(c,{ref:s,"data-slot":`field-group`,className:l,...o}),r[7]=c,r[8]=o,r[9]=s,r[10]=l,r[11]=u):u=r[11],u},R=e=>{let r=p(33),a,o,l,u,d,f,m,h;r[0]===e?(a=r[1],o=r[2],l=r[3],u=r[4],d=r[5],f=r[6],m=r[7],h=r[8]):({asChild:a,children:o,className:l,id:u,name:d,ref:m,validation:h,...f}=e,r[0]=e,r[1]=a,r[2]=o,r[3]=l,r[4]=u,r[5]=d,r[6]=f,r[7]=m,r[8]=h);let g=a?n:`div`,_=y(),v=u??_,x=y(),C=y(),[w,T]=b(!1),E=h??(w?`error`:void 0),D;r[9]===E?D=r[10]:(D=i(E),r[9]=E,r[10]=D);let O=D,k;r[11]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>(T(!0),()=>{T(!1)}),r[11]=k):k=r[11];let A=k,j;r[12]!==v||r[13]!==x||r[14]!==C||r[15]!==d||r[16]!==O?(j={controlId:v,descriptionId:x,errorId:C,name:d,registerError:A,validation:O},r[12]=v,r[13]=x,r[14]=C,r[15]=d,r[16]=O,r[17]=j):j=r[17];let M=j,N;r[18]===l?N=r[19]:(N=t(`flex w-full flex-col gap-1.5`,l),r[18]=l,r[19]=N);let P;r[20]!==g||r[21]!==o||r[22]!==f||r[23]!==m||r[24]!==N||r[25]!==O?(P=S(g,{ref:m,"data-slot":`field-item`,"data-validation":O,className:N,...f,children:o}),r[20]=g,r[21]=o,r[22]=f,r[23]=m,r[24]=N,r[25]=O,r[26]=P):P=r[26];let F;r[27]!==P||r[28]!==O?(F=S(s,{validation:O,children:P}),r[27]=P,r[28]=O,r[29]=F):F=r[29];let I;return r[30]!==M||r[31]!==F?(I=S(c.Provider,{value:M,children:F}),r[30]=M,r[31]=F,r[32]=I):I=r[32],I},z=e=>{let t=p(30),r,i,a;t[0]===e?(r=t[1],i=t[2],a=t[3]):({children:r,ref:a,...i}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a);let o=v(c),d,f,m,h,y,b,C,w,T;if(t[4]!==r||t[5]!==o||t[6]!==i||t[7]!==a){T=Symbol.for(`react.early_return_sentinel`);bb0:{let e=l({context:o});if(typeof r==`function`){T=S(s,{validation:e.validation,children:S(u.Provider,{value:o?e.ariaProps:null,children:r(e.ariaProps)})});break bb0}x(_(r),`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>.`),m=s,w=e.validation,f=u.Provider,C=o?e.ariaProps:null,d=n,h=a,y=i,b=g(r,e.ariaProps)}t[4]=r,t[5]=o,t[6]=i,t[7]=a,t[8]=d,t[9]=f,t[10]=m,t[11]=h,t[12]=y,t[13]=b,t[14]=C,t[15]=w,t[16]=T}else d=t[8],f=t[9],m=t[10],h=t[11],y=t[12],b=t[13],C=t[14],w=t[15],T=t[16];if(T!==Symbol.for(`react.early_return_sentinel`))return T;let E;t[17]!==d||t[18]!==h||t[19]!==y||t[20]!==b?(E=S(d,{ref:h,...y,children:b}),t[17]=d,t[18]=h,t[19]=y,t[20]=b,t[21]=E):E=t[21];let D;t[22]!==f||t[23]!==C||t[24]!==E?(D=S(f,{value:C,children:E}),t[22]=f,t[23]=C,t[24]=E,t[25]=D):D=t[25];let O;return t[26]!==m||t[27]!==w||t[28]!==D?(O=S(m,{validation:w,children:D}),t[26]=m,t[27]=w,t[28]=D,t[29]=O):O=t[29],O},B=e=>{let r=p(13),i,a,o,s;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4]):({asChild:i,className:a,ref:s,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let l=i?n:`p`,u=v(c)?.descriptionId,d;r[5]===a?d=r[6]:(d=t(`text-body text-sm leading-4`,`[:where([data-slot=field-error-list]+&)]:-mt-1.5`,a),r[5]=a,r[6]=d);let f;return r[7]!==l||r[8]!==o||r[9]!==s||r[10]!==u||r[11]!==d?(f=S(l,{ref:s,"data-slot":`field-description`,id:u,className:d,...o}),r[7]=l,r[8]=o,r[9]=s,r[10]=u,r[11]=d,r[12]=f):f=r[12],f},V=e=>{let n=p(12),r,i,a,o;if(n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({children:r,className:i,ref:o,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o),!T(r))return null;let s;n[5]===i?s=n[6]:(s=t(`text-danger-600 text-sm leading-4`,i),n[5]=i,n[6]=s);let c;return n[7]!==r||n[8]!==a||n[9]!==o||n[10]!==s?(c=S(`li`,{ref:o,"data-slot":`field-error`,className:s,...a,children:r}),n[7]=r,n[8]=a,n[9]=o,n[10]=s,n[11]=c):c=n[11],c},H=e=>{let t=p(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({messages:n,ref:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=w(n).map(G),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=S(U,{ref:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o},U=r=>{let i=p(21),a,o,s,l,u;i[0]===r?(a=i[1],o=i[2],s=i[3],l=i[4],u=i[5]):({asChild:a,children:o,className:s,ref:u,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=l,i[5]=u);let d;i[6]===o?d=i[7]:(d=E({children:o,errorItemType:V}),i[6]=o,i[7]=d);let f=d,m=v(c),h=m?.registerError,g,_;if(i[8]!==f||i[9]!==h?(g=()=>{if(f&&h!=null)return h()},_=[f,h],i[8]=f,i[9]=h,i[10]=g,i[11]=_):(g=i[10],_=i[11]),e(g,_),!f)return null;let y=a?n:`ul`,b=m?.errorId,x;i[12]===s?x=i[13]:(x=t(`m-0 flex w-full flex-col list-none p-0`,s),i[12]=s,i[13]=x);let C;return i[14]!==y||i[15]!==o||i[16]!==l||i[17]!==u||i[18]!==b||i[19]!==x?(C=S(y,{ref:u,"data-slot":`field-error-list`,id:b,role:`list`,className:x,...l,children:o}),i[14]=y,i[15]=o,i[16]=l,i[17]=u,i[18]=b,i[19]=x,i[20]=C):C=i[20],C},W={Item:R,Control:z,Group:L,Set:D,Legend:O,Label:k,LabelText:A,LabelRow:j,Help:M,HelpTrigger:P,HelpContent:F,Optional:I,Description:B,Errors:H,ErrorList:U,ErrorItem:V};function G(e){return S(V,{children:e},e)}const K=e=>w(e?.map(e=>typeof e==`string`||!e?e:e.message));export{W as Field,a as isAriaInvalid,o as parseValidation,i as resolveValidation,K as toErrorMessages};
|
|
1
|
+
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./slot-DdYN1L1C.js";import{t as i}from"./button-BMfUxs_j.js";import{i as a,n as o,r as s,t as c}from"./field-Bpptk_9t.js";import{n as l,r as u,t as d}from"./field-B1wqeZr4.js";import{t as f}from"./label-5T8i7I4X.js";import{t as p}from"./popover-oQDUvcZ2.js";import{c as m}from"react/compiler-runtime";import{Children as h,Fragment as g,cloneElement as _,isValidElement as v,useContext as y,useId as b,useState as x}from"react";import S from"tiny-invariant";import{jsx as C}from"react/jsx-runtime";import{QuestionIcon as w}from"@phosphor-icons/react/Question";const T=e=>{let t=[],n=/* @__PURE__ */ 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},E=e=>!(e==null||typeof e==`boolean`||typeof e==`string`&&e.trim().length===0),D=({children:e,errorItemType:t})=>{let n=!1;return h.forEach(e,e=>{n||e==null||typeof e==`boolean`||(typeof e==`string`?e.trim().length>0&&(n=!0):n=v(e)?e.type===t?E(e.props.children):e.type!==g||D({children:e.props.children,errorItemType:t}):!0)}),n},O=e=>{let r=m(14),i,a,o,s;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4]):({"data-slot":a,className:i,ref:s,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c;r[5]===a?c=r[6]:(c=n(a,`field-set`),r[5]=a,r[6]=c);let l;r[7]===i?l=r[8]:(l=t(`flex w-full min-w-0 flex-col gap-4 border-0 p-0`,i),r[7]=i,r[8]=l);let u;return r[9]!==o||r[10]!==s||r[11]!==c||r[12]!==l?(u=/* @__PURE__ */ C(`fieldset`,{ref:s,"data-slot":c,className:l,...o}),r[9]=o,r[10]=s,r[11]=c,r[12]=l,r[13]=u):u=r[13],u},k=e=>{let n=m(10),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,ref:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===r?o=n[5]:(o=t(`text-strong mb-1.5 text-sm font-medium font-sans`,r),n[4]=r,n[5]=o);let s;return n[6]!==i||n[7]!==a||n[8]!==o?(s=/* @__PURE__ */ C(`legend`,{ref:a,"data-slot":`field-legend`,className:o,...i}),n[6]=i,n[7]=a,n[8]=o,n[9]=s):s=n[9],s},A=e=>{let t=m(7),n,r;t[0]===e?(n=t[1],r=t[2]):({ref:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=y(l)?.controlId,a;return t[3]!==n||t[4]!==r||t[5]!==i?(a=/* @__PURE__ */ C(f,{ref:r,...n,htmlFor:i}),t[3]=n,t[4]=r,t[5]=i,t[6]=a):a=t[6],a},j=e=>{let i=m(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({"data-slot":s,asChild:a,className:o,ref:l,...c}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`p`,d;i[6]===s?d=i[7]:(d=n(s,`field-label-text`),i[6]=s,i[7]=d);let f;i[8]===o?f=i[9]:(f=t(`text-strong text-sm font-medium font-sans`,o),i[8]=o,i[9]=f);let p;return i[10]!==u||i[11]!==c||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ C(u,{ref:l,"data-slot":d,className:f,...c}),i[10]=u,i[11]=c,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},M=e=>{let i=m(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({"data-slot":s,asChild:a,className:o,ref:l,...c}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===s?d=i[7]:(d=n(s,`field-label-row`),i[6]=s,i[7]=d);let f;i[8]===o?f=i[9]:(f=t(`flex items-center gap-1`,o),i[8]=o,i[9]=f);let p;return i[10]!==u||i[11]!==c||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ C(u,{ref:l,"data-slot":d,className:f,...c}),i[10]=u,i[11]=c,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},N=p.Root,P=/* @__PURE__ */ C(w,{}),F=e=>{let n=m(22),r,a,o,s,c,l,u,d,f;n[0]===e?(r=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7],d=n[8],f=n[9]):({appearance:c,className:r,icon:l,intent:u,label:a,ref:s,size:d,type:f,...o}=e,n[0]=e,n[1]=r,n[2]=a,n[3]=o,n[4]=s,n[5]=c,n[6]=l,n[7]=u,n[8]=d,n[9]=f);let h=c===void 0?`ghost`:c,g=l===void 0?P:l,_=u===void 0?`neutral`:u,v=d===void 0?`xs`:d,y=f===void 0?`button`:f,b;n[10]===r?b=n[11]:(b=t(`text-body -my-0.5`,r),n[10]=r,n[11]=b);let x;return n[12]!==h||n[13]!==g||n[14]!==_||n[15]!==a||n[16]!==o||n[17]!==s||n[18]!==v||n[19]!==b||n[20]!==y?(x=/* @__PURE__ */ C(p.Trigger,{asChild:!0,children:/* @__PURE__ */ C(i,{ref:s,appearance:h,className:b,icon:g,intent:_,label:a,size:v,type:y,...o})}),n[12]=h,n[13]=g,n[14]=_,n[15]=a,n[16]=o,n[17]=s,n[18]=v,n[19]=b,n[20]=y,n[21]=x):x=n[21],x},I=e=>{let t=m(10),r,i,a;t[0]===e?(r=t[1],i=t[2],a=t[3]):({"data-slot":r,ref:a,...i}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a);let o;t[4]===r?o=t[5]:(o=n(r,`field-help-content`),t[4]=r,t[5]=o);let s;return t[6]!==i||t[7]!==a||t[8]!==o?(s=/* @__PURE__ */ C(p.Content,{ref:a,"data-slot":o,...i}),t[6]=i,t[7]=a,t[8]=o,t[9]=s):s=t[9],s},L=e=>{let i=m(18),a,o,s,c,l,u;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6]):({"data-slot":c,asChild:a,children:o,className:s,ref:u,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u);let d=a?r:`span`,f;i[7]===c?f=i[8]:(f=n(c,`field-optional`),i[7]=c,i[8]=f);let p;i[9]===s?p=i[10]:(p=t(`text-muted text-sm font-normal font-sans`,s),i[9]=s,i[10]=p);let h=o??`(Optional)`,g;return i[11]!==d||i[12]!==l||i[13]!==u||i[14]!==f||i[15]!==p||i[16]!==h?(g=/* @__PURE__ */ C(d,{ref:u,"data-slot":f,className:p,...l,children:h}),i[11]=d,i[12]=l,i[13]=u,i[14]=f,i[15]=p,i[16]=h,i[17]=g):g=i[17],g},R=e=>{let i=m(16),a,o,s,c,l;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5]):({"data-slot":s,asChild:a,className:o,ref:l,...c}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l);let u=a?r:`div`,d;i[6]===s?d=i[7]:(d=n(s,`field-group`),i[6]=s,i[7]=d);let f;i[8]===o?f=i[9]:(f=t(`flex w-full flex-col gap-4`,o),i[8]=o,i[9]=f);let p;return i[10]!==u||i[11]!==c||i[12]!==l||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ C(u,{ref:l,"data-slot":d,className:f,...c}),i[10]=u,i[11]=c,i[12]=l,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},z=e=>{let i=m(37),o,s,u,d,f,p,h,g,_;i[0]===e?(o=i[1],s=i[2],u=i[3],d=i[4],f=i[5],p=i[6],h=i[7],g=i[8],_=i[9]):({"data-slot":d,asChild:o,children:s,className:u,id:f,name:p,ref:g,validation:_,...h}=e,i[0]=e,i[1]=o,i[2]=s,i[3]=u,i[4]=d,i[5]=f,i[6]=p,i[7]=h,i[8]=g,i[9]=_);let v=o?r:`div`,y=b(),S=f??y,w=b(),T=b(),[E,D]=x(!1),O=_??(E?`error`:void 0),k;i[10]===O?k=i[11]:(k=a(O),i[10]=O,i[11]=k);let A=k,j;i[12]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>(D(!0),()=>{D(!1)}),i[12]=j):j=i[12];let M=j,N;i[13]!==S||i[14]!==w||i[15]!==T||i[16]!==p||i[17]!==A?(N={controlId:S,descriptionId:w,errorId:T,name:p,registerError:M,validation:A},i[13]=S,i[14]=w,i[15]=T,i[16]=p,i[17]=A,i[18]=N):N=i[18];let P=N,F;i[19]===d?F=i[20]:(F=n(d,`field-item`),i[19]=d,i[20]=F);let I;i[21]===u?I=i[22]:(I=t(`flex w-full flex-col gap-1.5`,u),i[21]=u,i[22]=I);let L;i[23]!==v||i[24]!==s||i[25]!==h||i[26]!==g||i[27]!==F||i[28]!==I||i[29]!==A?(L=/* @__PURE__ */ C(v,{ref:g,"data-slot":F,"data-validation":A,className:I,...h,children:s}),i[23]=v,i[24]=s,i[25]=h,i[26]=g,i[27]=F,i[28]=I,i[29]=A,i[30]=L):L=i[30];let R;i[31]!==L||i[32]!==A?(R=/* @__PURE__ */ C(c,{validation:A,children:L}),i[31]=L,i[32]=A,i[33]=R):R=i[33];let z;return i[34]!==P||i[35]!==R?(z=/* @__PURE__ */ C(l.Provider,{value:P,children:R}),i[34]=P,i[35]=R,i[36]=z):z=i[36],z},B=e=>{let t=m(30),n,i,a;t[0]===e?(n=t[1],i=t[2],a=t[3]):({children:n,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a);let o=y(l),s,f,p,h,g,b,x,w,T;if(t[4]!==n||t[5]!==o||t[6]!==i||t[7]!==a){T=Symbol.for(`react.early_return_sentinel`);bb0:{let e=u({context:o});if(typeof n==`function`){T=/* @__PURE__ */ C(c,{validation:e.validation,children:/* @__PURE__ */ C(d.Provider,{value:o?e.ariaProps:null,children:n(e.ariaProps)})});break bb0}S(v(n),`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>.`),p=c,w=e.validation,f=d.Provider,x=o?e.ariaProps:null,s=r,h=a,g=i,b=_(n,e.ariaProps)}t[4]=n,t[5]=o,t[6]=i,t[7]=a,t[8]=s,t[9]=f,t[10]=p,t[11]=h,t[12]=g,t[13]=b,t[14]=x,t[15]=w,t[16]=T}else s=t[8],f=t[9],p=t[10],h=t[11],g=t[12],b=t[13],x=t[14],w=t[15],T=t[16];if(T!==Symbol.for(`react.early_return_sentinel`))return T;let E;t[17]!==s||t[18]!==h||t[19]!==g||t[20]!==b?(E=/* @__PURE__ */ C(s,{ref:h,...g,children:b}),t[17]=s,t[18]=h,t[19]=g,t[20]=b,t[21]=E):E=t[21];let D;t[22]!==f||t[23]!==x||t[24]!==E?(D=/* @__PURE__ */ C(f,{value:x,children:E}),t[22]=f,t[23]=x,t[24]=E,t[25]=D):D=t[25];let O;return t[26]!==p||t[27]!==w||t[28]!==D?(O=/* @__PURE__ */ C(p,{validation:w,children:D}),t[26]=p,t[27]=w,t[28]=D,t[29]=O):O=t[29],O},V=e=>{let i=m(17),a,o,s,c,u;i[0]===e?(a=i[1],o=i[2],s=i[3],c=i[4],u=i[5]):({"data-slot":s,asChild:a,className:o,ref:u,...c}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=u);let d=a?r:`p`,f=y(l),p;i[6]===s?p=i[7]:(p=n(s,`field-description`),i[6]=s,i[7]=p);let h=f?.descriptionId,g;i[8]===o?g=i[9]:(g=t(`text-body text-sm leading-4`,`[:where([data-slot=field-error-list]+&)]:-mt-1.5`,o),i[8]=o,i[9]=g);let _;return i[10]!==d||i[11]!==c||i[12]!==u||i[13]!==p||i[14]!==h||i[15]!==g?(_=/* @__PURE__ */ C(d,{ref:u,"data-slot":p,id:h,className:g,...c}),i[10]=d,i[11]=c,i[12]=u,i[13]=p,i[14]=h,i[15]=g,i[16]=_):_=i[16],_},H=e=>{let r=m(16),i,a,o,s,c;if(r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5]):({"data-slot":o,children:i,className:a,ref:c,...s}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c),!E(i))return null;let l;r[6]===o?l=r[7]:(l=n(o,`field-error`),r[6]=o,r[7]=l);let u;r[8]===a?u=r[9]:(u=t(`text-danger-600 text-sm leading-4`,a),r[8]=a,r[9]=u);let d;return r[10]!==i||r[11]!==s||r[12]!==c||r[13]!==l||r[14]!==u?(d=/* @__PURE__ */ C(`li`,{ref:c,"data-slot":l,className:u,...s,children:i}),r[10]=i,r[11]=s,r[12]=c,r[13]=l,r[14]=u,r[15]=d):d=r[15],d},U=e=>{let t=m(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({messages:n,ref:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=T(n).map(K),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=/* @__PURE__ */ C(W,{ref:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o},W=i=>{let a=m(25),o,s,c,u,d,f;a[0]===i?(o=a[1],s=a[2],c=a[3],u=a[4],d=a[5],f=a[6]):({"data-slot":u,asChild:o,children:s,className:c,ref:f,...d}=i,a[0]=i,a[1]=o,a[2]=s,a[3]=c,a[4]=u,a[5]=d,a[6]=f);let p;a[7]===s?p=a[8]:(p=D({children:s,errorItemType:H}),a[7]=s,a[8]=p);let h=p,g=y(l),_=g?.registerError,v,b;if(a[9]!==h||a[10]!==_?(v=()=>{if(h&&_!=null)return _()},b=[h,_],a[9]=h,a[10]=_,a[11]=v,a[12]=b):(v=a[11],b=a[12]),e(v,b),!h)return null;let x=o?r:`ul`,S;a[13]===u?S=a[14]:(S=n(u,`field-error-list`),a[13]=u,a[14]=S);let w=g?.errorId,T;a[15]===c?T=a[16]:(T=t(`m-0 flex w-full flex-col list-none p-0`,c),a[15]=c,a[16]=T);let E;return a[17]!==x||a[18]!==s||a[19]!==d||a[20]!==f||a[21]!==S||a[22]!==w||a[23]!==T?(E=/* @__PURE__ */ C(x,{ref:f,"data-slot":S,id:w,role:`list`,className:T,...d,children:s}),a[17]=x,a[18]=s,a[19]=d,a[20]=f,a[21]=S,a[22]=w,a[23]=T,a[24]=E):E=a[24],E},G={Item:z,Control:B,Group:R,Set:O,Legend:k,Label:A,LabelText:j,LabelRow:M,Help:N,HelpTrigger:F,HelpContent:I,Optional:L,Description:V,Errors:U,ErrorList:W,ErrorItem:H};function K(e){return/* @__PURE__ */ C(H,{children:e},e)}const q=e=>T(e?.map(e=>typeof e==`string`||!e?e:e.message));export{G as Field,o as isAriaInvalid,s as parseValidation,a as resolveValidation,q as toErrorMessages};
|
package/dist/flag.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
1
2
|
import { ComponentProps } from "react";
|
|
2
3
|
//#region src/components/flag/country-code.d.ts
|
|
3
4
|
/** All valid values for a flag
|
|
@@ -38,7 +39,7 @@ type Props = Omit<ComponentProps<"div">, "children"> & {
|
|
|
38
39
|
* @default "lazy"
|
|
39
40
|
*/
|
|
40
41
|
loading?: ComponentProps<"img">["loading"];
|
|
41
|
-
};
|
|
42
|
+
} & WithDataSlot;
|
|
42
43
|
/**
|
|
43
44
|
* Renders a country flag from an [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
|
|
44
45
|
* country code, served as an SVG from ngrok's CDN. Inspired by
|
|
@@ -82,6 +83,6 @@ type Props = Omit<ComponentProps<"div">, "children"> & {
|
|
|
82
83
|
* </span>
|
|
83
84
|
* ```
|
|
84
85
|
*/
|
|
85
|
-
declare function Flag({ className, code, size, loading, ...props }: Props): import("react").JSX.Element;
|
|
86
|
+
declare function Flag({ "data-slot": dataSlot, className, code, size, loading, ...props }: Props): import("react").JSX.Element;
|
|
86
87
|
//#endregion
|
|
87
88
|
export { type CountryCode, Flag, type Props as FlagProps, countryCodes, isCountryCode };
|
package/dist/flag.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{c as n}from"react/compiler-runtime";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{cva as a}from"class-variance-authority";const o=a(``,{variants:{size:{s:`rounded-[0.0625rem]`,m:`rounded-[0.09375rem]`,l:`rounded-xs`}}}),s=a(``,{variants:{size:{s:`w-4 h-3`,m:`w-5 h-3.75`,l:`w-8 h-6`}}});function c(a){let c=n(31),l,u,d,f,p,m;c[0]===a?(l=c[1],u=c[2],d=c[3],f=c[4],p=c[5],m=c[6]):({"data-slot":d,className:l,code:u,size:p,loading:m,...f}=a,c[0]=a,c[1]=l,c[2]=u,c[3]=d,c[4]=f,c[5]=p,c[6]=m);let h=p===void 0?`l`:p,g=m===void 0?`lazy`:m,_,v,y,b,x;if(c[7]!==l||c[8]!==d||c[9]!==f||c[10]!==h){let n=o({size:h}),r=s({size:h});c[16]===d?y=c[17]:(y=t(d,`flag`),c[16]=d,c[17]=y),b=e(`flag relative overflow-hidden`,n,r,l),x=f,_=!0,v=e(`absolute inset-0 border border-[#000]/10`,n),c[7]=l,c[8]=d,c[9]=f,c[10]=h,c[11]=_,c[12]=v,c[13]=y,c[14]=b,c[15]=x}else _=c[11],v=c[12],y=c[13],b=c[14],x=c[15];let S;c[18]!==_||c[19]!==v?(S=/* @__PURE__ */ r(`div`,{"aria-hidden":_,className:v}),c[18]=_,c[19]=v,c[20]=S):S=c[20];let C=`https://assets.ngrok.com/flags/${h}/${u}.svg`,w=`flag for ${u}`,T;c[21]!==g||c[22]!==w||c[23]!==C?(T=/* @__PURE__ */ r(`img`,{className:`h-full w-full block object-cover`,src:C,alt:w,loading:g}),c[21]=g,c[22]=w,c[23]=C,c[24]=T):T=c[24];let E;return c[25]!==T||c[26]!==y||c[27]!==b||c[28]!==x||c[29]!==S?(E=/* @__PURE__ */ i(`div`,{"data-slot":y,className:b,...x,children:[S,T]}),c[25]=T,c[26]=y,c[27]=b,c[28]=x,c[29]=S,c[30]=E):E=c[30],E}const l=/* @__PURE__ */ `004.008.010.016.016.020.024.028.031.032.040.044.048.050.051.052.056.060.064.068.070.072.074.076.084.086.090.092.096.100.104.108.112.116.120.124.132.136.140.144.148.152.156.158.162.166.170.174.178.180.184.188.191.192.196.203.204.208.212.214.218.222.226.231.232.233.234.238.239.242.246.248.250.254.258.260.262.266.268.270.275.276.288.292.296.300.304.308.312.316.320.324.328.332.334.336.340.344.348.352.356.360.364.368.372.376.380.384.388.392.398.400.404.408.410.414.417.418.422.426.428.430.434.438.440.442.446.450.454.458.462.466.470.474.478.480.484.492.496.498.499.500.504.508.512.516.520.524.528.531.533.534.540.548.554.558.562.566.570.574.578.580.581.583.584.585.586.591.598.600.604.608.612.616.620.624.626.630.634.638.642.643.646.652.654.659.660.662.663.666.670.674.678.682.686.688.690.694.702.703.704.705.706.710.716.724.728.729.732.740.744.748.752.756.760.762.764.768.772.776.780.784.788.792.795.796.798.800.804.807.818.831.832.833.834.836.840.850.854.858.860.862.876.882.887.894.ABW.AD.AE.AF.AFG.AFRUN.AG.AGO.AI.AIA.AL.ALA.ALB.AM.AMS.AND.AO.AQ.AR.ARE.ARG.ARM.AS.ASM.AT.ATA.ATF.ATG.AU.AUS.AUT.AW.AX.AZ.AZE.BA.BB.BD.BDI.BE.BEL.BEN.BF.BFA.BG.BGD.BGR.BH.BHR.BHS.BI.BIH.BJ.BL.BLM.BLR.BLZ.BM.BMU.BN.BO.BOL.BQ-BO.BQ-SA.BQ-SE.BR.BRA.BRB.BRN.BS.BT.BTN.BV.BVT.BW.BWA.BY.BZ.CA.CAF.CAN.CC.CCK.CD.CF.CG.CH.CHE.CHL.CHN.CI.CIV.CK.CL.CM.CMR.CN.CO.COD.COG.COK.COL.COM.CPV.CR.CRI.CU.CUB.CUW.CV.CW.CX.CXR.CY.CYM.CYP.CZ.CZE.DE.DEU.DJ.DJI.DK.DM.DMA.DNK.DO.DOM.EC.ECU.EE.EG.EGY.EH.ER.ERI.ES.ESH.ESP.EST.ET.ETH.EU.FI.FIN.FJ.FJI.FK.FLK.FM.FO.FR.FRA.FRO.FSM.GA.GAB.GB-ENG.GB-NIR.GB-SCT.GB-UKM.GB-WLS.GB.GBR.GD.GE.GEO.GF.GG.GGY.GH.GHA.GI.GIB.GIN.GL.GLP.GM.GMB.GN.GNB.GNQ.GP.GQ.GR.GRC.GRD.GRL.GS.GT.GTM.GU.GUF.GUM.GUY.GW.GY.HK.HKG.HM.HMD.HN.HND.HR.HRV.HT.HTI.HU.HUN.ID.IDN.IE.IL.IM.IMN.IN.IND.IO.IOT.IQ.IR.IRL.IRN.IRQ.IS.ISL.ISR.IT.ITA.JAM.JE.JEY.JM.JO.JOR.JP.JPN.KAZ.KE.KEN.KG.KGZ.KH.KHM.KI.KIR.KM.KN-SK.KNA.KOR.KP.KR.KW.KWT.KY.KZ.LA.LAO.LB.LBN.LBR.LBY.LC.LCA.LI.LIE.LK.LKA.LR.LS.LSO.LT.LTU.LU.LUX.LV.LVA.LY.MA.MAC.MAF.MAR.MC.MCO.MD.MDA.MDG.MDV.ME.MEX.MF.MG.MH.MHL.MK.MKD.ML.MLI.MLT.MM.MMR.MN.MNE.MNG.MNP.MO.MOZ.MP.MQ.MR.MRT.MS.MSR.MT.MTQ.MU.MUS.MV.MW.MWI.MX.MY.MYS.MZ.NA.NAM.NC.NCL.NE.NER.NF.NFK.NG.NGA.NI.NIC.NIU.NL.NLD.NO.NOR.NP.NPL.NR.NRU.NU.NZ.NZL.OM.OMN.PA.PAK.PAN.PCN.PE.PER.PF.PG.PH.PHL.PK.PL.PLW.PM.PN.PNG.POL.PR.PRI.PRK.PRT.PRY.PS.PSE.PT.PW.PY.PYF.QA.QAT.RAINBOW.RE.REU.RO.ROU.RS.RU.RUS.RW.RWA.SA.SAU.SB.SC.SD.SDN.SE.SEN.SG.SGP.SGS.SH.SHN.SI.SJ.SJM.SK.SL.SLB.SLE.SLV.SM.SMR.SN.SO.SOM.SPM.SR.SRB.SS.SSD.ST.STP.SUR.SV.SVK.SVN.SWE.SWZ.SX.SXM.SY.SYC.SYR.SZ.TC.TCA.TCD.TD.TF.TG.TGO.TH.THA.TJ.TJK.TK.TKL.TKM.TL.TLS.TM.TN.TO.TON.TR.TT.TTO.TUN.TUR.TUV.TV.TW.TWN.TZ.TZA.UA.UG.UGA.UKR.UM.UMI.UNASUR.URY.US.USA.UY.UZ.UZB.VA.VAT.VC.VCT.VE.VEN.VG.VGB.VI.VIR.VN.VNM.VU.VUT.WF.WLF.WS.WSM.YE.YEM.ZA.ZAF.ZM.ZMB.ZW.ZWE`.split(`.`),u=new Set(l);function d(e){return typeof e==`string`&&u.has(e)}export{c as Flag,l as countryCodes,d as isCountryCode};
|
package/dist/hooks.d.ts
CHANGED
|
@@ -268,6 +268,10 @@ declare function useDebouncedCallback<T extends (...args: unknown[]) => unknown>
|
|
|
268
268
|
* localStorage): render a same-size placeholder until hydration so the real
|
|
269
269
|
* UI mounts exactly once, with the real client-side values.
|
|
270
270
|
*
|
|
271
|
+
* To gate a CSS transition on a post-hydration state correction, use
|
|
272
|
+
* `useIsHydratedAfterPaint` instead. This hook flips in the same commit as
|
|
273
|
+
* the correction, so the transition runs.
|
|
274
|
+
*
|
|
271
275
|
* @example
|
|
272
276
|
* ```tsx
|
|
273
277
|
* function PreferencesPanel() {
|
|
@@ -279,6 +283,37 @@ declare function useDebouncedCallback<T extends (...args: unknown[]) => unknown>
|
|
|
279
283
|
*/
|
|
280
284
|
declare function useIsHydrated(): boolean;
|
|
281
285
|
//#endregion
|
|
286
|
+
//#region src/hooks/use-is-hydrated-after-paint.d.ts
|
|
287
|
+
/**
|
|
288
|
+
* Returns `false` on the server, in the hydration render, and in the mount
|
|
289
|
+
* commit, then `true` from the next animation frame.
|
|
290
|
+
*
|
|
291
|
+
* Use it to gate a CSS transition that must not run on a post-hydration
|
|
292
|
+
* state correction. `useIsHydrated` flips in the hydration commit. A
|
|
293
|
+
* `useLocalStorage` or any other `useSyncExternalStore` correction lands in
|
|
294
|
+
* that same commit. CSS starts a transition from the commit's after-change
|
|
295
|
+
* style, so the transition runs. One frame later the correction has painted,
|
|
296
|
+
* so a gate keyed on this result opens on settled values. For every other
|
|
297
|
+
* client-only branch, `useIsHydrated` is the right hook: it costs no extra
|
|
298
|
+
* render.
|
|
299
|
+
*
|
|
300
|
+
* @example
|
|
301
|
+
* ```tsx
|
|
302
|
+
* function Panel({ open }: { open: boolean }) {
|
|
303
|
+
* const isHydrated = useIsHydratedAfterPaint();
|
|
304
|
+
* // A persisted-collapsed `open` snaps on load and animates on every later toggle.
|
|
305
|
+
* return (
|
|
306
|
+
* <div
|
|
307
|
+
* data-state={open ? "expanded" : "collapsed"}
|
|
308
|
+
* data-hydrated={isHydrated ? "" : undefined}
|
|
309
|
+
* className="w-52 transition-[width] data-[state=collapsed]:w-13 not-data-hydrated:transition-none"
|
|
310
|
+
* />
|
|
311
|
+
* );
|
|
312
|
+
* }
|
|
313
|
+
* ```
|
|
314
|
+
*/
|
|
315
|
+
declare function useIsHydratedAfterPaint(): boolean;
|
|
316
|
+
//#endregion
|
|
282
317
|
//#region src/hooks/use-isomorphic-layout-effect.d.ts
|
|
283
318
|
/**
|
|
284
319
|
* A drop-in replacement for `useLayoutEffect` that does not warn during
|
|
@@ -680,4 +715,4 @@ type UseUndoRedoReturn<T> = {
|
|
|
680
715
|
*/
|
|
681
716
|
declare function useUndoRedo<T extends NonNullable<unknown>>(): UseUndoRedoReturn<T>;
|
|
682
717
|
//#endregion
|
|
683
|
-
export { type Breakpoint, type TailwindBreakpoint, type UseInViewOptions, type UseUndoRedoReturn, breakpoints, useBreakpoint, useCallbackRef, useComposedRefs, useCopyToClipboard, useDebounce, useDebouncedCallback, useInView, useIsBelowBreakpoint, useIsHydrated, useLocalStorage, useSessionStorage, useUndoRedo };
|
|
718
|
+
export { type Breakpoint, type TailwindBreakpoint, type UseInViewOptions, type UseUndoRedoReturn, breakpoints, useBreakpoint, useCallbackRef, useComposedRefs, useCopyToClipboard, useDebounce, useDebouncedCallback, useInView, useIsBelowBreakpoint, useIsHydrated, useIsHydratedAfterPaint, useLocalStorage, useSessionStorage, useUndoRedo };
|
package/dist/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./use-is-hydrated-
|
|
1
|
+
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./use-is-hydrated-after-paint-r9Cl2mGp.js";import{t as r}from"./use-is-hydrated-DDCqXmju.js";import{t as i}from"./use-copy-to-clipboard-ByLT8veV.js";import{t as a}from"./use-callback-ref-BvVyI5K1.js";import{t as o}from"./use-matches-media-query-m860lols.js";import{n as s,t as c}from"./use-prefers-reduced-motion-Cj9tJ181.js";import{n as l,r as u,t as d}from"./use-breakpoint--mo7kr9d.js";import{t as f}from"./in-view-Dxv_GrUU.js";import{c as p}from"react/compiler-runtime";import{useEffect as m,useRef as h,useState as g,useSyncExternalStore as _}from"react";function v(e,t){let n=p(4),[r,i]=g(e),a,o;return n[0]!==t.waitMs||n[1]!==e?(a=()=>{let n=window.setTimeout(()=>{i(e)},t.waitMs);return()=>{window.clearTimeout(n)}},o=[e,t.waitMs],n[0]=t.waitMs,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),m(a,o),r}function y(e,t){let n=p(5),r=a(e),i=h(0),o,s;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>()=>window.clearTimeout(i.current),s=[],n[0]=o,n[1]=s):(o=n[0],s=n[1]),m(o,s);let c;return n[2]!==t.waitMs||n[3]!==r?(c=(...e)=>{let n=e;window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(...n),t.waitMs)},n[2]=t.waitMs,n[3]=r,n[4]=c):c=n[4],c}const b=/* @__PURE__ */ new Map;function x(e){e.key==null?b.clear():b.has(e.key)&&(e.newValue==null?b.delete(e.key):b.set(e.key,e.newValue))}function S(){try{return window.localStorage}catch{return null}}function C(e){return function(t){function n(n){let r=n.storageArea==null||n.storageArea===S(),i=n.key==null||n.key===e;r&&i&&(x(n),t())}return window.addEventListener(`storage`,n),()=>{window.removeEventListener(`storage`,n)}}}function w(){return null}function T(e){let t=b.get(e);if(t!=null)return t;try{return window.localStorage.getItem(e)}catch{return null}}function E(e,t){try{window.localStorage.setItem(e,t),b.delete(e)}catch{b.set(e,t)}}function D(e,t){try{let n=JSON.parse(e);return typeof n==`string`?n:t}catch{return t}}function O(e,t){let n=p(12),r;n[0]===e?r=n[1]:(r=C(e),n[0]=e,n[1]=r);let i=r,a;n[2]===e?a=n[3]:(a=()=>T(e),n[2]=e,n[3]=a);let o=_(i,a,w),s;n[4]!==t||n[5]!==o?(s=o==null?t:D(o,t),n[4]=t,n[5]=o,n[6]=s):s=n[6];let c=s,l;n[7]===e?l=n[8]:(l=t=>{let n=JSON.stringify(t);E(e,n),window.dispatchEvent(new StorageEvent(`storage`,{key:e,newValue:n,storageArea:S()}))},n[7]=e,n[8]=l);let u=l,d;return n[9]!==u||n[10]!==c?(d=[c,u],n[9]=u,n[10]=c,n[11]=d):d=n[11],d}const k=/* @__PURE__ */ new Map;function A(e){e.key==null?k.clear():k.has(e.key)&&(e.newValue==null?k.delete(e.key):k.set(e.key,e.newValue))}function j(){try{return window.sessionStorage}catch{return null}}function M(e){return function(t){function n(n){let r=n.storageArea==null||n.storageArea===j(),i=n.key==null||n.key===e;r&&i&&(A(n),t())}return window.addEventListener(`storage`,n),()=>{window.removeEventListener(`storage`,n)}}}function N(){return null}function P(e){let t=k.get(e);if(t!=null)return t;try{return window.sessionStorage.getItem(e)}catch{return null}}function F(e,t){try{window.sessionStorage.setItem(e,t),k.delete(e)}catch{k.set(e,t)}}function I(e,t){try{let n=JSON.parse(e);return typeof n==`string`?n:t}catch{return t}}function L(e,t){let n=p(12),r;n[0]===e?r=n[1]:(r=M(e),n[0]=e,n[1]=r);let i=r,a;n[2]===e?a=n[3]:(a=()=>P(e),n[2]=e,n[3]=a);let o=_(i,a,N),s;n[4]!==t||n[5]!==o?(s=o==null?t:I(o,t),n[4]=t,n[5]=o,n[6]=s):s=n[6];let c=s,l;n[7]===e?l=n[8]:(l=t=>{let n=JSON.stringify(t);F(e,n),window.dispatchEvent(new StorageEvent(`storage`,{key:e,newValue:n,storageArea:j()}))},n[7]=e,n[8]=l);let u=l,d;return n[9]!==u||n[10]!==c?(d=[c,u],n[9]=u,n[10]=c,n[11]=d):d=n[11],d}function R(){return s()?`auto`:`smooth`}function z(e,t){let n=p(14),r;n[0]===t?r=n[1]:(r=t===void 0?{}:t,n[0]=t,n[1]=r);let{root:i,margin:a,amount:o,once:s,initial:c}=r,l=s!==void 0&&s,u=c!==void 0&&c,[d,_]=g(u),v=h(u),y;n[2]!==o||n[3]!==a||n[4]!==l||n[5]!==e||n[6]!==i?.current?(y=()=>{let t=e.current;if(t==null||l&&v.current)return;let n=function(){if(v.current=!0,_(!0),!l)return()=>{v.current=!1,_(!1)}},r={root:i?.current??void 0,margin:a,amount:o};return f(t,n,r)},n[2]=o,n[3]=a,n[4]=l,n[5]=e,n[6]=i?.current,n[7]=y):y=n[7];let b;return n[8]!==o||n[9]!==a||n[10]!==l||n[11]!==e||n[12]!==i?(b=[i,e,a,l,o],n[8]=o,n[9]=a,n[10]=l,n[11]=e,n[12]=i,n[13]=b):b=n[13],m(y,b),d}function B(){let e=p(9),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let n=h(t),r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],e[1]=r):r=e[1];let i=h(r),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={undo:0,redo:0},e[2]=a):a=e[2];let[o,s]=g(a),c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>{n.current.push(e),i.current=[],s({undo:n.current.length,redo:0})},e[3]=c):c=e[3];let l=c,u;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{let t=n.current[n.current.length-1];if(t!==void 0)return n.current.pop(),i.current.push(e),s({undo:n.current.length,redo:i.current.length}),t},e[4]=u):u=e[4];let d=u,f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{let t=i.current[i.current.length-1];if(t!==void 0)return i.current.pop(),n.current.push(e),s({undo:n.current.length,redo:i.current.length}),t},e[5]=f):f=e[5];let m=f,_=o.undo>0,v=o.redo>0,y;return e[6]!==v||e[7]!==_?(y={canUndo:_,canRedo:v,push:l,undo:d,redo:m},e[6]=v,e[7]=_,e[8]=y):y=e[8],y}export{d as breakpoints,c as getPrefersReducedMotion,l as useBreakpoint,a as useCallbackRef,t as useComposedRefs,i as useCopyToClipboard,v as useDebounce,y as useDebouncedCallback,z as useInView,u as useIsBelowBreakpoint,r as useIsHydrated,n as useIsHydratedAfterPaint,e as useIsomorphicLayoutEffect,O as useLocalStorage,o as useMatchesMediaQuery,s as usePrefersReducedMotion,R as useScrollBehavior,L as useSessionStorage,B as useUndoRedo};
|
package/dist/hover-card.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
1
2
|
import { ComponentProps } from "react";
|
|
2
3
|
import { Arrow, Content, Portal, Root, Trigger } from "@radix-ui/react-hover-card";
|
|
3
4
|
//#region src/components/hover-card/hover-card.d.ts
|
|
@@ -48,7 +49,7 @@ declare const Root$1: ({ closeDelay, openDelay, ...props }: ComponentProps<typeo
|
|
|
48
49
|
* </HoverCard.Root>
|
|
49
50
|
* ```
|
|
50
51
|
*/
|
|
51
|
-
declare const Trigger$1: (props: ComponentProps<typeof Trigger>) => import("react").JSX.Element;
|
|
52
|
+
declare const Trigger$1: ({ "data-slot": dataSlot, ...props }: ComponentProps<typeof Trigger> & WithDataSlot) => import("react").JSX.Element;
|
|
52
53
|
/**
|
|
53
54
|
* The portal container for rendering hover card content outside the normal DOM tree.
|
|
54
55
|
* `HoverCard.Content` already renders inside this portal internally, so you typically
|
|
@@ -108,8 +109,8 @@ declare const Portal$1: ({ container, ...props }: ComponentProps<typeof Portal>)
|
|
|
108
109
|
* </HoverCard.Root>
|
|
109
110
|
* ```
|
|
110
111
|
*/
|
|
111
|
-
declare const Content$1: ({ className, onClick, align, sideOffset, ...props }: ComponentProps<typeof Content>) => import("react").JSX.Element;
|
|
112
|
-
type HoverCardArrowProps = Omit<ComponentProps<typeof Arrow>, "asChild" | "children"
|
|
112
|
+
declare const Content$1: ({ "data-slot": dataSlot, className, onClick, align, sideOffset, ...props }: ComponentProps<typeof Content> & WithDataSlot) => import("react").JSX.Element;
|
|
113
|
+
type HoverCardArrowProps = Omit<ComponentProps<typeof Arrow>, "asChild" | "children"> & WithDataSlot;
|
|
113
114
|
/**
|
|
114
115
|
* An optional tip that points from `HoverCard.Content` at its trigger. Render it
|
|
115
116
|
* as a child of `HoverCard.Content`. Radix positions it with floating-ui's arrow
|
|
@@ -133,7 +134,7 @@ type HoverCardArrowProps = Omit<ComponentProps<typeof Arrow>, "asChild" | "child
|
|
|
133
134
|
* </HoverCard.Root>
|
|
134
135
|
* ```
|
|
135
136
|
*/
|
|
136
|
-
declare const Arrow$1: ({ className, height, width, ...props }: HoverCardArrowProps) => import("react").JSX.Element;
|
|
137
|
+
declare const Arrow$1: ({ "data-slot": dataSlot, className, height, width, ...props }: HoverCardArrowProps) => import("react").JSX.Element;
|
|
137
138
|
/**
|
|
138
139
|
* A floating card that appears when a user hovers over a trigger element.
|
|
139
140
|
*
|