@sk-web-gui/core 0.1.25 → 0.1.28
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/accordion.js +5 -1
- package/src/components/button.js +29 -16
- package/src/components/calendar.js +81 -0
- package/src/components/cookie-consent.js +4 -0
- package/src/components/forms.js +9 -1
- package/src/components/link.js +5 -10
- package/src/components/message.js +1 -3
- package/src/components/pagination.js +2 -2
- package/src/components/switch.js +10 -0
- package/src/components/tag.js +1 -1
- package/src/components/user-menu.js +1 -1
- package/src/components/zebratable.js +4 -0
- package/src/index.js +2 -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.28",
|
|
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": "15182a6ef4eb5d75181591a9285bc7c475cd07c9"
|
|
35
35
|
}
|
package/src/components/button.js
CHANGED
|
@@ -2,10 +2,10 @@ function buttonSolid(colors) {
|
|
|
2
2
|
return {
|
|
3
3
|
"&-solid": {
|
|
4
4
|
//"@apply text-": {},
|
|
5
|
-
"@apply border border-gray-stroke": {},
|
|
6
|
-
"@apply text-
|
|
5
|
+
"@apply font-semibold border border-gray-stroke": {},
|
|
6
|
+
"@apply text-body bg-white": {},
|
|
7
7
|
/* hover */
|
|
8
|
-
"@apply hover:text-white hover:bg-hover": {},
|
|
8
|
+
"@apply hover:text-white hover:bg-hover hover:border-primary-active": {},
|
|
9
9
|
/* focus */
|
|
10
10
|
"@apply focus-visible:z-base": {},
|
|
11
11
|
"@apply focus-visible:border-primary": {},
|
|
@@ -24,13 +24,6 @@ function buttonSolid(colors) {
|
|
|
24
24
|
/* dark active */
|
|
25
25
|
"@apply dark:active:bg-neutral-900 dark:active:border-neutral-600": {},
|
|
26
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
27
|
...colors.reduce(
|
|
35
28
|
(styles, color) => ({
|
|
36
29
|
...styles,
|
|
@@ -65,6 +58,16 @@ function buttonSolid(colors) {
|
|
|
65
58
|
{}
|
|
66
59
|
),
|
|
67
60
|
|
|
61
|
+
"&[data-color='primary']": {
|
|
62
|
+
"@apply border-primary hover:border-primary-active": {},
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
"&.btn": {
|
|
66
|
+
"&-disabled": {
|
|
67
|
+
"@apply disabled:border-gray-stroke hover:border-gray-stroke": {},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
|
|
68
71
|
},
|
|
69
72
|
};
|
|
70
73
|
}
|
|
@@ -72,10 +75,10 @@ function buttonSolid(colors) {
|
|
|
72
75
|
function buttonOutline(colors) {
|
|
73
76
|
return {
|
|
74
77
|
"&-outline": {
|
|
75
|
-
"@apply border border-
|
|
78
|
+
"@apply font-semibold border border-gray-stroke": {},
|
|
76
79
|
"@apply text-body bg-transparent": {},
|
|
77
80
|
/* hover */
|
|
78
|
-
"@apply hover:bg-
|
|
81
|
+
"@apply hover:text-white hover:bg-primary-active hover:border-primary-active": {},
|
|
79
82
|
/* focus */
|
|
80
83
|
"@apply focus-visible:z-base": {},
|
|
81
84
|
"@apply focus-visible:border-primary-500": {},
|
|
@@ -99,7 +102,7 @@ function buttonOutline(colors) {
|
|
|
99
102
|
[`@apply border-current`]: {},
|
|
100
103
|
[`@apply text-${color}-600 bg-transparent`]: {},
|
|
101
104
|
/* hover */
|
|
102
|
-
[`@apply hover:bg-${color}-
|
|
105
|
+
[`@apply hover:text-white hover:bg-${color}-active hover:border-${color}-active`]: {},
|
|
103
106
|
/* focus */
|
|
104
107
|
[`@apply focus-visible:border-${color}-500`]: {},
|
|
105
108
|
[`@apply focus-visible:ring-${color}-500`]: {},
|
|
@@ -122,6 +125,13 @@ function buttonOutline(colors) {
|
|
|
122
125
|
}),
|
|
123
126
|
{}
|
|
124
127
|
),
|
|
128
|
+
|
|
129
|
+
"&.btn": {
|
|
130
|
+
"&-disabled": {
|
|
131
|
+
"@apply disabled:border-gray-stroke hover:border-gray-stroke": {},
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
|
|
125
135
|
},
|
|
126
136
|
};
|
|
127
137
|
}
|
|
@@ -252,7 +262,7 @@ module.exports = Button = (colors) => ({
|
|
|
252
262
|
".btn": {
|
|
253
263
|
"@apply relative": {},
|
|
254
264
|
"@apply m-0": {},
|
|
255
|
-
"@apply inline-flex items-center justify-center flex-shrink-0 align-middle": {},
|
|
265
|
+
"@apply rounded-lg inline-flex items-center justify-center flex-shrink-0 align-middle": {},
|
|
256
266
|
"@apply font-medium leading-tight": {},
|
|
257
267
|
transitionProperty: "background-color, border-color, color, fill, stroke, box-shadow",
|
|
258
268
|
"@apply duration-75 ease-out": {},
|
|
@@ -260,7 +270,10 @@ module.exports = Button = (colors) => ({
|
|
|
260
270
|
"@apply focus-visible:outline-none": {},
|
|
261
271
|
|
|
262
272
|
padding: "1.2rem 3.2rem",
|
|
263
|
-
|
|
273
|
+
|
|
274
|
+
"&[data-rounded='true']": {
|
|
275
|
+
borderRadius: "3.2rem"
|
|
276
|
+
},
|
|
264
277
|
|
|
265
278
|
// sizing
|
|
266
279
|
"&-sm": {
|
|
@@ -282,7 +295,7 @@ module.exports = Button = (colors) => ({
|
|
|
282
295
|
|
|
283
296
|
"&-disabled": {
|
|
284
297
|
"@apply disabled:shadow-none disabled:cursor-not-allowed": {},
|
|
285
|
-
"@apply disabled:text-
|
|
298
|
+
"@apply disabled:text-gray disabled:bg-gray-light !important": {},
|
|
286
299
|
},
|
|
287
300
|
|
|
288
301
|
// variants
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
module.exports = Calendar = () => ({
|
|
2
|
+
|
|
3
|
+
// Month row
|
|
4
|
+
".MuiCalendarPicker-root > div:first-of-type": {
|
|
5
|
+
"@apply ml-2 -mr-2 px-10": {},
|
|
6
|
+
},
|
|
7
|
+
|
|
8
|
+
// Month
|
|
9
|
+
".MuiCalendarPicker-root > div:first-of-type > div": {
|
|
10
|
+
"@apply font-bold text-base text-body": {},
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
// Arrow switchers
|
|
14
|
+
".MuiCalendarPicker-root > div:first-of-type .MuiButtonBase-root .MuiSvgIcon-root": {
|
|
15
|
+
"@apply text-body text-lg": {},
|
|
16
|
+
},
|
|
17
|
+
".MuiCalendarPicker-root > div:first-of-type .MuiButtonBase-root": {
|
|
18
|
+
"@apply border-solid border border-transparent focus:text-transparent hover:text-transparent focus:bg-transparent hover:bg-transparent focus:border-primary hover:border-primary": {},
|
|
19
|
+
},
|
|
20
|
+
".MuiCalendarPicker-root > div:first-of-type .MuiButtonBase-root": {
|
|
21
|
+
"@apply border-solid border border-transparent focus:text-transparent hover:text-transparent focus:bg-transparent hover:bg-transparent focus:border-primary hover:border-primary": {},
|
|
22
|
+
},
|
|
23
|
+
// Arrow spacer
|
|
24
|
+
".MuiCalendarPicker-root .MuiPickersArrowSwitcher-spacer": {
|
|
25
|
+
"@apply w-11": {},
|
|
26
|
+
},
|
|
27
|
+
// Disabled arrow
|
|
28
|
+
".MuiCalendarPicker-root > div:first-of-type .MuiButtonBase-root[disabled] .MuiSvgIcon-root": {
|
|
29
|
+
"@apply text-gray-stroke": {},
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
// Weekdays
|
|
33
|
+
".MuiCalendarPicker-root div > div:first-of-type > .MuiTypography-root": {
|
|
34
|
+
"@apply font-bold text-body text-base":{},
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
// Days-Grid
|
|
38
|
+
".MuiCalendarPicker-root > div:last-of-type > div:last-of-type": {
|
|
39
|
+
"@apply min-h-min pb-6":{},
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
// Day picking
|
|
43
|
+
".MuiCalendarPicker-root .MuiPickersDay-root": {
|
|
44
|
+
"@apply text-base":{},
|
|
45
|
+
},
|
|
46
|
+
".MuiCalendarPicker-root .Mui-disabled": {
|
|
47
|
+
"@apply text-gray-stroke":{},
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
// Day picked
|
|
51
|
+
".MuiCalendarPicker-root .MuiButtonBase-root.MuiPickersDay-root.Mui-selected": {
|
|
52
|
+
"@apply bg-background-one text-body focus-visible:bg-background-one hover:bg-background-one focus:bg-background-one": {},
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
// Day hovered
|
|
56
|
+
".MuiCalendarPicker-root .MuiPickersDay-root, .MuiCalendarPicker-root .MuiPickersDay-root.MuiPickersDay-today": {
|
|
57
|
+
"@apply border-primary border-solid focus-visible:border hover:bg-transparent focus:bg-transparent hover:border": {},
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
// today
|
|
61
|
+
".MuiCalendarPicker-root .MuiPickersDay-root.MuiPickersDay-today": {
|
|
62
|
+
"@apply border-0 hover:border":{},
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
".calendar": {
|
|
66
|
+
// Input field
|
|
67
|
+
".datepicker-input": {
|
|
68
|
+
"@apply relative": {},
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
".datepicker-input input": {
|
|
72
|
+
"@apply pl-20 cursor-pointer":{},
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
".datepicker-input-icon": {
|
|
76
|
+
"@apply pointer-events-none absolute m-6 top-0 left-0 text-xl fill-body":{},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
});
|
|
@@ -4,6 +4,10 @@ module.exports = CookieConsent = () => ({
|
|
|
4
4
|
|
|
5
5
|
"&-close-btn": {
|
|
6
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
|
+
"&-icon": {
|
|
9
|
+
"@apply !text-2xl": {}
|
|
10
|
+
},
|
|
7
11
|
},
|
|
8
12
|
|
|
9
13
|
"&-content-wrapper": {
|
package/src/components/forms.js
CHANGED
|
@@ -242,7 +242,15 @@ module.exports = Forms = (colors) => ({
|
|
|
242
242
|
},
|
|
243
243
|
|
|
244
244
|
".form-select": {
|
|
245
|
-
//"@apply
|
|
245
|
+
// "@apply ":{}
|
|
246
|
+
|
|
247
|
+
"&-option": {
|
|
248
|
+
"@apply rounded-none cursor-default hover:text-white focus-visible:text-white hover:bg-primary focus-visible:bg-primary": {},
|
|
249
|
+
|
|
250
|
+
"&.active": {
|
|
251
|
+
"@apply bg-primary text-white": {},
|
|
252
|
+
}
|
|
253
|
+
}
|
|
246
254
|
},
|
|
247
255
|
|
|
248
256
|
...formInputGroup(),
|
package/src/components/link.js
CHANGED
|
@@ -6,16 +6,11 @@ module.exports = Link = () => ({
|
|
|
6
6
|
|
|
7
7
|
"@apply hover:text-primary-active": {},
|
|
8
8
|
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
content: "'launch'",
|
|
15
|
-
lineHeight: "1",
|
|
16
|
-
marginLeft: ".25em",
|
|
17
|
-
verticalAlign: "text-top",
|
|
18
|
-
},
|
|
9
|
+
"&-external-icon": {
|
|
10
|
+
fontSize: "0.875em !important",
|
|
11
|
+
lineHeight: "1",
|
|
12
|
+
marginLeft: ".25em",
|
|
13
|
+
verticalAlign: "text-top",
|
|
19
14
|
},
|
|
20
15
|
|
|
21
16
|
"&-disabled": {
|
|
@@ -4,8 +4,6 @@ module.exports = Message = () => ({
|
|
|
4
4
|
"@apply text-body bg-white border-l-4": {},
|
|
5
5
|
// dark
|
|
6
6
|
"@apply dark:text-neutral-100 dark:bg-neutral-700 dark:border-neutral-600": {},
|
|
7
|
-
"minWidth": "520px",
|
|
8
|
-
"width": "520px",
|
|
9
7
|
|
|
10
8
|
"&-text": {
|
|
11
9
|
"@apply text-left flex-grow": {},
|
|
@@ -54,7 +52,7 @@ module.exports = Message = () => ({
|
|
|
54
52
|
marginRight: "-0.55em",
|
|
55
53
|
|
|
56
54
|
"&-icon": {
|
|
57
|
-
|
|
55
|
+
"@apply !text-xl": {},
|
|
58
56
|
},
|
|
59
57
|
|
|
60
58
|
"&-disabled": {
|
package/src/components/switch.js
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
module.exports = Switch = (colors) => ({
|
|
2
2
|
".form-switch-label": {
|
|
3
3
|
"@apply inline-block align-middle": {},
|
|
4
|
+
|
|
5
|
+
"&[type='hidden']": {
|
|
6
|
+
"@apply hidden": {},
|
|
7
|
+
|
|
8
|
+
".form-switch": {
|
|
9
|
+
"@apply hidden": {},
|
|
10
|
+
},
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
4
14
|
},
|
|
5
15
|
".form-switch": {
|
|
6
16
|
"@apply rounded-full p-0.5 cursor-base focus:outline-none": {},
|
package/src/components/tag.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module.exports = UserMenu = (colors) => ({
|
|
2
2
|
".usermenu": {
|
|
3
3
|
// "@apply mx-sm mt-sm mb-0 px-md py-0 divide-y divide-y-2 divide-gray-300 bg-white border-2 border-white border-solid rounded":
|
|
4
|
-
"@apply text-body
|
|
4
|
+
"@apply text-body": {},
|
|
5
5
|
// "@apply ": {},
|
|
6
6
|
"&-is-open": {
|
|
7
7
|
// "@apply border-2 border-gray-300 border-solid rounded": {},
|
package/src/index.js
CHANGED
|
@@ -11,6 +11,7 @@ const ButtonGroup = require("./components/button-group");
|
|
|
11
11
|
const Checkbox = require("./components/checkbox");
|
|
12
12
|
const Dot = require("./components/dot");
|
|
13
13
|
const Forms = require("./components/forms");
|
|
14
|
+
const Calendar = require("./components/calendar");
|
|
14
15
|
const IconButton = require("./components/icon-button");
|
|
15
16
|
const Icon = require("./components/icon");
|
|
16
17
|
const Link = require("./components/link");
|
|
@@ -42,6 +43,7 @@ const components = [
|
|
|
42
43
|
Checkbox,
|
|
43
44
|
Dot,
|
|
44
45
|
Forms,
|
|
46
|
+
Calendar,
|
|
45
47
|
IconButton,
|
|
46
48
|
Icon,
|
|
47
49
|
Link,
|