@oxyhq/bloom 0.39.0 → 0.41.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.
Files changed (63) hide show
  1. package/lib/commonjs/theme/build-theme-from-seed.js +90 -0
  2. package/lib/commonjs/theme/build-theme-from-seed.js.map +1 -0
  3. package/lib/commonjs/theme/color-engine/scheme-variants.js +23 -0
  4. package/lib/commonjs/theme/color-engine/scheme-variants.js.map +1 -1
  5. package/lib/commonjs/theme/color-presets.js +13 -13
  6. package/lib/commonjs/theme/color-presets.js.map +1 -1
  7. package/lib/commonjs/theme/color-scope/seed-scope.js +1 -0
  8. package/lib/commonjs/theme/color-scope/seed-scope.js.map +1 -1
  9. package/lib/commonjs/theme/index.js +94 -0
  10. package/lib/commonjs/theme/index.js.map +1 -1
  11. package/lib/commonjs/theme/seed-scope/index.js +87 -0
  12. package/lib/commonjs/theme/seed-scope/index.js.map +1 -0
  13. package/lib/commonjs/theme/seed-scope/index.web.js +86 -0
  14. package/lib/commonjs/theme/seed-scope/index.web.js.map +1 -0
  15. package/lib/module/theme/build-theme-from-seed.js +85 -0
  16. package/lib/module/theme/build-theme-from-seed.js.map +1 -0
  17. package/lib/module/theme/color-engine/scheme-variants.js +22 -0
  18. package/lib/module/theme/color-engine/scheme-variants.js.map +1 -1
  19. package/lib/module/theme/color-presets.js +13 -13
  20. package/lib/module/theme/color-presets.js.map +1 -1
  21. package/lib/module/theme/color-scope/seed-scope.js +1 -0
  22. package/lib/module/theme/color-scope/seed-scope.js.map +1 -1
  23. package/lib/module/theme/index.js +7 -0
  24. package/lib/module/theme/index.js.map +1 -1
  25. package/lib/module/theme/seed-scope/index.js +82 -0
  26. package/lib/module/theme/seed-scope/index.js.map +1 -0
  27. package/lib/module/theme/seed-scope/index.web.js +81 -0
  28. package/lib/module/theme/seed-scope/index.web.js.map +1 -0
  29. package/lib/typescript/commonjs/theme/build-theme-from-seed.d.ts +23 -0
  30. package/lib/typescript/commonjs/theme/build-theme-from-seed.d.ts.map +1 -0
  31. package/lib/typescript/commonjs/theme/color-engine/scheme-variants.d.ts +10 -1
  32. package/lib/typescript/commonjs/theme/color-engine/scheme-variants.d.ts.map +1 -1
  33. package/lib/typescript/commonjs/theme/color-scope/seed-scope.d.ts +3 -2
  34. package/lib/typescript/commonjs/theme/color-scope/seed-scope.d.ts.map +1 -1
  35. package/lib/typescript/commonjs/theme/index.d.ts +7 -0
  36. package/lib/typescript/commonjs/theme/index.d.ts.map +1 -1
  37. package/lib/typescript/commonjs/theme/seed-scope/index.d.ts +37 -0
  38. package/lib/typescript/commonjs/theme/seed-scope/index.d.ts.map +1 -0
  39. package/lib/typescript/commonjs/theme/seed-scope/index.web.d.ts +35 -0
  40. package/lib/typescript/commonjs/theme/seed-scope/index.web.d.ts.map +1 -0
  41. package/lib/typescript/module/theme/build-theme-from-seed.d.ts +23 -0
  42. package/lib/typescript/module/theme/build-theme-from-seed.d.ts.map +1 -0
  43. package/lib/typescript/module/theme/color-engine/scheme-variants.d.ts +10 -1
  44. package/lib/typescript/module/theme/color-engine/scheme-variants.d.ts.map +1 -1
  45. package/lib/typescript/module/theme/color-scope/seed-scope.d.ts +3 -2
  46. package/lib/typescript/module/theme/color-scope/seed-scope.d.ts.map +1 -1
  47. package/lib/typescript/module/theme/index.d.ts +7 -0
  48. package/lib/typescript/module/theme/index.d.ts.map +1 -1
  49. package/lib/typescript/module/theme/seed-scope/index.d.ts +37 -0
  50. package/lib/typescript/module/theme/seed-scope/index.d.ts.map +1 -0
  51. package/lib/typescript/module/theme/seed-scope/index.web.d.ts +35 -0
  52. package/lib/typescript/module/theme/seed-scope/index.web.d.ts.map +1 -0
  53. package/package.json +1 -1
  54. package/src/theme/__tests__/__fixtures__/golden-resolved-tokens.json +74 -74
  55. package/src/theme/__tests__/__snapshots__/visual-gallery.test.tsx.snap +68 -68
  56. package/src/theme/__tests__/build-theme-from-seed-parity.test.ts +33 -0
  57. package/src/theme/build-theme-from-seed.ts +99 -0
  58. package/src/theme/color-engine/scheme-variants.ts +30 -1
  59. package/src/theme/color-presets.ts +13 -13
  60. package/src/theme/color-scope/seed-scope.ts +4 -2
  61. package/src/theme/index.ts +21 -0
  62. package/src/theme/seed-scope/index.tsx +100 -0
  63. package/src/theme/seed-scope/index.web.tsx +110 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/theme/seed-scope/index.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;AAErD,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,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,OAAO,EACP,aAAa,EACb,OAAe,EACf,KAAK,EACL,QAAQ,GACT,EAAE,mBAAmB,2CA8CrB"}
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import type { SchemeVariant } from '../color-engine';
3
+ export interface BloomSeedScopeProps {
4
+ /**
5
+ * The seed colour (`#rrggbb`) to derive this subtree's palette from. When
6
+ * `undefined`, the scope is a no-op and children inherit the parent scope
7
+ * unchanged — pass `undefined` to fall back to the app preset (e.g. on
8
+ * mouse-leave/blur when restoring the default theme).
9
+ */
10
+ seed: string | undefined;
11
+ /** Tonal scheme variant. Defaults to `'vibrant'` (matches Bloom presets). */
12
+ variant?: SchemeVariant;
13
+ /** −1 (low) … 0 (normal) … 1 (high). Defaults to 0. */
14
+ contrastLevel?: number;
15
+ /**
16
+ * When `true`, do not render a wrapping `<div>`. The single child is cloned
17
+ * with the scope's CSS vars merged into its `style` prop (Radix-style).
18
+ */
19
+ asChild?: boolean;
20
+ /** Additional style applied to the wrapping `<div>` (or merged into the cloned child with `asChild`). */
21
+ style?: React.CSSProperties;
22
+ children: React.ReactNode;
23
+ }
24
+ /**
25
+ * Web `<BloomSeedScope>`: scopes a subtree to an ARBITRARY seed colour's palette
26
+ * (the dynamic counterpart of `<BloomColorScope>`). It (1) writes every canonical
27
+ * `--x` token plus the Tailwind v4 `--color-x` aliases (already resolved to
28
+ * `rgb(...)`) onto the wrapping element's inline `style`, so NativeWind classes
29
+ * inside resolve against the seed palette instead of the document root, and
30
+ * (2) publishes a matching JS `theme` on `BloomThemeContext` so
31
+ * `useTheme()`/`useBloomTheme()` consumers inside the subtree re-theme too. The
32
+ * `colorPreset` field is left as the parent's (a seed is not a named preset).
33
+ */
34
+ export declare function BloomSeedScope({ seed, variant, contrastLevel, asChild, style, children, }: BloomSeedScopeProps): import("react/jsx-runtime").JSX.Element;
35
+ //# sourceMappingURL=index.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../../src/theme/seed-scope/index.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAK3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,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,OAAO,EACP,aAAa,EACb,OAAe,EACf,KAAK,EACL,QAAQ,GACT,EAAE,mBAAmB,2CA6CrB"}
@@ -0,0 +1,23 @@
1
+ import { type SchemeVariant } from './color-engine';
2
+ import type { Theme, ThemeColors } from './types';
3
+ /**
4
+ * Build the JS `theme.colors` object from an ARBITRARY seed colour — the dynamic
5
+ * counterpart of `buildTheme(preset, …)`.
6
+ *
7
+ * This mirrors `buildColorsFromPreset` (`build-theme.ts`) field-for-field, but
8
+ * sources its tokens from `buildSeedScopeVars({ seed })` instead of a named
9
+ * preset, so a preset's seed reproduces that preset's JS theme exactly. Keeping
10
+ * the two in lockstep is enforced by `__tests__/build-theme-from-seed-parity.test.ts`.
11
+ *
12
+ * Token-backed fields read the resolved `rgb(...)` token map; the brand-tint
13
+ * family (primarySubtle / negative / …) reads the engine's container/error roles
14
+ * directly — identical to the preset path.
15
+ */
16
+ export declare function buildColorsFromSeed(seed: string, resolved: 'light' | 'dark', variant?: SchemeVariant, contrastLevel?: number): ThemeColors;
17
+ /**
18
+ * Build a full `Theme` from a seed colour and a resolved light/dark mode. Unlike
19
+ * `buildTheme`, there is no adaptive (Material You / iOS dynamic) override — a
20
+ * seed IS the dynamic source here.
21
+ */
22
+ export declare function buildThemeFromSeed(seed: string, resolved: 'light' | 'dark', variant?: SchemeVariant, contrastLevel?: number): Theme;
23
+ //# sourceMappingURL=build-theme-from-seed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-theme-from-seed.d.ts","sourceRoot":"","sources":["../../../../src/theme/build-theme-from-seed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAIzF,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElD;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,OAAO,GAAG,MAAM,EAC1B,OAAO,CAAC,EAAE,aAAa,EACvB,aAAa,CAAC,EAAE,MAAM,GACrB,WAAW,CAsDb;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,OAAO,GAAG,MAAM,EAC1B,OAAO,CAAC,EAAE,aAAa,EACvB,aAAa,CAAC,EAAE,MAAM,GACrB,KAAK,CAQP"}
@@ -9,10 +9,19 @@
9
9
  */
