@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.
Files changed (137) hide show
  1. package/README.md +12 -4
  2. package/dist/components/Accordion.d.ts +23 -40
  3. package/dist/components/Accordion.js +1 -1
  4. package/dist/components/AlertDialog.d.ts +79 -25
  5. package/dist/components/AlertDialog.js +1 -1
  6. package/dist/components/AspectRatio.d.ts +6 -9
  7. package/dist/components/AspectRatio.js +1 -1
  8. package/dist/components/Avatar.d.ts +9 -17
  9. package/dist/components/Avatar.js +1 -1
  10. package/dist/components/AvatarGroup.d.ts +21 -17
  11. package/dist/components/AvatarGroup.js +1 -1
  12. package/dist/components/AvatarPrimitiveFallback-BV0bK5Qg.js +1 -0
  13. package/dist/components/Badge.d.ts +7 -5
  14. package/dist/components/Badge.js +1 -1
  15. package/dist/components/BlockQuote.d.ts +7 -8
  16. package/dist/components/BlockQuote.js +1 -1
  17. package/dist/components/Button.d.ts +15 -6
  18. package/dist/components/Button.js +1 -1
  19. package/dist/components/Callout.d.ts +24 -29
  20. package/dist/components/Callout.js +1 -1
  21. package/dist/components/Card.d.ts +7 -15
  22. package/dist/components/Card.js +1 -1
  23. package/dist/components/Checkbox.d.ts +27 -17
  24. package/dist/components/Checkbox.js +1 -1
  25. package/dist/components/CheckboxCards.d.ts +28 -31
  26. package/dist/components/CheckboxCards.js +1 -1
  27. package/dist/components/CheckboxGroup.d.ts +31 -31
  28. package/dist/components/CheckboxGroup.js +1 -1
  29. package/dist/components/CheckboxGroupPrimitive-DrGqSxi3.js +1 -0
  30. package/dist/components/Code.d.ts +7 -3
  31. package/dist/components/Code.js +1 -1
  32. package/dist/components/Collapsible.d.ts +16 -22
  33. package/dist/components/Collapsible.js +1 -1
  34. package/dist/components/ContextMenu.d.ts +78 -35
  35. package/dist/components/ContextMenu.js +1 -1
  36. package/dist/components/DataList.d.ts +9 -17
  37. package/dist/components/DataList.js +1 -1
  38. package/dist/components/Dialog.d.ts +78 -32
  39. package/dist/components/Dialog.js +1 -1
  40. package/dist/components/Disclosure.d.ts +20 -26
  41. package/dist/components/Disclosure.js +1 -1
  42. package/dist/components/DropdownMenu.d.ts +78 -35
  43. package/dist/components/DropdownMenu.js +1 -1
  44. package/dist/components/Em.d.ts +5 -9
  45. package/dist/components/Em.js +1 -1
  46. package/dist/components/Heading.d.ts +7 -275
  47. package/dist/components/Heading.js +1 -1
  48. package/dist/components/HoverCard.d.ts +34 -33
  49. package/dist/components/HoverCard.js +1 -1
  50. package/dist/components/Kbd.d.ts +6 -8
  51. package/dist/components/Kbd.js +1 -1
  52. package/dist/components/Link.d.ts +6 -12
  53. package/dist/components/Link.js +1 -1
  54. package/dist/components/MenuPrimitive-DuUPySFO.js +1 -0
  55. package/dist/components/Menubar.d.ts +68 -45
  56. package/dist/components/Menubar.js +1 -1
  57. package/dist/components/Minimap.d.ts +48 -0
  58. package/dist/components/Minimap.js +1 -0
  59. package/dist/components/NavigationMenu.d.ts +35 -0
  60. package/dist/components/NavigationMenu.js +1 -0
  61. package/dist/components/NumberField.d.ts +17 -37
  62. package/dist/components/NumberField.js +1 -1
  63. package/dist/components/Progress.d.ts +22 -19
  64. package/dist/components/Progress.js +1 -1
  65. package/dist/components/Quote.d.ts +4 -8
  66. package/dist/components/Quote.js +1 -1
  67. package/dist/components/Radio.d.ts +11 -4
  68. package/dist/components/Radio.js +1 -1
  69. package/dist/components/RadioCards.d.ts +32 -35
  70. package/dist/components/RadioCards.js +1 -1
  71. package/dist/components/RadioGroup.d.ts +34 -37
  72. package/dist/components/RadioGroup.js +1 -1
  73. package/dist/components/RadioGroupPrimitive-D9grAL7G.js +1 -0
  74. package/dist/components/ScrollArea.d.ts +22 -14
  75. package/dist/components/ScrollArea.js +1 -1
  76. package/dist/components/Select.d.ts +69 -16
  77. package/dist/components/Select.js +1 -1
  78. package/dist/components/Separator.d.ts +5 -9
  79. package/dist/components/Separator.js +1 -1
  80. package/dist/components/Skeleton.d.ts +8 -7
  81. package/dist/components/Skeleton.js +1 -1
  82. package/dist/components/Slider.d.ts +78 -26
  83. package/dist/components/Slider.js +1 -1
  84. package/dist/components/Splitter.d.ts +57 -0
  85. package/dist/components/Splitter.js +1 -0
  86. package/dist/components/Steps.d.ts +38 -0
  87. package/dist/components/Steps.js +1 -0
  88. package/dist/components/Strong.d.ts +6 -7
  89. package/dist/components/Strong.js +1 -1
  90. package/dist/components/Switch.d.ts +28 -6
  91. package/dist/components/Switch.js +1 -1
  92. package/dist/components/TabNav.d.ts +15 -25
  93. package/dist/components/TabNav.js +1 -1
  94. package/dist/components/Table.d.ts +23 -27
  95. package/dist/components/Table.js +1 -1
  96. package/dist/components/Tabs.d.ts +23 -44
  97. package/dist/components/Tabs.js +1 -1
  98. package/dist/components/Text.d.ts +8 -274
  99. package/dist/components/Text.js +1 -1
  100. package/dist/components/TextArea.d.ts +9 -14
  101. package/dist/components/TextArea.js +1 -1
  102. package/dist/components/Theme.d.ts +9 -5
  103. package/dist/components/Theme.js +1 -1
  104. package/dist/components/Toggle.d.ts +8 -19
  105. package/dist/components/Toggle.js +1 -1
  106. package/dist/components/ToggleGroup.d.ts +55 -34
  107. package/dist/components/ToggleGroup.js +1 -1
  108. package/dist/components/Tooltip.d.ts +31 -18
  109. package/dist/components/Tooltip.js +1 -1
  110. package/dist/components/Tree.d.ts +31 -14
  111. package/dist/components/Tree.js +1 -1
  112. package/dist/components/VisuallyHidden.d.ts +6 -10
  113. package/dist/components/VisuallyHidden.js +1 -1
  114. package/dist/components/{floating-ui.react-jh3caJnc.js → floating-ui.react-CLbXmKZY.js} +2 -2
  115. package/dist/components/index-BRmT6kl7.js +1 -0
  116. package/dist/components/index-Bf4LVEjJ.js +1 -0
  117. package/dist/components/index-BtoPzkH9.js +1 -0
  118. package/dist/components/index-DBZNt4Em.js +1 -0
  119. package/dist/components/index-Dc5Cm9z0.js +1 -0
  120. package/dist/components/index-Di6TooPD.js +1 -0
  121. package/dist/components/{index-8D8A0ALD.js → index-DnCiOYxZ.js} +1 -1
  122. package/dist/components/index-XqbKa2D2.js +1 -0
  123. package/dist/components/index-YgKcfT__.js +1 -0
  124. package/dist/themes/default.css +1 -1
  125. package/package.json +21 -3
  126. package/dist/components/AvatarPrimitiveFallback-CSD78PQE.js +0 -1
  127. package/dist/components/CheckboxGroupPrimitive-PcT11bev.js +0 -1
  128. package/dist/components/MenuPrimitive-M690K2sI.js +0 -1
  129. package/dist/components/RadioGroupPrimitive-CUgW2PyL.js +0 -1
  130. package/dist/components/index-BNg6qXF-.js +0 -1
  131. package/dist/components/index-CaFVBHZz.js +0 -1
  132. package/dist/components/index-CyT0hgZn.js +0 -1
  133. package/dist/components/index-DAboJYKJ.js +0 -1
  134. package/dist/components/index-DIw4zyNG.js +0 -1
  135. package/dist/components/index-DpUtikes.js +0 -1
  136. package/dist/components/index-ZMIfeyHL.js +0 -1
  137. package/dist/components/setupTests.d.ts +0 -3
