@growth-angels/ds-core 1.14.1 → 1.15.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.
|
@@ -8,7 +8,7 @@ export const Tabs = ({ tabs, children, extraClassNames, edit }) => {
|
|
|
8
8
|
if (extraClassNames) {
|
|
9
9
|
classes.push(...extraClassNames);
|
|
10
10
|
}
|
|
11
|
-
return (_jsxs("div", { className: classes.join(" "), children: [_jsx("div", { className: "ga-ds-tabs__list", role: "tablist", children: tabs.map((tab, index) => (_jsx("button", { ref: (el) => (tabsRef.current[index] = el), role: "tab", "aria-selected": activeTab === tab.id, "aria-controls": `ga-ds-tabpanel-${tab.id}`, id: `ga-ds-tab-${tab.id}`, tabIndex: activeTab === tab.id ? 0 : -1, className: `ga-ds-tabs__tab ${activeTab === tab.id ? "ga-ds-tabs__tab--active" : ""}`, onClick: () => setActiveTab(tab.id), children: tab.label }, tab.id))) }), _jsx("div", { className: "ga-ds-tabs__panels", children: !edit
|
|
11
|
+
return (_jsxs("div", { className: classes.join(" "), children: [_jsx("div", { className: "ga-ds-tabs__list", role: "tablist", children: _jsx("div", { className: "ga-ds-tabs__list-container", children: tabs.map((tab, index) => (_jsx("button", { ref: (el) => (tabsRef.current[index] = el), role: "tab", "aria-selected": activeTab === tab.id, "aria-controls": `ga-ds-tabpanel-${tab.id}`, id: `ga-ds-tab-${tab.id}`, tabIndex: activeTab === tab.id ? 0 : -1, className: `ga-ds-tabs__tab ${activeTab === tab.id ? "ga-ds-tabs__tab--active" : ""}`, onClick: () => setActiveTab(tab.id), children: tab.label }, tab.id))) }) }), _jsx("div", { className: "ga-ds-tabs__panels", children: !edit
|
|
12
12
|
? Children.toArray(children).map((child) => (_jsx("div", { className: ["ga-ds-tabs__panel", activeTab === child.props.id ? "ga-ds-tabs__panel--active" : ""].join(" "), children: _jsx("div", { role: "tabpanel", id: `ga-ds-tabpanel-${child.props.id}`, "aria-labelledby": `ga-ds-tab-${child.props.id}`, children: child }) }, child.props.id)))
|
|
13
13
|
: children })] }));
|
|
14
14
|
};
|
package/package.json
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
@include bp-up("
|
|
32
|
+
@include bp-up("xxl", $ga-breakpoints) {
|
|
33
33
|
.ga-ds-container--small {
|
|
34
34
|
&:not(.ga-ds-container-stretch--right) {
|
|
35
35
|
padding-right: calc((100% - #{map.get($ga-containers, "sm")}) / 2);
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
@include bp-up("
|
|
43
|
+
@include bp-up("xxl", $ga-breakpoints) {
|
|
44
44
|
.ga-ds-container--medium {
|
|
45
45
|
&:not(.ga-ds-container-stretch--right) {
|
|
46
46
|
padding-right: calc((100% - #{map.get($ga-containers, "md")}) / 2);
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
@include bp-up("
|
|
54
|
+
@include bp-up("xxl", $ga-breakpoints) {
|
|
55
55
|
.ga-ds-container--large {
|
|
56
56
|
&:not(.ga-ds-container-stretch--right) {
|
|
57
57
|
padding-right: calc((100% - #{map.get($ga-containers, "lg")}) / 2);
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
.ga-ds-tabs {
|
|
2
2
|
$this: &;
|
|
3
|
+
|
|
3
4
|
&__list {
|
|
5
|
+
overflow-x: auto;
|
|
6
|
+
-webkit-overflow-scrolling: touch;
|
|
7
|
+
scrollbar-width: none; // Firefox
|
|
8
|
+
&::-webkit-scrollbar {
|
|
9
|
+
display: none; // Safari and Chrome
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
&__list-container {
|
|
4
13
|
display: flex;
|
|
14
|
+
flex-wrap: nowrap;
|
|
5
15
|
|
|
6
16
|
#{$this}__tab {
|
|
7
17
|
background: none;
|
|
@@ -9,6 +19,7 @@
|
|
|
9
19
|
font-size: inherit;
|
|
10
20
|
padding: inherit;
|
|
11
21
|
cursor: pointer;
|
|
22
|
+
width: fit-content;
|
|
12
23
|
}
|
|
13
24
|
}
|
|
14
25
|
|
|
@@ -13,21 +13,23 @@ export const Tabs = ({ tabs, children, extraClassNames, edit }: TabsProps) => {
|
|
|
13
13
|
return (
|
|
14
14
|
<div className={classes.join(" ")}>
|
|
15
15
|
<div className="ga-ds-tabs__list" role="tablist">
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
<div className="ga-ds-tabs__list-container">
|
|
17
|
+
{tabs.map((tab, index) => (
|
|
18
|
+
<button
|
|
19
|
+
key={tab.id}
|
|
20
|
+
ref={(el) => (tabsRef.current[index] = el)}
|
|
21
|
+
role="tab"
|
|
22
|
+
aria-selected={activeTab === tab.id}
|
|
23
|
+
aria-controls={`ga-ds-tabpanel-${tab.id}`}
|
|
24
|
+
id={`ga-ds-tab-${tab.id}`}
|
|
25
|
+
tabIndex={activeTab === tab.id ? 0 : -1}
|
|
26
|
+
className={`ga-ds-tabs__tab ${activeTab === tab.id ? "ga-ds-tabs__tab--active" : ""}`}
|
|
27
|
+
onClick={() => setActiveTab(tab.id)}
|
|
28
|
+
>
|
|
29
|
+
{tab.label}
|
|
30
|
+
</button>
|
|
31
|
+
))}
|
|
32
|
+
</div>
|
|
31
33
|
</div>
|
|
32
34
|
<div className="ga-ds-tabs__panels">
|
|
33
35
|
{!edit
|