@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./slot-DdYN1L1C.js";import{t}from"./booleanish-BfvnW6vy.js";import{n,r}from"./layer-container-DLf-6eBz.js";import{c as i}from"react/compiler-runtime";import{jsx as a}from"react/jsx-runtime";import{Close as o,Content as s,Description as c,Overlay as l,Portal as u,Root as d,Title as f,Trigger as p,createDialogScope as m}from"@radix-ui/react-dialog";function h(e){e.target instanceof Element&&e.target.closest(`.overlay-prompt`)&&e.preventDefault()}const g=d,_=p,v=e=>{let t=i(9),o,s;t[0]===e?(o=t[1],s=t[2]):({container:o,...s}=e,t[0]=e,t[1]=o,t[2]=s);let c=r(),l=o??c,d;t[3]!==s||t[4]!==l?(d=/* @__PURE__ */ a(u,{container:l,...s}),t[3]=s,t[4]=l,t[5]=d):d=t[5];let f;return t[6]!==l||t[7]!==d?(f=/* @__PURE__ */ a(n.Provider,{value:l,children:d}),t[6]=l,t[7]=d,t[8]=f):f=t[8],f},y=o,b=e=>{let t=i(2),n;return t[0]===e?n=t[1]:(n=/* @__PURE__ */ a(l,{"data-overlay":!0,...e}),t[0]=e,t[1]=n),n},x=e=>{let t=i(18),n,r,o,c,l;t[0]===e?(n=t[1],r=t[2],o=t[3],c=t[4],l=t[5]):({onEscapeKeyDown:n,onInteractOutside:r,onPointerDownOutside:o,ref:l,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=c,t[5]=l);let u;t[6]===n?u=t[7]:(u=e=>{T(e),n?.(e)},t[6]=n,t[7]=u);let d;t[8]===r?d=t[9]:(d=e=>{h(e),r?.(e)},t[8]=r,t[9]=d);let f;t[10]===o?f=t[11]:(f=e=>{h(e),o?.(e)},t[10]=o,t[11]=f);let p;return t[12]!==c||t[13]!==l||t[14]!==u||t[15]!==d||t[16]!==f?(p=/* @__PURE__ */ a(s,{ref:l,onEscapeKeyDown:u,onInteractOutside:d,onPointerDownOutside:f,...c}),t[12]=c,t[13]=l,t[14]=u,t[15]=d,t[16]=f,t[17]=p):p=t[17],p},S=f,C=t=>{let n=i(12),r,o,s,l;n[0]===t?(r=n[1],o=n[2],s=n[3],l=n[4]):({asChild:r,children:o,ref:l,...s}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=s,n[4]=l);let u=r?e:`div`,d;n[5]!==u||n[6]!==o?(d=/* @__PURE__ */ a(u,{children:o}),n[5]=u,n[6]=o,n[7]=d):d=n[7];let f;return n[8]!==s||n[9]!==l||n[10]!==d?(f=/* @__PURE__ */ a(c,{ref:l,asChild:!0,...s,children:d}),n[8]=s,n[9]=l,n[10]=d,n[11]=f):f=n[11],f};function w(e){return e instanceof HTMLElement&&e.hasAttribute(`data-overlay`)}function T(e){if(!k(e.currentTarget))return;let n=e.currentTarget,r=n instanceof Document?n.activeElement:n.ownerDocument?.activeElement??null,i=E(e.target)??E(r),a=i?D(i):null;i!=null&&t(i.getAttribute(`aria-expanded`))&&a!=null&&n.contains(i)&&n.contains(a)&&(a.getAttribute(`data-open`)===`true`||a.getAttribute(`data-state`)===`open`)&&e.preventDefault()}function E(e){return O(e)?e.closest(`[aria-expanded='true'][aria-controls]`):null}function D(e){let t=e.getAttribute(`aria-controls`);if(!t)return null;let n=e.ownerDocument.getElementById(t);return n instanceof HTMLElement?n:null}function O(e){return e instanceof HTMLElement}function k(e){return e instanceof Node&&`querySelector`in e}export{v as a,_ as c,b as i,m as l,x as n,g as o,C as r,S as s,y as t,w as u};
|
package/dist/progress.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
1
2
|
import { ComponentProps, HTMLAttributes } from "react";
|
|
2
3
|
import { Indicator } from "@radix-ui/react-progress";
|
|
3
4
|
//#region src/components/progress/types.d.ts
|
|
@@ -41,7 +42,7 @@ type Props = SvgAttributes & {
|
|
|
41
42
|
* @default `animation-duration-[15s]`
|
|
42
43
|
*/
|
|
43
44
|
indeterminateRotationSpeed?: `animation-duration-${string}`;
|
|
44
|
-
};
|
|
45
|
+
} & WithDataSlot;
|
|
45
46
|
/**
|
|
46
47
|
* A simple circular progress bar which shows the completion progress of a task.
|
|
47
48
|
*
|
|
@@ -73,8 +74,8 @@ type Props = SvgAttributes & {
|
|
|
73
74
|
* </ProgressDonut.Root>
|
|
74
75
|
* ```
|
|
75
76
|
*/
|
|
76
|
-
declare const Root$2: ({ children, className, max: _max, strokeWidth: _strokeWidth, value: _value, indeterminateRotationSpeed, ...props }: Props) => import("react").JSX.Element;
|
|
77
|
-
type ProgressDonutIndicatorProps = Omit<ComponentProps<"g">, "children"
|
|
77
|
+
declare const Root$2: ({ "data-slot": dataSlot, children, className, max: _max, strokeWidth: _strokeWidth, value: _value, indeterminateRotationSpeed, ...props }: Props) => import("react").JSX.Element;
|
|
78
|
+
type ProgressDonutIndicatorProps = Omit<ComponentProps<"g">, "children"> & WithDataSlot;
|
|
78
79
|
/**
|
|
79
80
|
* The indicator for the circular progress bar.
|
|
80
81
|
*
|
|
@@ -91,7 +92,7 @@ type ProgressDonutIndicatorProps = Omit<ComponentProps<"g">, "children">;
|
|
|
91
92
|
* </ProgressDonut.Root>
|
|
92
93
|
* ```
|
|
93
94
|
*/
|
|
94
|
-
declare const Indicator$2: ({ className, ...props }: ProgressDonutIndicatorProps) => import("react").JSX.Element;
|
|
95
|
+
declare const Indicator$2: ({ "data-slot": dataSlot, className, ...props }: ProgressDonutIndicatorProps) => import("react").JSX.Element;
|
|
95
96
|
/**
|
|
96
97
|
* A simple circular progress bar which shows the completion progress of a task.
|
|
97
98
|
*
|
|
@@ -183,7 +184,7 @@ type RootProps = ComponentProps<"div"> & {
|
|
|
183
184
|
* @default 0
|
|
184
185
|
*/
|
|
185
186
|
value?: ValueType | undefined;
|
|
186
|
-
};
|
|
187
|
+
} & WithDataSlot;
|
|
187
188
|
/**
|
|
188
189
|
* Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.
|
|
189
190
|
*
|
|
@@ -220,8 +221,8 @@ type RootProps = ComponentProps<"div"> & {
|
|
|
220
221
|
* </ProgressBar.Root>
|
|
221
222
|
* ```
|
|
222
223
|
*/
|
|
223
|
-
declare function Root$1({ className, children, max: _max, value: _value, ...props }: RootProps): import("react").JSX.Element;
|
|
224
|
-
type IndicatorProps = ComponentProps<typeof Indicator
|
|
224
|
+
declare function Root$1({ "data-slot": dataSlot, className, children, max: _max, value: _value, ...props }: RootProps): import("react").JSX.Element;
|
|
225
|
+
type IndicatorProps = ComponentProps<typeof Indicator> & WithDataSlot;
|
|
225
226
|
/**
|
|
226
227
|
* Displays the progress indicator, which visually represents the completion progress of a task.
|
|
227
228
|
*
|
|
@@ -242,7 +243,7 @@ type IndicatorProps = ComponentProps<typeof Indicator>;
|
|
|
242
243
|
* </ProgressBar.Root>
|
|
243
244
|
* ```
|
|
244
245
|
*/
|
|
245
|
-
declare function Indicator$1({ className, style, ...props }: IndicatorProps): import("react").JSX.Element;
|
|
246
|
+
declare function Indicator$1({ "data-slot": dataSlot, className, style, ...props }: IndicatorProps): import("react").JSX.Element;
|
|
246
247
|
/**
|
|
247
248
|
* Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.
|
|
248
249
|
*
|
package/dist/progress.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"./css-properties-D85fCNV3.js";import{t as r}from"./clsx-DUGZgXfJ.js";import{c as i}from"react/compiler-runtime";import{createContext as a,useContext as o,useId as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{Indicator as u,Root as d}from"@radix-ui/react-progress";function f(e,{min:t,max:n}){return Math.min(n,Math.max(t,e))}function p(e){return typeof e==`number`}function m(e,t){return p(e)&&!Number.isNaN(e)&&e<=t&&e>=0}function h(e){return p(e)&&!Number.isNaN(e)&&e>0}const g={max:100,strokeWidth:`0.25rem`,value:0},_=a(g),v={Root:r=>{let a=i(40),o,s,u,d,f,v,x,S;a[0]===r?(o=a[1],s=a[2],u=a[3],d=a[4],f=a[5],v=a[6],x=a[7],S=a[8]):({"data-slot":d,children:s,className:u,max:x,strokeWidth:S,value:o,indeterminateRotationSpeed:f,...v}=r,a[0]=r,a[1]=o,a[2]=s,a[3]=u,a[4]=d,a[5]=f,a[6]=v,a[7]=x,a[8]=S);let C=x===void 0?100:x,w=S===void 0?4:S,T=h(C)?C:100,E=m(o,T)?o:o==null?0:`indeterminate`,D,O,k;if(a[9]!==w||a[10]!==E){D=y(w??g.strokeWidth);let e;a[14]===E?e=a[15]:(e=p(E)?E:void 0,a[14]=E,a[15]=e),k=e;let t=b(D);O=n({"--radius":t}),a[9]=w,a[10]=E,a[11]=D,a[12]=O,a[13]=k}else D=a[11],O=a[12],k=a[13];let A=O,j;a[16]!==T||a[17]!==D||a[18]!==E?(j={max:T,strokeWidth:D,value:E},a[16]=T,a[17]=D,a[18]=E,a[19]=j):j=a[19];let M=j,N;a[20]===d?N=a[21]:(N=t(d,`progress-donut`),a[20]=d,a[21]=N);let P;a[22]!==u||a[23]!==f||a[24]!==E?(P=e(`size-6 text-gray-200 dark:text-gray-300`,E===`indeterminate`&&[`animate-spin`,f??`animation-duration-[15s]`],u),a[22]=u,a[23]=f,a[24]=E,a[25]=P):P=a[25];let F;a[26]!==D||a[27]!==A?(F=/* @__PURE__ */ c(`circle`,{className:`[r:var(--radius)]`,cx:`50%`,cy:`50%`,fill:`transparent`,stroke:`currentColor`,strokeWidth:D,style:A}),a[26]=D,a[27]=A,a[28]=F):F=a[28];let I;a[29]!==s||a[30]!==T||a[31]!==v||a[32]!==N||a[33]!==P||a[34]!==F||a[35]!==k?(I=/* @__PURE__ */ l(`svg`,{"data-slot":N,"aria-valuemax":T,"aria-valuemin":0,"aria-valuenow":k,className:P,"data-max":T,"data-min":0,"data-value":k,height:`100%`,role:`progressbar`,width:`100%`,...v,children:[F,s]}),a[29]=s,a[30]=T,a[31]=v,a[32]=N,a[33]=P,a[34]=F,a[35]=k,a[36]=I):I=a[36];let L;return a[37]!==M||a[38]!==I?(L=/* @__PURE__ */ c(_.Provider,{value:M,children:I}),a[37]=M,a[38]=I,a[39]=L):L=a[39],L},Indicator:a=>{let u=i(52),d,f,p;u[0]===a?(d=u[1],f=u[2],p=u[3]):({"data-slot":f,className:d,...p}=a,u[0]=a,u[1]=d,u[2]=f,u[3]=p);let m=s(),h=o(_)??g,v=(h.value===`indeterminate`?.6:h.value/h.max)*100,x,S,C,w,T,E,D,O,k,A,j,M,N,P,F;if(u[4]!==d||u[5]!==h.strokeWidth||u[6]!==h.value||u[7]!==f||u[8]!==m||u[9]!==v||u[10]!==p){let i=y(h.strokeWidth),a=b(i);u[26]===f?w=u[27]:(w=t(f,`progress-donut-indicator`),u[26]=f,u[27]=w),u[28]===d?T=u[29]:(T=e(`text-accent-600`,d),u[28]=d,u[29]=T),E=p,u[30]!==h.value||u[31]!==m?(D=h.value===`indeterminate`&&/* @__PURE__ */ c(`defs`,{children:/* @__PURE__ */ l(`linearGradient`,{id:m,children:[/* @__PURE__ */ c(`stop`,{className:`stop-opacity-100 stop-color-current`,offset:`0%`}),/* @__PURE__ */ c(`stop`,{className:`stop-opacity-0 stop-color-current`,offset:`95%`})]})}),u[30]=h.value,u[31]=m,u[32]=D):D=u[32],u[33]===Symbol.for(`react.memo_cache_sentinel`)?(x=r(`[r:var(--radius)]`,`origin-center`),u[33]=x):x=u[33],O=`50%`,k=`50%`,A=`transparent`,j=100,M=h.value===`indeterminate`?`url(#${m})`:`currentColor`,N=100,P=100-v,F=`round`,S=i,C=n({"--radius":a}),u[4]=d,u[5]=h.strokeWidth,u[6]=h.value,u[7]=f,u[8]=m,u[9]=v,u[10]=p,u[11]=x,u[12]=S,u[13]=C,u[14]=w,u[15]=T,u[16]=E,u[17]=D,u[18]=O,u[19]=k,u[20]=A,u[21]=j,u[22]=M,u[23]=N,u[24]=P,u[25]=F}else x=u[11],S=u[12],C=u[13],w=u[14],T=u[15],E=u[16],D=u[17],O=u[18],k=u[19],A=u[20],j=u[21],M=u[22],N=u[23],P=u[24],F=u[25];let I;u[34]!==x||u[35]!==S||u[36]!==C||u[37]!==O||u[38]!==k||u[39]!==A||u[40]!==j||u[41]!==M||u[42]!==N||u[43]!==P||u[44]!==F?(I=/* @__PURE__ */ c(`circle`,{className:x,cx:O,cy:k,fill:A,pathLength:j,stroke:M,strokeDasharray:N,strokeDashoffset:P,strokeLinecap:F,strokeWidth:S,style:C,transform:`rotate(-90)`}),u[34]=x,u[35]=S,u[36]=C,u[37]=O,u[38]=k,u[39]=A,u[40]=j,u[41]=M,u[42]=N,u[43]=P,u[44]=F,u[45]=I):I=u[45];let L;return u[46]!==w||u[47]!==T||u[48]!==E||u[49]!==D||u[50]!==I?(L=/* @__PURE__ */ l(`g`,{"data-slot":w,className:T,...E,children:[D,I]}),u[46]=w,u[47]=T,u[48]=E,u[49]=D,u[50]=I,u[51]=L):L=u[51],L}};function y(e){let t=4;return e==null?t:(t=typeof e==`number`?e:e.endsWith(`rem`)?Number(e.replace(`rem`,``))*16:Number(e),f(Number.isNaN(t)?4:t,{min:1,max:12}))}function b(e){return`calc(50% - ${e/2}px)`}const x=a({max:100,value:0});function S(n){let r=i(24),a,o,s,l,u,f;r[0]===n?(a=r[1],o=r[2],s=r[3],l=r[4],u=r[5],f=r[6]):({"data-slot":l,className:s,children:o,max:f,value:a,...u}=n,r[0]=n,r[1]=a,r[2]=o,r[3]=s,r[4]=l,r[5]=u,r[6]=f);let g=f===void 0?100:f,_=h(g)?g:100,v=m(a,_)?a:a==null?0:`indeterminate`,y=p(v)?v:void 0,b;r[7]!==_||r[8]!==v?(b={max:_,value:v},r[7]=_,r[8]=v,r[9]=b):b=r[9];let S=b,C;r[10]===l?C=r[11]:(C=t(l,`progress-bar`),r[10]=l,r[11]=C);let w;r[12]===s?w=r[13]:(w=e(`bg-base-hover dark:bg-base shadow-inner relative h-3 w-full overflow-hidden rounded-md`,s),r[12]=s,r[13]=w);let T;r[14]!==o||r[15]!==_||r[16]!==u||r[17]!==C||r[18]!==w||r[19]!==y?(T=/* @__PURE__ */ c(d,{"data-slot":C,className:w,value:y,max:_,...u,children:o}),r[14]=o,r[15]=_,r[16]=u,r[17]=C,r[18]=w,r[19]=y,r[20]=T):T=r[20];let E;return r[21]!==S||r[22]!==T?(E=/* @__PURE__ */ c(x.Provider,{value:S,children:T}),r[21]=S,r[22]=T,r[23]=E):E=r[23],E}function C(n){let r=i(17),a,s,l,d;r[0]===n?(a=r[1],s=r[2],l=r[3],d=r[4]):({"data-slot":s,className:a,style:d,...l}=n,r[0]=n,r[1]=a,r[2]=s,r[3]=l,r[4]=d);let f=o(x),{max:p}=f,m=(p-(f.value===`indeterminate`?0:f.value))/p*100,h;r[5]===s?h=r[6]:(h=t(s,`progress-bar-indicator`),r[5]=s,r[6]=h);let g;r[7]===a?g=r[8]:(g=e(`bg-accent-600 h-full w-full flex-1 transition-all`,a),r[7]=a,r[8]=g);let _=`translateX(-${m}%)`,v;r[9]!==d||r[10]!==_?(v={...d,transform:_},r[9]=d,r[10]=_,r[11]=v):v=r[11];let y;return r[12]!==l||r[13]!==h||r[14]!==g||r[15]!==v?(y=/* @__PURE__ */ c(u,{"data-slot":h,className:g,style:v,...l}),r[12]=l,r[13]=h,r[14]=g,r[15]=v,r[16]=y):y=r[16],y}const w={Root:S,Indicator:C};export{w as ProgressBar,v as ProgressDonut};
|
package/dist/qr-code.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 { ComponentProps } from "react";
|
|
3
4
|
//#region src/components/qr-code/qr-code.d.ts
|
|
4
5
|
/**
|
|
@@ -28,7 +29,7 @@ type QrCodeRootProps = ComponentProps<"div"> & WithAsChild & {
|
|
|
28
29
|
* surrounding whitespace but can hurt scannability; avoid `0`.
|
|
29
30
|
*/
|
|
30
31
|
quietZone?: number;
|
|
31
|
-
};
|
|
32
|
+
} & WithDataSlot;
|
|
32
33
|
/**
|
|
33
34
|
* The root container of a QR code. Encodes `value` (via the dependency-free
|
|
34
35
|
* `uqr` encoder) and renders a positioned white tile around the QR `Frame`,
|
|
@@ -57,12 +58,12 @@ type QrCodeRootProps = ComponentProps<"div"> & WithAsChild & {
|
|
|
57
58
|
* </QrCode.Root>
|
|
58
59
|
* ```
|
|
59
60
|
*/
|
|
60
|
-
declare const Root: ({ value, ecc, pixelSize, quietZone, asChild, className, children, ref, ...props }: QrCodeRootProps) => import("react").JSX.Element;
|
|
61
|
+
declare const Root: ({ "data-slot": dataSlot, value, ecc, pixelSize, quietZone, asChild, className, children, ref, ...props }: QrCodeRootProps) => import("react").JSX.Element;
|
|
61
62
|
/**
|
|
62
63
|
* Props for `QrCode.Frame`, the fixed SVG element that sizes the encoded QR
|
|
63
64
|
* pattern with its `viewBox`. `role` is locked to `"img"`.
|
|
64
65
|
*/
|
|
65
|
-
type QrCodeFrameProps = Omit<ComponentProps<"svg">, "role"
|
|
66
|
+
type QrCodeFrameProps = Omit<ComponentProps<"svg">, "role"> & WithDataSlot;
|
|
66
67
|
/**
|
|
67
68
|
* The `svg` frame that holds the QR `Pattern`. Defaults to a square `size-48`
|
|
68
69
|
* and scales the encoded pattern to fit via its `viewBox`, so resize the whole
|
|
@@ -90,12 +91,12 @@ type QrCodeFrameProps = Omit<ComponentProps<"svg">, "role">;
|
|
|
90
91
|
* </QrCode.Root>
|
|
91
92
|
* ```
|
|
92
93
|
*/
|
|
93
|
-
declare const Frame: ({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, className, children, ref, ...props }: QrCodeFrameProps) => import("react").JSX.Element;
|
|
94
|
+
declare const Frame: ({ "data-slot": dataSlot, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, className, children, ref, ...props }: QrCodeFrameProps) => import("react").JSX.Element;
|
|
94
95
|
/**
|
|
95
96
|
* Props for `QrCode.Pattern`, the fixed SVG `path` element that renders the
|
|
96
97
|
* encoded dark modules.
|
|
97
98
|
*/
|
|
98
|
-
type QrCodePatternProps = ComponentProps<"path"
|
|
99
|
+
type QrCodePatternProps = ComponentProps<"path"> & WithDataSlot;
|
|
99
100
|
/**
|
|
100
101
|
* The encoded QR modules, rendered as a single `path` inside the `Frame`.
|
|
101
102
|
* Defaults to black fill (`fill-static-black`) so the code stays scannable in
|
|
@@ -119,12 +120,12 @@ type QrCodePatternProps = ComponentProps<"path">;
|
|
|
119
120
|
* </QrCode.Root>
|
|
120
121
|
* ```
|
|
121
122
|
*/
|
|
122
|
-
declare const Pattern: ({ className, ref, ...props }: QrCodePatternProps) => import("react").JSX.Element;
|
|
123
|
+
declare const Pattern: ({ "data-slot": dataSlot, className, ref, ...props }: QrCodePatternProps) => import("react").JSX.Element;
|
|
123
124
|
/**
|
|
124
125
|
* Props for `QrCode.Overlay`, the optional centered logo container rendered on
|
|
125
126
|
* top of the QR pattern.
|
|
126
127
|
*/
|
|
127
|
-
type QrCodeOverlayProps = ComponentProps<"div"> & WithAsChild;
|
|
128
|
+
type QrCodeOverlayProps = ComponentProps<"div"> & WithAsChild & WithDataSlot;
|
|
128
129
|
/**
|
|
129
130
|
* An overlay centered on top of the QR code, typically holding a brand logo
|
|
130
131
|
* (e.g. `NgrokLettermarkIcon`). Renders a white, rounded "punch-out" so the
|
|
@@ -145,7 +146,7 @@ type QrCodeOverlayProps = ComponentProps<"div"> & WithAsChild;
|
|
|
145
146
|
* </QrCode.Root>
|
|
146
147
|
* ```
|
|
147
148
|
*/
|
|
148
|
-
declare const Overlay: ({ asChild, className, ref, ...props }: QrCodeOverlayProps) => import("react").JSX.Element;
|
|
149
|
+
declare const Overlay: ({ "data-slot": dataSlot, asChild, className, ref, ...props }: QrCodeOverlayProps) => import("react").JSX.Element;
|
|
149
150
|
/**
|
|
150
151
|
* A QR code. Compose `QrCode.Root` with a `QrCode.Frame` wrapping a
|
|
151
152
|
* `QrCode.Pattern`, and optionally a `QrCode.Overlay` for a centered logo.
|
package/dist/qr-code.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"./slot-DdYN1L1C.js";import{c as r}from"react/compiler-runtime";import{createContext as i,useContext as a}from"react";import o from"tiny-invariant";import{jsx as s}from"react/jsx-runtime";import{encode as c}from"uqr";const l=i(null);function u(e,t){o(Number.isFinite(e)&&e>0,"`QrCode.Root` pixelSize must be a finite number greater than 0."),o(Number.isInteger(t)&&t>=0,"`QrCode.Root` quietZone must be a non-negative integer.")}function d(){let e=a(l);return o(e,"`QrCode.Frame` and `QrCode.Pattern` must be rendered inside a `QrCode.Root`."),e}function f(e,t){let n=[];return e.forEach((e,r)=>{e.forEach((e,i)=>{if(e){let e=i*t,a=r*t;n.push(`M${e},${a}h${t}v${t}h-${t}z`)}})}),n.join(``)}const p={Root:i=>{let a=r(35),o,d,p,m,h,g,_,v,y,b;a[0]===i?(o=a[1],d=a[2],p=a[3],m=a[4],h=a[5],g=a[6],_=a[7],v=a[8],y=a[9],b=a[10]):({"data-slot":m,value:b,ecc:_,pixelSize:v,quietZone:y,asChild:o,className:p,children:d,ref:g,...h}=i,a[0]=i,a[1]=o,a[2]=d,a[3]=p,a[4]=m,a[5]=h,a[6]=g,a[7]=_,a[8]=v,a[9]=y,a[10]=b);let x=_===void 0?`L`:_,S=v===void 0?10:v,C=y===void 0?4:y;u(S,C);let w;a[11]!==x||a[12]!==C||a[13]!==b?(w=c(b,{ecc:x,border:C}),a[11]=x,a[12]=C,a[13]=b,a[14]=w):w=a[14];let T=w,E;a[15]!==T.data||a[16]!==S?(E=f(T.data,S),a[15]=T.data,a[16]=S,a[17]=E):E=a[17];let D=E,O=T.size*S,k;a[18]!==D||a[19]!==O?(k={path:D,dimension:O},a[18]=D,a[19]=O,a[20]=k):k=a[20];let A=k,j=o?n:`div`,M;a[21]===m?M=a[22]:(M=t(m,`qr-code`),a[21]=m,a[22]=M);let N;a[23]===p?N=a[24]:(N=e(`relative inline-flex bg-static-white text-static-black`,p),a[23]=p,a[24]=N);let P;a[25]!==j||a[26]!==d||a[27]!==h||a[28]!==g||a[29]!==M||a[30]!==N?(P=/* @__PURE__ */ s(j,{ref:g,...h,"data-slot":M,className:N,children:d}),a[25]=j,a[26]=d,a[27]=h,a[28]=g,a[29]=M,a[30]=N,a[31]=P):P=a[31];let F;return a[32]!==A||a[33]!==P?(F=/* @__PURE__ */ s(l.Provider,{value:A,children:P}),a[32]=A,a[33]=P,a[34]=F):F=a[34],F},Frame:n=>{let i=r(21),a,o,c,l,u,f,p;i[0]===n?(a=i[1],o=i[2],c=i[3],l=i[4],u=i[5],f=i[6],p=i[7]):({"data-slot":u,"aria-label":a,"aria-labelledby":o,className:l,children:c,ref:p,...f}=n,i[0]=n,i[1]=a,i[2]=o,i[3]=c,i[4]=l,i[5]=u,i[6]=f,i[7]=p);let{dimension:m}=d(),h=a??(o==null?`QR code`:void 0),g;i[8]===u?g=i[9]:(g=t(u,`qr-code-frame`),i[8]=u,i[9]=g);let _=`0 0 ${m} ${m}`,v;i[10]===l?v=i[11]:(v=e(`block size-48`,l),i[10]=l,i[11]=v);let y;return i[12]!==o||i[13]!==c||i[14]!==f||i[15]!==p||i[16]!==h||i[17]!==g||i[18]!==_||i[19]!==v?(y=/* @__PURE__ */ s(`svg`,{ref:p,...f,role:`img`,"aria-label":h,"aria-labelledby":o,"data-slot":g,xmlns:`http://www.w3.org/2000/svg`,viewBox:_,shapeRendering:`crispEdges`,className:v,children:c}),i[12]=o,i[13]=c,i[14]=f,i[15]=p,i[16]=h,i[17]=g,i[18]=_,i[19]=v,i[20]=y):y=i[20],y},Pattern:n=>{let i=r(15),a,o,c,l;i[0]===n?(a=i[1],o=i[2],c=i[3],l=i[4]):({"data-slot":o,className:a,ref:l,...c}=n,i[0]=n,i[1]=a,i[2]=o,i[3]=c,i[4]=l);let{path:u}=d(),f;i[5]===o?f=i[6]:(f=t(o,`qr-code-pattern`),i[5]=o,i[6]=f);let p;i[7]===a?p=i[8]:(p=e(`fill-static-black`,a),i[7]=a,i[8]=p);let m;return i[9]!==u||i[10]!==c||i[11]!==l||i[12]!==f||i[13]!==p?(m=/* @__PURE__ */ s(`path`,{ref:l,...c,"data-slot":f,d:u,className:p}),i[9]=u,i[10]=c,i[11]=l,i[12]=f,i[13]=p,i[14]=m):m=i[14],m},Overlay:i=>{let a=r(16),o,c,l,u,d;a[0]===i?(o=a[1],c=a[2],l=a[3],u=a[4],d=a[5]):({"data-slot":l,asChild:o,className:c,ref:d,...u}=i,a[0]=i,a[1]=o,a[2]=c,a[3]=l,a[4]=u,a[5]=d);let f=o?n:`div`,p;a[6]===l?p=a[7]:(p=t(l,`qr-code-overlay`),a[6]=l,a[7]=p);let m;a[8]===c?m=a[9]:(m=e(`absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-md bg-static-white text-static-black p-1.5`,c),a[8]=c,a[9]=m);let h;return a[10]!==f||a[11]!==u||a[12]!==d||a[13]!==p||a[14]!==m?(h=/* @__PURE__ */ s(f,{ref:d,...u,"data-slot":p,className:m}),a[10]=f,a[11]=u,a[12]=d,a[13]=p,a[14]=m,a[15]=h):h=a[15],h}};export{p as QrCode};
|
package/dist/radio-group.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
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 { HTMLAttributes, PropsWithChildren, ReactNode, Ref } from "react";
|
|
3
4
|
import { RadioGroupProps, RadioProps } from "@headlessui/react";
|
|
4
5
|
//#region src/components/radio-group/radio-group.d.ts
|
|
5
6
|
type RadioGroupProps$1 = PropsWithChildren<Omit<RadioGroupProps, "as" | "children">> & {
|
|
6
7
|
ref?: Ref<HTMLElement>;
|
|
7
|
-
};
|
|
8
|
+
} & WithDataSlot;
|
|
8
9
|
/**
|
|
9
10
|
* A group of radio items. It manages the state of the children radios. Unstyled and simple.
|
|
10
11
|
* Used as the root component for grouping related radio items where only one can be selected.
|
|
@@ -32,7 +33,7 @@ type RadioGroupProps$1 = PropsWithChildren<Omit<RadioGroupProps, "as" | "childre
|
|
|
32
33
|
* </RadioGroup.Root>
|
|
33
34
|
* ```
|
|
34
35
|
*/
|
|
35
|
-
declare const Root: ({ ref, ...props }: RadioGroupProps$1) => import("react").JSX.Element;
|
|
36
|
+
declare const Root: ({ "data-slot": dataSlot, ref, ...props }: RadioGroupProps$1) => import("react").JSX.Element;
|
|
36
37
|
/**
|
|
37
38
|
* The shape of the radio state context.
|
|
38
39
|
*/
|
|
@@ -45,7 +46,7 @@ type RadioStateContextValue = {
|
|
|
45
46
|
};
|
|
46
47
|
type RadioItemProps = Omit<RadioProps, "children"> & PropsWithChildren & {
|
|
47
48
|
ref?: Ref<HTMLDivElement>;
|
|
48
|
-
};
|
|
49
|
+
} & WithDataSlot;
|
|
49
50
|
/**
|
|
50
51
|
* A simple radio item that can be used inside a radio group. The "conventional" use-case.
|
|
51
52
|
* Must be a child of `RadioGroup`.
|
|
@@ -69,7 +70,7 @@ type RadioItemProps = Omit<RadioProps, "children"> & PropsWithChildren & {
|
|
|
69
70
|
* </RadioGroup.Root>
|
|
70
71
|
* ```
|
|
71
72
|
*/
|
|
72
|
-
declare const Item: ({ as: tag, children, className, ref, ...props }: RadioItemProps) => import("react").JSX.Element;
|
|
73
|
+
declare const Item: ({ "data-slot": dataSlot, as: tag, children, className, ref, ...props }: RadioItemProps) => import("react").JSX.Element;
|
|
73
74
|
type RadioIndicatorProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
74
75
|
children?: ReactNode | ((context: RadioStateContextValue) => ReactNode);
|
|
75
76
|
/**
|
|
@@ -77,7 +78,7 @@ type RadioIndicatorProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
|
77
78
|
* control, and a `<div>` has no `name` attribute.
|
|
78
79
|
*/
|
|
79
80
|
name?: string;
|
|
80
|
-
};
|
|
81
|
+
} & WithDataSlot;
|
|
81
82
|
/**
|
|
82
83
|
* The selection indicator for any radio item.
|
|
83
84
|
* Use it as a child of `RadioGroup.Item`, `RadioGroup.ListItem`, or `RadioGroup.Card`.
|
|
@@ -96,7 +97,7 @@ type RadioIndicatorProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
|
96
97
|
* </RadioGroup.Item>
|
|
97
98
|
* ```
|
|
98
99
|
*/
|
|
99
|
-
declare const Indicator: ({ children, className, name: _name, ...props }: RadioIndicatorProps) => import("react").JSX.Element;
|
|
100
|
+
declare const Indicator: ({ "data-slot": dataSlot, children, className, name: _name, ...props }: RadioIndicatorProps) => import("react").JSX.Element;
|
|
100
101
|
/**
|
|
101
102
|
* A group of radio list items. Use RadioGroup.ListItem as direct children.
|
|
102
103
|
*
|
|
@@ -120,8 +121,8 @@ declare const Indicator: ({ children, className, name: _name, ...props }: RadioI
|
|
|
120
121
|
* </RadioGroup.Root>
|
|
121
122
|
* ```
|
|
122
123
|
*/
|
|
123
|
-
declare const List: ({ className, ref, ...props }: RadioGroupProps$1) => import("react").JSX.Element;
|
|
124
|
-
type RadioListItemProps = RadioItemProps;
|
|
124
|
+
declare const List: ({ "data-slot": dataSlot, className, ref, ...props }: RadioGroupProps$1) => import("react").JSX.Element;
|
|
125
|
+
type RadioListItemProps = RadioItemProps & WithDataSlot;
|
|
125
126
|
/**
|
|
126
127
|
* A radio list item that is used inside a `RadioGroup.List`.
|
|
127
128
|
*
|
|
@@ -154,9 +155,9 @@ type RadioListItemProps = RadioItemProps;
|
|
|
154
155
|
* </RadioGroup.Root>
|
|
155
156
|
* ```
|
|
156
157
|
*/
|
|
157
|
-
declare const ListItem: ({ as: tag, children, className, ref, ...props }: RadioListItemProps) => import("react").JSX.Element;
|
|
158
|
-
type RadioItemContentProps = HTMLAttributes<HTMLDivElement> & WithAsChild;
|
|
159
|
-
type RadioCardProps = RadioItemProps;
|
|
158
|
+
declare const ListItem: ({ "data-slot": dataSlot, as: tag, children, className, ref, ...props }: RadioListItemProps) => import("react").JSX.Element;
|
|
159
|
+
type RadioItemContentProps = HTMLAttributes<HTMLDivElement> & WithAsChild & WithDataSlot;
|
|
160
|
+
type RadioCardProps = RadioItemProps & WithDataSlot;
|
|
160
161
|
/**
|
|
161
162
|
* A radio card item. Use it as a child of `RadioGroup`
|
|
162
163
|
*
|
|
@@ -189,7 +190,7 @@ type RadioCardProps = RadioItemProps;
|
|
|
189
190
|
* </RadioGroup.Root>
|
|
190
191
|
* ```
|
|
191
192
|
*/
|
|
192
|
-
declare const Card: ({ as: tag, children, className, ref, ...props }: RadioCardProps) => import("react").JSX.Element;
|
|
193
|
+
declare const Card: ({ "data-slot": dataSlot, as: tag, children, className, ref, ...props }: RadioCardProps) => import("react").JSX.Element;
|
|
193
194
|
/**
|
|
194
195
|
* The content of any radio item. Use it to wrap any labels, descriptions, or content of a radio item.
|
|
195
196
|
* Use it as a child of `RadioGroup.Item`, `RadioGroup.ListItem`, or `RadioGroup.Card`.
|
|
@@ -209,7 +210,7 @@ declare const Card: ({ as: tag, children, className, ref, ...props }: RadioCardP
|
|
|
209
210
|
* </RadioGroup.Root>
|
|
210
211
|
* ```
|
|
211
212
|
*/
|
|
212
|
-
declare const ItemContent: ({ asChild, children, className, ...props }: RadioItemContentProps) => import("react").JSX.Element;
|
|
213
|
+
declare const ItemContent: ({ "data-slot": dataSlot, asChild, children, className, ...props }: RadioItemContentProps) => import("react").JSX.Element;
|
|
213
214
|
/**
|
|
214
215
|
* An inline group of radio buttons. Use RadioGroup.Button as direct children.
|
|
215
216
|
* Renders the radio group itself (it wraps `Root`) — use it *in place of*
|
|
@@ -228,8 +229,8 @@ declare const ItemContent: ({ asChild, children, className, ...props }: RadioIte
|
|
|
228
229
|
* </RadioGroup.ButtonGroup>
|
|
229
230
|
* ```
|
|
230
231
|
*/
|
|
231
|
-
declare const ButtonGroup: ({ className, ref, ...props }: RadioGroupProps$1) => import("react").JSX.Element;
|
|
232
|
-
type RadioButtonProps = RadioItemProps;
|
|
232
|
+
declare const ButtonGroup: ({ "data-slot": dataSlot, className, ref, ...props }: RadioGroupProps$1) => import("react").JSX.Element;
|
|
233
|
+
type RadioButtonProps = RadioItemProps & WithDataSlot;
|
|
233
234
|
/**
|
|
234
235
|
* A radio button that is used inside a `RadioGroup.ButtonGroup`.
|
|
235
236
|
*
|
|
@@ -251,8 +252,8 @@ type RadioButtonProps = RadioItemProps;
|
|
|
251
252
|
* </RadioGroup.ButtonGroup>
|
|
252
253
|
* ```
|
|
253
254
|
*/
|
|
254
|
-
declare const Button: ({ as: tag, children, className, ref, ...props }: RadioButtonProps) => import("react").JSX.Element;
|
|
255
|
-
type RadioInputSandboxProps = HTMLAttributes<HTMLDivElement
|
|
255
|
+
declare const Button: ({ "data-slot": dataSlot, as: tag, children, className, ref, ...props }: RadioButtonProps) => import("react").JSX.Element;
|
|
256
|
+
type RadioInputSandboxProps = HTMLAttributes<HTMLDivElement> & WithDataSlot;
|
|
256
257
|
/**
|
|
257
258
|
* A sandbox container for input elements composed within radio group items.
|
|
258
259
|
* A click inside it still selects the radio, then focus returns to the input.
|
|
@@ -277,7 +278,7 @@ type RadioInputSandboxProps = HTMLAttributes<HTMLDivElement>;
|
|
|
277
278
|
* </RadioGroup.Root>
|
|
278
279
|
* ```
|
|
279
280
|
*/
|
|
280
|
-
declare const InputSandbox: ({ children, onClick, onKeyDown, ...props }: RadioInputSandboxProps) => import("react").JSX.Element;
|
|
281
|
+
declare const InputSandbox: ({ "data-slot": dataSlot, children, onClick, onKeyDown, ...props }: RadioInputSandboxProps) => import("react").JSX.Element;
|
|
281
282
|
/**
|
|
282
283
|
* A group of radio items. It manages the state of the children radios.
|
|
283
284
|
*
|
package/dist/radio-group.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-0HCjnNv1.js";import{t}from"./slot-BsvE2ntj.js";import{t as n}from"./clsx-DUGZgXfJ.js";import{t as r}from"./field-B1wqeZr4.js";import{t as i}from"./radio-group-HDVxTNPi.js";import{t as a}from"./input-DQyN6gN0.js";import{c as o}from"react/compiler-runtime";import{Children as s,cloneElement as c,createContext as l,isValidElement as u,useContext as d,useRef as f,useState as p}from"react";import{jsx as m}from"react/jsx-runtime";import{Radio as h,RadioGroup as g}from"@headlessui/react";const _=e=>{let t=o(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=m(g,{"data-slot":`radio-group`,...n,ref:r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i},v=l({autofocus:!1,checked:!1,disabled:!1,focus:!1,hover:!1});function y(e){let t=e.filter(e=>e!=null&&e!==``);return t.length>0?t.join(` `):void 0}function b(){let e=o(4),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let[n,r]=p(t),i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=e=>(r(t=>[...t,e]),()=>{r(t=>t.filter(t=>t!==e))}),e[1]=i):i=e[1];let a=i,s;return e[2]===n?s=e[3]:(s=[n,a],e[2]=n,e[3]=s),s}const x=e=>{let t=o(26),n,a,s,c;t[0]===e?(n=t[1],a=t[2],s=t[3],c=t[4]):({children:n,ref:s,tag:c,...a}=e,t[0]=e,t[1]=n,t[2]=a,t[3]=s,t[4]=c);let l=c===void 0?`div`:c,u=d(r),[f,p]=b(),[h,g]=b(),_;t[5]!==g||t[6]!==p?(_={registerLabelId:p,registerDescriptionId:g},t[5]=g,t[6]=p,t[7]=_):_=t[7];let v=_,x;t[8]===u?x=t[9]:(x=u?{"aria-errormessage":u[`aria-errormessage`],"aria-invalid":u[`aria-invalid`]}:void 0,t[8]=u,t[9]=x);let S;t[10]===f?S=t[11]:(S=y(f),t[10]=f,t[11]=S);let C=u?.[`aria-describedby`],w;t[12]!==h||t[13]!==C?(w=y([C,...h]),t[12]=h,t[13]=C,t[14]=w):w=t[14];let T;t[15]!==n||t[16]!==v?(T=m(i.Provider,{value:v,children:n}),t[15]=n,t[16]=v,t[17]=T):T=t[17];let E;return t[18]!==l||t[19]!==a||t[20]!==s||t[21]!==x||t[22]!==S||t[23]!==w||t[24]!==T?(E=m(l,{...a,...x,"aria-labelledby":S,"aria-describedby":w,ref:s,children:T}),t[18]=l,t[19]=a,t[20]=s,t[21]=x,t[22]=S,t[23]=w,t[24]=T,t[25]=E):E=t[25],E},S=t=>{let n=o(16),r,i,a,s,c;n[0]===t?(r=n[1],i=n[2],a=n[3],s=n[4],c=n[5]):({as:c,children:r,className:i,ref:s,...a}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=a,n[4]=s,n[5]=c);let l;n[6]===i?l=n[7]:(l=e(`group/radio cursor-pointer aria-disabled:cursor-default [&_label]:cursor-inherit flex gap-2 py-1 text-sm focus:outline-hidden`,`not-has-data-[radio-default-indicator]:focus-visible:ring-focus-accent not-has-data-[radio-default-indicator]:focus-visible:ring-4 not-has-data-[radio-default-indicator]:focus-visible:rounded-md`,i),n[6]=i,n[7]=l);let u;n[8]===r?u=n[9]:(u=e=>m(v.Provider,{value:e,children:r}),n[8]=r,n[9]=u);let d;return n[10]!==a||n[11]!==s||n[12]!==l||n[13]!==u||n[14]!==c?(d=m(h,{"data-slot":`radio-group-item`,className:l,...a,as:x,tag:c,ref:s,children:u}),n[10]=a,n[11]=s,n[12]=l,n[13]=u,n[14]=c,n[15]=d):d=n[15],d},C=t=>{let n=o(10),{checked:r,disabled:i,focus:a,hover:s}=t,c=i&&`cursor-default opacity-50`,l=r&&`border-accent-600 bg-accent-600`,u=a&&!i&&`border-accent-600 ring-focus-accent ring-4`,d=s&&`border-accent-600`,f;n[0]!==c||n[1]!==l||n[2]!==u||n[3]!==d?(f=e(`border-form flex size-4 items-center justify-center rounded-full border shrink-0`,c,l,u,d),n[0]=c,n[1]=l,n[2]=u,n[3]=d,n[4]=f):f=n[4];let p;n[5]===r?p=n[6]:(p=r&&m(`span`,{className:`size-2 rounded-full bg-white shrink-0`}),n[5]=r,n[6]=p);let h;return n[7]!==f||n[8]!==p?(h=m(`span`,{"data-radio-default-indicator":``,className:f,children:p}),n[7]=f,n[8]=p,n[9]=h):h=n[9],h},w={Button:t=>{let n=o(16),r,i,a,s,c;n[0]===t?(r=n[1],i=n[2],a=n[3],s=n[4],c=n[5]):({as:c,children:r,className:i,ref:s,...a}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=a,n[4]=s,n[5]=c);let l;n[6]===i?l=n[7]:(l=e(`group/radio border-form [&_label]:cursor-inherit relative flex flex-1 select-none items-center justify-center gap-2 border px-3 text-sm`,`h-9`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`first-of-type:rounded-bl-md first-of-type:rounded-tl-md last-of-type:rounded-br-md last-of-type:rounded-tr-md`,`not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600 aria-disabled:opacity-50`,`aria-checked:z-1 aria-checked:border-accent-600/40 aria-checked:bg-accent-500/10 not-aria-disabled:hover:aria-checked:border-accent-600`,`has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2`,i),n[6]=i,n[7]=l);let u;n[8]===r?u=n[9]:(u=e=>m(v.Provider,{value:e,children:r}),n[8]=r,n[9]=u);let d;return n[10]!==a||n[11]!==s||n[12]!==l||n[13]!==u||n[14]!==c?(d=m(h,{"data-slot":`radio-group-button`,className:l,...a,as:x,tag:c,ref:s,children:u}),n[10]=a,n[11]=s,n[12]=l,n[13]=u,n[14]=c,n[15]=d):d=n[15],d},ButtonGroup:e=>{let t=o(10),r,i,a;t[0]===e?(r=t[1],i=t[2],a=t[3]):({className:r,ref:a,...i}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a);let s;t[4]===r?s=t[5]:(s=n(`flex flex-row flex-nowrap -space-x-px`,r),t[4]=r,t[5]=s);let c;return t[6]!==i||t[7]!==a||t[8]!==s?(c=m(_,{"data-slot":`radio-group-button-group`,className:s,...i,ref:a}),t[6]=i,t[7]=a,t[8]=s,t[9]=c):c=t[9],c},Card:e=>{let t=o(16),r,i,a,s,c;t[0]===e?(r=t[1],i=t[2],a=t[3],s=t[4],c=t[5]):({as:c,children:r,className:i,ref:s,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=s,t[5]=c);let l;t[6]===i?l=t[7]:(l=n(`group/radio border-card bg-card [&_label]:cursor-inherit relative rounded-md border p-4 text-sm`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md`,`aria-disabled:border-form/50 not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600`,`aria-checked:z-1 aria-checked:border-accent-600/50 aria-checked:bg-accent-500/10 not-aria-disabled:hover:aria-checked:border-accent-600 dark-high-contrast:aria-checked:border-accent-600 high-contrast:aria-checked:border-accent-600`,i),t[6]=i,t[7]=l);let u;t[8]===r?u=t[9]:(u=e=>m(v.Provider,{value:e,children:r}),t[8]=r,t[9]=u);let d;return t[10]!==a||t[11]!==s||t[12]!==l||t[13]!==u||t[14]!==c?(d=m(h,{"data-slot":`radio-group-card`,className:l,...a,as:x,tag:c,ref:s,children:u}),t[10]=a,t[11]=s,t[12]=l,t[13]=u,t[14]=c,t[15]=d):d=t[15],d},Indicator:t=>{let n=o(13),r,i,a;if(n[0]!==t){let{children:e,className:o,name:s,...c}=t;r=e,i=o,a=c,n[0]=t,n[1]=r,n[2]=i,n[3]=a}else r=n[1],i=n[2],a=n[3];let s=d(v),c;n[4]===i?c=n[5]:(c=e(`radio-indicator inline-flex size-5 select-none items-center justify-center shrink-0`,i),n[4]=i,n[5]=c);let l;n[6]!==r||n[7]!==s?(l=r==null?m(C,{...s}):typeof r==`function`?r(s):r,n[6]=r,n[7]=s,n[8]=l):l=n[8];let u;return n[9]!==a||n[10]!==c||n[11]!==l?(u=m(`div`,{"data-slot":`radio-group-indicator`,className:c,...a,children:l}),n[9]=a,n[10]=c,n[11]=l,n[12]=u):u=n[12],u},InputSandbox:e=>{let t=o(18),n,r,i,l;t[0]===e?(n=t[1],r=t[2],i=t[3],l=t[4]):({children:n,onClick:r,onKeyDown:i,...l}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=l);let p=f(null),h=d(v),g;if(t[5]!==n||t[6]!==h.checked||t[7]!==h.disabled||t[8]!==r||t[9]!==i||t[10]!==l){let e=s.only(n),o=h.disabled||!h.checked,d;t[12]!==h.disabled||t[13]!==i?(d=e=>{if(h.disabled){e.stopPropagation(),e.preventDefault();return}bb9:switch(e.key){case`Enter`:case`Tab`:break bb9;default:e.stopPropagation()}i?.(e)},t[12]=h.disabled,t[13]=i,t[14]=d):d=t[14];let f;t[15]!==h.disabled||t[16]!==r?(f=e=>{if(h.disabled){e.stopPropagation(),e.preventDefault();return}let t=e.target;a(t)&&window.requestAnimationFrame(()=>{t.focus()}),r?.(e)},t[15]=h.disabled,t[16]=r,t[17]=f):f=t[17],g=m(`div`,{role:`none`,"data-slot":`radio-group-input-sandbox`,ref:p,onKeyDown:d,onClick:f,...l,children:u(e)?c(e,{disabled:h.disabled||e.props.disabled,tabIndex:o?-1:e.props.tabIndex}):null}),t[5]=n,t[6]=h.checked,t[7]=h.disabled,t[8]=r,t[9]=i,t[10]=l,t[11]=g}else g=t[11];return g},Item:S,ItemContent:e=>{let r=o(13),i,a,s,c;r[0]===e?(i=r[1],a=r[2],s=r[3],c=r[4]):({asChild:c,children:i,className:a,...s}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=s,r[4]=c);let l=c!==void 0&&c,u=d(v),f=l?t:`div`,p=u.disabled&&`opacity-50`,h;r[5]!==a||r[6]!==p?(h=n(`min-w-0 flex-1`,p,a),r[5]=a,r[6]=p,r[7]=h):h=r[7];let g;return r[8]!==f||r[9]!==i||r[10]!==s||r[11]!==h?(g=m(f,{"data-slot":`radio-group-item-content`,className:h,...s,children:i}),r[8]=f,r[9]=i,r[10]=s,r[11]=h,r[12]=g):g=r[12],g},List:e=>{let t=o(10),r,i,a;t[0]===e?(r=t[1],i=t[2],a=t[3]):({className:r,ref:a,...i}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a);let s;t[4]===r?s=t[5]:(s=n(`-space-y-px`,r),t[4]=r,t[5]=s);let c;return t[6]!==i||t[7]!==a||t[8]!==s?(c=m(_,{"data-slot":`radio-group-list`,className:s,...i,ref:a}),t[6]=i,t[7]=a,t[8]=s,t[9]=c):c=t[9],c},ListItem:t=>{let n=o(16),r,i,a,s,c;n[0]===t?(r=n[1],i=n[2],a=n[3],s=n[4],c=n[5]):({as:c,children:r,className:i,ref:s,...a}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=a,n[4]=s,n[5]=c);let l;n[6]===i?l=n[7]:(l=e(`group/radio border-form [&_label]:cursor-inherit relative flex select-none gap-2 border px-3 py-2 text-sm`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md`,`aria-disabled:border-form/50 not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600`,`aria-checked:z-1 aria-checked:border-accent-500/40 aria-checked:bg-accent-500/10 dark-high-contrast:aria-checked:border-accent-400 high-contrast:aria-checked:border-accent-400 not-aria-disabled:hover:aria-checked:border-accent-600`,`has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2`,i),n[6]=i,n[7]=l);let u;n[8]===r?u=n[9]:(u=e=>m(v.Provider,{value:e,children:r}),n[8]=r,n[9]=u);let d;return n[10]!==a||n[11]!==s||n[12]!==l||n[13]!==u||n[14]!==c?(d=m(h,{"data-slot":`radio-group-list-item`,className:l,...a,as:x,tag:c,ref:s,children:u}),n[10]=a,n[11]=s,n[12]=l,n[13]=u,n[14]=c,n[15]=d):d=n[15],d},Root:_};export{w as RadioGroup};
|
|
1
|
+
import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-DdYN1L1C.js";import{t as r}from"./clsx-DUGZgXfJ.js";import{t as i}from"./field-B1wqeZr4.js";import{t as a}from"./radio-group-HDVxTNPi.js";import{t as o}from"./input-DQyN6gN0.js";import{c as s}from"react/compiler-runtime";import{Children as c,cloneElement as l,createContext as u,isValidElement as d,useContext as f,useRef as p,useState as m}from"react";import{jsx as h}from"react/jsx-runtime";import{Radio as g,RadioGroup as _}from"@headlessui/react";const v=e=>{let n=s(10),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({"data-slot":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(r,`radio-group`),n[4]=r,n[5]=o);let c;return n[6]!==i||n[7]!==a||n[8]!==o?(c=/* @__PURE__ */ h(_,{"data-slot":o,...i,ref:a}),n[6]=i,n[7]=a,n[8]=o,n[9]=c):c=n[9],c},y=u({autofocus:!1,checked:!1,disabled:!1,focus:!1,hover:!1});function b(e){let t=e.filter(e=>e!=null&&e!==``);return t.length>0?t.join(` `):void 0}function x(){let e=s(4),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let[n,r]=m(t),i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=e=>(r(t=>[...t,e]),()=>{r(t=>t.filter(t=>t!==e))}),e[1]=i):i=e[1];let a=i,o;return e[2]===n?o=e[3]:(o=[n,a],e[2]=n,e[3]=o),o}const S=e=>{let t=s(26),n,r,o,c;t[0]===e?(n=t[1],r=t[2],o=t[3],c=t[4]):({children:n,ref:o,tag:c,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=c);let l=c===void 0?`div`:c,u=f(i),[d,p]=x(),[m,g]=x(),_;t[5]!==g||t[6]!==p?(_={registerLabelId:p,registerDescriptionId:g},t[5]=g,t[6]=p,t[7]=_):_=t[7];let v=_,y;t[8]===u?y=t[9]:(y=u?{"aria-errormessage":u[`aria-errormessage`],"aria-invalid":u[`aria-invalid`]}:void 0,t[8]=u,t[9]=y);let S;t[10]===d?S=t[11]:(S=b(d),t[10]=d,t[11]=S);let C=u?.[`aria-describedby`],w;t[12]!==m||t[13]!==C?(w=b([C,...m]),t[12]=m,t[13]=C,t[14]=w):w=t[14];let T;t[15]!==n||t[16]!==v?(T=/* @__PURE__ */ h(a.Provider,{value:v,children:n}),t[15]=n,t[16]=v,t[17]=T):T=t[17];let E;return t[18]!==l||t[19]!==r||t[20]!==o||t[21]!==y||t[22]!==S||t[23]!==w||t[24]!==T?(E=/* @__PURE__ */ h(l,{...r,...y,"aria-labelledby":S,"aria-describedby":w,ref:o,children:T}),t[18]=l,t[19]=r,t[20]=o,t[21]=y,t[22]=S,t[23]=w,t[24]=T,t[25]=E):E=t[25],E},C=n=>{let r=s(20),i,a,o,c,l,u;r[0]===n?(i=r[1],a=r[2],o=r[3],c=r[4],l=r[5],u=r[6]):({"data-slot":o,as:u,children:i,className:a,ref:l,...c}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=c,r[5]=l,r[6]=u);let d;r[7]===o?d=r[8]:(d=t(o,`radio-group-item`),r[7]=o,r[8]=d);let f;r[9]===a?f=r[10]:(f=e(`group/radio cursor-pointer aria-disabled:cursor-default [&_label]:cursor-inherit flex gap-2 py-1 text-sm focus:outline-hidden`,`not-has-data-[radio-default-indicator]:focus-visible:ring-focus-accent not-has-data-[radio-default-indicator]:focus-visible:ring-4 not-has-data-[radio-default-indicator]:focus-visible:rounded-md`,a),r[9]=a,r[10]=f);let p;r[11]===i?p=r[12]:(p=e=>/* @__PURE__ */ h(y.Provider,{value:e,children:i}),r[11]=i,r[12]=p);let m;return r[13]!==c||r[14]!==l||r[15]!==d||r[16]!==f||r[17]!==p||r[18]!==u?(m=/* @__PURE__ */ h(g,{"data-slot":d,className:f,...c,as:S,tag:u,ref:l,children:p}),r[13]=c,r[14]=l,r[15]=d,r[16]=f,r[17]=p,r[18]=u,r[19]=m):m=r[19],m},w=t=>{let n=s(10),{checked:r,disabled:i,focus:a,hover:o}=t,c=i&&`cursor-default opacity-50`,l=r&&`border-accent-600 bg-accent-600`,u=a&&!i&&`border-accent-600 ring-focus-accent ring-4`,d=o&&`border-accent-600`,f;n[0]!==c||n[1]!==l||n[2]!==u||n[3]!==d?(f=e(`border-form flex size-4 items-center justify-center rounded-full border shrink-0`,c,l,u,d),n[0]=c,n[1]=l,n[2]=u,n[3]=d,n[4]=f):f=n[4];let p;n[5]===r?p=n[6]:(p=r&&/* @__PURE__ */ h(`span`,{className:`size-2 rounded-full bg-white shrink-0`}),n[5]=r,n[6]=p);let m;return n[7]!==f||n[8]!==p?(m=/* @__PURE__ */ h(`span`,{"data-radio-default-indicator":``,className:f,children:p}),n[7]=f,n[8]=p,n[9]=m):m=n[9],m},T={Button:n=>{let r=s(20),i,a,o,c,l,u;r[0]===n?(i=r[1],a=r[2],o=r[3],c=r[4],l=r[5],u=r[6]):({"data-slot":o,as:u,children:i,className:a,ref:l,...c}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=c,r[5]=l,r[6]=u);let d;r[7]===o?d=r[8]:(d=t(o,`radio-group-button`),r[7]=o,r[8]=d);let f;r[9]===a?f=r[10]:(f=e(`group/radio border-form [&_label]:cursor-inherit relative flex flex-1 select-none items-center justify-center gap-2 border px-3 text-sm`,`h-9`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`first-of-type:rounded-bl-md first-of-type:rounded-tl-md last-of-type:rounded-br-md last-of-type:rounded-tr-md`,`not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600 aria-disabled:opacity-50`,`aria-checked:z-1 aria-checked:border-accent-600/40 aria-checked:bg-accent-500/10 not-aria-disabled:hover:aria-checked:border-accent-600`,`has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2`,a),r[9]=a,r[10]=f);let p;r[11]===i?p=r[12]:(p=e=>/* @__PURE__ */ h(y.Provider,{value:e,children:i}),r[11]=i,r[12]=p);let m;return r[13]!==c||r[14]!==l||r[15]!==d||r[16]!==f||r[17]!==p||r[18]!==u?(m=/* @__PURE__ */ h(g,{"data-slot":d,className:f,...c,as:S,tag:u,ref:l,children:p}),r[13]=c,r[14]=l,r[15]=d,r[16]=f,r[17]=p,r[18]=u,r[19]=m):m=r[19],m},ButtonGroup:e=>{let n=s(14),i,a,o,c;n[0]===e?(i=n[1],a=n[2],o=n[3],c=n[4]):({"data-slot":a,className:i,ref:c,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=c);let l;n[5]===a?l=n[6]:(l=t(a,`radio-group-button-group`),n[5]=a,n[6]=l);let u;n[7]===i?u=n[8]:(u=r(`flex flex-row flex-nowrap -space-x-px`,i),n[7]=i,n[8]=u);let d;return n[9]!==o||n[10]!==c||n[11]!==l||n[12]!==u?(d=/* @__PURE__ */ h(v,{"data-slot":l,className:u,...o,ref:c}),n[9]=o,n[10]=c,n[11]=l,n[12]=u,n[13]=d):d=n[13],d},Card:e=>{let n=s(20),i,a,o,c,l,u;n[0]===e?(i=n[1],a=n[2],o=n[3],c=n[4],l=n[5],u=n[6]):({"data-slot":o,as:u,children:i,className:a,ref:l,...c}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=c,n[5]=l,n[6]=u);let d;n[7]===o?d=n[8]:(d=t(o,`radio-group-card`),n[7]=o,n[8]=d);let f;n[9]===a?f=n[10]:(f=r(`group/radio border-card bg-card [&_label]:cursor-inherit relative rounded-md border p-4 text-sm`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md`,`aria-disabled:border-form/50 not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600`,`aria-checked:z-1 aria-checked:border-accent-600/50 aria-checked:bg-accent-500/10 not-aria-disabled:hover:aria-checked:border-accent-600 dark-high-contrast:aria-checked:border-accent-600 high-contrast:aria-checked:border-accent-600`,a),n[9]=a,n[10]=f);let p;n[11]===i?p=n[12]:(p=e=>/* @__PURE__ */ h(y.Provider,{value:e,children:i}),n[11]=i,n[12]=p);let m;return n[13]!==c||n[14]!==l||n[15]!==d||n[16]!==f||n[17]!==p||n[18]!==u?(m=/* @__PURE__ */ h(g,{"data-slot":d,className:f,...c,as:S,tag:u,ref:l,children:p}),n[13]=c,n[14]=l,n[15]=d,n[16]=f,n[17]=p,n[18]=u,n[19]=m):m=n[19],m},Indicator:n=>{let r=s(17),i,a,o,c;if(r[0]!==n){let{"data-slot":e,children:t,className:s,name:l,...u}=n;o=e,i=t,a=s,c=u,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=c}else i=r[1],a=r[2],o=r[3],c=r[4];let l=f(y),u;r[5]===o?u=r[6]:(u=t(o,`radio-group-indicator`),r[5]=o,r[6]=u);let d;r[7]===a?d=r[8]:(d=e(`radio-indicator inline-flex size-5 select-none items-center justify-center shrink-0`,a),r[7]=a,r[8]=d);let p;r[9]!==i||r[10]!==l?(p=i==null?/* @__PURE__ */ h(w,{...l}):typeof i==`function`?i(l):i,r[9]=i,r[10]=l,r[11]=p):p=r[11];let m;return r[12]!==c||r[13]!==u||r[14]!==d||r[15]!==p?(m=/* @__PURE__ */ h(`div`,{"data-slot":u,className:d,...c,children:p}),r[12]=c,r[13]=u,r[14]=d,r[15]=p,r[16]=m):m=r[16],m},InputSandbox:e=>{let n=s(22),r,i,a,u,m;n[0]===e?(r=n[1],i=n[2],a=n[3],u=n[4],m=n[5]):({"data-slot":i,children:r,onClick:a,onKeyDown:u,...m}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=u,n[5]=m);let g=p(null),_=f(y),v;if(n[6]!==r||n[7]!==_.checked||n[8]!==_.disabled||n[9]!==i||n[10]!==a||n[11]!==u||n[12]!==m){let e=c.only(r),s=_.disabled||!_.checked,f;n[14]===i?f=n[15]:(f=t(i,`radio-group-input-sandbox`),n[14]=i,n[15]=f);let p;n[16]!==_.disabled||n[17]!==u?(p=e=>{if(_.disabled)e.stopPropagation(),e.preventDefault();else{bb9:switch(e.key){case`Enter`:case`Tab`:break bb9;default:e.stopPropagation()}u?.(e)}},n[16]=_.disabled,n[17]=u,n[18]=p):p=n[18];let y;n[19]!==_.disabled||n[20]!==a?(y=e=>{if(_.disabled){e.stopPropagation(),e.preventDefault();return}let t=e.target;o(t)&&window.requestAnimationFrame(()=>{t.focus()}),a?.(e)},n[19]=_.disabled,n[20]=a,n[21]=y):y=n[21],v=/* @__PURE__ */ h(`div`,{role:`none`,"data-slot":f,ref:g,onKeyDown:p,onClick:y,...m,children:d(e)?l(e,{disabled:_.disabled||e.props.disabled,tabIndex:s?-1:e.props.tabIndex}):null}),n[6]=r,n[7]=_.checked,n[8]=_.disabled,n[9]=i,n[10]=a,n[11]=u,n[12]=m,n[13]=v}else v=n[13];return v},Item:C,ItemContent:e=>{let i=s(17),a,o,c,l,u;i[0]===e?(a=i[1],o=i[2],c=i[3],l=i[4],u=i[5]):({"data-slot":c,asChild:u,children:a,className:o,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=c,i[4]=l,i[5]=u);let d=u!==void 0&&u,p=f(y),m=d?n:`div`,g;i[6]===c?g=i[7]:(g=t(c,`radio-group-item-content`),i[6]=c,i[7]=g);let _=p.disabled&&`opacity-50`,v;i[8]!==o||i[9]!==_?(v=r(`min-w-0 flex-1`,_,o),i[8]=o,i[9]=_,i[10]=v):v=i[10];let b;return i[11]!==m||i[12]!==a||i[13]!==l||i[14]!==g||i[15]!==v?(b=/* @__PURE__ */ h(m,{"data-slot":g,className:v,...l,children:a}),i[11]=m,i[12]=a,i[13]=l,i[14]=g,i[15]=v,i[16]=b):b=i[16],b},List:e=>{let n=s(14),i,a,o,c;n[0]===e?(i=n[1],a=n[2],o=n[3],c=n[4]):({"data-slot":a,className:i,ref:c,...o}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=c);let l;n[5]===a?l=n[6]:(l=t(a,`radio-group-list`),n[5]=a,n[6]=l);let u;n[7]===i?u=n[8]:(u=r(`-space-y-px`,i),n[7]=i,n[8]=u);let d;return n[9]!==o||n[10]!==c||n[11]!==l||n[12]!==u?(d=/* @__PURE__ */ h(v,{"data-slot":l,className:u,...o,ref:c}),n[9]=o,n[10]=c,n[11]=l,n[12]=u,n[13]=d):d=n[13],d},ListItem:n=>{let r=s(20),i,a,o,c,l,u;r[0]===n?(i=r[1],a=r[2],o=r[3],c=r[4],l=r[5],u=r[6]):({"data-slot":o,as:u,children:i,className:a,ref:l,...c}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=c,r[5]=l,r[6]=u);let d;r[7]===o?d=r[8]:(d=t(o,`radio-group-list-item`),r[7]=o,r[8]=d);let f;r[9]===a?f=r[10]:(f=e(`group/radio border-form [&_label]:cursor-inherit relative flex select-none gap-2 border px-3 py-2 text-sm`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md`,`aria-disabled:border-form/50 not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600`,`aria-checked:z-1 aria-checked:border-accent-500/40 aria-checked:bg-accent-500/10 dark-high-contrast:aria-checked:border-accent-400 high-contrast:aria-checked:border-accent-400 not-aria-disabled:hover:aria-checked:border-accent-600`,`has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2`,a),r[9]=a,r[10]=f);let p;r[11]===i?p=r[12]:(p=e=>/* @__PURE__ */ h(y.Provider,{value:e,children:i}),r[11]=i,r[12]=p);let m;return r[13]!==c||r[14]!==l||r[15]!==d||r[16]!==f||r[17]!==p||r[18]!==u?(m=/* @__PURE__ */ h(g,{"data-slot":d,className:f,...c,as:S,tag:u,ref:l,children:p}),r[13]=c,r[14]=l,r[15]=d,r[16]=f,r[17]=p,r[18]=u,r[19]=m):m=r[19],m},Root:v};export{T as RadioGroup};
|
package/dist/sandbar.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as WithAsChild } from "./as-child-D23mGo4f.js";
|
|
2
2
|
import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
|
|
3
|
-
import { r as ButtonProps } from "./button-
|
|
3
|
+
import { r as ButtonProps } from "./button-mzUR1U0Y.js";
|
|
4
4
|
import { ComponentProps, ReactNode, Ref } from "react";
|
|
5
5
|
//#region src/components/sandbar/sandbar.d.ts
|
|
6
6
|
/**
|
|
@@ -254,12 +254,12 @@ type SandbarSaveButtonProps = Omit<ButtonProps, "appearance" | "children" | "int
|
|
|
254
254
|
*
|
|
255
255
|
* | Data Attribute | Value | Description |
|
|
256
256
|
* | ----------------- | ------------------------- | -------------------------------------------------------------------------------------------------- |
|
|
257
|
-
* | `data-slot` | `"sandbar-save-button"`
|
|
257
|
+
* | `data-slot` | `"sandbar-save-button button"` | Stable styling hook, joined ahead of `Button`'s own `button`. |
|
|
258
258
|
* | `data-appearance` | the resolved `appearance` | Stamped by `Button`. |
|
|
259
259
|
* | `data-intent` | the resolved `intent` | Stamped by `Button`. |
|
|
260
260
|
* | `data-size` | the resolved `size` | Stamped by `Button`; absent for `appearance="link"`. |
|
|
261
|
-
* | `data-disabled` |
|
|
262
|
-
* | `data-loading` |
|
|
261
|
+
* | `data-disabled` | present when disabled | Stamped by `Button`. Presence-only, never `"false"`. |
|
|
262
|
+
* | `data-loading` | present when `isLoading` | Stamped by `Button`. Presence-only, never `"false"`. |
|
|
263
263
|
*
|
|
264
264
|
* @see https://mantle.ngrok.com/components/feedback/sandbar#sandbarsavebutton
|
|
265
265
|
*
|
|
@@ -319,12 +319,12 @@ type SandbarDiscardButtonProps = Omit<ButtonProps, "appearance" | "children" | "
|
|
|
319
319
|
*
|
|
320
320
|
* | Data Attribute | Value | Description |
|
|
321
321
|
* | ----------------- | -------------------------- | -------------------------------------------------------------------------------------------------- |
|
|
322
|
-
* | `data-slot` | `"sandbar-discard-button"` | Stable styling hook
|
|
322
|
+
* | `data-slot` | `"sandbar-discard-button button"` | Stable styling hook, joined ahead of `Button`'s own `button`. |
|
|
323
323
|
* | `data-appearance` | the resolved `appearance` | Stamped by `Button`. |
|
|
324
324
|
* | `data-intent` | the resolved `intent` | Stamped by `Button`. |
|
|
325
325
|
* | `data-size` | the resolved `size` | Stamped by `Button`; absent for `appearance="link"`. |
|
|
326
|
-
* | `data-disabled` |
|
|
327
|
-
* | `data-loading` |
|
|
326
|
+
* | `data-disabled` | present when disabled | Stamped by `Button`. Presence-only, never `"false"`. |
|
|
327
|
+
* | `data-loading` | present when `isLoading` | Stamped by `Button`. Presence-only, never `"false"`. |
|
|
328
328
|
*
|
|
329
329
|
* @see https://mantle.ngrok.com/components/feedback/sandbar#sandbardiscardbutton
|
|
330
330
|
*
|
package/dist/sandbar.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"./cx-0HCjnNv1.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{t as i}from"./slot-BsvE2ntj.js";import{t as a}from"./button-Dij5vCQG.js";import{t as o}from"./alternate-announcement-BkH4bOKp.js";import{t as s}from"./use-prefers-reduced-motion-Cj9tJ181.js";import{c}from"react/compiler-runtime";import{createContext as l,useContext as u,useEffect as d,useId as f,useImperativeHandle as p,useRef as m,useState as h}from"react";import g from"tiny-invariant";import{jsx as _,jsxs as v}from"react/jsx-runtime";const y=`Unsaved changes`,b=1e3,x=[{transform:`translateX(0)`},{transform:`translateX(-8px)`},{transform:`translateX(8px)`},{transform:`translateX(-6px)`},{transform:`translateX(6px)`},{transform:`translateX(-3px)`},{transform:`translateX(3px)`},{transform:`translateX(0)`}],S=l(null);function C(e){let t=u(S);return g(t,`${e} must be rendered as a child of <Sandbar.Root>.`),t}const w={Root:e=>{let i=c(65),a,l,u,f,g,C,w,k,A,te;i[0]===e?(a=i[1],l=i[2],u=i[3],f=i[4],g=i[5],C=i[6],w=i[7],k=i[8],A=i[9],te=i[10]):({"aria-label":a,"aria-labelledby":l,children:u,className:f,"data-slot":g,handleRef:C,onTransitionEnd:w,open:k,ref:te,...A}=e,i[0]=e,i[1]=a,i[2]=l,i[3]=u,i[4]=f,i[5]=g,i[6]=C,i[7]=w,i[8]=k,i[9]=A,i[10]=te);let[j,M]=h(k?`open`:`closed`),[ne,re]=h(``),[ie,ae]=h(``),[oe,se]=h(null),ce=m(null),N=m(null),le=t(N,te),P=m(null),F=m(void 0),ue=m(void 0),I=m(void 0),de=m(!1),fe=m(!1),pe=m(!1),me=m(null),L=m(null),he=m(k),ge=m(j),R;i[11]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{re(o(e,de)),window.clearTimeout(F.current),F.current=window.setTimeout(()=>{re(``)},b)},i[11]=R):R=i[11];let _e=R,z;i[12]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{ae(o(e,fe)),window.clearTimeout(ue.current),ue.current=window.setTimeout(()=>{ae(``)},b)},i[12]=z):z=i[12];let ve=z,B;i[13]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>(se(e),()=>{se(t=>t===e?null:t)}),i[13]=B):B=i[13];let ye=B,V;i[14]===Symbol.for(`react.memo_cache_sentinel`)?(V=e=>{let{button:t,isSaving:n}=e,r=pe.current;if(pe.current=n,!n||r||(_e(`Saving changes…`),t==null||!t.matches(`:disabled`)))return;let i=document.activeElement,a=i===t,o=i===document.body&&L.current===t;(a||o)&&N.current?.focus({preventScroll:!0})},i[14]=V):V=i[14];let be=V,H;i[15]===Symbol.for(`react.memo_cache_sentinel`)?(H=e=>{ve(e?.announcement??`You have unsaved changes. Save or discard them before leaving.`);let t=N.current;if(t==null||s()||typeof t.animate!=`function`)return;P.current!=null&&(P.current.cancel(),P.current=null);let n=t.animate(x,{duration:400,easing:`ease-in-out`});n.finished.catch(T),n.onfinish=()=>{P.current=null},P.current=n},i[15]=H):H=i[15];let xe=H,U,W;i[16]===Symbol.for(`react.memo_cache_sentinel`)?(U=()=>({shake:xe}),W=[xe],i[16]=U,i[17]=W):(U=i[16],W=i[17]),p(C,U,W);let G;i[18]===Symbol.for(`react.memo_cache_sentinel`)?(G={announceAssertive:ve,registerMessage:ye,reportSaving:be},i[18]=G):G=i[18];let Se=G,K,q;i[19]===k?(K=i[20],q=i[21]):(q=()=>{M(k?E:D)},K=[k],i[19]=k,i[20]=K,i[21]=q),d(q,K);let Ce,we;i[22]===j?(Ce=i[23],we=i[24]):(Ce=()=>{if(j!==`opening`)return;let e=window.requestAnimationFrame(()=>{e=window.requestAnimationFrame(()=>{M(O)})});return()=>{window.cancelAnimationFrame(e)}},we=[j],i[22]=j,i[23]=Ce,i[24]=we),d(Ce,we);let Te,Ee;i[25]===j?(Te=i[26],Ee=i[27]):(Te=()=>{if(j!==`closing`)return;let e=window.setTimeout(()=>{M(`closed`)},400);return()=>{window.clearTimeout(e)}},Ee=[j],i[25]=j,i[26]=Te,i[27]=Ee),d(Te,Ee);let De,Oe;i[28]!==a||i[29]!==k?(De=()=>{let e=he.current;if(he.current=k,!k){e&&(window.clearTimeout(F.current),re(``));return}if(e)return;let t=(N.current?.querySelector(`[data-slot~="sandbar-message"]`))?.textContent?.trim();_e(t||a||y)},Oe=[_e,a,k],i[28]=a,i[29]=k,i[30]=De,i[31]=Oe):(De=i[30],Oe=i[31]),d(De,Oe);let ke,Ae;i[32]===j?(ke=i[33],Ae=i[34]):(ke=()=>{let e=ge.current;if(ge.current=j,j!==`closed`||e!==`closing`)return;let t=ce.current,n=document.activeElement,r=t!=null&&n instanceof HTMLElement&&t.contains(n),i=n===document.body&&L.current!=null,a=me.current;me.current=null,L.current=null,(r||i)&&a!=null&&a.isConnected&&!a.matches(`:disabled`)&&(typeof a.checkVisibility!=`function`||a.checkVisibility())&&a.focus()},Ae=[j],i[32]=j,i[33]=ke,i[34]=Ae),d(ke,Ae);let je,Me;i[35]===Symbol.for(`react.memo_cache_sentinel`)?(je=()=>()=>{window.clearTimeout(F.current),window.clearTimeout(ue.current),I.current!=null&&window.cancelAnimationFrame(I.current),P.current?.cancel()},Me=[],i[35]=je,i[36]=Me):(je=i[35],Me=i[36]),d(je,Me);let Ne;i[37]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=e=>{let t=ce.current,n=e.relatedTarget;t!=null&&(n==null||!t.contains(n))&&n instanceof HTMLElement&&(me.current=n),e.target instanceof HTMLElement&&(L.current=e.target)},i[37]=Ne):Ne=i[37];let Pe=Ne,Fe;i[38]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=e=>{if(e.relatedTarget!=null){let t=ce.current;(t==null||!t.contains(e.relatedTarget))&&(L.current=null);return}let t=e.target;t instanceof HTMLElement&&(I.current!=null&&window.cancelAnimationFrame(I.current),I.current=window.requestAnimationFrame(()=>{I.current=void 0;let e=N.current;e==null||e.hidden||(!t.isConnected||t.matches(`:disabled`)||t.hidden)&&document.activeElement===document.body&&e.focus({preventScroll:!0})}))},i[38]=Fe):Fe=i[38];let Ie=Fe,Le;i[39]===w?Le=i[40]:(Le=e=>{w?.(e),e.target===e.currentTarget&&(e.propertyName===`opacity`||e.propertyName===`translate`)&&M(ee)},i[39]=w,i[40]=Le);let Re=Le,ze=l??(a==null&&oe!=null?oe:void 0),Be=ze==null?a??y:a,Ve=j===`closed`,He=Ve||j===`closing`,J;i[41]===ne?J=i[42]:(J=_(`div`,{"aria-atomic":`true`,"aria-live":`polite`,className:`sr-only`,role:`status`,children:ne}),i[41]=ne,i[42]=J);let Y;i[43]===ie?Y=i[44]:(Y=_(`div`,{className:`sr-only`,role:`alert`,children:ie}),i[43]=ie,i[44]=Y);let X;i[45]===f?X=i[46]:(X=n(`invert-theme pointer-events-auto flex w-fit max-w-full flex-wrap items-center justify-center gap-x-4 gap-y-2 rounded-2xl border border-transparent bg-base px-4 py-3 text-strong shadow-lg`,`max-h-[60svh] overflow-y-auto`,`focus:outline-hidden`,`[&[hidden]]:hidden`,`transition-[opacity,translate] ease-out`,`data-state-open:duration-400`,`data-state-closed:pointer-events-none data-state-closed:opacity-0 data-state-closed:duration-200 motion-safe:data-state-closed:translate-y-[calc(100%+2.5rem)]`,`data-state-closed:ease-[cubic-bezier(0.4,0,1,1),cubic-bezier(0,0,0.2,1)]`,f),i[45]=f,i[46]=X);let Z;i[47]===g?Z=i[48]:(Z=r(g,`sandbar`),i[47]=g,i[48]=Z);let Ue=j===`open`?`open`:`closed`,We=Ve?!0:void 0,Ge=He?!0:void 0,Q;i[49]!==u||i[50]!==le||i[51]!==Re||i[52]!==Be||i[53]!==ze||i[54]!==A||i[55]!==X||i[56]!==Z||i[57]!==Ue||i[58]!==We||i[59]!==Ge?(Q=_(`div`,{className:X,...A,"aria-label":Be,"aria-labelledby":ze,"data-slot":Z,"data-state":Ue,hidden:We,inert:Ge,onTransitionEnd:Re,ref:le,role:`group`,tabIndex:-1,children:u}),i[49]=u,i[50]=le,i[51]=Re,i[52]=Be,i[53]=ze,i[54]=A,i[55]=X,i[56]=Z,i[57]=Ue,i[58]=We,i[59]=Ge,i[60]=Q):Q=i[60];let $;return i[61]!==J||i[62]!==Y||i[63]!==Q?($=_(S.Provider,{value:Se,children:v(`div`,{className:`pointer-events-none fixed inset-x-0 bottom-4 z-50 flex justify-center px-4 sm:bottom-10`,onBlur:Ie,onFocus:Pe,ref:ce,children:[J,Y,Q]})}),i[61]=J,i[62]=Y,i[63]=Q,i[64]=$):$=i[64],$},Message:a=>{let o=c(22),s,l,u,d,p,h;o[0]===a?(s=o[1],l=o[2],u=o[3],d=o[4],p=o[5],h=o[6]):({asChild:s,className:l,"data-slot":u,id:d,ref:h,...p}=a,o[0]=a,o[1]=s,o[2]=l,o[3]=u,o[4]=d,o[5]=p,o[6]=h);let{registerMessage:g}=C(`Sandbar.Message`),v=f(),y=d??v,b=m(null),x=t(b,h),S,w;o[7]!==y||o[8]!==g?(S=()=>g(b.current?.id||y),w=[y,g],o[7]=y,o[8]=g,o[9]=S,o[10]=w):(S=o[9],w=o[10]),e(S,w);let T=s?i:`p`,E;o[11]===l?E=o[12]:(E=n(`text-sm font-sans`,l),o[11]=l,o[12]=E);let D;o[13]===u?D=o[14]:(D=r(u,`sandbar-message`),o[13]=u,o[14]=D);let O;return o[15]!==T||o[16]!==x||o[17]!==y||o[18]!==p||o[19]!==E||o[20]!==D?(O=_(T,{className:E,id:y,...p,"data-slot":D,ref:x}),o[15]=T,o[16]=x,o[17]=y,o[18]=p,o[19]=E,o[20]=D,o[21]=O):O=o[21],O},Actions:e=>{let t=c(14),a,o,s,l;t[0]===e?(a=t[1],o=t[2],s=t[3],l=t[4]):({asChild:a,className:o,"data-slot":s,...l}=e,t[0]=e,t[1]=a,t[2]=o,t[3]=s,t[4]=l);let u=a?i:`div`,d;t[5]===o?d=t[6]:(d=n(`flex flex-wrap items-center justify-center gap-2`,o),t[5]=o,t[6]=d);let f;t[7]===s?f=t[8]:(f=r(s,`sandbar-actions`),t[7]=s,t[8]=f);let p;return t[9]!==u||t[10]!==l||t[11]!==d||t[12]!==f?(p=_(u,{className:d,...l,"data-slot":f}),t[9]=u,t[10]=l,t[11]=d,t[12]=f,t[13]=p):p=t[13],p},SaveButton:n=>{let i=c(25),o,s,l,u,d,f,p;i[0]===n?(o=i[1],s=i[2],l=i[3],u=i[4],d=i[5],f=i[6],p=i[7]):({appearance:d,children:o,"data-slot":s,intent:f,isLoading:p,ref:u,...l}=n,i[0]=n,i[1]=o,i[2]=s,i[3]=l,i[4]=u,i[5]=d,i[6]=f,i[7]=p);let h=d===void 0?`filled`:d,g=f===void 0?`neutral`:f,v=p!==void 0&&p,{reportSaving:y}=C(`Sandbar.SaveButton`),b=m(null),x=t(b,u),S,w;i[8]!==v||i[9]!==y?(S=()=>{y({button:b.current,isSaving:!!v})},w=[v,y],i[8]=v,i[9]=y,i[10]=S,i[11]=w):(S=i[10],w=i[11]),e(S,w);let T,E;i[12]===y?(T=i[13],E=i[14]):(T=()=>()=>{y({button:null,isSaving:!1})},E=[y],i[12]=y,i[13]=T,i[14]=E),e(T,E);let D;i[15]===s?D=i[16]:(D=r(s,`sandbar-save-button`),i[15]=s,i[16]=D);let O;return i[17]!==h||i[18]!==o||i[19]!==x||i[20]!==g||i[21]!==v||i[22]!==l||i[23]!==D?(O=_(a,{appearance:h,intent:g,isLoading:v,ref:x,...l,"data-slot":D,children:o}),i[17]=h,i[18]=o,i[19]=x,i[20]=g,i[21]=v,i[22]=l,i[23]=D,i[24]=O):O=i[24],O},DiscardButton:e=>{let t=c(14),n,i,o,s,l;t[0]===e?(n=t[1],i=t[2],o=t[3],s=t[4],l=t[5]):({appearance:s,children:n,"data-slot":i,intent:l,...o}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=o,t[4]=s,t[5]=l);let u=s===void 0?`outlined`:s,d=l===void 0?`neutral`:l,f;t[6]===i?f=t[7]:(f=r(i,`sandbar-discard-button`),t[6]=i,t[7]=f);let p;return t[8]!==u||t[9]!==n||t[10]!==d||t[11]!==o||t[12]!==f?(p=_(a,{appearance:u,intent:d,...o,"data-slot":f,children:n}),t[8]=u,t[9]=n,t[10]=d,t[11]=o,t[12]=f,t[13]=p):p=t[13],p}};function T(){}function E(e){return e===`open`||e===`opening`?e:e===`closing`?`open`:`opening`}function D(e){return e===`closed`?e:e===`opening`?`closed`:`closing`}function O(e){return e===`opening`?`open`:e}function ee(e){return e===`closing`?`closed`:e}export{w as Sandbar};
|
|
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"./cx-CK7o_rVv.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{t as i}from"./slot-DdYN1L1C.js";import{t as a}from"./button-b2HKEIE2.js";import{t as o}from"./alternate-announcement-BkH4bOKp.js";import{t as s}from"./use-prefers-reduced-motion-Cj9tJ181.js";import{c}from"react/compiler-runtime";import{createContext as l,useContext as u,useEffect as d,useId as f,useImperativeHandle as p,useRef as m,useState as h}from"react";import g from"tiny-invariant";import{jsx as _,jsxs as v}from"react/jsx-runtime";const y=`Unsaved changes`,b=1e3,x=[{transform:`translateX(0)`},{transform:`translateX(-8px)`},{transform:`translateX(8px)`},{transform:`translateX(-6px)`},{transform:`translateX(6px)`},{transform:`translateX(-3px)`},{transform:`translateX(3px)`},{transform:`translateX(0)`}],S=l(null);function C(e){let t=u(S);return g(t,`${e} must be rendered as a child of <Sandbar.Root>.`),t}const w={Root:e=>{let i=c(65),a,l,u,f,g,C,w,k,A,te;i[0]===e?(a=i[1],l=i[2],u=i[3],f=i[4],g=i[5],C=i[6],w=i[7],k=i[8],A=i[9],te=i[10]):({"aria-label":a,"aria-labelledby":l,children:u,className:f,"data-slot":g,handleRef:C,onTransitionEnd:w,open:k,ref:te,...A}=e,i[0]=e,i[1]=a,i[2]=l,i[3]=u,i[4]=f,i[5]=g,i[6]=C,i[7]=w,i[8]=k,i[9]=A,i[10]=te);let[j,M]=h(k?`open`:`closed`),[ne,re]=h(``),[ie,ae]=h(``),[oe,se]=h(null),ce=m(null),N=m(null),le=t(N,te),P=m(null),F=m(void 0),ue=m(void 0),I=m(void 0),de=m(!1),fe=m(!1),pe=m(!1),me=m(null),L=m(null),he=m(k),ge=m(j),R;i[11]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{re(o(e,de)),window.clearTimeout(F.current),F.current=window.setTimeout(()=>{re(``)},b)},i[11]=R):R=i[11];let _e=R,z;i[12]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{ae(o(e,fe)),window.clearTimeout(ue.current),ue.current=window.setTimeout(()=>{ae(``)},b)},i[12]=z):z=i[12];let ve=z,B;i[13]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>(se(e),()=>{se(t=>t===e?null:t)}),i[13]=B):B=i[13];let ye=B,V;i[14]===Symbol.for(`react.memo_cache_sentinel`)?(V=e=>{let{button:t,isSaving:n}=e,r=pe.current;if(pe.current=n,!n||r||(_e(`Saving changes…`),t==null||!t.matches(`:disabled`)))return;let i=document.activeElement,a=i===t,o=i===document.body&&L.current===t;(a||o)&&N.current?.focus({preventScroll:!0})},i[14]=V):V=i[14];let be=V,H;i[15]===Symbol.for(`react.memo_cache_sentinel`)?(H=e=>{ve(e?.announcement??`You have unsaved changes. Save or discard them before leaving.`);let t=N.current;if(t==null||s()||typeof t.animate!=`function`)return;P.current!=null&&(P.current.cancel(),P.current=null);let n=t.animate(x,{duration:400,easing:`ease-in-out`});n.finished.catch(T),n.onfinish=()=>{P.current=null},P.current=n},i[15]=H):H=i[15];let xe=H,U,W;i[16]===Symbol.for(`react.memo_cache_sentinel`)?(U=()=>({shake:xe}),W=[xe],i[16]=U,i[17]=W):(U=i[16],W=i[17]),p(C,U,W);let G;i[18]===Symbol.for(`react.memo_cache_sentinel`)?(G={announceAssertive:ve,registerMessage:ye,reportSaving:be},i[18]=G):G=i[18];let Se=G,K,q;i[19]===k?(K=i[20],q=i[21]):(q=()=>{M(k?E:D)},K=[k],i[19]=k,i[20]=K,i[21]=q),d(q,K);let Ce,we;i[22]===j?(Ce=i[23],we=i[24]):(Ce=()=>{if(j!==`opening`)return;let e=window.requestAnimationFrame(()=>{e=window.requestAnimationFrame(()=>{M(O)})});return()=>{window.cancelAnimationFrame(e)}},we=[j],i[22]=j,i[23]=Ce,i[24]=we),d(Ce,we);let Te,Ee;i[25]===j?(Te=i[26],Ee=i[27]):(Te=()=>{if(j!==`closing`)return;let e=window.setTimeout(()=>{M(`closed`)},400);return()=>{window.clearTimeout(e)}},Ee=[j],i[25]=j,i[26]=Te,i[27]=Ee),d(Te,Ee);let De,Oe;i[28]!==a||i[29]!==k?(De=()=>{let e=he.current;if(he.current=k,!k){e&&(window.clearTimeout(F.current),re(``));return}if(e)return;let t=(N.current?.querySelector(`[data-slot~="sandbar-message"]`))?.textContent?.trim();_e(t||a||y)},Oe=[_e,a,k],i[28]=a,i[29]=k,i[30]=De,i[31]=Oe):(De=i[30],Oe=i[31]),d(De,Oe);let ke,Ae;i[32]===j?(ke=i[33],Ae=i[34]):(ke=()=>{let e=ge.current;if(ge.current=j,j!==`closed`||e!==`closing`)return;let t=ce.current,n=document.activeElement,r=t!=null&&n instanceof HTMLElement&&t.contains(n),i=n===document.body&&L.current!=null,a=me.current;me.current=null,L.current=null,(r||i)&&a!=null&&a.isConnected&&!a.matches(`:disabled`)&&(typeof a.checkVisibility!=`function`||a.checkVisibility())&&a.focus()},Ae=[j],i[32]=j,i[33]=ke,i[34]=Ae),d(ke,Ae);let je,Me;i[35]===Symbol.for(`react.memo_cache_sentinel`)?(je=()=>()=>{window.clearTimeout(F.current),window.clearTimeout(ue.current),I.current!=null&&window.cancelAnimationFrame(I.current),P.current?.cancel()},Me=[],i[35]=je,i[36]=Me):(je=i[35],Me=i[36]),d(je,Me);let Ne;i[37]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=e=>{let t=ce.current,n=e.relatedTarget;t!=null&&(n==null||!t.contains(n))&&n instanceof HTMLElement&&(me.current=n),e.target instanceof HTMLElement&&(L.current=e.target)},i[37]=Ne):Ne=i[37];let Pe=Ne,Fe;i[38]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=e=>{if(e.relatedTarget!=null){let t=ce.current;(t==null||!t.contains(e.relatedTarget))&&(L.current=null);return}let t=e.target;t instanceof HTMLElement&&(I.current!=null&&window.cancelAnimationFrame(I.current),I.current=window.requestAnimationFrame(()=>{I.current=void 0;let e=N.current;e==null||e.hidden||(!t.isConnected||t.matches(`:disabled`)||t.hidden)&&document.activeElement===document.body&&e.focus({preventScroll:!0})}))},i[38]=Fe):Fe=i[38];let Ie=Fe,Le;i[39]===w?Le=i[40]:(Le=e=>{w?.(e),e.target===e.currentTarget&&(e.propertyName===`opacity`||e.propertyName===`translate`)&&M(ee)},i[39]=w,i[40]=Le);let Re=Le,ze=l??(a==null&&oe!=null?oe:void 0),Be=ze==null?a??y:a,Ve=j===`closed`,He=Ve||j===`closing`,J;i[41]===ne?J=i[42]:(J=/* @__PURE__ */ _(`div`,{"aria-atomic":`true`,"aria-live":`polite`,className:`sr-only`,role:`status`,children:ne}),i[41]=ne,i[42]=J);let Y;i[43]===ie?Y=i[44]:(Y=/* @__PURE__ */ _(`div`,{className:`sr-only`,role:`alert`,children:ie}),i[43]=ie,i[44]=Y);let X;i[45]===f?X=i[46]:(X=n(`invert-theme pointer-events-auto flex w-fit max-w-full flex-wrap items-center justify-center gap-x-4 gap-y-2 rounded-2xl border border-transparent bg-base px-4 py-3 text-strong shadow-lg`,`max-h-[60svh] overflow-y-auto`,`focus:outline-hidden`,`[&[hidden]]:hidden`,`transition-[opacity,translate] ease-out`,`data-state-open:duration-400`,`data-state-closed:pointer-events-none data-state-closed:opacity-0 data-state-closed:duration-200 motion-safe:data-state-closed:translate-y-[calc(100%+2.5rem)]`,`data-state-closed:ease-[cubic-bezier(0.4,0,1,1),cubic-bezier(0,0,0.2,1)]`,f),i[45]=f,i[46]=X);let Z;i[47]===g?Z=i[48]:(Z=r(g,`sandbar`),i[47]=g,i[48]=Z);let Ue=j===`open`?`open`:`closed`,We=Ve?!0:void 0,Ge=He?!0:void 0,Q;i[49]!==u||i[50]!==le||i[51]!==Re||i[52]!==Be||i[53]!==ze||i[54]!==A||i[55]!==X||i[56]!==Z||i[57]!==Ue||i[58]!==We||i[59]!==Ge?(Q=/* @__PURE__ */ _(`div`,{className:X,...A,"aria-label":Be,"aria-labelledby":ze,"data-slot":Z,"data-state":Ue,hidden:We,inert:Ge,onTransitionEnd:Re,ref:le,role:`group`,tabIndex:-1,children:u}),i[49]=u,i[50]=le,i[51]=Re,i[52]=Be,i[53]=ze,i[54]=A,i[55]=X,i[56]=Z,i[57]=Ue,i[58]=We,i[59]=Ge,i[60]=Q):Q=i[60];let $;return i[61]!==J||i[62]!==Y||i[63]!==Q?($=/* @__PURE__ */ _(S.Provider,{value:Se,children:/* @__PURE__ */ v(`div`,{className:`pointer-events-none fixed inset-x-0 bottom-4 z-50 flex justify-center px-4 sm:bottom-10`,onBlur:Ie,onFocus:Pe,ref:ce,children:[J,Y,Q]})}),i[61]=J,i[62]=Y,i[63]=Q,i[64]=$):$=i[64],$},Message:a=>{let o=c(22),s,l,u,d,p,h;o[0]===a?(s=o[1],l=o[2],u=o[3],d=o[4],p=o[5],h=o[6]):({asChild:s,className:l,"data-slot":u,id:d,ref:h,...p}=a,o[0]=a,o[1]=s,o[2]=l,o[3]=u,o[4]=d,o[5]=p,o[6]=h);let{registerMessage:g}=C(`Sandbar.Message`),v=f(),y=d??v,b=m(null),x=t(b,h),S,w;o[7]!==y||o[8]!==g?(S=()=>g(b.current?.id||y),w=[y,g],o[7]=y,o[8]=g,o[9]=S,o[10]=w):(S=o[9],w=o[10]),e(S,w);let T=s?i:`p`,E;o[11]===l?E=o[12]:(E=n(`text-sm font-sans`,l),o[11]=l,o[12]=E);let D;o[13]===u?D=o[14]:(D=r(u,`sandbar-message`),o[13]=u,o[14]=D);let O;return o[15]!==T||o[16]!==x||o[17]!==y||o[18]!==p||o[19]!==E||o[20]!==D?(O=/* @__PURE__ */ _(T,{className:E,id:y,...p,"data-slot":D,ref:x}),o[15]=T,o[16]=x,o[17]=y,o[18]=p,o[19]=E,o[20]=D,o[21]=O):O=o[21],O},Actions:e=>{let t=c(14),a,o,s,l;t[0]===e?(a=t[1],o=t[2],s=t[3],l=t[4]):({asChild:a,className:o,"data-slot":s,...l}=e,t[0]=e,t[1]=a,t[2]=o,t[3]=s,t[4]=l);let u=a?i:`div`,d;t[5]===o?d=t[6]:(d=n(`flex flex-wrap items-center justify-center gap-2`,o),t[5]=o,t[6]=d);let f;t[7]===s?f=t[8]:(f=r(s,`sandbar-actions`),t[7]=s,t[8]=f);let p;return t[9]!==u||t[10]!==l||t[11]!==d||t[12]!==f?(p=/* @__PURE__ */ _(u,{className:d,...l,"data-slot":f}),t[9]=u,t[10]=l,t[11]=d,t[12]=f,t[13]=p):p=t[13],p},SaveButton:n=>{let i=c(25),o,s,l,u,d,f,p;i[0]===n?(o=i[1],s=i[2],l=i[3],u=i[4],d=i[5],f=i[6],p=i[7]):({appearance:d,children:o,"data-slot":s,intent:f,isLoading:p,ref:u,...l}=n,i[0]=n,i[1]=o,i[2]=s,i[3]=l,i[4]=u,i[5]=d,i[6]=f,i[7]=p);let h=d===void 0?`filled`:d,g=f===void 0?`neutral`:f,v=p!==void 0&&p,{reportSaving:y}=C(`Sandbar.SaveButton`),b=m(null),x=t(b,u),S,w;i[8]!==v||i[9]!==y?(S=()=>{y({button:b.current,isSaving:!!v})},w=[v,y],i[8]=v,i[9]=y,i[10]=S,i[11]=w):(S=i[10],w=i[11]),e(S,w);let T,E;i[12]===y?(T=i[13],E=i[14]):(T=()=>()=>{y({button:null,isSaving:!1})},E=[y],i[12]=y,i[13]=T,i[14]=E),e(T,E);let D;i[15]===s?D=i[16]:(D=r(s,`sandbar-save-button`),i[15]=s,i[16]=D);let O;return i[17]!==h||i[18]!==o||i[19]!==x||i[20]!==g||i[21]!==v||i[22]!==l||i[23]!==D?(O=/* @__PURE__ */ _(a,{appearance:h,intent:g,isLoading:v,ref:x,...l,"data-slot":D,children:o}),i[17]=h,i[18]=o,i[19]=x,i[20]=g,i[21]=v,i[22]=l,i[23]=D,i[24]=O):O=i[24],O},DiscardButton:e=>{let t=c(14),n,i,o,s,l;t[0]===e?(n=t[1],i=t[2],o=t[3],s=t[4],l=t[5]):({appearance:s,children:n,"data-slot":i,intent:l,...o}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=o,t[4]=s,t[5]=l);let u=s===void 0?`outlined`:s,d=l===void 0?`neutral`:l,f;t[6]===i?f=t[7]:(f=r(i,`sandbar-discard-button`),t[6]=i,t[7]=f);let p;return t[8]!==u||t[9]!==n||t[10]!==d||t[11]!==o||t[12]!==f?(p=/* @__PURE__ */ _(a,{appearance:u,intent:d,...o,"data-slot":f,children:n}),t[8]=u,t[9]=n,t[10]=d,t[11]=o,t[12]=f,t[13]=p):p=t[13],p}};function T(){}function E(e){return e===`open`||e===`opening`?e:e===`closing`?`open`:`opening`}function D(e){return e===`closed`?e:e===`opening`?`closed`:`closing`}function O(e){return e===`opening`?`open`:e}function ee(e){return e===`closing`?`closed`:e}export{w as Sandbar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./slot-
|
|
1
|
+
import{t as e}from"./slot-DdYN1L1C.js";import{c as t}from"react/compiler-runtime";import{jsx as n}from"react/jsx-runtime";const r=({allowClickEventDefault:e=!1,onClick:t}={})=>({role:`presentation`,onClick:n=>{n.stopPropagation(),e||n.preventDefault(),t?.(n)}}),i=i=>{let a=t(23),o,s,c,l,u,d;a[0]===i?(o=a[1],s=a[2],c=a[3],l=a[4],u=a[5],d=a[6]):({allowClickEventDefault:u,asChild:d,children:o,onClick:s,ref:l,...c}=i,a[0]=i,a[1]=o,a[2]=s,a[3]=c,a[4]=l,a[5]=u,a[6]=d);let f=u!==void 0&&u,p=d!==void 0&&d,m=p?e:`div`,h;a[7]!==f||a[8]!==s?(h=r({allowClickEventDefault:f,onClick:s}),a[7]=f,a[8]=s,a[9]=h):h=a[9];let g,_;a[10]===h?(g=a[11],_=a[12]):({role:g,..._}=h,a[10]=h,a[11]=g,a[12]=_);let v;a[13]!==p||a[14]!==g?(v=!p&&{role:g},a[13]=p,a[14]=g,a[15]=v):v=a[15];let y;return a[16]!==m||a[17]!==o||a[18]!==c||a[19]!==l||a[20]!==_||a[21]!==v?(y=/* @__PURE__ */ n(m,{ref:l,...c,..._,...v,children:o}),a[16]=m,a[17]=o,a[18]=c,a[19]=l,a[20]=_,a[21]=v,a[22]=y):y=a[22],y};export{r as n,i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{t as SandboxedOnClick,n as sandboxedOnClickProps}from"./sandboxed-on-click-C7pPu-2M.js";
|