@lotte-innovate/ui-component-test 0.1.17 → 0.1.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. package/README.md +71 -71
  2. package/dist/globals.css +4 -4
  3. package/dist/lib/components/Accordion/index.d.ts +10 -4
  4. package/dist/lib/components/Accordion/index.js +17 -11
  5. package/dist/lib/components/AlertDialog/AlertDialogAction.js +4 -2
  6. package/dist/lib/components/AlertDialog/AlertDialogCancel.js +9 -5
  7. package/dist/lib/components/AlertDialog/AlertDialogContent.js +4 -2
  8. package/dist/lib/components/AlertDialog/AlertDialogDescription.js +4 -2
  9. package/dist/lib/components/AlertDialog/AlertDialogRoot.d.ts +16 -0
  10. package/dist/lib/components/AlertDialog/AlertDialogRoot.js +46 -0
  11. package/dist/lib/components/AlertDialog/AlertDialogTitle.js +4 -2
  12. package/dist/lib/components/AlertDialog/AlertDialogTrigger.js +2 -2
  13. package/dist/lib/components/AlertDialog/index.d.ts +10 -19
  14. package/dist/lib/components/AlertDialog/index.js +15 -35
  15. package/dist/lib/components/Avatar/index.d.ts +3 -0
  16. package/dist/lib/components/Avatar/index.js +3 -2
  17. package/dist/lib/components/BarChart/index.d.ts +5 -3
  18. package/dist/lib/components/BarChart/index.js +12 -1
  19. package/dist/lib/components/BubbleChart/index.d.ts +3 -0
  20. package/dist/lib/components/Callout/CalloutIcon.js +3 -3
  21. package/dist/lib/components/Callout/CalloutRoot.d.ts +18 -0
  22. package/dist/lib/components/Callout/CalloutRoot.js +72 -0
  23. package/dist/lib/components/Callout/CalloutText.js +2 -2
  24. package/dist/lib/components/Callout/index.d.ts +6 -19
  25. package/dist/lib/components/Callout/index.js +7 -73
  26. package/dist/lib/components/CheckboxGroup/CheckboxGroupItem.js +2 -2
  27. package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.d.ts +16 -0
  28. package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.js +34 -0
  29. package/dist/lib/components/CheckboxGroup/index.d.ts +5 -16
  30. package/dist/lib/components/CheckboxGroup/index.js +3 -34
  31. package/dist/lib/components/ContextMenu/ContextMenuCheckboxItem.d.ts +1 -1
  32. package/dist/lib/components/ContextMenu/ContextMenuCheckboxItem.js +4 -2
  33. package/dist/lib/components/ContextMenu/ContextMenuContent.js +2 -2
  34. package/dist/lib/components/ContextMenu/ContextMenuGroup.d.ts +1 -1
  35. package/dist/lib/components/ContextMenu/ContextMenuGroup.js +1 -1
  36. package/dist/lib/components/ContextMenu/ContextMenuItem.js +2 -2
  37. package/dist/lib/components/ContextMenu/ContextMenuItemIndicator.js +2 -2
  38. package/dist/lib/components/ContextMenu/ContextMenuLabel.js +2 -2
  39. package/dist/lib/components/ContextMenu/ContextMenuRadioGroup.js +1 -1
  40. package/dist/lib/components/ContextMenu/ContextMenuRadioItem.d.ts +1 -1
  41. package/dist/lib/components/ContextMenu/ContextMenuRadioItem.js +5 -2
  42. package/dist/lib/components/ContextMenu/ContextMenuRoot.d.ts +13 -0
  43. package/dist/lib/components/ContextMenu/ContextMenuRoot.js +42 -0
  44. package/dist/lib/components/ContextMenu/ContextMenuSeparator.js +1 -1
  45. package/dist/lib/components/ContextMenu/ContextMenuSubContent.js +4 -3
  46. package/dist/lib/components/ContextMenu/ContextMenuSubTrigger.js +2 -2
  47. package/dist/lib/components/ContextMenu/ContextMenuTrigger.d.ts +1 -1
  48. package/dist/lib/components/ContextMenu/ContextMenuTrigger.js +2 -2
  49. package/dist/lib/components/ContextMenu/index.d.ts +16 -24
  50. package/dist/lib/components/ContextMenu/index.js +27 -52
  51. package/dist/lib/components/DataList/DataListItem.js +2 -2
  52. package/dist/lib/components/DataList/DataListLabel.js +2 -2
  53. package/dist/lib/components/DataList/DataListRoot.d.ts +14 -0
  54. package/dist/lib/components/DataList/DataListRoot.js +54 -0
  55. package/dist/lib/components/DataList/DataListValue.js +2 -2
  56. package/dist/lib/components/DataList/index.d.ts +7 -16
  57. package/dist/lib/components/DataList/index.js +5 -56
  58. package/dist/lib/components/Dialog/DialogAction.d.ts +0 -2
  59. package/dist/lib/components/Dialog/DialogAction.js +7 -5
  60. package/dist/lib/components/Dialog/DialogCancel.js +5 -3
  61. package/dist/lib/components/Dialog/DialogContent.js +5 -3
  62. package/dist/lib/components/Dialog/DialogDescription.js +5 -3
  63. package/dist/lib/components/Dialog/DialogRoot.d.ts +12 -0
  64. package/dist/lib/components/Dialog/DialogRoot.js +37 -0
  65. package/dist/lib/components/Dialog/DialogSlot.js +5 -3
  66. package/dist/lib/components/Dialog/DialogTitle.js +5 -3
  67. package/dist/lib/components/Dialog/DialogTrigger.js +1 -1
  68. package/dist/lib/components/Dialog/index.d.ts +11 -17
  69. package/dist/lib/components/Dialog/index.js +17 -36
  70. package/dist/lib/components/DoughnutChart/index.js +9 -18
  71. package/dist/lib/components/DropdownMenu/DropdonMenuRadioGroup.d.ts +0 -5
  72. package/dist/lib/components/DropdownMenu/DropdonMenuRadioGroup.js +3 -4
  73. package/dist/lib/components/DropdownMenu/DropdonMenuSubContent.js +5 -3
  74. package/dist/lib/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +1 -1
  75. package/dist/lib/components/DropdownMenu/DropdownMenuCheckboxItem.js +7 -4
  76. package/dist/lib/components/DropdownMenu/DropdownMenuContent.js +5 -3
  77. package/dist/lib/components/DropdownMenu/DropdownMenuItem.d.ts +2 -0
  78. package/dist/lib/components/DropdownMenu/DropdownMenuItem.js +5 -3
  79. package/dist/lib/components/DropdownMenu/DropdownMenuItemIndicator.js +5 -3
  80. package/dist/lib/components/DropdownMenu/DropdownMenuLable.d.ts +0 -1
  81. package/dist/lib/components/DropdownMenu/DropdownMenuLable.js +5 -6
  82. package/dist/lib/components/DropdownMenu/DropdownMenuRadioItem.d.ts +4 -2
  83. package/dist/lib/components/DropdownMenu/DropdownMenuRadioItem.js +8 -6
  84. package/dist/lib/components/DropdownMenu/DropdownMenuRoot.d.ts +12 -0
  85. package/dist/lib/components/DropdownMenu/DropdownMenuRoot.js +38 -0
  86. package/dist/lib/components/DropdownMenu/DropdownMenuSeparator.js +1 -1
  87. package/dist/lib/components/DropdownMenu/DropdownMenuSub.js +1 -1
  88. package/dist/lib/components/DropdownMenu/DropdownMenuSubTrigger.js +5 -3
  89. package/dist/lib/components/DropdownMenu/DropdownMenuTrigger.d.ts +2 -1
  90. package/dist/lib/components/DropdownMenu/DropdownMenuTrigger.js +5 -3
  91. package/dist/lib/components/DropdownMenu/index.d.ts +16 -22
  92. package/dist/lib/components/DropdownMenu/index.js +27 -41
  93. package/dist/lib/components/HoverCard/HoverCardContent.js +5 -3
  94. package/dist/lib/components/HoverCard/HoverCardRoot.d.ts +8 -0
  95. package/dist/lib/components/HoverCard/HoverCardRoot.js +38 -0
  96. package/dist/lib/components/HoverCard/HoverCardTrigger.js +1 -1
  97. package/dist/lib/components/HoverCard/index.d.ts +6 -9
  98. package/dist/lib/components/HoverCard/index.js +7 -31
  99. package/dist/lib/components/LineChart/index.d.ts +87 -0
  100. package/dist/lib/components/LineChart/index.js +58 -0
  101. package/dist/lib/components/Menubar/MenubarCheckboxItem.js +2 -2
  102. package/dist/lib/components/Menubar/MenubarContent.js +2 -2
  103. package/dist/lib/components/Menubar/MenubarItem.js +2 -2
  104. package/dist/lib/components/Menubar/MenubarItemIndicator.js +2 -2
  105. package/dist/lib/components/Menubar/MenubarMenu.js +1 -1
  106. package/dist/lib/components/Menubar/MenubarRadioGroup.js +1 -1
  107. package/dist/lib/components/Menubar/MenubarRadioItem.js +2 -2
  108. package/dist/lib/components/Menubar/MenubarRoot.d.ts +19 -0
  109. package/dist/lib/components/Menubar/MenubarRoot.js +61 -0
  110. package/dist/lib/components/Menubar/MenubarSeparator.js +1 -1
  111. package/dist/lib/components/Menubar/MenubarSub.js +1 -1
  112. package/dist/lib/components/Menubar/MenubarSubContent.js +2 -2
  113. package/dist/lib/components/Menubar/MenubarSubTrigger.js +2 -2
  114. package/dist/lib/components/Menubar/MenubarTrigger.js +2 -2
  115. package/dist/lib/components/Menubar/index.d.ts +16 -30
  116. package/dist/lib/components/Menubar/index.js +27 -71
  117. package/dist/lib/components/NavigationMenu/NavigationMenuContent.js +2 -2
  118. package/dist/lib/components/NavigationMenu/NavigationMenuIndicator.js +1 -1
  119. package/dist/lib/components/NavigationMenu/NavigationMenuItem.js +1 -1
  120. package/dist/lib/components/NavigationMenu/NavigationMenuLink.js +2 -2
  121. package/dist/lib/components/NavigationMenu/NavigationMenuList.js +2 -2
  122. package/dist/lib/components/NavigationMenu/NavigationMenuRoot.d.ts +14 -0
  123. package/dist/lib/components/NavigationMenu/NavigationMenuRoot.js +43 -0
  124. package/dist/lib/components/NavigationMenu/NavigationMenuTrigger.js +2 -2
  125. package/dist/lib/components/NavigationMenu/NavigationMenuViewport.js +2 -2
  126. package/dist/lib/components/NavigationMenu/index.d.ts +11 -20
  127. package/dist/lib/components/NavigationMenu/index.js +9 -49
  128. package/dist/lib/components/PieChart/index.js +9 -18
  129. package/dist/lib/components/Popover/PopoverClose.js +5 -3
  130. package/dist/lib/components/Popover/PopoverContent.js +5 -3
  131. package/dist/lib/components/Popover/PopoverRoot.d.ts +9 -0
  132. package/dist/lib/components/Popover/PopoverRoot.js +36 -0
  133. package/dist/lib/components/Popover/PopoverTrigger.js +1 -1
  134. package/dist/lib/components/Popover/index.d.ts +7 -11
  135. package/dist/lib/components/Popover/index.js +9 -32
  136. package/dist/lib/components/RadioCards/RadioCardsItem.js +5 -3
  137. package/dist/lib/components/RadioCards/RadioCardsRoot.d.ts +14 -0
  138. package/dist/lib/components/RadioCards/RadioCardsRoot.js +46 -0
  139. package/dist/lib/components/RadioCards/index.d.ts +5 -13
  140. package/dist/lib/components/RadioCards/index.js +5 -41
  141. package/dist/lib/components/RadioGroup/RadioGroupItem.js +5 -3
  142. package/dist/lib/components/RadioGroup/RadioGroupRoot.d.ts +16 -0
  143. package/dist/lib/components/RadioGroup/RadioGroupRoot.js +53 -0
  144. package/dist/lib/components/RadioGroup/index.d.ts +5 -15
  145. package/dist/lib/components/RadioGroup/index.js +5 -49
  146. package/dist/lib/components/SegmentedControl/SegmentedControlItem.js +1 -1
  147. package/dist/lib/components/SegmentedControl/SegmentedControlRoot.d.ts +14 -0
  148. package/dist/lib/components/SegmentedControl/SegmentedControlRoot.js +47 -0
  149. package/dist/lib/components/SegmentedControl/index.d.ts +5 -14
  150. package/dist/lib/components/SegmentedControl/index.js +5 -46
  151. package/dist/lib/components/Select/index.d.ts +16 -7
  152. package/dist/lib/components/Select/index.js +23 -14
  153. package/dist/lib/components/TabNav/index.d.ts +6 -2
  154. package/dist/lib/components/TabNav/index.js +9 -5
  155. package/dist/lib/components/Table/index.d.ts +16 -7
  156. package/dist/lib/components/Table/index.js +23 -14
  157. package/dist/lib/components/Tabs/index.d.ts +10 -4
  158. package/dist/lib/components/Tabs/index.js +15 -9
  159. package/dist/lib/components/TextField/index.d.ts +6 -2
  160. package/dist/lib/components/TextField/index.js +8 -4
  161. package/dist/lib/components/Toast/ToastActionButton.js +2 -2
  162. package/dist/lib/components/Toast/ToastDescription.js +2 -2
  163. package/dist/lib/components/Toast/ToastRoot.d.ts +27 -0
  164. package/dist/lib/components/Toast/ToastRoot.js +90 -0
  165. package/dist/lib/components/Toast/ToastTitle.js +2 -2
  166. package/dist/lib/components/Toast/index.d.ts +7 -29
  167. package/dist/lib/components/Toast/index.js +9 -92
  168. package/dist/lib/components/ToggleGroup/{toggleGroupItem.js → ToggleGroupItem.js} +6 -4
  169. package/dist/lib/components/ToggleGroup/ToggleGroupRoot.d.ts +18 -0
  170. package/dist/lib/components/ToggleGroup/ToggleGroupRoot.js +47 -0
  171. package/dist/lib/components/ToggleGroup/index.d.ts +5 -19
  172. package/dist/lib/components/ToggleGroup/index.js +5 -41
  173. package/dist/lib/components/Tooltip/index.d.ts +3 -3
  174. package/dist/lib/components/Tooltip/index.js +3 -2
  175. package/dist/lib/components/index.d.ts +1 -0
  176. package/dist/lib/components/index.js +1 -0
  177. package/dist/lib/constants.d.ts +0 -9
  178. package/dist/lib/constants.js +0 -7
  179. package/package.json +131 -132
  180. /package/dist/lib/components/ToggleGroup/{toggleGroupItem.d.ts → ToggleGroupItem.d.ts} +0 -0
