@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
package/dist/avatar.d.ts CHANGED
@@ -1,9 +1,14 @@
1
+ /**
2
+ * Re-exports for the Avatar component.
3
+ *
4
+ * @see https://mantle.ngrok.com/components/data-display/avatar
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, ReactEventHandler, ReactNode } from "react";
4
9
  /**
5
10
  * The shape an `Avatar.Root` renders as. Circles read as people, rounded
6
- * squares as the things people belong to — accounts, workspaces, teams,
11
+ * squares as the things people belong to: accounts, workspaces, teams,
7
12
  * organizations. Keeping the two shapes visually distinct is the point: a
8
13
  * switcher row showing both at once stays legible without labels.
9
14
  *
@@ -18,8 +23,8 @@ import { ComponentProps, ReactEventHandler, ReactNode } from "react";
18
23
  */
19
24
  type AvatarAppearance = "circle" | "square";
20
25
  /**
21
- * The props for `Avatar.Root`. A `<span>`'s props — so `className`, `style`,
22
- * `ref`, `asChild`, and any `data-*` or `aria-*` reach the rendered element —
26
+ * The props for `Avatar.Root`. A `<span>`'s props (so `className`, `style`,
27
+ * `ref`, `asChild`, and any `data-*` or `aria-*` reach the rendered element),
23
28
  * plus the shape and swatch this root owns.
24
29
  */
