@aurodesignsystem-dev/auro-formkit 0.0.0-pr624.5 → 0.0.0-pr624.50

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 (115) hide show
  1. package/components/bibtemplate/dist/auro-bibtemplate.d.ts +13 -2
  2. package/components/bibtemplate/dist/buttonVersion.d.ts +2 -0
  3. package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
  4. package/components/bibtemplate/dist/index.js +1292 -79
  5. package/components/bibtemplate/dist/registered.js +1292 -79
  6. package/components/checkbox/README.md +1 -1
  7. package/components/checkbox/demo/api.md +47 -14
  8. package/components/checkbox/demo/api.min.js +47 -34
  9. package/components/checkbox/demo/index.md +2 -2
  10. package/components/checkbox/demo/index.min.js +47 -34
  11. package/components/checkbox/demo/readme.md +1 -1
  12. package/components/checkbox/dist/auro-checkbox-group.d.ts +1 -1
  13. package/components/checkbox/dist/auro-checkbox.d.ts +3 -3
  14. package/components/checkbox/dist/index.js +47 -34
  15. package/components/checkbox/dist/registered.js +47 -34
  16. package/components/combobox/demo/api.md +112 -8
  17. package/components/combobox/demo/api.min.js +3203 -760
  18. package/components/combobox/demo/index.md +6 -30
  19. package/components/combobox/demo/index.min.js +3203 -760
  20. package/components/combobox/dist/auro-combobox.d.ts +37 -16
  21. package/components/combobox/dist/index.js +3093 -791
  22. package/components/combobox/dist/registered.js +3093 -791
  23. package/components/counter/demo/api.html +1 -0
  24. package/components/counter/demo/api.md +29 -21
  25. package/components/counter/demo/api.min.js +3332 -615
  26. package/components/counter/demo/index.html +1 -0
  27. package/components/counter/demo/index.md +103 -34
  28. package/components/counter/demo/index.min.js +3332 -615
  29. package/components/counter/dist/auro-counter-button.d.ts +2 -0
  30. package/components/counter/dist/auro-counter-group.d.ts +90 -7
  31. package/components/counter/dist/auro-counter.d.ts +6 -0
  32. package/components/counter/dist/helptextVersion.d.ts +2 -0
  33. package/components/counter/dist/iconVersion.d.ts +1 -1
  34. package/components/counter/dist/index.js +3332 -615
  35. package/components/counter/dist/registered.js +3332 -615
  36. package/components/datepicker/demo/api.md +36 -19
  37. package/components/datepicker/demo/api.min.js +14940 -10964
  38. package/components/datepicker/demo/index.md +80 -0
  39. package/components/datepicker/demo/index.min.js +14940 -10964
  40. package/components/datepicker/dist/auro-datepicker.d.ts +71 -3
  41. package/components/datepicker/dist/buttonVersion.d.ts +1 -1
  42. package/components/datepicker/dist/iconVersion.d.ts +2 -0
  43. package/components/datepicker/dist/index.js +11817 -7841
  44. package/components/datepicker/dist/popoverVersion.d.ts +1 -1
  45. package/components/datepicker/dist/registered.js +11817 -7841
  46. package/components/dropdown/demo/api.md +25 -12
  47. package/components/dropdown/demo/api.min.js +552 -148
  48. package/components/dropdown/demo/index.md +57 -9
  49. package/components/dropdown/demo/index.min.js +552 -148
  50. package/components/dropdown/dist/auro-dropdown.d.ts +28 -9
  51. package/components/dropdown/dist/auro-dropdownBib.d.ts +22 -0
  52. package/components/dropdown/dist/index.js +552 -148
  53. package/components/dropdown/dist/registered.js +552 -148
  54. package/components/form/demo/api.min.js +1 -1
  55. package/components/form/demo/index.min.js +1 -1
  56. package/components/form/dist/index.js +1 -1
  57. package/components/form/dist/registered.js +1 -1
  58. package/components/helptext/dist/index.js +2 -2
  59. package/components/helptext/dist/registered.js +2 -2
  60. package/components/input/README.md +5 -2
  61. package/components/input/demo/api.md +271 -176
  62. package/components/input/demo/api.min.js +958 -272
  63. package/components/input/demo/index.md +48 -32
  64. package/components/input/demo/index.min.js +957 -271
  65. package/components/input/demo/readme.md +5 -2
  66. package/components/input/dist/auro-input.d.ts +23 -15
  67. package/components/input/dist/base-input.d.ts +33 -9
  68. package/components/input/dist/buttonVersion.d.ts +1 -1
  69. package/components/input/dist/iconVersion.d.ts +1 -1
  70. package/components/input/dist/index.js +957 -271
  71. package/components/input/dist/registered.js +957 -271
  72. package/components/layoutElement/dist/index.js +13 -10
  73. package/components/menu/demo/api.html +38 -0
  74. package/components/menu/demo/api.md +68 -7
  75. package/components/menu/demo/api.min.js +278 -42
  76. package/components/menu/demo/index.min.js +278 -42
  77. package/components/menu/dist/auro-menu.d.ts +28 -5
  78. package/components/menu/dist/auro-menuoption.d.ts +15 -3
  79. package/components/menu/dist/iconVersion.d.ts +1 -1
  80. package/components/menu/dist/index.js +278 -42
  81. package/components/menu/dist/registered.js +278 -42
  82. package/components/menu/dist/styles/default/color-menuoption-css.d.ts +2 -0
  83. package/components/menu/dist/styles/default/style-menu-css.d.ts +2 -0
  84. package/components/menu/dist/styles/default/style-menuoption-css.d.ts +2 -0
  85. package/components/menu/dist/styles/default/tokens-css.d.ts +2 -0
  86. package/components/radio/demo/api.md +7 -8
  87. package/components/radio/demo/api.min.js +71 -83
  88. package/components/radio/demo/index.min.js +71 -83
  89. package/components/radio/dist/auro-radio-group.d.ts +1 -1
  90. package/components/radio/dist/auro-radio.d.ts +9 -12
  91. package/components/radio/dist/index.js +71 -83
  92. package/components/radio/dist/registered.js +71 -83
  93. package/components/select/demo/api.js +0 -2
  94. package/components/select/demo/api.md +100 -45
  95. package/components/select/demo/api.min.js +3009 -526
  96. package/components/select/demo/index.html +1 -0
  97. package/components/select/demo/index.md +176 -768
  98. package/components/select/demo/index.min.js +3013 -518
  99. package/components/select/dist/auro-select.d.ts +126 -11
  100. package/components/select/dist/helptextVersion.d.ts +2 -0
  101. package/components/select/dist/index.js +2892 -538
  102. package/components/select/dist/registered.js +2892 -538
  103. package/components/select/dist/styles/shapeSize-css.d.ts +2 -0
  104. package/components/select/dist/styles/tokens-css.d.ts +2 -0
  105. package/package.json +28 -26
  106. /package/components/{dropdown/dist/styles/default/bibColors-css.d.ts → counter/dist/styles/shapeSize-css.d.ts} +0 -0
  107. /package/components/{dropdown → datepicker}/dist/styles/default/color-css.d.ts +0 -0
  108. /package/components/{dropdown/dist/styles/default/bibStyles-css.d.ts → datepicker/dist/styles/shapeSize-css.d.ts} +0 -0
  109. /package/components/{dropdown/dist/styles/default/style-css.d.ts → datepicker/dist/styles/snowflake/color-css.d.ts} +0 -0
  110. /package/components/{dropdown/dist/styles → datepicker/dist/styles/snowflake}/style-css.d.ts +0 -0
  111. /package/components/{menu/dist/styles/color-menu-css.d.ts → dropdown/dist/styles/classic/bibColors-css.d.ts} +0 -0
  112. /package/components/{menu/dist/styles/color-menuoption-css.d.ts → dropdown/dist/styles/classic/bibStyles-css.d.ts} +0 -0
  113. /package/components/{menu/dist/styles/style-menu-css.d.ts → dropdown/dist/styles/classic/color-css.d.ts} +0 -0
  114. /package/components/{menu/dist/styles/style-menuoption-css.d.ts → dropdown/dist/styles/classic/style-css.d.ts} +0 -0
  115. /package/components/menu/dist/styles/{tokens-css.d.ts → default/color-menu-css.d.ts} +0 -0
