@aurodesignsystem-dev/auro-formkit 0.0.0-pr1515.0 → 0.0.0-pr1515.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 (49) hide show
  1. package/components/checkbox/demo/customize.min.js +1 -1
  2. package/components/checkbox/demo/getting-started.min.js +1 -1
  3. package/components/checkbox/demo/index.min.js +1 -1
  4. package/components/checkbox/dist/index.js +1 -1
  5. package/components/checkbox/dist/registered.js +1 -1
  6. package/components/combobox/demo/customize.min.js +119 -96
  7. package/components/combobox/demo/getting-started.min.js +119 -96
  8. package/components/combobox/demo/index.min.js +119 -96
  9. package/components/combobox/dist/index.js +118 -95
  10. package/components/combobox/dist/registered.js +118 -95
  11. package/components/counter/demo/customize.min.js +2 -2
  12. package/components/counter/demo/index.min.js +2 -2
  13. package/components/counter/dist/index.js +2 -2
  14. package/components/counter/dist/registered.js +2 -2
  15. package/components/datepicker/demo/customize.min.js +139 -97
  16. package/components/datepicker/demo/index.min.js +139 -97
  17. package/components/datepicker/dist/index.js +139 -97
  18. package/components/datepicker/dist/registered.js +139 -97
  19. package/components/dropdown/demo/customize.min.js +1 -1
  20. package/components/dropdown/demo/getting-started.min.js +1 -1
  21. package/components/dropdown/demo/index.min.js +1 -1
  22. package/components/dropdown/dist/index.js +1 -1
  23. package/components/dropdown/dist/registered.js +1 -1
  24. package/components/form/demo/customize.min.js +381 -293
  25. package/components/form/demo/getting-started.min.js +381 -293
  26. package/components/form/demo/index.min.js +381 -293
  27. package/components/form/demo/registerDemoDeps.min.js +381 -293
  28. package/components/input/demo/api.md +5 -5
  29. package/components/input/demo/customize.md +8 -8
  30. package/components/input/demo/customize.min.js +116 -93
  31. package/components/input/demo/getting-started.min.js +116 -93
  32. package/components/input/demo/index.min.js +116 -93
  33. package/components/input/dist/base-input.d.ts +33 -44
  34. package/components/input/dist/index.js +129 -94
  35. package/components/input/dist/registered.js +116 -93
  36. package/components/radio/demo/customize.min.js +1 -1
  37. package/components/radio/demo/getting-started.min.js +1 -1
  38. package/components/radio/demo/index.min.js +1 -1
  39. package/components/radio/dist/index.js +1 -1
  40. package/components/radio/dist/registered.js +1 -1
  41. package/components/select/demo/customize.md +1 -1
  42. package/components/select/demo/index.min.js +2 -2
  43. package/components/select/dist/index.js +2 -2
  44. package/components/select/dist/registered.js +2 -2
  45. package/custom-elements.json +1944 -1734
  46. package/package.json +1 -1
  47. package/components/select/demo/customize.min.js +0 -10170
  48. package/components/select/demo/demo-support.min.js +0 -55807
  49. package/components/select/demo/getting-started.min.js +0 -10214
