@lotte-innovate/ui-component-test 0.1.34 → 0.1.35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. package/README.md +5 -5
  2. package/dist/globals.css +2 -2
  3. package/dist/lib/Typography/Text/index.js +1 -1
  4. package/dist/lib/components/AlertDialog/AlertDialogAction.js +5 -5
  5. package/dist/lib/components/AlertDialog/AlertDialogCancel.js +5 -5
  6. package/dist/lib/components/AlertDialog/AlertDialogTrigger.js +1 -1
  7. package/dist/lib/components/Avatar/index.d.ts +1 -0
  8. package/dist/lib/components/Avatar/index.js +2 -2
  9. package/dist/lib/components/Badge/index.js +1 -1
  10. package/dist/lib/components/BarChart/index.js +3 -0
  11. package/dist/lib/components/BubbleChart/index.d.ts +15 -22
  12. package/dist/lib/components/BubbleChart/index.js +34 -15
  13. package/dist/lib/components/Callout/CalloutIcon.d.ts +2 -1
  14. package/dist/lib/components/Callout/CalloutRoot.js +4 -4
  15. package/dist/lib/components/Callout/CalloutText.js +1 -1
  16. package/dist/lib/components/Callout/index.d.ts +1 -1
  17. package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.d.ts +2 -1
  18. package/dist/lib/components/CheckboxGroup/index.d.ts +1 -1
  19. package/dist/lib/components/LineChart/index.js +3 -1
  20. package/dist/lib/components/Menubar/MenubarMenu.d.ts +4 -1
  21. package/dist/lib/components/Menubar/MenubarRoot.js +1 -1
  22. package/dist/lib/components/Menubar/MenubarTrigger.js +1 -1
  23. package/dist/lib/components/Menubar/index.d.ts +3 -1
  24. package/dist/lib/components/NavigationMenu/NavigationMenuContent.js +2 -2
  25. package/dist/lib/components/NavigationMenu/NavigationMenuIndicator.js +1 -1
  26. package/dist/lib/components/NavigationMenu/NavigationMenuList.js +1 -1
  27. package/dist/lib/components/NavigationMenu/NavigationMenuRoot.js +1 -1
  28. package/dist/lib/components/NavigationMenu/NavigationMenuViewport.js +1 -1
  29. package/dist/lib/components/Progress/index.d.ts +1 -4
  30. package/dist/lib/components/Progress/index.js +2 -3
  31. package/dist/lib/components/RadarChart/index.d.ts +19 -26
  32. package/dist/lib/components/RadarChart/index.js +37 -15
  33. package/dist/lib/components/Radio/index.d.ts +0 -1
  34. package/dist/lib/components/Radio/index.js +3 -1
  35. package/dist/lib/components/RadioCards/RadioCardsItem.js +1 -1
  36. package/dist/lib/components/RadioCards/RadioCardsRoot.d.ts +0 -1
  37. package/dist/lib/components/RadioGroup/RadioGroupRoot.d.ts +0 -1
  38. package/dist/lib/components/Toggle/ToggleWithText.d.ts +1 -1
  39. package/dist/lib/components/Toggle/ToggleWithText.js +1 -0
  40. package/dist/lib/components/ToggleSwitch/index.js +1 -1
  41. package/dist/lib/components/Tooltip/index.d.ts +0 -1
  42. package/dist/lib/components/Tooltip/index.js +3 -4
  43. package/dist/lib/components/index.d.ts +1 -0
  44. package/dist/lib/components/index.js +1 -0
  45. package/dist/lib/types.d.ts +12 -0
  46. package/dist/lib/utils/useDarkMode.d.ts +1 -0
  47. package/dist/lib/utils/useDarkMode.js +49 -0
  48. package/dist/tailwind.config.js +2 -5
  49. package/package.json +10 -10
@@ -26,7 +26,7 @@ import { cva } from 'class-variance-authority';
26
26
  import { Text as TextTheme, Theme } from '@radix-ui/themes';
27
27
  import { textColorStyle, weightVariants } from '../../../lib/constants';
28
28
  import { cn } from '../../../lib/utils/utils';
