@unocss/preset-mini 0.55.0 → 0.55.2

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/{default-1f25a0ae.d.ts → shared/preset-mini.024bdcea.d.ts} +1 -1
  17. package/dist/shared/preset-mini.0a9763df.d.mts +721 -0
  18. package/dist/shared/preset-mini.0fac4963.mjs +320 -0
  19. package/dist/shared/preset-mini.5bfee53b.cjs +344 -0
  20. package/dist/shared/preset-mini.5f54784f.d.mts +71 -0
  21. package/dist/shared/preset-mini.5f54784f.d.ts +71 -0
  22. package/dist/shared/preset-mini.aa3a264b.d.cts +67 -0
  23. package/dist/shared/{preset-mini.a21c5071.cjs → preset-mini.b4ad509c.cjs} +12 -8
  24. package/dist/shared/preset-mini.d69a12a5.d.cts +721 -0
  25. package/dist/{utilities-d496540e.d.ts → shared/preset-mini.e93c20db.d.ts} +1 -1
  26. package/dist/shared/{preset-mini.6c1c8016.mjs → preset-mini.f1fe435e.mjs} +13 -9
  27. package/dist/shared/preset-mini.fc26b619.d.mts +67 -0
  28. package/dist/theme.cjs +308 -34
  29. package/dist/theme.d.cts +264 -0
  30. package/dist/theme.d.mts +264 -0
  31. package/dist/theme.d.ts +5 -5
  32. package/dist/theme.mjs +284 -4
  33. package/dist/utils.cjs +81 -10
  34. package/dist/utils.d.cts +83 -0
  35. package/dist/utils.d.mts +83 -0
  36. package/dist/utils.d.ts +18 -18
  37. package/dist/utils.mjs +81 -3
  38. package/dist/variants.cjs +737 -33
  39. package/dist/variants.d.cts +46 -0
  40. package/dist/variants.d.mts +46 -0
  41. package/dist/variants.d.ts +4 -4
  42. package/dist/variants.mjs +714 -4
  43. package/package.json +3 -3
  44. package/dist/shared/preset-mini.0131b915.mjs +0 -704
  45. package/dist/shared/preset-mini.1c66bf79.mjs +0 -361
  46. package/dist/shared/preset-mini.74f9d55e.mjs +0 -80
  47. package/dist/shared/preset-mini.811eb23d.mjs +0 -681
  48. package/dist/shared/preset-mini.8dd73081.mjs +0 -452
  49. package/dist/shared/preset-mini.9d93761b.cjs +0 -729
  50. package/dist/shared/preset-mini.b8d9397e.cjs +0 -471
  51. package/dist/shared/preset-mini.ce5169f2.cjs +0 -730
  52. package/dist/shared/preset-mini.d778b487.cjs +0 -85
  53. package/dist/shared/preset-mini.de3bd9f7.mjs +0 -284
  54. package/dist/shared/preset-mini.e078d7da.cjs +0 -313
  55. package/dist/shared/preset-mini.f3fc54d2.cjs +0 -363
  56. /package/dist/{types-d991ba46.d.ts → shared/preset-mini.5f54784f.d.cts} +0 -0
