Skip to content

Commit 1119450

Browse files
authored
Merge pull request #78 from zesty-io/sidebar-dark-theme
Sidebar dark theme
2 parents 1be0a6f + f3fd34b commit 1119450

File tree

10 files changed

+654
-467
lines changed

10 files changed

+654
-467
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ storybook-static
2525
*.njsproj
2626
*.sln
2727
*.sw?
28+
29+
# Built package
30+
zesty-io-material-*.tgz

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zesty-io/material",
3-
"version": "0.7.0",
3+
"version": "0.8.0",
44
"description": "Contains custom components which are in addition to the @mui design-system",
55
"author": "Zesty.io",
66
"license": "MIT",

src/IconButton/IconButton.stories.tsx

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Story, Meta } from "@storybook/react/types-6-0";
2+
import { IconButton, Props } from "./";
3+
4+
export default {
5+
title: "IconButton",
6+
component: IconButton,
7+
argType: {},
8+
} as Meta;
9+
10+
const Template: Story<Props> = (args) => {
11+
return <IconButton />;
12+
};
13+
14+
export const Default = Template.bind({});

src/IconButton/index.tsx

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { IconButton as IconButtonBase } from "@mui/material";
2+
import { styled } from "@mui/material/styles";
3+
4+
export type Props = {
5+
variant?: "standard" | "contained";
6+
};
7+
8+
export const IconButton = styled(IconButtonBase)<Props>(
9+
({ theme, variant = "standard", color = "inherit" }) => {
10+
if (variant === "standard") {
11+
return {};
12+
}
13+
const colorVariant =
14+
color === "default" || color === "inherit" ? "primary" : color;
15+
16+
return {
17+
backgroundColor: theme.palette[colorVariant].main,
18+
color: theme.palette.common.white,
19+
"&:hover": {
20+
backgroundColor: theme.palette[colorVariant].dark,
21+
},
22+
};
23+
}
24+
);

src/icons/Home.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { SvgIcon, SvgIconProps } from "@mui/material";
2+
3+
export const Home = (props: SvgIconProps) => (
4+
<SvgIcon {...props}>
5+
<path
6+
d="M5.5 20.625C5.08333 20.625 4.72917 20.4792 4.4375 20.1875C4.14583 19.8958 4 19.5417 4 19.125V9.375C4 9.14167 4.05417 8.91667 4.1625 8.7C4.27083 8.48333 4.41667 8.30833 4.6 8.175L11.1 3.3C11.2333 3.2 11.375 3.125 11.525 3.075C11.675 3.025 11.8333 3 12 3C12.1667 3 12.325 3.025 12.475 3.075C12.625 3.125 12.7667 3.2 12.9 3.3L19.4 8.175C19.5833 8.30833 19.7292 8.48333 19.8375 8.7C19.9458 8.91667 20 9.14167 20 9.375V19.125C20 19.5417 19.8542 19.8958 19.5625 20.1875C19.2708 20.4792 18.9167 20.625 18.5 20.625H14V13.625H10V20.625H5.5Z"
7+
fill="currentColor"
8+
/>
9+
</SvgIcon>
10+
);

src/icons/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ export { Markdown } from "./Markdown";
66
export { OneToOne } from "./OneToOne";
77
export { EditNote } from "./EditNote";
88
export { FileTable } from "./FileTable";
9-
export { Brain } from "./Brain";
9+
export { Brain } from "./Brain";
10+
export { Home } from "./Home";

src/index.ts

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
export { default as legacyTheme } from './LegacyTheme';
2-
export { default as theme } from './theme';
3-
export { default as FieldTypeText } from './FieldTypeText';
4-
export { default as FieldTypeSort } from './FieldTypeSort';
5-
export { default as FieldTypeUrl } from './FieldTypeUrl';
6-
export { default as FieldTypeDate } from './FieldTypeDate';
7-
export { default as FieldTypeDateTime } from './FieldTypeDateTime';
8-
export { default as FieldTypeColor } from './FieldTypeColor';
9-
export { default as FieldTypeNumber } from './FieldTypeNumber';
10-
export { default as FieldTypeOneToOne} from './FieldTypeOneToOne';
11-
export { default as FieldTypeOneToMany} from './FieldTypeOneToMany';
12-
export { default as CopyButton } from './CopyButton';
13-
export { default as ConfirmDialog } from './ConfirmDialog';
14-
export { default as VirtualizedAutocomplete } from './VitualizedAutocomplete';
15-
16-
export * from './icons';
1+
export { default as legacyTheme } from "./LegacyTheme";
2+
export { theme, darkTheme } from "./theme";
3+
export { default as FieldTypeText } from "./FieldTypeText";
4+
export { default as FieldTypeSort } from "./FieldTypeSort";
5+
export { default as FieldTypeUrl } from "./FieldTypeUrl";
6+
export { default as FieldTypeDate } from "./FieldTypeDate";
7+
export { default as FieldTypeDateTime } from "./FieldTypeDateTime";
8+
export { default as FieldTypeColor } from "./FieldTypeColor";
9+
export { default as FieldTypeNumber } from "./FieldTypeNumber";
10+
export { default as FieldTypeOneToOne } from "./FieldTypeOneToOne";
11+
export { default as FieldTypeOneToMany } from "./FieldTypeOneToMany";
12+
export { default as CopyButton } from "./CopyButton";
13+
export { default as ConfirmDialog } from "./ConfirmDialog";
14+
export { default as VirtualizedAutocomplete } from "./VitualizedAutocomplete";
15+
export { IconButton } from "./IconButton";
16+
export * from "./icons";

src/theme/Theme.stories.tsx

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
import React from 'react';
2-
import ReactJson from 'react-json-view'
3-
import { Story, Meta } from '@storybook/react/types-6-0';
4-
import theme from '.';
1+
import React from "react";
2+
import ReactJson from "react-json-view";
3+
import { Story, Meta } from "@storybook/react/types-6-0";
4+
import { darkTheme, theme } from ".";
55

66
export default {
7-
title: 'Theme',
7+
title: "Theme",
88
} as Meta;
99

10-
const Template: Story = (args) => {
11-
return (
12-
<ReactJson src={theme} />
13-
);
10+
const LightTheme: Story = (args) => {
11+
return <ReactJson src={theme} />;
1412
};
1513

16-
export const Default = Template.bind({});
14+
const DarkTheme: Story = (args) => {
15+
return <ReactJson src={darkTheme} />;
16+
};
17+
18+
export const light = LightTheme.bind({});
19+
export const dark = DarkTheme.bind({});

0 commit comments

Comments
 (0)