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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +133 -89
  2. package/dist/globals.css +4 -4
  3. package/dist/lib/Typography/Text/index.js +1 -1
  4. package/dist/lib/color/dark.js +1 -1
  5. package/dist/lib/color/light.js +3 -3
  6. package/dist/lib/components/AlertDialog/AlertDialogAction.js +5 -5
  7. package/dist/lib/components/AlertDialog/AlertDialogCancel.js +5 -5
  8. package/dist/lib/components/AlertDialog/AlertDialogTrigger.js +1 -1
  9. package/dist/lib/components/Avatar/index.d.ts +1 -0
  10. package/dist/lib/components/Avatar/index.js +2 -2
  11. package/dist/lib/components/Badge/index.js +1 -1
  12. package/dist/lib/components/BarChart/index.d.ts +13 -57
  13. package/dist/lib/components/BarChart/index.js +3 -0
  14. package/dist/lib/components/BubbleChart/index.d.ts +15 -22
  15. package/dist/lib/components/BubbleChart/index.js +34 -15
  16. package/dist/lib/components/Callout/CalloutIcon.d.ts +2 -1
  17. package/dist/lib/components/Callout/CalloutRoot.js +4 -4
  18. package/dist/lib/components/Callout/CalloutText.js +1 -1
  19. package/dist/lib/components/Callout/index.d.ts +1 -1
  20. package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.d.ts +2 -1
  21. package/dist/lib/components/CheckboxGroup/index.d.ts +1 -1
  22. package/dist/lib/components/DoughnutChart/index.d.ts +12 -15
  23. package/dist/lib/components/DoughnutChart/index.js +10 -3
  24. package/dist/lib/components/LineChart/index.d.ts +9 -53
  25. package/dist/lib/components/LineChart/index.js +3 -1
  26. package/dist/lib/components/Menubar/MenubarMenu.d.ts +4 -1
  27. package/dist/lib/components/Menubar/MenubarRoot.js +1 -1
  28. package/dist/lib/components/Menubar/MenubarTrigger.js +1 -1
  29. package/dist/lib/components/Menubar/index.d.ts +3 -1
  30. package/dist/lib/components/NavigationMenu/NavigationMenuContent.js +2 -2
  31. package/dist/lib/components/NavigationMenu/NavigationMenuIndicator.js +1 -1
  32. package/dist/lib/components/NavigationMenu/NavigationMenuList.js +1 -1
  33. package/dist/lib/components/NavigationMenu/NavigationMenuRoot.js +1 -1
  34. package/dist/lib/components/NavigationMenu/NavigationMenuViewport.js +1 -1
  35. package/dist/lib/components/PieChart/index.d.ts +12 -15
  36. package/dist/lib/components/PieChart/index.js +9 -2
  37. package/dist/lib/components/Progress/index.d.ts +1 -4
  38. package/dist/lib/components/Progress/index.js +2 -3
  39. package/dist/lib/components/RadarChart/index.d.ts +19 -26
  40. package/dist/lib/components/RadarChart/index.js +37 -15
  41. package/dist/lib/components/Radio/index.d.ts +0 -1
  42. package/dist/lib/components/Radio/index.js +3 -1
  43. package/dist/lib/components/RadioCards/RadioCardsItem.js +1 -1
  44. package/dist/lib/components/RadioCards/RadioCardsRoot.d.ts +0 -1
  45. package/dist/lib/components/RadioGroup/RadioGroupRoot.d.ts +0 -1
  46. package/dist/lib/components/Select/index.js +1 -1
  47. package/dist/lib/components/Toggle/ToggleWithText.d.ts +1 -1
  48. package/dist/lib/components/Toggle/ToggleWithText.js +1 -0
  49. package/dist/lib/components/ToggleSwitch/index.js +1 -1
  50. package/dist/lib/components/Tooltip/index.d.ts +0 -1
  51. package/dist/lib/components/Tooltip/index.js +3 -4
  52. package/dist/lib/components/index.d.ts +1 -0
  53. package/dist/lib/components/index.js +1 -0
  54. package/dist/lib/constants.d.ts +151 -0
  55. package/dist/lib/constants.js +111 -4
  56. package/dist/lib/types.d.ts +70 -0
  57. package/dist/lib/utils/useDarkMode.d.ts +1 -0
  58. package/dist/lib/utils/useDarkMode.js +49 -0
  59. package/dist/tailwind.config.js +2 -5
  60. package/package.json +131 -131
