@aurodesignsystem/auro-dialog 4.2.2 → 4.2.3

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.
@@ -1,9 +1,9 @@
1
- <auro-header level="1" id="overview">Dialog - Getting Started</auro-header>
1
+ <auro-header level="1" id="overview">Dialog - Getting started</auro-header>
2
2
  <div class="contentWrapper">
3
3
  <nav>
4
4
  <auro-nav anchorNavContent=".scrollWrapper">
5
- <span slot="mobileToggleCollapsed">View More</span>
6
- <span slot="mobileToggleExpanded">View Less</span>
5
+ <span slot="mobileToggleCollapsed">View more</span>
6
+ <span slot="mobileToggleExpanded">View less</span>
7
7
  <auro-anchorlink fluid href="#setup">Setup</auro-anchorlink>
8
8
  <auro-anchorlink fluid href="#recommendedAccordion" class="level2 body-xs" onclick="openAccordion('recommendedAccordion')">Recommended</auro-anchorlink>
9
9
  <auro-anchorlink fluid href="#autoAccordion" class="level2 body-xs" onclick="openAccordion('autoAccordion')">Auto</auro-anchorlink>
@@ -11,9 +11,9 @@
11
11
  <auro-anchorlink fluid href="#frameworks">Frameworks</auro-anchorlink>
12
12
  <auro-anchorlink fluid href="#react" class="level2 body-xs" onclick="openAccordion('react')">React</auro-anchorlink>
13
13
  <auro-anchorlink fluid href="#svelte" class="level2 body-xs" onclick="openAccordion('svelte')">Svelte</auro-anchorlink>
14
- <auro-anchorlink fluid href="#minimalConfig">Minimal Config</auro-anchorlink>
14
+ <auro-anchorlink fluid href="#minimalConfig">Minimal config</auro-anchorlink>
15
15
  <auro-anchorlink fluid href="#slots">Slots</auro-anchorlink>
16
- <auro-anchorlink fluid href="#stateManagement">State Management</auro-anchorlink>
16
+ <auro-anchorlink fluid href="#stateManagement">State management</auro-anchorlink>
17
17
  <auro-anchorlink fluid href="#open" class="level2 body-xs">open</auro-anchorlink>
18
18
  <auro-anchorlink fluid href="#modal" class="level2 body-xs">modal</auro-anchorlink>
19
19
  <auro-anchorlink fluid href="#triggerElement" class="level2 body-xs">triggerElement</auro-anchorlink>
@@ -27,25 +27,24 @@
27
27
  <auro-header level="2" id="setup">Setup</auro-header>
28
28
  <auro-accordion-group Emphasis>
29
29
  <auro-accordion expanded class="section" id="recommendedAccordion">
30
- <span slot="trigger">Recommended Installation and Implementation</span>
30
+ <span slot="trigger">Recommended installation and implementation</span>
31
31
  <div class="accordion-content">
32
32
  <auro-header level="3">Install</auro-header>
33
33
  <p>Install the <code>@aurodesignsystem/auro-dialog</code> package from npm:</p>
34
34
 
35
35
  <pre class="language-shell"><code class="language-shell">$ npm i @aurodesignsystem/auro-dialog</code></pre>
36
36
 
37
- <p>Installing as a dependency automatically installs its own dependencies (<code>auro-button</code> and <code>auro-icon</code>), which are registered internally under versioned tag names — you do not need to register them yourself.</p>
37
+ <p>Installing as a dependency automatically installs its own dependencies (<code>auro-button</code> and <code>auro-icon</code>), which are registered internally under versioned tag names, so you don't need to register them yourself.</p>
38
38
  <auro-header level="3">Implementation</auro-header>
39
39
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/getting-started/customRegistration.md) -->
40
40
  <!-- The below content is automatically added from ./../docs/partials/getting-started/customRegistration.md -->
41
41
  <p>Every Auro component consists of a JavaScript <auro-hyperlink href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</auro-hyperlink> and a <auro-hyperlink href="https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define">custom element registration</auro-hyperlink>. The class defines the component's behavior, and the registration maps it to an HTML tag name so it can be used in markup.</p>
42
42
  <p>The default import handles both steps automatically, registering the component under its standard <code>&lt;auro-dialog&gt;</code> tag name.</p>
43
- <p>If you need multiple versions of the same component on a single page — for example, when two projects depend on different versions — you can register the class under a custom tag name to avoid conflicts. Import the component class directly and call its <code>register(name)</code> method with a unique name:</p>
43
+ <p>When two projects on the same page depend on different versions of the component, register the class under a custom tag name to avoid conflicts. Import the component class directly and call its <code>register(name)</code> method with a unique name:</p>
44
44
 
45
45
  <pre class="language-js"><code class="language-js">// Import the class only
46
46
  import { AuroDialog } from '@aurodesignsystem/auro-dialog/class';
47
- ​
48
- // Register with a custom name
47
+ &#10;// Register with a custom name
49
48
  AuroDialog.register('custom-dialog');</code></pre>
50
49
 
51
50
  <p>This creates a new custom element <code>&lt;custom-dialog&gt;</code> that behaves exactly like <code>&lt;auro-dialog&gt;</code>, allowing both to coexist on the same page without interfering with each other.</p>
@@ -56,12 +55,12 @@ AuroDialog.register('custom-dialog');</code></pre>
56
55
  &lt;div slot="footer"&gt;
57
56
  &lt;auro-button id="closeCustom"&gt;Close&lt;/auro-button&gt;
58
57
  &lt;/div&gt;
59
- &lt;/custom-dialog&gt;</code></pre>
58
+ &lt;/custom-dialog&gt;</code></pre>
60
59
  <!-- AURO-GENERATED-CONTENT:END -->
