@lotte-innovate/ui-component-test 0.1.18 → 0.1.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (176) 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 +1 -1
  6. package/dist/lib/components/AlertDialog/AlertDialogCancel.js +1 -1
  7. package/dist/lib/components/AlertDialog/AlertDialogContent.js +2 -2
  8. package/dist/lib/components/AlertDialog/AlertDialogRoot.d.ts +1 -1
  9. package/dist/lib/components/AlertDialog/AlertDialogRoot.js +7 -2
  10. package/dist/lib/components/AlertDialog/AlertDialogTrigger.js +1 -1
  11. package/dist/lib/components/Avatar/index.d.ts +3 -0
  12. package/dist/lib/components/Avatar/index.js +3 -2
  13. package/dist/lib/components/BarChart/index.d.ts +5 -3
  14. package/dist/lib/components/BarChart/index.js +12 -1
  15. package/dist/lib/components/BubbleChart/index.d.ts +3 -0
  16. package/dist/lib/components/Callout/CalloutIcon.js +3 -3
  17. package/dist/lib/components/Callout/CalloutRoot.d.ts +18 -0
  18. package/dist/lib/components/Callout/CalloutRoot.js +72 -0
  19. package/dist/lib/components/Callout/CalloutText.js +2 -2
  20. package/dist/lib/components/Callout/index.d.ts +6 -19
  21. package/dist/lib/components/Callout/index.js +7 -73
  22. package/dist/lib/components/CheckboxGroup/CheckboxGroupItem.js +2 -2
  23. package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.d.ts +16 -0
  24. package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.js +34 -0
  25. package/dist/lib/components/CheckboxGroup/index.d.ts +5 -16
  26. package/dist/lib/components/CheckboxGroup/index.js +3 -34
  27. package/dist/lib/components/ContextMenu/ContextMenuCheckboxItem.d.ts +1 -1
  28. package/dist/lib/components/ContextMenu/ContextMenuCheckboxItem.js +4 -2
  29. package/dist/lib/components/ContextMenu/ContextMenuContent.js +2 -2
  30. package/dist/lib/components/ContextMenu/ContextMenuGroup.d.ts +1 -1
  31. package/dist/lib/components/ContextMenu/ContextMenuGroup.js +1 -1
  32. package/dist/lib/components/ContextMenu/ContextMenuItem.js +2 -2
  33. package/dist/lib/components/ContextMenu/ContextMenuItemIndicator.js +2 -2
  34. package/dist/lib/components/ContextMenu/ContextMenuLabel.js +2 -2
  35. package/dist/lib/components/ContextMenu/ContextMenuRadioGroup.js +1 -1
  36. package/dist/lib/components/ContextMenu/ContextMenuRadioItem.d.ts +1 -1
  37. package/dist/lib/components/ContextMenu/ContextMenuRadioItem.js +5 -2
  38. package/dist/lib/components/ContextMenu/ContextMenuRoot.d.ts +13 -0
  39. package/dist/lib/components/ContextMenu/ContextMenuRoot.js +42 -0
  40. package/dist/lib/components/ContextMenu/ContextMenuSeparator.js +1 -1
  41. package/dist/lib/components/ContextMenu/ContextMenuSubContent.js +4 -3
  42. package/dist/lib/components/ContextMenu/ContextMenuSubTrigger.js +2 -2
  43. package/dist/lib/components/ContextMenu/ContextMenuTrigger.d.ts +1 -1
  44. package/dist/lib/components/ContextMenu/ContextMenuTrigger.js +2 -2
  45. package/dist/lib/components/ContextMenu/index.d.ts +16 -24
  46. package/dist/lib/components/ContextMenu/index.js +27 -52
  47. package/dist/lib/components/DataList/DataListItem.js +2 -2
  48. package/dist/lib/components/DataList/DataListLabel.js +2 -2
  49. package/dist/lib/components/DataList/DataListRoot.d.ts +14 -0
  50. package/dist/lib/components/DataList/DataListRoot.js +54 -0
  51. package/dist/lib/components/DataList/DataListValue.js +2 -2
  52. package/dist/lib/components/DataList/index.d.ts +7 -16
  53. package/dist/lib/components/DataList/index.js +5 -56
  54. package/dist/lib/components/Dialog/DialogAction.d.ts +0 -2
  55. package/dist/lib/components/Dialog/DialogAction.js +7 -5
  56. package/dist/lib/components/Dialog/DialogCancel.js +5 -3
  57. package/dist/lib/components/Dialog/DialogContent.js +5 -3
  58. package/dist/lib/components/Dialog/DialogDescription.js +5 -3
  59. package/dist/lib/components/Dialog/DialogRoot.d.ts +12 -0
  60. package/dist/lib/components/Dialog/DialogRoot.js +37 -0
  61. package/dist/lib/components/Dialog/DialogSlot.js +5 -3
  62. package/dist/lib/components/Dialog/DialogTitle.js +5 -3
  63. package/dist/lib/components/Dialog/DialogTrigger.js +1 -1
  64. package/dist/lib/components/Dialog/index.d.ts +11 -17
  65. package/dist/lib/components/Dialog/index.js +17 -36
  66. package/dist/lib/components/DoughnutChart/index.js +9 -18
  67. package/dist/lib/components/DropdownMenu/DropdonMenuRadioGroup.d.ts +0 -5
  68. package/dist/lib/components/DropdownMenu/DropdonMenuRadioGroup.js +3 -4
  69. package/dist/lib/components/DropdownMenu/DropdonMenuSubContent.js +5 -3
  70. package/dist/lib/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +1 -1
  71. package/dist/lib/components/DropdownMenu/DropdownMenuCheckboxItem.js +7 -4
  72. package/dist/lib/components/DropdownMenu/DropdownMenuContent.js +5 -3
  73. package/dist/lib/components/DropdownMenu/DropdownMenuItem.d.ts +2 -0
  74. package/dist/lib/components/DropdownMenu/DropdownMenuItem.js +5 -3
  75. package/dist/lib/components/DropdownMenu/DropdownMenuItemIndicator.js +5 -3
  76. package/dist/lib/components/DropdownMenu/DropdownMenuLable.d.ts +0 -1
  77. package/dist/lib/components/DropdownMenu/DropdownMenuLable.js +5 -6
  78. package/dist/lib/components/DropdownMenu/DropdownMenuRadioItem.d.ts +4 -2
  79. package/dist/lib/components/DropdownMenu/DropdownMenuRadioItem.js +8 -6
  80. package/dist/lib/components/DropdownMenu/DropdownMenuRoot.d.ts +12 -0
  81. package/dist/lib/components/DropdownMenu/DropdownMenuRoot.js +38 -0
  82. package/dist/lib/components/DropdownMenu/DropdownMenuSeparator.js +1 -1
  83. package/dist/lib/components/DropdownMenu/DropdownMenuSub.js +1 -1
  84. package/dist/lib/components/DropdownMenu/DropdownMenuSubTrigger.js +5 -3
  85. package/dist/lib/components/DropdownMenu/DropdownMenuTrigger.d.ts +2 -1
  86. package/dist/lib/components/DropdownMenu/DropdownMenuTrigger.js +5 -3
  87. package/dist/lib/components/DropdownMenu/index.d.ts +16 -22
  88. package/dist/lib/components/DropdownMenu/index.js +27 -41
  89. package/dist/lib/components/HoverCard/HoverCardContent.js +5 -3
  90. package/dist/lib/components/HoverCard/HoverCardRoot.d.ts +8 -0
  91. package/dist/lib/components/HoverCard/HoverCardRoot.js +38 -0
  92. package/dist/lib/components/HoverCard/HoverCardTrigger.js +1 -1
  93. package/dist/lib/components/HoverCard/index.d.ts +6 -9
  94. package/dist/lib/components/HoverCard/index.js +7 -31
  95. package/dist/lib/components/LineChart/index.d.ts +87 -0
  96. package/dist/lib/components/LineChart/index.js +58 -0
  97. package/dist/lib/components/Menubar/MenubarCheckboxItem.js +2 -2
  98. package/dist/lib/components/Menubar/MenubarContent.js +2 -2
  99. package/dist/lib/components/Menubar/MenubarItem.js +2 -2
  100. package/dist/lib/components/Menubar/MenubarItemIndicator.js +2 -2
  101. package/dist/lib/components/Menubar/MenubarMenu.js +1 -1
  102. package/dist/lib/components/Menubar/MenubarRadioGroup.js +1 -1
  103. package/dist/lib/components/Menubar/MenubarRadioItem.js +2 -2
  104. package/dist/lib/components/Menubar/MenubarRoot.d.ts +19 -0
  105. package/dist/lib/components/Menubar/MenubarRoot.js +61 -0
  106. package/dist/lib/components/Menubar/MenubarSeparator.js +1 -1
  107. package/dist/lib/components/Menubar/MenubarSub.js +1 -1
  108. package/dist/lib/components/Menubar/MenubarSubContent.js +2 -2
  109. package/dist/lib/components/Menubar/MenubarSubTrigger.js +2 -2
  110. package/dist/lib/components/Menubar/MenubarTrigger.js +2 -2
  111. package/dist/lib/components/Menubar/index.d.ts +16 -30
  112. package/dist/lib/components/Menubar/index.js +27 -71
  113. package/dist/lib/components/NavigationMenu/NavigationMenuContent.js +2 -2
  114. package/dist/lib/components/NavigationMenu/NavigationMenuIndicator.js +1 -1
  115. package/dist/lib/components/NavigationMenu/NavigationMenuItem.js +1 -1
  116. package/dist/lib/components/NavigationMenu/NavigationMenuLink.js +2 -2
  117. package/dist/lib/components/NavigationMenu/NavigationMenuList.js +2 -2
  118. package/dist/lib/components/NavigationMenu/NavigationMenuRoot.d.ts +14 -0
  119. package/dist/lib/components/NavigationMenu/NavigationMenuRoot.js +43 -0
  120. package/dist/lib/components/NavigationMenu/NavigationMenuTrigger.js +2 -2
  121. package/dist/lib/components/NavigationMenu/NavigationMenuViewport.js +2 -2
  122. package/dist/lib/components/NavigationMenu/index.d.ts +11 -20
  123. package/dist/lib/components/NavigationMenu/index.js +9 -49
  124. package/dist/lib/components/PieChart/index.js +9 -18
  125. package/dist/lib/components/Popover/PopoverClose.js +5 -3
  126. package/dist/lib/components/Popover/PopoverContent.js +5 -3
  127. package/dist/lib/components/Popover/PopoverRoot.d.ts +9 -0
  128. package/dist/lib/components/Popover/PopoverRoot.js +36 -0
  129. package/dist/lib/components/Popover/PopoverTrigger.js +1 -1
  130. package/dist/lib/components/Popover/index.d.ts +7 -11
  131. package/dist/lib/components/Popover/index.js +9 -32
  132. package/dist/lib/components/RadioCards/RadioCardsItem.js +5 -3
  133. package/dist/lib/components/RadioCards/RadioCardsRoot.d.ts +14 -0
  134. package/dist/lib/components/RadioCards/RadioCardsRoot.js +46 -0
  135. package/dist/lib/components/RadioCards/index.d.ts +5 -13
  136. package/dist/lib/components/RadioCards/index.js +5 -41
  137. package/dist/lib/components/RadioGroup/RadioGroupItem.js +5 -3
  138. package/dist/lib/components/RadioGroup/RadioGroupRoot.d.ts +16 -0
  139. package/dist/lib/components/RadioGroup/RadioGroupRoot.js +53 -0
  140. package/dist/lib/components/RadioGroup/index.d.ts +5 -15
  141. package/dist/lib/components/RadioGroup/index.js +5 -49
  142. package/dist/lib/components/SegmentedControl/SegmentedControlItem.js +1 -1
  143. package/dist/lib/components/SegmentedControl/SegmentedControlRoot.d.ts +14 -0
  144. package/dist/lib/components/SegmentedControl/SegmentedControlRoot.js +47 -0
  145. package/dist/lib/components/SegmentedControl/index.d.ts +5 -14
  146. package/dist/lib/components/SegmentedControl/index.js +5 -46
  147. package/dist/lib/components/Select/index.d.ts +16 -7
  148. package/dist/lib/components/Select/index.js +23 -14
  149. package/dist/lib/components/TabNav/index.d.ts +6 -2
  150. package/dist/lib/components/TabNav/index.js +9 -5
  151. package/dist/lib/components/Table/index.d.ts +16 -7
  152. package/dist/lib/components/Table/index.js +23 -14
  153. package/dist/lib/components/Tabs/index.d.ts +10 -4
  154. package/dist/lib/components/Tabs/index.js +15 -9
  155. package/dist/lib/components/TextField/index.d.ts +6 -2
  156. package/dist/lib/components/TextField/index.js +8 -4
  157. package/dist/lib/components/Toast/ToastActionButton.js +2 -2
  158. package/dist/lib/components/Toast/ToastDescription.js +2 -2
  159. package/dist/lib/components/Toast/ToastRoot.d.ts +27 -0
  160. package/dist/lib/components/Toast/ToastRoot.js +90 -0
  161. package/dist/lib/components/Toast/ToastTitle.js +2 -2
  162. package/dist/lib/components/Toast/index.d.ts +7 -29
  163. package/dist/lib/components/Toast/index.js +9 -92
  164. package/dist/lib/components/ToggleGroup/{toggleGroupItem.js → ToggleGroupItem.js} +6 -4
  165. package/dist/lib/components/ToggleGroup/ToggleGroupRoot.d.ts +18 -0
  166. package/dist/lib/components/ToggleGroup/ToggleGroupRoot.js +47 -0
  167. package/dist/lib/components/ToggleGroup/index.d.ts +5 -19
  168. package/dist/lib/components/ToggleGroup/index.js +5 -41
  169. package/dist/lib/components/Tooltip/index.d.ts +3 -3
  170. package/dist/lib/components/Tooltip/index.js +3 -2
  171. package/dist/lib/components/index.d.ts +1 -0
  172. package/dist/lib/components/index.js +1 -0
  173. package/dist/lib/constants.d.ts +0 -9
  174. package/dist/lib/constants.js +0 -7
  175. package/package.json +131 -132
  176. /package/dist/lib/components/ToggleGroup/{toggleGroupItem.d.ts → ToggleGroupItem.d.ts} +0 -0
