@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/dist/strata.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * @see https://mantle.ngrok.com/components/structure/strata
5
5
  */
6
6
  import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
7
- import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
7
+ import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
8
8
  import { ComponentProps } from "react";
9
9
  /**
10
10
  * The stack of sections. Renders a `<div>` with `divide-card-muted divide-y`, so
@@ -12,7 +12,7 @@ import { ComponentProps } from "react";
12
12
  * the first or below the last. Vertical rhythm belongs to `Section`
13
13
  * (`py-8 first:pt-0`) rather than here, which keeps a lone `Section` usable
14
14
  * without a `Root` around it. Set `--strata-columns` on `Root` to re-split
15
- * every section at once — custom properties inherit, so one declaration reaches
15
+ * every section at once. Custom properties inherit, so one declaration reaches
16
16
  * all of them.
17
17
  *
18
18
  * | Data Attribute | Value | Description |
@@ -56,13 +56,13 @@ declare const Root: ({ asChild, children, className, "data-slot": dataSlot, ...p
56
56
  * section.
57
57
  *
58
58
  * The `<section>` takes no accessible name, which keeps it generic in the
59
- * accessibility tree instead of adding one `region` landmark per band — the
59
+ * accessibility tree instead of adding one `region` landmark per band. The
60
60
  * `Strata.Title` headings already carry the page outline, and a landmark list
61
61
  * only stays useful while `main` and `nav` are easy to find in it. Set
62
62
  * `aria-labelledby` to the `Title`'s `id` only when the section is a
63
63
  * destination a reader jumps back to, not merely a division of the page. To
64
64
  * tell apart controls that read alike across two sections, reach for
65
- * `Field.Set` and `Field.Legend` instead — assistive technology announces a
65
+ * `Field.Set` and `Field.Legend` instead: assistive technology announces a
66
66
  * landmark on entry, never per control.
67
67
  *
68
68
  * | CSS Variable | Default | Description |
@@ -101,7 +101,7 @@ declare const Root: ({ asChild, children, className, "data-slot": dataSlot, ...p
101
101
  */
102
102
  declare const Section: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"section"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
103
103
  /**
104
- * A section's introductory column — its `Strata.Title` and
104
+ * A section's introductory column: its `Strata.Title` and
105
105
  * `Strata.Description`. Renders a `<header>` with `flex flex-col gap-2`, so
106
106
  * anything else composed in (a `Badge`, a count) picks up the same spacing. At
107
107
  * `md` and up it takes the grid's first column; below the breakpoint it stacks
@@ -146,8 +146,8 @@ declare const Header: ({ asChild, children, className, "data-slot": dataSlot, ..
146
146
  /**
147
147
  * The section's heading. Renders an `<h2>`, one level below the page's `<h1>`,
148
148
  * because a `Strata.Section` is a top-level division of its page. Compose
149
- * `asChild` with the right element when a page nests its sections deeper —
150
- * heading level is document structure, so mantle does not guess it.
149
+ * `asChild` with the right element when a page nests its sections deeper.
150
+ * Heading level is document structure, so mantle does not guess it.
151
151
  *
152
152
  * | Data Attribute | Value | Description |
153
153
  * | -------------- | ----------------- | ------------------------------------------------------------------ |
@@ -182,8 +182,8 @@ declare const Header: ({ asChild, children, className, "data-slot": dataSlot, ..
182
182
  declare const Title: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"h2"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
183
183
  /**
184
184
  * The sentence that says what the section's controls do, and what changing them
185
- * costs. Renders a `<p>` in muted body text beneath `Strata.Title`. Optional —
186
- * a section whose title says everything may omit it.
185
+ * costs. Renders a `<p>` in muted body text beneath `Strata.Title`. It is
186
+ * optional: a section whose title says everything may omit it.
187
187
  *
188
188
  * | Data Attribute | Value | Description |
189
189
  * | -------------- | ----------------------- | ------------------------------------------------------------------ |
@@ -217,7 +217,7 @@ declare const Title: ({ asChild, children, className, "data-slot": dataSlot, ...
217
217
  */
218
218
  declare const Description: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"p"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
219
219
  /**
220
- * The section's content column — the controls, cards, or table that
220
+ * The section's content column: the controls, cards, or table that
221
221
  * `Strata.Header` describes. Renders a `<div>` with `flex flex-col gap-4`, so
222
222
  * stacked controls space themselves and a consumer's own `gap-*` replaces the
223
223
  * default cleanly. At `md` and up it takes the grid's second column; below the
@@ -256,14 +256,14 @@ declare const Description: ({ asChild, children, className, "data-slot": dataSlo
256
256
  declare const Body: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
257
257
  /**
258
258
  * A page of titled sections, each one explained beside its content. Every
259
- * section pairs a `Strata.Header` — its `Title` and `Description` — with a
259
+ * section pairs a `Strata.Header` (its `Title` and `Description`) with a
260
260
  * `Strata.Body` of controls. `Strata.Root` stacks the sections with a
261
261
  * hairline between them. Below the `md` breakpoint the header stacks above its
262
262
  * own content, so the pairing survives a narrow viewport. It is the shape of a
263
263
  * settings page, a resource configuration editor, and any form long enough that
264
264
  * each group needs its own explanation.
265
265
  *
266
- * It owns structure only — the grid, the rhythm, and the rules between sections.
266
+ * It owns structure only: the grid, the rhythm, and the rules between sections.
267
267
  * Reach for [Card](https://mantle.ngrok.com/components/structure/card) when a
268
268
  * group needs a raised surface of its own, for
269
269
  * [MediaObject](https://mantle.ngrok.com/components/structure/media-object)
@@ -363,12 +363,12 @@ declare const Strata: {
363
363
  * (`py-8 first:pt-0`). Both layouts size their tracks `minmax(0, …)`, so a
364
364
  * nowrap value in `Body` clips or wraps instead of widening the section. It
365
365
  * takes no accessible name, which keeps it generic in the accessibility tree
366
- * instead of adding one `region` landmark per band —
367
- * the `Title` headings already carry the page outline. Set `aria-labelledby`
366
+ * instead of adding one `region` landmark per band.
367
+ * The `Title` headings already carry the page outline. Set `aria-labelledby`
368
368
  * to the `Title`'s `id` only when the section is a destination a reader jumps
369
369
  * back to, not merely a division of the page. To tell apart controls that read
370
- * alike across two sections, reach for `Field.Set` and `Field.Legend` instead
371
- * — assistive technology announces a landmark on entry, never per control.
370
+ * alike across two sections, reach for `Field.Set` and `Field.Legend` instead:
371
+ * assistive technology announces a landmark on entry, never per control.
372
372
  *
373
373
  * | CSS Variable | Default | Description |
374
374
  * | ------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------- |
@@ -406,7 +406,7 @@ declare const Strata: {
406
406
  */