@@ -21,18 +21,21 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
- import { forwardRef } from 'react';
24
+ import { forwardRef, useContext } from 'react';
25
25
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
26
26
  import { menuItemAppearanceStyle } from '../../../lib/constants';
27
- import { dropdownMenuItemVariants, DropdownMenuItemIndicator } from '.';
27
+ import { dropdownMenuItemVariants } from './DropdownMenuItem';
28
+ import { DropdownMenuItemIndicator } from './DropdownMenuItemIndicator';
28
29
  import { CheckIcon } from '@radix-ui/react-icons';
30
+ import { DropdownMenuContext } from './DropdownMenuRoot';
29
31
  import { cn } from '../../../lib/utils/utils';
30
32
  export var DropdownMenuCheckboxItem = forwardRef(function (_a, ref) {
31
- var className = _a.className, children = _a.children, radius = _a.radius, size = _a.size, _b = _a.color, color = _b === void 0 ? 'red' : _b, _c = _a.appearance, appearance = _c === void 0 ? 'solid' : _c, shortcut = _a.shortcut, checked = _a.checked, props = __rest(_a, ["className", "children", "radius", "size", "color", "appearance", "shortcut", "checked"]);
33
+ var className = _a.className, children = _a.children, shortcut = _a.shortcut, checked = _a.checked, props = __rest(_a, ["className", "children", "shortcut", "checked"]);
34
+ var _b = useContext(DropdownMenuContext), radius = _b.radius, size = _b.size, _c = _b.color, color = _c === void 0 ? 'red' : _c, _d = _b.appearance, appearance = _d === void 0 ? 'solid' : _d;
32
35
  var itemClassName = cn(dropdownMenuItemVariants({
33
36
  radius: radius,
34
37
  size: size,
35
38
  }), 'pl-7', menuItemAppearanceStyle(appearance, color), className);
36
39
  return (_jsxs(DropdownMenuPrimitive.CheckboxItem, __assign({ ref: ref, className: itemClassName }, props, { children: [_jsx(DropdownMenuItemIndicator, { forceMount: true, radius: 'medium', size: size, children: checked && _jsx(CheckIcon, {}) }), children] })));
37
40
  });