@@ -81,6 +81,7 @@ let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
81
81
  }
82
82
  };
83
83
 
84
+ /* eslint-disable max-lines */
84
85
  // Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
85
86
  // See LICENSE in the project root for license information.
86
87
 
@@ -115,8 +116,8 @@ class AuroRadio extends LitElement {
115
116
  this.required = false;
116
117
  this.error = false;
117
118
  this.onDark = false;
118
- this.tabIndex = -1;
119
119
  this.touched = false;
120
+ this.role = 'radio';
120
121
 
121
122
  /**
122
123
  * @private
@@ -158,10 +159,6 @@ class AuroRadio extends LitElement {
158
159
  label: { type: String },
159
160
  name: { type: String },
160
161
  value: { type: String },
161
- tabIndex: {
162
- type: Number,
163
- reflect: true
164
- },
165
162
 
166
163
  /**
167
164
  * Whether or not the radio button has been touched by the user.
@@ -174,13 +171,22 @@ class AuroRadio extends LitElement {
174
171
  },
175
172
 
176
173
  /**
174
+ * ID for input node.
177
175
  * @private
178
- * id for input node
179
176
  */
180
177
  inputId: {
181
178
  type: String,
182
179
  reflect: false,
183
180
  attribute: false
181
+ },
182
+
183
+ /**
184
+ * @private
185
+ * not to add to api.md since changing of this can easily break a11y.
186
+ */
187
+ role: {
188
+ type: String,
189
+ reflect: true
184
190
  }
185
191
  };
186
192
  }
