@ngrok/mantle 0.93.7 → 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 (311) hide show
  1. package/README.md +11 -2
  2. package/dist/accordion.d.ts +73 -21
  3. package/dist/accordion.js +1 -1
  4. package/dist/agent.json +1234 -84
  5. package/dist/alert-BkJHDx9X.js +1 -0
  6. package/dist/{alert-BcSBNR3S.d.ts → alert-D0zRRUHV.d.ts} +35 -25
  7. package/dist/alert-center.d.ts +67 -55
  8. package/dist/alert-center.js +1 -1
  9. package/dist/alert-dialog.d.ts +35 -10
  10. package/dist/alert-dialog.js +1 -1
  11. package/dist/alert.d.ts +6 -1
  12. package/dist/alert.js +1 -1
  13. package/dist/anchor-Dc6IgvXV.js +1 -0
  14. package/dist/anchor.d.ts +17 -5
  15. package/dist/anchor.js +1 -1
  16. package/dist/app-layout.d.ts +33 -18
  17. package/dist/app-layout.js +1 -1
  18. package/dist/area-chart.d.ts +153 -97
  19. package/dist/area-chart.js +1 -1
  20. package/dist/avatar.d.ts +36 -24
  21. package/dist/avatar.js +1 -1
  22. package/dist/badge.d.ts +19 -7
  23. package/dist/badge.js +1 -1
  24. package/dist/bar-chart.d.ts +155 -100
  25. package/dist/bar-chart.js +1 -1
  26. package/dist/breadcrumb.d.ts +47 -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.d.ts +8 -0
  31. package/dist/browser-only.js +1 -1
  32. package/dist/{button-BX-4lYUn.d.ts → button-5Pc7Mby_.d.ts} +4 -4
  33. package/dist/button-B9bChDgl.js +1 -0
  34. package/dist/button-D8jixIbH.js +1 -0
  35. package/dist/button-DNLTJ32M.js +1 -0
  36. package/dist/{button-CPsKGDK0.d.ts → button-Ddj6yr10.d.ts} +34 -27
  37. package/dist/{button-Yxyu1XMd.d.ts → button-DnYv7IOT.d.ts} +29 -22
  38. package/dist/button.d.ts +9 -3
  39. package/dist/button.js +1 -1
  40. package/dist/calendar.d.ts +8 -1
  41. package/dist/calendar.js +1 -1
  42. package/dist/card.d.ts +7 -2
  43. package/dist/card.js +1 -1
  44. package/dist/centered-layout.d.ts +34 -23
  45. package/dist/centered-layout.js +1 -1
  46. package/dist/chart-BLCqzt56.js +1 -0
  47. package/dist/chart-CChZiCrt.js +1 -0
  48. package/dist/chart-CUmSu9d7.js +1 -0
  49. package/dist/{chart-BpfbtOUN.d.ts → chart-Dl8gFo_D.d.ts} +117 -121
  50. package/dist/chart-DtgZBAas.js +2 -0
  51. package/dist/checkbox-Cu5cgZmk.js +1 -0
  52. package/dist/checkbox.d.ts +15 -2
  53. package/dist/checkbox.js +1 -1
  54. package/dist/choice-CCVG2hb9.js +1 -0
  55. package/dist/{choice-BLR0_MeB.d.ts → choice-CNiOSzqV.d.ts} +26 -20
  56. package/dist/choice.d.ts +6 -1
  57. package/dist/choice.js +1 -1
  58. package/dist/code-BPKNY1_w.js +1 -0
  59. package/dist/{code-block-BGdV4Yty.d.ts → code-block-BDw6MEwH.d.ts} +9 -9
  60. package/dist/{code-block-W3kWPxCJ.js → code-block-CKzsAMzj.js} +3 -3
  61. package/dist/code-block.d.ts +28 -19
  62. package/dist/code-block.js +1 -1
  63. package/dist/code-block_highlight-utils.d.ts +6 -1
  64. package/dist/code-block_highlight-utils.js +1 -1
  65. package/dist/code.d.ts +16 -3
  66. package/dist/code.js +1 -1
  67. package/dist/color-CHZbU1Ww.js +1 -0
  68. package/dist/color.js +1 -1
  69. package/dist/combobox.d.ts +42 -28
  70. package/dist/combobox.js +1 -1
  71. package/dist/command.d.ts +59 -47
  72. package/dist/command.js +1 -1
  73. package/dist/compose-refs-BdRUneoc.js +1 -0
  74. package/dist/{copy-to-clipboard-DInu78k_.js → copy-to-clipboard-Dd83caRw.js} +1 -1
  75. package/dist/cx.d.ts +4 -4
  76. package/dist/cx.js +1 -1
  77. package/dist/{data-slot-B-LqAcBB.d.ts → data-slot-BW8KQ9Xo.d.ts} +2 -2
  78. package/dist/data-table.d.ts +83 -52
  79. package/dist/data-table.js +1 -1
  80. package/dist/description-list.d.ts +13 -2
  81. package/dist/description-list.js +1 -1
  82. package/dist/{dialog-2fRO4ca4.d.ts → dialog-CIEuwNys.d.ts} +32 -8
  83. package/dist/dialog-CbEEA0fl.d.ts +32 -0
  84. package/dist/dialog-DmzoDfY3.js +1 -0
  85. package/dist/dialog.d.ts +7 -2
  86. package/dist/dialog.js +1 -1
  87. package/dist/{dropdown-menu-CpjRwMWe.d.ts → dropdown-menu-CeY498yk.d.ts} +41 -33
  88. package/dist/dropdown-menu-uheL0prz.js +1 -0
  89. package/dist/dropdown-menu.d.ts +6 -1
  90. package/dist/dropdown-menu.js +1 -1
  91. package/dist/empty.d.ts +7 -2
  92. package/dist/empty.js +1 -1
  93. package/dist/field-Bpvn4tQp.js +1 -0
  94. package/dist/{field-V_gnkcmN.d.ts → field-BshcNVe_.d.ts} +1 -1
  95. package/dist/field-Cai_4c1l.js +1 -0
  96. package/dist/field.d.ts +53 -42
  97. package/dist/field.js +1 -1
  98. package/dist/flag.d.ts +11 -3
  99. package/dist/flag.js +1 -1
  100. package/dist/hooks.d.ts +35 -10
  101. package/dist/hooks.js +1 -1
  102. package/dist/hover-card.d.ts +25 -14
  103. package/dist/hover-card.js +1 -1
  104. package/dist/{icon-CgNqu-fl.d.ts → icon--purqHRo.d.ts} +1 -1
  105. package/dist/{icon-ByLVhdYq.d.ts → icon-DuIYoyft.d.ts} +8 -2
  106. package/dist/{icon-DXDyhy2N.d.ts → icon-QCm1ui29.d.ts} +2 -2
  107. package/dist/icon-xb7d9M7X.js +1 -0
  108. package/dist/icon.d.ts +8 -3
  109. package/dist/icon.js +1 -1
  110. package/dist/icons-DEDCLZ8B.js +1 -0
  111. package/dist/icons-DXadFwpo.js +1 -0
  112. package/dist/icons-DcesO4Ng.js +1 -0
  113. package/dist/icons.d.ts +13 -1
  114. package/dist/icons.js +1 -1
  115. package/dist/{in-view-B3nMAzfE.d.ts → in-view-C_daNafg.d.ts} +4 -23
  116. package/dist/{index-BhfgyurF.d.ts → index-KJ06KK6t.d.ts} +3 -3
  117. package/dist/input-BjCDSOPA.js +1 -0
  118. package/dist/{input-Dx5owTCc.d.ts → input-DC4nW0Sr.d.ts} +12 -2
  119. package/dist/input-fW8QSZEO.js +1 -0
  120. package/dist/input.d.ts +37 -5
  121. package/dist/input.js +1 -1
  122. package/dist/kbd-P1nQshWo.js +1 -0
  123. package/dist/kbd.d.ts +17 -5
  124. package/dist/kbd.js +1 -1
  125. package/dist/label-DO1RlMKl.js +1 -0
  126. package/dist/{label-Dn5CPJUj.d.ts → label-epgtywRz.d.ts} +14 -8
  127. package/dist/label.d.ts +6 -1
  128. package/dist/label.js +1 -1
  129. package/dist/layer-container-DL4yclOu.js +1 -0
  130. package/dist/layer-container.d.ts +2 -2
  131. package/dist/layer-container.js +1 -1
  132. package/dist/line-chart.d.ts +147 -90
  133. package/dist/line-chart.js +1 -1
  134. package/dist/list-cQZPSjfz.js +1 -0
  135. package/dist/list.d.ts +34 -16
  136. package/dist/list.js +1 -1
  137. package/dist/live-region-Dhapu8a5.js +1 -0
  138. package/dist/live-region.d.ts +15 -2
  139. package/dist/live-region.js +1 -1
  140. package/dist/llms.txt +82 -79
  141. package/dist/main-CHyWYDak.js +1 -0
  142. package/dist/main.d.ts +13 -1
  143. package/dist/main.js +1 -1
  144. package/dist/mantle.css +133 -88
  145. package/dist/media-object.d.ts +16 -4
  146. package/dist/media-object.js +1 -1
  147. package/dist/migrations/0014-chart-named-colors.yml +1389 -0
  148. package/dist/migrations/0015-segmented-control.yml +788 -0
  149. package/dist/multi-select.d.ts +42 -29
  150. package/dist/multi-select.js +1 -1
  151. package/dist/otp-input.d.ts +20 -8
  152. package/dist/otp-input.js +1 -1
  153. package/dist/pagination.d.ts +93 -4
  154. package/dist/pagination.js +1 -1
  155. package/dist/{popover-BfB2I9G0.d.ts → popover-Bei0jyfH.d.ts} +87 -12
  156. package/dist/popover-DhgunktK.js +1 -0
  157. package/dist/popover-T2EyaqGK.d.ts +1 -0
  158. package/dist/popover.d.ts +7 -2
  159. package/dist/popover.js +1 -1
  160. package/dist/primitive-D8CzV_Ft.js +1 -0
  161. package/dist/progress.d.ts +28 -11
  162. package/dist/progress.js +1 -1
  163. package/dist/qr-code.d.ts +11 -3
  164. package/dist/qr-code.js +1 -1
  165. package/dist/query-filter.d.ts +6 -6
  166. package/dist/query.d.ts +9 -4
  167. package/dist/query.js +1 -1
  168. package/dist/radio-group-BJQ6EOqh.d.ts +27 -0
  169. package/dist/radio-group-BliblUqe.js +1 -0
  170. package/dist/radio-group-ggEkCi0V.js +1 -0
  171. package/dist/radio-group.d.ts +21 -100
  172. package/dist/radio-group.js +1 -1
  173. package/dist/sandbar.d.ts +43 -30
  174. package/dist/sandbar.js +1 -1
  175. package/dist/sandboxed-on-click-D4PL5_GR.js +1 -0
  176. package/dist/sandboxed-on-click.d.ts +8 -0
  177. package/dist/sandboxed-on-click.js +1 -1
  178. package/dist/scatter-plot.d.ts +137 -76
  179. package/dist/scatter-plot.js +1 -1
  180. package/dist/segmented-control.d.ts +136 -0
  181. package/dist/segmented-control.js +1 -0
  182. package/dist/select-1xuUx_os.js +1 -0
  183. package/dist/{select-BkhBxtOT.d.ts → select-BpaXHxJm.d.ts} +33 -25
  184. package/dist/select.d.ts +6 -1
  185. package/dist/select.js +1 -1
  186. package/dist/selectable-list.d.ts +29 -18
  187. package/dist/selectable-list.js +1 -1
  188. package/dist/{separator-D9AWEkcJ.d.ts → separator-Ck4sPrdN.d.ts} +4 -2
  189. package/dist/separator-DnvhwY2J.js +1 -0
  190. package/dist/separator.d.ts +6 -1
  191. package/dist/separator.js +1 -1
  192. package/dist/{shake-DL6WhMXM.js → shake-CAUpKBHe.js} +1 -1
  193. package/dist/sheet-DHy_vlme.js +1 -0
  194. package/dist/sheet.d.ts +36 -7
  195. package/dist/sheet.js +1 -1
  196. package/dist/sidebar.d.ts +53 -37
  197. package/dist/sidebar.js +1 -1
  198. package/dist/skeleton-DHfyjuQi.js +1 -0
  199. package/dist/skeleton.d.ts +15 -4
  200. package/dist/skeleton.js +1 -1
  201. package/dist/skip-to-main-link.d.ts +12 -1
  202. package/dist/skip-to-main-link.js +1 -1
  203. package/dist/slider.d.ts +11 -1
  204. package/dist/slider.js +1 -1
  205. package/dist/slot-B7rwscwd.js +1 -0
  206. package/dist/{slot-C0OCJjdJ.d.ts → slot-BEMQMbk3.d.ts} +6 -4
  207. package/dist/slot.d.ts +6 -1
  208. package/dist/slot.js +1 -1
  209. package/dist/source-all.css +5 -1
  210. package/dist/split-button.d.ts +20 -9
  211. package/dist/split-button.js +1 -1
  212. package/dist/strata.d.ts +35 -22
  213. package/dist/strata.js +1 -1
  214. package/dist/{suggestions-NkqYTT49.d.ts → suggestions-BJeGvwDa.d.ts} +7 -7
  215. package/dist/switch.d.ts +14 -2
  216. package/dist/switch.js +1 -1
  217. package/dist/table-BnLdXUai.js +1 -0
  218. package/dist/{table-vT6Okwfa.d.ts → table-Ii9hHUWN.d.ts} +84 -5
  219. package/dist/table.d.ts +6 -1
  220. package/dist/table.js +1 -1
  221. package/dist/tabs.d.ts +24 -12
  222. package/dist/tabs.js +1 -1
  223. package/dist/text-area.d.ts +12 -2
  224. package/dist/text-area.js +1 -1
  225. package/dist/theme-BNdZl352.js +1 -0
  226. package/dist/theme-switcher.d.ts +18 -4
  227. package/dist/theme-switcher.js +1 -1
  228. package/dist/theme.d.ts +25 -11
  229. package/dist/theme.js +1 -1
  230. package/dist/toast.d.ts +15 -2
  231. package/dist/toast.js +1 -1
  232. package/dist/tokens.dark.json +3261 -0
  233. package/dist/tokens.json +4933 -0
  234. package/dist/tokens.resolver.json +37 -0
  235. package/dist/{tooltip-NcLIeBy5.d.ts → tooltip-CstGDKwy.d.ts} +18 -11
  236. package/dist/tooltip-DQO40Mrq.js +1 -0
  237. package/dist/tooltip.d.ts +6 -1
  238. package/dist/tooltip.js +1 -1
  239. package/dist/truncated-text.d.ts +28 -14
  240. package/dist/truncated-text.js +1 -1
  241. package/dist/types.d.ts +1 -1
  242. package/dist/types.js +1 -1
  243. package/dist/use-breakpoint-B4Kh0xE6.js +1 -0
  244. package/dist/use-callback-ref-DiOXFQzM.js +1 -0
  245. package/dist/use-composed-refs-DPYmLDSe.js +1 -0
  246. package/dist/use-copy-to-clipboard-hBL6_65i.js +1 -0
  247. package/dist/use-inert-siblings-C4RHXrZc.js +1 -0
  248. package/dist/use-is-apple-platform-Bq6_KbVX.js +1 -0
  249. package/dist/use-is-hydrated-BeLOGKwE.js +1 -0
  250. package/dist/use-is-hydrated-after-paint-CrHt3OHw.js +1 -0
  251. package/dist/use-isomorphic-layout-effect-CL6iq0Bj.js +1 -0
  252. package/dist/use-matches-media-query-FfvtNKQe.js +1 -0
  253. package/dist/use-prefers-reduced-motion-Ck6dnOM9.js +1 -0
  254. package/dist/use-swipe-to-dismiss-BYdlca8r.js +1 -0
  255. package/dist/utils.d.ts +1 -1
  256. package/dist/utils.js +1 -1
  257. package/dist/visually-hidden.d.ts +14 -1
  258. package/dist/visually-hidden.js +1 -1
  259. package/dist/well.d.ts +7 -2
  260. package/dist/well.js +1 -1
  261. package/package.json +21 -7
  262. package/src/components/chart/d3-license.md +25 -0
  263. package/dist/alert-P9lwn25X.js +0 -1
  264. package/dist/anchor-CgcbWEUs.js +0 -1
  265. package/dist/browser-only-BTSrYWLj.js +0 -1
  266. package/dist/button-69InNC_m.js +0 -1
  267. package/dist/button-B8k98Pby.js +0 -1
  268. package/dist/button-Dge0D5bl.js +0 -1
  269. package/dist/chart-BpWfQAwf.js +0 -2
  270. package/dist/checkbox-DmSQXs26.js +0 -1
  271. package/dist/choice-2Lrv8_nl.js +0 -1
  272. package/dist/code-DUJzSl4K.js +0 -1
  273. package/dist/compose-refs-sFdxsL7k.js +0 -1
  274. package/dist/dialog-7TUgiSzX.js +0 -1
  275. package/dist/dialog-Dp0QGWwo.d.ts +0 -28
  276. package/dist/dropdown-menu-BHBzCDSZ.js +0 -1
  277. package/dist/field-Bihblt8U.js +0 -1
  278. package/dist/field-CPvjazWN.js +0 -1
  279. package/dist/icon-kK0c-POG.js +0 -1
  280. package/dist/icons-CDLz5lpI.js +0 -1
  281. package/dist/icons-CSwTVV2m.js +0 -1
  282. package/dist/icons-DP3lQw5O.js +0 -1
  283. package/dist/input-CpQ6jlpI.js +0 -1
  284. package/dist/kbd-CLHsJ99p.js +0 -1
  285. package/dist/label-nHqqYS7e.js +0 -1
  286. package/dist/layer-container-kEQiE4zV.js +0 -1
  287. package/dist/list-RFRIQxU2.js +0 -1
  288. package/dist/live-region-DQ1QLv3L.js +0 -1
  289. package/dist/main-CC1L9IsH.js +0 -1
  290. package/dist/popover-C96V8SXi.d.ts +0 -1
  291. package/dist/popover-DxOqLKxy.js +0 -1
  292. package/dist/primitive-Dz9Al-us.js +0 -1
  293. package/dist/radio-group-HDVxTNPi.js +0 -1
  294. package/dist/sandboxed-on-click-C7pPu-2M.js +0 -1
  295. package/dist/select-CAAYk4Yj.js +0 -1
  296. package/dist/separator-DfzxVutO.js +0 -1
  297. package/dist/sheet-CSJc_sB4.js +0 -1
  298. package/dist/skeleton-DBpI-ko5.js +0 -1
  299. package/dist/slot-DdYN1L1C.js +0 -1
  300. package/dist/table-CFHiDBW8.js +0 -1
  301. package/dist/theme-C-glc5Q-.js +0 -1
  302. package/dist/tooltip-b6oiTaWq.js +0 -1
  303. package/dist/use-breakpoint--mo7kr9d.js +0 -1
  304. package/dist/use-callback-ref-BvVyI5K1.js +0 -1
  305. package/dist/use-copy-to-clipboard-Dy_0Qzb7.js +0 -1
  306. package/dist/use-is-apple-platform-D4nifHMx.js +0 -1
  307. package/dist/use-is-hydrated-after-paint-r9Cl2mGp.js +0 -1
  308. package/dist/use-isomorphic-layout-effect-CLSmHzo4.js +0 -1
  309. package/dist/use-matches-media-query-m860lols.js +0 -1
  310. package/dist/use-prefers-reduced-motion-CU6mWmOe.js +0 -1
  311. package/dist/use-swipe-to-dismiss-DceYk1Id.js +0 -1
