@aurodesignsystem-dev/auro-formkit 0.0.0-pr1605.0 → 0.0.0-pr1608.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/checkbox/demo/accessibility.md +15 -4
- package/components/checkbox/demo/customize.min.js +53 -17
- package/components/checkbox/demo/getting-started.min.js +53 -17
- package/components/checkbox/demo/index.min.js +53 -17
- package/components/checkbox/dist/auro-checkbox-group.d.ts +13 -0
- package/components/checkbox/dist/index.js +53 -17
- package/components/checkbox/dist/registered.js +53 -17
- package/components/combobox/demo/customize.min.js +3 -3
- package/components/combobox/demo/getting-started.min.js +3 -3
- package/components/combobox/demo/index.min.js +3 -3
- package/components/combobox/dist/index.js +3 -3
- package/components/combobox/dist/registered.js +3 -3
- package/components/counter/demo/customize.min.js +2 -2
- package/components/counter/demo/getting-started.min.js +2 -2
- package/components/counter/demo/index.min.js +2 -2
- package/components/counter/dist/index.js +2 -2
- package/components/counter/dist/registered.js +2 -2
- package/components/datepicker/demo/customize.min.js +4 -51
- package/components/datepicker/demo/getting-started.min.js +4 -51
- package/components/datepicker/demo/index.min.js +4 -51
- package/components/datepicker/dist/auro-datepicker.d.ts +0 -7
- package/components/datepicker/dist/index.js +4 -51
- package/components/datepicker/dist/registered.js +4 -51
- package/components/dropdown/demo/customize.min.js +1 -1
- package/components/dropdown/demo/getting-started.min.js +2 -2
- package/components/dropdown/demo/index.min.js +1 -1
- package/components/dropdown/dist/index.js +1 -1
- package/components/dropdown/dist/registered.js +1 -1
- package/components/form/demo/customize.min.js +123 -96
- package/components/form/demo/getting-started.min.js +123 -96
- package/components/form/demo/index.min.js +123 -96
- package/components/form/demo/registerDemoDeps.min.js +123 -96
- package/components/input/demo/customize.min.js +1 -1
- package/components/input/demo/getting-started.min.js +1 -1
- package/components/input/demo/index.min.js +1 -1
- package/components/input/dist/index.js +1 -1
- package/components/input/dist/registered.js +1 -1
- package/components/radio/demo/accessibility.md +13 -4
- package/components/radio/demo/customize.min.js +54 -16
- package/components/radio/demo/getting-started.min.js +54 -16
- package/components/radio/demo/index.min.js +54 -16
- package/components/radio/dist/auro-radio-group.d.ts +13 -0
- package/components/radio/dist/index.js +54 -16
- package/components/radio/dist/registered.js +54 -16
- package/components/select/demo/customize.min.js +2 -2
- package/components/select/demo/getting-started.min.js +2 -2
- package/components/select/demo/index.min.js +2 -2
- package/components/select/dist/index.js +2 -2
- package/components/select/dist/registered.js +2 -2
- package/custom-elements.json +22 -10
- package/package.json +1 -1
|
@@ -8,12 +8,13 @@ For keyboard interaction details, see the <auro-hyperlink href="keyboard-behavio
|
|
|
8
8
|
|
|
9
9
|
<auro-header level="2" id="ariaRolesAndAttributes">ARIA Roles and Attributes</auro-header>
|
|
10
10
|
<auro-header level="3" id="checkboxGroup">Checkbox Group</auro-header>
|
|
11
|
-
The `<auro-checkbox-group>` element uses a `<fieldset>` with a `<legend>` internally, providing native grouping semantics:
|
|
11
|
+
The `<auro-checkbox-group>` element uses a `<fieldset>` with a `<legend>` internally, providing native grouping semantics. These attributes are applied to that shadow-DOM `<fieldset>`, **not** to the `<auro-checkbox-group>` host element:
|
|
12
12
|
|
|
13
13
|
| Attribute | Value | Description |
|
|
14
14
|
|---|---|---|
|
|
15
|
-
| `role` | `group` (implicit via `fieldset`) | Groups related checkboxes together. |
|
|
16
|
-
| `aria-invalid` | `true`
|
|
15
|
+
| `role` | `group` (implicit via `fieldset`) | Groups related checkboxes together. There is no ARIA `checkboxgroup` role, so the `<fieldset>`'s implicit `group` role is used as-is. |
|
|
16
|
+
| `aria-invalid` | `true` | Present only while the group is in an invalid state. The attribute is **omitted entirely** when the group is valid — it is never set to `false`. |
|
|
17
|
+
| `aria-describedby` | id reference | Points at the `id` of the group's help-text/error element, so assistive technology can associate the message with the group on demand rather than relying only on the one-time live-region announcement. |
|
|
17
18
|
|
|
18
19
|
<auro-header level="3" id="checkboxElement">Checkbox</auro-header>
|
|
19
20
|
Each `<auro-checkbox>` renders a native `<input type="checkbox">` inside its shadow DOM:
|
|
@@ -23,12 +24,22 @@ Each `<auro-checkbox>` renders a native `<input type="checkbox">` inside its sha
|
|
|
23
24
|
| `type` | `checkbox` | Native checkbox input type. |
|
|
24
25
|
| `aria-checked` | `true` / `false` | Reflects the checked state of the checkbox. |
|
|
25
26
|
| `aria-disabled` | `true` / `false` | Indicates whether the checkbox is disabled. |
|
|
27
|
+
| `aria-invalid` | `true` | Mirrored onto each checkbox from the group while the group is invalid, and removed when it becomes valid. Omitted rather than set to `false`. |
|
|
28
|
+
|
|
29
|
+
<auro-header level="4" id="invalidStatePlacement">Why the invalid state appears twice</auro-header>
|
|
30
|
+
While the group is invalid, `aria-invalid` is set on both the `<fieldset>` and every individual `<auro-checkbox>`. This is intentional: some assistive-technology and browser combinations announce a container's invalid state only when focus first enters the group, so mirroring the state onto each checkbox keeps it conveyed as focus moves through the options.
|
|
31
|
+
|
|
32
|
+
The `checkbox` role is in `aria-invalid`'s supported-role list in every ARIA version, so the per-checkbox placement is unambiguous. The group-level placement is worth one note: `aria-invalid` is a global attribute in ARIA 1.1, applicable to any role including `group`, but ARIA 1.2 deprecates that global use in favor of a supported-role list that does not include `group`. Keeping it on the `<fieldset>` is a deliberate choice — it is not a *prohibited* attribute for `group`, current axe-core resolves it as global and reports no violation, and it gives the group a real invalid signal that would otherwise be lost. This is covered by an automated axe assertion in the component's test suite so that a future change in tooling surfaces here rather than in a consumer's audit.
|
|
33
|
+
|
|
34
|
+
<auro-header level="4" id="attributePlacementNote">Attribute placement</auro-header>
|
|
35
|
+
`aria-invalid` is applied to the internal `<fieldset>`, not to the `<auro-checkbox-group>` host element. Do not write CSS selectors or test assertions against `auro-checkbox-group[aria-invalid]`; query the internal fieldset or read the `validity` property instead.
|
|
26
36
|
|
|
27
37
|
<auro-header level="2" id="screenReaderAnnouncements">Screen Reader Announcements</auro-header>
|
|
28
38
|
- **Focus** — When focus moves to a checkbox, the screen reader announces the checkbox label, its checked/unchecked state, and role ("checkbox").
|
|
29
39
|
- **State change** — Toggling the checkbox announces the new state ("checked" or "unchecked").
|
|
30
40
|
- **Group context** — The legend text provides group context when navigating between groups.
|
|
31
|
-
- **Error** — When validation fails, the error message is announced
|
|
41
|
+
- **Error** — When validation fails, the error message is announced immediately via the help text's `role="alert"` live region, and stays discoverable afterward through the group's `aria-describedby` association.
|
|
42
|
+
- **Invalid state** — While the group is invalid, entering it or moving between its checkboxes conveys the invalid state.
|
|
32
43
|
|
|
33
44
|
<auro-header level="2" id="accessibleLabels">Accessible Labels</auro-header>
|
|
34
45
|
- The `legend` slot content provides the accessible group label via the native `<legend>` element.
|
|
@@ -1046,6 +1046,22 @@ class AuroDependencyVersioning {
|
|
|
1046
1046
|
}
|
|
1047
1047
|
}
|
|
1048
1048
|
|
|
1049
|
+
/**
|
|
1050
|
+
* Class for generating unique hashes based on the current timestamp.
|
|
1051
|
+
* This can be used to create unique identifiers for elements or data within an application,
|
|
1052
|
+
* ensuring that each identifier is distinct and can be easily generated without the need
|
|
1053
|
+
* for external libraries or complex algorithms.
|
|
1054
|
+
*/
|
|
1055
|
+
class UniqueId {
|
|
1056
|
+
/**
|
|
1057
|
+
* Creates a unique hash based on the current timestamp.
|
|
1058
|
+
* @returns {Function} Timestamp as a base-36 string
|
|
1059
|
+
*/
|
|
1060
|
+
create() {
|
|
1061
|
+
return Date.now().toString(36);
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1049
1065
|
var styleCss$1 = i$5`:host{display:block;padding-bottom:var(--ds-size-150, 0.75rem)}.displayFlex legend+slot{display:flex;white-space:nowrap}fieldset{all:unset}legend{margin-bottom:var(--ds-size-150, 0.75rem)}[auro-helptext]{margin-top:var(--ds-size-150, 0.75rem)}`;
|
|
1050
1066
|
|
|
1051
1067
|
var colorCss$1 = i$5`:host{color:var(--ds-auro-checkbox-group-text-color)}:host([disabled]){--ds-auro-checkbox-group-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host([onDark]),:host([appearance=inverse]){--ds-auro-checkbox-group-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][disabled]),:host([appearance=inverse][disabled]){--ds-auro-checkbox-group-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}`;
|
|
@@ -1284,7 +1300,7 @@ class AuroHelpText extends i$2 {
|
|
|
1284
1300
|
}
|
|
1285
1301
|
}
|
|
1286
1302
|
|
|
1287
|
-
var formkitVersion = '
|
|
1303
|
+
var formkitVersion = '202609022217';
|
|
1288
1304
|
|
|
1289
1305
|
// Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
|
|
1290
1306
|
// See LICENSE in the project root for license information.
|
|
@@ -1361,6 +1377,11 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1361
1377
|
* @private
|
|
1362
1378
|
*/
|
|
1363
1379
|
this.helpTextTag = versioning.generateTag('auro-formkit-checkbox-helptext', formkitVersion, AuroHelpText);
|
|
1380
|
+
|
|
1381
|
+
/**
|
|
1382
|
+
* @private
|
|
1383
|
+
*/
|
|
1384
|
+
this.uniqueId = new UniqueId().create();
|
|
1364
1385
|
}
|
|
1365
1386
|
|
|
1366
1387
|
static get styles() {
|
|
@@ -1612,6 +1633,29 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1612
1633
|
this.handlePreselectedItems();
|
|
1613
1634
|
|
|
1614
1635
|
this.validate();
|
|
1636
|
+
this.syncCheckboxValidity();
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
/**
|
|
1640
|
+
* Method for mirroring the group's invalid state onto each checkbox.
|
|
1641
|
+
* `validity` is the authoritative invalid state, and it has to be re-applied from
|
|
1642
|
+
* `handleItems()` as well, because a slot change can happen without `validity` itself
|
|
1643
|
+
* changing — a checkbox slotted into an already-invalid group would otherwise be missed.
|
|
1644
|
+
* @private
|
|
1645
|
+
* @returns {void}
|
|
1646
|
+
*/
|
|
1647
|
+
syncCheckboxValidity() {
|
|
1648
|
+
const invalid = Boolean(this.validity && this.validity !== 'valid');
|
|
1649
|
+
|
|
1650
|
+
this.checkboxes.forEach((el) => {
|
|
1651
|
+
if (invalid) {
|
|
1652
|
+
el.setAttribute('error', true);
|
|
1653
|
+
el.setAttribute('aria-invalid', 'true');
|
|
1654
|
+
} else {
|
|
1655
|
+
el.removeAttribute('error');
|
|
1656
|
+
el.removeAttribute('aria-invalid');
|
|
1657
|
+
}
|
|
1658
|
+
});
|
|
1615
1659
|
}
|
|
1616
1660
|
|
|
1617
1661
|
/**
|
|
@@ -1643,13 +1687,7 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1643
1687
|
}
|
|
1644
1688
|
|
|
1645
1689
|
if (changedProperties.has('validity')) {
|
|
1646
|
-
this.
|
|
1647
|
-
if (this.validity && this.validity !== 'valid') {
|
|
1648
|
-
el.setAttribute('error', true);
|
|
1649
|
-
} else {
|
|
1650
|
-
el.removeAttribute('error');
|
|
1651
|
-
}
|
|
1652
|
-
});
|
|
1690
|
+
this.syncCheckboxValidity();
|
|
1653
1691
|
}
|
|
1654
1692
|
|
|
1655
1693
|
if (changedProperties.has('required')) {
|
|
@@ -1673,12 +1711,6 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1673
1711
|
}
|
|
1674
1712
|
|
|
1675
1713
|
if (changedProperties.has('error')) {
|
|
1676
|
-
if (this.error) {
|
|
1677
|
-
this.setAttribute('aria-invalid', true);
|
|
1678
|
-
} else {
|
|
1679
|
-
this.removeAttribute('aria-invalid');
|
|
1680
|
-
}
|
|
1681
|
-
|
|
1682
1714
|
this.validate(true);
|
|
1683
1715
|
}
|
|
1684
1716
|
}
|
|
@@ -1697,7 +1729,11 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1697
1729
|
};
|
|
1698
1730
|
|
|
1699
1731
|
return u`
|
|
1700
|
-
<fieldset
|
|
1732
|
+
<fieldset
|
|
1733
|
+
class="${e(groupClasses)}"
|
|
1734
|
+
aria-invalid="${o$1(this.validity && this.validity !== 'valid' ? 'true' : undefined)}"
|
|
1735
|
+
aria-describedby="${this.uniqueId}"
|
|
1736
|
+
>
|
|
1701
1737
|
<legend>
|
|
1702
1738
|
<slot name="legend"></slot>
|
|
1703
1739
|
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
@@ -1707,11 +1743,11 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1707
1743
|
|
|
1708
1744
|
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
1709
1745
|
? u`
|
|
1710
|
-
<${this.helpTextTag} part="helpText" appearance="${this.onDark ? 'inverse' : this.appearance}">
|
|
1746
|
+
<${this.helpTextTag} id="${this.uniqueId}" part="helpText" appearance="${this.onDark ? 'inverse' : this.appearance}">
|
|
1711
1747
|
<slot name="helpText"></slot>
|
|
1712
1748
|
</${this.helpTextTag}>`
|
|
1713
1749
|
: u`
|
|
1714
|
-
<${this.helpTextTag} error appearance="${this.onDark ? 'inverse' : this.appearance}"
|
|
1750
|
+
<${this.helpTextTag} id="${this.uniqueId}" error appearance="${this.onDark ? 'inverse' : this.appearance}" role="alert" aria-live="assertive" part="helpText">
|
|
1715
1751
|
${this.errorMessage}
|
|
1716
1752
|
</${this.helpTextTag}>`
|
|
1717
1753
|
}
|
|
@@ -1046,6 +1046,22 @@ class AuroDependencyVersioning {
|
|
|
1046
1046
|
}
|
|
1047
1047
|
}
|
|
1048
1048
|
|
|
1049
|
+
/**
|
|
1050
|
+
* Class for generating unique hashes based on the current timestamp.
|
|
1051
|
+
* This can be used to create unique identifiers for elements or data within an application,
|
|
1052
|
+
* ensuring that each identifier is distinct and can be easily generated without the need
|
|
1053
|
+
* for external libraries or complex algorithms.
|
|
1054
|
+
*/
|
|
1055
|
+
class UniqueId {
|
|
1056
|
+
/**
|
|
1057
|
+
* Creates a unique hash based on the current timestamp.
|
|
1058
|
+
* @returns {Function} Timestamp as a base-36 string
|
|
1059
|
+
*/
|
|
1060
|
+
create() {
|
|
1061
|
+
return Date.now().toString(36);
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1049
1065
|
var styleCss$1 = i$5`:host{display:block;padding-bottom:var(--ds-size-150, 0.75rem)}.displayFlex legend+slot{display:flex;white-space:nowrap}fieldset{all:unset}legend{margin-bottom:var(--ds-size-150, 0.75rem)}[auro-helptext]{margin-top:var(--ds-size-150, 0.75rem)}`;
|
|
1050
1066
|
|
|
1051
1067
|
var colorCss$1 = i$5`:host{color:var(--ds-auro-checkbox-group-text-color)}:host([disabled]){--ds-auro-checkbox-group-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host([onDark]),:host([appearance=inverse]){--ds-auro-checkbox-group-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][disabled]),:host([appearance=inverse][disabled]){--ds-auro-checkbox-group-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}`;
|
|
@@ -1284,7 +1300,7 @@ class AuroHelpText extends i$2 {
|
|
|
1284
1300
|
}
|
|
1285
1301
|
}
|
|
1286
1302
|
|
|
1287
|
-
var formkitVersion = '
|
|
1303
|
+
var formkitVersion = '202609022217';
|
|
1288
1304
|
|
|
1289
1305
|
// Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
|
|
1290
1306
|
// See LICENSE in the project root for license information.
|
|
@@ -1361,6 +1377,11 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1361
1377
|
* @private
|
|
1362
1378
|
*/
|
|
1363
1379
|
this.helpTextTag = versioning.generateTag('auro-formkit-checkbox-helptext', formkitVersion, AuroHelpText);
|
|
1380
|
+
|
|
1381
|
+
/**
|
|
1382
|
+
* @private
|
|
1383
|
+
*/
|
|
1384
|
+
this.uniqueId = new UniqueId().create();
|
|
1364
1385
|
}
|
|
1365
1386
|
|
|
1366
1387
|
static get styles() {
|
|
@@ -1612,6 +1633,29 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1612
1633
|
this.handlePreselectedItems();
|
|
1613
1634
|
|
|
1614
1635
|
this.validate();
|
|
1636
|
+
this.syncCheckboxValidity();
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
/**
|
|
1640
|
+
* Method for mirroring the group's invalid state onto each checkbox.
|
|
1641
|
+
* `validity` is the authoritative invalid state, and it has to be re-applied from
|
|
1642
|
+
* `handleItems()` as well, because a slot change can happen without `validity` itself
|
|
1643
|
+
* changing — a checkbox slotted into an already-invalid group would otherwise be missed.
|
|
1644
|
+
* @private
|
|
1645
|
+
* @returns {void}
|
|
1646
|
+
*/
|
|
1647
|
+
syncCheckboxValidity() {
|
|
1648
|
+
const invalid = Boolean(this.validity && this.validity !== 'valid');
|
|
1649
|
+
|
|
1650
|
+
this.checkboxes.forEach((el) => {
|
|
1651
|
+
if (invalid) {
|
|
1652
|
+
el.setAttribute('error', true);
|
|
1653
|
+
el.setAttribute('aria-invalid', 'true');
|
|
1654
|
+
} else {
|
|
1655
|
+
el.removeAttribute('error');
|
|
1656
|
+
el.removeAttribute('aria-invalid');
|
|
1657
|
+
}
|
|
1658
|
+
});
|
|
1615
1659
|
}
|
|
1616
1660
|
|
|
1617
1661
|
/**
|
|
@@ -1643,13 +1687,7 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1643
1687
|
}
|
|
1644
1688
|
|
|
1645
1689
|
if (changedProperties.has('validity')) {
|
|
1646
|
-
this.
|
|
1647
|
-
if (this.validity && this.validity !== 'valid') {
|
|
1648
|
-
el.setAttribute('error', true);
|
|
1649
|
-
} else {
|
|
1650
|
-
el.removeAttribute('error');
|
|
1651
|
-
}
|
|
1652
|
-
});
|
|
1690
|
+
this.syncCheckboxValidity();
|
|
1653
1691
|
}
|
|
1654
1692
|
|
|
1655
1693
|
if (changedProperties.has('required')) {
|
|
@@ -1673,12 +1711,6 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1673
1711
|
}
|
|
1674
1712
|
|
|
1675
1713
|
if (changedProperties.has('error')) {
|
|
1676
|
-
if (this.error) {
|
|
1677
|
-
this.setAttribute('aria-invalid', true);
|
|
1678
|
-
} else {
|
|
1679
|
-
this.removeAttribute('aria-invalid');
|
|
1680
|
-
}
|
|
1681
|
-
|
|
1682
1714
|
this.validate(true);
|
|
1683
1715
|
}
|
|
1684
1716
|
}
|
|
@@ -1697,7 +1729,11 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1697
1729
|
};
|
|
1698
1730
|
|
|
1699
1731
|
return u`
|
|
1700
|
-
<fieldset
|
|
1732
|
+
<fieldset
|
|
1733
|
+
class="${e(groupClasses)}"
|
|
1734
|
+
aria-invalid="${o$1(this.validity && this.validity !== 'valid' ? 'true' : undefined)}"
|
|
1735
|
+
aria-describedby="${this.uniqueId}"
|
|
1736
|
+
>
|
|
1701
1737
|
<legend>
|
|
1702
1738
|
<slot name="legend"></slot>
|
|
1703
1739
|
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
@@ -1707,11 +1743,11 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1707
1743
|
|
|
1708
1744
|
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
1709
1745
|
? u`
|
|
1710
|
-
<${this.helpTextTag} part="helpText" appearance="${this.onDark ? 'inverse' : this.appearance}">
|
|
1746
|
+
<${this.helpTextTag} id="${this.uniqueId}" part="helpText" appearance="${this.onDark ? 'inverse' : this.appearance}">
|
|
1711
1747
|
<slot name="helpText"></slot>
|
|
1712
1748
|
</${this.helpTextTag}>`
|
|
1713
1749
|
: u`
|
|
1714
|
-
<${this.helpTextTag} error appearance="${this.onDark ? 'inverse' : this.appearance}"
|
|
1750
|
+
<${this.helpTextTag} id="${this.uniqueId}" error appearance="${this.onDark ? 'inverse' : this.appearance}" role="alert" aria-live="assertive" part="helpText">
|
|
1715
1751
|
${this.errorMessage}
|
|
1716
1752
|
</${this.helpTextTag}>`
|
|
1717
1753
|
}
|
|
@@ -1046,6 +1046,22 @@ class AuroDependencyVersioning {
|
|
|
1046
1046
|
}
|
|
1047
1047
|
}
|
|
1048
1048
|
|
|
1049
|
+
/**
|
|
1050
|
+
* Class for generating unique hashes based on the current timestamp.
|
|
1051
|
+
* This can be used to create unique identifiers for elements or data within an application,
|
|
1052
|
+
* ensuring that each identifier is distinct and can be easily generated without the need
|
|
1053
|
+
* for external libraries or complex algorithms.
|
|
1054
|
+
*/
|
|
1055
|
+
class UniqueId {
|
|
1056
|
+
/**
|
|
1057
|
+
* Creates a unique hash based on the current timestamp.
|
|
1058
|
+
* @returns {Function} Timestamp as a base-36 string
|
|
1059
|
+
*/
|
|
1060
|
+
create() {
|
|
1061
|
+
return Date.now().toString(36);
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1049
1065
|
var styleCss$1 = i$5`:host{display:block;padding-bottom:var(--ds-size-150, 0.75rem)}.displayFlex legend+slot{display:flex;white-space:nowrap}fieldset{all:unset}legend{margin-bottom:var(--ds-size-150, 0.75rem)}[auro-helptext]{margin-top:var(--ds-size-150, 0.75rem)}`;
|
|
1050
1066
|
|
|
1051
1067
|
var colorCss$1 = i$5`:host{color:var(--ds-auro-checkbox-group-text-color)}:host([disabled]){--ds-auro-checkbox-group-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host([onDark]),:host([appearance=inverse]){--ds-auro-checkbox-group-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][disabled]),:host([appearance=inverse][disabled]){--ds-auro-checkbox-group-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}`;
|
|
@@ -1284,7 +1300,7 @@ class AuroHelpText extends i$2 {
|
|
|
1284
1300
|
}
|
|
1285
1301
|
}
|
|
1286
1302
|
|
|
1287
|
-
var formkitVersion = '
|
|
1303
|
+
var formkitVersion = '202609022217';
|
|
1288
1304
|
|
|
1289
1305
|
// Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
|
|
1290
1306
|
// See LICENSE in the project root for license information.
|
|
@@ -1361,6 +1377,11 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1361
1377
|
* @private
|
|
1362
1378
|
*/
|
|
1363
1379
|
this.helpTextTag = versioning.generateTag('auro-formkit-checkbox-helptext', formkitVersion, AuroHelpText);
|
|
1380
|
+
|
|
1381
|
+
/**
|
|
1382
|
+
* @private
|
|
1383
|
+
*/
|
|
1384
|
+
this.uniqueId = new UniqueId().create();
|
|
1364
1385
|
}
|
|
1365
1386
|
|
|
1366
1387
|
static get styles() {
|
|
@@ -1612,6 +1633,29 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1612
1633
|
this.handlePreselectedItems();
|
|
1613
1634
|
|
|
1614
1635
|
this.validate();
|
|
1636
|
+
this.syncCheckboxValidity();
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
/**
|
|
1640
|
+
* Method for mirroring the group's invalid state onto each checkbox.
|
|
1641
|
+
* `validity` is the authoritative invalid state, and it has to be re-applied from
|
|
1642
|
+
* `handleItems()` as well, because a slot change can happen without `validity` itself
|
|
1643
|
+
* changing — a checkbox slotted into an already-invalid group would otherwise be missed.
|
|
1644
|
+
* @private
|
|
1645
|
+
* @returns {void}
|
|
1646
|
+
*/
|
|
1647
|
+
syncCheckboxValidity() {
|
|
1648
|
+
const invalid = Boolean(this.validity && this.validity !== 'valid');
|
|
1649
|
+
|
|
1650
|
+
this.checkboxes.forEach((el) => {
|
|
1651
|
+
if (invalid) {
|
|
1652
|
+
el.setAttribute('error', true);
|
|
1653
|
+
el.setAttribute('aria-invalid', 'true');
|
|
1654
|
+
} else {
|
|
1655
|
+
el.removeAttribute('error');
|
|
1656
|
+
el.removeAttribute('aria-invalid');
|
|
1657
|
+
}
|
|
1658
|
+
});
|
|
1615
1659
|
}
|
|
1616
1660
|
|
|
1617
1661
|
/**
|
|
@@ -1643,13 +1687,7 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1643
1687
|
}
|
|
1644
1688
|
|
|
1645
1689
|
if (changedProperties.has('validity')) {
|
|
1646
|
-
this.
|
|
1647
|
-
if (this.validity && this.validity !== 'valid') {
|
|
1648
|
-
el.setAttribute('error', true);
|
|
1649
|
-
} else {
|
|
1650
|
-
el.removeAttribute('error');
|
|
1651
|
-
}
|
|
1652
|
-
});
|
|
1690
|
+
this.syncCheckboxValidity();
|
|
1653
1691
|
}
|
|
1654
1692
|
|
|
1655
1693
|
if (changedProperties.has('required')) {
|
|
@@ -1673,12 +1711,6 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1673
1711
|
}
|
|
1674
1712
|
|
|
1675
1713
|
if (changedProperties.has('error')) {
|
|
1676
|
-
if (this.error) {
|
|
1677
|
-
this.setAttribute('aria-invalid', true);
|
|
1678
|
-
} else {
|
|
1679
|
-
this.removeAttribute('aria-invalid');
|
|
1680
|
-
}
|
|
1681
|
-
|
|
1682
1714
|
this.validate(true);
|
|
1683
1715
|
}
|
|
1684
1716
|
}
|
|
@@ -1697,7 +1729,11 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1697
1729
|
};
|
|
1698
1730
|
|
|
1699
1731
|
return u`
|
|
1700
|
-
<fieldset
|
|
1732
|
+
<fieldset
|
|
1733
|
+
class="${e(groupClasses)}"
|
|
1734
|
+
aria-invalid="${o$1(this.validity && this.validity !== 'valid' ? 'true' : undefined)}"
|
|
1735
|
+
aria-describedby="${this.uniqueId}"
|
|
1736
|
+
>
|
|
1701
1737
|
<legend>
|
|
1702
1738
|
<slot name="legend"></slot>
|
|
1703
1739
|
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
@@ -1707,11 +1743,11 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1707
1743
|
|
|
1708
1744
|
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
1709
1745
|
? u`
|
|
1710
|
-
<${this.helpTextTag} part="helpText" appearance="${this.onDark ? 'inverse' : this.appearance}">
|
|
1746
|
+
<${this.helpTextTag} id="${this.uniqueId}" part="helpText" appearance="${this.onDark ? 'inverse' : this.appearance}">
|
|
1711
1747
|
<slot name="helpText"></slot>
|
|
1712
1748
|
</${this.helpTextTag}>`
|
|
1713
1749
|
: u`
|
|
1714
|
-
<${this.helpTextTag} error appearance="${this.onDark ? 'inverse' : this.appearance}"
|
|
1750
|
+
<${this.helpTextTag} id="${this.uniqueId}" error appearance="${this.onDark ? 'inverse' : this.appearance}" role="alert" aria-live="assertive" part="helpText">
|
|
1715
1751
|
${this.errorMessage}
|
|
1716
1752
|
</${this.helpTextTag}>`
|
|
1717
1753
|
}
|
|
@@ -141,6 +141,10 @@ export class AuroCheckboxGroup extends LitElement {
|
|
|
141
141
|
* @private
|
|
142
142
|
*/
|
|
143
143
|
private helpTextTag;
|
|
144
|
+
/**
|
|
145
|
+
* @private
|
|
146
|
+
*/
|
|
147
|
+
private uniqueId;
|
|
144
148
|
/**
|
|
145
149
|
* Helper method to handle checkbox value changing.
|
|
146
150
|
* @private
|
|
@@ -164,6 +168,15 @@ export class AuroCheckboxGroup extends LitElement {
|
|
|
164
168
|
*/
|
|
165
169
|
private handleItems;
|
|
166
170
|
checkboxes: Element[] | undefined;
|
|
171
|
+
/**
|
|
172
|
+
* Method for mirroring the group's invalid state onto each checkbox.
|
|
173
|
+
* `validity` is the authoritative invalid state, and it has to be re-applied from
|
|
174
|
+
* `handleItems()` as well, because a slot change can happen without `validity` itself
|
|
175
|
+
* changing — a checkbox slotted into an already-invalid group would otherwise be missed.
|
|
176
|
+
* @private
|
|
177
|
+
* @returns {void}
|
|
178
|
+
*/
|
|
179
|
+
private syncCheckboxValidity;
|
|
167
180
|
/**
|
|
168
181
|
* Resets component to initial state.
|
|
169
182
|
* @returns {void}
|
|
@@ -999,6 +999,22 @@ class AuroDependencyVersioning {
|
|
|
999
999
|
}
|
|
1000
1000
|
}
|
|
1001
1001
|
|
|
1002
|
+
/**
|
|
1003
|
+
* Class for generating unique hashes based on the current timestamp.
|
|
1004
|
+
* This can be used to create unique identifiers for elements or data within an application,
|
|
1005
|
+
* ensuring that each identifier is distinct and can be easily generated without the need
|
|
1006
|
+
* for external libraries or complex algorithms.
|
|
1007
|
+
*/
|
|
1008
|
+
class UniqueId {
|
|
1009
|
+
/**
|
|
1010
|
+
* Creates a unique hash based on the current timestamp.
|
|
1011
|
+
* @returns {Function} Timestamp as a base-36 string
|
|
1012
|
+
*/
|
|
1013
|
+
create() {
|
|
1014
|
+
return Date.now().toString(36);
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1002
1018
|
var styleCss$1 = css`:host{display:block;padding-bottom:var(--ds-size-150, 0.75rem)}.displayFlex legend+slot{display:flex;white-space:nowrap}fieldset{all:unset}legend{margin-bottom:var(--ds-size-150, 0.75rem)}[auro-helptext]{margin-top:var(--ds-size-150, 0.75rem)}`;
|
|
1003
1019
|
|
|
1004
1020
|
var colorCss$1 = css`:host{color:var(--ds-auro-checkbox-group-text-color)}:host([disabled]){--ds-auro-checkbox-group-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host([onDark]),:host([appearance=inverse]){--ds-auro-checkbox-group-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][disabled]),:host([appearance=inverse][disabled]){--ds-auro-checkbox-group-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}`;
|
|
@@ -1237,7 +1253,7 @@ class AuroHelpText extends LitElement {
|
|
|
1237
1253
|
}
|
|
1238
1254
|
}
|
|
1239
1255
|
|
|
1240
|
-
var formkitVersion = '
|
|
1256
|
+
var formkitVersion = '202609022217';
|
|
1241
1257
|
|
|
1242
1258
|
// Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
|
|
1243
1259
|
// See LICENSE in the project root for license information.
|
|
@@ -1314,6 +1330,11 @@ class AuroCheckboxGroup extends LitElement {
|
|
|
1314
1330
|
* @private
|
|
1315
1331
|
*/
|
|
1316
1332
|
this.helpTextTag = versioning.generateTag('auro-formkit-checkbox-helptext', formkitVersion, AuroHelpText);
|
|
1333
|
+
|
|
1334
|
+
/**
|
|
1335
|
+
* @private
|
|
1336
|
+
*/
|
|
1337
|
+
this.uniqueId = new UniqueId().create();
|
|
1317
1338
|
}
|
|
1318
1339
|
|
|
1319
1340
|
static get styles() {
|
|
@@ -1565,6 +1586,29 @@ class AuroCheckboxGroup extends LitElement {
|
|
|
1565
1586
|
this.handlePreselectedItems();
|
|
1566
1587
|
|
|
1567
1588
|
this.validate();
|
|
1589
|
+
this.syncCheckboxValidity();
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
/**
|
|
1593
|
+
* Method for mirroring the group's invalid state onto each checkbox.
|
|
1594
|
+
* `validity` is the authoritative invalid state, and it has to be re-applied from
|
|
1595
|
+
* `handleItems()` as well, because a slot change can happen without `validity` itself
|
|
1596
|
+
* changing — a checkbox slotted into an already-invalid group would otherwise be missed.
|
|
1597
|
+
* @private
|
|
1598
|
+
* @returns {void}
|
|
1599
|
+
*/
|
|
1600
|
+
syncCheckboxValidity() {
|
|
1601
|
+
const invalid = Boolean(this.validity && this.validity !== 'valid');
|
|
1602
|
+
|
|
1603
|
+
this.checkboxes.forEach((el) => {
|
|
1604
|
+
if (invalid) {
|
|
1605
|
+
el.setAttribute('error', true);
|
|
1606
|
+
el.setAttribute('aria-invalid', 'true');
|
|
1607
|
+
} else {
|
|
1608
|
+
el.removeAttribute('error');
|
|
1609
|
+
el.removeAttribute('aria-invalid');
|
|
1610
|
+
}
|
|
1611
|
+
});
|
|
1568
1612
|
}
|
|
1569
1613
|
|
|
1570
1614
|
/**
|
|
@@ -1596,13 +1640,7 @@ class AuroCheckboxGroup extends LitElement {
|
|
|
1596
1640
|
}
|
|
1597
1641
|
|
|
1598
1642
|
if (changedProperties.has('validity')) {
|
|
1599
|
-
this.
|
|
1600
|
-
if (this.validity && this.validity !== 'valid') {
|
|
1601
|
-
el.setAttribute('error', true);
|
|
1602
|
-
} else {
|
|
1603
|
-
el.removeAttribute('error');
|
|
1604
|
-
}
|
|
1605
|
-
});
|
|
1643
|
+
this.syncCheckboxValidity();
|
|
1606
1644
|
}
|
|
1607
1645
|
|
|
1608
1646
|
if (changedProperties.has('required')) {
|
|
@@ -1626,12 +1664,6 @@ class AuroCheckboxGroup extends LitElement {
|
|
|
1626
1664
|
}
|
|
1627
1665
|
|
|
1628
1666
|
if (changedProperties.has('error')) {
|
|
1629
|
-
if (this.error) {
|
|
1630
|
-
this.setAttribute('aria-invalid', true);
|
|
1631
|
-
} else {
|
|
1632
|
-
this.removeAttribute('aria-invalid');
|
|
1633
|
-
}
|
|
1634
|
-
|
|
1635
1667
|
this.validate(true);
|
|
1636
1668
|
}
|
|
1637
1669
|
}
|
|
@@ -1650,7 +1682,11 @@ class AuroCheckboxGroup extends LitElement {
|
|
|
1650
1682
|
};
|
|
1651
1683
|
|
|
1652
1684
|
return html$1`
|
|
1653
|
-
<fieldset
|
|
1685
|
+
<fieldset
|
|
1686
|
+
class="${classMap(groupClasses)}"
|
|
1687
|
+
aria-invalid="${ifDefined(this.validity && this.validity !== 'valid' ? 'true' : undefined)}"
|
|
1688
|
+
aria-describedby="${this.uniqueId}"
|
|
1689
|
+
>
|
|
1654
1690
|
<legend>
|
|
1655
1691
|
<slot name="legend"></slot>
|
|
1656
1692
|
${this.required ? undefined : html$1`<slot name="optionalLabel"> (optional)</slot>`}
|
|
@@ -1660,11 +1696,11 @@ class AuroCheckboxGroup extends LitElement {
|
|
|
1660
1696
|
|
|
1661
1697
|
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
1662
1698
|
? html$1`
|
|
1663
|
-
<${this.helpTextTag} part="helpText" appearance="${this.onDark ? 'inverse' : this.appearance}">
|
|
1699
|
+
<${this.helpTextTag} id="${this.uniqueId}" part="helpText" appearance="${this.onDark ? 'inverse' : this.appearance}">
|
|
1664
1700
|
<slot name="helpText"></slot>
|
|
1665
1701
|
</${this.helpTextTag}>`
|
|
1666
1702
|
: html$1`
|
|
1667
|
-
<${this.helpTextTag} error appearance="${this.onDark ? 'inverse' : this.appearance}"
|
|
1703
|
+
<${this.helpTextTag} id="${this.uniqueId}" error appearance="${this.onDark ? 'inverse' : this.appearance}" role="alert" aria-live="assertive" part="helpText">
|
|
1668
1704
|
${this.errorMessage}
|
|
1669
1705
|
</${this.helpTextTag}>`
|
|
1670
1706
|
}
|