@aurodesignsystem-dev/auro-popover 0.0.0-pr136.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/README.md CHANGED
@@ -12,23 +12,23 @@ The following sections are editable by making changes to the following files:
12
12
  | SECTION | DESCRIPTION | FILE LOCATION |
13
13
  |------------------------|---------------------------------------------------|-------------------------------------|
14
14
  | Description | Description of the component | `./docs/partials/description.md` |
15
- | Use Cases | Examples for when to use this component | `./docs/partials/useCases.md` |
16
- | Additional Information | For use to add any component specific information | `./docs/partials/readmeAddlInfo.md` |
17
- | Component Example Code | HTML sample code of the components use | `./apiExamples/basic.html` |
15
+ | Use cases | Examples for when to use this component | `./docs/partials/useCases.md` |
16
+ | Additional information | For use to add any component specific information | `./docs/partials/readmeAddlInfo.md` |
17
+ | Component example code | HTML sample code of the components use | `./apiExamples/basic.html` |
18
18
  -->
19
19
 
20
20
  # Popover
21
21
 
22
22
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/description.md) -->
23
23
  <!-- The below content is automatically added from ./docs/partials/description.md -->
24
- The `<auro-popover>` element attaches to another element and displays on hover. It uses the [Popper.js](https://popper.js.org/) library to position itself relative to the trigger element and supports placement options such as `top` and `bottom`.
24
+ Shows short supporting content next to a trigger when someone hovers over, focuses, or taps it. It uses the [Popper.js](https://popper.js.org/) library to position itself relative to the trigger and supports placements such as `top` and `bottom`.
25
25
  <!-- AURO-GENERATED-CONTENT:END -->
26
26
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/readmeAddlInfo.md) -->
27
27
  <!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
28
28
  <!-- AURO-GENERATED-CONTENT This file is to be used for any additional content that should be included in the README.md which is specific to this component. -->
29
29
  <!-- AURO-GENERATED-CONTENT:END -->
30
30
 
31
- ## Use Cases
31
+ ## Use cases
32
32
 
33
33
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
34
34
  <!-- The below content is automatically added from ./docs/partials/useCases.md -->
@@ -51,10 +51,10 @@ The `auro-popover` element should be used in situations where users may:
51
51
 
52
52
  <!-- AURO-GENERATED-CONTENT:END -->
53
53
 
54
- ### Define Dependency in Project
54
+ ### Define dependency in project
55
55
 
56
56
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
57
- Defining the dependency within each project that is using the `<auro-popover>` component.
57
+ Import the component in each project that uses `<auro-popover>`.
58
58
 
59
59
  <!-- AURO-GENERATED-CONTENT:END -->
60
60
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
@@ -66,44 +66,43 @@ Defining the dependency within each project that is using the `<auro-popover>` c
66
66
  ### Use CDN
67
67
 
68
68
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
69
- In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
69
+ If your project can't process JS assets, use the pre-processed assets. Legacy browsers, such as IE11, aren't supported.
70
70
 
71
- <pre class="language-html"><code class="language-html">&lt;script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-popover@latest/+esm"&gt;&lt;/script&gt;</code></pre>
71
+ <pre class="language-html"><code class="language-html">&lt;script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-popover@latest/+esm"&gt;&lt;/script&gt;</code></pre>
72
72
 
73
73
  <!-- AURO-GENERATED-CONTENT:END -->
74
74
 
75
- ## Basic Example
75
+ ## Basic example
76
76
 
77
77
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
78
78
  <!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
79
79
 
80
80
  <pre class="language-html"><code class="language-html">&lt;auro-popover&gt;
81
81
  Top popover content!
82
- &lt;auro-button slot="trigger"&gt;Popover Test&lt;/auro-button&gt;
83
- &lt;/auro-popover&gt;</code></pre>
82
+ &lt;auro-button slot="trigger"&gt;Popover test&lt;/auro-button&gt;
83
+ &lt;/auro-popover&gt;</code></pre>
84
84
  <!-- AURO-GENERATED-CONTENT:END -->
85
85
 
86
- ## Custom Component Registration for Version Management
86
+ ## Custom component registration for version management
87
87
 
88
- There are two key parts to every Auro component: the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</a> and the custom element definition.
88
+ Every Auro component has two key parts: the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</a> and the custom element definition.
89
89
  The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
90
90
 
91
- When you install the component as described on the `Install` page, the class is imported automatically, and the component is registered globally for you.
91
+ Installing the component as described in the Install section imports the class and registers the component globally for you.
92
92
 
93
- However, if you need to load multiple versions of the same component on a single page (for example, when two projects depend on different versions), you can manually register the class under a custom element name to avoid conflicts.
93
+ However, if you need to load multiple versions of the same component on a single page (for example, when two projects depend on different versions), register the class manually under a custom element name to avoid conflicts.
94
94
 
95
- You can do this by importing only the component class and using the `register(name)` method with a unique name:
95
+ To do this, import only the component class and call the `register(name)` method with a unique name:
96
96
 
97
97
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
98
98
  <!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
99
99
 
100
100
  <pre class="language-js"><code class="language-js">// Import the class only
101
101
  import { AuroPopover } from '@aurodesignsystem/auro-popover/class';
102
- ​
103
- // Register with a custom name if desired
102
+ &#10;// Register with a custom name if desired
104
103
  AuroPopover.register('custom-popover');</code></pre>
105
104
 
106
- This will create a new custom element `<custom-popover>` that behaves exactly like `<auro-popover>`, allowing both to coexist on the same page without interfering with each other.
105
+ This registers a new custom element, `<custom-popover>`, that behaves like `<auro-popover>`. Both can exist on the same page without interfering with each other.
107
106
  <!-- AURO-GENERATED-CONTENT:END -->
108
107
  <div class="exampleWrapper exampleWrapper--flex">
109
108
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
@@ -111,12 +110,12 @@ This will create a new custom element `<custom-popover>` that behaves exactly li
111
110
  <!-- The slot=trigger attribute is bound directly to the auro-button element -->
112
111
  <custom-popover>
113
112
  Top popover content!
114
- <auro-button slot="trigger">Popover Test</auro-button>
113
+ <auro-button slot="trigger">Popover test</auro-button>
115
114
  </custom-popover>
116
115
  <!-- Using the placement=bottom attribute -->
117
116
  <custom-popover placement="bottom">
118
117
  Popover content!
119
- <auro-button slot="trigger">Popover Test</auro-button>
118
+ <auro-button slot="trigger">Popover test</auro-button>
120
119
  </custom-popover>
121
120
  <!-- AURO-GENERATED-CONTENT:END -->
122
121
  </div>
@@ -128,12 +127,12 @@ This will create a new custom element `<custom-popover>` that behaves exactly li
128
127
  <pre class="language-html"><code class="language-html">&lt;!-- The slot=trigger attribute is bound directly to the auro-button element --&gt;
129
128
  &lt;custom-popover&gt;
130
129
  Top popover content!
131
- &lt;auro-button slot="trigger"&gt;Popover Test&lt;/auro-button&gt;
132
- &lt;/custom-popover&gt;
133
- &lt;!-- Using the placement=bottom attribute --&gt;
130
+ &lt;auro-button slot="trigger"&gt;Popover test&lt;/auro-button&gt;
131
+ &lt;/custom-popover&gt;
132
+ &#10;&lt;!-- Using the placement=bottom attribute --&gt;
134
133
  &lt;custom-popover placement="bottom"&gt;
135
134
  Popover content!
136
- &lt;auro-button slot="trigger"&gt;Popover Test&lt;/auro-button&gt;
137
- &lt;/custom-popover&gt;</code></pre>
135
+ &lt;auro-button slot="trigger"&gt;Popover test&lt;/auro-button&gt;
136
+ &lt;/custom-popover&gt;</code></pre>
138
137
  <!-- AURO-GENERATED-CONTENT:END -->
139
138
  </auro-accordion>
package/demo/api.html CHANGED
@@ -58,6 +58,7 @@
58
58
 
59
59
  <script type="module" data-demo-script="true">
60
60
  import { initExamples } from "./api.min.js"
61
+
61
62
  initExamples();
62
63
  </script>
63
64
  </body>
package/demo/api.md CHANGED
@@ -3,32 +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
40
+
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. |
46
+
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. |
32
54
  <!-- AURO-GENERATED-CONTENT:END -->
33
55
 
34
56
  ## Basic
@@ -38,7 +60,7 @@ The `auro-popover` element attaches to another element and displays on hover.
38
60
  <!-- The below content is automatically added from ./../apiExamples/basic.html -->
39
61
  <auro-popover>
40
62
  Top popover content!
41
- <auro-button slot="trigger">Popover Test</auro-button>
63
+ <auro-button slot="trigger">Popover test</auro-button>
42
64
  </auro-popover>
43
65
  <!-- AURO-GENERATED-CONTENT:END -->
44
66
  </div>
@@ -49,18 +71,18 @@ The `auro-popover` element attaches to another element and displays on hover.
49
71
 
50
72
  <pre class="language-html"><code class="language-html">&lt;auro-popover&gt;
51
73
  Top popover content!
52
- &lt;auro-button slot="trigger"&gt;Popover Test&lt;/auro-button&gt;
53
- &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>
54
76
  <!-- AURO-GENERATED-CONTENT:END -->
55
77
  </auro-accordion>
56
78
 
57
79
  ## Apply popover to any type of content
58
80
 
59
- 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.
60
82
 
61
- > **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.
62
84
  >
63
- > **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.
64
86
 
65
87
  <div class="exampleWrapper">
66
88
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/non-interactive-triggers.html) -->
@@ -69,13 +91,13 @@ The trigger can be any element, not just buttons or links. The component automat
69
91
  adds tabindex. aria-label is still required to provide an accessible name. -->