61
60
  </div>
62
61
  </auro-accordion>
63
62
  <auro-accordion class="section" id="autoAccordion">
64
- <span slot="trigger">Auto Installation and Implementation</span>
63
+ <span slot="trigger">Auto installation and implementation</span>
65
64
  <div class="accordion-content">
66
65
  <p class="warning"><strong>Warning:</strong> Default registration can cause conflicts if another package registers the same tag name using a different version of the component, leading to unexpected behavior. Use custom registration to avoid this risk.</p>
67
66
  <auro-header level="3">Implementation</auro-header>
@@ -71,7 +70,7 @@ AuroDialog.register('custom-dialog');</code></pre>
71
70
 
72
71
  <pre class="language-js"><code class="language-js">import '@aurodesignsystem/auro-dialog';</code></pre>
73
72
 
74
- <p>This import registers the <code>&lt;auro-dialog&gt;</code> custom element globally. You can then use it in your HTML:</p>
73
+ <p>This import registers the <code>&lt;auro-dialog&gt;</code> custom element globally. Then use it in your HTML:</p>
75
74
 
76
75
  <pre class="language-html"><code class="language-html">&lt;auro-dialog id="default-dialog"&gt;
77
76
  &lt;span slot="header"&gt;Dialog header&lt;/span&gt;
@@ -79,21 +78,21 @@ AuroDialog.register('custom-dialog');</code></pre>
79
78
  &lt;div slot="footer"&gt;
80
79
  &lt;auro-button id="closeDefault"&gt;Close&lt;/auro-button&gt;
81
80
  &lt;/div&gt;
82
- &lt;/auro-dialog&gt;</code></pre>
81
+ &lt;/auro-dialog&gt;</code></pre>
83
82
  <!-- AURO-GENERATED-CONTENT:END -->
84
83
  </div>
85
84
  </auro-accordion>
86
85
  <auro-accordion class="section" id="cdnAccordion">
87
- <span slot="trigger">CDN Installation</span>
86
+ <span slot="trigger">CDN installation</span>
88
87
  <div class="accordion-content">
89
88
  <p class="warning"><strong>Warning:</strong> CDN registration can cause conflicts if another package registers the same tag name using a different version of the component, leading to unexpected behavior. Use custom registration to avoid this risk.</p>
90
89
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/getting-started/cdnRegistration.md) -->
91
90
  <!-- The below content is automatically added from ./../docs/partials/getting-started/cdnRegistration.md -->
92
91
  <p>Add the following script tag to your HTML to load the component directly from a CDN:</p>
93
92
 
94
- <pre class="language-html"><code class="language-html">&lt;script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-dialog@latest/+esm"&gt;&lt;/script&gt;</code></pre>
93
+ <pre class="language-html"><code class="language-html">&lt;script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-dialog@latest/+esm"&gt;&lt;/script&gt;</code></pre>
95
94
 
96
- <p>This script registers the <code>&lt;auro-dialog&gt;</code> custom element globally. You can then use it in your HTML:</p>
95
+ <p>This script registers the <code>&lt;auro-dialog&gt;</code> custom element globally. Then use it in your HTML:</p>
97
96
 
98
97
  <pre class="language-html"><code class="language-html">&lt;auro-dialog id="cdn-dialog"&gt;
99
98
  &lt;span slot="header"&gt;Dialog header&lt;/span&gt;
@@ -101,7 +100,7 @@ AuroDialog.register('custom-dialog');</code></pre>
101
100
  &lt;div slot="footer"&gt;
102
101
  &lt;auro-button id="closeCdn"&gt;Close&lt;/auro-button&gt;
103
102
  &lt;/div&gt;
104
- &lt;/auro-dialog&gt;</code></pre>
103
+ &lt;/auro-dialog&gt;</code></pre>
105
104
  <!-- AURO-GENERATED-CONTENT:END -->
106
105
  </div>
107
106
  </auro-accordion>
@@ -115,20 +114,18 @@ AuroDialog.register('custom-dialog');</code></pre>
115
114
  <!-- The below content is automatically added from ./../docs/partials/getting-started/react.md -->
116
115
  React 19 includes <auro-hyperlink href="https://react.dev/blog/2024/12/05/react-19#support-for-custom-elements">native support for custom elements</auro-hyperlink>, so <code>&lt;auro-dialog&gt;</code> works directly in JSX without any wrapper library.
117
116
 
118
- <auro-header level="3" id="reactImport">Import the Component</auro-header>
119
- Import and register the component at the top level of your application (e.g. in your root `main.tsx` or `App.tsx`):
117
+ <auro-header level="3" id="reactImport">Import the component</auro-header>
118
+ Import and register the component at the top level of your application (for example, in your root `main.tsx` or `App.tsx`):
120
119
 
121
120
  <pre class="language-js"><code class="language-js">import { AuroDialog } from '@aurodesignsystem/auro-dialog/class';
122
- ​
123
- AuroDialog.register('custom-dialog');</code></pre>
121
+ &#10;AuroDialog.register('custom-dialog');</code></pre>
124
122
 
125
- <auro-header level="3" id="reactTypeScript">TypeScript Declarations</auro-header>
126
- The component ships with TypeScript type definitions for the `AuroDialog` class. However, React's JSX does not automatically map custom element tag names to their types. React 19 removed the global `JSX` namespace, so custom element types are registered by augmenting the `react` module rather than using `declare global`. Add the following declaration to a `.d.ts` file in your project:
123
+ <auro-header level="3" id="reactTypeScript">TypeScript declarations</auro-header>
124
+ The component ships with TypeScript type definitions for the `AuroDialog` class. However, React's JSX doesn't automatically map custom element tag names to their types. React 19 removed the global `JSX` namespace, so custom element types are registered by augmenting the `react` module rather than using `declare global`. Add the following declaration to a `.d.ts` file in your project:
127
125
 