@@ -1,14 +1,19 @@
1
- import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
2
- import { t as Button } from "./button-CPsKGDK0.js";
3
- import { t as IconButton } from "./button-Yxyu1XMd.js";
1
+ /**
2
+ * Re-exports for the Split Button component.
3
+ *
4
+ * @see https://mantle.ngrok.com/components/actions/split-button
5
+ */
6
+ import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
7
+ import { t as Button } from "./button-Ddj6yr10.js";
8
+ import { t as IconButton } from "./button-DnYv7IOT.js";
4
9
  import { t as ButtonSize } from "./button-L4exxu_L.js";
5
- import { t as DropdownMenu } from "./dropdown-menu-CpjRwMWe.js";
10
+ import { t as DropdownMenu } from "./dropdown-menu-CeY498yk.js";
6
11
  import { ComponentProps, ReactNode } from "react";
7
12
  type RootProps = ComponentProps<typeof DropdownMenu.Root> & ComponentProps<"div"> & {
8
13
  /**
9
14
  * The size of the SplitButton, default `"md"`. Applied to both the
10
15
  * primary action and the menu trigger so the two halves always share
11
- * one height — the parts do not accept `size`, so mixed-size
16
+ * one height. The parts do not accept `size`, so mixed-size
12
17
  * composites cannot be expressed in the type system.
13
18
  */
14
19
  size?: ButtonSize;
@@ -76,7 +81,7 @@ type PrimaryActionProps = Omit<ComponentProps<typeof Button>, "appearance" | "in
76
81
  * </SplitButton.Root>
77
82
  * ```
78
83
  */
79
- declare const PrimaryAction: (props: PrimaryActionProps) => import("react").JSX.Element;
84
+ declare const PrimaryAction: ({ "data-slot": dataSlot, ...props }: PrimaryActionProps) => import("react").JSX.Element;
80
85
  type MenuTriggerProps = Omit<ComponentProps<typeof IconButton>, "appearance" | "intent" | "size" | "asChild" | "icon"> & {
81
86
  icon?: ReactNode;
82
87
  };
@@ -107,7 +112,7 @@ type MenuTriggerProps = Omit<ComponentProps<typeof IconButton>, "appearance" | "
107
112
  * </SplitButton.Root>
108
113
  * ```
109
114
  */
110
- declare const MenuTrigger: ({ icon, ...props }: MenuTriggerProps) => import("react").JSX.Element;
115
+ declare const MenuTrigger: ({ "data-slot": dataSlot, icon, ...props }: MenuTriggerProps) => import("react").JSX.Element;
111
116
  /**
112
117
  * The container for the split button dropdown menu content. Appears in a
113
118
  * portal with scrolling and animations.
@@ -136,7 +141,7 @@ declare const MenuTrigger: ({ icon, ...props }: MenuTriggerProps) => import("rea
136
141
  * </SplitButton.Root>
137
142
  * ```
138
143
  */
139
- declare const MenuContent: ({ align, ...props }: ComponentProps<typeof DropdownMenu.Content>) => import("react").JSX.Element;
144
+ declare const MenuContent: ({ align, "data-slot": dataSlot, ...props }: ComponentProps<typeof DropdownMenu.Content>) => import("react").JSX.Element;
140
145
  /**
141
146
  * A standard item in the split button dropdown menu that can be selected or
142
147
  * activated.
@@ -165,12 +170,18 @@ declare const MenuContent: ({ align, ...props }: ComponentProps<typeof DropdownM
165
170
  * </SplitButton.Root>
166
171
  * ```
167
172
  */
168
- declare const MenuItem: ({ className, ...props }: ComponentProps<typeof DropdownMenu.Item>) => import("react").JSX.Element;
173
+ declare const MenuItem: ({ className, "data-slot": dataSlot, ...props }: ComponentProps<typeof DropdownMenu.Item>) => import("react").JSX.Element;
169
174
  /**
170
175
  * A button group that pairs a one-click default action with a dropdown menu
171
176
  * of related alternatives. Best for when users typically want one action but
172
177
  * occasionally need variants.
173
178
  *
179
+ * @useWhen Run a default action on one click, and offer related alternatives in an attached menu.
180
+ *
181
+ * @siblings
182
+ * - `Button`: the control runs one action, with no alternatives.
183
+ * - `DropdownMenu`: the button only opens a menu and runs no default action.
184
+ *
174
185
  * @see https://mantle.ngrok.com/components/actions/split-button
175
186
  *
176
187
  * @example
@@ -1 +1 @@
1
- import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-kK0c-POG.js";import{t as r}from"./button-Dge0D5bl.js";import{t as i}from"./button-B8k98Pby.js";import{t as a}from"./dropdown-menu-BHBzCDSZ.js";import{c as o}from"react/compiler-runtime";import{CaretDownIcon as s}from"@phosphor-icons/react/CaretDown";import{createContext as c,useContext as l}from"react";import{jsx as u}from"react/jsx-runtime";const d=c({size:`md`}),f={Root:n=>{let r=o(35),i,s,c,l,f,p,m,h,g,_,v;r[0]===n?(i=r[1],s=r[2],c=r[3],l=r[4],f=r[5],p=r[6],m=r[7],h=r[8],g=r[9],_=r[10],v=r[11]):({"data-slot":c,className:s,children:i,dir:f,open:h,defaultOpen:l,onOpenChange:m,modal:p,size:v,ref:_,...g}=n,r[0]=n,r[1]=i,r[2]=s,r[3]=c,r[4]=l,r[5]=f,r[6]=p,r[7]=m,r[8]=h,r[9]=g,r[10]=_,r[11]=v);let y=v===void 0?`md`:v,b;r[12]===y?b=r[13]:(b={size:y},r[12]=y,r[13]=b);let x=b,S;r[14]===c?S=r[15]:(S=t(c,`split-button`),r[14]=c,r[15]=S);let C;r[16]===s?C=r[17]:(C=e(`flex flex-row [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:not(:first-child)]:-ml-px [&>*:focus]:relative [&>*:focus]:z-10 [&>*:hover]:relative [&>*:hover]:z-10 *:active:scale-100!`,s),r[16]=s,r[17]=C);let w;r[18]!==i||r[19]!==g||r[20]!==_||r[21]!==y||r[22]!==S||r[23]!==C?(w=/* @__PURE__ */ u(`div`,{"data-slot":S,"data-size":y,className:C,ref:_,...g,children:i}),r[18]=i,r[19]=g,r[20]=_,r[21]=y,r[22]=S,r[23]=C,r[24]=w):w=r[24];let T;r[25]!==x||r[26]!==w?(T=/* @__PURE__ */ u(d.Provider,{value:x,children:w}),r[25]=x,r[26]=w,r[27]=T):T=r[27];let E;return r[28]!==l||r[29]!==f||r[30]!==p||r[31]!==m||r[32]!==h||r[33]!==T?(E=/* @__PURE__ */ u(a.Root,{dir:f,open:h,defaultOpen:l,onOpenChange:m,modal:p,children:T}),r[28]=l,r[29]=f,r[30]=p,r[31]=m,r[32]=h,r[33]=T,r[34]=E):E=r[34],E},PrimaryAction:e=>{let t=o(3),{size:n}=l(d),i;return t[0]!==e||t[1]!==n?(i=/* @__PURE__ */ u(r,{appearance:`outlined`,intent:`neutral`,size:n,...e}),t[0]=e,t[1]=n,t[2]=i):i=t[2],i},MenuTrigger:e=>{let t=o(9),r,c;t[0]===e?(r=t[1],c=t[2]):({icon:r,...c}=e,t[0]=e,t[1]=r,t[2]=c);let{size:f}=l(d),p;t[3]===r?p=t[4]:(p=r??/* @__PURE__ */ u(n,{svg:/* @__PURE__ */ u(s,{weight:`bold`,className:`size-4 group-data-[state=open]:-rotate-180 transition-transform duration-200 ease-out-strong motion-reduce:transition-none`})}),t[3]=r,t[4]=p);let m;return t[5]!==c||t[6]!==f||t[7]!==p?(m=/* @__PURE__ */ u(a.Trigger,{asChild:!0,className:`group`,children:/* @__PURE__ */ u(i,{icon:p,appearance:`outlined`,intent:`neutral`,size:f,...c})}),t[5]=c,t[6]=f,t[7]=p,t[8]=m):m=t[8],m},MenuContent:e=>{let t=o(6),n,r;t[0]===e?(n=t[1],r=t[2]):({align:r,...n}=e,t[0]=e,t[1]=n,t[2]=r);let i=r===void 0?`end`:r,s;return t[3]!==i||t[4]!==n?(s=/* @__PURE__ */ u(a.Content,{align:i,...n}),t[3]=i,t[4]=n,t[5]=s):s=t[5],s},MenuItem:t=>{let n=o(8),r,i;n[0]===t?(r=n[1],i=n[2]):({className:r,...i}=t,n[0]=t,n[1]=r,n[2]=i);let s;n[3]===r?s=n[4]:(s=e(`gap-2`,r),n[3]=r,n[4]=s);let c;return n[5]!==i||n[6]!==s?(c=/* @__PURE__ */ u(a.Item,{className:s,...i}),n[5]=i,n[6]=s,n[7]=c):c=n[7],c}};export{f as SplitButton};
1
+ "use client";import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./button-DNLTJ32M.js";import{t as r}from"./button-B9bChDgl.js";import{t as i}from"./dropdown-menu-uheL0prz.js";import{t as a}from"./icon-xb7d9M7X.js";import{c as o}from"react/compiler-runtime";import{CaretDownIcon as s}from"@phosphor-icons/react/CaretDown";import{createContext as c,useContext as l}from"react";import{jsx as u}from"react/jsx-runtime";const d=c({size:`md`}),f={Root:n=>{let r=o(35),a,s,c,l,f,p,m,h,g,_,v;r[0]===n?(a=r[1],s=r[2],c=r[3],l=r[4],f=r[5],p=r[6],m=r[7],h=r[8],g=r[9],_=r[10],v=r[11]):({"data-slot":c,className:s,children:a,dir:f,open:h,defaultOpen:l,onOpenChange:m,modal:p,size:v,ref:_,...g}=n,r[0]=n,r[1]=a,r[2]=s,r[3]=c,r[4]=l,r[5]=f,r[6]=p,r[7]=m,r[8]=h,r[9]=g,r[10]=_,r[11]=v);let y=v===void 0?`md`:v,b;r[12]===y?b=r[13]:(b={size:y},r[12]=y,r[13]=b);let x=b,S;r[14]===c?S=r[15]:(S=t(c,`split-button`),r[14]=c,r[15]=S);let C;r[16]===s?C=r[17]:(C=e(`flex flex-row [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:not(:first-child)]:-ml-px [&>*:focus]:relative [&>*:focus]:z-10 [&>*:hover]:relative [&>*:hover]:z-10 *:active:scale-100!`,s),r[16]=s,r[17]=C);let w;r[18]!==a||r[19]!==g||r[20]!==_||r[21]!==y||r[22]!==S||r[23]!==C?(w=/* @__PURE__ */ u(`div`,{"data-slot":S,"data-size":y,className:C,ref:_,...g,children:a}),r[18]=a,r[19]=g,r[20]=_,r[21]=y,r[22]=S,r[23]=C,r[24]=w):w=r[24];let T;r[25]!==x||r[26]!==w?(T=/* @__PURE__ */ u(d.Provider,{value:x,children:w}),r[25]=x,r[26]=w,r[27]=T):T=r[27];let E;return r[28]!==l||r[29]!==f||r[30]!==p||r[31]!==m||r[32]!==h||r[33]!==T?(E=/* @__PURE__ */ u(i.Root,{dir:f,open:h,defaultOpen:l,onOpenChange:m,modal:p,children:T}),r[28]=l,r[29]=f,r[30]=p,r[31]=m,r[32]=h,r[33]=T,r[34]=E):E=r[34],E},PrimaryAction:e=>{let r=o(9),i,a;r[0]===e?(i=r[1],a=r[2]):({"data-slot":i,...a}=e,r[0]=e,r[1]=i,r[2]=a);let{size:s}=l(d),c;r[3]===i?c=r[4]:(c=t(i,`split-button-primary-action`),r[3]=i,r[4]=c);let f;return r[5]!==a||r[6]!==s||r[7]!==c?(f=/* @__PURE__ */ u(n,{appearance:`outlined`,intent:`neutral`,size:s,"data-slot":c,...a}),r[5]=a,r[6]=s,r[7]=c,r[8]=f):f=r[8],f},MenuTrigger:e=>{let n=o(15),c,f,p;n[0]===e?(c=n[1],f=n[2],p=n[3]):({"data-slot":c,icon:f,...p}=e,n[0]=e,n[1]=c,n[2]=f,n[3]=p);let{size:m}=l(d),h;n[4]===c?h=n[5]:(h=t(c,`split-button-menu-trigger`),n[4]=c,n[5]=h);let g;n[6]===f?g=n[7]:(g=f??/* @__PURE__ */ u(a,{svg:/* @__PURE__ */ u(s,{weight:`bold`,className:`size-4 group-data-[state=open]:-rotate-180 transition-transform duration-200 ease-out-strong motion-reduce:transition-none`})}),n[6]=f,n[7]=g);let _;n[8]!==p||n[9]!==m||n[10]!==g?(_=/* @__PURE__ */ u(r,{icon:g,appearance:`outlined`,intent:`neutral`,size:m,...p}),n[8]=p,n[9]=m,n[10]=g,n[11]=_):_=n[11];let v;return n[12]!==h||n[13]!==_?(v=/* @__PURE__ */ u(i.Trigger,{asChild:!0,className:`group`,"data-slot":h,children:_}),n[12]=h,n[13]=_,n[14]=v):v=n[14],v},MenuContent:e=>{let n=o(10),r,a,s;n[0]===e?(r=n[1],a=n[2],s=n[3]):({align:s,"data-slot":r,...a}=e,n[0]=e,n[1]=r,n[2]=a,n[3]=s);let c=s===void 0?`end`:s,l;n[4]===r?l=n[5]:(l=t(r,`split-button-menu-content`),n[4]=r,n[5]=l);let d;return n[6]!==c||n[7]!==a||n[8]!==l?(d=/* @__PURE__ */ u(i.Content,{align:c,"data-slot":l,...a}),n[6]=c,n[7]=a,n[8]=l,n[9]=d):d=n[9],d},MenuItem:n=>{let r=o(12),a,s,c;r[0]===n?(a=r[1],s=r[2],c=r[3]):({className:a,"data-slot":s,...c}=n,r[0]=n,r[1]=a,r[2]=s,r[3]=c);let l;r[4]===a?l=r[5]:(l=e(`gap-2`,a),r[4]=a,r[5]=l);let d;r[6]===s?d=r[7]:(d=t(s,`split-button-menu-item`),r[6]=s,r[7]=d);let f;return r[8]!==c||r[9]!==l||r[10]!==d?(f=/* @__PURE__ */ u(i.Item,{className:l,"data-slot":d,...c}),r[8]=c,r[9]=l,r[10]=d,r[11]=f):f=r[11],f}};export{f as SplitButton};
package/dist/strata.d.ts CHANGED
@@ -1,5 +1,10 @@
1
+ /**
2
+ * Re-exports for the Strata component.
3
+ *
4
+ * @see https://mantle.ngrok.com/components/structure/strata
5
+ */
1
6
  import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