38
- DropdownMenuCheckboxItem.displayName = 'DropdownMenuCheckboxItem';
41
+ DropdownMenuCheckboxItem.displayName = 'DropdownMenu.CheckboxItem';
@@ -21,10 +21,11 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
- import { forwardRef } from 'react';
24
+ import { forwardRef, useContext } from 'react';
25
25
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
26
26
  import { cva } from 'class-variance-authority';
27
27
  import { scalingVariants } from '../../../lib/constants';
28
+ import { DropdownMenuContext } from './DropdownMenuRoot';
28
29
  import { cn } from '../../../lib/utils/utils';
29
30
  export var dropdownMenuContentVariants = cva("p-[5px] bg-white dark:bg-slateDark-1 will-change-[transform,opacity]\n shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),_0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)] \n [animation-duration:_400ms] [animation-timing-function:_cubic-bezier(0.16,_1,_0.3,_1)]", {
30
31
  variants: {
@@ -48,7 +49,8 @@ export var dropdownMenuContentVariants = cva("p-[5px] bg-white dark:bg-slateDark
48
49
  },
49
50
  });
50
51
  export var DropdownMenuContent = forwardRef(function (_a, ref) {
51
- var className = _a.className, children = _a.children, size = _a.size, scaling = _a.scaling, radius = _a.radius, props = __rest(_a, ["className", "children", "size", "scaling", "radius"]);
52
+ var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
53
+ var _b = useContext(DropdownMenuContext), size = _b.size, scaling = _b.scaling, radius = _b.radius;
52
54
  return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, __assign({ ref: ref, sideOffset: 5, className: cn(dropdownMenuContentVariants({ radius: radius, scaling: scaling, size: size }), className) }, props, { children: children })) }));
