@radui/ui 0.4.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.
Files changed (130) hide show
  1. package/README.md +2 -0
  2. package/dist/components/Accordion.d.ts +19 -33
  3. package/dist/components/Accordion.js +1 -1
  4. package/dist/components/AlertDialog.d.ts +7 -3
  5. package/dist/components/AlertDialog.js +1 -1
  6. package/dist/components/AspectRatio.d.ts +2 -2
  7. package/dist/components/AspectRatio.js +1 -1
  8. package/dist/components/Avatar.js +1 -1
  9. package/dist/components/AvatarGroup.js +1 -1
  10. package/dist/components/{AvatarPrimitiveFallback-KiY3slgV.js → AvatarPrimitiveFallback-B1u295x6.js} +1 -1
  11. package/dist/components/Badge.js +1 -1
  12. package/dist/components/BlockQuote.js +1 -1
  13. package/dist/components/Breadcrumb.d.ts +70 -0
  14. package/dist/components/Breadcrumb.js +1 -0
  15. package/dist/components/Button.js +1 -1
  16. package/dist/components/Callout.js +1 -1
  17. package/dist/components/Card.js +1 -1
  18. package/dist/components/Checkbox.js +1 -1
  19. package/dist/components/CheckboxCards.js +1 -1
  20. package/dist/components/CheckboxGroup.js +1 -1
  21. package/dist/components/{CheckboxGroupPrimitive-DgfnzMT9.js → CheckboxGroupPrimitive-BWGRST9p.js} +1 -1
  22. package/dist/components/Code.js +1 -1
  23. package/dist/components/Collapsible.js +1 -1
  24. package/dist/components/Combobox.d.ts +3 -1
  25. package/dist/components/Combobox.js +1 -1
  26. package/dist/components/ComboboxPrimitive-C2sksm48.js +1 -0
  27. package/dist/components/Command.d.ts +113 -0
  28. package/dist/components/Command.js +1 -0
  29. package/dist/components/ContextMenu.d.ts +14 -10
  30. package/dist/components/ContextMenu.js +1 -1
  31. package/dist/components/DataList.d.ts +7 -2
  32. package/dist/components/DataList.js +1 -1
  33. package/dist/components/Dialog.d.ts +6 -3
  34. package/dist/components/Dialog.js +1 -1
  35. package/dist/components/Disclosure.d.ts +2 -0
  36. package/dist/components/Disclosure.js +1 -1
  37. package/dist/components/Drawer.d.ts +231 -0
  38. package/dist/components/Drawer.js +1 -0
  39. package/dist/components/DropdownMenu.d.ts +10 -6
  40. package/dist/components/DropdownMenu.js +1 -1
  41. package/dist/components/Em.js +1 -1
  42. package/dist/components/Fieldset.d.ts +43 -0
  43. package/dist/components/Fieldset.js +1 -0
  44. package/dist/components/Heading.js +1 -1
  45. package/dist/components/HoverCard.d.ts +10 -2
  46. package/dist/components/HoverCard.js +1 -1
  47. package/dist/components/Kbd.js +1 -1
  48. package/dist/components/Link.js +1 -1
  49. package/dist/components/LiveRegion.d.ts +73 -0
  50. package/dist/components/LiveRegion.js +1 -0
  51. package/dist/components/MenuPrimitive-COEgTo6S.js +1 -0
  52. package/dist/components/Menubar.d.ts +10 -6
  53. package/dist/components/Menubar.js +1 -1
  54. package/dist/components/Minimap.js +1 -1
  55. package/dist/components/NavigationMenu.d.ts +3 -0
  56. package/dist/components/NavigationMenu.js +1 -1
  57. package/dist/components/NumberField.d.ts +2 -0
  58. package/dist/components/NumberField.js +1 -1
  59. package/dist/components/Popover.d.ts +68 -0
  60. package/dist/components/Popover.js +1 -0
  61. package/dist/components/Progress.js +1 -1
  62. package/dist/components/Quote.d.ts +2 -0
  63. package/dist/components/Quote.js +1 -1
  64. package/dist/components/Radio.js +1 -1
  65. package/dist/components/RadioCards.js +1 -1
  66. package/dist/components/RadioGroup.js +1 -1
  67. package/dist/components/{RadioGroupPrimitive-tlWBfWJ8.js → RadioGroupPrimitive-BWUU-0Qh.js} +1 -1
  68. package/dist/components/ScrollArea.d.ts +15 -3
  69. package/dist/components/ScrollArea.js +1 -1
  70. package/dist/components/Select.d.ts +3 -1
  71. package/dist/components/Select.js +1 -1
  72. package/dist/components/Separator.js +1 -1
  73. package/dist/components/Skeleton.js +1 -1
  74. package/dist/components/Slider.js +1 -1
  75. package/dist/components/Spinner.js +1 -1
  76. package/dist/components/Splitter.js +1 -1
  77. package/dist/components/Steps.js +1 -1
  78. package/dist/components/Strong.js +1 -1
  79. package/dist/components/Switch.js +1 -1
  80. package/dist/components/TabNav.js +1 -1
  81. package/dist/components/Table.d.ts +65 -19
  82. package/dist/components/Table.js +1 -1
  83. package/dist/components/Tabs.d.ts +2 -0
  84. package/dist/components/Tabs.js +1 -1
  85. package/dist/components/Text.js +1 -1
  86. package/dist/components/TextArea.js +1 -1
  87. package/dist/components/TextField.d.ts +41 -0
  88. package/dist/components/TextField.js +1 -0
  89. package/dist/components/Theme.d.ts +2 -0
  90. package/dist/components/Theme.js +1 -1
  91. package/dist/components/Toast.d.ts +322 -0
  92. package/dist/components/Toast.js +1 -0
  93. package/dist/components/Toggle.js +1 -1
  94. package/dist/components/ToggleGroup.js +1 -1
  95. package/dist/components/Toolbar.js +1 -1
  96. package/dist/components/Tooltip.d.ts +3 -0
  97. package/dist/components/Tooltip.js +1 -1
  98. package/dist/components/Tree.d.ts +1 -0
  99. package/dist/components/Tree.js +1 -1
  100. package/dist/components/VisuallyHidden.js +1 -1
  101. package/dist/components/documentOverlayOpen-coyGmcyL.js +1 -0
  102. package/dist/components/floating-ui.react-Byzse64h.js +5 -0
  103. package/dist/components/index-C09ZQH_q.js +1 -0
  104. package/dist/components/index-CD_nZA9X.js +1 -0
  105. package/dist/components/{index-BOy86lYu.js → index-CfC8-kd8.js} +1 -1
  106. package/dist/components/index-Db-tduwt.js +1 -0
  107. package/dist/components/index-UODM4mVT.js +1 -0
  108. package/dist/components/index-XF8itt-H.js +1 -0
  109. package/dist/components/index-YhJvxumL.js +1 -0
  110. package/dist/components/index-eAZUMNef.js +1 -0
  111. package/dist/components/index-m8Mhi26u.js +1 -0
  112. package/dist/components/keyboard-BKF7hXqL.js +1 -0
  113. package/dist/components/mergeProps-0RucjqeH.js +1 -0
  114. package/dist/components/useComponentClass-QwNivz0h.js +1 -0
  115. package/dist/themes/baremetal.css +1 -0
  116. package/dist/themes/default.css +1 -1
  117. package/dist/themes/tailwind-presets/default.css +396 -0
  118. package/package.json +76 -23
  119. package/dist/components/ComboboxPrimitive-D5wWLl2_.js +0 -1
  120. package/dist/components/MenuPrimitive-BvxwQFGM.js +0 -1
  121. package/dist/components/floating-ui.react-gB901AP2.js +0 -5
  122. package/dist/components/index-3dZuI04X.js +0 -1
  123. package/dist/components/index-6If6D2Zi.js +0 -1
  124. package/dist/components/index-98jQ1vTr.js +0 -1
  125. package/dist/components/index-BQ2Hbb_x.js +0 -1
  126. package/dist/components/index-BZVbVgqN.js +0 -1
  127. package/dist/components/index-BoRAvltW.js +0 -1
  128. package/dist/components/index-DTYJVF-V.js +0 -1
  129. package/dist/components/index-TYaYKM2M.js +0 -1
  130. package/dist/themes/tailwind-presets/default.js +0 -1