70
92
  <auro-popover>
71
93
  This flight offers priority boarding.
72
- <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>
73
95
  </auro-popover>
74
96
  <br><br>
75
97
  <!-- Native elements like <abbr> are automatically made keyboard accessible by the component -->
76
98
  <p>Congratulations, you just achieved
77
99
  <auro-popover>
78
- Most Valuable Passenger — Alaska Airlines' mid-tier elite status level.
100
+ Most Valuable Passenger: Alaska Airlines' mid-tier elite status level.
79
101
  <abbr slot="trigger" style="color: orangered">MVP</abbr>
80
102
  </auro-popover> status!
81
103
  </p>
@@ -90,31 +112,31 @@ The trigger can be any element, not just buttons or links. The component automat
90
112
  adds tabindex. aria-label is still required to provide an accessible name. --&gt;
91
113
  &lt;auro-popover&gt;
92
114
  This flight offers priority boarding.
93
- &lt;auro-icon slot="trigger" category="interface" name="info-stroke" aria-label="More information"&gt;&lt;/auro-icon&gt;
94
- &lt;/auro-popover&gt;
95
- &lt;br&gt;&lt;br&gt;
96
- &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;
97
119
  &lt;p&gt;Congratulations, you just achieved
98
120
  &lt;auro-popover&gt;
