@ngrok/mantle 0.79.3 → 0.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/dist/accordion.d.ts +158 -19
  2. package/dist/accordion.js +1 -1
  3. package/dist/agent.json +5 -1
  4. package/dist/alert-dialog.d.ts +465 -32
  5. package/dist/alert-dialog.js +1 -1
  6. package/dist/alert.d.ts +116 -14
  7. package/dist/alert.js +1 -1
  8. package/dist/anchor-DfeXTpKW.js +1 -0
  9. package/dist/anchor.d.ts +2 -2
  10. package/dist/anchor.js +1 -1
  11. package/dist/area-chart.d.ts +504 -0
  12. package/dist/area-chart.js +1 -0
  13. package/dist/as-child-D23mGo4f.d.ts +49 -0
  14. package/dist/badge.d.ts +44 -5
  15. package/dist/badge.js +1 -1
  16. package/dist/bar-chart.d.ts +491 -0
  17. package/dist/bar-chart.js +1 -0
  18. package/dist/breadcrumb.d.ts +196 -14
  19. package/dist/breadcrumb.js +1 -1
  20. package/dist/button-BAno7KIU.js +1 -0
  21. package/dist/{index-BSAizFod.d.ts → button-C-gMbPso.d.ts} +5 -5
  22. package/dist/{icon-button-BvQvT790.d.ts → button-C7vAl6lS.d.ts} +22 -63
  23. package/dist/button-D9n09xUg.js +1 -0
  24. package/dist/{button-DcXOWUYo.d.ts → button-DARFK2KJ.d.ts} +4 -4
  25. package/dist/button-DjpEKt2X.js +1 -0
  26. package/dist/button-DvHMWAPl.js +1 -0
  27. package/dist/button.d.ts +5 -5
  28. package/dist/button.js +1 -1
  29. package/dist/calendar.d.ts +0 -3
  30. package/dist/calendar.js +1 -1
  31. package/dist/card.d.ts +131 -9
  32. package/dist/card.js +1 -1
  33. package/dist/centered-layout.d.ts +209 -8
  34. package/dist/centered-layout.js +1 -1
  35. package/dist/chart-BROa2gqt.js +2 -0
  36. package/dist/chart-BcOC6Qj0.d.ts +275 -0
  37. package/dist/checkbox-0EoxOyMA.js +1 -0
  38. package/dist/checkbox.d.ts +13 -11
  39. package/dist/checkbox.js +1 -1
  40. package/dist/choice-BHwFSSyv.js +1 -0
  41. package/dist/choice-BNRQXszu.d.ts +254 -0
  42. package/dist/choice.d.ts +1 -252
  43. package/dist/choice.js +1 -1
  44. package/dist/code-block.d.ts +242 -52
  45. package/dist/code-block.js +6 -6
  46. package/dist/code-block_highlight-utils.d.ts +1 -1
  47. package/dist/code-block_highlight-utils.js +1 -1
  48. package/dist/code.d.ts +3 -2
  49. package/dist/code.js +1 -1
  50. package/dist/combobox.d.ts +171 -16
  51. package/dist/combobox.js +1 -1
  52. package/dist/command.d.ts +279 -81
  53. package/dist/command.js +1 -1
  54. package/dist/compose-refs-BdBMM9ga.js +1 -0
  55. package/dist/data-table.d.ts +28 -6
  56. package/dist/data-table.js +1 -1
  57. package/dist/description-list.d.ts +67 -6
  58. package/dist/description-list.js +1 -1
  59. package/dist/dialog-BM4wPCft.d.ts +24 -0
  60. package/dist/dialog-DWZWd5Jt.js +1 -0
  61. package/dist/dialog.d.ts +226 -35
  62. package/dist/dialog.js +1 -1
  63. package/dist/{dropdown-menu-DP_Ne9Mr.d.ts → dropdown-menu-DZg-Cd69.d.ts} +137 -32
  64. package/dist/dropdown-menu-Dw-OtXPm.d.ts +1 -0
  65. package/dist/dropdown-menu-RyDWoKHx.js +1 -0
  66. package/dist/dropdown-menu.d.ts +2 -2
  67. package/dist/dropdown-menu.js +1 -1
  68. package/dist/empty.d.ts +7 -22
  69. package/dist/empty.js +1 -1
  70. package/dist/field-B1wqeZr4.js +1 -0
  71. package/dist/field.d.ts +568 -47
  72. package/dist/field.js +1 -1
  73. package/dist/flag.d.ts +0 -3
  74. package/dist/flag.js +1 -1
  75. package/dist/hooks.d.ts +3 -4
  76. package/dist/hooks.js +1 -1
  77. package/dist/hover-card.d.ts +48 -7
  78. package/dist/hover-card.js +1 -1
  79. package/dist/{svg-only-BFeFS1aa.d.ts → icon-CX_gj6sW.d.ts} +2 -2
  80. package/dist/icon-d-nMCfAI.js +1 -0
  81. package/dist/{icon-Cevjo93X.d.ts → icon-k4E9yNWD.d.ts} +2 -2
  82. package/dist/icon-lZ48P8Nn.js +1 -0
  83. package/dist/icon.d.ts +3 -3
  84. package/dist/icon.js +1 -1
  85. package/dist/{sort-BPX2Fk9t.js → icons-B_DDQcVD.js} +1 -1
  86. package/dist/{traffic-policy-file-0g5RXFqu.js → icons-CF1lbWtp.js} +1 -1
  87. package/dist/icons-DLCs1hLP.js +1 -0
  88. package/dist/icons.d.ts +7 -15
  89. package/dist/icons.js +1 -1
  90. package/dist/{in-view-nkSOdED2.d.ts → in-view-DDEGUKDR.d.ts} +17 -9
  91. package/dist/{index-D47aqlpz.d.ts → index-DA4ig3gj.d.ts} +1 -1
  92. package/dist/input-BnlpQF0c.js +1 -0
  93. package/dist/{types-C19IR7jf.d.ts → input-BuYDU6CF.d.ts} +42 -2
  94. package/dist/input.d.ts +5 -56
  95. package/dist/input.js +1 -1
  96. package/dist/{label-v2-bv98k.d.ts → label-C6YH9skg.d.ts} +8 -6
  97. package/dist/label-D-D11mlp.js +1 -0
  98. package/dist/label.d.ts +1 -1
  99. package/dist/label.js +1 -1
  100. package/dist/line-chart.d.ts +490 -0
  101. package/dist/line-chart.js +1 -0
  102. package/dist/list-51KQvENW.js +1 -0
  103. package/dist/list.d.ts +135 -6
  104. package/dist/list.js +1 -1
  105. package/dist/llms.txt +5 -1
  106. package/dist/main.d.ts +20 -4
  107. package/dist/main.js +1 -1
  108. package/dist/mantle-dark-high-contrast.css +17 -0
  109. package/dist/mantle-dark.css +13 -0
  110. package/dist/mantle-light-high-contrast.css +15 -0
  111. package/dist/mantle.css +29 -0
  112. package/dist/media-object.d.ts +18 -4
  113. package/dist/media-object.js +1 -1
  114. package/dist/multi-select.d.ts +282 -24
  115. package/dist/multi-select.js +1 -1
  116. package/dist/otp-input.d.ts +118 -6
  117. package/dist/otp-input.js +1 -1
  118. package/dist/pagination.d.ts +61 -6
  119. package/dist/pagination.js +1 -1
  120. package/dist/popover-CE4OlWkd.d.ts +208 -0
  121. package/dist/popover-CQ9s7jG5.js +1 -0
  122. package/dist/popover.d.ts +1 -181
  123. package/dist/popover.js +1 -1
  124. package/dist/primitive-trJDqIXJ.js +1 -0
  125. package/dist/progress.d.ts +2 -8
  126. package/dist/progress.js +1 -1
  127. package/dist/qr-code.d.ts +101 -5
  128. package/dist/qr-code.js +1 -1
  129. package/dist/radio-group.d.ts +110 -35
  130. package/dist/radio-group.js +1 -1
  131. package/dist/sandboxed-on-click.d.ts +2 -2
  132. package/dist/sandboxed-on-click.js +1 -1
  133. package/dist/scatter-plot.d.ts +495 -0
  134. package/dist/scatter-plot.js +1 -0
  135. package/dist/select-0z7HVS6r.d.ts +579 -0
  136. package/dist/select-BCHWvmyC.js +1 -0
  137. package/dist/select.d.ts +1 -1
  138. package/dist/select.js +1 -1
  139. package/dist/selectable-list.d.ts +225 -298
  140. package/dist/selectable-list.js +1 -1
  141. package/dist/separator-B5UmkVRL.d.ts +75 -0
  142. package/dist/separator-bpE_kooz.js +1 -0
  143. package/dist/separator.d.ts +1 -52
  144. package/dist/separator.js +1 -1
  145. package/dist/sheet.d.ts +285 -38
  146. package/dist/sheet.js +1 -1
  147. package/dist/skeleton-CsbUHbBA.js +1 -0
  148. package/dist/skeleton.d.ts +4 -7
  149. package/dist/skeleton.js +1 -1
  150. package/dist/skip-to-main-link.d.ts +24 -4
  151. package/dist/skip-to-main-link.js +1 -1
  152. package/dist/slider.js +1 -1
  153. package/dist/{index-Rv8RL7xy.d.ts → slot-BtwKJTLq.d.ts} +1 -1
  154. package/dist/slot-CDk0Bb9z.js +1 -0
  155. package/dist/slot.d.ts +1 -1
  156. package/dist/slot.js +1 -1
  157. package/dist/split-button.d.ts +14 -14
  158. package/dist/split-button.js +1 -1
  159. package/dist/switch.d.ts +10 -7
  160. package/dist/switch.js +1 -1
  161. package/dist/table-Bo0vNxIJ.d.ts +848 -0
  162. package/dist/table-CGxJwtbL.js +1 -0
  163. package/dist/table.d.ts +1 -1
  164. package/dist/table.js +1 -1
  165. package/dist/tabs.d.ts +124 -25
  166. package/dist/tabs.js +1 -1
  167. package/dist/text-area.d.ts +2 -2
  168. package/dist/text-area.js +1 -1
  169. package/dist/theme-C26-Xolp.js +1 -0
  170. package/dist/theme-switcher.d.ts +105 -33
  171. package/dist/theme-switcher.js +1 -1
  172. package/dist/theme.d.ts +54 -15
  173. package/dist/theme.js +1 -1
  174. package/dist/toast.d.ts +86 -10
  175. package/dist/toast.js +1 -1
  176. package/dist/tooltip.d.ts +50 -5
  177. package/dist/tooltip.js +1 -1
  178. package/dist/types.d.ts +2 -2
  179. package/dist/utils.d.ts +1 -1
  180. package/dist/utils.js +1 -1
  181. package/dist/well.d.ts +3 -3
  182. package/dist/well.js +1 -1
  183. package/package.json +9 -3
  184. package/dist/anchor-C_tjSVy6.js +0 -1
  185. package/dist/as-child-CYEVu1WY.d.ts +0 -23
  186. package/dist/button-5t6-JS_I.js +0 -1
  187. package/dist/button-ClC60Nzg.js +0 -1
  188. package/dist/checkbox-DJ2xl7Rc.js +0 -1
  189. package/dist/choice-DOdyNzFC.js +0 -1
  190. package/dist/compose-refs-Cjf2gfB8.js +0 -1
  191. package/dist/dialog-vxLIvB8M.js +0 -1
  192. package/dist/dropdown-menu-Bt1aKF1g.js +0 -1
  193. package/dist/field-context-BR01g789.js +0 -1
  194. package/dist/icon-CDtYjF_H.js +0 -1
  195. package/dist/icon-button-DV2-GZHf.js +0 -1
  196. package/dist/index-g2rfwNCH.d.ts +0 -1
  197. package/dist/input-Ct1YOqSy.js +0 -1
  198. package/dist/label-BMlHW_2D.js +0 -1
  199. package/dist/popover-D5WxxnBY.js +0 -1
  200. package/dist/primitive-C64-m48O.d.ts +0 -13
  201. package/dist/primitive-IKruV2iB.js +0 -1
  202. package/dist/select-Bwt2YduR.d.ts +0 -345
  203. package/dist/select-D-5u0Blc.js +0 -1
  204. package/dist/separator-kBnnv3Cw.js +0 -1
  205. package/dist/skeleton-Bu3tgNcW.js +0 -1
  206. package/dist/slot-DmPrjM7N.js +0 -1
  207. package/dist/svg-only-DDx6FtJd.js +0 -1
  208. package/dist/table-CPH2md2-.js +0 -1
  209. package/dist/table-CwFHXC-G.d.ts +0 -414
  210. package/dist/theme-D3MDng6U.js +0 -1
  211. package/dist/theme-provider-C9zpDyJW.js +0 -1
  212. package/dist/toast-BsCjaMVS.js +0 -1
  213. package/dist/virtual-DZMBu7Ch.js +0 -1
  214. /package/dist/{sizes-BCoI4bhP.d.ts → button-BCoI4bhP.d.ts} +0 -0
  215. /package/dist/{intents-DdSKSj1c.d.ts → button-DdSKSj1c.d.ts} +0 -0
  216. /package/dist/{resolve-pre-rendered-props-B6OlZrSI.d.ts → code-block-B6OlZrSI.d.ts} +0 -0
  217. /package/dist/{resolve-pre-rendered-props-C9uaM9-V.js → code-block-C9uaM9-V.js} +0 -0
  218. /package/dist/{validation-7QeiTFwl.d.ts → field-7QeiTFwl.d.ts} +0 -0
  219. /package/dist/{validation-Bpptk_9t.js → field-Bpptk_9t.js} +0 -0
  220. /package/dist/{types-D1RY5Tcj.d.ts → icon-D1RY5Tcj.d.ts} +0 -0
  221. /package/dist/{is-input-CXmS0OFN.js → input-CXmS0OFN.js} +0 -0
  222. /package/dist/{themes-CYNpplwN.d.ts → theme-CYNpplwN.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ import{t as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./cx-IiQEAKf5.js";import{useLayoutEffect as n,useMemo as r,useRef as i,useState as a}from"react";import{jsx as o}from"react/jsx-runtime";const s={Body:({children:e,className:n,ref:r,...i})=>o(`tbody`,{"data-slot":`table-body`,className:t(`[&>tr+tr>*]:border-t [&>tr+tr>*]:border-card-muted`,`text-body`,`[&>tr]:bg-card [&>tr]:not-only:hover:bg-card-hover`,n),ref:r,...i,children:e}),Caption:({children:e,className:n,ref:r,...i})=>o(`caption`,{"data-slot":`table-caption`,ref:r,className:t(`py-4 text-sm text-gray-500`,`border-t border-card-muted`,n),...i,children:e}),Cell:({children:e,className:n,ref:r,...i})=>o(`td`,{"data-slot":`table-cell`,ref:r,className:t(`p-3 align-middle [&:has([role=checkbox])]:pr-0 font-mono text-mono`,n),...i,children:e}),Element:({children:e,className:n,ref:r,...i})=>o(`table`,{"data-slot":`table-element`,ref:r,className:t(`table-auto border-separate border-spacing-0 caption-bottom w-full min-w-full text-left`,n),...i,children:e}),Foot:({children:e,className:n,ref:r,...i})=>o(`tfoot`,{"data-slot":`table-foot`,ref:r,className: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`,n),...i,children:e}),Head:({children:e,className:n,ref:r,...i})=>o(`thead`,{"data-slot":`table-head`,ref:r,className: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`,n),...i,children:e}),Header:({children:e,className:n,ref:r,...i})=>o(`th`,{"data-slot":`table-header`,ref:r,className:t(`h-11 px-4 text-left align-middle text-sm font-medium [&:has([role=checkbox])]:pr-0`,n),...i,children:e}),Root:({children:n,className:r,ref:i,...a})=>{let s=c();return o(`div`,{"data-slot":`table`,className:t(`group/table relative w-full overflow-hidden rounded-lg border border-card bg-white dark:bg-gray-100`,r),"data-sticky-active":s.state.hasOverflow&&!s.state.scrolledToEnd||void 0,"data-x-overflow":s.state.hasOverflow,"data-x-scroll-end":s.state.hasOverflow&&s.state.scrolledToEnd,...a,children:o(`div`,{className:t(`scrollbar scroll-fade-x overflow-x-auto overflow-y-clip overscroll-x-none`,`has-data-mantle-table-sticky-right:[--_fade-right:black]`),ref:e(s.ref,i),children:n})})},Row:({children:e,className:n,ref:r,...i})=>o(`tr`,{"data-slot":`table-row`,ref:r,className:t(n),...i,children:e})};function c(){let e=i(null),[t,o]=a({hasOverflow:!1,scrolledToStart:!0,scrolledToEnd:!1});return n(()=>{let t=e.current;if(!t)return;let n=0,r=()=>{let e=t.scrollWidth>t.clientWidth,n=t.scrollLeft<1,r=Math.abs(t.scrollWidth-t.scrollLeft-t.clientWidth)<1;o(t=>t.hasOverflow!==e||t.scrolledToStart!==n||t.scrolledToEnd!==r?{hasOverflow:e,scrolledToStart:n,scrolledToEnd:r}:t)},i=()=>{n===0&&(n=requestAnimationFrame(()=>{n=0,r()}))},a=new ResizeObserver(i);a.observe(t);let s=new MutationObserver(i);return s.observe(t,{childList:!0,subtree:!0}),t.addEventListener(`scroll`,i,{passive:!0}),r(),()=>{cancelAnimationFrame(n),a.disconnect(),s.disconnect(),t.removeEventListener(`scroll`,i)}},[]),r(()=>({ref:e,state:t}),[t])}export{s as t};
package/dist/table.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { t as Table } from "./table-CwFHXC-G.js";
1
+ import { t as Table } from "./table-Bo0vNxIJ.js";
2
2
  export { Table };
package/dist/table.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./table-CPH2md2-.js";export{e as Table};
1
+ import{t as e}from"./table-CGxJwtbL.js";export{e as Table};
package/dist/tabs.d.ts CHANGED
@@ -1,5 +1,100 @@
1
- import { HTMLAttributes } from "react";
1
+ import { ComponentProps, HTMLAttributes } from "react";
2
+ import { Content, List, Root, Trigger } from "@radix-ui/react-tabs";
2
3
  //#region src/components/tabs/tabs.d.ts
4
+ /**
5
+ * A set of layered sections of content—known as tab panels—that are displayed one at a time.
6
+ * The root component that provides context for all tab components.
7
+ *
8
+ * @see https://mantle.ngrok.com/components/navigation/tabs#tabsroot
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * <Tabs.Root defaultValue="account">
13
+ * <Tabs.List>
14
+ * <Tabs.Trigger value="account">Account</Tabs.Trigger>
15
+ * <Tabs.Trigger value="password">Password</Tabs.Trigger>
16
+ * </Tabs.List>
17
+ * <Tabs.Content value="account">
18
+ * <p>Make changes to your account here.</p>
19
+ * </Tabs.Content>
20
+ * <Tabs.Content value="password">
21
+ * <p>Change your password here.</p>
22
+ * </Tabs.Content>
23
+ * </Tabs.Root>
24
+ * ```
25
+ */
26
+ declare const Root$1: ({ className, children, orientation, appearance, ...props }: ComponentProps<typeof Root> & {
27
+ /**
28
+ * The appearance of the tabs. Classic appearance shows the tab
29
+ * list with an underline; pill appearance shows each tab as a pill.
30
+ * @default "classic"
31
+ */
32
+ appearance?: "classic" | "pill";
33
+ }) => import("react").JSX.Element;
34
+ /**
35
+ * Contains the triggers that are aligned along the edge of the active content.
36
+ * The container for tab triggers that provides the visual layout for tab navigation.
37
+ *
38
+ * By default a horizontal classic tablist draws a 1px bottom border in the
39
+ * `separator` color token, and a vertical classic tablist draws the matching
40
+ * side border. Pass `hideBorder` to remove it; the pill appearance never
41
+ * draws a border.
42
+ *
43
+ * @see https://mantle.ngrok.com/components/navigation/tabs#tabslist
44
+ *
45
+ * @example
46
+ * ```tsx
47
+ * <Tabs.Root defaultValue="account">
48
+ * <Tabs.List>
49
+ * <Tabs.Trigger value="account">Account</Tabs.Trigger>
50
+ * <Tabs.Trigger value="password">Password</Tabs.Trigger>
51
+ * </Tabs.List>
52
+ * <Tabs.Content value="account">
53
+ * <p>Make changes to your account here.</p>
54
+ * </Tabs.Content>
55
+ * </Tabs.Root>
56
+ * ```
57
+ *
58
+ * @example
59
+ * ```tsx
60
+ * // render the tablist without its border
61
+ * <Tabs.List hideBorder>
62
+ * <Tabs.Trigger value="account">Account</Tabs.Trigger>
63
+ * <Tabs.Trigger value="password">Password</Tabs.Trigger>
64
+ * </Tabs.List>
65
+ * ```
66
+ */
67
+ declare const List$1: ({ className, hideBorder, ref, ...props }: ComponentProps<typeof List> & {
68
+ /**
69
+ * Hide the tablist's border — the bottom border of a horizontal classic
70
+ * tablist, or the side border of a vertical one. Also rendered as a
71
+ * `data-hide-border` attribute on the tablist element. Has no effect on
72
+ * the pill appearance, which never draws a border.
73
+ * @default false
74
+ */
75
+ hideBorder?: boolean;
76
+ }) => import("react").JSX.Element;
77
+ type TabsTriggerProps = ComponentProps<typeof Trigger>;
78
+ /**
79
+ * The button that activates its associated content.
80
+ * A clickable tab trigger that switches between different tab content panels.
81
+ *
82
+ * @see https://mantle.ngrok.com/components/navigation/tabs#tabstrigger
83
+ *
84
+ * @example
85
+ * ```tsx
86
+ * <Tabs.Root defaultValue="account">
87
+ * <Tabs.List>
88
+ * <Tabs.Trigger value="account">Account</Tabs.Trigger>
89
+ * <Tabs.Trigger value="password">Password</Tabs.Trigger>
90
+ * </Tabs.List>
91
+ * <Tabs.Content value="account">
92
+ * <p>Make changes to your account here.</p>
93
+ * </Tabs.Content>
94
+ * </Tabs.Root>
95
+ * ```
96
+ */
97
+ declare const Trigger$1: ({ "aria-disabled": _ariaDisabled, asChild, children, className, disabled: _disabled, ref, ...props }: TabsTriggerProps) => import("react").JSX.Element;
3
98
  /**
4
99
  * A badge component that can be used inside tab triggers to display additional information.
5
100
  * Typically used to show counts or status indicators within tab headers.
@@ -18,10 +113,30 @@ import { HTMLAttributes } from "react";
18
113
  * </Tabs.Root>
19
114
  * ```
20
115
  */
21
- declare const Badge: {
22
- ({ className, children, ...props }: HTMLAttributes<HTMLSpanElement>): import("react").JSX.Element;
23
- displayName: string;
24
- };
116
+ declare const Badge: ({ className, children, ...props }: HTMLAttributes<HTMLSpanElement>) => import("react").JSX.Element;
117
+ /**
118
+ * Contains the content associated with each trigger.
119
+ * The content panel that displays when its corresponding tab trigger is active.
120
+ *
121
+ * @see https://mantle.ngrok.com/components/navigation/tabs#tabscontent
122
+ *
123
+ * @example
124
+ * ```tsx
125
+ * <Tabs.Root defaultValue="account">
126
+ * <Tabs.List>
127
+ * <Tabs.Trigger value="account">Account</Tabs.Trigger>
128
+ * <Tabs.Trigger value="password">Password</Tabs.Trigger>
129
+ * </Tabs.List>
130
+ * <Tabs.Content value="account">
131
+ * <p>Make changes to your account here.</p>
132
+ * </Tabs.Content>
133
+ * <Tabs.Content value="password">
134
+ * <p>Change your password here.</p>
135
+ * </Tabs.Content>
136
+ * </Tabs.Root>
137
+ * ```
138
+ */
139
+ declare const Content$1: ({ className, ...props }: ComponentProps<typeof Content>) => import("react").JSX.Element;
25
140
  /**
26
141
  * A set of layered sections of content—known as tab panels—that are displayed one at a time.
27
142
  * The root component that provides context for all tab components.
@@ -74,14 +189,7 @@ declare const Tabs: {
74
189
  * </Tabs.Root>
75
190
  * ```
76
191
  */
77
- readonly Root: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-tabs").TabsProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
78
- /**
79
- * The appearance of the tabs. Classic appearance shows the tab
80
- * list with an underline; pill appearance shows each tab as a pill.
81
- * @default "classic"
82
- */
83
- appearance?: "classic" | "pill";
84
- } & import("react").RefAttributes<HTMLDivElement>>;
192
+ readonly Root: typeof Root$1;
85
193
  /**
86
194
  * Contains the content associated with each trigger.
87
195
  * The content panel that displays when its corresponding tab trigger is active.
@@ -100,7 +208,7 @@ declare const Tabs: {
100
208
  * </Tabs.Root>
101
209
  * ```
102
210
  */
103
- readonly Content: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-tabs").TabsContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
211
+ readonly Content: typeof Content$1;
104
212
  /**
105
213
  * Contains the triggers that are aligned along the edge of the active content.
106
214
  * The container for tab triggers that provides the visual layout for tab navigation.
@@ -121,16 +229,7 @@ declare const Tabs: {
121
229
  * </Tabs.Root>
122
230
  * ```
123
231
  */
124
- readonly List: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-tabs").TabsListProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
125
- /**
126
- * Hide the tablist's border — the bottom border of a horizontal classic
127
- * tablist, or the side border of a vertical one. Also rendered as a
128
- * `data-hide-border` attribute on the tablist element. Has no effect on
129
- * the pill appearance, which never draws a border.
130
- * @default false
131
- */
132
- hideBorder?: boolean;
133
- } & import("react").RefAttributes<HTMLDivElement>>;
232
+ readonly List: typeof List$1;
134
233
  /**
135
234
  * The button that activates its associated content.
136
235
  * A clickable tab trigger that switches between different tab content panels.
@@ -147,7 +246,7 @@ declare const Tabs: {
147
246
  * </Tabs.Root>
148
247
  * ```
149
248
  */
