@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/progress.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./types-D85fCNV3.js";import{t as n}from"./clsx-DUGZgXfJ.js";import{createContext as r,useContext as i,useId as a,useMemo as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import*as l from"@radix-ui/react-progress";function u(e,{min:t,max:n}){return Math.min(n,Math.max(t,e))}function d(e){return typeof e==`number`}function f(e,t){return d(e)&&!Number.isNaN(e)&&e<=t&&e>=0}function p(e){return d(e)&&!Number.isNaN(e)&&e>0}const m={max:100,strokeWidth:`0.25rem`,value:0},h=r(m),g=({children:n,className:r,max:i=100,strokeWidth:a=4,value:l,indeterminateRotationSpeed:u,...g})=>{let
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./types-D85fCNV3.js";import{t as n}from"./clsx-DUGZgXfJ.js";import{createContext as r,useContext as i,useId as a,useMemo as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import*as l from"@radix-ui/react-progress";function u(e,{min:t,max:n}){return Math.min(n,Math.max(t,e))}function d(e){return typeof e==`number`}function f(e,t){return d(e)&&!Number.isNaN(e)&&e<=t&&e>=0}function p(e){return d(e)&&!Number.isNaN(e)&&e>0}const m={max:100,strokeWidth:`0.25rem`,value:0},h=r(m),g={Root:({children:n,className:r,max:i=100,strokeWidth:a=4,value:l,indeterminateRotationSpeed:u,...g})=>{let y=p(i)?i:100,b=f(l,y)?l:l==null?0:`indeterminate`,x=_(a??m.strokeWidth),S=d(b)?b:void 0,C=v(x),w=o(()=>({max:y,strokeWidth:x,value:b}),[y,x,b]);return s(h.Provider,{value:w,children:c(`svg`,{"data-slot":`progress-donut`,"aria-valuemax":y,"aria-valuemin":0,"aria-valuenow":S,className:e(`size-6 text-gray-200 dark:text-gray-300`,b===`indeterminate`&&[`animate-spin`,u??`animation-duration-[15s]`],r),"data-max":y,"data-min":0,"data-value":S,height:`100%`,role:`progressbar`,width:`100%`,...g,children:[s(`circle`,{className:`[r:var(--radius)]`,cx:`50%`,cy:`50%`,fill:`transparent`,stroke:`currentColor`,strokeWidth:x,style:t({"--radius":C})}),n]})})},Indicator:({className:r,...o})=>{let l=a(),u=i(h)??m,d=(u.value===`indeterminate`?.6:u.value/u.max)*100,f=_(u.strokeWidth),p=v(f);return c(`g`,{"data-slot":`progress-donut-indicator`,className:e(`text-accent-600`,r),...o,children:[u.value===`indeterminate`&&s(`defs`,{children:c(`linearGradient`,{id:l,children:[s(`stop`,{className:`stop-opacity-100 stop-color-current`,offset:`0%`}),s(`stop`,{className:`stop-opacity-0 stop-color-current`,offset:`95%`})]})}),s(`circle`,{className:n(`[r:var(--radius)]`,`origin-center`),cx:`50%`,cy:`50%`,fill:`transparent`,pathLength:100,stroke:u.value===`indeterminate`?`url(#${l})`:`currentColor`,strokeDasharray:100,strokeDashoffset:100-d,strokeLinecap:`round`,strokeWidth:f,style:t({"--radius":p}),transform:`rotate(-90)`})]})}};function _(e){let t=4;return e==null?t:(t=typeof e==`number`?e:e.endsWith(`rem`)?Number(e.replace(`rem`,``))*16:Number(e),u(Number.isNaN(t)?4:t,{min:1,max:12}))}function v(e){return`calc(50% - ${e/2}px)`}const y=r({max:100,value:0});function b({className:t,children:n,max:r=100,value:i,...a}){let c=p(r)?r:100,u=f(i,c)?i:i==null?0:`indeterminate`,m=d(u)?u:void 0,h=o(()=>({max:c,value:u}),[c,u]);return s(y.Provider,{value:h,children:s(l.Root,{"data-slot":`progress-bar`,className:e(`bg-base-hover dark:bg-base shadow-inner relative h-3 w-full overflow-hidden rounded-md`,t),value:m,max:c,...a,children:n})})}function x({className:t,style:n,...r}){let a=i(y),{max:o}=a,c=(o-(a.value===`indeterminate`?0:a.value))/o*100;return s(l.Indicator,{"data-slot":`progress-bar-indicator`,className:e(`bg-accent-600 h-full w-full flex-1 transition-all`,t),style:{...n,transform:`translateX(-${c}%)`},...r})}const S={Root:b,Indicator:x};export{S as ProgressBar,g as ProgressDonut};
|
package/dist/qr-code.d.ts
CHANGED
|
@@ -57,10 +57,7 @@ type QrCodeRootProps = ComponentProps<"div"> & WithAsChild & {
|
|
|
57
57
|
* </QrCode.Root>
|
|
58
58
|
* ```
|
|
59
59
|
*/
|
|
60
|
-
declare const Root: {
|
|
61
|
-
({ value, ecc, pixelSize, quietZone, asChild, className, children, ref, ...props }: QrCodeRootProps): import("react").JSX.Element;
|
|
62
|
-
displayName: string;
|
|
63
|
-
};
|
|
60
|
+
declare const Root: ({ value, ecc, pixelSize, quietZone, asChild, className, children, ref, ...props }: QrCodeRootProps) => import("react").JSX.Element;
|
|
64
61
|
/**
|
|
65
62
|
* Props for `QrCode.Frame`, the fixed SVG element that sizes the encoded QR
|
|
66
63
|
* pattern with its `viewBox`.
|
|
@@ -88,10 +85,7 @@ type QrCodeFrameProps = ComponentProps<"svg">;
|
|
|
88
85
|
* </QrCode.Root>
|
|
89
86
|
* ```
|
|
90
87
|
*/
|
|
91
|
-
declare const Frame: {
|
|
92
|
-
({ className, children, ref, ...props }: QrCodeFrameProps): import("react").JSX.Element;
|
|
93
|
-
displayName: string;
|
|
94
|
-
};
|
|
88
|
+
declare const Frame: ({ className, children, ref, ...props }: QrCodeFrameProps) => import("react").JSX.Element;
|
|
95
89
|
/**
|
|
96
90
|
* Props for `QrCode.Pattern`, the fixed SVG `path` element that renders the
|
|
97
91
|
* encoded dark modules.
|
|
@@ -119,10 +113,7 @@ type QrCodePatternProps = ComponentProps<"path">;
|
|
|
119
113
|
* </QrCode.Root>
|
|
120
114
|
* ```
|
|
121
115
|
*/
|
|
122
|
-
declare const Pattern: {
|
|
123
|
-
({ className, ref, ...props }: QrCodePatternProps): import("react").JSX.Element;
|
|
124
|
-
displayName: string;
|
|
125
|
-
};
|
|
116
|
+
declare const Pattern: ({ className, ref, ...props }: QrCodePatternProps) => import("react").JSX.Element;
|
|
126
117
|
/**
|
|
127
118
|
* Props for `QrCode.Overlay`, the optional centered logo container rendered on
|
|
128
119
|
* top of the QR pattern.
|
|
@@ -148,10 +139,7 @@ type QrCodeOverlayProps = ComponentProps<"div"> & WithAsChild;
|
|
|
148
139
|
* </QrCode.Root>
|
|
149
140
|
* ```
|
|
150
141
|
*/
|
|
151
|
-
declare const Overlay: {
|
|
152
|
-
({ asChild, className, ref, ...props }: QrCodeOverlayProps): import("react").JSX.Element;
|
|
153
|
-
displayName: string;
|
|
154
|
-
};
|
|
142
|
+
declare const Overlay: ({ asChild, className, ref, ...props }: QrCodeOverlayProps) => import("react").JSX.Element;
|
|
155
143
|
/**
|
|
156
144
|
* A QR code. Compose `QrCode.Root` with a `QrCode.Frame` wrapping a
|
|
157
145
|
* `QrCode.Pattern`, and optionally a `QrCode.Overlay` for a centered logo.
|
package/dist/qr-code.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-CDk0Bb9z.js";import{createContext as n,useContext as r,useMemo as i}from"react";import a from"tiny-invariant";import{jsx as o}from"react/jsx-runtime";import{encode as s}from"uqr";const c=n(null);function l(e,t){a(Number.isFinite(e)&&e>0,"`QrCode.Root` pixelSize must be a finite number greater than 0."),a(Number.isInteger(t)&&t>=0,"`QrCode.Root` quietZone must be a non-negative integer.")}function u(){let e=r(c);return a(e,"`QrCode.Frame` and `QrCode.Pattern` must be rendered inside a `QrCode.Root`."),e}function d(e,t){let n=[];return e.forEach((e,r)=>{e.forEach((e,i)=>{if(e){let e=i*t,a=r*t;n.push(`M${e},${a}h${t}v${t}h-${t}z`)}})}),n.join(``)}const f=({value:n,ecc:r=`L`,pixelSize:a=10,quietZone:u=4,asChild:f,className:p,children:m,ref:h,...g})=>{l(a,u);let _=i(()=>s(n,{ecc:r,border:u}),[n,r,u]),v=i(()=>d(_.data,a),[_,a]),y=i(()=>({path:v,dimension:_.size*a}),[v,_.size,a]),b=f?t:`div`;return o(c.Provider,{value:y,children:o(b,{ref:h,...g,"data-slot":`qr-code`,className:e(`relative inline-flex bg-static-white text-static-black`,p),children:m})})}
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-CDk0Bb9z.js";import{createContext as n,useContext as r,useMemo as i}from"react";import a from"tiny-invariant";import{jsx as o}from"react/jsx-runtime";import{encode as s}from"uqr";const c=n(null);function l(e,t){a(Number.isFinite(e)&&e>0,"`QrCode.Root` pixelSize must be a finite number greater than 0."),a(Number.isInteger(t)&&t>=0,"`QrCode.Root` quietZone must be a non-negative integer.")}function u(){let e=r(c);return a(e,"`QrCode.Frame` and `QrCode.Pattern` must be rendered inside a `QrCode.Root`."),e}function d(e,t){let n=[];return e.forEach((e,r)=>{e.forEach((e,i)=>{if(e){let e=i*t,a=r*t;n.push(`M${e},${a}h${t}v${t}h-${t}z`)}})}),n.join(``)}const f={Root:({value:n,ecc:r=`L`,pixelSize:a=10,quietZone:u=4,asChild:f,className:p,children:m,ref:h,...g})=>{l(a,u);let _=i(()=>s(n,{ecc:r,border:u}),[n,r,u]),v=i(()=>d(_.data,a),[_,a]),y=i(()=>({path:v,dimension:_.size*a}),[v,_.size,a]),b=f?t:`div`;return o(c.Provider,{value:y,children:o(b,{ref:h,...g,"data-slot":`qr-code`,className:e(`relative inline-flex bg-static-white text-static-black`,p),children:m})})},Frame:({className:t,children:n,ref:r,...i})=>{let{dimension:a}=u();return o(`svg`,{ref:r,...i,"data-slot":`qr-code-frame`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 ${a} ${a}`,shapeRendering:`crispEdges`,className:e(`block size-48`,t),children:n})},Pattern:({className:t,ref:n,...r})=>{let{path:i}=u();return o(`path`,{ref:n,...r,"data-slot":`qr-code-pattern`,d:i,className:e(`fill-static-black`,t)})},Overlay:({asChild:n,className:r,ref:i,...a})=>o(n?t:`div`,{ref:i,...a,"data-slot":`qr-code-overlay`,className:e(`absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-md bg-static-white text-static-black p-1.5`,r)})};export{f as QrCode};
|
package/dist/radio-group.d.ts
CHANGED
|
@@ -33,10 +33,7 @@ type RadioGroupProps$1 = PropsWithChildren<Omit<RadioGroupProps, "as" | "childre
|
|
|
33
33
|
* </RadioGroup.Root>
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
declare const Root: {
|
|
37
|
-
({ ref, ...props }: RadioGroupProps$1): import("react").JSX.Element;
|
|
38
|
-
displayName: string;
|
|
39
|
-
};
|
|
36
|
+
declare const Root: ({ ref, ...props }: RadioGroupProps$1) => import("react").JSX.Element;
|
|
40
37
|
/**
|
|
41
38
|
* The shape of the radio state context.
|
|
42
39
|
*/
|
|
@@ -71,10 +68,7 @@ type RadioItemProps = Omit<RadioProps, "children"> & PropsWithChildren & {
|
|
|
71
68
|
* </RadioGroup.Root>
|
|
72
69
|
* ```
|
|
73
70
|
*/
|
|
74
|
-
declare const Item: {
|
|
75
|
-
({ children, className, ref, ...props }: RadioItemProps): import("react").JSX.Element;
|
|
76
|
-
displayName: string;
|
|
77
|
-
};
|
|
71
|
+
declare const Item: ({ children, className, ref, ...props }: RadioItemProps) => import("react").JSX.Element;
|
|
78
72
|
type RadioIndicatorProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
79
73
|
children?: ReactNode | ((context: RadioStateContextValue) => ReactNode);
|
|
80
74
|
};
|
|
@@ -96,17 +90,31 @@ type RadioIndicatorProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
|
96
90
|
* </RadioGroup.Item>
|
|
97
91
|
* ```
|
|
98
92
|
*/
|
|
99
|
-
declare const Indicator: {
|
|
100
|
-
({ children, className, ...props }: RadioIndicatorProps): import("react").JSX.Element;
|
|
101
|
-
displayName: string;
|
|
102
|
-
};
|
|
93
|
+
declare const Indicator: ({ children, className, ...props }: RadioIndicatorProps) => import("react").JSX.Element;
|
|
103
94
|
/**
|
|
104
95
|
* A group of radio list items. Use RadioGroup.ListItem as direct children.
|
|
96
|
+
*
|
|
97
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogrouplist
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```tsx
|
|
101
|
+
* <RadioGroup.Root defaultValue="option1">
|
|
102
|
+
* <RadioGroup.List>
|
|
103
|
+
* <RadioGroup.ListItem value="option1">
|
|
104
|
+
* <RadioGroup.ItemContent>
|
|
105
|
+
* <Text>Option 1</Text>
|
|
106
|
+
* </RadioGroup.ItemContent>
|
|
107
|
+
* </RadioGroup.ListItem>
|
|
108
|
+
* <RadioGroup.ListItem value="option2">
|
|
109
|
+
* <RadioGroup.ItemContent>
|
|
110
|
+
* <Text>Option 2</Text>
|
|
111
|
+
* </RadioGroup.ItemContent>
|
|
112
|
+
* </RadioGroup.ListItem>
|
|
113
|
+
* </RadioGroup.List>
|
|
114
|
+
* </RadioGroup.Root>
|
|
115
|
+
* ```
|
|
105
116
|
*/
|
|
106
|
-
declare const List: {
|
|
107
|
-
({ className, ref, ...props }: RadioGroupProps$1): import("react").JSX.Element;
|
|
108
|
-
displayName: string;
|
|
109
|
-
};
|
|
117
|
+
declare const List: ({ className, ref, ...props }: RadioGroupProps$1) => import("react").JSX.Element;
|
|
110
118
|
type RadioListItemProps = RadioItemProps;
|
|
111
119
|
/**
|
|
112
120
|
* A radio list item that is used inside a `RadioGroup.List`.
|
|
@@ -115,11 +123,30 @@ type RadioListItemProps = RadioItemProps;
|
|
|
115
123
|
* `Field.Set` / `Field.Legend` composition), picks up `aria-invalid` and
|
|
116
124
|
* `aria-errormessage` from `FieldControlContext`. `aria-describedby` is owned
|
|
117
125
|
* by Headless UI's Radio primitive and does not propagate.
|
|
126
|
+
*
|
|
127
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogrouplistitem
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```tsx
|
|
131
|
+
* <RadioGroup.Root defaultValue="item1">
|
|
132
|
+
* <RadioGroup.List>
|
|
133
|
+
* <RadioGroup.ListItem value="item1">
|
|
134
|
+
* <RadioGroup.ItemContent>
|
|
135
|
+
* <Text>List Item 1</Text>
|
|
136
|
+
* <Text size="sm" className="text-muted">First option</Text>
|
|
137
|
+
* </RadioGroup.ItemContent>
|
|
138
|
+
* </RadioGroup.ListItem>
|
|
139
|
+
* <RadioGroup.ListItem value="item2">
|
|
140
|
+
* <RadioGroup.ItemContent>
|
|
141
|
+
* <Text>List Item 2</Text>
|
|
142
|
+
* <Text size="sm" className="text-muted">Second option</Text>
|
|
143
|
+
* </RadioGroup.ItemContent>
|
|
144
|
+
* </RadioGroup.ListItem>
|
|
145
|
+
* </RadioGroup.List>
|
|
146
|
+
* </RadioGroup.Root>
|
|
147
|
+
* ```
|
|
118
148
|
*/
|
|
119
|
-
declare const ListItem: {
|
|
120
|
-
({ children, className, ref, ...props }: RadioListItemProps): import("react").JSX.Element;
|
|
121
|
-
displayName: string;
|
|
122
|
-
};
|
|
149
|
+
declare const ListItem: ({ children, className, ref, ...props }: RadioListItemProps) => import("react").JSX.Element;
|
|
123
150
|
type RadioItemContentProps = HTMLAttributes<HTMLDivElement> & WithAsChild;
|
|
124
151
|
type RadioCardProps = RadioItemProps;
|
|
125
152
|
/**
|
|
@@ -129,29 +156,69 @@ type RadioCardProps = RadioItemProps;
|
|
|
129
156
|
* `Field.Set` / `Field.Legend` composition), picks up `aria-invalid` and
|
|
130
157
|
* `aria-errormessage` from `FieldControlContext`. `aria-describedby` is owned
|
|
131
158
|
* by Headless UI's Radio primitive and does not propagate.
|
|
159
|
+
*
|
|
160
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupcard
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```tsx
|
|
164
|
+
* <RadioGroup.Root defaultValue="basic">
|
|
165
|
+
* <div className="space-y-3">
|
|
166
|
+
* <RadioGroup.Card value="basic">
|
|
167
|
+
* <RadioGroup.ItemContent>
|
|
168
|
+
* <Text weight="strong">Basic Plan</Text>
|
|
169
|
+
* <Text>$10/month</Text>
|
|
170
|
+
* </RadioGroup.ItemContent>
|
|
171
|
+
* </RadioGroup.Card>
|
|
172
|
+
* <RadioGroup.Card value="pro">
|
|
173
|
+
* <RadioGroup.ItemContent>
|
|
174
|
+
* <Text weight="strong">Pro Plan</Text>
|
|
175
|
+
* <Text>$25/month</Text>
|
|
176
|
+
* </RadioGroup.ItemContent>
|
|
177
|
+
* </RadioGroup.Card>
|
|
178
|
+
* </div>
|
|
179
|
+
* </RadioGroup.Root>
|
|
180
|
+
* ```
|
|
132
181
|
*/
|
|
133
|
-
declare const Card: {
|
|
134
|
-
({ children, className, ref, ...props }: RadioCardProps): import("react").JSX.Element;
|
|
135
|
-
displayName: string;
|
|
136
|
-
};
|
|
182
|
+
declare const Card: ({ children, className, ref, ...props }: RadioCardProps) => import("react").JSX.Element;
|
|
137
183
|
/**
|
|
138
184
|
* The content of any radio item. Use it to wrap any labels, descriptions, or content of a radio item.
|
|
139
185
|
* Use it as a child of `RadioGroup.Item`, `RadioGroup.ListItem`, or `RadioGroup.Card`.
|
|
186
|
+
*
|
|
187
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupitemcontent
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* ```tsx
|
|
191
|
+
* <RadioGroup.Root defaultValue="option1">
|
|
192
|
+
* <RadioGroup.Item value="option1">
|
|
193
|
+
* <RadioGroup.Indicator />
|
|
194
|
+
* <RadioGroup.ItemContent>
|
|
195
|
+
* <Text weight="strong">Option 1</Text>
|
|
196
|
+
* <Text size="sm">Description for option 1</Text>
|
|
197
|
+
* </RadioGroup.ItemContent>
|
|
198
|
+
* </RadioGroup.Item>
|
|
199
|
+
* </RadioGroup.Root>
|
|
200
|
+
* ```
|
|
140
201
|
*/
|
|
141
|
-
declare const ItemContent: {
|
|
142
|
-
({ asChild, children, className, ...props }: RadioItemContentProps): import("react").JSX.Element;
|
|
143
|
-
displayName: string;
|
|
144
|
-
};
|
|
202
|
+
declare const ItemContent: ({ asChild, children, className, ...props }: RadioItemContentProps) => import("react").JSX.Element;
|
|
145
203
|
/**
|
|
146
204
|
* An inline group of radio buttons. Use RadioGroup.Button as direct children.
|
|
147
205
|
* Renders the radio group itself (it wraps `Root`) — use it *in place of*
|
|
148
206
|
* `RadioGroup.Root`, never nested inside one, or the buttons bind to an
|
|
149
207
|
* inner, uncontrolled group and outer `value`/`onChange` props are ignored.
|
|
208
|
+
*
|
|
209
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupbuttongroup
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* ```tsx
|
|
213
|
+
* <Label id="size-label">Size</Label>
|
|
214
|
+
* <RadioGroup.ButtonGroup aria-labelledby="size-label" defaultValue="small">
|
|
215
|
+
* <RadioGroup.Button value="small">Small</RadioGroup.Button>
|
|
216
|
+
* <RadioGroup.Button value="medium">Medium</RadioGroup.Button>
|
|
217
|
+
* <RadioGroup.Button value="large">Large</RadioGroup.Button>
|
|
218
|
+
* </RadioGroup.ButtonGroup>
|
|
219
|
+
* ```
|
|
150
220
|
*/
|
|
151
|
-
declare const ButtonGroup: {
|
|
152
|
-
({ className, ref, ...props }: RadioGroupProps$1): import("react").JSX.Element;
|
|
153
|
-
displayName: string;
|
|
154
|
-
};
|
|
221
|
+
declare const ButtonGroup: ({ className, ref, ...props }: RadioGroupProps$1) => import("react").JSX.Element;
|
|
155
222
|
type RadioButtonProps = RadioItemProps;
|
|
156
223
|
/**
|
|
157
224
|
* A radio button that is used inside a `RadioGroup.ButtonGroup`.
|
|
@@ -160,20 +227,42 @@ type RadioButtonProps = RadioItemProps;
|
|
|
160
227
|
* `Field.Set` / `Field.Legend` composition), picks up `aria-invalid` and
|
|
161
228
|
* `aria-errormessage` from `FieldControlContext`. `aria-describedby` is owned
|
|
162
229
|
* by Headless UI's Radio primitive and does not propagate.
|
|
230
|
+
*
|
|
231
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupbutton
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* ```tsx
|
|
235
|
+
* <RadioGroup.ButtonGroup defaultValue="option1">
|
|
236
|
+
* <RadioGroup.Button value="option1">Option 1</RadioGroup.Button>
|
|
237
|
+
* <RadioGroup.Button value="option2">Option 2</RadioGroup.Button>
|
|
238
|
+
* <RadioGroup.Button value="option3">Option 3</RadioGroup.Button>
|
|
239
|
+
* </RadioGroup.ButtonGroup>
|
|
240
|
+
* ```
|
|
163
241
|
*/
|
|
164
|
-
declare const Button: {
|
|
165
|
-
({ children, className, ref, ...props }: RadioButtonProps): import("react").JSX.Element;
|
|
166
|
-
displayName: string;
|
|
167
|
-
};
|
|
242
|
+
declare const Button: ({ children, className, ref, ...props }: RadioButtonProps) => import("react").JSX.Element;
|
|
168
243
|
type RadioInputSandboxProps = HTMLAttributes<HTMLDivElement>;
|
|
169
244
|
/**
|
|
170
245
|
* A sandbox container for input elements composed within radio group items.
|
|
171
246
|
* It prevents the default behavior of the radio group when clicking on the input element or accepting keyboard input.
|
|
247
|
+
*
|
|
248
|
+
* @see https://mantle.ngrok.com/components/forms/radio-group#radiogroupinputsandbox
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* ```tsx
|
|
252
|
+
* <RadioGroup.Root defaultValue="custom">
|
|
253
|
+
* <RadioGroup.Item value="custom">
|
|
254
|
+
* <RadioGroup.Indicator />
|
|
255
|
+
* <RadioGroup.ItemContent>
|
|
256
|
+
* <Text>Custom amount</Text>
|
|
257
|
+
* <RadioGroup.InputSandbox>
|
|
258
|
+
* <Input type="number" placeholder="Enter amount" />
|
|
259
|
+
* </RadioGroup.InputSandbox>
|
|
260
|
+
* </RadioGroup.ItemContent>
|
|
261
|
+
* </RadioGroup.Item>
|
|
262
|
+
* </RadioGroup.Root>
|
|
263
|
+
* ```
|
|
172
264
|
*/
|
|
173
|
-
declare const InputSandbox: {
|
|
174
|
-
({ children, onClick, onKeyDown, ...props }: RadioInputSandboxProps): import("react").JSX.Element;
|
|
175
|
-
displayName: string;
|
|
176
|
-
};
|
|
265
|
+
declare const InputSandbox: ({ children, onClick, onKeyDown, ...props }: RadioInputSandboxProps) => import("react").JSX.Element;
|
|
177
266
|
/**
|
|
178
267
|
* A group of radio items. It manages the state of the children radios.
|
|
179
268
|
*
|
package/dist/radio-group.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-CDk0Bb9z.js";import{t as n}from"./clsx-DUGZgXfJ.js";import{t as r}from"./field-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-CDk0Bb9z.js";import{t as n}from"./clsx-DUGZgXfJ.js";import{t as r}from"./field-B1wqeZr4.js";import{t as i}from"./input-CXmS0OFN.js";import{Children as a,cloneElement as o,createContext as s,isValidElement as c,useContext as l,useRef as u}from"react";import{jsx as d}from"react/jsx-runtime";import{Radio as f,RadioGroup as p}from"@headlessui/react";const m=({ref:e,...t})=>d(p,{"data-slot":`radio-group`,...t,ref:e}),h=s({autofocus:!1,checked:!1,disabled:!1,focus:!1,hover:!1}),g=({children:t,className:n,ref:i,...a})=>{let o=l(r);return d(f,{"data-slot":`radio-group-item`,className:e(`group/radio cursor-pointer aria-disabled:cursor-default [&_label]:cursor-inherit flex gap-2 py-1 text-sm focus:outline-hidden`,n),as:`div`,...a,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,ref:i,children:e=>d(h.Provider,{value:e,children:t})})},_=({checked:t,disabled:n,focus:r,hover:i})=>d(`span`,{className:e(`border-form flex size-4 items-center justify-center rounded-full border shrink-0`,n&&`cursor-default opacity-50`,t&&`border-accent-600 bg-accent-600`,r&&!n&&`border-accent-600 ring-focus-accent ring-4`,i&&`border-accent-600`),children:t&&d(`span`,{className:`size-2 rounded-full bg-white shrink-0`})}),v={Button:({children:t,className:n,ref:i,...a})=>{let o=l(r);return d(f,{as:`div`,"data-slot":`radio-group-button`,className:e(`group/radio border-form [&_label]:cursor-inherit relative flex flex-1 select-none items-center justify-center gap-2 border px-3 text-sm`,`h-9`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`first-of-type:rounded-bl-md first-of-type:rounded-tl-md last-of-type:rounded-br-md last-of-type:rounded-tr-md`,`not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600 aria-disabled:opacity-50`,`aria-checked:z-1 aria-checked:border-accent-600/40 aria-checked:bg-accent-500/10 not-aria-disabled:hover:aria-checked:border-accent-600`,`has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2`,n),ref:i,...a,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,children:e=>d(h.Provider,{value:e,children:t})})},ButtonGroup:({className:e,ref:t,...r})=>d(m,{"data-slot":`radio-group-button-group`,className:n(`flex flex-row flex-nowrap -space-x-px`,e),...r,ref:t}),Card:({children:e,className:t,ref:i,...a})=>{let o=l(r);return d(f,{as:`div`,"data-slot":`radio-group-card`,className:n(`group/radio border-card bg-card [&_label]:cursor-inherit relative rounded-md border p-4 text-sm`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md`,`aria-disabled:border-form/50 not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600`,`aria-checked:z-1 aria-checked:border-accent-600/50 aria-checked:bg-accent-500/10 not-aria-disabled:hover:aria-checked:border-accent-600 dark-high-contrast:aria-checked:border-accent-600 high-contrast:aria-checked:border-accent-600`,t),...a,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,ref:i,children:t=>d(h.Provider,{value:t,children:e})})},Indicator:({children:t,className:n,...r})=>{let i=l(h);return d(`div`,{"data-slot":`radio-group-indicator`,className:e(`radio-indicator inline-flex size-5 select-none items-center justify-center shrink-0`,n),...r,children:t==null?d(_,{...i}):typeof t==`function`?t(i):t})},InputSandbox:({children:e,onClick:t,onKeyDown:n,...r})=>{let s=u(null),f=l(h),p=a.only(e),m=f.disabled||!f.checked;return d(`div`,{role:`none`,"data-slot":`radio-group-input-sandbox`,ref:s,onKeyDown:e=>{if(f.disabled){e.stopPropagation(),e.preventDefault();return}switch(e.key){case`Enter`:case`Tab`:break;default:e.stopPropagation()}n?.(e)},onClick:e=>{if(f.disabled){e.stopPropagation(),e.preventDefault();return}let n=e.target;i(n)&&window.requestAnimationFrame(()=>{n.focus()}),t?.(e)},...r,children:c(p)?o(p,{disabled:f.disabled||p.props.disabled,tabIndex:m?-1:p.props.tabIndex}):null})},Item:g,ItemContent:({asChild:e=!1,children:r,className:i,...a})=>{let o=l(h);return d(e?t:`div`,{"data-slot":`radio-group-item-content`,className:n(`min-w-0 flex-1`,o.disabled&&`opacity-50`,i),...a,children:r})},List:({className:e,ref:t,...r})=>d(m,{"data-slot":`radio-group-list`,className:n(`-space-y-px`,e),...r,ref:t}),ListItem:({children:t,className:n,ref:i,...a})=>{let o=l(r);return d(f,{as:`div`,"data-slot":`radio-group-list-item`,className:e(`group/radio border-form [&_label]:cursor-inherit relative flex select-none gap-2 border px-3 py-2 text-sm`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`focus-visible:ring-focus-accent not-aria-disabled:focus-visible:border-accent-600 focus-visible:ring-4`,`first-of-type:rounded-tl-md first-of-type:rounded-tr-md last-of-type:rounded-bl-md last-of-type:rounded-br-md`,`aria-disabled:border-form/50 not-aria-disabled:hover:z-1 not-aria-disabled:hover:border-accent-600`,`aria-checked:z-1 aria-checked:border-accent-500/40 aria-checked:bg-accent-500/10 dark-high-contrast:aria-checked:border-accent-400 high-contrast:aria-checked:border-accent-400 not-aria-disabled:hover:aria-checked:border-accent-600`,`has-[.radio-indicator:first-child]:pl-2 has-[.radio-indicator:last-child]:pr-2`,n),ref:i,...a,...o?{"aria-describedby":o[`aria-describedby`],"aria-errormessage":o[`aria-errormessage`],"aria-invalid":o[`aria-invalid`]}:void 0,children:e=>d(h.Provider,{value:e,children:t})})},Root:m};export{v as RadioGroup};
|
|
@@ -25,7 +25,7 @@ type EventProps = BaseProps & {
|
|
|
25
25
|
* Props for the sandboxed onClick container. Spread this on the element you want
|
|
26
26
|
* to prevent the click event from bubbling out of.
|
|
27
27
|
*
|
|
28
|
-
* @see https://mantle.ngrok.com/components/primitives/sandboxed-on-click
|
|
28
|
+
* @see https://mantle.ngrok.com/components/primitives/sandboxed-on-click
|
|
29
29
|
*/
|
|
30
30
|
declare const sandboxedOnClickProps: ({ allowClickEventDefault, onClick }?: EventProps) => {
|
|
31
31
|
/**
|
|
@@ -43,7 +43,7 @@ type Props = ComponentProps<"div"> & WithAsChild & BaseProps;
|
|
|
43
43
|
/**
|
|
44
44
|
* A container that prevents the click event from bubbling out of it.
|
|
45
45
|
*
|
|
46
|
-
* @see https://mantle.ngrok.com/components/primitives/sandboxed-on-click
|
|
46
|
+
* @see https://mantle.ngrok.com/components/primitives/sandboxed-on-click
|
|
47
47
|
*
|
|
48
48
|
* @example
|
|
49
49
|
* ```tsx
|