407
407
  readonly Section: typeof Section;
408
408
  /**
409
- * A section's introductory column — its `Title` and `Description`. Renders a
409
+ * A section's introductory column: its `Title` and `Description`. Renders a
410
410
  * `<header>` with `flex flex-col gap-2`, so anything else composed in picks
411
411
  * up the same spacing. At `md` and up it takes the grid's first column; below
412
412
  * the breakpoint it stacks above `Body`. Nested inside `Section`'s
@@ -447,8 +447,8 @@ declare const Strata: {
447
447
  /**
448
448
  * The section's heading. Renders an `<h2>`, one level below the page's
449
449
  * `<h1>`, because a `Section` is a top-level division of its page. Compose
450
- * `asChild` with the right element when a page nests its sections deeper —
451
- * heading level is document structure, so mantle does not guess it.
450
+ * `asChild` with the right element when a page nests its sections deeper.
451
+ * Heading level is document structure, so mantle does not guess it.
452
452
  *
453
453
  * | Data Attribute | Value | Description |
454
454
  * | -------------- | ----------------- | ------------------------------------------------------------------ |
@@ -483,8 +483,8 @@ declare const Strata: {
483
483
  readonly Title: typeof Title;
484
484
  /**
485
485
  * The sentence that says what the section's controls do, and what changing
486
- * them costs. Renders a `<p>` in muted body text beneath `Title`. Optional —
487
- * a section whose title says everything may omit it.
486
+ * them costs. Renders a `<p>` in muted body text beneath `Title`. It is
487
+ * optional: a section whose title says everything may omit it.
488
488
  *
489
489
  * | Data Attribute | Value | Description |
490
490
  * | -------------- | ----------------------- | ------------------------------------------------------------------ |
@@ -518,7 +518,7 @@ declare const Strata: {
518
518
  */
519
519
  readonly Description: typeof Description;
520
520
  /**
521
- * The section's content column — the controls, cards, or table that `Header`
521
+ * The section's content column: the controls, cards, or table that `Header`
522
522
  * describes. Renders a `<div>` with `flex flex-col gap-4`, so stacked
523
523
  * controls space themselves and a consumer's own `gap-*` replaces the default
524
524
  * cleanly. At `md` and up it takes the grid's second column; below the
package/dist/strata.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"./slot-DdYN1L1C.js";import{c as r}from"react/compiler-runtime";import{jsx as i}from"react/jsx-runtime";const a={Root:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`div`,p;o[6]===u?p=o[7]:(p=t(u,`strata`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`divide-card-muted divide-y`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Section:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`section`,p;o[6]===u?p=o[7]:(p=t(u,`strata-section`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`grid grid-cols-1 gap-6 py-8 first:pt-0`,`md:grid-cols-(--strata-columns,minmax(0,1fr)_minmax(0,2fr)) md:gap-12`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Header:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`header`,p;o[6]===u?p=o[7]:(p=t(u,`strata-header`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex flex-col gap-2`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Title:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`h2`,p;o[6]===u?p=o[7]:(p=t(u,`strata-title`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`text-strong text-base font-medium`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Description:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`p`,p;o[6]===u?p=o[7]:(p=t(u,`strata-description`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`text-body text-sm`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Body:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`div`,p;o[6]===u?p=o[7]:(p=t(u,`strata-body`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex flex-col gap-4`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h}};export{a as Strata};
1
+ "use client";import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-B7rwscwd.js";import{c as r}from"react/compiler-runtime";import{jsx as i}from"react/jsx-runtime";const a={Root:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`div`,p;o[6]===u?p=o[7]:(p=t(u,`strata`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`divide-card-muted divide-y`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Section:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`section`,p;o[6]===u?p=o[7]:(p=t(u,`strata-section`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`grid grid-cols-1 gap-6 py-8 first:pt-0`,`md:grid-cols-(--strata-columns,minmax(0,1fr)_minmax(0,2fr)) md:gap-12`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Header:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`header`,p;o[6]===u?p=o[7]:(p=t(u,`strata-header`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex flex-col gap-2`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Title:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`h2`,p;o[6]===u?p=o[7]:(p=t(u,`strata-title`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`text-strong text-base font-medium`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Description:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`p`,p;o[6]===u?p=o[7]:(p=t(u,`strata-description`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`text-body text-sm`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h},Body:a=>{let o=r(16),s,c,l,u,d;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5]):({asChild:s,children:c,className:l,"data-slot":u,...d}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d);let f=s?n:`div`,p;o[6]===u?p=o[7]:(p=t(u,`strata-body`),o[6]=u,o[7]=p);let m;o[8]===l?m=o[9]:(m=e(`flex flex-col gap-4`,l),o[8]=l,o[9]=m);let h;return o[10]!==f||o[11]!==c||o[12]!==d||o[13]!==p||o[14]!==m?(h=/* @__PURE__ */ i(f,{"data-slot":p,className:m,...d,children:c}),o[10]=f,o[11]=c,o[12]=d,o[13]=p,o[14]=m,o[15]=h):h=o[15],h}};export{a as Strata};
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The grammar contract of the query-filter language.
3
3
  *
4
- * A grammar declares the qualifier keys of one list surface — their spellings,
4
+ * A grammar declares the qualifier keys of one list surface: their spellings,
5
5
  * their fixed values, and how one value tests one item. The engine modules
6
6
  * (`parse`, `match`, `suggestions`, `highlight`) stay grammar-agnostic and take
7
7
  * the grammar as their first argument, so every list can speak the same
@@ -9,7 +9,7 @@
9
9
  *
10
10
  * Spellings stay forgiving through explicit aliases, never fuzzy matching:
11
11
  * each accepted spelling is one entry, matched case-insensitively, and the
12
- * suggestions always write the canonical form — so a shared `?q=` URL never
12
+ * suggestions always write the canonical form, so a shared `?q=` URL never
13
13
  * surprises the person who opens it.
14
14
  */
15
15
  /** One fixed value of an enumerated key, with the copy the UI shows for it. */
