@oxy.so/bloom 1.1.1 → 1.3.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 (94) hide show
  1. package/docs/rail.mdx +112 -0
  2. package/lib/commonjs/design-tokens/tokens.json +47 -47
  3. package/lib/commonjs/index.js +77 -69
  4. package/lib/commonjs/index.js.map +1 -1
  5. package/lib/commonjs/index.web.js +77 -69
  6. package/lib/commonjs/index.web.js.map +1 -1
  7. package/lib/commonjs/rail/Rail.js +127 -0
  8. package/lib/commonjs/rail/Rail.js.map +1 -0
  9. package/lib/commonjs/rail/index.js +13 -0
  10. package/lib/commonjs/rail/index.js.map +1 -0
  11. package/lib/commonjs/rail/types.js +6 -0
  12. package/lib/commonjs/rail/types.js.map +1 -0
  13. package/lib/commonjs/styles/web-view-style.js +11 -1
  14. package/lib/commonjs/styles/web-view-style.js.map +1 -1
  15. package/lib/commonjs/theme/adaptive-colors.js +8 -6
  16. package/lib/commonjs/theme/adaptive-colors.js.map +1 -1
  17. package/lib/commonjs/theme/build-theme-from-seed.js +4 -0
  18. package/lib/commonjs/theme/build-theme-from-seed.js.map +1 -1
  19. package/lib/commonjs/theme/build-theme.js +4 -0
  20. package/lib/commonjs/theme/build-theme.js.map +1 -1
  21. package/lib/commonjs/theme/color-policy.js +34 -5
  22. package/lib/commonjs/theme/color-policy.js.map +1 -1
  23. package/lib/module/design-tokens/tokens.json +47 -47
  24. package/lib/module/index.js +1 -0
  25. package/lib/module/index.js.map +1 -1
  26. package/lib/module/index.web.js +1 -0
  27. package/lib/module/index.web.js.map +1 -1
  28. package/lib/module/rail/Rail.js +121 -0
  29. package/lib/module/rail/Rail.js.map +1 -0
  30. package/lib/module/rail/index.js +4 -0
  31. package/lib/module/rail/index.js.map +1 -0
  32. package/lib/module/rail/types.js +4 -0
  33. package/lib/module/rail/types.js.map +1 -0
  34. package/lib/module/styles/web-view-style.js +10 -0
  35. package/lib/module/styles/web-view-style.js.map +1 -1
  36. package/lib/module/theme/adaptive-colors.js +8 -6
  37. package/lib/module/theme/adaptive-colors.js.map +1 -1
  38. package/lib/module/theme/build-theme-from-seed.js +4 -0
  39. package/lib/module/theme/build-theme-from-seed.js.map +1 -1
  40. package/lib/module/theme/build-theme.js +4 -0
  41. package/lib/module/theme/build-theme.js.map +1 -1
  42. package/lib/module/theme/color-policy.js +34 -5
  43. package/lib/module/theme/color-policy.js.map +1 -1
  44. package/lib/typescript/commonjs/index.d.ts +2 -0
  45. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  46. package/lib/typescript/commonjs/index.web.d.ts +2 -0
  47. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  48. package/lib/typescript/commonjs/rail/Rail.d.ts +46 -0
  49. package/lib/typescript/commonjs/rail/Rail.d.ts.map +1 -0
  50. package/lib/typescript/commonjs/rail/index.d.ts +3 -0
  51. package/lib/typescript/commonjs/rail/index.d.ts.map +1 -0
  52. package/lib/typescript/commonjs/rail/types.d.ts +46 -0
  53. package/lib/typescript/commonjs/rail/types.d.ts.map +1 -0
  54. package/lib/typescript/commonjs/styles/web-view-style.d.ts +9 -0
  55. package/lib/typescript/commonjs/styles/web-view-style.d.ts.map +1 -1
  56. package/lib/typescript/commonjs/theme/adaptive-colors.d.ts +9 -7
  57. package/lib/typescript/commonjs/theme/adaptive-colors.d.ts.map +1 -1
  58. package/lib/typescript/commonjs/theme/build-theme-from-seed.d.ts.map +1 -1
  59. package/lib/typescript/commonjs/theme/build-theme.d.ts.map +1 -1
  60. package/lib/typescript/commonjs/theme/color-policy.d.ts.map +1 -1
  61. package/lib/typescript/commonjs/theme/types.d.ts +4 -0
  62. package/lib/typescript/commonjs/theme/types.d.ts.map +1 -1
  63. package/lib/typescript/module/index.d.ts +2 -0
  64. package/lib/typescript/module/index.d.ts.map +1 -1
  65. package/lib/typescript/module/index.web.d.ts +2 -0
  66. package/lib/typescript/module/index.web.d.ts.map +1 -1
  67. package/lib/typescript/module/rail/Rail.d.ts +46 -0
  68. package/lib/typescript/module/rail/Rail.d.ts.map +1 -0
  69. package/lib/typescript/module/rail/index.d.ts +3 -0
  70. package/lib/typescript/module/rail/index.d.ts.map +1 -0
  71. package/lib/typescript/module/rail/types.d.ts +46 -0
  72. package/lib/typescript/module/rail/types.d.ts.map +1 -0
  73. package/lib/typescript/module/styles/web-view-style.d.ts +9 -0
  74. package/lib/typescript/module/styles/web-view-style.d.ts.map +1 -1
  75. package/lib/typescript/module/theme/adaptive-colors.d.ts +9 -7
  76. package/lib/typescript/module/theme/adaptive-colors.d.ts.map +1 -1
  77. package/lib/typescript/module/theme/build-theme-from-seed.d.ts.map +1 -1
  78. package/lib/typescript/module/theme/build-theme.d.ts.map +1 -1
  79. package/lib/typescript/module/theme/color-policy.d.ts.map +1 -1
  80. package/lib/typescript/module/theme/types.d.ts +4 -0
  81. package/lib/typescript/module/theme/types.d.ts.map +1 -1
  82. package/package.json +15 -1
  83. package/src/design-tokens/tokens.json +47 -47
  84. package/src/index.ts +2 -0
  85. package/src/index.web.ts +2 -0
  86. package/src/rail/Rail.tsx +126 -0
  87. package/src/rail/index.ts +2 -0
  88. package/src/rail/types.ts +47 -0
  89. package/src/styles/web-view-style.ts +10 -0
  90. package/src/theme/adaptive-colors.ts +12 -6
  91. package/src/theme/build-theme-from-seed.ts +4 -0
  92. package/src/theme/build-theme.ts +4 -0
  93. package/src/theme/color-policy.ts +36 -5
  94. package/src/theme/types.ts +4 -0
