Skip to content

Commit bce8242

Browse files
committed
chore: tabs-migration-with-new-implementation
1 parent b864c7a commit bce8242

File tree

3 files changed

+213
-137
lines changed

3 files changed

+213
-137
lines changed

src/App.tsx

Lines changed: 89 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { GlobalStyle } from "./styles/global-style";
55
import { lightTheme, darkTheme } from "./styles/themes";
66
import Button from "./lib/button";
77
import Tabs from "./lib/pagination/tabs";
8-
import Card from "./lib/container/card";
98
import Buttons from "./examples/buttons";
109
import Pagination from "./examples/pagination";
1110
import Containers from "./examples/containers";
@@ -19,6 +18,7 @@ import TimelineProgress from "./examples/timeline";
1918
import Input from "./examples/input";
2019
import Tooltips from "./examples/tooltip";
2120
import Copiable from "./examples/copiable";
21+
import clsx from "clsx";
2222

2323
const StyledDiv = styled.div`
2424
position: fixed;
@@ -38,29 +38,9 @@ const StyledDiv = styled.div`
3838
${(props) => props.theme.klerosUIComponentsTransitionSpeed};
3939
`;
4040

41-
const StyledCard = styled(Card)`
42-
height: 500px;
43-
width: 1000px;
44-
display: flex;
45-
justify-content: space-around;
46-
align-items: center;
47-
gap: 24px;
48-
overflow: auto;
49-
flex-wrap: wrap;
50-
padding: 36px 36px;
51-
background: ${(props) => props.theme.klerosUIComponentsLightBackground};
52-
transition: background ease
53-
${(props) => props.theme.klerosUIComponentsTransitionSpeed};
54-
`;
55-
56-
const StyledTabs = styled(Tabs)`
57-
width: 995px;
58-
`;
59-
6041
const App = () => {
6142
const [theme, setTheme] = useState(lightTheme);
6243
const [tailwindTheme, setTailwindTheme] = useState("light");
63-
const [example, setExample] = useState("buttons");
6444

6545
// temporary
6646
const changeTheme = () => {
@@ -80,40 +60,97 @@ const App = () => {
8060
<ThemeProvider theme={theme}>
8161
<GlobalStyle />
8262
<StyledDiv>
83-
<StyledTabs
63+
<Tabs
64+
className="w-[995px]"
65+
defaultSelectedKey={"buttons"}
66+
panelClassName={clsx(
67+
"h-[500px] w-[1000px] bg-klerosUIComponentsLightBackground",
68+
"transition-[background] ease-ease",
69+
"border border-klerosUIComponentsStroke box-border",
70+
"flex justify-around items-center gap-6 flex-wrap p-9",
71+
"overflow-auto rounded-base shadow-sm shadow-klerosUIComponentsDefaultShadow-400",
72+
)}
8473
items={[
85-
{ text: "Buttons", value: "buttons" },
86-
{ text: "Pagination", value: "pagination" },
87-
{ text: "Containers", value: "containers" },
88-
{ text: "Accordion", value: "accordion" },
89-
{ text: "Form", value: "form" },
90-
{ text: "Dropdowns", value: "dropdowns" },
91-
{ text: "Displays", value: "displays" },
92-
{ text: "Messages", value: "messages" },
93-
{ text: "Timeline", value: "timeline" },
94-
{ text: "Progress", value: "progress" },
95-
{ text: "Input", value: "input" },
96-
{ text: "Tooltip", value: "tooltip" },
97-
{ text: "Copiable", value: "copiable" },
74+
{
75+
text: "Buttons",
76+
value: "buttons",
77+
id: "buttons",
78+
content: <Buttons />,
79+
},
80+
{
81+
text: "Pagination",
82+
value: "pagination",
83+
id: "pagination",
84+
content: <Pagination />,
85+
},
86+
{
87+
text: "Containers",
88+
value: "containers",
89+
id: "containers",
90+
content: <Containers />,
91+
},
92+
{
93+
text: "Accordion",
94+
value: "accordion",
95+
id: "accordion",
96+
content: <Accordion />,
97+
},
98+
{
99+
text: "Form",
100+
value: "form",
101+
id: "content",
102+
content: <Form />,
103+
},
104+
{
105+
text: "Dropdowns",
106+
value: "dropdowns",
107+
id: "dropdowns",
108+
content: <Dropdowns />,
109+
},
110+
{
111+
text: "Displays",
112+
value: "displays",
113+
id: "displays",
114+
content: <Displays />,
115+
},
116+
{
117+
text: "Messages",
118+
value: "messages",
119+
id: "messages",
120+
content: <Messages />,
121+
},
122+
{
123+
text: "Timeline",
124+
value: "timeline",
125+
id: "timeline",
126+
content: <TimelineProgress />,
127+
},
128+
{
129+
text: "Progress",
130+
value: "progress",
131+
id: "progress",
132+
content: <Progress />,
133+
},
134+
{
135+
text: "Input",
136+
value: "input",
137+
id: "input",
138+
content: <Input />,
139+
},
140+
{
141+
text: "Tooltip",
142+
value: "tooltip",
143+
id: "tooltip",
144+
content: <Tooltips />,
145+
},
146+
{
147+
text: "Copiable",
148+
value: "copiable",
149+
id: "copiable",
150+
content: <Copiable />,
151+
},
98152
]}
99-
callback={setExample}
100-
currentValue={example}
101153
/>
102-
<StyledCard>
103-
{example === "buttons" && <Buttons />}
104-
{example === "pagination" && <Pagination />}
105-
{example === "containers" && <Containers />}
106-
{example === "accordion" && <Accordion />}
107-
{example === "form" && <Form />}
108-
{example === "dropdowns" && <Dropdowns />}
109-
{example === "displays" && <Displays />}
110-
{example === "messages" && <Messages />}
111-
{example === "timeline" && <TimelineProgress />}
112-
{example === "progress" && <Progress />}
113-
{example === "input" && <Input />}
114-
{example === "tooltip" && <Tooltips />}
115-
{example === "copiable" && <Copiable />}
116-
</StyledCard>
117154
<Button
118155
variant="primary"
119156
className="mt-16"

src/examples/pagination.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,26 @@ const Pagination = () => {
2121
numPages={6}
2222
/>
2323
<Tabs
24+
className="w-[500px]"
25+
defaultSelectedKey={"hello"}
26+
panelClassName="bg-klerosUIComponentsLightBlue p-4"
2427
items={[
25-
{ text: "hello", value: 0 },
28+
{ text: "hello", value: 0, id: "hello", content: <p>hello</p> },
2629
{
2730
text: "Telegram",
2831
value: 1,
2932
Icon: Telegram,
33+
id: "telegram",
34+
content: <p>Telegram</p>,
35+
},
36+
{
37+
text: "disabled",
38+
value: 2,
39+
disabled: true,
40+
id: "disabled",
41+
content: <p>Disabled</p>,
3042
},
31-
{ text: "hello1", value: 2, disabled: true },
3243
]}
33-
callback={() => {
34-
// function called when a tab is clicked
35-
}}
36-
currentValue={0}
3744
/>
3845
<Breadcrumb
3946
items={[

0 commit comments

Comments
 (0)