@aurodesignsystem-dev/auro-formkit 0.0.0-pr1514.8 → 0.0.0-pr1515.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/components/bibtemplate/dist/index.js +1 -1
  2. package/components/bibtemplate/dist/registered.js +1 -1
  3. package/components/checkbox/demo/customize.min.js +1 -1
  4. package/components/checkbox/demo/getting-started.min.js +1 -1
  5. package/components/checkbox/demo/index.min.js +1 -1
  6. package/components/checkbox/dist/index.js +1 -1
  7. package/components/checkbox/dist/registered.js +1 -1
  8. package/components/combobox/demo/customize.min.js +97 -120
  9. package/components/combobox/demo/getting-started.min.js +97 -120
  10. package/components/combobox/demo/index.min.js +97 -120
  11. package/components/combobox/dist/index.js +96 -119
  12. package/components/combobox/dist/registered.js +96 -119
  13. package/components/counter/demo/customize.min.js +3 -3
  14. package/components/counter/demo/index.min.js +3 -3
  15. package/components/counter/dist/index.js +3 -3
  16. package/components/counter/dist/registered.js +3 -3
  17. package/components/datepicker/demo/customize.min.js +118 -251
  18. package/components/datepicker/demo/index.min.js +118 -251
  19. package/components/datepicker/dist/auro-calendar.d.ts +1 -30
  20. package/components/datepicker/dist/index.js +118 -251
  21. package/components/datepicker/dist/registered.js +118 -251
  22. package/components/dropdown/demo/customize.min.js +1 -1
  23. package/components/dropdown/demo/getting-started.min.js +1 -1
  24. package/components/dropdown/demo/index.min.js +1 -1
  25. package/components/dropdown/dist/index.js +1 -1
  26. package/components/dropdown/dist/registered.js +1 -1
  27. package/components/form/demo/customize.min.js +317 -496
  28. package/components/form/demo/getting-started.min.js +317 -496
  29. package/components/form/demo/index.min.js +317 -496
  30. package/components/form/demo/registerDemoDeps.min.js +317 -496
  31. package/components/input/demo/api.md +5 -5
  32. package/components/input/demo/customize.md +8 -8
  33. package/components/input/demo/customize.min.js +93 -116
  34. package/components/input/demo/getting-started.min.js +93 -116
  35. package/components/input/demo/index.min.js +93 -116
  36. package/components/input/dist/base-input.d.ts +44 -33
  37. package/components/input/dist/index.js +94 -129
  38. package/components/input/dist/registered.js +93 -116
  39. package/components/radio/demo/customize.min.js +1 -1
  40. package/components/radio/demo/getting-started.min.js +1 -1
  41. package/components/radio/demo/index.min.js +1 -1
  42. package/components/radio/dist/index.js +1 -1
  43. package/components/radio/dist/registered.js +1 -1
  44. package/components/select/demo/customize.md +1 -3
  45. package/components/select/demo/customize.min.js +3 -3
  46. package/components/select/demo/getting-started.min.js +50 -5
  47. package/components/select/demo/index.min.js +3 -3
  48. package/components/select/dist/index.js +3 -3
  49. package/components/select/dist/registered.js +3 -3
  50. package/custom-elements.json +1720 -1940
  51. package/package.json +1 -1
@@ -13,20 +13,20 @@ The `auro-input` element provides users a way to enter data into a text field.
13
13
  | `a11yControls` | `a11yControls` | | `string` | | The value for the aria-controls attribute. |
14
14
  | `a11yExpanded` | `a11yExpanded` | | `boolean` | | The value for the aria-expanded attribute. |
15
15
  | `a11yRole` | `a11yRole` | | `string` | | The value for the role attribute. |
16
- | `activeLabel` | `activeLabel` | | `boolean` | false | If set, the label will remain fixed in the active position. |
16
+ | `activeLabel` | `activeLabel` | | `boolean` | | If set, the label will remain fixed in the active position. |
17
17
  | `appearance` | `appearance` | | `'default' \| 'inverse'` | "'default'" | Defines whether the component will be on lighter or darker backgrounds. |
18
18
  | `autocapitalize` | `autocapitalize` | | `string` | | An enumerated attribute that controls whether and how text input is automatically capitalized as it is entered/edited by the user. [off/none, on/sentences, words, characters]. |
