@ngrok/mantle 0.76.6 → 0.76.7

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.
@@ -1,10 +1,45 @@
1
+ import { t as WithAsChild } from "./as-child-uN_018tj.js";
1
2
  import { n as IconProps } from "./icon-n49kOh4_.js";
2
- import * as AccordionPrimitive from "@radix-ui/react-accordion";
3
3
  import { ComponentPropsWithoutRef } from "react";
4
4
 
5
5
  //#region src/components/accordion/accordion.d.ts
6
6
  /**
7
- * A vertically stacked set of interactive headings that each reveal a section of content.
7
+ * `"single"` mode props: at most one item open at a time. `value`/`defaultValue`
8
+ * are the open item's value (`""` for none).
9
+ */
10
+ type AccordionSingleProps = {
11
+ type: "single"; /** The controlled open item value (`""` for none). */
12
+ value?: string; /** The initial open item value when uncontrolled. */
13
+ defaultValue?: string; /** Called with the newly open item value (`""` when collapsed). */
14
+ onValueChange?: (value: string) => void;
15
+ };
16
+ /**
17
+ * `"multiple"` mode props: any number of items may be open. `value`/`defaultValue`
18
+ * are the list of open item values.
19
+ */
20
+ type AccordionMultipleProps = {
21
+ type: "multiple"; /** The controlled list of open item values. */
22
+ value?: string[]; /** The initial list of open item values when uncontrolled. */
23
+ defaultValue?: string[]; /** Called with the new list of open item values. */
24
+ onValueChange?: (value: string[]) => void;
25
+ };
26
+ /**
27
+ * Props for {@link Root}. A discriminated union on `type` so `value`,
28
+ * `defaultValue`, and `onValueChange` are typed as a single string in
29
+ * `"single"` mode and a string array in `"multiple"` mode. Also accepts all
30
+ * standard `<div>` props (forwarded to the container) plus `asChild`.
31
+ */
32
+ type AccordionRootProps = (AccordionSingleProps | AccordionMultipleProps) & Omit<ComponentPropsWithoutRef<"div">, "defaultValue"> & WithAsChild;
33
+ /**
34
+ * A vertically stacked set of disclosure sections styled after the shadcn /
35
+ * ngrok.com accordion.
36
+ *
37
+ * Its defining feature: collapsed content is never removed from the DOM — it
38
+ * stays put with `hidden="until-found"` — so the browser's find-in-page (⌘F /
39
+ * Ctrl-F) can find text inside closed sections and auto-expand them (synced via
40
+ * the `beforematch` event). Built on plain `<div>`/`<button>` elements, so a
41
+ * section header can be any layout, including a non-toggling action button
42
+ * beside the trigger.
8
43
  *
9
44
  * @see https://mantle.ngrok.com/components/accordion
10
45
  *
@@ -12,181 +47,122 @@ import { ComponentPropsWithoutRef } from "react";
12
47
  * Composition:
13
48
  * ```
14
49
  * Accordion.Root
15
- * ├── Accordion.Item
16
- *├── Accordion.Heading
17
- * └── Accordion.Trigger
18
- * │ │ └── Accordion.TriggerIcon
19
- * │ └── Accordion.Content
50
+ * └── Accordion.Item
51
+ * ├── Accordion.Trigger
52
+ * │ └── Accordion.TriggerIcon
53
+ * └── Accordion.Content
20
54
  * ```
21
55
  *
22
56
  * @example
23
- * ```tsx
24
- * <Accordion.Root type="single" collapsible>
57
+ * <Accordion.Root type="single" defaultValue="item-1">
25
58
  * <Accordion.Item value="item-1">
26
- * <Accordion.Heading>
27
- * <Accordion.Trigger>
28
- * <Accordion.TriggerIcon />
29
- * Is it accessible?
30
- * </Accordion.Trigger>
31
- * </Accordion.Heading>
59
+ * <Accordion.Trigger>
60
+ * Is it accessible?
61
+ * <Accordion.TriggerIcon />
62
+ * </Accordion.Trigger>
32
63
  * <Accordion.Content>
33
- * Yes. It adheres to the WAI-ARIA design pattern.
64
+ * Yes. It adheres to the WAI-ARIA disclosure pattern.
34
65
  * </Accordion.Content>
35
66
  * </Accordion.Item>
36
67
  * </Accordion.Root>
37
- * ```
38
68
  */
39
69
  declare const Accordion: {
40
70
  /**
41
- * A vertically stacked set of interactive headings that each reveal a section of content.
42
- * The root component that contains all accordion items.
43
- *
44
- * @see https://mantle.ngrok.com/components/accordion#api-accordion
71
+ * The root that owns open/closed state. See {@link Root}.
45
72
  *
46
73
  * @example
47
- * ```tsx
48
- * <Accordion.Root type="single" collapsible>
74
+ * <Accordion.Root type="single" defaultValue="item-1">
49
75
  * <Accordion.Item value="item-1">
50
- * <Accordion.Heading>
51
- * <Accordion.Trigger>
52
- * <Accordion.TriggerIcon />
53
- * Is it accessible?
54
- * </Accordion.Trigger>
55
- * </Accordion.Heading>
76
+ * <Accordion.Trigger>
77
+ * Is it accessible?
78
+ * <Accordion.TriggerIcon />
79
+ * </Accordion.Trigger>
56
80
  * <Accordion.Content>
57
- * Yes. It adheres to the WAI-ARIA design pattern.
81
+ * Yes. It adheres to the WAI-ARIA disclosure pattern.
58
82
  * </Accordion.Content>
59
83
  * </Accordion.Item>
60
84
  * </Accordion.Root>
61
- * ```
62
85
  */
63
- readonly Root: import("react").ForwardRefExoticComponent<ComponentPropsWithoutRef<import("react").ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & import("react").RefAttributes<HTMLDivElement>>> & import("react").RefAttributes<HTMLDivElement>>;
86
+ readonly Root: import("react").ForwardRefExoticComponent<AccordionRootProps & import("react").RefAttributes<HTMLDivElement>>;
64
87
  /**
65
- * Contains the collapsible content for an item.
66
- * The content area that is revealed when the accordion item is expanded.
67
- *
68
- * @see https://mantle.ngrok.com/components/accordion#api-accordion-content
88
+ * A single collapsible section. See {@link Item}.
69
89
  *
70
90
  * @example
71
- * ```tsx
72
- * <Accordion.Root type="single" collapsible>
91
+ * <Accordion.Root type="single" defaultValue="item-1">
73
92
  * <Accordion.Item value="item-1">
74
- * <Accordion.Heading>
75
- * <Accordion.Trigger>
76
- * <Accordion.TriggerIcon />
77
- * Is it accessible?
78
- * </Accordion.Trigger>
79
- * </Accordion.Heading>
93
+ * <Accordion.Trigger>
94
+ * Is it accessible?
95
+ * <Accordion.TriggerIcon />
96
+ * </Accordion.Trigger>
80
97
  * <Accordion.Content>
81
- * Yes. It adheres to the WAI-ARIA design pattern.
98
+ * Yes. It adheres to the WAI-ARIA disclosure pattern.
82
99
  * </Accordion.Content>
83
100
  * </Accordion.Item>
84
101
  * </Accordion.Root>
85
- * ```
86
102
  */
87
- readonly Content: import("react").ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
103
+ readonly Item: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
104
+ /** The unique value identifying this item within its accordion. */value: string;
105
+ } & import("react").RefAttributes<HTMLDivElement>>;
88
106
  /**
89
- * Wraps an AccordionTrigger.
90
- * Contains the accordion trigger and provides proper heading semantics.
91
- *
92
- * @see https://mantle.ngrok.com/components/accordion#api-accordion-heading
107
+ * The `<button>` header that toggles a section. See {@link Trigger}.
93
108
  *
94
109
  * @example
95
- * ```tsx
96
- * <Accordion.Root type="single" collapsible>
110
+ * <Accordion.Root type="single" defaultValue="item-1">
97
111
  * <Accordion.Item value="item-1">
98
- * <Accordion.Heading>
99
- * <Accordion.Trigger>
100
- * <Accordion.TriggerIcon />
101
- * Is it accessible?
102
- * </Accordion.Trigger>
103
- * </Accordion.Heading>
112
+ * <Accordion.Trigger>
113
+ * Is it accessible?
114
+ * <Accordion.TriggerIcon />
115
+ * </Accordion.Trigger>
104
116
  * <Accordion.Content>
105
- * Yes. It adheres to the WAI-ARIA design pattern.
117
+ * Yes. It adheres to the WAI-ARIA disclosure pattern.
106
118
  * </Accordion.Content>
107
119
  * </Accordion.Item>
108
120
  * </Accordion.Root>
109
- * ```
110
121
  */
111
- readonly Heading: import("react").ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionHeaderProps & import("react").RefAttributes<HTMLHeadingElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
122
+ readonly Trigger: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "type"> & import("react").RefAttributes<HTMLButtonElement>>;
112
123
  /**
113
- * Contains all the parts of a collapsible section.
114
- * A single accordion item that can be expanded or collapsed.
115
- *
116
- * @see https://mantle.ngrok.com/components/accordion#api-accordion-item
124
+ * The caret indicating open/closed state. See {@link TriggerIcon}.
117
125
  *
118
126
  * @example
119
- * ```tsx
120
- * <Accordion.Root type="single" collapsible>
127
+ * <Accordion.Root type="single" defaultValue="item-1">
121
128
  * <Accordion.Item value="item-1">
122
- * <Accordion.Heading>
123
- * <Accordion.Trigger>
124
- * <Accordion.TriggerIcon />
125
- * Is it accessible?
126
- * </Accordion.Trigger>
127
- * </Accordion.Heading>
129
+ * <Accordion.Trigger>
130
+ * Is it accessible?
131
+ * <Accordion.TriggerIcon />
132
+ * </Accordion.Trigger>
128
133
  * <Accordion.Content>
129
- * Yes. It adheres to the WAI-ARIA design pattern.
134
+ * Yes. It adheres to the WAI-ARIA disclosure pattern.
130
135
  * </Accordion.Content>
131
136
  * </Accordion.Item>
132
137
  * </Accordion.Root>
133
- * ```
134
138
  */
135
- readonly Item: import("react").ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
136
- /**
137
- * Toggles the collapsed state of its associated item.
138
- * The interactive element that expands or collapses the accordion content.
139
- *
140
- * @see https://mantle.ngrok.com/components/accordion#api-accordion-trigger
141
- *
142
- * @example
143
- * ```tsx
144
- * <Accordion.Root type="single" collapsible>
145
- * <Accordion.Item value="item-1">
146
- * <Accordion.Heading>
147
- * <Accordion.Trigger>
148
- * <Accordion.TriggerIcon />
149
- * Is it accessible?
150
- * </Accordion.Trigger>
151
- * </Accordion.Heading>
152
- * <Accordion.Content>
153
- * Yes. It adheres to the WAI-ARIA design pattern.
154
- * </Accordion.Content>
155
- * </Accordion.Item>
156
- * </Accordion.Root>
157
- * ```
158
- */
159
- readonly Trigger: import("react").ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
139
+ readonly TriggerIcon: {
140
+ ({
141
+ className,
142
+ svg,
143
+ ...props
144
+ }: Omit<IconProps, "svg"> & {
145
+ /** The icon to render. Defaults to a downward caret that rotates open. */svg?: IconProps["svg"];
146
+ }): import("react").JSX.Element;
147
+ displayName: string;
148
+ };
160
149
  /**
161
- * An icon that indicates the expanded/collapsed state of the accordion trigger.
162
- * Rotates based on the accordion item state to provide visual feedback.
163
- *
164
- * @see https://mantle.ngrok.com/components/accordion#api-accordion-trigger-icon
150
+ * The collapsible, find-in-page-discoverable body. See {@link Content}.
165
151
  *
166
152
  * @example
167
- * ```tsx
168
- * <Accordion.Root type="single" collapsible>
153
+ * <Accordion.Root type="single" defaultValue="item-1">
169
154
  * <Accordion.Item value="item-1">
170
- * <Accordion.Heading>
171
- * <Accordion.Trigger>
172
- * <Accordion.TriggerIcon />
173
- * Is it accessible?
174
- * </Accordion.Trigger>
175
- * </Accordion.Heading>
155
+ * <Accordion.Trigger>
156
+ * Is it accessible?
157
+ * <Accordion.TriggerIcon />
158
+ * </Accordion.Trigger>
176
159
  * <Accordion.Content>
177
- * Yes. It adheres to the WAI-ARIA design pattern.
160
+ * Yes. It adheres to the WAI-ARIA disclosure pattern.
178
161
  * </Accordion.Content>
179
162
  * </Accordion.Item>
180
163
  * </Accordion.Root>
181
- * ```
182
164
  */
183
- readonly TriggerIcon: {
184
- ({
185
- className,
186
- ...props
187
- }: Omit<IconProps, "svg">): import("react").JSX.Element;
188
- displayName: string;
189
- };
165
+ readonly Content: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
190
166
  };
191
167
  //#endregion
192
168
  export { Accordion };
package/dist/accordion.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-SUx16Sl3.js";import{CaretDownIcon as n}from"@phosphor-icons/react/CaretDown";import*as r from"@radix-ui/react-accordion";import{forwardRef as i}from"react";import{jsx as a}from"react/jsx-runtime";const o=i(({className:t,...n},i)=>a(r.Root,{ref:i,"data-slot":`accordion`,className:e(`w-full space-y-2.5`,t),...n}));o.displayName=`Accordion`;const s=i(({...e},t)=>a(r.Item,{ref:t,"data-slot":`accordion-item`,...e}));s.displayName=`AccordionItem`;const c=i(({className:t,...n},i)=>a(r.Header,{ref:i,"data-slot":`accordion-heading`,className:e(`flex items-center gap-2`,t),...n}));c.displayName=`AccordionHeading`;const l=i(({className:t,children:n,...i},o)=>a(r.Trigger,{ref:o,"data-slot":`accordion-trigger`,className:e(`group flex items-center gap-1.5`,t),...i,children:n}));l.displayName=`AccordionTrigger`;const u=({className:r,...i})=>a(t,{...i,"data-slot":`accordion-trigger-icon`,svg:a(n,{weight:`fill`}),className:e(`group-data-[state=open]:rotate-0 -rotate-90`,r)});u.displayName=`AccordionTriggerIcon`;const d=i(({className:t,children:n,...i},o)=>a(r.Content,{ref:o,"data-slot":`accordion-content`,className:e(`data-state-closed:animate-accordion-up data-state-open:animate-accordion-down overflow-hidden *:first:mt-4`,t),...i,children:n}));d.displayName=`AccordionContent`;const f={Root:o,Content:d,Heading:c,Item:s,Trigger:l,TriggerIcon:u};export{f as Accordion};
1
+ import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./cx-C1UYP5We.js";import{t as n}from"./icon-SUx16Sl3.js";import{t as r}from"./slot-DT_E5BQx.js";import{CaretDownIcon as i}from"@phosphor-icons/react/CaretDown";import{createContext as a,forwardRef as o,useCallback as s,useContext as c,useEffect as l,useMemo as u,useRef as d,useState as f}from"react";import p from"tiny-invariant";import{jsx as m}from"react/jsx-runtime";function h(e,t){return e.includes(t)}function g(e,t,n,r){let i=e.includes(t);return n?r===`single`?i&&e.length===1?e:[t]:i?e:[...e,t]:i?e.filter(e=>e!==t):e}function _(e){return e==null?[]:typeof e==`string`?e===``?[]:[e]:e}function v(e,t){e.type===`single`?e.onValueChange?.(t[0]??``):e.onValueChange?.([...t])}function y(){return typeof document<`u`&&document.body!=null&&`onbeforematch`in document.body}const b=a(null);function x(e){let t=c(b);return p(t,`\`${e}\` must be rendered within \`Accordion.Root\`.`),t}const S=a(null);function C(e){let t=c(S);return p(t,`\`${e}\` must be rendered within \`Accordion.Item\`.`),t}const w=o((e,n)=>{let{type:i,value:a,defaultValue:o,onValueChange:s,asChild:c,children:l,className:d,...p}=e,h=a!=null,[y,x]=f(()=>_(o)),S=h?_(a):y,C=u(()=>({type:i,openValues:S,setItemOpen:(t,n)=>{let r=g(S,t,n,i);r!==S&&(h||x(r),v(e,r))}}),[i,S,h,e]),w={...p,"data-slot":`accordion`,className:t(`w-full`,d)};return m(b.Provider,{value:C,children:m(c?r:`div`,{ref:n,...w,children:l})})});w.displayName=`Accordion`;const T=o(({className:e,children:n,value:r,...i},a)=>{let{openValues:o,setItemOpen:c}=x(`Accordion.Item`),l=h(o,r),d=s(e=>{c(r,e)},[c,r]),f=u(()=>({open:l,setOpen:d}),[l,d]);return m(S.Provider,{value:f,children:m(`div`,{ref:a,...i,role:`group`,"data-slot":`accordion-item`,"data-state":l?`open`:`closed`,className:t(`border-card-muted border-b last:border-b-0`,e),children:n})})});T.displayName=`AccordionItem`;const E=o(({className:e,children:n,onClick:r,...i},a)=>{let{open:o,setOpen:s}=C(`Accordion.Trigger`);return m(`button`,{ref:a,type:`button`,...i,"data-slot":`accordion-trigger`,"data-state":o?`open`:`closed`,"aria-expanded":o,className:t(`group flex w-full cursor-pointer items-center justify-between gap-4 py-4 text-left text-sm font-medium outline-none`,`-mx-2 rounded-md px-2`,`focus:outline-hidden focus-visible:ring-4 focus-visible:ring-focus-accent`,e),onClick:e=>{r?.(e),s(!o)},children:n})});E.displayName=`AccordionTrigger`;const D=m(i,{weight:`bold`}),O=({className:e,svg:r=D,...i})=>m(n,{...i,"data-slot":`accordion-trigger-icon`,svg:r,className:t(`size-4 shrink-0 text-muted transition-transform duration-200 group-data-[state=open]:rotate-180`,e)});O.displayName=`AccordionTriggerIcon`;const k=o(({className:n,children:r,...i},a)=>{let{open:o,setOpen:c}=C(`Accordion.Content`),u=d(null),f=s(e=>{u.current=e,typeof a==`function`?a(e):a!=null&&(a.current=e)},[a]);return l(()=>{let e=u.current;if(e==null||!y())return;let t=()=>{e.removeAttribute(`hidden`),e.style.height=`auto`,c(!0)};return e.addEventListener(`beforematch`,t),()=>{e.removeEventListener(`beforematch`,t)}},[c]),e(()=>{let e=u.current;e!=null&&(o||!y()?e.removeAttribute(`hidden`):(e.setAttribute(`hidden`,`until-found`),e.style.height=``))},[o]),m(`div`,{ref:f,...i,"data-slot":`accordion-content`,"data-state":o?`open`:`closed`,className:t(`h-0 overflow-hidden text-sm transition-[height,content-visibility] duration-200 ease-out [interpolate-size:allow-keywords] transition-discrete data-[state=open]:h-auto motion-reduce:transition-none`,n),children:m(`div`,{className:`pb-4`,children:r})})});k.displayName=`AccordionContent`;const A={Root:w,Item:T,Trigger:E,TriggerIcon:O,Content:k};export{A as Accordion};
package/dist/agent.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngrok/mantle",
3
- "version": "0.76.6",
3
+ "version": "0.76.7",
4
4
  "origin": "https://mantle.ngrok.com",