@@ -1,57 +1,6 @@
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 { createContext, forwardRef, useContext, } from 'react';
25
- import { DataList as DataListTheme } from '@radix-ui/themes';
26
- import { cva } from 'class-variance-authority';
27
- import { cn } from '../../../lib/utils/utils';
28
- export * from './DataListItem';
29
- export * from './DataListLabel';
30
- export * from './DataListValue';
31
- export var dataListVariants = cva('flex flex-col', {
32
- variants: {
33
- size: {
34
- small: 'space-y-3',
35
- medium: 'space-y-4',
36
- large: 'space-y-5',
37
- },
38
- },
39
- defaultVariants: {
40
- size: 'medium',
41
- },
42
- });
43
- var DataListContext = createContext({
44
- size: 'medium',
45
- scaling: '100%',
46
- color: 'black',
47
- });
48
- export var useDataListContext = function () {
49
- return useContext(DataListContext);
50
- };
51
- export var DataList = forwardRef(function (_a, ref) {
52
- var children = _a.children, className = _a.className, size = _a.size, scaling = _a.scaling, color = _a.color, props = __rest(_a, ["children", "className", "size", "scaling", "color"]);
53
- var contextValue = { size: size, scaling: scaling, color: color };
54
- return (_jsx(DataListContext.Provider, { value: contextValue, children: _jsx(DataListTheme.Root, __assign({ ref: ref }, props, { className: cn(dataListVariants({ size: size }), className), children: children })) }));
55
- });
56
- DataList.displayName = 'DataList';
1
+ import { DataListRoot as Root } from './DataListRoot';
2
+ import { DataListItem as Item } from './DataListItem';
3
+ import { DataListLabel as Label } from './DataListLabel';
4
+ import { DataListValue as Value } from './DataListValue';
5
+ var DataList = { Root: Root, Item: Item, Label: Label, Value: Value };
57
6
  export default DataList;
