@unocss/preset-mini 0.55.1 → 0.55.3

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 (56) hide show
  1. package/dist/colors.cjs +360 -6
  2. package/dist/{colors-dabdd21f.d.ts → colors.d.cts} +3 -2
  3. package/dist/colors.d.mts +354 -0
  4. package/dist/colors.d.ts +353 -2
  5. package/dist/colors.mjs +361 -1
  6. package/dist/index.cjs +12 -12
  7. package/dist/index.d.cts +69 -0
  8. package/dist/index.d.mts +69 -0
  9. package/dist/index.d.ts +6 -6
  10. package/dist/index.mjs +9 -10
  11. package/dist/rules.cjs +928 -48
  12. package/dist/rules.d.cts +133 -0
  13. package/dist/rules.d.mts +133 -0
  14. package/dist/rules.d.ts +1 -1
  15. package/dist/rules.mjs +891 -4
  16. package/dist/shared/preset-mini.0d957b3b.d.mts +721 -0
  17. package/dist/shared/preset-mini.0fac4963.mjs +320 -0
  18. package/dist/shared/preset-mini.2f8c3259.d.mts +67 -0
  19. package/dist/{types-d991ba46.d.ts → shared/preset-mini.32abac2c.d.cts} +1 -1
  20. package/dist/shared/preset-mini.32abac2c.d.mts +71 -0
  21. package/dist/shared/preset-mini.32abac2c.d.ts +71 -0
  22. package/dist/{default-1f25a0ae.d.ts → shared/preset-mini.3a79e471.d.ts} +1 -1
  23. package/dist/shared/preset-mini.5bfee53b.cjs +344 -0
  24. package/dist/shared/preset-mini.7b9de562.d.cts +67 -0
  25. package/dist/shared/{preset-mini.a21c5071.cjs → preset-mini.b4ad509c.cjs} +12 -8
  26. package/dist/shared/{preset-mini.6c1c8016.mjs → preset-mini.f1fe435e.mjs} +13 -9
  27. package/dist/shared/preset-mini.f67366b3.d.cts +721 -0
  28. package/dist/{utilities-d496540e.d.ts → shared/preset-mini.fa67009f.d.ts} +1 -1
  29. package/dist/theme.cjs +308 -34
  30. package/dist/theme.d.cts +264 -0
  31. package/dist/theme.d.mts +264 -0
  32. package/dist/theme.d.ts +5 -5
  33. package/dist/theme.mjs +284 -4
  34. package/dist/utils.cjs +81 -10
  35. package/dist/utils.d.cts +65 -0
  36. package/dist/utils.d.mts +65 -0
  37. package/dist/utils.d.ts +13 -31
  38. package/dist/utils.mjs +81 -3
  39. package/dist/variants.cjs +737 -33
  40. package/dist/variants.d.cts +46 -0
  41. package/dist/variants.d.mts +46 -0
  42. package/dist/variants.d.ts +4 -4
  43. package/dist/variants.mjs +714 -4
  44. package/package.json +3 -3
  45. package/dist/shared/preset-mini.0131b915.mjs +0 -704
  46. package/dist/shared/preset-mini.1c66bf79.mjs +0 -361
  47. package/dist/shared/preset-mini.74f9d55e.mjs +0 -80
  48. package/dist/shared/preset-mini.811eb23d.mjs +0 -681
  49. package/dist/shared/preset-mini.8dd73081.mjs +0 -452
  50. package/dist/shared/preset-mini.9d93761b.cjs +0 -729
  51. package/dist/shared/preset-mini.b8d9397e.cjs +0 -471
  52. package/dist/shared/preset-mini.ce5169f2.cjs +0 -730
  53. package/dist/shared/preset-mini.d778b487.cjs +0 -85
  54. package/dist/shared/preset-mini.de3bd9f7.mjs +0 -284
  55. package/dist/shared/preset-mini.e078d7da.cjs +0 -313
  56. package/dist/shared/preset-mini.f3fc54d2.cjs +0 -363