25
30
  type AvatarRootProps = ComponentProps<"span"> & WithAsChild & WithDataSlot & {
@@ -31,7 +36,7 @@ type AvatarRootProps = ComponentProps<"span"> & WithAsChild & WithDataSlot & {
31
36
  */
32
37
  appearance?: AvatarAppearance;
33
38
  /**
34
- * A stable identifier — an account id, a user id — that deterministically
39
+ * A stable identifier (an account id, a user id) that deterministically
35
40
  * selects a background swatch, so the same subject always gets the same
36
41
  * color with nothing persisted. Omit it for a neutral surface, or set your
37
42
  * own `bg-*` class through `className` to opt out entirely.
@@ -43,7 +48,7 @@ type AvatarRootProps = ComponentProps<"span"> & WithAsChild & WithDataSlot & {
43
48
  };
44
49
  /**
45
50
  * A small image representing a person or an account, with a text or icon
46
- * fallback for when there is no picture — or before one loads.
51
+ * fallback for when there is no picture, or before one loads.
47
52
  *
48
53
  * The root sizes and shapes the avatar and paints the surface behind it. It is
49
54
  * `size-7` and `shrink-0` by default: an avatar is a fixed-size visual, and the
@@ -72,9 +77,9 @@ type AvatarRootProps = ComponentProps<"span"> & WithAsChild & WithDataSlot & {
72
77
  */
73
78
  declare const Root: ({ appearance, asChild, className, colorSeed, "data-slot": dataSlot, ...props }: AvatarRootProps) => import("react").JSX.Element;
74
79
  /**
75
- * The props for `Avatar.Image`. An `<img>`'s props — so `srcSet`, `sizes`,
80
+ * The props for `Avatar.Image`. An `<img>`'s props (so `srcSet`, `sizes`,
76
81
  * `loading`, `referrerPolicy`, `crossOrigin`, `className`, `style`, `ref`,
77
- * `asChild`, and any `data-*` reach the element — with `alt` promoted to
82
+ * `asChild`, and any `data-*` reach the element), with `alt` promoted to
78
83
  * required.
79
84
  */
80
85
  type AvatarImageProps = Omit<ComponentProps<"img">, "alt" | "onError"> & WithAsChild & WithDataSlot & {
@@ -83,8 +88,8 @@ type AvatarImageProps = Omit<ComponentProps<"img">, "alt" | "onError"> & WithAsC
83
88
  * `<img>` element: an avatar is the one image a developer reliably forgets,
84
89
  * and an `<img>` with no `alt` announces its URL.
85
90
  *
86
- * Pass `alt=""` when adjacent text already names the subject — the common
87
- * case, and the reason this is not just "always pass the name". Pass the name
91
+ * Pass `alt=""` when adjacent text already names the subject. That is the
92
+ * common case, and the reason this is not just "always pass the name". Pass the name
88
93
  * when the avatar stands alone, and name `Avatar.Root` as well (`role="img"`
89
94
  * + `aria-label`) so the label survives the states where the image is gone.
90
95
  */
@@ -103,14 +108,14 @@ type AvatarImageProps = Omit<ComponentProps<"img">, "alt" | "onError"> & WithAsC
103
108
  * The avatar's picture, layered over `Avatar.Fallback` so the fallback shows
104
109
  * through until the image paints. It is a plain `<img>` in the markup, which is
105
110
  * the whole point: the server renders it, the browser starts fetching while it
106
- * parses the HTML, and a cached image is *there* on the first frame — no
111
+ * parses the HTML, and a cached image is *there* on the first frame: no
107
112
  * hydration, no swap, no flash of initials.
108
113
  *
109
114
  * A failed load unmounts the image and leaves the fallback showing. That covers
110
115
  * every failure the client can observe; one it cannot is a load that fails
111
116
  * *before* hydration, where the error event has already come and gone. There the
112
- * browser's own rendering stands, which for `alt=""` is nothing at all — the
113
- * fallback shows through — and is one more reason to prefer `alt=""`
117
+ * browser's own rendering stands, which for `alt=""` is nothing at all (the
118
+ * fallback shows through), and is one more reason to prefer `alt=""`
114
119
  * whenever adjacent text names the subject.
115
120
  *
116
121
  * `onError` runs first and can `preventDefault()` to keep the image mounted, for
@@ -138,13 +143,13 @@ declare const Image: ({ asChild, className, "data-slot": dataSlot, onError, src,
138
143
  * The props for `Avatar.Fallback`. A `<span>`'s props, with the content stated
139
144
  * exactly one way: either `children` you render yourself, or a `name` this part
140
145
  * derives initials from. Passing both would leave the winner to precedence, so
141
- * the type forbids it — and `asChild`, which needs a real element to clone,
142
- * belongs to the `children` side only.
146
+ * the type forbids it. `asChild`, which needs a real element to clone, belongs
147
+ * to the `children` side only.
143
148
  */
144
149
  type AvatarFallbackProps = Omit<ComponentProps<"span">, "children"> & WithDataSlot & ({
145
150
  /**
146
151
  * Render this element instead of the fallback's own `<span>`. Only
147
- * available beside `children` — there has to be an element to clone.
152
+ * available beside `children`: there has to be an element to clone.
148
153
  */
149
154
  asChild?: boolean;
150
155
  /**
@@ -158,20 +163,20 @@ type AvatarFallbackProps = Omit<ComponentProps<"span">, "children"> & WithDataSl
158
163
  children?: never;
159
164
  /**
160
165
  * The subject's display name, rendered as at most two uppercase
161
- * initials — `"Acme Corp"` becomes `"AC"`, a name with no usable
166
+ * initials: `"Acme Corp"` becomes `"AC"`, and a name with no usable
162
167
  * characters becomes `"?"`. Deriving it here keeps one implementation
163
168
  * of a surprisingly fiddly rule (punctuation, code points, and casing
164
169
  * that has to match between server and client).
165
170
  *
166
171
  * Initials derived this way are `aria-hidden`: they abbreviate a name
167
172
  * the page already carries in text beside the avatar. When the avatar
168
- * is the only thing naming its subject, name it — `role="img"` plus
169
- * `aria-label` on `Avatar.Root` — rather than announcing `"AC"`.
173
+ * is the only thing naming its subject, name it (`role="img"` plus
174
+ * `aria-label` on `Avatar.Root`) rather than announcing `"AC"`.
170
175
  */
171
176
  name: string;
172
177
  });
173
178
  /**
174
- * What the avatar shows when there is no picture — initials, an icon, a
179
+ * What the avatar shows when there is no picture: initials, an icon, a
175
180
  * monogram. It always renders, sitting *behind* `Avatar.Image`: that is what
176
181
  * makes a loading image show initials instead of an empty box, with no loading
177
182
  * state for anyone to handle. A loaded image covers it, so give a transparent
@@ -200,11 +205,11 @@ type AvatarFallbackProps = Omit<ComponentProps<"span">, "children"> & WithDataSl
200
205
  declare const Fallback: ({ asChild, children, className, "data-slot": dataSlot, name, ...props }: AvatarFallbackProps) => import("react").JSX.Element;
201
206
  /**
202
207
  * A small image representing a person or an account, with a text or icon
203
- * fallback for when there is no picture — or before one loads.
208
+ * fallback for when there is no picture, or before one loads.
204
209
  *
205
210
  * `appearance` carries the meaning: `"circle"` for a person, `"square"` (a
206
211
  * rounded square) for an account, workspace, team, or organization. A row that
207
- * shows both — an account switcher with the signed-in user's photo beside it —
212
+ * shows both (an account switcher with the signed-in user's photo beside it)
208
213
  * stays readable without labels because the shapes differ.
209
214
  *
210
215
  * `colorSeed` gives a subject a stable color derived from its id, so the same
@@ -221,6 +226,13 @@ declare const Fallback: ({ asChild, children, className, "data-slot": dataSlot,
221
226
  * For the leading visual of a sidebar switcher row, put it inside
222
227
  * [Sidebar.SwitcherTrigger](https://mantle.ngrok.com/components/navigation/sidebar#sidebarswitchertrigger).
223
228
  *
229
+ * @useWhen Show a small picture of a person or an account, with initials or an icon when there is
230
+ * no picture.
231
+ *
232
+ * @siblings
233
+ * - `MediaObject`: the picture sits beside a title and a description.
234
+ * - `Icon`: the image is a generic symbol, not a person or an account.
235
+ *
224
236
  * @see https://mantle.ngrok.com/components/data-display/avatar
225
237
  *
226
238
  * @example
@@ -242,7 +254,7 @@ declare const Fallback: ({ asChild, children, className, "data-slot": dataSlot,
242
254
  declare const Avatar: {
243
255
  /**
244
256
  * A small image representing a person or an account, with a text or icon
245
- * fallback for when there is no picture — or before one loads.
257
+ * fallback for when there is no picture, or before one loads.
246
258
  *
247
259
  * The root sizes and shapes the avatar and paints the surface behind it. It is
248
260
  * `size-7` and `shrink-0` by default: an avatar is a fixed-size visual, and the
@@ -291,7 +303,7 @@ declare const Avatar: {
291
303
  */
292
304
  readonly Image: typeof Image;
293
305
  /**
294
- * What the avatar shows when there is no picture — initials, an icon, a
306
+ * What the avatar shows when there is no picture: initials, an icon, a
295
307
  * monogram. It always renders, behind `Avatar.Image`, which is what makes a
296
308
  * loading image show initials rather than an empty box. Pass `name` to render
297
309
  * the subject's initials, or `children` for anything else.
package/dist/avatar.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{useState as i}from"react";import{jsx as a}from"react/jsx-runtime";const o={circle:`rounded-full`,square:`rounded-md`},s=[`bg-emerald-500`,`bg-gray-500`,`bg-red-500`,`bg-violet-500`,`bg-cyan-500`,`bg-rose-500`,`bg-purple-500`,`bg-fuchsia-500`,`bg-green-500`,`bg-orange-500`,`bg-indigo-500`,`bg-teal-500`,`bg-yellow-500`,`bg-sky-500`,`bg-pink-500`,`bg-blue-500`,`bg-amber-500`];function c(e){let t=5381;for(let n=0;n<e.length;n+=1)t=t*33^e.charCodeAt(n);return t>>>0}function l(e){let t=c(e)%s.length;return s[t]??`bg-neutral-500`}function u(e){return e.replace(/[\p{P}`~!@#$%^&*+|=<>]/gu,``).trim().split(/\s+/).slice(0,2).map(e=>Array.from(e.toUpperCase())[0]??``).join(``)||`?`}const d={Root:i=>{let s=r(18),c,u,d,f,p,m;s[0]===i?(c=s[1],u=s[2],d=s[3],f=s[4],p=s[5],m=s[6]):({appearance:m,asChild:c,className:u,colorSeed:d,"data-slot":f,...p}=i,s[0]=i,s[1]=c,s[2]=u,s[3]=d,s[4]=f,s[5]=p,s[6]=m);let h=m===void 0?`circle`:m,g=c?n:`span`,_=o[h],v;s[7]!==u||s[8]!==d||s[9]!==_?(v=e(`text-body bg-neutral-500/15 relative flex size-7 shrink-0 items-center justify-center overflow-hidden text-xs font-medium select-none`,_,d!=null&&[`text-static-white`,l(d)],u),s[7]=u,s[8]=d,s[9]=_,s[10]=v):v=s[10];let y;s[11]===f?y=s[12]:(y=t(f,`avatar`),s[11]=f,s[12]=y);let b;return s[13]!==g||s[14]!==p||s[15]!==v||s[16]!==y?(b=/* @__PURE__ */ a(g,{className:v,"data-slot":y,...p}),s[13]=g,s[14]=p,s[15]=v,s[16]=y,s[17]=b):b=s[17],b},Image:o=>{let s=r(21),c,l,u,d,f,p;s[0]===o?(c=s[1],l=s[2],u=s[3],d=s[4],f=s[5],p=s[6]):({asChild:c,className:l,"data-slot":u,onError:d,src:p,...f}=o,s[0]=o,s[1]=c,s[2]=l,s[3]=u,s[4]=d,s[5]=f,s[6]=p);let[m,h]=i(),g=c?n:`img`;if(p==null||p===``||p===m)return null;let _;s[7]===l?_=s[8]:(_=e(`absolute inset-0 size-full object-cover`,l),s[7]=l,s[8]=_);let v;s[9]===u?v=s[10]:(v=t(u,`avatar-image`),s[9]=u,s[10]=v);let y;s[11]!==d||s[12]!==p?(y=e=>{d?.(e),e.defaultPrevented||h(p)},s[11]=d,s[12]=p,s[13]=y):y=s[13];let b;return s[14]!==g||s[15]!==f||s[16]!==p||s[17]!==_||s[18]!==v||s[19]!==y?(b=/* @__PURE__ */ a(g,{className:_,"data-slot":v,onError:y,src:p,...f}),s[14]=g,s[15]=f,s[16]=p,s[17]=_,s[18]=v,s[19]=y,s[20]=b):b=s[20],b},Fallback:i=>{let o=r(21),s,c,l,d,f,p;o[0]===i?(s=o[1],c=o[2],l=o[3],d=o[4],f=o[5],p=o[6]):({asChild:s,children:c,className:l,"data-slot":d,name:f,...p}=i,o[0]=i,o[1]=s,o[2]=c,o[3]=l,o[4]=d,o[5]=f,o[6]=p);let m=s?n:`span`,h=f!=null||void 0,g;o[7]===l?g=o[8]:(g=e(`flex size-full items-center justify-center`,l),o[7]=l,o[8]=g);let _;o[9]===d?_=o[10]:(_=t(d,`avatar-fallback`),o[9]=d,o[10]=_);let v;o[11]!==c||o[12]!==f?(v=f==null?c:u(f),o[11]=c,o[12]=f,o[13]=v):v=o[13];let y;return o[14]!==m||o[15]!==p||o[16]!==h||o[17]!==g||o[18]!==_||o[19]!==v?(y=/* @__PURE__ */ a(m,{"aria-hidden":h,className:g,"data-slot":_,...p,children:v}),o[14]=m,o[15]=p,o[16]=h,o[17]=g,o[18]=_,o[19]=v,o[20]=y):y=o[20],y}};export{d as Avatar};
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{useState as i}from"react";import{jsx as a}from"react/jsx-runtime";const o={circle:`rounded-full`,square:`rounded-md`},s=[`bg-emerald-500`,`bg-gray-500`,`bg-red-500`,`bg-violet-500`,`bg-cyan-500`,`bg-rose-500`,`bg-purple-500`,`bg-fuchsia-500`,`bg-green-500`,`bg-orange-500`,`bg-indigo-500`,`bg-teal-500`,`bg-yellow-500`,`bg-sky-500`,`bg-pink-500`,`bg-blue-500`,`bg-amber-500`];function c(e){let t=5381;for(let n=0;n<e.length;n+=1)t=t*33^e.charCodeAt(n);return t>>>0}function l(e){let t=c(e)%s.length;return s[t]??`bg-neutral-500`}function u(e){return e.replace(/[\p{P}`~!@#$%^&*+|=<>]/gu,``).trim().split(/\s+/).slice(0,2).map(e=>Array.from(e.toUpperCase())[0]??``).join(``)||`?`}const d={Root:i=>{let s=r(18),c,u,d,f,p,m;s[0]===i?(c=s[1],u=s[2],d=s[3],f=s[4],p=s[5],m=s[6]):({appearance:m,asChild:c,className:u,colorSeed:d,"data-slot":f,...p}=i,s[0]=i,s[1]=c,s[2]=u,s[3]=d,s[4]=f,s[5]=p,s[6]=m);let h=m===void 0?`circle`:m,g=c?n:`span`,_=o[h],v;s[7]!==u||s[8]!==d||s[9]!==_?(v=e(`text-body bg-neutral-500/15 relative flex size-7 shrink-0 items-center justify-center overflow-hidden text-xs font-medium select-none`,_,d!=null&&[`text-static-white`,l(d)],u),s[7]=u,s[8]=d,s[9]=_,s[10]=v):v=s[10];let y;s[11]===f?y=s[12]:(y=t(f,`avatar`),s[11]=f,s[12]=y);let b;return s[13]!==g||s[14]!==p||s[15]!==v||s[16]!==y?(b=/* @__PURE__ */ a(g,{className:v,"data-slot":y,...p}),s[13]=g,s[14]=p,s[15]=v,s[16]=y,s[17]=b):b=s[17],b},Image:o=>{let s=r(21),c,l,u,d,f,p;s[0]===o?(c=s[1],l=s[2],u=s[3],d=s[4],f=s[5],p=s[6]):({asChild:c,className:l,"data-slot":u,onError:d,src:p,...f}=o,s[0]=o,s[1]=c,s[2]=l,s[3]=u,s[4]=d,s[5]=f,s[6]=p);let[m,h]=i(),g=c?n:`img`;if(p==null||p===``||p===m)return null;let _;s[7]===l?_=s[8]:(_=e(`absolute inset-0 size-full object-cover`,l),s[7]=l,s[8]=_);let v;s[9]===u?v=s[10]:(v=t(u,`avatar-image`),s[9]=u,s[10]=v);let y;s[11]!==d||s[12]!==p?(y=e=>{d?.(e),e.defaultPrevented||h(p)},s[11]=d,s[12]=p,s[13]=y):y=s[13];let b;return s[14]!==g||s[15]!==f||s[16]!==p||s[17]!==_||s[18]!==v||s[19]!==y?(b=/* @__PURE__ */ a(g,{className:_,"data-slot":v,onError:y,src:p,...f}),s[14]=g,s[15]=f,s[16]=p,s[17]=_,s[18]=v,s[19]=y,s[20]=b):b=s[20],b},Fallback:i=>{let o=r(21),s,c,l,d,f,p;o[0]===i?(s=o[1],c=o[2],l=o[3],d=o[4],f=o[5],p=o[6]):({asChild:s,children:c,className:l,"data-slot":d,name:f,...p}=i,o[0]=i,o[1]=s,o[2]=c,o[3]=l,o[4]=d,o[5]=f,o[6]=p);let m=s?n:`span`,h=f!=null||void 0,g;o[7]===l?g=o[8]:(g=e(`flex size-full items-center justify-center`,l),o[7]=l,o[8]=g);let _;o[9]===d?_=o[10]:(_=t(d,`avatar-fallback`),o[9]=d,o[10]=_);let v;o[11]!==c||o[12]!==f?(v=f==null?c:u(f),o[11]=c,o[12]=f,o[13]=v):v=o[13];let y;return o[14]!==m||o[15]!==p||o[16]!==h||o[17]!==g||o[18]!==_||o[19]!==v?(y=/* @__PURE__ */ a(m,{"aria-hidden":h,className:g,"data-slot":_,...p,children:v}),o[14]=m,o[15]=p,o[16]=h,o[17]=g,o[18]=_,o[19]=v,o[20]=y):y=o[20],y}};export{d as Avatar};
package/dist/badge.d.ts CHANGED
@@ -1,6 +1,11 @@
1
+ /**
2
+ * Re-exports for the Badge component.
3
+ *
4
+ * @see https://mantle.ngrok.com/components/data-display/badge
5
+ */
1
6
  import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
2
- import { t as WithDataSlot } from "./data-slot-B-LqAcBB.js";
3
7
  import { t as Color } from "./index-BZhHLrBi.js";
8
+ import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
4
9
  import { ComponentProps, ReactNode } from "react";
5
10
  declare const appearances: readonly ["muted"];
6
11
  type Appearance = (typeof appearances)[number];
@@ -21,8 +26,8 @@ type BadgeProps = ComponentProps<"span"> & WithAsChild & {
21
26
  appearance: Appearance;
22
27
  } & WithDataSlot;
23
28
  /**
24
- * A non-interactive label used to highlight short, scannable information —
25
- * a status, a category tag, or a count — in the smallest possible footprint.
29
+ * A non-interactive label used to highlight short, scannable information
30
+ * (a status, a category tag, or a count) in the smallest possible footprint.
26
31
  *
27
32
  * **When to use**
28
33
  * - Status indicators: `Succeeded`, `Failed`, `Pending`, `Beta`.
@@ -30,7 +35,7 @@ type BadgeProps = ComponentProps<"span"> & WithAsChild & {
30
35
  * - Counts (e.g. `12 new`) when paired with brief context.
31
36
  *
32
37
  * **When not to use**
33
- * - For interactive UI. Badges are not buttons or links — use {@link https://mantle.ngrok.com/components/actions/button Button}
38
+ * - For interactive UI. Badges are not buttons or links. Use {@link https://mantle.ngrok.com/components/actions/button Button}
34
39
  * or {@link https://mantle.ngrok.com/components/navigation/anchor Anchor} (optionally with `asChild` styling) instead.
35
40
  * - For long-form text. Keep labels to one or two short words.
36
41
  * - As the sole signal of meaning. Pair color with a label or icon so the
@@ -42,12 +47,12 @@ type BadgeProps = ComponentProps<"span"> & WithAsChild & {
42
47
  * isn't already covered.
43
48
  *
44
49
  * **Polymorphism.** Pass `asChild` to render the badge as a single child
45
- * element — useful when the badge wraps a link or other semantic element
50
+ * element. This is useful when the badge wraps a link or other semantic element
46
51
  * while keeping the badge styling.
47
52
  *
48
53
  * **Structure.** `children` render inside a `<span data-slot="badge-label">`,
49
54
  * beside the `icon` slot. The span carries `display: contents`, so it lays out
50
- * nothing of its own — every child stays a flex item of the badge, and the badge's
55
+ * nothing of its own: every child stays a flex item of the badge, and the badge's
51
56
  * `gap` still falls between them. The span exists so a newly-appearing icon
52
57
  * inserts before an element sibling: a browser translation engine reparents text
53
58
  * nodes, and an insert aimed at one throws. A label that must shrink stays a child
@@ -57,6 +62,13 @@ type BadgeProps = ComponentProps<"span"> & WithAsChild & {
57
62
  * | -------------- | --------------- | -------------------------------------------------------------------------------------------- |
58
63
  * | `data-slot` | `"badge-label"` | On the `<span>` wrapping `children`. `display: contents`, so it changes no layout by itself. |
59
64
  *
65
+ * @useWhen Label an item with a short status, a category tag, or a count.
66
+ *
67
+ * @siblings
68
+ * - `Button`: the label must respond to a click.
69
+ * - `Kbd`: the label is a keyboard key or a shortcut.
70
+ * - `MultiSelect`: the tags are values that the user picks and removes.
71
+ *
60
72
  * @see https://mantle.ngrok.com/components/data-display/badge
61
73
  *
62
74
  * @example
@@ -68,7 +80,7 @@ type BadgeProps = ComponentProps<"span"> & WithAsChild & {
68
80
  * Succeeded
69
81
  * </Badge>
70
82
  *
71
- * // Polymorphic — render the badge as a link, preserving its styling.
83
+ * // Polymorphic: render the badge as a link, preserving its styling.
72
84
  * <Badge appearance="muted" color="info" asChild>
73
85
  * <a href="/status">Operational</a>
74
86
  * </Badge>
package/dist/badge.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-BudQMD2S.js";import{t as r}from"./slot-DdYN1L1C.js";import{c as i}from"react/compiler-runtime";import{Children as a,cloneElement as o,isValidElement as s}from"react";import c from"tiny-invariant";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";const f=f=>{let p=i(46),h,_,v,y,b,x,S,C;p[0]===f?(h=p[1],_=p[2],v=p[3],y=p[4],b=p[5],x=p[6],S=p[7],C=p[8]):({"data-slot":y,appearance:h,asChild:S,children:_,className:v,color:C,icon:b,...x}=f,p[0]=f,p[1]=h,p[2]=_,p[3]=v,p[4]=y,p[5]=b,p[6]=x,p[7]=S,p[8]=C);let w=S!==void 0&&S,T=C===void 0?`neutral`:C,E;if(p[9]!==h||p[10]!==v||p[11]!==T||p[12]!==b){let t=m(T,h),n=g(T,h);E=e(`inline-flex w-fit shrink-0 cursor-default items-center gap-1 rounded px-1.5 py-0.5 font-medium text-xs font-sans`,b&&`ps-1`,t,n,v),p[9]=h,p[10]=v,p[11]=T,p[12]=b,p[13]=E}else E=p[13];let D=E;if(w){let e,i,f,m,h;if(p[14]!==D||p[15]!==_||p[16]!==y||p[17]!==b||p[18]!==x){let g=a.only(_);c(s(g),"When using `asChild`, Badge must be passed a single child as a JSX tag.");let v=g.props?.children;e=r,p[24]===y?i=p[25]:(i=t(y,`badge`),p[24]=y,p[25]=i),f=D,m=x;let S;p[26]===b?S=p[27]:(S=b&&/* @__PURE__ */ u(n,{className:`size-4`,svg:b}),p[26]=b,p[27]=S),h=o(g,{},/* @__PURE__ */ d(l,{children:[S,/* @__PURE__ */ u(`span`,{"data-slot":`badge-label`,className:`contents`,children:v})]})),p[14]=D,p[15]=_,p[16]=y,p[17]=b,p[18]=x,p[19]=e,p[20]=i,p[21]=f,p[22]=m,p[23]=h}else e=p[19],i=p[20],f=p[21],m=p[22],h=p[23];let g;return p[28]!==e||p[29]!==i||p[30]!==f||p[31]!==m||p[32]!==h?(g=/* @__PURE__ */ u(e,{"data-slot":i,className:f,...m,children:h}),p[28]=e,p[29]=i,p[30]=f,p[31]=m,p[32]=h,p[33]=g):g=p[33],g}let O;p[34]===y?O=p[35]:(O=t(y,`badge`),p[34]=y,p[35]=O);let k;p[36]===b?k=p[37]:(k=b&&/* @__PURE__ */ u(n,{className:`size-4`,svg:b}),p[36]=b,p[37]=k);let A;p[38]===_?A=p[39]:(A=/* @__PURE__ */ u(`span`,{"data-slot":`badge-label`,className:`contents`,children:_}),p[38]=_,p[39]=A);let j;return p[40]!==D||p[41]!==x||p[42]!==O||p[43]!==k||p[44]!==A?(j=/* @__PURE__ */ d(`span`,{"data-slot":O,className:D,...x,children:[k,A]}),p[40]=D,p[41]=x,p[42]=O,p[43]=k,p[44]=A,p[45]=j):j=p[45],j},p={amber:`bg-amber-500/20`,blue:`bg-blue-500/20`,cyan:`bg-cyan-500/20`,emerald:`bg-emerald-500/20`,fuchsia:`bg-fuchsia-500/20`,gray:`bg-gray-500/20`,green:`bg-green-500/20`,indigo:`bg-indigo-500/20`,lime:`bg-lime-500/20`,orange:`bg-orange-500/20`,pink:`bg-pink-500/20`,purple:`bg-purple-500/20`,red:`bg-red-500/20`,rose:`bg-rose-500/20`,sky:`bg-sky-500/20`,teal:`bg-teal-500/20`,violet:`bg-violet-500/20`,yellow:`bg-yellow-500/20`,accent:`bg-accent-500/20`,danger:`bg-danger-500/20`,important:`bg-important-500/20`,info:`bg-info-500/20`,neutral:`bg-neutral-500/20`,success:`bg-success-500/20`,warning:`bg-warning-500/20`};function m(e,t){switch(t){case`muted`:return p[e];default:c(!1,`Invalid appearance: ${String(t)}`)}}const h={amber:`text-amber-700`,blue:`text-blue-700`,cyan:`text-cyan-700`,emerald:`text-emerald-700`,fuchsia:`text-fuchsia-700`,gray:`text-gray-700`,green:`text-green-700`,indigo:`text-indigo-700`,lime:`text-lime-700`,orange:`text-orange-700`,pink:`text-pink-700`,purple:`text-purple-700`,red:`text-red-700`,rose:`text-rose-700`,sky:`text-sky-700`,teal:`text-teal-700`,violet:`text-violet-700`,yellow:`text-yellow-700`,accent:`text-accent-700`,danger:`text-danger-700`,important:`text-important-700`,info:`text-info-700`,neutral:`text-neutral-700`,success:`text-success-700`,warning:`text-warning-700`};function g(e,t){switch(t){case`muted`:return h[e];default:c(!1,`Invalid appearance: ${String(t)}`)}}export{f as Badge};
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-BudQMD2S.js";import{t as r}from"./slot-B7rwscwd.js";import{c as i}from"react/compiler-runtime";import{Children as a,cloneElement as o,isValidElement as s}from"react";import c from"tiny-invariant";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";const f=f=>{let p=i(46),h,_,v,y,b,x,S,C;p[0]===f?(h=p[1],_=p[2],v=p[3],y=p[4],b=p[5],x=p[6],S=p[7],C=p[8]):({"data-slot":y,appearance:h,asChild:S,children:_,className:v,color:C,icon:b,...x}=f,p[0]=f,p[1]=h,p[2]=_,p[3]=v,p[4]=y,p[5]=b,p[6]=x,p[7]=S,p[8]=C);let w=S!==void 0&&S,T=C===void 0?`neutral`:C,E;if(p[9]!==h||p[10]!==v||p[11]!==T||p[12]!==b){let t=m(T,h),n=g(T,h);E=e(`inline-flex w-fit shrink-0 cursor-default items-center gap-1 rounded px-1.5 py-0.5 font-medium text-xs font-sans`,b&&`ps-1`,t,n,v),p[9]=h,p[10]=v,p[11]=T,p[12]=b,p[13]=E}else E=p[13];let D=E;if(w){let e,i,f,m,h;if(p[14]!==D||p[15]!==_||p[16]!==y||p[17]!==b||p[18]!==x){let g=a.only(_);c(s(g),"When using `asChild`, Badge must be passed a single child as a JSX tag.");let v=g.props?.children;e=r,p[24]===y?i=p[25]:(i=t(y,`badge`),p[24]=y,p[25]=i),f=D,m=x;let S;p[26]===b?S=p[27]:(S=b&&/* @__PURE__ */ u(n,{className:`size-4`,svg:b}),p[26]=b,p[27]=S),h=o(g,{},/* @__PURE__ */ d(l,{children:[S,/* @__PURE__ */ u(`span`,{"data-slot":`badge-label`,className:`contents`,children:v})]})),p[14]=D,p[15]=_,p[16]=y,p[17]=b,p[18]=x,p[19]=e,p[20]=i,p[21]=f,p[22]=m,p[23]=h}else e=p[19],i=p[20],f=p[21],m=p[22],h=p[23];let g;return p[28]!==e||p[29]!==i||p[30]!==f||p[31]!==m||p[32]!==h?(g=/* @__PURE__ */ u(e,{"data-slot":i,className:f,...m,children:h}),p[28]=e,p[29]=i,p[30]=f,p[31]=m,p[32]=h,p[33]=g):g=p[33],g}let O;p[34]===y?O=p[35]:(O=t(y,`badge`),p[34]=y,p[35]=O);let k;p[36]===b?k=p[37]:(k=b&&/* @__PURE__ */ u(n,{className:`size-4`,svg:b}),p[36]=b,p[37]=k);let A;p[38]===_?A=p[39]:(A=/* @__PURE__ */ u(`span`,{"data-slot":`badge-label`,className:`contents`,children:_}),p[38]=_,p[39]=A);let j;return p[40]!==D||p[41]!==x||p[42]!==O||p[43]!==k||p[44]!==A?(j=/* @__PURE__ */ d(`span`,{"data-slot":O,className:D,...x,children:[k,A]}),p[40]=D,p[41]=x,p[42]=O,p[43]=k,p[44]=A,p[45]=j):j=p[45],j},p={amber:`bg-amber-500/20`,blue:`bg-blue-500/20`,cyan:`bg-cyan-500/20`,emerald:`bg-emerald-500/20`,fuchsia:`bg-fuchsia-500/20`,gray:`bg-gray-500/20`,green:`bg-green-500/20`,indigo:`bg-indigo-500/20`,lime:`bg-lime-500/20`,orange:`bg-orange-500/20`,pink:`bg-pink-500/20`,purple:`bg-purple-500/20`,red:`bg-red-500/20`,rose:`bg-rose-500/20`,sky:`bg-sky-500/20`,teal:`bg-teal-500/20`,violet:`bg-violet-500/20`,yellow:`bg-yellow-500/20`,accent:`bg-accent-500/20`,danger:`bg-danger-500/20`,important:`bg-important-500/20`,info:`bg-info-500/20`,neutral:`bg-neutral-500/20`,success:`bg-success-500/20`,warning:`bg-warning-500/20`};function m(e,t){switch(t){case`muted`:return p[e];default:c(!1,`Invalid appearance: ${String(t)}`)}}const h={amber:`text-amber-700`,blue:`text-blue-700`,cyan:`text-cyan-700`,emerald:`text-emerald-700`,fuchsia:`text-fuchsia-700`,gray:`text-gray-700`,green:`text-green-700`,indigo:`text-indigo-700`,lime:`text-lime-700`,orange:`text-orange-700`,pink:`text-pink-700`,purple:`text-purple-700`,red:`text-red-700`,rose:`text-rose-700`,sky:`text-sky-700`,teal:`text-teal-700`,violet:`text-violet-700`,yellow:`text-yellow-700`,accent:`text-accent-700`,danger:`text-danger-700`,important:`text-important-700`,info:`text-info-700`,neutral:`text-neutral-700`,success:`text-success-700`,warning:`text-warning-700`};function g(e,t){switch(t){case`muted`:return h[e];default:c(!1,`Invalid appearance: ${String(t)}`)}}export{f as Badge};