@aurodesignsystem-dev/auro-formkit 0.0.0-pr681.1 → 0.0.0-pr684.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/bibtemplate/dist/auro-bibtemplate.d.ts +12 -2
- package/components/bibtemplate/dist/buttonVersion.d.ts +2 -0
- package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
- package/components/bibtemplate/dist/index.js +1026 -12
- package/components/bibtemplate/dist/registered.js +1026 -12
- package/components/combobox/demo/api.min.js +1830 -478
- package/components/combobox/demo/index.min.js +1830 -478
- package/components/combobox/dist/index.js +1703 -355
- package/components/combobox/dist/registered.js +1703 -355
- package/components/counter/demo/api.min.js +1813 -466
- package/components/counter/demo/index.min.js +1813 -466
- package/components/counter/dist/auro-counter-button.d.ts +2 -0
- package/components/counter/dist/iconVersion.d.ts +1 -1
- package/components/counter/dist/index.js +1813 -466
- package/components/counter/dist/registered.js +1813 -466
- package/components/datepicker/demo/api.min.js +2319 -643
- package/components/datepicker/demo/index.min.js +2319 -643
- package/components/datepicker/dist/index.js +2319 -643
- package/components/datepicker/dist/registered.js +2319 -643
- package/components/dropdown/demo/api.min.js +6 -2
- package/components/dropdown/demo/index.min.js +6 -2
- package/components/dropdown/dist/index.js +6 -2
- package/components/dropdown/dist/registered.js +6 -2
- package/components/input/demo/api.min.js +565 -235
- package/components/input/demo/index.min.js +565 -235
- package/components/input/dist/index.js +565 -235
- package/components/input/dist/registered.js +565 -235
- package/components/menu/demo/api.min.js +7 -3
- package/components/menu/demo/index.min.js +7 -3
- package/components/menu/dist/iconVersion.d.ts +1 -1
- package/components/menu/dist/index.js +7 -3
- package/components/menu/dist/registered.js +7 -3
- package/components/select/demo/api.min.js +1166 -144
- package/components/select/demo/index.min.js +1166 -144
- package/components/select/dist/index.js +1159 -141
- package/components/select/dist/registered.js +1159 -141
- package/package.json +1 -1
|
@@ -236,6 +236,8 @@ const stringsES = {
|
|
|
236
236
|
'dateMM': 'Ingrese una fecha completa en el formato MM',
|
|
237
237
|
'dateDD': 'Ingrese una fecha completa en el formato DD',
|
|
238
238
|
'clearInput': 'Borrar campo de entrada',
|
|
239
|
+
'showPassword': 'Mostrar contraseña',
|
|
240
|
+
'hidePassword': 'Ocultar contraseña'
|
|
239
241
|
};
|
|
240
242
|
|
|
241
243
|
const stringsEN = {
|
|
@@ -260,6 +262,8 @@ const stringsEN = {
|
|
|
260
262
|
'dateMM': 'Please enter a complete date in the format MM',
|
|
261
263
|
'dateDD': 'Please enter a complete date in the format DD',
|
|
262
264
|
'clearInput': 'Clear input field',
|
|
265
|
+
'showPassword': 'Show password',
|
|
266
|
+
'hidePassword': 'Hide password'
|
|
263
267
|
};
|
|
264
268
|
|
|
265
269
|
/**
|
|
@@ -4554,7 +4558,7 @@ const {
|
|
|
4554
4558
|
|
|
4555
4559
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
4556
4560
|
|
|
4557
|
-
let AuroLibraryRuntimeUtils$
|
|
4561
|
+
let AuroLibraryRuntimeUtils$3 = class AuroLibraryRuntimeUtils {
|
|
4558
4562
|
|
|
4559
4563
|
/* eslint-disable jsdoc/require-param */
|
|
4560
4564
|
|
|
@@ -4624,7 +4628,7 @@ let AuroLibraryRuntimeUtils$4 = class AuroLibraryRuntimeUtils {
|
|
|
4624
4628
|
class AuroFormValidation {
|
|
4625
4629
|
|
|
4626
4630
|
constructor() {
|
|
4627
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
4631
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$3();
|
|
4628
4632
|
}
|
|
4629
4633
|
|
|
4630
4634
|
/**
|
|
@@ -4985,7 +4989,7 @@ class AuroFormValidation {
|
|
|
4985
4989
|
}
|
|
4986
4990
|
}
|
|
4987
4991
|
|
|
4988
|
-
let AuroElement$
|
|
4992
|
+
let AuroElement$2 = class AuroElement extends i$2 {
|
|
4989
4993
|
static get properties() {
|
|
4990
4994
|
return {
|
|
4991
4995
|
|
|
@@ -5105,7 +5109,7 @@ let AuroElement$1 = class AuroElement extends i$2 {
|
|
|
5105
5109
|
* @event auroFormElement-validated - Notifies that the `validity` and `errorMessage` value has changed.
|
|
5106
5110
|
*/
|
|
5107
5111
|
|
|
5108
|
-
class BaseInput extends AuroElement$
|
|
5112
|
+
class BaseInput extends AuroElement$2 {
|
|
5109
5113
|
|
|
5110
5114
|
constructor() {
|
|
5111
5115
|
super();
|
|
@@ -6168,7 +6172,7 @@ class BaseInput extends AuroElement$1 {
|
|
|
6168
6172
|
// See LICENSE in the project root for license information.
|
|
6169
6173
|
|
|
6170
6174
|
|
|
6171
|
-
|
|
6175
|
+
class AuroDependencyVersioning {
|
|
6172
6176
|
|
|
6173
6177
|
/**
|
|
6174
6178
|
* Generates a unique string to be used for child auro element naming.
|
|
@@ -6202,7 +6206,7 @@ let AuroDependencyVersioning$1 = class AuroDependencyVersioning {
|
|
|
6202
6206
|
|
|
6203
6207
|
return tag;
|
|
6204
6208
|
}
|
|
6205
|
-
}
|
|
6209
|
+
}
|
|
6206
6210
|
|
|
6207
6211
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6208
6212
|
// See LICENSE in the project root for license information.
|
|
@@ -6214,7 +6218,7 @@ let AuroDependencyVersioning$1 = class AuroDependencyVersioning {
|
|
|
6214
6218
|
* @attr {Boolean} hiddenAudible - If present, the component will be hidden from screen readers, but seen visually
|
|
6215
6219
|
*/
|
|
6216
6220
|
|
|
6217
|
-
class AuroElement extends i$2 {
|
|
6221
|
+
let AuroElement$1 = class AuroElement extends i$2 {
|
|
6218
6222
|
|
|
6219
6223
|
// function to define props used within the scope of this component
|
|
6220
6224
|
static get properties() {
|
|
@@ -6238,7 +6242,7 @@ class AuroElement extends i$2 {
|
|
|
6238
6242
|
|
|
6239
6243
|
return 'false'
|
|
6240
6244
|
}
|
|
6241
|
-
}
|
|
6245
|
+
};
|
|
6242
6246
|
|
|
6243
6247
|
var error = {"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-labelledby=\"error__desc\" class=\"ico_squareLarge\" data-deprecated=\"true\" role=\"img\" style=\"min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor\" viewBox=\"0 0 24 24\" part=\"svg\"><title/><desc id=\"error__desc\">Error alert indicator.</desc><path d=\"m13.047 5.599 6.786 11.586A1.207 1.207 0 0 1 18.786 19H5.214a1.207 1.207 0 0 1-1.047-1.815l6.786-11.586a1.214 1.214 0 0 1 2.094 0m-1.165.87a.23.23 0 0 0-.085.085L5.419 17.442a.232.232 0 0 0 .203.35h12.756a.234.234 0 0 0 .203-.35L12.203 6.554a.236.236 0 0 0-.321-.084M12 15.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m-.024-6.22c.325 0 .589.261.589.583v4.434a.586.586 0 0 1-.589.583.586.586 0 0 1-.588-.583V9.863c0-.322.264-.583.588-.583\"/></svg>"};
|
|
6244
6248
|
|
|
@@ -6282,7 +6286,7 @@ var styleCss$3 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}.u
|
|
|
6282
6286
|
*/
|
|
6283
6287
|
|
|
6284
6288
|
// build the component class
|
|
6285
|
-
class BaseIcon extends AuroElement {
|
|
6289
|
+
class BaseIcon extends AuroElement$1 {
|
|
6286
6290
|
constructor() {
|
|
6287
6291
|
super();
|
|
6288
6292
|
this.onDark = false;
|
|
@@ -6365,7 +6369,7 @@ var colorCss$3 = i$5`:host{color:var(--ds-auro-icon-color)}:host([customColor]){
|
|
|
6365
6369
|
|
|
6366
6370
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
6367
6371
|
|
|
6368
|
-
let AuroLibraryRuntimeUtils$
|
|
6372
|
+
let AuroLibraryRuntimeUtils$2 = class AuroLibraryRuntimeUtils {
|
|
6369
6373
|
|
|
6370
6374
|
/* eslint-disable jsdoc/require-param */
|
|
6371
6375
|
|
|
@@ -6447,7 +6451,7 @@ class AuroIcon extends BaseIcon {
|
|
|
6447
6451
|
*/
|
|
6448
6452
|
privateDefaults() {
|
|
6449
6453
|
this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
|
|
6450
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
6454
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$2();
|
|
6451
6455
|
}
|
|
6452
6456
|
|
|
6453
6457
|
// function to define props used within the scope of this component
|
|
@@ -6529,7 +6533,7 @@ class AuroIcon extends BaseIcon {
|
|
|
6529
6533
|
*
|
|
6530
6534
|
*/
|
|
6531
6535
|
static register(name = "auro-icon") {
|
|
6532
|
-
AuroLibraryRuntimeUtils$
|
|
6536
|
+
AuroLibraryRuntimeUtils$2.prototype.registerComponent(name, AuroIcon);
|
|
6533
6537
|
}
|
|
6534
6538
|
|
|
6535
6539
|
connectedCallback() {
|
|
@@ -6550,8 +6554,12 @@ class AuroIcon extends BaseIcon {
|
|
|
6550
6554
|
async firstUpdated() {
|
|
6551
6555
|
await super.firstUpdated();
|
|
6552
6556
|
|
|
6553
|
-
|
|
6554
|
-
|
|
6557
|
+
/**
|
|
6558
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
6559
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
6560
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
6561
|
+
*/
|
|
6562
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
6555
6563
|
const svgDesc = this.svg.querySelector('desc');
|
|
6556
6564
|
|
|
6557
6565
|
if (svgDesc) {
|
|
@@ -6597,121 +6605,479 @@ class AuroIcon extends BaseIcon {
|
|
|
6597
6605
|
|
|
6598
6606
|
var iconVersion = '8.0.1';
|
|
6599
6607
|
|
|
6600
|
-
|
|
6601
|
-
|
|
6608
|
+
/**
|
|
6609
|
+
* Private module-level WeakMap to hold MutationObservers for each host element.
|
|
6610
|
+
*/
|
|
6611
|
+
const _observers = new WeakMap();
|
|
6602
6612
|
|
|
6613
|
+
/**
|
|
6614
|
+
* Private module-level WeakMap to hold attribute matchers and targets for each host element.
|
|
6615
|
+
* Structure: {
|
|
6616
|
+
* host: {
|
|
6617
|
+
* matchers: Set<Function>,
|
|
6618
|
+
* targets: Map<HTMLElement, Map<Function, {removeOriginal: boolean, currentAttributes: Map<string, string>}>>
|
|
6619
|
+
* }
|
|
6620
|
+
* }
|
|
6621
|
+
*/
|
|
6622
|
+
const _transportConfig = new WeakMap();
|
|
6603
6623
|
|
|
6604
|
-
|
|
6624
|
+
/**
|
|
6625
|
+
* Transfers all matching attributes from a host element to a target element and observes for future changes.
|
|
6626
|
+
*
|
|
6627
|
+
* @param {Object} params - The parameters for the function.
|
|
6628
|
+
* @param {HTMLElement} params.host - The host element from which attributes will be transported.
|
|
6629
|
+
* @param {HTMLElement} params.target - The target element to which attributes will be transported.
|
|
6630
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove the attributes from the host element.
|
|
6631
|
+
* @param {boolean} [params.observe=true] - Whether to attach a MutationObserver to the host element.
|
|
6632
|
+
* @returns {Function} A function to detach the observer when no longer needed.
|
|
6633
|
+
* @throws {TypeError} If the host or target parameters are not instances of HTMLElement.
|
|
6634
|
+
*/
|
|
6635
|
+
const transportAttributes = ({ host, target, match, removeOriginal = true }) => {
|
|
6636
|
+
// Guard Clause: Ensure host is valid HTMLElement instance
|
|
6637
|
+
if (typeof host !== 'object' || !(host instanceof HTMLElement)) {
|
|
6638
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "host" parameter must be an instance of HTMLElement.');
|
|
6639
|
+
}
|
|
6605
6640
|
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
* @param {string} version - Version of the component that will be appended to the baseName.
|
|
6611
|
-
* @returns {string} - Unique string to be used for naming.
|
|
6612
|
-
*/
|
|
6613
|
-
generateElementName(baseName, version) {
|
|
6614
|
-
let result = baseName;
|
|
6641
|
+
// Guard Clause: Ensure target is valid HTMLElement instance
|
|
6642
|
+
if (typeof target !== 'object' || !(target instanceof HTMLElement)) {
|
|
6643
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "target" parameter must be an instance of HTMLElement.');
|
|
6644
|
+
}
|
|
6615
6645
|
|
|
6616
|
-
|
|
6617
|
-
|
|
6646
|
+
// Guard Clause: Ensure match is a function
|
|
6647
|
+
if (typeof match !== 'function') {
|
|
6648
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "match" parameter must be a function.');
|
|
6649
|
+
}
|
|
6618
6650
|
|
|
6619
|
-
|
|
6651
|
+
// Guard Clause: Ensure removeOriginal is a boolean
|
|
6652
|
+
if (typeof removeOriginal !== 'boolean') {
|
|
6653
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "removeOriginal" parameter must be a boolean.');
|
|
6620
6654
|
}
|
|
6655
|
+
|
|
6656
|
+
// Register this transport and get cleanup function
|
|
6657
|
+
return _registerTransport({
|
|
6658
|
+
host,
|
|
6659
|
+
target,
|
|
6660
|
+
matcher: match,
|
|
6661
|
+
removeOriginal
|
|
6662
|
+
});
|
|
6663
|
+
};
|
|
6621
6664
|
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6665
|
+
/**
|
|
6666
|
+
* Registers a matcher and target for a host element and attaches an observer if needed.
|
|
6667
|
+
*
|
|
6668
|
+
* @param {Object} params - The parameters object.
|
|
6669
|
+
* @param {HTMLElement} params.host - The host element to observe.
|
|
6670
|
+
* @param {HTMLElement} params.target - The target element to receive attributes.
|
|
6671
|
+
* @param {Function} params.matcher - Function that determines which attributes to transport.
|
|
6672
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove original attributes.
|
|
6673
|
+
* @param {boolean} [params.observe=true] - Whether to observe for attribute changes.
|
|
6674
|
+
* @returns {Function} Function to detach the specific matcher and target pairing.
|
|
6675
|
+
* @private
|
|
6676
|
+
*/
|
|
6677
|
+
const _registerTransport = ({ host, target, matcher, removeOriginal = true }) => {
|
|
6678
|
+
// Initialize config for this host if it doesn't exist
|
|
6679
|
+
if (!_transportConfig.has(host)) {
|
|
6680
|
+
_transportConfig.set(host, {
|
|
6681
|
+
matchers: new Set(),
|
|
6682
|
+
targets: new Map()
|
|
6683
|
+
});
|
|
6684
|
+
}
|
|
6631
6685
|
|
|
6632
|
-
|
|
6633
|
-
|
|
6686
|
+
const config = _transportConfig.get(host);
|
|
6687
|
+
|
|
6688
|
+
// Add the matcher to the set of matchers for this host
|
|
6689
|
+
config.matchers.add(matcher);
|
|
6690
|
+
|
|
6691
|
+
// Initialize target entry if it doesn't exist
|
|
6692
|
+
if (!config.targets.has(target)) {
|
|
6693
|
+
config.targets.set(target, new Map());
|
|
6694
|
+
}
|
|
6695
|
+
|
|
6696
|
+
// Store the matcher with its removeOriginal setting for this target
|
|
6697
|
+
config.targets.get(target).set(matcher, {
|
|
6698
|
+
removeOriginal,
|
|
6699
|
+
currentAttributes: new Map()
|
|
6700
|
+
});
|
|
6701
|
+
|
|
6702
|
+
// Perform initial attribute transport
|
|
6703
|
+
_transportAttributes({ host, target, matcher, removeOriginal });
|
|
6704
|
+
|
|
6705
|
+
// Attach observer
|
|
6706
|
+
_attachObserver(host);
|
|
6707
|
+
|
|
6708
|
+
// Return cleanup function and utility functions
|
|
6709
|
+
return {
|
|
6710
|
+
cleanup: () => _cleanupTransport(host, target, matcher),
|
|
6711
|
+
getObservedAttributes: () => _getObservedAttributes(host, target, matcher),
|
|
6712
|
+
getObservedAttribute: (attr) => _getObservedAttribute(host, target, matcher, attr),
|
|
6713
|
+
}
|
|
6714
|
+
};
|
|
6715
|
+
|
|
6716
|
+
/**
|
|
6717
|
+
* Cleans up resources associated with a specific matcher and target for a host element.
|
|
6718
|
+
*
|
|
6719
|
+
* @param {HTMLElement} host - The host element
|
|
6720
|
+
* @param {HTMLElement} target - The target element
|
|
6721
|
+
* @param {Function} matcher - The matcher function
|
|
6722
|
+
* @private
|
|
6723
|
+
*/
|
|
6724
|
+
const _cleanupTransport = (host, target, matcher) => {
|
|
6725
|
+
const config = _transportConfig.get(host);
|
|
6726
|
+
if (!config) return;
|
|
6727
|
+
|
|
6728
|
+
// Remove this matcher from this target
|
|
6729
|
+
const targetMatchers = config.targets.get(target);
|
|
6730
|
+
if (targetMatchers) {
|
|
6731
|
+
targetMatchers.delete(matcher);
|
|
6732
|
+
|
|
6733
|
+
// If this target has no more matchers, remove it
|
|
6734
|
+
if (targetMatchers.size === 0) {
|
|
6735
|
+
config.targets.delete(target);
|
|
6736
|
+
}
|
|
6737
|
+
}
|
|
6738
|
+
|
|
6739
|
+
// Check if this matcher is still used by any target
|
|
6740
|
+
let matcherStillUsed = false;
|
|
6741
|
+
for (const matcherMap of config.targets.values()) {
|
|
6742
|
+
if (matcherMap.has(matcher)) {
|
|
6743
|
+
matcherStillUsed = true;
|
|
6744
|
+
break;
|
|
6634
6745
|
}
|
|
6746
|
+
}
|
|
6747
|
+
|
|
6748
|
+
// If not used anymore, remove from matchers set
|
|
6749
|
+
if (!matcherStillUsed) {
|
|
6750
|
+
config.matchers.delete(matcher);
|
|
6751
|
+
}
|
|
6752
|
+
|
|
6753
|
+
// If no more targets or matchers, detach observer
|
|
6754
|
+
if (config.targets.size === 0 || config.matchers.size === 0) {
|
|
6755
|
+
_detachObserver(host);
|
|
6756
|
+
}
|
|
6757
|
+
};
|
|
6635
6758
|
|
|
6636
|
-
|
|
6759
|
+
/**
|
|
6760
|
+
* Generic function to transport attributes from a host element to a target element.
|
|
6761
|
+
*
|
|
6762
|
+
* @param {Object} params - The parameters object.
|
|
6763
|
+
* @param {HTMLElement} params.host - The host element from which to transport attributes.
|
|
6764
|
+
* @param {HTMLElement} params.target - The target element to which attributes will be transported.
|
|
6765
|
+
* @param {Function} params.matcher - Function that takes an attribute name and returns true if it should be transported.
|
|
6766
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove original attributes from host.
|
|
6767
|
+
* @returns {void}
|
|
6768
|
+
* @private
|
|
6769
|
+
*/
|
|
6770
|
+
const _transportAttributes = ({ host, target, matcher, removeOriginal = true }) => {
|
|
6771
|
+
// Get a list of all matching attributes on the host element and their values
|
|
6772
|
+
const matchingAttributes = host.getAttributeNames()
|
|
6773
|
+
.filter(attr => matcher(attr))
|
|
6774
|
+
.reduce((acc, attr) => {
|
|
6775
|
+
acc[attr] = host.getAttribute(attr);
|
|
6776
|
+
return acc;
|
|
6777
|
+
}, {});
|
|
6778
|
+
|
|
6779
|
+
// Move matching attributes to the target element, removing them from the host if removeOriginal is true
|
|
6780
|
+
Object.entries(matchingAttributes).forEach(([key, value]) => {
|
|
6781
|
+
_setObservedAttribute(host, target, matcher, key, value);
|
|
6782
|
+
target.setAttribute(key, value);
|
|
6783
|
+
if (removeOriginal) {
|
|
6784
|
+
host.removeAttribute(key);
|
|
6785
|
+
}
|
|
6786
|
+
});
|
|
6787
|
+
};
|
|
6788
|
+
|
|
6789
|
+
/**
|
|
6790
|
+
* Attaches a MutationObserver to the host element to monitor attribute changes.
|
|
6791
|
+
*
|
|
6792
|
+
* @param {HTMLElement} host - The element to observe for attribute changes.
|
|
6793
|
+
* @returns {MutationObserver} The observer instance.
|
|
6794
|
+
* @private
|
|
6795
|
+
*/
|
|
6796
|
+
const _attachObserver = (host) => {
|
|
6797
|
+
// If an observer for this host already exists, return it
|
|
6798
|
+
if (_observers.has(host)) {
|
|
6799
|
+
return _observers.get(host);
|
|
6800
|
+
}
|
|
6801
|
+
|
|
6802
|
+
// Create a new MutationObserver
|
|
6803
|
+
const observer = new MutationObserver((mutations) => {
|
|
6804
|
+
const config = _transportConfig.get(host);
|
|
6805
|
+
if (!config) return;
|
|
6806
|
+
|
|
6807
|
+
// For each mutation affecting attributes
|
|
6808
|
+
mutations
|
|
6809
|
+
.filter(mutation => mutation.type === 'attributes')
|
|
6810
|
+
.forEach(mutation => {
|
|
6811
|
+
const attributeName = mutation.attributeName;
|
|
6812
|
+
|
|
6813
|
+
// Find matchers that care about this attribute
|
|
6814
|
+
for (const matcher of config.matchers) {
|
|
6815
|
+
if (matcher(attributeName)) {
|
|
6816
|
+
// For each target that uses this matcher
|
|
6817
|
+
for (const [target, matcherConfigs] of config.targets.entries()) {
|
|
6818
|
+
if (matcherConfigs.has(matcher)) {
|
|
6819
|
+
const { removeOriginal } = matcherConfigs.get(matcher);
|
|
6820
|
+
_transportAttributes({
|
|
6821
|
+
host,
|
|
6822
|
+
target,
|
|
6823
|
+
matcher,
|
|
6824
|
+
removeOriginal
|
|
6825
|
+
});
|
|
6826
|
+
}
|
|
6827
|
+
}
|
|
6828
|
+
}
|
|
6829
|
+
}
|
|
6830
|
+
});
|
|
6831
|
+
});
|
|
6832
|
+
|
|
6833
|
+
// Start observing attribute changes
|
|
6834
|
+
observer.observe(host, { attributes: true });
|
|
6835
|
+
|
|
6836
|
+
// Store the observer
|
|
6837
|
+
_observers.set(host, observer);
|
|
6838
|
+
|
|
6839
|
+
return observer;
|
|
6840
|
+
};
|
|
6841
|
+
|
|
6842
|
+
/**
|
|
6843
|
+
* Detaches and cleans up the MutationObserver for a given host element.
|
|
6844
|
+
*
|
|
6845
|
+
* @param {HTMLElement} host - The element whose observer should be detached.
|
|
6846
|
+
* @private
|
|
6847
|
+
*/
|
|
6848
|
+
const _detachObserver = (host) => {
|
|
6849
|
+
if (_observers.has(host)) {
|
|
6850
|
+
const observer = _observers.get(host);
|
|
6851
|
+
observer.disconnect();
|
|
6852
|
+
_observers.delete(host);
|
|
6637
6853
|
}
|
|
6638
|
-
|
|
6854
|
+
|
|
6855
|
+
// Clean up the transport config as well
|
|
6856
|
+
if (_transportConfig.has(host)) {
|
|
6857
|
+
_transportConfig.delete(host);
|
|
6858
|
+
}
|
|
6859
|
+
};
|
|
6639
6860
|
|
|
6640
|
-
|
|
6641
|
-
|
|
6861
|
+
/**
|
|
6862
|
+
* Gets the matcher configuration for a specific host, target, and matcher
|
|
6863
|
+
* @param {HTMLElement} host - The host element
|
|
6864
|
+
* @param {HTMLElement} target - The target element
|
|
6865
|
+
* @param {Function} matcher - The matcher function
|
|
6866
|
+
* @returns {Object|undefined} The matcher configuration if found
|
|
6867
|
+
* @private
|
|
6868
|
+
*/
|
|
6869
|
+
const _getMatcherConfig = (host, target, matcher) => {
|
|
6870
|
+
const config = _transportConfig.get(host);
|
|
6871
|
+
if (!config) return undefined;
|
|
6872
|
+
|
|
6873
|
+
const targetMatchers = config.targets.get(target);
|
|
6874
|
+
if (!targetMatchers) return undefined;
|
|
6875
|
+
|
|
6876
|
+
return targetMatchers.get(matcher);
|
|
6877
|
+
};
|
|
6642
6878
|
|
|
6643
|
-
|
|
6879
|
+
/**
|
|
6880
|
+
* Sets an observed attribute value
|
|
6881
|
+
* @param {HTMLElement} host - The host element
|
|
6882
|
+
* @param {HTMLElement} target - The target element
|
|
6883
|
+
* @param {Function} matcher - The matcher function
|
|
6884
|
+
* @param {string} key - The attribute name
|
|
6885
|
+
* @param {string} value - The attribute value
|
|
6886
|
+
* @private
|
|
6887
|
+
*/
|
|
6888
|
+
const _setObservedAttribute = (host, target, matcher, key, value) => {
|
|
6889
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
6890
|
+
if (matcherConfig) {
|
|
6891
|
+
matcherConfig.currentAttributes.set(key, value);
|
|
6892
|
+
}
|
|
6893
|
+
};
|
|
6644
6894
|
|
|
6645
|
-
|
|
6895
|
+
const _getObservedAttribute = (host, target, matcher, attr) => {
|
|
6896
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
6897
|
+
if (matcherConfig) return matcherConfig.currentAttributes.get(attr);
|
|
6898
|
+
return undefined;
|
|
6899
|
+
};
|
|
6646
6900
|
|
|
6647
|
-
|
|
6901
|
+
const _getObservedAttributes = (host, target, matcher) => {
|
|
6902
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
6903
|
+
if (matcherConfig) return Array.from(matcherConfig.currentAttributes.entries());
|
|
6904
|
+
return [];
|
|
6905
|
+
};
|
|
6648
6906
|
|
|
6649
|
-
|
|
6907
|
+
const _matchers = {
|
|
6908
|
+
'aria-': attr => attr.startsWith('aria-'),
|
|
6909
|
+
'role': attr => attr.match(/^role$/)
|
|
6910
|
+
};
|
|
6911
|
+
|
|
6912
|
+
const transportAllA11yAttributes = ({ host, target, removeOriginal = true }) => {
|
|
6913
|
+
return transportAttributes({
|
|
6914
|
+
host,
|
|
6915
|
+
target,
|
|
6916
|
+
match: attr => {
|
|
6917
|
+
for (const key in _matchers) {
|
|
6918
|
+
if (_matchers[key](attr)) return true;
|
|
6919
|
+
}
|
|
6920
|
+
return false;
|
|
6921
|
+
},
|
|
6922
|
+
removeOriginal
|
|
6923
|
+
});
|
|
6924
|
+
};
|
|
6925
|
+
|
|
6926
|
+
class AuroElement extends i$2 {
|
|
6650
6927
|
|
|
6651
6928
|
/**
|
|
6652
|
-
*
|
|
6653
|
-
* @
|
|
6654
|
-
* @
|
|
6655
|
-
* @
|
|
6929
|
+
* @type {Object} return object from transportAttributes via a11yUtilities
|
|
6930
|
+
* @property {Function} cleanup - Function to clean up the attribute watcher.
|
|
6931
|
+
* @property {Function} getCurrentAttributes - Function to get the current attributes being watched and their values.
|
|
6932
|
+
* @property {Function} getObservedAttribute - Function to get the value of a specific observed attribute by name.
|
|
6933
|
+
* @private
|
|
6656
6934
|
*/
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6935
|
+
attributeWatcher;
|
|
6936
|
+
|
|
6937
|
+
static get properties() {
|
|
6938
|
+
return {
|
|
6939
|
+
|
|
6940
|
+
/**
|
|
6941
|
+
* Defines the layout of an element.
|
|
6942
|
+
* @default {'default'}
|
|
6943
|
+
*/
|
|
6944
|
+
layout: {
|
|
6945
|
+
type: String,
|
|
6946
|
+
attribute: "layout",
|
|
6947
|
+
reflect: true
|
|
6948
|
+
},
|
|
6949
|
+
|
|
6950
|
+
/**
|
|
6951
|
+
* Defines the shape of an element.
|
|
6952
|
+
* @property {'default', 'rounded', 'pill', 'circle'}
|
|
6953
|
+
* @default {'default'}
|
|
6954
|
+
*/
|
|
6955
|
+
shape: {
|
|
6956
|
+
type: String,
|
|
6957
|
+
attribute: "shape",
|
|
6958
|
+
reflect: true
|
|
6959
|
+
},
|
|
6960
|
+
|
|
6961
|
+
/**
|
|
6962
|
+
* Defines the size of an element.
|
|
6963
|
+
* @property {'xs', 'sm', 'md', 'lg', 'xl'}
|
|
6964
|
+
* @default {'md'}
|
|
6965
|
+
*/
|
|
6966
|
+
size: {
|
|
6967
|
+
type: String,
|
|
6968
|
+
attribute: "size",
|
|
6969
|
+
reflect: true
|
|
6970
|
+
},
|
|
6971
|
+
|
|
6972
|
+
/**
|
|
6973
|
+
* This Boolean attribute lets you specify that the element should be rendered in dark mode.
|
|
6974
|
+
* @default {false}
|
|
6975
|
+
*/
|
|
6976
|
+
onDark: {
|
|
6977
|
+
type: Boolean,
|
|
6978
|
+
attribute: "ondark",
|
|
6979
|
+
reflect: true
|
|
6980
|
+
},
|
|
6981
|
+
|
|
6982
|
+
/**
|
|
6983
|
+
* A reference to the wrapper element in the shadow DOM.
|
|
6984
|
+
* This is used to apply layout and shape classes dynamically.
|
|
6985
|
+
* @type {HTMLElement|null}
|
|
6986
|
+
* @default {null}
|
|
6987
|
+
* @private
|
|
6988
|
+
*/
|
|
6989
|
+
wrapper: {
|
|
6990
|
+
type: HTMLElement,
|
|
6991
|
+
attribute: false,
|
|
6992
|
+
reflect: false
|
|
6993
|
+
}
|
|
6994
|
+
};
|
|
6995
|
+
}
|
|
6996
|
+
|
|
6997
|
+
|
|
6998
|
+
|
|
6999
|
+
resetShapeClasses() {
|
|
7000
|
+
if (this.shape && this.size) {
|
|
7001
|
+
|
|
7002
|
+
if (this.wrapper) {
|
|
7003
|
+
this.wrapper.classList.forEach((className) => {
|
|
7004
|
+
if (className.startsWith('shape-')) {
|
|
7005
|
+
this.wrapper.classList.remove(className);
|
|
7006
|
+
}
|
|
7007
|
+
});
|
|
7008
|
+
|
|
7009
|
+
this.wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
7010
|
+
}
|
|
6660
7011
|
}
|
|
6661
7012
|
}
|
|
6662
7013
|
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
6676
|
-
) {
|
|
6677
|
-
return __Closest(base);
|
|
7014
|
+
resetLayoutClasses() {
|
|
7015
|
+
if (this.layout) {
|
|
7016
|
+
if (this.wrapper) {
|
|
7017
|
+
this.wrapper.classList.forEach((className) => {
|
|
7018
|
+
if (className.startsWith('layout-')) {
|
|
7019
|
+
this.wrapper.classList.remove(className);
|
|
7020
|
+
}
|
|
7021
|
+
});
|
|
7022
|
+
|
|
7023
|
+
this.wrapper.classList.add(`layout-${this.layout.toLowerCase()}`);
|
|
7024
|
+
}
|
|
7025
|
+
}
|
|
6678
7026
|
}
|
|
6679
|
-
/* eslint-enable jsdoc/require-param */
|
|
6680
7027
|
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
* @returns {void}
|
|
6686
|
-
*/
|
|
6687
|
-
handleComponentTagRename(elem, tagName) {
|
|
6688
|
-
const tag = tagName.toLowerCase();
|
|
6689
|
-
const elemTag = elem.tagName.toLowerCase();
|
|
7028
|
+
updateComponentArchitecture() {
|
|
7029
|
+
this.resetLayoutClasses();
|
|
7030
|
+
this.resetShapeClasses();
|
|
7031
|
+
}
|
|
6690
7032
|
|
|
6691
|
-
|
|
6692
|
-
|
|
7033
|
+
updated(changedProperties) {
|
|
7034
|
+
if (changedProperties.has('layout') || changedProperties.has('shape') || changedProperties.has('size')) {
|
|
7035
|
+
this.updateComponentArchitecture();
|
|
6693
7036
|
}
|
|
6694
7037
|
}
|
|
6695
7038
|
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
* @param {Object} elem - The element to validate.
|
|
6699
|
-
* @param {String} tagName - The name of the Auro component to check against.
|
|
6700
|
-
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
6701
|
-
*/
|
|
6702
|
-
elementMatch(elem, tagName) {
|
|
6703
|
-
const tag = tagName.toLowerCase();
|
|
6704
|
-
const elemTag = elem.tagName.toLowerCase();
|
|
7039
|
+
firstUpdated() {
|
|
7040
|
+
super.firstUpdated();
|
|
6705
7041
|
|
|
6706
|
-
|
|
7042
|
+
// Set a reference to the wrapper element in the shadow DOM
|
|
7043
|
+
this.wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
7044
|
+
|
|
7045
|
+
// Initialize the transportation of ARIA attributes to the target element and get the disconnect function for cleanup
|
|
7046
|
+
this.attributeWatcher = transportAllA11yAttributes({ host: this, target: this.shadowRoot.querySelector('.wrapper') });
|
|
6707
7047
|
}
|
|
6708
|
-
};
|
|
6709
7048
|
|
|
6710
|
-
|
|
7049
|
+
disconnectedCallback() {
|
|
7050
|
+
super.disconnectedCallback();
|
|
6711
7051
|
|
|
6712
|
-
|
|
7052
|
+
// Cleanup the ARIA observer if it exists
|
|
7053
|
+
if (this.attributeWatcher) {
|
|
7054
|
+
this.attributeWatcher.cleanup();
|
|
7055
|
+
this.attributeWatcher = null;
|
|
7056
|
+
}
|
|
7057
|
+
}
|
|
6713
7058
|
|
|
6714
|
-
|
|
7059
|
+
// Try to render the defined `this.layout` layout. If that fails, fall back to the default layout.
|
|
7060
|
+
// This will catch if an invalid layout value is passed in and render the default layout if so.
|
|
7061
|
+
render() {
|
|
7062
|
+
try {
|
|
7063
|
+
return this.renderLayout();
|
|
7064
|
+
} catch (error) {
|
|
7065
|
+
// failed to get the defined layout
|
|
7066
|
+
console.error('Failed to get the defined layout - using the default layout', error); // eslint-disable-line no-console
|
|
7067
|
+
|
|
7068
|
+
// fallback to the default layout
|
|
7069
|
+
return this.getLayout('default');
|
|
7070
|
+
}
|
|
7071
|
+
}
|
|
7072
|
+
}
|
|
7073
|
+
|
|
7074
|
+
var styleCss$2 = i$5`:focus:not(:focus-visible){outline:3px solid transparent}.util_insetNone{padding:0}.util_insetXxxs{padding:.125rem}.util_insetXxxs--stretch{padding:.25rem .125rem}.util_insetXxxs--squish{padding:0 .125rem}.util_insetXxs{padding:.25rem}.util_insetXxs--stretch{padding:.375rem .25rem}.util_insetXxs--squish{padding:.125rem .25rem}.util_insetXs{padding:.5rem}.util_insetXs--stretch{padding:.75rem .5rem}.util_insetXs--squish{padding:.25rem .5rem}.util_insetSm{padding:.75rem}.util_insetSm--stretch{padding:1.125rem .75rem}.util_insetSm--squish{padding:.375rem .75rem}.util_insetMd{padding:1rem}.util_insetMd--stretch{padding:1.5rem 1rem}.util_insetMd--squish{padding:.5rem 1rem}.util_insetLg{padding:1.5rem}.util_insetLg--stretch{padding:2.25rem 1.5rem}.util_insetLg--squish{padding:.75rem 1.5rem}.util_insetXl{padding:2rem}.util_insetXl--stretch{padding:3rem 2rem}.util_insetXl--squish{padding:1rem 2rem}.util_insetXxl{padding:3rem}.util_insetXxl--stretch{padding:4.5rem 3rem}.util_insetXxl--squish{padding:1.5rem 3rem}.util_insetXxxl{padding:4rem}.util_insetXxxl--stretch{padding:6rem 4rem}.util_insetXxxl--squish{padding:2rem 4rem}:host([fluid]) .auro-button,:host([fluid=true]) .auro-button{min-width:auto;width:100%}:host([variant=flat]){display:inline-block}::slotted(svg){vertical-align:middle}slot{pointer-events:none}.auro-button{position:relative;padding:0 var(--ds-size-300, 1.5rem);cursor:pointer;border-width:1px;border-style:solid;border-radius:var(--ds-border-radius, 0.375rem);overflow:hidden;text-overflow:ellipsis;user-select:none;white-space:nowrap;min-height:var(--ds-size-600, 3rem);max-height:var(--ds-size-600, 3rem);display:inline-flex;flex-direction:row;align-items:center;justify-content:center;gap:var(--ds-size-100, 0.5rem);margin:0;-webkit-touch-callout:none;-webkit-user-select:none;transition:padding 300ms ease-out}.auro-button:active{transform:scale(0.95)}.auro-button:focus-visible,.auro-button:focus{outline:none;outline-style:solid;outline-width:var(--ds-size-50, 0.25rem);outline-offset:calc(var(--ds-size-50, 0.25rem)*-1)}.auro-button:focus-visible:not([variant=secondary]):not([variant=tertiary]),.auro-button:focus:not([variant=secondary]):not([variant=tertiary]){outline-width:calc(var(--ds-size-50, 0.25rem) - 1px)}.auro-button.loading{cursor:not-allowed}.auro-button.loading *:not([auro-loader]){visibility:hidden}@media screen and (min-width: 576px){.auro-button{min-width:8.75rem;width:auto}}.auro-button:disabled{cursor:not-allowed;transform:unset}.auro-button[variant=secondary]:disabled{cursor:not-allowed;transform:unset}.auro-button[variant=tertiary]:disabled{cursor:not-allowed;transform:unset}.auro-button[variant=ghost]:disabled{cursor:not-allowed;transform:unset}.auro-button[onDark]:disabled{cursor:not-allowed;transform:unset}.auro-button[onDark][variant=secondary]:disabled{cursor:not-allowed;transform:unset}@media(hover: hover){.auro-button[onDark][variant=tertiary]:active,.auro-button[onDark][variant=tertiary]:hover{box-shadow:none}}.auro-button[onDark][variant=tertiary]:active{box-shadow:none}.auro-button[onDark][variant=tertiary]:disabled{cursor:not-allowed;transform:unset}.auro-button--slim{min-width:unset;min-height:calc(var(--ds-size-500, 2.5rem) - var(--ds-size-50, 0.25rem));max-height:calc(var(--ds-size-500, 2.5rem) - var(--ds-size-50, 0.25rem))}.auro-button--iconOnly{padding:0 var(--ds-size-100, 0.5rem);border-radius:100px;min-width:unset;height:var(--ds-size-600, 3rem);width:var(--ds-size-500, 2.5rem)}.auro-button--iconOnly ::slotted(auro-icon),.auro-button--iconOnly ::slotted([auro-icon]){--ds-auro-icon-size:var(--ds-size-300, 1.5rem)}.auro-button--iconOnly:not(.auro-button--rounded):focus-visible:not([variant=secondary]):not([variant=tertiary]):not([variant=flat]),.auro-button--iconOnly:not(.auro-button--rounded):focus:not([variant=secondary]):not([variant=tertiary]):not([variant=flat]){outline-width:1px;outline-offset:-2px}.auro-button--iconOnlySlim{padding:0 var(--ds-size-50, 0.25rem);height:calc(var(--ds-size-400, 2rem) + var(--ds-size-50, 0.25rem));width:calc(var(--ds-size-300, 1.5rem) + var(--ds-size-50, 0.25rem))}.auro-button--iconOnlySlim ::slotted(auro-icon),.auro-button--iconOnlySlim ::slotted([auro-icon]){--ds-auro-icon-size:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, 0.25rem))}.auro-button--rounded{border-radius:100px;box-shadow:var(--ds-elevation-300, 0px 0px 15px rgba(0, 0, 0, 0.2));height:var(--ds-size-500, 2.5rem);min-width:unset;transition:padding 300ms ease-out,outline 0ms,outline-offset 0ms}.auro-button--rounded ::slotted(auro-icon),.auro-button--rounded ::slotted([auro-icon]){--ds-auro-icon-size:var(--ds-size-300, 1.5rem)}.auro-button--rounded:focus-visible:not([variant=flat]):after,.auro-button--rounded:focus:not([variant=flat]):after{border-radius:100px}:host([size=xs]) .wrapper:focus-visible,:host([size=xs]) .wrapper:focus{outline-width:1px;outline-offset:-2px}:host([rounded]) .textSlot{transition:opacity 300ms ease-in;opacity:1}:host([rounded][iconOnly]) .textSlot{opacity:0}:host([rounded][iconOnly]) .textWrapper{display:none}:host([rounded][iconOnly]) .auro-button{min-width:unset;padding:unset;width:var(--ds-size-600, 3rem)}[auro-loader]{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}`;
|
|
7075
|
+
|
|
7076
|
+
var colorCss$2 = i$5`[auro-loader]{color:var(--ds-auro-button-loader-color)}.auro-button{-webkit-tap-highlight-color:var(--ds-auro-button-tap-color);color:var(--ds-auro-button-text-color);background-color:var(--ds-auro-button-container-color);background-image:linear-gradient(var(--ds-auro-button-container-image), var(--ds-auro-button-container-image));border-color:var(--ds-auro-button-border-color)}.auro-button:not([variant=secondary]):not([variant=tertiary]):focus-visible{outline-color:var(--ds-auro-button-border-inset-color)}.auro-button:not([ondark]):active:not(:disabled),.auro-button:not([ondark]):hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-hover, #00274a);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-hover, #00274a);--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-hover, #00274a)}.auro-button:not([ondark]):disabled{--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-disabled, #acc9e2);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-disabled, #acc9e2);--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-disabled, #acc9e2)}.auro-button:not([ondark])[variant=secondary]{--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background, #ffffff);--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background, #ffffff);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border, #01426a);--ds-auro-button-text-color:var(--ds-advanced-color-button-secondary-text, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-secondary-text, #01426a)}.auro-button:not([ondark])[variant=secondary]:active:not(:disabled),.auro-button:not([ondark])[variant=secondary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background-hover, #f2f2f2);--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background-hover, #f2f2f2);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-hover, #00274a);--ds-auro-button-text-color:var(--ds-advanced-color-button-secondary-text-hover, #00274a)}.auro-button:not([ondark])[variant=secondary]:focus-visible{--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button:not([ondark])[variant=secondary]:disabled{--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background-disabled, #f7f7f7);--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background-disabled, #f7f7f7);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-disabled, #cfe0ef);--ds-auro-button-text-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}.auro-button:not([ondark])[variant=tertiary]{--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background, rgba(0, 0, 0, 0.05));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background, rgba(0, 0, 0, 0.05));--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-advanced-color-button-tertiary-text, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-tertiary-text, #01426a)}.auro-button:not([ondark])[variant=tertiary]:active:not(:disabled),.auro-button:not([ondark])[variant=tertiary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background-hover, rgba(0, 0, 0, 0.1));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background-hover, rgba(0, 0, 0, 0.1));--ds-auro-button-border-color:transparent}.auro-button:not([ondark])[variant=tertiary]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused, #01426a);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button:not([ondark])[variant=tertiary]:disabled{--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}.auro-button:not([ondark])[variant=ghost]{--ds-auro-button-container-color:transparent;--ds-auro-button-container-image:transparent;--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-advanced-color-button-ghost-text, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-ghost-text, #01426a)}.auro-button:not([ondark])[variant=ghost]:active:not(:disabled),.auro-button:not([ondark])[variant=ghost]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-ghost-background-hover, rgba(0, 0, 0, 0.05));--ds-auro-button-container-image:var(--ds-advanced-color-button-ghost-background-hover, rgba(0, 0, 0, 0.05));--ds-auro-button-border-color:transparent}.auro-button:not([ondark])[variant=ghost]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused, #01426a);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button:not([ondark])[variant=ghost]:disabled{--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}.auro-button:not([ondark])[variant=flat]{color:var(--ds-advanced-color-button-flat-text, #676767);background-color:transparent;background-image:none;border-color:transparent}.auro-button:not([ondark])[variant=flat]:active:not(:disabled),.auro-button:not([ondark])[variant=flat]:hover:not(:disabled){color:var(--ds-advanced-color-button-flat-text-hover, #525252);background-color:transparent;background-image:none;border-color:transparent}.auro-button:not([ondark])[variant=flat]:disabled{color:var(--ds-advanced-color-button-flat-text-disabled, #d0d0d0);background-color:transparent;background-image:none;border-color:transparent}.auro-button:not([ondark])[variant=flat]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused, #01426a);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button[ondark]{--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-inverse, #ffffff);--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-inverse, #ffffff);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-inverse, #ffffff);--ds-auro-button-text-color:var(--ds-advanced-color-button-primary-text-inverse, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-primary-text-inverse, #01426a)}.auro-button[ondark]:active:not(:disabled),.auro-button[ondark]:hover:not(:disabled){--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-inverse-hover, #ebf3f9);--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-inverse-hover, #ebf3f9);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-inverse-hover, #ebf3f9)}.auro-button[ondark]:focus-visible{--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused, #01426a)}.auro-button[ondark]:disabled{--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-inverse-disabled, rgba(255, 255, 255, 0.75));--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-inverse-disabled, rgba(255, 255, 255, 0.75));--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-inverse-disabled, rgba(255, 255, 255, 0.75));--ds-auro-button-text-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}.auro-button[ondark][variant=secondary]{--ds-auro-button-container-color:transparent;--ds-auro-button-container-image:transparent;--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-inverse, #ffffff);--ds-auro-button-text-color:var(--ds-advanced-color-button-secondary-text-inverse, #ffffff);--ds-auro-button-loader-color:var(--ds-advanced-color-button-secondary-text-inverse, #ffffff)}.auro-button[ondark][variant=secondary]:active:not(:disabled),.auro-button[ondark][variant=secondary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-secondary-background-inverse-hover, rgba(255, 255, 255, 0.1));--ds-auro-button-container-image:var(--ds-advanced-color-button-secondary-background-inverse-hover, rgba(255, 255, 255, 0.1))}.auro-button[ondark][variant=secondary]:focus-visible{--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff)}.auro-button[ondark][variant=secondary]:disabled{--ds-auro-button-text-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-button-border-color:var(--ds-advanced-color-button-secondary-border-inverse-disabled, #dddddd)}.auro-button[ondark][variant=tertiary]{--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background-inverse, rgba(255, 255, 255, 0.05));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background-inverse, rgba(255, 255, 255, 0.05));--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-advanced-color-button-tertiary-text-inverse, #ffffff);--ds-auro-button-loader-color:var(--ds-advanced-color-button-tertiary-text-inverse, #ffffff)}.auro-button[ondark][variant=tertiary]:active:not(:disabled),.auro-button[ondark][variant=tertiary]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-tertiary-background-inverse-hover, rgba(255, 255, 255, 0.1));--ds-auro-button-container-image:var(--ds-advanced-color-button-tertiary-background-inverse-hover, rgba(255, 255, 255, 0.1))}.auro-button[ondark][variant=tertiary]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff)}.auro-button[ondark][variant=tertiary]:disabled{--ds-auro-button-text-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}.auro-button[ondark][variant=ghost]{--ds-auro-button-container-color:transparent;--ds-auro-button-container-image:transparent;--ds-auro-button-border-color:transparent;--ds-auro-button-text-color:var(--ds-advanced-color-button-ghost-text-inverse, #ffffff);--ds-auro-button-loader-color:var(--ds-advanced-color-button-ghost-text-inverse, #ffffff)}.auro-button[ondark][variant=ghost]:active:not(:disabled),.auro-button[ondark][variant=ghost]:hover:not(:disabled){--ds-auro-button-container-color:var(--ds-advanced-color-button-ghost-background-inverse-hover, rgba(255, 255, 255, 0.05));--ds-auro-button-container-image:var(--ds-advanced-color-button-ghost-background-inverse-hover, rgba(255, 255, 255, 0.05))}.auro-button[ondark][variant=ghost]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff)}.auro-button[ondark][variant=ghost]:disabled{--ds-auro-button-text-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}.auro-button[ondark][variant=flat]{color:var(--ds-advanced-color-button-flat-text-inverse, #ffffff);background-color:transparent;background-image:none;border-color:transparent}.auro-button[ondark][variant=flat]:active:not(:disabled),.auro-button[ondark][variant=flat]:hover:not(:disabled){color:var(--ds-advanced-color-button-flat-text-inverse-hover, #adadad);background-color:transparent;background-image:none;border-color:transparent}.auro-button[ondark][variant=flat]:disabled{color:var(--ds-advanced-color-button-flat-text-inverse-disabled, #7e8894);background-color:transparent;background-image:none;border-color:transparent}.auro-button[ondark][variant=flat]:focus-visible{--ds-auro-button-border-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff)}`;
|
|
7077
|
+
|
|
7078
|
+
var tokensCss$2 = i$5`:host(:not([onDark])){--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border, #01426a);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background, #01426a);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background, #01426a);--ds-auro-button-loader-color:var(--ds-advanced-color-button-primary-text, #ffffff);--ds-auro-button-text-color:var(--ds-advanced-color-button-primary-text, #ffffff);--ds-auro-button-tap-color:transparent}:host([onDark]){--ds-auro-button-border-color:var(--ds-advanced-color-button-primary-border-inverse, #ffffff);--ds-auro-button-border-inset-color:var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-button-container-color:var(--ds-advanced-color-button-primary-background-inverse, #ffffff);--ds-auro-button-container-image:var(--ds-advanced-color-button-primary-background-inverse, #ffffff);--ds-auro-button-loader-color:var(--ds-advanced-color-button-primary-text-inverse, #01426a);--ds-auro-button-text-color:var(--ds-advanced-color-button-primary-text-inverse, #01426a);--ds-auro-button-tap-color:transparent}`;
|
|
7079
|
+
|
|
7080
|
+
var shapeSize = i$5`.shape-rounded-xl{min-height:68px;max-height:68px;border-style:solid;border-radius:6px;overflow:hidden;font-size:18px}.shape-rounded-lg{min-height:52px;max-height:52px;border-style:solid;border-radius:6px;overflow:hidden;font-size:18px}.shape-rounded-md{min-height:44px;max-height:44px;border-style:solid;border-radius:6px;overflow:hidden;font-size:16px}.shape-rounded-sm{min-height:32px;max-height:32px;border-style:solid;border-radius:6px;overflow:hidden;font-size:14px}.shape-rounded-xs{min-height:20px;max-height:20px;border-style:solid;border-radius:4px;overflow:hidden;font-size:12px;outline-offset:-2px;outline-width:1px}.shape-pill-xl{min-height:68px;max-height:68px;border-style:solid;border-radius:34px;overflow:hidden;font-size:18px}.shape-pill-left-xl{min-height:68px;max-height:68px;border-style:solid;border-radius:34px 0 0 34px;overflow:hidden}.shape-pill-right-xl{min-height:68px;max-height:68px;border-style:solid;border-radius:0 34px 34px 0;overflow:hidden}.shape-pill-lg{min-height:52px;max-height:52px;border-style:solid;border-radius:26px;overflow:hidden;font-size:18px}.shape-pill-left-lg{min-height:52px;max-height:52px;border-style:solid;border-radius:26px 0 0 26px;overflow:hidden}.shape-pill-right-lg{min-height:52px;max-height:52px;border-style:solid;border-radius:0 26px 26px 0;overflow:hidden}.shape-pill-md{min-height:44px;max-height:44px;border-style:solid;border-radius:22px;overflow:hidden}.shape-pill-left-md{min-height:44px;max-height:44px;border-style:solid;border-radius:22px 0 0 22px;overflow:hidden}.shape-pill-right-md{min-height:44px;max-height:44px;border-style:solid;border-radius:0 22px 22px 0;overflow:hidden;font-size:16px}.shape-pill-sm{min-height:32px;max-height:32px;border-style:solid;border-radius:16px;overflow:hidden;font-size:14px}.shape-pill-left-sm{min-height:32px;max-height:32px;border-style:solid;border-radius:16px 0 0 16px;overflow:hidden}.shape-pill-right-sm{min-height:32px;max-height:32px;border-style:solid;border-radius:0 16px 16px 0;overflow:hidden}.shape-pill-xs{min-height:20px;max-height:20px;border-style:solid;border-radius:10px;overflow:hidden;font-size:12px;outline-offset:-2px;outline-width:1px}.shape-pill-left-xs{min-height:20px;max-height:20px;border-style:solid;border-radius:10px 0 0 10px;overflow:hidden;outline-offset:-2px;outline-width:1px}.shape-pill-right-xs{min-height:20px;max-height:20px;border-style:solid;border-radius:0 10px 10px 0;overflow:hidden;outline-offset:-2px;outline-width:1px}.shape-circle-xl{min-height:68px;max-height:68px;min-width:68px;max-width:68px;border-style:solid;border-radius:34px;overflow:hidden;padding:0}.shape-circle-lg{min-height:52px;max-height:52px;min-width:52px;max-width:52px;border-style:solid;border-radius:26px;overflow:hidden;padding:0}.shape-circle-md{min-height:44px;max-height:44px;min-width:44px;max-width:44px;border-style:solid;border-radius:22px;overflow:hidden;padding:0}.shape-circle-sm{min-height:32px;max-height:32px;min-width:32px;max-width:32px;border-style:solid;border-radius:16px;overflow:hidden;padding:0}.shape-circle-xs{min-height:20px;max-height:20px;min-width:20px;max-width:20px;border-style:solid;border-radius:10px;overflow:hidden;padding:0;outline-offset:-2px;outline-width:1px}`;
|
|
6715
7081
|
|
|
6716
7082
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
6717
7083
|
// See LICENSE in the project root for license information.
|
|
@@ -6930,7 +7296,7 @@ class AuroLoader extends i$2 {
|
|
|
6930
7296
|
|
|
6931
7297
|
var loaderVersion = '5.0.0';
|
|
6932
7298
|
|
|
6933
|
-
/* eslint-disable max-lines */
|
|
7299
|
+
/* eslint-disable max-lines, curly */
|
|
6934
7300
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
6935
7301
|
// See LICENSE in the project root for license information.
|
|
6936
7302
|
|
|
@@ -6946,7 +7312,18 @@ var loaderVersion = '5.0.0';
|
|
|
6946
7312
|
|
|
6947
7313
|
/* eslint-disable lit/no-invalid-html, lit/binding-positions */
|
|
6948
7314
|
|
|
6949
|
-
|
|
7315
|
+
const ICON_ONLY_SHAPES = ['circle'];
|
|
7316
|
+
|
|
7317
|
+
/**
|
|
7318
|
+
* AuroButton is a custom element that provides a styled, accessible button with support for various states and form association.
|
|
7319
|
+
* It is designed to be flexible, supporting loading states, icon slots, and integration with HTML5 forms.
|
|
7320
|
+
* @property {'default', 'rounded', 'pill', 'circle'} shape - Defines the shape of the button.
|
|
7321
|
+
* @property {'xs', 'sm', 'md', 'lg', 'xl'} size - Defines the size of the button.
|
|
7322
|
+
* @property {'primary', 'secondary', 'tertiary', 'ghost', 'flat'} variant - Sets the button variant.
|
|
7323
|
+
* @property {'submit', 'reset', 'button'} type - The type of button. Matches HTML5 Button Spec.
|
|
7324
|
+
* @property {boolean} onDark - Indicates if the button is rendered in dark mode.
|
|
7325
|
+
*/
|
|
7326
|
+
class AuroButton extends AuroElement {
|
|
6950
7327
|
|
|
6951
7328
|
/**
|
|
6952
7329
|
* Enables form association for this element.
|
|
@@ -6961,13 +7338,10 @@ class AuroButton extends i$2 {
|
|
|
6961
7338
|
super();
|
|
6962
7339
|
this.autofocus = false;
|
|
6963
7340
|
this.disabled = false;
|
|
6964
|
-
this.iconOnly = false;
|
|
6965
7341
|
this.loading = false;
|
|
7342
|
+
this.size = "md";
|
|
7343
|
+
this.shape = "rounded";
|
|
6966
7344
|
this.onDark = false;
|
|
6967
|
-
this.secondary = false;
|
|
6968
|
-
this.tertiary = false;
|
|
6969
|
-
this.rounded = false;
|
|
6970
|
-
this.slim = false;
|
|
6971
7345
|
this.fluid = false;
|
|
6972
7346
|
this.loadingText = this.loadingText || 'Loading...';
|
|
6973
7347
|
|
|
@@ -6996,43 +7370,38 @@ class AuroButton extends i$2 {
|
|
|
6996
7370
|
return [
|
|
6997
7371
|
tokensCss$2,
|
|
6998
7372
|
styleCss$2,
|
|
6999
|
-
colorCss$2
|
|
7373
|
+
colorCss$2,
|
|
7374
|
+
shapeSize
|
|
7000
7375
|
];
|
|
7001
7376
|
}
|
|
7002
7377
|
|
|
7003
7378
|
static get properties() {
|
|
7004
7379
|
return {
|
|
7005
7380
|
|
|
7006
|
-
|
|
7007
|
-
* This Boolean attribute lets you specify that the button should have input focus when the page loads, unless overridden by the user.
|
|
7008
|
-
*/
|
|
7009
|
-
autofocus: {
|
|
7010
|
-
type: Boolean,
|
|
7011
|
-
reflect: true
|
|
7012
|
-
},
|
|
7381
|
+
...super.properties,
|
|
7013
7382
|
|
|
7014
7383
|
/**
|
|
7015
|
-
*
|
|
7384
|
+
* Override layout since it isn't used in this component.
|
|
7385
|
+
* @private
|
|
7016
7386
|
*/
|
|
7017
|
-
|
|
7387
|
+
layout: {
|
|
7018
7388
|
type: Boolean,
|
|
7019
|
-
|
|
7389
|
+
attribute: false,
|
|
7390
|
+
reflect: false
|
|
7020
7391
|
},
|
|
7021
7392
|
|
|
7022
7393
|
/**
|
|
7023
|
-
*
|
|
7024
|
-
* @deprecated
|
|
7394
|
+
* This Boolean attribute lets you specify that the button should have input focus when the page loads, unless overridden by the user.
|
|
7025
7395
|
*/
|
|
7026
|
-
|
|
7396
|
+
autofocus: {
|
|
7027
7397
|
type: Boolean,
|
|
7028
7398
|
reflect: true
|
|
7029
7399
|
},
|
|
7030
7400
|
|
|
7031
7401
|
/**
|
|
7032
|
-
*
|
|
7033
|
-
* @deprecated
|
|
7402
|
+
* If set to true, button will become disabled and not allow for interactions.
|
|
7034
7403
|
*/
|
|
7035
|
-
|
|
7404
|
+
disabled: {
|
|
7036
7405
|
type: Boolean,
|
|
7037
7406
|
reflect: true
|
|
7038
7407
|
},
|
|
@@ -7040,15 +7409,7 @@ class AuroButton extends i$2 {
|
|
|
7040
7409
|
/**
|
|
7041
7410
|
* Alters the shape of the button to be full width of its parent container.
|
|
7042
7411
|
*/
|
|
7043
|
-
fluid:
|
|
7044
|
-
type: Boolean,
|
|
7045
|
-
reflect: true
|
|
7046
|
-
},
|
|
7047
|
-
|
|
7048
|
-
/**
|
|
7049
|
-
* If set to true, the button will contain an icon with no additional content.
|
|
7050
|
-
*/
|
|
7051
|
-
iconOnly: {
|
|
7412
|
+
fluid: {
|
|
7052
7413
|
type: Boolean,
|
|
7053
7414
|
reflect: true
|
|
7054
7415
|
},
|
|
@@ -7056,7 +7417,7 @@ class AuroButton extends i$2 {
|
|
|
7056
7417
|
/**
|
|
7057
7418
|
* If set to true button text will be replaced with `auro-loader` and become disabled.
|
|
7058
7419
|
*/
|
|
7059
|
-
loading:
|
|
7420
|
+
loading: {
|
|
7060
7421
|
type: Boolean,
|
|
7061
7422
|
reflect: true
|
|
7062
7423
|
},
|
|
@@ -7064,34 +7425,10 @@ class AuroButton extends i$2 {
|
|
|
7064
7425
|
/**
|
|
7065
7426
|
* Sets custom loading text for the `aria-label` on a button in loading state. If not set, the default value of "Loading..." will be used.
|
|
7066
7427
|
*/
|
|
7067
|
-
loadingText:
|
|
7428
|
+
loadingText: {
|
|
7068
7429
|
type: String
|
|
7069
7430
|
},
|
|
7070
7431
|
|
|
7071
|
-
/**
|
|
7072
|
-
* Set value for on-dark version of auro-button.
|
|
7073
|
-
*/
|
|
7074
|
-
onDark: {
|
|
7075
|
-
type: Boolean,
|
|
7076
|
-
reflect: true
|
|
7077
|
-
},
|
|
7078
|
-
|
|
7079
|
-
/**
|
|
7080
|
-
* If set to true, the button will have a rounded shape.
|
|
7081
|
-
*/
|
|
7082
|
-
rounded: {
|
|
7083
|
-
type: Boolean,
|
|
7084
|
-
reflect: true
|
|
7085
|
-
},
|
|
7086
|
-
|
|
7087
|
-
/**
|
|
7088
|
-
* Set value for slim version of auro-button.
|
|
7089
|
-
*/
|
|
7090
|
-
slim: {
|
|
7091
|
-
type: Boolean,
|
|
7092
|
-
reflect: true
|
|
7093
|
-
},
|
|
7094
|
-
|
|
7095
7432
|
/**
|
|
7096
7433
|
* Populates `tabIndex` to define the focusable sequence in keyboard navigation.
|
|
7097
7434
|
*/
|
|
@@ -7100,48 +7437,10 @@ class AuroButton extends i$2 {
|
|
|
7100
7437
|
reflect: true
|
|
7101
7438
|
},
|
|
7102
7439
|
|
|
7103
|
-
/**
|
|
7104
|
-
* Populates the `aria-hidden` attribute to hide the button from a11y API.
|
|
7105
|
-
*/
|
|
7106
|
-
ariahidden: {
|
|
7107
|
-
type: String,
|
|
7108
|
-
reflect: true,
|
|
7109
|
-
},
|
|
7110
|
-
|
|
7111
|
-
/**
|
|
7112
|
-
* Populates the `aria-label` attribute that is used to define a string that labels the current element.
|
|
7113
|
-
* Use it in cases where a text label is not visible on the screen.
|
|
7114
|
-
* If there is visible text labeling the element, use `aria-labelledby` instead.
|
|
7115
|
-
*/
|
|
7116
|
-
arialabel: {
|
|
7117
|
-
type: String,
|
|
7118
|
-
reflect: true
|
|
7119
|
-
},
|
|
7120
|
-
|
|
7121
|
-
/**
|
|
7122
|
-
* Populates the `aria-labelledby` attribute that establishes relationships between objects and their label(s),
|
|
7123
|
-
* and its value should be one or more element IDs, which refer to elements that have the text needed for labeling.
|
|
7124
|
-
* List multiple element IDs in a space delimited fashion.
|
|
7125
|
-
*/
|
|
7126
|
-
arialabelledby: {
|
|
7127
|
-
type: String,
|
|
7128
|
-
reflect: true
|
|
7129
|
-
},
|
|
7130
|
-
|
|
7131
|
-
/**
|
|
7132
|
-
* Populates the `aria-expanded` attribute that indicates whether the element,
|
|
7133
|
-
* or another grouping element it controls, is currently expanded or collapsed.
|
|
7134
|
-
* This is an optional attribute for buttons.
|
|
7135
|
-
*/
|
|
7136
|
-
ariaexpanded: {
|
|
7137
|
-
type: Boolean,
|
|
7138
|
-
reflect: true
|
|
7139
|
-
},
|
|
7140
|
-
|
|
7141
7440
|
/**
|
|
7142
7441
|
* Sets title attribute. The information is most often shown as a tooltip text when the mouse moves over the element.
|
|
7143
7442
|
*/
|
|
7144
|
-
title:
|
|
7443
|
+
title: {
|
|
7145
7444
|
type: String,
|
|
7146
7445
|
reflect: true
|
|
7147
7446
|
},
|
|
@@ -7149,7 +7448,7 @@ class AuroButton extends i$2 {
|
|
|
7149
7448
|
/**
|
|
7150
7449
|
* The type of the button. Possible values are: `submit`, `reset`, `button`.
|
|
7151
7450
|
*/
|
|
7152
|
-
type:
|
|
7451
|
+
type: {
|
|
7153
7452
|
type: String,
|
|
7154
7453
|
reflect: true
|
|
7155
7454
|
},
|
|
@@ -7157,19 +7456,19 @@ class AuroButton extends i$2 {
|
|
|
7157
7456
|
/**
|
|
7158
7457
|
* Defines the value associated with the button which is submitted with the form data.
|
|
7159
7458
|
*/
|
|
7160
|
-
value:
|
|
7459
|
+
value: {
|
|
7161
7460
|
type: String,
|
|
7162
7461
|
reflect: true
|
|
7163
7462
|
},
|
|
7164
7463
|
|
|
7165
7464
|
/**
|
|
7166
|
-
* Sets button variant option.
|
|
7465
|
+
* Sets button variant option.
|
|
7466
|
+
* @default primary
|
|
7167
7467
|
*/
|
|
7168
|
-
variant:
|
|
7468
|
+
variant: {
|
|
7169
7469
|
type: String,
|
|
7170
7470
|
reflect: true
|
|
7171
7471
|
},
|
|
7172
|
-
ready: { type: Boolean },
|
|
7173
7472
|
};
|
|
7174
7473
|
}
|
|
7175
7474
|
|
|
@@ -7182,7 +7481,7 @@ class AuroButton extends i$2 {
|
|
|
7182
7481
|
*
|
|
7183
7482
|
*/
|
|
7184
7483
|
static register(name = "auro-button") {
|
|
7185
|
-
AuroLibraryRuntimeUtils$
|
|
7484
|
+
AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroButton);
|
|
7186
7485
|
}
|
|
7187
7486
|
|
|
7188
7487
|
/**
|
|
@@ -7194,17 +7493,6 @@ class AuroButton extends i$2 {
|
|
|
7194
7493
|
this.renderRoot.querySelector('button').focus();
|
|
7195
7494
|
}
|
|
7196
7495
|
|
|
7197
|
-
updated() {
|
|
7198
|
-
// support the old `secondary` and `tertiary` attributes` that are deprecated
|
|
7199
|
-
if (this.secondary) {
|
|
7200
|
-
this.setAttribute('variant', 'secondary');
|
|
7201
|
-
}
|
|
7202
|
-
|
|
7203
|
-
if (this.tertiary) {
|
|
7204
|
-
this.setAttribute('variant', 'tertiary');
|
|
7205
|
-
}
|
|
7206
|
-
}
|
|
7207
|
-
|
|
7208
7496
|
/**
|
|
7209
7497
|
* Submits the form that this button is associated with.
|
|
7210
7498
|
* @private
|
|
@@ -7225,25 +7513,56 @@ class AuroButton extends i$2 {
|
|
|
7225
7513
|
return this.internals ? this.internals.form : null;
|
|
7226
7514
|
}
|
|
7227
7515
|
|
|
7228
|
-
|
|
7516
|
+
/**
|
|
7517
|
+
* @private
|
|
7518
|
+
* @returns {Boolean}
|
|
7519
|
+
*/
|
|
7520
|
+
get hideText() {
|
|
7521
|
+
return ICON_ONLY_SHAPES.includes(this.shape);
|
|
7522
|
+
}
|
|
7523
|
+
|
|
7524
|
+
/**
|
|
7525
|
+
* Returns the current value of the projected `aria-label` attribute or undefined if not set.
|
|
7526
|
+
* @returns {string | undefined}
|
|
7527
|
+
* @private
|
|
7528
|
+
*/
|
|
7529
|
+
get currentAriaLabel() {
|
|
7530
|
+
if (!this.attributeWatcher) return undefined;
|
|
7531
|
+
|
|
7532
|
+
const ariaLabel = this.attributeWatcher.getObservedAttribute("aria-label");
|
|
7533
|
+
return ariaLabel || undefined;
|
|
7534
|
+
}
|
|
7535
|
+
|
|
7536
|
+
/**
|
|
7537
|
+
* Returns the current value of the projected `aria-labelledby` attribute or undefined if not set.
|
|
7538
|
+
* @returns {string | undefined}
|
|
7539
|
+
* @private
|
|
7540
|
+
*/
|
|
7541
|
+
get currentAriaLabelledBy() {
|
|
7542
|
+
if (!this.attributeWatcher) return undefined;
|
|
7543
|
+
|
|
7544
|
+
const ariaLabelledBy = this.attributeWatcher.getObservedAttribute("aria-labelledby");
|
|
7545
|
+
return ariaLabelledBy || undefined;
|
|
7546
|
+
}
|
|
7547
|
+
|
|
7548
|
+
/**
|
|
7549
|
+
* Renders the default layout for the button.
|
|
7550
|
+
* @returns {TemplateResult}
|
|
7551
|
+
* @private
|
|
7552
|
+
*/
|
|
7553
|
+
renderLayoutDefault() {
|
|
7229
7554
|
const classes = {
|
|
7230
|
-
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
'auro-button--slim': this.slim,
|
|
7235
|
-
'auro-button--iconOnly': this.iconOnly,
|
|
7236
|
-
'auro-button--iconOnlySlim': this.iconOnly && this.slim,
|
|
7237
|
-
'loading': this.loading
|
|
7555
|
+
"util_insetLg--squish": true,
|
|
7556
|
+
"auro-button": true,
|
|
7557
|
+
wrapper: true,
|
|
7558
|
+
loading: this.loading,
|
|
7238
7559
|
};
|
|
7239
7560
|
|
|
7240
7561
|
return u$2`
|
|
7241
7562
|
<button
|
|
7242
7563
|
part="button"
|
|
7243
|
-
aria-
|
|
7244
|
-
aria-
|
|
7245
|
-
aria-labelledby="${o(this.arialabelledby ? this.arialabelledby : undefined)}"
|
|
7246
|
-
aria-expanded="${o(this.ariaexpanded)}"
|
|
7564
|
+
aria-label="${o(this.loading ? this.loadingText : this.currentAriaLabel || undefined)}"
|
|
7565
|
+
aria-labelledby="${o(this.loading ? undefined : this.currentAriaLabelledBy || undefined)}"
|
|
7247
7566
|
tabIndex="${o(this.tIndex)}"
|
|
7248
7567
|
?autofocus="${this.autofocus}"
|
|
7249
7568
|
class="${e(classes)}"
|
|
@@ -7260,7 +7579,7 @@ class AuroButton extends i$2 {
|
|
|
7260
7579
|
|
|
7261
7580
|
<span class="contentWrapper">
|
|
7262
7581
|
<span class="textSlot" part="text">
|
|
7263
|
-
${this.
|
|
7582
|
+
${this.hideText ? undefined : u$2`<slot></slot>`}
|
|
7264
7583
|
</span>
|
|
7265
7584
|
|
|
7266
7585
|
<span part="icon">
|
|
@@ -7270,6 +7589,15 @@ class AuroButton extends i$2 {
|
|
|
7270
7589
|
</button>
|
|
7271
7590
|
`;
|
|
7272
7591
|
}
|
|
7592
|
+
|
|
7593
|
+
/**
|
|
7594
|
+
* Renders the layout of the button
|
|
7595
|
+
* @returns {TemplateResult}
|
|
7596
|
+
* @private
|
|
7597
|
+
*/
|
|
7598
|
+
renderLayout() {
|
|
7599
|
+
return this.renderLayoutDefault();
|
|
7600
|
+
}
|
|
7273
7601
|
}
|
|
7274
7602
|
|
|
7275
7603
|
var buttonVersion = '9.3.0';
|
|
@@ -7495,7 +7823,7 @@ class AuroInput extends BaseInput {
|
|
|
7495
7823
|
/**
|
|
7496
7824
|
* Generate unique names for dependency components.
|
|
7497
7825
|
*/
|
|
7498
|
-
const versioning = new AuroDependencyVersioning
|
|
7826
|
+
const versioning = new AuroDependencyVersioning();
|
|
7499
7827
|
|
|
7500
7828
|
/**
|
|
7501
7829
|
* @private
|
|
@@ -7616,7 +7944,7 @@ class AuroInput extends BaseInput {
|
|
|
7616
7944
|
*
|
|
7617
7945
|
*/
|
|
7618
7946
|
static register(name = "auro-input") {
|
|
7619
|
-
AuroLibraryRuntimeUtils$
|
|
7947
|
+
AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroInput);
|
|
7620
7948
|
}
|
|
7621
7949
|
|
|
7622
7950
|
/**
|
|
@@ -7746,11 +8074,12 @@ class AuroInput extends BaseInput {
|
|
|
7746
8074
|
?onDark="${this.onDark}"
|
|
7747
8075
|
aria-label="${i18n(this.lang, 'clearInput')}"
|
|
7748
8076
|
class="notificationBtn clearBtn"
|
|
7749
|
-
|
|
7750
|
-
|
|
8077
|
+
shape="circle"
|
|
8078
|
+
size="sm"
|
|
8079
|
+
variant="ghost">
|
|
7751
8080
|
<${this.iconTag}
|
|
8081
|
+
customColor="${this.onDark}"
|
|
7752
8082
|
category="interface"
|
|
7753
|
-
customColor
|
|
7754
8083
|
name="x-lg"
|
|
7755
8084
|
>
|
|
7756
8085
|
</${this.iconTag}>
|
|
@@ -7770,20 +8099,21 @@ class AuroInput extends BaseInput {
|
|
|
7770
8099
|
<${this.buttonTag}
|
|
7771
8100
|
@click="${this.handleClickShowPassword}"
|
|
7772
8101
|
?onDark="${this.onDark}"
|
|
7773
|
-
aria-hidden="true"
|
|
7774
8102
|
class="notificationBtn passwordBtn"
|
|
7775
|
-
|
|
7776
|
-
|
|
8103
|
+
aria-label="${this.showPassword ? i18n(this.lang, "hidePassword") : i18n(this.lang, "showPassword")}"
|
|
8104
|
+
shape="circle"
|
|
8105
|
+
size="sm"
|
|
8106
|
+
variant="ghost">
|
|
7777
8107
|
<${this.iconTag}
|
|
8108
|
+
customColor="${this.onDark}"
|
|
7778
8109
|
?hidden=${!this.showPassword}
|
|
7779
8110
|
category="interface"
|
|
7780
|
-
customColor
|
|
7781
8111
|
name="hide-password-stroke">
|
|
7782
8112
|
</${this.iconTag}>
|
|
7783
8113
|
<${this.iconTag}
|
|
8114
|
+
customColor="${this.onDark}"
|
|
7784
8115
|
?hidden=${this.showPassword}
|
|
7785
8116
|
category="interface"
|
|
7786
|
-
customColor
|
|
7787
8117
|
name="view-password-stroke">
|
|
7788
8118
|
</${this.iconTag}>
|
|
7789
8119
|
</${this.buttonTag}>
|