53
55
  });
54
- DropdownMenuContent.displayName = 'DropdownMenuContent';
56
+ DropdownMenuContent.displayName = 'DropdownMenu.Content';
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
3
  import { VariantProps } from 'class-variance-authority';
4
+ import { IColor } from '../../../lib/types';
4
5
  export interface DropdownMenuItemProps extends VariantProps<typeof dropdownMenuItemVariants> {
6
+ color?: IColor;
5
7
  shortcut?: string;
6
8
  appearance?: 'solid' | 'soft';
7
9
  }
@@ -21,10 +21,11 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
- import { forwardRef } from 'react';
24
+ import { forwardRef, useContext } from 'react';
25
25
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
26
26
  import { cva } from 'class-variance-authority';
27
27
  import { menuItemAppearanceStyle, scalingVariants, radiusVariants, blackText } from '../../../lib/constants';
28
+ import { DropdownMenuContext } from './DropdownMenuRoot';
28
29
  import { cn } from '../../../lib/utils/utils';
29
30
  export var dropdownMenuItemVariants = cva("flex group relative leading-none select-none outline-none items-center justify-between\n data-[disabled]:text-slate-8 dark:data-[disabled]:text-slateDark-8 hover:data-[disabled]:bg-transparent dark:hover:data-[disabled]:bg-transparent text-slate-12 dark:text-slateDark-12", {
30
31
  variants: {
@@ -42,7 +43,8 @@ export var dropdownMenuItemVariants = cva("flex group relative leading-none sele
42
43
  },
43
44
  });
44
45
  export var DropdownMenuItem = forwardRef(function (_a, ref) {
45
- var className = _a.className, children = _a.children, size = _a.size, radius = _a.radius, _b = _a.color, color = _b === void 0 ? 'red' : _b, _c = _a.appearance, appearance = _c === void 0 ? 'solid' : _c, shortcut = _a.shortcut, props = __rest(_a, ["className", "children", "size", "radius", "color", "appearance", "shortcut"]);
46
+ var className = _a.className, children = _a.children, shortcut = _a.shortcut, props = __rest(_a, ["className", "children", "shortcut"]);
47
+ var _b = useContext(DropdownMenuContext), size = _b.size, radius = _b.radius, _c = _b.color, color = _c === void 0 ? 'red' : _c, _d = _b.appearance, appearance = _d === void 0 ? 'solid' : _d;
46
48
  var itemClassName = cn(menuItemAppearanceStyle(appearance, color), dropdownMenuItemVariants({
47
49
  radius: radius,
48
50
  size: size,
@@ -53,4 +55,4 @@ export var DropdownMenuItem = forwardRef(function (_a, ref) {
53
55
  }
54
56
  return (_jsxs(DropdownMenuPrimitive.Item, __assign({ ref: ref }, props, { className: itemClassName, children: [children, shortcut && _jsx("span", { className: shortcutClassName, children: shortcut })] })));
55
57
  });
56
- DropdownMenuItem.displayName = 'DropdownMenuItem';
58
+ DropdownMenuItem.displayName = 'DropdownMenu.Item';
@@ -21,10 +21,11 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
- import { forwardRef } from 'react';
24
+ import { forwardRef, useContext } from 'react';
25
25
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
26
26
  import { cva } from 'class-variance-authority';
27
27
  import { radiusVariants } from '../../../lib/constants';
28
+ import { DropdownMenuContext } from './DropdownMenuRoot';
28
29
  import { cn } from '../../../lib/utils/utils';
29
30
  export var dropdownMenuItemIndicatorVariants = cva("absolute left-0 inline-flex items-center justify-center ml-1 border", {
30
31
  variants: {
@@ -40,7 +41,8 @@ export var dropdownMenuItemIndicatorVariants = cva("absolute left-0 inline-flex
40
41
  },
41
42
  });
42
43
  export var DropdownMenuItemIndicator = forwardRef(function (_a, ref) {
43
- var className = _a.className, children = _a.children, size = _a.size, radius = _a.radius, props = __rest(_a, ["className", "children", "size", "radius"]);
44
+ var className = _a.className, children = _a.children, radius = _a.radius, props = __rest(_a, ["className", "children", "radius"]);
45
+ var size = useContext(DropdownMenuContext).size;
44
46
  return (_jsx(DropdownMenuPrimitive.ItemIndicator, __assign({ ref: ref, className: cn(dropdownMenuItemIndicatorVariants({ radius: radius, size: size }), className) }, props, { children: children })));
45
47
  });
46
- DropdownMenuItemIndicator.displayName = 'DropdownMenuItemIndicator';
48
+ DropdownMenuItemIndicator.displayName = 'DropdownMenu.ItemIndicator';
@@ -6,6 +6,5 @@ export interface DropdownMenuLabelProps extends VariantProps<typeof dropdownMenu
6
6
  }
7
7
  export declare const dropdownMenuLabelVariants: (props?: ({
8
8
  size?: "small" | "medium" | null | undefined;
9
- scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
10
9
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
11
10
  export declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>>;
@@ -21,10 +21,10 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
- import { forwardRef } from 'react';
24
+ import { forwardRef, useContext } from 'react';
25
25
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
26
26
  import { cva } from 'class-variance-authority';
27
- import { scalingVariants } from '../../../lib/constants';
27
+ import { DropdownMenuContext } from './DropdownMenuRoot';
28
28
  import { cn } from '../../../lib/utils/utils';
29
29
  export var dropdownMenuLabelVariants = cva("flex relative leading-none select-none outline-none items-center font-normal text-slateA-11 dark:text-slateDarkA-11", {
30
30
  variants: {
@@ -32,15 +32,14 @@ export var dropdownMenuLabelVariants = cva("flex relative leading-none select-no
32
32
  small: 'text-xs h-[24px] w-[120px] px-2',
33
33
  medium: 'text-sm h-[32px] w-[136px] px-3',
34
34
  },
35
- scaling: __assign({}, scalingVariants),
36
35
  },
37
36
  defaultVariants: {
38
- scaling: '100%',
39
37
  size: 'medium',
40
38
  },
41
39
  });
42
40
  export var DropdownMenuLabel = forwardRef(function (_a, ref) {
43
- var className = _a.className, children = _a.children, size = _a.size, props = __rest(_a, ["className", "children", "size"]);
41
+ var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
42
+ var size = useContext(DropdownMenuContext).size;
44
43
  return (_jsx(DropdownMenuPrimitive.Label, __assign({ ref: ref, className: cn(dropdownMenuLabelVariants({ size: size }), className) }, props, { children: children })));
45
44
  });
46
- DropdownMenuLabel.displayName = 'DropdownMenuLabel';
45
+ DropdownMenuLabel.displayName = 'DropdownMenu.Label';
@@ -1,4 +1,6 @@
1
1
  import React from 'react';
2
2
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
- import { DropdownMenuItemProps } from '.';
4
- export declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>>;
3
+ export interface DropdownMenuRadioItemProps {
4
+ selectedValue?: string;
5
+ }
6
+ export declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
@@ -22,18 +22,20 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
24
  import { forwardRef, useContext } from 'react';
25
- import { DropdownMenu as DropdownMenuTheme } from '@radix-ui/themes';
26
- import { dropdownMenuItemVariants, DropdownMenuItemIndicator, RadioContext, } from '.';
25
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
26
+ import { DropdownMenuItemIndicator } from './DropdownMenuItemIndicator';
27
+ import { dropdownMenuItemVariants } from './DropdownMenuItem';
27
28
  import { menuItemAppearanceStyle } from '../../../lib/constants';
28
29
  import { DotFilledIcon } from '@radix-ui/react-icons';
30
+ import { DropdownMenuContext } from './DropdownMenuRoot';
29
31
  import { cn } from '../../../lib/utils/utils';
30
32
  export var DropdownMenuRadioItem = forwardRef(function (_a, ref) {
31
- var className = _a.className, children = _a.children, _b = _a.color, color = _b === void 0 ? 'red' : _b, _c = _a.appearance, appearance = _c === void 0 ? 'solid' : _c, radius = _a.radius, size = _a.size, props = __rest(_a, ["className", "children", "color", "appearance", "radius", "size"]);
32
- var radioGroup = useContext(RadioContext);
33
+ var className = _a.className, children = _a.children, selectedValue = _a.selectedValue, props = __rest(_a, ["className", "children", "selectedValue"]);
34
+ var _b = useContext(DropdownMenuContext), radius = _b.radius, size = _b.size, _c = _b.color, color = _c === void 0 ? 'red' : _c, _d = _b.appearance, appearance = _d === void 0 ? 'solid' : _d;
33
35
  var itemClassName = cn(dropdownMenuItemVariants({
34
36
  radius: radius,
35
37
  size: size,
36
38
  }), 'pl-7', menuItemAppearanceStyle(appearance, color), className);
37
- return (_jsxs(DropdownMenuTheme.RadioItem, __assign({ ref: ref, className: itemClassName }, props, { children: [_jsx(DropdownMenuItemIndicator, { forceMount: true, radius: 'full', size: size, children: radioGroup.selectedValue === props.value && _jsx(DotFilledIcon, {}) }), children] })));
39
+ return (_jsxs(DropdownMenuPrimitive.RadioItem, __assign({ ref: ref, className: itemClassName }, props, { children: [_jsx(DropdownMenuItemIndicator, { forceMount: true, radius: 'full', size: size, children: selectedValue === props.value && _jsx(DotFilledIcon, {}) }), children] })));
38
40
  });
39
- DropdownMenuRadioItem.displayName = 'DropdownMenuRadioItem';
41
+ DropdownMenuRadioItem.displayName = 'DropdownMenu.RadioItem';
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
+ import { VariantProps } from 'class-variance-authority';
4
+ import { dropdownMenuContentVariants } from './DropdownMenuContent';
5
+ import { dropdownMenuItemVariants } from './DropdownMenuItem';
6
+ import { IColor } from '../../../lib/types';
7
+ export interface DropdownMenuProps extends VariantProps<typeof dropdownMenuContentVariants>, VariantProps<typeof dropdownMenuItemVariants> {
8
+ color?: IColor;
9
+ appearance?: 'solid' | 'soft';
10
+ }
11
+ export declare const DropdownMenuContext: React.Context<DropdownMenuProps>;
12
+ export declare const DropdownMenuRoot: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuProps & DropdownMenuProps & React.RefAttributes<never>>;
@@ -0,0 +1,38 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { forwardRef, createContext } from 'react';
25
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
26
+ export var DropdownMenuContext = createContext({
27
+ radius: 'medium',
28
+ size: 'medium',
29
+ scaling: '100%',
30
+ color: 'red',
31
+ appearance: 'solid',
32
+ });
33
+ export var DropdownMenuRoot = forwardRef(function (_a, ref) {
34
+ var children = _a.children, radius = _a.radius, size = _a.size, scaling = _a.scaling, color = _a.color, appearance = _a.appearance, props = __rest(_a, ["children", "radius", "size", "scaling", "color", "appearance"]);
35
+ var contextValue = { radius: radius, size: size, scaling: scaling, color: color, appearance: appearance };
36
+ return (_jsx(DropdownMenuContext.Provider, { value: contextValue, children: _jsx(DropdownMenuPrimitive.Root, __assign({}, props, { children: children })) }));
37
+ });
38
+ DropdownMenuRoot.displayName = 'DropdownMenu.Root';
@@ -28,4 +28,4 @@ export var DropdownMenuSeparator = forwardRef(function (_a, ref) {
28
28
  var className = _a.className, children = _a.children, color = _a.color, props = __rest(_a, ["className", "children", "color"]);
29
29
  return (_jsx(DropdownMenuPrimitive.Separator, __assign({ ref: ref, className: cn('h-[1px] m-[5px] bg-slate-6 dark:bg-slateDark-6', className) }, props)));
30
30
  });
31
- DropdownMenuSeparator.displayName = 'DropdownMenuSeparator';
31
+ DropdownMenuSeparator.displayName = 'DropdownMenu.Separator';
@@ -27,4 +27,4 @@ export var DropdownMenuSub = forwardRef(function (_a, ref) {
27
27
  var children = _a.children, props = __rest(_a, ["children"]);
28
28
  return _jsx(DropdownMenuPrimitive.Sub, __assign({}, props, { children: children }));
29
29
  });
30
- DropdownMenuSub.displayName = 'DropdownMenuSub';
30
+ DropdownMenuSub.displayName = 'DropdownMenu.Sub';
@@ -21,18 +21,20 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
- import { forwardRef } from 'react';
24
+ import { forwardRef, useContext } from 'react';
25
25
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
26
26
  import { dropdownMenuItemVariants } from './DropdownMenuItem';
27
27
  import { ChevronRightIcon } from '@radix-ui/react-icons';
28
28
  import { blackText, menuItemAppearanceStyle } from '../../../lib/constants';
29
+ import { DropdownMenuContext } from './DropdownMenuRoot';
29
30
  import { cn } from '../../../lib/utils/utils';
30
31
  export var DropdownMenuSubTrigger = forwardRef(function (_a, ref) {
31
- var className = _a.className, children = _a.children, size = _a.size, radius = _a.radius, _b = _a.color, color = _b === void 0 ? 'red' : _b, _c = _a.appearance, appearance = _c === void 0 ? 'solid' : _c, props = __rest(_a, ["className", "children", "size", "radius", "color", "appearance"]);
32
+ var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
33
+ var _b = useContext(DropdownMenuContext), size = _b.size, radius = _b.radius, _c = _b.color, color = _c === void 0 ? 'red' : _c, _d = _b.appearance, appearance = _d === void 0 ? 'solid' : _d;
32
34
  var iconClassName = cn('group-data-[disabled]:text-slate-8 ', appearance === 'solid' && blackText.includes(color)
33
35
  ? 'hover:fill-slate-12 dark:hover:fill-slateDark-1'
34
36
  : "hover:fill-white dark:hover:fill-slateDark-12 ");
35
37
  var triggerClassName = cn(dropdownMenuItemVariants({ size: size, radius: radius }), menuItemAppearanceStyle(appearance, color), className);
36
38
  return (_jsxs(DropdownMenuPrimitive.SubTrigger, __assign({ ref: ref, className: triggerClassName }, props, { children: [children, _jsx("div", { className: "ml-auto pl-5 ", children: _jsx(ChevronRightIcon, { className: iconClassName }) })] })));
37
39
  });
38
- DropdownMenuSubTrigger.displayName = 'DropdownMenuSubTrigger';
40
+ DropdownMenuSubTrigger.displayName = 'DropdownMenu.SubTrigger';
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import { VariantProps } from 'class-variance-authority';
3
3
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
4
+ import { IColor } from '../../../lib/types';
4
5
  export interface DropdownMenuTriggerProps extends VariantProps<typeof dropdownMenuTriggerVariants> {
5
- color?: string;
6
+ color?: IColor;
6
7
  appearance?: 'classic' | 'surface';
7
8
  }
8
9
  declare const dropdownMenuTriggerVariants: (props?: ({
@@ -21,9 +21,10 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
- import { forwardRef } from 'react';
24
+ import { forwardRef, useContext } from 'react';
25
25
  import { cva } from 'class-variance-authority';
26
26
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
27
+ import { DropdownMenuContext } from './DropdownMenuRoot';
27
28
  import { cn } from '../../../lib/utils/utils';
28
29
  var dropdownMenuTriggerVariants = cva('', {
29
30
  variants: {
@@ -45,7 +46,8 @@ var dropdownMenuTriggerVariants = cva('', {
45
46
  },
46
47
  });
47
48
  export var DropdownMenuTrigger = forwardRef(function (_a, ref) {
48
- var className = _a.className, children = _a.children, radius = _a.radius, size = _a.size, props = __rest(_a, ["className", "children", "radius", "size"]);
49
+ var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
50
+ var _b = useContext(DropdownMenuContext), radius = _b.radius, size = _b.size;
49
51
  return (_jsx(DropdownMenuPrimitive.Trigger, __assign({ asChild: true, ref: ref, className: cn(dropdownMenuTriggerVariants({ radius: radius, size: size }), className) }, props, { children: children })));
50
52
  });
51
- DropdownMenuTrigger.displayName = 'DropdownMenuTrigger';
53
+ DropdownMenuTrigger.displayName = 'DropdownMenu.Trigger';
@@ -1,23 +1,17 @@
1
- import React from 'react';
2
- import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
- import { VariantProps } from 'class-variance-authority';
4
- import { dropdownMenuContentVariants } from './DropdownMenuContent';
5
- import { dropdownMenuItemVariants } from './DropdownMenuItem';
6
- export * from './DropdownMenuTrigger';
7
- export * from './DropdownMenuContent';
8
- export * from './DropdonMenuSubContent';
9
- export * from './DropdownMenuSubTrigger';
10
- export * from './DropdownMenuItem';
11
- export * from './DropdownMenuSeparator';
12
- export * from './DropdownMenuLable';
13
- export * from './DropdownMenuSub';
14
- export * from './DropdownMenuCheckboxItem';
15
- export * from './DropdownMenuItemIndicator';
16
- export * from './DropdonMenuRadioGroup';
17
- export * from './DropdownMenuRadioItem';
18
- export interface DropdownMenuProps extends VariantProps<typeof dropdownMenuContentVariants>, VariantProps<typeof dropdownMenuItemVariants> {
19
- color?: any;
20
- appearance?: 'solid' | 'soft';
21
- }
22
- export declare const DropdownMenu: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuProps & DropdownMenuProps & React.RefAttributes<never>>;
1
+ /// <reference types="react" />
2
+ declare const DropdownMenu: {
3
+ Root: import("react").ForwardRefExoticComponent<import("@radix-ui/react-dropdown-menu").DropdownMenuProps & import("./DropdownMenuRoot").DropdownMenuProps & import("react").RefAttributes<never>>;
4
+ Trigger: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("./DropdownMenuTrigger").DropdownMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
5
+ Content: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./DropdownMenuContent").DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>>;
6
+ Label: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuLabelProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./DropdownMenuLable").DropdownMenuLabelProps & import("react").RefAttributes<HTMLDivElement>>;
7
+ Item: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./DropdownMenuItem").DropdownMenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
8
+ Separator: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuSeparatorProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
9
+ CheckboxItem: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuCheckboxItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./DropdownMenuItem").DropdownMenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
10
+ RadioGroup: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuRadioGroupProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
11
+ RadioItem: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuRadioItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./DropdownMenuRadioItem").DropdownMenuRadioItemProps & import("react").RefAttributes<HTMLDivElement>>;
12
+ Sub: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuLabelProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<never>>;
13
+ SubTrigger: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuSubTriggerProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./DropdownMenuItem").DropdownMenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
14
+ SubContent: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuSubContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./DropdonMenuSubContent").DropdownMenuSubContentProps & import("react").RefAttributes<HTMLDivElement>>;
15
+ ItemIndicator: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuItemIndicatorProps & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("./DropdownMenuItemIndicator").DropdownMenuItemIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>;
16
+ };
23
17
  export default DropdownMenu;
@@ -1,43 +1,29 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
1
+ import { DropdownMenuRoot } from './DropdownMenuRoot';
2
+ import { DropdownMenuTrigger } from './DropdownMenuTrigger';
3
+ import { DropdownMenuContent } from './DropdownMenuContent';
4
+ import { DropdownMenuLabel } from './DropdownMenuLable';
5
+ import { DropdownMenuItem } from './DropdownMenuItem';
6
+ import { DropdownMenuSeparator } from './DropdownMenuSeparator';
7
+ import { DropdownMenuCheckboxItem } from './DropdownMenuCheckboxItem';
8
+ import { DropdownMenuRadioGroup } from './DropdonMenuRadioGroup';
9
+ import { DropdownMenuRadioItem } from './DropdownMenuRadioItem';
10
+ import { DropdownMenuSub } from './DropdownMenuSub';
11
+ import { DropdownMenuSubTrigger } from './DropdownMenuSubTrigger';
12
+ import { DropdownMenuSubContent } from './DropdonMenuSubContent';
13
+ import { DropdownMenuItemIndicator } from './DropdownMenuItemIndicator';
14
+ var DropdownMenu = {
15
+ Root: DropdownMenuRoot,
16
+ Trigger: DropdownMenuTrigger,
17
+ Content: DropdownMenuContent,
18
+ Label: DropdownMenuLabel,
19
+ Item: DropdownMenuItem,
20
+ Separator: DropdownMenuSeparator,
21
+ CheckboxItem: DropdownMenuCheckboxItem,
22
+ RadioGroup: DropdownMenuRadioGroup,
23
+ RadioItem: DropdownMenuRadioItem,
24
+ Sub: DropdownMenuSub,
25
+ SubTrigger: DropdownMenuSubTrigger,
26
+ SubContent: DropdownMenuSubContent,
27
+ ItemIndicator: DropdownMenuItemIndicator,
11
28
  };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
- import { jsx as _jsx } from "react/jsx-runtime";
24
- import { forwardRef } from 'react';
25
- import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
26
- export * from './DropdownMenuTrigger';
27
- export * from './DropdownMenuContent';
28
- export * from './DropdonMenuSubContent';
29
- export * from './DropdownMenuSubTrigger';
30
- export * from './DropdownMenuItem';
31
- export * from './DropdownMenuSeparator';
32
- export * from './DropdownMenuLable';
33
- export * from './DropdownMenuSub';
34
- export * from './DropdownMenuCheckboxItem';
35
- export * from './DropdownMenuItemIndicator';
36
- export * from './DropdonMenuRadioGroup';
37
- export * from './DropdownMenuRadioItem';
38
- export var DropdownMenu = forwardRef(function (_a, ref) {
39
- var children = _a.children, props = __rest(_a, ["children"]);
40
- return (_jsx(DropdownMenuPrimitive.Root, __assign({}, props, { children: children })));
41
- });
42
- DropdownMenu.displayName = 'DropdownMenu';
43
29
  export default DropdownMenu;
@@ -21,10 +21,11 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
- import { forwardRef } from 'react';
24
+ import { forwardRef, useContext } from 'react';
25
25
  import { primaryColorStyle, radiusVariants, weightVariants, scalingVariants } from '../../../lib/constants';
26
26
  import { cva } from 'class-variance-authority';
27
27
  import { HoverCard as HoverCardTheme } from '@radix-ui/themes';
28
+ import { HoverCardContext } from './HoverCardRoot';
28
29
  import { cn } from '../../../lib/utils/utils';
29
30
  export var hoverCardContentVariants = cva('', {
30
31
  variants: {
@@ -48,7 +49,8 @@ export var hoverCardContentVariants = cva('', {
48
49
  },
49
50
  });
50
51
  export var HoverCardContent = forwardRef(function (_a, ref) {
51
- var className = _a.className, radius = _a.radius, _b = _a.size, size = _b === void 0 ? 'medium' : _b, scaling = _a.scaling, weight = _a.weight, color = _a.color, children = _a.children, props = __rest(_a, ["className", "radius", "size", "scaling", "weight", "color", "children"]);
52
+ var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
53
+ var _b = useContext(HoverCardContext), radius = _b.radius, size = _b.size, scaling = _b.scaling, weight = _b.weight, color = _b.color;
52
54
  var sizeTheme = '2';
53
55
  if (size === 'small')
54
56
  sizeTheme = '1';
@@ -56,4 +58,4 @@ export var HoverCardContent = forwardRef(function (_a, ref) {
56
58
  sizeTheme = '3';
57
59
  return (_jsx(HoverCardTheme.Content, __assign({ ref: ref }, props, { size: sizeTheme, className: cn(hoverCardContentVariants({ size: size, scaling: scaling, weight: weight, radius: radius, color: color }), size === 'x-large' && 'rt-r-size-4', className), children: children })));
58
60
  });
59
- HoverCardContent.displayName = 'HoverCardContent';
61
+ HoverCardContent.displayName = 'HoverCard.Content';
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { HoverCard as HoverCardTheme } from '@radix-ui/themes';
3
+ import { hoverCardContentVariants } from './HoverCardContent';
4
+ import { VariantProps } from 'class-variance-authority';
5
+ export interface HoverCardProps extends VariantProps<typeof hoverCardContentVariants> {
6
+ }
7
+ export declare const HoverCardContext: React.Context<HoverCardProps>;
8
+ export declare const HoverCardRoot: React.ForwardRefExoticComponent<HoverCardTheme.RootProps & HoverCardProps & React.RefAttributes<never>>;
@@ -0,0 +1,38 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { forwardRef, createContext } from 'react';
25
+ import { HoverCard as HoverCardTheme, Theme } from '@radix-ui/themes';
26
+ export var HoverCardContext = createContext({
27
+ radius: 'medium',
28
+ size: 'medium',
29
+ scaling: '100%',
30
+ weight: 'medium',
31
+ color: 'red',
32
+ });
33
+ export var HoverCardRoot = forwardRef(function (_a, ref) {
34
+ var children = _a.children, radius = _a.radius, size = _a.size, scaling = _a.scaling, weight = _a.weight, color = _a.color, props = __rest(_a, ["children", "radius", "size", "scaling", "weight", "color"]);
35
+ var contextValue = { radius: radius, size: size, scaling: scaling, weight: weight, color: color };
36
+ return (_jsx(Theme, { children: _jsx(HoverCardContext.Provider, { value: contextValue, children: _jsx(HoverCardTheme.Root, __assign({}, props, { children: children })) }) }));
37
+ });
38
+ HoverCardRoot.displayName = 'HoverCard.Root';
@@ -27,4 +27,4 @@ export var HoverCardTrigger = forwardRef(function (_a, ref) {
27
27
  var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
28
28
  return (_jsx(HoverCardTheme.Trigger, __assign({ ref: ref, className: className }, props, { children: children })));
29
29
  });
30
- HoverCardTrigger.displayName = 'HoverCardTrigger';
30
+ HoverCardTrigger.displayName = 'HoverCard.Trigger';
@@ -1,10 +1,7 @@
1
- import React from 'react';
2
- import { HoverCard as HoverCardTheme } from '@radix-ui/themes';
3
- import { hoverCardContentVariants } from './HoverCardContent';
4
- import { VariantProps } from 'class-variance-authority';
5
- export * from './HoverCardTrigger';
6
- export * from './HoverCardContent';
7
- export interface HoverCardProps extends VariantProps<typeof hoverCardContentVariants> {
8
- }
9
- export declare const HoverCard: React.ForwardRefExoticComponent<HoverCardTheme.RootProps & HoverCardProps & React.RefAttributes<never>>;
1
+ /// <reference types="react" />
2
+ declare const HoverCard: {
3
+ Root: import("react").ForwardRefExoticComponent<import("@radix-ui/themes/dist/cjs/components/hover-card").RootProps & import("./HoverCardRoot").HoverCardProps & import("react").RefAttributes<never>>;
4
+ Trigger: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/hover-card").TriggerProps & import("react").RefAttributes<HTMLAnchorElement>, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
5
+ Content: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/hover-card").ContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./HoverCardContent").HoverCardContentProps & import("react").RefAttributes<HTMLDivElement>>;
6
+ };
10
7
  export default HoverCard;
@@ -1,33 +1,9 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
1
+ import { HoverCardRoot } from './HoverCardRoot';
2
+ import { HoverCardTrigger } from './HoverCardTrigger';
3
+ import { HoverCardContent } from './HoverCardContent';
4
+ var HoverCard = {
5
+ Root: HoverCardRoot,
6
+ Trigger: HoverCardTrigger,
7
+ Content: HoverCardContent,
11
8
  };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
- import { jsx as _jsx } from "react/jsx-runtime";
24
- import { forwardRef } from 'react';
25
- import { HoverCard as HoverCardTheme, Theme } from '@radix-ui/themes';
26
- export * from './HoverCardTrigger';
27
- export * from './HoverCardContent';
28
- export var HoverCard = forwardRef(function (_a, ref) {
29
- var children = _a.children, props = __rest(_a, ["children"]);
30
- return (_jsx(Theme, { children: _jsx(HoverCardTheme.Root, __assign({}, props, { children: children })) }));
31
- });
32
- HoverCard.displayName = 'HoverCard';
33
9
  export default HoverCard;