@radui/ui 0.1.2 → 0.1.4
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/components/Accordion.d.ts +36 -0
- package/dist/components/Accordion.js +1 -0
- package/dist/components/AlertDialog.d.ts +116 -0
- package/dist/components/AlertDialog.js +1 -0
- package/dist/components/AspectRatio.d.ts +13 -0
- package/dist/components/AspectRatio.js +1 -0
- package/dist/components/Avatar.d.ts +31 -0
- package/dist/components/Avatar.js +1 -0
- package/dist/components/AvatarGroup.d.ts +45 -0
- package/dist/components/AvatarGroup.js +1 -0
- package/dist/components/AvatarPrimitiveFallback-BV0bK5Qg.js +1 -0
- package/dist/components/Badge.d.ts +17 -0
- package/dist/components/Badge.js +1 -0
- package/dist/components/BlockQuote.d.ts +17 -0
- package/dist/components/BlockQuote.js +1 -0
- package/dist/components/Button.d.ts +24 -0
- package/dist/components/Button.js +1 -0
- package/dist/components/Callout.d.ts +30 -0
- package/dist/components/Callout.js +1 -0
- package/dist/components/Card.d.ts +20 -0
- package/dist/components/Card.js +1 -0
- package/dist/components/Checkbox.d.ts +33 -0
- package/dist/components/Checkbox.js +1 -0
- package/dist/components/CheckboxCards.d.ts +34 -0
- package/dist/components/CheckboxCards.js +1 -0
- package/dist/components/CheckboxGroup.d.ts +38 -0
- package/dist/components/CheckboxGroup.js +1 -0
- package/dist/components/CheckboxGroupPrimitive-DrGqSxi3.js +1 -0
- package/dist/components/Code.d.ts +17 -0
- package/dist/components/Code.js +1 -0
- package/dist/components/Collapsible.d.ts +24 -0
- package/dist/components/Collapsible.js +1 -0
- package/dist/components/ContextMenu.d.ts +95 -0
- package/dist/components/ContextMenu.js +1 -0
- package/dist/components/DataList.d.ts +16 -0
- package/dist/components/DataList.js +1 -0
- package/dist/components/Dialog.d.ts +97 -0
- package/dist/components/Dialog.js +1 -0
- package/dist/components/Disclosure.d.ts +35 -0
- package/dist/components/Disclosure.js +1 -0
- package/dist/components/DropdownMenu.d.ts +95 -0
- package/dist/components/DropdownMenu.js +1 -0
- package/dist/components/Em.d.ts +11 -0
- package/dist/components/Em.js +1 -0
- package/dist/components/Heading.d.ts +25 -0
- package/dist/components/Heading.js +1 -0
- package/dist/components/HoverCard.d.ts +38 -0
- package/dist/components/HoverCard.js +1 -0
- package/dist/components/Kbd.d.ts +11 -0
- package/dist/components/Kbd.js +1 -0
- package/dist/components/Link.d.ts +11 -0
- package/dist/components/Link.js +1 -0
- package/dist/components/MenuPrimitive-DuUPySFO.js +1 -0
- package/dist/components/Menubar.d.ts +83 -0
- package/dist/components/Menubar.js +1 -0
- package/dist/components/Minimap.d.ts +48 -0
- package/dist/components/Minimap.js +1 -0
- package/dist/components/NavigationMenu.d.ts +35 -0
- package/dist/components/NavigationMenu.js +1 -0
- package/dist/components/NumberField.d.ts +23 -0
- package/dist/components/NumberField.js +1 -0
- package/dist/components/Progress.d.ts +27 -0
- package/dist/components/Progress.js +1 -0
- package/dist/components/Quote.d.ts +11 -0
- package/dist/components/Quote.js +1 -0
- package/dist/components/Radio.d.ts +21 -0
- package/dist/components/Radio.js +1 -0
- package/dist/components/RadioCards.d.ts +38 -0
- package/dist/components/RadioCards.js +1 -0
- package/dist/components/RadioGroup.d.ts +51 -0
- package/dist/components/RadioGroup.js +1 -0
- package/dist/components/RadioGroupPrimitive-D9grAL7G.js +1 -0
- package/dist/components/ScrollArea.d.ts +26 -0
- package/dist/components/ScrollArea.js +1 -0
- package/dist/components/Select.d.ts +90 -0
- package/dist/components/Select.js +1 -0
- package/dist/components/Separator.d.ts +14 -0
- package/dist/components/Separator.js +1 -0
- package/dist/components/Skeleton.d.ts +19 -0
- package/dist/components/Skeleton.js +1 -0
- package/dist/components/Slider.d.ts +81 -0
- package/dist/components/Slider.js +1 -0
- package/dist/components/Splitter.d.ts +57 -0
- package/dist/components/Splitter.js +1 -0
- package/dist/components/Steps.d.ts +38 -0
- package/dist/components/Steps.js +1 -0
- package/dist/components/Strong.d.ts +13 -0
- package/dist/components/Strong.js +1 -0
- package/dist/components/Switch.d.ts +57 -0
- package/dist/components/Switch.js +1 -0
- package/dist/components/TabNav.d.ts +21 -0
- package/dist/components/TabNav.js +1 -0
- package/dist/components/Table.d.ts +31 -0
- package/dist/components/Table.js +1 -0
- package/dist/components/Tabs.d.ts +43 -0
- package/dist/components/Tabs.js +1 -0
- package/dist/components/Text.d.ts +17 -0
- package/dist/components/Text.js +1 -0
- package/dist/components/TextArea.d.ts +19 -0
- package/dist/components/TextArea.js +1 -0
- package/dist/components/Theme.d.ts +17 -0
- package/dist/components/Theme.js +1 -0
- package/dist/components/Toggle.d.ts +34 -0
- package/dist/components/Toggle.js +1 -0
- package/dist/components/ToggleGroup.d.ts +63 -0
- package/dist/components/ToggleGroup.js +1 -0
- package/dist/components/Tooltip.d.ts +35 -0
- package/dist/components/Tooltip.js +1 -0
- package/dist/components/Tree.d.ts +37 -0
- package/dist/components/Tree.js +1 -0
- package/dist/components/VisuallyHidden.d.ts +12 -0
- package/dist/components/VisuallyHidden.js +1 -0
- package/dist/components/clsx-BaVHROc5.js +1 -0
- package/dist/components/floating-ui.react-CLbXmKZY.js +5 -0
- package/dist/components/index-BRmT6kl7.js +1 -0
- package/dist/components/index-BVxS3Ixi.js +1 -0
- package/dist/components/index-Bf4LVEjJ.js +1 -0
- package/dist/components/index-BtoPzkH9.js +1 -0
- package/dist/components/index-DBZNt4Em.js +1 -0
- package/dist/components/index-Dc5Cm9z0.js +1 -0
- package/dist/components/index-Di6TooPD.js +1 -0
- package/dist/components/index-DnCiOYxZ.js +1 -0
- package/dist/components/index-XqbKa2D2.js +1 -0
- package/dist/components/index-YgKcfT__.js +1 -0
- package/dist/components/index-fkj4Fdgt.js +1 -0
- package/dist/components/tslib.es6-BtVxab8e.js +1 -0
- package/dist/themes/default.css +1 -0
- package/dist/themes/tailwind-presets/default.js +1 -0
- package/package.json +119 -3
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type SkeletonProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
4
|
+
loading: boolean;
|
|
5
|
+
customRootClass?: string;
|
|
6
|
+
height: string;
|
|
7
|
+
width: string;
|
|
8
|
+
radius?: string;
|
|
9
|
+
};
|
|
10
|
+
declare const Skeleton: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
11
|
+
loading: boolean;
|
|
12
|
+
customRootClass?: string;
|
|
13
|
+
height: string;
|
|
14
|
+
width: string;
|
|
15
|
+
radius?: string;
|
|
16
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
|
|
18
|
+
export { Skeleton as default };
|
|
19
|
+
export type { SkeletonProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as e,a as s}from"./tslib.es6-BtVxab8e.js";import t from"react";import{c as a}from"./index-BVxS3Ixi.js";import{c as r}from"./clsx-BaVHROc5.js";var i="Skeleton",o=t.forwardRef((function(o,l){var d,m=o.loading,n=void 0===m||m,c=o.className,h=void 0===c?"":c,f=o.customRootClass,u=void 0===f?"":f,v=o.children,g=o.height,p=o.width,k=o.radius,w=o.style,y=e(o,["loading","className","customRootClass","children","height","width","radius","style"]);if(!n)return t.createElement(t.Fragment,null,v);var N=a(u,i);return t.createElement("div",s({ref:l,className:r(N,h),style:s(s({},w),(d={},d["--skeleton-height"]=g,d["--skeleton-width"]=p,d["--skeleton-radius"]=k,d))},y))}));o.displayName=i;export{o as default};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React, { ForwardRefExoticComponent, ComponentPropsWithoutRef, RefAttributes, ElementRef } from 'react';
|
|
2
|
+
|
|
3
|
+
declare const SliderRoot: React.ForwardRefExoticComponent<{
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
customRootClass?: string;
|
|
7
|
+
defaultValue?: number;
|
|
8
|
+
value?: number;
|
|
9
|
+
onValueChange?: (value: number) => void;
|
|
10
|
+
min?: number;
|
|
11
|
+
max?: number;
|
|
12
|
+
step?: number;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
name?: string;
|
|
15
|
+
orientation?: "horizontal" | "vertical";
|
|
16
|
+
pageStepMultiplier?: number;
|
|
17
|
+
showStepMarks?: boolean;
|
|
18
|
+
formatValue?: (value: number) => string;
|
|
19
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
|
|
21
|
+
declare const SliderTrack: React.ForwardRefExoticComponent<{
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
|
|
25
|
+
declare const SliderThumb: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
asChild?: boolean;
|
|
28
|
+
'aria-label'?: string;
|
|
29
|
+
'aria-labelledby'?: string;
|
|
30
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLElement>>>;
|
|
31
|
+
|
|
32
|
+
declare const SliderRange: React.ForwardRefExoticComponent<{
|
|
33
|
+
children: React.ReactNode;
|
|
34
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
|
|
36
|
+
declare const SliderMarks: React.ForwardRefExoticComponent<{
|
|
37
|
+
children?: React.ReactNode;
|
|
38
|
+
customMarks?: Array<{
|
|
39
|
+
value: number;
|
|
40
|
+
label?: string;
|
|
41
|
+
}>;
|
|
42
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
43
|
+
|
|
44
|
+
declare const SliderRangeSlider: React.ForwardRefExoticComponent<{
|
|
45
|
+
children?: React.ReactNode;
|
|
46
|
+
'aria-label'?: string;
|
|
47
|
+
'aria-labelledby'?: string;
|
|
48
|
+
defaultValue?: [number, number];
|
|
49
|
+
value?: [number, number];
|
|
50
|
+
onValueChange?: (value: [number, number]) => void;
|
|
51
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
52
|
+
|
|
53
|
+
type SliderElement = ElementRef<'div'>;
|
|
54
|
+
type SliderProps = {
|
|
55
|
+
defaultValue?: number;
|
|
56
|
+
value?: number;
|
|
57
|
+
onValueChange?: (value: number) => void;
|
|
58
|
+
min?: number;
|
|
59
|
+
max?: number;
|
|
60
|
+
step?: number;
|
|
61
|
+
disabled?: boolean;
|
|
62
|
+
name?: string;
|
|
63
|
+
orientation?: 'horizontal' | 'vertical';
|
|
64
|
+
pageStepMultiplier?: number;
|
|
65
|
+
showStepMarks?: boolean;
|
|
66
|
+
formatValue?: (value: number) => string;
|
|
67
|
+
'aria-label'?: string;
|
|
68
|
+
'aria-labelledby'?: string;
|
|
69
|
+
} & ComponentPropsWithoutRef<'div'>;
|
|
70
|
+
type SliderComponent = ForwardRefExoticComponent<SliderProps & RefAttributes<SliderElement>> & {
|
|
71
|
+
Root: typeof SliderRoot;
|
|
72
|
+
Track: typeof SliderTrack;
|
|
73
|
+
Range: typeof SliderRange;
|
|
74
|
+
Thumb: typeof SliderThumb;
|
|
75
|
+
Marks: typeof SliderMarks;
|
|
76
|
+
RangeSlider: typeof SliderRangeSlider;
|
|
77
|
+
};
|
|
78
|
+
declare const Slider: SliderComponent;
|
|
79
|
+
|
|
80
|
+
export { Slider as default };
|
|
81
|
+
export type { SliderElement, SliderProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as e,a,b as t}from"./tslib.es6-BtVxab8e.js";import r,{createContext as n,forwardRef as o}from"react";import{c as l}from"./clsx-BaVHROc5.js";import{c as i}from"./index-BVxS3Ixi.js";import{u as c}from"./index-fkj4Fdgt.js";import{P as u}from"./index-Dc5Cm9z0.js";var s=n({rootClass:"",value:0,setValue:function(){},minValue:0,maxValue:100,step:1,name:void 0,isDragging:!1,setDragging:function(){},disabled:!1,orientation:"horizontal",pageStepMultiplier:10,showStepMarks:!1,formatValue:void 0}),m="Slider",d=o((function(t,n){var o=t.children,u=t.className,d=void 0===u?"":u,v=t.customRootClass,p=void 0===v?"":v,f=t.defaultValue,h=void 0===f?0:f,b=t.value,g=t.onValueChange,w=t.min,x=void 0===w?0:w,k=t.max,y=void 0===k?100:k,M=t.step,V=void 0===M?1:M,E=t.disabled,S=void 0!==E&&E,C=t.name,N=t.orientation,D=void 0===N?"horizontal":N,P=t.pageStepMultiplier,R=void 0===P?10:P,X=t.showStepMarks,L=void 0!==X&&X,T=t.formatValue,B=e(t,["children","className","customRootClass","defaultValue","value","onValueChange","min","max","step","disabled","name","orientation","pageStepMultiplier","showStepMarks","formatValue"]),A=i(p,m),U=c(b,h,g),j=U[0],Y=U[1],z=r.useState(!1),F=z[0],I=z[1],K=r.useRef(0),q=function(e){return Math.min(y,Math.max(x,e))},H=function(e){var a,t=e.currentTarget.getBoundingClientRect();a="vertical"===D?(t.bottom-e.clientY)/t.height:(e.clientX-t.left)/t.width;var r=x+a*(y-x),n=Math.round(r/V)*V,o=q(n);Y(o)},_={rootClass:A,value:j,setValue:Y,minValue:x,maxValue:y,step:V,name:C,isDragging:F,setDragging:I,disabled:S,orientation:D,pageStepMultiplier:R,showStepMarks:L,formatValue:T};return r.createElement(s.Provider,{value:_},r.createElement("div",a({ref:n,className:l(A,d),"data-slider-root":A,"data-disabled":S,"data-orientation":D,onPointerDown:function(e){if(!S){e.stopPropagation(),I(!0),H(e);var a=function(e){e.preventDefault();var a=document.querySelector('[data-slider-root="'.concat(A,'"]'));if(a){var t,r=a.getBoundingClientRect();t="vertical"===D?(r.bottom-e.clientY)/r.height:(e.clientX-r.left)/r.width;var n=x+t*(y-x),o=Math.round(n/V)*V,l=q(o),i=performance.now();i-K.current>16&&(Y(l),K.current=i)}},t=function(){I(!1),document.removeEventListener("pointermove",a),document.removeEventListener("pointerup",t)};document.addEventListener("pointermove",a),document.addEventListener("pointerup",t)}},onPointerMove:function(e){F&&(e.preventDefault(),H(e))},onPointerUp:function(){I(!1)}},B),o))}));d.displayName=m;var v=o((function(t,n){var o=t.children,l=e(t,["children"]),i=r.useContext(s).rootClass;return r.createElement("div",a({ref:n,className:"".concat(i,"-track"),style:{position:"relative"}},l),o)}));v.displayName="SliderTrack";var p=r.memo(o((function(t,n){var o=t.children,l=t.asChild,i=void 0!==l&&l,c=t["aria-label"],m=t["aria-labelledby"],d=e(t,["children","asChild","aria-label","aria-labelledby"]),v=r.useContext(s),p=v.rootClass,f=v.value,h=v.minValue,b=v.maxValue,g=v.step,w=v.setValue,x=v.name,k=v.isDragging,y=v.setDragging,M=v.disabled,V=v.orientation,E=v.pageStepMultiplier,S=v.formatValue,C=b===h?0:(f-h)/(b-h)*100,N=r.useState(!1),D=N[0],P=N[1],R=k?"dragging":D?"active":"inactive",X=r.createElement(u.div,a({ref:n,asChild:i,className:"".concat(p,"-thumb"),role:"slider",tabIndex:M?-1:0,"aria-valuemin":h,"aria-valuemax":b,"aria-valuenow":f,"aria-valuetext":S?S(f):void 0,"aria-orientation":V,"aria-label":c,"aria-labelledby":m,"data-state":R,"data-disabled":M,onKeyDown:function(e){if(!M){var a,t=f,r=Boolean(e.currentTarget.closest('[dir="rtl"]'));switch(e.key){case"ArrowRight":t=r?f-g:f+g;break;case"ArrowLeft":t=r?f+g:f-g;break;case"ArrowUp":t=f+g;break;case"ArrowDown":t=f-g;break;case"Home":t=h;break;case"End":t=b;break;case"PageUp":t=f+g*E;break;case"PageDown":t=f-g*E;break;default:return}e.preventDefault(),w((a=t,Math.min(b,Math.max(h,a))))}},onPointerDown:function(e){M||(e.stopPropagation(),y(!0))},onPointerUp:function(){y(!1)},onFocus:function(){return P(!0)},onBlur:function(){return P(!1)},style:"vertical"===V?{bottom:"calc(".concat(C,"% - 12px)")}:{left:"calc(".concat(C,"% - 12px)")}},d),o);return r.createElement(r.Fragment,null,X,r.createElement("input",{type:"hidden",value:f,name:x}))})));p.displayName="SliderThumb";var f=o((function(t,n){var o=t.children,l=e(t,["children"]),i=r.useContext(s),c=i.rootClass,u=i.value,m=i.minValue,d=i.maxValue,v=i.orientation,p=d===m?0:(u-m)/(d-m)*100;return r.createElement("div",a({ref:n,className:"".concat(c,"-range"),style:"vertical"===v?{height:"".concat(p,"%"),bottom:0,top:"auto"}:{width:"".concat(p,"%")}},l),o)}));f.displayName="SliderRange";var h=o((function(t,n){var o=t.children,l=t.customMarks,i=e(t,["children","customMarks"]),c=r.useContext(s),u=c.rootClass,m=c.minValue,d=c.maxValue,v=c.step,p=c.orientation;if(!c.showStepMarks&&!l)return null;var f=[];if(l)l.forEach((function(e){var a=e.value,t=e.label,n=d===m?0:(a-m)/(d-m)*100;f.push(r.createElement("div",{key:a,className:"".concat(u,"-mark ").concat(u,"-mark-custom"),"data-testid":"mark-".concat(a),style:"vertical"===p?{bottom:"".concat(n,"%"),left:"50%",transform:"translateX(-50%)"}:{left:"".concat(n,"%"),top:0,transform:"translateX(-50%)"},"data-value":a},r.createElement("div",{className:"".concat(u,"-mark-line"),style:"vertical"===p?{width:"2px",height:"12px",position:"absolute",bottom:"-6px",left:"50%",transform:"translateX(-50%)"}:{width:"1px",height:"6px",position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)"}}),t&&r.createElement("span",{className:"".concat(u,"-mark-label"),style:"vertical"===p?{right:"16px",top:"50%",transform:"translateY(-50%)",whiteSpace:"nowrap"}:{top:"8px",left:"50%",transform:"translateX(-50%)",whiteSpace:"nowrap"}},t)))}));else for(var h=m;h<=d;h+=v){var b=d===m?0:(h-m)/(d-m)*100;f.push(r.createElement("div",{key:h,className:"".concat(u,"-mark"),"data-testid":"mark-".concat(h),style:"vertical"===p?{bottom:"".concat(b,"%"),left:"50%",transform:"translateX(-50%)"}:{left:"".concat(b,"%"),top:0,transform:"translateX(-50%)"},"data-value":h},r.createElement("div",{className:"".concat(u,"-mark-line"),style:"vertical"===p?{width:"2px",height:"8px",position:"absolute",bottom:"-4px",left:"50%",transform:"translateX(-50%)"}:{width:"1px",height:"4px",position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)"}})))}return r.createElement("div",a({ref:n,className:"".concat(u,"-marks"),style:{position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",zIndex:1}},i),f,o)}));h.displayName="SliderMarks";var b=o((function(n,o){var l=n.children,i=n["aria-label"],c=n["aria-labelledby"],m=n.defaultValue,d=void 0===m?[25,75]:m,v=n.value,p=n.onValueChange,f=e(n,["children","aria-label","aria-labelledby","defaultValue","value","onValueChange"]),h=r.useContext(s),b=h.rootClass,g=h.minValue,w=h.maxValue,x=h.step,k=h.disabled,y=h.orientation,M=r.useState(v||d),V=M[0],E=M[1],S=r.useState(null),C=S[0],N=S[1],D=r.useState(null),P=D[0],R=D[1],X=r.useRef(0),L=function(e){return Math.min(w,Math.max(g,e))},T=function(e){E(e),null==p||p(e)},B=w===g?0:(V[0]-g)/(w-g)*100,A=w===g?0:(V[1]-g)/(w-g)*100,U=function(e,a){var r,n=e.currentTarget.getBoundingClientRect();r="vertical"===y?(n.bottom-e.clientY)/n.height:(e.clientX-n.left)/n.width;var o=g+r*(w-g),l=Math.round(o/x)*x,i=L(l),c=t([],V,!0);c["lower"===a?0:1]=i,"lower"===a?c[0]=Math.min(c[0],V[1]):c[1]=Math.max(c[1],V[0]),T(c)},j=function(e,a){if(!k){e.stopPropagation(),N(a),U(e,a);var r=function(e){e.preventDefault();var r=document.querySelector('[data-slider-root="'.concat(b,'"]'));if(r){var n,o=r.getBoundingClientRect();n="vertical"===y?(o.bottom-e.clientY)/o.height:(e.clientX-o.left)/o.width;var l=g+n*(w-g),i=Math.round(l/x)*x,c=L(i),u=t([],V,!0);u["lower"===a?0:1]=c,"lower"===a?u[0]=Math.min(u[0],V[1]):u[1]=Math.max(u[1],V[0]);var s=performance.now();s-X.current>16&&(T(u),X.current=s)}},n=function(){N(null),document.removeEventListener("pointermove",r),document.removeEventListener("pointerup",n)};document.addEventListener("pointermove",r),document.addEventListener("pointerup",n)}},Y=function(e,a){C&&C===a&&(e.preventDefault(),U(e,a))},z=function(){N(null)},F=function(e,a){if(!k){var r=t([],V,!0),n=Boolean(e.currentTarget.closest('[dir="rtl"]'));switch(e.key){case"ArrowRight":r["lower"===a?0:1]=n?V["lower"===a?0:1]-x:V["lower"===a?0:1]+x;break;case"ArrowLeft":r["lower"===a?0:1]=n?V["lower"===a?0:1]+x:V["lower"===a?0:1]-x;break;case"ArrowUp":r["lower"===a?0:1]=V["lower"===a?0:1]+x;break;case"ArrowDown":r["lower"===a?0:1]=V["lower"===a?0:1]-x;break;case"Home":r["lower"===a?0:1]=g;break;case"End":r["lower"===a?0:1]=w;break;default:return}e.preventDefault(),"lower"===a?r[0]=Math.min(r[0],V[1]):r[1]=Math.max(r[1],V[0]),r[0]=L(r[0]),r[1]=L(r[1]),T(r)}};return r.createElement("div",a({ref:o,className:"".concat(b,"-range-slider")},f),r.createElement(u.div,{className:"".concat(b,"-thumb ").concat(b,"-thumb-lower"),role:"slider",tabIndex:k?-1:0,"aria-valuemin":g,"aria-valuemax":w,"aria-valuenow":V[0],"aria-orientation":y,"aria-label":i?"".concat(i," minimum"):"Minimum value","aria-labelledby":c,"data-state":"lower"===C?"dragging":"lower"===P?"active":"inactive","data-disabled":k,onKeyDown:function(e){return F(e,"lower")},onFocus:function(){return R("lower")},onBlur:function(){return R(null)},onPointerDown:function(e){return j(e,"lower")},onPointerMove:function(e){return Y(e,"lower")},onPointerUp:z,style:"vertical"===y?{bottom:"calc(".concat(B,"% - 12px)")}:{left:"calc(".concat(B,"% - 12px)")}}),r.createElement(u.div,{className:"".concat(b,"-thumb ").concat(b,"-thumb-upper"),role:"slider",tabIndex:k?-1:0,"aria-valuemin":g,"aria-valuemax":w,"aria-valuenow":V[1],"aria-orientation":y,"aria-label":i?"".concat(i," maximum"):"Maximum value","aria-labelledby":c,"data-state":"upper"===C?"dragging":"upper"===P?"active":"inactive","data-disabled":k,onKeyDown:function(e){return F(e,"upper")},onFocus:function(){return R("upper")},onBlur:function(){return R(null)},onPointerDown:function(e){return j(e,"upper")},onPointerMove:function(e){return Y(e,"upper")},onPointerUp:z,style:"vertical"===y?{bottom:"calc(".concat(A,"% - 12px)")}:{left:"calc(".concat(A,"% - 12px)")}}),r.createElement("div",{className:"".concat(b,"-range-fill"),style:"vertical"===y?{bottom:"".concat(Math.min(B,A),"%"),height:"".concat(Math.abs(A-B),"%"),left:0,right:0}:{left:"".concat(Math.min(B,A),"%"),width:"".concat(Math.abs(A-B),"%"),top:0,bottom:0}}),l)}));b.displayName="SliderRangeSlider";var g=o((function(t,n){var o=t.defaultValue,l=void 0===o?50:o,i=t.min,c=void 0===i?0:i,u=t.max,s=void 0===u?100:u,m=t.step,d=void 0===m?1:m,v=t.orientation,p=void 0===v?"horizontal":v,f=t.formatValue,h=t["aria-label"],b=t["aria-labelledby"],w=e(t,["defaultValue","min","max","step","orientation","formatValue","aria-label","aria-labelledby"]);return r.createElement(g.Root,a({ref:n,defaultValue:l,min:c,max:s,step:d,orientation:p,formatValue:f},w),r.createElement(g.Track,null,r.createElement(g.Range,null,r.createElement(g.Thumb,{"aria-label":h,"aria-labelledby":b}))))}));g.displayName="Slider",g.Root=d,g.Track=v,g.Range=f,g.Thumb=p,g.Marks=h,g.RangeSlider=b;export{g as default};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type SplitterOrientation = 'horizontal' | 'vertical';
|
|
4
|
+
|
|
5
|
+
interface SplitterRootProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
6
|
+
orientation?: SplitterOrientation;
|
|
7
|
+
customRootClass?: string;
|
|
8
|
+
defaultSizes?: number[];
|
|
9
|
+
minSizes?: number[];
|
|
10
|
+
maxSizes?: number[];
|
|
11
|
+
onSizesChange?: (sizes: number[]) => void;
|
|
12
|
+
}
|
|
13
|
+
declare const SplitterRoot: React.ForwardRefExoticComponent<SplitterRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
|
|
15
|
+
interface SplitterPanelProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
16
|
+
index: number;
|
|
17
|
+
customRootClass?: string;
|
|
18
|
+
minSize?: number;
|
|
19
|
+
maxSize?: number;
|
|
20
|
+
}
|
|
21
|
+
declare const SplitterPanel: React.ForwardRefExoticComponent<SplitterPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
|
|
23
|
+
interface SplitterHandleProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
24
|
+
index: number;
|
|
25
|
+
customRootClass?: string;
|
|
26
|
+
}
|
|
27
|
+
declare const SplitterHandle: React.ForwardRefExoticComponent<SplitterHandleProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Splitter Component
|
|
31
|
+
*
|
|
32
|
+
* A headless splitter component for creating resizable panel layouts.
|
|
33
|
+
* Supports both horizontal and vertical orientations with drag and keyboard controls.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* <Splitter.Root orientation="horizontal" defaultSizes={[30, 70]}>
|
|
38
|
+
* <Splitter.Panel index={0}>
|
|
39
|
+
* <div>Left Panel</div>
|
|
40
|
+
* </Splitter.Panel>
|
|
41
|
+
* <Splitter.Handle index={0} />
|
|
42
|
+
* <Splitter.Panel index={1}>
|
|
43
|
+
* <div>Right Panel</div>
|
|
44
|
+
* </Splitter.Panel>
|
|
45
|
+
* </Splitter.Root>
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
type SplitterProps = React.ComponentPropsWithoutRef<'div'>;
|
|
49
|
+
type SplitterComponent = React.ForwardRefExoticComponent<SplitterProps & React.RefAttributes<HTMLDivElement>> & {
|
|
50
|
+
Root: typeof SplitterRoot;
|
|
51
|
+
Panel: typeof SplitterPanel;
|
|
52
|
+
Handle: typeof SplitterHandle;
|
|
53
|
+
};
|
|
54
|
+
declare const Splitter: SplitterComponent;
|
|
55
|
+
|
|
56
|
+
export { Splitter as default };
|
|
57
|
+
export type { SplitterProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as e,b as t,a as n}from"./tslib.es6-BtVxab8e.js";import r,{createContext as a,useRef as i,useState as o,useCallback as l,useMemo as s,useEffect as c}from"react";import{c as u}from"./index-BVxS3Ixi.js";import{c as m}from"./clsx-BaVHROc5.js";var d=a(null),f=function(){var e=r.useContext(d);if(!e)throw new Error("Splitter components must be used within a Splitter.Root");return e},v=r.forwardRef((function(a,f){var v=a.orientation,h=void 0===v?"horizontal":v,p=a.children,x=a.className,S=a.customRootClass,y=void 0===S?"":S,w=a.defaultSizes,z=void 0===w?[50,50]:w,M=a.minSizes,g=void 0===M?[0,0]:M,D=a.maxSizes,E=void 0===D?[100,100]:D,N=a.onSizesChange,R=a.style,b=e(a,["orientation","children","className","customRootClass","defaultSizes","minSizes","maxSizes","onSizesChange","style"]),L=u(y,"Splitter"),C=i(null),A=o(z),H=A[0],X=A[1],Y=o(!1),k=Y[0],P=Y[1],K=o(null),T=K[0],j=K[1],F=o(null);F[0];var I=F[1],W=l((function(e){C.current=e,"function"==typeof f?f(e):f&&(f.current=e)}),[f]),q=s((function(){return{minSizes:g||[],maxSizes:E||[]}}),[g,E]),B=i(null);c((function(){return function(){B.current&&(clearTimeout(B.current),B.current=null)}}),[]);var G=i(H),U=i(q);G.current=H,U.current=q;var _="horizontal"===h,J=l((function(e,t){void 0===t&&(t=!1),X(e),B.current&&clearTimeout(B.current),N&&(t?N(e):B.current=setTimeout((function(){N(e)}),16))}),[N]),O=l((function(e,n){n.preventDefault();var r=_?"clientX"in n?n.clientX:n.touches[0].clientX:"clientY"in n?n.clientY:n.touches[0].clientY,a=t([],G.current,!0);I({position:r,sizes:a}),P(!0),j(e);var i=null,o=0,l=function(n){if(C.current){var l=Date.now();l-o<16||(i&&cancelAnimationFrame(i),i=requestAnimationFrame((function(){var i=((_?"clientX"in n?n.clientX:n.touches[0].clientX:"clientY"in n?n.clientY:n.touches[0].clientY)-r)/(_?C.current.offsetWidth:C.current.offsetHeight)*100,s=t([],a,!0),c=U.current,u=c.minSizes,m=c.maxSizes,d=e,f=e+1;s.length;var v=s[d],h=s[f],p=Math.max(u[d]||0,Math.min(m[d]||100,v+i)),x=Math.max(u[f]||0,Math.min(m[f]||100,h-i)),S=p+x,y=100-(v+h);if(Math.abs(i)>.1)if(S<=100)s[d]=p,s[f]=x;else{var w=v/(v+h),z=100-y;s[d]=Math.max(u[d]||0,Math.min(m[d]||100,z*w)),s[f]=Math.max(u[f]||0,Math.min(m[f]||100,z*(1-w)))}X(s),o=l})))}},s=function(){i&&cancelAnimationFrame(i),P(!1),j(null),I(null);var e=G.current;N&&N(e),document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",s),document.removeEventListener("touchmove",l),document.removeEventListener("touchend",s)};document.addEventListener("mousemove",l),document.addEventListener("mouseup",s),document.addEventListener("touchmove",l),document.addEventListener("touchend",s)}),[_,N]),Q=l((function(e,n){var r=n.shiftKey?10:1,a=t([],G.current,!0),i=U.current,o=i.minSizes,l=i.maxSizes,s=0;if(_?("ArrowLeft"===n.key&&(s=-r),"ArrowRight"===n.key&&(s=r)):("ArrowUp"===n.key&&(s=-r),"ArrowDown"===n.key&&(s=r)),0!==s){n.preventDefault();var c=e,u=e+1,m=a[c],d=a[u],f=Math.max(o[c]||0,Math.min(l[c]||100,m+s)),v=Math.max(o[u]||0,Math.min(l[u]||100,d-s)),h=f+v,p=100-(m+d);if(Math.abs(s)>.1)if(h<=100)a[c]=f,a[u]=v;else{var x=m/(m+d),S=100-p;a[c]=Math.max(o[c]||0,Math.min(l[c]||100,S*x)),a[u]=Math.max(o[u]||0,Math.min(l[u]||100,S*(1-x)))}J(a,!0)}}),[_,J]),V={orientation:h,sizes:H,setSizes:J,startDrag:O,handleKeyDown:Q,isDragging:k,activeHandleIndex:T,rootClass:L};return r.createElement(d.Provider,{value:V},r.createElement("div",n({},b,{ref:W,className:m(L,x),style:n({display:"flex",flexDirection:_?"row":"column",width:"100%",height:"100%"},R)}),p))}));v.displayName="SplitterRoot";var h=r.forwardRef((function(t,a){var i=t.index,o=t.children,l=t.className,s=t.style,c=e(t,["index","children","className","style"]),u=f(),d=u.sizes,v=u.orientation,h=u.rootClass,p=n({flexBasis:"".concat(d[i],"%"),flexGrow:0,flexShrink:0,overflow:"auto",minWidth:"horizontal"===v?0:void 0,minHeight:"vertical"===v?0:void 0},s);return r.createElement("div",n({},c,{ref:a,className:m("".concat(h,"-panel"),l),style:p}),o)}));h.displayName="SplitterPanel";var p=r.forwardRef((function(t,a){var i=t.index,o=t.className,l=t["aria-label"],s=t.style,c=e(t,["index","className","aria-label","style"]),u=f(),d=u.startDrag,v=u.orientation;u.isDragging,u.activeHandleIndex;var h=u.handleKeyDown,p=u.rootClass;return r.createElement("div",n({},c,{ref:a,className:m("".concat(p,"-handle"),o),role:"separator","aria-orientation":v,"aria-label":l||"".concat(v," resize handle"),tabIndex:0,onMouseDown:function(e){return d(i,e)},onTouchStart:function(e){return d(i,e)},onKeyDown:function(e){return h(i,e)},style:s}))}));p.displayName="SplitterHandle";var x=r.forwardRef((function(e,t){return console.warn("Direct usage of Splitter is not supported. Please use Splitter.Root, Splitter.Panel, etc. instead."),r.createElement("div",n({ref:t},e))}));x.displayName="Splitter",x.Root=v,x.Panel=h,x.Handle=p;export{x as default};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
declare const StepsRoot: ({ children, className, customRootClass, ...props }: StepsRootProps) => React.JSX.Element;
|
|
4
|
+
|
|
5
|
+
type StepItemProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
value?: string | null;
|
|
7
|
+
};
|
|
8
|
+
declare const StepItem: ({ children, value, className, ...props }: StepItemProps) => React.JSX.Element;
|
|
9
|
+
|
|
10
|
+
type StepTrackProps = React.HTMLAttributes<HTMLDivElement>;
|
|
11
|
+
declare const StepTrack: ({ children, className, ...props }: StepTrackProps) => React.JSX.Element;
|
|
12
|
+
|
|
13
|
+
declare const StepBubble: ({ children, className, ...props }: StepBubbleProps) => React.JSX.Element;
|
|
14
|
+
|
|
15
|
+
type StepLineProps = React.HTMLAttributes<HTMLDivElement>;
|
|
16
|
+
declare const StepLine: ({ children, className, ...props }: StepLineProps) => React.JSX.Element;
|
|
17
|
+
|
|
18
|
+
declare const StepContent: ({ children, className, ...props }: StepContentProps) => React.JSX.Element;
|
|
19
|
+
|
|
20
|
+
declare const StepTitle: ({ children, className, ...props }: StepTitleProps) => React.JSX.Element;
|
|
21
|
+
|
|
22
|
+
type StepDescriptionProps = React.HTMLAttributes<HTMLDivElement>;
|
|
23
|
+
declare const StepDescription: ({ children, className, ...props }: StepDescriptionProps) => React.JSX.Element;
|
|
24
|
+
|
|
25
|
+
declare const StepsComponent: () => null;
|
|
26
|
+
type StepsComponentType = typeof StepsComponent & {
|
|
27
|
+
Root: typeof StepsRoot;
|
|
28
|
+
Item: typeof StepItem;
|
|
29
|
+
Track: typeof StepTrack;
|
|
30
|
+
Bubble: typeof StepBubble;
|
|
31
|
+
Line: typeof StepLine;
|
|
32
|
+
Content: typeof StepContent;
|
|
33
|
+
Title: typeof StepTitle;
|
|
34
|
+
Description: typeof StepDescription;
|
|
35
|
+
};
|
|
36
|
+
declare const Steps: StepsComponentType;
|
|
37
|
+
|
|
38
|
+
export { Steps as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as e,a as t}from"./tslib.es6-BtVxab8e.js";import s,{createContext as a,useState as r}from"react";import{c}from"./clsx-BaVHROc5.js";import{c as n}from"./index-BVxS3Ixi.js";import{P as o}from"./index-Dc5Cm9z0.js";var l=a(null),i=Object.assign((function(){return console.warn("Direct usage of Steps is not supported. Please use Steps.Root, Steps.Item, etc. instead."),null}),{Root:function(a){var i=a.children,m=a.className,u=a.customRootClass,d=e(a,["children","className","customRootClass"]),v=r(0),N=v[0],C=v[1],p=n(u,"Steps");return s.createElement(l.Provider,{value:{currentStep:N,setCurrentStep:C,rootClass:p}},s.createElement(o.div,t({className:c(p,m)},d),i))},Item:function(a){var r=a.children;a.value;var n=a.className,o=void 0===n?"":n,i=e(a,["children","value","className"]),m=s.useContext(l),u=m.rootClass;return m.currentStep,m.setCurrentStep,s.createElement("div",t({className:c("".concat(u,"-item"),o)},i),r)},Track:function(a){var r=a.children,n=a.className,o=void 0===n?"":n,i=e(a,["children","className"]),m=s.useContext(l).rootClass;return s.createElement("div",t({className:c("".concat(m,"-track"),o)},i),r)},Bubble:function(a){var r=a.children,n=a.className,o=void 0===n?"":n,i=e(a,["children","className"]),m=s.useContext(l).rootClass;return s.createElement("div",t({className:c("".concat(m,"-bubble"),o)},i),r)},Line:function(a){var r=a.children,n=a.className,o=void 0===n?"":n,i=e(a,["children","className"]),m=s.useContext(l).rootClass;return s.createElement("div",t({className:c("".concat(m,"-line"),o)},i),r)},Content:function(a){var r=a.children,n=a.className,o=void 0===n?"":n,i=e(a,["children","className"]),m=s.useContext(l).rootClass;return s.createElement("div",t({className:c("".concat(m,"-content"),o)},i),r)},Title:function(a){var r=a.children,n=a.className,o=void 0===n?"":n,i=e(a,["children","className"]),m=s.useContext(l).rootClass;return s.createElement("div",t({className:c("".concat(m,"-title"),o)},i),r)},Description:function(a){var r=a.children,n=a.className,o=void 0===n?"":n,i=e(a,["children","className"]),m=s.useContext(l).rootClass;return s.createElement("div",t({className:c("".concat(m,"-description"),o)},i),r)}});export{i as default};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type StrongProps = React.ComponentPropsWithoutRef<'strong'> & {
|
|
4
|
+
customRootClass?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const Strong: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
|
|
8
|
+
customRootClass?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
11
|
+
|
|
12
|
+
export { Strong as default };
|
|
13
|
+
export type { StrongProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as s,a}from"./tslib.es6-BtVxab8e.js";import r from"react";import{c as o}from"./clsx-BaVHROc5.js";import{c as e}from"./index-BVxS3Ixi.js";var t="Strong",m=r.forwardRef((function(m,c){var l=m.children,i=m.className,f=m.customRootClass,n=s(m,["children","className","customRootClass"]),d=e(f,t);return r.createElement("strong",a({ref:c,className:o(d,i)},n),l)}));m.displayName=t;export{m as default};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default, { ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
import Primitive from '~/core/primitives/Primitive';
|
|
4
|
+
import ButtonPrimitive from '~/core/primitives/Button';
|
|
5
|
+
|
|
6
|
+
type SwitchThumbProps = ComponentPropsWithoutRef<typeof Primitive.span> & {
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
children?: React__default.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type SwitchRootProps = ComponentPropsWithoutRef<typeof ButtonPrimitive> & {
|
|
13
|
+
children: React__default.ReactNode;
|
|
14
|
+
customRootClass?: string;
|
|
15
|
+
color?: string;
|
|
16
|
+
variant?: string;
|
|
17
|
+
size?: string;
|
|
18
|
+
defaultChecked?: boolean;
|
|
19
|
+
checked?: boolean;
|
|
20
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
required?: boolean;
|
|
23
|
+
name?: string;
|
|
24
|
+
value?: string;
|
|
25
|
+
asChild?: boolean;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
declare const Switch: {
|
|
29
|
+
(): null;
|
|
30
|
+
Root: React$1.ForwardRefExoticComponent<Omit<{
|
|
31
|
+
label?: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
asChild?: boolean;
|
|
34
|
+
required?: boolean;
|
|
35
|
+
onChange?: any;
|
|
36
|
+
} & Omit<React$1.DetailedHTMLProps<React$1.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
37
|
+
children: React.ReactNode;
|
|
38
|
+
customRootClass?: string;
|
|
39
|
+
color?: string;
|
|
40
|
+
variant?: string;
|
|
41
|
+
size?: string;
|
|
42
|
+
defaultChecked?: boolean;
|
|
43
|
+
checked?: boolean;
|
|
44
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
required?: boolean;
|
|
47
|
+
name?: string;
|
|
48
|
+
value?: string;
|
|
49
|
+
asChild?: boolean;
|
|
50
|
+
} & React$1.RefAttributes<HTMLButtonElement>>;
|
|
51
|
+
Thumb: React$1.ForwardRefExoticComponent<SwitchThumbProps & React$1.RefAttributes<HTMLElement>>;
|
|
52
|
+
};
|
|
53
|
+
declare namespace SwitchProps {
|
|
54
|
+
type Root = SwitchRootProps;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { SwitchProps, Switch as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as e,a}from"./tslib.es6-BtVxab8e.js";import s,{createContext as d,forwardRef as i,useContext as c}from"react";import{B as t}from"./index-DnCiOYxZ.js";import{c as o}from"./index-BVxS3Ixi.js";import{u as r,a as l,b as n}from"./index-Bf4LVEjJ.js";import{u as h}from"./index-fkj4Fdgt.js";import{P as m}from"./index-Dc5Cm9z0.js";var u=d({checked:!1,setChecked:function(){},rootClass:"",disabled:!1}),v="Switch",C=i((function(d,i){var c=d.children,m=d.customRootClass,C=d.color,f=void 0===C?"":C,k=d.variant,b=d.size,p=d.defaultChecked,w=void 0!==p&&p,j=d.checked,x=d.onCheckedChange,N=d.disabled,S=void 0!==N&&N,R=d.required,g=void 0!==R&&R,q=d.name,z=d.value,E=d.asChild,P=void 0!==E&&E,T=e(d,["children","customRootClass","color","variant","size","defaultChecked","checked","onCheckedChange","disabled","required","name","value","asChild"]),y=h(j,w,x),B=y[0],D=y[1],_=o(m,v),A=r("switch",{variant:k,size:b}),F=l(f),G=n(A(),F()),H={checked:B,setChecked:D,rootClass:_,disabled:S},I=a(a(a({},G()),{"data-state":B?"checked":"unchecked","data-disabled":S?"":void 0,role:"switch","aria-checked":B,"aria-required":g,disabled:S}),T);return q&&(I.name=q),z&&(I.value=z),s.createElement(u.Provider,{value:H},s.createElement(t,a({ref:i,onClick:function(){S||D(!B)},className:_,asChild:P},I),c))}));C.displayName=v;var f=i((function(d,i){var t=d.asChild,o=void 0!==t&&t,r=d.className,l=d.children,n=e(d,["asChild","className","children"]),h=c(u),v=h.checked,C=h.rootClass,f=h.disabled,k={};return k["data-state"]=v?"checked":"unchecked",f&&(k["data-disabled"]=""),s.createElement(m.span,a({ref:i,role:"switch",className:"".concat(C,"-indicator ").concat(r||""),asChild:o},k,n),l)}));f.displayName="SwitchThumb";var k=function(){return console.warn("Direct usage of Switch is not supported. Please use Switch.Root, Switch.Thumb, etc. instead."),null};k.Root=C,k.Thumb=f;export{k as default};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
declare const TabNav: {
|
|
4
|
+
(): null;
|
|
5
|
+
Root: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
6
|
+
loop?: boolean;
|
|
7
|
+
orientation?: "horizontal" | "vertical";
|
|
8
|
+
customRootClass?: string;
|
|
9
|
+
color?: string;
|
|
10
|
+
value?: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
onValueChange?: (value: string) => void;
|
|
13
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
Link: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
asChild?: boolean;
|
|
17
|
+
value?: string;
|
|
18
|
+
} & react.RefAttributes<HTMLAnchorElement>>;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { TabNav as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as a,a as e}from"./tslib.es6-BtVxab8e.js";import o,{createContext as n,forwardRef as r,useContext as t,useRef as l,useCallback as i,useEffect as s}from"react";import{c}from"./clsx-BaVHROc5.js";import{R as u}from"./index-BRmT6kl7.js";import{P as d}from"./index-Dc5Cm9z0.js";import{c as m}from"./index-BVxS3Ixi.js";import{u as v}from"./index-fkj4Fdgt.js";import"./index-DnCiOYxZ.js";var f=n({rootClass:"",tabValue:"",handleTabChange:function(){}}),h=r((function(n,r){var s=n.value,m=n.className,v=void 0===m?"":m,h=n.href,p=void 0===h?"#":h,b=n.children,C=n.disabled,N=n.asChild,T=a(n,["value","className","href","children","disabled","asChild"]),j=t(f),x=j.rootClass,R=j.tabValue,V=j.handleTabChange;N&&(C=!1);var g=l(null),E=i((function(a){g.current=a,"function"==typeof r?r(a):r&&(r.current=a)}),[r]),k=s===R;return o.createElement(u.Item,{onFocus:function(){return s&&!C&&function(a){var e;C||(g.current&&(null===(e=g.current)||void 0===e||e.focus()),V(a))}(s)}},o.createElement(d.a,e({ref:E,className:c("".concat(x,"-link"),v),asChild:N,"aria-disabled":C,"aria-selected":k,disabled:C},C?{}:{href:p},T),b))}));h.displayName="TabNavLink";var p=r((function(n,r){var t=n.className,l=n.loop,i=void 0===l||l,d=n.orientation,h=void 0===d?"horizontal":d,p=n.children;n.color;var b=n.customRootClass,C=void 0===b?"":b,N=n.defaultValue,T=void 0===N?"":N,j=n.onValueChange,x=void 0===j?function(){}:j,R=n.value,V=a(n,["className","loop","orientation","children","color","customRootClass","defaultValue","onValueChange","value"]),g=m(C,"TabNav"),E=v(R,T||"",x),k=E[0],y=E[1],L=function(a){y(a)};s((function(){void 0===R&&T&&L(T)}),[T,R]);var P={rootClass:g,tabValue:k,handleTabChange:L};return o.createElement(f.Provider,{value:P},o.createElement(u.Root,{loop:i,orientation:h},o.createElement(u.Group,e({},{asChild:!0}),o.createElement("div",e({ref:r,className:c(g,t)},V),p))))}));p.displayName="TabNavRoot";var b=function(){return console.warn("Direct usage of TabNav is not supported. Please use TabNav.Root, TabNav.Link instead."),null};b.Root=p,b.Link=h;export{b as default};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
declare const TableRoot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
4
|
+
customRootClass?: string;
|
|
5
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
|
|
7
|
+
declare const TableHead: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
8
|
+
|
|
9
|
+
declare const TableBody: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
10
|
+
|
|
11
|
+
declare const TableRow: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, "ref"> & React.RefAttributes<HTMLTableRowElement>>;
|
|
12
|
+
|
|
13
|
+
declare const TableColumnCellHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, "ref"> & React.RefAttributes<HTMLTableHeaderCellElement>>;
|
|
14
|
+
|
|
15
|
+
declare const TableCell: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, "ref"> & React.RefAttributes<HTMLTableDataCellElement>>;
|
|
16
|
+
|
|
17
|
+
type TableProps = React.HTMLAttributes<HTMLTableElement> & {
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
};
|
|
20
|
+
interface TableComponent extends React.ForwardRefExoticComponent<TableProps & React.RefAttributes<HTMLTableElement>> {
|
|
21
|
+
Root: typeof TableRoot;
|
|
22
|
+
Body: typeof TableBody;
|
|
23
|
+
Head: typeof TableHead;
|
|
24
|
+
Row: typeof TableRow;
|
|
25
|
+
Cell: typeof TableCell;
|
|
26
|
+
ColumnCellHeader: typeof TableColumnCellHeader;
|
|
27
|
+
}
|
|
28
|
+
declare const Table: TableComponent;
|
|
29
|
+
|
|
30
|
+
export { Table as default };
|
|
31
|
+
export type { TableProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import e from"react";import{_ as a,a as r}from"./tslib.es6-BtVxab8e.js";import{c as l}from"./clsx-BaVHROc5.js";import{c as s}from"./index-BVxS3Ixi.js";var c="Table",o=e.forwardRef((function(o,t){var d=o.children,n=o.className,m=void 0===n?"":n,i=o.customRootClass,f=void 0===i?"":i,N=a(o,["children","className","customRootClass"]),u=s(f,c);return e.createElement("div",r({ref:t,className:l("".concat(u,"-wrapper"),m)},N),e.createElement("table",{className:l(u)},d))}));o.displayName=c;var t=e.forwardRef((function(s,c){var o=s.children,t=s.className,d=void 0===t?"header":t,n=a(s,["children","className"]);return e.createElement("thead",r({ref:c,className:l(d)},n),o)}));t.displayName="TableHead";var d=e.forwardRef((function(s,c){var o=s.children,t=s.className,d=void 0===t?"":t,n=a(s,["children","className"]);return e.createElement("tbody",r({ref:c,className:l(d)},n),o)}));d.displayName="TableBody";var n=e.forwardRef((function(s,c){var o=s.children,t=s.className,d=void 0===t?"row":t,n=a(s,["children","className"]);return e.createElement("tr",r({ref:c,className:l(d)},n),o)}));n.displayName="TableRow";var m=e.forwardRef((function(s,c){var o=s.children,t=s.className,d=void 0===t?"cell-header":t,n=a(s,["children","className"]);return e.createElement("th",r({ref:c,className:l(d)},n),o)}));m.displayName="TableColumnCellHeader";var i=e.forwardRef((function(s,c){var o=s.children,t=s.className,d=void 0===t?"cell":t,n=a(s,["children","className"]);return e.createElement("td",r({ref:c,className:l(d)},n),o)}));i.displayName="TableCell";var f=e.forwardRef((function(e,a){return console.warn("Direct usage of Table is not supported. Please use Table.Root, Table.Head, etc. instead."),null}));f.displayName="Table",f.Root=o,f.Body=d,f.Head=t,f.Row=n,f.Cell=i,f.ColumnCellHeader=m;export{f as default};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
declare const TabList: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
4
|
+
asChild?: boolean;
|
|
5
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
|
|
7
|
+
declare const TabTrigger: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
8
|
+
value?: string;
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
|
|
12
|
+
declare const TabContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
13
|
+
customRootClass?: string;
|
|
14
|
+
value?: string;
|
|
15
|
+
asChild?: boolean;
|
|
16
|
+
forceMount?: boolean;
|
|
17
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
|
|
19
|
+
declare const TabRoot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
20
|
+
customRootClass?: string;
|
|
21
|
+
value?: string;
|
|
22
|
+
color?: string;
|
|
23
|
+
defaultValue?: string;
|
|
24
|
+
onValueChange?: (value: string) => void;
|
|
25
|
+
orientation?: "horizontal" | "vertical";
|
|
26
|
+
dir?: "ltr" | "rtl";
|
|
27
|
+
activationMode?: "automatic" | "manual";
|
|
28
|
+
asChild?: boolean;
|
|
29
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
|
|
31
|
+
type TabsProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
32
|
+
children?: React.ReactNode;
|
|
33
|
+
};
|
|
34
|
+
interface TabsComponent extends React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>> {
|
|
35
|
+
List: typeof TabList;
|
|
36
|
+
Content: typeof TabContent;
|
|
37
|
+
Root: typeof TabRoot;
|
|
38
|
+
Trigger: typeof TabTrigger;
|
|
39
|
+
}
|
|
40
|
+
declare const Tabs: TabsComponent;
|
|
41
|
+
|
|
42
|
+
export { Tabs as default };
|
|
43
|
+
export type { TabsProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import a,{createContext as e,useContext as t,useRef as o,useCallback as i,useEffect as r}from"react";import{_ as n,a as s}from"./tslib.es6-BtVxab8e.js";import{c as l}from"./clsx-BaVHROc5.js";import{R as d}from"./index-BRmT6kl7.js";import{P as c}from"./index-Dc5Cm9z0.js";import{c as u}from"./index-BVxS3Ixi.js";import{u as v}from"./index-fkj4Fdgt.js";import"./index-DnCiOYxZ.js";var m=e(null),f=a.forwardRef((function(e,o){var i=e.className,r=void 0===i?"":i,u=e.children,v=e.asChild,f=void 0!==v&&v,h=n(e,["className","children","asChild"]),b=t(m);if(!b)throw new Error("TabList must be used within a TabRoot");var C=b.rootClass,p=b.orientation;return a.createElement(d.Group,null,a.createElement(c.div,s({ref:o,role:"tablist","aria-orientation":p,"aria-label":"todo",className:l("".concat(C,"-list"),r),asChild:f},h),u))}));f.displayName="TabList";var h=a.forwardRef((function(e,r){var u=e.value,v=e.children,f=e.className,h=void 0===f?"":f,b=e.disabled,C=e.asChild,p=void 0!==C&&C,T=n(e,["value","children","className","disabled","asChild"]),N=t(m);if(!N)throw new Error("TabTrigger must be used within a TabRoot");var R=N.tabValue,w=N.handleTabChange,g=N.rootClass,E=N.orientation,j=N.activationMode,x=o(null),V=i((function(a){x.current=a,"function"==typeof r?r(a):r&&(r.current=a)}),[r]),y=u===R,M={};return M["data-state"]=y?"active":"inactive",M["data-orientation"]=E||"horizontal",b&&(M["data-disabled"]=""),a.createElement(d.Item,{onFocus:function(){return u&&!b&&function(a){var e;b||(x.current&&(null===(e=x.current)||void 0===e||e.focus()),"automatic"===j&&w(a))}(u)}},a.createElement(c.button,s({ref:V,onClick:function(a){b||u&&w(u)},className:l("".concat(g,"-trigger"),y?"active":"",b?"disabled":"",h),role:"tab","aria-selected":y,"aria-disabled":b,disabled:b,asChild:p},M,T),v))}));h.displayName="TabTrigger";var b="TabContent",C=a.forwardRef((function(e,o){var i=e.className,r=void 0===i?"":i,d=e.value,v=e.children,f=e.customRootClass,h=e.asChild,C=void 0!==h&&h,p=e.forceMount,T=void 0!==p&&p,N=n(e,["className","value","children","customRootClass","asChild","forceMount"]),R=u(f,b),w=t(m);if(!w)throw new Error("TabContent must be used within a TabRoot");var g=w.tabValue,E=w.orientation,j=g===d;if(!(T||j))return null;var x={};return x["data-state"]=j?"active":"inactive",x["data-orientation"]=E||"horizontal",a.createElement(c.div,s({ref:o,className:l(R,r),role:"tabpanel","aria-hidden":!j,asChild:C},x,N),v)}));C.displayName=b;var p="Tabs",T=a.forwardRef((function(e,t){var o=e.children,i=e.defaultValue,f=void 0===i?"":i,h=e.onValueChange,b=void 0===h?function(){}:h,C=e.customRootClass,T=void 0===C?"":C,N=e.value,R=e.className,w=e.color,g=e.orientation,E=void 0===g?"horizontal":g,j=e.dir,x=void 0===j?"ltr":j,V=e.activationMode,y=void 0===V?"automatic":V,M=e.asChild,L=void 0!==M&&M,z=n(e,["children","defaultValue","onValueChange","customRootClass","value","className","color","orientation","dir","activationMode","asChild"]),P=u(T,p),k=v(N,f||"",b),D=k[0],F=k[1],G=function(a){F(a)};r((function(){void 0===N&&f&&G(f)}),[f,N]);var I={rootClass:P,tabValue:D,handleTabChange:G,orientation:E,activationMode:y},_={};return _["data-orientation"]=E,a.createElement(m.Provider,{value:I},a.createElement(d.Root,{orientation:E,loop:!0,dir:x,asChild:!0},a.createElement(c.div,s({ref:t,className:l(P,R),"data-rad-ui-accent-color":w,asChild:L},_,z),o)))}));T.displayName=p;var N=a.forwardRef((function(a,e){return console.warn("Direct usage of Tabs is not supported. Please use Tabs.Root, Tabs.List, etc. instead."),null}));N.displayName="Tabs",N.List=f,N.Content=C,N.Root=T,N.Trigger=h;export{N as default};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
|
|
3
|
+
type TextProps = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
customRootClass?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
as?: string;
|
|
8
|
+
} & ComponentPropsWithoutRef<'p'>;
|
|
9
|
+
declare const Text: React.ForwardRefExoticComponent<{
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
customRootClass?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
as?: string;
|
|
14
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
15
|
+
|
|
16
|
+
export { Text as default };
|
|
17
|
+
export type { TextProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as s,a}from"./tslib.es6-BtVxab8e.js";import e,{forwardRef as o}from"react";import{c as r}from"./index-BVxS3Ixi.js";import{c as t}from"./clsx-BaVHROc5.js";var i="Text",l=["div","span","p","label"],m=o((function(o,m){var c=o.children,d=o.customRootClass,p=void 0===d?"":d,n=o.className,f=void 0===n?"":n,u=o.as,v=void 0===u?"p":u,x=s(o,["children","customRootClass","className","as"]),N=r(p,i);return l.includes(v)||(v="p"),e.createElement(v,a({ref:m,className:t(N,f)},x),c)}));m.displayName=i;export{m as default};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
declare const TextAreaRoot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
4
|
+
customRootClass?: string;
|
|
5
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
|
|
7
|
+
declare const TextAreaInput: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
8
|
+
|
|
9
|
+
type TextAreaProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
10
|
+
customRootClass?: string;
|
|
11
|
+
};
|
|
12
|
+
type TextAreaComponent = React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<React.ElementRef<'div'>>> & {
|
|
13
|
+
Input: typeof TextAreaInput;
|
|
14
|
+
Root: typeof TextAreaRoot;
|
|
15
|
+
};
|
|
16
|
+
declare const TextArea: TextAreaComponent;
|
|
17
|
+
|
|
18
|
+
export { TextArea as default };
|
|
19
|
+
export type { TextAreaProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as e,a}from"./tslib.es6-BtVxab8e.js";import r from"react";import{c as t}from"./clsx-BaVHROc5.js";import{c as o}from"./index-BVxS3Ixi.js";var s="TextArea",l=r.forwardRef((function(l,c){var d=l.children,i=l.customRootClass,m=void 0===i?"":i,n=l.className,f=void 0===n?"":n,u=e(l,["children","customRootClass","className"]),p=o(m,s);return r.createElement("div",a({ref:c,className:t(p,f)},u),d)}));l.displayName=s;var c=r.forwardRef((function(t,o){var s=t.children,l=t.placeholder,c=void 0===l?"":l,d=e(t,["children","placeholder"]);return r.createElement("textarea",a({ref:o,placeholder:c,defaultValue:"string"==typeof s?s:void 0},d))}));c.displayName="TextAreaInput";var d=r.forwardRef((function(o,s){var d=o.customRootClass,i=void 0===d?"":d,m=o.className,n=void 0===m?"":m,f=o.children,u=e(o,["customRootClass","className","children"]);return r.createElement(l,a({ref:s,customRootClass:i,className:t(n)},u),r.createElement(c,{placeholder:"enter text"},f),f)}));d.displayName="TextArea",d.Input=c,d.Root=l;export{d as default};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
|
|
3
|
+
type ThemeProps = ComponentPropsWithoutRef<'div'> & {
|
|
4
|
+
appearance?: 'light' | 'dark' | 'system';
|
|
5
|
+
accentColor?: string;
|
|
6
|
+
radius?: string;
|
|
7
|
+
scaling?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const Theme: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
10
|
+
appearance?: "light" | "dark" | "system";
|
|
11
|
+
accentColor?: string;
|
|
12
|
+
radius?: string;
|
|
13
|
+
scaling?: string;
|
|
14
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
|
|
16
|
+
export { Theme as default };
|
|
17
|
+
export type { ThemeProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as a,a as e}from"./tslib.es6-BtVxab8e.js";import r,{forwardRef as i,useState as t,useEffect as n}from"react";var d=i((function(i,d){var c=i.appearance,o=void 0===c?"system":c,s=i.id,u=void 0===s?"rad-ui-theme-container":s,m=i.accentColor,l=void 0===m?"":m,h=i.radius,f=void 0===h?"":h,v=i.scaling,p=void 0===v?"":v,g=i.children,y=a(i,["appearance","id","accentColor","radius","scaling","children"]),k=t(o),E=k[0],w=k[1],C=t(l),L=C[0],b=C[1],j=t(f),x=j[0],M=j[1],N=t(p),T=N[0],_=N[1];return n((function(){var a=window.matchMedia("(prefers-color-scheme: dark)"),e=function(a){"system"===o&&w(a.matches?"dark":"light")};return"system"===o?(w(a.matches?"dark":"light"),a.addEventListener("change",e)):w(o),function(){return a.removeEventListener("change",e)}}),[o]),n((function(){l&&b(l)}),[l]),n((function(){f&&M(f)}),[f]),n((function(){p&&_(p)}),[p]),r.createElement("div",e({ref:d,id:u,"data-rad-ui-theme":E,"data-rad-ui-accent-color":L,"data-rad-ui-radius":x,"data-rad-ui-scaling":T},y),g)}));d.displayName="Theme";export{d as default};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import TogglePrimitive from '~/core/primitives/Toggle';
|
|
3
|
+
|
|
4
|
+
type ToggleElement = React.ElementRef<typeof TogglePrimitive>;
|
|
5
|
+
/**
|
|
6
|
+
* Props for the Toggle component
|
|
7
|
+
*/
|
|
8
|
+
interface ToggleProps extends Omit<React.ComponentPropsWithoutRef<typeof TogglePrimitive>, 'onPressedChange'> {
|
|
9
|
+
/** Optional custom root class name to override default styling */
|
|
10
|
+
customRootClass?: string;
|
|
11
|
+
/** Accent color for the toggle */
|
|
12
|
+
color?: string;
|
|
13
|
+
/** Callback fired when toggle state changes */
|
|
14
|
+
onPressedChange: (isPressed: boolean) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Toggle component that can be used in either controlled or uncontrolled mode.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // Controlled mode
|
|
21
|
+
* const [pressed, setPressed] = useState(false);
|
|
22
|
+
* <Toggle pressed={pressed} onPressedChange={setPressed}>Toggle Me</Toggle>
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Uncontrolled mode
|
|
26
|
+
* <Toggle defaultPressed={false} onPressedChange={(isPressed) => console.log(isPressed)}>Toggle Me</Toggle>
|
|
27
|
+
*
|
|
28
|
+
* @param {ToggleProps} props - The component props
|
|
29
|
+
* @returns {JSX.Element} The Toggle component
|
|
30
|
+
*/
|
|
31
|
+
declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
32
|
+
|
|
33
|
+
export { Toggle as default };
|
|
34
|
+
export type { ToggleElement, ToggleProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as s,a as e}from"./tslib.es6-BtVxab8e.js";import a,{forwardRef as o}from"react";import{c as d}from"./clsx-BaVHROc5.js";import{c as r}from"./index-BVxS3Ixi.js";import{u as i}from"./index-fkj4Fdgt.js";import{T as t}from"./index-YgKcfT__.js";import"./index-DnCiOYxZ.js";import"./index-Dc5Cm9z0.js";import"./index-DBZNt4Em.js";var l="Toggle",m=o((function(o,m){var n=o.defaultPressed,c=void 0!==n&&n,p=o.customRootClass,f=void 0===p?"":p,u=o.children,h=o.className,j=void 0===h?"":h,v=o.color,x=void 0===v?"":v,C=o.pressed,g=o.onPressedChange,P=o.asChild,N=void 0!==P&&P,b=s(o,["defaultPressed","customRootClass","children","className","color","pressed","onPressedChange","asChild"]),R=i(C,c,g),T=R[0],y=R[1],E=r(f,l),_={};return x&&(_["data-rad-ui-accent-color"]=x),a.createElement(t,e({ref:m,className:d(E,j),pressed:T,onPressedChange:y,"data-state":T?"on":"off","data-disabled":b.disabled?"":void 0,asChild:N},b,_),u)}));m.displayName=l;export{m as default};
|