tailwindcss 4.0.0-alpha.9 → 4.0.0-beta.10

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/lib.d.ts CHANGED
@@ -1,339 +1,3 @@
1
- type ArbitraryUtilityValue = {
2
- kind: 'arbitrary';
3
- /**
4
- * bg-[color:--my-color]
5
- * ^^^^^
6
- */
7
- dataType: string | null;
8
- /**
9
- * bg-[#0088cc]
10
- * ^^^^^^^
11
- * bg-[--my_variable]
12
- * var(^^^^^^^^^^^^^)
13
- */
14
- value: string;
15
- /**
16
- * bg-[--my_variable]
17
- * ^^^^^^^^^^^^^
18
- */
19
- dashedIdent: string | null;
20
- };
21
- type NamedUtilityValue = {
22
- kind: 'named';
23
- /**
24
- * bg-red-500
25
- * ^^^^^^^
26
- *
27
- * w-1/2
28
- * ^
29
- */
30
- value: string;
31
- /**
32
- * w-1/2
33
- * ^^^
34
- */
35
- fraction: string | null;
36
- };
37
- type ArbitraryModifier = {
38
- kind: 'arbitrary';
39
- /**
40
- * bg-red-500/[50%]
41
- * ^^^
42
- */
43
- value: string;
44
- /**
45
- * bg-red-500/[--my_variable]
46
- * ^^^^^^^^^^^^^
47
- */
48
- dashedIdent: string | null;
49
- };
50
- type NamedModifier = {
51
- kind: 'named';
52
- /**
53
- * bg-red-500/50
54
- * ^^
55
- */
56
- value: string;
57
- };
58
- type ArbitraryVariantValue = {
59
- kind: 'arbitrary';
60
- value: string;
61
- };
62
- type NamedVariantValue = {
63
- kind: 'named';
64
- value: string;
65
- };
66
- type Variant =
67
- /**
68
- * Arbitrary variants are variants that take a selector and generate a variant
69
- * on the fly.
70
- *
71
- * E.g.: `[&_p]`
72
- */
73
- {
74
- kind: 'arbitrary';
75
- selector: string;
76
- compounds: boolean;
77
- }
78
- /**
79
- * Static variants are variants that don't take any arguments.
80
- *
81
- * E.g.: `hover`
82
- */
83
- | {
84
- kind: 'static';
85
- root: string;
86
- compounds: boolean;
87
- }
88
- /**
89
- * Functional variants are variants that can take an argument. The argument is
90
- * either a named variant value or an arbitrary variant value.
91
- *
92
- * E.g.:
93
- *
94
- * - `aria-disabled`
95
- * - `aria-[disabled]`
96
- * - `@container-size` -> @container, with named value `size`
97
- * - `@container-[inline-size]` -> @container, with arbitrary variant value `inline-size`
98
- * - `@container` -> @container, with no value
99
- */
100
- | {
101
- kind: 'functional';
102
- root: string;
103
- value: ArbitraryVariantValue | NamedVariantValue | null;
104
- modifier: ArbitraryModifier | NamedModifier | null;
105
- compounds: boolean;
106
- }
107
- /**
108
- * Compound variants are variants that take another variant as an argument.
109
- *
110
- * E.g.:
111
- *
112
- * - `has-[&_p]`
113
- * - `group-*`
114
- * - `peer-*`
115
- */
116
- | {
117
- kind: 'compound';
118
- root: string;
119
- modifier: ArbitraryModifier | NamedModifier | null;
120
- variant: Variant;
121
- compounds: boolean;
122
- };
123
- type Candidate =
124
- /**
125
- * Arbitrary candidates are candidates that register utilities on the fly with
126
- * a property and a value.
127
- *
128
- * E.g.:
129
- *
130
- * - `[color:red]`
131
- * - `[color:red]/50`
132
- * - `[color:red]/50!`
133
- */
134
- {
135
- kind: 'arbitrary';
136
- property: string;
137
- value: string;
138
- modifier: ArbitraryModifier | NamedModifier | null;
139
- variants: Variant[];
140
- important: boolean;
141
- }
142
- /**
143
- * Static candidates are candidates that don't take any arguments.
144
- *
145
- * E.g.:
146
- *
147
- * - `underline`
148
- * - `flex`
149
- */
150
- | {
151
- kind: 'static';
152
- root: string;
153
- variants: Variant[];
154
- negative: boolean;
155
- important: boolean;
156
- }
157
- /**
158
- * Functional candidates are candidates that can take an argument.
159
- *
160
- * E.g.:
161
- *
162
- * - `bg-red-500`
163
- * - `bg-[#0088cc]`
164
- * - `w-1/2`
165
- */
166
- | {
167
- kind: 'functional';
168
- root: string;
169
- value: ArbitraryUtilityValue | NamedUtilityValue | null;
170
- modifier: ArbitraryModifier | NamedModifier | null;
171
- variants: Variant[];
172
- negative: boolean;
173
- important: boolean;
174
- };
175
- declare function parseCandidate(input: string, designSystem: DesignSystem): Candidate | null;
176
- declare function parseVariant(variant: string, designSystem: DesignSystem): Variant | null;
1
+ declare function postcssPluginWarning(): void;
177
2
 
