@ngrok/mantle 0.93.6 → 0.94.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 (193) hide show
  1. package/dist/accordion.d.ts +13 -1
  2. package/dist/accordion.js +1 -1
  3. package/dist/agent.json +1181 -36
  4. package/dist/alert-CH99Rw-R.js +1 -0
  5. package/dist/{alert-BcSBNR3S.d.ts → alert-HffaioZM.d.ts} +31 -21
  6. package/dist/alert-center.d.ts +15 -3
  7. package/dist/alert-center.js +1 -1
  8. package/dist/alert-dialog.d.ts +15 -2
  9. package/dist/alert-dialog.js +1 -1
  10. package/dist/alert.d.ts +6 -1
  11. package/dist/alert.js +1 -1
  12. package/dist/anchor.d.ts +12 -0
  13. package/dist/app-layout.d.ts +16 -1
  14. package/dist/app-layout.js +1 -1
  15. package/dist/area-chart.d.ts +144 -88
  16. package/dist/area-chart.js +1 -1
  17. package/dist/avatar.d.ts +12 -0
  18. package/dist/badge.d.ts +13 -1
  19. package/dist/bar-chart.d.ts +144 -89
  20. package/dist/bar-chart.js +1 -1
  21. package/dist/breadcrumb.d.ts +11 -0
  22. package/dist/breadcrumb.js +1 -1
  23. package/dist/browser-only.d.ts +8 -0
  24. package/dist/{button-Yxyu1XMd.d.ts → button-BGwOPjGV.d.ts} +7 -1
  25. package/dist/{button-B8k98Pby.js → button-BWGUuWnu.js} +1 -1
  26. package/dist/{button-CPsKGDK0.d.ts → button-Cgf2IcEC.d.ts} +8 -1
  27. package/dist/button-Cu9e3SM7.js +1 -0
  28. package/dist/{button-BX-4lYUn.d.ts → button-K0pKc3GN.d.ts} +3 -3
  29. package/dist/button.d.ts +9 -3
  30. package/dist/button.js +1 -1
  31. package/dist/calendar.d.ts +7 -0
  32. package/dist/calendar.js +1 -1
  33. package/dist/card.d.ts +6 -1
  34. package/dist/centered-layout.d.ts +11 -0
  35. package/dist/chart-BO9EwQ60.js +1 -0
  36. package/dist/chart-CE5Uaqz9.js +1 -0
  37. package/dist/chart-DCTGGlWL.js +1 -0
  38. package/dist/chart-DudCw24t.js +2 -0
  39. package/dist/{chart-BpfbtOUN.d.ts → chart-jitNqimS.d.ts} +99 -103
  40. package/dist/{checkbox-DmSQXs26.js → checkbox-CS504fKk.js} +1 -1
  41. package/dist/checkbox.d.ts +14 -1
  42. package/dist/checkbox.js +1 -1
  43. package/dist/{choice-BLR0_MeB.d.ts → choice-BwfmbepO.d.ts} +7 -1
  44. package/dist/choice-uyYccm0A.js +1 -0
  45. package/dist/choice.d.ts +6 -1
  46. package/dist/choice.js +1 -1
  47. package/dist/code-block.d.ts +13 -2
  48. package/dist/code-block.js +1 -1
  49. package/dist/code-block_highlight-utils.d.ts +5 -0
  50. package/dist/code.d.ts +13 -0
  51. package/dist/color-CHZbU1Ww.js +1 -0
  52. package/dist/color.js +1 -1
  53. package/dist/combobox.d.ts +28 -14
  54. package/dist/combobox.js +1 -1
  55. package/dist/command.d.ts +14 -2
  56. package/dist/command.js +1 -1
  57. package/dist/cx.js +1 -1
  58. package/dist/data-table.d.ts +50 -19
  59. package/dist/data-table.js +1 -1
  60. package/dist/description-list.d.ts +12 -1
  61. package/dist/dialog-B9JAGy_x.d.ts +28 -0
  62. package/dist/{dialog-7TUgiSzX.js → dialog-CsugEt2A.js} +1 -1
  63. package/dist/{dialog-2fRO4ca4.d.ts → dialog-DD5H3EH1.d.ts} +10 -2
  64. package/dist/dialog.d.ts +7 -2
  65. package/dist/dialog.js +1 -1
  66. package/dist/dropdown-menu-DHdgaw4P.js +1 -0
  67. package/dist/{dropdown-menu-CpjRwMWe.d.ts → dropdown-menu-DmDxYPde.d.ts} +34 -26
  68. package/dist/dropdown-menu.d.ts +6 -1
  69. package/dist/dropdown-menu.js +1 -1
  70. package/dist/empty.d.ts +5 -0
  71. package/dist/empty.js +1 -1
  72. package/dist/{field-V_gnkcmN.d.ts → field-BshcNVe_.d.ts} +1 -1
  73. package/dist/field.d.ts +17 -6
  74. package/dist/field.js +1 -1
  75. package/dist/flag.d.ts +8 -0
  76. package/dist/hooks.d.ts +5 -0
  77. package/dist/hooks.js +1 -1
  78. package/dist/hover-card.d.ts +23 -12
  79. package/dist/{icon-ByLVhdYq.d.ts → icon-NYvyyRMG.d.ts} +6 -0
  80. package/dist/icon.d.ts +7 -2
  81. package/dist/icon.js +1 -1
  82. package/dist/{icons-DP3lQw5O.js → icons-4JA-SGfv.js} +1 -1
  83. package/dist/icons.d.ts +13 -1
  84. package/dist/icons.js +1 -1
  85. package/dist/{index-BhfgyurF.d.ts → index-KJ06KK6t.d.ts} +3 -3
  86. package/dist/input-BjCDSOPA.js +1 -0
  87. package/dist/input-DHovzBjS.js +1 -0
  88. package/dist/{input-Dx5owTCc.d.ts → input-q8o5uMhW.d.ts} +11 -1
  89. package/dist/input.d.ts +34 -2
  90. package/dist/input.js +1 -1
  91. package/dist/kbd.d.ts +12 -0
  92. package/dist/{label-nHqqYS7e.js → label-DmDwzPD8.js} +1 -1
  93. package/dist/{label-Dn5CPJUj.d.ts → label-r2sJcSQ4.d.ts} +6 -0
  94. package/dist/label.d.ts +6 -1
  95. package/dist/label.js +1 -1
  96. package/dist/line-chart.d.ts +139 -82
  97. package/dist/line-chart.js +1 -1
  98. package/dist/{list-RFRIQxU2.js → list-CO_yLdln.js} +1 -1
  99. package/dist/list.d.ts +19 -1
  100. package/dist/list.js +1 -1
  101. package/dist/live-region.d.ts +14 -1
  102. package/dist/llms.txt +78 -76
  103. package/dist/main.d.ts +12 -0
  104. package/dist/mantle.css +110 -65
  105. package/dist/media-object.d.ts +12 -0
  106. package/dist/migrations/0014-chart-named-colors.yml +1389 -0
  107. package/dist/migrations/0015-segmented-control.yml +788 -0
  108. package/dist/multi-select.d.ts +15 -2
  109. package/dist/multi-select.js +1 -1
  110. package/dist/otp-input.d.ts +17 -5
  111. package/dist/otp-input.js +1 -1
  112. package/dist/pagination.d.ts +92 -3
  113. package/dist/pagination.js +1 -1
  114. package/dist/popover-BhTFutCz.d.ts +1 -0
  115. package/dist/{popover-BfB2I9G0.d.ts → popover-lwkwWcRW.d.ts} +16 -7
  116. package/dist/popover.d.ts +7 -2
  117. package/dist/progress.d.ts +27 -10
  118. package/dist/progress.js +1 -1
  119. package/dist/qr-code.d.ts +9 -1
  120. package/dist/query.d.ts +2 -2
  121. package/dist/query.js +1 -1
  122. package/dist/radio-group-jj2abc0t.js +1 -0
  123. package/dist/radio-group-sLz5AA9I.d.ts +27 -0
  124. package/dist/radio-group.d.ts +20 -99
  125. package/dist/radio-group.js +1 -1
  126. package/dist/sandbar.d.ts +14 -1
  127. package/dist/sandbar.js +1 -1
  128. package/dist/sandboxed-on-click.d.ts +8 -0
  129. package/dist/scatter-plot.d.ts +126 -64
  130. package/dist/scatter-plot.js +1 -1
  131. package/dist/segmented-control.d.ts +136 -0
  132. package/dist/segmented-control.js +1 -0
  133. package/dist/{select-BkhBxtOT.d.ts → select-BqmpVJJT.d.ts} +29 -21
  134. package/dist/select-C6Su0dU0.js +1 -0
  135. package/dist/select.d.ts +6 -1
  136. package/dist/select.js +1 -1
  137. package/dist/selectable-list.d.ts +13 -2
  138. package/dist/selectable-list.js +1 -1
  139. package/dist/{separator-D9AWEkcJ.d.ts → separator-QfH0ot5K.d.ts} +3 -1
  140. package/dist/separator.d.ts +6 -1
  141. package/dist/{sheet-CSJc_sB4.js → sheet-Bd2LIhzF.js} +1 -1
  142. package/dist/sheet.d.ts +15 -2
  143. package/dist/sheet.js +1 -1
  144. package/dist/sidebar.d.ts +19 -3
  145. package/dist/sidebar.js +1 -1
  146. package/dist/skeleton.d.ts +11 -0
  147. package/dist/skip-to-main-link.d.ts +11 -0
  148. package/dist/skip-to-main-link.js +1 -1
  149. package/dist/slider.d.ts +10 -0
  150. package/dist/{slot-C0OCJjdJ.d.ts → slot-D12N_fZJ.d.ts} +3 -1
  151. package/dist/slot.d.ts +6 -1
  152. package/dist/split-button.d.ts +14 -3
  153. package/dist/split-button.js +1 -1
  154. package/dist/strata.d.ts +13 -0
  155. package/dist/switch.d.ts +13 -1
  156. package/dist/switch.js +1 -1
  157. package/dist/{table-vT6Okwfa.d.ts → table-rWiVWEgB.d.ts} +79 -0
  158. package/dist/table.d.ts +6 -1
  159. package/dist/tabs.d.ts +23 -11
  160. package/dist/tabs.js +1 -1
  161. package/dist/text-area.d.ts +11 -1
  162. package/dist/theme-DdZgLvKH.js +1 -0
  163. package/dist/theme-switcher.d.ts +16 -2
  164. package/dist/theme-switcher.js +1 -1
  165. package/dist/theme.d.ts +12 -0
  166. package/dist/theme.js +1 -1
  167. package/dist/toast.d.ts +14 -1
  168. package/dist/toast.js +1 -1
  169. package/dist/{tooltip-NcLIeBy5.d.ts → tooltip-CpK3XTor.d.ts} +15 -8
  170. package/dist/tooltip.d.ts +6 -1
  171. package/dist/truncated-text.d.ts +27 -13
  172. package/dist/truncated-text.js +1 -1
  173. package/dist/types.d.ts +1 -1
  174. package/dist/types.js +1 -1
  175. package/dist/use-inert-siblings-CNmNuS2h.js +1 -0
  176. package/dist/use-swipe-to-dismiss-i__cTF2v.js +1 -0
  177. package/dist/utils.d.ts +1 -1
  178. package/dist/utils.js +1 -1
  179. package/dist/visually-hidden.d.ts +13 -0
  180. package/dist/well.d.ts +6 -1
  181. package/package.json +7 -7
  182. package/src/components/chart/d3-license.md +25 -0
  183. package/dist/alert-P9lwn25X.js +0 -1
  184. package/dist/button-Dge0D5bl.js +0 -1
  185. package/dist/chart-BpWfQAwf.js +0 -2
  186. package/dist/choice-2Lrv8_nl.js +0 -1
  187. package/dist/dialog-Dp0QGWwo.d.ts +0 -28
  188. package/dist/dropdown-menu-BHBzCDSZ.js +0 -1
  189. package/dist/input-CpQ6jlpI.js +0 -1
  190. package/dist/popover-C96V8SXi.d.ts +0 -1
  191. package/dist/select-CAAYk4Yj.js +0 -1
  192. package/dist/theme-C-glc5Q-.js +0 -1
  193. package/dist/use-swipe-to-dismiss-DceYk1Id.js +0 -1
package/dist/slot.d.ts CHANGED
@@ -1,2 +1,7 @@
1
- import { t as Slot } from "./slot-C0OCJjdJ.js";
1
+ /**
2
+ * Re-exports for the Slot component.
3
+ *
4
+ * @see https://mantle.ngrok.com/components/primitives/slot
5
+ */
6
+ import { t as Slot } from "./slot-D12N_fZJ.js";
2
7
  export { Slot };
@@ -1,8 +1,13 @@
1
+ /**
2
+ * Re-exports for the Split Button component.
3
+ *
4
+ * @see https://mantle.ngrok.com/components/actions/split-button
5
+ */
1
6
  import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
2
- import { t as Button } from "./button-CPsKGDK0.js";
3
- import { t as IconButton } from "./button-Yxyu1XMd.js";
7
+ import { t as Button } from "./button-Cgf2IcEC.js";
8
+ import { t as IconButton } from "./button-BGwOPjGV.js";
4
9
  import { t as ButtonSize } from "./button-L4exxu_L.js";
5
- import { t as DropdownMenu } from "./dropdown-menu-CpjRwMWe.js";
10
+ import { t as DropdownMenu } from "./dropdown-menu-DmDxYPde.js";
6
11
  import { ComponentProps, ReactNode } from "react";
