@oxyhq/bloom 0.39.0 → 0.40.0
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/theme/build-theme-from-seed.js +90 -0
- package/lib/commonjs/theme/build-theme-from-seed.js.map +1 -0
- package/lib/commonjs/theme/index.js +94 -0
- package/lib/commonjs/theme/index.js.map +1 -1
- package/lib/commonjs/theme/seed-scope/index.js +87 -0
- package/lib/commonjs/theme/seed-scope/index.js.map +1 -0
- package/lib/commonjs/theme/seed-scope/index.web.js +86 -0
- package/lib/commonjs/theme/seed-scope/index.web.js.map +1 -0
- package/lib/module/theme/build-theme-from-seed.js +85 -0
- package/lib/module/theme/build-theme-from-seed.js.map +1 -0
- package/lib/module/theme/index.js +7 -0
- package/lib/module/theme/index.js.map +1 -1
- package/lib/module/theme/seed-scope/index.js +82 -0
- package/lib/module/theme/seed-scope/index.js.map +1 -0
- package/lib/module/theme/seed-scope/index.web.js +81 -0
- package/lib/module/theme/seed-scope/index.web.js.map +1 -0
- package/lib/typescript/commonjs/theme/build-theme-from-seed.d.ts +23 -0
- package/lib/typescript/commonjs/theme/build-theme-from-seed.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/index.d.ts +7 -0
- package/lib/typescript/commonjs/theme/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/seed-scope/index.d.ts +37 -0
- package/lib/typescript/commonjs/theme/seed-scope/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/seed-scope/index.web.d.ts +35 -0
- package/lib/typescript/commonjs/theme/seed-scope/index.web.d.ts.map +1 -0
- package/lib/typescript/module/theme/build-theme-from-seed.d.ts +23 -0
- package/lib/typescript/module/theme/build-theme-from-seed.d.ts.map +1 -0
- package/lib/typescript/module/theme/index.d.ts +7 -0
- package/lib/typescript/module/theme/index.d.ts.map +1 -1
- package/lib/typescript/module/theme/seed-scope/index.d.ts +37 -0
- package/lib/typescript/module/theme/seed-scope/index.d.ts.map +1 -0
- package/lib/typescript/module/theme/seed-scope/index.web.d.ts +35 -0
- package/lib/typescript/module/theme/seed-scope/index.web.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/theme/__tests__/build-theme-from-seed-parity.test.ts +33 -0
- package/src/theme/build-theme-from-seed.ts +99 -0
- package/src/theme/index.ts +21 -0
- package/src/theme/seed-scope/index.tsx +100 -0
- package/src/theme/seed-scope/index.web.tsx +110 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.buildColorsFromSeed = buildColorsFromSeed;
|
|
7
|
+
exports.buildThemeFromSeed = buildThemeFromSeed;
|
|
8
|
+
var _index = require("./color-engine/index.js");
|
|
9
|
+
var _seedScope = require("./color-scope/seed-scope.js");
|
|
10
|
+
var _buildTheme = require("./build-theme.js");
|
|
11
|
+
var _gradients = require("./gradients.js");
|
|
12
|
+
/**
|
|
13
|
+
* Build the JS `theme.colors` object from an ARBITRARY seed colour — the dynamic
|
|
14
|
+
* counterpart of `buildTheme(preset, …)`.
|
|
15
|
+
*
|
|
16
|
+
* This mirrors `buildColorsFromPreset` (`build-theme.ts`) field-for-field, but
|
|
17
|
+
* sources its tokens from `buildSeedScopeVars({ seed })` instead of a named
|
|
18
|
+
* preset, so a preset's seed reproduces that preset's JS theme exactly. Keeping
|
|
19
|
+
* the two in lockstep is enforced by `__tests__/build-theme-from-seed-parity.test.ts`.
|
|
20
|
+
*
|
|
21
|
+
* Token-backed fields read the resolved `rgb(...)` token map; the brand-tint
|
|
22
|
+
* family (primarySubtle / negative / …) reads the engine's container/error roles
|
|
23
|
+
* directly — identical to the preset path.
|
|
24
|
+
*/
|
|
25
|
+
function buildColorsFromSeed(seed, resolved, variant, contrastLevel) {
|
|
26
|
+
const t = (0, _seedScope.buildSeedScopeVars)({
|
|
27
|
+
seed,
|
|
28
|
+
mode: resolved,
|
|
29
|
+
variant,
|
|
30
|
+
contrastLevel
|
|
31
|
+
});
|
|
32
|
+
const isDark = resolved === 'dark';
|
|
33
|
+
|
|
34
|
+
// Read a resolved `rgb(...)` token by its bare name (no leading `--`).
|
|
35
|
+
const g = k => t[`--${k}`] ?? 'rgb(0 0 0)';
|
|
36
|
+
const r = (0, _index.generateRoleColors)({
|
|
37
|
+
seed,
|
|
38
|
+
variant,
|
|
39
|
+
isDark,
|
|
40
|
+
contrastLevel
|
|
41
|
+
});
|
|
42
|
+
return {
|
|
43
|
+
background: g('background'),
|
|
44
|
+
backgroundSecondary: g('surface'),
|
|
45
|
+
backgroundTertiary: g('popover'),
|
|
46
|
+
text: g('foreground'),
|
|
47
|
+
textSecondary: g('muted-foreground'),
|
|
48
|
+
textTertiary: r.outline,
|
|
49
|
+
border: g('border'),
|
|
50
|
+
borderLight: g('input'),
|
|
51
|
+
primary: g('primary'),
|
|
52
|
+
primaryForeground: g('primary-foreground'),
|
|
53
|
+
primaryLight: g('surface'),
|
|
54
|
+
primaryDark: g('background'),
|
|
55
|
+
secondary: g('secondary'),
|
|
56
|
+
secondaryForeground: g('secondary-foreground'),
|
|
57
|
+
tertiary: g('tertiary'),
|
|
58
|
+
tertiaryForeground: g('tertiary-foreground'),
|
|
59
|
+
tint: g('primary'),
|
|
60
|
+
icon: g('muted-foreground'),
|
|
61
|
+
iconActive: g('primary'),
|
|
62
|
+
..._buildTheme.STATUS_COLORS,
|
|
63
|
+
primarySubtle: r.primaryContainer,
|
|
64
|
+
primarySubtleForeground: r.onPrimaryContainer,
|
|
65
|
+
negative: r.error,
|
|
66
|
+
negativeForeground: r.onError,
|
|
67
|
+
negativeSubtle: r.errorContainer,
|
|
68
|
+
negativeSubtleForeground: r.onErrorContainer,
|
|
69
|
+
contrast50: g('muted'),
|
|
70
|
+
card: g('card'),
|
|
71
|
+
shadow: isDark ? 'rgba(0, 0, 0, 0.3)' : 'rgba(0, 0, 0, 0.1)',
|
|
72
|
+
overlay: 'rgba(0, 0, 0, 0.5)'
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Build a full `Theme` from a seed colour and a resolved light/dark mode. Unlike
|
|
78
|
+
* `buildTheme`, there is no adaptive (Material You / iOS dynamic) override — a
|
|
79
|
+
* seed IS the dynamic source here.
|
|
80
|
+
*/
|
|
81
|
+
function buildThemeFromSeed(seed, resolved, variant, contrastLevel) {
|
|
82
|
+
return {
|
|
83
|
+
mode: resolved,
|
|
84
|
+
colors: buildColorsFromSeed(seed, resolved, variant, contrastLevel),
|
|
85
|
+
gradients: _gradients.THEME_GRADIENTS,
|
|
86
|
+
isDark: resolved === 'dark',
|
|
87
|
+
isLight: resolved === 'light'
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=build-theme-from-seed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_index","require","_seedScope","_buildTheme","_gradients","buildColorsFromSeed","seed","resolved","variant","contrastLevel","t","buildSeedScopeVars","mode","isDark","g","k","r","generateRoleColors","background","backgroundSecondary","backgroundTertiary","text","textSecondary","textTertiary","outline","border","borderLight","primary","primaryForeground","primaryLight","primaryDark","secondary","secondaryForeground","tertiary","tertiaryForeground","tint","icon","iconActive","STATUS_COLORS","primarySubtle","primaryContainer","primarySubtleForeground","onPrimaryContainer","negative","error","negativeForeground","onError","negativeSubtle","errorContainer","negativeSubtleForeground","onErrorContainer","contrast50","card","shadow","overlay","buildThemeFromSeed","colors","gradients","THEME_GRADIENTS","isLight"],"sourceRoot":"../../../src","sources":["theme/build-theme-from-seed.ts"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS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EAAErB,CAAC,CAAC,SAAS,CAAC;IAClBsB,IAAI,EAAEtB,CAAC,CAAC,kBAAkB,CAAC;IAC3BuB,UAAU,EAAEvB,CAAC,CAAC,SAAS,CAAC;IAExB,GAAGwB,yBAAa;IAEhBC,aAAa,EAAEvB,CAAC,CAACwB,gBAAgB;IACjCC,uBAAuB,EAAEzB,CAAC,CAAC0B,kBAAkB;IAC7CC,QAAQ,EAAE3B,CAAC,CAAC4B,KAAK;IACjBC,kBAAkB,EAAE7B,CAAC,CAAC8B,OAAO;IAC7BC,cAAc,EAAE/B,CAAC,CAACgC,cAAc;IAChCC,wBAAwB,EAAEjC,CAAC,CAACkC,gBAAgB;IAC5CC,UAAU,EAAErC,CAAC,CAAC,OAAO,CAAC;IAEtBsC,IAAI,EAAEtC,CAAC,CAAC,MAAM,CAAC;IACfuC,MAAM,EAAExC,MAAM,GAAG,oBAAoB,GAAG,oBAAoB;IAC5DyC,OAAO,EAAE;EACX,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,kBAAkBA,CAChCjD,IAAY,EACZC,QAA0B,EAC1BC,OAAuB,EACvBC,aAAsB,EACf;EACP,OAAO;IACLG,IAAI,EAAEL,QAAQ;IACdiD,MAAM,EAAEnD,mBAAmB,CAACC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,aAAa,CAAC;IACnEgD,SAAS,EAAEC,0BAAe;IAC1B7C,MAAM,EAAEN,QAAQ,KAAK,MAAM;IAC3BoD,OAAO,EAAEpD,QAAQ,KAAK;EACxB,CAAC;AACH","ignoreList":[]}
|
|
@@ -21,6 +21,12 @@ Object.defineProperty(exports, "BloomColorScope", {
|
|
|
21
21
|
return _colorScope.BloomColorScope;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "BloomSeedScope", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _seedScope.BloomSeedScope;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
24
30
|
Object.defineProperty(exports, "BloomThemeProvider", {
|
|
25
31
|
enumerable: true,
|
|
26
32
|
get: function () {
|
|
@@ -63,18 +69,72 @@ Object.defineProperty(exports, "applyPresetVarsToDocument", {
|
|
|
63
69
|
return _presetVars.applyPresetVarsToDocument;
|
|
64
70
|
}
|
|
65
71
|
});
|
|
72
|
+
Object.defineProperty(exports, "argbFromHex", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _index.argbFromHex;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "argbFromRgb", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _index.argbFromRgb;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "blueFromArgb", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _index.blueFromArgb;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "buildColorsFromSeed", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _buildThemeFromSeed.buildColorsFromSeed;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "buildSeedScopeVars", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _seedScope2.buildSeedScopeVars;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
66
102
|
Object.defineProperty(exports, "buildTheme", {
|
|
67
103
|
enumerable: true,
|
|
68
104
|
get: function () {
|
|
69
105
|
return _buildTheme.buildTheme;
|
|
70
106
|
}
|
|
71
107
|
});
|
|
108
|
+
Object.defineProperty(exports, "buildThemeFromSeed", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return _buildThemeFromSeed.buildThemeFromSeed;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "generateRoleColors", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return _index.generateRoleColors;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
72
120
|
Object.defineProperty(exports, "getPresetVars", {
|
|
73
121
|
enumerable: true,
|
|
74
122
|
get: function () {
|
|
75
123
|
return _presetVars.getPresetVars;
|
|
76
124
|
}
|
|
77
125
|
});
|
|
126
|
+
Object.defineProperty(exports, "greenFromArgb", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () {
|
|
129
|
+
return _index.greenFromArgb;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "hexFromArgb", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function () {
|
|
135
|
+
return _index.hexFromArgb;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
78
138
|
Object.defineProperty(exports, "hexToAppColorName", {
|
|
79
139
|
enumerable: true,
|
|
80
140
|
get: function () {
|
|
@@ -93,6 +153,36 @@ Object.defineProperty(exports, "parseRgb", {
|
|
|
93
153
|
return _colorUtils.parseRgb;
|
|
94
154
|
}
|
|
95
155
|
});
|
|
156
|
+
Object.defineProperty(exports, "quantizeImage", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function () {
|
|
159
|
+
return _index.quantizeImage;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
Object.defineProperty(exports, "redFromArgb", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function () {
|
|
165
|
+
return _index.redFromArgb;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
Object.defineProperty(exports, "roleColorsToPresetTokens", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function () {
|
|
171
|
+
return _seedScope2.roleColorsToPresetTokens;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
Object.defineProperty(exports, "seedHexFromImagePixels", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function () {
|
|
177
|
+
return _index.seedHexFromImagePixels;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
Object.defineProperty(exports, "seedsFromImagePixels", {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
get: function () {
|
|
183
|
+
return _index.seedsFromImagePixels;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
96
186
|
Object.defineProperty(exports, "setColorSchemeSafe", {
|
|
97
187
|
enumerable: true,
|
|
98
188
|
get: function () {
|
|
@@ -143,7 +233,11 @@ Object.defineProperty(exports, "withAlpha", {
|
|
|
143
233
|
});
|
|
144
234
|
var _BloomThemeProvider = require("./BloomThemeProvider.js");
|
|
145
235
|
var _colorScope = require("./color-scope");
|
|
236
|
+
var _seedScope = require("./seed-scope");
|
|
237
|
+
var _seedScope2 = require("./color-scope/seed-scope.js");
|
|
238
|
+
var _index = require("./color-engine/index.js");
|
|
146
239
|
var _buildTheme = require("./build-theme.js");
|
|
240
|
+
var _buildThemeFromSeed = require("./build-theme-from-seed.js");
|
|
147
241
|
var _gradients = require("./gradients.js");
|
|
148
242
|
var _useTheme = require("./use-theme.js");
|
|
149
243
|
var _useNavigationTheme = require("./use-navigation-theme.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_BloomThemeProvider","require","_colorScope","_buildTheme","_gradients","_useTheme","_useNavigationTheme","_colorPresets","_colorUtils","_presetVars","_applyDarkClass","_setColorSchemeSafe","_initCssInterop","_persistence"],"sourceRoot":"../../../src","sources":["theme/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_BloomThemeProvider","require","_colorScope","_seedScope","_seedScope2","_index","_buildTheme","_buildThemeFromSeed","_gradients","_useTheme","_useNavigationTheme","_colorPresets","_colorUtils","_presetVars","_applyDarkClass","_setColorSchemeSafe","_initCssInterop","_persistence"],"sourceRoot":"../../../src","sources":["theme/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAaA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,mBAAA,GAAAT,OAAA;AAIA,IAAAU,aAAA,GAAAV,OAAA;AAOA,IAAAW,WAAA,GAAAX,OAAA;AAEA,IAAAY,WAAA,GAAAZ,OAAA;AACA,IAAAa,eAAA,GAAAb,OAAA;AACA,IAAAc,mBAAA,GAAAd,OAAA;AACA,IAAAe,eAAA,GAAAf,OAAA;AAEA,IAAAgB,YAAA,GAAAhB,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BloomSeedScope = BloomSeedScope;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _BloomThemeProvider = require("../BloomThemeProvider.js");
|
|
10
|
+
var _seedScope = require("../color-scope/seed-scope.js");
|
|
11
|
+
var _styleBuilder = require("../color-scope/style-builder.js");
|
|
12
|
+
var _buildThemeFromSeed = require("../build-theme-from-seed.js");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
|
+
/**
|
|
16
|
+
* Native `<BloomSeedScope>`: scopes a subtree to an ARBITRARY seed colour's
|
|
17
|
+
* palette (the dynamic counterpart of `<BloomColorScope>`, which takes a named
|
|
18
|
+
* preset). Feeds the seed through the colour engine and (1) provides the
|
|
19
|
+
* resulting canonical CSS vars to descendants via react-native-css's
|
|
20
|
+
* `VariableContext` — so `bg-background` / `bg-card` / `var(--primary)` resolve
|
|
21
|
+
* against the seed inside this subtree — and (2) publishes a matching JS `theme`
|
|
22
|
+
* on `BloomThemeContext`, so `useTheme()`/`useBloomTheme()` consumers inside the
|
|
23
|
+
* subtree also re-theme. The `colorPreset` field is left as the parent's (a seed
|
|
24
|
+
* is not a named preset).
|
|
25
|
+
*/
|
|
26
|
+
function BloomSeedScope({
|
|
27
|
+
seed,
|
|
28
|
+
variant,
|
|
29
|
+
contrastLevel,
|
|
30
|
+
asChild = false,
|
|
31
|
+
style,
|
|
32
|
+
children
|
|
33
|
+
}) {
|
|
34
|
+
// Hooks run unconditionally; conditional no-op/throw is applied afterwards.
|
|
35
|
+
const parent = (0, _react.useContext)(_BloomThemeProvider.BloomThemeContext);
|
|
36
|
+
const resolvedMode = parent?.theme.mode ?? 'light';
|
|
37
|
+
const nativeVars = (0, _react.useMemo)(() => seed ? (0, _seedScope.buildSeedScopeVars)({
|
|
38
|
+
seed,
|
|
39
|
+
mode: resolvedMode,
|
|
40
|
+
variant,
|
|
41
|
+
contrastLevel
|
|
42
|
+
}) : null, [seed, resolvedMode, variant, contrastLevel]);
|
|
43
|
+
const contextValue = (0, _react.useMemo)(() => {
|
|
44
|
+
if (!parent || !seed) return null;
|
|
45
|
+
const theme = (0, _buildThemeFromSeed.buildThemeFromSeed)(seed, resolvedMode, variant, contrastLevel);
|
|
46
|
+
return {
|
|
47
|
+
...parent,
|
|
48
|
+
theme
|
|
49
|
+
};
|
|
50
|
+
}, [parent, seed, resolvedMode, variant, contrastLevel]);
|
|
51
|
+
if (!parent) {
|
|
52
|
+
throw new Error('BloomSeedScope must be used within a <BloomThemeProvider>');
|
|
53
|
+
}
|
|
54
|
+
// `seed` undefined => no-op; children inherit the parent scope.
|
|
55
|
+
if (!nativeVars || !contextValue) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
56
|
+
children: children
|
|
57
|
+
});
|
|
58
|
+
const VariableProvider = (0, _styleBuilder.getVariableContextProvider)();
|
|
59
|
+
let content;
|
|
60
|
+
if (asChild) {
|
|
61
|
+
const child = _react.Children.only(children);
|
|
62
|
+
if (! /*#__PURE__*/(0, _react.isValidElement)(child)) {
|
|
63
|
+
throw new Error('BloomSeedScope with `asChild` requires a single React element child that accepts a `style` prop.');
|
|
64
|
+
}
|
|
65
|
+
const childStyle = child.props.style;
|
|
66
|
+
const mergedStyle = [style, childStyle];
|
|
67
|
+
content = /*#__PURE__*/(0, _react.cloneElement)(child, {
|
|
68
|
+
style: mergedStyle
|
|
69
|
+
});
|
|
70
|
+
} else {
|
|
71
|
+
content = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
72
|
+
style: [{
|
|
73
|
+
flex: 1
|
|
74
|
+
}, style],
|
|
75
|
+
children: children
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
const scoped = VariableProvider ? /*#__PURE__*/(0, _jsxRuntime.jsx)(VariableProvider, {
|
|
79
|
+
value: nativeVars,
|
|
80
|
+
children: content
|
|
81
|
+
}) : content;
|
|
82
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_BloomThemeProvider.BloomThemeContext.Provider, {
|
|
83
|
+
value: contextValue,
|
|
84
|
+
children: scoped
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_BloomThemeProvider","_seedScope","_styleBuilder","_buildThemeFromSeed","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","BloomSeedScope","seed","variant","contrastLevel","asChild","style","children","parent","useContext","BloomThemeContext","resolvedMode","theme","mode","nativeVars","useMemo","buildSeedScopeVars","contextValue","buildThemeFromSeed","Error","jsx","Fragment","VariableProvider","getVariableContextProvider","content","child","Children","only","isValidElement","childStyle","props","mergedStyle","cloneElement","View","flex","scoped","value","Provider"],"sourceRoot":"../../../../src","sources":["theme/seed-scope/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AAA8D,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAD,wBAAAQ,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAV,uBAAA,YAAAA,CAAAQ,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAA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AAC,QAAA,EAAEA;IAAQ,CAAO,CAAC;EAChE;EAEA,MAAM4B,MAAM,GAAGb,gBAAgB,gBAC7B,IAAAzC,WAAA,CAAAuC,GAAA,EAACE,gBAAgB;IAACc,KAAK,EAAEtB,UAAW;IAAAP,QAAA,EAAEiB;EAAO,CAAmB,CAAC,GAEjEA,OACD;EAED,oBAAO,IAAA3C,WAAA,CAAAuC,GAAA,EAAC3C,mBAAA,CAAAiC,iBAAiB,CAAC2B,QAAQ;IAACD,KAAK,EAAEnB,YAAa;IAAAV,QAAA,EAAE4B;EAAM,CAA6B,CAAC;AAC/F","ignoreList":[]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BloomSeedScope = BloomSeedScope;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _BloomThemeProvider = require("../BloomThemeProvider.js");
|
|
9
|
+
var _seedScope = require("../color-scope/seed-scope.js");
|
|
10
|
+
var _buildThemeFromSeed = require("../build-theme-from-seed.js");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
+
/**
|
|
14
|
+
* On web the single `asChild` child is frequently a react-native-web component
|
|
15
|
+
* whose `style` prop is a style ARRAY (or a numeric registered-style id), not a
|
|
16
|
+
* plain object. Spreading such an array into an object literal would copy its
|
|
17
|
+
* numeric indices as keys and crash RNW; merge as an array instead.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Web `<BloomSeedScope>`: scopes a subtree to an ARBITRARY seed colour's palette
|
|
22
|
+
* (the dynamic counterpart of `<BloomColorScope>`). It (1) writes every canonical
|
|
23
|
+
* `--x` token plus the Tailwind v4 `--color-x` aliases (already resolved to
|
|
24
|
+
* `rgb(...)`) onto the wrapping element's inline `style`, so NativeWind classes
|
|
25
|
+
* inside resolve against the seed palette instead of the document root, and
|
|
26
|
+
* (2) publishes a matching JS `theme` on `BloomThemeContext` so
|
|
27
|
+
* `useTheme()`/`useBloomTheme()` consumers inside the subtree re-theme too. The
|
|
28
|
+
* `colorPreset` field is left as the parent's (a seed is not a named preset).
|
|
29
|
+
*/
|
|
30
|
+
function BloomSeedScope({
|
|
31
|
+
seed,
|
|
32
|
+
variant,
|
|
33
|
+
contrastLevel,
|
|
34
|
+
asChild = false,
|
|
35
|
+
style,
|
|
36
|
+
children
|
|
37
|
+
}) {
|
|
38
|
+
const parent = (0, _react.useContext)(_BloomThemeProvider.BloomThemeContext);
|
|
39
|
+
const resolvedMode = parent?.theme.mode ?? 'light';
|
|
40
|
+
const varsStyle = (0, _react.useMemo)(() => seed ? (0, _seedScope.buildSeedScopeVars)({
|
|
41
|
+
seed,
|
|
42
|
+
mode: resolvedMode,
|
|
43
|
+
variant,
|
|
44
|
+
contrastLevel
|
|
45
|
+
}) : null, [seed, resolvedMode, variant, contrastLevel]);
|
|
46
|
+
const contextValue = (0, _react.useMemo)(() => {
|
|
47
|
+
if (!parent || !seed) return null;
|
|
48
|
+
const theme = (0, _buildThemeFromSeed.buildThemeFromSeed)(seed, resolvedMode, variant, contrastLevel);
|
|
49
|
+
return {
|
|
50
|
+
...parent,
|
|
51
|
+
theme
|
|
52
|
+
};
|
|
53
|
+
}, [parent, seed, resolvedMode, variant, contrastLevel]);
|
|
54
|
+
if (!parent) {
|
|
55
|
+
throw new Error('BloomSeedScope must be used within a <BloomThemeProvider>');
|
|
56
|
+
}
|
|
57
|
+
if (!varsStyle || !contextValue) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
58
|
+
children: children
|
|
59
|
+
});
|
|
60
|
+
let content;
|
|
61
|
+
if (asChild) {
|
|
62
|
+
const child = _react.Children.only(children);
|
|
63
|
+
if (! /*#__PURE__*/(0, _react.isValidElement)(child)) {
|
|
64
|
+
throw new Error('BloomSeedScope with `asChild` requires a single React element child that accepts a `style` prop.');
|
|
65
|
+
}
|
|
66
|
+
const childStyle = child.props.style;
|
|
67
|
+
const mergedStyle = [varsStyle, style, childStyle];
|
|
68
|
+
content = /*#__PURE__*/(0, _react.cloneElement)(child, {
|
|
69
|
+
style: mergedStyle
|
|
70
|
+
});
|
|
71
|
+
} else {
|
|
72
|
+
const mergedStyle = {
|
|
73
|
+
...varsStyle,
|
|
74
|
+
...style
|
|
75
|
+
};
|
|
76
|
+
content = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
77
|
+
style: mergedStyle,
|
|
78
|
+
children: children
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_BloomThemeProvider.BloomThemeContext.Provider, {
|
|
82
|
+
value: contextValue,
|
|
83
|
+
children: content
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=index.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_BloomThemeProvider","_seedScope","_buildThemeFromSeed","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","BloomSeedScope","seed","variant","contrastLevel","asChild","style","children","parent","useContext","BloomThemeContext","resolvedMode","theme","mode","varsStyle","useMemo","buildSeedScopeVars","contextValue","buildThemeFromSeed","Error","jsx","Fragment","content","child","Children","only","isValidElement","childStyle","props","mergedStyle","cloneElement","Provider","value"],"sourceRoot":"../../../../src","sources":["theme/seed-scope/index.web.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AAA8D,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,CAAAM,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAA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B,OAAO,EAAE;IACX,MAAMkB,KAAK,GAAGC,eAAQ,CAACC,IAAI,CAAClB,QAAQ,CAAC;IACrC,IAAI,eAAC,IAAAmB,qBAAc,EAAiBH,KAAK,CAAC,EAAE;MAC1C,MAAM,IAAIJ,KAAK,CACb,kGACF,CAAC;IACH;IACA,MAAMQ,UAAU,GAAGJ,KAAK,CAACK,KAAK,CAACtB,KAAK;IACpC,MAAMuB,WAAqB,GAAG,CAACf,SAAS,EAAER,KAAK,EAAEqB,UAAU,CAAC;IAC5DL,OAAO,gBAAG,IAAAQ,mBAAY,EAACP,KAAK,EAAE;MAAEjB,KAAK,EAAEuB;IAAY,CAAC,CAAC;EACvD,CAAC,MAAM;IACL,MAAMA,WAAgC,GAAG;MAAE,GAAGf,SAAS;MAAE,GAAGR;IAAM,CAAC;IACnEgB,OAAO,gBAAG,IAAAzC,WAAA,CAAAuC,GAAA;MAAKd,KAAK,EAAEuB,WAAY;MAAAtB,QAAA,EAAEA;IAAQ,CAAM,CAAC;EACrD;EAEA,oBAAO,IAAA1B,WAAA,CAAAuC,GAAA,EAAC1C,mBAAA,CAAAgC,iBAAiB,CAACqB,QAAQ;IAACC,KAAK,EAAEf,YAAa;IAAAV,QAAA,EAAEe;EAAO,CAA6B,CAAC;AAChG","ignoreList":[]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { generateRoleColors } from "./color-engine/index.js";
|
|
4
|
+
import { buildSeedScopeVars } from "./color-scope/seed-scope.js";
|
|
5
|
+
import { STATUS_COLORS } from "./build-theme.js";
|
|
6
|
+
import { THEME_GRADIENTS } from "./gradients.js";
|
|
7
|
+
/**
|
|
8
|
+
* Build the JS `theme.colors` object from an ARBITRARY seed colour — the dynamic
|
|
9
|
+
* counterpart of `buildTheme(preset, …)`.
|
|
10
|
+
*
|
|
11
|
+
* This mirrors `buildColorsFromPreset` (`build-theme.ts`) field-for-field, but
|
|
12
|
+
* sources its tokens from `buildSeedScopeVars({ seed })` instead of a named
|
|
13
|
+
* preset, so a preset's seed reproduces that preset's JS theme exactly. Keeping
|
|
14
|
+
* the two in lockstep is enforced by `__tests__/build-theme-from-seed-parity.test.ts`.
|
|
15
|
+
*
|
|
16
|
+
* Token-backed fields read the resolved `rgb(...)` token map; the brand-tint
|
|
17
|
+
* family (primarySubtle / negative / …) reads the engine's container/error roles
|
|
18
|
+
* directly — identical to the preset path.
|
|
19
|
+
*/
|
|
20
|
+
export function buildColorsFromSeed(seed, resolved, variant, contrastLevel) {
|
|
21
|
+
const t = buildSeedScopeVars({
|
|
22
|
+
seed,
|
|
23
|
+
mode: resolved,
|
|
24
|
+
variant,
|
|
25
|
+
contrastLevel
|
|
26
|
+
});
|
|
27
|
+
const isDark = resolved === 'dark';
|
|
28
|
+
|
|
29
|
+
// Read a resolved `rgb(...)` token by its bare name (no leading `--`).
|
|
30
|
+
const g = k => t[`--${k}`] ?? 'rgb(0 0 0)';
|
|
31
|
+
const r = generateRoleColors({
|
|
32
|
+
seed,
|
|
33
|
+
variant,
|
|
34
|
+
isDark,
|
|
35
|
+
contrastLevel
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
background: g('background'),
|
|
39
|
+
backgroundSecondary: g('surface'),
|
|
40
|
+
backgroundTertiary: g('popover'),
|
|
41
|
+
text: g('foreground'),
|
|
42
|
+
textSecondary: g('muted-foreground'),
|
|
43
|
+
textTertiary: r.outline,
|
|
44
|
+
border: g('border'),
|
|
45
|
+
borderLight: g('input'),
|
|
46
|
+
primary: g('primary'),
|
|
47
|
+
primaryForeground: g('primary-foreground'),
|
|
48
|
+
primaryLight: g('surface'),
|
|
49
|
+
primaryDark: g('background'),
|
|
50
|
+
secondary: g('secondary'),
|
|
51
|
+
secondaryForeground: g('secondary-foreground'),
|
|
52
|
+
tertiary: g('tertiary'),
|
|
53
|
+
tertiaryForeground: g('tertiary-foreground'),
|
|
54
|
+
tint: g('primary'),
|
|
55
|
+
icon: g('muted-foreground'),
|
|
56
|
+
iconActive: g('primary'),
|
|
57
|
+
...STATUS_COLORS,
|
|
58
|
+
primarySubtle: r.primaryContainer,
|
|
59
|
+
primarySubtleForeground: r.onPrimaryContainer,
|
|
60
|
+
negative: r.error,
|
|
61
|
+
negativeForeground: r.onError,
|
|
62
|
+
negativeSubtle: r.errorContainer,
|
|
63
|
+
negativeSubtleForeground: r.onErrorContainer,
|
|
64
|
+
contrast50: g('muted'),
|
|
65
|
+
card: g('card'),
|
|
66
|
+
shadow: isDark ? 'rgba(0, 0, 0, 0.3)' : 'rgba(0, 0, 0, 0.1)',
|
|
67
|
+
overlay: 'rgba(0, 0, 0, 0.5)'
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Build a full `Theme` from a seed colour and a resolved light/dark mode. Unlike
|
|
73
|
+
* `buildTheme`, there is no adaptive (Material You / iOS dynamic) override — a
|
|
74
|
+
* seed IS the dynamic source here.
|
|
75
|
+
*/
|
|
76
|
+
export function buildThemeFromSeed(seed, resolved, variant, contrastLevel) {
|
|
77
|
+
return {
|
|
78
|
+
mode: resolved,
|
|
79
|
+
colors: buildColorsFromSeed(seed, resolved, variant, contrastLevel),
|
|
80
|
+
gradients: THEME_GRADIENTS,
|
|
81
|
+
isDark: resolved === 'dark',
|
|
82
|
+
isLight: resolved === 'light'
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=build-theme-from-seed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["generateRoleColors","buildSeedScopeVars","STATUS_COLORS","THEME_GRADIENTS","buildColorsFromSeed","seed","resolved","variant","contrastLevel","t","mode","isDark","g","k","r","background","backgroundSecondary","backgroundTertiary","text","textSecondary","textTertiary","outline","border","borderLight","primary","primaryForeground","primaryLight","primaryDark","secondary","secondaryForeground","tertiary","tertiaryForeground","tint","icon","iconActive","primarySubtle","primaryContainer","primarySubtleForeground","onPrimaryContainer","negative","error","negativeForeground","onError","negativeSubtle","errorContainer","negativeSubtleForeground","onErrorContainer","contrast50","card","shadow","overlay","buildThemeFromSeed","colors","gradients","isLight"],"sourceRoot":"../../../src","sources":["theme/build-theme-from-seed.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAA6C,yBAAgB;AACxF,SAASC,kBAAkB,QAAQ,6BAA0B;AAC7D,SAASC,aAAa,QAAQ,kBAAe;AAC7C,SAASC,eAAe,QAAQ,gBAAa;AAG7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CACjCC,IAAY,EACZC,QAA0B,EAC1BC,OAAuB,EACvBC,aAAsB,EACT;EACb,MAAMC,CAAC,GAAGR,kBAAkB,CAAC;IAAEI,IAAI;IAAEK,IAAI,EAAEJ,QAAQ;IAAEC,OAAO;IAAEC;EAAc,CAAC,CAAC;EAC9E,MAAMG,MAAM,GAAGL,QAAQ,KAAK,MAAM;;EAElC;EACA,MAAMM,CAAC,GAAIC,CAAS,IAAaJ,CAAC,CAAC,KAAKI,CAAC,EAAE,CAAC,IAAI,YAAY;EAE5D,MAAMC,CAAa,GAAGd,kBAAkB,CAAC;IACvCK,IAAI;IACJE,OAAO;IACPI,MAAM;IACNH;EACF,CAAC,CAAC;EAEF,OAAO;IACLO,UAAU,EAAEH,CAAC,CAAC,YAAY,CAAC;IAC3BI,mBAAmB,EAAEJ,CAAC,CAAC,SAAS,CAAC;IACjCK,kBAAkB,EAAEL,CAAC,CAAC,SAAS,CAAC;IAEhCM,IAAI,EAAEN,CAAC,CAAC,YAAY,CAAC;IACrBO,aAAa,EAAEP,CAAC,CAAC,kBAAkB,CAAC;IACpCQ,YAAY,EAAEN,CAAC,CAACO,OAAO;IAEvBC,MAAM,EAAEV,CAAC,CAAC,QAAQ,CAAC;IACnBW,WAAW,EAAEX,CAAC,CAAC,OAAO,CAAC;IAEvBY,OAAO,EAAEZ,CAAC,CAAC,SAAS,CAAC;IACr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C1BQ,MAAM,EAAEL,QAAQ,KAAK,MAAM;IAC3BgD,OAAO,EAAEhD,QAAQ,KAAK;EACxB,CAAC;AACH","ignoreList":[]}
|
|
@@ -2,7 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
export { BloomThemeProvider } from "./BloomThemeProvider.js";
|
|
4
4
|
export { BloomColorScope, useColorScopeStyle } from './color-scope';
|
|
5
|
+
export { BloomSeedScope } from './seed-scope';
|
|
6
|
+
export { buildSeedScopeVars, roleColorsToPresetTokens } from "./color-scope/seed-scope.js";
|
|
7
|
+
// Colour engine — the dependency-free tonal system that turns ANY seed colour
|
|
8
|
+
// into a full role set. Surfaced here so consumers can derive dynamic themes
|
|
9
|
+
// (e.g. from artwork) without reaching into the internal color-engine path.
|
|
10
|
+
export { generateRoleColors, seedHexFromImagePixels, seedsFromImagePixels, quantizeImage, argbFromHex, hexFromArgb, argbFromRgb, redFromArgb, greenFromArgb, blueFromArgb } from "./color-engine/index.js";
|
|
5
11
|
export { buildTheme, STATUS_COLORS } from "./build-theme.js";
|
|
12
|
+
export { buildThemeFromSeed, buildColorsFromSeed } from "./build-theme-from-seed.js";
|
|
6
13
|
export { THEME_GRADIENTS } from "./gradients.js";
|
|
7
14
|
export { useTheme, useThemeColor, useBloomTheme } from "./use-theme.js";
|
|
8
15
|
export { useNavigationTheme } from "./use-navigation-theme.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BloomThemeProvider","BloomColorScope","useColorScopeStyle","buildTheme","STATUS_COLORS","THEME_GRADIENTS","useTheme","useThemeColor","useBloomTheme","useNavigationTheme","APP_COLOR_NAMES","PREMIUM_COLOR_NAMES","APP_COLOR_PRESETS","HEX_TO_APP_COLOR","hexToAppColorName","parseRgb","withAlpha","getPresetVars","applyPresetVarsToDocument","applyDarkClass","setColorSchemeSafe","initCssInteropDarkMode","webLocalStorage"],"sourceRoot":"../../../src","sources":["theme/index.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,yBAAsB;AAKzD,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,eAAe;AAEnE,SAASC,UAAU,EAAEC,aAAa,QAAQ,kBAAe;AACzD,SAASC,eAAe,QAAQ,gBAAa;AAC7C,SAASC,QAAQ,EAAEC,aAAa,EAAEC,aAAa,QAAQ,gBAAa;AACpE,SAASC,kBAAkB,QAAQ,2BAAwB;AAI3D,SACEC,eAAe,EACfC,mBAAmB,EACnBC,iBAAiB,EACjBC,gBAAgB,EAChBC,iBAAiB,QACZ,oBAAiB;AACxB,SAASC,QAAQ,EAAEC,SAAS,QAAQ,kBAAe;AAEnD,SAASC,aAAa,EAAEC,yBAAyB,QAAQ,kBAAe;AACxE,SAASC,cAAc,QAAQ,uBAAoB;AACnD,SAASC,kBAAkB,QAAQ,4BAAyB;AAC5D,SAASC,sBAAsB,QAAQ,uBAAoB;AAE3D,SAASC,eAAe,QAAQ,kBAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["BloomThemeProvider","BloomColorScope","useColorScopeStyle","BloomSeedScope","buildSeedScopeVars","roleColorsToPresetTokens","generateRoleColors","seedHexFromImagePixels","seedsFromImagePixels","quantizeImage","argbFromHex","hexFromArgb","argbFromRgb","redFromArgb","greenFromArgb","blueFromArgb","buildTheme","STATUS_COLORS","buildThemeFromSeed","buildColorsFromSeed","THEME_GRADIENTS","useTheme","useThemeColor","useBloomTheme","useNavigationTheme","APP_COLOR_NAMES","PREMIUM_COLOR_NAMES","APP_COLOR_PRESETS","HEX_TO_APP_COLOR","hexToAppColorName","parseRgb","withAlpha","getPresetVars","applyPresetVarsToDocument","applyDarkClass","setColorSchemeSafe","initCssInteropDarkMode","webLocalStorage"],"sourceRoot":"../../../src","sources":["theme/index.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,yBAAsB;AAKzD,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,eAAe;AAEnE,SAASC,cAAc,QAAQ,cAAc;AAE7C,SAASC,kBAAkB,EAAEC,wBAAwB,QAAQ,6BAA0B;AAEvF;AACA;AACA;AACA,SACEC,kBAAkB,EAClBC,sBAAsB,EACtBC,oBAAoB,EACpBC,aAAa,EACbC,WAAW,EACXC,WAAW,EACXC,WAAW,EACXC,WAAW,EACXC,aAAa,EACbC,YAAY,QACP,yBAAgB;AAEvB,SAASC,UAAU,EAAEC,aAAa,QAAQ,kBAAe;AACzD,SAASC,kBAAkB,EAAEC,mBAAmB,QAAQ,4BAAyB;AACjF,SAASC,eAAe,QAAQ,gBAAa;AAC7C,SAASC,QAAQ,EAAEC,aAAa,EAAEC,aAAa,QAAQ,gBAAa;AACpE,SAASC,kBAAkB,QAAQ,2BAAwB;AAI3D,SACEC,eAAe,EACfC,mBAAmB,EACnBC,iBAAiB,EACjBC,gBAAgB,EAChBC,iBAAiB,QACZ,oBAAiB;AACxB,SAASC,QAAQ,EAAEC,SAAS,QAAQ,kBAAe;AAEnD,SAASC,aAAa,EAAEC,yBAAyB,QAAQ,kBAAe;AACxE,SAASC,cAAc,QAAQ,uBAAoB;AACnD,SAASC,kBAAkB,QAAQ,4BAAyB;AAC5D,SAASC,sBAAsB,QAAQ,uBAAoB;AAE3D,SAASC,eAAe,QAAQ,kBAAe","ignoreList":[]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { Children, cloneElement, isValidElement, useContext, useMemo } from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import { BloomThemeContext } from "../BloomThemeProvider.js";
|
|
6
|
+
import { buildSeedScopeVars } from "../color-scope/seed-scope.js";
|
|
7
|
+
import { getVariableContextProvider } from "../color-scope/style-builder.js";
|
|
8
|
+
import { buildThemeFromSeed } from "../build-theme-from-seed.js";
|
|
9
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
/**
|
|
11
|
+
* Native `<BloomSeedScope>`: scopes a subtree to an ARBITRARY seed colour's
|
|
12
|
+
* palette (the dynamic counterpart of `<BloomColorScope>`, which takes a named
|
|
13
|
+
* preset). Feeds the seed through the colour engine and (1) provides the
|
|
14
|
+
* resulting canonical CSS vars to descendants via react-native-css's
|
|
15
|
+
* `VariableContext` — so `bg-background` / `bg-card` / `var(--primary)` resolve
|
|
16
|
+
* against the seed inside this subtree — and (2) publishes a matching JS `theme`
|
|
17
|
+
* on `BloomThemeContext`, so `useTheme()`/`useBloomTheme()` consumers inside the
|
|
18
|
+
* subtree also re-theme. The `colorPreset` field is left as the parent's (a seed
|
|
19
|
+
* is not a named preset).
|
|
20
|
+
*/
|
|
21
|
+
export function BloomSeedScope({
|
|
22
|
+
seed,
|
|
23
|
+
variant,
|
|
24
|
+
contrastLevel,
|
|
25
|
+
asChild = false,
|
|
26
|
+
style,
|
|
27
|
+
children
|
|
28
|
+
}) {
|
|
29
|
+
// Hooks run unconditionally; conditional no-op/throw is applied afterwards.
|
|
30
|
+
const parent = useContext(BloomThemeContext);
|
|
31
|
+
const resolvedMode = parent?.theme.mode ?? 'light';
|
|
32
|
+
const nativeVars = useMemo(() => seed ? buildSeedScopeVars({
|
|
33
|
+
seed,
|
|
34
|
+
mode: resolvedMode,
|
|
35
|
+
variant,
|
|
36
|
+
contrastLevel
|
|
37
|
+
}) : null, [seed, resolvedMode, variant, contrastLevel]);
|
|
38
|
+
const contextValue = useMemo(() => {
|
|
39
|
+
if (!parent || !seed) return null;
|
|
40
|
+
const theme = buildThemeFromSeed(seed, resolvedMode, variant, contrastLevel);
|
|
41
|
+
return {
|
|
42
|
+
...parent,
|
|
43
|
+
theme
|
|
44
|
+
};
|
|
45
|
+
}, [parent, seed, resolvedMode, variant, contrastLevel]);
|
|
46
|
+
if (!parent) {
|
|
47
|
+
throw new Error('BloomSeedScope must be used within a <BloomThemeProvider>');
|
|
48
|
+
}
|
|
49
|
+
// `seed` undefined => no-op; children inherit the parent scope.
|
|
50
|
+
if (!nativeVars || !contextValue) return /*#__PURE__*/_jsx(_Fragment, {
|
|
51
|
+
children: children
|
|
52
|
+
});
|
|
53
|
+
const VariableProvider = getVariableContextProvider();
|
|
54
|
+
let content;
|
|
55
|
+
if (asChild) {
|
|
56
|
+
const child = Children.only(children);
|
|
57
|
+
if (! /*#__PURE__*/isValidElement(child)) {
|
|
58
|
+
throw new Error('BloomSeedScope with `asChild` requires a single React element child that accepts a `style` prop.');
|
|
59
|
+
}
|
|
60
|
+
const childStyle = child.props.style;
|
|
61
|
+
const mergedStyle = [style, childStyle];
|
|
62
|
+
content = /*#__PURE__*/cloneElement(child, {
|
|
63
|
+
style: mergedStyle
|
|
64
|
+
});
|
|
65
|
+
} else {
|
|
66
|
+
content = /*#__PURE__*/_jsx(View, {
|
|
67
|
+
style: [{
|
|
68
|
+
flex: 1
|
|
69
|
+
}, style],
|
|
70
|
+
children: children
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
const scoped = VariableProvider ? /*#__PURE__*/_jsx(VariableProvider, {
|
|
74
|
+
value: nativeVars,
|
|
75
|
+
children: content
|
|
76
|
+
}) : content;
|
|
77
|
+
return /*#__PURE__*/_jsx(BloomThemeContext.Provider, {
|
|
78
|
+
value: contextValue,
|
|
79
|
+
children: scoped
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Children","cloneElement","isValidElement","useContext","useMemo","View","BloomThemeContext","buildSeedScopeVars","getVariableContextProvider","buildThemeFromSeed","Fragment","_Fragment","jsx","_jsx","BloomSeedScope","seed","variant","contrastLevel","asChild","style","children","parent","resolvedMode","theme","mode","nativeVars","contextValue","Error","VariableProvider","content","child","only","childStyle","props","mergedStyle","flex","scoped","value","Provider"],"sourceRoot":"../../../../src","sources":["theme/seed-scope/index.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,YAAY,EAAEC,cAAc,EAAEC,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC1F,SAASC,IAAI,QAA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