@@ -0,0 +1,113 @@
1
+ import React from 'react';
2
+ import Primitive from '~/core/primitives/Primitive';
3
+ import DialogPrimitive from '~/core/primitives/Dialog';
4
+
5
+ type CommandFilter = (value: string, search: string, keywords: string[]) => number;
6
+
7
+ type CommandRootProps = React.ComponentPropsWithoutRef<typeof Primitive.div> & {
8
+ customRootClass?: string;
9
+ value?: string;
10
+ defaultValue?: string;
11
+ onValueChange?: (value: string) => void;
12
+ label?: string;
13
+ shouldFilter?: boolean;
14
+ filter?: CommandFilter;
15
+ loop?: boolean;
16
+ };
17
+ declare const CommandRoot: React.ForwardRefExoticComponent<CommandRootProps & React.RefAttributes<HTMLElement>>;
18
+
19
+ type DialogPrimitiveRootProps$1 = {
20
+ children: React.ReactNode;
21
+ open?: boolean;
22
+ defaultOpen?: boolean;
23
+ onOpenChange?: (open: boolean) => void;
24
+ onClickOutside?: () => void;
25
+ className?: string;
26
+ /** When true, outside pointer events and escape key will not close the dialog. */
27
+ disablePointerDismissal?: boolean;
28
+ };
29
+
30
+ type DialogPrimitiveRootProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>;
31
+ type DialogPrimitivePortalProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>;
32
+ type DialogPrimitiveOverlayProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>;
33
+ type DialogPrimitiveContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;
34
+ type CommandDialogProps = Omit<CommandRootProps, 'ref'> & Pick<DialogPrimitiveRootProps, 'open' | 'onOpenChange' | 'onClickOutside'> & {
35
+ container?: DialogPrimitivePortalProps['container'];
36
+ overlayClassName?: string;
37
+ contentClassName?: string;
38
+ forceMount?: boolean;
39
+ contentProps?: Omit<DialogPrimitiveContentProps, 'children' | 'className'>;
40
+ overlayProps?: Omit<DialogPrimitiveOverlayProps, 'className'>;
41
+ };
42
+ declare const CommandDialog: React.ForwardRefExoticComponent<Omit<CommandRootProps, "ref"> & Pick<Omit<DialogPrimitiveRootProps$1 & React.RefAttributes<HTMLDivElement>, "ref">, "open" | "onOpenChange" | "onClickOutside"> & {
43
+ container?: DialogPrimitivePortalProps["container"];
44
+ overlayClassName?: string;
45
+ contentClassName?: string;
46
+ forceMount?: boolean;
47
+ contentProps?: Omit<DialogPrimitiveContentProps, "children" | "className">;
48
+ overlayProps?: Omit<DialogPrimitiveOverlayProps, "className">;
49
+ } & React.RefAttributes<HTMLDivElement>>;
50
+
51
+ type CommandInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange'> & {
52
+ value?: string;
53
+ onValueChange?: (value: string) => void;
54
+ };
55
+ declare const CommandInput: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "onChange"> & {
56
+ value?: string;
57
+ onValueChange?: (value: string) => void;
58
+ } & React.RefAttributes<HTMLElement>>;
59
+
60
+ type CommandListProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
61
+ declare const CommandList: React.ForwardRefExoticComponent<CommandListProps & React.RefAttributes<HTMLElement>>;
62
+
63
+ type CommandItemProps = React.HTMLAttributes<HTMLDivElement> & {
64
+ value?: string;
65
+ keywords?: string[];
66
+ onSelect?: (value: string) => void;
67
+ disabled?: boolean;
68
+ forceMount?: boolean;
69
+ };
70
+ declare const CommandItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
71
+ value?: string;
72
+ keywords?: string[];
73
+ onSelect?: (value: string) => void;
74
+ disabled?: boolean;
75
+ forceMount?: boolean;
76
+ } & React.RefAttributes<HTMLElement>>;
77
+
78
+ type CommandGroupProps = React.ComponentPropsWithoutRef<typeof Primitive.div> & {
79
+ heading?: React.ReactNode;
80
+ forceMount?: boolean;
81
+ };
82
+ declare const CommandGroup: React.ForwardRefExoticComponent<CommandGroupProps & React.RefAttributes<HTMLElement>>;
83
+
84
+ type CommandEmptyProps = React.ComponentPropsWithoutRef<typeof Primitive.div> & {
85
+ forceMount?: boolean;
86
+ };
87
+ declare const CommandEmpty: React.ForwardRefExoticComponent<CommandEmptyProps & React.RefAttributes<HTMLElement>>;
88
+
89
+ type CommandLoadingProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
90
+ declare const CommandLoading: React.ForwardRefExoticComponent<CommandLoadingProps & React.RefAttributes<HTMLElement>>;
91
+
92
+ type CommandSeparatorProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
93
+ declare const CommandSeparator: React.ForwardRefExoticComponent<CommandSeparatorProps & React.RefAttributes<HTMLElement>>;
94
+
95
+ type CommandShortcutProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;
96
+ declare const CommandShortcut: React.ForwardRefExoticComponent<CommandShortcutProps & React.RefAttributes<HTMLElement>>;
97
+
98
+ type CommandComponent = typeof CommandRoot & {
99
+ Root: typeof CommandRoot;
100
+ Dialog: typeof CommandDialog;
101
+ Input: typeof CommandInput;
102
+ List: typeof CommandList;
103
+ Item: typeof CommandItem;
104
+ Group: typeof CommandGroup;
105
+ Empty: typeof CommandEmpty;
106
+ Loading: typeof CommandLoading;
107
+ Separator: typeof CommandSeparator;
108
+ Shortcut: typeof CommandShortcut;
109
+ };
110
+ declare const Command: CommandComponent;
111
+
112
+ export { Command as default };
113
+ export type { CommandDialogProps, CommandEmptyProps, CommandFilter, CommandGroupProps, CommandInputProps, CommandItemProps, CommandListProps, CommandLoadingProps, CommandRootProps, CommandSeparatorProps, CommandShortcutProps };
@@ -0,0 +1 @@
1
+ 'use client';import{jsx as e,jsxs as t}from"react/jsx-runtime";import o from"react";import{c as a}from"./clsx-BaVHROc5.js";import{P as r}from"./index-XF8itt-H.js";import{u as s}from"./index-wRElCyvx.js";import{u as n}from"./useComponentClass-QwNivz0h.js";import{D as l}from"./index-CD_nZA9X.js";import{K as i,i as d}from"./keyboard-BKF7hXqL.js";import{c as m}from"./mergeProps-0RucjqeH.js";import"./ThemeContext-Sm-iNANd.js";import"./index-Db-tduwt.js";import"./floating-ui.react-Byzse64h.js";import"react-dom";import"./index-UODM4mVT.js";import"./documentOverlayOpen-coyGmcyL.js";import"./index-CfC8-kd8.js";const c=o.createContext(null),u=()=>{const e=o.useContext(c);if(!e)throw new Error("Command components must be used within Command.Root or Command.Dialog.");return e},p=(e,t,o)=>{const a=t.trim().toLowerCase();if(!a)return 1;return[e,...o].map((e=>e.toLowerCase())).some((e=>e.includes(a)))?1:0},f=o.forwardRef((({children:t,className:l,customRootClass:i="",value:d,defaultValue:m="",onValueChange:u,label:f="Command menu",shouldFilter:v=!0,filter:C=p,loop:g=!1,...h},b)=>{const y=n(i,"Command"),[I,N]=s(d,m,u),[k,w]=o.useState([]),[R,x]=o.useState([]),[M,S]=o.useState(null),D=o.useRef(0),j=o.useId(),$=o.useId(),E=o.useCallback((e=>{N(e.trimStart())}),[N]),O=o.useCallback((e=>{const t=D.current++;return w((o=>{const a=o.filter((t=>t.id!==e.id));return a.push({...e,order:t}),a.sort(((e,t)=>e.order-t.order)),a})),()=>{w((t=>t.filter((t=>t.id!==e.id))))}}),[]),V=o.useCallback(((e,t)=>{w((o=>o.map((o=>o.id===e?{...o,...t}:o))))}),[]),A=o.useCallback((e=>{w((t=>t.filter((t=>t.id!==e))))}),[]),P=o.useCallback((e=>{const t=D.current++;return x((o=>{const a=o.filter((t=>t.id!==e));return a.push({id:e,order:t}),a.sort(((e,t)=>e.order-t.order)),a})),()=>{x((t=>t.filter((t=>t.id!==e))))}}),[]),L=I.trim(),T=o.useMemo((()=>k.map((e=>{const t=v&&L?C(e.value,L,e.keywords):1,o=e.forceMount||t>0;return{...e,score:t,visible:o}}))),[C,k,L,v]),G=o.useMemo((()=>T.filter((e=>e.visible&&!e.disabled))),[T]),K=o.useMemo((()=>G.map((e=>e.id))),[G]),B=o.useMemo((()=>T.reduce(((e,t)=>t.groupId&&t.visible?(e[t.groupId]=(e[t.groupId]||0)+1,e):e),{})),[T]);o.useEffect((()=>{0!==K.length?S((e=>e&&K.includes(e)?e:K[0])):S(null)}),[K]),o.useEffect((()=>{if(!M)return;const e=k.find((e=>e.id===M)),t=e?.ref.current;t&&"function"==typeof t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"nearest"})}),[M,k]);const W=o.useCallback((e=>{if(0===G.length)return;const t=M?G.findIndex((e=>e.id===M)):-1;let o=t+e;-1===t&&(o=1===e?0:G.length-1),g?(o<0&&(o=G.length-1),o>=G.length&&(o=0)):o=Math.max(0,Math.min(G.length-1,o)),S(G[o]?.id||null)}),[M,g,G]),F=o.useCallback((e=>{0!==G.length&&S("start"===e?G[0].id:G[G.length-1].id)}),[G]),_=o.useCallback((()=>{if(!M)return;const e=G.find((e=>e.id===M));e&&!e.disabled&&e.onSelect?.(e.value)}),[M,G]),H=o.useCallback((e=>{const t=T.find((t=>t.id===e)),o=Boolean(t?.visible),a=M===e;return{active:a,visible:o,selected:a}}),[M,T]),U=o.useCallback((e=>B[e]||0),[B]),q=o.useCallback((e=>{const t=R.find((t=>t.id===e));if(!t)return!1;const o=T.some((e=>e.visible&&e.order<t.order)),a=T.some((e=>e.visible&&e.order>t.order));return o&&a}),[T,R]),z=o.useMemo((()=>({rootClass:y,label:f,listId:j,inputId:$,search:I,setSearch:E,loop:g,shouldFilter:v,registerItem:O,updateItem:V,unregisterItem:A,registerSeparator:P,activeItemId:M,setActiveItemId:S,moveActive:W,moveToBoundary:F,selectActiveItem:_,getItemState:H,visibleItemCount:T.filter((e=>e.visible)).length,getVisibleGroupItemCount:U,getSeparatorVisible:q})),[M,H,q,U,$,f,j,g,W,F,O,P,y,I,_,E,v,T,A,V]);return e(c.Provider,{value:z,children:e(r.div,{ref:b,className:a(y,l),"data-slot":"command-root","data-value":L||void 0,...h,children:t})})}));f.displayName="Command";const v=o.forwardRef((({children:o,className:r,customRootClass:s="",open:i,onOpenChange:d,onClickOutside:m,container:c,overlayClassName:u,contentClassName:p,forceMount:v=!1,contentProps:C,overlayProps:g,...h},b)=>{const y=n(s,"Command");return e(l.Root,{open:i,onOpenChange:d,onClickOutside:m,children:t(l.Portal,{container:c,forceMount:v,children:[e(l.Overlay,{className:a(y&&`${y}-overlay`,u),"data-slot":"command-overlay",...g}),e(l.Content,{ref:b,className:a(y&&`${y}-dialog-content`,p),"data-slot":"command-dialog-content",...C,children:e(f,{customRootClass:s,className:r,...h,children:o})})]})})}));v.displayName="CommandDialog";const C=o.forwardRef((({className:t,value:o,onValueChange:s,onKeyDown:n,...l},d)=>{const{rootClass:m,label:c,listId:p,inputId:f,search:v,setSearch:C,moveActive:g,moveToBoundary:h,selectActiveItem:b}=u(),y=o??v;return e(r.input,{ref:d,type:"text",id:f,className:a(m&&`${m}-input`,t),"data-slot":"command-input",role:"combobox","aria-autocomplete":"list","aria-controls":p,"aria-expanded":"true","aria-label":c,value:y,onChange:e=>{const t=e.currentTarget.value;void 0===o&&C(t),s?.(t)},onKeyDown:e=>{e.key===i.ARROW_DOWN&&(e.preventDefault(),g(1)),e.key===i.ARROW_UP&&(e.preventDefault(),g(-1)),e.key===i.HOME&&(e.preventDefault(),h("start")),e.key===i.END&&(e.preventDefault(),h("end")),e.key===i.ENTER&&(e.preventDefault(),b()),n?.(e)},...l})}));C.displayName="CommandInput";const g=o.forwardRef((({className:t,...o},s)=>{const{rootClass:n,listId:l,label:i}=u();return e(r.div,{ref:s,id:l,className:a(n&&`${n}-list`,t),"data-slot":"command-list",role:"listbox","aria-label":i,...o})}));g.displayName="CommandList";const h=o.createContext(null),b=o.forwardRef((({children:t,className:s,value:n,keywords:l,onSelect:i,disabled:c=!1,forceMount:p=!1,onMouseMove:f,onClick:v,...C},g)=>{const{registerItem:b,setActiveItemId:I,getItemState:N,rootClass:k}=u(),w=o.useContext(h),R=o.useId(),x=o.useRef(null),M=o.useMemo((()=>l??[]),[l]),S=o.useMemo((()=>"string"==typeof n&&n.length>0?n:"string"==typeof t||"number"==typeof t?String(t):R),[t,R,n]);o.useEffect((()=>b({id:R,value:S,keywords:M,disabled:c,forceMount:p,groupId:w,ref:x,onSelect:i})),[c,p,w,S,R,M,i,b]);const{active:D,visible:j,selected:$}=N(R);return j||p?e(r.div,{ref:m(x,g),className:a(y(k),s),"data-slot":"command-item","data-disabled":c?"":void 0,"data-selected":$?"":void 0,"data-value":S,role:"option","aria-disabled":c||void 0,"aria-selected":$,tabIndex:c?-1:0,hidden:!j,onMouseMove:e=>{c||I(R),f?.(e)},onClick:e=>{c||(I(R),i?.(S)),v?.(e)},onKeyDown:e=>{c||d(e.key)&&(e.preventDefault(),i?.(S))},...C,children:t}):null})),y=e=>e?`${e}-item`:void 0;b.displayName="CommandItem";const I=o.forwardRef((({children:s,className:n,heading:l,forceMount:i=!1,...d},m)=>{const{rootClass:c,getVisibleGroupItemCount:p}=u(),f=o.useId(),v=o.useId(),C=p(f),g=i||C>0;return e(h.Provider,{value:f,children:t(r.div,{ref:m,className:a(c&&`${c}-group`,n),"data-slot":"command-group",role:"presentation",hidden:!g,...d,children:[l?e(r.div,{className:c?`${c}-group-heading`:void 0,"data-slot":"command-group-heading",id:v,children:l}):null,e(r.div,{className:c?`${c}-group-items`:void 0,"data-slot":"command-group-items",role:"group","aria-labelledby":l?v:void 0,children:s})]})})}));I.displayName="CommandGroup";const N=o.forwardRef((({className:t,forceMount:o=!1,...s},n)=>{const{rootClass:l,visibleItemCount:i}=u(),d=o||0===i;return d||o?e(r.div,{ref:n,className:a(l&&`${l}-empty`,t),"data-slot":"command-empty",role:"status",hidden:!d,...s}):null}));N.displayName="CommandEmpty";const k=o.forwardRef((({className:t,...o},s)=>{const{rootClass:n}=u();return e(r.div,{ref:s,className:a(n&&`${n}-loading`,t),"data-slot":"command-loading","aria-live":"polite","aria-busy":"true",...o})}));k.displayName="CommandLoading";const w=o.forwardRef((({className:t,...s},n)=>{const{rootClass:l,registerSeparator:i,getSeparatorVisible:d}=u(),m=o.useId();o.useEffect((()=>i(m)),[i,m]);return d(m)?e(r.div,{ref:n,className:a(l&&`${l}-separator`,t),"data-slot":"command-separator",role:"separator",...s}):null}));w.displayName="CommandSeparator";const R=o.forwardRef((({className:t,...o},s)=>{const{rootClass:n}=u();return e(r.span,{ref:s,className:a(n&&`${n}-shortcut`,t),"data-slot":"command-shortcut",...o})}));R.displayName="CommandShortcut";const x=f;x.Root=f,x.Dialog=v,x.Input=C,x.List=g,x.Item=b,x.Group=I,x.Empty=N,x.Loading=k,x.Separator=w,x.Shortcut=R;export{x as default};
@@ -7,15 +7,15 @@ type ContextMenuRootProps = {
7
7
  children: React.ReactNode;
8
8
  customRootClass?: string;
9
9
  className?: string;
10
- variant?: 'default' | 'soft' | 'outline';
11
- size?: 'small' | 'medium' | 'large';
10
+ variant?: string;
11
+ size?: string;
12
12
  } & ComponentPropsWithoutRef<typeof MenuPrimitive.Root>;