5
5
  "endpoints": {
6
6
  "docs": "https://mantle.ngrok.com/",
@@ -1,6 +1,6 @@
1
- import { t as SvgAttributes } from "./types-BvUzforF.js";
2
1
  import { t as WithAsChild } from "./as-child-uN_018tj.js";
3
- import { n as ButtonProps } from "./button-mfYak6Rx.js";
2
+ import { t as SvgAttributes } from "./types-BvUzforF.js";
3
+ import { n as ButtonProps } from "./button-D9kqQuu9.js";
4
4
  import { t as Root$1 } from "./primitive-FoWela9a.js";
5
5
  import { ComponentProps, ReactNode } from "react";
6
6
 
@@ -1 +1 @@
1
- import{t as e}from"./cx-C1UYP5We.js";import{t}from"./svg-only-CSOaF1tL.js";import{t as n}from"./slot-DT_E5BQx.js";import{t as r}from"./button-BK8Thu3k.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./primitive-BEuiJONo.js";import{createContext as f,forwardRef as p,useContext as m,useMemo as h}from"react";import g from"tiny-invariant";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{InfoIcon as y}from"@phosphor-icons/react/Info";import{WarningIcon as b}from"@phosphor-icons/react/Warning";const x=f(null);function S(){let e=m(x);return g(e,`AlertDialog child component used outside of AlertDialog parent!`),e}function C({priority:e,...t}){let n=h(()=>({priority:e}),[e]);return _(x.Provider,{value:n,children:_(c,{...t})})}C.displayName=`AlertDialog`;const w=p(({...e},t)=>_(a,{ref:t,"data-slot":`alert-dialog-trigger`,...e}));w.displayName=`AlertDialogTrigger`;const T=i;T.displayName=`AlertDialogPortal`;const E=p(({className:t,...n},r)=>_(o,{"data-slot":`alert-dialog-overlay`,className:e(`data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 bg-overlay fixed inset-0 z-50 backdrop-blur-xs`,t),...n,ref:r}));E.displayName=`AlertDialogOverlay`;const D=p(({className:t,preferredWidth:n=`max-w-md`,...r},i)=>v(T,{children:[_(E,{}),_(`div`,{className:`fixed inset-4 z-50 flex items-center justify-center`,children:_(s,{"data-slot":`alert-dialog-content`,"data-mantle-modal-content":!0,ref:i,className:e(`flex w-full flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start`,`outline-hidden focus-within:outline-hidden`,`p-6`,`border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200`,`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`,n,t),...r})})]}));D.displayName=`AlertDialogContent`;const O=p(({asChild:t=!1,className:r,...i},a)=>_(t?n:`div`,{"data-slot":`alert-dialog-body`,className:e(`flex-1 space-y-4`,r),ref:a,...i}));O.displayName=`AlertDialogBody`;const k=p(({asChild:t=!1,className:r,...i},a)=>_(t?n:`div`,{"data-slot":`alert-dialog-header`,className:e(`flex flex-col space-y-2 text-center sm:text-start`,r),ref:a,...i}));k.displayName=`AlertDialogHeader`;const A=p(({asChild:t=!1,className:r,...i},a)=>_(t?n:`div`,{"data-slot":`alert-dialog-footer`,className:e(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,r),ref:a,...i}));A.displayName=`AlertDialogFooter`;const j=p(({className:t,...n},r)=>_(u,{ref:r,"data-slot":`alert-dialog-title`,className:e(`text-strong text-center text-lg font-medium sm:text-start`,t),...n}));j.displayName=`AlertDialogTitle`;const M=p(({className:t,...n},r)=>_(l,{ref:r,"data-slot":`alert-dialog-description`,className:e(`text-body text-center text-sm font-normal sm:text-start`,t),...n}));M.displayName=`AlertDialogDescription`;const N=p(({appearance:e=`filled`,...t},n)=>{let i=S(),a=`default`;return i.priority===`danger`&&(a=`danger`),_(r,{appearance:e,"data-slot":`alert-dialog-action`,priority:a,ref:n,...t})});N.displayName=`AlertDialogAction`;const P=p(({appearance:t=`outlined`,className:n,priority:i=`neutral`,...a},o)=>_(d,{asChild:!0,children:_(r,{appearance:t,"data-slot":`alert-dialog-cancel`,className:e(`mt-2 sm:mt-0`,n),priority:i,ref:o,...a})}));P.displayName=`AlertDialogCancel`;const F=p(({className:n,svg:r,...i},a)=>{let o=S(),s=o.priority===`danger`?`text-danger-600`:`text-accent-600`,c=o.priority===`danger`?_(b,{}):_(y,{});return _(t,{ref:a,"data-slot":`alert-dialog-icon`,className:e(`size-12 sm:size-7`,s,n),svg:r??c,...i})});F.displayName=`AlertDialogIcon`;const I=p(({...e},t)=>_(d,{ref:t,"data-slot":`alert-dialog-close`,...e}));I.displayName=`AlertDialogClose`;const L={Root:C,Action:N,Body:O,Cancel:P,Close:I,Content:D,Description:M,Footer:A,Header:k,Icon:F,Title:j,Trigger:w};export{L as AlertDialog};
1
+ import{t as e}from"./cx-C1UYP5We.js";import{t}from"./svg-only-CSOaF1tL.js";import{t as n}from"./slot-DT_E5BQx.js";import{t as r}from"./button-C9GW9nAr.js";import{a as i,c as a,i as o,n as s,o as c,r as l,s as u,t as d}from"./primitive-BFUir4UB.js";import{createContext as f,forwardRef as p,useContext as m,useMemo as h}from"react";import g from"tiny-invariant";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{InfoIcon as y}from"@phosphor-icons/react/Info";import{WarningIcon as b}from"@phosphor-icons/react/Warning";const x=f(null);function S(){let e=m(x);return g(e,`AlertDialog child component used outside of AlertDialog parent!`),e}function C({priority:e,...t}){let n=h(()=>({priority:e}),[e]);return _(x.Provider,{value:n,children:_(c,{...t})})}C.displayName=`AlertDialog`;const w=p(({...e},t)=>_(a,{ref:t,"data-slot":`alert-dialog-trigger`,...e}));w.displayName=`AlertDialogTrigger`;const T=i;T.displayName=`AlertDialogPortal`;const E=p(({className:t,...n},r)=>_(o,{"data-slot":`alert-dialog-overlay`,className:e(`data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 bg-overlay fixed inset-0 z-50 backdrop-blur-xs`,t),...n,ref:r}));E.displayName=`AlertDialogOverlay`;const D=p(({className:t,preferredWidth:n=`max-w-md`,...r},i)=>v(T,{children:[_(E,{}),_(`div`,{className:`fixed inset-4 z-50 flex items-center justify-center`,children:_(s,{"data-slot":`alert-dialog-content`,"data-mantle-modal-content":!0,ref:i,className:e(`flex w-full flex-1 flex-col items-center gap-4 sm:flex-row sm:items-start`,`outline-hidden focus-within:outline-hidden`,`p-6`,`border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200`,`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`,n,t),...r})})]}));D.displayName=`AlertDialogContent`;const O=p(({asChild:t=!1,className:r,...i},a)=>_(t?n:`div`,{"data-slot":`alert-dialog-body`,className:e(`flex-1 space-y-4`,r),ref:a,...i}));O.displayName=`AlertDialogBody`;const k=p(({asChild:t=!1,className:r,...i},a)=>_(t?n:`div`,{"data-slot":`alert-dialog-header`,className:e(`flex flex-col space-y-2 text-center sm:text-start`,r),ref:a,...i}));k.displayName=`AlertDialogHeader`;const A=p(({asChild:t=!1,className:r,...i},a)=>_(t?n:`div`,{"data-slot":`alert-dialog-footer`,className:e(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,r),ref:a,...i}));A.displayName=`AlertDialogFooter`;const j=p(({className:t,...n},r)=>_(u,{ref:r,"data-slot":`alert-dialog-title`,className:e(`text-strong text-center text-lg font-medium sm:text-start`,t),...n}));j.displayName=`AlertDialogTitle`;const M=p(({className:t,...n},r)=>_(l,{ref:r,"data-slot":`alert-dialog-description`,className:e(`text-body text-center text-sm font-normal sm:text-start`,t),...n}));M.displayName=`AlertDialogDescription`;const N=p(({appearance:e=`filled`,...t},n)=>{let i=S(),a=`default`;return i.priority===`danger`&&(a=`danger`),_(r,{appearance:e,"data-slot":`alert-dialog-action`,priority:a,ref:n,...t})});N.displayName=`AlertDialogAction`;const P=p(({appearance:t=`outlined`,className:n,priority:i=`neutral`,...a},o)=>_(d,{asChild:!0,children:_(r,{appearance:t,"data-slot":`alert-dialog-cancel`,className:e(`mt-2 sm:mt-0`,n),priority:i,ref:o,...a})}));P.displayName=`AlertDialogCancel`;const F=p(({className:n,svg:r,...i},a)=>{let o=S(),s=o.priority===`danger`?`text-danger-600`:`text-accent-600`,c=o.priority===`danger`?_(b,{}):_(y,{});return _(t,{ref:a,"data-slot":`alert-dialog-icon`,className:e(`size-12 sm:size-7`,s,n),svg:r??c,...i})});F.displayName=`AlertDialogIcon`;const I=p(({...e},t)=>_(d,{ref:t,"data-slot":`alert-dialog-close`,...e}));I.displayName=`AlertDialogClose`;const L={Root:C,Action:N,Body:O,Cancel:P,Close:I,Content:D,Description:M,Footer:A,Header:k,Icon:F,Title:j,Trigger:w};export{L as AlertDialog};
package/dist/alert.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { t as SvgAttributes } from "./types-BvUzforF.js";
2
1
  import { t as WithAsChild } from "./as-child-uN_018tj.js";
3
- import { n as IconButtonProps } from "./icon-button-BPvRuor6.js";
2
+ import { t as SvgAttributes } from "./types-BvUzforF.js";
3
+ import { n as IconButtonProps } from "./icon-button-D7hs6bX2.js";
4
4
  import { ComponentProps, HTMLAttributes, ReactNode } from "react";
5
5
 
6
6
  //#region src/components/alert/alert.d.ts
package/dist/alert.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-C1UYP5We.js";import{t}from"./svg-only-CSOaF1tL.js";import{t as n}from"./types-D85fCNV3.js";import{t as r}from"./slot-DT_E5BQx.js";import{t as i}from"./icon-button-CbqMI7q3.js";import{createContext as a,forwardRef as o,useContext as s,useMemo as c}from"react";import l from"tiny-invariant";import{jsx as u}from"react/jsx-runtime";import{CheckCircleIcon as d}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as f}from"@phosphor-icons/react/Info";import{MegaphoneIcon as p}from"@phosphor-icons/react/Megaphone";import{WarningIcon as m}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as h}from"@phosphor-icons/react/WarningDiamond";import{XIcon as g}from"@phosphor-icons/react/X";import{cva as _}from"class-variance-authority";const v=a(null),y=u(g,{});function b(){let e=s(v);return l(e,`useAlertContext hook used outside of Alert parent!`),e}const x=_(`relative flex w-full gap-1.5 rounded-md border p-2.5 text-sm font-sans`,{variants:{priority:{danger:`border-danger-500/50 bg-danger-500/10 text-danger-700 [&_code]:bg-danger-500/10 [&_code]:border-danger-500/20 [&_code]:text-danger-900 [&_a]:text-danger-700 [&_a]:underline`,important:`border-important-500/50 bg-important-500/10 text-important-700 [&_code]:bg-important-500/10 [&_code]:border-important-500/20 [&_code]:text-important-900 [&_a]:text-important-700 [&_a]:underline`,info:`border-info-500/50 bg-info-500/10 text-info-700 [&_code]:bg-info-500/10 [&_code]:border-info-500/20 [&_code]:text-info-900 [&_a]:text-info-700 [&_a]:underline`,success:`border-success-500/50 bg-success-500/10 text-success-700 [&_code]:bg-success-500/10 [&_code]:border-success-500/20 [&_code]:text-success-900 [&_a]:text-success-700 [&_a]:underline`,warning:`border-warning-500/50 bg-warning-500/10 text-warning-700 [&_code]:bg-warning-500/10 [&_code]:border-warning-500/20 [&_code]:text-warning-900 [&_a]:text-warning-700 [&_a]:underline`},appearance:{banner:`border-x-0 border-t-0 rounded-none z-50 sticky`,default:``}},compoundVariants:[{priority:`danger`,appearance:`banner`,className:``},{priority:`important`,appearance:`banner`,className:``},{priority:`info`,appearance:`banner`,className:``},{priority:`success`,appearance:`banner`,className:``},{priority:`warning`,appearance:`banner`,className:``}]}),S=o(({appearance:t=`default`,className:n,priority:r,...i},a)=>{let o=c(()=>({priority:r}),[r]);return u(v.Provider,{value:o,children:u(`div`,{ref:a,"data-slot":`alert`,className:e(x({appearance:t,priority:r}),n),...i})})});S.displayName=`Alert`;const C={danger:u(m,{}),important:u(p,{mirrored:!0}),info:u(f,{}),success:u(d,{}),warning:u(h,{})},w=o(({className:n,svg:r,...i},a)=>{let o=C[b().priority];return u(t,{ref:a,"data-slot":`alert-icon`,className:e(`size-5`,n),svg:r??o,...i})});w.displayName=`AlertIcon`;const T=o(({className:t,...n},r)=>u(`div`,{ref:r,"data-slot":`alert-content`,className:e(`min-w-0 flex-1 has-data-alert-dismiss:pr-6`,t),...n}));T.displayName=`AlertContent`;const E=o(({asChild:t=!1,className:n,...i},a)=>u(t?r:`h5`,{ref:a,"data-slot":`alert-title`,className:e(`font-medium`,n),...i}));E.displayName=`AlertTitle`;const D=o(({asChild:t=!1,className:n,...i},a)=>u(t?r:`div`,{ref:a,"data-slot":`alert-description`,className:e(`text-sm`,n),...i}));D.displayName=`AlertDescription`;const O=e=>`var(--color-${e}-700)`,k=e=>`var(--color-${e}-800)`,A=e=>`color-mix(in oklab, var(--color-${e}-500) 10%, transparent)`,j=({size:t=`sm`,type:r=`button`,label:a=`Dismiss Alert`,appearance:o=`ghost`,className:s,icon:c=y,style:l,...d})=>{let f=b();return u(i,{appearance:o,icon:c,label:a,size:t,"data-slot":`alert-dismiss-icon-button`,"data-alert-dismiss":!0,className:e(`right-1.5 top-1.5 absolute`,`text-(--alert-dismiss-icon-color)`,`not-disabled:hover:bg-(--alert-dismiss-hover-bg) not-disabled:hover:text-(--alert-dismiss-icon-hover-color)`,s),type:r,style:n({...l,"--alert-dismiss-icon-color":O(f.priority),"--alert-dismiss-icon-hover-color":k(f.priority),"--alert-dismiss-hover-bg":A(f.priority)}),...d})};j.displayName=`AlertDismissIconButton`;const M={Root:S,Content:T,Description:D,DismissIconButton:j,Icon:w,Title:E};export{M as Alert};
1
+ import{t as e}from"./cx-C1UYP5We.js";import{t}from"./svg-only-CSOaF1tL.js";import{t as n}from"./slot-DT_E5BQx.js";import{t as r}from"./types-D85fCNV3.js";import{t as i}from"./icon-button-DiX9iZ9n.js";import{createContext as a,forwardRef as o,useContext as s,useMemo as c}from"react";import l from"tiny-invariant";import{jsx as u}from"react/jsx-runtime";import{CheckCircleIcon as d}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as f}from"@phosphor-icons/react/Info";import{MegaphoneIcon as p}from"@phosphor-icons/react/Megaphone";import{WarningIcon as m}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as h}from"@phosphor-icons/react/WarningDiamond";import{XIcon as g}from"@phosphor-icons/react/X";import{cva as _}from"class-variance-authority";const v=a(null),y=u(g,{});function b(){let e=s(v);return l(e,`useAlertContext hook used outside of Alert parent!`),e}const x=_(`relative flex w-full gap-1.5 rounded-md border p-2.5 text-sm font-sans`,{variants:{priority:{danger:`border-danger-500/50 bg-danger-500/10 text-danger-700 [&_code]:bg-danger-500/10 [&_code]:border-danger-500/20 [&_code]:text-danger-900 [&_a]:text-danger-700 [&_a]:underline`,important:`border-important-500/50 bg-important-500/10 text-important-700 [&_code]:bg-important-500/10 [&_code]:border-important-500/20 [&_code]:text-important-900 [&_a]:text-important-700 [&_a]:underline`,info:`border-info-500/50 bg-info-500/10 text-info-700 [&_code]:bg-info-500/10 [&_code]:border-info-500/20 [&_code]:text-info-900 [&_a]:text-info-700 [&_a]:underline`,success:`border-success-500/50 bg-success-500/10 text-success-700 [&_code]:bg-success-500/10 [&_code]:border-success-500/20 [&_code]:text-success-900 [&_a]:text-success-700 [&_a]:underline`,warning:`border-warning-500/50 bg-warning-500/10 text-warning-700 [&_code]:bg-warning-500/10 [&_code]:border-warning-500/20 [&_code]:text-warning-900 [&_a]:text-warning-700 [&_a]:underline`},appearance:{banner:`border-x-0 border-t-0 rounded-none z-50 sticky`,default:``}},compoundVariants:[{priority:`danger`,appearance:`banner`,className:``},{priority:`important`,appearance:`banner`,className:``},{priority:`info`,appearance:`banner`,className:``},{priority:`success`,appearance:`banner`,className:``},{priority:`warning`,appearance:`banner`,className:``}]}),S=o(({appearance:t=`default`,className:n,priority:r,...i},a)=>{let o=c(()=>({priority:r}),[r]);return u(v.Provider,{value:o,children:u(`div`,{ref:a,"data-slot":`alert`,className:e(x({appearance:t,priority:r}),n),...i})})});S.displayName=`Alert`;const C={danger:u(m,{}),important:u(p,{mirrored:!0}),info:u(f,{}),success:u(d,{}),warning:u(h,{})},w=o(({className:n,svg:r,...i},a)=>{let o=C[b().priority];return u(t,{ref:a,"data-slot":`alert-icon`,className:e(`size-5`,n),svg:r??o,...i})});w.displayName=`AlertIcon`;const T=o(({className:t,...n},r)=>u(`div`,{ref:r,"data-slot":`alert-content`,className:e(`min-w-0 flex-1 has-data-alert-dismiss:pr-6`,t),...n}));T.displayName=`AlertContent`;const E=o(({asChild:t=!1,className:r,...i},a)=>u(t?n:`h5`,{ref:a,"data-slot":`alert-title`,className:e(`font-medium`,r),...i}));E.displayName=`AlertTitle`;const D=o(({asChild:t=!1,className:r,...i},a)=>u(t?n:`div`,{ref:a,"data-slot":`alert-description`,className:e(`text-sm`,r),...i}));D.displayName=`AlertDescription`;const O=e=>`var(--color-${e}-700)`,k=e=>`var(--color-${e}-800)`,A=e=>`color-mix(in oklab, var(--color-${e}-500) 10%, transparent)`,j=({size:t=`sm`,type:n=`button`,label:a=`Dismiss Alert`,appearance:o=`ghost`,className:s,icon:c=y,style:l,...d})=>{let f=b();return u(i,{appearance:o,icon:c,label:a,size:t,"data-slot":`alert-dismiss-icon-button`,"data-alert-dismiss":!0,className:e(`right-1.5 top-1.5 absolute`,`text-(--alert-dismiss-icon-color)`,`not-disabled:hover:bg-(--alert-dismiss-hover-bg) not-disabled:hover:text-(--alert-dismiss-icon-hover-color)`,s),type:n,style:r({...l,"--alert-dismiss-icon-color":O(f.priority),"--alert-dismiss-icon-hover-color":k(f.priority),"--alert-dismiss-hover-bg":A(f.priority)}),...d})};j.displayName=`AlertDismissIconButton`;const M={Root:S,Content:T,Description:D,DismissIconButton:j,Icon:w,Title:E};export{M as Alert};
@@ -1 +1 @@
1
- import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-SUx16Sl3.js";import{t as n}from"./booleanish-BfvnW6vy.js";import{t as r}from"./slot-DT_E5BQx.js";import{t as i}from"./clsx-DUGZgXfJ.js";import{Children as a,cloneElement as o,forwardRef as s,isValidElement as c}from"react";import l from"tiny-invariant";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{cva as p}from"class-variance-authority";import{CircleNotchIcon as m}from"@phosphor-icons/react/CircleNotch";const h=p(``,{variants:{appearance:{filled:`bg-filled-accent text-white focus-visible:ring-focus-accent not-disabled:hover:bg-filled-accent-hover h-9 border border-transparent px-3 text-sm font-medium`,ghost:`text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 h-9 border border-transparent px-3 text-sm font-medium`,outlined:`border-accent-600 bg-form text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-accent-700 not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 h-9 border px-3 text-sm font-medium`,link:`text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:underline group/button-link border-transparent`},isLoading:{false:``,true:`opacity-50`},priority:{danger:``,default:``,neutral:``}},defaultVariants:{appearance:`outlined`,isLoading:!1,priority:`default`},compoundVariants:[{appearance:`ghost`,priority:`danger`,class:`text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700 border-transparent`},{appearance:`outlined`,priority:`danger`,class:`border-danger-600 bg-form text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:border-danger-700 not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700`},{appearance:`filled`,priority:`danger`,class:`bg-filled-danger focus-visible:ring-focus-danger not-disabled:hover:bg-filled-danger-hover border-transparent`},{appearance:`link`,priority:`danger`,class:`text-danger-600 focus-visible:ring-focus-danger`},{appearance:`ghost`,priority:`neutral`,class:`text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong border-transparent`},{appearance:`outlined`,priority:`neutral`,class:`border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong focus-visible:not-disabled:hover:border-accent-600`},{appearance:`filled`,priority:`neutral`,class:`bg-filled-neutral not-disabled:hover:bg-filled-neutral-hover border-transparent focus-visible:border-transparent text-neutral-50`},{appearance:`link`,priority:`neutral`,class:`text-strong focus-visible:ring-focus-accent`}]}),g=s(({"aria-disabled":s,appearance:p=`outlined`,asChild:g,children:_,className:v,disabled:y,icon:b,iconPlacement:x=`start`,isLoading:S=!1,priority:C=`default`,type:w,...T},E)=>{let D=n(s??y??S),O=S?d(m,{className:`animate-spin`}):b,k=O&&p!==`link`,A={"aria-disabled":D,"data-slot":`button`,className:e(`inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md`,`focus:outline-hidden focus-visible:ring-4`,`disabled:cursor-default disabled:opacity-50`,`not-disabled:active:scale-97 ease-out transition-transform duration-150`,h({appearance:p,priority:C,isLoading:S}),p!==`link`&&`font-sans`,k&&x===`start`&&`ps-2.5`,k&&x===`end`&&`pe-2.5`,v),"data-appearance":p,"data-disabled":D,"data-loading":S,"data-priority":C,disabled:D,ref:E,...T};return g?(l(c(_)&&a.only(_),"When using `asChild`, Button must be passed a single child as a JSX tag."),d(r,{...A,children:o(_,{},f(u,{children:[O&&d(t,{svg:O,className:i(x===`end`&&`order-last`)}),_.props.children]}))})):f(`button`,{...A,type:w??`button`,children:[O&&d(t,{svg:O,className:i(x===`end`&&`order-last`)}),_]})});g.displayName=`Button`;export{g as t};
1
+ import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-SUx16Sl3.js";import{t as n}from"./slot-DT_E5BQx.js";import{t as r}from"./booleanish-BfvnW6vy.js";import{t as i}from"./clsx-DUGZgXfJ.js";import{Children as a,cloneElement as o,forwardRef as s,isValidElement as c}from"react";import l from"tiny-invariant";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";import{cva as p}from"class-variance-authority";import{CircleNotchIcon as m}from"@phosphor-icons/react/CircleNotch";const h=p(``,{variants:{appearance:{filled:`bg-filled-accent text-white focus-visible:ring-focus-accent not-disabled:hover:bg-filled-accent-hover h-9 border border-transparent px-3 text-sm font-medium`,ghost:`text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 h-9 border border-transparent px-3 text-sm font-medium`,outlined:`border-accent-600 bg-form text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-accent-700 not-disabled:hover:bg-accent-500/10 not-disabled:hover:text-accent-700 h-9 border px-3 text-sm font-medium`,link:`text-accent-600 focus-visible:ring-focus-accent not-disabled:hover:underline group/button-link border-transparent`},isLoading:{false:``,true:`opacity-50`},priority:{danger:``,default:``,neutral:``}},defaultVariants:{appearance:`outlined`,isLoading:!1,priority:`default`},compoundVariants:[{appearance:`ghost`,priority:`danger`,class:`text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700 border-transparent`},{appearance:`outlined`,priority:`danger`,class:`border-danger-600 bg-form text-danger-600 focus-visible:ring-focus-danger not-disabled:hover:border-danger-700 not-disabled:hover:bg-danger-500/10 not-disabled:hover:text-danger-700`},{appearance:`filled`,priority:`danger`,class:`bg-filled-danger focus-visible:ring-focus-danger not-disabled:hover:bg-filled-danger-hover border-transparent`},{appearance:`link`,priority:`danger`,class:`text-danger-600 focus-visible:ring-focus-danger`},{appearance:`ghost`,priority:`neutral`,class:`text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong border-transparent`},{appearance:`outlined`,priority:`neutral`,class:`border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong focus-visible:not-disabled:hover:border-accent-600`},{appearance:`filled`,priority:`neutral`,class:`bg-filled-neutral not-disabled:hover:bg-filled-neutral-hover border-transparent focus-visible:border-transparent text-neutral-50`},{appearance:`link`,priority:`neutral`,class:`text-strong focus-visible:ring-focus-accent`}]}),g=s(({"aria-disabled":s,appearance:p=`outlined`,asChild:g,children:_,className:v,disabled:y,icon:b,iconPlacement:x=`start`,isLoading:S=!1,priority:C=`default`,type:w,...T},E)=>{let D=r(s??y??S),O=S?d(m,{className:`animate-spin`}):b,k=O&&p!==`link`,A={"aria-disabled":D,"data-slot":`button`,className:e(`inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md`,`focus:outline-hidden focus-visible:ring-4`,`disabled:cursor-default disabled:opacity-50`,`not-disabled:active:scale-97 ease-out transition-transform duration-150`,h({appearance:p,priority:C,isLoading:S}),p!==`link`&&`font-sans`,k&&x===`start`&&`ps-2.5`,k&&x===`end`&&`pe-2.5`,v),"data-appearance":p,"data-disabled":D,"data-loading":S,"data-priority":C,disabled:D,ref:E,...T};return g?(l(c(_)&&a.only(_),"When using `asChild`, Button must be passed a single child as a JSX tag."),d(n,{...A,children:o(_,{},f(u,{children:[O&&d(t,{svg:O,className:i(x===`end`&&`order-last`)}),_.props.children]}))})):f(`button`,{...A,type:w??`button`,children:[O&&d(t,{svg:O,className:i(x===`end`&&`order-last`)}),_]})});g.displayName=`Button`;export{g as t};
@@ -4,7 +4,7 @@ import { ComponentProps, ReactNode } from "react";
4
4
 
