@oxyhq/bloom 0.73.1 → 0.74.1

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 (88) hide show
  1. package/lib/commonjs/design-tokens/theme.css +22 -0
  2. package/lib/commonjs/fab/Fab.js +9 -0
  3. package/lib/commonjs/fab/Fab.js.map +1 -1
  4. package/lib/commonjs/fab/Fab.web.js +11 -0
  5. package/lib/commonjs/fab/Fab.web.js.map +1 -1
  6. package/lib/commonjs/theme/BloomThemeProvider.js.map +1 -1
  7. package/lib/commonjs/theme/build-theme-from-seed.js +7 -5
  8. package/lib/commonjs/theme/build-theme-from-seed.js.map +1 -1
  9. package/lib/commonjs/theme/build-theme.js +9 -4
  10. package/lib/commonjs/theme/build-theme.js.map +1 -1
  11. package/lib/commonjs/theme/color-policy.js +320 -0
  12. package/lib/commonjs/theme/color-policy.js.map +1 -0
  13. package/lib/commonjs/theme/color-scope/seed-scope.js +13 -1
  14. package/lib/commonjs/theme/color-scope/seed-scope.js.map +1 -1
  15. package/lib/commonjs/theme/color-scope/style-builder.js +6 -0
  16. package/lib/commonjs/theme/color-scope/style-builder.js.map +1 -1
  17. package/lib/commonjs/theme/preset-vars.js +9 -1
  18. package/lib/commonjs/theme/preset-vars.js.map +1 -1
  19. package/lib/commonjs/theme/token-registry.js +11 -1
  20. package/lib/commonjs/theme/token-registry.js.map +1 -1
  21. package/lib/module/design-tokens/theme.css +22 -0
  22. package/lib/module/fab/Fab.js +9 -0
  23. package/lib/module/fab/Fab.js.map +1 -1
  24. package/lib/module/fab/Fab.web.js +11 -0
  25. package/lib/module/fab/Fab.web.js.map +1 -1
  26. package/lib/module/theme/BloomThemeProvider.js.map +1 -1
  27. package/lib/module/theme/build-theme-from-seed.js +7 -5
  28. package/lib/module/theme/build-theme-from-seed.js.map +1 -1
  29. package/lib/module/theme/build-theme.js +9 -4
  30. package/lib/module/theme/build-theme.js.map +1 -1
  31. package/lib/module/theme/color-policy.js +315 -0
  32. package/lib/module/theme/color-policy.js.map +1 -0
  33. package/lib/module/theme/color-scope/seed-scope.js +13 -1
  34. package/lib/module/theme/color-scope/seed-scope.js.map +1 -1
  35. package/lib/module/theme/color-scope/style-builder.js +6 -0
  36. package/lib/module/theme/color-scope/style-builder.js.map +1 -1
  37. package/lib/module/theme/preset-vars.js +9 -1
  38. package/lib/module/theme/preset-vars.js.map +1 -1
  39. package/lib/module/theme/token-registry.js +11 -1
  40. package/lib/module/theme/token-registry.js.map +1 -1
  41. package/lib/typescript/commonjs/fab/Fab.d.ts.map +1 -1
  42. package/lib/typescript/commonjs/fab/Fab.web.d.ts.map +1 -1
  43. package/lib/typescript/commonjs/fab/types.d.ts +6 -1
  44. package/lib/typescript/commonjs/fab/types.d.ts.map +1 -1
  45. package/lib/typescript/commonjs/icons/common.d.ts +1 -1
  46. package/lib/typescript/commonjs/theme/BloomThemeProvider.d.ts.map +1 -1
  47. package/lib/typescript/commonjs/theme/build-theme-from-seed.d.ts.map +1 -1
  48. package/lib/typescript/commonjs/theme/build-theme.d.ts.map +1 -1
  49. package/lib/typescript/commonjs/theme/color-policy.d.ts +48 -0
  50. package/lib/typescript/commonjs/theme/color-policy.d.ts.map +1 -0
  51. package/lib/typescript/commonjs/theme/color-scope/seed-scope.d.ts.map +1 -1
  52. package/lib/typescript/commonjs/theme/color-scope/style-builder.d.ts.map +1 -1
  53. package/lib/typescript/commonjs/theme/preset-vars.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/theme/token-registry.d.ts +1 -1
  55. package/lib/typescript/commonjs/theme/token-registry.d.ts.map +1 -1
  56. package/lib/typescript/module/fab/Fab.d.ts.map +1 -1
  57. package/lib/typescript/module/fab/Fab.web.d.ts.map +1 -1
  58. package/lib/typescript/module/fab/types.d.ts +6 -1
  59. package/lib/typescript/module/fab/types.d.ts.map +1 -1
  60. package/lib/typescript/module/icons/common.d.ts +1 -1
  61. package/lib/typescript/module/theme/BloomThemeProvider.d.ts.map +1 -1
  62. package/lib/typescript/module/theme/build-theme-from-seed.d.ts.map +1 -1
  63. package/lib/typescript/module/theme/build-theme.d.ts.map +1 -1
  64. package/lib/typescript/module/theme/color-policy.d.ts +48 -0
  65. package/lib/typescript/module/theme/color-policy.d.ts.map +1 -0
  66. package/lib/typescript/module/theme/color-scope/seed-scope.d.ts.map +1 -1
  67. package/lib/typescript/module/theme/color-scope/style-builder.d.ts.map +1 -1
  68. package/lib/typescript/module/theme/preset-vars.d.ts.map +1 -1
  69. package/lib/typescript/module/theme/token-registry.d.ts +1 -1
  70. package/lib/typescript/module/theme/token-registry.d.ts.map +1 -1
  71. package/package.json +1 -1
  72. package/src/__tests__/preset-vars.test.ts +27 -15
  73. package/src/design-tokens/theme.css +22 -0
  74. package/src/fab/Fab.tsx +3 -0
  75. package/src/fab/Fab.web.tsx +3 -0
  76. package/src/fab/types.ts +6 -1
  77. package/src/theme/BloomThemeProvider.tsx +7 -4
  78. package/src/theme/__tests__/__fixtures__/golden-resolved-tokens.json +1300 -312
  79. package/src/theme/__tests__/__snapshots__/visual-gallery.test.tsx.snap +442 -442
  80. package/src/theme/__tests__/policy-legibility.test.ts +118 -0
  81. package/src/theme/__tests__/theme-colors-parity.test.ts +11 -6
  82. package/src/theme/build-theme-from-seed.ts +7 -4
  83. package/src/theme/build-theme.ts +9 -4
  84. package/src/theme/color-policy.ts +346 -0
  85. package/src/theme/color-scope/seed-scope.ts +13 -1
  86. package/src/theme/color-scope/style-builder.ts +6 -0
  87. package/src/theme/preset-vars.ts +10 -1
  88. package/src/theme/token-registry.ts +32 -0
