@radui/ui 0.1.7 → 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.
Files changed (139) hide show
  1. package/README.md +87 -47
  2. package/dist/components/Accordion.d.ts +94 -30
  3. package/dist/components/Accordion.js +1 -1
  4. package/dist/components/AlertDialog.d.ts +13 -14
  5. package/dist/components/AlertDialog.js +1 -1
  6. package/dist/components/AspectRatio.js +1 -1
  7. package/dist/components/Avatar.d.ts +4 -3
  8. package/dist/components/Avatar.js +1 -1
  9. package/dist/components/AvatarGroup.d.ts +1 -0
  10. package/dist/components/AvatarGroup.js +1 -1
  11. package/dist/components/AvatarPrimitiveFallback-KiY3slgV.js +1 -0
  12. package/dist/components/Badge.d.ts +6 -4
  13. package/dist/components/Badge.js +1 -1
  14. package/dist/components/BlockQuote.js +1 -1
  15. package/dist/components/Button.js +1 -1
  16. package/dist/components/Callout.d.ts +19 -11
  17. package/dist/components/Callout.js +1 -1
  18. package/dist/components/Card.d.ts +30 -1
  19. package/dist/components/Card.js +1 -1
  20. package/dist/components/Checkbox.d.ts +22 -6
  21. package/dist/components/Checkbox.js +1 -1
  22. package/dist/components/CheckboxCards.d.ts +25 -7
  23. package/dist/components/CheckboxCards.js +1 -1
  24. package/dist/components/CheckboxGroup.d.ts +22 -7
  25. package/dist/components/CheckboxGroup.js +1 -1
  26. package/dist/components/CheckboxGroupPrimitive-DIOswrR1.js +1 -0
  27. package/dist/components/Code.js +1 -1
  28. package/dist/components/Collapsible.d.ts +12 -9
  29. package/dist/components/Collapsible.js +1 -1
  30. package/dist/components/Combobox.d.ts +98 -0
  31. package/dist/components/Combobox.js +1 -0
  32. package/dist/components/ComboboxPrimitive-Bn1C5dkn.js +1 -0
  33. package/dist/components/ContextMenu.d.ts +31 -1
  34. package/dist/components/ContextMenu.js +1 -1
  35. package/dist/components/DataList.d.ts +12 -5
  36. package/dist/components/DataList.js +1 -1
  37. package/dist/components/Dialog.d.ts +37 -18
  38. package/dist/components/Dialog.js +1 -1
  39. package/dist/components/Disclosure.d.ts +6 -1
  40. package/dist/components/Disclosure.js +1 -1
  41. package/dist/components/DropdownMenu.d.ts +31 -1
  42. package/dist/components/DropdownMenu.js +1 -1
  43. package/dist/components/Em.js +1 -1
  44. package/dist/components/Heading.js +1 -1
  45. package/dist/components/HoverCard.d.ts +12 -1
  46. package/dist/components/HoverCard.js +1 -1
  47. package/dist/components/Kbd.d.ts +1 -1
  48. package/dist/components/Kbd.js +1 -1
  49. package/dist/components/Link.d.ts +3 -1
  50. package/dist/components/Link.js +1 -1
  51. package/dist/components/MenuPrimitive-6Qr46BSn.js +1 -0
  52. package/dist/components/Menubar.d.ts +81 -37
  53. package/dist/components/Menubar.js +1 -1
  54. package/dist/components/Minimap.d.ts +11 -8
  55. package/dist/components/Minimap.js +1 -1
  56. package/dist/components/NavigationMenu.d.ts +13 -12
  57. package/dist/components/NavigationMenu.js +1 -1
  58. package/dist/components/NumberField.d.ts +28 -6
  59. package/dist/components/NumberField.js +1 -1
  60. package/dist/components/Progress.d.ts +1 -1
  61. package/dist/components/Progress.js +1 -1
  62. package/dist/components/Quote.js +1 -1
  63. package/dist/components/Radio.js +1 -1
  64. package/dist/components/RadioCards.d.ts +7 -2
  65. package/dist/components/RadioCards.js +1 -1
  66. package/dist/components/RadioGroup.d.ts +1 -1
  67. package/dist/components/RadioGroup.js +1 -1
  68. package/dist/components/RadioGroupPrimitive-QSMno27i.js +1 -0
  69. package/dist/components/ScrollArea.d.ts +18 -2
  70. package/dist/components/ScrollArea.js +1 -1
  71. package/dist/components/Select.d.ts +20 -15
  72. package/dist/components/Select.js +1 -1
  73. package/dist/components/Separator.js +1 -1
  74. package/dist/components/Skeleton.js +1 -1
  75. package/dist/components/Slider.d.ts +57 -11
  76. package/dist/components/Slider.js +1 -1
  77. package/dist/components/Spinner.d.ts +13 -0
  78. package/dist/components/Spinner.js +1 -0
  79. package/dist/components/Splitter.d.ts +1 -1
  80. package/dist/components/Splitter.js +1 -1
  81. package/dist/components/Steps.d.ts +21 -9
  82. package/dist/components/Steps.js +1 -1
  83. package/dist/components/Strong.js +1 -1
  84. package/dist/components/Switch.d.ts +8 -7
  85. package/dist/components/Switch.js +1 -1
  86. package/dist/components/TabNav.d.ts +23 -5
  87. package/dist/components/TabNav.js +1 -1
  88. package/dist/components/Table.d.ts +9 -1
  89. package/dist/components/Table.js +1 -1
  90. package/dist/components/Tabs.d.ts +25 -1
  91. package/dist/components/Tabs.js +1 -1
  92. package/dist/components/Text.js +1 -1
  93. package/dist/components/TextArea.d.ts +18 -2
  94. package/dist/components/TextArea.js +1 -1
  95. package/dist/components/Theme.js +1 -1
  96. package/dist/components/ThemeContext-Sm-iNANd.js +1 -0
  97. package/dist/components/Toggle.js +1 -1
  98. package/dist/components/ToggleGroup.d.ts +33 -0
  99. package/dist/components/ToggleGroup.js +1 -1
  100. package/dist/components/Toolbar.d.ts +83 -0
  101. package/dist/components/Toolbar.js +1 -0
  102. package/dist/components/Tooltip.d.ts +6 -0
  103. package/dist/components/Tooltip.js +1 -1
  104. package/dist/components/Tree.d.ts +10 -1
  105. package/dist/components/Tree.js +1 -1
  106. package/dist/components/VisuallyHidden.d.ts +1 -1
  107. package/dist/components/VisuallyHidden.js +1 -1
  108. package/dist/components/check-DujVUWP-.js +44 -0
  109. package/dist/components/floating-ui.react-DMgxgTKq.js +5 -0
  110. package/dist/components/index-3dZuI04X.js +1 -0
  111. package/dist/components/index-6If6D2Zi.js +1 -0
  112. package/dist/components/index-98jQ1vTr.js +1 -0
  113. package/dist/components/index-BOy86lYu.js +1 -0
  114. package/dist/components/index-BZVbVgqN.js +1 -0
  115. package/dist/components/index-CTJl2pTM.js +1 -0
  116. package/dist/components/index-CXzybYmm.js +1 -0
  117. package/dist/components/index-DTYJVF-V.js +1 -0
  118. package/dist/components/index-hAp0hL9w.js +1 -0
  119. package/dist/components/index-wRElCyvx.js +1 -0
  120. package/dist/components/index-yqRHPukT.js +1 -0
  121. package/dist/themes/default.css +1 -1
  122. package/package.json +51 -32
  123. package/dist/components/AvatarPrimitiveFallback-BV0bK5Qg.js +0 -1
  124. package/dist/components/CheckboxGroupPrimitive-DrGqSxi3.js +0 -1
  125. package/dist/components/MenuPrimitive-CPcrK1EK.js +0 -1
  126. package/dist/components/RadioGroupPrimitive-D9grAL7G.js +0 -1
  127. package/dist/components/floating-ui.react-CLbXmKZY.js +0 -5
  128. package/dist/components/index-BRmT6kl7.js +0 -1
  129. package/dist/components/index-BVxS3Ixi.js +0 -1
  130. package/dist/components/index-Bf4LVEjJ.js +0 -1
  131. package/dist/components/index-BtoPzkH9.js +0 -1
  132. package/dist/components/index-DBZNt4Em.js +0 -1
  133. package/dist/components/index-Dc5Cm9z0.js +0 -1
  134. package/dist/components/index-Di6TooPD.js +0 -1
  135. package/dist/components/index-DnCiOYxZ.js +0 -1
  136. package/dist/components/index-XqbKa2D2.js +0 -1
  137. package/dist/components/index-YgKcfT__.js +0 -1
  138. package/dist/components/index-fkj4Fdgt.js +0 -1
  139. package/dist/components/tslib.es6-BtVxab8e.js +0 -1
@@ -1,49 +1,92 @@
1
- import * as react from 'react';
2
- import react__default, { ComponentPropsWithoutRef } from 'react';
3
- import Primitive from '~/core/primitives/Primitive';
1
+ import * as React$1 from 'react';
2
+ import React__default, { ComponentPropsWithoutRef } from 'react';
4
3
  import * as _floating_ui_react from '@floating-ui/react';
5
-
6
- type PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;
7
- type SeparatorProps = {
8
- orientation?: 'horizontal' | 'vertical';
9
- customRootClass?: string;
10
- color?: string;
11
- decorative?: boolean;
12
- } & PrimitiveDivProps;
13
- declare const Separator: react__default.ForwardRefExoticComponent<SeparatorProps & react__default.RefAttributes<HTMLElement>>;
14
-
15
- type MenubarSeparatorProps = {
16
- className?: string;
17
- } & ComponentPropsWithoutRef<typeof Separator>;
4
+ import Floater from '~/core/primitives/Floater';
5
+ import MenuPrimitive from '~/core/primitives/Menu/MenuPrimitive';
6
+ import Primitive from '~/core/primitives/Primitive';
18
7
 
19
8
  type MenuPrimitiveItemProps = {
20
- children: react__default.ReactNode;
9
+ children: React__default.ReactNode;
21
10
  className?: string;
22
11
  label?: string;
23
12
  disabled?: boolean;
24
13
  asChild?: boolean;
25
- onSelect?: (event: react__default.MouseEvent<HTMLButtonElement>) => void;
14
+ onSelect?: (event: React__default.MouseEvent<HTMLButtonElement>) => void;
26
15
  };
27
16
 
28
17
  type MenuPrimitiveContentProps = {
29
- children: react__default.ReactNode;
18
+ children: React__default.ReactNode;
30
19
  className?: string;
31
20
  };
32
21
 
