@radui/ui 0.5.0 → 0.6.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/README.md +2 -0
- package/dist/components/Accordion.d.ts +19 -33
- package/dist/components/Accordion.js +1 -1
- package/dist/components/AlertDialog.d.ts +2 -0
- package/dist/components/AlertDialog.js +1 -1
- package/dist/components/AspectRatio.d.ts +2 -2
- package/dist/components/AspectRatio.js +1 -1
- package/dist/components/Avatar.js +1 -1
- package/dist/components/AvatarGroup.js +1 -1
- package/dist/components/{AvatarPrimitiveFallback-BOYawMc9.js → AvatarPrimitiveFallback-B1u295x6.js} +1 -1
- package/dist/components/Breadcrumb.d.ts +70 -0
- package/dist/components/Breadcrumb.js +1 -0
- package/dist/components/Button.js +1 -1
- package/dist/components/Callout.js +1 -1
- package/dist/components/Checkbox.js +1 -1
- package/dist/components/CheckboxCards.js +1 -1
- package/dist/components/CheckboxGroup.js +1 -1
- package/dist/components/{CheckboxGroupPrimitive-Cd8ra39e.js → CheckboxGroupPrimitive-BWGRST9p.js} +1 -1
- package/dist/components/Code.js +1 -1
- package/dist/components/Collapsible.js +1 -1
- package/dist/components/Combobox.js +1 -1
- package/dist/components/ComboboxPrimitive-C2sksm48.js +1 -0
- package/dist/components/Command.d.ts +1 -0
- package/dist/components/Command.js +1 -1
- package/dist/components/ContextMenu.d.ts +6 -6
- package/dist/components/ContextMenu.js +1 -1
- package/dist/components/Dialog.d.ts +1 -0
- package/dist/components/Dialog.js +1 -1
- package/dist/components/Disclosure.d.ts +2 -0
- package/dist/components/Disclosure.js +1 -1
- package/dist/components/Drawer.d.ts +94 -16
- package/dist/components/Drawer.js +1 -1
- package/dist/components/DropdownMenu.d.ts +6 -6
- package/dist/components/DropdownMenu.js +1 -1
- package/dist/components/Fieldset.d.ts +43 -0
- package/dist/components/Fieldset.js +1 -0
- package/dist/components/HoverCard.js +1 -1
- package/dist/components/Link.js +1 -1
- package/dist/components/LiveRegion.d.ts +73 -0
- package/dist/components/LiveRegion.js +1 -0
- package/dist/components/MenuPrimitive-COEgTo6S.js +1 -0
- package/dist/components/Menubar.d.ts +6 -6
- package/dist/components/Menubar.js +1 -1
- package/dist/components/Minimap.js +1 -1
- package/dist/components/NavigationMenu.d.ts +3 -0
- package/dist/components/NavigationMenu.js +1 -1
- package/dist/components/NumberField.js +1 -1
- package/dist/components/Popover.d.ts +68 -0
- package/dist/components/Popover.js +1 -0
- 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.js +1 -1
- package/dist/components/RadioGroup.js +1 -1
- package/dist/components/{RadioGroupPrimitive-CcvI-_wm.js → RadioGroupPrimitive-BWUU-0Qh.js} +1 -1
- package/dist/components/ScrollArea.d.ts +15 -3
- package/dist/components/ScrollArea.js +1 -1
- package/dist/components/Select.js +1 -1
- package/dist/components/Separator.js +1 -1
- package/dist/components/Slider.d.ts +1 -1
- package/dist/components/Slider.js +1 -1
- package/dist/components/Spinner.js +1 -1
- package/dist/components/Splitter.js +1 -1
- package/dist/components/Steps.js +1 -1
- package/dist/components/Switch.js +1 -1
- package/dist/components/TabNav.js +1 -1
- package/dist/components/Table.d.ts +65 -19
- package/dist/components/Table.js +1 -1
- package/dist/components/Tabs.d.ts +2 -0
- package/dist/components/Tabs.js +1 -1
- package/dist/components/TextArea.js +1 -1
- package/dist/components/TextField.js +1 -1
- package/dist/components/Toast.d.ts +322 -0
- package/dist/components/Toast.js +1 -0
- package/dist/components/Toggle.js +1 -1
- package/dist/components/ToggleGroup.js +1 -1
- package/dist/components/Toolbar.js +1 -1
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/Tree.d.ts +1 -0
- package/dist/components/Tree.js +1 -1
- package/dist/components/VisuallyHidden.js +1 -1
- package/dist/components/documentOverlayOpen-coyGmcyL.js +1 -0
- package/dist/components/index-C09ZQH_q.js +1 -0
- package/dist/components/index-CD_nZA9X.js +1 -0
- package/dist/components/{index-gM8bbyw1.js → index-CfC8-kd8.js} +1 -1
- package/dist/components/index-UODM4mVT.js +1 -0
- package/dist/components/index-XF8itt-H.js +1 -0
- package/dist/components/index-YhJvxumL.js +1 -0
- package/dist/components/index-m8Mhi26u.js +1 -0
- package/dist/components/keyboard-BKF7hXqL.js +1 -0
- package/dist/components/mergeProps-0RucjqeH.js +1 -0
- package/dist/themes/baremetal.css +1 -0
- package/dist/themes/default.css +1 -0
- package/dist/themes/tailwind-presets/default.css +396 -0
- package/package.json +65 -23
- package/dist/components/ComboboxPrimitive-BhHSrtiY.js +0 -1
- package/dist/components/MenuPrimitive-wJbEC-gM.js +0 -1
- package/dist/components/index-BbEsAodL.js +0 -1
- package/dist/components/index-DOVR6Rd5.js +0 -1
- package/dist/components/index-DU_6Msfu.js +0 -1
- package/dist/components/index-Ir5FYyWW.js +0 -1
- package/dist/components/index-m6qHOeQ9.js +0 -1
- package/dist/components/mergeProps-B9ocQsG4.js +0 -1
- package/dist/themes/tailwind-presets/default.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import
|
|
1
|
+
'use client';import o,{createContext as t,useRef as e,useState as r,useContext as n}from"react";import{jsx as a,jsxs as i}from"react/jsx-runtime";import{D as s,B as l,n as d,o as c,f as p,e as f,g as m,k as u,i as g,m as h,j as w,u as T,H as R,v as x}from"./floating-ui.react-Byzse64h.js";import{B as y}from"./index-CfC8-kd8.js";import{g as j}from"./mergeProps-0RucjqeH.js";import{c as v}from"./clsx-BaVHROc5.js";import{P as C}from"./index-XF8itt-H.js";import{T as N}from"./ThemeContext-Sm-iNANd.js";import"react-dom";const P=t(null),A=o.forwardRef((({children:o,placement:t="top",collisionBoundary:n=null,collisionPadding:i=5,...T},R)=>{const x=e(null),[y,j]=r(!1),v=(Array.isArray(n)?n:[n]).filter((o=>null!=o)),C={padding:i,boundary:v,altBoundary:v.length>0},N=s({placement:t,strategy:"fixed",onOpenChange:j,middleware:[d({element:x,padding:4}),c(5),p({crossAxis:!0,fallbackAxisSideDirection:"start",...C}),f(C)],whileElementsMounted:l}),A=N.context,O=m(A,{move:!1}),b=u(A,{}),B=g(A),D=h(A,{role:"tooltip"}),E=w([O,b,B,D]);return a(P.Provider,{value:{isOpen:y,setIsOpen:j,data:N,interactions:E,context:A,arrowRef:x},children:a("div",{ref:R,"data-slot":"tooltip-root",...T,children:o})})}));A.displayName="Tooltip";const O=o.forwardRef((({children:o,asChild:t,...e},r)=>{const i=n(P);if(!i)throw new Error("TooltipTrigger must be used within a TooltipRoot component");const{isOpen:s,interactions:l,context:d}=i,{getReferenceProps:c}=l,p=j(o),f=T([d.refs.setReference,r,p]);return a(y,{asChild:t,ref:f,"data-slot":"tooltip-trigger","data-state":s?"open":"closed",...c(e),children:o})}));O.displayName="TooltipTrigger";const b=o.forwardRef((({children:o,showArrow:t=!0,container:e,...r},s)=>{const l=n(P),d=n(N);if(!l)throw new Error("TooltipContent must be used within a TooltipRoot component");const{isOpen:c,data:p,interactions:f,context:m}=l,u=l.arrowRef,g=T([m.refs.setFloating,s]);if(!c)return null;const{getFloatingProps:h}=f,w=e??d?.portalRootRef.current??d?.containerRef.current??void 0;return a(R,{root:w,children:a(C.div,{className:"rad-ui-tooltip-floating-element",ref:g,"data-slot":"tooltip-content","data-state":c?"open":"closed",style:{...p.floatingStyles},...h(r),children:i("div",{className:"rad-ui-tooltip-content-inner",children:[t&&a(x,{className:v("rad-ui-arrow"),ref:u,context:m,"data-slot":"tooltip-arrow"}),o]})})})}));b.displayName="TooltipContent";const B=o.forwardRef(((o,t)=>(console.warn("Direct usage of Tooltip is not supported. Please use Tooltip.Root, Tooltip.Trigger, etc. instead."),null)));B.displayName="Tooltip",B.Root=A,B.Trigger=O,B.Content=b;export{B as default};
|
|
@@ -6,6 +6,7 @@ type TreeRootProps = {
|
|
|
6
6
|
customRootClass?: string;
|
|
7
7
|
'aria-label'?: string;
|
|
8
8
|
'aria-labelledby'?: string;
|
|
9
|
+
loop?: boolean;
|
|
9
10
|
} & ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
10
11
|
declare const TreeRoot: React.ForwardRefExoticComponent<TreeRootProps & React.RefAttributes<HTMLElement>>;
|
|
11
12
|
|
package/dist/components/Tree.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{createContext as
|
|
1
|
+
'use client';import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{createContext as o,forwardRef as n,useRef as a,useImperativeHandle as l,useCallback as s,useId as i,useState as d,useContext as c,useEffect as m}from"react";import{R as u}from"./index-m8Mhi26u.js";import{P as p}from"./index-XF8itt-H.js";import{u as f}from"./useComponentClass-QwNivz0h.js";import{c as h}from"./clsx-BaVHROc5.js";import{B as g}from"./index-CfC8-kd8.js";import{K as R}from"./keyboard-BKF7hXqL.js";import"./mergeRefs-B8eZ_q-T.js";import"./mergeProps-0RucjqeH.js";import"./ThemeContext-Sm-iNANd.js";const v=o({rootClass:"",treeRef:{current:null},itemRefs:new Map,registerItemRef:()=>{},unregisterItemRef:()=>{}}),b="Tree",I=n((({children:r,className:t="",customRootClass:o="","aria-label":n,"aria-labelledby":i,loop:d=!0,...c},m)=>{const g=a(null);l(m,(()=>g.current));const R=f(o,b),I=a(new Map),y=s(((e,r)=>{I.current.set(e,r)}),[]),w=s((e=>{I.current.delete(e)}),[]),C={rootClass:R,treeRef:g,itemRefs:I.current,registerItemRef:y,unregisterItemRef:w};return e(v.Provider,{value:C,children:e(u.Root,{orientation:"vertical",mode:"tree",loop:d,children:e(u.Group,{children:e(p.div,{className:h(R,t),ref:g,role:"tree","aria-label":n,"aria-labelledby":i,...c,children:r})})})})}));I.displayName=b;const y=n((({children:o,item:n,level:s=0,className:p="",parentId:f=null,isSelected:b=!1,onToggleSelect:I,getIsSelected:w,onChildRefReady:C,...j},x)=>{const N=i(),T=a(null);l(x,(()=>T.current));const k=Boolean(n?.items?.length),[S,D]=d((()=>Boolean(n?.expanded))),{rootClass:L,itemRefs:P,registerItemRef:B,unregisterItemRef:K}=c(v),$=a(null);m((()=>(B(N,T),()=>{K(N)})),[N,B,K]),m((()=>{C&&T.current&&C(T)}),[C]);const M=e=>{$.current=e.current};return r(t,{children:[e(u.Item,{handleRightKeyDown:()=>{k&&(S?$.current?.focus():D(!0))},handleLeftKeyDown:()=>{if(S)return void D(!1);if(!f)return;const e=P.get(f);e?.current&&e.current.focus(),D(!1)},role:"treeitem",children:r(g,{ref:T,className:h(L&&`${L}-item`,p),onClick:()=>{I&&I(N,n),k&&D((e=>!e))},onKeyDownCapture:e=>{e.key===R.ENTER&&(I&&I(N,n),e.preventDefault(),e.stopPropagation())},type:"button","data-selected":b,"aria-selected":b,"aria-expanded":k?S:void 0,"data-toggled":S,"data-has-children":k,"data-id":N,"data-parent-id":f,"data-level":s,...j,children:[e("span",{className:L?`${L}-item-chevron`:void 0,"aria-hidden":!0,children:k?e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:"false",children:e("path",{d:"M4.5 2.5L7.5 6L4.5 9.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}):null}),e("span",{className:L?`${L}-item-label`:void 0,children:o})]})}),S&&n.items&&e("div",{className:L?`${L}-branch`:void 0,role:"group",children:n.items.map(((r,t)=>{const o=s+1,n=!!w&&w(r);return e(y,{parentId:N,level:o,item:r,isSelected:n,onToggleSelect:I,getIsSelected:w,onChildRefReady:0===t?M:void 0,children:r.label},r.label)}))})]})}));y.displayName="TreeItem";const w=n((({children:r,...t},o)=>(console.warn("Direct usage of Tree is not supported. Please use Tree.Root and Tree.Item instead."),e("div",{ref:o,...t,children:r}))));w.displayName="Tree",w.Root=I,w.Item=y;export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{jsx as e}from"react/jsx-runtime";import{forwardRef as s}from"react";import{P as t}from"./index-
|
|
1
|
+
'use client';import{jsx as e}from"react/jsx-runtime";import{forwardRef as s}from"react";import{P as t}from"./index-XF8itt-H.js";import{u as o}from"./useComponentClass-QwNivz0h.js";import{c as r}from"./clsx-BaVHROc5.js";import"./mergeProps-0RucjqeH.js";import"./ThemeContext-Sm-iNANd.js";const i="VisuallyHidden",a={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",whiteSpace:"nowrap",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",pointerEvents:"none",userSelect:"none"},n=s((({children:s,customRootClass:n,className:m,style:p={},...l},c)=>{const d=o(n,i);return e(t.div,{ref:c,className:r(d,m),style:{...a,...p},...l,children:s})}));n.displayName=i;export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';const e="data-rad-ui-overlay-open";let t=0;const n=new Set;function o(){n.forEach((e=>e()))}function u(){if("undefined"==typeof document)return;const n=document.documentElement;t>0?n.setAttribute(e,""):n.removeAttribute(e)}function d(){return"undefined"!=typeof document&&(t>0||document.documentElement.hasAttribute(e)||"undefined"!=typeof document&&"hidden"===document.body.style.overflow)}function r(){t+=1,u(),o();let e=!1;return()=>{e||(e=!0,t=Math.max(0,t-1),u(),o())}}function c(e){return n.add(e),()=>{n.delete(e)}}export{e as D,d as i,r,c as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{jsx as e}from"react/jsx-runtime";import{forwardRef as a,useState as r}from"react";import{B as i}from"./index-CfC8-kd8.js";import{c as s}from"./index-CXzybYmm.js";import{i as o}from"./keyboard-BKF7hXqL.js";const d=a((({children:a,label:d="",defaultPressed:t=!1,pressed:l,onPressedChange:n=()=>{},disabled:f,asChild:m=!1,...c},p)=>{const[b,u]=r(t),h=void 0!==l,j=h?l:b,y=()=>{if(f)return;const e=!j;h||u(e),n(e)},C=d?{"aria-label":d}:{};return C["aria-pressed"]=j?"true":"false",C["aria-disabled"]=f?"true":"false",e(i,{ref:p,onClick:s(c.onClick,y),onKeyDown:s(c.onKeyDown,(e=>{o(e.key)&&(e.preventDefault(),y())})),"data-state":j?"on":"off","data-disabled":f?"":void 0,disabled:f,asChild:m,...C,...c,children:a})}));d.displayName="TogglePrimitive";export{d as T};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{jsx as e,Fragment as n}from"react/jsx-runtime";import r,{createContext as t,forwardRef as i,useContext as o,useRef as l,useState as a,useEffect as s}from"react";import{F as c}from"./index-Db-tduwt.js";import{u as d}from"./index-wRElCyvx.js";import{u}from"./index-UODM4mVT.js";import{B as f}from"./index-CfC8-kd8.js";import{P as m}from"./index-XF8itt-H.js";import{T as p}from"./ThemeContext-Sm-iNANd.js";const g=t({isOpen:!1,handleOpenChange:()=>{},handleOverlayClick:()=>{},getItemProps:(e={})=>e,getReferenceProps:(e={})=>e,getFloatingProps:(e={})=>e,refs:{setReference:()=>{},setFloating:()=>{},reference:{current:null},floating:{current:null}},floatingStyles:{position:"absolute"}}),h="DialogPrimitive",C=i((({children:n,open:r,defaultOpen:t=!1,onOpenChange:i,onClickOutside:o=()=>{},className:l,disablePointerDismissal:a=!1,...s},f)=>{const[m,p]=d(r,t,i),h=c.useFloatingNodeId();u(m);const C=e=>{p(e)},{context:P,refs:v,floatingStyles:y}=c.useFloating({open:m,nodeId:h,onOpenChange:C}),F=c.useDismiss(P,{bubbles:!1,escapeKey:!a,outsidePress:!a}),b=c.useRole(P,{role:"dialog"}),{getReferenceProps:O,getFloatingProps:k,getItemProps:N}=c.useInteractions([F,b]),R={isOpen:m,handleOpenChange:C,floaterContext:P,handleOverlayClick:()=>{a||(o(),C(!1))},getReferenceProps:O,getFloatingProps:k,getItemProps:N,refs:v,floatingStyles:y};return e(g.Provider,{value:R,children:e(c.FloatingNode,{id:h,children:e("div",{ref:f,"data-state":m?"open":"closed",...s,className:l,children:n})})})}));C.displayName=`${h}Inner`;const P=i((({disablePointerDismissal:n=!1,...r},t)=>c.useFloatingTree()?e(C,{ref:t,disablePointerDismissal:n,...r}):e(c.FloatingTree,{children:e(C,{ref:t,disablePointerDismissal:n,...r})})));P.displayName=h;const v=i((({children:n,asChild:r,onClick:t,...i},l)=>{const{handleOpenChange:a,getItemProps:s}=o(g);return e(f,{ref:l,asChild:r,...s({...i,onClick:e=>{t?.(e),a(!1)}}),children:n})}));v.displayName="DialogPrimitiveAction";const y=i((({children:n,asChild:r,onClick:t,...i},l)=>{const{handleOpenChange:a,getItemProps:s}=o(g);return e(f,{ref:l,asChild:r,...s({...i,onClick:e=>{t?.(e),a(!1)}}),children:n})}));y.displayName="DialogPrimitiveCancel";const F=i((({children:t,asChild:i=!1,forceMount:l=!1,initialFocus:a=!0,finalFocus:s=!0,trapFocus:d=!0,role:u="dialog","aria-modal":f=!0,"aria-labelledby":p,"aria-describedby":h,style:C,...P},v)=>{const{isOpen:y,getFloatingProps:F,refs:b,floaterContext:O}=o(g),k=r.useRef(null),N=b.reference?.current,R=c.useMergeRefs([b.setFloating,v]),x=y||l,D=y?"open":"closed";r.useEffect((()=>{if(y)return void(k.current=document.activeElement instanceof HTMLElement?document.activeElement:null);const e=(()=>{if(!1===s)return null;if(!0===s)return N instanceof HTMLElement?N:k.current;if("current"in s)return s.current;const e=s();return!0===e?N instanceof HTMLElement?N:k.current:e instanceof HTMLElement?e:null})();e&&requestAnimationFrame((()=>{e.focus()}))}),[s,y,N]);const M=r.useMemo((()=>{if(!1===a)return-1;if(!0===a)return 0;if("current"in a)return a;const e=a();return!1===e||void 0===e?-1:!0===e?0:e}),[a]),T=P.style,I={...P};delete I.style;const j=e(m.div,{ref:R,asChild:i,...F({...I,style:{outline:"none",...C,...T},role:u,"aria-hidden":y?void 0:"true","aria-labelledby":y?p:void 0,"aria-describedby":y?h:void 0,"data-state":D,"aria-modal":f}),children:t});return e(n,{children:x&&(y?e(c.FocusManager,{context:O,modal:d,initialFocus:M,returnFocus:!1!==s,children:j}):j)})}));F.displayName="DialogPrimitiveContent";const b=i((({children:n,asChild:r,className:t="",disabled:i=!1,...l},a)=>{const{isOpen:s,handleOpenChange:d,getReferenceProps:u,refs:m}=o(g),{onClick:p,...h}=l,C=c.useMergeRefs([m.setReference,a]);return e(f,{ref:C,asChild:r,className:t,...u({...h,disabled:i,"aria-expanded":s,"data-state":s?"open":"closed","data-disabled":i?"":void 0,onClick(e){i||(p?.(e),e.defaultPrevented||d(!0))}}),children:n})}));b.displayName="DialogPrimitiveTrigger";const O=i((({asChild:r=!1,forceMount:t=!1,children:i,onClick:l,...a},s)=>{const{isOpen:d,handleOverlayClick:u}=o(g),f=d?"open":"closed";return e(n,{children:(d||t)&&e(c.Overlay,{ref:s,lockScroll:d,onClick:e=>{l?.(e),e.defaultPrevented||u()},"data-state":f,...a,children:i})})}));O.displayName="DialogPrimitiveOverlay";const k=i((({children:n,asChild:r=!1,...t},i)=>e(m.div,{ref:i,asChild:r,...t,children:n})));k.displayName="DialogPrimitiveFooter";const N={Root:P,Action:v,Cancel:y,Footer:k,Content:F,Trigger:b,Overlay:O,Portal:({children:n,container:r,forceMount:t=!1,keepMounted:i=!1,...d})=>{const u=o(p),f=l(null),[m,g]=a(!1);return s((()=>{f.current=r||(u?.portalRootRef.current??u?.containerRef.current??document.body),g(!0)}),[r,u]),m?e(c.Portal,{root:f.current,...d,children:n}):null}};export{N as D,g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{jsx as i}from"react/jsx-runtime";import{forwardRef as t}from"react";import{P as e}from"./index-
|
|
1
|
+
'use client';import{jsx as i}from"react/jsx-runtime";import{forwardRef as t}from"react";import{P as e}from"./index-XF8itt-H.js";const r=t((({role:t="button",type:r="button",label:a="",description:o="",disabled:d=!1,children:l,...n},s)=>(a&&(n["aria-label"]=a),o&&(n["aria-description"]=o),d&&(n["aria-disabled"]="true",o||(n["aria-description"]="Disabled Button")),i(e.button,{ref:s,role:t,type:r,disabled:d,...n,children:l}))));r.displayName="ButtonPrimitive";export{r as B};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{useLayoutEffect as o}from"react";import{r as t}from"./documentOverlayOpen-coyGmcyL.js";const r=globalThis.document?o:()=>{};function e(o){r((()=>{if(o)return t()}),[o])}export{e as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import e from"react";import{g as r,c as t,m as n}from"./mergeProps-0RucjqeH.js";const i=["div","span","button","input","a","img","p","h2","label"].reduce(((i,a)=>(i[a]=(i=>{const a=e.forwardRef(((a,l)=>{const{asChild:o=!1,children:s,...m}=a;if(o){if(e.isValidElement(s)&&s.type===e.Fragment)return console.warn(`Primitive.${i}: asChild prop does not support React.Fragment. Please provide a single element.`),e.createElement(i,{...m,ref:l},s);const a=e.Children.toArray(s);if(1!==a.length||!e.isValidElement(a[0]))return console.warn(`Primitive.${i}: asChild prop requires exactly one valid child element.`),e.createElement(i,{...m,ref:l},s);const o=a[0],c=r(o),p=t(l,c),d=n(m,o.props);return e.cloneElement(o,{...d,...p?{ref:p}:{}})}return e.createElement(i,{...m,ref:l},s)}));return a.displayName=`Primitive.${i}`,a})(a),i)),{});export{i as P};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{jsx as t}from"react/jsx-runtime";import e,{createContext as n,useContext as r,useId as i,useState as o,useEffect as a,useRef as s,useLayoutEffect as c}from"react";import{P as d}from"./index-XF8itt-H.js";import{u as l}from"./index-wRElCyvx.js";import{c as u}from"./mergeProps-0RucjqeH.js";import{B as m}from"./index-CfC8-kd8.js";import{K as p}from"./keyboard-BKF7hXqL.js";const h=n(void 0),v=()=>{const t=r(h);if(!t)throw new Error("Collapsible compound components must be used within a CollapsiblePrimitive.Root component");return t},f=e.forwardRef((({children:e,defaultOpen:n=!1,open:r,onOpenChange:o,disabled:a=!1,transitionDuration:s,transitionTimingFunction:c="linear",...u},m)=>{const p=i(),[v,f]=l(r,n,o);return t(h.Provider,{value:{open:v,onOpenChange:t=>{a||f(t)},disabled:a,contentId:p,transitionDuration:s,transitionTimingFunction:c},children:t(d.div,{...u,ref:m,"data-state":v?"open":"closed","data-disabled":a?"":void 0,children:e})})}));f.displayName="CollapsiblePrimitiveRoot";const g=e.forwardRef((({children:n,className:r,asChild:i=!1,forceMount:l=!1,style:m,...p},h)=>{const{open:f,contentId:g,transitionDuration:y,transitionTimingFunction:C}=v(),b=function(){const[t,e]=o(!1);return a((()=>{if("undefined"==typeof window||"function"!=typeof window.matchMedia)return;const t=window.matchMedia("(prefers-reduced-motion: reduce)"),n=t=>{e(t.matches)};return n(t),"function"==typeof t.addEventListener?(t.addEventListener("change",n),()=>t.removeEventListener("change",n)):(t.addListener(n),()=>t.removeListener(n))}),[]),t}(),w=void 0!==y?y:b?0:300,[P,F]=o(f?void 0:0),[x,T]=o(f||l),[,D]=o(0),A=s(),R=s(),E=s(null),$=s(0),j=s(0),q=s(),L=s(f||l);a((()=>{const t=requestAnimationFrame((()=>{L.current=!1}));return()=>cancelAnimationFrame(t)}),[]),c((()=>{A.current&&clearTimeout(A.current),R.current&&cancelAnimationFrame(R.current);const t=E.current;if(!t)return;q.current=q.current||{transitionDuration:t.style.transitionDuration,transitionProperty:t.style.transitionProperty,transitionTimingFunction:t.style.transitionTimingFunction},t.style.transitionDuration="0s",t.style.transitionProperty="none";const e=t.getBoundingClientRect(),n=e.height||t.scrollHeight,r=e.width||t.scrollWidth;return $.current=n,j.current=r,L.current||(t.style.transitionDuration=q.current.transitionDuration,t.style.transitionProperty=q.current.transitionProperty,t.style.transitionTimingFunction=q.current.transitionTimingFunction),0===w?(F(f?void 0:0),T(!(!f&&!l)),void(f&&D((t=>t+1)))):L.current&&f?(T(!0),void F(void 0)):(f?(T(!0),F(0),R.current=requestAnimationFrame((()=>{E.current,R.current=requestAnimationFrame((()=>{E.current&&F($.current??E.current.scrollHeight)}))})),A.current=setTimeout((()=>{F(void 0)}),w)):(F($.current??t.scrollHeight),R.current=requestAnimationFrame((()=>{E.current,R.current=requestAnimationFrame((()=>{F(0)}))})),A.current=setTimeout((()=>{l||T(!1)}),w)),()=>{A.current&&clearTimeout(A.current),R.current&&cancelAnimationFrame(R.current)})}),[f,w,l,n]);if(!(f||x||l))return null;const N={...m,overflow:"hidden",height:void 0!==P?`${P}px`:void 0,"--radix-collapsible-content-height":void 0!==$.current?`${$.current}px`:void 0,"--radix-collapsible-content-width":void 0!==j.current?`${j.current}px`:void 0,"--rad-collapsible-content-height":void 0!==$.current?`${$.current}px`:void 0,"--rad-collapsible-content-width":void 0!==j.current?`${j.current}px`:void 0,...w>0?{transition:`height ${w}ms ${C}`}:{}},k=i&&e.isValidElement(n);return t(d.div,{id:g,ref:u(h,E),"aria-hidden":!f,"data-state":f?"open":"closed",className:r,style:N,asChild:k,...p,children:n})}));g.displayName="CollapsiblePrimitiveContent";const y=e.forwardRef((({children:e,asChild:n=!1,...r},i)=>{const{open:o,onOpenChange:a,disabled:s,contentId:c}=v();return t(m,{...r,"aria-controls":c,"aria-expanded":o,"data-state":o?"open":"closed","data-disabled":s?"true":void 0,ref:i,onClick:t=>{r.onClick?.(t),s||a(!o)},onKeyDown:t=>{r.onKeyDown?.(t),t.defaultPrevented||t.key===p.ESCAPE&&o&&!s&&a(!1)},asChild:n,children:e})}));y.displayName="CollapsiblePrimitiveTrigger";const C=()=>(console.warn("Direct usage of CollapsiblePrimitive is not supported. Please use CollapsiblePrimitive.Root, CollapsiblePrimitive.Content, etc. instead."),null);C.Root=f,C.Content=g,C.Trigger=y;export{C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{jsx as e}from"react/jsx-runtime";import t,{createContext as r,useRef as n,useState as l,useId as a,useEffect as o,forwardRef as i,useContext as s}from"react";import{P as d}from"./index-XF8itt-H.js";import{B as u}from"./index-CfC8-kd8.js";import{K as c}from"./keyboard-BKF7hXqL.js";import{m as f}from"./mergeRefs-B8eZ_q-T.js";const b=r({orientation:"horizontal",loop:!0,dir:"ltr",disableTabIndexing:!1,mode:"default"}),m=t.forwardRef((({children:t,orientation:r="horizontal",loop:n=!0,"aria-label":l,"aria-labelledby":a,disableTabIndexing:o=!1,mode:i="default",dir:s="ltr",asChild:u=!1,...c},f)=>{const m={orientation:r,loop:n,disableTabIndexing:o,dir:s,mode:i};return e(b.Provider,{value:m,children:e(d.div,{"aria-orientation":"both"===r?void 0:r,"aria-label":l,"aria-labelledby":a,ref:f,asChild:u,...c,children:t})})}));m.displayName="RovingFocusRoot";const h=r({focusedItemId:null,setFocusedItemId:()=>{},focusItems:[],setFocusItems:()=>{},addFocusItem:()=>{},groupRef:null,itemRefs:new Map,registerItemRef:()=>{},unregisterItemRef:()=>{}}),I=i((({children:r,"aria-label":l,"aria-labelledby":i,role:d,type:m,handleRightKeyDown:I,handleLeftKeyDown:p,domId:g,...R},y)=>{const v=a(),O=g??v,D=n(null),{focusedItemId:C,setFocusedItemId:F,addFocusItem:N,focusItems:k,itemRefs:x,registerItemRef:T,unregisterItemRef:w}=s(h),{orientation:A,loop:P,disableTabIndexing:_,dir:E}=s(b),W=t.Children.toArray(r)[0],j=!0===W?.props?.disabled,L="a"===("string"==typeof W?.type?W.type.toLowerCase():"")||null!=W?.props?.href,M=d??(L?void 0:"button"),z=m??(L?void 0:"button"),G=C===O,K=_||!j&&G?0:-1;o((()=>(T(O,D),N(O),()=>{w(O)})),[O]);const U=e=>{F(e);const t=x.get(e);t?.current&&t.current.focus()},B=(e,t)=>{let r=e;for(let e=0;e<k.length;e++){if(r+=t,P)r<0&&(r=k.length-1),r>=k.length&&(r=0);else if(r<0||r>=k.length)return-1;const e=k[r],n=x.get(e);if(!n?.current)continue;if(!("true"===n.current.getAttribute("data-child-disabled")))return r}return-1},H=()=>{const e=k.indexOf(O),t=B(e,-1);-1!==t&&U(k[t])},S=()=>{const e=k.indexOf(O),t=B(e,1);-1!==t&&U(k[t])};return e(u,{asChild:!0,onFocus:e=>{j&&e.target.blur(),j||F(O)},tabIndex:K,ref:f(D,y),id:O,onKeyDown:e=>{if(!j)switch(e.key){case c.ARROW_UP:e.preventDefault(),"vertical"!==A&&"both"!==A||H();break;case c.ARROW_LEFT:e.preventDefault(),p&&p(),"horizontal"!==A&&"both"!==A||("rtl"===E?S():H());break;case c.ARROW_DOWN:e.preventDefault(),"vertical"!==A&&"both"!==A||S();break;case c.ARROW_RIGHT:e.preventDefault(),I&&I(),"horizontal"!==A&&"both"!==A||("rtl"===E?H():S());break;case c.HOME:e.preventDefault(),(()=>{if(k.length>0){const e=B(-1,1);-1!==e&&U(k[e])}})();break;case c.END:e.preventDefault(),(()=>{if(k.length>0){const e=B(k.length,-1);-1!==e&&U(k[e])}})();case c.TAB:}},"data-child-disabled":j,role:M,type:z,"aria-selected":G,"aria-disabled":j,"aria-label":l,"aria-labelledby":i,...R,children:r})}));I.displayName="RovingFocusItem";const p={Root:m,Group:({children:r,"aria-label":i,"aria-labelledby":s,...u})=>{const c=n(null),[f,b]=l([]),[m,I]=l(null),p=a(),g=n(new Map),R=t.useCallback((e=>e.find((e=>{const t=g.current.get(e);return"true"!==t?.current?.getAttribute("data-child-disabled")}))??null),[]),y=t.useCallback(((e,t)=>{g.current.set(e,t)}),[]),v=t.useCallback((e=>{g.current.delete(e),b((t=>t.filter((t=>t!==e))))}),[]),O=t.useCallback((e=>{"undefined"==typeof window?b((t=>t.includes(e)?t:[...t,e])):b((t=>{if(t.includes(e))return t;const r=Array.from(g.current.entries()).filter((([,e])=>e.current));r.sort((([,e],[,t])=>{const r=e.current,n=t.current;if(!r||!n)return 0;const l=r.compareDocumentPosition(n);return l&Node.DOCUMENT_POSITION_FOLLOWING?-1:l&Node.DOCUMENT_POSITION_PRECEDING?1:0}));const n=r.map((([e])=>e));return n.length===t.length&&n.every(((e,r)=>e===t[r]))?t:n}))}),[]);o((()=>{if(0===f.length)return void(null!==m&&I(null));const e=m?g.current.get(m):null;if(!(null!=m&&"true"!==e?.current?.getAttribute("data-child-disabled"))){const e=R(f);e!==m&&I(e)}}),[R,f,m,I]);const D={focusedItemId:m,setFocusedItemId:I,focusItems:f,setFocusItems:b,addFocusItem:O,groupRef:c,itemRefs:g.current,registerItemRef:y,unregisterItemRef:v};return e(h.Provider,{value:D,children:e(d.div,{id:p,ref:c,role:"group","aria-label":i,"aria-labelledby":s,asChild:!0,...u,children:r})})},Item:I};export{p as R};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';const E=Object.freeze({ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",CONTEXT_MENU:"ContextMenu",END:"End",ENTER:"Enter",ESCAPE:"Escape",F10:"F10",HOME:"Home",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",SPACE:" ",TAB:"Tab"});function e(e){return e===E.ENTER||e===E.SPACE}function r(e,r=!1){return e===E.CONTEXT_MENU||r&&e===E.F10}export{E as K,r as a,e as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import t from"react";const n=/^on[A-Z]/,e=(()=>{const n=parseInt(t.version,10);return!Number.isNaN(n)&&n>=19})(),o=(...t)=>{if(!t.every((t=>null==t)))return e?n=>{const e=t.map((()=>null));return t.forEach(((t,o)=>{if(t)if("function"==typeof t){const r=t(n);"function"==typeof r&&(e[o]=r)}else t.current=n})),()=>{t.forEach(((t,n)=>{if(t)if("function"==typeof t){const o=e[n];o?o():t(null)}else t.current=null}))}}:n=>{for(const e of t)e&&("function"==typeof e?e(n):e.current=n)}},r=n=>{if(!t.isValidElement(n))return;return(e?n.props.ref:n.ref)??void 0},f=(t,e)=>{const o={...t,...e};for(const r of Object.keys(e)){const f=t[r],c=e[r];n.test(r)&&"function"==typeof f&&"function"==typeof c?o[r]=(...t)=>{c(...t);const n=t[0];n&&!0===n.defaultPrevented||f(...t)}:"className"===r&&f&&c?o[r]=`${f} ${c}`:"style"===r&&f&&c&&(o[r]={...f,...c})}return o};export{o as c,r as g,f as m};
|