150
- readonly Trigger: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-tabs").TabsTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
249
+ readonly Trigger: typeof Trigger$1;
151
250
  /**
152
251
  * A badge component that can be used inside tab triggers to display additional information.
153
252
  * Typically used to show counts or status indicators within tab headers.
package/dist/tabs.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./compose-refs-Cjf2gfB8.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./booleanish-BfvnW6vy.js";import{t as r}from"./clsx-DUGZgXfJ.js";import{t as i}from"./use-prefers-reduced-motion-CagaNRgm.js";import{Children as a,cloneElement as o,createContext as s,forwardRef as c,isValidElement as l,useContext as u,useEffect as d,useMemo as f,useRef as p}from"react";import m from"tiny-invariant";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{cva as v}from"class-variance-authority";import{Content as y,List as b,Root as x,Trigger as S}from"@radix-ui/react-tabs";const C=s({orientation:`horizontal`,appearance:`classic`}),w=c(({className:e,children:n,orientation:r=`horizontal`,appearance:i=`classic`,...a},o)=>{let s=f(()=>({orientation:r,appearance:i}),[r,i]);return g(x,{"data-slot":`tabs`,"data-appearance":i,className:t(`flex gap-4`,r===`horizontal`?`flex-col`:`flex-row`,e),orientation:r,ref:o,...a,children:g(C.Provider,{value:s,children:n})})});w.displayName=`Tabs`;const T=v(`flex`,{variants:{orientation:{horizontal:`scroll-fade-x flex-row items-center overflow-x-auto overscroll-x-none w-full min-w-0 pt-1 -mt-1 px-1 -mx-1`,vertical:`flex-col items-end gap-3.5 self-stretch`},appearance:{classic:``,pill:``},hideBorder:{true:``,false:``}},compoundVariants:[{orientation:`horizontal`,appearance:`pill`,className:`gap-1 pb-1 -mb-1`},{orientation:`horizontal`,appearance:`classic`,className:`gap-6`},{orientation:`horizontal`,appearance:`classic`,hideBorder:!1,className:t(`pb-px bg-origin-content bg-no-repeat bg-size-[100%_1px] bg-position-[0_calc(100%+1px)]`,`bg-[image:linear-gradient(var(--color-separator),var(--color-separator))]`,`[--_fade-bottom-border:black]`)},{orientation:`vertical`,appearance:`classic`,hideBorder:!1,className:`border-r border-separator`}],defaultVariants:{hideBorder:!1}}),E=c(({className:n,hideBorder:r=!1,...a},o)=>{let{orientation:s,appearance:c}=u(C),l=p(null);return d(()=>{let e=l.current;if(!e||s!==`horizontal`)return;let t=new AbortController;return e.addEventListener(`focusin`,t=>{if(t.target instanceof Element&&t.target!==e){let e=i()?`auto`:`smooth`;t.target.scrollIntoView({behavior:e,inline:`center`,block:`nearest`})}},{signal:t.signal}),()=>{t.abort()}},[s]),g(b,{"aria-orientation":s,"data-slot":`tabs-list`,"data-hide-border":r?``:void 0,className:t(T({orientation:s,appearance:c,hideBorder:r}),n),ref:e(l,o),...a})});E.displayName=`TabsList`;const D=v(`absolute z-0`,{variants:{orientation:{horizontal:`bottom-0 left-0 right-0 h-0.75`,vertical:`-right-px bottom-0 top-0 w-0.75`},appearance:{classic:`group-data-state-active/tab-trigger:bg-neutral-950`,pill:`hidden`}}}),O=()=>{let{orientation:e,appearance:t}=u(C);return g(`span`,{"aria-hidden":!0,className:r(D({orientation:e,appearance:t}))})};O.displayName=`TabsTriggerDecoration`;const k=v(t(`group/tab-trigger relative flex cursor-pointer items-center gap-1 whitespace-nowrap py-3 text-sm font-medium text-gray-600`,`ring-focus-accent outline-hidden`,`aria-disabled:cursor-default aria-disabled:opacity-50`,`focus-visible:ring-4`,`[&>svg]:shrink-0 [&>svg]:size-5`,`not-aria-disabled:hover:text-gray-900`),{variants:{orientation:{horizontal:`rounded-tl-md rounded-tr-md`,vertical:`rounded-bl-md rounded-tl-md pr-3`},appearance:{classic:t(`not-aria-disabled:hover:data-state-active:text-strong`,`data-state-active:text-strong`),pill:t(`not-aria-disabled:hover:data-state-active:text-strong`,`not-aria-disabled:hover:data-state-active:bg-neutral-500/15`,`data-state-active:text-strong`,`data-state-active:bg-neutral-500/15`,`rounded-full py-2 px-3`)}}}),A=c(({"aria-disabled":e,asChild:r=!1,children:i,className:s,disabled:c,...d},f)=>{let{orientation:p,appearance:v}=u(C),y=n(e??c),b={"aria-disabled":e??c,className:t(k({orientation:p,appearance:v}),s),disabled:y,...d};if(r){let e=a.only(i);m(l(e),"When using `asChild`, TabsTrigger must be passed a single child as a JSX tag.");let t=e.props?.children,n=y?{href:void 0,to:void 0}:{tabIndex:0};return g(S,{asChild:!0,"data-slot":`tabs-trigger`,...b,ref:f,children:o(y?g(`button`,{type:`button`}):e,n,_(h,{children:[g(O,{}),t]}))})}return _(S,{"data-slot":`tabs-trigger`,ref:f,...b,children:[g(O,{}),i]})});A.displayName=`TabsTrigger`;const j=({className:e,children:n,...r})=>g(`span`,{"data-slot":`tabs-badge`,className:t(`rounded-full bg-neutral-500/20 px-1.5 text-xs font-medium text-gray-600`,`group-data-state-active/tab-trigger:bg-neutral-950/10 group-data-state-active/tab-trigger:text-strong group-hover/tab-trigger:group-enabled/tab-trigger:group-data-state-active/tab-trigger:text-strong`,`group-hover/tab-trigger:group-enabled/tab-trigger:text-gray-700`,e),...r,children:n});j.displayName=`TabBadge`;const M=c(({className:e,...n},r)=>g(y,{ref:r,"data-slot":`tabs-content`,className:t(`focus-visible:ring-focus-accent outline-hidden focus-visible:ring-4`,e),...n}));M.displayName=`TabsContent`;const N={Root:w,Content:M,List:E,Trigger:A,Badge:j};export{N as Tabs};
1
+ import{t as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./cx-IiQEAKf5.js";import{t as n}from"./booleanish-BfvnW6vy.js";import{t as r}from"./clsx-DUGZgXfJ.js";import{t as i}from"./use-prefers-reduced-motion-CagaNRgm.js";import{Children as a,cloneElement as o,createContext as s,isValidElement as c,useContext as l,useEffect as u,useMemo as d,useRef as f}from"react";import p from"tiny-invariant";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{cva as _}from"class-variance-authority";import{Content as v,List as y,Root as b,Trigger as x}from"@radix-ui/react-tabs";const S=s({orientation:`horizontal`,appearance:`classic`}),C=({className:e,children:n,orientation:r=`horizontal`,appearance:i=`classic`,...a})=>{let o=d(()=>({orientation:r,appearance:i}),[r,i]);return h(b,{"data-slot":`tabs`,"data-appearance":i,className:t(`flex gap-4`,r===`horizontal`?`flex-col`:`flex-row`,e),orientation:r,...a,children:h(S.Provider,{value:o,children:n})})},w=_(`flex`,{variants:{orientation:{horizontal:`scroll-fade-x flex-row items-center overflow-x-auto overscroll-x-none w-full min-w-0 pt-1 -mt-1 px-1 -mx-1`,vertical:`flex-col items-end gap-3.5 self-stretch`},appearance:{classic:``,pill:``},hideBorder:{true:``,false:``}},compoundVariants:[{orientation:`horizontal`,appearance:`pill`,className:`gap-1 pb-1 -mb-1`},{orientation:`horizontal`,appearance:`classic`,className:`gap-6`},{orientation:`horizontal`,appearance:`classic`,hideBorder:!1,className:t(`pb-px bg-origin-content bg-no-repeat bg-size-[100%_1px] bg-position-[0_calc(100%+1px)]`,`bg-[image:linear-gradient(var(--color-separator),var(--color-separator))]`,`[--_fade-bottom-border:black]`)},{orientation:`vertical`,appearance:`classic`,hideBorder:!1,className:`border-r border-separator`}],defaultVariants:{hideBorder:!1}}),T=({className:n,hideBorder:r=!1,ref:a,...o})=>{let{orientation:s,appearance:c}=l(S),d=f(null);return u(()=>{let e=d.current;if(!e||s!==`horizontal`)return;let t=new AbortController;return e.addEventListener(`focusin`,t=>{if(t.target instanceof Element&&t.target!==e){let e=i()?`auto`:`smooth`;t.target.scrollIntoView({behavior:e,inline:`center`,block:`nearest`})}},{signal:t.signal}),()=>{t.abort()}},[s]),h(y,{"aria-orientation":s,"data-slot":`tabs-list`,"data-hide-border":r?``:void 0,className:t(w({orientation:s,appearance:c,hideBorder:r}),n),ref:e(d,a),...o})},E=_(`absolute z-0`,{variants:{orientation:{horizontal:`bottom-0 left-0 right-0 h-0.75`,vertical:`-right-px bottom-0 top-0 w-0.75`},appearance:{classic:`group-data-state-active/tab-trigger:bg-neutral-950`,pill:`hidden`}}}),D=()=>{let{orientation:e,appearance:t}=l(S);return h(`span`,{"aria-hidden":!0,className:r(E({orientation:e,appearance:t}))})},O=_(t(`group/tab-trigger relative flex cursor-pointer items-center gap-1 whitespace-nowrap py-3 text-sm font-medium text-gray-600`,`ring-focus-accent outline-hidden`,`aria-disabled:cursor-default aria-disabled:opacity-50`,`focus-visible:ring-4`,`[&>svg]:shrink-0 [&>svg]:size-5`,`not-aria-disabled:hover:text-gray-900`),{variants:{orientation:{horizontal:`rounded-tl-md rounded-tr-md`,vertical:`rounded-bl-md rounded-tl-md pr-3`},appearance:{classic:t(`not-aria-disabled:hover:data-state-active:text-strong`,`data-state-active:text-strong`),pill:t(`not-aria-disabled:hover:data-state-active:text-strong`,`not-aria-disabled:hover:data-state-active:bg-neutral-500/15`,`data-state-active:text-strong`,`data-state-active:bg-neutral-500/15`,`rounded-full py-2 px-3`)}}}),k={Root:C,Content:({className:e,...n})=>h(v,{"data-slot":`tabs-content`,className:t(`focus-visible:ring-focus-accent outline-hidden focus-visible:ring-4`,e),...n}),List:T,Trigger:({"aria-disabled":e,asChild:r=!1,children:i,className:s,disabled:u,ref:d,...f})=>{let{orientation:_,appearance:v}=l(S),y=n(e??u),b={"aria-disabled":e??u,className:t(O({orientation:_,appearance:v}),s),disabled:y,...f};if(r){let e=a.only(i);p(c(e),"When using `asChild`, TabsTrigger must be passed a single child as a JSX tag.");let t=e.props?.children,n=y?{href:void 0,to:void 0}:{tabIndex:0};return h(x,{asChild:!0,"data-slot":`tabs-trigger`,...b,ref:d,children:o(y?h(`button`,{type:`button`}):e,n,g(m,{children:[h(D,{}),t]}))})}return g(x,{"data-slot":`tabs-trigger`,ref:d,...b,children:[h(D,{}),i]})},Badge:({className:e,children:n,...r})=>h(`span`,{"data-slot":`tabs-badge`,className:t(`rounded-full bg-neutral-500/20 px-1.5 text-xs font-medium text-gray-600`,`group-data-state-active/tab-trigger:bg-neutral-950/10 group-data-state-active/tab-trigger:text-strong group-hover/tab-trigger:group-enabled/tab-trigger:group-data-state-active/tab-trigger:text-strong`,`group-hover/tab-trigger:group-enabled/tab-trigger:text-gray-700`,e),...r,children:n})};export{k as Tabs};
@@ -1,4 +1,4 @@
1
- import { o as WithValidation } from "./validation-7QeiTFwl.js";
1
+ import { o as WithValidation } from "./field-7QeiTFwl.js";
2
2
  import { ComponentProps } from "react";
3
3
  //#region src/components/text-area/text-area.d.ts
4
4
  type Props = ComponentProps<"textarea"> & WithValidation & {
@@ -28,6 +28,6 @@ type Props = ComponentProps<"textarea"> & WithValidation & {
28
28
  * </form>
29
29
  * ```
30
30
  */