@@ -109,6 +109,21 @@ const FILL_TONE_SEARCH_CEILING = 56;
109
109
  */
110
110
  const LIGHT_DEPTH_STEP = 5;
111
111
 
112
+ /**
113
+ * How much a PINNED action steps below its own peak in light mode — smaller
114
+ * than `LIGHT_DEPTH_STEP`, because staying close to the peak (not the full
115
+ * depth every other fill takes) is this branch's entire reason to exist (see
116
+ * `pinnedAction` below). 5 — `LIGHT_DEPTH_STEP` itself — was tried first and
117
+ * rejected: two curated presets can declare tertiary hues a fraction of a
118
+ * degree apart (`indigo-ember` and `pewter-current`, both a "turquoise
119
+ * action", 0.26° apart), and at THAT specific offset the two hues' peaks
120
+ * happened to round to the same quantized 8-bit colour, so one pinned action
121
+ * rendered two presets identically. The offset has no other significance
122
+ * than clearing that — any of {3, 4, 7, 8} does, checked against every
123
+ * built-in preset's own pinned `tertiaryHex`.
124
+ */
125
+ const PINNED_ACTION_LIGHT_STEP = 4;
126
+
112
127
  /**
113
128
  * How deep a light-mode fill may go. Deliberately BELOW the search's lower bound,
114
129
  * which those two used to share — and sharing them silently voided the depth step
@@ -550,11 +565,27 @@ export function buildPolicyTokens(
550
565
  ? MONOCHROME_SECONDARY_TONE.dark
551
566
  : MONOCHROME_SECONDARY_TONE.light
552
567
  : pinnedAction
553
- // A deliberately paired action stays at the hue's vivid peak instead of
554
- // turning signal yellow into ochre or lime into olive on a light page.
555
- // The matched foreground may be black; legibility is decided by the pair,
556
- // not by a blanket white-label preference.
557
- ? Math.max(peakTone(hue), isDark ? DARK_ACCENT_FLOOR : LIGHT_FILL_FLOOR)
568
+ // A deliberately paired action stays NEAR the hue's vivid peak instead of
569
+ // turning signal yellow into ochre or lime into olive on a light page. The
570
+ // matched foreground may be black; legibility is decided by the pair, not
571
+ // by a blanket white-label preference.
572
+ //
573
+ // Light and dark still have to differ, same as every other fill in this
574
+ // file — an EARLIER version of this branch floored both modes on
575
+ // `peakTone(hue)` directly with only the FLOOR differing (`LIGHT_FILL_FLOOR`
576
+ // vs `DARK_ACCENT_FLOOR`), so for any hue whose peak sits above both floors
577
+ // — the common case — the floor never bound anything and light and dark
578
+ // landed on the IDENTICAL tone: the same fill and the same foreground
579
+ // rendered twice. Measured across the 47 built-in presets that declare a
580
+ // `tertiaryHex`, that was ~30 of them, plus any app pinning its own
581
+ // `tertiaryColor`. Dark keeps the pure peak (the "stay vivid" case this
582
+ // branch exists for is a dark-page problem — deepening costs nothing
583
+ // there); light steps `PINNED_ACTION_LIGHT_STEP` below its own peak, so it
584
+ // still reads as "the same brand, a page deeper" rather than vanishing
585
+ // into the dark-mode swatch.
586
+ ? isDark
587
+ ? Math.max(peakTone(hue), DARK_ACCENT_FLOOR)
588
+ : Math.max(LIGHT_FILL_FLOOR, peakTone(hue) - PINNED_ACTION_LIGHT_STEP)
558
589
  : accentTone(hue, isDark);
559
590
  const pair = fillPair(fillPalette, tone);
560
591
  tokens[`--${role}`] = pair.fill;
@@ -31,9 +31,13 @@ export interface ThemeColors {
31
31
  iconActive: string;
32
32
 
33
33
  success: string;
34
+ successForeground: string;
34
35
  error: string;
36
+ errorForeground: string;
35
37
  warning: string;
38
+ warningForeground: string;
36
39
  info: string;
40
+ infoForeground: string;
37
41
 
38
42
  /**
39
43
  * The tinted status SURFACES and the text that is legible on them.