@@ -1,11 +1,9 @@
1
1
  import React from 'react';
2
2
  import { Dialog as DialogTheme } from '@radix-ui/themes';
3
3
  import { VariantProps } from 'class-variance-authority';
4
- import { IAppearance } from '../../../lib/types';
5
4
  export interface DialogActionProps extends VariantProps<typeof dialogActionVariants> {
6
5
  color?: any;
7
6
  size?: any;
8
- appearance?: IAppearance;
9
7
  }
10
8
  export declare const dialogActionVariants: (props?: ({
11
9
  radius?: "small" | "none" | "medium" | "large" | "full" | null | undefined;
@@ -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 { Dialog as DialogTheme } from '@radix-ui/themes';
26
26
  import { cva } from 'class-variance-authority';
27
- import { appearanceStyle, primaryColorStyle } from '../../../lib/constants';
27
+ import { primaryColorStyle } from '../../../lib/constants';
28
+ import { DialogContext } from './DialogRoot';
28
29
  import { cn } from '../../../lib/utils/utils';
29
30
  export var dialogActionVariants = cva('rounded-md inline-flex font-medium items-center justify-center px-[15px] hover:cursor-pointer', {
30
31
  variants: {
@@ -50,8 +51,9 @@ export var dialogActionVariants = cva('rounded-md inline-flex font-medium items-
50
51
  },
51
52
  });
52
53
  export var DialogAction = forwardRef(function (_a, ref) {
53
- var children = _a.children, className = _a.className, radius = _a.radius, size = _a.size, _b = _a.color, color = _b === void 0 ? 'red' : _b, _c = _a.appearance, appearance = _c === void 0 ? 'solid' : _c, props = __rest(_a, ["children", "className", "radius", "size", "color", "appearance"]);
54
- var buttonClassName = cn(dialogActionVariants({ radius: radius, size: size, color: color }), appearanceStyle(appearance, color), className);
54
+ var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
55
+ var _b = useContext(DialogContext), radius = _b.radius, size = _b.size, color = _b.color;
56
+ var buttonClassName = cn(dialogActionVariants({ radius: radius, size: size, color: color }), className);
55
57
  return (_jsx(DialogTheme.Close, __assign({ ref: ref, className: buttonClassName }, props, { children: children })));
56
58
  });
57
- DialogAction.displayName = 'DialogAction';
59
+ DialogAction.displayName = 'Dialog.Action';
@@ -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 { Dialog as DialogTheme } from '@radix-ui/themes';
26
26
  import { cva } from 'class-variance-authority';
27
+ import { DialogContext } from './DialogRoot';
27
28
  import { cn } from '../../../lib/utils/utils';
28
29
  export var dialogCancelVariants = cva("rounded-md font-medium inline-flex justify-center items-center text-slate-11 bg-slate-3 outline-none border-none\n dark:text-slateDark-11 dark:bg-slateDark-3 dark:hover:bg-slateDarkA-4\n active:border-none hover:cursor-pointer hover:bg-slateA-4", {
29
30
  variants: {
@@ -47,7 +48,8 @@ export var dialogCancelVariants = cva("rounded-md font-medium inline-flex justif
47
48
  },
48
49
  });
49
50
  export var DialogCancel = forwardRef(function (_a, ref) {
50
- var children = _a.children, className = _a.className, radius = _a.radius, size = _a.size, props = __rest(_a, ["children", "className", "radius", "size"]);
51
+ var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
52
+ var _b = useContext(DialogContext), radius = _b.radius, size = _b.size;
51
53
  return (_jsx(DialogTheme.Close, __assign({ ref: ref, className: cn(dialogCancelVariants({ radius: radius, size: size }), className) }, props, { children: children })));
52
54
  });
53
- DialogCancel.displayName = 'DialogCancel';
55
+ DialogCancel.displayName = 'Dialog.Cancel';
@@ -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 { cva } from 'class-variance-authority';
26
26
  import { Dialog as DialogTheme } from '@radix-ui/themes';
27
27
  import { scalingVariants } from '../../../lib/constants';
28
+ import { DialogContext } from './DialogRoot';
28
29
  import { cn } from '../../../lib/utils/utils';
29
30
  export var dialogContentVariants = cva("rounded-md focus:outline-none bg-white dark:bg-slateDark-1 \n shadow-[hsl(206_22%_7%_/_35%)_0px_10px_38px_-10px,_hsl(206_22%_7%_/_20%)_0px_10px_20px_-15px]", {
30
31
  variants: {
@@ -49,7 +50,8 @@ export var dialogContentVariants = cva("rounded-md focus:outline-none bg-white d
49
50
  },
50
51
  });
51
52
  export var DialogContent = forwardRef(function (_a, forwardedRef) {
52
- var children = _a.children, className = _a.className, radius = _a.radius, size = _a.size, scaling = _a.scaling, props = __rest(_a, ["children", "className", "radius", "size", "scaling"]);
53
+ var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
54
+ var _b = useContext(DialogContext), radius = _b.radius, size = _b.size, scaling = _b.scaling;
53
55
  return (_jsx(DialogTheme.Content, __assign({ ref: forwardedRef, className: cn(dialogContentVariants({ radius: radius, scaling: scaling, size: size }), className) }, props, { children: children })));
54
56
  });
55
- DialogContent.displayName = 'DialogContent';
57
+ DialogContent.displayName = 'Dialog.Content';
@@ -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 { Dialog as DialogTheme } from '@radix-ui/themes';
27
+ import { DialogContext } from './DialogRoot';
27
28
  import { cn } from '../../../lib/utils/utils';
28
29
  export var dialogDescriptionVariants = cva('font-normal text-slate-12 dark:text-slateDark-12', {
29
30
  variants: {
@@ -39,7 +40,8 @@ export var dialogDescriptionVariants = cva('font-normal text-slate-12 dark:text-
39
40
  },
40
41
  });
41
42
  export var DialogDescription = forwardRef(function (_a, ref) {
42
- var children = _a.children, className = _a.className, size = _a.size, props = __rest(_a, ["children", "className", "size"]);
43
+ var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
44
+ var size = useContext(DialogContext).size;
43
45
  return (_jsx(DialogTheme.Description, __assign({ mb: "4", ref: ref, className: cn(dialogDescriptionVariants({ size: size }), className) }, props, { children: children })));
44
46
  });
45
- DialogDescription.displayName = 'DialogDescription';
47
+ DialogDescription.displayName = 'Dialog.Description';
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { Dialog as DialogTheme } from '@radix-ui/themes';
3
+ import { VariantProps } from 'class-variance-authority';
4
+ import { dialogContentVariants } from './DialogContent';
5
+ import { dialogTitleVariants } from './DialogTitle';
6
+ import { dialogDescriptionVariants } from './DialogDescription';
7
+ import { dialogActionVariants } from './DialogAction';
8
+ export interface DialogProps extends VariantProps<typeof dialogContentVariants>, VariantProps<typeof dialogTitleVariants>, VariantProps<typeof dialogDescriptionVariants>, VariantProps<typeof dialogActionVariants> {
9
+ color?: any;
10
+ }
11
+ export declare const DialogContext: React.Context<DialogProps>;
12
+ export declare const DialogRoot: React.ForwardRefExoticComponent<DialogTheme.RootProps & DialogProps & React.RefAttributes<never>>;
@@ -0,0 +1,37 @@
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 { Theme, Dialog as DialogTheme } from '@radix-ui/themes';
26
+ export var DialogContext = createContext({
27
+ size: 'medium',
28
+ scaling: '100%',
29
+ color: 'red',
30
+ radius: 'medium',
31
+ });
32
+ export var DialogRoot = forwardRef(function (_a, ref) {
33
+ var children = _a.children, radius = _a.radius, size = _a.size, scaling = _a.scaling, color = _a.color, props = __rest(_a, ["children", "radius", "size", "scaling", "color"]);
34
+ var contextValue = { radius: radius, size: size, scaling: scaling, color: color };
35
+ return (_jsx(Theme, { accentColor: color, children: _jsx(DialogContext.Provider, { value: contextValue, children: _jsx(DialogTheme.Root, __assign({}, props, { children: children })) }) }));
36
+ });
37
+ DialogRoot.displayName = 'Dialog.Root';
@@ -21,8 +21,9 @@ 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
+ import { DialogContext } from './DialogRoot';
26
27
  import { cn } from '../../../lib/utils/utils';
27
28
  export var dialogSlotVariants = cva('flex flex-col gap-2 font-normal text-slate-12 dark:text-slateDark-12', {
28
29
  variants: {
@@ -38,7 +39,8 @@ export var dialogSlotVariants = cva('flex flex-col gap-2 font-normal text-slate-
38
39
  },
39
40
  });
40
41
  export var DialogSlot = forwardRef(function (_a, ref) {
41
- var children = _a.children, className = _a.className, size = _a.size, props = __rest(_a, ["children", "className", "size"]);
42
+ var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
43
+ var size = useContext(DialogContext).size;
42
44
  return (_jsx("div", __assign({ ref: ref, className: cn(dialogSlotVariants({ size: size }), className) }, props, { children: children })));
43
45
  });
44
- DialogSlot.displayName = 'DialogSlot';
46
+ DialogSlot.displayName = 'Dialog.Slot';
@@ -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 { Dialog as DialogTheme } from '@radix-ui/themes';
27
+ import { DialogContext } from './DialogRoot';
27
28
  import { cn } from '../../../lib/utils/utils';
28
29
  export var dialogTitleVariants = cva('font-bold text-slate-12 dark:text-slateDark-12', {
29
30
  variants: {
@@ -39,7 +40,8 @@ export var dialogTitleVariants = cva('font-bold text-slate-12 dark:text-slateDar
39
40
  },
40
41
  });
41
42
  export var DialogTitle = forwardRef(function (_a, ref) {
42
- var children = _a.children, className = _a.className, size = _a.size, props = __rest(_a, ["children", "className", "size"]);
43
+ var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
44
+ var size = useContext(DialogContext).size;
43
45
  return (_jsx(DialogTheme.Title, __assign({ ref: ref, className: cn(dialogTitleVariants({ size: size }), className) }, props, { children: children })));
44
46
  });
45
- DialogTitle.displayName = 'DialogTitle';
47
+ DialogTitle.displayName = 'Dialog.Title';
@@ -27,4 +27,4 @@ export var DialogTrigger = forwardRef(function (_a, ref) {
27
27
  var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
28
28
  return (_jsx(DialogTheme.Trigger, __assign({ ref: ref, className: className }, props, { children: children })));
29
29
  });
30
- DialogTrigger.displayName = 'DialogTrigger';
30
+ DialogTrigger.displayName = 'Dialog.Trigger';
@@ -1,18 +1,12 @@
1
- import React from 'react';
2
- import { Dialog as DialogTheme } from '@radix-ui/themes';
3
- import { VariantProps } from 'class-variance-authority';
4
- import { dialogContentVariants } from './DialogContent';
5
- import { dialogTitleVariants } from './DialogTitle';
6
- import { dialogDescriptionVariants } from './DialogDescription';
7
- export * from './DialogContent';
8
- export * from './DialogTitle';
9
- export * from './DialogDescription';
10
- export * from './DialogSlot';
11
- export * from './DialogTrigger';
12
- export * from './DialogCancel';
13
- export * from './DialogAction';
14
- export interface DialogProps extends VariantProps<typeof dialogContentVariants>, VariantProps<typeof dialogTitleVariants>, VariantProps<typeof dialogDescriptionVariants> {
15
- color?: any;
16
- }
17
- export declare const Dialog: React.ForwardRefExoticComponent<DialogTheme.RootProps & DialogProps & React.RefAttributes<never>>;
1
+ /// <reference types="react" />
2
+ declare const Dialog: {
3
+ Root: import("react").ForwardRefExoticComponent<import("@radix-ui/themes/dist/cjs/components/dialog").RootProps & import("./DialogRoot").DialogProps & import("react").RefAttributes<never>>;
4
+ Trigger: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/dialog").TriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
5
+ Content: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/dialog").ContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./DialogContent").DialogContentProps & import("react").RefAttributes<HTMLDivElement>>;
6
+ Title: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/dialog").TitleProps & import("react").RefAttributes<HTMLHeadingElement>, "ref"> & import("./DialogTitle").DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>>;
7
+ Description: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/dialog").DescriptionProps & import("react").RefAttributes<HTMLParagraphElement>, "ref"> & import("./DialogDescription").DialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>>;
8
+ Slot: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("./DialogSlot").DialogSlotProps & import("react").RefAttributes<HTMLDivElement>>;
9
+ Cancel: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/dialog").CloseProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("./DialogCancel").DialogCancelProps & import("react").RefAttributes<HTMLButtonElement>>;
10
+ Action: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/dialog").CloseProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("./DialogAction").DialogActionProps & import("react").RefAttributes<HTMLButtonElement>>;
11
+ };
18
12
  export default Dialog;
@@ -1,38 +1,19 @@
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 { DialogRoot } from './DialogRoot';
2
+ import { DialogTrigger } from './DialogTrigger';
3
+ import { DialogContent } from './DialogContent';
4
+ import { DialogTitle } from './DialogTitle';
5
+ import { DialogDescription } from './DialogDescription';
6
+ import { DialogSlot } from './DialogSlot';
7
+ import { DialogCancel } from './DialogCancel';
8
+ import { DialogAction } from './DialogAction';
9
+ var Dialog = {
10
+ Root: DialogRoot,
11
+ Trigger: DialogTrigger,
12
+ Content: DialogContent,
13
+ Title: DialogTitle,
14
+ Description: DialogDescription,
15
+ Slot: DialogSlot,
16
+ Cancel: DialogCancel,
17
+ Action: DialogAction,
11
18
  };
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 { Theme, Dialog as DialogTheme } from '@radix-ui/themes';
26
- export * from './DialogContent';
27
- export * from './DialogTitle';
28
- export * from './DialogDescription';
29
- export * from './DialogSlot';
30
- export * from './DialogTrigger';
31
- export * from './DialogCancel';
32
- export * from './DialogAction';
33
- export var Dialog = forwardRef(function (_a, ref) {
34
- var children = _a.children, color = _a.color, props = __rest(_a, ["children", "color"]);
35
- return (_jsx(Theme, { accentColor: color, children: _jsx(DialogTheme.Root, __assign({}, props, { children: children })) }));
36
- });
37
- Dialog.displayName = 'Dialog';
38
19
  export default Dialog;
@@ -42,26 +42,17 @@ var doughnutVariants = cva('', {
42
42
  });
43
43
  var DoughnutChart = function (_a) {
44
44
  var labels = _a.labels, datasets = _a.datasets, scaling = _a.scaling, className = _a.className, _b = _a.appearance, appearance = _b === void 0 ? 'solid' : _b, _c = _a.isColorMixed, isColorMixed = _c === void 0 ? true : _c, rest = __rest(_a, ["labels", "datasets", "scaling", "className", "appearance", "isColorMixed"]);
45
- if (appearance === 'solid') {
46
- if (isColorMixed) {
47
- datasets[0].backgroundColor = chartColorList.mixed;
48
- datasets[0].borderColor = chartColorList.mixed;
45
+ var getChartColor = function (isColorMixed, appearance) {
46
+ if (appearance === 'solid') {
47
+ return isColorMixed ? chartColorList.mixed : chartColorList.sorting;
49
48
  }
50
- else {
51
- datasets[0].backgroundColor = chartColorList.sorting;
52
- datasets[0].borderColor = chartColorList.sorting;
49
+ if (appearance === 'soft') {
50
+ return isColorMixed ? chartAlphaColorList.mixed : chartAlphaColorList.sorting;
53
51
  }
54
- }
55
- if (appearance === 'soft') {
56
- if (isColorMixed) {
57
- datasets[0].backgroundColor = chartAlphaColorList.mixed;
58
- datasets[0].borderColor = chartColorList.mixed;
59
- }
60
- else {
61
- datasets[0].backgroundColor = chartAlphaColorList.sorting;
62
- datasets[0].borderColor = chartColorList.sorting;
63
- }
64
- }
52
+ };
53
+ datasets.forEach(function (dataset, index) {
54
+ datasets[index] = __assign(__assign({}, dataset), { backgroundColor: getChartColor(isColorMixed, appearance), borderColor: getChartColor(isColorMixed, 'solid') });
55
+ });
65
56
  return (_jsx(Doughnut, __assign({ data: { labels: labels, datasets: datasets }, className: cn(doughnutVariants({ scaling: scaling }), className) }, rest)));
66
57
  };
67
58
  export default DoughnutChart;
@@ -1,8 +1,3 @@
1
1
  import React from 'react';
2
2
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
- type RadioContextType = {
4
- selectedValue: string;
5
- };
6
- export declare const RadioContext: React.Context<RadioContextType>;
7
3
  export declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
- export {};
@@ -21,11 +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 { createContext, forwardRef } from 'react';
24
+ import React, { forwardRef, Children } from 'react';
25
25
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
26
- export var RadioContext = createContext({ selectedValue: '' });
27
26
  export var DropdownMenuRadioGroup = forwardRef(function (_a, ref) {
28
27
  var className = _a.className, children = _a.children, value = _a.value, props = __rest(_a, ["className", "children", "value"]);
29
- return (_jsx(DropdownMenuPrimitive.RadioGroup, __assign({ ref: ref, className: className }, props, { children: _jsx(RadioContext.Provider, { value: { selectedValue: value !== null && value !== void 0 ? value : '' }, children: children }) })));
28
+ return (_jsx(DropdownMenuPrimitive.RadioGroup, __assign({ ref: ref, className: className }, props, { children: Children.map(children, function (child) { return React.cloneElement(child, { selectedValue: value }); }) })));
30
29
  });
31
- DropdownMenuRadioGroup.displayName = 'DropdownMenuRadioGroup';
30
+ DropdownMenuRadioGroup.displayName = 'DropdownMenu.RadioGroup';
@@ -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 dropdownMenuSubContentVariants = 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,11 +49,12 @@ export var dropdownMenuSubContentVariants = cva("p-[5px] bg-white dark:bg-slateD
48
49
  },
49
50
  });
50
51
  export var DropdownMenuSubContent = forwardRef(function (_a, ref) {
51
- var className = _a.className, children = _a.children, radius = _a.radius, scaling = _a.scaling, size = _a.size, props = __rest(_a, ["className", "children", "radius", "scaling", "size"]);
52
+ var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
53
+ var _b = useContext(DropdownMenuContext), radius = _b.radius, scaling = _b.scaling, size = _b.size;
52
54
  return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.SubContent, __assign({ ref: ref, className: cn(dropdownMenuSubContentVariants({
53
55
  radius: radius,
54
56
  size: size,
55
57
  scaling: scaling,
56
58
  }), className), sideOffset: 2, alignOffset: -5 }, props, { children: children })) }));
57
59
  });
58
- DropdownMenuSubContent.displayName = 'DropdownMenuSubContent';
60
+ DropdownMenuSubContent.displayName = 'DropdownMenu.SubContent';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
- import { DropdownMenuItemProps } from '.';
3
+ import { DropdownMenuItemProps } from './DropdownMenuItem';
4
4
  export interface DropdownMenuCheckboxItemProps {
5
5
  shortcut?: string;
6
6
  }
@@ -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>>;