29
- var textVariants = cva('text', {
29
+ var textVariants = cva('', {
30
30
  variants: {
31
31
  weight: __assign({ light: 'font-light' }, weightVariants),
32
32
  color: textColorStyle(),
@@ -27,7 +27,7 @@ import { cva } from 'class-variance-authority';
27
27
  import { cn } from '../../../lib/utils/utils';
28
28
  import { appearanceStyle, primaryColorStyle, weightVariants } from '../../../lib/constants';
29
29
  import { useAlertDialogContext } from './AlertDialogRoot';
30
- export var alertDialogActionVariants = cva("inline-flex items-center justify-center px-[15px] outline-none focus:shadow-[0_0_0_2px] font-normal", {
30
+ export var alertDialogActionVariants = cva("inline-flex items-center justify-center px-[15px] outline-none focus:shadow-[0_0_0_2px] font-normal w-fit", {
31
31
  variants: {
32
32
  radius: {
33
33
  none: 'rounded-none',
@@ -37,10 +37,10 @@ export var alertDialogActionVariants = cva("inline-flex items-center justify-cen
37
37
  full: 'rounded-full',
38
38
  },
39
39
  size: {
40
- small: 'text-xs h-[24px] px-2',
41
- medium: 'text-sm h-[32px] px-3',
42
- large: 'text-sm h-[32px] px-3',
43
- 'x-large': 'text-base h-[40px] px-4',
40
+ small: 'text-xs min-w-[40px] h-[24px] px-2',
41
+ medium: 'text-sm min-w-[50px] h-[32px] px-3',
42
+ large: 'text-sm min-w-[50px] h-[32px] px-3',
43
+ 'x-large': 'text-base min-w-[62px] h-[40px] px-4',
44
44
  },
45
45
  weight: __assign({}, weightVariants),
46
46
  color: primaryColorStyle(),
@@ -27,7 +27,7 @@ import { cva } from 'class-variance-authority';
27
27
  import { cn } from '../../../lib/utils/utils';
28
28
  import { appearanceStyle, weightVariants } from '../../../lib/constants';
29
29
  import { useAlertDialogContext } from './AlertDialogRoot';
30
- export var alertDialogCancelVariants = cva("inline-flex justify-center items-center outline-none", {
30
+ export var alertDialogCancelVariants = cva("inline-flex justify-center items-center outline-none w-fit", {
31
31
  variants: {
32
32
  radius: {
33
33
  none: 'rounded-none',
@@ -37,10 +37,10 @@ export var alertDialogCancelVariants = cva("inline-flex justify-center items-cen
37
37
  full: 'rounded-full',
38
38
  },
39
39
  size: {
40
- small: 'text-xs h-[24px] px-2 mr-2',
41
- medium: 'text-sm h-[32px] px-3 mr-2',
42
- large: 'text-sm h-[32px] px-3 mr-3',
43
- 'x-large': 'text-base h-[40px] px-4 mr-3',
40
+ small: 'text-xs min-w-[40px] h-[24px] px-2 mr-2',
41
+ medium: 'text-sm min-w-[50px] h-[32px] px-3 mr-2',
42
+ large: 'text-sm min-w-[50px] h-[32px] px-3 mr-3',
43
+ 'x-large': 'text-base min-w-[62px] h-[40px] px-4 mr-3',
44
44
  },
45
45
  weight: __assign({}, weightVariants),
46
46
  },
@@ -44,7 +44,7 @@ var buttonVariants = cva("inline-flex items-center transition-colors focus:outli
44
44
  scaling: '100%',
45
45
  weight: 'medium',
46
46
  color: 'red',
47
- size: 'large',
47
+ size: 'medium',
48
48
  },
49
49
  });
50
50
  export var AlertDialogTrigger = forwardRef(function (_a, ref) {
@@ -9,6 +9,7 @@ export interface AvatarProps extends VariantProps<typeof AvatarVariants> {
9
9
  ariaLabel?: string;
10
10
  ariaLabelledby?: string;
11
11
  title?: string;
12
+ delayMs?: number;
12
13
  }
13
14
  declare const AvatarVariants: (props?: ({
14
15
  radius?: "small" | "none" | "medium" | "large" | "full" | null | undefined;
@@ -50,9 +50,9 @@ var AvatarVariants = cva('font-medium', {
50
50
  },
51
51
  });
52
52
  var Avatar = forwardRef(function (_a, ref) {
53
- var className = _a.className, fallbackClassName = _a.fallbackClassName, radius = _a.radius, scaling = _a.scaling, size = _a.size, fallbackText = _a.fallbackText, imagePath = _a.imagePath, alt = _a.alt, _b = _a.appearance, appearance = _b === void 0 ? 'solid' : _b, _c = _a.color, color = _c === void 0 ? 'red' : _c, ariaLabel = _a.ariaLabel, ariaLabelledby = _a.ariaLabelledby, title = _a.title, props = __rest(_a, ["className", "fallbackClassName", "radius", "scaling", "size", "fallbackText", "imagePath", "alt", "appearance", "color", "ariaLabel", "ariaLabelledby", "title"]);
53
+ var className = _a.className, fallbackClassName = _a.fallbackClassName, radius = _a.radius, scaling = _a.scaling, size = _a.size, fallbackText = _a.fallbackText, imagePath = _a.imagePath, alt = _a.alt, _b = _a.appearance, appearance = _b === void 0 ? 'solid' : _b, _c = _a.color, color = _c === void 0 ? 'red' : _c, ariaLabel = _a.ariaLabel, ariaLabelledby = _a.ariaLabelledby, title = _a.title, _d = _a.delayMs, delayMs = _d === void 0 ? 300 : _d, props = __rest(_a, ["className", "fallbackClassName", "radius", "scaling", "size", "fallbackText", "imagePath", "alt", "appearance", "color", "ariaLabel", "ariaLabelledby", "title", "delayMs"]);
54
54
  var imgAltText = alt || ariaLabel || fallbackText || 'Avatar Image';
55
- return (_jsxs(AvatarPrimitive.Root, __assign({ className: cn("inline-flex select-none items-center justify-center overflow-hidden align-middle", AvatarVariants({ radius: radius, scaling: scaling, size: size, color: color }), appearanceStyle(appearance, color, false), className) }, props, { ref: ref, role: "img", "aria-label": ariaLabel || imgAltText, "aria-labelledby": ariaLabelledby, title: title || imgAltText, tabIndex: 0, children: [_jsx(AvatarPrimitive.Image, { className: "h-full w-full border-none object-cover", src: imagePath, alt: imgAltText, title: title || imgAltText }), _jsx(AvatarPrimitive.Fallback, { className: cn("leading-1 flex h-full w-full items-center justify-center", className), delayMs: 300, "aria-hidden": "true", children: fallbackText })] })));
55
+ return (_jsxs(AvatarPrimitive.Root, __assign({ className: cn("inline-flex select-none items-center justify-center overflow-hidden align-middle", AvatarVariants({ radius: radius, scaling: scaling, size: size, color: color }), appearanceStyle(appearance, color, false), className) }, props, { ref: ref, role: "img", "aria-label": ariaLabel || imgAltText, "aria-labelledby": ariaLabelledby, title: title || imgAltText, tabIndex: 0, children: [_jsx(AvatarPrimitive.Image, { className: "h-full w-full border-none object-cover", src: imagePath, alt: imgAltText, title: title || imgAltText }), _jsx(AvatarPrimitive.Fallback, { className: cn("leading-1 flex h-full w-full items-center justify-center", className), delayMs: delayMs, "aria-hidden": "true", children: fallbackText })] })));
56
56
  });
57
57
  Avatar.displayName = 'Avatar';
58
58
  export default Avatar;
@@ -25,7 +25,7 @@ import { forwardRef } from 'react';
25
25
  import { cva } from 'class-variance-authority';
26
26
  import { cn } from '../../../lib/utils/utils';
27
27
  import { appearanceStyle, primaryColorStyle, radiusVariants, scalingVariants, weightVariants, } from '../../../lib/constants';
28
- var BadgeVariants = cva('inline-flex items-center transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2', {
28
+ var BadgeVariants = cva('inline-flex items-center transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 w-fit', {
29
29
  variants: {
30
30
  radius: __assign({}, radiusVariants['base']),
31
31
  size: {
@@ -27,6 +27,7 @@ import { scalingVariants } from '../../../lib/constants';
27
27
  import { cva } from 'class-variance-authority';
28
28
  import { cn } from '../../../lib/utils/utils';
29
29
  import { chartAlphaColorList, chartColorList } from '../../../lib/color/constants';
30
+ import { useDarkMode } from '../../../lib/utils/useDarkMode';
30
31
  ChartJS.register(CategoryScale, LinearScale, BarElement, Tooltip, Legend);
31
32
  var barChartVariants = cva('', {
32
33
  variants: {
@@ -38,6 +39,7 @@ var barChartVariants = cva('', {
38
39
  });
39
40
  var BarChart = function (_a) {
40
41
  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, _c = _a.isColorMixed, isColorMixed = _c === void 0 ? true : _c, props = __rest(_a, ["className", "title", "datasets", "labels", "scaling", "legend", "width", "height", "indexAxis", "appearance", "isColorMixed"]);
42
+ var _d = useDarkMode(), isDark = _d[0], defaultScales = _d[1];
41
43
  datasets.forEach(function (dataset, index) {
42
44
  if (!dataset.backgroundColor) {
43
45
  if (isColorMixed) {
@@ -54,6 +56,7 @@ var BarChart = function (_a) {
54
56
  legend: legend,
55
57
  },
56
58
  indexAxis: indexAxis,
59
+ scales: __assign({}, defaultScales.linescale),
57
60
  }, className: cn(barChartVariants({ scaling: scaling }), className), width: width, height: height }, props)));
58
61
  };
59
62
  BarChart.displayName = 'BarChart';
@@ -1,35 +1,28 @@
1
- import { PointStyle } from '../../../lib/types';
2
1
  import { VariantProps } from 'class-variance-authority';
3
- export interface BubbleChartProps extends VariantProps<typeof bubbleChartVariants> {
4
- datasets: {
5
- label: string;
6
- data: {
7
- x: number;
8
- y: number;
9
- r: number;
10
- }[];
11
- backgroundColor?: string;
12
- borderColor?: string;
13
- borderWidth?: number;
14
- hoverBackgroundColor?: string;
15
- hoverBorderColor?: string;
16
- hoverBorderWidth?: number;
17
- pointStyle?: PointStyle;
18
- rotation?: number;
19
- radius?: number;
20
- order?: number;
2
+ import { IChartDataLabels, IChartDatasets, IChartLegend, IChartTitle } from '../../../lib/types';
3
+ type IBubbleChartDataset = IChartDatasets & {
4
+ data: {
5
+ x: number;
6
+ y: number;
7
+ r: number;
21
8
  }[];
22
- options?: {};
9
+ };
10
+ export interface BubbleChartProps extends VariantProps<typeof bubbleChartVariants> {
11
+ appearance?: 'solid' | 'soft';
12
+ isColorMixed?: boolean;
23
13
  className?: string;
14
+ title?: IChartTitle;
15
+ legend?: IChartLegend;
16
+ datasets: IBubbleChartDataset[];
17
+ datalabels?: IChartDataLabels;
24
18
  width?: string | number;
25
19
  height?: string | number;
26
- isColorMixed?: boolean;
27
20
  }
28
21
  declare const bubbleChartVariants: (props?: ({
29
22
  scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
30
23
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
31
24
  export declare const BubbleChart: {
32
- ({ className, datasets, scaling, width, height, isColorMixed, ...props }: BubbleChartProps): import("react/jsx-runtime").JSX.Element;
25
+ ({ className, title, legend, datalabels, datasets, scaling, width, height, appearance, isColorMixed, ...props }: BubbleChartProps): import("react/jsx-runtime").JSX.Element;
33
26
  displayName: string;
34
27
  };
35
28
  export default BubbleChart;
@@ -22,12 +22,17 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
24
  import { Bubble } from 'react-chartjs-2';
25
- import { Chart as ChartJS, LinearScale, PointElement, Tooltip, Legend } from 'chart.js/auto';
25
+ import { Chart as ChartJS, LinearScale, PointElement, Tooltip, Legend, plugins, } from 'chart.js/auto';
26
26
  import { scalingVariants } from '../../../lib/constants';
27
27
  import { cva } from 'class-variance-authority';
28
- import { chartColorList } from '../../../lib/color/constants';
28
+ import { chartColorList, chartAlphaColorList } from '../../../lib/color/constants';
29
+ import ChartDataLabels from 'chartjs-plugin-datalabels';
30
+ import { useDarkMode } from '../../../lib/utils/useDarkMode';
29
31
  import { cn } from '../../../lib/utils/utils';
30
- ChartJS.register(LinearScale, PointElement, Tooltip, Legend);
32
+ ChartJS.register(LinearScale, PointElement, Tooltip, Legend, plugins, ChartDataLabels);
33
+ ChartJS.defaults.set('plugins.datalabels', {
34
+ display: false,
35
+ });
31
36
  var bubbleChartVariants = cva('', {
32
37
  variants: {
33
38
  scaling: __assign({}, scalingVariants),
@@ -37,18 +42,32 @@ var bubbleChartVariants = cva('', {
37
42
  },
38
43
  });
39
44
  export var BubbleChart = function (_a) {
40
- var className = _a.className, datasets = _a.datasets, scaling = _a.scaling, width = _a.width, height = _a.height, _b = _a.isColorMixed, isColorMixed = _b === void 0 ? true : _b, props = __rest(_a, ["className", "datasets", "scaling", "width", "height", "isColorMixed"]);
41
- if (isColorMixed) {
42
- datasets.forEach(function (dataset, index) {
43
- dataset.backgroundColor = chartColorList.mixed[index];
44
- });
45
- }
46
- else {
47
- datasets.forEach(function (dataset, index) {
48
- dataset.backgroundColor = chartColorList.sorting[index];
49
- });
50
- }
51
- return (_jsx(Bubble, __assign({ data: { datasets: datasets }, className: cn(bubbleChartVariants({ scaling: scaling }), className), width: width, height: height }, props)));
45
+ var className = _a.className, title = _a.title, legend = _a.legend, datalabels = _a.datalabels, datasets = _a.datasets, scaling = _a.scaling, width = _a.width, height = _a.height, _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", "scaling", "width", "height", "appearance", "isColorMixed"]);
46
+ var _d = useDarkMode(), 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(Bubble, __assign({ data: { datasets: datasets }, options: {
64
+ plugins: {
65
+ title: title,
66
+ legend: legend,
67
+ datalabels: datalabels,
68
+ },
69
+ scales: __assign({}, defaultScales.linescale),
70
+ }, className: cn(bubbleChartVariants({ scaling: scaling }), className), width: width, height: height }, props)));
52
71
  };
53
72
  BubbleChart.displayName = 'BubbleChart';
54
73
  export default BubbleChart;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { Callout as CalloutTheme } from '@radix-ui/themes';
2
3
  import { VariantProps } from 'class-variance-authority';
3
4
  export interface CalloutIconProps extends VariantProps<typeof calloutIconVariants> {
4
5
  iconType?: 'danger' | 'success' | 'warning' | 'information';
@@ -8,5 +9,5 @@ declare const calloutIconVariants: (props?: ({
8
9
  size?: "small" | "medium" | "large" | null | undefined;
9
10
  color?: "danger" | "warning" | "success" | "information" | null | undefined;
10
11
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
11
- export declare const CalloutIcon: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & CalloutIconProps & React.RefAttributes<HTMLDivElement>>;
12
+ export declare const CalloutIcon: React.ForwardRefExoticComponent<Omit<CalloutTheme.IconProps & React.RefAttributes<HTMLDivElement>, "ref"> & CalloutIconProps & React.RefAttributes<HTMLDivElement>>;
12
13
  export {};
@@ -36,10 +36,10 @@ var calloutVariants = cva('flex w-fit max-w-[600px]', {
36
36
  },
37
37
  scaling: __assign({}, scalingVariants),
38
38
  color: {
39
- danger: 'bg-red-3 dark:bg-redDark-3',
40
- warning: 'bg-amber-3 dark:bg-amberDark-3',
41
- success: 'bg-green-3 dark:bg-greenDark-3',
42
- information: 'bg-sky-3 dark:bg-skyDark-3',
39
+ danger: 'bg-redA-3 dark:bg-redDarkA-3',
40
+ warning: 'bg-amberA-3 dark:bg-amberDarkA-3',
41
+ success: 'bg-greenA-3 dark:bg-greenDarkA-3',
42
+ information: 'bg-skyA-3 dark:bg-skyDarkA-3',
43
43
  },
44
44
  },
45
45
  defaultVariants: {
@@ -25,7 +25,7 @@ import { forwardRef } from 'react';
25
25
  import { cva } from 'class-variance-authority';
26
26
  import { cn } from '../../../lib/utils/utils';
27
27
  import { useCalloutContext } from './CalloutRoot';
28
- export var calloutTextVariants = cva('break-words font-normal text-slate-12 dark:text-slateDark-12 ', {
28
+ export var calloutTextVariants = cva('break-words font-normal text-slate-12 dark:text-slateDark-12', {
29
29
  variants: {
30
30
  size: {
31
31
  small: 'text-sm',
@@ -2,6 +2,6 @@
2
2
  declare const Callout: {
3
3
  Root: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("./CalloutRoot").CalloutProps & import("react").RefAttributes<HTMLDivElement>>;
4
4
  Text: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & import("./CalloutText").CalloutTextProps & import("react").RefAttributes<HTMLParagraphElement>>;
5
- Icon: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("./CalloutIcon").CalloutIconProps & import("react").RefAttributes<HTMLDivElement>>;
5
+ Icon: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/callout").IconProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./CalloutIcon").CalloutIconProps & import("react").RefAttributes<HTMLDivElement>>;
6
6
  };
7
7
  export default Callout;
@@ -1,4 +1,5 @@
1
1
  import React, { ReactNode } from 'react';
2
+ import { CheckboxGroup as CheckboxGroupTheme } from '@radix-ui/themes';
2
3
  import { CheckboxVariants } from '../../../lib/components/Checkbox';
3
4
  import { VariantProps } from 'class-variance-authority';
4
5
  import { IAppearance, IColor } from '../../../lib/types';
@@ -12,5 +13,5 @@ export declare const CheckboxGroupVariants: (props?: ({
12
13
  size?: "small" | "medium" | "large" | null | undefined;
13
14
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
14
15
  export declare const useCheckboxGroupContext: () => CheckboxGroupRootProps;
15
- export declare const CheckboxGroupRoot: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & CheckboxGroupRootProps & React.RefAttributes<HTMLDivElement>>;
16
+ export declare const CheckboxGroupRoot: React.ForwardRefExoticComponent<Omit<CheckboxGroupTheme.RootProps & React.RefAttributes<HTMLDivElement>, "ref"> & CheckboxGroupRootProps & React.RefAttributes<HTMLDivElement>>;
16
17
  export default CheckboxGroupRoot;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  declare const CheckboxGroup: {
3
- Root: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("./CheckboxGroupRoot").CheckboxGroupRootProps & import("react").RefAttributes<HTMLDivElement>>;
3
+ Root: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/themes/dist/cjs/components/checkbox-group").RootProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("./CheckboxGroupRoot").CheckboxGroupRootProps & import("react").RefAttributes<HTMLDivElement>>;
4
4
  Item: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-checkbox").CheckboxProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("../../../lib/components/Checkbox").CheckboxProps & import("react").RefAttributes<HTMLButtonElement>>;
5
5
  };
6
6
  export default CheckboxGroup;
@@ -27,6 +27,7 @@ import { scalingVariants } from '../../../lib/constants';
27
27
  import { cva } from 'class-variance-authority';
28
28
  import { cn } from '../../../lib/utils/utils';
29
29
  import { chartAlphaColorList, chartColorList } from '../../../lib/color/constants';
30
+ import { useDarkMode } from '../../../lib/utils/useDarkMode';
30
31
  ChartJS.register(CategoryScale, LinearScale, LineElement, PointElement, Tooltip, Legend);
31
32
  var lineChartVariants = cva('', {
32
33
  variants: {
@@ -38,6 +39,7 @@ var lineChartVariants = cva('', {
38
39
  });
39
40
  var LineChart = function (_a) {
40
41
  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"]);
42
+ var _d = useDarkMode(), isDark = _d[0], defaultScales = _d[1];
41
43
  var colorset = isColorMixed ? chartColorList.mixed : chartColorList.sorting;
42
44
  var colorAlphaset = isColorMixed ? chartAlphaColorList.mixed : chartAlphaColorList.sorting;
43
45
  datasets.forEach(function (dataset, index) {
@@ -52,7 +54,7 @@ var LineChart = function (_a) {
52
54
  legend: legend,
53
55
  },
54
56
  indexAxis: indexAxis,
55
- scales: scales,
57
+ scales: __assign(__assign({}, defaultScales.linescale), scales),
56
58
  }, className: cn(lineChartVariants({ scaling: scaling }), className), width: width, height: height }, props)));
57
59
  };
58
60
  LineChart.displayName = 'LineChart';
@@ -1,2 +1,5 @@
1
1
  import React from 'react';
2
- export declare const MenubarMenu: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<never>>;
2
+ import * as MenubarPrimitive from '@radix-ui/react-menubar';
3
+ export declare const MenubarMenu: React.ForwardRefExoticComponent<MenubarPrimitive.MenubarMenuProps & {
4
+ __scopeMenubar?: import("@radix-ui/react-context").Scope;
5
+ } & React.RefAttributes<never>>;
@@ -54,7 +54,7 @@ export var useMenubarContext = function () {
54
54
  export var MenubarRoot = forwardRef(function (_a, ref) {
55
55
  var children = _a.children, className = _a.className, radius = _a.radius, scaling = _a.scaling, size = _a.size, _b = _a.color, color = _b === void 0 ? 'red' : _b, _c = _a.appearance, appearance = _c === void 0 ? 'ghost' : _c, _d = _a.itemAppearance, itemAppearance = _d === void 0 ? 'solid' : _d, props = __rest(_a, ["children", "className", "radius", "scaling", "size", "color", "appearance", "itemAppearance"]);
56
56
  var contextValue = useMemo(function () { return ({ radius: radius, size: size, scaling: scaling, color: color, appearance: appearance, itemAppearance: itemAppearance }); }, [radius, size, scaling, color, appearance, itemAppearance]);
57
- var menuClassName = cn(menubarVariants({ radius: radius, scaling: scaling, size: size }), appearance === 'solid' && "bg-".concat(color, "-9 dark:bg-$").concat(color, "Dark-9"), 'w-fit', className);
57
+ var menuClassName = cn(menubarVariants({ radius: radius, scaling: scaling, size: size }), appearance === 'solid' && "bg-".concat(color, "-9 dark:bg-$").concat(color, "Dark-9"), className);
58
58
  return (_jsx(MenubarContext.Provider, { value: contextValue, children: _jsx(MenubarPrimitive.Root, __assign({ ref: ref, className: menuClassName }, props, { children: children })) }));
59
59
  });
60
60
  MenubarRoot.displayName = 'Menubar.Root';
@@ -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<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<never>>;
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("absolute top-0 left-0 w-full sm:w-auto\n data-[motion=from-start]:animate-enterFromLeft \n data-[motion=from-end]:animate-enterFromRight \n data-[motion=to-start]:animate-exitToLeft \n data-[motion=to-end]:animate-exitToRight", navigationMenuContentVariants({ radius: radius, size: size }), className) }, props, { children: children })));
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: "flex z-[1] top-full h-[10px] items-end justify-center overflow-hidden\n data-[state=visible]:animate-fadeIn data-[state=hidden]:animate-fadeOut \n transition-[width,transform_250ms_ease]" }, props, { children: [_jsx("div", { className: cn("relative top-[70%] h-[10px] w-[10px] rotate-[45deg] rounded-tl-[2px] \n bg-white dark:bg-slateDark-2 shadow-slate-4 shadow dark:shadow-slateDark-4", className) }), children] })));
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 items-center p-1 space-x-1 shadow-slate-4 shadow dark:shadow-slateDark-4 bg-white dark:bg-slateDark-1', {
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('flex relative z-[1] w-screen justify-center', className) }, props, { children: children })) }));
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 left-0 flex w-full justify-center ", children: _jsx(NavigationMenuPrimitive.Viewport, __assign({ ref: ref, className: viewportClassName }, props)) }));
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,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<ProgressPrimitive.ProgressProps & React.RefAttributes<HTMLDivElement>, "ref"> & ProgressProps & React.RefAttributes<HTMLDivElement>>;
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, bgColorStyle } from '../../../lib/constants';
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, children = _a.children, 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", "children", "radius", "size", "value", "appearance", "color", "scaling"]);
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 { PointStyle } from '../../../lib/types';
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
- labels?: string[];
5
- datasets: {
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, labels, datasets, width, height, scaling, isColorMixed, ...props }: RadarChartProps): import("react/jsx-runtime").JSX.Element;
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;