@sk-web-gui/core 0.1.37 → 0.1.39
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/LICENSE +21 -21
- package/README.md +5 -5
- package/package.json +2 -2
- package/src/colors.js +145 -145
- package/src/components/accordion.js +89 -89
- package/src/components/alert.js +98 -98
- package/src/components/avatar.js +85 -85
- package/src/components/badge.js +60 -60
- package/src/components/breadcrumb.js +13 -13
- package/src/components/button-group.js +46 -46
- package/src/components/button.js +304 -304
- package/src/components/calendar.js +82 -82
- package/src/components/card.js +54 -54
- package/src/components/checkbox.js +127 -127
- package/src/components/code.js +9 -9
- package/src/components/cookie-consent.js +30 -30
- package/src/components/divider.js +12 -12
- package/src/components/dot.js +84 -84
- package/src/components/dropdown-filter.js +72 -72
- package/src/components/footer.js +42 -42
- package/src/components/forms.js +256 -256
- package/src/components/header.js +35 -35
- package/src/components/icon-button.js +5 -5
- package/src/components/icon.js +9 -9
- package/src/components/kbd.js +9 -9
- package/src/components/link.js +20 -20
- package/src/components/message.js +62 -62
- package/src/components/modal.js +30 -30
- package/src/components/notification.js +56 -56
- package/src/components/pagination.js +69 -69
- package/src/components/radio.js +104 -104
- package/src/components/search-bar.js +44 -44
- package/src/components/side-menu.js +186 -0
- package/src/components/switch.js +119 -119
- package/src/components/tab-menu.js +36 -36
- package/src/components/table.js +13 -13
- package/src/components/tag.js +97 -97
- package/src/components/user-menu.js +23 -23
- package/src/components/zebratable.js +77 -77
- package/src/index.js +272 -272
- package/src/with-opacity.js +6 -6
- package/src/components/menu.js +0 -171
package/src/components/forms.js
CHANGED
|
@@ -1,256 +1,256 @@
|
|
|
1
|
-
function fieldOutline(colors) {
|
|
2
|
-
return {
|
|
3
|
-
'&-outline': {
|
|
4
|
-
'@apply border shadow-sm border-gray-stroke': {},
|
|
5
|
-
'@apply text-gray bg-white': {},
|
|
6
|
-
//"@apply hover:border-neutral-300": {},
|
|
7
|
-
|
|
8
|
-
'&[aria-invalid=true]': {
|
|
9
|
-
'--tw-border-opacity': '1',
|
|
10
|
-
borderColor: 'rgba(220, 38, 38, var(--tw-border-opacity))',
|
|
11
|
-
'--tw-ring-offset-shadow': 'var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)',
|
|
12
|
-
'--tw-ring-shadow': 'var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)',
|
|
13
|
-
boxShadow: 'var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)',
|
|
14
|
-
'--tw-ring-opacity': '1',
|
|
15
|
-
'--tw-ring-color': 'rgba(220, 38, 38, var(--tw-ring-opacity))',
|
|
16
|
-
},
|
|
17
|
-
'focus-visible:ring-4': {},
|
|
18
|
-
/* dark mode */
|
|
19
|
-
'@apply dark:border-neutral-700': {},
|
|
20
|
-
'@apply dark:text-neutral-100 dark:bg-base': {},
|
|
21
|
-
'@apply dark:hover:border-neutral-600': {},
|
|
22
|
-
|
|
23
|
-
'.dark &[aria-invalid=true]': {
|
|
24
|
-
'--tw-border-opacity': '1',
|
|
25
|
-
borderColor: 'rgba(248, 113, 113, var(--tw-border-opacity))',
|
|
26
|
-
'--tw-ring-opacity': '1',
|
|
27
|
-
'--tw-ring-color': 'rgba(248, 113, 113, var(--tw-ring-opacity))',
|
|
28
|
-
},
|
|
29
|
-
'@media (prefers-color-scheme: dark)': {
|
|
30
|
-
'&[aria-invalid=true]': {
|
|
31
|
-
'--tw-border-opacity': '1',
|
|
32
|
-
borderColor: 'rgba(248, 113, 113, var(--tw-border-opacity))',
|
|
33
|
-
'--tw-ring-opacity': '1',
|
|
34
|
-
'--tw-ring-color': 'rgba(248, 113, 113, var(--tw-ring-opacity))',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
...colors.reduce(
|
|
39
|
-
(styles, color) => ({
|
|
40
|
-
...styles,
|
|
41
|
-
[`&[data-color="${color}"]`]: {
|
|
42
|
-
[`@apply focus-visible:border-${color} focus-visible:ring-${color}`]: {},
|
|
43
|
-
[`@apply dark:focus-visible:border-${color} dark:focus-visible:ring-${color}`]: {},
|
|
44
|
-
},
|
|
45
|
-
}),
|
|
46
|
-
{}
|
|
47
|
-
),
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function fieldSolid(colors) {
|
|
53
|
-
return {
|
|
54
|
-
'&-solid': {
|
|
55
|
-
'@apply border border-transparent': {},
|
|
56
|
-
'@apply text-black bg-gray-light': {},
|
|
57
|
-
//"@apply hover:bg-gray-200": {},
|
|
58
|
-
|
|
59
|
-
'&[aria-invalid=true]': {
|
|
60
|
-
'--tw-border-opacity': '1',
|
|
61
|
-
borderColor: 'rgba(220, 38, 38, var(--tw-border-opacity))',
|
|
62
|
-
'--tw-ring-offset-shadow': 'var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)',
|
|
63
|
-
'--tw-ring-shadow': 'var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)',
|
|
64
|
-
boxShadow: 'var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)',
|
|
65
|
-
'--tw-ring-opacity': '1',
|
|
66
|
-
'--tw-ring-color': 'rgba(220, 38, 38, var(--tw-ring-opacity))',
|
|
67
|
-
},
|
|
68
|
-
'focus-visible:ring-4': {},
|
|
69
|
-
/* dark mode */
|
|
70
|
-
'@apply dark:text-neutral-100 dark:bg-white/50': {},
|
|
71
|
-
'@apply dark:hover:bg-white/100': {},
|
|
72
|
-
'.dark &[aria-invalid=true]': {
|
|
73
|
-
'--tw-border-opacity': '1',
|
|
74
|
-
borderColor: 'rgba(248, 113, 113, var(--tw-border-opacity))',
|
|
75
|
-
'--tw-ring-opacity': '1',
|
|
76
|
-
'--tw-ring-color': 'rgba(248, 113, 113, var(--tw-ring-opacity))',
|
|
77
|
-
},
|
|
78
|
-
'@media (prefers-color-scheme: dark)': {
|
|
79
|
-
'&[aria-invalid=true]': {
|
|
80
|
-
'--tw-border-opacity': '1',
|
|
81
|
-
borderColor: 'rgba(248, 113, 113, var(--tw-border-opacity))',
|
|
82
|
-
'--tw-ring-opacity': '1',
|
|
83
|
-
'--tw-ring-color': 'rgba(248, 113, 113, var(--tw-ring-opacity))',
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
...colors.reduce(
|
|
88
|
-
(styles, color) => ({
|
|
89
|
-
...styles,
|
|
90
|
-
[`&[data-color="${color}"]`]: {
|
|
91
|
-
[`@apply focus-visible:border-${color} focus-visible:ring-${color}`]: {},
|
|
92
|
-
[`@apply dark:focus-visible:border-${color} dark:focus-visible:ring-${color}`]: {},
|
|
93
|
-
},
|
|
94
|
-
}),
|
|
95
|
-
{}
|
|
96
|
-
),
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function formControl() {
|
|
102
|
-
return {
|
|
103
|
-
'.form-control': {
|
|
104
|
-
'@apply w-full relative': {},
|
|
105
|
-
},
|
|
106
|
-
'.form-helper-text': {
|
|
107
|
-
'@apply mt-1.5 leading-none text-gray dark:text-white/60': {},
|
|
108
|
-
},
|
|
109
|
-
'.form-error-message': {
|
|
110
|
-
'@apply mt-1.5 leading-none flex items-center text-sm': {},
|
|
111
|
-
'--tw-text-opacity': '1',
|
|
112
|
-
color: 'rgba(239, 68, 68, var(--tw-text-opacity))',
|
|
113
|
-
'.dark &': {
|
|
114
|
-
'--tw-text-opacity': '1',
|
|
115
|
-
color: 'rgba(252, 165, 165, var(--tw-text-opacity))',
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
'.form-label': {
|
|
119
|
-
'@apply text-sm font-medium text-left align-middle block mb-1.5': {},
|
|
120
|
-
|
|
121
|
-
'&-disabled': {
|
|
122
|
-
//"@apply opacity-60": {},
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
'.form-required-indicator': {
|
|
126
|
-
'@apply ml-1 text-sm': {},
|
|
127
|
-
'--tw-text-opacity': '1',
|
|
128
|
-
color: 'rgba(239, 68, 68, var(--tw-text-opacity))',
|
|
129
|
-
'.dark &': {
|
|
130
|
-
'--tw-text-opacity': '1',
|
|
131
|
-
color: 'rgba(252, 165, 165, var(--tw-text-opacity))',
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function formInputGroup() {
|
|
138
|
-
return {
|
|
139
|
-
'.form-input-group': {
|
|
140
|
-
'@apply flex relative': {},
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
'.form-input-element': {
|
|
144
|
-
'@apply flex items-center justify-center absolute z-base top-0': {},
|
|
145
|
-
|
|
146
|
-
'&-sm': {
|
|
147
|
-
'@apply text-xs h-7 w-7': {},
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
'&-md': {
|
|
151
|
-
'@apply text-sm h-8 w-8': {},
|
|
152
|
-
},
|
|
153
|
-
|
|
154
|
-
'&-lg': {
|
|
155
|
-
'@apply text-base h-10 w-10': {},
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
'.form-input-addon': {
|
|
160
|
-
'@apply flex items-center w-auto rounded-base shadow-sm whitespace-nowrap': {},
|
|
161
|
-
'@apply border border-neutral-300': {},
|
|
162
|
-
'@apply text-neutral-600 bg-neutral-50': {},
|
|
163
|
-
// dark colors
|
|
164
|
-
'@apply dark:border-neutral-700': {},
|
|
165
|
-
'@apply dark:text-neutral-100 dark:bg-white/30': {},
|
|
166
|
-
|
|
167
|
-
'&-sm': {
|
|
168
|
-
'@apply px-3 text-xs': {},
|
|
169
|
-
},
|
|
170
|
-
|
|
171
|
-
'&-md': {
|
|
172
|
-
'@apply px-4 text-sm': {},
|
|
173
|
-
},
|
|
174
|
-
|
|
175
|
-
'&-lg': {
|
|
176
|
-
'@apply px-4 text-base': {},
|
|
177
|
-
},
|
|
178
|
-
|
|
179
|
-
'&-left': {
|
|
180
|
-
'@apply -mr-1 rounded-r-none': {},
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
'&-right': {
|
|
184
|
-
'@apply -ml-1 rounded-l-none': {},
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
module.exports = Forms = (colors) => ({
|
|
191
|
-
'.form-field': {
|
|
192
|
-
'@apply placeholder-gray-stroke': {},
|
|
193
|
-
'@apply relative w-full min-w-0 inline-flex items-center appearance-none focus-visible:outline-none': {},
|
|
194
|
-
'@apply transition-colors duration-75 ease-out': {},
|
|
195
|
-
|
|
196
|
-
'&-sm': {
|
|
197
|
-
'@apply text-sm leading-sm': {},
|
|
198
|
-
borderRadius: '0.2rem',
|
|
199
|
-
padding: '1.08rem 1.44rem',
|
|
200
|
-
},
|
|
201
|
-
|
|
202
|
-
'&-md': {
|
|
203
|
-
'@apply text-base leading-base': {},
|
|
204
|
-
borderRadius: '0.2rem',
|
|
205
|
-
padding: '1.2rem 1.6rem',
|
|
206
|
-
},
|
|
207
|
-
|
|
208
|
-
'&-lg': {
|
|
209
|
-
'@apply text-lg leading-lg': {},
|
|
210
|
-
borderRadius: '0.2rem',
|
|
211
|
-
padding: '1.32rem 1.76rem',
|
|
212
|
-
},
|
|
213
|
-
|
|
214
|
-
'&-disabled': {
|
|
215
|
-
'@apply disabled:cursor-not-allowed': {},
|
|
216
|
-
'@apply disabled:bg-gray-lighter': {},
|
|
217
|
-
//"@apply disabled:shadow-none disabled:cursor-not-allowed disabled:opacity-60": {},
|
|
218
|
-
//"@apply disabled:border-neutral-200 disabled:bg-neutral-200": {},
|
|
219
|
-
//"@apply dark:disabled:border-transparent dark:disabled:bg-white/20": {},
|
|
220
|
-
},
|
|
221
|
-
|
|
222
|
-
// variants
|
|
223
|
-
...fieldOutline(colors),
|
|
224
|
-
...fieldSolid(colors),
|
|
225
|
-
},
|
|
226
|
-
|
|
227
|
-
'.form-textarea': {
|
|
228
|
-
//"@apply leading-tight": {},
|
|
229
|
-
minHeight: '5rem',
|
|
230
|
-
|
|
231
|
-
'&-counter': {
|
|
232
|
-
'@apply mt-xs text-right': {},
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
|
|
236
|
-
'.form-select': {
|
|
237
|
-
'@apply min-h-[50px] text-body bg-white caret-transparent select-none cursor-pointer border-gray-stroke': {},
|
|
238
|
-
'background-image': 'none',
|
|
239
|
-
|
|
240
|
-
'&-list': {
|
|
241
|
-
'@apply z-10 absolute w-full bg-white mt-0 border border-gray-stroke border-t-0': {},
|
|
242
|
-
},
|
|
243
|
-
|
|
244
|
-
'&-option': {
|
|
245
|
-
'@apply rounded-none cursor-default hover:text-white focus-visible:text-white hover:bg-primary focus-visible:bg-primary':
|
|
246
|
-
{},
|
|
247
|
-
|
|
248
|
-
'&.active': {
|
|
249
|
-
'@apply bg-primary text-white': {},
|
|
250
|
-
},
|
|
251
|
-
},
|
|
252
|
-
},
|
|
253
|
-
|
|
254
|
-
...formInputGroup(),
|
|
255
|
-
...formControl(),
|
|
256
|
-
});
|
|
1
|
+
function fieldOutline(colors) {
|
|
2
|
+
return {
|
|
3
|
+
'&-outline': {
|
|
4
|
+
'@apply border shadow-sm border-gray-stroke': {},
|
|
5
|
+
'@apply text-gray bg-white': {},
|
|
6
|
+
//"@apply hover:border-neutral-300": {},
|
|
7
|
+
|
|
8
|
+
'&[aria-invalid=true]': {
|
|
9
|
+
'--tw-border-opacity': '1',
|
|
10
|
+
borderColor: 'rgba(220, 38, 38, var(--tw-border-opacity))',
|
|
11
|
+
'--tw-ring-offset-shadow': 'var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)',
|
|
12
|
+
'--tw-ring-shadow': 'var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)',
|
|
13
|
+
boxShadow: 'var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)',
|
|
14
|
+
'--tw-ring-opacity': '1',
|
|
15
|
+
'--tw-ring-color': 'rgba(220, 38, 38, var(--tw-ring-opacity))',
|
|
16
|
+
},
|
|
17
|
+
'focus-visible:ring-4': {},
|
|
18
|
+
/* dark mode */
|
|
19
|
+
'@apply dark:border-neutral-700': {},
|
|
20
|
+
'@apply dark:text-neutral-100 dark:bg-base': {},
|
|
21
|
+
'@apply dark:hover:border-neutral-600': {},
|
|
22
|
+
|
|
23
|
+
'.dark &[aria-invalid=true]': {
|
|
24
|
+
'--tw-border-opacity': '1',
|
|
25
|
+
borderColor: 'rgba(248, 113, 113, var(--tw-border-opacity))',
|
|
26
|
+
'--tw-ring-opacity': '1',
|
|
27
|
+
'--tw-ring-color': 'rgba(248, 113, 113, var(--tw-ring-opacity))',
|
|
28
|
+
},
|
|
29
|
+
'@media (prefers-color-scheme: dark)': {
|
|
30
|
+
'&[aria-invalid=true]': {
|
|
31
|
+
'--tw-border-opacity': '1',
|
|
32
|
+
borderColor: 'rgba(248, 113, 113, var(--tw-border-opacity))',
|
|
33
|
+
'--tw-ring-opacity': '1',
|
|
34
|
+
'--tw-ring-color': 'rgba(248, 113, 113, var(--tw-ring-opacity))',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
...colors.reduce(
|
|
39
|
+
(styles, color) => ({
|
|
40
|
+
...styles,
|
|
41
|
+
[`&[data-color="${color}"]`]: {
|
|
42
|
+
[`@apply focus-visible:border-${color} focus-visible:ring-${color}`]: {},
|
|
43
|
+
[`@apply dark:focus-visible:border-${color} dark:focus-visible:ring-${color}`]: {},
|
|
44
|
+
},
|
|
45
|
+
}),
|
|
46
|
+
{}
|
|
47
|
+
),
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function fieldSolid(colors) {
|
|
53
|
+
return {
|
|
54
|
+
'&-solid': {
|
|
55
|
+
'@apply border border-transparent': {},
|
|
56
|
+
'@apply text-black bg-gray-light': {},
|
|
57
|
+
//"@apply hover:bg-gray-200": {},
|
|
58
|
+
|
|
59
|
+
'&[aria-invalid=true]': {
|
|
60
|
+
'--tw-border-opacity': '1',
|
|
61
|
+
borderColor: 'rgba(220, 38, 38, var(--tw-border-opacity))',
|
|
62
|
+
'--tw-ring-offset-shadow': 'var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)',
|
|
63
|
+
'--tw-ring-shadow': 'var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)',
|
|
64
|
+
boxShadow: 'var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)',
|
|
65
|
+
'--tw-ring-opacity': '1',
|
|
66
|
+
'--tw-ring-color': 'rgba(220, 38, 38, var(--tw-ring-opacity))',
|
|
67
|
+
},
|
|
68
|
+
'focus-visible:ring-4': {},
|
|
69
|
+
/* dark mode */
|
|
70
|
+
'@apply dark:text-neutral-100 dark:bg-white/50': {},
|
|
71
|
+
'@apply dark:hover:bg-white/100': {},
|
|
72
|
+
'.dark &[aria-invalid=true]': {
|
|
73
|
+
'--tw-border-opacity': '1',
|
|
74
|
+
borderColor: 'rgba(248, 113, 113, var(--tw-border-opacity))',
|
|
75
|
+
'--tw-ring-opacity': '1',
|
|
76
|
+
'--tw-ring-color': 'rgba(248, 113, 113, var(--tw-ring-opacity))',
|
|
77
|
+
},
|
|
78
|
+
'@media (prefers-color-scheme: dark)': {
|
|
79
|
+
'&[aria-invalid=true]': {
|
|
80
|
+
'--tw-border-opacity': '1',
|
|
81
|
+
borderColor: 'rgba(248, 113, 113, var(--tw-border-opacity))',
|
|
82
|
+
'--tw-ring-opacity': '1',
|
|
83
|
+
'--tw-ring-color': 'rgba(248, 113, 113, var(--tw-ring-opacity))',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
...colors.reduce(
|
|
88
|
+
(styles, color) => ({
|
|
89
|
+
...styles,
|
|
90
|
+
[`&[data-color="${color}"]`]: {
|
|
91
|
+
[`@apply focus-visible:border-${color} focus-visible:ring-${color}`]: {},
|
|
92
|
+
[`@apply dark:focus-visible:border-${color} dark:focus-visible:ring-${color}`]: {},
|
|
93
|
+
},
|
|
94
|
+
}),
|
|
95
|
+
{}
|
|
96
|
+
),
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function formControl() {
|
|
102
|
+
return {
|
|
103
|
+
'.form-control': {
|
|
104
|
+
'@apply w-full relative': {},
|
|
105
|
+
},
|
|
106
|
+
'.form-helper-text': {
|
|
107
|
+
'@apply mt-1.5 leading-none text-gray dark:text-white/60': {},
|
|
108
|
+
},
|
|
109
|
+
'.form-error-message': {
|
|
110
|
+
'@apply mt-1.5 leading-none flex items-center text-sm': {},
|
|
111
|
+
'--tw-text-opacity': '1',
|
|
112
|
+
color: 'rgba(239, 68, 68, var(--tw-text-opacity))',
|
|
113
|
+
'.dark &': {
|
|
114
|
+
'--tw-text-opacity': '1',
|
|
115
|
+
color: 'rgba(252, 165, 165, var(--tw-text-opacity))',
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
'.form-label': {
|
|
119
|
+
'@apply text-sm font-medium text-left align-middle block mb-1.5': {},
|
|
120
|
+
|
|
121
|
+
'&-disabled': {
|
|
122
|
+
//"@apply opacity-60": {},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
'.form-required-indicator': {
|
|
126
|
+
'@apply ml-1 text-sm': {},
|
|
127
|
+
'--tw-text-opacity': '1',
|
|
128
|
+
color: 'rgba(239, 68, 68, var(--tw-text-opacity))',
|
|
129
|
+
'.dark &': {
|
|
130
|
+
'--tw-text-opacity': '1',
|
|
131
|
+
color: 'rgba(252, 165, 165, var(--tw-text-opacity))',
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function formInputGroup() {
|
|
138
|
+
return {
|
|
139
|
+
'.form-input-group': {
|
|
140
|
+
'@apply flex relative': {},
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
'.form-input-element': {
|
|
144
|
+
'@apply flex items-center justify-center absolute z-base top-0': {},
|
|
145
|
+
|
|
146
|
+
'&-sm': {
|
|
147
|
+
'@apply text-xs h-7 w-7': {},
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
'&-md': {
|
|
151
|
+
'@apply text-sm h-8 w-8': {},
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
'&-lg': {
|
|
155
|
+
'@apply text-base h-10 w-10': {},
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
'.form-input-addon': {
|
|
160
|
+
'@apply flex items-center w-auto rounded-base shadow-sm whitespace-nowrap': {},
|
|
161
|
+
'@apply border border-neutral-300': {},
|
|
162
|
+
'@apply text-neutral-600 bg-neutral-50': {},
|
|
163
|
+
// dark colors
|
|
164
|
+
'@apply dark:border-neutral-700': {},
|
|
165
|
+
'@apply dark:text-neutral-100 dark:bg-white/30': {},
|
|
166
|
+
|
|
167
|
+
'&-sm': {
|
|
168
|
+
'@apply px-3 text-xs': {},
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
'&-md': {
|
|
172
|
+
'@apply px-4 text-sm': {},
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
'&-lg': {
|
|
176
|
+
'@apply px-4 text-base': {},
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
'&-left': {
|
|
180
|
+
'@apply -mr-1 rounded-r-none': {},
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
'&-right': {
|
|
184
|
+
'@apply -ml-1 rounded-l-none': {},
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
module.exports = Forms = (colors) => ({
|
|
191
|
+
'.form-field': {
|
|
192
|
+
'@apply placeholder-gray-stroke': {},
|
|
193
|
+
'@apply relative w-full min-w-0 inline-flex items-center appearance-none focus-visible:outline-none': {},
|
|
194
|
+
'@apply transition-colors duration-75 ease-out': {},
|
|
195
|
+
|
|
196
|
+
'&-sm': {
|
|
197
|
+
'@apply text-sm leading-sm': {},
|
|
198
|
+
borderRadius: '0.2rem',
|
|
199
|
+
padding: '1.08rem 1.44rem',
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
'&-md': {
|
|
203
|
+
'@apply text-base leading-base': {},
|
|
204
|
+
borderRadius: '0.2rem',
|
|
205
|
+
padding: '1.2rem 1.6rem',
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
'&-lg': {
|
|
209
|
+
'@apply text-lg leading-lg': {},
|
|
210
|
+
borderRadius: '0.2rem',
|
|
211
|
+
padding: '1.32rem 1.76rem',
|
|
212
|
+
},
|
|
213
|
+
|
|
214
|
+
'&-disabled': {
|
|
215
|
+
'@apply disabled:cursor-not-allowed': {},
|
|
216
|
+
'@apply disabled:bg-gray-lighter': {},
|
|
217
|
+
//"@apply disabled:shadow-none disabled:cursor-not-allowed disabled:opacity-60": {},
|
|
218
|
+
//"@apply disabled:border-neutral-200 disabled:bg-neutral-200": {},
|
|
219
|
+
//"@apply dark:disabled:border-transparent dark:disabled:bg-white/20": {},
|
|
220
|
+
},
|
|
221
|
+
|
|
222
|
+
// variants
|
|
223
|
+
...fieldOutline(colors),
|
|
224
|
+
...fieldSolid(colors),
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
'.form-textarea': {
|
|
228
|
+
//"@apply leading-tight": {},
|
|
229
|
+
minHeight: '5rem',
|
|
230
|
+
|
|
231
|
+
'&-counter': {
|
|
232
|
+
'@apply mt-xs text-right': {},
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
|
|
236
|
+
'.form-select': {
|
|
237
|
+
'@apply min-h-[50px] text-body bg-white caret-transparent select-none cursor-pointer border-gray-stroke': {},
|
|
238
|
+
'background-image': 'none',
|
|
239
|
+
|
|
240
|
+
'&-list': {
|
|
241
|
+
'@apply z-10 absolute w-full bg-white mt-0 border border-gray-stroke border-t-0': {},
|
|
242
|
+
},
|
|
243
|
+
|
|
244
|
+
'&-option': {
|
|
245
|
+
'@apply rounded-none cursor-default hover:text-white focus-visible:text-white hover:bg-primary focus-visible:bg-primary':
|
|
246
|
+
{},
|
|
247
|
+
|
|
248
|
+
'&.active': {
|
|
249
|
+
'@apply bg-primary text-white': {},
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
|
|
254
|
+
...formInputGroup(),
|
|
255
|
+
...formControl(),
|
|
256
|
+
});
|
package/src/components/header.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
module.exports = Header = (colors) => ({
|
|
2
|
-
'.header': {
|
|
3
|
-
'@apply lg:border-t-8 lg:border-primary lg:static lg:w-auto lg:h-auto lg:min-h-0': {},
|
|
4
|
-
|
|
5
|
-
...colors.reduce(
|
|
6
|
-
(styles, color) => ({
|
|
7
|
-
...styles,
|
|
8
|
-
[`&[data-color="${color}"]`]: {
|
|
9
|
-
[`@apply border-${color}`]: {},
|
|
10
|
-
},
|
|
11
|
-
}),
|
|
12
|
-
{}
|
|
13
|
-
),
|
|
14
|
-
|
|
15
|
-
[`&[data-color="none"]`]: {
|
|
16
|
-
[`@apply border-none`]: {},
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
'&-container': {
|
|
20
|
-
'@apply flex lg:h-[112px] shadow-lg relative mx-auto px-7 pt-[22px] pb-[8px] z-10': {},
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
'&-content': {
|
|
24
|
-
'@apply flex items-center w-full justify-between m-auto flex-shrink-0 text-body max-w-[140rem]': {},
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
'&-usermenu': {
|
|
28
|
-
'@apply lg:-mr-lg block flex-shrink lg:flex lg:items-center lg:w-auto': {},
|
|
29
|
-
|
|
30
|
-
'&-content': {
|
|
31
|
-
'@apply flex flex-grow lg:flex justify-end items-center lg:w-auto': {},
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
});
|
|
1
|
+
module.exports = Header = (colors) => ({
|
|
2
|
+
'.header': {
|
|
3
|
+
'@apply lg:border-t-8 lg:border-primary lg:static lg:w-auto lg:h-auto lg:min-h-0': {},
|
|
4
|
+
|
|
5
|
+
...colors.reduce(
|
|
6
|
+
(styles, color) => ({
|
|
7
|
+
...styles,
|
|
8
|
+
[`&[data-color="${color}"]`]: {
|
|
9
|
+
[`@apply border-${color}`]: {},
|
|
10
|
+
},
|
|
11
|
+
}),
|
|
12
|
+
{}
|
|
13
|
+
),
|
|
14
|
+
|
|
15
|
+
[`&[data-color="none"]`]: {
|
|
16
|
+
[`@apply border-none`]: {},
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
'&-container': {
|
|
20
|
+
'@apply flex lg:h-[112px] shadow-lg relative mx-auto px-7 pt-[22px] pb-[8px] z-10': {},
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
'&-content': {
|
|
24
|
+
'@apply flex items-center w-full justify-between m-auto flex-shrink-0 text-body max-w-[140rem]': {},
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
'&-usermenu': {
|
|
28
|
+
'@apply lg:-mr-lg block flex-shrink lg:flex lg:items-center lg:w-auto': {},
|
|
29
|
+
|
|
30
|
+
'&-content': {
|
|
31
|
+
'@apply flex flex-grow lg:flex justify-end items-center lg:w-auto': {},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module.exports = IconButton = () => ({
|
|
2
|
-
'.btn-icon': {
|
|
3
|
-
'@apply p-0': {},
|
|
4
|
-
},
|
|
5
|
-
});
|
|
1
|
+
module.exports = IconButton = () => ({
|
|
2
|
+
'.btn-icon': {
|
|
3
|
+
'@apply p-0': {},
|
|
4
|
+
},
|
|
5
|
+
});
|
package/src/components/icon.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
module.exports = Icon = () => ({
|
|
2
|
-
'.icon-inline': {
|
|
3
|
-
'@apply inline-block align-middle': {},
|
|
4
|
-
},
|
|
5
|
-
|
|
6
|
-
'.icon-block': {
|
|
7
|
-
'@apply block': {},
|
|
8
|
-
},
|
|
9
|
-
});
|
|
1
|
+
module.exports = Icon = () => ({
|
|
2
|
+
'.icon-inline': {
|
|
3
|
+
'@apply inline-block align-middle': {},
|
|
4
|
+
},
|
|
5
|
+
|
|
6
|
+
'.icon-block': {
|
|
7
|
+
'@apply block': {},
|
|
8
|
+
},
|
|
9
|
+
});
|
package/src/components/kbd.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
module.exports = Kbd = () => ({
|
|
2
|
-
'.kbd': {
|
|
3
|
-
'@apply inline-flex justify-center items-center capitalize text-xs p-1 rounded h-5 whitespace-nowrap font-sans': {},
|
|
4
|
-
minWidth: '1.25rem',
|
|
5
|
-
'@apply bg-blackAlpha-100 text-body': {},
|
|
6
|
-
// dark
|
|
7
|
-
'@apply dark:bg-white/30 dark:text-neutral-300': {},
|
|
8
|
-
},
|
|
9
|
-
});
|
|
1
|
+
module.exports = Kbd = () => ({
|
|
2
|
+
'.kbd': {
|
|
3
|
+
'@apply inline-flex justify-center items-center capitalize text-xs p-1 rounded h-5 whitespace-nowrap font-sans': {},
|
|
4
|
+
minWidth: '1.25rem',
|
|
5
|
+
'@apply bg-blackAlpha-100 text-body': {},
|
|
6
|
+
// dark
|
|
7
|
+
'@apply dark:bg-white/30 dark:text-neutral-300': {},
|
|
8
|
+
},
|
|
9
|
+
});
|