5
5
  //#region src/components/button/button.d.ts
6
6
  declare const buttonVariants: (props?: ({
7
- appearance?: "link" | "filled" | "ghost" | "outlined" | null | undefined;
7
+ appearance?: "link" | "ghost" | "outlined" | "filled" | null | undefined;
8
8
  isLoading?: boolean | null | undefined;
9
9
  priority?: "danger" | "neutral" | "default" | null | undefined;
10
10
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
package/dist/button.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as ButtonProps, t as Button } from "./button-mfYak6Rx.js";
2
- import { n as IconButtonProps, t as IconButton } from "./icon-button-BPvRuor6.js";
1
+ import { n as ButtonProps, t as Button } from "./button-D9kqQuu9.js";
2
+ import { n as IconButtonProps, t as IconButton } from "./icon-button-D7hs6bX2.js";
3
3
  import { n as ButtonGroupProps, t as ButtonGroup } from "./index-CTU6apE6.js";
4
4
  export { Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, IconButton, type IconButtonProps };
package/dist/button.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./icon-button-CbqMI7q3.js";import{t}from"./button-BK8Thu3k.js";import{t as n}from"./button-CERx95KE.js";export{t as Button,n as ButtonGroup,e as IconButton};
1
+ import{t as e}from"./icon-button-DiX9iZ9n.js";import{t}from"./button-C9GW9nAr.js";import{t as n}from"./button-CERx95KE.js";export{t as Button,n as ButtonGroup,e as IconButton};
package/dist/calendar.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-SUx16Sl3.js";import{n,r}from"./icon-button-CbqMI7q3.js";import{jsx as i}from"react/jsx-runtime";import{CaretLeftIcon as a}from"@phosphor-icons/react/CaretLeft";import{CaretRightIcon as o}from"@phosphor-icons/react/CaretRight";import{DayPicker as s}from"react-day-picker";function c({className:c,classNames:l,showOutsideDays:u=!1,...d}){return i(s,{"data-slot":`calendar`,animate:!1,components:{Chevron:e=>i(t,{svg:e.orientation===`left`?i(a,{}):i(o,{}),className:`size-4`})},classNames:{root:e(`isolate`,c),button_next:e(n,r({appearance:`ghost`,size:`sm`}),`absolute right-0`),button_previous:e(n,r({appearance:`ghost`,size:`sm`}),`absolute left-0`),caption_label:`text-sm font-medium`,day:e(`overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 size-7 rounded-md`,d.mode===`range`?`first:has-aria-selected:rounded-l-md last:has-aria-selected:rounded-r-md`:``),day_button:`day size-full rounded-md not-aria-selected:not-disabled:hover:bg-filled-accent/15`,disabled:`text-muted opacity-50`,hidden:`invisible`,month:`space-y-4`,month_caption:`flex justify-center pt-1 relative items-center`,month_grid:`w-full border-collapse space-y-1`,months:`flex flex-col sm:flex-row gap-y-4 sm:gap-x-4 sm:gap-y-0 relative max-w-min`,nav:`flex items-center absolute inset-x-0 top-1 h-5 justify-between z-10`,outside:`day-outside aria-selected:text-on-filled opacity-50 text-muted`,range_end:`day-range-end [&:not(.day-range-start)]:rounded-l-none`,range_middle:`day-range-middle not-disabled:aria-selected:bg-filled-accent/15 aria-selected:text-strong rounded-none not-disabled:aria-selected:hover:bg-filled-accent/25`,range_start:`day-range-start [&:not(.day-range-end)]:rounded-r-none`,selected:`not-disabled:bg-filled-accent text-on-filled not-disabled:hover:bg-filled-accent`,today:`not-aria-selected:not-disabled:text-accent-600 font-medium not-aria-selected:not-disabled:bg-filled-accent/10 rounded-md`,week:`flex w-full mt-1`,weekday:`text-body w-7 text-[0.8rem] text-center font-normal`,weekdays:`flex`,...l},showOutsideDays:u,...d})}c.displayName=`Calendar`;export{c as Calendar};
1
+ import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-SUx16Sl3.js";import{n,r}from"./icon-button-DiX9iZ9n.js";import{jsx as i}from"react/jsx-runtime";import{CaretLeftIcon as a}from"@phosphor-icons/react/CaretLeft";import{CaretRightIcon as o}from"@phosphor-icons/react/CaretRight";import{DayPicker as s}from"react-day-picker";function c({className:c,classNames:l,showOutsideDays:u=!1,...d}){return i(s,{"data-slot":`calendar`,animate:!1,components:{Chevron:e=>i(t,{svg:e.orientation===`left`?i(a,{}):i(o,{}),className:`size-4`})},classNames:{root:e(`isolate`,c),button_next:e(n,r({appearance:`ghost`,size:`sm`}),`absolute right-0`),button_previous:e(n,r({appearance:`ghost`,size:`sm`}),`absolute left-0`),caption_label:`text-sm font-medium`,day:e(`overflow-hidden text-center text-sm p-0 relative focus-within:relative focus-within:z-20 size-7 rounded-md`,d.mode===`range`?`first:has-aria-selected:rounded-l-md last:has-aria-selected:rounded-r-md`:``),day_button:`day size-full rounded-md not-aria-selected:not-disabled:hover:bg-filled-accent/15`,disabled:`text-muted opacity-50`,hidden:`invisible`,month:`space-y-4`,month_caption:`flex justify-center pt-1 relative items-center`,month_grid:`w-full border-collapse space-y-1`,months:`flex flex-col sm:flex-row gap-y-4 sm:gap-x-4 sm:gap-y-0 relative max-w-min`,nav:`flex items-center absolute inset-x-0 top-1 h-5 justify-between z-10`,outside:`day-outside aria-selected:text-on-filled opacity-50 text-muted`,range_end:`day-range-end [&:not(.day-range-start)]:rounded-l-none`,range_middle:`day-range-middle not-disabled:aria-selected:bg-filled-accent/15 aria-selected:text-strong rounded-none not-disabled:aria-selected:hover:bg-filled-accent/25`,range_start:`day-range-start [&:not(.day-range-end)]:rounded-r-none`,selected:`not-disabled:bg-filled-accent text-on-filled not-disabled:hover:bg-filled-accent`,today:`not-aria-selected:not-disabled:text-accent-600 font-medium not-aria-selected:not-disabled:bg-filled-accent/10 rounded-md`,week:`flex w-full mt-1`,weekday:`text-body w-7 text-[0.8rem] text-center font-normal`,weekdays:`flex`,...l},showOutsideDays:u,...d})}c.displayName=`Calendar`;export{c as Calendar};
@@ -1,5 +1,5 @@
1
- import { t as SvgAttributes } from "./types-BvUzforF.js";
2
1
  import { t as WithAsChild } from "./as-child-uN_018tj.js";
2
+ import { t as SvgAttributes } from "./types-BvUzforF.js";
3
3
  import { A as FoldStrategy, B as computeJsonFoldRanges, C as Indentation, D as FoldExplanation, E as ComputeFoldRangesInput, F as isSupportedLanguage, H as finalizeFoldRanges, I as parseLanguage, L as supportedLanguages, M as computeFoldRanges, N as foldStrategyFor, O as FoldLine, P as SupportedLanguage, S as normalizeIndentation, T as isIndentation, U as LineRange, V as FoldableRange, _ as MantleCodeBlockValue, a as Mode, c as ResolvedPreRenderedCodeBlockProps, d as parseMetastring, f as resolvePreRenderedCodeBlockProps, g as parseCodeBlockShowLineNumbers, h as parseCodeBlockLineNumberStart, i as MetaInput, j as FoldToken, k as FoldScope, l as defaultMeta, m as parseCodeBlockHighlightLines, n as DefaultMeta, o as ResolvePreRenderedCodeBlockPropsInput, p as tokenizeMetastring, r as Meta, s as ResolvePreRenderedCodeBlockPropsResult, t as CodeBlockPreElementInput, u as normalizeValue, v as MantleCodeOptions, w as inferIndentation, x as mantleCode, y as createMantleCodeBlockValue, z as decorateHighlightedHtml } from "./resolve-pre-rendered-props-DxJ9-DAl.js";
4
4
  import { ComponentProps, HTMLAttributes, ReactNode } from "react";
5
5
  import { Content, List, Trigger } from "@radix-ui/react-tabs";
@@ -1,4 +1,4 @@
1
- import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-SUx16Sl3.js";import{t as n}from"./slot-DT_E5BQx.js";import{t as r}from"./icon-button-CbqMI7q3.js";import{t as i}from"./compose-refs-Cjf2gfB8.js";import{t as a}from"./use-copy-to-clipboard-BLpquU9d.js";import{t as o}from"./traffic-policy-file-0g5RXFqu.js";import{S as s,_ as c,a as l,b as u,c as d,d as f,f as p,g as m,h,i as g,l as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,u as T,v as E,y as D}from"./resolve-pre-rendered-props-DwIF_M_K.js";import{CaretDownIcon as O}from"@phosphor-icons/react/CaretDown";import{createContext as ee,forwardRef as k,useCallback as A,useContext as te,useEffect as j,useId as ne,useLayoutEffect as re,useMemo as M,useRef as N,useState as P}from"react";import F from"tiny-invariant";import{jsx as I,jsxs as ie}from"react/jsx-runtime";import{CheckIcon as ae}from"@phosphor-icons/react/Check";import{CopyIcon as oe}from"@phosphor-icons/react/Copy";import{FileTextIcon as se}from"@phosphor-icons/react/FileText";import{TerminalIcon as ce}from"@phosphor-icons/react/Terminal";import{Content as le,List as ue,Root as de,Trigger as fe}from"@radix-ui/react-tabs";function L(e){let t=-1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`&`||r===`<`||r===`>`||r===`"`||r===`'`){t=n;break}}if(t===-1)return e;let n=e.slice(0,t);for(let r=t;r<e.length;r++){let t=e[r];switch(t){case`&`:n+=`&amp;`;break;case`<`:n+=`&lt;`;break;case`>`:n+=`&gt;`;break;case`"`:n+=`&quot;`;break;case`'`:n+=`&#39;`;break;default:n+=t}}return n}const R=new WeakMap;function z(e){let t=new Set;if(e==null||e===``)return t;for(let n of e.split(` `))n!==``&&t.add(n);return t}function pe(e){let t=R.get(e);if(t!=null&&ge(t))return t;let n=new Map,r=new WeakMap,i=e.querySelectorAll(`[data-fold-regions]`);for(let e=0;e<i.length;e+=1){let t=i[e];if(!(t instanceof HTMLElement))continue;let a=z(t.dataset.foldRegions);if(a.size!==0){r.set(t,a);for(let e of a){let r=n.get(e);r??(r=[],n.set(e,r)),r.push(t)}}}let a={regionToLines:n,lineToRegions:r};return R.set(e,a),a}function me(e){R.delete(e)}function he(e){me(e),e.removeAttribute(`data-folded-regions`)}function ge(e){for(let t of e.regionToLines.values()){if(t.length===0)continue;let e=t[0];if(e!=null)return e.isConnected}return!0}function _e(e,t,n){let r=!1;for(let e of n)if(t.has(e)){r=!0;break}r?e.dataset.foldHidden=`true`:delete e.dataset.foldHidden}function ve(e){let t=e.dataset.foldLine;if(t==null||t===``)return!1;let n=e.closest(`[data-slot='code-block-code']`)?.querySelector(`code`);if(n==null)return!1;let r=z(n.getAttribute(`data-folded-regions`)),i=!r.has(t);i?r.add(t):r.delete(t),r.size===0?n.removeAttribute(`data-folded-regions`):n.setAttribute(`data-folded-regions`,[...r].join(` `)),e.setAttribute(`aria-expanded`,i?`false`:`true`);let{regionToLines:a,lineToRegions:o}=pe(n),s=a.get(t);if(s!=null)for(let e of s){let t=o.get(e);t!=null&&_e(e,r,t)}return!0}function ye(e){let t=e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`.mantle-code-fold-toggle`);n instanceof HTMLButtonElement&&ve(n)};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}}const B=ee(null);function V(){let e=te(B);return F(e!=null,`CodeBlock subcomponents must be rendered within a <CodeBlock.Root>.`),e}const H=k(({asChild:t=!1,className:r,defaultTab:i,activeTab:a,onActiveTabChange:o,...s},c)=>{let l=N(``),[u,d]=P(!1),[f,p]=P(!1),[m,h]=P(void 0),g=A(e=>{h(t=>(F(t==null,`You can only render a single CodeBlock.Code within a CodeBlock.`),e))},[]),_=A(e=>{h(t=>{F(t===e,`You can only render a single CodeBlock.Code within a CodeBlock.`)})},[]),v=M(()=>({codeId:m,copyTextRef:l,hasCodeExpander:u,isCodeExpanded:f,registerCodeId:g,setHasCodeExpander:d,setIsCodeExpanded:p,unregisterCodeId:_}),[m,u,f,g,_]),y=i!=null||a!=null,b=I(t?n:`div`,{"data-slot":`code-block`,className:e(`text-mono w-full overflow-hidden rounded-md border border-gray-300 bg-card font-mono`,`[&_svg]:shrink-0`,r),ref:c,...s});return I(B.Provider,{value:v,children:y?I(de,{asChild:!0,defaultValue:i,value:a,onValueChange:o,children:b}):b})});H.displayName=`CodeBlock`;const U=k(({asChild:t=!1,className:r,...i},a)=>I(t?n:`div`,{"data-slot":`code-block-body`,className:e(`relative`,r),ref:a,...i}));U.displayName=`CodeBlockBody`;const be=/SHIKI_VAL_(\d+)/g;function xe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}const W=new Map;function Se(e){if(e==null||e.length===0)return be;let t=W.get(e);return t??(W.size>=500&&W.clear(),t=RegExp(`${xe(e)}(\\d+)__`,`g`),W.set(e,t)),t}function G(e,t,n,r){if(n==null){if(!e.includes(`SHIKI_VAL_`))return e}else if(!e.includes(n))return e;return e.replaceAll(Se(n),(e,n)=>{let i=Number.parseInt(n,10);return Number.isNaN(i)||i<0||i>=t.length?e:r(t[i])})}function Ce(e,t,n){return G(e,t,n,e=>L(String(e)))}function we(e,t,n){return G(e,t,n,e=>String(e))}const K=k(({className:t,style:n,value:r,...a},o)=>{let s=ne(),c=N(null),{copyTextRef:l,hasCodeExpander:u,isCodeExpanded:d,registerCodeId:f,unregisterCodeId:p}=V(),{language:m,code:h,"~preValToken":g,"~preVals":_,"~highlightLines":v,"~lineNumberStart":y,"~preHtml":b,"~showLineNumbers":x}=r,S=v,C=y??1,w=x??!1,T=M(()=>_!=null&&_.length>0?we(h,_,g):h,[g,_,h]);re(()=>{l.current=T},[l,T]),j(()=>(f(s),()=>{p(s)}),[s,f,p]);let E=M(()=>{if(b!=null)return _!=null&&_.length>0?Ce(b,_,g):b},[b,g,_]);j(()=>{let e=c.current;if(e==null)return;let t=e.querySelector(`code`);return t!=null&&he(t),ye(e)},[E]);let D=E!=null,O=E??L(T),ee=M(()=>({__html:O}),[O]);return I(`pre`,{"data-slot":`code-block-code`,"aria-expanded":u?d:void 0,className:e(`scrollbar overflow-x-auto overflow-y-hidden py-4`,!D&&`pr-14`,`data-[mantle-line-numbers~='false']:pl-4`,`text-mono m-0 font-mono outline-hidden`,`aria-collapsed:max-h-[13.6rem]`,t),"data-highlighted":D?`true`:`false`,"data-lang":m,"data-mantle-highlight-lines":D&&S!=null&&S.length>0?S.join(`,`):void 0,"data-mantle-line-number-start":D&&w?String(C):`1`,"data-mantle-line-numbers":D&&w?`true`:`false`,id:s,ref:i(c,o),style:{...n,"--mantle-line-number-start":String(C),tabSize:2,MozTabSize:2},...a,children:I(`code`,{className:`text-size-inherit block min-w-full w-max`,dangerouslySetInnerHTML:ee})})});K.displayName=`CodeBlockCode`;const q=k(({asChild:t=!1,className:r,...i},a)=>I(t?n:`div`,{"data-slot":`code-block-header`,className:e(`flex items-center gap-1 border-b border-gray-300 bg-base px-4 py-2 text-gray-700`,r),ref:a,...i}));q.displayName=`CodeBlockHeader`;const J=k(({asChild:t=!1,className:r,...i},a)=>I(t?n:`h3`,{"data-slot":`code-block-title`,ref:a,className:e(`text-mono m-0 font-mono font-normal`,r),...i}));J.displayName=`CodeBlockTitle`;const Y=k(({className:e,label:t=`Copy code`,onCopy:n,onCopyError:i,onClick:o,...s},c)=>{let{copyTextRef:l}=V(),u=a(),[d,f]=P(!1),p=N(void 0);return j(()=>()=>{p.current!=null&&clearTimeout(p.current)},[]),I(`span`,{"data-slot":`code-block-copy-button`,className:`absolute right-3 top-3 z-10 inline-flex size-7 items-center justify-center rounded-[var(--icon-button-border-radius,0.375rem)] bg-card`,children:I(r,{type:`button`,appearance:`ghost`,size:`sm`,label:t,icon:I(d?ae:oe,{}),className:e,ref:c,onClick:async e=>{try{if(o?.(e),e.defaultPrevented){p.current!=null&&clearTimeout(p.current);return}let t=l.current;await u(t),n?.(t),f(!0),p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{f(!1)},2e3)}catch(e){i?.(e)}},...s})})});Y.displayName=`CodeBlockCopyButton`;const X=k(({asChild:r=!1,className:i,onClick:a,...o},s)=>{let{codeId:c,isCodeExpanded:l,setIsCodeExpanded:u,setHasCodeExpander:d}=V();return j(()=>(d(!0),()=>{d(!1)}),[d]),ie(r?n:`button`,{...o,"data-slot":`code-block-expander-button`,"aria-controls":c,"aria-expanded":l,className:e(`flex w-full items-center justify-center gap-0.5 border-t border-gray-300 bg-card px-4 py-2 font-sans text-gray-700 hover:bg-gray-100`,i),ref:s,type:`button`,onClick:e=>{u(e=>!e),a?.(e)},children:[l?`Show less`:`Show more`,` `,I(t,{svg:I(O,{weight:`bold`}),className:e(`size-4`,l&&`rotate-180`,`transition-all duration-150`)})]})});X.displayName=`CodeBlockExpanderButton`;function Z({className:e,preset:n,svg:r,...i}){let a=r;if(n!=null)switch(n){case`file`:a=I(se,{weight:`fill`});break;case`cli`:a=I(ce,{weight:`fill`});break;case`traffic-policy`:a=I(o,{});break}return I(t,{"data-slot":`code-block-icon`,className:e,svg:a,...i})}Z.displayName=`CodeBlockIcon`;const Q=k(({className:t,...n},r)=>I(ue,{"data-slot":`code-block-tab-list`,className:e(`flex items-center gap-1`,t),ref:r,...n}));Q.displayName=`CodeBlockTabList`;const Te=k(({className:t,...n},r)=>I(fe,{"data-slot":`code-block-tab-trigger`,className:e(`cursor-pointer rounded px-1.5 py-0.5 text-xs font-medium`,`text-gray-600 outline-hidden`,`hover:text-gray-900`,`data-[state=active]:bg-neutral-500/15 data-[state=active]:text-strong`,`focus-visible:ring-focus-accent focus-visible:ring-4`,t),ref:r,...n}));Te.displayName=`CodeBlockTabTrigger`;const Ee=k((e,t)=>I(le,{"data-slot":`code-block-tab-content`,ref:t,...e}));Ee.displayName=`CodeBlockTabContent`;const De={Root:H,Body:U,Code:K,CopyButton:Y,ExpanderButton:X,Header:q,Icon:Z,TabContent:Ee,TabList:Q,TabTrigger:Te,Title:J},Oe=`var(--shiki-foreground)`;function ke(e){return e.replace(/[&<]/g,e=>e===`&`?`&#x26;`:`&#x3C;`)}function Ae(e){return e===` `||e===` `||e===`
1
+ import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-SUx16Sl3.js";import{t as n}from"./slot-DT_E5BQx.js";import{t as r}from"./icon-button-DiX9iZ9n.js";import{t as i}from"./compose-refs-Cjf2gfB8.js";import{t as a}from"./use-copy-to-clipboard-BLpquU9d.js";import{t as o}from"./traffic-policy-file-0g5RXFqu.js";import{S as s,_ as c,a as l,b as u,c as d,d as f,f as p,g as m,h,i as g,l as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,u as T,v as E,y as D}from"./resolve-pre-rendered-props-DwIF_M_K.js";import{CaretDownIcon as O}from"@phosphor-icons/react/CaretDown";import{createContext as ee,forwardRef as k,useCallback as A,useContext as te,useEffect as j,useId as ne,useLayoutEffect as re,useMemo as M,useRef as N,useState as P}from"react";import F from"tiny-invariant";import{jsx as I,jsxs as ie}from"react/jsx-runtime";import{CheckIcon as ae}from"@phosphor-icons/react/Check";import{CopyIcon as oe}from"@phosphor-icons/react/Copy";import{FileTextIcon as se}from"@phosphor-icons/react/FileText";import{TerminalIcon as ce}from"@phosphor-icons/react/Terminal";import{Content as le,List as ue,Root as de,Trigger as fe}from"@radix-ui/react-tabs";function L(e){let t=-1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`&`||r===`<`||r===`>`||r===`"`||r===`'`){t=n;break}}if(t===-1)return e;let n=e.slice(0,t);for(let r=t;r<e.length;r++){let t=e[r];switch(t){case`&`:n+=`&amp;`;break;case`<`:n+=`&lt;`;break;case`>`:n+=`&gt;`;break;case`"`:n+=`&quot;`;break;case`'`:n+=`&#39;`;break;default:n+=t}}return n}const R=new WeakMap;function z(e){let t=new Set;if(e==null||e===``)return t;for(let n of e.split(` `))n!==``&&t.add(n);return t}function pe(e){let t=R.get(e);if(t!=null&&ge(t))return t;let n=new Map,r=new WeakMap,i=e.querySelectorAll(`[data-fold-regions]`);for(let e=0;e<i.length;e+=1){let t=i[e];if(!(t instanceof HTMLElement))continue;let a=z(t.dataset.foldRegions);if(a.size!==0){r.set(t,a);for(let e of a){let r=n.get(e);r??(r=[],n.set(e,r)),r.push(t)}}}let a={regionToLines:n,lineToRegions:r};return R.set(e,a),a}function me(e){R.delete(e)}function he(e){me(e),e.removeAttribute(`data-folded-regions`)}function ge(e){for(let t of e.regionToLines.values()){if(t.length===0)continue;let e=t[0];if(e!=null)return e.isConnected}return!0}function _e(e,t,n){let r=!1;for(let e of n)if(t.has(e)){r=!0;break}r?e.dataset.foldHidden=`true`:delete e.dataset.foldHidden}function ve(e){let t=e.dataset.foldLine;if(t==null||t===``)return!1;let n=e.closest(`[data-slot='code-block-code']`)?.querySelector(`code`);if(n==null)return!1;let r=z(n.getAttribute(`data-folded-regions`)),i=!r.has(t);i?r.add(t):r.delete(t),r.size===0?n.removeAttribute(`data-folded-regions`):n.setAttribute(`data-folded-regions`,[...r].join(` `)),e.setAttribute(`aria-expanded`,i?`false`:`true`);let{regionToLines:a,lineToRegions:o}=pe(n),s=a.get(t);if(s!=null)for(let e of s){let t=o.get(e);t!=null&&_e(e,r,t)}return!0}function ye(e){let t=e=>{let t=e.target;if(!(t instanceof Element))return;let n=t.closest(`.mantle-code-fold-toggle`);n instanceof HTMLButtonElement&&ve(n)};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}}const B=ee(null);function V(){let e=te(B);return F(e!=null,`CodeBlock subcomponents must be rendered within a <CodeBlock.Root>.`),e}const H=k(({asChild:t=!1,className:r,defaultTab:i,activeTab:a,onActiveTabChange:o,...s},c)=>{let l=N(``),[u,d]=P(!1),[f,p]=P(!1),[m,h]=P(void 0),g=A(e=>{h(t=>(F(t==null,`You can only render a single CodeBlock.Code within a CodeBlock.`),e))},[]),_=A(e=>{h(t=>{F(t===e,`You can only render a single CodeBlock.Code within a CodeBlock.`)})},[]),v=M(()=>({codeId:m,copyTextRef:l,hasCodeExpander:u,isCodeExpanded:f,registerCodeId:g,setHasCodeExpander:d,setIsCodeExpanded:p,unregisterCodeId:_}),[m,u,f,g,_]),y=i!=null||a!=null,b=I(t?n:`div`,{"data-slot":`code-block`,className:e(`text-mono w-full overflow-hidden rounded-md border border-gray-300 bg-card font-mono`,`[&_svg]:shrink-0`,r),ref:c,...s});return I(B.Provider,{value:v,children:y?I(de,{asChild:!0,defaultValue:i,value:a,onValueChange:o,children:b}):b})});H.displayName=`CodeBlock`;const U=k(({asChild:t=!1,className:r,...i},a)=>I(t?n:`div`,{"data-slot":`code-block-body`,className:e(`relative`,r),ref:a,...i}));U.displayName=`CodeBlockBody`;const be=/SHIKI_VAL_(\d+)/g;function xe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}const W=new Map;function Se(e){if(e==null||e.length===0)return be;let t=W.get(e);return t??(W.size>=500&&W.clear(),t=RegExp(`${xe(e)}(\\d+)__`,`g`),W.set(e,t)),t}function G(e,t,n,r){if(n==null){if(!e.includes(`SHIKI_VAL_`))return e}else if(!e.includes(n))return e;return e.replaceAll(Se(n),(e,n)=>{let i=Number.parseInt(n,10);return Number.isNaN(i)||i<0||i>=t.length?e:r(t[i])})}function Ce(e,t,n){return G(e,t,n,e=>L(String(e)))}function we(e,t,n){return G(e,t,n,e=>String(e))}const K=k(({className:t,style:n,value:r,...a},o)=>{let s=ne(),c=N(null),{copyTextRef:l,hasCodeExpander:u,isCodeExpanded:d,registerCodeId:f,unregisterCodeId:p}=V(),{language:m,code:h,"~preValToken":g,"~preVals":_,"~highlightLines":v,"~lineNumberStart":y,"~preHtml":b,"~showLineNumbers":x}=r,S=v,C=y??1,w=x??!1,T=M(()=>_!=null&&_.length>0?we(h,_,g):h,[g,_,h]);re(()=>{l.current=T},[l,T]),j(()=>(f(s),()=>{p(s)}),[s,f,p]);let E=M(()=>{if(b!=null)return _!=null&&_.length>0?Ce(b,_,g):b},[b,g,_]);j(()=>{let e=c.current;if(e==null)return;let t=e.querySelector(`code`);return t!=null&&he(t),ye(e)},[E]);let D=E!=null,O=E??L(T),ee=M(()=>({__html:O}),[O]);return I(`pre`,{"data-slot":`code-block-code`,"aria-expanded":u?d:void 0,className:e(`scrollbar overflow-x-auto overflow-y-hidden py-4`,!D&&`pr-14`,`data-[mantle-line-numbers~='false']:pl-4`,`text-mono m-0 font-mono outline-hidden`,`aria-collapsed:max-h-[13.6rem]`,t),"data-highlighted":D?`true`:`false`,"data-lang":m,"data-mantle-highlight-lines":D&&S!=null&&S.length>0?S.join(`,`):void 0,"data-mantle-line-number-start":D&&w?String(C):`1`,"data-mantle-line-numbers":D&&w?`true`:`false`,id:s,ref:i(c,o),style:{...n,"--mantle-line-number-start":String(C),tabSize:2,MozTabSize:2},...a,children:I(`code`,{className:`text-size-inherit block min-w-full w-max`,dangerouslySetInnerHTML:ee})})});K.displayName=`CodeBlockCode`;const q=k(({asChild:t=!1,className:r,...i},a)=>I(t?n:`div`,{"data-slot":`code-block-header`,className:e(`flex items-center gap-1 border-b border-gray-300 bg-base px-4 py-2 text-gray-700`,r),ref:a,...i}));q.displayName=`CodeBlockHeader`;const J=k(({asChild:t=!1,className:r,...i},a)=>I(t?n:`h3`,{"data-slot":`code-block-title`,ref:a,className:e(`text-mono m-0 font-mono font-normal`,r),...i}));J.displayName=`CodeBlockTitle`;const Y=k(({className:e,label:t=`Copy code`,onCopy:n,onCopyError:i,onClick:o,...s},c)=>{let{copyTextRef:l}=V(),u=a(),[d,f]=P(!1),p=N(void 0);return j(()=>()=>{p.current!=null&&clearTimeout(p.current)},[]),I(`span`,{"data-slot":`code-block-copy-button`,className:`absolute right-3 top-3 z-10 inline-flex size-7 items-center justify-center rounded-[var(--icon-button-border-radius,0.375rem)] bg-card`,children:I(r,{type:`button`,appearance:`ghost`,size:`sm`,label:t,icon:I(d?ae:oe,{}),className:e,ref:c,onClick:async e=>{try{if(o?.(e),e.defaultPrevented){p.current!=null&&clearTimeout(p.current);return}let t=l.current;await u(t),n?.(t),f(!0),p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{f(!1)},2e3)}catch(e){i?.(e)}},...s})})});Y.displayName=`CodeBlockCopyButton`;const X=k(({asChild:r=!1,className:i,onClick:a,...o},s)=>{let{codeId:c,isCodeExpanded:l,setIsCodeExpanded:u,setHasCodeExpander:d}=V();return j(()=>(d(!0),()=>{d(!1)}),[d]),ie(r?n:`button`,{...o,"data-slot":`code-block-expander-button`,"aria-controls":c,"aria-expanded":l,className:e(`flex w-full items-center justify-center gap-0.5 border-t border-gray-300 bg-card px-4 py-2 font-sans text-gray-700 hover:bg-gray-100`,i),ref:s,type:`button`,onClick:e=>{u(e=>!e),a?.(e)},children:[l?`Show less`:`Show more`,` `,I(t,{svg:I(O,{weight:`bold`}),className:e(`size-4`,l&&`rotate-180`,`transition-all duration-150`)})]})});X.displayName=`CodeBlockExpanderButton`;function Z({className:e,preset:n,svg:r,...i}){let a=r;if(n!=null)switch(n){case`file`:a=I(se,{weight:`fill`});break;case`cli`:a=I(ce,{weight:`fill`});break;case`traffic-policy`:a=I(o,{});break}return I(t,{"data-slot":`code-block-icon`,className:e,svg:a,...i})}Z.displayName=`CodeBlockIcon`;const Q=k(({className:t,...n},r)=>I(ue,{"data-slot":`code-block-tab-list`,className:e(`flex items-center gap-1`,t),ref:r,...n}));Q.displayName=`CodeBlockTabList`;const Te=k(({className:t,...n},r)=>I(fe,{"data-slot":`code-block-tab-trigger`,className:e(`cursor-pointer rounded px-1.5 py-0.5 text-xs font-medium`,`text-gray-600 outline-hidden`,`hover:text-gray-900`,`data-[state=active]:bg-neutral-500/15 data-[state=active]:text-strong`,`focus-visible:ring-focus-accent focus-visible:ring-4`,t),ref:r,...n}));Te.displayName=`CodeBlockTabTrigger`;const Ee=k((e,t)=>I(le,{"data-slot":`code-block-tab-content`,ref:t,...e}));Ee.displayName=`CodeBlockTabContent`;const De={Root:H,Body:U,Code:K,CopyButton:Y,ExpanderButton:X,Header:q,Icon:Z,TabContent:Ee,TabList:Q,TabTrigger:Te,Title:J},Oe=`var(--shiki-foreground)`;function ke(e){return e.replace(/[&<]/g,e=>e===`&`?`&#x26;`:`&#x3C;`)}function Ae(e){return e===` `||e===` `||e===`
2
2
  `||e===`\r`||e===`{`||e===`}`||e===`[`||e===`]`||e===`:`||e===`,`||e===`"`}function je(e,t,n){let r=e.length,i=[],a=`"`,o=t+1;for(;o<r;){let t=e[o];if(t===`\\`){let t=e[o+1]===`u`&&/^[0-9a-fA-F]{4}$/.test(e.slice(o+2,o+6))?6:2;a!==``&&(i.push({text:a,isEscape:!1}),a=``),i.push({text:e.slice(o,o+t),isEscape:!0}),o+=t;continue}if(t===`"`){a+=`"`,o+=1;break}a+=t,o+=1}a!==``&&i.push({text:a,isEscape:!1});let s=o;for(;s<r;){let t=e[s];if(t===` `||t===` `||t===`
3
3
  `||t===`\r`){s+=1;continue}break}let c=e[s]===`:`?`var(--shiki-token-keyword)`:`var(--shiki-token-string-expression)`;for(let e of i)n(e.text,e.isEscape?`var(--shiki-token-escape, var(--shiki-token-constant))`:c);return o}function Me(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(n!=null&&n.color==null){let r=Oe;for(let n=t+1;n<e.length;n+=1){let t=e[n];if(t!=null&&t.color!=null){r=t.color;break}}n.color=r}}let t=``,n=``,r=null,i=()=>{r!=null&&(t+=`<span style="color:${r}">${ke(n)}</span>`),n=``,r=null};for(let t of e)t!=null&&(t.color===r?n+=t.text:(i(),n=t.text,r=t.color));return i(),`<span class="line">${t}</span>`}function $(e){let t=[[]],n=t[0]??[],r=e.length,i=0,a=(e,t)=>{n.push({text:e,color:t})};for(;i<r;){let o=e[i];if(o===`
4
4
  `||o===`\r`){o===`\r`&&e[i+1]===`
package/dist/command.d.ts CHANGED
@@ -135,7 +135,7 @@ declare const Command: {
135
135
  ref?: React.Ref<HTMLDivElement>;
136
136
  } & {
137
137
  asChild?: boolean;
138
- }, "key" | "asChild" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
138
+ }, "key" | keyof import("react").HTMLAttributes<HTMLDivElement> | "asChild"> & {
139
139
  label?: string;
140
140
  shouldFilter?: boolean;
141
141
  filter?: (value: string, search: string, keywords?: string[]) => number;
@@ -243,7 +243,7 @@ declare const Command: {
243
243
  ref?: React.Ref<HTMLInputElement>;
244
244
  } & {
245
245
  asChild?: boolean;
246
- }, "key" | "asChild" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "onChange" | "value" | "type"> & {
246
+ }, "key" | "asChild" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
247
247
  value?: string;
248
248
  onValueChange?: (search: string) => void;
249
249
  } & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -285,7 +285,7 @@ declare const Command: {
285
285
  ref?: React.Ref<HTMLDivElement>;
286
286
  } & {
287
287
  asChild?: boolean;
288
- }, "key" | "asChild" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
288
+ }, "key" | keyof import("react").HTMLAttributes<HTMLDivElement> | "asChild"> & {
289
289
  label?: string;
290
290
  } & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
