@cdx-ui/styles 0.0.1-alpha.34

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 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,58 @@
1
+ /** A DTCG token leaf node. */
2
+ export interface TokenValue {
3
+ $type: string;
4
+ $value: string | number;
5
+ $extensions?: Record<string, unknown>;
6
+ }
7
+ /** Recursive token group — every non-leaf node in a theme object. */
8
+ export interface TokenGroup {
9
+ [key: string]: TokenValue | TokenGroup;
10
+ }
11
+ /** Theme metadata stored under `$extensions.com.candescent.theme`. */
12
+ export interface ThemeMetadata {
13
+ name: string;
14
+ preset: string;
15
+ schemaVersion: string;
16
+ }
17
+ /** Override metadata stored under `$extensions.com.candescent.themeOverride`. */
18
+ export interface ThemeOverrideMetadata {
19
+ basePreset: string;
20
+ fiId: string;
21
+ fiName: string;
22
+ schemaVersion: string;
23
+ }
24
+ /**
25
+ * A complete CDX UI theme object (DTCG-compatible).
26
+ *
27
+ * Presets (Poise, Prestige, Pulse) are full theme objects. At runtime the
28
+ * build-time default preset is augmented by FI overrides via
29
+ * `applyThemeOverrides`.
30
+ */
31
+ export type ThemeObject = TokenGroup & {
32
+ $extensions: {
33
+ 'com.candescent.theme': ThemeMetadata;
34
+ [key: string]: unknown;
35
+ };
36
+ modes: {
37
+ light: TokenGroup;
38
+ dark: TokenGroup;
39
+ };
40
+ platform: {
41
+ web: TokenGroup;
42
+ ios: TokenGroup;
43
+ android: TokenGroup;
44
+ };
45
+ };
46
+ /**
47
+ * A theme override — a strict subset of the theme object schema containing
48
+ * only the token paths that differ from the base preset.
49
+ */
50
+ export type ThemeOverride = TokenGroup & {
51
+ $extensions?: {
52
+ 'com.candescent.themeOverride'?: ThemeOverrideMetadata;
53
+ [key: string]: unknown;
54
+ };
55
+ };
56
+ export type Mode = 'light' | 'dark';
57
+ export type Platform = 'web' | 'ios' | 'android';
58
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,8BAA8B;AAC9B,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED,qEAAqE;AACrE,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;CACxC;AAED,sEAAsE;AACtE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,iFAAiF;AACjF,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG;IACrC,WAAW,EAAE;QACX,sBAAsB,EAAE,aAAa,CAAC;QACtC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,KAAK,EAAE;QACL,KAAK,EAAE,UAAU,CAAC;QAClB,IAAI,EAAE,UAAU,CAAC;KAClB,CAAC;IACF,QAAQ,EAAE;QACR,GAAG,EAAE,UAAU,CAAC;QAChB,GAAG,EAAE,UAAU,CAAC;QAChB,OAAO,EAAE,UAAU,CAAC;KACrB,CAAC;CACH,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG;IACvC,WAAW,CAAC,EAAE;QACZ,8BAA8B,CAAC,EAAE,qBAAqB,CAAC;QACvD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC;AACpC,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,CAAC"}
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "@cdx-ui/styles",
3
+ "version": "0.0.1-alpha.34",
4
+ "main": "lib/commonjs/index.js",
5
+ "module": "lib/module/index.js",
6
+ "react-native": "src/index.ts",
7
+ "types": "lib/typescript/index.d.ts",
8
+ "source": "src/index.ts",
9
+ "exports": {
10
+ ".": {
11
+ "react-native": "./src/index.ts",
12
+ "types": "./lib/typescript/index.d.ts",
13
+ "import": "./lib/module/index.js",
14
+ "require": "./lib/commonjs/index.js",
15
+ "default": "./lib/module/index.js"
16
+ },
17
+ "./theme.css": "./css/theme.css",
18
+ "./utilities.css": "./css/utilities.css",
19
+ "./vanilla.css": "./css/vanilla.css",
20
+ "./presets/poise.json": "./tokens/presets/poise.json",
21
+ "./presets/prestige.json": "./tokens/presets/prestige.json",
22
+ "./presets/pulse.json": "./tokens/presets/pulse.json"
23
+ },
24
+ "files": [
25
+ "lib",
26
+ "src",
27
+ "css",
28
+ "tokens"
29
+ ],
30
+ "react-native-builder-bob": {
31
+ "source": "src",
32
+ "output": "lib",
33
+ "targets": [
34
+ "commonjs",
35
+ "module",
36
+ [
37
+ "typescript",
38
+ {
39
+ "project": "tsconfig.build.json"
40
+ }
41
+ ]
42
+ ]
43
+ },
44
+ "dependencies": {
45
+ "@cdx-ui/utils": "0.0.1-alpha.34"
46
+ },
47
+ "devDependencies": {
48
+ "react-native-builder-bob": "^0.40.17",
49
+ "style-dictionary": "^4.4.0",
50
+ "typescript": "~5.9.2"
51
+ },
52
+ "nx": {
53
+ "tags": [
54
+ "type:lib",
55
+ "scope:styles"
56
+ ]
57
+ },
58
+ "sideEffects": [
59
+ "**/*.css"
60
+ ],
61
+ "publishConfig": {
62
+ "access": "public"
63
+ },
64
+ "scripts": {
65
+ "build": "bob build",
66
+ "lint": "eslint src/",
67
+ "tokens:fetch": "node scripts/figma-fetch-variables.mjs",
68
+ "tokens:build": "node scripts/build-tokens.mjs"
69
+ }
70
+ }
package/src/index.ts ADDED
@@ -0,0 +1,67 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Types
3
+ // ---------------------------------------------------------------------------
4
+
5
+ /** A DTCG token leaf node. */
6
+ export interface TokenValue {
7
+ $type: string;
8
+ $value: string | number;
9
+ $extensions?: Record<string, unknown>;
10
+ }
11
+
12
+ /** Recursive token group — every non-leaf node in a theme object. */
13
+ export interface TokenGroup {
14
+ [key: string]: TokenValue | TokenGroup;
15
+ }
16
+
17
+ /** Theme metadata stored under `$extensions.com.candescent.theme`. */
18
+ export interface ThemeMetadata {
19
+ name: string;
20
+ preset: string;
21
+ schemaVersion: string;
22
+ }
23
+
24
+ /** Override metadata stored under `$extensions.com.candescent.themeOverride`. */
25
+ export interface ThemeOverrideMetadata {
26
+ basePreset: string;
27
+ fiId: string;
28
+ fiName: string;
29
+ schemaVersion: string;
30
+ }
31
+
32
+ /**
33
+ * A complete CDX UI theme object (DTCG-compatible).
34
+ *
35
+ * Presets (Poise, Prestige, Pulse) are full theme objects. At runtime the
36
+ * build-time default preset is augmented by FI overrides via
37
+ * `applyThemeOverrides`.
38
+ */
39
+ export type ThemeObject = TokenGroup & {
40
+ $extensions: {
41
+ 'com.candescent.theme': ThemeMetadata;
42
+ [key: string]: unknown;
43
+ };
44
+ modes: {
45
+ light: TokenGroup;
46
+ dark: TokenGroup;
47
+ };
48
+ platform: {
49
+ web: TokenGroup;
50
+ ios: TokenGroup;
51
+ android: TokenGroup;
52
+ };
53
+ };
54
+
55
+ /**
56
+ * A theme override — a strict subset of the theme object schema containing
57
+ * only the token paths that differ from the base preset.
58
+ */
59
+ export type ThemeOverride = TokenGroup & {
60
+ $extensions?: {
61
+ 'com.candescent.themeOverride'?: ThemeOverrideMetadata;
62
+ [key: string]: unknown;
63
+ };
64
+ };
65
+
66
+ export type Mode = 'light' | 'dark';
67
+ export type Platform = 'web' | 'ios' | 'android';
@@ -0,0 +1,5 @@
1
+ {
2
+ "poise.json": "2f009aa95e0bff8177411a8c773798d6ee30872b2652683cf764a4621bc2c355",
3
+ "prestige.json": "2cb3d8fa7e077d5f34884d509f640c869c3eb26f86a29c183d22a323dc4931e5",
4
+ "pulse.json": "bc32f6629d2547266d5f34e60b315575be8f9cc86f43bdde31f07379df094cdc"
5
+ }