@lotte-innovate/ui-component-test 0.1.18 → 0.1.19
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
@@ -21,10 +21,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
21
21
|
return t;
|
22
22
|
};
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
-
import { forwardRef } from 'react';
|
24
|
+
import { forwardRef, useContext } from 'react';
|
25
25
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
26
26
|
import { cva } from 'class-variance-authority';
|
27
|
-
import {
|
27
|
+
import { DropdownMenuContext } from './DropdownMenuRoot';
|
28
28
|
import { cn } from '../../../lib/utils/utils';
|
29
29
|
export var dropdownMenuLabelVariants = cva("flex relative leading-none select-none outline-none items-center font-normal text-slateA-11 dark:text-slateDarkA-11", {
|
30
30
|
variants: {
|
@@ -32,15 +32,14 @@ export var dropdownMenuLabelVariants = cva("flex relative leading-none select-no
|
|
32
32
|
small: 'text-xs h-[24px] w-[120px] px-2',
|
33
33
|
medium: 'text-sm h-[32px] w-[136px] px-3',
|
34
34
|
},
|
35
|
-
scaling: __assign({}, scalingVariants),
|
36
35
|
},
|
37
36
|
defaultVariants: {
|
38
|
-
scaling: '100%',
|
39
37
|
size: 'medium',
|
40
38
|
},
|
41
39
|
});
|
42
40
|
export var DropdownMenuLabel = forwardRef(function (_a, ref) {
|
43
|
-
var className = _a.className, children = _a.children,
|
41
|
+
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
42
|
+
var size = useContext(DropdownMenuContext).size;
|
44
43
|
return (_jsx(DropdownMenuPrimitive.Label, __assign({ ref: ref, className: cn(dropdownMenuLabelVariants({ size: size }), className) }, props, { children: children })));
|
45
44
|
});
|
46
|
-
DropdownMenuLabel.displayName = '
|
45
|
+
DropdownMenuLabel.displayName = 'DropdownMenu.Label';
|
@@ -1,4 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
3
|
-
|
4
|
-
|
3
|
+
export interface DropdownMenuRadioItemProps {
|
4
|
+
selectedValue?: string;
|
5
|
+
}
|
6
|
+
export declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
|
@@ -22,18 +22,20 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
22
22
|
};
|
23
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
24
24
|
import { forwardRef, useContext } from 'react';
|
25
|
-
import
|
26
|
-
import {
|
25
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
26
|
+
import { DropdownMenuItemIndicator } from './DropdownMenuItemIndicator';
|
27
|
+
import { dropdownMenuItemVariants } from './DropdownMenuItem';
|
27
28
|
import { menuItemAppearanceStyle } from '../../../lib/constants';
|
28
29
|
import { DotFilledIcon } from '@radix-ui/react-icons';
|
30
|
+
import { DropdownMenuContext } from './DropdownMenuRoot';
|
29
31
|
import { cn } from '../../../lib/utils/utils';
|
30
32
|
export var DropdownMenuRadioItem = forwardRef(function (_a, ref) {
|
31
|
-
var className = _a.className, children = _a.children,
|
32
|
-
var
|
33
|
+
var className = _a.className, children = _a.children, selectedValue = _a.selectedValue, props = __rest(_a, ["className", "children", "selectedValue"]);
|
34
|
+
var _b = useContext(DropdownMenuContext), radius = _b.radius, size = _b.size, _c = _b.color, color = _c === void 0 ? 'red' : _c, _d = _b.appearance, appearance = _d === void 0 ? 'solid' : _d;
|
33
35
|
var itemClassName = cn(dropdownMenuItemVariants({
|
34
36
|
radius: radius,
|
35
37
|
size: size,
|
36
38
|
}), 'pl-7', menuItemAppearanceStyle(appearance, color), className);
|
37
|
-
return (_jsxs(
|
39
|
+
return (_jsxs(DropdownMenuPrimitive.RadioItem, __assign({ ref: ref, className: itemClassName }, props, { children: [_jsx(DropdownMenuItemIndicator, { forceMount: true, radius: 'full', size: size, children: selectedValue === props.value && _jsx(DotFilledIcon, {}) }), children] })));
|
38
40
|
});
|
39
|
-
DropdownMenuRadioItem.displayName = '
|
41
|
+
DropdownMenuRadioItem.displayName = 'DropdownMenu.RadioItem';
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
4
|
+
import { dropdownMenuContentVariants } from './DropdownMenuContent';
|
5
|
+
import { dropdownMenuItemVariants } from './DropdownMenuItem';
|
6
|
+
import { IColor } from '../../../lib/types';
|
7
|
+
export interface DropdownMenuProps extends VariantProps<typeof dropdownMenuContentVariants>, VariantProps<typeof dropdownMenuItemVariants> {
|
8
|
+
color?: IColor;
|
9
|
+
appearance?: 'solid' | 'soft';
|
10
|
+
}
|
11
|
+
export declare const DropdownMenuContext: React.Context<DropdownMenuProps>;
|
12
|
+
export declare const DropdownMenuRoot: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuProps & DropdownMenuProps & React.RefAttributes<never>>;
|
@@ -0,0 +1,38 @@
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
2
|
+
__assign = Object.assign || function(t) {
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
+
s = arguments[i];
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
+
t[p] = s[p];
|
7
|
+
}
|
8
|
+
return t;
|
9
|
+
};
|
10
|
+
return __assign.apply(this, arguments);
|
11
|
+
};
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
+
var t = {};
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
+
t[p] = s[p];
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
+
t[p[i]] = s[p[i]];
|
20
|
+
}
|
21
|
+
return t;
|
22
|
+
};
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
+
import { forwardRef, createContext } from 'react';
|
25
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
26
|
+
export var DropdownMenuContext = createContext({
|
27
|
+
radius: 'medium',
|
28
|
+
size: 'medium',
|
29
|
+
scaling: '100%',
|
30
|
+
color: 'red',
|
31
|
+
appearance: 'solid',
|
32
|
+
});
|
33
|
+
export var DropdownMenuRoot = forwardRef(function (_a, ref) {
|
34
|
+
var children = _a.children, radius = _a.radius, size = _a.size, scaling = _a.scaling, color = _a.color, appearance = _a.appearance, props = __rest(_a, ["children", "radius", "size", "scaling", "color", "appearance"]);
|
35
|
+
var contextValue = { radius: radius, size: size, scaling: scaling, color: color, appearance: appearance };
|
36
|
+
return (_jsx(DropdownMenuContext.Provider, { value: contextValue, children: _jsx(DropdownMenuPrimitive.Root, __assign({}, props, { children: children })) }));
|
37
|
+
});
|
38
|
+
DropdownMenuRoot.displayName = 'DropdownMenu.Root';
|
@@ -28,4 +28,4 @@ export var DropdownMenuSeparator = forwardRef(function (_a, ref) {
|
|
28
28
|
var className = _a.className, children = _a.children, color = _a.color, props = __rest(_a, ["className", "children", "color"]);
|
29
29
|
return (_jsx(DropdownMenuPrimitive.Separator, __assign({ ref: ref, className: cn('h-[1px] m-[5px] bg-slate-6 dark:bg-slateDark-6', className) }, props)));
|
30
30
|
});
|
31
|
-
DropdownMenuSeparator.displayName = '
|
31
|
+
DropdownMenuSeparator.displayName = 'DropdownMenu.Separator';
|
@@ -27,4 +27,4 @@ export var DropdownMenuSub = forwardRef(function (_a, ref) {
|
|
27
27
|
var children = _a.children, props = __rest(_a, ["children"]);
|
28
28
|
return _jsx(DropdownMenuPrimitive.Sub, __assign({}, props, { children: children }));
|
29
29
|
});
|
30
|
-
DropdownMenuSub.displayName = '
|
30
|
+
DropdownMenuSub.displayName = 'DropdownMenu.Sub';
|
@@ -21,18 +21,20 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
21
21
|
return t;
|
22
22
|
};
|
23
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
24
|
-
import { forwardRef } from 'react';
|
24
|
+
import { forwardRef, useContext } from 'react';
|
25
25
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
26
26
|
import { dropdownMenuItemVariants } from './DropdownMenuItem';
|
27
27
|
import { ChevronRightIcon } from '@radix-ui/react-icons';
|
28
28
|
import { blackText, menuItemAppearanceStyle } from '../../../lib/constants';
|
29
|
+
import { DropdownMenuContext } from './DropdownMenuRoot';
|
29
30
|
import { cn } from '../../../lib/utils/utils';
|
30
31
|
export var DropdownMenuSubTrigger = forwardRef(function (_a, ref) {
|
31
|
-
var className = _a.className, children = _a.children,
|
32
|
+
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
33
|
+
var _b = useContext(DropdownMenuContext), size = _b.size, radius = _b.radius, _c = _b.color, color = _c === void 0 ? 'red' : _c, _d = _b.appearance, appearance = _d === void 0 ? 'solid' : _d;
|
32
34
|
var iconClassName = cn('group-data-[disabled]:text-slate-8 ', appearance === 'solid' && blackText.includes(color)
|
33
35
|
? 'hover:fill-slate-12 dark:hover:fill-slateDark-1'
|
34
36
|
: "hover:fill-white dark:hover:fill-slateDark-12 ");
|
35
37
|
var triggerClassName = cn(dropdownMenuItemVariants({ size: size, radius: radius }), menuItemAppearanceStyle(appearance, color), className);
|
36
38
|
return (_jsxs(DropdownMenuPrimitive.SubTrigger, __assign({ ref: ref, className: triggerClassName }, props, { children: [children, _jsx("div", { className: "ml-auto pl-5 ", children: _jsx(ChevronRightIcon, { className: iconClassName }) })] })));
|
37
39
|
});
|
38
|
-
DropdownMenuSubTrigger.displayName = '
|
40
|
+
DropdownMenuSubTrigger.displayName = 'DropdownMenu.SubTrigger';
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
3
3
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
4
|
+
import { IColor } from '../../../lib/types';
|
4
5
|
export interface DropdownMenuTriggerProps extends VariantProps<typeof dropdownMenuTriggerVariants> {
|
5
|
-
color?:
|
6
|
+
color?: IColor;
|
6
7
|
appearance?: 'classic' | 'surface';
|
7
8
|
}
|
8
9
|
declare const dropdownMenuTriggerVariants: (props?: ({
|
@@ -21,9 +21,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
21
21
|
return t;
|
22
22
|
};
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
-
import { forwardRef } from 'react';
|
24
|
+
import { forwardRef, useContext } from 'react';
|
25
25
|
import { cva } from 'class-variance-authority';
|
26
26
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
27
|
+
import { DropdownMenuContext } from './DropdownMenuRoot';
|
27
28
|
import { cn } from '../../../lib/utils/utils';
|
28
29
|
var dropdownMenuTriggerVariants = cva('', {
|
29
30
|
variants: {
|
@@ -45,7 +46,8 @@ var dropdownMenuTriggerVariants = cva('', {
|
|
45
46
|
},
|
46
47
|
});
|
47
48
|
export var DropdownMenuTrigger = forwardRef(function (_a, ref) {
|
48
|
-
var className = _a.className, children = _a.children,
|
49
|
+
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
50
|
+
var _b = useContext(DropdownMenuContext), radius = _b.radius, size = _b.size;
|
49
51
|
return (_jsx(DropdownMenuPrimitive.Trigger, __assign({ asChild: true, ref: ref, className: cn(dropdownMenuTriggerVariants({ radius: radius, size: size }), className) }, props, { children: children })));
|
50
52
|
});
|
51
|
-
DropdownMenuTrigger.displayName = '
|
53
|
+
DropdownMenuTrigger.displayName = 'DropdownMenu.Trigger';
|
@@ -1,23 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
export * from './DropdownMenuRadioItem';
|
18
|
-
export interface DropdownMenuProps extends VariantProps<typeof dropdownMenuContentVariants>, VariantProps<typeof dropdownMenuItemVariants> {
|
19
|
-
color?: any;
|
20
|
-
appearance?: 'solid' | 'soft';
|
21
|
-
}
|
22
|
-
export declare const DropdownMenu: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuProps & DropdownMenuProps & React.RefAttributes<never>>;
|
1
|
+
/// <reference types="react" />
|
2
|
+
declare const DropdownMenu: {
|
3
|
+
Root: import("react").ForwardRefExoticComponent<import("@radix-ui/react-dropdown-menu").DropdownMenuProps & import("./DropdownMenuRoot").DropdownMenuProps & import("react").RefAttributes<never>>;
|
4
|
+
Trigger: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("./DropdownMenuTrigger").DropdownMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
5
|
+
Content: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./DropdownMenuContent").DropdownMenuContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
6
|
+
Label: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuLabelProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./DropdownMenuLable").DropdownMenuLabelProps & import("react").RefAttributes<HTMLDivElement>>;
|
7
|
+
Item: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./DropdownMenuItem").DropdownMenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
8
|
+
Separator: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuSeparatorProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
9
|
+
CheckboxItem: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuCheckboxItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./DropdownMenuItem").DropdownMenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
10
|
+
RadioGroup: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuRadioGroupProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
11
|
+
RadioItem: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuRadioItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./DropdownMenuRadioItem").DropdownMenuRadioItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
12
|
+
Sub: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuLabelProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<never>>;
|
13
|
+
SubTrigger: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuSubTriggerProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./DropdownMenuItem").DropdownMenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
14
|
+
SubContent: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuSubContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./DropdonMenuSubContent").DropdownMenuSubContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
15
|
+
ItemIndicator: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-dropdown-menu").DropdownMenuItemIndicatorProps & import("react").RefAttributes<HTMLSpanElement>, "ref"> & import("./DropdownMenuItemIndicator").DropdownMenuItemIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>;
|
16
|
+
};
|
23
17
|
export default DropdownMenu;
|
@@ -1,43 +1,29 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
import { DropdownMenuRoot } from './DropdownMenuRoot';
|
2
|
+
import { DropdownMenuTrigger } from './DropdownMenuTrigger';
|
3
|
+
import { DropdownMenuContent } from './DropdownMenuContent';
|
4
|
+
import { DropdownMenuLabel } from './DropdownMenuLable';
|
5
|
+
import { DropdownMenuItem } from './DropdownMenuItem';
|
6
|
+
import { DropdownMenuSeparator } from './DropdownMenuSeparator';
|
7
|
+
import { DropdownMenuCheckboxItem } from './DropdownMenuCheckboxItem';
|
8
|
+
import { DropdownMenuRadioGroup } from './DropdonMenuRadioGroup';
|
9
|
+
import { DropdownMenuRadioItem } from './DropdownMenuRadioItem';
|
10
|
+
import { DropdownMenuSub } from './DropdownMenuSub';
|
11
|
+
import { DropdownMenuSubTrigger } from './DropdownMenuSubTrigger';
|
12
|
+
import { DropdownMenuSubContent } from './DropdonMenuSubContent';
|
13
|
+
import { DropdownMenuItemIndicator } from './DropdownMenuItemIndicator';
|
14
|
+
var DropdownMenu = {
|
15
|
+
Root: DropdownMenuRoot,
|
16
|
+
Trigger: DropdownMenuTrigger,
|
17
|
+
Content: DropdownMenuContent,
|
18
|
+
Label: DropdownMenuLabel,
|
19
|
+
Item: DropdownMenuItem,
|
20
|
+
Separator: DropdownMenuSeparator,
|
21
|
+
CheckboxItem: DropdownMenuCheckboxItem,
|
22
|
+
RadioGroup: DropdownMenuRadioGroup,
|
23
|
+
RadioItem: DropdownMenuRadioItem,
|
24
|
+
Sub: DropdownMenuSub,
|
25
|
+
SubTrigger: DropdownMenuSubTrigger,
|
26
|
+
SubContent: DropdownMenuSubContent,
|
27
|
+
ItemIndicator: DropdownMenuItemIndicator,
|
11
28
|
};
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
-
var t = {};
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
-
t[p] = s[p];
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
-
t[p[i]] = s[p[i]];
|
20
|
-
}
|
21
|
-
return t;
|
22
|
-
};
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
-
import { forwardRef } from 'react';
|
25
|
-
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
26
|
-
export * from './DropdownMenuTrigger';
|
27
|
-
export * from './DropdownMenuContent';
|
28
|
-
export * from './DropdonMenuSubContent';
|
29
|
-
export * from './DropdownMenuSubTrigger';
|
30
|
-
export * from './DropdownMenuItem';
|
31
|
-
export * from './DropdownMenuSeparator';
|
32
|
-
export * from './DropdownMenuLable';
|
33
|
-
export * from './DropdownMenuSub';
|
34
|
-
export * from './DropdownMenuCheckboxItem';
|
35
|
-
export * from './DropdownMenuItemIndicator';
|
36
|
-
export * from './DropdonMenuRadioGroup';
|
37
|
-
export * from './DropdownMenuRadioItem';
|
38
|
-
export var DropdownMenu = forwardRef(function (_a, ref) {
|
39
|
-
var children = _a.children, props = __rest(_a, ["children"]);
|
40
|
-
return (_jsx(DropdownMenuPrimitive.Root, __assign({}, props, { children: children })));
|
41
|
-
});
|
42
|
-
DropdownMenu.displayName = 'DropdownMenu';
|
43
29
|
export default DropdownMenu;
|
@@ -21,10 +21,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
21
21
|
return t;
|
22
22
|
};
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
-
import { forwardRef } from 'react';
|
24
|
+
import { forwardRef, useContext } from 'react';
|
25
25
|
import { primaryColorStyle, radiusVariants, weightVariants, scalingVariants } from '../../../lib/constants';
|
26
26
|
import { cva } from 'class-variance-authority';
|
27
27
|
import { HoverCard as HoverCardTheme } from '@radix-ui/themes';
|
28
|
+
import { HoverCardContext } from './HoverCardRoot';
|
28
29
|
import { cn } from '../../../lib/utils/utils';
|
29
30
|
export var hoverCardContentVariants = cva('', {
|
30
31
|
variants: {
|
@@ -48,7 +49,8 @@ export var hoverCardContentVariants = cva('', {
|
|
48
49
|
},
|
49
50
|
});
|
50
51
|
export var HoverCardContent = forwardRef(function (_a, ref) {
|
51
|
-
var className = _a.className,
|
52
|
+
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
53
|
+
var _b = useContext(HoverCardContext), radius = _b.radius, size = _b.size, scaling = _b.scaling, weight = _b.weight, color = _b.color;
|
52
54
|
var sizeTheme = '2';
|
53
55
|
if (size === 'small')
|
54
56
|
sizeTheme = '1';
|
@@ -56,4 +58,4 @@ export var HoverCardContent = forwardRef(function (_a, ref) {
|
|
56
58
|
sizeTheme = '3';
|
57
59
|
return (_jsx(HoverCardTheme.Content, __assign({ ref: ref }, props, { size: sizeTheme, className: cn(hoverCardContentVariants({ size: size, scaling: scaling, weight: weight, radius: radius, color: color }), size === 'x-large' && 'rt-r-size-4', className), children: children })));
|
58
60
|
});
|
59
|
-
HoverCardContent.displayName = '
|
61
|
+
HoverCardContent.displayName = 'HoverCard.Content';
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { HoverCard as HoverCardTheme } from '@radix-ui/themes';
|
3
|
+
import { hoverCardContentVariants } from './HoverCardContent';
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
5
|
+
export interface HoverCardProps extends VariantProps<typeof hoverCardContentVariants> {
|
6
|
+
}
|
7
|
+
export declare const HoverCardContext: React.Context<HoverCardProps>;
|
8
|
+
export declare const HoverCardRoot: React.ForwardRefExoticComponent<HoverCardTheme.RootProps & HoverCardProps & React.RefAttributes<never>>;
|
@@ -0,0 +1,38 @@
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
2
|
+
__assign = Object.assign || function(t) {
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
+
s = arguments[i];
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
+
t[p] = s[p];
|
7
|
+
}
|
8
|
+
return t;
|
9
|
+
};
|
10
|
+
return __assign.apply(this, arguments);
|
11
|
+
};
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
+
var t = {};
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
+
t[p] = s[p];
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
+
t[p[i]] = s[p[i]];
|
20
|
+
}
|
21
|
+
return t;
|
22
|
+
};
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
+
import { forwardRef, createContext } from 'react';
|
25
|
+
import { HoverCard as HoverCardTheme, Theme } from '@radix-ui/themes';
|
26
|
+
export var HoverCardContext = createContext({
|
27
|
+
radius: 'medium',
|
28
|
+
size: 'medium',
|
29
|
+
scaling: '100%',
|
30
|
+
weight: 'medium',
|
31
|
+
color: 'red',
|
32
|
+
});
|
33
|
+
export var HoverCardRoot = forwardRef(function (_a, ref) {
|
34
|
+
var children = _a.children, radius = _a.radius, size = _a.size, scaling = _a.scaling, weight = _a.weight, color = _a.color, props = __rest(_a, ["children", "radius", "size", "scaling", "weight", "color"]);
|
35
|
+
var contextValue = { radius: radius, size: size, scaling: scaling, weight: weight, color: color };
|
36
|
+
return (_jsx(Theme, { children: _jsx(HoverCardContext.Provider, { value: contextValue, children: _jsx(HoverCardTheme.Root, __assign({}, props, { children: children })) }) }));
|
37
|
+
});
|
38
|
+
HoverCardRoot.displayName = 'HoverCard.Root';
|
@@ -27,4 +27,4 @@ export var HoverCardTrigger = forwardRef(function (_a, ref) {
|
|
27
27
|
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
28
28
|
return (_jsx(HoverCardTheme.Trigger, __assign({ ref: ref, className: className }, props, { children: children })));
|
29
29
|
});
|
30
|
-
HoverCardTrigger.displayName = '
|
30
|
+
HoverCardTrigger.displayName = 'HoverCard.Trigger';
|
@@ -1,10 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import
|
4
|
-
import
|
5
|
-
|
6
|
-
|
7
|
-
export interface HoverCardProps extends VariantProps<typeof hoverCardContentVariants> {
|
8
|
-
}
|
9
|
-
export declare const HoverCard: React.ForwardRefExoticComponent<HoverCardTheme.RootProps & HoverCardProps & React.RefAttributes<never>>;
|
1
|
+
/// <reference types="react" />
|
2
|
+
declare const HoverCard: {
|
3
|
+
Root: import("react").ForwardRefExoticComponent<import("@radix-ui/themes/dist/cjs/components/hover-card").RootProps & import("./HoverCardRoot").HoverCardProps & import("react").RefAttributes<never>>;
|
4
|
+
Trigger: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/hover-card").TriggerProps & import("react").RefAttributes<HTMLAnchorElement>, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
|
5
|
+
Content: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/hover-card").ContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./HoverCardContent").HoverCardContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
6
|
+
};
|
10
7
|
export default HoverCard;
|
@@ -1,33 +1,9 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
return t;
|
9
|
-
};
|
10
|
-
return __assign.apply(this, arguments);
|
1
|
+
import { HoverCardRoot } from './HoverCardRoot';
|
2
|
+
import { HoverCardTrigger } from './HoverCardTrigger';
|
3
|
+
import { HoverCardContent } from './HoverCardContent';
|
4
|
+
var HoverCard = {
|
5
|
+
Root: HoverCardRoot,
|
6
|
+
Trigger: HoverCardTrigger,
|
7
|
+
Content: HoverCardContent,
|
11
8
|
};
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
13
|
-
var t = {};
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
15
|
-
t[p] = s[p];
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
19
|
-
t[p[i]] = s[p[i]];
|
20
|
-
}
|
21
|
-
return t;
|
22
|
-
};
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
24
|
-
import { forwardRef } from 'react';
|
25
|
-
import { HoverCard as HoverCardTheme, Theme } from '@radix-ui/themes';
|
26
|
-
export * from './HoverCardTrigger';
|
27
|
-
export * from './HoverCardContent';
|
28
|
-
export var HoverCard = forwardRef(function (_a, ref) {
|
29
|
-
var children = _a.children, props = __rest(_a, ["children"]);
|
30
|
-
return (_jsx(Theme, { children: _jsx(HoverCardTheme.Root, __assign({}, props, { children: children })) }));
|
31
|
-
});
|
32
|
-
HoverCard.displayName = 'HoverCard';
|
33
9
|
export default HoverCard;
|
@@ -0,0 +1,87 @@
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
2
|
+
import { PointStyle } from '../../../lib/types';
|
3
|
+
export interface BorderRadius {
|
4
|
+
topLeft: number;
|
5
|
+
topRight: number;
|
6
|
+
bottomLeft: number;
|
7
|
+
bottomRight: number;
|
8
|
+
}
|
9
|
+
export interface LineChartProps extends VariantProps<typeof lineChartVariants> {
|
10
|
+
labels?: string[];
|
11
|
+
isColorMixed?: boolean;
|
12
|
+
appearance?: 'solid' | 'soft';
|
13
|
+
title?: {
|
14
|
+
text?: string | string[];
|
15
|
+
display?: boolean;
|
16
|
+
position?: 'top' | 'right' | 'bottom' | 'left';
|
17
|
+
align?: 'start' | 'center' | 'end';
|
18
|
+
font?: {
|
19
|
+
size?: number;
|
20
|
+
weight?: 'normal' | 'bold' | 'lighter' | 'bolder' | number;
|
21
|
+
lineHeight?: number;
|
22
|
+
};
|
23
|
+
};
|
24
|
+
legend?: {
|
25
|
+
display?: boolean;
|
26
|
+
align?: 'start' | 'center' | 'end';
|
27
|
+
position?: 'top' | 'right' | 'bottom' | 'left';
|
28
|
+
maxHeight?: number;
|
29
|
+
maxWidth?: number;
|
30
|
+
fullSize?: boolean;
|
31
|
+
reverse?: boolean;
|
32
|
+
labels?: {
|
33
|
+
boxWidth?: number;
|
34
|
+
boxHeight?: number;
|
35
|
+
padding?: number;
|
36
|
+
textAlign?: 'left' | 'right' | 'center';
|
37
|
+
color?: string;
|
38
|
+
usePointStyle?: boolean;
|
39
|
+
pointStyleWidth?: number;
|
40
|
+
useBorderRadius?: boolean;
|
41
|
+
borderRadius?: number;
|
42
|
+
};
|
43
|
+
rtl?: boolean;
|
44
|
+
textDirection?: 'rtl' | 'ltr';
|
45
|
+
title?: {
|
46
|
+
color?: string;
|
47
|
+
display?: boolean;
|
48
|
+
padding?: number;
|
49
|
+
text?: string;
|
50
|
+
};
|
51
|
+
};
|
52
|
+
datasets: {
|
53
|
+
label: string;
|
54
|
+
data: any;
|
55
|
+
backgroundColor?: string | string[];
|
56
|
+
borderColor?: string | string[];
|
57
|
+
borderWidth?: number;
|
58
|
+
hoverBackgroundColor?: string;
|
59
|
+
hoverBorderColor?: string;
|
60
|
+
hoverBorderWidth?: number;
|
61
|
+
pointStyle?: PointStyle;
|
62
|
+
barThickness?: number;
|
63
|
+
barPercentage?: number;
|
64
|
+
}[];
|
65
|
+
scales?: {
|
66
|
+
x?: {
|
67
|
+
min?: number;
|
68
|
+
max?: number;
|
69
|
+
};
|
70
|
+
y?: {
|
71
|
+
min?: number;
|
72
|
+
max?: number;
|
73
|
+
};
|
74
|
+
};
|
75
|
+
indexAxis?: 'x' | 'y';
|
76
|
+
className?: string;
|
77
|
+
width?: string | number;
|
78
|
+
height?: string | number;
|
79
|
+
}
|
80
|
+
declare const lineChartVariants: (props?: ({
|
81
|
+
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
82
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
83
|
+
export declare const LineChart: {
|
84
|
+
({ className, title, datasets, labels, scaling, legend, width, height, indexAxis, appearance, scales, isColorMixed, ...props }: LineChartProps): import("react/jsx-runtime").JSX.Element;
|
85
|
+
displayName: string;
|
86
|
+
};
|
87
|
+
export {};
|
@@ -0,0 +1,58 @@
|
|
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 { Line } from 'react-chartjs-2';
|
25
|
+
import { Chart as ChartJS, CategoryScale, LinearScale, Tooltip, Legend, LineElement, PointElement, } from 'chart.js/auto';
|
26
|
+
import { scalingVariants } from '../../../lib/constants';
|
27
|
+
import { cva } from 'class-variance-authority';
|
28
|
+
import { cn } from '../../../lib/utils/utils';
|
29
|
+
import { chartAlphaColorList, chartColorList } from '../../../lib/color/constants';
|
30
|
+
ChartJS.register(CategoryScale, LinearScale, LineElement, PointElement, Tooltip, Legend);
|
31
|
+
var lineChartVariants = cva('', {
|
32
|
+
variants: {
|
33
|
+
scaling: __assign({}, scalingVariants),
|
34
|
+
},
|
35
|
+
defaultVariants: {
|
36
|
+
scaling: '100%',
|
37
|
+
},
|
38
|
+
});
|
39
|
+
export var LineChart = function (_a) {
|
40
|
+
var className = _a.className, title = _a.title, datasets = _a.datasets, labels = _a.labels, scaling = _a.scaling, legend = _a.legend, width = _a.width, height = _a.height, indexAxis = _a.indexAxis, _b = _a.appearance, appearance = _b === void 0 ? 'solid' : _b, scales = _a.scales, _c = _a.isColorMixed, isColorMixed = _c === void 0 ? true : _c, props = __rest(_a, ["className", "title", "datasets", "labels", "scaling", "legend", "width", "height", "indexAxis", "appearance", "scales", "isColorMixed"]);
|
41
|
+
var colorset = isColorMixed ? chartColorList.mixed : chartColorList.sorting;
|
42
|
+
var colorAlphaset = isColorMixed ? chartAlphaColorList.mixed : chartAlphaColorList.sorting;
|
43
|
+
datasets.forEach(function (dataset, index) {
|
44
|
+
var _a, _b;
|
45
|
+
datasets[index] = __assign(__assign({}, dataset), { borderColor: (_a = dataset.borderColor) !== null && _a !== void 0 ? _a : colorset[index % colorset.length], backgroundColor: ((_b = dataset.backgroundColor) !== null && _b !== void 0 ? _b : appearance == 'solid')
|
46
|
+
? colorset[index % colorset.length]
|
47
|
+
: colorAlphaset[index % colorset.length] });
|
48
|
+
});
|
49
|
+
return (_jsx(Line, __assign({ data: { labels: labels, datasets: datasets }, options: {
|
50
|
+
plugins: {
|
51
|
+
title: title,
|
52
|
+
legend: legend,
|
53
|
+
},
|
54
|
+
indexAxis: indexAxis,
|
55
|
+
scales: scales,
|
56
|
+
}, className: cn(lineChartVariants({ scaling: scaling }), className), width: width, height: height }, props)));
|
57
|
+
};
|
58
|
+
LineChart.displayName = 'LineChart';
|