@sk-web-gui/core 0.1.2

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.
@@ -0,0 +1,295 @@
1
+ function buttonSolid(colors) {
2
+ return {
3
+ "&-solid": {
4
+ //"@apply text-": {},
5
+ "@apply border border-gray-stroke": {},
6
+ "@apply text-black bg-white": {},
7
+ /* hover */
8
+ "@apply hover:text-white hover:bg-hover": {},
9
+ /* focus */
10
+ "@apply focus-visible:z-base": {},
11
+ "@apply focus-visible:border-primary": {},
12
+ "@apply focus-visible:ring-4 focus-visible:ring-black": {},
13
+ /* active */
14
+ "@apply active:bg-hover active:text-white": {},
15
+
16
+
17
+ /* dark mode */
18
+ "@apply dark:border-neutral-600": {},
19
+ "@apply dark:text-neutral-100 dark:bg-neutral-700": {},
20
+ /* dark hover */
21
+ "@apply dark:hover:border-hover dark:hover:bg-neutral-600": {},
22
+ /* dark focus */
23
+ "@apply dark:focus-visible:border-primary-500": {},
24
+ /* dark active */
25
+ "@apply dark:active:bg-neutral-900 dark:active:border-neutral-600": {},
26
+
27
+ /* "&[data-color=\"primary\"]": {
28
+ "@apply text-white bg-primary": {},
29
+ "@apply hover:text-white hover:bg-hover": {},
30
+ "@apply active:text-white active:bg-hover": {},
31
+ "@apply focus-visible:ring-4 focus-visible:ring-black": {},
32
+ }, */
33
+
34
+ ...colors.reduce(
35
+ (styles, color) => ({
36
+ ...styles,
37
+ [`&[data-color="${color}"]`]: {
38
+ //[`@apply border-${color}`]: {},
39
+ [`@apply text-white bg-${color}`]: {},
40
+ // hover
41
+ [`@apply hover:text-white hover:bg-${color}-active`]: {},
42
+
43
+ [`@apply active:text-white active:bg-${color}-active`]: {},
44
+ [`@apply focus-visible:ring-4 focus-visible:ring-black`]: {},
45
+
46
+
47
+ // focus
48
+ //[`@apply focus-visible:bg-${color}-700`]: {},
49
+ //[`@apply focus-visible:border-${color}-500`]: {},
50
+ //[`@apply focus-visible:ring-${color}-500`]: {},
51
+ // active
52
+ //[`@apply active:bg-${color}-600`]: {},
53
+ // dark mode
54
+ //[`@apply dark:border-${color}-500`]: {},
55
+ //[`@apply dark:bg-${color}-600`]: {},
56
+ // dark hover
57
+ //[`@apply dark:hover:border-${color}-400 dark:hover:bg-${color}-500`]: {},
58
+ // dark focus
59
+ //[`@apply dark:focus-visible:border-${color}-500`]: {},
60
+ //[`@apply dark:focus-visible:ring-${color}-500`]: {},
61
+ // dark active
62
+ //[`@apply dark:active:bg-${color}-800 dark:active:border-${color}-600`]: {},
63
+ },
64
+ }),
65
+ {}
66
+ ),
67
+
68
+ },
69
+ };
70
+ }
71
+
72
+ function buttonOutline(colors) {
73
+ return {
74
+ "&-outline": {
75
+ "@apply border border-neutral-200": {},
76
+ "@apply text-neutral-900 bg-transparent": {},
77
+ /* hover */
78
+ "@apply hover:bg-neutral-100 hover:border-neutral-300": {},
79
+ /* focus */
80
+ "@apply focus-visible:z-base": {},
81
+ "@apply focus-visible:border-primary-500": {},
82
+ "@apply focus-visible:ring-4 focus-visible:ring-primary-500": {},
83
+ /* active */
84
+ "@apply active:bg-neutral-200": {},
85
+ /* dark mode */
86
+ "@apply dark:border-neutral-600": {},
87
+ "@apply dark:text-neutral-100 dark:bg-transparent": {},
88
+ /* dark hover */
89
+ "@apply dark:hover:border-neutral-300 dark:hover:bg-neutral-700": {},
90
+ /* dark focus */
91
+ "@apply dark:focus-visible:border-primary-500": {},
92
+ /* dark active */
93
+ "@apply dark:active:bg-neutral-600 dark:active:border-neutral-600": {},
94
+
95
+ ...colors.reduce(
96
+ (styles, color) => ({
97
+ ...styles,
98
+ [`&[data-color="${color}"]`]: {
99
+ [`@apply border-current`]: {},
100
+ [`@apply text-${color}-600 bg-transparent`]: {},
101
+ /* hover */
102
+ [`@apply hover:bg-${color}-50`]: {},
103
+ /* focus */
104
+ [`@apply focus-visible:border-${color}-500`]: {},
105
+ [`@apply focus-visible:ring-${color}-500`]: {},
106
+ /* active */
107
+ [`@apply active:bg-${color}-100`]: {},
108
+ /* dark mode */
109
+ [`@apply dark:border-${color}-200`]: {},
110
+ [`@apply dark:text-${color}-200 dark:bg-transparent`]: {},
111
+ [`@apply dark:border-${color}-300`]: {},
112
+ /* dark hover */
113
+ [`@apply dark:hover:bg-${color}-200`]: {},
114
+ [`@apply dark:hover:bg-opacity-15`]: {},
115
+ /* dark focus */
116
+ [`@apply dark:focus-visible:border-${color}-500`]: {},
117
+ [`@apply dark:focus-visible:ring-${color}-500`]: {},
118
+ /* dark active */
119
+ [`@apply dark:active:bg-${color}-200`]: {},
120
+ [`@apply dark:active:bg-opacity-25`]: {},
121
+ },
122
+ }),
123
+ {}
124
+ ),
125
+ },
126
+ };
127
+ }
128
+
129
+ function buttonGhost(colors) {
130
+ return {
131
+ "&-ghost": {
132
+ "@apply text-neutral-900 bg-transparent": {},
133
+ "@apply hover:bg-neutral-100": {},
134
+ /* focus */
135
+ "@apply focus-visible:z-base": {},
136
+ "@apply focus-visible:ring-4 focus-visible:ring-primary-500": {},
137
+ /* active */
138
+ "@apply active:bg-neutral-200": {},
139
+ /* dark mode */
140
+ "@apply dark:text-neutral-100 dark:bg-transparent": {},
141
+ /* dark hover */
142
+ "@apply dark:hover:border-neutral-300 dark:hover:bg-neutral-700": {},
143
+ /* dark active */
144
+ "@apply dark:active:bg-neutral-600 dark:active:border-neutral-400": {},
145
+
146
+ ...colors.reduce(
147
+ (styles, color) => ({
148
+ ...styles,
149
+ [`&[data-color="${color}"]`]: {
150
+ [`@apply text-${color}-600`]: {},
151
+ [`@apply hover:bg-${color}-50`]: {},
152
+ /* focus */
153
+ [`@apply focus-visible:ring-${color}-500`]: {},
154
+ [`@apply active:bg-${color}-100`]: {},
155
+ // dark colors
156
+ [`@apply dark:text-${color}-200 dark:bg-transparent`]: {},
157
+ [`@apply dark:border-${color}-300 dark:hover:bg-${color}-200`]: {},
158
+ [`@apply dark:hover:bg-opacity-15`]: {},
159
+ [`@apply dark:active:bg-${color}-200`]: {},
160
+ [`@apply dark:active:bg-opacity-25`]: {},
161
+ },
162
+ }),
163
+ {}
164
+ ),
165
+ },
166
+ };
167
+ }
168
+
169
+ function buttonLight(colors) {
170
+ return {
171
+ "&-light": {
172
+ "@apply shadow-sm": {},
173
+ "@apply border border-transparent": {},
174
+ "@apply text-neutral-900 bg-neutral-100": {},
175
+ /* hover */
176
+ "@apply hover:bg-neutral-200": {},
177
+ /* focus */
178
+ "@apply focus-visible:z-base": {},
179
+ "@apply focus-visible:border-primary-500": {},
180
+ "@apply focus-visible:ring-4 focus-visible:ring-primary-500": {},
181
+ /* active */
182
+ "@apply active:bg-neutral-300": {},
183
+ /* dark mode */
184
+ "@apply dark:border-transparent": {},
185
+ "@apply dark:text-neutral-100 dark:bg-neutral-700": {},
186
+ /* dark hover */
187
+ "@apply dark:hover:bg-neutral-600": {},
188
+ /* dark focus */
189
+ "@apply dark:focus-visible:border-primary-500": {},
190
+ /* dark active */
191
+ "@apply dark:active:bg-neutral-600": {},
192
+
193
+ ...colors.reduce(
194
+ (styles, color) => ({
195
+ ...styles,
196
+ [`&[data-color="${color}"]`]: {
197
+ [`@apply text-${color}-600 bg-${color}-50`]: {},
198
+ /* hover */
199
+ [`@apply hover:bg-${color}-100`]: {},
200
+ /* focus */
201
+ [`@apply focus-visible:border-${color}-500`]: {},
202
+ [`@apply focus-visible:ring-${color}-500`]: {},
203
+ /* active */
204
+ [`@apply active:bg-${color}-200`]: {},
205
+ /* dark mode */
206
+ [`@apply dark:text-${color}-300 dark:bg-${color}-500`]: {},
207
+ [`@apply dark:bg-opacity-15`]: {},
208
+ /* dark hover */
209
+ [`@apply dark:hover:bg-${color}-500`]: {},
210
+ [`@apply dark:hover:bg-opacity-25`]: {},
211
+ /* dark focus */
212
+ [`@apply dark:focus-visible:border-${color}-500`]: {},
213
+ [`@apply dark:focus-visible:ring-${color}-500`]: {},
214
+ /* dark active */
215
+ [`@apply dark:active:bg-${color}-500`]: {},
216
+ [`@apply dark:active:bg-opacity-30`]: {},
217
+ },
218
+ }),
219
+ {}
220
+ ),
221
+ },
222
+ };
223
+ }
224
+
225
+ function buttonLink(colors) {
226
+ return {
227
+ "&-link": {
228
+ "@apply h-auto p-0 leading-normal text-neutral-600 hover:underline active:text-neutral-700": {},
229
+ "@apply focus-visible:z-base focus-visible:ring-4 focus-visible:ring-primary-500": {},
230
+ // dark colors
231
+ "@apply dark:text-neutral-200": {},
232
+ "@apply dark:active:text-neutral-500": {},
233
+
234
+ ...colors.reduce(
235
+ (styles, color) => ({
236
+ ...styles,
237
+ [`&[data-color="${color}"]`]: {
238
+ [`@apply text-${color}-600 active:text-${color}-700`]: {},
239
+ [`@apply focus-visible:ring-${color}-500`]: {},
240
+ // dark colors
241
+ [`@apply dark:text-${color}-200`]: {},
242
+ [`@apply dark:active:text-${color}-500`]: {},
243
+ },
244
+ }),
245
+ {}
246
+ ),
247
+ },
248
+ };
249
+ }
250
+
251
+ module.exports = Button = (colors) => ({
252
+ ".btn": {
253
+ "@apply relative": {},
254
+ "@apply m-0": {},
255
+ "@apply inline-flex items-center justify-center flex-shrink-0 align-middle": {},
256
+ "@apply font-medium leading-tight": {},
257
+ transitionProperty: "background-color, border-color, color, fill, stroke, box-shadow",
258
+ "@apply duration-75 ease-out": {},
259
+ "@apply outline-none appearance-none cursor-base select-none whitespace-nowrap": {},
260
+ "@apply focus-visible:outline-none": {},
261
+
262
+ padding: "1.2rem 3.2rem",
263
+ borderRadius: "3.2rem",
264
+
265
+ // sizing
266
+ "&-sm": {
267
+ "@apply text-xs": {},
268
+ // minWidth: "1.75rem",
269
+ },
270
+
271
+ "&-md": {
272
+ "@apply text-sm": {},
273
+ // minWidth: "2rem",
274
+ },
275
+
276
+ "&-lg": {
277
+ "@apply text-base": {},
278
+ // minWidth: "2.5rem",
279
+ },
280
+
281
+ // State
282
+
283
+ "&-disabled": {
284
+ "@apply disabled:shadow-none disabled:cursor-not-allowed": {},
285
+ "@apply disabled:text-black disabled:bg-gray-light !important": {},
286
+ },
287
+
288
+ // variants
289
+ ...buttonSolid(colors),
290
+ ...buttonOutline(colors),
291
+ //...buttonGhost(colors),
292
+ //...buttonLight(colors),
293
+ ...buttonLink(colors),
294
+ },
295
+ });
@@ -0,0 +1,55 @@
1
+ module.exports = Card = () => ({
2
+
3
+ ".avatar": {
4
+ "@apply bg-primary-light text-primary rounded-full p-4": {},
5
+ },
6
+
7
+ ".card-list": {
8
+ "@apply grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-10": {},
9
+ //"@apply text-center": {},
10
+ //"@apply justify-center items-center": {},
11
+ },
12
+
13
+ ".card": {
14
+ "@apply p-lg rounded shadow-lg bg-white relative": {},
15
+ "@apply p-0": {},
16
+ //padding: "2.4rem",
17
+
18
+ // clickable
19
+ "&-clickable": {
20
+ // Hover
21
+ "@apply hover:shadow-xl hover:cursor-pointer": {},
22
+ },
23
+
24
+ // "@apply bg-neutral-200 border border-neutral-100 text-neutral-900": {},
25
+ // dark
26
+ //"@apply dark:bg-neutral-700 dark:border-neutral-600 dark:text-neutral-300": {},
27
+ },
28
+ ".card-outlined": {
29
+ "@apply border-2 border-gray-stroke": {},
30
+ },
31
+ ".card-border-top": {
32
+ "@apply border-t-4 border-t-primary": {},
33
+ },
34
+
35
+ ".card-body": {
36
+ "@apply p-8": {},
37
+ },
38
+
39
+ ".card-image": {
40
+ "@apply object-cover": {},
41
+ "width": "100%",
42
+ "height": "250px",
43
+ },
44
+
45
+ ".card-link": {
46
+ "&::after": {
47
+ "content": "''",
48
+ "position": "absolute",
49
+ "left": "0",
50
+ "top": "0",
51
+ "right": "0",
52
+ "bottom": "0",
53
+ },
54
+ },
55
+ });
@@ -0,0 +1,128 @@
1
+ const svgToDataUri = require('mini-svg-data-uri');
2
+
3
+ module.exports = Checkbox = (colors, theme) => ({
4
+ ".form-checkbox": {
5
+ //"@apply rounded shadow-sm": {},
6
+ backgroundColor: "inherit",
7
+ "@apply border-gray-stroke focus:bg-white": {},
8
+
9
+ "&[aria-invalid=true]": {
10
+ "--tw-border-opacity": "1",
11
+ "borderColor": "rgba(220, 38, 38, var(--tw-border-opacity))",
12
+ },
13
+ "&[aria-invalid=true]:hover": {
14
+ "--tw-border-opacity": "1",
15
+ "border-color": "rgba(220, 38, 38, var(--tw-border-opacity))",
16
+ },
17
+ // dark colors
18
+ "@apply dark:border-neutral-400": {},
19
+ ".dark &[aria-invalid=true]": {
20
+ "--tw-border-opacity": "1",
21
+ "borderColor": "rgba(248, 113, 113, var(--tw-border-opacity))",
22
+ },
23
+ ".dark &[aria-invalid=true]:hover": {
24
+ "--tw-border-opacity": "1",
25
+ "borderColor": "rgba(248, 113, 113, var(--tw-border-opacity))",
26
+ },
27
+
28
+ "@media (prefers-color-scheme: dark)": {
29
+ "&[aria-invalid=true]": {
30
+ "--tw-border-opacity": "1",
31
+ "borderColor": "rgba(220, 38, 38, var(--tw-border-opacity))",
32
+ },
33
+ "&[aria-invalid=true]:hover": {
34
+ "--tw-border-opacity": "1",
35
+ "border-color": "rgba(220, 38, 38, var(--tw-border-opacity))",
36
+ },
37
+ },
38
+
39
+ "&:checked": {
40
+ "@apply text-white bg-white border-primary": {},
41
+ [`@apply focus-visible:border-primary focus-visible:ring-primary`]: {},
42
+
43
+ backgroundImage: `url("${svgToDataUri(
44
+ `<svg viewBox="0 0 16 16" fill="#005595" xmlns="http://www.w3.org/2000/svg"><path d="M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z"/></svg>`
45
+ )}")`,
46
+ //borderColor: "transparent",
47
+ },
48
+
49
+ [`&[data-color="primary"]`]: {
50
+ //[`@apply text-primary`]: {},
51
+
52
+ // dark
53
+ //[`@apply dark:text-primary`]: {},
54
+ //[`@apply dark:focus-visible:border-primary-400 dark:focus-visible:ring-primary-400`]: {},
55
+ },
56
+
57
+ // Fix focus stylign
58
+ "&:checked:hover, &:checked:focus": {
59
+ "@apply bg-white border-primary": {},
60
+ },
61
+
62
+ // colors
63
+ /*...colors.reduce(
64
+ (styles, color) => ({
65
+ ...styles,
66
+ [`&[data-color="${color}"]`]: {
67
+ [`@apply text-${color}`]: {},
68
+ [`@apply focus-visible:border-${color} focus-visible:ring-${color}`]: {},
69
+ backgroundImage: `url("${svgToDataUri(
70
+ `<svg viewBox="0 0 16 16" fill="${theme(`colors.primary_raw.DEFAULT`)}" xmlns="http://www.w3.org/2000/svg"><path d="M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z"/></svg>`
71
+ )}")`,
72
+ // dark
73
+ [`@apply dark:text-${color}`]: {},
74
+ [`@apply dark:focus-visible:border-${color}-400 dark:focus-visible:ring-${color}-400`]: {},
75
+ },
76
+ }),
77
+ {}
78
+ ),*/
79
+
80
+ "@apply dark:focus-visible:ring-offset-neutral-900": {},
81
+
82
+ // sizing
83
+ "&-sm": {
84
+ width: "1.4rem",
85
+ height: "1.4rem",
86
+ },
87
+
88
+ "&-md": {
89
+ width: "1.6rem",
90
+ height: "1.6rem",
91
+ //"@apply w-4 h-4": {},
92
+ },
93
+
94
+ "&-lg": {
95
+ width: "1.8rem",
96
+ height: "1.8rem",
97
+ },
98
+
99
+ // disabled
100
+ "&-disabled": {
101
+ backgroundColor: "#ECECEC",
102
+ //"@apply disabled:bg-gray-stroke": {},
103
+ //"@apply disabled:shadow-none disabled:border-neutral-300 disabled:bg-neutral-300 disabled:hover:text-neutral-300": {},
104
+ //"@apply dark:disabled:border-transparent dark:disabled:bg-whiteAlpha-200 dark:disabled:hover:text-whiteAlpha-200": {},
105
+ },
106
+
107
+ // label
108
+ "&-label": {
109
+ "@apply select-none text-sm": {},
110
+ marginLeft: "0.8rem",
111
+ //"@apply text-black": {},
112
+ // dark colors
113
+ "@apply dark:text-neutral-100": {},
114
+
115
+ "&-sm": {
116
+ "@apply text-xs": {},
117
+ },
118
+
119
+ "&-md": {
120
+ "@apply text-sm": {},
121
+ },
122
+
123
+ "&-lg": {
124
+ "@apply text-base": {},
125
+ },
126
+ },
127
+ },
128
+ });
@@ -0,0 +1,9 @@
1
+ module.exports = Code = () => ({
2
+ ".code": {
3
+ "@apply inline-flex justify-center items-center capitalize text-xs rounded-sm font-mono break-all": {},
4
+ "@apply bg-neutral-200 border border-neutral-100 text-neutral-900": {},
5
+ // dark
6
+ "@apply dark:bg-neutral-700 dark:border-neutral-600 dark:text-neutral-300": {},
7
+ padding: "2px 3px 1px",
8
+ },
9
+ });
@@ -0,0 +1,26 @@
1
+ module.exports = CookieConsent = () => ({
2
+ ".cookie-consent": {
3
+ "@apply min-w-full fixed flex justify-center z-10 bottom-0 left-0 right-0 bg-white": {},
4
+
5
+ "&-close-btn": {
6
+ "@apply cursor-pointer hover:text-primary-active absolute right-8 top-6 border border-transparent focus-visible:border-black flex self-center": {},
7
+ },
8
+
9
+ "&-content-wrapper": {
10
+ "@apply flex flex-col container py-12 px-4 bg-white relative": {},
11
+ },
12
+
13
+ "&-title": {
14
+ "@apply text-2xl leading-2xl mb-1 mt-4": {},
15
+ },
16
+
17
+ "&-description": {
18
+ "@apply text-base leading-base mb-8": {},
19
+ },
20
+
21
+ "&-btn-wrapper": {
22
+ "@apply flex flex-col space-y-4 lg:block lg:space-y-0 lg:space-x-4": {},
23
+ },
24
+
25
+ },
26
+ });
@@ -0,0 +1,12 @@
1
+ module.exports = Divider = () => ({
2
+ ".divider": {
3
+ "@apply border-0 opacity-60": {},
4
+ borderColor: "inherit",
5
+ "&-vertical": {
6
+ "@apply border-l border-solid h-auto mx-2": {},
7
+ },
8
+ "&-horizontal": {
9
+ "@apply border-b border-solid w-auto my-2": {},
10
+ },
11
+ },
12
+ });
@@ -0,0 +1,84 @@
1
+ module.exports = Dot = (colors) => ({
2
+ ".dot": {
3
+ "@apply relative inline-flex rounded-full": {},
4
+ "&-solid": {
5
+ "@apply bg-neutral-500": {},
6
+
7
+ ...colors.reduce(
8
+ (styles, color) => ({
9
+ ...styles,
10
+ [`&[data-color="${color}"]`]: {
11
+ [`@apply bg-${color}-500`]: {},
12
+ },
13
+ }),
14
+ {}
15
+ ),
16
+
17
+ "&.dot-bordered": {
18
+ "@apply border-2 border-white": {},
19
+ "@apply dark:border-neutral-800": {},
20
+ },
21
+
22
+ ...colors.reduce(
23
+ (styles, color) => ({
24
+ ...styles,
25
+ [`&.dot-bordered[data-color="${color}"]`]: {
26
+ [`@apply border-${color}-100`]: {},
27
+ [`@apply dark:border-${color}-300`]: {},
28
+ },
29
+ }),
30
+ {}
31
+ ),
32
+ },
33
+
34
+ "&-outline": {
35
+ "@apply bg-white border-2 border-neutral-500": {},
36
+ "@apply dark:bg-neutral-800": {},
37
+ ...colors.reduce(
38
+ (styles, color) => ({
39
+ ...styles,
40
+ [`&[data-color="${color}"]`]: {
41
+ [`@apply border-${color}-500`]: {},
42
+ },
43
+ }),
44
+ {}
45
+ ),
46
+ },
47
+
48
+ "&-3xs": {
49
+ "@apply w-1.5 h-1.5": {},
50
+ },
51
+
52
+ "&-2xs": {
53
+ "@apply w-2 h-2": {},
54
+ },
55
+
56
+ "&-xs": {
57
+ "@apply w-2.5 h-2.5": {},
58
+ },
59
+
60
+ "&-sm": {
61
+ "@apply w-3 h-3": {},
62
+ },
63
+
64
+ "&-md": {
65
+ "@apply w-3.5 h-3.5": {},
66
+ },
67
+
68
+ "&-lg": {
69
+ "@apply w-4 h-4": {},
70
+ },
71
+
72
+ "&-xl": {
73
+ "@apply w-5 h-5": {},
74
+ },
75
+
76
+ "&-2xl": {
77
+ "@apply w-6 h-6": {},
78
+ },
79
+
80
+ "&-3xl": {
81
+ "@apply w-8 h-8": {},
82
+ },
83
+ },
84
+ });