@oxyhq/bloom 0.73.0 → 0.74.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/lib/commonjs/button/Button.js +104 -42
- package/lib/commonjs/button/Button.js.map +1 -1
- package/lib/commonjs/button/Button.web.js +11 -3
- package/lib/commonjs/button/Button.web.js.map +1 -1
- package/lib/commonjs/design-tokens/theme.css +22 -0
- package/lib/commonjs/fab/Fab.js +9 -0
- package/lib/commonjs/fab/Fab.js.map +1 -1
- package/lib/commonjs/fab/Fab.web.js +11 -0
- package/lib/commonjs/fab/Fab.web.js.map +1 -1
- package/lib/commonjs/theme/BloomThemeProvider.js.map +1 -1
- package/lib/commonjs/theme/build-theme-from-seed.js +7 -5
- package/lib/commonjs/theme/build-theme-from-seed.js.map +1 -1
- package/lib/commonjs/theme/build-theme.js +9 -4
- package/lib/commonjs/theme/build-theme.js.map +1 -1
- package/lib/commonjs/theme/color-policy.js +315 -0
- package/lib/commonjs/theme/color-policy.js.map +1 -0
- package/lib/commonjs/theme/color-scope/seed-scope.js +13 -1
- package/lib/commonjs/theme/color-scope/seed-scope.js.map +1 -1
- package/lib/commonjs/theme/color-scope/style-builder.js +6 -0
- package/lib/commonjs/theme/color-scope/style-builder.js.map +1 -1
- package/lib/commonjs/theme/preset-vars.js +9 -1
- package/lib/commonjs/theme/preset-vars.js.map +1 -1
- package/lib/commonjs/theme/token-registry.js +11 -1
- package/lib/commonjs/theme/token-registry.js.map +1 -1
- package/lib/module/button/Button.js +104 -42
- package/lib/module/button/Button.js.map +1 -1
- package/lib/module/button/Button.web.js +11 -3
- package/lib/module/button/Button.web.js.map +1 -1
- package/lib/module/design-tokens/theme.css +22 -0
- package/lib/module/fab/Fab.js +9 -0
- package/lib/module/fab/Fab.js.map +1 -1
- package/lib/module/fab/Fab.web.js +11 -0
- package/lib/module/fab/Fab.web.js.map +1 -1
- package/lib/module/theme/BloomThemeProvider.js.map +1 -1
- package/lib/module/theme/build-theme-from-seed.js +7 -5
- package/lib/module/theme/build-theme-from-seed.js.map +1 -1
- package/lib/module/theme/build-theme.js +9 -4
- package/lib/module/theme/build-theme.js.map +1 -1
- package/lib/module/theme/color-policy.js +310 -0
- package/lib/module/theme/color-policy.js.map +1 -0
- package/lib/module/theme/color-scope/seed-scope.js +13 -1
- package/lib/module/theme/color-scope/seed-scope.js.map +1 -1
- package/lib/module/theme/color-scope/style-builder.js +6 -0
- package/lib/module/theme/color-scope/style-builder.js.map +1 -1
- package/lib/module/theme/preset-vars.js +9 -1
- package/lib/module/theme/preset-vars.js.map +1 -1
- package/lib/module/theme/token-registry.js +11 -1
- package/lib/module/theme/token-registry.js.map +1 -1
- package/lib/typescript/commonjs/button/Button.d.ts.map +1 -1
- package/lib/typescript/commonjs/button/Button.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/button/types.d.ts +8 -0
- package/lib/typescript/commonjs/button/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/fab/Fab.d.ts.map +1 -1
- package/lib/typescript/commonjs/fab/Fab.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/fab/types.d.ts +6 -1
- package/lib/typescript/commonjs/fab/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/common.d.ts +1 -1
- package/lib/typescript/commonjs/theme/BloomThemeProvider.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 +48 -0
- package/lib/typescript/commonjs/theme/color-policy.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-scope/seed-scope.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-scope/style-builder.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/preset-vars.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/token-registry.d.ts +1 -1
- package/lib/typescript/commonjs/theme/token-registry.d.ts.map +1 -1
- package/lib/typescript/module/button/Button.d.ts.map +1 -1
- package/lib/typescript/module/button/Button.web.d.ts.map +1 -1
- package/lib/typescript/module/button/types.d.ts +8 -0
- package/lib/typescript/module/button/types.d.ts.map +1 -1
- package/lib/typescript/module/fab/Fab.d.ts.map +1 -1
- package/lib/typescript/module/fab/Fab.web.d.ts.map +1 -1
- package/lib/typescript/module/fab/types.d.ts +6 -1
- package/lib/typescript/module/fab/types.d.ts.map +1 -1
- package/lib/typescript/module/icons/common.d.ts +1 -1
- package/lib/typescript/module/theme/BloomThemeProvider.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 +48 -0
- package/lib/typescript/module/theme/color-policy.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-scope/seed-scope.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-scope/style-builder.d.ts.map +1 -1
- package/lib/typescript/module/theme/preset-vars.d.ts.map +1 -1
- package/lib/typescript/module/theme/token-registry.d.ts +1 -1
- package/lib/typescript/module/theme/token-registry.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/Button.test.tsx +166 -1
- package/src/__tests__/Button.web.test.tsx +16 -0
- package/src/__tests__/preset-vars.test.ts +27 -15
- package/src/button/Button.tsx +123 -40
- package/src/button/Button.web.tsx +11 -3
- package/src/button/types.ts +8 -0
- package/src/design-tokens/theme.css +22 -0
- package/src/fab/Fab.tsx +3 -0
- package/src/fab/Fab.web.tsx +3 -0
- package/src/fab/types.ts +6 -1
- package/src/theme/BloomThemeProvider.tsx +7 -4
- package/src/theme/__tests__/__fixtures__/golden-resolved-tokens.json +1300 -312
- package/src/theme/__tests__/__snapshots__/visual-gallery.test.tsx.snap +442 -442
- package/src/theme/__tests__/policy-legibility.test.ts +118 -0
- package/src/theme/__tests__/theme-colors-parity.test.ts +11 -6
- package/src/theme/build-theme-from-seed.ts +7 -4
- package/src/theme/build-theme.ts +9 -4
- package/src/theme/color-policy.ts +342 -0
- package/src/theme/color-scope/seed-scope.ts +13 -1
- package/src/theme/color-scope/style-builder.ts +6 -0
- package/src/theme/preset-vars.ts +10 -1
- package/src/theme/token-registry.ts +32 -0
- package/lib/commonjs/fonts/font-data.web.js +0 -22
- package/lib/commonjs/fonts/font-data.web.js.map +0 -1
- package/lib/module/fonts/font-data.web.js +0 -18
- package/lib/module/fonts/font-data.web.js.map +0 -1
- package/lib/typescript/commonjs/fonts/font-data.web.d.ts +0 -5
- package/lib/typescript/commonjs/fonts/font-data.web.d.ts.map +0 -1
- package/lib/typescript/module/fonts/font-data.web.d.ts +0 -5
- package/lib/typescript/module/fonts/font-data.web.d.ts.map +0 -1
- package/src/fonts/font-data.web.ts +0 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/fab/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/fab/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE;;;;;;;;GAQG;AACH;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC;AAE1E;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,YAAY,GACpB,cAAc,GACd,aAAa,GACb,WAAW,GACX,UAAU,GACV,QAAQ,CAAC;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7 @@ export declare function useCommonSVGProps(props: Props): {
|
|
|
36
36
|
style: false | "" | IconStyle | import("react-native").RecursiveArray<import("react-native").Falsy | IconStyle> | null;
|
|
37
37
|
title?: string | undefined;
|
|
38
38
|
children?: React.ReactNode;
|
|
39
|
+
role?: import("react-native").Role | undefined;
|
|
39
40
|
filter?: string | undefined;
|
|
40
41
|
hitSlop?: number | import("react-native").Insets | undefined;
|
|
41
42
|
id?: string | undefined;
|
|
@@ -113,7 +114,6 @@ export declare function useCommonSVGProps(props: Props): {
|
|
|
113
114
|
importantForAccessibility?: ("auto" | "yes" | "no" | "no-hide-descendants") | undefined | undefined;
|
|
114
115
|
'aria-hidden'?: boolean | undefined | undefined;
|
|
115
116
|
'aria-modal'?: boolean | undefined | undefined;
|
|
116
|
-
role?: import("react-native").Role | undefined;
|
|
117
117
|
accessibilityLabelledBy?: string | string[] | undefined | undefined;
|
|
118
118
|
'aria-labelledby'?: string | undefined | undefined;
|
|
119
119
|
accessibilityLiveRegion?: "none" | "polite" | "assertive" | undefined | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BloomThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/theme/BloomThemeProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,oBAAoB,CAAC;AAE5B,OAAO,KAQN,MAAM,OAAO,CAAC;AACf,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAWtB,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGpD,OAAO,EAKL,KAAK,iBAAiB,EAEvB,MAAM,eAAe,CAAC;AAIvB,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAKhD,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,YAAY,CAAC;IAC1B,OAAO,EAAE,CAAC,IAAI,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gBAAgB,EAC7B,WAA0B,EAC1B,kBAAmC,EACnC,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,OAAO,EACP,cAAc,EACd,WAAW,EACX,KAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,IAAI,EACJ,QAAQ,GACT,EAAE,uBAAuB,2CAkKzB"}
|
|
@@ -1 +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;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,OAAO,GAAG,MAAM,EAC1B,OAAO,CAAC,EAAE,aAAa,EACvB,aAAa,CAAC,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,WAAW,GACpB,WAAW,
|
|
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;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,OAAO,GAAG,MAAM,EAC1B,OAAO,CAAC,EAAE,aAAa,EACvB,aAAa,CAAC,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,WAAW,GACpB,WAAW,CAkEb;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,EACtB,OAAO,CAAC,EAAE,WAAW,GACpB,KAAK,CAQP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-theme.d.ts","sourceRoot":"","sources":["../../../../src/theme/build-theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIrD,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,SAAS,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC;
|
|
1
|
+
{"version":3,"file":"build-theme.d.ts","sourceRoot":"","sources":["../../../../src/theme/build-theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIrD,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,SAAS,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC;AAyFX;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,OAAO,GAAG,MAAM,EAC1B,UAAU,GAAE,OAAe,EAC3B,OAAO,CAAC,EAAE,eAAe,GACxB,KAAK,CAWP"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bloom colour policy — how a seed becomes the visible token set.
|
|
3
|
+
*
|
|
4
|
+
* The engine (`color-engine/`) answers "what colours exist around this seed".
|
|
5
|
+
* This module answers the separate question of how deep, how loud and how far
|
|
6
|
+
* apart they should be, which canonical Material 3 answers differently than
|
|
7
|
+
* Bloom needs:
|
|
8
|
+
*
|
|
9
|
+
* - M3 puts `primary` at tone 80 in dark so it can be used as TEXT. Bloom uses
|
|
10
|
+
* `--primary` as a FILL (buttons, FABs, the user's own chat bubble), and tone
|
|
11
|
+
* 80 collapses chroma — the reason the whole palette read pastel. The two jobs
|
|
12
|
+
* are split here: `--primary` is the fill, `--primary-text` is the accent
|
|
13
|
+
* legible as text on the page.
|
|
14
|
+
* - M3's supporting accents rotate 18–35 degrees off the seed, so the
|
|
15
|
+
* primary/secondary/tertiary trio lands in one hue family and cannot encode
|
|
16
|
+
* anything. A real split-complementary rotation fixes that.
|
|
17
|
+
* - Chroma has to scale inversely with the area a colour paints: a chip's
|
|
18
|
+
* background covers far more pixels than its label.
|
|
19
|
+
*
|
|
20
|
+
* The single rule underneath every decision here is that **light and dark want
|
|
21
|
+
* opposite things**. On a near-white page a fill must go deep to read calm; on a
|
|
22
|
+
* near-black one it must stay bright or it turns to mud. Every asymmetry below
|
|
23
|
+
* is that rule applied to one more role.
|
|
24
|
+
*/
|
|
25
|
+
import { type RoleColors } from './color-engine';
|
|
26
|
+
/** Semantic status seeds. Only hue and chroma survive; tones come from the policy. */
|
|
27
|
+
export declare const STATUS_SEEDS: {
|
|
28
|
+
readonly success: "#10B981";
|
|
29
|
+
readonly error: "#EF4444";
|
|
30
|
+
readonly warning: "#F59E0B";
|
|
31
|
+
readonly info: "#3B82F6";
|
|
32
|
+
};
|
|
33
|
+
/** Optional real accent colours — e.g. the 2nd and 3rd seeds extracted from artwork. */
|
|
34
|
+
export interface PinnedAccents {
|
|
35
|
+
secondary?: string;
|
|
36
|
+
tertiary?: string;
|
|
37
|
+
}
|
|
38
|
+
/** The tokens the policy owns. Everything else keeps coming from the M3 roles. */
|
|
39
|
+
export type PolicyTokens = Record<string, string>;
|
|
40
|
+
/**
|
|
41
|
+
* Build the policy-owned tokens for a seed and mode.
|
|
42
|
+
*
|
|
43
|
+
* `roles` is the engine's `vivid` role set for the same seed and mode, passed in
|
|
44
|
+
* so the caller does not generate it twice — the surface scale and
|
|
45
|
+
* `--primary-text` come straight from it.
|
|
46
|
+
*/
|
|
47
|
+
export declare function buildPolicyTokens(seedHex: string, isDark: boolean, roles: RoleColors, pinned?: PinnedAccents): PolicyTokens;
|
|
48
|
+
//# sourceMappingURL=color-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-policy.d.ts","sourceRoot":"","sources":["../../../../src/theme/color-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAM9D,sFAAsF;AACtF,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AAEX,wFAAwF;AACxF,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,kFAAkF;AAClF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAkLlD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,UAAU,EACjB,MAAM,GAAE,aAAkB,GACzB,YAAY,CA0Gd"}
|
|
@@ -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;
|
|
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;AAI1F;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA4C9E;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;IACvB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA+BpF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-builder.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/style-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAY,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AA6CtD;;;;;GAKG;AACH,MAAM,MAAM,gCAAgC,GAAG,KAAK,CAAC,aAAa,CAAC;IACjE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC,CAAC;AAkEH;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,YAAY,EACzB,IAAI,EAAE,OAAO,GAAG,MAAM,EACtB,OAAO,CAAC,EAAE,eAAe,GACxB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"style-builder.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/style-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAY,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AA6CtD;;;;;GAKG;AACH,MAAM,MAAM,gCAAgC,GAAG,KAAK,CAAC,aAAa,CAAC;IACjE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC,CAAC;AAkEH;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,YAAY,EACzB,IAAI,EAAE,OAAO,GAAG,MAAM,EACtB,OAAO,CAAC,EAAE,eAAe,GACxB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkBxB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,IAAI,gCAAgC,GAAG,IAAI,CAepF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,YAAY,EACzB,IAAI,EAAE,OAAO,GAAG,MAAM,GACrB,SAAS,CAAC,SAAS,CAAC,CAQtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset-vars.d.ts","sourceRoot":"","sources":["../../../../src/theme/preset-vars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"preset-vars.d.ts","sourceRoot":"","sources":["../../../../src/theme/preset-vars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI1F;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAOD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,YAAY,EACvB,IAAI,EAAE,OAAO,GAAG,MAAM,EACtB,OAAO,CAAC,EAAE,eAAe,GACxB,YAAY,CAyEd;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,YAAY,EACvB,IAAI,EAAE,OAAO,GAAG,MAAM,GACrB,IAAI,CAYN"}
|
|
@@ -13,7 +13,7 @@ import { type ExplicitAccents } from './preset-vars';
|
|
|
13
13
|
* Order mirrors `getPresetVars`'s insertion order: base tokens first (in the
|
|
14
14
|
* order they appear in the preset data), then the synthesized extended tokens.
|
|
15
15
|
*/
|
|
16
|
-
export declare const CANONICAL_TOKENS: readonly ["background", "foreground", "surface", "surface-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "tertiary", "tertiary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "border", "input", "ring", "sidebar", "card", "card-foreground", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "content-area", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring"];
|
|
16
|
+
export declare const CANONICAL_TOKENS: readonly ["background", "foreground", "surface", "surface-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "tertiary", "tertiary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "border", "input", "ring", "sidebar", "card", "card-foreground", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "content-area", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring", "primary-text", "primary-subtle", "secondary-text", "secondary-subtle", "tertiary-text", "tertiary-subtle", "success", "success-foreground", "success-text", "success-subtle", "error", "error-foreground", "error-text", "error-subtle", "warning", "warning-foreground", "warning-text", "warning-subtle", "info", "info-foreground", "info-text", "info-subtle"];
|
|
17
17
|
/** A canonical token name (no leading `--`). */
|
|
18
18
|
export type CanonicalToken = (typeof CANONICAL_TOKENS)[number];
|
|
19
19
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-registry.d.ts","sourceRoot":"","sources":["../../../../src/theme/token-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAiB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"token-registry.d.ts","sourceRoot":"","sources":["../../../../src/theme/token-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAiB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,i6BAqEnB,CAAC;AAEX,gDAAgD;AAChD,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAW/D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CA+ChD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,OAAO,GAAG,MAAM,EACtB,OAAO,CAAC,EAAE,eAAe,GACxB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOxB;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAmBjE,OAAO,KAAK,EAAE,WAAW,EAA6B,MAAM,SAAS,CAAC;AAEtE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAkWtE,eAAO,MAAM,MAAM,yCAAwB,CAAC;AAG5C,eAAO,MAAM,aAAa,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEpE,CAAC;AAGH,eAAO,MAAM,eAAe,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEtE,CAAC;AAGH,eAAO,MAAM,UAAU,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEjE,CAAC;AAGH,eAAO,MAAM,WAAW,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAElE,CAAC;AAGH,eAAO,MAAM,aAAa,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEpE,CAAC;AAGH,eAAO,MAAM,UAAU,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEjE,CAAC;AAMH,eAAO,MAAM,aAAa,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEpE,CAAC;AAGH,eAAO,MAAM,UAAU,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEjE,CAAC;AAGH,eAAO,MAAM,iBAAiB,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAExE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.web.d.ts","sourceRoot":"","sources":["../../../../src/button/Button.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KASN,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,WAAW,EAA6B,MAAM,SAAS,CAAC;AAEtE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.web.d.ts","sourceRoot":"","sources":["../../../../src/button/Button.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KASN,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAE,WAAW,EAA6B,MAAM,SAAS,CAAC;AAEtE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAuatE,eAAO,MAAM,MAAM,yCAA2B,CAAC;AAG/C,eAAO,MAAM,aAAa,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEpE,CAAC;AAGH,eAAO,MAAM,eAAe,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEtE,CAAC;AAGH,eAAO,MAAM,UAAU,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEjE,CAAC;AAGH,eAAO,MAAM,WAAW,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAElE,CAAC;AAGH,eAAO,MAAM,aAAa,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEpE,CAAC;AAGH,eAAO,MAAM,UAAU,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEjE,CAAC;AAGH,eAAO,MAAM,aAAa,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEpE,CAAC;AAGH,eAAO,MAAM,UAAU,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAEjE,CAAC;AAGH,eAAO,MAAM,iBAAiB,oCAAgB,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,6CAExE,CAAC"}
|
|
@@ -10,6 +10,14 @@ import type { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
|
10
10
|
* the set. On native they fall back to a sensible equivalent
|
|
11
11
|
* (`outline → secondary`, `link → text`, `destructive → primary` tinted with
|
|
12
12
|
* the negative token) so passing them never crashes a native consumer.
|
|
13
|
+
*
|
|
14
|
+
* `text` (and its web alias `link`) is DELIBERATELY not a transparent `ghost`:
|
|
15
|
+
* it is the compact inline affordance, so it overrides the size config's padding
|
|
16
|
+
* down to 4/8 on BOTH platforms. `ghost` keeps the full padding — it is a
|
|
17
|
+
* regular button that happens to have no background. The one geometry that does
|
|
18
|
+
* differ by platform is `minHeight`: web clears it for `text`/`link` so the
|
|
19
|
+
* control hugs its label and sits inline, native keeps the size config's value
|
|
20
|
+
* because a finger needs the target and a cursor does not.
|
|
13
21
|
*/
|
|
14
22
|
export type ButtonVariant = 'primary' | 'secondary' | 'inverse' | 'icon' | 'ghost' | 'text' | 'outline' | 'link' | 'destructive';
|
|
15
23
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE;;;;;;;;;;;;;;;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;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC/D;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fab.d.ts","sourceRoot":"","sources":["../../../../src/fab/Fab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAa7C,OAAO,KAAK,EAAgB,QAAQ,EAAuB,MAAM,SAAS,CAAC;AAE3E,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Fab.d.ts","sourceRoot":"","sources":["../../../../src/fab/Fab.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAa7C,OAAO,KAAK,EAAgB,QAAQ,EAAuB,MAAM,SAAS,CAAC;AAE3E,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AA4M3E,eAAO,MAAM,GAAG,sCAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fab.web.d.ts","sourceRoot":"","sources":["../../../../src/fab/Fab.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAgB,QAAQ,EAAuB,MAAM,SAAS,CAAC;AAE3E,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Fab.web.d.ts","sourceRoot":"","sources":["../../../../src/fab/Fab.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAgB,QAAQ,EAAuB,MAAM,SAAS,CAAC;AAE3E,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAoS3E,eAAO,MAAM,GAAG,sCAAwB,CAAC"}
|
|
@@ -8,7 +8,12 @@ import type { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
|
8
8
|
* A lower-emphasis FAB that still reads as elevated.
|
|
9
9
|
* - `surface` — alias of `secondary`, named for Material-style "surface" FABs.
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* M3 defines four FAB colour variants. Bloom previously mapped `secondary` onto
|
|
13
|
+
* the neutral card surface, so a "secondary FAB" was a grey circle and the
|
|
14
|
+
* accent trio had no home in the component that most wants one.
|
|
15
|
+
*/
|
|
16
|
+
export type FabVariant = 'primary' | 'secondary' | 'tertiary' | 'surface';
|
|
12
17
|
/**
|
|
13
18
|
* FAB size presets, matching Material-ish conventions but in Bloom's scale:
|
|
14
19
|
* - `small` — 40px (compact / dense layouts)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/fab/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE;;;;;;;;GAQG;AACH,MA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C,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAUhB,wDAAwD;IACxD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC/D,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6DAA6D;IAC7D,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;CACtC"}
|
|
@@ -36,6 +36,7 @@ export declare function useCommonSVGProps(props: Props): {
|
|
|
36
36
|
style: false | "" | IconStyle | import("react-native").RecursiveArray<import("react-native").Falsy | IconStyle> | null;
|
|
37
37
|
title?: string | undefined;
|
|
38
38
|
children?: React.ReactNode;
|
|
39
|
+
role?: import("react-native").Role | undefined;
|
|
39
40
|
filter?: string | undefined;
|
|
40
41
|
hitSlop?: number | import("react-native").Insets | undefined;
|
|
41
42
|
id?: string | undefined;
|
|
@@ -113,7 +114,6 @@ export declare function useCommonSVGProps(props: Props): {
|
|
|
113
114
|
importantForAccessibility?: ("auto" | "yes" | "no" | "no-hide-descendants") | undefined | undefined;
|
|
114
115
|
'aria-hidden'?: boolean | undefined | undefined;
|
|
115
116
|
'aria-modal'?: boolean | undefined | undefined;
|
|
116
|
-
role?: import("react-native").Role | undefined;
|
|
117
117
|
accessibilityLabelledBy?: string | string[] | undefined | undefined;
|
|
118
118
|
'aria-labelledby'?: string | undefined | undefined;
|
|
119
119
|
accessibilityLiveRegion?: "none" | "polite" | "assertive" | undefined | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version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E,OAAO,CAAC;IACzB,iDAAiD;IACjD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE9B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wDAAwD;IACxD,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEjC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE1C;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAkJD,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EAAE,cAAc,EACpB,WAAW,EAAE,gBAAgB,EAC7B,WAA0B,EAC1B,kBAAmC,EACnC,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,OAAO,EACP,cAAc,EACd,WAAW,EACX,KAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,IAAI,EACJ,QAAQ,GACT,EAAE,uBAAuB,2CAkKzB"}
|
|
@@ -1 +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;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,OAAO,GAAG,MAAM,EAC1B,OAAO,CAAC,EAAE,aAAa,EACvB,aAAa,CAAC,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,WAAW,GACpB,WAAW,
|
|
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;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,OAAO,GAAG,MAAM,EAC1B,OAAO,CAAC,EAAE,aAAa,EACvB,aAAa,CAAC,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,WAAW,GACpB,WAAW,CAkEb;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,EACtB,OAAO,CAAC,EAAE,WAAW,GACpB,KAAK,CAQP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-theme.d.ts","sourceRoot":"","sources":["../../../../src/theme/build-theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIrD,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,SAAS,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC;
|
|
1
|
+
{"version":3,"file":"build-theme.d.ts","sourceRoot":"","sources":["../../../../src/theme/build-theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIrD,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,SAAS,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC;AAyFX;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,OAAO,GAAG,MAAM,EAC1B,UAAU,GAAE,OAAe,EAC3B,OAAO,CAAC,EAAE,eAAe,GACxB,KAAK,CAWP"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bloom colour policy — how a seed becomes the visible token set.
|
|
3
|
+
*
|
|
4
|
+
* The engine (`color-engine/`) answers "what colours exist around this seed".
|
|
5
|
+
* This module answers the separate question of how deep, how loud and how far
|
|
6
|
+
* apart they should be, which canonical Material 3 answers differently than
|
|
7
|
+
* Bloom needs:
|
|
8
|
+
*
|
|
9
|
+
* - M3 puts `primary` at tone 80 in dark so it can be used as TEXT. Bloom uses
|
|
10
|
+
* `--primary` as a FILL (buttons, FABs, the user's own chat bubble), and tone
|
|
11
|
+
* 80 collapses chroma — the reason the whole palette read pastel. The two jobs
|
|
12
|
+
* are split here: `--primary` is the fill, `--primary-text` is the accent
|
|
13
|
+
* legible as text on the page.
|
|
14
|
+
* - M3's supporting accents rotate 18–35 degrees off the seed, so the
|
|
15
|
+
* primary/secondary/tertiary trio lands in one hue family and cannot encode
|
|
16
|
+
* anything. A real split-complementary rotation fixes that.
|
|
17
|
+
* - Chroma has to scale inversely with the area a colour paints: a chip's
|
|
18
|
+
* background covers far more pixels than its label.
|
|
19
|
+
*
|
|
20
|
+
* The single rule underneath every decision here is that **light and dark want
|
|
21
|
+
* opposite things**. On a near-white page a fill must go deep to read calm; on a
|
|
22
|
+
* near-black one it must stay bright or it turns to mud. Every asymmetry below
|
|
23
|
+
* is that rule applied to one more role.
|
|
24
|
+
*/
|
|
25
|
+
import { type RoleColors } from './color-engine';
|
|
26
|
+
/** Semantic status seeds. Only hue and chroma survive; tones come from the policy. */
|
|
27
|
+
export declare const STATUS_SEEDS: {
|
|
28
|
+
readonly success: "#10B981";
|
|
29
|
+
readonly error: "#EF4444";
|
|
30
|
+
readonly warning: "#F59E0B";
|
|
31
|
+
readonly info: "#3B82F6";
|
|
32
|
+
};
|
|
33
|
+
/** Optional real accent colours — e.g. the 2nd and 3rd seeds extracted from artwork. */
|
|
34
|
+
export interface PinnedAccents {
|
|
35
|
+
secondary?: string;
|
|
36
|
+
tertiary?: string;
|
|
37
|
+
}
|
|
38
|
+
/** The tokens the policy owns. Everything else keeps coming from the M3 roles. */
|
|
39
|
+
export type PolicyTokens = Record<string, string>;
|
|
40
|
+
/**
|
|
41
|
+
* Build the policy-owned tokens for a seed and mode.
|
|
42
|
+
*
|
|
43
|
+
* `roles` is the engine's `vivid` role set for the same seed and mode, passed in
|
|
44
|
+
* so the caller does not generate it twice — the surface scale and
|
|
45
|
+
* `--primary-text` come straight from it.
|
|
46
|
+
*/
|
|
47
|
+
export declare function buildPolicyTokens(seedHex: string, isDark: boolean, roles: RoleColors, pinned?: PinnedAccents): PolicyTokens;
|
|
48
|
+
//# sourceMappingURL=color-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-policy.d.ts","sourceRoot":"","sources":["../../../../src/theme/color-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAM9D,sFAAsF;AACtF,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AAEX,wFAAwF;AACxF,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,kFAAkF;AAClF,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAkLlD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,UAAU,EACjB,MAAM,GAAE,aAAkB,GACzB,YAAY,CA0Gd"}
|
|
@@ -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;
|
|
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;AAI1F;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA4C9E;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;IACvB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA+BpF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-builder.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/style-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAY,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AA6CtD;;;;;GAKG;AACH,MAAM,MAAM,gCAAgC,GAAG,KAAK,CAAC,aAAa,CAAC;IACjE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC,CAAC;AAkEH;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,YAAY,EACzB,IAAI,EAAE,OAAO,GAAG,MAAM,EACtB,OAAO,CAAC,EAAE,eAAe,GACxB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"style-builder.d.ts","sourceRoot":"","sources":["../../../../../src/theme/color-scope/style-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAY,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AA6CtD;;;;;GAKG;AACH,MAAM,MAAM,gCAAgC,GAAG,KAAK,CAAC,aAAa,CAAC;IACjE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC,CAAC;AAkEH;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,YAAY,EACzB,IAAI,EAAE,OAAO,GAAG,MAAM,EACtB,OAAO,CAAC,EAAE,eAAe,GACxB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkBxB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,IAAI,gCAAgC,GAAG,IAAI,CAepF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,YAAY,EACzB,IAAI,EAAE,OAAO,GAAG,MAAM,GACrB,SAAS,CAAC,SAAS,CAAC,CAQtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset-vars.d.ts","sourceRoot":"","sources":["../../../../src/theme/preset-vars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"preset-vars.d.ts","sourceRoot":"","sources":["../../../../src/theme/preset-vars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI1F;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAOD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,YAAY,EACvB,IAAI,EAAE,OAAO,GAAG,MAAM,EACtB,OAAO,CAAC,EAAE,eAAe,GACxB,YAAY,CAyEd;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,YAAY,EACvB,IAAI,EAAE,OAAO,GAAG,MAAM,GACrB,IAAI,CAYN"}
|
|
@@ -13,7 +13,7 @@ import { type ExplicitAccents } from './preset-vars';
|
|
|
13
13
|
* Order mirrors `getPresetVars`'s insertion order: base tokens first (in the
|
|
14
14
|
* order they appear in the preset data), then the synthesized extended tokens.
|
|
15
15
|
*/
|
|
16
|
-
export declare const CANONICAL_TOKENS: readonly ["background", "foreground", "surface", "surface-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "tertiary", "tertiary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "border", "input", "ring", "sidebar", "card", "card-foreground", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "content-area", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring"];
|
|
16
|
+
export declare const CANONICAL_TOKENS: readonly ["background", "foreground", "surface", "surface-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "tertiary", "tertiary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "border", "input", "ring", "sidebar", "card", "card-foreground", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "content-area", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring", "primary-text", "primary-subtle", "secondary-text", "secondary-subtle", "tertiary-text", "tertiary-subtle", "success", "success-foreground", "success-text", "success-subtle", "error", "error-foreground", "error-text", "error-subtle", "warning", "warning-foreground", "warning-text", "warning-subtle", "info", "info-foreground", "info-text", "info-subtle"];
|
|
17
17
|
/** A canonical token name (no leading `--`). */
|
|
18
18
|
export type CanonicalToken = (typeof CANONICAL_TOKENS)[number];
|
|
19
19
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-registry.d.ts","sourceRoot":"","sources":["../../../../src/theme/token-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAiB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"token-registry.d.ts","sourceRoot":"","sources":["../../../../src/theme/token-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAiB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAEpE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,i6BAqEnB,CAAC;AAEX,gDAAgD;AAChD,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAW/D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CA+ChD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,OAAO,GAAG,MAAM,EACtB,OAAO,CAAC,EAAE,eAAe,GACxB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOxB;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Text } from 'react-native';
|
|
2
|
+
import { Text, View } from 'react-native';
|
|
3
3
|
import { render, fireEvent } from '@testing-library/react-native';
|
|
4
4
|
|
|
5
5
|
import { BloomThemeProvider } from '../theme/BloomThemeProvider';
|
|
6
|
+
import { useTheme } from '../theme/use-theme';
|
|
7
|
+
import type { ThemeColors } from '../theme/types';
|
|
6
8
|
import { Button, PrimaryButton, SecondaryButton, IconButton, GhostButton, TextButton } from '../button';
|
|
7
9
|
|
|
8
10
|
function renderWithTheme(ui: React.ReactElement) {
|
|
@@ -13,6 +15,71 @@ function renderWithTheme(ui: React.ReactElement) {
|
|
|
13
15
|
);
|
|
14
16
|
}
|
|
15
17
|
|
|
18
|
+
type StyleEntry = Record<string, unknown>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Deep-flatten an RN `style` prop (nested arrays, `false`/`null` holes) into the
|
|
22
|
+
* list of style objects that actually reached the node — including the
|
|
23
|
+
* `{ $$css: true, className }` descriptor react-native-css merges in.
|
|
24
|
+
*/
|
|
25
|
+
function styleEntries(style: unknown, out: StyleEntry[] = []): StyleEntry[] {
|
|
26
|
+
if (!style || typeof style !== 'object') return out;
|
|
27
|
+
if (Array.isArray(style)) {
|
|
28
|
+
for (const entry of style) styleEntries(entry, out);
|
|
29
|
+
return out;
|
|
30
|
+
}
|
|
31
|
+
out.push(style as StyleEntry);
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Every style key/value that landed on a node, later entries winning. */
|
|
36
|
+
function resolvedStyle(style: unknown): StyleEntry {
|
|
37
|
+
return Object.assign({}, ...styleEntries(style)) as StyleEntry;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** The class tokens react-native-css accepted for a node, in arrival order. */
|
|
41
|
+
function classNamesOn(style: unknown): string[] {
|
|
42
|
+
return styleEntries(style)
|
|
43
|
+
.filter((entry) => entry.$$css === true && typeof entry.className === 'string')
|
|
44
|
+
.map((entry) => String(entry.className));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface HostNode {
|
|
48
|
+
type: string;
|
|
49
|
+
props: Record<string, unknown>;
|
|
50
|
+
children: Array<HostNode | string> | null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function isHostNode(value: unknown): value is HostNode {
|
|
54
|
+
return typeof value === 'object' && value !== null && typeof (value as HostNode).type === 'string';
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Walk the HOST tree (composites are absent from `toJSON()`) for a testID. */
|
|
58
|
+
function findHost(node: unknown, testID: string): HostNode | null {
|
|
59
|
+
if (Array.isArray(node)) {
|
|
60
|
+
for (const child of node) {
|
|
61
|
+
const hit = findHost(child, testID);
|
|
62
|
+
if (hit) return hit;
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
if (!isHostNode(node)) return null;
|
|
67
|
+
if (node.props.testID === testID) return node;
|
|
68
|
+
return findHost(node.children, testID);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Read the live resolved theme colors the same way `Button` does. */
|
|
72
|
+
function captureThemeColors(): ThemeColors {
|
|
73
|
+
let captured: ThemeColors | undefined;
|
|
74
|
+
function Probe() {
|
|
75
|
+
captured = useTheme().colors;
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
renderWithTheme(<Probe />);
|
|
79
|
+
if (!captured) throw new Error('theme probe never rendered');
|
|
80
|
+
return captured;
|
|
81
|
+
}
|
|
82
|
+
|
|
16
83
|
describe('Button', () => {
|
|
17
84
|
it('renders children as text', () => {
|
|
18
85
|
const { getByText } = renderWithTheme(<Button>Click me</Button>);
|
|
@@ -95,6 +162,104 @@ describe('Button', () => {
|
|
|
95
162
|
});
|
|
96
163
|
});
|
|
97
164
|
|
|
165
|
+
// Regression: the native button used to render its `Pressable` inside an
|
|
166
|
+
// unstyled `Animated.View` that existed only to hold the press-scale transform.
|
|
167
|
+
// That wrapper — not the pressable — was the flex child of whatever laid the
|
|
168
|
+
// button out, and it hugged its content, so `className="flex-1"` (and every
|
|
169
|
+
// other layout the caller expressed) applied inside a box that never grew. The
|
|
170
|
+
// web fork renders one real `<button>` and has always behaved. Nothing errored;
|
|
171
|
+
// consumers wrapped each Bloom `Button` in their own `<View>` to compensate.
|
|
172
|
+
describe('layout: the button IS the node its parent lays out', () => {
|
|
173
|
+
it('renders the pressable as its outermost node — no wrapper in between', () => {
|
|
174
|
+
const { toJSON } = renderWithTheme(
|
|
175
|
+
<View testID="host">
|
|
176
|
+
<Button testID="btn" className="flex-1">
|
|
177
|
+
Wide
|
|
178
|
+
</Button>
|
|
179
|
+
</View>,
|
|
180
|
+
);
|
|
181
|
+
const host = findHost(toJSON(), 'host');
|
|
182
|
+
expect(host).not.toBeNull();
|
|
183
|
+
const rendered = (host?.children ?? []).filter(isHostNode);
|
|
184
|
+
expect(rendered).toHaveLength(1);
|
|
185
|
+
// The single node the parent lays out is the pressable itself — the one
|
|
186
|
+
// carrying the a11y role, the handlers and the button's own box.
|
|
187
|
+
expect(rendered[0]?.props.testID).toBe('btn');
|
|
188
|
+
expect(rendered[0]?.props.accessibilityRole).toBe('button');
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
it('lands the caller className on that same node, beside the button box', () => {
|
|
192
|
+
const { getByTestId } = renderWithTheme(
|
|
193
|
+
<Button testID="btn" className="flex-1">
|
|
194
|
+
Wide
|
|
195
|
+
</Button>,
|
|
196
|
+
);
|
|
197
|
+
const style = getByTestId('btn').props.style;
|
|
198
|
+
expect(classNamesOn(style)).toContain('flex-1');
|
|
199
|
+
// Same node, so a layout class and the button's visuals cannot diverge.
|
|
200
|
+
expect(resolvedStyle(style).borderRadius).toBe(999);
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
it('applies the press-scale transform to that node too, not to a wrapper', () => {
|
|
204
|
+
const { getByTestId } = renderWithTheme(<Button testID="btn">Press</Button>);
|
|
205
|
+
expect(resolvedStyle(getByTestId('btn').props.style).transform).toBeDefined();
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
it('keeps the caller style winning over the button box', () => {
|
|
209
|
+
const { getByTestId } = renderWithTheme(
|
|
210
|
+
<Button testID="btn" style={{ minHeight: 0, paddingHorizontal: 2 }}>
|
|
211
|
+
Tight
|
|
212
|
+
</Button>,
|
|
213
|
+
);
|
|
214
|
+
const style = resolvedStyle(getByTestId('btn').props.style);
|
|
215
|
+
expect(style.minHeight).toBe(0);
|
|
216
|
+
expect(style.paddingHorizontal).toBe(2);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
// Regression: the icon variant used to get its chrome from a DEFAULT
|
|
220
|
+
// `className` that the caller's own `className` replaced outright, so
|
|
221
|
+
// `<IconButton className="flex-1" />` shipped transparent and borderless. It
|
|
222
|
+
// now comes from the same resolved tokens `Button.web.tsx` already used.
|
|
223
|
+
it('keeps the icon variant chrome when the caller passes a className', () => {
|
|
224
|
+
const colors = captureThemeColors();
|
|
225
|
+
const { getByTestId } = renderWithTheme(<IconButton testID="icon" className="flex-1" />);
|
|
226
|
+
const style = resolvedStyle(getByTestId('icon').props.style);
|
|
227
|
+
expect(style.backgroundColor).toBe(colors.background);
|
|
228
|
+
expect(style.borderColor).toBe(colors.border);
|
|
229
|
+
expect(style.borderWidth).toBe(1);
|
|
230
|
+
expect(classNamesOn(getByTestId('icon').props.style)).toContain('flex-1');
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
// `variant="text"` was reported as "shrinks horizontal padding on native but is
|
|
235
|
+
// byte-identical to ghost on web". The padding is real and DELIBERATE — `text`
|
|
236
|
+
// (and its web alias `link`) is a compact inline affordance, `ghost` is a
|
|
237
|
+
// full-size button without a background — and web applies exactly the same 4/8
|
|
238
|
+
// override in `Button.web.tsx`'s `containerStyle`; only the variant COLOR table
|
|
239
|
+
// entry is shared with ghost there. The one genuine divergence left is
|
|
240
|
+
// `minHeight`, which web clears for text/link and native deliberately keeps: a
|
|
241
|
+
// finger needs the target, a cursor does not.
|
|
242
|
+
describe('variant="text" geometry', () => {
|
|
243
|
+
it('is a compact affordance, not a ghost button', () => {
|
|
244
|
+
const { getByTestId } = renderWithTheme(<TextButton testID="txt">Text</TextButton>);
|
|
245
|
+
const style = resolvedStyle(getByTestId('txt').props.style);
|
|
246
|
+
expect(style.paddingVertical).toBe(4);
|
|
247
|
+
expect(style.paddingHorizontal).toBe(8);
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
it('ghost keeps the full size-config padding', () => {
|
|
251
|
+
const { getByTestId } = renderWithTheme(<GhostButton testID="ghost">Ghost</GhostButton>);
|
|
252
|
+
const style = resolvedStyle(getByTestId('ghost').props.style);
|
|
253
|
+
expect(style.paddingVertical).toBe(8);
|
|
254
|
+
expect(style.paddingHorizontal).toBe(16);
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it('keeps the size-config minHeight so the touch target survives', () => {
|
|
258
|
+
const { getByTestId } = renderWithTheme(<TextButton testID="txt">Text</TextButton>);
|
|
259
|
+
expect(resolvedStyle(getByTestId('txt').props.style).minHeight).toBe(40);
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
|
|
98
263
|
describe('Button variants', () => {
|
|
99
264
|
it('PrimaryButton renders without crashing', () => {
|
|
100
265
|
const { getByText } = renderWithTheme(
|
|
@@ -129,6 +129,22 @@ describe('Button.web', () => {
|
|
|
129
129
|
expect(btn).toHaveClass('custom');
|
|
130
130
|
});
|
|
131
131
|
|
|
132
|
+
// Parity with the native fork's "the button IS the node its parent lays out"
|
|
133
|
+
// suite in `Button.test.tsx`. Both platforms render ONE node, so a caller's
|
|
134
|
+
// layout class reaches the box the parent actually lays out; a wrapper element
|
|
135
|
+
// added here would scope it away exactly the way native's `Animated.View` did.
|
|
136
|
+
it('renders the classed button as the outermost node — no wrapper element', () => {
|
|
137
|
+
const c = mount(
|
|
138
|
+
<div data-testid="host">
|
|
139
|
+
<Button className="flex-1">Wide</Button>
|
|
140
|
+
</div>,
|
|
141
|
+
);
|
|
142
|
+
const host = c.querySelector('[data-testid="host"]');
|
|
143
|
+
expect(host?.children).toHaveLength(1);
|
|
144
|
+
expect(host?.firstElementChild?.tagName).toBe('BUTTON');
|
|
145
|
+
expect(host?.firstElementChild).toHaveClass('flex-1');
|
|
146
|
+
});
|
|
147
|
+
|
|
132
148
|
it('applies aria-label from accessibilityLabel', () => {
|
|
133
149
|
const c = mount(<Button accessibilityLabel="Save changes">Save</Button>);
|
|
134
150
|
expect(getByLabelText(c, 'Save changes')).toBeTruthy();
|