@@ -0,0 +1,65 @@
1
+ import * as _unocss_core from '@unocss/core';
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 getBracket, e as getComponent, f as getComponents, h as hasParseableColor, m as makeGlobalStaticRules, p as parseColor, r as resolveBreakpoints, b as resolveVerticalBreakpoints, s as splitShorthand } from './shared/preset-mini.7b9de562.cjs';
4
+ import './shared/preset-mini.32abac2c.cjs';
5
+
6
+ declare function hex2rgba(hex?: string): RGBAColorValue | undefined;
7
+ declare function parseCssColor(str?: string): CSSColorValue | undefined;
8
+ declare function colorOpacityToString(color: CSSColorValue): string | number;
9
+ declare function colorToString(color: CSSColorValue | string, alphaOverride?: string | number): string;
10
+
11
+ declare const directionMap: Record<string, string[]>;
12
+ declare const insetMap: Record<string, string[]>;
13
+ declare const cornerMap: Record<string, string[]>;
14
+ declare const xyzMap: Record<string, string[]>;
15
+ declare const positionMap: Record<string, string>;
16
+ declare const globalKeywords: string[];
17
+
18
+ declare function numberWithUnit(str: string): string | undefined;
19
+ declare function auto(str: string): "auto" | undefined;
20
+ declare function rem(str: string): string | undefined;
21
+ declare function px(str: string): string | undefined;
22
+ declare function number(str: string): string | undefined;
23
+ declare function percent(str: string): string | undefined;
24
+ declare function fraction(str: string): string | undefined;
25
+ declare function bracket(str: string): string | undefined;
26
+ declare function bracketOfColor(str: string): string | undefined;
27
+ declare function bracketOfLength(str: string): string | undefined;
28
+ declare function bracketOfPosition(str: string): string | undefined;
29
+ declare function cssvar(str: string): string | undefined;
30
+ declare function time(str: string): string | undefined;
31
+ declare function degree(str: string): string | undefined;
32
+ declare function global(str: string): string | undefined;
33
+ declare function properties(str: string): string | undefined;
34
+ declare function position(str: string): string | undefined;
35
+
36
+ declare const handlers_auto: typeof auto;
37
+ declare const handlers_bracket: typeof bracket;
38
+ declare const handlers_bracketOfColor: typeof bracketOfColor;
39
+ declare const handlers_bracketOfLength: typeof bracketOfLength;
40
+ declare const handlers_bracketOfPosition: typeof bracketOfPosition;
41
+ declare const handlers_cssvar: typeof cssvar;
42
+ declare const handlers_degree: typeof degree;
43
+ declare const handlers_fraction: typeof fraction;
44
+ declare const handlers_global: typeof global;
45
+ declare const handlers_number: typeof number;
46
+ declare const handlers_numberWithUnit: typeof numberWithUnit;
47
+ declare const handlers_percent: typeof percent;
48
+ declare const handlers_position: typeof position;
49
+ declare const handlers_properties: typeof properties;
50
+ declare const handlers_px: typeof px;
51
+ declare const handlers_rem: typeof rem;
52
+ declare const handlers_time: typeof time;
53
+ declare namespace handlers {
54
+ export { handlers_auto as auto, handlers_bracket as bracket, handlers_bracketOfColor as bracketOfColor, handlers_bracketOfLength as bracketOfLength, handlers_bracketOfPosition as bracketOfPosition, handlers_cssvar as cssvar, handlers_degree as degree, handlers_fraction as fraction, handlers_global as global, handlers_number as number, handlers_numberWithUnit as numberWithUnit, handlers_percent as percent, handlers_position as position, handlers_properties as properties, handlers_px as px, handlers_rem as rem, handlers_time as time };
55
+ }
56
+
57
+ declare const handler: _unocss_core.ValueHandler<"number" | "auto" | "position" | "global" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "bracketOfPosition" | "cssvar" | "time" | "degree" | "properties">;
58
+ declare const h: _unocss_core.ValueHandler<"number" | "auto" | "position" | "global" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "bracketOfPosition" | "cssvar" | "time" | "degree" | "properties">;
59
+
60
+ declare function variantMatcher(name: string, handler: (input: VariantHandlerContext) => Record<string, any>): VariantObject;
61
+ declare function variantParentMatcher(name: string, parent: string): VariantObject;
62
+ declare function variantGetBracket(prefix: string, matcher: string, separators: string[]): string[] | undefined;
63
+ declare function variantGetParameter(prefix: string, matcher: string, separators: string[]): string[] | undefined;
64
+
65
+ export { colorOpacityToString, colorToString, cornerMap, directionMap, globalKeywords, h, handler, hex2rgba, insetMap, parseCssColor, positionMap, handlers as valueHandlers, variantGetBracket, variantGetParameter, variantMatcher, variantParentMatcher, xyzMap };
@@ -0,0 +1,65 @@
1
+ import * as _unocss_core from '@unocss/core';
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 getBracket, e as getComponent, f as getComponents, h as hasParseableColor, m as makeGlobalStaticRules, p as parseColor, r as resolveBreakpoints, b as resolveVerticalBreakpoints, s as splitShorthand } from './shared/preset-mini.2f8c3259.mjs';
4
+ import './shared/preset-mini.32abac2c.mjs';
5
+
6
+ declare function hex2rgba(hex?: string): RGBAColorValue | undefined;
7
+ declare function parseCssColor(str?: string): CSSColorValue | undefined;
8
+ declare function colorOpacityToString(color: CSSColorValue): string | number;
9
+ declare function colorToString(color: CSSColorValue | string, alphaOverride?: string | number): string;
10
+
11
+ declare const directionMap: Record<string, string[]>;
12
+ declare const insetMap: Record<string, string[]>;
13
+ declare const cornerMap: Record<string, string[]>;
14
+ declare const xyzMap: Record<string, string[]>;
15
+ declare const positionMap: Record<string, string>;
16
+ declare const globalKeywords: string[];
17
+
18
+ declare function numberWithUnit(str: string): string | undefined;
19
+ declare function auto(str: string): "auto" | undefined;
20
+ declare function rem(str: string): string | undefined;
21
+ declare function px(str: string): string | undefined;
22
+ declare function number(str: string): string | undefined;
23
+ declare function percent(str: string): string | undefined;
24
+ declare function fraction(str: string): string | undefined;
25
+ declare function bracket(str: string): string | undefined;
26
+ declare function bracketOfColor(str: string): string | undefined;
27
+ declare function bracketOfLength(str: string): string | undefined;
28
+ declare function bracketOfPosition(str: string): string | undefined;
29
+ declare function cssvar(str: string): string | undefined;
30
+ declare function time(str: string): string | undefined;
31
+ declare function degree(str: string): string | undefined;
32
+ declare function global(str: string): string | undefined;
33
+ declare function properties(str: string): string | undefined;
34
+ declare function position(str: string): string | undefined;
35
+
36
+ declare const handlers_auto: typeof auto;
37
+ declare const handlers_bracket: typeof bracket;
38
+ declare const handlers_bracketOfColor: typeof bracketOfColor;
39
+ declare const handlers_bracketOfLength: typeof bracketOfLength;
40
+ declare const handlers_bracketOfPosition: typeof bracketOfPosition;
41
+ declare const handlers_cssvar: typeof cssvar;
42
+ declare const handlers_degree: typeof degree;
43
+ declare const handlers_fraction: typeof fraction;
44
+ declare const handlers_global: typeof global;
45
+ declare const handlers_number: typeof number;
46
+ declare const handlers_numberWithUnit: typeof numberWithUnit;
47
+ declare const handlers_percent: typeof percent;
48
+ declare const handlers_position: typeof position;
49
+ declare const handlers_properties: typeof properties;
50
+ declare const handlers_px: typeof px;
51
+ declare const handlers_rem: typeof rem;
52
+ declare const handlers_time: typeof time;
53
+ declare namespace handlers {
54
+ export { handlers_auto as auto, handlers_bracket as bracket, handlers_bracketOfColor as bracketOfColor, handlers_bracketOfLength as bracketOfLength, handlers_bracketOfPosition as bracketOfPosition, handlers_cssvar as cssvar, handlers_degree as degree, handlers_fraction as fraction, handlers_global as global, handlers_number as number, handlers_numberWithUnit as numberWithUnit, handlers_percent as percent, handlers_position as position, handlers_properties as properties, handlers_px as px, handlers_rem as rem, handlers_time as time };
55
+ }
56
+
57
+ declare const handler: _unocss_core.ValueHandler<"number" | "auto" | "position" | "global" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "bracketOfPosition" | "cssvar" | "time" | "degree" | "properties">;
58
+ declare const h: _unocss_core.ValueHandler<"number" | "auto" | "position" | "global" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "bracketOfPosition" | "cssvar" | "time" | "degree" | "properties">;
59
+
60
+ declare function variantMatcher(name: string, handler: (input: VariantHandlerContext) => Record<string, any>): VariantObject;
61
+ declare function variantParentMatcher(name: string, parent: string): VariantObject;
62
+ declare function variantGetBracket(prefix: string, matcher: string, separators: string[]): string[] | undefined;
63
+ declare function variantGetParameter(prefix: string, matcher: string, separators: string[]): string[] | undefined;
64
+
65
+ export { colorOpacityToString, colorToString, cornerMap, directionMap, globalKeywords, h, handler, hex2rgba, insetMap, parseCssColor, positionMap, handlers as valueHandlers, variantGetBracket, variantGetParameter, variantMatcher, variantParentMatcher, xyzMap };
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 getBracket, e as getComponent, f as getComponents, h as hasParseableColor, m as makeGlobalStaticRules, p as parseColor, r as resolveBreakpoints, b as resolveVerticalBreakpoints, s as splitShorthand } from './utilities-d496540e.js';
4
- import './types-d991ba46.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, s as splitShorthand } from './shared/preset-mini.fa67009f.js';
4
+ import './shared/preset-mini.32abac2c.js';
5
5
 
