@rcarls/rc-bottom-sheet 0.0.0-next-20260921045401

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/CHANGELOG.md ADDED
@@ -0,0 +1,130 @@
1
+ # @rcarls/rc-bottom-sheet
2
+
3
+ ## 0.0.0-next-20260921045401
4
+
5
+ ### Minor Changes
6
+
7
+ - 57338f5: `rc-dialog`, `rc-bottom-sheet`, and `rc-snackbar` now fade in and out through
8
+ CSS alone, using `@starting-style` and a discrete `display`/`overlay`
9
+ transition, driven by the shared `--rc-motion-effects-*` tokens (and
10
+ `--rc-motion-spatial-*` for `rc-snackbar`'s slide). `showModal()`/`show()`/
11
+ `close()` all stay synchronous, and nothing in any of the three components
12
+ waits on the transition finishing, so a zero-duration theme or a browser
13
+ without support for the CSS involved both degrade to an instant, fully
14
+ correct open and close.
15
+
16
+ `rc-dialog` and `rc-bottom-sheet` animate opacity only, not a scale or slide
17
+ transform: both support pointer resize and read `getBoundingClientRect()` to
18
+ compute drag deltas, and a transform is a visual effect that
19
+ `getBoundingClientRect()` reports for as long as it's still animating,
20
+ corrupting that measurement if a resize or drag starts during the entrance.
21
+ `rc-snackbar` has no such feature, so it fades and slides up from the
22
+ block-end edge it's anchored to.
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [50d5610]
27
+ - Updated dependencies [4341311]
28
+ - Updated dependencies [2c7c80a]
29
+ - Updated dependencies [57338f5]
30
+ - @rcarls/rc-common@0.0.0-next-20260921045401
31
+ - @rcarls/rc-dialog@0.0.0-next-20260921045401
32
+
33
+ ## 0.6.0
34
+
35
+ ### Patch Changes
36
+
37
+ - ee7ba6c: Keep resize pinning, drag origins, and snapped bottom sheets correctly
38
+ positioned when a layout-containing ancestor establishes a non-viewport
39
+ containing block. Report animated snap changes only after the sheet settles so
40
+ consumers can defer discrete content and accessibility state changes until the
41
+ surface motion completes. Expose resize-start timing so content can be prepared
42
+ before an interactive expansion reveals it.
43
+ - Updated dependencies [6683eb9]
44
+ - Updated dependencies [ee7ba6c]
45
+ - Updated dependencies [30eb232]
46
+ - Updated dependencies [57370e4]
47
+ - @rcarls/rc-common@0.6.0
48
+ - @rcarls/rc-dialog@0.6.0
49
+
50
+ ## 0.5.0
51
+
52
+ ### Patch Changes
53
+
54
+ - ba65db7: Fix an edge case left in the 0.4.2 resize-repin fix: the window-resize re-pin re-measured
55
+ via `getBoundingClientRect()` on the box that was still carrying its _previous_ inline pin,
56
+ so a fixed (non-`dvh`) snap point (for example a `132px` peek height, common for a
57
+ persistent summary sheet) computed the exact same, now-stale target, since neither the
58
+ requested height nor the stale box's edges had changed. Only `dvh`-based snap points were
59
+ actually re-deriving correctly. Now clears the previous `top`/`height` pin before
60
+ re-measuring on resize, so the dialog reverts to its CSS-driven (`inset-block-end`-anchored)
61
+ position first, the same as a sheet that has never been pinned. Added a regression test
62
+ covering this specific case (confirmed it fails without the fix).
63
+ - Updated dependencies [4ae2ef0]
64
+ - Updated dependencies [689340c]
65
+ - @rcarls/rc-common@0.5.0
66
+ - @rcarls/rc-dialog@0.5.0
67
+
68
+ ## 0.4.2
69
+
70
+ ### Patch Changes
71
+
72
+ - 5178dcc: Fix `rc-bottom-sheet` snapping to stale geometry after a viewport resize (for example a
73
+ browser window maximize/restore) while open. Snap-point heights are resolved against the
74
+ current viewport at the moment a snap is applied, then frozen as inline `top`/`height`
75
+ styles; nothing re-derived them after that, so a resize with no drag or `snapTo()` call
76
+ in between left the sheet pinned to pre-resize pixel geometry. Now listens for `resize`
77
+ while open and re-applies the last-snapped index against fresh geometry.
78
+
79
+ Also stops pinning the inline axis (`left`/`width`) at all: only `top`/`height` are ever
80
+ read again after the initial pin, and freezing the inline axis as an inline style
81
+ permanently overrides any external stylesheet's `inset-inline`/`inline-size` confinement
82
+ (for example a host page confining a sheet to a layout pane narrower than the viewport)
83
+ regardless of specificity, since inline styles always win that cascade. `rc-bottom-sheet`'s
84
+ own `LIGHT_DOM_CSS` already deliberately leaves the inline axis CSS-owned; the pin just
85
+ wasn't honoring that.
86
+ - @rcarls/rc-common@0.4.2
87
+ - @rcarls/rc-dialog@0.4.2
88
+
89
+ ## 0.4.1
90
+
91
+ ### Patch Changes
92
+
93
+ - @rcarls/rc-common@0.4.1
94
+ - @rcarls/rc-dialog@0.4.1
95
+
96
+ ## 0.4.0
97
+
98
+ ### Minor Changes
99
+
100
+ - 48cf73f: Add the rc-bottom-sheet package as a dialog-backed modal bottom-sheet surface.
101
+ - 037b1b3: Add shared drag gesture measurement and numeric snap helpers, migrate bottom
102
+ sheet settling to the shared velocity lifecycle, and add anchored settling and
103
+ swipe-to-collapse behavior to splitters.
104
+ - c40a1be: Add theme-neutral fast, default, and slow effects and spatial motion token
105
+ pairs. Expose bottom-sheet settle easing through
106
+ `--rc-bottom-sheet-snap-easing` and map sheet settling to the Material spatial
107
+ motion scheme.
108
+
109
+ Give direct-child bottom-sheet handles a full-width 48px interaction target
110
+ while preserving the 32 by 4 pixel visual indicator. Replace rectangular
111
+ mobile browser tap highlights on chips with themeable, shape-clipped state
112
+ layers. Keep bottom-sheet snap targets docked to the block-end edge when CSS
113
+ minimum or maximum sizing constrains their requested heights.
114
+
115
+ Mount declaratively assigned textarea plugins at connection time and remount
116
+ them after reconnection, preserving plugin effects and adopted styles in
117
+ framework render lifecycles.
118
+
119
+ ### Patch Changes
120
+
121
+ - ebec800: Dock bottom sheets without a theme to the viewport block-end by default and
122
+ support absolute positioning for non-modal sheets contained by a positioned ancestor.
123
+ Center authored drag handles with a splitter-aligned pill treatment. Align the
124
+ Material theme with its surface, elevation, scrim, drag-handle, and contextual
125
+ button treatment.
126
+ - Updated dependencies [e57277f]
127
+ - Updated dependencies [ccca8e2]
128
+ - Updated dependencies [037b1b3]
129
+ - @rcarls/rc-dialog@0.4.0
130
+ - @rcarls/rc-common@0.4.0
package/README.md ADDED
@@ -0,0 +1,77 @@
1
+ # `@rcarls/rc-bottom-sheet`
2
+
3
+ Modal bottom-sheet wrapper for a native `<dialog>`.
4
+
5
+ Docs: [https://richardcarls.github.io/rc-webcomponents/components/rc-bottom-sheet](https://richardcarls.github.io/rc-webcomponents/components/rc-bottom-sheet).
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @rcarls/rc-bottom-sheet
11
+ ```
12
+
13
+ ```bash
14
+ yarn add @rcarls/rc-bottom-sheet
15
+ ```
16
+
17
+ ```js
18
+ import '@rcarls/rc-bottom-sheet/define';
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ Place a `<dialog>` element directly inside `<rc-bottom-sheet>`. The inner dialog
24
+ must have `aria-labelledby` or `aria-label`.
25
+
26
+ ```html
27
+ <rc-bottom-sheet id="filters" snap-points="40dvh 70dvh 100dvh">
28
+ <dialog aria-label="Filter recipes">
29
+ <button
30
+ type="button"
31
+ data-rc-bottom-sheet-handle
32
+ data-rc-dialog-resize-axis="y"
33
+ data-rc-dialog-resize-origin="top"
34
+ aria-label="Resize sheet"
35
+ ></button>
36
+ <button value="close" formmethod="dialog">Done</button>
37
+ </dialog>
38
+ </rc-bottom-sheet>
39
+
40
+ <script type="module">
41
+ document.querySelector('#filters').showModal();
42
+ </script>
43
+ ```
44
+
45
+ `rc-bottom-sheet` inherits `rc-dialog` methods and events, including
46
+ `showModal()`, `show()`, `close()`, `requestClose()`, `rc-dialog-toggle`, and
47
+ `rc-dialog-request-close`. It defaults to light dismiss, vertical top-origin
48
+ resize, downward swipe-dismiss, and fixed positioning at the viewport's bottom
49
+ edge. Add an optional
50
+ `[data-rc-bottom-sheet-handle]` element inside the dialog for an authored
51
+ handle. Handles without a theme use the same centered 32 by 4 pixel pill
52
+ geometry as the splitter-style drag indicator inside a full-width, 48 pixel-high pointer
53
+ target. Keep a direct-child handle at the top of the dialog so that target
54
+ starts at the sheet's draggable edge; when authoring custom dialog padding,
55
+ leave its block-start padding at zero.
56
+
57
+ For an embedded non-modal sheet, place the component in a positioned container,
58
+ set `--rc-bottom-sheet-position: absolute`, and open it with `show()`. The sheet
59
+ then docks to that container's block-end edge instead of the viewport.
60
+
61
+ List `snap-points` as CSS heights in ascending order. Slow drag releases
62
+ settle at the nearest point; a swipe at `swipe-velocity` or faster settles at
63
+ the first or last point. Settling animates unless the user prefers reduced
64
+ motion. `rc-bottom-sheet-resize-start` fires as an interactive resize begins,
65
+ before the sheet geometry changes, so consumers can prepare content that the
66
+ drag will reveal.
67
+
68
+ Call `snapTo(index)` to move programmatically. The
69
+ `rc-bottom-sheet-snap` event fires after the sheet has settled and reports the
70
+ selected `index`, effective target `height` after CSS size constraints, and
71
+ whether the trigger was a drag or API call. Interrupted animations do not emit
72
+ a stale event. Constrained targets remain docked to the same block-end edge.
73
+
74
+ Set `--rc-bottom-sheet-snap-duration` and
75
+ `--rc-bottom-sheet-snap-easing` on the dialog to customize its settle motion.
76
+ Themes can map these to their own spatial motion tokens; reduced motion still
77
+ settles instantly.