@@ -110,8 +110,8 @@ declare function getFilterSyntax<Item>(grammar: FilterGrammar<Item>): FilterSynt
110
110
  /**
111
111
  * Resolves a written key to its definition, case-insensitively.
112
112
  *
113
- * @returns the definition, or `null` when the spelling is not a qualifier —
114
- * in which case the caller keeps the whole token as free text.
113
+ * @returns the definition, or `null` when the spelling is not a qualifier. In
114
+ * that case the caller keeps the whole token as free text.
115
115
  *
116
116
  * @example
117
117
  * ```ts
@@ -126,11 +126,11 @@ declare function resolveFilterKey<Item>(grammar: FilterGrammar<Item>, writtenKey
126
126
  * Free-text keys have no vocabulary, so their values pass through unchanged.
127
127
  *
128
128
  * @returns the canonical value, or `null` when the key is enumerated and the
129
- * spelling matches no alias — that filter then matches no item.
129
+ * spelling matches no alias. That filter then matches no item.
130
130
  *
131
131
  * @example
132
132
  * ```ts
133
- * resolveFilterValue(grammar, "is", "LIVE"); // => "active" — an alias
133
+ * resolveFilterValue(grammar, "is", "LIVE"); // => "active" (an alias)
134
134
  * resolveFilterValue(grammar, "is", "bogus"); // => null
135
135
  * resolveFilterValue(grammar, "description", "Staging API"); // => "Staging API"
136
136
  * ```
@@ -243,7 +243,7 @@ type ValueCandidate = {
243
243
  * @example
244
244
  * ```ts
245
245
  * getValueCandidates(isDefinition); // => [{ value: "active", description: "…" }, …]
246
- * getValueCandidates(descriptionDefinition); // => [] — free text
246
+ * getValueCandidates(descriptionDefinition); // => [] (free text)
247
247
  * ```
248
248
  */
249
249
  declare function getValueCandidates(definition: Pick<FilterKeyDefinition<unknown>, "values">): ValueCandidate[];
package/dist/switch.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @see https://mantle.ngrok.com/components/forms/switch
5
5
  */
6
- import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
6
+ import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
7
7
  import { o as WithValidation } from "./field-BshcNVe_.js";
8
8
  import { ComponentProps } from "react";
9
9
  import { Root } from "@radix-ui/react-switch";
