@vinicunca/unocss-preset 1.44.0 → 1.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{akar-BG7oGPRI.mjs → akar-VedW04rH.mjs} +2 -6
- package/dist/{animation-DqL0WQgX.mjs → animation-DsnEDm70.mjs} +3 -11
- package/dist/{constants-D0-2LDV-.mjs → constants-CD9LkNQP.mjs} +11 -14
- package/dist/{fluid-3hh6B64T.mjs → fluid-vyZzun_V.mjs} +1 -9
- package/dist/index.d.mts +29 -7
- package/dist/index.mjs +10 -16
- package/dist/{magic-css-CRIcABfg.mjs → magic-css-DVWebgFO.mjs} +1 -3
- package/dist/{meta-C6h3diDY.mjs → meta-BWU-BFPZ.mjs} +1 -2
- package/dist/{scrollbar-CL2RfoWc.mjs → scrollbar-CdK-zPqW.mjs} +2 -4
- package/dist/{transformer-alias-BwevKlDD.mjs → transformer-alias-CUUXiUed.mjs} +3 -5
- package/package.json +26 -27
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { i as compressCSS, t as DEFAULT_AKAR_OPTIONS } from "./constants-
|
|
1
|
+
import { i as compressCSS, t as DEFAULT_AKAR_OPTIONS } from "./constants-CD9LkNQP.mjs";
|
|
2
2
|
import { defu } from "defu";
|
|
3
3
|
import { isObjectType, isString } from "@vinicunca/perkakas";
|
|
4
4
|
import { theme } from "unocss/preset-wind4";
|
|
5
|
-
|
|
6
5
|
//#region src/presets/akar/akar.drawer-preflights.ts
|
|
7
6
|
const drawerAkarCss = `
|
|
8
7
|
[data-akar-drawer] {
|
|
@@ -190,7 +189,6 @@ const drawerPreflight = {
|
|
|
190
189
|
layer: "preflights",
|
|
191
190
|
getCSS: () => compressCSS(drawerAkarCss)
|
|
192
191
|
};
|
|
193
|
-
|
|
194
192
|
//#endregion
|
|
195
193
|
//#region src/presets/akar/akar.theme.ts
|
|
196
194
|
const SHADES = [
|
|
@@ -259,7 +257,6 @@ function generateDynamicShades(brandKey) {
|
|
|
259
257
|
function isHexColor(value) {
|
|
260
258
|
return /^#([A-F0-9]{6}|[A-F0-9]{3})$/i.test(value);
|
|
261
259
|
}
|
|
262
|
-
|
|
263
260
|
//#endregion
|
|
264
261
|
//#region src/presets/akar/index.ts
|
|
265
262
|
function presetAkar(options) {
|
|
@@ -271,6 +268,5 @@ function presetAkar(options) {
|
|
|
271
268
|
theme: { colors: resolveAkarThemeColors(options) }
|
|
272
269
|
};
|
|
273
270
|
}
|
|
274
|
-
|
|
275
271
|
//#endregion
|
|
276
|
-
export { presetAkar };
|
|
272
|
+
export { presetAkar };
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { n as layerMeta } from "./meta-
|
|
1
|
+
import { n as layerMeta } from "./meta-BWU-BFPZ.mjs";
|
|
2
2
|
import { h } from "@unocss/preset-mini/utils";
|
|
3
|
-
|
|
4
3
|
//#region src/presets/animation/animation.entity.ts
|
|
5
4
|
const CSS_VARIABLE_PREFIX = "--vin";
|
|
6
5
|
const ENTER_ANIMATION_NAME = "vin-in";
|
|
7
6
|
const EXIT_ANIMATION_NAME = "vin-out";
|
|
8
|
-
|
|
9
7
|
//#endregion
|
|
10
8
|
//#region src/presets/animation/animation.util.ts
|
|
11
9
|
function handleSlide(val, dir) {
|
|
12
|
-
let value = h.cssvar.fraction.rem(val ||
|
|
10
|
+
let value = h.cssvar.fraction.rem(val || "100%");
|
|
13
11
|
if (!value) return [];
|
|
14
12
|
if (!value.startsWith("var(--") && ["left", "top"].includes(dir ?? "")) {
|
|
15
13
|
if (value.startsWith("-")) value = value.slice(1);
|
|
@@ -17,13 +15,11 @@ function handleSlide(val, dir) {
|
|
|
17
15
|
}
|
|
18
16
|
return [value, dir];
|
|
19
17
|
}
|
|
20
|
-
|
|
21
18
|
//#endregion
|
|
22
19
|
//#region src/presets/animation/animation.rule.ts
|
|
23
20
|
const DEFAULT_FADE_OPACITY = "0";
|
|
24
21
|
const DEFAULT_ZOOM_SCALE = "0";
|
|
25
22
|
const DEFAULT_SPIN_DEGREE = "30deg";
|
|
26
|
-
const DEFAULT_SLIDE_TRANSLATE = "100%";
|
|
27
23
|
const DIRECTIONS_AUTOCOMPLETE = "(t|b|l|r|top|bottom|left|right)";
|
|
28
24
|
const fadeRules = [[
|
|
29
25
|
/^fade-in(?:-(.+))?$/,
|
|
@@ -86,7 +82,6 @@ const animationRules = [
|
|
|
86
82
|
* So we need to run this immediately.
|
|
87
83
|
*/
|
|
88
84
|
for (const rule of animationRules) rule[2] = Object.assign(rule[2] || {}, layerMeta);
|
|
89
|
-
|
|
90
85
|
//#endregion
|
|
91
86
|
//#region src/presets/animation/animation.shortcut.ts
|
|
92
87
|
function animationShortcuts(options) {
|
|
@@ -127,14 +122,12 @@ function animationShortcuts(options) {
|
|
|
127
122
|
{ autocomplete: "animate-out" }
|
|
128
123
|
]];
|
|
129
124
|
}
|
|
130
|
-
|
|
131
125
|
//#endregion
|
|
132
126
|
//#region src/presets/animation/animation.theme.ts
|
|
133
127
|
const animationTheme = { keyframes: {
|
|
134
128
|
[ENTER_ANIMATION_NAME]: `{from{opacity:var(${CSS_VARIABLE_PREFIX}-enter-opacity,1);transform:translate3d(var(${CSS_VARIABLE_PREFIX}-enter-translate-x,0),var(${CSS_VARIABLE_PREFIX}-enter-translate-y,0),0) scale3d(var(${CSS_VARIABLE_PREFIX}-enter-scale,1),var(${CSS_VARIABLE_PREFIX}-enter-scale,1),var(${CSS_VARIABLE_PREFIX}-enter-scale,1)) rotate(var(${CSS_VARIABLE_PREFIX}-enter-rotate,0))}}`,
|
|
135
129
|
[EXIT_ANIMATION_NAME]: `{to{opacity:var(${CSS_VARIABLE_PREFIX}-exit-opacity,1);transform:translate3d(var(${CSS_VARIABLE_PREFIX}-exit-translate-x,0),var(${CSS_VARIABLE_PREFIX}-exit-translate-y,0),0) scale3d(var(${CSS_VARIABLE_PREFIX}-exit-scale,1),var(${CSS_VARIABLE_PREFIX}-exit-scale,1),var(${CSS_VARIABLE_PREFIX}-exit-scale,1)) rotate(var(${CSS_VARIABLE_PREFIX}-exit-rotate,0))}}`
|
|
136
130
|
} };
|
|
137
|
-
|
|
138
131
|
//#endregion
|
|
139
132
|
//#region src/presets/animation/index.ts
|
|
140
133
|
function presetAnimation(options) {
|
|
@@ -145,6 +138,5 @@ function presetAnimation(options) {
|
|
|
145
138
|
rules: [...animationRules]
|
|
146
139
|
};
|
|
147
140
|
}
|
|
148
|
-
|
|
149
141
|
//#endregion
|
|
150
|
-
export { presetAnimation };
|
|
142
|
+
export { presetAnimation };
|
|
@@ -84,7 +84,6 @@ function camelToHyphen(str) {
|
|
|
84
84
|
function compressCSS(css) {
|
|
85
85
|
return css.replace(/\s+/g, " ").replace(/\/\*[\s\S]*?\*\//g, "");
|
|
86
86
|
}
|
|
87
|
-
|
|
88
87
|
//#endregion
|
|
89
88
|
//#region src/constants.ts
|
|
90
89
|
const DEFAULT_OPTIONS = {
|
|
@@ -269,21 +268,19 @@ const DEFAULT_AKAR_OPTIONS = {
|
|
|
269
268
|
enableDrawer: true,
|
|
270
269
|
enableDynamicBrands: false
|
|
271
270
|
};
|
|
272
|
-
const DEFAULT_FLUID_OPTIONS = {
|
|
273
|
-
maxWidth: 1440,
|
|
274
|
-
minWidth: 375,
|
|
275
|
-
remBase: 16,
|
|
276
|
-
useRemByDefault: false,
|
|
277
|
-
extendMaxWidth: null,
|
|
278
|
-
extendMinWidth: null,
|
|
279
|
-
ranges: null,
|
|
280
|
-
commentHelpers: false
|
|
281
|
-
};
|
|
282
271
|
const DEFAULT_PRESET_OPTIONS = {
|
|
283
|
-
fluid:
|
|
272
|
+
fluid: {
|
|
273
|
+
maxWidth: 1440,
|
|
274
|
+
minWidth: 375,
|
|
275
|
+
remBase: 16,
|
|
276
|
+
useRemByDefault: false,
|
|
277
|
+
extendMaxWidth: null,
|
|
278
|
+
extendMinWidth: null,
|
|
279
|
+
ranges: null,
|
|
280
|
+
commentHelpers: false
|
|
281
|
+
},
|
|
284
282
|
animation: { unit: "ms" },
|
|
285
283
|
akar: DEFAULT_AKAR_OPTIONS
|
|
286
284
|
};
|
|
287
|
-
|
|
288
285
|
//#endregion
|
|
289
|
-
export { cssObj2StrSync as a, compressCSS as i, DEFAULT_OPTIONS as n, resolveAnimation as o, DEFAULT_PRESET_OPTIONS as r, DEFAULT_AKAR_OPTIONS as t };
|
|
286
|
+
export { cssObj2StrSync as a, compressCSS as i, DEFAULT_OPTIONS as n, resolveAnimation as o, DEFAULT_PRESET_OPTIONS as r, DEFAULT_AKAR_OPTIONS as t };
|
|
@@ -10,7 +10,6 @@ function extractValuesFromRegexMatch(match) {
|
|
|
10
10
|
predefinedRangeName
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
|
|
14
13
|
//#endregion
|
|
15
14
|
//#region src/presets/fluid/utils/parser.util.ts
|
|
16
15
|
function invertAndParseNumber(value) {
|
|
@@ -18,7 +17,6 @@ function invertAndParseNumber(value) {
|
|
|
18
17
|
if (value.includes("-")) return Number.parseInt(value.replace("-", ""));
|
|
19
18
|
return -Number.parseInt(value);
|
|
20
19
|
}
|
|
21
|
-
|
|
22
20
|
//#endregion
|
|
23
21
|
//#region src/presets/fluid/utils/validation.util.ts
|
|
24
22
|
function validateUtilityRange({ range, utility, config }) {
|
|
@@ -41,7 +39,6 @@ function validateUtilityName({ match, config }) {
|
|
|
41
39
|
}
|
|
42
40
|
return true;
|
|
43
41
|
}
|
|
44
|
-
|
|
45
42
|
//#endregion
|
|
46
43
|
//#region src/presets/fluid/utils/rem.util.ts
|
|
47
44
|
function getRemMaxWidth(config) {
|
|
@@ -107,7 +104,6 @@ function extractRemBoundsFromMatch({ match, config }) {
|
|
|
107
104
|
max: relativeMax ?? max
|
|
108
105
|
};
|
|
109
106
|
}
|
|
110
|
-
|
|
111
107
|
//#endregion
|
|
112
108
|
//#region src/presets/fluid/utils/clamp.util.ts
|
|
113
109
|
/**
|
|
@@ -203,7 +199,6 @@ function getClampComment({ match, config }) {
|
|
|
203
199
|
const unit = isRem ? "rem" : "px";
|
|
204
200
|
return `/* ${min}${unit} -> ${max}${unit} */`;
|
|
205
201
|
}
|
|
206
|
-
|
|
207
202
|
//#endregion
|
|
208
203
|
//#region src/presets/fluid/utils/constant.util.ts
|
|
209
204
|
const FLUID_UTILITIES = {
|
|
@@ -259,7 +254,6 @@ const FLUID_UTILITIES = {
|
|
|
259
254
|
"fluid-inset-x": ["left", "right"],
|
|
260
255
|
"fluid-inset-y": ["top", "bottom"]
|
|
261
256
|
};
|
|
262
|
-
|
|
263
257
|
//#endregion
|
|
264
258
|
//#region src/presets/fluid/utils/rule.util.ts
|
|
265
259
|
function buildSinglePropertyRule({ match, config, property }) {
|
|
@@ -325,7 +319,6 @@ function buildFluidRules(config) {
|
|
|
325
319
|
});
|
|
326
320
|
});
|
|
327
321
|
}
|
|
328
|
-
|
|
329
322
|
//#endregion
|
|
330
323
|
//#region src/presets/fluid/index.ts
|
|
331
324
|
function presetFluid(options) {
|
|
@@ -334,6 +327,5 @@ function presetFluid(options) {
|
|
|
334
327
|
rules: [...buildFluidRules(options)]
|
|
335
328
|
};
|
|
336
329
|
}
|
|
337
|
-
|
|
338
330
|
//#endregion
|
|
339
|
-
export { presetFluid };
|
|
331
|
+
export { presetFluid };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,35 @@
|
|
|
1
|
-
import { CSSObject } from "
|
|
2
|
-
import * as unocss0 from "unocss";
|
|
1
|
+
import { CSSObject } from "unocss";
|
|
3
2
|
import { IconsOptions } from "@unocss/preset-icons";
|
|
3
|
+
import { PresetMiniOptions, Theme as Theme$1 } from "@unocss/preset-mini";
|
|
4
4
|
import { TypographyOptions } from "@unocss/preset-typography";
|
|
5
5
|
import { WebFontsOptions } from "@unocss/preset-web-fonts";
|
|
6
|
-
import {
|
|
7
|
-
import { PresetWind4Options, Theme as Theme$1 } from "@unocss/preset-wind4";
|
|
6
|
+
import { PresetWind4Options, Theme } from "@unocss/preset-wind4";
|
|
8
7
|
import { TransformerDirectivesOptions } from "@unocss/transformer-directives";
|
|
9
8
|
import { TransformerVariantGroupOptions } from "@unocss/transformer-variant-group";
|
|
10
9
|
|
|
10
|
+
//#region node_modules/.pnpm/@unocss+preset-wind3@66.7.0/node_modules/@unocss/preset-wind3/dist/index-7RoeBIPP.d.mts
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/index.d.ts
|
|
13
|
+
interface PresetWind3Options extends PresetMiniOptions {
|
|
14
|
+
/**
|
|
15
|
+
* The important option lets you control whether UnoCSS’s utilities should be marked with `!important`.
|
|
16
|
+
*
|
|
17
|
+
* This can be really useful when using UnoCSS with existing CSS that has high specificity selectors.
|
|
18
|
+
*
|
|
19
|
+
* You can also set `important` to a selector like `#app` instead, which will generate `#app :is(.m-1) { ... }`
|
|
20
|
+
*
|
|
21
|
+
* Also check out the compatibility with [:is()](https://caniuse.com/?search=%3Ais())
|
|
22
|
+
*
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
important?: boolean | string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The Tailwind CSS v3 / Windi CSS compact preset for UnoCSS.
|
|
29
|
+
*
|
|
30
|
+
* @see https://unocss.dev/presets/wind3
|
|
31
|
+
*/
|
|
32
|
+
//#endregion
|
|
11
33
|
//#region src/presets/scrollbar/index.d.ts
|
|
12
34
|
interface UnoPresetScrollbarOption {
|
|
13
35
|
/**
|
|
@@ -150,7 +172,7 @@ interface VinicuncaExtends extends Exclude<VinicuncaTheme, 'extend'> {
|
|
|
150
172
|
*/
|
|
151
173
|
animation?: Record<string, string>;
|
|
152
174
|
}
|
|
153
|
-
type VinicuncaTheme = Theme
|
|
175
|
+
type VinicuncaTheme = Theme & Omit<Theme$1, 'container' | 'containers'>;
|
|
154
176
|
interface VinicuncaAkarOptions {
|
|
155
177
|
keyframes?: VinicuncaExtends['keyframes'];
|
|
156
178
|
animation?: VinicuncaExtends['animation'];
|
|
@@ -159,7 +181,7 @@ interface VinicuncaAkarOptions {
|
|
|
159
181
|
*
|
|
160
182
|
* @see `DEFAULT_AKAR_OPTIONS.brands`
|
|
161
183
|
*/
|
|
162
|
-
brands?: Theme
|
|
184
|
+
brands?: Theme['colors'];
|
|
163
185
|
/**
|
|
164
186
|
* When defining the brand colors, we use the colors from `unocss/preset-wind4` theme by default.
|
|
165
187
|
* If we want to use custom colors that are not in the preset-wind4 theme, you can enable this option.
|
|
@@ -368,6 +390,6 @@ interface FluidOptions {
|
|
|
368
390
|
type DeepPartial<T> = { [P in keyof T]: DeepPartial<T[P]> };
|
|
369
391
|
//#endregion
|
|
370
392
|
//#region src/index.d.ts
|
|
371
|
-
declare const presetVinicunca:
|
|
393
|
+
declare const presetVinicunca: import("unocss").PresetFactoryAwaitable<VinicuncaTheme, PresetVinicuncaOptions>;
|
|
372
394
|
//#endregion
|
|
373
395
|
export { type VinicuncaTheme, presetVinicunca };
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { a as cssObj2StrSync, i as compressCSS, n as DEFAULT_OPTIONS, o as resolveAnimation, r as DEFAULT_PRESET_OPTIONS, t as DEFAULT_AKAR_OPTIONS } from "./constants-
|
|
2
|
-
import { t as PRESET_NAME } from "./meta-
|
|
3
|
-
import { definePreset } from "@unocss/core";
|
|
1
|
+
import { a as cssObj2StrSync, i as compressCSS, n as DEFAULT_OPTIONS, o as resolveAnimation, r as DEFAULT_PRESET_OPTIONS, t as DEFAULT_AKAR_OPTIONS } from "./constants-CD9LkNQP.mjs";
|
|
2
|
+
import { t as PRESET_NAME } from "./meta-BWU-BFPZ.mjs";
|
|
4
3
|
import { defu } from "defu";
|
|
4
|
+
import { definePreset } from "unocss";
|
|
5
5
|
import { isBoolean, isObjectType, isPlainObject, isString, mergeDeep } from "@vinicunca/perkakas";
|
|
6
|
-
|
|
7
6
|
//#region src/core/postprocess.ts
|
|
8
7
|
const RE_RGB = /rgb\(([\d\s]+?)\s*\/\s*([^)]+)\)/;
|
|
9
8
|
const RE_RGBA = /rgba\(([\d\s,]+),\s*([^)]+)\)/;
|
|
@@ -27,7 +26,6 @@ function postprocessWithUnColor(unColor) {
|
|
|
27
26
|
});
|
|
28
27
|
};
|
|
29
28
|
}
|
|
30
|
-
|
|
31
29
|
//#endregion
|
|
32
30
|
//#region src/core/preflights/reset.ts
|
|
33
31
|
const resetCSS = `
|
|
@@ -501,13 +499,11 @@ const resetPreflight = {
|
|
|
501
499
|
layer: "preflights",
|
|
502
500
|
getCSS: () => compressCSS(resetCSS)
|
|
503
501
|
};
|
|
504
|
-
|
|
505
502
|
//#endregion
|
|
506
503
|
//#region src/core/preflights/index.ts
|
|
507
504
|
function getPreflights(options) {
|
|
508
505
|
return options.preflights ? [resetPreflight] : [];
|
|
509
506
|
}
|
|
510
|
-
|
|
511
507
|
//#endregion
|
|
512
508
|
//#region src/resolver.ts
|
|
513
509
|
async function resolveOptions(options) {
|
|
@@ -546,13 +542,13 @@ async function resolvePresets(options) {
|
|
|
546
542
|
icons: import("@unocss/preset-icons").then((mod) => mod.presetIcons),
|
|
547
543
|
wind4: import("unocss").then((m) => m.presetWind4),
|
|
548
544
|
wind3: import("unocss").then((m) => m.presetWind3),
|
|
549
|
-
fluid: import("./fluid-
|
|
550
|
-
animation: import("./animation-
|
|
545
|
+
fluid: import("./fluid-vyZzun_V.mjs").then((mod) => mod.presetFluid),
|
|
546
|
+
animation: import("./animation-DsnEDm70.mjs").then((mod) => mod.presetAnimation),
|
|
551
547
|
webFonts: import("@unocss/preset-web-fonts").then((mod) => mod.presetWebFonts),
|
|
552
548
|
typography: import("@unocss/preset-typography").then((mod) => mod.presetTypography),
|
|
553
|
-
scrollbar: import("./scrollbar-
|
|
554
|
-
magicCss: import("./magic-css-
|
|
555
|
-
akar: import("./akar-
|
|
549
|
+
scrollbar: import("./scrollbar-CdK-zPqW.mjs").then((mod) => mod.presetScrollbar),
|
|
550
|
+
magicCss: import("./magic-css-DVWebgFO.mjs").then((mod) => mod.presetMagicss),
|
|
551
|
+
akar: import("./akar-VedW04rH.mjs").then((mod) => mod.presetAkar)
|
|
556
552
|
};
|
|
557
553
|
for (const [key, preset] of Object.entries(presetMap)) {
|
|
558
554
|
const option = options[key];
|
|
@@ -570,7 +566,7 @@ async function resolveTransformers(options) {
|
|
|
570
566
|
const transformerMap = {
|
|
571
567
|
directives: import("unocss").then((m) => m.transformerDirectives),
|
|
572
568
|
variantGroup: import("unocss").then((m) => m.transformerVariantGroup),
|
|
573
|
-
alias: import("./transformer-alias-
|
|
569
|
+
alias: import("./transformer-alias-CUUXiUed.mjs").then((mod) => mod.transformerAlias)
|
|
574
570
|
};
|
|
575
571
|
for (const [key, transformer] of Object.entries(transformerMap)) {
|
|
576
572
|
const option = options[key];
|
|
@@ -618,7 +614,6 @@ function resolveExtend(options) {
|
|
|
618
614
|
safelist
|
|
619
615
|
};
|
|
620
616
|
}
|
|
621
|
-
|
|
622
617
|
//#endregion
|
|
623
618
|
//#region src/index.ts
|
|
624
619
|
const presetVinicunca = definePreset(async (options) => {
|
|
@@ -639,6 +634,5 @@ const presetVinicunca = definePreset(async (options) => {
|
|
|
639
634
|
layers: meta.layers
|
|
640
635
|
};
|
|
641
636
|
});
|
|
642
|
-
|
|
643
637
|
//#endregion
|
|
644
|
-
export { presetVinicunca };
|
|
638
|
+
export { presetVinicunca };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { definePreset } from "unocss";
|
|
2
|
-
|
|
3
2
|
//#region src/presets/magic-css/index.ts
|
|
4
3
|
const presetMagicss = definePreset(() => {
|
|
5
4
|
const property = { "animation-fill-mode": "both" };
|
|
@@ -210,6 +209,5 @@ const presetMagicss = definePreset(() => {
|
|
|
210
209
|
} }
|
|
211
210
|
};
|
|
212
211
|
});
|
|
213
|
-
|
|
214
212
|
//#endregion
|
|
215
|
-
export { presetMagicss };
|
|
213
|
+
export { presetMagicss };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { colorResolver, handler } from "@unocss/preset-mini/utils";
|
|
2
|
-
|
|
3
2
|
//#region src/presets/scrollbar/index.ts
|
|
4
3
|
const defaultOption = {
|
|
5
4
|
scrollbarWidth: "8px",
|
|
@@ -20,7 +19,7 @@ const customRules = {
|
|
|
20
19
|
"track-radius": ["track-radius"],
|
|
21
20
|
"thumb-radius": ["thumb-radius"]
|
|
22
21
|
};
|
|
23
|
-
const numberVarRegex =
|
|
22
|
+
const numberVarRegex = new RegExp(`^scrollbar-(${Object.keys(customRules).join("|")})-(\\d+?)([a-zA-Z]*?)$`);
|
|
24
23
|
function presetScrollbar(option) {
|
|
25
24
|
const config = {
|
|
26
25
|
...defaultOption,
|
|
@@ -114,6 +113,5 @@ function presetScrollbar(option) {
|
|
|
114
113
|
]
|
|
115
114
|
};
|
|
116
115
|
}
|
|
117
|
-
|
|
118
116
|
//#endregion
|
|
119
|
-
export { presetScrollbar };
|
|
117
|
+
export { presetScrollbar };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { expandVariantGroup, isStaticShortcut } from "
|
|
1
|
+
import { expandVariantGroup, isStaticShortcut } from "unocss";
|
|
2
2
|
import { isString } from "@vinicunca/perkakas";
|
|
3
|
-
|
|
4
3
|
//#region src/transformer-alias.ts
|
|
5
4
|
function transformerAlias(options) {
|
|
6
5
|
return {
|
|
@@ -23,7 +22,7 @@ async function transformAlias({ code, uno, options = {} }) {
|
|
|
23
22
|
};
|
|
24
23
|
const extraRE = new RegExp(`(${escapeRegExp(prefix)}|${escapeRegExp(keep.prefix)})([\\w-:]+)`, "g");
|
|
25
24
|
const map = /* @__PURE__ */ new Map();
|
|
26
|
-
for (const item of
|
|
25
|
+
for (const item of [...code.original.matchAll(extraRE)]) {
|
|
27
26
|
let result = map.get(item[0]);
|
|
28
27
|
if (result === false) continue;
|
|
29
28
|
else if (!result) {
|
|
@@ -66,6 +65,5 @@ async function expandShortcut({ input, uno, depth = 5 }) {
|
|
|
66
65
|
function escapeRegExp(str) {
|
|
67
66
|
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
68
67
|
}
|
|
69
|
-
|
|
70
68
|
//#endregion
|
|
71
|
-
export { transformerAlias };
|
|
69
|
+
export { transformerAlias };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vinicunca/unocss-preset",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.46.0",
|
|
5
5
|
"description": "Opinionated UnoCSS preset",
|
|
6
6
|
"author": "praburangki<https://github.com/praburangki>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -41,39 +41,38 @@
|
|
|
41
41
|
"dist"
|
|
42
42
|
],
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@vinicunca/perkakas": "^1.
|
|
45
|
-
"unocss": "66.
|
|
44
|
+
"@vinicunca/perkakas": "^1.15.0",
|
|
45
|
+
"unocss": "66.7.0"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"registry": "https://registry.npmjs.org/"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@types/node": "^24.
|
|
52
|
-
"@unocss/
|
|
53
|
-
"@unocss/preset-
|
|
54
|
-
"@unocss/preset-
|
|
55
|
-
"@unocss/preset-
|
|
56
|
-
"@unocss/preset-
|
|
57
|
-
"@unocss/
|
|
58
|
-
"@unocss/transformer-
|
|
59
|
-
"@
|
|
60
|
-
"@vinicunca/
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"lint-staged": "^16.2.7",
|
|
51
|
+
"@types/node": "^24.12.4",
|
|
52
|
+
"@unocss/preset-icons": "66.7.0",
|
|
53
|
+
"@unocss/preset-mini": "66.7.0",
|
|
54
|
+
"@unocss/preset-typography": "66.7.0",
|
|
55
|
+
"@unocss/preset-web-fonts": "66.7.0",
|
|
56
|
+
"@unocss/preset-wind4": "66.7.0",
|
|
57
|
+
"@unocss/transformer-directives": "66.7.0",
|
|
58
|
+
"@unocss/transformer-variant-group": "66.7.0",
|
|
59
|
+
"@vinicunca/eslint-config": "5.2.0",
|
|
60
|
+
"@vinicunca/perkakas": "^1.15.0",
|
|
61
|
+
"bumpp": "^11.1.0",
|
|
62
|
+
"defu": "^6.1.7",
|
|
63
|
+
"eslint": "^10.4.0",
|
|
64
|
+
"lint-staged": "^16.4.0",
|
|
66
65
|
"magic-string": "^0.30.21",
|
|
67
|
-
"postcss": "^8.5.
|
|
68
|
-
"postcss-js": "^5.0
|
|
69
|
-
"prettier": "^3.8.
|
|
66
|
+
"postcss": "^8.5.15",
|
|
67
|
+
"postcss-js": "^5.1.0",
|
|
68
|
+
"prettier": "^3.8.3",
|
|
70
69
|
"simple-git-hooks": "^2.13.1",
|
|
71
|
-
"tsdown": "^0.
|
|
72
|
-
"typescript": "^
|
|
73
|
-
"unocss": "66.
|
|
74
|
-
"vite": "^7.3.
|
|
75
|
-
"vitest": "^4.
|
|
76
|
-
"@vinicunca/unocss-preset": "1.
|
|
70
|
+
"tsdown": "^0.22.1",
|
|
71
|
+
"typescript": "^6.0.3",
|
|
72
|
+
"unocss": "66.7.0",
|
|
73
|
+
"vite": "^7.3.3",
|
|
74
|
+
"vitest": "^4.1.7",
|
|
75
|
+
"@vinicunca/unocss-preset": "1.46.0"
|
|
77
76
|
},
|
|
78
77
|
"devDependencies": {
|
|
79
78
|
"culori": "^4.0.2"
|