@getflip/swirl-components 0.457.0 → 0.458.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 +66 -4
- package/dist/cjs/index-CnaJlT6Y.js +8 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/swirl-components.cjs.js +1 -1
- package/dist/cjs/{swirl-option-list_2.cjs.entry.js → swirl-option-list.cjs.entry.js} +0 -44
- package/dist/cjs/swirl-popover_2.cjs.entry.js +6 -3
- package/dist/cjs/swirl-tag.cjs.entry.js +48 -0
- package/dist/cjs/swirl-tree-navigation-item.cjs.entry.js +5 -4
- package/dist/cjs/swirl-video-thumbnail.cjs.entry.js +1 -1
- package/dist/cjs/swirl-visually-hidden.cjs.entry.js +1 -1
- package/dist/collection/components/swirl-popover/swirl-popover.js +6 -3
- package/dist/collection/components/swirl-tree-navigation-item/swirl-tree-navigation-item.css +4 -0
- package/dist/collection/components/swirl-tree-navigation-item/swirl-tree-navigation-item.js +43 -3
- package/dist/collection/components/swirl-video-thumbnail/swirl-video-thumbnail.js +1 -1
- package/dist/collection/components/swirl-visually-hidden/swirl-visually-hidden.js +1 -1
- package/dist/components/swirl-popover2.js +1 -1
- package/dist/components/swirl-tree-navigation-item.js +1 -1
- package/dist/components/swirl-video-thumbnail.js +1 -1
- package/dist/components/swirl-visually-hidden2.js +1 -1
- package/dist/esm/index-bQirifsr.js +8 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/swirl-components.js +1 -1
- package/dist/esm/{swirl-option-list_2.entry.js → swirl-option-list.entry.js} +1 -44
- package/dist/esm/swirl-popover_2.entry.js +6 -3
- package/dist/esm/swirl-tag.entry.js +46 -0
- package/dist/esm/swirl-tree-navigation-item.entry.js +5 -4
- package/dist/esm/swirl-video-thumbnail.entry.js +1 -1
- package/dist/esm/swirl-visually-hidden.entry.js +1 -1
- package/dist/swirl-components/{p-77eaf21e.entry.js → p-1252f991.entry.js} +1 -1
- package/dist/swirl-components/p-7a09b97b.entry.js +1 -0
- package/dist/swirl-components/p-a6736a9c.entry.js +1 -0
- package/dist/swirl-components/p-a721dc7d.entry.js +1 -0
- package/dist/swirl-components/p-aba55abe.entry.js +1 -0
- package/dist/swirl-components/p-cefdb75b.entry.js +1 -0
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/dist/types/components/swirl-tree-navigation-item/swirl-tree-navigation-item.d.ts +2 -0
- package/dist/types/components.d.ts +12 -0
- package/package.json +1 -1
- package/vscode-data.json +8 -0
- package/dist/swirl-components/p-3010c78d.entry.js +0 -1
- package/dist/swirl-components/p-4b83464c.entry.js +0 -1
- package/dist/swirl-components/p-6217c656.entry.js +0 -1
- package/dist/swirl-components/p-e185b0d9.entry.js +0 -1
|
@@ -157,6 +157,7 @@ const SwirlPopover = class {
|
|
|
157
157
|
this.popoverEl?.hidePopover();
|
|
158
158
|
this.active = false;
|
|
159
159
|
this.closing = false;
|
|
160
|
+
this.position = undefined;
|
|
160
161
|
this.updateTriggerAttributes(this.openedVia);
|
|
161
162
|
this.openedVia = undefined;
|
|
162
163
|
}, 150);
|
|
@@ -175,6 +176,7 @@ const SwirlPopover = class {
|
|
|
175
176
|
return;
|
|
176
177
|
}
|
|
177
178
|
this.adjustWidth();
|
|
179
|
+
this.position = undefined;
|
|
178
180
|
this.active = true;
|
|
179
181
|
this.openedVia = via;
|
|
180
182
|
this.updateTriggerAttributes(via);
|
|
@@ -306,15 +308,16 @@ const SwirlPopover = class {
|
|
|
306
308
|
"popover--transparent": this.transparent,
|
|
307
309
|
"popover--padded": this.padded,
|
|
308
310
|
});
|
|
309
|
-
return (index.h(index.Host, { key: '
|
|
311
|
+
return (index.h(index.Host, { key: 'f415f0f3489fa984ec57af318bd1adc9c33cb0b3' }, index.h("div", { key: '7061cd077de88e09645f0f011f76b4550eca92d4', popover: "manual", class: className, onKeyDown: this.onKeydown, ref: (el) => (this.popoverEl = el) }, index.h("div", { key: 'd87e049c3e5c68ce5e1c9fdf4813e04147c23fe1', "aria-hidden": !this.active ? "true" : "false", "aria-label": this.label, class: "popover__content", id: this.popoverId, part: "popover__content", role: "dialog", ref: (el) => (this.contentContainer = el), style: {
|
|
310
312
|
top: Boolean(this.position) ? `${this.position?.y}px` : "",
|
|
311
313
|
left: Boolean(this.position) ? `${this.position?.x}px` : "",
|
|
314
|
+
visibility: this.active && !this.position && !mobile ? "hidden" : undefined,
|
|
312
315
|
"--swirl-popover-border-radius": borderRadius,
|
|
313
|
-
}, tabindex: "-1" }, index.h("span", { key: '
|
|
316
|
+
}, tabindex: "-1" }, index.h("span", { key: '367b321f34695844f41a60242f11c7ed7f18f0cf', class: "popover__handle" }), index.h("div", { key: '538f60733248b127e79a65feccea4d337f11819a', class: "popover__scroll-container", part: "popover__scroll-container", ref: (el) => (this.scrollContainer = el), style: {
|
|
314
317
|
maxHeight: !mobile && Boolean(this.maxHeight)
|
|
315
318
|
? this.maxHeight
|
|
316
319
|
: undefined,
|
|
317
|
-
} }, index.h("slot", { key: '
|
|
320
|
+
} }, index.h("slot", { key: '8f914e6bfa86c74a1c2de77fd8aed9995b2b594b' }))), this.active && (index.h("div", { key: '6d0e157e13c1c9660275d1791b1ab5b8a39dc3a5', class: "popover__backdrop", onClick: this.onCloseButtonClick })))));
|
|
318
321
|
}
|
|
319
322
|
get el() { return index.getElement(this); }
|
|
320
323
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-CnaJlT6Y.js');
|
|
4
|
+
var index$1 = require('./index-DcAhLZUH.js');
|
|
5
|
+
|
|
6
|
+
const swirlTagCss = () => `:host{display:inline-flex;max-width:100%}:host *{box-sizing:border-box}.tag{display:inline-flex;max-width:100%;align-items:center;border-radius:var(--s-border-radius-s);color:var(--s-text-default);background-color:var(--swirl-tag-background-default);font-size:var(--s-font-size-sm);font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-sm);white-space:nowrap;border-style:solid;border-width:var(--s-border-width-default);border-color:transparent}.tag--size-s{padding:var(--s-space-0) var(--s-space-4)}.tag--size-s.tag--icon-position-end .tag__icon{margin-right:calc(-1 * var(--s-space-2))}.tag--size-s .tag__icon{margin-left:calc(-1 * var(--s-space-2))}.tag--size-m{padding:var(--s-space-2) var(--s-space-8)}.tag--icon-position-end .tag__icon{margin-right:calc(-1 * var(--s-space-4));margin-left:var(--s-space-4);order:2}.tag--hide-label{padding-right:0;padding-left:0}.tag--hide-label.tag--size-s .tag__icon{margin-right:0;margin-left:0}.tag--hide-label .tag__icon{margin-right:var(--s-space-2);margin-left:var(--s-space-2)}.tag--variant-outline{border-color:var(--s-border-strong)}.tag--variant-strong{color:var(--s-text-on-status);background-color:var(--s-surface-neutral-default)}.tag--variant-strong .tag__removal-button{color:var(--s-icon-on-status)}.tag--intent-info{color:var(--s-text-info);background-color:var(--s-surface-info-subdued)}.tag--intent-info .tag__removal-button{color:var(--s-icon-info)}.tag--intent-info.tag--variant-outline{border-color:var(--s-border-info)}.tag--intent-info.tag--variant-strong{color:var(--s-text-on-status);background-color:var(--s-surface-info-default)}.tag--intent-info.tag--variant-strong .tag__removal-button{color:var(--s-icon-on-status)}.tag--intent-critical{color:var(--s-text-critical);background-color:var(--s-surface-critical-subdued)}.tag--intent-critical .tag__removal-button{color:var(--s-icon-critical)}.tag--intent-critical.tag--variant-outline{border-color:var(--s-border-critical)}.tag--intent-critical.tag--variant-strong{color:var(--s-text-on-status);background-color:var(--s-surface-critical-default)}.tag--intent-critical.tag--variant-strong .tag__removal-button{color:var(--s-icon-on-status)}.tag--intent-warning{color:var(--s-text-warning);background-color:var(--s-surface-warning-subdued)}.tag--intent-warning .tag__removal-button{color:var(--s-icon-warning)}.tag--intent-warning.tag--variant-outline{border-color:var(--s-border-warning)}.tag--intent-warning.tag--variant-strong{color:var(--s-text-dark);background-color:var(--s-surface-warning-default)}.tag--intent-warning.tag--variant-strong .tag__removal-button{color:var(--s-icon-dark)}.tag--intent-success{color:var(--s-text-success);background-color:var(--s-surface-success-subdued)}.tag--intent-success .tag__removal-button{color:var(--s-icon-success)}.tag--intent-success.tag--variant-outline{border-color:var(--s-border-success)}.tag--intent-success.tag--variant-strong{color:var(--s-text-on-status);background-color:var(--s-surface-success-default)}.tag--intent-success.tag--variant-strong .tag__removal-button{color:var(--s-icon-on-status)}.tag--intent-special{color:var(--s-decorative-grape-text);background-color:var(--s-decorative-grape-surface-subdued)}.tag--intent-special .tag__removal-button{color:var(--s-decorative-grape-text)}.tag--intent-special.tag--variant-outline{border-color:var(--s-decorative-grape-text)}.tag--intent-special.tag--variant-strong{color:var(--s-text-on-status);background-color:var(--s-decorative-grape-surface)}.tag--intent-special.tag--variant-strong .tag__removal-button{color:var(--s-icon-on-status)}.tag--intent-translucent{color:var(--s-text-on-image);background-color:var(--s-surface-on-image-default)}.tag--intent-translucent .tag__removal-button{color:var(--s-icon-on-image)}.tag--intent-translucent.tag--variant-outline{border-color:var(--s-text-on-image)}.tag__icon{display:inline-flex;margin-right:var(--s-space-4);margin-left:calc(-1 * var(--s-space-4));flex-shrink:0;order:0}.tag__label{overflow:hidden;min-width:0;white-space:nowrap;text-overflow:ellipsis;order:1}.tag__removal-button{display:inline-flex;margin-right:calc(-1 * var(--s-space-4));margin-left:var(--s-space-4);padding:0;border:none;color:var(--s-icon-strong);background-color:transparent;cursor:pointer;flex-shrink:0;order:3}.tag__removal-button:focus:not(:focus-visible){outline:none}.tag__removal-button:focus-visible{outline-color:var(--s-focus-default)}`;
|
|
7
|
+
|
|
8
|
+
const SwirlTag = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
index.registerInstance(this, hostRef);
|
|
11
|
+
this.removeTag = index.createEvent(this, "remove", 7);
|
|
12
|
+
this.iconPosition = "start";
|
|
13
|
+
this.intent = "default";
|
|
14
|
+
this.size = "m";
|
|
15
|
+
this.removalButtonLabel = "Remove";
|
|
16
|
+
this.variant = "default";
|
|
17
|
+
this.onRemove = (event) => {
|
|
18
|
+
this.removeTag?.emit(event);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
componentDidLoad() {
|
|
22
|
+
this.forceIconProps();
|
|
23
|
+
}
|
|
24
|
+
componentWillLoad() {
|
|
25
|
+
this.forceVariant();
|
|
26
|
+
}
|
|
27
|
+
componentDidRender() {
|
|
28
|
+
this.forceIconProps();
|
|
29
|
+
}
|
|
30
|
+
forceIconProps() {
|
|
31
|
+
const icon = this.iconEl?.children[0];
|
|
32
|
+
icon?.setAttribute("size", "16");
|
|
33
|
+
}
|
|
34
|
+
forceVariant() {
|
|
35
|
+
if (Boolean(this.bordered)) {
|
|
36
|
+
console.warn('[Swirl] The "bordered" prop of swirl-tag is deprecated and will be removed with the next major release. Please use the "variant" prop as "outline" to achieve the same result.');
|
|
37
|
+
this.variant = "outline";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
render() {
|
|
41
|
+
const className = index$1.classnames("tag", `tag--icon-position-${this.iconPosition}`, `tag--intent-${this.intent}`, `tag--size-${this.size}`, `tag--variant-${this.variant}`, { "tag--hide-label": this.hideLabel });
|
|
42
|
+
return (index.h(index.Host, { key: '1761004fec8f52ef477c14dfb032db0cb4a2cae2' }, index.h("span", { key: '1531d418beb787bf5a85b32bf10017d24fe458b7', class: className, part: "tag" }, this.icon && (index.h("span", { key: '95db9c8289b2e770af02cc6eeb370a002b2bd7b1', class: "tag__icon", innerHTML: this.icon, ref: (el) => (this.iconEl = el) })), !this.hideLabel ? (index.h("span", { class: "tag__label" }, this.label)) : (index.h("swirl-visually-hidden", null, this.label)), this.removable && (index.h("button", { key: '1b99be433002b0a62f07b93ff6dd6e95fafef4c9', "aria-label": this.removalButtonLabel, class: "tag__removal-button", onClick: this.onRemove, tabIndex: this.el.ariaHidden === "true" ? -1 : undefined, type: "button" }, index.h("swirl-icon-close", { key: '2afaee043cd6b5ce579a3aa675beb5dba764539a', size: 16 }))))));
|
|
43
|
+
}
|
|
44
|
+
get el() { return index.getElement(this); }
|
|
45
|
+
};
|
|
46
|
+
SwirlTag.style = swirlTagCss();
|
|
47
|
+
|
|
48
|
+
exports.swirl_tag = SwirlTag;
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
var index = require('./index-CnaJlT6Y.js');
|
|
4
4
|
var index$1 = require('./index-DcAhLZUH.js');
|
|
5
5
|
|
|
6
|
-
const swirlTreeNavigationItemCss = () => `:host{display:inline-flex;width:100%}:host *{box-sizing:border-box}.tree-navigation-item{width:100%;list-style:none;border-radius:var(--s-border-radius-base)}.tree-navigation-item__link{display:inline-flex;align-items:center;width:100%;height:3rem;padding:0 var(--s-space-12) 0 var(--tree-nav-item-padding, var(--s-space-12));margin-bottom:var(--s-space-2);gap:calc(var(--s-space-4) - var(--s-space-2));min-width:0;border:none;background-color:transparent;color:var(--s-text-default);cursor:pointer;text-decoration:none;font:inherit;font-size:var(--s-font-size-sm);font-weight:var(--tree-nav-item-label-weight, var(--s-font-weight-medium));line-height:var(--s-line-height-sm);border-radius:var(--s-border-radius-base)}.tree-navigation-item__link:hover{background-color:var(--s-background-hovered)}.tree-navigation-item__link:active{background-color:var(--s-background-pressed)}.tree-navigation-item__link:focus{outline:none}.tree-navigation-item__link:focus-visible .tree-navigation-item__label{border-radius:var(--s-border-radius-xs);box-shadow:0 0 0 0.125rem var(--s-focus-default)}.tree-navigation-item__link--active{background-color:var(--s-background-hovered);color:var(--s-text-highlight);--tree-nav-item-label-weight:var(--s-font-weight-medium)}.tree-navigation-item__link--active:hover{background-color:var(--s-background-pressed)}.tree-navigation-item__link--active:active{background-color:var(--s-background-pressed)}.tree-navigation-item--expanded{height:100%}.tree-navigation-item__content{display:flex;align-items:center;min-width:0;flex:1}.tree-navigation-item__icon{display:inline-flex;flex-shrink:0;padding-right:var(--s-space-8)}.tree-navigation-item__toggle-icon{flex-shrink:0;max-height:1rem;color:var(--s-icon-default);margin-left:var(--s-space-4)}.tree-navigation-item__external-icon{max-height:1rem;color:var(--s-icon-default);margin-left:var(--s-space-4)}.tree-navigation-item__label{display:flex;align-items:center;min-width:0;flex:1}.tree-navigation-item__label-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tree-navigation-item__toggle-icon,.tree-navigation-item__external-icon{flex:0 0 auto;margin-left:var(--s-space-4)}.tree-navigation-item__children{display:flex;flex-direction:column;margin:0;padding:0;overflow:hidden;height:0;transition:height 0.3s ease-out}.tree-navigation-item__children>::slotted(swirl-tree-navigation-item){--tree-nav-item-padding:2.25rem;--tree-nav-item-label-weight:var(--s-font-weight-normal)}.tree-navigation-item__children>::slotted(*){opacity:1}.tree-navigation-item__toggle-icon{transition:transform 0.3s ease}.tree-navigation-item--expanded .tree-navigation-item__toggle-icon{transform:rotate(90deg)}`;
|
|
6
|
+
const swirlTreeNavigationItemCss = () => `:host{display:inline-flex;width:100%}:host *{box-sizing:border-box}.tree-navigation-item{width:100%;list-style:none;border-radius:var(--s-border-radius-base)}.tree-navigation-item__link{display:inline-flex;align-items:center;width:100%;height:3rem;padding:0 var(--s-space-12) 0 var(--tree-nav-item-padding, var(--s-space-12));margin-bottom:var(--s-space-2);gap:calc(var(--s-space-4) - var(--s-space-2));min-width:0;border:none;background-color:transparent;color:var(--s-text-default);cursor:pointer;text-decoration:none;font:inherit;font-size:var(--s-font-size-sm);font-weight:var(--tree-nav-item-label-weight, var(--s-font-weight-medium));line-height:var(--s-line-height-sm);border-radius:var(--s-border-radius-base)}.tree-navigation-item__link:hover{background-color:var(--s-background-hovered)}.tree-navigation-item__link:active{background-color:var(--s-background-pressed)}.tree-navigation-item__link:focus{outline:none}.tree-navigation-item__link:focus-visible .tree-navigation-item__label{border-radius:var(--s-border-radius-xs);box-shadow:0 0 0 0.125rem var(--s-focus-default)}.tree-navigation-item__link--active{background-color:var(--s-background-hovered);color:var(--s-text-highlight);--tree-nav-item-label-weight:var(--s-font-weight-medium)}.tree-navigation-item__link--active:hover{background-color:var(--s-background-pressed)}.tree-navigation-item__link--active:active{background-color:var(--s-background-pressed)}.tree-navigation-item--expanded{height:100%}.tree-navigation-item__content{display:flex;align-items:center;min-width:0;flex:1}.tree-navigation-item__icon{display:inline-flex;flex-shrink:0;padding-right:var(--s-space-8)}.tree-navigation-item__toggle-icon{flex-shrink:0;max-height:1rem;color:var(--s-icon-default);margin-left:var(--s-space-4)}.tree-navigation-item__external-icon{max-height:1rem;color:var(--s-icon-default);margin-left:var(--s-space-4)}.tree-navigation-item__label{display:flex;align-items:center;min-width:0;flex:1}.tree-navigation-item__label-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tree-navigation-item__toggle-icon,.tree-navigation-item__external-icon{flex:0 0 auto;margin-left:var(--s-space-4)}.tree-navigation-item__children{display:flex;flex-direction:column;margin:0;padding:0;overflow:hidden;height:0;transition:height 0.3s ease-out}.tree-navigation-item__children>::slotted(swirl-tree-navigation-item){--tree-nav-item-padding:2.25rem;--tree-nav-item-label-weight:var(--s-font-weight-normal)}.tree-navigation-item__children>::slotted(*){opacity:1}.tree-navigation-item__toggle-icon{transition:transform 0.3s ease}.tree-navigation-item--expanded .tree-navigation-item__toggle-icon{transform:rotate(90deg)}.tree-navigation-item__is-new-tag{flex-shrink:0}`;
|
|
7
7
|
|
|
8
8
|
const SwirlTreeNavigationItem = class {
|
|
9
9
|
constructor(hostRef) {
|
|
10
10
|
index.registerInstance(this, hostRef);
|
|
11
11
|
this.expansionChange = index.createEvent(this, "expansionChange", 7);
|
|
12
|
+
this.markAsNewLabel = "New";
|
|
12
13
|
this.level = 1;
|
|
13
14
|
this.expandable = true;
|
|
14
15
|
this.external = false;
|
|
@@ -90,12 +91,12 @@ const SwirlTreeNavigationItem = class {
|
|
|
90
91
|
"tree-navigation-item__link--active": this.active,
|
|
91
92
|
"tree-navigation-item__link--has-icon": Boolean(this.icon),
|
|
92
93
|
});
|
|
93
|
-
return (index.h(index.Host, { key: '
|
|
94
|
+
return (index.h(index.Host, { key: 'd4de1d1f3580a4eed510a774a3f650190d9313fe', role: "none" }, index.h("li", { key: 'f9672b6904f549f62abc87cd241889154bc39f2f', class: {
|
|
94
95
|
"tree-navigation-item": true,
|
|
95
96
|
"tree-navigation-item--expanded": this.expanded,
|
|
96
|
-
}, role: "treeitem", "aria-expanded": this.hasChildren ? this.expanded : undefined, "aria-level": this.level }, index.h(Tag, { key: '
|
|
97
|
+
}, role: "treeitem", "aria-expanded": this.hasChildren ? this.expanded : undefined, "aria-level": this.level }, index.h(Tag, { key: '6a5eb19fdf461ecc09087805c54b5c0f9b82311f', onClick: this.toggleExpanded, onKeyDown: this.onKeyDown, class: linkClassName, href: this.href, target: this.target, type: isLink ? undefined : "button", id: this.buttonId, "aria-current": this.active ? "page" : undefined, "aria-controls": this.hasChildren ? this.childrenId : undefined, "aria-expanded": this.hasChildren ? this.expanded : undefined }, index.h("span", { key: '5903777ca52fbcea134cb099c77a979ec38d780a', class: "tree-navigation-item__content" }, this.icon && (index.h("swirl-icon", { key: '34a20d553d674cf7f9c927953e2cf5ed58705029', class: "tree-navigation-item__icon", glyph: this.icon, size: 20, "aria-hidden": "true", role: "img", "aria-label": `${this.label} icon` })), index.h("span", { key: '5da636bb27d2216dc6aff988f1d26fc8f30fcf60', class: "tree-navigation-item__label" }, index.h("span", { key: '6754265636339a86b486d5a321d90ec79a18444f', class: "tree-navigation-item__label-text" }, this.label), this.expandable && this.hasChildren && !this.external && (index.h("span", { key: 'ea1f51fd0014242f7272b32f211caa1426d4ea94', class: "tree-navigation-item__toggle-icon", "aria-hidden": "true" }, index.h("swirl-icon-chevron-right", { key: '4aa852fa75f7b6c5af5b5492fed3f80ef3361ebb', size: 16, role: "img", "aria-label": "Expand" }))), this.external && (index.h("span", { key: '5c68b8d23ac3e78e90eb31b3ae5e2f52d94c2bf8', class: "tree-navigation-item__external-icon", "aria-hidden": "true" }, index.h("swirl-icon-open-in-new", { key: 'b12ddc926cab64408e481c15cc2566561595227a', size: 16, role: "img", "aria-label": "External link" })))), this.markAsNew && (index.h("swirl-tag", { key: '8b851f933a2a474f2c300097ad735689fde016b6', class: "tree-navigation-item__is-new-tag", intent: "info", label: this.markAsNewLabel, size: "m", variant: "default" })))), this.hasChildren && (index.h("ul", { key: '0622463b9caf97cc16ea872038224c683aaccf5f', class: "tree-navigation-item__children", id: this.childrenId, role: "group", "aria-label": `${this.label} submenu`, ref: (el) => (this.childrenRef = el), style: {
|
|
97
98
|
height: this.childrenHeight,
|
|
98
|
-
} }, index.h("slot", { key: '
|
|
99
|
+
} }, index.h("slot", { key: 'b9088b5f02c54cc416b403581d1772ceb1693fb2' }))))));
|
|
99
100
|
}
|
|
100
101
|
get el() { return index.getElement(this); }
|
|
101
102
|
static get watchers() { return {
|
|
@@ -10,7 +10,7 @@ const SwirlVideoThumbnail = class {
|
|
|
10
10
|
this.durationLabel = "Duration";
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return (index.h(index.Host, { key: '
|
|
13
|
+
return (index.h(index.Host, { key: 'f4b5e892518fccf1e1959544fe7bd15afbb0d44c' }, index.h("button", { key: '5b580350e9154448b3d21c3c860e89d02fcaa8d9', "aria-describedby": this.duration !== undefined ? "duration" : undefined, "aria-label": this.label, class: "video-thumbnail", type: "button" }, index.h("img", { key: '3cba6d9df87c09717a866fb5a93bf814a82c50f0', alt: "", class: "video-thumbnail__image", loading: "lazy", src: this.src }), this.duration && (index.h("span", { key: '53a3a4e6381d041c658cb0139aa71b5b8b01eb98', class: "video-thumbnail__duration", id: "duration" }, index.h("swirl-visually-hidden", { key: '88b4da4deb1606b86641273dca6984e8270b3053' }, this.durationLabel), this.duration)), index.h("svg", { key: 'ee06d6f9ef41acfc1dfd33f0b16be1e7d6f99a03', class: "video-thumbnail__play-icon", fill: "none", viewBox: "0 0 40 40", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '0cfe8ddf2ff49220089e53d3e68448c782a0e328', d: "M15 14.65V25.35C15 26.1167 15.35 26.7 16.05 27.1C16.75 27.5 17.4333 27.4667 18.1 27L26.4 21.7C27.0333 21.3 27.35 20.7333 27.35 20C27.35 19.2667 27.0333 18.7 26.4 18.3L18.1 13C17.4333 12.5333 16.75 12.5 16.05 12.9C15.35 13.3 15 13.8833 15 14.65ZM20 40C17.2333 40 14.6333 39.4747 12.2 38.424C9.76667 37.3747 7.65 35.95 5.85 34.15C4.05 32.35 2.62533 30.2333 1.576 27.8C0.525334 25.3667 0 22.7667 0 20C0 17.2333 0.525334 14.6333 1.576 12.2C2.62533 9.76667 4.05 7.65 5.85 5.85C7.65 4.05 9.76667 2.62467 12.2 1.574C14.6333 0.524667 17.2333 0 20 0C22.7667 0 25.3667 0.524667 27.8 1.574C30.2333 2.62467 32.35 4.05 34.15 5.85C35.95 7.65 37.3747 9.76667 38.424 12.2C39.4747 14.6333 40 17.2333 40 20C40 22.7667 39.4747 25.3667 38.424 27.8C37.3747 30.2333 35.95 32.35 34.15 34.15C32.35 35.95 30.2333 37.3747 27.8 38.424C25.3667 39.4747 22.7667 40 20 40Z", fill: "white", "fill-opacity": "0.95" })))));
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
SwirlVideoThumbnail.style = swirlVideoThumbnailCss();
|
|
@@ -9,7 +9,7 @@ const SwirlVisuallyHidden = class {
|
|
|
9
9
|
index.registerInstance(this, hostRef);
|
|
10
10
|
}
|
|
11
11
|
render() {
|
|
12
|
-
return (index.h(index.Host, { key: '
|
|
12
|
+
return (index.h(index.Host, { key: '90076cf37baa0aa32be3f1f6b4900fd2d672b95b' }, index.h("slot", { key: 'bc644b9f81e4945abde8107bcddc0bb0ac2f12b6' })));
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
SwirlVisuallyHidden.style = swirlVisuallyHiddenCss();
|
|
@@ -152,6 +152,7 @@ export class SwirlPopover {
|
|
|
152
152
|
this.popoverEl?.hidePopover();
|
|
153
153
|
this.active = false;
|
|
154
154
|
this.closing = false;
|
|
155
|
+
this.position = undefined;
|
|
155
156
|
this.updateTriggerAttributes(this.openedVia);
|
|
156
157
|
this.openedVia = undefined;
|
|
157
158
|
}, 150);
|
|
@@ -170,6 +171,7 @@ export class SwirlPopover {
|
|
|
170
171
|
return;
|
|
171
172
|
}
|
|
172
173
|
this.adjustWidth();
|
|
174
|
+
this.position = undefined;
|
|
173
175
|
this.active = true;
|
|
174
176
|
this.openedVia = via;
|
|
175
177
|
this.updateTriggerAttributes(via);
|
|
@@ -301,15 +303,16 @@ export class SwirlPopover {
|
|
|
301
303
|
"popover--transparent": this.transparent,
|
|
302
304
|
"popover--padded": this.padded,
|
|
303
305
|
});
|
|
304
|
-
return (h(Host, { key: '
|
|
306
|
+
return (h(Host, { key: 'f415f0f3489fa984ec57af318bd1adc9c33cb0b3' }, h("div", { key: '7061cd077de88e09645f0f011f76b4550eca92d4', popover: "manual", class: className, onKeyDown: this.onKeydown, ref: (el) => (this.popoverEl = el) }, h("div", { key: 'd87e049c3e5c68ce5e1c9fdf4813e04147c23fe1', "aria-hidden": !this.active ? "true" : "false", "aria-label": this.label, class: "popover__content", id: this.popoverId, part: "popover__content", role: "dialog", ref: (el) => (this.contentContainer = el), style: {
|
|
305
307
|
top: Boolean(this.position) ? `${this.position?.y}px` : "",
|
|
306
308
|
left: Boolean(this.position) ? `${this.position?.x}px` : "",
|
|
309
|
+
visibility: this.active && !this.position && !mobile ? "hidden" : undefined,
|
|
307
310
|
"--swirl-popover-border-radius": borderRadius,
|
|
308
|
-
}, tabindex: "-1" }, h("span", { key: '
|
|
311
|
+
}, tabindex: "-1" }, h("span", { key: '367b321f34695844f41a60242f11c7ed7f18f0cf', class: "popover__handle" }), h("div", { key: '538f60733248b127e79a65feccea4d337f11819a', class: "popover__scroll-container", part: "popover__scroll-container", ref: (el) => (this.scrollContainer = el), style: {
|
|
309
312
|
maxHeight: !mobile && Boolean(this.maxHeight)
|
|
310
313
|
? this.maxHeight
|
|
311
314
|
: undefined,
|
|
312
|
-
} }, h("slot", { key: '
|
|
315
|
+
} }, h("slot", { key: '8f914e6bfa86c74a1c2de77fd8aed9995b2b594b' }))), this.active && (h("div", { key: '6d0e157e13c1c9660275d1791b1ab5b8a39dc3a5', class: "popover__backdrop", onClick: this.onCloseButtonClick })))));
|
|
313
316
|
}
|
|
314
317
|
static get is() { return "swirl-popover"; }
|
|
315
318
|
static get encapsulation() { return "shadow"; }
|
|
@@ -2,6 +2,7 @@ import { h, Host, } from "@stencil/core";
|
|
|
2
2
|
import classnames from "classnames";
|
|
3
3
|
export class SwirlTreeNavigationItem {
|
|
4
4
|
constructor() {
|
|
5
|
+
this.markAsNewLabel = "New";
|
|
5
6
|
this.level = 1;
|
|
6
7
|
this.expandable = true;
|
|
7
8
|
this.external = false;
|
|
@@ -83,12 +84,12 @@ export class SwirlTreeNavigationItem {
|
|
|
83
84
|
"tree-navigation-item__link--active": this.active,
|
|
84
85
|
"tree-navigation-item__link--has-icon": Boolean(this.icon),
|
|
85
86
|
});
|
|
86
|
-
return (h(Host, { key: '
|
|
87
|
+
return (h(Host, { key: 'd4de1d1f3580a4eed510a774a3f650190d9313fe', role: "none" }, h("li", { key: 'f9672b6904f549f62abc87cd241889154bc39f2f', class: {
|
|
87
88
|
"tree-navigation-item": true,
|
|
88
89
|
"tree-navigation-item--expanded": this.expanded,
|
|
89
|
-
}, role: "treeitem", "aria-expanded": this.hasChildren ? this.expanded : undefined, "aria-level": this.level }, h(Tag, { key: '
|
|
90
|
+
}, role: "treeitem", "aria-expanded": this.hasChildren ? this.expanded : undefined, "aria-level": this.level }, h(Tag, { key: '6a5eb19fdf461ecc09087805c54b5c0f9b82311f', onClick: this.toggleExpanded, onKeyDown: this.onKeyDown, class: linkClassName, href: this.href, target: this.target, type: isLink ? undefined : "button", id: this.buttonId, "aria-current": this.active ? "page" : undefined, "aria-controls": this.hasChildren ? this.childrenId : undefined, "aria-expanded": this.hasChildren ? this.expanded : undefined }, h("span", { key: '5903777ca52fbcea134cb099c77a979ec38d780a', class: "tree-navigation-item__content" }, this.icon && (h("swirl-icon", { key: '34a20d553d674cf7f9c927953e2cf5ed58705029', class: "tree-navigation-item__icon", glyph: this.icon, size: 20, "aria-hidden": "true", role: "img", "aria-label": `${this.label} icon` })), h("span", { key: '5da636bb27d2216dc6aff988f1d26fc8f30fcf60', class: "tree-navigation-item__label" }, h("span", { key: '6754265636339a86b486d5a321d90ec79a18444f', class: "tree-navigation-item__label-text" }, this.label), this.expandable && this.hasChildren && !this.external && (h("span", { key: 'ea1f51fd0014242f7272b32f211caa1426d4ea94', class: "tree-navigation-item__toggle-icon", "aria-hidden": "true" }, h("swirl-icon-chevron-right", { key: '4aa852fa75f7b6c5af5b5492fed3f80ef3361ebb', size: 16, role: "img", "aria-label": "Expand" }))), this.external && (h("span", { key: '5c68b8d23ac3e78e90eb31b3ae5e2f52d94c2bf8', class: "tree-navigation-item__external-icon", "aria-hidden": "true" }, h("swirl-icon-open-in-new", { key: 'b12ddc926cab64408e481c15cc2566561595227a', size: 16, role: "img", "aria-label": "External link" })))), this.markAsNew && (h("swirl-tag", { key: '8b851f933a2a474f2c300097ad735689fde016b6', class: "tree-navigation-item__is-new-tag", intent: "info", label: this.markAsNewLabel, size: "m", variant: "default" })))), this.hasChildren && (h("ul", { key: '0622463b9caf97cc16ea872038224c683aaccf5f', class: "tree-navigation-item__children", id: this.childrenId, role: "group", "aria-label": `${this.label} submenu`, ref: (el) => (this.childrenRef = el), style: {
|
|
90
91
|
height: this.childrenHeight,
|
|
91
|
-
} }, h("slot", { key: '
|
|
92
|
+
} }, h("slot", { key: 'b9088b5f02c54cc416b403581d1772ceb1693fb2' }))))));
|
|
92
93
|
}
|
|
93
94
|
static get is() { return "swirl-tree-navigation-item"; }
|
|
94
95
|
static get encapsulation() { return "shadow"; }
|
|
@@ -199,6 +200,45 @@ export class SwirlTreeNavigationItem {
|
|
|
199
200
|
"reflect": false,
|
|
200
201
|
"attribute": "target"
|
|
201
202
|
},
|
|
203
|
+
"markAsNew": {
|
|
204
|
+
"type": "boolean",
|
|
205
|
+
"mutable": false,
|
|
206
|
+
"complexType": {
|
|
207
|
+
"original": "boolean",
|
|
208
|
+
"resolved": "boolean",
|
|
209
|
+
"references": {}
|
|
210
|
+
},
|
|
211
|
+
"required": false,
|
|
212
|
+
"optional": true,
|
|
213
|
+
"docs": {
|
|
214
|
+
"tags": [],
|
|
215
|
+
"text": ""
|
|
216
|
+
},
|
|
217
|
+
"getter": false,
|
|
218
|
+
"setter": false,
|
|
219
|
+
"reflect": false,
|
|
220
|
+
"attribute": "mark-as-new"
|
|
221
|
+
},
|
|
222
|
+
"markAsNewLabel": {
|
|
223
|
+
"type": "string",
|
|
224
|
+
"mutable": false,
|
|
225
|
+
"complexType": {
|
|
226
|
+
"original": "string",
|
|
227
|
+
"resolved": "string",
|
|
228
|
+
"references": {}
|
|
229
|
+
},
|
|
230
|
+
"required": false,
|
|
231
|
+
"optional": true,
|
|
232
|
+
"docs": {
|
|
233
|
+
"tags": [],
|
|
234
|
+
"text": ""
|
|
235
|
+
},
|
|
236
|
+
"getter": false,
|
|
237
|
+
"setter": false,
|
|
238
|
+
"reflect": false,
|
|
239
|
+
"attribute": "mark-as-new-label",
|
|
240
|
+
"defaultValue": "\"New\""
|
|
241
|
+
},
|
|
202
242
|
"navigationItemId": {
|
|
203
243
|
"type": "string",
|
|
204
244
|
"mutable": false,
|
|
@@ -4,7 +4,7 @@ export class SwirlVideoThumbnail {
|
|
|
4
4
|
this.durationLabel = "Duration";
|
|
5
5
|
}
|
|
6
6
|
render() {
|
|
7
|
-
return (h(Host, { key: '
|
|
7
|
+
return (h(Host, { key: 'f4b5e892518fccf1e1959544fe7bd15afbb0d44c' }, h("button", { key: '5b580350e9154448b3d21c3c860e89d02fcaa8d9', "aria-describedby": this.duration !== undefined ? "duration" : undefined, "aria-label": this.label, class: "video-thumbnail", type: "button" }, h("img", { key: '3cba6d9df87c09717a866fb5a93bf814a82c50f0', alt: "", class: "video-thumbnail__image", loading: "lazy", src: this.src }), this.duration && (h("span", { key: '53a3a4e6381d041c658cb0139aa71b5b8b01eb98', class: "video-thumbnail__duration", id: "duration" }, h("swirl-visually-hidden", { key: '88b4da4deb1606b86641273dca6984e8270b3053' }, this.durationLabel), this.duration)), h("svg", { key: 'ee06d6f9ef41acfc1dfd33f0b16be1e7d6f99a03', class: "video-thumbnail__play-icon", fill: "none", viewBox: "0 0 40 40", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '0cfe8ddf2ff49220089e53d3e68448c782a0e328', d: "M15 14.65V25.35C15 26.1167 15.35 26.7 16.05 27.1C16.75 27.5 17.4333 27.4667 18.1 27L26.4 21.7C27.0333 21.3 27.35 20.7333 27.35 20C27.35 19.2667 27.0333 18.7 26.4 18.3L18.1 13C17.4333 12.5333 16.75 12.5 16.05 12.9C15.35 13.3 15 13.8833 15 14.65ZM20 40C17.2333 40 14.6333 39.4747 12.2 38.424C9.76667 37.3747 7.65 35.95 5.85 34.15C4.05 32.35 2.62533 30.2333 1.576 27.8C0.525334 25.3667 0 22.7667 0 20C0 17.2333 0.525334 14.6333 1.576 12.2C2.62533 9.76667 4.05 7.65 5.85 5.85C7.65 4.05 9.76667 2.62467 12.2 1.574C14.6333 0.524667 17.2333 0 20 0C22.7667 0 25.3667 0.524667 27.8 1.574C30.2333 2.62467 32.35 4.05 34.15 5.85C35.95 7.65 37.3747 9.76667 38.424 12.2C39.4747 14.6333 40 17.2333 40 20C40 22.7667 39.4747 25.3667 38.424 27.8C37.3747 30.2333 35.95 32.35 34.15 34.15C32.35 35.95 30.2333 37.3747 27.8 38.424C25.3667 39.4747 22.7667 40 20 40Z", fill: "white", "fill-opacity": "0.95" })))));
|
|
8
8
|
}
|
|
9
9
|
static get is() { return "swirl-video-thumbnail"; }
|
|
10
10
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
export class SwirlVisuallyHidden {
|
|
3
3
|
render() {
|
|
4
|
-
return (h(Host, { key: '
|
|
4
|
+
return (h(Host, { key: '90076cf37baa0aa32be3f1f6b4900fd2d672b95b' }, h("slot", { key: 'bc644b9f81e4945abde8107bcddc0bb0ac2f12b6' })));
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "swirl-visually-hidden"; }
|
|
7
7
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as o,HTMLElement as e,createEvent as t,h as i,Host as r,transformTag as n}from"@stencil/core/internal/client";import{c as s,a as p,s as a,o as d,f as c}from"./floating-ui.dom.js";import{d as l,e as h}from"./bodyScrollLock.esm.js";import{c as v}from"./index2.js";import{t as m}from"./index.esm.js";import{i as f,t as u,k as b,q as _}from"./utils.js";const g=["xs","sm","base","l","xl"],w=o(class extends e{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.popoverClose=t(this,"popoverClose",7),this.popoverOpen=t(this,"popoverOpen",7),this.animation="scale-in-xy",this.enableFlip=!0,this.maxHeight="22rem",this.offset=8,this.padded=!0,this.placement="bottom-start",this.returnFocusToTrigger=!0,this.borderRadius="base",this.active=!1,this.closing=!1,this.togglePopover=o=>{o.stopPropagation(),this.active?this.close():this.open()},this.onKeydown=o=>{"Escape"===o.code&&this.active&&(o.stopImmediatePropagation(),o.stopPropagation(),this.close())},this.reposition=async()=>{const o=f();if(!Boolean(this.triggerEl)||!Boolean(this.contentContainer))return;if(o)return void(this.position=void 0);const e="number"==typeof this.offset?{mainAxis:this.offset,crossAxis:0}:{mainAxis:this.offset[0],crossAxis:this.offset[1]},t=u("--s-space-16"),i=a({padding:{left:t,right:t}}),r=this.enableFlip?[d(e),i,c()]:[d(e),i];this.position=await s(this.triggerEl,this.contentContainer,{middleware:r,placement:this.placement,strategy:"fixed"})},this.onCloseButtonClick=()=>{this.close()}}componentDidLoad(){this.connectTrigger(),this.updateTriggerAttributes(),Boolean(this.trigger)&&console.warn('[Swirl] The "trigger" prop of swirl-popover is deprecated and will be removed with the next major release. Please use the swirl-popover-trigger component instead. https://swirl-storybook.flip-app.dev/?path=/docs/components-swirlpopovertrigger--docs')}disconnectedCallback(){this.unlockBodyScroll(),this.disableAutoUpdate?.(),this.disableAutoUpdate=void 0,this.triggerEl?.removeEventListener("click",this.togglePopover)}onWindowFocusIn(o){if(!this.active)return;const e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),t="webkit"in window,i=e||t,r=o.target,n=o.relatedTarget,s=b(),p=!this.el.contains(r)&&!this.el.contains(s),a=r!==this.triggerEl&&!this.triggerEl?.contains(r),d=i&&!this.el.contains(n||r)&&n!==this.el;["SWIRL-TAB"].includes(r.tagName)||!p||!a||i&&!d||this.close()}onWindowBlur(){if(!this.active||this.closing)return;const o=document.activeElement;o&&["IFRAME"].includes(o.tagName)&&this.close()}onWindowClick(o){if(!this.active||this.closing)return;const e=o.target,t=this.el.contains(e),i=o.composedPath().some((o=>!!(Boolean(o)&&o instanceof Node)&&this.el.contains(o))),r=e===this.triggerEl||this.triggerEl.contains(e)||o.composedPath().includes(this.triggerEl);t||i||r||this.close()}async close(o){!this.closing&&this.active&&(this.popoverClose.emit(),this.disableAutoUpdate&&this.disableAutoUpdate(),this.closing=!0,setTimeout((()=>{this.popoverEl?.hidePopover(),this.active=!1,this.closing=!1,this.updateTriggerAttributes(this.openedVia),this.openedVia=void 0}),150),this.unlockBodyScroll(),this.returnFocusToTrigger&&!o&&this.getNativeTriggerElement()?.focus())}async open(o,e,t){if(this.triggerEl=o||this.triggerEl,this.active||!Boolean(this.triggerEl))return;this.adjustWidth(),this.active=!0,this.openedVia=t,this.updateTriggerAttributes(t);const i=this.getFocusableChildren();requestAnimationFrame((async()=>{this.popoverEl?.showPopover(),await this.reposition(),this.popoverOpen.emit({position:this.position}),i.length>0&&!e?i[0].focus():e||this.contentContainer.focus(),this.disableAutoUpdate&&this.disableAutoUpdate(),this.disableAutoUpdate=p(this.triggerEl,this.contentContainer,(()=>this.reposition())),this.scrollContainer.scrollTop=0,this.lockBodyScroll()}))}async isOpen(){return this.active&&!this.closing}async toggle(o,e){this.active?this.close():this.open(o,void 0,e)}connectTrigger(){Boolean(this.trigger)?(this.triggerEl="string"==typeof this.trigger?_(this.triggerContainer||document.body,`#${this.trigger}`)[0]:this.trigger,Boolean(this.triggerEl)&&this.triggerEl.addEventListener("click",this.togglePopover)):this.triggerEl=void 0}getNativeTriggerElement(){return m(this.triggerEl,{includeContainer:!0,getShadowRoot:!0}).at(0)}updateTriggerAttributes(o){if(!Boolean(this.triggerEl))return;const e=this.getNativeTriggerElement();Boolean(e)&&("hover"!==o?(e.setAttribute("aria-controls",this.el.id),e.setAttribute("aria-expanded",String(this.active))):(e.removeAttribute("aria-controls"),e.removeAttribute("aria-expanded")),e.setAttribute("aria-haspopup","dialog"))}getFocusableChildren(){return _(this.el,'[role="menuitem"], [role="menuitemradio"], [role="option"]')}adjustWidth(){let o=this.useContainerWidth;[!0,"true"].includes(this.useContainerWidth)?o=!0:[!1,"false"].includes(this.useContainerWidth)&&(o=!1);const e=!window.matchMedia("(min-width: 768px)").matches;if(Boolean(o)&&!e){const e="string"==typeof o&&this.el.closest(o)||this.el.parentElement;this.contentContainer.style.maxWidth="none",this.contentContainer.style.width=e.getBoundingClientRect().width+"px"}else this.contentContainer.style.maxWidth="",this.contentContainer.style.width=""}lockBodyScroll(){f()&&!this.disableScrollLock&&Boolean(this.scrollContainer)&&l(this.scrollContainer)}unlockBodyScroll(){f()&&!this.disableScrollLock&&Boolean(this.scrollContainer)&&h(this.scrollContainer)}render(){const o=!window.matchMedia("(min-width: 768px)").matches,e=g.includes(this.borderRadius)?`var(--s-border-radius-${this.borderRadius})`:this.borderRadius,t=v("popover",`popover--animation-${this.animation}`,`popover--placement-${this.position?.placement}`,{"popover--active":this.active,"popover--closing":this.closing,"popover--fullscreen-bottom-sheet":this.fullscreenBottomSheet,"popover--inactive":!this.active,"popover--translucent":this.translucent,"popover--transparent":this.transparent,"popover--padded":this.padded});return i(r,{key:"e30cf49d1f8afe2b629b1b3b4d636045caa1807f"},i("div",{key:"c53b4aab6bede8240c53a69198d70f8f84712f1a",popover:"manual",class:t,onKeyDown:this.onKeydown,ref:o=>this.popoverEl=o},i("div",{key:"201e3db2673ffa718da5f01346b84bc0cdc3dfd1","aria-hidden":this.active?"false":"true","aria-label":this.label,class:"popover__content",id:this.popoverId,part:"popover__content",role:"dialog",ref:o=>this.contentContainer=o,style:{top:Boolean(this.position)?`${this.position?.y}px`:"",left:Boolean(this.position)?`${this.position?.x}px`:"","--swirl-popover-border-radius":e},tabindex:"-1"},i("span",{key:"47512b68f1b8eb6f67c2faff471281907ec90261",class:"popover__handle"}),i("div",{key:"7c2bd10e59230937864286cef380d1b7e0a24173",class:"popover__scroll-container",part:"popover__scroll-container",ref:o=>this.scrollContainer=o,style:{maxHeight:!o&&Boolean(this.maxHeight)?this.maxHeight:void 0}},i("slot",{key:"0decf5d79afc8203126d01f0ff4bb4a8b3cf32e8"}))),this.active&&i("div",{key:"3ba89dee3d44a30afa8838c5335e8ac168e9f93a",class:"popover__backdrop",onClick:this.onCloseButtonClick})))}get el(){return this}static get style(){return":host{position:relative;z-index:var(--s-z-40);display:contents}:host *{box-sizing:border-box}.popover{border:none;padding:0;margin:0}.popover::backdrop{display:none}.popover--active:not(.popover--closing) .popover__backdrop{animation:0.15s popover-fade-in}@media (prefers-reduced-motion){.popover--active:not(.popover--closing) .popover__backdrop{animation:none}}.popover--active:not(.popover--closing) .popover__content{animation:0.15s popover-slide-in}@media (min-width: 768px){.popover--active:not(.popover--closing) .popover__content{animation:0.15s popover-fade-scale-in-xy}}@media (prefers-reduced-motion){.popover--active:not(.popover--closing) .popover__content{animation:none}}.popover--closing .popover__backdrop{animation:0.15s popover-fade-out forwards}@media (prefers-reduced-motion){.popover--closing .popover__backdrop{animation:none}}.popover--closing .popover__content{animation:0.15s popover-slide-out forwards}@media (min-width: 768px){.popover--closing .popover__content{animation:0.15s popover-fade-out forwards}}@media (prefers-reduced-motion){.popover--closing .popover__content{animation:none}}.popover--inactive .popover__content{display:none}@media (max-width: 767px){.popover--fullscreen-bottom-sheet.popover--active:not(.popover--closing) .popover__content{animation:0.15s popover-fade-in}@media (prefers-reduced-motion){.popover--fullscreen-bottom-sheet.popover--active:not(.popover--closing) .popover__content{animation:none}}.popover--fullscreen-bottom-sheet.popover--closing .popover__content{animation:0.15s popover-fade-out forwards}@media (prefers-reduced-motion){.popover--fullscreen-bottom-sheet.popover--closing .popover__content{animation:none}}.popover--fullscreen-bottom-sheet .popover__backdrop{display:none}.popover--fullscreen-bottom-sheet .popover__content{top:0;border-top-left-radius:0;border-top-right-radius:0}.popover--fullscreen-bottom-sheet .popover__scroll-container{height:100%;max-height:none;padding-top:0;padding-bottom:0}.popover--fullscreen-bottom-sheet .popover__handle{display:none}}@media (min-width: 768px){.popover--animation-scale-in-y.popover--active:not(.popover--closing) .popover__content{animation:0.15s popover-fade-scale-in-y}}@media (prefers-reduced-motion){.popover--animation-scale-in-y.popover--active:not(.popover--closing) .popover__content{animation:none}}@media (min-width: 768px){.popover--animation-fade-in.popover--active:not(.popover--closing) .popover__content{animation:0.15s popover-fade-in}}@media (prefers-reduced-motion){.popover--animation-fade-in.popover--active:not(.popover--closing) .popover__content{animation:none}}@media (min-width: 768px){.popover--placement-bottom .popover__content,.popover--placement-bottom-start .popover__content,.popover--placement-right .popover__content,.popover--placement-right-start .popover__content{transform-origin:top left}}@media (min-width: 768px){.popover--placement-bottom-end .popover__content,.popover--placement-left .popover__content,.popover--placement-left-start .popover__content{transform-origin:top right}}@media (min-width: 768px){.popover--placement-top .popover__content,.popover--placement-top-start .popover__content,.popover--placement-right-end .popover__content{transform-origin:bottom left}}@media (min-width: 768px){.popover--placement-top-end .popover__content,.popover--placement-left-end .popover__content{transform-origin:bottom right}}@media (min-width: 768px){.popover--transparent .popover__content{background-color:transparent;box-shadow:none}}@media (min-width: 768px){.popover--transparent .popover__scroll-container{padding:0}}.popover--translucent .popover__content{background:var(--s-translucent-low-default);-webkit-backdrop-filter:blur(var(--s-blur-l));backdrop-filter:blur(var(--s-blur-l));outline:var(--s-border-width-default) solid var(--s-border-translucent-outline)}.popover--translucent .popover__handle{background-color:var(--s-border-on-translucent)}.popover__backdrop{position:fixed;z-index:0;background-color:rgba(0, 0, 0, 0.2);animation:0.15s popover-backdrop-fade-in;inset:0}@media (prefers-reduced-motion){.popover__backdrop{animation:none}}@media (min-width: 768px){.popover__backdrop{display:none}}.popover__content{position:fixed;z-index:2;right:0;bottom:0;left:0;overflow:hidden;border-top-left-radius:var(--s-border-radius-xl);border-top-right-radius:var(--s-border-radius-xl);background-color:var(--s-surface-overlay-default)}@media (min-width: 768px){.popover__content{right:unset;bottom:unset;left:unset;border-radius:var( --swirl-popover-border-radius, var(--s-border-radius-base) );max-width:22.5rem;animation:none;box-shadow:var(--s-shadow-level-2)}}.popover__scroll-container{overflow-x:hidden;overflow-y:auto;width:100%;max-height:90vh;padding-top:var(--s-space-24);padding-bottom:var(--s-space-24);overscroll-behavior:contain}@media (min-width: 768px){.popover__scroll-container{max-height:22rem;padding-top:0;padding-bottom:0}}@media (min-width: 768px){.popover--padded .popover__scroll-container{padding:var(--s-space-4)}}.popover__handle{position:absolute;top:var(--s-space-8);left:50%;width:2.5rem;height:0.375rem;border-radius:0.1875rem;background-color:var(--s-border-default);transform:translatex(-50%)}@media (min-width: 768px){.popover__handle{display:none}}@keyframes popover-slide-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes popover-slide-out{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes popover-fade-in{from{opacity:0}to{opacity:1}}@keyframes popover-fade-out{from{opacity:1}to{opacity:0}}@keyframes popover-fade-scale-in-xy{from{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}@keyframes popover-fade-scale-in-y{from{transform:scaleY(0);opacity:0}to{transform:scaleY(1);opacity:1}}"}},[257,"swirl-popover",{animation:[1],disableScrollLock:[4,"disable-scroll-lock"],enableFlip:[4,"enable-flip"],fullscreenBottomSheet:[4,"fullscreen-bottom-sheet"],label:[1],maxHeight:[1,"max-height"],offset:[2],padded:[4],popoverId:[1,"popover-id"],placement:[1],returnFocusToTrigger:[4,"return-focus-to-trigger"],translucent:[4],transparent:[4],trigger:[1],triggerContainer:[16],useContainerWidth:[8,"use-container-width"],borderRadius:[1,"border-radius"],active:[32],closing:[32],position:[32],close:[64],open:[64],isOpen:[64],toggle:[64]},[[8,"focusin","onWindowFocusIn"],[8,"blur","onWindowBlur"],[8,"click","onWindowClick"]]]);function x(){"undefined"!=typeof customElements&&["swirl-popover"].forEach((o=>{"swirl-popover"===o&&(customElements.get(n(o))||customElements.define(n(o),w))}))}export{w as S,x as d}
|
|
1
|
+
import{proxyCustomElement as o,HTMLElement as e,createEvent as t,h as i,Host as r,transformTag as n}from"@stencil/core/internal/client";import{c as s,a as p,s as a,o as d,f as c}from"./floating-ui.dom.js";import{d as l,e as h}from"./bodyScrollLock.esm.js";import{c as v}from"./index2.js";import{t as m}from"./index.esm.js";import{i as f,t as u,k as _,q as b}from"./utils.js";const g=["xs","sm","base","l","xl"],w=o(class extends e{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.popoverClose=t(this,"popoverClose",7),this.popoverOpen=t(this,"popoverOpen",7),this.animation="scale-in-xy",this.enableFlip=!0,this.maxHeight="22rem",this.offset=8,this.padded=!0,this.placement="bottom-start",this.returnFocusToTrigger=!0,this.borderRadius="base",this.active=!1,this.closing=!1,this.togglePopover=o=>{o.stopPropagation(),this.active?this.close():this.open()},this.onKeydown=o=>{"Escape"===o.code&&this.active&&(o.stopImmediatePropagation(),o.stopPropagation(),this.close())},this.reposition=async()=>{const o=f();if(!Boolean(this.triggerEl)||!Boolean(this.contentContainer))return;if(o)return void(this.position=void 0);const e="number"==typeof this.offset?{mainAxis:this.offset,crossAxis:0}:{mainAxis:this.offset[0],crossAxis:this.offset[1]},t=u("--s-space-16"),i=a({padding:{left:t,right:t}}),r=this.enableFlip?[d(e),i,c()]:[d(e),i];this.position=await s(this.triggerEl,this.contentContainer,{middleware:r,placement:this.placement,strategy:"fixed"})},this.onCloseButtonClick=()=>{this.close()}}componentDidLoad(){this.connectTrigger(),this.updateTriggerAttributes(),Boolean(this.trigger)&&console.warn('[Swirl] The "trigger" prop of swirl-popover is deprecated and will be removed with the next major release. Please use the swirl-popover-trigger component instead. https://swirl-storybook.flip-app.dev/?path=/docs/components-swirlpopovertrigger--docs')}disconnectedCallback(){this.unlockBodyScroll(),this.disableAutoUpdate?.(),this.disableAutoUpdate=void 0,this.triggerEl?.removeEventListener("click",this.togglePopover)}onWindowFocusIn(o){if(!this.active)return;const e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),t="webkit"in window,i=e||t,r=o.target,n=o.relatedTarget,s=_(),p=!this.el.contains(r)&&!this.el.contains(s),a=r!==this.triggerEl&&!this.triggerEl?.contains(r),d=i&&!this.el.contains(n||r)&&n!==this.el;["SWIRL-TAB"].includes(r.tagName)||!p||!a||i&&!d||this.close()}onWindowBlur(){if(!this.active||this.closing)return;const o=document.activeElement;o&&["IFRAME"].includes(o.tagName)&&this.close()}onWindowClick(o){if(!this.active||this.closing)return;const e=o.target,t=this.el.contains(e),i=o.composedPath().some((o=>!!(Boolean(o)&&o instanceof Node)&&this.el.contains(o))),r=e===this.triggerEl||this.triggerEl.contains(e)||o.composedPath().includes(this.triggerEl);t||i||r||this.close()}async close(o){!this.closing&&this.active&&(this.popoverClose.emit(),this.disableAutoUpdate&&this.disableAutoUpdate(),this.closing=!0,setTimeout((()=>{this.popoverEl?.hidePopover(),this.active=!1,this.closing=!1,this.position=void 0,this.updateTriggerAttributes(this.openedVia),this.openedVia=void 0}),150),this.unlockBodyScroll(),this.returnFocusToTrigger&&!o&&this.getNativeTriggerElement()?.focus())}async open(o,e,t){if(this.triggerEl=o||this.triggerEl,this.active||!Boolean(this.triggerEl))return;this.adjustWidth(),this.position=void 0,this.active=!0,this.openedVia=t,this.updateTriggerAttributes(t);const i=this.getFocusableChildren();requestAnimationFrame((async()=>{this.popoverEl?.showPopover(),await this.reposition(),this.popoverOpen.emit({position:this.position}),i.length>0&&!e?i[0].focus():e||this.contentContainer.focus(),this.disableAutoUpdate&&this.disableAutoUpdate(),this.disableAutoUpdate=p(this.triggerEl,this.contentContainer,(()=>this.reposition())),this.scrollContainer.scrollTop=0,this.lockBodyScroll()}))}async isOpen(){return this.active&&!this.closing}async toggle(o,e){this.active?this.close():this.open(o,void 0,e)}connectTrigger(){Boolean(this.trigger)?(this.triggerEl="string"==typeof this.trigger?b(this.triggerContainer||document.body,`#${this.trigger}`)[0]:this.trigger,Boolean(this.triggerEl)&&this.triggerEl.addEventListener("click",this.togglePopover)):this.triggerEl=void 0}getNativeTriggerElement(){return m(this.triggerEl,{includeContainer:!0,getShadowRoot:!0}).at(0)}updateTriggerAttributes(o){if(!Boolean(this.triggerEl))return;const e=this.getNativeTriggerElement();Boolean(e)&&("hover"!==o?(e.setAttribute("aria-controls",this.el.id),e.setAttribute("aria-expanded",String(this.active))):(e.removeAttribute("aria-controls"),e.removeAttribute("aria-expanded")),e.setAttribute("aria-haspopup","dialog"))}getFocusableChildren(){return b(this.el,'[role="menuitem"], [role="menuitemradio"], [role="option"]')}adjustWidth(){let o=this.useContainerWidth;[!0,"true"].includes(this.useContainerWidth)?o=!0:[!1,"false"].includes(this.useContainerWidth)&&(o=!1);const e=!window.matchMedia("(min-width: 768px)").matches;if(Boolean(o)&&!e){const e="string"==typeof o&&this.el.closest(o)||this.el.parentElement;this.contentContainer.style.maxWidth="none",this.contentContainer.style.width=e.getBoundingClientRect().width+"px"}else this.contentContainer.style.maxWidth="",this.contentContainer.style.width=""}lockBodyScroll(){f()&&!this.disableScrollLock&&Boolean(this.scrollContainer)&&l(this.scrollContainer)}unlockBodyScroll(){f()&&!this.disableScrollLock&&Boolean(this.scrollContainer)&&h(this.scrollContainer)}render(){const o=!window.matchMedia("(min-width: 768px)").matches,e=g.includes(this.borderRadius)?`var(--s-border-radius-${this.borderRadius})`:this.borderRadius,t=v("popover",`popover--animation-${this.animation}`,`popover--placement-${this.position?.placement}`,{"popover--active":this.active,"popover--closing":this.closing,"popover--fullscreen-bottom-sheet":this.fullscreenBottomSheet,"popover--inactive":!this.active,"popover--translucent":this.translucent,"popover--transparent":this.transparent,"popover--padded":this.padded});return i(r,{key:"f415f0f3489fa984ec57af318bd1adc9c33cb0b3"},i("div",{key:"7061cd077de88e09645f0f011f76b4550eca92d4",popover:"manual",class:t,onKeyDown:this.onKeydown,ref:o=>this.popoverEl=o},i("div",{key:"d87e049c3e5c68ce5e1c9fdf4813e04147c23fe1","aria-hidden":this.active?"false":"true","aria-label":this.label,class:"popover__content",id:this.popoverId,part:"popover__content",role:"dialog",ref:o=>this.contentContainer=o,style:{top:Boolean(this.position)?`${this.position?.y}px`:"",left:Boolean(this.position)?`${this.position?.x}px`:"",visibility:!this.active||this.position||o?void 0:"hidden","--swirl-popover-border-radius":e},tabindex:"-1"},i("span",{key:"367b321f34695844f41a60242f11c7ed7f18f0cf",class:"popover__handle"}),i("div",{key:"538f60733248b127e79a65feccea4d337f11819a",class:"popover__scroll-container",part:"popover__scroll-container",ref:o=>this.scrollContainer=o,style:{maxHeight:!o&&Boolean(this.maxHeight)?this.maxHeight:void 0}},i("slot",{key:"8f914e6bfa86c74a1c2de77fd8aed9995b2b594b"}))),this.active&&i("div",{key:"6d0e157e13c1c9660275d1791b1ab5b8a39dc3a5",class:"popover__backdrop",onClick:this.onCloseButtonClick})))}get el(){return this}static get style(){return":host{position:relative;z-index:var(--s-z-40);display:contents}:host *{box-sizing:border-box}.popover{border:none;padding:0;margin:0}.popover::backdrop{display:none}.popover--active:not(.popover--closing) .popover__backdrop{animation:0.15s popover-fade-in}@media (prefers-reduced-motion){.popover--active:not(.popover--closing) .popover__backdrop{animation:none}}.popover--active:not(.popover--closing) .popover__content{animation:0.15s popover-slide-in}@media (min-width: 768px){.popover--active:not(.popover--closing) .popover__content{animation:0.15s popover-fade-scale-in-xy}}@media (prefers-reduced-motion){.popover--active:not(.popover--closing) .popover__content{animation:none}}.popover--closing .popover__backdrop{animation:0.15s popover-fade-out forwards}@media (prefers-reduced-motion){.popover--closing .popover__backdrop{animation:none}}.popover--closing .popover__content{animation:0.15s popover-slide-out forwards}@media (min-width: 768px){.popover--closing .popover__content{animation:0.15s popover-fade-out forwards}}@media (prefers-reduced-motion){.popover--closing .popover__content{animation:none}}.popover--inactive .popover__content{display:none}@media (max-width: 767px){.popover--fullscreen-bottom-sheet.popover--active:not(.popover--closing) .popover__content{animation:0.15s popover-fade-in}@media (prefers-reduced-motion){.popover--fullscreen-bottom-sheet.popover--active:not(.popover--closing) .popover__content{animation:none}}.popover--fullscreen-bottom-sheet.popover--closing .popover__content{animation:0.15s popover-fade-out forwards}@media (prefers-reduced-motion){.popover--fullscreen-bottom-sheet.popover--closing .popover__content{animation:none}}.popover--fullscreen-bottom-sheet .popover__backdrop{display:none}.popover--fullscreen-bottom-sheet .popover__content{top:0;border-top-left-radius:0;border-top-right-radius:0}.popover--fullscreen-bottom-sheet .popover__scroll-container{height:100%;max-height:none;padding-top:0;padding-bottom:0}.popover--fullscreen-bottom-sheet .popover__handle{display:none}}@media (min-width: 768px){.popover--animation-scale-in-y.popover--active:not(.popover--closing) .popover__content{animation:0.15s popover-fade-scale-in-y}}@media (prefers-reduced-motion){.popover--animation-scale-in-y.popover--active:not(.popover--closing) .popover__content{animation:none}}@media (min-width: 768px){.popover--animation-fade-in.popover--active:not(.popover--closing) .popover__content{animation:0.15s popover-fade-in}}@media (prefers-reduced-motion){.popover--animation-fade-in.popover--active:not(.popover--closing) .popover__content{animation:none}}@media (min-width: 768px){.popover--placement-bottom .popover__content,.popover--placement-bottom-start .popover__content,.popover--placement-right .popover__content,.popover--placement-right-start .popover__content{transform-origin:top left}}@media (min-width: 768px){.popover--placement-bottom-end .popover__content,.popover--placement-left .popover__content,.popover--placement-left-start .popover__content{transform-origin:top right}}@media (min-width: 768px){.popover--placement-top .popover__content,.popover--placement-top-start .popover__content,.popover--placement-right-end .popover__content{transform-origin:bottom left}}@media (min-width: 768px){.popover--placement-top-end .popover__content,.popover--placement-left-end .popover__content{transform-origin:bottom right}}@media (min-width: 768px){.popover--transparent .popover__content{background-color:transparent;box-shadow:none}}@media (min-width: 768px){.popover--transparent .popover__scroll-container{padding:0}}.popover--translucent .popover__content{background:var(--s-translucent-low-default);-webkit-backdrop-filter:blur(var(--s-blur-l));backdrop-filter:blur(var(--s-blur-l));outline:var(--s-border-width-default) solid var(--s-border-translucent-outline)}.popover--translucent .popover__handle{background-color:var(--s-border-on-translucent)}.popover__backdrop{position:fixed;z-index:0;background-color:rgba(0, 0, 0, 0.2);animation:0.15s popover-backdrop-fade-in;inset:0}@media (prefers-reduced-motion){.popover__backdrop{animation:none}}@media (min-width: 768px){.popover__backdrop{display:none}}.popover__content{position:fixed;z-index:2;right:0;bottom:0;left:0;overflow:hidden;border-top-left-radius:var(--s-border-radius-xl);border-top-right-radius:var(--s-border-radius-xl);background-color:var(--s-surface-overlay-default)}@media (min-width: 768px){.popover__content{right:unset;bottom:unset;left:unset;border-radius:var( --swirl-popover-border-radius, var(--s-border-radius-base) );max-width:22.5rem;animation:none;box-shadow:var(--s-shadow-level-2)}}.popover__scroll-container{overflow-x:hidden;overflow-y:auto;width:100%;max-height:90vh;padding-top:var(--s-space-24);padding-bottom:var(--s-space-24);overscroll-behavior:contain}@media (min-width: 768px){.popover__scroll-container{max-height:22rem;padding-top:0;padding-bottom:0}}@media (min-width: 768px){.popover--padded .popover__scroll-container{padding:var(--s-space-4)}}.popover__handle{position:absolute;top:var(--s-space-8);left:50%;width:2.5rem;height:0.375rem;border-radius:0.1875rem;background-color:var(--s-border-default);transform:translatex(-50%)}@media (min-width: 768px){.popover__handle{display:none}}@keyframes popover-slide-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes popover-slide-out{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes popover-fade-in{from{opacity:0}to{opacity:1}}@keyframes popover-fade-out{from{opacity:1}to{opacity:0}}@keyframes popover-fade-scale-in-xy{from{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}@keyframes popover-fade-scale-in-y{from{transform:scaleY(0);opacity:0}to{transform:scaleY(1);opacity:1}}"}},[257,"swirl-popover",{animation:[1],disableScrollLock:[4,"disable-scroll-lock"],enableFlip:[4,"enable-flip"],fullscreenBottomSheet:[4,"fullscreen-bottom-sheet"],label:[1],maxHeight:[1,"max-height"],offset:[2],padded:[4],popoverId:[1,"popover-id"],placement:[1],returnFocusToTrigger:[4,"return-focus-to-trigger"],translucent:[4],transparent:[4],trigger:[1],triggerContainer:[16],useContainerWidth:[8,"use-container-width"],borderRadius:[1,"border-radius"],active:[32],closing:[32],position:[32],close:[64],open:[64],isOpen:[64],toggle:[64]},[[8,"focusin","onWindowFocusIn"],[8,"blur","onWindowBlur"],[8,"click","onWindowClick"]]]);function x(){"undefined"!=typeof customElements&&["swirl-popover"].forEach((o=>{"swirl-popover"===o&&(customElements.get(n(o))||customElements.define(n(o),w))}))}export{w as S,x as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as i,createEvent as t,h as a,Host as n,transformTag as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as i,createEvent as t,h as a,Host as n,transformTag as s}from"@stencil/core/internal/client";import{c as r}from"./index2.js";import{d as o}from"./swirl-icon2.js";import{d as l}from"./swirl-icon-chevron-right2.js";import{d as c}from"./swirl-icon-close2.js";import{d as h}from"./swirl-icon-open-in-new2.js";import{d}from"./swirl-tag2.js";import{d as g}from"./swirl-visually-hidden2.js";const m=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.expansionChange=t(this,"expansionChange",7),this.markAsNewLabel="New",this.level=1,this.expandable=!0,this.external=!1,this.expanded=!1,this.hasChildren=!1,this.childrenHeight="0",this.buttonId=this.navigationItemId+"-button",this.childrenId=this.navigationItemId+"-children",this.onKeyDown=e=>{switch(e.key){case" ":e.preventDefault(),this.toggleExpanded(e);break;case"ArrowRight":e.preventDefault(),!this.expanded&&this.hasChildren&&this.expand();break;case"ArrowLeft":e.preventDefault(),this.expanded&&this.collapse()}},this.toggleExpanded=e=>{this.expandable&&this.hasChildren&&!this.href&&(e.preventDefault(),e.stopPropagation(),this.expanded?this.collapse():this.expand())}}componentWillLoad(){this.checkForChildren()}componentDidLoad(){this.hasChildren&&this.expanded&&this.updateChildrenHeight()}updateChildrenHeight(){this.childrenRef&&(this.childrenHeight=this.expanded?this.childrenRef.scrollHeight+"px":"0")}handleExpandedChange(){this.expansionChange.emit(this.expanded),this.updateChildrenHeight()}checkForChildren(){this.hasChildren=!!this.el.querySelector("swirl-tree-navigation-item")}async expand(){!this.expanded&&this.expandable&&this.hasChildren&&(this.expanded=!0)}async collapse(){this.expanded&&this.expandable&&this.hasChildren&&(this.expanded=!1)}render(){const e=!!this.href,i=e?"a":"button",t=r("tree-navigation-item__link",{"tree-navigation-item__link--active":this.active,"tree-navigation-item__link--has-icon":!!this.icon});return a(n,{key:"d4de1d1f3580a4eed510a774a3f650190d9313fe",role:"none"},a("li",{key:"f9672b6904f549f62abc87cd241889154bc39f2f",class:{"tree-navigation-item":!0,"tree-navigation-item--expanded":this.expanded},role:"treeitem","aria-expanded":this.hasChildren?this.expanded:void 0,"aria-level":this.level},a(i,{key:"6a5eb19fdf461ecc09087805c54b5c0f9b82311f",onClick:this.toggleExpanded,onKeyDown:this.onKeyDown,class:t,href:this.href,target:this.target,type:e?void 0:"button",id:this.buttonId,"aria-current":this.active?"page":void 0,"aria-controls":this.hasChildren?this.childrenId:void 0,"aria-expanded":this.hasChildren?this.expanded:void 0},a("span",{key:"5903777ca52fbcea134cb099c77a979ec38d780a",class:"tree-navigation-item__content"},this.icon&&a("swirl-icon",{key:"34a20d553d674cf7f9c927953e2cf5ed58705029",class:"tree-navigation-item__icon",glyph:this.icon,size:20,"aria-hidden":"true",role:"img","aria-label":this.label+" icon"}),a("span",{key:"5da636bb27d2216dc6aff988f1d26fc8f30fcf60",class:"tree-navigation-item__label"},a("span",{key:"6754265636339a86b486d5a321d90ec79a18444f",class:"tree-navigation-item__label-text"},this.label),this.expandable&&this.hasChildren&&!this.external&&a("span",{key:"ea1f51fd0014242f7272b32f211caa1426d4ea94",class:"tree-navigation-item__toggle-icon","aria-hidden":"true"},a("swirl-icon-chevron-right",{key:"4aa852fa75f7b6c5af5b5492fed3f80ef3361ebb",size:16,role:"img","aria-label":"Expand"})),this.external&&a("span",{key:"5c68b8d23ac3e78e90eb31b3ae5e2f52d94c2bf8",class:"tree-navigation-item__external-icon","aria-hidden":"true"},a("swirl-icon-open-in-new",{key:"b12ddc926cab64408e481c15cc2566561595227a",size:16,role:"img","aria-label":"External link"}))),this.markAsNew&&a("swirl-tag",{key:"8b851f933a2a474f2c300097ad735689fde016b6",class:"tree-navigation-item__is-new-tag",intent:"info",label:this.markAsNewLabel,size:"m",variant:"default"}))),this.hasChildren&&a("ul",{key:"0622463b9caf97cc16ea872038224c683aaccf5f",class:"tree-navigation-item__children",id:this.childrenId,role:"group","aria-label":this.label+" submenu",ref:e=>this.childrenRef=e,style:{height:this.childrenHeight}},a("slot",{key:"b9088b5f02c54cc416b403581d1772ceb1693fb2"}))))}get el(){return this}static get watchers(){return{expanded:[{handleExpandedChange:0}]}}static get style(){return":host{display:inline-flex;width:100%}:host *{box-sizing:border-box}.tree-navigation-item{width:100%;list-style:none;border-radius:var(--s-border-radius-base)}.tree-navigation-item__link{display:inline-flex;align-items:center;width:100%;height:3rem;padding:0 var(--s-space-12) 0 var(--tree-nav-item-padding, var(--s-space-12));margin-bottom:var(--s-space-2);gap:calc(var(--s-space-4) - var(--s-space-2));min-width:0;border:none;background-color:transparent;color:var(--s-text-default);cursor:pointer;text-decoration:none;font:inherit;font-size:var(--s-font-size-sm);font-weight:var(--tree-nav-item-label-weight, var(--s-font-weight-medium));line-height:var(--s-line-height-sm);border-radius:var(--s-border-radius-base)}.tree-navigation-item__link:hover{background-color:var(--s-background-hovered)}.tree-navigation-item__link:active{background-color:var(--s-background-pressed)}.tree-navigation-item__link:focus{outline:none}.tree-navigation-item__link:focus-visible .tree-navigation-item__label{border-radius:var(--s-border-radius-xs);box-shadow:0 0 0 0.125rem var(--s-focus-default)}.tree-navigation-item__link--active{background-color:var(--s-background-hovered);color:var(--s-text-highlight);--tree-nav-item-label-weight:var(--s-font-weight-medium)}.tree-navigation-item__link--active:hover{background-color:var(--s-background-pressed)}.tree-navigation-item__link--active:active{background-color:var(--s-background-pressed)}.tree-navigation-item--expanded{height:100%}.tree-navigation-item__content{display:flex;align-items:center;min-width:0;flex:1}.tree-navigation-item__icon{display:inline-flex;flex-shrink:0;padding-right:var(--s-space-8)}.tree-navigation-item__toggle-icon{flex-shrink:0;max-height:1rem;color:var(--s-icon-default);margin-left:var(--s-space-4)}.tree-navigation-item__external-icon{max-height:1rem;color:var(--s-icon-default);margin-left:var(--s-space-4)}.tree-navigation-item__label{display:flex;align-items:center;min-width:0;flex:1}.tree-navigation-item__label-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tree-navigation-item__toggle-icon,.tree-navigation-item__external-icon{flex:0 0 auto;margin-left:var(--s-space-4)}.tree-navigation-item__children{display:flex;flex-direction:column;margin:0;padding:0;overflow:hidden;height:0;transition:height 0.3s ease-out}.tree-navigation-item__children>::slotted(swirl-tree-navigation-item){--tree-nav-item-padding:2.25rem;--tree-nav-item-label-weight:var(--s-font-weight-normal)}.tree-navigation-item__children>::slotted(*){opacity:1}.tree-navigation-item__toggle-icon{transition:transform 0.3s ease}.tree-navigation-item--expanded .tree-navigation-item__toggle-icon{transform:rotate(90deg)}.tree-navigation-item__is-new-tag{flex-shrink:0}"}},[257,"swirl-tree-navigation-item",{active:[4],href:[1],icon:[1],label:[1],target:[1],markAsNew:[4,"mark-as-new"],markAsNewLabel:[1,"mark-as-new-label"],navigationItemId:[1,"navigation-item-id"],level:[2],expandable:[4],external:[4],expanded:[32],hasChildren:[32],childrenHeight:[32],expand:[64],collapse:[64]},void 0,{expanded:[{handleExpandedChange:0}]}]),v=m,f=function(){"undefined"!=typeof customElements&&["swirl-tree-navigation-item","swirl-icon","swirl-icon-chevron-right","swirl-icon-close","swirl-icon-open-in-new","swirl-tag","swirl-visually-hidden"].forEach((e=>{switch(e){case"swirl-tree-navigation-item":customElements.get(s(e))||customElements.define(s(e),m);break;case"swirl-icon":customElements.get(s(e))||o();break;case"swirl-icon-chevron-right":customElements.get(s(e))||l();break;case"swirl-icon-close":customElements.get(s(e))||c();break;case"swirl-icon-open-in-new":customElements.get(s(e))||h();break;case"swirl-tag":customElements.get(s(e))||d();break;case"swirl-visually-hidden":customElements.get(s(e))||g()}}))};export{v as SwirlTreeNavigationItem,f as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as i,HTMLElement as e,h as t,Host as a,transformTag as n}from"@stencil/core/internal/client";import{d as o}from"./swirl-visually-hidden2.js";const s=i(class extends e{constructor(i){super(),!1!==i&&this.__registerHost(),this.__attachShadow(),this.durationLabel="Duration"}render(){return t(a,{key:"
|
|
1
|
+
import{proxyCustomElement as i,HTMLElement as e,h as t,Host as a,transformTag as n}from"@stencil/core/internal/client";import{d as o}from"./swirl-visually-hidden2.js";const s=i(class extends e{constructor(i){super(),!1!==i&&this.__registerHost(),this.__attachShadow(),this.durationLabel="Duration"}render(){return t(a,{key:"f4b5e892518fccf1e1959544fe7bd15afbb0d44c"},t("button",{key:"5b580350e9154448b3d21c3c860e89d02fcaa8d9","aria-describedby":void 0!==this.duration?"duration":void 0,"aria-label":this.label,class:"video-thumbnail",type:"button"},t("img",{key:"3cba6d9df87c09717a866fb5a93bf814a82c50f0",alt:"",class:"video-thumbnail__image",loading:"lazy",src:this.src}),this.duration&&t("span",{key:"53a3a4e6381d041c658cb0139aa71b5b8b01eb98",class:"video-thumbnail__duration",id:"duration"},t("swirl-visually-hidden",{key:"88b4da4deb1606b86641273dca6984e8270b3053"},this.durationLabel),this.duration),t("svg",{key:"ee06d6f9ef41acfc1dfd33f0b16be1e7d6f99a03",class:"video-thumbnail__play-icon",fill:"none",viewBox:"0 0 40 40",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"0cfe8ddf2ff49220089e53d3e68448c782a0e328",d:"M15 14.65V25.35C15 26.1167 15.35 26.7 16.05 27.1C16.75 27.5 17.4333 27.4667 18.1 27L26.4 21.7C27.0333 21.3 27.35 20.7333 27.35 20C27.35 19.2667 27.0333 18.7 26.4 18.3L18.1 13C17.4333 12.5333 16.75 12.5 16.05 12.9C15.35 13.3 15 13.8833 15 14.65ZM20 40C17.2333 40 14.6333 39.4747 12.2 38.424C9.76667 37.3747 7.65 35.95 5.85 34.15C4.05 32.35 2.62533 30.2333 1.576 27.8C0.525334 25.3667 0 22.7667 0 20C0 17.2333 0.525334 14.6333 1.576 12.2C2.62533 9.76667 4.05 7.65 5.85 5.85C7.65 4.05 9.76667 2.62467 12.2 1.574C14.6333 0.524667 17.2333 0 20 0C22.7667 0 25.3667 0.524667 27.8 1.574C30.2333 2.62467 32.35 4.05 34.15 5.85C35.95 7.65 37.3747 9.76667 38.424 12.2C39.4747 14.6333 40 17.2333 40 20C40 22.7667 39.4747 25.3667 38.424 27.8C37.3747 30.2333 35.95 32.35 34.15 34.15C32.35 35.95 30.2333 37.3747 27.8 38.424C25.3667 39.4747 22.7667 40 20 40Z",fill:"white","fill-opacity":"0.95"}))))}static get style(){return':host{display:flex;width:100%}:host *{box-sizing:border-box}.video-thumbnail{position:relative;display:inline-flex;width:100%;margin:0;padding:0;border:none;background-color:transparent;cursor:pointer;container-type:inline-size;container-name:video-thumbnail}.video-thumbnail:after{position:absolute;background-color:rgba(0, 0, 0, 0.05);content:"";inset:0}.video-thumbnail:focus:not(:focus-visible){outline:none}.video-thumbnail:focus-visible{outline-color:var(--s-focus-default);outline-offset:var(--s-space-4)}.video-thumbnail__image{width:100%}.video-thumbnail__duration{position:absolute;bottom:var(--s-space-8);left:var(--s-space-8);padding:var(--s-space-2) var(--s-space-8);border-radius:var(--s-border-radius-sm);color:var(--s-text-on-image);background:linear-gradient(0deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), rgba(255, 255, 255, 0.1);font-size:var(--s-font-size-sm);font-weight:var(--s-font-weight-medium);line-height:var(--s-line-height-sm);letter-spacing:var(--s-letter-spacing-tighter)}.video-thumbnail__play-icon{position:absolute;z-index:1;top:50%;left:50%;width:2.5rem;height:2.5rem;transform:translate3d(-50%, -50%, 0)}@container video-thumbnail (min-width: 448px){.video-thumbnail__play-icon{width:3.5rem;height:4.5rem}}'}},[1,"swirl-video-thumbnail",{durationLabel:[1,"duration-label"],duration:[1],label:[1],src:[1]}]),r=s,l=function(){"undefined"!=typeof customElements&&["swirl-video-thumbnail","swirl-visually-hidden"].forEach((i=>{switch(i){case"swirl-video-thumbnail":customElements.get(n(i))||customElements.define(n(i),s);break;case"swirl-visually-hidden":customElements.get(n(i))||o()}}))};export{r as SwirlVideoThumbnail,l as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as i,h as s,Host as t,transformTag as n}from"@stencil/core/internal/client";const l=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost()}render(){return s(t,{key:"
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as i,h as s,Host as t,transformTag as n}from"@stencil/core/internal/client";const l=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost()}render(){return s(t,{key:"90076cf37baa0aa32be3f1f6b4900fd2d672b95b"},s("slot",{key:"bc644b9f81e4945abde8107bcddc0bb0ac2f12b6"}))}static get style(){return".sc-swirl-visually-hidden-h{position:absolute;display:inline;overflow:hidden;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;word-wrap:normal;clip:rect(0, 0, 0, 0)}"}},[262,"swirl-visually-hidden"]);function r(){"undefined"!=typeof customElements&&["swirl-visually-hidden"].forEach((e=>{"swirl-visually-hidden"===e&&(customElements.get(n(e))||customElements.define(n(e),l))}))}export{l as S,r as d}
|
|
@@ -1726,6 +1726,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1726
1726
|
return import(
|
|
1727
1727
|
/* webpackMode: "lazy" */
|
|
1728
1728
|
'./swirl-icon-search.entry.js').then(processMod, consoleError);
|
|
1729
|
+
case 'swirl-option-list':
|
|
1730
|
+
return import(
|
|
1731
|
+
/* webpackMode: "lazy" */
|
|
1732
|
+
'./swirl-option-list.entry.js').then(processMod, consoleError);
|
|
1729
1733
|
case 'swirl-progress-indicator':
|
|
1730
1734
|
return import(
|
|
1731
1735
|
/* webpackMode: "lazy" */
|
|
@@ -1746,6 +1750,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1746
1750
|
return import(
|
|
1747
1751
|
/* webpackMode: "lazy" */
|
|
1748
1752
|
'./swirl-icon-info.entry.js').then(processMod, consoleError);
|
|
1753
|
+
case 'swirl-tag':
|
|
1754
|
+
return import(
|
|
1755
|
+
/* webpackMode: "lazy" */
|
|
1756
|
+
'./swirl-tag.entry.js').then(processMod, consoleError);
|
|
1749
1757
|
case 'swirl-heading':
|
|
1750
1758
|
return import(
|
|
1751
1759
|
/* webpackMode: "lazy" */
|
|
@@ -1806,10 +1814,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
1806
1814
|
return import(
|
|
1807
1815
|
/* webpackMode: "lazy" */
|
|
1808
1816
|
'./swirl-icon-check-circle_2.entry.js').then(processMod, consoleError);
|
|
1809
|
-
case 'swirl-option-list_2':
|
|
1810
|
-
return import(
|
|
1811
|
-
/* webpackMode: "lazy" */
|
|
1812
|
-
'./swirl-option-list_2.entry.js').then(processMod, consoleError);
|
|
1813
1817
|
case 'swirl-icon-check-small_2':
|
|
1814
1818
|
return import(
|
|
1815
1819
|
/* webpackMode: "lazy" */
|