package/dist/switch.js CHANGED
@@ -1 +1 @@
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};
1
+ "use client";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-Bpvn4tQp.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};
@@ -0,0 +1 @@
1
+ "use client";import{t as e}from"./use-composed-refs-DPYmLDSe.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{c as r}from"react/compiler-runtime";import{useLayoutEffect as i,useRef as a,useState as o}from"react";import{jsx as s}from"react/jsx-runtime";import{flushSync as c}from"react-dom";const l={Body:e=>{let i=r(16),a,o,c,l,u;i[0]===e?(a=i[1],o=i[2],c=i[3],l=i[4],u=i[5]):({"data-slot":c,children:a,className:o,ref:u,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=c,i[4]=l,i[5]=u);let d;i[6]===c?d=i[7]:(d=n(c,`table-body`),i[6]=c,i[7]=d);let f;i[8]===o?f=i[9]:(f=t(`[&>tr+tr>*]:border-t [&>tr+tr>*]:border-card-muted`,`text-body`,`[&>tr]:bg-card [&>tr]:not-only:hover:bg-card-hover [&>tr]:not-only:has-focus-visible:bg-card-hover`,o),i[8]=o,i[9]=f);let p;return i[10]!==a||i[11]!==l||i[12]!==u||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ s(`tbody`,{"data-slot":d,className:f,ref:u,...l,children:a}),i[10]=a,i[11]=l,i[12]=u,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},Caption:e=>{let i=r(16),a,o,c,l,u;i[0]===e?(a=i[1],o=i[2],c=i[3],l=i[4],u=i[5]):({"data-slot":c,children:a,className:o,ref:u,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=c,i[4]=l,i[5]=u);let d;i[6]===c?d=i[7]:(d=n(c,`table-caption`),i[6]=c,i[7]=d);let f;i[8]===o?f=i[9]:(f=t(`py-4 text-sm text-gray-500`,`border-t border-card-muted`,o),i[8]=o,i[9]=f);let p;return i[10]!==a||i[11]!==l||i[12]!==u||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ s(`caption`,{"data-slot":d,ref:u,className:f,...l,children:a}),i[10]=a,i[11]=l,i[12]=u,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},Cell:e=>{let i=r(16),a,o,c,l,u;i[0]===e?(a=i[1],o=i[2],c=i[3],l=i[4],u=i[5]):({"data-slot":c,children:a,className:o,ref:u,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=c,i[4]=l,i[5]=u);let d;i[6]===c?d=i[7]:(d=n(c,`table-cell`),i[6]=c,i[7]=d);let f;i[8]===o?f=i[9]:(f=t(`p-3 align-middle has-[[role=checkbox]]:pr-0 font-mono text-mono`,o),i[8]=o,i[9]=f);let p;return i[10]!==a||i[11]!==l||i[12]!==u||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ s(`td`,{"data-slot":d,ref:u,className:f,...l,children:a}),i[10]=a,i[11]=l,i[12]=u,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},Element:e=>{let i=r(16),a,o,c,l,u;i[0]===e?(a=i[1],o=i[2],c=i[3],l=i[4],u=i[5]):({"data-slot":c,children:a,className:o,ref:u,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=c,i[4]=l,i[5]=u);let d;i[6]===c?d=i[7]:(d=n(c,`table-element`),i[6]=c,i[7]=d);let f;i[8]===o?f=i[9]:(f=t(`table-auto border-separate border-spacing-0 caption-bottom w-full min-w-full text-left`,o),i[8]=o,i[9]=f);let p;return i[10]!==a||i[11]!==l||i[12]!==u||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ s(`table`,{"data-slot":d,ref:u,className:f,...l,children:a}),i[10]=a,i[11]=l,i[12]=u,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},Foot:e=>{let i=r(16),a,o,c,l,u;i[0]===e?(a=i[1],o=i[2],c=i[3],l=i[4],u=i[5]):({"data-slot":c,children:a,className:o,ref:u,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=c,i[4]=l,i[5]=u);let d;i[6]===c?d=i[7]:(d=n(c,`table-foot`),i[6]=c,i[7]=d);let f;i[8]===o?f=i[9]:(f=t(`font-medium text-body`,`[&>tr:first-child>*]:border-t [&>tr:first-child>*]:border-card-muted`,`[&>tr+tr>*]:border-t [&>tr+tr>*]:border-card-muted`,`[&>tr]:bg-gray-50/50 [&>tr]:hover:bg-card-hover`,o),i[8]=o,i[9]=f);let p;return i[10]!==a||i[11]!==l||i[12]!==u||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ s(`tfoot`,{"data-slot":d,ref:u,className:f,...l,children:a}),i[10]=a,i[11]=l,i[12]=u,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},Head:e=>{let i=r(16),a,o,c,l,u;i[0]===e?(a=i[1],o=i[2],c=i[3],l=i[4],u=i[5]):({"data-slot":c,children:a,className:o,ref:u,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=c,i[4]=l,i[5]=u);let d;i[6]===c?d=i[7]:(d=n(c,`table-head`),i[6]=c,i[7]=d);let f;i[8]===o?f=i[9]:(f=t(`[&>tr:last-child>*]:border-b [&>tr:last-child>*]:border-card-muted`,`[&>tr+tr>*]:border-t [&>tr+tr>*]:border-card-muted`,`text-muted bg-base`,`[&>tr]:bg-base`,o),i[8]=o,i[9]=f);let p;return i[10]!==a||i[11]!==l||i[12]!==u||i[13]!==d||i[14]!==f?(p=/* @__PURE__ */ s(`thead`,{"data-slot":d,ref:u,className:f,...l,children:a}),i[10]=a,i[11]=l,i[12]=u,i[13]=d,i[14]=f,i[15]=p):p=i[15],p},Header:e=>{let i=r(18),a,o,c,l,u,d;i[0]===e?(a=i[1],o=i[2],c=i[3],l=i[4],u=i[5],d=i[6]):({"data-slot":c,children:a,className:o,ref:u,scope:d,...l}=e,i[0]=e,i[1]=a,i[2]=o,i[3]=c,i[4]=l,i[5]=u,i[6]=d);let f=d===void 0?`col`:d,p;i[7]===c?p=i[8]:(p=n(c,`table-header`),i[7]=c,i[8]=p);let m;i[9]===o?m=i[10]:(m=t(`h-11 px-3 text-left align-middle text-sm font-medium has-[[role=checkbox]]:pr-0`,o),i[9]=o,i[10]=m);let h;return i[11]!==a||i[12]!==l||i[13]!==u||i[14]!==f||i[15]!==p||i[16]!==m?(h=/* @__PURE__ */ s(`th`,{"data-slot":p,ref:u,scope:f,className:m,...l,children:a}),i[11]=a,i[12]=l,i[13]=u,i[14]=f,i[15]=p,i[16]=m,i[17]=h):h=i[17],h},Root:i=>{let a=r(22),o,c,l,d,f;a[0]===i?(o=a[1],c=a[2],l=a[3],d=a[4],f=a[5]):({"data-slot":l,children:o,className:c,ref:f,...d}=i,a[0]=i,a[1]=o,a[2]=c,a[3]=l,a[4]=d,a[5]=f);let p=u(),m=e(p.ref,f),h;a[6]===l?h=a[7]:(h=n(l,`table`),a[6]=l,a[7]=h);let g;a[8]===c?g=a[9]:(g=t(`group/table relative w-full overflow-hidden rounded-lg border border-card bg-white dark:bg-gray-100`,c),a[8]=c,a[9]=g);let _=p.state.hasOverflow&&!p.state.scrolledToEnd||void 0,v=p.state.hasOverflow,y=p.state.hasOverflow&&p.state.scrolledToEnd,b;a[10]===Symbol.for(`react.memo_cache_sentinel`)?(b=t(`scrollbar scroll-fade-x overflow-x-auto overflow-y-clip overscroll-x-none`,`has-data-mantle-table-sticky-right:[--_fade-right:black]`),a[10]=b):b=a[10];let x;a[11]!==o||a[12]!==m?(x=/* @__PURE__ */ s(`div`,{className:b,ref:m,children:o}),a[11]=o,a[12]=m,a[13]=x):x=a[13];let S;return a[14]!==p.state.hasOverflow||a[15]!==d||a[16]!==h||a[17]!==g||a[18]!==_||a[19]!==y||a[20]!==x?(S=/* @__PURE__ */ s(`div`,{"data-slot":h,className:g,"data-sticky-active":_,"data-x-overflow":v,"data-x-scroll-end":y,...d,children:x}),a[14]=p.state.hasOverflow,a[15]=d,a[16]=h,a[17]=g,a[18]=_,a[19]=y,a[20]=x,a[21]=S):S=a[21],S},Row:e=>{let t=r(12),i,a,o,c;t[0]===e?(i=t[1],a=t[2],o=t[3],c=t[4]):({"data-slot":a,children: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=n(a,`table-row`),t[5]=a,t[6]=l);let u;return t[7]!==i||t[8]!==o||t[9]!==c||t[10]!==l?(u=/* @__PURE__ */ s(`tr`,{"data-slot":l,ref:c,...o,children:i}),t[7]=i,t[8]=o,t[9]=c,t[10]=l,t[11]=u):u=t[11],u}};function u(){let e=r(5),t=a(null),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={hasOverflow:!1,scrolledToStart:!0,scrolledToEnd:!1},e[0]=n):n=e[0];let[s,l]=o(n),u,d;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{let e=t.current;if(!e)return;let n=0,r=()=>{let t=e.scrollWidth>e.clientWidth,n=e.scrollLeft<1,r=Math.abs(e.scrollWidth-e.scrollLeft-e.clientWidth)<1;l(e=>e.hasOverflow!==t||e.scrolledToStart!==n||e.scrolledToEnd!==r?{hasOverflow:t,scrolledToStart:n,scrolledToEnd:r}:e)},i=()=>{n===0&&(n=requestAnimationFrame(()=>{n=0,r()}))},a=new ResizeObserver(()=>{c(r)});a.observe(e);let o=new MutationObserver(i);return o.observe(e,{childList:!0,subtree:!0}),e.addEventListener(`scroll`,i,{passive:!0}),()=>{cancelAnimationFrame(n),a.disconnect(),o.disconnect(),e.removeEventListener(`scroll`,i)}},d=[],e[1]=u,e[2]=d):(u=e[1],d=e[2]),i(u,d);let f;return e[3]===s?f=e[4]:(f={ref:t,state:s},e[3]=s,e[4]=f),f}export{l as t};
@@ -1,4 +1,4 @@
1
- import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
1
+ import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
2
2
  import { ComponentProps } from "react";
