@ngrok/mantle 0.77.0 → 0.79.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/dist/accordion.d.ts +63 -21
  2. package/dist/accordion.js +1 -1
  3. package/dist/agent.json +4 -1
  4. package/dist/alert-dialog.d.ts +102 -70
  5. package/dist/alert-dialog.js +1 -1
  6. package/dist/alert.d.ts +39 -39
  7. package/dist/alert.js +1 -1
  8. package/dist/{anchor-BtgEJoPN.js → anchor-C_tjSVy6.js} +1 -1
  9. package/dist/anchor.d.ts +3 -4
  10. package/dist/anchor.js +1 -1
  11. package/dist/{as-child-uN_018tj.d.ts → as-child-CYEVu1WY.d.ts} +0 -7
  12. package/dist/badge.d.ts +5 -56
  13. package/dist/badge.js +1 -1
  14. package/dist/breadcrumb.d.ts +212 -0
  15. package/dist/breadcrumb.js +1 -0
  16. package/dist/browser-only.d.ts +2 -6
  17. package/dist/{button-CERx95KE.js → button-5t6-JS_I.js} +1 -1
  18. package/dist/button-ClC60Nzg.js +1 -0
  19. package/dist/button-DcXOWUYo.d.ts +131 -0
  20. package/dist/button.d.ts +6 -4
  21. package/dist/button.js +1 -1
  22. package/dist/calendar.d.ts +2 -8
  23. package/dist/calendar.js +1 -1
  24. package/dist/card.d.ts +8 -8
  25. package/dist/card.js +1 -1
  26. package/dist/centered-layout.d.ts +147 -0
  27. package/dist/centered-layout.js +1 -0
  28. package/dist/checkbox-DJ2xl7Rc.js +1 -0
  29. package/dist/checkbox.d.ts +9 -11
  30. package/dist/checkbox.js +1 -1
  31. package/dist/{choice-D6S38dPs.js → choice-DOdyNzFC.js} +1 -1
  32. package/dist/choice.d.ts +16 -14
  33. package/dist/choice.js +1 -1
  34. package/dist/code-block.d.ts +5 -17
  35. package/dist/code-block.js +1 -1
  36. package/dist/code-block_highlight-utils.d.ts +1 -1
  37. package/dist/code-block_highlight-utils.js +1 -1
  38. package/dist/code.d.ts +4 -5
  39. package/dist/code.js +1 -1
  40. package/dist/combobox.d.ts +40 -19
  41. package/dist/combobox.js +1 -1
  42. package/dist/command.d.ts +71 -49
  43. package/dist/command.js +1 -1
  44. package/dist/cx-IiQEAKf5.js +1 -0
  45. package/dist/cx.js +1 -1
  46. package/dist/data-slot-CChfb_cv.d.ts +17 -0
  47. package/dist/data-table.d.ts +77 -137
  48. package/dist/data-table.js +1 -1
  49. package/dist/description-list.d.ts +7 -7
  50. package/dist/description-list.js +1 -1
  51. package/dist/{dialog-uyJcNks7.js → dialog-ZCgG41hx.js} +1 -1
  52. package/dist/dialog.d.ts +213 -88
  53. package/dist/dialog.js +1 -1
  54. package/dist/{direction-CcTY0FmA.d.ts → direction-BjU0bPST.d.ts} +1 -1
  55. package/dist/{dropdown-menu-OEuW4GLp.js → dropdown-menu-ByUQkAvJ.js} +1 -1
  56. package/dist/{dropdown-menu-CADgs9gz.d.ts → dropdown-menu-DMNw8ItM.d.ts} +26 -27
  57. package/dist/dropdown-menu.d.ts +2 -1
  58. package/dist/dropdown-menu.js +1 -1
  59. package/dist/empty.d.ts +139 -59
  60. package/dist/empty.js +1 -1
  61. package/dist/{field-context-4k1kI7Bo.js → field-context-BR01g789.js} +1 -1
  62. package/dist/field.d.ts +41 -36
  63. package/dist/field.js +1 -1
  64. package/dist/flag.d.ts +2 -9
  65. package/dist/flag.js +1 -1
  66. package/dist/hooks.d.ts +13 -15
  67. package/dist/hooks.js +1 -1
  68. package/dist/hover-card.d.ts +42 -20
  69. package/dist/hover-card.js +1 -1
  70. package/dist/icon-CDtYjF_H.js +1 -0
  71. package/dist/{icon-n49kOh4_.d.ts → icon-Cevjo93X.d.ts} +2 -3
  72. package/dist/{icon-button-D7hs6bX2.d.ts → icon-button-B7uEj1qq.d.ts} +73 -11
  73. package/dist/icon-button-DV2-GZHf.js +1 -0
  74. package/dist/icon.d.ts +3 -3
  75. package/dist/icon.js +1 -1
  76. package/dist/icons.d.ts +7 -19
  77. package/dist/icons.js +1 -1
  78. package/dist/{in-view-bItE1fkG.d.ts → in-view-nkSOdED2.d.ts} +1 -6
  79. package/dist/{index-CTU6apE6.d.ts → index-BivvYYs-.d.ts} +8 -7
  80. package/dist/{index-Bed_XLWa.d.ts → index-D47aqlpz.d.ts} +3 -2
  81. package/dist/index-DZRbVkZa.d.ts +1 -0
  82. package/dist/index-Rv8RL7xy.d.ts +25 -0
  83. package/dist/{input-B3TS9yAP.js → input-Ct1YOqSy.js} +1 -1
  84. package/dist/input.d.ts +10 -11
  85. package/dist/input.js +1 -1
  86. package/dist/intents-DdSKSj1c.d.ts +28 -0
  87. package/dist/{kbd-D6k4Dnrf.js → kbd-K8iaZ-Ti.js} +1 -1
  88. package/dist/kbd.d.ts +3 -8
  89. package/dist/kbd.js +1 -1
  90. package/dist/{label-BLXfnQmn.js → label-BMlHW_2D.js} +1 -1
  91. package/dist/{label-PY0qM0G5.d.ts → label-v2-bv98k.d.ts} +1 -1
  92. package/dist/label.d.ts +1 -1
  93. package/dist/label.js +1 -1
  94. package/dist/list.d.ts +18 -60
  95. package/dist/list.js +1 -1
  96. package/dist/llms.txt +4 -1
  97. package/dist/main.d.ts +4 -27
  98. package/dist/main.js +1 -1
  99. package/dist/mantle.css +6 -6
  100. package/dist/media-object.d.ts +6 -7
  101. package/dist/media-object.js +1 -1
  102. package/dist/multi-select.d.ts +80 -33
  103. package/dist/multi-select.js +1 -1
  104. package/dist/otp-input.d.ts +7 -8
  105. package/dist/otp-input.js +1 -1
  106. package/dist/pagination.d.ts +11 -22
  107. package/dist/pagination.js +1 -1
  108. package/dist/{popover-Bq52EC7X.js → popover-D5WxxnBY.js} +1 -1
  109. package/dist/popover.d.ts +17 -18
  110. package/dist/popover.js +1 -1
  111. package/dist/{primitive-FoWela9a.d.ts → primitive-C64-m48O.d.ts} +0 -1
  112. package/dist/{primitive-BuVqb6zf.js → primitive-M-kZdNIS.js} +1 -1
  113. package/dist/progress.d.ts +55 -46
  114. package/dist/progress.js +1 -1
  115. package/dist/qr-code.d.ts +10 -9
  116. package/dist/qr-code.js +1 -1
  117. package/dist/radio-group.d.ts +71 -60
  118. package/dist/radio-group.js +1 -1
  119. package/dist/{resolve-pre-rendered-props-DxJ9-DAl.d.ts → resolve-pre-rendered-props-B6OlZrSI.d.ts} +13 -26
  120. package/dist/{resolve-pre-rendered-props-DwIF_M_K.js → resolve-pre-rendered-props-C3e5Auo3.js} +1 -1
  121. package/dist/sandboxed-on-click.d.ts +4 -8
  122. package/dist/sandboxed-on-click.js +1 -1
  123. package/dist/{select-BUGOJMER.d.ts → select-Bwt2YduR.d.ts} +11 -12
  124. package/dist/{select-Bxq_N-_o.js → select-D-5u0Blc.js} +1 -1
  125. package/dist/select.d.ts +1 -1
  126. package/dist/select.js +1 -1
  127. package/dist/selectable-list.d.ts +160 -146
  128. package/dist/selectable-list.js +1 -1
  129. package/dist/{separator-CqohKk4z.js → separator-kBnnv3Cw.js} +1 -1
  130. package/dist/separator.d.ts +6 -37
  131. package/dist/separator.js +1 -1
  132. package/dist/sheet.d.ts +302 -89
  133. package/dist/sheet.js +1 -1
  134. package/dist/sizes-BCoI4bhP.d.ts +29 -0
  135. package/dist/skeleton-Bu3tgNcW.js +1 -0
  136. package/dist/skeleton.d.ts +2 -2
  137. package/dist/skeleton.js +1 -1
  138. package/dist/skip-to-main-link.d.ts +4 -34
  139. package/dist/skip-to-main-link.js +1 -1
  140. package/dist/slider.d.ts +2 -21
  141. package/dist/slider.js +1 -1
  142. package/dist/slot-DmPrjM7N.js +1 -0
  143. package/dist/slot.d.ts +1 -1
  144. package/dist/slot.js +1 -1
  145. package/dist/split-button.d.ts +21 -13
  146. package/dist/split-button.js +1 -1
  147. package/dist/{svg-only-f6ToFLH0.d.ts → svg-only-BFeFS1aa.d.ts} +2 -3
  148. package/dist/{svg-only-CSOaF1tL.js → svg-only-DDx6FtJd.js} +1 -1
  149. package/dist/switch.d.ts +4 -5
  150. package/dist/switch.js +1 -1
  151. package/dist/{table-CAitdL78.js → table-CPH2md2-.js} +1 -1
  152. package/dist/{table-BWD9IlIN.d.ts → table-CwFHXC-G.d.ts} +10 -10
  153. package/dist/table.d.ts +1 -1
  154. package/dist/table.js +1 -1
  155. package/dist/tabs.d.ts +29 -15
  156. package/dist/tabs.js +1 -1
  157. package/dist/text-area.d.ts +2 -3
  158. package/dist/text-area.js +1 -1
  159. package/dist/theme-D8kZCOzM.js +1 -0
  160. package/dist/theme-provider-Djj_jBo6.js +1 -0
  161. package/dist/theme-switcher.d.ts +53 -0
  162. package/dist/theme-switcher.js +1 -0
  163. package/dist/theme.d.ts +15 -101
  164. package/dist/theme.js +1 -1
  165. package/dist/toast-D3ntBmn4.js +1 -0
  166. package/dist/toast.d.ts +32 -50
  167. package/dist/toast.js +1 -1
  168. package/dist/tooltip.d.ts +16 -50
  169. package/dist/tooltip.js +1 -1
  170. package/dist/{types-CTam1uIW.d.ts → types-C19IR7jf.d.ts} +1 -0
  171. package/dist/{types-BvUzforF.d.ts → types-D1RY5Tcj.d.ts} +0 -1
  172. package/dist/types.d.ts +3 -3
  173. package/dist/use-prefers-reduced-motion-CagaNRgm.js +1 -0
  174. package/dist/utils.d.ts +2 -3
  175. package/dist/{validation-xyX_6kph.d.ts → validation-7QeiTFwl.d.ts} +3 -12
  176. package/dist/{validation-DCyx-ceH.js → validation-Bpptk_9t.js} +1 -1
  177. package/dist/{virtual-PBNiHjMK.js → virtual-DZMBu7Ch.js} +1 -1
  178. package/dist/well.d.ts +3 -3
  179. package/dist/well.js +1 -1
  180. package/dist/{with-style-props-CyImx7vd.d.ts → with-style-props-Dq5Vntqy.d.ts} +0 -1
  181. package/package.json +17 -14
  182. package/dist/button-C9GW9nAr.js +0 -1
  183. package/dist/button-mfYak6Rx.d.ts +0 -71
  184. package/dist/checkbox-Apow0ipK.js +0 -1
  185. package/dist/cx-C1UYP5We.js +0 -1
  186. package/dist/icon-SUx16Sl3.js +0 -1
  187. package/dist/icon-button-DiX9iZ9n.js +0 -1
  188. package/dist/index-CJbKEKr2.d.ts +0 -20
  189. package/dist/slot-DT_E5BQx.js +0 -1
  190. package/dist/theme-provider-C5XYi2-H.js +0 -1
  191. package/dist/toast-CZBWjXcP.js +0 -1
  192. package/dist/use-prefers-reduced-motion-DBqNw1wB.js +0 -1
