@aurodesignsystem-dev/auro-popover 0.0.0-pr140.0 → 0.0.0-pr141.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/demo/api.md CHANGED
@@ -3,40 +3,54 @@
3
3
 
4
4
  # auro-popover
5
5
 
6
- The `auro-popover` element attaches to another element and displays on hover.
6
+ Shows short supporting content next to a trigger when someone hovers over, focuses, or taps it.
7
+
8
+ **Key capabilities**
9
+
10
+ - **Keyboard and screen reader support**: A trigger that can't take focus is made reachable with the keyboard, and screen readers announce the popover text as the trigger's description.
11
+ - **Placement**: The popover appears above the trigger by default, or below it with `placement="bottom"`.
12
+ - **Turn off**: The `disabled` attribute stops the popover from showing.
13
+ - **Restyling**: The `popover`, `arrow`, and `trigger` CSS parts let you restyle the bubble, its arrow, and the trigger wrapper.
7
14
 
8
- ### Properties & Attributes
9
-
10
- | Properties | Attributes | Modifiers | Type | Default | Description |
11
- | ----------- | ----------- | --------- | ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
12
- | addSpace | addspace | | boolean | | Adds additional top and bottom space around the appearance of the popover in relation to the trigger. |
13
- | boundary | boundary | | string \| object | | The element to use as the boundary for the popover. Can be a query selector or an HTML element. |
14
- | disabled | disabled | | boolean | | Disables the popover from showing on hover and focus. |
15
- | for | for | | string | | Directly associates the popover with a trigger element with the given ID. In most cases, this should not be necessary and set `slot="trigger"` on the element instead. |
16
- | placement | placement | | string | `top` | Position for popover in relation to the element {'top' \| 'bottom'}. |
17
- | removeSpace | removespace | | boolean | | Removes top and bottom space around the appearance of the popover in relation to the trigger. |
18
- | | data-show | | boolean | `false` | Whether the popover is currently visible. Reflected as the `data-show`<br>attribute so host-level CSS selectors (e.g. `:host([data-show])`) work.<br>Also drives `aria-hidden` on the popover div in the template. |
15
+ ### Properties and attributes
16
+
17
+ | Properties | Attributes | Modifiers | Type | Default | Description |
18
+ | ----------- | ----------- | --------- | ---------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
19
+ | addSpace | addspace | | boolean | | Adds more space between the popover and its trigger. When `removeSpace` is also set, `addSpace` takes effect. |
20
+ | boundary | boundary | | string \| object | | Sets the element that keeps the popover from overflowing, such as a selector string or an HTML element. |
21
+ | disabled | disabled | | boolean | | Turns the popover off. A disabled popover doesn't show on hover, focus, touch, or keyboard activation. |
22
+ | for | for | | string | | Sets the ID of the trigger element, for when the trigger can't use the `trigger` slot. In most cases, set `slot="trigger"` on the element instead. |
23
+ | placement | placement | | string | `top` | Sets where the popover appears in relation to its trigger. Use `top` (the default) or `bottom`. The popover flips to the opposite side when there isn't room. Changing this after the first render does not currently move the popover. |
24
+ | removeSpace | removespace | | boolean | | Reduces the space between the popover and its trigger, so the popover sits closer to it. Has no effect when `addSpace` is also set. |
19
25
 
20
26
  ### Methods
21
27
 
22
- | Name | Parameters | Return | Description |
23
- | -------- | -------------------------------------------------------------------- | ------ | ------------------------------------------------- |
24
- | register | `name` (string) - The name of the element that you want to register. | | This will register this element with the browser. |
28
+ | Name | Parameters | Return | Description |
29
+ | -------- | ------------------------------------------------------------- | ------ | -------------------------------------------------------- |
30
+ | register | `name` (string) - The tag name to register the element under. | | Registers the element with the browser under a tag name. |
25
31
 
26
32
  ### Slots
27
33
 
28
- | Name | Description |
29
- | --------- | ----------------------------------------------------------------- |
30
- | (default) | Default unnamed slot for the use of popover content |
31
- | trigger | The element in this slot triggers hiding and showing the popover. |
34
+ | Name | Description |
35
+ | --------- | ------------------------------------------------------------------------------------------------------------------- |
36
+ | (default) | The content shown in the popover. Screen readers announce its text as the trigger's description, so use plain text. |
37
+ | trigger | The element in this slot triggers hiding and showing the popover. |
38
+
39
+ ### CSS shadow parts
32
40
 
