@oxy.so/bloom 1.0.7 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/content-panel.mdx +26 -0
- package/docs/fab.mdx +6 -0
- package/lib/commonjs/content-panel/ContentPanel.web.js +75 -5
- package/lib/commonjs/content-panel/ContentPanel.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/module/content-panel/ContentPanel.web.js +75 -5
- package/lib/module/content-panel/ContentPanel.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/typescript/commonjs/content-panel/ContentPanel.web.d.ts +31 -0
- package/lib/typescript/commonjs/content-panel/ContentPanel.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/content-panel/types.d.ts +36 -0
- package/lib/typescript/commonjs/content-panel/types.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/module/content-panel/ContentPanel.web.d.ts +31 -0
- package/lib/typescript/module/content-panel/ContentPanel.web.d.ts.map +1 -1
- package/lib/typescript/module/content-panel/types.d.ts +36 -0
- package/lib/typescript/module/content-panel/types.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/package.json +1 -1
- package/src/content-panel/ContentPanel.web.tsx +88 -11
- package/src/content-panel/types.ts +36 -0
- 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/__tests__/support/collision-fixture-barrel.ts +0 -20
- package/src/__tests__/support/constructed-style-sheets.ts +0 -68
- package/src/__tests__/support/press-host.ts +0 -30
- package/src/__tests__/support/rendered-style.ts +0 -99
- package/src/__tests__/support/unread-hook-fixture.ts +0 -33
- package/src/theme/__tests__/__fixtures__/golden-resolved-tokens.json +0 -7682
- package/src/theme/__tests__/fixtures/color-engine-golden.json +0 -1
|
@@ -23,6 +23,37 @@
|
|
|
23
23
|
* content rather than displacing it). They render BEFORE the content wrapper so
|
|
24
24
|
* z-index — not DOM order — decides layering.
|
|
25
25
|
*
|
|
26
|
+
* That sticky/`100dvh` sizing is itself a CHOICE, not the only mode — see
|
|
27
|
+
* `overlaySizing`. It is correct exactly when the panel's own DOM height can
|
|
28
|
+
* exceed one viewport in a document that actually scrolls (dvh gives the
|
|
29
|
+
* overlay a fixed, viewport-sized height that a percentage cannot: percentage
|
|
30
|
+
* heights need a definite ancestor height, which an auto-height document-flow
|
|
31
|
+
* ancestor never has). A consumer whose OWN shell already bounds the panel's
|
|
32
|
+
* height (no document scroll) doesn't have that problem, and viewport-sizing
|
|
33
|
+
* there is actively wrong — the overlay reads `100dvh` regardless of how much
|
|
34
|
+
* of the viewport is actually the panel's, so anything the consumer placed
|
|
35
|
+
* outside the panel (a header above it, say) gets painted over.
|
|
36
|
+
* `overlaySizing="panel"` is that second mode: CSS Grid layer-stacking (every
|
|
37
|
+
* child placed in the same `grid-area: 1/1`) instead of sticky/dvh/negative-
|
|
38
|
+
* margin — each child fills exactly the grid cell, i.e. exactly the panel's
|
|
39
|
+
* own box, whatever that box's real height is. No `position: absolute` (that
|
|
40
|
+
* takes the content wrapper out of flow, which is not what "panel" mode
|
|
41
|
+
* changes — only the two overlays' sizing mechanism changes) and no percentage
|
|
42
|
+
* margin (the well-known CSS quirk where a vertical margin percentage resolves
|
|
43
|
+
* against the containing block's WIDTH, not its height, so it cannot express
|
|
44
|
+
* "100% of my own height" at all).
|
|
45
|
+
*
|
|
46
|
+
* The bleed-mask's `clip-path` also changes with the mode, not just its box
|
|
47
|
+
* size: `inset(-12px)` (viewport mode) is a deliberate small halo — the
|
|
48
|
+
* `box-shadow`'s `GUTTER_MASK_SPREAD` is 40px, and the clip-path caps how much
|
|
49
|
+
* of that is actually allowed to paint past the box edge. A document-scroll
|
|
50
|
+
* consumer has nothing else positioned right above/below the panel for that
|
|
51
|
+
* halo to land on. A bounded-shell consumer might — the whole reason for
|
|
52
|
+
* `overlaySizing="panel"` is that something IS placed right outside the panel
|
|
53
|
+
* — so panel mode clips the shadow flush to the box (`inset(0)`, zero bleed)
|
|
54
|
+
* rather than merely resizing the box and leaving a smaller bleed that could
|
|
55
|
+
* still reach a close sibling.
|
|
56
|
+
*
|
|
26
57
|
* Framing is tri-state via the `framed` prop:
|
|
27
58
|
*
|
|
28
59
|
* - `undefined` (DEFAULT) → RESPONSIVE, driven purely by NativeWind: full-bleed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPanel.web.d.ts","sourceRoot":"","sources":["../../../../src/content-panel/ContentPanel.web.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ContentPanel.web.d.ts","sourceRoot":"","sources":["../../../../src/content-panel/ContentPanel.web.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AACH,OAAO,KAAe,MAAM,OAAO,CAAC;AAUpC,OAAO,KAAK,EAAgC,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE/E,+DAA+D;AAC/D,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,6DAA6D;AAC7D,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,2DAA2D;AAC3D,eAAO,MAAM,kBAAkB,IAAI,CAAC;AA4KpC,eAAO,MAAM,YAAY,+CAA8B,CAAC"}
|
|
@@ -44,5 +44,41 @@ export interface ContentPanelProps {
|
|
|
44
44
|
* API parity — no-op on native (there is no bleed-mask), like `framed`.
|
|
45
45
|
*/
|
|
46
46
|
maskColor?: string;
|
|
47
|
+
/**
|
|
48
|
+
* How the WEB overlays (bleed-mask, border-frame) size themselves. No-op on
|
|
49
|
+
* native (there are no overlays to size).
|
|
50
|
+
* - `'viewport'` (DEFAULT) — sized to the dynamic viewport height (`100dvh`)
|
|
51
|
+
* and `position: sticky`-pinned, so they read as a constant frame around
|
|
52
|
+
* the visible slice of a panel whose own DOM height can exceed one screen
|
|
53
|
+
* — the document-scroll case (e.g. a feed whose page grows with content).
|
|
54
|
+
* Requires the panel to sit in a document that actually scrolls; see
|
|
55
|
+
* `ContentPanel.web.tsx`'s doc comment.
|
|
56
|
+
* - `'panel'` — sized to the panel's own real box via CSS Grid layer-
|
|
57
|
+
* stacking (the overlays and the content wrapper all occupy the same
|
|
58
|
+
* grid cell) instead of viewport math. The right mode for a consumer
|
|
59
|
+
* whose own shell already bounds the panel's height (no document
|
|
60
|
+
* scroll — a fixed app shell with its own internal scroll containers),
|
|
61
|
+
* where anything the consumer places outside the panel (e.g. a header
|
|
62
|
+
* above it) must never be overlapped by an overlay sized to the whole
|
|
63
|
+
* viewport.
|
|
64
|
+
*/
|
|
65
|
+
overlaySizing?: 'viewport' | 'panel';
|
|
66
|
+
/**
|
|
67
|
+
* Pixels of REAL, persistent chrome the consumer has placed above the panel
|
|
68
|
+
* — outside it, in normal document flow — that the viewport-mode overlays
|
|
69
|
+
* (`overlaySizing="viewport"`, the default) do not otherwise know about.
|
|
70
|
+
* No-op when `overlaySizing="panel"` (that mode already starts at the
|
|
71
|
+
* panel's own box, wherever that is) and on native (no overlays there).
|
|
72
|
+
*
|
|
73
|
+
* The overlays are sized/positioned off the VIEWPORT (`top: 8px`,
|
|
74
|
+
* `height: calc(100dvh - 16px)`) on the assumption that the panel begins
|
|
75
|
+
* near the true top of the screen. A consumer with its own sticky chrome
|
|
76
|
+
* above the panel (a header, say, kept sticky-pinned the same way) shifts
|
|
77
|
+
* where the panel visually starts without moving the panel's own DOM
|
|
78
|
+
* position, so the overlays would still read from viewport 0 and paint
|
|
79
|
+
* over that chrome. This shifts their `top` down and shrinks their height
|
|
80
|
+
* by the same amount, so they begin exactly where the panel visually does.
|
|
81
|
+
*/
|
|
82
|
+
overlayTopOffset?: number;
|
|
47
83
|
}
|
|
48
84
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/content-panel/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,MAAM,4BAA4B,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAElE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,4BAA4B,CAAC;IAC1C,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/content-panel/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,MAAM,4BAA4B,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAElE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,4BAA4B,CAAC;IAC1C,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;;;;;;;;OAiBG;IACH,aAAa,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IACrC;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B"}
|
|
@@ -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;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,YAAY,GACpB,cAAc,GACd,aAAa,GACb,WAAW,GACX,UAAU,GACV,QAAQ,CAAC;AAEb,MAAM,WAAW,QAAQ;IACvB,qBAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,CAAC;IAEvC,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAExB;;;;OAIG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC;IAEzB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,yEAAyE;IACzE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,8CAA8C;IAC9C,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,8CAA8C;IAC9C,UAAU,CAAC,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"}
|
|
@@ -23,6 +23,37 @@
|
|
|
23
23
|
* content rather than displacing it). They render BEFORE the content wrapper so
|
|
24
24
|
* z-index — not DOM order — decides layering.
|
|
25
25
|
*
|
|
26
|
+
* That sticky/`100dvh` sizing is itself a CHOICE, not the only mode — see
|
|
27
|
+
* `overlaySizing`. It is correct exactly when the panel's own DOM height can
|
|
28
|
+
* exceed one viewport in a document that actually scrolls (dvh gives the
|
|
29
|
+
* overlay a fixed, viewport-sized height that a percentage cannot: percentage
|
|
30
|
+
* heights need a definite ancestor height, which an auto-height document-flow
|
|
31
|
+
* ancestor never has). A consumer whose OWN shell already bounds the panel's
|
|
32
|
+
* height (no document scroll) doesn't have that problem, and viewport-sizing
|
|
33
|
+
* there is actively wrong — the overlay reads `100dvh` regardless of how much
|
|
34
|
+
* of the viewport is actually the panel's, so anything the consumer placed
|
|
35
|
+
* outside the panel (a header above it, say) gets painted over.
|
|
36
|
+
* `overlaySizing="panel"` is that second mode: CSS Grid layer-stacking (every
|
|
37
|
+
* child placed in the same `grid-area: 1/1`) instead of sticky/dvh/negative-
|
|
38
|
+
* margin — each child fills exactly the grid cell, i.e. exactly the panel's
|
|
39
|
+
* own box, whatever that box's real height is. No `position: absolute` (that
|
|
40
|
+
* takes the content wrapper out of flow, which is not what "panel" mode
|
|
41
|
+
* changes — only the two overlays' sizing mechanism changes) and no percentage
|
|
42
|
+
* margin (the well-known CSS quirk where a vertical margin percentage resolves
|
|
43
|
+
* against the containing block's WIDTH, not its height, so it cannot express
|
|
44
|
+
* "100% of my own height" at all).
|
|
45
|
+
*
|
|
46
|
+
* The bleed-mask's `clip-path` also changes with the mode, not just its box
|
|
47
|
+
* size: `inset(-12px)` (viewport mode) is a deliberate small halo — the
|
|
48
|
+
* `box-shadow`'s `GUTTER_MASK_SPREAD` is 40px, and the clip-path caps how much
|
|
49
|
+
* of that is actually allowed to paint past the box edge. A document-scroll
|
|
50
|
+
* consumer has nothing else positioned right above/below the panel for that
|
|
51
|
+
* halo to land on. A bounded-shell consumer might — the whole reason for
|
|
52
|
+
* `overlaySizing="panel"` is that something IS placed right outside the panel
|
|
53
|
+
* — so panel mode clips the shadow flush to the box (`inset(0)`, zero bleed)
|
|
54
|
+
* rather than merely resizing the box and leaving a smaller bleed that could
|
|
55
|
+
* still reach a close sibling.
|
|
56
|
+
*
|
|
26
57
|
* Framing is tri-state via the `framed` prop:
|
|
27
58
|
*
|
|
28
59
|
* - `undefined` (DEFAULT) → RESPONSIVE, driven purely by NativeWind: full-bleed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPanel.web.d.ts","sourceRoot":"","sources":["../../../../src/content-panel/ContentPanel.web.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ContentPanel.web.d.ts","sourceRoot":"","sources":["../../../../src/content-panel/ContentPanel.web.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AACH,OAAO,KAAe,MAAM,OAAO,CAAC;AAUpC,OAAO,KAAK,EAAgC,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE/E,+DAA+D;AAC/D,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,6DAA6D;AAC7D,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,2DAA2D;AAC3D,eAAO,MAAM,kBAAkB,IAAI,CAAC;AA4KpC,eAAO,MAAM,YAAY,+CAA8B,CAAC"}
|
|
@@ -44,5 +44,41 @@ export interface ContentPanelProps {
|
|
|
44
44
|
* API parity — no-op on native (there is no bleed-mask), like `framed`.
|
|
45
45
|
*/
|
|
46
46
|
maskColor?: string;
|
|
47
|
+
/**
|
|
48
|
+
* How the WEB overlays (bleed-mask, border-frame) size themselves. No-op on
|
|
49
|
+
* native (there are no overlays to size).
|
|
50
|
+
* - `'viewport'` (DEFAULT) — sized to the dynamic viewport height (`100dvh`)
|
|
51
|
+
* and `position: sticky`-pinned, so they read as a constant frame around
|
|
52
|
+
* the visible slice of a panel whose own DOM height can exceed one screen
|
|
53
|
+
* — the document-scroll case (e.g. a feed whose page grows with content).
|
|
54
|
+
* Requires the panel to sit in a document that actually scrolls; see
|
|
55
|
+
* `ContentPanel.web.tsx`'s doc comment.
|
|
56
|
+
* - `'panel'` — sized to the panel's own real box via CSS Grid layer-
|
|
57
|
+
* stacking (the overlays and the content wrapper all occupy the same
|
|
58
|
+
* grid cell) instead of viewport math. The right mode for a consumer
|
|
59
|
+
* whose own shell already bounds the panel's height (no document
|
|
60
|
+
* scroll — a fixed app shell with its own internal scroll containers),
|
|
61
|
+
* where anything the consumer places outside the panel (e.g. a header
|
|
62
|
+
* above it) must never be overlapped by an overlay sized to the whole
|
|
63
|
+
* viewport.
|
|
64
|
+
*/
|
|
65
|
+
overlaySizing?: 'viewport' | 'panel';
|
|
66
|
+
/**
|
|
67
|
+
* Pixels of REAL, persistent chrome the consumer has placed above the panel
|
|
68
|
+
* — outside it, in normal document flow — that the viewport-mode overlays
|
|
69
|
+
* (`overlaySizing="viewport"`, the default) do not otherwise know about.
|
|
70
|
+
* No-op when `overlaySizing="panel"` (that mode already starts at the
|
|
71
|
+
* panel's own box, wherever that is) and on native (no overlays there).
|
|
72
|
+
*
|
|
73
|
+
* The overlays are sized/positioned off the VIEWPORT (`top: 8px`,
|
|
74
|
+
* `height: calc(100dvh - 16px)`) on the assumption that the panel begins
|
|
75
|
+
* near the true top of the screen. A consumer with its own sticky chrome
|
|
76
|
+
* above the panel (a header, say, kept sticky-pinned the same way) shifts
|
|
77
|
+
* where the panel visually starts without moving the panel's own DOM
|
|
78
|
+
* position, so the overlays would still read from viewport 0 and paint
|
|
79
|
+
* over that chrome. This shifts their `top` down and shrinks their height
|
|
80
|
+
* by the same amount, so they begin exactly where the panel visually does.
|
|
81
|
+
*/
|
|
82
|
+
overlayTopOffset?: number;
|
|
47
83
|
}
|
|
48
84
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/content-panel/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,MAAM,4BAA4B,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAElE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,4BAA4B,CAAC;IAC1C,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/content-panel/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,MAAM,4BAA4B,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC;AAElE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,4BAA4B,CAAC;IAC1C,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;;;;;;;;OAiBG;IACH,aAAa,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IACrC;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B"}
|
|
@@ -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;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,YAAY,GACpB,cAAc,GACd,aAAa,GACb,WAAW,GACX,UAAU,GACV,QAAQ,CAAC;AAEb,MAAM,WAAW,QAAQ;IACvB,qBAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,CAAC;IAEvC,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAExB;;;;OAIG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC;IAEzB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,yEAAyE;IACzE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,8CAA8C;IAC9C,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,8CAA8C;IAC9C,UAAU,CAAC,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"}
|
package/package.json
CHANGED
|
@@ -23,6 +23,37 @@
|
|
|
23
23
|
* content rather than displacing it). They render BEFORE the content wrapper so
|
|
24
24
|
* z-index — not DOM order — decides layering.
|
|
25
25
|
*
|
|
26
|
+
* That sticky/`100dvh` sizing is itself a CHOICE, not the only mode — see
|
|
27
|
+
* `overlaySizing`. It is correct exactly when the panel's own DOM height can
|
|
28
|
+
* exceed one viewport in a document that actually scrolls (dvh gives the
|
|
29
|
+
* overlay a fixed, viewport-sized height that a percentage cannot: percentage
|
|
30
|
+
* heights need a definite ancestor height, which an auto-height document-flow
|
|
31
|
+
* ancestor never has). A consumer whose OWN shell already bounds the panel's
|
|
32
|
+
* height (no document scroll) doesn't have that problem, and viewport-sizing
|
|
33
|
+
* there is actively wrong — the overlay reads `100dvh` regardless of how much
|
|
34
|
+
* of the viewport is actually the panel's, so anything the consumer placed
|
|
35
|
+
* outside the panel (a header above it, say) gets painted over.
|
|
36
|
+
* `overlaySizing="panel"` is that second mode: CSS Grid layer-stacking (every
|
|
37
|
+
* child placed in the same `grid-area: 1/1`) instead of sticky/dvh/negative-
|
|
38
|
+
* margin — each child fills exactly the grid cell, i.e. exactly the panel's
|
|
39
|
+
* own box, whatever that box's real height is. No `position: absolute` (that
|
|
40
|
+
* takes the content wrapper out of flow, which is not what "panel" mode
|
|
41
|
+
* changes — only the two overlays' sizing mechanism changes) and no percentage
|
|
42
|
+
* margin (the well-known CSS quirk where a vertical margin percentage resolves
|
|
43
|
+
* against the containing block's WIDTH, not its height, so it cannot express
|
|
44
|
+
* "100% of my own height" at all).
|
|
45
|
+
*
|
|
46
|
+
* The bleed-mask's `clip-path` also changes with the mode, not just its box
|
|
47
|
+
* size: `inset(-12px)` (viewport mode) is a deliberate small halo — the
|
|
48
|
+
* `box-shadow`'s `GUTTER_MASK_SPREAD` is 40px, and the clip-path caps how much
|
|
49
|
+
* of that is actually allowed to paint past the box edge. A document-scroll
|
|
50
|
+
* consumer has nothing else positioned right above/below the panel for that
|
|
51
|
+
* halo to land on. A bounded-shell consumer might — the whole reason for
|
|
52
|
+
* `overlaySizing="panel"` is that something IS placed right outside the panel
|
|
53
|
+
* — so panel mode clips the shadow flush to the box (`inset(0)`, zero bleed)
|
|
54
|
+
* rather than merely resizing the box and leaving a smaller bleed that could
|
|
55
|
+
* still reach a close sibling.
|
|
56
|
+
*
|
|
26
57
|
* Framing is tri-state via the `framed` prop:
|
|
27
58
|
*
|
|
28
59
|
* - `undefined` (DEFAULT) → RESPONSIVE, driven purely by NativeWind: full-bleed
|
|
@@ -120,6 +151,8 @@ const ContentPanelComponent: React.FC<ContentPanelProps> = ({
|
|
|
120
151
|
contentStyle,
|
|
121
152
|
showStickyFrame,
|
|
122
153
|
maskColor,
|
|
154
|
+
overlaySizing = 'viewport',
|
|
155
|
+
overlayTopOffset,
|
|
123
156
|
}) => {
|
|
124
157
|
// Dev-only invariant — must run unconditionally (before deriving any
|
|
125
158
|
// mode-specific branch) so the hook order stays stable (rules of hooks).
|
|
@@ -133,6 +166,7 @@ const ContentPanelComponent: React.FC<ContentPanelProps> = ({
|
|
|
133
166
|
// Responsive mode selects a pre-shipped literal breakpoint bundle by value;
|
|
134
167
|
// `framed === true`/`false` ignore `framedFrom` (fixed always/never framing).
|
|
135
168
|
const bp = RESPONSIVE_WEB[framedFrom];
|
|
169
|
+
const boundToPanel = overlaySizing === 'panel';
|
|
136
170
|
|
|
137
171
|
// Whole literal class strings selected per mode (the Tailwind content-scan
|
|
138
172
|
// over `lib/**` requires each arbitrary/`min-*`/`max-*`/`web:` token stay
|
|
@@ -148,25 +182,64 @@ const ContentPanelComponent: React.FC<ContentPanelProps> = ({
|
|
|
148
182
|
: framed
|
|
149
183
|
? 'flex-1 rounded-radius-28 web:overflow-x-clip'
|
|
150
184
|
: 'flex-1';
|
|
151
|
-
|
|
152
|
-
|
|
185
|
+
// `overlaySizing="panel"`: the surface becomes a single-cell CSS Grid so the
|
|
186
|
+
// overlays and the content wrapper below can all be placed in that ONE cell
|
|
187
|
+
// (`web:[grid-area:1/1]`) and each fill it exactly — `minmax(0,1fr)` (not
|
|
188
|
+
// `1fr` alone) on both axes so the track can still SHRINK below its content's
|
|
189
|
+
// intrinsic size, the grid-track equivalent of the flex `min-height: 0`
|
|
190
|
+
// fix — without it, a tall scrollable child would grow the row instead of
|
|
191
|
+
// being clipped/scrolled inside a fixed-height cell.
|
|
192
|
+
const gridStackClass = boundToPanel
|
|
193
|
+
? 'web:grid web:[grid-template-columns:minmax(0,1fr)] web:[grid-template-rows:minmax(0,1fr)]'
|
|
194
|
+
: '';
|
|
195
|
+
const surfaceClass = [surfaceBase, gridStackClass, surfaceClassName ?? 'bg-card'].filter(Boolean).join(' ');
|
|
196
|
+
const contentClass = [contentBase, boundToPanel ? 'web:[grid-area:1/1]' : '', contentClassName]
|
|
197
|
+
.filter(Boolean)
|
|
198
|
+
.join(' ');
|
|
199
|
+
|
|
200
|
+
// `overlayTopOffset`: the viewport-mode overlays are sized/positioned from
|
|
201
|
+
// literal Tailwind classes (`top-2`, `h-[calc(100dvh-16px)]`, a matching
|
|
202
|
+
// negative `margin-bottom`) because those values are constants known at
|
|
203
|
+
// build time. An offset is a runtime number (a consumer's measured header
|
|
204
|
+
// height), which a Tailwind arbitrary class can't express — content-scanning
|
|
205
|
+
// needs the literal class string in source, not a value computed later — so
|
|
206
|
+
// this shifts the same three properties via inline `style` instead, which
|
|
207
|
+
// has no such constraint. No-op in `panel` mode (already starts at the
|
|
208
|
+
// panel's own box) and when unset (0/undefined) — the className values are
|
|
209
|
+
// left standing on their own in both of those cases.
|
|
210
|
+
// RN's `ViewStyle.height`/`marginBottom` types only accept a number or a
|
|
211
|
+
// `${number}%` string (not an arbitrary CSS `calc()` string), because most
|
|
212
|
+
// of this type is shared with native, where `calc()` doesn't exist. This
|
|
213
|
+
// file is web-only, where it's a real, valid CSS value react-native-web
|
|
214
|
+
// passes straight through — the same reasoning `WebViewStyle`/`asViewStyle`
|
|
215
|
+
// document in OxyHQ/Mention's `types/webStyles.ts` for the identical need.
|
|
216
|
+
const topOffsetStyle = !boundToPanel && overlayTopOffset
|
|
217
|
+
? ({
|
|
218
|
+
top: 8 + overlayTopOffset,
|
|
219
|
+
height: `calc(100dvh - ${16 + overlayTopOffset}px)`,
|
|
220
|
+
marginBottom: `calc(-100dvh + ${16 + overlayTopOffset}px)`,
|
|
221
|
+
} as unknown as ViewStyle)
|
|
222
|
+
: undefined;
|
|
153
223
|
|
|
154
224
|
return (
|
|
155
225
|
<ContentPanelNestingContext.Provider value={true}>
|
|
156
|
-
<StyledView className={surfaceClass} style={surfaceStyle}>
|
|
226
|
+
<StyledView testID="content-panel-surface" className={surfaceClass} style={surfaceStyle}>
|
|
157
227
|
{/* (1) Bleed-mask overlay — gutter box-shadow ring, below chrome. Not
|
|
158
228
|
rendered when never-framed; `max-md:hidden` (display:none <md) when
|
|
159
229
|
responsive, so the breakpoint is decided in CSS, not by remounting. */}
|
|
160
230
|
{showOverlays && (
|
|
161
231
|
<StyledView
|
|
162
232
|
key="bleed-mask"
|
|
233
|
+
testID="content-panel-bleed-mask"
|
|
163
234
|
pointerEvents="none"
|
|
164
235
|
className={
|
|
165
|
-
|
|
166
|
-
? `web:
|
|
167
|
-
:
|
|
236
|
+
boundToPanel
|
|
237
|
+
? `web:[grid-area:1/1] z-30 h-full w-full rounded-radius-28 ${responsive ? bp.overlayHidden : ''} web:[clip-path:inset(0)]`
|
|
238
|
+
: responsive
|
|
239
|
+
? `web:sticky web:top-2 z-30 h-[calc(100dvh-16px)] w-full rounded-radius-28 ${bp.overlayHidden} web:[margin-bottom:calc(-100dvh+16px)] web:[clip-path:inset(-12px)]`
|
|
240
|
+
: 'web:sticky web:top-2 z-30 h-[calc(100dvh-16px)] w-full rounded-radius-28 web:[margin-bottom:calc(-100dvh+16px)] web:[clip-path:inset(-12px)]'
|
|
168
241
|
}
|
|
169
|
-
style={{ boxShadow: `0 0 0 ${GUTTER_MASK_SPREAD}px ${maskColor ?? colors.background}` }}
|
|
242
|
+
style={{ ...topOffsetStyle, boxShadow: `0 0 0 ${GUTTER_MASK_SPREAD}px ${maskColor ?? colors.background}` }}
|
|
170
243
|
/>
|
|
171
244
|
)}
|
|
172
245
|
{/* (2) Border-frame overlay — one continuous rounded border, above all.
|
|
@@ -174,11 +247,15 @@ const ContentPanelComponent: React.FC<ContentPanelProps> = ({
|
|
|
174
247
|
{showOverlays && showStickyFrame !== false && (
|
|
175
248
|
<StyledView
|
|
176
249
|
key="border-frame"
|
|
250
|
+
testID="content-panel-border-frame"
|
|
177
251
|
pointerEvents="none"
|
|
252
|
+
style={topOffsetStyle}
|
|
178
253
|
className={
|
|
179
|
-
|
|
180
|
-
? `web:
|
|
181
|
-
:
|
|
254
|
+
boundToPanel
|
|
255
|
+
? `web:[grid-area:1/1] z-[120] h-full w-full rounded-radius-28 border border-border ${responsive ? bp.overlayHidden : ''}`
|
|
256
|
+
: responsive
|
|
257
|
+
? `web:sticky web:top-2 z-[120] h-[calc(100dvh-16px)] w-full rounded-radius-28 border border-border ${bp.overlayHidden} web:[margin-bottom:calc(-100dvh+16px)]`
|
|
258
|
+
: 'web:sticky web:top-2 z-[120] h-[calc(100dvh-16px)] w-full rounded-radius-28 border border-border web:[margin-bottom:calc(-100dvh+16px)]'
|
|
182
259
|
}
|
|
183
260
|
/>
|
|
184
261
|
)}
|
|
@@ -186,7 +263,7 @@ const ContentPanelComponent: React.FC<ContentPanelProps> = ({
|
|
|
186
263
|
in place instead of remounting `{children}` (which would reset feed
|
|
187
264
|
scroll/virtualizer + refetch on a breakpoint cross). Clipped to the
|
|
188
265
|
rounded panel shape on web when framed. */}
|
|
189
|
-
<StyledView key="content" className={contentClass} style={contentStyle}>
|
|
266
|
+
<StyledView key="content" testID="content-panel-content" className={contentClass} style={contentStyle}>
|
|
190
267
|
{children}
|
|
191
268
|
</StyledView>
|
|
192
269
|
</StyledView>
|
|
@@ -46,4 +46,40 @@ export interface ContentPanelProps {
|
|
|
46
46
|
* API parity — no-op on native (there is no bleed-mask), like `framed`.
|
|
47
47
|
*/
|
|
48
48
|
maskColor?: string;
|
|
49
|
+
/**
|
|
50
|
+
* How the WEB overlays (bleed-mask, border-frame) size themselves. No-op on
|
|
51
|
+
* native (there are no overlays to size).
|
|
52
|
+
* - `'viewport'` (DEFAULT) — sized to the dynamic viewport height (`100dvh`)
|
|
53
|
+
* and `position: sticky`-pinned, so they read as a constant frame around
|
|
54
|
+
* the visible slice of a panel whose own DOM height can exceed one screen
|
|
55
|
+
* — the document-scroll case (e.g. a feed whose page grows with content).
|
|
56
|
+
* Requires the panel to sit in a document that actually scrolls; see
|
|
57
|
+
* `ContentPanel.web.tsx`'s doc comment.
|
|
58
|
+
* - `'panel'` — sized to the panel's own real box via CSS Grid layer-
|
|
59
|
+
* stacking (the overlays and the content wrapper all occupy the same
|
|
60
|
+
* grid cell) instead of viewport math. The right mode for a consumer
|
|
61
|
+
* whose own shell already bounds the panel's height (no document
|
|
62
|
+
* scroll — a fixed app shell with its own internal scroll containers),
|
|
63
|
+
* where anything the consumer places outside the panel (e.g. a header
|
|
64
|
+
* above it) must never be overlapped by an overlay sized to the whole
|
|
65
|
+
* viewport.
|
|
66
|
+
*/
|
|
67
|
+
overlaySizing?: 'viewport' | 'panel';
|
|
68
|
+
/**
|
|
69
|
+
* Pixels of REAL, persistent chrome the consumer has placed above the panel
|
|
70
|
+
* — outside it, in normal document flow — that the viewport-mode overlays
|
|
71
|
+
* (`overlaySizing="viewport"`, the default) do not otherwise know about.
|
|
72
|
+
* No-op when `overlaySizing="panel"` (that mode already starts at the
|
|
73
|
+
* panel's own box, wherever that is) and on native (no overlays there).
|
|
74
|
+
*
|
|
75
|
+
* The overlays are sized/positioned off the VIEWPORT (`top: 8px`,
|
|
76
|
+
* `height: calc(100dvh - 16px)`) on the assumption that the panel begins
|
|
77
|
+
* near the true top of the screen. A consumer with its own sticky chrome
|
|
78
|
+
* above the panel (a header, say, kept sticky-pinned the same way) shifts
|
|
79
|
+
* where the panel visually starts without moving the panel's own DOM
|
|
80
|
+
* position, so the overlays would still read from viewport 0 and paint
|
|
81
|
+
* over that chrome. This shifts their `top` down and shrinks their height
|
|
82
|
+
* by the same amount, so they begin exactly where the panel visually does.
|
|
83
|
+
*/
|
|
84
|
+
overlayTopOffset?: number;
|
|
49
85
|
}
|
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
|
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A barrel that DELIBERATELY offers one name from two declarations, so that
|
|
3
|
-
* `barrel-name-collisions.test.ts` can prove its detector fires. It reproduces
|
|
4
|
-
* the shipped `Item` shape: a star export carrying `Item` from `item/`, and an
|
|
5
|
-
* explicit re-export binding that same name to a different component.
|
|
6
|
-
*
|
|
7
|
-
* Nothing imports this at runtime. bob's `exclude` keeps it out of `lib/`, and
|
|
8
|
-
* `files: ["src", …]` does ship it inside the tarball's `src/` like the other
|
|
9
|
-
* test files there — but no entry point reaches it, so no bundler links it, and
|
|
10
|
-
* `package.json#exports` never names it.
|
|
11
|
-
*
|
|
12
|
-
* The `Card` lines below are the other half of the
|
|
13
|
-
* control: one name offered twice from ONE declaration, which the detector must
|
|
14
|
-
* stay quiet about — otherwise its cheapest fix would be deleting a legitimate
|
|
15
|
-
* redundant re-export.
|
|
16
|
-
*/
|
|
17
|
-
export * from '../../item';
|
|
18
|
-
export { Card as Item } from '../../card';
|
|
19
|
-
export { Card } from '../../card';
|
|
20
|
-
export * from '../../card';
|