@aurodesignsystem-dev/auro-formkit 0.0.0-pr1497.0 → 0.0.0-pr1497.2

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.
Files changed (132) hide show
  1. package/components/bibtemplate/dist/auro-bibtemplate.d.ts +7 -0
  2. package/components/bibtemplate/dist/index.js +9 -1
  3. package/components/bibtemplate/dist/registered.js +9 -1
  4. package/components/checkbox/demo/css-only.html +57 -0
  5. package/components/checkbox/demo/css-only.md +146 -0
  6. package/components/checkbox/demo/customize.min.js +1 -1
  7. package/components/checkbox/demo/getting-started.min.js +1 -1
  8. package/components/checkbox/demo/index.min.js +1 -1
  9. package/components/checkbox/demo/pages.json +1 -1
  10. package/components/checkbox/demo/styles.min.css +1 -1
  11. package/components/checkbox/demo/why-checkbox.html +57 -0
  12. package/components/checkbox/demo/why-checkbox.md +86 -0
  13. package/components/checkbox/dist/index.js +1 -1
  14. package/components/checkbox/dist/registered.js +1 -1
  15. package/components/combobox/demo/css-only.html +57 -0
  16. package/components/combobox/demo/css-only.md +209 -0
  17. package/components/combobox/demo/customize.min.js +250 -16
  18. package/components/combobox/demo/getting-started.min.js +250 -16
  19. package/components/combobox/demo/index.min.js +250 -16
  20. package/components/combobox/demo/pages.json +1 -1
  21. package/components/combobox/demo/styles.min.css +1 -1
  22. package/components/combobox/demo/why-combobox.html +57 -0
  23. package/components/combobox/demo/why-combobox.md +113 -0
  24. package/components/combobox/dist/index.js +250 -16
  25. package/components/combobox/dist/registered.js +250 -16
  26. package/components/counter/demo/css-only.html +57 -0
  27. package/components/counter/demo/css-only.md +184 -0
  28. package/components/counter/demo/customize.min.js +249 -15
  29. package/components/counter/demo/index.min.js +249 -15
  30. package/components/counter/demo/keyboard-behavior.md +1 -0
  31. package/components/counter/demo/pages.json +1 -1
  32. package/components/counter/demo/styles.min.css +1 -1
  33. package/components/counter/demo/why-counter.html +57 -0
  34. package/components/counter/demo/why-counter.md +108 -0
  35. package/components/counter/dist/index.js +10 -2
  36. package/components/counter/dist/registered.js +10 -2
  37. package/components/datepicker/demo/accessibility.md +54 -3
  38. package/components/datepicker/demo/api.md +63 -53
  39. package/components/datepicker/demo/css-only.html +57 -0
  40. package/components/datepicker/demo/css-only.md +151 -0
  41. package/components/datepicker/demo/customize.html +2 -0
  42. package/components/datepicker/demo/customize.js +19 -0
  43. package/components/datepicker/demo/customize.md +56 -0
  44. package/components/datepicker/demo/customize.min.js +36147 -0
  45. package/components/datepicker/demo/design.md +3 -1
  46. package/components/datepicker/demo/index.js +5 -1
  47. package/components/datepicker/demo/index.md +104 -15
  48. package/components/datepicker/demo/index.min.js +2485 -261
  49. package/components/datepicker/demo/keyboard-behavior.md +201 -2
  50. package/components/datepicker/demo/pages.json +1 -1
  51. package/components/datepicker/demo/styles.min.css +1 -1
  52. package/components/datepicker/demo/voiceover.md +21 -12
  53. package/components/datepicker/demo/why-datepicker.html +57 -0
  54. package/components/datepicker/demo/why-datepicker.md +133 -0
  55. package/components/datepicker/dist/index.js +2348 -211
  56. package/components/datepicker/dist/registered.js +2348 -211
  57. package/components/datepicker/dist/src/auro-calendar-cell.d.ts +113 -13
  58. package/components/datepicker/dist/src/auro-calendar-month.d.ts +38 -1
  59. package/components/datepicker/dist/src/auro-calendar.d.ts +258 -0
  60. package/components/datepicker/dist/src/auro-datepicker.d.ts +141 -41
  61. package/components/datepicker/dist/src/datepickerKeyboardStrategy.d.ts +5 -3
  62. package/components/dropdown/demo/accessibility.md +11 -0
  63. package/components/dropdown/demo/api.md +1 -0
  64. package/components/dropdown/demo/css-only.html +57 -0
  65. package/components/dropdown/demo/css-only.md +219 -0
  66. package/components/dropdown/demo/customize.md +3 -0
  67. package/components/dropdown/demo/customize.min.js +239 -13
  68. package/components/dropdown/demo/getting-started.min.js +239 -13
  69. package/components/dropdown/demo/index.min.js +239 -13
  70. package/components/dropdown/demo/keyboard-behavior.md +1 -0
  71. package/components/dropdown/demo/pages.json +1 -1
  72. package/components/dropdown/demo/styles.min.css +1 -1
  73. package/components/dropdown/demo/why-dropdown.html +57 -0
  74. package/components/dropdown/demo/why-dropdown.md +97 -0
  75. package/components/dropdown/dist/auro-dropdown.d.ts +34 -1
  76. package/components/dropdown/dist/index.js +239 -13
  77. package/components/dropdown/dist/registered.js +239 -13
  78. package/components/form/demo/css-only.html +57 -0
  79. package/components/form/demo/css-only.md +156 -0
  80. package/components/form/demo/customize.min.js +3098 -259
  81. package/components/form/demo/getting-started.min.js +3098 -259
  82. package/components/form/demo/index.min.js +3098 -259
  83. package/components/form/demo/pages.json +1 -1
  84. package/components/form/demo/registerDemoDeps.min.js +3098 -259
  85. package/components/form/demo/styles.min.css +1 -1
  86. package/components/form/demo/why-form.html +57 -0
  87. package/components/form/demo/why-form.md +101 -0
  88. package/components/input/demo/css-only.html +57 -0
  89. package/components/input/demo/css-only.md +199 -0
  90. package/components/input/demo/customize.min.js +1 -1
  91. package/components/input/demo/getting-started.min.js +1 -1
  92. package/components/input/demo/index.min.js +1 -1
  93. package/components/input/demo/pages.json +1 -1
  94. package/components/input/demo/styles.min.css +1 -1
  95. package/components/input/demo/why-input.html +57 -0
  96. package/components/input/demo/why-input.md +121 -0
  97. package/components/input/dist/index.js +1 -1
  98. package/components/input/dist/registered.js +1 -1
  99. package/components/menu/demo/css-only.html +57 -0
  100. package/components/menu/demo/css-only.md +166 -0
  101. package/components/menu/demo/pages.json +1 -1
  102. package/components/menu/demo/styles.min.css +1 -1
  103. package/components/menu/demo/why-menu.html +57 -0
  104. package/components/menu/demo/why-menu.md +104 -0
  105. package/components/radio/demo/css-only.html +57 -0
  106. package/components/radio/demo/css-only.md +151 -0
  107. package/components/radio/demo/customize.min.js +1764 -0
  108. package/components/radio/demo/demo-support.min.js +55807 -0
  109. package/components/radio/demo/getting-started.js +1 -1
  110. package/components/radio/demo/getting-started.md +1 -1
  111. package/components/radio/demo/getting-started.min.js +1783 -0
  112. package/components/radio/demo/index.min.js +1 -1
  113. package/components/radio/demo/pages.json +1 -1
  114. package/components/radio/demo/styles.min.css +1 -1
  115. package/components/radio/demo/why-radio.html +57 -0
  116. package/components/radio/demo/why-radio.md +92 -0
  117. package/components/radio/dist/index.js +1 -1
  118. package/components/radio/dist/registered.js +1 -1
  119. package/components/select/demo/css-only.html +57 -0
  120. package/components/select/demo/css-only.md +203 -0
  121. package/components/select/demo/customize.min.js +249 -15
  122. package/components/select/demo/getting-started.min.js +249 -15
  123. package/components/select/demo/index.min.js +249 -15
  124. package/components/select/demo/keyboard-behavior.md +1 -0
  125. package/components/select/demo/pages.json +1 -1
  126. package/components/select/demo/styles.min.css +1 -1
  127. package/components/select/demo/why-select.html +57 -0
  128. package/components/select/demo/why-select.md +128 -0
  129. package/components/select/dist/index.js +249 -15
  130. package/components/select/dist/registered.js +249 -15
  131. package/custom-elements.json +1171 -92
  132. package/package.json +8 -8