@@ -0,0 +1,320 @@
1
+ import { h, m as makeGlobalStaticRules, g as globalKeywords, c as colorResolver, a as hasParseableColor, b as colorableShadows, d as positionMap, x as xyzMap } from './preset-mini.f1fe435e.mjs';
2
+
3
+ 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"];
4
+ const containValues = ["none", "strict", "content", "size", "inline-size", "layout", "style", "paint"];
5
+ const varEmpty = " ";
6
+ const displays = [
7
+ ["inline", { display: "inline" }],
8
+ ["block", { display: "block" }],
9
+ ["inline-block", { display: "inline-block" }],
10
+ ["contents", { display: "contents" }],
11
+ ["flow-root", { display: "flow-root" }],
12
+ ["list-item", { display: "list-item" }],
13
+ ["hidden", { display: "none" }],
14
+ [/^display-(.+)$/, ([, c]) => ({ display: h.bracket.cssvar.global(c) || c })]
15
+ ];
16
+ const appearances = [
17
+ ["visible", { visibility: "visible" }],
18
+ ["invisible", { visibility: "hidden" }],
19
+ ["backface-visible", { "backface-visibility": "visible" }],
20
+ ["backface-hidden", { "backface-visibility": "hidden" }],
21
+ ...makeGlobalStaticRules("backface", "backface-visibility")
22
+ ];
23
+ const cursors = [
24
+ [/^cursor-(.+)$/, ([, c]) => ({ cursor: h.bracket.cssvar.global(c) })],
25
+ ...cursorValues.map((v) => [`cursor-${v}`, { cursor: v }])
26
+ ];
27
+ const contains = [
28
+ [/^contain-(.*)$/, ([, d]) => {
29
+ if (h.bracket(d) != null) {
30
+ return {
31
+ contain: h.bracket(d).split(" ").map((e) => h.cssvar.fraction(e) ?? e).join(" ")
32
+ };
33
+ }
34
+ return containValues.includes(d) ? { contain: d } : void 0;
35
+ }]
36
+ ];
37
+ const pointerEvents = [
38
+ ["pointer-events-auto", { "pointer-events": "auto" }],
39
+ ["pointer-events-none", { "pointer-events": "none" }],
40
+ ...makeGlobalStaticRules("pointer-events")
41
+ ];
42
+ const resizes = [
43
+ ["resize-x", { resize: "horizontal" }],
44
+ ["resize-y", { resize: "vertical" }],
45
+ ["resize", { resize: "both" }],
46
+ ["resize-none", { resize: "none" }],
47
+ ...makeGlobalStaticRules("resize")
48
+ ];
49
+ const userSelects = [
50
+ ["select-auto", { "-webkit-user-select": "auto", "user-select": "auto" }],
51
+ ["select-all", { "-webkit-user-select": "all", "user-select": "all" }],
52
+ ["select-text", { "-webkit-user-select": "text", "user-select": "text" }],
53
+ ["select-none", { "-webkit-user-select": "none", "user-select": "none" }],
54
+ ...makeGlobalStaticRules("select", "user-select")
55
+ ];
56
+ const whitespaces = [
57
+ [
58
+ /^(?:whitespace-|ws-)([-\w]+)$/,
59
+ ([, v]) => ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces", ...globalKeywords].includes(v) ? { "white-space": v } : void 0,
60
+ { autocomplete: "(whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)" }
61
+ ]
62
+ ];
63
+ const contentVisibility = [
64
+ [/^intrinsic-size-(.+)$/, ([, d]) => ({ "contain-intrinsic-size": h.bracket.cssvar.global.fraction.rem(d) }), { autocomplete: "intrinsic-size-<num>" }],
65
+ ["content-visibility-visible", { "content-visibility": "visible" }],
66
+ ["content-visibility-hidden", { "content-visibility": "hidden" }],
67
+ ["content-visibility-auto", { "content-visibility": "auto" }],
68
+ ...makeGlobalStaticRules("content-visibility")
69
+ ];
70
+ const contents = [
71
+ [/^content-(.+)$/, ([, v]) => ({ content: h.bracket.cssvar(v) })],
72
+ ["content-empty", { content: '""' }],
73
+ ["content-none", { content: "none" }]
74
+ ];
75
+ const breaks = [
76
+ ["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
77
+ ["break-words", { "overflow-wrap": "break-word" }],
78
+ ["break-all", { "word-break": "break-all" }],
79
+ ["break-keep", { "word-break": "keep-all" }],
80
+ ["break-anywhere", { "overflow-wrap": "anywhere" }]
81
+ ];
82
+ const textWraps = [
83
+ ["text-wrap", { "text-wrap": "wrap" }],
84
+ ["text-nowrap", { "text-wrap": "nowrap" }],
85
+ ["text-balance", { "text-wrap": "balance" }]
86
+ ];
87
+ const textOverflows = [
88
+ ["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
89
+ ["text-truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
90
+ ["text-ellipsis", { "text-overflow": "ellipsis" }],
91
+ ["text-clip", { "text-overflow": "clip" }]
92
+ ];
93
+ const textTransforms = [
94
+ ["case-upper", { "text-transform": "uppercase" }],
95
+ ["case-lower", { "text-transform": "lowercase" }],
96
+ ["case-capital", { "text-transform": "capitalize" }],
97
+ ["case-normal", { "text-transform": "none" }],
98
+ ...makeGlobalStaticRules("case", "text-transform")
99
+ ];
100
+ const fontStyles = [
101
+ ["italic", { "font-style": "italic" }],
102
+ ["not-italic", { "font-style": "normal" }],
103
+ ["font-italic", { "font-style": "italic" }],
104
+ ["font-not-italic", { "font-style": "normal" }],
105
+ ["oblique", { "font-style": "oblique" }],
106
+ ["not-oblique", { "font-style": "normal" }],
107
+ ["font-oblique", { "font-style": "oblique" }],
108
+ ["font-not-oblique", { "font-style": "normal" }]
109
+ ];
110
+ const fontSmoothings = [
111
+ ["antialiased", {
112
+ "-webkit-font-smoothing": "antialiased",
113
+ "-moz-osx-font-smoothing": "grayscale",
114
+ "font-smoothing": "grayscale"
115
+ }],
116
+ ["subpixel-antialiased", {
117
+ "-webkit-font-smoothing": "auto",
118
+ "-moz-osx-font-smoothing": "auto",
119
+ "font-smoothing": "auto"
120
+ }]
121
+ ];
122
+
123
+ const ringBase = {
124
+ "--un-ring-inset": varEmpty,
125
+ "--un-ring-offset-width": "0px",
126
+ "--un-ring-offset-color": "#fff",
127
+ "--un-ring-width": "0px",
128
+ "--un-ring-color": "rgba(147,197,253,0.5)",
129
+ "--un-shadow": "0 0 rgba(0,0,0,0)"
130
+ };
131
+ const rings = [
132
+ // size
133
+ [/^ring(?:-(.+))?$/, ([, d], { theme }) => {
134
+ const value = theme.ringWidth?.[d || "DEFAULT"] ?? h.px(d || "1");
135
+ if (value) {
136
+ return {
137
+ "--un-ring-width": value,
138
+ "--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)",
139
+ "--un-ring-shadow": "var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color)",
140
+ "box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)"
141
+ };
142
+ }
143
+ }, { autocomplete: "ring-$ringWidth" }],
144
+ [/^ring-(?:width-|size-)(.+)$/, ([, d], { theme }) => ({ "--un-ring-width": theme.lineWidth?.[d] ?? h.bracket.cssvar.px(d) }), { autocomplete: "ring-(width|size)-$lineWidth" }],
145
+ // offset size
146
+ ["ring-offset", { "--un-ring-offset-width": "1px" }],
147
+ [/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ?? h.bracket.cssvar.px(d) }), { autocomplete: "ring-offset-(width|size)-$lineWidth" }],
148
+ // colors
149
+ [/^ring-(.+)$/, colorResolver("--un-ring-color", "ring"), { autocomplete: "ring-$colors" }],
150
+ [/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "ring-(op|opacity)-<percent>" }],
151
+ // offset color
152
+ [/^ring-offset-(.+)$/, colorResolver("--un-ring-offset-color", "ring-offset"), { autocomplete: "ring-offset-$colors" }],
153
+ [/^ring-offset-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-offset-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "ring-offset-(op|opacity)-<percent>" }],
154
+ // style
155
+ ["ring-inset", { "--un-ring-inset": "inset" }]
156
+ ];
157
+
158
+ const boxShadowsBase = {
159
+ "--un-ring-offset-shadow": "0 0 rgba(0,0,0,0)",
160
+ "--un-ring-shadow": "0 0 rgba(0,0,0,0)",
161
+ "--un-shadow-inset": varEmpty,
162
+ "--un-shadow": "0 0 rgba(0,0,0,0)"
163
+ };
164
+ const boxShadows = [
165
+ // color
166
+ [/^shadow(?:-(.+))?$/, (match, context) => {
167
+ const [, d] = match;
168
+ const { theme } = context;
169
+ const v = theme.boxShadow?.[d || "DEFAULT"];
170
+ const c = d ? h.bracket.cssvar(d) : void 0;
171
+ if ((v != null || c != null) && !hasParseableColor(c, theme)) {
172
+ return {
173
+ "--un-shadow": colorableShadows(v || c, "--un-shadow-color").join(","),
174
+ "box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)"
175
+ };
176
+ }
177
+ return colorResolver("--un-shadow-color", "shadow")(match, context);
178
+ }, { autocomplete: ["shadow-$colors", "shadow-$boxShadow"] }],
179
+ [/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "shadow-(op|opacity)-<percent>" }],
180
+ // inset
181
+ ["shadow-inset", { "--un-shadow-inset": "inset" }]
182
+ ];
183
+
184
+ const transformValues = [
185
+ "translate",
186
+ "rotate",
187
+ "scale"
188
+ ];
189
+ const transformCpu = [
190
+ "translateX(var(--un-translate-x))",
191
+ "translateY(var(--un-translate-y))",
192
+ "translateZ(var(--un-translate-z))",
193
+ "rotate(var(--un-rotate))",
194
+ "rotateX(var(--un-rotate-x))",
195
+ "rotateY(var(--un-rotate-y))",
196
+ "rotateZ(var(--un-rotate-z))",
197
+ "skewX(var(--un-skew-x))",
198
+ "skewY(var(--un-skew-y))",
199
+ "scaleX(var(--un-scale-x))",
200
+ "scaleY(var(--un-scale-y))",
201
+ "scaleZ(var(--un-scale-z))"
202
+ ].join(" ");
203
+ const transformGpu = [
204
+ "translate3d(var(--un-translate-x), var(--un-translate-y), var(--un-translate-z))",
205
+ "rotate(var(--un-rotate))",
206
+ "rotateX(var(--un-rotate-x))",
207
+ "rotateY(var(--un-rotate-y))",
208
+ "rotateZ(var(--un-rotate-z))",
209
+ "skewX(var(--un-skew-x))",
210
+ "skewY(var(--un-skew-y))",
211
+ "scaleX(var(--un-scale-x))",
212
+ "scaleY(var(--un-scale-y))",
213
+ "scaleZ(var(--un-scale-z))"
214
+ ].join(" ");
215
+ const transformBase = {
216
+ // transform
217
+ "--un-rotate": 0,
218
+ "--un-rotate-x": 0,
219
+ "--un-rotate-y": 0,
220
+ "--un-rotate-z": 0,
221
+ "--un-scale-x": 1,
222
+ "--un-scale-y": 1,
223
+ "--un-scale-z": 1,
224
+ "--un-skew-x": 0,
225
+ "--un-skew-y": 0,
226
+ "--un-translate-x": 0,
227
+ "--un-translate-y": 0,
228
+ "--un-translate-z": 0
229
+ };
230
+ const transforms = [
231
+ // origins
232
+ [/^(?:transform-)?origin-(.+)$/, ([, s]) => ({ "transform-origin": positionMap[s] ?? h.bracket.cssvar(s) }), { autocomplete: [`transform-origin-(${Object.keys(positionMap).join("|")})`, `origin-(${Object.keys(positionMap).join("|")})`] }],
233
+ // perspectives
234
+ [/^(?:transform-)?perspect(?:ive)?-(.+)$/, ([, s]) => {
235
+ const v = h.bracket.cssvar.px.numberWithUnit(s);
236
+ if (v != null) {
237
+ return {
238
+ "-webkit-perspective": v,
239
+ "perspective": v
240
+ };
241
+ }
242
+ }],
243
+ // skip 1 & 2 letters shortcut
244
+ [/^(?:transform-)?perspect(?:ive)?-origin-(.+)$/, ([, s]) => {
245
+ const v = h.bracket.cssvar(s) ?? (s.length >= 3 ? positionMap[s] : void 0);
246
+ if (v != null) {
247
+ return {
248
+ "-webkit-perspective-origin": v,
249
+ "perspective-origin": v
250
+ };
251
+ }
252
+ }],
253
+ // modifiers
254
+ [/^(?:transform-)?translate-()(.+)$/, handleTranslate],
255
+ [/^(?:transform-)?translate-([xyz])-(.+)$/, handleTranslate],
256
+ [/^(?:transform-)?rotate-()(.+)$/, handleRotate],
257
+ [/^(?:transform-)?rotate-([xyz])-(.+)$/, handleRotate],
258
+ [/^(?:transform-)?skew-()(.+)$/, handleSkew],
259
+ [/^(?:transform-)?skew-([xy])-(.+)$/, handleSkew, { autocomplete: ["transform-skew-(x|y)-<percent>"] }],
260
+ [/^(?:transform-)?scale-()(.+)$/, handleScale],
261
+ [/^(?:transform-)?scale-([xyz])-(.+)$/, handleScale, { autocomplete: [`transform-(${transformValues.join("|")})-<percent>`, `transform-(${transformValues.join("|")})-(x|y|z)-<percent>`] }],
262
+ // style
263
+ [/^(?:transform-)?preserve-3d$/, () => ({ "transform-style": "preserve-3d" })],
264
+ [/^(?:transform-)?preserve-flat$/, () => ({ "transform-style": "flat" })],
265
+ // base
266
+ ["transform", { transform: transformCpu }],
267
+ ["transform-cpu", { transform: transformCpu }],
268
+ ["transform-gpu", { transform: transformGpu }],
269
+ ["transform-none", { transform: "none" }],
270
+ ...makeGlobalStaticRules("transform")
271
+ ];
272
+ function handleTranslate([, d, b], { theme }) {
273
+ const v = theme.spacing?.[b] ?? h.bracket.cssvar.fraction.rem(b);
274
+ if (v != null) {
275
+ return [
276
+ ...xyzMap[d].map((i) => [`--un-translate${i}`, v]),
277
+ ["transform", transformCpu]
278
+ ];
279
+ }
280
+ }
281
+ function handleScale([, d, b]) {
282
+ const v = h.bracket.cssvar.fraction.percent(b);
283
+ if (v != null) {
284
+ return [
285
+ ...xyzMap[d].map((i) => [`--un-scale${i}`, v]),
286
+ ["transform", transformCpu]
287
+ ];
288
+ }
289
+ }
290
+ function handleRotate([, d = "", b]) {
291
+ const v = h.bracket.cssvar.degree(b);
292
+ if (v != null) {
293
+ if (d) {
294
+ return {
295
+ "--un-rotate": 0,
296
+ [`--un-rotate-${d}`]: v,
297
+ "transform": transformCpu
298
+ };
299
+ } else {
300
+ return {
301
+ "--un-rotate-x": 0,
302
+ "--un-rotate-y": 0,
303
+ "--un-rotate-z": 0,
304
+ "--un-rotate": v,
305
+ "transform": transformCpu
306
+ };
307
+ }
308
+ }
309
+ }
310
+ function handleSkew([, d, b]) {
311
+ const v = h.bracket.cssvar.degree(b);
312
+ if (v != null) {
313
+ return [
314
+ ...xyzMap[d].map((i) => [`--un-skew${i}`, v]),
315
+ ["transform", transformCpu]
316
+ ];
317
+ }
318
+ }
319
+
320
+ export { contents as a, boxShadowsBase as b, contentVisibility as c, displays as d, textOverflows as e, textTransforms as f, fontStyles as g, fontSmoothings as h, boxShadows as i, rings as j, cursors as k, appearances as l, resizes as m, breaks as n, transforms as o, pointerEvents as p, contains as q, ringBase as r, textWraps as s, transformBase as t, userSelects as u, varEmpty as v, whitespaces as w };
@@ -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;