31
- declare const TextArea: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
31
+ declare const TextArea: ({ appearance, "aria-invalid": _ariaInvalid, className, onDragEnter, onDragLeave, onDropCapture, ref, validation: _validation, ...props }: Props) => import("react").JSX.Element;
32
32
  //#endregion
33
33
  export { TextArea };
package/dist/text-area.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./compose-refs-Cjf2gfB8.js";import{t}from"./cx-IiQEAKf5.js";import{a as n,r}from"./validation-Bpptk_9t.js";import{forwardRef as i,useRef as a,useState as o}from"react";import{jsx as s}from"react/jsx-runtime";const c=i(({appearance:i,"aria-invalid":c,className:l,onDragEnter:u,onDragLeave:d,onDropCapture:f,validation:p,...m},h)=>{let g=n(),{ariaInvalid:_,validation:v}=r({"aria-invalid":c,validation:p??g}),[y,b]=o(!1),x=a(null);return s(`textarea`,{"aria-invalid":_,"data-validation":v||void 0,"data-slot":`text-area`,className:t(i===`monospaced`&&`pointer-coarse:text-[0.9375rem] font-mono text-[0.8125rem]`,`border-input bg-form data-drag-over:border-dashed data-drag-over:ring-4 pointer-coarse:py-[calc(theme(spacing[2.5])-1px)] pointer-coarse:text-base flex min-h-24 w-full rounded-md border px-3 py-[calc(theme(spacing[2])-1px)] focus-visible:outline-hidden focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50`,`placeholder:text-placeholder data-drag-over:border-dashed`,`border-form text-strong ring-focus-accent focus:border-accent-600 data-drag-over:border-accent-600`,`data-validation-error:border-danger-600 data-validation-error:ring-focus-danger data-validation-error:focus-visible:border-danger-600 data-validation-error:data-drag-over:border-danger-600`,`data-validation-success:border-success-600 data-validation-success:ring-focus-success data-validation-success:focus-visible:border-success-600 data-validation-success:data-drag-over:border-success-600`,`data-validation-warning:border-warning-600 data-validation-warning:ring-focus-warning data-validation-warning:focus-visible:border-warning-600 data-validation-warning:data-drag-over:border-warning-600`,l),"data-drag-over":y,onDragEnter:e=>{b(!0),u?.(e)},onDragLeave:e=>{b(!1),d?.(e)},onDropCapture:e=>{b(!1),x.current?.focus(),f?.(e)},ref:e(x,h),...m})});c.displayName=`TextArea`;export{c as TextArea};
1
+ import{t as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./cx-IiQEAKf5.js";import{a as n,r}from"./field-Bpptk_9t.js";import{useRef as i,useState as a}from"react";import{jsx as o}from"react/jsx-runtime";const s=({appearance:s,"aria-invalid":c,className:l,onDragEnter:u,onDragLeave:d,onDropCapture:f,ref:p,validation:m,...h})=>{let g=n(),{ariaInvalid:_,validation:v}=r({"aria-invalid":c,validation:m??g}),[y,b]=a(!1),x=i(null);return o(`textarea`,{"aria-invalid":_,"data-validation":v||void 0,"data-slot":`text-area`,className:t(s===`monospaced`&&`pointer-coarse:text-[0.9375rem] font-mono text-[0.8125rem]`,`border-input bg-form data-drag-over:border-dashed data-drag-over:ring-4 pointer-coarse:py-[calc(theme(spacing[2.5])-1px)] pointer-coarse:text-base flex min-h-24 w-full rounded-md border px-3 py-[calc(theme(spacing[2])-1px)] focus-visible:outline-hidden focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50`,`placeholder:text-placeholder data-drag-over:border-dashed`,`border-form text-strong ring-focus-accent focus:border-accent-600 data-drag-over:border-accent-600`,`data-validation-error:border-danger-600 data-validation-error:ring-focus-danger data-validation-error:focus-visible:border-danger-600 data-validation-error:data-drag-over:border-danger-600`,`data-validation-success:border-success-600 data-validation-success:ring-focus-success data-validation-success:focus-visible:border-success-600 data-validation-success:data-drag-over:border-success-600`,`data-validation-warning:border-warning-600 data-validation-warning:ring-focus-warning data-validation-warning:focus-visible:border-warning-600 data-validation-warning:data-drag-over:border-warning-600`,l),"data-drag-over":y,onDragEnter:e=>{b(!0),u?.(e)},onDragLeave:e=>{b(!1),d?.(e)},onDropCapture:e=>{b(!1),x.current?.focus(),f?.(e)},ref:e(x,p),...h})};export{s as TextArea};
@@ -0,0 +1 @@
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{n as t}from"./browser-only-CPH56Xw_.js";import{t as n}from"./use-matches-media-query-CMSxHR9n.js";import{createContext as r,useContext as i,useEffect as a,useMemo as o,useRef as s,useState as c}from"react";import l from"tiny-invariant";import{jsx as u}from"react/jsx-runtime";const d=[`light`,`dark`,`light-high-contrast`,`dark-high-contrast`],f=[`system`,...d],p=e=>e;function m(e){return typeof e==`string`&&f.includes(e)}const h=e=>e;function g(e){return typeof e==`string`&&d.includes(e)}const _=`(prefers-color-scheme: dark)`,v=`(prefers-contrast: more)`,y=`mantle-ui-theme`,b=`system`,x=r([`system`,()=>null]);function S({children:e}){let[n,r]=c(()=>{let e=N({cookie:t()?document.cookie:null});return w(e),e}),i=s(null);a(()=>{function e(e){let t=e??N({cookie:document.cookie});r(t),w(t)}e();try{`BroadcastChannel`in window&&(i.current=new BroadcastChannel(y),i.current.addEventListener(`message`,t=>{let n=t?.data?.theme;m(n)&&e(n)}))}catch{}function t(t){t.key===`${y}__ping`&&e()}window.addEventListener(`storage`,t);let n=window.matchMedia(_),a=window.matchMedia(v);function o(){e()}function s(){document.visibilityState===`visible`&&e()}return n.addEventListener(`change`,o),a.addEventListener(`change`,o),window.addEventListener(`pageshow`,o),document.addEventListener(`visibilitychange`,s),()=>{window.removeEventListener(`storage`,t),n.removeEventListener(`change`,o),a.removeEventListener(`change`,o),window.removeEventListener(`pageshow`,o),document.removeEventListener(`visibilitychange`,s);try{i.current?.close()}catch{}i.current=null}},[]);let l=o(()=>[n,e=>{L(e),r(e),w(e),F(e,{broadcastChannel:i.current,pingKey:`${y}__ping`})}],[n]);return u(x.Provider,{value:l,children:e})}function C(){let e=i(x);return l(e,`useTheme must be used within a ThemeProvider`),e}function w(e){if(!t())return;let n=window.document.documentElement,r=window.matchMedia(_).matches,i=window.matchMedia(v).matches,a=E(e,{prefersDarkMode:r,prefersHighContrast:i}),o=n.dataset.theme,s=n.dataset.appliedTheme,c=m(o)?o:void 0,l=g(s)?s:void 0;(c!==e||l!==a)&&(n.classList.remove(...d),n.classList.add(a),n.dataset.theme=e,n.dataset.appliedTheme=a)}function T(){if(!t())return{appliedTheme:void 0,theme:void 0};let e=window.document.documentElement,n=m(e.dataset.theme)?e.dataset.theme:void 0;return{appliedTheme:g(e.dataset.appliedTheme)?e.dataset.appliedTheme:void 0,theme:n}}function E(e,{prefersDarkMode:t,prefersHighContrast:n}){return e===`system`?O({prefersDarkMode:t,prefersHighContrast:n}):e}function D(){let e=i(x);return E(e==null?`system`:e[0],{prefersDarkMode:n(_),prefersHighContrast:n(v)})}function O({prefersDarkMode:e,prefersHighContrast:t}){return t?e?`dark-high-contrast`:`light-high-contrast`:e?`dark`:`light`}function k(e){let{storageKey:t,defaultTheme:n,themes:r,resolvedThemes:i,prefersDarkModeMediaQuery:a,prefersHighContrastMediaQuery:o}=e;function s(e){return typeof e==`string`&&r.includes(e)}function c(e){let t=document.cookie;if(!t)return null;try{let n=t.split(`;`).find(t=>t.trim().startsWith(`${e}=`))?.split(`=`)[1];return n?decodeURIComponent(n):null}catch{return null}}function l(e,t){let n=new Date;n.setFullYear(n.getFullYear()+1);let r=window.location.hostname,i=window.location.protocol,a=r===`ngrok.com`||r.endsWith(`.ngrok.com`)?`; domain=.ngrok.com`:``,o=i===`https:`?`; Secure`:``;return`${e}=${encodeURIComponent(t)}; expires=${n.toUTCString()}; path=/${a}; SameSite=Lax${o}`}function u(e,t){try{document.cookie=l(e,t)}catch{}}function d(e,t,n){return e===`system`?n?t?`dark-high-contrast`:`light-high-contrast`:t?`dark`:`light`:e}let f=null,p=null,m=null;try{f=c(t)}catch{}if(s(f))m=f;else{try{p=window.localStorage?.getItem(t)??null}catch{}s(p)&&(m=p)}let h=s(m)?m:n,g=matchMedia(a).matches,_=matchMedia(o).matches,v=d(h,g,_),y=document.documentElement;if(y.dataset.appliedTheme!==v||y.dataset.theme!==h){for(let e of i)y.classList.remove(e);y.classList.add(v),y.dataset.theme=h,y.dataset.appliedTheme=v}let b=s(f);try{if(s(p)&&!b){u(t,p);try{window.localStorage.removeItem(t)}catch{}}else b||u(t,h)}catch{}}function A(){let e={storageKey:y,defaultTheme:b,themes:f,resolvedThemes:d,prefersDarkModeMediaQuery:_,prefersHighContrastMediaQuery:v};return`(${k.toString()})(${JSON.stringify(e)})`}const j=({nonce:e})=>u(`script`,{dangerouslySetInnerHTML:{__html:A()},nonce:e,suppressHydrationWarning:!0});function M(n={}){let{className:r=``,ssrCookie:i}=n??{};return o(()=>{let n,a;if(!t())n=N({cookie:i}),a=E(n,{prefersDarkMode:!1,prefersHighContrast:!1});else{let e=window.matchMedia(_).matches,t=window.matchMedia(v).matches;n=N({cookie:document.cookie}),a=E(n,{prefersDarkMode:e,prefersHighContrast:t})}return{className:e(r,a),"data-applied-theme":a,"data-theme":n}},[r,i])}function N({cookie:e}){if(!e)return b;try{let t=e.split(`;`).find(e=>e.trim().startsWith(`${y}=`))?.split(`=`)[1],n=t?globalThis.decodeURIComponent(t):null;return m(n)?n:b}catch{return b}}function P(e){if(e)return e.split(`;`).map(e=>e.trim()).find(e=>e.startsWith(`${y}=`))}function F(e,t){let{broadcastChannel:n,pingKey:r}=t;try{if(n){n.postMessage({theme:e,timestamp:Date.now()});return}}catch{}try{localStorage.setItem(r,JSON.stringify({theme:e,timestamp:Date.now()}))}catch{}}function I(e){let t=new Date;t.setFullYear(t.getFullYear()+1);let{hostname:n,protocol:r}=window.location,i=n===`ngrok.com`||n.endsWith(`.ngrok.com`)?`; domain=.ngrok.com`:``,a=r===`https:`?`; Secure`:``;return`${y}=${encodeURIComponent(e)}; expires=${t.toUTCString()}; path=/${i}; SameSite=Lax${a}`}function L(e){if(t())try{document.cookie=I(e)}catch{}}export{A as a,M as c,p as d,g as f,f as h,N as i,C as l,d as m,S as n,T as o,m as p,P as r,D as s,j as t,h as u};
@@ -1,18 +1,61 @@
1
1
  import { t as WithStyleProps } from "./with-style-props-Dq5Vntqy.js";
2
- import { n as IconButtonAppearance, r as IconButtonProps } from "./icon-button-BvQvT790.js";
2
+ import { n as IconButtonProps, r as IconButtonAppearance } from "./button-C7vAl6lS.js";
3
3
  import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
4
- import { t as DropdownMenu } from "./dropdown-menu-DP_Ne9Mr.js";
5
- import "./index-g2rfwNCH.js";
6
- import { ComponentProps, ComponentPropsWithoutRef } from "react";
4
+ import { t as DropdownMenu } from "./dropdown-menu-DZg-Cd69.js";
5
+ import "./dropdown-menu-Dw-OtXPm.js";
6
+ import { ComponentProps } from "react";
7
7
  //#region src/components/theme-switcher/theme-switcher.d.ts
8
8
  /**
9
9
  * The props for the `ThemeDropdownMenuRadioGroup` component.
10
10
  */
11
11
  type ThemeDropdownMenuRadioGroupProps = WithStyleProps;
12
- declare function ThemeDropdownMenuRadioGroup({ className, style }: ThemeDropdownMenuRadioGroupProps): import("react").JSX.Element;
13
- declare namespace ThemeDropdownMenuRadioGroup {
14
- var displayName: string;
15
- }
12
+ /**
13
+ * Must render inside a `DropdownMenu.Content` or `DropdownMenu.SubContent` —
14
+ * the type system cannot express this constraint, so it is on you to uphold it.
15
+ *
16
+ * The theme-selection radio group for mantle's theme system. Renders one
17
+ * `role="menuitemradio"` item per mantle theme via `DropdownMenu.RadioGroup`;
18
+ * the active theme is `aria-checked` and choosing an item persists the new
19
+ * theme through `useTheme`, so a `ThemeProvider` ancestor is required
20
+ * (`useTheme` throws outside of one). Use it to embed theme selection in an
21
+ * existing menu (e.g. an account menu submenu); for a standalone picker,
22
+ * reach for `ThemeSwitcher` instead.
23
+ *
24
+ * @see https://mantle.ngrok.com/components/forms/theme-switcher
25
+ *
26
+ * @example
27
+ * Standalone inside a `DropdownMenu.Content`:
28
+ * ```tsx
29
+ * <DropdownMenu.Root>
30
+ * <DropdownMenu.Trigger asChild>
31
+ * <Button type="button" appearance="outlined" intent="neutral">Theme</Button>
32
+ * </DropdownMenu.Trigger>
33
+ * <DropdownMenu.Content>
34
+ * <ThemeDropdownMenuRadioGroup />
35
+ * </DropdownMenu.Content>
36
+ * </DropdownMenu.Root>
37
+ * ```
38
+ *
39
+ * @example
40
+ * Embedded in a submenu of an existing menu (e.g. an account menu):
41
+ * ```tsx
42
+ * <DropdownMenu.Root>
43
+ * <DropdownMenu.Trigger asChild>
44
+ * <Button type="button" appearance="outlined" intent="neutral">Account</Button>
45
+ * </DropdownMenu.Trigger>
46
+ * <DropdownMenu.Content>
47
+ * <DropdownMenu.Item>Profile</DropdownMenu.Item>
48
+ * <DropdownMenu.Sub>
49
+ * <DropdownMenu.SubTrigger>Theme</DropdownMenu.SubTrigger>
50
+ * <DropdownMenu.SubContent>
51
+ * <ThemeDropdownMenuRadioGroup />
52
+ * </DropdownMenu.SubContent>
53
+ * </DropdownMenu.Sub>
54
+ * </DropdownMenu.Content>
55
+ * </DropdownMenu.Root>
56
+ * ```
57
+ */
58
+ declare const ThemeDropdownMenuRadioGroup: ({ className, style }: ThemeDropdownMenuRadioGroupProps) => import("react").JSX.Element;
16
59
  /**
17
60
  * The props for the `ThemeSwitcher.Root` component. Identical to
18
61
  * `DropdownMenu.Root`'s props — `Root` forwards everything through.
@@ -34,10 +77,7 @@ type ThemeSwitcherRootProps = ComponentProps<typeof DropdownMenu.Root>;
34
77
  * </ThemeSwitcher.Root>
35
78
  * ```
36
79
  */
37
- declare const Root: {
38
- (props: ThemeSwitcherRootProps): import("react").JSX.Element;
39
- displayName: string;
40
- };
80
+ declare const Root: (props: ThemeSwitcherRootProps) => import("react").JSX.Element;
41
81
  /**
42
82
  * The props for the `ThemeSwitcher.Trigger` component. Forwards
43
83
  * `IconButton`'s props, except the parts the trigger owns: `icon` (the
@@ -63,13 +103,63 @@ type ThemeSwitcherTriggerProps = Omit<IconButtonProps, "appearance" | "asChild"
63
103
  */
64
104
  label?: string;
65
105
  };