10
10
  import { DynamicScheme } from './dynamic-scheme';
11
11
  import type { Hct } from './hct';
12
- export type SchemeVariant = 'vibrant' | 'expressive' | 'tonalSpot' | 'neutral';
12
+ export type SchemeVariant = 'vivid' | 'vibrant' | 'expressive' | 'tonalSpot' | 'neutral';
13
13
  /** Maxed-out colourfulness at each position of the primary palette. */
14
14
  export declare function schemeVibrant(source: Hct, isDark: boolean, contrastLevel: number): DynamicScheme;
15
15
  /** Playful, intentionally detached from the seed hue (primary rotated 240°). */
16
+ /**
17
+ * Bloom's own brand-vivid scheme. Same vibrant base (max-chroma primary) but the
18
+ * secondary and tertiary accents keep MUCH more chroma than canonical M3 (which
19
+ * intentionally desaturates supporting accents). Neutrals stay low-chroma so
20
+ * surfaces read as clean tinted light/dark. This is what the presets use — the
21
+ * old hand-authored palette felt more vivid than pure M3, and this restores that
22
+ * across the whole primary/secondary/tertiary trio.
23
+ */
24
+ export declare function schemeVivid(source: Hct, isDark: boolean, contrastLevel: number): DynamicScheme;
16
25
  export declare function schemeExpressive(source: Hct, isDark: boolean, contrastLevel: number): DynamicScheme;