@@ -1,7 +1,6 @@
1
- import { t as WithAsChild } from "./as-child-uN_018tj.js";
2
- import { n as IconProps } from "./icon-n49kOh4_.js";
1
+ import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
2
+ import { n as IconProps } from "./icon-Cevjo93X.js";
3
3
  import { ComponentPropsWithoutRef } from "react";
4
-
5
4
  //#region src/components/accordion/accordion.d.ts
6
5
  /**
7
6
  * `"single"` mode props: at most one item open at a time — opening a section
@@ -16,9 +15,12 @@ type AccordionSingleProps = {
16
15
  * previously open one. Must be set explicitly — the default is `"multiple"`,
17
16
  * where sections open independently.
18
17
  */
19
- type: "single"; /** The controlled open item value (`""` for none). */
20
- value?: string; /** The initial open item value when uncontrolled. */
21
- defaultValue?: string; /** Called with the newly open item value (`""` when collapsed). */
18
+ type: "single";
19
+ /** The controlled open item value (`""` for none). */
20
+ value?: string;
21
+ /** The initial open item value when uncontrolled. */
22
+ defaultValue?: string;
23
+ /** Called with the newly open item value (`""` when collapsed). */
22
24
  onValueChange?: (value: string) => void;
23
25
  };
24
26
  /**
@@ -36,9 +38,12 @@ type AccordionMultipleProps = {
36
38
  *
37
39
  * @default "multiple"
38
40
  */