106
+ /**
107
+ * The button that opens the theme menu: an `IconButton` (ghost by default)
108
+ * wired up as the menu trigger. The trigger icon is SSR-safe: the applied
109
+ * theme is unknowable server-side, so a `Skeleton` renders until hydration,
110
+ * then the icon matching the applied theme. The icon is owned by the trigger;
111
+ * to render a completely custom trigger, compose `DropdownMenu` +
112
+ * `ThemeDropdownMenuRadioGroup` directly instead.
113
+ *
114
+ * @see https://mantle.ngrok.com/components/forms/theme-switcher
115
+ *
116
+ * @example
117
+ * ```tsx
118
+ * <ThemeSwitcher.Root>
119
+ * <ThemeSwitcher.Trigger appearance="outlined" label="Choose a theme" />
120
+ * <ThemeSwitcher.Content />
121
+ * </ThemeSwitcher.Root>
122
+ * ```
123
+ */
124
+ declare const Trigger: ({ appearance, "data-slot": dataSlot, disabled, label, ref, ...props }: ThemeSwitcherTriggerProps) => import("react").JSX.Element;
66
125
  /**
67
126
  * The props for the `ThemeSwitcher.Content` component. Identical to
68
127
  * `DropdownMenu.Content`'s props — positioning and collision behavior
69
128
  * (`align`, `side`, `collisionPadding`, …) plus `className`/`style` all
70
129
  * forward through.
71
130
  */
