@fusion.dev/helix-docs 0.143.0 → 0.144.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/content/accessibility.mdx +7 -0
- package/content/building-on-the-headless-tier.mdx +2 -1
- package/content/localization.mdx +12 -0
- package/content/metrics.mdx +223 -223
- package/content/overlays.mdx +29 -2
- package/dist/sources.generated.js +273 -226
- package/package.json +9 -9
package/content/overlays.mdx
CHANGED
|
@@ -81,8 +81,15 @@ to the element that opened it. `Dialog` does this, and so does `Drawer` unless
|
|
|
81
81
|
you set `modal="false"`. The page behind a modal `Dialog` or `Drawer` does not
|
|
82
82
|
scroll while it is open.
|
|
83
83
|
|
|
84
|
-
`Popover`
|
|
85
|
-
panel,
|
|
84
|
+
Opening a `Popover` moves focus to the first control in its panel, or to the
|
|
85
|
+
panel where it holds none, and closing it from inside gives focus back to the
|
|
86
|
+
trigger. It does not trap focus unless you set `modal`, which keeps `Tab` in the
|
|
87
|
+
panel until it closes. When focus moves out of its trigger and its panel, the
|
|
88
|
+
popover closes.
|
|
89
|
+
|
|
90
|
+
Press F8 to move focus to the `Toast` stack, and press it again to go back.
|
|
91
|
+
Set `hotkey` on the stack to use another key. The stack's name says which key
|
|
92
|
+
it is.
|
|
86
93
|
|
|
87
94
|
The fields with a panel behave the same way:
|
|
88
95
|
|
|
@@ -95,6 +102,12 @@ The fields with a panel behave the same way:
|
|
|
95
102
|
**A tooltip never takes focus.** A tooltip only describes a control, so it
|
|
96
103
|
cannot contain a button. For something with a button in it, use a `Popover`.
|
|
97
104
|
|
|
105
|
+
A tooltip describes its trigger by itself, whether it wraps the trigger or
|
|
106
|
+
names it with `for`. A Helix trigger is described as soon as it has rendered.
|
|
107
|
+
A plain element in your markup is described the first time a reader points at
|
|
108
|
+
it or focuses it, so the link is never written into markup your server sent.
|
|
109
|
+
Write `aria-describedby` yourself to have the link in the server's markup.
|
|
110
|
+
|
|
98
111
|
## Keep an overlay open
|
|
99
112
|
|
|
100
113
|
An overlay sends `helix-before-close` before it closes. Cancel the event to keep
|
|
@@ -118,6 +131,20 @@ on the `overlay` and `display` properties, which allows an exit animation on an
|
|
|
118
131
|
element the browser is about to remove from the top layer. Every overlay
|
|
119
132
|
responds to `prefers-reduced-motion`.
|
|
120
133
|
|
|
134
|
+
`Dialog` and `Drawer` also say where they are in the journey:
|
|
135
|
+
`:state(entering)` holds from the moment they open until their entrance has
|
|
136
|
+
finished, and `:state(exiting)` from the moment they close until their exit has
|
|
137
|
+
finished. Select on them to draw an entrance or an exit of your own.
|
|
138
|
+
|
|
139
|
+
## Swiping an overlay away
|
|
140
|
+
|
|
141
|
+
A touch or a pen swipes a `Drawer` toward the edge it came from, and a `Toast`
|
|
142
|
+
message toward the end of the line. A swipe past halfway, or a quick one, closes
|
|
143
|
+
it through the same cancelable request as its close control. A `Drawer` with
|
|
144
|
+
`snap-points` comes to rest at the nearest point, such as half open. In a
|
|
145
|
+
`Lightbox`, a swipe across the viewer shows the next or the previous item. A
|
|
146
|
+
mouse never swipes, because dragging with a mouse selects text.
|
|
147
|
+
|
|
121
148
|
## Choose an overlay
|
|
122
149
|
|
|
123
150
|
| Component | Use it for |
|