@oxy.so/bloom 7.26.2 → 7.27.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/docs/adoption-matrix.mdx +2 -2
- package/docs/design-tokens.mdx +41 -0
- package/lib/commonjs/portal/Portal.js +11 -2
- package/lib/commonjs/portal/Portal.js.map +1 -1
- package/lib/commonjs/portal/Portal.web.js +10 -1
- package/lib/commonjs/portal/Portal.web.js.map +1 -1
- package/lib/commonjs/theme/BloomThemeProvider.js +30 -4
- package/lib/commonjs/theme/BloomThemeProvider.js.map +1 -1
- package/lib/commonjs/theme/color-scope/ColorScope.js +14 -27
- package/lib/commonjs/theme/color-scope/ColorScope.js.map +1 -1
- package/lib/commonjs/theme/color-scope/ColorScope.web.js +15 -23
- package/lib/commonjs/theme/color-scope/ColorScope.web.js.map +1 -1
- package/lib/commonjs/theme/color-scope/ThemeScopeBridge.js +36 -0
- package/lib/commonjs/theme/color-scope/ThemeScopeBridge.js.map +1 -0
- package/lib/commonjs/theme/color-scope/context.js +11 -0
- package/lib/commonjs/theme/color-scope/context.js.map +1 -0
- package/lib/commonjs/theme/color-scope/resolve-scope.js +86 -0
- package/lib/commonjs/theme/color-scope/resolve-scope.js.map +1 -0
- package/lib/commonjs/theme/color-scope/types.js +6 -0
- package/lib/commonjs/theme/color-scope/types.js.map +1 -0
- package/lib/commonjs/theme/color-scope/use-scope.js +44 -0
- package/lib/commonjs/theme/color-scope/use-scope.js.map +1 -0
- package/lib/commonjs/theme/seed-scope/SeedScope.js +26 -1
- package/lib/commonjs/theme/seed-scope/SeedScope.js.map +1 -1
- package/lib/commonjs/theme/seed-scope/SeedScope.web.js +26 -1
- package/lib/commonjs/theme/seed-scope/SeedScope.web.js.map +1 -1
- package/lib/module/portal/Portal.js +11 -2
- package/lib/module/portal/Portal.js.map +1 -1
- package/lib/module/portal/Portal.web.js +11 -2
- package/lib/module/portal/Portal.web.js.map +1 -1
- package/lib/module/theme/BloomThemeProvider.js +30 -4
- package/lib/module/theme/BloomThemeProvider.js.map +1 -1
- package/lib/module/theme/color-scope/ColorScope.js +15 -28
- package/lib/module/theme/color-scope/ColorScope.js.map +1 -1
- package/lib/module/theme/color-scope/ColorScope.web.js +15 -23
- package/lib/module/theme/color-scope/ColorScope.web.js.map +1 -1
- package/lib/module/theme/color-scope/ThemeScopeBridge.js +32 -0
- package/lib/module/theme/color-scope/ThemeScopeBridge.js.map +1 -0
- package/lib/module/theme/color-scope/context.js +8 -0
- package/lib/module/theme/color-scope/context.js.map +1 -0
- package/lib/module/theme/color-scope/resolve-scope.js +82 -0
- package/lib/module/theme/color-scope/resolve-scope.js.map +1 -0
- package/lib/module/theme/color-scope/types.js +4 -0
- package/lib/module/theme/color-scope/types.js.map +1 -0
- package/lib/module/theme/color-scope/use-scope.js +40 -0
- package/lib/module/theme/color-scope/use-scope.js.map +1 -0
- package/lib/module/theme/seed-scope/SeedScope.js +26 -1
- package/lib/module/theme/seed-scope/SeedScope.js.map +1 -1
- package/lib/module/theme/seed-scope/SeedScope.web.js +26 -1
- package/lib/module/theme/seed-scope/SeedScope.web.js.map +1 -1
- package/lib/typescript/commonjs/portal/Portal.d.ts.map +1 -1
- package/lib/typescript/commonjs/portal/Portal.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/BloomThemeProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-scope/ColorScope.d.ts +7 -2
- package/lib/typescript/commonjs/theme/color-scope/ColorScope.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-scope/ColorScope.web.d.ts +7 -2
- package/lib/typescript/commonjs/theme/color-scope/ColorScope.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-scope/ThemeScopeBridge.d.ts +9 -0
- package/lib/typescript/commonjs/theme/color-scope/ThemeScopeBridge.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-scope/context.d.ts +14 -0
- package/lib/typescript/commonjs/theme/color-scope/context.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-scope/index.d.ts +1 -0
- package/lib/typescript/commonjs/theme/color-scope/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-scope/index.web.d.ts +1 -0
- package/lib/typescript/commonjs/theme/color-scope/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-scope/resolve-scope.d.ts +5 -0
- package/lib/typescript/commonjs/theme/color-scope/resolve-scope.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-scope/types.d.ts +4 -0
- package/lib/typescript/commonjs/theme/color-scope/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-scope/use-scope.d.ts +9 -0
- package/lib/typescript/commonjs/theme/color-scope/use-scope.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/index.d.ts +1 -1
- package/lib/typescript/commonjs/theme/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/index.web.d.ts +1 -1
- package/lib/typescript/commonjs/theme/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/seed-scope/SeedScope.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/seed-scope/SeedScope.web.d.ts.map +1 -1
- package/lib/typescript/module/portal/Portal.d.ts.map +1 -1
- package/lib/typescript/module/portal/Portal.web.d.ts.map +1 -1
- package/lib/typescript/module/theme/BloomThemeProvider.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-scope/ColorScope.d.ts +7 -2
- package/lib/typescript/module/theme/color-scope/ColorScope.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-scope/ColorScope.web.d.ts +7 -2
- package/lib/typescript/module/theme/color-scope/ColorScope.web.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-scope/ThemeScopeBridge.d.ts +9 -0
- package/lib/typescript/module/theme/color-scope/ThemeScopeBridge.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-scope/context.d.ts +14 -0
- package/lib/typescript/module/theme/color-scope/context.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-scope/index.d.ts +1 -0
- package/lib/typescript/module/theme/color-scope/index.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-scope/index.web.d.ts +1 -0
- package/lib/typescript/module/theme/color-scope/index.web.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-scope/resolve-scope.d.ts +5 -0
- package/lib/typescript/module/theme/color-scope/resolve-scope.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-scope/types.d.ts +4 -0
- package/lib/typescript/module/theme/color-scope/types.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-scope/use-scope.d.ts +9 -0
- package/lib/typescript/module/theme/color-scope/use-scope.d.ts.map +1 -0
- package/lib/typescript/module/theme/index.d.ts +1 -1
- package/lib/typescript/module/theme/index.d.ts.map +1 -1
- package/lib/typescript/module/theme/index.web.d.ts +1 -1
- package/lib/typescript/module/theme/index.web.d.ts.map +1 -1
- package/lib/typescript/module/theme/seed-scope/SeedScope.d.ts.map +1 -1
- package/lib/typescript/module/theme/seed-scope/SeedScope.web.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/portal/Portal.tsx +19 -12
- package/src/portal/Portal.web.tsx +7 -2
- package/src/theme/BloomThemeProvider.tsx +14 -2
- package/src/theme/color-scope/ColorScope.tsx +20 -31
- package/src/theme/color-scope/ColorScope.web.tsx +18 -37
- package/src/theme/color-scope/ThemeScopeBridge.tsx +30 -0
- package/src/theme/color-scope/context.ts +20 -0
- package/src/theme/color-scope/index.ts +1 -0
- package/src/theme/color-scope/index.web.ts +1 -0
- package/src/theme/color-scope/resolve-scope.ts +82 -0
- package/src/theme/color-scope/types.ts +4 -0
- package/src/theme/color-scope/use-scope.ts +46 -0
- package/src/theme/index.ts +1 -1
- package/src/theme/index.web.ts +1 -1
- package/src/theme/seed-scope/SeedScope.tsx +11 -1
- package/src/theme/seed-scope/SeedScope.web.tsx +11 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { BloomThemeProvider } from './BloomThemeProvider';
|
|
2
2
|
export type { BloomThemeProviderProps, BloomThemeContextValue, } from './BloomThemeProvider';
|
|
3
3
|
export { BloomColorScope, useColorScopeStyle } from './color-scope';
|
|
4
|
-
export type { BloomColorScopeProps } from './color-scope';
|
|
4
|
+
export type { BloomColorScopeProps, BloomColorScopeTokens } from './color-scope';
|
|
5
5
|
export { BloomSeedScope } from './seed-scope';
|
|
6
6
|
export type { BloomSeedScopeProps } from './seed-scope';
|
|
7
7
|
export { roleColorsToPresetTokens } from './color-scope/seed-scope';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACpE,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACpE,YAAY,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAepE,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,kBAAk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,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAG1D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { BloomThemeProvider } from './BloomThemeProvider';
|
|
2
2
|
export type { BloomThemeProviderProps, BloomThemeContextValue, } from './BloomThemeProvider';
|
|
3
3
|
export { BloomColorScope, useColorScopeStyle } from './color-scope/index.web';
|
|
4
|
-
export type { BloomColorScopeProps } from './color-scope/index.web';
|
|
4
|
+
export type { BloomColorScopeProps, BloomColorScopeTokens } from './color-scope/index.web';
|
|
5
5
|
export { BloomSeedScope } from './seed-scope/index.web';
|
|
6
6
|
export type { BloomSeedScopeProps } from './seed-scope/index.web';
|
|
7
7
|
export { roleColorsToPresetTokens } from './color-scope/seed-scope';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/theme/index.web.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC9E,YAAY,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/theme/index.web.ts"],"names":[],"mappings":"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
{"version":3,"file":"SeedScope.d.ts","sourceRoot":"","sources":["../../../../../src/theme/seed-scope/SeedScope.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAMpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0GAA0G;IAC1G,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,aAAa,EACb,YAAY,EACZ,OAAO,EACP,aAAa,EACb,OAAe,EACf,KAAK,EACL,QAAQ,GACT,EAAE,mBAAmB,2CA0DrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SeedScope.web.d.ts","sourceRoot":"","sources":["../../../../../src/theme/seed-scope/SeedScope.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAK3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"SeedScope.web.d.ts","sourceRoot":"","sources":["../../../../../src/theme/seed-scope/SeedScope.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAK3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yGAAyG;IACzG,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAoBD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,aAAa,EACb,YAAY,EACZ,OAAO,EACP,aAAa,EACb,OAAe,EACf,KAAK,EACL,QAAQ,GACT,EAAE,mBAAmB,2CAwDrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../../../../src/portal/Portal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAWN,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../../../../src/portal/Portal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAWN,MAAM,OAAO,CAAC;AAoBf,iBAAS,iBAAiB;sBAQC,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC;;2BA+B1B,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC;EAoB9D;AAED,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAExD,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,6BAA6B,EAAE,WAAW,GAAG,SAAS,CAAC;CAC5D;AAuBD,eAAO,MAAM,cAAc,UAjFA,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,4CAiFN,CAAC;AACrD,eAAO,MAAM,YAAY,iFAA6B,CAAC;AACvD,eAAO,MAAM,MAAM,iBApDa,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,SAoDrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Portal.web.d.ts","sourceRoot":"","sources":["../../../../src/portal/Portal.web.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"Portal.web.d.ts","sourceRoot":"","sources":["../../../../src/portal/Portal.web.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAgE,MAAM,OAAO,CAAC;AA+CrF,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,EAAE,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,4BAWnE;AAKD,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,2CAEpE;AAED,eAAO,MAAM,YAAY,oCAEvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BloomThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/theme/BloomThemeProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAQN,MAAM,OAAO,CAAC;AACf,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"BloomThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/theme/BloomThemeProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAQN,MAAM,OAAO,CAAC;AACf,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cA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IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iDAAiD;IACjD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE9B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wDAAwD;IACxD,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEjC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE1C;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAkJD,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EAAE,cAAc,EACpB,WAAW,EAAE,gBAAgB,EAC7B,WAA0B,EAC1B,kBAAmC,EACnC,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,OAAO,EACP,cAAc,EACd,WAAW,EACX,KAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,IAAI,EACJ,QAAQ,GACT,EAAE,uBAAuB,2CAqLzB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { BloomColorScopeTokens } from './types';
|
|
3
4
|
import type { AppColorName } from '../color-presets';
|
|
4
5
|
export interface BloomColorScopeProps {
|
|
5
6
|
/**
|
|
@@ -11,7 +12,11 @@ export interface BloomColorScopeProps {
|
|
|
11
12
|
* or not a preset is set, because a preset that arrives late must not remount
|
|
12
13
|
* the subtree.
|
|
13
14
|
*/
|
|
14
|
-
colorPreset
|
|
15
|
+
colorPreset?: AppColorName;
|
|
16
|
+
/** Local resolved mode; does not change the app mode, storage or document. */
|
|
17
|
+
mode?: 'light' | 'dark';
|
|
18
|
+
/** Exact canonical colors. Unspecified roles inherit the selected preset or parent scope. */
|
|
19
|
+
tokens?: BloomColorScopeTokens;
|
|
15
20
|
/**
|
|
16
21
|
* When `true`, do not render a wrapping `<View>`. The single child is cloned
|
|
17
22
|
* with the scope's CSS vars merged into its `style` prop (Radix-style).
|
|
@@ -50,7 +55,7 @@ export interface BloomColorScopeProps {
|
|
|
50
55
|
* element types at this position identical across a preset change, or the
|
|
51
56
|
* remount comes back.
|
|
52
57
|
*/
|
|
53
|
-
export declare function BloomColorScope({ colorPreset, asChild, style, children, }: BloomColorScopeProps): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
export declare function BloomColorScope({ colorPreset, mode, tokens, asChild, style, children, }: BloomColorScopeProps): import("react/jsx-runtime").JSX.Element;
|
|
54
59
|
/**
|
|
55
60
|
* Escape hatch for advanced cases where the wrapping element is owned by the
|
|
56
61
|
* caller. Returns a stable native style object carrying the preset's CSS vars
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorScope.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/ColorScope.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorScope.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/ColorScope.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAiBrD,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,8EAA8E;IAC9E,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,6FAA6F;IAC7F,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0GAA0G;IAC1G,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,IAAI,EACJ,MAAM,EACN,OAAe,EACf,KAAK,EACL,QAAQ,GACT,EAAE,oBAAoB,2CAkCtB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,CAYlF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { BloomColorScopeTokens } from './types';
|
|
2
3
|
import type { AppColorName } from '../color-presets';
|
|
3
4
|
export interface BloomColorScopeProps {
|
|
4
5
|
/**
|
|
@@ -9,7 +10,11 @@ export interface BloomColorScopeProps {
|
|
|
9
10
|
* tree is identical either way, so a preset that arrives late cannot remount
|
|
10
11
|
* the subtree. `ColorScope.tsx` carries the full account.
|
|
11
12
|
*/
|
|
12
|
-
colorPreset
|
|
13
|
+
colorPreset?: AppColorName;
|
|
14
|
+
/** Local resolved mode; does not change the app mode, storage or document. */
|
|
15
|
+
mode?: 'light' | 'dark';
|
|
16
|
+
/** Exact canonical colors. Unspecified roles inherit the selected preset or parent scope. */
|
|
17
|
+
tokens?: BloomColorScopeTokens;
|
|
13
18
|
/**
|
|
14
19
|
* When `true`, do not render a wrapping `<div>`. The single child is cloned
|
|
15
20
|
* with the scope's CSS vars merged into its `style` prop (Radix-style).
|
|
@@ -19,7 +24,7 @@ export interface BloomColorScopeProps {
|
|
|
19
24
|
style?: React.CSSProperties;
|
|
20
25
|
children: React.ReactNode;
|
|
21
26
|
}
|
|
22
|
-
export declare function BloomColorScope({ colorPreset, asChild, style, children, }: BloomColorScopeProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare function BloomColorScope({ colorPreset, mode, tokens, asChild, style, children, }: BloomColorScopeProps): import("react/jsx-runtime").JSX.Element;
|
|
23
28
|
/**
|
|
24
29
|
* Escape hatch for advanced cases where the wrapping element is owned by the
|
|
25
30
|
* caller. Returns a stable React style object carrying the preset's CSS vars.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorScope.web.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/ColorScope.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorScope.web.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/ColorScope.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAK3F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAarD,MAAM,WAAW,oBAAoB;IACnC;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,8EAA8E;IAC9E,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,6FAA6F;IAC7F,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yGAAyG;IACzG,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAyBD,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,IAAI,EACJ,MAAM,EACN,OAAe,EACf,KAAK,EACL,QAAQ,GACT,EAAE,oBAAoB,2CAkCtB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,YAAY,GAAG,KAAK,CAAC,aAAa,CAYjF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type BloomThemeContextValue } from '../BloomThemeProvider';
|
|
3
|
+
import { type ScopeState } from './context';
|
|
4
|
+
/** Re-publish the source scope when a native portal renders under an unrelated outlet. */
|
|
5
|
+
export declare function ThemeScopeBridge({ theme, scope, children, }: React.PropsWithChildren<{
|
|
6
|
+
theme: BloomThemeContextValue | null;
|
|
7
|
+
scope: ScopeState | null;
|
|
8
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=ThemeScopeBridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeScopeBridge.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/ThemeScopeBridge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAqB,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAG/D,0FAA0F;AAC1F,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,KAAK,EACL,QAAQ,GACT,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACzB,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACrC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;CAC1B,CAAC,2CAgBD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Theme } from '../types';
|
|
2
|
+
export interface ScopePalette {
|
|
3
|
+
theme: Theme;
|
|
4
|
+
vars: Record<string, string>;
|
|
5
|
+
}
|
|
6
|
+
/** Private resolved source, retained through scopes and portal outlets. */
|
|
7
|
+
export interface ScopeState extends ScopePalette {
|
|
8
|
+
resolveMode: (mode: 'light' | 'dark') => ScopePalette;
|
|
9
|
+
}
|
|
10
|
+
declare global {
|
|
11
|
+
var __oxy_so_bloom_scope_context__: React.Context<ScopeState | null> | undefined;
|
|
12
|
+
}
|
|
13
|
+
export declare const ThemeScopeContext: import("react").Context<ScopeState | null>;
|
|
14
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED,2EAA2E;AAC3E,MAAM,WAAW,UAAW,SAAQ,YAAY;IAC9C,WAAW,EAAE,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,KAAK,YAAY,CAAC;CACvD;AAED,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,8BAA8B,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;CAClF;AAED,eAAO,MAAM,iBAAiB,4CACW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACnE,YAAY,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACnE,YAAY,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,YAAY,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/index.web.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACvE,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/index.web.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACvE,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,YAAY,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ScopePalette } from './context';
|
|
2
|
+
import type { BloomColorScopeTokens } from './types';
|
|
3
|
+
/** Preserve unspecified roles; rebuild the full CSS alias layer after exact overrides. */
|
|
4
|
+
export declare function applyScopeTokens(base: ScopePalette, overrides?: BloomColorScopeTokens): ScopePalette;
|
|
5
|
+
//# sourceMappingURL=resolve-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-scope.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/resolve-scope.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AA2CrD,0FAA0F;AAC1F,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,YAAY,EAClB,SAAS,CAAC,EAAE,qBAAqB,GAChC,YAAY,CA4Bd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,iFAAiF;AACjF,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AppColorName } from '../color-presets';
|
|
2
|
+
import { type ScopeState } from './context';
|
|
3
|
+
import type { BloomColorScopeTokens } from './types';
|
|
4
|
+
export declare function useScope(colorPreset?: AppColorName, mode?: 'light' | 'dark', tokens?: BloomColorScopeTokens): {
|
|
5
|
+
context: import("..").BloomThemeContextValue;
|
|
6
|
+
state: ScopeState | null;
|
|
7
|
+
vars: Record<string, string> | undefined;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=use-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-scope.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/use-scope.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAwC,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAGlF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,wBAAgB,QAAQ,CACtB,WAAW,CAAC,EAAE,YAAY,EAC1B,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,EACvB,MAAM,CAAC,EAAE,qBAAqB;;;;EAiC/B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { BloomThemeProvider } from './BloomThemeProvider';
|
|
2
2
|
export type { BloomThemeProviderProps, BloomThemeContextValue, } from './BloomThemeProvider';
|
|
3
3
|
export { BloomColorScope, useColorScopeStyle } from './color-scope';
|
|
4
|
-
export type { BloomColorScopeProps } from './color-scope';
|
|
4
|
+
export type { BloomColorScopeProps, BloomColorScopeTokens } from './color-scope';
|
|
5
5
|
export { BloomSeedScope } from './seed-scope';
|
|
6
6
|
export type { BloomSeedScopeProps } from './seed-scope';
|
|
7
7
|
export { roleColorsToPresetTokens } from './color-scope/seed-scope';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACpE,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACpE,YAAY,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAepE,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAClF,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,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1D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { BloomThemeProvider } from './BloomThemeProvider';
|
|
2
2
|
export type { BloomThemeProviderProps, BloomThemeContextValue, } from './BloomThemeProvider';
|
|
3
3
|
export { BloomColorScope, useColorScopeStyle } from './color-scope/index.web';
|
|
4
|
-
export type { BloomColorScopeProps } from './color-scope/index.web';
|
|
4
|
+
export type { BloomColorScopeProps, BloomColorScopeTokens } from './color-scope/index.web';
|
|
5
5
|
export { BloomSeedScope } from './seed-scope/index.web';
|
|
6
6
|
export type { BloomSeedScopeProps } from './seed-scope/index.web';
|
|
7
7
|
export { roleColorsToPresetTokens } from './color-scope/seed-scope';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/theme/index.web.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC9E,YAAY,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/theme/index.web.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,sBAAsB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,EACrB,4BAA4B,EAC5B,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/D,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAK/D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAMnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAG1D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SeedScope.d.ts","sourceRoot":"","sources":["../../../../../src/theme/seed-scope/SeedScope.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAMpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"SeedScope.d.ts","sourceRoot":"","sources":["../../../../../src/theme/seed-scope/SeedScope.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAC3F,OAAO,EAAQ,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAMpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0GAA0G;IAC1G,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,aAAa,EACb,YAAY,EACZ,OAAO,EACP,aAAa,EACb,OAAe,EACf,KAAK,EACL,QAAQ,GACT,EAAE,mBAAmB,2CA0DrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SeedScope.web.d.ts","sourceRoot":"","sources":["../../../../../src/theme/seed-scope/SeedScope.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAK3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"SeedScope.web.d.ts","sourceRoot":"","sources":["../../../../../src/theme/seed-scope/SeedScope.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAK3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yGAAyG;IACzG,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAoBD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,aAAa,EACb,YAAY,EACZ,OAAO,EACP,aAAa,EACb,OAAe,EACf,KAAK,EACL,QAAQ,GACT,EAAE,mBAAmB,2CAwDrB"}
|
package/package.json
CHANGED
package/src/portal/Portal.tsx
CHANGED
|
@@ -12,6 +12,9 @@ import React, {
|
|
|
12
12
|
} from 'react';
|
|
13
13
|
import { View, StyleSheet, Platform } from 'react-native';
|
|
14
14
|
import { Z_INDEX } from '../styles/z-index';
|
|
15
|
+
import { BloomThemeContext } from '../theme/BloomThemeProvider';
|
|
16
|
+
import { ThemeScopeContext } from '../theme/color-scope/context';
|
|
17
|
+
import { ThemeScopeBridge } from '../theme/color-scope/ThemeScopeBridge';
|
|
15
18
|
import { WEB_POSITION_FIXED } from '../styles/web-view-style';
|
|
16
19
|
|
|
17
20
|
type Component = React.ReactElement;
|
|
@@ -48,22 +51,19 @@ function createPortalGroup() {
|
|
|
48
51
|
setOutlet(<>{Object.values(map.current)}</>);
|
|
49
52
|
}, []);
|
|
50
53
|
|
|
51
|
-
const contextValue = useMemo(
|
|
52
|
-
() => ({ outlet, append, remove }),
|
|
53
|
-
[outlet, append, remove],
|
|
54
|
-
);
|
|
54
|
+
const contextValue = useMemo(() => ({ outlet, append, remove }), [outlet, append, remove]);
|
|
55
55
|
|
|
56
|
-
return
|
|
57
|
-
<Context.Provider value={contextValue}>
|
|
58
|
-
{props.children}
|
|
59
|
-
</Context.Provider>
|
|
60
|
-
);
|
|
56
|
+
return <Context.Provider value={contextValue}>{props.children}</Context.Provider>;
|
|
61
57
|
}
|
|
62
58
|
|
|
63
59
|
function Outlet() {
|
|
64
60
|
const ctx = useContext(Context);
|
|
65
61
|
if (Platform.OS === 'web') {
|
|
66
|
-
return
|
|
62
|
+
return (
|
|
63
|
+
<View pointerEvents="box-none" style={styles.portalOutlet}>
|
|
64
|
+
{ctx.outlet}
|
|
65
|
+
</View>
|
|
66
|
+
);
|
|
67
67
|
}
|
|
68
68
|
return ctx.outlet;
|
|
69
69
|
}
|
|
@@ -71,11 +71,18 @@ function createPortalGroup() {
|
|
|
71
71
|
function Portal({ children }: React.PropsWithChildren<object>) {
|
|
72
72
|
const { append, remove } = useContext(Context);
|
|
73
73
|
const id = useId();
|
|
74
|
+
const theme = useContext(BloomThemeContext);
|
|
75
|
+
const scope = useContext(ThemeScopeContext);
|
|
74
76
|
|
|
75
77
|
useEffect(() => {
|
|
76
|
-
append(
|
|
78
|
+
append(
|
|
79
|
+
id,
|
|
80
|
+
<ThemeScopeBridge theme={theme} scope={scope}>
|
|
81
|
+
{children}
|
|
82
|
+
</ThemeScopeBridge>,
|
|
83
|
+
);
|
|
77
84
|
return () => remove(id);
|
|
78
|
-
}, [id, children, append, remove]);
|
|
85
|
+
}, [id, children, append, remove, theme, scope]);
|
|
79
86
|
|
|
80
87
|
return null;
|
|
81
88
|
}
|
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
* `PortalOutlet` are still exported on web — they just become harmless no-op
|
|
14
14
|
* fragments so consumers that *do* mount them keep compiling.
|
|
15
15
|
*/
|
|
16
|
-
import React, { Fragment, memo, useLayoutEffect, useState } from 'react';
|
|
16
|
+
import React, { Fragment, memo, useContext, useLayoutEffect, useState } from 'react';
|
|
17
17
|
import { createPortal } from 'react-dom';
|
|
18
18
|
import { Z_INDEX } from '../styles/z-index';
|
|
19
|
+
import { ThemeScopeContext } from '../theme/color-scope/context';
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* Render children into a stable container appended to `document.body`.
|
|
@@ -61,11 +62,15 @@ function getPortalRoot(): HTMLElement | null {
|
|
|
61
62
|
|
|
62
63
|
export function Portal({ children }: React.PropsWithChildren<object>) {
|
|
63
64
|
const [root, setRoot] = useState<HTMLElement | null>(null);
|
|
65
|
+
const scope = useContext(ThemeScopeContext);
|
|
64
66
|
useLayoutEffect(() => {
|
|
65
67
|
setRoot(getPortalRoot());
|
|
66
68
|
}, []);
|
|
67
69
|
if (!root) return null;
|
|
68
|
-
return createPortal(
|
|
70
|
+
return createPortal(
|
|
71
|
+
<div style={{ ...scope?.vars, display: 'contents', pointerEvents: 'none' }}>{children}</div>,
|
|
72
|
+
root,
|
|
73
|
+
);
|
|
69
74
|
}
|
|
70
75
|
|
|
71
76
|
// Native API parity — on web these are inert. `PortalProvider` mounts its
|
|
@@ -28,6 +28,7 @@ import { useAmbientThemeState } from './ambient-store';
|
|
|
28
28
|
|
|
29
29
|
import { applyDarkClass, applyDocumentTheme, applyVarsToDocument } from './apply-dark-class';
|
|
30
30
|
import { buildTheme } from './build-theme';
|
|
31
|
+
import { ThemeScopeContext, type ScopeState } from './color-scope/context';
|
|
31
32
|
import { buildThemeFromSeed } from './build-theme-from-seed';
|
|
32
33
|
import { buildSeedScopeVars } from './color-scope/seed-scope';
|
|
33
34
|
import { type AppColorName } from './color-presets';
|
|
@@ -431,6 +432,17 @@ export function BloomThemeProvider({
|
|
|
431
432
|
],
|
|
432
433
|
);
|
|
433
434
|
|
|
435
|
+
const scopeState = useMemo<ScopeState>(() => ({
|
|
436
|
+
theme: themeColors,
|
|
437
|
+
vars: themeVars,
|
|
438
|
+
resolveMode: (nextMode) => nextMode === resolved ? { theme: themeColors, vars: themeVars } : effectiveSeed
|
|
439
|
+
? {
|
|
440
|
+
theme: buildThemeFromSeed(effectiveSeed, nextMode, undefined, undefined, { secondarySeed: effectiveSecondary, tertiarySeed: effectiveTertiary }),
|
|
441
|
+
vars: buildSeedScopeVars({ seed: effectiveSeed, mode: nextMode, secondarySeed: effectiveSecondary, tertiarySeed: effectiveTertiary }),
|
|
442
|
+
}
|
|
443
|
+
: { theme: buildTheme(colorPreset, nextMode, isAdaptive, explicitAccents), vars: buildScopeVars(colorPreset, nextMode, explicitAccents) },
|
|
444
|
+
}), [themeColors, themeVars, resolved, effectiveSeed, effectiveSecondary, effectiveTertiary, colorPreset, isAdaptive, explicitAccents]);
|
|
445
|
+
|
|
434
446
|
useIsomorphicLayoutEffect(() => {
|
|
435
447
|
setColorSchemeSafe(effectiveMode);
|
|
436
448
|
applyDarkClass(resolved);
|
|
@@ -480,9 +492,9 @@ export function BloomThemeProvider({
|
|
|
480
492
|
const VariableProvider = getVariableContextProvider();
|
|
481
493
|
|
|
482
494
|
const content = (
|
|
483
|
-
<FontLoader enabled={fonts} fallback={onFontsLoading}>
|
|
495
|
+
<ThemeScopeContext.Provider value={scopeState}><FontLoader enabled={fonts} fallback={onFontsLoading}>
|
|
484
496
|
{isGated ? onHydrating ?? null : children}
|
|
485
|
-
</FontLoader>
|
|
497
|
+
</FontLoader></ThemeScopeContext.Provider>
|
|
486
498
|
);
|
|
487
499
|
|
|
488
500
|
if (Platform.OS === 'web') {
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import React, { Children, cloneElement, isValidElement, useContext, useMemo } from 'react';
|
|
2
2
|
import { View, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import { BloomThemeContext
|
|
5
|
-
import {
|
|
4
|
+
import { BloomThemeContext } from '../BloomThemeProvider';
|
|
5
|
+
import { ThemeScopeContext } from './context';
|
|
6
|
+
import { useScope } from './use-scope';
|
|
7
|
+
import type { BloomColorScopeTokens } from './types';
|
|
6
8
|
import type { AppColorName } from '../color-presets';
|
|
7
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
buildNativePresetStyle,
|
|
11
|
+
buildScopeVars,
|
|
12
|
+
getVariableContextProvider,
|
|
13
|
+
} from './style-builder';
|
|
8
14
|
|
|
9
15
|
/**
|
|
10
16
|
* The variables a scope publishes when it carries no preset of its own.
|
|
@@ -26,7 +32,11 @@ export interface BloomColorScopeProps {
|
|
|
26
32
|
* or not a preset is set, because a preset that arrives late must not remount
|
|
27
33
|
* the subtree.
|
|
28
34
|
*/
|
|
29
|
-
colorPreset
|
|
35
|
+
colorPreset?: AppColorName;
|
|
36
|
+
/** Local resolved mode; does not change the app mode, storage or document. */
|
|
37
|
+
mode?: 'light' | 'dark';
|
|
38
|
+
/** Exact canonical colors. Unspecified roles inherit the selected preset or parent scope. */
|
|
39
|
+
tokens?: BloomColorScopeTokens;
|
|
30
40
|
/**
|
|
31
41
|
* When `true`, do not render a wrapping `<View>`. The single child is cloned
|
|
32
42
|
* with the scope's CSS vars merged into its `style` prop (Radix-style).
|
|
@@ -72,36 +82,13 @@ interface StyleableProps {
|
|
|
72
82
|
*/
|
|
73
83
|
export function BloomColorScope({
|
|
74
84
|
colorPreset,
|
|
85
|
+
mode,
|
|
86
|
+
tokens,
|
|
75
87
|
asChild = false,
|
|
76
88
|
style,
|
|
77
89
|
children,
|
|
78
90
|
}: BloomColorScopeProps) {
|
|
79
|
-
|
|
80
|
-
// never gate a hook behind an early return (rules of hooks). The throw below
|
|
81
|
-
// happens AFTER every hook has run. `resolvedMode` falls back harmlessly when
|
|
82
|
-
// the provider is absent (that render path throws anyway).
|
|
83
|
-
const parent = useContext(BloomThemeContext);
|
|
84
|
-
const resolvedMode = parent?.theme.mode ?? 'light';
|
|
85
|
-
|
|
86
|
-
const contextValue = useMemo<BloomThemeContextValue | null>(() => {
|
|
87
|
-
if (!parent || !colorPreset) return null;
|
|
88
|
-
const theme = buildTheme(colorPreset, resolvedMode);
|
|
89
|
-
return { ...parent, theme, colorPreset };
|
|
90
|
-
}, [colorPreset, resolvedMode, parent]);
|
|
91
|
-
|
|
92
|
-
// Preset vars flow to the subtree through react-native-css's real
|
|
93
|
-
// VariableContext (`VariableContextProvider`), NOT via an inline `vars()`
|
|
94
|
-
// style — under react-native-css@3 inline vars applied to a plain `<View>`
|
|
95
|
-
// (no matched className rules) are dropped silently. See `style-builder.ts`.
|
|
96
|
-
const nativeVars = useMemo<Record<string, string> | null>(
|
|
97
|
-
() => (colorPreset ? buildScopeVars(colorPreset, resolvedMode) : null),
|
|
98
|
-
[colorPreset, resolvedMode],
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
if (!parent) {
|
|
102
|
-
throw new Error('BloomColorScope must be used within a <BloomThemeProvider>');
|
|
103
|
-
}
|
|
104
|
-
|
|
91
|
+
const { context, state, vars: nativeVars } = useScope(colorPreset, mode, tokens);
|
|
105
92
|
const VariableProvider = getVariableContextProvider();
|
|
106
93
|
|
|
107
94
|
let content: React.ReactNode;
|
|
@@ -130,7 +117,9 @@ export function BloomColorScope({
|
|
|
130
117
|
);
|
|
131
118
|
|
|
132
119
|
return (
|
|
133
|
-
<BloomThemeContext.Provider value={
|
|
120
|
+
<BloomThemeContext.Provider value={context}>
|
|
121
|
+
<ThemeScopeContext.Provider value={state}>{scoped}</ThemeScopeContext.Provider>
|
|
122
|
+
</BloomThemeContext.Provider>
|
|
134
123
|
);
|
|
135
124
|
}
|
|
136
125
|
|