33
- ### CSS Shadow Parts
41
+ | Name | Description |
42
+ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
43
+ | arrow | The positioning anchor for the popover's arrow. The visible arrow shape is its `::before` pseudo-element, so target `::part(arrow)::before` to change color, shadow, or size. Popper sets the arrow's position, so don't override it through this part. |
44
+ | popover | The popover bubble that holds the content. |
45
+ | trigger | The wrapper around the `trigger` slot, useful for correcting alignment between the trigger and the popover. Empty when the `for` attribute is used, because the trigger then lives outside the component. |
34
46
 
35
- | Name | Description |
36
- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
37
- | arrow | Apply CSS to the arrow's positioning anchor. The visible arrow shape is its `::before` pseudo-element, so target `::part(arrow)::before` to restyle color, shadow, or size. Arrow position is set by Popper as inline styles and cannot be overridden through this part. |
38
- | popover | Apply CSS to the popover bubble container. |
39
- | trigger | Apply CSS to the wrapper around the trigger slot. Use to correct alignment between the trigger and the popover. Has no effect when the `for` attribute is used, as the trigger then lives outside the component and this wrapper is empty. |
47
+ ### CSS custom properties
48
+
49
+ | Name | Description |
50
+ | --------------------------------- | --------------------------------------- |
51
+ | --ds-auro-popover-boxshadow-color | Color of the shadow around the popover. |
52
+ | --ds-auro-popover-container-color | Background color of the popover. |
53
+ | --ds-auro-popover-text-color | Color of the popover text. |
40
54
  <!-- AURO-GENERATED-CONTENT:END -->
41
55
 
42
56
  ## Basic
@@ -46,7 +60,7 @@ The `auro-popover` element attaches to another element and displays on hover.
46
60
  <!-- The below content is automatically added from ./../apiExamples/basic.html -->
47
61
  <auro-popover>
48
62
  Top popover content!
49
- <auro-button slot="trigger">Popover Test</auro-button>
63
+ <auro-button slot="trigger">Popover test</auro-button>
50
64
  </auro-popover>
51
65
  <!-- AURO-GENERATED-CONTENT:END -->
52
66
  </div>
@@ -57,18 +71,18 @@ The `auro-popover` element attaches to another element and displays on hover.
57
71
 
58
72
  <pre class="language-html"><code class="language-html">&lt;auro-popover&gt;
59
73
  Top popover content!
60
- &lt;auro-button slot="trigger"&gt;Popover Test&lt;/auro-button&gt;
61
- &lt;/auro-popover&gt;</code></pre>
74
+ &lt;auro-button slot="trigger"&gt;Popover test&lt;/auro-button&gt;
75
+ &lt;/auro-popover&gt;</code></pre>
62
76
  <!-- AURO-GENERATED-CONTENT:END -->
63
77
  </auro-accordion>
64
78
 
65
79
  ## Apply popover to any type of content
66
80
 
67
- The trigger can be any element, not just buttons or links. The component automatically makes any non-focusable trigger keyboard accessible — including custom elements like `auro-icon` that have no internal focusable element. For icon-based triggers without visible text, `aria-label` is still required to provide an accessible name.
81
+ The trigger can be any element, not just buttons or links. The component automatically makes any non-focusable trigger keyboard accessible, including custom elements like `auro-icon` that have no internal focusable element. For icon-based triggers without visible text, `aria-label` is still required to provide an accessible name.
68
82
 
69
- > **Accessibility note:** `auro-popover` manages `aria-description` on the focusable element(s) within the trigger slot as part of its accessibility contract — the popover content becomes the trigger's accessible description so screen readers can announce it on focus. When the trigger is a non-focusable wrapper around focusable content (e.g. `<div><a href="#">link</a></div>`), the description is applied to each focusable descendant rather than the wrapper itself. Any existing `aria-description` on affected elements will be replaced when the component connects and removed when it disconnects.
83
+ > **Accessibility note:** `auro-popover` manages `aria-description` on the focusable elements within the trigger slot as part of its accessibility contract. The popover content becomes the trigger's accessible description, so screen readers announce it on focus. When the trigger is a non-focusable wrapper around focusable content, such as `<div><a href="#">link</a></div>`, the description is applied to each focusable descendant rather than the wrapper itself. The component replaces any existing `aria-description` on affected elements when it first renders and removes it when it disconnects.
70
84
  >
