@robuust-digital/vue-components 1.1.1 → 1.2.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/style.css +1 -1
- package/dist/tailwind/base/index.js +22 -0
- package/dist/tailwind/components/accordion.js +54 -0
- package/dist/tailwind/components/alert.js +102 -134
- package/dist/tailwind/components/badge.js +69 -174
- package/dist/tailwind/components/button.js +196 -314
- package/dist/tailwind/components/checkbox.js +65 -0
- package/dist/tailwind/components/drawer.js +83 -79
- package/dist/tailwind/components/lightswitch.js +73 -0
- package/dist/tailwind/components/modal.js +127 -0
- package/dist/tailwind/components/table.js +109 -0
- package/dist/tailwind/components/tooltip.js +66 -0
- package/dist/tailwind/index.js +17 -1
- package/dist/vue-components.es.js +2502 -667
- package/dist/vue-components.umd.js +2 -2
- package/package.json +5 -3
|
@@ -5,91 +5,95 @@ import { withAlphaValue } from 'tailwindcss/lib/util/withAlphaVariable';
|
|
|
5
5
|
*
|
|
6
6
|
* @param {Object} theme - The global theme object
|
|
7
7
|
*/
|
|
8
|
-
export default (theme) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
'
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
padding: theme('padding.6'),
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
...theme('components.drawer.header'),
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
// Title
|
|
45
|
-
'.drawer-title': {
|
|
46
|
-
fontSize: theme('fontSize.2xl'),
|
|
47
|
-
fontWeight: theme('fontWeight.bold'),
|
|
48
|
-
color: theme('colors.neutral.900'),
|
|
49
|
-
...theme('components.drawer.title'),
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
// Close
|
|
53
|
-
'.drawer-close': {
|
|
54
|
-
width: theme('width.6'),
|
|
55
|
-
height: theme('height.6'),
|
|
56
|
-
color: theme('colors.neutral.700'),
|
|
57
|
-
|
|
58
|
-
'&:hover': {
|
|
59
|
-
color: theme('colors.neutral.950'),
|
|
60
|
-
},
|
|
8
|
+
export default (theme) => ({
|
|
9
|
+
':root': {
|
|
10
|
+
'--rvc-drawer-backdrop-bg-color': withAlphaValue(theme('colors.slate.900'), 0.5),
|
|
11
|
+
'--rvc-drawer-padding-x': theme('padding.4'),
|
|
12
|
+
'--rvc-drawer-padding-y': theme('padding.4'),
|
|
13
|
+
'--rvc-drawer-border-color': theme('colors.slate.200'),
|
|
14
|
+
'--rvc-drawer-border-width': theme('borderWidth.DEFAULT'),
|
|
15
|
+
'--rvc-drawer-border-style': 'solid',
|
|
16
|
+
'--rvc-drawer-header-bg-color': theme('colors.white'),
|
|
17
|
+
'--rvc-drawer-title-font-size': theme('fontSize.2xl'),
|
|
18
|
+
'--rvc-drawer-title-font-weight': theme('fontWeight.bold'),
|
|
19
|
+
'--rvc-drawer-title-color': theme('colors.slate.900'),
|
|
20
|
+
'--rvc-drawer-close-size': theme('width.6'),
|
|
21
|
+
'--rvc-drawer-close-color': theme('colors.slate.700'),
|
|
22
|
+
'--rvc-drawer-close-color-hover': theme('colors.slate.900'),
|
|
23
|
+
'--rvc-drawer-content-bg-color': theme('colors.white'),
|
|
24
|
+
'--rvc-drawer-footer-bg-color': theme('colors.slate.50'),
|
|
25
|
+
'--rvc-drawer-footer-gap': theme('gap.3'),
|
|
26
|
+
'--rvc-drawer-footer-justify-content': 'space-between',
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
'.rvc-drawer': {
|
|
30
|
+
zIndex: 500,
|
|
31
|
+
position: 'relative',
|
|
32
|
+
...theme('components.drawer'),
|
|
33
|
+
|
|
34
|
+
// Backdrop
|
|
35
|
+
'.rvc-drawer-backdrop': {
|
|
36
|
+
backgroundColor: 'var(--rvc-drawer-backdrop-bg-color)',
|
|
37
|
+
},
|
|
61
38
|
|
|
62
|
-
|
|
63
|
-
|
|
39
|
+
// Header
|
|
40
|
+
'.rvc-drawer-header': {
|
|
41
|
+
paddingTop: 'var(--rvc-drawer-padding-y)',
|
|
42
|
+
paddingRight: 'var(--rvc-drawer-padding-x)',
|
|
43
|
+
paddingBottom: 'var(--rvc-drawer-padding-y)',
|
|
44
|
+
paddingLeft: 'var(--rvc-drawer-padding-x)',
|
|
45
|
+
borderColor: 'var(--rvc-drawer-border-color)',
|
|
46
|
+
borderBottomWidth: 'var(--rvc-drawer-border-width)',
|
|
47
|
+
borderBottomStyle: 'var(--rvc-drawer-border-style)',
|
|
48
|
+
backgroundColor: 'var(--rvc-drawer-header-bg-color)',
|
|
49
|
+
},
|
|
64
50
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
51
|
+
// Title
|
|
52
|
+
'.rvc-drawer-title': {
|
|
53
|
+
fontSize: 'var(--rvc-drawer-title-font-size)',
|
|
54
|
+
fontWeight: 'var(--rvc-drawer-title-font-weight)',
|
|
55
|
+
color: 'var(--rvc-drawer-title-color)',
|
|
56
|
+
},
|
|
69
57
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
58
|
+
// Close
|
|
59
|
+
'.rvc-drawer-close': {
|
|
60
|
+
width: 'var(--rvc-drawer-close-size)',
|
|
61
|
+
height: 'var(--rvc-drawer-close-size)',
|
|
62
|
+
color: 'var(--rvc-drawer-close-color)',
|
|
73
63
|
|
|
74
|
-
|
|
64
|
+
'&:hover': {
|
|
65
|
+
color: 'var(--rvc-drawer-close-color-hover)',
|
|
75
66
|
},
|
|
67
|
+
},
|
|
76
68
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
justifyContent: 'space-between',
|
|
69
|
+
// Content
|
|
70
|
+
'.rvc-drawer-content': {
|
|
71
|
+
paddingTop: 'var(--rvc-drawer-padding-y)',
|
|
72
|
+
paddingRight: 'var(--rvc-drawer-padding-x)',
|
|
73
|
+
paddingBottom: 'var(--rvc-drawer-padding-y)',
|
|
74
|
+
paddingLeft: 'var(--rvc-drawer-padding-x)',
|
|
75
|
+
backgroundColor: 'var(--rvc-drawer-content-bg-color)',
|
|
76
|
+
},
|
|
86
77
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
78
|
+
// Footer
|
|
79
|
+
'.rvc-drawer-footer': {
|
|
80
|
+
paddingTop: 'var(--rvc-drawer-padding-y)',
|
|
81
|
+
paddingRight: 'var(--rvc-drawer-padding-x)',
|
|
82
|
+
paddingBottom: 'var(--rvc-drawer-padding-y)',
|
|
83
|
+
paddingLeft: 'var(--rvc-drawer-padding-x)',
|
|
84
|
+
borderColor: 'var(--rvc-drawer-border-color)',
|
|
85
|
+
borderTopWidth: 'var(--rvc-drawer-border-width)',
|
|
86
|
+
borderTopStyle: 'var(--rvc-drawer-border-style)',
|
|
87
|
+
backgroundColor: 'var(--rvc-drawer-footer-bg-color)',
|
|
88
|
+
gap: 'var(--rvc-drawer-footer-gap)',
|
|
89
|
+
justifyContent: 'var(--rvc-drawer-footer-justify-content)',
|
|
90
|
+
},
|
|
90
91
|
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
// Larger screens
|
|
93
|
+
[`@media (min-width: ${theme('screens.sm')})`]: {
|
|
94
|
+
'--rvc-drawer-padding-x': theme('padding.6'),
|
|
95
|
+
'--rvc-drawer-padding-y': theme('padding.6'),
|
|
96
|
+
...theme('components.drawer[screen-sm]'),
|
|
93
97
|
},
|
|
94
|
-
}
|
|
95
|
-
};
|
|
98
|
+
},
|
|
99
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightswitch component
|
|
3
|
+
*
|
|
4
|
+
* @param {Object} theme - The global theme object
|
|
5
|
+
*/
|
|
6
|
+
export default (theme) => ({
|
|
7
|
+
':root': {
|
|
8
|
+
'--rvc-lightswitch-border-radius': theme('borderRadius.full'),
|
|
9
|
+
'--rvc-lightswitch-height': '1.875rem',
|
|
10
|
+
'--rvc-lightswitch-width': '3.125rem',
|
|
11
|
+
'--rvc-lightswitch-bg-color': theme('colors.slate.200'),
|
|
12
|
+
'--rvc-lightswitch-bg-color-enabled': theme('colors.green.400'),
|
|
13
|
+
'--rvc-lightswitch-transition-property': theme('transitionProperty.colors'),
|
|
14
|
+
'--rvc-lightswitch-transition-duration': theme('transitionDuration.DEFAULT'),
|
|
15
|
+
'--rvc-lightswitch-transition-timing-function': theme('transitionTimingFunction.DEFAULT'),
|
|
16
|
+
'--rvc-lightswitch-label-offset': '0.5rem',
|
|
17
|
+
'--rvc-lightswitch-toggle-offset': '0.1875rem',
|
|
18
|
+
'--rvc-lightswitch-toggle-size': theme('width.6'),
|
|
19
|
+
'--rvc-lightswitch-toggle-bg-color': theme('colors.white'),
|
|
20
|
+
'--rvc-lightswitch-toggle-transition-property': theme('transitionProperty.transform'),
|
|
21
|
+
'--rvc-lightswitch-toggle-transition-duration': theme('transitionDuration.DEFAULT'),
|
|
22
|
+
'--rvc-lightswitch-toggle-transition-timing-function': theme('transitionTimingFunction.DEFAULT'),
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
'.rvc-lightswitch-group': {
|
|
26
|
+
display: 'inline-block',
|
|
27
|
+
...theme('components.lightswitch'),
|
|
28
|
+
|
|
29
|
+
'&:has(label)': {
|
|
30
|
+
display: 'inline-flex',
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
label: {
|
|
35
|
+
cursor: 'pointer',
|
|
36
|
+
paddingLeft: 'var(--rvc-lightswitch-label-offset)',
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
'.rvc-lightswitch': {
|
|
40
|
+
height: 'var(--rvc-lightswitch-height)',
|
|
41
|
+
transitionProperty: 'var(--rvc-lightswitch-transition-property)',
|
|
42
|
+
transitionDuration: 'var(--rvc-lightswitch-transition-duration)',
|
|
43
|
+
transitionTimingFunction: 'var(--rvc-lightswitch-transition-timing-function)',
|
|
44
|
+
width: 'var(--rvc-lightswitch-width)',
|
|
45
|
+
borderRadius: 'var(--rvc-lightswitch-border-radius)',
|
|
46
|
+
backgroundColor: 'var(--rvc-lightswitch-bg-color)',
|
|
47
|
+
position: 'relative',
|
|
48
|
+
display: 'inline-flex',
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
|
|
51
|
+
'.rvc-lightswitch-toggle': {
|
|
52
|
+
width: 'var(--rvc-lightswitch-toggle-size)',
|
|
53
|
+
height: 'var(--rvc-lightswitch-toggle-size)',
|
|
54
|
+
transform: 'translateX(var(--rvc-lightswitch-toggle-offset))',
|
|
55
|
+
borderRadius: 'var(--rvc-lightswitch-border-radius)',
|
|
56
|
+
backgroundColor: 'var(--rvc-lightswitch-toggle-bg-color)',
|
|
57
|
+
transitionProperty: 'var(--rvc-lightswitch-toggle-transition-property)',
|
|
58
|
+
transitionDuration: 'var(--rvc-lightswitch-toggle-transition-duration)',
|
|
59
|
+
transitionTimingFunction: 'var(--rvc-lightswitch-toggle-transition-timing-function)',
|
|
60
|
+
display: 'inline-block',
|
|
61
|
+
boxShadow: theme('boxShadow.md'),
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
'&.rvc-lightswitch-enabled': {
|
|
65
|
+
backgroundColor: 'var(--rvc-lightswitch-bg-color-enabled)',
|
|
66
|
+
|
|
67
|
+
'.rvc-lightswitch-toggle': {
|
|
68
|
+
transform: 'translateX(calc(var(--rvc-lightswitch-width) - var(--rvc-lightswitch-toggle-size) - var(--rvc-lightswitch-toggle-offset)))',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
});
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { withAlphaValue } from 'tailwindcss/lib/util/withAlphaVariable';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Modal component
|
|
5
|
+
*
|
|
6
|
+
* @param {Object} theme - The global theme object
|
|
7
|
+
*/
|
|
8
|
+
export default (theme) => ({
|
|
9
|
+
':root': {
|
|
10
|
+
'--rvc-modal-backdrop-bg-color': withAlphaValue(theme('colors.slate.900'), 0.5),
|
|
11
|
+
'--rvc-modal-border-color': theme('colors.slate.200'),
|
|
12
|
+
'--rvc-modal-border-width': theme('borderWidth.DEFAULT'),
|
|
13
|
+
'--rvc-modal-border-style': 'solid',
|
|
14
|
+
'--rvc-modal-border-radius': theme('borderRadius.DEFAULT'),
|
|
15
|
+
'--rvc-modal-box-shadow': theme('boxShadow.xl'),
|
|
16
|
+
'--rvc-modal-margin-y': 0,
|
|
17
|
+
'--rvc-modal-padding-x': theme('padding.4'),
|
|
18
|
+
'--rvc-modal-padding-y': theme('padding.4'),
|
|
19
|
+
'--rvc-modal-header-bg-color': theme('colors.slate.50'),
|
|
20
|
+
'--rvc-modal-title-font-size': theme('fontSize.xl'),
|
|
21
|
+
'--rvc-modal-title-font-weight': theme('fontWeight.bold'),
|
|
22
|
+
'--rvc-modal-title-color': theme('colors.slate.900'),
|
|
23
|
+
'--rvc-modal-close-size': theme('width.6'),
|
|
24
|
+
'--rvc-modal-close-color': theme('colors.slate.700'),
|
|
25
|
+
'--rvc-modal-close-color-hover': theme('colors.slate.900'),
|
|
26
|
+
'--rvc-modal-content-bg-color': theme('colors.white'),
|
|
27
|
+
'--rvc-modal-footer-bg-color': theme('colors.white'),
|
|
28
|
+
'--rvc-modal-footer-gap': theme('gap.2'),
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
'.rvc-modal': {
|
|
32
|
+
zIndex: 600,
|
|
33
|
+
position: 'relative',
|
|
34
|
+
...theme('components.modal'),
|
|
35
|
+
|
|
36
|
+
// Backdrop
|
|
37
|
+
'.rvc-modal-backdrop': {
|
|
38
|
+
backgroundColor: 'var(--rvc-modal-backdrop-bg-color)',
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
// Panel
|
|
42
|
+
'.rvc-modal-panel': {
|
|
43
|
+
borderColor: 'var(--rvc-modal-border-color)',
|
|
44
|
+
borderWidth: 'var(--rvc-modal-border-width)',
|
|
45
|
+
borderStyle: 'var(--rvc-modal-border-style)',
|
|
46
|
+
borderRadius: 'var(--rvc-modal-border-radius)',
|
|
47
|
+
boxShadow: 'var(--rvc-modal-box-shadow)',
|
|
48
|
+
marginTop: 'var(--rvc-modal-margin-y)',
|
|
49
|
+
marginBottom: 'var(--rvc-modal-margin-y)',
|
|
50
|
+
display: 'flex',
|
|
51
|
+
height: '100%',
|
|
52
|
+
flexDirection: 'column',
|
|
53
|
+
position: 'relative',
|
|
54
|
+
transform: 'translate(0, 0)',
|
|
55
|
+
overflow: 'hidden',
|
|
56
|
+
width: '100%',
|
|
57
|
+
textAlign: 'left',
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
// Header
|
|
61
|
+
'.rvc-modal-header': {
|
|
62
|
+
paddingTop: 'var(--rvc-modal-padding-y)',
|
|
63
|
+
paddingRight: 'var(--rvc-modal-padding-x)',
|
|
64
|
+
paddingBottom: 'var(--rvc-modal-padding-y)',
|
|
65
|
+
paddingLeft: 'var(--rvc-modal-padding-x)',
|
|
66
|
+
backgroundColor: 'var(--rvc-modal-header-bg-color)',
|
|
67
|
+
borderBottomColor: 'var(--rvc-modal-border-color)',
|
|
68
|
+
borderBottomWidth: 'var(--rvc-modal-border-width)',
|
|
69
|
+
borderBottomStyle: 'var(--rvc-modal-border-style)',
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
// Title
|
|
73
|
+
'.rvc-modal-title': {
|
|
74
|
+
fontSize: 'var(--rvc-modal-title-font-size)',
|
|
75
|
+
fontWeight: 'var(--rvc-modal-title-font-weight)',
|
|
76
|
+
color: 'var(--rvc-modal-title-color)',
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
// Close
|
|
80
|
+
'.rvc-modal-close': {
|
|
81
|
+
width: 'var(--rvc-modal-close-size)',
|
|
82
|
+
height: 'var(--rvc-modal-close-size)',
|
|
83
|
+
color: 'var(--rvc-modal-close-color)',
|
|
84
|
+
|
|
85
|
+
'&:hover': {
|
|
86
|
+
color: 'var(--rvc-modal-close-color-hover)',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
// Content
|
|
91
|
+
'.rvc-modal-content': {
|
|
92
|
+
paddingTop: 'var(--rvc-modal-padding-y)',
|
|
93
|
+
paddingRight: 'var(--rvc-modal-padding-x)',
|
|
94
|
+
paddingBottom: 'var(--rvc-modal-padding-y)',
|
|
95
|
+
paddingLeft: 'var(--rvc-modal-padding-x)',
|
|
96
|
+
backgroundColor: 'var(--rvc-modal-content-bg-color)',
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
// Footer
|
|
100
|
+
'.rvc-modal-footer': {
|
|
101
|
+
paddingTop: 'var(--rvc-modal-padding-y)',
|
|
102
|
+
paddingRight: 'var(--rvc-modal-padding-x)',
|
|
103
|
+
paddingBottom: 'var(--rvc-modal-padding-y)',
|
|
104
|
+
paddingLeft: 'var(--rvc-modal-padding-x)',
|
|
105
|
+
gap: 'var(--rvc-modal-footer-gap)',
|
|
106
|
+
backgroundColor: 'var(--rvc-modal-footer-bg-color)',
|
|
107
|
+
borderTopColor: 'var(--rvc-modal-border-color)',
|
|
108
|
+
borderTopWidth: 'var(--rvc-modal-border-width)',
|
|
109
|
+
borderTopStyle: 'var(--rvc-modal-border-style)',
|
|
110
|
+
display: 'flex',
|
|
111
|
+
flexDirection: 'column',
|
|
112
|
+
|
|
113
|
+
[`@media (min-width: ${theme('screens.sm')})`]: {
|
|
114
|
+
'--rvc-modal-footer-gap': theme('gap.3'),
|
|
115
|
+
|
|
116
|
+
flexDirection: 'row-reverse',
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
// Larger screens
|
|
121
|
+
[`@media (min-width: ${theme('screens.sm')})`]: {
|
|
122
|
+
'--rvc-modal-padding-x': theme('padding.6'),
|
|
123
|
+
'--rvc-modal-padding-y': theme('padding.4'),
|
|
124
|
+
...theme('components.modal[screen-sm]'),
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
});
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DataTable component
|
|
3
|
+
*
|
|
4
|
+
* @param {Object} theme - The global theme object
|
|
5
|
+
*/
|
|
6
|
+
export default (theme) => ({
|
|
7
|
+
':root': {
|
|
8
|
+
'--rvc-table-head-border-color': theme('colors.slate.300'),
|
|
9
|
+
'--rvc-table-border-color': theme('colors.slate.200'),
|
|
10
|
+
'--rvc-table-border-style': 'solid',
|
|
11
|
+
'--rvc-table-border-width': theme('borderWidth.DEFAULT'),
|
|
12
|
+
'--rvc-table-head-bg-color': theme('colors.slate.200'),
|
|
13
|
+
'--rvc-table-bg-color': theme('colors.slate.50'),
|
|
14
|
+
'--rvc-table-font-size': '0.875rem',
|
|
15
|
+
'--rvc-table-head-font-size': '0.875rem',
|
|
16
|
+
'--rvc-table-head-font-weight': theme('fontWeight.medium'),
|
|
17
|
+
'--rvc-table-font-weight': theme('fontWeight.normal'),
|
|
18
|
+
'--rvc-table-padding-x': theme('padding.2'),
|
|
19
|
+
'--rvc-table-padding-y': theme('padding.3'),
|
|
20
|
+
'--rvc-table-white-space': 'nowrap',
|
|
21
|
+
'--rvc-table-line-height': '1.1',
|
|
22
|
+
'--rvc-table-spinner-size': theme('size.5'),
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
'.rvc-table': {
|
|
26
|
+
...theme('components.table'),
|
|
27
|
+
|
|
28
|
+
'&.rvc-table-striped': {
|
|
29
|
+
thead: {
|
|
30
|
+
th: {
|
|
31
|
+
paddingRight: 'var(--rvc-table-padding-x)',
|
|
32
|
+
paddingLeft: 'var(--rvc-table-padding-x)',
|
|
33
|
+
backgroundColor: 'var(--rvc-table-head-bg-color)',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
'tr:nth-of-type(even)': {
|
|
38
|
+
td: {
|
|
39
|
+
backgroundColor: 'var(--rvc-table-bg-color)',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
td: {
|
|
44
|
+
paddingRight: 'var(--rvc-table-padding-x)',
|
|
45
|
+
paddingLeft: 'var(--rvc-table-padding-x)',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
'&:not(.rvc-table-striped)': {
|
|
50
|
+
thead: {
|
|
51
|
+
th: {
|
|
52
|
+
borderBottomWidth: 'var(--rvc-table-border-width)',
|
|
53
|
+
borderBottomColor: 'var(--rvc-table-head-border-color)',
|
|
54
|
+
borderBottomStyle: 'var(--rvc-table-border-style)',
|
|
55
|
+
|
|
56
|
+
'&:not(:first-child,:last-child)': {
|
|
57
|
+
paddingRight: 'var(--rvc-table-padding-x)',
|
|
58
|
+
paddingLeft: 'var(--rvc-table-padding-x)',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
'tr:not(:last-child)': {
|
|
64
|
+
td: {
|
|
65
|
+
borderBottomWidth: 'var(--rvc-table-border-width)',
|
|
66
|
+
borderBottomColor: 'var(--rvc-table-border-color)',
|
|
67
|
+
borderBottomStyle: 'var(--rvc-table-border-style)',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
'td:not(:first-child,:last-child)': {
|
|
72
|
+
paddingRight: 'var(--rvc-table-padding-x)',
|
|
73
|
+
paddingLeft: 'var(--rvc-table-padding-x)',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
thead: {
|
|
78
|
+
th: {
|
|
79
|
+
paddingTop: 'var(--rvc-table-padding-y)',
|
|
80
|
+
paddingBottom: 'var(--rvc-table-padding-y)',
|
|
81
|
+
fontSize: 'var(--rvc-table-head-font-size)',
|
|
82
|
+
fontWeight: 'var(--rvc-table-head-font-weight)',
|
|
83
|
+
lineHeight: 'var(--rvc-table-line-height)',
|
|
84
|
+
whiteSpace: 'var(--rvc-table-white-space)',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
td: {
|
|
89
|
+
paddingTop: 'var(--rvc-table-padding-y)',
|
|
90
|
+
paddingBottom: 'var(--rvc-table-padding-y)',
|
|
91
|
+
fontSize: 'var(--rvc-table-font-size)',
|
|
92
|
+
fontWeight: 'var(--rvc-table-font-weight)',
|
|
93
|
+
lineHeight: 'var(--rvc-table-line-height)',
|
|
94
|
+
whiteSpace: 'var(--rvc-table-white-space)',
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
'.rvc-table-spinner': {
|
|
98
|
+
animation: theme('animation.spin'),
|
|
99
|
+
width: 'var(--rvc-table-spinner-size)',
|
|
100
|
+
height: 'var(--rvc-table-spinner-size)',
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
'td.rvc-table-state': {
|
|
104
|
+
borderBottomWidth: 'var(--rvc-table-border-width)',
|
|
105
|
+
borderBottomColor: 'var(--rvc-table-border-color)',
|
|
106
|
+
borderBottomStyle: 'var(--rvc-table-border-style)',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { withAlphaValue } from 'tailwindcss/lib/util/withAlphaVariable';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Tooltip component
|
|
5
|
+
*
|
|
6
|
+
* @param {Object} theme - The global theme object
|
|
7
|
+
*/
|
|
8
|
+
export default (theme) => ({
|
|
9
|
+
':root': {
|
|
10
|
+
'--rvc-tooltip-color': theme('colors.white'),
|
|
11
|
+
'--rvc-tooltip-transition-property': 'opacity, visibility',
|
|
12
|
+
'--rvc-tooltip-transition-duration': theme('transitionDuration.DEFAULT'),
|
|
13
|
+
'--rvc-tooltip-transition-timing-function': theme('transitionTimingFunction.DEFAULT'),
|
|
14
|
+
'--rvc-tooltip-text-align': 'left',
|
|
15
|
+
'--rvc-tooltip-padding-x': theme('padding.4'),
|
|
16
|
+
'--rvc-tooltip-padding-y': theme('padding.4'),
|
|
17
|
+
'--rvc-tooltip-width': theme('width.max'),
|
|
18
|
+
'--rvc-tooltip-border-radius': theme('borderRadius.DEFAULT'),
|
|
19
|
+
'--rvc-tooltip-bg-color': withAlphaValue(theme('colors.neutral.700'), 0.6),
|
|
20
|
+
'--rvc-tooltip-arrow-size': theme('width.3'),
|
|
21
|
+
'--rvc-tooltip-blur-size': theme('blur.sm'),
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
'.rvc-tooltip': {
|
|
25
|
+
zIndex: 10,
|
|
26
|
+
color: 'var(--rvc-tooltip-color)',
|
|
27
|
+
transitionProperty: 'var(--rvc-tooltip-transition-property)',
|
|
28
|
+
transitionDuration: 'var(--rvc-tooltip-transition-duration)',
|
|
29
|
+
transitionTimingFunction: 'var(--rvc-tooltip-transition-timing-function)',
|
|
30
|
+
textAlign: 'var(--rvc-tooltip-text-align)',
|
|
31
|
+
paddingTop: 'var(--rvc-tooltip-padding-y)',
|
|
32
|
+
paddingRight: 'var(--rvc-tooltip-padding-x)',
|
|
33
|
+
paddingBottom: 'var(--rvc-tooltip-padding-y)',
|
|
34
|
+
paddingLeft: 'var(--rvc-tooltip-padding-x)',
|
|
35
|
+
width: 'var(--rvc-tooltip-width)',
|
|
36
|
+
position: 'absolute',
|
|
37
|
+
top: 0,
|
|
38
|
+
left: 0,
|
|
39
|
+
...theme('components.tooltip'),
|
|
40
|
+
|
|
41
|
+
'&::before': {
|
|
42
|
+
content: '""',
|
|
43
|
+
position: 'absolute',
|
|
44
|
+
top: 0,
|
|
45
|
+
right: 0,
|
|
46
|
+
bottom: 0,
|
|
47
|
+
left: 0,
|
|
48
|
+
borderRadius: 'var(--rvc-tooltip-border-radius)',
|
|
49
|
+
backgroundColor: 'var(--rvc-tooltip-bg-color)',
|
|
50
|
+
zIndex: -1,
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
// Arrow
|
|
54
|
+
'.rvc-tooltip-arrow': {
|
|
55
|
+
backgroundColor: 'var(--rvc-tooltip-bg-color)',
|
|
56
|
+
width: 'var(--rvc-tooltip-arrow-size)',
|
|
57
|
+
height: 'var(--rvc-tooltip-arrow-size)',
|
|
58
|
+
clipPath: 'polygon(0 0, 50% 50%, 100% 0)',
|
|
59
|
+
zIndex: -1,
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
'&.rvc-tooltip-blur::before, &.rvc-tooltip-blur .rvc-tooltip-arrow': {
|
|
63
|
+
backdropFilter: 'blur(var(--rvc-tooltip-blur-size))',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
});
|
package/dist/tailwind/index.js
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import plugin from 'tailwindcss/plugin';
|
|
2
2
|
|
|
3
|
+
// Base
|
|
4
|
+
import base from './base/index.js';
|
|
5
|
+
|
|
3
6
|
// Components
|
|
7
|
+
import accordion from './components/accordion.js';
|
|
4
8
|
import alert from './components/alert.js';
|
|
5
9
|
import badge from './components/badge.js';
|
|
6
10
|
import button from './components/button.js';
|
|
11
|
+
import checkbox from './components/checkbox.js';
|
|
7
12
|
import drawer from './components/drawer.js';
|
|
13
|
+
import lightswitch from './components/lightswitch.js';
|
|
14
|
+
import modal from './components/modal.js';
|
|
15
|
+
import table from './components/table.js';
|
|
16
|
+
import tooltip from './components/tooltip.js';
|
|
8
17
|
|
|
9
18
|
/**
|
|
10
19
|
* Tailwind Theme plugin
|
|
@@ -16,11 +25,18 @@ import drawer from './components/drawer.js';
|
|
|
16
25
|
*
|
|
17
26
|
* @returns {void}
|
|
18
27
|
*/
|
|
19
|
-
export default plugin.withOptions(() => ({ addComponents, theme }) => {
|
|
28
|
+
export default plugin.withOptions(() => ({ addComponents, addBase, theme }) => {
|
|
29
|
+
addBase(base(theme));
|
|
20
30
|
addComponents([
|
|
31
|
+
accordion(theme),
|
|
21
32
|
alert(theme),
|
|
22
33
|
badge(theme),
|
|
23
34
|
button(theme),
|
|
35
|
+
checkbox(theme),
|
|
24
36
|
drawer(theme),
|
|
37
|
+
lightswitch(theme),
|
|
38
|
+
modal(theme),
|
|
39
|
+
table(theme),
|
|
40
|
+
tooltip(theme),
|
|
25
41
|
], { respectPrefix: false });
|
|
26
42
|
});
|