39
- type?: "multiple"; /** The controlled list of open item values. */
40
- value?: string[]; /** The initial list of open item values when uncontrolled. */
41
- defaultValue?: string[]; /** Called with the new list of open item values. */
41
+ type?: "multiple";
42
+ /** The controlled list of open item values. */
43
+ value?: string[];
44
+ /** The initial list of open item values when uncontrolled. */
45
+ defaultValue?: string[];
46
+ /** Called with the new list of open item values. */
42
47
  onValueChange?: (value: string[]) => void;
43
48
  };
44
49
  /**
@@ -52,6 +57,51 @@ type AccordionMultipleProps = {
52
57
  * standard `<div>` props (forwarded to the container) plus `asChild`.
53
58
  */
54
59
  type AccordionRootProps = (AccordionSingleProps | AccordionMultipleProps) & Omit<ComponentPropsWithoutRef<"div">, "defaultValue"> & WithAsChild;
60
+ /**
61
+ * The icon that indicates the open/closed state of its {@link Trigger}. Defaults
62
+ * to a downward caret that rotates 180° when the section is open. Pass `svg` to
63
+ * override it with any icon (the rotation-on-open still applies; override
64
+ * `className` to change that).
65
+ *
66
+ * @see https://mantle.ngrok.com/components/data-display/accordion#api-accordion-trigger-icon
67
+ *
68
+ * @example
69
+ * // Default caret
70
+ * <Accordion.Root type="single" defaultValue="item-1">
71
+ * <Accordion.Item value="item-1">
72
+ * <Accordion.Trigger>
73
+ * Is it accessible?
74
+ * <Accordion.TriggerIcon />
75
+ * </Accordion.Trigger>
76
+ * <Accordion.Content>
77
+ * <Accordion.Body>Yes. It adheres to the WAI-ARIA disclosure pattern.</Accordion.Body>
78
+ * </Accordion.Content>
79
+ * </Accordion.Item>
80
+ * </Accordion.Root>
81
+ *
82
+ * @example
83
+ * // Custom icon
84
+ * import { PlusIcon } from "@phosphor-icons/react/Plus";
85
+ *
86
+ * <Accordion.Root type="single" defaultValue="item-1">
87
+ * <Accordion.Item value="item-1">
88
+ * <Accordion.Trigger>
89
+ * Is it accessible?
90
+ * <Accordion.TriggerIcon svg={<PlusIcon />} />
91
+ * </Accordion.Trigger>
92
+ * <Accordion.Content>
93
+ * <Accordion.Body>Yes. It adheres to the WAI-ARIA disclosure pattern.</Accordion.Body>
94
+ * </Accordion.Content>
95
+ * </Accordion.Item>
96
+ * </Accordion.Root>
97
+ */
98
+ declare const TriggerIcon: {
99
+ ({ className, svg, ...props }: Omit<IconProps, "svg"> & {
100
+ /** The icon to render. Defaults to a downward caret that rotates open. */
101
+ svg?: IconProps["svg"];
102
+ }): import("react").JSX.Element;
103
+ displayName: string;
104
+ };
55
105
  /**
56
106
  * A vertically stacked set of disclosure sections styled after the shadcn /
57
107
  * ngrok.com accordion.
@@ -66,7 +116,7 @@ type AccordionRootProps = (AccordionSingleProps | AccordionMultipleProps) & Omit
66
116
  * `Accordion.Root` defaults to `type="multiple"` (sections open independently);
67
117
  * pass `type="single"` when opening one section should auto-close the others.
68
118
  *
69
- * @see https://mantle.ngrok.com/components/accordion
119
+ * @see https://mantle.ngrok.com/components/data-display/accordion
70
120
  *
71
121
  * @example
72
122
  * Composition:
@@ -127,7 +177,8 @@ declare const Accordion: {
127
177
  * </Accordion.Root>
128
178
  */
