@sk-web-gui/core 0.1.2 → 0.1.5

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.
@@ -1,29 +1,29 @@
1
- module.exports = Modal = () => ({
2
- ".modal": {
3
- "@apply fixed inset-0 z-10 flex items-center justify-center overflow-y-auto": {},
4
-
5
- "&-backdrop": {
6
- "@apply bg-black bg-opacity-30": {},
7
- },
8
-
9
- "&-wrapper": {
10
- "@apply flex flex-col container py-8 px-4 text-center bg-white max-w-screen-sm relative": {},
11
- },
12
-
13
- "&-close-btn": {
14
- "@apply cursor-pointer hover:text-primary-active absolute right-8 top-6 border border-transparent focus-visible:border-black flex self-center": {},
15
- },
16
-
17
- "&-title": {
18
- "@apply text-3xl p-4": {},
19
- },
20
-
21
- "&-description": {
22
- "@apply text-base p-4": {},
23
- },
24
-
25
- "&-content-wrapper": {
26
- "@apply p-4 space-y-10": {},
27
- },
28
- },
29
- });
1
+ module.exports = Modal = () => ({
2
+ ".modal": {
3
+ "@apply fixed inset-0 z-10 flex items-center justify-center overflow-y-auto": {},
4
+
5
+ "&-backdrop": {
6
+ "@apply bg-black bg-opacity-30": {},
7
+ },
8
+
9
+ "&-wrapper": {
10
+ "@apply flex flex-col container py-8 px-4 text-center bg-white max-w-screen-sm relative": {},
11
+ },
12
+
13
+ "&-close-btn": {
14
+ "@apply cursor-pointer hover:text-primary-active absolute right-8 top-6 border border-transparent focus-visible:border-black flex self-center": {},
15
+ },
16
+
17
+ "&-title": {
18
+ "@apply text-3xl p-4": {},
19
+ },
20
+
21
+ "&-description": {
22
+ "@apply text-base p-4": {},
23
+ },
24
+
25
+ "&-content-wrapper": {
26
+ "@apply p-4 space-y-10": {},
27
+ },
28
+ },
29
+ });
@@ -1,56 +1,56 @@
1
- module.exports = Notification = () => ({
2
- ".notification": {
3
- "@apply relative flex p-4 text-sm w-96 m-2 max-w-full rounded-base shadow-sm sm:max-w-md": {},
4
- "@apply text-neutral-900 bg-white border border-neutral-200": {},
5
- // dark
6
- "@apply dark:text-neutral-100 dark:bg-neutral-700 dark:border-neutral-600": {},
7
- },
8
-
9
- ".notification-icon": {
10
- "@apply flex-shrink-0 w-5 h-5 mr-3": {},
11
-
12
- "&-info": {
13
- "--tw-text-opacity": "1",
14
- color: "rgba(59, 130, 246, var(--tw-text-opacity))",
15
- },
16
- "&-success": {
17
- "--tw-text-opacity": "1",
18
- color: "rgba(34, 197, 94, var(--tw-text-opacity))",
19
- },
20
- "&-error": {
21
- "--tw-text-opacity": "1",
22
- color: "rgba(239, 68, 68, var(--tw-text-opacity))",
23
- },
24
- "&-warning": {
25
- "--tw-text-opacity": "1",
26
- color: "rgba(234, 179, 8, var(--tw-text-opacity))",
27
- },
28
- },
29
-
30
- ".notification-content": {
31
- "@apply flex flex-col items-start flex-1 mr-2 -mt-px text-left": {},
32
-
33
- "&-title": {
34
- "@apply font-semibold": {},
35
- },
36
-
37
- "&-description": {
38
- "@apply text-neutral-500 dark:text-neutral-400": {},
39
- },
40
- },
41
-
42
- ".notification-action": {
43
- "@apply absolute space-x-2": {},
44
- right: 16,
45
- top: 16,
46
-
47
- "&-undo": {
48
- "@apply h-auto p-0 text-sm": {},
49
- },
50
-
51
- "&-close-button": {
52
- "@apply cursor-base text-neutral-700 hover:text-neutral-900": {},
53
- "@apply dark:text-neutral-400 dark:hover:text-neutral-100": {},
54
- },
55
- },
56
- });
1
+ module.exports = Notification = () => ({
2
+ ".notification": {
3
+ "@apply relative flex p-4 text-sm w-96 m-2 max-w-full rounded-base shadow-sm sm:max-w-md": {},
4
+ "@apply text-neutral-900 bg-white border border-neutral-200": {},
5
+ // dark
6
+ "@apply dark:text-neutral-100 dark:bg-neutral-700 dark:border-neutral-600": {},
7
+ },
8
+
9
+ ".notification-icon": {
10
+ "@apply flex-shrink-0 w-5 h-5 mr-3": {},
11
+
12
+ "&-info": {
13
+ "--tw-text-opacity": "1",
14
+ color: "rgba(59, 130, 246, var(--tw-text-opacity))",
15
+ },
16
+ "&-success": {
17
+ "--tw-text-opacity": "1",
18
+ color: "rgba(34, 197, 94, var(--tw-text-opacity))",
19
+ },
20
+ "&-error": {
21
+ "--tw-text-opacity": "1",
22
+ color: "rgba(239, 68, 68, var(--tw-text-opacity))",
23
+ },
24
+ "&-warning": {
25
+ "--tw-text-opacity": "1",
26
+ color: "rgba(234, 179, 8, var(--tw-text-opacity))",
27
+ },
28
+ },
29
+
30
+ ".notification-content": {
31
+ "@apply flex flex-col items-start flex-1 mr-2 -mt-px text-left": {},
32
+
33
+ "&-title": {
34
+ "@apply font-semibold": {},
35
+ },
36
+
37
+ "&-description": {
38
+ "@apply text-neutral-500 dark:text-neutral-400": {},
39
+ },
40
+ },
41
+
42
+ ".notification-action": {
43
+ "@apply absolute space-x-2": {},
44
+ right: 16,
45
+ top: 16,
46
+
47
+ "&-undo": {
48
+ "@apply h-auto p-0 text-sm": {},
49
+ },
50
+
51
+ "&-close-button": {
52
+ "@apply cursor-base text-neutral-700 hover:text-neutral-900": {},
53
+ "@apply dark:text-neutral-400 dark:hover:text-neutral-100": {},
54
+ },
55
+ },
56
+ });
@@ -1,103 +1,103 @@
1
- module.exports = Radio = (colors) => ({
2
- ".form-radio": {
3
- "@apply shadow-sm": {},
4
- backgroundColor: "inherit",
5
- "@apply border-neutral-300": {},
6
- "&[aria-invalid=true]": {
7
- "--tw-border-opacity": "1",
8
- "borderColor": "rgba(220, 38, 38, var(--tw-border-opacity))",
9
- },
10
- "&[aria-invalid=true]:hover": {
11
- "--tw-border-opacity": "1",
12
- "border-color": "rgba(220, 38, 38, var(--tw-border-opacity))",
13
- },
14
- // dark colors
15
- "@apply dark:border-neutral-400": {},
16
- ".dark &[aria-invalid=true]": {
17
- "--tw-border-opacity": "1",
18
- "borderColor": "rgba(248, 113, 113, var(--tw-border-opacity))",
19
- },
20
- ".dark &[aria-invalid=true]:hover": {
21
- "--tw-border-opacity": "1",
22
- "borderColor": "rgba(248, 113, 113, var(--tw-border-opacity))",
23
- },
24
-
25
- "@media (prefers-color-scheme: dark)": {
26
- "&[aria-invalid=true]": {
27
- "--tw-border-opacity": "1",
28
- "borderColor": "rgba(220, 38, 38, var(--tw-border-opacity))",
29
- },
30
- "&[aria-invalid=true]:hover": {
31
- "--tw-border-opacity": "1",
32
- "border-color": "rgba(220, 38, 38, var(--tw-border-opacity))",
33
- },
34
- },
35
-
36
- "&:checked": {
37
- borderColor: "transparent",
38
- },
39
-
40
- // colors
41
- ...colors.reduce(
42
- (styles, color) => ({
43
- ...styles,
44
- [`&[data-color="${color}"]`]: {
45
- [`@apply text-${color}-600`]: {},
46
- [`@apply focus-visible:border-${color}-600 focus-visible:ring-${color}-600`]: {},
47
- [`@apply dark:text-${color}-500`]: {},
48
- [`@apply dark:focus-visible:border-${color}-400 dark:focus-visible:ring-${color}-400`]: {},
49
- },
50
- }),
51
- {}
52
- ),
53
-
54
- "@apply dark:focus-visible:ring-offset-neutral-900": {},
55
-
56
- // sizing
57
- "&-sm": {
58
- "@apply w-3 h-3": {},
59
- },
60
-
61
- "&-md": {
62
- "@apply w-4 h-4": {},
63
- },
64
-
65
- "&-lg": {
66
- "@apply w-5 h-5": {},
67
- },
68
-
69
- "&-xl": {
70
- "@apply w-6 h-6": {},
71
- },
72
-
73
- // disabled
74
- "&-disabled": {
75
- "@apply disabled:shadow-none disabled:border-neutral-300 disabled:bg-neutral-300 disabled:hover:text-neutral-300": {},
76
- "@apply dark:disabled:border-transparent dark:disabled:bg-whiteAlpha-200 dark:disabled:hover:text-whiteAlpha-200": {},
77
- },
78
-
79
- // label
80
- "&-label": {
81
- "@apply ml-2 select-none text-sm": {},
82
- "@apply text-neutral-900": {},
83
- // dark colors
84
- "@apply dark:text-neutral-100": {},
85
-
86
- "&-sm": {
87
- "@apply text-xs": {},
88
- },
89
-
90
- "&-md": {
91
- "@apply text-sm": {},
92
- },
93
-
94
- "&-lg": {
95
- "@apply text-base": {},
96
- },
97
-
98
- "&-xl": {
99
- "@apply text-lg": {},
100
- },
101
- },
102
- },
103
- });
1
+ module.exports = Radio = (colors) => ({
2
+ ".form-radio": {
3
+ "@apply shadow-sm": {},
4
+ backgroundColor: "inherit",
5
+ "@apply border-neutral-300": {},
6
+ "&[aria-invalid=true]": {
7
+ "--tw-border-opacity": "1",
8
+ "borderColor": "rgba(220, 38, 38, var(--tw-border-opacity))",
9
+ },
10
+ "&[aria-invalid=true]:hover": {
11
+ "--tw-border-opacity": "1",
12
+ "border-color": "rgba(220, 38, 38, var(--tw-border-opacity))",
13
+ },
14
+ // dark colors
15
+ "@apply dark:border-neutral-400": {},
16
+ ".dark &[aria-invalid=true]": {
17
+ "--tw-border-opacity": "1",
18
+ "borderColor": "rgba(248, 113, 113, var(--tw-border-opacity))",
19
+ },
20
+ ".dark &[aria-invalid=true]:hover": {
21
+ "--tw-border-opacity": "1",
22
+ "borderColor": "rgba(248, 113, 113, var(--tw-border-opacity))",
23
+ },
24
+
25
+ "@media (prefers-color-scheme: dark)": {
26
+ "&[aria-invalid=true]": {
27
+ "--tw-border-opacity": "1",
28
+ "borderColor": "rgba(220, 38, 38, var(--tw-border-opacity))",
29
+ },
30
+ "&[aria-invalid=true]:hover": {
31
+ "--tw-border-opacity": "1",
32
+ "border-color": "rgba(220, 38, 38, var(--tw-border-opacity))",
33
+ },
34
+ },
35
+
36
+ "&:checked": {
37
+ borderColor: "transparent",
38
+ },
39
+
40
+ // colors
41
+ ...colors.reduce(
42
+ (styles, color) => ({
43
+ ...styles,
44
+ [`&[data-color="${color}"]`]: {
45
+ [`@apply text-${color}-600`]: {},
46
+ [`@apply focus-visible:border-${color}-600 focus-visible:ring-${color}-600`]: {},
47
+ [`@apply dark:text-${color}-500`]: {},
48
+ [`@apply dark:focus-visible:border-${color}-400 dark:focus-visible:ring-${color}-400`]: {},
49
+ },
50
+ }),
51
+ {}
52
+ ),
53
+
54
+ "@apply dark:focus-visible:ring-offset-neutral-900": {},
55
+
56
+ // sizing
57
+ "&-sm": {
58
+ "@apply w-3 h-3": {},
59
+ },
60
+
61
+ "&-md": {
62
+ "@apply w-4 h-4": {},
63
+ },
64
+
65
+ "&-lg": {
66
+ "@apply w-5 h-5": {},
67
+ },
68
+
69
+ "&-xl": {
70
+ "@apply w-6 h-6": {},
71
+ },
72
+
73
+ // disabled
74
+ "&-disabled": {
75
+ "@apply disabled:shadow-none disabled:border-neutral-300 disabled:bg-neutral-300 disabled:hover:text-neutral-300": {},
76
+ "@apply dark:disabled:border-transparent dark:disabled:bg-whiteAlpha-200 dark:disabled:hover:text-whiteAlpha-200": {},
77
+ },
78
+
79
+ // label
80
+ "&-label": {
81
+ "@apply ml-2 select-none text-sm": {},
82
+ "@apply text-neutral-900": {},
83
+ // dark colors
84
+ "@apply dark:text-neutral-100": {},
85
+
86
+ "&-sm": {
87
+ "@apply text-xs": {},
88
+ },
89
+
90
+ "&-md": {
91
+ "@apply text-sm": {},
92
+ },
93
+
94
+ "&-lg": {
95
+ "@apply text-base": {},
96
+ },
97
+
98
+ "&-xl": {
99
+ "@apply text-lg": {},
100
+ },
101
+ },
102
+ },
103
+ });
@@ -1,112 +1,112 @@
1
- module.exports = Switch = (colors) => ({
2
- ".form-switch-label": {
3
- "@apply inline-block align-middle": {},
4
- },
5
- ".form-switch": {
6
- "@apply rounded-full p-0.5 cursor-base focus:outline-none": {},
7
- "@apply bg-gray-stroke dark:bg-neutral-700": {},
8
- // Hover
9
- //"@apply hover:bg-neutral-300 dark:hover:bg-neutral-600": {},
10
-
11
- border: "0.1rem solid transparent",
12
-
13
- "input[type=checkbox]:checked + &, input[type=checkbox][aria-checked=mixed] + &": {
14
- backgroundColor: "currentColor",
15
- ".form-switch-box-sm": {
16
- transform: "translateX(1.42rem)",
17
- },
18
- ".form-switch-box-md": {
19
- transform: "translateX(1.6rem)",
20
- },
21
- ".form-switch-box-lg": {
22
- transform: "translateX(1.78rem)",
23
- },
24
- },
25
-
26
-
27
-
28
- "input[type=checkbox]:focus-visible + &": {
29
- "@apply z-base !important": {},
30
- "@apply border-primary !important": {},
31
- "@apply ring-4 ring-black !important": {},
32
- },
33
-
34
- "input[type=checkbox]:checked:focus-visible + &, input[type=checkbox][aria-checked=mixed]:focus-visible + &": {
35
- "@apply ring-black !important": {},
36
- },
37
- ".dark input[type=checkbox]:checked:focus-visible + &,.dark input[type=checkbox][aria-checked=mixed]:focus-visible + &": {
38
- "@apply ring-black !important": {},
39
- },
40
- "input[type=checkbox]:checked:hover:not(:disabled) + &, input[type=checkbox][aria-checked=mixed]:hover:not(:disabled) + &": {
41
- "@apply cursor-base": {},
42
- },
43
-
44
- // colors
45
- ...colors.reduce(
46
- (styles, color) => ({
47
- ...styles,
48
- [`&[data-color="${color}"]`]: {
49
- [`@apply text-${color}`]: {},
50
-
51
- "input[type=checkbox]:focus + &": {
52
- borderColor: `theme('colors.${color}.DEFAULT')`,
53
- boxShadow: `0 0 5px theme('colors.${color}.DEFAULT')`,
54
- borderWidth: "0.1rem",
55
- },
56
- },
57
- }),
58
- {}
59
- ),
60
-
61
- // disabled
62
- "&-disabled": {
63
- "@apply cursor-not-allowed": {},
64
-
65
- "&": {
66
- backgroundColor: "#ECECEC",
67
- }
68
- },
69
-
70
- "input[type=checkbox]:not(:checked) + &-disabled .form-switch-box": {
71
- "@apply bg-gray-stroke": {},
72
- },
73
-
74
-
75
- // sizing
76
- "&-sm": {
77
- height: "2.16rem",
78
- width: "3.6rem",
79
- },
80
-
81
- "&-md": {
82
- height: "2.4rem",
83
- width: "4rem",
84
- },
85
-
86
- "&-lg": {
87
- height: "2.64rem",
88
- width: "4.4rem",
89
- },
90
- },
91
-
92
- // Knob
93
- ".form-switch-box": {
94
- "@apply transition-transform ease-in-out duration-150 transform bg-white rounded-full shadow translate-x-0": {},
95
-
96
- // sizing
97
- "&-sm": {
98
- height: "1.6rem",
99
- width: "1.7rem",
100
- },
101
-
102
- "&-md": {
103
- height: "2rem",
104
- width: "2rem",
105
- },
106
-
107
- "&-lg": {
108
- height: "2.2rem",
109
- width: "2.2rem",
110
- },
111
- },
112
- });
1
+ module.exports = Switch = (colors) => ({
2
+ ".form-switch-label": {
3
+ "@apply inline-block align-middle": {},
4
+ },
5
+ ".form-switch": {
6
+ "@apply rounded-full p-0.5 cursor-base focus:outline-none": {},
7
+ "@apply bg-gray-stroke dark:bg-neutral-700": {},
8
+ // Hover
9
+ //"@apply hover:bg-neutral-300 dark:hover:bg-neutral-600": {},
10
+
11
+ border: "0.1rem solid transparent",
12
+
13
+ "input[type=checkbox]:checked + &, input[type=checkbox][aria-checked=mixed] + &": {
14
+ backgroundColor: "currentColor",
15
+ ".form-switch-box-sm": {
16
+ transform: "translateX(1.42rem)",
17
+ },
18
+ ".form-switch-box-md": {
19
+ transform: "translateX(1.6rem)",
20
+ },
21
+ ".form-switch-box-lg": {
22
+ transform: "translateX(1.78rem)",
23
+ },
24
+ },
25
+
26
+
27
+
28
+ "input[type=checkbox]:focus-visible + &": {
29
+ "@apply z-base !important": {},
30
+ "@apply border-primary !important": {},
31
+ "@apply ring-4 ring-black !important": {},
32
+ },
33
+
34
+ "input[type=checkbox]:checked:focus-visible + &, input[type=checkbox][aria-checked=mixed]:focus-visible + &": {
35
+ "@apply ring-black !important": {},
36
+ },
37
+ ".dark input[type=checkbox]:checked:focus-visible + &,.dark input[type=checkbox][aria-checked=mixed]:focus-visible + &": {
38
+ "@apply ring-black !important": {},
39
+ },
40
+ "input[type=checkbox]:checked:hover:not(:disabled) + &, input[type=checkbox][aria-checked=mixed]:hover:not(:disabled) + &": {
41
+ "@apply cursor-base": {},
42
+ },
43
+
44
+ // colors
45
+ ...colors.reduce(
46
+ (styles, color) => ({
47
+ ...styles,
48
+ [`&[data-color="${color}"]`]: {
49
+ [`@apply text-${color}`]: {},
50
+
51
+ "input[type=checkbox]:focus + &": {
52
+ borderColor: `theme('colors.${color}.DEFAULT')`,
53
+ boxShadow: `0 0 5px theme('colors.${color}.DEFAULT')`,
54
+ borderWidth: "0.1rem",
55
+ },
56
+ },
57
+ }),
58
+ {}
59
+ ),
60
+
61
+ // disabled
62
+ "&-disabled": {
63
+ "@apply cursor-not-allowed": {},
64
+
65
+ "&": {
66
+ backgroundColor: "#ECECEC",
67
+ }
68
+ },
69
+
70
+ "input[type=checkbox]:not(:checked) + &-disabled .form-switch-box": {
71
+ "@apply bg-gray-stroke": {},
72
+ },
73
+
74
+
75
+ // sizing
76
+ "&-sm": {
77
+ height: "2.16rem",
78
+ width: "3.6rem",
79
+ },
80
+
81
+ "&-md": {
82
+ height: "2.4rem",
83
+ width: "4rem",
84
+ },
85
+
86
+ "&-lg": {
87
+ height: "2.64rem",
88
+ width: "4.4rem",
89
+ },
90
+ },
91
+
92
+ // Knob
93
+ ".form-switch-box": {
94
+ "@apply transition-transform ease-in-out duration-150 transform bg-white rounded-full shadow translate-x-0": {},
95
+
96
+ // sizing
97
+ "&-sm": {
98
+ height: "1.6rem",
99
+ width: "1.7rem",
100
+ },
101
+
102
+ "&-md": {
103
+ height: "2rem",
104
+ width: "2rem",
105
+ },
106
+
107
+ "&-lg": {
108
+ height: "2.2rem",
109
+ width: "2.2rem",
110
+ },
111
+ },
112
+ });
@@ -1,13 +1,13 @@
1
- module.exports = Table = () => ({
2
- ".table": {
3
- "@apply min-w-full border-collapse border-gray-stroke divide-gray-lighter table-auto": {},
4
-
5
- "&-item": {
6
- "@apply px-6 py-4 border border-gray-stroke whitespace-nowrap": {},
7
-
8
- "&:nth-child(odd)": {
9
- "@apply bg-gray-lighter": {},
10
- }
11
- }
12
- },
13
- });
1
+ module.exports = Table = () => ({
2
+ ".table": {
3
+ "@apply min-w-full border-collapse border-gray-stroke divide-gray-lighter table-auto": {},
4
+
5
+ "&-item": {
6
+ "@apply px-6 py-4 border border-gray-stroke whitespace-nowrap": {},
7
+
8
+ "&:nth-child(odd)": {
9
+ "@apply bg-gray-lighter": {},
10
+ }
11
+ }
12
+ },
13
+ });