@@ -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(),
@@ -63,7 +63,7 @@ export var redDark = {
63
63
  6: '#72232d',
64
64
  7: '#8c333a',
65
65
  8: '#b54548',
66
- 9: '#e5484d',
66
+ 9: '#da291c',
67
67
  10: '#ec5d5e',
68
68
  11: '#ff9592',
69
69
  12: '#ffd1d9',
@@ -64,9 +64,9 @@ export var red = {
64
64
  6: '#fdbdbe',
65
65
  7: '#f4a9aa',
66
66
  8: '#eb8e90',
67
- 9: '#e5484d',
68
- 10: '#dc3e42',
69
- 11: '#ce2c31',
67
+ 9: '#da291c',
68
+ 10: '#b52217',
69
+ 11: '#881a11',
70
70
  12: '#641723',
71
71
  };
72
72
  export var ruby = {
@@ -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 object-cover border-none", 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: {
@@ -1,71 +1,27 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
- import { PointStyle } from '../../../lib/types';
2
+ import { IChartDatasets, IChartLegend, IChartTitle } from '../../../lib/types';
3
3
  export interface BorderRadius {
4
4
  topLeft: number;
5
5
  topRight: number;
6
6
  bottomLeft: number;
7
7
  bottomRight: number;
8
8
  }
9
+ type IBarchartDataset = IChartDatasets & {
10
+ data: {
11
+ x: number;
12
+ y: number;
13
+ r: number;
14
+ }[];
15
+ barThickness?: number;
16
+ barPercentage?: number;
17
+ };
9
18
  export interface BarChartProps extends VariantProps<typeof barChartVariants> {
10
19
  labels?: string[];
11
20
  isColorMixed?: boolean;
12
21
  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: {
55
- x: number;
56
- y: number;
57
- r: number;
58
- }[];
59
- backgroundColor?: string[];
60
- borderColor?: string[];
61
- borderWidth?: number;
62
- hoverBackgroundColor?: string;
63
- hoverBorderColor?: string;
64
- hoverBorderWidth?: number;
65
- pointStyle?: PointStyle;
66
- barThickness?: number;
67
- barPercentage?: number;
68
- }[];
22
+ title?: IChartTitle;
23
+ legend?: IChartLegend;
24
+ datasets: IBarchartDataset[];
69
25
  indexAxis?: 'x' | 'y';
70
26
  className?: string;
71
27
  width?: string | number;
@@ -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;
@@ -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 DoughnutChartProps extends VariantProps<typeof doughnutVariants> {
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 doughnutVariants: (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 DoughnutChart: ({ labels, datasets, scaling, className, appearance, isColorMixed, ...rest }: DoughnutChartProps) => import("react/jsx-runtime").JSX.Element;
18
+ declare const DoughnutChart: {
19
+ ({ labels, title, legend, datasets, datalabels, scaling, className, appearance, isColorMixed, ...rest }: DoughnutChartProps): import("react/jsx-runtime").JSX.Element;
20
+ displayName: string;
21
+ };
25
22
  export default DoughnutChart;
@@ -22,7 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
24
  import { Doughnut } from 'react-chartjs-2';
25
- import { Chart as ChartJS, ArcElement, Tooltip, Legend, plugins } from 'chart.js';
25
+ import { Chart as ChartJS, ArcElement, Tooltip, Legend, plugins } from 'chart.js/auto';
26
26
  import ChartDataLabels from 'chartjs-plugin-datalabels';
27
27
  import { cn } from '../../../lib/utils/utils';
28
28
  import { cva } from 'class-variance-authority';
@@ -41,7 +41,7 @@ var doughnutVariants = cva('', {
41
41
  },
42
42
  });
43
43
  var DoughnutChart = 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 DoughnutChart = 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(Doughnut, __assign({ data: { labels: labels, datasets: datasets }, className: cn(doughnutVariants({ scaling: scaling }), className) }, rest)));
56
+ return (_jsx(Doughnut, __assign({ data: { labels: labels, datasets: datasets }, options: {
57
+ plugins: {
58
+ title: title,
59
+ legend: legend,
60
+ datalabels: datalabels,
61
+ },
62
+ }, className: cn(doughnutVariants({ scaling: scaling }), className) }, rest)));
57
63
  };
64
+ DoughnutChart.displayName = 'DoughnutChart';
58
65
  export default DoughnutChart;
@@ -1,67 +1,23 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
- import { PointStyle } from '../../../lib/types';
2
+ import { IChartDatasets, IChartLegend, IChartTitle } from '../../../lib/types';
3
3
  export interface BorderRadius {
4
4
  topLeft: number;
5
5
  topRight: number;
6
6
  bottomLeft: number;
7
7
  bottomRight: number;
8
8
  }
9
+ type ILinechartDataset = IChartDatasets & {
10
+ data: any;
11
+ barThickness?: number;
12
+ barPercentage?: number;
13
+ };
9
14
  export interface LineChartProps extends VariantProps<typeof lineChartVariants> {
10
15
  labels?: string[];
11
16
  isColorMixed?: boolean;
12
17
  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
- }[];
18
+ title?: IChartTitle;
19
+ legend?: IChartLegend;
20
+ datasets: ILinechartDataset[];
65
21
  scales?: {
66
22
  x?: {
67
23
  min?: number;
@@ -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';