7
12
  type RootProps = ComponentProps<typeof DropdownMenu.Root> & ComponentProps<"div"> & {
8
13
  /**
@@ -171,6 +176,12 @@ declare const MenuItem: ({ className, ...props }: ComponentProps<typeof Dropdown
171
176
  * of related alternatives. Best for when users typically want one action but
172
177
  * occasionally need variants.
173
178
  *
179
+ * @useWhen Run a default action on one click, and offer related alternatives in an attached menu.
180
+ *
181
+ * @siblings
182
+ * - `Button`: the control runs one action, with no alternatives.
183
+ * - `DropdownMenu`: the button only opens a menu and runs no default action.
184
+ *
174
185
  * @see https://mantle.ngrok.com/components/actions/split-button
175
186
  *
176
187
  * @example
@@ -1 +1 @@
1
- import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-kK0c-POG.js";import{t as r}from"./button-Dge0D5bl.js";import{t as i}from"./button-B8k98Pby.js";import{t as a}from"./dropdown-menu-BHBzCDSZ.js";import{c as o}from"react/compiler-runtime";import{CaretDownIcon as s}from"@phosphor-icons/react/CaretDown";import{createContext as c,useContext as l}from"react";import{jsx as u}from"react/jsx-runtime";const d=c({size:`md`}),f={Root:n=>{let r=o(35),i,s,c,l,f,p,m,h,g,_,v;r[0]===n?(i=r[1],s=r[2],c=r[3],l=r[4],f=r[5],p=r[6],m=r[7],h=r[8],g=r[9],_=r[10],v=r[11]):({"data-slot":c,className:s,children:i,dir:f,open:h,defaultOpen:l,onOpenChange:m,modal:p,size:v,ref:_,...g}=n,r[0]=n,r[1]=i,r[2]=s,r[3]=c,r[4]=l,r[5]=f,r[6]=p,r[7]=m,r[8]=h,r[9]=g,r[10]=_,r[11]=v);let y=v===void 0?`md`:v,b;r[12]===y?b=r[13]:(b={size:y},r[12]=y,r[13]=b);let x=b,S;r[14]===c?S=r[15]:(S=t(c,`split-button`),r[14]=c,r[15]=S);let C;r[16]===s?C=r[17]:(C=e(`flex flex-row [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:not(:first-child)]:-ml-px [&>*:focus]:relative [&>*:focus]:z-10 [&>*:hover]:relative [&>*:hover]:z-10 *:active:scale-100!`,s),r[16]=s,r[17]=C);let w;r[18]!==i||r[19]!==g||r[20]!==_||r[21]!==y||r[22]!==S||r[23]!==C?(w=/* @__PURE__ */ u(`div`,{"data-slot":S,"data-size":y,className:C,ref:_,...g,children:i}),r[18]=i,r[19]=g,r[20]=_,r[21]=y,r[22]=S,r[23]=C,r[24]=w):w=r[24];let T;r[25]!==x||r[26]!==w?(T=/* @__PURE__ */ u(d.Provider,{value:x,children:w}),r[25]=x,r[26]=w,r[27]=T):T=r[27];let E;return r[28]!==l||r[29]!==f||r[30]!==p||r[31]!==m||r[32]!==h||r[33]!==T?(E=/* @__PURE__ */ u(a.Root,{dir:f,open:h,defaultOpen:l,onOpenChange:m,modal:p,children:T}),r[28]=l,r[29]=f,r[30]=p,r[31]=m,r[32]=h,r[33]=T,r[34]=E):E=r[34],E},PrimaryAction:e=>{let t=o(3),{size:n}=l(d),i;return t[0]!==e||t[1]!==n?(i=/* @__PURE__ */ u(r,{appearance:`outlined`,intent:`neutral`,size:n,...e}),t[0]=e,t[1]=n,t[2]=i):i=t[2],i},MenuTrigger:e=>{let t=o(9),r,c;t[0]===e?(r=t[1],c=t[2]):({icon:r,...c}=e,t[0]=e,t[1]=r,t[2]=c);let{size:f}=l(d),p;t[3]===r?p=t[4]:(p=r??/* @__PURE__ */ u(n,{svg:/* @__PURE__ */ u(s,{weight:`bold`,className:`size-4 group-data-[state=open]:-rotate-180 transition-transform duration-200 ease-out-strong motion-reduce:transition-none`})}),t[3]=r,t[4]=p);let m;return t[5]!==c||t[6]!==f||t[7]!==p?(m=/* @__PURE__ */ u(a.Trigger,{asChild:!0,className:`group`,children:/* @__PURE__ */ u(i,{icon:p,appearance:`outlined`,intent:`neutral`,size:f,...c})}),t[5]=c,t[6]=f,t[7]=p,t[8]=m):m=t[8],m},MenuContent:e=>{let t=o(6),n,r;t[0]===e?(n=t[1],r=t[2]):({align:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=r===void 0?`end`:r,s;return t[3]!==i||t[4]!==n?(s=/* @__PURE__ */ u(a.Content,{align:i,...n}),t[3]=i,t[4]=n,t[5]=s):s=t[5],s},MenuItem:t=>{let n=o(8),r,i;n[0]===t?(r=n[1],i=n[2]):({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i);let s;n[3]===r?s=n[4]:(s=e(`gap-2`,r),n[3]=r,n[4]=s);let c;return n[5]!==i||n[6]!==s?(c=/* @__PURE__ */ u(a.Item,{className:s,...i}),n[5]=i,n[6]=s,n[7]=c):c=n[7],c}};export{f as SplitButton};
1
+ import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./button-Cu9e3SM7.js";import{t as r}from"./button-BWGUuWnu.js";import{t as i}from"./dropdown-menu-DHdgaw4P.js";import{t as a}from"./icon-kK0c-POG.js";import{c as o}from"react/compiler-runtime";import{CaretDownIcon as s}from"@phosphor-icons/react/CaretDown";import{createContext as c,useContext as l}from"react";import{jsx as u}from"react/jsx-runtime";const d=c({size:`md`}),f={Root:n=>{let r=o(35),a,s,c,l,f,p,m,h,g,_,v;r[0]===n?(a=r[1],s=r[2],c=r[3],l=r[4],f=r[5],p=r[6],m=r[7],h=r[8],g=r[9],_=r[10],v=r[11]):({"data-slot":c,className:s,children:a,dir:f,open:h,defaultOpen:l,onOpenChange:m,modal:p,size:v,ref:_,...g}=n,r[0]=n,r[1]=a,r[2]=s,r[3]=c,r[4]=l,r[5]=f,r[6]=p,r[7]=m,r[8]=h,r[9]=g,r[10]=_,r[11]=v);let y=v===void 0?`md`:v,b;r[12]===y?b=r[13]:(b={size:y},r[12]=y,r[13]=b);let x=b,S;r[14]===c?S=r[15]:(S=t(c,`split-button`),r[14]=c,r[15]=S);let C;r[16]===s?C=r[17]:(C=e(`flex flex-row [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:not(:first-child)]:-ml-px [&>*:focus]:relative [&>*:focus]:z-10 [&>*:hover]:relative [&>*:hover]:z-10 *:active:scale-100!`,s),r[16]=s,r[17]=C);let w;r[18]!==a||r[19]!==g||r[20]!==_||r[21]!==y||r[22]!==S||r[23]!==C?(w=/* @__PURE__ */ u(`div`,{"data-slot":S,"data-size":y,className:C,ref:_,...g,children:a}),r[18]=a,r[19]=g,r[20]=_,r[21]=y,r[22]=S,r[23]=C,r[24]=w):w=r[24];let T;r[25]!==x||r[26]!==w?(T=/* @__PURE__ */ u(d.Provider,{value:x,children:w}),r[25]=x,r[26]=w,r[27]=T):T=r[27];let E;return r[28]!==l||r[29]!==f||r[30]!==p||r[31]!==m||r[32]!==h||r[33]!==T?(E=/* @__PURE__ */ u(i.Root,{dir:f,open:h,defaultOpen:l,onOpenChange:m,modal:p,children:T}),r[28]=l,r[29]=f,r[30]=p,r[31]=m,r[32]=h,r[33]=T,r[34]=E):E=r[34],E},PrimaryAction:e=>{let t=o(3),{size:r}=l(d),i;return t[0]!==e||t[1]!==r?(i=/* @__PURE__ */ u(n,{appearance:`outlined`,intent:`neutral`,size:r,...e}),t[0]=e,t[1]=r,t[2]=i):i=t[2],i},MenuTrigger:e=>{let t=o(9),n,c;t[0]===e?(n=t[1],c=t[2]):({icon:n,...c}=e,t[0]=e,t[1]=n,t[2]=c);let{size:f}=l(d),p;t[3]===n?p=t[4]:(p=n??/* @__PURE__ */ u(a,{svg:/* @__PURE__ */ u(s,{weight:`bold`,className:`size-4 group-data-[state=open]:-rotate-180 transition-transform duration-200 ease-out-strong motion-reduce:transition-none`})}),t[3]=n,t[4]=p);let m;return t[5]!==c||t[6]!==f||t[7]!==p?(m=/* @__PURE__ */ u(i.Trigger,{asChild:!0,className:`group`,children:/* @__PURE__ */ u(r,{icon:p,appearance:`outlined`,intent:`neutral`,size:f,...c})}),t[5]=c,t[6]=f,t[7]=p,t[8]=m):m=t[8],m},MenuContent:e=>{let t=o(6),n,r;t[0]===e?(n=t[1],r=t[2]):({align:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let a=r===void 0?`end`:r,s;return t[3]!==a||t[4]!==n?(s=/* @__PURE__ */ u(i.Content,{align:a,...n}),t[3]=a,t[4]=n,t[5]=s):s=t[5],s},MenuItem:t=>{let n=o(8),r,a;n[0]===t?(r=n[1],a=n[2]):({className:r,...a}=t,n[0]=t,n[1]=r,n[2]=a);let s;n[3]===r?s=n[4]:(s=e(`gap-2`,r),n[3]=r,n[4]=s);let c;return n[5]!==a||n[6]!==s?(c=/* @__PURE__ */ u(i.Item,{className:s,...a}),n[5]=a,n[6]=s,n[7]=c):c=n[7],c}};export{f as SplitButton};
package/dist/strata.d.ts CHANGED
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Re-exports for the Strata component.
3
+ *
4
+ * @see https://mantle.ngrok.com/components/structure/strata
5
+ */
1
6
  import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
2
7
  import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
3
8
  import { ComponentProps } from "react";
@@ -266,6 +271,14 @@ declare const Body: ({ asChild, children, className, "data-slot": dataSlot, ...p
266
271
  * [DescriptionList](https://mantle.ngrok.com/components/data-display/description-list)
267
272
  * when the pairs are read-only term/value data rather than headed sections.
268
273
  *
274
+ * @useWhen Lay out a settings page or a configuration editor as titled sections, each one explained
275
+ * beside its controls.
276
+ *
277
+ * @siblings
278
+ * - `Card`: a group needs a raised surface of its own.
279
+ * - `MediaObject`: the thing beside the text is an image or an icon.
280
+ * - `DescriptionList`: the pairs are read-only label and value data, not headed sections.
281
+ *
269
282
  * @see https://mantle.ngrok.com/components/structure/strata
270
283
  *
271
284
  * @example
package/dist/switch.d.ts CHANGED
@@ -1,5 +1,10 @@
1
+ /**
2
+ * Re-exports for the Switch component.
3
+ *
4
+ * @see https://mantle.ngrok.com/components/forms/switch
5
+ */
1
6
  import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
2
- import { o as WithValidation } from "./field-V_gnkcmN.js";
7
+ import { o as WithValidation } from "./field-BshcNVe_.js";
3
8
  import { ComponentProps } from "react";
4
9
  import { Root } from "@radix-ui/react-switch";
5
10
  type SwitchProps = ComponentProps<typeof Root> & WithValidation & {
@@ -16,6 +21,13 @@ type SwitchProps = ComponentProps<typeof Root> & WithValidation & {
16
21
  * compose it inside [`Choice`](/components/forms/choice) for a titled, multi-line
17
22
  * label with a supplementary description.
18
23
  *
24
+ * @useWhen Turn one setting on or off, such as a feature toggle in a settings list.
25
+ *
26
+ * @siblings
27
+ * - `Checkbox`: the option needs an indeterminate state.
28
+ * - `Choice`: the switch needs a title and a description beside it.
29
+ * - `ThemeSwitcher`: the setting is the light or dark theme.
30
+ *
19
31
  * @see https://mantle.ngrok.com/components/forms/switch
20
32
  *
21
33
  * @example
package/dist/switch.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./booleanish-BfvnW6vy.js";import{t as r}from"./clsx-DUGZgXfJ.js";import{a as i,r as a}from"./field-CPvjazWN.js";import{c as o}from"react/compiler-runtime";import{jsx as s}from"react/jsx-runtime";import{Root as c,Thumb as l}from"@radix-ui/react-switch";const u=u=>{let d=o(32),f,p,m,h,g,_,v,y,b;d[0]===u?(f=d[1],p=d[2],m=d[3],h=d[4],g=d[5],_=d[6],v=d[7],y=d[8],b=d[9]):({"data-slot":_,"aria-invalid":f,"aria-readonly":p,className:g,readOnly:m,onClick:v,ref:b,validation:h,...y}=u,d[0]=u,d[1]=f,d[2]=p,d[3]=m,d[4]=h,d[5]=g,d[6]=_,d[7]=v,d[8]=y,d[9]=b);let x=m??p,S;d[10]===x?S=d[11]:(S=n(x),d[10]=x,d[11]=S);let C=S,w=i(),T=h??w,E;d[12]!==f||d[13]!==T?(E=a({"aria-invalid":f,validation:T}),d[12]=f,d[13]=T,d[14]=E):E=d[14];let{ariaInvalid:D,validation:O}=E,k;d[15]===_?k=d[16]:(k=t(_,`switch`),d[15]=_,d[16]=k);let A=O||void 0,j;d[17]===g?j=d[18]:(j=e(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full outline-hidden`,`disabled:cursor-default disabled:opacity-50`,`focus-visible:border-accent-600 focus-visible:ring-focus-accent focus-visible:outline-hidden focus-visible:ring-4`,`data-state-checked:bg-accent-600 data-state-unchecked:bg-gray-400`,`data-validation-success:data-state-checked:bg-success-600 focus-visible:data-validation-success:ring-focus-success`,`data-validation-warning:data-state-checked:bg-warning-600 focus-visible:data-validation-warning:ring-focus-warning`,`data-validation-error:data-state-checked:bg-danger-600 focus-visible:data-validation-error:ring-focus-danger`,g),d[17]=g,d[18]=j);let M;d[19]!==v||d[20]!==C?(M=e=>{C?e.preventDefault():v?.(e)},d[19]=v,d[20]=C,d[21]=M):M=d[21];let N;d[22]===Symbol.for(`react.memo_cache_sentinel`)?(N=/* @__PURE__ */ s(l,{className:r(`pointer-events-none block size-4 rounded-full bg-[#fff] shadow-md ring-0 transition-transform duration-200 ease-out-strong motion-reduce:transition-none`,`data-state-checked:translate-x-4.5 data-state-unchecked:translate-x-0.5`)}),d[22]=N):N=d[22];let P;return d[23]!==D||d[24]!==y||d[25]!==C||d[26]!==b||d[27]!==k||d[28]!==A||d[29]!==j||d[30]!==M?(P=/* @__PURE__ */ s(c,{"aria-invalid":D,"aria-readonly":C,"data-slot":k,"data-validation":A,className:j,onClick:M,ref:b,...y,children:N}),d[23]=D,d[24]=y,d[25]=C,d[26]=b,d[27]=k,d[28]=A,d[29]=j,d[30]=M,d[31]=P):P=d[31],P};export{u as Switch};
1
+ import{t as e}from"./booleanish-BfvnW6vy.js";import{t}from"./clsx-DUGZgXfJ.js";import{t as n}from"./cx-CK7o_rVv.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{a as i,r as a}from"./field-CPvjazWN.js";import{c as o}from"react/compiler-runtime";import{jsx as s}from"react/jsx-runtime";import{Root as c,Thumb as l}from"@radix-ui/react-switch";const u=u=>{let d=o(32),f,p,m,h,g,_,v,y,b;d[0]===u?(f=d[1],p=d[2],m=d[3],h=d[4],g=d[5],_=d[6],v=d[7],y=d[8],b=d[9]):({"data-slot":_,"aria-invalid":f,"aria-readonly":p,className:g,readOnly:m,onClick:v,ref:b,validation:h,...y}=u,d[0]=u,d[1]=f,d[2]=p,d[3]=m,d[4]=h,d[5]=g,d[6]=_,d[7]=v,d[8]=y,d[9]=b);let x=m??p,S;d[10]===x?S=d[11]:(S=e(x),d[10]=x,d[11]=S);let C=S,w=i(),T=h??w,E;d[12]!==f||d[13]!==T?(E=a({"aria-invalid":f,validation:T}),d[12]=f,d[13]=T,d[14]=E):E=d[14];let{ariaInvalid:D,validation:O}=E,k;d[15]===_?k=d[16]:(k=r(_,`switch`),d[15]=_,d[16]=k);let A=O||void 0,j;d[17]===g?j=d[18]:(j=n(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full outline-hidden`,`disabled:cursor-default disabled:opacity-50`,`focus-visible:border-accent-600 focus-visible:ring-focus-accent focus-visible:outline-hidden focus-visible:ring-4`,`data-state-checked:bg-accent-600 data-state-unchecked:bg-gray-400`,`data-validation-success:data-state-checked:bg-success-600 focus-visible:data-validation-success:ring-focus-success`,`data-validation-warning:data-state-checked:bg-warning-600 focus-visible:data-validation-warning:ring-focus-warning`,`data-validation-error:data-state-checked:bg-danger-600 focus-visible:data-validation-error:ring-focus-danger`,g),d[17]=g,d[18]=j);let M;d[19]!==v||d[20]!==C?(M=e=>{C?e.preventDefault():v?.(e)},d[19]=v,d[20]=C,d[21]=M):M=d[21];let N;d[22]===Symbol.for(`react.memo_cache_sentinel`)?(N=/* @__PURE__ */ s(l,{className:t(`pointer-events-none block size-4 rounded-full bg-[#fff] shadow-md ring-0 transition-transform duration-200 ease-out-strong motion-reduce:transition-none`,`data-state-checked:translate-x-4.5 data-state-unchecked:translate-x-0.5`)}),d[22]=N):N=d[22];let P;return d[23]!==D||d[24]!==y||d[25]!==C||d[26]!==b||d[27]!==k||d[28]!==A||d[29]!==j||d[30]!==M?(P=/* @__PURE__ */ s(c,{"aria-invalid":D,"aria-readonly":C,"data-slot":k,"data-validation":A,className:j,onClick:M,ref:b,...y,children:N}),d[23]=D,d[24]=y,d[25]=C,d[26]=b,d[27]=k,d[28]=A,d[29]=j,d[30]=M,d[31]=P):P=d[31],P};export{u as Switch};
@@ -40,6 +40,67 @@ import { ComponentProps } from "react";
40
40
  * </Table.Root>
41
41
  * ```
42
42
  *
43
+ * @example
44
+ * Paginated, with the count line and a page-size select:
45
+ * ```tsx
46
+ * import {
47
+ * CursorPagination,
48
+ * PaginationRange,
49
+ * getOffsetPaginatedSlice,
50
+ * useOffsetPagination,
51
+ * } from "@ngrok/mantle/pagination";
52
+ * import { Table } from "@ngrok/mantle/table";
53
+ *
54
+ * function InvoicesTable({ invoices }: { invoices: Invoice[] }) {
55
+ * const pagination = useOffsetPagination({ listSize: invoices.length, pageSize: 20 });
56
+ * const pageInvoices = getOffsetPaginatedSlice(invoices, pagination);
57
+ *
58
+ * return (
59
+ * <div className="flex flex-col gap-4">
60
+ * <Table.Root>
61
+ * <Table.Element>
62
+ * <Table.Head>
63
+ * <Table.Row>
64
+ * <Table.Header>Invoice</Table.Header>
65
+ * <Table.Header className="text-right">Amount</Table.Header>
66
+ * </Table.Row>
67
+ * </Table.Head>
68
+ * <Table.Body>
69
+ * {pageInvoices.map((invoice) => (
70
+ * <Table.Row key={invoice.invoice}>
71
+ * <Table.Cell>{invoice.invoice}</Table.Cell>
72
+ * <Table.Cell className="text-right">{invoice.totalAmount}</Table.Cell>
73
+ * </Table.Row>
74
+ * ))}
75
+ * </Table.Body>
76
+ * </Table.Element>
77
+ * </Table.Root>
78
+ * <CursorPagination.Root
79
+ * className="flex flex-wrap justify-between"
80
+ * pageSize={pagination.pageSize}
81
+ * onChangePageSize={pagination.setPageSize}
82
+ * >
83
+ * <PaginationRange
84
+ * offset={pagination.offset}
85
+ * pageSize={pagination.pageSize}
86
+ * total={invoices.length}
87
+ * noun={{ singular: "invoice", plural: "invoices" }}
88
+ * />
89
+ * <div className="flex items-center gap-2">
90
+ * <CursorPagination.PageSizeSelect />
91
+ * <CursorPagination.Buttons
92
+ * hasPreviousPage={pagination.hasPreviousPage}
93
+ * hasNextPage={pagination.hasNextPage}
94
+ * onPreviousPage={pagination.previousPage}
95
+ * onNextPage={pagination.nextPage}
96
+ * />
97
+ * </div>
98
+ * </CursorPagination.Root>
99
+ * </div>
100
+ * );
101
+ * }
102
+ * ```
103
+ *
43
104
  * `ref` lands on the inner scroll container, so a consumer can read or set its
44
105
  * scroll position. Every other prop lands on the outer element.
45
106
  *
@@ -455,6 +516,24 @@ declare const Caption: ({ "data-slot": dataSlot, children, className, ref, ...pr
455
516
  * For INTERACTIVE tabular data with sorting / filtering / pagination / row
456
517
  * selection, use `DataTable` (built on TanStack Table) instead.
457
518
  *
519
+ * **Large lists.** Each rendered row costs mount and layout time, so a table
520
+ * that renders every row of a large list blocks input while it mounts:
521
+ * - Paginate a list that can grow past 100 rows, and show 100 rows or fewer on
522
+ * a page. Slice the rows with `useOffsetPagination` and
523
+ * `getOffsetPaginatedSlice`, and compose `CursorPagination` with
524
+ * `PaginationRange` under the table, as the paginated example below shows.
525
+ * - Search and filter the whole list, then paginate the result. Pass the
526
+ * filtered length as `listSize`, so a new filter returns to the first page.
527
+ * - Paginate before you virtualize. A page of 100 rows mounts fast, and the
528
+ * browser's find in page still sees every row on it.
529
+ *
530
+ * @useWhen Show static rows and columns of data, such as a read-only data dump, with no sorting,
531
+ * filtering, or pagination.
532
+ *
533
+ * @siblings
534
+ * - `DataTable`: the user sorts, filters, pages through, or selects the rows.
535
+ * - `DescriptionList`: one record shows as label and value pairs.
536
+ *
458
537
  * @see https://mantle.ngrok.com/components/data-display/table
459
538
  *
460
539
  * @example
package/dist/table.d.ts CHANGED
@@ -1,2 +1,7 @@
1
- import { t as Table } from "./table-vT6Okwfa.js";
1
+ /**
2
+ * Re-exports for the Table component.
3
+ *
4
+ * @see https://mantle.ngrok.com/components/data-display/table
5
+ */
6
+ import { t as Table } from "./table-rWiVWEgB.js";
2
7
  export { Table };
package/dist/tabs.d.ts CHANGED
@@ -1,8 +1,13 @@
1
+ /**
2
+ * Re-exports for the Tabs component.
3
+ *
4
+ * @see https://mantle.ngrok.com/components/navigation/tabs
5
+ */
1
6
  import { t as SelfClosingWithAsChild } from "./as-child-DFxX3U2i.js";
2
7
  import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
3
- import { n as Separator } from "./separator-D9AWEkcJ.js";
8
+ import { n as Separator } from "./separator-QfH0ot5K.js";
4
9
  import { ComponentProps } from "react";
5
- import { Content, List, Root, Trigger } from "@radix-ui/react-tabs";
10
+ import { Content as Content$1, List as List$1, Root as Root$1, Trigger as Trigger$1 } from "@radix-ui/react-tabs";
6
11
  /**
7
12
  * Layered sections of content, called tab panels, that show one at a time.
8
13
  * The outermost part; it owns `orientation` and `appearance`. It stamps both as
@@ -46,7 +51,7 @@ import { Content, List, Root, Trigger } from "@radix-ui/react-tabs";
46
51
  * </Tabs.Root>
47
52
  * ```
48
53
  */
49
- declare const Root$1: ({ className, children, "data-slot": dataSlot, onValueChange, orientation, appearance, ...props }: ComponentProps<typeof Root> & WithDataSlot & {
54
+ declare const Root: ({ className, children, "data-slot": dataSlot, onValueChange, orientation, appearance, ...props }: ComponentProps<typeof Root$1> & WithDataSlot & {
50
55
  /**
51
56
  * The appearance of the tabs. Classic appearance shows the tab
52
57
  * list with an underline; pill appearance shows each tab as a pill.
@@ -82,7 +87,7 @@ declare const Root$1: ({ className, children, "data-slot": dataSlot, onValueChan
82
87
  * </Tabs.Root>
83
88
  * ```
84
89
  */
85
- declare const List$1: ({ className, "data-slot": dataSlot, ref, ...props }: ComponentProps<typeof List> & WithDataSlot) => import("react").JSX.Element;
90
+ declare const List: ({ className, "data-slot": dataSlot, ref, ...props }: ComponentProps<typeof List$1> & WithDataSlot) => import("react").JSX.Element;
86
91
  type TabsSeparatorProps = Omit<ComponentProps<typeof Separator>, "asChild" | "children" | "orientation"> & SelfClosingWithAsChild & WithDataSlot;
87
92
  /**
88
93
  * The hairline between the list and the content, in the `separator` color
@@ -129,7 +134,7 @@ type TabsSeparatorProps = Omit<ComponentProps<typeof Separator>, "asChild" | "ch
129
134
  * ```
130
135
  */
131
136
  declare const TabsSeparator: ({ className, "data-slot": dataSlot, ...props }: TabsSeparatorProps) => import("react").JSX.Element;
132
- type TabsTriggerProps = ComponentProps<typeof Trigger> & WithDataSlot;
137
+ type TabsTriggerProps = ComponentProps<typeof Trigger$1> & WithDataSlot;
133
138
  /**
134
139
  * The button that activates its associated content.
135
140
  *
@@ -176,7 +181,7 @@ type TabsTriggerProps = ComponentProps<typeof Trigger> & WithDataSlot;
176
181
  * </Tabs.Root>
177
182
  * ```
178
183
  */
179
- declare const Trigger$1: ({ "aria-disabled": _ariaDisabled, asChild, children, className, "data-slot": dataSlot, disabled: _disabled, onClick, onMouseDown, ref, ...props }: TabsTriggerProps) => import("react").JSX.Element;
184
+ declare const Trigger: ({ "aria-disabled": _ariaDisabled, asChild, children, className, "data-slot": dataSlot, disabled: _disabled, onClick, onMouseDown, ref, ...props }: TabsTriggerProps) => import("react").JSX.Element;
180
185
  /**
181
186
  * A badge to render inside a tab trigger, typically a count or a status indicator.
182
187
  *
@@ -233,10 +238,17 @@ declare const Badge: ({ className, children, "data-slot": dataSlot, ...props }:
233
238
  * </Tabs.Root>
234
239
  * ```
235
240
  */
236
- declare const Content$1: ({ className, "data-slot": dataSlot, ...props }: ComponentProps<typeof Content> & WithDataSlot) => import("react").JSX.Element;
241
+ declare const Content: ({ className, "data-slot": dataSlot, ...props }: ComponentProps<typeof Content$1> & WithDataSlot) => import("react").JSX.Element;
237
242
  /**
238
243
  * Layered sections of content, called tab panels, that show one at a time.
239
244
  *
245
+ * @useWhen Switch between peer views of related content in one place, with one view visible at a
246
+ * time.
247
+ *
248
+ * @siblings
249
+ * - `Accordion`: several sections stack, and each one expands in place.
250
+ * - `RadioGroup`: the user picks a form value, not a view.
251
+ *
240
252
  * @see https://mantle.ngrok.com/components/navigation/tabs
241
253
  *
242
254
  * @example
@@ -302,7 +314,7 @@ declare const Tabs: {
302
314
  * </Tabs.Root>
303
315
  * ```
304
316
  */
305
- readonly Root: typeof Root$1;
317
+ readonly Root: typeof Root;
306
318
  /**
307
319
  * Contains the content associated with each trigger.
308
320
  * It renders when that trigger is active.
@@ -330,7 +342,7 @@ declare const Tabs: {
330
342
  * </Tabs.Root>
331
343
  * ```
332
344
  */
333
- readonly Content: typeof Content$1;
345
+ readonly Content: typeof Content;
334
346
  /**
335
347
  * Contains the triggers that are aligned along the edge of the active content.
336
348
  * The list draws no border of its own: compose `Tabs.Separator` after it for
@@ -356,7 +368,7 @@ declare const Tabs: {
356
368
  * </Tabs.Root>
357
369
  * ```
358
370
  */
359
- readonly List: typeof List$1;
371
+ readonly List: typeof List;
360
372
  /**
361
373
  * The hairline between the list and the content, in the `separator` color
362
374
  * token. Compose it directly after `Tabs.List`. It follows the root's
@@ -426,7 +438,7 @@ declare const Tabs: {
426
438
  * </Tabs.Root>
427
439
  * ```
428
440
  */
429
- readonly Trigger: typeof Trigger$1;
441
+ readonly Trigger: typeof Trigger;
430
442
  /**
431
443
  * A badge to render inside a tab trigger, typically a count or a status indicator.
432
444
  *
package/dist/tabs.js CHANGED
@@ -1 +1 @@
1
- import{n as e}from"./compose-refs-sFdxsL7k.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./booleanish-BfvnW6vy.js";import{t as i}from"./clsx-DUGZgXfJ.js";import{n as a}from"./separator-DfzxVutO.js";import{t as o}from"./use-prefers-reduced-motion-CU6mWmOe.js";import{c as s}from"react/compiler-runtime";import{Children as c,cloneElement as l,createContext as u,isValidElement as d,useContext as f,useEffect as p,useRef as m}from"react";import h from"tiny-invariant";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import{cva as y}from"class-variance-authority";import{Content as b,List as x,Root as S,Trigger as C}from"@radix-ui/react-tabs";const w=u(null);function T(e){let t=f(w);return h(t!=null,`${e} must be rendered inside Tabs.Root.`),t}const E=e=>{let r=s(29),i,a,o,c,l,u,d;r[0]===e?(i=r[1],a=r[2],o=r[3],c=r[4],l=r[5],u=r[6],d=r[7]):({className:a,children:i,"data-slot":o,onValueChange:c,orientation:u,appearance:d,...l}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=c,r[5]=l,r[6]=u,r[7]=d);let f=u===void 0?`horizontal`:u,p=d===void 0?`classic`:d,h;r[8]!==p||r[9]!==f?(h={orientation:f,appearance:p},r[8]=p,r[9]=f,r[10]=h):h=r[10];let g=h,v=m(null),y;r[11]===c?y=r[12]:(y=e=>{e!==v.current&&(v.current=e,queueMicrotask(()=>{v.current=null}),c?.(e))},r[11]=c,r[12]=y);let b=y,x;r[13]===o?x=r[14]:(x=n(o,`tabs`),r[13]=o,r[14]=x);let C=f===`horizontal`?`flex-col`:`flex-row`,T;r[15]!==a||r[16]!==C?(T=t(`flex [--tabs-gap:--spacing(4)] gap-(--tabs-gap)`,C,a),r[15]=a,r[16]=C,r[17]=T):T=r[17];let E;r[18]!==p||r[19]!==i||r[20]!==b||r[21]!==f||r[22]!==l||r[23]!==x||r[24]!==T?(E=/* @__PURE__ */ _(S,{"data-slot":x,"data-appearance":p,className:T,orientation:f,onValueChange:b,...l,children:i}),r[18]=p,r[19]=i,r[20]=b,r[21]=f,r[22]=l,r[23]=x,r[24]=T,r[25]=E):E=r[25];let D;return r[26]!==g||r[27]!==E?(D=/* @__PURE__ */ _(w.Provider,{value:g,children:E}),r[26]=g,r[27]=E,r[28]=D):D=r[28],D},D=y(`flex`,{variants:{orientation:{horizontal:`scroll-fade-x flex-row items-center overflow-x-auto overscroll-x-none self-stretch min-w-0 pt-1 -mt-1 px-1 -mx-1`,vertical:`flex-col items-end gap-3.5 self-stretch`},appearance:{classic:``,pill:``}},compoundVariants:[{orientation:`horizontal`,appearance:`pill`,className:`gap-1 pb-1 -mb-1`},{orientation:`horizontal`,appearance:`classic`,className:`gap-6`}]}),O=r=>{let i=s(20),a,c,l,u;i[0]===r?(a=i[1],c=i[2],l=i[3],u=i[4]):({className:a,"data-slot":c,ref:u,...l}=r,i[0]=r,i[1]=a,i[2]=c,i[3]=l,i[4]=u);let{orientation:d,appearance:f}=T(`Tabs.List`),h=m(null),g=e(h,u),v,y;i[5]===d?(v=i[6],y=i[7]):(v=()=>{let e=h.current;if(!e||d!==`horizontal`)return;let t=new AbortController,{signal:n}=t,r=!1;e.addEventListener(`pointerdown`,()=>{r=!0},{signal:n});let i=()=>{r=!1};return e.addEventListener(`pointerup`,()=>setTimeout(i),{signal:n}),e.addEventListener(`pointercancel`,i,{signal:n}),e.addEventListener(`keydown`,i,{signal:n}),e.addEventListener(`focusin`,t=>{if(!r&&t.target instanceof Element&&t.target!==e){let e=o()?`auto`:`smooth`;t.target.scrollIntoView({behavior:e,inline:`center`,block:`nearest`})}},{signal:n}),()=>{t.abort()}},y=[d],i[5]=d,i[6]=v,i[7]=y),p(v,y);let b;i[8]===c?b=i[9]:(b=n(c,`tabs-list`),i[8]=c,i[9]=b);let S;i[10]!==f||i[11]!==a||i[12]!==d?(S=t(D({orientation:d,appearance:f}),a),i[10]=f,i[11]=a,i[12]=d,i[13]=S):S=i[13];let C;return i[14]!==g||i[15]!==d||i[16]!==l||i[17]!==b||i[18]!==S?(C=/* @__PURE__ */ _(x,{"aria-orientation":d,"data-slot":b,className:S,ref:g,...l}),i[14]=g,i[15]=d,i[16]=l,i[17]=b,i[18]=S,i[19]=C):C=i[19],C},k=e=>{let r=s(14),i,o,c;r[0]===e?(i=r[1],o=r[2],c=r[3]):({className:i,"data-slot":o,...c}=e,r[0]=e,r[1]=i,r[2]=o,r[3]=c);let{orientation:l}=T(`Tabs.Separator`),u=l===`horizontal`?`[[data-slot~=tabs]>&]:-mt-(--tabs-gap)`:`h-auto self-stretch [[data-slot~=tabs]>&]:-ml-(--tabs-gap)`,d;r[4]===o?d=r[5]:(d=n(o,`tabs-separator`),r[4]=o,r[5]=d);let f;r[6]!==i||r[7]!==u?(f=t(u,i),r[6]=i,r[7]=u,r[8]=f):f=r[8];let p;return r[9]!==l||r[10]!==c||r[11]!==d||r[12]!==f?(p=/* @__PURE__ */ _(a,{"data-slot":d,orientation:l,className:f,...c}),r[9]=l,r[10]=c,r[11]=d,r[12]=f,r[13]=p):p=r[13],p},A=y(`absolute z-0`,{variants:{orientation:{horizontal:`bottom-0 left-0 right-0 h-0.75`,vertical:`-right-px bottom-0 top-0 w-0.75`},appearance:{classic:`group-data-state-active/tab-trigger:bg-neutral-950`,pill:`hidden`}}}),j=()=>{let e=s(5),{orientation:t,appearance:n}=T(`Tabs.Trigger`),r;e[0]!==n||e[1]!==t?(r=i(A({orientation:t,appearance:n})),e[0]=n,e[1]=t,e[2]=r):r=e[2];let a;return e[3]===r?a=e[4]:(a=/* @__PURE__ */ _(`span`,{"aria-hidden":!0,className:r}),e[3]=r,e[4]=a),a},M=y(t(`group/tab-trigger relative flex cursor-pointer select-none items-center gap-1 whitespace-nowrap py-3 text-sm font-medium text-gray-600`,`ring-focus-accent outline-hidden`,`aria-disabled:cursor-default aria-disabled:opacity-50`,`focus-visible:ring-4`,`[&>[data-slot=tabs-trigger-label]>svg]:shrink-0 [&>[data-slot=tabs-trigger-label]>svg]:size-5`,`not-aria-disabled:hover:text-gray-900`),{variants:{orientation:{horizontal:`rounded-tl-md rounded-tr-md`,vertical:`rounded-bl-md rounded-tl-md pr-3`},appearance:{classic:t(`not-aria-disabled:hover:data-state-active:text-strong`,`data-state-active:text-strong`),pill:t(`not-aria-disabled:hover:data-state-active:text-strong`,`not-aria-disabled:hover:data-state-active:bg-neutral-500/15`,`data-state-active:text-strong`,`data-state-active:bg-neutral-500/15`,`rounded-full py-2 px-3`)}}}),N={Root:E,Content:e=>{let r=s(12),i,a,o;r[0]===e?(i=r[1],a=r[2],o=r[3]):({className:i,"data-slot":a,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o);let c;r[4]===a?c=r[5]:(c=n(a,`tabs-content`),r[4]=a,r[5]=c);let l;r[6]===i?l=r[7]:(l=t(`focus-visible:ring-focus-accent outline-hidden focus-visible:ring-4`,i),r[6]=i,r[7]=l);let u;return r[8]!==o||r[9]!==c||r[10]!==l?(u=/* @__PURE__ */ _(b,{"data-slot":c,className:l,...o}),r[8]=o,r[9]=c,r[10]=l,r[11]=u):u=r[11],u},List:O,Separator:k,Trigger:e=>{let i=s(54),a,o,u,f,p,y,b,x,S,w;i[0]===e?(a=i[1],o=i[2],u=i[3],f=i[4],p=i[5],y=i[6],b=i[7],x=i[8],S=i[9],w=i[10]):({"aria-disabled":a,asChild:w,children:u,className:f,"data-slot":p,disabled:o,onClick:y,onMouseDown:b,ref:S,...x}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=u,i[4]=f,i[5]=p,i[6]=y,i[7]=b,i[8]=x,i[9]=S,i[10]=w);let E=w!==void 0&&w,{orientation:D,appearance:O}=T(`Tabs.Trigger`),k=a??o,A;i[11]===k?A=i[12]:(A=r(k),i[11]=k,i[12]=A);let N=A,P=m(!1),F=a??o,I;i[13]!==O||i[14]!==f||i[15]!==D?(I=t(M({orientation:D,appearance:O}),f),i[13]=O,i[14]=f,i[15]=D,i[16]=I):I=i[16];let L;i[17]===p?L=i[18]:(L=n(p,`tabs-trigger`),i[17]=p,i[18]=L);let R;i[19]!==N||i[20]!==y?(R=e=>{if(y?.(e),e.defaultPrevented||N||!e.currentTarget.matches(`a[href]`)||e.button!==0||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;let t=e.currentTarget;t.focus({focusVisible:!1}),P.current=!0,t.dispatchEvent(new MouseEvent(`mousedown`,{bubbles:!0,button:0})),P.current=!1},i[19]=N,i[20]=y,i[21]=R):R=i[21];let z;i[22]!==N||i[23]!==b?(z=e=>{P.current||(b?.(e),!(e.defaultPrevented||N)&&(e.currentTarget.matches(`a[href]`)?e.preventDefault():e.button===0&&!e.ctrlKey&&e.currentTarget.focus({focusVisible:!1})))},i[22]=N,i[23]=b,i[24]=z):z=i[24];let B;i[25]!==N||i[26]!==x||i[27]!==F||i[28]!==I||i[29]!==L||i[30]!==R||i[31]!==z?(B={"aria-disabled":F,className:I,"data-slot":L,disabled:N,onClick:R,onMouseDown:z,...x},i[25]=N,i[26]=x,i[27]=F,i[28]=I,i[29]=L,i[30]=R,i[31]=z,i[32]=B):B=i[32];let V=B;if(E){let e;i[33]===u?e=i[34]:(e=c.only(u),h(d(e),"When using `asChild`, TabsTrigger must be passed a single child as a JSX tag."),i[33]=u,i[34]=e);let t=e.props?.children,n;if(i[35]!==N||i[36]!==t||i[37]!==S||i[38]!==e||i[39]!==V){let r=N?{href:void 0,to:void 0}:{},a;i[41]!==N||i[42]!==e?(a=N?/* @__PURE__ */ _(`button`,{type:`button`}):e,i[41]=N,i[42]=e,i[43]=a):a=i[43];let o;i[44]===Symbol.for(`react.memo_cache_sentinel`)?(o=/* @__PURE__ */ _(j,{}),i[44]=o):o=i[44];let s;i[45]===t?s=i[46]:(s=/* @__PURE__ */ v(g,{children:[o,/* @__PURE__ */ _(`span`,{"data-slot":`tabs-trigger-label`,className:`contents`,children:t})]}),i[45]=t,i[46]=s),n=/* @__PURE__ */ _(C,{asChild:!0,...V,ref:S,children:l(a,r,s)}),i[35]=N,i[36]=t,i[37]=S,i[38]=e,i[39]=V,i[40]=n}else n=i[40];return n}let H;i[47]===Symbol.for(`react.memo_cache_sentinel`)?(H=/* @__PURE__ */ _(j,{}),i[47]=H):H=i[47];let U;i[48]===u?U=i[49]:(U=/* @__PURE__ */ _(`span`,{"data-slot":`tabs-trigger-label`,className:`contents`,children:u}),i[48]=u,i[49]=U);let W;return i[50]!==S||i[51]!==U||i[52]!==V?(W=/* @__PURE__ */ v(C,{ref:S,...V,children:[H,U]}),i[50]=S,i[51]=U,i[52]=V,i[53]=W):W=i[53],W},Badge:e=>{let r=s(14),i,a,o,c;r[0]===e?(i=r[1],a=r[2],o=r[3],c=r[4]):({className:a,children:i,"data-slot":o,...c}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=c);let l;r[5]===o?l=r[6]:(l=n(o,`tabs-badge`),r[5]=o,r[6]=l);let u;r[7]===a?u=r[8]:(u=t(`rounded-full bg-neutral-500/20 px-1.5 text-xs font-medium text-gray-600`,`group-data-state-active/tab-trigger:bg-neutral-950/10 group-data-state-active/tab-trigger:text-strong group-hover/tab-trigger:group-enabled/tab-trigger:group-data-state-active/tab-trigger:text-strong`,`group-hover/tab-trigger:group-enabled/tab-trigger:text-gray-700`,a),r[7]=a,r[8]=u);let d;return r[9]!==i||r[10]!==c||r[11]!==l||r[12]!==u?(d=/* @__PURE__ */ _(`span`,{"data-slot":l,className:u,...c,children:i}),r[9]=i,r[10]=c,r[11]=l,r[12]=u,r[13]=d):d=r[13],d}};export{N as Tabs};
1
+ import{t as e}from"./booleanish-BfvnW6vy.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./clsx-DUGZgXfJ.js";import{t as i}from"./cx-CK7o_rVv.js";import{t as a}from"./use-prefers-reduced-motion-CU6mWmOe.js";import{n as o}from"./separator-DfzxVutO.js";import{c as s}from"react/compiler-runtime";import{Children as c,cloneElement as l,createContext as u,isValidElement as d,useContext as f,useEffect as p,useRef as m}from"react";import h from"tiny-invariant";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";import{cva as y}from"class-variance-authority";import{Content as b,List as x,Root as S,Trigger as C}from"@radix-ui/react-tabs";const w=u(null);function T(e){let t=f(w);return h(t!=null,`${e} must be rendered inside Tabs.Root.`),t}const E=e=>{let t=s(29),r,a,o,c,l,u,d;t[0]===e?(r=t[1],a=t[2],o=t[3],c=t[4],l=t[5],u=t[6],d=t[7]):({className:a,children:r,"data-slot":o,onValueChange:c,orientation:u,appearance:d,...l}=e,t[0]=e,t[1]=r,t[2]=a,t[3]=o,t[4]=c,t[5]=l,t[6]=u,t[7]=d);let f=u===void 0?`horizontal`:u,p=d===void 0?`classic`:d,h;t[8]!==p||t[9]!==f?(h={orientation:f,appearance:p},t[8]=p,t[9]=f,t[10]=h):h=t[10];let g=h,v=m(null),y;t[11]===c?y=t[12]:(y=e=>{e!==v.current&&(v.current=e,queueMicrotask(()=>{v.current=null}),c?.(e))},t[11]=c,t[12]=y);let b=y,x;t[13]===o?x=t[14]:(x=n(o,`tabs`),t[13]=o,t[14]=x);let C=f===`horizontal`?`flex-col`:`flex-row`,T;t[15]!==a||t[16]!==C?(T=i(`flex [--tabs-gap:--spacing(4)] gap-(--tabs-gap)`,C,a),t[15]=a,t[16]=C,t[17]=T):T=t[17];let E;t[18]!==p||t[19]!==r||t[20]!==b||t[21]!==f||t[22]!==l||t[23]!==x||t[24]!==T?(E=/* @__PURE__ */ _(S,{"data-slot":x,"data-appearance":p,className:T,orientation:f,onValueChange:b,...l,children:r}),t[18]=p,t[19]=r,t[20]=b,t[21]=f,t[22]=l,t[23]=x,t[24]=T,t[25]=E):E=t[25];let D;return t[26]!==g||t[27]!==E?(D=/* @__PURE__ */ _(w.Provider,{value:g,children:E}),t[26]=g,t[27]=E,t[28]=D):D=t[28],D},D=y(`flex`,{variants:{orientation:{horizontal:`scroll-fade-x flex-row items-center overflow-x-auto overscroll-x-none self-stretch min-w-0 pt-1 -mt-1 px-1 -mx-1`,vertical:`flex-col items-end gap-3.5 self-stretch`},appearance:{classic:``,pill:``}},compoundVariants:[{orientation:`horizontal`,appearance:`pill`,className:`gap-1 pb-1 -mb-1`},{orientation:`horizontal`,appearance:`classic`,className:`gap-6`}]}),O=e=>{let r=s(20),o,c,l,u;r[0]===e?(o=r[1],c=r[2],l=r[3],u=r[4]):({className:o,"data-slot":c,ref:u,...l}=e,r[0]=e,r[1]=o,r[2]=c,r[3]=l,r[4]=u);let{orientation:d,appearance:f}=T(`Tabs.List`),h=m(null),g=t(h,u),v,y;r[5]===d?(v=r[6],y=r[7]):(v=()=>{let e=h.current;if(!e||d!==`horizontal`)return;let t=new AbortController,{signal:n}=t,r=!1;e.addEventListener(`pointerdown`,()=>{r=!0},{signal:n});let i=()=>{r=!1};return e.addEventListener(`pointerup`,()=>setTimeout(i),{signal:n}),e.addEventListener(`pointercancel`,i,{signal:n}),e.addEventListener(`keydown`,i,{signal:n}),e.addEventListener(`focusin`,t=>{if(!r&&t.target instanceof Element&&t.target!==e){let e=a()?`auto`:`smooth`;t.target.scrollIntoView({behavior:e,inline:`center`,block:`nearest`})}},{signal:n}),()=>{t.abort()}},y=[d],r[5]=d,r[6]=v,r[7]=y),p(v,y);let b;r[8]===c?b=r[9]:(b=n(c,`tabs-list`),r[8]=c,r[9]=b);let S;r[10]!==f||r[11]!==o||r[12]!==d?(S=i(D({orientation:d,appearance:f}),o),r[10]=f,r[11]=o,r[12]=d,r[13]=S):S=r[13];let C;return r[14]!==g||r[15]!==d||r[16]!==l||r[17]!==b||r[18]!==S?(C=/* @__PURE__ */ _(x,{"aria-orientation":d,"data-slot":b,className:S,ref:g,...l}),r[14]=g,r[15]=d,r[16]=l,r[17]=b,r[18]=S,r[19]=C):C=r[19],C},k=e=>{let t=s(14),r,a,c;t[0]===e?(r=t[1],a=t[2],c=t[3]):({className:r,"data-slot":a,...c}=e,t[0]=e,t[1]=r,t[2]=a,t[3]=c);let{orientation:l}=T(`Tabs.Separator`),u=l===`horizontal`?`[[data-slot~=tabs]>&]:-mt-(--tabs-gap)`:`h-auto self-stretch [[data-slot~=tabs]>&]:-ml-(--tabs-gap)`,d;t[4]===a?d=t[5]:(d=n(a,`tabs-separator`),t[4]=a,t[5]=d);let f;t[6]!==r||t[7]!==u?(f=i(u,r),t[6]=r,t[7]=u,t[8]=f):f=t[8];let p;return t[9]!==l||t[10]!==c||t[11]!==d||t[12]!==f?(p=/* @__PURE__ */ _(o,{"data-slot":d,orientation:l,className:f,...c}),t[9]=l,t[10]=c,t[11]=d,t[12]=f,t[13]=p):p=t[13],p},A=y(`absolute z-0`,{variants:{orientation:{horizontal:`bottom-0 left-0 right-0 h-0.75`,vertical:`-right-px bottom-0 top-0 w-0.75`},appearance:{classic:`group-data-state-active/tab-trigger:bg-neutral-950`,pill:`hidden`}}}),j=()=>{let e=s(5),{orientation:t,appearance:n}=T(`Tabs.Trigger`),i;e[0]!==n||e[1]!==t?(i=r(A({orientation:t,appearance:n})),e[0]=n,e[1]=t,e[2]=i):i=e[2];let a;return e[3]===i?a=e[4]:(a=/* @__PURE__ */ _(`span`,{"aria-hidden":!0,className:i}),e[3]=i,e[4]=a),a},M=y(i(`group/tab-trigger relative flex cursor-pointer select-none items-center gap-1 whitespace-nowrap py-3 text-sm font-medium text-gray-600`,`ring-focus-accent outline-hidden`,`aria-disabled:cursor-default aria-disabled:opacity-50`,`focus-visible:ring-4`,`[&>[data-slot=tabs-trigger-label]>svg]:shrink-0 [&>[data-slot=tabs-trigger-label]>svg]:size-5`,`not-aria-disabled:hover:text-gray-900`),{variants:{orientation:{horizontal:`rounded-tl-md rounded-tr-md`,vertical:`rounded-bl-md rounded-tl-md pr-3`},appearance:{classic:i(`not-aria-disabled:hover:data-state-active:text-strong`,`data-state-active:text-strong`),pill:i(`not-aria-disabled:hover:data-state-active:text-strong`,`not-aria-disabled:hover:data-state-active:bg-neutral-500/15`,`data-state-active:text-strong`,`data-state-active:bg-neutral-500/15`,`rounded-full py-2 px-3`)}}}),N={Root:E,Content:e=>{let t=s(12),r,a,o;t[0]===e?(r=t[1],a=t[2],o=t[3]):({className:r,"data-slot":a,...o}=e,t[0]=e,t[1]=r,t[2]=a,t[3]=o);let c;t[4]===a?c=t[5]:(c=n(a,`tabs-content`),t[4]=a,t[5]=c);let l;t[6]===r?l=t[7]:(l=i(`focus-visible:ring-focus-accent outline-hidden focus-visible:ring-4`,r),t[6]=r,t[7]=l);let u;return t[8]!==o||t[9]!==c||t[10]!==l?(u=/* @__PURE__ */ _(b,{"data-slot":c,className:l,...o}),t[8]=o,t[9]=c,t[10]=l,t[11]=u):u=t[11],u},List:O,Separator:k,Trigger:t=>{let r=s(54),a,o,u,f,p,y,b,x,S,w;r[0]===t?(a=r[1],o=r[2],u=r[3],f=r[4],p=r[5],y=r[6],b=r[7],x=r[8],S=r[9],w=r[10]):({"aria-disabled":a,asChild:w,children:u,className:f,"data-slot":p,disabled:o,onClick:y,onMouseDown:b,ref:S,...x}=t,r[0]=t,r[1]=a,r[2]=o,r[3]=u,r[4]=f,r[5]=p,r[6]=y,r[7]=b,r[8]=x,r[9]=S,r[10]=w);let E=w!==void 0&&w,{orientation:D,appearance:O}=T(`Tabs.Trigger`),k=a??o,A;r[11]===k?A=r[12]:(A=e(k),r[11]=k,r[12]=A);let N=A,P=m(!1),F=a??o,I;r[13]!==O||r[14]!==f||r[15]!==D?(I=i(M({orientation:D,appearance:O}),f),r[13]=O,r[14]=f,r[15]=D,r[16]=I):I=r[16];let L;r[17]===p?L=r[18]:(L=n(p,`tabs-trigger`),r[17]=p,r[18]=L);let R;r[19]!==N||r[20]!==y?(R=e=>{if(y?.(e),e.defaultPrevented||N||!e.currentTarget.matches(`a[href]`)||e.button!==0||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;let t=e.currentTarget;t.focus({focusVisible:!1}),P.current=!0,t.dispatchEvent(new MouseEvent(`mousedown`,{bubbles:!0,button:0})),P.current=!1},r[19]=N,r[20]=y,r[21]=R):R=r[21];let z;r[22]!==N||r[23]!==b?(z=e=>{P.current||(b?.(e),e.defaultPrevented||N||(e.currentTarget.matches(`a[href]`)?e.preventDefault():e.button===0&&!e.ctrlKey&&e.currentTarget.focus({focusVisible:!1})))},r[22]=N,r[23]=b,r[24]=z):z=r[24];let B;r[25]!==N||r[26]!==x||r[27]!==F||r[28]!==I||r[29]!==L||r[30]!==R||r[31]!==z?(B={"aria-disabled":F,className:I,"data-slot":L,disabled:N,onClick:R,onMouseDown:z,...x},r[25]=N,r[26]=x,r[27]=F,r[28]=I,r[29]=L,r[30]=R,r[31]=z,r[32]=B):B=r[32];let V=B;if(E){let e;r[33]===u?e=r[34]:(e=c.only(u),h(d(e),"When using `asChild`, TabsTrigger must be passed a single child as a JSX tag."),r[33]=u,r[34]=e);let t=e.props?.children,n;if(r[35]!==N||r[36]!==t||r[37]!==S||r[38]!==e||r[39]!==V){let i=N?{href:void 0,to:void 0}:{},a;r[41]!==N||r[42]!==e?(a=N?/* @__PURE__ */ _(`button`,{type:`button`}):e,r[41]=N,r[42]=e,r[43]=a):a=r[43];let o;r[44]===Symbol.for(`react.memo_cache_sentinel`)?(o=/* @__PURE__ */ _(j,{}),r[44]=o):o=r[44];let s;r[45]===t?s=r[46]:(s=/* @__PURE__ */ v(g,{children:[o,/* @__PURE__ */ _(`span`,{"data-slot":`tabs-trigger-label`,className:`contents`,children:t})]}),r[45]=t,r[46]=s),n=/* @__PURE__ */ _(C,{asChild:!0,...V,ref:S,children:l(a,i,s)}),r[35]=N,r[36]=t,r[37]=S,r[38]=e,r[39]=V,r[40]=n}else n=r[40];return n}let H;r[47]===Symbol.for(`react.memo_cache_sentinel`)?(H=/* @__PURE__ */ _(j,{}),r[47]=H):H=r[47];let U;r[48]===u?U=r[49]:(U=/* @__PURE__ */ _(`span`,{"data-slot":`tabs-trigger-label`,className:`contents`,children:u}),r[48]=u,r[49]=U);let W;return r[50]!==S||r[51]!==U||r[52]!==V?(W=/* @__PURE__ */ v(C,{ref:S,...V,children:[H,U]}),r[50]=S,r[51]=U,r[52]=V,r[53]=W):W=r[53],W},Badge:e=>{let t=s(14),r,a,o,c;t[0]===e?(r=t[1],a=t[2],o=t[3],c=t[4]):({className:a,children:r,"data-slot":o,...c}=e,t[0]=e,t[1]=r,t[2]=a,t[3]=o,t[4]=c);let l;t[5]===o?l=t[6]:(l=n(o,`tabs-badge`),t[5]=o,t[6]=l);let u;t[7]===a?u=t[8]:(u=i(`rounded-full bg-neutral-500/20 px-1.5 text-xs font-medium text-gray-600`,`group-data-state-active/tab-trigger:bg-neutral-950/10 group-data-state-active/tab-trigger:text-strong group-hover/tab-trigger:group-enabled/tab-trigger:group-data-state-active/tab-trigger:text-strong`,`group-hover/tab-trigger:group-enabled/tab-trigger:text-gray-700`,a),t[7]=a,t[8]=u);let d;return t[9]!==r||t[10]!==c||t[11]!==l||t[12]!==u?(d=/* @__PURE__ */ _(`span`,{"data-slot":l,className:u,...c,children:r}),t[9]=r,t[10]=c,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}};export{N as Tabs};
@@ -1,5 +1,10 @@
1
+ /**
2
+ * Re-exports for the Text Area component.
3
+ *
4
+ * @see https://mantle.ngrok.com/components/forms/text-area
5
+ */
1
6
  import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
2
- import { o as WithValidation } from "./field-V_gnkcmN.js";
7
+ import { o as WithValidation } from "./field-BshcNVe_.js";
3
8
  import { ComponentProps } from "react";
4
9
  type Props = ComponentProps<"textarea"> & WithValidation & {
5
10
  /**
@@ -12,6 +17,11 @@ type Props = ComponentProps<"textarea"> & WithValidation & {
12
17
  * to enter a sizeable amount of free-form text, for example a comment on a
13
18
  * review or feedback form.
14
19
  *
20
+ * @useWhen Accept several lines of free-form text, such as a comment or a description.
21
+ *
22
+ * @siblings
23
+ * - `Input`: the text fits on one line.
24
+ *
15
25
  * @see https://mantle.ngrok.com/components/forms/text-area
16
26
  *
17
27
  * @example
@@ -0,0 +1 @@
1
+ import{t as e}from"./use-matches-media-query-m860lols.js";import{n as t,t as n}from"./cookie-ca4g5CKp.js";import{t as r}from"./cx-CK7o_rVv.js";import{n as i}from"./browser-only-BTSrYWLj.js";import{t as a}from"./use-prefers-reduced-motion-CU6mWmOe.js";import{c as o}from"react/compiler-runtime";import{createContext as s,useContext as c,useEffect as l,useRef as u,useState as d}from"react";import f from"tiny-invariant";import{jsx as p}from"react/jsx-runtime";import{flushSync as m}from"react-dom";let h=null;function g(e,{origin:t}={}){if(typeof document.startViewTransition!=`function`||a()||document.visibilityState!==`visible`){e();return}if(h!=null){h.skipTransition(),h.updateCallbackDone.finally(()=>_(e));return}let n=document.documentElement,r={width:window.innerWidth,height:window.innerHeight},i=S(x(t,r),r),o=y(),s=[n,...document.querySelectorAll(`[data-slot~="dialog-overlay"], [data-slot~="dialog-content"], [data-slot~="dialog-positioner"], [data-slot~="dropdown-menu-content"], [data-slot~="dropdown-menu-sub-content"]`)];for(let e of s)e.dataset.themeTransition=``;let c=document.startViewTransition(()=>{o&&(n.dataset.themeTransitionMany=``),_(e)});h=c;function l(e){if(e.target!==n)return;c.skipTransition();let t=document.elementFromPoint(e.clientX,e.clientY);t!=null&&t!==n&&t.dispatchEvent(new MouseEvent(`click`,e))}document.addEventListener(`click`,l,{capture:!0});let u=c.ready.then(()=>n.animate({clipPath:[i.from,i.to]},{duration:400,easing:`ease-out`,pseudoElement:`::view-transition-new(root)`}),()=>void 0),d=async()=>{(await u)?.cancel(),document.removeEventListener(`click`,l,{capture:!0}),h=null,delete n.dataset.themeTransitionMany;for(let e of s)delete e.dataset.themeTransition};c.finished.finally(()=>{d()})}function _(e){if(m(e),!document.documentElement.hasAttribute(`data-theme-transition-many`))for(let e of document.getAnimations())e instanceof CSSTransition&&!v(e)&&e.cancel()}function v(e){return(e.effect instanceof KeyframeEffect?e.effect.target:null)?.parentElement?.closest(`[data-slot~="theme-switcher"], [data-slot~="theme-switcher-icon"]`)!=null}function y(){let e=document.getElementsByTagName(`*`),t=Math.max(1,Math.floor(e.length/256)),n=0;for(let r=0;r<e.length;r+=t){let i=e[r+Math.floor(Math.random()*t)];i!=null&&b(i)&&(n+=1)}return n*t>2e3}function b(e){return getComputedStyle(e).transitionDuration.split(`,`).some(e=>Number.parseFloat(e)>0)}function x(e,t){let n=document.activeElement,r=e??(n!=null&&n!==document.body?n:void 0);return r==null?{left:t.width/2,top:t.height/2,width:0,height:0}:r.getBoundingClientRect()}function S(e,t){let n=e.left+e.width/2,r=e.top+e.height/2,i=Math.hypot(Math.max(n,t.width-n),Math.max(r,t.height-r)),a=`at ${n}px ${r}px`;return{from:`circle(0px ${a})`,to:`circle(${Math.round(i*100)/100}px ${a})`}}const C=[`light`,`dark`],w=[`system`,...C],T=e=>e;function E(e){return typeof e==`string`&&w.some(t=>t===e)}const ee=e=>e;function D(e){return typeof e==`string`&&C.some(t=>t===e)}function O({theme:e,prefersDarkMode:t}){let n=t?`dark`:`light`,r=(e===`system`?n:e)===`dark`?`light`:`dark`;return r===n?`system`:r}const k=`(prefers-color-scheme: dark)`,A=`mantle-ui-theme`,j=`system`,M={system:`system`,light:`light`,dark:`dark`,"light-high-contrast":`light`,"dark-high-contrast":`dark`},N=s(null),P=s(void 0);function F(e){let n=o(19),{children:r,forceTheme:a,ssrCookie:s}=e,c;n[0]!==a||n[1]!==s?(c=()=>{let e=K({cookie:i()?Q()??s:s});return L(e,{forceTheme:a}),e},n[0]=a,n[1]=s,n[2]=c):c=n[2];let[f,m]=d(c),h=u(null),_,v;n[3]!==a||n[4]!==s?(_=()=>{let e=function(){let e=K({cookie:Q()??s});m(e),L(e,{forceTheme:a})};e();let n=t(Q(),A);n!=null&&!E(n)&&Object.hasOwn(M,n)&&$(K({cookie:Q()}));try{`BroadcastChannel`in window&&(h.current=new BroadcastChannel(A),h.current.addEventListener(`message`,e))}catch{}let r=function(t){t.key===`${A}__ping`&&e()};window.addEventListener(`storage`,r);let i=window.matchMedia(k),o=function(){e()},c=function(){document.visibilityState===`visible`&&e()};return i.addEventListener(`change`,o),window.addEventListener(`pageshow`,o),document.addEventListener(`visibilitychange`,c),()=>{window.removeEventListener(`storage`,r),i.removeEventListener(`change`,o),window.removeEventListener(`pageshow`,o),document.removeEventListener(`visibilitychange`,c),te(h.current),h.current=null}},v=[a,s],n[3]=a,n[4]=s,n[5]=_,n[6]=v):(_=n[5],v=n[6]),l(_,v);let y;n[7]!==a||n[8]!==f?(y=(e,t)=>{let{origin:n}=t===void 0?{}:t,r=()=>{if(typeof e!=`function`)return e;let t=document.documentElement.dataset.theme;return e(E(t)?t:f)},i=()=>{let e=r();$(e),m(e),L(e,{forceTheme:a}),J(e,{broadcastChannel:h.current,pingKey:`${A}__ping`})},o=window.matchMedia(k).matches;(a??z(r(),{prefersDarkMode:o}))===document.documentElement.dataset.appliedTheme?i():g(i,{origin:n})},n[7]=a,n[8]=f,n[9]=y):y=n[9];let b;n[10]!==y||n[11]!==f?(b=[f,y],n[10]=y,n[11]=f,n[12]=b):b=n[12];let x=b,S;n[13]!==r||n[14]!==x?(S=/* @__PURE__ */ p(N.Provider,{value:x,children:r}),n[13]=r,n[14]=x,n[15]=S):S=n[15];let C;return n[16]!==a||n[17]!==S?(C=/* @__PURE__ */ p(P.Provider,{value:a,children:S}),n[16]=a,n[17]=S,n[18]=C):C=n[18],C}function I(){let e=c(N);return f(e,`useTheme must be used within a ThemeProvider`),e}function L(e,{forceTheme:t}={}){if(!i())return;let n=window.document.documentElement,r=window.matchMedia(k).matches,a=t??z(e,{prefersDarkMode:r}),o=n.dataset.theme,s=n.dataset.appliedTheme,c=E(o)?o:void 0,l=D(s)?s:void 0;(c!==e||l!==a)&&(n.classList.remove(...C),n.classList.add(a),n.dataset.theme=e,n.dataset.appliedTheme=a)}function R(){if(!i())return{appliedTheme:void 0,theme:void 0};let e=window.document.documentElement,t=E(e.dataset.theme)?e.dataset.theme:void 0;return{appliedTheme:D(e.dataset.appliedTheme)?e.dataset.appliedTheme:void 0,theme:t}}function z(e,{prefersDarkMode:t}){return e===`system`?t?`dark`:`light`:e}function B(){let t=o(4),n=c(N),r=V(),i=n==null?`system`:n[0],a=e(k),s;return t[0]!==r||t[1]!==a||t[2]!==i?(s=r??z(i,{prefersDarkMode:a}),t[0]=r,t[1]=a,t[2]=i,t[3]=s):s=t[3],s}function V(){return c(P)}function H({storageKey:e,themeByCookieValue:t,forceTheme:n}){let r=`system`;try{let n=document.cookie.split(`;`).map(e=>e.trim()).find(t=>t.startsWith(`${e}=`)),i=decodeURIComponent(n?.slice(e.length+1)??``);Object.hasOwn(t,i)&&(r=t[i]??`system`)}catch{}let i=matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;n==null?r!==`system`&&(i=r):i=n;let a=document.documentElement;a.classList.remove(`light`,`dark`),a.classList.add(i),a.dataset.theme=r,a.dataset.appliedTheme=i}function U(e){let t={storageKey:A,themeByCookieValue:M,forceTheme:e};return`(${H.toString()})(${JSON.stringify(t)})`}const W=e=>{let t=o(7),{forceTheme:n,nonce:r}=e,i;t[0]===n?i=t[1]:(i=U(n),t[0]=n,t[1]=i);let a;t[2]===i?a=t[3]:(a={__html:i},t[2]=i,t[3]=a);let s;return t[4]!==r||t[5]!==a?(s=/* @__PURE__ */ p(`script`,{dangerouslySetInnerHTML:a,nonce:r,suppressHydrationWarning:!0}),t[4]=r,t[5]=a,t[6]=s):s=t[6],s};function G(e){let t=o(17),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let a=n,s;t[2]===a?s=t[3]:(s=a??{},t[2]=a,t[3]=s);let{className:c,forceTheme:l,ssrCookie:u}=s,d=c===void 0?``:c,f,p;if(i()){let e;if(t[7]!==u){let n=window.matchMedia(k).matches;f=K({cookie:Q()??u}),e=z(f,{prefersDarkMode:n}),t[7]=u,t[8]=e,t[9]=f}else e=t[8],f=t[9];p=e}else{let e;t[4]===u?(e=t[5],f=t[6]):(f=K({cookie:u}),e=z(f,{prefersDarkMode:!1}),t[4]=u,t[5]=e,t[6]=f),p=e}let m=l??p,h;t[10]!==m||t[11]!==d?(h=r(d,m),t[10]=m,t[11]=d,t[12]=h):h=t[12];let g;return t[13]!==m||t[14]!==f||t[15]!==h?(g={className:h,"data-applied-theme":m,"data-theme":f},t[13]=m,t[14]=f,t[15]=h,t[16]=g):g=t[16],g}function K({cookie:e}){if(!e)return j;let n=t(e,A);return n==null||!Object.hasOwn(M,n)?j:M[n]??j}function q(e){return n(e,A)}function J(e,t){let{broadcastChannel:n,pingKey:r}=t;try{if(n){n.postMessage({theme:e,timestamp:Date.now()});return}}catch{}try{localStorage.setItem(r,JSON.stringify({theme:e,timestamp:Date.now()}))}catch{}}const Y=[`ngrok.com`,`ngrok.ai`];function X(e){let t=Y.find(t=>e===t||e.endsWith(`.${t}`));return t==null?void 0:`.${t}`}function Z(e){let t=/* @__PURE__ */ new Date;t.setFullYear(t.getFullYear()+1);let{hostname:n,protocol:r}=window.location,i=X(n),a=i==null?``:`; domain=${i}`,o=r===`https:`?`; Secure`:``;return`${A}=${encodeURIComponent(e)}; expires=${t.toUTCString()}; path=/${a}; SameSite=Lax${o}`}function Q(){try{return document.cookie}catch{return}}function $(e){if(i())try{document.cookie=Z(e)}catch{}}function te(e){if(e!=null)try{e.close()}catch{}}export{w as _,U as a,V as c,ee as d,T as f,C as g,E as h,K as i,G as l,D as m,F as n,R as o,O as p,q as r,B as s,W as t,I as u};
@@ -1,6 +1,14 @@
1
- import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
1
+ /**
2
+ * Re-exports for ThemeSwitcher, the canonical light/dark toggle for headers
3
+ * and toolbars, and ThemeDropdownMenuItem, the same toggle as one item for
4
+ * any `DropdownMenu.Content` or `DropdownMenu.SubContent`. ThemeSwitcherIcon
5
+ * and useThemeToggle compose the same toggle into a menu item you lay out.
6
+ *
7
+ * @see https://mantle.ngrok.com/components/forms/theme-switcher
8
+ */
2
9
  import { t as WithStyleProps } from "./with-style-props-CuT30s0W.js";
3
- import { n as IconButtonProps, r as IconButtonAppearance } from "./button-Yxyu1XMd.js";
10
+ import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
11
+ import { n as IconButtonProps, r as IconButtonAppearance } from "./button-BGwOPjGV.js";
4
12
  import { ReactNode } from "react";
5
13
  /**
6
14
  * The props for the `ThemeSwitcherIcon` component.
@@ -203,6 +211,12 @@ type ThemeSwitcherProps = Omit<IconButtonProps, "appearance" | "asChild" | "chil
203
211
  * hydration, then the icon of the applied theme. To put the same control in
204
212
  * an existing menu, use `ThemeDropdownMenuItem`.
205
213
  *
214
+ * @useWhen Let the user switch between light and dark mode from a header, a toolbar, or an account
215
+ * menu.
216
+ *
217
+ * @siblings
218
+ * - `Switch`: the toggle controls a setting other than the theme.
219
+ *
206
220
  * @see https://mantle.ngrok.com/components/forms/theme-switcher
207
221
  * @see https://lea.verou.me/blog/2026/dark-mode-toggles/
208
222
  *
@@ -1 +1 @@
1
- import{r as e,t}from"./browser-only-BTSrYWLj.js";import{t as n}from"./cx-CK7o_rVv.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{r as i}from"./button-Dge0D5bl.js";import{t as a}from"./button-B8k98Pby.js";import{t as o}from"./use-matches-media-query-m860lols.js";import{t as s}from"./skeleton-DBpI-ko5.js";import{t as c}from"./dropdown-menu-BHBzCDSZ.js";import{c as l,p as u,s as d,u as f}from"./theme-C-glc5Q-.js";import{n as p}from"./icons-DP3lQw5O.js";import{c as m}from"react/compiler-runtime";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";const v={light:/* @__PURE__ */ g(p,{theme:`light`}),dark:/* @__PURE__ */ g(p,{theme:`dark`})};function y(e){let r=m(9),{className:a,style:o}=e,c=d(),l;r[0]===a?l=r[1]:(l=n(`flex shrink-0 items-center justify-center text-muted`,a),r[0]=a,r[1]=l);let u;r[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=/* @__PURE__ */ g(s,{asChild:!0,className:`rounded-full size-5`,children:/* @__PURE__ */ g(`span`,{})}),r[2]=u):u=r[2];let f;r[3]===c?f=r[4]:(f=/* @__PURE__ */ g(t,{fallback:u,children:()=>/* @__PURE__ */ g(i,{active:c,icons:v})}),r[3]=c,r[4]=f);let p;return r[5]!==o||r[6]!==l||r[7]!==f?(p=/* @__PURE__ */ g(`span`,{"aria-hidden":!0,"data-slot":`theme-switcher-icon`,className:l,style:o,children:f}),r[5]=o,r[6]=l,r[7]=f,r[8]=p):p=r[8],p}function b(){let e=m(10),[t,n]=f(),r=l(),i=o(`(prefers-color-scheme: dark)`),a=r!=null,s;e[0]!==i||e[1]!==t?(s=C(u({theme:t,prefersDarkMode:i}),{prefersDarkMode:i}),e[0]=i,e[1]=t,e[2]=s):s=e[2];let c;e[3]!==i||e[4]!==n?(c=e=>{e.preventDefault();let t=e.currentTarget instanceof Element?e.currentTarget:null;n(e=>u({theme:e,prefersDarkMode:i}),{origin:t?.querySelector(`[data-slot~="theme-switcher-icon"]`)??t})},e[3]=i,e[4]=n,e[5]=c):c=e[5];let d;return e[6]!==a||e[7]!==s||e[8]!==c?(d={disabled:a,label:s,onSelect:c},e[6]=a,e[7]=s,e[8]=c,e[9]=d):d=e[9],d}function x(e){let t=m(13),{children:r,className:i,label:a,style:o}=e,s=b(),l=r!=null&&typeof r!=`boolean`&&r!==``,u=a==null&&!l?`Theme: ${s.label}`:void 0,d;t[0]===i?d=t[1]:(d=n(`gap-2`,i),t[0]=i,t[1]=d);let f;t[2]!==r||t[3]!==l||t[4]!==a?(f=l?r:/* @__PURE__ */ _(h,{children:[/* @__PURE__ */ g(`span`,{"data-slot":`theme-dropdown-menu-item-label`,className:`flex-1`,children:a??`Theme`}),/* @__PURE__ */ g(y,{className:`size-7`})]}),t[2]=r,t[3]=l,t[4]=a,t[5]=f):f=t[5];let p;return t[6]!==o||t[7]!==u||t[8]!==d||t[9]!==f||t[10]!==s.disabled||t[11]!==s.onSelect?(p=/* @__PURE__ */ g(c.Item,{"aria-label":u,"data-slot":`theme-dropdown-menu-item`,className:d,disabled:s.disabled,style:o,onSelect:s.onSelect,children:f}),t[6]=o,t[7]=u,t[8]=d,t[9]=f,t[10]=s.disabled,t[11]=s.onSelect,t[12]=p):p=t[12],p}function S(n){let c=m(28),p,h,_,y,b,x;c[0]===n?(p=c[1],h=c[2],_=c[3],y=c[4],b=c[5],x=c[6]):({appearance:x,"data-slot":p,disabled:h,label:_,onClick:y,...b}=n,c[0]=n,c[1]=p,c[2]=h,c[3]=_,c[4]=y,c[5]=b,c[6]=x);let S=x===void 0?`ghost`:x,[w,T]=f(),E=d(),D=l(),O=o(`(prefers-color-scheme: dark)`),k=e(),A;if(c[7]!==k||c[8]!==O||c[9]!==w){let e=u({theme:w,prefersDarkMode:O});A=k?C(e,{prefersDarkMode:O}):`Toggle theme`,c[7]=k,c[8]=O,c[9]=w,c[10]=A}else A=c[10];let j=A,M;c[11]===p?M=c[12]:(M=r(p,`theme-switcher`),c[11]=p,c[12]=M);let N=D!=null||h,P;c[13]===Symbol.for(`react.memo_cache_sentinel`)?(P=/* @__PURE__ */ g(s,{asChild:!0,className:`rounded-full size-5`,children:/* @__PURE__ */ g(`span`,{})}),c[13]=P):P=c[13];let F;c[14]===E?F=c[15]:(F=/* @__PURE__ */ g(t,{fallback:P,children:()=>/* @__PURE__ */ g(i,{active:E,icons:v})}),c[14]=E,c[15]=F);let I=_??(D==null?j:`Theme set by this page`),L;c[16]!==y||c[17]!==O||c[18]!==T?(L=e=>{y?.(e),e.defaultPrevented||T(e=>u({theme:e,prefersDarkMode:O}),{origin:e.currentTarget})},c[16]=y,c[17]=O,c[18]=T,c[19]=L):L=c[19];let R;return c[20]!==S||c[21]!==b||c[22]!==M||c[23]!==N||c[24]!==F||c[25]!==I||c[26]!==L?(R=/* @__PURE__ */ g(a,{appearance:S,"data-slot":M,disabled:N,intent:`neutral`,icon:F,label:I,onClick:L,...b}),c[20]=S,c[21]=b,c[22]=M,c[23]=N,c[24]=F,c[25]=I,c[26]=L,c[27]=R):R=c[27],R}function C(e,{prefersDarkMode:t}){return e===`system`?t?`Switch to dark theme (system default)`:`Switch to light theme (system default)`:`Switch to ${e} theme`}export{x as ThemeDropdownMenuItem,S as ThemeSwitcher,y as ThemeSwitcherIcon,b as useThemeToggle};
1
+ import{r as e,t}from"./browser-only-BTSrYWLj.js";import{t as n}from"./use-matches-media-query-m860lols.js";import{t as r}from"./cx-CK7o_rVv.js";import{t as i}from"./data-slot-EM6s2WEU.js";import{t as a}from"./button-BWGUuWnu.js";import{t as o}from"./dropdown-menu-DHdgaw4P.js";import{r as s}from"./button-Cu9e3SM7.js";import{n as c}from"./icons-4JA-SGfv.js";import{t as l}from"./skeleton-DBpI-ko5.js";import{c as u,p as d,s as f,u as p}from"./theme-DdZgLvKH.js";import{c as m}from"react/compiler-runtime";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";const v={light:/* @__PURE__ */ g(c,{theme:`light`}),dark:/* @__PURE__ */ g(c,{theme:`dark`})};function y(e){let n=m(9),{className:i,style:a}=e,o=f(),c;n[0]===i?c=n[1]:(c=r(`flex shrink-0 items-center justify-center text-muted`,i),n[0]=i,n[1]=c);let u;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=/* @__PURE__ */ g(l,{asChild:!0,className:`rounded-full size-5`,children:/* @__PURE__ */ g(`span`,{})}),n[2]=u):u=n[2];let d;n[3]===o?d=n[4]:(d=/* @__PURE__ */ g(t,{fallback:u,children:()=>/* @__PURE__ */ g(s,{active:o,icons:v})}),n[3]=o,n[4]=d);let p;return n[5]!==a||n[6]!==c||n[7]!==d?(p=/* @__PURE__ */ g(`span`,{"aria-hidden":!0,"data-slot":`theme-switcher-icon`,className:c,style:a,children:d}),n[5]=a,n[6]=c,n[7]=d,n[8]=p):p=n[8],p}function b(){let e=m(10),[t,r]=p(),i=u(),a=n(`(prefers-color-scheme: dark)`),o=i!=null,s;e[0]!==a||e[1]!==t?(s=C(d({theme:t,prefersDarkMode:a}),{prefersDarkMode:a}),e[0]=a,e[1]=t,e[2]=s):s=e[2];let c;e[3]!==a||e[4]!==r?(c=e=>{e.preventDefault();let t=e.currentTarget instanceof Element?e.currentTarget:null;r(e=>d({theme:e,prefersDarkMode:a}),{origin:t?.querySelector(`[data-slot~="theme-switcher-icon"]`)??t})},e[3]=a,e[4]=r,e[5]=c):c=e[5];let l;return e[6]!==o||e[7]!==s||e[8]!==c?(l={disabled:o,label:s,onSelect:c},e[6]=o,e[7]=s,e[8]=c,e[9]=l):l=e[9],l}function x(e){let t=m(13),{children:n,className:i,label:a,style:s}=e,c=b(),l=n!=null&&typeof n!=`boolean`&&n!==``,u=a==null&&!l?`Theme: ${c.label}`:void 0,d;t[0]===i?d=t[1]:(d=r(`gap-2`,i),t[0]=i,t[1]=d);let f;t[2]!==n||t[3]!==l||t[4]!==a?(f=l?n:/* @__PURE__ */ _(h,{children:[/* @__PURE__ */ g(`span`,{"data-slot":`theme-dropdown-menu-item-label`,className:`flex-1`,children:a??`Theme`}),/* @__PURE__ */ g(y,{className:`size-7`})]}),t[2]=n,t[3]=l,t[4]=a,t[5]=f):f=t[5];let p;return t[6]!==s||t[7]!==u||t[8]!==d||t[9]!==f||t[10]!==c.disabled||t[11]!==c.onSelect?(p=/* @__PURE__ */ g(o.Item,{"aria-label":u,"data-slot":`theme-dropdown-menu-item`,className:d,disabled:c.disabled,style:s,onSelect:c.onSelect,children:f}),t[6]=s,t[7]=u,t[8]=d,t[9]=f,t[10]=c.disabled,t[11]=c.onSelect,t[12]=p):p=t[12],p}function S(r){let o=m(28),c,h,_,y,b,x;o[0]===r?(c=o[1],h=o[2],_=o[3],y=o[4],b=o[5],x=o[6]):({appearance:x,"data-slot":c,disabled:h,label:_,onClick:y,...b}=r,o[0]=r,o[1]=c,o[2]=h,o[3]=_,o[4]=y,o[5]=b,o[6]=x);let S=x===void 0?`ghost`:x,[w,T]=p(),E=f(),D=u(),O=n(`(prefers-color-scheme: dark)`),k=e(),A;if(o[7]!==k||o[8]!==O||o[9]!==w){let e=d({theme:w,prefersDarkMode:O});A=k?C(e,{prefersDarkMode:O}):`Toggle theme`,o[7]=k,o[8]=O,o[9]=w,o[10]=A}else A=o[10];let j=A,M;o[11]===c?M=o[12]:(M=i(c,`theme-switcher`),o[11]=c,o[12]=M);let N=D!=null||h,P;o[13]===Symbol.for(`react.memo_cache_sentinel`)?(P=/* @__PURE__ */ g(l,{asChild:!0,className:`rounded-full size-5`,children:/* @__PURE__ */ g(`span`,{})}),o[13]=P):P=o[13];let F;o[14]===E?F=o[15]:(F=/* @__PURE__ */ g(t,{fallback:P,children:()=>/* @__PURE__ */ g(s,{active:E,icons:v})}),o[14]=E,o[15]=F);let I=_??(D==null?j:`Theme set by this page`),L;o[16]!==y||o[17]!==O||o[18]!==T?(L=e=>{y?.(e),e.defaultPrevented||T(e=>d({theme:e,prefersDarkMode:O}),{origin:e.currentTarget})},o[16]=y,o[17]=O,o[18]=T,o[19]=L):L=o[19];let R;return o[20]!==S||o[21]!==b||o[22]!==M||o[23]!==N||o[24]!==F||o[25]!==I||o[26]!==L?(R=/* @__PURE__ */ g(a,{appearance:S,"data-slot":M,disabled:N,intent:`neutral`,icon:F,label:I,onClick:L,...b}),o[20]=S,o[21]=b,o[22]=M,o[23]=N,o[24]=F,o[25]=I,o[26]=L,o[27]=R):R=o[27],R}function C(e,{prefersDarkMode:t}){return e===`system`?t?`Switch to dark theme (system default)`:`Switch to light theme (system default)`:`Switch to ${e} theme`}export{x as ThemeDropdownMenuItem,S as ThemeSwitcher,y as ThemeSwitcherIcon,b as useThemeToggle};
package/dist/theme.d.ts CHANGED
@@ -1,3 +1,15 @@
1
+ /**
2
+ * Re-exports for the Theme component — the provider and hooks that carry the
3
+ * applied theme, plus the document tags that stop a wrong-theme flash.
4
+ *
5
+ * @useWhen Apply the light or dark theme to an app, follow the operating system by default, and
6
+ * stop a wrong-theme flash on load.
7
+ *
8
+ * @siblings
9
+ * - `ThemeSwitcher`: the user changes the theme from a control in the UI.
10
+ *
11
+ * @see https://mantle.ngrok.com/components/primitives/theme
12
+ */
1
13
  import { a as isResolvedTheme, c as themes, i as Theme, n as $theme, o as isTheme, r as ResolvedTheme, s as resolvedThemes, t as $resolvedTheme } from "./theme-w1CrMM-x.js";
2
14
  import { PropsWithChildren } from "react";
3
15
  /**
package/dist/theme.js CHANGED
@@ -1 +1 @@
1
- import{_ as e,a as t,d as n,f as r,g as i,h as a,i as o,l as s,m as c,n as l,o as u,r as d,s as f,t as p,u as m}from"./theme-C-glc5Q-.js";import{c as h}from"react/compiler-runtime";import{jsx as g}from"react/jsx-runtime";const _=`https://assets.ngrok.com`,v=`${_}/fonts`,y={roobert:`/roobert/roobert-proportional-vf.woff2`,"jetbrains-mono":`/jetbrains/jetbrainsmono-wght.woff2`,"jetbrains-mono-italic":`/jetbrains/jetbrainsmono-italic-wght.woff2`,"family-regular":`/family/family-regular.woff2`,"family-italic":`/family/family-italic.woff2`};function b(e){let t=e.startsWith(`/`)?e:`/${e}`;return`${v}${t}`}function x(e){return`<${b(y[e])}>; rel=preload; as=font; type="font/woff2"; crossorigin`}const S=e=>{let t=h(4),{name:n}=e,r=y[n],i;t[0]===r?i=t[1]:(i=b(r),t[0]=r,t[1]=i);let a;return t[2]===i?a=t[3]:(a=/* @__PURE__ */ g(`link`,{rel:`preload`,href:i,as:`font`,type:`font/woff2`,crossOrigin:`anonymous`}),t[2]=i,t[3]=a),a};export{n as $resolvedTheme,r as $theme,S as PreloadFont,p as PreventWrongThemeFlashScript,l as ThemeProvider,_ as assetsCdnOrigin,d as extractThemeCookie,b as fontHref,o as getStoredTheme,c as isResolvedTheme,a as isTheme,x as preloadFontLink,t as preventWrongThemeFlashScriptContent,u as readThemeFromHtmlElement,i as resolvedThemes,e as themes,f as useAppliedTheme,s as useInitialHtmlThemeProps,m as useTheme};
1
+ import{_ as e,a as t,d as n,f as r,g as i,h as a,i as o,l as s,m as c,n as l,o as u,r as d,s as f,t as p,u as m}from"./theme-DdZgLvKH.js";import{c as h}from"react/compiler-runtime";import{jsx as g}from"react/jsx-runtime";const _=`https://assets.ngrok.com`,v=`${_}/fonts`,y={roobert:`/roobert/roobert-proportional-vf.woff2`,"jetbrains-mono":`/jetbrains/jetbrainsmono-wght.woff2`,"jetbrains-mono-italic":`/jetbrains/jetbrainsmono-italic-wght.woff2`,"family-regular":`/family/family-regular.woff2`,"family-italic":`/family/family-italic.woff2`};function b(e){let t=e.startsWith(`/`)?e:`/${e}`;return`${v}${t}`}function x(e){return`<${b(y[e])}>; rel=preload; as=font; type="font/woff2"; crossorigin`}const S=e=>{let t=h(4),{name:n}=e,r=y[n],i;t[0]===r?i=t[1]:(i=b(r),t[0]=r,t[1]=i);let a;return t[2]===i?a=t[3]:(a=/* @__PURE__ */ g(`link`,{rel:`preload`,href:i,as:`font`,type:`font/woff2`,crossOrigin:`anonymous`}),t[2]=i,t[3]=a),a};export{n as $resolvedTheme,r as $theme,S as PreloadFont,p as PreventWrongThemeFlashScript,l as ThemeProvider,_ as assetsCdnOrigin,d as extractThemeCookie,b as fontHref,o as getStoredTheme,c as isResolvedTheme,a as isTheme,x as preloadFontLink,t as preventWrongThemeFlashScriptContent,u as readThemeFromHtmlElement,i as resolvedThemes,e as themes,f as useAppliedTheme,s as useInitialHtmlThemeProps,m as useTheme};
package/dist/toast.d.ts CHANGED
@@ -1,6 +1,11 @@
1
+ /**
2
+ * Re-exports for the Toast component.
3
+ *
4
+ * @see https://mantle.ngrok.com/components/feedback/toast
5
+ */
1
6
  import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
2
- import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
3
7
  import { t as WithStyleProps } from "./with-style-props-CuT30s0W.js";
8
+ import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
4
9
  import { n as SvgOnlyProps } from "./icon-DXDyhy2N.js";
5
10
  import { ComponentProps, ReactNode } from "react";
6
11
  import { Toaster as Toaster$1 } from "sonner";
@@ -176,6 +181,14 @@ declare const Message: ({ "data-slot": dataSlot, asChild, className, ref, ...pro
176
181
  * A succinct message that appears temporarily. Toasts give the user feedback
177
182
  * without interrupting their workflow.
178
183
  *
184
+ * @useWhen Report the result of an action, such as a save or a copy, in a brief message that goes
185
+ * away on its own.
186
+ *
187
+ * @siblings
188
+ * - `Alert`: the message stays in the page next to the content it describes.
189
+ * - `AlertDialog`: the user must respond before they continue.
190
+ * - `Sandbar`: the message waits for the user to save or discard pending changes.
191
+ *
179
192
  * @see https://mantle.ngrok.com/components/feedback/toast
180
193
  *
181
194
  * @example
package/dist/toast.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-kK0c-POG.js";import{t as r}from"./slot-DdYN1L1C.js";import{s as i}from"./theme-C-glc5Q-.js";import{c as a}from"react/compiler-runtime";import{createContext as o,useContext as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{CheckCircleIcon as u}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as d}from"@phosphor-icons/react/Info";import{WarningIcon as f}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as p}from"@phosphor-icons/react/WarningDiamond";import{Toaster as m,toast as h}from"sonner";function g(e){return typeof e==`number`&&e<=0?1/0:e}const _=t=>{let n=a(13),{className:r,containerAriaLabel:o,dir:s,duration_ms:l,position:u,style:d}=t,f=l===void 0?4e3:l,p=u===void 0?`top-center`:u,h=i(),_;n[0]===r?_=n[1]:(_=e(`toaster overlay-prompt pointer-events-auto *:duration-200`,r),n[0]=r,n[1]=_);let v;n[2]===f?v=n[3]:(v=g(f),n[2]=f,n[3]=v);let y=p??`top-center`,b;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(b={unstyled:!0},n[4]=b):b=n[4];let x;return n[5]!==o||n[6]!==s||n[7]!==d||n[8]!==_||n[9]!==v||n[10]!==y||n[11]!==h?(x=/* @__PURE__ */ c(m,{"data-slot":`toaster`,className:_,containerAriaLabel:o,dir:s,duration:v,gap:12,position:y,style:d,theme:h,toastOptions:b}),n[5]=o,n[6]=s,n[7]=d,n[8]=_,n[9]=v,n[10]=y,n[11]=h,n[12]=x):x=n[12],x},v=o(``);function y(e,t){let n=g(t?.duration_ms);return h.custom(t=>/* @__PURE__ */ c(v.Provider,{value:t,children:e}),{duration:n,...t?.id?{id:t.id}:{},unstyled:!0})}const b=o({intent:`info`}),x={Root:n=>{let r=a(27),i,o,s,u,d,f;r[0]===n?(i=r[1],o=r[2],s=r[3],u=r[4],d=r[5],f=r[6]):({"data-slot":s,children:i,className:o,intent:u,ref:f,...d}=n,r[0]=n,r[1]=i,r[2]=o,r[3]=s,r[4]=u,r[5]=d,r[6]=f);let p;r[7]===u?p=r[8]:(p={intent:u},r[7]=u,r[8]=p);let m=p,h;r[9]===s?h=r[10]:(h=t(s,`toast`),r[9]=s,r[10]=h);let g;r[11]===o?g=r[12]:(g=e(`relative flex items-start gap-2 text-sm font-sans`,`p-3 pl-3.75`,`bg-popover rounded rounded-r-[0.3125rem] border border-gray-500/35 shadow-lg`,o),r[11]=o,r[12]=g);let _;r[13]===u?_=r[14]:(_=/* @__PURE__ */ c(C,{intent:u}),r[13]=u,r[14]=_);let v;r[15]===i?v=r[16]:(v=/* @__PURE__ */ c(`div`,{"data-slot":`toast-label`,className:`contents`,children:i}),r[15]=i,r[16]=v);let y;r[17]!==d||r[18]!==f||r[19]!==h||r[20]!==g||r[21]!==_||r[22]!==v?(y=/* @__PURE__ */ l(`div`,{"data-slot":h,className:g,ref:f,...d,children:[_,v]}),r[17]=d,r[18]=f,r[19]=h,r[20]=g,r[21]=_,r[22]=v,r[23]=y):y=r[23];let x;return r[24]!==m||r[25]!==y?(x=/* @__PURE__ */ c(b.Provider,{value:m,children:y}),r[24]=m,r[25]=y,r[26]=x):x=r[26],x},Action:n=>{let i=a(21),o,l,u,d,f,p;i[0]===n?(o=i[1],l=i[2],u=i[3],d=i[4],f=i[5],p=i[6]):({"data-slot":u,asChild:o,className:l,onClick:d,ref:p,...f}=n,i[0]=n,i[1]=o,i[2]=l,i[3]=u,i[4]=d,i[5]=f,i[6]=p);let m=s(v),g=o?r:`button`,_;i[7]===u?_=i[8]:(_=t(u,`toast-action`),i[7]=u,i[8]=_);let y;i[9]===l?y=i[10]:(y=e(`shrink-0`,`data-icon-button:-mr-0.5 data-icon-button:-mt-0.5 data-icon-button:rounded-xs`,l),i[9]=l,i[10]=y);let b;i[11]!==m||i[12]!==d?(b=e=>{d?.(e),!e.defaultPrevented&&h.dismiss(m)},i[11]=m,i[12]=d,i[13]=b):b=i[13];let x;return i[14]!==g||i[15]!==f||i[16]!==p||i[17]!==_||i[18]!==y||i[19]!==b?(x=/* @__PURE__ */ c(g,{"data-slot":_,className:y,onClick:b,ref:p,...f}),i[14]=g,i[15]=f,i[16]=p,i[17]=_,i[18]=y,i[19]=b,i[20]=x):x=i[20],x},Icon:r=>{let i=a(54),o,l,m,h,g;i[0]===r?(o=i[1],l=i[2],m=i[3],h=i[4],g=i[5]):({"data-slot":l,className:o,svg:g,ref:h,...m}=r,i[0]=r,i[1]=o,i[2]=l,i[3]=m,i[4]=h,i[5]=g);let _=s(b);switch(_.intent){case`danger`:{let r;i[6]===l?r=i[7]:(r=t(l,`toast-icon`),i[6]=l,i[7]=r);let a;i[8]===o?a=i[9]:(a=e(`text-danger-600`,o),i[8]=o,i[9]=a);let s;i[10]===g?s=i[11]:(s=g??/* @__PURE__ */ c(f,{weight:`fill`}),i[10]=g,i[11]=s);let u;return i[12]!==m||i[13]!==h||i[14]!==r||i[15]!==a||i[16]!==s?(u=/* @__PURE__ */ c(n,{"data-slot":r,className:a,ref:h,svg:s,...m}),i[12]=m,i[13]=h,i[14]=r,i[15]=a,i[16]=s,i[17]=u):u=i[17],u}case`warning`:{let r;i[18]===l?r=i[19]:(r=t(l,`toast-icon`),i[18]=l,i[19]=r);let a;i[20]===o?a=i[21]:(a=e(`text-warning-600`,o),i[20]=o,i[21]=a);let s;i[22]===g?s=i[23]:(s=g??/* @__PURE__ */ c(p,{weight:`fill`}),i[22]=g,i[23]=s);let u;return i[24]!==m||i[25]!==h||i[26]!==r||i[27]!==a||i[28]!==s?(u=/* @__PURE__ */ c(n,{"data-slot":r,className:a,ref:h,svg:s,...m}),i[24]=m,i[25]=h,i[26]=r,i[27]=a,i[28]=s,i[29]=u):u=i[29],u}case`success`:{let r;i[30]===l?r=i[31]:(r=t(l,`toast-icon`),i[30]=l,i[31]=r);let a;i[32]===o?a=i[33]:(a=e(`text-success-600`,o),i[32]=o,i[33]=a);let s;i[34]===g?s=i[35]:(s=g??/* @__PURE__ */ c(u,{weight:`fill`}),i[34]=g,i[35]=s);let d;return i[36]!==m||i[37]!==h||i[38]!==r||i[39]!==a||i[40]!==s?(d=/* @__PURE__ */ c(n,{"data-slot":r,className:a,ref:h,svg:s,...m}),i[36]=m,i[37]=h,i[38]=r,i[39]=a,i[40]=s,i[41]=d):d=i[41],d}case`info`:{let r;i[42]===l?r=i[43]:(r=t(l,`toast-icon`),i[42]=l,i[43]=r);let a;i[44]===o?a=i[45]:(a=e(`text-accent-600`,o),i[44]=o,i[45]=a);let s;i[46]===g?s=i[47]:(s=g??/* @__PURE__ */ c(d,{weight:`fill`}),i[46]=g,i[47]=s);let u;return i[48]!==m||i[49]!==h||i[50]!==r||i[51]!==a||i[52]!==s?(u=/* @__PURE__ */ c(n,{"data-slot":r,className:a,ref:h,svg:s,...m}),i[48]=m,i[49]=h,i[50]=r,i[51]=a,i[52]=s,i[53]=u):u=i[53],u}default:throw Error(`Unreachable Case: ${String(_.intent)}`)}},Message:n=>{let i=a(16),o,s,l,u,d;i[0]===n?(o=i[1],s=i[2],l=i[3],u=i[4],d=i[5]):({"data-slot":l,asChild:o,className:s,ref:d,...u}=n,i[0]=n,i[1]=o,i[2]=s,i[3]=l,i[4]=u,i[5]=d);let f=o?r:`p`,p;i[6]===l?p=i[7]:(p=t(l,`toast-message`),i[6]=l,i[7]=p);let m;i[8]===s?m=i[9]:(m=e(`text-strong flex-1 text-sm font-body`,s),i[8]=s,i[9]=m);let h;return i[10]!==f||i[11]!==u||i[12]!==d||i[13]!==p||i[14]!==m?(h=/* @__PURE__ */ c(f,{"data-slot":p,className:m,ref:d,...u}),i[10]=f,i[11]=u,i[12]=d,i[13]=p,i[14]=m,i[15]=h):h=i[15],h}},S={info:`bg-accent-600`,warning:`bg-warning-600`,success:`bg-success-600`,danger:`bg-danger-600`};function C(t){let n=a(10),r,i,o;n[0]===t?(r=n[1],i=n[2],o=n[3]):({className:r,intent:i,...o}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=o);let s=S[i],l;n[4]!==r||n[5]!==s?(l=e(`z-1 absolute -inset-px right-auto w-1.5 rounded-l`,s,r),n[4]=r,n[5]=s,n[6]=l):l=n[6];let u;return n[7]!==o||n[8]!==l?(u=/* @__PURE__ */ c(`div`,{"aria-hidden":!0,className:l,...o}),n[7]=o,n[8]=l,n[9]=u):u=n[9],u}export{x as Toast,_ as Toaster,y as makeToast};
1
+ import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-kK0c-POG.js";import{t as r}from"./slot-DdYN1L1C.js";import{s as i}from"./theme-DdZgLvKH.js";import{c as a}from"react/compiler-runtime";import{createContext as o,useContext as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";import{CheckCircleIcon as u}from"@phosphor-icons/react/CheckCircle";import{InfoIcon as d}from"@phosphor-icons/react/Info";import{WarningIcon as f}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as p}from"@phosphor-icons/react/WarningDiamond";import{Toaster as m,toast as h}from"sonner";function g(e){return typeof e==`number`&&e<=0?1/0:e}const _=t=>{let n=a(13),{className:r,containerAriaLabel:o,dir:s,duration_ms:l,position:u,style:d}=t,f=l===void 0?4e3:l,p=u===void 0?`top-center`:u,h=i(),_;n[0]===r?_=n[1]:(_=e(`toaster overlay-prompt pointer-events-auto *:duration-200`,r),n[0]=r,n[1]=_);let v;n[2]===f?v=n[3]:(v=g(f),n[2]=f,n[3]=v);let y=p??`top-center`,b;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(b={unstyled:!0},n[4]=b):b=n[4];let x;return n[5]!==o||n[6]!==s||n[7]!==d||n[8]!==_||n[9]!==v||n[10]!==y||n[11]!==h?(x=/* @__PURE__ */ c(m,{"data-slot":`toaster`,className:_,containerAriaLabel:o,dir:s,duration:v,gap:12,position:y,style:d,theme:h,toastOptions:b}),n[5]=o,n[6]=s,n[7]=d,n[8]=_,n[9]=v,n[10]=y,n[11]=h,n[12]=x):x=n[12],x},v=o(``);function y(e,t){let n=g(t?.duration_ms);return h.custom(t=>/* @__PURE__ */ c(v.Provider,{value:t,children:e}),{duration:n,...t?.id?{id:t.id}:{},unstyled:!0})}const b=o({intent:`info`}),x={Root:n=>{let r=a(27),i,o,s,u,d,f;r[0]===n?(i=r[1],o=r[2],s=r[3],u=r[4],d=r[5],f=r[6]):({"data-slot":s,children:i,className:o,intent:u,ref:f,...d}=n,r[0]=n,r[1]=i,r[2]=o,r[3]=s,r[4]=u,r[5]=d,r[6]=f);let p;r[7]===u?p=r[8]:(p={intent:u},r[7]=u,r[8]=p);let m=p,h;r[9]===s?h=r[10]:(h=t(s,`toast`),r[9]=s,r[10]=h);let g;r[11]===o?g=r[12]:(g=e(`relative flex items-start gap-2 text-sm font-sans`,`p-3 pl-3.75`,`bg-popover rounded rounded-r-[0.3125rem] border border-gray-500/35 shadow-lg`,o),r[11]=o,r[12]=g);let _;r[13]===u?_=r[14]:(_=/* @__PURE__ */ c(C,{intent:u}),r[13]=u,r[14]=_);let v;r[15]===i?v=r[16]:(v=/* @__PURE__ */ c(`div`,{"data-slot":`toast-label`,className:`contents`,children:i}),r[15]=i,r[16]=v);let y;r[17]!==d||r[18]!==f||r[19]!==h||r[20]!==g||r[21]!==_||r[22]!==v?(y=/* @__PURE__ */ l(`div`,{"data-slot":h,className:g,ref:f,...d,children:[_,v]}),r[17]=d,r[18]=f,r[19]=h,r[20]=g,r[21]=_,r[22]=v,r[23]=y):y=r[23];let x;return r[24]!==m||r[25]!==y?(x=/* @__PURE__ */ c(b.Provider,{value:m,children:y}),r[24]=m,r[25]=y,r[26]=x):x=r[26],x},Action:n=>{let i=a(21),o,l,u,d,f,p;i[0]===n?(o=i[1],l=i[2],u=i[3],d=i[4],f=i[5],p=i[6]):({"data-slot":u,asChild:o,className:l,onClick:d,ref:p,...f}=n,i[0]=n,i[1]=o,i[2]=l,i[3]=u,i[4]=d,i[5]=f,i[6]=p);let m=s(v),g=o?r:`button`,_;i[7]===u?_=i[8]:(_=t(u,`toast-action`),i[7]=u,i[8]=_);let y;i[9]===l?y=i[10]:(y=e(`shrink-0`,`data-icon-button:-mr-0.5 data-icon-button:-mt-0.5 data-icon-button:rounded-xs`,l),i[9]=l,i[10]=y);let b;i[11]!==m||i[12]!==d?(b=e=>{d?.(e),e.defaultPrevented||h.dismiss(m)},i[11]=m,i[12]=d,i[13]=b):b=i[13];let x;return i[14]!==g||i[15]!==f||i[16]!==p||i[17]!==_||i[18]!==y||i[19]!==b?(x=/* @__PURE__ */ c(g,{"data-slot":_,className:y,onClick:b,ref:p,...f}),i[14]=g,i[15]=f,i[16]=p,i[17]=_,i[18]=y,i[19]=b,i[20]=x):x=i[20],x},Icon:r=>{let i=a(54),o,l,m,h,g;i[0]===r?(o=i[1],l=i[2],m=i[3],h=i[4],g=i[5]):({"data-slot":l,className:o,svg:g,ref:h,...m}=r,i[0]=r,i[1]=o,i[2]=l,i[3]=m,i[4]=h,i[5]=g);let _=s(b);switch(_.intent){case`danger`:{let r;i[6]===l?r=i[7]:(r=t(l,`toast-icon`),i[6]=l,i[7]=r);let a;i[8]===o?a=i[9]:(a=e(`text-danger-600`,o),i[8]=o,i[9]=a);let s;i[10]===g?s=i[11]:(s=g??/* @__PURE__ */ c(f,{weight:`fill`}),i[10]=g,i[11]=s);let u;return i[12]!==m||i[13]!==h||i[14]!==r||i[15]!==a||i[16]!==s?(u=/* @__PURE__ */ c(n,{"data-slot":r,className:a,ref:h,svg:s,...m}),i[12]=m,i[13]=h,i[14]=r,i[15]=a,i[16]=s,i[17]=u):u=i[17],u}case`warning`:{let r;i[18]===l?r=i[19]:(r=t(l,`toast-icon`),i[18]=l,i[19]=r);let a;i[20]===o?a=i[21]:(a=e(`text-warning-600`,o),i[20]=o,i[21]=a);let s;i[22]===g?s=i[23]:(s=g??/* @__PURE__ */ c(p,{weight:`fill`}),i[22]=g,i[23]=s);let u;return i[24]!==m||i[25]!==h||i[26]!==r||i[27]!==a||i[28]!==s?(u=/* @__PURE__ */ c(n,{"data-slot":r,className:a,ref:h,svg:s,...m}),i[24]=m,i[25]=h,i[26]=r,i[27]=a,i[28]=s,i[29]=u):u=i[29],u}case`success`:{let r;i[30]===l?r=i[31]:(r=t(l,`toast-icon`),i[30]=l,i[31]=r);let a;i[32]===o?a=i[33]:(a=e(`text-success-600`,o),i[32]=o,i[33]=a);let s;i[34]===g?s=i[35]:(s=g??/* @__PURE__ */ c(u,{weight:`fill`}),i[34]=g,i[35]=s);let d;return i[36]!==m||i[37]!==h||i[38]!==r||i[39]!==a||i[40]!==s?(d=/* @__PURE__ */ c(n,{"data-slot":r,className:a,ref:h,svg:s,...m}),i[36]=m,i[37]=h,i[38]=r,i[39]=a,i[40]=s,i[41]=d):d=i[41],d}case`info`:{let r;i[42]===l?r=i[43]:(r=t(l,`toast-icon`),i[42]=l,i[43]=r);let a;i[44]===o?a=i[45]:(a=e(`text-accent-600`,o),i[44]=o,i[45]=a);let s;i[46]===g?s=i[47]:(s=g??/* @__PURE__ */ c(d,{weight:`fill`}),i[46]=g,i[47]=s);let u;return i[48]!==m||i[49]!==h||i[50]!==r||i[51]!==a||i[52]!==s?(u=/* @__PURE__ */ c(n,{"data-slot":r,className:a,ref:h,svg:s,...m}),i[48]=m,i[49]=h,i[50]=r,i[51]=a,i[52]=s,i[53]=u):u=i[53],u}default:throw Error(`Unreachable Case: ${String(_.intent)}`)}},Message:n=>{let i=a(16),o,s,l,u,d;i[0]===n?(o=i[1],s=i[2],l=i[3],u=i[4],d=i[5]):({"data-slot":l,asChild:o,className:s,ref:d,...u}=n,i[0]=n,i[1]=o,i[2]=s,i[3]=l,i[4]=u,i[5]=d);let f=o?r:`p`,p;i[6]===l?p=i[7]:(p=t(l,`toast-message`),i[6]=l,i[7]=p);let m;i[8]===s?m=i[9]:(m=e(`text-strong flex-1 text-sm font-body`,s),i[8]=s,i[9]=m);let h;return i[10]!==f||i[11]!==u||i[12]!==d||i[13]!==p||i[14]!==m?(h=/* @__PURE__ */ c(f,{"data-slot":p,className:m,ref:d,...u}),i[10]=f,i[11]=u,i[12]=d,i[13]=p,i[14]=m,i[15]=h):h=i[15],h}},S={info:`bg-accent-600`,warning:`bg-warning-600`,success:`bg-success-600`,danger:`bg-danger-600`};function C(t){let n=a(10),r,i,o;n[0]===t?(r=n[1],i=n[2],o=n[3]):({className:r,intent:i,...o}=t,n[0]=t,n[1]=r,n[2]=i,n[3]=o);let s=S[i],l;n[4]!==r||n[5]!==s?(l=e(`z-1 absolute -inset-px right-auto w-1.5 rounded-l`,s,r),n[4]=r,n[5]=s,n[6]=l):l=n[6];let u;return n[7]!==o||n[8]!==l?(u=/* @__PURE__ */ c(`div`,{"aria-hidden":!0,className:l,...o}),n[7]=o,n[8]=l,n[9]=u):u=n[9],u}export{x as Toast,_ as Toaster,y as makeToast};