@jsenv/navi 0.29.387 → 0.29.388
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/README.md +4 -4
- package/dist/dev/jsenv_navi.js +400 -310
- package/dist/dev/jsenv_navi.js.map +72 -72
- package/dist/dev/jsenv_navi_side_effects.js.map +1 -1
- package/dist/jsenv_navi.js +396 -306
- package/dist/jsenv_navi.js.map +72 -72
- package/dist/jsenv_navi_side_effects.js.map +1 -1
- package/docs/AI_INSTRUCTIONS.md +39 -23
- package/docs/actions.md +6 -4
- package/docs/autofocus.md +2 -1
- package/docs/badge_list.md +5 -3
- package/docs/control_group.md +4 -3
- package/docs/control_object.md +1 -1
- package/docs/control_value.md +8 -9
- package/docs/css_architecture.md +16 -14
- package/docs/dialog_shape.md +12 -8
- package/docs/drag_interactions.md +44 -36
- package/docs/drag_to_travel.md +29 -23
- package/docs/dynamic_import.md +7 -5
- package/docs/error_handling.md +26 -27
- package/docs/field_validation.md +35 -6
- package/docs/interactions.md +28 -23
- package/docs/list_action.md +8 -5
- package/docs/list_refresh.md +7 -1
- package/docs/mobile_layout_pitfalls.md +6 -5
- package/docs/navigation.md +7 -5
- package/docs/network_policy.md +10 -3
- package/docs/pan_zoom.md +2 -2
- package/docs/popup_backdrop.md +11 -5
- package/docs/popup_lift.md +5 -3
- package/docs/popup_open.md +39 -28
- package/docs/resource.md +24 -17
- package/docs/route_transitions.md +13 -10
- package/docs/safe_area.md +38 -22
- package/docs/scroll.md +11 -9
- package/docs/testid.md +10 -1
- package/docs/typography.md +2 -3
- package/docs/view_transitions.md +9 -9
- package/docs/z_index.md +6 -5
- package/package.json +2 -2
package/docs/testid.md
CHANGED
|
@@ -85,7 +85,9 @@ found by nothing, while the host is what the user focuses and what
|
|
|
85
85
|
`getByRole(role, { name })` and `getByLabel()` read.
|
|
86
86
|
|
|
87
87
|
```jsx
|
|
88
|
-
<Picker variant="icon" aria-label="Aide" ui={<Icon>…</Icon>}
|
|
88
|
+
<Picker variant="icon" aria-label="Aide" ui={<Icon>…</Icon>}>
|
|
89
|
+
…
|
|
90
|
+
</Picker>
|
|
89
91
|
```
|
|
90
92
|
|
|
91
93
|
```html
|
|
@@ -122,6 +124,13 @@ error message, a section, a row — put the testid on the surrounding component
|
|
|
122
124
|
(`<Field data-testid="email-field">`, `<Box data-testid="cart-row">`); anything
|
|
123
125
|
built on `Box` forwards it to its own element.
|
|
124
126
|
|
|
127
|
+
A selectable `List.Item` is a control too, and the rule holds there with a
|
|
128
|
+
consequence worth knowing: its host is the real checkbox or radio the row
|
|
129
|
+
selects with, an input navi draws invisible (`navi-visually-hidden`) and lays
|
|
130
|
+
under the row's content. A `data-testid` on the item names that input — what
|
|
131
|
+
`toBeChecked()` reads, not what the eye sees. A test that presses the row, or
|
|
132
|
+
waits for it to show, targets what the row draws: a testid on its content.
|
|
133
|
+
|
|
125
134
|
A picker's popup is the one element the application does not render itself:
|
|
126
135
|
`<Picker>` builds it, so a `data-testid` on the picker names the trigger and
|
|
127
136
|
nothing names the popup. `popupTestId` does:
|
package/docs/typography.md
CHANGED
|
@@ -84,7 +84,7 @@ The prop is the same everywhere: a number of lines, cut with an ellipsis.
|
|
|
84
84
|
- **`Picker`** — its value, `maxLines={1}` by default; `variant="text"` and
|
|
85
85
|
`variant="bare"` draw the caller's own thing and are not clamped, a `Text` in
|
|
86
86
|
their `ui` cuts itself with its own `maxLines`.
|
|
87
|
-
- **`
|
|
87
|
+
- **`Spin`** (`DaySpin`, `NumberSpin`…) — its value; left out, a long value
|
|
88
88
|
wraps and the box grows.
|
|
89
89
|
- **`Binder`** — its tab labels, `maxLines={1}` by default, `false` lets them
|
|
90
90
|
wrap; overridable per item.
|
|
@@ -104,9 +104,8 @@ width must say it too**, or the whole chain grows instead of truncating:
|
|
|
104
104
|
|
|
105
105
|
```jsx
|
|
106
106
|
<Box flex width="300" spacing="s">
|
|
107
|
+
{/* without minWidth the row just grows */}
|
|
107
108
|
<Box flex expandX minWidth="0">
|
|
108
|
-
{" "}
|
|
109
|
-
{/* without minWidth the row just grows */}
|
|
110
109
|
<Text maxLines={1}>…</Text>
|
|
111
110
|
</Box>
|
|
112
111
|
</Box>
|
package/docs/view_transitions.md
CHANGED
|
@@ -75,15 +75,6 @@ does not handle a rejection, an unhandled one is what it leaves behind, and
|
|
|
75
75
|
`.then(done, done)` is the shape that ends it whichever way it went — while a
|
|
76
76
|
`ready` waiter must expect the skip: `ready.then(onPictures, () => {})`.
|
|
77
77
|
|
|
78
|
-
## See also
|
|
79
|
-
|
|
80
|
-
- [route_transitions.md](./route_transitions.md) — pages moving against each
|
|
81
|
-
other on navigation
|
|
82
|
-
- [drag_to_travel.md](./drag_to_travel.md) — a transition held under a finger,
|
|
83
|
-
and what the main thread cannot read of it
|
|
84
|
-
- [drag_interactions.md](./drag_interactions.md#naming-what-travels) — naming
|
|
85
|
-
what moves when something is dropped on a place
|
|
86
|
-
|
|
87
78
|
## The top layer is painted through the root's picture
|
|
88
79
|
|
|
89
80
|
A modal `<dialog>`, its `::backdrop`, a popover: the browser paints the top
|
|
@@ -137,3 +128,12 @@ Two consequences for the switch itself:
|
|
|
137
128
|
`display` on: hidden before the call, a stand-in measures as a zero rect and
|
|
138
129
|
lands in the wrong place; and on the capture frame it is displayed while the
|
|
139
130
|
real thing is still there.
|
|
131
|
+
|
|
132
|
+
## See also
|
|
133
|
+
|
|
134
|
+
- [route_transitions.md](./route_transitions.md) — pages moving against each
|
|
135
|
+
other on navigation
|
|
136
|
+
- [drag_to_travel.md](./drag_to_travel.md) — a transition held under a finger,
|
|
137
|
+
and what the main thread cannot read of it
|
|
138
|
+
- [drag_interactions.md](./drag_interactions.md#naming-what-travels) — naming
|
|
139
|
+
what moves when something is dropped on a place
|
package/docs/z_index.md
CHANGED
|
@@ -77,6 +77,7 @@ which band it came from.
|
|
|
77
77
|
| Band | Token | Value |
|
|
78
78
|
| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ---------------------------- |
|
|
79
79
|
| Top layer (`Dialog`/`Popover` with `layer="top"`) | — | above everything |
|
|
80
|
+
| A modal's wall painted into the page for the length of a route transition, standing in for the top layer | `--navi-z-index-top-layer` | 10000 |
|
|
80
81
|
| `Dialog`/`Popover` with `layer="local"`, their backdrop, callouts | `--navi-z-index-popup`, `--navi-z-index-callout` | 1000 `+ stack order` |
|
|
81
82
|
| `FixedBar` | `--navi-z-index-bar` | 100 |
|
|
82
83
|
| Sticky while something scrolls under: `List` header/footer/group labels, `SidePanel` head/foot, `Box` header/footer, `<Box sticky>` | `--navi-z-index-sticky` | 10 |
|
|
@@ -103,7 +104,7 @@ What to read from it:
|
|
|
103
104
|
the second half of that sentence is a condition, not decoration. A `List` group
|
|
104
105
|
label at rest is a block in the flow: nothing passes under it, and painting it
|
|
105
106
|
at 10 there is what slices a focus ring, a badge or a stamp that a neighbouring
|
|
106
|
-
row lets out of its box — including a `Group` member raising itself to 1 or
|
|
107
|
+
row lets out of its box — including a `Group` member raising itself to 1, 2 or 3.
|
|
107
108
|
|
|
108
109
|
CSS cannot express the condition. There is no `:stuck`, and
|
|
109
110
|
`@container scroll-state(stuck: top)` styles a container's **descendants**, so
|
|
@@ -164,7 +165,7 @@ page raised passes in front of it — a `Group` member holding focus is at 2, so
|
|
|
164
165
|
it is seen crossing a submit bar the box was written to keep last. DOM order
|
|
165
166
|
cannot answer that (2 beats `auto` whatever the order) and `isolation: isolate`
|
|
166
167
|
neither (the common parent holds both, isolating it does not reorder them), so
|
|
167
|
-
|
|
168
|
+
without the band the app would have no move left but a literal of its own.
|
|
168
169
|
|
|
169
170
|
An explicit `zIndex` wins, `zIndex="auto"` included — the way
|
|
170
171
|
`--box-header-z-index` writes the band back at a call site that knows better:
|
|
@@ -181,10 +182,10 @@ to paint over its neighbour — otherwise its focus ring is sliced in half by th
|
|
|
181
182
|
member that comes after it in the DOM. DOM order cannot express "whichever one
|
|
182
183
|
is hovered", so this is a legitimate `z-index`.
|
|
183
184
|
|
|
184
|
-
`isolation: isolate` on the group would contain those
|
|
185
|
+
`isolation: isolate` on the group would contain those values, but it would
|
|
185
186
|
also contain the popup of a `Picker` held in the group: its 1000 would become
|
|
186
187
|
local, and the popup would be capped inside the group instead of covering the
|
|
187
|
-
page. So the group is deliberately not isolated, and what keeps its 1 and
|
|
188
|
+
page. So the group is deliberately not isolated, and what keeps its 1, 2 and 3
|
|
188
189
|
harmless is the scale above them.
|
|
189
190
|
|
|
190
191
|
## A card that stacks three layers with no `z-index`
|
|
@@ -209,4 +210,4 @@ above everything — DOM order alone, in painting order:
|
|
|
209
210
|
The only positioning trick here is `position: relative` on the content: a
|
|
210
211
|
positioned element paints above a non-positioned one regardless of order, so
|
|
211
212
|
the content has to be positioned too to stay above the cover link. `isolation`
|
|
212
|
-
is there for what the card's children may do later, not for this
|
|
213
|
+
is there for what the card's children may do later, not for this example.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/navi",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.388",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Library of components including navigation to create frontend applications",
|
|
6
6
|
"repository": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"preact": "^11.0.0-rc.2"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@jsenv/dom": "0.17.
|
|
37
|
+
"@jsenv/dom": "0.17.72",
|
|
38
38
|
"@jsenv/humanize": "1.8.5",
|
|
39
39
|
"@jsenv/validity": "0.4.5"
|
|
40
40
|
},
|