3
3
  /**
4
4
  * The `<Table.Root>` is the root container element for all `Table`s.
@@ -106,11 +106,11 @@ import { ComponentProps } from "react";
106
106
  *
107
107
  * Data attributes it stamps on the outer element, for your own CSS to target:
108
108
  *
109
- * - `data-x-overflow="true" | "false"` — whether the content is wider than the
109
+ * - `data-x-overflow="true" | "false"`: whether the content is wider than the
110
110
  * container. Always present, so match the value, not the attribute.
111
- * - `data-x-scroll-end="true" | "false"` — whether an overflowing container is
111
+ * - `data-x-scroll-end="true" | "false"`: whether an overflowing container is
112
112
  * scrolled to its right edge. Always present.
113
- * - `data-sticky-active` — present only while the container overflows and is not
113
+ * - `data-sticky-active`: present only while the container overflows and is not
114
114
  * scrolled to the end. `DataTable`'s pinned action column keys its shadow off
115
115
  * this through `group-data-sticky-active/table:`.
116
116
  *
@@ -509,7 +509,7 @@ declare const Cell: ({ "data-slot": dataSlot, children, className, ref, ...props
509
509
  */
510
510
  declare const Caption: ({ "data-slot": dataSlot, children, className, ref, ...props }: ComponentProps<"caption"> & WithDataSlot) => import("react").JSX.Element;
511
511
  /**
512
- * Use `Table` for STATIC, layout-driven tabular data — read-only data dumps,
512
+ * Use `Table` for STATIC, layout-driven tabular data: read-only data dumps,
513
513
  * simple key/value displays, plain markup tables. The API matches the HTML
514
514
  * `<table>` element 1:1, with no built-in sorting, filtering, or pagination.
515
515
  *
package/dist/table.d.ts CHANGED
@@ -3,5 +3,5 @@
3
3
  *
4
4
  * @see https://mantle.ngrok.com/components/data-display/table
5
5
  */
6
- import { t as Table } from "./table-rWiVWEgB.js";
6
+ import { t as Table } from "./table-Ii9hHUWN.js";
7
7
  export { Table };
package/dist/table.js CHANGED
@@ -1 +1 @@
1
- export{t as Table}from"./table-CFHiDBW8.js";
1
+ export{t as Table}from"./table-BnLdXUai.js";
package/dist/tabs.d.ts CHANGED
@@ -4,8 +4,8 @@
4
4
  * @see https://mantle.ngrok.com/components/navigation/tabs
5
5
  */
6
6
  import { t as SelfClosingWithAsChild } from "./as-child-DFxX3U2i.js";
7
- import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
8
- import { n as Separator } from "./separator-QfH0ot5K.js";
7
+ import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
8
+ import { n as Separator } from "./separator-Ck4sPrdN.js";
9
9
  import { ComponentProps } from "react";
10
10
  import { Content as Content$1, List as List$1, Root as Root$1, Trigger as Trigger$1 } from "@radix-ui/react-tabs";
11
11
  /**
package/dist/tabs.js CHANGED
@@ -1 +1 @@
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
+ "use client";import{t as e}from"./booleanish-BfvnW6vy.js";import{t}from"./use-composed-refs-DPYmLDSe.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-Ck6dnOM9.js";import{n as o}from"./separator-DnvhwY2J.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};
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @see https://mantle.ngrok.com/components/forms/text-area
5
5
  */
6
- import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
6
+ import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
7
7
  import { o as WithValidation } from "./field-BshcNVe_.js";
8
8
  import { ComponentProps } from "react";