17
26
  /** The Material You default — a calm, balanced treatment of the seed. */
18
27
  export declare function schemeTonalSpot(source: Hct, isDark: boolean, contrastLevel: number): DynamicScheme;
@@ -1 +1 @@
1
- {"version":3,"file":"scheme-variants.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-engine/scheme-variants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAKjC,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,SAAS,CAAC;AAU/E,uEAAuE;AACvE,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,aAAa,CAkBhG;AAED,gFAAgF;AAChF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,aAAa,CAkBnG;AAED,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,aAAa,CAYlG;AAED,kEAAkE;AAClE,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,aAAa,CAYhG;AASD,sCAAsC;AACtC,wBAAgB,WAAW,CACzB,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,GAAG,EACX,MAAM,EAAE,OAAO,EACf,aAAa,SAAI,GAChB,aAAa,CAEf"}
1
+ {"version":3,"file":"scheme-variants.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-engine/scheme-variants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAKjC,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,GAAG,YAAY,GAAG,WAAW,GAAG,SAAS,CAAC;AAUzF,uEAAuE;AACvE,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,aAAa,CAkBhG;AAED,gFAAgF;AAChF;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,aAAa,CAkB9F;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,aAAa,CAkBnG;AAED,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,aAAa,CAYlG;AAED,kEAAkE;AAClE,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,aAAa,CAYhG;AAUD,sCAAsC;AACtC,wBAAgB,WAAW,CACzB,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,GAAG,EACX,MAAM,EAAE,OAAO,EACf,aAAa,SAAI,GAChB,aAAa,CAEf"}
@@ -20,8 +20,9 @@ export interface SeedScopeOptions {
20
20
  seed: string;
21
21
  mode: 'light' | 'dark';
22
22
  /**
23
- * The tonal scheme variant. Defaults to `'vibrant'` — the same variant every
24
- * named Bloom preset uses, so a preset's seed reproduces that preset exactly.
23
+ * The tonal scheme variant. Defaults to `'vivid'` — the same variant every
24
+ * named Bloom preset uses, so a preset's seed reproduces that preset exactly
25
+ * (and an artwork-extracted seed gets the same brand-vivid feel as the app).
25
26
  */
26
27
  variant?: SchemeVariant;
27
28
  /** −1 (low) … 0 (normal) … 1 (high). Defaults to 0. */
@@ -1 +1 @@
1
- {"version":3,"file":"seed-scope.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/seed-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAG1F;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA0C9E;AAED,mEAAmE;AACnE,MAAM,WAAW,gBAAgB;IAC/B,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAiBpF"}
1
+ {"version":3,"file":"seed-scope.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/seed-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAG1F;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA0C9E;AAED,mEAAmE;AACnE,MAAM,WAAW,gBAAgB;IAC/B,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,uDAAuD;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkBpF"}
@@ -2,7 +2,14 @@ export { BloomThemeProvider } from './BloomThemeProvider';
2
2
  export type { BloomThemeProviderProps, BloomThemeContextValue, } from './BloomThemeProvider';
3
3
  export { BloomColorScope, useColorScopeStyle } from './color-scope';
4
4
  export type { BloomColorScopeProps } from './color-scope';
5
+ export { BloomSeedScope } from './seed-scope';
6
+ export type { BloomSeedScopeProps } from './seed-scope';
7
+ export { buildSeedScopeVars, roleColorsToPresetTokens } from './color-scope/seed-scope';
8
+ export type { SeedScopeOptions } from './color-scope/seed-scope';
9
+ export { generateRoleColors, seedHexFromImagePixels, seedsFromImagePixels, quantizeImage, argbFromHex, hexFromArgb, argbFromRgb, redFromArgb, greenFromArgb, blueFromArgb, } from './color-engine';
10
+ export type { RoleColors, GenerateOptions, RoleName, SchemeVariant } from './color-engine';
5
11
  export { buildTheme, STATUS_COLORS } from './build-theme';
12
+ export { buildThemeFromSeed, buildColorsFromSeed } from './build-theme-from-seed';
6
13
  export { THEME_GRADIENTS } from './gradients';
7
14
  export { useTheme, useThemeColor, useBloomTheme } from './use-theme';
8
15
  export { useNavigationTheme } from './use-navigation-theme';
@@ -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;AAC1D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACrE,OAA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M,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"}
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ import { type StyleProp, type ViewStyle } from 'react-native';
3
+ import type { SchemeVariant } from '../color-engine';
4
+ export interface BloomSeedScopeProps {
5
+ /**
6
+ * The seed colour (`#rrggbb`) to derive this subtree's palette from. When
7
+ * `undefined`, the scope is a no-op and children inherit the parent scope
8
+ * unchanged — pass `undefined` to fall back to the app preset (e.g. on
9
+ * mouse-leave/blur when restoring the default theme).
10
+ */
11
+ seed: string | undefined;
12
+ /** Tonal scheme variant. Defaults to `'vibrant'` (matches Bloom presets). */
13
+ variant?: SchemeVariant;
14
+ /** −1 (low) … 0 (normal) … 1 (high). Defaults to 0. */
15
+ contrastLevel?: number;
16
+ /**
17
+ * When `true`, do not render a wrapping `<View>`. The single child is cloned
18
+ * with the caller's `style` merged into its `style` prop (Radix-style).
19
+ */
20
+ asChild?: boolean;
21
+ /** Additional style applied to the wrapping `<View>` (or merged into the cloned child with `asChild`). */
22
+ style?: StyleProp<ViewStyle>;
23
+ children: React.ReactNode;
24
+ }
25
+ /**
26
+ * Native `<BloomSeedScope>`: scopes a subtree to an ARBITRARY seed colour's
27
+ * palette (the dynamic counterpart of `<BloomColorScope>`, which takes a named
28
+ * preset). Feeds the seed through the colour engine and (1) provides the
29
+ * resulting canonical CSS vars to descendants via react-native-css's
30
+ * `VariableContext` — so `bg-background` / `bg-card` / `var(--primary)` resolve
31
+ * against the seed inside this subtree — and (2) publishes a matching JS `theme`
32
+ * on `BloomThemeContext`, so `useTheme()`/`useBloomTheme()` consumers inside the
33
+ * subtree also re-theme. The `colorPreset` field is left as the parent's (a seed
34
+ * is not a named preset).
35
+ */
36
+ export declare function BloomSeedScope({ seed, variant, contrastLevel, asChild, style, children, }: BloomSeedScopeProps): import("react/jsx-runtime").JSX.Element;
37
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/theme/seed-scope/index.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;AAErD,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,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,OAAO,EACP,aAAa,EACb,OAAe,EACf,KAAK,EACL,QAAQ,GACT,EAAE,mBAAmB,2CA8CrB"}
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import type { SchemeVariant } from '../color-engine';
3
+ export interface BloomSeedScopeProps {
4
+ /**
5
+ * The seed colour (`#rrggbb`) to derive this subtree's palette from. When
6
+ * `undefined`, the scope is a no-op and children inherit the parent scope
7
+ * unchanged — pass `undefined` to fall back to the app preset (e.g. on
8
+ * mouse-leave/blur when restoring the default theme).
9
+ */
10
+ seed: string | undefined;
11
+ /** Tonal scheme variant. Defaults to `'vibrant'` (matches Bloom presets). */
12
+ variant?: SchemeVariant;
13
+ /** −1 (low) … 0 (normal) … 1 (high). Defaults to 0. */
14
+ contrastLevel?: number;
15
+ /**
16
+ * When `true`, do not render a wrapping `<div>`. The single child is cloned
17
+ * with the scope's CSS vars merged into its `style` prop (Radix-style).
18
+ */
19
+ asChild?: boolean;
20
+ /** Additional style applied to the wrapping `<div>` (or merged into the cloned child with `asChild`). */
21
+ style?: React.CSSProperties;
22
+ children: React.ReactNode;
23
+ }
24
+ /**
25
+ * Web `<BloomSeedScope>`: scopes a subtree to an ARBITRARY seed colour's palette
26
+ * (the dynamic counterpart of `<BloomColorScope>`). It (1) writes every canonical
27
+ * `--x` token plus the Tailwind v4 `--color-x` aliases (already resolved to
28
+ * `rgb(...)`) onto the wrapping element's inline `style`, so NativeWind classes
29
+ * inside resolve against the seed palette instead of the document root, and
30
+ * (2) publishes a matching JS `theme` on `BloomThemeContext` so
31
+ * `useTheme()`/`useBloomTheme()` consumers inside the subtree re-theme too. The
32
+ * `colorPreset` field is left as the parent's (a seed is not a named preset).
33
+ */
34
+ export declare function BloomSeedScope({ seed, variant, contrastLevel, asChild, style, children, }: BloomSeedScopeProps): import("react/jsx-runtime").JSX.Element;
35
+ //# sourceMappingURL=index.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../../src/theme/seed-scope/index.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAK3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,mBAAmB;IAClC;;;;;OAKG;IACH,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,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,OAAO,EACP,aAAa,EACb,OAAe,EACf,KAAK,EACL,QAAQ,GACT,EAAE,mBAAmB,2CA6CrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyhq/bloom",
3
- "version": "0.39.0",
3
+ "version": "0.41.0",
4
4
  "description": "Bloom UI — Oxy ecosystem component library for React Native + Expo + Web",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",