13
13
  declare const ContextMenuRoot: React.ForwardRefExoticComponent<{
14
14
  children: React.ReactNode;
15
15
  customRootClass?: string;
16
16
  className?: string;
17
- variant?: "default" | "soft" | "outline";
18
- size?: "small" | "medium" | "large";
17
+ variant?: string;
18
+ size?: string;
19
19
  } & Omit<{
20
20
  children: React.ReactNode;
21
21
  className?: string;
@@ -24,6 +24,8 @@ declare const ContextMenuRoot: React.ForwardRefExoticComponent<{
24
24
  defaultOpen?: boolean;
25
25
  crossAxisOffset?: number;
26
26
  mainAxisOffset?: number;
27
+ collisionBoundary?: Element | null | Array<Element | null>;
28
+ collisionPadding?: number;
27
29
  loop?: boolean;
28
30
  placement?: "top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end";
29
31
  avoidCollision?: boolean;
@@ -45,11 +47,6 @@ declare const ContextMenuTrigger: React.ForwardRefExoticComponent<{
45
47
  className?: string;
46
48
  } & Omit<MenuPrimitiveTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
47
49
 
48
- type MenuPrimitiveContentProps = {
49
- children: React.ReactNode;
50
- className?: string;
51
- };
52
-
53
50
  type ContextMenuContentProps = {
54
51
  children: React.ReactNode;
55
52
  className?: string;
@@ -65,7 +62,12 @@ declare const ContextMenuContent: React.ForwardRefExoticComponent<{
65
62
  variant?: "default" | "soft" | "outline";
66
63
  /** Size of the content panel */
67
64
  size?: "small" | "medium" | "large";
68
- } & Omit<MenuPrimitiveContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
65
+ } & Omit<{
66
+ children: React.ReactNode;
67
+ className?: string;
68
+ initialFocus?: number;
69
+ focusManagerDisabled?: boolean;
70
+ } & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
69
71
 
70
72
  type ContextMenuPortalProps = {
71
73
  children: React.ReactNode;
@@ -117,6 +119,8 @@ declare const ContextMenuSub: React.ForwardRefExoticComponent<{
117
119
  defaultOpen?: boolean;
118
120
  crossAxisOffset?: number;
119
121
  mainAxisOffset?: number;
122
+ collisionBoundary?: Element | null | Array<Element | null>;
123
+ collisionPadding?: number;
120
124
  loop?: boolean;
121
125
  placement?: "top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end";
122
126
  avoidCollision?: boolean;
@@ -1 +1 @@
1
- 'use client';import e,{forwardRef as t}from"react";import{jsx as n}from"react/jsx-runtime";import{M as o,a as s}from"./MenuPrimitive-BvxwQFGM.js";import{c as r}from"./index-6If6D2Zi.js";import{c as a}from"./clsx-BaVHROc5.js";import{u}from"./index-wRElCyvx.js";import{u as i}from"./floating-ui.react-gB901AP2.js";import{c as l}from"./index-3dZuI04X.js";import c from"./Separator.js";import"./index-BQ2Hbb_x.js";import"./index-98jQ1vTr.js";import"./index-BOy86lYu.js";import"react-dom";const m=e.createContext(null),d="ContextMenu",C=t((({children:e,customRootClass:t,className:s,open:i,defaultOpen:l=!1,onOpenChange:c,variant:C,size:x,...p},h)=>{const[f,g]=u(i,l,c),M=r(t,d);return n(m.Provider,{value:{rootClass:M,setIsOpen:g,variant:C,size:x},children:n(o.Root,{ref:h,className:a(`${M}-root`,s),open:f,onOpenChange:g,...p,children:e})})}));C.displayName=d;const x=t((({children:t,className:r,...u},l)=>{const c=e.useContext(m),d=e.useContext(s),C=e.useRef(null),x=i([C,l]);if(!c)return console.warn("ContextMenuTrigger should be used in the ContextMenuRoot"),null;const{rootClass:p,setIsOpen:h}=c,f=(e,t)=>{d?.refs.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:e,y:t,top:t,left:e,right:e,bottom:t,toJSON(){return this}})}),h(!0)};return n(o.Trigger,{className:a(`${p}-trigger`,r),asChild:!0,...u,children:n("span",{ref:x,onContextMenu:e=>{e.preventDefault(),f(e.clientX,e.clientY)},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){if(e.preventDefault(),!C.current)return;const t=C.current.getBoundingClientRect();f(t.left+t.width/2,t.top+t.height/2)}},onClick:e=>{e.preventDefault(),h(!1)},role:"button",tabIndex:0,"aria-haspopup":"menu",children:t})})}));x.displayName="ContextMenuTrigger";const p=t((({children:t,className:s,variant:r,size:u,...i},c)=>{const d=e.useContext(m);if(!d)return console.warn("ContextMenuContent should be used in the ContextMenuRoot"),null;const{rootClass:C}=d,x=r??d.variant,p=u??d.size,h=l("context-menu-content",{variant:x,size:p});return n(o.Content,{ref:c,className:a(`${C}-content`,s),...h,...i,children:t})}));p.displayName="ContextMenuContent";const h=t((({children:t,...s},r)=>{const a=e.useContext(m);if(!a)return console.warn("ContextMenuPortal should be used in the ContextMenuRoot"),null;const{rootClass:u}=a;return n(o.Portal,{ref:r,...s,children:t})}));h.displayName="ContextMenuPortal";const f=t((({children:t,className:s,label:r,...u},i)=>{const l=e.useContext(m);if(!l)return console.warn("ContextMenuItem should be used in the ContextMenuRoot"),null;const{rootClass:c}=l;return n(o.Item,{ref:i,className:a(`${c}-item`,s),label:r,...u,children:t})}));f.displayName="ContextMenuItem";const g=t((({children:t,className:s,...r},u)=>{const i=e.useContext(m);if(!i)return console.warn("ContextMenuSub should be used in the ContextMenuRoot"),null;const{rootClass:l}=i;return n(o.Sub,{ref:u,className:a(`${l}-sub`,s),...r,children:t})}));g.displayName="ContextMenuSub";const M=t((({children:t,className:s,...r},u)=>{const i=e.useContext(m);if(!i)return console.warn("ContextMenuSubTrigger should be used in the ContextMenuRoot"),null;const{rootClass:l}=i;return n(o.Trigger,{ref:u,className:a(`${l}-sub-trigger`,s),...r,children:t})}));M.displayName="ContextMenuSubTrigger";const N=t((({className:t,...o},s)=>{const r=e.useContext(m);if(!r)return console.warn("ContextMenuSeparator should be used within ContextMenuRoot"),null;const{rootClass:a}=r;return n(c,{ref:s,customRootClass:a,className:t,...o})}));N.displayName="ContextMenuSeparator";const b=t(((e,t)=>(console.warn("Direct usage of ContextMenu is not supported. Please use ContextMenu.Root, ContextMenu.Item instead."),null)));b.displayName="ContextMenu",b.Root=C,b.Trigger=x,b.Content=p,b.Portal=h,b.Item=f,b.Sub=g,b.SubTrigger=M,b.Separator=N;export{b as default};
1
+ 'use client';import e,{forwardRef as t}from"react";import{jsx as n}from"react/jsx-runtime";import{M as o,a as s}from"./MenuPrimitive-COEgTo6S.js";import{u as r}from"./useComponentClass-QwNivz0h.js";import{c as a}from"./clsx-BaVHROc5.js";import{u as i}from"./index-wRElCyvx.js";import{a as u}from"./keyboard-BKF7hXqL.js";import{u as l}from"./floating-ui.react-Byzse64h.js";import{c}from"./index-eAZUMNef.js";import m from"./Separator.js";import"./index-Db-tduwt.js";import"./index-UODM4mVT.js";import"./documentOverlayOpen-coyGmcyL.js";import"./index-XF8itt-H.js";import"./mergeProps-0RucjqeH.js";import"./index-CfC8-kd8.js";import"./ThemeContext-Sm-iNANd.js";import"react-dom";const d=e.createContext(null),C="ContextMenu",p=t((({children:e,customRootClass:t,className:s,open:u,defaultOpen:l=!1,onOpenChange:c,variant:m,size:p,...x},h)=>{const[f,g]=i(u,l,c),M=r(t,C);return n(d.Provider,{value:{rootClass:M,setIsOpen:g,variant:m,size:p},children:n(o.Root,{ref:h,className:a(M&&`${M}-root`,s),open:f,onOpenChange:g,...x,children:e})})}));p.displayName=C;const x=t((({children:t,className:r,...i},c)=>{const m=e.useContext(d),C=e.useContext(s),p=e.useRef(null),x=l([p,c]);if(!m)return console.warn("ContextMenuTrigger should be used in the ContextMenuRoot"),null;const{rootClass:h,setIsOpen:f}=m,g=(e,t)=>{C?.refs.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:e,y:t,top:t,left:e,right:e,bottom:t,toJSON(){return this}})}),f(!0)};return n(o.Trigger,{className:a(h&&`${h}-trigger`,r),asChild:!0,...i,children:n("span",{ref:x,onContextMenu:e=>{e.preventDefault(),g(e.clientX,e.clientY)},onKeyDown:e=>{if(u(e.key,e.shiftKey)){if(e.preventDefault(),!p.current)return;const t=p.current.getBoundingClientRect();g(t.left+t.width/2,t.top+t.height/2)}},onClick:e=>{e.preventDefault(),f(!1)},role:"button",tabIndex:0,"aria-haspopup":"menu",children:t})})}));x.displayName="ContextMenuTrigger";const h=t((({children:t,className:s,variant:r,size:i,...u},l)=>{const m=e.useContext(d);if(!m)return console.warn("ContextMenuContent should be used in the ContextMenuRoot"),null;const{rootClass:C}=m,p=r??m.variant,x=i??m.size,h=c("context-menu-content",{variant:p,size:x});return n(o.Content,{ref:l,className:a(C&&`${C}-content`,s),...h,...u,children:t})}));h.displayName="ContextMenuContent";const f=t((({children:t,...s},r)=>{const a=e.useContext(d);if(!a)return console.warn("ContextMenuPortal should be used in the ContextMenuRoot"),null;const{rootClass:i}=a;return n(o.Portal,{ref:r,...s,children:t})}));f.displayName="ContextMenuPortal";const g=t((({children:t,className:s,label:r,...i},u)=>{const l=e.useContext(d);if(!l)return console.warn("ContextMenuItem should be used in the ContextMenuRoot"),null;const{rootClass:c}=l;return n(o.Item,{ref:u,className:a(c&&`${c}-item`,s),label:r,...i,children:t})}));g.displayName="ContextMenuItem";const M=t((({children:t,className:s,...r},i)=>{const u=e.useContext(d);if(!u)return console.warn("ContextMenuSub should be used in the ContextMenuRoot"),null;const{rootClass:l}=u;return n(o.Sub,{ref:i,className:a(l&&`${l}-sub`,s),...r,children:t})}));M.displayName="ContextMenuSub";const N=t((({children:t,className:s,...r},i)=>{const u=e.useContext(d);if(!u)return console.warn("ContextMenuSubTrigger should be used in the ContextMenuRoot"),null;const{rootClass:l}=u;return n(o.Trigger,{ref:i,className:a(l&&`${l}-sub-trigger`,s),...r,children:t})}));N.displayName="ContextMenuSubTrigger";const b=t((({className:t,...o},s)=>{const r=e.useContext(d);if(!r)return console.warn("ContextMenuSeparator should be used within ContextMenuRoot"),null;const{rootClass:a}=r;return n(m,{ref:s,customRootClass:a,className:t,...o})}));b.displayName="ContextMenuSeparator";const j=t(((e,t)=>(console.warn("Direct usage of ContextMenu is not supported. Please use ContextMenu.Root, ContextMenu.Item instead."),null)));j.displayName="ContextMenu",j.Root=p,j.Trigger=x,j.Content=h,j.Portal=f,j.Item=g,j.Sub=M,j.SubTrigger=N,j.Separator=b;export{j as default};
@@ -3,11 +3,14 @@ import { ComponentPropsWithoutRef } from 'react';
3
3
 