71
- > **Keyboard behavior:** Non-interactive triggers (e.g. `<abbr>`, `<auro-icon>`) are automatically made keyboard accessible with `tabindex="0"`. `Space` and `Enter` toggle the popover open and closed, ensuring keyboard-only users have parity with mouse/hover users. This is intentional — accessibility covers more than screen readers, and without activation semantics a keyboard-only user has no way to interact with a non-interactive trigger.
85
+ > **Keyboard behavior:** Non-interactive triggers, such as `<abbr>` and `<auro-icon>`, are automatically made keyboard accessible with `tabindex="0"`. `Space` and `Enter` toggle the popover open and closed, so keyboard-only users get the same access as mouse and hover users. Without activation semantics, a keyboard-only user has no way to interact with a non-interactive trigger.
72
86
 
73
87
  <div class="exampleWrapper">
74
88
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/non-interactive-triggers.html) -->
@@ -77,13 +91,13 @@ The trigger can be any element, not just buttons or links. The component automat
77
91
  adds tabindex. aria-label is still required to provide an accessible name. -->
78
92
  <auro-popover>
79
93
  This flight offers priority boarding.
80
- <auro-icon slot="trigger" category="interface" name="info-stroke" aria-label="More information"></auro-icon>
94
+ <auro-icon slot="trigger" category="interface" name="information-stroke" aria-label="More information"></auro-icon>
81
95
  </auro-popover>
82
96
  <br><br>
83
97
  <!-- Native elements like <abbr> are automatically made keyboard accessible by the component -->
84
98
  <p>Congratulations, you just achieved
85
99
  <auro-popover>
86
- Most Valuable Passenger — Alaska Airlines' mid-tier elite status level.
100
+ Most Valuable Passenger: Alaska Airlines' mid-tier elite status level.
87
101
  <abbr slot="trigger" style="color: orangered">MVP</abbr>
88
102
  </auro-popover> status!
89
103
  </p>
@@ -98,31 +112,31 @@ The trigger can be any element, not just buttons or links. The component automat
98
112
  adds tabindex. aria-label is still required to provide an accessible name. --&gt;
99
113
  &lt;auro-popover&gt;
100
114
  This flight offers priority boarding.
101
- &lt;auro-icon slot="trigger" category="interface" name="info-stroke" aria-label="More information"&gt;&lt;/auro-icon&gt;
102
- &lt;/auro-popover&gt;
103
- &lt;br&gt;&lt;br&gt;
104
- &lt;!-- Native elements like &lt;abbr&gt; are automatically made keyboard accessible by the component --&gt;
115
+ &lt;auro-icon slot="trigger" category="interface" name="information-stroke" aria-label="More information"&gt;&lt;/auro-icon&gt;
116
+ &lt;/auro-popover&gt;
117
+ &#10;&lt;br&gt;&lt;br&gt;
118
+ &#10;&lt;!-- Native elements like &lt;abbr&gt; are automatically made keyboard accessible by the component --&gt;
105
119
  &lt;p&gt;Congratulations, you just achieved
106
120
  &lt;auro-popover&gt;
107
- Most Valuable Passenger — Alaska Airlines' mid-tier elite status level.
121
+ Most Valuable Passenger: Alaska Airlines' mid-tier elite status level.
108
122
  &lt;abbr slot="trigger" style="color: orangered"&gt;MVP&lt;/abbr&gt;
109
123
  &lt;/auro-popover&gt; status!
110
- &lt;/p&gt;</code></pre>
124
+ &lt;/p&gt;</code></pre>
111
125
  <!-- AURO-GENERATED-CONTENT:END -->
112
126
  </auro-accordion>
113
127
 
114
- ## Property & Attribute Examples
128
+ ## Property and attribute examples
115
129
 
116
- ### Add Space Around Popover
130
+ ### Add space around popover
117
131
 
118
- Use the `addspace` attribute to add more space between the popover and it's trigger.
132
+ Use the `addspace` attribute to add more space between the popover and its trigger.
119
133
 
120
134
  <div class="exampleWrapper">
121
135
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/add-space.html) -->
122
136
  <!-- The below content is automatically added from ../apiExamples/add-space.html -->
123
137
  <auro-popover addspace>
124
138
  Notice this popover is a little<br>further away from the trigger.
125
- <auro-button slot="trigger">Popover w/additional space above</auro-button>
139
+ <auro-button slot="trigger">Popover with additional space above</auro-button>
126
140
  </auro-popover>
127
141
  <!-- AURO-GENERATED-CONTENT:END -->
