@getflip/swirl-components 0.88.1 → 0.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components.json +146 -3
- package/dist/cjs/index-506fe4ea.js +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/swirl-checkbox.cjs.entry.js +4 -3
- package/dist/cjs/swirl-chip.cjs.entry.js +6 -4
- package/dist/cjs/swirl-components.cjs.js +1 -1
- package/dist/cjs/swirl-description-list-item.cjs.entry.js +2 -1
- package/dist/cjs/swirl-radio.cjs.entry.js +4 -3
- package/dist/cjs/swirl-toolbar.cjs.entry.js +83 -0
- package/dist/collection/assets/pdfjs/pdf.worker.min.js +22 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/swirl-checkbox/swirl-checkbox.css +33 -0
- package/dist/collection/components/swirl-checkbox/swirl-checkbox.js +26 -2
- package/dist/collection/components/swirl-checkbox/swirl-checkbox.spec.js +1 -1
- package/dist/collection/components/swirl-chip/swirl-chip.css +34 -0
- package/dist/collection/components/swirl-chip/swirl-chip.js +23 -4
- package/dist/collection/components/swirl-chip/swirl-chip.spec.js +30 -21
- package/dist/collection/components/swirl-description-list-item/swirl-description-list-item.js +19 -1
- package/dist/collection/components/swirl-radio/swirl-radio.css +33 -0
- package/dist/collection/components/swirl-radio/swirl-radio.js +26 -2
- package/dist/collection/components/swirl-radio/swirl-radio.spec.js +1 -1
- package/dist/collection/components/swirl-toolbar/swirl-toolbar.css +7 -0
- package/dist/collection/components/swirl-toolbar/swirl-toolbar.js +128 -0
- package/dist/collection/components/swirl-toolbar/swirl-toolbar.spec.js +26 -0
- package/dist/collection/components/swirl-toolbar/swirl-toolbar.stories.js +24 -0
- package/dist/components/assets/pdfjs/pdf.worker.min.js +22 -0
- package/dist/components/swirl-checkbox.js +6 -4
- package/dist/components/swirl-chip.js +8 -6
- package/dist/components/swirl-description-list-item.js +3 -1
- package/dist/components/swirl-radio.js +6 -4
- package/dist/components/swirl-toolbar.d.ts +11 -0
- package/dist/components/swirl-toolbar.js +107 -0
- package/dist/esm/index-99d0060d.js +4 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/swirl-checkbox.entry.js +4 -3
- package/dist/esm/swirl-chip.entry.js +6 -4
- package/dist/esm/swirl-components.js +1 -1
- package/dist/esm/swirl-description-list-item.entry.js +2 -1
- package/dist/esm/swirl-radio.entry.js +4 -3
- package/dist/esm/swirl-toolbar.entry.js +79 -0
- package/dist/swirl-components/p-240552ca.entry.js +1 -0
- package/dist/swirl-components/p-7c70d4b2.entry.js +1 -0
- package/dist/swirl-components/p-ae31163c.entry.js +1 -0
- package/dist/swirl-components/p-ea08c219.entry.js +1 -0
- package/dist/swirl-components/p-f75a91a5.entry.js +1 -0
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/dist/types/components/swirl-checkbox/swirl-checkbox.d.ts +2 -0
- package/dist/types/components/swirl-chip/swirl-chip.d.ts +1 -0
- package/dist/types/components/swirl-description-list-item/swirl-description-list-item.d.ts +1 -0
- package/dist/types/components/swirl-radio/swirl-radio.d.ts +2 -0
- package/dist/types/components/swirl-toolbar/swirl-toolbar.d.ts +15 -0
- package/dist/types/components/swirl-toolbar/swirl-toolbar.stories.d.ts +14 -0
- package/dist/types/components.d.ts +31 -4
- package/package.json +13 -13
- package/vscode-data.json +57 -0
- package/dist/swirl-components/p-2c44a1cb.entry.js +0 -1
- package/dist/swirl-components/p-31eb71e2.entry.js +0 -1
- package/dist/swirl-components/p-62f1aaae.entry.js +0 -1
- package/dist/swirl-components/p-d6034b86.entry.js +0 -1
|
@@ -3,7 +3,7 @@ import { c as classnames } from './index2.js';
|
|
|
3
3
|
import { d as defineCustomElement$3 } from './swirl-icon-check-strong2.js';
|
|
4
4
|
import { d as defineCustomElement$2 } from './swirl-visually-hidden2.js';
|
|
5
5
|
|
|
6
|
-
const swirlCheckboxCss = ".sc-swirl-checkbox-h{display:inline-flex}.sc-swirl-checkbox-h *.sc-swirl-checkbox{box-sizing:border-box}.checkbox.sc-swirl-checkbox{display:inline-flex;line-height:var(--s-line-height-base);cursor:pointer}.checkbox.sc-swirl-checkbox:focus-within .checkbox__box.sc-swirl-checkbox{box-shadow:0 0 0 0.0625rem var(--s-background-default),\n 0 0 0 0.1875rem var(--s-focus-default)}.checkbox--checked.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox,.checkbox--indeterminate.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox{border-color:var(--s-interactive-primary-hovered);background-color:var(--s-interactive-primary-hovered)}.checkbox--checked.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox,.checkbox--indeterminate.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{border-color:var(--s-icon-highlight);color:var(--s-text-on-status);background-color:var(--s-icon-highlight)}.checkbox--invalid.checkbox--checked.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox,.checkbox--invalid.checkbox--indeterminate.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{background-color:var(--s-icon-critical)}.checkbox--invalid.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{border-color:var(--s-icon-critical)}.checkbox--disabled.sc-swirl-checkbox{cursor:default}.checkbox--disabled.checkbox--checked.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox,.checkbox--disabled.checkbox--indeterminate.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox{border-color:var(--s-icon-disabled);background-color:var(--s-icon-disabled)}.checkbox--disabled.checkbox--checked.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox,.checkbox--disabled.checkbox--indeterminate.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{background-color:var(--s-icon-disabled)}.checkbox--disabled.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox{background-color:transparent}.checkbox--disabled.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{border-color:var(--s-icon-disabled)}.checkbox--disabled.sc-swirl-checkbox .checkbox__label.sc-swirl-checkbox,.checkbox--disabled.sc-swirl-checkbox .checkbox__description.sc-swirl-checkbox{color:var(--s-text-disabled)}.checkbox--label-weight-regular.sc-swirl-checkbox .checkbox__label.sc-swirl-checkbox{font-weight:var(--s-font-weight-regular)}.checkbox__control.sc-swirl-checkbox{position:relative;width:1.5rem;height:1.5rem;padding:var(--s-space-2);flex-shrink:0}.checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox{background-color:var(--s-action-neutral-hovered)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.checkbox__control.sc-swirl-checkbox{width:1.375rem;height:1.375rem}}.checkbox__box.sc-swirl-checkbox{position:relative;z-index:1;display:flex;width:100%;height:100%;justify-content:center;align-items:center;border:0.125rem solid var(--s-icon-default);border-radius:var(--s-border-radius-s)}.checkbox__icon.sc-swirl-checkbox{display:inline-flex;width:1.0625rem;height:1.0625rem}.checkbox__icon.sc-swirl-checkbox>*.sc-swirl-checkbox::part(icon){width:1.0625rem;height:1.0625rem}.checkbox__indeterminate-icon.sc-swirl-checkbox{position:relative;width:100%;height:100%}.checkbox__indeterminate-icon.sc-swirl-checkbox:after{position:absolute;top:50%;left:50%;width:0.625rem;height:0.125rem;border-radius:0.0625rem;background-color:currentColor;content:\"\";transform:translate3d(-50%, -50%, 0)}.checkbox__label-container.sc-swirl-checkbox{display:inline-flex;margin-left:var(--s-space-8);padding-top:var(--s-space-2);align-items:flex-start;flex-direction:column}.checkbox__label.sc-swirl-checkbox{font-weight:var(--s-font-weight-medium)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.checkbox__label.sc-swirl-checkbox{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.checkbox__description.sc-swirl-checkbox{color:var(--s-text-subdued)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.checkbox__description.sc-swirl-checkbox{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}";
|
|
6
|
+
const swirlCheckboxCss = ".sc-swirl-checkbox-h{display:inline-flex}.sc-swirl-checkbox-h *.sc-swirl-checkbox{box-sizing:border-box}.checkbox.sc-swirl-checkbox{display:inline-flex;line-height:var(--s-line-height-base);cursor:pointer}.checkbox.sc-swirl-checkbox:focus-within .checkbox__box.sc-swirl-checkbox{box-shadow:0 0 0 0.0625rem var(--s-background-default),\n 0 0 0 0.1875rem var(--s-focus-default)}.checkbox--variant-card.sc-swirl-checkbox{width:100%;padding:var(--s-space-16);border:0.0625rem solid var(--s-border-default);border-radius:var(--s-border-radius-sm);background-color:var(--s-surface)}.checkbox--variant-card.sc-swirl-checkbox:focus-within{box-shadow:0 0 0 0.125rem var(--s-background-default),\n 0 0 0 0.25rem var(--s-focus-default)}.checkbox--variant-card.sc-swirl-checkbox:focus-within .checkbox__box.sc-swirl-checkbox{box-shadow:none}.checkbox--variant-card.sc-swirl-checkbox:hover:not(.checkbox--disabled){background-color:var(--s-surface-hovered)}.checkbox--variant-card.sc-swirl-checkbox:active:not(.checkbox--disabled){background-color:var(--s-surface-pressed)}.checkbox--variant-card.checkbox--checked.sc-swirl-checkbox:not(.checkbox--disabled){border-color:var(--s-border-highlight)}.checkbox--variant-card.checkbox--invalid.sc-swirl-checkbox:not(.checkbox--disabled){border-color:var(--s-border-critical)}.checkbox--checked.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox,.checkbox--indeterminate.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox{border-color:var(--s-interactive-primary-hovered);background-color:var(--s-interactive-primary-hovered)}.checkbox--checked.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox,.checkbox--indeterminate.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{border-color:var(--s-icon-highlight);color:var(--s-text-on-status);background-color:var(--s-icon-highlight)}.checkbox--invalid.checkbox--checked.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox,.checkbox--invalid.checkbox--indeterminate.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{background-color:var(--s-icon-critical)}.checkbox--invalid.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{border-color:var(--s-icon-critical)}.checkbox--disabled.sc-swirl-checkbox{cursor:default}.checkbox--disabled.checkbox--checked.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox,.checkbox--disabled.checkbox--indeterminate.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox{border-color:var(--s-icon-disabled);background-color:var(--s-icon-disabled)}.checkbox--disabled.checkbox--checked.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox,.checkbox--disabled.checkbox--indeterminate.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{background-color:var(--s-icon-disabled)}.checkbox--disabled.sc-swirl-checkbox .checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox{background-color:transparent}.checkbox--disabled.sc-swirl-checkbox .checkbox__box.sc-swirl-checkbox{border-color:var(--s-icon-disabled)}.checkbox--disabled.sc-swirl-checkbox .checkbox__label.sc-swirl-checkbox,.checkbox--disabled.sc-swirl-checkbox .checkbox__description.sc-swirl-checkbox{color:var(--s-text-disabled)}.checkbox--label-weight-regular.sc-swirl-checkbox .checkbox__label.sc-swirl-checkbox{font-weight:var(--s-font-weight-regular)}.checkbox__control.sc-swirl-checkbox{position:relative;width:1.5rem;height:1.5rem;padding:var(--s-space-2);flex-shrink:0}.checkbox__control.sc-swirl-checkbox:hover .checkbox__box.sc-swirl-checkbox{background-color:var(--s-action-neutral-hovered)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.checkbox__control.sc-swirl-checkbox{width:1.375rem;height:1.375rem}}.checkbox__box.sc-swirl-checkbox{position:relative;z-index:1;display:flex;width:100%;height:100%;justify-content:center;align-items:center;border:0.125rem solid var(--s-icon-default);border-radius:var(--s-border-radius-s)}.checkbox__icon.sc-swirl-checkbox{display:inline-flex;width:1.0625rem;height:1.0625rem}.checkbox__icon.sc-swirl-checkbox>*.sc-swirl-checkbox::part(icon){width:1.0625rem;height:1.0625rem}.checkbox__indeterminate-icon.sc-swirl-checkbox{position:relative;width:100%;height:100%}.checkbox__indeterminate-icon.sc-swirl-checkbox:after{position:absolute;top:50%;left:50%;width:0.625rem;height:0.125rem;border-radius:0.0625rem;background-color:currentColor;content:\"\";transform:translate3d(-50%, -50%, 0)}.checkbox__label-container.sc-swirl-checkbox{display:inline-flex;margin-left:var(--s-space-8);padding-top:var(--s-space-2);align-items:flex-start;flex-direction:column}.checkbox__label.sc-swirl-checkbox{font-weight:var(--s-font-weight-medium)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.checkbox__label.sc-swirl-checkbox{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.checkbox__description.sc-swirl-checkbox{color:var(--s-text-subdued)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.checkbox__description.sc-swirl-checkbox{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}";
|
|
7
7
|
|
|
8
8
|
const SwirlCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class SwirlCheckbox extends HTMLElement {
|
|
9
9
|
constructor() {
|
|
@@ -26,6 +26,7 @@ const SwirlCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class SwirlCheckbox ext
|
|
|
26
26
|
this.label = undefined;
|
|
27
27
|
this.labelWeight = "medium";
|
|
28
28
|
this.value = undefined;
|
|
29
|
+
this.variant = "default";
|
|
29
30
|
}
|
|
30
31
|
getAriaCheckedLabel(checked, unchecked) {
|
|
31
32
|
if (checked) {
|
|
@@ -45,14 +46,14 @@ const SwirlCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class SwirlCheckbox ext
|
|
|
45
46
|
const ariaInvalid = this.invalid === true || this.invalid === false
|
|
46
47
|
? String(this.invalid)
|
|
47
48
|
: undefined;
|
|
48
|
-
const className = classnames("checkbox", `checkbox--label-weight-${this.labelWeight}`, {
|
|
49
|
+
const className = classnames("checkbox", `checkbox--label-weight-${this.labelWeight}`, `checkbox--variant-${this.variant}`, {
|
|
49
50
|
"checkbox--checked": checked,
|
|
50
51
|
"checkbox--disabled": this.disabled,
|
|
51
52
|
"checkbox--indeterminate": indeterminate,
|
|
52
53
|
"checkbox--invalid": this.invalid,
|
|
53
54
|
"checkbox--unchecked": unchecked,
|
|
54
55
|
});
|
|
55
|
-
return (h(Host,
|
|
56
|
+
return (h(Host, { style: { width: this.variant === "card" ? "100%" : undefined } }, h("label", { class: className, htmlFor: this.inputId }, h("span", { class: "checkbox__control" }, h("swirl-visually-hidden", null, h("input", { "aria-checked": ariaCheckedLabel, "aria-describedby": this.swirlAriaDescribedby, "aria-invalid": ariaInvalid, "aria-label": this.swirlAriaLabel, checked: checked, class: "checkbox__input", disabled: this.disabled, id: this.inputId, indeterminate: indeterminate, name: this.inputName, onChange: this.onChange, type: "checkbox", value: this.value })), h("span", { "aria-hidden": "true", class: "checkbox__box" }, h("span", { class: "checkbox__icon" }, checked && h("swirl-icon-check-strong", null), indeterminate && (h("span", { class: "checkbox__indeterminate-icon" }))))), showLabelContainer && (h("span", { class: "checkbox__label-container" }, this.label && h("span", { class: "checkbox__label" }, this.label), this.description && (h("span", { class: "checkbox__description" }, this.description)))))));
|
|
56
57
|
}
|
|
57
58
|
static get style() { return swirlCheckboxCss; }
|
|
58
59
|
}, [2, "swirl-checkbox", {
|
|
@@ -66,7 +67,8 @@ const SwirlCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class SwirlCheckbox ext
|
|
|
66
67
|
"invalid": [4],
|
|
67
68
|
"label": [1],
|
|
68
69
|
"labelWeight": [1, "label-weight"],
|
|
69
|
-
"value": [1]
|
|
70
|
+
"value": [1],
|
|
71
|
+
"variant": [1]
|
|
70
72
|
}]);
|
|
71
73
|
function defineCustomElement$1() {
|
|
72
74
|
if (typeof customElements === "undefined") {
|
|
@@ -4,13 +4,12 @@ import { g as getDesktopMediaQuery } from './utils.js';
|
|
|
4
4
|
import { d as defineCustomElement$3 } from './swirl-icon-close2.js';
|
|
5
5
|
import { d as defineCustomElement$2 } from './swirl-progress-indicator2.js';
|
|
6
6
|
|
|
7
|
-
const swirlChipCss = "
|
|
7
|
+
const swirlChipCss = ".sc-swirl-chip-h{position:relative;display:inline-flex;max-width:100%}.sc-swirl-chip-h *.sc-swirl-chip{box-sizing:border-box}.chip.sc-swirl-chip{display:inline-flex;overflow:hidden;max-width:100%;height:2.5rem;padding:0;border:0.0625rem solid var(--s-border-default);border-radius:1.25rem;color:var(--s-text-subdued);background-color:var(--s-surface-overlay-default);font:inherit;font-size:var(--s-font-size-sm);font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-sm);flex-direction:column}.chip--size-s.sc-swirl-chip{height:2rem}.chip--size-s.chip--removable.sc-swirl-chip .chip__inner.sc-swirl-chip{padding-right:calc(1.5rem + var(--s-space-12))}.chip--size-s.sc-swirl-chip .chip__inner.sc-swirl-chip{padding-right:var(--s-space-12);padding-left:var(--s-space-12)}.chip--size-s.sc-swirl-chip+.chip__remove-button.sc-swirl-chip{top:var(--s-space-4);width:1.5rem;height:1.5rem}.chip--interactive.sc-swirl-chip{cursor:pointer}.chip--interactive.sc-swirl-chip:hover{background-color:var(--s-surface-overlay-hovered)}.chip--interactive.sc-swirl-chip:hover .sc-swirl-chip::part(avatar){background-color:var(--s-surface-raised-hovered)}.chip--interactive.sc-swirl-chip:hover+.chip__remove-button.sc-swirl-chip{background-color:var(--s-surface-raised-default)}.chip--interactive.sc-swirl-chip:hover+.chip__remove-button.sc-swirl-chip:hover{background-color:var(--s-surface-raised-hovered)}.chip--interactive.sc-swirl-chip:hover+.chip__remove-button.sc-swirl-chip:active{background-color:var(--s-surface-overlay-pressed)}.chip--interactive.sc-swirl-chip:active{background-color:var(--s-surface-overlay-pressed)}.chip--interactive.sc-swirl-chip:active .sc-swirl-chip::part(avatar){background-color:var(--s-surface-raised-pressed)}.chip--interactive.sc-swirl-chip:active+.chip__remove-button.sc-swirl-chip{background-color:var(--s-surface-overlay-pressed)}.chip--icon-color-highlight.sc-swirl-chip .chip__icon.sc-swirl-chip{color:var(--s-icon-highlight)}.chip--removable.sc-swirl-chip .chip__inner.sc-swirl-chip{padding-right:calc(1.875rem + var(--s-space-12))}.chip--intent-critical.sc-swirl-chip{border-color:var(--s-border-critical);color:var(--s-text-critical)}.chip--intent-critical.sc-swirl-chip .chip__icon.sc-swirl-chip{color:var(--s-icon-critical)}.chip--border-radius-sm.sc-swirl-chip{border-radius:var(--s-border-radius-sm)}.chip--intent-success.sc-swirl-chip{border-color:var(--s-border-success);color:var(--s-text-success)}.chip--intent-success.sc-swirl-chip .chip__icon.sc-swirl-chip{color:var(--s-icon-success)}.chip--variant-outline.chip--pressed.sc-swirl-chip{background-color:var(--s-action-primary-default);color:var(--s-text-on-action-primary)}.chip--variant-outline.chip--pressed.sc-swirl-chip:hover{background-color:var(--s-action-primary-hovered)}.chip--variant-outline.chip--pressed.sc-swirl-chip:hover+.chip__remove-button.sc-swirl-chip{background-color:var(--s-action-primary-hovered)}.chip--variant-outline.chip--pressed.sc-swirl-chip:active{background-color:var(--s-action-primary-pressed)}.chip--variant-outline.chip--pressed.sc-swirl-chip:active+.chip__remove-button.sc-swirl-chip{background-color:var(--s-action-primary-pressed)}.chip--variant-outline.chip--pressed.sc-swirl-chip+.chip__remove-button.sc-swirl-chip{background-color:var(--s-action-primary-default);color:var(--s-text-on-action-primary)}.chip--variant-outline.chip--pressed.sc-swirl-chip+.chip__remove-button.sc-swirl-chip:hover{background-color:var(--s-action-primary-hovered)}.chip--variant-outline.chip--pressed.sc-swirl-chip+.chip__remove-button.sc-swirl-chip:active{background-color:var(--s-action-primary-pressed)}.chip--variant-plain.sc-swirl-chip{height:auto;border:none;border-radius:0;background-color:transparent}.chip--variant-plain.chip--interactive.sc-swirl-chip:hover{background-color:transparent;text-decoration:underline;text-underline-offset:var(--s-space-4)}.chip--variant-plain.chip--interactive.sc-swirl-chip:hover .sc-swirl-chip::part(avatar){background-color:var(--s-surface-raised-hovered)}.chip--variant-plain.chip--interactive.sc-swirl-chip:active{background-color:transparent}.chip--variant-plain.chip--interactive.sc-swirl-chip:active .sc-swirl-chip::part(avatar){background-color:var(--s-surface-raised-pressed)}.chip--variant-plain.chip--removable.sc-swirl-chip .chip__inner.sc-swirl-chip{padding-right:var(--s-space-12)}.chip--variant-plain.sc-swirl-chip+.chip__remove-button.sc-swirl-chip{position:relative;top:0;right:auto}.chip--variant-plain.sc-swirl-chip .chip__inner.sc-swirl-chip{padding-right:0;padding-left:0}.chip--has-progress.sc-swirl-chip+.chip__remove-button.sc-swirl-chip{top:0.1875rem}.chip__inner.sc-swirl-chip{display:inline-flex;height:100%;padding-right:var(--s-space-16);padding-left:var(--s-space-16);align-items:center}.chip__avatar.sc-swirl-chip,.chip__icon.sc-swirl-chip{display:inline-flex;margin-right:var(--s-space-8);flex-shrink:0}.chip__avatar.sc-swirl-chip{overflow:hidden;width:1.75rem;height:1.75rem;margin-left:-0.625rem}.chip__icon.sc-swirl-chip{margin-left:-0.25rem;color:var(--s-icon-default)}.chip__label.sc-swirl-chip{overflow:hidden;flex-grow:1;white-space:nowrap;text-overflow:ellipsis}.chip__progress-indicator.sc-swirl-chip{width:100%}.chip__remove-button.sc-swirl-chip{position:absolute;top:0.3125rem;right:var(--s-space-4);display:inline-flex;width:1.875rem;height:1.875rem;padding:0;justify-content:center;align-items:center;border:none;border-radius:50%;color:var(--s-icon-default);background-color:var(--s-surface-overlay-default);cursor:pointer}.chip__remove-button.sc-swirl-chip:hover{background-color:var(--s-surface-overlay-hovered)}.chip__remove-button.sc-swirl-chip:active{background-color:var(--s-surface-overlay-pressed)}";
|
|
8
8
|
|
|
9
9
|
const SwirlChip$1 = /*@__PURE__*/ proxyCustomElement(class SwirlChip extends HTMLElement {
|
|
10
10
|
constructor() {
|
|
11
11
|
super();
|
|
12
12
|
this.__registerHost();
|
|
13
|
-
this.__attachShadow();
|
|
14
13
|
this.remove = createEvent(this, "remove", 7);
|
|
15
14
|
this.desktopMediaQuery = getDesktopMediaQuery();
|
|
16
15
|
this.desktopMediaQueryHandler = (event) => {
|
|
@@ -23,6 +22,7 @@ const SwirlChip$1 = /*@__PURE__*/ proxyCustomElement(class SwirlChip extends HTM
|
|
|
23
22
|
this.interactive = false;
|
|
24
23
|
this.label = undefined;
|
|
25
24
|
this.progress = undefined;
|
|
25
|
+
this.pressed = undefined;
|
|
26
26
|
this.progressBarLabel = "Loading progress";
|
|
27
27
|
this.removable = undefined;
|
|
28
28
|
this.removeButtonLabel = "Remove";
|
|
@@ -45,19 +45,20 @@ const SwirlChip$1 = /*@__PURE__*/ proxyCustomElement(class SwirlChip extends HTM
|
|
|
45
45
|
icon?.setAttribute("size", iconSize);
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
|
-
const Tag = this.interactive ? "button" : "span";
|
|
48
|
+
const Tag = this.interactive || this.pressed !== undefined ? "button" : "span";
|
|
49
49
|
const showAvatar = Boolean(this.el.querySelector('[slot="avatar"]'));
|
|
50
50
|
const showIcon = !showAvatar && Boolean(this.icon);
|
|
51
51
|
const className = classnames("chip", `chip--border-radius-${this.borderRadius}`, `chip--icon-color-${this.iconColor}`, `chip--intent-${this.intent}`, `chip--size-${this.size}`, `chip--variant-${this.variant}`, {
|
|
52
|
+
"chip--pressed": this.pressed,
|
|
52
53
|
"chip--has-progress": this.progress !== undefined,
|
|
53
|
-
"chip--interactive": this.interactive,
|
|
54
|
+
"chip--interactive": this.interactive || this.pressed !== undefined,
|
|
54
55
|
"chip--removable": this.removable,
|
|
55
56
|
});
|
|
56
|
-
return (h(Host, null, h(Tag, { class: className, type: this.interactive ? "button" : undefined }, h("span", { class: "chip__inner" }, showAvatar && (h("span", { class: "chip__avatar" }, h("slot", { name: "avatar" }))), showIcon && (h("span", { class: "chip__icon", innerHTML: this.icon, ref: (el) => (this.iconEl = el) })), h("span", { class: "chip__label" }, this.label)), this.progress !== undefined && (h("span", { class: "chip__progress-indicator" }, h("swirl-progress-indicator", { label: this.progressBarLabel, value: this.progress })))), this.removable && (h("button", { "aria-label": this.removeButtonLabel, class: "chip__remove-button", onClick: this.remove.emit }, h("swirl-icon-close", { size: 20 })))));
|
|
57
|
+
return (h(Host, null, h(Tag, { class: className, type: this.interactive ? "button" : undefined, "aria-pressed": this.pressed !== undefined ? String(this.pressed) : undefined }, h("span", { class: "chip__inner" }, showAvatar && (h("span", { class: "chip__avatar" }, h("slot", { name: "avatar" }))), showIcon && (h("span", { class: "chip__icon", innerHTML: this.icon, ref: (el) => (this.iconEl = el) })), h("span", { class: "chip__label" }, this.label)), this.progress !== undefined && (h("span", { class: "chip__progress-indicator" }, h("swirl-progress-indicator", { label: this.progressBarLabel, value: this.progress })))), this.removable && (h("button", { "aria-label": this.removeButtonLabel, class: "chip__remove-button", onClick: this.remove.emit }, h("swirl-icon-close", { size: 20 })))));
|
|
57
58
|
}
|
|
58
59
|
get el() { return this; }
|
|
59
60
|
static get style() { return swirlChipCss; }
|
|
60
|
-
}, [
|
|
61
|
+
}, [6, "swirl-chip", {
|
|
61
62
|
"borderRadius": [1, "border-radius"],
|
|
62
63
|
"icon": [1],
|
|
63
64
|
"iconColor": [1, "icon-color"],
|
|
@@ -65,6 +66,7 @@ const SwirlChip$1 = /*@__PURE__*/ proxyCustomElement(class SwirlChip extends HTM
|
|
|
65
66
|
"interactive": [4],
|
|
66
67
|
"label": [1],
|
|
67
68
|
"progress": [2],
|
|
69
|
+
"pressed": [4],
|
|
68
70
|
"progressBarLabel": [1, "progress-bar-label"],
|
|
69
71
|
"removable": [4],
|
|
70
72
|
"removeButtonLabel": [1, "remove-button-label"],
|
|
@@ -9,16 +9,18 @@ const SwirlDescriptionListItem$1 = /*@__PURE__*/ proxyCustomElement(class SwirlD
|
|
|
9
9
|
this.__registerHost();
|
|
10
10
|
this.__attachShadow();
|
|
11
11
|
this.bordered = true;
|
|
12
|
+
this.maxWidth = undefined;
|
|
12
13
|
this.orientation = "horizontal";
|
|
13
14
|
this.term = undefined;
|
|
14
15
|
}
|
|
15
16
|
render() {
|
|
16
17
|
const className = classnames("description-list-item", `description-list-item--orientation-${this.orientation}`, { "description-list-item--bordered": this.bordered });
|
|
17
|
-
return (h(Host, { role: "listitem" }, h("div", { class: className, part: "description-list-item", role: "group" }, h("div", { class: "description-list-item__term", part: "description-list-item__term", role: "term" }, this.term), h("div", { class: "description-list-item__description", role: "definition" }, h("slot", null)))));
|
|
18
|
+
return (h(Host, { role: "listitem" }, h("div", { class: className, part: "description-list-item", role: "group" }, h("div", { class: "description-list-item__term", part: "description-list-item__term", role: "term" }, this.term), h("div", { style: { maxWidth: this.maxWidth }, class: "description-list-item__description", role: "definition" }, h("slot", null)))));
|
|
18
19
|
}
|
|
19
20
|
static get style() { return swirlDescriptionListItemCss; }
|
|
20
21
|
}, [1, "swirl-description-list-item", {
|
|
21
22
|
"bordered": [4],
|
|
23
|
+
"maxWidth": [1, "max-width"],
|
|
22
24
|
"orientation": [1],
|
|
23
25
|
"term": [1]
|
|
24
26
|
}]);
|
|
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
|
2
2
|
import { c as classnames } from './index2.js';
|
|
3
3
|
import { d as defineCustomElement$2 } from './swirl-visually-hidden2.js';
|
|
4
4
|
|
|
5
|
-
const swirlRadioCss = ".sc-swirl-radio-h{display:inline-flex}.sc-swirl-radio-h *.sc-swirl-radio{box-sizing:border-box}.radio.sc-swirl-radio{display:inline-flex;line-height:var(--s-line-height-base);cursor:pointer}.radio.sc-swirl-radio:focus-within .radio__box.sc-swirl-radio{box-shadow:0 0 0 0.0625rem var(--s-background-default),\n 0 0 0 0.1875rem var(--s-focus-default)}.radio--checked.sc-swirl-radio .radio__control.sc-swirl-radio:hover .radio__box.sc-swirl-radio{border-color:var(--s-interactive-primary-hovered);background-color:var(--s-interactive-primary-hovered)}.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio{position:relative;border-color:var(--s-icon-highlight);background-color:var(--s-icon-highlight)}.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio:after{position:absolute;top:50%;left:50%;width:0.5rem;height:0.5rem;border-radius:50%;background-color:var(--s-background-default);content:\"\";transform:translate3d(-50%, -50%, 0)}.radio--invalid.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio,.radio--invalid.radio--indeterminate.sc-swirl-radio .radio__box.sc-swirl-radio{background-color:var(--s-icon-critical)}.radio--invalid.sc-swirl-radio .radio__box.sc-swirl-radio{border-color:var(--s-icon-critical)}.radio--disabled.sc-swirl-radio{cursor:default}.radio--disabled.radio--checked.sc-swirl-radio .radio__control.sc-swirl-radio:hover .radio__box.sc-swirl-radio{border-color:var(--s-icon-disabled);background-color:transparent}.radio--disabled.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio{border-color:var(--s-icon-disabled);background-color:var(--s-background-default)}.radio--disabled.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio:after{background-color:var(--s-icon-disabled)}.radio--disabled.sc-swirl-radio .radio__control.sc-swirl-radio:hover .radio__box.sc-swirl-radio{background-color:transparent}.radio--disabled.sc-swirl-radio .radio__box.sc-swirl-radio{border-color:var(--s-icon-disabled)}.radio--disabled.sc-swirl-radio .radio__description.sc-swirl-radio,.radio--disabled.sc-swirl-radio .radio__label.sc-swirl-radio{color:var(--s-text-disabled)}.radio__control.sc-swirl-radio{position:relative;display:inline-flex;width:1.5rem;height:1.5rem;padding:var(--s-space-2);flex-shrink:0}.radio__control.sc-swirl-radio:hover .radio__box.sc-swirl-radio{background-color:var(--s-action-neutral-hovered)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.radio__control.sc-swirl-radio{width:1.375rem;height:1.375rem}}.radio__box.sc-swirl-radio{position:relative;display:flex;width:100%;height:100%;justify-content:center;align-items:center;border:0.125rem solid var(--s-icon-default);border-radius:50%}.radio__label-container.sc-swirl-radio{display:inline-flex;margin-left:var(--s-space-8);padding-top:var(--s-space-2);flex-direction:column}.radio__label.sc-swirl-radio{font-weight:var(--s-font-weight-medium)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.radio__label.sc-swirl-radio{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.radio__description.sc-swirl-radio{color:var(--s-text-subdued)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.radio__description.sc-swirl-radio{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}";
|
|
5
|
+
const swirlRadioCss = ".sc-swirl-radio-h{display:inline-flex}.sc-swirl-radio-h *.sc-swirl-radio{box-sizing:border-box}.radio.sc-swirl-radio{display:inline-flex;line-height:var(--s-line-height-base);cursor:pointer}.radio.sc-swirl-radio:focus-within .radio__box.sc-swirl-radio{box-shadow:0 0 0 0.0625rem var(--s-background-default),\n 0 0 0 0.1875rem var(--s-focus-default)}.radio--variant-card.sc-swirl-radio{width:100%;padding:var(--s-space-16);border:0.0625rem solid var(--s-border-default);border-radius:var(--s-border-radius-sm);background-color:var(--s-surface)}.radio--variant-card.sc-swirl-radio:focus-within{box-shadow:0 0 0 0.125rem var(--s-background-default),\n 0 0 0 0.25rem var(--s-focus-default)}.radio--variant-card.sc-swirl-radio:focus-within .radio__box.sc-swirl-radio{box-shadow:none}.radio--variant-card.sc-swirl-radio:hover:not(.radio--disabled){background-color:var(--s-surface-hovered)}.radio--variant-card.sc-swirl-radio:active:not(.radio--disabled){background-color:var(--s-surface-pressed)}.radio--variant-card.radio--checked.sc-swirl-radio:not(.radio--disabled){border-color:var(--s-border-highlight)}.radio--variant-card.radio--invalid.sc-swirl-radio:not(.radio--disabled){border-color:var(--s-border-critical)}.radio--checked.sc-swirl-radio .radio__control.sc-swirl-radio:hover .radio__box.sc-swirl-radio{border-color:var(--s-interactive-primary-hovered);background-color:var(--s-interactive-primary-hovered)}.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio{position:relative;border-color:var(--s-icon-highlight);background-color:var(--s-icon-highlight)}.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio:after{position:absolute;top:50%;left:50%;width:0.5rem;height:0.5rem;border-radius:50%;background-color:var(--s-background-default);content:\"\";transform:translate3d(-50%, -50%, 0)}.radio--invalid.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio,.radio--invalid.radio--indeterminate.sc-swirl-radio .radio__box.sc-swirl-radio{background-color:var(--s-icon-critical)}.radio--invalid.sc-swirl-radio .radio__box.sc-swirl-radio{border-color:var(--s-icon-critical)}.radio--disabled.sc-swirl-radio{cursor:default}.radio--disabled.radio--checked.sc-swirl-radio .radio__control.sc-swirl-radio:hover .radio__box.sc-swirl-radio{border-color:var(--s-icon-disabled);background-color:transparent}.radio--disabled.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio{border-color:var(--s-icon-disabled);background-color:var(--s-background-default)}.radio--disabled.radio--checked.sc-swirl-radio .radio__box.sc-swirl-radio:after{background-color:var(--s-icon-disabled)}.radio--disabled.sc-swirl-radio .radio__control.sc-swirl-radio:hover .radio__box.sc-swirl-radio{background-color:transparent}.radio--disabled.sc-swirl-radio .radio__box.sc-swirl-radio{border-color:var(--s-icon-disabled)}.radio--disabled.sc-swirl-radio .radio__description.sc-swirl-radio,.radio--disabled.sc-swirl-radio .radio__label.sc-swirl-radio{color:var(--s-text-disabled)}.radio__control.sc-swirl-radio{position:relative;display:inline-flex;width:1.5rem;height:1.5rem;padding:var(--s-space-2);flex-shrink:0}.radio__control.sc-swirl-radio:hover .radio__box.sc-swirl-radio{background-color:var(--s-action-neutral-hovered)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.radio__control.sc-swirl-radio{width:1.375rem;height:1.375rem}}.radio__box.sc-swirl-radio{position:relative;display:flex;width:100%;height:100%;justify-content:center;align-items:center;border:0.125rem solid var(--s-icon-default);border-radius:50%}.radio__label-container.sc-swirl-radio{display:inline-flex;margin-left:var(--s-space-8);padding-top:var(--s-space-2);flex-direction:column}.radio__label.sc-swirl-radio{font-weight:var(--s-font-weight-medium)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.radio__label.sc-swirl-radio{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}.radio__description.sc-swirl-radio{color:var(--s-text-subdued)}@media (min-width: 992px) and (max-width: 1439px) and (hover: hover),(min-width: 1440px){.radio__description.sc-swirl-radio{font-size:var(--s-font-size-sm);line-height:var(--s-line-height-sm)}}";
|
|
6
6
|
|
|
7
7
|
const SwirlRadio$1 = /*@__PURE__*/ proxyCustomElement(class SwirlRadio extends HTMLElement {
|
|
8
8
|
constructor() {
|
|
@@ -21,6 +21,7 @@ const SwirlRadio$1 = /*@__PURE__*/ proxyCustomElement(class SwirlRadio extends H
|
|
|
21
21
|
this.invalid = undefined;
|
|
22
22
|
this.label = undefined;
|
|
23
23
|
this.value = undefined;
|
|
24
|
+
this.variant = "default";
|
|
24
25
|
}
|
|
25
26
|
getAriaCheckedLabel(checked, unchecked) {
|
|
26
27
|
if (checked) {
|
|
@@ -36,13 +37,13 @@ const SwirlRadio$1 = /*@__PURE__*/ proxyCustomElement(class SwirlRadio extends H
|
|
|
36
37
|
const checked = this.checked === true || this.checked === "true";
|
|
37
38
|
const ariaCheckedLabel = this.getAriaCheckedLabel(checked, unchecked);
|
|
38
39
|
const ariaInvalid = this.invalid;
|
|
39
|
-
const className = classnames("radio", {
|
|
40
|
+
const className = classnames("radio", `radio--variant-${this.variant}`, {
|
|
40
41
|
"radio--checked": checked,
|
|
41
42
|
"radio--disabled": this.disabled,
|
|
42
43
|
"radio--invalid": this.invalid,
|
|
43
44
|
"radio--unchecked": unchecked,
|
|
44
45
|
});
|
|
45
|
-
return (h(Host,
|
|
46
|
+
return (h(Host, { style: { width: this.variant === "card" ? "100%" : undefined } }, h("label", { class: className, htmlFor: this.inputId }, h("span", { class: "radio__control" }, h("swirl-visually-hidden", null, h("input", { "aria-checked": ariaCheckedLabel, "aria-invalid": ariaInvalid, checked: checked, class: "radio__input", disabled: this.disabled, id: this.inputId, name: this.inputName, onChange: this.onChange, type: "radio", value: this.value })), h("span", { "aria-hidden": "true", class: "radio__box" })), h("span", { class: "radio__label-container" }, this.label && h("span", { class: "radio__label" }, this.label), this.description && (h("span", { class: "radio__description", innerHTML: this.description }))))));
|
|
46
47
|
}
|
|
47
48
|
static get style() { return swirlRadioCss; }
|
|
48
49
|
}, [2, "swirl-radio", {
|
|
@@ -53,7 +54,8 @@ const SwirlRadio$1 = /*@__PURE__*/ proxyCustomElement(class SwirlRadio extends H
|
|
|
53
54
|
"inputName": [1, "input-name"],
|
|
54
55
|
"invalid": [4],
|
|
55
56
|
"label": [1],
|
|
56
|
-
"value": [1]
|
|
57
|
+
"value": [1],
|
|
58
|
+
"variant": [1]
|
|
57
59
|
}]);
|
|
58
60
|
function defineCustomElement$1() {
|
|
59
61
|
if (typeof customElements === "undefined") {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SwirlToolbar extends Components.SwirlToolbar, HTMLElement {}
|
|
4
|
+
export const SwirlToolbar: {
|
|
5
|
+
prototype: SwirlToolbar;
|
|
6
|
+
new (): SwirlToolbar;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { b as getActiveElement } from './utils.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './swirl-stack2.js';
|
|
4
|
+
|
|
5
|
+
const swirlToolbarCss = ":host{display:block}:host *{box-sizing:border-box}";
|
|
6
|
+
|
|
7
|
+
const SwirlToolbar$1 = /*@__PURE__*/ proxyCustomElement(class SwirlToolbar extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
12
|
+
this.onKeyDown = (event) => {
|
|
13
|
+
if (event.code === "ArrowDown" || event.code === "ArrowRight") {
|
|
14
|
+
event.preventDefault();
|
|
15
|
+
this.focusNextItem();
|
|
16
|
+
}
|
|
17
|
+
else if (event.code === "ArrowUp" || event.code === "ArrowLeft") {
|
|
18
|
+
event.preventDefault();
|
|
19
|
+
this.focusPreviousItem();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
this.label = undefined;
|
|
23
|
+
this.orientation = "horizontal";
|
|
24
|
+
}
|
|
25
|
+
componentDidLoad() {
|
|
26
|
+
const items = this.getItems();
|
|
27
|
+
this.deactivateTabIndexes(items);
|
|
28
|
+
const firstButton = items[0]?.querySelector("button");
|
|
29
|
+
if (!Boolean(firstButton)) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
firstButton.tabIndex = 0;
|
|
33
|
+
}
|
|
34
|
+
getItems() {
|
|
35
|
+
return Array.from(this.el.querySelectorAll("swirl-button, swirl-chip"));
|
|
36
|
+
}
|
|
37
|
+
focusNextItem() {
|
|
38
|
+
const items = this.getItems();
|
|
39
|
+
const activeItemIndex = this.getActiveItemIndex(items);
|
|
40
|
+
const newIndex = (activeItemIndex + 1) % items.length;
|
|
41
|
+
this.focusItem(items[newIndex]);
|
|
42
|
+
}
|
|
43
|
+
focusPreviousItem() {
|
|
44
|
+
const items = this.getItems();
|
|
45
|
+
const activeItemIndex = this.getActiveItemIndex(items);
|
|
46
|
+
const newIndex = activeItemIndex === 0 ? items.length - 1 : activeItemIndex - 1;
|
|
47
|
+
this.focusItem(items[newIndex]);
|
|
48
|
+
}
|
|
49
|
+
getActiveItemIndex(items) {
|
|
50
|
+
const activeElement = getActiveElement();
|
|
51
|
+
return items.findIndex((item) => item === activeElement?.closest("swirl-button, swirl-chip"));
|
|
52
|
+
}
|
|
53
|
+
focusItem(item) {
|
|
54
|
+
const items = this.getItems();
|
|
55
|
+
this.deactivateTabIndexes(items);
|
|
56
|
+
if (!Boolean(item)) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const button = item.querySelector("button");
|
|
60
|
+
if (!Boolean(button)) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
button.tabIndex = 0;
|
|
64
|
+
button.focus();
|
|
65
|
+
}
|
|
66
|
+
deactivateTabIndexes(items) {
|
|
67
|
+
items.forEach((item) => {
|
|
68
|
+
const button = item.querySelector("button");
|
|
69
|
+
if (!Boolean(button)) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
button.tabIndex = -1;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
render() {
|
|
76
|
+
return (h(Host, null, h("swirl-stack", { align: "center", "aria-label": this.label, "aria-orientation": this.orientation, role: "toolbar", onKeyDown: this.onKeyDown, orientation: this.orientation, spacing: "8" }, h("slot", null))));
|
|
77
|
+
}
|
|
78
|
+
get el() { return this; }
|
|
79
|
+
static get style() { return swirlToolbarCss; }
|
|
80
|
+
}, [1, "swirl-toolbar", {
|
|
81
|
+
"label": [1],
|
|
82
|
+
"orientation": [1]
|
|
83
|
+
}]);
|
|
84
|
+
function defineCustomElement$1() {
|
|
85
|
+
if (typeof customElements === "undefined") {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const components = ["swirl-toolbar", "swirl-stack"];
|
|
89
|
+
components.forEach(tagName => { switch (tagName) {
|
|
90
|
+
case "swirl-toolbar":
|
|
91
|
+
if (!customElements.get(tagName)) {
|
|
92
|
+
customElements.define(tagName, SwirlToolbar$1);
|
|
93
|
+
}
|
|
94
|
+
break;
|
|
95
|
+
case "swirl-stack":
|
|
96
|
+
if (!customElements.get(tagName)) {
|
|
97
|
+
defineCustomElement$2();
|
|
98
|
+
}
|
|
99
|
+
break;
|
|
100
|
+
} });
|
|
101
|
+
}
|
|
102
|
+
defineCustomElement$1();
|
|
103
|
+
|
|
104
|
+
const SwirlToolbar = SwirlToolbar$1;
|
|
105
|
+
const defineCustomElement = defineCustomElement$1;
|
|
106
|
+
|
|
107
|
+
export { SwirlToolbar, defineCustomElement };
|
|
@@ -2975,6 +2975,10 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
2975
2975
|
return import(
|
|
2976
2976
|
/* webpackMode: "lazy" */
|
|
2977
2977
|
'./swirl-toast-provider.entry.js').then(processMod, consoleError);
|
|
2978
|
+
case 'swirl-toolbar':
|
|
2979
|
+
return import(
|
|
2980
|
+
/* webpackMode: "lazy" */
|
|
2981
|
+
'./swirl-toolbar.entry.js').then(processMod, consoleError);
|
|
2978
2982
|
case 'swirl-tooltip':
|
|
2979
2983
|
return import(
|
|
2980
2984
|
/* webpackMode: "lazy" */
|