128
126
  <pre class="language-ts"><code class="language-ts">import type { HTMLAttributes } from 'react';
129
127
  import type { AuroDialog } from '@aurodesignsystem/auro-dialog/class';
130
- ​
131
- declare module 'react' {
128
+ &#10;declare module 'react' {
132
129
  namespace JSX {
133
130
  interface IntrinsicElements {
134
131
  'custom-dialog': HTMLAttributes&lt;AuroDialog&gt; &amp; Partial&lt;AuroDialog&gt;;
@@ -136,25 +133,22 @@ declare module 'react' {
136
133
  }
137
134
  }</code></pre>
138
135
 
139
- If your `tsconfig.json` uses the automatic runtime (`"jsx": "react-jsx"`, the React 19 default) and the types are not picked up, augment `'react/jsx-runtime'` instead of `'react'`.
136
+ If your `tsconfig.json` uses the automatic runtime (`"jsx": "react-jsx"`, the React 19 default) and the types aren't picked up, augment `'react/jsx-runtime'` instead of `'react'`.
140
137
 
141
- <auro-header level="3" id="reactState">Controlling the Open State</auro-header>
138
+ <auro-header level="3" id="reactState">Controlling the open state</auro-header>
142
139
  The dialog's visibility is controlled by the `open` attribute. Use component state to toggle it, and listen for the component's `toggle` event (which fires when the dialog closes) to keep your state in sync:
143
140
 
144
141
  <pre class="language-jsx"><code class="language-jsx">import { useState, useRef, useEffect } from 'react';
145
- ​
146
- export default function Example() {
142
+ &#10;export default function Example() {
147
143
  const dialogRef = useRef(null);
148
144
  const [open, setOpen] = useState(false);
149
- ​
150
- useEffect(() =&gt; {
145
+ &#10; useEffect(() =&gt; {
151
146
  const dialog = dialogRef.current;
152
147
  const handleToggle = () =&gt; setOpen(false);
153
148
  dialog?.addEventListener('toggle', handleToggle);
154
149
  return () =&gt; dialog?.removeEventListener('toggle', handleToggle);
155
150
  }, []);
156
- ​
157
- return (
151
+ &#10; return (
158
152
  &lt;&gt;
159
153
  &lt;auro-button onClick={() =&gt; setOpen(true)}&gt;Open dialog&lt;/auro-button&gt;
160
154
  &lt;custom-dialog ref={dialogRef} open={open || undefined}&gt;
@@ -177,46 +171,42 @@ export default function Example() {
177
171
  <!-- The below content is automatically added from ./../docs/partials/getting-started/svelte.md -->
178
172
  Svelte works with custom elements out of the box, so <code>&lt;auro-dialog&gt;</code> can be used directly in your markup.
179
173
 
180
- <auro-header level="3" id="svelteImport">Import the Component</auro-header>
181
- Import and register the component in a script block — either once at the app root, or in the component that uses it:
174
+ <auro-header level="3" id="svelteImport">Import the component</auro-header>
175
+ Import and register the component in a script block, either once at the app root or in the component that uses it:
182
176
 
183
177
  <pre class="language-html"><code class="language-html">&lt;script lang="ts"&gt;
184
178
  import { AuroDialog } from '@aurodesignsystem/auro-dialog/class';
185
- ​
186
- AuroDialog.register('custom-dialog');
187
- &lt;/script&gt;</code></pre>
179
+ &#10; AuroDialog.register('custom-dialog');
180
+ &lt;/script&gt;</code></pre>
188
181
 
189
- <auro-header level="3" id="svelteTypeScript">TypeScript Declarations</auro-header>
190
- Svelte does not automatically know about custom element attributes. To get autocomplete and type checking for `<auro-dialog>` props in templates, add the following to a `.d.ts` file in your project (e.g. `src/auro-elements.d.ts`):
182
+ <auro-header level="3" id="svelteTypeScript">TypeScript declarations</auro-header>
183
+ Svelte doesn't automatically know about custom element attributes. To get autocomplete and type checking for `<auro-dialog>` props in templates, add the following to a `.d.ts` file in your project, such as `src/auro-elements.d.ts`:
191
184
 
192
185
  <pre class="language-ts"><code class="language-ts">import type { AuroDialog } from '@aurodesignsystem/auro-dialog/class';
193
- ​
194
- declare namespace svelteHTML {
186
+ &#10;declare namespace svelteHTML {
195
187
  interface IntrinsicElements {
196
188
  'custom-dialog': Partial&lt;AuroDialog&gt; &amp; svelteHTML.HTMLAttributes&lt;AuroDialog&gt;;
197
189
  }
198
190
  }</code></pre>
199
191
 
200
- <auro-header level="3" id="svelteState">Controlling the Open State</auro-header>
192
+ <auro-header level="3" id="svelteState">Controlling the open state</auro-header>
201
193
  Bind the `open` attribute to a reactive state value, and listen for the component's `toggle` event to reset it when the dialog is dismissed:
202
194
 
203
195
  <pre class="language-html"><code class="language-html">&lt;script lang="ts"&gt;
204
196
  import { AuroDialog } from '@aurodesignsystem/auro-dialog/class';
205
- ​
206
- AuroDialog.register('custom-dialog');
207
- ​
208
- let open = $state(false);
209
- &lt;/script&gt;
210
- &lt;auro-button onclick={() =&gt; (open = true)}&gt;Open dialog&lt;/auro-button&gt;
211
- &lt;custom-dialog {open} ontoggle={() =&gt; (open = false)}&gt;
197
+ &#10; AuroDialog.register('custom-dialog');
198
+ &#10; let open = $state(false);
199
+ &lt;/script&gt;
200
+ &#10;&lt;auro-button onclick={() =&gt; (open = true)}&gt;Open dialog&lt;/auro-button&gt;
201
+ &#10;&lt;custom-dialog {open} ontoggle={() =&gt; (open = false)}&gt;
212
202
  &lt;span slot="header"&gt;Dialog header&lt;/span&gt;
213
203
  &lt;div slot="content"&gt;Dialog content&lt;/div&gt;
214
204
  &lt;div slot="footer"&gt;
215
205
  &lt;auro-button onclick={() =&gt; (open = false)}&gt;Close&lt;/auro-button&gt;
216
206
  &lt;/div&gt;
217
- &lt;/custom-dialog&gt;</code></pre>
207
+ &lt;/custom-dialog&gt;</code></pre>
218
208
 
219
- <auro-header level="3" id="svelteModuleResolution">Module Resolution</auro-header>
209
+ <auro-header level="3" id="svelteModuleResolution">Module resolution</auro-header>
220
210
  Ensure your `tsconfig.json` uses `"moduleResolution": "bundler"` so TypeScript can resolve the component's package exports:
221
211
 
222
212
  <pre class="language-json"><code class="language-json">{
@@ -230,13 +220,14 @@ Ensure your `tsconfig.json` uses `"moduleResolution": "bundler"` so TypeScript c
230
220
  </auro-accordion-group>
231
221
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/getting-started/minimal-config.md) -->
232
222
  <!-- The below content is automatically added from ./../docs/partials/getting-started/minimal-config.md -->
233
- <auro-header level="2" id="minimalConfig">Minimal Configuration</auro-header>
234
- <p>Every <code>&lt;auro-dialog&gt;</code> implementation requires:</p>
223
+ <auro-header level="2" id="minimalConfig">Minimal configuration</auro-header>
224
+ <p>A minimal <code>&lt;auro-dialog&gt;</code> has:</p>
235
225
  <ul>
236
- <li><strong>A unique <code>id</code> attribute</strong> — so the dialog can be targeted by the trigger that opens it.</li>
237
- <li><strong>Content in the <code>header</code>, <code>content</code>, and <code>footer</code> slots</strong> — the three structural regions of a formatted dialog. The <code>footer</code> is reserved for action buttons.</li>
238
- <li><strong>A trigger that toggles the <code>open</code> state</strong> — the dialog does not open on its own; a control on the page sets its <code>open</code> attribute (or <code>open</code> property) to <code>true</code>.</li>
239
- </ul>
226
+ <li><strong>A unique <code>id</code></strong>: Lets the control that opens the dialog find it.</li>
227
+ <li><strong>Content in the <code>header</code> and <code>content</code> slots</strong>: The <code>header</code> slot labels the dialog for screen readers, and the <code>content</code> slot holds the body.</li>
228
+ <li><strong>A trigger that sets <code>open</code></strong>: The dialog doesn't open on its own, so a control on the page must set its <code>open</code> attribute or property.</li>
229
+ </ul>
230
+ <p>Add a button in the <code>footer</code> slot so people can close the dialog. A <code>modal</code> dialog needs one, because it has no close button.</p>
240
231
 
241
232
  <pre class="language-html"><code class="language-html">&lt;auro-dialog id="minimal"&gt;
242
233
  &lt;span slot="header"&gt;Header content&lt;/span&gt;
@@ -244,44 +235,43 @@ Ensure your `tsconfig.json` uses `"moduleResolution": "bundler"` so TypeScript c
244
235
  &lt;div slot="footer"&gt;
245
236
  &lt;auro-button id="closeMinimal"&gt;Close&lt;/auro-button&gt;
246
237
  &lt;/div&gt;
247
- &lt;/auro-dialog&gt;</code></pre>
238
+ &lt;/auro-dialog&gt;</code></pre>
248
239
 
249
240
  <auro-header level="3" id="minimalConfigTrigger">Opening and closing the dialog</auro-header>
250
- <p>The <code>open</code> state is controlled via the <code>open</code> attribute, or programmatically by setting the <code>open</code> property to <code>true</code>. The example below toggles the attribute from a helper function:</p>
241
+ <p>Control the open state with the <code>open</code> attribute, or set the <code>open</code> property to <code>true</code> in JavaScript. The example below toggles the attribute from a helper function:</p>
251
242
 
252
243
  <pre class="language-js"><code class="language-js">function toggleDialog(dialogID) {
253
244
  const dialog = document.querySelector(dialogID);
254
- ​
255
- if (dialog.hasAttribute('open')) {
245
+ &#10; if (dialog.hasAttribute('open')) {
256
246
  dialog.removeAttribute('open');
257
247
  } else {
258
248
  dialog.setAttribute('open', true);
259
249
  }
260
250
  }</code></pre>
261
251
 
262
- <pre class="language-html"><code class="language-html">&lt;auro-button onclick="toggleDialog('#minimal')"&gt;Open dialog&lt;/auro-button&gt;</code></pre>
252
+ <pre class="language-html"><code class="language-html">&lt;auro-button onclick="toggleDialog('#minimal')"&gt;Open dialog&lt;/auro-button&gt;</code></pre>
263
253
 
264
- <p>The component also exposes <code>show()</code> and <code>hide()</code> methods for imperative control, and dispatches a <code>toggle</code> event when it closes.</p>
254
+ <p>The component also has <code>show()</code> and <code>hide()</code> methods, and dispatches a <code>toggle</code> event when it closes.</p>
265
255
  <!-- AURO-GENERATED-CONTENT:END -->
266
256
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/getting-started/slots.md) -->
267
257
  <!-- The below content is automatically added from ./../docs/partials/getting-started/slots.md -->
268
258
  <auro-header level="2" id="slots">Slots</auro-header>
269
259
  <p>The following slots are available on the <code>&lt;auro-dialog&gt;</code> element.</p>
270
260
  <auro-header level="3" id="slot-header">header</auro-header>
271
- <p>Text to display as the header of the dialog. Rendered inside the dialog's labelled heading (<code>id="dialog-header"</code>), which provides the dialog's accessible name.</p>
261
+ <p>Text for the dialog's heading, which also names the dialog for screen readers. Isn't shown when <code>unformatted</code> is set.</p>
272
262
  <auro-header level="3" id="slot-content">content</auro-header>
273
- <p>Injects content into the body of the dialog. In an <code>unformatted</code> dialog this slot fills the entire dialog window edge-to-edge.</p>
263
+ <p>Content for the body of the dialog. In an <code>unformatted</code> dialog, this slot fills the whole dialog window edge to edge.</p>
274
264
  <auro-header level="3" id="slot-footer">footer</auro-header>
275
- <p>Used for action options, e.g. buttons. In a <code>modal</code> dialog this slot must contain the control that dismisses the dialog, since no default close button is rendered.</p>
265
+ <p>Action buttons for the dialog, such as Close. A <code>modal</code> dialog needs a button here, because it has no close button. Isn't shown when <code>unformatted</code> is set.</p>
276
266
  <auro-header level="3" id="slot-ariaLabel-dialog-close">ariaLabel.dialog.close</auro-header>
277
- <p>Text to describe the "x" icon close button for screen readers. If no text is provided, the default text <code>"Close"</code> is used. Has no effect on <code>modal</code> dialogs, which do not render a close button.</p>
267
+ <p>Text screen readers read for the close button, for example "Close dialog". Defaults to "Close". Has no effect when <code>modal</code> is set, because a modal dialog has no close button.</p>
278
268
  <!-- AURO-GENERATED-CONTENT:END -->
279
- <auro-header level="2" id="stateManagement">State Management</auro-header>
269
+ <auro-header level="2" id="stateManagement">State management</auro-header>
280
270
  <p>The following properties reflect and control the current state of the component and can be accessed via JavaScript.</p>
281
271
  <auro-header level="3" id="open">open</auro-header>
282
272
  <p>Gets or sets the visibility of the dialog. Setting <code>open</code> to <code>true</code> shows the dialog; setting it to <code>false</code> hides it. Reflected to the <code>open</code> attribute.</p>
283
273
  <auro-header level="3" id="modal">modal</auro-header>
284
- <p>When <code>true</code>, the dialog is blocking: the close button is not rendered, <code>Esc</code> and backdrop clicks do not dismiss it, and the user must resolve it with an explicit footer action.</p>
274
+ <p>When <code>true</code>, the dialog is blocking: the close button isn't rendered, <code>Esc</code> and backdrop clicks don't dismiss it, and the user must resolve it with an explicit footer action.</p>
285
275
  <auro-header level="3" id="triggerElement">triggerElement</auro-header>
286
276
  <p>A fallback element to focus when the dialog closes. By default focus returns to whatever element was active (<code>document.activeElement</code>) when the dialog opened; <code>triggerElement</code> is used only when no element was active at that moment.</p>
287
277
  <auro-header level="2" id="publicFunctions">Functions</auro-header>
package/demo/index.md CHANGED
@@ -1,12 +1,12 @@
1
- <auro-header level="1" id="overview">Dialog - Overview and UX Guide</auro-header>
1
+ <auro-header level="1" id="overview">Dialog - Overview and UX guide</auro-header>
2
2
  <div class="contentWrapper">
3
3
  <nav>
4
4
  <auro-nav anchorNavContent=".scrollWrapper">
5
- <span slot="mobileToggleCollapsed">View More</span>
6
- <span slot="mobileToggleExpanded">View Less</span>
5
+ <span slot="mobileToggleCollapsed">View more</span>
6
+ <span slot="mobileToggleExpanded">View less</span>
7
7
  <auro-anchorlink fluid href="#description">Description</auro-anchorlink>
8
- <auro-anchorlink fluid href="#useCases">Use Cases</auro-anchorlink>
9
- <auro-anchorlink fluid href="#userStories">User Stories</auro-anchorlink>
8
+ <auro-anchorlink fluid href="#useCases">Use cases</auro-anchorlink>
9
+ <auro-anchorlink fluid href="#userStories">User stories</auro-anchorlink>
10
10
  <auro-anchorlink fluid href="#modalExample">Modal</auro-anchorlink>
11
11
  </auro-nav>
12
12
  </nav>
@@ -15,9 +15,9 @@
15
15
  <auro-header level="2" id="description">Description</auro-header>
16
16
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/description.md) -->
17
17
  <!-- The below content is automatically added from ./../docs/partials/description.md -->
18
- <p>The <code>&lt;auro-dialog&gt;</code> component is an intrusive interactive component, not passive. The component is best used when there is a requirement the user be made aware of the content being shown, moving focus from the main content to the dialog content.</p>
19
- <p>The component also supports a modal (blocking) state where the user must interact with the content of the component in order to continue. Passive dismissal of the content is not allowed. Users of this state must add a trigger for the user to move beyond this content.</p>
20
- <p>Auro holds the opinions of the <a class="hyperlink" href="https://www.nngroup.com/articles/modal-nonmodal-dialog/" target="_blank">Nielsen Norman Group</a> on dialog and modal use to be true.</p>
18
+ <p>The <code>&lt;auro-dialog&gt;</code> component interrupts the page and moves focus into the dialog. Use it when people need to notice the content right away.</p>
19
+ <p>Use <code>modal</code> when people must act before they continue. A modal dialog can't be dismissed passively, so add a footer button that closes it.</p>
20
+ <p>Auro follows the <a class="hyperlink" href="https://www.nngroup.com/articles/modal-nonmodal-dialog/" target="_blank">Nielsen Norman Group</a>'s guidance on dialogs and modals.</p>
21
21
  <!-- AURO-GENERATED-CONTENT:END -->
22
22
  <div class="exampleWrapper">
23
23
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
@@ -26,7 +26,7 @@
26
26
  <auro-button id="openBasic">Open default dialog</auro-button>
27
27
  </div>
28
28
  <auro-dialog id="defaultDialog">
29
- <span slot="header">Default Dialog</span>
29
+ <span slot="header">Default dialog</span>
30
30
  <div slot="content">
31
31
  <p>When traveling on Alaska Airlines flights, Alaska Airlines checked baggage fees may apply. See <auro-hyperlink href="https://www.alaskaair.com/bagrules" target="_blank">alaskaair.com/bagrules</auro-hyperlink> for our rules. For itineraries that include other airlines, their checked baggage fees may apply, as displayed on their websites.</p>
32
32
  <p>Baggage rules and fees will be based on the specific itinerary chosen. The applicable first and second bag fees will be displayed after you have added flights to the cart.</p>
@@ -39,7 +39,7 @@
39
39
  </ul>
40
40
  </div>
41
41
  <div slot="footer">
42
- <auro-button secondary id="closeBasic">Close</auro-button>
42
+ <auro-button variant="secondary" id="closeBasic">Close</auro-button>
43
43
  </div>
44
44
  </auro-dialog>
45
45
  <!-- AURO-GENERATED-CONTENT:END -->
@@ -51,9 +51,9 @@
51
51
 
52
52
  <pre class="language-html"><code class="language-html">&lt;div&gt;
53
53
  &lt;auro-button id="openBasic"&gt;Open default dialog&lt;/auro-button&gt;
54
- &lt;/div&gt;
55
- &lt;auro-dialog id="defaultDialog"&gt;
56
- &lt;span slot="header"&gt;Default Dialog&lt;/span&gt;
54
+ &lt;/div&gt;
55
+ &#10;&lt;auro-dialog id="defaultDialog"&gt;
56
+ &lt;span slot="header"&gt;Default dialog&lt;/span&gt;
57
57
  &lt;div slot="content"&gt;
58
58
  &lt;p&gt;When traveling on Alaska Airlines flights, Alaska Airlines checked baggage fees may apply. See &lt;auro-hyperlink href="https://www.alaskaair.com/bagrules" target="_blank"&gt;alaskaair.com/bagrules&lt;/auro-hyperlink&gt; for our rules. For itineraries that include other airlines, their checked baggage fees may apply, as displayed on their websites.&lt;/p&gt;
59
59
  &lt;p&gt;Baggage rules and fees will be based on the specific itinerary chosen. The applicable first and second bag fees will be displayed after you have added flights to the cart.&lt;/p&gt;
@@ -66,34 +66,34 @@
66
66
  &lt;/ul&gt;
67
67
  &lt;/div&gt;
68
68
  &lt;div slot="footer"&gt;
69
- &lt;auro-button secondary id="closeBasic"&gt;Close&lt;/auro-button&gt;
69
+ &lt;auro-button variant="secondary" id="closeBasic"&gt;Close&lt;/auro-button&gt;
70
70
  &lt;/div&gt;
71
- &lt;/auro-dialog&gt;</code></pre>
71
+ &lt;/auro-dialog&gt;</code></pre>
72
72
  <!-- AURO-GENERATED-CONTENT:END -->
73
73
  </auro-accordion>
74
- <auro-header level="2" id="useCases">Use Cases</auro-header>
74
+ <auro-header level="2" id="useCases">Use cases</auro-header>
75
75
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/useCases.md) -->
76
76
  <!-- The below content is automatically added from ./../docs/partials/useCases.md -->
77
- <p>The <code>&lt;auro-dialog&gt;</code> component should be used in situations where users may:</p>
77
+ <p>Use <code>&lt;auro-dialog&gt;</code> when people need to:</p>
78
78
  <ul>
79
- <li>Be prompted to take an action before doing anything else or going back</li>
80
- <li>Be prompted to view content with the option of closing it</li>
79
+ <li>Take an action before they do anything else or go back</li>
80
+ <li>View content that they can close when they're done</li>
81
81
  </ul>
82
82
  <!-- AURO-GENERATED-CONTENT:END -->
83
- <auro-header level="2" id="userStories">User Stories</auro-header>
83
+ <auro-header level="2" id="userStories">User stories</auro-header>
84
84
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/index/userStories.md) -->
85
85
  <!-- The below content is automatically added from ./../docs/partials/index/userStories.md -->
86
86
  <p>The following user stories describe the primary ways the <code>&lt;auro-dialog&gt;</code> component is intended to be used.</p>
87
87
  <auro-header level="3" id="story-dismissible">Dismissible dialog</auro-header>
88
- <p>As a user, I want to be shown important supplemental information in a focused overlay that I can dismiss — by pressing the close button, pressing <code>Esc</code>, or clicking outside the dialog — so I can return to the main content when I am done reading.</p>
88
+ <p>As a user, I want to be shown important supplemental information in a focused overlay that I can dismiss by pressing the close button, pressing <code>Esc</code>, or clicking outside the dialog, so I can return to the main content when I'm done reading.</p>
89
89
  <auro-header level="3" id="story-modal">Modal (blocking) dialog</auro-header>
90
90
  <p>As a user, I need to be prompted to make a decision or acknowledge information before I can continue, so the experience presents a modal dialog that I must resolve with an explicit action before returning to the page.</p>
91
91
  <auro-header level="3" id="story-unformatted">Unformatted dialog</auro-header>
92
92
  <p>As a developer, I want the open/close behavior, focus management, and accessibility tooling of the dialog while supplying my own edge-to-edge layout, so I can present rich media or a fully custom composition inside the dialog window.</p>
93
93
  <!-- AURO-GENERATED-CONTENT:END -->
94
94
  <auro-header level="2" id="modalExample">Modal</auro-header>
95
- <p>The <code>modal</code> attribute locks the user into interacting with the dialog. The close icon is not rendered and clicking outside the dialog will not dismiss it, so a <code>modal</code> dialog must include an explicit action button in the footer to dismiss it.</p>
96
- <p>Freezing the page behind the dialog is not what <code>modal</code> controls — every dialog does that while it is open, and restores the scroll position on close. What <code>modal</code> changes is how the dialog can be dismissed. See the Accessibility page for details.</p>
95
+ <p>The <code>modal</code> attribute locks the user into interacting with the dialog. The close icon isn't rendered and clicking outside the dialog doesn't dismiss it, so a <code>modal</code> dialog must include an explicit action button in the footer to dismiss it.</p>
96
+ <p>Freezing the page behind the dialog isn't what <code>modal</code> controls. Every dialog does that while it's open, and restores the scroll position on close. What <code>modal</code> changes is how the dialog can be dismissed. See the Accessibility page for details.</p>
97
97
  <div class="exampleWrapper">
98
98
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/modal.html) -->
99
99
  <!-- The below content is automatically added from ./../apiExamples/modal.html -->
