@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,344 @@
1
+ 'use strict';
2
+
3
+ const colors = require('./preset-mini.b4ad509c.cjs');
4
+
5
+ const cursorValues = ["auto", "default", "none", "context-menu", "help", "pointer", "progress", "wait", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "no-drop", "not-allowed", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out"];
6
+ const containValues = ["none", "strict", "content", "size", "inline-size", "layout", "style", "paint"];
7
+ const varEmpty = " ";
8
+ const displays = [
9
+ ["inline", { display: "inline" }],
10
+ ["block", { display: "block" }],
11
+ ["inline-block", { display: "inline-block" }],
12
+ ["contents", { display: "contents" }],
13
+ ["flow-root", { display: "flow-root" }],
14
+ ["list-item", { display: "list-item" }],
15
+ ["hidden", { display: "none" }],
16
+ [/^display-(.+)$/, ([, c]) => ({ display: colors.h.bracket.cssvar.global(c) || c })]
17
+ ];
18
+ const appearances = [
19
+ ["visible", { visibility: "visible" }],
20
+ ["invisible", { visibility: "hidden" }],
21
+ ["backface-visible", { "backface-visibility": "visible" }],
22
+ ["backface-hidden", { "backface-visibility": "hidden" }],
23
+ ...colors.makeGlobalStaticRules("backface", "backface-visibility")
24
+ ];
25
+ const cursors = [
26
+ [/^cursor-(.+)$/, ([, c]) => ({ cursor: colors.h.bracket.cssvar.global(c) })],
27
+ ...cursorValues.map((v) => [`cursor-${v}`, { cursor: v }])
28
+ ];
29
+ const contains = [
30
+ [/^contain-(.*)$/, ([, d]) => {
31
+ if (colors.h.bracket(d) != null) {
32
+ return {
33
+ contain: colors.h.bracket(d).split(" ").map((e) => colors.h.cssvar.fraction(e) ?? e).join(" ")
34
+ };
35
+ }
36
+ return containValues.includes(d) ? { contain: d } : void 0;
37
+ }]
38
+ ];
39
+ const pointerEvents = [
40
+ ["pointer-events-auto", { "pointer-events": "auto" }],
41
+ ["pointer-events-none", { "pointer-events": "none" }],
42
+ ...colors.makeGlobalStaticRules("pointer-events")
43
+ ];
44
+ const resizes = [
45
+ ["resize-x", { resize: "horizontal" }],
46
+ ["resize-y", { resize: "vertical" }],
47
+ ["resize", { resize: "both" }],
48
+ ["resize-none", { resize: "none" }],
49
+ ...colors.makeGlobalStaticRules("resize")
50
+ ];
51
+ const userSelects = [
52
+ ["select-auto", { "-webkit-user-select": "auto", "user-select": "auto" }],
53
+ ["select-all", { "-webkit-user-select": "all", "user-select": "all" }],
54
+ ["select-text", { "-webkit-user-select": "text", "user-select": "text" }],
55
+ ["select-none", { "-webkit-user-select": "none", "user-select": "none" }],
56
+ ...colors.makeGlobalStaticRules("select", "user-select")
57
+ ];
58
+ const whitespaces = [
59
+ [
60
+ /^(?:whitespace-|ws-)([-\w]+)$/,
61
+ ([, v]) => ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces", ...colors.globalKeywords].includes(v) ? { "white-space": v } : void 0,
62
+ { autocomplete: "(whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)" }
63
+ ]
64
+ ];
65
+ const contentVisibility = [
66
+ [/^intrinsic-size-(.+)$/, ([, d]) => ({ "contain-intrinsic-size": colors.h.bracket.cssvar.global.fraction.rem(d) }), { autocomplete: "intrinsic-size-<num>" }],
67
+ ["content-visibility-visible", { "content-visibility": "visible" }],
68
+ ["content-visibility-hidden", { "content-visibility": "hidden" }],
69
+ ["content-visibility-auto", { "content-visibility": "auto" }],
70
+ ...colors.makeGlobalStaticRules("content-visibility")
71
+ ];
72
+ const contents = [
73
+ [/^content-(.+)$/, ([, v]) => ({ content: colors.h.bracket.cssvar(v) })],
74
+ ["content-empty", { content: '""' }],
75
+ ["content-none", { content: "none" }]
76
+ ];
77
+ const breaks = [
78
+ ["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
79
+ ["break-words", { "overflow-wrap": "break-word" }],
80
+ ["break-all", { "word-break": "break-all" }],
81
+ ["break-keep", { "word-break": "keep-all" }],
82
+ ["break-anywhere", { "overflow-wrap": "anywhere" }]
83
+ ];
84
+ const textWraps = [
85
+ ["text-wrap", { "text-wrap": "wrap" }],
86
+ ["text-nowrap", { "text-wrap": "nowrap" }],
87
+ ["text-balance", { "text-wrap": "balance" }]
88
+ ];
89
+ const textOverflows = [
90
+ ["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
91
+ ["text-truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
92
+ ["text-ellipsis", { "text-overflow": "ellipsis" }],
93
+ ["text-clip", { "text-overflow": "clip" }]
94
+ ];
95
+ const textTransforms = [
96
+ ["case-upper", { "text-transform": "uppercase" }],
97
+ ["case-lower", { "text-transform": "lowercase" }],
98
+ ["case-capital", { "text-transform": "capitalize" }],
99
+ ["case-normal", { "text-transform": "none" }],
100
+ ...colors.makeGlobalStaticRules("case", "text-transform")
101
+ ];
102
+ const fontStyles = [
103
+ ["italic", { "font-style": "italic" }],
104
+ ["not-italic", { "font-style": "normal" }],
105
+ ["font-italic", { "font-style": "italic" }],
106
+ ["font-not-italic", { "font-style": "normal" }],
107
+ ["oblique", { "font-style": "oblique" }],
108
+ ["not-oblique", { "font-style": "normal" }],
109
+ ["font-oblique", { "font-style": "oblique" }],
110
+ ["font-not-oblique", { "font-style": "normal" }]
111
+ ];
112
+ const fontSmoothings = [
113
+ ["antialiased", {
114
+ "-webkit-font-smoothing": "antialiased",
115
+ "-moz-osx-font-smoothing": "grayscale",
116
+ "font-smoothing": "grayscale"
117
+ }],
118
+ ["subpixel-antialiased", {
119
+ "-webkit-font-smoothing": "auto",
120
+ "-moz-osx-font-smoothing": "auto",
121
+ "font-smoothing": "auto"
122
+ }]
123
+ ];
124
+
125
+ const ringBase = {
126
+ "--un-ring-inset": varEmpty,
127
+ "--un-ring-offset-width": "0px",
128
+ "--un-ring-offset-color": "#fff",
129
+ "--un-ring-width": "0px",
130
+ "--un-ring-color": "rgba(147,197,253,0.5)",
131
+ "--un-shadow": "0 0 rgba(0,0,0,0)"
132
+ };
133
+ const rings = [
134
+ // size
135
+ [/^ring(?:-(.+))?$/, ([, d], { theme }) => {
136
+ const value = theme.ringWidth?.[d || "DEFAULT"] ?? colors.h.px(d || "1");
137
+ if (value) {
138
+ return {
139
+ "--un-ring-width": value,
140
+ "--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
141
+ "--un-ring-shadow": "var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color)",
142
+ "box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)"
143
+ };
144
+ }
145
+ }, { autocomplete: "ring-$ringWidth" }],
146
+ [/^ring-(?:width-|size-)(.+)$/, ([, d], { theme }) => ({ "--un-ring-width": theme.lineWidth?.[d] ?? colors.h.bracket.cssvar.px(d) }), { autocomplete: "ring-(width|size)-$lineWidth" }],
147
+ // offset size
148
+ ["ring-offset", { "--un-ring-offset-width": "1px" }],
149
+ [/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ?? colors.h.bracket.cssvar.px(d) }), { autocomplete: "ring-offset-(width|size)-$lineWidth" }],
150
+ // colors
151
+ [/^ring-(.+)$/, colors.colorResolver("--un-ring-color", "ring"), { autocomplete: "ring-$colors" }],
152
+ [/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": colors.h.bracket.percent.cssvar(opacity) }), { autocomplete: "ring-(op|opacity)-<percent>" }],
153
+ // offset color
154
+ [/^ring-offset-(.+)$/, colors.colorResolver("--un-ring-offset-color", "ring-offset"), { autocomplete: "ring-offset-$colors" }],
155
+ [/^ring-offset-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-offset-opacity": colors.h.bracket.percent.cssvar(opacity) }), { autocomplete: "ring-offset-(op|opacity)-<percent>" }],
156
+ // style
157
+ ["ring-inset", { "--un-ring-inset": "inset" }]
158
+ ];
159
+
160
+ const boxShadowsBase = {
161
+ "--un-ring-offset-shadow": "0 0 rgba(0,0,0,0)",
162
+ "--un-ring-shadow": "0 0 rgba(0,0,0,0)",
163
+ "--un-shadow-inset": varEmpty,
164
+ "--un-shadow": "0 0 rgba(0,0,0,0)"
165
+ };
166
+ const boxShadows = [
167
+ // color
168
+ [/^shadow(?:-(.+))?$/, (match, context) => {
169
+ const [, d] = match;
170
+ const { theme } = context;
171
+ const v = theme.boxShadow?.[d || "DEFAULT"];
172
+ const c = d ? colors.h.bracket.cssvar(d) : void 0;
173
+ if ((v != null || c != null) && !colors.hasParseableColor(c, theme)) {
174
+ return {
175
+ "--un-shadow": colors.colorableShadows(v || c, "--un-shadow-color").join(","),
176
+ "box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)"
177
+ };
178
+ }
179
+ return colors.colorResolver("--un-shadow-color", "shadow")(match, context);
180
+ }, { autocomplete: ["shadow-$colors", "shadow-$boxShadow"] }],
181
+ [/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": colors.h.bracket.percent.cssvar(opacity) }), { autocomplete: "shadow-(op|opacity)-<percent>" }],
182
+ // inset
183
+ ["shadow-inset", { "--un-shadow-inset": "inset" }]
184
+ ];
185
+
186
+ const transformValues = [
187
+ "translate",
188
+ "rotate",
189
+ "scale"
190
+ ];
191
+ const transformCpu = [
192
+ "translateX(var(--un-translate-x))",
193
+ "translateY(var(--un-translate-y))",
194
+ "translateZ(var(--un-translate-z))",
195
+ "rotate(var(--un-rotate))",
196
+ "rotateX(var(--un-rotate-x))",
197
+ "rotateY(var(--un-rotate-y))",
198
+ "rotateZ(var(--un-rotate-z))",
199
+ "skewX(var(--un-skew-x))",
200
+ "skewY(var(--un-skew-y))",
201
+ "scaleX(var(--un-scale-x))",
202
+ "scaleY(var(--un-scale-y))",
203
+ "scaleZ(var(--un-scale-z))"
204
+ ].join(" ");
205
+ const transformGpu = [
206
+ "translate3d(var(--un-translate-x), var(--un-translate-y), var(--un-translate-z))",
207
+ "rotate(var(--un-rotate))",
208
+ "rotateX(var(--un-rotate-x))",
209
+ "rotateY(var(--un-rotate-y))",
210
+ "rotateZ(var(--un-rotate-z))",
211
+ "skewX(var(--un-skew-x))",
212
+ "skewY(var(--un-skew-y))",
213
+ "scaleX(var(--un-scale-x))",
214
+ "scaleY(var(--un-scale-y))",
215
+ "scaleZ(var(--un-scale-z))"
216
+ ].join(" ");
217
+ const transformBase = {
218
+ // transform
219
+ "--un-rotate": 0,
220
+ "--un-rotate-x": 0,
221
+ "--un-rotate-y": 0,
222
+ "--un-rotate-z": 0,
223
+ "--un-scale-x": 1,
224
+ "--un-scale-y": 1,
225
+ "--un-scale-z": 1,
226
+ "--un-skew-x": 0,
227
+ "--un-skew-y": 0,
228
+ "--un-translate-x": 0,
229
+ "--un-translate-y": 0,
230
+ "--un-translate-z": 0
231
+ };
232
+ const transforms = [
233
+ // origins
234
+ [/^(?:transform-)?origin-(.+)$/, ([, s]) => ({ "transform-origin": colors.positionMap[s] ?? colors.h.bracket.cssvar(s) }), { autocomplete: [`transform-origin-(${Object.keys(colors.positionMap).join("|")})`, `origin-(${Object.keys(colors.positionMap).join("|")})`] }],
235
+ // perspectives
236
+ [/^(?:transform-)?perspect(?:ive)?-(.+)$/, ([, s]) => {
237
+ const v = colors.h.bracket.cssvar.px.numberWithUnit(s);
238
+ if (v != null) {
239
+ return {
240
+ "-webkit-perspective": v,
241
+ "perspective": v
242
+ };
243
+ }
244
+ }],
245
+ // skip 1 & 2 letters shortcut
246
+ [/^(?:transform-)?perspect(?:ive)?-origin-(.+)$/, ([, s]) => {
247
+ const v = colors.h.bracket.cssvar(s) ?? (s.length >= 3 ? colors.positionMap[s] : void 0);
248
+ if (v != null) {
249
+ return {
250
+ "-webkit-perspective-origin": v,
251
+ "perspective-origin": v
252
+ };
253
+ }
254
+ }],
255
+ // modifiers
256
+ [/^(?:transform-)?translate-()(.+)$/, handleTranslate],
257
+ [/^(?:transform-)?translate-([xyz])-(.+)$/, handleTranslate],
258
+ [/^(?:transform-)?rotate-()(.+)$/, handleRotate],
259
+ [/^(?:transform-)?rotate-([xyz])-(.+)$/, handleRotate],
260
+ [/^(?:transform-)?skew-()(.+)$/, handleSkew],
261
+ [/^(?:transform-)?skew-([xy])-(.+)$/, handleSkew, { autocomplete: ["transform-skew-(x|y)-<percent>"] }],
262
+ [/^(?:transform-)?scale-()(.+)$/, handleScale],
263
+ [/^(?:transform-)?scale-([xyz])-(.+)$/, handleScale, { autocomplete: [`transform-(${transformValues.join("|")})-<percent>`, `transform-(${transformValues.join("|")})-(x|y|z)-<percent>`] }],
264
+ // style
265
+ [/^(?:transform-)?preserve-3d$/, () => ({ "transform-style": "preserve-3d" })],
266
+ [/^(?:transform-)?preserve-flat$/, () => ({ "transform-style": "flat" })],
267
+ // base
268
+ ["transform", { transform: transformCpu }],
269
+ ["transform-cpu", { transform: transformCpu }],
270
+ ["transform-gpu", { transform: transformGpu }],
271
+ ["transform-none", { transform: "none" }],
272
+ ...colors.makeGlobalStaticRules("transform")
273
+ ];
274
+ function handleTranslate([, d, b], { theme }) {
275
+ const v = theme.spacing?.[b] ?? colors.h.bracket.cssvar.fraction.rem(b);
276
+ if (v != null) {
277
+ return [
278
+ ...colors.xyzMap[d].map((i) => [`--un-translate${i}`, v]),
279
+ ["transform", transformCpu]
280
+ ];
281
+ }
282
+ }
283
+ function handleScale([, d, b]) {
284
+ const v = colors.h.bracket.cssvar.fraction.percent(b);
285
+ if (v != null) {
286
+ return [
287
+ ...colors.xyzMap[d].map((i) => [`--un-scale${i}`, v]),
288
+ ["transform", transformCpu]
289
+ ];
290
+ }
291
+ }
292
+ function handleRotate([, d = "", b]) {
293
+ const v = colors.h.bracket.cssvar.degree(b);
294
+ if (v != null) {
295
+ if (d) {
296
+ return {
297
+ "--un-rotate": 0,
298
+ [`--un-rotate-${d}`]: v,
299
+ "transform": transformCpu
300
+ };
301
+ } else {
302
+ return {
303
+ "--un-rotate-x": 0,
304
+ "--un-rotate-y": 0,
305
+ "--un-rotate-z": 0,
306
+ "--un-rotate": v,
307
+ "transform": transformCpu
308
+ };
309
+ }
310
+ }
311
+ }
312
+ function handleSkew([, d, b]) {
313
+ const v = colors.h.bracket.cssvar.degree(b);
314
+ if (v != null) {
315
+ return [
316
+ ...colors.xyzMap[d].map((i) => [`--un-skew${i}`, v]),
317
+ ["transform", transformCpu]
318
+ ];
319
+ }
320
+ }
321
+
322
+ exports.appearances = appearances;
323
+ exports.boxShadows = boxShadows;
324
+ exports.boxShadowsBase = boxShadowsBase;
325
+ exports.breaks = breaks;
326
+ exports.contains = contains;
327
+ exports.contentVisibility = contentVisibility;
328
+ exports.contents = contents;
329
+ exports.cursors = cursors;
330
+ exports.displays = displays;
331
+ exports.fontSmoothings = fontSmoothings;
332
+ exports.fontStyles = fontStyles;
333
+ exports.pointerEvents = pointerEvents;
334
+ exports.resizes = resizes;
335
+ exports.ringBase = ringBase;
336
+ exports.rings = rings;
337
+ exports.textOverflows = textOverflows;
338
+ exports.textTransforms = textTransforms;
339
+ exports.textWraps = textWraps;
340
+ exports.transformBase = transformBase;
341
+ exports.transforms = transforms;
342
+ exports.userSelects = userSelects;
343
+ exports.varEmpty = varEmpty;
344
+ exports.whitespaces = whitespaces;
@@ -0,0 +1,67 @@
1
+ import { DynamicMatcher, ParsedColorValue, CSSObject, VariantContext, StaticRule } from '@unocss/core';
2
+ import { T as Theme } from './preset-mini.32abac2c.cjs';
3
+
4
+ declare const CONTROL_MINI_NO_NEGATIVE = "$$mini-no-negative";
5
+ /**
6
+ * Provide {@link DynamicMatcher} function returning spacing definition. See spacing rules.
7
+ *
8
+ * @param {string} propertyPrefix - Property for the css value to be created. Postfix will be appended according to direction matched.
9
+ * @see {@link directionMap}
10
+ */
11
+ declare function directionSize(propertyPrefix: string): DynamicMatcher;
12
+ /**
13
+ * Split utility shorthand delimited by / or :
14
+ */
15
+ declare function splitShorthand(body: string, type: string): string[];
16
+ /**
17
+ * Parse color string into {@link ParsedColorValue} (if possible). Color value will first be matched to theme object before parsing.
18
+ * See also color.tests.ts for more examples.
19
+ *
20
+ * @example Parseable strings:
21
+ * 'red' // From theme, if 'red' is available
22
+ * 'red-100' // From theme, plus scale
23
+ * 'red-100/20' // From theme, plus scale/opacity
24
+ * '[rgb(100,2,3)]/[var(--op)]' // Bracket with rgb color and bracket with opacity
25
+ *
26
+ * @param {string} body - Color string to be parsed.
27
+ * @param {Theme} theme - {@link Theme} object.
28
+ * @return {ParsedColorValue|undefined} {@link ParsedColorValue} object if string is parseable.
29
+ */
30
+ declare function parseColor(body: string, theme: Theme): ParsedColorValue | undefined;
31
+ /**
32
+ * Provide {@link DynamicMatcher} function to produce color value matched from rule.
33
+ *
34
+ * @see {@link parseColor}
35
+ *
36
+ * @example Resolving 'red' from theme:
37
+ * colorResolver('background-color', 'background')('', 'red')
38
+ * return { 'background-color': '#f12' }
39
+ *
40
+ * @example Resolving 'red-100' from theme:
41
+ * colorResolver('background-color', 'background')('', 'red-100')
42
+ * return { '--un-background-opacity': '1', 'background-color': 'rgba(254,226,226,var(--un-background-opacity))' }
43
+ *
44
+ * @example Resolving 'red-100/20' from theme:
45
+ * colorResolver('background-color', 'background')('', 'red-100/20')
46
+ * return { 'background-color': 'rgba(204,251,241,0.22)' }
47
+ *
48
+ * @example Resolving 'hex-124':
49
+ * colorResolver('color', 'text')('', 'hex-124')
50
+ * return { '--un-text-opacity': '1', 'color': 'rgba(17,34,68,var(--un-text-opacity))' }
51
+ *
52
+ * @param {string} property - Property for the css value to be created.
53
+ * @param {string} varName - Base name for the opacity variable.
54
+ * @param {function} [shouldPass] - Function to decide whether to pass the css.
55
+ * @return {@link DynamicMatcher} object.
56
+ */
57
+ declare function colorResolver(property: string, varName: string, shouldPass?: (css: CSSObject) => boolean): DynamicMatcher;
58
+ declare function colorableShadows(shadows: string | string[], colorVar: string): string[];
59
+ declare function hasParseableColor(color: string | undefined, theme: Theme): boolean;
60
+ declare function resolveBreakpoints({ theme, generator }: Readonly<VariantContext<Theme>>): Record<string, string> | undefined;
61
+ declare function resolveVerticalBreakpoints({ theme, generator }: Readonly<VariantContext<Theme>>): Record<string, string> | undefined;
62
+ declare function makeGlobalStaticRules(prefix: string, property?: string): StaticRule[];
63
+ declare function getBracket(str: string, open: string, close: string): string[] | undefined;
64
+ declare function getComponent(str: string, open: string, close: string, separators: string | string[]): string[] | undefined;
65
+ declare function getComponents(str: string, separators: string | string[], limit?: number): string[] | undefined;
66
+
67
+ 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, splitShorthand as s };
@@ -113,6 +113,7 @@ const numberRE = /^(-?\d*(?:\.\d+)?)$/i;
113
113
  const unitOnlyRE = /^(px)$/i;
114
114
 
115
115
  const cssProps = [
116
+ // basic props
116
117
  "color",
117
118
  "border-color",
118
119
  "background-color",
@@ -130,12 +131,14 @@ const cssProps = [
130
131
  "text-shadow",
131
132
  "transform",
132
133
  "box-shadow",
134
+ // positions
133
135
  "background-position",
134
136
  "left",
135
137
  "right",
136
138
  "top",
137
139
  "bottom",
138
140
  "object-position",
141
+ // sizes
139
142
  "max-height",
140
143
  "min-height",
141
144
  "max-width",
@@ -154,6 +157,7 @@ const cssProps = [
154
157
  "border-spacing",
155
158
  "letter-spacing",
156
159
  "word-spacing",
160
+ // enhances
157
161
  "stroke",
158
162
  "filter",
159
163
  "backdrop-filter",
@@ -337,23 +341,23 @@ function position(str) {
337
341
 
338
342
  const valueHandlers = {
339
343
  __proto__: null,
340
- numberWithUnit: numberWithUnit,
341
344
  auto: auto,
342
- rem: rem,
343
- px: px,
344
- number: number,
345
- percent: percent,
346
- fraction: fraction,
347
345
  bracket: bracket,
348
346
  bracketOfColor: bracketOfColor,
349
347
  bracketOfLength: bracketOfLength,
350
348
  bracketOfPosition: bracketOfPosition,
351
349
  cssvar: cssvar,
352
- time: time,
353
350
  degree: degree,
351
+ fraction: fraction,
354
352
  global: global,
353
+ number: number,
354
+ numberWithUnit: numberWithUnit,
355
+ percent: percent,
356
+ position: position,
355
357
  properties: properties,
356
- position: position
358
+ px: px,
359
+ rem: rem,
360
+ time: time
357
361
  };
358
362
 
359
363
  const handler = core.createValueHandler(valueHandlers);
@@ -111,6 +111,7 @@ const numberRE = /^(-?\d*(?:\.\d+)?)$/i;
111
111
  const unitOnlyRE = /^(px)$/i;
112
112
 
113
113
  const cssProps = [
114
+ // basic props
114
115
  "color",
115
116
  "border-color",
116
117
  "background-color",
@@ -128,12 +129,14 @@ const cssProps = [
128
129
  "text-shadow",
129
130
  "transform",
130
131
  "box-shadow",
132
+ // positions
131
133
  "background-position",
132
134
  "left",
133
135
  "right",
134
136
  "top",
135
137
  "bottom",
136
138
  "object-position",
139
+ // sizes
137
140
  "max-height",
138
141
  "min-height",
139
142
  "max-width",
@@ -152,6 +155,7 @@ const cssProps = [
152
155
  "border-spacing",
153
156
  "letter-spacing",
154
157
  "word-spacing",
158
+ // enhances
155
159
  "stroke",
156
160
  "filter",
157
161
  "backdrop-filter",
@@ -335,23 +339,23 @@ function position(str) {
335
339
 
336
340
  const valueHandlers = {
337
341
  __proto__: null,
338
- numberWithUnit: numberWithUnit,
339
342
  auto: auto,
340
- rem: rem,
341
- px: px,
342
- number: number,
343
- percent: percent,
344
- fraction: fraction,
345
343
  bracket: bracket,
346
344
  bracketOfColor: bracketOfColor,
347
345
  bracketOfLength: bracketOfLength,
348
346
  bracketOfPosition: bracketOfPosition,
349
347
  cssvar: cssvar,
350
- time: time,
351
348
  degree: degree,
349
+ fraction: fraction,
352
350
  global: global,
351
+ number: number,
352
+ numberWithUnit: numberWithUnit,
353
+ percent: percent,
354
+ position: position,
353
355
  properties: properties,
354
- position: position
356
+ px: px,
357
+ rem: rem,
358
+ time: time
355
359
  };
356
360
 
357
361
  const handler = createValueHandler(valueHandlers);
@@ -770,4 +774,4 @@ function parseCssSpaceColorValues(componentString) {
770
774
  };
771
775
  }
772
776
 
773
- export { CONTROL_MINI_NO_NEGATIVE as C, hasParseableColor as a, cornerMap as b, colorResolver as c, directionMap as d, colorToString as e, colorOpacityToString as f, globalKeywords as g, h, insetMap as i, colorableShadows as j, positionMap as k, resolveBreakpoints as l, makeGlobalStaticRules as m, numberWithUnitRE as n, directionSize as o, parseColor$1 as p, getBracket as q, resolveVerticalBreakpoints as r, splitShorthand as s, getComponent as t, hex2rgba as u, parseCssColor as v, handler as w, xyzMap as x, valueHandlers as y, getComponents as z };
777
+ export { CONTROL_MINI_NO_NEGATIVE as C, hasParseableColor as a, colorableShadows as b, colorResolver as c, positionMap as d, getBracket as e, hex2rgba as f, globalKeywords as g, h, parseCssColor as i, colorOpacityToString as j, colorToString as k, directionMap as l, makeGlobalStaticRules as m, insetMap as n, cornerMap as o, parseColor$1 as p, handler as q, directionSize as r, splitShorthand as s, resolveBreakpoints as t, resolveVerticalBreakpoints as u, valueHandlers as v, getComponent as w, xyzMap as x, getComponents as y, numberWithUnitRE as z };