178
- type Rule = {
179
- kind: 'rule';
180
- selector: string;
181
- nodes: AstNode[];
182
- };
183
- type Declaration = {
184
- kind: 'declaration';
185
- property: string;
186
- value: string;
187
- important: boolean;
188
- };
189
- type Comment = {
190
- kind: 'comment';
191
- value: string;
192
- };
193
- type AstNode = Rule | Declaration | Comment;
194
-
195
- declare class Theme {
196
- private values;
197
- constructor(values?: Map<string, {
198
- value: string;
199
- isReference: boolean;
200
- }>);
201
- add(key: string, value: string, isReference?: boolean): void;
202
- keysInNamespaces(themeKeys: ThemeKey[]): string[];
203
- get(themeKeys: ThemeKey[]): string | null;
204
- entries(): IterableIterator<[string, {
205
- value: string;
206
- isReference: boolean;
207
- }]>;
208
- clearNamespace(namespace: string): void;
209
- resolveKey(candidateValue: string, themeKeys: ThemeKey[]): string | null;
210
- resolve(candidateValue: string, themeKeys: ThemeKey[]): string | null;
211
- resolveWith(candidateValue: string, themeKeys: ThemeKey[], nestedKeys?: `--${string}`[]): [string, Record<string, string>] | null;
212
- namespace(namespace: string): Map<string | null, string>;
213
- }
214
- type ThemeKey = '--accent-color' | '--animate' | '--aspect-ratio' | '--backdrop-blur' | '--backdrop-brightness' | '--backdrop-contrast' | '--backdrop-grayscale' | '--backdrop-hue-rotate' | '--backdrop-invert' | '--backdrop-opacity' | '--backdrop-saturate' | '--backdrop-sepia' | '--background-color' | '--background-image' | '--blur' | '--border-color' | '--border-spacing' | '--border-width' | '--box-shadow-color' | '--breakpoint' | '--brightness' | '--caret-color' | '--color' | '--columns' | '--contrast' | '--cursor' | '--default-border-width' | '--default-ring-color' | '--default-ring-width' | '--default-transition-timing-function' | '--default-transition-duration' | '--divide-width' | '--divide-color' | '--drop-shadow' | '--fill' | '--flex-basis' | '--font-family' | '--font-size' | '--font-weight' | '--gap' | '--gradient-color-stop-positions' | '--grayscale' | '--grid-auto-columns' | '--grid-auto-rows' | '--grid-column' | '--grid-column-end' | '--grid-column-start' | '--grid-row' | '--grid-row-end' | '--grid-row-start' | '--grid-template-columns' | '--grid-template-rows' | '--height' | '--hue-rotate' | '--inset' | '--inset-shadow' | '--invert' | '--letter-spacing' | '--line-height' | '--line-clamp' | '--list-style-image' | '--list-style-type' | '--margin' | '--max-height' | '--max-width' | '--min-height' | '--min-width' | '--object-position' | '--opacity' | '--order' | '--outline-color' | '--outline-width' | '--outline-offset' | '--padding' | '--placeholder-color' | '--radius' | '--ring-color' | '--ring-offset-color' | '--ring-offset-width' | '--ring-width' | '--rotate' | '--saturate' | '--scale' | '--scroll-margin' | '--scroll-padding' | '--sepia' | '--shadow' | '--size' | '--skew' | '--space' | '--spacing' | '--stroke' | '--stroke-width' | '--text-color' | '--text-decoration-color' | '--text-decoration-thickness' | '--text-indent' | '--text-underline-offset' | '--transform-origin' | '--transition-delay' | '--transition-duration' | '--transition-property' | '--transition-timing-function' | '--translate' | '--width' | '--z-index';
215
-
216
- type VariantFn<T extends Variant['kind']> = (rule: Rule, variant: Extract<Variant, {
217
- kind: T;
218
- }>) => null | void;
219
- type CompareFn = (a: Variant, z: Variant) => number;
220
- declare class Variants {
221
- private compareFns;
222
- private variants;
223
- private completions;
224
- /**
225
- * Registering a group of variants should result in the same sort number for
226
- * all the variants. This is to ensure that the variants are applied in the
227
- * correct order.
228
- */
229
- private groupOrder;
230
- /**
231
- * Keep track of the last sort order instead of using the size of the map to
232
- * avoid unnecessarily skipping order numbers.
233
- */
234
- private lastOrder;
235
- static(name: string, applyFn: VariantFn<'static'>, { compounds }?: {
236
- compounds?: boolean;
237
- }): void;
238
- functional(name: string, applyFn: VariantFn<'functional'>, { compounds }?: {
239
- compounds?: boolean;
240
- }): void;
241
- compound(name: string, applyFn: VariantFn<'compound'>, { compounds }?: {
242
- compounds?: boolean;
243
- }): void;
244
- group(fn: () => void, compareFn?: CompareFn): void;
245
- has(name: string): boolean;
246
- get(name: string): {
247
- kind: "arbitrary" | "static" | "functional" | "compound";
248
- order: number;
249
- applyFn: VariantFn<any>;
250
- compounds: boolean;
251
- } | undefined;
252
- kind(name: string): "arbitrary" | "static" | "functional" | "compound";
253
- compounds(name: string): boolean;
254
- suggest(name: string, suggestions: () => string[]): void;
255
- getCompletions(name: string): string[];
256
- compare(a: Variant | null, z: Variant | null): number;
257
- keys(): IterableIterator<string>;
258
- entries(): IterableIterator<[string, {
259
- kind: "arbitrary" | "static" | "functional" | "compound";
260
- order: number;
261
- applyFn: VariantFn<any>;
262
- compounds: boolean;
263
- }]>;
264
- private set;
265
- private nextOrder;
266
- }
267
-
268
- declare function compileAstNodes(rawCandidate: string, designSystem: DesignSystem): {
269
- node: Rule;
270
- propertySort: number[];
271
- } | null;
272
-
273
- interface ClassMetadata {
274
- modifiers: string[];
275
- }
276
- type ClassEntry = [string, ClassMetadata];
277
- interface SelectorOptions {
278
- modifier?: string;
279
- value?: string;
280
- }
281
- interface VariantEntry {
282
- name: string;
283
- isArbitrary: boolean;
284
- values: string[];
285
- hasDash: boolean;
286
- selectors: (options: SelectorOptions) => string[];
287
- }
288
-
289
- type CompileFn<T extends Candidate['kind']> = (value: Extract<Candidate, {
290
- kind: T;
291
- }>) => AstNode[] | undefined;
292
- interface SuggestionGroup {
293
- supportsNegative?: boolean;
294
- values: (string | null)[];
295
- modifiers: string[];
296
- }
297
- declare class Utilities {
298
- private utilities;
299
- private completions;
300
- static(name: string, compileFn: CompileFn<'static'>): void;
301
- functional(name: string, compileFn: CompileFn<'functional'>): void;
302
- arbitrary(compileFn: CompileFn<'arbitrary'>): void;
303
- has(name: string): boolean;
304
- get(name: string | symbol): {
305
- kind: "arbitrary" | "static" | "functional";
306
- compileFn: CompileFn<any>;
307
- } | undefined;
308
- kind(name: string): "arbitrary" | "static" | "functional";
309
- getCompletions(name: string): SuggestionGroup[];
310
- suggest(name: string, groups: () => SuggestionGroup[]): void;
311
- keys(): IterableIterator<string | symbol>;
312
- entries(): IterableIterator<[string | symbol, {
313
- kind: "arbitrary" | "static" | "functional";
314
- compileFn: CompileFn<any>;
315
- }]>;
316
- getArbitrary(): CompileFn<any>;
317
- private set;
318
- }
319
-
320
- type DesignSystem = {
321
- theme: Theme;
322
- utilities: Utilities;
323
- variants: Variants;
324
- candidatesToCss(classes: string[]): (string | null)[];
325
- getClassOrder(classes: string[]): [string, bigint | null][];
326
- getClassList(): ClassEntry[];
327
- getVariants(): VariantEntry[];
328
- parseCandidate(candidate: string): ReturnType<typeof parseCandidate>;
329
- parseVariant(variant: string): ReturnType<typeof parseVariant>;
330
- compileAstNodes(candidate: string): ReturnType<typeof compileAstNodes>;
331
- getUsedVariants(): ReturnType<typeof parseVariant>[];
332
- };
333
-
334
- declare function compile(css: string): {
335
- build(candidates: string[]): string;
336
- };
337
- declare function __unstable__loadDesignSystem(css: string): DesignSystem;
338
-
339
- export { __unstable__loadDesignSystem, compile };
3
+ export { postcssPluginWarning as default };