@unocss/preset-mini 0.45.29 → 0.46.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.
Files changed (35) hide show
  1. package/dist/{colors-67ae184f.d.ts → colors-4d254848.d.ts} +1 -1
  2. package/dist/colors.d.ts +3 -2
  3. package/dist/{default-016bd463.d.ts → default-9096842f.d.ts} +1 -1
  4. package/dist/index.cjs +8 -7
  5. package/dist/index.d.ts +5 -5
  6. package/dist/index.mjs +10 -9
  7. package/dist/rules.cjs +3 -3
  8. package/dist/rules.d.ts +1 -1
  9. package/dist/rules.mjs +3 -3
  10. package/dist/shared/{preset-mini.7346cef1.cjs → preset-mini.0109bbf2.cjs} +64 -17
  11. package/dist/shared/{preset-mini.dadc4e80.mjs → preset-mini.13105b6e.mjs} +2 -2
  12. package/dist/shared/preset-mini.154e3363.mjs +67 -0
  13. package/dist/shared/{preset-mini.3602602e.mjs → preset-mini.739fdcc7.mjs} +2 -3
  14. package/dist/shared/{preset-mini.eeab2052.cjs → preset-mini.7c4b1c47.cjs} +2 -2
  15. package/dist/shared/{preset-mini.b300afab.cjs → preset-mini.7f221566.cjs} +2 -3
  16. package/dist/shared/preset-mini.968d02ba.cjs +72 -0
  17. package/dist/shared/{preset-mini.42e5e280.mjs → preset-mini.9c5f881e.mjs} +65 -19
  18. package/dist/shared/{preset-mini.d7aeeb41.mjs → preset-mini.9e26490c.mjs} +180 -102
  19. package/dist/shared/{preset-mini.85263b33.mjs → preset-mini.ae98d318.mjs} +2 -2
  20. package/dist/shared/{preset-mini.5d1fe287.cjs → preset-mini.f5f22d9a.cjs} +2 -2
  21. package/dist/shared/{preset-mini.eaaf9ac5.cjs → preset-mini.fc97229a.cjs} +179 -101
  22. package/dist/theme.cjs +3 -3
  23. package/dist/theme.d.ts +5 -4
  24. package/dist/theme.mjs +3 -3
  25. package/dist/{types-c22910b5.d.ts → types-3dbe7f66.d.ts} +3 -0
  26. package/dist/{utilities-d1833377.d.ts → utilities-8393c8ff.d.ts} +5 -4
  27. package/dist/utils.cjs +5 -2
  28. package/dist/utils.d.ts +5 -3
  29. package/dist/utils.mjs +2 -2
  30. package/dist/variants.cjs +3 -3
  31. package/dist/variants.d.ts +4 -4
  32. package/dist/variants.mjs +3 -3
  33. package/package.json +2 -2
  34. package/dist/shared/preset-mini.6d3bd985.cjs +0 -45
  35. package/dist/shared/preset-mini.f73f9ed7.mjs +0 -42
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const colors = require('./preset-mini.7346cef1.cjs');
3
+ const colors = require('./preset-mini.0109bbf2.cjs');
4
4
  const core = require('@unocss/core');
5
- const variants$1 = require('./preset-mini.6d3bd985.cjs');
5
+ const variants$1 = require('./preset-mini.968d02ba.cjs');
6
6
 
7
7
  const regexCache = {};
