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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "winduum",
3
- "version": "0.5.0-next.10",
3
+ "version": "0.5.0-next.11",
4
4
  "type": "module",
5
5
  "main": "utils/tailwind.cjs",
6
6
  "module": "utils/tailwind.js",
@@ -1,5 +1,5 @@
1
1
  :root.dark, :host.dark {
2
2
  --color-scheme: dark;
3
- --color-main: rgb(255 255 255);
4
- --color-body: rgb(25 26 27);
3
+ --color-main: var(--color-light);
4
+ --color-body: var(--color-dark);
5
5
  }
@@ -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: rgb(3 138 255);
7
+ --color-primary: #3b82f6; /* color.blue.500 */
8
8
  --color-primary-fg: var(--color-light);
9
- --color-main: rgb(17 19 2);
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: rgb(255 255 255);
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: rgb(255 255 255);
19
+ --color-light: #fff; /* color.white */
20
20
  --color-light-fg: var(--color-dark);
21
- --color-dark: rgb(17 19 21);
21
+ --color-dark: #171717; /* color.neutral.900 */
22
22
  --color-dark-fg: var(--color-light);
23
- --color-success: rgb(33 154 67);
24
- --color-error: rgb(254 50 75);
25
- --color-warning: rgb(254 179 53);
26
- --color-info: rgb(45 168 234);
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
  }
@@ -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, 0.875rem);
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);
@@ -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: 1;
5
- --ui-control-icon-count-e: 1;
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-l) {
8
- --ui-control-ps: calc(var(--ui-control-icon-count-s) * (var(--ui-control-icon-size) + var(--ui-control-icon-gap)) - var(--ui-control-icon-gap) + var(--ui-control-px));
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-r) {
12
- --ui-control-pe: calc(var(--ui-control-icon-count-e) * (var(--ui-control-icon-size) + var(--ui-control-icon-gap)) - var(--ui-control-icon-gap) + var(--ui-control-px));
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-l > *:nth-child(2)) {
15
+ &:has(.icon-s > *:nth-child(2)) {
16
16
  --ui-control-icon-count-s: 2;
17
17
  }
18
18
 
19
- &:has(.icon-r > *:nth-child(2)) {
19
+ &:has(.icon-e > *:nth-child(2)) {
20
20
  --ui-control-icon-count-e: 2;
21
21
  }
22
22
 
23
- & :where(.icon-l) {
23
+ & :where(.icon-s) {
24
24
  margin-inline-end: auto;
25
25
  }
26
26
 
27
- & :where(.icon-r) {
27
+ & :where(.icon-e) {
28
28
  margin-inline-start: auto;
29
29
  }
30
30
 
31
- & :where(.icon-l, .icon-r) {
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-l, .icon-r) {
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-r) {
6
+ &:has(.icon-e) {
7
7
  --ui-control-icon-count-e: 2;
8
8
  }
9
9
 
10
- & :where(.icon-r) {
10
+ & :where(.icon-e) {
11
11
  margin-inline-end: var(--ui-control-select-icon-size);
12
12
  }
13
13
 
@@ -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: true,
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 = lodash.merge(defaultConfig, 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 = matchValue
188
- ? { color: 'var(--color-current)' }
189
- : {
190
- ...withAlphaVariable({
191
- color: value,
192
- property: 'color',
193
- variable: '--tw-text-opacity'
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(`sq-${key}`)}`]: {
223
- width: value,
224
- height: value
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
- ], variants('sq'));
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(--transition-duration)'
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 = matchValue
212
- ? { color: 'var(--color-current)' }
213
- : {
214
- ...withAlphaVariable({
215
- color: value,
216
- property: 'color',
217
- variable: '--tw-text-opacity'
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 {