@lotte-innovate/ui-component-test 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
package/dist/globals.css CHANGED
@@ -33607,10 +33607,6 @@ video {
33607
33607
  height: 36px;
33608
33608
  }
33609
33609
 
33610
- .h-\[400px\] {
33611
- height: 400px;
33612
- }
33613
-
33614
33610
  .h-\[40px\] {
33615
33611
  height: 40px;
33616
33612
  }
@@ -18,3 +18,12 @@ export declare const alphaOptions: {
18
18
  };
19
19
  export declare const ColorStyle: Record<string, string>;
20
20
  export declare const DarkColorStyle: Record<string, string>;
21
+ export declare const chartColorList: {
22
+ sorting: string[];
23
+ mixed: string[];
24
+ };
25
+ export declare const chartAlphaColorList: {
26
+ sorting: string[];
27
+ mixed: string[];
28
+ };
29
+ export declare const chartColorOptions: IColor[];
@@ -1,3 +1,5 @@
1
+ import { blue, crimson, teal, orange, purple, amber, slate, cyan, red, grass, brown, indigo, plum, yellow, sky, lime, } from './light';
2
+ import { blueA, crimsonA, tealA, orangeA, purpleA, amberA, slateA, cyanA, redA, grassA, brownA, indigoA, plumA, yellowA, skyA, limeA, } from './alpha';
1
3
  export var colorOptions = [
2
4
  // 'black',
3
5
  'slate',
@@ -198,3 +200,97 @@ export var DarkColorStyle = {
198
200
  amberDark: 'amberDark-9',
199
201
  orangeDark: 'orangeDark-9',
200
202
  };
203
+ export var chartColorList = {
204
+ sorting: [
205
+ crimson[9],
206
+ orange[9],
207
+ amber[9],
208
+ teal[9],
209
+ blue[9],
210
+ purple[9],
211
+ slate[9],
212
+ red[9],
213
+ brown[9],
214
+ yellow[9],
215
+ lime[9],
216
+ grass[9],
217
+ sky[9],
218
+ cyan[9],
219
+ indigo[9],
220
+ plum[9],
221
+ ],
222
+ mixed: [
223
+ blue[9],
224
+ crimson[9],
225
+ teal[9],
226
+ orange[9],
227
+ purple[9],
228
+ amber[9],
229
+ slate[9],
230
+ cyan[9],
231
+ red[9],
232
+ grass[9],
233
+ brown[9],
234
+ indigo[9],
235
+ plum[9],
236
+ yellow[9],
237
+ sky[9],
238
+ lime[9],
239
+ ],
240
+ };
241
+ export var chartAlphaColorList = {
242
+ sorting: [
243
+ crimsonA[2],
244
+ orangeA[2],
245
+ amberA[2],
246
+ tealA[2],
247
+ blueA[2],
248
+ purpleA[2],
249
+ slateA[2],
250
+ redA[2],
251
+ brownA[2],
252
+ yellowA[2],
253
+ limeA[2],
254
+ grassA[2],
255
+ skyA[2],
256
+ cyanA[2],
257
+ indigoA[2],
258
+ plumA[2],
259
+ ],
260
+ mixed: [
261
+ blueA[2],
262
+ crimsonA[2],
263
+ tealA[2],
264
+ orangeA[2],
265
+ purpleA[2],
266
+ amberA[2],
267
+ slateA[2],
268
+ cyanA[2],
269
+ redA[2],
270
+ grassA[2],
271
+ brownA[2],
272
+ indigoA[2],
273
+ plumA[2],
274
+ yellowA[2],
275
+ skyA[2],
276
+ limeA[2],
277
+ ],
278
+ };
279
+ export var chartColorOptions = [
280
+ 'blue',
281
+ 'crimson',
282
+ 'teal',
283
+ 'orange',
284
+ 'purple',
285
+ 'amber',
286
+ 'slate',
287
+ 'cyan',
288
+ 'red',
289
+ 'grass',
290
+ 'brown',
291
+ 'indigo',
292
+ 'plum',
293
+ 'yellow',
294
+ 'sky',
295
+ 'lime',
296
+ ];
@@ -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 { radiusVariants, weightVariants, primaryColorStyle, appearanceStyle, scalingVariants, } from '../../../lib/constants';
28
- var buttonVariants = cva("inline-flex items-center transition-colors focus:outline-none hover:cursor-pointer\n disabled:cursor-not-allowed disabled:bg-slate-3 disabled:text-slate-8 justify-center", {
28
+ var buttonVariants = cva("inline-flex items-center w-fit transition-colors focus:outline-none hover:cursor-pointer\n disabled:cursor-not-allowed disabled:bg-slate-3 disabled:text-slate-8 justify-center", {
29
29
  variants: {
30
30
  radius: __assign({}, radiusVariants['base']),
31
31
  size: {
@@ -27,7 +27,7 @@ import Checkbox from '../../../lib/components/Checkbox';
27
27
  import { Label } from '../../../lib/components/Label';
28
28
  import { cn } from '../../../lib/utils/utils';
29
29
  import { scalingVariants } from '../../../lib/constants';
30
- export var CheckboxCardVariants = cva("flex justify-between space-x-2 min-w-[200px] border border-slate-7 text-slate-12\n hover:border-slate-8 hover:cursor-pointer aria-disabled:bg-slate-3 aria-disabled:cursor-not-allowed aria-disabled:text-slateA-9\n dark:border-slateDark-6 dark:text-slateDark-12 dark:hover:border-slateDark-7\n dark:aria-disabled:bg-slateDark-3 dark:aria-disabled:text-slateDarkA-8", {
30
+ export var CheckboxCardVariants = cva("flex justify-between space-x-2 w-fit min-w-[200px] border border-slate-7 text-slate-12\n hover:border-slate-8 hover:cursor-pointer aria-disabled:bg-slate-3 aria-disabled:cursor-not-allowed aria-disabled:text-slateA-9\n dark:border-slateDark-6 dark:text-slateDark-12 dark:hover:border-slateDark-7\n dark:aria-disabled:bg-slateDark-3 dark:aria-disabled:text-slateDarkA-8", {
31
31
  variants: {
32
32
  radius: {
33
33
  none: 'rounded-none',
@@ -26,6 +26,6 @@ import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
26
26
  import { cn } from '../../../lib/utils/utils';
27
27
  export var ContextMenuTrigger = forwardRef(function (_a, ref) {
28
28
  var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
29
- return (_jsx(ContextMenuPrimitive.Trigger, __assign({ ref: ref, className: cn("block border-2 border-dashed text-slate-12 dark:text-slateDark-12 rounded text-base \n select-none py-[45px] w-[300px] text-center", className) }, props, { children: children })));
29
+ return (_jsx(ContextMenuPrimitive.Trigger, __assign({ ref: ref, className: cn("flex text-slate-12 dark:text-slateDark-12 text-base text-center", className) }, props, { children: children })));
30
30
  });
31
31
  ContextMenuTrigger.displayName = 'ContextMenuTrigger';
@@ -4,7 +4,7 @@ export interface DoughnutChartProps extends VariantProps<typeof doughnutVariants
4
4
  datasets: {
5
5
  label?: string;
6
6
  data: number[];
7
- backgroundColor: string[];
7
+ backgroundColor?: string[];
8
8
  borderColor?: string[];
9
9
  borderWidth?: number;
10
10
  borderDash?: number[];
@@ -15,9 +15,11 @@ export interface DoughnutChartProps extends VariantProps<typeof doughnutVariants
15
15
  }[];
16
16
  options?: {};
17
17
  className?: string;
18
+ appearance?: 'solid' | 'soft';
19
+ isColorMixed?: boolean;
18
20
  }
19
21
  declare const doughnutVariants: (props?: ({
20
22
  scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
21
23
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
22
- declare const DoughnutChart: ({ labels, datasets, scaling, className, ...rest }: DoughnutChartProps) => import("react/jsx-runtime").JSX.Element;
24
+ declare const DoughnutChart: ({ labels, datasets, scaling, className, appearance, isColorMixed, ...rest }: DoughnutChartProps) => import("react/jsx-runtime").JSX.Element;
23
25
  export default DoughnutChart;
@@ -27,6 +27,7 @@ import ChartDataLabels from 'chartjs-plugin-datalabels';
27
27
  import { cn } from '../../../lib/utils/utils';
28
28
  import { cva } from 'class-variance-authority';
29
29
  import { scalingVariants } from '../../../lib/constants';
30
+ import { chartColorList, chartAlphaColorList } from '../../../lib/color/constants';
30
31
  ChartJS.register(ArcElement, Tooltip, Legend, plugins, ChartDataLabels);
31
32
  ChartJS.defaults.set('plugins.datalabels', {
32
33
  display: false,
@@ -40,7 +41,27 @@ var doughnutVariants = cva('', {
40
41
  },
41
42
  });
42
43
  var DoughnutChart = function (_a) {
43
- var labels = _a.labels, datasets = _a.datasets, scaling = _a.scaling, className = _a.className, rest = __rest(_a, ["labels", "datasets", "scaling", "className"]);
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"]);
45
+ if (appearance === 'solid') {
46
+ if (isColorMixed) {
47
+ datasets[0].backgroundColor = chartColorList.mixed;
48
+ datasets[0].borderColor = chartColorList.mixed;
49
+ }
50
+ else {
51
+ datasets[0].backgroundColor = chartColorList.sorting;
52
+ datasets[0].borderColor = chartColorList.sorting;
53
+ }
54
+ }
55
+ if (appearance === 'soft') {
56
+ if (isColorMixed) {
57
+ datasets[0].backgroundColor = chartAlphaColorList.mixed;
58
+ datasets[0].borderColor = chartColorList.mixed;
59
+ }
60
+ else {
61
+ datasets[0].backgroundColor = chartAlphaColorList.sorting;
62
+ datasets[0].borderColor = chartColorList.sorting;
63
+ }
64
+ }
44
65
  return (_jsx(Doughnut, __assign({ data: { labels: labels, datasets: datasets }, className: cn(doughnutVariants({ scaling: scaling }), className) }, rest)));
45
66
  };
46
67
  export default DoughnutChart;
@@ -27,7 +27,7 @@ import { cva } from 'class-variance-authority';
27
27
  import { cn } from '../../../lib/utils/utils';
28
28
  import { scalingVariants } from '../../../lib/constants';
29
29
  import { useMenubarContext } from '.';
30
- export var menubarContentVariants = cva("p-[5px] bg-white dark:bg-slateDark-1 will-change-[transform,opacity]\n shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),_0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)] \n [animation-duration:_400ms] [animation-timing-function:_cubic-bezier(0.16,_1,_0.3,_1)]", {
30
+ export var menubarContentVariants = cva("p-[5px] w-fit bg-white dark:bg-slateDark-1 will-change-[transform,opacity]\n shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),_0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)] \n [animation-duration:_400ms] [animation-timing-function:_cubic-bezier(0.16,_1,_0.3,_1)]", {
31
31
  variants: {
32
32
  radius: {
33
33
  none: 'rounded-none',
@@ -27,7 +27,7 @@ import { cva } from 'class-variance-authority';
27
27
  import { cn } from '../../../lib/utils/utils';
28
28
  import { radiusVariants } from '../../../lib/constants';
29
29
  import { useMenubarContext } from '.';
30
- export var menubarSubContentVariants = cva("p-[5px] bg-white dark:bg-slateDark-1 will-change-[transform,opacity]\n shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),_0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)] \n [animation-duration:_400ms] [animation-timing-function:_cubic-bezier(0.16,_1,_0.3,_1)]", {
30
+ export var menubarSubContentVariants = cva("p-[5px] w-fit bg-white dark:bg-slateDark-1 will-change-[transform,opacity]\n shadow-[0px_10px_38px_-10px_rgba(22,_23,_24,_0.35),_0px_10px_20px_-15px_rgba(22,_23,_24,_0.2)] \n [animation-duration:_400ms] [animation-timing-function:_cubic-bezier(0.16,_1,_0.3,_1)]", {
31
31
  variants: {
32
32
  radius: __assign({}, radiusVariants['extra-large']),
33
33
  size: {
@@ -66,7 +66,7 @@ export var useMenubarContext = function () {
66
66
  export var Menubar = forwardRef(function (_a, ref) {
67
67
  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"]);
68
68
  var contextValue = { radius: radius, size: size, scaling: scaling, color: color, appearance: appearance, itemAppearance: itemAppearance };
69
- var menuClassName = cn(menubarVariants({ radius: radius, scaling: scaling, size: size }), appearance === 'solid' && "bg-".concat(color, "-9 dark:bg-$").concat(color, "Dark-9"), className);
69
+ 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);
70
70
  return (_jsx(MenubarContext.Provider, { value: contextValue, children: _jsx(MenubarPrimitive.Root, __assign({ ref: ref, className: menuClassName }, props, { children: children })) }));
71
71
  });
72
72
  Menubar.displayName = 'Menubar';
@@ -4,7 +4,7 @@ export interface PieChartProps extends VariantProps<typeof PieVariants> {
4
4
  datasets: {
5
5
  label?: string;
6
6
  data: number[];
7
- backgroundColor: string[];
7
+ backgroundColor?: string[];
8
8
  borderColor?: string[];
9
9
  borderWidth?: number;
10
10
  borderDash?: number[];
@@ -15,9 +15,11 @@ export interface PieChartProps extends VariantProps<typeof PieVariants> {
15
15
  }[];
16
16
  options?: {};
17
17
  className?: string;
18
+ appearance?: 'solid' | 'soft';
19
+ isColorMixed?: boolean;
18
20
  }
19
21
  declare const PieVariants: (props?: ({
20
22
  scaling?: "90%" | "95%" | "100%" | "105%" | "110%" | null | undefined;
21
23
  } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
22
- declare const PieChart: ({ labels, datasets, scaling, className, ...rest }: PieChartProps) => import("react/jsx-runtime").JSX.Element;
24
+ declare const PieChart: ({ labels, datasets, scaling, className, appearance, isColorMixed, ...rest }: PieChartProps) => import("react/jsx-runtime").JSX.Element;
23
25
  export default PieChart;
@@ -27,6 +27,7 @@ import ChartDataLabels from 'chartjs-plugin-datalabels';
27
27
  import { cn } from '../../../lib/utils/utils';
28
28
  import { cva } from 'class-variance-authority';
29
29
  import { scalingVariants } from '../../../lib/constants';
30
+ import { chartColorList, chartAlphaColorList } from '../../../lib/color/constants';
30
31
  ChartJS.register(ArcElement, Tooltip, Legend, plugins, ChartDataLabels);
31
32
  ChartJS.defaults.set('plugins.datalabels', {
32
33
  display: false,
@@ -40,7 +41,27 @@ var PieVariants = cva('', {
40
41
  },
41
42
  });
42
43
  var PieChart = function (_a) {
43
- var labels = _a.labels, datasets = _a.datasets, scaling = _a.scaling, className = _a.className, rest = __rest(_a, ["labels", "datasets", "scaling", "className"]);
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"]);
45
+ if (appearance === 'solid') {
46
+ if (isColorMixed) {
47
+ datasets[0].backgroundColor = chartColorList.mixed;
48
+ datasets[0].borderColor = chartColorList.mixed;
49
+ }
50
+ else {
51
+ datasets[0].backgroundColor = chartColorList.sorting;
52
+ datasets[0].borderColor = chartColorList.sorting;
53
+ }
54
+ }
55
+ if (appearance === 'soft') {
56
+ if (isColorMixed) {
57
+ datasets[0].backgroundColor = chartAlphaColorList.mixed;
58
+ datasets[0].borderColor = chartColorList.mixed;
59
+ }
60
+ else {
61
+ datasets[0].backgroundColor = chartAlphaColorList.sorting;
62
+ datasets[0].borderColor = chartColorList.sorting;
63
+ }
64
+ }
44
65
  return (_jsx(Pie, __assign({ data: { labels: labels, datasets: datasets }, className: cn(PieVariants({ scaling: scaling }), className) }, rest)));
45
66
  };
46
67
  export default PieChart;
@@ -7,6 +7,7 @@ export declare const weightOptions: IWeight[];
7
7
  export declare const themeOptions: ITheme[];
8
8
  export declare const appearanceOptions: IAppearance[];
9
9
  export declare const labelPositionList: string[];
10
+ export declare const pointStyleList: (string | boolean)[];
10
11
  export declare const radiusVariants: {
11
12
  small: {
12
13
  none: string;
@@ -174,6 +175,7 @@ export declare const commonArgTypes: {
174
175
  };
175
176
  };
176
177
  export declare const blackText: string[];
178
+ export declare const chartColorStyle: () => Record<string, string>;
177
179
  export declare const primaryColorStyle: () => Record<string, string>;
178
180
  export declare const bgColorStyle: () => Record<string, string>;
179
181
  export declare const textColorStyle: () => Record<string, string>;
@@ -1,4 +1,5 @@
1
- import { ColorStyle, DarkColorStyle, colorOptions } from '../lib/color/constants';
1
+ import { ColorStyle, DarkColorStyle, colorOptions, chartColorOptions } from '../lib/color/constants';
2
+ import * as lightColors from '../lib/color/light';
2
3
  export var radiusOptions = ['none', 'small', 'medium', 'large', 'full'];
3
4
  export var typoSizeOptions = ['1', '2', '3', '4', '5', '6', '7', '8', '9'];
4
5
  export var scalingOptions = ['90%', '95%', '100%', '105%', '110%'];
@@ -13,8 +14,21 @@ export var appearanceOptions = [
13
14
  'solid',
14
15
  'surface',
15
16
  ];
16
- //차트 label 위치
17
+ //차트
17
18
  export var labelPositionList = ['top', 'bottom', 'left', 'right'];
19
+ export var pointStyleList = [
20
+ 'circle',
21
+ 'cross',
22
+ 'crossRot',
23
+ 'dash',
24
+ 'line',
25
+ 'rect',
26
+ 'rectRounded',
27
+ 'rectRot',
28
+ 'star',
29
+ 'triangle',
30
+ false,
31
+ ];
18
32
  export var radiusVariants = {
19
33
  // 체크박스
20
34
  small: {
@@ -144,6 +158,14 @@ export var commonArgTypes = {
144
158
  },
145
159
  };
146
160
  export var blackText = ['sky', 'mint', 'lime', 'yellow', 'amber', 'orange', 'white'];
161
+ export var chartColorStyle = function () {
162
+ var colorValues = lightColors;
163
+ var colorMappings = {};
164
+ chartColorOptions.forEach(function (color) {
165
+ colorMappings[color] = colorValues[color][9];
166
+ });
167
+ return colorMappings;
168
+ };
147
169
  export var primaryColorStyle = function () {
148
170
  var color = {};
149
171
  for (var i in ColorStyle) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lotte-innovate/ui-component-test",
3
3
  "description": "Lotte UI Library",
4
- "version": "0.1.12",
4
+ "version": "0.1.13",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "files": [