6
6
  declare function hex2rgba(hex?: string): RGBAColorValue | undefined;
7
7
  declare function parseCssColor(str?: string): CSSColorValue | undefined;
@@ -33,47 +33,29 @@ declare function global(str: string): string | undefined;
33
33
  declare function properties(str: string): string | undefined;
34
34
  declare function position(str: string): string | undefined;
35
35
 
36
- declare const handlers_numberWithUnit: typeof numberWithUnit;
37
36
  declare const handlers_auto: typeof auto;
38
- declare const handlers_rem: typeof rem;
39
- declare const handlers_px: typeof px;
40
- declare const handlers_number: typeof number;
41
- declare const handlers_percent: typeof percent;
42
- declare const handlers_fraction: typeof fraction;
43
37
  declare const handlers_bracket: typeof bracket;
44
38
  declare const handlers_bracketOfColor: typeof bracketOfColor;
45
39
  declare const handlers_bracketOfLength: typeof bracketOfLength;
46
40
  declare const handlers_bracketOfPosition: typeof bracketOfPosition;
47
41
  declare const handlers_cssvar: typeof cssvar;
48
- declare const handlers_time: typeof time;
49
42
  declare const handlers_degree: typeof degree;
43
+ declare const handlers_fraction: typeof fraction;
50
44
  declare const handlers_global: typeof global;
