Skip to content

Commit bca0900

Browse files
committed
Add new version style
1 parent 928cbea commit bca0900

File tree

5 files changed

+45
-4
lines changed

5 files changed

+45
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jderobot-ide-interface",
3-
"version": "0.1.22",
3+
"version": "0.1.23",
44
"main": "dist/main.js",
55
"typings": "dist/index.d.ts",
66
"files": [

src/components/Button/Button.styles.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ interface StyledButtonProps {
1010
variant: ButtonVariant;
1111
iconType: IconVariant;
1212
active: boolean;
13+
isLabel: boolean;
1314
}
1415

1516
const handleVariant = (p: StyledButtonProps) => {
@@ -58,11 +59,19 @@ const handleActive = (p: StyledButtonProps) => {
5859
}
5960
};
6061

62+
const handleLabel = (p: StyledButtonProps) => {
63+
if (!p.isLabel) {
64+
return `
65+
width: 24px;
66+
`;
67+
}
68+
};
69+
70+
6171
export const StyledButton = styled.button<StyledButtonProps>`
6272
display: flex;
6373
justify-content: center;
6474
align-items: center;
65-
width: 24px;
6675
height: 24px;
6776
border: 0;
6877
padding: 0 0 0 0;
@@ -79,6 +88,7 @@ export const StyledButton = styled.button<StyledButtonProps>`
7988
${handleVariant}
8089
${handleActive}
8190
${handleIcon}
91+
${handleLabel}
8292
8393
& svg {
8494
width: 20px;

src/components/Button/Button.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export type IconVariant = "fill" | "stroke";
55

66
const Button = ({
77
active = false,
8+
isLabel = false,
89
variant = "standard",
910
iconType,
1011
title,
@@ -13,6 +14,7 @@ const Button = ({
1314
children,
1415
}: {
1516
active: boolean;
17+
isLabel: boolean;
1618
variant: ButtonVariant;
1719
iconType: IconVariant;
1820
title: string;
@@ -28,6 +30,7 @@ const Button = ({
2830
color={theme.palette?.text}
2931
roundness={theme.roundness}
3032
variant={variant}
33+
isLabel={isLabel}
3134
iconType={iconType}
3235
title={title}
3336
id={id}
@@ -57,6 +60,7 @@ export const MenuButton = ({
5760
active={false}
5861
variant="standard"
5962
iconType="fill"
63+
isLabel={false}
6064
title={title}
6165
id={id}
6266
onClick={() => onClick()}
@@ -82,6 +86,7 @@ export const MenuButtonStroke = ({
8286
active={false}
8387
variant="standard"
8488
iconType="stroke"
89+
isLabel={false}
8590
title={title}
8691
id={id}
8792
onClick={() => onClick()}
@@ -90,3 +95,29 @@ export const MenuButtonStroke = ({
9095
</Button>
9196
);
9297
};
98+
99+
export const MenuButtonLabel = ({
100+
title,
101+
id,
102+
onClick,
103+
children,
104+
}: {
105+
title: string;
106+
id: string;
107+
onClick: Function;
108+
children: any;
109+
}) => {
110+
return (
111+
<Button
112+
active={false}
113+
variant="standard"
114+
iconType="fill"
115+
isLabel={true}
116+
title={title}
117+
id={id}
118+
onClick={() => onClick()}
119+
>
120+
{children}
121+
</Button>
122+
);
123+
};

src/components/Button/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { default as Button, MenuButton, MenuButtonStroke } from "./Button";
1+
export { default as Button, MenuButton, MenuButtonStroke, MenuButtonLabel } from "./Button";

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { IdeInterface } from "./components";
22
export default IdeInterface;
33

44
export { VncViewer } from "./components";
5-
export { Button, MenuButton, MenuButtonStroke } from "./components";
5+
export { Button, MenuButton, MenuButtonStroke, MenuButtonLabel } from "./components";
66
export {
77
ThemeProvider,
88
useTheme,

0 commit comments

Comments
 (0)