128
142
  </div>
@@ -133,14 +147,14 @@ Use the `addspace` attribute to add more space between the popover and it's trig
133
147
 
134
148
  <pre class="language-html"><code class="language-html">&lt;auro-popover addspace&gt;
135
149
  Notice this popover is a little&lt;br&gt;further away from the trigger.
136
- &lt;auro-button slot="trigger"&gt;Popover w/additional space above&lt;/auro-button&gt;
137
- &lt;/auro-popover&gt;</code></pre>
150
+ &lt;auro-button slot="trigger"&gt;Popover with additional space above&lt;/auro-button&gt;
151
+ &lt;/auro-popover&gt;</code></pre>
138
152
  <!-- AURO-GENERATED-CONTENT:END -->
139
153
  </auro-accordion>
140
154
 
141
155
  ### Boundary
142
156
 
143
- Use the `boundary` property to set the overflow boundary for the `auro-popover`, shifting the x-axis of the `auro-popover`. This example demonstrates an `auro-popover` in a container without a `boundary` set vs an `auro-popover` in a container with a `boundary` set. The value passed to the `boundary` attribute can be a valid selector string or HTML Element.
157
+ Use the `boundary` property to keep the popover inside a container, shifting it horizontally when it would overflow. This example shows a popover in a container without a `boundary` and one in a container with a `boundary`. Set `boundary` to a selector string in HTML or JavaScript. To use an HTML element, set the property in JavaScript.
144
158
 
145
159
  <div class="exampleWrapper">
146
160
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/boundary.html) -->
@@ -172,14 +186,14 @@ Use the `boundary` property to set the overflow boundary for the `auro-popover`,
172
186
  Popover content!
173
187
  &lt;auro-button slot="trigger"&gt;Popover Test&lt;/auro-button&gt;
174
188
  &lt;/auro-popover&gt;
175
- &lt;/div&gt;
176
- &lt;strong&gt;Example with boundary set&lt;/strong&gt;
189
+ &lt;/div&gt;
190
+ &#10;&lt;strong&gt;Example with boundary set&lt;/strong&gt;
177
191
  &lt;div id="popoverBoundary" style="height: 150px; width: 200px; background-color: #fcfcfc; border: 1px solid darkgray;"&gt;
178
192
  &lt;auro-popover class="boundaryExample" placement="bottom"&gt;
179
193
  Popover content!
180
194
  &lt;auro-button slot="trigger"&gt;Popover Test&lt;/auro-button&gt;
181
195
  &lt;/auro-popover&gt;
182
- &lt;/div&gt;</code></pre>
196
+ &lt;/div&gt;</code></pre>
183
197
  <!-- AURO-GENERATED-CONTENT:END -->
184
198
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/boundary.js) -->
185
199
  <!-- The below code snippet is automatically added from ../apiExamples/boundary.js -->
@@ -187,22 +201,21 @@ Use the `boundary` property to set the overflow boundary for the `auro-popover`,
187
201
  <pre class="language-js"><code class="language-js">export function boundaryExample() {
188
202
  const boundaryExample = document.querySelector(".boundaryExample");
189
203
  const popoverBoundary = document.querySelector("#popoverBoundary");
190
- ​
191
- boundaryExample.boundary = popoverBoundary;
204
+ &#10; boundaryExample.boundary = popoverBoundary;
192
205
  }</code></pre>
193
206
  <!-- AURO-GENERATED-CONTENT:END -->
194
207
  </auro-accordion>
195
208
 
196
209
  ### Disabled
197
210
 
198
- When the `disabled` attribute is present, the popover will not appear on hover or focus.
211
+ When the `disabled` attribute is present, the popover doesn't appear on hover, focus, touch, or keyboard activation.
199
212
 
200
213
  <div class="exampleWrapper">
201
214
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/disabled.html) -->
202
215
  <!-- The below content is automatically added from ../apiExamples/disabled.html -->
203
216
  <auro-popover disabled>
204
217
  Top popover content!
205
- <auro-button disabled slot="trigger">Popover Test</auro-button>
218
+ <auro-button disabled slot="trigger">Popover test</auro-button>
206
219
  </auro-popover>
207
220
  <!-- AURO-GENERATED-CONTENT:END -->
208
221
  </div>
@@ -213,21 +226,21 @@ When the `disabled` attribute is present, the popover will not appear on hover o
213
226
 
214
227
  <pre class="language-html"><code class="language-html">&lt;auro-popover disabled&gt;
