@getflip/swirl-components 0.120.1 → 0.120.3
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 +1 -1
- package/dist/cjs/swirl-app-layout_6.cjs.entry.js +25 -1
- package/dist/cjs/swirl-chip.cjs.entry.js +1 -1
- package/dist/collection/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/collection/components/swirl-chip/swirl-chip.css +3 -2
- package/dist/collection/components/swirl-resource-list-item/swirl-resource-list-item.js +26 -2
- package/dist/components/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/components/swirl-chip.js +1 -1
- package/dist/components/swirl-resource-list-item2.js +25 -1
- package/dist/esm/swirl-app-layout_6.entry.js +25 -1
- package/dist/esm/swirl-chip.entry.js +1 -1
- package/dist/swirl-components/{p-5d02fd42.entry.js → p-227a43ff.entry.js} +1 -1
- package/dist/swirl-components/{p-488d2a7d.entry.js → p-b2a9f663.entry.js} +1 -1
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/dist/types/components/swirl-resource-list-item/swirl-resource-list-item.d.ts +5 -0
- package/package.json +1 -1
package/components.json
CHANGED
|
@@ -479,6 +479,12 @@ const SwirlResourceListItem = class {
|
|
|
479
479
|
this.checked = !this.checked;
|
|
480
480
|
this.valueChange.emit(this.checked);
|
|
481
481
|
};
|
|
482
|
+
this.onBlur = () => {
|
|
483
|
+
this.makeControlUnfocusable();
|
|
484
|
+
};
|
|
485
|
+
this.onFocus = () => {
|
|
486
|
+
this.makeControlFocusable();
|
|
487
|
+
};
|
|
482
488
|
this.onMenuTriggerClick = (event) => {
|
|
483
489
|
if (this.disabled && !Boolean(this.href)) {
|
|
484
490
|
event.stopPropagation();
|
|
@@ -518,6 +524,7 @@ const SwirlResourceListItem = class {
|
|
|
518
524
|
this.forceIconProps(this.desktopMediaQuery.matches);
|
|
519
525
|
this.updateIconSize(this.desktopMediaQuery.matches);
|
|
520
526
|
this.desktopMediaQuery.onchange = this.desktopMediaQueryHandler;
|
|
527
|
+
this.makeControlUnfocusable();
|
|
521
528
|
if (Boolean(this.menuTriggerId)) {
|
|
522
529
|
console.warn('[Swirl] The "menu-trigger-id" prop of swirl-resource-list-item is deprecated and will be removed with the next major release. Please use the "control" slot to add a menu button instead. https://swirl-storybook.flip-app.dev/?path=/docs/components-swirlresourcelistitem--docs');
|
|
523
530
|
}
|
|
@@ -539,6 +546,23 @@ const SwirlResourceListItem = class {
|
|
|
539
546
|
this.hasMedia = hasMedia;
|
|
540
547
|
}
|
|
541
548
|
}
|
|
549
|
+
getControl() {
|
|
550
|
+
return this.el.querySelector('[slot="control"] button');
|
|
551
|
+
}
|
|
552
|
+
makeControlFocusable() {
|
|
553
|
+
const control = this.getControl();
|
|
554
|
+
if (!Boolean(control)) {
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
control.tabIndex = 0;
|
|
558
|
+
}
|
|
559
|
+
makeControlUnfocusable() {
|
|
560
|
+
const control = this.getControl();
|
|
561
|
+
if (!Boolean(control)) {
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
control.tabIndex = -1;
|
|
565
|
+
}
|
|
542
566
|
render() {
|
|
543
567
|
const Tag = !this.interactive && !this.selectable
|
|
544
568
|
? "div"
|
|
@@ -567,7 +591,7 @@ const SwirlResourceListItem = class {
|
|
|
567
591
|
"resource-list-item--show-control-on-focus": showControlOnFocus,
|
|
568
592
|
"resource-list-item--show-meta": showMeta,
|
|
569
593
|
});
|
|
570
|
-
return (index.h(index.Host, { role: "row" }, index.h("div", { class: className, role: "gridcell" }, index.h(Tag, { "aria-checked": ariaChecked, "aria-disabled": disabled ? "true" : undefined, "aria-labelledby": this.id, class: "resource-list-item__content", href: href, disabled: disabled, onClick: this.onClick, part: "resource-list-item__content", role: role, tabIndex: 0, type: Tag === "button" ? "button" : undefined }, this.hasMedia && (index.h("span", { class: "resource-list-item__media" }, index.h("slot", { name: "media" }))), index.h("span", { class: "resource-list-item__label-container" }, index.h("span", { class: "resource-list-item__label", id: this.id, innerHTML: this.label }), this.description && (index.h("span", { class: "resource-list-item__description" }, this.description))), showMeta && (index.h("span", { class: "resource-list-item__meta" }, index.h("span", { class: "resource-list-item__meta-text" }, this.meta), index.h("span", { class: "resource-list-item__badges" }, index.h("slot", { name: "badges" }))))), this.selectable && (index.h("span", { "aria-hidden": "true", class: "resource-list-item__checkbox" }, index.h("span", { class: "resource-list-item__checkbox-icon" }, this.checked && (index.h("swirl-icon-check-strong", null))))), index.h("span", { class: "resource-list-item__control" }, index.h("slot", { name: "control" })), showMenu && (index.h("swirl-popover-trigger", { popover: this.menuTriggerId }, index.h("swirl-button", { "aria-disabled": disabled ? "true" : undefined, class: "resource-list-item__menu-trigger", disabled: disabled, hideLabel: true, icon: "<swirl-icon-more-horizontal></swirl-icon-more-horizontal>", intent: "primary", label: this.menuTriggerLabel, onClick: this.onMenuTriggerClick })))), this.allowDrag && (index.h("button", { "aria-describedby": this.dragHandleDescription, "aria-label": `${this.dragHandleLabel} "${this.label}"`, class: "resource-list-item__drag-handle", onKeyDown: this.onDragHandleKeyDown, type: "button" }, index.h("swirl-icon-drag-handle", { size: this.iconSize })))));
|
|
594
|
+
return (index.h(index.Host, { role: "row" }, index.h("div", { class: className, role: "gridcell" }, index.h(Tag, { "aria-checked": ariaChecked, "aria-disabled": disabled ? "true" : undefined, "aria-labelledby": this.id, class: "resource-list-item__content", href: href, disabled: disabled, onClick: this.onClick, onBlur: this.onBlur, onFocus: this.onFocus, part: "resource-list-item__content", role: role, tabIndex: 0, type: Tag === "button" ? "button" : undefined }, this.hasMedia && (index.h("span", { class: "resource-list-item__media" }, index.h("slot", { name: "media" }))), index.h("span", { class: "resource-list-item__label-container" }, index.h("span", { class: "resource-list-item__label", id: this.id, innerHTML: this.label }), this.description && (index.h("span", { class: "resource-list-item__description" }, this.description))), showMeta && (index.h("span", { class: "resource-list-item__meta" }, index.h("span", { class: "resource-list-item__meta-text" }, this.meta), index.h("span", { class: "resource-list-item__badges" }, index.h("slot", { name: "badges" }))))), this.selectable && (index.h("span", { "aria-hidden": "true", class: "resource-list-item__checkbox" }, index.h("span", { class: "resource-list-item__checkbox-icon" }, this.checked && (index.h("swirl-icon-check-strong", null))))), index.h("span", { class: "resource-list-item__control" }, index.h("slot", { name: "control" })), showMenu && (index.h("swirl-popover-trigger", { popover: this.menuTriggerId }, index.h("swirl-button", { "aria-disabled": disabled ? "true" : undefined, class: "resource-list-item__menu-trigger", disabled: disabled, hideLabel: true, icon: "<swirl-icon-more-horizontal></swirl-icon-more-horizontal>", intent: "primary", label: this.menuTriggerLabel, onClick: this.onMenuTriggerClick })))), this.allowDrag && (index.h("button", { "aria-describedby": this.dragHandleDescription, "aria-label": `${this.dragHandleLabel} "${this.label}"`, class: "resource-list-item__drag-handle", onKeyDown: this.onDragHandleKeyDown, type: "button" }, index.h("swirl-icon-drag-handle", { size: this.iconSize })))));
|
|
571
595
|
}
|
|
572
596
|
get el() { return index.getElement(this); }
|
|
573
597
|
};
|
|
@@ -6,7 +6,7 @@ const index = require('./index-506fe4ea.js');
|
|
|
6
6
|
const index$1 = require('./index-2ddd0598.js');
|
|
7
7
|
const utils = require('./utils-2b6367e4.js');
|
|
8
8
|
|
|
9
|
-
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{
|
|
9
|
+
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{color:var(--s-text-on-action-primary);background-color:var(--s-action-primary-default)}.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{color:var(--s-text-on-action-primary);background-color:var(--s-action-primary-default)}.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;max-width:100%;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)}";
|
|
10
10
|
|
|
11
11
|
const SwirlChip = class {
|
|
12
12
|
constructor(hostRef) {
|