tailwindcss 4.0.0-alpha.20 → 4.0.0-alpha.21

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/plugin.d.mts CHANGED
@@ -1,21 +1,28 @@
1
- import { U as UserConfig } from './types-InlknEYy.mjs';
1
+ import { P as PluginUtils, N as NamedUtilityValue } from './resolve-config-C9L_YGHi.mjs';
2
2
 
3
- type NamedUtilityValue = {
4
- kind: 'named';
5
- /**
6
- * bg-red-500
7
- * ^^^^^^^
8
- *
9
- * w-1/2
10
- * ^
11
- */
12
- value: string;
13
- /**
14
- * w-1/2
15
- * ^^^
16
- */
17
- fraction: string | null;
3
+ type ResolvableTo<T> = T | ((utils: PluginUtils) => T);
4
+ type ThemeValue = ResolvableTo<Record<string, unknown>> | null | undefined;
5
+ type ThemeConfig = Record<string, ThemeValue> & {
6
+ extend?: Record<string, ThemeValue>;
18
7
  };
8
+ type ContentFile = string | {
9
+ raw: string;
10
+ extension?: string;
11
+ };
12
+ type DarkModeStrategy = false | 'media' | 'class' | ['class', string] | 'selector' | ['selector', string] | ['variant', string | string[]];
13
+ interface UserConfig {
14
+ presets?: UserConfig[];
15
+ theme?: ThemeConfig;
16
+ plugins?: Plugin[];
17
+ }
18
+ interface UserConfig {
19
+ content?: ContentFile[] | {
20
+ files: ContentFile[];
21
+ };
22
+ }
23
+ interface UserConfig {
24
+ darkMode?: DarkModeStrategy;
25
+ }
19
26
 
20
27
  type Config = UserConfig;
21
28
  type PluginFn = (api: PluginAPI) => void;
@@ -27,6 +34,7 @@ type PluginWithOptions<T> = {
27
34
  (options?: T): PluginWithConfig;
28
35
  __isOptionsFunction: true;
29
36
  };
37
+ type Plugin = PluginFn | PluginWithConfig | PluginWithOptions<any>;
30
38
  type PluginAPI = {
31
39
  addBase(base: CssInJs): void;
32
40
  addVariant(name: string, variant: string | string[] | CssInJs): void;
@@ -53,10 +61,11 @@ type PluginAPI = {
53
61
  modifiers: 'any' | Record<string, string>;
54
62
  }>): void;
55
63
  theme(path: string, defaultValue?: any): any;
64
+ config(path: string, defaultValue?: any): any;
56
65
  prefix(className: string): string;
57
66
  };
58
67
  type CssInJs = {
59
- [key: string]: string | CssInJs | CssInJs[];
68
+ [key: string]: string | string[] | CssInJs | CssInJs[];
60
69
  };
61
70
 
62
71
  declare function createPlugin(handler: PluginFn, config?: Partial<Config>): PluginWithConfig;
package/dist/plugin.d.ts CHANGED
@@ -1,2 +1,76 @@
1
+ import { P as PluginUtils, N as NamedUtilityValue } from './resolve-config-C9L_YGHi.js';
1
2
 