19
19
  | `autocomplete` | `autocomplete` | | `string` | | An enumerated attribute that defines what the user agent can suggest for autofill. At this time, only `autocomplete="off"` is supported. |
20
20
  | `autocorrect` | `autocorrect` | | `string` | | When set to `off`, stops iOS from auto-correcting words when typed into a text box. |
21
21
  | `customValidityTypeEmail` | `customValidityTypeEmail` | | `string` | | Custom help text message for email type validity. |
22
22
  | `disabled` | `disabled` | | `boolean` | false | If set, disables the input. |
23
- | `dvInputOnly` | `dvInputOnly` | | `boolean` | false | If defined, the display value slot content will only mask the HTML5 input element. The input's label will not be masked. |
23
+ | `dvInputOnly` | `dvInputOnly` | | `boolean` | | If defined, the display value slot content will only mask the HTML5 input element. The input's label will not be masked. |
24
24
  | `error` | `error` | | `string` | | When defined, sets persistent validity to `customError` and sets `setCustomValidity` = attribute value. |
25
25
  | `errorMessage` | `errorMessage` | | `string` | | Contains the help text message for the current validity error. |
26
26
  | `format` | `format` | | `string` | | Specifies the input mask format. |
27
27
  | `hasFocus` | | | `boolean` | | Flag to indicate if the input currently has focus. |
28
- | `hasValue` | | | `boolean` | false | Flag to indicate if the input currently has value. |
29
- | `icon` | `icon` | | `boolean` | false | If set, will render an icon inside the input to the left of the value. Support is limited to auro-input instances with credit card format. |
28
+ | `hasValue` | | | `boolean` | | Flag to indicate if the input currently has value. |
29
+ | `icon` | `icon` | | `boolean` | | If set, will render an icon inside the input to the left of the value. Support is limited to auro-input instances with credit card format. |
30
30
  | `id` | `id` | | `string` | | The id global attribute defines an identifier (ID) which must be unique in the whole document. |
31
31
  | `inputmode` | `inputmode` | | `string` | | Exposes inputmode attribute for input. |
32
32
  | `lang` | `lang` | | `string` | | Defines the language of an element. |
@@ -40,7 +40,7 @@ The `auro-input` element provides users a way to enter data into a text field.
40
40
  | `minObject` | | readonly | `Date \| undefined` | | Read-only Date object representation of `min` for full date formats. |
41
41
  | `name` | `name` | | `string` | | Populates the `name` attribute on the input. |
42
42
  | `nested` | `nested` | | `boolean` | | Sets styles for nested operation - removes borders, hides help + error text, and<br />hides accents. |
43
- | `noValidate` | `noValidate` | | `boolean` | false | If set, disables auto-validation on blur. |
43
+ | `noValidate` | `noValidate` | | `boolean` | | If set, disables auto-validation on blur. |
44
44
  | `onDark` | `onDark` | | `boolean` | false | DEPRECATED - use `appearance="inverse"` instead. |
45
45
  | `pattern` | `pattern` | | `string` | | Specifies a regular expression the form control's value should match. |
46
46
  | `placeholder` | `placeholder` | | `string` | | Define custom placeholder text. |
@@ -646,7 +646,7 @@
646
646
  <div class="exampleWrapper">
647
647
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-range-overflow.html) -->
648
648
  <!-- The below content is automatically added from ../apiExamples/set-custom-validity-range-overflow.html -->
649
- <auro-input type="date" max="2025-12-31" setCustomValidityRangeOverflow="Date must be on or before 12/31/2025.">
649
+ <auro-input type="date" max="12/31/2025" setCustomValidityRangeOverflow="Date must be on or before 12/31/2025.">
650
650
  <span slot="label">Event Date</span>
651
651
  <span slot="helpText">Enter a date no later than 12/31/2025.</span>
652
652
  </auro-input>
@@ -656,7 +656,7 @@
656
656
  <span slot="trigger">See code</span>
657
657
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-range-overflow.html) -->
658
658
  <!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-range-overflow.html -->
659
- <pre class="language-html"><code class="language-html">&lt;auro-input type="date" max="2025-12-31" setCustomValidityRangeOverflow="Date must be on or before 12/31/2025."&gt;
659
+ <pre class="language-html"><code class="language-html">&lt;auro-input type="date" max="12/31/2025" setCustomValidityRangeOverflow="Date must be on or before 12/31/2025."&gt;
660
660
  &lt;span slot="label"&gt;Event Date&lt;/span&gt;