72
- type ThemeSwitcherContentProps = ComponentPropsWithoutRef<typeof DropdownMenu.Content> & WithDataSlot;
131
+ type ThemeSwitcherContentProps = ComponentProps<typeof DropdownMenu.Content> & WithDataSlot;
132
+ /**
133
+ * The popover the trigger opens: a thin forwarding wrapper over
134
+ * `DropdownMenu.Content`. When `children` are omitted (or `null`/`undefined`)
135
+ * it renders `ThemeDropdownMenuRadioGroup`, the five-theme radio group — pass
136
+ * `children` to own the menu contents instead (compose
137
+ * `ThemeDropdownMenuRadioGroup` yourself alongside extra items). Any
138
+ * non-nullish children replace the default entirely, including render-nothing
139
+ * values like `false` — a lone `{condition && <Item />}` child suppresses the
140
+ * radio group when the condition is false.
141
+ *
142
+ * @see https://mantle.ngrok.com/components/forms/theme-switcher
143
+ *
144
+ * @example
145
+ * ```tsx
146
+ * <ThemeSwitcher.Root>
147
+ * <ThemeSwitcher.Trigger />
148
+ * <ThemeSwitcher.Content align="end" collisionPadding={{ right: 16 }} />
149
+ * </ThemeSwitcher.Root>
150
+ * ```
151
+ *
152
+ * @example
153
+ * Extending the menu beyond theme selection:
154
+ * ```tsx
155
+ * <ThemeSwitcher.Content>
156
+ * <ThemeDropdownMenuRadioGroup />
157
+ * <DropdownMenu.Separator />
158
+ * <DropdownMenu.Item>Appearance settings…</DropdownMenu.Item>
159
+ * </ThemeSwitcher.Content>
160
+ * ```
161
+ */
162
+ declare const Content: ({ children, "data-slot": dataSlot, ...props }: ThemeSwitcherContentProps) => import("react").JSX.Element;
73
163
  /**
74
164
  * The canonical picker for mantle's theme system: a compact `IconButton`
75
165
  * trigger (ghost by default) that opens a `DropdownMenu` hosting
@@ -134,23 +224,7 @@ declare const ThemeSwitcher: {
134
224
  * </ThemeSwitcher.Root>
135
225
  * ```
136
226
  */