33
22
  type MenuPrimitiveTriggerProps = {
34
- children: react__default.ReactNode;
23
+ children: React__default.ReactNode;
35
24
  className?: string;
36
25
  asChild?: boolean;
37
26
  };
38
27
 
28
+ type MenubarRootProps = {
29
+ children: React__default.ReactNode;
30
+ customRootClass?: string;
31
+ className?: string;
32
+ } & ComponentPropsWithoutRef<typeof Floater.Composite>;
33
+
34
+ type MenubarMenuProps = {
35
+ children: React__default.ReactNode;
36
+ className?: string;
37
+ } & ComponentPropsWithoutRef<typeof MenuPrimitive.Root>;
38
+
39
+ type MenubarTriggerProps = {
40
+ children: React__default.ReactNode;
41
+ className?: string;
42
+ } & ComponentPropsWithoutRef<typeof MenuPrimitive.Trigger>;
43
+
44
+ type MenubarContentProps = {
45
+ children: React__default.ReactNode;
46
+ className?: string;
47
+ } & ComponentPropsWithoutRef<typeof MenuPrimitive.Content>;
48
+
49
+ type MenubarPortalProps = {
50
+ children: React__default.ReactNode;
51
+ } & ComponentPropsWithoutRef<typeof MenuPrimitive.Portal>;
52
+
53
+ type MenubarItemProps = {
54
+ children: React__default.ReactNode;
55
+ className?: string;
56
+ label?: string;
57
+ } & ComponentPropsWithoutRef<typeof MenuPrimitive.Item>;
58
+
59
+ type MenubarSubProps = {
60
+ children: React__default.ReactNode;
61
+ className?: string;
62
+ } & ComponentPropsWithoutRef<typeof MenuPrimitive.Sub>;
63
+
64
+ type MenubarSubTriggerProps = {
65
+ children: React__default.ReactNode;
66
+ className?: string;
67
+ } & ComponentPropsWithoutRef<typeof MenuPrimitive.Trigger>;
68
+
69
+ type PrimitiveDivProps = ComponentPropsWithoutRef<typeof Primitive.div>;
70
+ type SeparatorProps = {
71
+ orientation?: 'horizontal' | 'vertical';
72
+ customRootClass?: string;
73
+ color?: string;
74
+ decorative?: boolean;
75
+ } & PrimitiveDivProps;
76
+ declare const Separator: React__default.ForwardRefExoticComponent<SeparatorProps & React__default.RefAttributes<HTMLElement>>;
77
+
78
+ type MenubarSeparatorProps = {
79
+ className?: string;
80
+ } & ComponentPropsWithoutRef<typeof Separator>;
81
+
39
82
  declare const Menubar: {
40
83
  (): null;
41
- Root: react.ForwardRefExoticComponent<{
84
+ Root: React$1.ForwardRefExoticComponent<{
42
85
  children: React.ReactNode;
43
86
  customRootClass?: string;
44
87
  className?: string;
45
- } & Omit<Omit<react.HTMLProps<HTMLElement> & _floating_ui_react.CompositeProps, "ref"> & react.RefAttributes<HTMLElement>, "ref"> & react.RefAttributes<HTMLElement>>;
46
- Menu: react.ForwardRefExoticComponent<{
88
+ } & Omit<Omit<React$1.HTMLProps<HTMLElement> & _floating_ui_react.CompositeProps, "ref"> & React$1.RefAttributes<HTMLElement>, "ref"> & React$1.RefAttributes<HTMLElement>>;
89
+ Menu: React$1.ForwardRefExoticComponent<{
47
90
  children: React.ReactNode;
48
91
  className?: string;
49
92
  } & Omit<{
@@ -58,26 +101,26 @@ declare const Menubar: {
58
101
  placement?: "top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end";
59
102
  avoidCollision?: boolean;
60
103
  rtl?: boolean;
61
- } & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
62
- Trigger: react.ForwardRefExoticComponent<{
104
+ } & Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
105
+ Trigger: React$1.ForwardRefExoticComponent<{
63
106
  children: React.ReactNode;
64
107
  className?: string;
65
- } & Omit<MenuPrimitiveTriggerProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
66
- Content: react.ForwardRefExoticComponent<{
108
+ } & Omit<MenuPrimitiveTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
109
+ Content: React$1.ForwardRefExoticComponent<{
67
110
  children: React.ReactNode;
68
111
  className?: string;
69
- } & Omit<MenuPrimitiveContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
70
- Portal: react.ForwardRefExoticComponent<{
112
+ } & Omit<MenuPrimitiveContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
113
+ Portal: React$1.ForwardRefExoticComponent<{
71
114
  children: React.ReactNode;
72
115
  } & Omit<{
73
116
  children: React.ReactNode;
74
- } & _floating_ui_react.FloatingPortalProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
75
- Item: react.ForwardRefExoticComponent<{
117
+ } & _floating_ui_react.FloatingPortalProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
118
+ Item: React$1.ForwardRefExoticComponent<{
76
119
  children: React.ReactNode;
77
120
  className?: string;
78
121
  label?: string;
79
- } & Omit<MenuPrimitiveItemProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
80
- Sub: react.ForwardRefExoticComponent<{
122
+ } & Omit<MenuPrimitiveItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
123
+ Sub: React$1.ForwardRefExoticComponent<{
81
124
  children: React.ReactNode;
82
125
  className?: string;
83
126
  } & Omit<{
@@ -98,12 +141,13 @@ declare const Menubar: {
98
141
  placement?: "top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end";
99
142
  avoidCollision?: boolean;
100
143
  rtl?: boolean;
101
- } & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
102
- SubTrigger: react.ForwardRefExoticComponent<{
144
+ } & Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
145
+ SubTrigger: React$1.ForwardRefExoticComponent<{
103
146
  children: React.ReactNode;
104
147
  className?: string;
105
- } & Omit<MenuPrimitiveTriggerProps & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
106
- Separator: react.ForwardRefExoticComponent<MenubarSeparatorProps & react.RefAttributes<HTMLElement>>;
148
+ } & Omit<MenuPrimitiveTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
149
+ Separator: React$1.ForwardRefExoticComponent<MenubarSeparatorProps & React$1.RefAttributes<HTMLElement>>;
107
150
  };
108
151
 
109
152
  export { Menubar as default };
153
+ export type { MenubarContentProps, MenubarItemProps, MenubarMenuProps, MenubarPortalProps, MenubarRootProps, MenubarSeparatorProps, MenubarSubProps, MenubarSubTriggerProps, MenubarTriggerProps };
@@ -1 +1 @@
1
- 'use client';import{_ as e,a as r,b as t}from"./tslib.es6-BtVxab8e.js";import a,{forwardRef as n}from"react";import{c as o}from"./index-BVxS3Ixi.js";import{c as s}from"./clsx-BaVHROc5.js";import{F as u}from"./index-Di6TooPD.js";import{M as l}from"./MenuPrimitive-CPcrK1EK.js";import i from"./Separator.js";import"./floating-ui.react-CLbXmKZY.js";import"react/jsx-runtime";import"react-dom";import"./index-fkj4Fdgt.js";import"./index-Dc5Cm9z0.js";import"./index-DnCiOYxZ.js";var c=a.createContext(null),m=n((function(n,l){var i=n.children,m=n.customRootClass,d=n.className,b=n.dir,f=n.loop,p=e(n,["children","customRootClass","className","dir","loop"]),v=o(m,"Menubar"),M=a.useState([]),h=M[0],N=M[1],C=a.useState(0),g=C[0],x=C[1],R=function(e,t){N((function(a){return a.map((function(a){return a.id===e?r(r({},a),{state:t}):a}))}))};return a.createElement(c.Provider,{value:{rootClass:v,registerItem:function(e,a){void 0===a&&(a="closed"),N((function(n){return n.find((function(r){return r.id===e}))?n.map((function(t){return t.id===e?r(r({},t),{state:a}):t})):t(t([],n,!0),[{id:e,state:a}],!1)}))},items:h,updateItemState:R}},a.createElement(u.Composite,r({ref:l,className:s("".concat(v,"-root"),d),dir:b,loop:f},p,{activeIndex:g,onNavigate:function(e){var r=h[g],t=h[e];if(r&&R(r.id,"closed"),t){var a="open"===(null==r?void 0:r.state);R(t.id,a?"open":"closed")}x(e)}}),i))}));m.displayName="MenubarRoot";var d=a.createContext(null),b=n((function(t,n){var o=t.children,i=t.className,m=e(t,["children","className"]),b=a.useContext(c),f=a.useContext(d);if(!b)return console.warn("MenubarTrigger should be used in the MenubarRoot"),null;var p=b.rootClass;if(!f)return console.warn("MenubarTrigger should be used in the MenubarMenu"),null;var v=f.isOpen;return a.createElement(u.CompositeItem,{render:function(){return a.createElement(l.Trigger,r({ref:n,className:s("".concat(p,"-trigger"),i),"data-active":v},m),o)}})}));b.displayName="MenubarTrigger";var f=n((function(t,n){var o=t.children,u=t.className,i=e(t,["children","className"]),m=a.useContext(c);if(!m)return console.warn("MenubarContent should be used in the MenubarRoot"),null;var d=m.rootClass;return a.createElement(l.Content,r({ref:n,className:s("".concat(d,"-content"),u)},i),o)}));f.displayName="MenubarContent";var p=n((function(t,n){var o=t.children,s=e(t,["children"]);return a.useContext(c)?a.createElement(l.Portal,r({ref:n},s),o):(console.warn("MenubarPortal should be used in the MenubarRoot"),null)}));p.displayName="MenubarPortal";var v=n((function(t,n){var o=t.children,u=t.className,i=t.label,m=e(t,["children","className","label"]),d=a.useContext(c);if(!d)return console.warn("MenubarItem should be used in the MenubarRoot"),null;var b=d.rootClass;return a.createElement(l.Item,r({ref:n,className:s("".concat(b,"-item"),u),label:i},m),o)}));v.displayName="MenubarItem";var M=n((function(t,n){var o=t.children,u=t.className,i=e(t,["children","className"]),m=a.useContext(c);if(!m)return console.warn("MenubarSub should be used in the MenubarRoot"),null;var d=m.rootClass;return a.createElement(l.Sub,r({ref:n,className:s("".concat(d,"-sub"),u)},i),o)}));M.displayName="MenubarSub";var h=n((function(t,n){var o=t.children,u=t.className,i=e(t,["children","className"]),m=a.useContext(c);if(!m)return console.warn("MenubarSubTrigger should be used in the MenubarRoot"),null;var d=m.rootClass;return a.createElement(l.Trigger,r({ref:n,className:s("".concat(d,"-sub-trigger"),u)},i),o)}));h.displayName="MenubarSubTrigger";var N=n((function(t,n){var o,i=t.children,m=t.className,b=e(t,["children","className"]),f=a.useContext(c),p=u.useId();if(!f)return console.warn("MenubarMenu should be used in the MenubarRoot"),null;var v=f.rootClass,M=f.registerItem,h=f.items,N=f.updateItemState;a.useEffect((function(){p&&M(p)}),[p]);var C="open"===(null===(o=h.find((function(e){return e.id===p})))||void 0===o?void 0:o.state);return a.createElement(l.Root,r({ref:n,className:s("".concat(v,"-menu"),m),"data-id":p,"data-active":C,open:C,onOpenChange:function(e){return p&&N(p,e?"open":"closed")}},b),a.createElement(d.Provider,{value:{isOpen:C}},i))}));N.displayName="MenubarMenu";var C=n((function(t,n){var o=t.className,s=e(t,["className"]),u=a.useContext(c);if(!u)return console.warn("MenubarSeparator should be used within MenubarRoot"),null;var l=u.rootClass;return a.createElement(i,r({ref:n,customRootClass:l,className:o},s))}));C.displayName="MenubarSeparator";var g=function(){return console.warn("Direct usage of Menubar is not supported. Please use Menubar.Root, Menubar.Item instead."),null};g.Root=m,g.Menu=N,g.Trigger=b,g.Content=f,g.Portal=p,g.Item=v,g.Sub=M,g.SubTrigger=h,g.Separator=C;export{g as default};
1
+ 'use client';import{jsx as e}from"react/jsx-runtime";import t,{forwardRef as n}from"react";import{c as r}from"./index-6If6D2Zi.js";import{c as o}from"./clsx-BaVHROc5.js";import{F as s}from"./index-yqRHPukT.js";import{M as a}from"./MenuPrimitive-6Qr46BSn.js";import u from"./Separator.js";import"./floating-ui.react-DMgxgTKq.js";import"react-dom";import"./index-wRElCyvx.js";import"./index-98jQ1vTr.js";import"./index-BOy86lYu.js";const l=t.createContext(null),i=n((({children:n,customRootClass:a,className:u,dir:i,loop:c,...d},m)=>{const b=r(a,"Menubar"),[p,h]=t.useState([]),[M,f]=t.useState(0),g=(e,t)=>{h((n=>n.map((n=>n.id===e?{...n,state:t}:n))))};return e(l.Provider,{value:{rootClass:b,registerItem:(e,t="closed")=>{h((n=>n.find((t=>t.id===e))?n.map((n=>n.id===e?{...n,state:t}:n)):[...n,{id:e,state:t}]))},items:p,updateItemState:g},children:e(s.Composite,{ref:m,className:o(`${b}-root`,u),dir:i,loop:c,...d,activeIndex:M,onNavigate:e=>{const t=p[M],n=p[e];if(t&&g(t.id,"closed"),n){const e="open"===t?.state;g(n.id,e?"open":"closed")}f(e)},children:n})})}));i.displayName="MenubarRoot";const c=t.createContext(null),d=n((({children:n,className:r,...u},i)=>{const d=t.useContext(l),m=t.useContext(c);if(!d)return console.warn("MenubarTrigger should be used in the MenubarRoot"),null;const{rootClass:b}=d;if(!m)return console.warn("MenubarTrigger should be used in the MenubarMenu"),null;const{isOpen:p}=m;return e(s.CompositeItem,{render:()=>e(a.Trigger,{ref:i,className:o(`${b}-trigger`,r),"data-active":p,...u,children:n})})}));d.displayName="MenubarTrigger";const m=n((({children:n,className:r,...s},u)=>{const i=t.useContext(l);if(!i)return console.warn("MenubarContent should be used in the MenubarRoot"),null;const{rootClass:c}=i;return e(a.Content,{ref:u,className:o(`${c}-content`,r),...s,children:n})}));m.displayName="MenubarContent";const b=n((({children:n,...r},o)=>t.useContext(l)?e(a.Portal,{ref:o,...r,children:n}):(console.warn("MenubarPortal should be used in the MenubarRoot"),null)));b.displayName="MenubarPortal";const p=n((({children:n,className:r,label:s,...u},i)=>{const c=t.useContext(l);if(!c)return console.warn("MenubarItem should be used in the MenubarRoot"),null;const{rootClass:d}=c;return e(a.Item,{ref:i,className:o(`${d}-item`,r),label:s,...u,children:n})}));p.displayName="MenubarItem";const h=n((({children:n,className:r,...s},u)=>{const i=t.useContext(l);if(!i)return console.warn("MenubarSub should be used in the MenubarRoot"),null;const{rootClass:c}=i;return e(a.Sub,{ref:u,className:o(`${c}-sub`,r),...s,children:n})}));h.displayName="MenubarSub";const M=n((({children:n,className:r,...s},u)=>{const i=t.useContext(l);if(!i)return console.warn("MenubarSubTrigger should be used in the MenubarRoot"),null;const{rootClass:c}=i;return e(a.Trigger,{ref:u,className:o(`${c}-sub-trigger`,r),...s,children:n})}));M.displayName="MenubarSubTrigger";const f=n((({children:n,className:r,...u},i)=>{const d=t.useContext(l),m=s.useId();if(!d)return console.warn("MenubarMenu should be used in the MenubarRoot"),null;const{rootClass:b,registerItem:p,items:h,updateItemState:M}=d;t.useEffect((()=>{m&&p(m)}),[m]);const f="open"===h.find((e=>e.id===m))?.state;return e(a.Root,{ref:i,className:o(`${b}-menu`,r),"data-id":m,"data-active":f,open:f,onOpenChange:e=>m&&M(m,e?"open":"closed"),...u,children:e(c.Provider,{value:{isOpen:f},children:n})})}));f.displayName="MenubarMenu";const g=n((({className:n,...r},o)=>{const s=t.useContext(l);if(!s)return console.warn("MenubarSeparator should be used within MenubarRoot"),null;const{rootClass:a}=s;return e(u,{ref:o,customRootClass:a,className:n,...r})}));g.displayName="MenubarSeparator";const C=()=>(console.warn("Direct usage of Menubar is not supported. Please use Menubar.Root, Menubar.Item instead."),null);C.Root=i,C.Menu=f,C.Trigger=d,C.Content=m,C.Portal=b,C.Item=p,C.Sub=h,C.SubTrigger=M,C.Separator=g;export{C as default};
@@ -1,36 +1,38 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
1
2
  import React from 'react';
2
3
 
3
4
  type MinimapRootProps = React.HTMLAttributes<HTMLDivElement> & {
4
5
  customRootClass?: string;
5
6
  };
6
- declare const MinimapRoot: ({ children, className, customRootClass, ...props }: MinimapRootProps) => React.JSX.Element;
7
+ declare const MinimapRoot: ({ children, className, customRootClass, ...props }: MinimapRootProps) => react_jsx_runtime.JSX.Element;
7
8
 
8
9
  type MinimapItemProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
9
10
  value: string;
10
11
  };
11
- declare const MinimapItem: ({ children, className, value, ...props }: MinimapItemProps) => React.JSX.Element;
12
+ declare const MinimapItem: ({ children, className, value, ...props }: MinimapItemProps) => react_jsx_runtime.JSX.Element;
12
13
 
13
- declare const MinimapTrack: ({ children, className, ...props }: MinimapTrackProps) => React.JSX.Element;
14
+ type MinimapTrackProps = React.HTMLAttributes<HTMLDivElement>;
15
+ declare const MinimapTrack: ({ children, className, ...props }: MinimapTrackProps) => react_jsx_runtime.JSX.Element;
14
16
 
15
17
  type MinimapLineProps = React.HTMLAttributes<HTMLDivElement>;
16
- declare const MinimapLine: ({ children, className, ...props }: MinimapLineProps) => React.JSX.Element;
18
+ declare const MinimapLine: ({ children, className, ...props }: MinimapLineProps) => react_jsx_runtime.JSX.Element;
17
19
 
18
20
  type MinimapContentProps = React.HTMLAttributes<HTMLDivElement>;
19
- declare const MinimapContent: ({ children, className, ...props }: MinimapContentProps) => React.JSX.Element;
21
+ declare const MinimapContent: ({ children, className, ...props }: MinimapContentProps) => react_jsx_runtime.JSX.Element;
20
22
 
21
23
  type MinimapBubbleProps = React.HTMLAttributes<HTMLDivElement>;
22
- declare const MinimapBubble: ({ children, className, ...props }: MinimapBubbleProps) => React.JSX.Element;
24
+ declare const MinimapBubble: ({ children, className, ...props }: MinimapBubbleProps) => react_jsx_runtime.JSX.Element;
23
25
 
24
26
  type MinimapProviderProps = React.HTMLAttributes<HTMLDivElement> & {
25
27
  children: React.ReactNode;
26
28
  scrollable?: boolean;
27
29
  };
28
- declare const MinimapProvider: ({ children, className, scrollable, ...props }: MinimapProviderProps) => React.JSX.Element;
30
+ declare const MinimapProvider: ({ children, className, scrollable, ...props }: MinimapProviderProps) => react_jsx_runtime.JSX.Element;
29
31
 
30
32
  type MinimapWaypointProps = React.HTMLAttributes<HTMLDivElement> & {
31
33
  value?: string | null;
32
34
  };
33
- declare const MinimapWaypoint: ({ children, className, value, ...props }: MinimapWaypointProps) => React.JSX.Element;
35
+ declare const MinimapWaypoint: ({ children, className, value, ...props }: MinimapWaypointProps) => react_jsx_runtime.JSX.Element;
34
36
 
35
37
  declare const MinimapComponent: () => null;
36
38
  type MinimapComponentType = typeof MinimapComponent & {
@@ -46,3 +48,4 @@ type MinimapComponentType = typeof MinimapComponent & {
46
48
  declare const Minimap: MinimapComponentType;
47
49
 
48
50
  export { Minimap as default };
51
+ export type { MinimapBubbleProps, MinimapContentProps, MinimapItemProps, MinimapLineProps, MinimapProviderProps, MinimapRootProps, MinimapTrackProps, MinimapWaypointProps };
@@ -1 +1 @@
1
- 'use client';import{_ as e,a as t,b as n}from"./tslib.es6-BtVxab8e.js";import o,{createContext as r,useRef as l,useEffect as a}from"react";import{c as i}from"./clsx-BaVHROc5.js";import{c as s}from"./index-BVxS3Ixi.js";import{P as c}from"./index-Dc5Cm9z0.js";import{R as u}from"./index-BRmT6kl7.js";import"./index-DnCiOYxZ.js";var m=r({rootClass:"",rootRef:null}),d=r({value:"",isVisible:!1}),f=r({visibleItems:[],handleInView:function(){},handleOutView:function(){},scrollToItem:function(){},registerRef:function(){}});function v(e){if(!e)return null;var t=window.getComputedStyle(e).overflowY;return"auto"===t||"scroll"===t?e:v(e.parentElement)}function h(e){var t=e.onEnter,n=e.onLeave,o=e.threshold,r=void 0===o?0:o,i=e.rootMargin,s=void 0===i?"0px":i,c=e.root,u=l(null);return a((function(){if("undefined"!=typeof window&&"IntersectionObserver"in window&&u.current){var e=null!=c?c:v(u.current),o=new IntersectionObserver((function(e){e.forEach((function(e){e.isIntersecting?null==t||t():null==n||n()}))}),{threshold:r,rootMargin:s,root:e});return o.observe(u.current),function(){u.current&&o.unobserve(u.current),o.disconnect()}}}),[t,n,r,s,c]),u}var C=Object.assign((function(){return console.warn("Direct usage of Minimap is not supported. Please use Minimap.Root, Minimap.Item instead."),null}),{Root:function(n){var r=n.children,l=n.className,a=n.customRootClass,d=void 0===a?"":a,f=e(n,["children","className","customRootClass"]),v=s(d,"Minimap"),h=o.useRef(null);return o.createElement(m.Provider,{value:{rootClass:v,rootRef:h}},o.createElement(u.Root,{loop:!0,orientation:"both"},o.createElement(u.Group,null,o.createElement(c.div,t({ref:h,className:i(v,l)},f),r))))},Item:function(n){var r=n.children,l=n.className,a=void 0===l?"":l,s=n.value,v=e(n,["children","className","value"]),h=(o.useContext(m)||{rootClass:""}).rootClass,C=o.useContext(f),b=C.visibleItems,p=C.scrollToItem,w=b.includes(s),N=o.useMemo((function(){return{value:s,isVisible:w}}),[s,w]),g=o.useCallback((function(){p(s)}),[s,p]);return o.createElement(d.Provider,{value:N},o.createElement(u.Item,{value:s},o.createElement(c.button,t({onClick:g,className:i("".concat(h,"-item"),a),"data-in-view":w?"true":"false"},v),r)))},Track:function(n){var r=n.children,l=n.className,a=void 0===l?"":l,s=e(n,["children","className"]),c=o.useContext(m).rootClass;return o.createElement("div",t({className:i("".concat(c,"-track"),a)},s),r)},Line:function(n){var r=n.children,l=n.className,a=void 0===l?"":l,s=e(n,["children","className"]),c=(o.useContext(m)||{rootClass:""}).rootClass,u=(o.useContext(d)||{value:""}).value,v=o.useContext(f).visibleItems,h=v.indexOf(u),C=-1!==h,b=-1!==h&&h<v.length-1,p=C&&b;return o.createElement("div",t({className:i("".concat(c,"-line"),a),"data-in-view":p?"true":"false"},s),r)},Content:function(n){var r=n.children,l=n.className,a=void 0===l?"":l,s=e(n,["children","className"]),c=o.useContext(m).rootClass;return o.createElement("div",t({className:i("".concat(c,"-content"),a)},s),r)},Bubble:function(n){var r=n.children,l=n.className,a=void 0===l?"":l,s=e(n,["children","className"]),c=(o.useContext(m)||{rootClass:""}).rootClass,u=(o.useContext(d)||{isVisible:!1}).isVisible;return o.createElement("div",t({className:i("".concat(c,"-bubble"),a),"data-in-view":u?"true":"false"},s),r)},Provider:function(r){var l=r.children,a=r.className,i=void 0===a?"":a,s=r.scrollable,c=e(r,["children","className","scrollable"]),u=o.useState([]),m=u[0],d=u[1],v=o.useRef(new Map),h=o.useRef(null),C=o.useCallback((function(e,t){t?v.current.set(e,t):v.current.delete(e)}),[]),b=o.useCallback((function(e){d((function(t){return null===e||t.includes(e)?t:n(n([],t,!0),[e],!1).sort((function(e,t){var n=v.current.get(e),o=v.current.get(t);return n&&o?n.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1:0}))}))}),[]),p=o.useCallback((function(e){d((function(t){return null!==e&&t.includes(e)?t.filter((function(t){return t!==e})):t}))}),[]),w=o.useCallback((function(e){var t=v.current.get(e);if(t){var n=null;if(s&&h.current)n=h.current;else{var o=function(e){if(!e||e===document.body)return null;var t=window.getComputedStyle(e);return("auto"===t.overflow||"scroll"===t.overflow||"auto"===t.overflowY||"scroll"===t.overflowY)&&e.scrollHeight>e.clientHeight?e:o(e.parentElement)};n=o(t.parentElement)}if(n){var r=t.getBoundingClientRect(),l=n.getBoundingClientRect(),a=r.top-l.top+n.scrollTop,i=n.scrollHeight-n.clientHeight,c=Math.max(0,Math.min(a,i));Math.abs(c-n.scrollTop)>1&&n.scrollTo({top:c,behavior:"smooth"})}}}),[]),N=o.useMemo((function(){return{visibleItems:m,handleInView:b,handleOutView:p,scrollToItem:w,registerRef:C}}),[m,b,p,w,C]);return o.createElement(f.Provider,{value:N},o.createElement("div",t({ref:h,className:"".concat(i)},c),l))},Waypoint:function(n){var r=n.children,l=n.className,a=void 0===l?"":l,s=n.value,c=void 0===s?"":s,u=e(n,["children","className","value"]),m=o.useContext(f),d=m.handleInView,v=m.handleOutView,C=m.registerRef,b=h({onEnter:o.useCallback((function(){console.log("waypoint",c,"in view"),d(c)}),[c,d]),onLeave:o.useCallback((function(){console.log("waypoint",c,"out of view"),v(c)}),[c,v]),threshold:.1}),p=o.useCallback((function(e){"function"==typeof b?b(e):b&&(b.current=e),c&&C(c,e)}),[b,c,C]);return o.createElement("div",t({ref:p,className:i(a)},u),r)}});export{C as default};
1
+ 'use client';import{jsx as e}from"react/jsx-runtime";import t,{createContext as r,useRef as n,useEffect as o}from"react";import{c as l}from"./clsx-BaVHROc5.js";import{c as s}from"./index-6If6D2Zi.js";import{P as i}from"./index-98jQ1vTr.js";import{R as a}from"./index-hAp0hL9w.js";import"./index-BOy86lYu.js";const c=r({rootClass:"",rootRef:null}),u=r({value:"",isVisible:!1}),d=r({visibleItems:[],handleInView:()=>{},handleOutView:()=>{},scrollToItem:()=>{},registerRef:()=>{}});function m(e){if(!e)return null;const t=window.getComputedStyle(e).overflowY;return"auto"===t||"scroll"===t?e:m(e.parentElement)}function h({onEnter:e,onLeave:t,threshold:r=0,rootMargin:l="0px",root:s}){const i=n(null);return o((()=>{if("undefined"==typeof window||!("IntersectionObserver"in window))return;if(!i.current)return;const n=s??m(i.current),o=new IntersectionObserver((r=>{r.forEach((r=>{r.isIntersecting?e?.():t?.()}))}),{threshold:r,rootMargin:l,root:n});return o.observe(i.current),()=>{i.current&&o.unobserve(i.current),o.disconnect()}}),[e,t,r,l,s]),i}const f=Object.assign((()=>(console.warn("Direct usage of Minimap is not supported. Please use Minimap.Root, Minimap.Item instead."),null)),{Root:({children:r,className:n,customRootClass:o="",...u})=>{const d=s(o,"Minimap"),m=t.useRef(null);return e(c.Provider,{value:{rootClass:d,rootRef:m},children:e(a.Root,{loop:!0,orientation:"both",children:e(a.Group,{children:e(i.div,{ref:m,className:l(d,n),...u,children:r})})})})},Item:({children:r,className:n="",value:o,...s})=>{const{rootClass:m}=t.useContext(c)||{rootClass:""},{visibleItems:h,scrollToItem:f}=t.useContext(d),v=h.includes(o),C=t.useMemo((()=>({value:o,isVisible:v})),[o,v]),p=t.useCallback((()=>{f(o)}),[o,f]);return e(u.Provider,{value:C,children:e(a.Item,{value:o,children:e(i.button,{onClick:p,className:l(`${m}-item`,n),"data-in-view":v?"true":"false",...s,children:r})})})},Track:({children:r,className:n="",...o})=>{const{rootClass:s}=t.useContext(c);return e("div",{className:l(`${s}-track`,n),...o,children:r})},Line:({children:r,className:n="",...o})=>{const{rootClass:s}=t.useContext(c)||{rootClass:""},{value:i}=t.useContext(u)||{value:""},{visibleItems:a}=t.useContext(d),m=a.indexOf(i),h=-1!==m,f=-1!==m&&m<a.length-1,v=h&&f;return e("div",{className:l(`${s}-line`,n),"data-in-view":v?"true":"false",...o,children:r})},Content:({children:r,className:n="",...o})=>{const{rootClass:s}=t.useContext(c);return e("div",{className:l(`${s}-content`,n),...o,children:r})},Bubble:({children:r,className:n="",...o})=>{const{rootClass:s}=t.useContext(c)||{rootClass:""},{isVisible:i}=t.useContext(u)||{isVisible:!1};return e("div",{className:l(`${s}-bubble`,n),"data-in-view":i?"true":"false",...o,children:r})},Provider:({children:r,className:n="",scrollable:o,...l})=>{const[s,i]=t.useState([]),a=t.useRef(new Map),c=t.useRef(null),u=t.useCallback(((e,t)=>{t?a.current.set(e,t):a.current.delete(e)}),[]),m=t.useCallback((e=>{i((t=>{if(null===e||t.includes(e))return t;return[...t,e].sort(((e,t)=>{const r=a.current.get(e),n=a.current.get(t);if(!r||!n)return 0;return r.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}))}))}),[]),h=t.useCallback((e=>{i((t=>null!==e&&t.includes(e)?t.filter((t=>t!==e)):t))}),[]),f=t.useCallback((e=>{const t=a.current.get(e);if(!t)return;let r=null;if(o&&c.current)r=c.current;else{const e=t=>{if(!t||t===document.body)return null;const r=window.getComputedStyle(t);return("auto"===r.overflow||"scroll"===r.overflow||"auto"===r.overflowY||"scroll"===r.overflowY)&&t.scrollHeight>t.clientHeight?t:e(t.parentElement)};r=e(t.parentElement)}if(r){const e=t.getBoundingClientRect(),n=r.getBoundingClientRect(),o=e.top-n.top+r.scrollTop,l=r.scrollHeight-r.clientHeight,s=Math.max(0,Math.min(o,l));Math.abs(s-r.scrollTop)>1&&r.scrollTo({top:s,behavior:"smooth"})}}),[]),v=t.useMemo((()=>({visibleItems:s,handleInView:m,handleOutView:h,scrollToItem:f,registerRef:u})),[s,m,h,f,u]);return e(d.Provider,{value:v,children:e("div",{ref:c,className:`${n}`,...l,children:r})})},Waypoint:({children:r,className:n="",value:o="",...s})=>{const{handleInView:i,handleOutView:a,registerRef:c}=t.useContext(d),u=h({onEnter:t.useCallback((()=>{console.log("waypoint",o,"in view"),i(o)}),[o,i]),onLeave:t.useCallback((()=>{console.log("waypoint",o,"out of view"),a(o)}),[o,a]),threshold:.1}),m=t.useCallback((e=>{u&&"current"in u&&(u.current=e),o&&c(o,e)}),[u,o,c]);return e("div",{ref:m,className:l(n),...s,children:r})}});export{f as default};
@@ -1,27 +1,27 @@
1
1
  import * as React from 'react';
2
2
  import React__default from 'react';
3
3
 
4
- interface NavigationMenuLinkProps extends React__default.ComponentPropsWithoutRef<'a'> {
5
- href: string;
4
+ interface NavigationMenuRootProps extends React__default.ComponentPropsWithoutRef<'div'> {
5
+ children: React__default.ReactNode;
6
+ value?: string;
7
+ defaultValue?: string;
8
+ onValueChange?: (value: string) => void;
9
+ customRootClass?: string;
6
10
  }
7
11
 
8
- interface NavigationMenuContentProps extends React__default.ComponentPropsWithoutRef<'div'> {
9
- children: React__default.ReactNode;
12
+ interface NavigationMenuItemProps extends React__default.ComponentPropsWithoutRef<'div'> {
13
+ value: string;
10
14
  }
11
15
 
12
16
  interface NavigationMenuTriggerProps extends React__default.ComponentPropsWithoutRef<'button'> {
13
17
  }
14
18
 
15
- interface NavigationMenuItemProps extends React__default.ComponentPropsWithoutRef<'div'> {
16
- value: string;
19
+ interface NavigationMenuContentProps extends React__default.ComponentPropsWithoutRef<'div'> {
20
+ children: React__default.ReactNode;
17
21
  }
18
22
 
19
- interface NavigationMenuRootProps extends React__default.ComponentPropsWithoutRef<'div'> {
20
- children: React__default.ReactNode;
21
- value?: string;
22
- defaultValue?: string;
23
- onValueChange?: (value: string) => void;
24
- customRootClass?: string;
23
+ interface NavigationMenuLinkProps extends React__default.ComponentPropsWithoutRef<'a'> {
24
+ href: string;
25
25
  }
26
26
 
27
27
  declare const NavigationMenu: {
@@ -33,3 +33,4 @@ declare const NavigationMenu: {
33
33
  };
34
34
 
35
35
  export { NavigationMenu as default };
36
+ export type { NavigationMenuContentProps, NavigationMenuItemProps, NavigationMenuLinkProps, NavigationMenuRootProps, NavigationMenuTriggerProps };
@@ -1 +1 @@
1
- 'use client';import{_ as e,a as n}from"./tslib.es6-BtVxab8e.js";import a,{useEffect as t}from"react";import{R as r}from"./index-BRmT6kl7.js";import{u as o}from"./index-fkj4Fdgt.js";import{c as s}from"./index-BVxS3Ixi.js";import{c as l}from"./clsx-BaVHROc5.js";import{c as i}from"./index-DBZNt4Em.js";import"./index-Dc5Cm9z0.js";import"./index-DnCiOYxZ.js";var c=a.createContext({isOpen:"",setIsOpen:function(){},rootClass:""}),u="NavigationMenuRoot",m=a.forwardRef((function(t,i){var m=t.children,d=t.value,f=t.defaultValue,v=void 0===f?"":f,p=t.onValueChange,N=t.customRootClass,C=t.className,g=e(t,["children","value","defaultValue","onValueChange","customRootClass","className"]),h=s(N,u),E=o(d,v,p),x=E[0],R=E[1];return a.createElement("div",n({ref:i},g),a.createElement(c.Provider,{value:{isOpen:x,setIsOpen:R,rootClass:h}},a.createElement(r.Root,null,a.createElement(r.Group,{className:l("".concat(h,"-root"),C)},m))))}));m.displayName=u;var d=a.createContext({itemOpen:!1,handleTrigger:function(){}}),f=a.forwardRef((function(t,r){var o=t.value,s=t.children,u=t.className,m=t.onMouseEnter,f=t.onMouseLeave,v=t.onKeyDown,p=e(t,["value","children","className","onMouseEnter","onMouseLeave","onKeyDown"]),N=a.useContext(c),C=N.isOpen,g=N.setIsOpen,h=N.rootClass,E=C===o,x=function(){g(E?"":o)};return a.createElement(d.Provider,{value:{itemOpen:E,handleTrigger:x}},a.createElement("div",n({ref:r,onMouseEnter:i(m,x),onMouseLeave:i(f,x),className:l("".concat(h,"-item"),u),onKeyDown:i(v,(function(e){"Escape"===e.key&&g("")}))},p),s))}));f.displayName="NavigationMenuItem";var v=a.forwardRef((function(t,o){var s=t.children,u=t.className,m=t.onClick,f=e(t,["children","className","onClick"]),v=a.useContext(d).handleTrigger,p=a.useContext(c).rootClass;return a.createElement(r.Item,null,a.createElement("button",n({ref:o,onClick:i(m,v),className:l("".concat(p,"-trigger"),u)},f),s))}));v.displayName="NavigationMenuTrigger";var p=a.forwardRef((function(o,s){var i=o.children,u=o.className,m=e(o,["children","className"]),f=a.useContext(d).itemOpen,v=a.useContext(c).rootClass,p=a.useRef(null);return a.useImperativeHandle(s,(function(){return p.current})),t((function(){var e,n=null===(e=p.current)||void 0===e?void 0:e.querySelector("*");null==n||n.focus()}),[f]),f?a.createElement("div",n({ref:p,className:l("".concat(v,"-content"),u),"data-state":f?"open":"closed"},m),a.createElement(r.Root,null,a.createElement(r.Group,null,i))):null}));p.displayName="NavigationMenuContent";var N=a.forwardRef((function(t,o){var s=t.children,i=t.href,u=t.className,m=e(t,["children","href","className"]),d=a.useContext(c).rootClass;return a.createElement(r.Item,null,a.createElement("a",n({ref:o,href:i,className:l("".concat(d,"-link"),u)},m),s))}));N.displayName="NavigationMenuLink";var C={Root:m,Item:f,Trigger:v,Content:p,Link:N};export{C as default};
1
+ 'use client';import{jsx as e}from"react/jsx-runtime";import n,{useEffect as r}from"react";import{R as o}from"./index-hAp0hL9w.js";import{u as t}from"./index-wRElCyvx.js";import{c as s}from"./index-6If6D2Zi.js";import{c as a}from"./clsx-BaVHROc5.js";import{c as i}from"./index-CXzybYmm.js";import"./index-98jQ1vTr.js";import"./index-BOy86lYu.js";const l=n.createContext({isOpen:"",setIsOpen:()=>{},rootClass:""}),c="NavigationMenuRoot",d=n.forwardRef((({children:n,value:r,defaultValue:i="",onValueChange:d,customRootClass:m,className:u,...p},f)=>{const h=s(m,c),[C,N]=t(r,i,d);return e("div",{ref:f,...p,children:e(l.Provider,{value:{isOpen:C,setIsOpen:N,rootClass:h},children:e(o.Root,{children:e(o.Group,{className:a(`${h}-root`,u),children:n})})})})}));d.displayName=c;const m=n.createContext({itemOpen:!1,handleTrigger:()=>{}}),u=n.forwardRef((({value:r,children:o,className:t,onMouseEnter:s,onMouseLeave:c,onKeyDown:d,...u},p)=>{const{isOpen:f,setIsOpen:h,rootClass:C}=n.useContext(l),N=f===r,g=()=>{h(N?"":r)};return e(m.Provider,{value:{itemOpen:N,handleTrigger:g},children:e("div",{ref:p,onMouseEnter:i(s,g),onMouseLeave:i(c,g),className:a(`${C}-item`,t),onKeyDown:i(d,(e=>{"Escape"===e.key&&h("")})),...u,children:o})})}));u.displayName="NavigationMenuItem";const p=n.forwardRef((({children:r,className:t,onClick:s,...c},d)=>{const{handleTrigger:u}=n.useContext(m),{rootClass:p}=n.useContext(l);return e(o.Item,{children:e("button",{ref:d,onClick:i(s,u),className:a(`${p}-trigger`,t),...c,children:r})})}));p.displayName="NavigationMenuTrigger";const f=n.forwardRef((({children:t,className:s,...i},c)=>{const{itemOpen:d}=n.useContext(m),{rootClass:u}=n.useContext(l),p=n.useRef(null);return n.useImperativeHandle(c,(()=>p.current)),r((()=>{const e=p.current?.querySelector("*");e?.focus()}),[d]),d?e("div",{ref:p,className:a(`${u}-content`,s),"data-state":d?"open":"closed",...i,children:e(o.Root,{children:e(o.Group,{children:t})})}):null}));f.displayName="NavigationMenuContent";const h=n.forwardRef((({children:r,href:t,className:s,...i},c)=>{const{rootClass:d}=n.useContext(l);return e(o.Item,{children:e("a",{ref:c,href:t,className:a(`${d}-link`,s),...i,children:r})})}));h.displayName="NavigationMenuLink";const C={Root:d,Item:u,Trigger:p,Content:f,Link:h};export{C as default};
@@ -1,8 +1,29 @@
1
- import * as react from 'react';
1
+ import * as React from 'react';
2
+ import { ComponentPropsWithoutRef } from 'react';
3
+
4
+ type NumberFieldRootProps = {
5
+ name?: string;
6
+ defaultValue?: number | '';
7
+ value?: number | '';
8
+ onValueChange?: (value: number | '') => void;
9
+ step?: number;
10
+ largeStep?: number;
11
+ min?: number;
12
+ max?: number;
13
+ disabled?: boolean;
14
+ readOnly?: boolean;
15
+ required?: boolean;
16
+ } & ComponentPropsWithoutRef<'div'>;
17
+
18
+ type NumberFieldInputProps = ComponentPropsWithoutRef<'input'>;
19
+
20
+ type NumberFieldIncrementProps = ComponentPropsWithoutRef<'button'>;
21
+
22
+ type NumberFieldDecrementProps = ComponentPropsWithoutRef<'button'>;
2
23
 
3
24
  declare const NumberField: {
4
25
  (): null;
5
- Root: react.ForwardRefExoticComponent<{
26
+ Root: React.ForwardRefExoticComponent<{
6
27
  name?: string;
7
28
  defaultValue?: number | "";
8
29
  value?: number | "";
@@ -14,10 +35,11 @@ declare const NumberField: {
14
35
  disabled?: boolean;
15
36
  readOnly?: boolean;
16
37
  required?: boolean;
17
- } & Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
18
- Input: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & react.RefAttributes<HTMLInputElement>>;
19
- Increment: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
20
- Decrement: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & react.RefAttributes<HTMLButtonElement>>;
38
+ } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
39
+ Input: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
40
+ Increment: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
41
+ Decrement: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
21
42
  };
22
43
 
23
44
  export { NumberField as default };
45
+ export type { NumberFieldDecrementProps, NumberFieldIncrementProps, NumberFieldInputProps, NumberFieldRootProps };
@@ -1 +1 @@
1
- 'use client';import{_ as e,a as r}from"./tslib.es6-BtVxab8e.js";import n,{forwardRef as a,useContext as t}from"react";import{u as l}from"./index-fkj4Fdgt.js";import{c as i}from"./index-BVxS3Ixi.js";import{c as d}from"./clsx-BaVHROc5.js";var u=n.createContext(null),o="NumberField",s=a((function(a,t){var s=a.children,c=a.name,m=a.defaultValue,p=void 0===m?"":m,f=a.value,b=a.onValueChange,v=a.largeStep,y=a.step,N=a.min,h=a.max,F=a.disabled,g=a.readOnly,w=a.required,C=a.id,D=a.className,O=e(a,["children","name","defaultValue","value","onValueChange","largeStep","step","min","max","disabled","readOnly","required","id","className"]),k=i(D,o),x=l(f,p,b),I=x[0],S=x[1],V={inputValue:I,handleOnChange:function(e){S(""!==e?void 0!==h&&e>h?h:void 0!==N&&e<N?N:e:"")},handleStep:function(e){var r=e.type,n=e.direction,a=0;switch(r){case"small":if(!y)return;a=y;break;case"large":if(!v)return;a=v}"decrement"===n&&(a*=-1),function(e){S((function(r){var n=r;""===n&&(n=void 0!==N?N:-1);var a=n+e;return void 0!==h&&a>h?h:void 0!==N&&a<N?N:a}))}(a)},id:C,name:c,disabled:F,readOnly:g,required:w,rootClass:k};return n.createElement("div",r({ref:t,className:d("".concat(k,"-root"),D)},O),n.createElement(u.Provider,{value:V},s))}));s.displayName=o;var c=a((function(a,l){var i=a.className,o=e(a,["className"]),s=t(u);if(!s)return console.error("NumberFieldInput must be used within a NumberField"),null;var c=s.inputValue,m=s.handleOnChange,p=s.handleStep,f=s.id,b=s.name,v=s.disabled,y=s.readOnly,N=s.required,h=s.rootClass;return n.createElement("input",r({ref:l,type:"number",onKeyDown:function(e){"ArrowUp"!==e.key||e.shiftKey||(e.preventDefault(),p({direction:"increment",type:"small"})),"ArrowDown"!==e.key||e.shiftKey||(e.preventDefault(),p({direction:"decrement",type:"small"})),"ArrowUp"===e.key&&e.shiftKey&&(e.preventDefault(),p({direction:"increment",type:"large"})),"ArrowDown"===e.key&&e.shiftKey&&(e.preventDefault(),p({direction:"decrement",type:"large"}))},value:""===c?"":c,onChange:function(e){var r=e.target.value;m(""===r?"":Number(r))},id:f,name:b,disabled:v,readOnly:y,required:N,className:d("".concat(h,"-input"),i)},o))}));c.displayName="NumberFieldInput";var m=a((function(a,l){var i=a.children,o=a.className,s=e(a,["children","className"]),c=t(u);if(!c)return console.error("NumberFieldIncrement must be used within a NumberField"),null;var m=c.handleStep,p=c.rootClass,f=c.disabled,b=c.readOnly;return n.createElement("button",r({ref:l,onClick:function(){return m({direction:"increment",type:"small"})},className:d("".concat(p,"-increment"),o),disabled:f||b,type:"button"},s),i)}));m.displayName="NumberFieldIncrement";var p=a((function(a,l){var i=a.children,o=a.className,s=e(a,["children","className"]),c=t(u);if(!c)return console.error("NumberFieldDecrement must be used within a NumberField"),null;var m=c.handleStep,p=c.rootClass,f=c.disabled,b=c.readOnly;return n.createElement("button",r({ref:l,onClick:function(){return m({direction:"decrement",type:"small"})},className:d("".concat(p,"-decrement"),o),disabled:f||b,type:"button"},s),i)}));p.displayName="NumberFieldDecrement";var f=function(){return console.warn("Direct usage of NumberField is not supported. Please use NumberField.Root, NumberField.Item instead."),null};f.Root=s,f.Input=c,f.Increment=m,f.Decrement=p;export{f as default};
1
+ 'use client';import{jsx as e}from"react/jsx-runtime";import r,{forwardRef as n,useContext as t}from"react";import{u as l}from"./index-wRElCyvx.js";import{c as i}from"./index-6If6D2Zi.js";import{c as a}from"./clsx-BaVHROc5.js";const d=r.createContext(null),s="NumberField",o=n((({children:r,name:n,defaultValue:t="",value:o,onValueChange:u,largeStep:m,step:c,min:p,max:b,disabled:y,readOnly:N,required:f,id:h,className:v,...F},w)=>{const C=i(v,s),[D,g]=l(o,t,u),O={inputValue:D,handleOnChange:e=>{g(""!==e?void 0!==b&&e>b?b:void 0!==p&&e<p?p:e:"")},handleStep:({type:e,direction:r})=>{let n=0;switch(e){case"small":if(!c)return;n=c;break;case"large":if(!m)return;n=m}"decrement"===r&&(n*=-1),(e=>{g((r=>{let n=r;""===n&&(n=void 0!==p?p:-1);const t=n+e;return void 0!==b&&t>b?b:void 0!==p&&t<p?p:t}))})(n)},id:h,name:n,disabled:y,readOnly:N,required:f,rootClass:C};return e("div",{ref:w,className:a(`${C}-root`,v),...F,children:e(d.Provider,{value:O,children:r})})}));o.displayName=s;const u=n((({className:r,...n},l)=>{const i=t(d);if(!i)return console.error("NumberFieldInput must be used within a NumberField"),null;const{inputValue:s,handleOnChange:o,handleStep:u,id:m,name:c,disabled:p,readOnly:b,required:y,rootClass:N}=i;return e("input",{ref:l,type:"number",onKeyDown:e=>{"ArrowUp"!==e.key||e.shiftKey||(e.preventDefault(),u({direction:"increment",type:"small"})),"ArrowDown"!==e.key||e.shiftKey||(e.preventDefault(),u({direction:"decrement",type:"small"})),"ArrowUp"===e.key&&e.shiftKey&&(e.preventDefault(),u({direction:"increment",type:"large"})),"ArrowDown"===e.key&&e.shiftKey&&(e.preventDefault(),u({direction:"decrement",type:"large"}))},value:""===s?"":s,onChange:e=>{const r=e.target.value;o(""===r?"":Number(r))},id:m,name:c,disabled:p,readOnly:b,required:y,className:a(`${N}-input`,r),...n})}));u.displayName="NumberFieldInput";const m=n((({children:r,className:n,...l},i)=>{const s=t(d);if(!s)return console.error("NumberFieldIncrement must be used within a NumberField"),null;const{handleStep:o,rootClass:u,disabled:m,readOnly:c}=s;return e("button",{ref:i,onClick:()=>o({direction:"increment",type:"small"}),className:a(`${u}-increment`,n),disabled:m||c,type:"button",...l,children:r})}));m.displayName="NumberFieldIncrement";const c=n((({children:r,className:n,...l},i)=>{const s=t(d);if(!s)return console.error("NumberFieldDecrement must be used within a NumberField"),null;const{handleStep:o,rootClass:u,disabled:m,readOnly:c}=s;return e("button",{ref:i,onClick:()=>o({direction:"decrement",type:"small"}),className:a(`${u}-decrement`,n),disabled:m||c,type:"button",...l,children:r})}));c.displayName="NumberFieldDecrement";const p=()=>(console.warn("Direct usage of NumberField is not supported. Please use NumberField.Root, NumberField.Item instead."),null);p.Root=o,p.Input=u,p.Increment=m,p.Decrement=c;export{p as default};
@@ -24,4 +24,4 @@ type ProgressComponent = React.ForwardRefExoticComponent<ProgressProps & React.R
24
24
  declare const Progress: ProgressComponent;
25
25
 
26
26
  export { COMPONENT_NAME, Progress as default };
27
- export type { ProgressProps };
27
+ export type { ProgressIndicatorProps, ProgressProps, ProgressRootProps };
@@ -1 +1 @@
1
- 'use client';import{_ as a,a as e}from"./tslib.es6-BtVxab8e.js";import l,{createContext as r,forwardRef as s,useState as t,useEffect as o,useContext as i}from"react";import{c as n}from"./clsx-BaVHROc5.js";import{c as m}from"./index-BVxS3Ixi.js";import{P as u}from"./index-Dc5Cm9z0.js";var d=r({value:0,minValue:0,maxValue:100,rootClass:"",ariaLabel:"",state:"loading"}),c="Progress",v="loading",f="complete",x="indeterminate",g=s((function(r,s){var i,g=r.value,p=void 0===g?0:g,V=r.minValue,C=void 0===V?0:V,h=r.maxValue,b=void 0===h?100:h,N=r.children,P=r.customRootClass,y=r.getValueLabel,L=r.className,j=a(r,["value","minValue","maxValue","children","customRootClass","getValueLabel","className"]),E=t(v),R=E[0],w=E[1],I=m(P,c),M=null!==(i=null==y?void 0:y(null!=p?p:0,C,b))&&void 0!==i?i:"";o((function(){w(null===p?x:p===b?f:v)}),[p,b]);var D={value:p,minValue:C,maxValue:b,rootClass:I,getValueLabel:y,ariaLabel:M,state:R},X=j.asChild,_=a(j,["asChild"]);return l.createElement(d.Provider,{value:D},l.createElement(u.div,e({role:"progressbar","aria-label":M,"aria-valuetext":M,"aria-valuenow":null!=p?p:0,"aria-valuemin":C,"aria-valuemax":b,"data-state":R,"data-value":null!=p?p:0,"data-max":b,"data-min":C,className:n(I,L),asChild:X,ref:s},_),N))}));g.displayName=c;var p=s((function(r,s){var t=r.className,o=r.style,m=a(r,["className","style"]),c=i(d),v=c.value,f=c.minValue,x=c.maxValue,g=c.rootClass,p=c.state,V=Math.min(Math.max(null!=v?v:0,f),x),C=(V-f)/(x-f)*100,h=m.asChild,b=a(m,["asChild"]);return l.createElement(u.div,e({role:"progressbar",className:n("".concat(g,"-indicator"),t),style:e({transform:"translateX(-".concat(100-C,"%)")},o),"aria-valuenow":V,"aria-valuemax":x,"aria-valuemin":f,"data-state":p,"data-value":V,"data-max":x,"data-min":f,asChild:h,ref:s},b))}));p.displayName="ProgressIndicator";var V="Progress",C=s((function(a,r){return console.warn("Direct usage of Progress is not supported. Please use Progress.Root, Progress.Indicator, etc. instead."),l.createElement(g,e({ref:r},a))}));C.displayName=V,C.Root=g,C.Indicator=p;export{V as COMPONENT_NAME,C as default};
1
+ 'use client';import{jsx as a}from"react/jsx-runtime";import{createContext as e,forwardRef as s,useState as r,useEffect as t,useContext as l}from"react";import{c as o}from"./clsx-BaVHROc5.js";import{c as i}from"./index-6If6D2Zi.js";import{P as m}from"./index-98jQ1vTr.js";const n=e({value:0,minValue:0,maxValue:100,rootClass:"",ariaLabel:"",state:"loading"}),d="Progress",u="loading",c="complete",v="indeterminate",x=s((({value:e=0,minValue:s=0,maxValue:l=100,children:x,customRootClass:p,getValueLabel:g,className:f,...V},h)=>{const[P,C]=r(u),b=i(p,d),N=g?.(e??0,s,l)??"";t((()=>{C(null===e?v:e===l?c:u)}),[e,l]);const y={value:e,minValue:s,maxValue:l,rootClass:b,getValueLabel:g,ariaLabel:N,state:P},{asChild:j,...L}=V;return a(n.Provider,{value:y,children:a(m.div,{role:"progressbar","aria-label":N,"aria-valuetext":N,"aria-valuenow":e??0,"aria-valuemin":s,"aria-valuemax":l,"data-state":P,"data-value":e??0,"data-max":l,"data-min":s,className:o(b,f),asChild:j,ref:h,...L,children:x})})}));x.displayName=d;const p=s((({className:e,style:s,...r},t)=>{const{value:i,minValue:d,maxValue:u,rootClass:c,state:v}=l(n),x=Math.min(Math.max(i??0,d),u),p=(x-d)/(u-d)*100,{asChild:g,...f}=r;return a(m.div,{role:"progressbar",className:o(`${c}-indicator`,e),style:{transform:`translateX(-${100-p}%)`,...s},"aria-valuenow":x,"aria-valuemax":u,"aria-valuemin":d,"data-state":v,"data-value":x,"data-max":u,"data-min":d,asChild:g,ref:t,...f})}));p.displayName="ProgressIndicator";const g="Progress",f=s(((e,s)=>(console.warn("Direct usage of Progress is not supported. Please use Progress.Root, Progress.Indicator, etc. instead."),a(x,{ref:s,...e}))));f.displayName=g,f.Root=x,f.Indicator=p;export{g as COMPONENT_NAME,f as default};
@@ -1 +1 @@
1
- 'use client';import{_ as s,a}from"./tslib.es6-BtVxab8e.js";import r from"react";import{c as e}from"./index-BVxS3Ixi.js";import{c as o}from"./clsx-BaVHROc5.js";var t="Quote",m=r.forwardRef((function(m,c){var l=m.children,i=m.customRootClass,f=m.className,n=s(m,["children","customRootClass","className"]),d=e(i,t);return r.createElement("q",a({ref:c,className:o(d,f)},n),l)}));m.displayName=t;export{m as default};
1
+ 'use client';import{jsx as r}from"react/jsx-runtime";import s from"react";import{c as o}from"./index-6If6D2Zi.js";import{c as e}from"./clsx-BaVHROc5.js";const t="Quote",a=s.forwardRef((({children:s,customRootClass:a,className:m,...c},i)=>{const f=o(a,t);return r("q",{ref:i,className:e(f,m),...c,children:s})}));a.displayName=t;export{a as default};
@@ -1 +1 @@
1
- 'use client';import{_ as e,a}from"./tslib.es6-BtVxab8e.js";import i from"react";import{P as d}from"./index-Dc5Cm9z0.js";import{c as s}from"./clsx-BaVHROc5.js";import{c as r}from"./index-BVxS3Ixi.js";import{u as o,a as n,b as l}from"./index-Bf4LVEjJ.js";var t=i.forwardRef((function(s,r){var o=s.name,n=s.value,l=s.id,t=s.checked,c=s.required,m=s.onChange,u=s.disabled,h=s.asChild,v=s.className,f=e(s,["name","value","id","checked","required","onChange","disabled","asChild","className"]);return i.createElement(d.input,a({ref:r,type:"radio",checked:t,name:o,tabIndex:-1,value:n,onChange:m,id:l,"aria-disabled":u,disabled:u,required:c,"aria-required":c,asChild:h,className:v},f))}));t.displayName="RadioPrimitive";var c="Radio",m=i.forwardRef((function(d,m){var u=d.name,h=d.value,v=d.id,f=d.checked,C=void 0!==f&&f,b=d.required,p=d.onChange,N=d.disabled,k=d.asChild,q=d.className,g=d.customRootClass,x=d.variant,R=void 0===x?"":x,j=d.size,y=void 0===j?"":j,z=d.color,w=void 0===z?"":z,E=e(d,["name","value","id","checked","required","onChange","disabled","asChild","className","customRootClass","variant","size","color"]),P=r(g,c),I=i.useState(C),S=I[0],_=I[1],A=o("button",{variant:R,size:y}),B=n(w),D=l(A(),B());return i.createElement(t,a({ref:m,name:u,id:v,value:h,checked:S,required:b,onChange:function(){p&&p(),_(!S)},disabled:N,asChild:k,className:s(P,q),"data-checked":S},D(),E))}));m.displayName=c;export{m as default};
1
+ 'use client';import{jsx as e}from"react/jsx-runtime";import a from"react";import{P as i}from"./index-98jQ1vTr.js";import{c as d}from"./clsx-BaVHROc5.js";import{c as r}from"./index-6If6D2Zi.js";import{c as s,a as o,b as t}from"./index-3dZuI04X.js";const n=a.forwardRef((({name:a,value:d,id:r,checked:s,required:o,onChange:t,disabled:n,asChild:c,className:m,...l},u)=>e(i.input,{ref:u,type:"radio",checked:s,name:a,tabIndex:-1,value:d,onChange:t,id:r,"aria-disabled":n,disabled:n,required:o,"aria-required":o,asChild:c,className:m,...l})));n.displayName="RadioPrimitive";const c="Radio",m=a.forwardRef((function({name:i,value:m,id:l,checked:u=!1,required:f,onChange:h,disabled:p,asChild:C,className:b,customRootClass:v,variant:x="",size:N="",color:j="",...k},q){const R=r(v,c),[g,y]=a.useState(u),w=s("button",{variant:x,size:N}),z=t(j),P=o(w,z);return e(n,{ref:q,name:i,id:l,value:m,checked:g,required:f,onChange:()=>{h&&h(),y(!g)},disabled:p,asChild:C,className:d(R,b),"data-checked":g,...P,...k})}));m.displayName=c;export{m as default};
@@ -1,5 +1,6 @@
1
- import React, { ForwardRefExoticComponent, ComponentPropsWithoutRef, RefAttributes, ElementRef } from 'react';
1
+ import React, { ElementRef, ComponentPropsWithoutRef, ForwardRefExoticComponent, RefAttributes } from 'react';
2
2
  import { RadioGroupPrimitiveRootProps } from '~/core/primitives/RadioGroup/fragments/RadioGroupPrimitiveRoot';
3
+ import { RadioGroupPrimitiveItemProps } from '~/core/primitives/RadioGroup/fragments/RadioGroupPrimitiveItem';
3
4
 
4
5
  type RadioCardsRootProps = RadioGroupPrimitiveRootProps & {
5
6
  children: React.ReactNode;
@@ -13,6 +14,10 @@ type RadioCardsRootProps = RadioGroupPrimitiveRootProps & {
13
14
  };
14
15
  declare const RadioCardsRoot: React.ForwardRefExoticComponent<RadioCardsRootProps & React.RefAttributes<HTMLElement>>;
15
16
 
17
+ type RadioCardsItemProps = RadioGroupPrimitiveItemProps & {
18
+ children?: React.ReactNode;
19
+ className?: string;
20
+ };
16
21
  declare const RadioCardsItem: React.ForwardRefExoticComponent<Omit<{
17
22
  label?: string;
18
23
  description?: string;
@@ -35,4 +40,4 @@ interface RadioCardsComponent extends ForwardRefExoticComponent<RadioCardsProps
35
40
  declare const RadioCards: RadioCardsComponent;
36
41
 
37
42
  export { RadioCards as default };
38
- export type { RadioCardsElement, RadioCardsProps };
43
+ export type { RadioCardsElement, RadioCardsItemProps, RadioCardsProps, RadioCardsRootProps };
@@ -1 +1 @@
1
- 'use client';import a,{createContext as o,forwardRef as s,useContext as e}from"react";import{_ as r,a as i}from"./tslib.es6-BtVxab8e.js";import{R as t}from"./RadioGroupPrimitive-D9grAL7G.js";import{c as d}from"./clsx-BaVHROc5.js";import{c as m}from"./index-BVxS3Ixi.js";import{u as l,a as n,b as c}from"./index-Bf4LVEjJ.js";import"./index-Dc5Cm9z0.js";import"./index-BRmT6kl7.js";import"./index-DnCiOYxZ.js";import"./index-fkj4Fdgt.js";var v=o({rootClass:""}),u=s((function(o,s){var e=o.children,u=o.className,p=void 0===u?"":u,R=o.customRootClass,f=void 0===R?"":R,C=o.variant,j=void 0===C?"":C,N=o.size,x=void 0===N?"":N,h=o.color,I=void 0===h?"":h,y=r(o,["children","className","customRootClass","variant","size","color"]),z=m(f,"RadioCards"),E=l("radio-cards",{variant:j,size:x}),P=n(I),b=c(E(),P());return a.createElement(v.Provider,{value:{rootClass:z}},a.createElement(t.Root,i({ref:s,className:d(z,p)},b(),y),e))}));u.displayName="RadioCardsRoot";var p=s((function(o,s){var m=o.children,l=o.className,n=void 0===l?"":l,c=o.value,u=r(o,["children","className","value"]),p=e(v).rootClass;return a.createElement(t.Item,i({ref:s,className:d("".concat(p,"-item"),n)},u,{value:c}),m)}));p.displayName="RadioCardsItem";var R=s((function(a,o){return console.warn("Direct usage of RadioCards is not supported. Please use RadioCards.Root and RadioCards.Item instead."),null}));R.displayName="RadioCards",R.Root=u,R.Item=p;export{R as default};
1
+ 'use client';import{createContext as o,forwardRef as a,useContext as s}from"react";import{jsx as r}from"react/jsx-runtime";import{R as i}from"./RadioGroupPrimitive-QSMno27i.js";import{c as e}from"./clsx-BaVHROc5.js";import{c as t}from"./index-6If6D2Zi.js";import{c as d,a as m,b as n}from"./index-3dZuI04X.js";import"./index-98jQ1vTr.js";import"./index-hAp0hL9w.js";import"./index-BOy86lYu.js";import"./index-wRElCyvx.js";const l=o({rootClass:""}),c=a((({children:o,className:a="",customRootClass:s="",variant:c="",size:p="",color:R="",orientation:u="both",...C},f)=>{const j=t(s,"RadioCards"),x=d("radio-cards",{variant:c,size:p}),v=n(R),N=m(x,v);return r(l.Provider,{value:{rootClass:j},children:r(i.Root,{ref:f,className:e(j,a),...C,...N,orientation:u,children:o})})}));c.displayName="RadioCardsRoot";const p=a((({children:o,className:a="",value:t,...d},m)=>{const{rootClass:n}=s(l);return r(i.Item,{ref:m,className:e(`${n}-item`,a),...d,value:t,children:o})}));p.displayName="RadioCardsItem";const R=a(((o,a)=>(console.warn("Direct usage of RadioCards is not supported. Please use RadioCards.Root and RadioCards.Item instead."),null)));R.displayName="RadioCards",R.Root=c,R.Item=p;export{R as default};
@@ -48,4 +48,4 @@ type RadioGroupComponent = React.ForwardRefExoticComponent<RadioGroupProps & Rea
48
48
  declare const RadioGroup: RadioGroupComponent;
49
49
 
50
50
  export { RadioGroup as default };
51
- export type { RadioGroupElement, RadioGroupProps };
51
+ export type { RadioGroupElement, RadioGroupProps, RadioGroupRootProps };
@@ -1 +1 @@
1
- 'use client';import a,{createContext as o,useContext as e}from"react";import{_ as r,a as s}from"./tslib.es6-BtVxab8e.js";import{R as i}from"./RadioGroupPrimitive-D9grAL7G.js";import{c as t}from"./clsx-BaVHROc5.js";import{c as l}from"./index-BVxS3Ixi.js";import{u as d,a as n,b as c}from"./index-Bf4LVEjJ.js";import{P as m}from"./index-Dc5Cm9z0.js";import"./index-BRmT6kl7.js";import"./index-DnCiOYxZ.js";import"./index-fkj4Fdgt.js";var u=o({rootClass:""}),p=a.forwardRef((function(o,e){var m=o.children,p=o.className,f=void 0===p?"":p,v=o.customRootClass,R=void 0===v?"":v,N=o.variant,h=void 0===N?"":N,C=o.size,x=void 0===C?"":C,G=o.color,j=void 0===G?"":G,I=r(o,["children","className","customRootClass","variant","size","color"]),b=l(R,"RadioGroup"),w=d("radio-group",{variant:h,size:x}),y=n(j),E=c(w(),y());return a.createElement(u.Provider,{value:{rootClass:b}},a.createElement(i.Root,s({ref:e,className:t("".concat(b,"-root"),f)},E(),I)," ",m," "))}));p.displayName="RadioGroupRoot";var f=a.forwardRef((function(o,l){var d=o.children,n=o.className,c=void 0===n?"":n,m=o.value,p=r(o,["children","className","value"]),f=e(u).rootClass;return a.createElement(i.Item,s({ref:l,className:t("".concat(f,"-item"),c),value:m},p),d)}));f.displayName="RadioGroupItem";var v=a.forwardRef((function(o,e){var l=o.className,d=void 0===l?"":l,n=o.children,c=r(o,["className","children"]),m=a.useContext(u).rootClass;return a.createElement(i.Indicator,s({ref:e,className:t("".concat(m,"-indicator"),d)},c),n)}));v.displayName="RadioGroupIndicator";var R=a.forwardRef((function(o,e){var i=o.className,l=void 0===i?"":i,d=o.asChild,n=void 0!==d&&d,c=o.children,p=r(o,["className","asChild","children"]),f=a.useContext(u).rootClass;return a.createElement(m.label,s({ref:e},p,{className:t("".concat(f,"-label"),l),asChild:n})," ",c," ")}));R.displayName="RadioGroupLabel";var N=a.forwardRef((function(a,o){return console.warn("Direct usage of RadioGroup is not supported. Please use RadioGroup.Root and RadioGroup.Item instead."),null}));N.displayName="RadioGroup",N.Root=p,N.Item=f,N.Indicator=v,N.Label=R;export{N as default};
1
+ 'use client';import o,{createContext as r,useContext as a}from"react";import{jsx as e,jsxs as s}from"react/jsx-runtime";import{R as i}from"./RadioGroupPrimitive-QSMno27i.js";import{c as t}from"./clsx-BaVHROc5.js";import{c as d}from"./index-6If6D2Zi.js";import{c as l,a as n,b as c}from"./index-3dZuI04X.js";import{P as m}from"./index-98jQ1vTr.js";import"./index-hAp0hL9w.js";import"./index-BOy86lYu.js";import"./index-wRElCyvx.js";const p=r({rootClass:""}),u=o.forwardRef((({children:o,className:r="",customRootClass:a="",variant:m="",size:u="",color:f="",...R},N)=>{const h=d(a,"RadioGroup"),x=l("radio-group",{variant:m,size:u}),j=c(f),C=n(x,j);return e(p.Provider,{value:{rootClass:h},children:s(i.Root,{ref:N,className:t(`${h}-root`,r),...C,...R,children:[" ",o," "]})})}));u.displayName="RadioGroupRoot";const f=o.forwardRef((({children:o,className:r="",value:s,...d},l)=>{const{rootClass:n}=a(p);return e(i.Item,{ref:l,className:t(`${n}-item`,r),value:s,...d,children:o})}));f.displayName="RadioGroupItem";const R=o.forwardRef((({className:r="",children:a,...s},d)=>{const{rootClass:l}=o.useContext(p);return e(i.Indicator,{ref:d,className:t(`${l}-indicator`,r),...s,children:a})}));R.displayName="RadioGroupIndicator";const N=o.forwardRef((({className:r="",asChild:a=!1,children:e,...i},d)=>{const{rootClass:l}=o.useContext(p);return s(m.label,{ref:d,...i,className:t(`${l}-label`,r),asChild:a,children:[" ",e," "]})}));N.displayName="RadioGroupLabel";const h=o.forwardRef(((o,r)=>(console.warn("Direct usage of RadioGroup is not supported. Please use RadioGroup.Root and RadioGroup.Item instead."),null)));h.displayName="RadioGroup",h.Root=u,h.Item=f,h.Indicator=R,h.Label=N;export{h as default};
@@ -0,0 +1 @@
1
+ 'use client';import e,{useContext as i}from"react";import{jsxs as a,jsx as r,Fragment as d}from"react/jsx-runtime";import{P as o}from"./index-98jQ1vTr.js";import{R as t}from"./index-hAp0hL9w.js";import{u as l}from"./index-wRElCyvx.js";import{B as n}from"./index-BOy86lYu.js";const s=e.createContext(null),c=e.forwardRef((({value:e,defaultValue:i="",onValueChange:n,children:c,disabled:u=!1,required:m=!1,name:p="",orientation:h="horizontal",loop:f=!1,dir:R="ltr",...v},b)=>{const[C,x]=l(e,i,n),G={selectedValue:C,setSelectedValue:x,groupDisabled:u};return a(o.div,{ref:b,...v,"aria-required":m,role:"radiogroup","aria-disabled":u,"data-disabled":u?"":void 0,children:[r(t.Root,{dir:R,orientation:h,loop:f,asChild:!0,children:r(s.Provider,{value:G,children:r(t.Group,{children:c})})}),p&&a(d,{children:[r("input",{type:"hidden",name:p,value:C,disabled:u}),m&&""!==C&&r("input",{type:"radio",name:p,value:C,checked:!0,onChange:()=>{},disabled:u,required:!0,"aria-hidden":"true",tabIndex:-1,style:{position:"absolute",width:0,height:0,opacity:0,pointerEvents:"none",margin:0}})]})]})}));c.displayName="RadioGroupPrimitiveRoot";const u=e.createContext({itemSelected:!1}),m=e.forwardRef((({value:e,children:a,disabled:d,required:o=!1,className:l="",asChild:c=!1,...m},p)=>{const h=i(s);if(!h)throw new Error("RadioGroup.Item must be used within a RadioGroup.Root");const{groupDisabled:f,selectedValue:R,setSelectedValue:v}=h,b=e===R;return r(u.Provider,{value:{itemSelected:b},children:r(t.Item,{children:r(n,{ref:p,role:"radio",type:"button",disabled:f||d,onClick:()=>v(e),onFocus:()=>v(e),"aria-disabled":f||d,"aria-checked":b,"aria-selected":void 0,"data-state":b?"checked":"unchecked","data-disabled":f||d?"":void 0,"aria-required":o,asChild:c,className:l,...m,children:a})})})}));m.displayName="RadioGroupPrimitiveItem";const p=e.forwardRef((({children:i,className:a,asChild:d=!1,...t},l)=>{const{itemSelected:n}=e.useContext(u);return n?r(o.span,{ref:l,className:a,asChild:d,...t,children:i}):null}));p.displayName="RadioGroupPrimitiveIndicator";const h=e.forwardRef(((e,i)=>(console.warn("Direct usage of RadioGroup is not supported. Please use RadioGroup.Root, RadioGroup.Item, etc. instead."),null)));h.displayName="RadioGroupPrimitive",h.Root=c,h.Item=m,h.Indicator=p;export{h as R};