215
228
  Top popover content!
216
- &lt;auro-button disabled slot="trigger"&gt;Popover Test&lt;/auro-button&gt;
217
- &lt;/auro-popover&gt;</code></pre>
229
+ &lt;auro-button disabled slot="trigger"&gt;Popover test&lt;/auro-button&gt;
230
+ &lt;/auro-popover&gt;</code></pre>
218
231
  <!-- AURO-GENERATED-CONTENT:END -->
219
232
  </auro-accordion>
220
233
 
221
234
  ### Placement
222
235
 
223
- Use the `placement` attribute to set the position of the popover in relation to the trigger element. Options are `top` and `bottom`.
236
+ Use the `placement` attribute to set the position of the popover in relation to the trigger element. Options are `top` and `bottom`. The popover flips to the opposite side when there isn't room.
224
237
 
225
238
  <div class="exampleWrapper">
226
239
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/placement.html) -->
227
240
  <!-- The below content is automatically added from ../apiExamples/placement.html -->
228
241
  <auro-popover placement="bottom">
229
242
  Bottom popover content!
230
- <auro-button slot="trigger">Popover Test</auro-button>
243
+ <auro-button slot="trigger">Popover test</auro-button>
231
244
  </auro-popover>
232
245
  <!-- AURO-GENERATED-CONTENT:END -->
233
246
  </div>
@@ -238,25 +251,25 @@ Use the `placement` attribute to set the position of the popover in relation to
238
251
 
239
252
  <pre class="language-html"><code class="language-html">&lt;auro-popover placement="bottom"&gt;
240
253
  Bottom popover content!
241
- &lt;auro-button slot="trigger"&gt;Popover Test&lt;/auro-button&gt;
242
- &lt;/auro-popover&gt;</code></pre>
254
+ &lt;auro-button slot="trigger"&gt;Popover test&lt;/auro-button&gt;
255
+ &lt;/auro-popover&gt;</code></pre>
243
256
  <!-- AURO-GENERATED-CONTENT:END -->
244
257
  </auro-accordion>
245
258
 
246
- ### Remove Space Around Popover
259
+ ### Remove space around popover
247
260
 
248
- Use the `removespace` attribute to lessen the space between the popover and it's trigger.
261
+ Use the `removespace` attribute to lessen the space between the popover and its trigger.
249
262
 
250
263
  <div class="exampleWrapper">
251
264
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/remove-space.html) -->
252
265
  <!-- The below content is automatically added from ../apiExamples/remove-space.html -->
253
266
  <auro-popover removespace>
254
267
  Notice this popover is a little<br>closer to the trigger.
255
- <auro-button slot="trigger">Popover w/less space above</auro-button>
268
+ <auro-button slot="trigger">Popover with less space above</auro-button>
256
269
  </auro-popover>
257
270
  <auro-popover placement="bottom" removespace>
258
271
  Notice this popover is a little<br>closer to the trigger.
259
- <auro-button slot="trigger">Popover w/less space below</auro-button>
272
+ <auro-button slot="trigger">Popover with less space below</auro-button>
260
273
  </auro-popover>
261
274
  <!-- AURO-GENERATED-CONTENT:END -->
262
275
  </div>
@@ -267,83 +280,26 @@ Use the `removespace` attribute to lessen the space between the popover and it's
267
280
 
268
281
  <pre class="language-html"><code class="language-html">&lt;auro-popover removespace&gt;
269
282
  Notice this popover is a little&lt;br&gt;closer to the trigger.
270
- &lt;auro-button slot="trigger"&gt;Popover w/less space above&lt;/auro-button&gt;
271
- &lt;/auro-popover&gt;
272
- &lt;auro-popover placement="bottom" removespace&gt;
283
+ &lt;auro-button slot="trigger"&gt;Popover with less space above&lt;/auro-button&gt;
284
+ &lt;/auro-popover&gt;
285
+ &#10;&lt;auro-popover placement="bottom" removespace&gt;
273
286
  Notice this popover is a little&lt;br&gt;closer to the trigger.
