@aurodesignsystem-dev/auro-formkit 0.0.0-pr1475.6 → 0.0.0-pr1477.1
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/components/bibtemplate/dist/auro-bibtemplate.d.ts +0 -7
- package/components/bibtemplate/dist/index.js +1 -9
- package/components/bibtemplate/dist/registered.js +1 -9
- package/components/checkbox/demo/customize.min.js +1 -1
- package/components/checkbox/demo/getting-started.min.js +1 -1
- package/components/checkbox/demo/index.min.js +1 -1
- package/components/checkbox/demo/pages.json +1 -1
- package/components/checkbox/dist/index.js +1 -1
- package/components/checkbox/dist/registered.js +1 -1
- package/components/combobox/demo/customize.min.js +18 -236
- package/components/combobox/demo/getting-started.min.js +18 -236
- package/components/combobox/demo/index.min.js +18 -236
- package/components/combobox/demo/keyboard-behavior.md +68 -8
- package/components/combobox/demo/pages.json +1 -1
- package/components/combobox/dist/index.js +18 -236
- package/components/combobox/dist/registered.js +18 -236
- package/components/counter/demo/customize.min.js +15 -233
- package/components/counter/demo/index.min.js +15 -233
- package/components/counter/demo/keyboard-behavior.md +0 -1
- package/components/counter/demo/pages.json +1 -1
- package/components/counter/dist/index.js +2 -10
- package/components/counter/dist/registered.js +2 -10
- package/components/datepicker/demo/accessibility.md +3 -51
- package/components/datepicker/demo/api.md +2 -11
- package/components/datepicker/demo/customize.html +0 -2
- package/components/datepicker/demo/customize.md +8 -72
- package/components/datepicker/demo/design.md +1 -3
- package/components/datepicker/demo/index.js +1 -5
- package/components/datepicker/demo/index.md +2 -83
- package/components/datepicker/demo/index.min.js +100 -1567
- package/components/datepicker/demo/keyboard-behavior.md +2 -201
- package/components/datepicker/demo/pages.json +1 -1
- package/components/datepicker/demo/voiceover.md +12 -19
- package/components/datepicker/dist/index.js +98 -1489
- package/components/datepicker/dist/registered.js +98 -1489
- package/components/datepicker/dist/src/auro-calendar-cell.d.ts +1 -66
- package/components/datepicker/dist/src/auro-calendar-month.d.ts +0 -28
- package/components/datepicker/dist/src/auro-calendar.d.ts +0 -100
- package/components/datepicker/dist/src/auro-datepicker.d.ts +0 -88
- package/components/datepicker/dist/src/datepickerKeyboardStrategy.d.ts +3 -5
- package/components/dropdown/demo/accessibility.md +0 -11
- package/components/dropdown/demo/api.md +0 -1
- package/components/dropdown/demo/customize.md +0 -3
- package/components/dropdown/demo/customize.min.js +13 -223
- package/components/dropdown/demo/getting-started.min.js +13 -223
- package/components/dropdown/demo/index.min.js +13 -223
- package/components/dropdown/demo/keyboard-behavior.md +0 -1
- package/components/dropdown/demo/pages.json +1 -1
- package/components/dropdown/dist/auro-dropdown.d.ts +1 -33
- package/components/dropdown/dist/index.js +13 -223
- package/components/dropdown/dist/registered.js +13 -223
- package/components/form/demo/customize.min.js +165 -2208
- package/components/form/demo/getting-started.min.js +165 -2208
- package/components/form/demo/index.min.js +165 -2208
- package/components/form/demo/pages.json +1 -1
- package/components/form/demo/registerDemoDeps.min.js +165 -2208
- package/components/input/demo/customize.min.js +1 -1
- package/components/input/demo/getting-started.min.js +1 -1
- package/components/input/demo/index.min.js +1 -1
- package/components/input/demo/pages.json +1 -1
- package/components/input/dist/index.js +1 -1
- package/components/input/dist/registered.js +1 -1
- package/components/menu/demo/pages.json +1 -1
- package/components/radio/demo/getting-started.js +1 -1
- package/components/radio/demo/getting-started.md +1 -1
- package/components/radio/demo/index.min.js +1 -1
- package/components/radio/demo/pages.json +1 -1
- package/components/radio/dist/index.js +1 -1
- package/components/radio/dist/registered.js +1 -1
- package/components/select/demo/customize.min.js +33 -249
- package/components/select/demo/getting-started.min.js +33 -249
- package/components/select/demo/index.min.js +33 -249
- package/components/select/demo/keyboard-behavior.md +54 -9
- package/components/select/demo/pages.json +1 -1
- package/components/select/dist/index.js +33 -249
- package/components/select/dist/registered.js +33 -249
- package/custom-elements.json +21 -738
- package/package.json +2 -2
- package/components/checkbox/demo/why-checkbox.html +0 -57
- package/components/checkbox/demo/why-checkbox.md +0 -86
- package/components/combobox/demo/why-combobox.html +0 -57
- package/components/combobox/demo/why-combobox.md +0 -113
- package/components/counter/demo/why-counter.html +0 -57
- package/components/counter/demo/why-counter.md +0 -108
- package/components/datepicker/demo/customize.js +0 -19
- package/components/datepicker/demo/customize.min.js +0 -26028
- package/components/datepicker/demo/why-datepicker.html +0 -57
- package/components/datepicker/demo/why-datepicker.md +0 -133
- package/components/dropdown/demo/why-dropdown.html +0 -57
- package/components/dropdown/demo/why-dropdown.md +0 -97
- package/components/form/demo/why-form.html +0 -57
- package/components/form/demo/why-form.md +0 -101
- package/components/input/demo/why-input.html +0 -57
- package/components/input/demo/why-input.md +0 -121
- package/components/menu/demo/why-menu.html +0 -57
- package/components/menu/demo/why-menu.md +0 -104
- package/components/radio/demo/customize.min.js +0 -2186
- package/components/radio/demo/demo-support.min.js +0 -55807
- package/components/radio/demo/getting-started.min.js +0 -2205
- package/components/radio/demo/why-radio.html +0 -57
- package/components/radio/demo/why-radio.md +0 -92
- package/components/select/demo/why-select.html +0 -57
- package/components/select/demo/why-select.md +0 -128
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3
|
-
See LICENSE in the project root for license information.
|
|
4
|
-
|
|
5
|
-
HTML in this document is standardized and NOT to be edited.
|
|
6
|
-
All demo code should be added/edited in ./demo/why-datepicker.md
|
|
7
|
-
|
|
8
|
-
With the exception of adding custom elements if needed for the demo.
|
|
9
|
-
|
|
10
|
-
----------------------- DO NOT EDIT -----------------------------
|
|
11
|
-
|
|
12
|
-
-->
|
|
13
|
-
|
|
14
|
-
<!DOCTYPE html>
|
|
15
|
-
<html lang="en">
|
|
16
|
-
<head>
|
|
17
|
-
<meta charset="UTF-8" />
|
|
18
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
19
|
-
<title>Auro Web Component Demo | auro-datepicker | Why auro-datepicker</title>
|
|
20
|
-
|
|
21
|
-
<!-- highlight.js Stylesheet -->
|
|
22
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/github.min.css"/>
|
|
23
|
-
|
|
24
|
-
<!-- Legacy reference is still needed to support auro-datepicker's use of legacy token values at this time -->
|
|
25
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
|
|
26
|
-
|
|
27
|
-
<!-- Design Token Alaska Theme -->
|
|
28
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/themes/alaska/CSSCustomProperties--alaska.min.css"/>
|
|
29
|
-
|
|
30
|
-
<!-- Webcore Stylesheet Alaska Theme -->
|
|
31
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/themes/alaska.global.min.css" />
|
|
32
|
-
|
|
33
|
-
<!-- Demo Specific Styles -->
|
|
34
|
-
<link rel="stylesheet" type="text/css" href="./styles.min.css" />
|
|
35
|
-
<style>
|
|
36
|
-
table {
|
|
37
|
-
--ds-color-container-secondary-default: transparent;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
tr:not(:last-of-type) {
|
|
41
|
-
border-bottom: 1px solid var(--ds-color-border-tertiary-default);
|
|
42
|
-
}
|
|
43
|
-
</style>
|
|
44
|
-
</head>
|
|
45
|
-
<body class="auro-markdown">
|
|
46
|
-
<main></main>
|
|
47
|
-
|
|
48
|
-
<script type="module">
|
|
49
|
-
import { renderPage } from './demo-support.min.js';
|
|
50
|
-
await renderPage('./why-datepicker.md');
|
|
51
|
-
</script>
|
|
52
|
-
|
|
53
|
-
<!-- If additional elements are needed for the demo, add them here. -->
|
|
54
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-header@latest/+esm" type="module"></script>
|
|
55
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-hyperlink@latest/+esm" type="module"></script>
|
|
56
|
-
</body>
|
|
57
|
-
</html>
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
<auro-header level="1" id="overview">Why auro-datepicker?</auro-header>
|
|
2
|
-
<p>The native HTML <code><input type="date"></code> element provides a minimal date-picking experience, but it falls short for the needs of a complex, accessible, and branded application. <code>auro-datepicker</code> bridges those gaps with a purpose-built component designed for real-world use.</p>
|
|
3
|
-
<auro-header level="2" id="accessibility">Accessibility</auro-header>
|
|
4
|
-
<p>Native date inputs vary widely across browsers and platforms, with inconsistent screen reader announcements, keyboard behavior, and focus management.</p>
|
|
5
|
-
<p><code>auro-datepicker</code> provides:</p>
|
|
6
|
-
<ul>
|
|
7
|
-
<li><strong>Full keyboard navigation</strong> — Arrow keys move between days, months, and years. Enter and Space select a date. Escape closes the calendar. The roving <code>tabindex</code> pattern ensures only one cell is in the tab order at a time, so users can Tab past the calendar efficiently.</li>
|
|
8
|
-
<li><strong>Rich ARIA semantics</strong> — Every cell is labeled with its full date, day-of-week, and contextual state (e.g. "selected", "today", "unavailable", "range start", "in range"). Screen reader users hear meaningful announcements, not just numbers.</li>
|
|
9
|
-
<li><strong>Live region announcements</strong> — Month changes are announced via <code>aria-live</code> so assistive technology users know the visible month has changed.</li>
|
|
10
|
-
<li><strong>Reduced motion support</strong> — Scrolling and transitions respect <code>prefers-reduced-motion</code>.</li>
|
|
11
|
-
<li><strong>Focus management</strong> — Opening the calendar moves focus to the active date cell. Closing it returns focus to the trigger input. The fullscreen dialog uses <code>showModal()</code> for native inert-background behavior, while the desktop modal traps focus within the bib.</li>
|
|
12
|
-
</ul>
|
|
13
|
-
<p>By contrast, native <code><input type="date"></code> delegates all of this to the browser, and the result differs significantly between Chrome, Safari, and Firefox — often with no keyboard navigation of the calendar grid at all on some platforms.</p>
|
|
14
|
-
<auro-header level="2" id="dateRangeSelection">Date range selection</auro-header>
|
|
15
|
-
<p>HTML has no native concept of a date range picker. Building one from two <code><input type="date"></code> elements requires custom logic for coordinating values, enforcing start-before-end ordering, and providing a unified visual experience.</p>
|
|
16
|
-
<p><code>auro-datepicker</code> handles this with a single <code>range</code> attribute, providing:</p>
|
|
17
|
-
<ul>
|
|
18
|
-
<li>Two coordinated input fields with shared calendar interaction</li>
|
|
19
|
-
<li>Visual range highlighting across the calendar grid</li>
|
|
20
|
-
<li>Customizable ARIA labels for range positions (start, end, in-range, before range, after range)</li>
|
|
21
|
-
<li>Automatic value coordination between departure and return dates</li>
|
|
22
|
-
</ul>
|
|
23
|
-
<auro-header level="2" id="blackoutDates">Blackout dates</auro-header>
|
|
24
|
-
<p>Native date inputs have no mechanism to mark specific dates as unavailable. <code>minDate</code> and <code>maxDate</code> can restrict to a range, but they cannot express "these specific dates within the range are not selectable."</p>
|
|
25
|
-
<p><code>auro-datepicker</code> supports a <code>blackoutDates</code> array of ISO date strings. Blacked-out dates are:</p>
|
|
26
|
-
<ul>
|
|
27
|
-
<li>Visually styled as unavailable</li>
|
|
28
|
-
<li>Announced as unavailable (with a customizable label like "sold out") to screen readers</li>
|
|
29
|
-
<li>Focusable but not selectable via click or keyboard</li>
|
|
30
|
-
<li>Validated on typed input — entering a blackout date triggers a <code>customError</code> validity state</li>
|
|
31
|
-
</ul>
|
|
32
|
-
<auro-header level="2" id="validation">Validation</auro-header>
|
|
33
|
-
<p>Native date validation is limited to <code>required</code>, <code>min</code>, and <code>max</code>. Error messages are browser-controlled and cannot be customized.</p>
|
|
34
|
-
<p><code>auro-datepicker</code> integrates with the Auro form validation system:</p>
|
|
35
|
-
<ul>
|
|
36
|
-
<li>Supports <code>required</code>, <code>minDate</code>, <code>maxDate</code>, and blackout date constraints</li>
|
|
37
|
-
<li>Custom error messages for each validity state (<code>setCustomValidityValueMissing</code>, <code>setCustomValidityRangeOverflow</code>, <code>setCustomValidityRangeUnderflow</code>, <code>setCustomValidityCustomError</code>)</li>
|
|
38
|
-
<li>Validation runs on blur, on value change, and when constraints change (e.g. <code>blackoutDates</code> is updated)</li>
|
|
39
|
-
<li>Dispatches <code>auroFormElement-validated</code> events so parent forms can react</li>
|
|
40
|
-
<li>Displays errors inline via the help text slot</li>
|
|
41
|
-
</ul>
|
|
42
|
-
<auro-header level="2" id="responsiveLayout">Responsive layout</auro-header>
|
|
43
|
-
<p>Native date inputs render a small, browser-controlled popup that cannot be styled or repositioned.</p>
|
|
44
|
-
<p><code>auro-datepicker</code> adapts to viewport size:</p>
|
|
45
|
-
<ul>
|
|
46
|
-
<li><strong>Desktop</strong> — Calendar appears as a positioned dropdown bib, with optional modal behavior (<code>desktopModal</code>) that traps focus and makes background content inert</li>
|
|
47
|
-
<li><strong>Mobile</strong> — Calendar opens as a fullscreen dialog via <code>showModal()</code>, with a configurable breakpoint (<code>fullscreenBreakpoint</code>). The virtual keyboard stays open during the transition so users can continue typing</li>
|
|
48
|
-
<li><strong>Multi-month</strong> — Desktop viewports can display two months side-by-side for range selection</li>
|
|
49
|
-
</ul>
|
|
50
|
-
<auro-header level="2" id="localization">Localization</auro-header>
|
|
51
|
-
<p>Native <code><input type="date"></code> follows the browser's locale for display format, but offers no control over month names, labels, or ARIA text.</p>
|
|
52
|
-
<p><code>auro-datepicker</code> supports:</p>
|
|
53
|
-
<ul>
|
|
54
|
-
<li>Custom <code>monthNames</code> arrays for any language</li>
|
|
55
|
-
<li>Localizable navigation labels (<code>navLabelPrevMonth</code>, <code>navLabelNextMonth</code>)</li>
|
|
56
|
-
<li>Localizable range position labels for screen readers</li>
|
|
57
|
-
<li>Customizable <code>blackoutLabel</code> text</li>
|
|
58
|
-
<li>Configurable date display format</li>
|
|
59
|
-
</ul>
|
|
60
|
-
<auro-header level="2" id="customCellContent">Custom cell content</auro-header>
|
|
61
|
-
<p>Native date inputs render a fixed grid of numbers. There is no way to add prices, icons, or supplementary information to individual dates.</p>
|
|
62
|
-
<p><code>auro-datepicker</code> supports per-date slot content:</p>
|
|
63
|
-
<ul>
|
|
64
|
-
<li><strong>Date slots</strong> (<code>date_MM_DD_YYYY</code>) — Add custom HTML below the date number (e.g. flight prices, availability indicators)</li>
|
|
65
|
-
<li><strong>Popover slots</strong> (<code>popover_MM_DD_YYYY</code>) — Add popover content that appears on hover or focus for a specific date</li>
|
|
66
|
-
<li><strong>Reference dates</strong> — Display reference data alongside dates for decision-making</li>
|
|
67
|
-
</ul>
|
|
68
|
-
<auro-header level="2" id="designSystemIntegration">Design system integration</auro-header>
|
|
69
|
-
<p>A native <code><input type="date"></code> cannot be styled to match a design system. Shadow DOM browser controls resist CSS customization, and the calendar popup is entirely outside author control.</p>
|
|
70
|
-
<p><code>auro-datepicker</code> is built with the Alaska Airlines Auro Design System:</p>
|
|
71
|
-
<ul>
|
|
72
|
-
<li>Consistent visual language with other Auro form components</li>
|
|
73
|
-
<li>Light and dark theme support (<code>appearance="default"</code> or <code>appearance="inverse"</code>)</li>
|
|
74
|
-
<li>CSS custom properties and <code>::part()</code> selectors for targeted styling</li>
|
|
75
|
-
<li>Composed from versioned Auro sub-components (dropdown, input, button, icon) for consistency</li>
|
|
76
|
-
</ul>
|
|
77
|
-
<auro-header level="2" id="summary">Summary</auro-header>
|
|
78
|
-
<table>
|
|
79
|
-
<thead>
|
|
80
|
-
<tr>
|
|
81
|
-
<th>Capability</th>
|
|
82
|
-
<th><code><input type="date"></code></th>
|
|
83
|
-
<th><code>auro-datepicker</code></th>
|
|
84
|
-
</tr>
|
|
85
|
-
</thead>
|
|
86
|
-
<tbody>
|
|
87
|
-
<tr>
|
|
88
|
-
<td>Keyboard navigation</td>
|
|
89
|
-
<td>Browser-dependent</td>
|
|
90
|
-
<td>Full arrow-key grid navigation</td>
|
|
91
|
-
</tr>
|
|
92
|
-
<tr>
|
|
93
|
-
<td>Screen reader support</td>
|
|
94
|
-
<td>Inconsistent</td>
|
|
95
|
-
<td>Rich ARIA labels and live regions</td>
|
|
96
|
-
</tr>
|
|
97
|
-
<tr>
|
|
98
|
-
<td>Date range</td>
|
|
99
|
-
<td>Not supported</td>
|
|
100
|
-
<td>Built-in with <code>range</code> attribute</td>
|
|
101
|
-
</tr>
|
|
102
|
-
<tr>
|
|
103
|
-
<td>Blackout dates</td>
|
|
104
|
-
<td>Not supported</td>
|
|
105
|
-
<td><code>blackoutDates</code> array with validation</td>
|
|
106
|
-
</tr>
|
|
107
|
-
<tr>
|
|
108
|
-
<td>Custom validation messages</td>
|
|
109
|
-
<td>Not supported</td>
|
|
110
|
-
<td>Per-constraint custom messages</td>
|
|
111
|
-
</tr>
|
|
112
|
-
<tr>
|
|
113
|
-
<td>Responsive layout</td>
|
|
114
|
-
<td>Fixed popup</td>
|
|
115
|
-
<td>Desktop dropdown / mobile fullscreen</td>
|
|
116
|
-
</tr>
|
|
117
|
-
<tr>
|
|
118
|
-
<td>Custom cell content</td>
|
|
119
|
-
<td>Not supported</td>
|
|
120
|
-
<td>Per-date slots and popovers</td>
|
|
121
|
-
</tr>
|
|
122
|
-
<tr>
|
|
123
|
-
<td>Localization</td>
|
|
124
|
-
<td>Browser locale only</td>
|
|
125
|
-
<td>Fully configurable labels and names</td>
|
|
126
|
-
</tr>
|
|
127
|
-
<tr>
|
|
128
|
-
<td>Theming</td>
|
|
129
|
-
<td>Minimal / browser-dependent</td>
|
|
130
|
-
<td>Full design system integration</td>
|
|
131
|
-
</tr>
|
|
132
|
-
</tbody>
|
|
133
|
-
</table>
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3
|
-
See LICENSE in the project root for license information.
|
|
4
|
-
|
|
5
|
-
HTML in this document is standardized and NOT to be edited.
|
|
6
|
-
All demo code should be added/edited in ./demo/why-dropdown.md
|
|
7
|
-
|
|
8
|
-
With the exception of adding custom elements if needed for the demo.
|
|
9
|
-
|
|
10
|
-
----------------------- DO NOT EDIT -----------------------------
|
|
11
|
-
|
|
12
|
-
-->
|
|
13
|
-
|
|
14
|
-
<!DOCTYPE html>
|
|
15
|
-
<html lang="en">
|
|
16
|
-
<head>
|
|
17
|
-
<meta charset="UTF-8" />
|
|
18
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
19
|
-
<title>Auro Web Component Demo | auro-dropdown | Why auro-dropdown</title>
|
|
20
|
-
|
|
21
|
-
<!-- highlight.js Stylesheet -->
|
|
22
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/github.min.css"/>
|
|
23
|
-
|
|
24
|
-
<!-- Legacy reference is still needed to support auro-dropdown's use of legacy token values at this time -->
|
|
25
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
|
|
26
|
-
|
|
27
|
-
<!-- Design Token Alaska Theme -->
|
|
28
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/themes/alaska/CSSCustomProperties--alaska.min.css"/>
|
|
29
|
-
|
|
30
|
-
<!-- Webcore Stylesheet Alaska Theme -->
|
|
31
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/themes/alaska.global.min.css" />
|
|
32
|
-
|
|
33
|
-
<!-- Demo Specific Styles -->
|
|
34
|
-
<link rel="stylesheet" type="text/css" href="./styles.min.css" />
|
|
35
|
-
<style>
|
|
36
|
-
table {
|
|
37
|
-
--ds-color-container-secondary-default: transparent;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
tr:not(:last-of-type) {
|
|
41
|
-
border-bottom: 1px solid var(--ds-color-border-tertiary-default);
|
|
42
|
-
}
|
|
43
|
-
</style>
|
|
44
|
-
</head>
|
|
45
|
-
<body class="auro-markdown">
|
|
46
|
-
<main></main>
|
|
47
|
-
|
|
48
|
-
<script type="module">
|
|
49
|
-
import { renderPage } from './demo-support.min.js';
|
|
50
|
-
await renderPage('./why-dropdown.md');
|
|
51
|
-
</script>
|
|
52
|
-
|
|
53
|
-
<!-- If additional elements are needed for the demo, add them here. -->
|
|
54
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-header@latest/+esm" type="module"></script>
|
|
55
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-hyperlink@latest/+esm" type="module"></script>
|
|
56
|
-
</body>
|
|
57
|
-
</html>
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
<auro-header level="1" id="overview">Why auro-dropdown?</auro-header>
|
|
2
|
-
<p>Native HTML has no dedicated dropdown/popover primitive that combines trigger management, content positioning, focus trapping, and responsive behavior. Building a dropdown from <code><details></code>/<code><summary></code> or custom <code><div></code> toggles requires significant work for accessibility and positioning. <code>auro-dropdown</code> provides a production-ready solution.</p>
|
|
3
|
-
<auro-header level="2" id="accessibility">Accessibility</auro-header>
|
|
4
|
-
<p>Custom dropdown implementations often break keyboard navigation, fail to trap focus, or leave background content interactive when the dropdown is open.</p>
|
|
5
|
-
<p><code>auro-dropdown</code> provides:</p>
|
|
6
|
-
<ul>
|
|
7
|
-
<li><strong>Focus trapping</strong> — In desktop modal mode, Tab and Shift+Tab cycle within the dropdown content. Background content is made inert. The implementation handles focus across shadow DOM boundaries.</li>
|
|
8
|
-
<li><strong>Native dialog semantics</strong> — On mobile, the dropdown opens via <code>showModal()</code>, which provides browser-native focus trapping and background inert behavior.</li>
|
|
9
|
-
<li><strong>ARIA attributes</strong> — The trigger carries <code>aria-expanded</code>, <code>aria-controls</code>, and a configurable <code>role</code> (default: <code>button</code>). The dropdown bib has an accessible dialog label.</li>
|
|
10
|
-
<li><strong>Focus delegation</strong> — <code>delegatesFocus: true</code> ensures clicks on the trigger container route focus to the correct interactive element.</li>
|
|
11
|
-
<li><strong>Escape to close</strong> — The dialog's cancel event is handled to close the dropdown on Escape.</li>
|
|
12
|
-
</ul>
|
|
13
|
-
<auro-header level="2" id="positioning">Positioning</auro-header>
|
|
14
|
-
<p>Positioning a dropdown relative to its trigger — accounting for viewport edges, scroll containers, and dynamic content — is a complex problem that native HTML does not solve.</p>
|
|
15
|
-
<p><code>auro-dropdown</code> integrates Floating UI with:</p>
|
|
16
|
-
<ul>
|
|
17
|
-
<li>Configurable <code>placement</code> (12 positions: top/bottom/left/right with start/center/end)</li>
|
|
18
|
-
<li><code>offset</code> control for gap between trigger and content</li>
|
|
19
|
-
<li><code>noFlip</code> to prevent automatic repositioning</li>
|
|
20
|
-
<li><code>shift</code> to slide the dropdown along the edge to avoid clipping</li>
|
|
21
|
-
<li><code>autoPlacement</code> to let the library choose the best position</li>
|
|
22
|
-
<li><code>matchWidth</code> to size the dropdown to the trigger width</li>
|
|
23
|
-
<li>Layout containment escape so the dropdown is not clipped by ancestor <code>overflow</code> or <code><dialog></code> elements</li>
|
|
24
|
-
</ul>
|
|
25
|
-
<auro-header level="2" id="responsiveBehavior">Responsive behavior</auro-header>
|
|
26
|
-
<p>Native disclosure elements have no concept of viewport-aware presentation.</p>
|
|
27
|
-
<p><code>auro-dropdown</code> adapts to the viewport:</p>
|
|
28
|
-
<ul>
|
|
29
|
-
<li><strong>Desktop</strong> — Content appears as a positioned panel with optional modal behavior</li>
|
|
30
|
-
<li><strong>Mobile</strong> — Content opens as a fullscreen dialog below a configurable breakpoint (<code>fullscreenBreakpoint</code>: xs, sm, md, lg, xl, or disabled)</li>
|
|
31
|
-
<li><strong>Desktop modal</strong> — <code>desktopModal</code> makes background siblings inert, traps focus within the dropdown, and prevents interaction with page content — all without going fullscreen</li>
|
|
32
|
-
</ul>
|
|
33
|
-
<auro-header level="2" id="contentagnostic">Content-agnostic</auro-header>
|
|
34
|
-
<p>Unlike <code><select></code>, which only accepts <code><option></code> elements, <code>auro-dropdown</code> accepts any HTML content in its default slot. This makes it the foundation for composed components like <code>auro-select</code>, <code>auro-combobox</code>, and <code>auro-counter-group</code>.</p>
|
|
35
|
-
<auro-header level="2" id="triggerFlexibility">Trigger flexibility</auro-header>
|
|
36
|
-
<p>The <code>trigger</code> slot accepts any content — plain text, buttons, inputs, or complex custom elements. The component detects whether the trigger content is focusable and adjusts tabindex and ARIA attributes accordingly.</p>
|
|
37
|
-
<auro-header level="2" id="designSystemIntegration">Design system integration</auro-header>
|
|
38
|
-
<p><code>auro-dropdown</code> is built with the Auro Design System:</p>
|
|
39
|
-
<ul>
|
|
40
|
-
<li>Three layout options: classic, emphasized, snowflake</li>
|
|
41
|
-
<li>Light and dark theme support (<code>appearance</code>)</li>
|
|
42
|
-
<li>Chevron indicator for expand/collapse state</li>
|
|
43
|
-
<li>CSS <code>::part()</code> selectors (<code>trigger</code>, <code>chevron</code>, <code>size</code>, <code>helpText</code>)</li>
|
|
44
|
-
<li>Help text slot with error message support</li>
|
|
45
|
-
</ul>
|
|
46
|
-
<auro-header level="2" id="summary">Summary</auro-header>
|
|
47
|
-
<table>
|
|
48
|
-
<thead>
|
|
49
|
-
<tr>
|
|
50
|
-
<th>Capability</th>
|
|
51
|
-
<th><code><details></code> / custom div</th>
|
|
52
|
-
<th><code>auro-dropdown</code></th>
|
|
53
|
-
</tr>
|
|
54
|
-
</thead>
|
|
55
|
-
<tbody>
|
|
56
|
-
<tr>
|
|
57
|
-
<td>Viewport-aware positioning</td>
|
|
58
|
-
<td>No</td>
|
|
59
|
-
<td>Floating UI with flip/shift/auto</td>
|
|
60
|
-
</tr>
|
|
61
|
-
<tr>
|
|
62
|
-
<td>Focus trapping</td>
|
|
63
|
-
<td>No</td>
|
|
64
|
-
<td>Desktop modal + fullscreen dialog</td>
|
|
65
|
-
</tr>
|
|
66
|
-
<tr>
|
|
67
|
-
<td>Background inert</td>
|
|
68
|
-
<td>No</td>
|
|
69
|
-
<td>Automatic in modal modes</td>
|
|
70
|
-
</tr>
|
|
71
|
-
<tr>
|
|
72
|
-
<td>Keyboard close (Escape)</td>
|
|
73
|
-
<td>No</td>
|
|
74
|
-
<td>Built-in</td>
|
|
75
|
-
</tr>
|
|
76
|
-
<tr>
|
|
77
|
-
<td>Mobile fullscreen</td>
|
|
78
|
-
<td>No</td>
|
|
79
|
-
<td>Automatic at breakpoint</td>
|
|
80
|
-
</tr>
|
|
81
|
-
<tr>
|
|
82
|
-
<td>Any HTML content</td>
|
|
83
|
-
<td>Yes</td>
|
|
84
|
-
<td>Yes</td>
|
|
85
|
-
</tr>
|
|
86
|
-
<tr>
|
|
87
|
-
<td>Trigger detection</td>
|
|
88
|
-
<td>No</td>
|
|
89
|
-
<td>Auto-detects focusable content</td>
|
|
90
|
-
</tr>
|
|
91
|
-
<tr>
|
|
92
|
-
<td>Theming</td>
|
|
93
|
-
<td>No</td>
|
|
94
|
-
<td>Three layouts + appearance modes</td>
|
|
95
|
-
</tr>
|
|
96
|
-
</tbody>
|
|
97
|
-
</table>
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3
|
-
See LICENSE in the project root for license information.
|
|
4
|
-
|
|
5
|
-
HTML in this document is standardized and NOT to be edited.
|
|
6
|
-
All demo code should be added/edited in ./demo/why-form.md
|
|
7
|
-
|
|
8
|
-
With the exception of adding custom elements if needed for the demo.
|
|
9
|
-
|
|
10
|
-
----------------------- DO NOT EDIT -----------------------------
|
|
11
|
-
|
|
12
|
-
-->
|
|
13
|
-
|
|
14
|
-
<!DOCTYPE html>
|
|
15
|
-
<html lang="en">
|
|
16
|
-
<head>
|
|
17
|
-
<meta charset="UTF-8" />
|
|
18
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
19
|
-
<title>Auro Web Component Demo | auro-form | Why auro-form</title>
|
|
20
|
-
|
|
21
|
-
<!-- highlight.js Stylesheet -->
|
|
22
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/github.min.css"/>
|
|
23
|
-
|
|
24
|
-
<!-- Legacy reference is still needed to support auro-form's use of legacy token values at this time -->
|
|
25
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
|
|
26
|
-
|
|
27
|
-
<!-- Design Token Alaska Theme -->
|
|
28
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/themes/alaska/CSSCustomProperties--alaska.min.css"/>
|
|
29
|
-
|
|
30
|
-
<!-- Webcore Stylesheet Alaska Theme -->
|
|
31
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/themes/alaska.global.min.css" />
|
|
32
|
-
|
|
33
|
-
<!-- Demo Specific Styles -->
|
|
34
|
-
<link rel="stylesheet" type="text/css" href="./styles.min.css" />
|
|
35
|
-
<style>
|
|
36
|
-
table {
|
|
37
|
-
--ds-color-container-secondary-default: transparent;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
tr:not(:last-of-type) {
|
|
41
|
-
border-bottom: 1px solid var(--ds-color-border-tertiary-default);
|
|
42
|
-
}
|
|
43
|
-
</style>
|
|
44
|
-
</head>
|
|
45
|
-
<body class="auro-markdown">
|
|
46
|
-
<main></main>
|
|
47
|
-
|
|
48
|
-
<script type="module">
|
|
49
|
-
import { renderPage } from './demo-support.min.js';
|
|
50
|
-
await renderPage('./why-form.md');
|
|
51
|
-
</script>
|
|
52
|
-
|
|
53
|
-
<!-- If additional elements are needed for the demo, add them here. -->
|
|
54
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-header@latest/+esm" type="module"></script>
|
|
55
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-hyperlink@latest/+esm" type="module"></script>
|
|
56
|
-
</body>
|
|
57
|
-
</html>
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
<auro-header level="1" id="overview">Why auro-form?</auro-header>
|
|
2
|
-
<p>The native <code><form></code> element handles submission and reset for standard HTML inputs, but it has no awareness of web components, cannot orchestrate validation across custom elements, and provides no centralized state management. <code>auro-form</code> fills these gaps for applications built with Auro components.</p>
|
|
3
|
-
<auro-header level="2" id="customElementAwareness">Custom element awareness</auro-header>
|
|
4
|
-
<p>Native <code><form></code> relies on the browser's form association API, which web components must explicitly opt into via <code>ElementInternals</code>. Even when they do, coordinating validation state, required fields, and submission values across a mix of Auro components requires custom JavaScript.</p>
|
|
5
|
-
<p><code>auro-form</code> automatically discovers and manages:</p>
|
|
6
|
-
<ul>
|
|
7
|
-
<li><code>auro-input</code></li>
|
|
8
|
-
<li><code>auro-select</code></li>
|
|
9
|
-
<li><code>auro-datepicker</code></li>
|
|
10
|
-
<li><code>auro-combobox</code></li>
|
|
11
|
-
<li><code>auro-checkbox-group</code></li>
|
|
12
|
-
<li><code>auro-radio-group</code></li>
|
|
13
|
-
<li><code>auro-counter-group</code></li>
|
|
14
|
-
</ul>
|
|
15
|
-
<p>New elements added to the DOM are detected via <code>MutationObserver</code> and integrated automatically.</p>
|
|
16
|
-
<auro-header level="2" id="validationOrchestration">Validation orchestration</auro-header>
|
|
17
|
-
<p>Native forms validate each input independently. There is no built-in way to check "are all required fields valid?" without querying each element manually.</p>
|
|
18
|
-
<p><code>auro-form</code> provides:</p>
|
|
19
|
-
<ul>
|
|
20
|
-
<li>A single <code>validity</code> getter that returns <code>'valid'</code>, <code>'invalid'</code>, or <code>null</code> based on the aggregate state of all child form elements</li>
|
|
21
|
-
<li>Automatic validation of all elements on <code>submit()</code> — each element's <code>validate(true)</code> is called to force error display</li>
|
|
22
|
-
<li>Per-element validity tracking via an internal <code>formState</code> object</li>
|
|
23
|
-
<li>Listening for <code>auroFormElement-validated</code> events from child components to stay in sync</li>
|
|
24
|
-
</ul>
|
|
25
|
-
<auro-header level="2" id="centralizedState">Centralized state</auro-header>
|
|
26
|
-
<p>Native forms have no concept of "has the user touched anything?" or "what are all the current values?"</p>
|
|
27
|
-
<p><code>auro-form</code> tracks:</p>
|
|
28
|
-
<ul>
|
|
29
|
-
<li><strong><code>value</code></strong> — A key-value object of all form element values, keyed by element <code>name</code></li>
|
|
30
|
-
<li><strong><code>isInitialState</code></strong> — Whether any element has been modified since initialization</li>
|
|
31
|
-
<li><strong>Submit/reset button state</strong> — Submit and reset buttons are automatically disabled based on form state (e.g., reset is disabled when the form is in its initial state)</li>
|
|
32
|
-
</ul>
|
|
33
|
-
<auro-header level="2" id="submitAndReset">Submit and reset</auro-header>
|
|
34
|
-
<p>Native form submission navigates to a URL or requires <code>event.preventDefault()</code> and manual value extraction.</p>
|
|
35
|
-
<p><code>auro-form</code> simplifies this:</p>
|
|
36
|
-
<ul>
|
|
37
|
-
<li><strong><code>submit()</code></strong> — Validates all elements. If valid, dispatches a <code>submit</code> event with a <code>detail.value</code> object containing all form values. No page navigation.</li>
|
|
38
|
-
<li><strong><code>reset()</code></strong> — Resets all child elements to their initial state, dispatches a <code>reset</code> event with <code>detail.previousValue</code> containing the pre-reset values.</li>
|
|
39
|
-
<li><strong>Enter key</strong> — Pressing Enter on a form element triggers <code>submit()</code>, matching native form behavior. Textareas are excluded to allow newlines.</li>
|
|
40
|
-
</ul>
|
|
41
|
-
<auro-header level="2" id="eventNormalization">Event normalization</auro-header>
|
|
42
|
-
<p>Each Auro component dispatches its own events (<code>auroSelect-valueSet</code>, <code>auroDatePicker-valueSet</code>, etc.). Listening for all of these individually is error-prone.</p>
|
|
43
|
-
<p><code>auro-form</code> normalizes events:</p>
|
|
44
|
-
<ul>
|
|
45
|
-
<li><code>input</code> — Fired when any child element receives user input</li>
|
|
46
|
-
<li><code>change</code> — Fired when any child element's value changes, or when the form is initialized</li>
|
|
47
|
-
<li><code>submit</code> — Fired with aggregated form values on valid submission</li>
|
|
48
|
-
<li><code>reset</code> — Fired with previous values on reset</li>
|
|
49
|
-
</ul>
|
|
50
|
-
<auro-header level="2" id="summary">Summary</auro-header>
|
|
51
|
-
<table>
|
|
52
|
-
<thead>
|
|
53
|
-
<tr>
|
|
54
|
-
<th>Capability</th>
|
|
55
|
-
<th><code><form></code></th>
|
|
56
|
-
<th><code>auro-form</code></th>
|
|
57
|
-
</tr>
|
|
58
|
-
</thead>
|
|
59
|
-
<tbody>
|
|
60
|
-
<tr>
|
|
61
|
-
<td>Web component discovery</td>
|
|
62
|
-
<td>Manual</td>
|
|
63
|
-
<td>Automatic (MutationObserver)</td>
|
|
64
|
-
</tr>
|
|
65
|
-
<tr>
|
|
66
|
-
<td>Aggregate validity</td>
|
|
67
|
-
<td>Manual querying</td>
|
|
68
|
-
<td>Single <code>validity</code> getter</td>
|
|
69
|
-
</tr>
|
|
70
|
-
<tr>
|
|
71
|
-
<td>Centralized values</td>
|
|
72
|
-
<td><code>FormData</code> (native inputs only)</td>
|
|
73
|
-
<td><code>value</code> object (all Auro components)</td>
|
|
74
|
-
</tr>
|
|
75
|
-
<tr>
|
|
76
|
-
<td>Force validation on submit</td>
|
|
77
|
-
<td>Manual per-element</td>
|
|
78
|
-
<td>Automatic</td>
|
|
79
|
-
</tr>
|
|
80
|
-
<tr>
|
|
81
|
-
<td>Submit button auto-disable</td>
|
|
82
|
-
<td>No</td>
|
|
83
|
-
<td>Yes</td>
|
|
84
|
-
</tr>
|
|
85
|
-
<tr>
|
|
86
|
-
<td>Reset to initial state</td>
|
|
87
|
-
<td>Native inputs only</td>
|
|
88
|
-
<td>All Auro components</td>
|
|
89
|
-
</tr>
|
|
90
|
-
<tr>
|
|
91
|
-
<td>Enter key submit</td>
|
|
92
|
-
<td>Native inputs only</td>
|
|
93
|
-
<td>All Auro components</td>
|
|
94
|
-
</tr>
|
|
95
|
-
<tr>
|
|
96
|
-
<td>Event normalization</td>
|
|
97
|
-
<td>No</td>
|
|
98
|
-
<td>Unified input/change/submit/reset</td>
|
|
99
|
-
</tr>
|
|
100
|
-
</tbody>
|
|
101
|
-
</table>
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3
|
-
See LICENSE in the project root for license information.
|
|
4
|
-
|
|
5
|
-
HTML in this document is standardized and NOT to be edited.
|
|
6
|
-
All demo code should be added/edited in ./demo/why-input.md
|
|
7
|
-
|
|
8
|
-
With the exception of adding custom elements if needed for the demo.
|
|
9
|
-
|
|
10
|
-
----------------------- DO NOT EDIT -----------------------------
|
|
11
|
-
|
|
12
|
-
-->
|
|
13
|
-
|
|
14
|
-
<!DOCTYPE html>
|
|
15
|
-
<html lang="en">
|
|
16
|
-
<head>
|
|
17
|
-
<meta charset="UTF-8" />
|
|
18
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
19
|
-
<title>Auro Web Component Demo | auro-input | Why auro-input</title>
|
|
20
|
-
|
|
21
|
-
<!-- highlight.js Stylesheet -->
|
|
22
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/github.min.css"/>
|
|
23
|
-
|
|
24
|
-
<!-- Legacy reference is still needed to support auro-input's use of legacy token values at this time -->
|
|
25
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
|
|
26
|
-
|
|
27
|
-
<!-- Design Token Alaska Theme -->
|
|
28
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/themes/alaska/CSSCustomProperties--alaska.min.css"/>
|
|
29
|
-
|
|
30
|
-
<!-- Webcore Stylesheet Alaska Theme -->
|
|
31
|
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/themes/alaska.global.min.css" />
|
|
32
|
-
|
|
33
|
-
<!-- Demo Specific Styles -->
|
|
34
|
-
<link rel="stylesheet" type="text/css" href="./styles.min.css" />
|
|
35
|
-
<style>
|
|
36
|
-
table {
|
|
37
|
-
--ds-color-container-secondary-default: transparent;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
tr:not(:last-of-type) {
|
|
41
|
-
border-bottom: 1px solid var(--ds-color-border-tertiary-default);
|
|
42
|
-
}
|
|
43
|
-
</style>
|
|
44
|
-
</head>
|
|
45
|
-
<body class="auro-markdown">
|
|
46
|
-
<main></main>
|
|
47
|
-
|
|
48
|
-
<script type="module">
|
|
49
|
-
import { renderPage } from './demo-support.min.js';
|
|
50
|
-
await renderPage('./why-input.md');
|
|
51
|
-
</script>
|
|
52
|
-
|
|
53
|
-
<!-- If additional elements are needed for the demo, add them here. -->
|
|
54
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-header@latest/+esm" type="module"></script>
|
|
55
|
-
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-hyperlink@latest/+esm" type="module"></script>
|
|
56
|
-
</body>
|
|
57
|
-
</html>
|