@ngrok/mantle 0.77.0 → 0.78.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.
- package/dist/accordion.d.ts +63 -21
- package/dist/accordion.js +1 -1
- package/dist/agent.json +4 -1
- package/dist/alert-dialog.d.ts +19 -26
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +16 -24
- package/dist/alert.js +1 -1
- package/dist/{anchor-BtgEJoPN.js → anchor-C_tjSVy6.js} +1 -1
- package/dist/anchor.d.ts +3 -4
- package/dist/anchor.js +1 -1
- package/dist/{as-child-uN_018tj.d.ts → as-child-CYEVu1WY.d.ts} +0 -7
- package/dist/badge.d.ts +5 -56
- package/dist/badge.js +1 -1
- package/dist/breadcrumb.d.ts +212 -0
- package/dist/breadcrumb.js +1 -0
- package/dist/browser-only.d.ts +2 -6
- package/dist/{button-CERx95KE.js → button-5t6-JS_I.js} +1 -1
- package/dist/button-AS5Ir3DE.js +1 -0
- package/dist/{button-mfYak6Rx.d.ts → button-Bw9MpShl.d.ts} +26 -8
- package/dist/button.d.ts +5 -4
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +2 -8
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +8 -8
- package/dist/card.js +1 -1
- package/dist/centered-layout.d.ts +147 -0
- package/dist/centered-layout.js +1 -0
- package/dist/checkbox-DJ2xl7Rc.js +1 -0
- package/dist/checkbox.d.ts +9 -11
- package/dist/checkbox.js +1 -1
- package/dist/{choice-D6S38dPs.js → choice-DOdyNzFC.js} +1 -1
- package/dist/choice.d.ts +16 -14
- package/dist/choice.js +1 -1
- package/dist/code-block.d.ts +5 -17
- package/dist/code-block.js +1 -1
- package/dist/code-block_highlight-utils.d.ts +1 -1
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.d.ts +4 -5
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +40 -19
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +60 -38
- package/dist/command.js +1 -1
- package/dist/cx-IiQEAKf5.js +1 -0
- package/dist/cx.js +1 -1
- package/dist/data-slot-CChfb_cv.d.ts +17 -0
- package/dist/data-table.d.ts +45 -131
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +7 -7
- package/dist/description-list.js +1 -1
- package/dist/{dialog-uyJcNks7.js → dialog-DVDFVT_-.js} +1 -1
- package/dist/dialog.d.ts +155 -48
- package/dist/dialog.js +1 -1
- package/dist/{direction-CcTY0FmA.d.ts → direction-BjU0bPST.d.ts} +1 -1
- package/dist/{dropdown-menu-OEuW4GLp.js → dropdown-menu-ByUQkAvJ.js} +1 -1
- package/dist/{dropdown-menu-CADgs9gz.d.ts → dropdown-menu-DT30TQzL.d.ts} +21 -24
- package/dist/dropdown-menu.d.ts +2 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +133 -53
- package/dist/empty.js +1 -1
- package/dist/{field-context-4k1kI7Bo.js → field-context-BR01g789.js} +1 -1
- package/dist/field.d.ts +24 -36
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +2 -9
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +13 -15
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +34 -14
- package/dist/hover-card.js +1 -1
- package/dist/icon-CDtYjF_H.js +1 -0
- package/dist/{icon-n49kOh4_.d.ts → icon-Cevjo93X.d.ts} +2 -3
- package/dist/{icon-button-DiX9iZ9n.js → icon-button-CxVsZ2N1.js} +1 -1
- package/dist/{icon-button-D7hs6bX2.d.ts → icon-button-DuRSCsPh.d.ts} +5 -6
- package/dist/icon.d.ts +3 -3
- package/dist/icon.js +1 -1
- package/dist/icons.d.ts +7 -19
- package/dist/icons.js +1 -1
- package/dist/{in-view-bItE1fkG.d.ts → in-view-nkSOdED2.d.ts} +1 -6
- package/dist/index-BnI3OppC.d.ts +1 -0
- package/dist/{index-CTU6apE6.d.ts → index-CDwfBOAA.d.ts} +5 -4
- package/dist/{index-Bed_XLWa.d.ts → index-D47aqlpz.d.ts} +3 -2
- package/dist/index-Rv8RL7xy.d.ts +25 -0
- package/dist/{input-B3TS9yAP.js → input-Ct1YOqSy.js} +1 -1
- package/dist/input.d.ts +10 -11
- package/dist/input.js +1 -1
- package/dist/{kbd-D6k4Dnrf.js → kbd-K8iaZ-Ti.js} +1 -1
- package/dist/kbd.d.ts +3 -8
- package/dist/kbd.js +1 -1
- package/dist/{label-BLXfnQmn.js → label-BMlHW_2D.js} +1 -1
- package/dist/{label-PY0qM0G5.d.ts → label-v2-bv98k.d.ts} +1 -1
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/list.d.ts +18 -60
- package/dist/list.js +1 -1
- package/dist/llms.txt +4 -1
- package/dist/main.d.ts +4 -27
- package/dist/main.js +1 -1
- package/dist/mantle.css +6 -6
- package/dist/media-object.d.ts +6 -7
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +80 -33
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +7 -8
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +11 -22
- package/dist/pagination.js +1 -1
- package/dist/{popover-Bq52EC7X.js → popover-D5WxxnBY.js} +1 -1
- package/dist/popover.d.ts +6 -7
- package/dist/popover.js +1 -1
- package/dist/{primitive-FoWela9a.d.ts → primitive-C64-m48O.d.ts} +0 -1
- package/dist/{primitive-BuVqb6zf.js → primitive-wm7Wk-gy.js} +1 -1
- package/dist/progress.d.ts +55 -46
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +10 -9
- package/dist/qr-code.js +1 -1
- package/dist/radio-group.d.ts +71 -60
- package/dist/radio-group.js +1 -1
- package/dist/{resolve-pre-rendered-props-DxJ9-DAl.d.ts → resolve-pre-rendered-props-B6OlZrSI.d.ts} +13 -26
- package/dist/{resolve-pre-rendered-props-DwIF_M_K.js → resolve-pre-rendered-props-C3e5Auo3.js} +1 -1
- package/dist/sandboxed-on-click.d.ts +4 -8
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/{select-BUGOJMER.d.ts → select-Bwt2YduR.d.ts} +11 -12
- package/dist/{select-Bxq_N-_o.js → select-D-5u0Blc.js} +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +160 -146
- package/dist/selectable-list.js +1 -1
- package/dist/{separator-CqohKk4z.js → separator-kBnnv3Cw.js} +1 -1
- package/dist/separator.d.ts +6 -37
- package/dist/separator.js +1 -1
- package/dist/sheet.d.ts +231 -47
- package/dist/sheet.js +1 -1
- package/dist/sizes-Dje_rwKc.d.ts +29 -0
- package/dist/skeleton-Bu3tgNcW.js +1 -0
- package/dist/skeleton.d.ts +2 -2
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.d.ts +4 -34
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.d.ts +2 -21
- package/dist/slider.js +1 -1
- package/dist/slot-DmPrjM7N.js +1 -0
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/split-button.d.ts +20 -12
- package/dist/split-button.js +1 -1
- package/dist/{svg-only-f6ToFLH0.d.ts → svg-only-BFeFS1aa.d.ts} +2 -3
- package/dist/{svg-only-CSOaF1tL.js → svg-only-DDx6FtJd.js} +1 -1
- package/dist/switch.d.ts +4 -5
- package/dist/switch.js +1 -1
- package/dist/{table-CAitdL78.js → table-CPH2md2-.js} +1 -1
- package/dist/{table-BWD9IlIN.d.ts → table-CwFHXC-G.d.ts} +10 -10
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +29 -15
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +2 -3
- package/dist/text-area.js +1 -1
- package/dist/theme-D8kZCOzM.js +1 -0
- package/dist/theme-provider-Djj_jBo6.js +1 -0
- package/dist/theme-switcher.d.ts +45 -0
- package/dist/theme-switcher.js +1 -0
- package/dist/theme.d.ts +15 -101
- package/dist/theme.js +1 -1
- package/dist/{toast-CZBWjXcP.js → toast-RkhbliFh.js} +1 -1
- package/dist/toast.d.ts +13 -37
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +10 -44
- package/dist/tooltip.js +1 -1
- package/dist/{types-CTam1uIW.d.ts → types-C19IR7jf.d.ts} +1 -0
- package/dist/{types-BvUzforF.d.ts → types-D1RY5Tcj.d.ts} +0 -1
- package/dist/types.d.ts +3 -3
- package/dist/use-prefers-reduced-motion-CagaNRgm.js +1 -0
- package/dist/utils.d.ts +2 -3
- package/dist/{validation-xyX_6kph.d.ts → validation-7QeiTFwl.d.ts} +3 -12
- package/dist/{validation-DCyx-ceH.js → validation-Bpptk_9t.js} +1 -1
- package/dist/{virtual-PBNiHjMK.js → virtual-DZMBu7Ch.js} +1 -1
- package/dist/well.d.ts +3 -3
- package/dist/well.js +1 -1
- package/dist/{with-style-props-CyImx7vd.d.ts → with-style-props-Dq5Vntqy.d.ts} +0 -1
- package/package.json +17 -14
- package/dist/button-C9GW9nAr.js +0 -1
- package/dist/checkbox-Apow0ipK.js +0 -1
- package/dist/cx-C1UYP5We.js +0 -1
- package/dist/icon-SUx16Sl3.js +0 -1
- package/dist/index-CJbKEKr2.d.ts +0 -20
- package/dist/slot-DT_E5BQx.js +0 -1
- package/dist/theme-provider-C5XYi2-H.js +0 -1
- package/dist/use-prefers-reduced-motion-DBqNw1wB.js +0 -1
package/dist/split-button.d.ts
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import { t as Button } from "./button-
|
|
2
|
-
import { t as IconButton } from "./icon-button-
|
|
3
|
-
import { t as
|
|
1
|
+
import { t as Button } from "./button-Bw9MpShl.js";
|
|
2
|
+
import { t as IconButton } from "./icon-button-DuRSCsPh.js";
|
|
3
|
+
import { t as ButtonSize } from "./sizes-Dje_rwKc.js";
|
|
4
|
+
import { t as DropdownMenu } from "./dropdown-menu-DT30TQzL.js";
|
|
4
5
|
import { ComponentProps, ReactNode } from "react";
|
|
5
|
-
|
|
6
6
|
//#region src/components/split-button/split-button.d.ts
|
|
7
|
-
type RootProps = ComponentProps<typeof DropdownMenu.Root> & ComponentProps<"div"
|
|
8
|
-
|
|
7
|
+
type RootProps = ComponentProps<typeof DropdownMenu.Root> & ComponentProps<"div"> & {
|
|
8
|
+
/**
|
|
9
|
+
* The size of the SplitButton, default `"md"`. Applied to both the
|
|
10
|
+
* primary action and the menu trigger so the two halves always share
|
|
11
|
+
* one height — the parts do not accept `size`, so mixed-size
|
|
12
|
+
* composites cannot be expressed in the type system.
|
|
13
|
+
*/
|
|
14
|
+
size?: ButtonSize;
|
|
15
|
+
};
|
|
16
|
+
type PrimaryActionProps = Omit<ComponentProps<typeof Button>, "appearance" | "priority" | "size">;
|
|
9
17
|
type MenuTriggerProps = Omit<ComponentProps<typeof IconButton>, "appearance" | "size" | "asChild" | "icon"> & {
|
|
10
18
|
icon?: ReactNode;
|
|
11
19
|
};
|
|
@@ -14,7 +22,7 @@ type MenuTriggerProps = Omit<ComponentProps<typeof IconButton>, "appearance" | "
|
|
|
14
22
|
* related alternatives through a dropdown menu. Best for when users typically
|
|
15
23
|
* want one action but occasionally need variants.
|
|
16
24
|
*
|
|
17
|
-
* @see https://mantle.ngrok.com/components/split-button#splitbuttonroot
|
|
25
|
+
* @see https://mantle.ngrok.com/components/actions/split-button#splitbuttonroot
|
|
18
26
|
*
|
|
19
27
|
* @example
|
|
20
28
|
* Composition:
|
|
@@ -54,7 +62,7 @@ declare const SplitButton: {
|
|
|
54
62
|
* related alternatives through a dropdown menu. Best for when users typically
|
|
55
63
|
* want one action but occasionally need variants.
|
|
56
64
|
*
|
|
57
|
-
* @see https://mantle.ngrok.com/components/split-button#splitbuttonroot
|
|
65
|
+
* @see https://mantle.ngrok.com/components/actions/split-button#splitbuttonroot
|
|
58
66
|
*
|
|
59
67
|
* @example
|
|
60
68
|
* ```tsx
|
|
@@ -82,7 +90,7 @@ declare const SplitButton: {
|
|
|
82
90
|
/**
|
|
83
91
|
* The most common action users can trigger with a single click.
|
|
84
92
|
*
|
|
85
|
-
* @see https://mantle.ngrok.com/components/split-button#splitbuttonprimaryaction
|
|
93
|
+
* @see https://mantle.ngrok.com/components/actions/split-button#splitbuttonprimaryaction
|
|
86
94
|
*
|
|
87
95
|
* @example
|
|
88
96
|
* ```tsx
|
|
@@ -110,7 +118,7 @@ declare const SplitButton: {
|
|
|
110
118
|
/**
|
|
111
119
|
* The button that opens the split button dropdown menu.
|
|
112
120
|
*
|
|
113
|
-
* @see https://mantle.ngrok.com/components/split-button#splitbuttonmenutrigger
|
|
121
|
+
* @see https://mantle.ngrok.com/components/actions/split-button#splitbuttonmenutrigger
|
|
114
122
|
*
|
|
115
123
|
* @example
|
|
116
124
|
* ```tsx
|
|
@@ -139,7 +147,7 @@ declare const SplitButton: {
|
|
|
139
147
|
* The container for the split button dropdown menu content. Appears in a
|
|
140
148
|
* portal with scrolling and animations.
|
|
141
149
|
*
|
|
142
|
-
* @see https://mantle.ngrok.com/components/split-button#splitbuttonmenucontent
|
|
150
|
+
* @see https://mantle.ngrok.com/components/actions/split-button#splitbuttonmenucontent
|
|
143
151
|
*
|
|
144
152
|
* @example
|
|
145
153
|
* ```tsx
|
|
@@ -170,7 +178,7 @@ declare const SplitButton: {
|
|
|
170
178
|
* A standard item in the split button dropdown menu that can be selected or
|
|
171
179
|
* activated.
|
|
172
180
|
*
|
|
173
|
-
* @see https://mantle.ngrok.com/components/split-button#splitbuttonmenuitem
|
|
181
|
+
* @see https://mantle.ngrok.com/components/actions/split-button#splitbuttonmenuitem
|
|
174
182
|
*
|
|
175
183
|
* @example
|
|
176
184
|
* ```tsx
|
package/dist/split-button.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CDtYjF_H.js";import{t as n}from"./icon-button-CxVsZ2N1.js";import{t as r}from"./button-AS5Ir3DE.js";import{t as i}from"./dropdown-menu-ByUQkAvJ.js";import{CaretDownIcon as a}from"@phosphor-icons/react/CaretDown";import{createContext as o,forwardRef as s,useContext as c,useMemo as l}from"react";import{jsx as u}from"react/jsx-runtime";const d=o({size:`md`}),f=s(({className:t,children:n,dir:r,open:a,defaultOpen:o,onOpenChange:s,modal:c,size:f=`md`,...p},m)=>{let h=l(()=>({size:f}),[f]);return u(i.Root,{dir:r,open:a,defaultOpen:o,onOpenChange:s,modal:c,children:u(d.Provider,{value:h,children:u(`div`,{"data-slot":`split-button`,"data-size":f,className:e(`flex flex-row [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:not(:first-child)]:-ml-px [&>*:focus]:relative [&>*:focus]:z-10 [&>*:hover]:relative [&>*:hover]:z-10 *:active:scale-100!`,t),ref:m,...p,children:n})})})});f.displayName=`SplitButton`;const p=s((e,t)=>{let{size:n}=c(d);return u(r,{appearance:`outlined`,priority:`neutral`,ref:t,size:n,...e})});p.displayName=`SplitButtonPrimaryAction`;const m=s(({icon:e,...r},o)=>{let{size:s}=c(d);return u(i.Trigger,{asChild:!0,className:`group`,children:u(n,{icon:e??u(t,{svg:u(a,{weight:`bold`,className:`size-4 group-data-[state=open]:-rotate-180 transition-transform ease-out duration-150`})}),appearance:`outlined`,ref:o,size:s,...r})})});m.displayName=`SplitButtonMenuTrigger`;const h=s(({align:e=`end`,...t},n)=>u(i.Content,{align:e,ref:n,...t}));h.displayName=`SplitButtonMenuContent`;const g=s(({className:t,...n},r)=>u(i.Item,{className:e(`gap-2`,t),ref:r,...n}));g.displayName=`SplitButtonMenuItem`;const _={Root:f,PrimaryAction:p,MenuTrigger:m,MenuContent:h,MenuItem:g};export{_ as SplitButton};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as SvgAttributes } from "./types-
|
|
1
|
+
import { t as SvgAttributes } from "./types-D1RY5Tcj.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
|
|
4
3
|
//#region src/components/icon/svg-only.d.ts
|
|
5
4
|
type SvgOnlyProps = Omit<SvgAttributes, "children"> & {
|
|
6
5
|
/**
|
|
@@ -12,7 +11,7 @@ type SvgOnlyProps = Omit<SvgAttributes, "children"> & {
|
|
|
12
11
|
* Accepts a single SVG icon element and decorates it with `shrink-0` class.
|
|
13
12
|
* You probably want to use the `Icon` component instead.
|
|
14
13
|
*
|
|
15
|
-
* @see https://mantle.ngrok.com/components/icon
|
|
14
|
+
* @see https://mantle.ngrok.com/components/data-display/icon
|
|
16
15
|
*
|
|
17
16
|
* @example
|
|
18
17
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{Children as t,cloneElement as n,forwardRef as r,isValidElement as i}from"react";import a from"tiny-invariant";const o=r(({className:r,style:o,svg:s,...c},l)=>(a(i(s)&&t.only(s),`SvgOnly must be passed a single SVG icon as a JSX tag.`),n(s,{"data-slot":`svg-only`,...c,className:e(`shrink-0`,r,s.props.className),style:{...o,...s.props.style},ref:l})));o.displayName=`SvgOnly`;export{o as t};
|
package/dist/switch.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { o as WithValidation } from "./validation-
|
|
2
|
-
|
|
1
|
+
import { o as WithValidation } from "./validation-7QeiTFwl.js";
|
|
3
2
|
//#region src/components/switch/switch.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* A form control that allows the user to toggle between checked and not checked.
|
|
6
5
|
*
|
|
7
|
-
* Pair it with a [`Label`](/components/label) for a single-line caption, or
|
|
8
|
-
* compose it inside [`Choice`](/components/choice) for a titled, multi-line
|
|
6
|
+
* Pair it with a [`Label`](/components/forms/label) for a single-line caption, or
|
|
7
|
+
* compose it inside [`Choice`](/components/forms/choice) for a titled, multi-line
|
|
9
8
|
* label with a supplementary description.
|
|
10
9
|
*
|
|
11
|
-
* @see https://mantle.ngrok.com/components/switch
|
|
10
|
+
* @see https://mantle.ngrok.com/components/forms/switch
|
|
12
11
|
*
|
|
13
12
|
* @example
|
|
14
13
|
* ```tsx
|
package/dist/switch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
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"./validation-Bpptk_9t.js";import{forwardRef as a}from"react";import{jsx as o}from"react/jsx-runtime";import{Root as s,Thumb as c}from"@radix-ui/react-switch";const l=a(({"aria-invalid":a,"aria-readonly":l,className:u,readOnly:d,onClick:f,validation:p,...m},h)=>{let g=t(d??l),_=r(),{ariaInvalid:v,validation:y}=i({"aria-invalid":a,validation:p??_});return o(s,{"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:h,...m,children:o(c,{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`)})})});l.displayName=`Switch`;export{l as Switch};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compose-refs-Cjf2gfB8.js";import{t}from"./cx-
|
|
1
|
+
import{t as e}from"./compose-refs-Cjf2gfB8.js";import{t}from"./cx-IiQEAKf5.js";import{forwardRef as n,useLayoutEffect as r,useMemo as i,useRef as a,useState as o}from"react";import{jsx as s}from"react/jsx-runtime";const c=n(({children:n,className:r,...i},a)=>{let o=v();return s(`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":o.state.hasOverflow&&!o.state.scrolledToEnd||void 0,"data-x-overflow":o.state.hasOverflow,"data-x-scroll-end":o.state.hasOverflow&&o.state.scrolledToEnd,...i,children:s(`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(o.ref,a),children:n})})});c.displayName=`TableRoot`;const l=n(({children:e,className:n,...r},i)=>s(`table`,{"data-slot":`table-element`,ref:i,className:t(`table-auto border-separate border-spacing-0 caption-bottom w-full min-w-full text-left`,n),...r,children:e}));l.displayName=`TableElement`;const u=n(({children:e,className:n,...r},i)=>s(`thead`,{"data-slot":`table-head`,ref:i,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),...r,children:e}));u.displayName=`TableHead`;const d=n(({children:e,className:n,...r},i)=>s(`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:i,...r,children:e}));d.displayName=`TableBody`;const f=n(({children:e,className:n,...r},i)=>s(`tfoot`,{"data-slot":`table-foot`,ref:i,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),...r,children:e}));f.displayName=`TableFoot`;const p=n(({children:e,className:n,...r},i)=>s(`tr`,{"data-slot":`table-row`,ref:i,className:t(n),...r,children:e}));p.displayName=`TableRow`;const m=n(({children:e,className:n,...r},i)=>s(`th`,{"data-slot":`table-header`,ref:i,className:t(`h-11 px-4 text-left align-middle text-sm font-medium [&:has([role=checkbox])]:pr-0`,n),...r,children:e}));m.displayName=`TableHeader`;const h=n(({children:e,className:n,...r},i)=>s(`td`,{"data-slot":`table-cell`,ref:i,className:t(`p-3 align-middle [&:has([role=checkbox])]:pr-0 font-mono text-mono`,n),...r,children:e}));h.displayName=`TableCell`;const g=n(({children:e,className:n,...r},i)=>s(`caption`,{"data-slot":`table-caption`,ref:i,className:t(`py-4 text-sm text-gray-500`,`border-t border-card-muted`,n),...r,children:e}));g.displayName=`TableCaption`;const _={Body:d,Caption:g,Cell:h,Element:l,Foot:f,Head:u,Header:m,Root:c,Row:p};function v(){let e=a(null),[t,n]=o({hasOverflow:!1,scrolledToStart:!0,scrolledToEnd:!1});return r(()=>{let t=e.current;if(!t)return;let r=0,i=()=>{let e=t.scrollWidth>t.clientWidth,r=t.scrollLeft<1,i=Math.abs(t.scrollWidth-t.scrollLeft-t.clientWidth)<1;n(t=>t.hasOverflow!==e||t.scrolledToStart!==r||t.scrolledToEnd!==i?{hasOverflow:e,scrolledToStart:r,scrolledToEnd:i}:t)},a=()=>{r===0&&(r=requestAnimationFrame(()=>{r=0,i()}))},o=new ResizeObserver(a);o.observe(t);let s=new MutationObserver(a);return s.observe(t,{childList:!0,subtree:!0}),t.addEventListener(`scroll`,a,{passive:!0}),i(),()=>{cancelAnimationFrame(r),o.disconnect(),s.disconnect(),t.removeEventListener(`scroll`,a)}},[]),i(()=>({ref:e,state:t}),[t])}export{_ as t};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* For INTERACTIVE tabular data with sorting / filtering / pagination / row
|
|
8
8
|
* selection, use `DataTable` (built on TanStack Table) instead.
|
|
9
9
|
*
|
|
10
|
-
* @see https://mantle.ngrok.com/components/table
|
|
10
|
+
* @see https://mantle.ngrok.com/components/data-display/table
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* Composition:
|
|
@@ -61,7 +61,7 @@ declare const Table: {
|
|
|
61
61
|
/**
|
|
62
62
|
* The body section of the table. Encapsulates a set of table rows comprising the body of a table's main data.
|
|
63
63
|
*
|
|
64
|
-
* @see https://mantle.ngrok.com/components/table#tablebody
|
|
64
|
+
* @see https://mantle.ngrok.com/components/data-display/table#tablebody
|
|
65
65
|
*
|
|
66
66
|
* @example
|
|
67
67
|
* ```tsx
|
|
@@ -100,7 +100,7 @@ declare const Table: {
|
|
|
100
100
|
/**
|
|
101
101
|
* An optional caption that specifies the caption (or title) of a table, providing an accessible description.
|
|
102
102
|
*
|
|
103
|
-
* @see https://mantle.ngrok.com/components/table#tablecaption
|
|
103
|
+
* @see https://mantle.ngrok.com/components/data-display/table#tablecaption
|
|
104
104
|
*
|
|
105
105
|
* @example
|
|
106
106
|
* ```tsx
|
|
@@ -139,7 +139,7 @@ declare const Table: {
|
|
|
139
139
|
/**
|
|
140
140
|
* A cell that contains data and may be used as a child of a table row.
|
|
141
141
|
*
|
|
142
|
-
* @see https://mantle.ngrok.com/components/table#tablecell
|
|
142
|
+
* @see https://mantle.ngrok.com/components/data-display/table#tablecell
|
|
143
143
|
*
|
|
144
144
|
* @example
|
|
145
145
|
* ```tsx
|
|
@@ -178,7 +178,7 @@ declare const Table: {
|
|
|
178
178
|
/**
|
|
179
179
|
* A structured way to display data in rows and columns. The API matches the HTML table element 1:1.
|
|
180
180
|
*
|
|
181
|
-
* @see https://mantle.ngrok.com/components/table#tableelement
|
|
181
|
+
* @see https://mantle.ngrok.com/components/data-display/table#tableelement
|
|
182
182
|
*
|
|
183
183
|
* @example
|
|
184
184
|
* ```tsx
|
|
@@ -217,7 +217,7 @@ declare const Table: {
|
|
|
217
217
|
/**
|
|
218
218
|
* The foot section of a table. Encapsulates a set of table rows comprising the foot with summary information.
|
|
219
219
|
*
|
|
220
|
-
* @see https://mantle.ngrok.com/components/table#tablefoot
|
|
220
|
+
* @see https://mantle.ngrok.com/components/data-display/table#tablefoot
|
|
221
221
|
*
|
|
222
222
|
* @example
|
|
223
223
|
* ```tsx
|
|
@@ -256,7 +256,7 @@ declare const Table: {
|
|
|
256
256
|
/**
|
|
257
257
|
* The head section of a table. Contains the table's column headers information.
|
|
258
258
|
*
|
|
259
|
-
* @see https://mantle.ngrok.com/components/table#tableheader
|
|
259
|
+
* @see https://mantle.ngrok.com/components/data-display/table#tableheader
|
|
260
260
|
*
|
|
261
261
|
* @example
|
|
262
262
|
* ```tsx
|
|
@@ -295,7 +295,7 @@ declare const Table: {
|
|
|
295
295
|
/**
|
|
296
296
|
* A cell that defines the header of a group of table cells as a child of a table row.
|
|
297
297
|
*
|
|
298
|
-
* @see https://mantle.ngrok.com/components/table#tableheader
|
|
298
|
+
* @see https://mantle.ngrok.com/components/data-display/table#tableheader
|
|
299
299
|
*
|
|
300
300
|
* @example
|
|
301
301
|
* ```tsx
|
|
@@ -334,7 +334,7 @@ declare const Table: {
|
|
|
334
334
|
/**
|
|
335
335
|
* The root container element for all tables. Provides styling and additional functionality like horizontal overflow detection.
|
|
336
336
|
*
|
|
337
|
-
* @see https://mantle.ngrok.com/components/table#tableroot
|
|
337
|
+
* @see https://mantle.ngrok.com/components/data-display/table#tableroot
|
|
338
338
|
*
|
|
339
339
|
* @example
|
|
340
340
|
* ```tsx
|
|
@@ -373,7 +373,7 @@ declare const Table: {
|
|
|
373
373
|
/**
|
|
374
374
|
* Defines a row of cells in a table. Contains a mix of table cells and table headers.
|
|
375
375
|
*
|
|
376
|
-
* @see https://mantle.ngrok.com/components/table#tablerow
|
|
376
|
+
* @see https://mantle.ngrok.com/components/data-display/table#tablerow
|
|
377
377
|
*
|
|
378
378
|
* @example
|
|
379
379
|
* ```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-CwFHXC-G.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-CPH2md2-.js";export{e as Table};
|
package/dist/tabs.d.ts
CHANGED
|
@@ -1,11 +1,32 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
|
-
|
|
3
2
|
//#region src/components/tabs/tabs.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* A badge component that can be used inside tab triggers to display additional information.
|
|
5
|
+
* Typically used to show counts or status indicators within tab headers.
|
|
6
|
+
*
|
|
7
|
+
* @see https://mantle.ngrok.com/components/navigation/tabs#tabsbadge
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Tabs.Root defaultValue="account">
|
|
12
|
+
* <Tabs.List>
|
|
13
|
+
* <Tabs.Trigger value="account">
|
|
14
|
+
* Account <Tabs.Badge>5</Tabs.Badge>
|
|
15
|
+
* </Tabs.Trigger>
|
|
16
|
+
* <Tabs.Trigger value="password">Password</Tabs.Trigger>
|
|
17
|
+
* </Tabs.List>
|
|
18
|
+
* </Tabs.Root>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare const Badge: {
|
|
22
|
+
({ className, children, ...props }: HTMLAttributes<HTMLSpanElement>): import("react").JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
4
25
|
/**
|
|
5
26
|
* A set of layered sections of content—known as tab panels—that are displayed one at a time.
|
|
6
27
|
* The root component that provides context for all tab components.
|
|
7
28
|
*
|
|
8
|
-
* @see https://mantle.ngrok.com/components/tabs
|
|
29
|
+
* @see https://mantle.ngrok.com/components/navigation/tabs
|
|
9
30
|
*
|
|
10
31
|
* @example
|
|
11
32
|
* Composition:
|
|
@@ -38,7 +59,7 @@ declare const Tabs: {
|
|
|
38
59
|
* The root container of the tabs component that provides context for all tab components.
|
|
39
60
|
* A set of layered sections of content—known as tab panels—that are displayed one at a time.
|
|
40
61
|
*
|
|
41
|
-
* @see https://mantle.ngrok.com/components/tabs#tabsroot
|
|
62
|
+
* @see https://mantle.ngrok.com/components/navigation/tabs#tabsroot
|
|
42
63
|
*
|
|
43
64
|
* @example
|
|
44
65
|
* ```tsx
|
|
@@ -65,7 +86,7 @@ declare const Tabs: {
|
|
|
65
86
|
* Contains the content associated with each trigger.
|
|
66
87
|
* The content panel that displays when its corresponding tab trigger is active.
|
|
67
88
|
*
|
|
68
|
-
* @see https://mantle.ngrok.com/components/tabs#tabscontent
|
|
89
|
+
* @see https://mantle.ngrok.com/components/navigation/tabs#tabscontent
|
|
69
90
|
*
|
|
70
91
|
* @example
|
|
71
92
|
* ```tsx
|
|
@@ -84,7 +105,7 @@ declare const Tabs: {
|
|
|
84
105
|
* Contains the triggers that are aligned along the edge of the active content.
|
|
85
106
|
* The container for tab triggers that provides the visual layout for tab navigation.
|
|
86
107
|
*
|
|
87
|
-
* @see https://mantle.ngrok.com/components/tabs#tabslist
|
|
108
|
+
* @see https://mantle.ngrok.com/components/navigation/tabs#tabslist
|
|
88
109
|
*
|
|
89
110
|
* @example
|
|
90
111
|
* ```tsx
|
|
@@ -101,7 +122,7 @@ declare const Tabs: {
|
|
|
101
122
|
* The button that activates its associated content.
|
|
102
123
|
* A clickable tab trigger that switches between different tab content panels.
|
|
103
124
|
*
|
|
104
|
-
* @see https://mantle.ngrok.com/components/tabs#tabstrigger
|
|
125
|
+
* @see https://mantle.ngrok.com/components/navigation/tabs#tabstrigger
|
|
105
126
|
*
|
|
106
127
|
* @example
|
|
107
128
|
* ```tsx
|
|
@@ -118,7 +139,7 @@ declare const Tabs: {
|
|
|
118
139
|
* A badge component that can be used inside tab triggers to display additional information.
|
|
119
140
|
* Typically used to show counts or status indicators within tab headers.
|
|
120
141
|
*
|
|
121
|
-
* @see https://mantle.ngrok.com/components/tabs#tabsbadge
|
|
142
|
+
* @see https://mantle.ngrok.com/components/navigation/tabs#tabsbadge
|
|
122
143
|
*
|
|
123
144
|
* @example
|
|
124
145
|
* ```tsx
|
|
@@ -131,14 +152,7 @@ declare const Tabs: {
|
|
|
131
152
|
* </Tabs.Root>
|
|
132
153
|
* ```
|
|
133
154
|
*/
|
|
134
|
-
readonly Badge:
|
|
135
|
-
({
|
|
136
|
-
className,
|
|
137
|
-
children,
|
|
138
|
-
...props
|
|
139
|
-
}: HTMLAttributes<HTMLSpanElement>): import("react").JSX.Element;
|
|
140
|
-
displayName: string;
|
|
141
|
-
};
|
|
155
|
+
readonly Badge: typeof Badge;
|
|
142
156
|
};
|
|
143
157
|
//#endregion
|
|
144
158
|
export { Tabs };
|
package/dist/tabs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compose-refs-Cjf2gfB8.js";import{t}from"./cx-
|
|
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`,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:``}},compoundVariants:[{orientation:`horizontal`,appearance:`pill`,className:`gap-1 pb-1 -mb-1`},{orientation:`horizontal`,appearance:`classic`,className:`gap-6`},{orientation:`vertical`,appearance:`classic`,className:`border-r border-gray-200`}]}),E=c(({className:n,...r},a)=>{let{orientation:o,appearance:s}=u(C),c=p(null);return d(()=>{let e=c.current;if(!e||o!==`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()}},[o]),g(b,{"aria-orientation":o,"data-slot":`tabs-list`,className:t(T({orientation:o,appearance:s}),n),ref:e(c,a),...r})});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};
|
package/dist/text-area.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { o as WithValidation } from "./validation-
|
|
1
|
+
import { o as WithValidation } from "./validation-7QeiTFwl.js";
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
|
-
|
|
4
3
|
//#region src/components/text-area/text-area.d.ts
|
|
5
4
|
type Props = ComponentProps<"textarea"> & WithValidation & {
|
|
6
5
|
/**
|
|
@@ -13,7 +12,7 @@ type Props = ComponentProps<"textarea"> & WithValidation & {
|
|
|
13
12
|
* to enter a sizeable amount of free-form text, for example a comment on a
|
|
14
13
|
* review or feedback form.
|
|
15
14
|
*
|
|
16
|
-
* @see https://mantle.ngrok.com/components/text-area
|
|
15
|
+
* @see https://mantle.ngrok.com/components/forms/text-area
|
|
17
16
|
*
|
|
18
17
|
* @example
|
|
19
18
|
* ```tsx
|
package/dist/text-area.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compose-refs-Cjf2gfB8.js";import{t}from"./cx-
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as e}from"./theme-provider-Djj_jBo6.js";import{jsx as t}from"react/jsx-runtime";import{DesktopIcon as n}from"@phosphor-icons/react/Desktop";import{MoonIcon as r}from"@phosphor-icons/react/Moon";import{SunIcon as i}from"@phosphor-icons/react/Sun";function a(n){return t(o,{theme:e(),...n})}a.displayName=`AutoThemeIcon`;function o({theme:e,...a}){switch(e){case`system`:return t(n,{...a});case`light`:return t(i,{...a});case`dark`:return t(r,{...a});case`light-high-contrast`:return t(i,{...a,weight:`fill`});case`dark-high-contrast`:return t(r,{...a,weight:`fill`})}}o.displayName=`ThemeIcon`;export{o as n,a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./use-matches-media-query-CMSxHR9n.js";import{n}from"./browser-only-CPH56Xw_.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[t,r]=c(()=>{let e=N({cookie:n()?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(()=>[t,e=>{L(e),r(e),w(e),F(e,{broadcastChannel:i.current,pingKey:`${y}__ping`})}],[t]);return u(x.Provider,{value:l,children:e})}S.displayName=`ThemeProvider`;function C(){let e=i(x);return l(e,`useTheme must be used within a ThemeProvider`),e}function w(e){if(!n())return;let t=window.document.documentElement,r=window.matchMedia(_).matches,i=window.matchMedia(v).matches,a=E(e,{prefersDarkMode:r,prefersHighContrast:i}),o=t.dataset.theme,s=t.dataset.appliedTheme,c=m(o)?o:void 0,l=g(s)?s:void 0;c===e&&l===a||(t.classList.remove(...d),t.classList.add(a),t.dataset.theme=e,t.dataset.appliedTheme=a)}function T(){if(!n())return{appliedTheme:void 0,theme:void 0};let e=window.document.documentElement,t=m(e.dataset.theme)?e.dataset.theme:void 0;return{appliedTheme:g(e.dataset.appliedTheme)?e.dataset.appliedTheme:void 0,theme:t}}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:t(_),prefersHighContrast:t(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});j.displayName=`PreventWrongThemeFlashScript`;function M(t={}){let{className:r=``,ssrCookie:i}=t??{};return o(()=>{let t,a;if(!n())t=N({cookie:i}),a=E(t,{prefersDarkMode:!1,prefersHighContrast:!1});else{let e=window.matchMedia(_).matches,n=window.matchMedia(v).matches;t=N({cookie:document.cookie}),a=E(t,{prefersDarkMode:e,prefersHighContrast:n})}return{className:e(r,a),"data-applied-theme":a,"data-theme":t}},[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(n())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};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { t as WithStyleProps } from "./with-style-props-Dq5Vntqy.js";
|
|
2
|
+
import { t as IconButton } from "./icon-button-DuRSCsPh.js";
|
|
3
|
+
import { t as DropdownMenu } from "./dropdown-menu-DT30TQzL.js";
|
|
4
|
+
import "./index-BnI3OppC.js";
|
|
5
|
+
import { ComponentProps } from "react";
|
|
6
|
+
//#region src/components/theme-switcher/theme-switcher.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* The props for the `ThemeDropdownMenuRadioGroup` component.
|
|
9
|
+
*/
|
|
10
|
+
type ThemeDropdownMenuRadioGroupProps = WithStyleProps;
|
|
11
|
+
declare function ThemeDropdownMenuRadioGroup({ className, style }: ThemeDropdownMenuRadioGroupProps): import("react").JSX.Element;
|
|
12
|
+
declare namespace ThemeDropdownMenuRadioGroup {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The props for the `ThemeSwitcher` component.
|
|
17
|
+
*/
|
|
18
|
+
type ThemeSwitcherProps = WithStyleProps & Pick<ComponentProps<typeof IconButton>, "appearance"> & {
|
|
19
|
+
/**
|
|
20
|
+
* Props forwarded to the menu's `DropdownMenu.Content` — positioning and
|
|
21
|
+
* collision behavior (`align`, `side`, `collisionPadding`, …) plus
|
|
22
|
+
* `className`/`style` for the popover the trigger opens. To own the whole
|
|
23
|
+
* menu instead, compose `ThemeDropdownMenuRadioGroup` in your own
|
|
24
|
+
* `DropdownMenu`.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <ThemeSwitcher contentProps={{ collisionPadding: { right: 16 } }} />
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
contentProps?: Omit<ComponentProps<typeof DropdownMenu.Content>, "children">;
|
|
32
|
+
/**
|
|
33
|
+
* The accessible name for the trigger `IconButton`. Visually hidden but
|
|
34
|
+
* announced to screen readers. Override it for localization.
|
|
35
|
+
*
|
|
36
|
+
* @default "Change Theme"
|
|
37
|
+
*/
|
|
38
|
+
label?: string;
|
|
39
|
+
};
|
|
40
|
+
declare function ThemeSwitcher({ appearance, className, contentProps, label, style }: ThemeSwitcherProps): import("react").JSX.Element;
|
|
41
|
+
declare namespace ThemeSwitcher {
|
|
42
|
+
var displayName: string;
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { ThemeDropdownMenuRadioGroup, type ThemeDropdownMenuRadioGroupProps, ThemeSwitcher, type ThemeSwitcherProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./icon-CDtYjF_H.js";import{t}from"./icon-button-CxVsZ2N1.js";import{t as n}from"./browser-only-CPH56Xw_.js";import{d as r,h as i,l as a,p as o}from"./theme-provider-Djj_jBo6.js";import{t as s}from"./dropdown-menu-ByUQkAvJ.js";import{n as c,t as l}from"./theme-D8kZCOzM.js";import{t as u}from"./skeleton-Bu3tgNcW.js";import{jsx as d,jsxs as f}from"react/jsx-runtime";const p={system:`System Preference`,light:`Light Mode`,dark:`Dark Mode`,"light-high-contrast":`Light High Contrast`,"dark-high-contrast":`Dark High Contrast`},m=({className:t,style:n})=>{let[l,u]=a();return d(s.RadioGroup,{"data-slot":`theme-dropdown-menu-radio-group`,className:t,style:n,value:l,onValueChange:e=>{o(e)&&u(e)},children:i.map(t=>f(s.RadioItem,{value:r(t),children:[d(e,{svg:d(c,{theme:t})}),p[t]]},t))})};m.displayName=`ThemeDropdownMenuRadioGroup`;const h=({appearance:e,className:r,contentProps:i,label:a=`Change Theme`,style:o})=>f(s.Root,{children:[d(s.Trigger,{asChild:!0,children:d(t,{type:`button`,appearance:e??`ghost`,className:r,"data-slot":`theme-switcher`,icon:d(n,{fallback:d(u,{className:`rounded-full size-5`}),children:()=>d(l,{className:`size-5`})}),label:a,style:o})}),d(s.Content,{...i,children:d(m,{})})]});h.displayName=`ThemeSwitcher`;export{m as ThemeDropdownMenuRadioGroup,h as ThemeSwitcher};
|