@@ -103,7 +103,7 @@
103
103
  <auro-button id="openSmallModal">Open small modal</auro-button>
104
104
  </div>
105
105
  <auro-dialog id="defaultModalDialog" modal>
106
- <span slot="header">Default Modal Dialog</span>
106
+ <span slot="header">Default modal dialog</span>
107
107
  <div slot="content">
108
108
  <p>When traveling on Alaska Airlines flights, Alaska Airlines checked baggage fees may apply. See <auro-hyperlink href="https://www.alaskaair.com/bagrules" target="_blank">alaskaair.com/bagrules</auro-hyperlink> for our rules. For itineraries that include other airlines, their checked baggage fees may apply, as displayed on their websites.</p>
109
109
  <p>Baggage rules and fees will be based on the specific itinerary chosen. The applicable first and second bag fees will be displayed after you have added flights to the cart.</p>
@@ -117,12 +117,12 @@
117
117
  </div>
118
118
  <div slot="footer">
119
119
  <auro-button id="closeDefaultModal">I understand
120
- <auro-icon category="interface" name="chevron-right" emphasis appearance="inverse"></auro-icon>
120
+ <auro-icon category="interface" name="chevron-right" appearance="inverse"></auro-icon>
121
121
  </auro-button>
122
122
  </div>