4
4
  interface DataListRootProps extends ComponentPropsWithoutRef<'div'> {
5
5
  customRootClass?: string;
6
+ size?: string;
6
7
  }
7
8
 
8
9
  type DataListItemProps = ComponentPropsWithoutRef<'div'>;
9
10
 
10
- type DataListLabelProps = ComponentPropsWithoutRef<'dt'>;
11
+ type DataListLabelProps = ComponentPropsWithoutRef<'dt'> & {
12
+ color?: string;
13
+ };
11
14
 
12
15
  type DataListValueProps = ComponentPropsWithoutRef<'dd'>;
13
16
 
@@ -15,7 +18,9 @@ declare const DataList: {
15
18
  (): null;
16
19
  Root: React.ForwardRefExoticComponent<DataListRootProps & React.RefAttributes<HTMLDivElement>>;
17
20
  Item: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
18
- Label: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
21
+ Label: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
22
+ color?: string;
23
+ } & React.RefAttributes<HTMLElement>>;
19
24
  Value: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
20
25
  };
21
26
 
@@ -1 +1 @@
1
- 'use client';import{jsx as a}from"react/jsx-runtime";import{createContext as s,forwardRef as t,useContext as e}from"react";import{c as o}from"./index-6If6D2Zi.js";import{c as r}from"./clsx-BaVHROc5.js";const l=s({rootClass:"DataList"}),c=t((({children:s,className:t="",customRootClass:e="",...c},i)=>{const n=o(e,"DataList");return a(l.Provider,{value:{rootClass:n},children:a("div",{ref:i,className:r(n,t),...c,children:s})})}));c.displayName="DataListRoot";const i=t((({children:s,className:t="",...o},c)=>{const{rootClass:i}=e(l);return a("div",{ref:c,className:r(`${i}-item`,t),...o,children:s})}));i.displayName="DataListItem";const n=t((({children:s,className:t="",...o},c)=>{const{rootClass:i}=e(l);return a("dt",{ref:c,className:r(`${i}-label`,t),...o,children:s})}));n.displayName="DataListLabel";const m=t((({children:s,className:t="",...o},c)=>{const{rootClass:i}=e(l);return a("dd",{ref:c,className:r(`${i}-value`,t),...o,children:s})}));m.displayName="DataListValue";const d=()=>(console.warn("Direct usage of DataList is not supported. Please use DataList.Root, DataList.Item, etc. instead."),null);d.Root=c,d.Item=i,d.Label=n,d.Value=m;export{d as default};
1
+ 'use client';import{jsx as s}from"react/jsx-runtime";import{createContext as a,forwardRef as t,useContext as e}from"react";import{u as o}from"./useComponentClass-QwNivz0h.js";import{c as r,b as l}from"./index-eAZUMNef.js";import{c as i}from"./clsx-BaVHROc5.js";import"./ThemeContext-Sm-iNANd.js";const c=a({rootClass:"DataList"}),n=t((({children:a,className:t="",customRootClass:e="",size:l="",...n},m)=>{const d=o(e,"DataList"),u=r("datalist",{size:l});return s(c.Provider,{value:{rootClass:d},children:s("div",{ref:m,className:i(d,t),...u,...n,children:a})})}));n.displayName="DataListRoot";const m=t((({children:a,className:t="",...o},r)=>{const{rootClass:l}=e(c);return s("div",{ref:r,className:i(l&&`${l}-item`,t),...o,children:a})}));m.displayName="DataListItem";const d=t((({children:a,className:t="",color:o="",...r},n)=>{const{rootClass:m}=e(c),d=l(o);return s("dt",{ref:n,className:i(m&&`${m}-label`,t),...d,...r,children:a})}));d.displayName="DataListLabel";const u=t((({children:a,className:t="",...o},r)=>{const{rootClass:l}=e(c);return s("dd",{ref:r,className:i(l&&`${l}-value`,t),...o,children:a})}));u.displayName="DataListValue";const p=()=>(console.warn("Direct usage of DataList is not supported. Please use DataList.Root, DataList.Item, etc. instead."),null);p.Root=n,p.Item=m,p.Label=d,p.Value=u;export{p as default};
@@ -1,13 +1,17 @@
1
1
  import React from 'react';
