@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
|
@@ -3,9 +3,9 @@ import { unsafeStatic, literal, html as html$1 } from 'lit/static-html.js';
|
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
5
5
|
|
|
6
|
-
var colorCss$
|
|
6
|
+
var colorCss$3 = css`#headerContainer{box-shadow:var(--ds-auro-dropdownbib-header-boxshadow-color)}#footerContainer{background-color:var(--ds-auro-dropdownbib-footer-container-color)}`;
|
|
7
7
|
|
|
8
|
-
var styleCss$
|
|
8
|
+
var styleCss$4 = css`#bibTemplate{display:flex;overflow:hidden;height:100%;max-height:100%;flex-direction:column}#headerContainer{display:flex;flex-direction:column}#header{display:flex;width:100%;min-height:var(--ds-size-1000, 5rem);box-sizing:border-box;align-items:end;padding-top:var(--ds-size-400, 2rem);padding-right:var(--ds-size-700, 3.5rem);padding-left:var(--ds-size-200, 1rem);pointer-events:none}#subheader{width:100%}#subheader ::slotted([auro-input]){box-sizing:border-box;padding:0 var(--ds-size-200, 1rem)}#closeButton{position:absolute;top:var(--ds-size-400, 2rem);right:var(--ds-size-200, 1rem);border:none;background-color:transparent;cursor:pointer}#bodyContainer{position:relative;overflow:auto;flex:1 1 100%}:host([isfullscreen]) #bibTemplate{max-height:100dvh}:host([isfullscreen]) #bodyContainer{margin-top:var(--ds-size-100, 0.5rem)}#footerContainer{position:absolute;right:0;bottom:0;left:0;padding:var(--ds-size-200, 1rem)}`;
|
|
9
9
|
|
|
10
10
|
var tokenCss = css`:host{--ds-auro-dropdownbib-header-boxshadow-color: var(--ds-elevation-200, 0px 0px 10px rgba(0, 0, 0, 0.15));--ds-auro-dropdownbib-footer-container-color: var(--ds-basic-color-surface-default, #ffffff)}`;
|
|
11
11
|
|
|
@@ -16,7 +16,7 @@ var tokenCss = css`:host{--ds-auro-dropdownbib-header-boxshadow-color: var(--ds-
|
|
|
16
16
|
|
|
17
17
|
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
18
18
|
|
|
19
|
-
let AuroLibraryRuntimeUtils$
|
|
19
|
+
let AuroLibraryRuntimeUtils$3 = class AuroLibraryRuntimeUtils {
|
|
20
20
|
|
|
21
21
|
/* eslint-disable jsdoc/require-param */
|
|
22
22
|
|
|
@@ -119,6 +119,1003 @@ class AuroDependencyVersioning {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
/**
|
|
123
|
+
* Private module-level WeakMap to hold MutationObservers for each host element.
|
|
124
|
+
*/
|
|
125
|
+
const _observers = new WeakMap();
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Private module-level WeakMap to hold attribute matchers and targets for each host element.
|
|
129
|
+
* Structure: {
|
|
130
|
+
* host: {
|
|
131
|
+
* matchers: Set<Function>,
|
|
132
|
+
* targets: Map<HTMLElement, Map<Function, {removeOriginal: boolean, currentAttributes: Map<string, string>}>>
|
|
133
|
+
* }
|
|
134
|
+
* }
|
|
135
|
+
*/
|
|
136
|
+
const _transportConfig = new WeakMap();
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Transfers all matching attributes from a host element to a target element and observes for future changes.
|
|
140
|
+
*
|
|
141
|
+
* @param {Object} params - The parameters for the function.
|
|
142
|
+
* @param {HTMLElement} params.host - The host element from which attributes will be transported.
|
|
143
|
+
* @param {HTMLElement} params.target - The target element to which attributes will be transported.
|
|
144
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove the attributes from the host element.
|
|
145
|
+
* @param {boolean} [params.observe=true] - Whether to attach a MutationObserver to the host element.
|
|
146
|
+
* @returns {Function} A function to detach the observer when no longer needed.
|
|
147
|
+
* @throws {TypeError} If the host or target parameters are not instances of HTMLElement.
|
|
148
|
+
*/
|
|
149
|
+
const transportAttributes = ({ host, target, match, removeOriginal = true }) => {
|
|
150
|
+
// Guard Clause: Ensure host is valid HTMLElement instance
|
|
151
|
+
if (typeof host !== 'object' || !(host instanceof HTMLElement)) {
|
|
152
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "host" parameter must be an instance of HTMLElement.');
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Guard Clause: Ensure target is valid HTMLElement instance
|
|
156
|
+
if (typeof target !== 'object' || !(target instanceof HTMLElement)) {
|
|
157
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "target" parameter must be an instance of HTMLElement.');
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Guard Clause: Ensure match is a function
|
|
161
|
+
if (typeof match !== 'function') {
|
|
162
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "match" parameter must be a function.');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Guard Clause: Ensure removeOriginal is a boolean
|
|
166
|
+
if (typeof removeOriginal !== 'boolean') {
|
|
167
|
+
throw new TypeError('a11yUtilities.js | transportAttributes | The "removeOriginal" parameter must be a boolean.');
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Register this transport and get cleanup function
|
|
171
|
+
return _registerTransport({
|
|
172
|
+
host,
|
|
173
|
+
target,
|
|
174
|
+
matcher: match,
|
|
175
|
+
removeOriginal
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Registers a matcher and target for a host element and attaches an observer if needed.
|
|
181
|
+
*
|
|
182
|
+
* @param {Object} params - The parameters object.
|
|
183
|
+
* @param {HTMLElement} params.host - The host element to observe.
|
|
184
|
+
* @param {HTMLElement} params.target - The target element to receive attributes.
|
|
185
|
+
* @param {Function} params.matcher - Function that determines which attributes to transport.
|
|
186
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove original attributes.
|
|
187
|
+
* @param {boolean} [params.observe=true] - Whether to observe for attribute changes.
|
|
188
|
+
* @returns {Function} Function to detach the specific matcher and target pairing.
|
|
189
|
+
* @private
|
|
190
|
+
*/
|
|
191
|
+
const _registerTransport = ({ host, target, matcher, removeOriginal = true }) => {
|
|
192
|
+
// Initialize config for this host if it doesn't exist
|
|
193
|
+
if (!_transportConfig.has(host)) {
|
|
194
|
+
_transportConfig.set(host, {
|
|
195
|
+
matchers: new Set(),
|
|
196
|
+
targets: new Map()
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const config = _transportConfig.get(host);
|
|
201
|
+
|
|
202
|
+
// Add the matcher to the set of matchers for this host
|
|
203
|
+
config.matchers.add(matcher);
|
|
204
|
+
|
|
205
|
+
// Initialize target entry if it doesn't exist
|
|
206
|
+
if (!config.targets.has(target)) {
|
|
207
|
+
config.targets.set(target, new Map());
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Store the matcher with its removeOriginal setting for this target
|
|
211
|
+
config.targets.get(target).set(matcher, {
|
|
212
|
+
removeOriginal,
|
|
213
|
+
currentAttributes: new Map()
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
// Perform initial attribute transport
|
|
217
|
+
_transportAttributes({ host, target, matcher, removeOriginal });
|
|
218
|
+
|
|
219
|
+
// Attach observer
|
|
220
|
+
_attachObserver(host);
|
|
221
|
+
|
|
222
|
+
// Return cleanup function and utility functions
|
|
223
|
+
return {
|
|
224
|
+
cleanup: () => _cleanupTransport(host, target, matcher),
|
|
225
|
+
getObservedAttributes: () => _getObservedAttributes(host, target, matcher),
|
|
226
|
+
getObservedAttribute: (attr) => _getObservedAttribute(host, target, matcher, attr),
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Cleans up resources associated with a specific matcher and target for a host element.
|
|
232
|
+
*
|
|
233
|
+
* @param {HTMLElement} host - The host element
|
|
234
|
+
* @param {HTMLElement} target - The target element
|
|
235
|
+
* @param {Function} matcher - The matcher function
|
|
236
|
+
* @private
|
|
237
|
+
*/
|
|
238
|
+
const _cleanupTransport = (host, target, matcher) => {
|
|
239
|
+
const config = _transportConfig.get(host);
|
|
240
|
+
if (!config) return;
|
|
241
|
+
|
|
242
|
+
// Remove this matcher from this target
|
|
243
|
+
const targetMatchers = config.targets.get(target);
|
|
244
|
+
if (targetMatchers) {
|
|
245
|
+
targetMatchers.delete(matcher);
|
|
246
|
+
|
|
247
|
+
// If this target has no more matchers, remove it
|
|
248
|
+
if (targetMatchers.size === 0) {
|
|
249
|
+
config.targets.delete(target);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Check if this matcher is still used by any target
|
|
254
|
+
let matcherStillUsed = false;
|
|
255
|
+
for (const matcherMap of config.targets.values()) {
|
|
256
|
+
if (matcherMap.has(matcher)) {
|
|
257
|
+
matcherStillUsed = true;
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// If not used anymore, remove from matchers set
|
|
263
|
+
if (!matcherStillUsed) {
|
|
264
|
+
config.matchers.delete(matcher);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// If no more targets or matchers, detach observer
|
|
268
|
+
if (config.targets.size === 0 || config.matchers.size === 0) {
|
|
269
|
+
_detachObserver(host);
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Generic function to transport attributes from a host element to a target element.
|
|
275
|
+
*
|
|
276
|
+
* @param {Object} params - The parameters object.
|
|
277
|
+
* @param {HTMLElement} params.host - The host element from which to transport attributes.
|
|
278
|
+
* @param {HTMLElement} params.target - The target element to which attributes will be transported.
|
|
279
|
+
* @param {Function} params.matcher - Function that takes an attribute name and returns true if it should be transported.
|
|
280
|
+
* @param {boolean} [params.removeOriginal=true] - Whether to remove original attributes from host.
|
|
281
|
+
* @returns {void}
|
|
282
|
+
* @private
|
|
283
|
+
*/
|
|
284
|
+
const _transportAttributes = ({ host, target, matcher, removeOriginal = true }) => {
|
|
285
|
+
// Get a list of all matching attributes on the host element and their values
|
|
286
|
+
const matchingAttributes = host.getAttributeNames()
|
|
287
|
+
.filter(attr => matcher(attr))
|
|
288
|
+
.reduce((acc, attr) => {
|
|
289
|
+
acc[attr] = host.getAttribute(attr);
|
|
290
|
+
return acc;
|
|
291
|
+
}, {});
|
|
292
|
+
|
|
293
|
+
// Move matching attributes to the target element, removing them from the host if removeOriginal is true
|
|
294
|
+
Object.entries(matchingAttributes).forEach(([key, value]) => {
|
|
295
|
+
_setObservedAttribute(host, target, matcher, key, value);
|
|
296
|
+
target.setAttribute(key, value);
|
|
297
|
+
if (removeOriginal) {
|
|
298
|
+
host.removeAttribute(key);
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Attaches a MutationObserver to the host element to monitor attribute changes.
|
|
305
|
+
*
|
|
306
|
+
* @param {HTMLElement} host - The element to observe for attribute changes.
|
|
307
|
+
* @returns {MutationObserver} The observer instance.
|
|
308
|
+
* @private
|
|
309
|
+
*/
|
|
310
|
+
const _attachObserver = (host) => {
|
|
311
|
+
// If an observer for this host already exists, return it
|
|
312
|
+
if (_observers.has(host)) {
|
|
313
|
+
return _observers.get(host);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// Create a new MutationObserver
|
|
317
|
+
const observer = new MutationObserver((mutations) => {
|
|
318
|
+
const config = _transportConfig.get(host);
|
|
319
|
+
if (!config) return;
|
|
320
|
+
|
|
321
|
+
// For each mutation affecting attributes
|
|
322
|
+
mutations
|
|
323
|
+
.filter(mutation => mutation.type === 'attributes')
|
|
324
|
+
.forEach(mutation => {
|
|
325
|
+
const attributeName = mutation.attributeName;
|
|
326
|
+
|
|
327
|
+
// Find matchers that care about this attribute
|
|
328
|
+
for (const matcher of config.matchers) {
|
|
329
|
+
if (matcher(attributeName)) {
|
|
330
|
+
// For each target that uses this matcher
|
|
331
|
+
for (const [target, matcherConfigs] of config.targets.entries()) {
|
|
332
|
+
if (matcherConfigs.has(matcher)) {
|
|
333
|
+
const { removeOriginal } = matcherConfigs.get(matcher);
|
|
334
|
+
_transportAttributes({
|
|
335
|
+
host,
|
|
336
|
+
target,
|
|
337
|
+
matcher,
|
|
338
|
+
removeOriginal
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
// Start observing attribute changes
|
|
348
|
+
observer.observe(host, { attributes: true });
|
|
349
|
+
|
|
350
|
+
// Store the observer
|
|
351
|
+
_observers.set(host, observer);
|
|
352
|
+
|
|
353
|
+
return observer;
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Detaches and cleans up the MutationObserver for a given host element.
|
|
358
|
+
*
|
|
359
|
+
* @param {HTMLElement} host - The element whose observer should be detached.
|
|
360
|
+
* @private
|
|
361
|
+
*/
|
|
362
|
+
const _detachObserver = (host) => {
|
|
363
|
+
if (_observers.has(host)) {
|
|
364
|
+
const observer = _observers.get(host);
|
|
365
|
+
observer.disconnect();
|
|
366
|
+
_observers.delete(host);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// Clean up the transport config as well
|
|
370
|
+
if (_transportConfig.has(host)) {
|
|
371
|
+
_transportConfig.delete(host);
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Gets the matcher configuration for a specific host, target, and matcher
|
|
377
|
+
* @param {HTMLElement} host - The host element
|
|
378
|
+
* @param {HTMLElement} target - The target element
|
|
379
|
+
* @param {Function} matcher - The matcher function
|
|
380
|
+
* @returns {Object|undefined} The matcher configuration if found
|
|
381
|
+
* @private
|
|
382
|
+
*/
|
|
383
|
+
const _getMatcherConfig = (host, target, matcher) => {
|
|
384
|
+
const config = _transportConfig.get(host);
|
|
385
|
+
if (!config) return undefined;
|
|
386
|
+
|
|
387
|
+
const targetMatchers = config.targets.get(target);
|
|
388
|
+
if (!targetMatchers) return undefined;
|
|
389
|
+
|
|
390
|
+
return targetMatchers.get(matcher);
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Sets an observed attribute value
|
|
395
|
+
* @param {HTMLElement} host - The host element
|
|
396
|
+
* @param {HTMLElement} target - The target element
|
|
397
|
+
* @param {Function} matcher - The matcher function
|
|
398
|
+
* @param {string} key - The attribute name
|
|
399
|
+
* @param {string} value - The attribute value
|
|
400
|
+
* @private
|
|
401
|
+
*/
|
|
402
|
+
const _setObservedAttribute = (host, target, matcher, key, value) => {
|
|
403
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
404
|
+
if (matcherConfig) {
|
|
405
|
+
matcherConfig.currentAttributes.set(key, value);
|
|
406
|
+
}
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
const _getObservedAttribute = (host, target, matcher, attr) => {
|
|
410
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
411
|
+
if (matcherConfig) return matcherConfig.currentAttributes.get(attr);
|
|
412
|
+
return undefined;
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
const _getObservedAttributes = (host, target, matcher) => {
|
|
416
|
+
const matcherConfig = _getMatcherConfig(host, target, matcher);
|
|
417
|
+
if (matcherConfig) return Array.from(matcherConfig.currentAttributes.entries());
|
|
418
|
+
return [];
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
const _matchers = {
|
|
422
|
+
'aria-': attr => attr.startsWith('aria-'),
|
|
423
|
+
'role': attr => attr.match(/^role$/)
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
const transportAllA11yAttributes = ({ host, target, removeOriginal = true }) => {
|
|
427
|
+
return transportAttributes({
|
|
428
|
+
host,
|
|
429
|
+
target,
|
|
430
|
+
match: attr => {
|
|
431
|
+
for (const key in _matchers) {
|
|
432
|
+
if (_matchers[key](attr)) return true;
|
|
433
|
+
}
|
|
434
|
+
return false;
|
|
435
|
+
},
|
|
436
|
+
removeOriginal
|
|
437
|
+
});
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
let AuroElement$1 = class AuroElement extends LitElement {
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* @type {Object} return object from transportAttributes via a11yUtilities
|
|
444
|
+
* @property {Function} cleanup - Function to clean up the attribute watcher.
|
|
445
|
+
* @property {Function} getCurrentAttributes - Function to get the current attributes being watched and their values.
|
|
446
|
+
* @property {Function} getObservedAttribute - Function to get the value of a specific observed attribute by name.
|
|
447
|
+
* @private
|
|
448
|
+
*/
|
|
449
|
+
attributeWatcher;
|
|
450
|
+
|
|
451
|
+
static get properties() {
|
|
452
|
+
return {
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Defines the layout of an element.
|
|
456
|
+
* @default {'default'}
|
|
457
|
+
*/
|
|
458
|
+
layout: {
|
|
459
|
+
type: String,
|
|
460
|
+
attribute: "layout",
|
|
461
|
+
reflect: true
|
|
462
|
+
},
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Defines the shape of an element.
|
|
466
|
+
* @property {'default', 'rounded', 'pill', 'circle'}
|
|
467
|
+
* @default {'default'}
|
|
468
|
+
*/
|
|
469
|
+
shape: {
|
|
470
|
+
type: String,
|
|
471
|
+
attribute: "shape",
|
|
472
|
+
reflect: true
|
|
473
|
+
},
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Defines the size of an element.
|
|
477
|
+
* @property {'xs', 'sm', 'md', 'lg', 'xl'}
|
|
478
|
+
* @default {'md'}
|
|
479
|
+
*/
|
|
480
|
+
size: {
|
|
481
|
+
type: String,
|
|
482
|
+
attribute: "size",
|
|
483
|
+
reflect: true
|
|
484
|
+
},
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* This Boolean attribute lets you specify that the element should be rendered in dark mode.
|
|
488
|
+
* @default {false}
|
|
489
|
+
*/
|
|
490
|
+
onDark: {
|
|
491
|
+
type: Boolean,
|
|
492
|
+
attribute: "ondark",
|
|
493
|
+
reflect: true
|
|
494
|
+
},
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* A reference to the wrapper element in the shadow DOM.
|
|
498
|
+
* This is used to apply layout and shape classes dynamically.
|
|
499
|
+
* @type {HTMLElement|null}
|
|
500
|
+
* @default {null}
|
|
501
|
+
* @private
|
|
502
|
+
*/
|
|
503
|
+
wrapper: {
|
|
504
|
+
type: HTMLElement,
|
|
505
|
+
attribute: false,
|
|
506
|
+
reflect: false
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
resetShapeClasses() {
|
|
514
|
+
if (this.shape && this.size) {
|
|
515
|
+
|
|
516
|
+
if (this.wrapper) {
|
|
517
|
+
this.wrapper.classList.forEach((className) => {
|
|
518
|
+
if (className.startsWith('shape-')) {
|
|
519
|
+
this.wrapper.classList.remove(className);
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
this.wrapper.classList.add(`shape-${this.shape.toLowerCase()}-${this.size.toLowerCase()}`);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
resetLayoutClasses() {
|
|
529
|
+
if (this.layout) {
|
|
530
|
+
if (this.wrapper) {
|
|
531
|
+
this.wrapper.classList.forEach((className) => {
|
|
532
|
+
if (className.startsWith('layout-')) {
|
|
533
|
+
this.wrapper.classList.remove(className);
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
|
|
537
|
+
this.wrapper.classList.add(`layout-${this.layout.toLowerCase()}`);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
updateComponentArchitecture() {
|
|
543
|
+
this.resetLayoutClasses();
|
|
544
|
+
this.resetShapeClasses();
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
updated(changedProperties) {
|
|
548
|
+
if (changedProperties.has('layout') || changedProperties.has('shape') || changedProperties.has('size')) {
|
|
549
|
+
this.updateComponentArchitecture();
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
firstUpdated() {
|
|
554
|
+
super.firstUpdated();
|
|
555
|
+
|
|
556
|
+
// Set a reference to the wrapper element in the shadow DOM
|
|
557
|
+
this.wrapper = this.shadowRoot.querySelector('.wrapper');
|
|
558
|
+
|
|
559
|
+
// Initialize the transportation of ARIA attributes to the target element and get the disconnect function for cleanup
|
|
560
|
+
this.attributeWatcher = transportAllA11yAttributes({ host: this, target: this.shadowRoot.querySelector('.wrapper') });
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
disconnectedCallback() {
|
|
564
|
+
super.disconnectedCallback();
|
|
565
|
+
|
|
566
|
+
// Cleanup the ARIA observer if it exists
|
|
567
|
+
if (this.attributeWatcher) {
|
|
568
|
+
this.attributeWatcher.cleanup();
|
|
569
|
+
this.attributeWatcher = null;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
// Try to render the defined `this.layout` layout. If that fails, fall back to the default layout.
|
|
574
|
+
// This will catch if an invalid layout value is passed in and render the default layout if so.
|
|
575
|
+
render() {
|
|
576
|
+
try {
|
|
577
|
+
return this.renderLayout();
|
|
578
|
+
} catch (error) {
|
|
579
|
+
// failed to get the defined layout
|
|
580
|
+
console.error('Failed to get the defined layout - using the default layout', error); // eslint-disable-line no-console
|
|
581
|
+
|
|
582
|
+
// fallback to the default layout
|
|
583
|
+
return this.getLayout('default');
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
|
|
588
|
+
var styleCss$3 = 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}`;
|
|
589
|
+
|
|
590
|
+
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)}`;
|
|
591
|
+
|
|
592
|
+
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}`;
|
|
593
|
+
|
|
594
|
+
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}`;
|
|
595
|
+
|
|
596
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
597
|
+
// See LICENSE in the project root for license information.
|
|
598
|
+
|
|
599
|
+
// ---------------------------------------------------------------------
|
|
600
|
+
|
|
601
|
+
/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
|
|
602
|
+
|
|
603
|
+
let AuroLibraryRuntimeUtils$2 = class AuroLibraryRuntimeUtils {
|
|
604
|
+
|
|
605
|
+
/* eslint-disable jsdoc/require-param */
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* This will register a new custom element with the browser.
|
|
609
|
+
* @param {String} name - The name of the custom element.
|
|
610
|
+
* @param {Object} componentClass - The class to register as a custom element.
|
|
611
|
+
* @returns {void}
|
|
612
|
+
*/
|
|
613
|
+
registerComponent(name, componentClass) {
|
|
614
|
+
if (!customElements.get(name)) {
|
|
615
|
+
customElements.define(name, class extends componentClass {});
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Finds and returns the closest HTML Element based on a selector.
|
|
621
|
+
* @returns {void}
|
|
622
|
+
*/
|
|
623
|
+
closestElement(
|
|
624
|
+
selector, // selector like in .closest()
|
|
625
|
+
base = this, // extra functionality to skip a parent
|
|
626
|
+
__Closest = (el, found = el && el.closest(selector)) =>
|
|
627
|
+
!el || el === document || el === window
|
|
628
|
+
? null // standard .closest() returns null for non-found selectors also
|
|
629
|
+
: found
|
|
630
|
+
? found // found a selector INside this element
|
|
631
|
+
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
|
|
632
|
+
) {
|
|
633
|
+
return __Closest(base);
|
|
634
|
+
}
|
|
635
|
+
/* eslint-enable jsdoc/require-param */
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
|
|
639
|
+
* @param {Object} elem - The element to check.
|
|
640
|
+
* @param {String} tagName - The name of the Auro component to check for or add as an attribute.
|
|
641
|
+
* @returns {void}
|
|
642
|
+
*/
|
|
643
|
+
handleComponentTagRename(elem, tagName) {
|
|
644
|
+
const tag = tagName.toLowerCase();
|
|
645
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
646
|
+
|
|
647
|
+
if (elemTag !== tag) {
|
|
648
|
+
elem.setAttribute(tag, true);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* Validates if an element is a specific Auro component.
|
|
654
|
+
* @param {Object} elem - The element to validate.
|
|
655
|
+
* @param {String} tagName - The name of the Auro component to check against.
|
|
656
|
+
* @returns {Boolean} - Returns true if the element is the specified Auro component.
|
|
657
|
+
*/
|
|
658
|
+
elementMatch(elem, tagName) {
|
|
659
|
+
const tag = tagName.toLowerCase();
|
|
660
|
+
const elemTag = elem.tagName.toLowerCase();
|
|
661
|
+
|
|
662
|
+
return elemTag === tag || elem.hasAttribute(tag);
|
|
663
|
+
}
|
|
664
|
+
};
|
|
665
|
+
|
|
666
|
+
var styleCss$2 = css`:focus:not(:focus-visible){outline:3px solid transparent}:host,:host>span{position:relative}:host{width:2rem;height:2rem;display:inline-block;font-size:0}:host>span{position:absolute;display:inline-block;float:none;top:0;left:0;width:2rem;height:2rem;border-radius:100%;border-style:solid;border-width:0}:host([xs]),:host([xs])>span{width:1.2rem;height:1.2rem}:host([sm]),:host([sm])>span{width:3rem;height:3rem}:host([md]),:host([md])>span{width:5rem;height:5rem}:host([lg]),:host([lg])>span{width:8rem;height:8rem}:host{--margin:0.375rem;--margin-xs:0.2rem;--margin-sm:0.5rem;--margin-md:0.75rem;--margin-lg:1rem}:host([pulse]),:host([pulse])>span{position:relative}:host([pulse]){width:calc(3rem + var(--margin)*6);height:1.5rem}:host([pulse])>span{width:1rem;height:1rem;margin:var(--margin);animation:pulse 1.5s ease infinite}:host([pulse][xs]){width:calc(2.55rem + var(--margin-xs)*6);height:1.55rem}:host([pulse][xs])>span{margin:var(--margin-xs);width:.65rem;height:.65rem}:host([pulse][sm]){width:calc(6rem + var(--margin-sm)*6);height:2.5rem}:host([pulse][sm])>span{margin:var(--margin-sm);width:2rem;height:2rem}:host([pulse][md]){width:calc(9rem + var(--margin-md)*6);height:3.5rem}:host([pulse][md])>span{margin:var(--margin-md);width:3rem;height:3rem}:host([pulse][lg]){width:calc(15rem + var(--margin-lg)*6);height:5.5rem}:host([pulse][lg])>span{margin:var(--margin-lg);width:5rem;height:5rem}:host([pulse])>span:nth-child(1){animation-delay:-400ms}:host([pulse])>span:nth-child(2){animation-delay:-200ms}:host([pulse])>span:nth-child(3){animation-delay:0ms}@keyframes pulse{0%,100%{opacity:.1;transform:scale(0.9)}50%{opacity:1;transform:scale(1.1)}}:host([orbit]),:host([orbit])>span{opacity:1}:host([orbit])>span{border-width:5px}:host([orbit])>span:nth-child(2){animation:orbit 2s linear infinite}:host([orbit][sm])>span{border-width:8px}:host([orbit][md])>span{border-width:13px}:host([orbit][lg])>span{border-width:21px}@keyframes orbit{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}:host([ringworm])>svg{animation:rotate 2s linear infinite;height:100%;width:100%;stroke:currentcolor;stroke-width:8}:host([ringworm]) .path{stroke-dashoffset:0;animation:ringworm 1.5s ease-in-out infinite;stroke-linecap:round}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes ringworm{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}100%{stroke-dasharray:89,200;stroke-dashoffset:-124px}}:host([laser]){position:static;width:100%;display:block;height:0;overflow:hidden;font-size:unset}:host([laser])>span{position:fixed;width:100%;height:.25rem;border-radius:0;z-index:100}:host([laser])>span:nth-child(1){border-color:currentcolor;opacity:.25}:host([laser])>span:nth-child(2){border-color:currentcolor;animation:laser 2s linear infinite;opacity:1;width:50%}:host([laser][sm])>span:nth-child(2){width:20%}:host([laser][md])>span:nth-child(2){width:30%}:host([laser][lg])>span:nth-child(2){width:50%;animation-duration:1.5s}:host([laser][xl])>span:nth-child(2){width:80%;animation-duration:1.5s}@keyframes laser{0%{left:-100%}100%{left:110%}}:host>.no-animation{display:none}@media(prefers-reduced-motion: reduce){:host{display:flex;align-items:center;justify-content:center;font-size:1rem}:host>span{opacity:1}:host>.loader{display:none}:host>.no-animation{display:block}}`;
|
|
667
|
+
|
|
668
|
+
var colorCss$1 = css`:host{color:var(--ds-auro-loader-color)}:host>span{background-color:var(--ds-auro-loader-background-color);border-color:var(--ds-auro-loader-border-color)}:host([onlight]){--ds-auro-loader-color:var(--ds-basic-color-brand-primary, #01426a)}:host([ondark]){--ds-auro-loader-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([orbit])>span{--ds-auro-loader-background-color:transparent}:host([orbit])>span:nth-child(1){--ds-auro-loader-border-color:currentcolor;opacity:.25}:host([orbit])>span:nth-child(2){--ds-auro-loader-border-color:currentcolor;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent}`;
|
|
669
|
+
|
|
670
|
+
var tokensCss$1 = css`:host{--ds-auro-loader-background-color:currentcolor;--ds-auro-loader-border-color:currentcolor;--ds-auro-loader-color:currentcolor}`;
|
|
671
|
+
|
|
672
|
+
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
673
|
+
// See LICENSE in the project root for license information.
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
class AuroLoader extends LitElement {
|
|
677
|
+
constructor() {
|
|
678
|
+
super();
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* @private
|
|
682
|
+
*/
|
|
683
|
+
this.keys = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* @private
|
|
687
|
+
*/
|
|
688
|
+
this.mdCount = 3;
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* @private
|
|
692
|
+
*/
|
|
693
|
+
this.smCount = 2;
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* @private
|
|
697
|
+
*/
|
|
698
|
+
this.runtimeUtils = new AuroLibraryRuntimeUtils$2();
|
|
699
|
+
|
|
700
|
+
this.orbit = false;
|
|
701
|
+
this.ringworm = false;
|
|
702
|
+
this.laser = false;
|
|
703
|
+
this.pulse = false;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// function to define props used within the scope of this component
|
|
707
|
+
static get properties() {
|
|
708
|
+
return {
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* Sets loader to laser type.
|
|
712
|
+
*/
|
|
713
|
+
laser: {
|
|
714
|
+
type: Boolean,
|
|
715
|
+
reflect: true
|
|
716
|
+
},
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Sets loader to orbit type.
|
|
720
|
+
*/
|
|
721
|
+
orbit: {
|
|
722
|
+
type: Boolean,
|
|
723
|
+
reflect: true
|
|
724
|
+
},
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* Sets loader to pulse type.
|
|
728
|
+
*/
|
|
729
|
+
pulse: {
|
|
730
|
+
type: Boolean,
|
|
731
|
+
reflect: true
|
|
732
|
+
},
|
|
733
|
+
|
|
734
|
+
/**
|
|
735
|
+
* Sets loader to ringworm type.
|
|
736
|
+
*/
|
|
737
|
+
ringworm: {
|
|
738
|
+
type: Boolean,
|
|
739
|
+
reflect: true
|
|
740
|
+
}
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
static get styles() {
|
|
745
|
+
return [
|
|
746
|
+
css`${styleCss$2}`,
|
|
747
|
+
css`${colorCss$1}`,
|
|
748
|
+
css`${tokensCss$1}`
|
|
749
|
+
];
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* This will register this element with the browser.
|
|
754
|
+
* @param {string} [name="auro-loader"] - The name of element that you want to register to.
|
|
755
|
+
*
|
|
756
|
+
* @example
|
|
757
|
+
* AuroLoader.register("custom-loader") // this will register this element to <custom-loader/>
|
|
758
|
+
*
|
|
759
|
+
*/
|
|
760
|
+
static register(name = "auro-loader") {
|
|
761
|
+
AuroLibraryRuntimeUtils$2.prototype.registerComponent(name, AuroLoader);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
firstUpdated() {
|
|
765
|
+
// Add the tag name as an attribute if it is different than the component name
|
|
766
|
+
this.runtimeUtils.handleComponentTagRename(this, 'auro-loader');
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
connectedCallback() {
|
|
770
|
+
super.connectedCallback();
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
/**
|
|
774
|
+
* @private
|
|
775
|
+
* @returns {Array} Numbered array for template map.
|
|
776
|
+
*/
|
|
777
|
+
defineTemplate() {
|
|
778
|
+
let nodes = Array.from(Array(this.mdCount).keys());
|
|
779
|
+
|
|
780
|
+
if (this.orbit || this.laser) {
|
|
781
|
+
nodes = Array.from(Array(this.smCount).keys());
|
|
782
|
+
} else if (this.ringworm) {
|
|
783
|
+
nodes = Array.from(Array(0).keys());
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
return nodes;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
790
|
+
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
791
|
+
|
|
792
|
+
// function that renders the HTML and CSS into the scope of the component
|
|
793
|
+
render() {
|
|
794
|
+
return html`
|
|
795
|
+
${this.defineTemplate().map((idx) => html`
|
|
796
|
+
<span part="element" class="loader node-${idx}"></span>
|
|
797
|
+
`)}
|
|
798
|
+
|
|
799
|
+
<div class="no-animation">Loading...</div>
|
|
800
|
+
|
|
801
|
+
${this.ringworm ? html`
|
|
802
|
+
<svg part="element" class="circular" viewBox="25 25 50 50">
|
|
803
|
+
<circle class="path" cx="50" cy="50" r="20" fill="none"/>
|
|
804
|
+
</svg>`
|
|
805
|
+
: ``
|
|
806
|
+
}
|
|
807
|
+
`;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
var loaderVersion = '5.0.0';
|
|
812
|
+
|
|
813
|
+
/* eslint-disable max-lines, curly */
|
|
814
|
+
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
815
|
+
// See LICENSE in the project root for license information.
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* @slot - Default slot for the text of the button.
|
|
820
|
+
* @slot icon - Slot to provide auro-icon for the button.
|
|
821
|
+
* @csspart button - Apply CSS to HTML5 button.
|
|
822
|
+
* @csspart loader - Apply CSS to auro-loader.
|
|
823
|
+
* @csspart text - Apply CSS to text slot.
|
|
824
|
+
* @csspart icon - Apply CSS to icon slot.
|
|
825
|
+
*/
|
|
826
|
+
|
|
827
|
+
/* eslint-disable lit/no-invalid-html, lit/binding-positions */
|
|
828
|
+
|
|
829
|
+
const ICON_ONLY_SHAPES = ['circle'];
|
|
830
|
+
|
|
831
|
+
/**
|
|
832
|
+
* AuroButton is a custom element that provides a styled, accessible button with support for various states and form association.
|
|
833
|
+
* It is designed to be flexible, supporting loading states, icon slots, and integration with HTML5 forms.
|
|
834
|
+
* @property {'default', 'rounded', 'pill', 'circle'} shape - Defines the shape of the button.
|
|
835
|
+
* @property {'xs', 'sm', 'md', 'lg', 'xl'} size - Defines the size of the button.
|
|
836
|
+
* @property {'primary', 'secondary', 'tertiary', 'ghost', 'flat'} variant - Sets the button variant.
|
|
837
|
+
* @property {'submit', 'reset', 'button'} type - The type of button. Matches HTML5 Button Spec.
|
|
838
|
+
* @property {boolean} onDark - Indicates if the button is rendered in dark mode.
|
|
839
|
+
*/
|
|
840
|
+
class AuroButton extends AuroElement$1 {
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
* Enables form association for this element.
|
|
844
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/attachInternals
|
|
845
|
+
* @returns {boolean} - Returns true to enable form association.
|
|
846
|
+
*/
|
|
847
|
+
static get formAssociated() {
|
|
848
|
+
return true;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
constructor() {
|
|
852
|
+
super();
|
|
853
|
+
this.autofocus = false;
|
|
854
|
+
this.disabled = false;
|
|
855
|
+
this.loading = false;
|
|
856
|
+
this.size = "md";
|
|
857
|
+
this.shape = "rounded";
|
|
858
|
+
this.onDark = false;
|
|
859
|
+
this.fluid = false;
|
|
860
|
+
this.loadingText = this.loadingText || 'Loading...';
|
|
861
|
+
|
|
862
|
+
// Support for HTML5 forms
|
|
863
|
+
if (typeof this.attachInternals === 'function') {
|
|
864
|
+
this.internals = this.attachInternals();
|
|
865
|
+
} else {
|
|
866
|
+
this.internals = null;
|
|
867
|
+
|
|
868
|
+
// eslint-disable-next-line no-console
|
|
869
|
+
console.warn('This browser does not support form association features. Some form-related functionality may not work as expected. Consider using a polyfill or handling click events manually.');
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
/**
|
|
873
|
+
* Generate unique names for dependency components.
|
|
874
|
+
*/
|
|
875
|
+
const versioning = new AuroDependencyVersioning();
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* @private
|
|
879
|
+
*/
|
|
880
|
+
this.loaderTag = versioning.generateTag('auro-loader', loaderVersion, AuroLoader);
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
static get styles() {
|
|
884
|
+
return [
|
|
885
|
+
tokensCss$2,
|
|
886
|
+
styleCss$3,
|
|
887
|
+
colorCss$2,
|
|
888
|
+
shapeSize
|
|
889
|
+
];
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
static get properties() {
|
|
893
|
+
return {
|
|
894
|
+
|
|
895
|
+
...super.properties,
|
|
896
|
+
|
|
897
|
+
/**
|
|
898
|
+
* Override layout since it isn't used in this component.
|
|
899
|
+
* @private
|
|
900
|
+
*/
|
|
901
|
+
layout: {
|
|
902
|
+
type: Boolean,
|
|
903
|
+
attribute: false,
|
|
904
|
+
reflect: false
|
|
905
|
+
},
|
|
906
|
+
|
|
907
|
+
/**
|
|
908
|
+
* This Boolean attribute lets you specify that the button should have input focus when the page loads, unless overridden by the user.
|
|
909
|
+
*/
|
|
910
|
+
autofocus: {
|
|
911
|
+
type: Boolean,
|
|
912
|
+
reflect: true
|
|
913
|
+
},
|
|
914
|
+
|
|
915
|
+
/**
|
|
916
|
+
* If set to true, button will become disabled and not allow for interactions.
|
|
917
|
+
*/
|
|
918
|
+
disabled: {
|
|
919
|
+
type: Boolean,
|
|
920
|
+
reflect: true
|
|
921
|
+
},
|
|
922
|
+
|
|
923
|
+
/**
|
|
924
|
+
* Alters the shape of the button to be full width of its parent container.
|
|
925
|
+
*/
|
|
926
|
+
fluid: {
|
|
927
|
+
type: Boolean,
|
|
928
|
+
reflect: true
|
|
929
|
+
},
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* If set to true button text will be replaced with `auro-loader` and become disabled.
|
|
933
|
+
*/
|
|
934
|
+
loading: {
|
|
935
|
+
type: Boolean,
|
|
936
|
+
reflect: true
|
|
937
|
+
},
|
|
938
|
+
|
|
939
|
+
/**
|
|
940
|
+
* 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.
|
|
941
|
+
*/
|
|
942
|
+
loadingText: {
|
|
943
|
+
type: String
|
|
944
|
+
},
|
|
945
|
+
|
|
946
|
+
/**
|
|
947
|
+
* Populates `tabIndex` to define the focusable sequence in keyboard navigation.
|
|
948
|
+
*/
|
|
949
|
+
tIndex: {
|
|
950
|
+
type: String,
|
|
951
|
+
reflect: true
|
|
952
|
+
},
|
|
953
|
+
|
|
954
|
+
/**
|
|
955
|
+
* Sets title attribute. The information is most often shown as a tooltip text when the mouse moves over the element.
|
|
956
|
+
*/
|
|
957
|
+
title: {
|
|
958
|
+
type: String,
|
|
959
|
+
reflect: true
|
|
960
|
+
},
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* The type of the button. Possible values are: `submit`, `reset`, `button`.
|
|
964
|
+
*/
|
|
965
|
+
type: {
|
|
966
|
+
type: String,
|
|
967
|
+
reflect: true
|
|
968
|
+
},
|
|
969
|
+
|
|
970
|
+
/**
|
|
971
|
+
* Defines the value associated with the button which is submitted with the form data.
|
|
972
|
+
*/
|
|
973
|
+
value: {
|
|
974
|
+
type: String,
|
|
975
|
+
reflect: true
|
|
976
|
+
},
|
|
977
|
+
|
|
978
|
+
/**
|
|
979
|
+
* Sets button variant option.
|
|
980
|
+
* @default primary
|
|
981
|
+
*/
|
|
982
|
+
variant: {
|
|
983
|
+
type: String,
|
|
984
|
+
reflect: true
|
|
985
|
+
},
|
|
986
|
+
};
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
/**
|
|
990
|
+
* This will register this element with the browser.
|
|
991
|
+
* @param {string} [name="auro-button"] - The name of element that you want to register to.
|
|
992
|
+
*
|
|
993
|
+
* @example
|
|
994
|
+
* AuroButton.register("custom-button") // this will register this element to <custom-button/>
|
|
995
|
+
*
|
|
996
|
+
*/
|
|
997
|
+
static register(name = "auro-button") {
|
|
998
|
+
AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroButton);
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
/**
|
|
1002
|
+
* Internal method to apply focus to the HTML5 button.
|
|
1003
|
+
* @private
|
|
1004
|
+
* @returns {void}
|
|
1005
|
+
*/
|
|
1006
|
+
focus() {
|
|
1007
|
+
this.renderRoot.querySelector('button').focus();
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
/**
|
|
1011
|
+
* Submits the form that this button is associated with.
|
|
1012
|
+
* @private
|
|
1013
|
+
* @returns {void}
|
|
1014
|
+
*/
|
|
1015
|
+
surfaceSubmitEvent() {
|
|
1016
|
+
if (this.form) {
|
|
1017
|
+
this.form.requestSubmit();
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
/**
|
|
1022
|
+
* Returns the form element that this button is associated with.
|
|
1023
|
+
* @private
|
|
1024
|
+
* @returns {HTMLFormElement | null}
|
|
1025
|
+
*/
|
|
1026
|
+
get form() {
|
|
1027
|
+
return this.internals ? this.internals.form : null;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
/**
|
|
1031
|
+
* @private
|
|
1032
|
+
* @returns {Boolean}
|
|
1033
|
+
*/
|
|
1034
|
+
get hideText() {
|
|
1035
|
+
return ICON_ONLY_SHAPES.includes(this.shape);
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
/**
|
|
1039
|
+
* Returns the current value of the projected `aria-label` attribute or undefined if not set.
|
|
1040
|
+
* @returns {string | undefined}
|
|
1041
|
+
* @private
|
|
1042
|
+
*/
|
|
1043
|
+
get currentAriaLabel() {
|
|
1044
|
+
if (!this.attributeWatcher) return undefined;
|
|
1045
|
+
|
|
1046
|
+
const ariaLabel = this.attributeWatcher.getObservedAttribute("aria-label");
|
|
1047
|
+
return ariaLabel || undefined;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
/**
|
|
1051
|
+
* Returns the current value of the projected `aria-labelledby` attribute or undefined if not set.
|
|
1052
|
+
* @returns {string | undefined}
|
|
1053
|
+
* @private
|
|
1054
|
+
*/
|
|
1055
|
+
get currentAriaLabelledBy() {
|
|
1056
|
+
if (!this.attributeWatcher) return undefined;
|
|
1057
|
+
|
|
1058
|
+
const ariaLabelledBy = this.attributeWatcher.getObservedAttribute("aria-labelledby");
|
|
1059
|
+
return ariaLabelledBy || undefined;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* Renders the default layout for the button.
|
|
1064
|
+
* @returns {TemplateResult}
|
|
1065
|
+
* @private
|
|
1066
|
+
*/
|
|
1067
|
+
renderLayoutDefault() {
|
|
1068
|
+
const classes = {
|
|
1069
|
+
"util_insetLg--squish": true,
|
|
1070
|
+
"auro-button": true,
|
|
1071
|
+
wrapper: true,
|
|
1072
|
+
loading: this.loading,
|
|
1073
|
+
};
|
|
1074
|
+
|
|
1075
|
+
return html$1`
|
|
1076
|
+
<button
|
|
1077
|
+
part="button"
|
|
1078
|
+
aria-label="${ifDefined(this.loading ? this.loadingText : this.currentAriaLabel || undefined)}"
|
|
1079
|
+
aria-labelledby="${ifDefined(this.loading ? undefined : this.currentAriaLabelledBy || undefined)}"
|
|
1080
|
+
tabIndex="${ifDefined(this.tIndex)}"
|
|
1081
|
+
?autofocus="${this.autofocus}"
|
|
1082
|
+
class="${classMap(classes)}"
|
|
1083
|
+
?disabled="${this.disabled || this.loading}"
|
|
1084
|
+
?onDark="${this.onDark}"
|
|
1085
|
+
title="${ifDefined(this.title ? this.title : undefined)}"
|
|
1086
|
+
name="${ifDefined(this.name ? this.name : undefined)}"
|
|
1087
|
+
type="${ifDefined(this.type ? this.type : undefined)}"
|
|
1088
|
+
variant="${ifDefined(this.variant ? this.variant : undefined)}"
|
|
1089
|
+
.value="${ifDefined(this.value ? this.value : undefined)}"
|
|
1090
|
+
@click="${this.type === 'submit' ? this.surfaceSubmitEvent : undefined}"
|
|
1091
|
+
>
|
|
1092
|
+
${ifDefined(this.loading ? html$1`<${this.loaderTag} pulse part="loader"></${this.loaderTag}>` : undefined)}
|
|
1093
|
+
|
|
1094
|
+
<span class="contentWrapper">
|
|
1095
|
+
<span class="textSlot" part="text">
|
|
1096
|
+
${this.hideText ? undefined : html$1`<slot></slot>`}
|
|
1097
|
+
</span>
|
|
1098
|
+
|
|
1099
|
+
<span part="icon">
|
|
1100
|
+
<slot name="icon"></slot>
|
|
1101
|
+
</span>
|
|
1102
|
+
</span>
|
|
1103
|
+
</button>
|
|
1104
|
+
`;
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
/**
|
|
1108
|
+
* Renders the layout of the button
|
|
1109
|
+
* @returns {TemplateResult}
|
|
1110
|
+
* @private
|
|
1111
|
+
*/
|
|
1112
|
+
renderLayout() {
|
|
1113
|
+
return this.renderLayoutDefault();
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
var buttonVersion = '10.0.0';
|
|
1118
|
+
|
|
122
1119
|
// Copyright (c) 2020 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
123
1120
|
// See LICENSE in the project root for license information.
|
|
124
1121
|
|
|
@@ -465,8 +1462,12 @@ class AuroIcon extends BaseIcon {
|
|
|
465
1462
|
async firstUpdated() {
|
|
466
1463
|
await super.firstUpdated();
|
|
467
1464
|
|
|
468
|
-
|
|
469
|
-
|
|
1465
|
+
/**
|
|
1466
|
+
* icons provide a description for screen readers. Icon only instances Auro-button
|
|
1467
|
+
* depend on this description to provide context for the user using a screen reader.
|
|
1468
|
+
* Removes the SVG description for screen reader if ariaHidden is set to true.
|
|
1469
|
+
*/
|
|
1470
|
+
if (this.hasAttribute('ariaHidden') && this.svg) {
|
|
470
1471
|
const svgDesc = this.svg.querySelector('desc');
|
|
471
1472
|
|
|
472
1473
|
if (svgDesc) {
|
|
@@ -510,7 +1511,7 @@ class AuroIcon extends BaseIcon {
|
|
|
510
1511
|
}
|
|
511
1512
|
}
|
|
512
1513
|
|
|
513
|
-
var iconVersion = '8.0.
|
|
1514
|
+
var iconVersion = '8.0.4';
|
|
514
1515
|
|
|
515
1516
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
516
1517
|
// See LICENSE in the project root for license information.
|
|
@@ -737,17 +1738,30 @@ class AuroBibtemplate extends LitElement {
|
|
|
737
1738
|
|
|
738
1739
|
this.large = false;
|
|
739
1740
|
|
|
740
|
-
AuroLibraryRuntimeUtils$
|
|
1741
|
+
AuroLibraryRuntimeUtils$3.prototype.handleComponentTagRename(this, 'auro-bibtemplate');
|
|
741
1742
|
|
|
742
1743
|
const versioning = new AuroDependencyVersioning();
|
|
1744
|
+
|
|
1745
|
+
/**
|
|
1746
|
+
* @private
|
|
1747
|
+
*/
|
|
743
1748
|
this.iconTag = versioning.generateTag('auro-formkit-bibtemplate-icon', iconVersion, AuroIcon);
|
|
1749
|
+
|
|
1750
|
+
/**
|
|
1751
|
+
* @private
|
|
1752
|
+
*/
|
|
744
1753
|
this.headerTag = versioning.generateTag('auro-formkit-bibtemplate-header', headerVersion, AuroHeader);
|
|
1754
|
+
|
|
1755
|
+
/**
|
|
1756
|
+
* @private
|
|
1757
|
+
*/
|
|
1758
|
+
this.buttonTag = versioning.generateTag('auro-formkit-input-button', buttonVersion, AuroButton);
|
|
745
1759
|
}
|
|
746
1760
|
|
|
747
1761
|
static get styles() {
|
|
748
1762
|
return [
|
|
749
|
-
colorCss$
|
|
750
|
-
styleCss$
|
|
1763
|
+
colorCss$3,
|
|
1764
|
+
styleCss$4,
|
|
751
1765
|
tokenCss
|
|
752
1766
|
];
|
|
753
1767
|
}
|
|
@@ -776,7 +1790,7 @@ class AuroBibtemplate extends LitElement {
|
|
|
776
1790
|
*
|
|
777
1791
|
*/
|
|
778
1792
|
static register(name = "auro-bibtemplate") {
|
|
779
|
-
AuroLibraryRuntimeUtils$
|
|
1793
|
+
AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroBibtemplate);
|
|
780
1794
|
}
|
|
781
1795
|
|
|
782
1796
|
/**
|
|
@@ -834,9 +1848,9 @@ class AuroBibtemplate extends LitElement {
|
|
|
834
1848
|
<div id="bibTemplate" part="bibtemplate">
|
|
835
1849
|
${this.isFullscreen ? html$1`
|
|
836
1850
|
<div id="headerContainer">
|
|
837
|
-
|
|
1851
|
+
<${this.buttonTag} id="closeButton" variant="ghost" shape="circle" size="sm" @click="${this.onCloseButtonClick}">
|
|
838
1852
|
<${this.iconTag} category="interface" name="x-lg"></${this.iconTag}>
|
|
839
|
-
|
|
1853
|
+
</${this.buttonTag}>
|
|
840
1854
|
<${this.headerTag} display="${this.large ? 'display' : '600'}" level="3" size="none" id="header" no-margin-block>
|
|
841
1855
|
<slot name="header"></slot>
|
|
842
1856
|
</${this.headerTag}>
|