99
- Most Valuable Passenger — Alaska Airlines' mid-tier elite status level.
121
+ Most Valuable Passenger: Alaska Airlines' mid-tier elite status level.
100
122
  &lt;abbr slot="trigger" style="color: orangered"&gt;MVP&lt;/abbr&gt;
101
123
  &lt;/auro-popover&gt; status!
102
- &lt;/p&gt;</code></pre>
124
+ &lt;/p&gt;</code></pre>
103
125
  <!-- AURO-GENERATED-CONTENT:END -->
104
126
  </auro-accordion>
105
127
 
106
- ## Property & Attribute Examples
128
+ ## Property and attribute examples
107
129
 
108
- ### Add Space Around Popover
130
+ ### Add space around popover
109
131
 
110
- 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.
111
133
 
112
134
  <div class="exampleWrapper">
113
135
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/add-space.html) -->
114
136
  <!-- The below content is automatically added from ../apiExamples/add-space.html -->
115
- <auro-popover addSpace>
137
+ <auro-popover addspace>
116
138
  Notice this popover is a little<br>further away from the trigger.
117
- <auro-button slot="trigger">Popover w/additional space above</auro-button>
139
+ <auro-button slot="trigger">Popover with additional space above</auro-button>
118
140
  </auro-popover>
119
141
  <!-- AURO-GENERATED-CONTENT:END -->