137
- readonly Trigger: import("react").ForwardRefExoticComponent<Omit<IconButtonProps, "appearance" | "asChild" | "children" | "icon" | "intent" | "label"> & WithDataSlot & {
138
- /**
139
- * The visual style of the trigger `IconButton`. Optional here —
140
- * `ThemeSwitcher.Trigger` defaults to `"ghost"` so the trigger sits
141
- * quietly in headers and toolbars.
142
- *
143
- * @default "ghost"
144
- */
145
- appearance?: IconButtonAppearance;
146
- /**
147
- * The accessible name for the trigger `IconButton`. Visually hidden but
148
- * announced to screen readers. Override it for localization.
149
- *
150
- * @default "Change Theme"
151
- */
152
- label?: string;
153
- } & import("react").RefAttributes<HTMLButtonElement>>;
227
+ readonly Trigger: typeof Trigger;
154
228
  /**
155
229
  * The popover the trigger opens: forwards `DropdownMenu.Content` props
156
230
  * (`align`, `side`, `collisionPadding`, `className`, …) and renders the
@@ -166,9 +240,7 @@ declare const ThemeSwitcher: {
166
240
  * </ThemeSwitcher.Root>
167
241
  * ```
168
242
  */
169
- readonly Content: import("react").ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & WithDataSlot & {
170
- width?: "trigger" | "content";
171
- } & import("react").RefAttributes<HTMLDivElement>, "ref"> & WithDataSlot & import("react").RefAttributes<HTMLDivElement>>;
243
+ readonly Content: typeof Content;
172
244
  };
