@ngrok/mantle 0.94.0 → 0.94.1

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 (299) hide show
  1. package/README.md +11 -2
  2. package/dist/accordion.d.ts +61 -21
  3. package/dist/accordion.js +1 -1
  4. package/dist/agent.json +61 -56
  5. package/dist/alert-BkJHDx9X.js +1 -0
  6. package/dist/{alert-HffaioZM.d.ts → alert-D0zRRUHV.d.ts} +6 -6
  7. package/dist/alert-center.d.ts +53 -53
  8. package/dist/alert-center.js +1 -1
  9. package/dist/alert-dialog.d.ts +22 -10
  10. package/dist/alert-dialog.js +1 -1
  11. package/dist/alert.d.ts +1 -1
  12. package/dist/alert.js +1 -1
  13. package/dist/anchor-Dc6IgvXV.js +1 -0
  14. package/dist/anchor.d.ts +5 -5
  15. package/dist/anchor.js +1 -1
  16. package/dist/app-layout.d.ts +18 -18
  17. package/dist/app-layout.js +1 -1
  18. package/dist/area-chart.d.ts +13 -13
  19. package/dist/area-chart.js +1 -1
  20. package/dist/avatar.d.ts +24 -24
  21. package/dist/avatar.js +1 -1
  22. package/dist/badge.d.ts +7 -7
  23. package/dist/badge.js +1 -1
  24. package/dist/bar-chart.d.ts +12 -12
  25. package/dist/bar-chart.js +1 -1
  26. package/dist/breadcrumb.d.ts +36 -36
  27. package/dist/breadcrumb.js +1 -1
  28. package/dist/browser-only-CZfkNw5A.js +1 -0
  29. package/dist/browser-only-ymFoM3Ya.js +1 -0
  30. package/dist/browser-only.js +1 -1
  31. package/dist/{button-K0pKc3GN.d.ts → button-5Pc7Mby_.d.ts} +3 -3
  32. package/dist/button-B9bChDgl.js +1 -0
  33. package/dist/button-D8jixIbH.js +1 -0
  34. package/dist/button-DNLTJ32M.js +1 -0
  35. package/dist/{button-Cgf2IcEC.d.ts → button-Ddj6yr10.d.ts} +26 -26
  36. package/dist/{button-BGwOPjGV.d.ts → button-DnYv7IOT.d.ts} +22 -21
  37. package/dist/button.d.ts +3 -3
  38. package/dist/button.js +1 -1
  39. package/dist/calendar.d.ts +1 -1
  40. package/dist/calendar.js +1 -1
  41. package/dist/card.d.ts +1 -1
  42. package/dist/card.js +1 -1
  43. package/dist/centered-layout.d.ts +23 -23
  44. package/dist/centered-layout.js +1 -1
  45. package/dist/{chart-CE5Uaqz9.js → chart-BLCqzt56.js} +1 -1
  46. package/dist/{chart-DCTGGlWL.js → chart-CChZiCrt.js} +1 -1
  47. package/dist/{chart-BO9EwQ60.js → chart-CUmSu9d7.js} +1 -1
  48. package/dist/{chart-jitNqimS.d.ts → chart-Dl8gFo_D.d.ts} +22 -22
  49. package/dist/chart-DtgZBAas.js +2 -0
  50. package/dist/checkbox-Cu5cgZmk.js +1 -0
  51. package/dist/checkbox.d.ts +1 -1
  52. package/dist/checkbox.js +1 -1
  53. package/dist/choice-CCVG2hb9.js +1 -0
  54. package/dist/{choice-BwfmbepO.d.ts → choice-CNiOSzqV.d.ts} +20 -20
  55. package/dist/choice.d.ts +1 -1
  56. package/dist/choice.js +1 -1
  57. package/dist/code-BPKNY1_w.js +1 -0
  58. package/dist/{code-block-BGdV4Yty.d.ts → code-block-BDw6MEwH.d.ts} +9 -9
  59. package/dist/{code-block-W3kWPxCJ.js → code-block-CKzsAMzj.js} +3 -3
  60. package/dist/code-block.d.ts +15 -17
  61. package/dist/code-block.js +1 -1
  62. package/dist/code-block_highlight-utils.d.ts +1 -1
  63. package/dist/code-block_highlight-utils.js +1 -1
  64. package/dist/code.d.ts +3 -3
  65. package/dist/code.js +1 -1
  66. package/dist/combobox.d.ts +15 -15
  67. package/dist/combobox.js +1 -1
  68. package/dist/command.d.ts +47 -47
  69. package/dist/command.js +1 -1
  70. package/dist/compose-refs-BdRUneoc.js +1 -0
  71. package/dist/{copy-to-clipboard-DInu78k_.js → copy-to-clipboard-Dd83caRw.js} +1 -1
  72. package/dist/cx.d.ts +4 -4
  73. package/dist/{data-slot-B-LqAcBB.d.ts → data-slot-BW8KQ9Xo.d.ts} +2 -2
  74. package/dist/data-table.d.ts +36 -36
  75. package/dist/data-table.js +1 -1
  76. package/dist/description-list.d.ts +1 -1
  77. package/dist/description-list.js +1 -1
  78. package/dist/{dialog-DD5H3EH1.d.ts → dialog-CIEuwNys.d.ts} +24 -8
  79. package/dist/{dialog-B9JAGy_x.d.ts → dialog-CbEEA0fl.d.ts} +7 -3
  80. package/dist/dialog-DmzoDfY3.js +1 -0
  81. package/dist/dialog.d.ts +2 -2
  82. package/dist/dialog.js +1 -1
  83. package/dist/{dropdown-menu-DmDxYPde.d.ts → dropdown-menu-CeY498yk.d.ts} +10 -10
  84. package/dist/dropdown-menu-uheL0prz.js +1 -0
  85. package/dist/dropdown-menu.d.ts +1 -1
  86. package/dist/dropdown-menu.js +1 -1
  87. package/dist/empty.d.ts +2 -2
  88. package/dist/empty.js +1 -1
  89. package/dist/field-Bpvn4tQp.js +1 -0
  90. package/dist/field-Cai_4c1l.js +1 -0
  91. package/dist/field.d.ts +41 -41
  92. package/dist/field.js +1 -1
  93. package/dist/flag.d.ts +3 -3
  94. package/dist/flag.js +1 -1
  95. package/dist/hooks.d.ts +30 -10
  96. package/dist/hooks.js +1 -1
  97. package/dist/hover-card.d.ts +3 -3
  98. package/dist/hover-card.js +1 -1
  99. package/dist/{icon-CgNqu-fl.d.ts → icon--purqHRo.d.ts} +1 -1
  100. package/dist/{icon-NYvyyRMG.d.ts → icon-DuIYoyft.d.ts} +2 -2
  101. package/dist/{icon-DXDyhy2N.d.ts → icon-QCm1ui29.d.ts} +2 -2
  102. package/dist/icon-xb7d9M7X.js +1 -0
  103. package/dist/icon.d.ts +3 -3
  104. package/dist/icon.js +1 -1
  105. package/dist/icons-DEDCLZ8B.js +1 -0
  106. package/dist/icons-DXadFwpo.js +1 -0
  107. package/dist/icons-DcesO4Ng.js +1 -0
  108. package/dist/icons.d.ts +2 -2
  109. package/dist/icons.js +1 -1
  110. package/dist/{in-view-B3nMAzfE.d.ts → in-view-C_daNafg.d.ts} +4 -23
  111. package/dist/{input-q8o5uMhW.d.ts → input-DC4nW0Sr.d.ts} +1 -1
  112. package/dist/input-fW8QSZEO.js +1 -0
  113. package/dist/input.d.ts +4 -4
  114. package/dist/input.js +1 -1
  115. package/dist/kbd-P1nQshWo.js +1 -0
  116. package/dist/kbd.d.ts +5 -5
  117. package/dist/kbd.js +1 -1
  118. package/dist/label-DO1RlMKl.js +1 -0
  119. package/dist/{label-r2sJcSQ4.d.ts → label-epgtywRz.d.ts} +8 -8
  120. package/dist/label.d.ts +1 -1
  121. package/dist/label.js +1 -1
  122. package/dist/layer-container-DL4yclOu.js +1 -0
  123. package/dist/layer-container.d.ts +2 -2
  124. package/dist/layer-container.js +1 -1
  125. package/dist/line-chart.d.ts +12 -12
  126. package/dist/line-chart.js +1 -1
  127. package/dist/list-cQZPSjfz.js +1 -0
  128. package/dist/list.d.ts +17 -17
  129. package/dist/list.js +1 -1
  130. package/dist/live-region-Dhapu8a5.js +1 -0
  131. package/dist/live-region.d.ts +1 -1
  132. package/dist/live-region.js +1 -1
  133. package/dist/llms.txt +23 -22
  134. package/dist/main-CHyWYDak.js +1 -0
  135. package/dist/main.d.ts +1 -1
  136. package/dist/main.js +1 -1
  137. package/dist/mantle.css +25 -25
  138. package/dist/media-object.d.ts +4 -4
  139. package/dist/media-object.js +1 -1
  140. package/dist/multi-select.d.ts +28 -28
  141. package/dist/multi-select.js +1 -1
  142. package/dist/otp-input.d.ts +3 -3
  143. package/dist/otp-input.js +1 -1
  144. package/dist/pagination.d.ts +4 -4
  145. package/dist/pagination.js +1 -1
  146. package/dist/{popover-lwkwWcRW.d.ts → popover-Bei0jyfH.d.ts} +73 -7
  147. package/dist/popover-DhgunktK.js +1 -0
  148. package/dist/popover-T2EyaqGK.d.ts +1 -0
  149. package/dist/popover.d.ts +2 -2
  150. package/dist/popover.js +1 -1
  151. package/dist/primitive-D8CzV_Ft.js +1 -0
  152. package/dist/progress.d.ts +1 -1
  153. package/dist/progress.js +1 -1
  154. package/dist/qr-code.d.ts +3 -3
  155. package/dist/qr-code.js +1 -1
  156. package/dist/query-filter.d.ts +6 -6
  157. package/dist/query.d.ts +8 -3
  158. package/dist/query.js +1 -1
  159. package/dist/{radio-group-sLz5AA9I.d.ts → radio-group-BJQ6EOqh.d.ts} +1 -1
  160. package/dist/radio-group-BliblUqe.js +1 -0
  161. package/dist/radio-group-ggEkCi0V.js +1 -0
  162. package/dist/radio-group.d.ts +2 -2
  163. package/dist/radio-group.js +1 -1
  164. package/dist/sandbar.d.ts +30 -30
  165. package/dist/sandbar.js +1 -1
  166. package/dist/sandboxed-on-click-D4PL5_GR.js +1 -0
  167. package/dist/sandboxed-on-click.js +1 -1
  168. package/dist/scatter-plot.d.ts +13 -14
  169. package/dist/scatter-plot.js +1 -1
  170. package/dist/segmented-control.d.ts +1 -1
  171. package/dist/segmented-control.js +1 -1
  172. package/dist/select-1xuUx_os.js +1 -0
  173. package/dist/{select-BqmpVJJT.d.ts → select-BpaXHxJm.d.ts} +6 -6
  174. package/dist/select.d.ts +1 -1
  175. package/dist/select.js +1 -1
  176. package/dist/selectable-list.d.ts +18 -18
  177. package/dist/selectable-list.js +1 -1
  178. package/dist/{separator-QfH0ot5K.d.ts → separator-Ck4sPrdN.d.ts} +1 -1
  179. package/dist/separator-DnvhwY2J.js +1 -0
  180. package/dist/separator.d.ts +1 -1
  181. package/dist/separator.js +1 -1
  182. package/dist/{shake-DL6WhMXM.js → shake-CAUpKBHe.js} +1 -1
  183. package/dist/sheet-DHy_vlme.js +1 -0
  184. package/dist/sheet.d.ts +23 -7
  185. package/dist/sheet.js +1 -1
  186. package/dist/sidebar.d.ts +37 -37
  187. package/dist/sidebar.js +1 -1
  188. package/dist/skeleton-DHfyjuQi.js +1 -0
  189. package/dist/skeleton.d.ts +4 -4
  190. package/dist/skeleton.js +1 -1
  191. package/dist/skip-to-main-link.d.ts +1 -1
  192. package/dist/skip-to-main-link.js +1 -1
  193. package/dist/slider.d.ts +1 -1
  194. package/dist/slider.js +1 -1
  195. package/dist/slot-B7rwscwd.js +1 -0
  196. package/dist/{slot-D12N_fZJ.d.ts → slot-BEMQMbk3.d.ts} +4 -4
  197. package/dist/slot.d.ts +1 -1
  198. package/dist/slot.js +1 -1
  199. package/dist/source-all.css +5 -1
  200. package/dist/split-button.d.ts +9 -9
  201. package/dist/split-button.js +1 -1
  202. package/dist/strata.d.ts +22 -22
  203. package/dist/strata.js +1 -1
  204. package/dist/{suggestions-NkqYTT49.d.ts → suggestions-BJeGvwDa.d.ts} +7 -7
  205. package/dist/switch.d.ts +1 -1
  206. package/dist/switch.js +1 -1
  207. package/dist/table-BnLdXUai.js +1 -0
  208. package/dist/{table-rWiVWEgB.d.ts → table-Ii9hHUWN.d.ts} +5 -5
  209. package/dist/table.d.ts +1 -1
  210. package/dist/table.js +1 -1
  211. package/dist/tabs.d.ts +2 -2
  212. package/dist/tabs.js +1 -1
  213. package/dist/text-area.d.ts +1 -1
  214. package/dist/text-area.js +1 -1
  215. package/dist/theme-BNdZl352.js +1 -0
  216. package/dist/theme-switcher.d.ts +4 -4
  217. package/dist/theme-switcher.js +1 -1
  218. package/dist/theme.d.ts +14 -12
  219. package/dist/theme.js +1 -1
  220. package/dist/toast.d.ts +2 -2
  221. package/dist/toast.js +1 -1
  222. package/dist/tokens.dark.json +3261 -0
  223. package/dist/tokens.json +4933 -0
  224. package/dist/tokens.resolver.json +37 -0
  225. package/dist/{tooltip-CpK3XTor.d.ts → tooltip-CstGDKwy.d.ts} +4 -4
  226. package/dist/tooltip-DQO40Mrq.js +1 -0
  227. package/dist/tooltip.d.ts +1 -1
  228. package/dist/tooltip.js +1 -1
  229. package/dist/truncated-text.d.ts +1 -1
  230. package/dist/truncated-text.js +1 -1
  231. package/dist/use-breakpoint-B4Kh0xE6.js +1 -0
  232. package/dist/use-callback-ref-DiOXFQzM.js +1 -0
  233. package/dist/use-composed-refs-DPYmLDSe.js +1 -0
  234. package/dist/use-copy-to-clipboard-hBL6_65i.js +1 -0
  235. package/dist/use-inert-siblings-C4RHXrZc.js +1 -0
  236. package/dist/use-is-apple-platform-Bq6_KbVX.js +1 -0
  237. package/dist/use-is-hydrated-BeLOGKwE.js +1 -0
  238. package/dist/use-is-hydrated-after-paint-CrHt3OHw.js +1 -0
  239. package/dist/use-isomorphic-layout-effect-CL6iq0Bj.js +1 -0
  240. package/dist/use-matches-media-query-FfvtNKQe.js +1 -0
  241. package/dist/use-prefers-reduced-motion-Ck6dnOM9.js +1 -0
  242. package/dist/use-swipe-to-dismiss-BYdlca8r.js +1 -0
  243. package/dist/utils.d.ts +1 -1
  244. package/dist/utils.js +1 -1
  245. package/dist/visually-hidden.d.ts +1 -1
  246. package/dist/visually-hidden.js +1 -1
  247. package/dist/well.d.ts +1 -1
  248. package/dist/well.js +1 -1
  249. package/package.json +16 -2
  250. package/dist/alert-CH99Rw-R.js +0 -1
  251. package/dist/anchor-CgcbWEUs.js +0 -1
  252. package/dist/browser-only-BTSrYWLj.js +0 -1
  253. package/dist/button-69InNC_m.js +0 -1
  254. package/dist/button-BWGUuWnu.js +0 -1
  255. package/dist/button-Cu9e3SM7.js +0 -1
  256. package/dist/chart-DudCw24t.js +0 -2
  257. package/dist/checkbox-CS504fKk.js +0 -1
  258. package/dist/choice-uyYccm0A.js +0 -1
  259. package/dist/code-DUJzSl4K.js +0 -1
  260. package/dist/compose-refs-sFdxsL7k.js +0 -1
  261. package/dist/dialog-CsugEt2A.js +0 -1
  262. package/dist/dropdown-menu-DHdgaw4P.js +0 -1
  263. package/dist/field-Bihblt8U.js +0 -1
  264. package/dist/field-CPvjazWN.js +0 -1
  265. package/dist/icon-kK0c-POG.js +0 -1
  266. package/dist/icons-4JA-SGfv.js +0 -1
  267. package/dist/icons-CDLz5lpI.js +0 -1
  268. package/dist/icons-CSwTVV2m.js +0 -1
  269. package/dist/input-DHovzBjS.js +0 -1
  270. package/dist/kbd-CLHsJ99p.js +0 -1
  271. package/dist/label-DmDwzPD8.js +0 -1
  272. package/dist/layer-container-kEQiE4zV.js +0 -1
  273. package/dist/list-CO_yLdln.js +0 -1
  274. package/dist/live-region-DQ1QLv3L.js +0 -1
  275. package/dist/main-CC1L9IsH.js +0 -1
  276. package/dist/popover-BhTFutCz.d.ts +0 -1
  277. package/dist/popover-DxOqLKxy.js +0 -1
  278. package/dist/primitive-Dz9Al-us.js +0 -1
  279. package/dist/radio-group-HDVxTNPi.js +0 -1
  280. package/dist/radio-group-jj2abc0t.js +0 -1
  281. package/dist/sandboxed-on-click-C7pPu-2M.js +0 -1
  282. package/dist/select-C6Su0dU0.js +0 -1
  283. package/dist/separator-DfzxVutO.js +0 -1
  284. package/dist/sheet-Bd2LIhzF.js +0 -1
  285. package/dist/skeleton-DBpI-ko5.js +0 -1
  286. package/dist/slot-DdYN1L1C.js +0 -1
  287. package/dist/table-CFHiDBW8.js +0 -1
  288. package/dist/theme-DdZgLvKH.js +0 -1
  289. package/dist/tooltip-b6oiTaWq.js +0 -1
  290. package/dist/use-breakpoint--mo7kr9d.js +0 -1
  291. package/dist/use-callback-ref-BvVyI5K1.js +0 -1
  292. package/dist/use-copy-to-clipboard-Dy_0Qzb7.js +0 -1
  293. package/dist/use-inert-siblings-CNmNuS2h.js +0 -1
  294. package/dist/use-is-apple-platform-D4nifHMx.js +0 -1
  295. package/dist/use-is-hydrated-after-paint-r9Cl2mGp.js +0 -1
  296. package/dist/use-isomorphic-layout-effect-CLSmHzo4.js +0 -1
  297. package/dist/use-matches-media-query-m860lols.js +0 -1
  298. package/dist/use-prefers-reduced-motion-CU6mWmOe.js +0 -1
  299. package/dist/use-swipe-to-dismiss-i__cTF2v.js +0 -1