8
8
  const calcMaxWidthBySize = (size) => {
@@ -64,48 +64,59 @@ const variantBreakpoints = {
64
64
  autocomplete: "(at-|lt-|)$breakpoints:"
65
65
  };
66
66
 
67
- const scopeMatcher = (strict, name, template) => {
68
- const re = strict ? new RegExp(`^${name}(?:-\\[(.+?)\\])[:-]`) : new RegExp(`^${name}(?:-\\[(.+?)\\])?[:-]`);
69
- return {
70
- name: `combinator:${name}`,
71
- match: (matcher) => {
72
- const match = matcher.match(re);
73
- if (match) {
74
- return {
75
- matcher: matcher.slice(match[0].length),
76
- selector: (s) => template.replace("&&-s", s).replace("&&-c", match[1] ?? "*")
77
- };
67
+ const scopeMatcher = (name, combinator) => ({
68
+ name: `combinator:${name}`,
69
+ match(matcher) {
70
+ if (!matcher.startsWith(name))
71
+ return;
72
+ let body = variants$1.variantGetBracket(name, matcher, [":", "-"]);
73
+ if (!body) {
74
+ for (const separator of [":", "-"]) {
75
+ if (matcher.startsWith(`${name}${separator}`)) {
76
+ body = ["", matcher.slice(name.length + separator.length)];
77
+ break;
78
+ }
78
79
  }
79
- },
80
- multiPass: true
81
- };
82
- };
80
+ if (!body)
81
+ return;
82
+ }
83
+ let bracketValue = colors.handler.bracket(body[0]) ?? "";
84
+ if (bracketValue === "")
85
+ bracketValue = "*";
86
+ return {
87
+ matcher: body[1],
88
+ selector: (s) => `${s}${combinator}${bracketValue}`
89
+ };
90
+ },
91
+ multiPass: true
92
+ });
83
93
  const variantCombinators = [
84
- scopeMatcher(false, "all", "&&-s &&-c"),
85
- scopeMatcher(false, "children", "&&-s>&&-c"),
86
- scopeMatcher(false, "next", "&&-s+&&-c"),
87
- scopeMatcher(false, "sibling", "&&-s+&&-c"),
88
- scopeMatcher(false, "siblings", "&&-s~&&-c"),
89
- scopeMatcher(true, "group", "&&-c &&-s"),
90
- scopeMatcher(true, "parent", "&&-c>&&-s"),
91
- scopeMatcher(true, "previous", "&&-c+&&-s"),
92
- scopeMatcher(true, "peer", "&&-c~&&-s")
94
+ scopeMatcher("all", " "),
95
+ scopeMatcher("children", ">"),
96
+ scopeMatcher("next", "+"),
97
+ scopeMatcher("sibling", "+"),
98
+ scopeMatcher("siblings", "~")
93
99
  ];
94
100
 
95
101
  const variantPrint = variants$1.variantParentMatcher("print", "@media print");
96
102
  const variantCustomMedia = {
97
103
  name: "media",
98
104
  match(matcher, { theme }) {
99
- const match = matcher.match(/^media-([_\d\w]+)[:-]/);
100
- if (match) {
101
- const media = theme.media?.[match[1]] ?? `(--${match[1]})`;
102
- return {
103
- matcher: matcher.slice(match[0].length),
104
- handle: (input, next) => next({
105
- ...input,
106
- parent: `${input.parent ? `${input.parent} $$ ` : ""}@media ${media}`
107
- })
108
- };
105
+ const variant = variants$1.variantGetParameter("media", matcher, [":", "-"]);
106
+ if (variant) {
107
+ const [match, rest] = variant;
108
+ let media = colors.handler.bracket(match) ?? "";
109
+ if (media === "")
110
+ media = theme.media?.[match] ?? "";
111
+ if (media) {
112
+ return {
113
+ matcher: rest,
114
+ handle: (input, next) => next({
115
+ ...input,
116
+ parent: `${input.parent ? `${input.parent} $$ ` : ""}@media ${media}`
117
+ })
118
+ };
119
+ }
109
120
  }
110
121
  },
111
122
  multiPass: true
@@ -114,17 +125,12 @@ const variantCustomMedia = {
114
125
  const variantSupports = {
115
126
  name: "supports",
116
127
  match(matcher, { theme }) {
117
- if (matcher.startsWith("supports-")) {
118
- const matcherValue = matcher.substring(9);
119
- const [match, rest] = colors.getComponent(matcherValue, "[", "]", ":") ?? [];
120
- if (!(match && rest && rest !== ""))
121
- return;
128
+ const variant = variants$1.variantGetParameter("supports", matcher, [":", "-"]);
129
+ if (variant) {
130
+ const [match, rest] = variant;
122
131
  let supports = colors.handler.bracket(match) ?? "";
123
- if (supports === "") {
124
- const themeValue = theme.supports?.[match];
125
- if (themeValue)
126
- supports = themeValue;
127
- }
132
+ if (supports === "")
133
+ supports = theme.supports?.[match] ?? "";
128
134
  if (supports) {
129
135
  return {
130
136
  matcher: rest,
@@ -161,51 +167,67 @@ const variantLanguageDirections = [
161
167
  const variantSelector = {
162
168
  name: "selector",
163
169
  match(matcher) {
164
- const match = matcher.match(/^selector-\[(.+?)\][:-]/);
165
- if (match) {
166
- return {
167
- matcher: matcher.slice(match[0].length),
168
- selector: () => match[1]
169
- };
170
+ const variant = variants$1.variantGetBracket("selector", matcher, [":", "-"]);
171
+ if (variant) {
172
+ const [match, rest] = variant;
173
+ const selector = colors.handler.bracket(match);
174
+ if (selector) {
175
+ return {
176
+ matcher: rest,
177
+ selector: () => selector
178
+ };
179
+ }
170
180
  }
171
181
  }
172
182
  };
173
183
  const variantCssLayer = {
174
184
  name: "layer",
175
185
  match(matcher) {
176
- const match = matcher.match(/^layer-([_\d\w]+)[:-]/);
177
- if (match) {
178
- return {
179
- matcher: matcher.slice(match[0].length),
180
- handle: (input, next) => next({
181
- ...input,
182
- parent: `${input.parent ? `${input.parent} $$ ` : ""}@layer ${match[1]}`
183
- })
184
- };
186
+ const variant = variants$1.variantGetParameter("layer", matcher, [":", "-"]);
187
+ if (variant) {
188
+ const [match, rest] = variant;
189
+ const layer = colors.handler.bracket(match) ?? match;
190
+ if (layer) {
191
+ return {
192
+ matcher: rest,
193
+ handle: (input, next) => next({
194
+ ...input,
195
+ parent: `${input.parent ? `${input.parent} $$ ` : ""}@layer ${layer}`
196
+ })
197
+ };
198
+ }
185
199
  }
186
200
  }
187
201
  };
188
202
  const variantInternalLayer = {
189
203
  name: "uno-layer",
190
204
  match(matcher) {
191
- const match = matcher.match(/^uno-layer-([_\d\w]+)[:-]/);
192
- if (match) {
193
- return {
194
- matcher: matcher.slice(match[0].length),
195
- layer: match[1]
196
- };
205
+ const variant = variants$1.variantGetParameter("uno-layer", matcher, [":", "-"]);
206
+ if (variant) {
207
+ const [match, rest] = variant;
208
+ const layer = colors.handler.bracket(match) ?? match;
209
+ if (layer) {
210
+ return {
211
+ matcher: rest,
212
+ layer
213
+ };
214
+ }
197
215
  }
198
216
  }
199
217
  };
200
218
  const variantScope = {
201
219
  name: "scope",
202
220
  match(matcher) {
203
- const match = matcher.match(/^scope-([_\d\w]+)[:-]/);
204
- if (match) {
205
- return {
206
- matcher: matcher.slice(match[0].length),
207
- selector: (s) => `.${match[1]} $$ ${s}`
208
- };
221
+ const variant = variants$1.variantGetBracket("scope", matcher, [":", "-"]);
222
+ if (variant) {
223
+ const [match, rest] = variant;
224
+ const scope = colors.handler.bracket(match);
225
+ if (scope) {
226
+ return {
227
+ matcher: rest,
228
+ selector: (s) => `${scope} $$ ${s}`
229
+ };
230
+ }
209
231
  }
210
232
  }
211
233
  };
@@ -214,16 +236,26 @@ const variantVariables = {
214
236
  match(matcher) {
215
237
  if (!matcher.startsWith("["))
216
238
  return;
217
- const [match, rest] = colors.getComponent(matcher, "[", "]", ":") ?? [];
218
- if (!(match && rest && rest !== ""))
239
+ const [match, rest] = colors.getBracket(matcher, "[", "]") ?? [];
240
+ if (!(match && rest))
241
+ return;
242
+ let newMatcher;
243
+ for (const separator of [":", "-"]) {
244
+ if (rest.startsWith(separator)) {
245
+ newMatcher = rest.slice(separator.length);
246
+ break;
247
+ }
248
+ }
249
+ if (newMatcher == null)
219
250
  return;
220
251
  const variant = colors.handler.bracket(match) ?? "";
221
- if (!(variant.startsWith("@") || variant.includes("&")))
252
+ const useParent = variant.startsWith("@");
253
+ if (!(useParent || variant.includes("&")))
222
254
  return;
223
255
  return {
224
- matcher: rest,
256
+ matcher: newMatcher,
225
257
  handle(input, next) {
226
- const updates = variant.startsWith("@") ? {
258
+ const updates = useParent ? {
227
259
  parent: `${input.parent ? `${input.parent} $$ ` : ""}${variant}`
228
260
  } : {
229
261
  selector: variant.replace(/&/g, input.selector)
@@ -242,6 +274,14 @@ const numberRE = /[0-9.]+(?:[a-z]+|%)?/;
242
274
  const ignoreProps = [
243
275
  /opacity|color|flex/
244
276
  ];
277
+ const negateFunctions = (value) => {
278
+ const match = value.match(/^(calc|clamp|max|min)\s*(\(.*)/);
279
+ if (match) {
280
+ const [fnBody, rest] = colors.getComponent(match[2], "(", ")", " ") ?? [];
281
+ if (fnBody)
282
+ return `calc(${match[1]}${fnBody} * -1)${rest ? ` ${rest}` : ""}`;
283
+ }
284
+ };
245
285
  const variantNegative = {
246
286
  name: "negative",
247
287
  match(matcher) {
@@ -259,7 +299,11 @@ const variantNegative = {
259
299
  return;
260
300
  if (ignoreProps.some((i) => v[0].match(i)))
261
301
  return;
262
- if (numberRE.test(value)) {
302
+ const negated = negateFunctions(value);
303
+ if (negated) {
304
+ v[1] = negated;
305
+ changed = true;
306
+ } else if (numberRE.test(value)) {
263
307
  v[1] = value.replace(numberRE, (i) => `-${i}`);
264
308
  changed = true;
265
309
  }
@@ -360,26 +404,60 @@ const sortValue = (pseudo) => {
360
404
  return 1;
361
405
  };
362
406
  const taggedPseudoClassMatcher = (tag, parent, combinator) => {
363
- const rawRe = new RegExp(`^(${core.escapeRegExp(parent)}:)(\\S+)${core.escapeRegExp(combinator)}\\1`);
364
- const pseudoRE = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))[:-]`);
365
- const pseudoColonRE = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesColonStr}))[:]`);
407
+ const rawRE = new RegExp(`^(${core.escapeRegExp(parent)}:)(\\S+)${core.escapeRegExp(combinator)}\\1`);
408
+ const pseudoRE = new RegExp(`^${tag}-(?:(?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))(?:(/\\w+))?[:-]`);
409
+ const pseudoColonRE = new RegExp(`^${tag}-(?:(?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesColonStr}))(?:(/\\w+))?[:]`);
410
+ const matchBracket = (input) => {
411
+ const body = variants$1.variantGetBracket(tag, input, []);
412
+ if (!body)
413
+ return;
414
+ const [match, rest] = body;
415
+ const bracketValue = colors.handler.bracket(match);
416
+ if (bracketValue == null)
417
+ return;
418
+ const label = rest.split(/[:-]/, 1)?.[0] ?? "";
419
+ const prefix = `${parent}${core.escapeSelector(label)}`;
420
+ return [
421
+ label,
422
+ input.slice(input.length - (rest.length - label.length - 1)),
423
+ bracketValue.includes("&") ? bracketValue.replace(/&/g, prefix) : `${prefix}${bracketValue}`
424
+ ];
425
+ };
426
+ const matchPseudo = (input) => {
427
+ const match = input.match(pseudoRE) || input.match(pseudoColonRE);
428
+ if (!match)
429
+ return;
430
+ const [original, fn, pseudoKey] = match;
431
+ const label = match[3] ?? "";
432
+ let pseudo = PseudoClasses[pseudoKey] || PseudoClassesColon[pseudoKey] || `:${pseudoKey}`;
433
+ if (fn)
434
+ pseudo = `:${fn}(${pseudo})`;
435
+ return [
436
+ label,
437
+ input.slice(original.length),
438
+ `${parent}${core.escapeSelector(label)}${pseudo}`,
439
+ sortValue(pseudoKey)
440
+ ];
441
+ };
366
442
  return {
367
443
  name: `pseudo:${tag}`,
368
444
  match(input) {
369
- const match = input.match(pseudoRE) || input.match(pseudoColonRE);
370
- if (match) {
371
- let pseudo = PseudoClasses[match[3]] || PseudoClassesColon[match[3]] || `:${match[3]}`;
372
- if (match[2])
373
- pseudo = `:${match[2]}(${pseudo})`;
374
- return {
375
- matcher: input.slice(match[0].length),
376
- handle: (input2, next) => next({
377
- ...input2,
378
- prefix: `${parent}${pseudo}${combinator}${input2.prefix}`.replace(rawRe, "$1$2:"),
379
- sort: sortValue(match[3])
380
- })
381
- };
382
- }
445
+ if (!input.startsWith(tag))
446
+ return;
447
+ const result = matchBracket(input) || matchPseudo(input);
448
+ if (!result)
449
+ return;
450
+ const [label, matcher, prefix, sort] = result;
451
+ if (label !== "")
452
+ core.warnOnce("The labeled pseudo is experimental and may be changed in breaking ways at any time.");
453
+ return {
454
+ matcher,
455
+ handle: (input2, next) => next({
456
+ ...input2,
457
+ prefix: `${prefix}${combinator}${input2.prefix}`.replace(rawRE, "$1$2:")
458
+ }),
459
+ sort
460
+ };
383
461
  },
384
462
  multiPass: true
385
463
  };
@@ -390,7 +468,7 @@ const PseudoClassesAndElementsRE = new RegExp(`^(${PseudoClassesAndElementsStr})
390
468
  const PseudoClassesAndElementsColonRE = new RegExp(`^(${PseudoClassesAndElementsColonStr})[:]`);
391
469
  const variantPseudoClassesAndElements = {
392
470
  name: "pseudo",
393
- match: (input) => {
471
+ match(input) {
394
472
  const match = input.match(PseudoClassesAndElementsRE) || input.match(PseudoClassesAndElementsColonRE);
395
473
  if (match) {
396
474
  const pseudo = PseudoClasses[match[1]] || PseudoClassesColon[match[1]] || `:${match[1]}`;
@@ -417,7 +495,7 @@ const variantPseudoClassesAndElements = {
417
495
  const PseudoClassFunctionsRE = new RegExp(`^(${PseudoClassFunctionsStr})-(${PseudoClassesStr})[:-]`);
418
496
  const PseudoClassColonFunctionsRE = new RegExp(`^(${PseudoClassFunctionsStr})-(${PseudoClassesColonStr})[:]`);
419
497
  const variantPseudoClassFunctions = {
420
- match: (input) => {
498
+ match(input) {
421
499
  const match = input.match(PseudoClassFunctionsRE) || input.match(PseudoClassColonFunctionsRE);
422
500
  if (match) {
423
501
  const fn = match[1];
@@ -442,7 +520,7 @@ const variantTaggedPseudoClasses = (options = {}) => {
442
520
  };
443
521
  const PartClassesRE = /(part-\[(.+)]:)(.+)/;
444
522
  const partClasses = {
445
- match: (input) => {
523
+ match(input) {
446
524
  const match = input.match(PartClassesRE);
447
525
  if (match) {
448
526
  const part = `part(${match[2]})`;
@@ -456,7 +534,6 @@ const partClasses = {
456
534
  };
457
535
 
458
536
  const variants = (options) => [
459
- variantVariables,
460
537
  variantCssLayer,
461
538
  variantSelector,
462
539
  variantInternalLayer,
@@ -473,7 +550,8 @@ const variants = (options) => [
473
550
  partClasses,
474
551
  ...variantColorsMediaOrClass(options),
475
552
  ...variantLanguageDirections,
476
- variantScope
553
+ variantScope,
554
+ variantVariables
477
555
  ];
478
556
 
479
557
  exports.calcMaxWidthBySize = calcMaxWidthBySize;
package/dist/theme.cjs CHANGED
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const colors = require('./shared/preset-mini.30606736.cjs');
6
- const _default = require('./shared/preset-mini.eeab2052.cjs');
7
- require('./shared/preset-mini.b300afab.cjs');
8
- require('./shared/preset-mini.7346cef1.cjs');
6
+ const _default = require('./shared/preset-mini.7c4b1c47.cjs');
7
+ require('./shared/preset-mini.7f221566.cjs');
8
+ require('./shared/preset-mini.0109bbf2.cjs');
9
9
  require('@unocss/core');
10
10
 
11
11
 
package/dist/theme.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- export { c as colors } from './colors-67ae184f.js';
2
- export { t as theme } from './default-016bd463.js';
3
- import { T as Theme } from './types-c22910b5.js';
4
- export { T as Theme, a as ThemeAnimation } from './types-c22910b5.js';
1
+ export { c as colors } from './colors-4d254848.js';
2
+ export { t as theme } from './default-9096842f.js';
3
+ import { T as Theme } from './types-3dbe7f66.js';
4
+ export { T as Theme, a as ThemeAnimation } from './types-3dbe7f66.js';
5
+ import '@unocss/core';
5
6
 
6
7
  declare const blur: {
7
8
  DEFAULT: string;
package/dist/theme.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  export { c as colors } from './shared/preset-mini.65ac75be.mjs';
2
- export { p as baseSize, b as blur, m as borderRadius, n as boxShadow, i as breakpoints, d as dropShadow, k as duration, o as easing, f as fontFamily, a as fontSize, x as height, h as letterSpacing, l as lineHeight, j as lineWidth, y as maxHeight, u as maxWidth, z as preflightBase, r as ringWidth, s as spacing, c as textIndent, g as textShadow, e as textStrokeWidth, t as theme, v as verticalBreakpoints, q as width, w as wordSpacing } from './shared/preset-mini.85263b33.mjs';
3
- import './shared/preset-mini.3602602e.mjs';
4
- import './shared/preset-mini.42e5e280.mjs';
2
+ export { p as baseSize, b as blur, m as borderRadius, n as boxShadow, i as breakpoints, d as dropShadow, k as duration, o as easing, f as fontFamily, a as fontSize, x as height, h as letterSpacing, l as lineHeight, j as lineWidth, y as maxHeight, u as maxWidth, z as preflightBase, r as ringWidth, s as spacing, c as textIndent, g as textShadow, e as textStrokeWidth, t as theme, v as verticalBreakpoints, q as width, w as wordSpacing } from './shared/preset-mini.ae98d318.mjs';
3
+ import './shared/preset-mini.739fdcc7.mjs';
4
+ import './shared/preset-mini.9c5f881e.mjs';
5
5
  import '@unocss/core';
@@ -1,3 +1,5 @@
1
+ import { Arrayable } from '@unocss/core';
2
+
1
3
  interface ThemeAnimation {
2
4
  keyframes?: Record<string, string>;
3
5
  durations?: Record<string, string>;
@@ -51,6 +53,7 @@ interface Theme {
51
53
  center?: boolean;
52
54
  };
53
55
  /** Used to generate CSS variables placeholder in preflight */
56
+ preflightRoot?: Arrayable<string>;
54
57
  preflightBase?: Record<string, string | number>;
55
58
  }
56
59
 
@@ -1,5 +1,5 @@
1
1
  import { DynamicMatcher, ParsedColorValue, CSSObject, VariantContext, Rule } from '@unocss/core';
2
- import { T as Theme } from './types-c22910b5.js';
2
+ import { T as Theme } from './types-3dbe7f66.js';
3
3
 
4
4
  declare const CONTROL_MINI_NO_NEGATIVE = "$$mini-no-negative";
5
5
  /**
@@ -56,7 +56,8 @@ declare function hasParseableColor(color: string | undefined, theme: Theme): boo
56
56
  declare function resolveBreakpoints({ theme, generator }: Readonly<VariantContext<Theme>>): Record<string, string> | undefined;
57
57
  declare function resolveVerticalBreakpoints({ theme, generator }: Readonly<VariantContext<Theme>>): Record<string, string> | undefined;
58
58
  declare function makeGlobalStaticRules(prefix: string, property?: string): Rule<{}>[];
59
- declare function getComponent(str: string, open: string, close: string, separator: string): string[] | undefined;
60
- declare function getComponents(str: string, separator: string, limit?: number): string[] | undefined;
59
+ declare function getBracket(str: string, open: string, close: string): string[] | undefined;
60
+ declare function getComponent(str: string, open: string, close: string, separators: string | string[]): string[] | undefined;
61
+ declare function getComponents(str: string, separators: string | string[], limit?: number): string[] | undefined;
61
62
 
62
- export { CONTROL_MINI_NO_NEGATIVE as C, colorableShadows as a, resolveVerticalBreakpoints as b, colorResolver as c, directionSize as d, getComponents as e, getComponent as g, hasParseableColor as h, makeGlobalStaticRules as m, parseColor as p, resolveBreakpoints as r };
63
+ export { CONTROL_MINI_NO_NEGATIVE as C, colorableShadows as a, resolveVerticalBreakpoints as b, colorResolver as c, directionSize as d, getComponent as e, getComponents as f, getBracket as g, hasParseableColor as h, makeGlobalStaticRules as m, parseColor as p, resolveBreakpoints as r };
package/dist/utils.cjs CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const colors = require('./shared/preset-mini.7346cef1.cjs');
6
- const variants = require('./shared/preset-mini.6d3bd985.cjs');
5
+ const colors = require('./shared/preset-mini.0109bbf2.cjs');
6
+ const variants = require('./shared/preset-mini.968d02ba.cjs');
7
7
  require('@unocss/core');
8
8
 
9
9
 
@@ -16,6 +16,7 @@ exports.colorableShadows = colors.colorableShadows;
16
16
  exports.cornerMap = colors.cornerMap;
17
17
  exports.directionMap = colors.directionMap;
18
18
  exports.directionSize = colors.directionSize;
19
+ exports.getBracket = colors.getBracket;
19
20
  exports.getComponent = colors.getComponent;
20
21
  exports.getComponents = colors.getComponents;
21
22
  exports.globalKeywords = colors.globalKeywords;
@@ -32,5 +33,7 @@ exports.resolveBreakpoints = colors.resolveBreakpoints;
32
33
  exports.resolveVerticalBreakpoints = colors.resolveVerticalBreakpoints;
33
34
  exports.valueHandlers = colors.valueHandlers;
34
35
  exports.xyzMap = colors.xyzMap;
36
+ exports.variantGetBracket = variants.variantGetBracket;
37
+ exports.variantGetParameter = variants.variantGetParameter;
35
38
  exports.variantMatcher = variants.variantMatcher;
36
39
  exports.variantParentMatcher = variants.variantParentMatcher;
package/dist/utils.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _unocss_core from '@unocss/core';
2
2
  import { RGBAColorValue, CSSColorValue, VariantHandlerContext, VariantObject } from '@unocss/core';
3
- export { C as CONTROL_MINI_NO_NEGATIVE, c as colorResolver, a as colorableShadows, d as directionSize, g as getComponent, e as getComponents, h as hasParseableColor, m as makeGlobalStaticRules, p as parseColor, r as resolveBreakpoints, b as resolveVerticalBreakpoints } from './utilities-d1833377.js';
4
- import './types-c22910b5.js';
3
+ export { C as CONTROL_MINI_NO_NEGATIVE, c as colorResolver, a as colorableShadows, d as directionSize, g as getBracket, e as getComponent, f as getComponents, h as hasParseableColor, m as makeGlobalStaticRules, p as parseColor, r as resolveBreakpoints, b as resolveVerticalBreakpoints } from './utilities-8393c8ff.js';
4
+ import './types-3dbe7f66.js';
5
5
 
6
6
  declare function hex2rgba(hex?: string): RGBAColorValue | undefined;
7
7
  declare function parseCssColor(str?: string): CSSColorValue | undefined;
@@ -77,5 +77,7 @@ declare const h: _unocss_core.ValueHandler<"number" | "global" | "auto" | "posit
77
77
 
78
78
  declare const variantMatcher: (name: string, handler: (input: VariantHandlerContext) => Record<string, any>) => VariantObject;
79
79
  declare const variantParentMatcher: (name: string, parent: string) => VariantObject;
80
+ declare const variantGetBracket: (name: string, matcher: string, separators: string[]) => string[] | undefined;
81
+ declare const variantGetParameter: (name: string, matcher: string, separators: string[]) => string[] | undefined;
80
82
 
81
- export { colorOpacityToString, colorToString, cornerMap, directionMap, globalKeywords, h, handler, hex2rgba, insetMap, parseCssColor, positionMap, handlers as valueHandlers, variantMatcher, variantParentMatcher, xyzMap };
83
+ export { colorOpacityToString, colorToString, cornerMap, directionMap, globalKeywords, h, handler, hex2rgba, insetMap, parseCssColor, positionMap, handlers as valueHandlers, variantGetBracket, variantGetParameter, variantMatcher, variantParentMatcher, xyzMap };
package/dist/utils.mjs CHANGED
@@ -1,3 +1,3 @@
1
- export { C as CONTROL_MINI_NO_NEGATIVE, f as colorOpacityToString, c as colorResolver, e as colorToString, i as colorableShadows, b as cornerMap, d as directionMap, o as directionSize, q as getComponent, w as getComponents, g as globalKeywords, u as h, h as handler, a as hasParseableColor, s as hex2rgba, j as insetMap, m as makeGlobalStaticRules, p as parseColor, t as parseCssColor, k as positionMap, l as resolveBreakpoints, r as resolveVerticalBreakpoints, v as valueHandlers, x as xyzMap } from './shared/preset-mini.42e5e280.mjs';
2
- export { a as variantMatcher, v as variantParentMatcher } from './shared/preset-mini.f73f9ed7.mjs';
1
+ export { C as CONTROL_MINI_NO_NEGATIVE, f as colorOpacityToString, c as colorResolver, e as colorToString, i as colorableShadows, b as cornerMap, d as directionMap, o as directionSize, q as getBracket, s as getComponent, y as getComponents, g as globalKeywords, v as h, h as handler, a as hasParseableColor, t as hex2rgba, j as insetMap, m as makeGlobalStaticRules, p as parseColor, u as parseCssColor, k as positionMap, l as resolveBreakpoints, r as resolveVerticalBreakpoints, w as valueHandlers, x as xyzMap } from './shared/preset-mini.9c5f881e.mjs';
2
+ export { v as variantGetBracket, b as variantGetParameter, c as variantMatcher, a as variantParentMatcher } from './shared/preset-mini.154e3363.mjs';
3
3
  import '@unocss/core';
package/dist/variants.cjs CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const _default = require('./shared/preset-mini.eaaf9ac5.cjs');
6
- require('./shared/preset-mini.7346cef1.cjs');
5
+ const _default = require('./shared/preset-mini.fc97229a.cjs');
6
+ require('./shared/preset-mini.0109bbf2.cjs');
7
7
  require('@unocss/core');
8
- require('./shared/preset-mini.6d3bd985.cjs');
8
+ require('./shared/preset-mini.968d02ba.cjs');
9
9
 
10
10
 
11
11
 
@@ -1,9 +1,9 @@
1
1
  import { Variant, VariantObject } from '@unocss/core';
2
- import { T as Theme } from './types-c22910b5.js';
2
+ import { T as Theme } from './types-3dbe7f66.js';
3
3
  import { PresetMiniOptions } from './index.js';
4
- import './colors-67ae184f.js';
5
- import './default-016bd463.js';
6
- import './utilities-d1833377.js';
4
+ import './colors-4d254848.js';
5
+ import './default-9096842f.js';
6
+ import './utilities-8393c8ff.js';
7
7
 
8
8
  declare const calcMaxWidthBySize: (size: string) => string;
9
9
  declare const variantBreakpoints: Variant<Theme>;
package/dist/variants.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { c as calcMaxWidthBySize, q as partClasses, a as variantBreakpoints, g as variantColorsMediaOrClass, b as variantCombinators, j as variantCssLayer, e as variantCustomMedia, r as variantImportant, k as variantInternalLayer, h as variantLanguageDirections, s as variantNegative, d as variantPrint, o as variantPseudoClassFunctions, n as variantPseudoClassesAndElements, l as variantScope, i as variantSelector, f as variantSupports, p as variantTaggedPseudoClasses, m as variantVariables, v as variants } from './shared/preset-mini.d7aeeb41.mjs';
2
- import './shared/preset-mini.42e5e280.mjs';
1
+ export { c as calcMaxWidthBySize, q as partClasses, a as variantBreakpoints, g as variantColorsMediaOrClass, b as variantCombinators, j as variantCssLayer, e as variantCustomMedia, r as variantImportant, k as variantInternalLayer, h as variantLanguageDirections, s as variantNegative, d as variantPrint, o as variantPseudoClassFunctions, n as variantPseudoClassesAndElements, l as variantScope, i as variantSelector, f as variantSupports, p as variantTaggedPseudoClasses, m as variantVariables, v as variants } from './shared/preset-mini.9e26490c.mjs';
2
+ import './shared/preset-mini.9c5f881e.mjs';
3
3
  import '@unocss/core';
4
- import './shared/preset-mini.f73f9ed7.mjs';
4
+ import './shared/preset-mini.154e3363.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-mini",
3
- "version": "0.45.29",
3
+ "version": "0.46.0",
4
4
  "description": "The minimal preset for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -61,7 +61,7 @@
61
61
  "*.css"
62
62
  ],
63
63
  "dependencies": {
64
- "@unocss/core": "0.45.29"
64
+ "@unocss/core": "0.46.0"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "unbuild",
@@ -1,45 +0,0 @@
1
- 'use strict';
2
-
3
- const core = require('@unocss/core');
4
-
5
- const variantMatcher = (name, handler) => {
6
- const re = new RegExp(`^${core.escapeRegExp(name)}[:-]`);
7
- return {
8
- name,
9
- match: (input) => {
10
- const match = input.match(re);
11
- if (match) {
12
- return {
13
- matcher: input.slice(match[0].length),
14
- handle: (input2, next) => next({
15
- ...input2,
16
- ...handler(input2)
17
- })
18
- };
19
- }
20
- },
21
- autocomplete: `${name}:`
22
- };
23
- };
24
- const variantParentMatcher = (name, parent) => {
25
- const re = new RegExp(`^${core.escapeRegExp(name)}[:-]`);
26
- return {
27
- name,
28
- match: (input) => {
29
- const match = input.match(re);
30
- if (match) {
31
- return {
32
- matcher: input.slice(match[0].length),
33
- handle: (input2, next) => next({
34
- ...input2,
35
- parent: `${input2.parent ? `${input2.parent} $$ ` : ""}${parent}`
36
- })
37
- };
38
- }
39
- },
40
- autocomplete: `${name}:`
41
- };
42
- };
43
-
44
- exports.variantMatcher = variantMatcher;
45
- exports.variantParentMatcher = variantParentMatcher;