123
123
  </auro-dialog>
124
124
  <auro-dialog id="mediumModalDialog" md modal>
125
- <span slot="header">Medium Dialog</span>
125
+ <span slot="header">Medium modal dialog</span>
126
126
  <div slot="content">
127
127
  <p>When traveling on Alaska Airlines flights, Alaska Airlines checked baggage fees may apply. See <auro-hyperlink href="https://www.alaskaair.com/bagrules" target="_blank">alaskaair.com/bagrules</auro-hyperlink> for our rules. For itineraries that include other airlines, their checked baggage fees may apply, as displayed on their websites.</p>
128
128
  <p>Baggage rules and fees will be based on the specific itinerary chosen. The applicable first and second bag fees will be displayed after you have added flights to the cart.</p>
@@ -136,12 +136,12 @@
136
136
  </div>
137
137
  <div slot="footer">
138
138
  <auro-button id="closeMediumModal">I understand
139
- <auro-icon category="interface" name="chevron-right" emphasis appearance="inverse"></auro-icon>
139
+ <auro-icon category="interface" name="chevron-right" appearance="inverse"></auro-icon>
140
140
  </auro-button>
141
141
  </div>
142
142
  </auro-dialog>
143
143
  <auro-dialog id="smallModalDialog" sm modal>
144
- <span slot="header">Small Dialog</span>
144
+ <span slot="header">Small modal dialog</span>
145
145
  <div slot="content">