274
- &lt;auro-button slot="trigger"&gt;Popover w/less space below&lt;/auro-button&gt;
275
- &lt;/auro-popover&gt;</code></pre>
276
- <!-- AURO-GENERATED-CONTENT:END -->
277
- </auro-accordion>
278
-
279
- ## Common Usage Patterns & Functional Examples
280
-
281
- ### Guidelines
282
-
283
- The auro-popover element is meant to be used when the interaction and it's content is passive. A popover is not to be used for cases where the user must adjust their focus and acknowledge the presented content. For these cases, please see the [auro-dialog](https://auro.alaskaair.com/components/auro/dialog) element.
284
-
285
- Binding a `trigger` event to a hyperlink is **not** recommended. This is a poor user experience for mobile devices, the event required to make the popover appear is a `tap`. The tap will also trigger the hyperlink to fire as well, thus negating the impact of the popover.
286
-
287
- The use of a hyperlink to trigger an event in the UI is semantically incorrect and this will present itself as a confusing scenario to assistive devices.
288
-
289
- <div class="exampleWrapper">
290
- <auro-alert type="error" noIcon>
291
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/not-recommended.html) -->
292
- <!-- The below content is automatically added from ../apiExamples/not-recommended.html -->
293
- <auro-popover>
294
- This works, but not recommended
295
- <auro-hyperlink href="#" relative nav slot="trigger">hyperlink popover trigger</auro-hyperlink>
296
- </auro-popover>
297
- <!-- AURO-GENERATED-CONTENT:END -->
298
- </auro-alert>
299
- </div>
300
- <auro-accordion alignRight>
301
- <span slot="trigger">See code</span>
302
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/not-recommended.html) -->
303
- <!-- The below code snippet is automatically added from ../apiExamples/not-recommended.html -->
304
-
305
- <pre class="language-html"><code class="language-html">&lt;auro-popover&gt;
306
- This works, but not recommended
307
- &lt;auro-hyperlink href="#" relative nav slot="trigger"&gt;hyperlink popover trigger&lt;/auro-hyperlink&gt;
308
- &lt;/auro-popover&gt;</code></pre>
309
- <!-- AURO-GENERATED-CONTENT:END -->
310
- </auro-accordion>
311
- In the event that a hyperlink UI is desired, it is recommended to use the `role="button"` semantic reassignment to the hyperlink element.
312
-
313
- <div class="exampleWrapper">
314
- <auro-alert type="success" noIcon>
315
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/recommended.html) -->
316
- <!-- The below content is automatically added from ../apiExamples/recommended.html -->
317
- <auro-popover>
318
- Role button is recommended
319
- <auro-hyperlink role="button" slot="trigger">hyperlink, role button</auro-hyperlink>
320
- </auro-popover>
321
- <!-- AURO-GENERATED-CONTENT:END -->
322
- </auro-alert>
323
- </div>
324
- <auro-accordion alignRight>
325
- <span slot="trigger">See code</span>
326
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/recommended.html) -->
327
- <!-- The below code snippet is automatically added from ../apiExamples/recommended.html -->
328
-
329
- <pre class="language-html"><code class="language-html">&lt;auro-popover&gt;
330
- Role button is recommended
331
- &lt;auro-hyperlink role="button" slot="trigger"&gt;hyperlink, role button&lt;/auro-hyperlink&gt;
332
- &lt;/auro-popover&gt;</code></pre>
287
+ &lt;auro-button slot="trigger"&gt;Popover with less space below&lt;/auro-button&gt;
288
+ &lt;/auro-popover&gt;</code></pre>
333
289
  <!-- AURO-GENERATED-CONTENT:END -->
334
290
  </auro-accordion>
335
291
 
336
- ## Style Component with CSS Shadow Parts
292
+ ## CSS shadow part examples
337
293
 
338
294
  The component exposes the `popover` bubble, the `arrow`, and the `trigger` wrapper as CSS shadow parts, so they can be styled from outside the shadow DOM.
339
295
 
340
296
  Three things to know before reaching for these:
341
297
 
342
- **The arrow's visible shape is a pseudo-element.** `::part(arrow)` selects an invisible positioning anchor; the diamond you see is its `::before`. Target `::part(arrow)::before` to change color, shadow, or size. Because the arrow and the bubble are painted separately, recolor both together or the seam between them will show.
298
+ **The arrow's visible shape is a pseudo-element.** `::part(arrow)` selects an invisible positioning anchor; the diamond you see is its `::before`. Target `::part(arrow)::before` to change color, shadow, or size. Because the arrow and the bubble are painted separately, recolor both together or the seam between them shows.
343
299
 
