@ngrok/mantle 0.80.0 → 0.81.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.
- package/dist/accordion.d.ts +19 -37
- package/dist/accordion.js +1 -1
- package/dist/agent.json +5 -1
- package/dist/alert-dialog.d.ts +15 -48
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +167 -83
- package/dist/alert.js +1 -1
- package/dist/{anchor-_2meGDfj.js → anchor-DfeXTpKW.js} +1 -1
- package/dist/anchor.js +1 -1
- package/dist/area-chart.d.ts +505 -0
- package/dist/area-chart.js +1 -0
- package/dist/badge.js +1 -1
- package/dist/bar-chart.d.ts +492 -0
- package/dist/bar-chart.js +1 -0
- package/dist/breadcrumb.d.ts +6 -24
- package/dist/breadcrumb.js +1 -1
- package/dist/button-BAno7KIU.js +1 -0
- package/dist/{index-C2jj8U4a.d.ts → button-C-gMbPso.d.ts} +2 -2
- package/dist/{icon-button-C1AfGnQx.d.ts → button-C7vAl6lS.d.ts} +16 -3
- package/dist/{button-BPMwa2jN.d.ts → button-DARFK2KJ.d.ts} +1 -1
- package/dist/{button-5WsvzIQ6.js → button-DjpEKt2X.js} +1 -1
- package/dist/button-DvHMWAPl.js +1 -0
- package/dist/button.d.ts +5 -5
- package/dist/button.js +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +5 -20
- package/dist/card.js +1 -1
- package/dist/centered-layout.d.ts +5 -20
- package/dist/centered-layout.js +1 -1
- package/dist/chart-1cVjAcj8.d.ts +334 -0
- package/dist/chart-Do2qkrxl.js +2 -0
- package/dist/checkbox-0EoxOyMA.js +1 -0
- package/dist/checkbox.d.ts +13 -1
- package/dist/checkbox.js +1 -1
- package/dist/choice-BHwFSSyv.js +1 -0
- package/dist/{choice-Ct0KK8jw.d.ts → choice-BNRQXszu.d.ts} +5 -20
- package/dist/choice.d.ts +1 -1
- package/dist/choice.js +1 -1
- package/dist/code-block.d.ts +60 -44
- package/dist/code-block.js +6 -6
- package/dist/code-block_highlight-utils.d.ts +1 -1
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/combobox.d.ts +9 -33
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +70 -18
- package/dist/command.js +1 -1
- package/dist/data-table.d.ts +6 -12
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +40 -32
- package/dist/description-list.js +1 -1
- package/dist/{primitive-CJRIlrLz.d.ts → dialog-BM4wPCft.d.ts} +9 -16
- package/dist/dialog-DWZWd5Jt.js +1 -0
- package/dist/dialog.d.ts +13 -43
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu-BbbQuae2.d.ts +1 -0
- package/dist/{dropdown-menu-CoyozLzy.d.ts → dropdown-menu-D6pMAY7I.d.ts} +156 -54
- package/dist/dropdown-menu-RyDWoKHx.js +1 -0
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +6 -21
- package/dist/empty.js +1 -1
- package/dist/field-B1wqeZr4.js +1 -0
- package/dist/field.d.ts +26 -53
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +1 -1
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +3 -12
- package/dist/hover-card.js +1 -1
- package/dist/{svg-only-CdI_v82i.d.ts → icon-CX_gj6sW.d.ts} +1 -1
- package/dist/{icon-BDqpcZ-n.d.ts → icon-k4E9yNWD.d.ts} +1 -1
- package/dist/icon-lZ48P8Nn.js +1 -0
- package/dist/icon.d.ts +3 -3
- package/dist/icon.js +1 -1
- package/dist/icons-DLCs1hLP.js +1 -0
- package/dist/icons.d.ts +53 -2
- package/dist/icons.js +1 -1
- package/dist/input-BnlpQF0c.js +1 -0
- package/dist/{input-DV9M6K4v.d.ts → input-BuYDU6CF.d.ts} +1 -1
- package/dist/input.d.ts +2 -2
- package/dist/input.js +1 -1
- package/dist/line-chart.d.ts +491 -0
- package/dist/line-chart.js +1 -0
- package/dist/{virtual-UrzmaSQm.js → list-51KQvENW.js} +1 -1
- package/dist/list.d.ts +5 -20
- package/dist/list.js +1 -1
- package/dist/llms.txt +5 -1
- package/dist/mantle-dark-high-contrast.css +17 -0
- package/dist/mantle-dark.css +13 -0
- package/dist/mantle-light-high-contrast.css +15 -0
- package/dist/mantle.css +29 -0
- package/dist/media-object.d.ts +45 -12
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +14 -53
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +5 -17
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +11 -21
- package/dist/pagination.js +1 -1
- package/dist/{index-B8mIWKIU.d.ts → popover-CE4OlWkd.d.ts} +1 -4
- package/dist/popover-CQ9s7jG5.js +1 -0
- package/dist/popover.d.ts +1 -1
- package/dist/popover.js +1 -1
- package/dist/primitive-trJDqIXJ.js +1 -0
- package/dist/progress.d.ts +2 -8
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +4 -16
- package/dist/qr-code.js +1 -1
- package/dist/radio-group.d.ts +129 -40
- package/dist/radio-group.js +1 -1
- package/dist/sandboxed-on-click.d.ts +2 -2
- package/dist/scatter-plot.d.ts +495 -0
- package/dist/scatter-plot.js +1 -0
- package/dist/{select-idm1jy7y.d.ts → select-0z7HVS6r.d.ts} +8 -29
- package/dist/select-BCHWvmyC.js +1 -0
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +11 -38
- package/dist/selectable-list.js +1 -1
- package/dist/sheet.d.ts +22 -49
- package/dist/sheet.js +1 -1
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.js +1 -1
- package/dist/slot.d.ts +1 -1
- package/dist/split-button.d.ts +155 -31
- package/dist/split-button.js +1 -1
- package/dist/switch.d.ts +1 -1
- package/dist/switch.js +1 -1
- package/dist/table-CGxJwtbL.js +1 -0
- package/dist/{table-DUSvU_Jw.d.ts → table-CZBYEmyK.d.ts} +11 -38
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +21 -36
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +2 -2
- package/dist/text-area.js +1 -1
- package/dist/theme-C26-Xolp.js +1 -0
- package/dist/{themes-CYNpplwN.d.ts → theme-FbfjYiD3.d.ts} +16 -0
- package/dist/theme-switcher.d.ts +6 -15
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.d.ts +42 -2
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +9 -17
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +26 -8
- package/dist/tooltip.js +1 -1
- package/dist/types.js +1 -1
- package/package.json +20 -14
- package/dist/checkbox-Cq17y0-R.js +0 -1
- package/dist/choice-Cc8dA5r8.js +0 -1
- package/dist/dialog-CQ2C6vkE.js +0 -1
- package/dist/dropdown-menu-CSCDdA3K.js +0 -1
- package/dist/field-context-BR01g789.js +0 -1
- package/dist/icon-CGgMKpJg.js +0 -1
- package/dist/icon-button-DiOhreJD.js +0 -1
- package/dist/index-CdPXa9h1.d.ts +0 -1
- package/dist/input-CVyAVbim.js +0 -1
- package/dist/popover-CBMADtjV.js +0 -1
- package/dist/primitive-DCPHJsRs.js +0 -1
- package/dist/select-SR_9-bxA.js +0 -1
- package/dist/table-GDkapNFi.js +0 -1
- package/dist/theme-provider-BftkIiZn.js +0 -1
- package/dist/theme-wVnzzx2F.js +0 -1
- package/dist/toast-DKgMRv4F.js +0 -1
- /package/dist/{sizes-BCoI4bhP.d.ts → button-BCoI4bhP.d.ts} +0 -0
- /package/dist/{intents-DdSKSj1c.d.ts → button-DdSKSj1c.d.ts} +0 -0
- /package/dist/{resolve-pre-rendered-props-B6OlZrSI.d.ts → code-block-B6OlZrSI.d.ts} +0 -0
- /package/dist/{resolve-pre-rendered-props-C9uaM9-V.js → code-block-C9uaM9-V.js} +0 -0
- /package/dist/{validation-7QeiTFwl.d.ts → field-7QeiTFwl.d.ts} +0 -0
- /package/dist/{validation-Bpptk_9t.js → field-Bpptk_9t.js} +0 -0
- /package/dist/{types-D1RY5Tcj.d.ts → icon-D1RY5Tcj.d.ts} +0 -0
- /package/dist/{svg-only-d-nMCfAI.js → icon-d-nMCfAI.js} +0 -0
- /package/dist/{sort-B_DDQcVD.js → icons-B_DDQcVD.js} +0 -0
- /package/dist/{traffic-policy-file-CF1lbWtp.js → icons-CF1lbWtp.js} +0 -0
- /package/dist/{is-input-CXmS0OFN.js → input-CXmS0OFN.js} +0 -0
- /package/dist/{index-BtwKJTLq.d.ts → slot-BtwKJTLq.d.ts} +0 -0
package/dist/switch.d.ts
CHANGED
package/dist/switch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./booleanish-BfvnW6vy.js";import{t as n}from"./clsx-DUGZgXfJ.js";import{a as r,r as i}from"./
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./booleanish-BfvnW6vy.js";import{t as n}from"./clsx-DUGZgXfJ.js";import{a as r,r as i}from"./field-Bpptk_9t.js";import{jsx as a}from"react/jsx-runtime";import{Root as o,Thumb as s}from"@radix-ui/react-switch";const c=({"aria-invalid":c,"aria-readonly":l,className:u,readOnly:d,onClick:f,ref:p,validation:m,...h})=>{let g=t(d??l),_=r(),{ariaInvalid:v,validation:y}=i({"aria-invalid":c,validation:m??_});return a(o,{"aria-invalid":v,"aria-readonly":g,"data-slot":`switch`,"data-validation":y||void 0,className:e(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full outline-hidden`,`disabled:cursor-default disabled:opacity-50`,`focus-visible:border-accent-600 focus-visible:ring-focus-accent focus-visible:outline-hidden focus-visible:ring-4`,`data-state-checked:bg-accent-600 data-state-unchecked:bg-gray-400`,`data-validation-success:data-state-checked:bg-success-600 focus-visible:data-validation-success:ring-focus-success`,`data-validation-warning:data-state-checked:bg-warning-600 focus-visible:data-validation-warning:ring-focus-warning`,`data-validation-error:data-state-checked:bg-danger-600 focus-visible:data-validation-error:ring-focus-danger`,u),onClick:e=>{if(g){e.preventDefault(),e.stopPropagation();return}f?.(e)},ref:p,...h,children:a(s,{className:n(`pointer-events-none block size-4 rounded-full bg-[#fff] shadow-md ring-0 transition-transform`,`data-state-checked:translate-x-4.5 data-state-unchecked:translate-x-0.5`)})})};export{c as Switch};
|
|
@@ -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};
|
|
@@ -42,10 +42,7 @@ import { ComponentProps } from "react";
|
|
|
42
42
|
*
|
|
43
43
|
* @see https://mantle.ngrok.com/components/data-display/table#tableroot
|
|
44
44
|
*/
|
|
45
|
-
declare const Root: {
|
|
46
|
-
({ children, className, ref, ...props }: ComponentProps<"div">): import("react").JSX.Element;
|
|
47
|
-
displayName: string;
|
|
48
|
-
};
|
|
45
|
+
declare const Root: ({ children, className, ref, ...props }: ComponentProps<"div">) => import("react").JSX.Element;
|
|
49
46
|
/**
|
|
50
47
|
* The `<Table.Element>` is a structured way to display data in rows and columns. The API
|
|
51
48
|
* matches the HTML `<table>` element 1:1.
|
|
@@ -111,10 +108,7 @@ declare const Root: {
|
|
|
111
108
|
*
|
|
112
109
|
* @see https://mantle.ngrok.com/components/data-display/table#tableelement
|
|
113
110
|
*/
|
|
114
|
-
declare const Element: {
|
|
115
|
-
({ children, className, ref, ...props }: ComponentProps<"table">): import("react").JSX.Element;
|
|
116
|
-
displayName: string;
|
|
117
|
-
};
|
|
111
|
+
declare const Element: ({ children, className, ref, ...props }: ComponentProps<"table">) => import("react").JSX.Element;
|
|
118
112
|
/**
|
|
119
113
|
* The `<Table.Head>` is a container for the table's column headers.
|
|
120
114
|
* Encapsulates a set of `<Table.Row>`s, indicating that they comprise the head
|
|
@@ -160,12 +154,9 @@ declare const Element: {
|
|
|
160
154
|
* </Table.Root>
|
|
161
155
|
* ```
|
|
162
156
|
*
|
|
163
|
-
* @see https://mantle.ngrok.com/components/data-display/table#
|
|
157
|
+
* @see https://mantle.ngrok.com/components/data-display/table#tablehead
|
|
164
158
|
*/
|
|
165
|
-
declare const Head: {
|
|
166
|
-
({ children, className, ref, ...props }: ComponentProps<"thead">): import("react").JSX.Element;
|
|
167
|
-
displayName: string;
|
|
168
|
-
};
|
|
159
|
+
declare const Head: ({ children, className, ref, ...props }: ComponentProps<"thead">) => import("react").JSX.Element;
|
|
169
160
|
/**
|
|
170
161
|
* The `<Table.Body>` encapsulates a set of `<Table.Row>`s, indicating that they
|
|
171
162
|
* comprise the body of a table's (main) data.
|
|
@@ -211,10 +202,7 @@ declare const Head: {
|
|
|
211
202
|
*
|
|
212
203
|
* @see https://mantle.ngrok.com/components/data-display/table#tablebody
|
|
213
204
|
*/
|
|
214
|
-
declare const Body: {
|
|
215
|
-
({ children, className, ref, ...props }: ComponentProps<"tbody">): import("react").JSX.Element;
|
|
216
|
-
displayName: string;
|
|
217
|
-
};
|
|
205
|
+
declare const Body: ({ children, className, ref, ...props }: ComponentProps<"tbody">) => import("react").JSX.Element;
|
|
218
206
|
/**
|
|
219
207
|
* The `<Table.Foot>` encapsulates a set of `<Table.Row>`s, indicating that they
|
|
220
208
|
* comprise the foot of a table with information about the table's columns. This
|
|
@@ -262,10 +250,7 @@ declare const Body: {
|
|
|
262
250
|
*
|
|
263
251
|
* @see https://mantle.ngrok.com/components/data-display/table#tablefoot
|
|
264
252
|
*/
|
|
265
|
-
declare const Foot: {
|
|
266
|
-
({ children, className, ref, ...props }: ComponentProps<"tfoot">): import("react").JSX.Element;
|
|
267
|
-
displayName: string;
|
|
268
|
-
};
|
|
253
|
+
declare const Foot: ({ children, className, ref, ...props }: ComponentProps<"tfoot">) => import("react").JSX.Element;
|
|
269
254
|
/**
|
|
270
255
|
* The `<Table.Row>` defines a row of cells in a table. The row's cells can then
|
|
271
256
|
* be established using a mix of `<Table.Cell>` and `<Table.Header>` components.
|
|
@@ -310,10 +295,7 @@ declare const Foot: {
|
|
|
310
295
|
*
|
|
311
296
|
* @see https://mantle.ngrok.com/components/data-display/table#tablerow
|
|
312
297
|
*/
|
|
313
|
-
declare const Row: {
|
|
314
|
-
({ children, className, ref, ...props }: ComponentProps<"tr">): import("react").JSX.Element;
|
|
315
|
-
displayName: string;
|
|
316
|
-
};
|
|
298
|
+
declare const Row: ({ children, className, ref, ...props }: ComponentProps<"tr">) => import("react").JSX.Element;
|
|
317
299
|
/**
|
|
318
300
|
* The `<Table.Header>` defines a cell as the header of a group of table cells
|
|
319
301
|
* and may be used as a child of a `<Table.Row>`. The exact nature of this group
|
|
@@ -360,10 +342,7 @@ declare const Row: {
|
|
|
360
342
|
*
|
|
361
343
|
* @see https://mantle.ngrok.com/components/data-display/table#tableheader
|
|
362
344
|
*/
|
|
363
|
-
declare const Header: {
|
|
364
|
-
({ children, className, ref, ...props }: ComponentProps<"th">): import("react").JSX.Element;
|
|
365
|
-
displayName: string;
|
|
366
|
-
};
|
|
345
|
+
declare const Header: ({ children, className, ref, ...props }: ComponentProps<"th">) => import("react").JSX.Element;
|
|
367
346
|
/**
|
|
368
347
|
* The `<Table.Cell>` defines a cell of a table that contains data and may be
|
|
369
348
|
* used as a child of a `<Table.Row>`.
|
|
@@ -408,10 +387,7 @@ declare const Header: {
|
|
|
408
387
|
*
|
|
409
388
|
* @see https://mantle.ngrok.com/components/data-display/table#tablecell
|
|
410
389
|
*/
|
|
411
|
-
declare const Cell: {
|
|
412
|
-
({ children, className, ref, ...props }: ComponentProps<"td">): import("react").JSX.Element;
|
|
413
|
-
displayName: string;
|
|
414
|
-
};
|
|
390
|
+
declare const Cell: ({ children, className, ref, ...props }: ComponentProps<"td">) => import("react").JSX.Element;
|
|
415
391
|
/**
|
|
416
392
|
* The optional `<Table.Caption>` specifies the caption (or title) of a table,
|
|
417
393
|
* providing the table an accessible description.
|
|
@@ -456,10 +432,7 @@ declare const Cell: {
|
|
|
456
432
|
*
|
|
457
433
|
* @see https://mantle.ngrok.com/components/data-display/table#tablecaption
|
|
458
434
|
*/
|
|
459
|
-
declare const Caption: {
|
|
460
|
-
({ children, className, ref, ...props }: ComponentProps<"caption">): import("react").JSX.Element;
|
|
461
|
-
displayName: string;
|
|
462
|
-
};
|
|
435
|
+
declare const Caption: ({ children, className, ref, ...props }: ComponentProps<"caption">) => import("react").JSX.Element;
|
|
463
436
|
/**
|
|
464
437
|
* Use `Table` for STATIC, layout-driven tabular data — read-only data dumps,
|
|
465
438
|
* simple key/value displays, plain markup tables. The API matches the HTML
|
|
@@ -717,7 +690,7 @@ declare const Table: {
|
|
|
717
690
|
/**
|
|
718
691
|
* The head section of a table. Contains the table's column headers information.
|
|
719
692
|
*
|
|
720
|
-
* @see https://mantle.ngrok.com/components/data-display/table#
|
|
693
|
+
* @see https://mantle.ngrok.com/components/data-display/table#tablehead
|
|
721
694
|
*
|
|
722
695
|
* @example
|
|
723
696
|
* ```tsx
|
package/dist/table.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Table } from "./table-
|
|
1
|
+
import { t as Table } from "./table-CZBYEmyK.js";
|
|
2
2
|
export { Table };
|
package/dist/table.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./table-
|
|
1
|
+
import{t as e}from"./table-CGxJwtbL.js";export{e as Table};
|
package/dist/tabs.d.ts
CHANGED
|
@@ -23,17 +23,14 @@ import { Content, List, Root, Trigger } from "@radix-ui/react-tabs";
|
|
|
23
23
|
* </Tabs.Root>
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
declare const Root$1: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}): import("react").JSX.Element;
|
|
35
|
-
displayName: string;
|
|
36
|
-
};
|
|
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;
|
|
37
34
|
/**
|
|
38
35
|
* Contains the triggers that are aligned along the edge of the active content.
|
|
39
36
|
* The container for tab triggers that provides the visual layout for tab navigation.
|
|
@@ -67,19 +64,16 @@ declare const Root$1: {
|
|
|
67
64
|
* </Tabs.List>
|
|
68
65
|
* ```
|
|
69
66
|
*/
|
|
70
|
-
declare const List$1: {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}): import("react").JSX.Element;
|
|
81
|
-
displayName: string;
|
|
82
|
-
};
|
|
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;
|
|
83
77
|
type TabsTriggerProps = ComponentProps<typeof Trigger>;
|
|
84
78
|
/**
|
|
85
79
|
* The button that activates its associated content.
|
|
@@ -100,10 +94,7 @@ type TabsTriggerProps = ComponentProps<typeof Trigger>;
|
|
|
100
94
|
* </Tabs.Root>
|
|
101
95
|
* ```
|
|
102
96
|
*/
|
|
103
|
-
declare const Trigger$1: {
|
|
104
|
-
({ "aria-disabled": _ariaDisabled, asChild, children, className, disabled: _disabled, ref, ...props }: TabsTriggerProps): import("react").JSX.Element;
|
|
105
|
-
displayName: string;
|
|
106
|
-
};
|
|
97
|
+
declare const Trigger$1: ({ "aria-disabled": _ariaDisabled, asChild, children, className, disabled: _disabled, ref, ...props }: TabsTriggerProps) => import("react").JSX.Element;
|
|
107
98
|
/**
|
|
108
99
|
* A badge component that can be used inside tab triggers to display additional information.
|
|
109
100
|
* Typically used to show counts or status indicators within tab headers.
|
|
@@ -122,10 +113,7 @@ declare const Trigger$1: {
|
|
|
122
113
|
* </Tabs.Root>
|
|
123
114
|
* ```
|
|
124
115
|
*/
|
|
125
|
-
declare const Badge: {
|
|
126
|
-
({ className, children, ...props }: HTMLAttributes<HTMLSpanElement>): import("react").JSX.Element;
|
|
127
|
-
displayName: string;
|
|
128
|
-
};
|
|
116
|
+
declare const Badge: ({ className, children, ...props }: HTMLAttributes<HTMLSpanElement>) => import("react").JSX.Element;
|
|
129
117
|
/**
|
|
130
118
|
* Contains the content associated with each trigger.
|
|
131
119
|
* The content panel that displays when its corresponding tab trigger is active.
|
|
@@ -148,10 +136,7 @@ declare const Badge: {
|
|
|
148
136
|
* </Tabs.Root>
|
|
149
137
|
* ```
|
|
150
138
|
*/
|
|
151
|
-
declare const Content$1: {
|
|
152
|
-
({ className, ...props }: ComponentProps<typeof Content>): import("react").JSX.Element;
|
|
153
|
-
displayName: string;
|
|
154
|
-
};
|
|
139
|
+
declare const Content$1: ({ className, ...props }: ComponentProps<typeof Content>) => import("react").JSX.Element;
|
|
155
140
|
/**
|
|
156
141
|
* A set of layered sections of content—known as tab panels—that are displayed one at a time.
|
|
157
142
|
* The root component that provides context for all tab components.
|
package/dist/tabs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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})})}
|
|
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};
|
package/dist/text-area.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as WithValidation } from "./
|
|
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 & {
|
|
@@ -30,4 +30,4 @@ type Props = ComponentProps<"textarea"> & WithValidation & {
|
|
|
30
30
|
*/
|
|
31
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
|
-
export { TextArea };
|
|
33
|
+
export { TextArea, type Props as TextAreaProps };
|
package/dist/text-area.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./cx-IiQEAKf5.js";import{a as n,r}from"./
|
|
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,34 +1,50 @@
|
|
|
1
1
|
//#region src/components/theme/themes.d.ts
|
|
2
2
|
/**
|
|
3
3
|
* resolvedThemes is a tuple of valid themes that have been resolved from "system" to a specific theme.
|
|
4
|
+
*
|
|
5
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
4
6
|
*/
|
|
5
7
|
declare const resolvedThemes: readonly ["light", "dark", "light-high-contrast", "dark-high-contrast"];
|
|
6
8
|
/**
|
|
7
9
|
* ResolvedTheme is a type that represents a theme that has been resolved from "system" to a specific theme.
|
|
10
|
+
*
|
|
11
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
8
12
|
*/
|
|
9
13
|
type ResolvedTheme = (typeof resolvedThemes)[number];
|
|
10
14
|
/**
|
|
11
15
|
* themes is a tuple of valid themes.
|
|
16
|
+
*
|
|
17
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
12
18
|
*/
|
|
13
19
|
declare const themes: readonly ["system", "light", "dark", "light-high-contrast", "dark-high-contrast"];
|
|
14
20
|
/**
|
|
15
21
|
* Theme is a string literal type that represents a valid theme.
|
|
22
|
+
*
|
|
23
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
16
24
|
*/
|
|
17
25
|
type Theme = (typeof themes)[number];
|
|
18
26
|
/**
|
|
19
27
|
* $theme is a helper which translates the Theme type into a string literal type.
|
|
28
|
+
*
|
|
29
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
20
30
|
*/
|
|
21
31
|
declare const $theme: <T extends Theme = Theme>(value: T) => T;
|
|
22
32
|
/**
|
|
23
33
|
* Type predicate that checks if a value is a valid theme.
|
|
34
|
+
*
|
|
35
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
24
36
|
*/
|
|
25
37
|
declare function isTheme(value: unknown): value is Theme;
|
|
26
38
|
/**
|
|
27
39
|
* $resolvedTheme is a helper which translates the ResolvedTheme type into a string literal type.
|
|
40
|
+
*
|
|
41
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
28
42
|
*/
|
|
29
43
|
declare const $resolvedTheme: <T extends ResolvedTheme = ResolvedTheme>(value: T) => T;
|
|
30
44
|
/**
|
|
31
45
|
* Type predicate that checks if a value is a valid resolved theme.
|
|
46
|
+
*
|
|
47
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
32
48
|
*/
|
|
33
49
|
declare function isResolvedTheme(value: unknown): value is ResolvedTheme;
|
|
34
50
|
//#endregion
|
package/dist/theme-switcher.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as WithStyleProps } from "./with-style-props-Dq5Vntqy.js";
|
|
2
|
-
import { n as
|
|
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-
|
|
5
|
-
import "./
|
|
4
|
+
import { t as DropdownMenu } from "./dropdown-menu-D6pMAY7I.js";
|
|
5
|
+
import "./dropdown-menu-BbbQuae2.js";
|
|
6
6
|
import { ComponentProps } from "react";
|
|
7
7
|
//#region src/components/theme-switcher/theme-switcher.d.ts
|
|
8
8
|
/**
|
|
@@ -77,10 +77,7 @@ type ThemeSwitcherRootProps = ComponentProps<typeof DropdownMenu.Root>;
|
|
|
77
77
|
* </ThemeSwitcher.Root>
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
|
-
declare const Root:
|
|
81
|
-
(props: ThemeSwitcherRootProps): import("react").JSX.Element;
|
|
82
|
-
displayName: string;
|
|
83
|
-
};
|
|
80
|
+
declare const Root: (props: ThemeSwitcherRootProps) => import("react").JSX.Element;
|
|
84
81
|
/**
|
|
85
82
|
* The props for the `ThemeSwitcher.Trigger` component. Forwards
|
|
86
83
|
* `IconButton`'s props, except the parts the trigger owns: `icon` (the
|
|
@@ -124,10 +121,7 @@ type ThemeSwitcherTriggerProps = Omit<IconButtonProps, "appearance" | "asChild"
|
|
|
124
121
|
* </ThemeSwitcher.Root>
|
|
125
122
|
* ```
|
|
126
123
|
*/
|
|
127
|
-
declare const Trigger: {
|
|
128
|
-
({ appearance, "data-slot": dataSlot, disabled, label, ref, ...props }: ThemeSwitcherTriggerProps): import("react").JSX.Element;
|
|
129
|
-
displayName: string;
|
|
130
|
-
};
|
|
124
|
+
declare const Trigger: ({ appearance, "data-slot": dataSlot, disabled, label, ref, ...props }: ThemeSwitcherTriggerProps) => import("react").JSX.Element;
|
|
131
125
|
/**
|
|
132
126
|
* The props for the `ThemeSwitcher.Content` component. Identical to
|
|
133
127
|
* `DropdownMenu.Content`'s props — positioning and collision behavior
|
|
@@ -165,10 +159,7 @@ type ThemeSwitcherContentProps = ComponentProps<typeof DropdownMenu.Content> & W
|
|
|
165
159
|
* </ThemeSwitcher.Content>
|
|
166
160
|
* ```
|
|
167
161
|
*/
|
|
168
|
-
declare const Content: {
|
|
169
|
-
({ children, "data-slot": dataSlot, ...props }: ThemeSwitcherContentProps): import("react").JSX.Element;
|
|
170
|
-
displayName: string;
|
|
171
|
-
};
|
|
162
|
+
declare const Content: ({ children, "data-slot": dataSlot, ...props }: ThemeSwitcherContentProps) => import("react").JSX.Element;
|
|
172
163
|
/**
|
|
173
164
|
* The canonical picker for mantle's theme system: a compact `IconButton`
|
|
174
165
|
* trigger (ghost by default) that opens a `DropdownMenu` hosting
|
package/dist/theme-switcher.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./icon-
|
|
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,10 +1,12 @@
|
|
|
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 "./
|
|
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-FbfjYiD3.js";
|
|
2
2
|
import { PropsWithChildren } from "react";
|
|
3
3
|
//#region src/components/theme/mantle-style-sheets.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Browser-accessible URLs for mantle's three lazy-loaded theme stylesheets.
|
|
6
6
|
*
|
|
7
7
|
* Use {@link mantleStyleSheetUrls} to create this object from Vite `?url` imports.
|
|
8
|
+
*
|
|
9
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
8
10
|
*/
|
|
9
11
|
type MantleThemeCssUrls = {
|
|
10
12
|
/**
|
|
@@ -51,8 +53,16 @@ type MantleThemeCssUrls = {
|
|
|
51
53
|
* // In JSX:
|
|
52
54
|
* <MantleStyleSheets {...themeUrls} nonce={nonce} ssrCookie={ssrCookie} />
|
|
53
55
|
* ```
|
|
56
|
+
*
|
|
57
|
+
* @see https://mantle.ngrok.com/components/primitives/theme#mantlestylesheeturls
|
|
54
58
|
*/
|
|
55
59
|
declare function mantleStyleSheetUrls(urls: MantleThemeCssUrls): MantleThemeCssUrls;
|
|
60
|
+
/**
|
|
61
|
+
* Props for {@link MantleStyleSheets} — the three theme stylesheet URLs plus optional
|
|
62
|
+
* `forceTheme`, `ssrCookie`, and `nonce`.
|
|
63
|
+
*
|
|
64
|
+
* @see https://mantle.ngrok.com/components/primitives/theme#mantlestylesheets
|
|
65
|
+
*/
|
|
56
66
|
type MantleStyleSheetsProps = MantleThemeCssUrls & {
|
|
57
67
|
/**
|
|
58
68
|
* Force a specific resolved theme's stylesheet to load unconditionally (`media="all"`),
|
|
@@ -105,6 +115,8 @@ type MantleStyleSheetsProps = MantleThemeCssUrls & {
|
|
|
105
115
|
* Use this when you need to inline the script directly into SSR HTML outside of a React
|
|
106
116
|
* context — for example, in a legacy Go service that renders the initial HTML response.
|
|
107
117
|
*
|
|
118
|
+
* @see https://mantle.ngrok.com/components/primitives/theme#fixmediascriptcontent
|
|
119
|
+
*
|
|
108
120
|
* @example
|
|
109
121
|
* ```go
|
|
110
122
|
* // In a Go template, inline script content that was pre-generated by mantle
|
|
@@ -138,6 +150,8 @@ declare function fixMediaScriptContent(forceTheme?: ResolvedTheme): string;
|
|
|
138
150
|
* When `forceTheme` is set, only the link tag for that theme is rendered — the others are
|
|
139
151
|
* omitted entirely to avoid unnecessary network requests.
|
|
140
152
|
*
|
|
153
|
+
* @see https://mantle.ngrok.com/components/primitives/theme#mantlestylesheets
|
|
154
|
+
*
|
|
141
155
|
* @example
|
|
142
156
|
* ```tsx
|
|
143
157
|
* // root.tsx
|
|
@@ -169,7 +183,7 @@ type ThemeProviderProps = PropsWithChildren;
|
|
|
169
183
|
*
|
|
170
184
|
* @example
|
|
171
185
|
* ```tsx
|
|
172
|
-
* <ThemeProvider
|
|
186
|
+
* <ThemeProvider>
|
|
173
187
|
* <App />
|
|
174
188
|
* </ThemeProvider>
|
|
175
189
|
* ```
|
|
@@ -178,11 +192,15 @@ declare function ThemeProvider({ children }: ThemeProviderProps): import("react"
|
|
|
178
192
|
/**
|
|
179
193
|
* useTheme returns the current theme and a function to set the theme.
|
|
180
194
|
*
|
|
195
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
196
|
+
*
|
|
181
197
|
* @note This function will throw an error if used outside of a ThemeProvider context tree.
|
|
182
198
|
*/
|
|
183
199
|
declare function useTheme(): ThemeProviderState;
|
|
184
200
|
/**
|
|
185
201
|
* Read the theme and applied theme from the `<html>` element.
|
|
202
|
+
*
|
|
203
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
186
204
|
*/
|
|
187
205
|
declare function readThemeFromHtmlElement(): {
|
|
188
206
|
appliedTheme: "dark" | "dark-high-contrast" | "light" | "light-high-contrast" | undefined;
|
|
@@ -191,12 +209,16 @@ declare function readThemeFromHtmlElement(): {
|
|
|
191
209
|
/**
|
|
192
210
|
* If the theme is "system", it will resolve the theme based on the user's media query preferences, otherwise it will return the theme as is.
|
|
193
211
|
* This will mirror the result that gets applied to the <html> element.
|
|
212
|
+
*
|
|
213
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
194
214
|
*/
|
|
195
215
|
declare function useAppliedTheme(): "dark" | "dark-high-contrast" | "light" | "light-high-contrast";
|
|
196
216
|
/**
|
|
197
217
|
* preventWrongThemeFlashScriptContent generates a script that prevents the wrong theme from flashing on initial page load.
|
|
198
218
|
* It checks cookies for a stored theme, and if none is found, it sets the default theme.
|
|
199
219
|
* It also applies the correct theme to the `<html>` element based on the user's media query preferences.
|
|
220
|
+
*
|
|
221
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
200
222
|
*/
|
|
201
223
|
declare function preventWrongThemeFlashScriptContent(): string;
|
|
202
224
|
type PreventWrongThemeFlashScriptProps = {
|
|
@@ -220,6 +242,8 @@ type PreventWrongThemeFlashScriptProps = {
|
|
|
220
242
|
*
|
|
221
243
|
* Place this as early as possible in the `<head>`.
|
|
222
244
|
*
|
|
245
|
+
* @see https://mantle.ngrok.com/components/primitives/theme#preventwrongthemeflashscript
|
|
246
|
+
*
|
|
223
247
|
* @example
|
|
224
248
|
* ```tsx
|
|
225
249
|
* // entry.server.tsx — send font preloads as HTTP headers (preferred for SSR)
|
|
@@ -258,6 +282,8 @@ type UseInitialHtmlThemePropsOptions = {
|
|
|
258
282
|
};
|
|
259
283
|
/**
|
|
260
284
|
* useInitialHtmlThemeProps returns the initial props that should be applied to the <html> element to prevent react hydration errors.
|
|
285
|
+
*
|
|
286
|
+
* @see https://mantle.ngrok.com/components/primitives/theme#useinitialhtmlthemeprops
|
|
261
287
|
*/
|
|
262
288
|
declare function useInitialHtmlThemeProps(props?: UseInitialHtmlThemePropsOptions): InitialThemeProps;
|
|
263
289
|
type GetStoredThemeOptions = {
|
|
@@ -274,6 +300,8 @@ type GetStoredThemeOptions = {
|
|
|
274
300
|
* {@link DEFAULT_THEME}. This function never throws; malformed encodings or
|
|
275
301
|
* missing cookies quietly return the default.
|
|
276
302
|
*
|
|
303
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
304
|
+
*
|
|
277
305
|
* @example
|
|
278
306
|
* getStoredTheme({ cookie: `${THEME_STORAGE_KEY}=dark; session=abc` }) // "dark"
|
|
279
307
|
* @example
|
|
@@ -287,6 +315,8 @@ declare function getStoredTheme({ cookie }: GetStoredThemeOptions): Theme;
|
|
|
287
315
|
* {@link useInitialHtmlThemeProps} without exposing the full `Cookie` header
|
|
288
316
|
* (which may contain HttpOnly/session cookies) in serialized loader data.
|
|
289
317
|
*
|
|
318
|
+
* @see https://mantle.ngrok.com/components/primitives/theme#extractthemecookie
|
|
319
|
+
*
|
|
290
320
|
* @example
|
|
291
321
|
* ```ts
|
|
292
322
|
* // app/root.tsx loader
|
|
@@ -310,12 +340,16 @@ declare function extractThemeCookie(cookieHeader: string | null | undefined): st
|
|
|
310
340
|
* The origin for the assets CDN where custom ngrok fonts and assets are hosted.
|
|
311
341
|
*
|
|
312
342
|
* Keep this stable across the app so we can preconnect/DNS-prefetch consistently.
|
|
343
|
+
*
|
|
344
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
313
345
|
* @public
|
|
314
346
|
*/
|
|
315
347
|
declare const assetsCdnOrigin = "https://assets.ngrok.com";
|
|
316
348
|
declare const coreFontNames: readonly ["roobert", "jetbrains-mono", "jetbrains-mono-italic", "family-regular", "family-italic"];
|
|
317
349
|
/**
|
|
318
350
|
* Named keys identifying each individual core font.
|
|
351
|
+
*
|
|
352
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
319
353
|
* @public
|
|
320
354
|
*/
|
|
321
355
|
type CoreFontName = (typeof coreFontNames)[number];
|
|
@@ -323,6 +357,8 @@ type FontPath = `/${string}` | (string & {});
|
|
|
323
357
|
/**
|
|
324
358
|
* Builds an absolute CDN URL for a given font.
|
|
325
359
|
*
|
|
360
|
+
* @see https://mantle.ngrok.com/components/primitives/theme
|
|
361
|
+
*
|
|
326
362
|
* @returns {`https://assets.ngrok.com/fonts${T}`} An absolute, literal-typed CDN URL.
|
|
327
363
|
*
|
|
328
364
|
* @example
|
|
@@ -354,6 +390,8 @@ type PreloadFontProps = {
|
|
|
354
390
|
* addition to) an HTML `<link>` element. Sending this as a `Link` header lets
|
|
355
391
|
* the browser start the font fetch before it has parsed any HTML.
|
|
356
392
|
*
|
|
393
|
+
* @see https://mantle.ngrok.com/components/primitives/theme#preloadfontlink
|
|
394
|
+
*
|
|
357
395
|
* @remarks
|
|
358
396
|
* For best performance, also send a `preconnect` hint to {@link assetsCdnOrigin}
|
|
359
397
|
* in the same `Link` header.
|
|
@@ -378,6 +416,8 @@ declare function preloadFontLink(name: CoreFontName): string;
|
|
|
378
416
|
* Use this when you only need one or two specific fonts rather than all core
|
|
379
417
|
* fonts. Include it as early as possible in the document `<head>`.
|
|
380
418
|
*
|
|
419
|
+
* @see https://mantle.ngrok.com/components/primitives/theme#preloadfont
|
|
420
|
+
*
|
|
381
421
|
* @remarks
|
|
382
422
|
* For best performance, pair this with preconnect/dns-prefetch hints to the CDN.
|
|
383
423
|
*
|
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-
|
|
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};
|