146
146
  <p>When traveling on Alaska Airlines flights, Alaska Airlines checked baggage fees may apply. See <auro-hyperlink href="https://www.alaskaair.com/bagrules" target="_blank">alaskaair.com/bagrules</auro-hyperlink> for our rules. For itineraries that include other airlines, their checked baggage fees may apply, as displayed on their websites.</p>
147
147
  <p>Baggage rules and fees will be based on the specific itinerary chosen. The applicable first and second bag fees will be displayed after you have added flights to the cart.</p>
@@ -155,7 +155,7 @@
155
155
  </div>
156
156
  <div slot="footer">
157
157
  <auro-button id="closeSmallModal">I understand
158
- <auro-icon category="interface" name="chevron-right" emphasis appearance="inverse"></auro-icon>
158
+ <auro-icon category="interface" name="chevron-right" appearance="inverse"></auro-icon>
159
159
  </auro-button>
160
160
  </div>
161
161
  </auro-dialog>
@@ -170,9 +170,9 @@
170
170
  &lt;auro-button id="openDefaultModal"&gt;Open default modal&lt;/auro-button&gt;
171
171
  &lt;auro-button id="openMediumModal"&gt;Open medium modal&lt;/auro-button&gt;
172
172
  &lt;auro-button id="openSmallModal"&gt;Open small modal&lt;/auro-button&gt;
