@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.
- package/docs/rail.mdx +112 -0
- package/lib/commonjs/design-tokens/tokens.json +47 -47
- package/lib/commonjs/index.js +77 -69
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +77 -69
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/rail/Rail.js +127 -0
- package/lib/commonjs/rail/Rail.js.map +1 -0
- package/lib/commonjs/rail/index.js +13 -0
- package/lib/commonjs/rail/index.js.map +1 -0
- package/lib/commonjs/rail/types.js +6 -0
- package/lib/commonjs/rail/types.js.map +1 -0
- package/lib/commonjs/styles/web-view-style.js +11 -1
- package/lib/commonjs/styles/web-view-style.js.map +1 -1
- package/lib/commonjs/theme/adaptive-colors.js +8 -6
- package/lib/commonjs/theme/adaptive-colors.js.map +1 -1
- package/lib/commonjs/theme/build-theme-from-seed.js +4 -0
- package/lib/commonjs/theme/build-theme-from-seed.js.map +1 -1
- package/lib/commonjs/theme/build-theme.js +4 -0
- package/lib/commonjs/theme/build-theme.js.map +1 -1
- package/lib/commonjs/theme/color-policy.js +34 -5
- package/lib/commonjs/theme/color-policy.js.map +1 -1
- package/lib/module/design-tokens/tokens.json +47 -47
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +1 -0
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/rail/Rail.js +121 -0
- package/lib/module/rail/Rail.js.map +1 -0
- package/lib/module/rail/index.js +4 -0
- package/lib/module/rail/index.js.map +1 -0
- package/lib/module/rail/types.js +4 -0
- package/lib/module/rail/types.js.map +1 -0
- package/lib/module/styles/web-view-style.js +10 -0
- package/lib/module/styles/web-view-style.js.map +1 -1
- package/lib/module/theme/adaptive-colors.js +8 -6
- package/lib/module/theme/adaptive-colors.js.map +1 -1
- package/lib/module/theme/build-theme-from-seed.js +4 -0
- package/lib/module/theme/build-theme-from-seed.js.map +1 -1
- package/lib/module/theme/build-theme.js +4 -0
- package/lib/module/theme/build-theme.js.map +1 -1
- package/lib/module/theme/color-policy.js +34 -5
- package/lib/module/theme/color-policy.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +2 -0
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/rail/Rail.d.ts +46 -0
- package/lib/typescript/commonjs/rail/Rail.d.ts.map +1 -0
- package/lib/typescript/commonjs/rail/index.d.ts +3 -0
- package/lib/typescript/commonjs/rail/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/rail/types.d.ts +46 -0
- package/lib/typescript/commonjs/rail/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/styles/web-view-style.d.ts +9 -0
- package/lib/typescript/commonjs/styles/web-view-style.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/adaptive-colors.d.ts +9 -7
- package/lib/typescript/commonjs/theme/adaptive-colors.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/build-theme-from-seed.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/build-theme.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-policy.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/types.d.ts +4 -0
- package/lib/typescript/commonjs/theme/types.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +2 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +2 -0
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/rail/Rail.d.ts +46 -0
- package/lib/typescript/module/rail/Rail.d.ts.map +1 -0
- package/lib/typescript/module/rail/index.d.ts +3 -0
- package/lib/typescript/module/rail/index.d.ts.map +1 -0
- package/lib/typescript/module/rail/types.d.ts +46 -0
- package/lib/typescript/module/rail/types.d.ts.map +1 -0
- package/lib/typescript/module/styles/web-view-style.d.ts +9 -0
- package/lib/typescript/module/styles/web-view-style.d.ts.map +1 -1
- package/lib/typescript/module/theme/adaptive-colors.d.ts +9 -7
- package/lib/typescript/module/theme/adaptive-colors.d.ts.map +1 -1
- package/lib/typescript/module/theme/build-theme-from-seed.d.ts.map +1 -1
- package/lib/typescript/module/theme/build-theme.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-policy.d.ts.map +1 -1
- package/lib/typescript/module/theme/types.d.ts +4 -0
- package/lib/typescript/module/theme/types.d.ts.map +1 -1
- package/package.json +15 -1
- package/src/design-tokens/tokens.json +47 -47
- package/src/index.ts +2 -0
- package/src/index.web.ts +2 -0
- package/src/rail/Rail.tsx +126 -0
- package/src/rail/index.ts +2 -0
- package/src/rail/types.ts +47 -0
- package/src/styles/web-view-style.ts +10 -0
- package/src/theme/adaptive-colors.ts +12 -6
- package/src/theme/build-theme-from-seed.ts +4 -0
- package/src/theme/build-theme.ts +4 -0
- package/src/theme/color-policy.ts +36 -5
- 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
|
|
554
|
-
// turning signal yellow into ochre or lime into olive on a light page.
|
|
555
|
-
//
|
|
556
|
-
//
|
|
557
|
-
|
|
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;
|
package/src/theme/types.ts
CHANGED
|
@@ -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.
|