@unocss/preset-mini 66.5.11 → 66.6.0-beta.1

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.
@@ -1,234 +0,0 @@
1
- import { _ as VariantHandlerContext, a as Arrayable, c as DynamicMatcher, g as VariantContext, m as StaticRule, r as Theme, s as CSSObject, v as VariantObject } from "./colors-CdGFctaC.mjs";
2
-
3
- //#region ../rule-utils/src/colors.d.ts
4
- interface CSSColorValue {
5
- type: string;
6
- components: (string | number)[];
7
- alpha: string | number | undefined;
8
- }
9
- type RGBAColorValue = [number, number, number, number] | [number, number, number];
10
- interface ParsedColorValue {
11
- /**
12
- * Parsed color value.
13
- */
14
- color?: string;
15
- /**
16
- * Parsed opacity value.
17
- */
18
- opacity: string;
19
- /**
20
- * Color name.
21
- */
22
- name: string;
23
- /**
24
- * Color scale, preferably 000 - 999.
25
- */
26
- no: string;
27
- /**
28
- * {@link CSSColorValue}
29
- */
30
- cssColor: CSSColorValue | undefined;
31
- /**
32
- * Parsed alpha value from opacity
33
- */
34
- alpha: string | number | undefined;
35
- }
36
- declare const cssColorFunctions: string[];
37
- declare const rectangularColorSpace: string[];
38
- declare const polarColorSpace: string[];
39
- declare const hueInterpolationMethods: string[];
40
- declare const alphaPlaceholders: string[];
41
- declare const alphaPlaceholdersRE: RegExp;
42
- declare function isInterpolatedMethod(type?: string): boolean;
43
- declare function hex2rgba(hex?: string): RGBAColorValue | undefined;
44
- declare function parseCssColor(str?: string): CSSColorValue | undefined;
45
- declare function colorOpacityToString(color: CSSColorValue): string | number;
46
- declare function colorToString(color: CSSColorValue | string, alphaOverride?: string | number): string;
47
- //#endregion
48
- //#region ../rule-utils/src/directive.d.ts
49
- declare const themeFnRE: RegExp;
50
- declare function hasThemeFn(str: string): boolean;
51
- declare function transformThemeFn(code: string, theme: Record<string, any>, throwOnMissing?: boolean): string;
52
- declare function transformThemeString(code: string, theme: Record<string, any>, throwOnMissing?: boolean): string | undefined;
53
- declare function calcMaxWidthBySize(size: string): string;
54
- //#endregion
55
- //#region ../rule-utils/src/handlers.d.ts
56
- type ValueHandlerCallback<T extends object> = (str: string, theme?: T) => string | number | undefined;
57
- type ValueHandler<K extends string, T extends object> = { [S in K]: ValueHandler<K, T> } & {
58
- (str: string, theme?: T): string | undefined;
59
- __options: {
60
- sequence: K[];
61
- };
62
- };
63
- declare function createValueHandler<K extends string, T extends object>(handlers: Record<K, ValueHandlerCallback<T>>): ValueHandler<K, T>;
64
- //#endregion
65
- //#region ../rule-utils/src/icon.d.ts
66
- declare const iconFnRE: RegExp;
67
- declare function hasIconFn(str: string): boolean;
68
- //#endregion
69
- //#region ../rule-utils/src/utilities.d.ts
70
- declare function getBracket(str: string, open: string, close: string): string[] | undefined;
71
- declare function getStringComponent(str: string, open: string, close: string, separators: string | string[]): string[] | undefined;
72
- declare function getStringComponents(str: string, separators: string | string[], limit?: number, open?: string, close?: string): string[] | undefined;
73
- //#endregion
74
- //#region ../rule-utils/src/variants.d.ts
75
- declare function variantMatcher<T extends object = object>(name: string, handler: Arrayable<(input: VariantHandlerContext) => Record<string, any>>, options?: Omit<VariantObject<T>, 'match'>): VariantObject<T>;
76
- declare function variantParentMatcher<T extends object = object>(name: string, parent: string): VariantObject<T>;
77
- declare function variantGetBracket(prefix: string, matcher: string, separators: string[]): string[] | undefined;
78
- declare function variantGetParameter(prefix: Arrayable<string>, matcher: string, separators: string[]): string[] | undefined;
79
- //#endregion
80
- //#region ../rule-utils/src/pseudo.d.ts
81
- /**
82
- * Note: the order of following pseudo classes will affect the order of generated css.
83
- *
84
- * Reference: https://github.com/tailwindlabs/tailwindcss/blob/main/src/corePlugins.js#L83
85
- */
86
- declare const PseudoClasses: Record<string, string>;
87
- declare const PseudoClassesKeys: string[];
88
- declare const PseudoClassesColon: Record<string, string>;
89
- declare const PseudoClassesColonKeys: string[];
90
- declare const PseudoClassFunctions: string[];
91
- declare const PseudoClassesMulti: Record<string, string[]>;
92
- declare const PseudoClassesStr: string;
93
- declare const PseudoClassesColonStr: string;
94
- declare const PseudoClassFunctionsStr: string;
95
- declare const PseudoClassesMultiStr: string;
96
- declare const excludedPseudo: string[];
97
- declare const PseudoClassesAndElementsStr: string;
98
- declare const PseudoClassesAndElementsColonStr: string;
99
- interface PseudoVariantOptions {
100
- /**
101
- * Generate tagged pseudo selector as `[group=""]` instead of `.group`
102
- *
103
- * @default false
104
- */
105
- attributifyPseudo?: boolean;
106
- /**
107
- * Utils prefix
108
- */
109
- prefix?: string | string[];
110
- }
111
- interface PseudoVariantUtilities<Theme$1 extends object = object> {
112
- getBracket: typeof getBracket;
113
- h: {
114
- bracket: (s: string, theme?: Theme$1) => string | undefined;
115
- };
116
- variantGetBracket: typeof variantGetBracket;
117
- }
118
- declare function createTaggedPseudoClassMatcher<T extends object = object>(tag: string, parent: string, combinator: string, utils: PseudoVariantUtilities): VariantObject<T>;
119
- declare function createPseudoClassesAndElements<T extends object = object>(utils: PseudoVariantUtilities): VariantObject<T>[];
120
- declare function createPseudoClassFunctions<T extends object = object>(utils: PseudoVariantUtilities): VariantObject<T>;
121
- declare function createTaggedPseudoClasses<T extends object = object>(options: PseudoVariantOptions, utils: PseudoVariantUtilities): VariantObject<T>[];
122
- declare function createPartClasses<T extends object = object>(): VariantObject<T>;
123
- declare namespace handlers_d_exports {
124
- export { auto, bracket, bracketOfColor, bracketOfLength, bracketOfPosition, cssvar, degree, fraction, global, number, numberWithUnit, percent, position, properties, px, rem, time };
125
- }
126
- declare function numberWithUnit(str: string): string | undefined;
127
- declare function auto(str: string): "auto" | undefined;
128
- declare function rem(str: string): string | undefined;
129
- declare function px(str: string): string | undefined;
130
- declare function number(str: string): number | undefined;
131
- declare function percent(str: string): string | undefined;
132
- declare function fraction(str: string): string | undefined;
133
- declare function bracket(str: string): string | undefined;
134
- declare function bracketOfColor(str: string): string | undefined;
135
- declare function bracketOfLength(str: string): string | undefined;
136
- declare function bracketOfPosition(str: string): string | undefined;
137
- declare function cssvar(str: string): string | undefined;
138
- declare function time(str: string): string | undefined;
139
- declare function degree(str: string): string | undefined;
140
- declare function global(str: string): string | undefined;
141
- declare function properties(str: string): string | undefined;
142
- declare function position(str: string): string | undefined;
143
- //#endregion
144
- //#region src/_utils/handlers/index.d.ts
145
- declare const handler: ValueHandler<"number" | "auto" | "position" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "bracketOfPosition" | "cssvar" | "time" | "degree" | "global" | "properties", object>;
146
- declare const h: ValueHandler<"number" | "auto" | "position" | "numberWithUnit" | "rem" | "px" | "percent" | "fraction" | "bracket" | "bracketOfColor" | "bracketOfLength" | "bracketOfPosition" | "cssvar" | "time" | "degree" | "global" | "properties", object>;
147
- //#endregion
148
- //#region src/_utils/mappings.d.ts
149
- declare const directionMap: Record<string, string[]>;
150
- declare const insetMap: Record<string, string[]>;
151
- declare const cornerMap: Record<string, string[]>;
152
- declare const xyzMap: Record<string, string[]>;
153
- declare const xyzArray: string[];
154
- declare const positionMap: Record<string, string>;
155
- declare const globalKeywords: string[];
156
- declare const cssMathFnRE: RegExp;
157
- declare const cssVarFnRE: RegExp;
158
- //#endregion
159
- //#region src/_utils/utilities.d.ts
160
- declare const CONTROL_MINI_NO_NEGATIVE = "$$mini-no-negative";
161
- /**
162
- * Provide {@link DynamicMatcher} function returning spacing definition. See spacing rules.
163
- *
164
- * @param propertyPrefix - Property for the css value to be created. Postfix will be appended according to direction matched.
165
- * @see {@link directionMap}
166
- */
167
- declare function directionSize(propertyPrefix: string): DynamicMatcher;
168
- type ThemeColorKeys = 'colors' | 'borderColor' | 'backgroundColor' | 'textColor' | 'shadowColor' | 'accentColor';
169
- /**
170
- * Split utility shorthand delimited by / or :
171
- */
172
- declare function splitShorthand(body: string, type: string): string[] | undefined;
173
- /**
174
- * Parse color string into {@link ParsedColorValue} (if possible). Color value will first be matched to theme object before parsing.
175
- * See also color.tests.ts for more examples.
176
- *
177
- * @example Parseable strings:
178
- * 'red' // From theme, if 'red' is available
179
- * 'red-100' // From theme, plus scale
180
- * 'red-100/20' // From theme, plus scale/opacity
181
- * '[rgb(100 2 3)]/[var(--op)]' // Bracket with rgb color and bracket with opacity
182
- *
183
- * @param body - Color string to be parsed.
184
- * @param theme - {@link Theme} object.
185
- * @return object if string is parseable.
186
- */
187
- declare function parseColor(body: string, theme: Theme, key?: ThemeColorKeys): ParsedColorValue | undefined;
188
- /**
189
- * Provide {@link DynamicMatcher} function to produce color value matched from rule.
190
- *
191
- * @see {@link parseColor}
192
- *
193
- * @example Resolving 'red' from theme:
194
- * colorResolver('background-color', 'background')('', 'red')
195
- * return { 'background-color': '#f12' }
196
- *
197
- * @example Resolving 'red-100' from theme:
198
- * colorResolver('background-color', 'background')('', 'red-100')
199
- * return { '--un-background-opacity': '1', 'background-color': 'rgb(254 226 226 / var(--un-background-opacity))' }
200
- *
201
- * @example Resolving 'red-100/20' from theme:
202
- * colorResolver('background-color', 'background')('', 'red-100/20')
203
- * return { 'background-color': 'rgb(204 251 241 / 0.22)' }
204
- *
205
- * @example Resolving 'hex-124':
206
- * colorResolver('color', 'text')('', 'hex-124')
207
- * return { '--un-text-opacity': '1', 'color': 'rgb(17 34 68 / var(--un-text-opacity))' }
208
- *
209
- * @param property - Property for the css value to be created.
210
- * @param varName - Base name for the opacity variable.
211
- * @param [key] - Theme key to select the color from.
212
- * @param [shouldPass] - Function to decide whether to pass the css.
213
- * @return object.
214
- */
215
- declare function colorResolver(property: string, varName: string, key?: ThemeColorKeys, shouldPass?: (css: CSSObject) => boolean): DynamicMatcher;
216
- declare function colorableShadows(shadows: string | string[], colorVar: string): string[];
217
- declare function hasParseableColor(color: string | undefined, theme: Theme, key: ThemeColorKeys): boolean;
218
- declare function resolveBreakpoints({
219
- theme,
220
- generator
221
- }: Readonly<VariantContext<Theme>>, key?: 'breakpoints' | 'verticalBreakpoints'): {
222
- point: string;
223
- size: string;
224
- }[] | undefined;
225
- declare function resolveVerticalBreakpoints(context: Readonly<VariantContext<Theme>>): {
226
- point: string;
227
- size: string;
228
- }[] | undefined;
229
- declare function makeGlobalStaticRules(prefix: string, property?: string): StaticRule[];
230
- declare function isCSSMathFn(value: string | undefined): boolean;
231
- declare function isSize(str: string): boolean;
232
- declare function transformXYZ(d: string, v: string, name: string): [string, string][];
233
- //#endregion
234
- export { hasIconFn as $, PseudoClassesAndElementsStr as A, createPartClasses as B, h as C, PseudoClassFunctionsStr as D, PseudoClassFunctions as E, PseudoClassesMulti as F, excludedPseudo as G, createPseudoClassesAndElements as H, PseudoClassesMultiStr as I, variantMatcher as J, variantGetBracket as K, PseudoClassesStr as L, PseudoClassesColonKeys as M, PseudoClassesColonStr as N, PseudoClasses as O, PseudoClassesKeys as P, getStringComponents as Q, PseudoVariantOptions as R, xyzMap as S, rectangularColorSpace as St, handlers_d_exports as T, createTaggedPseudoClassMatcher as U, createPseudoClassFunctions as V, createTaggedPseudoClasses as W, getBracket as X, variantParentMatcher as Y, getStringComponent as Z, directionMap as _, hex2rgba as _t, hasParseableColor as a, hasThemeFn as at, positionMap as b, parseCssColor as bt, makeGlobalStaticRules as c, transformThemeString as ct, resolveVerticalBreakpoints as d, RGBAColorValue as dt, iconFnRE as et, splitShorthand as f, alphaPlaceholders as ft, cssVarFnRE as g, cssColorFunctions as gt, cssMathFnRE as h, colorToString as ht, directionSize as i, calcMaxWidthBySize as it, PseudoClassesColon as j, PseudoClassesAndElementsColonStr as k, parseColor as l, CSSColorValue as lt, cornerMap as m, colorOpacityToString as mt, colorResolver as n, ValueHandlerCallback as nt, isCSSMathFn as o, themeFnRE as ot, transformXYZ as p, alphaPlaceholdersRE as pt, variantGetParameter as q, colorableShadows as r, createValueHandler as rt, isSize as s, transformThemeFn as st, CONTROL_MINI_NO_NEGATIVE as t, ValueHandler as tt, resolveBreakpoints as u, ParsedColorValue as ut, globalKeywords as v, hueInterpolationMethods as vt, handler as w, xyzArray as x, polarColorSpace as xt, insetMap as y, isInterpolatedMethod as yt, PseudoVariantUtilities as z };