@cdx-ui/components 0.0.1-alpha.4 → 0.0.1-alpha.5
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/lib/commonjs/metro/withCdxMetroConfig.js +24 -0
- package/lib/commonjs/metro/withCdxMetroConfig.js.map +1 -0
- package/lib/module/metro/withCdxMetroConfig.js +20 -0
- package/lib/module/metro/withCdxMetroConfig.js.map +1 -0
- package/lib/typescript/metro/withCdxMetroConfig.d.ts +19 -0
- package/lib/typescript/metro/withCdxMetroConfig.d.ts.map +1 -0
- package/package.json +12 -9
- package/src/metro/withCdxMetroConfig.ts +29 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.withCdxMetroConfig = withCdxMetroConfig;
|
|
7
|
+
var _metro = require("uniwind/metro");
|
|
8
|
+
/**
|
|
9
|
+
* Wraps a Metro config with CDX UI's styling-layer configuration.
|
|
10
|
+
*
|
|
11
|
+
* Today this delegates to Uniwind. If the styling layer is swapped (see
|
|
12
|
+
* `docs/research/uniwind-to-nativewind-contingency.md`), only the internals
|
|
13
|
+
* of this function change — consuming Metro configs stay the same.
|
|
14
|
+
*
|
|
15
|
+
* Must be the **outermost** Metro config wrapper (after any other wrappers
|
|
16
|
+
* like `withStorybook`).
|
|
17
|
+
*/
|
|
18
|
+
function withCdxMetroConfig(config, options) {
|
|
19
|
+
return (0, _metro.withUniwindConfig)(config, {
|
|
20
|
+
cssEntryFile: options.cssEntryFile,
|
|
21
|
+
dtsFile: options.generatedTypesFile
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=withCdxMetroConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_metro","require","withCdxMetroConfig","config","options","withUniwindConfig","cssEntryFile","dtsFile","generatedTypesFile"],"sourceRoot":"../../../src","sources":["metro/withCdxMetroConfig.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,kBAAkBA,CAChCC,MAAS,EACTC,OAA8B,EAC3B;EACH,OAAO,IAAAC,wBAAiB,EAACF,MAAM,EAAE;IAC/BG,YAAY,EAAEF,OAAO,CAACE,YAAY;IAClCC,OAAO,EAAEH,OAAO,CAACI;EACnB,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { withUniwindConfig } from 'uniwind/metro';
|
|
4
|
+
/**
|
|
5
|
+
* Wraps a Metro config with CDX UI's styling-layer configuration.
|
|
6
|
+
*
|
|
7
|
+
* Today this delegates to Uniwind. If the styling layer is swapped (see
|
|
8
|
+
* `docs/research/uniwind-to-nativewind-contingency.md`), only the internals
|
|
9
|
+
* of this function change — consuming Metro configs stay the same.
|
|
10
|
+
*
|
|
11
|
+
* Must be the **outermost** Metro config wrapper (after any other wrappers
|
|
12
|
+
* like `withStorybook`).
|
|
13
|
+
*/
|
|
14
|
+
export function withCdxMetroConfig(config, options) {
|
|
15
|
+
return withUniwindConfig(config, {
|
|
16
|
+
cssEntryFile: options.cssEntryFile,
|
|
17
|
+
dtsFile: options.generatedTypesFile
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=withCdxMetroConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["withUniwindConfig","withCdxMetroConfig","config","options","cssEntryFile","dtsFile","generatedTypesFile"],"sourceRoot":"../../../src","sources":["metro/withCdxMetroConfig.ts"],"mappings":";;AACA,SAASA,iBAAiB,QAAQ,eAAe;AASjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAChCC,MAAS,EACTC,OAA8B,EAC3B;EACH,OAAOH,iBAAiB,CAACE,MAAM,EAAE;IAC/BE,YAAY,EAAED,OAAO,CAACC,YAAY;IAClCC,OAAO,EAAEF,OAAO,CAACG;EACnB,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { MetroConfig } from 'metro-config';
|
|
2
|
+
export interface CdxMetroConfigOptions {
|
|
3
|
+
/** Path to the CSS entry file (e.g., `'./global.css'`). */
|
|
4
|
+
cssEntryFile: string;
|
|
5
|
+
/** Path where generated Tailwind class type definitions are written. */
|
|
6
|
+
generatedTypesFile?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Wraps a Metro config with CDX UI's styling-layer configuration.
|
|
10
|
+
*
|
|
11
|
+
* Today this delegates to Uniwind. If the styling layer is swapped (see
|
|
12
|
+
* `docs/research/uniwind-to-nativewind-contingency.md`), only the internals
|
|
13
|
+
* of this function change — consuming Metro configs stay the same.
|
|
14
|
+
*
|
|
15
|
+
* Must be the **outermost** Metro config wrapper (after any other wrappers
|
|
16
|
+
* like `withStorybook`).
|
|
17
|
+
*/
|
|
18
|
+
export declare function withCdxMetroConfig<T extends MetroConfig>(config: T, options: CdxMetroConfigOptions): T;
|
|
19
|
+
//# sourceMappingURL=withCdxMetroConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withCdxMetroConfig.d.ts","sourceRoot":"","sources":["../../../src/metro/withCdxMetroConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,qBAAqB;IACpC,2DAA2D;IAC3D,YAAY,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,WAAW,EACtD,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,qBAAqB,GAC7B,CAAC,CAKH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdx-ui/components",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.5",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"module": "lib/module/index.js",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -14,7 +14,13 @@
|
|
|
14
14
|
"require": "./lib/commonjs/index.js",
|
|
15
15
|
"default": "./lib/module/index.js"
|
|
16
16
|
},
|
|
17
|
-
"./styles.css": "./src/styles.css"
|
|
17
|
+
"./styles.css": "./src/styles.css",
|
|
18
|
+
"./metro": {
|
|
19
|
+
"types": "./lib/typescript/metro/withCdxMetroConfig.d.ts",
|
|
20
|
+
"require": "./lib/commonjs/metro/withCdxMetroConfig.js",
|
|
21
|
+
"import": "./lib/module/metro/withCdxMetroConfig.js",
|
|
22
|
+
"default": "./lib/commonjs/metro/withCdxMetroConfig.js"
|
|
23
|
+
}
|
|
18
24
|
},
|
|
19
25
|
"files": [
|
|
20
26
|
"lib",
|
|
@@ -38,8 +44,7 @@
|
|
|
38
44
|
"react": "^18.2.0 || ^19.0.0",
|
|
39
45
|
"react-native": ">=0.76.0",
|
|
40
46
|
"react-native-reanimated": ">=3.0.0",
|
|
41
|
-
"react-native-web": ">=0.19.0"
|
|
42
|
-
"uniwind": "*"
|
|
47
|
+
"react-native-web": ">=0.19.0"
|
|
43
48
|
},
|
|
44
49
|
"peerDependenciesMeta": {
|
|
45
50
|
"react-native": {
|
|
@@ -50,15 +55,13 @@
|
|
|
50
55
|
},
|
|
51
56
|
"react-native-web": {
|
|
52
57
|
"optional": true
|
|
53
|
-
},
|
|
54
|
-
"uniwind": {
|
|
55
|
-
"optional": true
|
|
56
58
|
}
|
|
57
59
|
},
|
|
58
60
|
"dependencies": {
|
|
59
61
|
"class-variance-authority": "^0.7.1",
|
|
60
|
-
"
|
|
61
|
-
"@cdx-ui/utils": "0.0.1-alpha.
|
|
62
|
+
"uniwind": "1.4.1",
|
|
63
|
+
"@cdx-ui/utils": "0.0.1-alpha.5",
|
|
64
|
+
"@cdx-ui/primitives": "0.0.1-alpha.5"
|
|
62
65
|
},
|
|
63
66
|
"devDependencies": {
|
|
64
67
|
"@types/react": "*",
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { MetroConfig } from 'metro-config';
|
|
2
|
+
import { withUniwindConfig } from 'uniwind/metro';
|
|
3
|
+
|
|
4
|
+
export interface CdxMetroConfigOptions {
|
|
5
|
+
/** Path to the CSS entry file (e.g., `'./global.css'`). */
|
|
6
|
+
cssEntryFile: string;
|
|
7
|
+
/** Path where generated Tailwind class type definitions are written. */
|
|
8
|
+
generatedTypesFile?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Wraps a Metro config with CDX UI's styling-layer configuration.
|
|
13
|
+
*
|
|
14
|
+
* Today this delegates to Uniwind. If the styling layer is swapped (see
|
|
15
|
+
* `docs/research/uniwind-to-nativewind-contingency.md`), only the internals
|
|
16
|
+
* of this function change — consuming Metro configs stay the same.
|
|
17
|
+
*
|
|
18
|
+
* Must be the **outermost** Metro config wrapper (after any other wrappers
|
|
19
|
+
* like `withStorybook`).
|
|
20
|
+
*/
|
|
21
|
+
export function withCdxMetroConfig<T extends MetroConfig>(
|
|
22
|
+
config: T,
|
|
23
|
+
options: CdxMetroConfigOptions,
|
|
24
|
+
): T {
|
|
25
|
+
return withUniwindConfig(config, {
|
|
26
|
+
cssEntryFile: options.cssEntryFile,
|
|
27
|
+
dtsFile: options.generatedTypesFile,
|
|
28
|
+
}) as T;
|
|
29
|
+
}
|