@radui/ui 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion.d.ts +67 -34
- package/dist/components/Accordion.js +1 -1
- package/dist/components/AlertDialog.d.ts +13 -14
- package/dist/components/AlertDialog.js +1 -1
- package/dist/components/AspectRatio.js +1 -1
- package/dist/components/Avatar.d.ts +4 -3
- package/dist/components/Avatar.js +1 -1
- package/dist/components/AvatarGroup.d.ts +1 -0
- package/dist/components/AvatarGroup.js +1 -1
- package/dist/components/AvatarPrimitiveFallback-KiY3slgV.js +1 -0
- package/dist/components/Badge.d.ts +6 -4
- package/dist/components/Badge.js +1 -1
- package/dist/components/BlockQuote.js +1 -1
- package/dist/components/Button.js +1 -1
- package/dist/components/Callout.d.ts +19 -12
- package/dist/components/Callout.js +1 -1
- package/dist/components/Card.d.ts +30 -1
- package/dist/components/Card.js +1 -1
- package/dist/components/Checkbox.d.ts +22 -6
- package/dist/components/Checkbox.js +1 -1
- package/dist/components/CheckboxCards.d.ts +25 -7
- package/dist/components/CheckboxCards.js +1 -1
- package/dist/components/CheckboxGroup.d.ts +22 -7
- package/dist/components/CheckboxGroup.js +1 -1
- package/dist/components/CheckboxGroupPrimitive-DIOswrR1.js +1 -0
- package/dist/components/Code.js +1 -1
- package/dist/components/Collapsible.d.ts +12 -9
- package/dist/components/Collapsible.js +1 -1
- package/dist/components/Combobox.d.ts +98 -0
- package/dist/components/Combobox.js +1 -0
- package/dist/components/ComboboxPrimitive-Bn1C5dkn.js +1 -0
- package/dist/components/ContextMenu.d.ts +31 -1
- package/dist/components/ContextMenu.js +1 -1
- package/dist/components/DataList.d.ts +12 -5
- package/dist/components/DataList.js +1 -1
- package/dist/components/Dialog.d.ts +37 -18
- package/dist/components/Dialog.js +1 -1
- package/dist/components/Disclosure.d.ts +6 -1
- package/dist/components/Disclosure.js +1 -1
- package/dist/components/DropdownMenu.d.ts +31 -1
- package/dist/components/DropdownMenu.js +1 -1
- package/dist/components/Em.js +1 -1
- package/dist/components/Heading.js +1 -1
- package/dist/components/HoverCard.d.ts +12 -1
- package/dist/components/HoverCard.js +1 -1
- package/dist/components/Kbd.d.ts +1 -1
- package/dist/components/Kbd.js +1 -1
- package/dist/components/Link.d.ts +3 -1
- package/dist/components/Link.js +1 -1
- package/dist/components/MenuPrimitive-6Qr46BSn.js +1 -0
- package/dist/components/Menubar.d.ts +81 -37
- package/dist/components/Menubar.js +1 -1
- package/dist/components/Minimap.d.ts +11 -8
- package/dist/components/Minimap.js +1 -1
- package/dist/components/NavigationMenu.d.ts +13 -12
- package/dist/components/NavigationMenu.js +1 -1
- package/dist/components/NumberField.d.ts +28 -6
- package/dist/components/NumberField.js +1 -1
- package/dist/components/Progress.d.ts +1 -1
- package/dist/components/Progress.js +1 -1
- package/dist/components/Quote.js +1 -1
- package/dist/components/Radio.js +1 -1
- package/dist/components/RadioCards.d.ts +7 -2
- package/dist/components/RadioCards.js +1 -1
- package/dist/components/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup.js +1 -1
- package/dist/components/RadioGroupPrimitive-QSMno27i.js +1 -0
- package/dist/components/ScrollArea.d.ts +18 -2
- package/dist/components/ScrollArea.js +1 -1
- package/dist/components/Select.d.ts +20 -15
- package/dist/components/Select.js +1 -1
- package/dist/components/Separator.js +1 -1
- package/dist/components/Skeleton.js +1 -1
- package/dist/components/Slider.d.ts +57 -11
- package/dist/components/Slider.js +1 -1
- package/dist/components/Spinner.d.ts +13 -0
- package/dist/components/Spinner.js +1 -0
- package/dist/components/Splitter.d.ts +1 -1
- package/dist/components/Splitter.js +1 -1
- package/dist/components/Steps.d.ts +21 -9
- package/dist/components/Steps.js +1 -1
- package/dist/components/Strong.js +1 -1
- package/dist/components/Switch.d.ts +8 -7
- package/dist/components/Switch.js +1 -1
- package/dist/components/TabNav.d.ts +23 -5
- package/dist/components/TabNav.js +1 -1
- package/dist/components/Table.d.ts +9 -1
- package/dist/components/Table.js +1 -1
- package/dist/components/Tabs.d.ts +25 -1
- package/dist/components/Tabs.js +1 -1
- package/dist/components/Text.js +1 -1
- package/dist/components/TextArea.d.ts +15 -2
- package/dist/components/TextArea.js +1 -1
- package/dist/components/Theme.js +1 -1
- package/dist/components/ThemeContext-Sm-iNANd.js +1 -0
- package/dist/components/Toggle.js +1 -1
- package/dist/components/ToggleGroup.d.ts +33 -0
- package/dist/components/ToggleGroup.js +1 -1
- package/dist/components/Toolbar.d.ts +83 -0
- package/dist/components/Toolbar.js +1 -0
- package/dist/components/Tooltip.d.ts +6 -0
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/Tree.d.ts +10 -1
- package/dist/components/Tree.js +1 -1
- package/dist/components/VisuallyHidden.d.ts +1 -1
- package/dist/components/VisuallyHidden.js +1 -1
- package/dist/components/check-DujVUWP-.js +44 -0
- package/dist/components/floating-ui.react-DMgxgTKq.js +5 -0
- package/dist/components/index-3dZuI04X.js +1 -0
- package/dist/components/index-6If6D2Zi.js +1 -0
- package/dist/components/index-98jQ1vTr.js +1 -0
- package/dist/components/index-BOy86lYu.js +1 -0
- package/dist/components/index-BZVbVgqN.js +1 -0
- package/dist/components/index-CTJl2pTM.js +1 -0
- package/dist/components/index-CXzybYmm.js +1 -0
- package/dist/components/index-DTYJVF-V.js +1 -0
- package/dist/components/index-hAp0hL9w.js +1 -0
- package/dist/components/index-wRElCyvx.js +1 -0
- package/dist/components/index-yqRHPukT.js +1 -0
- package/dist/themes/default.css +1 -1
- package/package.json +51 -32
- package/dist/components/AvatarPrimitiveFallback-SECStDbi.js +0 -1
- package/dist/components/CheckboxGroupPrimitive-CEeFUCQV.js +0 -1
- package/dist/components/MenuPrimitive-CBMvjJyH.js +0 -1
- package/dist/components/RadioGroupPrimitive-CbRZK8wB.js +0 -1
- package/dist/components/floating-ui.react-CLbXmKZY.js +0 -5
- package/dist/components/index-BVxS3Ixi.js +0 -1
- package/dist/components/index-BgvB1-RV.js +0 -1
- package/dist/components/index-Br4Ygpsh.js +0 -1
- package/dist/components/index-BuGKU1-S.js +0 -1
- package/dist/components/index-BxNZdFaZ.js +0 -1
- package/dist/components/index-CD1lNchI.js +0 -1
- package/dist/components/index-DBZNt4Em.js +0 -1
- package/dist/components/index-DR_GC01Z.js +0 -1
- package/dist/components/index-Di6TooPD.js +0 -1
- package/dist/components/index-DzAecJCk.js +0 -1
- package/dist/components/index-fkj4Fdgt.js +0 -1
- package/dist/components/tslib.es6-B3RR16LH.js +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import ComboboxPrimitive from '~/core/primitives/Combobox/ComboboxPrimitive';
|
|
3
3
|
import * as _floating_ui_react from '@floating-ui/react';
|
|
4
4
|
|
|
5
|
-
type SelectContentProps = React.ComponentPropsWithoutRef<typeof
|
|
5
|
+
type SelectContentProps = React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Content> & {
|
|
6
6
|
customRootClass?: string;
|
|
7
7
|
};
|
|
8
8
|
declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
|
|
10
|
-
interface
|
|
10
|
+
interface ComboboxPrimitiveItemProps {
|
|
11
11
|
children: React.ReactNode;
|
|
12
12
|
value: string;
|
|
13
13
|
disabled?: boolean;
|
|
@@ -15,30 +15,37 @@ interface SelectPrimitiveItemProps {
|
|
|
15
15
|
[key: string]: any;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
type SelectItemProps = React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Item> & {
|
|
19
|
+
customRootClass?: string;
|
|
20
|
+
};
|
|
21
|
+
declare const SelectItem: React.ForwardRefExoticComponent<(Omit<Omit<Omit<ComboboxPrimitiveItemProps & Omit<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
19
22
|
asChild?: boolean;
|
|
20
23
|
} & React.RefAttributes<HTMLElement>, "ref">, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
21
24
|
customRootClass?: string;
|
|
22
|
-
}, "ref"> | Omit<Omit<Omit<
|
|
25
|
+
}, "ref"> | Omit<Omit<Omit<ComboboxPrimitiveItemProps & Omit<React.HTMLAttributes<HTMLElement> & {
|
|
23
26
|
asChild?: boolean;
|
|
24
27
|
children?: React.ReactNode;
|
|
25
28
|
} & React.RefAttributes<HTMLElement>, "ref">, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
26
29
|
customRootClass?: string;
|
|
27
30
|
}, "ref">) & React.RefAttributes<HTMLElement>>;
|
|
28
31
|
|
|
29
|
-
type
|
|
32
|
+
type ComboboxPrimitiveTriggerProps = {
|
|
30
33
|
children: React.ReactNode;
|
|
31
34
|
className?: string;
|
|
32
35
|
disabled?: boolean;
|
|
33
36
|
[key: string]: any;
|
|
34
37
|
};
|
|
35
38
|
|
|
36
|
-
|
|
39
|
+
type SelectTriggerProps = React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Trigger> & {
|
|
40
|
+
customRootClass?: string;
|
|
41
|
+
placeholder?: boolean;
|
|
42
|
+
};
|
|
43
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<(Omit<Omit<Omit<ComboboxPrimitiveTriggerProps & Omit<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
37
44
|
asChild?: boolean;
|
|
38
45
|
} & React.RefAttributes<HTMLElement>, "ref">, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
39
46
|
customRootClass?: string;
|
|
40
47
|
placeholder?: boolean;
|
|
41
|
-
}, "ref"> | Omit<Omit<Omit<
|
|
48
|
+
}, "ref"> | Omit<Omit<Omit<ComboboxPrimitiveTriggerProps & Omit<React.HTMLAttributes<HTMLElement> & {
|
|
42
49
|
asChild?: boolean;
|
|
43
50
|
children?: React.ReactNode;
|
|
44
51
|
} & React.RefAttributes<HTMLElement>, "ref">, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
@@ -46,11 +53,12 @@ declare const SelectTrigger: React.ForwardRefExoticComponent<(Omit<Omit<Omit<Sel
|
|
|
46
53
|
placeholder?: boolean;
|
|
47
54
|
}, "ref">) & React.RefAttributes<HTMLElement>>;
|
|
48
55
|
|
|
49
|
-
type SelectRootProps = React.ComponentPropsWithoutRef<typeof
|
|
56
|
+
type SelectRootProps = React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Root> & {
|
|
50
57
|
customRootClass?: string;
|
|
51
58
|
};
|
|
52
59
|
declare const SelectRoot: React.ForwardRefExoticComponent<SelectRootProps & React.RefAttributes<HTMLElement>>;
|
|
53
60
|
|
|
61
|
+
type SelectIndicatorProps = React.ComponentPropsWithoutRef<'div'>;
|
|
54
62
|
declare const SelectIndicator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
55
63
|
|
|
56
64
|
type SelectPortalProps = {
|
|
@@ -62,7 +70,7 @@ declare const SelectPortal: React.ForwardRefExoticComponent<Omit<{
|
|
|
62
70
|
container?: HTMLElement | null;
|
|
63
71
|
} & _floating_ui_react.FloatingPortalProps & React.RefAttributes<never>, "ref"> & SelectPortalProps & React.RefAttributes<never>>;
|
|
64
72
|
|
|
65
|
-
type
|
|
73
|
+
type ComboboxPrimitiveGroupProps = {
|
|
66
74
|
children: React.ReactNode;
|
|
67
75
|
className?: string;
|
|
68
76
|
};
|
|
@@ -70,10 +78,7 @@ type SelectPrimitiveGroupProps = {
|
|
|
70
78
|
type SelectGroupProps = {
|
|
71
79
|
children: React.ReactNode;
|
|
72
80
|
};
|
|
73
|
-
declare const SelectGroup: React.ForwardRefExoticComponent<Omit<
|
|
74
|
-
|
|
75
|
-
type SelectSearchProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Search>;
|
|
76
|
-
declare const SelectSearch: React.ForwardRefExoticComponent<SelectSearchProps & React.RefAttributes<HTMLElement>>;
|
|
81
|
+
declare const SelectGroup: React.ForwardRefExoticComponent<Omit<ComboboxPrimitiveGroupProps & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
77
82
|
|
|
78
83
|
interface SelectComponent extends React.ForwardRefExoticComponent<React.RefAttributes<unknown>> {
|
|
79
84
|
Root: typeof SelectRoot;
|
|
@@ -83,8 +88,8 @@ interface SelectComponent extends React.ForwardRefExoticComponent<React.RefAttri
|
|
|
83
88
|
Portal: typeof SelectPortal;
|
|
84
89
|
Group: typeof SelectGroup;
|
|
85
90
|
Indicator: typeof SelectIndicator;
|
|
86
|
-
Search: typeof SelectSearch;
|
|
87
91
|
}
|
|
88
92
|
declare const Select: SelectComponent;
|
|
89
93
|
|
|
90
94
|
export { Select as default };
|
|
95
|
+
export type { SelectContentProps, SelectGroupProps, SelectIndicatorProps, SelectItemProps, SelectPortalProps, SelectRootProps, SelectTriggerProps };
|
|
@@ -1 +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};
|
|
1
|
+
'use client';import e,{useContext as o}from"react";import{jsx as t}from"react/jsx-runtime";import{C as r}from"./ComboboxPrimitive-Bn1C5dkn.js";import{c as a}from"./index-6If6D2Zi.js";import{C as s}from"./check-DujVUWP-.js";import"./index-yqRHPukT.js";import"./floating-ui.react-DMgxgTKq.js";import"react-dom";import"./index-98jQ1vTr.js";import"./index-CXzybYmm.js";import"./index-wRElCyvx.js";const i=e.createContext({rootClass:""}),l=e.forwardRef((({customRootClass:e,children:a,position:s="popper",...l},n)=>{const{rootClass:c}=o(i);return t(r.Content,{className:`${c}-content`,position:s,"data-position":s,ref:n,...l,children:a})}));l.displayName="SelectContent";const n=e.forwardRef((({customRootClass:e,children:a,value:s,disabled:l,...n},c)=>{const{rootClass:d}=o(i);return t(r.Item,{className:`${d}-item`,value:s,disabled:l,"data-disabled":l?"":void 0,role:"option","aria-disabled":l?"true":void 0,ref:c,...n,children:t("span",{className:`${d}-text`,children:a})})}));n.displayName="SelectItem";const c=e.forwardRef((({customRootClass:e,children:a,disabled:s,placeholder:l,...n},c)=>{const{rootClass:d}=o(i);return t(r.Trigger,{className:`${d}-trigger`,"aria-disabled":s?"true":void 0,"data-placeholder":l?"":void 0,disabled:s,ref:c,...n,children:a})}));c.displayName="SelectTrigger";const d=e.forwardRef((({customRootClass:e,children:o,defaultValue:s,value:l,onValueChange:n,shift:c,...d},m)=>{const p=a(e,"Select");return t(i.Provider,{value:{rootClass:p},children:t(r.Root,{className:`${p}-root`,defaultValue:s,value:l,onValueChange:n,shift:c,ref:m,...d,children:o})})}));d.displayName="SelectRoot";const m=e.forwardRef(((e,r)=>{const{rootClass:a}=o(i);return t("div",{className:`${a}-item-indicator`,ref:r,...e,children:t(s,{width:16,height:16})})}));m.displayName="SelectIndicator";const p=e.forwardRef((({children:e,container:o,...a},s)=>t(r.Portal,{ref:s,container:o,...a,children:e})));p.displayName="SelectPortal";const f=e.forwardRef((({children:e,...a},s)=>{const{rootClass:l}=o(i);return t(r.Group,{className:`${l}-group`,ref:s,...a,children:e})}));f.displayName="SelectGroup";const u=e.forwardRef(((e,o)=>(console.warn("Direct usage of Select is not supported. Please use Select.Root, Select.Content, etc. instead."),null)));u.displayName="Select";const h=u;h.Root=d,h.Content=l,h.Item=n,h.Trigger=c,h.Portal=p,h.Group=f,h.Indicator=m;export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
1
|
+
'use client';import{jsx as r}from"react/jsx-runtime";import a from"react";import{c as o}from"./index-6If6D2Zi.js";import{c as t}from"./clsx-BaVHROc5.js";import{P as e}from"./index-98jQ1vTr.js";const i="Separator",s=a.forwardRef((({orientation:a="horizontal",className:s,customRootClass:c,color:m="",decorative:n=!1,...l},d)=>{const f=o(c,i),p="vertical"===a?`${f}-vertical`:`${f}-horizontal`,u={};return u["data-orientation"]=a,m&&(u["data-rad-ui-accent-color"]=m),n&&(u.role="separator",u["aria-hidden"]="true"),r(e.div,{ref:d,className:t(f,p,s),...u,...l})}));s.displayName=i;export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
1
|
+
'use client';import{jsx as e,Fragment as t}from"react/jsx-runtime";import s from"react";import{c as r}from"./index-6If6D2Zi.js";import{c as o}from"./clsx-BaVHROc5.js";const i="Skeleton",a=s.forwardRef((({loading:s=!0,className:a="",customRootClass:l="",children:m,height:n,width:c,radius:d,style:f,...h},u)=>{if(!s)return e(t,{children:m});const p=r(l,i);return e("div",{ref:u,className:o(p,a),style:{...f,"--skeleton-height":n,"--skeleton-width":c,"--skeleton-radius":d},...h})}));a.displayName=i;export{a as default};
|
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { ComponentPropsWithoutRef, ElementRef, ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
2
|
|
|
3
|
+
type SliderRootProps = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
customRootClass?: string;
|
|
7
|
+
defaultValue?: number | number[];
|
|
8
|
+
value?: number | number[];
|
|
9
|
+
onValueChange?: (value: number | 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<ComponentPropsWithoutRef<'div'>, 'value' | 'defaultValue' | 'onValueChange'>;
|
|
3
20
|
declare const SliderRoot: React.ForwardRefExoticComponent<{
|
|
4
21
|
children: React.ReactNode;
|
|
5
22
|
className?: string;
|
|
6
23
|
customRootClass?: string;
|
|
7
|
-
defaultValue?: number;
|
|
8
|
-
value?: number;
|
|
9
|
-
onValueChange?: (value: number) => void;
|
|
24
|
+
defaultValue?: number | number[];
|
|
25
|
+
value?: number | number[];
|
|
26
|
+
onValueChange?: (value: number | number[]) => void;
|
|
10
27
|
min?: number;
|
|
11
28
|
max?: number;
|
|
12
29
|
step?: number;
|
|
@@ -16,23 +33,44 @@ declare const SliderRoot: React.ForwardRefExoticComponent<{
|
|
|
16
33
|
pageStepMultiplier?: number;
|
|
17
34
|
showStepMarks?: boolean;
|
|
18
35
|
formatValue?: (value: number) => string;
|
|
19
|
-
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
36
|
+
} & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "value" | "defaultValue" | "onValueChange"> & React.RefAttributes<HTMLDivElement>>;
|
|
20
37
|
|
|
38
|
+
type SliderTrackProps = {
|
|
39
|
+
children: React.ReactNode;
|
|
40
|
+
} & ComponentPropsWithoutRef<'div'>;
|
|
21
41
|
declare const SliderTrack: React.ForwardRefExoticComponent<{
|
|
22
42
|
children: React.ReactNode;
|
|
23
43
|
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
24
44
|
|
|
45
|
+
type SliderThumbProps = {
|
|
46
|
+
children?: React.ReactNode;
|
|
47
|
+
asChild?: boolean;
|
|
48
|
+
index?: number;
|
|
49
|
+
'aria-label'?: string;
|
|
50
|
+
'aria-labelledby'?: string;
|
|
51
|
+
} & ComponentPropsWithoutRef<'div'>;
|
|
25
52
|
declare const SliderThumb: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
|
26
53
|
children?: React.ReactNode;
|
|
27
54
|
asChild?: boolean;
|
|
55
|
+
index?: number;
|
|
28
56
|
'aria-label'?: string;
|
|
29
57
|
'aria-labelledby'?: string;
|
|
30
58
|
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLElement>>>;
|
|
31
59
|
|
|
60
|
+
type SliderRangeProps = {
|
|
61
|
+
children?: React.ReactNode;
|
|
62
|
+
} & ComponentPropsWithoutRef<'div'>;
|
|
32
63
|
declare const SliderRange: React.ForwardRefExoticComponent<{
|
|
33
|
-
children
|
|
64
|
+
children?: React.ReactNode;
|
|
34
65
|
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
35
66
|
|
|
67
|
+
type SliderMarksProps = {
|
|
68
|
+
children?: React.ReactNode;
|
|
69
|
+
customMarks?: Array<{
|
|
70
|
+
value: number;
|
|
71
|
+
label?: string;
|
|
72
|
+
}>;
|
|
73
|
+
} & ComponentPropsWithoutRef<'div'>;
|
|
36
74
|
declare const SliderMarks: React.ForwardRefExoticComponent<{
|
|
37
75
|
children?: React.ReactNode;
|
|
38
76
|
customMarks?: Array<{
|
|
@@ -41,6 +79,14 @@ declare const SliderMarks: React.ForwardRefExoticComponent<{
|
|
|
41
79
|
}>;
|
|
42
80
|
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
43
81
|
|
|
82
|
+
type SliderRangeSliderProps = {
|
|
83
|
+
children?: React.ReactNode;
|
|
84
|
+
'aria-label'?: string;
|
|
85
|
+
'aria-labelledby'?: string;
|
|
86
|
+
defaultValue?: [number, number];
|
|
87
|
+
value?: [number, number];
|
|
88
|
+
onValueChange?: (value: [number, number]) => void;
|
|
89
|
+
} & ComponentPropsWithoutRef<'div'>;
|
|
44
90
|
declare const SliderRangeSlider: React.ForwardRefExoticComponent<{
|
|
45
91
|
children?: React.ReactNode;
|
|
46
92
|
'aria-label'?: string;
|
|
@@ -52,9 +98,9 @@ declare const SliderRangeSlider: React.ForwardRefExoticComponent<{
|
|
|
52
98
|
|
|
53
99
|
type SliderElement = ElementRef<'div'>;
|
|
54
100
|
type SliderProps = {
|
|
55
|
-
defaultValue?: number;
|
|
56
|
-
value?: number;
|
|
57
|
-
onValueChange?: (value: number) => void;
|
|
101
|
+
defaultValue?: number | number[];
|
|
102
|
+
value?: number | number[];
|
|
103
|
+
onValueChange?: (value: number | number[]) => void;
|
|
58
104
|
min?: number;
|
|
59
105
|
max?: number;
|
|
60
106
|
step?: number;
|
|
@@ -66,7 +112,7 @@ type SliderProps = {
|
|
|
66
112
|
formatValue?: (value: number) => string;
|
|
67
113
|
'aria-label'?: string;
|
|
68
114
|
'aria-labelledby'?: string;
|
|
69
|
-
} & ComponentPropsWithoutRef<'div'>;
|
|
115
|
+
} & Omit<ComponentPropsWithoutRef<'div'>, 'value' | 'defaultValue' | 'onValueChange'>;
|
|
70
116
|
type SliderComponent = ForwardRefExoticComponent<SliderProps & RefAttributes<SliderElement>> & {
|
|
71
117
|
Root: typeof SliderRoot;
|
|
72
118
|
Track: typeof SliderTrack;
|
|
@@ -78,4 +124,4 @@ type SliderComponent = ForwardRefExoticComponent<SliderProps & RefAttributes<Sli
|
|
|
78
124
|
declare const Slider: SliderComponent;
|
|
79
125
|
|
|
80
126
|
export { Slider as default };
|
|
81
|
-
export type { SliderElement, SliderProps };
|
|
127
|
+
export type { SliderElement, SliderMarksProps, SliderProps, SliderRangeProps, SliderRangeSliderProps, SliderRootProps, SliderThumbProps, SliderTrackProps };
|
|
@@ -1 +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};
|
|
1
|
+
'use client';import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import r,{createContext as n,forwardRef as l}from"react";import{c as o}from"./clsx-BaVHROc5.js";import{c as i}from"./index-6If6D2Zi.js";import{u as s}from"./index-wRElCyvx.js";import{P as u}from"./index-98jQ1vTr.js";const c=n({rootClass:"",value:0,setValue:()=>{},minValue:0,maxValue:100,step:1,name:void 0,isDragging:!1,setDragging:()=>{},disabled:!1,orientation:"horizontal",pageStepMultiplier:10,showStepMarks:!1,formatValue:void 0}),m="Slider",d=l((({children:t,className:a="",customRootClass:n="",defaultValue:l,value:u,onValueChange:d,min:p=0,max:h=100,step:f=1,disabled:v=!1,name:b,orientation:g="horizontal",pageStepMultiplier:w=10,showStepMarks:x=!1,formatValue:y,...$},M)=>{const k=i(n,m),[V,S]=s(u,l??(Array.isArray(u)?u:0),d),[A,N]=r.useState(!1),D=r.useRef(null),C=r.useRef(null),P=r.useMemo((()=>e=>{C.current=e,"function"==typeof M?M(e):M&&(M.current=e)}),[M]),R=e=>{const t=C.current;if(!t)return;const a=t.getBoundingClientRect();let r;r="vertical"===g?(a.bottom-e.clientY)/a.height:(e.clientX-a.left)/a.width;const n=p+r*(h-p),l=Math.round(n/f)*f,o=(i=l,Math.min(h,Math.max(p,i)));var i;if(Array.isArray(V)){let e=D.current;if(null===e){const t=V.map((e=>Math.abs(e-o)));e=t.indexOf(Math.min(...t)),D.current=e}const t=V.map(((e,t)=>({value:e,origIndex:t})));t[e].value=o,t.sort(((e,t)=>e.value-t.value)),D.current=t.findIndex((t=>t.origIndex===e)),S(t.map((e=>e.value)))}else S(o)},E={rootClass:k,value:V,setValue:S,minValue:p,maxValue:h,step:f,name:b,isDragging:A,setDragging:N,disabled:v,orientation:g,pageStepMultiplier:w,showStepMarks:x,formatValue:y};return e(c.Provider,{value:E,children:e("div",{ref:P,className:o(k,a),"data-slider-root":k,"data-disabled":v,"data-orientation":g,onPointerDown:e=>{if(v)return;e.stopPropagation();const t=e.target.closest(`.${k}-thumb`);if(t&&Array.isArray(V)){const e=parseInt(t.getAttribute("data-index")||"0",10);D.current=e,t.focus()}else if(D.current=null,Array.isArray(V))C.current?.focus();else{const e=C.current?.querySelector(`.${k}-thumb`);e?.focus()}N(!0),R(e);const a=e=>{e.preventDefault(),R(e)},r=()=>{N(!1),D.current=null,document.removeEventListener("pointermove",a),document.removeEventListener("pointerup",r)};document.addEventListener("pointermove",a),document.addEventListener("pointerup",r)},onPointerMove:e=>{A&&(e.preventDefault(),R(e))},onPointerUp:()=>{N(!1),D.current=null},...$,children:t})})}));d.displayName=m;const p=l((({children:t,...a},n)=>{const{rootClass:l}=r.useContext(c);return e("div",{ref:n,className:`${l}-track`,style:{position:"relative"},...a,children:t})}));p.displayName="SliderTrack";const h=r.memo(l((({children:n,asChild:l=!1,index:o=0,"aria-label":i,"aria-labelledby":s,...m},d)=>{const{rootClass:p,value:h,minValue:f,maxValue:v,step:b,setValue:g,name:w,isDragging:x,setDragging:y,disabled:$,orientation:M,pageStepMultiplier:k,formatValue:V}=r.useContext(c),S=Array.isArray(h)&&o>=0&&o<h.length?h[o]:"number"==typeof h?h:f,A=Number.isFinite(S)?S:f,N=Math.min(v,Math.max(f,A)),D=v===f?0:(N-f)/(v-f)*100,[C,P]=r.useState(!1),R=x?"dragging":C?"active":"inactive",E=e(u.div,{ref:d,asChild:l,className:`${p}-thumb`,role:"slider",tabIndex:$?-1:0,"aria-valuemin":f,"aria-valuemax":v,"aria-valuenow":N,"aria-valuetext":V?V(N):void 0,"aria-orientation":M,"aria-label":i,"aria-labelledby":s,"data-state":R,"data-disabled":$,"data-index":o,onKeyDown:e=>{if($)return;let t=N;const a=Boolean(e.currentTarget.closest('[dir="rtl"]'));switch(e.key){case"ArrowRight":t=a?N-b:N+b;break;case"ArrowLeft":t=a?N+b:N-b;break;case"ArrowUp":t=N+b;break;case"ArrowDown":t=N-b;break;case"Home":t=f;break;case"End":t=v;break;case"PageUp":t=N+b*k;break;case"PageDown":t=N-b*k;break;default:return}e.preventDefault();const r=(n=t,Math.min(v,Math.max(f,n)));var n;if(Array.isArray(h)){const e=[...h];e[o]=r,g(e)}else g(r)},onPointerDown:e=>{$||(e.currentTarget.focus(),y(!0))},onPointerUp:()=>{y(!1)},onFocus:()=>P(!0),onBlur:()=>P(!1),style:"vertical"===M?{bottom:`calc(${D}% - 10px)`}:{left:`calc(${D}% - 10px)`},...m,children:n});return t(a,{children:[E,e("input",{type:"hidden",value:N,name:Array.isArray(h)?`${w}[${o}]`:w})]})})));h.displayName="SliderThumb";const f=l((({children:t,...a},n)=>{const{rootClass:l,value:o,minValue:i,maxValue:s,orientation:u}=r.useContext(c);let m=0,d=0;if(Array.isArray(o))if(0===o.length)m=0,d=0;else{const e=[...o].sort(((e,t)=>e-t)),t=e[0],a=e[e.length-1];m=s===i?0:(t-i)/(s-i)*100,d=s===i?0:(a-i)/(s-i)*100,1===o.length&&(m=0)}else m=0,d=s===i?0:(o-i)/(s-i)*100;const p=d-m;return e("div",{ref:n,className:`${l}-range`,style:"vertical"===u?{height:`${p}%`,marginTop:100-d+"%"}:{marginLeft:`${m}%`,width:`${p}%`},...a,children:t})}));f.displayName="SliderRange";const v=l((({children:a,customMarks:n,...l},o)=>{const{rootClass:i,minValue:s,maxValue:u,step:m,orientation:d,showStepMarks:p}=r.useContext(c);if(!p&&!n)return null;const h=[];if(n)n.forEach((({value:a,label:r})=>{const n=u===s?0:(a-s)/(u-s)*100;h.push(t("div",{className:`${i}-mark ${i}-mark-custom`,"data-testid":`mark-${a}`,style:"vertical"===d?{bottom:`${n}%`,left:"50%",transform:"translateX(-50%)"}:{left:`${n}%`,top:0,transform:"translateX(-50%)"},"data-value":a,children:[e("div",{className:`${i}-mark-line`,style:"vertical"===d?{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%)"}}),r&&e("span",{className:`${i}-mark-label`,style:"vertical"===d?{right:"16px",top:"50%",transform:"translateY(-50%)",whiteSpace:"nowrap"}:{top:"8px",left:"50%",transform:"translateX(-50%)",whiteSpace:"nowrap"},children:r})]},a))}));else for(let t=s;t<=u;t+=m){const a=u===s?0:(t-s)/(u-s)*100;h.push(e("div",{className:`${i}-mark`,"data-testid":`mark-${t}`,style:"vertical"===d?{bottom:`${a}%`,left:"50%",transform:"translateX(-50%)"}:{left:`${a}%`,top:0,transform:"translateX(-50%)"},"data-value":t,children:e("div",{className:`${i}-mark-line`,style:"vertical"===d?{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%)"}})},t))}return t("div",{ref:o,className:`${i}-marks`,style:{position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none",zIndex:1},...l,children:[h,a]})}));v.displayName="SliderMarks";const b=l((({children:a,"aria-label":n,"aria-labelledby":l,defaultValue:o=[25,75],value:i,onValueChange:s,...m},d)=>{const{rootClass:p,minValue:h,maxValue:f,step:v,disabled:b,orientation:g}=r.useContext(c),[w,x]=r.useState(i||o),[y,$]=r.useState(null),[M,k]=r.useState(null),V=r.useRef(0),S=e=>Math.min(f,Math.max(h,e)),A=e=>{x(e),s?.(e)},N=f===h?0:(w[0]-h)/(f-h)*100,D=f===h?0:(w[1]-h)/(f-h)*100,C=(e,t)=>{const a=e.currentTarget.getBoundingClientRect();let r;r="vertical"===g?(a.bottom-e.clientY)/a.height:(e.clientX-a.left)/a.width;const n=h+r*(f-h),l=Math.round(n/v)*v,o=S(l),i=[...w];i["lower"===t?0:1]=o,"lower"===t?i[0]=Math.min(i[0],w[1]):i[1]=Math.max(i[1],w[0]),A(i)},P=(e,t)=>{if(b)return;e.stopPropagation(),$(t),C(e,t);const a=e=>{e.preventDefault();const a=document.querySelector(`[data-slider-root="${p}"]`);if(!a)return;const r=a.getBoundingClientRect();let n;n="vertical"===g?(r.bottom-e.clientY)/r.height:(e.clientX-r.left)/r.width;const l=h+n*(f-h),o=Math.round(l/v)*v,i=S(o),s=[...w];s["lower"===t?0:1]=i,"lower"===t?s[0]=Math.min(s[0],w[1]):s[1]=Math.max(s[1],w[0]);const u=performance.now();u-V.current>16&&(A(s),V.current=u)},r=()=>{$(null),document.removeEventListener("pointermove",a),document.removeEventListener("pointerup",r)};document.addEventListener("pointermove",a),document.addEventListener("pointerup",r)},R=(e,t)=>{y&&y===t&&(e.preventDefault(),C(e,t))},E=()=>{$(null)},X=(e,t)=>{if(b)return;const a=[...w],r=Boolean(e.currentTarget.closest('[dir="rtl"]'));switch(e.key){case"ArrowRight":a["lower"===t?0:1]=r?w["lower"===t?0:1]-v:w["lower"===t?0:1]+v;break;case"ArrowLeft":a["lower"===t?0:1]=r?w["lower"===t?0:1]+v:w["lower"===t?0:1]-v;break;case"ArrowUp":a["lower"===t?0:1]=w["lower"===t?0:1]+v;break;case"ArrowDown":a["lower"===t?0:1]=w["lower"===t?0:1]-v;break;case"Home":a["lower"===t?0:1]=h;break;case"End":a["lower"===t?0:1]=f;break;default:return}e.preventDefault(),"lower"===t?a[0]=Math.min(a[0],w[1]):a[1]=Math.max(a[1],w[0]),a[0]=S(a[0]),a[1]=S(a[1]),A(a)};return t("div",{ref:d,className:`${p}-range-slider`,...m,children:[e(u.div,{className:`${p}-thumb ${p}-thumb-lower`,role:"slider",tabIndex:b?-1:0,"aria-valuemin":h,"aria-valuemax":f,"aria-valuenow":w[0],"aria-orientation":g,"aria-label":n?`${n} minimum`:"Minimum value","aria-labelledby":l,"data-state":"lower"===y?"dragging":"lower"===M?"active":"inactive","data-disabled":b,onKeyDown:e=>X(e,"lower"),onFocus:()=>k("lower"),onBlur:()=>k(null),onPointerDown:e=>P(e,"lower"),onPointerMove:e=>R(e,"lower"),onPointerUp:E,style:"vertical"===g?{bottom:`calc(${N}% - 8px)`}:{left:`calc(${N}% - 8px)`}}),e(u.div,{className:`${p}-thumb ${p}-thumb-upper`,role:"slider",tabIndex:b?-1:0,"aria-valuemin":h,"aria-valuemax":f,"aria-valuenow":w[1],"aria-orientation":g,"aria-label":n?`${n} maximum`:"Maximum value","aria-labelledby":l,"data-state":"upper"===y?"dragging":"upper"===M?"active":"inactive","data-disabled":b,onKeyDown:e=>X(e,"upper"),onFocus:()=>k("upper"),onBlur:()=>k(null),onPointerDown:e=>P(e,"upper"),onPointerMove:e=>R(e,"upper"),onPointerUp:E,style:"vertical"===g?{bottom:`calc(${D}% - 8px)`}:{left:`calc(${D}% - 8px)`}}),e("div",{className:`${p}-range-fill`,style:"vertical"===g?{bottom:`${Math.min(N,D)}%`,height:`${Math.abs(D-N)}%`,left:0,right:0}:{left:`${Math.min(N,D)}%`,width:`${Math.abs(D-N)}%`,top:0,bottom:0}}),a]})}));b.displayName="SliderRangeSlider";const g=l(((t,a)=>{const{defaultValue:r,min:n=0,max:l=100,step:o=1,orientation:i="horizontal",formatValue:s,"aria-label":u,"aria-labelledby":c,...m}=t;return e(g.Root,{ref:a,defaultValue:r,min:n,max:l,step:o,orientation:i,formatValue:s,...m,children:e(g.Track,{children:e(g.Range,{children:e(g.Thumb,{"aria-label":u,"aria-labelledby":c})})})})}));g.displayName="Slider",g.Root=d,g.Track=p,g.Range=f,g.Thumb=h,g.Marks=v,g.RangeSlider=b;export{g as default};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
|
|
3
|
+
type SpinnerProps = {
|
|
4
|
+
customRootClass?: string;
|
|
5
|
+
size?: string;
|
|
6
|
+
} & ComponentPropsWithoutRef<'span'>;
|
|
7
|
+
declare const Spinner: React.ForwardRefExoticComponent<{
|
|
8
|
+
customRootClass?: string;
|
|
9
|
+
size?: string;
|
|
10
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
11
|
+
|
|
12
|
+
export { Spinner as default };
|
|
13
|
+
export type { SpinnerProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{jsx as s}from"react/jsx-runtime";import r from"react";import{c as a}from"./index-6If6D2Zi.js";import{c as e}from"./index-3dZuI04X.js";import{c as o}from"./clsx-BaVHROc5.js";const i="Spinner",m=r.forwardRef((({className:r,customRootClass:m="",size:t="",...c},n)=>{const p=a(m,i),d=e("spinner",{size:t});return s("div",{className:`${p}-container`,children:s("span",{className:o(p,r),...c,...d})})}));m.displayName=i;export{m as default};
|
|
@@ -54,4 +54,4 @@ type SplitterComponent = React.ForwardRefExoticComponent<SplitterProps & React.R
|
|
|
54
54
|
declare const Splitter: SplitterComponent;
|
|
55
55
|
|
|
56
56
|
export { Splitter as default };
|
|
57
|
-
export type { SplitterProps };
|
|
57
|
+
export type { SplitterHandleProps, SplitterPanelProps, SplitterProps, SplitterRootProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
1
|
+
'use client';import{jsx as e}from"react/jsx-runtime";import t,{createContext as n,useRef as r,useState as i,useCallback as o,useMemo as a,useEffect as s}from"react";import{c as l}from"./index-6If6D2Zi.js";import{c}from"./clsx-BaVHROc5.js";const m=n(null),u=()=>{const e=t.useContext(m);if(!e)throw new Error("Splitter components must be used within a Splitter.Root");return e},d=t.forwardRef((({orientation:t="horizontal",children:n,className:u,customRootClass:d="",defaultSizes:h=[50,50],minSizes:f=[0,0],maxSizes:p=[100,100],onSizesChange:v,style:x,...S},w)=>{const y=l(d,"Splitter"),M=r(null),[z,g]=i(h),[D,N]=i(!1),[R,E]=i(null),[L,A]=i(null),b=o((e=>{M.current=e,"function"==typeof w?w(e):w&&(w.current=e)}),[w]),C=a((()=>({minSizes:f||[],maxSizes:p||[]})),[f,p]),H=r(null);s((()=>()=>{H.current&&(clearTimeout(H.current),H.current=null)}),[]);const X=r(z),Y=r(C);X.current=z,Y.current=C;const k="horizontal"===t,P=o(((e,t=!1)=>{g(e),H.current&&clearTimeout(H.current),v&&(t?v(e):H.current=setTimeout((()=>{v(e)}),16))}),[v]),K=o(((e,t)=>{t.preventDefault();const n=k?"clientX"in t?t.clientX:t.touches[0].clientX:"clientY"in t?t.clientY:t.touches[0].clientY,r=[...X.current];A({position:n,sizes:r}),N(!0),E(e);let i=null,o=0;const a=t=>{if(!M.current)return;const a=Date.now();a-o<16||(i&&cancelAnimationFrame(i),i=requestAnimationFrame((()=>{const i=((k?"clientX"in t?t.clientX:t.touches[0].clientX:"clientY"in t?t.clientY:t.touches[0].clientY)-n)/(k?M.current.offsetWidth:M.current.offsetHeight)*100,s=[...r],{minSizes:l,maxSizes:c}=Y.current,m=e,u=e+1;s.length;const d=s[m],h=s[u],f=Math.max(l[m]||0,Math.min(c[m]||100,d+i)),p=Math.max(l[u]||0,Math.min(c[u]||100,h-i)),v=f+p,x=100-(d+h);if(Math.abs(i)>.1)if(v<=100)s[m]=f,s[u]=p;else{const e=d/(d+h),t=100-x;s[m]=Math.max(l[m]||0,Math.min(c[m]||100,t*e)),s[u]=Math.max(l[u]||0,Math.min(c[u]||100,t*(1-e)))}g(s),o=a})))},s=()=>{i&&cancelAnimationFrame(i),N(!1),E(null),A(null);const e=X.current;v&&v(e),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",s),document.removeEventListener("touchmove",a),document.removeEventListener("touchend",s)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",s),document.addEventListener("touchmove",a),document.addEventListener("touchend",s)}),[k,v]),T=o(((e,t)=>{const n=t.shiftKey?10:1,r=[...X.current],{minSizes:i,maxSizes:o}=Y.current;let a=0;if(k?("ArrowLeft"===t.key&&(a=-n),"ArrowRight"===t.key&&(a=n)):("ArrowUp"===t.key&&(a=-n),"ArrowDown"===t.key&&(a=n)),0!==a){t.preventDefault();const n=e,s=e+1,l=r[n],c=r[s],m=Math.max(i[n]||0,Math.min(o[n]||100,l+a)),u=Math.max(i[s]||0,Math.min(o[s]||100,c-a)),d=m+u,h=100-(l+c);if(Math.abs(a)>.1)if(d<=100)r[n]=m,r[s]=u;else{const e=l/(l+c),t=100-h;r[n]=Math.max(i[n]||0,Math.min(o[n]||100,t*e)),r[s]=Math.max(i[s]||0,Math.min(o[s]||100,t*(1-e)))}P(r,!0)}}),[k,P]),$={orientation:t,sizes:z,setSizes:P,startDrag:K,handleKeyDown:T,isDragging:D,activeHandleIndex:R,rootClass:y};return e(m.Provider,{value:$,children:e("div",{...S,ref:b,className:c(y,u),style:{display:"flex",flexDirection:k?"row":"column",width:"100%",height:"100%",...x},children:n})})}));d.displayName="SplitterRoot";const h=t.forwardRef((({index:t,children:n,className:r,style:i,...o},a)=>{const{sizes:s,orientation:l,rootClass:m}=u(),d={flexBasis:`${s[t]}%`,flexGrow:0,flexShrink:0,overflow:"auto",minWidth:"horizontal"===l?0:void 0,minHeight:"vertical"===l?0:void 0,...i};return e("div",{...o,ref:a,className:c(`${m}-panel`,r),style:d,children:n})}));h.displayName="SplitterPanel";const f=t.forwardRef((({index:t,className:n,"aria-label":r,style:i,...o},a)=>{const{startDrag:s,orientation:l,isDragging:m,activeHandleIndex:d,handleKeyDown:h,rootClass:f}=u();return e("div",{...o,ref:a,className:c(`${f}-handle`,{active:m&&d===t},n),role:"separator","aria-orientation":l,"aria-label":r||`${l} resize handle`,tabIndex:0,onMouseDown:e=>s(t,e),onTouchStart:e=>s(t,e),onKeyDown:e=>h(t,e),style:i})}));f.displayName="SplitterHandle";const p=t.forwardRef(((t,n)=>(console.warn("Direct usage of Splitter is not supported. Please use Splitter.Root, Splitter.Panel, etc. instead."),e("div",{ref:n,...t}))));p.displayName="Splitter",p.Root=d,p.Panel=h,p.Handle=f;export{p as default};
|
|
@@ -1,26 +1,37 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
type StepsRootProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
customRootClass?: string;
|
|
6
|
+
orientation?: 'horizontal' | 'vertical';
|
|
7
|
+
value?: number;
|
|
8
|
+
defaultValue?: number;
|
|
9
|
+
onValueChange?: (value: number) => void;
|
|
10
|
+
};
|
|
11
|
+
declare const StepsRoot: ({ children, className, customRootClass, orientation, value, defaultValue, onValueChange, ...props }: StepsRootProps) => react_jsx_runtime.JSX.Element;
|
|
4
12
|
|
|
5
13
|
type StepItemProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
6
|
-
value?: string | null;
|
|
14
|
+
value?: string | number | null;
|
|
7
15
|
};
|
|
8
|
-
declare const StepItem: ({ children, value, className, ...props }: StepItemProps) =>
|
|
16
|
+
declare const StepItem: ({ children, value, className, ...props }: StepItemProps) => react_jsx_runtime.JSX.Element;
|
|
9
17
|
|
|
10
18
|
type StepTrackProps = React.HTMLAttributes<HTMLDivElement>;
|
|
11
|
-
declare const StepTrack: ({ children, className, ...props }: StepTrackProps) =>
|
|
19
|
+
declare const StepTrack: ({ children, className, ...props }: StepTrackProps) => react_jsx_runtime.JSX.Element;
|
|
12
20
|
|
|
13
|
-
|
|
21
|
+
type StepBubbleProps = React.HTMLAttributes<HTMLDivElement>;
|
|
22
|
+
declare const StepBubble: ({ children, className, ...props }: StepBubbleProps) => react_jsx_runtime.JSX.Element;
|
|
14
23
|
|
|
15
24
|
type StepLineProps = React.HTMLAttributes<HTMLDivElement>;
|
|
16
|
-
declare const StepLine: ({ children, className, ...props }: StepLineProps) =>
|
|
25
|
+
declare const StepLine: ({ children, className, ...props }: StepLineProps) => react_jsx_runtime.JSX.Element;
|
|
17
26
|
|
|
18
|
-
|
|
27
|
+
type StepContentProps = React.HTMLAttributes<HTMLDivElement>;
|
|
28
|
+
declare const StepContent: ({ children, className, ...props }: StepContentProps) => react_jsx_runtime.JSX.Element;
|
|
19
29
|
|
|
20
|
-
|
|
30
|
+
type StepTitleProps = React.HTMLAttributes<HTMLDivElement>;
|
|
31
|
+
declare const StepTitle: ({ children, className, ...props }: StepTitleProps) => react_jsx_runtime.JSX.Element;
|
|
21
32
|
|
|
22
33
|
type StepDescriptionProps = React.HTMLAttributes<HTMLDivElement>;
|
|
23
|
-
declare const StepDescription: ({ children, className, ...props }: StepDescriptionProps) =>
|
|
34
|
+
declare const StepDescription: ({ children, className, ...props }: StepDescriptionProps) => react_jsx_runtime.JSX.Element;
|
|
24
35
|
|
|
25
36
|
declare const StepsComponent: () => null;
|
|
26
37
|
type StepsComponentType = typeof StepsComponent & {
|
|
@@ -36,3 +47,4 @@ type StepsComponentType = typeof StepsComponent & {
|
|
|
36
47
|
declare const Steps: StepsComponentType;
|
|
37
48
|
|
|
38
49
|
export { Steps as default };
|
|
50
|
+
export type { StepBubbleProps, StepContentProps, StepDescriptionProps, StepItemProps, StepLineProps, StepTitleProps, StepTrackProps, StepsRootProps };
|
package/dist/components/Steps.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
1
|
+
'use client';import{jsx as e}from"react/jsx-runtime";import{c as t}from"./clsx-BaVHROc5.js";import{c as s}from"./index-6If6D2Zi.js";import{P as r}from"./index-98jQ1vTr.js";import{createContext as a,useContext as n}from"react";import{u as o}from"./index-wRElCyvx.js";const l=a(null),c=()=>{const e=n(l);if(!e)throw new Error("useStepsContext must be used within a StepsContext.Provider");return e},i=Object.assign((()=>(console.warn("Direct usage of Steps is not supported. Please use Steps.Root, Steps.Item, etc. instead."),null)),{Root:({children:a,className:n,customRootClass:c,orientation:i="horizontal",value:d,defaultValue:m,onValueChange:u,...p})=>{const[h,v]=o(d,m??0,u),N=s(c,"Steps");return e(l.Provider,{value:{currentStep:h,setCurrentStep:v,rootClass:N,orientation:i},children:e(r.div,{className:t(N,n,`${N}-${i}`),"data-orientation":i,...p,children:a})})},Item:({children:s,value:r=0,className:a="",...n})=>{const{rootClass:o,currentStep:l}=c(),i="number"==typeof r&&l>r?"completed":"number"==typeof r&&l===r?"active":"inactive";return e("div",{className:t(`${o}-item`,a),"data-state":i,"data-value":r,...n,children:s})},Track:({children:s,className:r="",...a})=>{const{rootClass:n}=c();return e("div",{className:t(`${n}-track`,r),...a,children:s})},Bubble:({children:s,className:r="",...a})=>{const{rootClass:n}=c();return e("div",{className:t(`${n}-bubble`,r),...a,children:s})},Line:({children:s,className:r="",...a})=>{const{rootClass:n}=c();return e("div",{className:t(`${n}-line`,r),...a,children:s})},Content:({children:s,className:r="",...a})=>{const{rootClass:n}=c();return e("div",{className:t(`${n}-content`,r),...a,children:s})},Title:({children:s,className:r="",...a})=>{const{rootClass:n}=c();return e("div",{className:t(`${n}-title`,r),...a,children:s})},Description:({children:s,className:r="",...a})=>{const{rootClass:n}=c();return e("div",{className:t(`${n}-description`,r),...a,children:s})}});export{i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
1
|
+
'use client';import{jsx as r}from"react/jsx-runtime";import s from"react";import{c as o}from"./clsx-BaVHROc5.js";import{c as t}from"./index-6If6D2Zi.js";const a="Strong",e=s.forwardRef((({children:s,className:e,customRootClass:m,...c},i)=>{const n=t(m,a);return r("strong",{ref:i,className:o(n,e),...c,children:s})}));e.displayName=a;export{e as default};
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { ComponentPropsWithoutRef } from 'react';
|
|
3
|
-
import Primitive from '~/core/primitives/Primitive';
|
|
4
3
|
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
|
-
};
|
|
4
|
+
import Primitive from '~/core/primitives/Primitive';
|
|
11
5
|
|
|
12
6
|
type SwitchRootProps = ComponentPropsWithoutRef<typeof ButtonPrimitive> & {
|
|
13
7
|
children: React__default.ReactNode;
|
|
@@ -25,6 +19,12 @@ type SwitchRootProps = ComponentPropsWithoutRef<typeof ButtonPrimitive> & {
|
|
|
25
19
|
asChild?: boolean;
|
|
26
20
|
};
|
|
27
21
|
|
|
22
|
+
type SwitchThumbProps = ComponentPropsWithoutRef<typeof Primitive.span> & {
|
|
23
|
+
asChild?: boolean;
|
|
24
|
+
className?: string;
|
|
25
|
+
children?: React__default.ReactNode;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
28
|
declare const Switch: {
|
|
29
29
|
(): null;
|
|
30
30
|
Root: React$1.ForwardRefExoticComponent<Omit<{
|
|
@@ -55,3 +55,4 @@ declare namespace SwitchProps {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
export { SwitchProps, Switch as default };
|
|
58
|
+
export type { SwitchRootProps, SwitchThumbProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
1
|
+
'use client';import{jsx as e}from"react/jsx-runtime";import{createContext as a,forwardRef as s,useContext as d}from"react";import{B as i}from"./index-BOy86lYu.js";import{c}from"./index-6If6D2Zi.js";import{c as t,a as r,b as o}from"./index-3dZuI04X.js";import{u as l}from"./index-wRElCyvx.js";import{P as h}from"./index-98jQ1vTr.js";const n=a({checked:!1,setChecked:()=>{},rootClass:"",disabled:!1}),m="Switch",u=s((({children:a,customRootClass:s,color:d="",variant:h,size:u,defaultChecked:k=!1,checked:C,onCheckedChange:p,disabled:f=!1,required:b=!1,name:w,value:v,asChild:x=!1,...j},N)=>{const[S,P]=l(C,k,p),R=c(s,m),T=t("switch",{variant:h,size:u}),g=o(d),q=r(T,g),y={checked:S,setChecked:P,rootClass:R,disabled:f},z={...q,"data-state":S?"checked":"unchecked","data-disabled":f?"":void 0,role:"switch","aria-checked":S,"aria-required":b,disabled:f,...j};return w&&(z.name=w),v&&(z.value=v),e(n.Provider,{value:y,children:e(i,{ref:N,onClick:()=>{f||P(!S)},className:R,asChild:x,...z,children:a})})}));u.displayName=m;const k=s((({asChild:a=!1,className:s,children:i,...c},t)=>{const{checked:r,rootClass:o,disabled:l}=d(n),m={};return m["data-state"]=r?"checked":"unchecked",l&&(m["data-disabled"]=""),e(h.span,{ref:t,role:"switch",className:`${o}-indicator ${s||""}`,asChild:a,...m,...c,children:i})}));k.displayName="SwitchThumb";const C=()=>(console.warn("Direct usage of Switch is not supported. Please use Switch.Root, Switch.Thumb, etc. instead."),null);C.Root=u,C.Thumb=k;export{C as default};
|
|
@@ -1,8 +1,25 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
type TabNavRootProps = React__default.ComponentPropsWithoutRef<'div'> & {
|
|
5
|
+
loop?: boolean;
|
|
6
|
+
orientation?: 'horizontal' | 'vertical';
|
|
7
|
+
customRootClass?: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
onValueChange?: (value: string) => void;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type TabNavLinkProps = React__default.ComponentPropsWithoutRef<'a'> & {
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
asChild?: boolean;
|
|
17
|
+
value?: string;
|
|
18
|
+
};
|
|
2
19
|
|
|
3
20
|
declare const TabNav: {
|
|
4
21
|
(): null;
|
|
5
|
-
Root:
|
|
22
|
+
Root: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
6
23
|
loop?: boolean;
|
|
7
24
|
orientation?: "horizontal" | "vertical";
|
|
8
25
|
customRootClass?: string;
|
|
@@ -10,12 +27,13 @@ declare const TabNav: {
|
|
|
10
27
|
value?: string;
|
|
11
28
|
defaultValue?: string;
|
|
12
29
|
onValueChange?: (value: string) => void;
|
|
13
|
-
} &
|
|
14
|
-
Link:
|
|
30
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
31
|
+
Link: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
15
32
|
disabled?: boolean;
|
|
16
33
|
asChild?: boolean;
|
|
17
34
|
value?: string;
|
|
18
|
-
} &
|
|
35
|
+
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
19
36
|
};
|
|
20
37
|
|
|
21
38
|
export { TabNav as default };
|
|
39
|
+
export type { TabNavLinkProps, TabNavRootProps };
|