2
- export { }
3
+ type ResolvableTo<T> = T | ((utils: PluginUtils) => T);
4
+ type ThemeValue = ResolvableTo<Record<string, unknown>> | null | undefined;
5
+ type ThemeConfig = Record<string, ThemeValue> & {
6
+ extend?: Record<string, ThemeValue>;
7
+ };
8
+ type ContentFile = string | {
9
+ raw: string;
10
+ extension?: string;
11
+ };
12
+ type DarkModeStrategy = false | 'media' | 'class' | ['class', string] | 'selector' | ['selector', string] | ['variant', string | string[]];
13
+ interface UserConfig {
14
+ presets?: UserConfig[];
15
+ theme?: ThemeConfig;
16
+ plugins?: Plugin[];
17
+ }
18
+ interface UserConfig {
19
+ content?: ContentFile[] | {
20
+ files: ContentFile[];
21
+ };
22
+ }
23
+ interface UserConfig {
24
+ darkMode?: DarkModeStrategy;
25
+ }
26
+
27
+ type Config = UserConfig;
28
+ type PluginFn = (api: PluginAPI) => void;
29
+ type PluginWithConfig = {
30
+ handler: PluginFn;
31
+ config?: UserConfig;
32
+ };
33
+ type PluginWithOptions<T> = {
34
+ (options?: T): PluginWithConfig;
35
+ __isOptionsFunction: true;
36
+ };
37
+ type Plugin = PluginFn | PluginWithConfig | PluginWithOptions<any>;
38
+ type PluginAPI = {
39
+ addBase(base: CssInJs): void;
40
+ addVariant(name: string, variant: string | string[] | CssInJs): void;
41
+ addUtilities(utilities: Record<string, CssInJs | CssInJs[]> | Record<string, CssInJs | CssInJs[]>[], options?: {}): void;
42
+ matchUtilities(utilities: Record<string, (value: string, extra: {
43
+ modifier: string | null;
44
+ }) => CssInJs | CssInJs[]>, options?: Partial<{
45
+ type: string | string[];
46
+ supportsNegativeValues: boolean;
47
+ values: Record<string, string> & {
48
+ __BARE_VALUE__?: (value: NamedUtilityValue) => string | undefined;
49
+ };
50
+ modifiers: 'any' | Record<string, string>;
51
+ }>): void;
52
+ addComponents(utilities: Record<string, CssInJs> | Record<string, CssInJs>[], options?: {}): void;
53
+ matchComponents(utilities: Record<string, (value: string, extra: {
54
+ modifier: string | null;
55
+ }) => CssInJs>, options?: Partial<{
56
+ type: string | string[];
57
+ supportsNegativeValues: boolean;
58
+ values: Record<string, string> & {
59
+ __BARE_VALUE__?: (value: NamedUtilityValue) => string | undefined;
60
+ };
61
+ modifiers: 'any' | Record<string, string>;
62
+ }>): void;
63
+ theme(path: string, defaultValue?: any): any;
64
+ config(path: string, defaultValue?: any): any;
65
+ prefix(className: string): string;
66
+ };
67
+ type CssInJs = {
68
+ [key: string]: string | string[] | CssInJs | CssInJs[];
69
+ };
70
+
71
+ declare function createPlugin(handler: PluginFn, config?: Partial<Config>): PluginWithConfig;
72
+ declare namespace createPlugin {
73
+ var withOptions: <T>(pluginFunction: (options?: T) => PluginFn, configFunction?: (options?: T) => Partial<Config>) => PluginWithOptions<T>;
74
+ }
75
+
76
+ export { createPlugin as default };
package/dist/plugin.js CHANGED
@@ -1 +1 @@
1
- "use strict";var g=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var P=(n,i)=>()=>(n&&(i=n(n=0)),i);var a=(n,i)=>{for(var t in i)g(n,t,{get:i[t],enumerable:!0})},c=(n,i,t,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let u of p(i))!s.call(n,u)&&u!==t&&g(n,u,{get:()=>i[u],enumerable:!(o=f(i,u))||o.enumerable});return n};var h=n=>c(g({},"__esModule",{value:!0}),n);var l={};a(l,{default:()=>C});function r(n,i){return{handler:n,config:i}}var C,e=P(()=>{"use strict";r.withOptions=function(n,i=()=>({})){function t(o){return{handler:n(o),config:i(o)}}return t.__isOptionsFunction=!0,t};C=r});module.exports=(e(),h(l)).default;
1
+ "use strict";function u(i,n){return{handler:i,config:n}}u.withOptions=function(i,n=()=>({})){function t(o){return{handler:i(o),config:n(o)}}return t.__isOptionsFunction=!0,t};var g=u;module.exports=g;
@@ -0,0 +1,22 @@
1
+ type NamedUtilityValue = {
2
+ kind: 'named';
3
+ /**
4
+ * bg-red-500
5
+ * ^^^^^^^
6
+ *
7
+ * w-1/2
8
+ * ^
9
+ */
10
+ value: string;
11
+ /**
12
+ * w-1/2
13
+ * ^^^
14
+ */
15
+ fraction: string | null;
16
+ };
17
+
18
+ interface PluginUtils {
19
+ theme(keypath: string, defaultValue?: any): any;
20
+ }
21
+
22
+ export type { NamedUtilityValue as N, PluginUtils as P };
@@ -0,0 +1,22 @@
1
+ type NamedUtilityValue = {
2
+ kind: 'named';
3
+ /**
4
+ * bg-red-500
5
+ * ^^^^^^^
6
+ *
7
+ * w-1/2
8
+ * ^
9
+ */
10
+ value: string;
11
+ /**
12
+ * w-1/2
13
+ * ^^^
14
+ */
15
+ fraction: string | null;
16
+ };
17
+
18
+ interface PluginUtils {
19
+ theme(keypath: string, defaultValue?: any): any;
20
+ }
21
+
22
+ export type { NamedUtilityValue as N, PluginUtils as P };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss",
3
- "version": "4.0.0-alpha.20",
3
+ "version": "4.0.0-alpha.21",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -54,7 +54,7 @@
54
54
  "devDependencies": {
55
55
  "@types/node": "^20.14.8",
56
56
  "lightningcss": "^1.26.0",
57
- "@tailwindcss/oxide": "4.0.0-alpha.20"
57
+ "@tailwindcss/oxide": "4.0.0-alpha.21"
58
58
  },
59
59
  "scripts": {
60
60
  "lint": "tsc --noEmit",
@@ -1,14 +0,0 @@
1
- interface PluginUtils {
2
- theme(keypath: string, defaultValue?: any): any;
3
- }
4
-
5
- type ResolvableTo<T> = T | ((utils: PluginUtils) => T);
6
- interface UserConfig {
7
- theme?: ThemeConfig;
8
- }
9
- type ThemeValue = ResolvableTo<Record<string, unknown>> | null | undefined;
10
- type ThemeConfig = Record<string, ThemeValue> & {
11
- extend?: Record<string, ThemeValue>;
12
- };
13
-
14
- export type { ThemeValue as T, UserConfig as U };