@ngrok/mantle 0.76.11 → 0.78.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 (194) hide show
  1. package/dist/accordion.d.ts +63 -21
  2. package/dist/accordion.js +1 -1
  3. package/dist/agent.json +7 -1
  4. package/dist/alert-dialog.d.ts +19 -26
  5. package/dist/alert-dialog.js +1 -1
  6. package/dist/alert.d.ts +16 -24
  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-CPH56Xw_.js +1 -0
  17. package/dist/browser-only.d.ts +2 -6
  18. package/dist/browser-only.js +1 -1
  19. package/dist/{button-CERx95KE.js → button-5t6-JS_I.js} +1 -1
  20. package/dist/button-AS5Ir3DE.js +1 -0
  21. package/dist/{button-mfYak6Rx.d.ts → button-Bw9MpShl.d.ts} +26 -8
  22. package/dist/button.d.ts +5 -4
  23. package/dist/button.js +1 -1
  24. package/dist/calendar.d.ts +2 -8
  25. package/dist/calendar.js +1 -1
  26. package/dist/card.d.ts +8 -8
  27. package/dist/card.js +1 -1
  28. package/dist/centered-layout.d.ts +147 -0
  29. package/dist/centered-layout.js +1 -0
  30. package/dist/checkbox-DJ2xl7Rc.js +1 -0
  31. package/dist/checkbox.d.ts +11 -9
  32. package/dist/checkbox.js +1 -1
  33. package/dist/choice-DOdyNzFC.js +1 -0
  34. package/dist/choice.d.ts +253 -0
  35. package/dist/choice.js +1 -0
  36. package/dist/code-block.d.ts +5 -17
  37. package/dist/code-block.js +1 -1
  38. package/dist/code-block_highlight-utils.d.ts +1 -1
  39. package/dist/code-block_highlight-utils.js +1 -1
  40. package/dist/code.d.ts +4 -5
  41. package/dist/code.js +1 -1
  42. package/dist/combobox.d.ts +40 -19
  43. package/dist/combobox.js +1 -1
  44. package/dist/command.d.ts +60 -38
  45. package/dist/command.js +1 -1
  46. package/dist/{copy-to-clipboard-Baw30q9O.js → copy-to-clipboard-BsCQ9m6K.js} +1 -1
  47. package/dist/cx-IiQEAKf5.js +1 -0
  48. package/dist/cx.js +1 -1
  49. package/dist/data-slot-CChfb_cv.d.ts +17 -0
  50. package/dist/data-table.d.ts +45 -131
  51. package/dist/data-table.js +1 -1
  52. package/dist/description-list.d.ts +7 -7
  53. package/dist/description-list.js +1 -1
  54. package/dist/{dialog-Cp0S2jsG.js → dialog-DVDFVT_-.js} +1 -1
  55. package/dist/dialog.d.ts +155 -48
  56. package/dist/dialog.js +1 -1
  57. package/dist/{direction-CcTY0FmA.d.ts → direction-BjU0bPST.d.ts} +1 -1
  58. package/dist/{dropdown-menu-OEuW4GLp.js → dropdown-menu-ByUQkAvJ.js} +1 -1
  59. package/dist/{dropdown-menu-CADgs9gz.d.ts → dropdown-menu-DT30TQzL.d.ts} +21 -24
  60. package/dist/dropdown-menu.d.ts +2 -1
  61. package/dist/dropdown-menu.js +1 -1
  62. package/dist/empty.d.ts +133 -53
  63. package/dist/empty.js +1 -1
  64. package/dist/{field-context-4k1kI7Bo.js → field-context-BR01g789.js} +1 -1
  65. package/dist/field.d.ts +24 -36
  66. package/dist/field.js +1 -1
  67. package/dist/flag.d.ts +2 -9
  68. package/dist/flag.js +1 -1
  69. package/dist/hooks.d.ts +139 -81
  70. package/dist/hooks.js +1 -1
  71. package/dist/hover-card.d.ts +34 -14
  72. package/dist/hover-card.js +1 -1
  73. package/dist/icon-CDtYjF_H.js +1 -0
  74. package/dist/{icon-n49kOh4_.d.ts → icon-Cevjo93X.d.ts} +2 -3
  75. package/dist/{icon-button-DiX9iZ9n.js → icon-button-CxVsZ2N1.js} +1 -1
  76. package/dist/{icon-button-D7hs6bX2.d.ts → icon-button-DuRSCsPh.d.ts} +5 -6
  77. package/dist/icon.d.ts +3 -3
  78. package/dist/icon.js +1 -1
  79. package/dist/icons.d.ts +7 -19
  80. package/dist/icons.js +1 -1
  81. package/dist/{in-view-BC3wmz-a.d.ts → in-view-nkSOdED2.d.ts} +21 -10
  82. package/dist/index-BnI3OppC.d.ts +1 -0
  83. package/dist/{index-CTU6apE6.d.ts → index-CDwfBOAA.d.ts} +5 -4
  84. package/dist/{index-Bed_XLWa.d.ts → index-D47aqlpz.d.ts} +3 -2
  85. package/dist/index-Rv8RL7xy.d.ts +25 -0
  86. package/dist/input-Ct1YOqSy.js +1 -0
  87. package/dist/input.d.ts +10 -56
  88. package/dist/input.js +1 -1
  89. package/dist/{kbd-D6k4Dnrf.js → kbd-K8iaZ-Ti.js} +1 -1
  90. package/dist/kbd.d.ts +3 -8
  91. package/dist/kbd.js +1 -1
  92. package/dist/{label-BLXfnQmn.js → label-BMlHW_2D.js} +1 -1
  93. package/dist/label-v2-bv98k.d.ts +69 -0
  94. package/dist/label.d.ts +1 -68
  95. package/dist/label.js +1 -1
  96. package/dist/list.d.ts +295 -0
  97. package/dist/list.js +1 -0
  98. package/dist/llms.txt +7 -1
  99. package/dist/main.d.ts +4 -27
  100. package/dist/main.js +1 -1
  101. package/dist/mantle.css +6 -6
  102. package/dist/media-object.d.ts +6 -7
  103. package/dist/media-object.js +1 -1
  104. package/dist/multi-select.d.ts +80 -33
  105. package/dist/multi-select.js +1 -1
  106. package/dist/otp-input.d.ts +7 -8
  107. package/dist/otp-input.js +1 -1
  108. package/dist/pagination.d.ts +11 -22
  109. package/dist/pagination.js +1 -1
  110. package/dist/{popover-Bq52EC7X.js → popover-D5WxxnBY.js} +1 -1
  111. package/dist/popover.d.ts +6 -7
  112. package/dist/popover.js +1 -1
  113. package/dist/{primitive-FoWela9a.d.ts → primitive-C64-m48O.d.ts} +0 -1
  114. package/dist/{primitive-BFUir4UB.js → primitive-wm7Wk-gy.js} +1 -1
  115. package/dist/progress.d.ts +55 -46
  116. package/dist/progress.js +1 -1
  117. package/dist/qr-code.d.ts +10 -9
  118. package/dist/qr-code.js +1 -1
  119. package/dist/radio-group.d.ts +71 -60
  120. package/dist/radio-group.js +1 -1
  121. package/dist/{resolve-pre-rendered-props-DxJ9-DAl.d.ts → resolve-pre-rendered-props-B6OlZrSI.d.ts} +13 -26
  122. package/dist/{resolve-pre-rendered-props-DwIF_M_K.js → resolve-pre-rendered-props-C3e5Auo3.js} +1 -1
  123. package/dist/sandboxed-on-click.d.ts +4 -8
  124. package/dist/sandboxed-on-click.js +1 -1
  125. package/dist/{select-BUGOJMER.d.ts → select-Bwt2YduR.d.ts} +11 -12
  126. package/dist/{select-xfyY5Vt1.js → select-D-5u0Blc.js} +1 -1
  127. package/dist/select.d.ts +1 -1
  128. package/dist/select.js +1 -1
  129. package/dist/selectable-list.d.ts +725 -0
  130. package/dist/selectable-list.js +1 -0
  131. package/dist/{separator-CqohKk4z.js → separator-kBnnv3Cw.js} +1 -1
  132. package/dist/separator.d.ts +6 -37
  133. package/dist/separator.js +1 -1
  134. package/dist/sheet.d.ts +231 -47
  135. package/dist/sheet.js +1 -1
  136. package/dist/sizes-Dje_rwKc.d.ts +29 -0
  137. package/dist/skeleton-Bu3tgNcW.js +1 -0
  138. package/dist/skeleton.d.ts +2 -2
  139. package/dist/skeleton.js +1 -1
  140. package/dist/skip-to-main-link.d.ts +4 -34
  141. package/dist/skip-to-main-link.js +1 -1
  142. package/dist/slider.d.ts +2 -21
  143. package/dist/slider.js +1 -1
  144. package/dist/slot-DmPrjM7N.js +1 -0
  145. package/dist/slot.d.ts +1 -1
  146. package/dist/slot.js +1 -1
  147. package/dist/split-button.d.ts +20 -12
  148. package/dist/split-button.js +1 -1
  149. package/dist/{svg-only-f6ToFLH0.d.ts → svg-only-BFeFS1aa.d.ts} +2 -3
  150. package/dist/{svg-only-CSOaF1tL.js → svg-only-DDx6FtJd.js} +1 -1
  151. package/dist/switch.d.ts +6 -3
  152. package/dist/switch.js +1 -1
  153. package/dist/{table-CAitdL78.js → table-CPH2md2-.js} +1 -1
  154. package/dist/{table-BWD9IlIN.d.ts → table-CwFHXC-G.d.ts} +10 -10
  155. package/dist/table.d.ts +1 -1
  156. package/dist/table.js +1 -1
  157. package/dist/tabs.d.ts +29 -15
  158. package/dist/tabs.js +1 -1
  159. package/dist/text-area.d.ts +2 -3
  160. package/dist/text-area.js +1 -1
  161. package/dist/theme-D8kZCOzM.js +1 -0
  162. package/dist/theme-provider-Djj_jBo6.js +1 -0
  163. package/dist/theme-switcher.d.ts +45 -0
  164. package/dist/theme-switcher.js +1 -0
  165. package/dist/theme.d.ts +15 -101
  166. package/dist/theme.js +1 -1
  167. package/dist/{toast-Bwno5LUs.js → toast-RkhbliFh.js} +1 -1
  168. package/dist/toast.d.ts +13 -37
  169. package/dist/toast.js +1 -1
  170. package/dist/tooltip.d.ts +10 -44
  171. package/dist/tooltip.js +1 -1
  172. package/dist/types-C19IR7jf.d.ts +48 -0
  173. package/dist/{types-BvUzforF.d.ts → types-D1RY5Tcj.d.ts} +0 -1
  174. package/dist/types.d.ts +3 -3
  175. package/dist/use-copy-to-clipboard-DqQ0_N3E.js +1 -0
  176. package/dist/use-prefers-reduced-motion-CagaNRgm.js +1 -0
  177. package/dist/utils.d.ts +2 -3
  178. package/dist/utils.js +1 -1
  179. package/dist/{validation-xyX_6kph.d.ts → validation-7QeiTFwl.d.ts} +3 -12
  180. package/dist/{validation-DCyx-ceH.js → validation-Bpptk_9t.js} +1 -1
  181. package/dist/virtual-DZMBu7Ch.js +1 -0
  182. package/dist/well.d.ts +3 -3
  183. package/dist/well.js +1 -1
  184. package/dist/{with-style-props-CyImx7vd.d.ts → with-style-props-Dq5Vntqy.d.ts} +0 -1
  185. package/package.json +79 -344
  186. package/dist/browser-only-BSl_hruR.js +0 -1
  187. package/dist/button-C9GW9nAr.js +0 -1
  188. package/dist/cx-C1UYP5We.js +0 -1
  189. package/dist/icon-SUx16Sl3.js +0 -1
  190. package/dist/index-CJbKEKr2.d.ts +0 -20
  191. package/dist/slot-DT_E5BQx.js +0 -1
  192. package/dist/theme-provider-BNFS3Acf.js +0 -1
  193. package/dist/use-copy-to-clipboard-BLpquU9d.js +0 -1
  194. package/dist/use-prefers-reduced-motion-CWIoFA6W.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.76.11",