2
- import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
7
+ import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
3
8
  import { ComponentProps } from "react";
4
9
  /**
5
10
  * The stack of sections. Renders a `<div>` with `divide-card-muted divide-y`, so
@@ -7,7 +12,7 @@ import { ComponentProps } from "react";
7
12
  * the first or below the last. Vertical rhythm belongs to `Section`
8
13
  * (`py-8 first:pt-0`) rather than here, which keeps a lone `Section` usable
9
14
  * without a `Root` around it. Set `--strata-columns` on `Root` to re-split
10
- * every section at once — custom properties inherit, so one declaration reaches
15
+ * every section at once. Custom properties inherit, so one declaration reaches
11
16
  * all of them.
12
17
  *
13
18
  * | Data Attribute | Value | Description |
@@ -51,13 +56,13 @@ declare const Root: ({ asChild, children, className, "data-slot": dataSlot, ...p
51
56
  * section.
52
57
  *
53
58
  * The `<section>` takes no accessible name, which keeps it generic in the
54
- * accessibility tree instead of adding one `region` landmark per band — the
59
+ * accessibility tree instead of adding one `region` landmark per band. The
55
60
  * `Strata.Title` headings already carry the page outline, and a landmark list
56
61
  * only stays useful while `main` and `nav` are easy to find in it. Set
57
62
  * `aria-labelledby` to the `Title`'s `id` only when the section is a
58
63
  * destination a reader jumps back to, not merely a division of the page. To
59
64
  * tell apart controls that read alike across two sections, reach for
60
- * `Field.Set` and `Field.Legend` instead — assistive technology announces a
65
+ * `Field.Set` and `Field.Legend` instead: assistive technology announces a
61
66
  * landmark on entry, never per control.
62
67
  *
63
68
  * | CSS Variable | Default | Description |
@@ -96,7 +101,7 @@ declare const Root: ({ asChild, children, className, "data-slot": dataSlot, ...p
96
101
  */
