@oxy.so/bloom 1.0.6 → 1.0.8
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/fab.mdx +6 -0
- package/docs/theme.mdx +19 -0
- package/docs/user-hover-card.mdx +59 -10
- package/lib/commonjs/avatar-group/AvatarGroup.web.js +4 -1
- package/lib/commonjs/avatar-group/AvatarGroup.web.js.map +1 -1
- package/lib/commonjs/fab/Fab.web.js +21 -10
- package/lib/commonjs/fab/Fab.web.js.map +1 -1
- package/lib/commonjs/theme/BloomThemeProvider.js +2 -0
- package/lib/commonjs/theme/BloomThemeProvider.js.map +1 -1
- package/lib/commonjs/theme/apply-dark-class.js +37 -0
- package/lib/commonjs/theme/apply-dark-class.js.map +1 -1
- package/lib/commonjs/user-hover-card/UserHoverCard.js +33 -12
- package/lib/commonjs/user-hover-card/UserHoverCard.js.map +1 -1
- package/lib/commonjs/user-hover-card/constants.js +45 -0
- package/lib/commonjs/user-hover-card/constants.js.map +1 -0
- package/lib/commonjs/user-hover-card/index.js +19 -0
- package/lib/commonjs/user-hover-card/index.js.map +1 -1
- package/lib/module/avatar-group/AvatarGroup.web.js +5 -2
- package/lib/module/avatar-group/AvatarGroup.web.js.map +1 -1
- package/lib/module/fab/Fab.web.js +21 -10
- package/lib/module/fab/Fab.web.js.map +1 -1
- package/lib/module/fab/index.web.js +2 -2
- package/lib/module/theme/BloomThemeProvider.js +3 -1
- package/lib/module/theme/BloomThemeProvider.js.map +1 -1
- package/lib/module/theme/apply-dark-class.js +36 -0
- package/lib/module/theme/apply-dark-class.js.map +1 -1
- package/lib/module/user-hover-card/UserHoverCard.js +33 -12
- package/lib/module/user-hover-card/UserHoverCard.js.map +1 -1
- package/lib/module/user-hover-card/constants.js +42 -0
- package/lib/module/user-hover-card/constants.js.map +1 -0
- package/lib/module/user-hover-card/index.js +1 -0
- package/lib/module/user-hover-card/index.js.map +1 -1
- package/lib/typescript/commonjs/avatar-group/AvatarGroup.web.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 +7 -5
- package/lib/typescript/commonjs/fab/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/shared.d.ts +4 -4
- package/lib/typescript/commonjs/theme/BloomThemeProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/apply-dark-class.d.ts +8 -0
- package/lib/typescript/commonjs/theme/apply-dark-class.d.ts.map +1 -1
- package/lib/typescript/commonjs/user-hover-card/UserHoverCard.d.ts.map +1 -1
- package/lib/typescript/commonjs/user-hover-card/constants.d.ts +35 -0
- package/lib/typescript/commonjs/user-hover-card/constants.d.ts.map +1 -0
- package/lib/typescript/commonjs/user-hover-card/index.d.ts +1 -0
- package/lib/typescript/commonjs/user-hover-card/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/user-hover-card/types.d.ts +35 -6
- package/lib/typescript/commonjs/user-hover-card/types.d.ts.map +1 -1
- package/lib/typescript/module/avatar-group/AvatarGroup.web.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 +7 -5
- package/lib/typescript/module/fab/types.d.ts.map +1 -1
- package/lib/typescript/module/icons/shared.d.ts +4 -4
- package/lib/typescript/module/theme/BloomThemeProvider.d.ts.map +1 -1
- package/lib/typescript/module/theme/apply-dark-class.d.ts +8 -0
- package/lib/typescript/module/theme/apply-dark-class.d.ts.map +1 -1
- package/lib/typescript/module/user-hover-card/UserHoverCard.d.ts.map +1 -1
- package/lib/typescript/module/user-hover-card/constants.d.ts +35 -0
- package/lib/typescript/module/user-hover-card/constants.d.ts.map +1 -0
- package/lib/typescript/module/user-hover-card/index.d.ts +1 -0
- package/lib/typescript/module/user-hover-card/index.d.ts.map +1 -1
- package/lib/typescript/module/user-hover-card/types.d.ts +35 -6
- package/lib/typescript/module/user-hover-card/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/avatar-group/AvatarGroup.web.tsx +5 -2
- package/src/fab/Fab.web.tsx +20 -9
- package/src/fab/index.web.ts +2 -2
- package/src/fab/types.ts +7 -5
- package/src/theme/BloomThemeProvider.tsx +3 -1
- package/src/theme/apply-dark-class.ts +38 -0
- package/src/user-hover-card/UserHoverCard.tsx +40 -16
- package/src/user-hover-card/constants.ts +40 -0
- package/src/user-hover-card/index.ts +5 -0
- package/src/user-hover-card/types.ts +35 -6
|
@@ -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,EAAE,SAAS,KAAK,IAAI,CAAC;IACnC,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IAC/C;;;;OAIG;IACH,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,8BAA8B,EAC9B,KAAK,CAAC,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,GAC5C,SAAS,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,OAAO,CAAC,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IAC3E,kBAAkB,CAAC,EAAE,YAAY,CAAC;IAElC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;IACzC,mBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IAErD;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;;;OAKG;IACH,cAAc,CAAC,EAAE,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,2CAoKzB"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { type AppColorName } from './color-presets';
|
|
2
2
|
import type { ExplicitAccents } from './preset-vars';
|
|
3
3
|
export declare function applyDarkClass(resolved: 'light' | 'dark'): void;
|
|
4
|
+
/**
|
|
5
|
+
* Theme the browser's document canvas as well as the app's React surfaces.
|
|
6
|
+
* The root background covers exposed viewport/overscroll areas; color-scheme
|
|
7
|
+
* lets browser-owned controls follow the resolved mode. theme-color is a hint
|
|
8
|
+
* for mobile browser chrome, whose final appearance remains browser-controlled.
|
|
9
|
+
* Called only by the app-wide provider, never by color/seed scopes.
|
|
10
|
+
*/
|
|
11
|
+
export declare function applyDocumentTheme(resolved: 'light' | 'dark', background: string): void;
|
|
4
12
|
/**
|
|
5
13
|
* Apply a color preset's CSS custom properties to the document root.
|
|
6
14
|
* No-op on native — only affects web (early-returns on `Platform.OS !== 'web'`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-dark-class.d.ts","sourceRoot":"","sources":["../../../../src/theme/apply-dark-class.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,QAIxD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAM/D;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,OAAO,GAAG,MAAM,EAC1B,OAAO,CAAC,EAAE,eAAe,QAI1B"}
|
|
1
|
+
{"version":3,"file":"apply-dark-class.d.ts","sourceRoot":"","sources":["../../../../src/theme/apply-dark-class.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,QAIxD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,EAAE,UAAU,EAAE,MAAM,QA6BhF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAM/D;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,OAAO,GAAG,MAAM,EAC1B,OAAO,CAAC,EAAE,eAAe,QAI1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserHoverCard.d.ts","sourceRoot":"","sources":["../../../../src/user-hover-card/UserHoverCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"UserHoverCard.d.ts","sourceRoot":"","sources":["../../../../src/user-hover-card/UserHoverCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AAepC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AA0NlD,eAAO,MAAM,aAAa,gDAA+B,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The card's geometry, in one place, because two of these numbers are now a
|
|
3
|
+
* CONTRACT rather than an implementation detail: the card has two consumer
|
|
4
|
+
* slots, and a consumer cannot size content for a width it has to discover by
|
|
5
|
+
* overflowing.
|
|
6
|
+
*
|
|
7
|
+
* The card does not clip (see `UserHoverCard`), so content wider than
|
|
8
|
+
* {@link USER_HOVER_CARD_CONTENT_WIDTH} paints OUTSIDE the card's border rather
|
|
9
|
+
* than being cut off — the louder failure of the two, and still a failure.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Usable inner width, and the number a consumer sizes slot content against.
|
|
13
|
+
*
|
|
14
|
+
* This is the DECIDED number; the card's width is derived from it. That is the
|
|
15
|
+
* inversion the slots forced: the family's width was an unexplained `280` from
|
|
16
|
+
* the day it shipped (0.9.0), and the inner width that fell out of it — 248 —
|
|
17
|
+
* missed the first real slot content by ONE pixel. A contribution graph of 18
|
|
18
|
+
* columns at `cellSize={11} gap={3}` is 249px, and 18 columns is what 119 days
|
|
19
|
+
* spans once the leading partial week is counted.
|
|
20
|
+
*
|
|
21
|
+
* 256 is a step up on the 8px grid the spacing scale follows, it is 16× the
|
|
22
|
+
* inset, and it clears that measured requirement with room rather than exactly
|
|
23
|
+
* — a number chosen to be sized against, not nudged to fit one consumer.
|
|
24
|
+
*/
|
|
25
|
+
export declare const USER_HOVER_CARD_CONTENT_WIDTH = 256;
|
|
26
|
+
/** Padding on all four sides. */
|
|
27
|
+
export declare const USER_HOVER_CARD_INSET: 16;
|
|
28
|
+
/**
|
|
29
|
+
* Total card width — derived, never the other way round. Anything positioning
|
|
30
|
+
* the card (see `AvatarGroup`'s web hover card) reads this rather than keeping
|
|
31
|
+
* its own copy: two spellings of one number centre the card off its anchor the
|
|
32
|
+
* first time either moves.
|
|
33
|
+
*/
|
|
34
|
+
export declare const USER_HOVER_CARD_WIDTH: number;
|
|
35
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/user-hover-card/constants.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD,iCAAiC;AACjC,eAAO,MAAM,qBAAqB,IAAW,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,QACyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/user-hover-card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/user-hover-card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -38,6 +38,34 @@ export interface UserHoverCardProps {
|
|
|
38
38
|
* Bloom does NOT implement follow logic; it only renders the card.
|
|
39
39
|
*/
|
|
40
40
|
action?: ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* Marker slot in the handle row, rendered after `@username` — an account-kind
|
|
43
|
+
* or federation marker, the kind of quiet glyph that says what this account
|
|
44
|
+
* IS. Renders even when `username` is absent, because it describes the
|
|
45
|
+
* account rather than the handle. A long handle truncates to make room; the
|
|
46
|
+
* marker never shrinks.
|
|
47
|
+
*
|
|
48
|
+
* UNLIKE {@link UserHoverCardProps.footer}, this slot is INSIDE the identity
|
|
49
|
+
* area, because that is where it has to be to sit beside the handle. What that
|
|
50
|
+
* costs, measured rather than assumed:
|
|
51
|
+
*
|
|
52
|
+
* - The card's accessible name is unaffected. The identity area carries an
|
|
53
|
+
* explicit `accessibilityLabel`, and an explicit label wins over contents in
|
|
54
|
+
* the ARIA name computation — read back from Chrome's own accessibility tree
|
|
55
|
+
* with a badge nested inside: the button's name was exactly its label.
|
|
56
|
+
* - The badge's press does NOT leak into `onPressProfile`, on either platform.
|
|
57
|
+
* react-native-web implements React Native's responder system, so a nested
|
|
58
|
+
* pressable wins there the same way it does natively. No `stopPropagation`
|
|
59
|
+
* is needed, and a doc that told you to add one would be describing a
|
|
60
|
+
* different ancestor: a RAW DOM handler (`onPointerUp` on a plain `View`)
|
|
61
|
+
* does receive the bubbled event.
|
|
62
|
+
* - **Prefer an INERT marker.** When `onPressProfile` is set the identity area
|
|
63
|
+
* is a real `<button>`, so a pressable badge nests a button inside a button
|
|
64
|
+
* — invalid HTML, which Chrome tolerates and other user agents need not. A
|
|
65
|
+
* marker is usually a statement rather than a control anyway; make it
|
|
66
|
+
* pressable only where the answer it opens is worth that.
|
|
67
|
+
*/
|
|
68
|
+
badge?: ReactNode;
|
|
41
69
|
/**
|
|
42
70
|
* Trailing content region, rendered after the stats row and spanning the full
|
|
43
71
|
* inner width — the slot for whatever this app knows about a person that Bloom
|
|
@@ -45,13 +73,14 @@ export interface UserHoverCardProps {
|
|
|
45
73
|
* line). Bloom adds the vertical rhythm and nothing else: no label, no divider,
|
|
46
74
|
* no clip.
|
|
47
75
|
*
|
|
48
|
-
* It is a SIBLING of the identity area, never a child,
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
76
|
+
* It is a SIBLING of the identity area, never a child. Nested, a press
|
|
77
|
+
* anywhere on it — on a chart, on a line of text, on anything that is not
|
|
78
|
+
* itself pressable — would open the profile through
|
|
79
|
+
* {@link UserHoverCardProps.onPressProfile}.
|
|
52
80
|
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
81
|
+
* Size content against {@link USER_HOVER_CARD_CONTENT_WIDTH}, which is
|
|
82
|
+
* exported for exactly that. The card does not clip, so anything wider paints
|
|
83
|
+
* outside it.
|
|
55
84
|
*/
|
|
56
85
|
footer?: ReactNode;
|
|
57
86
|
/** Container style override. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/user-hover-card/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,oFAAoF;AACpF,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,WAAW,EAAE,MAAM,CAAC;IACpB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kEAAkE;IAClE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/user-hover-card/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,oFAAoF;AACpF,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,WAAW,EAAE,MAAM,CAAC;IACpB,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kEAAkE;IAClE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,gCAAgC;IAChC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroup.web.d.ts","sourceRoot":"","sources":["../../../../src/avatar-group/AvatarGroup.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAkB5E,OAAO,KAAK,EAAmB,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"AvatarGroup.web.d.ts","sourceRoot":"","sources":["../../../../src/avatar-group/AvatarGroup.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAkB5E,OAAO,KAAK,EAAmB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AA0JjE,eAAO,MAAM,WAAW,8CAAgC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fab.web.d.ts","sourceRoot":"","sources":["../../../../src/fab/Fab.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAYf,OAAO,KAAK,EAAqC,QAAQ,EAAuB,MAAM,SAAS,CAAC;AAEhG,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Fab.web.d.ts","sourceRoot":"","sources":["../../../../src/fab/Fab.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAYf,OAAO,KAAK,EAAqC,QAAQ,EAAuB,MAAM,SAAS,CAAC;AAEhG,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AA+ThG,eAAO,MAAM,GAAG,sCAAwB,CAAC"}
|
|
@@ -42,9 +42,11 @@ export type FabMinimizeBehavior = 'none' | 'hide' | 'collapse';
|
|
|
42
42
|
* - `bottom-right` (default) / `bottom-left` / `top-right` / `top-left` —
|
|
43
43
|
* the FAB pins itself to that corner of its CONTAINING block, never the
|
|
44
44
|
* viewport. On native it uses `position: absolute` within the nearest
|
|
45
|
-
* positioned ancestor.
|
|
46
|
-
*
|
|
47
|
-
*
|
|
45
|
+
* positioned ancestor. On web a bottom placement combines
|
|
46
|
+
* `margin-top: auto` with `position: sticky; bottom`, so it reaches the
|
|
47
|
+
* bottom of short flex-column content and remains visible with document
|
|
48
|
+
* scroll. The web container must fill the available height, use flex-column
|
|
49
|
+
* layout, and render the FAB last.
|
|
48
50
|
* - `static` — no positioning at all. The FAB is laid out inline and the
|
|
49
51
|
* consumer is fully responsible for placement (e.g. wrapping it in their
|
|
50
52
|
* own absolutely/sticky-positioned container). Use this when you need
|
|
@@ -52,7 +54,7 @@ export type FabMinimizeBehavior = 'none' | 'hide' | 'collapse';
|
|
|
52
54
|
*
|
|
53
55
|
* CRITICAL: the positioned placements DO NOT use web `position: fixed` and are
|
|
54
56
|
* never anchored to the viewport. They stay inside the containing column so the
|
|
55
|
-
* FAB never escapes a constrained multi-column layout
|
|
57
|
+
* FAB never escapes a constrained multi-column layout.
|
|
56
58
|
*/
|
|
57
59
|
export type FabPlacement = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'static';
|
|
58
60
|
export interface FabProps {
|
|
@@ -90,7 +92,7 @@ export interface FabProps {
|
|
|
90
92
|
/**
|
|
91
93
|
* Corner of the containing block to anchor to. Defaults to `'bottom-right'`.
|
|
92
94
|
* See {@link FabPlacement}. The DEFAULT never escapes the containing column
|
|
93
|
-
* (
|
|
95
|
+
* (web uses `position: sticky`, native uses `position: absolute`).
|
|
94
96
|
*/
|
|
95
97
|
placement?: FabPlacement;
|
|
96
98
|
/**
|
|
@@ -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;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC;AAE1E;;;;GAIG;AAEH;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEnD,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;AAE/D
|
|
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;;;;GAIG;AAEH;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEnD,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;G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CAAkC;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6DAA6D;IAC7D,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;CACtC"}
|
|
@@ -38,6 +38,10 @@ export declare function useCommonSVGProps(props: Props): {
|
|
|
38
38
|
children?: React.ReactNode;
|
|
39
39
|
role?: import("react-native").Role | undefined;
|
|
40
40
|
filter?: string | undefined;
|
|
41
|
+
clipPath?: string | undefined;
|
|
42
|
+
marker?: string | undefined;
|
|
43
|
+
mask?: string | undefined;
|
|
44
|
+
font?: import("react-native-svg").FontObject | undefined;
|
|
41
45
|
hitSlop?: number | import("react-native").Insets | undefined;
|
|
42
46
|
id?: string | undefined;
|
|
43
47
|
needsOffscreenAlphaCompositing?: boolean | undefined | undefined;
|
|
@@ -157,7 +161,6 @@ export declare function useCommonSVGProps(props: Props): {
|
|
|
157
161
|
strokeMiterlimit?: import("react-native-svg").NumberProp | undefined;
|
|
158
162
|
vectorEffect?: import("react-native-svg").VectorEffect | undefined;
|
|
159
163
|
clipRule?: import("react-native-svg").FillRule | undefined;
|
|
160
|
-
clipPath?: string | undefined;
|
|
161
164
|
translate?: import("react-native-svg").NumberArray | undefined;
|
|
162
165
|
origin?: import("react-native-svg").NumberArray | undefined;
|
|
163
166
|
originX?: import("react-native-svg").NumberProp | undefined;
|
|
@@ -370,12 +373,9 @@ export declare function useCommonSVGProps(props: Props): {
|
|
|
370
373
|
delayPressIn?: number | undefined;
|
|
371
374
|
delayPressOut?: number | undefined;
|
|
372
375
|
delayLongPress?: number | undefined;
|
|
373
|
-
marker?: string | undefined;
|
|
374
376
|
markerStart?: string | undefined;
|
|
375
377
|
markerMid?: string | undefined;
|
|
376
378
|
markerEnd?: string | undefined;
|
|
377
|
-
mask?: string | undefined;
|
|
378
|
-
font?: import("react-native-svg").FontObject | undefined;
|
|
379
379
|
fontVariant?: import("react-native-svg").FontVariant | undefined;
|
|
380
380
|
fontStretch?: import("react-native-svg").FontStretch | undefined;
|
|
381
381
|
fontFamily?: string | 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,EAAE,SAAS,KAAK,IAAI,CAAC;IACnC,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IAC/C;;;;OAIG;IACH,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,8BAA8B,EAC9B,KAAK,CAAC,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,GAC5C,SAAS,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAEpB,CAAC;AAExD,MAAM,WAAW,uBAAuB;IACtC,uFAAuF;IACvF,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,mEAAmE;IACnE,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,mEAAmE;IACnE,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,2EAA2E;IAC3E,kBAAk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ACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;;;OAKG;IACH,cAAc,CAAC,EAAE,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,2CAoKzB"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { type AppColorName } from './color-presets';
|
|
2
2
|
import type { ExplicitAccents } from './preset-vars';
|
|
3
3
|
export declare function applyDarkClass(resolved: 'light' | 'dark'): void;
|
|
4
|
+
/**
|
|
5
|
+
* Theme the browser's document canvas as well as the app's React surfaces.
|
|
6
|
+
* The root background covers exposed viewport/overscroll areas; color-scheme
|
|
7
|
+
* lets browser-owned controls follow the resolved mode. theme-color is a hint
|
|
8
|
+
* for mobile browser chrome, whose final appearance remains browser-controlled.
|
|
9
|
+
* Called only by the app-wide provider, never by color/seed scopes.
|
|
10
|
+
*/
|
|
11
|
+
export declare function applyDocumentTheme(resolved: 'light' | 'dark', background: string): void;
|
|
4
12
|
/**
|
|
5
13
|
* Apply a color preset's CSS custom properties to the document root.
|
|
6
14
|
* No-op on native — only affects web (early-returns on `Platform.OS !== 'web'`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-dark-class.d.ts","sourceRoot":"","sources":["../../../../src/theme/apply-dark-class.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,QAIxD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAM/D;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,OAAO,GAAG,MAAM,EAC1B,OAAO,CAAC,EAAE,eAAe,QAI1B"}
|
|
1
|
+
{"version":3,"file":"apply-dark-class.d.ts","sourceRoot":"","sources":["../../../../src/theme/apply-dark-class.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,QAIxD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,EAAE,UAAU,EAAE,MAAM,QA6BhF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAM/D;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,OAAO,GAAG,MAAM,EAC1B,OAAO,CAAC,EAAE,eAAe,QAI1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserHoverCard.d.ts","sourceRoot":"","sources":["../../../../src/user-hover-card/UserHoverCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"UserHoverCard.d.ts","sourceRoot":"","sources":["../../../../src/user-hover-card/UserHoverCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AAepC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AA0NlD,eAAO,MAAM,aAAa,gDAA+B,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The card's geometry, in one place, because two of these numbers are now a
|
|
3
|
+
* CONTRACT rather than an implementation detail: the card has two consumer
|
|
4
|
+
* slots, and a consumer cannot size content for a width it has to discover by
|
|
5
|
+
* overflowing.
|
|
6
|
+
*
|
|
7
|
+
* The card does not clip (see `UserHoverCard`), so content wider than
|
|
8
|
+
* {@link USER_HOVER_CARD_CONTENT_WIDTH} paints OUTSIDE the card's border rather
|
|
9
|
+
* than being cut off — the louder failure of the two, and still a failure.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Usable inner width, and the number a consumer sizes slot content against.
|
|
13
|
+
*
|
|
14
|
+
* This is the DECIDED number; the card's width is derived from it. That is the
|
|
15
|
+
* inversion the slots forced: the family's width was an unexplained `280` from
|
|
16
|
+
* the day it shipped (0.9.0), and the inner width that fell out of it — 248 —
|
|
17
|
+
* missed the first real slot content by ONE pixel. A contribution graph of 18
|
|
18
|
+
* columns at `cellSize={11} gap={3}` is 249px, and 18 columns is what 119 days
|
|
19
|
+
* spans once the leading partial week is counted.
|
|
20
|
+
*
|
|
21
|
+
* 256 is a step up on the 8px grid the spacing scale follows, it is 16× the
|
|
22
|
+
* inset, and it clears that measured requirement with room rather than exactly
|
|
23
|
+
* — a number chosen to be sized against, not nudged to fit one consumer.
|
|
24
|
+
*/
|
|
25
|
+
export declare const USER_HOVER_CARD_CONTENT_WIDTH = 256;
|
|
26
|
+
/** Padding on all four sides. */
|
|
27
|
+
export declare const USER_HOVER_CARD_INSET: 16;
|
|
28
|
+
/**
|
|
29
|
+
* Total card width — derived, never the other way round. Anything positioning
|
|
30
|
+
* the card (see `AvatarGroup`'s web hover card) reads this rather than keeping
|
|
31
|
+
* its own copy: two spellings of one number centre the card off its anchor the
|
|
32
|
+
* first time either moves.
|
|
33
|
+
*/
|
|
34
|
+
export declare const USER_HOVER_CARD_WIDTH: number;
|
|
35
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/user-hover-card/constants.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD,iCAAiC;AACjC,eAAO,MAAM,qBAAqB,IAAW,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,QACyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/user-hover-card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/user-hover-card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -38,6 +38,34 @@ export interface UserHoverCardProps {
|
|
|
38
38
|
* Bloom does NOT implement follow logic; it only renders the card.
|
|
39
39
|
*/
|
|
40
40
|
action?: ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* Marker slot in the handle row, rendered after `@username` — an account-kind
|
|
43
|
+
* or federation marker, the kind of quiet glyph that says what this account
|
|
44
|
+
* IS. Renders even when `username` is absent, because it describes the
|
|
45
|
+
* account rather than the handle. A long handle truncates to make room; the
|
|
46
|
+
* marker never shrinks.
|
|
47
|
+
*
|
|
48
|
+
* UNLIKE {@link UserHoverCardProps.footer}, this slot is INSIDE the identity
|
|
49
|
+
* area, because that is where it has to be to sit beside the handle. What that
|
|
50
|
+
* costs, measured rather than assumed:
|
|
51
|
+
*
|
|
52
|
+
* - The card's accessible name is unaffected. The identity area carries an
|
|
53
|
+
* explicit `accessibilityLabel`, and an explicit label wins over contents in
|
|
54
|
+
* the ARIA name computation — read back from Chrome's own accessibility tree
|
|
55
|
+
* with a badge nested inside: the button's name was exactly its label.
|
|
56
|
+
* - The badge's press does NOT leak into `onPressProfile`, on either platform.
|
|
57
|
+
* react-native-web implements React Native's responder system, so a nested
|
|
58
|
+
* pressable wins there the same way it does natively. No `stopPropagation`
|
|
59
|
+
* is needed, and a doc that told you to add one would be describing a
|
|
60
|
+
* different ancestor: a RAW DOM handler (`onPointerUp` on a plain `View`)
|
|
61
|
+
* does receive the bubbled event.
|
|
62
|
+
* - **Prefer an INERT marker.** When `onPressProfile` is set the identity area
|
|
63
|
+
* is a real `<button>`, so a pressable badge nests a button inside a button
|
|
64
|
+
* — invalid HTML, which Chrome tolerates and other user agents need not. A
|
|
65
|
+
* marker is usually a statement rather than a control anyway; make it
|
|
66
|
+
* pressable only where the answer it opens is worth that.
|
|
67
|
+
*/
|
|
68
|
+
badge?: ReactNode;
|
|
41
69
|
/**
|
|
42
70
|
* Trailing content region, rendered after the stats row and spanning the full
|
|
43
71
|
* inner width — the slot for whatever this app knows about a person that Bloom
|
|
@@ -45,13 +73,14 @@ export interface UserHoverCardProps {
|
|
|
45
73
|
* line). Bloom adds the vertical rhythm and nothing else: no label, no divider,
|
|
46
74
|
* no clip.
|
|
47
75
|
*
|
|
48
|
-
* It is a SIBLING of the identity area, never a child,
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
76
|
+
* It is a SIBLING of the identity area, never a child. Nested, a press
|
|
77
|
+
* anywhere on it — on a chart, on a line of text, on anything that is not
|
|
78
|
+
* itself pressable — would open the profile through
|
|
79
|
+
* {@link UserHoverCardProps.onPressProfile}.
|
|
52
80
|
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
81
|
+
* Size content against {@link USER_HOVER_CARD_CONTENT_WIDTH}, which is
|
|
82
|
+
* exported for exactly that. The card does not clip, so anything wider paints
|
|
83
|
+
* outside it.
|
|
55
84
|
*/
|
|
56
85
|
footer?: ReactNode;
|
|
57
86
|
/** Container style override. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/user-hover-card/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,oFAAoF;AACpF,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,WAAW,EAAE,MAA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0BG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,gCAAgC;IAChC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@ import { OverlayRoot } from '../overlay';
|
|
|
10
10
|
// `Dialog.web.tsx` and `BottomSheet.web.tsx` already name it this way.
|
|
11
11
|
import { Portal } from '../portal/index.web';
|
|
12
12
|
import { WEB_POSITION_FIXED } from '../styles/web-view-style';
|
|
13
|
-
import { UserHoverCard } from '../user-hover-card';
|
|
13
|
+
import { USER_HOVER_CARD_WIDTH, UserHoverCard } from '../user-hover-card';
|
|
14
14
|
import {
|
|
15
15
|
AvatarGroupBase,
|
|
16
16
|
getItemName,
|
|
@@ -22,7 +22,10 @@ import type { AvatarGroupItem, AvatarGroupProps } from './types';
|
|
|
22
22
|
const CLOSE_DELAY_MS = 120;
|
|
23
23
|
/** Gap between the anchored avatar and the floating card. */
|
|
24
24
|
const CARD_GAP = 8;
|
|
25
|
-
|
|
25
|
+
// The card's own width, never a second copy of it: this file CENTRES the card
|
|
26
|
+
// on its anchor, so a private constant would mis-place it the first time
|
|
27
|
+
// either number moved, and nothing would error.
|
|
28
|
+
const CARD_WIDTH = USER_HOVER_CARD_WIDTH;
|
|
26
29
|
|
|
27
30
|
interface HoverState {
|
|
28
31
|
item: AvatarGroupItem;
|
package/src/fab/Fab.web.tsx
CHANGED
|
@@ -103,12 +103,12 @@ const BLOOM_FAB_CSS = interactiveWebCss({
|
|
|
103
103
|
/**
|
|
104
104
|
* Positioning for a placement on web.
|
|
105
105
|
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
106
|
+
* Bottom placements use `sticky`, never `fixed`, so the FAB follows the
|
|
107
|
+
* document scroll while remaining inside its content column. They combine
|
|
108
|
+
* `margin-top: auto` (short flex-column content) with `bottom` (long, scrolling
|
|
109
|
+
* content). The consumer column must fill the available height, use flex-column
|
|
110
|
+
* layout, and render the FAB last. Top placements remain absolute: a sticky
|
|
111
|
+
* element rendered last cannot be pulled upward to the top of its container.
|
|
112
112
|
*
|
|
113
113
|
* `bottomEdgeInset` applies to the BOTTOM axis only. It is not a gap preference
|
|
114
114
|
* — `offset` is that — but the height of whatever floating surface has already
|
|
@@ -123,17 +123,28 @@ function placementStyle(
|
|
|
123
123
|
bottomEdgeInset: number,
|
|
124
124
|
): CSSProperties {
|
|
125
125
|
if (placement === 'static') return {};
|
|
126
|
-
const style: CSSProperties = { position: 'absolute' };
|
|
127
126
|
const isBottom = placement === 'bottom-right' || placement === 'bottom-left';
|
|
127
|
+
const style: CSSProperties = { position: isBottom ? 'sticky' : 'absolute' };
|
|
128
128
|
if (isBottom) {
|
|
129
129
|
style.bottom = offset + bottomEdgeInset;
|
|
130
|
+
style.marginTop = 'auto';
|
|
130
131
|
} else {
|
|
131
132
|
style.top = offset;
|
|
132
133
|
}
|
|
133
134
|
if (placement === 'bottom-right' || placement === 'top-right') {
|
|
134
|
-
|
|
135
|
+
if (isBottom) {
|
|
136
|
+
style.alignSelf = 'flex-end';
|
|
137
|
+
style.marginRight = offset;
|
|
138
|
+
} else {
|
|
139
|
+
style.right = offset;
|
|
140
|
+
}
|
|
135
141
|
} else {
|
|
136
|
-
|
|
142
|
+
if (isBottom) {
|
|
143
|
+
style.alignSelf = 'flex-start';
|
|
144
|
+
style.marginLeft = offset;
|
|
145
|
+
} else {
|
|
146
|
+
style.left = offset;
|
|
147
|
+
}
|
|
137
148
|
}
|
|
138
149
|
return style;
|
|
139
150
|
}
|
package/src/fab/index.web.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// The default barrel (`./index.ts`) re-exports the React Native (`Pressable`)
|
|
4
4
|
// implementation, whose `placement` anchoring uses `position: absolute` within
|
|
5
5
|
// the nearest positioned ancestor. The web fork (`./Fab.web`) renders a real
|
|
6
|
-
// HTML `<button>` and uses `position: sticky` for its
|
|
7
|
-
//
|
|
6
|
+
// HTML `<button>` and uses `position: sticky` for its bottom placements so the
|
|
7
|
+
// FAB tracks the bottom-right of its CONTAINING content column while
|
|
8
8
|
// scrolling — never the viewport edge (the bug that motivated moving the FAB
|
|
9
9
|
// into Bloom). Web bundlers select this file via the `"browser"` export
|
|
10
10
|
// condition in `package.json`'s `exports['./fab']`.
|
package/src/fab/types.ts
CHANGED
|
@@ -47,9 +47,11 @@ export type FabMinimizeBehavior = 'none' | 'hide' | 'collapse';
|
|
|
47
47
|
* - `bottom-right` (default) / `bottom-left` / `top-right` / `top-left` —
|
|
48
48
|
* the FAB pins itself to that corner of its CONTAINING block, never the
|
|
49
49
|
* viewport. On native it uses `position: absolute` within the nearest
|
|
50
|
-
* positioned ancestor.
|
|
51
|
-
*
|
|
52
|
-
*
|
|
50
|
+
* positioned ancestor. On web a bottom placement combines
|
|
51
|
+
* `margin-top: auto` with `position: sticky; bottom`, so it reaches the
|
|
52
|
+
* bottom of short flex-column content and remains visible with document
|
|
53
|
+
* scroll. The web container must fill the available height, use flex-column
|
|
54
|
+
* layout, and render the FAB last.
|
|
53
55
|
* - `static` — no positioning at all. The FAB is laid out inline and the
|
|
54
56
|
* consumer is fully responsible for placement (e.g. wrapping it in their
|
|
55
57
|
* own absolutely/sticky-positioned container). Use this when you need
|
|
@@ -57,7 +59,7 @@ export type FabMinimizeBehavior = 'none' | 'hide' | 'collapse';
|
|
|
57
59
|
*
|
|
58
60
|
* CRITICAL: the positioned placements DO NOT use web `position: fixed` and are
|
|
59
61
|
* never anchored to the viewport. They stay inside the containing column so the
|
|
60
|
-
* FAB never escapes a constrained multi-column layout
|
|
62
|
+
* FAB never escapes a constrained multi-column layout.
|
|
61
63
|
*/
|
|
62
64
|
export type FabPlacement =
|
|
63
65
|
| 'bottom-right'
|
|
@@ -106,7 +108,7 @@ export interface FabProps {
|
|
|
106
108
|
/**
|
|
107
109
|
* Corner of the containing block to anchor to. Defaults to `'bottom-right'`.
|
|
108
110
|
* See {@link FabPlacement}. The DEFAULT never escapes the containing column
|
|
109
|
-
* (
|
|
111
|
+
* (web uses `position: sticky`, native uses `position: absolute`).
|
|
110
112
|
*/
|
|
111
113
|
placement?: FabPlacement;
|
|
112
114
|
|
|
@@ -26,7 +26,7 @@ import { FontLoader } from '../fonts/FontLoader';
|
|
|
26
26
|
|
|
27
27
|
import { useAmbientThemeState } from './ambient-store';
|
|
28
28
|
|
|
29
|
-
import { applyDarkClass, applyVarsToDocument } from './apply-dark-class';
|
|
29
|
+
import { applyDarkClass, applyDocumentTheme, applyVarsToDocument } from './apply-dark-class';
|
|
30
30
|
import { buildTheme } from './build-theme';
|
|
31
31
|
import { buildThemeFromSeed } from './build-theme-from-seed';
|
|
32
32
|
import { buildSeedScopeVars } from './color-scope/seed-scope';
|
|
@@ -433,6 +433,8 @@ export function BloomThemeProvider({
|
|
|
433
433
|
setColorSchemeSafe(effectiveMode);
|
|
434
434
|
applyDarkClass(resolved);
|
|
435
435
|
applyVarsToDocument(themeVars);
|
|
436
|
+
const background = themeVars['--background'];
|
|
437
|
+
if (background) applyDocumentTheme(resolved, background);
|
|
436
438
|
}, [effectiveMode, resolved, themeVars]);
|
|
437
439
|
|
|
438
440
|
// Native only: publish the same vars into react-native-css's GLOBAL root
|
|
@@ -9,6 +9,44 @@ export function applyDarkClass(resolved: 'light' | 'dark') {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Theme the browser's document canvas as well as the app's React surfaces.
|
|
14
|
+
* The root background covers exposed viewport/overscroll areas; color-scheme
|
|
15
|
+
* lets browser-owned controls follow the resolved mode. theme-color is a hint
|
|
16
|
+
* for mobile browser chrome, whose final appearance remains browser-controlled.
|
|
17
|
+
* Called only by the app-wide provider, never by color/seed scopes.
|
|
18
|
+
*/
|
|
19
|
+
export function applyDocumentTheme(resolved: 'light' | 'dark', background: string) {
|
|
20
|
+
if (Platform.OS !== 'web' || typeof document === 'undefined') return;
|
|
21
|
+
|
|
22
|
+
for (const element of [document.documentElement, document.body]) {
|
|
23
|
+
if (!element) continue;
|
|
24
|
+
// The canonical token is the document paint source. The concrete colour is
|
|
25
|
+
// still passed separately for metadata, which cannot consume CSS variables.
|
|
26
|
+
element.style.backgroundColor = 'var(--background)';
|
|
27
|
+
element.style.colorScheme = resolved;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Authored entries are useful before hydration, but become competing runtime
|
|
31
|
+
// owners afterwards. Adopt one entry and remove every fallback once Bloom's
|
|
32
|
+
// root provider has resolved the actual app preference.
|
|
33
|
+
const head = document.head;
|
|
34
|
+
if (!head) return;
|
|
35
|
+
let meta = head.querySelector<HTMLMetaElement>('meta[data-bloom-theme-color]');
|
|
36
|
+
if (!meta) {
|
|
37
|
+
meta = head.querySelector<HTMLMetaElement>('meta[name="theme-color"]') ??
|
|
38
|
+
document.createElement('meta');
|
|
39
|
+
meta.setAttribute('data-bloom-theme-color', '');
|
|
40
|
+
meta.name = 'theme-color';
|
|
41
|
+
}
|
|
42
|
+
meta.content = background;
|
|
43
|
+
meta.removeAttribute('media');
|
|
44
|
+
if (!meta.isConnected) head.append(meta);
|
|
45
|
+
for (const candidate of Array.from(head.querySelectorAll('meta[name="theme-color"]'))) {
|
|
46
|
+
if (candidate !== meta) candidate.remove();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
12
50
|
/**
|
|
13
51
|
* Apply a color preset's CSS custom properties to the document root.
|
|
14
52
|
* No-op on native — only affects web (early-returns on `Platform.OS !== 'web'`).
|