3
+ "version": "0.78.0",
4
4
  "origin": "https://mantle.ngrok.com",
5
5
  "endpoints": {
6
6
  "docs": "https://mantle.ngrok.com/",
@@ -21,11 +21,14 @@
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",
31
+ "@ngrok/mantle/choice",
29
32
  "@ngrok/mantle/code",
30
33
  "@ngrok/mantle/code-block",
31
34
  "@ngrok/mantle/color",
@@ -47,6 +50,7 @@
47
50
  "@ngrok/mantle/input",
48
51
  "@ngrok/mantle/kbd",
49
52
  "@ngrok/mantle/label",
53
+ "@ngrok/mantle/list",
50
54
  "@ngrok/mantle/main",
51
55
  "@ngrok/mantle/media-object",
52
56
  "@ngrok/mantle/multi-select",
@@ -58,6 +62,7 @@
58
62
  "@ngrok/mantle/radio-group",
59
63
  "@ngrok/mantle/sandboxed-on-click",
60
64
  "@ngrok/mantle/select",
65
+ "@ngrok/mantle/selectable-list",
61
66
  "@ngrok/mantle/separator",
62
67
  "@ngrok/mantle/sheet",
63
68
  "@ngrok/mantle/skeleton",
@@ -70,6 +75,7 @@
70
75
  "@ngrok/mantle/tabs",
71
76
  "@ngrok/mantle/text-area",
72
77
  "@ngrok/mantle/theme",
78
+ "@ngrok/mantle/theme-switcher",
73
79
  "@ngrok/mantle/toast",
74
80
  "@ngrok/mantle/tooltip",
75
81
  "@ngrok/mantle/types",
@@ -1,9 +1,8 @@
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 { n as ButtonProps } from "./button-Bw9MpShl.js";
4
+ import { t as Root$1 } from "./primitive-C64-m48O.js";
5
5
  import { ComponentProps, ReactNode } from "react";
6
-
7
6
  //#region src/components/alert-dialog/alert-dialog.d.ts
8
7
  declare const priorities: readonly ["info", "danger"];
9
8
  type Priority = (typeof priorities)[number];
@@ -23,7 +22,7 @@ type AlertDialogProps = ComponentProps<typeof Root$1> & {
23
22
  * shared floating z-index. When multiple shared layers are open, the most
24
23
  * recently mounted layer renders on top.
25
24
  *
26
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogroot
25
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogroot
27
26
  *
28
27
  * @example
29
28
  * ```tsx
@@ -55,13 +54,7 @@ type AlertDialogProps = ComponentProps<typeof Root$1> & {
55
54
  * </AlertDialog.Root>
56
55
  * ```
57
56
  */
58
- declare function Root({
59
- priority,
60
- ...props
61
- }: AlertDialogProps): import("react").JSX.Element;
62
- declare namespace Root {
63
- var displayName: string;
64
- }
57
+ declare function Root({ priority, ...props }: AlertDialogProps): import("react").JSX.Element;
65
58
  type AlertDialogIconProps = Omit<SvgAttributes, "children"> & {
66
59
  svg?: ReactNode;
67
60
  };
@@ -78,7 +71,7 @@ type AlertDialogIconProps = Omit<SvgAttributes, "children"> & {
78
71
  * shared floating z-index. When multiple shared layers are open, the most
79
72
  * recently mounted layer renders on top.
80
73
  *
81
- * @see https://mantle.ngrok.com/components/alert-dialog
74
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog
82
75
  *
83
76
  * @example
84
77
  * Composition:
@@ -138,7 +131,7 @@ declare const AlertDialog: {
138
131
  * shared floating z-index. When multiple shared layers are open, the most
139
132
  * recently mounted layer renders on top.
140
133
  *
141
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogroot
134
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogroot
142
135
  *
143
136
  * @example
144
137
  * ```tsx
@@ -177,7 +170,7 @@ declare const AlertDialog: {
177
170
  * `AlertDialog.Root`. Does not close the dialog by default — wrap with
178
171
  * `AlertDialog.Close asChild` if the action should also dismiss.
179
172
  *
180
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogaction
173
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogaction
181
174
  *
182
175
  * @example
183
176
  * ```tsx
@@ -214,7 +207,7 @@ declare const AlertDialog: {
214
207
  * Contains the main content of the alert dialog. Wraps the header and footer
215
208
  * inside `AlertDialog.Content` next to `AlertDialog.Icon`.
216
209
  *
217
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogbody
210
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogbody
218
211
  *
219
212
  * @example
220
213
  * ```tsx
@@ -252,7 +245,7 @@ declare const AlertDialog: {
252
245
  * `appearance="outlined"` and `priority="neutral"` so it visually
253
246
  * de-emphasizes against `AlertDialog.Action`.
254
247
  *
255
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogcancel
248
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogcancel
256
249
  *
257
250
  * @example
258
251
  * ```tsx
@@ -290,7 +283,7 @@ declare const AlertDialog: {
290
283
  * around `AlertDialog.Action` with `asChild` so the action both performs
291
284
  * the operation and dismisses the dialog.
292
285
  *
293
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogclose
286
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogclose
294
287
  *
295
288
  * @example
296
289
  * ```tsx
@@ -333,7 +326,7 @@ declare const AlertDialog: {
333
326
  * Mantle's shared floating z-index. When multiple shared layers are open,
334
327
  * the most recently mounted layer renders on top.
335
328
  *
336
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogcontent
329
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogcontent
337
330
  *
338
331
  * @example
339
332
  * ```tsx
@@ -380,7 +373,7 @@ declare const AlertDialog: {
380
373
  * An accessible description to be announced when the dialog is opened.
381
374
  * Renders as a `div` by default; can be changed via the `asChild` prop.
382
375
  *
383
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogdescription
376
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogdescription
384
377
  *
385
378
  * @example
386
379
  * ```tsx
@@ -417,7 +410,7 @@ declare const AlertDialog: {
417
410
  * Contains the footer content of the dialog, including the action and
418
411
  * cancel buttons.
419
412
  *
420
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogfooter
413
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogfooter
421
414
  *
422
415
  * @example
423
416
  * ```tsx
@@ -454,7 +447,7 @@ declare const AlertDialog: {
454
447
  * Contains the header content of the dialog, including the title and
455
448
  * description.
456
449
  *
457
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogheader
450
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogheader
458
451
  *
459
452
  * @example
460
453
  * ```tsx
@@ -492,7 +485,7 @@ declare const AlertDialog: {
492
485
  * Defaults to a warning icon for `danger` and an info icon for `info`. Can
493
486
  * be overridden via the `svg` prop.
494
487
  *
495
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogicon
488
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogicon
496
489
  *
497
490
  * @example
498
491
  * ```tsx
@@ -530,7 +523,7 @@ declare const AlertDialog: {
530
523
  * Alternatively, provide `aria-label` or `aria-labelledby` to
531
524
  * `AlertDialog.Content` and exclude this component.
532
525
  *
533
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogtitle
526
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogtitle
534
527
  *
535
528
  * @example
536
529
  * ```tsx
@@ -566,7 +559,7 @@ declare const AlertDialog: {
566
559
  /**
567
560
  * A button that opens the Alert Dialog.
568
561
  *
569
- * @see https://mantle.ngrok.com/components/alert-dialog#alertdialogtrigger
562
+ * @see https://mantle.ngrok.com/components/overlays/alert-dialog#alertdialogtrigger
570
563
  *
571
564
  * @example
572
565
  * ```tsx
@@ -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-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};
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-AS5Ir3DE.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-wm7Wk-gy.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,8 +1,8 @@
1
- import { t as WithAsChild } from "./as-child-uN_018tj.js";
2
- import { t as SvgAttributes } from "./types-BvUzforF.js";
3
- import { n as IconButtonProps } from "./icon-button-D7hs6bX2.js";
1
+ import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
2
+ import { t as SvgAttributes } from "./types-D1RY5Tcj.js";
3
+ import "./index-D47aqlpz.js";
4
+ import { n as IconButtonProps } from "./icon-button-DuRSCsPh.js";
4
5
  import { ComponentProps, HTMLAttributes, ReactNode } from "react";
5
-
6
6
  //#region src/components/alert/alert.d.ts
7
7
  declare const priorities: readonly ["danger", "important", "info", "success", "warning"];
8
8
  type Priority = (typeof priorities)[number];
@@ -36,10 +36,14 @@ type AlertDismissIconButtonProps = Partial<Omit<IconButtonProps, "icon">> & {
36
36
  */
37
37
  icon?: ReactNode;
38
38
  };
39
+ declare const DismissIconButton: {
40
+ ({ size, type, label, appearance, className, icon, style, ...props }: AlertDismissIconButtonProps): import("react").JSX.Element;
41
+ displayName: string;
42
+ };
39
43
  /**
40
44
  * Displays a callout for user attention.
41
45
  *
42
- * @see https://mantle.ngrok.com/components/alert
46
+ * @see https://mantle.ngrok.com/components/feedback/alert
43
47
  *
44
48
  * @example
45
49
  * Composition:
@@ -70,7 +74,7 @@ declare const Alert: {
70
74
  /**
71
75
  * The root container of the alert component.
72
76
  *
73
- * @see https://mantle.ngrok.com/components/alert#alertroot
77
+ * @see https://mantle.ngrok.com/components/feedback/alert#alertroot
74
78
  *
75
79
  * @example
76
80
  * ```tsx
@@ -87,7 +91,7 @@ declare const Alert: {
87
91
  /**
88
92
  * The container for the content slot of an alert.
89
93
  *
90
- * @see https://mantle.ngrok.com/components/alert#alertcontent
94
+ * @see https://mantle.ngrok.com/components/feedback/alert#alertcontent
91
95
  *
92
96
  * @example
93
97
  * ```tsx
@@ -104,7 +108,7 @@ declare const Alert: {
104
108
  /**
105
109
  * The optional description of an alert.
106
110
  *
107
- * @see https://mantle.ngrok.com/components/alert#alertdescription
111
+ * @see https://mantle.ngrok.com/components/feedback/alert#alertdescription
108
112
  *
109
113
  * @example
110
114
  * ```tsx
@@ -121,7 +125,7 @@ declare const Alert: {
121
125
  /**
122
126
  * An optional dismiss button that can be used to close the alert.
123
127
  *
124
- * @see https://mantle.ngrok.com/components/alert#alertdismissiconbutton
128
+ * @see https://mantle.ngrok.com/components/feedback/alert#alertdismissiconbutton
125
129
  *
126
130
  * @example
127
131
  * ```tsx
@@ -135,23 +139,11 @@ declare const Alert: {
135
139
  * </Alert.Root>
136
140
  * ```
137
141
  */
138
- readonly DismissIconButton: {
139
- ({
140
- size,
141
- type,
142
- label,
143
- appearance,
144
- className,
145
- icon,
146
- style,
147
- ...props
148
- }: AlertDismissIconButtonProps): import("react").JSX.Element;
149
- displayName: string;
150
- };
142
+ readonly DismissIconButton: typeof DismissIconButton;
151
143
  /**
152
144
  * An optional icon that visually represents the priority of the Alert.
153
145
  *
154
- * @see https://mantle.ngrok.com/components/alert#alerticon
146
+ * @see https://mantle.ngrok.com/components/feedback/alert#alerticon
155
147
  *
156
148
  * @example
157
149
  * ```tsx
@@ -168,7 +160,7 @@ declare const Alert: {
168
160
  /**
169
161
  * The title of an alert.
170
162
  *
171
- * @see https://mantle.ngrok.com/components/alert#alerttitle
163
+ * @see https://mantle.ngrok.com/components/feedback/alert#alerttitle
172
164
  *
173
165
  * @example
174
166
  * ```tsx
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"./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
+ 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"./types-D85fCNV3.js";import{t as i}from"./icon-button-CxVsZ2N1.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=b(),s=C[o.priority];return u(t,{ref:a,"data-slot":`alert-icon`,className:e(`size-5`,n),svg:r??s,...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"./slot-DT_E5BQx.js";import{Children as r,cloneElement as i,forwardRef as a,isValidElement as o}from"react";import s from"tiny-invariant";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";const d=t=>e(`cursor-pointer rounded bg-transparent text-accent-600 hover:underline focus:outline-hidden focus-visible:ring-3 focus-visible:ring-focus-accent`,t),f=a(({asChild:e,children:a,className:f,rel:m,icon:h,iconPlacement:g=`start`,..._},v)=>{let y=p(m),b={"data-slot":`anchor`,className:d(f),ref:v,rel:y,..._};if(e){let e=r.only(a);s(o(e),"When using `asChild`, Anchor must be passed a single child as a JSX tag.");let d=e.props?.children;return l(n,{...b,children:i(e,{},u(c,{children:[h&&g===`start`&&l(t,{className:`inline-block mr-1.5`,svg:h}),d,h&&g===`end`&&l(t,{className:`inline-block ml-1.5`,svg:h})]}))})}return u(`a`,{...b,children:[h&&g===`start`&&l(t,{className:`inline-block mr-1.5`,svg:h}),a,h&&g===`end`&&l(t,{className:`inline-block ml-1.5`,svg:h})]})});f.displayName=`Anchor`;function p(e){return Array.isArray(e)?[...new Set(e)].map(e=>e?.trim()).filter(Boolean).toSorted().join(` `)||void 0:e?.trim()||void 0}export{d as n,p as r,f as t};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CDtYjF_H.js";import{t as n}from"./slot-DmPrjM7N.js";import{Children as r,cloneElement as i,forwardRef as a,isValidElement as o}from"react";import s from"tiny-invariant";import{Fragment as c,jsx as l,jsxs as u}from"react/jsx-runtime";const d=t=>e(`cursor-pointer rounded bg-transparent text-accent-600 hover:underline focus:outline-hidden focus-visible:ring-3 focus-visible:ring-focus-accent`,t),f=a(({asChild:e,children:a,className:f,rel:m,icon:h,iconPlacement:g=`start`,..._},v)=>{let y=p(m),b={"data-slot":`anchor`,className:d(f),ref:v,rel:y,..._};if(e){let e=r.only(a);s(o(e),"When using `asChild`, Anchor must be passed a single child as a JSX tag.");let d=e.props?.children;return l(n,{...b,children:i(e,{},u(c,{children:[h&&g===`start`&&l(t,{className:`inline-block mr-1.5`,svg:h}),d,h&&g===`end`&&l(t,{className:`inline-block ml-1.5`,svg:h})]}))})}return u(`a`,{...b,children:[h&&g===`start`&&l(t,{className:`inline-block mr-1.5`,svg:h}),a,h&&g===`end`&&l(t,{className:`inline-block ml-1.5`,svg:h})]})});f.displayName=`Anchor`;function p(e){return Array.isArray(e)?[...new Set(e)].map(e=>e?.trim()).filter(Boolean).toSorted().join(` `)||void 0:e?.trim()||void 0}export{d as n,p as r,f as t};
package/dist/anchor.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- import { t as WithAsChild } from "./as-child-uN_018tj.js";
1
+ import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
2
2
  import { ComponentProps, ReactNode } from "react";
3
-
4
3
  //#region src/components/anchor/types.d.ts
5
4
  /**
6
5
  * The rel attribute defines the relationship between a linked resource and the current document. Valid on <link>, <a>, <area>, and <form>, the supported values depend on the element on which the attribute is found.
@@ -53,7 +52,7 @@ type AnchorProps = Omit<ComponentProps<"a">, "rel"> & WithAsChild & {
53
52
  * primitive ({@link https://reactrouter.com/en/main/components/link `react-router` `<Link>`})
54
53
  * so client-side navigation kicks in. You can keep mantle's styling by
55
54
  * composing: `<Anchor asChild><Link to="/foo">…</Link></Anchor>`.
56
- * - For triggering an action — use a {@link https://mantle.ngrok.com/components/button Button}
55
+ * - For triggering an action — use a {@link https://mantle.ngrok.com/components/actions/button Button}
57
56
  * instead. If it doesn't navigate, it's not a link.
58
57
  *
59
58
  * **Icons.** Pass `icon` (a phosphor or custom SVG) and optionally
@@ -69,7 +68,7 @@ type AnchorProps = Omit<ComponentProps<"a">, "rel"> & WithAsChild & {
69
68
  * here" / "read more". For purely decorative icons, no extra labeling is
70
69
  * needed; for icon-only links, provide an `aria-label`.
71
70
  *
72
- * @see https://mantle.ngrok.com/components/anchor
71
+ * @see https://mantle.ngrok.com/components/navigation/anchor
73
72
  *
74
73
  * @example
75
74
  * ```tsx
package/dist/anchor.js CHANGED
@@ -1 +1 @@
1
- import{n as e,r as t,t as n}from"./anchor-BtgEJoPN.js";export{n as Anchor,e as anchorClassNames,t as resolveRel};
1
+ import{n as e,r as t,t as n}from"./anchor-C_tjSVy6.js";export{n as Anchor,e as anchorClassNames,t as resolveRel};
@@ -1,5 +1,4 @@
1
1
  import { ReactNode } from "react";
2
-
3
2
  //#region src/types/as-child.d.ts
4
3
  /**
5
4
  * Utility type for adding the optional `asChild` boolean prop to a component.
@@ -20,11 +19,5 @@ type WithAsChild = {
20
19
  */
21
20
  asChild?: boolean;
22
21
  };
23
- /**
24
- * Utility type for adding the optional `asChild` boolean prop to a component
25
- * that is self-closing.
26
- * This is useful for components that do not have children, but still need to
27
- * support the `asChild` prop.
28
- */
29
22
  //#endregion
30
23
  export { WithAsChild as t };
package/dist/badge.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- import { t as WithAsChild } from "./as-child-uN_018tj.js";
1
+ import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
2
2
  import { t as Color } from "./index-DorCusfG.js";
3
3
  import { ComponentProps, ReactNode } from "react";
4
-
5
4
  //#region src/components/badge/badge.d.ts
6
5
  declare const appearances: readonly ["muted"];
7
6
  type Appearance = (typeof appearances)[number];
@@ -19,59 +18,9 @@ type BadgeProps = ComponentProps<"span"> & WithAsChild & {
19
18
  */
20
19
  appearance: Appearance;
21
20
  };
22
- /**
23
- * A non-interactive label used to highlight short, scannable information —
24
- * a status, a category tag, or a count — in the smallest possible footprint.
25
- *
26
- * **When to use**
27
- * - Status indicators: `Succeeded`, `Failed`, `Pending`, `Beta`.
28
- * - Category or tag chips alongside list items, table rows, or cards.
29
- * - Counts (e.g. `12 new`) when paired with brief context.
30
- *
31
- * **When not to use**
32
- * - For interactive UI. Badges are not buttons or links — use {@link https://mantle.ngrok.com/components/button Button}
33
- * or {@link https://mantle.ngrok.com/components/anchor Anchor} (optionally with `asChild` styling) instead.
34
- * - For long-form text. Keep labels to one or two short words.
35
- * - As the sole signal of meaning. Pair color with a label or icon so the
36
- * distinction works without color (color blindness, monochrome themes).
37
- *
38
- * **Choosing a `color`.** Prefer functional colors (`success`, `warning`,
39
- * `danger`, `info`, `accent`, `neutral`) for status meaning so theming
40
- * stays coherent. Reach for named hues only when the badge's semantic role
41
- * isn't already covered.
42
- *
43
- * **Polymorphism.** Pass `asChild` to render the badge as a single child
44
- * element — useful when the badge wraps a link or other semantic element
45
- * while keeping the badge styling.
46
- *
47
- * @see https://mantle.ngrok.com/components/badge
48
- *
49
- * @example
50
- * ```tsx
51
- * import { Badge } from "@ngrok/mantle/badge";
52
- * import { CheckCircleIcon } from "@phosphor-icons/react/CheckCircle";
53
- *
54
- * <Badge appearance="muted" color="success" icon={<CheckCircleIcon />}>
55
- * Succeeded
56
- * </Badge>
57
- *
58
- * // Polymorphic — render the badge as a link, preserving its styling.
59
- * <Badge appearance="muted" color="info" asChild>
60
- * <a href="/status">Operational</a>
61
- * </Badge>
62
- * ```
63
- */
64
- declare const Badge: {
65
- ({
66
- appearance,
67
- asChild,
68
- children,
69
- className,
70
- color,
71
- icon,
72
- ...props
73
- }: BadgeProps): import("react").JSX.Element;
74
- displayName: string;
75
- };
21
+ declare function Badge({ appearance, asChild, children, className, color, icon, ...props }: BadgeProps): import("react").JSX.Element;
22
+ declare namespace Badge {
23
+ var displayName: string;
24
+ }
76
25
  //#endregion
77
26
  export { Badge, type BadgeProps };
package/dist/badge.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"./slot-DT_E5BQx.js";import{Children as r,cloneElement as i,isValidElement as a}from"react";import o from"tiny-invariant";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";const u=({appearance:u,asChild:d=!1,children:p,className:h,color:g=`neutral`,icon:_,...v})=>{let y=f(g,u),b=m(g,u),x=e(`inline-flex w-fit shrink-0 cursor-default items-center gap-1 rounded px-1.5 py-0.5 font-medium text-xs font-sans`,_&&`ps-1`,y,b,h);if(d){let e=r.only(p);o(a(e),"When using `asChild`, Badge must be passed a single child as a JSX tag.");let u=e.props?.children;return c(n,{"data-slot":`badge`,className:x,...v,children:i(e,{},l(s,{children:[_&&c(t,{className:`size-4`,svg:_}),u]}))})}return l(`span`,{"data-slot":`badge`,className:x,...v,children:[_&&c(t,{className:`size-4`,svg:_}),p]})};u.displayName=`Badge`;const d={amber:`bg-amber-500/20`,blue:`bg-blue-500/20`,cyan:`bg-cyan-500/20`,emerald:`bg-emerald-500/20`,fuchsia:`bg-fuchsia-500/20`,gray:`bg-gray-500/20`,green:`bg-green-500/20`,indigo:`bg-indigo-500/20`,lime:`bg-lime-500/20`,orange:`bg-orange-500/20`,pink:`bg-pink-500/20`,purple:`bg-purple-500/20`,red:`bg-red-500/20`,rose:`bg-rose-500/20`,sky:`bg-sky-500/20`,teal:`bg-teal-500/20`,violet:`bg-violet-500/20`,yellow:`bg-yellow-500/20`,accent:`bg-accent-500/20`,danger:`bg-danger-500/20`,important:`bg-important-500/20`,info:`bg-info-500/20`,neutral:`bg-neutral-500/20`,success:`bg-success-500/20`,warning:`bg-warning-500/20`};function f(e,t){switch(t){case`muted`:return d[e];default:o(!1,`Invalid appearance: ${String(t)}`)}}const p={amber:`text-amber-700`,blue:`text-blue-700`,cyan:`text-cyan-700`,emerald:`text-emerald-700`,fuchsia:`text-fuchsia-700`,gray:`text-gray-700`,green:`text-green-700`,indigo:`text-indigo-700`,lime:`text-lime-700`,orange:`text-orange-700`,pink:`text-pink-700`,purple:`text-purple-700`,red:`text-red-700`,rose:`text-rose-700`,sky:`text-sky-700`,teal:`text-teal-700`,violet:`text-violet-700`,yellow:`text-yellow-700`,accent:`text-accent-700`,danger:`text-danger-700`,important:`text-important-700`,info:`text-info-700`,neutral:`text-neutral-700`,success:`text-success-700`,warning:`text-warning-700`};function m(e,t){switch(t){case`muted`:return p[e];default:o(!1,`Invalid appearance: ${String(t)}`)}}export{u as Badge};
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{Children as r,cloneElement as i,isValidElement as a}from"react";import o from"tiny-invariant";import{Fragment as s,jsx as c,jsxs as l}from"react/jsx-runtime";const u=({appearance:u,asChild:d=!1,children:p,className:h,color:g=`neutral`,icon:_,...v})=>{let y=f(g,u),b=m(g,u),x=e(`inline-flex w-fit shrink-0 cursor-default items-center gap-1 rounded px-1.5 py-0.5 font-medium text-xs font-sans`,_&&`ps-1`,y,b,h);if(d){let e=r.only(p);o(a(e),"When using `asChild`, Badge must be passed a single child as a JSX tag.");let u=e.props?.children;return c(n,{"data-slot":`badge`,className:x,...v,children:i(e,{},l(s,{children:[_&&c(t,{className:`size-4`,svg:_}),u]}))})}return l(`span`,{"data-slot":`badge`,className:x,...v,children:[_&&c(t,{className:`size-4`,svg:_}),p]})};u.displayName=`Badge`;const d={amber:`bg-amber-500/20`,blue:`bg-blue-500/20`,cyan:`bg-cyan-500/20`,emerald:`bg-emerald-500/20`,fuchsia:`bg-fuchsia-500/20`,gray:`bg-gray-500/20`,green:`bg-green-500/20`,indigo:`bg-indigo-500/20`,lime:`bg-lime-500/20`,orange:`bg-orange-500/20`,pink:`bg-pink-500/20`,purple:`bg-purple-500/20`,red:`bg-red-500/20`,rose:`bg-rose-500/20`,sky:`bg-sky-500/20`,teal:`bg-teal-500/20`,violet:`bg-violet-500/20`,yellow:`bg-yellow-500/20`,accent:`bg-accent-500/20`,danger:`bg-danger-500/20`,important:`bg-important-500/20`,info:`bg-info-500/20`,neutral:`bg-neutral-500/20`,success:`bg-success-500/20`,warning:`bg-warning-500/20`};function f(e,t){switch(t){case`muted`:return d[e];default:o(!1,`Invalid appearance: ${String(t)}`)}}const p={amber:`text-amber-700`,blue:`text-blue-700`,cyan:`text-cyan-700`,emerald:`text-emerald-700`,fuchsia:`text-fuchsia-700`,gray:`text-gray-700`,green:`text-green-700`,indigo:`text-indigo-700`,lime:`text-lime-700`,orange:`text-orange-700`,pink:`text-pink-700`,purple:`text-purple-700`,red:`text-red-700`,rose:`text-rose-700`,sky:`text-sky-700`,teal:`text-teal-700`,violet:`text-violet-700`,yellow:`text-yellow-700`,accent:`text-accent-700`,danger:`text-danger-700`,important:`text-important-700`,info:`text-info-700`,neutral:`text-neutral-700`,success:`text-success-700`,warning:`text-warning-700`};function m(e,t){switch(t){case`muted`:return p[e];default:o(!1,`Invalid appearance: ${String(t)}`)}}export{u as Badge};