97
102
  declare const Section: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"section"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
98
103
  /**
99
- * A section's introductory column — its `Strata.Title` and
104
+ * A section's introductory column: its `Strata.Title` and
100
105
  * `Strata.Description`. Renders a `<header>` with `flex flex-col gap-2`, so
101
106
  * anything else composed in (a `Badge`, a count) picks up the same spacing. At
102
107
  * `md` and up it takes the grid's first column; below the breakpoint it stacks
@@ -141,8 +146,8 @@ declare const Header: ({ asChild, children, className, "data-slot": dataSlot, ..
141
146
  /**
142
147
  * The section's heading. Renders an `<h2>`, one level below the page's `<h1>`,
143
148
  * because a `Strata.Section` is a top-level division of its page. Compose
144
- * `asChild` with the right element when a page nests its sections deeper —
145
- * 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.
146
151
  *
147
152
  * | Data Attribute | Value | Description |
148
153
  * | -------------- | ----------------- | ------------------------------------------------------------------ |
@@ -177,8 +182,8 @@ declare const Header: ({ asChild, children, className, "data-slot": dataSlot, ..
177
182
  declare const Title: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"h2"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
178
183
  /**
179
184
  * The sentence that says what the section's controls do, and what changing them
180
- * costs. Renders a `<p>` in muted body text beneath `Strata.Title`. Optional —
181
- * 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.
182
187
  *
183
188
  * | Data Attribute | Value | Description |
184
189
  * | -------------- | ----------------------- | ------------------------------------------------------------------ |
@@ -212,7 +217,7 @@ declare const Title: ({ asChild, children, className, "data-slot": dataSlot, ...
212
217
  */