120
142
  </div>
@@ -123,16 +145,16 @@ Use the `addSpace` attribute to add more space between the popover and it's trig
123
145
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/add-space.html) -->
124
146
  <!-- The below code snippet is automatically added from ../apiExamples/add-space.html -->
125
147
 
126
- <pre class="language-html"><code class="language-html">&lt;auro-popover addSpace&gt;
148
+ <pre class="language-html"><code class="language-html">&lt;auro-popover addspace&gt;
127
149
  Notice this popover is a little&lt;br&gt;further away from the trigger.
128
- &lt;auro-button slot="trigger"&gt;Popover w/additional space above&lt;/auro-button&gt;
129
- &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>
130
152
  <!-- AURO-GENERATED-CONTENT:END -->
131
153
  </auro-accordion>
132
154
 
133
155
  ### Boundary
134
156
 
135
- 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.
136
158
 
137
159
  <div class="exampleWrapper">
138
160
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/boundary.html) -->
@@ -164,14 +186,14 @@ Use the `boundary` property to set the overflow boundary for the `auro-popover`,
164
186
  Popover content!
165
187
  &lt;auro-button slot="trigger"&gt;Popover Test&lt;/auro-button&gt;
166
188
  &lt;/auro-popover&gt;
167
- &lt;/div&gt;
168
- &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;
169
191
  &lt;div id="popoverBoundary" style="height: 150px; width: 200px; background-color: #fcfcfc; border: 1px solid darkgray;"&gt;
170
192
  &lt;auro-popover class="boundaryExample" placement="bottom"&gt;
171
193
  Popover content!
172
194
  &lt;auro-button slot="trigger"&gt;Popover Test&lt;/auro-button&gt;
173
195
  &lt;/auro-popover&gt;
174
- &lt;/div&gt;</code></pre>
196
+ &lt;/div&gt;</code></pre>
175
197
  <!-- AURO-GENERATED-CONTENT:END -->
176
198
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/boundary.js) -->
177
199
  <!-- The below code snippet is automatically added from ../apiExamples/boundary.js -->
@@ -179,22 +201,21 @@ Use the `boundary` property to set the overflow boundary for the `auro-popover`,
179
201
  <pre class="language-js"><code class="language-js">export function boundaryExample() {
180
202
  const boundaryExample = document.querySelector(".boundaryExample");
181
203
  const popoverBoundary = document.querySelector("#popoverBoundary");
182
- ​
183
- boundaryExample.boundary = popoverBoundary;
204
+ &#10; boundaryExample.boundary = popoverBoundary;
184
205
  }</code></pre>
185
206
  <!-- AURO-GENERATED-CONTENT:END -->
186
207
  </auro-accordion>
187
208
 
188
209
  ### Disabled
189
210
 
190
- 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.
191
212
 
192
213
  <div class="exampleWrapper">
193
214
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/disabled.html) -->
194
215
  <!-- The below content is automatically added from ../apiExamples/disabled.html -->
195
216
  <auro-popover disabled>
196
217
  Top popover content!