@@ -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` | | If set, the label will remain fixed in the active position. |
16
+ | `activeLabel` | `activeLabel` | | `boolean` | false | 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` | | 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` | false | 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` | | 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. |
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. |
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` | | If set, disables auto-validation on blur. |
43
+ | `noValidate` | `noValidate` | | `boolean` | false | 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="12/31/2025" setCustomValidityRangeOverflow="Date must be on or before 12/31/2025.">
649
+ <auro-input type="date" max="2025-12-31" 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="12/31/2025" 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="2025-12-31" 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="01/01/2024" setCustomValidityRangeUnderflow="Date must be on or after 01/01/2024.">
670
+ <auro-input type="date" min="2024-01-01" 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="01/01/2024" 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="2024-01-01" 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="03/25/2023" setCustomValidityRangeOverflow="The selected date is past the defined maximum date.">
891
+ <auro-input type="date" max="2023-03-25" 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="03/25/2023" 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="2023-03-25" 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="03/25/2023" setCustomValidityRangeUnderflow="The selected date is before the defined minimum date.">
957
+ <auro-input type="date" min="2023-03-25" 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="03/25/2023" 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="2023-03-25" 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,6 +10385,13 @@ 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
+ }
10388
10395
  const normalizedFormat = format.toLowerCase();
10389
10396
  const maskOptions = this.getMaskOptions('date', normalizedFormat);
10390
10397
 
@@ -10535,79 +10542,18 @@ class BaseInput extends AuroElement {
10535
10542
  constructor() {
10536
10543
  super();
10537
10544
 
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() {
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.
10565
10555
  this.activeLabel = false;
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
-
10556
+ /** @private */
10611
10557
  this.allowedInputTypes = [
10612
10558
  "text",
10613
10559
  "number",
@@ -10616,7 +10562,8 @@ class BaseInput extends AuroElement {
10616
10562
  "credit-card",
10617
10563
  "tel"
10618
10564
  ];
10619
- this.icon = false;
10565
+ this.appearance = "default";
10566
+ /** @private */
10620
10567
  this.dateFormatMap = {
10621
10568
  'mm/dd/yyyy': 'dateMMDDYYYY',
10622
10569
  'dd/mm/yyyy': 'dateDDMMYYYY',
@@ -10633,27 +10580,57 @@ class BaseInput extends AuroElement {
10633
10580
  'dd/mm': 'dateDDMM',
10634
10581
  'mm/dd': 'dateMMDD'
10635
10582
  };
10583
+ this.disabled = false;
10584
+ /** @private */
10636
10585
  this.domHandler = new DomHandler();
10637
10586
  this.dvInputOnly = false;
10638
10587
  this.hasValue = false;
10588
+ this.hideLabelVisually = false;
10589
+ this.icon = false;
10590
+ /** @private */
10639
10591
  this.inputIconName = undefined;
10592
+ /** @private */
10640
10593
  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;
10641
10602
  this.noValidate = false;
10642
- this._rawMaskValue = undefined; // Used for storing raw values returned from input mask.
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 */
10643
10611
  this.setSelectionInputTypes = [
10644
10612
  "text",
10645
10613
  "password",
10646
10614
  "email"
10647
- ]; // Credit Card is not included as this caused cursor placement issues in Safari.
10615
+ ];
10616
+ this.shape = 'classic';
10617
+ /** @private */
10648
10618
  this.showPassword = false;
10619
+ this.size = 'lg';
10649
10620
  this.touched = false;
10621
+ /** @private */
10650
10622
  this.uniqueId = new UniqueId().create();
10623
+ /** @private */
10651
10624
  this.util = new AuroInputUtilities({
10652
10625
  locale: this.locale,
10653
10626
  format: this.format
10654
10627
  });
10628
+ /** @private */
10655
10629
  this.validation = new AuroFormValidation();
10630
+ /** @private */
10656
10631
  this.validationCCLength = undefined;
10632
+ this.value = undefined;
10633
+ this._valueObject = undefined;
10657
10634
  }
10658
10635
 
10659
10636
  // function to define props used within the scope of this component
@@ -11201,6 +11178,15 @@ class BaseInput extends AuroElement {
11201
11178
 
11202
11179
  this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
11203
11180
 
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
+
11204
11190
  // use validity message override if declared when initializing the component
11205
11191
  if (this.hasAttribute('setCustomValidity')) {
11206
11192
  this.ValidityMessageOverride = this.setCustomValidity;
@@ -11634,6 +11620,38 @@ class BaseInput extends AuroElement {
11634
11620
  this.touched = true;
11635
11621
  this.validation.validate(this);
11636
11622
  }
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
+ }
11637
11655
  }
11638
11656
 
11639
11657
  /**
@@ -12260,7 +12278,7 @@ class AuroHelpText extends i$3 {
12260
12278
  }
12261
12279
  }
12262
12280
 
12263
- var formkitVersion = '202606291748';
12281
+ var formkitVersion = '202606291813';
12264
12282
 
12265
12283
  /**
12266
12284
  * @license
@@ -12775,6 +12793,7 @@ class AuroInput extends BaseInput {
12775
12793
  <${this.buttonTag}
12776
12794
  @click="${this.handleClickShowPassword}"
12777
12795
  appearance="${this.onDark ? 'inverse' : this.appearance}"
12796
+ aria-pressed="${this.showPassword ? 'true' : 'false'}"
12778
12797
  class="notificationBtn passwordBtn"
12779
12798
  shape="circle"
12780
12799
  size="sm"
@@ -12848,25 +12867,29 @@ class AuroInput extends BaseInput {
12848
12867
  * @returns {html} - Returns HTML for the help text and error message.
12849
12868
  */
12850
12869
  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';
12851
12878
  return u$4`
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
- `
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>`
12869
12890
  }
12891
+ </p>
12892
+ </${this.helpTextTag}>
12870
12893
  `;
12871
12894
  }
12872
12895