@aurodesignsystem-dev/auro-formkit 0.0.0-pr1608.6 → 0.0.0-pr1610.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.
- package/components/checkbox/demo/accessibility.md +4 -15
- package/components/checkbox/demo/api.md +3 -4
- package/components/checkbox/demo/customize.md +1 -2
- package/components/checkbox/demo/customize.min.js +18 -74
- package/components/checkbox/demo/getting-started.min.js +18 -74
- package/components/checkbox/demo/index.min.js +18 -74
- package/components/checkbox/dist/auro-checkbox-group.d.ts +0 -24
- package/components/checkbox/dist/index.js +18 -74
- package/components/checkbox/dist/registered.js +18 -74
- 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 +3 -3
- package/components/datepicker/demo/getting-started.min.js +3 -3
- package/components/datepicker/demo/index.min.js +3 -3
- package/components/datepicker/dist/index.js +3 -3
- package/components/datepicker/dist/registered.js +3 -3
- 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 +50 -156
- package/components/form/demo/getting-started.min.js +50 -156
- package/components/form/demo/index.min.js +50 -156
- package/components/form/demo/registerDemoDeps.min.js +50 -156
- 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 +4 -15
- package/components/radio/demo/customize.min.js +17 -67
- package/components/radio/demo/getting-started.min.js +17 -67
- package/components/radio/demo/index.min.js +17 -67
- package/components/radio/dist/auro-radio-group.d.ts +0 -22
- package/components/radio/dist/index.js +17 -67
- package/components/radio/dist/registered.js +17 -67
- 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 +566 -616
- package/package.json +1 -1
|
@@ -8,13 +8,12 @@ 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:
|
|
12
12
|
|
|
13
13
|
| Attribute | Value | Description |
|
|
14
14
|
|---|---|---|
|
|
15
|
-
| `role` | `group` (implicit via `fieldset`) | Groups related checkboxes together.
|
|
16
|
-
| `aria-invalid` | `true` |
|
|
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. |
|
|
15
|
+
| `role` | `group` (implicit via `fieldset`) | Groups related checkboxes together. |
|
|
16
|
+
| `aria-invalid` | `true` / `false` | Reflects whether the group is currently in an invalid state. |
|
|
18
17
|
|
|
19
18
|
<auro-header level="3" id="checkboxElement">Checkbox</auro-header>
|
|
20
19
|
Each `<auro-checkbox>` renders a native `<input type="checkbox">` inside its shadow DOM:
|
|
@@ -24,22 +23,12 @@ Each `<auro-checkbox>` renders a native `<input type="checkbox">` inside its sha
|
|
|
24
23
|
| `type` | `checkbox` | Native checkbox input type. |
|
|
25
24
|
| `aria-checked` | `true` / `false` | Reflects the checked state of the checkbox. |
|
|
26
25
|
| `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]`; target the `part="checkbox-group"` fieldset or read the `validity` property instead.
|
|
36
26
|
|
|
37
27
|
<auro-header level="2" id="screenReaderAnnouncements">Screen Reader Announcements</auro-header>
|
|
38
28
|
- **Focus** — When focus moves to a checkbox, the screen reader announces the checkbox label, its checked/unchecked state, and role ("checkbox").
|
|
39
29
|
- **State change** — Toggling the checkbox announces the new state ("checked" or "unchecked").
|
|
40
30
|
- **Group context** — The legend text provides group context when navigating between groups.
|
|
41
|
-
- **Error** — When validation fails, the error message is announced
|
|
42
|
-
- **Invalid state** — While the group is invalid, entering it or moving between its checkboxes conveys the invalid state.
|
|
31
|
+
- **Error** — When validation fails, the error message is announced to screen reader users.
|
|
43
32
|
|
|
44
33
|
<auro-header level="2" id="accessibleLabels">Accessible Labels</auro-header>
|
|
45
34
|
- The `legend` slot content provides the accessible group label via the native `<legend>` element.
|
|
@@ -46,10 +46,9 @@ The `auro-checkbox-group` element is a wrapper for `auro-checkbox` elements..
|
|
|
46
46
|
|
|
47
47
|
## CSS Shadow Parts
|
|
48
48
|
|
|
49
|
-
| Part
|
|
50
|
-
|
|
51
|
-
| `
|
|
52
|
-
| `helpText` | Apply css to the help text element that displays helper or error messages. |
|
|
49
|
+
| Part | Description |
|
|
50
|
+
|------------|--------------------------------------------------|
|
|
51
|
+
| `helpText` | Apply css to the help text element that displays helper or error messages. |
|
|
53
52
|
|
|
54
53
|
# auro-checkbox
|
|
55
54
|
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
<auro-header level="3" id="cssParts">CSS Shadow Parts</auro-header>
|
|
161
161
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/customize/css-parts.md) -->
|
|
162
162
|
<!-- The below content is automatically added from ./../docs/partials/customize/css-parts.md -->
|
|
163
|
-
<p>CSS Shadow Parts allow you to style elements inside a web component's shadow DOM using the <code>::part()</code> pseudo-element. The following parts are exposed by <code><auro-checkbox
|
|
163
|
+
<p>CSS Shadow Parts allow you to style elements inside a web component's shadow DOM using the <code>::part()</code> pseudo-element. The following parts are exposed by <code><auro-checkbox></code>.</p>
|
|
164
164
|
<table class="auro_table">
|
|
165
165
|
<thead>
|
|
166
166
|
<tr>
|
|
@@ -169,7 +169,6 @@
|
|
|
169
169
|
</tr>
|
|
170
170
|
</thead>
|
|
171
171
|
<tbody>
|
|
172
|
-
<tr><td><code>checkbox-group</code></td><td>The fieldset element in the <code><auro-checkbox-group></code> shadow DOM. Use this to style the group container, and to query the element that carries the group's <code>aria-invalid</code> state.</td></tr>
|
|
173
172
|
<tr><td><code>checkbox</code></td><td>The checkbox container element.</td></tr>
|
|
174
173
|
<tr><td><code>checkbox-input</code></td><td>The checkbox input element.</td></tr>
|
|
175
174
|
<tr><td><code>checkbox-label</code></td><td>The checkbox label element.</td></tr>
|
|
@@ -1046,22 +1046,6 @@ 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
|
-
|
|
1065
1049
|
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)}`;
|
|
1066
1050
|
|
|
1067
1051
|
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)}`;
|
|
@@ -1300,7 +1284,7 @@ class AuroHelpText extends i$2 {
|
|
|
1300
1284
|
}
|
|
1301
1285
|
}
|
|
1302
1286
|
|
|
1303
|
-
var formkitVersion = '
|
|
1287
|
+
var formkitVersion = '202609042059';
|
|
1304
1288
|
|
|
1305
1289
|
// Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
|
|
1306
1290
|
// See LICENSE in the project root for license information.
|
|
@@ -1310,7 +1294,6 @@ var formkitVersion = '202609031742';
|
|
|
1310
1294
|
* The `auro-checkbox-group` element is a wrapper for `auro-checkbox` elements.
|
|
1311
1295
|
* @customElement auro-checkbox-group
|
|
1312
1296
|
*
|
|
1313
|
-
* @csspart checkbox-group - Apply css to the fieldset element in the shadow DOM
|
|
1314
1297
|
* @csspart helpText - Apply css to the help text element that displays helper or error messages.
|
|
1315
1298
|
*
|
|
1316
1299
|
* @slot legend - Allows for the legend to be overridden.
|
|
@@ -1378,11 +1361,6 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1378
1361
|
* @private
|
|
1379
1362
|
*/
|
|
1380
1363
|
this.helpTextTag = versioning.generateTag('auro-formkit-checkbox-helptext', formkitVersion, AuroHelpText);
|
|
1381
|
-
|
|
1382
|
-
/**
|
|
1383
|
-
* @private
|
|
1384
|
-
*/
|
|
1385
|
-
this.uniqueId = new UniqueId().create();
|
|
1386
1364
|
}
|
|
1387
1365
|
|
|
1388
1366
|
static get styles() {
|
|
@@ -1634,47 +1612,6 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1634
1612
|
this.handlePreselectedItems();
|
|
1635
1613
|
|
|
1636
1614
|
this.validate();
|
|
1637
|
-
this.syncCheckboxValidity();
|
|
1638
|
-
}
|
|
1639
|
-
|
|
1640
|
-
/**
|
|
1641
|
-
* Whether the group is currently in an invalid state.
|
|
1642
|
-
* `validity` — not `error` — is the authoritative source: `validate()` resolves the
|
|
1643
|
-
* `error` attribute to `validity = 'customError'`, so `error` is already covered here.
|
|
1644
|
-
* Single definition of "invalid" for the whole component, consumed by `render()` and
|
|
1645
|
-
* `syncCheckboxValidity()` so the fieldset and its children can never disagree.
|
|
1646
|
-
* @private
|
|
1647
|
-
* @returns {boolean}
|
|
1648
|
-
*/
|
|
1649
|
-
get isInvalid() {
|
|
1650
|
-
return Boolean(this.validity && this.validity !== 'valid');
|
|
1651
|
-
}
|
|
1652
|
-
|
|
1653
|
-
/**
|
|
1654
|
-
* Method for mirroring the group's invalid state onto each checkbox.
|
|
1655
|
-
* Has to be re-applied from `handleItems()` as well, because a slot change can happen
|
|
1656
|
-
* without `validity` itself changing — a checkbox slotted into an already-invalid
|
|
1657
|
-
* group would otherwise be missed.
|
|
1658
|
-
* @private
|
|
1659
|
-
* @returns {void}
|
|
1660
|
-
*/
|
|
1661
|
-
syncCheckboxValidity() {
|
|
1662
|
-
const invalid = this.isInvalid;
|
|
1663
|
-
|
|
1664
|
-
this.checkboxes.forEach((el) => {
|
|
1665
|
-
if (invalid) {
|
|
1666
|
-
el.setAttribute('error', true);
|
|
1667
|
-
el.setAttribute('aria-invalid', 'true');
|
|
1668
|
-
} else {
|
|
1669
|
-
// Group state is authoritative: an `error` set directly on an individual
|
|
1670
|
-
// checkbox by a consumer is cleared here, and because this method also runs
|
|
1671
|
-
// from `handleItems()` that now happens on every slot change, not just on a
|
|
1672
|
-
// validity change. Matches auro-radio-group. See docs/post-mortem/1636704.md,
|
|
1673
|
-
// "Breaking Change Assessment", for why this is not treated as a breaker.
|
|
1674
|
-
el.removeAttribute('error');
|
|
1675
|
-
el.removeAttribute('aria-invalid');
|
|
1676
|
-
}
|
|
1677
|
-
});
|
|
1678
1615
|
}
|
|
1679
1616
|
|
|
1680
1617
|
/**
|
|
@@ -1706,7 +1643,13 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1706
1643
|
}
|
|
1707
1644
|
|
|
1708
1645
|
if (changedProperties.has('validity')) {
|
|
1709
|
-
this.
|
|
1646
|
+
this.checkboxes.forEach((el) => {
|
|
1647
|
+
if (this.validity && this.validity !== 'valid') {
|
|
1648
|
+
el.setAttribute('error', true);
|
|
1649
|
+
} else {
|
|
1650
|
+
el.removeAttribute('error');
|
|
1651
|
+
}
|
|
1652
|
+
});
|
|
1710
1653
|
}
|
|
1711
1654
|
|
|
1712
1655
|
if (changedProperties.has('required')) {
|
|
@@ -1730,6 +1673,12 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1730
1673
|
}
|
|
1731
1674
|
|
|
1732
1675
|
if (changedProperties.has('error')) {
|
|
1676
|
+
if (this.error) {
|
|
1677
|
+
this.setAttribute('aria-invalid', true);
|
|
1678
|
+
} else {
|
|
1679
|
+
this.removeAttribute('aria-invalid');
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1733
1682
|
this.validate(true);
|
|
1734
1683
|
}
|
|
1735
1684
|
}
|
|
@@ -1748,12 +1697,7 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1748
1697
|
};
|
|
1749
1698
|
|
|
1750
1699
|
return u`
|
|
1751
|
-
<fieldset
|
|
1752
|
-
class="${e(groupClasses)}"
|
|
1753
|
-
part="checkbox-group"
|
|
1754
|
-
aria-invalid="${o$1(this.isInvalid ? 'true' : undefined)}"
|
|
1755
|
-
aria-describedby="${this.uniqueId}"
|
|
1756
|
-
>
|
|
1700
|
+
<fieldset class="${e(groupClasses)}">
|
|
1757
1701
|
<legend>
|
|
1758
1702
|
<slot name="legend"></slot>
|
|
1759
1703
|
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
@@ -1761,13 +1705,13 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1761
1705
|
<slot @slotchange=${this.handleItems}></slot>
|
|
1762
1706
|
</fieldset>
|
|
1763
1707
|
|
|
1764
|
-
${!this.
|
|
1708
|
+
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
1765
1709
|
? u`
|
|
1766
|
-
<${this.helpTextTag}
|
|
1710
|
+
<${this.helpTextTag} part="helpText" appearance="${this.onDark ? 'inverse' : this.appearance}">
|
|
1767
1711
|
<slot name="helpText"></slot>
|
|
1768
1712
|
</${this.helpTextTag}>`
|
|
1769
1713
|
: u`
|
|
1770
|
-
<${this.helpTextTag}
|
|
1714
|
+
<${this.helpTextTag} error appearance="${this.onDark ? 'inverse' : this.appearance}"" role="alert" aria-live="assertive" part="helpText">
|
|
1771
1715
|
${this.errorMessage}
|
|
1772
1716
|
</${this.helpTextTag}>`
|
|
1773
1717
|
}
|
|
@@ -1046,22 +1046,6 @@ 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
|
-
|
|
1065
1049
|
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)}`;
|
|
1066
1050
|
|
|
1067
1051
|
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)}`;
|
|
@@ -1300,7 +1284,7 @@ class AuroHelpText extends i$2 {
|
|
|
1300
1284
|
}
|
|
1301
1285
|
}
|
|
1302
1286
|
|
|
1303
|
-
var formkitVersion = '
|
|
1287
|
+
var formkitVersion = '202609042059';
|
|
1304
1288
|
|
|
1305
1289
|
// Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
|
|
1306
1290
|
// See LICENSE in the project root for license information.
|
|
@@ -1310,7 +1294,6 @@ var formkitVersion = '202609031742';
|
|
|
1310
1294
|
* The `auro-checkbox-group` element is a wrapper for `auro-checkbox` elements.
|
|
1311
1295
|
* @customElement auro-checkbox-group
|
|
1312
1296
|
*
|
|
1313
|
-
* @csspart checkbox-group - Apply css to the fieldset element in the shadow DOM
|
|
1314
1297
|
* @csspart helpText - Apply css to the help text element that displays helper or error messages.
|
|
1315
1298
|
*
|
|
1316
1299
|
* @slot legend - Allows for the legend to be overridden.
|
|
@@ -1378,11 +1361,6 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1378
1361
|
* @private
|
|
1379
1362
|
*/
|
|
1380
1363
|
this.helpTextTag = versioning.generateTag('auro-formkit-checkbox-helptext', formkitVersion, AuroHelpText);
|
|
1381
|
-
|
|
1382
|
-
/**
|
|
1383
|
-
* @private
|
|
1384
|
-
*/
|
|
1385
|
-
this.uniqueId = new UniqueId().create();
|
|
1386
1364
|
}
|
|
1387
1365
|
|
|
1388
1366
|
static get styles() {
|
|
@@ -1634,47 +1612,6 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1634
1612
|
this.handlePreselectedItems();
|
|
1635
1613
|
|
|
1636
1614
|
this.validate();
|
|
1637
|
-
this.syncCheckboxValidity();
|
|
1638
|
-
}
|
|
1639
|
-
|
|
1640
|
-
/**
|
|
1641
|
-
* Whether the group is currently in an invalid state.
|
|
1642
|
-
* `validity` — not `error` — is the authoritative source: `validate()` resolves the
|
|
1643
|
-
* `error` attribute to `validity = 'customError'`, so `error` is already covered here.
|
|
1644
|
-
* Single definition of "invalid" for the whole component, consumed by `render()` and
|
|
1645
|
-
* `syncCheckboxValidity()` so the fieldset and its children can never disagree.
|
|
1646
|
-
* @private
|
|
1647
|
-
* @returns {boolean}
|
|
1648
|
-
*/
|
|
1649
|
-
get isInvalid() {
|
|
1650
|
-
return Boolean(this.validity && this.validity !== 'valid');
|
|
1651
|
-
}
|
|
1652
|
-
|
|
1653
|
-
/**
|
|
1654
|
-
* Method for mirroring the group's invalid state onto each checkbox.
|
|
1655
|
-
* Has to be re-applied from `handleItems()` as well, because a slot change can happen
|
|
1656
|
-
* without `validity` itself changing — a checkbox slotted into an already-invalid
|
|
1657
|
-
* group would otherwise be missed.
|
|
1658
|
-
* @private
|
|
1659
|
-
* @returns {void}
|
|
1660
|
-
*/
|
|
1661
|
-
syncCheckboxValidity() {
|
|
1662
|
-
const invalid = this.isInvalid;
|
|
1663
|
-
|
|
1664
|
-
this.checkboxes.forEach((el) => {
|
|
1665
|
-
if (invalid) {
|
|
1666
|
-
el.setAttribute('error', true);
|
|
1667
|
-
el.setAttribute('aria-invalid', 'true');
|
|
1668
|
-
} else {
|
|
1669
|
-
// Group state is authoritative: an `error` set directly on an individual
|
|
1670
|
-
// checkbox by a consumer is cleared here, and because this method also runs
|
|
1671
|
-
// from `handleItems()` that now happens on every slot change, not just on a
|
|
1672
|
-
// validity change. Matches auro-radio-group. See docs/post-mortem/1636704.md,
|
|
1673
|
-
// "Breaking Change Assessment", for why this is not treated as a breaker.
|
|
1674
|
-
el.removeAttribute('error');
|
|
1675
|
-
el.removeAttribute('aria-invalid');
|
|
1676
|
-
}
|
|
1677
|
-
});
|
|
1678
1615
|
}
|
|
1679
1616
|
|
|
1680
1617
|
/**
|
|
@@ -1706,7 +1643,13 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1706
1643
|
}
|
|
1707
1644
|
|
|
1708
1645
|
if (changedProperties.has('validity')) {
|
|
1709
|
-
this.
|
|
1646
|
+
this.checkboxes.forEach((el) => {
|
|
1647
|
+
if (this.validity && this.validity !== 'valid') {
|
|
1648
|
+
el.setAttribute('error', true);
|
|
1649
|
+
} else {
|
|
1650
|
+
el.removeAttribute('error');
|
|
1651
|
+
}
|
|
1652
|
+
});
|
|
1710
1653
|
}
|
|
1711
1654
|
|
|
1712
1655
|
if (changedProperties.has('required')) {
|
|
@@ -1730,6 +1673,12 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1730
1673
|
}
|
|
1731
1674
|
|
|
1732
1675
|
if (changedProperties.has('error')) {
|
|
1676
|
+
if (this.error) {
|
|
1677
|
+
this.setAttribute('aria-invalid', true);
|
|
1678
|
+
} else {
|
|
1679
|
+
this.removeAttribute('aria-invalid');
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1733
1682
|
this.validate(true);
|
|
1734
1683
|
}
|
|
1735
1684
|
}
|
|
@@ -1748,12 +1697,7 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1748
1697
|
};
|
|
1749
1698
|
|
|
1750
1699
|
return u`
|
|
1751
|
-
<fieldset
|
|
1752
|
-
class="${e(groupClasses)}"
|
|
1753
|
-
part="checkbox-group"
|
|
1754
|
-
aria-invalid="${o$1(this.isInvalid ? 'true' : undefined)}"
|
|
1755
|
-
aria-describedby="${this.uniqueId}"
|
|
1756
|
-
>
|
|
1700
|
+
<fieldset class="${e(groupClasses)}">
|
|
1757
1701
|
<legend>
|
|
1758
1702
|
<slot name="legend"></slot>
|
|
1759
1703
|
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
@@ -1761,13 +1705,13 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1761
1705
|
<slot @slotchange=${this.handleItems}></slot>
|
|
1762
1706
|
</fieldset>
|
|
1763
1707
|
|
|
1764
|
-
${!this.
|
|
1708
|
+
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
1765
1709
|
? u`
|
|
1766
|
-
<${this.helpTextTag}
|
|
1710
|
+
<${this.helpTextTag} part="helpText" appearance="${this.onDark ? 'inverse' : this.appearance}">
|
|
1767
1711
|
<slot name="helpText"></slot>
|
|
1768
1712
|
</${this.helpTextTag}>`
|
|
1769
1713
|
: u`
|
|
1770
|
-
<${this.helpTextTag}
|
|
1714
|
+
<${this.helpTextTag} error appearance="${this.onDark ? 'inverse' : this.appearance}"" role="alert" aria-live="assertive" part="helpText">
|
|
1771
1715
|
${this.errorMessage}
|
|
1772
1716
|
</${this.helpTextTag}>`
|
|
1773
1717
|
}
|
|
@@ -1046,22 +1046,6 @@ 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
|
-
|
|
1065
1049
|
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)}`;
|
|
1066
1050
|
|
|
1067
1051
|
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)}`;
|
|
@@ -1300,7 +1284,7 @@ class AuroHelpText extends i$2 {
|
|
|
1300
1284
|
}
|
|
1301
1285
|
}
|
|
1302
1286
|
|
|
1303
|
-
var formkitVersion = '
|
|
1287
|
+
var formkitVersion = '202609042059';
|
|
1304
1288
|
|
|
1305
1289
|
// Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
|
|
1306
1290
|
// See LICENSE in the project root for license information.
|
|
@@ -1310,7 +1294,6 @@ var formkitVersion = '202609031742';
|
|
|
1310
1294
|
* The `auro-checkbox-group` element is a wrapper for `auro-checkbox` elements.
|
|
1311
1295
|
* @customElement auro-checkbox-group
|
|
1312
1296
|
*
|
|
1313
|
-
* @csspart checkbox-group - Apply css to the fieldset element in the shadow DOM
|
|
1314
1297
|
* @csspart helpText - Apply css to the help text element that displays helper or error messages.
|
|
1315
1298
|
*
|
|
1316
1299
|
* @slot legend - Allows for the legend to be overridden.
|
|
@@ -1378,11 +1361,6 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1378
1361
|
* @private
|
|
1379
1362
|
*/
|
|
1380
1363
|
this.helpTextTag = versioning.generateTag('auro-formkit-checkbox-helptext', formkitVersion, AuroHelpText);
|
|
1381
|
-
|
|
1382
|
-
/**
|
|
1383
|
-
* @private
|
|
1384
|
-
*/
|
|
1385
|
-
this.uniqueId = new UniqueId().create();
|
|
1386
1364
|
}
|
|
1387
1365
|
|
|
1388
1366
|
static get styles() {
|
|
@@ -1634,47 +1612,6 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1634
1612
|
this.handlePreselectedItems();
|
|
1635
1613
|
|
|
1636
1614
|
this.validate();
|
|
1637
|
-
this.syncCheckboxValidity();
|
|
1638
|
-
}
|
|
1639
|
-
|
|
1640
|
-
/**
|
|
1641
|
-
* Whether the group is currently in an invalid state.
|
|
1642
|
-
* `validity` — not `error` — is the authoritative source: `validate()` resolves the
|
|
1643
|
-
* `error` attribute to `validity = 'customError'`, so `error` is already covered here.
|
|
1644
|
-
* Single definition of "invalid" for the whole component, consumed by `render()` and
|
|
1645
|
-
* `syncCheckboxValidity()` so the fieldset and its children can never disagree.
|
|
1646
|
-
* @private
|
|
1647
|
-
* @returns {boolean}
|
|
1648
|
-
*/
|
|
1649
|
-
get isInvalid() {
|
|
1650
|
-
return Boolean(this.validity && this.validity !== 'valid');
|
|
1651
|
-
}
|
|
1652
|
-
|
|
1653
|
-
/**
|
|
1654
|
-
* Method for mirroring the group's invalid state onto each checkbox.
|
|
1655
|
-
* Has to be re-applied from `handleItems()` as well, because a slot change can happen
|
|
1656
|
-
* without `validity` itself changing — a checkbox slotted into an already-invalid
|
|
1657
|
-
* group would otherwise be missed.
|
|
1658
|
-
* @private
|
|
1659
|
-
* @returns {void}
|
|
1660
|
-
*/
|
|
1661
|
-
syncCheckboxValidity() {
|
|
1662
|
-
const invalid = this.isInvalid;
|
|
1663
|
-
|
|
1664
|
-
this.checkboxes.forEach((el) => {
|
|
1665
|
-
if (invalid) {
|
|
1666
|
-
el.setAttribute('error', true);
|
|
1667
|
-
el.setAttribute('aria-invalid', 'true');
|
|
1668
|
-
} else {
|
|
1669
|
-
// Group state is authoritative: an `error` set directly on an individual
|
|
1670
|
-
// checkbox by a consumer is cleared here, and because this method also runs
|
|
1671
|
-
// from `handleItems()` that now happens on every slot change, not just on a
|
|
1672
|
-
// validity change. Matches auro-radio-group. See docs/post-mortem/1636704.md,
|
|
1673
|
-
// "Breaking Change Assessment", for why this is not treated as a breaker.
|
|
1674
|
-
el.removeAttribute('error');
|
|
1675
|
-
el.removeAttribute('aria-invalid');
|
|
1676
|
-
}
|
|
1677
|
-
});
|
|
1678
1615
|
}
|
|
1679
1616
|
|
|
1680
1617
|
/**
|
|
@@ -1706,7 +1643,13 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1706
1643
|
}
|
|
1707
1644
|
|
|
1708
1645
|
if (changedProperties.has('validity')) {
|
|
1709
|
-
this.
|
|
1646
|
+
this.checkboxes.forEach((el) => {
|
|
1647
|
+
if (this.validity && this.validity !== 'valid') {
|
|
1648
|
+
el.setAttribute('error', true);
|
|
1649
|
+
} else {
|
|
1650
|
+
el.removeAttribute('error');
|
|
1651
|
+
}
|
|
1652
|
+
});
|
|
1710
1653
|
}
|
|
1711
1654
|
|
|
1712
1655
|
if (changedProperties.has('required')) {
|
|
@@ -1730,6 +1673,12 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1730
1673
|
}
|
|
1731
1674
|
|
|
1732
1675
|
if (changedProperties.has('error')) {
|
|
1676
|
+
if (this.error) {
|
|
1677
|
+
this.setAttribute('aria-invalid', true);
|
|
1678
|
+
} else {
|
|
1679
|
+
this.removeAttribute('aria-invalid');
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1733
1682
|
this.validate(true);
|
|
1734
1683
|
}
|
|
1735
1684
|
}
|
|
@@ -1748,12 +1697,7 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1748
1697
|
};
|
|
1749
1698
|
|
|
1750
1699
|
return u`
|
|
1751
|
-
<fieldset
|
|
1752
|
-
class="${e(groupClasses)}"
|
|
1753
|
-
part="checkbox-group"
|
|
1754
|
-
aria-invalid="${o$1(this.isInvalid ? 'true' : undefined)}"
|
|
1755
|
-
aria-describedby="${this.uniqueId}"
|
|
1756
|
-
>
|
|
1700
|
+
<fieldset class="${e(groupClasses)}">
|
|
1757
1701
|
<legend>
|
|
1758
1702
|
<slot name="legend"></slot>
|
|
1759
1703
|
${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
|
|
@@ -1761,13 +1705,13 @@ class AuroCheckboxGroup extends i$2 {
|
|
|
1761
1705
|
<slot @slotchange=${this.handleItems}></slot>
|
|
1762
1706
|
</fieldset>
|
|
1763
1707
|
|
|
1764
|
-
${!this.
|
|
1708
|
+
${!this.validity || this.validity === undefined || this.validity === 'valid'
|
|
1765
1709
|
? u`
|
|
1766
|
-
<${this.helpTextTag}
|
|
1710
|
+
<${this.helpTextTag} part="helpText" appearance="${this.onDark ? 'inverse' : this.appearance}">
|
|
1767
1711
|
<slot name="helpText"></slot>
|
|
1768
1712
|
</${this.helpTextTag}>`
|
|
1769
1713
|
: u`
|
|
1770
|
-
<${this.helpTextTag}
|
|
1714
|
+
<${this.helpTextTag} error appearance="${this.onDark ? 'inverse' : this.appearance}"" role="alert" aria-live="assertive" part="helpText">
|
|
1771
1715
|
${this.errorMessage}
|
|
1772
1716
|
</${this.helpTextTag}>`
|
|
1773
1717
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* The `auro-checkbox-group` element is a wrapper for `auro-checkbox` elements.
|
|
3
3
|
* @customElement auro-checkbox-group
|
|
4
4
|
*
|
|
5
|
-
* @csspart checkbox-group - Apply css to the fieldset element in the shadow DOM
|
|
6
5
|
* @csspart helpText - Apply css to the help text element that displays helper or error messages.
|
|
7
6
|
*
|
|
8
7
|
* @slot legend - Allows for the legend to be overridden.
|
|
@@ -142,10 +141,6 @@ export class AuroCheckboxGroup extends LitElement {
|
|
|
142
141
|
* @private
|
|
143
142
|
*/
|
|
144
143
|
private helpTextTag;
|
|
145
|
-
/**
|
|
146
|
-
* @private
|
|
147
|
-
*/
|
|
148
|
-
private uniqueId;
|
|
149
144
|
/**
|
|
150
145
|
* Helper method to handle checkbox value changing.
|
|
151
146
|
* @private
|
|
@@ -169,25 +164,6 @@ export class AuroCheckboxGroup extends LitElement {
|
|
|
169
164
|
*/
|
|
170
165
|
private handleItems;
|
|
171
166
|
checkboxes: Element[] | undefined;
|
|
172
|
-
/**
|
|
173
|
-
* Whether the group is currently in an invalid state.
|
|
174
|
-
* `validity` — not `error` — is the authoritative source: `validate()` resolves the
|
|
175
|
-
* `error` attribute to `validity = 'customError'`, so `error` is already covered here.
|
|
176
|
-
* Single definition of "invalid" for the whole component, consumed by `render()` and
|
|
177
|
-
* `syncCheckboxValidity()` so the fieldset and its children can never disagree.
|
|
178
|
-
* @private
|
|
179
|
-
* @returns {boolean}
|
|
180
|
-
*/
|
|
181
|
-
private get isInvalid();
|
|
182
|
-
/**
|
|
183
|
-
* Method for mirroring the group's invalid state onto each checkbox.
|
|
184
|
-
* Has to be re-applied from `handleItems()` as well, because a slot change can happen
|
|
185
|
-
* without `validity` itself changing — a checkbox slotted into an already-invalid
|
|
186
|
-
* group would otherwise be missed.
|
|
187
|
-
* @private
|
|
188
|
-
* @returns {void}
|
|
189
|
-
*/
|
|
190
|
-
private syncCheckboxValidity;
|
|
191
167
|
/**
|
|
192
168
|
* Resets component to initial state.
|
|
193
169
|
* @returns {void}
|