@lotte-innovate/ui-component-test 0.1.33 → 0.1.35
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +133 -89
- package/dist/globals.css +4 -4
- package/dist/lib/Typography/Text/index.js +1 -1
- package/dist/lib/color/dark.js +1 -1
- package/dist/lib/color/light.js +3 -3
- package/dist/lib/components/AlertDialog/AlertDialogAction.js +5 -5
- package/dist/lib/components/AlertDialog/AlertDialogCancel.js +5 -5
- package/dist/lib/components/AlertDialog/AlertDialogTrigger.js +1 -1
- package/dist/lib/components/Avatar/index.d.ts +1 -0
- package/dist/lib/components/Avatar/index.js +2 -2
- package/dist/lib/components/Badge/index.js +1 -1
- package/dist/lib/components/BarChart/index.d.ts +13 -57
- package/dist/lib/components/BarChart/index.js +3 -0
- package/dist/lib/components/BubbleChart/index.d.ts +15 -22
- package/dist/lib/components/BubbleChart/index.js +34 -15
- package/dist/lib/components/Callout/CalloutIcon.d.ts +2 -1
- package/dist/lib/components/Callout/CalloutRoot.js +4 -4
- package/dist/lib/components/Callout/CalloutText.js +1 -1
- package/dist/lib/components/Callout/index.d.ts +1 -1
- package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.d.ts +2 -1
- package/dist/lib/components/CheckboxGroup/index.d.ts +1 -1
- package/dist/lib/components/DoughnutChart/index.d.ts +12 -15
- package/dist/lib/components/DoughnutChart/index.js +10 -3
- package/dist/lib/components/LineChart/index.d.ts +9 -53
- package/dist/lib/components/LineChart/index.js +3 -1
- package/dist/lib/components/Menubar/MenubarMenu.d.ts +4 -1
- package/dist/lib/components/Menubar/MenubarRoot.js +1 -1
- package/dist/lib/components/Menubar/MenubarTrigger.js +1 -1
- package/dist/lib/components/Menubar/index.d.ts +3 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuContent.js +2 -2
- package/dist/lib/components/NavigationMenu/NavigationMenuIndicator.js +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuList.js +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuRoot.js +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuViewport.js +1 -1
- package/dist/lib/components/PieChart/index.d.ts +12 -15
- package/dist/lib/components/PieChart/index.js +9 -2
- package/dist/lib/components/Progress/index.d.ts +1 -4
- package/dist/lib/components/Progress/index.js +2 -3
- package/dist/lib/components/RadarChart/index.d.ts +19 -26
- package/dist/lib/components/RadarChart/index.js +37 -15
- package/dist/lib/components/Radio/index.d.ts +0 -1
- package/dist/lib/components/Radio/index.js +3 -1
- package/dist/lib/components/RadioCards/RadioCardsItem.js +1 -1
- package/dist/lib/components/RadioCards/RadioCardsRoot.d.ts +0 -1
- package/dist/lib/components/RadioGroup/RadioGroupRoot.d.ts +0 -1
- package/dist/lib/components/Select/index.js +1 -1
- package/dist/lib/components/Toggle/ToggleWithText.d.ts +1 -1
- package/dist/lib/components/Toggle/ToggleWithText.js +1 -0
- package/dist/lib/components/ToggleSwitch/index.js +1 -1
- package/dist/lib/components/Tooltip/index.d.ts +0 -1
- package/dist/lib/components/Tooltip/index.js +3 -4
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/components/index.js +1 -0
- package/dist/lib/constants.d.ts +151 -0
- package/dist/lib/constants.js +111 -4
- package/dist/lib/types.d.ts +70 -0
- package/dist/lib/utils/useDarkMode.d.ts +1 -0
- package/dist/lib/utils/useDarkMode.js +49 -0
- package/dist/tailwind.config.js +2 -5
- package/package.json +131 -131
package/dist/lib/constants.d.ts
CHANGED
@@ -173,6 +173,52 @@ export declare const commonArgTypes: {
|
|
173
173
|
summary: string;
|
174
174
|
};
|
175
175
|
};
|
176
|
+
isColorMixed: {
|
177
|
+
table: {
|
178
|
+
category: string;
|
179
|
+
type: {
|
180
|
+
summary: string;
|
181
|
+
};
|
182
|
+
};
|
183
|
+
description: string;
|
184
|
+
control: string;
|
185
|
+
defaultValue: {
|
186
|
+
summary: string;
|
187
|
+
};
|
188
|
+
};
|
189
|
+
chartAppearance: {
|
190
|
+
table: {
|
191
|
+
category: string;
|
192
|
+
type: {
|
193
|
+
summary: string;
|
194
|
+
};
|
195
|
+
};
|
196
|
+
options: string[];
|
197
|
+
control: string;
|
198
|
+
defaultValue: {
|
199
|
+
summary: string;
|
200
|
+
};
|
201
|
+
description: string;
|
202
|
+
};
|
203
|
+
datasets: {
|
204
|
+
name: string;
|
205
|
+
description: string;
|
206
|
+
table: {
|
207
|
+
category: string;
|
208
|
+
type: {
|
209
|
+
summary: string;
|
210
|
+
};
|
211
|
+
};
|
212
|
+
};
|
213
|
+
labels: {
|
214
|
+
description: string;
|
215
|
+
table: {
|
216
|
+
category: string;
|
217
|
+
type: {
|
218
|
+
summary: string;
|
219
|
+
};
|
220
|
+
};
|
221
|
+
};
|
176
222
|
};
|
177
223
|
export declare const chartColorStyle: () => Record<string, string>;
|
178
224
|
export declare const chartTitleArgTypes: {
|
@@ -381,6 +427,37 @@ export declare const chartLegendArgTypes: {
|
|
381
427
|
summary: string;
|
382
428
|
};
|
383
429
|
};
|
430
|
+
'legend.labels.usePointStyle': {
|
431
|
+
description: string;
|
432
|
+
table: {
|
433
|
+
category: string;
|
434
|
+
type: {
|
435
|
+
summary: string;
|
436
|
+
};
|
437
|
+
};
|
438
|
+
control: {
|
439
|
+
type: string;
|
440
|
+
};
|
441
|
+
defaultValue: {
|
442
|
+
summary: string;
|
443
|
+
};
|
444
|
+
};
|
445
|
+
'legend.labels.pointStyle': {
|
446
|
+
description: string;
|
447
|
+
table: {
|
448
|
+
category: string;
|
449
|
+
type: {
|
450
|
+
summary: string;
|
451
|
+
};
|
452
|
+
};
|
453
|
+
control: {
|
454
|
+
type: string;
|
455
|
+
};
|
456
|
+
options: (string | boolean)[];
|
457
|
+
defaultValue: {
|
458
|
+
summary: string;
|
459
|
+
};
|
460
|
+
};
|
384
461
|
};
|
385
462
|
export declare const chartDatasetsArgsTypes: {
|
386
463
|
'datasets[n].data': {
|
@@ -491,6 +568,80 @@ export declare const chartDatasetsArgsTypes: {
|
|
491
568
|
};
|
492
569
|
};
|
493
570
|
};
|
571
|
+
'datasets[n].borderDash': {
|
572
|
+
description: string;
|
573
|
+
table: {
|
574
|
+
category: string;
|
575
|
+
type: {
|
576
|
+
summary: string;
|
577
|
+
};
|
578
|
+
};
|
579
|
+
};
|
580
|
+
'datasets[n].borderDashOffset': {
|
581
|
+
description: string;
|
582
|
+
table: {
|
583
|
+
category: string;
|
584
|
+
type: {
|
585
|
+
summary: string;
|
586
|
+
};
|
587
|
+
};
|
588
|
+
};
|
589
|
+
'datasets[n].offset': {
|
590
|
+
description: string;
|
591
|
+
table: {
|
592
|
+
category: string;
|
593
|
+
type: {
|
594
|
+
summary: string;
|
595
|
+
};
|
596
|
+
};
|
597
|
+
};
|
598
|
+
'datasets[n].weight': {
|
599
|
+
description: string;
|
600
|
+
table: {
|
601
|
+
category: string;
|
602
|
+
type: {
|
603
|
+
summary: string;
|
604
|
+
};
|
605
|
+
};
|
606
|
+
};
|
607
|
+
};
|
608
|
+
export declare const chartDatalabelsArgsTypes: {
|
609
|
+
datalabels: {
|
610
|
+
table: {
|
611
|
+
disable: boolean;
|
612
|
+
};
|
613
|
+
};
|
614
|
+
'datalabels.display': {
|
615
|
+
description: string;
|
616
|
+
table: {
|
617
|
+
category: string;
|
618
|
+
type: {
|
619
|
+
summary: string;
|
620
|
+
};
|
621
|
+
};
|
622
|
+
control: {
|
623
|
+
type: string;
|
624
|
+
};
|
625
|
+
defaultValue: {
|
626
|
+
summary: boolean;
|
627
|
+
};
|
628
|
+
};
|
629
|
+
'datalabels.color': {
|
630
|
+
description: string;
|
631
|
+
table: {
|
632
|
+
category: string;
|
633
|
+
type: {
|
634
|
+
summary: string;
|
635
|
+
};
|
636
|
+
};
|
637
|
+
control: {
|
638
|
+
type: string;
|
639
|
+
};
|
640
|
+
options: string[];
|
641
|
+
defaultValue: {
|
642
|
+
summary: string;
|
643
|
+
};
|
644
|
+
};
|
494
645
|
};
|
495
646
|
export declare const blackText: string[];
|
496
647
|
export declare const primaryColorStyle: () => Record<string, string>;
|
package/dist/lib/constants.js
CHANGED
@@ -156,6 +156,40 @@ export var commonArgTypes = {
|
|
156
156
|
options: sizeOptions,
|
157
157
|
defaultValue: { summary: 'medium' },
|
158
158
|
},
|
159
|
+
isColorMixed: {
|
160
|
+
table: {
|
161
|
+
category: 'Props',
|
162
|
+
type: { summary: 'boolean' },
|
163
|
+
},
|
164
|
+
description: "- \uCC28\uD2B8 \uAE30\uBCF8 \uC0C9\uC0C1 \uC2A4\uD0C0\uC77C \n - true\uC778 \uACBD\uC6B0 \uC0C9\uC0C1\uC774 \uAD50\uCC28\uB428, false\uC778 \uACBD\uC6B0 \uC0C9\uC0C1 \uC21C\uCC28\uC801\uC73C\uB85C \uC0AC\uC6A9",
|
165
|
+
control: 'readonly',
|
166
|
+
defaultValue: { summary: 'true' },
|
167
|
+
},
|
168
|
+
chartAppearance: {
|
169
|
+
table: {
|
170
|
+
category: 'Props',
|
171
|
+
type: { summary: 'solid | soft' },
|
172
|
+
},
|
173
|
+
options: ['solid', 'soft'],
|
174
|
+
control: 'readonly',
|
175
|
+
defaultValue: { summary: 'solid' },
|
176
|
+
description: "- \uCC28\uD2B8 \uAE30\uBCF8 \uC0C9\uC0C1 \uC2A4\uD0C0\uC77C \n - \uBC30\uACBD\uC0C9\uACFC \uD14C\uB450\uB9AC\uC0C9 \uAE30\uBCF8 \uC2A4\uD0C0\uC77C\uC744 \uC9C0\uC815\uD574\uC900\uB2E4",
|
177
|
+
},
|
178
|
+
datasets: {
|
179
|
+
name: 'datasets',
|
180
|
+
description: '차트에 사용할 데이터셋',
|
181
|
+
table: {
|
182
|
+
category: 'Props',
|
183
|
+
type: { summary: 'object' },
|
184
|
+
},
|
185
|
+
},
|
186
|
+
labels: {
|
187
|
+
description: '차트 위에 표시될 라벨들',
|
188
|
+
table: {
|
189
|
+
category: 'Props',
|
190
|
+
type: { summary: 'object' },
|
191
|
+
},
|
192
|
+
},
|
159
193
|
};
|
160
194
|
export var chartColorStyle = function () {
|
161
195
|
var colorValues = lightColors;
|
@@ -167,7 +201,7 @@ export var chartColorStyle = function () {
|
|
167
201
|
};
|
168
202
|
export var chartTitleArgTypes = {
|
169
203
|
title: {
|
170
|
-
description: '
|
204
|
+
description: '차트 타이틀',
|
171
205
|
table: {
|
172
206
|
category: 'Props',
|
173
207
|
type: { summary: 'object' },
|
@@ -223,7 +257,7 @@ export var chartTitleArgTypes = {
|
|
223
257
|
};
|
224
258
|
export var chartLegendArgTypes = {
|
225
259
|
legend: {
|
226
|
-
description: '차트
|
260
|
+
description: '차트 범례',
|
227
261
|
table: {
|
228
262
|
category: 'Props',
|
229
263
|
type: { summary: 'object' },
|
@@ -246,7 +280,7 @@ export var chartLegendArgTypes = {
|
|
246
280
|
},
|
247
281
|
control: { type: 'select' },
|
248
282
|
options: ['start', 'center', 'end'],
|
249
|
-
defaultValue: { summary: '
|
283
|
+
defaultValue: { summary: 'center' },
|
250
284
|
},
|
251
285
|
'legend.position': {
|
252
286
|
description: '범례 위치',
|
@@ -283,7 +317,7 @@ export var chartLegendArgTypes = {
|
|
283
317
|
type: { summary: 'boolean' },
|
284
318
|
},
|
285
319
|
control: { type: 'boolean' },
|
286
|
-
defaultValue: { summary:
|
320
|
+
defaultValue: { summary: false },
|
287
321
|
},
|
288
322
|
'legend.title.text': {
|
289
323
|
description: '범례 타이틀 문구',
|
@@ -294,6 +328,25 @@ export var chartLegendArgTypes = {
|
|
294
328
|
control: { type: 'text' },
|
295
329
|
defaultValue: { summary: '' },
|
296
330
|
},
|
331
|
+
'legend.labels.usePointStyle': {
|
332
|
+
description: '범례 스타일 사용여부',
|
333
|
+
table: {
|
334
|
+
category: 'Legend Props',
|
335
|
+
type: { summary: 'boolean' },
|
336
|
+
},
|
337
|
+
control: { type: 'boolean' },
|
338
|
+
defaultValue: { summary: 'false' },
|
339
|
+
},
|
340
|
+
'legend.labels.pointStyle': {
|
341
|
+
description: "- \uB77C\uBCA8 \uD3EC\uC778\uD2B8 \uC2A4\uD0C0\uC77C\n - usePointStyle\uAC00 true\uC778 \uACBD\uC6B0 \uC801\uC6A9",
|
342
|
+
table: {
|
343
|
+
category: 'Legend Props',
|
344
|
+
type: { summary: pointStyleList.join(' | ') },
|
345
|
+
},
|
346
|
+
control: { type: 'select' },
|
347
|
+
options: pointStyleList,
|
348
|
+
defaultValue: { summary: 'false' },
|
349
|
+
},
|
297
350
|
};
|
298
351
|
export var chartDatasetsArgsTypes = {
|
299
352
|
'datasets[n].data': {
|
@@ -380,6 +433,60 @@ export var chartDatasetsArgsTypes = {
|
|
380
433
|
type: { summary: 'boolean' },
|
381
434
|
},
|
382
435
|
},
|
436
|
+
'datasets[n].borderDash': {
|
437
|
+
description: "- \uCC28\uD2B8\uC758 \uAC01 \uC139\uC158\uC758 \uD14C\uB450\uB9AC\uB97C \uC810\uC120\uC73C\uB85C \uB9CC\uB4EC\n - ex)[5,5]: 5\uD53D\uC140 \uAE38\uC774\uC758 \uC120\uACFC 5\uD53D\uC140 \uAE38\uC774\uC758 \uAC04\uACA9",
|
438
|
+
table: {
|
439
|
+
category: 'Dataset Props',
|
440
|
+
type: { summary: 'number[]' },
|
441
|
+
},
|
442
|
+
},
|
443
|
+
'datasets[n].borderDashOffset': {
|
444
|
+
description: "- \uC810\uC120\uC758 \uC2DC\uC791 \uC704\uCE58 \uC870\uC815\n - ex) 2: \uC810\uC120\uC758 \uC2DC\uC791 \uC9C0\uC810\uC744 2\uD53D\uC140 \uC774\uB3D9",
|
445
|
+
table: {
|
446
|
+
category: 'Dataset Props',
|
447
|
+
type: { summary: 'number' },
|
448
|
+
},
|
449
|
+
},
|
450
|
+
'datasets[n].offset': {
|
451
|
+
description: '각 섹션 사이의 간격 조정',
|
452
|
+
table: {
|
453
|
+
category: 'Dataset Props',
|
454
|
+
type: { summary: 'number' },
|
455
|
+
},
|
456
|
+
},
|
457
|
+
'datasets[n].weight': {
|
458
|
+
description: '각 섹션의 상대적인 두께를 설정, 섹션이 차지하는 공간의 비율을 조정',
|
459
|
+
table: {
|
460
|
+
category: 'Dataset Props',
|
461
|
+
type: { summary: 'number' },
|
462
|
+
},
|
463
|
+
},
|
464
|
+
};
|
465
|
+
export var chartDatalabelsArgsTypes = {
|
466
|
+
datalabels: {
|
467
|
+
table: {
|
468
|
+
disable: true,
|
469
|
+
},
|
470
|
+
},
|
471
|
+
'datalabels.display': {
|
472
|
+
description: '차트 데이터 라벨 표시 여부',
|
473
|
+
table: {
|
474
|
+
category: 'Datalabels Props',
|
475
|
+
type: { summary: 'boolean' },
|
476
|
+
},
|
477
|
+
control: { type: 'boolean' },
|
478
|
+
defaultValue: { summary: false },
|
479
|
+
},
|
480
|
+
'datalabels.color': {
|
481
|
+
description: '차트 데이터 라벨 색상',
|
482
|
+
table: {
|
483
|
+
category: 'Datalabels Props',
|
484
|
+
type: { summary: 'string' },
|
485
|
+
},
|
486
|
+
control: { type: 'select' },
|
487
|
+
options: ['white', 'gray', 'black'],
|
488
|
+
defaultValue: { summary: 'gray' },
|
489
|
+
},
|
383
490
|
};
|
384
491
|
export var blackText = ['sky', 'mint', 'lime', 'yellow', 'amber', 'orange', 'white'];
|
385
492
|
export var primaryColorStyle = function () {
|
package/dist/lib/types.d.ts
CHANGED
@@ -9,3 +9,73 @@ export type PointStyle = 'circle' | 'cross' | 'crossRot' | 'dash' | 'line' | 're
|
|
9
9
|
export type IColor = 'slate' | 'olive' | 'sand' | 'tomato' | 'red' | 'ruby' | 'crimson' | 'pink' | 'plum' | 'purple' | 'violet' | 'iris' | 'indigo' | 'blue' | 'cyan' | 'teal' | 'jade' | 'green' | 'grass' | 'brown' | 'bronze' | 'gold' | 'sky' | 'mint' | 'lime' | 'yellow' | 'amber' | 'orange' | 'black' | 'white';
|
10
10
|
export type IDarkColor = 'blackDark' | 'whiteDark' | 'slateDark' | 'oliveDark' | 'sandDark' | 'tomatoDark' | 'redDark' | 'rubyDark' | 'crimsonDark' | 'pinkDark' | 'plumDark' | 'purpleDark' | 'violetDark' | 'irisDark' | 'indigoDark' | 'blueDark' | 'cyanDark' | 'tealDark' | 'jadeDark' | 'greenDark' | 'grassDark' | 'brownDark' | 'bronzeDark' | 'goldDark' | 'skyDark' | 'mintDark' | 'limeDark' | 'yellowDark' | 'amberDark' | 'orangeDark' | 'slateDarkA' | 'oliveDarkA' | 'sandDarkA' | 'tomatoDarkA' | 'redDarkA' | 'rubyDarkA' | 'crimsonDarkA' | 'pinkDarkA' | 'plumDarkA' | 'purpleDarkA' | 'violetDarkA' | 'irisDarkA' | 'indigoDarkA' | 'blueDarkA' | 'cyanDarkA' | 'tealDarkA' | 'jadeDarkA' | 'greenDarkA' | 'grassDarkA' | 'brownDarkA' | 'bronzeDarkA' | 'goldDarkA' | 'skyDarkA' | 'mintDarkA' | 'limeDarkA' | 'yellowDarkA' | 'amberDarkA' | 'orangeDarkA';
|
11
11
|
export type IAlphaColor = 'slateA' | 'oliveA' | 'sandA' | 'tomatoA' | 'redA' | 'rubyA' | 'crimsonA' | 'pinkA' | 'plumA' | 'purpleA' | 'violetA' | 'irisA' | 'indigoA' | 'blueA' | 'cyanA' | 'tealA' | 'jadeA' | 'greenA' | 'grassA' | 'brownA' | 'bronzeA' | 'goldA' | 'skyA' | 'mintA' | 'limeA' | 'yellowA' | 'amberA' | 'orangeA';
|
12
|
+
export type IChartTitle = {
|
13
|
+
text?: string | string[];
|
14
|
+
display?: boolean;
|
15
|
+
position?: 'top' | 'right' | 'bottom' | 'left';
|
16
|
+
align?: 'start' | 'center' | 'end';
|
17
|
+
font?: {
|
18
|
+
size?: number;
|
19
|
+
weight?: 'normal' | 'bold' | 'lighter' | 'bolder' | number;
|
20
|
+
lineHeight?: number;
|
21
|
+
};
|
22
|
+
};
|
23
|
+
export type IChartLegend = {
|
24
|
+
display?: boolean;
|
25
|
+
align?: 'start' | 'center' | 'end';
|
26
|
+
position?: 'top' | 'right' | 'bottom' | 'left';
|
27
|
+
maxHeight?: number;
|
28
|
+
maxWidth?: number;
|
29
|
+
fullSize?: boolean;
|
30
|
+
reverse?: boolean;
|
31
|
+
labels?: {
|
32
|
+
boxWidth?: number;
|
33
|
+
boxHeight?: number;
|
34
|
+
padding?: number;
|
35
|
+
textAlign?: 'left' | 'right' | 'center';
|
36
|
+
color?: string;
|
37
|
+
usePointStyle?: boolean;
|
38
|
+
pointStyle?: PointStyle;
|
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
|
+
export type IChartDatasets = {
|
53
|
+
label?: string;
|
54
|
+
backgroundColor?: string[] | string;
|
55
|
+
borderColor?: string[] | string;
|
56
|
+
borderWidth?: number;
|
57
|
+
borderRadius?: number;
|
58
|
+
borderDash?: number[];
|
59
|
+
borderDashOffset?: number;
|
60
|
+
hoverBackgroundColor?: string;
|
61
|
+
hoverBorderColor?: string;
|
62
|
+
hoverBorderWidth?: number;
|
63
|
+
pointStyle?: PointStyle;
|
64
|
+
offset?: number;
|
65
|
+
spacing?: number;
|
66
|
+
weight?: number;
|
67
|
+
order?: number;
|
68
|
+
hidden?: boolean;
|
69
|
+
};
|
70
|
+
export type IChartDataLabels = {
|
71
|
+
display?: boolean;
|
72
|
+
color?: string;
|
73
|
+
align?: 'start' | 'center' | 'end' | number;
|
74
|
+
backgroundColor?: string | ((context: any) => string);
|
75
|
+
borderColor?: string;
|
76
|
+
borderRadius?: number;
|
77
|
+
borderWidth?: number;
|
78
|
+
font?: object;
|
79
|
+
formatter?: (x: number) => number;
|
80
|
+
padding?: number;
|
81
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const useDarkMode: (isRAxes?: boolean) => any[];
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import { slateA, slateDarkA } from '../../lib/color/alpha';
|
2
|
+
import { useEffect, useState } from 'react';
|
3
|
+
export var useDarkMode = function (isRAxes) {
|
4
|
+
if (isRAxes === void 0) { isRAxes = false; }
|
5
|
+
var lightmode = {};
|
6
|
+
var darkmode = {};
|
7
|
+
if (isRAxes === true) {
|
8
|
+
lightmode = {
|
9
|
+
r: { grid: { color: slateA[8] } },
|
10
|
+
};
|
11
|
+
darkmode = {
|
12
|
+
r: { grid: { color: slateDarkA[8] }, ticks: { backdropColor: 'rgba(0, 0, 0, 0)' } },
|
13
|
+
};
|
14
|
+
}
|
15
|
+
else {
|
16
|
+
lightmode = {
|
17
|
+
x: { grid: { color: slateA[8] } },
|
18
|
+
y: { grid: { color: slateA[8] } },
|
19
|
+
};
|
20
|
+
darkmode = {
|
21
|
+
x: { grid: { color: slateDarkA[8] } },
|
22
|
+
y: { grid: { color: slateDarkA[8] } },
|
23
|
+
};
|
24
|
+
}
|
25
|
+
var _a = useState(checkDarkMode()), isDarkMode = _a[0], setIsDarkMode = _a[1];
|
26
|
+
var _b = useState({
|
27
|
+
linescale: {},
|
28
|
+
}), defaultOptions = _b[0], setDefaultOptions = _b[1];
|
29
|
+
function checkDarkMode() {
|
30
|
+
return document.body.classList.contains('dark');
|
31
|
+
}
|
32
|
+
useEffect(function () {
|
33
|
+
setIsDarkMode(checkDarkMode());
|
34
|
+
setDefaultOptions({ linescale: !checkDarkMode() ? lightmode : darkmode });
|
35
|
+
var mutationObserver = new MutationObserver(function (mutations) {
|
36
|
+
mutations.forEach(function (mutation) {
|
37
|
+
if (mutation.attributeName === 'class') {
|
38
|
+
setIsDarkMode(checkDarkMode());
|
39
|
+
setDefaultOptions({ linescale: !checkDarkMode() ? lightmode : darkmode });
|
40
|
+
}
|
41
|
+
});
|
42
|
+
});
|
43
|
+
mutationObserver.observe(document.body, { attributes: true });
|
44
|
+
return function () {
|
45
|
+
mutationObserver.disconnect();
|
46
|
+
};
|
47
|
+
}, []);
|
48
|
+
return [isDarkMode, defaultOptions];
|
49
|
+
};
|
package/dist/tailwind.config.js
CHANGED
@@ -27,16 +27,14 @@ var darkClasses = [];
|
|
27
27
|
var colorScale = Array.from({ length: 12 }, function (_, i) { return (i + 1).toString(); });
|
28
28
|
var allColorOptions = [colorOptions, alphaColorOptions];
|
29
29
|
var generateClasses = function (colorList, colorScale) {
|
30
|
-
var classPrefixes = ['
|
30
|
+
var classPrefixes = ['fill', 'border', 'bg', 'text'];
|
31
31
|
return colorList.flatMap(function (color) {
|
32
32
|
return colorScale.flatMap(function (scale) { return classPrefixes.map(function (prefix) { return "".concat(prefix, "-").concat(color, "-").concat(scale); }); });
|
33
33
|
});
|
34
34
|
};
|
35
35
|
var generateDarkClasses = function (colorList, colorScale) {
|
36
36
|
var classPrefixes = [
|
37
|
-
'dark:accent',
|
38
37
|
'dark:fill',
|
39
|
-
'dark:outline',
|
40
38
|
'dark:border',
|
41
39
|
'dark:bg',
|
42
40
|
'dark:text',
|
@@ -46,7 +44,6 @@ var generateDarkClasses = function (colorList, colorScale) {
|
|
46
44
|
'dark:active:bg',
|
47
45
|
'dark:active:border',
|
48
46
|
'dark:active:text',
|
49
|
-
'dark:before:checked:bg',
|
50
47
|
'dark:data-[state=on]:bg',
|
51
48
|
'dark:data-[state=open]:bg',
|
52
49
|
'dark:data-[state=on]:text',
|
@@ -69,7 +66,7 @@ var config = {
|
|
69
66
|
'./src/stories/**/*.{js,ts,jsx,tsx,mdx,zip}',
|
70
67
|
'./src/**/*.{js,ts,jsx,tsx,mdx,zip}',
|
71
68
|
],
|
72
|
-
safelist: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(
|
69
|
+
safelist: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], classes, true), classes.map(function (cls) { return "hover:".concat(cls); }), true), classes.map(function (cls) { return "active:".concat(cls); }), true), classes.map(function (cls) { return "before:".concat(cls); }), true), classes.map(function (cls) { return "data-[state=checked]:".concat(cls); }), true), classes.map(function (cls) { return "data-[state=unchecked]:".concat(cls); }), true), classes.map(function (cls) { return "data-[state=on]:".concat(cls); }), true), classes.map(function (cls) { return "data-[state=open]:".concat(cls); }), true), darkClasses, true),
|
73
70
|
theme: {
|
74
71
|
extend: {
|
75
72
|
fontFamily: {
|