344
300
  **The arrow's position belongs to the component.** Placement is set by Popper as inline styles that are recalculated every time the popover opens, so `transform`, `top`, `left`, and `position` cannot be overridden through `::part(arrow)`. Use the `placement` attribute to choose which side the popover appears on. Resizing the arrow via `::part(arrow)::before` also shifts where it meets the bubble, so verify both `placement="top"` and `placement="bottom"` if you change its dimensions.
345
301
 
346
- **The `trigger` part is empty when you use `for`.** It wraps the trigger slot, so it only has something to style when the trigger is slotted into the component. If you point at an external element with `for`, that element is not inside the wrapper and `::part(trigger)` will silently do nothing — style the external trigger directly instead.
302
+ **The `trigger` part is empty when you use `for`.** It wraps the trigger slot, so it only has something to style when the trigger is slotted into the component. If you point at an external element with `for`, that element is not inside the wrapper and `::part(trigger)` silently does nothing. Style the external trigger directly instead.
347
303
 
348
304
  To adjust spacing between the popover and its trigger, prefer the `addspace` and `removespace` attributes over part overrides.
349
305
 
@@ -351,7 +307,7 @@ To adjust spacing between the popover and its trigger, prefer the `addspace` and
351
307
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/cssParts.html) -->
352
308
  <!-- The below content is automatically added from ../apiExamples/cssParts.html -->
353
309
  <!-- Scoped to .cssPartsExample. Keep every line in this <style> block at
354
- column zero with no blank lines — the docs generator indents it, and a
310
+ column zero with no blank lines: the docs generator indents it, and a
355
311
  4-space indent turns it into a code block. -->
356
312
  <style>
357
313
  /* Bubble container. */
@@ -379,13 +335,13 @@ To adjust spacing between the popover and its trigger, prefer the `addspace` and
379
335
  <div class="cssPartsExample">
380
336
  <auro-popover>
381
337
  This bubble and its arrow are restyled from outside the shadow DOM.
382
- <auro-button slot="trigger">Popover Test</auro-button>
338
+ <auro-button slot="trigger">Popover test</auro-button>
383
339
  </auro-popover>
384
340
  <p class="iconTrigger">
385
341
  Checked baggage fees apply
386
342
  <auro-popover placement="bottom">
387
343
  Fees vary by route and fare class.
388
- <auro-icon slot="trigger" category="interface" name="info-stroke" aria-label="More information"></auro-icon>
344
+ <auro-icon slot="trigger" category="interface" name="information-stroke" aria-label="More information"></auro-icon>
389
345
  </auro-popover>
390
346
  </p>
391
347
  </div>
@@ -397,7 +353,7 @@ To adjust spacing between the popover and its trigger, prefer the `addspace` and
397
353
  <!-- The below code snippet is automatically added from ../apiExamples/cssParts.html -->
398
354
 
399
355
  <pre class="language-html"><code class="language-html">&lt;!-- Scoped to .cssPartsExample. Keep every line in this &lt;style&gt; block at
400
- column zero with no blank lines — the docs generator indents it, and a
356
+ column zero with no blank lines: the docs generator indents it, and a
401
357
  4-space indent turns it into a code block. --&gt;
402
358
  &lt;style&gt;
403
359
  /* Bubble container. */
@@ -421,34 +377,90 @@ background-color: #01426a;
421
377
  display: inline-flex;
422
378
  align-items: center;
423
379
  }
424
- &lt;/style&gt;
425
- &lt;div class="cssPartsExample"&gt;
380
+ &lt;/style&gt;
381
+ &#10;&lt;div class="cssPartsExample"&gt;
426
382
  &lt;auro-popover&gt;
427
383
  This bubble and its arrow are restyled from outside the shadow DOM.
428
- &lt;auro-button slot="trigger"&gt;Popover Test&lt;/auro-button&gt;
429
- &lt;/auro-popover&gt;
430
- &lt;p class="iconTrigger"&gt;
384
+ &lt;auro-button slot="trigger"&gt;Popover test&lt;/auro-button&gt;
385
+ &lt;/auro-popover&gt;
386
+ &#10; &lt;p class="iconTrigger"&gt;
431
387
  Checked baggage fees apply
432
388
  &lt;auro-popover placement="bottom"&gt;
433
389
  Fees vary by route and fare class.
434
- &lt;auro-icon slot="trigger" category="interface" name="info-stroke" aria-label="More information"&gt;&lt;/auro-icon&gt;
390
+ &lt;auro-icon slot="trigger" category="interface" name="information-stroke" aria-label="More information"&gt;&lt;/auro-icon&gt;
435
391
  &lt;/auro-popover&gt;
