@lotte-innovate/ui-component-test 0.1.63 → 0.1.65
Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,25 @@
|
|
1
|
+
export var classPrefixesByScale = {
|
2
|
+
fill: [9, 12],
|
3
|
+
border: [4, 6, 7, 8, 9],
|
4
|
+
bg: [1, 2, 3, 4, 5, 6, 7, 9, 10, 12],
|
5
|
+
text: [1, 8, 9, 10, 11, 12],
|
6
|
+
'hover:bg': [2, 3, 4, 6, 9, 10],
|
7
|
+
'hover:border': [4, 6, 7, 8, 9],
|
8
|
+
'hover:text': [1, 10, 11, 12],
|
9
|
+
'active:bg': [3, 4, 5, 6, 8, 9, 10],
|
10
|
+
'active:border': [6, 8, 9],
|
11
|
+
'active:text': [10, 11, 12],
|
12
|
+
'data-[state=on]:bg': [3, 4, 5, 9, 10],
|
13
|
+
'data-[state=on]:border': [8, 9],
|
14
|
+
'data-[state=on]:text': [1, 11],
|
15
|
+
'data-[state=on]:hover:bg': [2, 3, 4, 10],
|
16
|
+
'data-[state=on]:hover:border': [8, 9],
|
17
|
+
'data-[state=on]:hover:text': [1, 11],
|
18
|
+
'data-[state=open]:bg': [5],
|
19
|
+
'data-[state=checked]:bg': [2, 3, 5, 6, 7, 9, 10],
|
20
|
+
'data-[state=checked]:border': [6],
|
21
|
+
'data-[state=checked]:text': [1, 8, 11],
|
22
|
+
'data-[state=unchecked]:bg': [2, 3, 5, 6, 7],
|
23
|
+
'data-[state=unchecked]:border': [4, 6, 7, 8, 9],
|
24
|
+
'data-[state=unchecked]:text': [8],
|
25
|
+
};
|
package/dist/tailwind.config.js
CHANGED
@@ -21,44 +21,24 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
21
21
|
import * as lightColors from './lib/color/light';
|
22
22
|
import * as darkColors from './lib/color/dark';
|
23
23
|
import * as alphaColors from './lib/color/alpha';
|
24
|
-
import { colorOptions, alphaColorOptions
|
24
|
+
import { colorOptions, alphaColorOptions } from './lib/color/constants';
|
25
|
+
import { classPrefixesByScale } from './lib/utils/classPrefixes';
|
25
26
|
var classes = [];
|
26
|
-
var darkClasses = [];
|
27
|
-
var colorScale = Array.from({ length: 12 }, function (_, i) { return (i + 1).toString(); });
|
28
27
|
var allColorOptions = [colorOptions, alphaColorOptions];
|
29
|
-
var generateClasses = function (colorList,
|
30
|
-
var classPrefixes = ['fill', 'border', 'bg', 'text'];
|
28
|
+
var generateClasses = function (colorList, mode) {
|
31
29
|
return colorList.flatMap(function (color) {
|
32
|
-
return
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
'dark:border',
|
39
|
-
'dark:bg',
|
40
|
-
'dark:text',
|
41
|
-
'dark:hover:bg',
|
42
|
-
'dark:hover:border',
|
43
|
-
'dark:hover:text',
|
44
|
-
'dark:active:bg',
|
45
|
-
'dark:active:border',
|
46
|
-
'dark:active:text',
|
47
|
-
'dark:data-[state=on]:bg',
|
48
|
-
'dark:data-[state=open]:bg',
|
49
|
-
'dark:data-[state=on]:text',
|
50
|
-
'dark:data-[state=on]:hover:bg',
|
51
|
-
'dark:data-[state=on]:hover:border',
|
52
|
-
'dark:data-[state=on]:hover:text',
|
53
|
-
];
|
54
|
-
return colorList.flatMap(function (color) {
|
55
|
-
return colorScale.flatMap(function (scale) { return classPrefixes.map(function (prefix) { return "".concat(prefix, "-").concat(color, "-").concat(scale); }); });
|
30
|
+
return Object.entries(classPrefixesByScale).flatMap(function (_a) {
|
31
|
+
var key = _a[0], values = _a[1];
|
32
|
+
return values.map(function (value) {
|
33
|
+
return mode ? "".concat(mode).concat(key, "-").concat(color, "-").concat(value) : "".concat(key, "-").concat(color, "-").concat(value);
|
34
|
+
});
|
35
|
+
});
|
56
36
|
});
|
57
37
|
};
|
58
38
|
allColorOptions.forEach(function (options) {
|
59
|
-
classes = classes.concat(generateClasses(options
|
39
|
+
classes = classes.concat(generateClasses(options));
|
40
|
+
classes = classes.concat(generateClasses(options, 'dark:'));
|
60
41
|
});
|
61
|
-
darkClasses.push.apply(darkClasses, generateDarkClasses(darkColorOptions, colorScale));
|
62
42
|
var config = {
|
63
43
|
content: [
|
64
44
|
'./src/app/**/*.{js,ts,jsx,tsx,mdx,zip}',
|
@@ -66,7 +46,7 @@ var config = {
|
|
66
46
|
'./src/stories/**/*.{js,ts,jsx,tsx,mdx,zip}',
|
67
47
|
'./src/**/*.{js,ts,jsx,tsx,mdx,zip}',
|
68
48
|
],
|
69
|
-
safelist: __spreadArray(
|
49
|
+
safelist: __spreadArray([], classes, true),
|
70
50
|
theme: {
|
71
51
|
extend: {
|
72
52
|
fontFamily: {
|