291
291
  /**
@@ -326,7 +326,7 @@ declare const Command: {
326
326
  ref?: React.Ref<HTMLDivElement>;
327
327
  } & {
328
328
  asChild?: boolean;
329
- }, "key" | "asChild" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
329
+ }, "key" | keyof import("react").HTMLAttributes<HTMLDivElement> | "asChild"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
330
330
  /**
331
331
  * The group component for the Command component.
332
332
  *
@@ -365,7 +365,7 @@ declare const Command: {
365
365
  ref?: React.Ref<HTMLDivElement>;
366
366
  } & {
367
367
  asChild?: boolean;
368
- }, "key" | "asChild" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "value" | "heading"> & {
368
+ }, "key" | keyof import("react").HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "heading"> & {
369
369
  heading?: React.ReactNode;
370
370
  value?: string;
371
371
  forceMount?: boolean;
@@ -408,7 +408,7 @@ declare const Command: {
408
408
  ref?: React.Ref<HTMLDivElement>;
409
409
  } & {
410
410
  asChild?: boolean;
411
- }, "key" | "asChild" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "onSelect" | "disabled" | "value"> & {
411
+ }, "key" | keyof import("react").HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "disabled" | "value"> & {
412
412
  disabled?: boolean;
413
413
  onSelect?: (value: string) => void;
414
414
  value?: string;
@@ -484,7 +484,7 @@ declare const Command: {
484
484
  ref?: React.Ref<HTMLDivElement>;
485
485
  } & {
486
486
  asChild?: boolean;
487
- }, "key" | "asChild" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
487
+ }, "key" | keyof import("react").HTMLAttributes<HTMLDivElement> | "asChild"> & {
488
488
  alwaysRender?: boolean;
489
489
  } & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
490
490
  };
package/dist/command.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-C1UYP5We.js";import{n as t}from"./separator-DtufgIHt.js";import{t as n}from"./dialog-2tNq-mRR.js";import{t as r}from"./kbd-D6k4Dnrf.js";import{forwardRef as i,useEffect as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{MagnifyingGlassIcon as l}from"@phosphor-icons/react/MagnifyingGlass";import{Command as u,useCommandState as d}from"cmdk";const f=i(({className:t,...n},r)=>s(u,{ref:r,"data-slot":`command`,className:e(`bg-popover flex h-full w-full flex-col overflow-hidden rounded-md`,t),...n}));f.displayName=`Command`;const p=({children:t,className:r,description:i=`Search for a command to run...`,filter:a,shouldFilter:o,showCloseButton:l=!0,title:u=`Command Palette`})=>c(n.Content,{className:e(`overflow-hidden p-0 relative`,r),children:[c(n.Header,{className:`sr-only absolute`,children:[s(n.Title,{children:u}),s(n.Description,{children:i})]}),s(f,{className:`**:data-[slot=command-input-wrapper]:h-12 **:[[cmdk-input]]:h-12 **:data-[slot=command-group]:px-2 **:data-[slot=command-list]:pb-1`,filter:a,shouldFilter:o,children:t}),l&&s(`div`,{className:`absolute top-1.5 right-1.5`,children:s(n.CloseIconButton,{})})]});p.displayName=`CommandDialogContent`;const m=i(({className:t,...n},r)=>c(`div`,{ref:r,"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b border-popover px-3`,children:[s(l,{className:`size-5 shrink-0 opacity-50`}),s(u.Input,{"data-slot":`command-input`,className:e(`placeholder:text-muted flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,t),...n})]}));m.displayName=`CommandInput`;const h=i(({className:t,...n},r)=>s(u.List,{ref:r,"data-slot":`command-list`,className:e(`max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto scrollbar`,t),...n}));h.displayName=`CommandList`;const g=i(({className:t,...n},r)=>s(u.Empty,{ref:r,"data-slot":`command-empty`,className:e(`py-6 text-center text-sm`,t),...n}));g.displayName=`CommandEmpty`;const _=i(({className:t,...n},r)=>s(u.Group,{ref:r,"data-slot":`command-group`,className:e(`[&>[cmdk-group-heading]]:text-muted overflow-hidden p-1 [&>[cmdk-group-heading]]:px-2 [&>[cmdk-group-heading]]:py-1.5 [&>[cmdk-group-heading]]:text-xs [&>[cmdk-group-heading]]:font-medium`,t),...n}));_.displayName=`CommandGroup`;const v=i(({className:n,...r},i)=>s(u.Separator,{ref:i,"data-slot":`command-separator`,asChild:!0,...r,children:s(t,{className:e(`-mx-1 my-1 w-auto`,n)})}));v.displayName=`CommandSeparator`;const y=i(({className:t,...n},r)=>s(u.Item,{ref:r,"data-slot":`command-item`,className:e(`data-[selected=true]:bg-active-menu-item [:where(&_svg)]:text-muted relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [:where(&_svg)]:size-5`,t),...n}));y.displayName=`CommandItem`;const b=i(({className:t,...n},r)=>s(`span`,{ref:r,"data-slot":`command-shortcut`,className:e(`text-muted ml-auto text-xs tracking-widest`,t),...n}));b.displayName=`CommandShortcut`;const x={Root:f,DialogRoot:n.Root,DialogTrigger:n.Trigger,DialogContent:p,Input:m,List:h,Empty:g,Group:_,Item:y,Shortcut:b,Separator:v};function S({className:t,...n}){let[i,l]=o(`⌃`);a(()=>{l(w())},[]);let u=i===`⌘`?`Command`:`Control`;return c(r,{...n,suppressHydrationWarning:!0,"data-slot":`meta-key`,className:e(i===`⌃`&&`font-medium`,t),children:[s(`span`,{className:`sr-only`,children:u}),i]})}function C(e){return`userAgentData`in e}function w(){if(typeof navigator>`u`)return`⌃`;let e=``;return C(navigator)&&(e=navigator.userAgentData.platform??``),e||=navigator.platform||navigator.userAgent||``,/mac|iphone|ipad|ipod/i.test(e)?`⌘`:`⌃`}export{x as Command,S as MetaKey,d as useCommandState};
1
+ import{t as e}from"./cx-C1UYP5We.js";import{n as t}from"./separator-DtufgIHt.js";import{t as n}from"./dialog-Cp0S2jsG.js";import{t as r}from"./kbd-D6k4Dnrf.js";import{forwardRef as i,useEffect as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{MagnifyingGlassIcon as l}from"@phosphor-icons/react/MagnifyingGlass";import{Command as u,useCommandState as d}from"cmdk";const f=i(({className:t,...n},r)=>s(u,{ref:r,"data-slot":`command`,className:e(`bg-popover flex h-full w-full flex-col overflow-hidden rounded-md`,t),...n}));f.displayName=`Command`;const p=({children:t,className:r,description:i=`Search for a command to run...`,filter:a,shouldFilter:o,showCloseButton:l=!0,title:u=`Command Palette`})=>c(n.Content,{className:e(`overflow-hidden p-0 relative`,r),children:[c(n.Header,{className:`sr-only absolute`,children:[s(n.Title,{children:u}),s(n.Description,{children:i})]}),s(f,{className:`**:data-[slot=command-input-wrapper]:h-12 **:[[cmdk-input]]:h-12 **:data-[slot=command-group]:px-2 **:data-[slot=command-list]:pb-1`,filter:a,shouldFilter:o,children:t}),l&&s(`div`,{className:`absolute top-1.5 right-1.5`,children:s(n.CloseIconButton,{})})]});p.displayName=`CommandDialogContent`;const m=i(({className:t,...n},r)=>c(`div`,{ref:r,"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b border-popover px-3`,children:[s(l,{className:`size-5 shrink-0 opacity-50`}),s(u.Input,{"data-slot":`command-input`,className:e(`placeholder:text-muted flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,t),...n})]}));m.displayName=`CommandInput`;const h=i(({className:t,...n},r)=>s(u.List,{ref:r,"data-slot":`command-list`,className:e(`max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto scrollbar`,t),...n}));h.displayName=`CommandList`;const g=i(({className:t,...n},r)=>s(u.Empty,{ref:r,"data-slot":`command-empty`,className:e(`py-6 text-center text-sm`,t),...n}));g.displayName=`CommandEmpty`;const _=i(({className:t,...n},r)=>s(u.Group,{ref:r,"data-slot":`command-group`,className:e(`[&>[cmdk-group-heading]]:text-muted overflow-hidden p-1 [&>[cmdk-group-heading]]:px-2 [&>[cmdk-group-heading]]:py-1.5 [&>[cmdk-group-heading]]:text-xs [&>[cmdk-group-heading]]:font-medium`,t),...n}));_.displayName=`CommandGroup`;const v=i(({className:n,...r},i)=>s(u.Separator,{ref:i,"data-slot":`command-separator`,asChild:!0,...r,children:s(t,{className:e(`-mx-1 my-1 w-auto`,n)})}));v.displayName=`CommandSeparator`;const y=i(({className:t,...n},r)=>s(u.Item,{ref:r,"data-slot":`command-item`,className:e(`data-[selected=true]:bg-active-menu-item [:where(&_svg)]:text-muted relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [:where(&_svg)]:size-5`,t),...n}));y.displayName=`CommandItem`;const b=i(({className:t,...n},r)=>s(`span`,{ref:r,"data-slot":`command-shortcut`,className:e(`text-muted ml-auto text-xs tracking-widest`,t),...n}));b.displayName=`CommandShortcut`;const x={Root:f,DialogRoot:n.Root,DialogTrigger:n.Trigger,DialogContent:p,Input:m,List:h,Empty:g,Group:_,Item:y,Shortcut:b,Separator:v};function S({className:t,...n}){let[i,l]=o(`⌃`);a(()=>{l(w())},[]);let u=i===`⌘`?`Command`:`Control`;return c(r,{...n,suppressHydrationWarning:!0,"data-slot":`meta-key`,className:e(i===`⌃`&&`font-medium`,t),children:[s(`span`,{className:`sr-only`,children:u}),i]})}function C(e){return`userAgentData`in e}function w(){if(typeof navigator>`u`)return`⌃`;let e=``;return C(navigator)&&(e=navigator.userAgentData.platform??``),e||=navigator.platform||navigator.userAgent||``,/mac|iphone|ipad|ipod/i.test(e)?`⌘`:`⌃`}export{x as Command,S as MetaKey,d as useCommandState};
@@ -1,5 +1,5 @@
1
- import { t as Button } from "./button-mfYak6Rx.js";
2
- import { t as IconButton } from "./icon-button-BPvRuor6.js";
1
+ import { t as Button } from "./button-D9kqQuu9.js";
2
+ import { t as IconButton } from "./icon-button-D7hs6bX2.js";
3
3
  import { s as SortingMode } from "./direction-CcTY0FmA.js";
4
4
  import { t as Table$1 } from "./table-BWD9IlIN.js";
5
5
  import { ComponentProps, ReactNode } from "react";
@@ -1 +1 @@
1
- import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-button-CbqMI7q3.js";import{t as n}from"./button-BK8Thu3k.js";import{i as r}from"./direction-Wa9W2F61.js";import{t as i}from"./sort-BPX2Fk9t.js";import{t as a}from"./table-DpEcAEq5.js";import{Fragment as o,createContext as s,forwardRef as c,useContext as l,useMemo as u}from"react";import d from"tiny-invariant";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{flexRender as h}from"@tanstack/react-table";import{MinusIcon as g}from"@phosphor-icons/react/Minus";import{PlusIcon as _}from"@phosphor-icons/react/Plus";export*from"@tanstack/react-table";const v=[`unsorted`,`asc`,`desc`],y=[`unsorted`,`desc`,`asc`];function b(e,t){return x(t===`alphanumeric`?v:y,e)??`unsorted`}function x(e,t,n){if(e.length===0)return n;let r=e.findIndex(e=>e===t);if(r===-1)return n;let i=(r+1)%e.length;return e.at(i)??n}const S=s(null);function C(){let e=l(S);return d(e,`useDataTableContext should only be used within a DataTable child component`),e}function w({children:e,table:t,...n}){let r=u(()=>({table:t}),[t]);return p(S.Provider,{value:r,children:p(a.Root,{"data-slot":`data-table`,...n,children:p(a.Element,{children:e})})})}function T({children:t,className:i,column:a,disableSorting:o=!1,iconPlacement:s=`end`,sortingMode:c,sortIcon:l,onClick:u,...d}){let f=a.getIsSorted(),h=!o&&a.getCanSort(),g=h&&typeof f==`string`?f:`unsorted`,_=l?.(g)??p(V,{mode:c,direction:g});return m(n,{appearance:`ghost`,"data-slot":`data-table-header-sort-button`,className:e(`flex justify-start w-full h-full rounded-none not-disabled:active:scale-none text-muted`,i),"data-sort-direction":g,"data-table-header-action":!0,icon:_,iconPlacement:s,onClick:e=>{u?.(e),!e.defaultPrevented&&(!h||o||c===void 0||H(a,c))},priority:`neutral`,type:`button`,...d,children:[h&&g!==`unsorted`&&m(`span`,{className:`sr-only`,children:[`Column sorted in`,` `,c===`alphanumeric`?g===`asc`?`ascending`:`descending`:r(g),` `,`order`]}),t]})}function E({children:t,className:n,...r}){return p(a.Header,{"data-slot":`data-table-header`,className:e(`has-data-table-header-action:px-0`,n),...r,children:t})}const D=c((e,t)=>p(a.Body,{ref:t,"data-slot":`data-table-body`,...e}));D.displayName=`DataTableBody`;function O(e){let{table:t}=C();return p(a.Head,{"data-slot":`data-table-head`,...e,children:t.getHeaderGroups().map(e=>p(a.Row,{children:e.headers.map(e=>p(o,{children:e.isPlaceholder?p(a.Header,{},e.id):h(e.column.columnDef.header,e.getContext())},e.id))},e.id))})}function k({className:t,renderExpanded:n,row:r,...i}){let s=p(a.Row,{"data-slot":`data-table-row`,"data-expanded":r.getIsExpanded()||void 0,className:e(i.onClick&&`cursor-pointer`,t),...i,children:r.getVisibleCells().map(e=>p(o,{children:h(e.column.columnDef.cell,e.getContext())},e.id))});return n==null?s:m(f,{children:[s,r.getIsExpanded()&&p(z,{row:r,children:n(r)})]})}function A({children:e,...t}){let{table:n}=C(),r=n.getAllColumns().length;return p(a.Row,{"data-slot":`data-table-empty-row`,...t,children:p(a.Cell,{colSpan:r,children:e})})}function j(){return p(`span`,{"aria-hidden":!0,className:e(`pointer-events-none absolute -inset-y-px -left-1.5 w-1.5`,`opacity-0 transition-opacity group-data-sticky-active/table:opacity-100`,`shadow-[1px_0_0_0_var(--border-color-card-muted)]`,`bg-linear-to-l to-transparent`,`from-[color-mix(in_oklab,var(--shadow-color)_var(--shadow-second-opacity),transparent)]`)})}function M({children:t,className:n,...r}){return m(a.Cell,{"data-mantle-table-sticky-right":!0,"data-slot":`data-table-action-cell`,className:e(`sticky z-10 right-0 text-end align-middle bg-inherit p-2`,n),...r,children:[p(j,{}),t]})}function N({children:t,className:n,...r}){let{table:i}=C(),o=i.getRowModel().rows.length>0;return m(a.Header,{...o?{"data-mantle-table-sticky-right":!0}:{},"data-slot":`data-table-action-header`,className:e(o&&`sticky z-10 right-0 bg-inherit`,n),...r,children:[o&&p(j,{}),t]})}function P(e){return`data-table-expanded-row-${encodeURIComponent(e.id)}`}function F({children:t,className:n,...r}){return p(a.Header,{"data-slot":`data-table-expand-header`,className:e(`w-9 px-0 text-center`,n),...r,children:t??p(`span`,{className:`sr-only`,children:`Row details`})})}const I=p(_,{weight:`bold`,className:`size-3.5`}),L=p(g,{weight:`bold`,className:`size-3.5`});function R({appearance:n=`ghost`,className:r,collapseIcon:i=L,expandIcon:a=I,label:o,onClick:s,row:c,size:l=`sm`,...u}){if(!c.getCanExpand())return null;let d=c.getIsExpanded(),f=c.getToggleExpandedHandler();return p(t,{type:`button`,"data-slot":`data-table-row-expand-button`,appearance:n,size:l,className:e(`rounded`,r),"aria-expanded":d,"aria-controls":d?P(c):void 0,icon:d?i:a,label:`${d?`Hide`:`Show`} details for ${o}`,onClick:e=>{e.stopPropagation(),s?.(e),!e.defaultPrevented&&f()},...u})}function z({children:t,className:n,colSpan:r,row:i,...o}){return p(a.Row,{"data-slot":`data-table-expanded-row`,"data-expanded-content":!0,className:e(`[&>td]:border-t-0`,n),...o,children:p(a.Cell,{id:P(i),colSpan:r??i.getVisibleCells().length,className:`bg-card font-sans text-body`,children:t})})}w.displayName=`DataTable`,M.displayName=`DataTableActionCell`,N.displayName=`DataTableActionHeader`,D.displayName=`DataTableBody`,A.displayName=`DataTableEmptyRow`,F.displayName=`DataTableExpandHeader`,z.displayName=`DataTableExpandedRow`,O.displayName=`DataTableHead`,E.displayName=`DataTableHeader`,T.displayName=`DataTableHeaderSortButton`,k.displayName=`DataTableRow`,R.displayName=`DataTableRowExpandButton`;const B={Root:w,ActionCell:M,ActionHeader:N,Cell:a.Cell,Body:D,EmptyRow:A,Head:O,Header:E,HeaderSortButton:T,Row:k,ExpandHeader:F,RowExpandButton:R,ExpandedRow:z};function V({direction:e,mode:t,...n}){return e===`unsorted`||!t||!e?p(`svg`,{"aria-hidden":!0,...n}):p(i,{mode:t,direction:e,...n})}function H(e,t){if(!e.getCanSort())return;let n=e.getIsSorted();switch(b(typeof n==`string`?n:`unsorted`,t)){case`unsorted`:e.clearSorting();return;case`asc`:e.toggleSorting(!1);return;case`desc`:e.toggleSorting(!0);return;default:return}}export{B as DataTable,P as expandedRowId};
1
+ import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-button-DiX9iZ9n.js";import{t as n}from"./button-C9GW9nAr.js";import{i as r}from"./direction-Wa9W2F61.js";import{t as i}from"./sort-BPX2Fk9t.js";import{t as a}from"./table-DpEcAEq5.js";import{Fragment as o,createContext as s,forwardRef as c,useContext as l,useMemo as u}from"react";import d from"tiny-invariant";import{Fragment as f,jsx as p,jsxs as m}from"react/jsx-runtime";import{flexRender as h}from"@tanstack/react-table";import{MinusIcon as g}from"@phosphor-icons/react/Minus";import{PlusIcon as _}from"@phosphor-icons/react/Plus";export*from"@tanstack/react-table";const v=[`unsorted`,`asc`,`desc`],y=[`unsorted`,`desc`,`asc`];function b(e,t){return x(t===`alphanumeric`?v:y,e)??`unsorted`}function x(e,t,n){if(e.length===0)return n;let r=e.findIndex(e=>e===t);if(r===-1)return n;let i=(r+1)%e.length;return e.at(i)??n}const S=s(null);function C(){let e=l(S);return d(e,`useDataTableContext should only be used within a DataTable child component`),e}function w({children:e,table:t,...n}){let r=u(()=>({table:t}),[t]);return p(S.Provider,{value:r,children:p(a.Root,{"data-slot":`data-table`,...n,children:p(a.Element,{children:e})})})}function T({children:t,className:i,column:a,disableSorting:o=!1,iconPlacement:s=`end`,sortingMode:c,sortIcon:l,onClick:u,...d}){let f=a.getIsSorted(),h=!o&&a.getCanSort(),g=h&&typeof f==`string`?f:`unsorted`,_=l?.(g)??p(V,{mode:c,direction:g});return m(n,{appearance:`ghost`,"data-slot":`data-table-header-sort-button`,className:e(`flex justify-start w-full h-full rounded-none not-disabled:active:scale-none text-muted`,i),"data-sort-direction":g,"data-table-header-action":!0,icon:_,iconPlacement:s,onClick:e=>{u?.(e),!e.defaultPrevented&&(!h||o||c===void 0||H(a,c))},priority:`neutral`,type:`button`,...d,children:[h&&g!==`unsorted`&&m(`span`,{className:`sr-only`,children:[`Column sorted in`,` `,c===`alphanumeric`?g===`asc`?`ascending`:`descending`:r(g),` `,`order`]}),t]})}function E({children:t,className:n,...r}){return p(a.Header,{"data-slot":`data-table-header`,className:e(`has-data-table-header-action:px-0`,n),...r,children:t})}const D=c((e,t)=>p(a.Body,{ref:t,"data-slot":`data-table-body`,...e}));D.displayName=`DataTableBody`;function O(e){let{table:t}=C();return p(a.Head,{"data-slot":`data-table-head`,...e,children:t.getHeaderGroups().map(e=>p(a.Row,{children:e.headers.map(e=>p(o,{children:e.isPlaceholder?p(a.Header,{},e.id):h(e.column.columnDef.header,e.getContext())},e.id))},e.id))})}function k({className:t,renderExpanded:n,row:r,...i}){let s=p(a.Row,{"data-slot":`data-table-row`,"data-expanded":r.getIsExpanded()||void 0,className:e(i.onClick&&`cursor-pointer`,t),...i,children:r.getVisibleCells().map(e=>p(o,{children:h(e.column.columnDef.cell,e.getContext())},e.id))});return n==null?s:m(f,{children:[s,r.getIsExpanded()&&p(z,{row:r,children:n(r)})]})}function A({children:e,...t}){let{table:n}=C(),r=n.getAllColumns().length;return p(a.Row,{"data-slot":`data-table-empty-row`,...t,children:p(a.Cell,{colSpan:r,children:e})})}function j(){return p(`span`,{"aria-hidden":!0,className:e(`pointer-events-none absolute -inset-y-px -left-1.5 w-1.5`,`opacity-0 transition-opacity group-data-sticky-active/table:opacity-100`,`shadow-[1px_0_0_0_var(--border-color-card-muted)]`,`bg-linear-to-l to-transparent`,`from-[color-mix(in_oklab,var(--shadow-color)_var(--shadow-second-opacity),transparent)]`)})}function M({children:t,className:n,...r}){return m(a.Cell,{"data-mantle-table-sticky-right":!0,"data-slot":`data-table-action-cell`,className:e(`sticky z-10 right-0 text-end align-middle bg-inherit p-2`,n),...r,children:[p(j,{}),t]})}function N({children:t,className:n,...r}){let{table:i}=C(),o=i.getRowModel().rows.length>0;return m(a.Header,{...o?{"data-mantle-table-sticky-right":!0}:{},"data-slot":`data-table-action-header`,className:e(o&&`sticky z-10 right-0 bg-inherit`,n),...r,children:[o&&p(j,{}),t]})}function P(e){return`data-table-expanded-row-${encodeURIComponent(e.id)}`}function F({children:t,className:n,...r}){return p(a.Header,{"data-slot":`data-table-expand-header`,className:e(`w-9 px-0 text-center`,n),...r,children:t??p(`span`,{className:`sr-only`,children:`Row details`})})}const I=p(_,{weight:`bold`,className:`size-3.5`}),L=p(g,{weight:`bold`,className:`size-3.5`});function R({appearance:n=`ghost`,className:r,collapseIcon:i=L,expandIcon:a=I,label:o,onClick:s,row:c,size:l=`sm`,...u}){if(!c.getCanExpand())return null;let d=c.getIsExpanded(),f=c.getToggleExpandedHandler();return p(t,{type:`button`,"data-slot":`data-table-row-expand-button`,appearance:n,size:l,className:e(`rounded`,r),"aria-expanded":d,"aria-controls":d?P(c):void 0,icon:d?i:a,label:`${d?`Hide`:`Show`} details for ${o}`,onClick:e=>{e.stopPropagation(),s?.(e),!e.defaultPrevented&&f()},...u})}function z({children:t,className:n,colSpan:r,row:i,...o}){return p(a.Row,{"data-slot":`data-table-expanded-row`,"data-expanded-content":!0,className:e(`[&>td]:border-t-0`,n),...o,children:p(a.Cell,{id:P(i),colSpan:r??i.getVisibleCells().length,className:`bg-card font-sans text-body`,children:t})})}w.displayName=`DataTable`,M.displayName=`DataTableActionCell`,N.displayName=`DataTableActionHeader`,D.displayName=`DataTableBody`,A.displayName=`DataTableEmptyRow`,F.displayName=`DataTableExpandHeader`,z.displayName=`DataTableExpandedRow`,O.displayName=`DataTableHead`,E.displayName=`DataTableHeader`,T.displayName=`DataTableHeaderSortButton`,k.displayName=`DataTableRow`,R.displayName=`DataTableRowExpandButton`;const B={Root:w,ActionCell:M,ActionHeader:N,Cell:a.Cell,Body:D,EmptyRow:A,Head:O,Header:E,HeaderSortButton:T,Row:k,ExpandHeader:F,RowExpandButton:R,ExpandedRow:z};function V({direction:e,mode:t,...n}){return e===`unsorted`||!t||!e?p(`svg`,{"aria-hidden":!0,...n}):p(i,{mode:t,direction:e,...n})}function H(e,t){if(!e.getCanSort())return;let n=e.getIsSorted();switch(b(typeof n==`string`?n:`unsorted`,t)){case`unsorted`:e.clearSorting();return;case`asc`:e.toggleSorting(!1);return;case`desc`:e.toggleSorting(!0);return;default:return}}export{B as DataTable,P as expandedRowId};
@@ -1 +1 @@
1
- import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-button-CbqMI7q3.js";import{a as n,c as r,i,n as a,o,r as s,s as c,t as l}from"./primitive-BEuiJONo.js";import{forwardRef as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{XIcon as p}from"@phosphor-icons/react/X";const m=o;m.displayName=`Dialog`;const h=u((e,t)=>d(r,{ref:t,"data-slot":`dialog-trigger`,...e}));h.displayName=`DialogTrigger`;const g=n;g.displayName=`DialogPortal`;const _=u((e,t)=>d(l,{ref:t,"data-slot":`dialog-close`,...e}));_.displayName=`DialogClose`;const v=u(({className:t,...n},r)=>d(i,{ref:r,"data-slot":`dialog-overlay`,className:e(`bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-50 backdrop-blur-xs`,t),...n}));v.displayName=`DialogOverlay`;const y=u(({children:t,className:n,preferredWidth:r=`max-w-lg`,...i},o)=>f(g,{children:[d(v,{}),d(`div`,{className:`fixed inset-4 z-50 flex items-center justify-center`,children:d(a,{"data-mantle-modal-content":!0,"data-slot":`dialog-content`,className:e(`flex max-h-full w-full flex-1 flex-col`,`outline-hidden focus-within:outline-hidden`,`border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200`,`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`,r,n),ref:o,...i,children:t})})]}));y.displayName=`DialogContent`;const b=({className:t,children:n,...r})=>d(`div`,{"data-slot":`dialog-header`,className:e(`border-dialog-muted text-strong relative flex shrink-0 items-center justify-between gap-2 border-b px-6 py-4`,`has-[.icon-button]:pr-4`,t),...r,children:n});b.displayName=`DialogHeader`;const x=({size:e=`md`,type:n=`button`,label:r=`Close Dialog`,appearance:i=`ghost`,...a})=>d(l,{asChild:!0,children:d(t,{appearance:i,"data-slot":`dialog-close-icon-button`,icon:d(p,{}),label:r,size:e,type:n,...a})});x.displayName=`DialogCloseIconButton`;const S=({className:t,...n})=>d(`div`,{"data-slot":`dialog-body`,className:e(`scrollbar scrollbar-gutter-stable text-body flex-1 overflow-y-auto p-6`,t),...n});S.displayName=`DialogBody`;const C=({className:t,...n})=>d(`div`,{"data-slot":`dialog-footer`,className:e(`border-dialog-muted flex shrink-0 justify-end gap-2 border-t px-6 py-4`,t),...n});C.displayName=`DialogFooter`;const w=u(({className:t,...n},r)=>d(c,{ref:r,"data-slot":`dialog-title`,className:e(`text-strong truncate text-lg font-medium`,t),...n}));w.displayName=`DialogTitle`;const T=u(({className:t,...n},r)=>d(s,{ref:r,"data-slot":`dialog-description`,className:e(`text-muted`,t),...n}));T.displayName=`DialogDescription`;const E={Root:m,Body:S,Close:_,CloseIconButton:x,Content:y,Description:T,Footer:C,Header:b,Overlay:v,Portal:g,Title:w,Trigger:h};export{E as t};
1
+ import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-button-DiX9iZ9n.js";import{a as n,c as r,i,n as a,o,r as s,s as c,t as l}from"./primitive-BFUir4UB.js";import{forwardRef as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{XIcon as p}from"@phosphor-icons/react/X";const m=o;m.displayName=`Dialog`;const h=u((e,t)=>d(r,{ref:t,"data-slot":`dialog-trigger`,...e}));h.displayName=`DialogTrigger`;const g=n;g.displayName=`DialogPortal`;const _=u((e,t)=>d(l,{ref:t,"data-slot":`dialog-close`,...e}));_.displayName=`DialogClose`;const v=u(({className:t,...n},r)=>d(i,{ref:r,"data-slot":`dialog-overlay`,className:e(`bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-50 backdrop-blur-xs`,t),...n}));v.displayName=`DialogOverlay`;const y=u(({children:t,className:n,preferredWidth:r=`max-w-lg`,...i},o)=>f(g,{children:[d(v,{}),d(`div`,{className:`fixed inset-4 z-50 flex items-center justify-center`,children:d(a,{"data-mantle-modal-content":!0,"data-slot":`dialog-content`,className:e(`flex max-h-full w-full flex-1 flex-col`,`outline-hidden focus-within:outline-hidden`,`border-dialog bg-dialog rounded-xl border shadow-lg transition-transform duration-200`,`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`,r,n),ref:o,...i,children:t})})]}));y.displayName=`DialogContent`;const b=({className:t,children:n,...r})=>d(`div`,{"data-slot":`dialog-header`,className:e(`border-dialog-muted text-strong relative flex shrink-0 items-center justify-between gap-2 border-b px-6 py-4`,`has-[.icon-button]:pr-4`,t),...r,children:n});b.displayName=`DialogHeader`;const x=({size:e=`md`,type:n=`button`,label:r=`Close Dialog`,appearance:i=`ghost`,...a})=>d(l,{asChild:!0,children:d(t,{appearance:i,"data-slot":`dialog-close-icon-button`,icon:d(p,{}),label:r,size:e,type:n,...a})});x.displayName=`DialogCloseIconButton`;const S=({className:t,...n})=>d(`div`,{"data-slot":`dialog-body`,className:e(`scrollbar scrollbar-gutter-stable text-body flex-1 overflow-y-auto p-6`,t),...n});S.displayName=`DialogBody`;const C=({className:t,...n})=>d(`div`,{"data-slot":`dialog-footer`,className:e(`border-dialog-muted flex shrink-0 justify-end gap-2 border-t px-6 py-4`,t),...n});C.displayName=`DialogFooter`;const w=u(({className:t,...n},r)=>d(c,{ref:r,"data-slot":`dialog-title`,className:e(`text-strong truncate text-lg font-medium`,t),...n}));w.displayName=`DialogTitle`;const T=u(({className:t,...n},r)=>d(s,{ref:r,"data-slot":`dialog-description`,className:e(`text-muted`,t),...n}));T.displayName=`DialogDescription`;const E={Root:m,Body:S,Close:_,CloseIconButton:x,Content:y,Description:T,Footer:C,Header:b,Overlay:v,Portal:g,Title:w,Trigger:h};export{E as t};
package/dist/dialog.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { n as isDialogOverlayTarget, t as Root } from "./primitive-FoWela9a.js";
2
- import { n as IconButtonProps } from "./icon-button-BPvRuor6.js";
2
+ import { n as IconButtonProps } from "./icon-button-D7hs6bX2.js";
3
3
  import { ComponentProps } from "react";
4
4
 
5
5
  //#region src/components/dialog/dialog.d.ts
package/dist/dialog.js CHANGED
@@ -1 +1 @@
1
- import{l as e}from"./primitive-BEuiJONo.js";import{t}from"./dialog-2tNq-mRR.js";export{t as Dialog,e as isDialogOverlayTarget};
1
+ import{l as e}from"./primitive-BFUir4UB.js";import{t}from"./dialog-Cp0S2jsG.js";export{t as Dialog,e as isDialogOverlayTarget};
package/dist/empty.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { t as SvgAttributes } from "./types-BvUzforF.js";
2
1
  import { t as WithAsChild } from "./as-child-uN_018tj.js";
2
+ import { t as SvgAttributes } from "./types-BvUzforF.js";
3
3
  import { ComponentProps, HTMLAttributes, ReactNode } from "react";
4
4
 
5
5
  //#region src/components/empty/empty.d.ts
package/dist/field.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as WithAsChild } from "./as-child-uN_018tj.js";
2
- import { n as IconButtonProps } from "./icon-button-BPvRuor6.js";
2
+ import { n as IconButtonProps } from "./icon-button-D7hs6bX2.js";
3
3
  import { a as ValidationState, c as parseValidation, i as ValidationProp, l as resolveValidation, n as ParsedValidation, o as WithValidation, r as Validation, s as isAriaInvalid, t as AriaInvalid } from "./validation-xyX_6kph.js";
4
4
  import { t as Slot } from "./index-CJbKEKr2.js";
5
5
  import { ComponentProps, ReactElement, ReactNode } from "react";
package/dist/field.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-C1UYP5We.js";import{t}from"./slot-DT_E5BQx.js";import{t as n}from"./icon-button-CbqMI7q3.js";import{i as r,n as i,r as a,t as o}from"./validation-DCyx-ceH.js";import{t as s}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t as c}from"./label-BLXfnQmn.js";import{t as l}from"./popover-Bq52EC7X.js";import{n as u,r as d,t as f}from"./field-context-4k1kI7Bo.js";import{Children as p,Fragment as m,cloneElement as h,forwardRef as g,isValidElement as _,useCallback as v,useContext as y,useId as b,useMemo as x,useState as S}from"react";import C from"tiny-invariant";import{jsx as w}from"react/jsx-runtime";import{QuestionIcon as T}from"@phosphor-icons/react/Question";const E=e=>{let t=[],n=new Set;for(let r of e??[]){if(typeof r!=`string`)continue;let e=r.trim();e.length===0||n.has(e)||(n.add(e),t.push(e))}return t},D=e=>!(e==null||typeof e==`boolean`||typeof e==`string`&&e.trim().length===0),O=({children:e,errorItemType:t})=>{let n=!1;return p.forEach(e,e=>{if(!(n||e==null||typeof e==`boolean`)){if(typeof e==`string`){e.trim().length>0&&(n=!0);return}if(!_(e)){n=!0;return}if(e.type===t){n=D(e.props.children);return}if(e.type===m){n=O({children:e.props.children,errorItemType:t});return}n=!0}}),n},k=g(({className:t,...n},r)=>w(`fieldset`,{ref:r,"data-slot":`field-set`,className:e(`flex w-full min-w-0 flex-col gap-4 border-0 p-0`,t),...n}));k.displayName=`FieldSet`;const A=g(({className:t,...n},r)=>w(`legend`,{ref:r,"data-slot":`field-legend`,className:e(`text-strong mb-1.5 text-sm font-medium font-sans`,t),...n}));A.displayName=`FieldLegend`;const j=g(({htmlFor:e,...t},n)=>{let r=y(u);return w(c,{ref:n,htmlFor:e??r?.controlId,...t})});j.displayName=`FieldLabel`;const M=g(({asChild:n,className:r,...i},a)=>w(n?t:`p`,{ref:a,"data-slot":`field-label-text`,className:e(`text-strong text-sm font-medium font-sans`,r),...i}));M.displayName=`FieldLabelText`;const N=g(({asChild:n,className:r,...i},a)=>w(n?t:`div`,{ref:a,"data-slot":`field-label-row`,className:e(`flex items-center gap-1`,r),...i}));N.displayName=`FieldLabelRow`;const P=l.Root,F=w(T,{}),I=g(({appearance:t=`ghost`,className:r,icon:i=F,label:a,size:o=`xs`,type:s=`button`,...c},u)=>w(l.Trigger,{asChild:!0,children:w(n,{ref:u,appearance:t,className:e(`text-body -my-0.5`,r),icon:i,label:a,size:o,type:s,...c})}));I.displayName=`FieldHelpTrigger`;const L=g((e,t)=>w(l.Content,{ref:t,"data-slot":`field-help-content`,...e}));L.displayName=`FieldHelpContent`;const R=g(({asChild:n,children:r,className:i,...a},o)=>w(n?t:`span`,{ref:o,"data-slot":`field-optional`,className:e(`text-muted text-sm font-normal font-sans`,i),...a,children:r??`(Optional)`}));R.displayName=`FieldOptional`;const z=g(({asChild:n,className:r,...i},a)=>w(n?t:`div`,{ref:a,"data-slot":`field-group`,className:e(`flex w-full flex-col gap-4`,r),...i}));z.displayName=`FieldGroup`;const B=g(({asChild:n,children:i,className:a,name:s,validation:c,...l},d)=>{let f=n?t:`div`,p=b(),m=b(),h=b(),[g,_]=S(!1),y=r(c??(g?`error`:void 0)),C=v(()=>(_(!0),()=>{_(!1)}),[]),T=x(()=>({controlId:p,descriptionId:m,errorId:h,hasErrors:g,name:s,registerError:C,validation:y}),[p,m,h,g,s,C,y]);return w(u.Provider,{value:T,children:w(o,{validation:y,children:w(f,{ref:d,"data-slot":`field-item`,"data-validation":y,className:e(`flex w-full flex-col gap-1.5`,a),...l,children:i})})})});B.displayName=`FieldItem`;const V=g(({children:e,...n},r)=>{let i=y(u),a=d({context:i});return typeof e==`function`?w(o,{validation:a.validation,children:w(f.Provider,{value:i?a.ariaProps:null,children:e(a.ariaProps)})}):(C(_(e),`Field.Control expects a single React element child (or a render-prop function). Got a non-element value (string, array, fragment, null, or undefined). Wrap the control in a single element, or use the function child form: <Field.Control>{(props) => <YourControl {...props} />}</Field.Control>.`),w(o,{validation:a.validation,children:w(f.Provider,{value:i?a.ariaProps:null,children:w(t,{ref:r,...n,children:h(e,a.ariaProps)})})}))});V.displayName=`FieldControl`;const H=g(({asChild:n,className:r,...i},a)=>w(n?t:`p`,{ref:a,"data-slot":`field-description`,id:y(u)?.descriptionId,className:e(`text-body text-sm leading-4`,`[:where([data-slot=field-error-list]+&)]:-mt-1.5`,r),...i}));H.displayName=`FieldDescription`;const U=g(({children:t,className:n,...r},i)=>D(t)?w(`li`,{ref:i,"data-slot":`field-error`,className:e(`text-danger-600 text-sm leading-4`,n),...r,children:t}):null);U.displayName=`FieldErrorItem`;const W=g(({messages:e,...t},n)=>w(G,{ref:n,...t,children:E(e).map(e=>w(U,{children:e},e))}));W.displayName=`FieldErrors`;const G=g(({asChild:n,children:r,className:i,...a},o)=>{let c=O({children:r,errorItemType:U}),l=y(u),d=l?.registerError;return s(()=>{if(!(!c||d==null))return d()},[c,d]),c?w(n?t:`ul`,{ref:o,"data-slot":`field-error-list`,id:l?.errorId,role:`list`,className:e(`m-0 flex w-full flex-col list-none p-0`,i),...a,children:r}):null});G.displayName=`FieldErrorList`;const K={Item:B,Control:V,Group:z,Set:k,Legend:A,Label:j,LabelText:M,LabelRow:N,Help:P,HelpTrigger:I,HelpContent:L,Optional:R,Description:H,Errors:W,ErrorList:G,ErrorItem:U},q=e=>E(e?.map(e=>typeof e==`string`||!e?e:e.message));export{K as Field,i as isAriaInvalid,a as parseValidation,r as resolveValidation,q as toErrorMessages};
1
+ import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./cx-C1UYP5We.js";import{t as n}from"./slot-DT_E5BQx.js";import{t as r}from"./icon-button-DiX9iZ9n.js";import{i,n as a,r as o,t as s}from"./validation-DCyx-ceH.js";import{t as c}from"./label-BLXfnQmn.js";import{t as l}from"./popover-Bq52EC7X.js";import{n as u,r as d,t as f}from"./field-context-4k1kI7Bo.js";import{Children as p,Fragment as m,cloneElement as h,forwardRef as g,isValidElement as _,useCallback as v,useContext as y,useId as b,useMemo as x,useState as S}from"react";import C from"tiny-invariant";import{jsx as w}from"react/jsx-runtime";import{QuestionIcon as T}from"@phosphor-icons/react/Question";const E=e=>{let t=[],n=new Set;for(let r of e??[]){if(typeof r!=`string`)continue;let e=r.trim();e.length===0||n.has(e)||(n.add(e),t.push(e))}return t},D=e=>!(e==null||typeof e==`boolean`||typeof e==`string`&&e.trim().length===0),O=({children:e,errorItemType:t})=>{let n=!1;return p.forEach(e,e=>{if(!(n||e==null||typeof e==`boolean`)){if(typeof e==`string`){e.trim().length>0&&(n=!0);return}if(!_(e)){n=!0;return}if(e.type===t){n=D(e.props.children);return}if(e.type===m){n=O({children:e.props.children,errorItemType:t});return}n=!0}}),n},k=g(({className:e,...n},r)=>w(`fieldset`,{ref:r,"data-slot":`field-set`,className:t(`flex w-full min-w-0 flex-col gap-4 border-0 p-0`,e),...n}));k.displayName=`FieldSet`;const A=g(({className:e,...n},r)=>w(`legend`,{ref:r,"data-slot":`field-legend`,className:t(`text-strong mb-1.5 text-sm font-medium font-sans`,e),...n}));A.displayName=`FieldLegend`;const j=g(({htmlFor:e,...t},n)=>{let r=y(u);return w(c,{ref:n,htmlFor:e??r?.controlId,...t})});j.displayName=`FieldLabel`;const M=g(({asChild:e,className:r,...i},a)=>w(e?n:`p`,{ref:a,"data-slot":`field-label-text`,className:t(`text-strong text-sm font-medium font-sans`,r),...i}));M.displayName=`FieldLabelText`;const N=g(({asChild:e,className:r,...i},a)=>w(e?n:`div`,{ref:a,"data-slot":`field-label-row`,className:t(`flex items-center gap-1`,r),...i}));N.displayName=`FieldLabelRow`;const P=l.Root,F=w(T,{}),I=g(({appearance:e=`ghost`,className:n,icon:i=F,label:a,size:o=`xs`,type:s=`button`,...c},u)=>w(l.Trigger,{asChild:!0,children:w(r,{ref:u,appearance:e,className:t(`text-body -my-0.5`,n),icon:i,label:a,size:o,type:s,...c})}));I.displayName=`FieldHelpTrigger`;const L=g((e,t)=>w(l.Content,{ref:t,"data-slot":`field-help-content`,...e}));L.displayName=`FieldHelpContent`;const R=g(({asChild:e,children:r,className:i,...a},o)=>w(e?n:`span`,{ref:o,"data-slot":`field-optional`,className:t(`text-muted text-sm font-normal font-sans`,i),...a,children:r??`(Optional)`}));R.displayName=`FieldOptional`;const z=g(({asChild:e,className:r,...i},a)=>w(e?n:`div`,{ref:a,"data-slot":`field-group`,className:t(`flex w-full flex-col gap-4`,r),...i}));z.displayName=`FieldGroup`;const B=g(({asChild:e,children:r,className:a,name:o,validation:c,...l},d)=>{let f=e?n:`div`,p=b(),m=b(),h=b(),[g,_]=S(!1),y=i(c??(g?`error`:void 0)),C=v(()=>(_(!0),()=>{_(!1)}),[]),T=x(()=>({controlId:p,descriptionId:m,errorId:h,hasErrors:g,name:o,registerError:C,validation:y}),[p,m,h,g,o,C,y]);return w(u.Provider,{value:T,children:w(s,{validation:y,children:w(f,{ref:d,"data-slot":`field-item`,"data-validation":y,className:t(`flex w-full flex-col gap-1.5`,a),...l,children:r})})})});B.displayName=`FieldItem`;const V=g(({children:e,...t},r)=>{let i=y(u),a=d({context:i});return typeof e==`function`?w(s,{validation:a.validation,children:w(f.Provider,{value:i?a.ariaProps:null,children:e(a.ariaProps)})}):(C(_(e),`Field.Control expects a single React element child (or a render-prop function). Got a non-element value (string, array, fragment, null, or undefined). Wrap the control in a single element, or use the function child form: <Field.Control>{(props) => <YourControl {...props} />}</Field.Control>.`),w(s,{validation:a.validation,children:w(f.Provider,{value:i?a.ariaProps:null,children:w(n,{ref:r,...t,children:h(e,a.ariaProps)})})}))});V.displayName=`FieldControl`;const H=g(({asChild:e,className:r,...i},a)=>w(e?n:`p`,{ref:a,"data-slot":`field-description`,id:y(u)?.descriptionId,className:t(`text-body text-sm leading-4`,`[:where([data-slot=field-error-list]+&)]:-mt-1.5`,r),...i}));H.displayName=`FieldDescription`;const U=g(({children:e,className:n,...r},i)=>D(e)?w(`li`,{ref:i,"data-slot":`field-error`,className:t(`text-danger-600 text-sm leading-4`,n),...r,children:e}):null);U.displayName=`FieldErrorItem`;const W=g(({messages:e,...t},n)=>w(G,{ref:n,...t,children:E(e).map(e=>w(U,{children:e},e))}));W.displayName=`FieldErrors`;const G=g(({asChild:r,children:i,className:a,...o},s)=>{let c=O({children:i,errorItemType:U}),l=y(u),d=l?.registerError;return e(()=>{if(!(!c||d==null))return d()},[c,d]),c?w(r?n:`ul`,{ref:s,"data-slot":`field-error-list`,id:l?.errorId,role:`list`,className:t(`m-0 flex w-full flex-col list-none p-0`,a),...o,children:i}):null});G.displayName=`FieldErrorList`;const K={Item:B,Control:V,Group:z,Set:k,Legend:A,Label:j,LabelText:M,LabelRow:N,Help:P,HelpTrigger:I,HelpContent:L,Optional:R,Description:H,Errors:W,ErrorList:G,ErrorItem:U},q=e=>E(e?.map(e=>typeof e==`string`||!e?e:e.message));export{K as Field,a as isAriaInvalid,o as parseValidation,i as resolveValidation,q as toErrorMessages};
package/dist/hooks.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./use-matches-media-query-CMSxHR9n.js";import{r as t}from"./browser-only-BSl_hruR.js";import{n}from"./compose-refs-Cjf2gfB8.js";import{t as r}from"./use-copy-to-clipboard-BLpquU9d.js";import{t as i}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as a,t as o}from"./use-prefers-reduced-motion-CWIoFA6W.js";import{t as s}from"./in-view-C2DpZ6s0.js";import{useCallback as c,useEffect as l,useMemo as u,useReducer as d,useRef as f,useState as p,useSyncExternalStore as m}from"react";const h=[`2xl`,`xl`,`lg`,`md`,`sm`,`xs`,`2xs`],g=[`default`,...h];function _(){return m(j,M,()=>`default`)}function v(e){return m(P(e),I(e),()=>!1)}const y={"2xl":`(min-width: 96rem)`,xl:`(min-width: 80rem)`,lg:`(min-width: 64rem)`,md:`(min-width: 48rem)`,sm:`(min-width: 40rem)`,xs:`(min-width: 30rem)`,"2xs":`(min-width: 22.5rem)`},b={"2xl":`(max-width: 95.99rem)`,xl:`(max-width: 79.99rem)`,lg:`(max-width: 63.99rem)`,md:`(max-width: 47.99rem)`,sm:`(max-width: 39.99rem)`,xs:`(max-width: 29.99rem)`,"2xs":`(max-width: 22.49rem)`};let x=null,S=null;function C(){return x||={"2xl":window.matchMedia(y[`2xl`]),xl:window.matchMedia(y.xl),lg:window.matchMedia(y.lg),md:window.matchMedia(y.md),sm:window.matchMedia(y.sm),xs:window.matchMedia(y.xs),"2xs":window.matchMedia(y[`2xs`])},x}function w(e){return S||={"2xl":window.matchMedia(b[`2xl`]),xl:window.matchMedia(b.xl),lg:window.matchMedia(b.lg),md:window.matchMedia(b.md),sm:window.matchMedia(b.sm),xs:window.matchMedia(b.xs),"2xs":window.matchMedia(b[`2xs`])},S[e]}let T=`default`;const E=new Set;let D=!1;function O(){let e=C();for(let t of h)if(e[t].matches)return t;return`default`}let k=!1;function A(){k||(k=!0,requestAnimationFrame(()=>{k=!1;let e=O();if(e!==T){T=e;for(let e of E)e()}}))}function j(e){if(E.add(e),!D){D=!0;let e=C();T=O();for(let t of Object.values(e))t.addEventListener(`change`,A)}return e(),()=>{if(E.delete(e),E.size===0&&D){D=!1;let e=C();for(let t of Object.values(e))t.removeEventListener(`change`,A)}}}function M(){return T}const N=new Map;function P(e){let t=N.get(e);return t||(t=t=>{let n=w(e),r=!1,i=()=>{r||(r=!0,requestAnimationFrame(()=>{r=!1,t()}))};return n.addEventListener(`change`,i),()=>{n.removeEventListener(`change`,i)}},N.set(e,t),t)}const F=new Map;function I(e){let t=F.get(e);return t||(t=()=>w(e).matches,F.set(e,t),t)}function L(e){let t=f(e);return l(()=>{t.current=e}),u(()=>((...e)=>t.current?.(...e)),[])}function R(e,t){let n=L(e),r=f(0);return l(()=>()=>window.clearTimeout(r.current),[]),c((...e)=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>n(...e),t.waitMs)},[n,t.waitMs])}const z=(e=`mantle`)=>u(()=>B(e),[e]);function B(e=`mantle`){return[e.trim()||`mantle`,V()].join(`-`)}function V(){return Math.random().toString(36).substring(2,9)}function H(){let e=a();return u(()=>e?`auto`:`smooth`,[e])}function U(e,{root:t,margin:n,amount:r,once:i=!1,initial:a=!1}={}){let[o,c]=p(a);return l(()=>{if(!e.current||i&&o)return;function a(){return c(!0),i?void 0:()=>c(!1)}let l={root:t&&t.current||void 0,margin:n,amount:r};return s(e.current,a,l)},[t,e,n,i,r]),o}function W(e,t){switch(t.type){case`push`:return{undoStack:[...e.undoStack,t.snapshot],redoStack:[]};case`undo`:{if(e.undoStack.length===0)return e;let n=e.undoStack.slice(0,-1);return e.undoStack[e.undoStack.length-1]===void 0?e:{undoStack:n,redoStack:[...e.redoStack,t.current]}}case`redo`:{if(e.redoStack.length===0)return e;let n=e.redoStack.slice(0,-1);return e.redoStack[e.redoStack.length-1]===void 0?e:{undoStack:[...e.undoStack,t.current],redoStack:n}}}}function G(){let[e,t]=d(W,{undoStack:[],redoStack:[]}),n=c(e=>{t({type:`push`,snapshot:e})},[]),r=c(n=>{let r=e.undoStack[e.undoStack.length-1];if(r!==void 0)return t({type:`undo`,current:n}),r},[e.undoStack]),i=c(n=>{let r=e.redoStack[e.redoStack.length-1];if(r!==void 0)return t({type:`redo`,current:n}),r},[e.redoStack]);return u(()=>({canUndo:e.undoStack.length>0,canRedo:e.redoStack.length>0,push:n,undo:r,redo:i}),[e.undoStack.length,e.redoStack.length,n,r,i])}export{g as breakpoints,o as getPrefersReducedMotion,_ as useBreakpoint,L as useCallbackRef,n as useComposedRefs,r as useCopyToClipboard,R as useDebouncedCallback,U as useInView,v as useIsBelowBreakpoint,t as useIsHydrated,i as useIsomorphicLayoutEffect,e as useMatchesMediaQuery,a as usePrefersReducedMotion,z as useRandomStableId,H as useScrollBehavior,G as useUndoRedo};
1
+ import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./use-matches-media-query-CMSxHR9n.js";import{r as n}from"./browser-only-BSl_hruR.js";import{n as r}from"./compose-refs-Cjf2gfB8.js";import{t as i}from"./use-copy-to-clipboard-BLpquU9d.js";import{n as a,t as o}from"./use-prefers-reduced-motion-CWIoFA6W.js";import{t as s}from"./in-view-C2DpZ6s0.js";import{useCallback as c,useEffect as l,useMemo as u,useReducer as d,useRef as f,useState as p,useSyncExternalStore as m}from"react";const h=[`2xl`,`xl`,`lg`,`md`,`sm`,`xs`,`2xs`],g=[`default`,...h];function _(){return m(j,M,()=>`default`)}function v(e){return m(P(e),I(e),()=>!1)}const y={"2xl":`(min-width: 96rem)`,xl:`(min-width: 80rem)`,lg:`(min-width: 64rem)`,md:`(min-width: 48rem)`,sm:`(min-width: 40rem)`,xs:`(min-width: 30rem)`,"2xs":`(min-width: 22.5rem)`},b={"2xl":`(max-width: 95.99rem)`,xl:`(max-width: 79.99rem)`,lg:`(max-width: 63.99rem)`,md:`(max-width: 47.99rem)`,sm:`(max-width: 39.99rem)`,xs:`(max-width: 29.99rem)`,"2xs":`(max-width: 22.49rem)`};let x=null,S=null;function C(){return x||={"2xl":window.matchMedia(y[`2xl`]),xl:window.matchMedia(y.xl),lg:window.matchMedia(y.lg),md:window.matchMedia(y.md),sm:window.matchMedia(y.sm),xs:window.matchMedia(y.xs),"2xs":window.matchMedia(y[`2xs`])},x}function w(e){return S||={"2xl":window.matchMedia(b[`2xl`]),xl:window.matchMedia(b.xl),lg:window.matchMedia(b.lg),md:window.matchMedia(b.md),sm:window.matchMedia(b.sm),xs:window.matchMedia(b.xs),"2xs":window.matchMedia(b[`2xs`])},S[e]}let T=`default`;const E=new Set;let D=!1;function O(){let e=C();for(let t of h)if(e[t].matches)return t;return`default`}let k=!1;function A(){k||(k=!0,requestAnimationFrame(()=>{k=!1;let e=O();if(e!==T){T=e;for(let e of E)e()}}))}function j(e){if(E.add(e),!D){D=!0;let e=C();T=O();for(let t of Object.values(e))t.addEventListener(`change`,A)}return e(),()=>{if(E.delete(e),E.size===0&&D){D=!1;let e=C();for(let t of Object.values(e))t.removeEventListener(`change`,A)}}}function M(){return T}const N=new Map;function P(e){let t=N.get(e);return t||(t=t=>{let n=w(e),r=!1,i=()=>{r||(r=!0,requestAnimationFrame(()=>{r=!1,t()}))};return n.addEventListener(`change`,i),()=>{n.removeEventListener(`change`,i)}},N.set(e,t),t)}const F=new Map;function I(e){let t=F.get(e);return t||(t=()=>w(e).matches,F.set(e,t),t)}function L(e){let t=f(e);return l(()=>{t.current=e}),u(()=>((...e)=>t.current?.(...e)),[])}function R(e,t){let n=L(e),r=f(0);return l(()=>()=>window.clearTimeout(r.current),[]),c((...e)=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>n(...e),t.waitMs)},[n,t.waitMs])}const z=(e=`mantle`)=>u(()=>B(e),[e]);function B(e=`mantle`){return[e.trim()||`mantle`,V()].join(`-`)}function V(){return Math.random().toString(36).substring(2,9)}function H(){let e=a();return u(()=>e?`auto`:`smooth`,[e])}function U(e,{root:t,margin:n,amount:r,once:i=!1,initial:a=!1}={}){let[o,c]=p(a);return l(()=>{if(!e.current||i&&o)return;function a(){return c(!0),i?void 0:()=>c(!1)}let l={root:t&&t.current||void 0,margin:n,amount:r};return s(e.current,a,l)},[t,e,n,i,r]),o}function W(e,t){switch(t.type){case`push`:return{undoStack:[...e.undoStack,t.snapshot],redoStack:[]};case`undo`:{if(e.undoStack.length===0)return e;let n=e.undoStack.slice(0,-1);return e.undoStack[e.undoStack.length-1]===void 0?e:{undoStack:n,redoStack:[...e.redoStack,t.current]}}case`redo`:{if(e.redoStack.length===0)return e;let n=e.redoStack.slice(0,-1);return e.redoStack[e.redoStack.length-1]===void 0?e:{undoStack:[...e.undoStack,t.current],redoStack:n}}}}function G(){let[e,t]=d(W,{undoStack:[],redoStack:[]}),n=c(e=>{t({type:`push`,snapshot:e})},[]),r=c(n=>{let r=e.undoStack[e.undoStack.length-1];if(r!==void 0)return t({type:`undo`,current:n}),r},[e.undoStack]),i=c(n=>{let r=e.redoStack[e.redoStack.length-1];if(r!==void 0)return t({type:`redo`,current:n}),r},[e.redoStack]);return u(()=>({canUndo:e.undoStack.length>0,canRedo:e.redoStack.length>0,push:n,undo:r,redo:i}),[e.undoStack.length,e.redoStack.length,n,r,i])}export{g as breakpoints,o as getPrefersReducedMotion,_ as useBreakpoint,L as useCallbackRef,r as useComposedRefs,i as useCopyToClipboard,R as useDebouncedCallback,U as useInView,v as useIsBelowBreakpoint,n as useIsHydrated,e as useIsomorphicLayoutEffect,t as useMatchesMediaQuery,a as usePrefersReducedMotion,z as useRandomStableId,H as useScrollBehavior,G as useUndoRedo};
@@ -6,7 +6,7 @@ import { ButtonHTMLAttributes, ReactNode } from "react";
6
6
  declare const iconButtonVariants: (props?: ({
7
7
  appearance?: "ghost" | "outlined" | null | undefined;
8
8
  isLoading?: boolean | null | undefined;
9
- size?: "md" | "xs" | "sm" | null | undefined;
9
+ size?: "xs" | "sm" | "md" | null | undefined;
10
10
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
11
11
  type IconButtonVariants = VariantProps<typeof iconButtonVariants>;
12
12
  /**
@@ -70,7 +70,7 @@ type IconButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & WithAsChild & I
70
70
  declare const IconButton: import("react").ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & WithAsChild & Partial<DeepNonNullable<import("class-variance-authority").VariantProps<(props?: ({
71
71
  appearance?: "ghost" | "outlined" | null | undefined;
72
72
  isLoading?: boolean | null | undefined;
73
- size?: "md" | "xs" | "sm" | null | undefined;
73
+ size?: "xs" | "sm" | "md" | null | undefined;
74
74
  } & import("class-variance-authority/types").ClassProp) | undefined) => string>>> & {
75
75
  /**
76
76
  * The accessible label for the icon. This label will be visually hidden but announced to screen reader users, similar to alt text for img tags.
@@ -1 +1 @@
1
- import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-SUx16Sl3.js";import{t as n}from"./booleanish-BfvnW6vy.js";import{t as r}from"./slot-DT_E5BQx.js";import{Children as i,cloneElement as a,forwardRef as o,isValidElement as s}from"react";import c from"tiny-invariant";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";import{cva as f}from"class-variance-authority";import{CircleNotchIcon as p}from"@phosphor-icons/react/CircleNotch";const m=e(`icon-button`,`inline-flex shrink-0 items-center justify-center rounded-[var(--icon-button-border-radius,0.375rem)] border`,`focus:outline-hidden focus-visible:ring-4`,`disabled:cursor-default disabled:opacity-50`,`not-disabled:active:scale-97 ease-out transition-transform duration-150`),h=f(m,{variants:{appearance:{ghost:`text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong border-transparent`,outlined:`border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong focus-visible:not-disabled:hover:border-accent-600 focus-visible:not-disabled:active:border-accent-600`},isLoading:{false:``,true:`opacity-50`},size:{xs:`size-6`,sm:`size-7`,md:`size-9`}},defaultVariants:{appearance:`outlined`,size:`md`}}),g=o(({"aria-disabled":o,appearance:f,asChild:m=!1,children:g,className:_,disabled:v,icon:y,isLoading:b=!1,label:x,size:S,type:C,...w},T)=>{let E=n(o??v??b),D=b?u(p,{className:`animate-spin`}):y,O={"aria-disabled":E,"data-slot":`icon-button`,className:e(h({appearance:f,isLoading:b,size:S}),_),"data-appearance":f,"data-disabled":E,"data-icon-button":!0,"data-loading":b,"data-size":S,disabled:E,ref:T,...w},k=d(l,{children:[u(`span`,{className:`sr-only`,children:x}),u(t,{svg:D})]});return m?(c(s(g)&&i.only(g),"When using `asChild`, IconButton must be passed a single child as a JSX tag."),u(r,{...O,children:a(g,{},k)})):u(`button`,{...O,type:C??`button`,children:k})});g.displayName=`IconButton`;export{m as n,h as r,g as t};
1
+ import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-SUx16Sl3.js";import{t as n}from"./slot-DT_E5BQx.js";import{t as r}from"./booleanish-BfvnW6vy.js";import{Children as i,cloneElement as a,forwardRef as o,isValidElement as s}from"react";import c from"tiny-invariant";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";import{cva as f}from"class-variance-authority";import{CircleNotchIcon as p}from"@phosphor-icons/react/CircleNotch";const m=e(`icon-button`,`inline-flex shrink-0 items-center justify-center rounded-[var(--icon-button-border-radius,0.375rem)] border`,`focus:outline-hidden focus-visible:ring-4`,`disabled:cursor-default disabled:opacity-50`,`not-disabled:active:scale-97 ease-out transition-transform duration-150`),h=f(m,{variants:{appearance:{ghost:`text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong border-transparent`,outlined:`border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong focus-visible:not-disabled:hover:border-accent-600 focus-visible:not-disabled:active:border-accent-600`},isLoading:{false:``,true:`opacity-50`},size:{xs:`size-6`,sm:`size-7`,md:`size-9`}},defaultVariants:{appearance:`outlined`,size:`md`}}),g=o(({"aria-disabled":o,appearance:f,asChild:m=!1,children:g,className:_,disabled:v,icon:y,isLoading:b=!1,label:x,size:S,type:C,...w},T)=>{let E=r(o??v??b),D=b?u(p,{className:`animate-spin`}):y,O={"aria-disabled":E,"data-slot":`icon-button`,className:e(h({appearance:f,isLoading:b,size:S}),_),"data-appearance":f,"data-disabled":E,"data-icon-button":!0,"data-loading":b,"data-size":S,disabled:E,ref:T,...w},k=d(l,{children:[u(`span`,{className:`sr-only`,children:x}),u(t,{svg:D})]});return m?(c(s(g)&&i.only(g),"When using `asChild`, IconButton must be passed a single child as a JSX tag."),u(n,{...O,children:a(g,{},k)})):u(`button`,{...O,type:C??`button`,children:k})});g.displayName=`IconButton`;export{m as n,h as r,g as t};
package/dist/input.d.ts CHANGED
@@ -68,7 +68,7 @@ type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "
68
68
  * />
69
69
  * ```
70
70
  */