661
661
  &lt;span slot="helpText"&gt;Enter a date no later than 12/31/2025.&lt;/span&gt;
662
662
  &lt;/auro-input&gt;</code></pre>
@@ -667,7 +667,7 @@
667
667
  <div class="exampleWrapper">
668
668
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/set-custom-validity-range-underflow.html) -->
669
669
  <!-- The below content is automatically added from ../apiExamples/set-custom-validity-range-underflow.html -->
670
- <auro-input type="date" min="2024-01-01" setCustomValidityRangeUnderflow="Date must be on or after 01/01/2024.">
670
+ <auro-input type="date" min="01/01/2024" setCustomValidityRangeUnderflow="Date must be on or after 01/01/2024.">
671
671
  <span slot="label">Start Date</span>
672
672
  <span slot="helpText">Enter a date no earlier than 01/01/2024.</span>
673
673
  </auro-input>
@@ -677,7 +677,7 @@
677
677
  <span slot="trigger">See code</span>
678
678
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/set-custom-validity-range-underflow.html) -->
679
679
  <!-- The below code snippet is automatically added from ../apiExamples/set-custom-validity-range-underflow.html -->
680
- <pre class="language-html"><code class="language-html">&lt;auro-input type="date" min="2024-01-01" setCustomValidityRangeUnderflow="Date must be on or after 01/01/2024."&gt;
680
+ <pre class="language-html"><code class="language-html">&lt;auro-input type="date" min="01/01/2024" setCustomValidityRangeUnderflow="Date must be on or after 01/01/2024."&gt;
681
681
  &lt;span slot="label"&gt;Start Date&lt;/span&gt;
682
682
  &lt;span slot="helpText"&gt;Enter a date no earlier than 01/01/2024.&lt;/span&gt;
683
683
  &lt;/auro-input&gt;</code></pre>
@@ -888,7 +888,7 @@
888
888
  <div class="exampleWrapper">
889
889
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/max-date.html) -->
890
890
  <!-- The below content is automatically added from ../apiExamples/max-date.html -->
891
- <auro-input type="date" max="2023-03-25" setCustomValidityRangeOverflow="The selected date is past the defined maximum date.">
891
+ <auro-input type="date" max="03/25/2023" setCustomValidityRangeOverflow="The selected date is past the defined maximum date.">
892
892
  <span slot="label">Choose a date</span>
893
893
  <span slot="helpText">Help Text</span>
894
894
  </auro-input>
@@ -898,7 +898,7 @@
898
898
  <span slot="trigger">See code</span>
899
899
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/max-date.html) -->
900
900
  <!-- The below code snippet is automatically added from ../apiExamples/max-date.html -->
901
- <pre class="language-html"><code class="language-html">&lt;auro-input type="date" max="2023-03-25" setCustomValidityRangeOverflow="The selected date is past the defined maximum date."&gt;
901
+ <pre class="language-html"><code class="language-html">&lt;auro-input type="date" max="03/25/2023" setCustomValidityRangeOverflow="The selected date is past the defined maximum date."&gt;
902
902
  &lt;span slot="label"&gt;Choose a date&lt;/span&gt;
903
903
  &lt;span slot="helpText"&gt;Help Text&lt;/span&gt;
904
904
  &lt;/auro-input&gt;</code></pre>
@@ -954,7 +954,7 @@
954
954
  <div class="exampleWrapper">
955
955
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=../apiExamples/min-date.html) -->
956
956
  <!-- The below content is automatically added from ../apiExamples/min-date.html -->
957
- <auro-input type="date" min="2023-03-25" setCustomValidityRangeUnderflow="The selected date is before the defined minimum date.">
957
+ <auro-input type="date" min="03/25/2023" setCustomValidityRangeUnderflow="The selected date is before the defined minimum date.">
958
958
  <span slot="label">Choose a date</span>
959
959
  <span slot="helpText">Help Text</span>
960
960
  </auro-input>
@@ -964,7 +964,7 @@
964
964
  <span slot="trigger">See code</span>
965
965
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=../apiExamples/min-date.html) -->
966
966
  <!-- The below code snippet is automatically added from ../apiExamples/min-date.html -->
