@oxyhq/bloom 1.0.1 → 1.0.3
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/button.mdx +19 -17
- package/docs/design-tokens.mdx +12 -10
- package/lib/commonjs/design-tokens/color-roles.js +21 -1
- package/lib/commonjs/design-tokens/color-roles.js.map +1 -1
- package/lib/commonjs/design-tokens/index.js +6 -0
- package/lib/commonjs/design-tokens/index.js.map +1 -1
- package/lib/commonjs/design-tokens/tailwind-preset.js +3 -1
- package/lib/commonjs/design-tokens/tailwind-preset.js.map +1 -1
- package/lib/commonjs/design-tokens/theme-css.js +1 -0
- package/lib/commonjs/design-tokens/theme-css.js.map +1 -1
- package/lib/commonjs/design-tokens/theme.css +3 -0
- package/lib/commonjs/design-tokens/tokens.json +11040 -0
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +7 -0
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/theme/color-policy.js +1 -1
- package/lib/commonjs/theme/color-presets.js +331 -1
- package/lib/commonjs/theme/color-presets.js.map +1 -1
- package/lib/commonjs/theme/color-scope/seed-scope.js +1 -0
- package/lib/commonjs/theme/color-scope/seed-scope.js.map +1 -1
- package/lib/commonjs/theme/glass-colors.js +22 -19
- package/lib/commonjs/theme/glass-colors.js.map +1 -1
- package/lib/module/design-tokens/color-roles.js +20 -0
- package/lib/module/design-tokens/color-roles.js.map +1 -1
- package/lib/module/design-tokens/index.js +2 -2
- package/lib/module/design-tokens/index.js.map +1 -1
- package/lib/module/design-tokens/tailwind-preset.js +4 -2
- package/lib/module/design-tokens/tailwind-preset.js.map +1 -1
- package/lib/module/design-tokens/theme-css.js +2 -1
- package/lib/module/design-tokens/theme-css.js.map +1 -1
- package/lib/module/design-tokens/theme.css +3 -0
- package/lib/module/design-tokens/tokens.json +11040 -0
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +1 -1
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/theme/color-policy.js +1 -1
- package/lib/module/theme/color-presets.js +331 -1
- package/lib/module/theme/color-presets.js.map +1 -1
- package/lib/module/theme/color-scope/seed-scope.js +2 -1
- package/lib/module/theme/color-scope/seed-scope.js.map +1 -1
- package/lib/module/theme/glass-colors.js +22 -19
- package/lib/module/theme/glass-colors.js.map +1 -1
- package/lib/typescript/commonjs/design-tokens/color-roles.d.ts +20 -0
- package/lib/typescript/commonjs/design-tokens/color-roles.d.ts.map +1 -1
- package/lib/typescript/commonjs/design-tokens/index.d.ts +3 -3
- package/lib/typescript/commonjs/design-tokens/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/design-tokens/tailwind-preset.d.ts.map +1 -1
- package/lib/typescript/commonjs/design-tokens/theme-css.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -2
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +2 -2
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-presets.d.ts +331 -1
- package/lib/typescript/commonjs/theme/color-presets.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-scope/seed-scope.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/glass-colors.d.ts +22 -19
- package/lib/typescript/commonjs/theme/glass-colors.d.ts.map +1 -1
- package/lib/typescript/module/design-tokens/color-roles.d.ts +20 -0
- package/lib/typescript/module/design-tokens/color-roles.d.ts.map +1 -1
- package/lib/typescript/module/design-tokens/index.d.ts +3 -3
- package/lib/typescript/module/design-tokens/index.d.ts.map +1 -1
- package/lib/typescript/module/design-tokens/tailwind-preset.d.ts.map +1 -1
- package/lib/typescript/module/design-tokens/theme-css.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +2 -2
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +2 -2
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-presets.d.ts +331 -1
- package/lib/typescript/module/theme/color-presets.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-scope/seed-scope.d.ts.map +1 -1
- package/lib/typescript/module/theme/glass-colors.d.ts +22 -19
- package/lib/typescript/module/theme/glass-colors.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/design-tokens/color-roles.ts +21 -0
- package/src/design-tokens/index.ts +3 -2
- package/src/design-tokens/tailwind-preset.ts +3 -2
- package/src/design-tokens/theme-css.ts +2 -1
- package/src/design-tokens/theme.css +3 -0
- package/src/design-tokens/tokens.json +11040 -0
- package/src/index.ts +2 -0
- package/src/index.web.ts +2 -0
- package/src/theme/__tests__/__fixtures__/golden-resolved-tokens.json +3600 -0
- package/src/theme/color-policy.ts +1 -1
- package/src/theme/color-presets.ts +361 -1
- package/src/theme/color-scope/seed-scope.ts +2 -1
- package/src/theme/glass-colors.ts +22 -19
|
@@ -81,6 +81,26 @@ export const TEXT_ROLES = {
|
|
|
81
81
|
'text-placeholder': ref('muted-foreground'),
|
|
82
82
|
} as const;
|
|
83
83
|
|
|
84
|
+
/**
|
|
85
|
+
* Decorative brand-accent text roles → text-color utilities.
|
|
86
|
+
*
|
|
87
|
+
* These are deliberately separate from the semantic status roles
|
|
88
|
+
* (`success-text`, `warning-text`, `info-text`, and `error-text`). Product
|
|
89
|
+
* copy, labels, and artwork captions can use the active palette's accent
|
|
90
|
+
* families without pretending that the text communicates a system state.
|
|
91
|
+
*
|
|
92
|
+
* | utility | canonical token |
|
|
93
|
+
* | --------------------- | ------------------ |
|
|
94
|
+
* | text-accent-primary | --primary-text |
|
|
95
|
+
* | text-accent-secondary | --secondary-text |
|
|
96
|
+
* | text-accent-tertiary | --tertiary-text |
|
|
97
|
+
*/
|
|
98
|
+
export const ACCENT_TEXT_ROLES = {
|
|
99
|
+
'accent-primary': ref('primary-text'),
|
|
100
|
+
'accent-secondary': ref('secondary-text'),
|
|
101
|
+
'accent-tertiary': ref('tertiary-text'),
|
|
102
|
+
} as const;
|
|
103
|
+
|
|
84
104
|
/**
|
|
85
105
|
* Border roles → border-color utilities (`border-<role>`).
|
|
86
106
|
*
|
|
@@ -107,4 +127,5 @@ export const BORDER_ROLES = {
|
|
|
107
127
|
|
|
108
128
|
export type FillRole = keyof typeof FILL_ROLES;
|
|
109
129
|
export type TextRole = keyof typeof TEXT_ROLES;
|
|
130
|
+
export type AccentTextRole = keyof typeof ACCENT_TEXT_ROLES;
|
|
110
131
|
export type BorderRole = keyof typeof BORDER_ROLES;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* for CSS-configured web apps.
|
|
11
11
|
* - `getPresetVars` / `buildSeedScopeVars` — the resolved token VALUES behind
|
|
12
12
|
* that alias layer, for a named preset or an arbitrary brand seed.
|
|
13
|
-
* - The raw token maps (`FILL_ROLES`, `TEXT_ROLES`, `BORDER_ROLES`, `SPACING`,
|
|
13
|
+
* - The raw token maps (`FILL_ROLES`, `TEXT_ROLES`, `ACCENT_TEXT_ROLES`, `BORDER_ROLES`, `SPACING`,
|
|
14
14
|
* `RADIUS`, `TYPOGRAPHY`, `SHADOW_BOX`) for direct programmatic use.
|
|
15
15
|
* - `bloomShadowStyle` — platform-correct shadow style object (web box-shadow /
|
|
16
16
|
* native elevation) so a consumer writes one call for both platforms.
|
|
@@ -65,9 +65,10 @@ export type { SeedScopeOptions } from '../theme/color-scope/seed-scope';
|
|
|
65
65
|
export {
|
|
66
66
|
FILL_ROLES,
|
|
67
67
|
TEXT_ROLES,
|
|
68
|
+
ACCENT_TEXT_ROLES,
|
|
68
69
|
BORDER_ROLES,
|
|
69
70
|
} from './color-roles';
|
|
70
|
-
export type { FillRole, TextRole, BorderRole } from './color-roles';
|
|
71
|
+
export type { FillRole, TextRole, AccentTextRole, BorderRole } from './color-roles';
|
|
71
72
|
|
|
72
73
|
export {
|
|
73
74
|
SPACING,
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* `Config`) so Bloom does not need to depend on `tailwindcss` types.
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
|
-
import { BORDER_ROLES, FILL_ROLES, TEXT_ROLES } from './color-roles';
|
|
29
|
+
import { ACCENT_TEXT_ROLES, BORDER_ROLES, FILL_ROLES, TEXT_ROLES } from './color-roles';
|
|
30
30
|
import {
|
|
31
31
|
BORDER_WIDTH,
|
|
32
32
|
FONT_FAMILY_VARS,
|
|
@@ -109,6 +109,7 @@ const BORDER_WIDTH_PX = toPxMap(BORDER_WIDTH);
|
|
|
109
109
|
const COLOR_ROLES: Record<string, string> = {
|
|
110
110
|
...FILL_ROLES,
|
|
111
111
|
...TEXT_ROLES,
|
|
112
|
+
...ACCENT_TEXT_ROLES,
|
|
112
113
|
...BORDER_ROLES,
|
|
113
114
|
};
|
|
114
115
|
|
|
@@ -123,7 +124,7 @@ export const bloomTailwindPreset: TailwindPreset = Object.freeze({
|
|
|
123
124
|
colors: { ...COLOR_ROLES },
|
|
124
125
|
// Targeted buckets so the namespaced roles resolve on the right utility.
|
|
125
126
|
backgroundColor: { ...FILL_ROLES },
|
|
126
|
-
textColor: { ...TEXT_ROLES },
|
|
127
|
+
textColor: { ...TEXT_ROLES, ...ACCENT_TEXT_ROLES },
|
|
127
128
|
borderColor: { ...BORDER_ROLES },
|
|
128
129
|
|
|
129
130
|
spacing: SPACING_PX,
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* `bloomThemeCss()` directly into their `@theme { … }` — the values are stable.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
import { BORDER_ROLES, FILL_ROLES, TEXT_ROLES } from './color-roles';
|
|
26
|
+
import { ACCENT_TEXT_ROLES, BORDER_ROLES, FILL_ROLES, TEXT_ROLES } from './color-roles';
|
|
27
27
|
import { CANONICAL_TOKENS } from '../theme/token-registry';
|
|
28
28
|
import {
|
|
29
29
|
BORDER_WIDTH,
|
|
@@ -53,6 +53,7 @@ export function bloomThemeCss(): string {
|
|
|
53
53
|
for (const [role, value] of Object.entries({
|
|
54
54
|
...FILL_ROLES,
|
|
55
55
|
...TEXT_ROLES,
|
|
56
|
+
...ACCENT_TEXT_ROLES,
|
|
56
57
|
...BORDER_ROLES,
|
|
57
58
|
})) {
|
|
58
59
|
lines.push(` --color-${role}: ${value};`);
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
--color-text-inverse: var(--primary-foreground);
|
|
22
22
|
--color-text-fixed-light: var(--primary-foreground);
|
|
23
23
|
--color-text-placeholder: var(--muted-foreground);
|
|
24
|
+
--color-accent-primary: var(--primary-text);
|
|
25
|
+
--color-accent-secondary: var(--secondary-text);
|
|
26
|
+
--color-accent-tertiary: var(--tertiary-text);
|
|
24
27
|
--color-border: var(--border);
|
|
25
28
|
--color-border-image: var(--border);
|
|
26
29
|
--color-border-secondary: var(--input);
|