2
2
  import DialogPrimitive from '~/core/primitives/Dialog';
3
+ import * as _floating_ui_react from '@floating-ui/react';
3
4
  import Primitive from '~/core/primitives/Primitive';
4
5
 
5
6
  type DialogPrimitiveRootProps$1 = {
6
7
  children: React.ReactNode;
7
8
  open?: boolean;
9
+ defaultOpen?: boolean;
8
10
  onOpenChange?: (open: boolean) => void;
9
11
  onClickOutside?: () => void;
10
12
  className?: string;
13
+ /** When true, outside pointer events and escape key will not close the dialog. */
14
+ disablePointerDismissal?: boolean;
11
15
  };
12
16
 
13
17
  type DialogPrimitiveRootProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>;
@@ -50,11 +54,9 @@ type DialogPrimitiveOverlayProps = React.ComponentPropsWithoutRef<typeof DialogP
50
54
  type DialogOverlayProps = DialogPrimitiveOverlayProps & {
51
55
  className?: string;
52
56
  };
53
- declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<{
54
- className?: string;
57
+ declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & _floating_ui_react.FloatingOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
55
58
  asChild?: boolean;
56
59
  forceMount?: boolean;
57
- children?: React.ReactNode;
58
60
  } & React.RefAttributes<HTMLDivElement>, "ref"> & {
59
61
  className?: string;
60
62
  } & React.RefAttributes<HTMLDivElement>>;
