@cdx-ui/components 0.0.1-alpha.3 → 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.
@@ -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",
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",
@@ -9,13 +9,18 @@
9
9
  "exports": {
10
10
  ".": {
11
11
  "react-native": "./src/index.ts",
12
- "source": "./src/index.ts",
13
12
  "types": "./lib/typescript/index.d.ts",
14
13
  "import": "./lib/module/index.js",
15
14
  "require": "./lib/commonjs/index.js",
16
15
  "default": "./lib/module/index.js"
17
16
  },
18
- "./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
+ }
19
24
  },
20
25
  "files": [
21
26
  "lib",
@@ -36,11 +41,10 @@
36
41
  ]
37
42
  },
38
43
  "peerDependencies": {
39
- "react": "*",
40
- "react-native": "*",
44
+ "react": "^18.2.0 || ^19.0.0",
45
+ "react-native": ">=0.76.0",
41
46
  "react-native-reanimated": ">=3.0.0",
42
- "react-native-web": "*",
43
- "uniwind": "*"
47
+ "react-native-web": ">=0.19.0"
44
48
  },
45
49
  "peerDependenciesMeta": {
46
50
  "react-native": {
@@ -51,18 +55,13 @@
51
55
  },
52
56
  "react-native-web": {
53
57
  "optional": true
54
- },
55
- "react-dom": {
56
- "optional": true
57
- },
58
- "uniwind": {
59
- "optional": true
60
58
  }
61
59
  },
62
60
  "dependencies": {
63
61
  "class-variance-authority": "^0.7.1",
64
- "@cdx-ui/primitives": "0.0.1-alpha.3",
65
- "@cdx-ui/utils": "0.0.1-alpha.3"
62
+ "uniwind": "1.4.1",
63
+ "@cdx-ui/utils": "0.0.1-alpha.5",
64
+ "@cdx-ui/primitives": "0.0.1-alpha.5"
66
65
  },
67
66
  "devDependencies": {
68
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
+ }