51
- declare const handlers_properties: typeof properties;
45
+ declare const handlers_number: typeof number;
46
+ declare const handlers_numberWithUnit: typeof numberWithUnit;
47
+ declare const handlers_percent: typeof percent;
52
48
  declare const handlers_position: typeof position;
49
+ declare const handlers_properties: typeof properties;
50
+ declare const handlers_px: typeof px;
51
+ declare const handlers_rem: typeof rem;
52
+ declare const handlers_time: typeof time;
53
53
  declare namespace handlers {
54
- export {
55
- handlers_numberWithUnit as numberWithUnit,
56
- handlers_auto as auto,
57
- handlers_rem as rem,
58
- handlers_px as px,
59
- handlers_number as number,
60
- handlers_percent as percent,
61
- handlers_fraction as fraction,
62
- handlers_bracket as bracket,
63
- handlers_bracketOfColor as bracketOfColor,
64
- handlers_bracketOfLength as bracketOfLength,
65
- handlers_bracketOfPosition as bracketOfPosition,
66
- handlers_cssvar as cssvar,
67
- handlers_time as time,
68
- handlers_degree as degree,
69
- handlers_global as global,
70
- handlers_properties as properties,
71
- handlers_position as position,
72
- };
54
+ export { handlers_auto as auto, handlers_bracket as bracket, handlers_bracketOfColor as bracketOfColor, handlers_bracketOfLength as bracketOfLength, handlers_bracketOfPosition as bracketOfPosition, handlers_cssvar as cssvar, handlers_degree as degree, handlers_fraction as fraction, handlers_global as global, handlers_number as number, handlers_numberWithUnit as numberWithUnit, handlers_percent as percent, handlers_position as position, handlers_properties as properties, handlers_px as px, handlers_rem as rem, handlers_time as time };
73
55
  }
74
56
 
75
- declare const handler: _unocss_core.ValueHandler<"number" | "global" | "auto" | "position" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "bracketOfPosition" | "cssvar" | "time" | "degree" | "properties">;
76
- declare const h: _unocss_core.ValueHandler<"number" | "global" | "auto" | "position" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "bracketOfPosition" | "cssvar" | "time" | "degree" | "properties">;
57
+ declare const handler: _unocss_core.ValueHandler<"number" | "auto" | "position" | "global" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "bracketOfPosition" | "cssvar" | "time" | "degree" | "properties">;
58
+ declare const h: _unocss_core.ValueHandler<"number" | "auto" | "position" | "global" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "bracketOfPosition" | "cssvar" | "time" | "degree" | "properties">;
77
59
 
78
60
  declare function variantMatcher(name: string, handler: (input: VariantHandlerContext) => Record<string, any>): VariantObject;
79
61
  declare function variantParentMatcher(name: string, parent: string): VariantObject;