@@ -81,6 +83,7 @@ type DialogPrimitiveCancelProps = {
81
83
  children: React.ReactNode;
82
84
  asChild?: boolean;
83
85
  className?: string;
86
+ onClick?: React.MouseEventHandler<HTMLButtonElement>;
84
87
  };
85
88
 
86
89
  type DialogPrimitiveCloseProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Cancel>;
@@ -1 +1 @@
1
- 'use client';import{createContext as s,forwardRef as e,useContext as o}from"react";import{jsx as a}from"react/jsx-runtime";import{D as r}from"./index-BoRAvltW.js";import{c as l}from"./clsx-BaVHROc5.js";import{c as t}from"./index-6If6D2Zi.js";import{P as i}from"./index-98jQ1vTr.js";import"./index-BQ2Hbb_x.js";import"./floating-ui.react-gB901AP2.js";import"react-dom";import"./index-BOy86lYu.js";import"./ThemeContext-Sm-iNANd.js";const n=s({rootClass:""}),c="Dialog",m=e((({children:s,customRootClass:e="",className:o="",...i},m)=>{const d=t(e,c),p={rootClass:d};return a(r.Root,{ref:m,className:l(d,o),...i,children:a(n.Provider,{value:p,children:s})})}));m.displayName=c;const d=e((({children:s,asChild:e,className:t="",...i},c)=>{const{rootClass:m}=o(n);return a(r.Trigger,{ref:c,className:l(`${m}-trigger`,t),asChild:e,...i,children:s})}));d.displayName="DialogTrigger";const p=e((({children:s,...e},o)=>a(r.Portal,{...e,children:s})));p.displayName="DialogPortal";const N=e((({className:s="",...e},t)=>{const{rootClass:i}=o(n);return a(r.Overlay,{ref:t,className:l(`${i}-overlay`,s),...e})}));N.displayName="DialogOverlay";const g=e((({children:s,className:e="",...t},i)=>{const{rootClass:c}=o(n);return a(r.Content,{ref:i,className:l(`${c}-content`,e),...t,children:s})}));g.displayName="DialogContent";const h=e((({children:s,className:e="",...r},t)=>{const{rootClass:c}=o(n);return a(i.h2,{ref:t,className:l(`${c}-title`,e),...r,children:s})}));h.displayName="DialogTitle";const C=e((({children:s,className:e="",...r},t)=>{const{rootClass:c}=o(n);return a(i.p,{ref:t,className:l(`${c}-description`,e),...r,children:s})}));C.displayName="DialogDescription";const f=e((({children:s,asChild:e,className:t="",...i},c)=>{const{rootClass:m}=o(n);return a(r.Cancel,{ref:c,className:l(`${m}-close`,t),asChild:e,...i,children:s})}));f.displayName="DialogClose";const u=e((({children:s,className:e="",...t},i)=>{const{rootClass:c}=o(n);return a(r.Footer,{ref:i,className:l(`${c}-footer`,e),...t,children:s})}));u.displayName="DialogFooter";const D=e(((s,e)=>(console.warn("Direct usage of Dialog is not supported. Please use Dialog.Root, Dialog.Content, etc. instead."),null)));D.displayName="Dialog";const y=D;y.Root=m,y.Trigger=d,y.Portal=p,y.Overlay=N,y.Content=g,y.Title=h,y.Description=C,y.Footer=u,y.Close=f;export{y as default};
1
+ 'use client';import{createContext as s,forwardRef as e,useContext as o}from"react";import{jsx as r}from"react/jsx-runtime";import{D as a}from"./index-CD_nZA9X.js";import{c as t}from"./clsx-BaVHROc5.js";import{u as l}from"./useComponentClass-QwNivz0h.js";import{P as i}from"./index-XF8itt-H.js";import"./index-Db-tduwt.js";import"./floating-ui.react-Byzse64h.js";import"react-dom";import"./index-wRElCyvx.js";import"./index-UODM4mVT.js";import"./documentOverlayOpen-coyGmcyL.js";import"./index-CfC8-kd8.js";import"./ThemeContext-Sm-iNANd.js";import"./mergeProps-0RucjqeH.js";const n=s({rootClass:""}),c="Dialog",m=e((({children:s,customRootClass:e="",className:o="",...i},m)=>{const d=l(e,c),p={rootClass:d};return r(a.Root,{ref:m,className:t(d,o),...i,children:r(n.Provider,{value:p,children:s})})}));m.displayName=c;const d=e((({children:s,asChild:e,className:l="",...i},c)=>{const{rootClass:m}=o(n);return r(a.Trigger,{ref:c,className:t(m&&`${m}-trigger`,l),asChild:e,...i,children:s})}));d.displayName="DialogTrigger";const p=e((({children:s,...e},o)=>r(a.Portal,{...e,children:s})));p.displayName="DialogPortal";const N=e((({className:s="",...e},l)=>{const{rootClass:i}=o(n);return r(a.Overlay,{ref:l,className:t(i&&`${i}-overlay`,s),...e})}));N.displayName="DialogOverlay";const g=e((({children:s,className:e="",...l},i)=>{const{rootClass:c}=o(n);return r(a.Content,{ref:i,className:t(c&&`${c}-content`,e),...l,children:s})}));g.displayName="DialogContent";const C=e((({children:s,className:e="",...a},l)=>{const{rootClass:c}=o(n);return r(i.h2,{ref:l,className:t(c&&`${c}-title`,e),...a,children:s})}));C.displayName="DialogTitle";const h=e((({children:s,className:e="",...a},l)=>{const{rootClass:c}=o(n);return r(i.p,{ref:l,className:t(c&&`${c}-description`,e),...a,children:s})}));h.displayName="DialogDescription";const u=e((({children:s,asChild:e,className:l="",...i},c)=>{const{rootClass:m}=o(n);return r(a.Cancel,{ref:c,className:t(m&&`${m}-close`,l),asChild:e,...i,children:s})}));u.displayName="DialogClose";const f=e((({children:s,className:e="",...l},i)=>{const{rootClass:c}=o(n);return r(a.Footer,{ref:i,className:t(c&&`${c}-footer`,e),...l,children:s})}));f.displayName="DialogFooter";const D=e(((s,e)=>(console.warn("Direct usage of Dialog is not supported. Please use Dialog.Root, Dialog.Content, etc. instead."),null)));D.displayName="Dialog";const y=D;y.Root=m,y.Trigger=d,y.Portal=p,y.Overlay=N,y.Content=g,y.Title=C,y.Description=h,y.Footer=f,y.Close=u;export{y as default};
@@ -3,10 +3,12 @@ import React from 'react';
3
3
  type DisclosureRootProps = React.ComponentPropsWithoutRef<'div'> & {
4
4
  customRootClass?: string;
5
5
  defaultOpen?: number | null;
6
+ loop?: boolean;
6
7
  };
7
8
  declare const DisclosureRoot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
8
9
  customRootClass?: string;
9
10
  defaultOpen?: number | null;
11
+ loop?: boolean;
10
12
  } & React.RefAttributes<HTMLDivElement>>;
11
13
 
