@radui/ui 0.1.6 → 0.1.9
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/README.md +87 -47
- package/dist/components/Accordion.d.ts +67 -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-SECStDbi.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 +31 -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-CEeFUCQV.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 +122 -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 +122 -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-CBMvjJyH.js +1 -0
- package/dist/components/Menubar.d.ts +109 -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-CbRZK8wB.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 +22 -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-BVxS3Ixi.js +1 -0
- package/dist/components/index-BgvB1-RV.js +1 -0
- package/dist/components/index-Br4Ygpsh.js +1 -0
- package/dist/components/index-BuGKU1-S.js +1 -0
- package/dist/components/index-BxNZdFaZ.js +1 -0
- package/dist/components/index-CD1lNchI.js +1 -0
- package/dist/components/index-DBZNt4Em.js +1 -0
- package/dist/components/index-DR_GC01Z.js +1 -0
- package/dist/components/index-Di6TooPD.js +1 -0
- package/dist/components/index-DzAecJCk.js +1 -0
- package/dist/components/index-fkj4Fdgt.js +1 -0
- package/dist/components/tslib.es6-B3RR16LH.js +1 -0
- package/dist/themes/default.css +1 -0
- package/dist/themes/tailwind-presets/default.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import e,{useContext as a}from"react";import{_ as i,b as r}from"./tslib.es6-B3RR16LH.js";import{P as t}from"./index-DR_GC01Z.js";import{R as d}from"./index-Br4Ygpsh.js";import{u as o}from"./index-fkj4Fdgt.js";import{B as l}from"./index-BxNZdFaZ.js";var n=e.createContext(null),s=e.forwardRef((function(a,l){var s=a.value,u=a.defaultValue,c=void 0===u?"":u,m=a.onValueChange,p=a.children,v=a.disabled,f=void 0!==v&&v,h=a.required,R=void 0!==h&&h,b=a.name,C=void 0===b?"":b,E=a.orientation,g=void 0===E?"horizontal":E,G=a.loop,N=void 0!==G&&G,w=a.dir,x=void 0===w?"ltr":w,y=i(a,["value","defaultValue","onValueChange","children","disabled","required","name","orientation","loop","dir"]),I=o(s,c,m),P=I[0],V={selectedValue:P,setSelectedValue:I[1],groupDisabled:f};return e.createElement(t.div,r({ref:l},y,{"aria-required":R,role:"radiogroup","aria-disabled":f,"data-disabled":f?"":void 0}),e.createElement(d.Root,{dir:x,orientation:g,loop:N,asChild:!0},e.createElement(n.Provider,{value:V},e.createElement(d.Group,null,p))),C&&e.createElement(e.Fragment,null,e.createElement("input",{type:"hidden",name:C,value:P,disabled:f}),R&&""!==P&&e.createElement("input",{type:"radio",name:C,value:P,checked:!0,onChange:function(){},disabled:f,required:!0,"aria-hidden":"true",tabIndex:-1,style:{position:"absolute",width:0,height:0,opacity:0,pointerEvents:"none",margin:0}})))}));s.displayName="RadioGroupPrimitiveRoot";var u=e.createContext({itemSelected:!1}),c=e.forwardRef((function(t,o){var s=t.value,c=t.children,m=t.disabled,p=t.required,v=void 0!==p&&p,f=t.className,h=void 0===f?"":f,R=t.asChild,b=void 0!==R&&R,C=i(t,["value","children","disabled","required","className","asChild"]),E=a(n);if(!E)throw new Error("RadioGroup.Item must be used within a RadioGroup.Root");var g=E.groupDisabled,G=E.selectedValue,N=E.setSelectedValue,w=s===G;return e.createElement(u.Provider,{value:{itemSelected:w}},e.createElement(d.Item,null,e.createElement(l,r({ref:o,role:"radio",type:"button",disabled:g||m,onClick:function(){return N(s)},onFocus:function(){return N(s)},"aria-disabled":g||m,"aria-checked":w,"aria-selected":void 0,"data-state":w?"checked":"unchecked","data-disabled":g||m?"":void 0,"aria-required":v,asChild:b,className:h},C),c)))}));c.displayName="RadioGroupPrimitiveItem";var m=e.forwardRef((function(a,d){var o=a.children,l=a.className,n=a.asChild,s=void 0!==n&&n,c=i(a,["children","className","asChild"]);return e.useContext(u).itemSelected?e.createElement(t.span,r({ref:d,className:l,asChild:s},c),o):null}));m.displayName="RadioGroupPrimitiveIndicator";var p=e.forwardRef((function(e,a){return console.warn("Direct usage of RadioGroup is not supported. Please use RadioGroup.Root, RadioGroup.Item, etc. instead."),null}));p.displayName="RadioGroupPrimitive",p.Root=s,p.Item=c,p.Indicator=m;export{p as R};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
declare const ScrollAreaRoot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
4
|
+
customRootClass?: string;
|
|
5
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
|
|
7
|
+
declare const ScrollAreaViewport: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
|
|
9
|
+
declare const ScrollAreaScrollbar: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
10
|
+
orientation?: "horizontal" | "vertical";
|
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
|
|
13
|
+
declare const ScrollAreaThumb: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
|
|
15
|
+
declare const ScrollAreaCorner: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
|
|
17
|
+
type ScrollAreaProps = React.ComponentPropsWithoutRef<'div'>;
|
|
18
|
+
declare const ScrollArea: React.ForwardRefExoticComponent<ScrollAreaProps> & {
|
|
19
|
+
Root: typeof ScrollAreaRoot;
|
|
20
|
+
Viewport: typeof ScrollAreaViewport;
|
|
21
|
+
Scrollbar: typeof ScrollAreaScrollbar;
|
|
22
|
+
Thumb: typeof ScrollAreaThumb;
|
|
23
|
+
Corner: typeof ScrollAreaCorner;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { ScrollArea as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import e,{createContext as r,forwardRef as n,useRef as t,useEffect as o,useContext as c,useCallback as l}from"react";import{_ as u,b as i}from"./tslib.es6-B3RR16LH.js";import{c as a}from"./clsx-BaVHROc5.js";import{c as s}from"./index-BVxS3Ixi.js";var d=r({rootClass:""}),v="ScrollArea",f=n((function(r,n){var c=r.children,l=r.className,f=void 0===l?"":l,m=r.customRootClass,p=void 0===m?"":m,h=u(r,["children","className","customRootClass"]),E=s(p,v),g=t(null),b=t(null);o((function(){y()}),[g,b]),o((function(){var e=b.current;if(e){var r=function(){y()},n=new ResizeObserver((function(n){for(var t=0,o=n;t<o.length;t++){var c=o[t];(c.target===e||e.contains(c.target))&&r()}}));n.observe(e);var t=function(e){n.observe(e),Array.from(e.children).forEach((function(e){t(e)}))};Array.from(e.children).forEach((function(e){t(e)}));var o=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){e.nodeType===Node.ELEMENT_NODE&&t(e)}))})),r()}));return o.observe(e,{childList:!0,subtree:!0}),window.addEventListener("resize",r),function(){n.disconnect(),o.disconnect(),window.removeEventListener("resize",r)}}}),[]);var y=function(){var e,r,n=(null===(e=null==b?void 0:b.current)||void 0===e?void 0:e.clientHeight)||0,t=n/(((null===(r=null==b?void 0:b.current)||void 0===r?void 0:r.scrollHeight)||0)/n);t<24&&(t=24),g.current&&(g.current.style.height="".concat(t,"px"))},N=function(e){if(b.current){var r=b.current.scrollTop,n=e-r,t=performance.now(),o=function(e){var c=e-t,l=Math.min(c/150,1),u=1-Math.pow(1-l,3),i=r+n*u;b.current&&(b.current.scrollTop=i),l<1&&requestAnimationFrame(o)};requestAnimationFrame(o)}};return e.createElement(d.Provider,{value:{rootClass:E,scrollXThumbRef:g,scrollAreaViewportRef:b,handleScroll:function(){var e,r,n,t,o=(null===(e=b.current)||void 0===e?void 0:e.clientHeight)||0,c=(null===(r=b.current)||void 0===r?void 0:r.scrollHeight)||0,l=((null===(n=b.current)||void 0===n?void 0:n.scrollTop)||0)/(c-o)*(o-((null===(t=g.current)||void 0===t?void 0:t.clientHeight)||0));g.current&&(g.current.style.top="".concat(l,"px"))},handleScrollbarClick:function(e){!function(e){var r,n,t,o=(null===(r=null==b?void 0:b.current)||void 0===r?void 0:r.clientHeight)||0,c=((null===(n=null==b?void 0:b.current)||void 0===n?void 0:n.scrollHeight)||0)/o;if(g.current){var l=g.current.getBoundingClientRect().top,u=l+g.current.clientHeight,i=(null===(t=g.current)||void 0===t?void 0:t.clientHeight)||0;if(e>l&&e<u)return;if(e<l){var a=b.current.scrollTop-i*c;N(a)}e>u&&(a=b.current.scrollTop+i*c,N(a))}}(e.clientY)}}},e.createElement("div",i({ref:n,className:a(E,f)},h),c))}));f.displayName=v;var m=n((function(r,n){var t=r.children,o=r.className,l=void 0===o?"":o,s=u(r,["children","className"]),v=c(d),f=v.rootClass,m=v.scrollAreaViewportRef,p=v.handleScroll;return e.createElement("div",i({ref:function(e){m&&(m.current=e),"function"==typeof n?n(e):n&&(n.current=e)},className:a(f+"-viewport",l),onScroll:p},s),t)}));m.displayName="ScrollAreaViewport";var p=n((function(r,n){var o=r.children,s=r.className,v=void 0===s?"":s,f=r.orientation,m=u(r,["children","className","orientation"]),p=c(d),h=p.rootClass,E=p.handleScrollbarClick,g=p.scrollXThumbRef,b=t(null),y=t(!1),N=t(null),w=e.useState(!1),S=w[0],T=w[1],A=t(0),L=l((function(e){if(!(null==g?void 0:g.current))return!1;var r=g.current.getBoundingClientRect(),n=r.top,t=r.bottom;return!(e>=n&&e<=t)}),[g]),R=l((function(e){E&&(e.preventDefault(),A.current=e.clientY,E({clientY:e.clientY}),setTimeout((function(){y.current&&(b.current=setInterval((function(){y.current&&L(A.current)?E({clientY:A.current}):C()}),50))}),300),y.current=!0,T(!0))}),[E,L]),C=l((function(){var e;y.current=!1,null===(e=N.current)||void 0===e||e.call(N),N.current=null,b.current&&(clearInterval(b.current),b.current=null),T(!1)}),[]);return e.useEffect((function(){if(!y.current)return function(){var e;null===(e=N.current)||void 0===e||e.call(N),C()};var e=function(){return C()},r=function(){return C()};return document.addEventListener("mouseup",e),document.addEventListener("mouseleave",r),N.current=function(){document.removeEventListener("mouseup",e),document.removeEventListener("mouseleave",r)},function(){var e;null===(e=N.current)||void 0===e||e.call(N),N.current=null,C()}}),[S,C]),e.createElement("div",i({ref:n,className:a(h+"-scrollbar",v),"data-orientation":f,onMouseDown:R,onMouseUp:C,onMouseLeave:C},m),o)}));p.displayName="ScrollAreaScrollbar";var h=n((function(r,n){var o=r.children,s=r.className,v=void 0===s?"":s,f=u(r,["children","className"]),m=c(d),p=m.rootClass,h=m.scrollXThumbRef,E=m.scrollAreaViewportRef,g=t(!1),b=t({y:0,scrollTop:0}),y=l((function(e){(null==E?void 0:E.current)&&(null==h?void 0:h.current)&&(e.preventDefault(),e.stopPropagation(),g.current=!0,b.current={y:e.clientY,scrollTop:E.current.scrollTop},document.body.style.userSelect="none")}),[E,h]),N=l((function(e){var r;if(g.current&&(null==E?void 0:E.current)&&(null==h?void 0:h.current)){e.preventDefault();var n=e.clientY-b.current.y,t=null===(r=h.current.parentElement)||void 0===r?void 0:r.getBoundingClientRect();if(t){var o=E.current.clientHeight,c=E.current.scrollHeight,l=h.current.clientHeight,u=n/(t.height-l),i=c-o,a=b.current.scrollTop+u*i,s=Math.max(0,Math.min(a,i));E.current.scrollTop=s}}}),[E,h]),w=l((function(){g.current=!1,document.body.style.cursor="",document.body.style.userSelect=""}),[]);e.useEffect((function(){var e=function(e){return N(e)},r=function(){return w()};return g.current&&(document.addEventListener("mousemove",e),document.addEventListener("mouseup",r)),document.addEventListener("mousemove",e),document.addEventListener("mouseup",r),function(){document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",r),w()}}),[N,w]);return e.createElement("div",i({ref:function(e){h&&(h.current=e),"function"==typeof n?n(e):n&&(n.current=e)},className:a(p+"-thumb",v),onMouseDown:y},f),o)}));h.displayName="ScrollAreaThumb";var E=n((function(r,n){var t=r.children,o=u(r,["children"]);return e.createElement("div",i({ref:n},o),t)}));E.displayName="ScrollAreaCorner";var g=e.forwardRef((function(e,r){return console.warn("Direct usage of ScrollArea is not supported. Please use ScrollArea.Root and ScrollArea.Viewport instead."),null}));g.Root=f,g.Viewport=m,g.Scrollbar=p,g.Thumb=h,g.Corner=E,g.displayName="ScrollArea";export{g as default};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import SelectPrimitive from '~/core/primitives/Select/Select';
|
|
3
|
+
import * as _floating_ui_react from '@floating-ui/react';
|
|
4
|
+
|
|
5
|
+
type SelectContentProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> & {
|
|
6
|
+
customRootClass?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
|
|
10
|
+
interface SelectPrimitiveItemProps {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
value: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare const SelectItem: React.ForwardRefExoticComponent<(Omit<Omit<Omit<SelectPrimitiveItemProps & Omit<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
19
|
+
asChild?: boolean;
|
|
20
|
+
} & React.RefAttributes<HTMLElement>, "ref">, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
21
|
+
customRootClass?: string;
|
|
22
|
+
}, "ref"> | Omit<Omit<Omit<SelectPrimitiveItemProps & Omit<React.HTMLAttributes<HTMLElement> & {
|
|
23
|
+
asChild?: boolean;
|
|
24
|
+
children?: React.ReactNode;
|
|
25
|
+
} & React.RefAttributes<HTMLElement>, "ref">, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
26
|
+
customRootClass?: string;
|
|
27
|
+
}, "ref">) & React.RefAttributes<HTMLElement>>;
|
|
28
|
+
|
|
29
|
+
type SelectPrimitiveTriggerProps = {
|
|
30
|
+
children: React.ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<(Omit<Omit<Omit<SelectPrimitiveTriggerProps & Omit<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
37
|
+
asChild?: boolean;
|
|
38
|
+
} & React.RefAttributes<HTMLElement>, "ref">, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
39
|
+
customRootClass?: string;
|
|
40
|
+
placeholder?: boolean;
|
|
41
|
+
}, "ref"> | Omit<Omit<Omit<SelectPrimitiveTriggerProps & Omit<React.HTMLAttributes<HTMLElement> & {
|
|
42
|
+
asChild?: boolean;
|
|
43
|
+
children?: React.ReactNode;
|
|
44
|
+
} & React.RefAttributes<HTMLElement>, "ref">, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
45
|
+
customRootClass?: string;
|
|
46
|
+
placeholder?: boolean;
|
|
47
|
+
}, "ref">) & React.RefAttributes<HTMLElement>>;
|
|
48
|
+
|
|
49
|
+
type SelectRootProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Root> & {
|
|
50
|
+
customRootClass?: string;
|
|
51
|
+
};
|
|
52
|
+
declare const SelectRoot: React.ForwardRefExoticComponent<SelectRootProps & React.RefAttributes<HTMLElement>>;
|
|
53
|
+
|
|
54
|
+
declare const SelectIndicator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
55
|
+
|
|
56
|
+
type SelectPortalProps = {
|
|
57
|
+
children: React.ReactNode;
|
|
58
|
+
container?: HTMLElement | null;
|
|
59
|
+
};
|
|
60
|
+
declare const SelectPortal: React.ForwardRefExoticComponent<Omit<{
|
|
61
|
+
children: React.ReactNode;
|
|
62
|
+
container?: HTMLElement | null;
|
|
63
|
+
} & _floating_ui_react.FloatingPortalProps & React.RefAttributes<never>, "ref"> & SelectPortalProps & React.RefAttributes<never>>;
|
|
64
|
+
|
|
65
|
+
type SelectPrimitiveGroupProps = {
|
|
66
|
+
children: React.ReactNode;
|
|
67
|
+
className?: string;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
type SelectGroupProps = {
|
|
71
|
+
children: React.ReactNode;
|
|
72
|
+
};
|
|
73
|
+
declare const SelectGroup: React.ForwardRefExoticComponent<Omit<SelectPrimitiveGroupProps & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
74
|
+
|
|
75
|
+
type SelectSearchProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Search>;
|
|
76
|
+
declare const SelectSearch: React.ForwardRefExoticComponent<SelectSearchProps & React.RefAttributes<HTMLElement>>;
|
|
77
|
+
|
|
78
|
+
interface SelectComponent extends React.ForwardRefExoticComponent<React.RefAttributes<unknown>> {
|
|
79
|
+
Root: typeof SelectRoot;
|
|
80
|
+
Content: typeof SelectContent;
|
|
81
|
+
Item: typeof SelectItem;
|
|
82
|
+
Trigger: typeof SelectTrigger;
|
|
83
|
+
Portal: typeof SelectPortal;
|
|
84
|
+
Group: typeof SelectGroup;
|
|
85
|
+
Indicator: typeof SelectIndicator;
|
|
86
|
+
Search: typeof SelectSearch;
|
|
87
|
+
}
|
|
88
|
+
declare const Select: SelectComponent;
|
|
89
|
+
|
|
90
|
+
export { Select as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import e,{createContext as t,useContext as a,useState as r,useEffect as n,useLayoutEffect as l}from"react";import{_ as o,b as i}from"./tslib.es6-B3RR16LH.js";import{F as s}from"./index-Di6TooPD.js";import{P as c}from"./index-DR_GC01Z.js";import{c as u}from"./index-DBZNt4Em.js";import{u as d}from"./index-fkj4Fdgt.js";import{c as f}from"./index-BVxS3Ixi.js";import"./floating-ui.react-CLbXmKZY.js";import"react/jsx-runtime";import"react-dom";var m=t({}),v=e.forwardRef((function(t,r){var n=t.children,l=t.className,c=o(t,["children","className"]),u=a(m),d=u.isOpen,f=u.elementsRef,v=u.labelsRef,p=u.floatingContext,h=u.refs,g=u.getFloatingProps,R=u.floatingStyles;return e.createElement(e.Fragment,null,d&&e.createElement(s.FocusManager,{context:p},e.createElement(s.FloatingList,{elementsRef:f,labelsRef:v},e.createElement("div",i({ref:s.useMergeRefs([h.setFloating,r]),style:R,className:l,"data-state":d?"open":"closed"},g(),c),n))))}));v.displayName="SelectPrimitiveContent";var p=e.forwardRef((function(t,r){var n,l=t.children,u=t.value,d=t.disabled,f=t.className,v=o(t,["children","value","disabled","className"]),p=a(m);if(!p)return console.error("SelectPrimitiveItem must be used within a SelectPrimitive"),null;var h=p.handleSelect,g=p.isTypingRef,R=p.getItemProps,C=p.activeIndex,b=p.selectedIndex,S=p.virtualItemRef,N=p.selectedItemRef,I=p.hasSearch;p.disabledIndices;var y=p.setDisabledIndices,E=p.valuesRef,x=e.useRef(null),w=s.useListItem({label:u}),P=w.ref,k=w.index,V=e.useRef(k),L=C===k,D=b===k,F=u||"select-item-".concat(k);return e.useEffect((function(){var e=V.current;return E.current[k]=F,e!==k&&delete E.current[e],y((function(t){var a=new Set(t);return a.delete(e),d?a.add(k):a.delete(k),Array.from(a).sort((function(e,t){return e-t}))})),D&&!I&&(N.current=x.current),V.current=k,function(){y((function(e){var t=new Set(e);return t.delete(V.current),Array.from(t).sort((function(e,t){return e-t}))}))}}),[k,d,D,I,y,N,E]),e.createElement(c.div,i({ref:s.useMergeRefs([P,x,r]),id:F,role:"option",className:f,"data-value":u,"data-label":u,"data-active":I?(null===(n=S.current)||void 0===n?void 0:n.id)==F:L,"aria-selected":D,"aria-disabled":!!d||void 0,"data-disabled":d?"":void 0},R({tabIndex:d?-1:L?0:-1,onClick:function(){return!d&&h(k)},onKeyDown:function(e){d||("Enter"===e.key&&(e.preventDefault(),h(k))," "!==e.key||g.current||(e.preventDefault(),h(k)))}}),v,{tabIndex:d?-1:L?0:-1}),l)}));p.displayName="SelectPrimitiveItem";var h=e.forwardRef((function(t,r){var n=t.children,l=t.className,d=t.disabled,f=t.asChild,v=t.onClick,p=o(t,["children","className","disabled","asChild","onClick"]),h=a(m),g=h.isOpen,R=h.setIsOpen,C=h.selectedLabel,b=h.refs,S=(0,h.getReferenceProps)();S.onClick;var N=o(S,["onClick"]),I=u(v,(function(){d||R((function(e){return!e}))}));return e.createElement(c.button,i({type:f?void 0:"button",className:l,"aria-expanded":g,"data-state":g?"open":"closed","aria-disabled":!!d||void 0,disabled:!!d||void 0,ref:s.useMergeRefs([b.setReference,r]),role:"combobox",asChild:f,onClick:I},N,p),C||n)}));h.displayName="SelectPrimitiveTrigger";var g=e.forwardRef((function(t,a){var u=t.children,f=t.className,v=t.value,p=t.name,h=t.defaultValue,g=void 0===h?"":h,R=t.onValueChange;t.onClickOutside;var C=t.placement,b=void 0===C?"bottom-start":C,S=t.offsetValue,N=t.shift,I=void 0===N||N,y=o(t,["children","className","value","name","defaultValue","onValueChange","onClickOutside","placement","offsetValue","shift"]),E=e.useState(!1),x=E[0],w=E[1],P=e.useState(S),k=P[0],V=P[1],L=d(v,g,R),D=L[0],F=L[1],O=e.useRef(null),T=e.useRef([]),j=e.useRef([]),A=e.useRef([]),M=e.useState([]),G=M[0],B=M[1],q=e.useRef(!1),H=e.useRef(null),K=e.useRef(null),W=e.useState(null),_=W[0],z=W[1],J=e.useState(null),Q=J[0],U=J[1],X=e.useState(!1),Y=X[0],Z=X[1],$=function(e){var t=r(!1),a=t[0],l=t[1];return n((function(){if(e){for(var t=e;t;){if("FORM"===t.tagName)return void l(!0);t=t.parentElement}l(!1)}else l(!1)}),[e]),a}(H.current),ee=s.useFloating({middleware:[s.offset(k)],open:x,onOpenChange:w,placement:b}),te=ee.refs,ae=ee.floatingStyles,re=ee.context,ne=s.useClick(re),le=s.useDismiss(re),oe=s.useRole(re,{role:"listbox"});var ie=e.useCallback((function(e){var t;if(null!==e&&!G.includes(e)&&(U(e),w(!1),null===(t=te.reference.current)||void 0===t||t.focus(),null!==e)){var a=j.current[e];a&&F(a)}}),[G,j,U,w,F,te]),se=s.useListNavigation(re,{listRef:T,activeIndex:_,selectedIndex:Q,onNavigate:z,virtual:Y,virtualItemRef:K,disabledIndices:G}),ce=s.useTypeahead(re,{listRef:j,activeIndex:_,selectedIndex:Q,enabled:!Y,onMatch:function(e){null===e||G.includes(e)||(x?z(e):ie(e))},onTypingChange:function(e){q.current=e}}),ue=s.useInteractions([ne,le,oe,se,ce]),de=ue.getReferenceProps,fe=ue.getFloatingProps,me=ue.getItemProps;l((function(){if(I&&O&&te.floating.current&&O.current){var e=te.floating.current.getBoundingClientRect(),t=O.current.getBoundingClientRect(),a=e.top-t.bottom;V(a)}}),[O.current,I]);var ve={isOpen:x,setIsOpen:w,handleSelect:ie,floatingContext:re,refs:te,getFloatingProps:fe,getReferenceProps:de,floatingStyles:ae,getItemProps:me,activeIndex:_,selectedIndex:Q,elementsRef:T,labelsRef:j,valuesRef:A,disabledIndices:G,setDisabledIndices:B,setActiveIndex:z,selectedLabel:D,isTypingRef:q,virtualItemRef:K,hasSearch:Y,setHasSearch:Z,selectedItemRef:O};return e.createElement(m.Provider,{value:ve},e.createElement(c.div,i({},y,{className:f,ref:s.useMergeRefs([H,a]),"data-state":x?"open":"closed"}),u,$&&e.createElement("select",{name:p,value:D,hidden:!0,"aria-hidden":"true",tabIndex:-1,onChange:function(){}},e.createElement("option",{value:D},D))))}));g.displayName="SelectPrimitiveRoot";var R=e.forwardRef((function(t,l){var c=t.children,u=t.container,d=o(t,["children","container"]),f=a(m).isOpen,v=r(!1),p=v[0],h=v[1],g=u||document.querySelector("#rad-ui-theme-container")||document.body;return n((function(){g&&h(!0)}),[g]),f&&p?e.createElement(s.Portal,i({root:g},d),c):null}));R.displayName="SelectPrimitivePortal";var C=e.forwardRef((function(t,a){var r=t.children,n=t.className,l=o(t,["children","className"]);return e.createElement("div",i({className:n,ref:a},l),r)}));C.displayName="SelectPrimitiveGroup";var b=e.forwardRef((function(t,r){var n,l=t.className,u=o(t,["className"]),d=e.useState(""),f=d[0],v=d[1],p=a(m),h=e.useRef(null);if(!p||!p.refs)return e.createElement(c.input,i({type:"search",className:l,placeholder:"Search...",value:f,onChange:function(e){return v(e.target.value)},ref:r},u));var g=p.refs,R=p.handleSelect,C=p.labelsRef,b=p.valuesRef,S=p.activeIndex,N=p.elementsRef,I=p.virtualItemRef,y=p.getReferenceProps;p.isTypingRef;var E=p.setHasSearch,x=e.useRef([]);e.useEffect((function(){E(!0),p&&p.setActiveIndex(0)}),[E]),e.useEffect((function(){if(g.floating.current){var e=g.floating.current,t=Array.from(e.querySelectorAll('[role="option"]'));0===x.current.length&&(x.current=t.map((function(e){var t;return{element:e,label:e.getAttribute("data-label")||(null===(t=e.textContent)||void 0===t?void 0:t.trim())||"",value:e.getAttribute("data-value")||e.id||"",parent:e.parentElement}}))),x.current.forEach((function(e){var t=e.element;t.parentElement&&t.parentElement.removeChild(t)}));var a=[];x.current.forEach((function(e){var t=e.element,r=e.label,n=e.value,l=e.parent;r.toLowerCase().includes(f.toLowerCase())&&l&&(l.appendChild(t),a.push({element:t,label:r,value:n}))})),p.setActiveIndex(null),N.current=a.map((function(e){return e.element})),C.current=a.map((function(e){return e.label}))}}),[f,g.floating.current]);var w=y();return e.createElement(c.input,i({type:"search",className:l,placeholder:"Search...",ref:s.useMergeRefs([h,r]),value:f,"aria-activedescendant":(null===(n=I.current)||void 0===n?void 0:n.id)||(null!==S&&b.current[S]?b.current[S]:void 0),onChange:function(e){return v(e.target.value)}},w,{onKeyDown:function(e){null!==S&&"Enter"===e.key&&(e.preventDefault(),R(S))}},u))}));b.displayName="SelectPrimitiveSearch";var S=e.forwardRef((function(e,t){return console.warn("Direct usage of Select is not supported. Please use Select.Root, Select.Content, etc. instead."),null}));S.displayName="SelectPrimitive";var N=S;N.Root=g,N.Content=v,N.Portal=R,N.Item=p,N.Trigger=h,N.Group=C,N.Search=b;var I=e.createContext({rootClass:""}),y=e.forwardRef((function(t,r){t.customRootClass;var n=t.children,l=t.position,s=void 0===l?"popper":l,c=o(t,["customRootClass","children","position"]),u=a(I).rootClass;return e.createElement(N.Content,i({className:"".concat(u,"-content"),position:s,"data-position":s,ref:r},c),n)}));y.displayName="SelectContent";var E=e.forwardRef((function(t,r){t.customRootClass;var n=t.children,l=t.value,s=t.disabled,c=o(t,["customRootClass","children","value","disabled"]),u=a(I).rootClass;return e.createElement(N.Item,i({className:"".concat(u,"-item"),value:l,disabled:s,"data-disabled":s?"":void 0,role:"option","aria-disabled":s?"true":void 0,ref:r},c),e.createElement("span",{className:"".concat(u,"-text")},n))}));E.displayName="SelectItem";var x=e.forwardRef((function(t,r){t.customRootClass;var n=t.children,l=t.disabled,s=t.placeholder,c=o(t,["customRootClass","children","disabled","placeholder"]),u=a(I).rootClass;return e.createElement(N.Trigger,i({className:"".concat(u,"-trigger"),"aria-disabled":l?"true":void 0,"data-placeholder":s?"":void 0,disabled:l,ref:r},c),n)}));x.displayName="SelectTrigger";var w=e.forwardRef((function(t,a){var r=t.customRootClass,n=t.children,l=t.defaultValue,s=t.value,c=t.onValueChange,u=t.shift,d=o(t,["customRootClass","children","defaultValue","value","onValueChange","shift"]),m=f(r,"Select");return e.createElement(I.Provider,{value:{rootClass:m}},e.createElement(N.Root,i({className:"".concat(m,"-root"),defaultValue:l,value:s,onValueChange:c,shift:u,ref:a},d),n))}));w.displayName="SelectRoot";var P=e.forwardRef((function(t,r){var n=a(I).rootClass;return e.createElement("div",i({className:"".concat(n,"-item-indicator"),ref:r},t),e.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M13.3332 4L5.99984 11.3333L2.6665 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})))}));P.displayName="SelectIndicator";var k=e.forwardRef((function(t,a){var r=t.children,n=t.container,l=o(t,["children","container"]);return e.createElement(N.Portal,i({ref:a,container:n},l),r)}));k.displayName="SelectPortal";var V=e.forwardRef((function(t,r){var n=t.children,l=o(t,["children"]),s=a(I).rootClass;return e.createElement(N.Group,i({className:"".concat(s,"-group"),ref:r},l),n)}));V.displayName="SelectGroup";var L=e.forwardRef((function(t,r){var n=a(I).rootClass;return e.createElement(N.Search,i({className:"".concat(n,"-search"),ref:r},t))}));L.displayName="SelectSearch";var D=e.forwardRef((function(e,t){return console.warn("Direct usage of Select is not supported. Please use Select.Root, Select.Content, etc. instead."),null}));D.displayName="Select";var F=D;F.Root=w,F.Content=y,F.Item=E,F.Trigger=x,F.Portal=k,F.Group=V,F.Indicator=P,F.Search=L;export{F as default};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import Primitive from '~/core/primitives/Primitive';
|
|
3
|
+
|
|
4
|
+
type PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
5
|
+
type SeparatorProps = {
|
|
6
|
+
orientation?: 'horizontal' | 'vertical';
|
|
7
|
+
customRootClass?: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
decorative?: boolean;
|
|
10
|
+
} & PrimitiveDivProps;
|
|
11
|
+
declare const Separator: React.ForwardRefExoticComponent<SeparatorProps & React.RefAttributes<HTMLElement>>;
|
|
12
|
+
|
|
13
|
+
export { Separator as default };
|
|
14
|
+
export type { SeparatorProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{_ as a,b as o}from"./tslib.es6-B3RR16LH.js";import r from"react";import{c as t}from"./index-BVxS3Ixi.js";import{c as e}from"./clsx-BaVHROc5.js";import{P as i}from"./index-DR_GC01Z.js";var s="Separator",c=r.forwardRef((function(c,l){var m=c.orientation,n=void 0===m?"horizontal":m,d=c.className,f=c.customRootClass,v=c.color,p=void 0===v?"":v,u=c.decorative,j=void 0!==u&&u,x=a(c,["orientation","className","customRootClass","color","decorative"]),N=t(f,s),h="".concat(N,"vertical"===n?"-vertical":"-horizontal"),R={};return R["data-orientation"]=n,p&&(R["data-rad-ui-accent-color"]=p),j&&(R.role="separator",R["aria-hidden"]="true"),r.createElement(i.div,o({ref:l,className:e(N,h,d)},R,x))}));c.displayName=s;export{c as default};
|
|
@@ -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,b as s}from"./tslib.es6-B3RR16LH.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,b as a,a as t}from"./tslib.es6-B3RR16LH.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-DR_GC01Z.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,a as t,b as n}from"./tslib.es6-B3RR16LH.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,b as t}from"./tslib.es6-B3RR16LH.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-DR_GC01Z.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,b as r}from"./tslib.es6-B3RR16LH.js";import a from"react";import{c as o}from"./clsx-BaVHROc5.js";import{c as e}from"./index-BVxS3Ixi.js";var t="Strong",m=a.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 a.createElement("strong",r({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,b as a}from"./tslib.es6-B3RR16LH.js";import s,{createContext as d,forwardRef as i,useContext as c}from"react";import{B as t}from"./index-BxNZdFaZ.js";import{c as o}from"./index-BVxS3Ixi.js";import{u as r,a as l,b as n}from"./index-CD1lNchI.js";import{u as h}from"./index-fkj4Fdgt.js";import{P as m}from"./index-DR_GC01Z.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,b as e}from"./tslib.es6-B3RR16LH.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-Br4Ygpsh.js";import{P as d}from"./index-DR_GC01Z.js";import{c as m}from"./index-BVxS3Ixi.js";import{u as v}from"./index-fkj4Fdgt.js";import"./index-BxNZdFaZ.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,b=void 0===h?"#":h,p=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:b},T),p))}));h.displayName="TabNavLink";var b=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,b=n.children;n.color;var p=n.customRootClass,C=void 0===p?"":p,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),b))))}));b.displayName="TabNavRoot";var p=function(){return console.warn("Direct usage of TabNav is not supported. Please use TabNav.Root, TabNav.Link instead."),null};p.Root=b,p.Link=h;export{p 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,b as r}from"./tslib.es6-B3RR16LH.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};
|