@reliability-design/web 1.4.9 → 1.4.11
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 +161 -2
- package/custom-elements.json +18604 -0
- package/dist/components/rel-accordion/README.md +9 -2
- package/dist/components/rel-alert/README.md +4 -7
- package/dist/components/rel-autocomplete/README.md +209 -209
- package/dist/components/rel-avatar/README.md +228 -118
- package/dist/components/rel-breadcrumb/README.md +1 -0
- package/dist/components/rel-button/README.md +9 -9
- package/dist/components/rel-calendar/README.md +111 -109
- package/dist/components/rel-cardmedia/README.md +1 -1
- package/dist/components/rel-carousel/README.md +187 -187
- package/dist/components/rel-checkbox/README.md +159 -147
- package/dist/components/rel-chip/README.md +141 -138
- package/dist/components/rel-container/README.md +1 -1
- package/dist/components/rel-date-picker/README.md +221 -206
- package/dist/components/rel-drawer/README.md +4 -4
- package/dist/components/rel-kbd/README.md +188 -141
- package/dist/components/rel-layout/README.md +34 -34
- package/dist/components/rel-menu/README.md +17 -10
- package/dist/components/rel-menubar/README.md +218 -218
- package/dist/components/rel-otp/README.md +4 -8
- package/dist/components/rel-pagination/README.md +141 -100
- package/dist/components/rel-popover/README.md +220 -203
- package/dist/components/rel-radio/README.md +142 -131
- package/dist/components/rel-range-picker/README.md +194 -171
- package/dist/components/rel-resizable/README.md +220 -199
- package/dist/components/rel-segmented-button/README.md +158 -157
- package/dist/components/rel-select/README.md +21 -17
- package/dist/components/rel-sheet/README.md +3 -2
- package/dist/components/rel-signature-pad/README.md +161 -0
- package/dist/components/rel-slider/README.md +140 -131
- package/dist/components/rel-snackbar/README.md +170 -168
- package/dist/components/rel-split-button/README.md +129 -0
- package/dist/components/rel-stepper/README.md +171 -171
- package/dist/components/rel-switch/README.md +122 -117
- package/dist/components/rel-tab/README.md +184 -174
- package/dist/components/rel-textfield/README.md +21 -28
- package/dist/components/rel-time-picker/README.md +188 -170
- package/dist/components/rel-toast/README.md +20 -11
- package/dist/components/rel-tooltip/README.md +5 -4
- package/dist/components/rel-tree/README.md +157 -0
- package/dist/components/rel-upload/README.md +8 -5
- package/dist/index.d.mts +1608 -624
- package/dist/index.d.ts +1608 -624
- package/dist/index.js +11933 -6802
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11009 -5885
- package/dist/index.mjs.map +1 -1
- package/dist/styles/ag-grid.css +274 -0
- package/dist/styles/motion.css +31 -0
- package/dist/styles/motion.tokens.json +38 -0
- package/dist/styles/vars.css +88 -64
- package/dist/{vars-DXX6QOAG.css → vars-E22LYFMV.css} +88 -64
- package/package.json +61 -37
- package/dist/styles/focus-ring.ts +0 -84
|
@@ -1,199 +1,220 @@
|
|
|
1
|
-
# rel-resizable
|
|
2
|
-
|
|
3
|
-
`rel-resizable` is a three-element split-pane system: `<rel-resizable-group>` lays out its direct-child `<rel-resizable-panel>`s along one axis (`direction="horizontal"` side by side, `"vertical"` stacked) and lets the user drag or keyboard-nudge the `<rel-resizable-handle>` between two neighbours to trade percentage size between them, within each panel's `
|
|
4
|
-
|
|
5
|
-
## Usage
|
|
6
|
-
|
|
7
|
-
```html
|
|
8
|
-
<!-- Horizontal split (default direction) -->
|
|
9
|
-
<rel-resizable-group direction="horizontal" style="height: 320px;">
|
|
10
|
-
<rel-resizable-panel
|
|
11
|
-
<h3>Left</h3>
|
|
12
|
-
</rel-resizable-panel>
|
|
13
|
-
<rel-resizable-handle></rel-resizable-handle>
|
|
14
|
-
<rel-resizable-panel
|
|
15
|
-
<h3>Right</h3>
|
|
16
|
-
</rel-resizable-panel>
|
|
17
|
-
</rel-resizable-group>
|
|
18
|
-
|
|
19
|
-
<!-- Vertical split: the group needs an explicit height to divide -->
|
|
20
|
-
<rel-resizable-group direction="vertical" style="height: 480px;">
|
|
21
|
-
<rel-resizable-panel
|
|
22
|
-
<rel-resizable-handle></rel-resizable-handle>
|
|
23
|
-
<rel-resizable-panel
|
|
24
|
-
</rel-resizable-group>
|
|
25
|
-
|
|
26
|
-
<!-- Constraints: percentages of the group -->
|
|
27
|
-
<rel-resizable-group style="height: 320px;">
|
|
28
|
-
<rel-resizable-panel
|
|
29
|
-
<rel-resizable-handle></rel-resizable-handle>
|
|
30
|
-
<rel-resizable-panel
|
|
31
|
-
</rel-resizable-group>
|
|
32
|
-
|
|
33
|
-
<!-- Nested: a vertical group inside the right panel of a horizontal one -->
|
|
34
|
-
<rel-resizable-group direction="horizontal" style="height: 480px;">
|
|
35
|
-
<rel-resizable-panel
|
|
36
|
-
<rel-resizable-handle></rel-resizable-handle>
|
|
37
|
-
<rel-resizable-panel
|
|
38
|
-
<rel-resizable-group direction="vertical">
|
|
39
|
-
<rel-resizable-panel
|
|
40
|
-
<rel-resizable-handle></rel-resizable-handle>
|
|
41
|
-
<rel-resizable-panel
|
|
42
|
-
</rel-resizable-group>
|
|
43
|
-
</rel-resizable-panel>
|
|
44
|
-
</rel-resizable-group>
|
|
45
|
-
|
|
46
|
-
<!--
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
<rel-resizable-
|
|
50
|
-
<rel-resizable-
|
|
51
|
-
</rel-resizable-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
</
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
|
142
|
-
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
|
148
|
-
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
|
159
|
-
|
|
|
160
|
-
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
|
165
|
-
| --- | --- |
|
|
166
|
-
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
|
179
|
-
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
|
184
|
-
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
##
|
|
190
|
-
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
-
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
-
|
|
197
|
-
-
|
|
198
|
-
|
|
199
|
-
|
|
1
|
+
# rel-resizable
|
|
2
|
+
|
|
3
|
+
`rel-resizable` is a three-element split-pane system: `<rel-resizable-group>` lays out its direct-child `<rel-resizable-panel>`s along one axis (`direction="horizontal"` side by side, `"vertical"` stacked) and lets the user drag or keyboard-nudge the `<rel-resizable-handle>` between two neighbours to trade percentage size between them, within each panel's `min-size` / `max-size`. Use it for editor / preview splits, sidebar + content layouts and inspector panes where the user should control the proportions. It has no Figma component of its own; it follows the WAI-ARIA window-splitter pattern. It is not a general grid or an accordion — every panel stays visible and cannot be collapsed below its `min-size`.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<!-- Horizontal split (default direction) -->
|
|
9
|
+
<rel-resizable-group direction="horizontal" style="height: 320px;">
|
|
10
|
+
<rel-resizable-panel default-size="50">
|
|
11
|
+
<h3>Left</h3>
|
|
12
|
+
</rel-resizable-panel>
|
|
13
|
+
<rel-resizable-handle></rel-resizable-handle>
|
|
14
|
+
<rel-resizable-panel default-size="50">
|
|
15
|
+
<h3>Right</h3>
|
|
16
|
+
</rel-resizable-panel>
|
|
17
|
+
</rel-resizable-group>
|
|
18
|
+
|
|
19
|
+
<!-- Vertical split: the group needs an explicit height to divide -->
|
|
20
|
+
<rel-resizable-group direction="vertical" style="height: 480px;">
|
|
21
|
+
<rel-resizable-panel default-size="40">Top</rel-resizable-panel>
|
|
22
|
+
<rel-resizable-handle></rel-resizable-handle>
|
|
23
|
+
<rel-resizable-panel default-size="60">Bottom</rel-resizable-panel>
|
|
24
|
+
</rel-resizable-group>
|
|
25
|
+
|
|
26
|
+
<!-- Constraints: percentages of the group -->
|
|
27
|
+
<rel-resizable-group style="height: 320px;">
|
|
28
|
+
<rel-resizable-panel default-size="30" min-size="20" max-size="50">Sidebar</rel-resizable-panel>
|
|
29
|
+
<rel-resizable-handle></rel-resizable-handle>
|
|
30
|
+
<rel-resizable-panel default-size="70">Main</rel-resizable-panel>
|
|
31
|
+
</rel-resizable-group>
|
|
32
|
+
|
|
33
|
+
<!-- Nested: a vertical group inside the right panel of a horizontal one -->
|
|
34
|
+
<rel-resizable-group direction="horizontal" style="height: 480px;">
|
|
35
|
+
<rel-resizable-panel default-size="33">Sidebar</rel-resizable-panel>
|
|
36
|
+
<rel-resizable-handle></rel-resizable-handle>
|
|
37
|
+
<rel-resizable-panel default-size="67">
|
|
38
|
+
<rel-resizable-group direction="vertical">
|
|
39
|
+
<rel-resizable-panel default-size="50">Editor</rel-resizable-panel>
|
|
40
|
+
<rel-resizable-handle></rel-resizable-handle>
|
|
41
|
+
<rel-resizable-panel default-size="50">Preview</rel-resizable-panel>
|
|
42
|
+
</rel-resizable-group>
|
|
43
|
+
</rel-resizable-panel>
|
|
44
|
+
</rel-resizable-group>
|
|
45
|
+
|
|
46
|
+
<!-- Scrollable panel (new in 1.5.0): while the content overflows, the panel is a
|
|
47
|
+
focusable region named by panel-label, so keyboard users can scroll it -->
|
|
48
|
+
<rel-resizable-group style="height: 240px;">
|
|
49
|
+
<rel-resizable-panel default-size="30" panel-label="Shipment list">…long list…</rel-resizable-panel>
|
|
50
|
+
<rel-resizable-handle aria-label="Resize shipment list"></rel-resizable-handle>
|
|
51
|
+
<rel-resizable-panel default-size="70">Details</rel-resizable-panel>
|
|
52
|
+
</rel-resizable-group>
|
|
53
|
+
|
|
54
|
+
<!-- Listening for size changes -->
|
|
55
|
+
<rel-resizable-group id="split" style="height: 320px;">
|
|
56
|
+
<rel-resizable-panel>A</rel-resizable-panel>
|
|
57
|
+
<rel-resizable-handle></rel-resizable-handle>
|
|
58
|
+
<rel-resizable-panel>B</rel-resizable-panel>
|
|
59
|
+
</rel-resizable-group>
|
|
60
|
+
<script>
|
|
61
|
+
const split = document.getElementById('split');
|
|
62
|
+
// fires continuously while dragging
|
|
63
|
+
split.addEventListener('rel-resize', (e) => console.log(e.detail.sizes));
|
|
64
|
+
// fires once per drag, and after every keyboard step — good for persisting
|
|
65
|
+
split.addEventListener('rel-resize-end', (e) => localStorage.setItem('split', JSON.stringify(e.detail.sizes)));
|
|
66
|
+
</script>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Deprecated aliases
|
|
70
|
+
|
|
71
|
+
```html
|
|
72
|
+
<!-- defaultsize / minsize / maxsize → default-size / min-size / max-size (since 1.5.0; still work,
|
|
73
|
+
log a one-time console notice, removed in 3.0) -->
|
|
74
|
+
<rel-resizable-panel defaultsize="30" minsize="20" maxsize="50">Sidebar</rel-resizable-panel>
|
|
75
|
+
<rel-resizable-panel default-size="30" min-size="20" max-size="50">Sidebar</rel-resizable-panel>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
<!-- readme-gen:start -->
|
|
79
|
+
|
|
80
|
+
<!-- Generated from rel-resizable-group.ts, rel-resizable-handle.ts, rel-resizable-panel.ts — do not edit; run readme-generate.mjs -->
|
|
81
|
+
|
|
82
|
+
## Elements
|
|
83
|
+
|
|
84
|
+
| Element | Class | Source |
|
|
85
|
+
| --- | --- | --- |
|
|
86
|
+
| `<rel-resizable-group>` | `RelResizableGroup` | `rel-resizable-group.ts` |
|
|
87
|
+
| `<rel-resizable-handle>` | `RelResizableHandle` | `rel-resizable-handle.ts` |
|
|
88
|
+
| `<rel-resizable-panel>` | `RelResizablePanel` | `rel-resizable-panel.ts` |
|
|
89
|
+
|
|
90
|
+
## API
|
|
91
|
+
|
|
92
|
+
### `<rel-resizable-group>`
|
|
93
|
+
|
|
94
|
+
#### Attributes / Properties
|
|
95
|
+
|
|
96
|
+
| Property | Attribute | Type | Default | Description |
|
|
97
|
+
| --- | --- | --- | --- | --- |
|
|
98
|
+
| `direction` | `direction` | `"horizontal" \| "vertical"` | `"horizontal"` | Layout axis: `horizontal` places panels side by side and resizes widths, `vertical` stacks them and resizes heights; also pushed to every child handle's `orientation`. Reflected. |
|
|
99
|
+
|
|
100
|
+
### Events
|
|
101
|
+
|
|
102
|
+
| Event | Detail | Bubbles / composed | Description |
|
|
103
|
+
| --- | --- | --- | --- |
|
|
104
|
+
| `rel-resize` | `{ direction: this.direction, sizes, }` | bubbles / composed | Fired continuously while a handle is dragged. Detail: `{ direction, sizes: number[] }` with one percentage per panel. |
|
|
105
|
+
| `rel-resize-end` | `{ direction: this.direction, sizes, }` | bubbles / composed | Fired once when a drag ends (pointerup) and after every keyboard resize step. Detail: `{ direction, sizes: number[] }` with one percentage per panel. |
|
|
106
|
+
|
|
107
|
+
### Slots
|
|
108
|
+
|
|
109
|
+
| Slot | Description |
|
|
110
|
+
| --- | --- |
|
|
111
|
+
| (default) | The panels and handles, as direct children in display order (panel, handle, panel, …) |
|
|
112
|
+
|
|
113
|
+
### CSS Parts
|
|
114
|
+
|
|
115
|
+
| Part | Description |
|
|
116
|
+
| --- | --- |
|
|
117
|
+
| — | None exposed. |
|
|
118
|
+
|
|
119
|
+
### `<rel-resizable-handle>`
|
|
120
|
+
|
|
121
|
+
#### Attributes / Properties
|
|
122
|
+
|
|
123
|
+
| Property | Attribute | Type | Default | Description |
|
|
124
|
+
| --- | --- | --- | --- | --- |
|
|
125
|
+
| `orientation` | `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | Axis the handle separates: `horizontal` = 8px-wide vertical bar with `col-resize` cursor, `vertical` = 8px-tall bar with `row-resize`; set automatically from the parent group's `direction` on first render and mirrored to `aria-orientation`. Reflected. |
|
|
126
|
+
|
|
127
|
+
#### Public fields / accessors
|
|
128
|
+
|
|
129
|
+
| Name | Type | Description |
|
|
130
|
+
| --- | --- | --- |
|
|
131
|
+
| `splitValue` | `number` | Current split of the two neighbouring panels as a percentage 0–100 (share held by the leading panel); read-only — the parent group updates it and mirrors it to `aria-valuenow`. |
|
|
132
|
+
|
|
133
|
+
### Events
|
|
134
|
+
|
|
135
|
+
| Event | Detail | Bubbles / composed | Description |
|
|
136
|
+
| --- | --- | --- | --- |
|
|
137
|
+
| — | — | — | This element emits no custom events. |
|
|
138
|
+
|
|
139
|
+
### Slots
|
|
140
|
+
|
|
141
|
+
| Slot | Description |
|
|
142
|
+
| --- | --- |
|
|
143
|
+
| — | This element has no slots. |
|
|
144
|
+
|
|
145
|
+
### CSS Parts
|
|
146
|
+
|
|
147
|
+
| Part | Description |
|
|
148
|
+
| --- | --- |
|
|
149
|
+
| — | None exposed. |
|
|
150
|
+
|
|
151
|
+
### `<rel-resizable-panel>`
|
|
152
|
+
|
|
153
|
+
#### Attributes / Properties
|
|
154
|
+
|
|
155
|
+
| Property | Attribute | Type | Default | Description |
|
|
156
|
+
| --- | --- | --- | --- | --- |
|
|
157
|
+
| `defaultSize` | `default-size` | `number` | `undefined` | Initial size as a percentage of the group; panels without one share whatever is left of 100%, then all sizes are normalised to sum to 100. The `defaultsize` attribute spelling is deprecated (still works; removal targeted for 3.0). |
|
|
158
|
+
| `minSize` | `min-size` | `number` | `10` | Smallest size (percentage) the panel can be resized to. The `minsize` attribute spelling is deprecated (still works; removal targeted for 3.0). |
|
|
159
|
+
| `maxSize` | `max-size` | `number` | `90` | Largest size (percentage) the panel can be resized to. The `maxsize` attribute spelling is deprecated (still works; removal targeted for 3.0). |
|
|
160
|
+
| `panelLabel` | `panel-label` | `string` | `undefined` | New in 1.5.0. Accessible name the panel carries while its content overflows (it is then a focusable `role="region"`). Defaults to "Panel N", N being its position among the group's panels. Ignored when the page sets its own `aria-label` / `aria-labelledby`. |
|
|
161
|
+
|
|
162
|
+
#### Public fields / accessors
|
|
163
|
+
|
|
164
|
+
| Name | Type | Description |
|
|
165
|
+
| --- | --- | --- |
|
|
166
|
+
| `currentSize` | `number` | Current size as a percentage of the group (also written to the host's `flex-basis`); read-only — the parent group updates it on every resize. |
|
|
167
|
+
| `scrollable` | `boolean` | True while the content overflows the panel in either axis; read-only, kept current by a ResizeObserver. |
|
|
168
|
+
|
|
169
|
+
### Events
|
|
170
|
+
|
|
171
|
+
| Event | Detail | Bubbles / composed | Description |
|
|
172
|
+
| --- | --- | --- | --- |
|
|
173
|
+
| — | — | — | This element emits no custom events. |
|
|
174
|
+
|
|
175
|
+
### Slots
|
|
176
|
+
|
|
177
|
+
| Slot | Description |
|
|
178
|
+
| --- | --- |
|
|
179
|
+
| (default) | The panel's content; slotted `h1`–`h4` get the headings-md role |
|
|
180
|
+
|
|
181
|
+
### CSS Parts
|
|
182
|
+
|
|
183
|
+
| Part | Description |
|
|
184
|
+
| --- | --- |
|
|
185
|
+
| — | None exposed. |
|
|
186
|
+
|
|
187
|
+
<!-- readme-gen:end -->
|
|
188
|
+
|
|
189
|
+
## Accessibility
|
|
190
|
+
|
|
191
|
+
- Each `<rel-resizable-handle>` makes itself focusable (`tabindex="0"`) and takes `role="separator"` with `aria-orientation` mirroring its `orientation`. The group writes `aria-valuenow` (the leading panel's share of the pair, rounded, 0–100), `aria-valuemin="0"` and `aria-valuemax="100"` on first render and after every resize, so assistive technology can read the current split before and after any interaction.
|
|
192
|
+
- Handles have no accessible name of their own; when several handles are on a page add `aria-label` to each (e.g. `aria-label="Resize sidebar"`).
|
|
193
|
+
- The group sets no role and is not focusable. Panels are `overflow: auto`, and any interactive content inside keeps its own tab order.
|
|
194
|
+
- Scrollable panels (new in 1.5.0): while a panel's content overflows it (either axis), the panel gets `tabindex="0"`, `role="region"` and an `aria-label` (`panel-label`, default "Panel 1", "Panel 2"… by position), so a keyboard user can Tab to it and scroll with the arrow keys, Page Up / Page Down and Home / End. Focus shows a 2px `--rel-border-focus` ring drawn inside the panel edge (the group clips anything outside), or the system highlight colour in forced-colors mode. When the content fits again (resized larger, content removed) all three are removed, so a panel that cannot scroll is never a dead tab stop; a panel that is focused at that moment keeps its tab stop until focus leaves. Overflow is re-measured on panel and content resizes and on content changes.
|
|
195
|
+
- A `tabindex` you set yourself is never changed or removed (including `-1`), and the panel then leaves `role` and `aria-label` to you as well. A `role` or `aria-label` / `aria-labelledby` you set is never overridden. Give each scrollable panel a distinct `panel-label` when the defaults would repeat (for example in nested groups, where each group numbers its panels from 1).
|
|
196
|
+
- A focused handle shows a 2px focus ring (`--rel-border-focus`) and a lighter background; hover and drag states change the background and grab-bar colours only.
|
|
197
|
+
- Keyboard resizing (handled by the group, on a focused handle):
|
|
198
|
+
|
|
199
|
+
| Key | Direction | Action |
|
|
200
|
+
| --- | --- | --- |
|
|
201
|
+
| `ArrowLeft` / `ArrowRight` | `horizontal` | Shrink / grow the leading panel by 2% (of the group). |
|
|
202
|
+
| `ArrowUp` / `ArrowDown` | `vertical` | Shrink / grow the leading panel by 2%. |
|
|
203
|
+
| `Shift` + arrow | either | Same, in 5% steps. |
|
|
204
|
+
| `Home` | either | Collapse the leading panel to its `min-size` (as far as the neighbour allows). |
|
|
205
|
+
| `End` | either | Grow the leading panel to its `max-size` (as far as the neighbour allows). |
|
|
206
|
+
|
|
207
|
+
- Every keyboard step dispatches `rel-resize-end` (not `rel-resize`).
|
|
208
|
+
- Motion: the handle's background transitions are removed under `prefers-reduced-motion: reduce`.
|
|
209
|
+
|
|
210
|
+
## Notes / Edge Cases
|
|
211
|
+
|
|
212
|
+
- Panels and handles must be **direct children** of the group (`:scope > rel-resizable-panel`), alternating panel / handle / panel. A handle at the start or end, or two handles in a row, has no valid pair and does nothing.
|
|
213
|
+
- Layout is computed once in `firstUpdated`: panels without `default-size` share whatever remains of 100%, then all sizes are normalised to sum to exactly 100 (so `default-size="50"` + `default-size="70"` ends up as 41.7 / 58.3). Panels or handles added or removed later are **not** observed; re-attach the group to re-initialise.
|
|
214
|
+
- Sizes are always percentages of the group, applied as `flex-basis` with `flex-grow: 0; flex-shrink: 0`. The group itself is `display: flex; width: 100%; height: 100%`, so a `vertical` group needs an ancestor with a definite height or it has nothing to divide.
|
|
215
|
+
- Only the two panels adjacent to the dragged handle change; each is clamped to its own `min-size` / `max-size`, then the pair is rescaled so their combined share stays constant. A panel therefore cannot go below its `min-size` (default 10) and never collapses to 0 unless you set `min-size="0"`.
|
|
216
|
+
- Attribute names are kebab-case: `default-size`, `min-size`, `max-size` (properties `defaultSize`, `minSize`, `maxSize`). The older lowercase spellings still work since 1.5.0 but log a one-time console notice and are removed in 3.0; see Deprecated aliases.
|
|
217
|
+
- While a drag is in progress the active handle carries a `data-dragging` attribute (the group sets and removes it) — the only hook for drag-specific styling from outside.
|
|
218
|
+
- Each handle's `orientation` is overwritten from the group's `direction` on first render; set `direction` on the group, not `orientation` on the handles.
|
|
219
|
+
- `rel-resize` fires on every pointer move during a drag; throttle any expensive listener. `rel-resize-end` fires once on pointer-up and after each keyboard step; both carry `{ direction, sizes }` where `sizes[i]` is panel *i*'s current percentage.
|
|
220
|
+
- Nested groups work because the inner group is ordinary panel content; pointer events are handled by the nearest group whose handle is in the event's composed path.
|