@thecb/components 11.4.1-beta.1 → 11.4.1
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/package.json
CHANGED
|
@@ -18,13 +18,13 @@ const Tab = ({ label, activeTab, setActiveTab }) => {
|
|
|
18
18
|
className={className}
|
|
19
19
|
onClick={onClick}
|
|
20
20
|
margin="0 0 -1px 0"
|
|
21
|
-
padding="
|
|
21
|
+
padding="1rem 0.75rem"
|
|
22
22
|
background={activeTab === label ? WHITE : GRECIAN_GREY}
|
|
23
23
|
extraStyles={`cursor: pointer; flex-grow: 1; text-align: center; ${
|
|
24
24
|
activeTab === label ? `list-style: none;` : ``
|
|
25
25
|
}`}
|
|
26
26
|
>
|
|
27
|
-
<Text>{label}</Text>
|
|
27
|
+
<Text weight="600">{label}</Text>
|
|
28
28
|
</Box>
|
|
29
29
|
);
|
|
30
30
|
};
|
|
@@ -6,7 +6,14 @@ import Tab from "../../atoms/tab";
|
|
|
6
6
|
|
|
7
7
|
const HORIZONTAL = "horizontal";
|
|
8
8
|
|
|
9
|
-
const Tabs = ({
|
|
9
|
+
const Tabs = ({
|
|
10
|
+
tabsConfig,
|
|
11
|
+
tabsDisplayMode = HORIZONTAL,
|
|
12
|
+
tabsPadding = "0",
|
|
13
|
+
contentPadding = "0",
|
|
14
|
+
extraStyles = "",
|
|
15
|
+
...props
|
|
16
|
+
}) => {
|
|
10
17
|
const [activeTab, toggleActiveTab] = useState(
|
|
11
18
|
tabsConfig.tabs[0]?.label || null
|
|
12
19
|
);
|
|
@@ -47,14 +54,14 @@ const Tabs = ({ tabsConfig, tabsDisplayMode = HORIZONTAL, ...props }) => {
|
|
|
47
54
|
};
|
|
48
55
|
|
|
49
56
|
return (
|
|
50
|
-
<Box className="tabs" {...props}>
|
|
51
|
-
<Box className="tab-list">
|
|
57
|
+
<Box className="tabs" padding="0" extraStyles={extraStyles} {...props}>
|
|
58
|
+
<Box className="tab-list" padding={tabsPadding}>
|
|
52
59
|
{tabsDisplayMode == HORIZONTAL
|
|
53
60
|
? showHorizontal(tabsConfig, activeTab)
|
|
54
61
|
: showVertical(tabsConfig, activeTab)}
|
|
55
62
|
</Box>
|
|
56
|
-
<Box className="tab-content">
|
|
57
|
-
<Box>
|
|
63
|
+
<Box className="tab-content" padding={contentPadding}>
|
|
64
|
+
<Box padding="0">
|
|
58
65
|
{tabsConfig.tabs.map((tab, idx) => {
|
|
59
66
|
if (tab.label !== activeTab) return undefined;
|
|
60
67
|
return <Fragment key={idx}>{tab.content}</Fragment>;
|