197
- <auro-button disabled slot="trigger">Popover Test</auro-button>
218
+ <auro-button disabled slot="trigger">Popover test</auro-button>
198
219
  </auro-popover>
199
220
  <!-- AURO-GENERATED-CONTENT:END -->
200
221
  </div>
@@ -205,21 +226,21 @@ When the `disabled` attribute is present, the popover will not appear on hover o
205
226
 
206
227
  <pre class="language-html"><code class="language-html">&lt;auro-popover disabled&gt;
207
228
  Top popover content!
208
- &lt;auro-button disabled slot="trigger"&gt;Popover Test&lt;/auro-button&gt;
209
- &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>
210
231
  <!-- AURO-GENERATED-CONTENT:END -->
211
232
  </auro-accordion>
212
233
 
213
234
  ### Placement
214
235
 
215
- 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.
216
237
 
217
238
  <div class="exampleWrapper">
218
239
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/placement.html) -->
219
240
  <!-- The below content is automatically added from ../apiExamples/placement.html -->
220
241
  <auro-popover placement="bottom">
221
242
  Bottom popover content!
222
- <auro-button slot="trigger">Popover Test</auro-button>
243
+ <auro-button slot="trigger">Popover test</auro-button>
223
244
  </auro-popover>
224
245
  <!-- AURO-GENERATED-CONTENT:END -->
225
246
  </div>
@@ -230,25 +251,25 @@ Use the `placement` attribute to set the position of the popover in relation to
230
251
 
231
252
  <pre class="language-html"><code class="language-html">&lt;auro-popover placement="bottom"&gt;
232
253
  Bottom popover content!
233
- &lt;auro-button slot="trigger"&gt;Popover Test&lt;/auro-button&gt;
234
- &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>
235
256
  <!-- AURO-GENERATED-CONTENT:END -->
236
257
  </auro-accordion>
237
258
 
238
- ### Remove Space Around Popover
259
+ ### Remove space around popover
239
260
 
240
- 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.
241
262
 
242
263
  <div class="exampleWrapper">
243
264
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/remove-space.html) -->
244
265
  <!-- The below content is automatically added from ../apiExamples/remove-space.html -->
245
- <auro-popover removeSpace>
266
+ <auro-popover removespace>
246
267
  Notice this popover is a little<br>closer to the trigger.
247
- <auro-button slot="trigger">Popover w/less space above</auro-button>
268
+ <auro-button slot="trigger">Popover with less space above</auro-button>
248
269
  </auro-popover>
249
- <auro-popover placement="bottom" removeSpace>
270
+ <auro-popover placement="bottom" removespace>
250
271
  Notice this popover is a little<br>closer to the trigger.
251
- <auro-button slot="trigger">Popover w/less space below</auro-button>
272
+ <auro-button slot="trigger">Popover with less space below</auro-button>
252
273
  </auro-popover>
253
274
  <!-- AURO-GENERATED-CONTENT:END -->
254
275
  </div>
@@ -257,26 +278,131 @@ Use the `removeSpace` attribute to lessen the space between the popover and it's
257
278
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/remove-space.html) -->
258
279
  <!-- The below code snippet is automatically added from ../apiExamples/remove-space.html -->
259
280
 
260
- <pre class="language-html"><code class="language-html">&lt;auro-popover removeSpace&gt;
281
+ <pre class="language-html"><code class="language-html">&lt;auro-popover removespace&gt;
261
282
  Notice this popover is a little&lt;br&gt;closer to the trigger.
262
- &lt;auro-button slot="trigger"&gt;Popover w/less space above&lt;/auro-button&gt;
263
- &lt;/auro-popover&gt;
264
- &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;
265
286
  Notice this popover is a little&lt;br&gt;closer to the trigger.
