@sk-web-gui/core 0.1.86 → 0.1.88

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,64 +1,64 @@
1
- module.exports = Tabs = () => ({
2
- '.sk-tabs': {
3
- '&-stretch': {
4
- '@apply w-full': {},
5
- },
6
- '&-list': {
7
- '@apply block relative w-full h-[3rem]': {},
8
- '&-stretch': {
9
- '@apply flex justify-between': {},
10
- },
11
- '&-right': {
12
- '@apply text-right': {},
13
- },
14
- '&-center': {
15
- '@apply text-center': {},
16
- },
17
-
18
- '&-line::after': {
19
- content: '""',
20
- '@apply bg-gray-middle w-full h-[2px] absolute left-0 right-0 bottom-0': {},
21
- },
22
- },
23
- '&-tab': {
24
- '@apply relative mr-[3.2rem] text-base font-bold p-0 relative h-[2.8rem] inline-block': {},
25
- '@apply text-gray': {},
26
- '@apply cursor-pointer': {},
27
- '&.disabled': {
28
- '@apply cursor-not-allowed': {},
29
- '@apply text-gray-stroke': {},
30
- },
31
- '&.active': {
32
- '@apply text-body': {},
33
- '&::after': {
34
- content: '""',
35
- '@apply bg-primary w-full h-[2px] absolute left-0 right-0 top-[100%] z-[1]': {},
36
- },
37
- },
38
- '&-stretch': {
39
- '@apply mr-0': {},
40
- },
41
- '&-header': {
42
- '@apply text-lg font-normal': {},
43
- },
44
- '&-right': {
45
- '@apply mr-0 ml-lg': {},
46
- },
47
- '&:last-of-type': {
48
- '@apply mr-0': {},
49
- },
50
- '&-icon': {
51
- '&-with-label': {
52
- '@apply mr-sm': {},
53
- },
54
- },
55
- },
56
- '&-panel': {
57
- '@apply mt-lg': {},
58
- '&:not(.active)': {
59
- display: 'none',
60
- hidden: true,
61
- },
62
- },
63
- },
64
- });
1
+ module.exports = Tabs = () => ({
2
+ '.sk-tabs': {
3
+ '&-stretch': {
4
+ '@apply w-full': {},
5
+ },
6
+ '&-list': {
7
+ '@apply block relative w-full h-[3rem]': {},
8
+ '&-stretch': {
9
+ '@apply flex justify-between': {},
10
+ },
11
+ '&-right': {
12
+ '@apply text-right': {},
13
+ },
14
+ '&-center': {
15
+ '@apply text-center': {},
16
+ },
17
+
18
+ '&-line::after': {
19
+ content: '""',
20
+ '@apply bg-gray-middle w-full h-[2px] absolute left-0 right-0 bottom-0': {},
21
+ },
22
+ },
23
+ '&-tab': {
24
+ '@apply relative mr-[3.2rem] text-base font-bold p-0 relative h-[2.8rem] inline-block': {},
25
+ '@apply text-gray': {},
26
+ '@apply cursor-pointer': {},
27
+ '&.disabled': {
28
+ '@apply cursor-not-allowed': {},
29
+ '@apply text-gray-stroke': {},
30
+ },
31
+ '&.active': {
32
+ '@apply text-body': {},
33
+ '&::after': {
34
+ content: '""',
35
+ '@apply bg-primary w-full h-[2px] absolute left-0 right-0 top-[100%] z-[1]': {},
36
+ },
37
+ },
38
+ '&-stretch': {
39
+ '@apply mr-0': {},
40
+ },
41
+ '&-header': {
42
+ '@apply text-lg font-normal': {},
43
+ },
44
+ '&-right': {
45
+ '@apply mr-0 ml-lg': {},
46
+ },
47
+ '&:last-of-type': {
48
+ '@apply mr-0': {},
49
+ },
50
+ '&-icon': {
51
+ '&-with-label': {
52
+ '@apply mr-sm': {},
53
+ },
54
+ },
55
+ },
56
+ '&-panel': {
57
+ '@apply mt-lg': {},
58
+ '&:not(.active)': {
59
+ display: 'none',
60
+ hidden: true,
61
+ },
62
+ },
63
+ },
64
+ });
@@ -1,41 +1,65 @@
1
1
  module.exports = UserMenu = (colors) => ({
2
- '.usermenu': {
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': {},
5
- // "@apply ": {},
6
- '&-is-open': {
7
- // "@apply border-2 border-gray-300 border-solid rounded": {},
8
- // "box-shadow": "0px 4px 12px rgba(27, 29, 31, 0.12)",
2
+ '.sk-usermenu': {
3
+ '@apply text-body mx-auto lg:mx-sm lg:relative': {},
4
+
5
+ '&-wrapper': {
6
+ '@apply block max-lg:-mr-md': {},
7
+ },
8
+
9
+ '&-button': {
10
+ '&-content': {
11
+ '@apply max-lg:font-bold lg:items-center lg:text-left': {},
12
+ },
13
+ '&-icon': {
14
+ '@apply !text-2xl ml-auto align-top max-lg:mr-2 max-lg:text-primary': {},
15
+ },
16
+ },
17
+
18
+ '&-first-row': {
19
+ '@apply max-lg:hidden bg-white border-t-2 pb-sm -mt-0 mx-md': {},
9
20
  },
10
21
 
11
- '&-menuTitle': {
12
- overflow: 'hidden',
13
- 'text-overflow': 'ellipsis',
14
- display: '-webkit-box',
15
- '-webkit-line-clamp': '2' /* number of lines to show */,
16
- 'line-clamp': '2',
17
- '-webkit-box-orient': 'vertical',
22
+ '&-label': {
23
+ '@apply flex align-middle mt-md lg:mb-xs': {},
24
+ '&-content': {
25
+ '@apply inline-block px-lg py-md lg:pl-md lg:pr-md lg:py-sm text-sm font-semibold uppercase whitespace-nowrap':
26
+ {},
27
+ },
28
+ '&-line': {
29
+ '@apply inline-block w-full h-px border-gray-300 border-t-2 mt-[2.6rem] lg:hidden': {},
30
+ },
18
31
  },
19
32
 
20
- '&-menuSubTitle': {
21
- overflow: 'hidden',
22
- 'text-overflow': 'ellipsis',
23
- display: '-webkit-box',
24
- '-webkit-line-clamp': '1' /* number of lines to show */,
25
- 'line-clamp': '1',
26
- '-webkit-box-orient': 'vertical',
33
+ '&-body': {
34
+ '@apply py-sm absolute rounded border-t-0 bg-white mt-6 right-0 left-0 border-none max-lg:shadow-lg lg:-mt-2 lg:border-2 lg:border-solid lg:border-white':
35
+ {},
36
+ '&[data-open="true"]': {
37
+ '@apply lg:border-gray-300 lg:border-t-0 lg:shadow-lg': {},
38
+ },
27
39
  },
28
40
 
29
41
  '&-header': {
30
- '[aria-expanded="true"] &': {
31
- '@apply bg-hover': {},
42
+ '@apply px-md py-sm bg-white border-none rounded lg:border-2 lg:border-solid lg:border-b-0 lg:border-transparent':
43
+ {},
44
+ '&[aria-expanded="true"]': {
45
+ '@apply lg:border-gray-300 lg:shadow-none': {},
32
46
  },
33
47
  },
34
- '&-item': {
35
- '@apply block px-lg py-md lg:px-md lg:py-sm w-full cursor-pointer text-body no-underline': {},
48
+ '&-group': {
49
+ 'a, button': {
50
+ '@apply block px-lg py-md lg:px-md lg:py-sm w-full cursor-pointer text-body no-underline': {},
51
+ '&.active': {
52
+ '@apply bg-hover text-white no-underline': {},
53
+ },
54
+ },
36
55
  '&.active': {
37
- '@apply bg-hover text-white no-underline': {},
56
+ 'a, button': {
57
+ '@apply bg-hover text-white no-underline': {},
58
+ },
38
59
  },
39
60
  },
61
+ '&-divider': {
62
+ '@apply bg-white border-t-2 pb-sm mt-sm mx-md': {},
63
+ },
40
64
  },
41
65
  });
package/src/index.js CHANGED
@@ -1,8 +1,8 @@
1
- const preset = require('./preset');
2
- const plugin = require('./plugin');
3
-
4
- module.exports = {
5
- default: plugin,
6
- plugin: plugin,
7
- preset: preset,
8
- };
1
+ const preset = require('./preset');
2
+ const plugin = require('./plugin');
3
+
4
+ module.exports = {
5
+ default: plugin,
6
+ plugin: plugin,
7
+ preset: preset,
8
+ };
package/src/plugin.js CHANGED
@@ -1,120 +1,120 @@
1
- const plugin = require('tailwindcss/plugin');
2
-
3
- const base = require('./base');
4
- const theme = require('./theme');
5
-
6
- // components
7
- const Alert = require('./components/alert');
8
- const AlertBanner = require('./components/alert-banner');
9
- const Badge = require('./components/badge');
10
- const Breadcrumb = require('./components/breadcrumb');
11
- const ButtonGroup = require('./components/button-group');
12
- const Comments = require('./components/comments');
13
- const Checkbox = require('./components/checkbox');
14
- const ContextMenu = require('./components/context-menu');
15
- const Dialog = require('./components/dialog');
16
- const Dot = require('./components/dot');
17
- const Forms = require('./components/forms');
18
- const Calendar = require('./components/calendar');
19
- const Icon = require('./components/icon');
20
- const Link = require('./components/link');
21
- const Message = require('./components/message');
22
- const Notification = require('./components/notification');
23
- const Radio = require('./components/radio');
24
- const Switch = require('./components/switch');
25
-
26
- const Button = require('./components/button');
27
- const Accordion = require('./components/accordion');
28
- const Card = require('./components/card');
29
- const Table = require('./components/table');
30
- const ZebraTable = require('./components/zebratable');
31
-
32
- const Modal = require('./components/modal');
33
- const CookieConsent = require('./components/cookie-consent');
34
- const Divider = require('./components/divider');
35
-
36
- const SideMenu = require('./components/side-menu');
37
- const TabMenu = require('./components/tab-menu');
38
- const Tabs = require('./components/tabs');
39
- const UserMenu = require('./components/user-menu');
40
-
41
- const DropdownFilter = require('./components/dropdown-filter');
42
-
43
- const Tag = require('./components/tag');
44
- const Pagination = require('./components/pagination');
45
- const Footer = require('./components/footer');
46
- const Header = require('./components/header');
47
-
48
- const SearchBar = require('./components/search-bar');
49
-
50
- const ProfilePicture = require('./components/profile-picture');
51
- const Profile = require('./components/profile');
52
-
53
- const components = [
54
- Alert,
55
- AlertBanner,
56
- Badge,
57
- Breadcrumb,
58
- ButtonGroup,
59
- Button,
60
- Checkbox,
61
- Comments,
62
- ContextMenu,
63
- Dialog,
64
- Dot,
65
- Forms,
66
- Calendar,
67
- Icon,
68
- Link,
69
- Message,
70
- Notification,
71
- Radio,
72
- Switch,
73
-
74
- Table,
75
- ZebraTable,
76
- CookieConsent,
77
- Modal,
78
-
79
- Accordion,
80
- Card,
81
- Divider,
82
-
83
- SideMenu,
84
- TabMenu,
85
- Tabs,
86
- UserMenu,
87
-
88
- DropdownFilter,
89
-
90
- SearchBar,
91
-
92
- Tag,
93
- Pagination,
94
- Footer,
95
- Header,
96
-
97
- ProfilePicture,
98
- Profile,
99
- ];
100
-
101
- const defaultColors = ['primary', 'secondary'];
102
-
103
- module.exports = plugin.withOptions(
104
- function (options = { colors: [], cssBase: true }) {
105
- return function ({ addComponents, addBase, theme }) {
106
- const optionColors = [...defaultColors, ...(options.colors || [])];
107
-
108
- if (options.cssBase) {
109
- addBase(base);
110
- }
111
-
112
- addComponents(components.map((component) => component(optionColors, theme)));
113
- };
114
- },
115
- function () {
116
- return {
117
- theme: theme,
118
- };
119
- }
120
- );
1
+ const plugin = require('tailwindcss/plugin');
2
+
3
+ const base = require('./base');
4
+ const theme = require('./theme');
5
+
6
+ // components
7
+ const Alert = require('./components/alert');
8
+ const AlertBanner = require('./components/alert-banner');
9
+ const Badge = require('./components/badge');
10
+ const Breadcrumb = require('./components/breadcrumb');
11
+ const ButtonGroup = require('./components/button-group');
12
+ const Comments = require('./components/comments');
13
+ const Checkbox = require('./components/checkbox');
14
+ const ContextMenu = require('./components/context-menu');
15
+ const Dialog = require('./components/dialog');
16
+ const Dot = require('./components/dot');
17
+ const Forms = require('./components/forms');
18
+ const Calendar = require('./components/calendar');
19
+ const Icon = require('./components/icon');
20
+ const Link = require('./components/link');
21
+ const Message = require('./components/message');
22
+ const Notification = require('./components/notification');
23
+ const Radio = require('./components/radio');
24
+ const Switch = require('./components/switch');
25
+
26
+ const Button = require('./components/button');
27
+ const Accordion = require('./components/accordion');
28
+ const Card = require('./components/card');
29
+ const Table = require('./components/table');
30
+ const ZebraTable = require('./components/zebratable');
31
+
32
+ const Modal = require('./components/modal');
33
+ const CookieConsent = require('./components/cookie-consent');
34
+ const Divider = require('./components/divider');
35
+
36
+ const SideMenu = require('./components/side-menu');
37
+ const TabMenu = require('./components/tab-menu');
38
+ const Tabs = require('./components/tabs');
39
+ const UserMenu = require('./components/user-menu');
40
+
41
+ const DropdownFilter = require('./components/dropdown-filter');
42
+
43
+ const Tag = require('./components/tag');
44
+ const Pagination = require('./components/pagination');
45
+ const Footer = require('./components/footer');
46
+ const Header = require('./components/header');
47
+
48
+ const SearchBar = require('./components/search-bar');
49
+
50
+ const ProfilePicture = require('./components/profile-picture');
51
+ const Profile = require('./components/profile');
52
+
53
+ const components = [
54
+ Alert,
55
+ AlertBanner,
56
+ Badge,
57
+ Breadcrumb,
58
+ ButtonGroup,
59
+ Button,
60
+ Checkbox,
61
+ Comments,
62
+ ContextMenu,
63
+ Dialog,
64
+ Dot,
65
+ Forms,
66
+ Calendar,
67
+ Icon,
68
+ Link,
69
+ Message,
70
+ Notification,
71
+ Radio,
72
+ Switch,
73
+
74
+ Table,
75
+ ZebraTable,
76
+ CookieConsent,
77
+ Modal,
78
+
79
+ Accordion,
80
+ Card,
81
+ Divider,
82
+
83
+ SideMenu,
84
+ TabMenu,
85
+ Tabs,
86
+ UserMenu,
87
+
88
+ DropdownFilter,
89
+
90
+ SearchBar,
91
+
92
+ Tag,
93
+ Pagination,
94
+ Footer,
95
+ Header,
96
+
97
+ ProfilePicture,
98
+ Profile,
99
+ ];
100
+
101
+ const defaultColors = ['primary', 'secondary'];
102
+
103
+ module.exports = plugin.withOptions(
104
+ function (options = { colors: [], cssBase: true }) {
105
+ return function ({ addComponents, addBase, theme }) {
106
+ const optionColors = [...defaultColors, ...(options.colors || [])];
107
+
108
+ if (options.cssBase) {
109
+ addBase(base);
110
+ }
111
+
112
+ addComponents(components.map((component) => component(optionColors, theme)));
113
+ };
114
+ },
115
+ function () {
116
+ return {
117
+ theme: theme,
118
+ };
119
+ }
120
+ );
package/src/theme.js CHANGED
@@ -1,84 +1,84 @@
1
- const { colors } = require('@sk-web-gui/theme');
2
- const withOpacity = require('./with-opacity');
3
-
4
- module.exports = {
5
- fontSize: {
6
- tiny: '1rem',
7
- xs: '1.2rem',
8
- sm: '1.4rem',
9
- base: '1.6rem',
10
- lg: '1.8rem',
11
- xl: '2.0rem',
12
- '2xl': '2.4rem',
13
- '3xl': '3.2rem',
14
- '4xl': '4.0rem',
15
- '5xl': '5.2rem',
16
- },
17
- extend: {
18
- colors: {
19
- ...colors,
20
- current: 'currentColor',
21
- },
22
- cursor: {
23
- base: 'var(--vc-cursor)',
24
- },
25
- spacing: {
26
- xs: '4px',
27
- sm: '8px',
28
- md: '16px',
29
- lg: '24px',
30
- xl: '48px',
31
- },
32
- lineHeight: {
33
- tiny: '1.4rem',
34
- xs: '1.6rem',
35
- sm: '2rem',
36
- base: '2.4rem',
37
- lg: '2.4rem',
38
- xl: '3.2rem',
39
- '2xl': '3.2rem',
40
- '3xl': '4rem',
41
- '4xl': '4.8rem',
42
- '5xl': '5.8rem',
43
- },
44
- opacity: {
45
- 15: '0.15',
46
- },
47
- backgroundColor: {
48
- base: withOpacity('--vc-colors-bg-base'),
49
- fill: withOpacity('--vc-colors-bg-fill'),
50
- },
51
- textColor: {
52
- foreground: withOpacity('--vc-colors-text-foreground'),
53
- muted: withOpacity('--vc-colors-text-muted'),
54
- },
55
- borderRadius: {
56
- base: 'var(--vc-rounded)',
57
- },
58
- zIndex: {
59
- hide: -1,
60
- none: 0,
61
- base: 1,
62
- docked: 10,
63
- dropdown: 1000,
64
- sticky: 1100,
65
- banner: 1200,
66
- overlay: 1300,
67
- modal: 1400,
68
- popover: 1500,
69
- skipLink: 1600,
70
- toast: 1700,
71
- tooltip: 1800,
72
- },
73
- keyframes: {
74
- 'reset-overflow': {
75
- 'from, to': {
76
- overflow: 'hidden',
77
- },
78
- },
79
- },
80
- animation: {
81
- 'reset-overflow': 'reset-overflow 180ms backwards',
82
- },
83
- },
84
- };
1
+ const { colors } = require('@sk-web-gui/theme');
2
+ const withOpacity = require('./with-opacity');
3
+
4
+ module.exports = {
5
+ fontSize: {
6
+ tiny: '1rem',
7
+ xs: '1.2rem',
8
+ sm: '1.4rem',
9
+ base: '1.6rem',
10
+ lg: '1.8rem',
11
+ xl: '2.0rem',
12
+ '2xl': '2.4rem',
13
+ '3xl': '3.2rem',
14
+ '4xl': '4.0rem',
15
+ '5xl': '5.2rem',
16
+ },
17
+ extend: {
18
+ colors: {
19
+ ...colors,
20
+ current: 'currentColor',
21
+ },
22
+ cursor: {
23
+ base: 'var(--vc-cursor)',
24
+ },
25
+ spacing: {
26
+ xs: '4px',
27
+ sm: '8px',
28
+ md: '16px',
29
+ lg: '24px',
30
+ xl: '48px',
31
+ },
32
+ lineHeight: {
33
+ tiny: '1.4rem',
34
+ xs: '1.6rem',
35
+ sm: '2rem',
36
+ base: '2.4rem',
37
+ lg: '2.4rem',
38
+ xl: '3.2rem',
39
+ '2xl': '3.2rem',
40
+ '3xl': '4rem',
41
+ '4xl': '4.8rem',
42
+ '5xl': '5.8rem',
43
+ },
44
+ opacity: {
45
+ 15: '0.15',
46
+ },
47
+ backgroundColor: {
48
+ base: withOpacity('--vc-colors-bg-base'),
49
+ fill: withOpacity('--vc-colors-bg-fill'),
50
+ },
51
+ textColor: {
52
+ foreground: withOpacity('--vc-colors-text-foreground'),
53
+ muted: withOpacity('--vc-colors-text-muted'),
54
+ },
55
+ borderRadius: {
56
+ base: 'var(--vc-rounded)',
57
+ },
58
+ zIndex: {
59
+ hide: -1,
60
+ none: 0,
61
+ base: 1,
62
+ docked: 10,
63
+ dropdown: 1000,
64
+ sticky: 1100,
65
+ banner: 1200,
66
+ overlay: 1300,
67
+ modal: 1400,
68
+ popover: 1500,
69
+ skipLink: 1600,
70
+ toast: 1700,
71
+ tooltip: 1800,
72
+ },
73
+ keyframes: {
74
+ 'reset-overflow': {
75
+ 'from, to': {
76
+ overflow: 'hidden',
77
+ },
78
+ },
79
+ },
80
+ animation: {
81
+ 'reset-overflow': 'reset-overflow 180ms backwards',
82
+ },
83
+ },
84
+ };