213
218
  declare const Description: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"p"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
214
219
  /**
215
- * The section's content column — the controls, cards, or table that
220
+ * The section's content column: the controls, cards, or table that
216
221
  * `Strata.Header` describes. Renders a `<div>` with `flex flex-col gap-4`, so
217
222
  * stacked controls space themselves and a consumer's own `gap-*` replaces the
218
223
  * default cleanly. At `md` and up it takes the grid's second column; below the
@@ -251,14 +256,14 @@ declare const Description: ({ asChild, children, className, "data-slot": dataSlo
251
256
  declare const Body: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
252
257
  /**
253
258
  * A page of titled sections, each one explained beside its content. Every
254
- * section pairs a `Strata.Header` — its `Title` and `Description` — with a
259
+ * section pairs a `Strata.Header` (its `Title` and `Description`) with a
255
260
  * `Strata.Body` of controls. `Strata.Root` stacks the sections with a
256
261
  * hairline between them. Below the `md` breakpoint the header stacks above its
257
262
  * own content, so the pairing survives a narrow viewport. It is the shape of a
258
263
  * settings page, a resource configuration editor, and any form long enough that
259
264
  * each group needs its own explanation.
260
265
  *
261
- * 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.
262
267
  * Reach for [Card](https://mantle.ngrok.com/components/structure/card) when a
263
268
  * group needs a raised surface of its own, for
264
269
  * [MediaObject](https://mantle.ngrok.com/components/structure/media-object)
@@ -266,6 +271,14 @@ declare const Body: ({ asChild, children, className, "data-slot": dataSlot, ...p
266
271
  * [DescriptionList](https://mantle.ngrok.com/components/data-display/description-list)
267
272
  * when the pairs are read-only term/value data rather than headed sections.
268
273
  *
274
+ * @useWhen Lay out a settings page or a configuration editor as titled sections, each one explained
275
+ * beside its controls.
276
+ *
277
+ * @siblings
278
+ * - `Card`: a group needs a raised surface of its own.
279
+ * - `MediaObject`: the thing beside the text is an image or an icon.
280
+ * - `DescriptionList`: the pairs are read-only label and value data, not headed sections.
281
+ *
269
282
  * @see https://mantle.ngrok.com/components/structure/strata
270
283
  *
271
284
  * @example
@@ -350,12 +363,12 @@ declare const Strata: {
350
363
  * (`py-8 first:pt-0`). Both layouts size their tracks `minmax(0, …)`, so a
351
364
  * nowrap value in `Body` clips or wraps instead of widening the section. It
352
365
  * takes no accessible name, which keeps it generic in the accessibility tree
353
- * instead of adding one `region` landmark per band —
354
- * 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`
355
368
  * to the `Title`'s `id` only when the section is a destination a reader jumps
356
369
  * back to, not merely a division of the page. To tell apart controls that read
357
- * alike across two sections, reach for `Field.Set` and `Field.Legend` instead
358
- * — 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.
359
372
  *
360
373
  * | CSS Variable | Default | Description |
361
374
  * | ------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------- |
@@ -393,7 +406,7 @@ declare const Strata: {
393
406
  */