package/README.md CHANGED
@@ -14,7 +14,6 @@
14
14
  ## Documentation
15
15
 
16
16
  - [mantle.ngrok.com](https://mantle.ngrok.com) - our official component documentation site (reflects latest releases)
17
- - [develop.mantle.ngrok.com](https://develop.mantle.ngrok.com) - staging site for all merges to `main`
18
17
 
19
18
  ## Installation
20
19
 
@@ -40,7 +39,17 @@ Next, check out the [Overview & Setup](https://mantle.ngrok.com/) docs and start
40
39
 
41
40
  ## Using with AI Agents
42
41
 
43
- Mantle ships machine-readable entry points for coding agents — see [For AI Agents](https://mantle.ngrok.com/for-ai-agents) for the system-prompt snippet, conventions, and the full list of `/api/*.json` and `llms.txt` endpoints. An offline pointer file (`@ngrok/mantle/agent.json`) is included in the published package as a fallback when network access isn't available.
42
+ Mantle runs a hosted, read-only [MCP](https://modelcontextprotocol.io) server at `https://mantle.ngrok.com/mcp`. It reads the API of the version you installed. [For AI Agents](https://mantle.ngrok.com/for-ai-agents) has the setup for each client, the system-prompt snippet, and the full list of `/api/*.json` and `llms.txt` endpoints.
43
+
44
+ The package also works offline:
45
+
46
+ - `@ngrok/mantle/agent.json`: the full component, hook, and utility records for the installed version.
47
+ - `@ngrok/mantle/llms.txt`: one line for each module, with its import path and summary.
48
+ - `dist/migrations/`: the codemods that the migration guides name.
49
+
50
+ ## Design tokens
51
+
52
+ `@ngrok/mantle/tokens.json` holds mantle's design tokens in the [Design Tokens Community Group (DTCG)](https://www.designtokens.org/tr/2025.10/format/) format, with their light theme values. `@ngrok/mantle/tokens.dark.json` holds the tokens that change in the dark theme, and `@ngrok/mantle/tokens.resolver.json` is a DTCG resolver document that applies them. A token path joined with `-` names its Tailwind theme variable: `color.sky.500` is `--color-sky-500`.
44
53
 
45
54
  ## Code Block Tooling
46
55
 
@@ -4,11 +4,11 @@
4
4
  * @see https://mantle.ngrok.com/components/data-display/accordion
5
5
  */
6
6
  import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
7
- import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
8
- import { n as IconProps } from "./icon-NYvyyRMG.js";
7
+ import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
8
+ import { n as IconProps } from "./icon-DuIYoyft.js";
9
9
  import { ComponentProps } from "react";
10
10
  /**
11
- * `"single"` mode props: at most one item open at a time — opening a section
11
+ * `"single"` mode props: at most one item open at a time. Opening a section
12
12
  * auto-closes the previously open one. This is the **opt-in** behavior; `type`
13
13
  * defaults to `"multiple"`, so you must set `type="single"` explicitly to get
14
14
  * the auto-close accordion. `value`/`defaultValue` are the open item's value
@@ -17,7 +17,7 @@ import { ComponentProps } from "react";
17
17
  type AccordionSingleProps = {
18
18
  /**
19
19
  * Keep at most one section open at a time: opening a section auto-closes the
20
- * previously open one. Must be set explicitly — the default is `"multiple"`,
20
+ * previously open one. Must be set explicitly: the default is `"multiple"`,
21
21
  * where sections open independently.
22
22
  */
23
23
  type: "single";
@@ -29,15 +29,15 @@ type AccordionSingleProps = {
29
29
  onValueChange?: (value: string) => void;
30
30
  };
31
31
  /**
32
- * `"multiple"` mode props — the **default** when `type` is omitted: any number
32
+ * `"multiple"` mode props, the **default** when `type` is omitted. Any number
33
33
  * of items may be open at once, and opening one never closes another.
34
34
  * `value`/`defaultValue` are the list of open item values. Use `type="single"`
35
35
  * instead if you want opening a section to auto-close the others.
36
36
  */
37
37
  type AccordionMultipleProps = {
38
38
  /**
39
- * Allow any number of sections open at once — the **default** when `type` is
40
- * omitted. Opening one section never collapses the others. Switch to
39
+ * Allow any number of sections open at once. This is the **default** when
40
+ * `type` is omitted. Opening one section never collapses the others. Switch to
41
41
  * `type="single"` for the accordion that auto-closes the previously open
42
42
  * section.
43
43
  *
@@ -55,7 +55,7 @@ type AccordionMultipleProps = {
55
55
  * Props for {@link Root}. A discriminated union on `type` so `value`,
56
56
  * `defaultValue`, and `onValueChange` are typed as a single string in
57
57
  * `"single"` mode and a string array in `"multiple"` mode. `type` is optional
58
- * and **defaults to `"multiple"`** — omitting it is the same as
58
+ * and **defaults to `"multiple"`**. Omitting it is the same as
59
59
  * `type="multiple"` (sections open independently), so `value` / `defaultValue` /
60
60
  * `onValueChange` are typed as string arrays. Set `type="single"` for the
61
61
  * accordion that keeps at most one section open at a time. Also accepts all
@@ -73,8 +73,8 @@ type AccordionRootProps = (AccordionSingleProps | AccordionMultipleProps) & Omit
73
73
  * with controlled (`value` + `onValueChange`) and uncontrolled (`defaultValue`)
74
74
  * usage in both `"single"` and `"multiple"` modes.
75
75
  *
76
- * `type` is optional and **defaults to `"multiple"`** — sections open
77
- * independently and opening one never closes another. Pass `type="single"` for
76
+ * `type` is optional and **defaults to `"multiple"`**: sections open
77
+ * independently, and opening one never closes another. Pass `type="single"` for
78
78
  * the classic accordion where opening a section auto-closes the previously open
79
79
  * one.
80
80
  *
@@ -86,6 +86,7 @@ type AccordionRootProps = (AccordionSingleProps | AccordionMultipleProps) & Omit
86
86
  * @see https://mantle.ngrok.com/components/data-display/accordion#accordionroot
87
87
  *
88
88
  * @example
89
+ * ```tsx
89
90
  * <Accordion.Root type="single" defaultValue="shipping">
90
91
  * <Accordion.Item value="shipping">
91
92
  * <Accordion.Trigger>
@@ -97,19 +98,21 @@ type AccordionRootProps = (AccordionSingleProps | AccordionMultipleProps) & Omit
97
98
  * </Accordion.Content>
98
99
  * </Accordion.Item>
99
100
  * </Accordion.Root>
101
+ * ```
100
102
  */
101
103
  declare const Root: (props: AccordionRootProps) => import("react").JSX.Element;
102
104
  /**
103
- * A single collapsible section, rendered as a plain `<div role="group">` — the
104
- * same accessibility role the browser gives a native `<details>`. Derives its
105
+ * A single collapsible section, rendered as a plain `<div role="group">` (the
106
+ * same accessibility role the browser gives a native `<details>`). Derives its
105
107
  * open state from {@link Root}.
106
108
  *
107
- * Because the item is a plain `<div>`, its header can be any layout — e.g. a flex
108
- * row with the {@link Trigger} alongside a separate, non-toggling action button.
109
+ * Because the item is a plain `<div>`, its header can be any layout, including a
110
+ * flex row with the {@link Trigger} beside a separate, non-toggling action button.
109
111
  *
110
112
  * @see https://mantle.ngrok.com/components/data-display/accordion#accordionitem
111
113
  *
112
114
  * @example
115
+ * ```tsx
113
116
  * <Accordion.Root type="single" defaultValue="item-1">
114
117
  * <Accordion.Item value="item-1">
115
118
  * <Accordion.Trigger>
@@ -121,6 +124,7 @@ declare const Root: (props: AccordionRootProps) => import("react").JSX.Element;
121
124
  * </Accordion.Content>
122
125
  * </Accordion.Item>
123
126
  * </Accordion.Root>
127
+ * ```
124
128
  */
125
129
  declare const Item: ({ "data-slot": dataSlot, children, value, ref, ...props }: ComponentProps<"div"> & {
126
130
  /** The unique value identifying this item within its accordion. */
@@ -128,7 +132,7 @@ declare const Item: ({ "data-slot": dataSlot, children, value, ref, ...props }:
128
132
  } & WithDataSlot) => import("react").JSX.Element;
129
133
  /**
130
134
  * The interactive header that toggles its section, rendered as a `<button>` with
131
- * `aria-expanded` — the disclosure semantics a native `<summary>` carries, but
135
+ * `aria-expanded`: the disclosure semantics a native `<summary>` carries, but
132
136
  * via a real button so the role is consistent across browsers (native summary's
133
137
  * role varies). Its `aria-controls` points at the item's {@link Content}, as the
134
138
  * WAI-ARIA disclosure pattern requires. Place the {@link TriggerIcon} as the last
@@ -137,6 +141,7 @@ declare const Item: ({ "data-slot": dataSlot, children, value, ref, ...props }:
137
141
  * @see https://mantle.ngrok.com/components/data-display/accordion#accordiontrigger
138
142
  *
139
143
  * @example
144
+ * ```tsx
140
145
  * <Accordion.Root type="single" defaultValue="item-1">
141
146
  * <Accordion.Item value="item-1">
142
147
  * <Accordion.Trigger>
@@ -148,6 +153,7 @@ declare const Item: ({ "data-slot": dataSlot, children, value, ref, ...props }:
148
153
  * </Accordion.Content>
149
154
  * </Accordion.Item>
150
155
  * </Accordion.Root>
156
+ * ```
151
157
  */
152
158
  declare const Trigger: ({ "data-slot": dataSlot, className, children, onClick, ref, ...props }: Omit<ComponentProps<"button">, "type"> & WithDataSlot) => import("react").JSX.Element;
153
159
  /**
@@ -159,6 +165,7 @@ declare const Trigger: ({ "data-slot": dataSlot, className, children, onClick, r
159
165
  * @see https://mantle.ngrok.com/components/data-display/accordion#accordiontriggericon
160
166
  *
161
167
  * @example
168
+ * ```tsx
162
169
  * // Default caret
163
170
  * <Accordion.Root type="single" defaultValue="item-1">
164
171
  * <Accordion.Item value="item-1">
@@ -171,8 +178,10 @@ declare const Trigger: ({ "data-slot": dataSlot, className, children, onClick, r
171
178
  * </Accordion.Content>
172
179
  * </Accordion.Item>
173
180
  * </Accordion.Root>
181
+ * ```
174
182
  *
175
183
  * @example
184
+ * ```tsx
176
185
  * // Custom icon
177
186
  * import { PlusIcon } from "@phosphor-icons/react/Plus";
178
187
  *
@@ -187,14 +196,15 @@ declare const Trigger: ({ "data-slot": dataSlot, className, children, onClick, r
187
196
  * </Accordion.Content>
188
197
  * </Accordion.Item>
189
198
  * </Accordion.Root>
199
+ * ```
190
200
  */
191
201
  declare const TriggerIcon: ({ "data-slot": dataSlot, className, svg, ...props }: Omit<IconProps, "svg"> & {
192
202
  /** The icon to render. Defaults to a downward caret that rotates open. */
193
203
  svg?: IconProps["svg"];
194
204
  } & WithDataSlot) => import("react").JSX.Element;
195
205
  /**
196
- * The collapsible region of an {@link Item} — the zero-padding viewport that
197
- * slides open and closed. Wrap its children in {@link Body} for the standard
206
+ * The collapsible region of an {@link Item} (the zero-padding viewport that
207
+ * slides open and closed). Wrap its children in {@link Body} for the standard
198
208
  * padding (text inherits the ambient size); `Content` itself stays unpadded so
199
209
  * its `h-0` collapse can reach zero height. Always rendered into the DOM. When
200
210
  * collapsed, it leaves the accessibility tree and the tab order, like a closed
@@ -209,6 +219,7 @@ declare const TriggerIcon: ({ "data-slot": dataSlot, className, svg, ...props }:
209
219
  * @see https://mantle.ngrok.com/components/data-display/accordion#accordioncontent
210
220
  *
211
221
  * @example
222
+ * ```tsx
212
223
  * <Accordion.Root type="single" defaultValue="item-1">
213
224
  * <Accordion.Item value="item-1">
214
225
  * <Accordion.Trigger>
@@ -220,23 +231,25 @@ declare const TriggerIcon: ({ "data-slot": dataSlot, className, svg, ...props }:
220
231
  * </Accordion.Content>
221
232
  * </Accordion.Item>
222
233
  * </Accordion.Root>
234
+ * ```
223
235
  */
224
236
  declare const Content: ({ "data-slot": dataSlot, className, children, ref, ...props }: Omit<ComponentProps<"div">, "id"> & WithDataSlot) => import("react").JSX.Element;
225
237
  /**
226
- * The padded inner region of an {@link Item}'s {@link Content} — where the
238
+ * The padded inner region of an {@link Item}'s {@link Content}, where the
227
239
  * section's body content lives. Owns the body's padding so {@link Content} can
228
240
  * stay a zero-padding animation viewport: a padded `h-0` border-box can't
229
241
  * collapse below its padding, so keeping the padding here lets the closed slide
230
242
  * reach zero height. The `pt-1` is the focus ring's vertical clearance: the
231
243
  * trigger keeps its `py-4` when open, and its `ring-4` paints 4px below the
232
244
  * button, so the ring stays off the body's first line (see {@link Trigger}). Text inherits the ambient
233
- * size — it isn't forced — so set a size on the content where you need one.
245
+ * size rather than being forced to a fixed size. Set a text class where you need one.
234
246
  * Override `className` to retune the padding (e.g. `pb-0`, `px-6`); `cx` resolves
235
247
  * last-wins.
236
248
  *
237
249
  * @see https://mantle.ngrok.com/components/data-display/accordion#accordionbody
238
250
  *
239
251
  * @example
252
+ * ```tsx
240
253
  * <Accordion.Root type="single" defaultValue="item-1">
241
254
  * <Accordion.Item value="item-1">
242
255
  * <Accordion.Trigger>
@@ -250,14 +263,15 @@ declare const Content: ({ "data-slot": dataSlot, className, children, ref, ...pr
250
263
  * </Accordion.Content>
251
264
  * </Accordion.Item>
252
265
  * </Accordion.Root>
266
+ * ```
253
267
  */
254
268
  declare const Body: ({ "data-slot": dataSlot, className, ref, ...props }: ComponentProps<"div"> & WithDataSlot) => import("react").JSX.Element;
255
269
  /**
256
270
  * A vertically stacked set of disclosure sections styled after the shadcn /
257
271
  * ngrok.com accordion.
258
272
  *
259
- * Its defining feature: collapsed content is never removed from the DOM — it
260
- * stays put with `hidden="until-found"` — so the browser's find-in-page (⌘F /
273
+ * Its defining feature: collapsed content is never removed from the DOM (it
274
+ * stays put with `hidden="until-found"`), so the browser's find-in-page (⌘F /
261
275
  * Ctrl-F) can find text inside closed sections and auto-expand them (synced via
262
276
  * the `beforematch` event). Built on plain `<div>`/`<button>` elements, so a
263
277
  * section header can be any layout, including a non-toggling action button
@@ -287,6 +301,7 @@ declare const Body: ({ "data-slot": dataSlot, className, ref, ...props }: Compon
287
301
  * ```
288
302
  *
289
303
  * @example
304
+ * ```tsx
290
305
  * <Accordion.Root type="single" defaultValue="item-1">
291
306
  * <Accordion.Item value="item-1">
292
307
  * <Accordion.Trigger>
@@ -298,12 +313,16 @@ declare const Body: ({ "data-slot": dataSlot, className, ref, ...props }: Compon
298
313
  * </Accordion.Content>
299
314
  * </Accordion.Item>
300
315
  * </Accordion.Root>
316
+ * ```
301
317
  */
302
318
  declare const Accordion: {
303
319
  /**
304
320
  * The root that owns open/closed state. See {@link Root}.
305
321
  *
322
+ * @see https://mantle.ngrok.com/components/data-display/accordion#accordionroot
323
+ *
306
324
  * @example
325
+ * ```tsx
307
326
  * <Accordion.Root type="single" defaultValue="item-1">
308
327
  * <Accordion.Item value="item-1">
309
328
  * <Accordion.Trigger>
@@ -315,12 +334,16 @@ declare const Accordion: {
315
334
  * </Accordion.Content>
316
335
  * </Accordion.Item>
317
336
  * </Accordion.Root>
337
+ * ```
318
338
  */
319
339
  readonly Root: typeof Root;
320
340
  /**
321
341
  * A single collapsible section. See {@link Item}.
322
342
  *
343
+ * @see https://mantle.ngrok.com/components/data-display/accordion#accordionitem
344
+ *
323
345
  * @example
346
+ * ```tsx
324
347
  * <Accordion.Root type="single" defaultValue="item-1">
325
348
  * <Accordion.Item value="item-1">
326
349
  * <Accordion.Trigger>
@@ -332,12 +355,16 @@ declare const Accordion: {
332
355
  * </Accordion.Content>
333
356
  * </Accordion.Item>
334
357
  * </Accordion.Root>
358
+ * ```
335
359
  */
336
360
  readonly Item: typeof Item;
337
361
  /**
338
362
  * The `<button>` header that toggles a section. See {@link Trigger}.
339
363
  *
364
+ * @see https://mantle.ngrok.com/components/data-display/accordion#accordiontrigger
365
+ *
340
366
  * @example
367
+ * ```tsx
341
368
  * <Accordion.Root type="single" defaultValue="item-1">
342
369
  * <Accordion.Item value="item-1">
343
370
  * <Accordion.Trigger>
@@ -349,12 +376,16 @@ declare const Accordion: {
349
376
  * </Accordion.Content>
350
377
  * </Accordion.Item>
351
378
  * </Accordion.Root>
379
+ * ```
352
380
  */
353
381
  readonly Trigger: typeof Trigger;
354
382
  /**
355
383
  * The caret indicating open/closed state. See {@link TriggerIcon}.
356
384
  *
385
+ * @see https://mantle.ngrok.com/components/data-display/accordion#accordiontriggericon
386
+ *
357
387
  * @example
388
+ * ```tsx
358
389
  * <Accordion.Root type="single" defaultValue="item-1">
359
390
  * <Accordion.Item value="item-1">
360
391
  * <Accordion.Trigger>
@@ -366,12 +397,16 @@ declare const Accordion: {
366
397
  * </Accordion.Content>
367
398
  * </Accordion.Item>
368
399
  * </Accordion.Root>
400
+ * ```
369
401
  */
370
402
  readonly TriggerIcon: typeof TriggerIcon;
371
403
  /**
372
404
  * The collapsible, find-in-page-discoverable body. See {@link Content}.
373
405
  *
406
+ * @see https://mantle.ngrok.com/components/data-display/accordion#accordioncontent
407
+ *
374
408
  * @example
409
+ * ```tsx
375
410
  * <Accordion.Root type="single" defaultValue="item-1">
376
411
  * <Accordion.Item value="item-1">
377
412
  * <Accordion.Trigger>
@@ -383,12 +418,16 @@ declare const Accordion: {
383
418
  * </Accordion.Content>
384
419
  * </Accordion.Item>
385
420
  * </Accordion.Root>
421
+ * ```
386
422
  */
387
423
  readonly Content: typeof Content;
388
424
  /**
389
425
  * The padded inner region of a {@link Content}. See {@link Body}.
390
426
  *
427
+ * @see https://mantle.ngrok.com/components/data-display/accordion#accordionbody
428
+ *
391
429
  * @example
430
+ * ```tsx
392
431
  * <Accordion.Root type="single" defaultValue="item-1">
393
432
  * <Accordion.Item value="item-1">
394
433
  * <Accordion.Trigger>
@@ -402,6 +441,7 @@ declare const Accordion: {
402
441
  * </Accordion.Content>
403
442
  * </Accordion.Item>
404
443
  * </Accordion.Root>
444
+ * ```
405
445
  */
406
446
  readonly Body: typeof Body;
407
447
  };
package/dist/accordion.js CHANGED
@@ -1 +1 @@
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};
1
+ "use client";import{t as e}from"./use-isomorphic-layout-effect-CL6iq0Bj.js";import{t}from"./use-composed-refs-DPYmLDSe.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-xb7d9M7X.js";import{t as a}from"./slot-B7rwscwd.js";import{t as o}from"./browser-only-ymFoM3Ya.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};