129
179
  readonly Item: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
130
- /** The unique value identifying this item within its accordion. */value: string;
180
+ /** The unique value identifying this item within its accordion. */
181
+ value: string;
131
182
  } & import("react").RefAttributes<HTMLDivElement>>;
132
183
  /**
133
184
  * The `<button>` header that toggles a section. See {@link Trigger}.
@@ -162,16 +213,7 @@ declare const Accordion: {
162
213
  * </Accordion.Item>
163
214
  * </Accordion.Root>
164
215
  */
165
- readonly TriggerIcon: {
166
- ({
167
- className,
168
- svg,
169
- ...props
170
- }: Omit<IconProps, "svg"> & {
171
- /** The icon to render. Defaults to a downward caret that rotates open. */svg?: IconProps["svg"];
172
- }): import("react").JSX.Element;
173
- displayName: string;
174
- };
216
+ readonly TriggerIcon: typeof TriggerIcon;
175
217
  /**
176
218
  * The collapsible, find-in-page-discoverable body. See {@link Content}.
177
219
  *
package/dist/accordion.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-Cjf2gfB8.js";import{t as n}from"./cx-C1UYP5We.js";import{t as r}from"./icon-SUx16Sl3.js";import{t as i}from"./slot-DT_E5BQx.js";import{CaretDownIcon as a}from"@phosphor-icons/react/CaretDown";import{createContext as o,forwardRef as s,useCallback as c,useContext as l,useEffect as u,useMemo as d,useRef as f,useState as p}from"react";import m from"tiny-invariant";import{jsx as h}from"react/jsx-runtime";function g(e,t){return e.includes(t)}function _(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 v(e){return e==null?[]:typeof e==`string`?e===``?[]:[e]:e}function y(e,t){e.type===`single`?e.onValueChange?.(t[0]??``):e.onValueChange?.([...t])}function b(){return typeof document<`u`&&document.body!=null&&`onbeforematch`in document.body}const x=o(null);function S(e){let t=l(x);return m(t,`\`${e}\` must be rendered within \`Accordion.Root\`.`),t}const C=o(null);function w(e){let t=l(C);return m(t,`\`${e}\` must be rendered within \`Accordion.Item\`.`),t}const T=s((e,t)=>{let{type:r=`multiple`,value:a,defaultValue:o,onValueChange:s,asChild:c,children:l,className:u,...f}=e,m=a!=null,[g,b]=p(()=>v(o)),S=m?v(a):g,C=d(()=>({type:r,openValues:S,setItemOpen:(t,n)=>{let i=_(S,t,n,r);i!==S&&(m||b(i),y(e,i))}}),[r,S,m,e]),w={...f,"data-slot":`accordion`,className:n(`w-full divide-y divide-separator`,u)};return h(x.Provider,{value:C,children:h(c?i:`div`,{ref:t,...w,children:l})})});T.displayName=`Accordion`;const E=s(({children:e,value:t,...n},r)=>{let{openValues:i,setItemOpen:a}=S(`Accordion.Item`),o=g(i,t),s=c(e=>{a(t,e)},[a,t]),l=d(()=>({open:o,setOpen:s}),[o,s]);return h(C.Provider,{value:l,children:h(`div`,{ref:r,...n,role:`group`,"data-slot":`accordion-item`,"data-state":o?`open`:`closed`,children:e})})});E.displayName=`AccordionItem`;const D=s(({className:e,children:t,onClick:r,...i},a)=>{let{open:o,setOpen:s}=w(`Accordion.Trigger`);return h(`button`,{ref:a,type:`button`,...i,"data-slot":`accordion-trigger`,"data-state":o?`open`:`closed`,"aria-expanded":o,className:n(`group flex w-full cursor-pointer items-center justify-between gap-4 py-4 text-left font-medium outline-none`,`-mx-2 rounded-md px-2`,`transition-[padding] duration-200 ease-out data-state-open:pb-2 motion-reduce:transition-none`,`focus:outline-hidden focus-visible:ring-4 focus-visible:ring-focus-accent`,e),onClick:e=>{r?.(e),s(!o)},children:t})});D.displayName=`AccordionTrigger`;const O=h(a,{weight:`bold`}),k=({className:e,svg:t=O,...i})=>h(r,{...i,"data-slot":`accordion-trigger-icon`,svg:t,className:n(`size-4 shrink-0 text-muted transition-transform duration-200 group-data-state-open:rotate-180`,e)});k.displayName=`AccordionTriggerIcon`;const A=s(({className:r,children:i,...a},o)=>{let{open:s,setOpen:c}=w(`Accordion.Content`),l=f(null),d=t(l,o);return u(()=>{let e=l.current;if(!e||!b())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=l.current;e&&(s||!b()?e.removeAttribute(`hidden`):(e.setAttribute(`hidden`,`until-found`),e.style.height=``))},[s]),h(`div`,{ref:d,...a,"data-slot":`accordion-content`,"data-state":s?`open`:`closed`,className:n(`h-0 overflow-hidden transition-[height,content-visibility] duration-200 ease-out [interpolate-size:allow-keywords] transition-discrete data-state-open:h-auto motion-reduce:transition-none`,r),children:i})});A.displayName=`AccordionContent`;const j=s(({className:e,...t},r)=>h(`div`,{ref:r,...t,"data-slot":`accordion-body`,className:n(`pt-2 pb-4`,e)}));j.displayName=`AccordionBody`;const M={Root:T,Item:E,Trigger:D,TriggerIcon:k,Content:A,Body:j};export{M as Accordion};
1
+ import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-Cjf2gfB8.js";import{t as n}from"./cx-IiQEAKf5.js";import{t as r}from"./icon-CDtYjF_H.js";import{t as i}from"./slot-DmPrjM7N.js";import{CaretDownIcon as a}from"@phosphor-icons/react/CaretDown";import{createContext as o,forwardRef as s,useCallback as c,useContext as l,useEffect as u,useMemo as d,useRef as f,useState as p}from"react";import m from"tiny-invariant";import{jsx as h}from"react/jsx-runtime";function g(e,t){return e.includes(t)}function _(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 v(e){return e==null?[]:typeof e==`string`?e===``?[]:[e]:e}function y(e,t){e.type===`single`?e.onValueChange?.(t[0]??``):e.onValueChange?.([...t])}function b(){return typeof document<`u`&&document.body!=null&&`onbeforematch`in document.body}const x=o(null);function S(e){let t=l(x);return m(t,`\`${e}\` must be rendered within \`Accordion.Root\`.`),t}const C=o(null);function w(e){let t=l(C);return m(t,`\`${e}\` must be rendered within \`Accordion.Item\`.`),t}const T=s((e,t)=>{let{type:r=`multiple`,value:a,defaultValue:o,onValueChange:s,asChild:c,children:l,className:u,...f}=e,m=a!=null,[g,b]=p(()=>v(o)),S=m?v(a):g,C=d(()=>({type:r,openValues:S,setItemOpen:(t,n)=>{let i=_(S,t,n,r);i!==S&&(m||b(i),y(e,i))}}),[r,S,m,e]),w={...f,"data-slot":`accordion`,className:n(`w-full divide-y divide-separator`,u)};return h(x.Provider,{value:C,children:h(c?i:`div`,{ref:t,...w,children:l})})});T.displayName=`Accordion`;const E=s(({children:e,value:t,...n},r)=>{let{openValues:i,setItemOpen:a}=S(`Accordion.Item`),o=g(i,t),s=c(e=>{a(t,e)},[a,t]),l=d(()=>({open:o,setOpen:s}),[o,s]);return h(C.Provider,{value:l,children:h(`div`,{ref:r,...n,role:`group`,"data-slot":`accordion-item`,"data-state":o?`open`:`closed`,children:e})})});E.displayName=`AccordionItem`;const D=s(({className:e,children:t,onClick:r,...i},a)=>{let{open:o,setOpen:s}=w(`Accordion.Trigger`);return h(`button`,{ref:a,type:`button`,...i,"data-slot":`accordion-trigger`,"data-state":o?`open`:`closed`,"aria-expanded":o,className:n(`group flex w-full cursor-pointer items-center justify-between gap-4 py-4 text-left font-medium outline-none`,`-mx-2 rounded-md px-2`,`transition-[padding] duration-200 ease-out data-state-open:pb-2 motion-reduce:transition-none`,`focus:outline-hidden focus-visible:ring-4 focus-visible:ring-focus-accent`,e),onClick:e=>{r?.(e),s(!o)},children:t})});D.displayName=`AccordionTrigger`;const O=h(a,{weight:`bold`}),k=({className:e,svg:t=O,...i})=>h(r,{...i,"data-slot":`accordion-trigger-icon`,svg:t,className:n(`size-4 shrink-0 text-muted transition-transform duration-200 group-data-state-open:rotate-180`,e)});k.displayName=`AccordionTriggerIcon`;const A=s(({className:r,children:i,...a},o)=>{let{open:s,setOpen:c}=w(`Accordion.Content`),l=f(null),d=t(l,o);return u(()=>{let e=l.current;if(!e||!b())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=l.current;e&&(s||!b()?e.removeAttribute(`hidden`):(e.setAttribute(`hidden`,`until-found`),e.style.height=``))},[s]),h(`div`,{ref:d,...a,"data-slot":`accordion-content`,"data-state":s?`open`:`closed`,className:n(`h-0 overflow-hidden transition-[height,content-visibility] duration-200 ease-out [interpolate-size:allow-keywords] transition-discrete data-state-open:h-auto motion-reduce:transition-none`,r),children:i})});A.displayName=`AccordionContent`;const j=s(({className:e,...t},r)=>h(`div`,{ref:r,...t,"data-slot":`accordion-body`,className:n(`pt-2 pb-4`,e)}));j.displayName=`AccordionBody`;const M={Root:T,Item:E,Trigger:D,TriggerIcon:k,Content:A,Body:j};export{M as Accordion};
package/dist/agent.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngrok/mantle",
3
- "version": "0.77.0",
3
+ "version": "0.79.0",
4
4
  "origin": "https://mantle.ngrok.com",
5
5
  "endpoints": {
6
6
  "docs": "https://mantle.ngrok.com/",
@@ -21,10 +21,12 @@
21
21
  "@ngrok/mantle/alert-dialog",
22
22
  "@ngrok/mantle/anchor",
23
23
  "@ngrok/mantle/badge",
24
+ "@ngrok/mantle/breadcrumb",
24
25
  "@ngrok/mantle/browser-only",
25
26
  "@ngrok/mantle/button",
26
27
  "@ngrok/mantle/calendar",
27
28
  "@ngrok/mantle/card",
29
+ "@ngrok/mantle/centered-layout",
28
30
  "@ngrok/mantle/checkbox",
29
31
  "@ngrok/mantle/choice",
30
32
  "@ngrok/mantle/code",
@@ -73,6 +75,7 @@
73
75
  "@ngrok/mantle/tabs",
74
76
  "@ngrok/mantle/text-area",
75
77
  "@ngrok/mantle/theme",
78
+ "@ngrok/mantle/theme-switcher",
76
79
  "@ngrok/mantle/toast",
77
80
  "@ngrok/mantle/tooltip",
78
81
  "@ngrok/mantle/types",
@@ -1,18 +1,19 @@
1
- import { t as WithAsChild } from "./as-child-uN_018tj.js";
2
- import { t as SvgAttributes } from "./types-BvUzforF.js";
3
- import { n as ButtonProps } from "./button-mfYak6Rx.js";
4
- import { t as Root$1 } from "./primitive-FoWela9a.js";
1
+ import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
2
+ import { t as SvgAttributes } from "./types-D1RY5Tcj.js";
3
+ import { t as ButtonIntent } from "./intents-DdSKSj1c.js";
4
+ import { n as ButtonAppearance, r as ButtonProps } from "./button-DcXOWUYo.js";
5
+ import { t as Root$1 } from "./primitive-C64-m48O.js";
5
6
  import { ComponentProps, ReactNode } from "react";
6
-
7
7
  //#region src/components/alert-dialog/alert-dialog.d.ts
8
- declare const priorities: readonly ["info", "danger"];
9
- type Priority = (typeof priorities)[number];
8
+ declare const intents: readonly ["info", "danger"];
9
+ type AlertDialogIntent = (typeof intents)[number];
10
10
  type AlertDialogProps = ComponentProps<typeof Root$1> & {
11
11
  /**
12
- * Indicates the importance or impact level of the AlertDialog, affecting its
13
- * color and styling to communicate its purpose to the user.
12
+ * The intent of the AlertDialog the tone its color communicates to the
13
+ * user, affecting the color and styling of descendants like
14
+ * `AlertDialog.Icon` and `AlertDialog.Action`.
14
15
  */
