@radui/ui 0.0.47 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -4
- package/dist/components/Accordion.d.ts +23 -40
- package/dist/components/Accordion.js +1 -1
- package/dist/components/AlertDialog.d.ts +79 -25
- package/dist/components/AlertDialog.js +1 -1
- package/dist/components/AspectRatio.d.ts +6 -9
- package/dist/components/AspectRatio.js +1 -1
- package/dist/components/Avatar.d.ts +9 -17
- package/dist/components/Avatar.js +1 -1
- package/dist/components/AvatarGroup.d.ts +21 -17
- package/dist/components/AvatarGroup.js +1 -1
- package/dist/components/AvatarPrimitiveFallback-BV0bK5Qg.js +1 -0
- package/dist/components/Badge.d.ts +7 -5
- package/dist/components/Badge.js +1 -1
- package/dist/components/BlockQuote.d.ts +7 -8
- package/dist/components/BlockQuote.js +1 -1
- package/dist/components/Button.d.ts +15 -6
- package/dist/components/Button.js +1 -1
- package/dist/components/Callout.d.ts +24 -29
- package/dist/components/Callout.js +1 -1
- package/dist/components/Card.d.ts +7 -15
- package/dist/components/Card.js +1 -1
- package/dist/components/Checkbox.d.ts +27 -17
- package/dist/components/Checkbox.js +1 -1
- package/dist/components/CheckboxCards.d.ts +28 -31
- package/dist/components/CheckboxCards.js +1 -1
- package/dist/components/CheckboxGroup.d.ts +31 -31
- package/dist/components/CheckboxGroup.js +1 -1
- package/dist/components/CheckboxGroupPrimitive-DrGqSxi3.js +1 -0
- package/dist/components/Code.d.ts +7 -3
- package/dist/components/Code.js +1 -1
- package/dist/components/Collapsible.d.ts +16 -22
- package/dist/components/Collapsible.js +1 -1
- package/dist/components/ContextMenu.d.ts +78 -35
- package/dist/components/ContextMenu.js +1 -1
- package/dist/components/DataList.d.ts +9 -17
- package/dist/components/DataList.js +1 -1
- package/dist/components/Dialog.d.ts +78 -32
- package/dist/components/Dialog.js +1 -1
- package/dist/components/Disclosure.d.ts +20 -26
- package/dist/components/Disclosure.js +1 -1
- package/dist/components/DropdownMenu.d.ts +78 -35
- package/dist/components/DropdownMenu.js +1 -1
- package/dist/components/Em.d.ts +5 -9
- package/dist/components/Em.js +1 -1
- package/dist/components/Heading.d.ts +7 -275
- package/dist/components/Heading.js +1 -1
- package/dist/components/HoverCard.d.ts +34 -33
- package/dist/components/HoverCard.js +1 -1
- package/dist/components/Kbd.d.ts +6 -8
- package/dist/components/Kbd.js +1 -1
- package/dist/components/Link.d.ts +6 -12
- package/dist/components/Link.js +1 -1
- package/dist/components/MenuPrimitive-DuUPySFO.js +1 -0
- package/dist/components/Menubar.d.ts +68 -45
- package/dist/components/Menubar.js +1 -1
- package/dist/components/Minimap.d.ts +48 -0
- package/dist/components/Minimap.js +1 -0
- package/dist/components/NavigationMenu.d.ts +35 -0
- package/dist/components/NavigationMenu.js +1 -0
- package/dist/components/NumberField.d.ts +17 -37
- package/dist/components/NumberField.js +1 -1
- package/dist/components/Progress.d.ts +22 -19
- package/dist/components/Progress.js +1 -1
- package/dist/components/Quote.d.ts +4 -8
- package/dist/components/Quote.js +1 -1
- package/dist/components/Radio.d.ts +11 -4
- package/dist/components/Radio.js +1 -1
- package/dist/components/RadioCards.d.ts +32 -35
- package/dist/components/RadioCards.js +1 -1
- package/dist/components/RadioGroup.d.ts +34 -37
- package/dist/components/RadioGroup.js +1 -1
- package/dist/components/RadioGroupPrimitive-D9grAL7G.js +1 -0
- package/dist/components/ScrollArea.d.ts +22 -14
- package/dist/components/ScrollArea.js +1 -1
- package/dist/components/Select.d.ts +69 -16
- package/dist/components/Select.js +1 -1
- package/dist/components/Separator.d.ts +5 -9
- package/dist/components/Separator.js +1 -1
- package/dist/components/Skeleton.d.ts +8 -7
- package/dist/components/Skeleton.js +1 -1
- package/dist/components/Slider.d.ts +78 -26
- package/dist/components/Slider.js +1 -1
- package/dist/components/Splitter.d.ts +57 -0
- package/dist/components/Splitter.js +1 -0
- package/dist/components/Steps.d.ts +38 -0
- package/dist/components/Steps.js +1 -0
- package/dist/components/Strong.d.ts +6 -7
- package/dist/components/Strong.js +1 -1
- package/dist/components/Switch.d.ts +28 -6
- package/dist/components/Switch.js +1 -1
- package/dist/components/TabNav.d.ts +15 -25
- package/dist/components/TabNav.js +1 -1
- package/dist/components/Table.d.ts +23 -27
- package/dist/components/Table.js +1 -1
- package/dist/components/Tabs.d.ts +23 -44
- package/dist/components/Tabs.js +1 -1
- package/dist/components/Text.d.ts +8 -274
- package/dist/components/Text.js +1 -1
- package/dist/components/TextArea.d.ts +9 -14
- package/dist/components/TextArea.js +1 -1
- package/dist/components/Theme.d.ts +9 -5
- package/dist/components/Theme.js +1 -1
- package/dist/components/Toggle.d.ts +8 -19
- package/dist/components/Toggle.js +1 -1
- package/dist/components/ToggleGroup.d.ts +55 -34
- package/dist/components/ToggleGroup.js +1 -1
- package/dist/components/Tooltip.d.ts +31 -18
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/Tree.d.ts +31 -14
- package/dist/components/Tree.js +1 -1
- package/dist/components/VisuallyHidden.d.ts +6 -10
- package/dist/components/VisuallyHidden.js +1 -1
- package/dist/components/{floating-ui.react-jh3caJnc.js → floating-ui.react-CLbXmKZY.js} +2 -2
- package/dist/components/index-BRmT6kl7.js +1 -0
- package/dist/components/index-Bf4LVEjJ.js +1 -0
- package/dist/components/index-BtoPzkH9.js +1 -0
- package/dist/components/index-DBZNt4Em.js +1 -0
- package/dist/components/index-Dc5Cm9z0.js +1 -0
- package/dist/components/index-Di6TooPD.js +1 -0
- package/dist/components/{index-8D8A0ALD.js → index-DnCiOYxZ.js} +1 -1
- package/dist/components/index-XqbKa2D2.js +1 -0
- package/dist/components/index-YgKcfT__.js +1 -0
- package/dist/themes/default.css +1 -1
- package/package.json +21 -3
- package/dist/components/AvatarPrimitiveFallback-CSD78PQE.js +0 -1
- package/dist/components/CheckboxGroupPrimitive-PcT11bev.js +0 -1
- package/dist/components/MenuPrimitive-M690K2sI.js +0 -1
- package/dist/components/RadioGroupPrimitive-CUgW2PyL.js +0 -1
- package/dist/components/index-BNg6qXF-.js +0 -1
- package/dist/components/index-CaFVBHZz.js +0 -1
- package/dist/components/index-CyT0hgZn.js +0 -1
- package/dist/components/index-DAboJYKJ.js +0 -1
- package/dist/components/index-DIw4zyNG.js +0 -1
- package/dist/components/index-DpUtikes.js +0 -1
- package/dist/components/index-ZMIfeyHL.js +0 -1
- package/dist/components/setupTests.d.ts +0 -3
package/dist/components/Text.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{_ as s,a}from"./tslib.es6-BtVxab8e.js";import e from"react";import{c as
|
|
1
|
+
'use client';import{_ as s,a}from"./tslib.es6-BtVxab8e.js";import e,{forwardRef as o}from"react";import{c as r}from"./index-BVxS3Ixi.js";import{c as t}from"./clsx-BaVHROc5.js";var i="Text",l=["div","span","p","label"],m=o((function(o,m){var c=o.children,d=o.customRootClass,p=void 0===d?"":d,n=o.className,f=void 0===n?"":n,u=o.as,v=void 0===u?"p":u,x=s(o,["children","customRootClass","className","as"]),N=r(p,i);return l.includes(v)||(v="p"),e.createElement(v,a({ref:m,className:t(N,f)},x),c)}));m.displayName=i;export{m as default};
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
children: React.ReactNode;
|
|
3
|
+
declare const TextAreaRoot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
5
4
|
customRootClass?: string;
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
|
|
7
|
+
declare const TextAreaInput: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
8
8
|
|
|
9
|
-
type TextAreaProps = {
|
|
10
|
-
children: React.ReactNode;
|
|
9
|
+
type TextAreaProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
11
10
|
customRootClass?: string;
|
|
12
|
-
className?: string;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
children: React.ReactNode;
|
|
18
|
-
placeholder?: string;
|
|
19
|
-
}) => React.JSX.Element;
|
|
20
|
-
Root: ({ children, customRootClass, className }: TextAreaProps$1) => React.JSX.Element;
|
|
12
|
+
type TextAreaComponent = React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<React.ElementRef<'div'>>> & {
|
|
13
|
+
Input: typeof TextAreaInput;
|
|
14
|
+
Root: typeof TextAreaRoot;
|
|
21
15
|
};
|
|
16
|
+
declare const TextArea: TextAreaComponent;
|
|
22
17
|
|
|
23
18
|
export { TextArea as default };
|
|
24
19
|
export type { TextAreaProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{_ as e}from"./tslib.es6-BtVxab8e.js";import
|
|
1
|
+
'use client';import{_ as e,a}from"./tslib.es6-BtVxab8e.js";import r from"react";import{c as t}from"./clsx-BaVHROc5.js";import{c as o}from"./index-BVxS3Ixi.js";var s="TextArea",l=r.forwardRef((function(l,c){var d=l.children,i=l.customRootClass,m=void 0===i?"":i,n=l.className,f=void 0===n?"":n,u=e(l,["children","customRootClass","className"]),p=o(m,s);return r.createElement("div",a({ref:c,className:t(p,f)},u),d)}));l.displayName=s;var c=r.forwardRef((function(t,o){var s=t.children,l=t.placeholder,c=void 0===l?"":l,d=e(t,["children","placeholder"]);return r.createElement("textarea",a({ref:o,placeholder:c,defaultValue:"string"==typeof s?s:void 0},d))}));c.displayName="TextAreaInput";var d=r.forwardRef((function(o,s){var d=o.customRootClass,i=void 0===d?"":d,m=o.className,n=void 0===m?"":m,f=o.children,u=e(o,["customRootClass","className","children"]);return r.createElement(l,a({ref:s,customRootClass:i,className:t(n)},u),r.createElement(c,{placeholder:"enter text"},f),f)}));d.displayName="TextArea",d.Input=c,d.Root=l;export{d as default};
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
|
|
3
|
-
type ThemeProps = {
|
|
3
|
+
type ThemeProps = ComponentPropsWithoutRef<'div'> & {
|
|
4
4
|
appearance?: 'light' | 'dark' | 'system';
|
|
5
5
|
accentColor?: string;
|
|
6
6
|
radius?: string;
|
|
7
7
|
scaling?: string;
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
id?: string;
|
|
10
8
|
};
|
|
11
|
-
declare const Theme:
|
|
9
|
+
declare const Theme: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
10
|
+
appearance?: "light" | "dark" | "system";
|
|
11
|
+
accentColor?: string;
|
|
12
|
+
radius?: string;
|
|
13
|
+
scaling?: string;
|
|
14
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
15
|
|
|
13
16
|
export { Theme as default };
|
|
17
|
+
export type { ThemeProps };
|
package/dist/components/Theme.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{_ as a,a as
|
|
1
|
+
'use client';import{_ as a,a as e}from"./tslib.es6-BtVxab8e.js";import r,{forwardRef as i,useState as t,useEffect as n}from"react";var d=i((function(i,d){var c=i.appearance,o=void 0===c?"system":c,s=i.id,u=void 0===s?"rad-ui-theme-container":s,m=i.accentColor,l=void 0===m?"":m,h=i.radius,f=void 0===h?"":h,v=i.scaling,p=void 0===v?"":v,g=i.children,y=a(i,["appearance","id","accentColor","radius","scaling","children"]),k=t(o),E=k[0],w=k[1],C=t(l),L=C[0],b=C[1],j=t(f),x=j[0],M=j[1],N=t(p),T=N[0],_=N[1];return n((function(){var a=window.matchMedia("(prefers-color-scheme: dark)"),e=function(a){"system"===o&&w(a.matches?"dark":"light")};return"system"===o?(w(a.matches?"dark":"light"),a.addEventListener("change",e)):w(o),function(){return a.removeEventListener("change",e)}}),[o]),n((function(){l&&b(l)}),[l]),n((function(){f&&M(f)}),[f]),n((function(){p&&_(p)}),[p]),r.createElement("div",e({ref:d,id:u,"data-rad-ui-theme":E,"data-rad-ui-accent-color":L,"data-rad-ui-radius":x,"data-rad-ui-scaling":T},y),g)}));d.displayName="Theme";export{d as default};
|
|
@@ -1,45 +1,34 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import TogglePrimitive from '~/core/primitives/Toggle';
|
|
2
3
|
|
|
4
|
+
type ToggleElement = React.ElementRef<typeof TogglePrimitive>;
|
|
3
5
|
/**
|
|
4
6
|
* Props for the Toggle component
|
|
5
|
-
* @typedef ToggleProps
|
|
6
7
|
*/
|
|
7
|
-
|
|
8
|
-
/** Initial state when in uncontrolled mode */
|
|
9
|
-
defaultPressed?: boolean;
|
|
10
|
-
/** Current pressed state (for controlled mode) */
|
|
11
|
-
pressed?: boolean;
|
|
8
|
+
interface ToggleProps extends Omit<React.ComponentPropsWithoutRef<typeof TogglePrimitive>, 'onPressedChange'> {
|
|
12
9
|
/** Optional custom root class name to override default styling */
|
|
13
10
|
customRootClass?: string;
|
|
14
|
-
/** Whether the toggle is disabled */
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
/** Content to render inside the toggle */
|
|
17
|
-
children?: React.ReactNode;
|
|
18
|
-
/** Additional class names to apply */
|
|
19
|
-
className?: string;
|
|
20
11
|
/** Accent color for the toggle */
|
|
21
12
|
color?: string;
|
|
22
13
|
/** Callback fired when toggle state changes */
|
|
23
14
|
onPressedChange: (isPressed: boolean) => void;
|
|
24
|
-
|
|
25
|
-
asChild?: boolean;
|
|
26
|
-
};
|
|
15
|
+
}
|
|
27
16
|
/**
|
|
28
17
|
* Toggle component that can be used in either controlled or uncontrolled mode.
|
|
29
18
|
*
|
|
30
19
|
* @example
|
|
31
20
|
* // Controlled mode
|
|
32
21
|
* const [pressed, setPressed] = useState(false);
|
|
33
|
-
* <Toggle pressed={pressed}
|
|
22
|
+
* <Toggle pressed={pressed} onPressedChange={setPressed}>Toggle Me</Toggle>
|
|
34
23
|
*
|
|
35
24
|
* @example
|
|
36
25
|
* // Uncontrolled mode
|
|
37
|
-
* <Toggle defaultPressed={false}
|
|
26
|
+
* <Toggle defaultPressed={false} onPressedChange={(isPressed) => console.log(isPressed)}>Toggle Me</Toggle>
|
|
38
27
|
*
|
|
39
28
|
* @param {ToggleProps} props - The component props
|
|
40
29
|
* @returns {JSX.Element} The Toggle component
|
|
41
30
|
*/
|
|
42
|
-
declare const Toggle: React.
|
|
31
|
+
declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
43
32
|
|
|
44
33
|
export { Toggle as default };
|
|
45
|
-
export type { ToggleProps };
|
|
34
|
+
export type { ToggleElement, ToggleProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{_ as s,a as e}from"./tslib.es6-BtVxab8e.js";import a from"react";import{c as
|
|
1
|
+
'use client';import{_ as s,a as e}from"./tslib.es6-BtVxab8e.js";import a,{forwardRef as o}from"react";import{c as d}from"./clsx-BaVHROc5.js";import{c as r}from"./index-BVxS3Ixi.js";import{u as i}from"./index-fkj4Fdgt.js";import{T as t}from"./index-YgKcfT__.js";import"./index-DnCiOYxZ.js";import"./index-Dc5Cm9z0.js";import"./index-DBZNt4Em.js";var l="Toggle",m=o((function(o,m){var n=o.defaultPressed,c=void 0!==n&&n,p=o.customRootClass,f=void 0===p?"":p,u=o.children,h=o.className,j=void 0===h?"":h,v=o.color,x=void 0===v?"":v,C=o.pressed,g=o.onPressedChange,P=o.asChild,N=void 0!==P&&P,b=s(o,["defaultPressed","customRootClass","children","className","color","pressed","onPressedChange","asChild"]),R=i(C,c,g),T=R[0],y=R[1],E=r(f,l),_={};return x&&(_["data-rad-ui-accent-color"]=x),a.createElement(t,e({ref:m,className:d(E,j),pressed:T,onPressedChange:y,"data-state":T?"on":"off","data-disabled":b.disabled?"":void 0,asChild:N},b,_),u)}));m.displayName=l;export{m as default};
|
|
@@ -1,42 +1,63 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import TogglePrimitive from '~/core/primitives/Toggle';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
/**
|
|
4
|
+
declare const ToggleGroupRoot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
5
|
+
/** Selection mode - 'single' allows only one item to be selected, 'multiple' allows many */
|
|
6
|
+
type?: "single" | "multiple";
|
|
7
|
+
/** Additional CSS class names to apply */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Whether focus should loop from last to first and vice versa */
|
|
10
|
+
loop?: boolean;
|
|
11
|
+
/** Orientation of the toggle group - affects keyboard navigation */
|
|
12
|
+
orientation?: "horizontal" | "vertical";
|
|
13
|
+
/** Custom root class name to override default styling */
|
|
14
|
+
customRootClass?: string;
|
|
15
|
+
/** Current value or values for the toggle group (controlled mode) */
|
|
12
16
|
value?: any;
|
|
13
|
-
/**
|
|
17
|
+
/** Initial value or values for the toggle group (uncontrolled mode) */
|
|
18
|
+
defaultValue?: any;
|
|
19
|
+
/** Callback fired when value changes */
|
|
20
|
+
onValueChange?: (value: any) => void;
|
|
21
|
+
/** Accent color for the toggle group */
|
|
22
|
+
color?: string;
|
|
23
|
+
/** Whether the toggle group is disabled */
|
|
14
24
|
disabled?: boolean;
|
|
15
|
-
/**
|
|
25
|
+
/** Text direction */
|
|
26
|
+
dir?: "ltr" | "rtl";
|
|
27
|
+
/** Whether to enable roving focus */
|
|
28
|
+
rovingFocus?: boolean;
|
|
29
|
+
/** Whether to render as a child element instead of a div */
|
|
16
30
|
asChild?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
}
|
|
31
|
+
/** Child elements */
|
|
32
|
+
children?: React.ReactNode;
|
|
33
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
|
|
35
|
+
interface ToggleItemProps extends React.ComponentPropsWithoutRef<typeof TogglePrimitive> {
|
|
36
|
+
/** Value associated with this toggle item, used for selection state */
|
|
37
|
+
value?: any;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Individual toggle item to be used within a ToggleGroup.
|
|
41
|
+
* Receives context from ToggleGroupRoot for selection state management
|
|
42
|
+
* and uses RovingFocusGroup.Item for keyboard navigation.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* <ToggleGroup.Root>
|
|
46
|
+
* <ToggleItem value="bold">B</ToggleItem>
|
|
47
|
+
* <ToggleItem value="italic">I</ToggleItem>
|
|
48
|
+
* </ToggleGroup.Root>
|
|
49
|
+
*
|
|
50
|
+
* @param {ToggleItemProps} props - Component props
|
|
51
|
+
* @returns {JSX.Element} The ToggleItem component
|
|
52
|
+
*/
|
|
53
|
+
declare const ToggleItem: React.ForwardRefExoticComponent<ToggleItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
20
54
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
loop?: boolean;
|
|
27
|
-
orientation?: "horizontal" | "vertical";
|
|
28
|
-
customRootClass?: string;
|
|
29
|
-
value?: any;
|
|
30
|
-
defaultValue?: any;
|
|
31
|
-
onValueChange?: (value: any) => void;
|
|
32
|
-
color?: string;
|
|
33
|
-
disabled?: boolean;
|
|
34
|
-
dir?: "ltr" | "rtl";
|
|
35
|
-
rovingFocus?: boolean;
|
|
36
|
-
asChild?: boolean;
|
|
37
|
-
children?: React.ReactNode;
|
|
38
|
-
}>;
|
|
39
|
-
Item: ({ children, className, value, disabled, asChild, ...props }: ToggleItemProps) => React$1.JSX.Element;
|
|
55
|
+
type ToggleGroupElement = React.ElementRef<'div'>;
|
|
56
|
+
type ToggleGroupProps = React.ComponentPropsWithoutRef<'div'>;
|
|
57
|
+
type ToggleGroupComponent = React.ForwardRefExoticComponent<ToggleGroupProps & React.RefAttributes<ToggleGroupElement>> & {
|
|
58
|
+
Root: typeof ToggleGroupRoot;
|
|
59
|
+
Item: typeof ToggleItem;
|
|
40
60
|
};
|
|
61
|
+
declare const ToggleGroup: ToggleGroupComponent;
|
|
41
62
|
|
|
42
63
|
export { ToggleGroup as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import
|
|
1
|
+
'use client';import e,{createContext as o,useContext as a}from"react";import{_ as i,a as t,b as r}from"./tslib.es6-BtVxab8e.js";import{c as l}from"./clsx-BaVHROc5.js";import{c as s}from"./index-BVxS3Ixi.js";import{u as d}from"./index-fkj4Fdgt.js";import{R as n}from"./index-BRmT6kl7.js";import{T as c}from"./index-YgKcfT__.js";import"./index-Dc5Cm9z0.js";import"./index-DnCiOYxZ.js";import"./index-DBZNt4Em.js";var u=o({type:"single",activeToggles:[],setActiveToggles:function(){},rootClass:"",disabled:!1,orientation:"horizontal"}),m="ToggleGroup",v=e.forwardRef((function(o,a){var r=o.type,c=void 0===r?"single":r,v=o.className,g=void 0===v?"":v,p=o.loop,f=void 0===p||p,h=o.orientation,C=void 0===h?"horizontal":h,T=o.customRootClass,b=void 0===T?"":T,N=o.value,j=o.defaultValue,x=void 0===j?[]:j,R=o.onValueChange,y=o.color,E=void 0===y?"":y,G=o.disabled,w=void 0!==G&&G,I=o.dir,V=void 0===I?"ltr":I,A=o.rovingFocus,P=void 0===A||A;o.asChild;var z=o.children,F=i(o,["type","className","loop","orientation","customRootClass","value","defaultValue","onValueChange","color","disabled","dir","rovingFocus","asChild","children"]),k=s(b,m),D=d(N,x,R),_={activeToggles:D[0],setActiveToggles:D[1],type:c,rootClass:k,disabled:w,orientation:C},q={};return E&&(q["data-rad-ui-accent-color"]=E),w&&(q["data-disabled"]=""),q["data-orientation"]=C,P?e.createElement(u.Provider,{value:_},e.createElement(n.Root,{loop:f,orientation:C,dir:V},e.createElement(n.Group,t({},q,F),e.createElement("div",{ref:a,className:l(k,g)},z)))):e.createElement(u.Provider,{value:_},e.createElement("div",t({ref:a,className:l(k,g)},q,{dir:V},F),z))}));v.displayName=m;var g=e.forwardRef((function(o,l){var s=o.children,d=o.className,m=void 0===d?"":d,v=o.value,g=void 0===v?null:v,p=o.disabled,f=void 0!==p&&p,h=o.asChild,C=void 0!==h&&h,T=i(o,["children","className","value","disabled","asChild"]),b=a(u),N=b.type,j=b.activeToggles,x=b.setActiveToggles,R=b.rootClass,y=b.disabled,E=null==j?void 0:j.includes(g),G=f||y,w={},I={};return E?(w["aria-pressed"]="true",I["data-state"]="on"):(w["aria-pressed"]="false",I["data-state"]="off"),G&&(I["data-disabled"]=""),e.createElement(n.Item,null,e.createElement(c,t({ref:l,onClick:function(){if(!G){var e=j||[];if("single"===N)return E?void x([]):void x([g]);"multiple"===N&&(e=E?e.filter((function(e){return e!==g})):r(r([],e,!0),[g],!1)),x(e)}},className:"".concat(R,"-item ").concat(m),disabled:G,asChild:C},w,I,T),s))}));g.displayName="ToggleItem";var p=e.forwardRef((function(e,o){return console.warn("Direct usage of ToggleGroup is not supported. Please use ToggleGroup.Root, ToggleGroup.Item, etc. instead."),null}));p.displayName="ToggleGroup",p.Root=v,p.Item=g;export{p as default};
|
|
@@ -1,22 +1,35 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Primitive from '~/core/primitives/Primitive';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
type Placement = 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end';
|
|
5
|
+
interface TooltipRootProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
placement?: Placement;
|
|
8
|
+
}
|
|
9
|
+
declare const TooltipRoot: React.ForwardRefExoticComponent<TooltipRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
|
|
11
|
+
declare const TooltipTrigger: React.ForwardRefExoticComponent<Omit<{
|
|
12
|
+
label?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
asChild?: boolean;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
onChange?: any;
|
|
17
|
+
} & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
18
|
+
asChild?: boolean;
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
21
|
+
|
|
22
|
+
type TooltipContentProps = React.ComponentPropsWithoutRef<typeof Primitive.div> & {
|
|
23
|
+
showArrow?: boolean;
|
|
24
|
+
children: React.ReactNode;
|
|
20
25
|
};
|
|
26
|
+
declare const TooltipContent: React.ForwardRefExoticComponent<TooltipContentProps & React.RefAttributes<HTMLElement>>;
|
|
27
|
+
|
|
28
|
+
interface TooltipComponent extends React.ForwardRefExoticComponent<React.ComponentPropsWithoutRef<'div'> & React.RefAttributes<React.ElementRef<'div'>>> {
|
|
29
|
+
Root: typeof TooltipRoot;
|
|
30
|
+
Trigger: typeof TooltipTrigger;
|
|
31
|
+
Content: typeof TooltipContent;
|
|
32
|
+
}
|
|
33
|
+
declare const Tooltip: TooltipComponent;
|
|
21
34
|
|
|
22
35
|
export { Tooltip as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import e,{createContext as t,useRef as r,useState as o,
|
|
1
|
+
'use client';import e,{createContext as t,useRef as r,useState as o,useContext as a}from"react";import{_ as i,a as n}from"./tslib.es6-BtVxab8e.js";import{a as s,k as l,o as d,f as c,s as p,d as f,i as m,e as u,j as g,g as w,u as v,D as h,r as T}from"./floating-ui.react-CLbXmKZY.js";import{B as x}from"./index-DnCiOYxZ.js";import{c as R}from"./clsx-BaVHROc5.js";import{P as E}from"./index-Dc5Cm9z0.js";import"react/jsx-runtime";import"react-dom";var j=t(null),y=e.forwardRef((function(t,a){var v=t.children,h=t.placement,T=void 0===h?"top":h,x=i(t,["children","placement"]),R=r(null),E=o(!1),y=E[0],C=E[1],N=s({placement:T,strategy:"fixed",onOpenChange:C,middleware:[l({element:R,padding:4}),d(5),c({crossAxis:!0,fallbackAxisSideDirection:"start",padding:5}),p({padding:5})]}),b=N.context,O=f(b,{move:!1}),P=m(b,{}),A=u(b),D=g(b,{role:"tooltip"}),k=w([O,P,A,D]);return e.createElement(j.Provider,{value:{isOpen:y,setIsOpen:C,data:N,interactions:k,context:b,arrowRef:R}},e.createElement("div",n({ref:a},x),v))}));y.displayName="Tooltip";var C=e.forwardRef((function(t,r){var o=t.children,s=t.asChild,l=i(t,["children","asChild"]),d=a(j);if(!d)throw new Error("TooltipTrigger must be used within a TooltipRoot component");var c=d.isOpen,p=d.interactions,f=d.context,m=p.getReferenceProps,u=o.ref,g=v([f.refs.setReference,r,u]);return e.createElement(x,n({asChild:s,ref:g,"data-state":c?"open":"closed"},m(l)),o)}));C.displayName="TooltipTrigger";var N=e.forwardRef((function(t,r){var o=t.children,s=t.showArrow,l=void 0===s||s,d=i(t,["children","showArrow"]),c=a(j);if(!c)throw new Error("TooltipContent must be used within a TooltipRoot component");var p=c.isOpen,f=c.data,m=c.interactions,u=c.context,g=c.arrowRef,w=v([u.refs.setFloating,r]);if(!p)return null;var x=m.getFloatingProps;return e.createElement(h,null,e.createElement(E.div,n({className:"rad-ui-tooltip-floating-element",ref:w,"data-state":p?"open":"closed",style:n({},f.floatingStyles)},x(d)),l&&e.createElement(T,{className:R("rad-ui-arrow rad-ui-arrow"),ref:g,context:u}),o))}));N.displayName="TooltipContent";var b=e.forwardRef((function(e,t){return console.warn("Direct usage of Tooltip is not supported. Please use Tooltip.Root, Tooltip.Trigger, etc. instead."),null}));b.displayName="Tooltip",b.Root=y,b.Trigger=C,b.Content=N;export{b as default};
|
|
@@ -1,20 +1,37 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import Primitive from '~/core/primitives/Primitive';
|
|
2
3
|
|
|
3
|
-
type
|
|
4
|
+
type TreeRootProps = {
|
|
5
|
+
customRootClass?: string;
|
|
6
|
+
'aria-label'?: string;
|
|
7
|
+
'aria-labelledby'?: string;
|
|
8
|
+
} & ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
9
|
+
declare const TreeRoot: React.ForwardRefExoticComponent<TreeRootProps & React.RefAttributes<HTMLElement>>;
|
|
10
|
+
|
|
11
|
+
declare const TreeItem: React.ForwardRefExoticComponent<{
|
|
12
|
+
item: any;
|
|
13
|
+
level?: number;
|
|
14
|
+
parentId?: string | null;
|
|
15
|
+
isSelected?: boolean;
|
|
16
|
+
onToggleSelect?: (id: string, item: any) => void;
|
|
17
|
+
getIsSelected?: (item: any) => boolean;
|
|
18
|
+
} & Omit<{
|
|
19
|
+
label?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
asChild?: boolean;
|
|
22
|
+
required?: boolean;
|
|
23
|
+
onChange?: any;
|
|
24
|
+
} & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
25
|
+
|
|
26
|
+
type TreeElement = HTMLDivElement;
|
|
27
|
+
type TreeProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
4
28
|
children?: React.ReactNode;
|
|
5
29
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Root: ({ children, ...props }: {
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
}) => React.JSX.Element;
|
|
13
|
-
Item: ({ children, item, level, className, ...props }: {
|
|
14
|
-
[key: string]: any;
|
|
15
|
-
children: React.ReactNode;
|
|
16
|
-
}) => React.JSX.Element;
|
|
30
|
+
type TreeComponent = React.ForwardRefExoticComponent<TreeProps & React.RefAttributes<TreeElement>> & {
|
|
31
|
+
Root: typeof TreeRoot;
|
|
32
|
+
Item: typeof TreeItem;
|
|
17
33
|
};
|
|
34
|
+
declare const Tree: TreeComponent;
|
|
18
35
|
|
|
19
36
|
export { Tree as default };
|
|
20
|
-
export type { TreeProps };
|
|
37
|
+
export type { TreeElement, TreeProps };
|
package/dist/components/Tree.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{_ as e,a as t}from"./tslib.es6-BtVxab8e.js";import l,{createContext as r,useRef as n,useId as
|
|
1
|
+
'use client';import{_ as e,a as t}from"./tslib.es6-BtVxab8e.js";import l,{createContext as a,forwardRef as r,useRef as n,useImperativeHandle as o,useId as i,useState as s,useContext as c}from"react";import{R as d}from"./index-BRmT6kl7.js";import{P as m}from"./index-Dc5Cm9z0.js";import{c as u}from"./index-BVxS3Ixi.js";import{c as f}from"./clsx-BaVHROc5.js";import{B as v}from"./index-DnCiOYxZ.js";var p=a({rootClass:"",treeRef:{current:null}}),g="Tree",b=r((function(a,r){var i=a.children,s=a.className,c=void 0===s?"":s,v=a.customRootClass,b=void 0===v?"":v,h=a["aria-label"],E=a["aria-labelledby"],y=e(a,["children","className","customRootClass","aria-label","aria-labelledby"]),S=n(null);o(r,(function(){return S.current}));var I=u(b,g),N={rootClass:I,treeRef:S};return l.createElement(p.Provider,{value:N},l.createElement(d.Root,{orientation:"vertical",mode:"tree"},l.createElement(d.Group,null,l.createElement(m.div,t({className:f(I,c),ref:S,role:"tree","aria-label":h,"aria-labelledby":E},y),i))))}));b.displayName=g;var h=r((function(a,r){var m=a.children,u=a.item,g=a.level,b=void 0===g?0:g,E=a.className,y=void 0===E?"":E,S=a.parentId,I=void 0===S?null:S,N=a.isSelected,R=void 0!==N&&N,T=a.onToggleSelect,x=a.getIsSelected,C=e(a,["children","item","level","className","parentId","isSelected","onToggleSelect","getIsSelected"]),j=i(),D=n(null);o(r,(function(){return D.current}));var k=s(!1),w=k[0],P=k[1],K=c(p).rootClass;return l.createElement(l.Fragment,null,l.createElement(d.Item,{handleRightKeyDown:function(){if(console.log("handleExpand",j),u.items&&0!==u.items.length)if(w){var e=D.current,t=null==e?void 0:e.nextElementSibling;t&&t.focus()}else P(!0)},handleLeftKeyDown:function(){if(console.log("handleCollapse",j),w)P(!1);else if(I){var e=document.querySelector('[data-id="'.concat(I,'"]'));e&&e.focus(),P(!1)}}},l.createElement(v,t({ref:D,className:f("".concat(K,"-item"),y),onClick:function(){console.log("clicked",j),T&&T(j,u),(null==u?void 0:u.items)&&u.items.length>0&&P((function(e){return!e}))},onKeyDownCapture:function(e){"Enter"===e.key&&(T&&T(j,u),e.preventDefault(),e.stopPropagation())},"data-selected":R,"aria-selected":R,"data-toggled":w,"data-id":j,"data-parent-id":I,"data-level":b},C),m)),w&&u.items&&l.createElement(l.Fragment,null,u.items.map((function(e){var t=b+1,a=!!x&&x(e);return l.createElement(h,{parentId:j,level:t,key:e.label,item:e,isSelected:a,onToggleSelect:T,getIsSelected:x},e.label)}))))}));h.displayName="TreeItem";var E=r((function(a,r){var n=a.children,o=e(a,["children"]);return console.warn("Direct usage of Tree is not supported. Please use Tree.Root and Tree.Item instead."),l.createElement("div",t({ref:r},o),n)}));E.displayName="Tree",E.Root=b,E.Item=h;export{E as default};
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import React, { CSSProperties } from 'react';
|
|
1
|
+
import React, { CSSProperties, ComponentPropsWithoutRef, ElementRef } from 'react';
|
|
2
|
+
import Primitive from '~/core/primitives/Primitive';
|
|
2
3
|
|
|
4
|
+
type VisuallyHiddenElement = ElementRef<typeof Primitive.div>;
|
|
3
5
|
type VisuallyHiddenProps = {
|
|
4
|
-
children: React.ReactNode;
|
|
5
6
|
customRootClass?: string;
|
|
6
|
-
className?: string;
|
|
7
|
-
asChild?: boolean;
|
|
8
7
|
style?: CSSProperties;
|
|
9
|
-
} &
|
|
10
|
-
declare const VisuallyHidden:
|
|
11
|
-
({ children, customRootClass, className, style, ...props }: VisuallyHiddenProps): React.JSX.Element;
|
|
12
|
-
displayName: string;
|
|
13
|
-
};
|
|
8
|
+
} & ComponentPropsWithoutRef<typeof Primitive.div>;
|
|
9
|
+
declare const VisuallyHidden: React.ForwardRefExoticComponent<VisuallyHiddenProps & React.RefAttributes<HTMLElement>>;
|
|
14
10
|
|
|
15
11
|
export { VisuallyHidden as default };
|
|
16
|
-
export type { VisuallyHiddenProps };
|
|
12
|
+
export type { VisuallyHiddenElement, VisuallyHiddenProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{_ as e,a as s}from"./tslib.es6-BtVxab8e.js";import t from"react";import{P as
|
|
1
|
+
'use client';import{_ as e,a as s}from"./tslib.es6-BtVxab8e.js";import t,{forwardRef as a}from"react";import{P as o}from"./index-Dc5Cm9z0.js";import{c as i}from"./index-BVxS3Ixi.js";import{c as r}from"./clsx-BaVHROc5.js";var l="VisuallyHidden",n={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",whiteSpace:"nowrap",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",pointerEvents:"none",userSelect:"none"},c=a((function(a,c){var m=a.children,p=a.customRootClass,d=a.className,f=a.style,h=void 0===f?{}:f,u=e(a,["children","customRootClass","className","style"]),x=i(p,l);return t.createElement(o.div,s({ref:c,className:r(x,d),style:s(s({},n),h)},u),m)}));c.displayName=l;export{c as default};
|