@@ -1 +1 @@
1
- 'use client';import{_ as s,a}from"./tslib.es6-BtVxab8e.js";import e from"react";import{c as o}from"./index-BVxS3Ixi.js";import{c as r}from"./clsx-BaVHROc5.js";var t="Text",i=["div","span","p","label"],l=function(l){var m=l.children,c=l.customRootClass,d=void 0===c?"":c,p=l.className,n=void 0===p?"":p,f=l.as,u=void 0===f?"p":f,v=s(l,["children","customRootClass","className","as"]),x=o(d,t);return i.includes(u)||(u="p"),e.createElement(u,a({className:r(x,n)},v),m)};l.displayName=t;export{l as default};
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
- type TextAreaProps$1 = {
4
- children: React.ReactNode;
3
+ declare const TextAreaRoot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
5
4
  customRootClass?: string;
6
- className?: string;
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
- declare const TextArea: {
15
- ({ customRootClass, className, children, ...props }: TextAreaProps): React.JSX.Element;
16
- Input: ({ children, placeholder }: {
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 t from"react";import{c as a}from"./clsx-BaVHROc5.js";import{c as o}from"./index-BVxS3Ixi.js";var r=function(e){var r=e.children,s=e.customRootClass,c=void 0===s?"":s,l=e.className,m=void 0===l?"":l,n=o(c,"TextArea");return t.createElement("div",{className:a(n,m)},r)},s=function(e){var a=e.children,o=e.placeholder,r=void 0===o?"":o;return t.createElement("textarea",{placeholder:r},a)},c=function(o){var c=o.customRootClass,l=void 0===c?"":c,m=o.className,n=void 0===m?"":m,i=o.children;return e(o,["customRootClass","className","children"]),t.createElement(r,{customRootClass:l,className:a(n)},t.createElement(s,{placeholder:"enter text"},i),i)};c.Input=s,c.Root=r;export{c as default};
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: ({ appearance, id, accentColor, radius, scaling, children, ...props }: ThemeProps) => React.JSX.Element;
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 };
@@ -1 +1 @@
1
- 'use client';import{_ as a,a as i}from"./tslib.es6-BtVxab8e.js";import r,{useState as e,useEffect as t}from"react";var d=function(d){var c=d.appearance,n=void 0===c?"light":c,o=d.id,s=void 0===o?"rad-ui-theme-container":o,u=d.accentColor,l=void 0===u?"":u,m=d.radius,f=void 0===m?"":m,h=d.scaling,p=void 0===h?"":h,v=d.children,g=a(d,["appearance","id","accentColor","radius","scaling","children"]),k=e(n),w=k[0],C=k[1],b=e(l),j=b[0],x=b[1],y=e(f),E=y[0],M=y[1],_=e(p),q=_[0],z=_[1];return t((function(){C("system"===n?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":n)}),[n]),t((function(){l&&x(l)}),[l]),t((function(){f&&M(f)}),[f]),t((function(){p&&z(p)}),[p]),r.createElement("div",i({id:s,"data-rad-ui-theme":w,"data-rad-ui-accent-color":j,"data-rad-ui-radius":E,"data-rad-ui-scaling":q},g),v)};export{d as default};
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
- type ToggleProps = {
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
- /** Whether to render as a child element instead of a button */
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} onChange={setPressed}>Toggle Me</Toggle>
22
+ * <Toggle pressed={pressed} onPressedChange={setPressed}>Toggle Me</Toggle>
34
23
  *
35
24
  * @example
36
25
  * // Uncontrolled mode
37
- * <Toggle defaultPressed={false} onChange={(isPressed) => console.log(isPressed)}>Toggle Me</Toggle>
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.FC<ToggleProps>;
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 o}from"./clsx-BaVHROc5.js";import{c as d}from"./index-BVxS3Ixi.js";import{u as r}from"./index-fkj4Fdgt.js";import{T as i}from"./index-CyT0hgZn.js";import"./index-8D8A0ALD.js";import"./index-DIw4zyNG.js";var t="Toggle",l=function(l){var m=l.defaultPressed,n=void 0!==m&&m,c=l.customRootClass,p=void 0===c?"":c,f=l.children,h=l.className,u=void 0===h?"":h,v=l.color,C=void 0===v?"":v,j=l.pressed,x=l.onPressedChange,g=l.asChild,P=void 0!==g&&g,N=s(l,["defaultPressed","customRootClass","children","className","color","pressed","onPressedChange","asChild"]),b=r(j,n,x),R=b[0],T=b[1],y=d(p,t),E={};return C&&(E["data-rad-ui-accent-color"]=C),a.createElement(i,e({className:o(y,u),pressed:R,onPressedChange:T,"data-state":R?"on":"off","data-disabled":N.disabled?"":void 0,asChild:P},N,E),f)};l.displayName=t;export{l as default};
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 * as React$1 from 'react';
2
- import React__default from 'react';
1
+ import React from 'react';
2
+ import TogglePrimitive from '~/core/primitives/Toggle';
3
3
 
4
- /**
5
- * Props for the ToggleItem component
6
- * @typedef ToggleItemProps
7
- */
8
- type ToggleItemProps = {
9
- /** Content to render inside the toggle item */
10
- children?: React__default.ReactNode;
11
- /** Value associated with this toggle item, used for selection state */
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
- /** Whether the toggle item is disabled */
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
- /** Whether to render as a child element instead of a button */
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
- /** Additional props to pass to the underlying TogglePrimitive */
18
- [key: string]: any;
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
- declare const ToggleGroup: {
22
- (): null;
23
- Root: React$1.FC<{
24
- type?: "single" | "multiple";
25
- className?: string;
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{a as e,_ as o,b as a}from"./tslib.es6-BtVxab8e.js";import t,{createContext as i,useContext as s}from"react";import{c as l}from"./clsx-BaVHROc5.js";import{c as r}from"./index-BVxS3Ixi.js";import{u as d}from"./index-fkj4Fdgt.js";import{R as n}from"./index-BNg6qXF-.js";import{T as c}from"./index-CyT0hgZn.js";import"./index-DIw4zyNG.js";import"./index-8D8A0ALD.js";var u=i({type:"single",activeToggles:[],setActiveToggles:function(){},rootClass:"",disabled:!1,orientation:"horizontal"}),v=function(){return console.warn("Direct usage of ToggleGroup is not supported. Please use ToggleGroup.Root, ToggleGroup.Item, etc. instead."),null};v.Root=function(o){var a=o.type,i=void 0===a?"single":a,s=o.className,c=void 0===s?"":s,v=o.loop,m=void 0===v||v,g=o.orientation,p=void 0===g?"horizontal":g,f=o.customRootClass,b=void 0===f?"":f,h=o.value,T=o.defaultValue,C=void 0===T?[]:T,j=o.onValueChange,x=o.color,E=void 0===x?"":x,N=o.disabled,G=void 0!==N&&N,R=o.dir,y=void 0===R?"ltr":R,A=o.rovingFocus,I=void 0===A||A;o.asChild;var P=o.children,z=r(b,"ToggleGroup"),V=d(h,C,j),k={activeToggles:V[0],setActiveToggles:V[1],type:i,rootClass:z,disabled:G,orientation:p},w={};return E&&(w["data-rad-ui-accent-color"]=E),G&&(w["data-disabled"]=""),w["data-orientation"]=p,I?t.createElement(u.Provider,{value:k},t.createElement(n.Root,{loop:m,orientation:p,dir:y},t.createElement(n.Group,e({className:l(z,c)},w),P))):t.createElement(u.Provider,{value:k},t.createElement("div",e({className:l(z,c)},w,{dir:y}),P))},v.Item=function(i){var l=i.children,r=i.className,d=void 0===r?"":r,v=i.value,m=void 0===v?null:v,g=i.disabled,p=void 0!==g&&g,f=i.asChild,b=void 0!==f&&f,h=o(i,["children","className","value","disabled","asChild"]),T=s(u),C=T.type,j=T.activeToggles,x=T.setActiveToggles,E=T.rootClass,N=T.disabled,G=null==j?void 0:j.includes(m),R=p||N,y={},A={};return G?(y["aria-pressed"]="true",A["data-state"]="on"):(y["aria-pressed"]="false",A["data-state"]="off"),R&&(A["data-disabled"]=""),t.createElement(n.Item,null,t.createElement(c,e({onClick:function(){if(!R){var e=j||[];if("single"===C)return G?void x([]):void x([m]);"multiple"===C&&(e=G?e.filter((function(e){return e!==m})):a(a([],e,!0),[m],!1)),x(e)}},className:"".concat(E,"-item ").concat(d),disabled:R,asChild:b},y,A,h),l))};export{v as default};
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 * as react from 'react';
1
+ import React from 'react';
2
+ import Primitive from '~/core/primitives/Primitive';
2
3
 
3
- declare const Tooltip: {
4
- (): null;
5
- Root: {
6
- ({ children, placement }: {
7
- children: React.ReactNode;
8
- placement?: "top" | "bottom" | "left" | "right" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end";
9
- } & JSX.IntrinsicElements["div"]): react.JSX.Element;
10
- displayName: string;
11
- };
12
- Trigger: react.ForwardRefExoticComponent<Omit<{
13
- children: React.ReactNode;
14
- asChild?: boolean;
15
- } & react.ClassAttributes<HTMLButtonElement> & react.ButtonHTMLAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
16
- Content: react.ForwardRefExoticComponent<Omit<{
17
- children: React.ReactNode;
18
- showArrow?: boolean;
19
- } & react.ClassAttributes<HTMLDivElement> & react.HTMLAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
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,forwardRef as a,useContext as i}from"react";import{u as n,k as s,o as l,f as c,s as d,d as p,i as m,e as f,j as u,g,c as v,D as w,r as h}from"./floating-ui.react-jh3caJnc.js";import{_ as x,a as T}from"./tslib.es6-BtVxab8e.js";import{B as b}from"./index-8D8A0ALD.js";import{c as R}from"./clsx-BaVHROc5.js";import{P as j}from"./index-DIw4zyNG.js";import"react/jsx-runtime";import"react-dom";var C=t(null),E=function(t){var a=t.children,i=t.placement,v=void 0===i?"top":i,w=r(null),h=o(!1),x=h[0],T=h[1],b=n({placement:v,strategy:"fixed",onOpenChange:T,middleware:[s({element:w,padding:4}),l(5),c({crossAxis:!0,fallbackAxisSideDirection:"start",padding:5}),d({padding:5})]}),R=b.context,j=p(R,{move:!1}),E=m(R,{}),y=f(R),N=u(R,{role:"tooltip"}),O=g([j,E,y,N]);return e.createElement(C.Provider,{value:{isOpen:x,setIsOpen:T,data:b,interactions:O,context:R,arrowRef:w}},a)};E.displayName="Tooltip";var y=a((function(t,r){var o=t.children,a=t.asChild,n=x(t,["children","asChild"]),s=i(C);if(!s)throw new Error("TooltipTrigger must be used within a TooltipRoot component");var l=s.isOpen,c=s.interactions,d=s.context,p=c.getReferenceProps,m=o.ref,f=v([d.refs.setReference,r,m]);return e.createElement(b,T({asChild:a,ref:f,"data-state":l?"open":"closed"},p(n)),o)}));y.displayName="TooltipTrigger";var N=a((function(t,r){var o=t.children,a=t.showArrow,n=void 0===a||a,s=x(t,["children","showArrow"]),l=i(C);if(!l)throw new Error("TooltipContent must be used within a TooltipRoot component");var c=l.isOpen,d=l.data,p=l.interactions,m=l.context,f=l.arrowRef,u=v([m.refs.setFloating,r]);if(!c)return null;var g=p.getFloatingProps;return e.createElement(w,null,e.createElement(j.div,T({className:"rad-ui-tooltip-floating-element",ref:u,style:T({},d.floatingStyles)},g(s)),n&&e.createElement(h,{className:R("rad-ui-arrow rad-ui-arrow"),ref:f,context:m}),o))}));N.displayName="TooltipContent";var O=function(){return console.warn("Direct usage of Tabs is not supported. Please use Tabs.Root, Tabs.List, etc. instead."),null};O.Root=E,O.Trigger=y,O.Content=N;export{O as default};
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 TreeProps = React.HTMLAttributes<HTMLDivElement> & {
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
- declare const Tree: {
7
- (): null;
8
- displayName: string;
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 };
@@ -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 a,useState as i}from"react";import{R as m}from"./index-BNg6qXF-.js";import{P as o}from"./index-DIw4zyNG.js";import{B as c}from"./index-8D8A0ALD.js";import{c as s}from"./clsx-BaVHROc5.js";var d=r({}),u=function(r){var n=r.children,o=r.item,d=r.level,p=void 0===d?0:d,v=r.className,f=void 0===v?"":v,E=e(r,["children","item","level","className"]),g=a(),x=i(!1),y=x[0],j=x[1];return l.createElement(l.Fragment,null,l.createElement(m.Item,null,l.createElement(c,t({className:s(f),onClick:function(){console.log("clicked",g),j(!y)},style:{display:"block",alignItems:"center",gap:"0.5rem"}},E),l.createElement("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",paddingLeft:"".concat(16*p,"px")}},l.createElement("div",null,y?"v":">"),l.createElement("div",null,n)))),y&&o.items&&l.createElement(l.Fragment,null,o.items.map((function(e){var t=p+1;return l.createElement(u,{level:t,key:e.label,item:e},e.label)}))))},p=function(){return console.warn("Direct usage of Tree is not supported. Please use Tree.Root and Tree.Item instead."),null};p.displayName="Tree",p.Root=function(r){var a=r.children,i=e(r,["children"]),c=n(null);return l.createElement(d.Provider,{value:{}},l.createElement(m.Root,{orientation:"vertical"},l.createElement(m.Group,null,l.createElement(o.div,t({},i,{ref:c}),a))))},p.Item=u;export{p as default};
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
- } & React.HTMLAttributes<HTMLDivElement>;
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 a}from"./index-DIw4zyNG.js";import{c as o}from"./index-BVxS3Ixi.js";import{c as i}from"./clsx-BaVHROc5.js";var r="VisuallyHidden",l={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",whiteSpace:"nowrap",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",overflow:"hidden",pointerEvents:"none",userSelect:"none"},n=function(n){var c=n.children,m=n.customRootClass,p=n.className,d=n.style,f=void 0===d?{}:d,h=e(n,["children","customRootClass","className","style"]),u=o(m,r);return t.createElement(a.div,s({className:i(u,p),style:s(s({},l),f)},h),c)};n.displayName=r;export{n as default};
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};