12
14
  type DisclosureItemProps = React.ComponentPropsWithoutRef<'div'> & {
@@ -1 +1 @@
1
- 'use client';import{jsx as e,jsxs as r}from"react/jsx-runtime";import t,{createContext as o,useRef as i,useState as s,useCallback as a,useContext as l,useEffect as n,useId as c}from"react";import{c as d}from"./index-6If6D2Zi.js";import{c as m}from"./clsx-BaVHROc5.js";import{R as u}from"./index-TYaYKM2M.js";import{C as p}from"./index-DTYJVF-V.js";import"./index-98jQ1vTr.js";import"./index-BOy86lYu.js";import"./mergeRefs-B8eZ_q-T.js";import"./index-wRElCyvx.js";const f=o({}),h=t.forwardRef((({children:r,customRootClass:t,"aria-label":o,...l},n)=>{const c=i(null),p=d(t,"Disclosure"),[h,g]=s(null),v=a((e=>{c.current=e,"function"==typeof n?n(e):n&&(n.current=e)}),[n]);return e(f.Provider,{value:{rootClass:p,activeItem:h,setActiveItem:g,disclosureRef:c},children:e(u.Root,{children:e(u.Group,{className:m(`${p}-root`),children:e("div",{...l,className:m(`${p}-root`),ref:v,role:"region","aria-label":o,"data-testid":"disclosure-root",children:r})})})})}));h.displayName="DisclosureRoot";const g=o({}),v=t.forwardRef((({children:r,className:t="",value:o,...i},a)=>{const{activeItem:d,rootClass:u}=l(f),[h,v]=s(o),[C,N]=s(!1);n((()=>{N(d===h)}),[d,h]);const R=c();return e(g.Provider,{value:{itemValue:h,setItemValue:v},children:e(p.Root,{open:C,onOpenChange:N,asChild:!0,children:e("div",{...i,className:m(`${u}-item`,t),ref:a,"data-state":C?"open":"closed",id:`disclosure-data-item-${R}`,role:"region","aria-labelledby":`disclosure-trigger-${R}`,children:r})})})}));v.displayName="DisclosureItem";const C=t.forwardRef((({children:r,className:t,onClick:o,...i},s)=>{const{activeItem:a,setActiveItem:n,rootClass:c}=l(f),{itemValue:d}=l(g);return e(u.Item,{children:e(p.Trigger,{asChild:!0,children:e("button",{...i,ref:s,type:"button",className:m(`${c}-trigger`,t),onClick:e=>{a===d?n(null):a!==d&&n(d),o&&o(e)},"aria-expanded":a===d,"aria-haspopup":"true",children:r})})})}));C.displayName="DisclosureTrigger";const N=t.forwardRef((({children:r,className:t="",...o},i)=>{const{activeItem:s,rootClass:a}=l(f),{itemValue:n}=l(g);return n!==s?null:e(p.Content,{...o,ref:i,className:m(`${a}-content`,t),role:"region","aria-hidden":s!==n,children:r})}));N.displayName="DisclosureContent";const R=t.forwardRef((({items:t,...o},i)=>e(h,{ref:i,...o,children:t.map(((t,o)=>r(v,{value:o,children:[e(C,{children:t.title}),e(N,{children:t.content})]},o)))})));R.Root=h,R.Item=v,R.Trigger=C,R.Content=N,R.displayName="Disclosure";export{R as default};
1
+ 'use client';import{jsx as e,jsxs as r}from"react/jsx-runtime";import t,{createContext as o,useRef as s,useState as a,useCallback as i,useContext as l,useEffect as n,useId as c}from"react";import{u as d}from"./useComponentClass-QwNivz0h.js";import{c as m}from"./clsx-BaVHROc5.js";import{R as u}from"./index-m8Mhi26u.js";import{C as p}from"./index-YhJvxumL.js";import"./ThemeContext-Sm-iNANd.js";import"./index-XF8itt-H.js";import"./mergeProps-0RucjqeH.js";import"./index-CfC8-kd8.js";import"./keyboard-BKF7hXqL.js";import"./mergeRefs-B8eZ_q-T.js";import"./index-wRElCyvx.js";const f=o({}),h=t.forwardRef((({children:r,className:t,customRootClass:o,defaultOpen:l=null,"aria-label":n,loop:c=!0,...p},h)=>{const g=s(null),C=d(o,"Disclosure"),[v,N]=a(l),R=i((e=>{g.current=e,"function"==typeof h?h(e):h&&(h.current=e)}),[h]);return e(f.Provider,{value:{rootClass:C,activeItem:v,setActiveItem:N,disclosureRef:g},children:e(u.Root,{loop:c,children:e(u.Group,{className:m(C&&`${C}-root`),children:e("div",{...p,className:m(C&&`${C}-root`,t),ref:R,role:"region","aria-label":n,"data-slot":"disclosure-root","data-testid":"disclosure-root",children:r})})})})}));h.displayName="DisclosureRoot";const g=o({}),C=t.forwardRef((({children:r,className:t="",value:o,...s},i)=>{const{activeItem:d,rootClass:u}=l(f),[h,C]=a(o),[v,N]=a(d===o);n((()=>{N(d===h)}),[d,h]);const R=c();return e(g.Provider,{value:{itemValue:h,setItemValue:C},children:e(p.Root,{open:v,onOpenChange:N,asChild:!0,children:e("div",{...s,className:m(u&&`${u}-item`,t),ref:i,"data-state":v?"open":"closed","data-slot":"disclosure-item",id:`disclosure-data-item-${R}`,role:"region","aria-labelledby":`disclosure-trigger-${R}`,children:r})})})}));C.displayName="DisclosureItem";const v=t.forwardRef((({children:r,className:t,onClick:o,...s},a)=>{const{activeItem:i,setActiveItem:n,rootClass:c}=l(f),{itemValue:d}=l(g);return e(u.Item,{children:e(p.Trigger,{asChild:!0,children:e("button",{...s,ref:a,type:"button",className:m(c&&`${c}-trigger`,t),onClick:e=>{i===d?n(null):i!==d&&n(d),o&&o(e)},"data-state":i===d?"open":"closed","data-slot":"disclosure-trigger","aria-expanded":i===d,"aria-haspopup":"true",children:r})})})}));v.displayName="DisclosureTrigger";const N=t.forwardRef((({children:r,className:t="",...o},s)=>{const{activeItem:a,rootClass:i}=l(f),{itemValue:n}=l(g);return n!==a?null:e(p.Content,{...o,ref:s,className:m(i&&`${i}-content`,t),"data-state":"open","data-slot":"disclosure-content",role:"region","aria-hidden":a!==n,children:r})}));N.displayName="DisclosureContent";const R=t.forwardRef((({items:t,...o},s)=>e(h,{ref:s,...o,children:t.map(((t,o)=>r(C,{value:o,children:[e(v,{children:t.title}),e(N,{children:t.content})]},o)))})));R.Root=h,R.Item=C,R.Trigger=v,R.Content=N,R.displayName="Disclosure";export{R as default};
@@ -0,0 +1,231 @@
1
+ import React from 'react';
2
+ import DialogPrimitive from '~/core/primitives/Dialog';
3
+ import Primitive from '~/core/primitives/Primitive';
4
+
5
+ type DrawerSnapPoint = number | string;
6
+
7
+ type DrawerRootActions = {
8
+ close: () => void;
9
+ unmount: () => void;
10
+ };
11
+ type DrawerChangeReason = 'trigger-press' | 'outside-press' | 'escape-key' | 'close-press' | 'imperative-action' | 'swipe' | 'none';
12
+ type DrawerOpenChangeEventDetails = {
13
+ /** The reason the drawer was asked to open or close. */
14
+ reason: DrawerChangeReason;
15
+ /** Vetoes the pending open state change. */
16
+ cancel: () => void;
17
+ /** True once `cancel` has been called. */
18
+ isCanceled: boolean;
19
+ /**
20
+ * Keeps the drawer mounted through this close, for externally controlled
21
+ * close animations. Release it with `actionsRef.current.unmount()`.
22
+ */
23
+ preventUnmountOnClose: () => void;
24
+ /** The DOM event behind the request, when there was one. */
25
+ event?: Event;
26
+ };
27
+
28
+ type DrawerRootProps = {
29
+ children?: React.ReactNode;
30
+ className?: string;
31
+ customRootClass?: string;
32
+ /** Uncontrolled initial open state. */
33
+ defaultOpen?: boolean;
34
+ /** Controlled open state. */
35
+ open?: boolean;
36
+ /**
37
+ * Called when the drawer requests an open state change.
38
+ *
39
+ * Call `eventDetails.cancel()` to veto the change, which is how you show a
40
+ * "discard your changes?" confirmation before the drawer closes. The second
41
+ * argument carries the `reason` so you can react to the source of the request.
42
+ */
43
+ onOpenChange?: (open: boolean, eventDetails: DrawerOpenChangeEventDetails) => void;
44
+ /** Called once the open or close animation has fully completed. */
45
+ onOpenChangeComplete?: (open: boolean) => void;
46
+ /**
47
+ * Resting heights for a vertical drawer. Numbers between 0 and 1 are
48
+ * fractions of the viewport height, numbers above 1 are pixels, and strings
49
+ * accept `px` and `rem` (for example `'148px'` or `'30rem'`).
50
+ */
51
+ snapPoints?: DrawerSnapPoint[];
52
+ /** Initial snap point when uncontrolled. Defaults to the first snap point. */
53
+ defaultSnapPoint?: DrawerSnapPoint | null;
54
+ /** Controlled active snap point. `null` means fully expanded. */
55
+ snapPoint?: DrawerSnapPoint | null;
56
+ /** Called when the active snap point changes. */
57
+ onSnapPointChange?: (snapPoint: DrawerSnapPoint | null) => void;
58
+ /**
59
+ * Disables velocity-based snap skipping, so the resting point is decided by
60
+ * drag distance alone. You can still drag past several points.
61
+ */
62
+ snapToSequentialPoints?: boolean;
63
+ /**
64
+ * Modal mode.
65
+ * - `true` (default): focus trapped, scroll locked, outside pointer events disabled.
66
+ * - `false`: full document interaction allowed.
67
+ * - `'trap-focus'`: focus trapped, but scroll and outside pointer events remain enabled.
68
+ */
69
+ modal?: boolean | 'trap-focus';
70
+ /** When true, outside presses and the Escape key do not close the drawer. */
71
+ disablePointerDismissal?: boolean;
72
+ /**
73
+ * The side the drawer is docked on, which is also the direction you drag to
74
+ * dismiss it. `up` and `down` are accepted as aliases for `top` and `bottom`.
75
+ */
76
+ swipeDirection?: 'left' | 'right' | 'top' | 'bottom' | 'up' | 'down';
77
+ /** ID of the trigger associated with this drawer (controlled). */
78
+ triggerId?: string | null;
79
+ /** ID of the trigger associated with this drawer (uncontrolled / defaultOpen). */
80
+ defaultTriggerId?: string | null;
81
+ /**
82
+ * Ref to imperative actions.
83
+ * - `close()`: closes the drawer programmatically.
84
+ * - `unmount()`: unmounts the drawer. Needed when a close was held open with
85
+ * `eventDetails.preventUnmountOnClose()` for a custom close animation.
86
+ */
87
+ actionsRef?: React.RefObject<DrawerRootActions | null>;
88
+ };
89
+ declare const DrawerRoot: React.ForwardRefExoticComponent<DrawerRootProps & React.RefAttributes<HTMLDivElement>>;
90
+
91
+ type DialogPrimitiveTriggerProps$1 = {
92
+ children: React.ReactNode;
93
+ asChild?: boolean;
94
+ className?: string;
95
+ disabled?: boolean;
96
+ };
97
+
98
+ type DialogPrimitiveTriggerProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;
99
+ type DrawerTriggerProps = DialogPrimitiveTriggerProps & {
100
+ className?: string;
101
+ };
102
+ declare const DrawerTrigger: React.ForwardRefExoticComponent<Omit<DialogPrimitiveTriggerProps$1 & React.RefAttributes<HTMLButtonElement>, "ref"> & {
103
+ className?: string;
104
+ } & React.RefAttributes<HTMLButtonElement>>;
105
+
106
+ type DialogPrimitivePortalProps$1 = {
107
+ children: React.ReactNode;
108
+ container?: Element | null;
109
+ forceMount?: boolean;
110
+ keepMounted?: boolean;
111
+ };
112
+
113
+ type DialogPrimitivePortalProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>;
114
+ type DrawerPortalProps = DialogPrimitivePortalProps;
115
+ declare const DrawerPortal: React.ForwardRefExoticComponent<DialogPrimitivePortalProps$1 & React.RefAttributes<HTMLDivElement>>;
116
+
117
+ type DrawerOverlayProps = React.ComponentPropsWithoutRef<'div'> & {
118
+ className?: string;
119
+ forceMount?: boolean;
120
+ };
121
+ declare const DrawerOverlay: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
122
+ className?: string;
123
+ forceMount?: boolean;
124
+ } & React.RefAttributes<HTMLDivElement>>;
125
+
126
+ type DrawerContentProps = React.ComponentPropsWithoutRef<typeof Primitive.div> & {
127
+ className?: string;
128
+ asChild?: boolean;
129
+ forceMount?: boolean;
130
+ /**
131
+ * Where focus lands when the drawer opens. `0` focuses the first focusable
132
+ * element, `-1` focuses the popup itself, or pass an element / ref.
133
+ */
134
+ initialFocus?: number | React.RefObject<HTMLElement | null>;
135
+ /** Element focus returns to on close. Defaults to the trigger. */
136
+ finalFocus?: React.RefObject<HTMLElement | null>;
137
+ /**
138
+ * Turns off drag-to-dismiss for this popup. Equivalent to putting
139
+ * `data-swipe-ignore` on it, but as a prop.
140
+ */
141
+ disableSwipeDismiss?: boolean;
142
+ };
143
+ declare const DrawerContent: React.ForwardRefExoticComponent<DrawerContentProps & React.RefAttributes<HTMLElement>>;
144
+
145
+ type PrimitiveHeadingProps = React.ComponentPropsWithoutRef<typeof Primitive.h2>;
146
+ type DrawerTitleProps = PrimitiveHeadingProps & {
147
+ className?: string;
148
+ id?: string;
149
+ };
150
+ declare const DrawerTitle: React.ForwardRefExoticComponent<DrawerTitleProps & React.RefAttributes<HTMLElement>>;
151
+
152
+ type PrimitiveParagraphProps = React.ComponentPropsWithoutRef<typeof Primitive.p>;
153
+ type DrawerDescriptionProps = PrimitiveParagraphProps & {
154
+ className?: string;
155
+ id?: string;
156
+ };
157
+ declare const DrawerDescription: React.ForwardRefExoticComponent<DrawerDescriptionProps & React.RefAttributes<HTMLElement>>;
158
+
159
+ type DialogPrimitiveCancelProps$1 = {
160
+ children: React.ReactNode;
161
+ asChild?: boolean;
162
+ className?: string;
163
+ onClick?: React.MouseEventHandler<HTMLButtonElement>;
164
+ };
165
+
166
+ type DialogPrimitiveCancelProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Cancel>;
167
+ type DrawerCloseProps = DialogPrimitiveCancelProps & {
168
+ className?: string;
169
+ };
170
+ declare const DrawerClose: React.ForwardRefExoticComponent<Omit<DialogPrimitiveCancelProps$1 & React.RefAttributes<HTMLButtonElement>, "ref"> & {
171
+ className?: string;
172
+ } & React.RefAttributes<HTMLButtonElement>>;
173
+
174
+ type DrawerHandleProps = {
175
+ className?: string;
176
+ };
177
+ declare const DrawerHandle: React.ForwardRefExoticComponent<DrawerHandleProps & React.RefAttributes<HTMLDivElement>>;
178
+
179
+ type DrawerSwipeZoneProps = React.ComponentPropsWithoutRef<'div'> & {
180
+ className?: string;
181
+ /**
182
+ * How far (px) the user must drag in the open direction before the drawer opens.
183
+ * @default 48
184
+ */
185
+ openThreshold?: number;
186
+ /**
187
+ * Width/height of the hit zone in px (the edge-hugging strip).
188
+ * @default 20
189
+ */
190
+ size?: number;
191
+ /**
192
+ * Disables the swipe zone. The hit area is removed when disabled.
193
+ */
194
+ disabled?: boolean;
195
+ };
196
+ declare const DrawerSwipeZone: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
197
+ className?: string;
198
+ /**
199
+ * How far (px) the user must drag in the open direction before the drawer opens.
200
+ * @default 48
201
+ */
202
+ openThreshold?: number;
203
+ /**
204
+ * Width/height of the hit zone in px (the edge-hugging strip).
205
+ * @default 20
206
+ */
207
+ size?: number;
208
+ /**
209
+ * Disables the swipe zone. The hit area is removed when disabled.
210
+ */
211
+ disabled?: boolean;
212
+ } & React.RefAttributes<HTMLDivElement>>;
213
+
214
+ type DrawerElement = React.ElementRef<'div'>;
215
+ type DrawerProps = React.ComponentPropsWithoutRef<'div'>;
216
+ interface DrawerComponent extends React.ForwardRefExoticComponent<DrawerProps & React.RefAttributes<DrawerElement>> {
217
+ Root: typeof DrawerRoot;
218
+ Trigger: typeof DrawerTrigger;
219
+ Portal: typeof DrawerPortal;
220
+ Overlay: typeof DrawerOverlay;
221
+ Content: typeof DrawerContent;
222
+ Title: typeof DrawerTitle;
223
+ Description: typeof DrawerDescription;
224
+ Close: typeof DrawerClose;
225
+ Handle: typeof DrawerHandle;
226
+ SwipeZone: typeof DrawerSwipeZone;
227
+ }
228
+ declare const Drawer: DrawerComponent;
229
+
230
+ export { Drawer as default };
231
+ export type { DrawerCloseProps, DrawerContentProps, DrawerDescriptionProps, DrawerHandleProps, DrawerOverlayProps, DrawerPortalProps, DrawerRootActions, DrawerRootProps, DrawerSnapPoint, DrawerSwipeZoneProps, DrawerTitleProps, DrawerTriggerProps };