@sk-web-gui/core 0.1.3 → 0.1.6
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/LICENSE +21 -21
- package/README.md +4 -4
- package/package.json +2 -2
- package/src/colors.js +77 -77
- package/src/components/accordion.js +42 -42
- package/src/components/alert.js +98 -98
- package/src/components/avatar.js +85 -85
- package/src/components/badge.js +61 -61
- package/src/components/breadcrumb.js +13 -13
- package/src/components/button-group.js +46 -46
- package/src/components/button.js +295 -295
- package/src/components/card.js +55 -55
- package/src/components/checkbox.js +128 -128
- package/src/components/code.js +9 -9
- package/src/components/cookie-consent.js +26 -26
- package/src/components/divider.js +12 -12
- package/src/components/dot.js +84 -84
- package/src/components/forms.js +246 -246
- package/src/components/icon-button.js +5 -5
- package/src/components/icon.js +9 -9
- package/src/components/kbd.js +9 -9
- package/src/components/link.js +13 -13
- package/src/components/message.js +29 -29
- package/src/components/modal.js +29 -29
- package/src/components/notification.js +56 -56
- package/src/components/radio.js +103 -103
- package/src/components/switch.js +112 -112
- package/src/components/table.js +13 -13
- package/src/components/tag.js +109 -109
- package/src/components/user-menu.js +40 -0
- package/src/index.js +241 -235
- package/src/with-opacity.js +6 -6
package/src/components/avatar.js
CHANGED
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
module.exports = Avatar = () => ({
|
|
2
|
-
".avatar": {
|
|
3
|
-
"@apply relative inline-flex items-center justify-center flex-shrink-0 align-top rounded-full": {},
|
|
4
|
-
"@apply bg-neutral-300 text-neutral-800": {},
|
|
5
|
-
// dark colors
|
|
6
|
-
"@apply dark:bg-neutral-600 dark:text-neutral-100": {},
|
|
7
|
-
|
|
8
|
-
"&-2xs": {
|
|
9
|
-
"@apply w-4 h-4": {},
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
"&-xs": {
|
|
13
|
-
"@apply w-5 h-5": {},
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
"&-sm": {
|
|
17
|
-
"@apply w-6 h-6": {},
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
"&-md": {
|
|
21
|
-
"@apply w-7 h-7": {},
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
"&-lg": {
|
|
25
|
-
"@apply w-8 h-8": {},
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
"&-xl": {
|
|
29
|
-
"@apply w-10 h-10": {},
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
"&-2xl": {
|
|
33
|
-
"@apply w-12 h-12": {},
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
"&-3xl": {
|
|
37
|
-
"@apply w-16 h-16": {},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
".avatar-bordered": {
|
|
42
|
-
"@apply border-2 border-white": {},
|
|
43
|
-
"@apply dark:border-neutral-800": {},
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
".avatar-name": {
|
|
47
|
-
"@apply font-medium text-center uppercase": {},
|
|
48
|
-
|
|
49
|
-
"&-2xs": {
|
|
50
|
-
"@apply w-4 h-4": {},
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
"&-xs": {
|
|
54
|
-
"@apply w-5 h-5": {},
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
"&-sm": {
|
|
58
|
-
"@apply w-6 h-6": {},
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
"&-md": {
|
|
62
|
-
"@apply w-7 h-7": {},
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
"&-lg": {
|
|
66
|
-
"@apply w-8 h-8": {},
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
"&-xl": {
|
|
70
|
-
"@apply w-10 h-10": {},
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
"&-2xl": {
|
|
74
|
-
"@apply w-12 h-12": {},
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
"&-3xl": {
|
|
78
|
-
"@apply w-16 h-16": {},
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
".avatar-group": {
|
|
83
|
-
"@apply flex items-center justify-end flex-row-reverse": {},
|
|
84
|
-
},
|
|
85
|
-
});
|
|
1
|
+
module.exports = Avatar = () => ({
|
|
2
|
+
".avatar": {
|
|
3
|
+
"@apply relative inline-flex items-center justify-center flex-shrink-0 align-top rounded-full": {},
|
|
4
|
+
"@apply bg-neutral-300 text-neutral-800": {},
|
|
5
|
+
// dark colors
|
|
6
|
+
"@apply dark:bg-neutral-600 dark:text-neutral-100": {},
|
|
7
|
+
|
|
8
|
+
"&-2xs": {
|
|
9
|
+
"@apply w-4 h-4": {},
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
"&-xs": {
|
|
13
|
+
"@apply w-5 h-5": {},
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
"&-sm": {
|
|
17
|
+
"@apply w-6 h-6": {},
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
"&-md": {
|
|
21
|
+
"@apply w-7 h-7": {},
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
"&-lg": {
|
|
25
|
+
"@apply w-8 h-8": {},
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
"&-xl": {
|
|
29
|
+
"@apply w-10 h-10": {},
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
"&-2xl": {
|
|
33
|
+
"@apply w-12 h-12": {},
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
"&-3xl": {
|
|
37
|
+
"@apply w-16 h-16": {},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
".avatar-bordered": {
|
|
42
|
+
"@apply border-2 border-white": {},
|
|
43
|
+
"@apply dark:border-neutral-800": {},
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
".avatar-name": {
|
|
47
|
+
"@apply font-medium text-center uppercase": {},
|
|
48
|
+
|
|
49
|
+
"&-2xs": {
|
|
50
|
+
"@apply w-4 h-4": {},
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
"&-xs": {
|
|
54
|
+
"@apply w-5 h-5": {},
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
"&-sm": {
|
|
58
|
+
"@apply w-6 h-6": {},
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
"&-md": {
|
|
62
|
+
"@apply w-7 h-7": {},
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
"&-lg": {
|
|
66
|
+
"@apply w-8 h-8": {},
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
"&-xl": {
|
|
70
|
+
"@apply w-10 h-10": {},
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
"&-2xl": {
|
|
74
|
+
"@apply w-12 h-12": {},
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
"&-3xl": {
|
|
78
|
+
"@apply w-16 h-16": {},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
".avatar-group": {
|
|
83
|
+
"@apply flex items-center justify-end flex-row-reverse": {},
|
|
84
|
+
},
|
|
85
|
+
});
|
package/src/components/badge.js
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
module.exports = Badge = (colors) => ({
|
|
2
|
-
".badge": {
|
|
3
|
-
"@apply inline-block text-xs font-medium leading-4 text-center whitespace-nowrap": {},
|
|
4
|
-
|
|
5
|
-
"&-light": {
|
|
6
|
-
"@apply text-neutral-900 bg-neutral-200 border border-transparent": {},
|
|
7
|
-
"@apply dark:text-neutral-100 dark:bg-neutral-700": {},
|
|
8
|
-
|
|
9
|
-
...colors.reduce(
|
|
10
|
-
(styles, color) => ({
|
|
11
|
-
...styles,
|
|
12
|
-
[`&[data-color="${color}"]`]: {
|
|
13
|
-
[`@apply text-${color}-800 bg-${color}-100`]: {},
|
|
14
|
-
[`@apply dark:text-${color}-400 dark:bg-${color}-500`]: {},
|
|
15
|
-
"@apply dark:bg-opacity-15": {},
|
|
16
|
-
},
|
|
17
|
-
}),
|
|
18
|
-
{}
|
|
19
|
-
),
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
"&-solid": {
|
|
23
|
-
"@apply text-white bg-neutral-500 border border-transparent": {},
|
|
24
|
-
"@apply dark:border-neutral-600 dark:text-neutral-100 dark:bg-neutral-700": {},
|
|
25
|
-
...colors.reduce(
|
|
26
|
-
(styles, color) => ({
|
|
27
|
-
...styles,
|
|
28
|
-
[`&[data-color="${color}"]`]: {
|
|
29
|
-
[`@apply bg-${color}-500`]: {},
|
|
30
|
-
[`@apply dark:text-${color}-400 dark:border-${color}-500 dark:bg-${color}-500`]: {},
|
|
31
|
-
"@apply dark:bg-opacity-15": {},
|
|
32
|
-
"@apply dark:border-opacity-40": {},
|
|
33
|
-
},
|
|
34
|
-
}),
|
|
35
|
-
{}
|
|
36
|
-
),
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
"&-sm": {
|
|
41
|
-
minWidth: "14px",
|
|
42
|
-
height: "14px",
|
|
43
|
-
padding: 0,
|
|
44
|
-
lineHeight: "12px",
|
|
45
|
-
borderRadius: "2em",
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
"&-md": {
|
|
49
|
-
"@apply px-1.5 py-0": {},
|
|
50
|
-
minWidth: "20px",
|
|
51
|
-
height: "20px",
|
|
52
|
-
lineHeight: "18px",
|
|
53
|
-
borderRadius: "2em",
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
"&-shadow": {
|
|
57
|
-
"@apply ring-1 ring-white": {},
|
|
58
|
-
"@apply dark:ring-black": {},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
});
|
|
1
|
+
module.exports = Badge = (colors) => ({
|
|
2
|
+
".badge": {
|
|
3
|
+
"@apply inline-block text-xs font-medium leading-4 text-center whitespace-nowrap": {},
|
|
4
|
+
|
|
5
|
+
"&-light": {
|
|
6
|
+
"@apply text-neutral-900 bg-neutral-200 border border-transparent": {},
|
|
7
|
+
"@apply dark:text-neutral-100 dark:bg-neutral-700": {},
|
|
8
|
+
|
|
9
|
+
...colors.reduce(
|
|
10
|
+
(styles, color) => ({
|
|
11
|
+
...styles,
|
|
12
|
+
[`&[data-color="${color}"]`]: {
|
|
13
|
+
[`@apply text-${color}-800 bg-${color}-100`]: {},
|
|
14
|
+
[`@apply dark:text-${color}-400 dark:bg-${color}-500`]: {},
|
|
15
|
+
"@apply dark:bg-opacity-15": {},
|
|
16
|
+
},
|
|
17
|
+
}),
|
|
18
|
+
{}
|
|
19
|
+
),
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
"&-solid": {
|
|
23
|
+
"@apply text-white bg-neutral-500 border border-transparent": {},
|
|
24
|
+
"@apply dark:border-neutral-600 dark:text-neutral-100 dark:bg-neutral-700": {},
|
|
25
|
+
...colors.reduce(
|
|
26
|
+
(styles, color) => ({
|
|
27
|
+
...styles,
|
|
28
|
+
[`&[data-color="${color}"]`]: {
|
|
29
|
+
[`@apply bg-${color}-500`]: {},
|
|
30
|
+
[`@apply dark:text-${color}-400 dark:border-${color}-500 dark:bg-${color}-500`]: {},
|
|
31
|
+
"@apply dark:bg-opacity-15": {},
|
|
32
|
+
"@apply dark:border-opacity-40": {},
|
|
33
|
+
},
|
|
34
|
+
}),
|
|
35
|
+
{}
|
|
36
|
+
),
|
|
37
|
+
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
"&-sm": {
|
|
41
|
+
minWidth: "14px",
|
|
42
|
+
height: "14px",
|
|
43
|
+
padding: 0,
|
|
44
|
+
lineHeight: "12px",
|
|
45
|
+
borderRadius: "2em",
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
"&-md": {
|
|
49
|
+
"@apply px-1.5 py-0": {},
|
|
50
|
+
minWidth: "20px",
|
|
51
|
+
height: "20px",
|
|
52
|
+
lineHeight: "18px",
|
|
53
|
+
borderRadius: "2em",
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
"&-shadow": {
|
|
57
|
+
"@apply ring-1 ring-white": {},
|
|
58
|
+
"@apply dark:ring-black": {},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
module.exports = Breadcrumb = () => ({
|
|
2
|
-
".breadcrumb": {
|
|
3
|
-
"@apply relative": {},
|
|
4
|
-
|
|
5
|
-
"&-item": {
|
|
6
|
-
"@apply inline-flex items-center whitespace-nowrap": {},
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
"&-separator": {
|
|
10
|
-
"@apply mx-2 text-neutral-500": {},
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
});
|
|
1
|
+
module.exports = Breadcrumb = () => ({
|
|
2
|
+
".breadcrumb": {
|
|
3
|
+
"@apply relative": {},
|
|
4
|
+
|
|
5
|
+
"&-item": {
|
|
6
|
+
"@apply inline-flex items-center whitespace-nowrap": {},
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
"&-separator": {
|
|
10
|
+
"@apply mx-2 text-neutral-500": {},
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
// TODO: how it works with prefix?
|
|
2
|
-
module.exports = ButtonGroup = () => ({
|
|
3
|
-
".btn-group": {
|
|
4
|
-
"@apply inline-block": {},
|
|
5
|
-
|
|
6
|
-
"&.btn-group-attached": {
|
|
7
|
-
"> .btn-icon": {
|
|
8
|
-
boxSizing: "content-box",
|
|
9
|
-
},
|
|
10
|
-
"> *:first-of-type:not(:last-of-type)": {
|
|
11
|
-
borderTopRightRadius: "0px",
|
|
12
|
-
borderBottomRightRadius: "0px",
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
"> *:not(:first-of-type):not(:last-of-type)": {
|
|
16
|
-
borderRadius: "0px",
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
"> *:not(:first-of-type):last-of-type": {
|
|
20
|
-
borderTopLeftRadius: "0px",
|
|
21
|
-
borderBottomLeftRadius: "0px",
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
"> .btn-solid:not(:last-child), > .btn-outline:not(:last-child)": {
|
|
25
|
-
borderRightWidth: "0px",
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
"> .btn-solid:hover, > .btn-outline:hover": {
|
|
29
|
-
borderRightWidth: "1px",
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
"> *:not(:last-of-type):hover + .btn-solid, > *:not(:last-of-type):hover + .btn-outline": {
|
|
33
|
-
borderLeftWidth: "0px",
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
"> .btn-solid:focus, > .btn-outline:focus": {
|
|
37
|
-
zIndex: "1px",
|
|
38
|
-
borderRightWidth: "1px",
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
"> *:not(:last-of-type):focus + .btn-solid, > *:not(:last-of-type):focus + .btn-outline": {
|
|
42
|
-
borderLeftWidth: "0px",
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
});
|
|
1
|
+
// TODO: how it works with prefix?
|
|
2
|
+
module.exports = ButtonGroup = () => ({
|
|
3
|
+
".btn-group": {
|
|
4
|
+
"@apply inline-block": {},
|
|
5
|
+
|
|
6
|
+
"&.btn-group-attached": {
|
|
7
|
+
"> .btn-icon": {
|
|
8
|
+
boxSizing: "content-box",
|
|
9
|
+
},
|
|
10
|
+
"> *:first-of-type:not(:last-of-type)": {
|
|
11
|
+
borderTopRightRadius: "0px",
|
|
12
|
+
borderBottomRightRadius: "0px",
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
"> *:not(:first-of-type):not(:last-of-type)": {
|
|
16
|
+
borderRadius: "0px",
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
"> *:not(:first-of-type):last-of-type": {
|
|
20
|
+
borderTopLeftRadius: "0px",
|
|
21
|
+
borderBottomLeftRadius: "0px",
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
"> .btn-solid:not(:last-child), > .btn-outline:not(:last-child)": {
|
|
25
|
+
borderRightWidth: "0px",
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
"> .btn-solid:hover, > .btn-outline:hover": {
|
|
29
|
+
borderRightWidth: "1px",
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
"> *:not(:last-of-type):hover + .btn-solid, > *:not(:last-of-type):hover + .btn-outline": {
|
|
33
|
+
borderLeftWidth: "0px",
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
"> .btn-solid:focus, > .btn-outline:focus": {
|
|
37
|
+
zIndex: "1px",
|
|
38
|
+
borderRightWidth: "1px",
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
"> *:not(:last-of-type):focus + .btn-solid, > *:not(:last-of-type):focus + .btn-outline": {
|
|
42
|
+
borderLeftWidth: "0px",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
});
|