394
407
  readonly Section: typeof Section;
395
408
  /**
396
- * A section's introductory column — its `Title` and `Description`. Renders a
409
+ * A section's introductory column: its `Title` and `Description`. Renders a
397
410
  * `<header>` with `flex flex-col gap-2`, so anything else composed in picks
398
411
  * up the same spacing. At `md` and up it takes the grid's first column; below
399
412
  * the breakpoint it stacks above `Body`. Nested inside `Section`'s
@@ -434,8 +447,8 @@ declare const Strata: {
434
447
  /**
435
448
  * The section's heading. Renders an `<h2>`, one level below the page's
436
449
  * `<h1>`, because a `Section` is a top-level division of its page. Compose
437
- * `asChild` with the right element when a page nests its sections deeper —
438
- * 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.
439
452
  *
440
453
  * | Data Attribute | Value | Description |
441
454
  * | -------------- | ----------------- | ------------------------------------------------------------------ |
@@ -470,8 +483,8 @@ declare const Strata: {
470
483
  readonly Title: typeof Title;
471
484
  /**
472
485
  * The sentence that says what the section's controls do, and what changing
473
- * them costs. Renders a `<p>` in muted body text beneath `Title`. Optional —
474
- * 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.
475
488
  *
476
489
  * | Data Attribute | Value | Description |
477
490
  * | -------------- | ----------------------- | ------------------------------------------------------------------ |
@@ -505,7 +518,7 @@ declare const Strata: {
505
518
  */
506
519
  readonly Description: typeof Description;
507
520
  /**
508
- * 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`
509
522
  * describes. Renders a `<div>` with `flex flex-col gap-4`, so stacked
510
523
  * controls space themselves and a consumer's own `gap-*` replaces the default
511
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
@@ -1,5 +1,10 @@
1
- import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
2
- import { o as WithValidation } from "./field-V_gnkcmN.js";
1
+ /**
2
+ * Re-exports for the Switch component.
3
+ *
4
+ * @see https://mantle.ngrok.com/components/forms/switch
5
+ */
6
+ import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
7
+ import { o as WithValidation } from "./field-BshcNVe_.js";
3
8
  import { ComponentProps } from "react";
4
9
  import { Root } from "@radix-ui/react-switch";