436
392
  &lt;/p&gt;
437
- &lt;/div&gt;</code></pre>
393
+ &lt;/div&gt;</code></pre>
394
+ <!-- AURO-GENERATED-CONTENT:END -->
395
+ </auro-accordion>
396
+
397
+ ## Common usage patterns
398
+
399
+ ### Guidelines
400
+
401
+ Use `auro-popover` only when the interaction and its content are passive. Don't use a popover when people must shift focus and acknowledge the content. For those cases, see the [auro-dialog](https://auro.alaskaair.com/components/auro/dialog) element.
402
+
403
+ Don't use a hyperlink as the trigger. On mobile devices, a tap opens the popover and also follows the hyperlink, which defeats the popover.
404
+
405
+ Using a hyperlink to run an action in the UI is semantically incorrect and confuses screen reader users.
406
+
407
+ <div class="exampleWrapper">
408
+ <auro-alert type="error" noIcon>
409
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/not-recommended.html) -->
410
+ <!-- The below content is automatically added from ../apiExamples/not-recommended.html -->
411
+ <auro-popover>
412
+ This works, but not recommended
413
+ <auro-hyperlink href="#" relative nav slot="trigger">hyperlink popover trigger</auro-hyperlink>
414
+ </auro-popover>
415
+ <!-- AURO-GENERATED-CONTENT:END -->
416
+ </auro-alert>
417
+ </div>
418
+ <auro-accordion alignRight>
419
+ <span slot="trigger">See code</span>
420
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/not-recommended.html) -->
421
+ <!-- The below code snippet is automatically added from ../apiExamples/not-recommended.html -->
422
+
423
+ <pre class="language-html"><code class="language-html">&lt;auro-popover&gt;
424
+ This works, but not recommended
425
+ &lt;auro-hyperlink href="#" relative nav slot="trigger"&gt;hyperlink popover trigger&lt;/auro-hyperlink&gt;
426
+ &lt;/auro-popover&gt;</code></pre>
427
+ <!-- AURO-GENERATED-CONTENT:END -->
428
+ </auro-accordion>
429
+ If you need the look of a hyperlink, add `role="button"` to it so screen readers announce a button.
430
+
431
+ <div class="exampleWrapper">
432
+ <auro-alert type="success" noIcon>
433
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/recommended.html) -->
434
+ <!-- The below content is automatically added from ../apiExamples/recommended.html -->
435
+ <auro-popover>
436
+ Role button is recommended
437
+ <auro-hyperlink role="button" slot="trigger">hyperlink, role button</auro-hyperlink>
438
+ </auro-popover>
439
+ <!-- AURO-GENERATED-CONTENT:END -->
440
+ </auro-alert>
441
+ </div>
442
+ <auro-accordion alignRight>
443
+ <span slot="trigger">See code</span>
444
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/recommended.html) -->
445
+ <!-- The below code snippet is automatically added from ../apiExamples/recommended.html -->
446
+
447
+ <pre class="language-html"><code class="language-html">&lt;auro-popover&gt;
448
+ Role button is recommended
449
+ &lt;auro-hyperlink role="button" slot="trigger"&gt;hyperlink, role button&lt;/auro-hyperlink&gt;
450
+ &lt;/auro-popover&gt;</code></pre>
438
451
  <!-- AURO-GENERATED-CONTENT:END -->
439
452
  </auro-accordion>
440
453
 
441
- ## Restyle Component with CSS Variables
454
+ ## Restyle with CSS custom properties
442
455
 
443
- The component may be restyled by changing the values of the following token(s).
456
+ Restyle the component by changing the values of the following tokens.
444
457
 
445
458
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../src/styles/tokens.scss) -->
446
459
  <!-- The below code snippet is automatically added from ./../src/styles/tokens.scss -->
447
460
 
448
461
  <pre class="language-scss"><code class="language-scss">@use "@aurodesignsystem/design-tokens/dist/legacy/auro-classic/SCSSVariables" as vac;
449
462
  @use "@aurodesignsystem/design-tokens/dist/themes/alaska/SCSSVariables--alaska" as v;
450
- ​
451
- :host {
463
+ &#10;:host {
452
464
  --ds-auro-popover-boxshadow-color: var(--ds-elevation-200, #{vac.$ds-elevation-200});
453
465
  --ds-auro-popover-container-color: var(--ds-basic-color-surface-default, #{v.$ds-basic-color-surface-default});
454
466
  --ds-auro-popover-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});