173
- &lt;/div&gt;
174
- &lt;auro-dialog id="defaultModalDialog" modal&gt;
175
- &lt;span slot="header"&gt;Default Modal Dialog&lt;/span&gt;
173
+ &lt;/div&gt;
174
+ &#10;&lt;auro-dialog id="defaultModalDialog" modal&gt;
175
+ &lt;span slot="header"&gt;Default modal dialog&lt;/span&gt;
176
176
  &lt;div slot="content"&gt;
177
177
  &lt;p&gt;When traveling on Alaska Airlines flights, Alaska Airlines checked baggage fees may apply. See &lt;auro-hyperlink href="https://www.alaskaair.com/bagrules" target="_blank"&gt;alaskaair.com/bagrules&lt;/auro-hyperlink&gt; for our rules. For itineraries that include other airlines, their checked baggage fees may apply, as displayed on their websites.&lt;/p&gt;
178
178
  &lt;p&gt;Baggage rules and fees will be based on the specific itinerary chosen. The applicable first and second bag fees will be displayed after you have added flights to the cart.&lt;/p&gt;
@@ -186,12 +186,12 @@
186
186
  &lt;/div&gt;
187
187
  &lt;div slot="footer"&gt;
188
188
  &lt;auro-button id="closeDefaultModal"&gt;I understand