5
10
  type SwitchProps = ComponentProps<typeof Root> & WithValidation & {
@@ -16,6 +21,13 @@ type SwitchProps = ComponentProps<typeof Root> & WithValidation & {
16
21
  * compose it inside [`Choice`](/components/forms/choice) for a titled, multi-line
17
22
  * label with a supplementary description.
18
23
  *
24
+ * @useWhen Turn one setting on or off, such as a feature toggle in a settings list.
25
+ *
26
+ * @siblings
27
+ * - `Checkbox`: the option needs an indeterminate state.
28
+ * - `Choice`: the switch needs a title and a description beside it.
29
+ * - `ThemeSwitcher`: the setting is the light or dark theme.
30
+ *
19
31
  * @see https://mantle.ngrok.com/components/forms/switch
20
32
  *
21
33
  * @example
package/dist/switch.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./booleanish-BfvnW6vy.js";import{t as r}from"./clsx-DUGZgXfJ.js";import{a as i,r as a}from"./field-CPvjazWN.js";import{c as o}from"react/compiler-runtime";import{jsx as s}from"react/jsx-runtime";import{Root as c,Thumb as l}from"@radix-ui/react-switch";const u=u=>{let d=o(32),f,p,m,h,g,_,v,y,b;d[0]===u?(f=d[1],p=d[2],m=d[3],h=d[4],g=d[5],_=d[6],v=d[7],y=d[8],b=d[9]):({"data-slot":_,"aria-invalid":f,"aria-readonly":p,className:g,readOnly:m,onClick:v,ref:b,validation:h,...y}=u,d[0]=u,d[1]=f,d[2]=p,d[3]=m,d[4]=h,d[5]=g,d[6]=_,d[7]=v,d[8]=y,d[9]=b);let x=m??p,S;d[10]===x?S=d[11]:(S=n(x),d[10]=x,d[11]=S);let C=S,w=i(),T=h??w,E;d[12]!==f||d[13]!==T?(E=a({"aria-invalid":f,validation:T}),d[12]=f,d[13]=T,d[14]=E):E=d[14];let{ariaInvalid:D,validation:O}=E,k;d[15]===_?k=d[16]:(k=t(_,`switch`),d[15]=_,d[16]=k);let A=O||void 0,j;d[17]===g?j=d[18]:(j=e(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full outline-hidden`,`disabled:cursor-default disabled:opacity-50`,`focus-visible:border-accent-600 focus-visible:ring-focus-accent focus-visible:outline-hidden focus-visible:ring-4`,`data-state-checked:bg-accent-600 data-state-unchecked:bg-gray-400`,`data-validation-success:data-state-checked:bg-success-600 focus-visible:data-validation-success:ring-focus-success`,`data-validation-warning:data-state-checked:bg-warning-600 focus-visible:data-validation-warning:ring-focus-warning`,`data-validation-error:data-state-checked:bg-danger-600 focus-visible:data-validation-error:ring-focus-danger`,g),d[17]=g,d[18]=j);let M;d[19]!==v||d[20]!==C?(M=e=>{C?e.preventDefault():v?.(e)},d[19]=v,d[20]=C,d[21]=M):M=d[21];let N;d[22]===Symbol.for(`react.memo_cache_sentinel`)?(N=/* @__PURE__ */ s(l,{className:r(`pointer-events-none block size-4 rounded-full bg-[#fff] shadow-md ring-0 transition-transform duration-200 ease-out-strong motion-reduce:transition-none`,`data-state-checked:translate-x-4.5 data-state-unchecked:translate-x-0.5`)}),d[22]=N):N=d[22];let P;return d[23]!==D||d[24]!==y||d[25]!==C||d[26]!==b||d[27]!==k||d[28]!==A||d[29]!==j||d[30]!==M?(P=/* @__PURE__ */ s(c,{"aria-invalid":D,"aria-readonly":C,"data-slot":k,"data-validation":A,className:j,onClick:M,ref:b,...y,children:N}),d[23]=D,d[24]=y,d[25]=C,d[26]=b,d[27]=k,d[28]=A,d[29]=j,d[30]=M,d[31]=P):P=d[31],P};export{u as Switch};
1
+ "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.
@@ -40,16 +40,77 @@ import { ComponentProps } from "react";
40
40
  * </Table.Root>
41
41
  * ```
42
42
  *
43
+ * @example
44
+ * Paginated, with the count line and a page-size select:
45
+ * ```tsx
46
+ * import {
47
+ * CursorPagination,
48
+ * PaginationRange,
49
+ * getOffsetPaginatedSlice,
50
+ * useOffsetPagination,
51
+ * } from "@ngrok/mantle/pagination";
52
+ * import { Table } from "@ngrok/mantle/table";
53
+ *
54
+ * function InvoicesTable({ invoices }: { invoices: Invoice[] }) {
55
+ * const pagination = useOffsetPagination({ listSize: invoices.length, pageSize: 20 });
56
+ * const pageInvoices = getOffsetPaginatedSlice(invoices, pagination);
57
+ *
58
+ * return (
59
+ * <div className="flex flex-col gap-4">
60
+ * <Table.Root>
61
+ * <Table.Element>
62
+ * <Table.Head>
63
+ * <Table.Row>
64
+ * <Table.Header>Invoice</Table.Header>
65
+ * <Table.Header className="text-right">Amount</Table.Header>
66
+ * </Table.Row>
67
+ * </Table.Head>
68
+ * <Table.Body>
69
+ * {pageInvoices.map((invoice) => (
70
+ * <Table.Row key={invoice.invoice}>
71
+ * <Table.Cell>{invoice.invoice}</Table.Cell>
72
+ * <Table.Cell className="text-right">{invoice.totalAmount}</Table.Cell>
73
+ * </Table.Row>
74
+ * ))}
75
+ * </Table.Body>
76
+ * </Table.Element>
77
+ * </Table.Root>
78
+ * <CursorPagination.Root
79
+ * className="flex flex-wrap justify-between"
80
+ * pageSize={pagination.pageSize}
81
+ * onChangePageSize={pagination.setPageSize}
82
+ * >
83
+ * <PaginationRange
84
+ * offset={pagination.offset}
85
+ * pageSize={pagination.pageSize}
86
+ * total={invoices.length}
87
+ * noun={{ singular: "invoice", plural: "invoices" }}
88
+ * />
89
+ * <div className="flex items-center gap-2">
90
+ * <CursorPagination.PageSizeSelect />
91
+ * <CursorPagination.Buttons
92
+ * hasPreviousPage={pagination.hasPreviousPage}
93
+ * hasNextPage={pagination.hasNextPage}
94
+ * onPreviousPage={pagination.previousPage}
95
+ * onNextPage={pagination.nextPage}
96
+ * />
97
+ * </div>
98
+ * </CursorPagination.Root>
99
+ * </div>
100
+ * );
101
+ * }
102
+ * ```
103
+ *
43
104
  * `ref` lands on the inner scroll container, so a consumer can read or set its
44
105
  * scroll position. Every other prop lands on the outer element.
45
106
  *
46
107
  * Data attributes it stamps on the outer element, for your own CSS to target:
47
108
  *
48
- * - `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
49
110
  * container. Always present, so match the value, not the attribute.
50
- * - `data-x-scroll-end="true" | "false"` — whether an overflowing container is
111
+ * - `data-x-scroll-end="true" | "false"`: whether an overflowing container is
51
112
  * scrolled to its right edge. Always present.
52
- * - `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
53
114
  * scrolled to the end. `DataTable`'s pinned action column keys its shadow off
54
115
  * this through `group-data-sticky-active/table:`.
55
116
  *
@@ -448,13 +509,31 @@ declare const Cell: ({ "data-slot": dataSlot, children, className, ref, ...props
448
509
  */
449
510
  declare const Caption: ({ "data-slot": dataSlot, children, className, ref, ...props }: ComponentProps<"caption"> & WithDataSlot) => import("react").JSX.Element;
450
511
  /**
451
- * 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,
452
513
  * simple key/value displays, plain markup tables. The API matches the HTML
453
514
  * `<table>` element 1:1, with no built-in sorting, filtering, or pagination.
454
515
  *
455
516
  * For INTERACTIVE tabular data with sorting / filtering / pagination / row
456
517
  * selection, use `DataTable` (built on TanStack Table) instead.
457
518
  *
519
+ * **Large lists.** Each rendered row costs mount and layout time, so a table
520
+ * that renders every row of a large list blocks input while it mounts:
521
+ * - Paginate a list that can grow past 100 rows, and show 100 rows or fewer on
522
+ * a page. Slice the rows with `useOffsetPagination` and
523
+ * `getOffsetPaginatedSlice`, and compose `CursorPagination` with
524
+ * `PaginationRange` under the table, as the paginated example below shows.
525
+ * - Search and filter the whole list, then paginate the result. Pass the
526
+ * filtered length as `listSize`, so a new filter returns to the first page.
527
+ * - Paginate before you virtualize. A page of 100 rows mounts fast, and the
528
+ * browser's find in page still sees every row on it.
529
+ *
530
+ * @useWhen Show static rows and columns of data, such as a read-only data dump, with no sorting,
531
+ * filtering, or pagination.
532
+ *
533
+ * @siblings
534
+ * - `DataTable`: the user sorts, filters, pages through, or selects the rows.
535
+ * - `DescriptionList`: one record shows as label and value pairs.
536
+ *
458
537
  * @see https://mantle.ngrok.com/components/data-display/table
459
538
  *
460
539
  * @example
package/dist/table.d.ts CHANGED
@@ -1,2 +1,7 @@
1
- import { t as Table } from "./table-vT6Okwfa.js";
1
+ /**
2
+ * Re-exports for the Table component.
3
+ *
4
+ * @see https://mantle.ngrok.com/components/data-display/table
5
+ */
6
+ import { t as Table } from "./table-Ii9hHUWN.js";
2
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
@@ -1,8 +1,13 @@
1
+ /**
2
+ * Re-exports for the Tabs component.
3
+ *
4
+ * @see https://mantle.ngrok.com/components/navigation/tabs
5
+ */
1
6
  import { t as SelfClosingWithAsChild } from "./as-child-DFxX3U2i.js";
2
- import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
3
- import { n as Separator } from "./separator-D9AWEkcJ.js";
7
+ import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
8
+ import { n as Separator } from "./separator-Ck4sPrdN.js";
4
9
  import { ComponentProps } from "react";
5
- import { Content, List, Root, Trigger } from "@radix-ui/react-tabs";
10
+ import { Content as Content$1, List as List$1, Root as Root$1, Trigger as Trigger$1 } from "@radix-ui/react-tabs";
6
11
  /**
7
12
  * Layered sections of content, called tab panels, that show one at a time.
8
13
  * The outermost part; it owns `orientation` and `appearance`. It stamps both as
@@ -46,7 +51,7 @@ import { Content, List, Root, Trigger } from "@radix-ui/react-tabs";
46
51
  * </Tabs.Root>
47
52
  * ```
48
53
  */
49
- declare const Root$1: ({ className, children, "data-slot": dataSlot, onValueChange, orientation, appearance, ...props }: ComponentProps<typeof Root> & WithDataSlot & {
54
+ declare const Root: ({ className, children, "data-slot": dataSlot, onValueChange, orientation, appearance, ...props }: ComponentProps<typeof Root$1> & WithDataSlot & {
50
55
  /**
51
56
  * The appearance of the tabs. Classic appearance shows the tab
52
57
  * list with an underline; pill appearance shows each tab as a pill.
@@ -82,7 +87,7 @@ declare const Root$1: ({ className, children, "data-slot": dataSlot, onValueChan
82
87
  * </Tabs.Root>
83
88
  * ```
84
89
  */
85
- declare const List$1: ({ className, "data-slot": dataSlot, ref, ...props }: ComponentProps<typeof List> & WithDataSlot) => import("react").JSX.Element;
90
+ declare const List: ({ className, "data-slot": dataSlot, ref, ...props }: ComponentProps<typeof List$1> & WithDataSlot) => import("react").JSX.Element;
86
91
  type TabsSeparatorProps = Omit<ComponentProps<typeof Separator>, "asChild" | "children" | "orientation"> & SelfClosingWithAsChild & WithDataSlot;
87
92
  /**
88
93
  * The hairline between the list and the content, in the `separator` color
@@ -129,7 +134,7 @@ type TabsSeparatorProps = Omit<ComponentProps<typeof Separator>, "asChild" | "ch
129
134
  * ```
130
135
  */
131
136
  declare const TabsSeparator: ({ className, "data-slot": dataSlot, ...props }: TabsSeparatorProps) => import("react").JSX.Element;
132
- type TabsTriggerProps = ComponentProps<typeof Trigger> & WithDataSlot;
137
+ type TabsTriggerProps = ComponentProps<typeof Trigger$1> & WithDataSlot;
133
138
  /**
134
139
  * The button that activates its associated content.
135
140
  *
@@ -176,7 +181,7 @@ type TabsTriggerProps = ComponentProps<typeof Trigger> & WithDataSlot;
176
181
  * </Tabs.Root>
177
182
  * ```
178
183
  */
179
- declare const Trigger$1: ({ "aria-disabled": _ariaDisabled, asChild, children, className, "data-slot": dataSlot, disabled: _disabled, onClick, onMouseDown, ref, ...props }: TabsTriggerProps) => import("react").JSX.Element;
184
+ declare const Trigger: ({ "aria-disabled": _ariaDisabled, asChild, children, className, "data-slot": dataSlot, disabled: _disabled, onClick, onMouseDown, ref, ...props }: TabsTriggerProps) => import("react").JSX.Element;
180
185
  /**
181
186
  * A badge to render inside a tab trigger, typically a count or a status indicator.
182
187
  *
@@ -233,10 +238,17 @@ declare const Badge: ({ className, children, "data-slot": dataSlot, ...props }:
233
238
  * </Tabs.Root>
234
239
  * ```
235
240
  */
236
- declare const Content$1: ({ className, "data-slot": dataSlot, ...props }: ComponentProps<typeof Content> & WithDataSlot) => import("react").JSX.Element;
241
+ declare const Content: ({ className, "data-slot": dataSlot, ...props }: ComponentProps<typeof Content$1> & WithDataSlot) => import("react").JSX.Element;
237
242
  /**
238
243
  * Layered sections of content, called tab panels, that show one at a time.
239
244
  *
245
+ * @useWhen Switch between peer views of related content in one place, with one view visible at a
246
+ * time.
247
+ *
248
+ * @siblings
249
+ * - `Accordion`: several sections stack, and each one expands in place.
250
+ * - `RadioGroup`: the user picks a form value, not a view.
251
+ *
240
252
  * @see https://mantle.ngrok.com/components/navigation/tabs
241
253
  *
242
254
  * @example
@@ -302,7 +314,7 @@ declare const Tabs: {
302
314
  * </Tabs.Root>
303
315
  * ```
304
316
  */
305
- readonly Root: typeof Root$1;
317
+ readonly Root: typeof Root;
306
318
  /**
307
319
  * Contains the content associated with each trigger.
308
320
  * It renders when that trigger is active.
@@ -330,7 +342,7 @@ declare const Tabs: {
330
342
  * </Tabs.Root>
331
343
  * ```
332
344
  */
333
- readonly Content: typeof Content$1;
345
+ readonly Content: typeof Content;
334
346
  /**
335
347
  * Contains the triggers that are aligned along the edge of the active content.
336
348
  * The list draws no border of its own: compose `Tabs.Separator` after it for
@@ -356,7 +368,7 @@ declare const Tabs: {
356
368
  * </Tabs.Root>
357
369
  * ```
358
370
  */
359
- readonly List: typeof List$1;
371
+ readonly List: typeof List;
360
372
  /**
361
373
  * The hairline between the list and the content, in the `separator` color
362
374
  * token. Compose it directly after `Tabs.List`. It follows the root's
@@ -426,7 +438,7 @@ declare const Tabs: {
426
438
  * </Tabs.Root>
427
439
  * ```
428
440
  */
429
- readonly Trigger: typeof Trigger$1;
441
+ readonly Trigger: typeof Trigger;
430
442
  /**
431
443
  * A badge to render inside a tab trigger, typically a count or a status indicator.
432
444
  *