@ngrok/mantle 0.93.7 → 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 +6 -6
  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
@@ -1,6 +1,11 @@
1
+ /**
2
+ * Re-exports for the Accordion component.
3
+ *
4
+ * @see https://mantle.ngrok.com/components/data-display/accordion
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
- import { n as IconProps } from "./icon-ByLVhdYq.js";
8
+ import { n as IconProps } from "./icon-NYvyyRMG.js";
4
9
  import { ComponentProps } from "react";
5
10
  /**
6
11
  * `"single"` mode props: at most one item open at a time — opening a section
@@ -261,6 +266,13 @@ declare const Body: ({ "data-slot": dataSlot, className, ref, ...props }: Compon
261
266
  * `Accordion.Root` defaults to `type="multiple"` (sections open independently);
262
267
  * pass `type="single"` when opening one section should auto-close the others.
263
268
  *
269
+ * @useWhen Stack titled sections that each expand and collapse in place, such as questions and
270
+ * answers or a group of advanced settings.
271
+ *
272
+ * @siblings
273
+ * - `Tabs`: one section shows at a time, and a row of tabs switches between them.
274
+ * - `Strata`: every section stays open, with its title and explanation beside its content.
275
+ *
264
276
  * @see https://mantle.ngrok.com/components/data-display/accordion
265
277
  *
266
278
  * @example
package/dist/accordion.js CHANGED
@@ -1 +1 @@
1
- import{n as e}from"./browser-only-BTSrYWLj.js";import{t}from"./use-isomorphic-layout-effect-CLSmHzo4.js";import{n}from"./compose-refs-sFdxsL7k.js";import{t as r}from"./cx-CK7o_rVv.js";import{t as i}from"./data-slot-EM6s2WEU.js";import{t as a}from"./icon-kK0c-POG.js";import{t as o}from"./slot-DdYN1L1C.js";import{c as s}from"react/compiler-runtime";import{CaretDownIcon as c}from"@phosphor-icons/react/CaretDown";import{createContext as l,useContext as u,useEffect as d,useId as f,useRef as p,useState as m}from"react";import h from"tiny-invariant";import{jsx as g}from"react/jsx-runtime";function _(e,t){return e.includes(t)}function v({openValues:e,value:t,open:n,type: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 y(e){return e==null?[]:typeof e==`string`?e===``?[]:[e]:e}function b(e,t){e.type===`single`?e.onValueChange?.(t[0]??``):e.onValueChange?.([...t])}function x(){return e()&&document.body!=null&&`onbeforematch`in document.body}const S=l(null);function C(e){let t=u(S);return h(t,`\`${e}\` must be rendered within \`Accordion.Root\`.`),t}const w=l(null);function T(e){let t=u(w);return h(t,`\`${e}\` must be rendered within \`Accordion.Item\`.`),t}const E=e=>{let n=s(42),a,c,l,u,d,f,h,_,x;if(n[0]!==e){let{type:t,value:r,defaultValue:i,onValueChange:o,"data-slot":s,asChild:p,children:m,className:g,ref:v,...y}=e;_=t,x=r,d=i,u=s,a=p,c=m,l=g,h=v,f=y,n[0]=e,n[1]=a,n[2]=c,n[3]=l,n[4]=u,n[5]=d,n[6]=f,n[7]=h,n[8]=_,n[9]=x}else a=n[1],c=n[2],l=n[3],u=n[4],d=n[5],f=n[6],h=n[7],_=n[8],x=n[9];let C=_===void 0?`multiple`:_,w=x!=null,T;n[10]===d?T=n[11]:(T=()=>y(d),n[10]=d,n[11]=T);let[E,D]=m(T),O;n[12]!==E||n[13]!==w||n[14]!==x?(O=w?y(x):E,n[12]=E,n[13]=w,n[14]=x,n[15]=O):O=n[15];let k=O,A=p(e),j;n[16]===e?j=n[17]:(j=()=>{A.current=e},n[16]=e,n[17]=j),t(j);let M;n[18]!==w||n[19]!==k||n[20]!==C?(M=e=>{let{itemValue:t,open:n}=e,r=v({openValues:k,value:t,open:n,type:C});r!==k&&(w||D(r),b(A.current,r))},n[18]=w,n[19]=k,n[20]=C,n[21]=M):M=n[21];let N=M,P;n[22]!==k||n[23]!==N||n[24]!==C?(P={type:C,openValues:k,setItemOpen:N},n[22]=k,n[23]=N,n[24]=C,n[25]=P):P=n[25];let F=P,I;n[26]===u?I=n[27]:(I=i(u,`accordion`),n[26]=u,n[27]=I);let L;n[28]===l?L=n[29]:(L=r(`w-full divide-y divide-separator`,l),n[28]=l,n[29]=L);let R;n[30]!==f||n[31]!==I||n[32]!==L?(R={...f,"data-slot":I,className:L},n[30]=f,n[31]=I,n[32]=L,n[33]=R):R=n[33];let z=R,B;n[34]!==a||n[35]!==c||n[36]!==z||n[37]!==h?(B=g(a?o:`div`,{ref:h,...z,children:c}),n[34]=a,n[35]=c,n[36]=z,n[37]=h,n[38]=B):B=n[38];let V;return n[39]!==F||n[40]!==B?(V=/* @__PURE__ */ g(S.Provider,{value:F,children:B}),n[39]=F,n[40]=B,n[41]=V):V=n[41],V},D=e=>{let t=s(27),n,r,a,o,c;t[0]===e?(n=t[1],r=t[2],a=t[3],o=t[4],c=t[5]):({"data-slot":r,children:n,value:c,ref:o,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=o,t[5]=c);let{openValues:l,setItemOpen:u}=C(`Accordion.Item`),d;t[6]!==l||t[7]!==c?(d=_(l,c),t[6]=l,t[7]=c,t[8]=d):d=t[8];let p=d,m=f(),h;t[9]!==u||t[10]!==c?(h=e=>{u({itemValue:c,open:e})},t[9]=u,t[10]=c,t[11]=h):h=t[11];let v=h,y;t[12]!==m||t[13]!==p||t[14]!==v?(y={open:p,setOpen:v,contentId:m},t[12]=m,t[13]=p,t[14]=v,t[15]=y):y=t[15];let b=y,x;t[16]===r?x=t[17]:(x=i(r,`accordion-item`),t[16]=r,t[17]=x);let S=p?`open`:`closed`,T;t[18]!==n||t[19]!==a||t[20]!==o||t[21]!==x||t[22]!==S?(T=/* @__PURE__ */ g(`div`,{ref:o,...a,role:`group`,"data-slot":x,"data-state":S,children:n}),t[18]=n,t[19]=a,t[20]=o,t[21]=x,t[22]=S,t[23]=T):T=t[23];let E;return t[24]!==b||t[25]!==T?(E=/* @__PURE__ */ g(w.Provider,{value:b,children:T}),t[24]=b,t[25]=T,t[26]=E):E=t[26],E},O=e=>{let t=s(25),n,a,o,c,l,u;t[0]===e?(n=t[1],a=t[2],o=t[3],c=t[4],l=t[5],u=t[6]):({"data-slot":o,className:a,children:n,onClick:c,ref:u,...l}=e,t[0]=e,t[1]=n,t[2]=a,t[3]=o,t[4]=c,t[5]=l,t[6]=u);let{open:d,setOpen:f,contentId:p}=T(`Accordion.Trigger`),m;t[7]===o?m=t[8]:(m=i(o,`accordion-trigger`),t[7]=o,t[8]=m);let h=d?`open`:`closed`,_;t[9]===a?_=t[10]:(_=r(`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`,`focus:outline-hidden focus-visible:ring-4 focus-visible:ring-focus-accent`,a),t[9]=a,t[10]=_);let v;t[11]!==c||t[12]!==d||t[13]!==f?(v=e=>{c?.(e),f(!d)},t[11]=c,t[12]=d,t[13]=f,t[14]=v):v=t[14];let y;return t[15]!==n||t[16]!==p||t[17]!==d||t[18]!==l||t[19]!==u||t[20]!==m||t[21]!==h||t[22]!==_||t[23]!==v?(y=/* @__PURE__ */ g(`button`,{ref:u,type:`button`,...l,"data-slot":m,"data-state":h,"aria-expanded":d,"aria-controls":p,className:_,onClick:v,children:n}),t[15]=n,t[16]=p,t[17]=d,t[18]=l,t[19]=u,t[20]=m,t[21]=h,t[22]=_,t[23]=v,t[24]=y):y=t[24],y},k=/* @__PURE__ */ g(c,{weight:`bold`}),A={Root:E,Item:D,Trigger:O,TriggerIcon:e=>{let t=s(14),n,o,c,l;t[0]===e?(n=t[1],o=t[2],c=t[3],l=t[4]):({"data-slot":o,className:n,svg:l,...c}=e,t[0]=e,t[1]=n,t[2]=o,t[3]=c,t[4]=l);let u=l===void 0?k:l,d;t[5]===o?d=t[6]:(d=i(o,`accordion-trigger-icon`),t[5]=o,t[6]=d);let f;t[7]===n?f=t[8]:(f=r(`h-lh w-4 shrink-0 self-start text-muted transition-transform duration-200 ease-out-strong group-data-state-open:rotate-180 motion-reduce:transition-none`,n),t[7]=n,t[8]=f);let p;return t[9]!==c||t[10]!==u||t[11]!==d||t[12]!==f?(p=/* @__PURE__ */ g(a,{...c,"data-slot":d,svg:u,className:f}),t[9]=c,t[10]=u,t[11]=d,t[12]=f,t[13]=p):p=t[13],p},Content:e=>{let a=s(25),o,c,l,u,f;a[0]===e?(o=a[1],c=a[2],l=a[3],u=a[4],f=a[5]):({"data-slot":l,className:c,children:o,ref:f,...u}=e,a[0]=e,a[1]=o,a[2]=c,a[3]=l,a[4]=u,a[5]=f);let{open:m,setOpen:h,contentId:_}=T(`Accordion.Content`),v=p(null),y=n(v,f),b,S;a[6]===h?(b=a[7],S=a[8]):(b=()=>{let e=v.current;if(!e||!x())return;let t=()=>{let{transitionProperty:t}=e.style;e.removeAttribute(`hidden`),e.style.transitionProperty=`none`,e.style.height=`auto`,e.style.opacity=`1`,e.getBoundingClientRect(),e.style.transitionProperty=t,h(!0)};return e.addEventListener(`beforematch`,t),()=>{e.removeEventListener(`beforematch`,t)}},S=[h],a[6]=h,a[7]=b,a[8]=S),d(b,S);let C,w;a[9]===m?(C=a[10],w=a[11]):(C=()=>{let e=v.current;e&&x()&&(e.removeAttribute(`inert`),m?e.removeAttribute(`hidden`):(e.setAttribute(`hidden`,`until-found`),e.style.height=``,e.style.opacity=``))},w=[m],a[9]=m,a[10]=C,a[11]=w),t(C,w);let E=!m,D;a[12]===l?D=a[13]:(D=i(l,`accordion-content`),a[12]=l,a[13]=D);let O=m?`open`:`closed`,k;a[14]===c?k=a[15]:(k=r(`h-0 overflow-hidden opacity-0 transition-[height,opacity,content-visibility] duration-200 ease-out-strong [interpolate-size:allow-keywords] transition-discrete data-state-open:h-auto data-state-open:opacity-100 motion-reduce:transition-none`,c),a[14]=c,a[15]=k);let A;return a[16]!==o||a[17]!==y||a[18]!==_||a[19]!==u||a[20]!==E||a[21]!==D||a[22]!==O||a[23]!==k?(A=/* @__PURE__ */ g(`div`,{ref:y,...u,id:_,inert:E,"data-slot":D,"data-state":O,className:k,children:o}),a[16]=o,a[17]=y,a[18]=_,a[19]=u,a[20]=E,a[21]=D,a[22]=O,a[23]=k,a[24]=A):A=a[24],A},Body:e=>{let t=s(14),n,a,o,c;t[0]===e?(n=t[1],a=t[2],o=t[3],c=t[4]):({"data-slot":a,className:n,ref:c,...o}=e,t[0]=e,t[1]=n,t[2]=a,t[3]=o,t[4]=c);let l;t[5]===a?l=t[6]:(l=i(a,`accordion-body`),t[5]=a,t[6]=l);let u;t[7]===n?u=t[8]:(u=r(`pt-1 pb-4`,n),t[7]=n,t[8]=u);let d;return t[9]!==o||t[10]!==c||t[11]!==l||t[12]!==u?(d=/* @__PURE__ */ g(`div`,{ref:c,...o,"data-slot":l,className:u}),t[9]=o,t[10]=c,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}};export{A as Accordion};
1
+ import{t as e}from"./use-isomorphic-layout-effect-CLSmHzo4.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{t as n}from"./cx-CK7o_rVv.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{t as i}from"./icon-kK0c-POG.js";import{t as a}from"./slot-DdYN1L1C.js";import{n as o}from"./browser-only-BTSrYWLj.js";import{c as s}from"react/compiler-runtime";import{CaretDownIcon as c}from"@phosphor-icons/react/CaretDown";import{createContext as l,useContext as u,useEffect as d,useId as f,useRef as p,useState as m}from"react";import h from"tiny-invariant";import{jsx as g}from"react/jsx-runtime";function _(e,t){return e.includes(t)}function v({openValues:e,value:t,open:n,type: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 y(e){return e==null?[]:typeof e==`string`?e===``?[]:[e]:e}function b(e,t){e.type===`single`?e.onValueChange?.(t[0]??``):e.onValueChange?.([...t])}function x(){return o()&&document.body!=null&&`onbeforematch`in document.body}const S=l(null);function C(e){let t=u(S);return h(t,`\`${e}\` must be rendered within \`Accordion.Root\`.`),t}const w=l(null);function T(e){let t=u(w);return h(t,`\`${e}\` must be rendered within \`Accordion.Item\`.`),t}const E=t=>{let i=s(42),o,c,l,u,d,f,h,_,x;if(i[0]!==t){let{type:e,value:n,defaultValue:r,onValueChange:a,"data-slot":s,asChild:p,children:m,className:g,ref:v,...y}=t;_=e,x=n,d=r,u=s,o=p,c=m,l=g,h=v,f=y,i[0]=t,i[1]=o,i[2]=c,i[3]=l,i[4]=u,i[5]=d,i[6]=f,i[7]=h,i[8]=_,i[9]=x}else o=i[1],c=i[2],l=i[3],u=i[4],d=i[5],f=i[6],h=i[7],_=i[8],x=i[9];let C=_===void 0?`multiple`:_,w=x!=null,T;i[10]===d?T=i[11]:(T=()=>y(d),i[10]=d,i[11]=T);let[E,D]=m(T),O;i[12]!==E||i[13]!==w||i[14]!==x?(O=w?y(x):E,i[12]=E,i[13]=w,i[14]=x,i[15]=O):O=i[15];let k=O,A=p(t),j;i[16]===t?j=i[17]:(j=()=>{A.current=t},i[16]=t,i[17]=j),e(j);let M;i[18]!==w||i[19]!==k||i[20]!==C?(M=e=>{let{itemValue:t,open:n}=e,r=v({openValues:k,value:t,open:n,type:C});r!==k&&(w||D(r),b(A.current,r))},i[18]=w,i[19]=k,i[20]=C,i[21]=M):M=i[21];let N=M,P;i[22]!==k||i[23]!==N||i[24]!==C?(P={type:C,openValues:k,setItemOpen:N},i[22]=k,i[23]=N,i[24]=C,i[25]=P):P=i[25];let F=P,I;i[26]===u?I=i[27]:(I=r(u,`accordion`),i[26]=u,i[27]=I);let L;i[28]===l?L=i[29]:(L=n(`w-full divide-y divide-separator`,l),i[28]=l,i[29]=L);let R;i[30]!==f||i[31]!==I||i[32]!==L?(R={...f,"data-slot":I,className:L},i[30]=f,i[31]=I,i[32]=L,i[33]=R):R=i[33];let z=R,B;i[34]!==o||i[35]!==c||i[36]!==z||i[37]!==h?(B=g(o?a:`div`,{ref:h,...z,children:c}),i[34]=o,i[35]=c,i[36]=z,i[37]=h,i[38]=B):B=i[38];let V;return i[39]!==F||i[40]!==B?(V=/* @__PURE__ */ g(S.Provider,{value:F,children:B}),i[39]=F,i[40]=B,i[41]=V):V=i[41],V},D=e=>{let t=s(27),n,i,a,o,c;t[0]===e?(n=t[1],i=t[2],a=t[3],o=t[4],c=t[5]):({"data-slot":i,children:n,value:c,ref:o,...a}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=c);let{openValues:l,setItemOpen:u}=C(`Accordion.Item`),d;t[6]!==l||t[7]!==c?(d=_(l,c),t[6]=l,t[7]=c,t[8]=d):d=t[8];let p=d,m=f(),h;t[9]!==u||t[10]!==c?(h=e=>{u({itemValue:c,open:e})},t[9]=u,t[10]=c,t[11]=h):h=t[11];let v=h,y;t[12]!==m||t[13]!==p||t[14]!==v?(y={open:p,setOpen:v,contentId:m},t[12]=m,t[13]=p,t[14]=v,t[15]=y):y=t[15];let b=y,x;t[16]===i?x=t[17]:(x=r(i,`accordion-item`),t[16]=i,t[17]=x);let S=p?`open`:`closed`,T;t[18]!==n||t[19]!==a||t[20]!==o||t[21]!==x||t[22]!==S?(T=/* @__PURE__ */ g(`div`,{ref:o,...a,role:`group`,"data-slot":x,"data-state":S,children:n}),t[18]=n,t[19]=a,t[20]=o,t[21]=x,t[22]=S,t[23]=T):T=t[23];let E;return t[24]!==b||t[25]!==T?(E=/* @__PURE__ */ g(w.Provider,{value:b,children:T}),t[24]=b,t[25]=T,t[26]=E):E=t[26],E},O=e=>{let t=s(25),i,a,o,c,l,u;t[0]===e?(i=t[1],a=t[2],o=t[3],c=t[4],l=t[5],u=t[6]):({"data-slot":o,className:a,children:i,onClick:c,ref:u,...l}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=o,t[4]=c,t[5]=l,t[6]=u);let{open:d,setOpen:f,contentId:p}=T(`Accordion.Trigger`),m;t[7]===o?m=t[8]:(m=r(o,`accordion-trigger`),t[7]=o,t[8]=m);let h=d?`open`:`closed`,_;t[9]===a?_=t[10]:(_=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`,`focus:outline-hidden focus-visible:ring-4 focus-visible:ring-focus-accent`,a),t[9]=a,t[10]=_);let v;t[11]!==c||t[12]!==d||t[13]!==f?(v=e=>{c?.(e),f(!d)},t[11]=c,t[12]=d,t[13]=f,t[14]=v):v=t[14];let y;return t[15]!==i||t[16]!==p||t[17]!==d||t[18]!==l||t[19]!==u||t[20]!==m||t[21]!==h||t[22]!==_||t[23]!==v?(y=/* @__PURE__ */ g(`button`,{ref:u,type:`button`,...l,"data-slot":m,"data-state":h,"aria-expanded":d,"aria-controls":p,className:_,onClick:v,children:i}),t[15]=i,t[16]=p,t[17]=d,t[18]=l,t[19]=u,t[20]=m,t[21]=h,t[22]=_,t[23]=v,t[24]=y):y=t[24],y},k=/* @__PURE__ */ g(c,{weight:`bold`}),A={Root:E,Item:D,Trigger:O,TriggerIcon:e=>{let t=s(14),a,o,c,l;t[0]===e?(a=t[1],o=t[2],c=t[3],l=t[4]):({"data-slot":o,className:a,svg:l,...c}=e,t[0]=e,t[1]=a,t[2]=o,t[3]=c,t[4]=l);let u=l===void 0?k:l,d;t[5]===o?d=t[6]:(d=r(o,`accordion-trigger-icon`),t[5]=o,t[6]=d);let f;t[7]===a?f=t[8]:(f=n(`h-lh w-4 shrink-0 self-start text-muted transition-transform duration-200 ease-out-strong group-data-state-open:rotate-180 motion-reduce:transition-none`,a),t[7]=a,t[8]=f);let p;return t[9]!==c||t[10]!==u||t[11]!==d||t[12]!==f?(p=/* @__PURE__ */ g(i,{...c,"data-slot":d,svg:u,className:f}),t[9]=c,t[10]=u,t[11]=d,t[12]=f,t[13]=p):p=t[13],p},Content:i=>{let a=s(25),o,c,l,u,f;a[0]===i?(o=a[1],c=a[2],l=a[3],u=a[4],f=a[5]):({"data-slot":l,className:c,children:o,ref:f,...u}=i,a[0]=i,a[1]=o,a[2]=c,a[3]=l,a[4]=u,a[5]=f);let{open:m,setOpen:h,contentId:_}=T(`Accordion.Content`),v=p(null),y=t(v,f),b,S;a[6]===h?(b=a[7],S=a[8]):(b=()=>{let e=v.current;if(!e||!x())return;let t=()=>{let{transitionProperty:t}=e.style;e.removeAttribute(`hidden`),e.style.transitionProperty=`none`,e.style.height=`auto`,e.style.opacity=`1`,e.getBoundingClientRect(),e.style.transitionProperty=t,h(!0)};return e.addEventListener(`beforematch`,t),()=>{e.removeEventListener(`beforematch`,t)}},S=[h],a[6]=h,a[7]=b,a[8]=S),d(b,S);let C,w;a[9]===m?(C=a[10],w=a[11]):(C=()=>{let e=v.current;e&&x()&&(e.removeAttribute(`inert`),m?e.removeAttribute(`hidden`):(e.setAttribute(`hidden`,`until-found`),e.style.height=``,e.style.opacity=``))},w=[m],a[9]=m,a[10]=C,a[11]=w),e(C,w);let E=!m,D;a[12]===l?D=a[13]:(D=r(l,`accordion-content`),a[12]=l,a[13]=D);let O=m?`open`:`closed`,k;a[14]===c?k=a[15]:(k=n(`h-0 overflow-hidden opacity-0 transition-[height,opacity,content-visibility] duration-200 ease-out-strong [interpolate-size:allow-keywords] transition-discrete data-state-open:h-auto data-state-open:opacity-100 motion-reduce:transition-none`,c),a[14]=c,a[15]=k);let A;return a[16]!==o||a[17]!==y||a[18]!==_||a[19]!==u||a[20]!==E||a[21]!==D||a[22]!==O||a[23]!==k?(A=/* @__PURE__ */ g(`div`,{ref:y,...u,id:_,inert:E,"data-slot":D,"data-state":O,className:k,children:o}),a[16]=o,a[17]=y,a[18]=_,a[19]=u,a[20]=E,a[21]=D,a[22]=O,a[23]=k,a[24]=A):A=a[24],A},Body:e=>{let t=s(14),i,a,o,c;t[0]===e?(i=t[1],a=t[2],o=t[3],c=t[4]):({"data-slot":a,className:i,ref:c,...o}=e,t[0]=e,t[1]=i,t[2]=a,t[3]=o,t[4]=c);let l;t[5]===a?l=t[6]:(l=r(a,`accordion-body`),t[5]=a,t[6]=l);let u;t[7]===i?u=t[8]:(u=n(`pt-1 pb-4`,i),t[7]=i,t[8]=u);let d;return t[9]!==o||t[10]!==c||t[11]!==l||t[12]!==u?(d=/* @__PURE__ */ g(`div`,{ref:c,...o,"data-slot":l,className:u}),t[9]=o,t[10]=c,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}};export{A as Accordion};