@@ -206,7 +212,6 @@ class AuroRadio extends LitElement {
206
212
  handleChange(event) {
207
213
  this.checked = event.target.checked;
208
214
  const customEvent = new CustomEvent(event.type, event);
209
-
210
215
  this.dispatchEvent(customEvent);
211
216
  }
212
217
 
@@ -265,7 +270,27 @@ class AuroRadio extends LitElement {
265
270
  }
266
271
 
267
272
  updated(changedProperties) {
273
+ if (changedProperties.has('error') || changedProperties.has('validity')) {
274
+ this.setAttribute('aria-invalid', this.error || this.validity !== 'valid' ? 'true' : 'false');
275
+ }
276
+
277
+ if (changedProperties.has('required')) {
278
+ this.setAttribute('aria-required', this.isRequired(this.required));
279
+ }
280
+
281
+ if (changedProperties.has('disabled')) {
282
+ if (this.disabled) {
283
+ this.setAttribute('aria-disabled', '');
284
+ } else {
285
+ this.removeAttribute('aria-disabled');
286
+ }
287
+ }
288
+
268
289
  if (changedProperties.has('checked')) {
290
+ this.setAttribute('aria-checked', this.checked ? 'true' : 'false');
291
+ // eslint-disable-next-line no-magic-numbers
292
+ this.setAttribute('tabindex', this.checked ? 0 : -1);
293
+
269
294
  this.dispatchEvent(new CustomEvent('resetRadio', {
270
295
  bubbles: true,
271
296
  composed: true
@@ -280,20 +305,6 @@ class AuroRadio extends LitElement {
280
305
  }
281
306
  }
282
307
 
283
- /**
284
- * Method for handling content when it is invalid accessibility wise.
285
- * @private
286
- * @param {Boolean} error - The element's error attribute.
287
- * @returns {void}
288
- */
289
- invalid(error) {
290
- if (error) {
291
- return 'true';
292
- }
293
-
294
- return 'false';
295
- }
296
-
297
308
  /**
298
309
  * Method for handling passing the required status to aria.
299
310
  * @private
@@ -312,6 +323,7 @@ class AuroRadio extends LitElement {
312
323
  // Add the tag name as an attribute if it is different than the component name
313
324
  this.runtimeUtils.handleComponentTagRename(this, 'auro-radio');
314
325
 
326
+ this.addEventListener('focus', this.handleFocus);
315
327
  this.addEventListener('blur', this.handleBlur);
316
328
 
317
329
  this.input = this.shadowRoot.querySelector('input');
@@ -336,27 +348,21 @@ class AuroRadio extends LitElement {
336
348
  return html`
337
349
  <div class="ods-inputGroup rdoGroup" part="radio">
338
350
  <input
339
- class="util_displayHiddenVisually ods-inputOption rdo--input"
351
+ class="util_displayHidden ods-inputOption rdo--input"
340
352
  part="radio-input"
341
- @focus="${this.handleFocus}"
342
353
  @input="${this.handleInput}"
343
354
  @change="${this.handleChange}"
344
355
  ?disabled="${this.disabled}"
345
- aria-invalid="${this.invalid(this.error)}"
346
- aria-required="${this.isRequired(this.required)}"
347
356
  .checked="${this.checked}"
348
357
  id="${this.inputId}"
349
358
  name="${ifDefined(this.name)}"
350
359
  type="radio"
351
360
  .value="${this.value}"
361
+ aria-hidden="true"
352
362
  tabindex="-1"
353
363
  />
354
364
 
355
- <label
356
- for="${this.inputId}"
357
- class="${classMap(labelClasses)}"
358
- part="radio-label"
359
- >
365
+ <label for="${this.inputId}" class="${classMap(labelClasses)}" part="radio-label">
360
366
  <slot>${this.label}</slot>
361
367
  </label>
362
368
  </div>
@@ -365,7 +371,7 @@ class AuroRadio extends LitElement {
365
371
  }
366
372
  }
367
373
 
368
- var styleCss$1 = css`:host{display:block;padding-bottom:var(--ds-size-150, 0.75rem)}fieldset{all:unset}.displayFlex legend+slot{display:flex;white-space:nowrap}legend{margin-bottom:var(--ds-size-150, 0.75rem)}`;
374
+ var styleCss$1 = css`:host{display:block;padding-bottom:var(--ds-size-150, 0.75rem)}fieldset{all:unset}.displayFlex legend+slot{display:flex;white-space:nowrap}legend{margin-bottom:var(--ds-size-150, 0.75rem)}[auro-helptext]{margin-top:var(--ds-size-150, 0.75rem)}`;
369
375
 
370
376
  var colorCss$1 = css`:host legend{color:var(--ds-auro-radio-group-label-color)}:host([disabled]){--ds-auro-radio-group-label-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host([onDark]){--ds-auro-radio-group-label-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][disabled]){--ds-auro-radio-group-label-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}`;
371
377
 
@@ -425,9 +431,10 @@ class DateFormatter {
425
431
  /**
426
432
  * Convert a date object to string format.
427
433
  * @param {Object} date - Date to convert to string.
428
- * @returns {Object} Returns the date as a string.
434
+ * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
435
+ * @returns {String} Returns the date as a string.
429
436
  */
430
- this.getDateAsString = (date) => date.toLocaleDateString(undefined, {
437
+ this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
431
438
  year: "numeric",
432
439
  month: "2-digit",
433
440
  day: "2-digit",
@@ -619,7 +626,7 @@ class AuroDateUtilities extends AuroDateUtilitiesBase {
619
626
  const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
620
627
 
621
628
  // Get the date string of the date object we created from the string date
622
- const actualDateStr = dateFormatter.getDateAsString(dateObj);
629
+ const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
623
630
 
624
631
  // Guard Clause: Generated date matches date string input
625
632
  if (expectedDateStr !== actualDateStr) {
@@ -1063,7 +1070,9 @@ class AuroFormValidation {
1063
1070
  elem.validity = this.auroInputElements[0].validity;
1064
1071
  elem.errorMessage = this.auroInputElements[0].errorMessage;
1065
1072
 
1066
- if (elem.validity === 'valid' && this.auroInputElements.length > 1) {
1073
+ // combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
1074
+ // combobox's 2nd input will have noValidate set true.
1075
+ if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !this.auroInputElements[1].noValidate) {
1067
1076
  elem.validity = this.auroInputElements[1].validity;
1068
1077
  elem.errorMessage = this.auroInputElements[1].errorMessage;
1069
1078
  }
@@ -1183,9 +1192,9 @@ class AuroDependencyVersioning {
1183
1192
  }
1184
1193
  }
1185
1194
 
1186
- var colorCss = css`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
1195
+ var colorCss = css`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error-subtle, #fbc6c6)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
1187
1196
 
1188
- var styleCss = css`.helptext-wrapper{display:none;font-size:var(--ds-basic-text-body-xs-font-size, 12px);font-weight:var(--ds-basic-text-body-xs-font-weight, 450);letter-spacing:var(--ds-basic-text-body-xs-letter-spacing, 0);line-height:var(--ds-basic-text-body-xs-line-height, 16px)}:host([large]) .helptext-wrapper{font-size:var(--ds-basic-text-body-default-font-size, 16px);font-weight:var(--ds-basic-text-body-default-font-weight, 450);letter-spacing:var(--ds-basic-text-body-default-letter-spacing, 0);line-height:var(--ds-basic-text-body-default-line-height, 24px)}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
1197
+ var styleCss = css`:host{position:relative;display:block}.helptext-wrapper{display:none;font-size:12px;font-weight:450;letter-spacing:0;line-height:16px}:host([large]) .helptext-wrapper{font-size:16px;font-weight:450;letter-spacing:0;line-height:24px}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
1189
1198
 
1190
1199
  var tokensCss = css`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
1191
1200
 
@@ -1411,7 +1420,7 @@ var helpTextVersion = '1.0.0';
1411
1420
  * @attr {Object} optionSelected - Specifies the current selected radio button.
1412
1421
  * @csspart radio-group - Apply css to the fieldset element in the shadow DOM
1413
1422
  * @slot {HTMLSlotElement} legend - Allows for the legend to be overridden.
1414
- * @slot {HTMLSlotElement} optionalLabel - Allows for the optional label to be overridden.
1423
+ * @slot {HTMLSlotElement} optionalLabel - Allows overriding the optional display text "(optional)", which appears next to the label.
1415
1424
  * @slot {HTMLSlotElement} helpText - Allows for the helper text to be overridden.
1416
1425
  * @event auroFormElement-validated - Notifies that the element has been validated.
1417
1426
  * @event input - Notifies every time the value prop of the element is changed.
@@ -1567,7 +1576,7 @@ class AuroRadioGroup extends LitElement {
1567
1576
 
1568
1577
  this.optionSelected = event.target;
1569
1578
 
1570
- this.validation.validate(this);
1579
+ this.validation.validate(this, this.optionSelected !== undefined);
1571
1580
  }
1572
1581
 
1573
1582
  /**
@@ -1666,15 +1675,6 @@ class AuroRadioGroup extends LitElement {
1666
1675
  if (this.items.length === 0) {
1667
1676
  this.handleItems();
1668
1677
  }
1669
-
1670
- // handle tab index
1671
- this.items.forEach((item) => {
1672
- item.tabIndex = -1;
1673
- });
1674
-
1675
- if (!this.disabled) {
1676
- this.items[this.index].tabIndex = 0;
1677
- }
1678
1678
  }
1679
1679
 
1680
1680
  /**
@@ -1718,10 +1718,7 @@ class AuroRadioGroup extends LitElement {
1718
1718
  const nextEnabledIndex = this.items.findIndex((item) => !item.hasAttribute('disabled'));
1719
1719
 
1720
1720
  this.index = index >= 0 ? index : nextEnabledIndex;
1721
-
1722
- if (this.index >= 0) {
1723
- this.items[this.index].tabIndex = 0;
1724
- }
1721
+ this.items[this.index].setAttribute('tabindex', 0);
1725
1722
  }
1726
1723
  }
1727
1724
 
@@ -1735,20 +1732,10 @@ class AuroRadioGroup extends LitElement {
1735
1732
  this.index = this.items.indexOf(event.target);
1736
1733
 
1737
1734
  this.items.forEach((item) => {
1738
- if (item === event.target) {
1739
- item.tabIndex = 0;
1740
- if (event.target.value) {
1741
- this.value = event.target.value;
1742
- }
1743
- } else {
1744
- const sdInput = item.shadowRoot.querySelector('input');
1745
-
1746
- sdInput.checked = false;
1747
- item.checked = false;
1748
- item.tabIndex = -1;
1749
- }
1735
+ item.checked = item === event.target;
1750
1736
  });
1751
1737
 
1738
+ this.value = event.target.value;
1752
1739
  this.optionSelected = event.target;
1753
1740
 
1754
1741
  this.validation.validate(this);
@@ -1761,7 +1748,7 @@ class AuroRadioGroup extends LitElement {
1761
1748
  * @returns {void}
1762
1749
  */
1763
1750
  selectItem(index) {
1764
- const sdItem = this.items[index].shadowRoot.querySelector('input');
1751
+ const sdItem = this.items[index];
1765
1752
 
1766
1753
  sdItem.click();
1767
1754
  sdItem.focus();
@@ -1780,17 +1767,18 @@ class AuroRadioGroup extends LitElement {
1780
1767
 
1781
1768
  for (currIndex; currIndex < this.items.length; moveDirection === "Down" ? currIndex += 1 : currIndex -= 1) {
1782
1769
  currIndex = currIndex === -1 ? this.items.length - 1 : currIndex;
1783
- const sdItem = this.items[currIndex].shadowRoot.querySelector('input');
1784
-
1785
- if (this.disabled || this.items.every((item) => item.disabled === true)) {
1786
- sdItem.focus();
1787
- break;
1788
- }
1789
- if (!sdItem.disabled) {
1790
- sdItem.click();
1791
- sdItem.focus();
1792
- this.index = currIndex;
1793
- break;
1770
+ const sdItem = this.items[currIndex];
1771
+ if (sdItem) {
1772
+ if (this.disabled || this.items.every((item) => item.disabled === true)) {
1773
+ sdItem.focus();
1774
+ break;
1775
+ }
1776
+ if (!sdItem.disabled) {
1777
+ sdItem.click();
1778
+ sdItem.focus();
1779
+ this.index = currIndex;
1780
+ break;
1781
+ }
1794
1782
  }
1795
1783
  }
1796
1784
  }
@@ -1833,21 +1821,21 @@ class AuroRadioGroup extends LitElement {
1833
1821
  };
1834
1822
 
1835
1823
  return html$1`
1836
- <fieldset class="${classMap(groupClasses)}" part="radio-group">
1837
- ${this.required
1838
- ? html$1`<legend><slot name="legend"></slot></legend>`
1839
- : html$1`<legend><slot name="legend"></slot> <slot name="optionalLabel">(optional)</slot></legend>`
1840
- }
1824
+ <fieldset class="${classMap(groupClasses)}" part="radio-group" role="radiogroup">
1825
+ <legend>
1826
+ <slot name="legend"></slot>
1827
+ ${this.required ? undefined : html$1`<slot name="optionalLabel"> (optional)</slot>`}
1828
+ </legend>
1841
1829
  <slot @slotchange=${this.handleSlotChange}></slot>
1842
1830
  </fieldset>
1843
1831
 
1844
1832
  ${!this.validity || this.validity === undefined || this.validity === 'valid'
1845
1833
  ? html$1`
1846
- <${this.helpTextTag} large ?onDark="${this.onDark}" part="helpText">
1834
+ <${this.helpTextTag} ?onDark="${this.onDark}" part="helpText">
1847
1835
  <slot name="helpText"></slot>
1848
1836
  </${this.helpTextTag}>`
1849
1837
  : html$1`
1850
- <${this.helpTextTag} large ?onDark="${this.onDark}" role="alert" error aria-live="assertive" part="helpText">
1838
+ <${this.helpTextTag} ?onDark="${this.onDark}" role="alert" error aria-live="assertive" part="helpText">
1851
1839
  ${this.errorMessage}
1852
1840
  </${this.helpTextTag}>`
1853
1841
  }
@@ -5,7 +5,6 @@ import { valueAlertExample } from "../apiExamples/valueAlert.js";
5
5
  import { inDialogExample } from '../apiExamples/inDialog';
6
6
  import { resetStateExample } from "../apiExamples/resetState";
7
7
  import { auroMenuLoadingExample } from "../apiExamples/loading";
8
- import { valueTextExample } from '../apiExamples/valueText.js';
9
8
 
10
9
  /* eslint-disable jsdoc/require-jsdoc, no-magic-numbers, no-param-reassign */
11
10
  import { AuroSelect } from '../src/auro-select.js';
@@ -25,7 +24,6 @@ export function initExamples(initCount) {
25
24
  inDialogExample();
26
25
  resetStateExample();
27
26
  auroMenuLoadingExample();
28
- valueTextExample();
29
27
  } catch (err) {
30
28
  if (initCount <= 20) {
31
29
  // setTimeout handles issue where content is sometimes loaded after the functions get called
@@ -20,9 +20,11 @@ The auro-select element is a wrapper for auro-dropdown and auro-menu to create a
20
20
  | [autocomplete](#autocomplete) | `autocomplete` | `string` | | If declared, sets the autocomplete attribute for the select element. |
21
21
  | [disabled](#disabled) | `disabled` | `boolean` | | When attribute is present, element shows disabled state. |
22
22
  | [error](#error) | `error` | `string` | | When defined, sets persistent validity to `customError` and sets `setCustomValidity` = attribute value. |
23
- | [flexMenuWidth](#flexMenuWidth) | `flexMenuWidth` | `boolean` | | If set, makes dropdown width match the size of the content, rather than the width of the trigger. |
23
+ | [forceDisplayValue](#forceDisplayValue) | `forceDisplayValue` | `boolean` | false | If declared, the label and value will be visually hidden and the displayValue will render 100% of the time. |
24
24
  | [fullscreenBreakpoint](#fullscreenBreakpoint) | `fullscreenBreakpoint` | `string` | "sm" | Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)<br />at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.<br /><br />When expanded, the dropdown will automatically display in fullscreen mode<br />if the screen size is equal to or smaller than the selected breakpoint. |
25
25
  | [largeFullscreenHeadline](#largeFullscreenHeadline) | `largeFullscreenHeadline` | `boolean` | | If declared, make bib.fullscreen.headline in HeadingDisplay.<br />Otherwise, Heading 600. |
26
+ | [layout](#layout) | | `string` | "snowflake" | |
27
+ | [matchWidth](#matchWidth) | `matchWidth` | `boolean` | false | If declared, the popover and trigger will be set to the same width. |
26
28
  | [multiSelect](#multiSelect) | `multiselect` | `boolean` | | Sets multi-select mode, allowing multiple options to be selected at once. |
27
29
  | [name](#name) | `name` | `string` | | The name for the select element. |
28
30
  | [noCheckmark](#noCheckmark) | `noCheckmark` | `boolean` | | When true, checkmark on selected option will no longer be present. |
@@ -31,11 +33,14 @@ The auro-select element is a wrapper for auro-dropdown and auro-menu to create a
31
33
  | [offset](#offset) | `offset` | `number` | "0" | Gap between the trigger element and bib. |
32
34
  | [onDark](#onDark) | `onDark` | `boolean` | | If declared, onDark styles will be applied to the trigger. |
33
35
  | [optionSelected](#optionSelected) | `optionSelected` | `HTMLElement\|Array<HTMLElement>` | | Specifies the current selected menuOption. Default type is `HTMLElement`, changing to `Array<HTMLElement>` when `multiSelect` is true. |
34
- | [placement](#placement) | `placement` | `string` | "bottom-start" | Position where the bib should appear relative to the trigger.<br />Accepted values:<br />"top" \| "right" \| "bottom" \| "left" \|<br />"bottom-start" \| "top-start" \| "top-end" \|<br />"right-start" \| "right-end" \| "bottom-end" \|<br />"left-start" \| "left-end" |
36
+ | [placeholder](#placeholder) | `placeholder` | `string` | | Define custom placeholder text. |
37
+ | [placement](#placement) | `placement` | `string` | "bottom-start" | Position where the bib should appear relative to the trigger.<br />Accepted values:<br />"top" \| "right" \| "bottom" \| "left" \|<br />"bottom-start" \| "top-start" \| "top-end" \|<br />"right-start" \| "right-end" \| "bottom-end" \|<br />"left-start" \| "left-end". |
35
38
  | [required](#required) | `required` | `boolean` | | Populates the `required` attribute on the element. Used for client-side validation. |
36
39
  | [setCustomValidity](#setCustomValidity) | `setCustomValidity` | `string` | | Sets a custom help text message to display for all validityStates. |
37
40
  | [setCustomValidityCustomError](#setCustomValidityCustomError) | `setCustomValidityCustomError` | `string` | | Custom help text message to display when validity = `customError`. |
38
41
  | [setCustomValidityValueMissing](#setCustomValidityValueMissing) | `setCustomValidityValueMissing` | `string` | | Custom help text message to display when validity = `valueMissing`. |
42
+ | [shape](#shape) | | `string` | "snowflake" | |
43
+ | [size](#size) | | `string` | "xl" | |
39
44
  | [validity](#validity) | `validity` | `string` | | Specifies the `validityState` this element is in. |
40
45
  | [value](#value) | `value` | `String\|Array<String>` | | Value selected for the component. Default type is `String`, changing to `Array<String>` when `multiSelect` is true. |
41
46
 
@@ -60,9 +65,10 @@ The auro-select element is a wrapper for auro-dropdown and auro-menu to create a
60
65
  |---------------------------|--------------------------------------------------|
61
66
  | | Default slot for the menu content. |
62
67
  | `bib.fullscreen.headline` | Defines the headline to display above menu-options |
68
+ | [displayValue](#displayValue) | Allows custom HTML content to display the selected value when select is not focused. |
63
69
  | [helpText](#helpText) | Defines the content of the helpText. |
64
70
  | [label](#label) | Defines the content of the label. |
65
- | [placeholder](#placeholder) | Defines the content of the placeholder to be shown when there is no value |
71
+ | [optionalLabel](#optionalLabel) | Allows overriding the optional display text "(optional)", which appears next to the label. |
66
72
  | [valueText](#valueText) | Dropdown value text display. |
67
73
 
68
74
  ## CSS Shadow Parts
@@ -440,6 +446,50 @@ When the validity check fails the validityState, equals `valueMissing`. The erro
440
446
  <!-- AURO-GENERATED-CONTENT:END -->
441
447
  </auro-accordion>
442
448
 
449
+ ### Custom optional label <a name="optionalLabel"></a>
450
+ The `<auro-select>` supports an `optionalLabel` slot, where users can can override the default `(optional)` notification text.
451
+
452
+ <div class="exampleWrapper">
453
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/optionalLabel.html) -->
454
+ <!-- The below content is automatically added from ./../apiExamples/optionalLabel.html -->
455
+ <auro-select>
456
+ <span slot="bib.fullscreen.headline">Bib Headline</span>
457
+ <span slot="label">Please select a preference</span>
458
+ <span slot="optionalLabel" style="color: grey; font-size: small"> - optional</span>
459
+ <auro-menu>
460
+ <auro-menuoption value="stops">Stops</auro-menuoption>
461
+ <auro-menuoption value="price">Price</auro-menuoption>
462
+ <auro-menuoption value="duration">Duration</auro-menuoption>
463
+ <auro-menuoption value="departure">Departure</auro-menuoption>
464
+ <auro-menuoption value="arrival">Arrival</auro-menuoption>
465
+ <auro-menuoption value="prefer alaska">Prefer Alaska</auro-menuoption>
466
+ </auro-menu>
467
+ </auro-select>
468
+ <!-- AURO-GENERATED-CONTENT:END -->
469
+ </div>
470
+ <auro-accordion alignRight>
471
+ <span slot="trigger">See code</span>
472
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/optionalLabel.html) -->
473
+ <!-- The below code snippet is automatically added from ./../apiExamples/optionalLabel.html -->
474
+
475
+ ```html
476
+ <auro-select>
477
+ <span slot="bib.fullscreen.headline">Bib Headline</span>
478
+ <span slot="label">Please select a preference</span>
479
+ <span slot="optionalLabel" style="color: grey; font-size: small"> - optional</span>
480
+ <auro-menu>
481
+ <auro-menuoption value="stops">Stops</auro-menuoption>
482
+ <auro-menuoption value="price">Price</auro-menuoption>
483
+ <auro-menuoption value="duration">Duration</auro-menuoption>
484
+ <auro-menuoption value="departure">Departure</auro-menuoption>
485
+ <auro-menuoption value="arrival">Arrival</auro-menuoption>
486
+ <auro-menuoption value="prefer alaska">Prefer Alaska</auro-menuoption>
487
+ </auro-menu>
488
+ </auro-select>
489
+ ```
490
+ <!-- AURO-GENERATED-CONTENT:END -->
491
+ </auro-accordion>
492
+
443
493
  #### error <a name="error"></a>
444
494
  Use the `error` boolean attribute to toggle the error UI.
445
495
 
@@ -731,7 +781,7 @@ Use the `label` slot to give your users contextual information about their selec
731
781
  </auro-accordion>
732
782
 
733
783
  #### helpText <a name="helpText"></a>
734
- Use the `helptext` slot to provide additional information back to your user about their selection option(s).
784
+ Use the `helpText` slot to provide additional information back to your user about their selection option(s).
735
785
 
736
786
  <div class="exampleWrapper">
737
787
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/helpText.html) -->
@@ -1034,57 +1084,56 @@ export function auroMenuLoadingExample() {
1034
1084
  <!-- AURO-GENERATED-CONTENT:END -->
1035
1085
  </auro-accordion>
1036
1086
 
1037
- ### valueText <a name="valueText"></a>
1038
- The label for selected option can be customized using `valueText` slot.
1039
- This slot can be manipulated on the `input` event which delivers the new value and selected `auro-menuoption` element in the `detail` object.
1087
+ ### displayValue <a name="displayValue"></a>
1088
+ The label for selected option can be customized using `displayValue` slot under `<menuoption>.
1040
1089
 
1041
1090
  <div class="exampleWrapper">
1042
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/valueText.html) -->
1043
- <!-- The below content is automatically added from ./../apiExamples/valueText.html -->
1044
- <auro-select id="valueTextExample" autocomplete="address-level1">
1091
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/displayValue.html) -->
1092
+ <!-- The below content is automatically added from ./../apiExamples/displayValue.html -->
1093
+ <auro-select id="displayValueExample" autocomplete="address-level1">
1045
1094
  <span slot="bib.fullscreen.headline">Select Your Gender</span>
1046
1095
  <span slot="label">Gender</span>
1047
- <span slot="valueText"></span>
1096
+ <span slot="displayValue"></span>
1048
1097
  <auro-menu>
1049
- <auro-menuoption value="m" data-display="Male">M - Male</auro-menuoption>
1050
- <auro-menuoption value="f" data-display="Female">F - Female</auro-menuoption>
1051
- <auro-menuoption value="x" data-display="Unspecified">X - Unspecified</auro-menuoption>
1052
- <auro-menuoption value="u" data-display="Undisclosed">U - Undisclosed</auro-menuoption>
1098
+ <auro-menuoption value="m" data-display="Male">M - Male
1099
+ <span slot="displayValue">Male</span>
1100
+ </auro-menuoption>
1101
+ <auro-menuoption value="f" data-display="Female">F - Female
1102
+ <span slot="displayValue">Female</span>
1103
+ </auro-menuoption>
1104
+ <auro-menuoption value="x" data-display="Unspecified">X - Unspecified
1105
+ <span slot="displayValue">Unspecified</span>
1106
+ </auro-menuoption>
1107
+ <auro-menuoption value="u" data-display="Undisclosed">U - Undisclosed
1108
+ <span slot="displayValue">Undisclosed</span>
1109
+ </auro-menuoption>
1053
1110
  </auro-menu>
1054
1111
  </auro-select>
1055
1112
  <!-- AURO-GENERATED-CONTENT:END -->
1056
1113
  </div>
1057
1114
  <auro-accordion alignRight>
1058
1115
  <span slot="trigger">See code</span>
1059
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/valueText.js) -->
1060
- <!-- The below code snippet is automatically added from ./../apiExamples/valueText.js -->
1061
-
1062
- ```js
1063
- export function valueTextExample() {
1064
- const onValueTextSelectInput = (e) => {
1065
- const valueText = e.target.querySelector("[slot=valueText]");
1066
-
1067
- valueText.textContent = e.detail.optionSelected.dataset.display;
1068
- };
1069
-
1070
- const select = document.querySelector("#valueTextExample");
1071
- select.addEventListener('input', onValueTextSelectInput);
1072
- }
1073
- ```
1074
- <!-- AURO-GENERATED-CONTENT:END -->
1075
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/valueText.html) -->
1076
- <!-- The below code snippet is automatically added from ./../apiExamples/valueText.html -->
1116
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/displayValue.html) -->
1117
+ <!-- The below code snippet is automatically added from ./../apiExamples/displayValue.html -->
1077
1118
 
1078
1119
  ```html
1079
- <auro-select id="valueTextExample" autocomplete="address-level1">
1120
+ <auro-select id="displayValueExample" autocomplete="address-level1">
1080
1121
  <span slot="bib.fullscreen.headline">Select Your Gender</span>
1081
1122
  <span slot="label">Gender</span>
1082
- <span slot="valueText"></span>
1123
+ <span slot="displayValue"></span>
1083
1124
  <auro-menu>
1084
- <auro-menuoption value="m" data-display="Male">M - Male</auro-menuoption>
1085
- <auro-menuoption value="f" data-display="Female">F - Female</auro-menuoption>
1086
- <auro-menuoption value="x" data-display="Unspecified">X - Unspecified</auro-menuoption>
1087
- <auro-menuoption value="u" data-display="Undisclosed">U - Undisclosed</auro-menuoption>
1125
+ <auro-menuoption value="m" data-display="Male">M - Male
1126
+ <span slot="displayValue">Male</span>
1127
+ </auro-menuoption>
1128
+ <auro-menuoption value="f" data-display="Female">F - Female
1129
+ <span slot="displayValue">Female</span>
1130
+ </auro-menuoption>
1131
+ <auro-menuoption value="x" data-display="Unspecified">X - Unspecified
1132
+ <span slot="displayValue">Unspecified</span>
1133
+ </auro-menuoption>
1134
+ <auro-menuoption value="u" data-display="Undisclosed">U - Undisclosed
1135
+ <span slot="displayValue">Undisclosed</span>
1136
+ </auro-menuoption>
1088
1137
  </auro-menu>
1089
1138
  </auro-select>
1090
1139
  ```
@@ -1105,7 +1154,8 @@ The bib position can be customized with `placement`, `offset`, `flip`, `autoPlac
1105
1154
  <div style="width: 350px">
1106
1155
  <auro-select offset="20" noFlip placement="bottom-end">
1107
1156
  <span slot="bib.fullscreen.headline">Bib Headline</span>
1108
- <span slot="label">bottom-end bib with 20px offset and noFlip</span>
1157
+ <span slot="label">Label</span>
1158
+ <span slot="helpText">bottom-end bib with 20px offset and noFlip</span>
1109
1159
  <auro-menu>
1110
1160
  <auro-menuoption value="stops">Stops</auro-menuoption>
1111
1161
  <auro-menuoption value="price">Price</auro-menuoption>
@@ -1117,7 +1167,8 @@ The bib position can be customized with `placement`, `offset`, `flip`, `autoPlac
1117
1167
  </auro-select>
1118
1168
  <auro-select offset="20" placement="bottom-end">
1119
1169
  <span slot="bib.fullscreen.headline">Bib Headline</span>
1120
- <span slot="label">bottom-end bib with 20px offset and flip</span>
1170
+ <span slot="label">Label</span>
1171
+ <span slot="helpText">bottom-end bib with 20px offset and flip</span>
1121
1172
  <auro-menu>
1122
1173
  <auro-menuoption value="stops">Stops</auro-menuoption>
1123
1174
  <auro-menuoption value="price">Price</auro-menuoption>
@@ -1129,7 +1180,8 @@ The bib position can be customized with `placement`, `offset`, `flip`, `autoPlac
1129
1180
  </auro-select>
1130
1181
  <auro-select offset="20" noFlip placement="right" autoPlacement noFlip >
1131
1182
  <span slot="bib.fullscreen.headline">Bib Headline</span>
1132
- <span slot="label">right bib with 20px offset, noFlip and autoPlacement</span>
1183
+ <span slot="label">Label</span>
1184
+ <span slot="helpText">right bib with 20px offset, noFlip and autoPlacement</span>
1133
1185
  <auro-menu>
1134
1186
  <auro-menuoption value="stops">Stops</auro-menuoption>
1135
1187
  <auro-menuoption value="price">Price</auro-menuoption>
@@ -1151,7 +1203,8 @@ The bib position can be customized with `placement`, `offset`, `flip`, `autoPlac
1151
1203
  <div style="width: 350px">
1152
1204
  <auro-select offset="20" noFlip placement="bottom-end">
1153
1205
  <span slot="bib.fullscreen.headline">Bib Headline</span>
1154
- <span slot="label">bottom-end bib with 20px offset and noFlip</span>
1206
+ <span slot="label">Label</span>
1207
+ <span slot="helpText">bottom-end bib with 20px offset and noFlip</span>
1155
1208
  <auro-menu>
1156
1209
  <auro-menuoption value="stops">Stops</auro-menuoption>
1157
1210
  <auro-menuoption value="price">Price</auro-menuoption>
@@ -1163,7 +1216,8 @@ The bib position can be customized with `placement`, `offset`, `flip`, `autoPlac
1163
1216
  </auro-select>
1164
1217
  <auro-select offset="20" placement="bottom-end">
1165
1218
  <span slot="bib.fullscreen.headline">Bib Headline</span>
1166
- <span slot="label">bottom-end bib with 20px offset and flip</span>
1219
+ <span slot="label">Label</span>
1220
+ <span slot="helpText">bottom-end bib with 20px offset and flip</span>
1167
1221
  <auro-menu>
1168
1222
  <auro-menuoption value="stops">Stops</auro-menuoption>
1169
1223
  <auro-menuoption value="price">Price</auro-menuoption>
@@ -1175,7 +1229,8 @@ The bib position can be customized with `placement`, `offset`, `flip`, `autoPlac
1175
1229
  </auro-select>
1176
1230
  <auro-select offset="20" noFlip placement="right" autoPlacement noFlip >
1177
1231
  <span slot="bib.fullscreen.headline">Bib Headline</span>
1178
- <span slot="label">right bib with 20px offset, noFlip and autoPlacement</span>
1232
+ <span slot="label">Label</span>
1233
+ <span slot="helpText">right bib with 20px offset, noFlip and autoPlacement</span>
1179
1234
  <auro-menu>
1180
1235
  <auro-menuoption value="stops">Stops</auro-menuoption>
1181
1236
  <auro-menuoption value="price">Price</auro-menuoption>