@sk-web-gui/core 0.1.93 → 1.0.0
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/dist/cjs/base.js +21 -40
- package/dist/cjs/base.js.map +1 -1
- package/dist/cjs/colors.js +629 -123
- package/dist/cjs/colors.js.map +1 -1
- package/dist/cjs/components/accordion.js +52 -141
- package/dist/cjs/components/accordion.js.map +1 -1
- package/dist/cjs/components/alert-banner.js +1 -1
- package/dist/cjs/components/alert-banner.js.map +1 -1
- package/dist/cjs/components/alert.js +6 -6
- package/dist/cjs/components/alert.js.map +1 -1
- package/dist/cjs/components/avatar.js +28 -63
- package/dist/cjs/components/avatar.js.map +1 -1
- package/dist/cjs/components/badge.js +21 -165
- package/dist/cjs/components/badge.js.map +1 -1
- package/dist/cjs/components/breadcrumb.js +15 -3
- package/dist/cjs/components/breadcrumb.js.map +1 -1
- package/dist/cjs/components/button-group.js +20 -33
- package/dist/cjs/components/button-group.js.map +1 -1
- package/dist/cjs/components/button.js +178 -151
- package/dist/cjs/components/button.js.map +1 -1
- package/dist/cjs/components/calendar.js +1 -1
- package/dist/cjs/components/calendar.js.map +1 -1
- package/dist/cjs/components/card.js +200 -39
- package/dist/cjs/components/card.js.map +1 -1
- package/dist/cjs/components/checkbox.js +97 -70
- package/dist/cjs/components/checkbox.js.map +1 -1
- package/dist/cjs/components/combobox.js +67 -0
- package/dist/cjs/components/combobox.js.map +1 -0
- package/dist/cjs/components/comments.js +2 -2
- package/dist/cjs/components/comments.js.map +1 -1
- package/dist/cjs/components/cookie-consent.js +25 -8
- package/dist/cjs/components/cookie-consent.js.map +1 -1
- package/dist/cjs/components/dialog.js +2 -9
- package/dist/cjs/components/dialog.js.map +1 -1
- package/dist/cjs/components/divider.js +43 -5
- package/dist/cjs/components/divider.js.map +1 -1
- package/dist/cjs/components/dot.js +3 -3
- package/dist/cjs/components/dot.js.map +1 -1
- package/dist/cjs/components/filter.js +17 -0
- package/dist/cjs/components/filter.js.map +1 -0
- package/dist/cjs/components/footer.js +22 -22
- package/dist/cjs/components/footer.js.map +1 -1
- package/dist/cjs/components/form-control.js +8 -0
- package/dist/cjs/components/form-control.js.map +1 -0
- package/dist/cjs/components/forms.js +13 -283
- package/dist/cjs/components/forms.js.map +1 -1
- package/dist/cjs/components/header.js +28 -17
- package/dist/cjs/components/header.js.map +1 -1
- package/dist/cjs/components/icon.js +52 -7
- package/dist/cjs/components/icon.js.map +1 -1
- package/dist/cjs/components/input.js +227 -0
- package/dist/cjs/components/input.js.map +1 -0
- package/dist/cjs/components/kbd.js +2 -2
- package/dist/cjs/components/kbd.js.map +1 -1
- package/dist/cjs/components/label.js +26 -0
- package/dist/cjs/components/label.js.map +1 -0
- package/dist/cjs/components/link.js +35 -12
- package/dist/cjs/components/link.js.map +1 -1
- package/dist/cjs/components/list.js +56 -0
- package/dist/cjs/components/list.js.map +1 -0
- package/dist/cjs/components/logo.js +50 -0
- package/dist/cjs/components/logo.js.map +1 -0
- package/dist/cjs/components/menu-vertical.js +234 -0
- package/dist/cjs/components/menu-vertical.js.map +1 -0
- package/dist/cjs/components/menubar.js +1 -1
- package/dist/cjs/components/menubar.js.map +1 -1
- package/dist/cjs/components/modal.js +34 -14
- package/dist/cjs/components/modal.js.map +1 -1
- package/dist/cjs/components/notification.js +2 -2
- package/dist/cjs/components/notification.js.map +1 -1
- package/dist/cjs/components/pagination.js +50 -29
- package/dist/cjs/components/pagination.js.map +1 -1
- package/dist/cjs/components/progress-bar.js +23 -0
- package/dist/cjs/components/progress-bar.js.map +1 -0
- package/dist/cjs/components/radio.js +113 -64
- package/dist/cjs/components/radio.js.map +1 -1
- package/dist/cjs/components/search-field.js +23 -0
- package/dist/cjs/components/search-field.js.map +1 -0
- package/dist/cjs/components/select.js +190 -0
- package/dist/cjs/components/select.js.map +1 -0
- package/dist/cjs/components/side-menu.js +7 -7
- package/dist/cjs/components/side-menu.js.map +1 -1
- package/dist/cjs/components/snackbar.js +6 -0
- package/dist/cjs/components/snackbar.js.map +1 -1
- package/dist/cjs/components/spinner.js +19 -0
- package/dist/cjs/components/spinner.js.map +1 -0
- package/dist/cjs/components/switch.js +46 -75
- package/dist/cjs/components/switch.js.map +1 -1
- package/dist/cjs/components/tabs.js +1 -1
- package/dist/cjs/components/tabs.js.map +1 -1
- package/dist/cjs/components/tag.js +4 -4
- package/dist/cjs/components/tag.js.map +1 -1
- package/dist/cjs/components/tooltip.js +61 -0
- package/dist/cjs/components/tooltip.js.map +1 -0
- package/dist/cjs/components/user-menu.js +7 -50
- package/dist/cjs/components/user-menu.js.map +1 -1
- package/dist/cjs/components/zebratable.js +89 -34
- package/dist/cjs/components/zebratable.js.map +1 -1
- package/dist/cjs/plugin.js +19 -8
- package/dist/cjs/plugin.js.map +1 -1
- package/dist/cjs/theme.js +83 -37
- package/dist/cjs/theme.js.map +1 -1
- package/dist/esm/base.js +21 -40
- package/dist/esm/base.js.map +1 -1
- package/dist/esm/colors.js +629 -123
- package/dist/esm/colors.js.map +1 -1
- package/dist/esm/components/accordion.js +52 -141
- package/dist/esm/components/accordion.js.map +1 -1
- package/dist/esm/components/alert-banner.js +1 -1
- package/dist/esm/components/alert-banner.js.map +1 -1
- package/dist/esm/components/alert.js +5 -11
- package/dist/esm/components/alert.js.map +1 -1
- package/dist/esm/components/avatar.js +32 -63
- package/dist/esm/components/avatar.js.map +1 -1
- package/dist/esm/components/badge.js +27 -172
- package/dist/esm/components/badge.js.map +1 -1
- package/dist/esm/components/breadcrumb.js +19 -2
- package/dist/esm/components/breadcrumb.js.map +1 -1
- package/dist/esm/components/button-group.js +20 -33
- package/dist/esm/components/button-group.js.map +1 -1
- package/dist/esm/components/button.js +185 -200
- package/dist/esm/components/button.js.map +1 -1
- package/dist/esm/components/calendar.js +1 -1
- package/dist/esm/components/calendar.js.map +1 -1
- package/dist/esm/components/card.js +233 -39
- package/dist/esm/components/card.js.map +1 -1
- package/dist/esm/components/checkbox.js +83 -93
- package/dist/esm/components/checkbox.js.map +1 -1
- package/dist/esm/components/combobox.js +65 -0
- package/dist/esm/components/combobox.js.map +1 -0
- package/dist/esm/components/comments.js +2 -2
- package/dist/esm/components/comments.js.map +1 -1
- package/dist/esm/components/cookie-consent.js +25 -8
- package/dist/esm/components/cookie-consent.js.map +1 -1
- package/dist/esm/components/dialog.js +2 -9
- package/dist/esm/components/dialog.js.map +1 -1
- package/dist/esm/components/divider.js +43 -5
- package/dist/esm/components/divider.js.map +1 -1
- package/dist/esm/components/dot.js +3 -4
- package/dist/esm/components/dot.js.map +1 -1
- package/dist/esm/components/filter.js +15 -0
- package/dist/esm/components/filter.js.map +1 -0
- package/dist/esm/components/footer.js +22 -24
- package/dist/esm/components/footer.js.map +1 -1
- package/dist/esm/components/form-control.js +6 -0
- package/dist/esm/components/form-control.js.map +1 -0
- package/dist/esm/components/forms.js +15 -289
- package/dist/esm/components/forms.js.map +1 -1
- package/dist/esm/components/header.js +22 -18
- package/dist/esm/components/header.js.map +1 -1
- package/dist/esm/components/icon.js +57 -7
- package/dist/esm/components/icon.js.map +1 -1
- package/dist/esm/components/input.js +225 -0
- package/dist/esm/components/input.js.map +1 -0
- package/dist/esm/components/kbd.js +2 -2
- package/dist/esm/components/kbd.js.map +1 -1
- package/dist/esm/components/label.js +30 -0
- package/dist/esm/components/label.js.map +1 -0
- package/dist/esm/components/link.js +35 -12
- package/dist/esm/components/link.js.map +1 -1
- package/dist/esm/components/list.js +54 -0
- package/dist/esm/components/list.js.map +1 -0
- package/dist/esm/components/logo.js +48 -0
- package/dist/esm/components/logo.js.map +1 -0
- package/dist/esm/components/menu-vertical.js +228 -0
- package/dist/esm/components/menu-vertical.js.map +1 -0
- package/dist/esm/components/menubar.js +1 -1
- package/dist/esm/components/menubar.js.map +1 -1
- package/dist/esm/components/modal.js +34 -14
- package/dist/esm/components/modal.js.map +1 -1
- package/dist/esm/components/notification.js +2 -2
- package/dist/esm/components/notification.js.map +1 -1
- package/dist/esm/components/pagination.js +50 -29
- package/dist/esm/components/pagination.js.map +1 -1
- package/dist/esm/components/progress-bar.js +25 -0
- package/dist/esm/components/progress-bar.js.map +1 -0
- package/dist/esm/components/radio.js +113 -68
- package/dist/esm/components/radio.js.map +1 -1
- package/dist/esm/components/search-field.js +21 -0
- package/dist/esm/components/search-field.js.map +1 -0
- package/dist/esm/components/select.js +188 -0
- package/dist/esm/components/select.js.map +1 -0
- package/dist/esm/components/side-menu.js +7 -7
- package/dist/esm/components/side-menu.js.map +1 -1
- package/dist/esm/components/snackbar.js +6 -0
- package/dist/esm/components/snackbar.js.map +1 -1
- package/dist/esm/components/spinner.js +18 -0
- package/dist/esm/components/spinner.js.map +1 -0
- package/dist/esm/components/switch.js +53 -80
- package/dist/esm/components/switch.js.map +1 -1
- package/dist/esm/components/tabs.js +1 -1
- package/dist/esm/components/tabs.js.map +1 -1
- package/dist/esm/components/tag.js +4 -4
- package/dist/esm/components/tag.js.map +1 -1
- package/dist/esm/components/tooltip.js +59 -0
- package/dist/esm/components/tooltip.js.map +1 -0
- package/dist/esm/components/user-menu.js +7 -50
- package/dist/esm/components/user-menu.js.map +1 -1
- package/dist/esm/components/zebratable.js +89 -34
- package/dist/esm/components/zebratable.js.map +1 -1
- package/dist/esm/plugin.js +19 -8
- package/dist/esm/plugin.js.map +1 -1
- package/dist/esm/theme.js +85 -37
- package/dist/esm/theme.js.map +1 -1
- package/package.json +5 -5
- package/src/base.js +28 -28
- package/src/colors.js +631 -132
- package/src/components/accordion.js +53 -161
- package/src/components/alert-banner.js +1 -2
- package/src/components/alert.js +5 -13
- package/src/components/avatar.js +36 -82
- package/src/components/badge.js +33 -200
- package/src/components/breadcrumb.js +22 -2
- package/src/components/button-group.js +17 -32
- package/src/components/button.js +197 -212
- package/src/components/card.js +273 -34
- package/src/components/checkbox.js +95 -93
- package/src/components/combobox.js +66 -0
- package/src/components/comments.js +31 -27
- package/src/components/cookie-consent.js +24 -9
- package/src/components/dialog.js +2 -9
- package/src/components/divider.js +45 -5
- package/src/components/dot.js +3 -4
- package/src/components/filter.js +16 -0
- package/src/components/footer.js +20 -33
- package/src/components/forms.js +14 -360
- package/src/components/header.js +21 -21
- package/src/components/icon.js +75 -6
- package/src/components/input.js +244 -0
- package/src/components/kbd.js +1 -1
- package/src/components/label.js +37 -0
- package/src/components/link.js +38 -12
- package/src/components/list.js +61 -0
- package/src/components/logo.js +48 -0
- package/src/components/menu-vertical.js +293 -0
- package/src/components/menubar.js +56 -0
- package/src/components/modal.js +35 -18
- package/src/components/notification.js +2 -2
- package/src/components/pagination.js +54 -31
- package/src/components/popup-menu.js +111 -0
- package/src/components/progress-bar.js +31 -0
- package/src/components/progress-stepper.js +50 -0
- package/src/components/radio.js +114 -80
- package/src/components/search-field.js +20 -0
- package/src/components/select.js +203 -0
- package/src/components/side-menu.js +7 -7
- package/src/components/snackbar.js +34 -0
- package/src/components/spinner.js +23 -0
- package/src/components/switch.js +54 -88
- package/src/components/tabs.js +1 -1
- package/src/components/tooltip.js +64 -0
- package/src/components/user-menu.js +7 -59
- package/src/components/zebratable.js +92 -41
- package/src/plugin.js +37 -15
- package/src/theme.js +105 -31
- package/src/units.js +212 -0
- package/src/components/calendar.js +0 -78
- package/src/components/message.js +0 -60
- package/src/components/profile-picture.js +0 -14
- package/src/components/profile.js +0 -33
- package/src/components/search-bar.js +0 -5
- package/src/components/tag.js +0 -96
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module.exports = Breadcrumb = () => ({
|
|
2
|
-
'.breadcrumb': {
|
|
2
|
+
'.sk-breadcrumb': {
|
|
3
3
|
'@apply text-body relative': {},
|
|
4
4
|
|
|
5
5
|
'&-item': {
|
|
@@ -7,7 +7,27 @@ module.exports = Breadcrumb = () => ({
|
|
|
7
7
|
},
|
|
8
8
|
|
|
9
9
|
'&-separator': {
|
|
10
|
-
'@apply mx-
|
|
10
|
+
'@apply mx-6': {},
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
'.sk-breadcrumb-item': {
|
|
15
|
+
span: {
|
|
16
|
+
'&[aria-current="page"]': {
|
|
17
|
+
'@apply font-bold': {},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
[`&[data-color="primary"]`]: {
|
|
22
|
+
'a.sk-link': {
|
|
23
|
+
[`@apply text-secondary`]: {},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
[`&[data-color="vattjom"]`]: {
|
|
28
|
+
'a.sk-link': {
|
|
29
|
+
[`@apply text-vattjom-text-primary`]: {},
|
|
30
|
+
},
|
|
11
31
|
},
|
|
12
32
|
},
|
|
13
33
|
});
|
|
@@ -1,45 +1,30 @@
|
|
|
1
|
-
// TODO: how it works with prefix?
|
|
2
1
|
module.exports = ButtonGroup = () => ({
|
|
3
|
-
'.btn-group': {
|
|
4
|
-
'@apply inline-
|
|
2
|
+
'.sk-btn-group': {
|
|
3
|
+
'@apply inline-flex items-center': {},
|
|
5
4
|
|
|
6
|
-
'&.btn-group-attached': {
|
|
7
|
-
'
|
|
8
|
-
|
|
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
|
-
},
|
|
5
|
+
'&.sk-btn-group-attached': {
|
|
6
|
+
'@apply rounded-groups': {},
|
|
7
|
+
'@apply bg-tertiary-surface': {},
|
|
8
|
+
'@apply py-6 px-12': {},
|
|
18
9
|
|
|
19
|
-
'>
|
|
20
|
-
|
|
21
|
-
borderBottomLeftRadius: '0px',
|
|
10
|
+
'> *': {
|
|
11
|
+
'@apply bg-transparent': {},
|
|
22
12
|
},
|
|
23
13
|
|
|
24
|
-
'
|
|
25
|
-
|
|
14
|
+
'.sk-btn[data-icon="true"] .sk-icon': {
|
|
15
|
+
'@apply bg-transparent text-dark-secondary': {},
|
|
26
16
|
},
|
|
27
17
|
|
|
28
|
-
'
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
'> *:not(:last-of-type):hover + .btn-solid, > *:not(:last-of-type):hover + .btn-outline': {
|
|
33
|
-
borderLeftWidth: '0px',
|
|
18
|
+
'.sk-icon': {
|
|
19
|
+
'@apply p-0 w-fit h-fit': {},
|
|
34
20
|
},
|
|
21
|
+
},
|
|
35
22
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
borderRightWidth: '1px',
|
|
39
|
-
},
|
|
23
|
+
'&-divider': {
|
|
24
|
+
'@apply grow bg-tertiary-surface px-6': {},
|
|
40
25
|
|
|
41
|
-
|
|
42
|
-
|
|
26
|
+
hr: {
|
|
27
|
+
'@apply h-[2rem]': {},
|
|
43
28
|
},
|
|
44
29
|
},
|
|
45
30
|
},
|
package/src/components/button.js
CHANGED
|
@@ -1,187 +1,143 @@
|
|
|
1
|
-
function
|
|
1
|
+
function buttonPrimary(colors) {
|
|
2
2
|
return {
|
|
3
|
-
'&-
|
|
4
|
-
|
|
5
|
-
'@apply font-semibold border border-gray-stroke': {},
|
|
6
|
-
'@apply text-body bg-white': {},
|
|
3
|
+
'&-primary': {
|
|
4
|
+
'@apply text-light-primary': {},
|
|
7
5
|
/* hover */
|
|
8
|
-
'@apply hover:
|
|
9
|
-
/* keyboard active */
|
|
10
|
-
'&.active': {
|
|
11
|
-
'@apply text-white bg-hover border-primary-active': {},
|
|
12
|
-
/* dark */
|
|
13
|
-
'@apply dark:border-hover dark:bg-neutral-600': {},
|
|
14
|
-
},
|
|
15
|
-
/* focus */
|
|
16
|
-
'@apply focus-visible:z-base': {},
|
|
17
|
-
'@apply focus-visible:border-primary': {},
|
|
18
|
-
'@apply focus-visible:ring-4 focus-visible:ring-black': {},
|
|
19
|
-
/* active */
|
|
20
|
-
'@apply active:bg-hover active:text-white': {},
|
|
21
|
-
|
|
22
|
-
/* dark mode */
|
|
23
|
-
'@apply dark:border-neutral-600': {},
|
|
24
|
-
'@apply dark:text-neutral-100 dark:bg-neutral-700': {},
|
|
25
|
-
/* dark hover */
|
|
26
|
-
'@apply dark:hover:border-hover dark:hover:bg-neutral-600': {},
|
|
27
|
-
/* dark focus */
|
|
28
|
-
'@apply dark:focus-visible:border-primary-500': {},
|
|
29
|
-
/* dark active */
|
|
30
|
-
'@apply dark:active:bg-neutral-900 dark:active:border-neutral-600': {},
|
|
6
|
+
'@apply hover:bg-primary-surface-hover': {},
|
|
31
7
|
|
|
32
8
|
...colors.reduce(
|
|
33
9
|
(styles, color) => ({
|
|
34
10
|
...styles,
|
|
35
11
|
[`&[data-color="${color}"]`]: {
|
|
36
|
-
|
|
37
|
-
[`@apply text-white bg-${color}`]: {},
|
|
12
|
+
[`@apply bg-${color}-surface-primary text-${color}-text-secondary`]: {},
|
|
38
13
|
// hover
|
|
39
|
-
[`@apply hover:
|
|
14
|
+
[`@apply hover:bg-${color}-surface-primary-hover hover:text-light-primary`]: {},
|
|
40
15
|
// keyboard active
|
|
41
16
|
'&.active': {
|
|
42
|
-
[`@apply
|
|
17
|
+
[`@apply bg-${color}-surface-primary-hover`]: {},
|
|
43
18
|
},
|
|
19
|
+
[`@apply active:bg-${color}-surface-primary-hover`]: {},
|
|
44
20
|
|
|
45
|
-
[
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
//[`@apply dark:bg-${color}-600`]: {},
|
|
57
|
-
// dark hover
|
|
58
|
-
//[`@apply dark:hover:border-${color}-400 dark:hover:bg-${color}-500`]: {},
|
|
59
|
-
// dark focus
|
|
60
|
-
//[`@apply dark:focus-visible:border-${color}-500`]: {},
|
|
61
|
-
//[`@apply dark:focus-visible:ring-${color}-500`]: {},
|
|
62
|
-
// dark active
|
|
63
|
-
//[`@apply dark:active:bg-${color}-800 dark:active:border-${color}-600`]: {},
|
|
21
|
+
'&[data-inverted="true"]': {
|
|
22
|
+
'@apply text-inverted-light-primary': {},
|
|
23
|
+
[`@apply bg-inverted-${color}-surface-primary text-inverted-${color}-text-secondary`]: {},
|
|
24
|
+
// hover
|
|
25
|
+
[`@apply hover:bg-inverted-${color}-surface-primary-hover hover:text-inverted-light-primary`]: {},
|
|
26
|
+
// keyboard active
|
|
27
|
+
'&.active': {
|
|
28
|
+
[`@apply bg-inverted-${color}-surface-primary-hover`]: {},
|
|
29
|
+
},
|
|
30
|
+
[`@apply active:bg-inverted-${color}-surface-primary-hover`]: {},
|
|
31
|
+
},
|
|
64
32
|
},
|
|
65
33
|
}),
|
|
66
34
|
{}
|
|
67
35
|
),
|
|
68
36
|
|
|
69
37
|
"&[data-color='primary']": {
|
|
70
|
-
'@apply
|
|
38
|
+
'@apply bg-primary-surface': {},
|
|
39
|
+
'@apply hover:bg-primary-surface-hover': {},
|
|
71
40
|
'&.active': {
|
|
72
|
-
'@apply
|
|
41
|
+
'@apply bg-primary-surface-hover': {},
|
|
73
42
|
},
|
|
74
|
-
|
|
43
|
+
[`@apply active:bg-primary-surface-hover`]: {},
|
|
75
44
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
'@apply
|
|
45
|
+
'&[data-inverted="true"]': {
|
|
46
|
+
'@apply text-inverted-light-primary': {},
|
|
47
|
+
'@apply bg-inverted-primary-surface': {},
|
|
48
|
+
'@apply hover:bg-inverted-primary-surface-hover': {},
|
|
79
49
|
'&.active': {
|
|
80
|
-
'@apply
|
|
50
|
+
'@apply bg-inverted-primary-surface-hover': {},
|
|
81
51
|
},
|
|
52
|
+
[`@apply active:bg-inverted-primary-surface-hover`]: {},
|
|
82
53
|
},
|
|
83
54
|
},
|
|
84
55
|
},
|
|
85
56
|
};
|
|
86
57
|
}
|
|
87
|
-
|
|
88
|
-
function buttonOutline(colors) {
|
|
58
|
+
function buttonSecondary() {
|
|
89
59
|
return {
|
|
90
|
-
'&-
|
|
91
|
-
'@apply
|
|
92
|
-
'@apply text-
|
|
60
|
+
'&-secondary': {
|
|
61
|
+
'@apply border-secondary-outline': {},
|
|
62
|
+
'@apply text-dark-secondary': {},
|
|
63
|
+
'@apply bg-secondary-surface': {},
|
|
93
64
|
/* hover */
|
|
94
|
-
'@apply hover:
|
|
95
|
-
|
|
96
|
-
'&.active': {
|
|
97
|
-
'@apply text-white bg-primary-active border-primary-active': {},
|
|
98
|
-
/* dark keyboard active */
|
|
99
|
-
'@apply dark:border-neutral-300 dark:bg-neutral-700': {},
|
|
100
|
-
},
|
|
65
|
+
'@apply hover:border-secondary-outline-hover': {},
|
|
66
|
+
'@apply hover:bg-secondary-surface-hover': {},
|
|
101
67
|
/* focus */
|
|
102
|
-
'@apply focus-visible:
|
|
103
|
-
'@apply focus-visible:border-primary-500': {},
|
|
104
|
-
'@apply focus-visible:ring-4 focus-visible:ring-primary-500': {},
|
|
105
|
-
/* active */
|
|
106
|
-
'@apply active:bg-neutral-200': {},
|
|
107
|
-
/* dark mode */
|
|
108
|
-
'@apply dark:border-neutral-600': {},
|
|
109
|
-
'@apply dark:text-neutral-100 dark:bg-transparent': {},
|
|
110
|
-
/* dark hover */
|
|
111
|
-
'@apply dark:hover:border-neutral-300 dark:hover:bg-neutral-700': {},
|
|
112
|
-
/* dark focus */
|
|
113
|
-
'@apply dark:focus-visible:border-primary-500': {},
|
|
114
|
-
/* dark active */
|
|
115
|
-
'@apply dark:active:bg-neutral-600 dark:active:border-neutral-600': {},
|
|
68
|
+
'@apply focus-visible:border-background-content': {},
|
|
116
69
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
[`@apply text-${color}-600 bg-transparent`]: {},
|
|
123
|
-
/* hover */
|
|
124
|
-
[`@apply hover:text-white hover:bg-${color}-active hover:border-${color}-active`]: {},
|
|
125
|
-
/* keyboard active */
|
|
126
|
-
'&.active': {
|
|
127
|
-
[`@apply text-white bg-${color}-active border-${color}-active`]: {},
|
|
70
|
+
// State
|
|
71
|
+
'&.sk-btn-disabled, &[aria-disabled="true"]': {
|
|
72
|
+
'@apply disabled:bg-secondary-surface-disabled bg-secondary-surface-disabled disabled:border-transparent border-transparent !important':
|
|
73
|
+
{},
|
|
74
|
+
},
|
|
128
75
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
/* dark mode */
|
|
139
|
-
[`@apply dark:border-${color}-200`]: {},
|
|
140
|
-
[`@apply dark:text-${color}-200 dark:bg-transparent`]: {},
|
|
141
|
-
[`@apply dark:border-${color}-300`]: {},
|
|
142
|
-
/* dark hover */
|
|
143
|
-
[`@apply dark:hover:bg-${color}-200`]: {},
|
|
144
|
-
[`@apply dark:hover:bg-opacity-15`]: {},
|
|
145
|
-
/* dark focus */
|
|
146
|
-
[`@apply dark:focus-visible:border-${color}-500`]: {},
|
|
147
|
-
[`@apply dark:focus-visible:ring-${color}-500`]: {},
|
|
148
|
-
/* dark active */
|
|
149
|
-
[`@apply dark:active:bg-${color}-200`]: {},
|
|
150
|
-
[`@apply dark:active:bg-opacity-25`]: {},
|
|
151
|
-
},
|
|
152
|
-
}),
|
|
153
|
-
{}
|
|
154
|
-
),
|
|
76
|
+
'&[data-inverted="true"]': {
|
|
77
|
+
'@apply border-inverted-secondary-outline': {},
|
|
78
|
+
'@apply text-inverted-dark-secondary': {},
|
|
79
|
+
'@apply bg-inverted-secondary-surface': {},
|
|
80
|
+
/* hover */
|
|
81
|
+
'@apply hover:border-inverted-secondary-outline-hover': {},
|
|
82
|
+
'@apply hover:bg-inverted-secondary-surface-hover': {},
|
|
83
|
+
/* focus */
|
|
84
|
+
'@apply focus-visible:border-inverted-background-content': {},
|
|
155
85
|
|
|
156
|
-
|
|
157
|
-
'
|
|
158
|
-
'@apply disabled:
|
|
159
|
-
|
|
160
|
-
'@apply border-gray-stroke': {},
|
|
161
|
-
},
|
|
86
|
+
// State
|
|
87
|
+
'&.sk-btn-disabled, &[aria-disabled="true"]': {
|
|
88
|
+
'@apply disabled:bg-inverted-secondary-surface-disabled bg-inverted-secondary-surface-disabled disabled:border-transparent border-transparent !important':
|
|
89
|
+
{},
|
|
162
90
|
},
|
|
163
91
|
},
|
|
164
92
|
},
|
|
165
93
|
};
|
|
166
94
|
}
|
|
167
95
|
|
|
168
|
-
function
|
|
96
|
+
function buttonTertiary() {
|
|
97
|
+
return {
|
|
98
|
+
'&-tertiary': {
|
|
99
|
+
'@apply text-dark-secondary': {},
|
|
100
|
+
'@apply bg-tertiary-surface': {},
|
|
101
|
+
/* hover */
|
|
102
|
+
'@apply hover:bg-tertiary-surface-hover': {},
|
|
103
|
+
|
|
104
|
+
// State
|
|
105
|
+
'&.sk-btn-disabled, &[aria-disabled="true"]': {
|
|
106
|
+
'@apply disabled:bg-tertiary-surface-disabled bg-tertiary-surface-disabled disabled:border-transparent border-transparent !important':
|
|
107
|
+
{},
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
'&[data-inverted="true"]': {
|
|
111
|
+
'@apply text-inverted-dark-secondary': {},
|
|
112
|
+
'@apply bg-inverted-tertiary-surface': {},
|
|
113
|
+
/* hover */
|
|
114
|
+
'@apply hover:bg-inverted-tertiary-surface-hover': {},
|
|
115
|
+
'&.sk-btn-disabled, &[aria-disabled="true"]': {
|
|
116
|
+
'@apply disabled:bg-inverted-tertiary-surface-disabled bg-inverted-tertiary-surface-disabled disabled:border-transparent border-transparent !important':
|
|
117
|
+
{},
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function buttonGhost() {
|
|
169
124
|
return {
|
|
170
125
|
'&-ghost': {
|
|
171
|
-
|
|
172
|
-
'@apply
|
|
173
|
-
'@apply
|
|
126
|
+
'@apply text-dark-secondary': {},
|
|
127
|
+
'@apply bg-transparent': {},
|
|
128
|
+
'@apply border-transparent': {},
|
|
129
|
+
/* hover */
|
|
130
|
+
'@apply hover:bg-transparent': {},
|
|
131
|
+
'@apply hover:border-transparent': {},
|
|
174
132
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
{}
|
|
184
|
-
),
|
|
133
|
+
// State
|
|
134
|
+
'&.sk-btn-disabled, &[aria-disabled="true"]': {
|
|
135
|
+
'@apply disabled:bg-transparent bg-transparent disabled:border-transparent border-transparent !important': {},
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
'&[data-inverted="true"]': {
|
|
139
|
+
'@apply text-inverted-dark-secondary': {},
|
|
140
|
+
},
|
|
185
141
|
},
|
|
186
142
|
};
|
|
187
143
|
}
|
|
@@ -193,7 +149,6 @@ function buttonLink(colors) {
|
|
|
193
149
|
'&.active': {
|
|
194
150
|
'@apply underline': {},
|
|
195
151
|
},
|
|
196
|
-
'@apply focus-visible:z-base focus-visible:ring-4 focus-visible:ring-primary-500': {},
|
|
197
152
|
// dark colors
|
|
198
153
|
'@apply dark:text-neutral-200': {},
|
|
199
154
|
'@apply dark:active:text-neutral-500': {},
|
|
@@ -202,11 +157,8 @@ function buttonLink(colors) {
|
|
|
202
157
|
(styles, color) => ({
|
|
203
158
|
...styles,
|
|
204
159
|
[`&[data-color="${color}"]`]: {
|
|
205
|
-
[`@apply text-${color}-
|
|
206
|
-
[`@apply focus-visible:ring-${color}-500`]: {},
|
|
160
|
+
[`@apply text-${color}-text active:text-${color}-text`]: {},
|
|
207
161
|
// dark colors
|
|
208
|
-
[`@apply dark:text-${color}-200`]: {},
|
|
209
|
-
[`@apply dark:active:text-${color}-500`]: {},
|
|
210
162
|
},
|
|
211
163
|
}),
|
|
212
164
|
{}
|
|
@@ -216,107 +168,140 @@ function buttonLink(colors) {
|
|
|
216
168
|
}
|
|
217
169
|
|
|
218
170
|
module.exports = Button = (colors) => ({
|
|
219
|
-
'.btn': {
|
|
171
|
+
'.sk-btn': {
|
|
172
|
+
'@apply box-border': {},
|
|
173
|
+
'@apply border-2 border-transparent': {},
|
|
174
|
+
'@apply cursor-pointer': {},
|
|
220
175
|
'@apply relative': {},
|
|
221
176
|
'@apply m-0': {},
|
|
222
|
-
'@apply px-
|
|
223
|
-
'@apply
|
|
224
|
-
'@apply rounded-
|
|
225
|
-
'@apply font-medium leading-tight': {},
|
|
177
|
+
'@apply px-24 py-8 gap-8': {},
|
|
178
|
+
'@apply inline-flex items-center justify-center flex-shrink-0 align-middle': {},
|
|
179
|
+
'@apply rounded-button': {},
|
|
226
180
|
transitionProperty: 'background-color, border-color, color, fill, stroke, box-shadow',
|
|
227
181
|
'@apply duration-75 ease-out': {},
|
|
228
|
-
'@apply outline-none appearance-none
|
|
182
|
+
'@apply outline-none appearance-none select-none whitespace-nowrap': {},
|
|
229
183
|
'@apply focus-visible:outline-none': {},
|
|
184
|
+
'@apply focus-visible:ring': {},
|
|
230
185
|
|
|
231
186
|
"&[data-rounded='true']": {
|
|
232
|
-
|
|
187
|
+
'@apply rounded-circular': {},
|
|
233
188
|
},
|
|
234
189
|
|
|
235
190
|
// sizing
|
|
236
191
|
'&-sm': {
|
|
237
|
-
'@apply text-
|
|
238
|
-
|
|
239
|
-
|
|
192
|
+
'@apply text-label-small': {},
|
|
193
|
+
'@apply px-14 py-8 gap-6': {},
|
|
194
|
+
'@apply max-h-[3.2rem] h-[3.2rem]': {},
|
|
195
|
+
'@apply rounded-button-sm': {},
|
|
196
|
+
svg: {
|
|
197
|
+
'@apply h-[1.6rem] w-[1.6rem]': {},
|
|
198
|
+
},
|
|
240
199
|
},
|
|
241
200
|
|
|
242
201
|
'&-md': {
|
|
243
|
-
'@apply text-
|
|
244
|
-
|
|
245
|
-
|
|
202
|
+
'@apply text-label-medium': {},
|
|
203
|
+
'@apply px-18 py-8 gap-8': {},
|
|
204
|
+
'@apply max-h-[4rem] h-[4rem]': {},
|
|
205
|
+
'@apply rounded-button-md': {},
|
|
206
|
+
svg: {
|
|
207
|
+
'@apply h-[1.8rem] w-[1.8rem]': {},
|
|
208
|
+
},
|
|
246
209
|
},
|
|
247
210
|
|
|
248
211
|
'&-lg': {
|
|
249
|
-
'@apply text-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
212
|
+
'@apply text-label-large': {},
|
|
213
|
+
'@apply px-24 py-8 gap-8': {},
|
|
214
|
+
'@apply max-h-[4.8rem] h-[4.8rem]': {},
|
|
215
|
+
'@apply rounded-button-lg': {},
|
|
216
|
+
svg: {
|
|
217
|
+
'@apply h-[2rem] w-[2rem]': {},
|
|
218
|
+
},
|
|
256
219
|
},
|
|
257
220
|
|
|
258
221
|
// State
|
|
259
|
-
|
|
260
222
|
'&-disabled, &[aria-disabled="true"]': {
|
|
261
|
-
'@apply shadow-none disabled:shadow-none disabled:cursor-
|
|
262
|
-
'@apply disabled:text-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
223
|
+
'@apply shadow-none disabled:shadow-none disabled:cursor-default cursor-default': {},
|
|
224
|
+
'@apply disabled:text-dark-disabled text-dark-disabled disabled:bg-primary-surface-disabled bg-primary-surface-disabled disabled:border-transparent border-transparent !important':
|
|
225
|
+
{},
|
|
226
|
+
'&[data-inverted="true"]': {
|
|
227
|
+
'@apply disabled:text-inverted-dark-disabled text-inverted-dark-disabled disabled:bg-inverted-primary-surface-disabled bg-inverted-primary-surface-disabled disabled:border-transparent border-transparent !important':
|
|
228
|
+
{},
|
|
229
|
+
},
|
|
268
230
|
},
|
|
269
231
|
|
|
270
232
|
// variants
|
|
271
|
-
...
|
|
272
|
-
...
|
|
273
|
-
...
|
|
233
|
+
...buttonPrimary(colors),
|
|
234
|
+
...buttonSecondary(),
|
|
235
|
+
...buttonTertiary(),
|
|
236
|
+
...buttonGhost(),
|
|
274
237
|
...buttonLink(colors),
|
|
275
|
-
},
|
|
276
|
-
'.btn-has-icon': {
|
|
277
|
-
'&-left': {
|
|
278
|
-
'@apply h-full flex items-center justify-center': {},
|
|
279
238
|
|
|
280
|
-
|
|
281
|
-
|
|
239
|
+
'.btn-has-icon': {
|
|
240
|
+
'&-left': {
|
|
241
|
+
'@apply h-full flex items-center justify-center -ml-2': {},
|
|
242
|
+
'.sk-icon': {
|
|
243
|
+
'@apply bg-transparent': {},
|
|
244
|
+
color: 'currentColor',
|
|
245
|
+
},
|
|
282
246
|
},
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
247
|
+
'&-right': {
|
|
248
|
+
'@apply h-full flex items-center justify-center -mr-2': {},
|
|
249
|
+
'.sk-icon': {
|
|
250
|
+
'@apply bg-transparent': {},
|
|
251
|
+
color: 'currentColor',
|
|
252
|
+
},
|
|
289
253
|
},
|
|
290
254
|
},
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
'@apply p-0': {},
|
|
294
|
-
"&[data-rounded='true']": {
|
|
295
|
-
'@apply rounded-full': {},
|
|
255
|
+
'&-lg .btn-has-icon-left': {
|
|
256
|
+
'@apply -ml-4': {},
|
|
296
257
|
},
|
|
297
|
-
'
|
|
298
|
-
|
|
299
|
-
maxWidth: '4rem',
|
|
258
|
+
'&-lg .btn-has-icon-right': {
|
|
259
|
+
'@apply -mr-4': {},
|
|
300
260
|
},
|
|
261
|
+
'&[data-icon=true]': {
|
|
262
|
+
'@apply p-0': {},
|
|
301
263
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
264
|
+
'.sk-icon': {
|
|
265
|
+
'@apply bg-transparent': {},
|
|
266
|
+
color: 'currentColor',
|
|
267
|
+
},
|
|
306
268
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
'.
|
|
314
|
-
|
|
269
|
+
"&[data-rounded='true']": {
|
|
270
|
+
'@apply rounded-full': {},
|
|
271
|
+
},
|
|
272
|
+
|
|
273
|
+
'&.sk-btn-sm': {
|
|
274
|
+
minWidth: '3.2rem',
|
|
275
|
+
width: '3.2rem',
|
|
276
|
+
maxWidth: '3.2rem',
|
|
277
|
+
svg: {
|
|
278
|
+
'@apply h-[2rem] w-[2rem]': {},
|
|
315
279
|
},
|
|
316
280
|
},
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
281
|
+
|
|
282
|
+
'&.sk-btn-md': {
|
|
283
|
+
minWidth: '4rem',
|
|
284
|
+
width: '4rem',
|
|
285
|
+
maxWidth: '4rem',
|
|
286
|
+
svg: {
|
|
287
|
+
'@apply h-[2rem] w-[2rem]': {},
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
|
|
291
|
+
'&.sk-btn-lg': {
|
|
292
|
+
minWidth: '4.8rem',
|
|
293
|
+
width: '4.8rem',
|
|
294
|
+
maxWidth: '4.8rem',
|
|
295
|
+
svg: {
|
|
296
|
+
'@apply h-[2.4rem] w-[2.4rem]': {},
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
'.btn-has-icon': {
|
|
300
|
+
'&-left': {
|
|
301
|
+
'@apply m-0': {},
|
|
302
|
+
},
|
|
303
|
+
'&-right': {
|
|
304
|
+
'@apply m-0': {},
|
|
320
305
|
},
|
|
321
306
|
},
|
|
322
307
|
},
|