967
- <pre class="language-html"><code class="language-html">&lt;auro-input type="date" min="2023-03-25" setCustomValidityRangeUnderflow="The selected date is before the defined minimum date."&gt;
967
+ <pre class="language-html"><code class="language-html">&lt;auro-input type="date" min="03/25/2023" setCustomValidityRangeUnderflow="The selected date is before the defined minimum date."&gt;
968
968
  &lt;span slot="label"&gt;Choose a date&lt;/span&gt;
969
969
  &lt;span slot="helpText"&gt;Help Text&lt;/span&gt;
970
970
  &lt;/auro-input&gt;</code></pre>
@@ -10385,13 +10385,6 @@ class AuroInputUtilities {
10385
10385
  * @returns {string | undefined}
10386
10386
  */
10387
10387
  toFormattedValue(valueObject, format) {
10388
- // Exposed publicly via `AuroInputUtil.toFormattedValue`, so a missing
10389
- // `format` argument has to fail gracefully rather than throw on
10390
- // `format.toLowerCase()`. Treat any falsy value (undefined, null, '')
10391
- // as "no format → no display value".
10392
- if (!format) {
10393
- return undefined;
10394
- }
10395
10388
  const normalizedFormat = format.toLowerCase();
10396
10389
  const maskOptions = this.getMaskOptions('date', normalizedFormat);
10397
10390
 
@@ -10542,18 +10535,79 @@ class BaseInput extends AuroElement {
10542
10535
  constructor() {
10543
10536
  super();
10544
10537
 
10545
- // Single-source initialization. Alphabetized so duplicate or stale
10546
- // defaults are immediately obvious on a diff. Every field is assigned
10547
- // exactly once here (previously the constructor + the old
10548
- // `_initializePrivateDefaults` overlapped — both wrote ~14 of the same
10549
- // fields and double-allocated `util` and `validation`, discarding the
10550
- // first instance). `validation` is now allocated exactly once; `util`
10551
- // is seeded here with an en-US default and then rebuilt in
10552
- // `connectedCallback` once the consumer-resolved locale is available,
10553
- // so a parent (datepicker/combobox) calling `validate()` synchronously
10554
- // during its own update cycle sees a populated util instance.
10538
+ this.appearance = "default";
10539
+ this.disabled = false;
10540
+ this.layout = 'classic';
10541
+ this.locale = 'en-US';
10542
+ this.max = undefined;
10543
+ this._maxObject = undefined;
10544
+ this.maxLength = undefined;
10545
+ this.min = undefined;
10546
+ this._minObject = undefined;
10547
+ this.minLength = undefined;
10548
+ this.required = false;
10549
+ this.onDark = false;
10550
+ this.setCustomValidityForType = undefined;
10551
+ this.size = 'lg';
10552
+ this.shape = 'classic';
10553
+ this.value = undefined;
10554
+ this._valueObject = undefined;
10555
+
10556
+ this._initializePrivateDefaults();
10557
+ }
10558
+
10559
+ /**
10560
+ * Internal Defaults.
10561
+ * @private
10562
+ * @returns {void}
10563
+ */
10564
+ _initializePrivateDefaults() {
10555
10565
  this.activeLabel = false;
10556
- /** @private */
10566
+ this.appearance = "default";
10567
+ this.icon = false;
10568
+ this.disabled = false;
10569
+ this.dvInputOnly = false;
10570
+ this.hideLabelVisually = false;
10571
+ this.max = undefined;
10572
+ this.maxLength = undefined;
10573
+ this.min = undefined;
10574
+ this.minLength = undefined;
10575
+ this.noValidate = false;
10576
+ this.onDark = false;
10577
+ this.required = false;
10578
+ this.setCustomValidityForType = undefined;
10579
+
10580
+ // Used for storing raw values returned from input mask.
10581
+ this._rawMaskValue = undefined;
10582
+
10583
+ /**
10584
+ * @private
10585
+ */
10586
+ this.layout = 'classic';
10587
+
10588
+ /**
10589
+ * @private
10590
+ */
10591
+ this.shape = 'classic';
10592
+
10593
+ /**
10594
+ * @private
10595
+ */
10596
+ this.size = 'lg';
10597
+
10598
+ this.touched = false;
10599
+ this.util = new AuroInputUtilities({
10600
+ locale: "en-US",
10601
+ format: this.format
10602
+ });
10603
+ this.validation = new AuroFormValidation();
10604
+ this.inputIconName = undefined;
10605
+ this.showPassword = false;
10606
+ this.validationCCLength = undefined;
10607
+ this.hasValue = false;
10608
+ this.label = 'Input label is undefined';
10609
+
10610
+
10557
10611
  this.allowedInputTypes = [
10558
10612
  "text",
10559
10613
  "number",
@@ -10562,8 +10616,7 @@ class BaseInput extends AuroElement {
10562
10616
  "credit-card",
10563
10617
  "tel"
10564
10618
  ];
10565
- this.appearance = "default";
10566
- /** @private */
10619
+ this.icon = false;
10567
10620
  this.dateFormatMap = {
10568
10621
  'mm/dd/yyyy': 'dateMMDDYYYY',
10569
10622
  'dd/mm/yyyy': 'dateDDMMYYYY',
@@ -10580,57 +10633,27 @@ class BaseInput extends AuroElement {
10580
10633
  'dd/mm': 'dateDDMM',
10581
10634
  'mm/dd': 'dateMMDD'
10582
10635
  };
10583
- this.disabled = false;
10584
- /** @private */
10585
10636
  this.domHandler = new DomHandler();
10586
10637
  this.dvInputOnly = false;
10587
10638
  this.hasValue = false;
10588
- this.hideLabelVisually = false;
10589
- this.icon = false;
10590
- /** @private */
10591
10639
  this.inputIconName = undefined;
10592
- /** @private */
10593
10640
  this.label = 'Input label is undefined';
10594
- this.layout = 'classic';
10595
- this.locale = 'en-US';
10596
- this.max = undefined;
10597
- this._maxObject = undefined;
10598
- this.maxLength = undefined;
10599
- this.min = undefined;
10600
- this._minObject = undefined;
10601
- this.minLength = undefined;
10602
10641
  this.noValidate = false;
10603
- this.onDark = false;
10604
- // Raw values returned from the input mask before model normalization.
10605
- this._rawMaskValue = undefined;
10606
- this.required = false;
10607
- this.setCustomValidityForType = undefined;
10608
- // Credit Card is intentionally excluded — its mask manages the cursor
10609
- // itself, and listing it here caused cursor placement issues in Safari.
10610
- /** @private */
10642
+ this._rawMaskValue = undefined; // Used for storing raw values returned from input mask.
10611
10643
  this.setSelectionInputTypes = [
10612
10644
  "text",
10613
10645
  "password",
10614
10646
  "email"
10615
- ];
10616
- this.shape = 'classic';
10617
- /** @private */
10647
+ ]; // Credit Card is not included as this caused cursor placement issues in Safari.
10618
10648
  this.showPassword = false;
10619
- this.size = 'lg';
10620
10649
  this.touched = false;
10621
- /** @private */
10622
10650
  this.uniqueId = new UniqueId().create();
10623
- /** @private */
10624
10651
  this.util = new AuroInputUtilities({
10625
10652
  locale: this.locale,
10626
10653
  format: this.format
10627
10654
  });
10628
- /** @private */
10629
10655
  this.validation = new AuroFormValidation();
10630
- /** @private */
10631
10656
  this.validationCCLength = undefined;
10632
- this.value = undefined;
10633
- this._valueObject = undefined;
10634
10657
  }
10635
10658
 
10636
10659
  // function to define props used within the scope of this component
@@ -11178,15 +11201,6 @@ class BaseInput extends AuroElement {
11178
11201
 
11179
11202
  this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
11180
11203
 
11181
- // Normalize the format token to lowercase so case-mixed values supplied
11182
- // via attribute (e.g. `format="MM/DD/YYYY"`) hit the `dateFormatMap`
11183
- // lookup inside `setCustomHelpTextMessage`. Without this, an uppercase
11184
- // format silently misses the map and leaves `setCustomValidityForType`
11185
- // unset.
11186
- if (this.format) {
11187
- this.format = this.format.toLowerCase();
11188
- }
11189
-
11190
11204
  // use validity message override if declared when initializing the component
11191
11205
  if (this.hasAttribute('setCustomValidity')) {
11192
11206
  this.ValidityMessageOverride = this.setCustomValidity;
@@ -11620,38 +11634,6 @@ class BaseInput extends AuroElement {
11620
11634
  this.touched = true;
11621
11635
  this.validation.validate(this);
11622
11636
  }
11623
-
11624
- // Prevents cursor jumping in Safari. Setting `this.value` triggers a Lit
11625
- // update that can re-render the input and reset the native cursor; we
11626
- // capture the caret position before that update commits and restore it
11627
- // via `setSelectionRange` once the update has flushed. Gated on
11628
- // `setSelectionInputTypes` so credit-card (and other masked types whose
11629
- // formatter manages the cursor itself) doesn't get a competing write.
11630
- // Capture the caret position INSIDE the gate — reading `selectionStart`
11631
- // on input types that don't support text selection (number, email in
11632
- // some browsers) throws InvalidStateError, which would crash all input
11633
- // handling. Wrap the read in try/catch belt-and-suspenders even though
11634
- // the gated types currently support it, since the list is a public
11635
- // property a consumer could mutate.
11636
- if (this.setSelectionInputTypes.includes(this.type)) {
11637
- let selectionStart;
11638
- try {
11639
- selectionStart = this.inputElement.selectionStart;
11640
- } catch (error) { // eslint-disable-line no-unused-vars
11641
- return;
11642
- }
11643
- if (typeof selectionStart !== 'number') {
11644
- return;
11645
- }
11646
- this.updateComplete.then(() => {
11647
- try {
11648
- this.inputElement.setSelectionRange(selectionStart, selectionStart);
11649
- } catch (error) { // eslint-disable-line no-unused-vars
11650
- // Some input types (number/email in certain UAs) throw on
11651
- // setSelectionRange; swallow and let the native cursor stand.
11652
- }
11653
- });
11654
- }
11655
11637
  }
11656
11638
 
11657
11639
  /**
@@ -12278,7 +12260,7 @@ class AuroHelpText extends i$3 {
12278
12260
  }
12279
12261
  }
12280
12262
 
12281
- var formkitVersion = '202606291956';
12263
+ var formkitVersion = '202606291748';
12282
12264
 
12283
12265
  /**
12284
12266
  * @license
@@ -12793,7 +12775,6 @@ class AuroInput extends BaseInput {
12793
12775
  <${this.buttonTag}
12794
12776
  @click="${this.handleClickShowPassword}"
12795
12777
  appearance="${this.onDark ? 'inverse' : this.appearance}"
12796
- aria-pressed="${this.showPassword ? 'true' : 'false'}"
12797
12778
  class="notificationBtn passwordBtn"
12798
12779
  shape="circle"
12799
12780
  size="sm"
@@ -12867,29 +12848,25 @@ class AuroInput extends BaseInput {
12867
12848
  * @returns {html} - Returns HTML for the help text and error message.
12868
12849
  */
12869
12850
  renderHtmlHelpText() {
12870
- // Single `<p>` with stable identity across validity transitions —
12871
- // previously two distinct templates (valid vs invalid) caused Lit to
12872
- // replace the node entirely on a flip, and VoiceOver wouldn't
12873
- // re-announce because the live-region element it was watching had been
12874
- // removed and a new one inserted. Keeping one node means the `role`,
12875
- // `aria-live`, and text content all change in-place, which AT does
12876
- // observe and announce.
12877
- const isError = this.validity && this.validity !== 'valid';
12878
12851
  return u$4`
12879
- <${this.helpTextTag}
12880
- appearance="${this.onDark ? 'inverse' : this.appearance}"
12881
- ?error=${isError}>
12882
- <p
12883
- id="${this.uniqueId}"
12884
- part="helpText"
12885
- role="${o$2(isError ? 'alert' : undefined)}"
12886
- aria-live="${o$2(isError ? 'assertive' : undefined)}">
12887
- ${isError
12888
- ? this.errorMessage
12889
- : u$4`<slot name="helpText">${this.getHelpText()}</slot>`
12852
+ ${!this.validity || this.validity === undefined || this.validity === 'valid'
12853
+ ? u$4`
12854
+ <${this.helpTextTag}
12855
+ appearance="${this.onDark ? 'inverse' : this.appearance}">
12856
+ <p id="${this.uniqueId}" part="helpText">
12857
+ <slot name="helpText">${this.getHelpText()}</slot>
12858
+ </p>
12859
+ </${this.helpTextTag}>
12860
+ `
12861
+ : u$4`
12862
+ <${this.helpTextTag} error
12863
+ appearance="${this.onDark ? 'inverse' : this.appearance}">
12864
+ <p id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
12865
+ ${this.errorMessage}
12866
+ </p>
12867
+ </${this.helpTextTag}>
12868
+ `
12890
12869
  }
12891
- </p>
12892
- </${this.helpTextTag}>
12893
12870
  `;
12894
12871
  }
12895
12872