15
- priority: Priority;
16
+ intent: AlertDialogIntent;
16
17
  };
17
18
  /**
18
19
  * A modal dialog that interrupts the user with important content and expects a
@@ -23,13 +24,13 @@ type AlertDialogProps = ComponentProps<typeof Root$1> & {
23
24
  * shared floating z-index. When multiple shared layers are open, the most
24
25
  * recently mounted layer renders on top.
25
26
  *
26
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogroot
27
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogroot
27
28
  *
28
29
  * @example
29
30
  * ```tsx
30
- * <AlertDialog.Root priority="danger">
31
+ * <AlertDialog.Root intent="danger">
31
32
  * <AlertDialog.Trigger asChild>
32
- * <Button type="button" appearance="outlined">
33
+ * <Button type="button" appearance="outlined" intent="neutral">
33
34
  * Show Danger Alert Dialog
34
35
  * </Button>
35
36
  * </AlertDialog.Trigger>
@@ -55,13 +56,42 @@ type AlertDialogProps = ComponentProps<typeof Root$1> & {
55
56
  * </AlertDialog.Root>
56
57
  * ```
57
58
  */
58
- declare function Root({
59
- priority,
60
- ...props
61
- }: AlertDialogProps): import("react").JSX.Element;
62
- declare namespace Root {
63
- var displayName: string;
64
- }
59
+ declare function Root({ intent, ...props }: AlertDialogProps): import("react").JSX.Element;
60
+ type AlertDialogActionProps = Omit<ButtonProps, "appearance" | "intent"> & {
61
+ /**
62
+ * The visual style of the action button. Optional here — `AlertDialog.Action`
63
+ * defaults to `"filled"` so the confirming action carries the heaviest
64
+ * visual weight in the dialog.
65
+ *
66
+ * @default "filled"
67
+ */
68
+ appearance?: ButtonAppearance;
69
+ /**
70
+ * The tone of the action button. Optional here — when omitted,
71
+ * `AlertDialog.Action` derives the tone from the parent `AlertDialog.Root`'s
72
+ * `intent` (`"danger"` → `"danger"`, `"info"` → `"accent"`), so the Action
73
+ * carries the dialog's tone the same way its icon does. A passed value
74
+ * always wins over the context-derived tone.
75
+ */
76
+ intent?: ButtonIntent;
77
+ };
78
+ type AlertDialogCancelProps = Omit<ButtonProps, "appearance" | "intent"> & {
79
+ /**
80
+ * The visual style of the cancel button. Optional here — `AlertDialog.Cancel`
81
+ * defaults to `"outlined"` so it visually de-emphasizes against
82
+ * `AlertDialog.Action`.
83
+ *
84
+ * @default "outlined"
85
+ */
86
+ appearance?: ButtonAppearance;
87
+ /**
88
+ * The tone of the cancel button. Optional here — `AlertDialog.Cancel`
89
+ * defaults to `"neutral"`, the workhorse tone for routine actions.
90
+ *
91
+ * @default "neutral"
92
+ */
93
+ intent?: ButtonIntent;
94
+ };
65
95
  type AlertDialogIconProps = Omit<SvgAttributes, "children"> & {
66
96
  svg?: ReactNode;
67
97
  };