@@ -38,13 +38,10 @@ export class AuroDatePicker extends AuroElement {
38
38
  static get properties(): {
39
39
  /**
40
40
  * Defines whether the component will be on lighter or darker backgrounds.
41
- * @property {'default', 'inverse'}
41
+ * @type {'default' | 'inverse'}
42
42
  * @default 'default'
43
43
  */
44
- appearance: {
45
- type: StringConstructor;
46
- reflect: boolean;
47
- };
44
+ appearance: "default" | "inverse";
48
45
  /**
49
46
  * If declared, bib's position will be automatically calculated where to appear.
50
47
  * @default false
@@ -53,6 +50,20 @@ export class AuroDatePicker extends AuroElement {
53
50
  type: BooleanConstructor;
54
51
  reflect: boolean;
55
52
  };
53
+ /**
54
+ * Array of dates that cannot be selected. Dates should be in ISO format (YYYY-MM-DD).
55
+ */
56
+ blackoutDates: {
57
+ type: ArrayConstructor;
58
+ reflect: boolean;
59
+ };
60
+ /**
61
+ * Label announced for blackout (disabled but in-range) date cells.
62
+ */
63
+ blackoutLabel: {
64
+ type: StringConstructor;
65
+ reflect: boolean;
66
+ };
56
67
  /**
57
68
  * The last date that may be displayed in the calendar.
58
69
  */
@@ -60,6 +71,13 @@ export class AuroDatePicker extends AuroElement {
60
71
  type: StringConstructor;
61
72
  reflect: boolean;
62
73
  };
74
+ /**
75
+ * Accessible label for the calendar grid containing the days of the month.
76
+ */
77
+ calendarGridLabel: {
78
+ type: StringConstructor;
79
+ reflect: boolean;
80
+ };
63
81
  /**
64
82
  * The date that will first be visually rendered to the user in the calendar.
65
83
  */
@@ -101,24 +119,6 @@ export class AuroDatePicker extends AuroElement {
101
119
  type: StringConstructor;
102
120
  reflect: boolean;
103
121
  };
104
- hasFocus: {
105
- type: BooleanConstructor;
106
- reflect: boolean;
107
- };
108
- /**
109
- * @private
110
- */
111
- hasValue: {
112
- type: BooleanConstructor;
113
- reflect: boolean;
114
- };
115
- /**
116
- * @private
117
- */
118
- hasAllValues: {
119
- type: BooleanConstructor;
120
- reflect: boolean;
121
- };
122
122
  /**
123
123
  * Specifies the date format. The default is `mm/dd/yyyy`.
124
124
  */
@@ -142,6 +142,24 @@ export class AuroDatePicker extends AuroElement {
142
142
  * @default 'sm'
143
143
  */
144
144
  fullscreenBreakpoint: "xs" | "sm" | "md" | "lg" | "xl" | "disabled";
145
+ /**
146
+ * @private
147
+ */
148
+ hasAllValues: {
149
+ type: BooleanConstructor;
150
+ reflect: boolean;
151
+ };
152
+ hasFocus: {
153
+ type: BooleanConstructor;
154
+ reflect: boolean;
155
+ };
156
+ /**
157
+ * @private
158
+ */
159
+ hasValue: {
160
+ type: BooleanConstructor;
161
+ reflect: boolean;
162
+ };
145
163
  /** Exposes inputmode attribute for input. */
146
164
  inputmode: {
147
165
  type: StringConstructor;
@@ -176,6 +194,12 @@ export class AuroDatePicker extends AuroElement {
176
194
  type: StringConstructor;
177
195
  reflect: boolean;
178
196
  };
197
+ /**
198
+ * @private
199
+ */
200
+ monthFirst: {
201
+ type: BooleanConstructor;
202
+ };
179
203
  /**
180
204
  * Names of all 12 months to render in the calendar.
181
205
  * When omitted, month names will be automatically populated from the active `locale` (falling back to `en-US`).
@@ -184,17 +208,24 @@ export class AuroDatePicker extends AuroElement {
184
208
  type: ArrayConstructor;
185
209
  };
186
210
  /**
187
- * If declared, the bib will NOT flip to an alternate position
188
- * when there isn't enough space in the specified `placement`.
211
+ * Accessible label for the next month navigation button.
189
212
  */
190
- noFlip: {
191
- type: BooleanConstructor;
213
+ navLabelNextMonth: {
214
+ type: StringConstructor;
192
215
  reflect: boolean;
193
216
  };
194
217
  /**
195
- * If declared, the dropdown will shift its position to avoid being cut off by the viewport.
218
+ * Accessible label for the previous month navigation button.
196
219
  */
197
- shift: {
220
+ navLabelPrevMonth: {
221
+ type: StringConstructor;
222
+ reflect: boolean;
223
+ };
224
+ /**
225
+ * If declared, the bib will NOT flip to an alternate position
226
+ * when there isn't enough space in the specified `placement`.
227
+ */
228
+ noFlip: {
198
229
  type: BooleanConstructor;
199
230
  reflect: boolean;
200
231
  };
@@ -249,6 +280,41 @@ export class AuroDatePicker extends AuroElement {
249
280
  type: BooleanConstructor;
250
281
  reflect: boolean;
251
282
  };
283
+ /**
284
+ * Label announced for cells after the range (or after start when no end is selected).
285
+ */
286
+ rangeLabelAfterRange: {
287
+ type: StringConstructor;
288
+ reflect: boolean;
289
+ };
290
+ /**
291
+ * Label announced for cells before the range start.
292
+ */
293
+ rangeLabelBeforeRange: {
294
+ type: StringConstructor;
295
+ reflect: boolean;
296
+ };
297
+ /**
298
+ * Label announced for the range end date cell.
299
+ */
300
+ rangeLabelEnd: {
301
+ type: StringConstructor;
302
+ reflect: boolean;
303
+ };
304
+ /**
305
+ * Label announced for cells within the selected range.
306
+ */
307
+ rangeLabelInRange: {
308
+ type: StringConstructor;
309
+ reflect: boolean;
310
+ };
311
+ /**
312
+ * Label announced for the range start date cell.
313
+ */
314
+ rangeLabelStart: {
315
+ type: StringConstructor;
316
+ reflect: boolean;
317
+ };
252
318
  /**
253
319
  * Dates that the user should have for reference as part of their decision making when selecting a date.
254
320
  * This should be a JSON string array of ISO date strings (`YYYY-MM-DD`).
@@ -272,6 +338,7 @@ export class AuroDatePicker extends AuroElement {
272
338
  };
273
339
  /**
274
340
  * Custom help text message to display when validity = `customError`.
341
+ * Also used as the validation message when a blackout date is typed into the input.
275
342
  */
276
343
  setCustomValidityCustomError: {
277
344
  type: StringConstructor;
@@ -294,6 +361,13 @@ export class AuroDatePicker extends AuroElement {
294
361
  setCustomValidityValueMissing: {
295
362
  type: StringConstructor;
296
363
  };
364
+ /**
365
+ * If declared, the dropdown will shift its position to avoid being cut off by the viewport.
366
+ */
367
+ shift: {
368
+ type: BooleanConstructor;
369
+ reflect: boolean;
370
+ };
297
371
  /**
298
372
  * Set true to make datepicker stacked style.
299
373
  */
@@ -301,6 +375,15 @@ export class AuroDatePicker extends AuroElement {
301
375
  type: BooleanConstructor;
302
376
  reflect: boolean;
303
377
  };
378
+ /**
379
+ * Indicates whether the datepicker is in a dirty state (has been interacted with).
380
+ * @private
381
+ */
382
+ touched: {
383
+ type: BooleanConstructor;
384
+ reflect: boolean;
385
+ attribute: boolean;
386
+ };
304
387
  /**
305
388
  * Specifies the `validityState` this element is in.
306
389
  */
@@ -320,15 +403,6 @@ export class AuroDatePicker extends AuroElement {
320
403
  valueEnd: {
321
404
  type: StringConstructor;
322
405
  };
323
- /**
324
- * Indicates whether the datepicker is in a dirty state (has been interacted with).
325
- * @private
326
- */
327
- touched: {
328
- type: BooleanConstructor;
329
- reflect: boolean;
330
- attribute: boolean;
331
- };
332
406
  };
333
407
  static get styles(): import("lit").CSSResult[];
334
408
  /**
@@ -359,6 +433,16 @@ export class AuroDatePicker extends AuroElement {
359
433
  required: boolean;
360
434
  onDark: boolean;
361
435
  range: boolean;
436
+ rangeLabelStart: string;
437
+ rangeLabelEnd: string;
438
+ rangeLabelBeforeRange: string;
439
+ rangeLabelInRange: string;
440
+ rangeLabelAfterRange: string;
441
+ blackoutDates: any[];
442
+ blackoutLabel: string;
443
+ navLabelPrevMonth: string;
444
+ navLabelNextMonth: string;
445
+ calendarGridLabel: string;
362
446
  stacked: boolean;
363
447
  noValidate: boolean;
364
448
  validity: any;
@@ -437,7 +521,7 @@ export class AuroDatePicker extends AuroElement {
437
521
  /**
438
522
  * Handles click on the clear button.
439
523
  * @private
440
- * @param {MouseEvent} event - The click event object.
524
+ * @param {MouseEvent} event - The mouse event from the clear button click.
441
525
  * @returns {void}
442
526
  */
443
527
  private handleClearClick;
@@ -470,7 +554,7 @@ export class AuroDatePicker extends AuroElement {
470
554
  /**
471
555
  * Common display value wrapper classes.
472
556
  * @private
473
- * @return {Object} - An object containing the common classes for the display value wrapper.
557
+ * @returns {Object} Class map for Lit's classMap directive.
474
558
  */
475
559
  private get commonDisplayValueWrapperClasses();
476
560
  /**
@@ -582,6 +666,13 @@ export class AuroDatePicker extends AuroElement {
582
666
  * @returns {void}
583
667
  */
584
668
  private notifyMonthChanged;
669
+ /**
670
+ * Attempts to focus the active calendar cell using a rAF retry loop.
671
+ * Shared by both fullscreen and desktop open paths.
672
+ * @private
673
+ * @returns {void}
674
+ */
675
+ private focusActiveCellWhenReady;
585
676
  /**
586
677
  * Binds all behavior needed to the dropdown after rendering.
587
678
  * @private
@@ -589,6 +680,7 @@ export class AuroDatePicker extends AuroElement {
589
680
  */
590
681
  private configureDropdown;
591
682
  dropdown: any;
683
+ centralDate: any;
592
684
  /**
593
685
  * Binds all behavior needed to the input after rendering.
594
686
  * @private
@@ -656,6 +748,13 @@ export class AuroDatePicker extends AuroElement {
656
748
  * @returns {void}
657
749
  */
658
750
  clear(): void;
751
+ /**
752
+ * Checks whether a formatted date string matches a blackout date.
753
+ * @private
754
+ * @param {string} dateStr - A date string in the component's configured format.
755
+ * @returns {boolean} True if the date is in the blackoutDates list.
756
+ */
757
+ private isBlackoutDate;
659
758
  /**
660
759
  * Validates value.
661
760
  * @param {boolean} [force=false] - Whether to force validation.
@@ -672,7 +771,7 @@ export class AuroDatePicker extends AuroElement {
672
771
  */
673
772
  get hasError(): boolean;
674
773
  /**
675
- * lifecycle method to check if the locale is valid.
774
+ * Lifecycle method to check if the locale is valid.
676
775
  * @ignore
677
776
  * @param {Map} changedProperties - The map of properties that have changed since the last update.
678
777
  * @returns {void}
@@ -681,6 +780,7 @@ export class AuroDatePicker extends AuroElement {
681
780
  format: string | undefined;
682
781
  updated(changedProperties: any): void;
683
782
  previousTabIndex: string | null | undefined;
783
+ wasCellClick: boolean | undefined;
684
784
  /**
685
785
  * Handles the transfer of content between slots in the component.
686
786
  *
@@ -1,3 +1,5 @@
1
- export namespace datepickerKeyboardStrategy {
2
- function Escape(component: any, evt: any): void;
3
- }
1
+ export const datepickerKeyboardStrategy: {
2
+ Escape(component: any, evt: any, ctx: any): void;
3
+ Enter(component: any, evt: any, ctx: any): void;
4
+ ' '(component: any, evt: any, ctx: any): void;
5
+ };
@@ -28,12 +28,23 @@
28
28
  </ol>
29
29
  </section>
30
30
  <section>
31
+ <auro-header level="2" id="desktopModal">Desktop Modal</auro-header>
32
+ <p>When the <code>desktopModal</code> attribute is set, the dropdown behaves as a modal dialog on desktop viewports:</p>
33
+ <ul>
34
+ <li>All sibling elements on the page are marked <code>inert</code>, preventing interaction with content outside the dropdown.</li>
35
+ <li>Focus is trapped within the bib content using a Tab-key handler.</li>
36
+ <li>The <code>inert</code> state and focus trap are automatically cleaned up when the bib is closed or the component is disconnected.</li>
37
+ </ul>
38
+ <p>In fullscreen mode, the native <code>&lt;dialog&gt;</code> <code>showModal()</code> API provides equivalent behavior, so <code>desktopModal</code> only applies to desktop-sized viewports.</p>
39
+ </section>
40
+ <section>
31
41
  <auro-header level="2" id="tabBehavior">Tab Behavior</auro-header>
32
42
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/tabindex.md) -->
33
43
  <!-- The below content is automatically added from ./../docs/partials/tabindex.md -->
34
44
  <p>The trigger is a focusable element and participates in the standard tab order, responding to <code>Tab</code> and <code>Shift+Tab</code> key events per <auro-hyperlink href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/tabindex">native browser behavior</auro-hyperlink>, i.e., these keys step through the browser tabindex sequence.</p>
35
45
  <p>When the component is <code>disabled</code> it is removed from the <code>tabindex</code> sequence. VoiceOver's virtual cursor <em>(swipe navigation)</em> can still encounter the component, but standard keyboard <code>Tab</code> navigation skips it.</p>
36
46
  <p>When the bib is collapsed, the bib content is excluded from the tab sequence. When <strong>expanded</strong>, focusable elements within the bib content are included in the natural tab order. In fullscreen mode, focus is trapped within the bib, and the tab sequence cycles through the bib content focusable elements until the bib is closed or the viewport no longer meets the fullscreen condition and is rendered as a popover.</p>
47
+ <p>When the <code>desktopModal</code> attribute is set, focus is also trapped within the bib on desktop viewports. All sibling elements on the page are marked <code>inert</code>, preventing interaction with content outside the dropdown until it is closed.</p>
37
48
  <!-- AURO-GENERATED-CONTENT:END -->
38
49
  </section>
39
50
  <section>
@@ -13,6 +13,7 @@ The `auro-dropdown` element provides a way to place content in a bib that can be
13
13
  | `appearance` | `appearance` | `'default' \| 'inverse'` | "'default'" | Defines whether the component will be on lighter or darker backgrounds. |
14
14
  | `autoPlacement` | `autoPlacement` | `boolean` | | If declared, bib's position will be automatically calculated where to appear. |
15
15
  | `chevron` | `chevron` | `boolean` | | If declared, the dropdown displays a chevron on the right. |
16
+ | `desktopModal` | `desktopModal` | `boolean` | | If declared, the dropdown will behave as a modal dialog when in a desktop viewport size. |
16
17
  | `disableEventShow` | `disableEventShow` | `boolean` | | If declared, the dropdown will only show by calling the API .show() public method. |
17
18
  | `disableKeyboardHandling` | `disableKeyboardHandling` | `boolean` | | If declared, the dropdown will not handle keyboard events and will require the consumer to manage this behavior. |
18
19
  | `disabled` | `disabled` | `boolean` | | If declared, the dropdown is not interactive. |
@@ -0,0 +1,57 @@
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/css-only.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 | CSS only</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('./css-only.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>
@@ -0,0 +1,219 @@
1
+ <auro-header level="1">CSS only with native disclosure</auro-header>
2
+ <p>For situations where the <code>&lt;auro-dropdown&gt;</code> web component cannot be used, a native HTML <code>&lt;details&gt;</code>/<code>&lt;summary&gt;</code> element can be styled with the Auro Design System tokens to approximate the visual appearance of <code>auro-dropdown</code>. Unlike <auro-hyperlink href="https://auro.alaskaair.com/components/auro/hyperlink/css-only" target="_blank">auro-hyperlink</auro-hyperlink>, <auro-hyperlink href="https://alaskaairlines.github.io/WebCoreStyleSheets/" target="_blank">Web Core Style Sheets</auro-hyperlink> does not provide a prebuilt <code>.dropdown</code> class, so the styling must be authored manually using Auro design tokens.</p>
3
+ <auro-header level="2">Styling a native disclosure</auro-header>
4
+ <p>The native <code>&lt;details&gt;</code>/<code>&lt;summary&gt;</code> pair can be reset and restyled with the Auro design tokens published by <auro-hyperlink href="https://alaskaairlines.github.io/WebCoreStyleSheets/" target="_blank">@aurodesignsystem/design-tokens</auro-hyperlink>. The pattern below replicates the trigger border, spacing, and panel colors used by <code>auro-dropdown</code>.</p>
5
+ <pre><code>@import "./node_modules/@aurodesignsystem/design-tokens/dist/tokens/CSSCustomProperties.css";
6
+
7
+ .dropdown {
8
+ position: relative;
9
+ display: inline-block;
10
+ }
11
+
12
+ .dropdown &gt; summary {
13
+ list-style: none;
14
+ cursor: pointer;
15
+ display: inline-flex;
16
+ align-items: center;
17
+ gap: var(--ds-size-100, 0.5rem);
18
+ padding: var(--ds-size-100, 0.5rem) var(--ds-size-150, 0.75rem);
19
+ border: 1px solid var(--ds-color-border-ui-default, #6e767f);
20
+ border-radius: var(--ds-border-radius, 4px);
21
+ background-color: var(--ds-color-container-primary-default, #ffffff);
22
+ color: var(--ds-color-text-primary-default, #1d1d1d);
23
+ font-family: var(--ds-font-family-default, sans-serif);
24
+ }
25
+
26
+ .dropdown &gt; summary::-webkit-details-marker {
27
+ display: none;
28
+ }
29
+
30
+ .dropdown &gt; summary::after {
31
+ content: "";
32
+ width: var(--ds-size-150, 0.75rem);
33
+ height: var(--ds-size-150, 0.75rem);
34
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d1d1d' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
35
+ background-repeat: no-repeat;
36
+ background-position: center;
37
+ transition: transform 150ms ease;
38
+ }
39
+
40
+ .dropdown[open] &gt; summary::after {
41
+ transform: rotate(180deg);
42
+ }
43
+
44
+ .dropdown &gt; summary:focus-visible {
45
+ outline: 2px solid var(--ds-color-border-active-default, #01426a);
46
+ outline-offset: 2px;
47
+ }
48
+
49
+ .dropdown-bib {
50
+ position: absolute;
51
+ top: calc(100% + var(--ds-size-50, 0.25rem));
52
+ left: 0;
53
+ z-index: 1;
54
+ min-width: 100%;
55
+ padding: var(--ds-size-100, 0.5rem);
56
+ border: 1px solid var(--ds-color-border-ui-default, #6e767f);
57
+ border-radius: var(--ds-border-radius, 4px);
58
+ background-color: var(--ds-color-container-primary-default, #ffffff);
59
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
60
+ }</code></pre>
61
+ <auro-header level="3">Basic disclosure</auro-header>
62
+ <p>Apply the <code>.dropdown</code> class to a <code>&lt;details&gt;</code> element with a <code>&lt;summary&gt;</code> trigger and a panel container:</p>
63
+ <pre><code>&lt;details class="dropdown"&gt;
64
+ &lt;summary&gt;More options&lt;/summary&gt;
65
+ &lt;div class="dropdown-bib"&gt;
66
+ &lt;p&gt;Panel content goes here.&lt;/p&gt;
67
+ &lt;/div&gt;
68
+ &lt;/details&gt;</code></pre>
69
+ <auro-header level="3">Disclosure with a list of actions</auro-header>
70
+ <p>The panel can hold any markup. For a menu-like list, author the items as a plain unordered list:</p>
71
+ <pre><code>&lt;details class="dropdown"&gt;
72
+ &lt;summary&gt;Account&lt;/summary&gt;
73
+ &lt;div class="dropdown-bib"&gt;
74
+ &lt;ul&gt;
75
+ &lt;li&gt;&lt;a href="/profile"&gt;Profile&lt;/a&gt;&lt;/li&gt;
76
+ &lt;li&gt;&lt;a href="/settings"&gt;Settings&lt;/a&gt;&lt;/li&gt;
77
+ &lt;li&gt;&lt;a href="/logout"&gt;Log out&lt;/a&gt;&lt;/li&gt;
78
+ &lt;/ul&gt;
79
+ &lt;/div&gt;
80
+ &lt;/details&gt;</code></pre>
81
+ <auro-header level="2">What you lose without auro-dropdown</auro-header>
82
+ <p>While the CSS above replicates the <strong>visual styling</strong> of <code>auro-dropdown</code>, the following functionality built into the <code>auro-dropdown</code> web component is <strong>not available</strong> when using plain HTML:</p>
83
+ <auro-header level="3">Floating-UI positioning</auro-header>
84
+ <p><code>auro-dropdown</code> uses Floating UI to position the bib relative to the trigger and supports a <code>placement</code> attribute with twelve values (<code>top</code>, <code>right</code>, <code>bottom</code>, <code>left</code>, and their <code>-start</code>/<code>-end</code> variants). A native <code>&lt;details&gt;</code> panel is absolutely positioned by the author and does not adapt to alternate placements without additional CSS for each case.</p>
85
+ <auro-header level="3">Auto-placement and flip</auro-header>
86
+ <p><code>auro-dropdown</code> exposes <code>autoPlacement</code> and the inverse <code>noFlip</code> option so the bib can automatically pick the side of the trigger with the most available space and flip when it would otherwise be clipped by the viewport. A CSS-only panel stays where it is authored and will overflow the viewport when there is not enough room.</p>
87
+ <auro-header level="3">Shift to stay on-screen</auro-header>
88
+ <p><code>auro-dropdown</code> supports a <code>shift</code> attribute that nudges the bib along its axis so it remains fully visible inside the viewport. Native disclosures have no equivalent — a panel positioned with CSS that runs past the viewport edge is simply clipped or causes horizontal scroll.</p>
89
+ <auro-header level="3">Match-width and offset control</auro-header>
90
+ <p><code>auro-dropdown</code> exposes <code>matchWidth</code> to size the bib to the trigger and a numeric <code>offset</code> for the gap between trigger and bib. With native HTML, both must be implemented manually with CSS and, in the case of dynamic trigger widths, JavaScript measurement.</p>
91
+ <auro-header level="3">Mobile fullscreen behavior</auro-header>
92
+ <p><code>auro-dropdown</code> supports a <code>fullscreenBreakpoint</code> (defaulting to <code>sm</code>) that switches the bib into a fullscreen presentation on small viewports, and a <code>desktopModal</code> option for modal behavior on larger viewports. Native <code>&lt;details&gt;</code> has no responsive presentation — the panel renders the same way on every screen size.</p>
93
+ <auro-header level="3">Hover trigger</auro-header>
94
+ <p><code>auro-dropdown</code> supports a <code>hoverToggle</code> attribute that opens the bib on mouseover and closes it on mouseout. Native <code>&lt;details&gt;</code> only responds to click on the <code>&lt;summary&gt;</code>; hover-to-open requires custom JavaScript.</p>
95
+ <auro-header level="3">Focus management</auro-header>
96
+ <p><code>auro-dropdown</code> provides a <code>focus()</code> method that moves focus to the first focusable element inside the bib when it is open, or to the trigger when it is closed. It also supports <code>focusShow</code> to open the bib on trigger focus. Native <code>&lt;details&gt;</code> leaves focus on the <code>&lt;summary&gt;</code> after toggle and offers no built-in focus-into-panel behavior.</p>
97
+ <auro-header level="3">Click-outside and focus-loss dismissal</auro-header>
98
+ <p><code>auro-dropdown</code> closes the bib when the user clicks outside the component or moves focus out of it, and exposes <code>noHideOnThisFocusLoss</code> to opt out. Native <code>&lt;details&gt;</code> stays open until the <code>&lt;summary&gt;</code> is clicked again — click-outside and focus-out dismissal must be wired up manually.</p>
99
+ <auro-header level="3">Keyboard handling</auro-header>
100
+ <p><code>auro-dropdown</code> includes a keyboard strategy for arrow-key navigation, <code>Escape</code> to close, and <code>Tab</code> behavior coordinated with the bib contents, and lets consumers opt out via <code>disableKeyboardHandling</code>. Native <code>&lt;details&gt;</code> only toggles on <code>Enter</code>/<code>Space</code> on the <code>&lt;summary&gt;</code> and offers no panel-internal keyboard model.</p>
101
+ <auro-header level="3">ARIA wiring</auro-header>
102
+ <p><code>auro-dropdown</code> sets an <code>a11yRole</code> on the trigger, manages <code>aria-expanded</code>, and emits an <code>auroDropdown-idAdded</code> event so consumers can wire <code>aria-controls</code> to the generated bib ID. Native <code>&lt;details&gt;</code> exposes a disclosure role with <code>open</code> state but does not expose a generated panel ID, and any custom role (for example, <code>combobox</code> or <code>menu</code>) must be added and kept in sync by hand.</p>
103
+ <auro-header level="3">Chevron indicator</auro-header>
104
+ <p><code>auro-dropdown</code> supports a <code>chevron</code> attribute that renders a collapsed/expanded indicator with the correct rotation and design-token color. With native HTML you must author the indicator yourself — the example above uses a background-image SVG and a <code>[open]</code> selector to rotate it.</p>
105
+ <auro-header level="3">Error and help-text presentation</auro-header>
106
+ <p><code>auro-dropdown</code> exposes <code>error</code>, <code>errorMessage</code>, and a <code>helpText</code> slot that renders supporting text below the trigger with the correct error styling. Native <code>&lt;details&gt;</code> has no concept of error state or help text — both must be authored and toggled manually.</p>
107
+ <auro-header level="3">Imperative show/hide and toggle events</auro-header>
108
+ <p><code>auro-dropdown</code> exposes <code>show()</code> and <code>hide()</code> methods, a <code>disableEventShow</code> option to lock it to programmatic control, and emits <code>auroDropdown-toggled</code> and <code>auroDropdown-triggerClick</code> events. Native <code>&lt;details&gt;</code> emits a single <code>toggle</code> event and is toggled by user interaction with the <code>&lt;summary&gt;</code>; coordinated open/close logic across components must be written by hand.</p>
109
+ <auro-header level="3">Multi-brand theming</auro-header>
110
+ <p><code>auro-dropdown</code> consumes Auro design tokens through its component logic, so it automatically picks up brand-specific theming when token packages are swapped. A CSS-only disclosure is tied to whichever tokens were imported at author time and will not respond to runtime theme switching the way the web component does.</p>
111
+ <auro-header level="2">Summary</auro-header>
112
+ <table>
113
+ <thead>
114
+ <tr>
115
+ <th>Feature</th>
116
+ <th>Native <code>&lt;details&gt;</code>/<code>&lt;summary&gt;</code> with Auro tokens</th>
117
+ <th><code>auro-dropdown</code></th>
118
+ </tr>
119
+ </thead>
120
+ <tbody>
121
+ <tr>
122
+ <td>Design-system-aligned styling</td>
123
+ <td>Manual (author-written CSS)</td>
124
+ <td>Built-in</td>
125
+ </tr>
126
+ <tr>
127
+ <td>Dark background support</td>
128
+ <td>Manual</td>
129
+ <td>Yes (<code>appearance="inverse"</code>)</td>
130
+ </tr>
131
+ <tr>
132
+ <td>Bib placement</td>
133
+ <td>Fixed by author CSS</td>
134
+ <td>12 <code>placement</code> values</td>
135
+ </tr>
136
+ <tr>
137
+ <td>Auto-placement and flip</td>
138
+ <td>Not supported</td>
139
+ <td><code>autoPlacement</code> / <code>noFlip</code></td>
140
+ </tr>
141
+ <tr>
142
+ <td>Shift to stay on-screen</td>
143
+ <td>Not supported</td>
144
+ <td><code>shift</code></td>
145
+ </tr>
146
+ <tr>
147
+ <td>Match trigger width</td>
148
+ <td>Manual CSS/JS</td>
149
+ <td><code>matchWidth</code></td>
150
+ </tr>
151
+ <tr>
152
+ <td>Offset / gap control</td>
153
+ <td>Manual CSS</td>
154
+ <td><code>offset</code></td>
155
+ </tr>
156
+ <tr>
157
+ <td>Mobile fullscreen</td>
158
+ <td>Not supported</td>
159
+ <td><code>fullscreenBreakpoint</code></td>
160
+ </tr>
161
+ <tr>
162
+ <td>Desktop modal</td>
163
+ <td>Not supported</td>
164
+ <td><code>desktopModal</code></td>
165
+ </tr>
166
+ <tr>
167
+ <td>Hover to open</td>
168
+ <td>Manual JS</td>
169
+ <td><code>hoverToggle</code></td>
170
+ </tr>
171
+ <tr>
172
+ <td>Focus into bib on open</td>
173
+ <td>Manual JS</td>
174
+ <td><code>focus()</code> / <code>focusShow</code></td>
175
+ </tr>
176
+ <tr>
177
+ <td>Click-outside / focus-loss dismiss</td>
178
+ <td>Manual JS</td>
179
+ <td>Built-in (with opt-out)</td>
180
+ </tr>
181
+ <tr>
182
+ <td>Keyboard model</td>
183
+ <td><code>Enter</code>/<code>Space</code> on summary only</td>
184
+ <td>Arrow / <code>Escape</code> / <code>Tab</code> strategy</td>
185
+ </tr>
186
+ <tr>
187
+ <td>ARIA wiring</td>
188
+ <td>Native disclosure role only</td>
189
+ <td><code>a11yRole</code>, <code>aria-expanded</code>, generated bib ID</td>
190
+ </tr>
191
+ <tr>
192
+ <td>Chevron indicator</td>
193
+ <td>Manual</td>
194
+ <td><code>chevron</code></td>
195
+ </tr>
196
+ <tr>
197
+ <td>Error / help text</td>
198
+ <td>Manual</td>
199
+ <td><code>error</code>, <code>errorMessage</code>, <code>helpText</code> slot</td>
200
+ </tr>
201
+ <tr>
202
+ <td>Imperative show / hide</td>
203
+ <td>Not supported</td>
204
+ <td><code>show()</code> / <code>hide()</code></td>
205
+ </tr>
206
+ <tr>
207
+ <td>Toggle events</td>
208
+ <td><code>toggle</code></td>
209
+ <td><code>auroDropdown-toggled</code>, <code>auroDropdown-triggerClick</code></td>
210
+ </tr>
211
+ <tr>
212
+ <td>Multi-brand theming</td>
213
+ <td>Static (import-time tokens)</td>
214
+ <td>Full (design tokens + component logic)</td>
215
+ </tr>
216
+ </tbody>
217
+ </table>
218
+ <auro-header level="2">Recommendation</auro-header>
219
+ <p>Use <code>auro-dropdown</code> whenever possible. Fall back to a CSS-styled native <code>&lt;details&gt;</code>/<code>&lt;summary&gt;</code> only in environments where custom elements are not supported or when integrating with third-party systems that require plain HTML — and be prepared to reimplement positioning, focus management, click-outside dismissal, keyboard behavior, and responsive presentation yourself.</p>