@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,8 +1,25 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
import CheckboxGroupPrimitive from '~/core/primitives/CheckboxGroup/CheckboxGroupPrimitive';
|
|
4
|
+
|
|
5
|
+
type CheckboxCardsRootProps = {
|
|
6
|
+
customRootClass?: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
variant?: string;
|
|
9
|
+
size?: string;
|
|
10
|
+
} & ComponentPropsWithoutRef<typeof CheckboxGroupPrimitive.Root>;
|
|
11
|
+
|
|
12
|
+
type CheckboxCardsContentProps = ComponentPropsWithoutRef<typeof CheckboxGroupPrimitive.Content>;
|
|
13
|
+
|
|
14
|
+
type CheckboxCardsItemProps = {
|
|
15
|
+
value: string;
|
|
16
|
+
} & ComponentPropsWithoutRef<typeof CheckboxGroupPrimitive.Trigger>;
|
|
17
|
+
|
|
18
|
+
type CheckboxCardsIndicatorProps = ComponentPropsWithoutRef<'svg'>;
|
|
2
19
|
|
|
3
20
|
declare const CheckboxCards: {
|
|
4
21
|
(): null;
|
|
5
|
-
Root:
|
|
22
|
+
Root: React.ForwardRefExoticComponent<{
|
|
6
23
|
customRootClass?: string;
|
|
7
24
|
color?: string;
|
|
8
25
|
variant?: string;
|
|
@@ -17,9 +34,9 @@ declare const CheckboxCards: {
|
|
|
17
34
|
defaultValue?: string[];
|
|
18
35
|
value?: string[];
|
|
19
36
|
onValueChange?: (value: string[]) => void;
|
|
20
|
-
} & Omit<
|
|
21
|
-
Content:
|
|
22
|
-
Item:
|
|
37
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
Content: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
39
|
+
Item: React.ForwardRefExoticComponent<{
|
|
23
40
|
value: string;
|
|
24
41
|
} & Omit<{
|
|
25
42
|
value: string;
|
|
@@ -27,8 +44,9 @@ declare const CheckboxCards: {
|
|
|
27
44
|
disabled?: boolean;
|
|
28
45
|
checked?: boolean;
|
|
29
46
|
onCheckedChange?: (checked: boolean) => void;
|
|
30
|
-
} & Omit<
|
|
31
|
-
Indicator:
|
|
47
|
+
} & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
48
|
+
Indicator: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
32
49
|
};
|
|
33
50
|
|
|
34
51
|
export { CheckboxCards as default };
|
|
52
|
+
export type { CheckboxCardsContentProps, CheckboxCardsIndicatorProps, CheckboxCardsItemProps, CheckboxCardsRootProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
1
|
+
'use client';import{jsx as e}from"react/jsx-runtime";import o,{forwardRef as s,useContext as t}from"react";import{C as r}from"./CheckboxGroupPrimitive-DIOswrR1.js";import{c as a}from"./index-6If6D2Zi.js";import{c}from"./clsx-BaVHROc5.js";import{c as i,a as n,b as m}from"./index-3dZuI04X.js";import{C as l}from"./check-DujVUWP-.js";import"./index-hAp0hL9w.js";import"./index-98jQ1vTr.js";import"./index-BOy86lYu.js";import"./index-wRElCyvx.js";const d=o.createContext({rootClass:""}),C="CheckboxCards",h=s((({children:o,customRootClass:s="",className:t="",color:l="",variant:h="",size:x="",orientation:p="both",...u},f)=>{const b=a(s,C),k=i("checkbox-cards",{variant:h,size:x}),N=m(l),j=n(k,N);return e(d.Provider,{value:{rootClass:b},children:e(r.Root,{ref:f,className:c(`${b}-root`,b,t),...u,...j,orientation:p,children:o})})}));h.displayName=C;const x=s((({children:s,className:t="",value:a,...i},n)=>{const{rootClass:m}=o.useContext(d);return e(r.Trigger,{ref:n,className:c(`${m}-item`,t),value:a,...i,children:s})}));x.displayName="CheckboxCardsItem";const p=s((({children:s,...t},a)=>{const{rootClass:c}=o.useContext(d);return e(r.Content,{ref:a,className:`${c}-content`,...t,children:s})}));p.displayName="CheckboxCardsContent";const u=s((({className:o,...s},r)=>{const{rootClass:a}=t(d);return e(l,{ref:r,width:15,height:15,className:c(`${a}-tick-icon`,o),...s})}));u.displayName="CheckboxCardsIndicator";const f=()=>(console.warn("Direct usage of CheckboxCards is not supported. Please use CheckboxCards.Root, CheckboxCards.Item instead."),null);f.Root=h,f.Content=p,f.Item=x,f.Indicator=u;export{f as default};
|
|
@@ -1,12 +1,26 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
import CheckboxGroupPrimitive from '~/core/primitives/CheckboxGroup/CheckboxGroupPrimitive';
|
|
3
4
|
import Primitive from '~/core/primitives/Primitive';
|
|
4
5
|
|
|
6
|
+
type CheckboxGroupRootProps = {
|
|
7
|
+
customRootClass?: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
variant?: string;
|
|
10
|
+
size?: string;
|
|
11
|
+
} & ComponentPropsWithoutRef<typeof CheckboxGroupPrimitive.Root>;
|
|
12
|
+
|
|
13
|
+
type CheckboxGroupTriggerProps = {
|
|
14
|
+
value?: string;
|
|
15
|
+
} & ComponentPropsWithoutRef<typeof CheckboxGroupPrimitive.Trigger>;
|
|
16
|
+
|
|
5
17
|
type CheckboxGroupLabelProps = ComponentPropsWithoutRef<typeof Primitive.label>;
|
|
6
18
|
|
|
19
|
+
type CheckboxGroupIndicatorProps = ComponentPropsWithoutRef<'svg'>;
|
|
20
|
+
|
|
7
21
|
declare const CheckboxGroup: {
|
|
8
22
|
(): null;
|
|
9
|
-
Root:
|
|
23
|
+
Root: React.ForwardRefExoticComponent<{
|
|
10
24
|
customRootClass?: string;
|
|
11
25
|
color?: string;
|
|
12
26
|
variant?: string;
|
|
@@ -21,8 +35,8 @@ declare const CheckboxGroup: {
|
|
|
21
35
|
defaultValue?: string[];
|
|
22
36
|
value?: string[];
|
|
23
37
|
onValueChange?: (value: string[]) => void;
|
|
24
|
-
} & Omit<
|
|
25
|
-
Trigger:
|
|
38
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
Trigger: React.ForwardRefExoticComponent<{
|
|
26
40
|
value?: string;
|
|
27
41
|
} & Omit<{
|
|
28
42
|
value: string;
|
|
@@ -30,9 +44,10 @@ declare const CheckboxGroup: {
|
|
|
30
44
|
disabled?: boolean;
|
|
31
45
|
checked?: boolean;
|
|
32
46
|
onCheckedChange?: (checked: boolean) => void;
|
|
33
|
-
} & Omit<
|
|
34
|
-
Label:
|
|
35
|
-
Indicator:
|
|
47
|
+
} & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
48
|
+
Label: React.ForwardRefExoticComponent<CheckboxGroupLabelProps & React.RefAttributes<HTMLElement>>;
|
|
49
|
+
Indicator: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
36
50
|
};
|
|
37
51
|
|
|
38
52
|
export { CheckboxGroup as default };
|
|
53
|
+
export type { CheckboxGroupIndicatorProps, CheckboxGroupLabelProps, CheckboxGroupRootProps, CheckboxGroupTriggerProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
1
|
+
'use client';import{jsx as o}from"react/jsx-runtime";import e,{forwardRef as r,useContext as s}from"react";import{C as a}from"./CheckboxGroupPrimitive-DIOswrR1.js";import{c as t}from"./index-6If6D2Zi.js";import{c}from"./clsx-BaVHROc5.js";import{c as i,a as l,b as n}from"./index-3dZuI04X.js";import{P as m}from"./index-98jQ1vTr.js";import{C as p}from"./check-DujVUWP-.js";import"./index-hAp0hL9w.js";import"./index-BOy86lYu.js";import"./index-wRElCyvx.js";const d=e.createContext({rootClass:""}),u="CheckboxGroup",h=r((({children:e,customRootClass:r="",className:s="",color:m="",variant:p="",size:h="",...x},C)=>{const f=t(r,u),b=i("checkbox-group",{variant:p,size:h}),N=n(m),g=l(b,N);return o(d.Provider,{value:{rootClass:f},children:o(a.Root,{ref:C,className:c(`${f}-root`,f,s),...x,...g,children:e})})}));h.displayName=u;const x=r((({children:r,className:s="",value:t,...i},l)=>{const{rootClass:n}=e.useContext(d);return o(a.Trigger,{ref:l,className:c(`${n}-trigger`,s),value:t,...i,children:o(a.Content,{children:r})})}));x.displayName="CheckboxGroupTrigger";const C=r((({children:e,className:r="",...a},t)=>{const{rootClass:i}=s(d);return o(m.label,{ref:t,className:c(`${i}-label`,r),...a,children:e})}));C.displayName="CheckboxGroupLabel";const f=r((({className:e,...r},a)=>{const{rootClass:t}=s(d);return o(p,{ref:a,width:15,height:15,className:c(`${t}-tick-icon`,e),...r})}));f.displayName="CheckboxGroupIndicator";const b=()=>(console.warn("Direct usage of CheckboxGroup is not supported. Please use CheckboxGroup.Root, CheckboxGroup.Item instead."),null);b.Root=h,b.Trigger=x,b.Label=C,b.Indicator=f;export{b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{jsx as e,jsxs as r}from"react/jsx-runtime";import i,{forwardRef as a}from"react";import{R as d}from"./index-hAp0hL9w.js";import{u as o}from"./index-wRElCyvx.js";const t=i.createContext({checkedValues:[],setCheckedValues:()=>{},name:"",required:!1,disabled:!1}),c=a((({dir:r,orientation:i,loop:a,defaultValue:c=[],value:n,onValueChange:s,children:l,name:u,required:h,disabled:m,className:p="",...k},C)=>{const[b,x]=o(n,c,s);return e("div",{ref:C,className:p,...k,children:e(d.Root,{dir:r,orientation:i??"horizontal",loop:a??!0,children:e(t.Provider,{value:{checkedValues:b,setCheckedValues:x,name:u,required:h,disabled:m},children:e(d.Group,{children:l})})})})}));c.displayName="CheckboxGroupPrimitiveRoot";const n=i.createContext({isChecked:!1}),s=a((({children:a,className:o="",value:c,required:s,disabled:l,checked:u,onCheckedChange:h,onClick:m,...p},k)=>{const{checkedValues:C,setCheckedValues:b,name:x,required:v,disabled:f}=i.useContext(t),N=C.includes(c),g=s||v,y=l||f,{role:V,...q}=p;return r("div",{children:[e(n.Provider,{value:{isChecked:N},children:e(d.Item,{ref:k,onClick:e=>{m?.(e),e.preventDefault(),e.stopPropagation(),C.includes(c)?(b(C.filter((e=>e!==c))),h?.(!1)):C.includes(c)||(b([...C,c]),h?.(!0))},className:o,role:"checkbox","aria-checked":N,"aria-required":g,"aria-disabled":y||void 0,disabled:y,...q,"data-state":N?"checked":"unchecked",children:e("button",{type:"button",disabled:y,children:a})})}),e("input",{type:"checkbox",checked:N,name:x,value:c,style:{display:"none"},required:g,disabled:y,"aria-hidden":"true",readOnly:!0})]})}));s.displayName="CheckboxGroupPrimitiveTrigger";const l=a((({children:r,className:a,...d},o)=>{const{isChecked:t}=i.useContext(n);return e("span",{ref:o,className:a,...d,children:t?r:null})}));l.displayName="CheckboxGroupPrimitiveContent";const u=()=>(console.warn("Direct usage of CheckboxGroup is not supported. Please use CheckboxGroup.Root, CheckboxGroup.Item instead."),null);u.Root=c,u.Trigger=s,u.Content=l;export{u as C};
|
package/dist/components/Code.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
1
|
+
'use client';import{jsx as r}from"react/jsx-runtime";import s from"react";import{c as a}from"./clsx-BaVHROc5.js";import{c as o}from"./index-6If6D2Zi.js";import{a as e,b as t,c}from"./index-3dZuI04X.js";const i="Code",m=s.forwardRef((({children:s,customRootClass:m="",color:d="",variant:n="",size:f="",className:l,...p},x)=>{const j=o(m,i),u=e(c("code",{variant:n,size:f}),t(d));return r("code",{ref:x,className:a(j,l),...u,...p,children:s})}));m.displayName=i;export{m as default};
|
|
@@ -1,24 +1,27 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
import CollapsiblePrimitive from '~/core/primitives/Collapsible';
|
|
4
4
|
|
|
5
|
-
type
|
|
6
|
-
|
|
7
|
-
type CollapsibleRootProps = react__default.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Root> & {
|
|
5
|
+
type CollapsibleRootProps = React__default.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Root> & {
|
|
8
6
|
customRootClass?: string;
|
|
9
7
|
};
|
|
10
8
|
|
|
9
|
+
type CollapsibleTriggerProps = React__default.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Trigger>;
|
|
10
|
+
|
|
11
|
+
type CollapsibleContentProps = React__default.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Content>;
|
|
12
|
+
|
|
11
13
|
declare const Collapsible: {
|
|
12
14
|
(): null;
|
|
13
|
-
Root:
|
|
14
|
-
Trigger:
|
|
15
|
+
Root: React.ForwardRefExoticComponent<CollapsibleRootProps & React.RefAttributes<HTMLElement>>;
|
|
16
|
+
Trigger: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
15
17
|
label?: string;
|
|
16
18
|
description?: string;
|
|
17
19
|
asChild?: boolean;
|
|
18
20
|
required?: boolean;
|
|
19
21
|
onChange?: any;
|
|
20
|
-
} & Omit<
|
|
21
|
-
Content:
|
|
22
|
+
} & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
23
|
+
Content: React.ForwardRefExoticComponent<CollapsibleContentProps & React.RefAttributes<HTMLElement>>;
|
|
22
24
|
};
|
|
23
25
|
|
|
24
26
|
export { Collapsible as default };
|
|
27
|
+
export type { CollapsibleContentProps, CollapsibleRootProps, CollapsibleTriggerProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
1
|
+
'use client';import{jsx as e}from"react/jsx-runtime";import{c as o}from"./clsx-BaVHROc5.js";import s,{createContext as r,useContext as a}from"react";import{c as t}from"./index-6If6D2Zi.js";import{C as l}from"./index-DTYJVF-V.js";import"./index-98jQ1vTr.js";import"./index-wRElCyvx.js";import"./index-BOy86lYu.js";const i=r({rootClass:"",open:!1,onOpenChange:()=>{},disabled:!1,defaultOpen:!1}),n=s.forwardRef((({children:s,className:r="",transitionDuration:a=0,disabled:n,customRootClass:c,...d},m)=>{const p=t(c,"Collapsible");return e(i.Provider,{value:{rootClass:p},children:e(l.Root,{ref:m,className:o(p,r),transitionDuration:a,disabled:n,...d,children:s})})}));n.displayName="CollapsibleRoot";const c=s.forwardRef((({children:s,className:r,...t},n)=>{const{rootClass:c}=a(i),d=c?`${c}-trigger`:"";return e(l.Trigger,{ref:n,className:o(d,r),...t,children:s})}));c.displayName="CollapsibleTrigger";const d=s.forwardRef((({children:s,className:r="",...t},n)=>{const{rootClass:c}=a(i),d=c?`${c}-content`:"";return e(l.Content,{ref:n,className:o(d,r),...t,children:s})}));d.displayName="CollapsibleContent";const m=()=>(console.warn("Direct usage of Collapsible is not supported. Please use Collapsible.Root, Collapsible.Trigger, etc. instead."),null);m.Root=n,m.Trigger=c,m.Content=d;export{m as default};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ComboboxPrimitive from '~/core/primitives/Combobox/ComboboxPrimitive';
|
|
3
|
+
import * as _floating_ui_react from '@floating-ui/react';
|
|
4
|
+
|
|
5
|
+
type ComboboxContentProps = React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Content> & {
|
|
6
|
+
customRootClass?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const ComboboxContent: React.ForwardRefExoticComponent<Omit<ComboboxContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
|
|
10
|
+
interface ComboboxPrimitiveItemProps {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
value: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type ComboboxItemProps = React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Item> & {
|
|
19
|
+
customRootClass?: string;
|
|
20
|
+
};
|
|
21
|
+
declare const ComboboxItem: React.ForwardRefExoticComponent<(Omit<Omit<Omit<ComboboxPrimitiveItemProps & Omit<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
22
|
+
asChild?: boolean;
|
|
23
|
+
} & React.RefAttributes<HTMLElement>, "ref">, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
24
|
+
customRootClass?: string;
|
|
25
|
+
}, "ref"> | Omit<Omit<Omit<ComboboxPrimitiveItemProps & Omit<React.HTMLAttributes<HTMLElement> & {
|
|
26
|
+
asChild?: boolean;
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
} & React.RefAttributes<HTMLElement>, "ref">, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
29
|
+
customRootClass?: string;
|
|
30
|
+
}, "ref">) & React.RefAttributes<HTMLElement>>;
|
|
31
|
+
|
|
32
|
+
type ComboboxPrimitiveTriggerProps = {
|
|
33
|
+
children: React.ReactNode;
|
|
34
|
+
className?: string;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
type ComboboxTriggerProps = React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Trigger> & {
|
|
40
|
+
customRootClass?: string;
|
|
41
|
+
placeholder?: boolean;
|
|
42
|
+
};
|
|
43
|
+
declare const ComboboxTrigger: React.ForwardRefExoticComponent<(Omit<Omit<Omit<ComboboxPrimitiveTriggerProps & Omit<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
44
|
+
asChild?: boolean;
|
|
45
|
+
} & React.RefAttributes<HTMLElement>, "ref">, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
46
|
+
customRootClass?: string;
|
|
47
|
+
placeholder?: boolean;
|
|
48
|
+
}, "ref"> | Omit<Omit<Omit<ComboboxPrimitiveTriggerProps & Omit<React.HTMLAttributes<HTMLElement> & {
|
|
49
|
+
asChild?: boolean;
|
|
50
|
+
children?: React.ReactNode;
|
|
51
|
+
} & React.RefAttributes<HTMLElement>, "ref">, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & {
|
|
52
|
+
customRootClass?: string;
|
|
53
|
+
placeholder?: boolean;
|
|
54
|
+
}, "ref">) & React.RefAttributes<HTMLElement>>;
|
|
55
|
+
|
|
56
|
+
type ComboboxRootProps = React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Root> & {
|
|
57
|
+
customRootClass?: string;
|
|
58
|
+
};
|
|
59
|
+
declare const ComboboxRoot: React.ForwardRefExoticComponent<ComboboxRootProps & React.RefAttributes<HTMLElement>>;
|
|
60
|
+
|
|
61
|
+
declare const ComboboxIndicator: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
62
|
+
|
|
63
|
+
type ComboboxPortalProps = {
|
|
64
|
+
children: React.ReactNode;
|
|
65
|
+
container?: HTMLElement | null;
|
|
66
|
+
};
|
|
67
|
+
declare const ComboboxPortal: React.ForwardRefExoticComponent<Omit<{
|
|
68
|
+
children: React.ReactNode;
|
|
69
|
+
container?: HTMLElement | null;
|
|
70
|
+
} & _floating_ui_react.FloatingPortalProps & React.RefAttributes<never>, "ref"> & ComboboxPortalProps & React.RefAttributes<never>>;
|
|
71
|
+
|
|
72
|
+
type ComboboxPrimitiveGroupProps = {
|
|
73
|
+
children: React.ReactNode;
|
|
74
|
+
className?: string;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
type ComboboxGroupProps = {
|
|
78
|
+
children: React.ReactNode;
|
|
79
|
+
};
|
|
80
|
+
declare const ComboboxGroup: React.ForwardRefExoticComponent<Omit<ComboboxPrimitiveGroupProps & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & ComboboxGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
81
|
+
|
|
82
|
+
type ComboboxSearchProps = React.ComponentPropsWithoutRef<typeof ComboboxPrimitive.Search>;
|
|
83
|
+
declare const ComboboxSearch: React.ForwardRefExoticComponent<ComboboxSearchProps & React.RefAttributes<HTMLElement>>;
|
|
84
|
+
|
|
85
|
+
interface ComboboxComponent extends React.ForwardRefExoticComponent<React.RefAttributes<unknown>> {
|
|
86
|
+
Root: typeof ComboboxRoot;
|
|
87
|
+
Content: typeof ComboboxContent;
|
|
88
|
+
Item: typeof ComboboxItem;
|
|
89
|
+
Trigger: typeof ComboboxTrigger;
|
|
90
|
+
Portal: typeof ComboboxPortal;
|
|
91
|
+
Group: typeof ComboboxGroup;
|
|
92
|
+
Indicator: typeof ComboboxIndicator;
|
|
93
|
+
Search: typeof ComboboxSearch;
|
|
94
|
+
}
|
|
95
|
+
declare const Combobox: ComboboxComponent;
|
|
96
|
+
|
|
97
|
+
export { Combobox as default };
|
|
98
|
+
export type { ComboboxContentProps, ComboboxItemProps, ComboboxRootProps, ComboboxSearchProps, ComboboxTriggerProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import o,{useContext as e}from"react";import{jsx as r}from"react/jsx-runtime";import{C as a}from"./ComboboxPrimitive-Bn1C5dkn.js";import{c as t}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=o.createContext({rootClass:""}),n=o.forwardRef((({customRootClass:o,children:t,position:s="popper",...n},l)=>{const{rootClass:d}=e(i);return r(a.Content,{className:`${d}-content`,position:s,"data-position":s,ref:l,...n,children:t})}));n.displayName="ComboboxContent";const l=o.forwardRef((({customRootClass:o,children:t,value:s,disabled:n,...l},d)=>{const{rootClass:c}=e(i);return r(a.Item,{className:`${c}-item`,value:s,disabled:n,"data-disabled":n?"":void 0,role:"option","aria-disabled":n?"true":void 0,ref:d,...l,children:r("span",{className:`${c}-text`,children:t})})}));l.displayName="ComboboxItem";const d=o.forwardRef((({customRootClass:o,children:t,disabled:s,placeholder:n,...l},d)=>{const{rootClass:c}=e(i);return r(a.Trigger,{className:`${c}-trigger`,"aria-disabled":s?"true":void 0,"data-placeholder":n?"":void 0,disabled:s,ref:d,...l,children:t})}));d.displayName="ComboboxTrigger";const c=o.forwardRef((({customRootClass:o,children:e,defaultValue:s,value:n,onValueChange:l,shift:d,...c},m)=>{const f=t(o,"Combobox");return r(i.Provider,{value:{rootClass:f},children:r(a.Root,{className:`${f}-root`,defaultValue:s,value:n,onValueChange:l,shift:d,ref:m,...c,children:e})})}));c.displayName="ComboboxRoot";const m=o.forwardRef(((o,a)=>{const{rootClass:t}=e(i);return r("div",{className:`${t}-item-indicator`,ref:a,...o,children:r(s,{width:16,height:16})})}));m.displayName="ComboboxIndicator";const f=o.forwardRef((({children:o,container:e,...t},s)=>r(a.Portal,{ref:s,container:e,...t,children:o})));f.displayName="ComboboxPortal";const p=o.forwardRef((({children:o,...t},s)=>{const{rootClass:n}=e(i);return r(a.Group,{className:`${n}-group`,ref:s,...t,children:o})}));p.displayName="ComboboxGroup";const b=o.forwardRef(((o,t)=>{const{rootClass:s}=e(i);return r(a.Search,{className:`${s}-search`,ref:t,...o})}));b.displayName="ComboboxSearch";const u=o.forwardRef(((o,e)=>(console.warn("Direct usage of Combobox is not supported. Please use Combobox.Root, Combobox.Content, etc. instead."),null)));u.displayName="Combobox";const C=u;C.Root=c,C.Content=n,C.Item=l,C.Trigger=d,C.Portal=f,C.Group=p,C.Indicator=m,C.Search=b;export{C as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{jsx as e,Fragment as t,jsxs as n}from"react/jsx-runtime";import r,{createContext as s,useContext as a,useState as o,useEffect as i,useLayoutEffect as l}from"react";import{F as c}from"./index-yqRHPukT.js";import{P as d}from"./index-98jQ1vTr.js";import{c as u}from"./index-CXzybYmm.js";import{u as f}from"./index-wRElCyvx.js";const m=s({}),b=r.forwardRef((({children:n,className:r,...s},o)=>{const{isOpen:i,elementsRef:l,labelsRef:d,floatingContext:u,refs:f,getFloatingProps:b,floatingStyles:p}=a(m),h=c.useMergeRefs([f.setFloating,o]);return e(t,{children:i&&e(c.FocusManager,{context:u,children:e(c.FloatingList,{elementsRef:l,labelsRef:d,children:e("div",{ref:h,style:p,className:r,"data-state":i?"open":"closed",...b(),...s,children:n})})})})}));b.displayName="ComboboxPrimitiveContent";const p=s(null),h=r.forwardRef((({children:t,value:n,disabled:s,className:o,...i},l)=>{const u=a(m);if(!u)return console.error("ComboboxPrimitiveItem must be used within a ComboboxPrimitive"),null;const{handleSelect:f,isTypingRef:b,getItemProps:h,activeIndex:v,selectedIndex:R,virtualItemRef:g,selectedItemRef:x,hasSearch:I,search:C,hiddenIndices:y,disabledIndices:S,setDisabledIndices:P,valuesRef:N,bumpLabelsVersion:w}=u,M=r.useRef(null),{ref:k,index:D}=c.useListItem({label:n}),E=y.includes(D),F=v===D,L=R===D,O=n||`select-item-${D}`,T=a(p);return r.useEffect((()=>{if(T?.registerItem)return T.registerItem(O,!E)}),[T,O,E]),r.useEffect((()=>(N.current[D]=O,()=>{delete N.current[D]})),[D,O,N]),r.useEffect((()=>(w(),()=>{w()})),[D,n,w]),r.useEffect((()=>{const e=D;return P((t=>{if(s&&t.includes(e))return t;if(!s&&!t.includes(e))return t;const n=new Set(t);return s?n.add(e):n.delete(e),Array.from(n).sort(((e,t)=>e-t))})),()=>{P((t=>{if(!t.includes(e))return t;const n=new Set(t);return n.delete(e),Array.from(n).sort(((e,t)=>e-t))}))}}),[D,s,P]),r.useEffect((()=>{L&&!I&&(x.current=M.current)}),[L,I,x]),e(d.div,{ref:c.useMergeRefs([k,M,l]),id:O,role:"option",className:o,style:{display:E?"none":void 0,...i.style},"data-value":n,"data-label":n,"data-active":I?g.current?.id==O:F,"aria-selected":L,"aria-disabled":!!s||void 0,"data-disabled":s?"":void 0,...h({tabIndex:s?-1:F?0:-1,onClick:()=>!s&&f(D),onKeyDown:e=>{s||("Enter"===e.key&&(e.preventDefault(),f(D))," "!==e.key||b.current||(e.preventDefault(),f(D)))}}),...i,tabIndex:s?-1:F?0:-1,children:t})}));h.displayName="ComboboxPrimitiveItem";const v=r.forwardRef((({children:t,className:n,disabled:r,asChild:s,onClick:o,...i},l)=>{const{isOpen:f,setIsOpen:b,selectedLabel:p,refs:h,getReferenceProps:v}=a(m),{onClick:R,...g}=v(),x=u(o,(()=>{r||b((e=>!e))}));return e(d.button,{type:s?void 0:"button",className:n,"aria-expanded":f,"data-state":f?"open":"closed","aria-disabled":!!r||void 0,disabled:!!r||void 0,ref:c.useMergeRefs([h.setReference,l]),role:"combobox",asChild:s,onClick:x,...g,...i,children:p||t})}));v.displayName="ComboboxPrimitiveTrigger";const R=r.forwardRef((({children:t,className:s,value:a,name:u,defaultValue:b="",onValueChange:p,onClickOutside:h=()=>{},placement:v="bottom-start",offsetValue:R,shift:g=!0,...x},I)=>{const[C,y]=r.useState(!1),[S,P]=r.useState(R),[N,w]=f(a,b,p),M=r.useRef(null),k=r.useRef([]),D=r.useRef([]),E=r.useRef([]),[F,L]=r.useState([]),O=r.useRef(!1),T=r.useRef(null),V=r.useRef(null),[j,A]=r.useState(null),[B,G]=r.useState(null),[H,K]=r.useState(!1),[q,z]=r.useState(""),[$,J]=r.useReducer((e=>e+1),0),Q=r.useMemo((()=>{if(!q)return[];const e=[];for(let t=0;t<D.current.length;t++){const n=D.current[t];n&&!n.toLowerCase().includes(q.toLowerCase())&&e.push(t)}return e}),[q,$]),U=r.useMemo((()=>{const e=new Set([...F,...Q]);return Array.from(e).sort(((e,t)=>e-t))}),[F,Q]),W=function(e){const[t,n]=o(!1);return i((()=>{if(!e)return void n(!1);let t=e;for(;t;){if("FORM"===t.tagName)return void n(!0);t=t.parentElement}n(!1)}),[e]),t}(T.current),{refs:X,floatingStyles:Y,context:Z}=c.useFloating({middleware:[c.offset(S)],open:C,onOpenChange:y,placement:v}),_=c.useClick(Z),ee=c.useDismiss(Z),te=c.useRole(Z,{role:"listbox"});const ne=r.useCallback((e=>{if(null!==e&&!U.includes(e)&&(G(e),y(!1),X.reference.current?.focus(),null!==e)){const t=D.current[e];t&&w(t)}}),[U,D,G,y,w,X]),re=c.useListNavigation(Z,{listRef:k,activeIndex:j,selectedIndex:B,onNavigate:A,virtual:H,virtualItemRef:V,disabledIndices:U}),se=c.useTypeahead(Z,{listRef:D,activeIndex:j,selectedIndex:B,enabled:!H,onMatch:function(e){null===e||U.includes(e)||(C?A(e):ne(e))},onTypingChange(e){O.current=e}}),{getReferenceProps:ae,getFloatingProps:oe,getItemProps:ie}=c.useInteractions([_,ee,te,re,se]);l((()=>{if(g&&M&&X.floating.current&&M.current){const e=X.floating.current.getBoundingClientRect(),t=M.current.getBoundingClientRect(),n=e.top-t.bottom;P(n)}}),[M.current,g]);const le=r.useMemo((()=>({isOpen:C,setIsOpen:y,handleSelect:ne,floatingContext:Z,refs:X,getFloatingProps:oe,getReferenceProps:ae,floatingStyles:Y,getItemProps:ie,activeIndex:j,selectedIndex:B,elementsRef:k,labelsRef:D,valuesRef:E,disabledIndices:F,setDisabledIndices:L,setActiveIndex:A,selectedLabel:N,isTypingRef:O,virtualItemRef:V,hasSearch:H,setHasSearch:K,search:q,setSearch:z,hiddenIndices:Q,selectedItemRef:M,labelsVersion:$,bumpLabelsVersion:J})),[C,ne,Z,X,oe,ae,Y,ie,j,B,F,N,H,q,Q,$]);return e(m.Provider,{value:le,children:n(d.div,{...x,className:s,ref:c.useMergeRefs([T,I]),"data-state":C?"open":"closed",children:[t,W&&e("select",{name:u,value:N,hidden:!0,"aria-hidden":"true",tabIndex:-1,onChange:()=>{},children:e("option",{value:N,children:N})})]})})}));R.displayName="ComboboxPrimitiveRoot";const g=r.forwardRef((({children:t,container:n,...r},s)=>{const{isOpen:l}=a(m),[d,u]=o(!1),f=n||document.querySelector("#rad-ui-theme-container")||document.body;return i((()=>{f&&u(!0)}),[f]),l&&d?e(c.Portal,{root:f,...r,children:t}):null}));g.displayName="ComboboxPrimitivePortal";const x=r.forwardRef((({children:t,className:n,...s},a)=>{const[o,i]=r.useState(new Set),{search:l}=r.useContext(m),c=r.useCallback(((e,t)=>(i((n=>{if(t&&n.has(e))return n;if(!t&&!n.has(e))return n;const r=new Set(n);return t?r.add(e):r.delete(e),r})),()=>{i((t=>{if(!t.has(e))return t;const n=new Set(t);return n.delete(e),n}))})),[]),d=o.size>0,u=""!==l&&!d,f=r.useMemo((()=>({registerItem:c})),[c]);return e(p.Provider,{value:f,children:e("div",{className:n,ref:a,...s,style:{display:u?"none":void 0,...s.style},children:t})})}));x.displayName="ComboboxPrimitiveGroup";const I=r.forwardRef((({className:t,...n},s)=>{const o=a(m),{refs:i,handleSelect:l,labelsRef:u,valuesRef:f,activeIndex:b,elementsRef:p,virtualItemRef:h,getReferenceProps:v,setHasSearch:R,search:g,setSearch:x,setActiveIndex:I}=o,C=r.useRef(null);r.useEffect((()=>(R(!0),I(0),()=>{R(!1),x("")})),[R,I,x]);const y=v();return e(d.input,{type:"search",className:t,placeholder:"Search...",ref:c.useMergeRefs([C,s]),value:g,"aria-activedescendant":h.current?.id||(null!==b&&f.current[b]?f.current[b]:void 0),onChange:e=>x(e.target.value),...y,onKeyDown:e=>{null!==b&&"Enter"===e.key&&(e.preventDefault(),l(b))},...n})}));I.displayName="ComboboxPrimitiveSearch";const C=r.forwardRef(((e,t)=>(console.warn("Direct usage of Combobox is not supported. Please use Combobox.Root, Combobox.Content, etc. instead."),null)));C.displayName="ComboboxPrimitive";const y=C;y.Root=R,y.Content=b,y.Portal=g,y.Item=h,y.Trigger=v,y.Group=x,y.Search=I;export{y as C};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import React, { ComponentPropsWithoutRef, ElementRef } from 'react';
|
|
2
|
+
import MenuPrimitive from '~/core/primitives/Menu/MenuPrimitive';
|
|
2
3
|
import * as _floating_ui_react from '@floating-ui/react';
|
|
3
4
|
import Primitive from '~/core/primitives/Primitive';
|
|
4
5
|
|
|
6
|
+
type ContextMenuRootProps = {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
customRootClass?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
} & ComponentPropsWithoutRef<typeof MenuPrimitive.Root>;
|
|
5
11
|
declare const ContextMenuRoot: React.ForwardRefExoticComponent<{
|
|
6
12
|
children: React.ReactNode;
|
|
7
13
|
customRootClass?: string;
|
|
@@ -26,6 +32,10 @@ type MenuPrimitiveTriggerProps = {
|
|
|
26
32
|
asChild?: boolean;
|
|
27
33
|
};
|
|
28
34
|
|
|
35
|
+
type ContextMenuTriggerProps = {
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
className?: string;
|
|
38
|
+
} & ComponentPropsWithoutRef<typeof MenuPrimitive.Trigger>;
|
|
29
39
|
declare const ContextMenuTrigger: React.ForwardRefExoticComponent<{
|
|
30
40
|
children: React.ReactNode;
|
|
31
41
|
className?: string;
|
|
@@ -36,11 +46,18 @@ type MenuPrimitiveContentProps = {
|
|
|
36
46
|
className?: string;
|
|
37
47
|
};
|
|
38
48
|
|
|
49
|
+
type ContextMenuContentProps = {
|
|
50
|
+
children: React.ReactNode;
|
|
51
|
+
className?: string;
|
|
52
|
+
} & ComponentPropsWithoutRef<typeof MenuPrimitive.Content>;
|
|
39
53
|
declare const ContextMenuContent: React.ForwardRefExoticComponent<{
|
|
40
54
|
children: React.ReactNode;
|
|
41
55
|
className?: string;
|
|
42
56
|
} & Omit<MenuPrimitiveContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
43
57
|
|
|
58
|
+
type ContextMenuPortalProps = {
|
|
59
|
+
children: React.ReactNode;
|
|
60
|
+
} & ComponentPropsWithoutRef<typeof MenuPrimitive.Portal>;
|
|
44
61
|
declare const ContextMenuPortal: React.ForwardRefExoticComponent<{
|
|
45
62
|
children: React.ReactNode;
|
|
46
63
|
} & Omit<{
|
|
@@ -56,12 +73,21 @@ type MenuPrimitiveItemProps = {
|
|
|
56
73
|
onSelect?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
57
74
|
};
|
|
58
75
|
|
|
76
|
+
type ContextMenuItemProps = {
|
|
77
|
+
children: React.ReactNode;
|
|
78
|
+
className?: string;
|
|
79
|
+
label?: string;
|
|
80
|
+
} & ComponentPropsWithoutRef<typeof MenuPrimitive.Item>;
|
|
59
81
|
declare const ContextMenuItem: React.ForwardRefExoticComponent<{
|
|
60
82
|
children: React.ReactNode;
|
|
61
83
|
className?: string;
|
|
62
84
|
label?: string;
|
|
63
85
|
} & Omit<MenuPrimitiveItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
64
86
|
|
|
87
|
+
type ContextMenuSubProps = {
|
|
88
|
+
children: React.ReactNode;
|
|
89
|
+
className?: string;
|
|
90
|
+
} & ComponentPropsWithoutRef<typeof MenuPrimitive.Sub>;
|
|
65
91
|
declare const ContextMenuSub: React.ForwardRefExoticComponent<{
|
|
66
92
|
children: React.ReactNode;
|
|
67
93
|
className?: string;
|
|
@@ -85,6 +111,10 @@ declare const ContextMenuSub: React.ForwardRefExoticComponent<{
|
|
|
85
111
|
rtl?: boolean;
|
|
86
112
|
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
87
113
|
|
|
114
|
+
type ContextMenuSubTriggerProps = {
|
|
115
|
+
children: React.ReactNode;
|
|
116
|
+
className?: string;
|
|
117
|
+
} & ComponentPropsWithoutRef<typeof MenuPrimitive.Trigger>;
|
|
88
118
|
declare const ContextMenuSubTrigger: React.ForwardRefExoticComponent<{
|
|
89
119
|
children: React.ReactNode;
|
|
90
120
|
className?: string;
|
|
@@ -119,4 +149,4 @@ type ContextMenuComponent = React.ForwardRefExoticComponent<ContextMenuProps & R
|
|
|
119
149
|
declare const ContextMenu: ContextMenuComponent;
|
|
120
150
|
|
|
121
151
|
export { ContextMenu as default };
|
|
122
|
-
export type { ContextMenuElement, ContextMenuProps };
|
|
152
|
+
export type { ContextMenuContentProps, ContextMenuElement, ContextMenuItemProps, ContextMenuPortalProps, ContextMenuProps, ContextMenuRootProps, ContextMenuSeparatorProps, ContextMenuSubProps, ContextMenuSubTriggerProps, ContextMenuTriggerProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import e,{forwardRef as t}from"react";import{
|
|
1
|
+
'use client';import e,{forwardRef as t}from"react";import{jsx as n}from"react/jsx-runtime";import{M as o}from"./MenuPrimitive-6Qr46BSn.js";import{c as s}from"./index-6If6D2Zi.js";import{c as r}from"./clsx-BaVHROc5.js";import{u}from"./index-wRElCyvx.js";import{u as l}from"./floating-ui.react-DMgxgTKq.js";import a from"./Separator.js";import"./index-yqRHPukT.js";import"./index-98jQ1vTr.js";import"./index-BOy86lYu.js";import"react-dom";const i=e.createContext(null),c="ContextMenu",C=t((({children:t,customRootClass:l,className:a,open:C,defaultOpen:d=!1,onOpenChange:m,...x},p)=>{const[f,h]=u(C,d,m),[M,g]=e.useState({x:0,y:0}),N=s(l,c);return n(i.Provider,{value:{rootClass:N,setCoords:g,setIsOpen:h},children:n(o.Root,{ref:p,className:r(`${N}-root`,a),mainAxisOffset:-M.y,crossAxisOffset:M.x,open:f,onOpenChange:h,...x,children:t})})}));C.displayName=c;const d=t((({children:t,className:s,...u},a)=>{const c=e.useContext(i),C=e.useRef(null),d=l([C,a]);if(!c)return console.warn("ContextMenuTrigger should be used in the ContextMenuRoot"),null;const{rootClass:m,setCoords:x,setIsOpen:p}=c;return n(o.Trigger,{className:r(`${m}-trigger`,s),asChild:!0,...u,children:n("span",{ref:d,onContextMenu:e=>{if(e.preventDefault(),!C.current)return;const t=C.current.getBoundingClientRect(),n=e.clientX-t.left,o=t.bottom-e.clientY;x({x:n,y:o}),p(!0)},onKeyDown:e=>{if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){if(e.preventDefault(),!C.current)return;const t=C.current.getBoundingClientRect(),n=t.left+t.width/2,o=t.top+t.height/2;x({x:n,y:o}),p(!0)}},onClick:e=>{e.preventDefault()},role:"button",tabIndex:0,"aria-haspopup":"menu",children:t})})}));d.displayName="ContextMenuTrigger";const m=t((({children:t,className:s,...u},l)=>{const a=e.useContext(i);if(!a)return console.warn("ContextMenuContent should be used in the ContextMenuRoot"),null;const{rootClass:c}=a;return n(o.Content,{ref:l,className:r(`${c}-content`,s),...u,children:t})}));m.displayName="ContextMenuContent";const x=t((({children:t,...s},r)=>{const u=e.useContext(i);if(!u)return console.warn("ContextMenuPortal should be used in the ContextMenuRoot"),null;const{rootClass:l}=u;return n(o.Portal,{ref:r,...s,children:t})}));x.displayName="ContextMenuPortal";const p=t((({children:t,className:s,label:u,...l},a)=>{const c=e.useContext(i);if(!c)return console.warn("ContextMenuItem should be used in the ContextMenuRoot"),null;const{rootClass:C}=c;return n(o.Item,{ref:a,className:r(`${C}-item`,s),label:u,...l,children:t})}));p.displayName="ContextMenuItem";const f=t((({children:t,className:s,...u},l)=>{const a=e.useContext(i);if(!a)return console.warn("ContextMenuSub should be used in the ContextMenuRoot"),null;const{rootClass:c}=a;return n(o.Sub,{ref:l,className:r(`${c}-sub`,s),...u,children:t})}));f.displayName="ContextMenuSub";const h=t((({children:t,className:s,...u},l)=>{const a=e.useContext(i);if(!a)return console.warn("ContextMenuSubTrigger should be used in the ContextMenuRoot"),null;const{rootClass:c}=a;return n(o.Trigger,{ref:l,className:r(`${c}-sub-trigger`,s),...u,children:t})}));h.displayName="ContextMenuSubTrigger";const M=t((({className:t,...o},s)=>{const r=e.useContext(i);if(!r)return console.warn("ContextMenuSeparator should be used within ContextMenuRoot"),null;const{rootClass:u}=r;return n(a,{ref:s,customRootClass:u,className:t,...o})}));M.displayName="ContextMenuSeparator";const g=t(((e,t)=>(console.warn("Direct usage of ContextMenu is not supported. Please use ContextMenu.Root, ContextMenu.Item instead."),null)));g.displayName="ContextMenu",g.Root=C,g.Trigger=d,g.Content=m,g.Portal=x,g.Item=p,g.Sub=f,g.SubTrigger=h,g.Separator=M;export{g as default};
|
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { ComponentPropsWithoutRef } from 'react';
|
|
3
3
|
|
|
4
4
|
interface DataListRootProps extends ComponentPropsWithoutRef<'div'> {
|
|
5
5
|
customRootClass?: string;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
type DataListItemProps = ComponentPropsWithoutRef<'div'>;
|
|
9
|
+
|
|
10
|
+
type DataListLabelProps = ComponentPropsWithoutRef<'dt'>;
|
|
11
|
+
|
|
12
|
+
type DataListValueProps = ComponentPropsWithoutRef<'dd'>;
|
|
13
|
+
|
|
8
14
|
declare const DataList: {
|
|
9
15
|
(): null;
|
|
10
|
-
Root:
|
|
11
|
-
Item:
|
|
12
|
-
Label:
|
|
13
|
-
Value:
|
|
16
|
+
Root: React.ForwardRefExoticComponent<DataListRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
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>>;
|
|
19
|
+
Value: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
14
20
|
};
|
|
15
21
|
|
|
16
22
|
export { DataList as default };
|
|
23
|
+
export type { DataListItemProps, DataListLabelProps, DataListRootProps, DataListValueProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
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};
|