173
245
  //#endregion
174
246
  export { ThemeDropdownMenuRadioGroup, type ThemeDropdownMenuRadioGroupProps, ThemeSwitcher, type ThemeSwitcherContentProps, type ThemeSwitcherRootProps, type ThemeSwitcherTriggerProps };
@@ -1 +1 @@
1
- import{t as e}from"./icon-CDtYjF_H.js";import{n as t}from"./slot-DmPrjM7N.js";import{t as n}from"./icon-button-DV2-GZHf.js";import{t as r}from"./browser-only-CPH56Xw_.js";import{d as i,h as a,l as o,p as s}from"./theme-provider-C9zpDyJW.js";import{t as c}from"./dropdown-menu-Bt1aKF1g.js";import{n as l,t as u}from"./theme-D3MDng6U.js";import{t as d}from"./skeleton-Bu3tgNcW.js";import{forwardRef as f}from"react";import{jsx as p,jsxs as m}from"react/jsx-runtime";const h={system:`System Preference`,light:`Light Mode`,dark:`Dark Mode`,"light-high-contrast":`Light High Contrast`,"dark-high-contrast":`Dark High Contrast`},g=({className:t,style:n})=>{let[r,u]=o();return p(c.RadioGroup,{"data-slot":`theme-dropdown-menu-radio-group`,className:t,style:n,value:r,onValueChange:e=>{s(e)&&u(e)},children:a.map(t=>m(c.RadioItem,{value:i(t),children:[p(e,{svg:p(l,{theme:t})}),h[t]]},t))})};g.displayName=`ThemeDropdownMenuRadioGroup`;const _=e=>p(c.Root,{...e});_.displayName=`ThemeSwitcher`;const v=f(({appearance:e=`ghost`,"data-slot":i,disabled:a,label:o=`Change Theme`,...s},l)=>p(c.Trigger,{asChild:!0,disabled:a,children:p(n,{ref:l,appearance:e,disabled:a,"data-slot":t(i,`theme-switcher-trigger`),intent:`neutral`,icon:p(r,{fallback:p(d,{className:`rounded-full size-5`}),children:()=>p(u,{className:`size-5`})}),label:o,...s})}));v.displayName=`ThemeSwitcherTrigger`;const y=f(({children:e,"data-slot":n,...r},i)=>p(c.Content,{ref:i,"data-slot":t(n,`theme-switcher-content`),...r,children:e??p(g,{})}));y.displayName=`ThemeSwitcherContent`;const b={Root:_,Trigger:v,Content:y};export{g as ThemeDropdownMenuRadioGroup,b as ThemeSwitcher};
1
+ import{t as e}from"./icon-lZ48P8Nn.js";import{n as t}from"./slot-CDk0Bb9z.js";import{t as n}from"./button-BAno7KIU.js";import{t as r}from"./browser-only-CPH56Xw_.js";import{t as i}from"./dropdown-menu-RyDWoKHx.js";import{d as a,h as o,l as s,p as c}from"./theme-C26-Xolp.js";import{n as l,t as u}from"./icons-DLCs1hLP.js";import{t as d}from"./skeleton-CsbUHbBA.js";import{jsx as f,jsxs as p}from"react/jsx-runtime";const m={system:`System Preference`,light:`Light Mode`,dark:`Dark Mode`,"light-high-contrast":`Light High Contrast`,"dark-high-contrast":`Dark High Contrast`},h=({className:t,style:n})=>{let[r,u]=s();return f(i.RadioGroup,{"data-slot":`theme-dropdown-menu-radio-group`,className:t,style:n,value:r,onValueChange:e=>{c(e)&&u(e)},children:o.map(t=>p(i.RadioItem,{value:a(t),children:[f(e,{svg:f(l,{theme:t})}),m[t]]},t))})},g={Root:e=>f(i.Root,{...e}),Trigger:({appearance:e=`ghost`,"data-slot":a,disabled:o,label:s=`Change Theme`,ref:c,...l})=>f(i.Trigger,{asChild:!0,disabled:o,children:f(n,{ref:c,appearance:e,disabled:o,"data-slot":t(a,`theme-switcher-trigger`),intent:`neutral`,icon:f(r,{fallback:f(d,{className:`rounded-full size-5`}),children:()=>f(u,{className:`size-5`})}),label:s,...l})}),Content:({children:e,"data-slot":n,...r})=>f(i.Content,{"data-slot":t(n,`theme-switcher-content`),...r,children:e??f(h,{})})};export{h as ThemeDropdownMenuRadioGroup,g as ThemeSwitcher};
package/dist/theme.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as isResolvedTheme, c as themes, i as Theme, n as $theme, o as isTheme, r as ResolvedTheme, s as resolvedThemes, t as $resolvedTheme } from "./themes-CYNpplwN.js";
1
+ import { a as isResolvedTheme, c as themes, i as Theme, n as $theme, o as isTheme, r as ResolvedTheme, s as resolvedThemes, t as $resolvedTheme } from "./theme-CYNpplwN.js";
2
2
  import { PropsWithChildren } from "react";
3
3
  //#region src/components/theme/mantle-style-sheets.d.ts
4
4
  /**
@@ -155,9 +155,6 @@ declare function fixMediaScriptContent(forceTheme?: ResolvedTheme): string;
155
155
  * ```
156
156
  */
157
157
  declare function MantleStyleSheets({ darkCssUrl, lightHighContrastCssUrl, darkHighContrastCssUrl, forceTheme, nonce, ssrCookie }: MantleStyleSheetsProps): import("react").JSX.Element;
158
- declare namespace MantleStyleSheets {
159
- var displayName: string;
160
- }
161
158
  //#endregion
162
159
  //#region src/components/theme/theme-provider.d.ts
163
160
  /**
@@ -178,9 +175,6 @@ type ThemeProviderProps = PropsWithChildren;
178
175
  * ```
179
176
  */
180
177
  declare function ThemeProvider({ children }: ThemeProviderProps): import("react").JSX.Element;
181
- declare namespace ThemeProvider {
182
- var displayName: string;
183
- }
184
178
  /**
185
179
  * useTheme returns the current theme and a function to set the theme.
186
180
  *
@@ -215,10 +209,39 @@ type PreventWrongThemeFlashScriptProps = {
215
209
  */
216
210
  nonce?: string;
217
211
  };
