@unocss/vite 0.1.0-beta.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.
package/dist/index.js ADDED
@@ -0,0 +1,1723 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ __markAsModule(target);
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __reExport = (target, module2, desc) => {
14
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
15
+ for (let key of __getOwnPropNames(module2))
16
+ if (!__hasOwnProp.call(target, key) && key !== "default")
17
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
18
+ }
19
+ return target;
20
+ };
21
+ var __toModule = (module2) => {
22
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
23
+ };
24
+
25
+ // src/index.ts
26
+ __export(exports, {
27
+ ChunkModeBuildPlugin: () => ChunkModeBuildPlugin,
28
+ GlobalModeDevPlugin: () => GlobalModeDevPlugin,
29
+ PerModuleModePlugin: () => PerModuleModePlugin,
30
+ VueScopedPlugin: () => VueScopedPlugin,
31
+ default: () => UnocssPlugin
32
+ });
33
+
34
+ // ../unocss/src/index.ts
35
+ var src_exports = {};
36
+ __export(src_exports, {
37
+ presetAttributify: () => src_default2,
38
+ presetUno: () => src_default
39
+ });
40
+ __reExport(src_exports, __toModule(require("@unocss/core")));
41
+
42
+ // ../preset-uno/src/rules/animations.ts
43
+ var transitionProps = ["background-color", "border-color", "color", "fill", "stroke", "opacity", "box-shadow", "transform", "filter", "backdrop-filter"];
44
+ var transitionPropsStr = transitionProps.join(", ");
45
+ var transitions = [
46
+ [/^transition(?:-([a-z-]+))?(?:-(\d+))?$/, ([, prop, duration = "150"]) => {
47
+ if (prop && !transitionProps.includes(prop))
48
+ return;
49
+ return {
50
+ "transition-property": prop || transitionPropsStr,
51
+ "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)",
52
+ "transition-duration": `${duration}ms`
53
+ };
54
+ }],
55
+ [/^duration-(\d+)$/, ([, duration = "150"]) => {
56
+ return {
57
+ "transition-duration": `${duration}ms`
58
+ };
59
+ }],
60
+ ["ease", { "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)" }],
61
+ ["ease-in", { "transition-timing-function": "cubic-bezier(0.4, 0, 1, 1)" }],
62
+ ["ease-out", { "transition-timing-function": "cubic-bezier(0, 0, 0.2, 1)" }],
63
+ ["ease-in-out", { "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)" }]
64
+ ];
65
+
66
+ // ../preset-uno/src/rules/border.ts
67
+ var import_core = __toModule(require("@unocss/core"));
68
+
69
+ // ../preset-uno/src/utils/mappings.ts
70
+ var directionMap = {
71
+ "l": ["-left"],
72
+ "r": ["-right"],
73
+ "t": ["-top"],
74
+ "b": ["-bottom"],
75
+ "s": ["-inline-start"],
76
+ "e": ["-inline-end"],
77
+ "x": ["-left", "-right"],
78
+ "y": ["-top", "-bottom"],
79
+ "": [""],
80
+ "a": [""]
81
+ };
82
+ var cornerMap = {
83
+ "t": ["-top-left", "-top-right"],
84
+ "r": ["-top-right", "-bottom-right"],
85
+ "b": ["-bottom-left", "-bottom-right"],
86
+ "l": ["-bottom-left", "-top-left"],
87
+ "tl": ["-top-left"],
88
+ "lt": ["-top-left"],
89
+ "tr": ["-top-right"],
90
+ "rt": ["-top-right"],
91
+ "bl": ["-bottom-left"],
92
+ "lb": ["-bottom-left"],
93
+ "br": ["-bottom-right"],
94
+ "rb": ["-bottom-right"],
95
+ "": [""]
96
+ };
97
+ var xyzMap = {
98
+ "x": ["-x"],
99
+ "y": ["-y"],
100
+ "z": ["-z"],
101
+ "": ["-x", "-y"]
102
+ };
103
+
104
+ // ../preset-uno/src/rules/border.ts
105
+ var borders = [
106
+ [/^border$/, handlerBorder],
107
+ [/^border(?:-([^-]+))?$/, handlerBorder],
108
+ [/^border(?:-([^-]+))?(?:-([^-]+))?$/, handlerBorder]
109
+ ];
110
+ var borderRadius = [
111
+ [/^(?:border-)?(?:rounded|rd)$/, handlerRounded],
112
+ [/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?$/, handlerRounded],
113
+ [/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?(?:-([^-]+))?$/, handlerRounded]
114
+ ];
115
+ var borderStyles = [
116
+ ["border-solid", { "border-style": "solid" }],
117
+ ["border-dashed", { "border-style": "dashed" }],
118
+ ["border-dotted", { "border-style": "dotted" }],
119
+ ["border-double", { "border-style": "double" }],
120
+ ["border-none", { "border-style": "none" }]
121
+ ];
122
+ function handlerBorder([, a, b]) {
123
+ const [d, s = "1"] = directionMap[a] ? [a, b] : ["", a];
124
+ const v = import_core.handler.bracket.border(s);
125
+ if (v != null) {
126
+ return [
127
+ ...directionMap[d].map((i) => [`border${i}-width`, v]),
128
+ ["border-style", "solid"]
129
+ ];
130
+ }
131
+ }
132
+ function handlerRounded([, a, b], theme2) {
133
+ var _a;
134
+ const [d, s = "DEFAULT"] = cornerMap[a] ? [a, b] : ["", a];
135
+ const v = ((_a = theme2.borderRadius) == null ? void 0 : _a[s]) || import_core.handler.bracket.fraction.size(s);
136
+ if (v != null)
137
+ return cornerMap[d].map((i) => [`border${i}-radius`, v]);
138
+ }
139
+
140
+ // ../preset-uno/src/rules/colors.ts
141
+ var import_core2 = __toModule(require("@unocss/core"));
142
+ var colorResolver = (attribute, varName) => ([, body], theme2) => {
143
+ var _a;
144
+ const [main, opacity2] = body.split("/");
145
+ const [name, no = "DEFAULT"] = main.split(/(?<=[a-z])-?(?=[0-9])/g);
146
+ if (!name)
147
+ return;
148
+ let color;
149
+ const bracket = import_core2.handler.bracket(main) || main;
150
+ if (bracket.startsWith("#"))
151
+ color = bracket.slice(1);
152
+ if (bracket.startsWith("hex-"))
153
+ color = bracket.slice(4);
154
+ if (!color) {
155
+ if (name === "transparent") {
156
+ return {
157
+ [attribute]: "transparent"
158
+ };
159
+ } else if (name === "inherit") {
160
+ return {
161
+ [attribute]: "inherit"
162
+ };
163
+ } else if (name === "current") {
164
+ return {
165
+ [attribute]: "currentColor"
166
+ };
167
+ }
168
+ color = (_a = theme2.colors) == null ? void 0 : _a[name];
169
+ if (no && color && typeof color !== "string")
170
+ color = color[no];
171
+ }
172
+ if (typeof color !== "string")
173
+ return;
174
+ const rgba = (0, import_core2.hex2rgba)(color);
175
+ if (rgba) {
176
+ const a = opacity2 ? parseFloat(opacity2) / 100 : rgba[3];
177
+ if (a != null && !Number.isNaN(a)) {
178
+ rgba[3] = a;
179
+ return {
180
+ [attribute]: `rgba(${rgba.join(",")})`
181
+ };
182
+ } else {
183
+ return {
184
+ [`--un-${varName}-opacity`]: 1,
185
+ [attribute]: `rgba(${rgba.slice(0, 3).join(",")},var(--un-${varName}-opacity))`
186
+ };
187
+ }
188
+ }
189
+ };
190
+ var opacity = [
191
+ [/^op(?:acity)?-?(\d+)$/, ([, d]) => ({ opacity: import_core2.handler.percent(d) })]
192
+ ];
193
+ var textColors = [
194
+ [/^(?:text|color|c)-(.+)$/, colorResolver("color", "text")],
195
+ [/^(?:text|color|c)-op(?:acity)?-?(\d+)$/m, ([, opacity2]) => ({ "--un-text-opacity": import_core2.handler.percent(opacity2) })]
196
+ ];
197
+ var bgColors = [
198
+ [/^bg-(.+)$/, colorResolver("background-color", "bg")],
199
+ [/^bg-op(?:acity)?-?(\d+)$/m, ([, opacity2]) => ({ "--un-bg-opacity": import_core2.handler.percent(opacity2) })]
200
+ ];
201
+ var borderColors = [
202
+ [/^border-(.+)$/, colorResolver("border-color", "border")],
203
+ [/^border-op(?:acity)?-?(\d+)$/m, ([, opacity2]) => ({ "--un-border-opacity": import_core2.handler.percent(opacity2) })]
204
+ ];
205
+
206
+ // ../preset-uno/src/rules/filters.ts
207
+ var filterContnet = "var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia) var(--un-drop-shadow)";
208
+ var init = {
209
+ "--un-blur": "var(--un-empty,/*!*/ /*!*/)",
210
+ "--un-brightness": "var(--un-empty,/*!*/ /*!*/)",
211
+ "--un-contrast": "var(--un-empty,/*!*/ /*!*/)",
212
+ "--un-grayscale": "var(--un-empty,/*!*/ /*!*/)",
213
+ "--un-hue-rotate": "var(--un-empty,/*!*/ /*!*/)",
214
+ "--un-invert": "var(--un-empty,/*!*/ /*!*/)",
215
+ "--un-saturate": "var(--un-empty,/*!*/ /*!*/)",
216
+ "--un-sepia": "var(--un-empty,/*!*/ /*!*/)",
217
+ "--un-drop-shadow": "var(--un-empty,/*!*/ /*!*/)",
218
+ "filter": filterContnet
219
+ };
220
+ var filters = [
221
+ ["filter", init],
222
+ ["filter-none", { filter: "none" }],
223
+ [/^blur(?:-(\d+))?$/, ([, d]) => ({ "--un-blur": `blur(${d}px)`, "filter": filterContnet })],
224
+ ["invert", { "--un-invert": "invert(100%)" }]
225
+ ];
226
+
227
+ // ../preset-uno/src/rules/flex.ts
228
+ var flex = [
229
+ ["flex-col", { "flex-direction": "column" }],
230
+ ["flex-col-reverse", { "flex-direction": "column-reverse" }],
231
+ ["flex-row", { "flex-direction": "row" }],
232
+ ["flex-row-reverse", { "flex-direction": "row-reverse" }],
233
+ ["flex-wrap", { "flex-wrap": "wrap" }],
234
+ ["flex-wrap-reverse", { "flex-wrap": "wrap-reverse" }],
235
+ ["flex-nowrap", { "flex-wrap": "nowrap" }],
236
+ ["flex-1", { flex: "1 1 0%" }],
237
+ ["flex-auto", { flex: "1 1 auto" }],
238
+ ["flex-initial", { flex: "0 1 auto" }],
239
+ ["flex-none", { flex: "none" }],
240
+ [/^flex-\[(.+)\]$/, ([, d]) => ({ flex: d })],
241
+ ["flex-grow", { "flex-grow": 1 }],
242
+ ["flex-grow-0", { "flex-grow": 0 }],
243
+ ["flex-shrink", { "flex-shrink": 1 }],
244
+ ["flex-shrink-0", { "flex-shrink": 0 }],
245
+ ["flex", { display: "flex" }],
246
+ ["inline-flex", { display: "inline-flex" }]
247
+ ];
248
+
249
+ // ../preset-uno/src/rules/font.ts
250
+ var import_core3 = __toModule(require("@unocss/core"));
251
+ var fonts = [
252
+ [/^font-(\w+)$/, ([, d], theme2) => {
253
+ var _a;
254
+ const font = (_a = theme2.fontFamily) == null ? void 0 : _a[d];
255
+ if (font) {
256
+ return {
257
+ "font-family": font
258
+ };
259
+ }
260
+ }]
261
+ ];
262
+ var weightMap = {
263
+ thin: "100",
264
+ extralight: "200",
265
+ light: "300",
266
+ normal: "400",
267
+ medium: "500",
268
+ semibold: "600",
269
+ bold: "700",
270
+ extrabold: "800",
271
+ black: "900"
272
+ };
273
+ var fontSizes = [
274
+ [/^text-([^-]+)$/, ([, s = "base"], theme2) => {
275
+ var _a;
276
+ const result = (0, import_core3.toArray)(((_a = theme2.fontSize) == null ? void 0 : _a[s]) || import_core3.handler.bracket.size(s));
277
+ if (result == null ? void 0 : result[0]) {
278
+ const [size, height = "1"] = result;
279
+ return {
280
+ "font-size": size,
281
+ "line-height": height
282
+ };
283
+ }
284
+ }]
285
+ ];
286
+ var fontWeights = [
287
+ [/^(?:font|fw)-?([^-]+)$/, ([, s]) => {
288
+ const v = weightMap[s] || import_core3.handler.number(s);
289
+ if (v)
290
+ return { "font-weight": v };
291
+ }]
292
+ ];
293
+ var leadings = [
294
+ [/^(?:leading|lh)-([^-]+)$/, ([, s], theme2) => {
295
+ var _a;
296
+ const v = ((_a = theme2.lineHeight) == null ? void 0 : _a[s]) || import_core3.handler.bracket.size(s);
297
+ if (v !== null)
298
+ return { "line-height": v };
299
+ }]
300
+ ];
301
+ var trackings = [
302
+ [/^tracking-([^-]+)$/, ([, s], theme2) => {
303
+ var _a;
304
+ const v = ((_a = theme2.letterSpacing) == null ? void 0 : _a[s]) || import_core3.handler.bracket.size(s);
305
+ if (v !== null)
306
+ return { "letter-spacing": v };
307
+ }]
308
+ ];
309
+
310
+ // ../preset-uno/src/rules/gap.ts
311
+ var import_core4 = __toModule(require("@unocss/core"));
312
+ var gaps = [
313
+ [/^(?:flex-|grid-)?gap-([^-]+)$/, ([, s]) => {
314
+ const v = import_core4.handler.bracket.size(s);
315
+ if (v != null) {
316
+ return {
317
+ "grid-gap": v,
318
+ "gap": v
319
+ };
320
+ }
321
+ }],
322
+ [/^(?:flex-|grid-)?gap-x-([^-]+)$/, ([, s]) => {
323
+ const v = import_core4.handler.bracket.size(s);
324
+ if (v != null) {
325
+ return {
326
+ "grid-column-gap": v,
327
+ "column-gap": v
328
+ };
329
+ }
330
+ }],
331
+ [/^(?:flex-|grid-)?gap-y-([^-]+)$/, ([, s]) => {
332
+ const v = import_core4.handler.bracket.size(s);
333
+ if (v != null) {
334
+ return {
335
+ "grid-row-gap": v,
336
+ "row-gap": v
337
+ };
338
+ }
339
+ }]
340
+ ];
341
+
342
+ // ../preset-uno/src/rules/grid.ts
343
+ var grids = [
344
+ ["grid", { display: "grid" }],
345
+ ["inline-grid", { display: "inline-grid" }],
346
+ [/^grid-cols-(\d+)$/, ([, d]) => ({ "grid-template-columns": `repeat(${d}, minmax(0, 1fr))` })],
347
+ [/^grid-rows-(\d+)$/, ([, d]) => ({ "grid-template-rows": `repeat(${d}, minmax(0, 1fr))` })],
348
+ [/^grid-cols-\[(.+)\]$/, ([, v]) => ({ "grid-template-columns": v.replace(/,/g, " ") })],
349
+ [/^grid-rows-\[(.+)\]$/, ([, v]) => ({ "grid-template-rows": v.replace(/,/g, " ") })]
350
+ ];
351
+
352
+ // ../preset-uno/src/rules/layouts.ts
353
+ var overflowValues = [
354
+ "auto",
355
+ "hidden",
356
+ "visible",
357
+ "scroll"
358
+ ];
359
+ var overflows = [
360
+ [/^overflow-(.+)$/, ([, v]) => overflowValues.includes(v) ? { overflow: v } : void 0],
361
+ [/^overflow-([xy])-(.+)$/, ([, d, v]) => overflowValues.includes(v) ? { [`overflow-${d}`]: v } : void 0]
362
+ ];
363
+
364
+ // ../preset-uno/src/rules/positions.ts
365
+ var import_core5 = __toModule(require("@unocss/core"));
366
+ var positions = [
367
+ ["relative", { position: "relative" }],
368
+ ["absolute", { position: "absolute" }],
369
+ ["fixed", { position: "fixed" }]
370
+ ];
371
+ var justifies = [
372
+ ["justify-start", { "justify-content": "flex-start" }],
373
+ ["justify-end", { "justify-content": "flex-end" }],
374
+ ["justify-center", { "justify-content": "center" }],
375
+ ["justify-between", { "justify-content": "space-between" }],
376
+ ["justify-around", { "justify-content": "space-around" }],
377
+ ["justify-evenly", { "justify-content": "space-evenly" }]
378
+ ];
379
+ var orders = [
380
+ [/^order-(.+)$/, ([, v]) => ({ order: { first: "-9999", last: "9999", none: "0" }[v] || import_core5.handler.bracket.number(v) })]
381
+ ];
382
+ var basicSet = ["auto", "start", "end", "center", "stretch"];
383
+ var justifyItems = basicSet.map((i) => [`justify-items-${i}`, { "justify-items": i }]);
384
+ var justifySelfs = basicSet.map((i) => [`justify-self-${i}`, { "justify-self": i }]);
385
+ var alignContents = [
386
+ ["content-start", { "align-content": "flex-start" }],
387
+ ["content-end", { "align-content": "flex-end" }],
388
+ ["content-center", { "align-content": "center" }],
389
+ ["content-between", { "align-content": "space-between" }],
390
+ ["content-around", { "align-content": "space-around" }],
391
+ ["content-evenly", { "align-content": "space-evenly" }]
392
+ ];
393
+ var alignItems = [
394
+ ["items-start", { "align-items": "flex-start" }],
395
+ ["items-end", { "align-items": "flex-end" }],
396
+ ["items-center", { "align-items": "center" }],
397
+ ["items-baseline", { "align-items": "baseline" }],
398
+ ["items-stretch", { "align-items": "stretch" }]
399
+ ];
400
+ var alignSelfs = [
401
+ ["self-auto", { "align-self": "auto" }],
402
+ ["self-start", { "align-self": "flex-start" }],
403
+ ["self-end", { "align-self": "flex-end" }],
404
+ ["self-center", { "align-self": "center" }],
405
+ ["self-stretch", { "align-items": "stretch" }]
406
+ ];
407
+ var placeContents = [
408
+ ["place-content-start", { "place-content": "start" }],
409
+ ["place-content-end", { "place-content": "end" }],
410
+ ["place-content-center", { "place-content": "center" }],
411
+ ["place-content-between", { "place-content": "space-between" }],
412
+ ["place-content-around", { "place-content": "space-around" }],
413
+ ["place-content-evenly", { "place-content": "space-evenly" }],
414
+ ["place-content-stretch", { "place-content": "stretch" }]
415
+ ];
416
+ var placeItems = basicSet.map((i) => [`place-items-${i}`, { "place-items": i }]);
417
+ var placeSelfs = basicSet.map((i) => [`place-self-${i}`, { "place-self": i }]);
418
+ function handleInsetValue(v) {
419
+ var _a;
420
+ return (_a = { auto: "auto", full: "100%" }[v]) != null ? _a : import_core5.handler.bracket.fraction.size(v);
421
+ }
422
+ var insets = [
423
+ [/^inset-(x|y)-(.+)$/, ([, d, v]) => {
424
+ const r = handleInsetValue(v);
425
+ if (r != null)
426
+ return directionMap[d].map((i) => [i.slice(1), r]);
427
+ }],
428
+ [/^(top|left|right|bottom|inset)-(.+)$/, ([, d, v]) => ({ [d]: handleInsetValue(v) })]
429
+ ];
430
+ var floats = [
431
+ [/^float-(left|right|none)$/, ([, value]) => ({ float: value })],
432
+ [/^clear-(left|right|both|none)$/, ([, value]) => ({ clear: value })]
433
+ ];
434
+ var zIndexes = [
435
+ ["z-auto", { "z-index": "auto" }],
436
+ [/^z-([^-]+)$/, ([, v]) => ({ "z-index": import_core5.handler.number(v) })]
437
+ ];
438
+ var objectPositions = [
439
+ ["object-cover", { "object-fit": "cover" }],
440
+ ["object-contain", { "object-fit": "contain" }],
441
+ ["object-fill", { "object-fit": "fill" }],
442
+ ["object-scale-down", { "object-fit": "scale-down" }],
443
+ ["object-none", { "object-fit": "none" }],
444
+ ["object-bottom", { "object-position": "bottom" }],
445
+ ["object-top", { "object-position": "top" }],
446
+ ["object-right", { "object-position": "right" }],
447
+ ["object-left", { "object-position": "left" }],
448
+ ["object-lb", { "object-position": "left bottom" }],
449
+ ["object-lt", { "object-position": "left top" }],
450
+ ["object-rb", { "object-position": "right bottom" }],
451
+ ["object-rt", { "object-position": "right top" }]
452
+ ];
453
+
454
+ // ../preset-uno/src/rules/size.ts
455
+ var import_core6 = __toModule(require("@unocss/core"));
456
+ var sizes = [
457
+ ["w-full", { width: "100%" }],
458
+ ["h-full", { height: "100%" }],
459
+ ["w-screen", { width: "100vw" }],
460
+ ["h-screen", { height: "100vh" }],
461
+ [/^w-([^-]+)$/, ([, s]) => ({ width: import_core6.handler.bracket.fraction.size(s) })],
462
+ [/^h-([^-]+)$/, ([, s]) => ({ height: import_core6.handler.bracket.fraction.size(s) })],
463
+ [/^max-w-([^-]+)$/, ([, s]) => ({ "max-width": import_core6.handler.bracket.fraction.size(s) })],
464
+ [/^max-h-([^-]+)$/, ([, s]) => ({ "max-height": import_core6.handler.bracket.fraction.size(s) })]
465
+ ];
466
+
467
+ // ../preset-uno/src/rules/spacing.ts
468
+ var import_core7 = __toModule(require("@unocss/core"));
469
+ var directionSize = (prefix) => ([_, direction, size]) => {
470
+ const v = import_core7.handler.bracket.size.fraction(size);
471
+ if (v)
472
+ return directionMap[direction].map((i) => [prefix + i, v]);
473
+ };
474
+ var paddings = [
475
+ [/^pa?()-?(-?[^-]+)$/, directionSize("padding")],
476
+ [/^p-?([xy])-?(-?[^-]+)$/, directionSize("padding")],
477
+ [/^p-?([rltbse])-?(-?[^-]+)$/, directionSize("padding")]
478
+ ];
479
+ var margins = [
480
+ [/^ma?()-?(-?[^-]+)$/, directionSize("margin")],
481
+ [/^m-?([xy])-?(-?[^-]+)$/, directionSize("margin")],
482
+ [/^m-?([rltbse])-?(-?[^-]+)$/, directionSize("margin")]
483
+ ];
484
+
485
+ // ../preset-uno/src/rules/static.ts
486
+ var displays = [
487
+ ["inline", { display: "inline" }],
488
+ ["block", { display: "block" }],
489
+ ["inline-block", { display: "inline-block" }],
490
+ ["table", { display: "table" }],
491
+ ["contents", { display: "contents" }],
492
+ ["flow-root", { display: "flow-root" }],
493
+ ["list-item", { display: "list-item" }],
494
+ ["hidden", { display: "none" }]
495
+ ];
496
+ var appearances = [
497
+ ["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }],
498
+ ["appearance-none", { appearance: "none" }],
499
+ ["visible", { visibility: "visible" }],
500
+ ["invisible", { visibility: "hidden" }],
501
+ ["backface-visible", { "backface-visibility": "visible" }],
502
+ ["backface-hidden", { "backface-visibility": "hidden" }]
503
+ ];
504
+ var cursors = [
505
+ [/^cursor-(.+)$/, ([, c]) => ({ cursor: c })]
506
+ ];
507
+ var pointerEvents = [
508
+ ["pointer-events-none", { "pointer-events": "none" }],
509
+ ["pointer-events-auto", { "pointer-events": "auto" }]
510
+ ];
511
+ var resizes = [
512
+ ["resize-none", { resize: "none" }],
513
+ ["resize-x", { resize: "horizontal" }],
514
+ ["resize-y", { resize: "vertical" }],
515
+ ["resize", { resize: "both" }]
516
+ ];
517
+ var userSelects = [
518
+ ["select-none", { "user-select": "none" }],
519
+ ["select-text", { "user-select": "text" }],
520
+ ["select-all", { "user-select": "all" }],
521
+ ["select-auto", { "user-select": "auto" }]
522
+ ];
523
+ var verticalAligns = [
524
+ ["vertical-baseline", { "vertical-align": "baseline" }],
525
+ ["vertical-top", { "vertical-align": "top" }],
526
+ ["vertical-middle", { "vertical-align": "middle" }],
527
+ ["vertical-text-top", { "vertical-align": "text-top" }],
528
+ ["vertical-text-bottom", { "vertical-align": "text-bottom" }]
529
+ ];
530
+ var whitespaces = [
531
+ ["whitespace-normal", { "white-space": "normal" }],
532
+ ["whitespace-nowrap", { "white-space": "nowrap" }],
533
+ ["whitespace-pre", { "white-space": "pre" }],
534
+ ["whitespace-pre-line", { "white-space": "pre-line" }],
535
+ ["whitespace-pre-wrap", { "white-space": "pre-wrap" }]
536
+ ];
537
+ var breaks = [
538
+ ["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }],
539
+ ["break-works", { "overflow-wrap": "break-word" }],
540
+ ["break-all", { "word-break": "break-all" }]
541
+ ];
542
+ var textOverflows = [
543
+ ["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }],
544
+ ["text-ellipsis", { "text-overflow": "ellipsis" }],
545
+ ["text-clip", { "text-overflow": "clip" }]
546
+ ];
547
+ var textTransforms = [
548
+ ["case-upper", { "text-transform": "uppercase" }],
549
+ ["case-lower", { "text-transform": "lowercase" }],
550
+ ["case-capital", { "text-transform": "capitalize" }],
551
+ ["case-normal", { "text-transform": "none" }]
552
+ ];
553
+ var textDecorations = [
554
+ ["underline", { "text-decoration": "underline" }],
555
+ ["line-through", { "text-decoration": "line-through" }],
556
+ ["no-underline", { "text-decoration": "none" }]
557
+ ];
558
+ var textAligns = [
559
+ ["text-center", { "text-align": "center" }],
560
+ ["text-left", { "text-align": "left" }],
561
+ ["text-right", { "text-align": "right" }],
562
+ ["text-justify", { "text-align": "justify" }]
563
+ ];
564
+
565
+ // ../preset-uno/src/rules/transform.ts
566
+ var transforms = [
567
+ [
568
+ "transform",
569
+ {
570
+ "--un-rotate": 0,
571
+ "--un-scale-x": 1,
572
+ "--un-scale-y": 1,
573
+ "--un-scale-z": 1,
574
+ "--un-skew-x": 0,
575
+ "--un-skew-y": 0,
576
+ "--un-translate-x": 0,
577
+ "--un-translate-y": 0,
578
+ "--un-translate-z": 0,
579
+ "transform": "rotate(var(--un-rotate)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z))"
580
+ }
581
+ ],
582
+ [/^translate()-([^-]+)$/, handleTranslate],
583
+ [/^translate-([xyz])-([^-]+)$/, handleTranslate],
584
+ [/^scale()-([^-]+)$/, handleScale],
585
+ [/^scale-([xyz])-([^-]+)$/, handleScale],
586
+ [/^rotate-([^-]+)(?:deg)?$/, handleRotate],
587
+ ["origin-center", { "transform-origin": "center" }],
588
+ ["origin-top", { "transform-origin": "top" }],
589
+ ["origin-top-right", { "transform-origin": "top right" }],
590
+ ["origin-right", { "transform-origin": "right" }],
591
+ ["origin-bottom-right", { "transform-origin": "bottom right" }],
592
+ ["origin-bottom", { "transform-origin": "bottom" }],
593
+ ["origin-bottom-left", { "transform-origin": "bottom left" }],
594
+ ["origin-left", { "transform-origin": "left" }],
595
+ ["origin-top-left", { "transform-origin": "top left" }]
596
+ ];
597
+ function handleTranslate([, d, b]) {
598
+ const v = src_exports.handler.bracket.size(b);
599
+ if (v != null) {
600
+ return [
601
+ ...xyzMap[d].map((i) => [`--un-translate${i}`, v])
602
+ ];
603
+ }
604
+ }
605
+ function handleScale([, d, b]) {
606
+ const v = src_exports.handler.bracket.fraction.percent(b);
607
+ if (v != null) {
608
+ return [
609
+ ...xyzMap[d].map((i) => [`--un-scale${i}`, v])
610
+ ];
611
+ }
612
+ }
613
+ function handleRotate([, b]) {
614
+ const v = src_exports.handler.bracket.number(b);
615
+ if (v != null)
616
+ return { "--un-rotate": `${v}deg` };
617
+ }
618
+
619
+ // ../preset-uno/src/rules/index.ts
620
+ var rules = [
621
+ paddings,
622
+ margins,
623
+ displays,
624
+ opacity,
625
+ bgColors,
626
+ borders,
627
+ borderColors,
628
+ borderStyles,
629
+ borderRadius,
630
+ fonts,
631
+ fontSizes,
632
+ fontWeights,
633
+ textOverflows,
634
+ textDecorations,
635
+ textTransforms,
636
+ textAligns,
637
+ textColors,
638
+ flex,
639
+ grids,
640
+ gaps,
641
+ positions,
642
+ sizes,
643
+ cursors,
644
+ appearances,
645
+ pointerEvents,
646
+ resizes,
647
+ verticalAligns,
648
+ userSelects,
649
+ whitespaces,
650
+ breaks,
651
+ trackings,
652
+ leadings,
653
+ overflows,
654
+ positions,
655
+ orders,
656
+ justifies,
657
+ justifyItems,
658
+ justifySelfs,
659
+ alignContents,
660
+ alignItems,
661
+ alignSelfs,
662
+ placeContents,
663
+ placeItems,
664
+ placeSelfs,
665
+ insets,
666
+ floats,
667
+ zIndexes,
668
+ objectPositions,
669
+ transitions,
670
+ filters,
671
+ transforms
672
+ ].flat(1);
673
+
674
+ // ../preset-uno/src/theme/colors.ts
675
+ var colors = {
676
+ black: "#000",
677
+ white: "#fff",
678
+ rose: {
679
+ 50: "#fff1f2",
680
+ 100: "#ffe4e6",
681
+ 200: "#fecdd3",
682
+ 300: "#fda4af",
683
+ 400: "#fb7185",
684
+ 500: "#f43f5e",
685
+ 600: "#e11d48",
686
+ 700: "#be123c",
687
+ 800: "#9f1239",
688
+ 900: "#881337"
689
+ },
690
+ pink: {
691
+ 50: "#fdf2f8",
692
+ 100: "#fce7f3",
693
+ 200: "#fbcfe8",
694
+ 300: "#f9a8d4",
695
+ 400: "#f472b6",
696
+ 500: "#ec4899",
697
+ 600: "#db2777",
698
+ 700: "#be185d",
699
+ 800: "#9d174d",
700
+ 900: "#831843"
701
+ },
702
+ fuchsia: {
703
+ 50: "#fdf4ff",
704
+ 100: "#fae8ff",
705
+ 200: "#f5d0fe",
706
+ 300: "#f0abfc",
707
+ 400: "#e879f9",
708
+ 500: "#d946ef",
709
+ 600: "#c026d3",
710
+ 700: "#a21caf",
711
+ 800: "#86198f",
712
+ 900: "#701a75"
713
+ },
714
+ purple: {
715
+ 50: "#faf5ff",
716
+ 100: "#f3e8ff",
717
+ 200: "#e9d5ff",
718
+ 300: "#d8b4fe",
719
+ 400: "#c084fc",
720
+ 500: "#a855f7",
721
+ 600: "#9333ea",
722
+ 700: "#7e22ce",
723
+ 800: "#6b21a8",
724
+ 900: "#581c87"
725
+ },
726
+ violet: {
727
+ 50: "#f5f3ff",
728
+ 100: "#ede9fe",
729
+ 200: "#ddd6fe",
730
+ 300: "#c4b5fd",
731
+ 400: "#a78bfa",
732
+ 500: "#8b5cf6",
733
+ 600: "#7c3aed",
734
+ 700: "#6d28d9",
735
+ 800: "#5b21b6",
736
+ 900: "#4c1d95"
737
+ },
738
+ indigo: {
739
+ 50: "#eef2ff",
740
+ 100: "#e0e7ff",
741
+ 200: "#c7d2fe",
742
+ 300: "#a5b4fc",
743
+ 400: "#818cf8",
744
+ 500: "#6366f1",
745
+ 600: "#4f46e5",
746
+ 700: "#4338ca",
747
+ 800: "#3730a3",
748
+ 900: "#312e81"
749
+ },
750
+ blue: {
751
+ 50: "#eff6ff",
752
+ 100: "#dbeafe",
753
+ 200: "#bfdbfe",
754
+ 300: "#93c5fd",
755
+ 400: "#60a5fa",
756
+ 500: "#3b82f6",
757
+ 600: "#2563eb",
758
+ 700: "#1d4ed8",
759
+ 800: "#1e40af",
760
+ 900: "#1e3a8a"
761
+ },
762
+ sky: {
763
+ 50: "#f0f9ff",
764
+ 100: "#e0f2fe",
765
+ 200: "#bae6fd",
766
+ 300: "#7dd3fc",
767
+ 400: "#38bdf8",
768
+ 500: "#0ea5e9",
769
+ 600: "#0284c7",
770
+ 700: "#0369a1",
771
+ 800: "#075985",
772
+ 900: "#0c4a6e"
773
+ },
774
+ cyan: {
775
+ 50: "#ecfeff",
776
+ 100: "#cffafe",
777
+ 200: "#a5f3fc",
778
+ 300: "#67e8f9",
779
+ 400: "#22d3ee",
780
+ 500: "#06b6d4",
781
+ 600: "#0891b2",
782
+ 700: "#0e7490",
783
+ 800: "#155e75",
784
+ 900: "#164e63"
785
+ },
786
+ teal: {
787
+ 50: "#f0fdfa",
788
+ 100: "#ccfbf1",
789
+ 200: "#99f6e4",
790
+ 300: "#5eead4",
791
+ 400: "#2dd4bf",
792
+ 500: "#14b8a6",
793
+ 600: "#0d9488",
794
+ 700: "#0f766e",
795
+ 800: "#115e59",
796
+ 900: "#134e4a"
797
+ },
798
+ emerald: {
799
+ 50: "#ecfdf5",
800
+ 100: "#d1fae5",
801
+ 200: "#a7f3d0",
802
+ 300: "#6ee7b7",
803
+ 400: "#34d399",
804
+ 500: "#10b981",
805
+ 600: "#059669",
806
+ 700: "#047857",
807
+ 800: "#065f46",
808
+ 900: "#064e3b"
809
+ },
810
+ green: {
811
+ 50: "#f0fdf4",
812
+ 100: "#dcfce7",
813
+ 200: "#bbf7d0",
814
+ 300: "#86efac",
815
+ 400: "#4ade80",
816
+ 500: "#22c55e",
817
+ 600: "#16a34a",
818
+ 700: "#15803d",
819
+ 800: "#166534",
820
+ 900: "#14532d"
821
+ },
822
+ lime: {
823
+ 50: "#f7fee7",
824
+ 100: "#ecfccb",
825
+ 200: "#d9f99d",
826
+ 300: "#bef264",
827
+ 400: "#a3e635",
828
+ 500: "#84cc16",
829
+ 600: "#65a30d",
830
+ 700: "#4d7c0f",
831
+ 800: "#3f6212",
832
+ 900: "#365314"
833
+ },
834
+ yellow: {
835
+ 50: "#fefce8",
836
+ 100: "#fef9c3",
837
+ 200: "#fef08a",
838
+ 300: "#fde047",
839
+ 400: "#facc15",
840
+ 500: "#eab308",
841
+ 600: "#ca8a04",
842
+ 700: "#a16207",
843
+ 800: "#854d0e",
844
+ 900: "#713f12"
845
+ },
846
+ amber: {
847
+ 50: "#fffbeb",
848
+ 100: "#fef3c7",
849
+ 200: "#fde68a",
850
+ 300: "#fcd34d",
851
+ 400: "#fbbf24",
852
+ 500: "#f59e0b",
853
+ 600: "#d97706",
854
+ 700: "#b45309",
855
+ 800: "#92400e",
856
+ 900: "#78350f"
857
+ },
858
+ orange: {
859
+ 50: "#fff7ed",
860
+ 100: "#ffedd5",
861
+ 200: "#fed7aa",
862
+ 300: "#fdba74",
863
+ 400: "#fb923c",
864
+ 500: "#f97316",
865
+ 600: "#ea580c",
866
+ 700: "#c2410c",
867
+ 800: "#9a3412",
868
+ 900: "#7c2d12"
869
+ },
870
+ red: {
871
+ 50: "#fef2f2",
872
+ 100: "#fee2e2",
873
+ 200: "#fecaca",
874
+ 300: "#fca5a5",
875
+ 400: "#f87171",
876
+ 500: "#ef4444",
877
+ 600: "#dc2626",
878
+ 700: "#b91c1c",
879
+ 800: "#991b1b",
880
+ 900: "#7f1d1d"
881
+ },
882
+ warmgray: {
883
+ 50: "#fafaf9",
884
+ 100: "#f5f5f4",
885
+ 200: "#e7e5e4",
886
+ 300: "#d6d3d1",
887
+ 400: "#a8a29e",
888
+ 500: "#78716c",
889
+ 600: "#57534e",
890
+ 700: "#44403c",
891
+ 800: "#292524",
892
+ 900: "#1c1917"
893
+ },
894
+ truegray: {
895
+ 50: "#fafafa",
896
+ 100: "#f5f5f5",
897
+ 200: "#e5e5e5",
898
+ 300: "#d4d4d4",
899
+ 400: "#a3a3a3",
900
+ 500: "#737373",
901
+ 600: "#525252",
902
+ 700: "#404040",
903
+ 800: "#262626",
904
+ 900: "#171717"
905
+ },
906
+ gray: {
907
+ 50: "#fafafa",
908
+ 100: "#f4f4f5",
909
+ 200: "#e4e4e7",
910
+ 300: "#d4d4d8",
911
+ 400: "#a1a1aa",
912
+ 500: "#71717a",
913
+ 600: "#52525b",
914
+ 700: "#3f3f46",
915
+ 800: "#27272a",
916
+ 900: "#18181b"
917
+ },
918
+ coolgray: {
919
+ 50: "#f9fafb",
920
+ 100: "#f3f4f6",
921
+ 200: "#e5e7eb",
922
+ 300: "#d1d5db",
923
+ 400: "#9ca3af",
924
+ 500: "#6b7280",
925
+ 600: "#4b5563",
926
+ 700: "#374151",
927
+ 800: "#1f2937",
928
+ 900: "#111827"
929
+ },
930
+ bluegray: {
931
+ 50: "#f8fafc",
932
+ 100: "#f1f5f9",
933
+ 200: "#e2e8f0",
934
+ 300: "#cbd5e1",
935
+ 400: "#94a3b8",
936
+ 500: "#64748b",
937
+ 600: "#475569",
938
+ 700: "#334155",
939
+ 800: "#1e293b",
940
+ 900: "#0f172a"
941
+ },
942
+ light: {
943
+ 50: "#fdfdfd",
944
+ 100: "#fcfcfc",
945
+ 200: "#fafafa",
946
+ 300: "#f8f9fa",
947
+ 400: "#f6f6f6",
948
+ 500: "#f2f2f2",
949
+ 600: "#f1f3f5",
950
+ 700: "#e9ecef",
951
+ 800: "#dee2e6",
952
+ 900: "#dde1e3"
953
+ },
954
+ dark: {
955
+ 50: "#4a4a4a",
956
+ 100: "#3c3c3c",
957
+ 200: "#323232",
958
+ 300: "#2d2d2d",
959
+ 400: "#222222",
960
+ 500: "#1f1f1f",
961
+ 600: "#1c1c1e",
962
+ 700: "#1b1b1b",
963
+ 800: "#181818",
964
+ 900: "#0f0f0f"
965
+ }
966
+ };
967
+ Object.values(colors).forEach((color) => {
968
+ if (typeof color !== "string") {
969
+ color.DEFAULT = color.DEFAULT || color[400];
970
+ Object.keys(color).forEach((key) => {
971
+ const short = +key / 100;
972
+ if (short === Math.round(short))
973
+ color[short] = color[key];
974
+ });
975
+ }
976
+ });
977
+
978
+ // ../preset-uno/src/theme/font.ts
979
+ var fontFamily = {
980
+ sans: [
981
+ "ui-sans-serif",
982
+ "system-ui",
983
+ "-apple-system",
984
+ "BlinkMacSystemFont",
985
+ '"Segoe UI"',
986
+ "Roboto",
987
+ '"Helvetica Neue"',
988
+ "Arial",
989
+ '"Noto Sans"',
990
+ "sans-serif",
991
+ '"Apple Color Emoji"',
992
+ '"Segoe UI Emoji"',
993
+ '"Segoe UI Symbol"',
994
+ '"Noto Color Emoji"'
995
+ ].join(","),
996
+ serif: [
997
+ "ui-serif",
998
+ "Georgia",
999
+ "Cambria",
1000
+ '"Times New Roman"',
1001
+ "Times",
1002
+ "serif"
1003
+ ].join(","),
1004
+ mono: [
1005
+ "ui-monospace",
1006
+ "SFMono-Regular",
1007
+ "Menlo",
1008
+ "Monaco",
1009
+ "Consolas",
1010
+ '"Liberation Mono"',
1011
+ '"Courier New"',
1012
+ "monospace"
1013
+ ].join(",")
1014
+ };
1015
+ var fontSize = {
1016
+ "xs": ["0.75rem", "1rem"],
1017
+ "sm": ["0.875rem", "1.25rem"],
1018
+ "base": ["1rem", "1.5rem"],
1019
+ "lg": ["1.125rem", "1.75rem"],
1020
+ "xl": ["1.25rem", "1.75rem"],
1021
+ "2xl": ["1.5rem", "2rem"],
1022
+ "3xl": ["1.875rem", "2.25rem"],
1023
+ "4xl": ["2.25rem", "2.5rem"],
1024
+ "5xl": ["3rem", "1"],
1025
+ "6xl": ["3.75rem", "1"],
1026
+ "7xl": ["4.5rem", "1"],
1027
+ "8xl": ["6rem", "1"],
1028
+ "9xl": ["8rem", "1"]
1029
+ };
1030
+ var lineHeight = {
1031
+ none: "1",
1032
+ tight: "1.25",
1033
+ snug: "1.375",
1034
+ normal: "1.5",
1035
+ relaxed: "1.625",
1036
+ loose: "2"
1037
+ };
1038
+ var letterSpacing = {
1039
+ tighter: "-0.05em",
1040
+ tight: "-0.025em",
1041
+ normal: "0em",
1042
+ wide: "0.025em",
1043
+ wider: "0.05em",
1044
+ widest: "0.1em"
1045
+ };
1046
+
1047
+ // ../preset-uno/src/theme/index.ts
1048
+ var breakpoints = {
1049
+ "sm": "640px",
1050
+ "md": "768px",
1051
+ "lg": "1024px",
1052
+ "xl": "1280px",
1053
+ "2xl": "1536px"
1054
+ };
1055
+ var borderRadius2 = {
1056
+ "DEFAULT": "0.25rem",
1057
+ "none": "0px",
1058
+ "sm": "0.125rem",
1059
+ "md": "0.375rem",
1060
+ "lg": "0.5rem",
1061
+ "xl": "0.75rem",
1062
+ "2xl": "1rem",
1063
+ "3xl": "1.5rem",
1064
+ "full": "9999px"
1065
+ };
1066
+ var theme = {
1067
+ colors,
1068
+ fontFamily,
1069
+ fontSize,
1070
+ breakpoints,
1071
+ borderRadius: borderRadius2,
1072
+ lineHeight,
1073
+ letterSpacing
1074
+ };
1075
+
1076
+ // ../preset-uno/src/variants/breakpoints.ts
1077
+ var regexCache = {};
1078
+ var variantBreakpoints = {
1079
+ match(input, theme2) {
1080
+ for (const point of Object.keys(theme2.breakpoints || {})) {
1081
+ if (!regexCache[point])
1082
+ regexCache[point] = new RegExp(`^((?:lt-)?${point}[:-])`);
1083
+ const match = input.match(regexCache[point]);
1084
+ if (match)
1085
+ return input.slice(match[1].length);
1086
+ }
1087
+ },
1088
+ mediaQuery(input, theme2) {
1089
+ var _a;
1090
+ const [, d, s] = input.match(/^(lt-)?(\w+)[:-]/) || [];
1091
+ if (!s)
1092
+ return;
1093
+ let direction = "min";
1094
+ if (d === "lt-")
1095
+ direction = "max";
1096
+ const point = (_a = theme2.breakpoints) == null ? void 0 : _a[s];
1097
+ if (point)
1098
+ return `@media (${direction}-width: ${point})`;
1099
+ }
1100
+ };
1101
+
1102
+ // ../core/src/utils/basic.ts
1103
+ function toArray2(value = []) {
1104
+ return Array.isArray(value) ? value : [value];
1105
+ }
1106
+
1107
+ // ../core/src/utils/variant.ts
1108
+ var variantMatcher = (name) => {
1109
+ const length = name.length + 1;
1110
+ const re = new RegExp(`^${name}[:-]`);
1111
+ return (input) => input.match(re) ? input.slice(length) : void 0;
1112
+ };
1113
+
1114
+ // ../preset-uno/src/variants/children.ts
1115
+ var variantChildren = [
1116
+ {
1117
+ match: variantMatcher("children"),
1118
+ selector: (input) => `${input} > *`
1119
+ },
1120
+ {
1121
+ match: variantMatcher("all"),
1122
+ selector: (input) => `${input} *`
1123
+ }
1124
+ ];
1125
+
1126
+ // ../preset-uno/src/variants/dark.ts
1127
+ var variantColorsClass = [
1128
+ {
1129
+ match: variantMatcher("dark"),
1130
+ selector: (input) => `.dark $$ ${input}`
1131
+ },
1132
+ {
1133
+ match: variantMatcher("light"),
1134
+ selector: (input) => `.light $$ ${input}`
1135
+ }
1136
+ ];
1137
+ var variantColorsMedia = [
1138
+ {
1139
+ match: variantMatcher("dark"),
1140
+ mediaQuery: () => "@media (prefers-color-scheme: dark)"
1141
+ },
1142
+ {
1143
+ match: variantMatcher("light"),
1144
+ mediaQuery: () => "@media (prefers-color-scheme: light)"
1145
+ }
1146
+ ];
1147
+
1148
+ // ../preset-uno/src/variants/pseudo.ts
1149
+ function createPseudoClassVariant(name, pseudo = name) {
1150
+ return [
1151
+ {
1152
+ match: variantMatcher(name),
1153
+ selector: (input) => `${input}:${pseudo}`
1154
+ },
1155
+ {
1156
+ match: variantMatcher(`not-${name}`),
1157
+ selector: (input) => `${input}:not(:${pseudo})`
1158
+ },
1159
+ {
1160
+ match: variantMatcher(`group-${name}`),
1161
+ selector: (input) => `.group:${pseudo} ${input}`
1162
+ }
1163
+ ];
1164
+ }
1165
+ function createPseudoElementVariant(name) {
1166
+ return {
1167
+ match: variantMatcher(name),
1168
+ selector: (input) => `${input}::${name}`
1169
+ };
1170
+ }
1171
+ var variantPseudoClasses = [
1172
+ "active",
1173
+ "checked",
1174
+ "default",
1175
+ "empty",
1176
+ "enabled",
1177
+ "first-of-type",
1178
+ "first",
1179
+ "focus-visible",
1180
+ "focus-within",
1181
+ "focus",
1182
+ "hover",
1183
+ "indeterminate",
1184
+ "invalid",
1185
+ "last-of-type",
1186
+ "last",
1187
+ "link",
1188
+ "only-child",
1189
+ "only-of-type",
1190
+ "optional",
1191
+ "placeholder-shown",
1192
+ "read-only",
1193
+ "read-write",
1194
+ "required",
1195
+ "root",
1196
+ "target",
1197
+ "valid",
1198
+ "visited",
1199
+ ["even-of-type", "nth-of-type(even)"],
1200
+ ["even", "nth-child(even)"],
1201
+ ["odd-of-type", "nth-of-type(odd)"],
1202
+ ["odd", "nth-child(odd)"]
1203
+ ].flatMap((i) => createPseudoClassVariant(...toArray2(i)));
1204
+ var variantPseudoElements = [
1205
+ "before",
1206
+ "after",
1207
+ "first-letter",
1208
+ "first-line",
1209
+ "selection"
1210
+ ].map(createPseudoElementVariant);
1211
+
1212
+ // ../preset-uno/src/variants/index.ts
1213
+ var variantImportant = {
1214
+ match: (input) => input.startsWith("!") ? input.slice(1) : void 0,
1215
+ rewrite: (input) => {
1216
+ input.forEach((v) => {
1217
+ if (v[1])
1218
+ v[1] += " !important";
1219
+ });
1220
+ return input;
1221
+ }
1222
+ };
1223
+ var variantNegative = {
1224
+ match: (input) => input.startsWith("-") ? input.slice(1) : void 0,
1225
+ rewrite: (input) => {
1226
+ input.forEach((v) => {
1227
+ var _a;
1228
+ if ((_a = v[1]) == null ? void 0 : _a.toString().match(/^\d/))
1229
+ v[1] = `-${v[1]}`;
1230
+ });
1231
+ return input;
1232
+ }
1233
+ };
1234
+ var variants = [
1235
+ variantNegative,
1236
+ variantImportant,
1237
+ variantBreakpoints,
1238
+ ...variantChildren,
1239
+ ...variantColorsClass,
1240
+ ...variantPseudoClasses,
1241
+ ...variantPseudoElements
1242
+ ];
1243
+
1244
+ // ../preset-uno/src/index.ts
1245
+ var preset = () => ({
1246
+ theme,
1247
+ rules,
1248
+ variants
1249
+ });
1250
+ var src_default = preset;
1251
+
1252
+ // ../preset-attributify/src/index.ts
1253
+ var import_core10 = __toModule(require("@unocss/core"));
1254
+
1255
+ // ../preset-attributify/src/extractor.ts
1256
+ var import_core8 = __toModule(require("@unocss/core"));
1257
+ var strippedPrefixes = [
1258
+ "v-bind:",
1259
+ ":"
1260
+ ];
1261
+ var splitterRE = /[\s'"`;]/g;
1262
+ var valuedAttributeRE = /([\w:-]+)(?:=(["'])([^\2]+?)\2)?/g;
1263
+ var extractorAttributify = (options) => (code) => {
1264
+ const result = Array.from(code.matchAll(valuedAttributeRE)).flatMap(([, name, _, content]) => {
1265
+ for (const prefix of strippedPrefixes) {
1266
+ if (name.startsWith(prefix)) {
1267
+ name = name.slice(prefix.length);
1268
+ break;
1269
+ }
1270
+ }
1271
+ if (!content) {
1272
+ if ((0, import_core8.isValidSelector)(name) && (options == null ? void 0 : options.nonValuedAttribute) !== false)
1273
+ return [`[${name}=""]`];
1274
+ return [];
1275
+ }
1276
+ if (["class", "className"].includes(name)) {
1277
+ return content.split(splitterRE).filter(import_core8.isValidSelector);
1278
+ } else {
1279
+ return content.split(splitterRE).filter(Boolean).map((v) => `[${name}~="${v}"]`);
1280
+ }
1281
+ });
1282
+ return new Set(result);
1283
+ };
1284
+
1285
+ // ../preset-attributify/src/variant.ts
1286
+ var import_core9 = __toModule(require("@unocss/core"));
1287
+ var variantsRE = /^(.+\:\!?)?(.*?)$/;
1288
+ var variantAttributify = (options = {}) => {
1289
+ var _a;
1290
+ const prefix = (_a = options.prefix) != null ? _a : "un-";
1291
+ return {
1292
+ match(input) {
1293
+ const match = (0, import_core9.isAttributifySelector)(input);
1294
+ if (!match)
1295
+ return;
1296
+ let name = match[1];
1297
+ if (name.startsWith(prefix))
1298
+ name = name.slice(prefix.length);
1299
+ else if (options.prefixedOnly)
1300
+ return;
1301
+ const content = match[2];
1302
+ const [, variants2 = "", body = content] = content.match(variantsRE) || [];
1303
+ if (body === "~" || !body)
1304
+ return `${variants2}${name}`;
1305
+ else
1306
+ return `${variants2}${name}-${body}`;
1307
+ }
1308
+ };
1309
+ };
1310
+
1311
+ // ../preset-attributify/src/index.ts
1312
+ var preset2 = (options) => {
1313
+ const variants2 = [
1314
+ variantAttributify(options)
1315
+ ];
1316
+ const extractors = [
1317
+ extractorAttributify(options)
1318
+ ];
1319
+ if (!(options == null ? void 0 : options.strict))
1320
+ extractors.unshift(import_core10.extractorSplit);
1321
+ return {
1322
+ variants: variants2,
1323
+ extractors
1324
+ };
1325
+ };
1326
+ var src_default2 = preset2;
1327
+
1328
+ // src/index.ts
1329
+ var import_config2 = __toModule(require("@unocss/config"));
1330
+
1331
+ // src/context.ts
1332
+ function createContext(uno, config, configFilepath) {
1333
+ const invalidations = [];
1334
+ const modules = new src_exports.BetterMap();
1335
+ const tokens = new Set();
1336
+ function invalidate() {
1337
+ invalidations.forEach((cb) => cb());
1338
+ }
1339
+ async function scan(code, id) {
1340
+ if (id)
1341
+ modules.set(id, code);
1342
+ await uno.applyExtractors(code, id, tokens);
1343
+ invalidate();
1344
+ }
1345
+ return {
1346
+ tokens,
1347
+ modules,
1348
+ invalidate,
1349
+ onInvalidate(fn) {
1350
+ invalidations.push(fn);
1351
+ },
1352
+ uno,
1353
+ scan,
1354
+ config,
1355
+ configFilepath
1356
+ };
1357
+ }
1358
+
1359
+ // src/chunk-build.ts
1360
+ var import_pluginutils = __toModule(require("@rollup/pluginutils"));
1361
+
1362
+ // src/utils.ts
1363
+ var import_crypto = __toModule(require("crypto"));
1364
+ var defaultExclude = [/[\/\\]node_modules[\/\\]/, /[\/\\]dist[\/\\]/, /\.(css|postcss|sass|scss|less|stylus|styl)$/];
1365
+ var defaultInclude = [/\.vue$/, /\.vue\?vue/, /\.svelte$/, /\.[jt]sx$/, /\.mdx?$/];
1366
+ function getHash(input, length = 8) {
1367
+ return (0, import_crypto.createHash)("sha256").update(input).digest("hex").substr(0, length);
1368
+ }
1369
+
1370
+ // src/chunk-build.ts
1371
+ function ChunkModeBuildPlugin({ uno, config }) {
1372
+ let cssPlugin;
1373
+ const filter = (0, import_pluginutils.createFilter)(config.include || defaultInclude, config.exclude || defaultExclude);
1374
+ const files = {};
1375
+ return {
1376
+ name: "unocss:chunk",
1377
+ apply: "build",
1378
+ enforce: "pre",
1379
+ configResolved(config2) {
1380
+ cssPlugin = config2.plugins.find((i) => i.name === "vite:css-post");
1381
+ },
1382
+ transform(code, id) {
1383
+ if (!filter(id))
1384
+ return;
1385
+ files[id] = code;
1386
+ return null;
1387
+ },
1388
+ async renderChunk(_, chunk) {
1389
+ const chunks = Object.keys(chunk.modules).map((i) => files[i]).filter(Boolean);
1390
+ if (!chunks.length)
1391
+ return null;
1392
+ const tokens = new Set();
1393
+ await Promise.all(chunks.map((c) => uno.applyExtractors(c, void 0, tokens)));
1394
+ const { css } = await uno.generate(tokens);
1395
+ const fakeCssId = `${chunk.fileName}.css`;
1396
+ await cssPlugin.transform(css, fakeCssId);
1397
+ chunk.modules[fakeCssId] = {
1398
+ code: null,
1399
+ originalLength: 0,
1400
+ removedExports: [],
1401
+ renderedExports: [],
1402
+ renderedLength: 0
1403
+ };
1404
+ return null;
1405
+ },
1406
+ async transformIndexHtml(code) {
1407
+ const { css } = await uno.generate(code);
1408
+ if (css)
1409
+ return `${code}<style>${css}</style>`;
1410
+ }
1411
+ };
1412
+ }
1413
+
1414
+ // src/global-dev.ts
1415
+ var import_pluginutils2 = __toModule(require("@rollup/pluginutils"));
1416
+ var VIRTUAL_ENTRY = "/@unocss-entry";
1417
+ var READY_CALLBACK = "/__unocss_ready";
1418
+ function GlobalModeDevPlugin({ config, uno, tokens, onInvalidate, scan }) {
1419
+ let server;
1420
+ const filter = (0, import_pluginutils2.createFilter)(config.include || defaultInclude, config.exclude || defaultExclude);
1421
+ const tasks = [];
1422
+ let timer;
1423
+ let lastUpdate = +new Date();
1424
+ function invalidate() {
1425
+ if (!server)
1426
+ return;
1427
+ const mod = server.moduleGraph.getModuleById(VIRTUAL_ENTRY);
1428
+ if (!mod)
1429
+ return;
1430
+ lastUpdate = +new Date();
1431
+ server.moduleGraph.invalidateModule(mod);
1432
+ clearTimeout(timer);
1433
+ timer = setTimeout(sendUpdate, 10);
1434
+ }
1435
+ function sendUpdate() {
1436
+ server.ws.send({
1437
+ type: "update",
1438
+ updates: [{
1439
+ acceptedPath: VIRTUAL_ENTRY,
1440
+ path: VIRTUAL_ENTRY,
1441
+ timestamp: lastUpdate,
1442
+ type: "js-update"
1443
+ }]
1444
+ });
1445
+ }
1446
+ onInvalidate(invalidate);
1447
+ return {
1448
+ name: "unocss:global",
1449
+ apply: "serve",
1450
+ enforce: "pre",
1451
+ configureServer(_server) {
1452
+ server = _server;
1453
+ server.middlewares.use(async (req, res, next) => {
1454
+ if (req.url === READY_CALLBACK) {
1455
+ let body = "";
1456
+ await new Promise((resolve) => {
1457
+ req.on("data", (chunk) => {
1458
+ body += chunk;
1459
+ });
1460
+ req.on("end", resolve);
1461
+ });
1462
+ if (+body !== lastUpdate)
1463
+ sendUpdate();
1464
+ res.statusCode = 200;
1465
+ res.end();
1466
+ } else {
1467
+ return next();
1468
+ }
1469
+ });
1470
+ },
1471
+ transform(code, id) {
1472
+ if (!filter(id))
1473
+ return;
1474
+ scan(code, id);
1475
+ return null;
1476
+ },
1477
+ resolveId(id) {
1478
+ return id === VIRTUAL_ENTRY ? id : null;
1479
+ },
1480
+ async load(id) {
1481
+ if (id !== VIRTUAL_ENTRY)
1482
+ return null;
1483
+ await Promise.all(tasks);
1484
+ const { css } = await uno.generate(tokens);
1485
+ return `
1486
+ import { updateStyle, removeStyle } from "/@vite/client";
1487
+ const id = "${VIRTUAL_ENTRY}"
1488
+ import.meta.hot.accept()
1489
+ import.meta.hot.prune(() => removeStyle(id))
1490
+ const css = ${JSON.stringify(`/* unocss */
1491
+ ${css}`)}
1492
+ updateStyle(id, css)
1493
+ export default css
1494
+ fetch('${READY_CALLBACK}', { method: 'POST', body: '${lastUpdate}' })
1495
+ `;
1496
+ },
1497
+ transformIndexHtml: {
1498
+ enforce: "pre",
1499
+ async transform(code, { path }) {
1500
+ tasks.push(scan(code, path));
1501
+ return `${code}<script src="${VIRTUAL_ENTRY}" type="module"><\/script>`;
1502
+ }
1503
+ }
1504
+ };
1505
+ }
1506
+
1507
+ // src/per-module.ts
1508
+ var import_pluginutils3 = __toModule(require("@rollup/pluginutils"));
1509
+ var VIRTUAL_PREFIX = "/@unocss/";
1510
+ var SCOPE_IMPORT_RE = / from (['"])(@unocss\/scope)\1/;
1511
+ function PerModuleModePlugin({ uno, config }) {
1512
+ const moduleMap = new Map();
1513
+ let server;
1514
+ const filter = (0, import_pluginutils3.createFilter)(config.include || defaultInclude, config.exclude || defaultExclude);
1515
+ const invalidate = (hash) => {
1516
+ if (!server)
1517
+ return;
1518
+ const id = `${VIRTUAL_PREFIX}${hash}.css`;
1519
+ const mod = server.moduleGraph.getModuleById(id);
1520
+ if (!mod)
1521
+ return;
1522
+ server.moduleGraph.invalidateModule(mod);
1523
+ server.ws.send({
1524
+ type: "update",
1525
+ updates: [{
1526
+ acceptedPath: id,
1527
+ path: id,
1528
+ timestamp: +Date.now(),
1529
+ type: "js-update"
1530
+ }]
1531
+ });
1532
+ };
1533
+ return {
1534
+ name: "unocss:module-scope",
1535
+ enforce: "post",
1536
+ configureServer(_server) {
1537
+ server = _server;
1538
+ },
1539
+ async transform(code, id) {
1540
+ if (!filter(id))
1541
+ return;
1542
+ const hash = getHash(id);
1543
+ const hasScope = code.match(SCOPE_IMPORT_RE);
1544
+ const { css } = await uno.generate(code, id, hasScope ? `.${hash}` : void 0);
1545
+ if (!css && !hasScope)
1546
+ return null;
1547
+ if (hasScope)
1548
+ code = code.replace(SCOPE_IMPORT_RE, ` from 'data:text/javascript;base64,${Buffer.from(`export default () => "${hash}"`).toString("base64")}'`);
1549
+ moduleMap.set(hash, [id, css]);
1550
+ invalidate(hash);
1551
+ return {
1552
+ code: `import "${VIRTUAL_PREFIX}${hash}.css";${code}`,
1553
+ map: null
1554
+ };
1555
+ },
1556
+ resolveId(id) {
1557
+ return id.startsWith(VIRTUAL_PREFIX) ? id : null;
1558
+ },
1559
+ load(id) {
1560
+ if (!id.startsWith(VIRTUAL_PREFIX))
1561
+ return null;
1562
+ const hash = id.slice(VIRTUAL_PREFIX.length, -".css".length);
1563
+ const [source, css] = moduleMap.get(hash) || [];
1564
+ if (source)
1565
+ this.addWatchFile(source);
1566
+ return `
1567
+ /* unocss ${source} */
1568
+ ${css}`;
1569
+ }
1570
+ };
1571
+ }
1572
+
1573
+ // src/vue-scoped.ts
1574
+ var import_pluginutils4 = __toModule(require("@rollup/pluginutils"));
1575
+ function VueScopedPlugin({ uno, config }) {
1576
+ const filter = (0, import_pluginutils4.createFilter)(config.include || [/\.vue$/], config.exclude || defaultExclude);
1577
+ async function transformSFC(code) {
1578
+ const { css } = await uno.generate(code);
1579
+ if (!css)
1580
+ return null;
1581
+ return `${code}
1582
+ <style scoped>${css}</style>`;
1583
+ }
1584
+ return {
1585
+ name: "unocss:vue-scoped",
1586
+ enforce: "pre",
1587
+ transform(code, id) {
1588
+ if (!filter(id))
1589
+ return;
1590
+ return transformSFC(code);
1591
+ },
1592
+ handleHotUpdate(ctx) {
1593
+ const read = ctx.read;
1594
+ if (filter(ctx.file)) {
1595
+ ctx.read = async () => {
1596
+ const code = await read();
1597
+ return await transformSFC(code) || code;
1598
+ };
1599
+ }
1600
+ }
1601
+ };
1602
+ }
1603
+
1604
+ // src/global-build.ts
1605
+ var import_pluginutils5 = __toModule(require("@rollup/pluginutils"));
1606
+ var VIRTUAL_ENTRY2 = "/@unocss/entry.css";
1607
+ var PLACEHOLDER = "#--unocss--{--unocss:true}";
1608
+ var PLACEHOLDER_RE = /#--unocss--\s*{\s*--unocss:\s*true;?\s*}/;
1609
+ function GlobalModeBuildPlugin({ uno, config, scan, tokens }) {
1610
+ const filter = (0, import_pluginutils5.createFilter)(config.include || defaultInclude, config.exclude || defaultExclude);
1611
+ const tasks = [];
1612
+ return [
1613
+ {
1614
+ name: "unocss:global:build:scan",
1615
+ apply: "build",
1616
+ enforce: "pre",
1617
+ transform(code, id) {
1618
+ if (!filter(id))
1619
+ return;
1620
+ tasks.push(scan(code, id));
1621
+ return null;
1622
+ },
1623
+ resolveId(id) {
1624
+ return id === VIRTUAL_ENTRY2 ? id : null;
1625
+ },
1626
+ async load(id) {
1627
+ if (id !== VIRTUAL_ENTRY2)
1628
+ return null;
1629
+ return PLACEHOLDER;
1630
+ },
1631
+ transformIndexHtml: {
1632
+ enforce: "pre",
1633
+ transform(code, { path }) {
1634
+ tasks.push(scan(code, path));
1635
+ return `${code}<script src="${VIRTUAL_ENTRY2}" type="module"><\/script>`;
1636
+ }
1637
+ }
1638
+ },
1639
+ {
1640
+ name: "unocss:global:build:generate",
1641
+ apply(options, { command }) {
1642
+ var _a;
1643
+ return command === "build" && !((_a = options.build) == null ? void 0 : _a.ssr);
1644
+ },
1645
+ enforce: "post",
1646
+ async generateBundle(options, bundle) {
1647
+ const keys = Object.keys(bundle).filter((i) => i.endsWith(".css"));
1648
+ await Promise.all(tasks);
1649
+ const { css } = await uno.generate(tokens);
1650
+ let replaced = false;
1651
+ if (!css)
1652
+ return;
1653
+ for (const key of keys) {
1654
+ const chunk = bundle[key];
1655
+ if (chunk.type === "asset" && typeof chunk.source === "string") {
1656
+ if (PLACEHOLDER_RE.test(chunk.source)) {
1657
+ chunk.source = chunk.source.replace(PLACEHOLDER_RE, css);
1658
+ replaced = true;
1659
+ }
1660
+ }
1661
+ }
1662
+ if (!replaced)
1663
+ this.error(new Error("[unocss] does not found CSS placeholder in the generated chunks,\nthis is likely an internal bug of unocss vite plugin"));
1664
+ }
1665
+ }
1666
+ ];
1667
+ }
1668
+
1669
+ // src/config-hmr.ts
1670
+ var import_config = __toModule(require("@unocss/config"));
1671
+ function ConfigHMRPlugin({ uno, configFilepath: filepath, invalidate, tokens, modules }) {
1672
+ if (!filepath)
1673
+ return;
1674
+ return {
1675
+ name: "unocss:config",
1676
+ configureServer(server) {
1677
+ server.watcher.add(filepath);
1678
+ server.watcher.on("change", async (p) => {
1679
+ if (p !== filepath)
1680
+ return;
1681
+ uno.setConfig((0, import_config.loadConfig)(filepath).config);
1682
+ tokens.clear();
1683
+ await Promise.all(modules.map((code, id) => uno.applyExtractors(code, id, tokens)));
1684
+ invalidate();
1685
+ });
1686
+ }
1687
+ };
1688
+ }
1689
+
1690
+ // src/index.ts
1691
+ function UnocssPlugin(configOrPath, defaults = {
1692
+ presets: [
1693
+ src_default()
1694
+ ]
1695
+ }) {
1696
+ var _a;
1697
+ const { config = {}, filepath } = (0, import_config2.loadConfig)(configOrPath);
1698
+ const mode = (_a = config.mode) != null ? _a : "global";
1699
+ const uno = (0, src_exports.createGenerator)(config, defaults);
1700
+ const ctx = createContext(uno, config, filepath);
1701
+ const plugins = [
1702
+ ConfigHMRPlugin(ctx)
1703
+ ];
1704
+ if (mode === "per-module") {
1705
+ plugins.push(PerModuleModePlugin(ctx));
1706
+ } else if (mode === "vue-scoped") {
1707
+ plugins.push(VueScopedPlugin(ctx));
1708
+ } else if (mode === "global") {
1709
+ plugins.push(...GlobalModeBuildPlugin(ctx), GlobalModeDevPlugin(ctx));
1710
+ } else if (mode === "dist-chunk") {
1711
+ plugins.push(ChunkModeBuildPlugin(ctx), GlobalModeDevPlugin(ctx));
1712
+ } else {
1713
+ throw new Error(`[unocss] unknown mode "${mode}"`);
1714
+ }
1715
+ return plugins.filter(Boolean);
1716
+ }
1717
+ // Annotate the CommonJS export names for ESM import in node:
1718
+ 0 && (module.exports = {
1719
+ ChunkModeBuildPlugin,
1720
+ GlobalModeDevPlugin,
1721
+ PerModuleModePlugin,
1722
+ VueScopedPlugin
1723
+ });