71
- declare const Input: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "type"> & WithAutoComplete & WithInputType & WithValidation & {
71
+ declare const Input: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "autoComplete"> & WithAutoComplete & WithInputType & WithValidation & {
72
72
  children?: import("react").ReactNode | undefined;
73
73
  } & import("react").RefAttributes<HTMLInputElement>>;
74
74
  type InputCaptureProps = Omit<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "type"> & BaseProps;
@@ -86,7 +86,7 @@ type InputCaptureProps = Omit<InputHTMLAttributes<HTMLInputElement>, "autoComple
86
86
  * </Input>
87
87
  * ```
88
88
  */
89
- declare const InputCapture: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "type"> & WithAutoComplete & WithInputType & WithValidation & import("react").RefAttributes<HTMLInputElement>>;
89
+ declare const InputCapture: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "autoComplete"> & WithAutoComplete & WithInputType & WithValidation & import("react").RefAttributes<HTMLInputElement>>;
90
90
  //#endregion
91
91
  //#region src/components/input/password-input.d.ts
92
92
  type PasswordInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "type"> & WithValidation & WithAutoComplete & {
@@ -158,7 +158,7 @@ type PasswordInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "autoCompl
158
158
  * }
159
159
  * ```
160
160
  */
161
- declare const PasswordInput: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "type"> & WithValidation & WithAutoComplete & {
161
+ declare const PasswordInput: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "autoComplete"> & WithValidation & WithAutoComplete & {
162
162
  /**
163
163
  * Callback for when the visibility of the password value changes.
164
164
  */
package/dist/llms.txt CHANGED
@@ -1,4 +1,4 @@
1
- # @ngrok/mantle (0.76.6)
1
+ # @ngrok/mantle (0.76.7)
2
2
 
3
3
  > Offline discovery hint shipped inside the @ngrok/mantle npm package. Authoritative metadata lives at https://mantle.ngrok.com/for-ai-agents.
4
4
 
package/dist/otp-input.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-C1UYP5We.js";import{t}from"./types-D85fCNV3.js";import{t as n}from"./slot-DT_E5BQx.js";import{a as r,r as i}from"./validation-DCyx-ceH.js";import{t as a}from"./field-context-4k1kI7Bo.js";import{forwardRef as o,useContext as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{MinusIcon as u}from"@phosphor-icons/react/Minus";import{OTPInput as d,OTPInputContext as f,REGEXP_ONLY_CHARS as p,REGEXP_ONLY_DIGITS as m,REGEXP_ONLY_DIGITS_AND_CHARS as h}from"input-otp";const g={error:`danger`,success:`success`,warning:`warning`},_=e=>`var(--color-${e}-600)`,v=e=>`var(--ring-color-focus-${e})`,y=({totalActive:e,total:t})=>e===0?`idle`:e===1?`caret`:e===t?`all`:`range`,b=({children:e,validation:n})=>{let r=s(f),i=r.slots.length,a=y({totalActive:r.slots.reduce((e,t)=>e+ +!!t.isActive,0),total:i}),o=n?g[n]:void 0,l=o?t({"--otp-validation-border":_(o),"--otp-validation-ring":v(o)}):void 0;return c(`div`,{className:`group/otp contents`,"data-otp-state":a,"data-validation":n||void 0,style:l,children:e})},x=o(({"aria-invalid":t,children:n,className:o,containerClassName:l,validation:u,...f},p)=>{let m=r(),h=s(a),{ariaInvalid:g,validation:_}=i({"aria-invalid":t,defaultAriaInvalid:!1,validation:u??m});return c(d,{ref:p,"aria-invalid":g,"data-slot":`otp-input`,containerClassName:e(`flex items-center gap-2 has-disabled:opacity-50`,l),className:e(`disabled:cursor-not-allowed`,o),...f,...h?{"aria-describedby":h[`aria-describedby`],"aria-errormessage":h[`aria-errormessage`],id:h.id,name:h.name}:void 0,children:c(b,{validation:_,children:n})})});x.displayName=`OtpInput`;const S=o(({asChild:t,children:r,className:i,...a},o)=>c(t?n:`div`,{ref:o,"data-slot":`otp-input-group`,className:e(`relative flex items-center rounded-md`,`has-[[data-active]~[data-active]]:ring-focus-accent has-[[data-active]~[data-active]]:ring-4`,`group-data-validation/otp:has-[[data-active]~[data-active]]:ring-(--otp-validation-ring)`,i),...a,children:r}));S.displayName=`OtpInputGroup`;const C=o(({className:t,index:n,...r},i)=>{let a=s(f).slots[n],o=a?.char??null,u=a?.hasFakeCaret??!1;return l(`div`,{ref:i,"data-slot":`otp-input-slot`,"data-active":a?.isActive??!1?``:void 0,className:e(`border-form bg-form text-strong relative flex h-10 w-10 items-center justify-center border-y border-r text-sm shadow-sm outline-hidden transition-all duration-150 ease-out`,`first:rounded-l-md first:border-l last:rounded-r-md`,`[&:has(+[data-active])]:group-data-[otp-state=caret]/otp:border-r-transparent`,`data-active:group-data-[otp-state=caret]/otp:border-accent-600`,`data-active:group-data-[otp-state=caret]/otp:border-l`,`data-active:group-data-[otp-state=caret]/otp:ring-focus-accent`,`data-active:group-data-[otp-state=caret]/otp:z-20`,`data-active:group-data-[otp-state=caret]/otp:ring-4`,`group-data-[otp-state=all]/otp:border-accent-600`,`group-data-validation/otp:border-y-(--otp-validation-border)`,`group-data-validation/otp:first:border-l-(--otp-validation-border)`,`group-data-validation/otp:last:border-r-(--otp-validation-border)`,`group-data-validation/otp:data-active:group-data-[otp-state=caret]/otp:border-(--otp-validation-border)`,`group-data-validation/otp:data-active:group-data-[otp-state=caret]/otp:ring-(--otp-validation-ring)`,`group-data-validation/otp:group-data-[otp-state=all]/otp:border-(--otp-validation-border)`,t),...r,children:[o,u&&c(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:c(`div`,{className:`bg-strong h-4 w-px animate-pulse`})})]})});C.displayName=`OtpInputSlot`;const w=o(({asChild:t,children:r,className:i,semantic:a=!1,...o},s)=>{let l=t?n:`div`,d=a?{role:`separator`}:{"aria-hidden":!0,role:`none`};return c(l,{ref:s,"data-slot":`otp-input-separator`,className:e(`text-muted flex items-center`,i),...d,...o,children:r??c(u,{weight:`bold`})})});w.displayName=`OtpInputSeparator`;const T={Root:x,Group:S,Slot:C,Separator:w};export{T as OtpInput,p as REGEXP_ONLY_CHARS,m as REGEXP_ONLY_DIGITS,h as REGEXP_ONLY_DIGITS_AND_CHARS};
1
+ import{t as e}from"./cx-C1UYP5We.js";import{t}from"./slot-DT_E5BQx.js";import{t as n}from"./types-D85fCNV3.js";import{a as r,r as i}from"./validation-DCyx-ceH.js";import{t as a}from"./field-context-4k1kI7Bo.js";import{forwardRef as o,useContext as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{MinusIcon as u}from"@phosphor-icons/react/Minus";import{OTPInput as d,OTPInputContext as f,REGEXP_ONLY_CHARS as p,REGEXP_ONLY_DIGITS as m,REGEXP_ONLY_DIGITS_AND_CHARS as h}from"input-otp";const g={error:`danger`,success:`success`,warning:`warning`},_=e=>`var(--color-${e}-600)`,v=e=>`var(--ring-color-focus-${e})`,y=({totalActive:e,total:t})=>e===0?`idle`:e===1?`caret`:e===t?`all`:`range`,b=({children:e,validation:t})=>{let r=s(f),i=r.slots.length,a=y({totalActive:r.slots.reduce((e,t)=>e+ +!!t.isActive,0),total:i}),o=t?g[t]:void 0,l=o?n({"--otp-validation-border":_(o),"--otp-validation-ring":v(o)}):void 0;return c(`div`,{className:`group/otp contents`,"data-otp-state":a,"data-validation":t||void 0,style:l,children:e})},x=o(({"aria-invalid":t,children:n,className:o,containerClassName:l,validation:u,...f},p)=>{let m=r(),h=s(a),{ariaInvalid:g,validation:_}=i({"aria-invalid":t,defaultAriaInvalid:!1,validation:u??m});return c(d,{ref:p,"aria-invalid":g,"data-slot":`otp-input`,containerClassName:e(`flex items-center gap-2 has-disabled:opacity-50`,l),className:e(`disabled:cursor-not-allowed`,o),...f,...h?{"aria-describedby":h[`aria-describedby`],"aria-errormessage":h[`aria-errormessage`],id:h.id,name:h.name}:void 0,children:c(b,{validation:_,children:n})})});x.displayName=`OtpInput`;const S=o(({asChild:n,children:r,className:i,...a},o)=>c(n?t:`div`,{ref:o,"data-slot":`otp-input-group`,className:e(`relative flex items-center rounded-md`,`has-[[data-active]~[data-active]]:ring-focus-accent has-[[data-active]~[data-active]]:ring-4`,`group-data-validation/otp:has-[[data-active]~[data-active]]:ring-(--otp-validation-ring)`,i),...a,children:r}));S.displayName=`OtpInputGroup`;const C=o(({className:t,index:n,...r},i)=>{let a=s(f).slots[n],o=a?.char??null,u=a?.hasFakeCaret??!1;return l(`div`,{ref:i,"data-slot":`otp-input-slot`,"data-active":a?.isActive??!1?``:void 0,className:e(`border-form bg-form text-strong relative flex h-10 w-10 items-center justify-center border-y border-r text-sm shadow-sm outline-hidden transition-all duration-150 ease-out`,`first:rounded-l-md first:border-l last:rounded-r-md`,`[&:has(+[data-active])]:group-data-[otp-state=caret]/otp:border-r-transparent`,`data-active:group-data-[otp-state=caret]/otp:border-accent-600`,`data-active:group-data-[otp-state=caret]/otp:border-l`,`data-active:group-data-[otp-state=caret]/otp:ring-focus-accent`,`data-active:group-data-[otp-state=caret]/otp:z-20`,`data-active:group-data-[otp-state=caret]/otp:ring-4`,`group-data-[otp-state=all]/otp:border-accent-600`,`group-data-validation/otp:border-y-(--otp-validation-border)`,`group-data-validation/otp:first:border-l-(--otp-validation-border)`,`group-data-validation/otp:last:border-r-(--otp-validation-border)`,`group-data-validation/otp:data-active:group-data-[otp-state=caret]/otp:border-(--otp-validation-border)`,`group-data-validation/otp:data-active:group-data-[otp-state=caret]/otp:ring-(--otp-validation-ring)`,`group-data-validation/otp:group-data-[otp-state=all]/otp:border-(--otp-validation-border)`,t),...r,children:[o,u&&c(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:c(`div`,{className:`bg-strong h-4 w-px animate-pulse`})})]})});C.displayName=`OtpInputSlot`;const w=o(({asChild:n,children:r,className:i,semantic:a=!1,...o},s)=>{let l=n?t:`div`,d=a?{role:`separator`}:{"aria-hidden":!0,role:`none`};return c(l,{ref:s,"data-slot":`otp-input-separator`,className:e(`text-muted flex items-center`,i),...d,...o,children:r??c(u,{weight:`bold`})})});w.displayName=`OtpInputSeparator`;const T={Root:x,Group:S,Slot:C,Separator:w};export{T as OtpInput,p as REGEXP_ONLY_CHARS,m as REGEXP_ONLY_DIGITS,h as REGEXP_ONLY_DIGITS_AND_CHARS};
@@ -1 +1 @@
1
- import{t as e}from"./cx-C1UYP5We.js";import{t}from"./slot-DT_E5BQx.js";import{t as n}from"./icon-button-CbqMI7q3.js";import{t as r}from"./button-CERx95KE.js";import{n as i}from"./separator-DtufgIHt.js";import{t as a}from"./select-CvI6VKAL.js";import{createContext as o,forwardRef as s,useContext as c,useEffect as l,useMemo as u,useState as d}from"react";import f from"tiny-invariant";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{CaretLeftIcon as h}from"@phosphor-icons/react/CaretLeft";import{CaretRightIcon as g}from"@phosphor-icons/react/CaretRight";const _=o(void 0),v=s(({className:t,children:n,defaultPageSize:r,...i},a)=>{let[o,s]=d(r),c=u(()=>({defaultPageSize:r,pageSize:o,setPageSize:s}),[r,o]);return p(_.Provider,{value:c,children:p(`div`,{"data-slot":`cursor-pagination`,className:e(`inline-flex items-center justify-between gap-2`,t),ref:a,...i,children:n})})});v.displayName=`CursorPagination`;const y=s(({hasNextPage:e,hasPreviousPage:t,onNextPage:a,onPreviousPage:o,...s},c)=>m(r,{"data-slot":`cursor-pagination-buttons`,appearance:`panel`,ref:c,...s,children:[p(n,{"data-slot":`cursor-pagination-previous`,appearance:`ghost`,disabled:!t,icon:p(h,{}),label:`Previous page`,onClick:o,size:`sm`,type:`button`}),p(i,{"data-slot":`cursor-pagination-separator`,orientation:`vertical`,className:`min-h-5`}),p(n,{"data-slot":`cursor-pagination-next`,appearance:`ghost`,disabled:!e,icon:p(g,{}),label:`Next page`,onClick:a,size:`sm`,type:`button`})]}));y.displayName=`CursorButtons`;const b=[5,10,20,50,100],x=s(({className:t,pageSizes:n=b,onChangePageSize:r,...i},o)=>{let s=c(_);return f(s,`CursorPageSizeSelect must be used as a child of a CursorPagination component`),f(n.includes(s.defaultPageSize),`CursorPagination.defaultPageSize must be included in CursorPageSizeSelect.pageSizes`),f(n.includes(s.pageSize),`CursorPagination.pageSize must be included in CursorPageSizeSelect.pageSizes`),m(a.Root,{defaultValue:`${s.pageSize}`,onValueChange:e=>{let t=Number.parseInt(e,10);Number.isNaN(t)&&(t=s.defaultPageSize),s.setPageSize(t),r?.(t)},children:[p(a.Trigger,{ref:o,"data-slot":`cursor-pagination-page-size-select`,className:e(`w-auto min-w-36`,t),value:s.pageSize,...i,children:p(a.Value,{})}),p(a.Content,{width:`trigger`,children:n.map(e=>m(a.Item,{value:`${e}`,children:[e,` per page`]},e))})]})});x.displayName=`CursorPageSizeSelect`;function S({asChild:n=!1,className:r,...i}){let a=c(_);return f(a,`CursorPageSizeValue must be used as a child of a CursorPagination component`),m(n?t:`span`,{"data-slot":`cursor-pagination-page-size-value`,className:e(`text-muted text-sm font-normal`,r),...i,children:[a.pageSize,` per page`]})}S.displayName=`CursorPageSizeValue`;const C={Root:v,Buttons:y,PageSizeSelect:x,PageSizeValue:S};function w({listSize:e,pageSize:t}){let[n,r]=d(1),[i,a]=d(t);l(()=>{a(t),r(1)},[t]),l(()=>{r(1)},[e]);let o=Math.ceil(e/i),s=(n-1)*i,c=n>1,u=n<o;function f(e){r(Math.max(1,Math.min(e,o)))}function p(){u&&r(e=>Math.min(e+1,o))}function m(){c&&r(e=>Math.max(e-1,1))}function h(e){a(e),r(1)}function g(){r(o)}function _(){r(1)}return{currentPage:n,goToFirstPage:_,goToLastPage:g,goToPage:f,hasNextPage:u,hasPreviousPage:c,nextPage:p,offset:s,pageSize:i,previousPage:m,setPageSize:h,totalPages:o}}function T(e,t){return e.slice(t.offset,t.offset+t.pageSize)}export{C as CursorPagination,T as getOffsetPaginatedSlice,w as useOffsetPagination};
1
+ import{t as e}from"./cx-C1UYP5We.js";import{t}from"./slot-DT_E5BQx.js";import{t as n}from"./icon-button-DiX9iZ9n.js";import{t as r}from"./button-CERx95KE.js";import{n as i}from"./separator-DtufgIHt.js";import{t as a}from"./select-CvI6VKAL.js";import{createContext as o,forwardRef as s,useContext as c,useEffect as l,useMemo as u,useState as d}from"react";import f from"tiny-invariant";import{jsx as p,jsxs as m}from"react/jsx-runtime";import{CaretLeftIcon as h}from"@phosphor-icons/react/CaretLeft";import{CaretRightIcon as g}from"@phosphor-icons/react/CaretRight";const _=o(void 0),v=s(({className:t,children:n,defaultPageSize:r,...i},a)=>{let[o,s]=d(r),c=u(()=>({defaultPageSize:r,pageSize:o,setPageSize:s}),[r,o]);return p(_.Provider,{value:c,children:p(`div`,{"data-slot":`cursor-pagination`,className:e(`inline-flex items-center justify-between gap-2`,t),ref:a,...i,children:n})})});v.displayName=`CursorPagination`;const y=s(({hasNextPage:e,hasPreviousPage:t,onNextPage:a,onPreviousPage:o,...s},c)=>m(r,{"data-slot":`cursor-pagination-buttons`,appearance:`panel`,ref:c,...s,children:[p(n,{"data-slot":`cursor-pagination-previous`,appearance:`ghost`,disabled:!t,icon:p(h,{}),label:`Previous page`,onClick:o,size:`sm`,type:`button`}),p(i,{"data-slot":`cursor-pagination-separator`,orientation:`vertical`,className:`min-h-5`}),p(n,{"data-slot":`cursor-pagination-next`,appearance:`ghost`,disabled:!e,icon:p(g,{}),label:`Next page`,onClick:a,size:`sm`,type:`button`})]}));y.displayName=`CursorButtons`;const b=[5,10,20,50,100],x=s(({className:t,pageSizes:n=b,onChangePageSize:r,...i},o)=>{let s=c(_);return f(s,`CursorPageSizeSelect must be used as a child of a CursorPagination component`),f(n.includes(s.defaultPageSize),`CursorPagination.defaultPageSize must be included in CursorPageSizeSelect.pageSizes`),f(n.includes(s.pageSize),`CursorPagination.pageSize must be included in CursorPageSizeSelect.pageSizes`),m(a.Root,{defaultValue:`${s.pageSize}`,onValueChange:e=>{let t=Number.parseInt(e,10);Number.isNaN(t)&&(t=s.defaultPageSize),s.setPageSize(t),r?.(t)},children:[p(a.Trigger,{ref:o,"data-slot":`cursor-pagination-page-size-select`,className:e(`w-auto min-w-36`,t),value:s.pageSize,...i,children:p(a.Value,{})}),p(a.Content,{width:`trigger`,children:n.map(e=>m(a.Item,{value:`${e}`,children:[e,` per page`]},e))})]})});x.displayName=`CursorPageSizeSelect`;function S({asChild:n=!1,className:r,...i}){let a=c(_);return f(a,`CursorPageSizeValue must be used as a child of a CursorPagination component`),m(n?t:`span`,{"data-slot":`cursor-pagination-page-size-value`,className:e(`text-muted text-sm font-normal`,r),...i,children:[a.pageSize,` per page`]})}S.displayName=`CursorPageSizeValue`;const C={Root:v,Buttons:y,PageSizeSelect:x,PageSizeValue:S};function w({listSize:e,pageSize:t}){let[n,r]=d(1),[i,a]=d(t);l(()=>{a(t),r(1)},[t]),l(()=>{r(1)},[e]);let o=Math.ceil(e/i),s=(n-1)*i,c=n>1,u=n<o;function f(e){r(Math.max(1,Math.min(e,o)))}function p(){u&&r(e=>Math.min(e+1,o))}function m(){c&&r(e=>Math.max(e-1,1))}function h(e){a(e),r(1)}function g(){r(o)}function _(){r(1)}return{currentPage:n,goToFirstPage:_,goToLastPage:g,goToPage:f,hasNextPage:u,hasPreviousPage:c,nextPage:p,offset:s,pageSize:i,previousPage:m,setPageSize:h,totalPages:o}}function T(e,t){return e.slice(t.offset,t.offset+t.pageSize)}export{C as CursorPagination,T as getOffsetPaginatedSlice,w as useOffsetPagination};
@@ -1 +1 @@
1
- import{t as e}from"./booleanish-BfvnW6vy.js";import{t}from"./slot-DT_E5BQx.js";import{i as n}from"./toast-Bwno5LUs.js";import{createContext as r,forwardRef as i,useContext as a,useEffect as o,useMemo as s,useState as c}from"react";import{jsx as l}from"react/jsx-runtime";import*as u from"@radix-ui/react-dialog";const d=r({hasDescription:!1,setHasDescription:()=>{}});function f(e){let[t,n]=c(!1),r=s(()=>({hasDescription:t,setHasDescription:n}),[t]);return l(d.Provider,{value:r,children:l(u.Root,{...e})})}f.displayName=`DialogPrimitiveRoot`;const p=u.Trigger;p.displayName=`DialogPrimitiveTrigger`;const m=u.Portal;m.displayName=`DialogPrimitivePortal`;const h=u.Close;h.displayName=`DialogPrimitiveClose`;const g=i((e,t)=>l(u.Overlay,{"data-overlay":!0,ref:t,...e}));g.displayName=`DialogPrimitiveOverlay`;const _=i(({onEscapeKeyDown:e,onInteractOutside:t,onPointerDownOutside:r,...i},o)=>{let s=a(d);return l(u.Content,{ref:o,onEscapeKeyDown:t=>{x(t),e?.(t)},onInteractOutside:e=>{n(e),t?.(e)},onPointerDownOutside:e=>{n(e),r?.(e)},...s.hasDescription?{}:{"aria-describedby":void 0},...i})});_.displayName=`DialogPrimitiveContent`;const v=u.Title,y=i(({asChild:e,children:n,...r},i)=>{let s=a(d);o(()=>(s.setHasDescription(!0),()=>s.setHasDescription(!1)),[s]);let c=e?t:`div`;return l(u.Description,{ref:i,asChild:!0,children:l(c,{...r,children:n})})});y.displayName=`DialogPrimitiveDescription`;function b(e){return e instanceof HTMLElement?e.hasAttribute(`data-overlay`):!1}function x(t){if(!T(t.currentTarget))return;let n=t.currentTarget,r=n instanceof Document?n.activeElement:n.ownerDocument?.activeElement??null,i=S(t.target)??S(r),a=i?C(i):null;i!=null&&e(i.getAttribute(`aria-expanded`))&&a!=null&&n.contains(i)&&n.contains(a)&&(a.getAttribute(`data-open`)===`true`||a.getAttribute(`data-state`)===`open`)&&t.preventDefault()}function S(e){return w(e)?e.closest(`[aria-expanded='true'][aria-controls]`):null}function C(e){let t=e.getAttribute(`aria-controls`);if(!t)return null;let n=e.ownerDocument.getElementById(t);return n instanceof HTMLElement?n:null}function w(e){return e instanceof HTMLElement}function T(e){return e instanceof Node&&`querySelector`in e}export{m as a,p as c,g as i,b as l,_ as n,f as o,y as r,v as s,h as t};
1
+ import{t as e}from"./slot-DT_E5BQx.js";import{t}from"./booleanish-BfvnW6vy.js";import{i as n}from"./toast-Bwno5LUs.js";import{createContext as r,forwardRef as i,useContext as a,useEffect as o,useMemo as s,useState as c}from"react";import{jsx as l}from"react/jsx-runtime";import*as u from"@radix-ui/react-dialog";const d=r({hasDescription:!1,setHasDescription:()=>{}});function f(e){let[t,n]=c(!1),r=s(()=>({hasDescription:t,setHasDescription:n}),[t]);return l(d.Provider,{value:r,children:l(u.Root,{...e})})}f.displayName=`DialogPrimitiveRoot`;const p=u.Trigger;p.displayName=`DialogPrimitiveTrigger`;const m=u.Portal;m.displayName=`DialogPrimitivePortal`;const h=u.Close;h.displayName=`DialogPrimitiveClose`;const g=i((e,t)=>l(u.Overlay,{"data-overlay":!0,ref:t,...e}));g.displayName=`DialogPrimitiveOverlay`;const _=i(({onEscapeKeyDown:e,onInteractOutside:t,onPointerDownOutside:r,...i},o)=>{let s=a(d);return l(u.Content,{ref:o,onEscapeKeyDown:t=>{x(t),e?.(t)},onInteractOutside:e=>{n(e),t?.(e)},onPointerDownOutside:e=>{n(e),r?.(e)},...s.hasDescription?{}:{"aria-describedby":void 0},...i})});_.displayName=`DialogPrimitiveContent`;const v=u.Title,y=i(({asChild:t,children:n,...r},i)=>{let s=a(d);o(()=>(s.setHasDescription(!0),()=>s.setHasDescription(!1)),[s]);let c=t?e:`div`;return l(u.Description,{ref:i,asChild:!0,children:l(c,{...r,children:n})})});y.displayName=`DialogPrimitiveDescription`;function b(e){return e instanceof HTMLElement?e.hasAttribute(`data-overlay`):!1}function x(e){if(!T(e.currentTarget))return;let n=e.currentTarget,r=n instanceof Document?n.activeElement:n.ownerDocument?.activeElement??null,i=S(e.target)??S(r),a=i?C(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 S(e){return w(e)?e.closest(`[aria-expanded='true'][aria-controls]`):null}function C(e){let t=e.getAttribute(`aria-controls`);if(!t)return null;let n=e.ownerDocument.getElementById(t);return n instanceof HTMLElement?n:null}function w(e){return e instanceof HTMLElement}function T(e){return e instanceof Node&&`querySelector`in e}export{m as a,p as c,g as i,b as l,_ as n,f as o,y as r,v as s,h as t};
package/dist/sheet.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as Root } from "./primitive-FoWela9a.js";
2
- import { n as IconButtonProps } from "./icon-button-BPvRuor6.js";
2
+ import { n as IconButtonProps } from "./icon-button-D7hs6bX2.js";
3
3
  import { HTMLAttributes } from "react";
4
4
  import { VariantProps } from "class-variance-authority";
5
5
 
package/dist/sheet.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-button-CbqMI7q3.js";import{a as n,c as r,i,n as a,o,r as s,s as c,t as l}from"./primitive-BEuiJONo.js";import{forwardRef as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{XIcon as p}from"@phosphor-icons/react/X";import{cva as m}from"class-variance-authority";const h=o;h.displayName=`Sheet`;const g=r;g.displayName=`SheetTrigger`;const _=l;_.displayName=`SheetClose`;const v=n;v.displayName=`SheetPortal`;const y=u(({className:t,...n},r)=>d(i,{"data-slot":`sheet-overlay`,className:e(`bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-40 backdrop-blur-xs`,t),...n,ref:r}));y.displayName=i.displayName;const b=m(`bg-dialog border-dialog inset-y-0 h-full w-full fixed z-40 flex flex-col shadow-lg outline-hidden transition ease-in-out focus-within:outline-hidden data-state-closed:duration-100 data-state-closed:animate-out data-state-open:duration-100 data-state-open:animate-in`,{variants:{side:{left:`data-state-closed:slide-out-to-left data-state-open:slide-in-from-left left-0 border-r`,right:`data-state-closed:slide-out-to-right data-state-open:slide-in-from-right right-0 border-l`}},defaultVariants:{side:`right`}}),x=u(({children:t,className:n,preferredWidth:r=`sm:max-w-[30rem]`,side:i=`right`,...o},s)=>f(v,{children:[d(y,{}),d(a,{"data-slot":`sheet-content`,"data-mantle-modal-content":!0,className:e(b({side:i}),r,n),ref:s,...o,children:t})]}));x.displayName=a.displayName;const S=({size:e=`md`,type:n=`button`,label:r=`Close Sheet`,appearance:i=`ghost`,...a})=>d(l,{asChild:!0,children:d(t,{"data-slot":`sheet-close-icon-button`,appearance:i,icon:d(p,{}),label:r,size:e,type:n,...a})});S.displayName=`SheetCloseIconButton`;const C=({className:t,...n})=>d(`div`,{"data-slot":`sheet-body`,className:e(`scrollbar scrollbar-gutter-stable text-body flex-1 overflow-y-auto p-6`,t),...n});C.displayName=`SheetBody`;const w=({className:t,...n})=>d(`div`,{"data-slot":`sheet-header`,className:e(`border-dialog-muted flex shrink-0 flex-col gap-2 border-b py-4 pl-6 pr-4`,`has-[.icon-button]:pr-4`,t),...n});w.displayName=`SheetHeader`;const T=({className:t,...n})=>d(`div`,{"data-slot":`sheet-footer`,className:e(`border-dialog-muted flex shrink-0 justify-end gap-2 border-t px-6 py-2.5`,t),...n});T.displayName=`SheetFooter`;const E=u(({className:t,...n},r)=>d(c,{"data-slot":`sheet-title`,ref:r,className:e(`text-strong flex-1 truncate text-lg font-medium`,t),...n}));E.displayName=c.displayName;const D=u(({children:t,className:n,...r},i)=>d(`div`,{"data-slot":`sheet-title-group`,className:e(`flex items-center justify-between gap-2`,n),...r,ref:i,children:t}));D.displayName=`SheetTitleGroup`;const O=u(({className:t,...n},r)=>d(s,{"data-slot":`sheet-description`,ref:r,className:e(`text-body text-sm`,t),...n}));O.displayName=s.displayName;const k=u(({children:t,className:n,...r},i)=>d(`div`,{"data-slot":`sheet-actions`,className:e(`flex h-full items-center gap-2`,n),...r,ref:i,children:t}));k.displayName=`SheetActions`;const A={Root:h,Actions:k,Body:C,Close:_,CloseIconButton:S,Content:x,Description:O,Footer:T,Header:w,Title:E,TitleGroup:D,Trigger:g};export{A as Sheet};
1
+ import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-button-DiX9iZ9n.js";import{a as n,c as r,i,n as a,o,r as s,s as c,t as l}from"./primitive-BFUir4UB.js";import{forwardRef as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{XIcon as p}from"@phosphor-icons/react/X";import{cva as m}from"class-variance-authority";const h=o;h.displayName=`Sheet`;const g=r;g.displayName=`SheetTrigger`;const _=l;_.displayName=`SheetClose`;const v=n;v.displayName=`SheetPortal`;const y=u(({className:t,...n},r)=>d(i,{"data-slot":`sheet-overlay`,className:e(`bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 fixed inset-0 z-40 backdrop-blur-xs`,t),...n,ref:r}));y.displayName=i.displayName;const b=m(`bg-dialog border-dialog inset-y-0 h-full w-full fixed z-40 flex flex-col shadow-lg outline-hidden transition ease-in-out focus-within:outline-hidden data-state-closed:duration-100 data-state-closed:animate-out data-state-open:duration-100 data-state-open:animate-in`,{variants:{side:{left:`data-state-closed:slide-out-to-left data-state-open:slide-in-from-left left-0 border-r`,right:`data-state-closed:slide-out-to-right data-state-open:slide-in-from-right right-0 border-l`}},defaultVariants:{side:`right`}}),x=u(({children:t,className:n,preferredWidth:r=`sm:max-w-[30rem]`,side:i=`right`,...o},s)=>f(v,{children:[d(y,{}),d(a,{"data-slot":`sheet-content`,"data-mantle-modal-content":!0,className:e(b({side:i}),r,n),ref:s,...o,children:t})]}));x.displayName=a.displayName;const S=({size:e=`md`,type:n=`button`,label:r=`Close Sheet`,appearance:i=`ghost`,...a})=>d(l,{asChild:!0,children:d(t,{"data-slot":`sheet-close-icon-button`,appearance:i,icon:d(p,{}),label:r,size:e,type:n,...a})});S.displayName=`SheetCloseIconButton`;const C=({className:t,...n})=>d(`div`,{"data-slot":`sheet-body`,className:e(`scrollbar scrollbar-gutter-stable text-body flex-1 overflow-y-auto p-6`,t),...n});C.displayName=`SheetBody`;const w=({className:t,...n})=>d(`div`,{"data-slot":`sheet-header`,className:e(`border-dialog-muted flex shrink-0 flex-col gap-2 border-b py-4 pl-6 pr-4`,`has-[.icon-button]:pr-4`,t),...n});w.displayName=`SheetHeader`;const T=({className:t,...n})=>d(`div`,{"data-slot":`sheet-footer`,className:e(`border-dialog-muted flex shrink-0 justify-end gap-2 border-t px-6 py-2.5`,t),...n});T.displayName=`SheetFooter`;const E=u(({className:t,...n},r)=>d(c,{"data-slot":`sheet-title`,ref:r,className:e(`text-strong flex-1 truncate text-lg font-medium`,t),...n}));E.displayName=c.displayName;const D=u(({children:t,className:n,...r},i)=>d(`div`,{"data-slot":`sheet-title-group`,className:e(`flex items-center justify-between gap-2`,n),...r,ref:i,children:t}));D.displayName=`SheetTitleGroup`;const O=u(({className:t,...n},r)=>d(s,{"data-slot":`sheet-description`,ref:r,className:e(`text-body text-sm`,t),...n}));O.displayName=s.displayName;const k=u(({children:t,className:n,...r},i)=>d(`div`,{"data-slot":`sheet-actions`,className:e(`flex h-full items-center gap-2`,n),...r,ref:i,children:t}));k.displayName=`SheetActions`;const A={Root:h,Actions:k,Body:C,Close:_,CloseIconButton:S,Content:x,Description:O,Footer:T,Header:w,Title:E,TitleGroup:D,Trigger:g};export{A as Sheet};
@@ -1,5 +1,5 @@
1
- import { t as Button } from "./button-mfYak6Rx.js";
2
- import { t as IconButton } from "./icon-button-BPvRuor6.js";
1
+ import { t as Button } from "./button-D9kqQuu9.js";
2
+ import { t as IconButton } from "./icon-button-D7hs6bX2.js";
3
3
  import { t as DropdownMenu } from "./dropdown-menu-BqdyTFLu.js";
4
4
  import { ComponentProps, ReactNode } from "react";
5
5
 
@@ -1 +1 @@
1
- import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-SUx16Sl3.js";import{t as n}from"./icon-button-CbqMI7q3.js";import{t as r}from"./button-BK8Thu3k.js";import{t as i}from"./dropdown-menu-Dj8qPMRh.js";import{CaretDownIcon as a}from"@phosphor-icons/react/CaretDown";import{forwardRef as o}from"react";import{jsx as s}from"react/jsx-runtime";const c=o(({className:t,children:n,dir:r,open:a,defaultOpen:o,onOpenChange:c,modal:l,...u},d)=>s(i.Root,{dir:r,open:a,defaultOpen:o,onOpenChange:c,modal:l,children:s(`div`,{"data-slot":`split-button`,className:e(`flex flex-row [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:not(:first-child)]:-ml-px [&>*:focus]:relative [&>*:focus]:z-10 [&>*:hover]:relative [&>*:hover]:z-10 *:active:scale-100!`,t),ref:d,...u,children:n})}));c.displayName=`SplitButton`;const l=o((e,t)=>s(r,{appearance:`outlined`,priority:`neutral`,ref:t,...e}));l.displayName=`SplitButtonPrimaryAction`;const u=o(({icon:e,...r},o)=>s(i.Trigger,{asChild:!0,className:`group`,children:s(n,{icon:e??s(t,{svg:s(a,{weight:`bold`,className:`size-4 group-data-[state=open]:-rotate-180 transition-transform ease-out duration-150`})}),appearance:`outlined`,ref:o,...r})}));u.displayName=`SplitButtonMenuTrigger`;const d=o(({align:e=`end`,...t},n)=>s(i.Content,{align:e,ref:n,...t}));d.displayName=`SplitButtonMenuContent`;const f=o(({className:t,...n},r)=>s(i.Item,{className:e(`gap-2`,t),ref:r,...n}));f.displayName=`SplitButtonMenuItem`;const p={Root:c,PrimaryAction:l,MenuTrigger:u,MenuContent:d,MenuItem:f};export{p as SplitButton};
1
+ import{t as e}from"./cx-C1UYP5We.js";import{t}from"./icon-SUx16Sl3.js";import{t as n}from"./icon-button-DiX9iZ9n.js";import{t as r}from"./button-C9GW9nAr.js";import{t as i}from"./dropdown-menu-Dj8qPMRh.js";import{CaretDownIcon as a}from"@phosphor-icons/react/CaretDown";import{forwardRef as o}from"react";import{jsx as s}from"react/jsx-runtime";const c=o(({className:t,children:n,dir:r,open:a,defaultOpen:o,onOpenChange:c,modal:l,...u},d)=>s(i.Root,{dir:r,open:a,defaultOpen:o,onOpenChange:c,modal:l,children:s(`div`,{"data-slot":`split-button`,className:e(`flex flex-row [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:not(:first-child)]:-ml-px [&>*:focus]:relative [&>*:focus]:z-10 [&>*:hover]:relative [&>*:hover]:z-10 *:active:scale-100!`,t),ref:d,...u,children:n})}));c.displayName=`SplitButton`;const l=o((e,t)=>s(r,{appearance:`outlined`,priority:`neutral`,ref:t,...e}));l.displayName=`SplitButtonPrimaryAction`;const u=o(({icon:e,...r},o)=>s(i.Trigger,{asChild:!0,className:`group`,children:s(n,{icon:e??s(t,{svg:s(a,{weight:`bold`,className:`size-4 group-data-[state=open]:-rotate-180 transition-transform ease-out duration-150`})}),appearance:`outlined`,ref:o,...r})}));u.displayName=`SplitButtonMenuTrigger`;const d=o(({align:e=`end`,...t},n)=>s(i.Content,{align:e,ref:n,...t}));d.displayName=`SplitButtonMenuContent`;const f=o(({className:t,...n},r)=>s(i.Item,{className:e(`gap-2`,t),ref:r,...n}));f.displayName=`SplitButtonMenuItem`;const p={Root:c,PrimaryAction:l,MenuTrigger:u,MenuContent:d,MenuItem:f};export{p as SplitButton};
package/dist/theme.d.ts CHANGED
@@ -201,14 +201,14 @@ declare function useTheme(): ThemeProviderState;
201
201
  * Read the theme and applied theme from the `<html>` element.
202
202
  */
203
203
  declare function readThemeFromHtmlElement(): {
204
- appliedTheme: "dark" | "light" | "light-high-contrast" | "dark-high-contrast" | undefined;
205
- theme: "dark" | "light" | "system" | "light-high-contrast" | "dark-high-contrast" | undefined;
204
+ appliedTheme: "light" | "dark" | "light-high-contrast" | "dark-high-contrast" | undefined;
205
+ theme: "system" | "light" | "dark" | "light-high-contrast" | "dark-high-contrast" | undefined;
206
206
  };
207
207
  /**
208
208
  * If the theme is "system", it will resolve the theme based on the user's media query preferences, otherwise it will return the theme as is.
209
209
  * This will mirror the result that gets applied to the <html> element.
210
210
  */
211
- declare function useAppliedTheme(): "dark" | "light" | "light-high-contrast" | "dark-high-contrast";
211
+ declare function useAppliedTheme(): "light" | "dark" | "light-high-contrast" | "dark-high-contrast";
212
212
  /**
213
213
  * determineThemeFromMediaQuery returns the theme that should be used based on the user's media query preferences.
214
214
  * @private
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngrok/mantle",
3
- "version": "0.76.6",
3
+ "version": "0.76.7",
4
4
  "description": "mantle is ngrok's UI library and design system.",
5
5
  "homepage": "https://mantle.ngrok.com",
6
6
  "license": "MIT",
@@ -349,7 +349,6 @@
349
349
  "dependencies": {
350
350
  "@ariakit/react": "0.4.29",
351
351
  "@headlessui/react": "2.2.10",
352
- "@radix-ui/react-accordion": "1.2.14",
353
352
  "@radix-ui/react-dialog": "1.1.17",
354
353
  "@radix-ui/react-dropdown-menu": "2.1.18",
355
354
  "@radix-ui/react-hover-card": "1.1.17",