189
- &lt;auro-icon category="interface" name="chevron-right" emphasis appearance="inverse"&gt;&lt;/auro-icon&gt;
189
+ &lt;auro-icon category="interface" name="chevron-right" appearance="inverse"&gt;&lt;/auro-icon&gt;
190
190
  &lt;/auro-button&gt;
191
191
  &lt;/div&gt;
192
- &lt;/auro-dialog&gt;
193
- &lt;auro-dialog id="mediumModalDialog" md modal&gt;
194
- &lt;span slot="header"&gt;Medium Dialog&lt;/span&gt;
192
+ &lt;/auro-dialog&gt;
193
+ &#10;&lt;auro-dialog id="mediumModalDialog" md modal&gt;
194
+ &lt;span slot="header"&gt;Medium modal dialog&lt;/span&gt;
195
195
  &lt;div slot="content"&gt;
196
196
  &lt;p&gt;When traveling on Alaska Airlines flights, Alaska Airlines checked baggage fees may apply. See &lt;auro-hyperlink href="https://www.alaskaair.com/bagrules" target="_blank"&gt;alaskaair.com/bagrules&lt;/auro-hyperlink&gt; for our rules. For itineraries that include other airlines, their checked baggage fees may apply, as displayed on their websites.&lt;/p&gt;
197
197
  &lt;p&gt;Baggage rules and fees will be based on the specific itinerary chosen. The applicable first and second bag fees will be displayed after you have added flights to the cart.&lt;/p&gt;
@@ -205,12 +205,12 @@
205
205
  &lt;/div&gt;
206
206
  &lt;div slot="footer"&gt;
207
207
  &lt;auro-button id="closeMediumModal"&gt;I understand
208
- &lt;auro-icon category="interface" name="chevron-right" emphasis appearance="inverse"&gt;&lt;/auro-icon&gt;
208
+ &lt;auro-icon category="interface" name="chevron-right" appearance="inverse"&gt;&lt;/auro-icon&gt;
209
209
  &lt;/auro-button&gt;
210
210
  &lt;/div&gt;
211
- &lt;/auro-dialog&gt;
212
- &lt;auro-dialog id="smallModalDialog" sm modal&gt;
213
- &lt;span slot="header"&gt;Small Dialog&lt;/span&gt;
211
+ &lt;/auro-dialog&gt;
212
+ &#10;&lt;auro-dialog id="smallModalDialog" sm modal&gt;
213
+ &lt;span slot="header"&gt;Small modal dialog&lt;/span&gt;
214
214
  &lt;div slot="content"&gt;
215
215
  &lt;p&gt;When traveling on Alaska Airlines flights, Alaska Airlines checked baggage fees may apply. See &lt;auro-hyperlink href="https://www.alaskaair.com/bagrules" target="_blank"&gt;alaskaair.com/bagrules&lt;/auro-hyperlink&gt; for our rules. For itineraries that include other airlines, their checked baggage fees may apply, as displayed on their websites.&lt;/p&gt;
216
216
  &lt;p&gt;Baggage rules and fees will be based on the specific itinerary chosen. The applicable first and second bag fees will be displayed after you have added flights to the cart.&lt;/p&gt;
@@ -224,10 +224,10 @@
224
224
  &lt;/div&gt;
225
225
  &lt;div slot="footer"&gt;
226
226
  &lt;auro-button id="closeSmallModal"&gt;I understand
227
- &lt;auro-icon category="interface" name="chevron-right" emphasis appearance="inverse"&gt;&lt;/auro-icon&gt;
227
+ &lt;auro-icon category="interface" name="chevron-right" appearance="inverse"&gt;&lt;/auro-icon&gt;
228
228
  &lt;/auro-button&gt;
229
229
  &lt;/div&gt;
230
- &lt;/auro-dialog&gt;</code></pre>
230
+ &lt;/auro-dialog&gt;</code></pre>
231
231
  <!-- AURO-GENERATED-CONTENT:END -->
232
232
  </auro-accordion>
233
233
  </div>