@@ -78,7 +108,7 @@ type AlertDialogIconProps = Omit<SvgAttributes, "children"> & {
78
108
  * shared floating z-index. When multiple shared layers are open, the most
79
109
  * recently mounted layer renders on top.
80
110
  *
81
- * @see https://mantle.ngrok.com/components/alert-dialog
111
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog
82
112
  *
83
113
  * @example
84
114
  * Composition:
@@ -98,9 +128,9 @@ type AlertDialogIconProps = Omit<SvgAttributes, "children"> & {
98
128
  *
99
129
  * @example
100
130
  * ```tsx
101
- * <AlertDialog.Root priority="danger">
131
+ * <AlertDialog.Root intent="danger">
102
132
  * <AlertDialog.Trigger asChild>
103
- * <Button type="button" appearance="outlined">
133
+ * <Button type="button" appearance="outlined" intent="neutral">
104
134
  * Show Danger Alert Dialog
105
135
  * </Button>
106
136
  * </AlertDialog.Trigger>
@@ -129,22 +159,22 @@ type AlertDialogIconProps = Omit<SvgAttributes, "children"> & {
129
159
  declare const AlertDialog: {
130
160
  /**
131
161
  * The root stateful component for the Alert Dialog. Wraps the trigger and
132
- * content and exposes the required `priority` prop (`"danger"` for
133
- * destructive actions, `"info"` for informational confirmations) which
134
- * propagates color to descendants like `AlertDialog.Icon` and
135
- * `AlertDialog.Action`.
162
+ * content and exposes the required `intent` prop (`"danger"` for
163
+ * destructive actions, `"info"` for informational confirmations) — the tone
164
+ * its color communicates — which propagates color to descendants like
165
+ * `AlertDialog.Icon` and `AlertDialog.Action`.
136
166
  *
137
167
  * `AlertDialog` renders its floating layer at Tailwind `z-50`, Mantle's
138
168
  * shared floating z-index. When multiple shared layers are open, the most
139
169
  * recently mounted layer renders on top.
140
170
  *
141
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogroot
171
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogroot
142
172
  *
143
173
  * @example
144
174
  * ```tsx
145
- * <AlertDialog.Root priority="danger">
175
+ * <AlertDialog.Root intent="danger">
146
176
  * <AlertDialog.Trigger asChild>
147
- * <Button type="button" appearance="outlined">
177
+ * <Button type="button" appearance="outlined" intent="neutral">
148
178
  * Show Danger Alert Dialog
149
179
  * </Button>
150
180
  * </AlertDialog.Trigger>
@@ -173,17 +203,19 @@ declare const AlertDialog: {
173
203
  readonly Root: typeof Root;
174
204
  /**
175
205
  * A button that confirms the Alert Dialog action. Defaults to
176
- * `appearance="filled"` and inherits the priority color from the parent
177
- * `AlertDialog.Root`. Does not close the dialog by default — wrap with
178
- * `AlertDialog.Close asChild` if the action should also dismiss.
206
+ * `appearance="filled"`, with a tone derived from the parent
207
+ * `AlertDialog.Root`'s intent: danger dialogs get a danger button, info
208
+ * dialogs get an accent one — the Action carries the dialog's tone the
209
+ * same way its icon does. Does not close the dialog by default — wrap
210
+ * with `AlertDialog.Close asChild` if the action should also dismiss.
179
211
  *
180
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogaction
212
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogaction
181
213
  *
182
214
  * @example
183
215
  * ```tsx
184
- * <AlertDialog.Root priority="danger">
216
+ * <AlertDialog.Root intent="danger">
185
217
  * <AlertDialog.Trigger asChild>
186
- * <Button type="button" appearance="outlined">
218
+ * <Button type="button" appearance="outlined" intent="neutral">
187
219
  * Show Danger Alert Dialog
188
220
  * </Button>
189
221
  * </AlertDialog.Trigger>
@@ -209,18 +241,18 @@ declare const AlertDialog: {
209
241
  * </AlertDialog.Root>
210
242
  * ```
211
243
  */
212
- readonly Action: import("react").ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
244
+ readonly Action: import("react").ForwardRefExoticComponent<Omit<AlertDialogActionProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
213
245
  /**
214
246
  * Contains the main content of the alert dialog. Wraps the header and footer
215
247
  * inside `AlertDialog.Content` next to `AlertDialog.Icon`.
216
248
  *
217
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogbody
249
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogbody
218
250
  *
219
251
  * @example
220
252
  * ```tsx
221
- * <AlertDialog.Root priority="danger">
253
+ * <AlertDialog.Root intent="danger">
222
254
  * <AlertDialog.Trigger asChild>
223
- * <Button type="button" appearance="outlined">
255
+ * <Button type="button" appearance="outlined" intent="neutral">
224
256
  * Show Danger Alert Dialog
225
257
  * </Button>
226
258
  * </AlertDialog.Trigger>
@@ -249,16 +281,16 @@ declare const AlertDialog: {
249
281
  readonly Body: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & WithAsChild, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
250
282
  /**
251
283
  * A button that closes the dialog and cancels the action. Defaults to
252
- * `appearance="outlined"` and `priority="neutral"` so it visually
284
+ * `appearance="outlined"` and `intent="neutral"` so it visually
253
285
  * de-emphasizes against `AlertDialog.Action`.
254
286
  *
255
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogcancel
287
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogcancel
256
288
  *
257
289
  * @example
258
290
  * ```tsx
259
- * <AlertDialog.Root priority="danger">
291
+ * <AlertDialog.Root intent="danger">
260
292
  * <AlertDialog.Trigger asChild>
261
- * <Button type="button" appearance="outlined">
293
+ * <Button type="button" appearance="outlined" intent="neutral">
262
294
  * Show Danger Alert Dialog
263
295
  * </Button>
264
296
  * </AlertDialog.Trigger>
@@ -284,19 +316,19 @@ declare const AlertDialog: {
284
316
  * </AlertDialog.Root>
285
317
  * ```
286
318
  */
287
- readonly Cancel: import("react").ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
319
+ readonly Cancel: import("react").ForwardRefExoticComponent<Omit<AlertDialogCancelProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
288
320
  /**
289
321
  * A button that closes the Alert Dialog. (Unstyled) Typically wrapped
290
322
  * around `AlertDialog.Action` with `asChild` so the action both performs
291
323
  * the operation and dismisses the dialog.
292
324
  *
293
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogclose
325
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogclose
294
326
  *
295
327
  * @example
296
328
  * ```tsx
297
- * <AlertDialog.Root priority="danger">
329
+ * <AlertDialog.Root intent="danger">
298
330
  * <AlertDialog.Trigger asChild>
299
- * <Button type="button" appearance="outlined">
331
+ * <Button type="button" appearance="outlined" intent="neutral">
300
332
  * Show Danger Alert Dialog
301
333
  * </Button>
302
334
  * </AlertDialog.Trigger>
@@ -333,13 +365,13 @@ declare const AlertDialog: {
333
365
  * Mantle's shared floating z-index. When multiple shared layers are open,
334
366
  * the most recently mounted layer renders on top.
335
367
  *
336
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogcontent
368
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogcontent
337
369
  *
338
370
  * @example
339
371
  * ```tsx
340
- * <AlertDialog.Root priority="danger">
372
+ * <AlertDialog.Root intent="danger">
341
373
  * <AlertDialog.Trigger asChild>
342
- * <Button type="button" appearance="outlined">
374
+ * <Button type="button" appearance="outlined" intent="neutral">
343
375
  * Show Danger Alert Dialog
344
376
  * </Button>
345
377
  * </AlertDialog.Trigger>
@@ -380,13 +412,13 @@ declare const AlertDialog: {
380
412
  * An accessible description to be announced when the dialog is opened.
381
413
  * Renders as a `div` by default; can be changed via the `asChild` prop.
382
414
  *
383
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogdescription
415
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogdescription
384
416
  *
385
417
  * @example
386
418
  * ```tsx
387
- * <AlertDialog.Root priority="danger">
419
+ * <AlertDialog.Root intent="danger">
388
420
  * <AlertDialog.Trigger asChild>
389
- * <Button type="button" appearance="outlined">
421
+ * <Button type="button" appearance="outlined" intent="neutral">
390
422
  * Show Danger Alert Dialog
391
423
  * </Button>
392
424
  * </AlertDialog.Trigger>
@@ -417,13 +449,13 @@ declare const AlertDialog: {
417
449
  * Contains the footer content of the dialog, including the action and
418
450
  * cancel buttons.
419
451
  *
420
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogfooter
452
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogfooter
421
453
  *
422
454
  * @example
423
455
  * ```tsx
424
- * <AlertDialog.Root priority="danger">
456
+ * <AlertDialog.Root intent="danger">
425
457
  * <AlertDialog.Trigger asChild>
426
- * <Button type="button" appearance="outlined">
458
+ * <Button type="button" appearance="outlined" intent="neutral">
427
459
  * Show Danger Alert Dialog
428
460
  * </Button>
429
461
  * </AlertDialog.Trigger>
@@ -454,13 +486,13 @@ declare const AlertDialog: {
454
486
  * Contains the header content of the dialog, including the title and
455
487
  * description.
456
488
  *
457
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogheader
489
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogheader
458
490
  *
459
491
  * @example
460
492
  * ```tsx
461
- * <AlertDialog.Root priority="danger">
493
+ * <AlertDialog.Root intent="danger">
462
494
  * <AlertDialog.Trigger asChild>
463
- * <Button type="button" appearance="outlined">
495
+ * <Button type="button" appearance="outlined" intent="neutral">
464
496
  * Show Danger Alert Dialog
465
497
  * </Button>
466
498
  * </AlertDialog.Trigger>
@@ -488,17 +520,17 @@ declare const AlertDialog: {
488
520
  */
489
521
  readonly Header: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & WithAsChild, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
490
522
  /**
491
- * An icon that visually represents the priority of the AlertDialog.
523
+ * An icon that visually represents the intent of the AlertDialog.
492
524
  * Defaults to a warning icon for `danger` and an info icon for `info`. Can
493
525
  * be overridden via the `svg` prop.
494
526
  *
495
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogicon
527
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogicon
496
528
  *
497
529
  * @example
498
530
  * ```tsx
499
- * <AlertDialog.Root priority="danger">
531
+ * <AlertDialog.Root intent="danger">
500
532
  * <AlertDialog.Trigger asChild>
501
- * <Button type="button" appearance="outlined">
533
+ * <Button type="button" appearance="outlined" intent="neutral">
502
534
  * Show Danger Alert Dialog
503
535
  * </Button>
504
536
  * </AlertDialog.Trigger>
@@ -530,13 +562,13 @@ declare const AlertDialog: {
530
562
  * Alternatively, provide `aria-label` or `aria-labelledby` to
531
563
  * `AlertDialog.Content` and exclude this component.
532
564
  *
533
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogtitle
565
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogtitle
534
566
  *
535
567
  * @example
536
568
  * ```tsx
537
- * <AlertDialog.Root priority="danger">
569
+ * <AlertDialog.Root intent="danger">
538
570
  * <AlertDialog.Trigger asChild>
539
- * <Button type="button" appearance="outlined">
571
+ * <Button type="button" appearance="outlined" intent="neutral">
540
572
  * Show Danger Alert Dialog
541
573
  * </Button>
542
574
  * </AlertDialog.Trigger>
@@ -566,13 +598,13 @@ declare const AlertDialog: {
566
598
  /**
567
599
  * A button that opens the Alert Dialog.
568
600
  *
569
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogtrigger
601
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogtrigger
570
602
  *
571
603
  * @example
572
604
  * ```tsx
573
- * <AlertDialog.Root priority="danger">
605
+ * <AlertDialog.Root intent="danger">
574
606
  * <AlertDialog.Trigger asChild>
575
- * <Button type="button" appearance="outlined">
607
+ * <Button type="button" appearance="outlined" intent="neutral">
576
608
  * Show Danger Alert Dialog
577
609
  * </Button>
578
610
  * </AlertDialog.Trigger>
@@ -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-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-BuVqb6zf.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-IiQEAKf5.js";import{t}from"./svg-only-DDx6FtJd.js";import{t as n}from"./slot-DmPrjM7N.js";import{t as r}from"./button-ClC60Nzg.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-M-kZdNIS.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({intent:e,...t}){let n=h(()=>({intent: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={danger:`danger`,info:`accent`},P=p(({appearance:e=`filled`,intent:t,...n},i)=>{let a=S(),o=N[a.intent];return _(r,{appearance:e,"data-slot":`alert-dialog-action`,intent:t??o,ref:i,...n})});P.displayName=`AlertDialogAction`;const F=p(({appearance:t=`outlined`,className:n,intent:i=`neutral`,...a},o)=>_(d,{asChild:!0,children:_(r,{appearance:t,"data-slot":`alert-dialog-cancel`,className:e(`mt-2 sm:mt-0`,n),intent:i,ref:o,...a})}));F.displayName=`AlertDialogCancel`;const I={danger:_(b,{}),info:_(y,{})},L={danger:`text-danger-600`,info:`text-accent-600`},R=p(({className:n,svg:r,...i},a)=>{let o=S(),s=L[o.intent],c=I[o.intent];return _(t,{ref:a,"data-slot":`alert-dialog-icon`,className:e(`size-12 sm:size-7`,s,n),svg:r??c,...i})});R.displayName=`AlertDialogIcon`;const z=p(({...e},t)=>_(d,{ref:t,"data-slot":`alert-dialog-close`,...e}));z.displayName=`AlertDialogClose`;const B={Root:C,Action:P,Body:O,Cancel:F,Close:z,Content:D,Description:M,Footer:A,Header:k,Icon:R,Title:j,Trigger:w};export{B as AlertDialog};