@@ -166,6 +166,9 @@ function resolveVariant(
166
166
  ): { background: string; foreground: string; ring: string } {
167
167
  switch (variant) {
168
168
  case 'secondary':
169
+ return { background: c.secondary, foreground: c.secondaryForeground, ring: c.secondary };
170
+ case 'tertiary':
171
+ return { background: c.tertiary, foreground: c.tertiaryForeground, ring: c.tertiary };
169
172
  case 'surface':
170
173
  return { background: c.card, foreground: c.text, ring: c.primary };
171
174
  case 'primary':
package/src/fab/types.ts CHANGED
@@ -9,7 +9,12 @@ import type { StyleProp, ViewStyle, TextStyle } from 'react-native';
9
9
  * A lower-emphasis FAB that still reads as elevated.
10
10
  * - `surface` — alias of `secondary`, named for Material-style "surface" FABs.
11
11
  */
12
- export type FabVariant = 'primary' | 'secondary' | 'surface';
12
+ /**
13
+ * M3 defines four FAB colour variants. Bloom previously mapped `secondary` onto
14
+ * the neutral card surface, so a "secondary FAB" was a grey circle and the
15
+ * accent trio had no home in the component that most wants one.
16
+ */
17
+ export type FabVariant = 'primary' | 'secondary' | 'tertiary' | 'surface';
13
18
 
14
19
  /**
15
20
  * FAB size presets, matching Material-ish conventions but in Bloom's scale:
@@ -410,10 +410,13 @@ export function BloomThemeProvider({
410
410
  const themeColors = useMemo(
411
411
  () =>
412
412
  effectiveSeed
413
- ? buildThemeFromSeed(effectiveSeed, resolved, undefined, undefined, {
414
- secondarySeed: effectiveSecondary,
415
- tertiarySeed: effectiveTertiary,
416
- })
413
+ ? buildThemeFromSeed(
414
+ effectiveSeed,
415
+ resolved,
416
+ undefined,
417
+ undefined,
418
+ { secondarySeed: effectiveSecondary, tertiarySeed: effectiveTertiary }
419
+ )
417
420
  : buildTheme(colorPreset, resolved, isAdaptive, explicitAccents),
418
421
  [
419
422
  effectiveSeed,