218
- declare function PreventWrongThemeFlashScript({ nonce }: PreventWrongThemeFlashScriptProps): import("react").JSX.Element;
219
- declare namespace PreventWrongThemeFlashScript {
220
- var displayName: string;
221
- }
212
+ /**
213
+ * Renders an inline script that prevents Flash of Unstyled Content (FOUC) or the
214
+ * wrong theme flashing on first paint.
215
+ *
216
+ * This is the preferred building block for SSR apps. Pair it with
217
+ * {@link preloadFontLink} HTTP `Link` headers in your server entry so font fetches
218
+ * begin before HTML is parsed. For client-only apps without header control, pair
219
+ * it with {@link PreloadFont} elements in `<head>` instead.
220
+ *
221
+ * Place this as early as possible in the `<head>`.
222
+ *
223
+ * @example
224
+ * ```tsx
225
+ * // entry.server.tsx — send font preloads as HTTP headers (preferred for SSR)
226
+ * headers.set("Link", [
227
+ * `<${assetsCdnOrigin}>; rel=preconnect; crossorigin`,
228
+ * preloadFontLink("roobert"),
229
+ * preloadFontLink("jetbrains-mono"),
230
+ * ].join(", "));
231
+ *
232
+ * // root.tsx — only the FOUC script in <head>
233
+ * <head>
234
+ * <PreventWrongThemeFlashScript nonce={nonce} />
235
+ * </head>
236
+ * ```
237
+ *
238
+ * @param nonce - Optional CSP nonce to allowlist the inline script under a strict CSP.
239
+ * @returns {JSX.Element} A script tag injected before first paint.
240
+ * @see preloadFontLink
241
+ * @see PreloadFont
242
+ * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce
243
+ */
244
+ declare const PreventWrongThemeFlashScript: ({ nonce }: PreventWrongThemeFlashScriptProps) => import("react").JSX.Element;
222
245
  type InitialThemeProps = {
223
246
  className: string;
224
247
  "data-applied-theme": ResolvedTheme;
@@ -349,9 +372,25 @@ type PreloadFontProps = {
349
372
  * ```
350
373
  */
351
374
  declare function preloadFontLink(name: CoreFontName): string;
352
- declare function PreloadFont({ name }: PreloadFontProps): import("react").JSX.Element;
353
- declare namespace PreloadFont {
354
- var displayName: string;
355
- }
375
+ /**
376
+ * Preloads a single core font by name.
377
+ *
378
+ * Use this when you only need one or two specific fonts rather than all core
379
+ * fonts. Include it as early as possible in the document `<head>`.
380
+ *
381
+ * @remarks
382
+ * For best performance, pair this with preconnect/dns-prefetch hints to the CDN.
383
+ *
384
+ * @example
385
+ * ```tsx
386
+ * <head>
387
+ * <link rel="preconnect" href={assetsCdnOrigin} crossOrigin="anonymous" />
388
+ * <link rel="dns-prefetch" href={assetsCdnOrigin} />
389
+ * <PreloadFont name="roobert" />
390
+ * <PreloadFont name="jetbrains-mono" />
391
+ * </head>
392
+ * ```
393
+ */
394
+ declare const PreloadFont: ({ name }: PreloadFontProps) => import("react").JSX.Element;
356
395
  //#endregion
357
396
  export { $resolvedTheme, $theme, type CoreFontName, MantleStyleSheets, type MantleStyleSheetsProps, type MantleThemeCssUrls, PreloadFont, PreventWrongThemeFlashScript, type ResolvedTheme, type Theme, ThemeProvider, assetsCdnOrigin, extractThemeCookie, fixMediaScriptContent, fontHref, getStoredTheme, isResolvedTheme, isTheme, mantleStyleSheetUrls, preloadFontLink, preventWrongThemeFlashScriptContent, readThemeFromHtmlElement, resolvedThemes, themes, useAppliedTheme, useInitialHtmlThemeProps, useTheme };
package/dist/theme.js CHANGED
@@ -1 +1 @@
1
- import{a as e,c as t,d as n,f as r,h as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./theme-provider-C9zpDyJW.js";import{useEffect as h}from"react";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";const y=`mantle-dark-styles`,b=`mantle-light-high-contrast-styles`,x=`mantle-dark-high-contrast-styles`,S=`(prefers-color-scheme: dark)`,C=`(prefers-contrast: more) and (prefers-color-scheme: light)`,w=`(prefers-contrast: more) and (prefers-color-scheme: dark)`;function T(e,t){let n=t??e;return{dark:n===`dark`?`all`:S,lightHighContrast:n===`light-high-contrast`?`all`:C,darkHighContrast:n===`dark-high-contrast`?`all`:w}}function E(e){return e}function D(e){let{darkLinkId:t,lightHcLinkId:n,darkHcLinkId:r,mediaDark:i,mediaLightHc:a,mediaDarkHc:o,forceTheme:s}=e,c=document.documentElement.dataset.appliedTheme,l=s??c,u=document.getElementById(t),d=document.getElementById(n),f=document.getElementById(r);u&&(u.media=l===`dark`?`all`:i),d&&(d.media=l===`light-high-contrast`?`all`:a),f&&(f.media=l===`dark-high-contrast`?`all`:o)}function O(e){let t={darkLinkId:y,lightHcLinkId:b,darkHcLinkId:x,mediaDark:S,mediaLightHc:C,mediaDarkHc:w,forceTheme:e};return`(${D.toString()})(${JSON.stringify(t)})`}function k({darkCssUrl:e,lightHighContrastCssUrl:t,darkHighContrastCssUrl:n,forceTheme:i,nonce:o,ssrCookie:s}){h(()=>{function e(){let e=document.documentElement.dataset.appliedTheme;return r(e)?e:void 0}function t(){let{dark:t,lightHighContrast:n,darkHighContrast:r}=T(e(),i),a=document.getElementById(y),o=document.getElementById(b),s=document.getElementById(x);a&&(a.media=t),o&&(o.media=n),s&&(s.media=r)}t();let n=new MutationObserver(t);return n.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-applied-theme`]}),()=>{n.disconnect()}},[i]);let c=s==null?void 0:a({cookie:s}),l=c===`system`?void 0:c,{dark:u,lightHighContrast:d,darkHighContrast:f}=T(l,i);return v(g,{children:[(!i||i===`dark`)&&_(`link`,{rel:`stylesheet`,id:y,href:e,media:u,suppressHydrationWarning:!0}),(!i||i===`light-high-contrast`)&&_(`link`,{rel:`stylesheet`,id:b,href:t,media:d,suppressHydrationWarning:!0}),(!i||i===`dark-high-contrast`)&&_(`link`,{rel:`stylesheet`,id:x,href:n,media:f,suppressHydrationWarning:!0}),!i&&l==null&&_(`script`,{dangerouslySetInnerHTML:{__html:O(i)},nonce:o,suppressHydrationWarning:!0})]})}k.displayName=`MantleStyleSheets`;const A=`https://assets.ngrok.com`,j=`${A}/fonts`,M={roobert:`/roobert/roobert-proportional-vf.woff2`,"jetbrains-mono":`/jetbrains/jetbrainsmono-wght.woff2`,"jetbrains-mono-italic":`/jetbrains/jetbrainsmono-italic-wght.woff2`,"family-regular":`/family/family-regular.woff2`,"family-italic":`/family/family-italic.woff2`};function N(e){let t=e.startsWith(`/`)?e:`/${e}`;return`${j}${t}`}function P(e){return`<${N(M[e])}>; rel=preload; as=font; type="font/woff2"; crossorigin`}const F=({name:e})=>_(`link`,{rel:`preload`,href:N(M[e]),as:`font`,type:`font/woff2`,crossOrigin:`anonymous`});F.displayName=`PreloadFont`;export{m as $resolvedTheme,n as $theme,k as MantleStyleSheets,F as PreloadFont,p as PreventWrongThemeFlashScript,c as ThemeProvider,A as assetsCdnOrigin,d as extractThemeCookie,O as fixMediaScriptContent,N as fontHref,a as getStoredTheme,r as isResolvedTheme,u as isTheme,E as mantleStyleSheetUrls,P as preloadFontLink,e as preventWrongThemeFlashScriptContent,l as readThemeFromHtmlElement,s as resolvedThemes,i as themes,f as useAppliedTheme,t as useInitialHtmlThemeProps,o as useTheme};
1
+ import{a as e,c as t,d as n,f as r,h as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"./theme-C26-Xolp.js";import{useEffect as h}from"react";import{Fragment as g,jsx as _,jsxs as v}from"react/jsx-runtime";const y=`mantle-dark-styles`,b=`mantle-light-high-contrast-styles`,x=`mantle-dark-high-contrast-styles`,S=`(prefers-color-scheme: dark)`,C=`(prefers-contrast: more) and (prefers-color-scheme: light)`,w=`(prefers-contrast: more) and (prefers-color-scheme: dark)`;function T(e,t){let n=t??e;return{dark:n===`dark`?`all`:S,lightHighContrast:n===`light-high-contrast`?`all`:C,darkHighContrast:n===`dark-high-contrast`?`all`:w}}function E(e){return e}function D(e){let{darkLinkId:t,lightHcLinkId:n,darkHcLinkId:r,mediaDark:i,mediaLightHc:a,mediaDarkHc:o,forceTheme:s}=e,c=document.documentElement.dataset.appliedTheme,l=s??c,u=document.getElementById(t),d=document.getElementById(n),f=document.getElementById(r);u&&(u.media=l===`dark`?`all`:i),d&&(d.media=l===`light-high-contrast`?`all`:a),f&&(f.media=l===`dark-high-contrast`?`all`:o)}function O(e){let t={darkLinkId:y,lightHcLinkId:b,darkHcLinkId:x,mediaDark:S,mediaLightHc:C,mediaDarkHc:w,forceTheme:e};return`(${D.toString()})(${JSON.stringify(t)})`}function k({darkCssUrl:e,lightHighContrastCssUrl:t,darkHighContrastCssUrl:n,forceTheme:i,nonce:o,ssrCookie:s}){h(()=>{function e(){let e=document.documentElement.dataset.appliedTheme;return r(e)?e:void 0}function t(){let{dark:t,lightHighContrast:n,darkHighContrast:r}=T(e(),i),a=document.getElementById(y),o=document.getElementById(b),s=document.getElementById(x);a&&(a.media=t),o&&(o.media=n),s&&(s.media=r)}t();let n=new MutationObserver(t);return n.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-applied-theme`]}),()=>{n.disconnect()}},[i]);let c=s==null?void 0:a({cookie:s}),l=c===`system`?void 0:c,{dark:u,lightHighContrast:d,darkHighContrast:f}=T(l,i);return v(g,{children:[(!i||i===`dark`)&&_(`link`,{rel:`stylesheet`,id:y,href:e,media:u,suppressHydrationWarning:!0}),(!i||i===`light-high-contrast`)&&_(`link`,{rel:`stylesheet`,id:b,href:t,media:d,suppressHydrationWarning:!0}),(!i||i===`dark-high-contrast`)&&_(`link`,{rel:`stylesheet`,id:x,href:n,media:f,suppressHydrationWarning:!0}),!i&&l==null&&_(`script`,{dangerouslySetInnerHTML:{__html:O(i)},nonce:o,suppressHydrationWarning:!0})]})}const A=`https://assets.ngrok.com`,j=`${A}/fonts`,M={roobert:`/roobert/roobert-proportional-vf.woff2`,"jetbrains-mono":`/jetbrains/jetbrainsmono-wght.woff2`,"jetbrains-mono-italic":`/jetbrains/jetbrainsmono-italic-wght.woff2`,"family-regular":`/family/family-regular.woff2`,"family-italic":`/family/family-italic.woff2`};function N(e){let t=e.startsWith(`/`)?e:`/${e}`;return`${j}${t}`}function P(e){return`<${N(M[e])}>; rel=preload; as=font; type="font/woff2"; crossorigin`}const F=({name:e})=>_(`link`,{rel:`preload`,href:N(M[e]),as:`font`,type:`font/woff2`,crossOrigin:`anonymous`});export{m as $resolvedTheme,n as $theme,k as MantleStyleSheets,F as PreloadFont,p as PreventWrongThemeFlashScript,c as ThemeProvider,A as assetsCdnOrigin,d as extractThemeCookie,O as fixMediaScriptContent,N as fontHref,a as getStoredTheme,r as isResolvedTheme,u as isTheme,E as mantleStyleSheetUrls,P as preloadFontLink,e as preventWrongThemeFlashScriptContent,l as readThemeFromHtmlElement,s as resolvedThemes,i as themes,f as useAppliedTheme,t as useInitialHtmlThemeProps,o as useTheme};