package/dist/utils.mjs CHANGED
@@ -1,3 +1,81 @@
1
- export { C as CONTROL_MINI_NO_NEGATIVE, f as colorOpacityToString, c as colorResolver, e as colorToString, j as colorableShadows, b as cornerMap, d as directionMap, o as directionSize, q as getBracket, t as getComponent, z as getComponents, g as globalKeywords, h, w as handler, a as hasParseableColor, u as hex2rgba, i as insetMap, m as makeGlobalStaticRules, p as parseColor, v as parseCssColor, k as positionMap, l as resolveBreakpoints, r as resolveVerticalBreakpoints, s as splitShorthand, y as valueHandlers, x as xyzMap } from './shared/preset-mini.6c1c8016.mjs';
2
- export { a as variantGetBracket, v as variantGetParameter, b as variantMatcher, c as variantParentMatcher } from './shared/preset-mini.74f9d55e.mjs';
3
- import '@unocss/core';
1
+ import { e as getBracket } from './shared/preset-mini.f1fe435e.mjs';
2
+ export { C as CONTROL_MINI_NO_NEGATIVE, j as colorOpacityToString, c as colorResolver, k as colorToString, b as colorableShadows, o as cornerMap, l as directionMap, r as directionSize, w as getComponent, y as getComponents, g as globalKeywords, h, q as handler, a as hasParseableColor, f as hex2rgba, n as insetMap, m as makeGlobalStaticRules, p as parseColor, i as parseCssColor, d as positionMap, t as resolveBreakpoints, u as resolveVerticalBreakpoints, s as splitShorthand, v as valueHandlers, x as xyzMap } from './shared/preset-mini.f1fe435e.mjs';
3
+ import { escapeRegExp } from '@unocss/core';
4
+
5
+ function variantMatcher(name, handler) {
6
+ let re;
7
+ return {
8
+ name,
9
+ match(input, ctx) {
10
+ if (!re)
11
+ re = new RegExp(`^${escapeRegExp(name)}(?:${ctx.generator.config.separators.join("|")})`);
12
+ const match = input.match(re);
13
+ if (match) {
14
+ return {
15
+ matcher: input.slice(match[0].length),
16
+ handle: (input2, next) => next({
17
+ ...input2,
18
+ ...handler(input2)
19
+ })
20
+ };
21
+ }
22
+ },
23
+ autocomplete: `${name}:`
24
+ };
25
+ }
26
+ function variantParentMatcher(name, parent) {
27
+ let re;
28
+ return {
29
+ name,
30
+ match(input, ctx) {
31
+ if (!re)
32
+ re = new RegExp(`^${escapeRegExp(name)}(?:${ctx.generator.config.separators.join("|")})`);
33
+ const match = input.match(re);
34
+ if (match) {
35
+ return {
36
+ matcher: input.slice(match[0].length),
37
+ handle: (input2, next) => next({
38
+ ...input2,
39
+ parent: `${input2.parent ? `${input2.parent} $$ ` : ""}${parent}`
40
+ })
41
+ };
42
+ }
43
+ },
44
+ autocomplete: `${name}:`
45
+ };
46
+ }
47
+ function variantGetBracket(prefix, matcher, separators) {
48
+ if (matcher.startsWith(`${prefix}[`)) {
49
+ const [match, rest] = getBracket(matcher.slice(prefix.length), "[", "]") ?? [];
50
+ if (match && rest) {
51
+ for (const separator of separators) {
52
+ if (rest.startsWith(separator))
53
+ return [match, rest.slice(separator.length), separator];
54
+ }
55
+ return [match, rest, ""];
56
+ }
57
+ }
58
+ }
59
+ function variantGetParameter(prefix, matcher, separators) {
60
+ if (matcher.startsWith(prefix)) {
61
+ const body = variantGetBracket(prefix, matcher, separators);
62
+ if (body) {
63
+ const [label = "", rest = body[1]] = variantGetParameter("/", body[1], separators) ?? [];
64
+ return [body[0], rest, label];
65
+ }
66
+ for (const separator of separators.filter((x) => x !== "/")) {
67
+ const pos = matcher.indexOf(separator, prefix.length);
68
+ if (pos !== -1) {
69
+ const labelPos = matcher.indexOf("/", prefix.length);
70
+ const unlabelled = labelPos === -1 || pos <= labelPos;
71
+ return [
72
+ matcher.slice(prefix.length, unlabelled ? pos : labelPos),
73
+ matcher.slice(pos + separator.length),
74
+ unlabelled ? "" : matcher.slice(labelPos + 1, pos)
75
+ ];
76
+ }
77
+ }
78
+ }
79
+ }
80
+
81
+ export { getBracket, variantGetBracket, variantGetParameter, variantMatcher, variantParentMatcher };