-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding toggle button, needs fix for reverse theme colors
- Loading branch information
1 parent
4397a3d
commit ef7e749
Showing
18 changed files
with
239 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,5 @@ ignores: [ | |
"react-dom", | ||
"remark-gfm", | ||
"rimraf", | ||
"storybook-dark-mode", | ||
"webpack" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,4 @@ | |
rel="stylesheet"> | ||
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700&display=swap" rel="stylesheet"> | ||
<link href="https://fonts.googleapis.com/css2?family=Fustat:wght@300;400;500;600;700&display=swap" rel="stylesheet"> | ||
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@100;200;300;400;500;600;700&display=swap" | ||
rel="stylesheet"> | ||
<link href="https://fonts.googleapis.com/css2?family=Outfit:[email protected]&display=swap" rel="stylesheet"> |
32 changes: 32 additions & 0 deletions
32
packages/invertible-theme/src/Buttons/ThemeModeButtonGroup.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { CssBaseline, ThemeProvider } from '@mui/material' | ||
import { createTheme } from '@mui/material/styles' | ||
import React from 'react' | ||
|
||
import { InvertibleMuiThemeProvider } from '../InvertibleMuiThemeProvider/index.ts' | ||
import { ThemeModeButtonGroup } from './ThemeModeButtonGroup.tsx' | ||
|
||
export default { | ||
title: 'Theme/ThemeModeButtonGroup', | ||
component: ThemeModeButtonGroup, | ||
parameters: { layout: 'fullscreen' }, | ||
} | ||
|
||
const theme = createTheme({ | ||
palette: { | ||
mode: 'light', | ||
primary: { main: '#2c5ba8' }, | ||
secondary: { main: '#ffb300' }, | ||
}, | ||
}) | ||
|
||
const Template = () => ( | ||
<ThemeProvider theme={theme}> | ||
<CssBaseline /> | ||
<InvertibleMuiThemeProvider> | ||
<ThemeModeButtonGroup /> | ||
</InvertibleMuiThemeProvider> | ||
</ThemeProvider> | ||
) | ||
|
||
export const Default = Template.bind({}) | ||
Default.args = {} |
42 changes: 42 additions & 0 deletions
42
packages/invertible-theme/src/Buttons/ThemeModeButtonGroup.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { | ||
Button, ButtonGroup, Chip, Stack, | ||
} from '@mui/material' | ||
import React from 'react' | ||
|
||
import { useColorSchemeEx } from '../InvertibleMuiThemeProvider/index.ts' | ||
|
||
export const ThemeModeButtonGroup: React.FC = () => { | ||
const { | ||
darkMode, lightMode, systemMode, mode, setMode, | ||
} = useColorSchemeEx() | ||
|
||
return ( | ||
<Stack direction="column" gap={2} alignItems="start"> | ||
<Stack direction="row" gap={2}> | ||
Current Mode: | ||
{' '} | ||
<Chip label={mode} /> | ||
</Stack> | ||
<ButtonGroup> | ||
<Button | ||
variant={darkMode ? 'contained' : 'outlined'} | ||
onClick={() => setMode('dark')} | ||
> | ||
Dark Mode | ||
</Button> | ||
<Button | ||
variant={lightMode ? 'contained' : 'outlined'} | ||
onClick={() => setMode('light')} | ||
> | ||
Light Mode | ||
</Button> | ||
<Button | ||
variant={systemMode ? 'contained' : 'outlined'} | ||
onClick={() => setMode('system')} | ||
> | ||
System | ||
</Button> | ||
</ButtonGroup> | ||
</Stack> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './DarkModeIconButton.tsx' | ||
export * from './ThemeModeButtonGroup.tsx' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.