9
9
  type Props = ComponentProps<"textarea"> & WithValidation & {
package/dist/text-area.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{a as r,r as i}from"./field-CPvjazWN.js";import{c as a}from"react/compiler-runtime";import{useRef as o,useState as s}from"react";import{jsx as c}from"react/jsx-runtime";const l=l=>{let u=a(36),d,f,p,m,h,g,_,v,y,b;u[0]===l?(d=u[1],f=u[2],p=u[3],m=u[4],h=u[5],g=u[6],_=u[7],v=u[8],y=u[9],b=u[10]):({"data-slot":h,appearance:p,"aria-invalid":d,className:m,onDragEnter:g,onDragLeave:_,onDropCapture:v,ref:b,validation:f,...y}=l,u[0]=l,u[1]=d,u[2]=f,u[3]=p,u[4]=m,u[5]=h,u[6]=g,u[7]=_,u[8]=v,u[9]=y,u[10]=b);let x=r(),S=f??x,C;u[11]!==d||u[12]!==S?(C=i({"aria-invalid":d,validation:S}),u[11]=d,u[12]=S,u[13]=C):C=u[13];let{ariaInvalid:w,validation:T}=C,[E,D]=s(!1),O=o(null),k=e(O,b),A=T||void 0,j;u[14]===h?j=u[15]:(j=n(h,`text-area`),u[14]=h,u[15]=j);let M=p===`monospaced`&&`font-mono pointer-coarse:text-base text-xs/5`,N;u[16]!==m||u[17]!==M?(N=t(`border-input bg-form data-drag-over:border-dashed data-drag-over:ring-4 pointer-coarse:py-[calc(--spacing(2.5)-1px)] pointer-coarse:text-base text-sm flex min-h-24 w-full rounded-md border px-3 py-[calc(--spacing(2)-1px)] focus-visible:outline-hidden focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50`,`placeholder:text-placeholder data-drag-over:border-dashed`,`border-form text-strong ring-focus-accent focus:border-accent-600 data-drag-over:border-accent-600`,`data-validation-error:border-danger-600 data-validation-error:ring-focus-danger data-validation-error:focus-visible:border-danger-600 data-validation-error:data-drag-over:border-danger-600 motion-safe:data-validation-error:animate-shake`,`data-validation-success:border-success-600 data-validation-success:ring-focus-success data-validation-success:focus-visible:border-success-600 data-validation-success:data-drag-over:border-success-600`,`data-validation-warning:border-warning-600 data-validation-warning:ring-focus-warning data-validation-warning:focus-visible:border-warning-600 data-validation-warning:data-drag-over:border-warning-600`,M,m),u[16]=m,u[17]=M,u[18]=N):N=u[18];let P;u[19]===g?P=u[20]:(P=e=>{D(!0),g?.(e)},u[19]=g,u[20]=P);let F;u[21]===_?F=u[22]:(F=e=>{D(!1),_?.(e)},u[21]=_,u[22]=F);let I;u[23]===v?I=u[24]:(I=e=>{D(!1),O.current?.focus(),v?.(e)},u[23]=v,u[24]=I);let L;return u[25]!==w||u[26]!==k||u[27]!==E||u[28]!==y||u[29]!==A||u[30]!==j||u[31]!==N||u[32]!==P||u[33]!==F||u[34]!==I?(L=/* @__PURE__ */ c(`textarea`,{"aria-invalid":w,"data-validation":A,"data-slot":j,className:N,"data-drag-over":E,onDragEnter:P,onDragLeave:F,onDropCapture:I,ref:k,...y}),u[25]=w,u[26]=k,u[27]=E,u[28]=y,u[29]=A,u[30]=j,u[31]=N,u[32]=P,u[33]=F,u[34]=I,u[35]=L):L=u[35],L};export{l as TextArea};
1
+ "use client";import{t as e}from"./use-composed-refs-DPYmLDSe.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{a as r,r as i}from"./field-Bpvn4tQp.js";import{c as a}from"react/compiler-runtime";import{useRef as o,useState as s}from"react";import{jsx as c}from"react/jsx-runtime";const l=l=>{let u=a(36),d,f,p,m,h,g,_,v,y,b;u[0]===l?(d=u[1],f=u[2],p=u[3],m=u[4],h=u[5],g=u[6],_=u[7],v=u[8],y=u[9],b=u[10]):({"data-slot":h,appearance:p,"aria-invalid":d,className:m,onDragEnter:g,onDragLeave:_,onDropCapture:v,ref:b,validation:f,...y}=l,u[0]=l,u[1]=d,u[2]=f,u[3]=p,u[4]=m,u[5]=h,u[6]=g,u[7]=_,u[8]=v,u[9]=y,u[10]=b);let x=r(),S=f??x,C;u[11]!==d||u[12]!==S?(C=i({"aria-invalid":d,validation:S}),u[11]=d,u[12]=S,u[13]=C):C=u[13];let{ariaInvalid:w,validation:T}=C,[E,D]=s(!1),O=o(null),k=e(O,b),A=T||void 0,j;u[14]===h?j=u[15]:(j=n(h,`text-area`),u[14]=h,u[15]=j);let M=p===`monospaced`&&`font-mono pointer-coarse:text-base text-xs/5`,N;u[16]!==m||u[17]!==M?(N=t(`border-input bg-form data-drag-over:border-dashed data-drag-over:ring-4 pointer-coarse:py-[calc(--spacing(2.5)-1px)] pointer-coarse:text-base text-sm flex min-h-24 w-full rounded-md border px-3 py-[calc(--spacing(2)-1px)] focus-visible:outline-hidden focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50`,`placeholder:text-placeholder data-drag-over:border-dashed`,`border-form text-strong ring-focus-accent focus:border-accent-600 data-drag-over:border-accent-600`,`data-validation-error:border-danger-600 data-validation-error:ring-focus-danger data-validation-error:focus-visible:border-danger-600 data-validation-error:data-drag-over:border-danger-600 motion-safe:data-validation-error:animate-shake`,`data-validation-success:border-success-600 data-validation-success:ring-focus-success data-validation-success:focus-visible:border-success-600 data-validation-success:data-drag-over:border-success-600`,`data-validation-warning:border-warning-600 data-validation-warning:ring-focus-warning data-validation-warning:focus-visible:border-warning-600 data-validation-warning:data-drag-over:border-warning-600`,M,m),u[16]=m,u[17]=M,u[18]=N):N=u[18];let P;u[19]===g?P=u[20]:(P=e=>{D(!0),g?.(e)},u[19]=g,u[20]=P);let F;u[21]===_?F=u[22]:(F=e=>{D(!1),_?.(e)},u[21]=_,u[22]=F);let I;u[23]===v?I=u[24]:(I=e=>{D(!1),O.current?.focus(),v?.(e)},u[23]=v,u[24]=I);let L;return u[25]!==w||u[26]!==k||u[27]!==E||u[28]!==y||u[29]!==A||u[30]!==j||u[31]!==N||u[32]!==P||u[33]!==F||u[34]!==I?(L=/* @__PURE__ */ c(`textarea`,{"aria-invalid":w,"data-validation":A,"data-slot":j,className:N,"data-drag-over":E,onDragEnter:P,onDragLeave:F,onDropCapture:I,ref:k,...y}),u[25]=w,u[26]=k,u[27]=E,u[28]=y,u[29]=A,u[30]=j,u[31]=N,u[32]=P,u[33]=F,u[34]=I,u[35]=L):L=u[35],L};export{l as TextArea};
@@ -0,0 +1 @@
1
+ "use client";import{t as e}from"./use-matches-media-query-FfvtNKQe.js";import{n as t,t as n}from"./cookie-ca4g5CKp.js";import{t as r}from"./cx-CK7o_rVv.js";import{t as i}from"./browser-only-ymFoM3Ya.js";import{t as a}from"./use-prefers-reduced-motion-Ck6dnOM9.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,useSyncExternalStore as f}from"react";import p from"tiny-invariant";import{jsx as m}from"react/jsx-runtime";import{flushSync as h}from"react-dom";let g=null;function ee(e,{origin:t}={}){if(typeof document.startViewTransition!=`function`||a()||document.visibilityState!==`visible`){e();return}if(g!=null){g.skipTransition(),g.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)});g=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}),g=null,delete n.dataset.themeTransitionMany;for(let e of s)delete e.dataset.themeTransition};c.finished.finally(()=>{d()})}function _(e){if(h(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 D=e=>e;function O(e){return typeof e==`string`&&C.some(t=>t===e)}function te({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`};function N(e){let t=e,n=/* @__PURE__ */ new Set;return{getTheme:()=>t,setTheme:e=>{if(e!==t){t=e;for(let e of n)e()}},subscribe:e=>(n.add(e),()=>{n.delete(e)})}}const P=s(null),F=N(j),I=s(void 0);function L(e){let n=o(23),{children:r,forceTheme:a,ssrCookie:s}=e,c;n[0]!==a||n[1]!==s?(c=()=>{let e=Y({cookie:i()?Q()??s:s});return B(e,{forceTheme:a}),N(e)},n[0]=a,n[1]=s,n[2]=c):c=n[2];let[f]=d(c),p;n[3]===s?p=n[4]:(p=Y({cookie:s}),n[3]=s,n[4]=p);let h=p,g=u(null),_,v;n[5]!==a||n[6]!==s||n[7]!==f?(_=()=>{let e=function(){let e=Y({cookie:Q()??s});f.setTheme(e),B(e,{forceTheme:a})};e();let n=t(Q(),A);n!=null&&!E(n)&&Object.hasOwn(M,n)&&$(Y({cookie:Q()}));try{`BroadcastChannel`in window&&(g.current=new BroadcastChannel(A),g.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),ae(g.current),g.current=null}},v=[a,s,f],n[5]=a,n[6]=s,n[7]=f,n[8]=_,n[9]=v):(_=n[8],v=n[9]),l(_,v);let y;n[10]!==a||n[11]!==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.getTheme())},i=()=>{let e=r();$(e),f.setTheme(e),B(e,{forceTheme:a}),Z(e,{broadcastChannel:g.current,pingKey:`${A}__ping`})},o=window.matchMedia(k).matches;(a??H(r(),{prefersDarkMode:o}))===document.documentElement.dataset.appliedTheme?i():ee(i,{origin:n})},n[10]=a,n[11]=f,n[12]=y):y=n[12];let b;n[13]!==h||n[14]!==f||n[15]!==y?(b={serverTheme:h,setTheme:y,store:f},n[13]=h,n[14]=f,n[15]=y,n[16]=b):b=n[16];let x=b,S;n[17]!==r||n[18]!==x?(S=/* @__PURE__ */ m(P.Provider,{value:x,children:r}),n[17]=r,n[18]=x,n[19]=S):S=n[19];let C;return n[20]!==a||n[21]!==S?(C=/* @__PURE__ */ m(I.Provider,{value:a,children:S}),n[20]=a,n[21]=S,n[22]=C):C=n[22],C}function R(){let e=o(3),t=c(P);p(t,`useTheme must be used within a ThemeProvider`);let n=z(t),r;return e[0]!==t.setTheme||e[1]!==n?(r=[n,t.setTheme],e[0]=t.setTheme,e[1]=n,e[2]=r):r=e[2],r}function z(e){let t=o(2),n=e?.store??F,r=e?.serverTheme??j,i;return t[0]===r?i=t[1]:(i=()=>r,t[0]=r,t[1]=i),f(n.subscribe,n.getTheme,i)}function B(e,{forceTheme:t}={}){if(!i())return;let n=window.document.documentElement,r=window.matchMedia(k).matches,a=t??H(e,{prefersDarkMode:r}),o=n.dataset.theme,s=n.dataset.appliedTheme,c=E(o)?o:void 0,l=O(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 V(){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:O(e.dataset.appliedTheme)?e.dataset.appliedTheme:void 0,theme:t}}function H(e,{prefersDarkMode:t}){return e===`system`?t?`dark`:`light`:e}function U(){let t=o(4),n=z(c(P)),r=W(),i=e(k),a;return t[0]!==r||t[1]!==i||t[2]!==n?(a=r??H(n,{prefersDarkMode:i}),t[0]=r,t[1]=i,t[2]=n,t[3]=a):a=t[3],a}function W(){return c(I)}function G({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 K(e){let t={storageKey:A,themeByCookieValue:M,forceTheme:e};return`(${G.toString()})(${JSON.stringify(t)})`}const q=e=>{let t=o(7),{forceTheme:n,nonce:r}=e,i;t[0]===n?i=t[1]:(i=K(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__ */ m(`script`,{dangerouslySetInnerHTML:a,nonce:r,suppressHydrationWarning:!0}),t[4]=r,t[5]=a,t[6]=s):s=t[6],s};function J(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=Y({cookie:Q()??u}),e=H(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=Y({cookie:u}),e=H(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 Y({cookie:e}){if(!e)return j;let n=t(e,A);return n==null||!Object.hasOwn(M,n)?j:M[n]??j}function X(e){return n(e,A)}function Z(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 ne=[`ngrok.com`,`ngrok.ai`];function re(e){let t=ne.find(t=>e===t||e.endsWith(`.${t}`));return t==null?void 0:`.${t}`}function ie(e){let t=/* @__PURE__ */ new Date;t.setFullYear(t.getFullYear()+1);let{hostname:n,protocol:r}=window.location,i=re(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=ie(e)}catch{}}function ae(e){if(e!=null)try{e.close()}catch{}}export{w as _,K as a,W as c,D as d,T as f,C as g,E as h,Y as i,J as l,O as m,L as n,V as o,te as p,X as r,U as s,q as t,R as u};
@@ -7,8 +7,8 @@
7
7
  * @see https://mantle.ngrok.com/components/forms/theme-switcher
8
8
  */
9
9
  import { t as WithStyleProps } from "./with-style-props-CuT30s0W.js";
10
- import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
11
- import { n as IconButtonProps, r as IconButtonAppearance } from "./button-BGwOPjGV.js";
10
+ import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
11
+ import { n as IconButtonProps, r as IconButtonAppearance } from "./button-DnYv7IOT.js";
12
12
  import { ReactNode } from "react";
13
13
  /**
14
14
  * The props for the `ThemeSwitcherIcon` component.
@@ -114,8 +114,8 @@ type ThemeDropdownMenuItemProps = WithStyleProps & ({
114
114
  label?: never;
115
115
  });
116
116
  /**
117
- * Must render inside a `DropdownMenu.Content` or `DropdownMenu.SubContent` —
118
- * the type system cannot express this constraint, so it is on you to uphold it.
117
+ * Must render inside a `DropdownMenu.Content` or `DropdownMenu.SubContent`.
118
+ * The type system cannot express this constraint, so it is on you to uphold it.
119
119
  *
120
120
  * The light/dark toggle for an existing menu, such as an account menu: one
121
121
  * "Theme" row that ends in the `ThemeSwitcher` icon. It is the menu form of
@@ -1 +1 @@
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};
1
+ "use client";import{t as e}from"./use-is-hydrated-BeLOGKwE.js";import{t}from"./use-matches-media-query-FfvtNKQe.js";import{t as n}from"./cx-CK7o_rVv.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{t as i}from"./browser-only-CZfkNw5A.js";import{t as a}from"./button-B9bChDgl.js";import{t as o}from"./dropdown-menu-uheL0prz.js";import{r as s}from"./button-DNLTJ32M.js";import{n as c}from"./icons-DcesO4Ng.js";import{t as l}from"./skeleton-DHfyjuQi.js";import{c as u,p as d,s as f,u as p}from"./theme-BNdZl352.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 t=m(9),{className:r,style:a}=e,o=f(),c;t[0]===r?c=t[1]:(c=n(`flex shrink-0 items-center justify-center text-muted`,r),t[0]=r,t[1]=c);let u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=/* @__PURE__ */ g(l,{asChild:!0,className:`rounded-full size-5`,children:/* @__PURE__ */ g(`span`,{})}),t[2]=u):u=t[2];let d;t[3]===o?d=t[4]:(d=/* @__PURE__ */ g(i,{fallback:u,children:()=>/* @__PURE__ */ g(s,{active:o,icons:v})}),t[3]=o,t[4]=d);let p;return t[5]!==a||t[6]!==c||t[7]!==d?(p=/* @__PURE__ */ g(`span`,{"aria-hidden":!0,"data-slot":`theme-switcher-icon`,className:c,style:a,children:d}),t[5]=a,t[6]=c,t[7]=d,t[8]=p):p=t[8],p}function b(){let e=m(10),[n,r]=p(),i=u(),a=t(`(prefers-color-scheme: dark)`),o=i!=null,s;e[0]!==a||e[1]!==n?(s=C(d({theme:n,prefersDarkMode:a}),{prefersDarkMode:a}),e[0]=a,e[1]=n,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:r,className:i,label:a,style:s}=e,c=b(),l=r!=null&&typeof r!=`boolean`&&r!==``,u=a==null&&!l?`Theme: ${c.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]!==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(n){let o=m(28),c,h,_,y,b,x;o[0]===n?(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}=n,o[0]=n,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=t(`(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=r(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(i,{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,5 +1,5 @@
1
1
  /**
2
- * Re-exports for the Theme component — the provider and hooks that carry the
2
+ * Re-exports for the Theme component: the provider and hooks that carry the
3
3
  * applied theme, plus the document tags that stop a wrong-theme flash.
4
4
  *
5
5
  * @useWhen Apply the light or dark theme to an app, follow the operating system by default, and
@@ -44,9 +44,9 @@ type ThemeProviderProps = PropsWithChildren<{
44
44
  * Pass the value `extractThemeCookie` returns. Pass the same value to
45
45
  * `useInitialHtmlThemeProps`. The server then seeds
46
46
  * the context with the stored theme, so the hydrated client agrees with the
47
- * server HTML. When omitted, the server renders `"system"`. A client with a
48
- * stored theme then reports a hydration mismatch. The client reads
49
- * `document.cookie`, and reads `ssrCookie` only when the environment blocks cookies.
47
+ * server HTML. When omitted, the server and the hydration render use
48
+ * `"system"`, and the render after hydration shows the stored theme. The client
49
+ * reads `document.cookie`, and reads `ssrCookie` only when the environment blocks cookies.
50
50
  */
51
51
  ssrCookie?: string;
52
52
  }>;
@@ -80,7 +80,7 @@ type ThemeProviderProps = PropsWithChildren<{
80
80
  *
81
81
  * @example
82
82
  * ```tsx
83
- * // a page locked to light — mirror the same value everywhere it is forced
83
+ * // a page locked to light: mirror the same value everywhere it is forced
84
84
  * <ThemeProvider forceTheme="light">
85
85
  * <App />
86
86
  * </ThemeProvider>
@@ -122,6 +122,8 @@ declare function readThemeFromHtmlElement(): {
122
122
  * Returns the theme the page paints in: the provider's `forceTheme` when it
123
123
  * has one, else the stored theme with `"system"` resolved against the OS
124
124
  * dark-mode preference. The result mirrors what lands on the `<html>` element.
125
+ * During hydration, it returns the theme the server rendered, so the markup
126
+ * matches. The next render returns the client theme.
125
127
  *
126
128
  * @see https://mantle.ngrok.com/components/primitives/theme
127
129
  */
@@ -175,14 +177,14 @@ type PreventWrongThemeFlashScriptProps = {
175
177
  *
176
178
  * @example
177
179
  * ```tsx
178
- * // entry.server.tsx — send font preloads as HTTP headers (preferred for SSR)
180
+ * // entry.server.tsx: send font preloads as HTTP headers (preferred for SSR)
179
181
  * headers.set("Link", [
180
182
  * `<${assetsCdnOrigin}>; rel=preconnect; crossorigin`,
181
183
  * preloadFontLink("roobert"),
182
184
  * preloadFontLink("jetbrains-mono"),
183
185
  * ].join(", "));
184
186
  *
185
- * // root.tsx — only the FOUC script in <head>
187
+ * // root.tsx: only the FOUC script in <head>
186
188
  * <head>
187
189
  * <PreventWrongThemeFlashScript nonce={nonce} />
188
190
  * </head>
@@ -311,11 +313,11 @@ type PreloadFontProps = {
311
313
  /**
312
314
  * The name of the individual core font to preload.
313
315
  *
314
- * - `"roobert"` — Roobert proportional variable font
315
- * - `"jetbrains-mono"` — JetBrains Mono variable weight
316
- * - `"jetbrains-mono-italic"` — JetBrains Mono italic variable weight
317
- * - `"family-regular"` — Family regular
318
- * - `"family-italic"` — Family italic
316
+ * - `"roobert"`: Roobert proportional variable font
317
+ * - `"jetbrains-mono"`: JetBrains Mono variable weight
318
+ * - `"jetbrains-mono-italic"`: JetBrains Mono italic variable weight
319
+ * - `"family-regular"`: Family regular
320
+ * - `"family-italic"`: Family italic
319
321
  */
320
322
  name: CoreFontName;
321
323
  };
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-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};
1
+ "use client";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-BNdZl352.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
@@ -5,8 +5,8 @@
5
5
  */
6
6
  import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
7
7
  import { t as WithStyleProps } from "./with-style-props-CuT30s0W.js";
8
- import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
9
- import { n as SvgOnlyProps } from "./icon-DXDyhy2N.js";
8
+ import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
9
+ import { n as SvgOnlyProps } from "./icon-QCm1ui29.js";
10
10
  import { ComponentProps, ReactNode } from "react";
11
11
  import { Toaster as Toaster$1 } from "sonner";
12
12
  type ToasterPrimitiveProps = ComponentProps<typeof Toaster$1>;
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-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};
1
+ "use client";import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-xb7d9M7X.js";import{t as r}from"./slot-B7rwscwd.js";import{s as i}from"./theme-BNdZl352.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};