@getflip/swirl-components 0.289.0 → 0.290.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 +1 -1
- package/dist/cjs/swirl-tab-bar.cjs.entry.js +9 -2
- package/dist/collection/components/swirl-tab-bar/swirl-tab-bar.js +9 -2
- package/dist/components/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/components/swirl-tab-bar2.js +9 -2
- package/dist/esm/swirl-tab-bar.entry.js +9 -2
- package/dist/swirl-components/p-761bed6f.entry.js +1 -0
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/dist/types/components/swirl-tab-bar/swirl-tab-bar.d.ts +1 -0
- package/package.json +1 -1
- package/dist/swirl-components/p-8d7ad114.entry.js +0 -1
package/components.json
CHANGED
|
@@ -37,6 +37,13 @@ const SwirlTabBar = class {
|
|
|
37
37
|
this.tabs = [];
|
|
38
38
|
this.variant = "default";
|
|
39
39
|
}
|
|
40
|
+
onTabFocus(event) {
|
|
41
|
+
event.target.scrollIntoView({
|
|
42
|
+
behavior: "smooth",
|
|
43
|
+
block: "nearest",
|
|
44
|
+
inline: "center",
|
|
45
|
+
});
|
|
46
|
+
}
|
|
40
47
|
focusAdjacentTab(previous) {
|
|
41
48
|
const tabs = this.getTabs();
|
|
42
49
|
const selectedTabIndex = tabs.findIndex((tab) => tab.ariaSelected === "true");
|
|
@@ -65,7 +72,7 @@ const SwirlTabBar = class {
|
|
|
65
72
|
? `var(--s-space-${this.paddingBlockStart})`
|
|
66
73
|
: undefined,
|
|
67
74
|
};
|
|
68
|
-
return (index.h(index.Host, { key: '
|
|
75
|
+
return (index.h(index.Host, { key: 'f5ebe5a9d614fa2b59dac17e08e90aba4a3c4a60' }, index.h("div", { key: '8bf90f073348f34fe7293e837e70fe8ea09220ce', "aria-label": this.label, class: className, onKeyDown: this.onKeyDown, role: this.disableTabSemantics ? undefined : "tablist", style: styles }, this.tabs.map((tab) => {
|
|
69
76
|
const className = index$1.classnames("tab-bar__tab", {
|
|
70
77
|
"tab-bar__tab--active": tab.active,
|
|
71
78
|
"tab-bar__tab--variant-pill": this.variant === "pill",
|
|
@@ -80,7 +87,7 @@ const SwirlTabBar = class {
|
|
|
80
87
|
? "true"
|
|
81
88
|
: "false", class: className, id: `tab-${tab.id}`, key: tab.id,
|
|
82
89
|
// eslint-disable-next-line react/jsx-no-bind
|
|
83
|
-
onClick: () => this.activateTab.emit(tab.id), role: this.disableTabSemantics ? undefined : "tab", tabIndex: this.disableTabSemantics ? undefined : tab.active ? 0 : -1, type: "button" }, tab.icon && (index.h("span", { class: "tab-bar__tab-icon", innerHTML: tab.icon })), index.h("span", { class: labelClassName }, tab.label)));
|
|
90
|
+
onClick: () => this.activateTab.emit(tab.id), onFocus: this.onTabFocus, role: this.disableTabSemantics ? undefined : "tab", tabIndex: this.disableTabSemantics ? undefined : tab.active ? 0 : -1, type: "button" }, tab.icon && (index.h("span", { class: "tab-bar__tab-icon", innerHTML: tab.icon })), index.h("span", { class: labelClassName }, tab.label)));
|
|
84
91
|
}))));
|
|
85
92
|
}
|
|
86
93
|
get el() { return index.getElement(this); }
|
|
@@ -25,6 +25,13 @@ export class SwirlTabBar {
|
|
|
25
25
|
this.tabs = [];
|
|
26
26
|
this.variant = "default";
|
|
27
27
|
}
|
|
28
|
+
onTabFocus(event) {
|
|
29
|
+
event.target.scrollIntoView({
|
|
30
|
+
behavior: "smooth",
|
|
31
|
+
block: "nearest",
|
|
32
|
+
inline: "center",
|
|
33
|
+
});
|
|
34
|
+
}
|
|
28
35
|
focusAdjacentTab(previous) {
|
|
29
36
|
const tabs = this.getTabs();
|
|
30
37
|
const selectedTabIndex = tabs.findIndex((tab) => tab.ariaSelected === "true");
|
|
@@ -53,7 +60,7 @@ export class SwirlTabBar {
|
|
|
53
60
|
? `var(--s-space-${this.paddingBlockStart})`
|
|
54
61
|
: undefined,
|
|
55
62
|
};
|
|
56
|
-
return (h(Host, { key: '
|
|
63
|
+
return (h(Host, { key: 'f5ebe5a9d614fa2b59dac17e08e90aba4a3c4a60' }, h("div", { key: '8bf90f073348f34fe7293e837e70fe8ea09220ce', "aria-label": this.label, class: className, onKeyDown: this.onKeyDown, role: this.disableTabSemantics ? undefined : "tablist", style: styles }, this.tabs.map((tab) => {
|
|
57
64
|
const className = classnames("tab-bar__tab", {
|
|
58
65
|
"tab-bar__tab--active": tab.active,
|
|
59
66
|
"tab-bar__tab--variant-pill": this.variant === "pill",
|
|
@@ -68,7 +75,7 @@ export class SwirlTabBar {
|
|
|
68
75
|
? "true"
|
|
69
76
|
: "false", class: className, id: `tab-${tab.id}`, key: tab.id,
|
|
70
77
|
// eslint-disable-next-line react/jsx-no-bind
|
|
71
|
-
onClick: () => this.activateTab.emit(tab.id), role: this.disableTabSemantics ? undefined : "tab", tabIndex: this.disableTabSemantics ? undefined : tab.active ? 0 : -1, type: "button" }, tab.icon && (h("span", { class: "tab-bar__tab-icon", innerHTML: tab.icon })), h("span", { class: labelClassName }, tab.label)));
|
|
78
|
+
onClick: () => this.activateTab.emit(tab.id), onFocus: this.onTabFocus, role: this.disableTabSemantics ? undefined : "tab", tabIndex: this.disableTabSemantics ? undefined : tab.active ? 0 : -1, type: "button" }, tab.icon && (h("span", { class: "tab-bar__tab-icon", innerHTML: tab.icon })), h("span", { class: labelClassName }, tab.label)));
|
|
72
79
|
}))));
|
|
73
80
|
}
|
|
74
81
|
static get is() { return "swirl-tab-bar"; }
|