winduum 0.5.0-next.10 → 0.5.0-next.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/base/theme/dark.css +2 -2
- package/src/base/theme/default.css +9 -9
- package/src/ui/btn/default.css +1 -1
- package/src/ui/control/icon.css +12 -12
- package/src/ui/control/select.css +2 -2
- package/utils/tailwind.cjs +58 -18
- package/utils/tailwind.js +7 -9
package/package.json
CHANGED
package/src/base/theme/dark.css
CHANGED
|
@@ -4,24 +4,24 @@
|
|
|
4
4
|
--color-current-fg: var(--color-main-fg);
|
|
5
5
|
--color-accent: var(--color-primary);
|
|
6
6
|
--color-accent-fg: var(--color-primary-fg);
|
|
7
|
-
--color-primary:
|
|
7
|
+
--color-primary: #3b82f6; /* color.blue.500 */
|
|
8
8
|
--color-primary-fg: var(--color-light);
|
|
9
|
-
--color-main:
|
|
9
|
+
--color-main: #171717; /* color.neutral.900 */
|
|
10
10
|
--color-main-fg: var(--color-body);
|
|
11
11
|
--color-main-primary: var(--color-main);
|
|
12
12
|
--color-main-secondary: color-mix(in sRGB, var(--color-main) 75%, var(--color-main-fg));
|
|
13
13
|
--color-main-tertiary: color-mix(in sRGB, var(--color-main) 50%, var(--color-main-fg));
|
|
14
|
-
--color-body:
|
|
14
|
+
--color-body: #fff; /* color.white */
|
|
15
15
|
--color-body-fg: var(--color-main);
|
|
16
16
|
--color-body-primary: var(--color-body);
|
|
17
17
|
--color-body-secondary: color-mix(in sRGB, var(--color-body) 95%, var(--color-body-fg));
|
|
18
18
|
--color-body-tertiary: color-mix(in sRGB, var(--color-body) 90%, var(--color-body-fg));
|
|
19
|
-
--color-light:
|
|
19
|
+
--color-light: #fff; /* color.white */
|
|
20
20
|
--color-light-fg: var(--color-dark);
|
|
21
|
-
--color-dark:
|
|
21
|
+
--color-dark: #171717; /* color.neutral.900 */
|
|
22
22
|
--color-dark-fg: var(--color-light);
|
|
23
|
-
--color-success:
|
|
24
|
-
--color-error:
|
|
25
|
-
--color-warning:
|
|
26
|
-
--color-info:
|
|
23
|
+
--color-success: #16a34a; /* color.green.600 */
|
|
24
|
+
--color-error: #dc2626; /* color.red.600 */
|
|
25
|
+
--color-warning: #eab308; /* color.yellow.500 */
|
|
26
|
+
--color-info: #0ea5e9; /* color.sky.500 */
|
|
27
27
|
}
|
package/src/ui/btn/default.css
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
height: var(--ui-btn-height);
|
|
13
13
|
padding: var(--ui-btn-py) var(--ui-btn-px);
|
|
14
14
|
border-radius: var(--ui-btn-border-radius, var(--rounded));
|
|
15
|
-
font-size: var(--ui-btn-font-size,
|
|
15
|
+
font-size: var(--ui-btn-font-size, var(--text-sm));
|
|
16
16
|
font-weight: var(--ui-btn-font-weight, var(--font-medium));
|
|
17
17
|
letter-spacing: var(--ui-btn-letter-spacing, 0);
|
|
18
18
|
background-color: var(--ui-btn-bg);
|
package/src/ui/control/icon.css
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
.ui-control {
|
|
2
2
|
--ui-control-icon-size: 1.25rem;
|
|
3
3
|
--ui-control-icon-gap: 0.375rem;
|
|
4
|
-
--ui-control-icon-count-s
|
|
5
|
-
--ui-control-icon-count-e
|
|
4
|
+
--ui-control-icon-s: calc(var(--ui-control-icon-count-s, 1) * (var(--ui-control-icon-size) + var(--ui-control-icon-gap)) - var(--ui-control-icon-gap));
|
|
5
|
+
--ui-control-icon-e: calc(var(--ui-control-icon-count-e, 1) * (var(--ui-control-icon-size) + var(--ui-control-icon-gap)) - var(--ui-control-icon-gap));
|
|
6
6
|
|
|
7
|
-
&:has(.icon-
|
|
8
|
-
--ui-control-ps: calc(var(--ui-control-icon-
|
|
7
|
+
&:has(.icon-s) {
|
|
8
|
+
--ui-control-ps: calc(var(--ui-control-icon-s) + var(--ui-control-px));
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
&:has(.icon-
|
|
12
|
-
--ui-control-pe: calc(var(--ui-control-icon-
|
|
11
|
+
&:has(.icon-e) {
|
|
12
|
+
--ui-control-pe: calc(var(--ui-control-icon-e) + var(--ui-control-px));
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
&:has(.icon-
|
|
15
|
+
&:has(.icon-s > *:nth-child(2)) {
|
|
16
16
|
--ui-control-icon-count-s: 2;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
&:has(.icon-
|
|
19
|
+
&:has(.icon-e > *:nth-child(2)) {
|
|
20
20
|
--ui-control-icon-count-e: 2;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
& :where(.icon-
|
|
23
|
+
& :where(.icon-s) {
|
|
24
24
|
margin-inline-end: auto;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
& :where(.icon-
|
|
27
|
+
& :where(.icon-e) {
|
|
28
28
|
margin-inline-start: auto;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
& :where(.icon-
|
|
31
|
+
& :where(.icon-s, .icon-e) {
|
|
32
32
|
display: flex;
|
|
33
33
|
align-items: center;
|
|
34
34
|
gap: var(--ui-control-icon-gap);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
&:has(textarea) :where(.icon-
|
|
37
|
+
&:has(textarea) :where(.icon-s, .icon-e) {
|
|
38
38
|
margin-block-start: var(--ui-control-py);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
--ui-control-select-icon-me: -0.25rem;
|
|
4
4
|
--ui-control-pe: calc(var(--ui-control-select-icon-size) + var(--ui-control-select-icon-me));
|
|
5
5
|
|
|
6
|
-
&:has(.icon-
|
|
6
|
+
&:has(.icon-e) {
|
|
7
7
|
--ui-control-icon-count-e: 2;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
& :where(.icon-
|
|
10
|
+
& :where(.icon-e) {
|
|
11
11
|
margin-inline-end: var(--ui-control-select-icon-size);
|
|
12
12
|
}
|
|
13
13
|
|
package/utils/tailwind.cjs
CHANGED
|
@@ -6,7 +6,6 @@ var plugin = require('tailwindcss/plugin');
|
|
|
6
6
|
var flattenColorPalette = require('tailwindcss/src/util/flattenColorPalette');
|
|
7
7
|
var toColorValue = require('tailwindcss/src/util/toColorValue');
|
|
8
8
|
var color = require('tailwindcss/src/util/color');
|
|
9
|
-
var lodash = require('lodash');
|
|
10
9
|
|
|
11
10
|
function withAlphaVariable ({ color: color$1, property, variable }) {
|
|
12
11
|
const properties = [].concat(property);
|
|
@@ -49,11 +48,13 @@ const defaultConfig = {
|
|
|
49
48
|
],
|
|
50
49
|
fontFamily: ['primary', 'secondary'],
|
|
51
50
|
fontWeight: ['light', 'normal', 'medium', 'semibold', 'bold', 'extrabold'],
|
|
51
|
+
ease: ['linear', 'in', 'out', 'in-out'],
|
|
52
52
|
zIndex: [10, 20, 30, 40, 50, 60],
|
|
53
53
|
fontSize: ['xs', 'sm', 'base', 'md', 'lg', 'xl', '2xl', '3xl', '3xl', '4xl', '5xl', '6xl', '7xl', '7xl', '8xl', '9xl'],
|
|
54
54
|
spacing: ['xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl', 'section'],
|
|
55
55
|
borderRadius: ['xs', 'sm', 'base', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl', 'full'],
|
|
56
56
|
animations: ['fade-in', 'fade-out', 'fade-in-down', 'fade-out-up', 'ripple', 'spin', 'move-indeterminate'],
|
|
57
|
+
mask: ['check', 'radio', 'angle-up', 'angle-down'],
|
|
57
58
|
screens: {
|
|
58
59
|
xs: '22.5em',
|
|
59
60
|
sm: '26em',
|
|
@@ -67,7 +68,7 @@ const defaultConfig = {
|
|
|
67
68
|
'2xxl': '158em'
|
|
68
69
|
},
|
|
69
70
|
settings: {
|
|
70
|
-
rgb:
|
|
71
|
+
rgb: false,
|
|
71
72
|
colorMix: true
|
|
72
73
|
}
|
|
73
74
|
};
|
|
@@ -102,6 +103,18 @@ const tailwindVariablesFont = (type, variables = [], values = {}) => {
|
|
|
102
103
|
return values
|
|
103
104
|
};
|
|
104
105
|
|
|
106
|
+
const tailwindPropertyUtilities = (type, variables = []) => {
|
|
107
|
+
const result = {};
|
|
108
|
+
|
|
109
|
+
variables.forEach(name => {
|
|
110
|
+
result[`.${type}-${name}`] = {
|
|
111
|
+
[type]: `var(--${type}-${name})`
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
return result
|
|
116
|
+
};
|
|
117
|
+
|
|
105
118
|
const tailwindAnimations = (values) => {
|
|
106
119
|
const result = {};
|
|
107
120
|
|
|
@@ -114,8 +127,23 @@ const tailwindAnimations = (values) => {
|
|
|
114
127
|
return result
|
|
115
128
|
};
|
|
116
129
|
|
|
130
|
+
const tailwindMask = (values) => {
|
|
131
|
+
const result = {};
|
|
132
|
+
|
|
133
|
+
values.forEach(value => {
|
|
134
|
+
result[`.mask-${value}`] = {
|
|
135
|
+
mask: value
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
return result
|
|
140
|
+
};
|
|
141
|
+
|
|
117
142
|
const createPlugin = (userConfig = {}) => {
|
|
118
|
-
userConfig =
|
|
143
|
+
userConfig = {
|
|
144
|
+
...defaultConfig,
|
|
145
|
+
userConfig
|
|
146
|
+
};
|
|
119
147
|
|
|
120
148
|
return plugin(({ addUtilities, matchUtilities, theme, variants, e, corePlugins }) => {
|
|
121
149
|
matchUtilities(
|
|
@@ -184,15 +212,13 @@ const createPlugin = (userConfig = {}) => {
|
|
|
184
212
|
}
|
|
185
213
|
}
|
|
186
214
|
|
|
187
|
-
const color =
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
})
|
|
195
|
-
};
|
|
215
|
+
const color = {
|
|
216
|
+
...withAlphaVariable({
|
|
217
|
+
color: value,
|
|
218
|
+
property: 'color',
|
|
219
|
+
variable: '--tw-text-opacity'
|
|
220
|
+
})
|
|
221
|
+
};
|
|
196
222
|
|
|
197
223
|
if (!corePlugins('textOpacity')) {
|
|
198
224
|
return {
|
|
@@ -216,28 +242,40 @@ const createPlugin = (userConfig = {}) => {
|
|
|
216
242
|
{ values: flattenColorPalette(theme('textColor')), type: ['color', 'any'] }
|
|
217
243
|
);
|
|
218
244
|
addUtilities(tailwindAnimations(userConfig.animations));
|
|
245
|
+
addUtilities(tailwindPropertyUtilities('mask', userConfig.mask));
|
|
219
246
|
addUtilities([
|
|
220
247
|
Object.entries(theme('spacing')).map(([key, value]) => {
|
|
221
248
|
return {
|
|
222
|
-
[`.${e(`
|
|
223
|
-
|
|
224
|
-
|
|
249
|
+
[`.${e(`divide-gap-x-${key}`)}`]: {
|
|
250
|
+
'& > :where(*:not(:first-child))': {
|
|
251
|
+
paddingLeft: value,
|
|
252
|
+
marginLeft: value
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
[`.${e(`divide-gap-y-${key}`)}`]: {
|
|
256
|
+
'& > :where(*:not(:first-child))': {
|
|
257
|
+
paddingTop: value,
|
|
258
|
+
marginTop: value
|
|
259
|
+
}
|
|
225
260
|
}
|
|
226
261
|
}
|
|
227
262
|
})
|
|
228
|
-
]
|
|
263
|
+
]);
|
|
229
264
|
}, {
|
|
230
265
|
corePlugins: {
|
|
231
266
|
preflight: false,
|
|
232
|
-
container: false,
|
|
233
267
|
textColor: false,
|
|
234
268
|
accentColor: false
|
|
235
269
|
},
|
|
236
270
|
theme: {
|
|
237
271
|
extend: {
|
|
272
|
+
transitionProperty: {
|
|
273
|
+
DEFAULT: 'var(--transition)'
|
|
274
|
+
},
|
|
238
275
|
transitionDuration: {
|
|
239
|
-
DEFAULT: 'var(--
|
|
276
|
+
DEFAULT: 'var(--duration)'
|
|
240
277
|
},
|
|
278
|
+
transitionTimingFunction: tailwindVariables('ease', userConfig.ease),
|
|
241
279
|
colors: tailwindColors(userConfig.colors),
|
|
242
280
|
fontSize: tailwindVariablesFont('text', userConfig.fontSize),
|
|
243
281
|
fontFamily: tailwindVariables('font', userConfig.fontFamily),
|
|
@@ -261,5 +299,7 @@ exports.default = createPlugin;
|
|
|
261
299
|
exports.defaultConfig = defaultConfig;
|
|
262
300
|
exports.tailwindAnimations = tailwindAnimations;
|
|
263
301
|
exports.tailwindColors = tailwindColors;
|
|
302
|
+
exports.tailwindMask = tailwindMask;
|
|
303
|
+
exports.tailwindPropertyUtilities = tailwindPropertyUtilities;
|
|
264
304
|
exports.tailwindVariables = tailwindVariables;
|
|
265
305
|
exports.tailwindVariablesFont = tailwindVariablesFont;
|
package/utils/tailwind.js
CHANGED
|
@@ -208,15 +208,13 @@ export const createPlugin = (userConfig = {}) => {
|
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
const color =
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
})
|
|
219
|
-
}
|
|
211
|
+
const color = {
|
|
212
|
+
...withAlphaVariable({
|
|
213
|
+
color: value,
|
|
214
|
+
property: 'color',
|
|
215
|
+
variable: '--tw-text-opacity'
|
|
216
|
+
})
|
|
217
|
+
}
|
|
220
218
|
|
|
221
219
|
if (!corePlugins('textOpacity')) {
|
|
222
220
|
return {
|