266
- &lt;auro-button slot="trigger"&gt;Popover w/less space below&lt;/auro-button&gt;
267
- &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>
289
+ <!-- AURO-GENERATED-CONTENT:END -->
290
+ </auro-accordion>
291
+
292
+ ## CSS shadow part examples
293
+
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.
295
+
296
+ Three things to know before reaching for these:
297
+
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.
299
+
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.
301
+
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.
303
+
304
+ To adjust spacing between the popover and its trigger, prefer the `addspace` and `removespace` attributes over part overrides.
305
+
306
+ <div class="exampleWrapper">
307
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/cssParts.html) -->
308
+ <!-- The below content is automatically added from ../apiExamples/cssParts.html -->
309
+ <!-- Scoped to .cssPartsExample. Keep every line in this <style> block at
310
+ column zero with no blank lines: the docs generator indents it, and a
311
+ 4-space indent turns it into a code block. -->
312
+ <style>
313
+ /* Bubble container. */
314
+ .cssPartsExample auro-popover::part(popover) {
315
+ color: #fff;
316
+ border-radius: 0;
317
+ background-color: #01426a;
318
+ }
319
+ /* `color` above only reaches bare text; element content is matched by
320
+ ::slotted(*), which beats inheritance. Set the token or markup loses contrast. */
321
+ .cssPartsExample auro-popover {
322
+ --ds-auro-popover-text-color: #fff;
323
+ }
324
+ /* The visible arrow is the part's ::before, not ::part(arrow) itself.
325
+ Match the bubble background or a seam shows. */
326
+ .cssPartsExample auro-popover::part(arrow)::before {
327
+ background-color: #01426a;
328
+ }
329
+ /* Trigger wrapper — aligns an icon trigger with adjacent text. */
330
+ .cssPartsExample .iconTrigger auro-popover::part(trigger) {
331
+ display: inline-flex;
332
+ align-items: center;
333
+ }
334
+ </style>
335
+ <div class="cssPartsExample">
336
+ <auro-popover>
337
+ This bubble and its arrow are restyled from outside the shadow DOM.
338
+ <auro-button slot="trigger">Popover test</auro-button>
339
+ </auro-popover>
340
+ <p class="iconTrigger">
341
+ Checked baggage fees apply
342
+ <auro-popover placement="bottom">
343
+ Fees vary by route and fare class.
344
+ <auro-icon slot="trigger" category="interface" name="information-stroke" aria-label="More information"></auro-icon>
345
+ </auro-popover>
346
+ </p>
347
+ </div>
348
+ <!-- AURO-GENERATED-CONTENT:END -->
349
+ </div>
350
+ <auro-accordion alignRight>
351
+ <span slot="trigger">See code</span>
352
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/cssParts.html) -->
353
+ <!-- The below code snippet is automatically added from ../apiExamples/cssParts.html -->
354
+
355
+ <pre class="language-html"><code class="language-html">&lt;!-- Scoped to .cssPartsExample. Keep every line in this &lt;style&gt; block at
356
+ column zero with no blank lines: the docs generator indents it, and a
357
+ 4-space indent turns it into a code block. --&gt;
358
+ &lt;style&gt;
359
+ /* Bubble container. */
360
+ .cssPartsExample auro-popover::part(popover) {
361
+ color: #fff;
362
+ border-radius: 0;
363
+ background-color: #01426a;
364
+ }
365
+ /* `color` above only reaches bare text; element content is matched by
366
+ ::slotted(*), which beats inheritance. Set the token or markup loses contrast. */
367
+ .cssPartsExample auro-popover {
368
+ --ds-auro-popover-text-color: #fff;
369
+ }
370
+ /* The visible arrow is the part's ::before, not ::part(arrow) itself.
371
+ Match the bubble background or a seam shows. */
372
+ .cssPartsExample auro-popover::part(arrow)::before {
373
+ background-color: #01426a;
374
+ }
375
+ /* Trigger wrapper — aligns an icon trigger with adjacent text. */
376
+ .cssPartsExample .iconTrigger auro-popover::part(trigger) {
377
+ display: inline-flex;
378
+ align-items: center;
379
+ }
380
+ &lt;/style&gt;
381
+ &#10;&lt;div class="cssPartsExample"&gt;
382
+ &lt;auro-popover&gt;
383
+ This bubble and its arrow are restyled from outside the shadow DOM.
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;
387
+ Checked baggage fees apply
388
+ &lt;auro-popover placement="bottom"&gt;
389
+ Fees vary by route and fare class.
390
+ &lt;auro-icon slot="trigger" category="interface" name="information-stroke" aria-label="More information"&gt;&lt;/auro-icon&gt;
391
+ &lt;/auro-popover&gt;
392
+ &lt;/p&gt;
393
+ &lt;/div&gt;</code></pre>
268
394
  <!-- AURO-GENERATED-CONTENT:END -->
