@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
|
@@ -85,6 +85,8 @@ const stringsES = {
|
|
|
85
85
|
'dateMM': 'Ingrese una fecha completa en el formato MM',
|
|
86
86
|
'dateDD': 'Ingrese una fecha completa en el formato DD',
|
|
87
87
|
'clearInput': 'Borrar campo de entrada',
|
|
88
|
+
'showPassword': 'Mostrar contraseña',
|
|
89
|
+
'hidePassword': 'Ocultar contraseña'
|
|
88
90
|
};
|
|
89
91
|
|
|
90
92
|
const stringsEN = {
|
|
@@ -109,6 +111,8 @@ const stringsEN = {
|
|
|
109
111
|
'dateMM': 'Please enter a complete date in the format MM',
|
|
110
112
|
'dateDD': 'Please enter a complete date in the format DD',
|
|
111
113
|
'clearInput': 'Clear input field',
|
|
114
|
+
'showPassword': 'Show password',
|
|
115
|
+
'hidePassword': 'Hide password'
|
|
112
116
|
};
|
|
113
117
|
|
|
114
118
|
/**
|
|
@@ -4403,7 +4407,7 @@ const {
|
|
|
4403
4407
|
|
|
4404
4408
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
4405
4409
|
|
|
4406
|
-
let AuroLibraryRuntimeUtils$
|
|
4410
|
+
let AuroLibraryRuntimeUtils$3 = class AuroLibraryRuntimeUtils {
|
|
4407
4411
|
|
|
4408
4412
|
/* eslint-disable jsdoc/require-param */
|
|
4409
4413
|
|
|
@@ -4473,7 +4477,7 @@ let AuroLibraryRuntimeUtils$4 = class AuroLibraryRuntimeUtils {
|
|
|
4473
4477
|
class AuroFormValidation {
|
|
4474
4478
|
|
|
4475
4479
|
constructor() {
|
|
4476
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
4480
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$3();
|
|
4477
4481
|
}
|
|
4478
4482
|
|
|
4479
4483
|
/**
|
|
@@ -4834,7 +4838,7 @@ class AuroFormValidation {
|
|
|
4834
4838
|
}
|
|
4835
4839
|
}
|
|
4836
4840
|
|
|
4837
|
-
let AuroElement$
|
|
4841
|
+
let AuroElement$2 = class AuroElement extends LitElement {
|
|
4838
4842
|
static get properties() {
|
|
4839
4843
|
return {
|
|
4840
4844
|
|
|
@@ -4954,7 +4958,7 @@ let AuroElement$1 = class AuroElement extends LitElement {
|
|
|
4954
4958
|
* @event auroFormElement-validated - Notifies that the `validity` and `errorMessage` value has changed.
|
|
4955
4959
|
*/
|
|
4956
4960
|
|
|
4957
|
-
class BaseInput extends AuroElement$
|
|
4961
|
+
class BaseInput extends AuroElement$2 {
|
|
4958
4962
|
|
|
4959
4963
|
constructor() {
|
|
4960
4964
|
super();
|
|
@@ -6017,7 +6021,7 @@ class BaseInput extends AuroElement$1 {
|
|
|
6017
6021
|
// See LICENSE in the project root for license information.
|
|
6018
6022
|
|
|
6019
6023
|
|
|
6020
|
-
|
|
6024
|
+
class AuroDependencyVersioning {
|
|
6021
6025
|
|
|
6022
6026
|
/**
|
|
6023
6027
|
* Generates a unique string to be used for child auro element naming.
|
|
@@ -6051,7 +6055,7 @@ let AuroDependencyVersioning$1 = class AuroDependencyVersioning {
|
|
|
6051
6055
|
|
|
6052
6056
|
return tag;
|
|
6053
6057
|
}
|
|
6054
|
-
}
|
|
6058
|
+
}
|
|
6055
6059
|
|
|
6056
6060
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
6057
6061
|
// See LICENSE in the project root for license information.
|
|
@@ -6063,7 +6067,7 @@ let AuroDependencyVersioning$1 = class AuroDependencyVersioning {
|
|
|
6063
6067
|
* @attr {Boolean} hiddenAudible - If present, the component will be hidden from screen readers, but seen visually
|
|
6064
6068
|
*/
|
|
6065
6069
|
|
|
6066
|
-
class AuroElement extends LitElement {
|
|
6070
|
+
let AuroElement$1 = class AuroElement extends LitElement {
|
|
6067
6071
|
|
|
6068
6072
|
// function to define props used within the scope of this component
|
|
6069
6073
|
static get properties() {
|
|
@@ -6087,7 +6091,7 @@ class AuroElement extends LitElement {
|
|
|
6087
6091
|
|
|
6088
6092
|
return 'false'
|
|
6089
6093
|
}
|
|
6090
|
-
}
|
|
6094
|
+
};
|
|
6091
6095
|
|
|
6092
6096
|
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>"};
|
|
6093
6097
|
|
|
@@ -6131,7 +6135,7 @@ var styleCss$3 = css`:focus:not(:focus-visible){outline:3px solid transparent}.u
|
|
|
6131
6135
|
*/
|
|
6132
6136
|
|
|
6133
6137
|
// build the component class
|
|
6134
|
-
class BaseIcon extends AuroElement {
|
|
6138
|
+
class BaseIcon extends AuroElement$1 {
|
|
6135
6139
|
constructor() {
|
|
6136
6140
|
super();
|
|
6137
6141
|
this.onDark = false;
|
|
@@ -6214,7 +6218,7 @@ var colorCss$3 = css`:host{color:var(--ds-auro-icon-color)}:host([customColor]){
|
|
|
6214
6218
|
|
|
6215
6219
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
6216
6220
|
|
|
6217
|
-
let AuroLibraryRuntimeUtils$
|
|
6221
|
+
let AuroLibraryRuntimeUtils$2 = class AuroLibraryRuntimeUtils {
|
|
6218
6222
|
|
|
6219
6223
|
/* eslint-disable jsdoc/require-param */
|
|
6220
6224
|
|
|
@@ -6296,7 +6300,7 @@ class AuroIcon extends BaseIcon {
|
|
|
6296
6300
|
*/
|
|
6297
6301
|
privateDefaults() {
|
|
6298
6302
|
this.uri = 'https://cdn.jsdelivr.net/npm/@alaskaairux/icons@latest/dist';
|
|
6299
|
-
this.runtimeUtils = new AuroLibraryRuntimeUtils$
|
|
6303
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$2();
|
|
6300
6304
|
}
|
|
6301
6305
|
|
|
6302
6306
|
// function to define props used within the scope of this component
|
|
@@ -6378,7 +6382,7 @@ class AuroIcon extends BaseIcon {
|
|
|
6378
6382
|
*
|
|
6379
6383
|
*/
|
|
6380
6384
|
static register(name = "auro-icon") {
|
|
6381
|
-
AuroLibraryRuntimeUtils$
|
|
6385
|
+
AuroLibraryRuntimeUtils$2.prototype.registerComponent(name, AuroIcon);
|
|
6382
6386
|
}
|
|
6383
6387
|
|
|
6384
6388
|
connectedCallback() {
|
|
@@ -6399,8 +6403,12 @@ class AuroIcon extends BaseIcon {
|
|
|
6399
6403
|
async firstUpdated() {
|
|
6400
6404
|
await super.firstUpdated();
|
|
6401
6405
|
|
|
6402
|
-
|
|
6403
|
-
|
|
6406
|
+
/**
|
|
6407
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
6408
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
6409
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
6410
|
+
*/
|
|
6411
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
6404
6412
|
const svgDesc = this.svg.querySelector('desc');
|
|
6405
6413
|
|
|
6406
6414
|
if (svgDesc) {
|
|
@@ -6446,121 +6454,479 @@ class AuroIcon extends BaseIcon {
|
|
|
6446
6454
|
|
|
6447
6455
|
var iconVersion = '8.0.1';
|
|
6448
6456
|
|
|
6449
|
-
|
|
6450
|
-
|
|
6457
|
+
/**
|
|
6458
|
+
* Private module-level WeakMap to hold MutationObservers for each host element.
|
|
6459
|
+
*/
|
|
6460
|
+
const _observers = new WeakMap();
|
|
6451
6461
|
|
|
6462
|
+
/**
|
|
6463
|
+
* Private module-level WeakMap to hold attribute matchers and targets for each host element.
|
|
6464
|
+
* Structure: {
|
|
6465
|
+
* host: {
|
|
6466
|
+
* matchers: Set<Function>,
|
|
6467
|
+
* targets: Map<HTMLElement, Map<Function, {removeOriginal: boolean, currentAttributes: Map<string, string>}>>
|
|
6468
|
+
* }
|
|
6469
|
+
* }
|
|
6470
|
+
*/
|
|
6471
|
+
const _transportConfig = new WeakMap();
|
|
6452
6472
|
|
|
6453
|
-
|
|
6473
|
+
/**
|
|
6474
|
+
* Transfers all matching attributes from a host element to a target element and observes for future changes.
|
|
6475
|
+
*
|
|
6476
|
+
* @param {Object} params - The parameters for the function.
|
|
6477
|
+
* @param {HTMLElement} params.host - The host element from which attributes will be transported.
|
|
6478
|
+
* @param {HTMLElement} params.target - The target element to which attributes will be transported.
|
|
6479
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove the attributes from the host element.
|
|
6480
|
+
* @param {boolean} [params.observe=true] - Whether to attach a MutationObserver to the host element.
|
|
6481
|
+
* @returns {Function} A function to detach the observer when no longer needed.
|
|
6482
|
+
* @throws {TypeError} If the host or target parameters are not instances of HTMLElement.
|
|
6483
|
+
*/
|
|
6484
|
+
const transportAttributes = ({ host, target, match, removeOriginal = true }) => {
|
|
6485
|
+
// Guard Clause: Ensure host is valid HTMLElement instance
|
|
6486
|
+
if (typeof host !== 'object' || !(host instanceof HTMLElement)) {
|
|
6487
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "host" parameter must be an instance of HTMLElement.');
|
|
6488
|
+
}
|
|
6454
6489
|
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
* @param {string} version - Version of the component that will be appended to the baseName.
|
|
6460
|
-
* @returns {string} - Unique string to be used for naming.
|
|
6461
|
-
*/
|
|
6462
|
-
generateElementName(baseName, version) {
|
|
6463
|
-
let result = baseName;
|
|
6490
|
+
// Guard Clause: Ensure target is valid HTMLElement instance
|
|
6491
|
+
if (typeof target !== 'object' || !(target instanceof HTMLElement)) {
|
|
6492
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "target" parameter must be an instance of HTMLElement.');
|
|
6493
|
+
}
|
|
6464
6494
|
|
|
6465
|
-
|
|
6466
|
-
|
|
6495
|
+
// Guard Clause: Ensure match is a function
|
|
6496
|
+
if (typeof match !== 'function') {
|
|
6497
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "match" parameter must be a function.');
|
|
6498
|
+
}
|
|
6467
6499
|
|
|
6468
|
-
|
|
6500
|
+
// Guard Clause: Ensure removeOriginal is a boolean
|
|
6501
|
+
if (typeof removeOriginal !== 'boolean') {
|
|
6502
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "removeOriginal" parameter must be a boolean.');
|
|
6469
6503
|
}
|
|
6504
|
+
|
|
6505
|
+
// Register this transport and get cleanup function
|
|
6506
|
+
return _registerTransport({
|
|
6507
|
+
host,
|
|
6508
|
+
target,
|
|
6509
|
+
matcher: match,
|
|
6510
|
+
removeOriginal
|
|
6511
|
+
});
|
|
6512
|
+
};
|
|
6470
6513
|
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6514
|
+
/**
|
|
6515
|
+
* Registers a matcher and target for a host element and attaches an observer if needed.
|
|
6516
|
+
*
|
|
6517
|
+
* @param {Object} params - The parameters object.
|
|
6518
|
+
* @param {HTMLElement} params.host - The host element to observe.
|
|
6519
|
+
* @param {HTMLElement} params.target - The target element to receive attributes.
|
|
6520
|
+
* @param {Function} params.matcher - Function that determines which attributes to transport.
|
|
6521
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove original attributes.
|
|
6522
|
+
* @param {boolean} [params.observe=true] - Whether to observe for attribute changes.
|
|
6523
|
+
* @returns {Function} Function to detach the specific matcher and target pairing.
|
|
6524
|
+
* @private
|
|
6525
|
+
*/
|
|
6526
|
+
const _registerTransport = ({ host, target, matcher, removeOriginal = true }) => {
|
|
6527
|
+
// Initialize config for this host if it doesn't exist
|
|
6528
|
+
if (!_transportConfig.has(host)) {
|
|
6529
|
+
_transportConfig.set(host, {
|
|
6530
|
+
matchers: new Set(),
|
|
6531
|
+
targets: new Map()
|
|
6532
|
+
});
|
|
6533
|
+
}
|
|
6480
6534
|
|
|
6481
|
-
|
|
6482
|
-
|
|
6535
|
+
const config = _transportConfig.get(host);
|
|
6536
|
+
|
|
6537
|
+
// Add the matcher to the set of matchers for this host
|
|
6538
|
+
config.matchers.add(matcher);
|
|
6539
|
+
|
|
6540
|
+
// Initialize target entry if it doesn't exist
|
|
6541
|
+
if (!config.targets.has(target)) {
|
|
6542
|
+
config.targets.set(target, new Map());
|
|
6543
|
+
}
|
|
6544
|
+
|
|
6545
|
+
// Store the matcher with its removeOriginal setting for this target
|
|
6546
|
+
config.targets.get(target).set(matcher, {
|
|
6547
|
+
removeOriginal,
|
|
6548
|
+
currentAttributes: new Map()
|
|
6549
|
+
});
|
|
6550
|
+
|
|
6551
|
+
// Perform initial attribute transport
|
|
6552
|
+
_transportAttributes({ host, target, matcher, removeOriginal });
|
|
6553
|
+
|
|
6554
|
+
// Attach observer
|
|
6555
|
+
_attachObserver(host);
|
|
6556
|
+
|
|
6557
|
+
// Return cleanup function and utility functions
|
|
6558
|
+
return {
|
|
6559
|
+
cleanup: () => _cleanupTransport(host, target, matcher),
|
|
6560
|
+
getObservedAttributes: () => _getObservedAttributes(host, target, matcher),
|
|
6561
|
+
getObservedAttribute: (attr) => _getObservedAttribute(host, target, matcher, attr),
|
|
6562
|
+
}
|
|
6563
|
+
};
|
|
6564
|
+
|
|
6565
|
+
/**
|
|
6566
|
+
* Cleans up resources associated with a specific matcher and target for a host element.
|
|
6567
|
+
*
|
|
6568
|
+
* @param {HTMLElement} host - The host element
|
|
6569
|
+
* @param {HTMLElement} target - The target element
|
|
6570
|
+
* @param {Function} matcher - The matcher function
|
|
6571
|
+
* @private
|
|
6572
|
+
*/
|
|
6573
|
+
const _cleanupTransport = (host, target, matcher) => {
|
|
6574
|
+
const config = _transportConfig.get(host);
|
|
6575
|
+
if (!config) return;
|
|
6576
|
+
|
|
6577
|
+
// Remove this matcher from this target
|
|
6578
|
+
const targetMatchers = config.targets.get(target);
|
|
6579
|
+
if (targetMatchers) {
|
|
6580
|
+
targetMatchers.delete(matcher);
|
|
6581
|
+
|
|
6582
|
+
// If this target has no more matchers, remove it
|
|
6583
|
+
if (targetMatchers.size === 0) {
|
|
6584
|
+
config.targets.delete(target);
|
|
6585
|
+
}
|
|
6586
|
+
}
|
|
6587
|
+
|
|
6588
|
+
// Check if this matcher is still used by any target
|
|
6589
|
+
let matcherStillUsed = false;
|
|
6590
|
+
for (const matcherMap of config.targets.values()) {
|
|
6591
|
+
if (matcherMap.has(matcher)) {
|
|
6592
|
+
matcherStillUsed = true;
|
|
6593
|
+
break;
|
|
6594
|
+
}
|
|
6595
|
+
}
|
|
6596
|
+
|
|
6597
|
+
// If not used anymore, remove from matchers set
|
|
6598
|
+
if (!matcherStillUsed) {
|
|
6599
|
+
config.matchers.delete(matcher);
|
|
6600
|
+
}
|
|
6601
|
+
|
|
6602
|
+
// If no more targets or matchers, detach observer
|
|
6603
|
+
if (config.targets.size === 0 || config.matchers.size === 0) {
|
|
6604
|
+
_detachObserver(host);
|
|
6605
|
+
}
|
|
6606
|
+
};
|
|
6607
|
+
|
|
6608
|
+
/**
|
|
6609
|
+
* Generic function to transport attributes from a host element to a target element.
|
|
6610
|
+
*
|
|
6611
|
+
* @param {Object} params - The parameters object.
|
|
6612
|
+
* @param {HTMLElement} params.host - The host element from which to transport attributes.
|
|
6613
|
+
* @param {HTMLElement} params.target - The target element to which attributes will be transported.
|
|
6614
|
+
* @param {Function} params.matcher - Function that takes an attribute name and returns true if it should be transported.
|
|
6615
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove original attributes from host.
|
|
6616
|
+
* @returns {void}
|
|
6617
|
+
* @private
|
|
6618
|
+
*/
|
|
6619
|
+
const _transportAttributes = ({ host, target, matcher, removeOriginal = true }) => {
|
|
6620
|
+
// Get a list of all matching attributes on the host element and their values
|
|
6621
|
+
const matchingAttributes = host.getAttributeNames()
|
|
6622
|
+
.filter(attr => matcher(attr))
|
|
6623
|
+
.reduce((acc, attr) => {
|
|
6624
|
+
acc[attr] = host.getAttribute(attr);
|
|
6625
|
+
return acc;
|
|
6626
|
+
}, {});
|
|
6627
|
+
|
|
6628
|
+
// Move matching attributes to the target element, removing them from the host if removeOriginal is true
|
|
6629
|
+
Object.entries(matchingAttributes).forEach(([key, value]) => {
|
|
6630
|
+
_setObservedAttribute(host, target, matcher, key, value);
|
|
6631
|
+
target.setAttribute(key, value);
|
|
6632
|
+
if (removeOriginal) {
|
|
6633
|
+
host.removeAttribute(key);
|
|
6483
6634
|
}
|
|
6635
|
+
});
|
|
6636
|
+
};
|
|
6484
6637
|
|
|
6485
|
-
|
|
6638
|
+
/**
|
|
6639
|
+
* Attaches a MutationObserver to the host element to monitor attribute changes.
|
|
6640
|
+
*
|
|
6641
|
+
* @param {HTMLElement} host - The element to observe for attribute changes.
|
|
6642
|
+
* @returns {MutationObserver} The observer instance.
|
|
6643
|
+
* @private
|
|
6644
|
+
*/
|
|
6645
|
+
const _attachObserver = (host) => {
|
|
6646
|
+
// If an observer for this host already exists, return it
|
|
6647
|
+
if (_observers.has(host)) {
|
|
6648
|
+
return _observers.get(host);
|
|
6649
|
+
}
|
|
6650
|
+
|
|
6651
|
+
// Create a new MutationObserver
|
|
6652
|
+
const observer = new MutationObserver((mutations) => {
|
|
6653
|
+
const config = _transportConfig.get(host);
|
|
6654
|
+
if (!config) return;
|
|
6655
|
+
|
|
6656
|
+
// For each mutation affecting attributes
|
|
6657
|
+
mutations
|
|
6658
|
+
.filter(mutation => mutation.type === 'attributes')
|
|
6659
|
+
.forEach(mutation => {
|
|
6660
|
+
const attributeName = mutation.attributeName;
|
|
6661
|
+
|
|
6662
|
+
// Find matchers that care about this attribute
|
|
6663
|
+
for (const matcher of config.matchers) {
|
|
6664
|
+
if (matcher(attributeName)) {
|
|
6665
|
+
// For each target that uses this matcher
|
|
6666
|
+
for (const [target, matcherConfigs] of config.targets.entries()) {
|
|
6667
|
+
if (matcherConfigs.has(matcher)) {
|
|
6668
|
+
const { removeOriginal } = matcherConfigs.get(matcher);
|
|
6669
|
+
_transportAttributes({
|
|
6670
|
+
host,
|
|
6671
|
+
target,
|
|
6672
|
+
matcher,
|
|
6673
|
+
removeOriginal
|
|
6674
|
+
});
|
|
6675
|
+
}
|
|
6676
|
+
}
|
|
6677
|
+
}
|
|
6678
|
+
}
|
|
6679
|
+
});
|
|
6680
|
+
});
|
|
6681
|
+
|
|
6682
|
+
// Start observing attribute changes
|
|
6683
|
+
observer.observe(host, { attributes: true });
|
|
6684
|
+
|
|
6685
|
+
// Store the observer
|
|
6686
|
+
_observers.set(host, observer);
|
|
6687
|
+
|
|
6688
|
+
return observer;
|
|
6689
|
+
};
|
|
6690
|
+
|
|
6691
|
+
/**
|
|
6692
|
+
* Detaches and cleans up the MutationObserver for a given host element.
|
|
6693
|
+
*
|
|
6694
|
+
* @param {HTMLElement} host - The element whose observer should be detached.
|
|
6695
|
+
* @private
|
|
6696
|
+
*/
|
|
6697
|
+
const _detachObserver = (host) => {
|
|
6698
|
+
if (_observers.has(host)) {
|
|
6699
|
+
const observer = _observers.get(host);
|
|
6700
|
+
observer.disconnect();
|
|
6701
|
+
_observers.delete(host);
|
|
6486
6702
|
}
|
|
6487
|
-
|
|
6703
|
+
|
|
6704
|
+
// Clean up the transport config as well
|
|
6705
|
+
if (_transportConfig.has(host)) {
|
|
6706
|
+
_transportConfig.delete(host);
|
|
6707
|
+
}
|
|
6708
|
+
};
|
|
6488
6709
|
|
|
6489
|
-
|
|
6490
|
-
|
|
6710
|
+
/**
|
|
6711
|
+
* Gets the matcher configuration for a specific host, target, and matcher
|
|
6712
|
+
* @param {HTMLElement} host - The host element
|
|
6713
|
+
* @param {HTMLElement} target - The target element
|
|
6714
|
+
* @param {Function} matcher - The matcher function
|
|
6715
|
+
* @returns {Object|undefined} The matcher configuration if found
|
|
6716
|
+
* @private
|
|
6717
|
+
*/
|
|
6718
|
+
const _getMatcherConfig = (host, target, matcher) => {
|
|
6719
|
+
const config = _transportConfig.get(host);
|
|
6720
|
+
if (!config) return undefined;
|
|
6721
|
+
|
|
6722
|
+
const targetMatchers = config.targets.get(target);
|
|
6723
|
+
if (!targetMatchers) return undefined;
|
|
6724
|
+
|
|
6725
|
+
return targetMatchers.get(matcher);
|
|
6726
|
+
};
|
|
6491
6727
|
|
|
6492
|
-
|
|
6728
|
+
/**
|
|
6729
|
+
* Sets an observed attribute value
|
|
6730
|
+
* @param {HTMLElement} host - The host element
|
|
6731
|
+
* @param {HTMLElement} target - The target element
|
|
6732
|
+
* @param {Function} matcher - The matcher function
|
|
6733
|
+
* @param {string} key - The attribute name
|
|
6734
|
+
* @param {string} value - The attribute value
|
|
6735
|
+
* @private
|
|
6736
|
+
*/
|
|
6737
|
+
const _setObservedAttribute = (host, target, matcher, key, value) => {
|
|
6738
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
6739
|
+
if (matcherConfig) {
|
|
6740
|
+
matcherConfig.currentAttributes.set(key, value);
|
|
6741
|
+
}
|
|
6742
|
+
};
|
|
6493
6743
|
|
|
6494
|
-
|
|
6744
|
+
const _getObservedAttribute = (host, target, matcher, attr) => {
|
|
6745
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
6746
|
+
if (matcherConfig) return matcherConfig.currentAttributes.get(attr);
|
|
6747
|
+
return undefined;
|
|
6748
|
+
};
|
|
6495
6749
|
|
|
6496
|
-
|
|
6750
|
+
const _getObservedAttributes = (host, target, matcher) => {
|
|
6751
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
6752
|
+
if (matcherConfig) return Array.from(matcherConfig.currentAttributes.entries());
|
|
6753
|
+
return [];
|
|
6754
|
+
};
|
|
6497
6755
|
|
|
6498
|
-
|
|
6756
|
+
const _matchers = {
|
|
6757
|
+
'aria-': attr => attr.startsWith('aria-'),
|
|
6758
|
+
'role': attr => attr.match(/^role$/)
|
|
6759
|
+
};
|
|
6760
|
+
|
|
6761
|
+
const transportAllA11yAttributes = ({ host, target, removeOriginal = true }) => {
|
|
6762
|
+
return transportAttributes({
|
|
6763
|
+
host,
|
|
6764
|
+
target,
|
|
6765
|
+
match: attr => {
|
|
6766
|
+
for (const key in _matchers) {
|
|
6767
|
+
if (_matchers[key](attr)) return true;
|
|
6768
|
+
}
|
|
6769
|
+
return false;
|
|
6770
|
+
},
|
|
6771
|
+
removeOriginal
|
|
6772
|
+
});
|
|
6773
|
+
};
|
|
6774
|
+
|
|
6775
|
+
class AuroElement extends LitElement {
|
|
6499
6776
|
|
|
6500
6777
|
/**
|
|
6501
|
-
*
|
|
6502
|
-
* @
|
|
6503
|
-
* @
|
|
6504
|
-
* @
|
|
6778
|
+
* @type {Object} return object from transportAttributes via a11yUtilities
|
|
6779
|
+
* @property {Function} cleanup - Function to clean up the attribute watcher.
|
|
6780
|
+
* @property {Function} getCurrentAttributes - Function to get the current attributes being watched and their values.
|
|
6781
|
+
* @property {Function} getObservedAttribute - Function to get the value of a specific observed attribute by name.
|
|
6782
|
+
* @private
|
|
6505
6783
|
*/
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6784
|
+
attributeWatcher;
|
|
6785
|
+
|
|
6786
|
+
static get properties() {
|
|
6787
|
+
return {
|
|
6788
|
+
|
|
6789
|
+
/**
|
|
6790
|
+
* Defines the layout of an element.
|
|
6791
|
+
* @default {'default'}
|
|
6792
|
+
*/
|
|
6793
|
+
layout: {
|
|
6794
|
+
type: String,
|
|
6795
|
+
attribute: "layout",
|
|
6796
|
+
reflect: true
|
|
6797
|
+
},
|
|
6798
|
+
|
|
6799
|
+
/**
|
|
6800
|
+
* Defines the shape of an element.
|
|
6801
|
+
* @property {'default', 'rounded', 'pill', 'circle'}
|
|
6802
|
+
* @default {'default'}
|
|
6803
|
+
*/
|
|
6804
|
+
shape: {
|
|
6805
|
+
type: String,
|
|
6806
|
+
attribute: "shape",
|
|
6807
|
+
reflect: true
|
|
6808
|
+
},
|
|
6809
|
+
|
|
6810
|
+
/**
|
|
6811
|
+
* Defines the size of an element.
|
|
6812
|
+
* @property {'xs', 'sm', 'md', 'lg', 'xl'}
|
|
6813
|
+
* @default {'md'}
|
|
6814
|
+
*/
|
|
6815
|
+
size: {
|
|
6816
|
+
type: String,
|
|
6817
|
+
attribute: "size",
|
|
6818
|
+
reflect: true
|
|
6819
|
+
},
|
|
6820
|
+
|
|
6821
|
+
/**
|
|
6822
|
+
* This Boolean attribute lets you specify that the element should be rendered in dark mode.
|
|
6823
|
+
* @default {false}
|
|
6824
|
+
*/
|
|
6825
|
+
onDark: {
|
|
6826
|
+
type: Boolean,
|
|
6827
|
+
attribute: "ondark",
|
|
6828
|
+
reflect: true
|
|
6829
|
+
},
|
|
6830
|
+
|
|
6831
|
+
/**
|
|
6832
|
+
* A reference to the wrapper element in the shadow DOM.
|
|
6833
|
+
* This is used to apply layout and shape classes dynamically.
|
|
6834
|
+
* @type {HTMLElement|null}
|
|
6835
|
+
* @default {null}
|
|
6836
|
+
* @private
|
|
6837
|
+
*/
|
|
6838
|
+
wrapper: {
|
|
6839
|
+
type: HTMLElement,
|
|
6840
|
+
attribute: false,
|
|
6841
|
+
reflect: false
|
|
6842
|
+
}
|
|
6843
|
+
};
|
|
6844
|
+
}
|
|
6845
|
+
|
|
6846
|
+
|
|
6847
|
+
|
|
6848
|
+
resetShapeClasses() {
|
|
6849
|
+
if (this.shape && this.size) {
|
|
6850
|
+
|
|
6851
|
+
if (this.wrapper) {
|
|
6852
|
+
this.wrapper.classList.forEach((className) => {
|
|
6853
|
+
if (className.startsWith('shape-')) {
|
|
6854
|
+
this.wrapper.classList.remove(className);
|
|
6855
|
+
}
|
|
6856
|
+
});
|
|
6857
|
+
|
|
6858
|
+
this.wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
6859
|
+
}
|
|
6509
6860
|
}
|
|
6510
6861
|
}
|
|
6511
6862
|
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
6525
|
-
) {
|
|
6526
|
-
return __Closest(base);
|
|
6863
|
+
resetLayoutClasses() {
|
|
6864
|
+
if (this.layout) {
|
|
6865
|
+
if (this.wrapper) {
|
|
6866
|
+
this.wrapper.classList.forEach((className) => {
|
|
6867
|
+
if (className.startsWith('layout-')) {
|
|
6868
|
+
this.wrapper.classList.remove(className);
|
|
6869
|
+
}
|
|
6870
|
+
});
|
|
6871
|
+
|
|
6872
|
+
this.wrapper.classList.add(`layout-${this.layout.toLowerCase()}`);
|
|
6873
|
+
}
|
|
6874
|
+
}
|
|
6527
6875
|
}
|
|
6528
|
-
/* eslint-enable jsdoc/require-param */
|
|
6529
6876
|
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
* @returns {void}
|
|
6535
|
-
*/
|
|
6536
|
-
handleComponentTagRename(elem, tagName) {
|
|
6537
|
-
const tag = tagName.toLowerCase();
|
|
6538
|
-
const elemTag = elem.tagName.toLowerCase();
|
|
6877
|
+
updateComponentArchitecture() {
|
|
6878
|
+
this.resetLayoutClasses();
|
|
6879
|
+
this.resetShapeClasses();
|
|
6880
|
+
}
|
|
6539
6881
|
|
|
6540
|
-
|
|
6541
|
-
|
|
6882
|
+
updated(changedProperties) {
|
|
6883
|
+
if (changedProperties.has('layout') || changedProperties.has('shape') || changedProperties.has('size')) {
|
|
6884
|
+
this.updateComponentArchitecture();
|
|
6542
6885
|
}
|
|
6543
6886
|
}
|
|
6544
6887
|
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
* @param {Object} elem - The element to validate.
|
|
6548
|
-
* @param {String} tagName - The name of the Auro component to check against.
|
|
6549
|
-
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
6550
|
-
*/
|
|
6551
|
-
elementMatch(elem, tagName) {
|
|
6552
|
-
const tag = tagName.toLowerCase();
|
|
6553
|
-
const elemTag = elem.tagName.toLowerCase();
|
|
6888
|
+
firstUpdated() {
|
|
6889
|
+
super.firstUpdated();
|
|
6554
6890
|
|
|
6555
|
-
|
|
6891
|
+
// Set a reference to the wrapper element in the shadow DOM
|
|
6892
|
+
this.wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
6893
|
+
|
|
6894
|
+
// Initialize the transportation of ARIA attributes to the target element and get the disconnect function for cleanup
|
|
6895
|
+
this.attributeWatcher = transportAllA11yAttributes({ host: this, target: this.shadowRoot.querySelector('.wrapper') });
|
|
6556
6896
|
}
|
|
6557
|
-
};
|
|
6558
6897
|
|
|
6559
|
-
|
|
6898
|
+
disconnectedCallback() {
|
|
6899
|
+
super.disconnectedCallback();
|
|
6900
|
+
|
|
6901
|
+
// Cleanup the ARIA observer if it exists
|
|
6902
|
+
if (this.attributeWatcher) {
|
|
6903
|
+
this.attributeWatcher.cleanup();
|
|
6904
|
+
this.attributeWatcher = null;
|
|
6905
|
+
}
|
|
6906
|
+
}
|
|
6907
|
+
|
|
6908
|
+
// Try to render the defined `this.layout` layout. If that fails, fall back to the default layout.
|
|
6909
|
+
// This will catch if an invalid layout value is passed in and render the default layout if so.
|
|
6910
|
+
render() {
|
|
6911
|
+
try {
|
|
6912
|
+
return this.renderLayout();
|
|
6913
|
+
} catch (error) {
|
|
6914
|
+
// failed to get the defined layout
|
|
6915
|
+
console.error('Failed to get the defined layout - using the default layout', error); // eslint-disable-line no-console
|
|
6916
|
+
|
|
6917
|
+
// fallback to the default layout
|
|
6918
|
+
return this.getLayout('default');
|
|
6919
|
+
}
|
|
6920
|
+
}
|
|
6921
|
+
}
|
|
6922
|
+
|
|
6923
|
+
var styleCss$2 = css`: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}`;
|
|
6924
|
+
|
|
6925
|
+
var colorCss$2 = css`[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)}`;
|
|
6560
6926
|
|
|
6561
|
-
var
|
|
6927
|
+
var tokensCss$2 = css`: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}`;
|
|
6562
6928
|
|
|
6563
|
-
var
|
|
6929
|
+
var shapeSize = css`.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}`;
|
|
6564
6930
|
|
|
6565
6931
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
6566
6932
|
// See LICENSE in the project root for license information.
|
|
@@ -6779,7 +7145,7 @@ class AuroLoader extends LitElement {
|
|
|
6779
7145
|
|
|
6780
7146
|
var loaderVersion = '5.0.0';
|
|
6781
7147
|
|
|
6782
|
-
/* eslint-disable max-lines */
|
|
7148
|
+
/* eslint-disable max-lines, curly */
|
|
6783
7149
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
6784
7150
|
// See LICENSE in the project root for license information.
|
|
6785
7151
|
|
|
@@ -6795,7 +7161,18 @@ var loaderVersion = '5.0.0';
|
|
|
6795
7161
|
|
|
6796
7162
|
/* eslint-disable lit/no-invalid-html, lit/binding-positions */
|
|
6797
7163
|
|
|
6798
|
-
|
|
7164
|
+
const ICON_ONLY_SHAPES = ['circle'];
|
|
7165
|
+
|
|
7166
|
+
/**
|
|
7167
|
+
* AuroButton is a custom element that provides a styled, accessible button with support for various states and form association.
|
|
7168
|
+
* It is designed to be flexible, supporting loading states, icon slots, and integration with HTML5 forms.
|
|
7169
|
+
* @property {'default', 'rounded', 'pill', 'circle'} shape - Defines the shape of the button.
|
|
7170
|
+
* @property {'xs', 'sm', 'md', 'lg', 'xl'} size - Defines the size of the button.
|
|
7171
|
+
* @property {'primary', 'secondary', 'tertiary', 'ghost', 'flat'} variant - Sets the button variant.
|
|
7172
|
+
* @property {'submit', 'reset', 'button'} type - The type of button. Matches HTML5 Button Spec.
|
|
7173
|
+
* @property {boolean} onDark - Indicates if the button is rendered in dark mode.
|
|
7174
|
+
*/
|
|
7175
|
+
class AuroButton extends AuroElement {
|
|
6799
7176
|
|
|
6800
7177
|
/**
|
|
6801
7178
|
* Enables form association for this element.
|
|
@@ -6810,13 +7187,10 @@ class AuroButton extends LitElement {
|
|
|
6810
7187
|
super();
|
|
6811
7188
|
this.autofocus = false;
|
|
6812
7189
|
this.disabled = false;
|
|
6813
|
-
this.iconOnly = false;
|
|
6814
7190
|
this.loading = false;
|
|
7191
|
+
this.size = "md";
|
|
7192
|
+
this.shape = "rounded";
|
|
6815
7193
|
this.onDark = false;
|
|
6816
|
-
this.secondary = false;
|
|
6817
|
-
this.tertiary = false;
|
|
6818
|
-
this.rounded = false;
|
|
6819
|
-
this.slim = false;
|
|
6820
7194
|
this.fluid = false;
|
|
6821
7195
|
this.loadingText = this.loadingText || 'Loading...';
|
|
6822
7196
|
|
|
@@ -6845,43 +7219,38 @@ class AuroButton extends LitElement {
|
|
|
6845
7219
|
return [
|
|
6846
7220
|
tokensCss$2,
|
|
6847
7221
|
styleCss$2,
|
|
6848
|
-
colorCss$2
|
|
7222
|
+
colorCss$2,
|
|
7223
|
+
shapeSize
|
|
6849
7224
|
];
|
|
6850
7225
|
}
|
|
6851
7226
|
|
|
6852
7227
|
static get properties() {
|
|
6853
7228
|
return {
|
|
6854
7229
|
|
|
6855
|
-
|
|
6856
|
-
* This Boolean attribute lets you specify that the button should have input focus when the page loads, unless overridden by the user.
|
|
6857
|
-
*/
|
|
6858
|
-
autofocus: {
|
|
6859
|
-
type: Boolean,
|
|
6860
|
-
reflect: true
|
|
6861
|
-
},
|
|
7230
|
+
...super.properties,
|
|
6862
7231
|
|
|
6863
7232
|
/**
|
|
6864
|
-
*
|
|
7233
|
+
* Override layout since it isn't used in this component.
|
|
7234
|
+
* @private
|
|
6865
7235
|
*/
|
|
6866
|
-
|
|
7236
|
+
layout: {
|
|
6867
7237
|
type: Boolean,
|
|
6868
|
-
|
|
7238
|
+
attribute: false,
|
|
7239
|
+
reflect: false
|
|
6869
7240
|
},
|
|
6870
7241
|
|
|
6871
7242
|
/**
|
|
6872
|
-
*
|
|
6873
|
-
* @deprecated
|
|
7243
|
+
* This Boolean attribute lets you specify that the button should have input focus when the page loads, unless overridden by the user.
|
|
6874
7244
|
*/
|
|
6875
|
-
|
|
7245
|
+
autofocus: {
|
|
6876
7246
|
type: Boolean,
|
|
6877
7247
|
reflect: true
|
|
6878
7248
|
},
|
|
6879
7249
|
|
|
6880
7250
|
/**
|
|
6881
|
-
*
|
|
6882
|
-
* @deprecated
|
|
7251
|
+
* If set to true, button will become disabled and not allow for interactions.
|
|
6883
7252
|
*/
|
|
6884
|
-
|
|
7253
|
+
disabled: {
|
|
6885
7254
|
type: Boolean,
|
|
6886
7255
|
reflect: true
|
|
6887
7256
|
},
|
|
@@ -6889,15 +7258,7 @@ class AuroButton extends LitElement {
|
|
|
6889
7258
|
/**
|
|
6890
7259
|
* Alters the shape of the button to be full width of its parent container.
|
|
6891
7260
|
*/
|
|
6892
|
-
fluid:
|
|
6893
|
-
type: Boolean,
|
|
6894
|
-
reflect: true
|
|
6895
|
-
},
|
|
6896
|
-
|
|
6897
|
-
/**
|
|
6898
|
-
* If set to true, the button will contain an icon with no additional content.
|
|
6899
|
-
*/
|
|
6900
|
-
iconOnly: {
|
|
7261
|
+
fluid: {
|
|
6901
7262
|
type: Boolean,
|
|
6902
7263
|
reflect: true
|
|
6903
7264
|
},
|
|
@@ -6905,7 +7266,7 @@ class AuroButton extends LitElement {
|
|
|
6905
7266
|
/**
|
|
6906
7267
|
* If set to true button text will be replaced with `auro-loader` and become disabled.
|
|
6907
7268
|
*/
|
|
6908
|
-
loading:
|
|
7269
|
+
loading: {
|
|
6909
7270
|
type: Boolean,
|
|
6910
7271
|
reflect: true
|
|
6911
7272
|
},
|
|
@@ -6913,34 +7274,10 @@ class AuroButton extends LitElement {
|
|
|
6913
7274
|
/**
|
|
6914
7275
|
* 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.
|
|
6915
7276
|
*/
|
|
6916
|
-
loadingText:
|
|
7277
|
+
loadingText: {
|
|
6917
7278
|
type: String
|
|
6918
7279
|
},
|
|
6919
7280
|
|
|
6920
|
-
/**
|
|
6921
|
-
* Set value for on-dark version of auro-button.
|
|
6922
|
-
*/
|
|
6923
|
-
onDark: {
|
|
6924
|
-
type: Boolean,
|
|
6925
|
-
reflect: true
|
|
6926
|
-
},
|
|
6927
|
-
|
|
6928
|
-
/**
|
|
6929
|
-
* If set to true, the button will have a rounded shape.
|
|
6930
|
-
*/
|
|
6931
|
-
rounded: {
|
|
6932
|
-
type: Boolean,
|
|
6933
|
-
reflect: true
|
|
6934
|
-
},
|
|
6935
|
-
|
|
6936
|
-
/**
|
|
6937
|
-
* Set value for slim version of auro-button.
|
|
6938
|
-
*/
|
|
6939
|
-
slim: {
|
|
6940
|
-
type: Boolean,
|
|
6941
|
-
reflect: true
|
|
6942
|
-
},
|
|
6943
|
-
|
|
6944
7281
|
/**
|
|
6945
7282
|
* Populates `tabIndex` to define the focusable sequence in keyboard navigation.
|
|
6946
7283
|
*/
|
|
@@ -6949,48 +7286,10 @@ class AuroButton extends LitElement {
|
|
|
6949
7286
|
reflect: true
|
|
6950
7287
|
},
|
|
6951
7288
|
|
|
6952
|
-
/**
|
|
6953
|
-
* Populates the `aria-hidden` attribute to hide the button from a11y API.
|
|
6954
|
-
*/
|
|
6955
|
-
ariahidden: {
|
|
6956
|
-
type: String,
|
|
6957
|
-
reflect: true,
|
|
6958
|
-
},
|
|
6959
|
-
|
|
6960
|
-
/**
|
|
6961
|
-
* Populates the `aria-label` attribute that is used to define a string that labels the current element.
|
|
6962
|
-
* Use it in cases where a text label is not visible on the screen.
|
|
6963
|
-
* If there is visible text labeling the element, use `aria-labelledby` instead.
|
|
6964
|
-
*/
|
|
6965
|
-
arialabel: {
|
|
6966
|
-
type: String,
|
|
6967
|
-
reflect: true
|
|
6968
|
-
},
|
|
6969
|
-
|
|
6970
|
-
/**
|
|
6971
|
-
* Populates the `aria-labelledby` attribute that establishes relationships between objects and their label(s),
|
|
6972
|
-
* and its value should be one or more element IDs, which refer to elements that have the text needed for labeling.
|
|
6973
|
-
* List multiple element IDs in a space delimited fashion.
|
|
6974
|
-
*/
|
|
6975
|
-
arialabelledby: {
|
|
6976
|
-
type: String,
|
|
6977
|
-
reflect: true
|
|
6978
|
-
},
|
|
6979
|
-
|
|
6980
|
-
/**
|
|
6981
|
-
* Populates the `aria-expanded` attribute that indicates whether the element,
|
|
6982
|
-
* or another grouping element it controls, is currently expanded or collapsed.
|
|
6983
|
-
* This is an optional attribute for buttons.
|
|
6984
|
-
*/
|
|
6985
|
-
ariaexpanded: {
|
|
6986
|
-
type: Boolean,
|
|
6987
|
-
reflect: true
|
|
6988
|
-
},
|
|
6989
|
-
|
|
6990
7289
|
/**
|
|
6991
7290
|
* Sets title attribute. The information is most often shown as a tooltip text when the mouse moves over the element.
|
|
6992
7291
|
*/
|
|
6993
|
-
title:
|
|
7292
|
+
title: {
|
|
6994
7293
|
type: String,
|
|
6995
7294
|
reflect: true
|
|
6996
7295
|
},
|
|
@@ -6998,7 +7297,7 @@ class AuroButton extends LitElement {
|
|
|
6998
7297
|
/**
|
|
6999
7298
|
* The type of the button. Possible values are: `submit`, `reset`, `button`.
|
|
7000
7299
|
*/
|
|
7001
|
-
type:
|
|
7300
|
+
type: {
|
|
7002
7301
|
type: String,
|
|
7003
7302
|
reflect: true
|
|
7004
7303
|
},
|
|
@@ -7006,19 +7305,19 @@ class AuroButton extends LitElement {
|
|
|
7006
7305
|
/**
|
|
7007
7306
|
* Defines the value associated with the button which is submitted with the form data.
|
|
7008
7307
|
*/
|
|
7009
|
-
value:
|
|
7308
|
+
value: {
|
|
7010
7309
|
type: String,
|
|
7011
7310
|
reflect: true
|
|
7012
7311
|
},
|
|
7013
7312
|
|
|
7014
7313
|
/**
|
|
7015
|
-
* Sets button variant option.
|
|
7314
|
+
* Sets button variant option.
|
|
7315
|
+
* @default primary
|
|
7016
7316
|
*/
|
|
7017
|
-
variant:
|
|
7317
|
+
variant: {
|
|
7018
7318
|
type: String,
|
|
7019
7319
|
reflect: true
|
|
7020
7320
|
},
|
|
7021
|
-
ready: { type: Boolean },
|
|
7022
7321
|
};
|
|
7023
7322
|
}
|
|
7024
7323
|
|
|
@@ -7031,7 +7330,7 @@ class AuroButton extends LitElement {
|
|
|
7031
7330
|
*
|
|
7032
7331
|
*/
|
|
7033
7332
|
static register(name = "auro-button") {
|
|
7034
|
-
AuroLibraryRuntimeUtils$
|
|
7333
|
+
AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroButton);
|
|
7035
7334
|
}
|
|
7036
7335
|
|
|
7037
7336
|
/**
|
|
@@ -7043,17 +7342,6 @@ class AuroButton extends LitElement {
|
|
|
7043
7342
|
this.renderRoot.querySelector('button').focus();
|
|
7044
7343
|
}
|
|
7045
7344
|
|
|
7046
|
-
updated() {
|
|
7047
|
-
// support the old `secondary` and `tertiary` attributes` that are deprecated
|
|
7048
|
-
if (this.secondary) {
|
|
7049
|
-
this.setAttribute('variant', 'secondary');
|
|
7050
|
-
}
|
|
7051
|
-
|
|
7052
|
-
if (this.tertiary) {
|
|
7053
|
-
this.setAttribute('variant', 'tertiary');
|
|
7054
|
-
}
|
|
7055
|
-
}
|
|
7056
|
-
|
|
7057
7345
|
/**
|
|
7058
7346
|
* Submits the form that this button is associated with.
|
|
7059
7347
|
* @private
|
|
@@ -7074,25 +7362,56 @@ class AuroButton extends LitElement {
|
|
|
7074
7362
|
return this.internals ? this.internals.form : null;
|
|
7075
7363
|
}
|
|
7076
7364
|
|
|
7077
|
-
|
|
7365
|
+
/**
|
|
7366
|
+
* @private
|
|
7367
|
+
* @returns {Boolean}
|
|
7368
|
+
*/
|
|
7369
|
+
get hideText() {
|
|
7370
|
+
return ICON_ONLY_SHAPES.includes(this.shape);
|
|
7371
|
+
}
|
|
7372
|
+
|
|
7373
|
+
/**
|
|
7374
|
+
* Returns the current value of the projected `aria-label` attribute or undefined if not set.
|
|
7375
|
+
* @returns {string | undefined}
|
|
7376
|
+
* @private
|
|
7377
|
+
*/
|
|
7378
|
+
get currentAriaLabel() {
|
|
7379
|
+
if (!this.attributeWatcher) return undefined;
|
|
7380
|
+
|
|
7381
|
+
const ariaLabel = this.attributeWatcher.getObservedAttribute("aria-label");
|
|
7382
|
+
return ariaLabel || undefined;
|
|
7383
|
+
}
|
|
7384
|
+
|
|
7385
|
+
/**
|
|
7386
|
+
* Returns the current value of the projected `aria-labelledby` attribute or undefined if not set.
|
|
7387
|
+
* @returns {string | undefined}
|
|
7388
|
+
* @private
|
|
7389
|
+
*/
|
|
7390
|
+
get currentAriaLabelledBy() {
|
|
7391
|
+
if (!this.attributeWatcher) return undefined;
|
|
7392
|
+
|
|
7393
|
+
const ariaLabelledBy = this.attributeWatcher.getObservedAttribute("aria-labelledby");
|
|
7394
|
+
return ariaLabelledBy || undefined;
|
|
7395
|
+
}
|
|
7396
|
+
|
|
7397
|
+
/**
|
|
7398
|
+
* Renders the default layout for the button.
|
|
7399
|
+
* @returns {TemplateResult}
|
|
7400
|
+
* @private
|
|
7401
|
+
*/
|
|
7402
|
+
renderLayoutDefault() {
|
|
7078
7403
|
const classes = {
|
|
7079
|
-
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
'auro-button--slim': this.slim,
|
|
7084
|
-
'auro-button--iconOnly': this.iconOnly,
|
|
7085
|
-
'auro-button--iconOnlySlim': this.iconOnly && this.slim,
|
|
7086
|
-
'loading': this.loading
|
|
7404
|
+
"util_insetLg--squish": true,
|
|
7405
|
+
"auro-button": true,
|
|
7406
|
+
wrapper: true,
|
|
7407
|
+
loading: this.loading,
|
|
7087
7408
|
};
|
|
7088
7409
|
|
|
7089
7410
|
return html$1`
|
|
7090
7411
|
<button
|
|
7091
7412
|
part="button"
|
|
7092
|
-
aria-
|
|
7093
|
-
aria-
|
|
7094
|
-
aria-labelledby="${ifDefined(this.arialabelledby ? this.arialabelledby : undefined)}"
|
|
7095
|
-
aria-expanded="${ifDefined(this.ariaexpanded)}"
|
|
7413
|
+
aria-label="${ifDefined(this.loading ? this.loadingText : this.currentAriaLabel || undefined)}"
|
|
7414
|
+
aria-labelledby="${ifDefined(this.loading ? undefined : this.currentAriaLabelledBy || undefined)}"
|
|
7096
7415
|
tabIndex="${ifDefined(this.tIndex)}"
|
|
7097
7416
|
?autofocus="${this.autofocus}"
|
|
7098
7417
|
class="${classMap(classes)}"
|
|
@@ -7109,7 +7428,7 @@ class AuroButton extends LitElement {
|
|
|
7109
7428
|
|
|
7110
7429
|
<span class="contentWrapper">
|
|
7111
7430
|
<span class="textSlot" part="text">
|
|
7112
|
-
${this.
|
|
7431
|
+
${this.hideText ? undefined : html$1`<slot></slot>`}
|
|
7113
7432
|
</span>
|
|
7114
7433
|
|
|
7115
7434
|
<span part="icon">
|
|
@@ -7119,6 +7438,15 @@ class AuroButton extends LitElement {
|
|
|
7119
7438
|
</button>
|
|
7120
7439
|
`;
|
|
7121
7440
|
}
|
|
7441
|
+
|
|
7442
|
+
/**
|
|
7443
|
+
* Renders the layout of the button
|
|
7444
|
+
* @returns {TemplateResult}
|
|
7445
|
+
* @private
|
|
7446
|
+
*/
|
|
7447
|
+
renderLayout() {
|
|
7448
|
+
return this.renderLayoutDefault();
|
|
7449
|
+
}
|
|
7122
7450
|
}
|
|
7123
7451
|
|
|
7124
7452
|
var buttonVersion = '9.3.0';
|
|
@@ -7344,7 +7672,7 @@ class AuroInput extends BaseInput {
|
|
|
7344
7672
|
/**
|
|
7345
7673
|
* Generate unique names for dependency components.
|
|
7346
7674
|
*/
|
|
7347
|
-
const versioning = new AuroDependencyVersioning
|
|
7675
|
+
const versioning = new AuroDependencyVersioning();
|
|
7348
7676
|
|
|
7349
7677
|
/**
|
|
7350
7678
|
* @private
|
|
@@ -7465,7 +7793,7 @@ class AuroInput extends BaseInput {
|
|
|
7465
7793
|
*
|
|
7466
7794
|
*/
|
|
7467
7795
|
static register(name = "auro-input") {
|
|
7468
|
-
AuroLibraryRuntimeUtils$
|
|
7796
|
+
AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroInput);
|
|
7469
7797
|
}
|
|
7470
7798
|
|
|
7471
7799
|
/**
|
|
@@ -7595,11 +7923,12 @@ class AuroInput extends BaseInput {
|
|
|
7595
7923
|
?onDark="${this.onDark}"
|
|
7596
7924
|
aria-label="${i18n(this.lang, 'clearInput')}"
|
|
7597
7925
|
class="notificationBtn clearBtn"
|
|
7598
|
-
|
|
7599
|
-
|
|
7926
|
+
shape="circle"
|
|
7927
|
+
size="sm"
|
|
7928
|
+
variant="ghost">
|
|
7600
7929
|
<${this.iconTag}
|
|
7930
|
+
customColor="${this.onDark}"
|
|
7601
7931
|
category="interface"
|
|
7602
|
-
customColor
|
|
7603
7932
|
name="x-lg"
|
|
7604
7933
|
>
|
|
7605
7934
|
</${this.iconTag}>
|
|
@@ -7619,20 +7948,21 @@ class AuroInput extends BaseInput {
|
|
|
7619
7948
|
<${this.buttonTag}
|
|
7620
7949
|
@click="${this.handleClickShowPassword}"
|
|
7621
7950
|
?onDark="${this.onDark}"
|
|
7622
|
-
aria-hidden="true"
|
|
7623
7951
|
class="notificationBtn passwordBtn"
|
|
7624
|
-
|
|
7625
|
-
|
|
7952
|
+
aria-label="${this.showPassword ? i18n(this.lang, "hidePassword") : i18n(this.lang, "showPassword")}"
|
|
7953
|
+
shape="circle"
|
|
7954
|
+
size="sm"
|
|
7955
|
+
variant="ghost">
|
|
7626
7956
|
<${this.iconTag}
|
|
7957
|
+
customColor="${this.onDark}"
|
|
7627
7958
|
?hidden=${!this.showPassword}
|
|
7628
7959
|
category="interface"
|
|
7629
|
-
customColor
|
|
7630
7960
|
name="hide-password-stroke">
|
|
7631
7961
|
</${this.iconTag}>
|
|
7632
7962
|
<${this.iconTag}
|
|
7963
|
+
customColor="${this.onDark}"
|
|
7633
7964
|
?hidden=${this.showPassword}
|
|
7634
7965
|
category="interface"
|
|
7635
|
-
customColor
|
|
7636
7966
|
name="view-password-stroke">
|
|
7637
7967
|
</${this.iconTag}>
|
|
7638
7968
|
</${this.buttonTag}>
|