@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.
- package/README.md +71 -71
- package/dist/globals.css +4 -4
- package/dist/lib/components/Accordion/index.d.ts +10 -4
- package/dist/lib/components/Accordion/index.js +17 -11
- package/dist/lib/components/AlertDialog/AlertDialogAction.js +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogCancel.js +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogContent.js +2 -2
- package/dist/lib/components/AlertDialog/AlertDialogRoot.d.ts +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogRoot.js +7 -2
- package/dist/lib/components/AlertDialog/AlertDialogTrigger.js +1 -1
- package/dist/lib/components/Avatar/index.d.ts +3 -0
- package/dist/lib/components/Avatar/index.js +3 -2
- package/dist/lib/components/BarChart/index.d.ts +5 -3
- package/dist/lib/components/BarChart/index.js +12 -1
- package/dist/lib/components/BubbleChart/index.d.ts +3 -0
- package/dist/lib/components/Callout/CalloutIcon.js +3 -3
- package/dist/lib/components/Callout/CalloutRoot.d.ts +18 -0
- package/dist/lib/components/Callout/CalloutRoot.js +72 -0
- package/dist/lib/components/Callout/CalloutText.js +2 -2
- package/dist/lib/components/Callout/index.d.ts +6 -19
- package/dist/lib/components/Callout/index.js +7 -73
- package/dist/lib/components/CheckboxGroup/CheckboxGroupItem.js +2 -2
- package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.d.ts +16 -0
- package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.js +34 -0
- package/dist/lib/components/CheckboxGroup/index.d.ts +5 -16
- package/dist/lib/components/CheckboxGroup/index.js +3 -34
- package/dist/lib/components/ContextMenu/ContextMenuCheckboxItem.d.ts +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuCheckboxItem.js +4 -2
- package/dist/lib/components/ContextMenu/ContextMenuContent.js +2 -2
- package/dist/lib/components/ContextMenu/ContextMenuGroup.d.ts +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuGroup.js +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuItem.js +2 -2
- package/dist/lib/components/ContextMenu/ContextMenuItemIndicator.js +2 -2
- package/dist/lib/components/ContextMenu/ContextMenuLabel.js +2 -2
- package/dist/lib/components/ContextMenu/ContextMenuRadioGroup.js +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuRadioItem.d.ts +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuRadioItem.js +5 -2
- package/dist/lib/components/ContextMenu/ContextMenuRoot.d.ts +13 -0
- package/dist/lib/components/ContextMenu/ContextMenuRoot.js +42 -0
- package/dist/lib/components/ContextMenu/ContextMenuSeparator.js +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuSubContent.js +4 -3
- package/dist/lib/components/ContextMenu/ContextMenuSubTrigger.js +2 -2
- package/dist/lib/components/ContextMenu/ContextMenuTrigger.d.ts +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuTrigger.js +2 -2
- package/dist/lib/components/ContextMenu/index.d.ts +16 -24
- package/dist/lib/components/ContextMenu/index.js +27 -52
- package/dist/lib/components/DataList/DataListItem.js +2 -2
- package/dist/lib/components/DataList/DataListLabel.js +2 -2
- package/dist/lib/components/DataList/DataListRoot.d.ts +14 -0
- package/dist/lib/components/DataList/DataListRoot.js +54 -0
- package/dist/lib/components/DataList/DataListValue.js +2 -2
- package/dist/lib/components/DataList/index.d.ts +7 -16
- package/dist/lib/components/DataList/index.js +5 -56
- package/dist/lib/components/Dialog/DialogAction.d.ts +0 -2
- package/dist/lib/components/Dialog/DialogAction.js +7 -5
- package/dist/lib/components/Dialog/DialogCancel.js +5 -3
- package/dist/lib/components/Dialog/DialogContent.js +5 -3
- package/dist/lib/components/Dialog/DialogDescription.js +5 -3
- package/dist/lib/components/Dialog/DialogRoot.d.ts +12 -0
- package/dist/lib/components/Dialog/DialogRoot.js +37 -0
- package/dist/lib/components/Dialog/DialogSlot.js +5 -3
- package/dist/lib/components/Dialog/DialogTitle.js +5 -3
- package/dist/lib/components/Dialog/DialogTrigger.js +1 -1
- package/dist/lib/components/Dialog/index.d.ts +11 -17
- package/dist/lib/components/Dialog/index.js +17 -36
- package/dist/lib/components/DoughnutChart/index.js +9 -18
- package/dist/lib/components/DropdownMenu/DropdonMenuRadioGroup.d.ts +0 -5
- package/dist/lib/components/DropdownMenu/DropdonMenuRadioGroup.js +3 -4
- package/dist/lib/components/DropdownMenu/DropdonMenuSubContent.js +5 -3
- package/dist/lib/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuCheckboxItem.js +7 -4
- package/dist/lib/components/DropdownMenu/DropdownMenuContent.js +5 -3
- package/dist/lib/components/DropdownMenu/DropdownMenuItem.d.ts +2 -0
- package/dist/lib/components/DropdownMenu/DropdownMenuItem.js +5 -3
- package/dist/lib/components/DropdownMenu/DropdownMenuItemIndicator.js +5 -3
- package/dist/lib/components/DropdownMenu/DropdownMenuLable.d.ts +0 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuLable.js +5 -6
- package/dist/lib/components/DropdownMenu/DropdownMenuRadioItem.d.ts +4 -2
- package/dist/lib/components/DropdownMenu/DropdownMenuRadioItem.js +8 -6
- package/dist/lib/components/DropdownMenu/DropdownMenuRoot.d.ts +12 -0
- package/dist/lib/components/DropdownMenu/DropdownMenuRoot.js +38 -0
- package/dist/lib/components/DropdownMenu/DropdownMenuSeparator.js +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuSub.js +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuSubTrigger.js +5 -3
- package/dist/lib/components/DropdownMenu/DropdownMenuTrigger.d.ts +2 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuTrigger.js +5 -3
- package/dist/lib/components/DropdownMenu/index.d.ts +16 -22
- package/dist/lib/components/DropdownMenu/index.js +27 -41
- package/dist/lib/components/HoverCard/HoverCardContent.js +5 -3
- package/dist/lib/components/HoverCard/HoverCardRoot.d.ts +8 -0
- package/dist/lib/components/HoverCard/HoverCardRoot.js +38 -0
- package/dist/lib/components/HoverCard/HoverCardTrigger.js +1 -1
- package/dist/lib/components/HoverCard/index.d.ts +6 -9
- package/dist/lib/components/HoverCard/index.js +7 -31
- package/dist/lib/components/LineChart/index.d.ts +87 -0
- package/dist/lib/components/LineChart/index.js +58 -0
- package/dist/lib/components/Menubar/MenubarCheckboxItem.js +2 -2
- package/dist/lib/components/Menubar/MenubarContent.js +2 -2
- package/dist/lib/components/Menubar/MenubarItem.js +2 -2
- package/dist/lib/components/Menubar/MenubarItemIndicator.js +2 -2
- package/dist/lib/components/Menubar/MenubarMenu.js +1 -1
- package/dist/lib/components/Menubar/MenubarRadioGroup.js +1 -1
- package/dist/lib/components/Menubar/MenubarRadioItem.js +2 -2
- package/dist/lib/components/Menubar/MenubarRoot.d.ts +19 -0
- package/dist/lib/components/Menubar/MenubarRoot.js +61 -0
- package/dist/lib/components/Menubar/MenubarSeparator.js +1 -1
- package/dist/lib/components/Menubar/MenubarSub.js +1 -1
- package/dist/lib/components/Menubar/MenubarSubContent.js +2 -2
- package/dist/lib/components/Menubar/MenubarSubTrigger.js +2 -2
- package/dist/lib/components/Menubar/MenubarTrigger.js +2 -2
- package/dist/lib/components/Menubar/index.d.ts +16 -30
- package/dist/lib/components/Menubar/index.js +27 -71
- package/dist/lib/components/NavigationMenu/NavigationMenuContent.js +2 -2
- package/dist/lib/components/NavigationMenu/NavigationMenuIndicator.js +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuItem.js +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuLink.js +2 -2
- package/dist/lib/components/NavigationMenu/NavigationMenuList.js +2 -2
- package/dist/lib/components/NavigationMenu/NavigationMenuRoot.d.ts +14 -0
- package/dist/lib/components/NavigationMenu/NavigationMenuRoot.js +43 -0
- package/dist/lib/components/NavigationMenu/NavigationMenuTrigger.js +2 -2
- package/dist/lib/components/NavigationMenu/NavigationMenuViewport.js +2 -2
- package/dist/lib/components/NavigationMenu/index.d.ts +11 -20
- package/dist/lib/components/NavigationMenu/index.js +9 -49
- package/dist/lib/components/PieChart/index.js +9 -18
- package/dist/lib/components/Popover/PopoverClose.js +5 -3
- package/dist/lib/components/Popover/PopoverContent.js +5 -3
- package/dist/lib/components/Popover/PopoverRoot.d.ts +9 -0
- package/dist/lib/components/Popover/PopoverRoot.js +36 -0
- package/dist/lib/components/Popover/PopoverTrigger.js +1 -1
- package/dist/lib/components/Popover/index.d.ts +7 -11
- package/dist/lib/components/Popover/index.js +9 -32
- package/dist/lib/components/RadioCards/RadioCardsItem.js +5 -3
- package/dist/lib/components/RadioCards/RadioCardsRoot.d.ts +14 -0
- package/dist/lib/components/RadioCards/RadioCardsRoot.js +46 -0
- package/dist/lib/components/RadioCards/index.d.ts +5 -13
- package/dist/lib/components/RadioCards/index.js +5 -41
- package/dist/lib/components/RadioGroup/RadioGroupItem.js +5 -3
- package/dist/lib/components/RadioGroup/RadioGroupRoot.d.ts +16 -0
- package/dist/lib/components/RadioGroup/RadioGroupRoot.js +53 -0
- package/dist/lib/components/RadioGroup/index.d.ts +5 -15
- package/dist/lib/components/RadioGroup/index.js +5 -49
- package/dist/lib/components/SegmentedControl/SegmentedControlItem.js +1 -1
- package/dist/lib/components/SegmentedControl/SegmentedControlRoot.d.ts +14 -0
- package/dist/lib/components/SegmentedControl/SegmentedControlRoot.js +47 -0
- package/dist/lib/components/SegmentedControl/index.d.ts +5 -14
- package/dist/lib/components/SegmentedControl/index.js +5 -46
- package/dist/lib/components/Select/index.d.ts +16 -7
- package/dist/lib/components/Select/index.js +23 -14
- package/dist/lib/components/TabNav/index.d.ts +6 -2
- package/dist/lib/components/TabNav/index.js +9 -5
- package/dist/lib/components/Table/index.d.ts +16 -7
- package/dist/lib/components/Table/index.js +23 -14
- package/dist/lib/components/Tabs/index.d.ts +10 -4
- package/dist/lib/components/Tabs/index.js +15 -9
- package/dist/lib/components/TextField/index.d.ts +6 -2
- package/dist/lib/components/TextField/index.js +8 -4
- package/dist/lib/components/Toast/ToastActionButton.js +2 -2
- package/dist/lib/components/Toast/ToastDescription.js +2 -2
- package/dist/lib/components/Toast/ToastRoot.d.ts +27 -0
- package/dist/lib/components/Toast/ToastRoot.js +90 -0
- package/dist/lib/components/Toast/ToastTitle.js +2 -2
- package/dist/lib/components/Toast/index.d.ts +7 -29
- package/dist/lib/components/Toast/index.js +9 -92
- package/dist/lib/components/ToggleGroup/{toggleGroupItem.js → ToggleGroupItem.js} +6 -4
- package/dist/lib/components/ToggleGroup/ToggleGroupRoot.d.ts +18 -0
- package/dist/lib/components/ToggleGroup/ToggleGroupRoot.js +47 -0
- package/dist/lib/components/ToggleGroup/index.d.ts +5 -19
- package/dist/lib/components/ToggleGroup/index.js +5 -41
- package/dist/lib/components/Tooltip/index.d.ts +3 -3
- package/dist/lib/components/Tooltip/index.js +3 -2
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/components/index.js +1 -0
- package/dist/lib/constants.d.ts +0 -9
- package/dist/lib/constants.js +0 -7
- package/package.json +131 -132
- /package/dist/lib/components/ToggleGroup/{toggleGroupItem.d.ts → ToggleGroupItem.d.ts} +0 -0
@@ -1,35 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
import
|
3
|
-
|
4
|
-
import { cva } from 'class-variance-authority';
|
5
|
-
import { cn } from '../../../lib/utils/utils';
|
6
|
-
export * from './CheckboxGroupItem';
|
7
|
-
export var CheckboxGroupVariants = cva("", {
|
8
|
-
variants: {
|
9
|
-
size: {
|
10
|
-
small: 'space-y-1',
|
11
|
-
medium: 'space-y-2',
|
12
|
-
large: 'space-y-3',
|
13
|
-
},
|
14
|
-
},
|
15
|
-
defaultVariants: {
|
16
|
-
size: 'medium',
|
17
|
-
},
|
18
|
-
});
|
19
|
-
var CheckboxGroupContext = createContext({
|
20
|
-
size: 'medium',
|
21
|
-
color: 'red',
|
22
|
-
scaling: '100%',
|
23
|
-
radius: 'medium',
|
24
|
-
appearance: 'surface',
|
25
|
-
});
|
26
|
-
export var useCheckboxGroupContext = function () {
|
27
|
-
return useContext(CheckboxGroupContext);
|
28
|
-
};
|
29
|
-
export var CheckboxGroup = forwardRef(function (_a, ref) {
|
30
|
-
var className = _a.className, children = _a.children, defaultValue = _a.defaultValue, size = _a.size;
|
31
|
-
var contextValue = { size: size };
|
32
|
-
return (_jsx(CheckboxGroupContext.Provider, { value: contextValue, children: _jsx(CheckboxGroupTheme.Root, { defaultValue: defaultValue, ref: ref, className: cn(CheckboxGroupVariants({ size: size }), className), children: Children.map(children, function (child) { return React.cloneElement(child, { defaultValue: defaultValue }); }) }) }));
|
33
|
-
});
|
34
|
-
CheckboxGroup.displayName = 'CheckboxGroup';
|
1
|
+
import { CheckboxGroupRoot as Root } from './CheckboxGroupRoot';
|
2
|
+
import { CheckboxGroupItem as Item } from './CheckboxGroupItem';
|
3
|
+
var CheckboxGroup = { Root: Root, Item: Item };
|
35
4
|
export default CheckboxGroup;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
3
|
-
import { ContextMenuProps } from '
|
3
|
+
import { ContextMenuProps } from './ContextMenuRoot';
|
4
4
|
export declare const ContextMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & ContextMenuProps & React.RefAttributes<HTMLDivElement>>;
|
@@ -25,8 +25,10 @@ import { forwardRef } from 'react';
|
|
25
25
|
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
26
26
|
import { CheckIcon } from '@radix-ui/react-icons';
|
27
27
|
import { cn } from '../../../lib/utils/utils';
|
28
|
-
import {
|
28
|
+
import { useContextMenuContext } from './ContextMenuRoot';
|
29
29
|
import { menuItemAppearanceStyle } from '../../../lib/constants';
|
30
|
+
import { contextMenuItemVariants } from './ContextMenuItem';
|
31
|
+
import { ContextMenuItemIndicator } from './ContextMenuItemIndicator';
|
30
32
|
export var ContextMenuCheckboxItem = forwardRef(function (_a, ref) {
|
31
33
|
var children = _a.children, className = _a.className, checked = _a.checked, props = __rest(_a, ["children", "className", "checked"]);
|
32
34
|
var _b = useContextMenuContext(), radius = _b.radius, scaling = _b.scaling, size = _b.size, _c = _b.color, color = _c === void 0 ? 'red' : _c, _d = _b.appearance, appearance = _d === void 0 ? 'solid' : _d;
|
@@ -37,4 +39,4 @@ export var ContextMenuCheckboxItem = forwardRef(function (_a, ref) {
|
|
37
39
|
}), 'pl-7', menuItemAppearanceStyle(appearance, color), className);
|
38
40
|
return (_jsxs(ContextMenuPrimitive.CheckboxItem, __assign({ ref: ref, className: itemClassName }, props, { children: [_jsx(ContextMenuItemIndicator, { forceMount: true, radius: 'medium', size: size, children: checked && _jsx(CheckIcon, {}) }), children] })));
|
39
41
|
});
|
40
|
-
ContextMenuCheckboxItem.displayName = '
|
42
|
+
ContextMenuCheckboxItem.displayName = 'ContextMenu.CheckboxItem';
|
@@ -26,7 +26,7 @@ import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
26
26
|
import { cn } from '../../../lib/utils/utils';
|
27
27
|
import { cva } from 'class-variance-authority';
|
28
28
|
import { scalingVariants } from '../../../lib/constants';
|
29
|
-
import { useContextMenuContext } from '
|
29
|
+
import { useContextMenuContext } from './ContextMenuRoot';
|
30
30
|
export var contextMenuContentVariants = 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)]", {
|
31
31
|
variants: {
|
32
32
|
radius: {
|
@@ -53,4 +53,4 @@ export var ContextMenuContent = forwardRef(function (_a, ref) {
|
|
53
53
|
var _b = useContextMenuContext(), radius = _b.radius, scaling = _b.scaling, size = _b.size;
|
54
54
|
return (_jsx(ContextMenuPrimitive.Portal, { children: _jsx(ContextMenuPrimitive.Content, __assign({ ref: ref, className: cn(contextMenuContentVariants({ radius: radius, scaling: scaling, size: size }), className) }, props, { children: children })) }));
|
55
55
|
});
|
56
|
-
ContextMenuContent.displayName = '
|
56
|
+
ContextMenuContent.displayName = 'ContextMenu.Content';
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { ContextMenuProps } from '
|
2
|
+
import { ContextMenuProps } from './ContextMenuRoot';
|
3
3
|
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
4
4
|
export declare const ContextMenuGroup: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & ContextMenuProps & React.RefAttributes<HTMLDivElement>>;
|
@@ -27,4 +27,4 @@ export var ContextMenuGroup = forwardRef(function (_a, ref) {
|
|
27
27
|
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
28
28
|
return (_jsx(ContextMenuPrimitive.Group, __assign({ ref: ref, className: className }, props, { children: children })));
|
29
29
|
});
|
30
|
-
ContextMenuGroup.displayName = '
|
30
|
+
ContextMenuGroup.displayName = 'ContextMenu.Group';
|
@@ -26,7 +26,7 @@ import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
26
26
|
import { cn } from '../../../lib/utils/utils';
|
27
27
|
import { cva } from 'class-variance-authority';
|
28
28
|
import { blackText, menuItemAppearanceStyle, scalingVariants, radiusVariants } from '../../../lib/constants';
|
29
|
-
import { useContextMenuContext } from '
|
29
|
+
import { useContextMenuContext } from './ContextMenuRoot';
|
30
30
|
export var contextMenuItemVariants = cva("flex group relative leading-none select-none outline-none items-center justify-between font-normal\n data-[disabled]:text-slate-8 data-[disabled]:cursor-not-allowed text-slate-12 dark:text-slateDark-12\n data-[disabled]:hover:bg-transparent dark:data-[disabled]:text-slateDark-8 data-[disabled]:dark:hover:bg-transparent", {
|
31
31
|
variants: {
|
32
32
|
radius: __assign({}, radiusVariants['menu-item']),
|
@@ -56,4 +56,4 @@ export var ContextMenuItem = forwardRef(function (_a, ref) {
|
|
56
56
|
}
|
57
57
|
return (_jsxs(ContextMenuPrimitive.Item, __assign({ ref: ref, className: itemClassName }, props, { children: [children, shortcut && _jsx("span", { className: shortcutClassName, children: shortcut })] })));
|
58
58
|
});
|
59
|
-
ContextMenuItem.displayName = '
|
59
|
+
ContextMenuItem.displayName = 'ContextMenu.Item';
|
@@ -27,7 +27,7 @@ import { cn } from '../../../lib/utils/utils';
|
|
27
27
|
import { CheckIcon } from '@radix-ui/react-icons';
|
28
28
|
import { cva } from 'class-variance-authority';
|
29
29
|
import { radiusVariants } from '../../../lib/constants';
|
30
|
-
import { useContextMenuContext } from '
|
30
|
+
import { useContextMenuContext } from './ContextMenuRoot';
|
31
31
|
export var contextMenuItemIndicatorVariants = cva("absolute left-0 inline-flex items-center justify-center ml-1 border", {
|
32
32
|
variants: {
|
33
33
|
radius: __assign({}, radiusVariants['base']),
|
@@ -47,4 +47,4 @@ export var ContextMenuItemIndicator = forwardRef(function (_a, ref) {
|
|
47
47
|
var indicatorClassName = cn(contextMenuItemIndicatorVariants({ size: size, radius: radius }), className);
|
48
48
|
return (_jsx(ContextMenuPrimitive.ItemIndicator, __assign({ ref: ref, className: indicatorClassName }, props, { children: children !== null && children !== void 0 ? children : _jsx(CheckIcon, {}) })));
|
49
49
|
});
|
50
|
-
ContextMenuItemIndicator.displayName = '
|
50
|
+
ContextMenuItemIndicator.displayName = 'ContextMenu.ItemIndicator';
|
@@ -26,7 +26,7 @@ import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
26
26
|
import { cn } from '../../../lib/utils/utils';
|
27
27
|
import { cva } from 'class-variance-authority';
|
28
28
|
import { scalingVariants } from '../../../lib/constants';
|
29
|
-
import { useContextMenuContext } from '
|
29
|
+
import { useContextMenuContext } from './ContextMenuRoot';
|
30
30
|
export var contextMenuLabelVariants = cva("flex relative leading-none select-none outline-none items-center \n text-slate-11 dark:text-slateDarkA-11 font-normal", {
|
31
31
|
variants: {
|
32
32
|
size: {
|
@@ -45,4 +45,4 @@ export var ContextMenuLabel = forwardRef(function (_a, ref) {
|
|
45
45
|
var _b = useContextMenuContext(), size = _b.size, scaling = _b.scaling;
|
46
46
|
return (_jsx(ContextMenuPrimitive.Label, __assign({ ref: ref, className: cn(contextMenuLabelVariants({ size: size, scaling: scaling }), className) }, props, { children: children })));
|
47
47
|
});
|
48
|
-
ContextMenuLabel.displayName = '
|
48
|
+
ContextMenuLabel.displayName = 'ContextMenu.Label';
|
@@ -28,4 +28,4 @@ export var ContextMenuRadioGroup = forwardRef(function (_a, ref) {
|
|
28
28
|
var className = _a.className, children = _a.children, value = _a.value, props = __rest(_a, ["className", "children", "value"]);
|
29
29
|
return (_jsx(ContextMenuPrimitive.RadioGroup, __assign({ ref: ref, className: className }, props, { children: _jsx(RadioContext.Provider, { value: { selectedValue: value !== null && value !== void 0 ? value : '' }, children: children }) })));
|
30
30
|
});
|
31
|
-
ContextMenuRadioGroup.displayName = '
|
31
|
+
ContextMenuRadioGroup.displayName = 'ContextMenu.RadioGroup';
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
3
|
-
import { ContextMenuProps } from '
|
3
|
+
import { ContextMenuProps } from './ContextMenuRoot';
|
4
4
|
export declare const ContextMenuRadioItem: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & ContextMenuProps & React.RefAttributes<HTMLDivElement>>;
|
@@ -26,7 +26,10 @@ import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
26
26
|
import { cn } from '../../../lib/utils/utils';
|
27
27
|
import { DotFilledIcon } from '@radix-ui/react-icons';
|
28
28
|
import { menuItemAppearanceStyle } from '../../../lib/constants';
|
29
|
-
import {
|
29
|
+
import { useContextMenuContext } from './ContextMenuRoot';
|
30
|
+
import { contextMenuItemVariants } from './ContextMenuItem';
|
31
|
+
import { RadioContext } from './ContextMenuRadioGroup';
|
32
|
+
import { ContextMenuItemIndicator } from './ContextMenuItemIndicator';
|
30
33
|
export var ContextMenuRadioItem = forwardRef(function (_a, ref) {
|
31
34
|
var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
|
32
35
|
var _b = useContextMenuContext(), radius = _b.radius, scaling = _b.scaling, size = _b.size, _c = _b.color, color = _c === void 0 ? 'red' : _c, _d = _b.appearance, appearance = _d === void 0 ? 'solid' : _d;
|
@@ -38,4 +41,4 @@ export var ContextMenuRadioItem = forwardRef(function (_a, ref) {
|
|
38
41
|
var radioGroup = useContext(RadioContext);
|
39
42
|
return (_jsxs(ContextMenuPrimitive.RadioItem, __assign({ ref: ref, className: itemClassName }, props, { children: [_jsx(ContextMenuItemIndicator, { forceMount: true, radius: 'full', size: size, children: radioGroup.selectedValue === props.value && _jsx(DotFilledIcon, {}) }), children] })));
|
40
43
|
});
|
41
|
-
ContextMenuRadioItem.displayName = '
|
44
|
+
ContextMenuRadioItem.displayName = 'ContextMenu.RadioItem';
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
4
|
+
import { IColor } from '../../../lib/types';
|
5
|
+
import { contextMenuContentVariants } from './ContextMenuContent';
|
6
|
+
import { contextMenuItemVariants } from './ContextMenuItem';
|
7
|
+
export interface ContextMenuProps extends VariantProps<typeof contextMenuContentVariants>, VariantProps<typeof contextMenuItemVariants> {
|
8
|
+
color?: IColor;
|
9
|
+
appearance?: 'solid' | 'soft';
|
10
|
+
}
|
11
|
+
export declare const useContextMenuContext: () => ContextMenuProps;
|
12
|
+
export declare const ContextMenuRoot: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuProps & ContextMenuProps & React.RefAttributes<never>>;
|
13
|
+
export default ContextMenuRoot;
|
@@ -0,0 +1,42 @@
|
|
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, useMemo, } from 'react';
|
25
|
+
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
26
|
+
var ContextMenuContext = createContext({
|
27
|
+
radius: 'medium',
|
28
|
+
scaling: '100%',
|
29
|
+
size: 'medium',
|
30
|
+
color: 'red',
|
31
|
+
appearance: 'solid',
|
32
|
+
});
|
33
|
+
export var useContextMenuContext = function () {
|
34
|
+
return useContext(ContextMenuContext);
|
35
|
+
};
|
36
|
+
export var ContextMenuRoot = forwardRef(function (_a, ref) {
|
37
|
+
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"]);
|
38
|
+
var contextValue = useMemo(function () { return ({ radius: radius, size: size, scaling: scaling, color: color, appearance: appearance }); }, [radius, size, scaling, color, appearance]);
|
39
|
+
return (_jsx(ContextMenuContext.Provider, { value: contextValue, children: _jsx("div", { ref: ref, children: _jsx(ContextMenuPrimitive.Root, __assign({}, props, { children: children })) }) }));
|
40
|
+
});
|
41
|
+
ContextMenuRoot.displayName = 'ContextMenu.Root';
|
42
|
+
export default ContextMenuRoot;
|
@@ -28,4 +28,4 @@ export var ContextMenuSeparator = forwardRef(function (_a, ref) {
|
|
28
28
|
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
29
29
|
return (_jsx(ContextMenuPrimitive.Separator, __assign({ ref: ref, className: cn('h-[1px] m-[5px] bg-slate-6 dark:bg-slateDark-6', className) }, props, { children: children })));
|
30
30
|
});
|
31
|
-
ContextMenuSeparator.displayName = '
|
31
|
+
ContextMenuSeparator.displayName = 'ContextMenu.Separator';
|
@@ -26,7 +26,7 @@ import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
26
26
|
import { cn } from '../../../lib/utils/utils';
|
27
27
|
import { cva } from 'class-variance-authority';
|
28
28
|
import { radiusVariants, scalingVariants } from '../../../lib/constants';
|
29
|
-
import { useContextMenuContext } from '
|
29
|
+
import { useContextMenuContext } from './ContextMenuRoot';
|
30
30
|
export var contextMenuSubContentVariants = 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)]", {
|
31
31
|
variants: {
|
32
32
|
radius: __assign({}, radiusVariants['extra-large']),
|
@@ -44,10 +44,11 @@ export var contextMenuSubContentVariants = cva("p-[5px] bg-white dark:bg-slateDa
|
|
44
44
|
});
|
45
45
|
export var ContextMenuSubContent = forwardRef(function (_a, ref) {
|
46
46
|
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
47
|
-
var _b = useContextMenuContext(), radius = _b.radius, size = _b.size;
|
47
|
+
var _b = useContextMenuContext(), radius = _b.radius, size = _b.size, scaling = _b.scaling;
|
48
48
|
return (_jsx(ContextMenuPrimitive.Portal, { children: _jsx(ContextMenuPrimitive.SubContent, __assign({ ref: ref, className: cn(contextMenuSubContentVariants({
|
49
49
|
radius: radius,
|
50
50
|
size: size,
|
51
|
+
scaling: scaling,
|
51
52
|
}), className), sideOffset: 2, alignOffset: -5 }, props, { children: children })) }));
|
52
53
|
});
|
53
|
-
ContextMenuSubContent.displayName = '
|
54
|
+
ContextMenuSubContent.displayName = 'ContextMenu.SubContent';
|
@@ -27,7 +27,7 @@ import { ChevronRightIcon } from '@radix-ui/react-icons';
|
|
27
27
|
import { cn } from '../../../lib/utils/utils';
|
28
28
|
import { contextMenuItemVariants } from './ContextMenuItem';
|
29
29
|
import { blackText, menuItemAppearanceStyle } from '../../../lib/constants';
|
30
|
-
import { useContextMenuContext } from '
|
30
|
+
import { useContextMenuContext } from './ContextMenuRoot';
|
31
31
|
export var ContextMenuSubTrigger = forwardRef(function (_a, ref) {
|
32
32
|
var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
|
33
33
|
var _b = useContextMenuContext(), scaling = _b.scaling, size = _b.size, radius = _b.radius, _c = _b.color, color = _c === void 0 ? 'red' : _c, _d = _b.appearance, appearance = _d === void 0 ? 'solid' : _d;
|
@@ -37,4 +37,4 @@ export var ContextMenuSubTrigger = forwardRef(function (_a, ref) {
|
|
37
37
|
: "hover:fill-white dark:hover:fill-slateDark-12 ");
|
38
38
|
return (_jsx(ContextMenuPrimitive.Sub, { children: _jsxs(ContextMenuPrimitive.SubTrigger, __assign({ ref: ref, className: triggerClassName }, props, { children: [children, _jsx("div", { className: "ml-auto pl-5 ", children: _jsx(ChevronRightIcon, { className: iconClassName }) })] })) }));
|
39
39
|
});
|
40
|
-
ContextMenuSubTrigger.displayName = '
|
40
|
+
ContextMenuSubTrigger.displayName = 'ContextMenu.SubTrigger';
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
3
|
-
import { ContextMenuProps } from '
|
3
|
+
import { ContextMenuProps } from './ContextMenuRoot';
|
4
4
|
export declare const ContextMenuTrigger: React.ForwardRefExoticComponent<Omit<ContextMenuPrimitive.ContextMenuTriggerProps & React.RefAttributes<HTMLSpanElement>, "ref"> & ContextMenuProps & React.RefAttributes<HTMLSpanElement>>;
|
@@ -26,6 +26,6 @@ import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
26
26
|
import { cn } from '../../../lib/utils/utils';
|
27
27
|
export var ContextMenuTrigger = forwardRef(function (_a, ref) {
|
28
28
|
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
29
|
-
return (_jsx(ContextMenuPrimitive.Trigger, __assign({ ref: ref, className: cn("flex text-slate-12 dark:text-slateDark-12 text-base text-center", className) }, props, { children: children })));
|
29
|
+
return (_jsx(ContextMenuPrimitive.Trigger, __assign({ ref: ref, className: cn("flex text-slate-12 dark:text-slateDark-12 text-base text-center justify-center", className) }, props, { children: children })));
|
30
30
|
});
|
31
|
-
ContextMenuTrigger.displayName = '
|
31
|
+
ContextMenuTrigger.displayName = 'ContextMenu.Trigger';
|
@@ -1,25 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
export * from './ContextMenuSubTrigger';
|
18
|
-
export * from './ContextMenuSubContent';
|
19
|
-
export interface ContextMenuProps extends VariantProps<typeof contextMenuContentVariants>, VariantProps<typeof contextMenuItemVariants> {
|
20
|
-
color?: IColor;
|
21
|
-
appearance?: 'solid' | 'soft';
|
22
|
-
}
|
23
|
-
export declare const useContextMenuContext: () => ContextMenuProps;
|
24
|
-
export declare const ContextMenu: React.ForwardRefExoticComponent<ContextMenuPrimitive.ContextMenuProps & ContextMenuProps & React.RefAttributes<never>>;
|
1
|
+
/// <reference types="react" />
|
2
|
+
declare const ContextMenu: {
|
3
|
+
Root: import("react").ForwardRefExoticComponent<import("@radix-ui/react-context-menu").ContextMenuProps & import("./ContextMenuRoot").ContextMenuProps & import("react").RefAttributes<never>>;
|
4
|
+
Content: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-context-menu").ContextMenuContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./ContextMenuContent").ContextMenuContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
5
|
+
CheckboxItem: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-context-menu").ContextMenuCheckboxItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./ContextMenuRoot").ContextMenuProps & import("react").RefAttributes<HTMLDivElement>>;
|
6
|
+
Group: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-context-menu").ContextMenuGroupProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./ContextMenuRoot").ContextMenuProps & import("react").RefAttributes<HTMLDivElement>>;
|
7
|
+
Item: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-context-menu").ContextMenuItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./ContextMenuItem").ContextMenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
8
|
+
ItemIndicator: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-context-menu").ContextMenuItemIndicatorProps & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("./ContextMenuItemIndicator").ContextMenuItemIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>;
|
9
|
+
Label: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-context-menu").ContextMenuLabelProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./ContextMenuLabel").ContextMenuLabelProps & import("react").RefAttributes<HTMLDivElement>>;
|
10
|
+
Trigger: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-context-menu").ContextMenuTriggerProps & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("./ContextMenuRoot").ContextMenuProps & import("react").RefAttributes<HTMLSpanElement>>;
|
11
|
+
RadioGroup: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-context-menu").ContextMenuRadioGroupProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
12
|
+
RadioItem: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-context-menu").ContextMenuRadioItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./ContextMenuRoot").ContextMenuProps & import("react").RefAttributes<HTMLDivElement>>;
|
13
|
+
Separator: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-context-menu").ContextMenuSeparatorProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
14
|
+
SubTrigger: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-context-menu").ContextMenuSubTriggerProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./ContextMenuItem").ContextMenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
15
|
+
SubContent: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-context-menu").ContextMenuSubContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./ContextMenuSubContent").ContextMenuSubContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
16
|
+
};
|
25
17
|
export default ContextMenu;
|
@@ -1,54 +1,29 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
import { ContextMenuRoot as Root } from './ContextMenuRoot';
|
2
|
+
import { ContextMenuContent as Content } from './ContextMenuContent';
|
3
|
+
import { ContextMenuCheckboxItem as CheckboxItem } from './ContextMenuCheckboxItem';
|
4
|
+
import { ContextMenuGroup as Group } from './ContextMenuGroup';
|
5
|
+
import { ContextMenuItem as Item } from './ContextMenuItem';
|
6
|
+
import { ContextMenuItemIndicator as ItemIndicator } from './ContextMenuItemIndicator';
|
7
|
+
import { ContextMenuLabel as Label } from './ContextMenuLabel';
|
8
|
+
import { ContextMenuTrigger as Trigger } from './ContextMenuTrigger';
|
9
|
+
import { ContextMenuRadioGroup as RadioGroup } from './ContextMenuRadioGroup';
|
10
|
+
import { ContextMenuRadioItem as RadioItem } from './ContextMenuRadioItem';
|
11
|
+
import { ContextMenuSeparator as Separator } from './ContextMenuSeparator';
|
12
|
+
import { ContextMenuSubTrigger as SubTrigger } from './ContextMenuSubTrigger';
|
13
|
+
import { ContextMenuSubContent as SubContent } from './ContextMenuSubContent';
|
14
|
+
var ContextMenu = {
|
15
|
+
Root: Root,
|
16
|
+
Content: Content,
|
17
|
+
CheckboxItem: CheckboxItem,
|
18
|
+
Group: Group,
|
19
|
+
Item: Item,
|
20
|
+
ItemIndicator: ItemIndicator,
|
21
|
+
Label: Label,
|
22
|
+
Trigger: Trigger,
|
23
|
+
RadioGroup: RadioGroup,
|
24
|
+
RadioItem: RadioItem,
|
25
|
+
Separator: Separator,
|
26
|
+
SubTrigger: SubTrigger,
|
27
|
+
SubContent: SubContent,
|
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 { createContext, forwardRef, useContext, } from 'react';
|
25
|
-
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
26
|
-
export * from './ContextMenuContent';
|
27
|
-
export * from './ContextMenuCheckboxItem';
|
28
|
-
export * from './ContextMenuGroup';
|
29
|
-
export * from './ContextMenuItem';
|
30
|
-
export * from './ContextMenuItemIndicator';
|
31
|
-
export * from './ContextMenuLabel';
|
32
|
-
export * from './ContextMenuTrigger';
|
33
|
-
export * from './ContextMenuRadioGroup';
|
34
|
-
export * from './ContextMenuRadioItem';
|
35
|
-
export * from './ContextMenuSeparator';
|
36
|
-
export * from './ContextMenuSubTrigger';
|
37
|
-
export * from './ContextMenuSubContent';
|
38
|
-
var ContextMenuContext = createContext({
|
39
|
-
radius: 'medium',
|
40
|
-
scaling: '100%',
|
41
|
-
size: 'medium',
|
42
|
-
color: 'red',
|
43
|
-
appearance: 'solid',
|
44
|
-
});
|
45
|
-
export var useContextMenuContext = function () {
|
46
|
-
return useContext(ContextMenuContext);
|
47
|
-
};
|
48
|
-
export var ContextMenu = forwardRef(function (_a, ref) {
|
49
|
-
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"]);
|
50
|
-
var contextValue = { radius: radius, size: size, scaling: scaling, color: color, appearance: appearance };
|
51
|
-
return (_jsx(ContextMenuContext.Provider, { value: contextValue, children: _jsx("div", { ref: ref, children: _jsx(ContextMenuPrimitive.Root, __assign({}, props, { children: children })) }) }));
|
52
|
-
});
|
53
|
-
ContextMenu.displayName = 'ContextMenu';
|
54
29
|
export default ContextMenu;
|
@@ -26,7 +26,7 @@ import { DataList as DataListTheme } from '@radix-ui/themes';
|
|
26
26
|
import { cva } from 'class-variance-authority';
|
27
27
|
import { cn } from '../../../lib/utils/utils';
|
28
28
|
import { scalingVariants } from '../../../lib/constants';
|
29
|
-
import { useDataListContext } from '
|
29
|
+
import { useDataListContext } from './DataListRoot';
|
30
30
|
export var dataListItemVariants = cva('flex', {
|
31
31
|
variants: {
|
32
32
|
scaling: __assign({}, scalingVariants),
|
@@ -40,4 +40,4 @@ export var DataListItem = forwardRef(function (_a, ref) {
|
|
40
40
|
var scaling = useDataListContext().scaling;
|
41
41
|
return (_jsx(DataListTheme.Item, __assign({ ref: ref }, props, { className: cn(dataListItemVariants({ scaling: scaling }), className), children: children })));
|
42
42
|
});
|
43
|
-
DataListItem.displayName = '
|
43
|
+
DataListItem.displayName = 'DataList.Item';
|
@@ -26,7 +26,7 @@ import { DataList as DataListTheme } from '@radix-ui/themes';
|
|
26
26
|
import { cva } from 'class-variance-authority';
|
27
27
|
import { cn } from '../../../lib/utils/utils';
|
28
28
|
import { weightVariants } from '../../../lib/constants';
|
29
|
-
import { useDataListContext } from '
|
29
|
+
import { useDataListContext } from './DataListRoot';
|
30
30
|
export var dataListLabelVariants = cva('text-slateA-11 dark:text-slateDarkA-11 w-[120px] mb-1', {
|
31
31
|
variants: {
|
32
32
|
size: {
|
@@ -46,4 +46,4 @@ export var DataListLabel = forwardRef(function (_a, ref) {
|
|
46
46
|
var size = useDataListContext().size;
|
47
47
|
return (_jsx(DataListTheme.Label, __assign({ ref: ref }, props, { children: _jsx("p", { className: cn(dataListLabelVariants({ weight: weight, size: size }), className), children: children }) })));
|
48
48
|
});
|
49
|
-
DataListLabel.displayName = '
|
49
|
+
DataListLabel.displayName = 'DataList.Label';
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { DataList as DataListTheme } from '@radix-ui/themes';
|
3
|
+
import { dataListValueVariants } from './DataListValue';
|
4
|
+
import { dataListItemVariants } from './DataListItem';
|
5
|
+
import { VariantProps } from 'class-variance-authority';
|
6
|
+
export interface DataListProps extends VariantProps<typeof dataListVariants>, VariantProps<typeof dataListItemVariants>, VariantProps<typeof dataListValueVariants> {
|
7
|
+
orientation?: 'horizontal' | 'vertical';
|
8
|
+
}
|
9
|
+
export declare const dataListVariants: (props?: ({
|
10
|
+
size?: "small" | "medium" | "large" | null | undefined;
|
11
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
12
|
+
export declare const useDataListContext: () => DataListProps;
|
13
|
+
export declare const DataListRoot: React.ForwardRefExoticComponent<Omit<DataListTheme.RootProps & React.RefAttributes<HTMLDListElement>, "ref"> & DataListProps & React.RefAttributes<HTMLDListElement>>;
|
14
|
+
export default DataListRoot;
|
@@ -0,0 +1,54 @@
|
|
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, useMemo, } 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 var dataListVariants = cva('flex flex-col', {
|
29
|
+
variants: {
|
30
|
+
size: {
|
31
|
+
small: 'space-y-3',
|
32
|
+
medium: 'space-y-4',
|
33
|
+
large: 'space-y-5',
|
34
|
+
},
|
35
|
+
},
|
36
|
+
defaultVariants: {
|
37
|
+
size: 'medium',
|
38
|
+
},
|
39
|
+
});
|
40
|
+
var DataListContext = createContext({
|
41
|
+
size: 'medium',
|
42
|
+
scaling: '100%',
|
43
|
+
color: 'black',
|
44
|
+
});
|
45
|
+
export var useDataListContext = function () {
|
46
|
+
return useContext(DataListContext);
|
47
|
+
};
|
48
|
+
export var DataListRoot = forwardRef(function (_a, ref) {
|
49
|
+
var children = _a.children, className = _a.className, size = _a.size, scaling = _a.scaling, color = _a.color, props = __rest(_a, ["children", "className", "size", "scaling", "color"]);
|
50
|
+
var contextValue = useMemo(function () { return ({ size: size, scaling: scaling, color: color }); }, [size, scaling, color]);
|
51
|
+
return (_jsx(DataListContext.Provider, { value: contextValue, children: _jsx(DataListTheme.Root, __assign({ ref: ref }, props, { className: cn(dataListVariants({ size: size }), className), children: children })) }));
|
52
|
+
});
|
53
|
+
DataListRoot.displayName = 'DataList.Root';
|
54
|
+
export default DataListRoot;
|
@@ -26,7 +26,7 @@ import { DataList as DataListTheme } from '@radix-ui/themes';
|
|
26
26
|
import { textColorStyle, weightVariants } from '../../../lib/constants';
|
27
27
|
import { cva } from 'class-variance-authority';
|
28
28
|
import { cn } from '../../../lib/utils/utils';
|
29
|
-
import { useDataListContext } from '
|
29
|
+
import { useDataListContext } from './DataListRoot';
|
30
30
|
export var dataListValueVariants = cva('text-slate-12 dark:text-slateDark-12 w-[200px]', {
|
31
31
|
variants: {
|
32
32
|
size: {
|
@@ -48,4 +48,4 @@ export var DataListValue = forwardRef(function (_a, ref) {
|
|
48
48
|
var _b = useDataListContext(), size = _b.size, color = _b.color;
|
49
49
|
return (_jsx(DataListTheme.Value, __assign({ ref: ref, className: cn(dataListValueVariants({ weight: weight, size: size, color: color }), className) }, props, { children: children })));
|
50
50
|
});
|
51
|
-
DataListValue.displayName = '
|
51
|
+
DataListValue.displayName = 'DataList.Value';
|
@@ -1,17 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
|
7
|
-
|
8
|
-
export * from './DataListValue';
|
9
|
-
export interface DataListProps extends VariantProps<typeof dataListVariants>, VariantProps<typeof dataListItemVariants>, VariantProps<typeof dataListValueVariants> {
|
10
|
-
orientation?: 'horizontal' | 'vertical';
|
11
|
-
}
|
12
|
-
export declare const dataListVariants: (props?: ({
|
13
|
-
size?: "small" | "medium" | "large" | null | undefined;
|
14
|
-
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
15
|
-
export declare const useDataListContext: () => DataListProps;
|
16
|
-
export declare const DataList: React.ForwardRefExoticComponent<Omit<DataListTheme.RootProps & React.RefAttributes<HTMLDListElement>, "ref"> & DataListProps & React.RefAttributes<HTMLDListElement>>;
|
1
|
+
/// <reference types="react" />
|
2
|
+
declare const DataList: {
|
3
|
+
Root: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/data-list").RootProps & import("react").RefAttributes<HTMLDListElement>, "ref"> & import("./DataListRoot").DataListProps & import("react").RefAttributes<HTMLDListElement>>;
|
4
|
+
Item: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/data-list").ItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./DataListItem").DataListItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
5
|
+
Label: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/data-list").LabelProps & import("react").RefAttributes<HTMLElement>, "ref"> & import("./DataListLabel").DataListLabelProps & import("react").RefAttributes<HTMLElement>>;
|
6
|
+
Value: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/data-list").ValueProps & import("react").RefAttributes<HTMLElement>, "ref"> & import("./DataListValue").DataListValueProps & import("react").RefAttributes<HTMLElement>>;
|
7
|
+
};
|
17
8
|
export default DataList;
|