@sk-web-gui/core 0.1.5 → 0.1.8
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.
- package/package.json +2 -2
- package/src/components/tag.js +43 -57
- package/src/components/user-menu.js +13 -6
- package/src/index.js +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sk-web-gui/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"postcss-import": "^14.0.2",
|
|
32
32
|
"tailwindcss": "^2.2.4"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "6399e82a177dee62d0f8fb10e3fbe3d7f80a1cac"
|
|
35
35
|
}
|
package/src/components/tag.js
CHANGED
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
function tagOutline(colors) {
|
|
2
2
|
return {
|
|
3
3
|
".tag-outline": {
|
|
4
|
-
"@apply border bg-transparent border-
|
|
5
|
-
// dark
|
|
6
|
-
"@apply dark:border-neutral-600 dark:text-neutral-100": {},
|
|
4
|
+
"@apply border bg-transparent border-gray-stroke text-neutral-900": {},
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// dark
|
|
14
|
-
[`@apply dark:border-${color}-400 dark:text-${color}-400`]: {},
|
|
15
|
-
"@apply dark:border-opacity-40": {},
|
|
16
|
-
},
|
|
17
|
-
}),
|
|
18
|
-
{}
|
|
19
|
-
),
|
|
6
|
+
"&[href]": {
|
|
7
|
+
[`@apply hover:border-hover hover:text-white hover:bg-hover`]: {},
|
|
8
|
+
[`@apply active:text-white active:bg-hover`]: {},
|
|
9
|
+
[`@apply focus-visible:text-white focus-visible:ring-4 focus-visible:ring-black focus-visible:bg-hover`]: {},
|
|
10
|
+
},
|
|
20
11
|
},
|
|
21
12
|
};
|
|
22
13
|
}
|
|
@@ -24,23 +15,17 @@ function tagOutline(colors) {
|
|
|
24
15
|
function tagSolid(colors) {
|
|
25
16
|
return {
|
|
26
17
|
".tag-solid": {
|
|
27
|
-
"@apply border bg-
|
|
28
|
-
// dark
|
|
29
|
-
"@apply dark:border-neutral-600 dark:text-neutral-100 dark:bg-neutral-700": {},
|
|
18
|
+
"@apply border bg-gray-stroke border-transparent text-white": {},
|
|
30
19
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
}),
|
|
42
|
-
{}
|
|
43
|
-
),
|
|
20
|
+
"&[href]": {
|
|
21
|
+
[`@apply hover:text-white hover:bg-hover`]: {},
|
|
22
|
+
[`@apply active:text-white active:bg-hover`]: {},
|
|
23
|
+
[`@apply focus-visible:text-white focus-visible:ring-4 focus-visible:ring-black focus-visible:bg-hover`]: {},
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
".tag-close-button": {
|
|
27
|
+
"@apply text-white": {}
|
|
28
|
+
},
|
|
44
29
|
},
|
|
45
30
|
};
|
|
46
31
|
}
|
|
@@ -48,49 +33,43 @@ function tagSolid(colors) {
|
|
|
48
33
|
function tagLight(colors) {
|
|
49
34
|
return {
|
|
50
35
|
".tag-light": {
|
|
51
|
-
"@apply text-neutral-900
|
|
52
|
-
// dark
|
|
53
|
-
"@apply dark:text-neutral-100 dark:bg-neutral-700": {},
|
|
36
|
+
"@apply border border-transparent text-neutral-900": {},
|
|
54
37
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
// dark
|
|
61
|
-
[`@apply dark:text-${color}-400 dark:bg-${color}-500`]: {},
|
|
62
|
-
"@apply dark:bg-opacity-15": {},
|
|
63
|
-
},
|
|
64
|
-
}),
|
|
65
|
-
{}
|
|
66
|
-
),
|
|
38
|
+
"&[href]": {
|
|
39
|
+
[`@apply hover:border-hover`]: {},
|
|
40
|
+
[`@apply active:border-hover`]: {},
|
|
41
|
+
[`@apply focus-visible:border-hover focus-visible:ring-4 focus-visible:ring-black`]: {},
|
|
42
|
+
},
|
|
67
43
|
},
|
|
68
44
|
};
|
|
69
45
|
}
|
|
70
46
|
|
|
71
47
|
module.exports = Tag = (colors) => ({
|
|
72
48
|
".tag": {
|
|
73
|
-
"@apply inline-flex items-center max-h-full rounded-full font-
|
|
49
|
+
"@apply leading-none inline-flex items-center content-center max-h-full rounded-full font-normal outline-none whitespace-nowrap": {},
|
|
50
|
+
width: "fit-content",
|
|
51
|
+
height: "fit-content",
|
|
52
|
+
padding: "0 1.145em 0 1.145em",
|
|
53
|
+
borderRadius: "3.2rem",
|
|
54
|
+
|
|
55
|
+
"&-text": {
|
|
56
|
+
padding: "0.4285em 0"
|
|
57
|
+
},
|
|
74
58
|
|
|
75
59
|
"&-sm": {
|
|
76
|
-
"@apply
|
|
60
|
+
"@apply text-xs": {},
|
|
77
61
|
minWidth: "1.25rem",
|
|
78
62
|
},
|
|
79
63
|
|
|
80
64
|
"&-md": {
|
|
81
|
-
"@apply
|
|
65
|
+
"@apply text-sm": {},
|
|
82
66
|
minWidth: "1.5rem",
|
|
83
67
|
},
|
|
84
68
|
|
|
85
69
|
"&-lg": {
|
|
86
|
-
"@apply
|
|
70
|
+
"@apply text-base": {},
|
|
87
71
|
minWidth: "1.75rem",
|
|
88
72
|
},
|
|
89
|
-
|
|
90
|
-
"&-xl": {
|
|
91
|
-
"@apply px-3 h-8 text-base": {},
|
|
92
|
-
minWidth: "2rem",
|
|
93
|
-
},
|
|
94
73
|
},
|
|
95
74
|
|
|
96
75
|
// variants
|
|
@@ -99,8 +78,15 @@ module.exports = Tag = (colors) => ({
|
|
|
99
78
|
...tagLight(colors),
|
|
100
79
|
|
|
101
80
|
".tag-close-button": {
|
|
102
|
-
"@apply flex items-center justify-center transition-all duration-150 rounded-full outline-none
|
|
103
|
-
|
|
81
|
+
"@apply border-transparent flex items-center justify-center transition-all duration-150 rounded-full outline-none cursor-base": {},
|
|
82
|
+
fontSize: "1em",
|
|
83
|
+
padding: "0.36em",
|
|
84
|
+
marginLeft: "0.25em",
|
|
85
|
+
marginRight: "-0.55em",
|
|
86
|
+
|
|
87
|
+
"&-icon": {
|
|
88
|
+
fontSize: "1em"
|
|
89
|
+
},
|
|
104
90
|
|
|
105
91
|
"&-disabled": {
|
|
106
92
|
"@apply disabled:opacity-40 disabled:cursor-not-allowed disabled:shadow-none": {},
|
|
@@ -18,16 +18,23 @@ module.exports = UserMenu = (colors) => ({
|
|
|
18
18
|
// "@apply p-0 m-0 py-sm bg-white": {},
|
|
19
19
|
},
|
|
20
20
|
"&-item": {
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
"@apply text-black": {},
|
|
21
|
+
"&.link": {
|
|
22
|
+
"@apply text-white no-underline": {},
|
|
24
23
|
},
|
|
25
|
-
"
|
|
26
|
-
|
|
24
|
+
"@apply text-white cursor-pointer bg-hover": {
|
|
25
|
+
a: {
|
|
26
|
+
"@apply text-white px-md py-sm w-full": {},
|
|
27
|
+
},
|
|
27
28
|
"a.link": {
|
|
28
|
-
"@apply text-white
|
|
29
|
+
"@apply text-white px-md py-sm w-full": {},
|
|
29
30
|
},
|
|
30
31
|
},
|
|
31
32
|
},
|
|
33
|
+
".inactive > &-item": {
|
|
34
|
+
"@apply bg-white text-black no-underline": {},
|
|
35
|
+
"a.link": {
|
|
36
|
+
"@apply text-black no-underline": {},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
32
39
|
},
|
|
33
40
|
});
|
package/src/index.js
CHANGED
|
@@ -29,6 +29,8 @@ const Divider = require("./components/divider");
|
|
|
29
29
|
|
|
30
30
|
const UserMenu = require("./components/user-menu");
|
|
31
31
|
|
|
32
|
+
const Tag = require("./components/tag");
|
|
33
|
+
|
|
32
34
|
const components = [
|
|
33
35
|
Alert,
|
|
34
36
|
Breadcrumb,
|
|
@@ -54,6 +56,8 @@ const components = [
|
|
|
54
56
|
Divider,
|
|
55
57
|
|
|
56
58
|
UserMenu,
|
|
59
|
+
|
|
60
|
+
Tag,
|
|
57
61
|
];
|
|
58
62
|
|
|
59
63
|
const defaultColors = ["primary", "secondary"];
|