@lotte-innovate/ui-component-test 0.1.33 → 0.1.35
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +133 -89
- package/dist/globals.css +4 -4
- package/dist/lib/Typography/Text/index.js +1 -1
- package/dist/lib/color/dark.js +1 -1
- package/dist/lib/color/light.js +3 -3
- package/dist/lib/components/AlertDialog/AlertDialogAction.js +5 -5
- package/dist/lib/components/AlertDialog/AlertDialogCancel.js +5 -5
- package/dist/lib/components/AlertDialog/AlertDialogTrigger.js +1 -1
- package/dist/lib/components/Avatar/index.d.ts +1 -0
- package/dist/lib/components/Avatar/index.js +2 -2
- package/dist/lib/components/Badge/index.js +1 -1
- package/dist/lib/components/BarChart/index.d.ts +13 -57
- package/dist/lib/components/BarChart/index.js +3 -0
- package/dist/lib/components/BubbleChart/index.d.ts +15 -22
- package/dist/lib/components/BubbleChart/index.js +34 -15
- package/dist/lib/components/Callout/CalloutIcon.d.ts +2 -1
- package/dist/lib/components/Callout/CalloutRoot.js +4 -4
- package/dist/lib/components/Callout/CalloutText.js +1 -1
- package/dist/lib/components/Callout/index.d.ts +1 -1
- package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.d.ts +2 -1
- package/dist/lib/components/CheckboxGroup/index.d.ts +1 -1
- package/dist/lib/components/DoughnutChart/index.d.ts +12 -15
- package/dist/lib/components/DoughnutChart/index.js +10 -3
- package/dist/lib/components/LineChart/index.d.ts +9 -53
- package/dist/lib/components/LineChart/index.js +3 -1
- package/dist/lib/components/Menubar/MenubarMenu.d.ts +4 -1
- package/dist/lib/components/Menubar/MenubarRoot.js +1 -1
- package/dist/lib/components/Menubar/MenubarTrigger.js +1 -1
- package/dist/lib/components/Menubar/index.d.ts +3 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuContent.js +2 -2
- package/dist/lib/components/NavigationMenu/NavigationMenuIndicator.js +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuList.js +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuRoot.js +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuViewport.js +1 -1
- package/dist/lib/components/PieChart/index.d.ts +12 -15
- package/dist/lib/components/PieChart/index.js +9 -2
- package/dist/lib/components/Progress/index.d.ts +1 -4
- package/dist/lib/components/Progress/index.js +2 -3
- package/dist/lib/components/RadarChart/index.d.ts +19 -26
- package/dist/lib/components/RadarChart/index.js +37 -15
- package/dist/lib/components/Radio/index.d.ts +0 -1
- package/dist/lib/components/Radio/index.js +3 -1
- package/dist/lib/components/RadioCards/RadioCardsItem.js +1 -1
- package/dist/lib/components/RadioCards/RadioCardsRoot.d.ts +0 -1
- package/dist/lib/components/RadioGroup/RadioGroupRoot.d.ts +0 -1
- package/dist/lib/components/Select/index.js +1 -1
- package/dist/lib/components/Toggle/ToggleWithText.d.ts +1 -1
- package/dist/lib/components/Toggle/ToggleWithText.js +1 -0
- package/dist/lib/components/ToggleSwitch/index.js +1 -1
- package/dist/lib/components/Tooltip/index.d.ts +0 -1
- package/dist/lib/components/Tooltip/index.js +3 -4
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/components/index.js +1 -0
- package/dist/lib/constants.d.ts +151 -0
- package/dist/lib/constants.js +111 -4
- package/dist/lib/types.d.ts +70 -0
- package/dist/lib/utils/useDarkMode.d.ts +1 -0
- package/dist/lib/utils/useDarkMode.js +49 -0
- package/dist/tailwind.config.js +2 -5
- package/package.json +131 -131
@@ -27,7 +27,7 @@ import { cva } from 'class-variance-authority';
|
|
27
27
|
import { cn } from '../../../lib/utils/utils';
|
28
28
|
import { appearanceStyle, scalingVariants } from '../../../lib/constants';
|
29
29
|
import { useMenubarContext } from './MenubarRoot';
|
30
|
-
export var menubarTriggerVariants = cva("flex items-center justify-between gap-[2px] outline-none select-none leading-none py-1 px-3 font-medium", {
|
30
|
+
export var menubarTriggerVariants = cva("flex items-center justify-between gap-[2px] outline-none select-none leading-none py-1 px-3 \n font-medium truncate w-fit", {
|
31
31
|
variants: {
|
32
32
|
size: {
|
33
33
|
small: 'text-xs',
|
@@ -1,7 +1,9 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
declare const Menubar: {
|
3
3
|
Root: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-menubar").MenubarProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./MenubarRoot").MenubarProps & import("react").RefAttributes<HTMLDivElement>>;
|
4
|
-
Menu: import("react").ForwardRefExoticComponent<
|
4
|
+
Menu: import("react").ForwardRefExoticComponent<import("@radix-ui/react-menubar").MenubarMenuProps & {
|
5
|
+
__scopeMenubar?: import("@radix-ui/react-context").Scope;
|
6
|
+
} & import("react").RefAttributes<never>>;
|
5
7
|
Trigger: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-menubar").MenubarTriggerProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("./MenubarTrigger").MenubarTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
6
8
|
Content: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-menubar").MenubarContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./MenubarContent").MenubarContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
7
9
|
Item: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-menubar").MenubarItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./MenubarItem").MenubarItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
@@ -27,7 +27,7 @@ import { cn } from '../../../lib/utils/utils';
|
|
27
27
|
import { cva } from 'class-variance-authority';
|
28
28
|
import { radiusVariants } from '../../../lib/constants';
|
29
29
|
import { useNavigationMenuContext } from './NavigationMenuRoot';
|
30
|
-
export var navigationMenuContentVariants = cva("text-slate-12 dark:text-slateDark-12 bg-white dark:bg-slateDark-1 p-2", {
|
30
|
+
export var navigationMenuContentVariants = cva("text-slate-12 dark:text-slateDark-12 bg-white dark:bg-slateDark-1 p-2 cursor-pointer", {
|
31
31
|
variants: {
|
32
32
|
radius: __assign({}, radiusVariants['extra-large']),
|
33
33
|
size: {
|
@@ -43,6 +43,6 @@ export var navigationMenuContentVariants = cva("text-slate-12 dark:text-slateDar
|
|
43
43
|
export var NavigationMenuContent = forwardRef(function (_a, ref) {
|
44
44
|
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
45
45
|
var _b = useNavigationMenuContext(), radius = _b.radius, size = _b.size;
|
46
|
-
return (_jsx(NavigationMenuPrimitive.Content, __assign({ ref: ref, className: cn("
|
46
|
+
return (_jsx(NavigationMenuPrimitive.Content, __assign({ ref: ref, className: cn("data-[motion=from-start]:animate-enterFromLeft data-[motion=from-end]:animate-enterFromRight data-[motion=to-start]:animate-exitToLeft data-[motion=to-end]:animate-exitToRight absolute left-0 top-0 w-full sm:w-auto", navigationMenuContentVariants({ radius: radius, size: size }), className) }, props, { children: children })));
|
47
47
|
});
|
48
48
|
NavigationMenuContent.displayName = 'NavigationMenu.Content';
|
@@ -26,6 +26,6 @@ import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
26
26
|
import { cn } from '../../../lib/utils/utils';
|
27
27
|
export var NavigationMenuIndicator = forwardRef(function (_a, ref) {
|
28
28
|
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
29
|
-
return (_jsxs(NavigationMenuPrimitive.Indicator, __assign({ ref: ref, className: "
|
29
|
+
return (_jsxs(NavigationMenuPrimitive.Indicator, __assign({ ref: ref, className: "data-[state=visible]:animate-fadeIn data-[state=hidden]:animate-fadeOut top-full z-[1] flex h-[10px] items-end justify-center overflow-hidden transition-[width,transform_250ms_ease]" }, props, { children: [_jsx("div", { className: cn("relative top-[70%] h-[10px] w-[10px] rotate-[45deg] rounded-tl-[2px] bg-white shadow shadow-slate-4 dark:bg-slateDark-2 dark:shadow-slateDark-4", className) }), children] })));
|
30
30
|
});
|
31
31
|
NavigationMenuIndicator.displayName = 'NavigationMenu.Indicator';
|
@@ -28,7 +28,7 @@ import { cva } from 'class-variance-authority';
|
|
28
28
|
import { appearanceStyle, radiusVariants, scalingVariants } from '../../../lib/constants';
|
29
29
|
import { NavigationMenuIndicator } from './NavigationMenuIndicator';
|
30
30
|
import { useNavigationMenuContext } from './NavigationMenuRoot';
|
31
|
-
export var navigationMenuListVariants = cva('flex
|
31
|
+
export var navigationMenuListVariants = cva('flex p-1 space-x-1 shadow-slate-4 shadow dark:shadow-slateDark-4 bg-white dark:bg-slateDark-1', {
|
32
32
|
variants: {
|
33
33
|
radius: __assign({}, radiusVariants['base']),
|
34
34
|
scaling: __assign({}, scalingVariants),
|
@@ -37,7 +37,7 @@ export var useNavigationMenuContext = function () {
|
|
37
37
|
export var NavigationMenuRoot = forwardRef(function (_a, ref) {
|
38
38
|
var className = _a.className, children = _a.children, radius = _a.radius, size = _a.size, scaling = _a.scaling, color = _a.color, appearance = _a.appearance, props = __rest(_a, ["className", "children", "radius", "size", "scaling", "color", "appearance"]);
|
39
39
|
var contextValue = useMemo(function () { return ({ radius: radius, size: size, scaling: scaling, color: color, appearance: appearance }); }, [radius, size, scaling, color, appearance]);
|
40
|
-
return (_jsx(NavigationMenuContext.Provider, { value: contextValue, children: _jsx(NavigationMenuPrimitive.Root, __assign({ ref: ref, className: cn('
|
40
|
+
return (_jsx(NavigationMenuContext.Provider, { value: contextValue, children: _jsx(NavigationMenuPrimitive.Root, __assign({ ref: ref, className: cn('relative flex', className) }, props, { children: children })) }));
|
41
41
|
});
|
42
42
|
NavigationMenuRoot.displayName = 'NavigationMenu.Root';
|
43
43
|
export default NavigationMenuRoot;
|
@@ -48,6 +48,6 @@ export var NavigationMenuViewport = forwardRef(function (_a, ref) {
|
|
48
48
|
var className = _a.className, props = __rest(_a, ["className"]);
|
49
49
|
var _b = useNavigationMenuContext(), size = _b.size, scaling = _b.scaling, radius = _b.radius;
|
50
50
|
var viewportClassName = cn(navigationViewportVariants({ size: size, scaling: scaling, radius: radius }), className);
|
51
|
-
return (_jsx("div", { className: "perspective-[2000px] absolute top-full
|
51
|
+
return (_jsx("div", { className: "perspective-[2000px] absolute left-0 top-full flex w-full", children: _jsx(NavigationMenuPrimitive.Viewport, __assign({ ref: ref, className: viewportClassName }, props)) }));
|
52
52
|
});
|
53
53
|
NavigationMenuViewport.displayName = 'NavigationMenu.Viewport';
|
@@ -1,25 +1,22 @@
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
2
|
+
import { IChartDataLabels, IChartDatasets, IChartLegend, IChartTitle } from '../../../lib/types';
|
2
3
|
export interface PieChartProps extends VariantProps<typeof PieVariants> {
|
3
4
|
labels?: string[];
|
4
|
-
datasets: {
|
5
|
-
label?: string;
|
6
|
-
data: number[];
|
7
|
-
backgroundColor?: string[];
|
8
|
-
borderColor?: string[];
|
9
|
-
borderWidth?: number;
|
10
|
-
borderDash?: number[];
|
11
|
-
borderDashOffset?: number;
|
12
|
-
offset?: number;
|
13
|
-
spacing?: number;
|
14
|
-
weight?: number;
|
15
|
-
}[];
|
16
|
-
options?: {};
|
17
|
-
className?: string;
|
18
5
|
appearance?: 'solid' | 'soft';
|
19
6
|
isColorMixed?: boolean;
|
7
|
+
className?: string;
|
8
|
+
title?: IChartTitle;
|
9
|
+
legend?: IChartLegend;
|
10
|
+
datasets: IChartDatasets[] & {
|
11
|
+
data: number[];
|
12
|
+
}[];
|
13
|
+
datalabels?: IChartDataLabels;
|
20
14
|
}
|
21
15
|
declare const PieVariants: (props?: ({
|
22
16
|
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
23
17
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
24
|
-
declare const PieChart:
|
18
|
+
declare const PieChart: {
|
19
|
+
({ labels, title, legend, datasets, datalabels, scaling, className, appearance, isColorMixed, ...rest }: PieChartProps): import("react/jsx-runtime").JSX.Element;
|
20
|
+
displayName: string;
|
21
|
+
};
|
25
22
|
export default PieChart;
|
@@ -41,7 +41,7 @@ var PieVariants = cva('', {
|
|
41
41
|
},
|
42
42
|
});
|
43
43
|
var PieChart = function (_a) {
|
44
|
-
var labels = _a.labels, datasets = _a.datasets, scaling = _a.scaling, className = _a.className, _b = _a.appearance, appearance = _b === void 0 ? 'solid' : _b, _c = _a.isColorMixed, isColorMixed = _c === void 0 ? true : _c, rest = __rest(_a, ["labels", "datasets", "scaling", "className", "appearance", "isColorMixed"]);
|
44
|
+
var labels = _a.labels, title = _a.title, legend = _a.legend, datasets = _a.datasets, datalabels = _a.datalabels, scaling = _a.scaling, className = _a.className, _b = _a.appearance, appearance = _b === void 0 ? 'solid' : _b, _c = _a.isColorMixed, isColorMixed = _c === void 0 ? true : _c, rest = __rest(_a, ["labels", "title", "legend", "datasets", "datalabels", "scaling", "className", "appearance", "isColorMixed"]);
|
45
45
|
var getChartColor = function (isColorMixed, appearance) {
|
46
46
|
if (appearance === 'solid') {
|
47
47
|
return isColorMixed ? chartColorList.mixed : chartColorList.sorting;
|
@@ -53,6 +53,13 @@ var PieChart = function (_a) {
|
|
53
53
|
datasets.forEach(function (dataset, index) {
|
54
54
|
datasets[index] = __assign(__assign({}, dataset), { backgroundColor: getChartColor(isColorMixed, appearance), borderColor: getChartColor(isColorMixed, 'solid') });
|
55
55
|
});
|
56
|
-
return (_jsx(Pie, __assign({ data: { labels: labels, datasets: datasets },
|
56
|
+
return (_jsx(Pie, __assign({ data: { labels: labels, datasets: datasets }, options: {
|
57
|
+
plugins: {
|
58
|
+
title: title,
|
59
|
+
legend: legend,
|
60
|
+
datalabels: datalabels,
|
61
|
+
},
|
62
|
+
}, className: cn(PieVariants({ scaling: scaling }), className) }, rest)));
|
57
63
|
};
|
64
|
+
PieChart.displayName = 'PieChart';
|
58
65
|
export default PieChart;
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
3
|
-
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
4
3
|
export interface ProgressProps extends VariantProps<typeof progressVariants> {
|
5
|
-
color?: any;
|
6
4
|
size?: any;
|
7
5
|
appearance?: 'classic' | 'surface' | 'soft';
|
8
6
|
}
|
@@ -10,7 +8,6 @@ declare const progressVariants: (props?: ({
|
|
10
8
|
radius?: "small" | "none" | "medium" | "large" | "full" | null | undefined;
|
11
9
|
size?: "small" | "medium" | "large" | null | undefined;
|
12
10
|
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
13
|
-
color?: string | null | undefined;
|
14
11
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
15
|
-
export declare const Progress: React.ForwardRefExoticComponent<Omit<
|
12
|
+
export declare const Progress: React.ForwardRefExoticComponent<Omit<import("@radix-ui/themes").ProgressProps & React.RefAttributes<HTMLDivElement>, "ref"> & ProgressProps & React.RefAttributes<HTMLDivElement>>;
|
16
13
|
export default Progress;
|
@@ -23,7 +23,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
24
24
|
import { forwardRef } from 'react';
|
25
25
|
import { cva } from 'class-variance-authority';
|
26
|
-
import { scalingVariants
|
26
|
+
import { scalingVariants } from '../../../lib/constants';
|
27
27
|
import { Theme, Progress as ProgressTheme } from '@radix-ui/themes';
|
28
28
|
import { cn } from '../../../lib/utils/utils';
|
29
29
|
var progressVariants = cva('w-[300px]', {
|
@@ -41,7 +41,6 @@ var progressVariants = cva('w-[300px]', {
|
|
41
41
|
large: 'h-2',
|
42
42
|
},
|
43
43
|
scaling: __assign({}, scalingVariants),
|
44
|
-
color: bgColorStyle(),
|
45
44
|
},
|
46
45
|
defaultVariants: {
|
47
46
|
radius: 'medium',
|
@@ -50,7 +49,7 @@ var progressVariants = cva('w-[300px]', {
|
|
50
49
|
},
|
51
50
|
});
|
52
51
|
export var Progress = forwardRef(function (_a, ref) {
|
53
|
-
var className = _a.className,
|
52
|
+
var className = _a.className, radius = _a.radius, size = _a.size, value = _a.value, _b = _a.appearance, appearance = _b === void 0 ? 'surface' : _b, _c = _a.color, color = _c === void 0 ? 'red' : _c, scaling = _a.scaling, props = __rest(_a, ["className", "radius", "size", "value", "appearance", "color", "scaling"]);
|
54
53
|
return (_jsx(Theme, { accentColor: color, children: _jsx(ProgressTheme, __assign({ ref: ref, value: value, variant: appearance, className: cn(progressVariants({ radius: radius, size: size, scaling: scaling }), className) }, props)) }));
|
55
54
|
});
|
56
55
|
Progress.displayName = 'Progress';
|
@@ -1,39 +1,32 @@
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
2
|
-
import {
|
2
|
+
import { IChartDataLabels, IChartDatasets, IChartLegend, IChartTitle } from '../../../lib/types';
|
3
|
+
type IRadarChartDataset = IChartDatasets & {
|
4
|
+
data: number[];
|
5
|
+
pointBackgroundColor?: string;
|
6
|
+
pointBorderColor?: string;
|
7
|
+
pointBorderWidth?: number;
|
8
|
+
pointHoverBackgroundColor?: string;
|
9
|
+
pointHoverBorderColor?: string;
|
10
|
+
pointHoverBorderWidth?: number;
|
11
|
+
fill?: boolean;
|
12
|
+
};
|
3
13
|
export interface RadarChartProps extends VariantProps<typeof radarChartVariants> {
|
4
|
-
|
5
|
-
|
6
|
-
label?: string;
|
7
|
-
data: number[];
|
8
|
-
backgroundColor?: string;
|
9
|
-
borderColor?: string;
|
10
|
-
borderWidth?: number;
|
11
|
-
hoverBackgroundColor?: string;
|
12
|
-
hoverBorderColor?: string;
|
13
|
-
hoverBorderWidth?: number;
|
14
|
-
pointBackgroundColor?: string;
|
15
|
-
pointBorderColor?: string;
|
16
|
-
pointBorderWidth?: number;
|
17
|
-
pointHoverBackgroundColor?: string;
|
18
|
-
pointHoverBorderColor?: string;
|
19
|
-
pointHoverBorderWidth?: number;
|
20
|
-
pointStyle?: PointStyle;
|
21
|
-
pointRotation?: number;
|
22
|
-
fill?: boolean;
|
23
|
-
order?: number;
|
24
|
-
tension?: number;
|
25
|
-
}[];
|
26
|
-
options?: {};
|
14
|
+
appearance?: 'solid' | 'soft';
|
15
|
+
isColorMixed?: boolean;
|
27
16
|
className?: string;
|
17
|
+
datasets: IRadarChartDataset[];
|
18
|
+
title?: IChartTitle;
|
19
|
+
legend?: IChartLegend;
|
20
|
+
labels?: string[];
|
21
|
+
datalabels?: IChartDataLabels;
|
28
22
|
width?: string | number;
|
29
23
|
height?: string | number;
|
30
|
-
isColorMixed?: boolean;
|
31
24
|
}
|
32
25
|
declare const radarChartVariants: (props?: ({
|
33
26
|
scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
|
34
27
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
35
28
|
export declare const RadarChart: {
|
36
|
-
({ className,
|
29
|
+
({ className, title, legend, datalabels, datasets, labels, width, height, scaling, appearance, isColorMixed, ...props }: RadarChartProps): import("react/jsx-runtime").JSX.Element;
|
37
30
|
displayName: string;
|
38
31
|
};
|
39
32
|
export default RadarChart;
|
@@ -25,9 +25,14 @@ import { cva } from 'class-variance-authority';
|
|
25
25
|
import { scalingVariants } from '../../../lib/constants';
|
26
26
|
import { Radar } from 'react-chartjs-2';
|
27
27
|
import { cn } from '../../../lib/utils/utils';
|
28
|
-
import { Chart as ChartJS, RadialLinearScale, PointElement, LineElement, Filler, Tooltip, Legend, } from 'chart.js/auto';
|
29
|
-
import { chartColorList } from '../../../lib/color/constants';
|
30
|
-
|
28
|
+
import { Chart as ChartJS, RadialLinearScale, PointElement, LineElement, Filler, Tooltip, Legend, plugins, } from 'chart.js/auto';
|
29
|
+
import { chartColorList, chartAlphaColorList } from '../../../lib/color/constants';
|
30
|
+
import { useDarkMode } from '../../../lib/utils/useDarkMode';
|
31
|
+
import ChartDataLabels from 'chartjs-plugin-datalabels';
|
32
|
+
ChartJS.register(RadialLinearScale, PointElement, LineElement, Filler, Tooltip, Legend, plugins, ChartDataLabels);
|
33
|
+
ChartJS.defaults.set('plugins.datalabels', {
|
34
|
+
display: false,
|
35
|
+
});
|
31
36
|
var radarChartVariants = cva('', {
|
32
37
|
variants: {
|
33
38
|
scaling: __assign({}, scalingVariants),
|
@@ -37,18 +42,35 @@ var radarChartVariants = cva('', {
|
|
37
42
|
},
|
38
43
|
});
|
39
44
|
export var RadarChart = function (_a) {
|
40
|
-
var className = _a.className,
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
45
|
+
var className = _a.className, title = _a.title, legend = _a.legend, datalabels = _a.datalabels, datasets = _a.datasets, labels = _a.labels, width = _a.width, height = _a.height, scaling = _a.scaling, _b = _a.appearance, appearance = _b === void 0 ? 'solid' : _b, _c = _a.isColorMixed, isColorMixed = _c === void 0 ? true : _c, props = __rest(_a, ["className", "title", "legend", "datalabels", "datasets", "labels", "width", "height", "scaling", "appearance", "isColorMixed"]);
|
46
|
+
var _d = useDarkMode(true), isDark = _d[0], defaultScales = _d[1];
|
47
|
+
var getChartColor = function (isColorMixed, appearance) {
|
48
|
+
if (appearance === 'solid') {
|
49
|
+
return isColorMixed ? chartColorList.mixed : chartColorList.sorting;
|
50
|
+
}
|
51
|
+
if (appearance === 'soft') {
|
52
|
+
return isColorMixed ? chartAlphaColorList.mixed : chartAlphaColorList.sorting;
|
53
|
+
}
|
54
|
+
};
|
55
|
+
datasets.forEach(function (dataset, index) {
|
56
|
+
var ChartColor = getChartColor(isColorMixed, appearance);
|
57
|
+
var BorderColor = getChartColor(isColorMixed, 'solid');
|
58
|
+
if (!ChartColor || !BorderColor)
|
59
|
+
return;
|
60
|
+
dataset.backgroundColor = ChartColor[index];
|
61
|
+
dataset.borderColor = BorderColor[index];
|
62
|
+
});
|
63
|
+
return (_jsx(Radar, __assign({ data: { labels: labels, datasets: datasets }, options: {
|
64
|
+
plugins: {
|
65
|
+
title: title,
|
66
|
+
legend: legend,
|
67
|
+
datalabels: datalabels,
|
68
|
+
},
|
69
|
+
scales: __assign({ r: {
|
70
|
+
suggestedMin: 50,
|
71
|
+
suggestedMax: 100,
|
72
|
+
} }, defaultScales.linescale),
|
73
|
+
}, className: cn(radarChartVariants({ scaling: scaling }), className), width: width, height: height }, props)));
|
52
74
|
};
|
53
75
|
RadarChart.displayName = 'RadarChart';
|
54
76
|
export default RadarChart;
|
@@ -3,7 +3,6 @@ import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { IScaling } from '../../../lib/types';
|
4
4
|
export interface RadioProps extends VariantProps<typeof radioVariants> {
|
5
5
|
size?: any;
|
6
|
-
color?: any;
|
7
6
|
scaling?: IScaling;
|
8
7
|
appearance?: 'classic' | 'surface' | 'soft';
|
9
8
|
}
|
@@ -39,7 +39,9 @@ var radioVariants = cva('font-normal', {
|
|
39
39
|
},
|
40
40
|
});
|
41
41
|
export var Radio = React.forwardRef(function (_a, ref) {
|
42
|
-
var value = _a.value, scaling = _a.scaling,
|
42
|
+
var value = _a.value, scaling = _a.scaling, color = _a.color, _b = _a.size, size = _b === void 0 ? 'medium' : _b, _c = _a.appearance, appearance = _c === void 0 ? 'surface' : _c, children = _a.children, className = _a.className, props = __rest(_a, ["value", "scaling", "color", "size", "appearance", "children", "className"]);
|
43
|
+
if (!color)
|
44
|
+
color = 'red';
|
43
45
|
var sizeTheme = '2';
|
44
46
|
if (size === 'small')
|
45
47
|
sizeTheme = '1';
|
@@ -26,7 +26,7 @@ import { cva } from 'class-variance-authority';
|
|
26
26
|
import { RadioCards as RadioCardsTheme } from '@radix-ui/themes';
|
27
27
|
import { cn } from '../../../lib/utils/utils';
|
28
28
|
import { RadioCardsContext } from './RadioCardsRoot';
|
29
|
-
export var radioCardsItemVariants = cva('bg-white dark:bg-slateDark-1 text-slateA-12 dark:text-slateDarkA-12 border-slateA-6 dark:border-slateDarkA-6 font-normal disabled:text-slateA-9 dark:disabled:text-slateDarkA-9', {
|
29
|
+
export var radioCardsItemVariants = cva('min-w-[200px] bg-white dark:bg-slateDark-1 text-slateA-12 dark:text-slateDarkA-12 border-slateA-6 dark:border-slateDarkA-6 font-normal disabled:text-slateA-9 dark:disabled:text-slateDarkA-9', {
|
30
30
|
variants: {
|
31
31
|
radius: {
|
32
32
|
none: 'rounded-none before:rounded-none after:rounded-none',
|
@@ -3,7 +3,6 @@ import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { RadioCards as RadioCardsTheme } from '@radix-ui/themes';
|
4
4
|
import { radioCardsItemVariants } from './RadioCardsItem';
|
5
5
|
export interface RadioCardsProps extends VariantProps<typeof radioCardsVariants>, VariantProps<typeof radioCardsItemVariants> {
|
6
|
-
color?: any;
|
7
6
|
appearance?: 'classic' | 'surface';
|
8
7
|
}
|
9
8
|
declare const radioCardsVariants: (props?: ({
|
@@ -3,7 +3,6 @@ import { RadioGroup as RadioGroupTheme } from '@radix-ui/themes';
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
4
4
|
import { IScaling } from '../../../lib/types';
|
5
5
|
export interface RadioGroupProps extends VariantProps<typeof radioGroupVariants> {
|
6
|
-
color?: any;
|
7
6
|
scaling?: IScaling;
|
8
7
|
size?: 'small' | 'medium' | 'large';
|
9
8
|
appearance?: 'classic' | 'surface' | 'soft';
|
@@ -45,7 +45,7 @@ export var Root = React.forwardRef(function (_a, ref) {
|
|
45
45
|
});
|
46
46
|
Root.displayName = 'Select.Root';
|
47
47
|
export var Trigger = React.forwardRef(function (_a, forwardedRef) {
|
48
|
-
var _b = _a.appearance, appearance = _b === void 0 ? '
|
48
|
+
var _b = _a.appearance, appearance = _b === void 0 ? 'classic' : _b, color = _a.color, size = _a.size, radius = _a.radius, children = _a.children, className = _a.className, props = __rest(_a, ["appearance", "color", "size", "radius", "children", "className"]);
|
49
49
|
if (!color)
|
50
50
|
color = 'red';
|
51
51
|
return (_jsx(SelectTheme.Trigger, __assign({ ref: forwardedRef, variant: appearance, radius: radius, className: cn(selectVariants({ radius: radius }), selectAppearanceStyle(appearance, color), className) }, props, { children: children })));
|
@@ -18,4 +18,4 @@ export declare const IconScaling: {
|
|
18
18
|
large: string;
|
19
19
|
};
|
20
20
|
export declare const ToggleWithText: React.ForwardRefExoticComponent<Omit<TogglePrimitive.ToggleProps & React.RefAttributes<HTMLButtonElement>, "ref"> & ToggleWithTextProps & React.RefAttributes<HTMLButtonElement>>;
|
21
|
-
export
|
21
|
+
export default ToggleWithText;
|
@@ -65,7 +65,7 @@ export var ToggleSwitch = React.forwardRef(function (_a, forwardedRef) {
|
|
65
65
|
sizeTheme = '1';
|
66
66
|
if (size === 'large')
|
67
67
|
sizeTheme = '3';
|
68
|
-
return (_jsx(Theme, { className: "flex", accentColor: color, hasBackground: false, children: _jsxs(Text, { as: "label", className: cn('flex items-center', SwitchLabelVariants({ size: size, scaling: scaling })), children: [_jsx(SwitchTheme, __assign({ ref: forwardedRef }, switchProps, { variant: appearance, radius: radius, size: sizeTheme, color: color, className: cn(toggleSwitchVariants({ scaling: scaling, radius: radius, size: size }), className) })), children] }) }));
|
68
|
+
return (_jsx(Theme, { className: "flex", accentColor: color, hasBackground: false, children: _jsxs(Text, { as: "label", className: cn('flex items-center', SwitchLabelVariants({ size: size, scaling: scaling })), children: [_jsx(SwitchTheme, __assign({ ref: forwardedRef }, switchProps, { variant: appearance, radius: radius, size: sizeTheme, color: color, className: cn(toggleSwitchVariants({ scaling: scaling, radius: radius, size: size }), className), "aria-label": "Switch" })), children] }) }));
|
69
69
|
});
|
70
70
|
ToggleSwitch.displayName = 'ToggleSwitch';
|
71
71
|
export default ToggleSwitch;
|
@@ -11,7 +11,6 @@ export interface TooltipProps extends React.InputHTMLAttributes<HTMLInputElement
|
|
11
11
|
side?: 'top' | 'right' | 'bottom' | 'left';
|
12
12
|
}
|
13
13
|
declare const tooltipVariants: (props?: ({
|
14
|
-
scaling?: number | typeof Symbol.iterator | "concat" | "indexOf" | "lastIndexOf" | "slice" | "length" | "includes" | "at" | "toLocaleString" | typeof Symbol.unscopables | "map" | "filter" | "fill" | "values" | "toString" | "pop" | "push" | "join" | "reverse" | "shift" | "sort" | "splice" | "unshift" | "every" | "some" | "forEach" | "reduce" | "reduceRight" | "find" | "findIndex" | "copyWithin" | "entries" | "keys" | "flatMap" | "flat" | "findLast" | "findLastIndex" | "toReversed" | "toSorted" | "toSpliced" | "with" | null | undefined;
|
15
14
|
weight?: "bold" | "medium" | "regular" | "semibold" | null | undefined;
|
16
15
|
radius?: "small" | "none" | "medium" | "large" | "full" | null | undefined;
|
17
16
|
color?: string | null | undefined;
|
@@ -26,17 +26,16 @@ import React from 'react';
|
|
26
26
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
27
27
|
import { cva } from 'class-variance-authority';
|
28
28
|
import { cn } from '../../../lib/utils/utils';
|
29
|
-
import { primaryColorStyle, radiusVariants,
|
29
|
+
import { primaryColorStyle, radiusVariants, weightVariants } from '../../../lib/constants';
|
30
30
|
var tooltipVariants = cva('bg-slate-12 text-slate-1 dark:bg-slateDark-12 dark:text-slateDark-1 data-[state=delayed-open]:data-[side=top]:animate-slideDownAndFade data-[state=delayed-open]:data-[side=right]:animate-slideLeftAndFade data-[state=delayed-open]:data-[side=left]:animate-slideRightAndFade data-[state=delayed-open]:data-[side=bottom]:animate-slideUpAndFade select-none rounded-[4px] px-[9px] py-[6px] text-[12px] leading-none shadow-[hsl(206_22%_7%_/_35%)_0px_10px_38px_-10px,_hsl(206_22%_7%_/_20%)_0px_10px_20px_-15px] will-change-[transform,opacity]', {
|
31
31
|
variants: {
|
32
|
-
scaling: __assign({}, scalingOptions),
|
33
32
|
weight: __assign({}, weightVariants),
|
34
33
|
radius: __assign({}, radiusVariants['extra-large']),
|
35
34
|
color: primaryColorStyle(),
|
36
35
|
},
|
37
36
|
});
|
38
37
|
var Tooltip = React.forwardRef(function (_a, ref) {
|
39
|
-
var content = _a.content,
|
38
|
+
var content = _a.content, weight = _a.weight, color = _a.color, radius = _a.radius, children = _a.children, defaultOpen = _a.defaultOpen, open = _a.open, className = _a.className, side = _a.side, onOpenChange = _a.onOpenChange, props = __rest(_a, ["content", "weight", "color", "radius", "children", "defaultOpen", "open", "className", "side", "onOpenChange"]);
|
40
39
|
if (!side)
|
41
40
|
side = 'top';
|
42
41
|
if (radius === 'full')
|
@@ -44,7 +43,7 @@ var Tooltip = React.forwardRef(function (_a, ref) {
|
|
44
43
|
var arrowColor = color
|
45
44
|
? "fill-".concat(color, "-9 dark:fill-").concat(color, "Dark-9")
|
46
45
|
: 'fill-slate-12 dark:fill-slateDark-12';
|
47
|
-
return (_jsx(TooltipPrimitive.Provider, { children: _jsxs(TooltipPrimitive.Root, { open: open, defaultOpen: defaultOpen, onOpenChange: onOpenChange, children: [_jsx(TooltipPrimitive.Trigger, { className: "cursor-pointer text-slate-12 dark:text-slateDark-12", asChild: true, children: children }), _jsxs(TooltipPrimitive.Content, __assign({ align: "center" }, props, { side: side, className: cn('mr-2', tooltipVariants({
|
46
|
+
return (_jsx(TooltipPrimitive.Provider, { children: _jsxs(TooltipPrimitive.Root, { open: open, defaultOpen: defaultOpen, onOpenChange: onOpenChange, children: [_jsx(TooltipPrimitive.Trigger, { className: "cursor-pointer text-slate-12 dark:text-slateDark-12", asChild: true, children: children }), _jsxs(TooltipPrimitive.Content, __assign({ align: "center" }, props, { side: side, className: cn('mr-2', tooltipVariants({ weight: weight, radius: radius, color: color }), className), sideOffset: 5, children: [content, _jsx(TooltipPrimitive.Arrow, { width: 11, height: 5, className: arrowColor })] }))] }) }));
|
48
47
|
});
|
49
48
|
Tooltip.displayName = 'Tooltip';
|
50
49
|
export default Tooltip;
|
@@ -38,6 +38,7 @@ export { default as TextArea } from './TextArea';
|
|
38
38
|
export { default as TextField } from './TextField';
|
39
39
|
export { default as Toast } from './Toast';
|
40
40
|
export { default as Toggle } from './Toggle';
|
41
|
+
export { default as ToggleWithText } from './Toggle/ToggleWithText';
|
41
42
|
export { default as ToggleGroup } from './ToggleGroup';
|
42
43
|
export { default as ToggleSwitch } from './ToggleSwitch';
|
43
44
|
export { default as Tooltip } from './Tooltip';
|
@@ -39,6 +39,7 @@ export { default as TextArea } from './TextArea';
|
|
39
39
|
export { default as TextField } from './TextField';
|
40
40
|
export { default as Toast } from './Toast';
|
41
41
|
export { default as Toggle } from './Toggle';
|
42
|
+
export { default as ToggleWithText } from './Toggle/ToggleWithText';
|
42
43
|
export { default as ToggleGroup } from './ToggleGroup';
|
43
44
|
export { default as ToggleSwitch } from './ToggleSwitch';
|
44
45
|
export { default as Tooltip } from './Tooltip';
|