269
395
  </auro-accordion>
270
396
 
271
- ## Common Usage Patterns & Functional Examples
397
+ ## Common usage patterns
272
398
 
273
399
  ### Guidelines
274
400
 
275
- 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.
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.
276
402
 
277
- 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.
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.
278
404
 
279
- 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.
405
+ Using a hyperlink to run an action in the UI is semantically incorrect and confuses screen reader users.
280
406
 
281
407
  <div class="exampleWrapper">
282
408
  <auro-alert type="error" noIcon>
@@ -297,10 +423,10 @@ The use of a hyperlink to trigger an event in the UI is semantically incorrect a
297
423
  <pre class="language-html"><code class="language-html">&lt;auro-popover&gt;
298
424
  This works, but not recommended
299
425
  &lt;auro-hyperlink href="#" relative nav slot="trigger"&gt;hyperlink popover trigger&lt;/auro-hyperlink&gt;
300
- &lt;/auro-popover&gt;</code></pre>
426
+ &lt;/auro-popover&gt;</code></pre>
301
427
  <!-- AURO-GENERATED-CONTENT:END -->
302
428
  </auro-accordion>
303
- In the event that a hyperlink UI is desired, it is recommended to use the `role="button"` semantic reassignment to the hyperlink element.
429
+ If you need the look of a hyperlink, add `role="button"` to it so screen readers announce a button.
304
430
 
305
431
  <div class="exampleWrapper">
306
432
  <auro-alert type="success" noIcon>
@@ -321,21 +447,20 @@ In the event that a hyperlink UI is desired, it is recommended to use the `role=
321
447
  <pre class="language-html"><code class="language-html">&lt;auro-popover&gt;
322
448
  Role button is recommended
323
449
  &lt;auro-hyperlink role="button" slot="trigger"&gt;hyperlink, role button&lt;/auro-hyperlink&gt;
324
- &lt;/auro-popover&gt;</code></pre>
450
+ &lt;/auro-popover&gt;</code></pre>
325
451
  <!-- AURO-GENERATED-CONTENT:END -->
326
452
  </auro-accordion>
327
453
 
328
- ## Restyle Component with CSS Variables
454
+ ## Restyle with CSS custom properties
329
455
 
330
- 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.
331
457
 
332
458
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../src/styles/tokens.scss) -->
333
459
  <!-- The below code snippet is automatically added from ./../src/styles/tokens.scss -->
334
460
 
335
461
  <pre class="language-scss"><code class="language-scss">@use "@aurodesignsystem/design-tokens/dist/legacy/auro-classic/SCSSVariables" as vac;
336
462
  @use "@aurodesignsystem/design-tokens/dist/themes/alaska/SCSSVariables--alaska" as v;
337
- ​
338
- :host {
463
+ &#10;:host {
339
464
  --ds-auro-popover-boxshadow-color: var(--ds-elevation-200, #{vac.$ds-elevation-200});
340
465
  --ds-auro-popover-container-color: var(--ds-basic-color-surface-default, #{v.$ds-basic-color-surface-default});
341
466
  --ds-auro-popover-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});