-
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.
- Loading branch information
1 parent
cc602e5
commit a6b7bb5
Showing
100 changed files
with
4,058 additions
and
49 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
39 changes: 15 additions & 24 deletions
39
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 |
---|---|---|
@@ -1,33 +1,24 @@ | ||
import { CssBaseline, ThemeProvider } from '@mui/material' | ||
import { createTheme } from '@mui/material/styles' | ||
import type { StoryFn } from '@storybook/react' | ||
import type { Meta, StoryFn } from '@storybook/react' | ||
import React from 'react' | ||
|
||
import { InvertibleMuiThemeProvider } from '../InvertibleMuiThemeProvider/index.ts' | ||
import { ThemeModeButtonGroup } from './ThemeModeButtonGroup.tsx' | ||
|
||
export default { | ||
title: 'Theme/ThemeModeButtonGroup', | ||
const StorybookEntry = { | ||
argTypes: {}, | ||
component: ThemeModeButtonGroup, | ||
parameters: { layout: 'fullscreen' }, | ||
parameters: { docs: { page: null } }, | ||
title: 'theme/ThemeModeButtonGroup', | ||
} as Meta<typeof ThemeModeButtonGroup> | ||
|
||
const Template: StoryFn<typeof ThemeModeButtonGroup> = () => { | ||
return ( | ||
<ThemeModeButtonGroup /> | ||
) | ||
} | ||
|
||
const theme = createTheme({ | ||
palette: { | ||
mode: 'light', | ||
primary: { main: '#2c5ba8' }, | ||
secondary: { main: '#ffb300' }, | ||
}, | ||
}) | ||
const Default = Template.bind({}) | ||
Default.args = {} | ||
|
||
const Template: StoryFn = () => ( | ||
<ThemeProvider theme={theme}> | ||
<CssBaseline /> | ||
<InvertibleMuiThemeProvider> | ||
<ThemeModeButtonGroup sx={{ margin: 2 }} /> | ||
</InvertibleMuiThemeProvider> | ||
</ThemeProvider> | ||
) | ||
export { Default } | ||
|
||
export const Default = Template.bind({}) | ||
Default.args = {} | ||
export default StorybookEntry |
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,3 +1,2 @@ | ||
export * from './dataism/index.ts' | ||
export * from './xylabs/index.ts' | ||
export * from './xyo-website/index.ts' | ||
export * from './product-theme/index.ts' | ||
export * from './showcase/index.ts' |
File renamed without changes.
File renamed without changes.
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,23 @@ | ||
import type { Meta, StoryFn } from '@storybook/react' | ||
import React from 'react' | ||
|
||
import { DataismTheme } from './dataism/index.ts' | ||
import { ThemeViewer } from './ThemeViewer.tsx' | ||
|
||
const StorybookEntry = { | ||
argTypes: {}, | ||
component: ThemeViewer, | ||
parameters: { docs: { page: null } }, | ||
title: 'theme/ThemeViewer', | ||
} as Meta<typeof ThemeViewer> | ||
|
||
const Template: StoryFn<typeof ThemeViewer> = args => ( | ||
<ThemeViewer {...args} /> | ||
) | ||
|
||
const Default = Template.bind({}) | ||
Default.args = { data: DataismTheme } | ||
|
||
export { Default } | ||
|
||
export default StorybookEntry |
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,71 @@ | ||
import { ExpandMoreRounded } from '@mui/icons-material' | ||
import { | ||
Accordion, | ||
AccordionDetails, | ||
AccordionSummary, | ||
Typography, | ||
} from '@mui/material' | ||
import type { Theme } from '@mui/material/styles' | ||
import { useTheme } from '@mui/material/styles' | ||
import React from 'react' | ||
|
||
interface RecursiveAccordionProps { | ||
data: Record<string, unknown> | ||
path?: string | ||
} | ||
|
||
const RecursiveAccordion: React.FC<RecursiveAccordionProps> = ({ | ||
data, | ||
path = '', | ||
}) => { | ||
return ( | ||
<> | ||
{Object.entries(data).map(([key, value]) => { | ||
const currentPath = path ? `${path}.${key}` : key | ||
const isObject = typeof value === 'object' && value !== null | ||
|
||
return ( | ||
<Accordion disableGutters elevation={0} key={currentPath}> | ||
<AccordionSummary | ||
expandIcon={<ExpandMoreRounded />} | ||
> | ||
<Typography | ||
variant="body2" | ||
style={{ | ||
marginTop: 0.25, marginBottom: 0.25, paddingLeft: 0.25, paddingRight: 0.25, | ||
}} | ||
> | ||
{key} | ||
{isObject && ':'} | ||
</Typography> | ||
</AccordionSummary> | ||
<AccordionDetails style={{ margin: 0.25, padding: 0.5 }}> | ||
{isObject | ||
? ( | ||
<RecursiveAccordion data={value as Record<string, unknown>} path={currentPath} /> | ||
) | ||
: ( | ||
<Typography variant="body2" sx={{ wordBreak: 'break-word' }}> | ||
{JSON.stringify(value, null, 2)} | ||
</Typography> | ||
)} | ||
</AccordionDetails> | ||
</Accordion> | ||
) | ||
})} | ||
</> | ||
) | ||
} | ||
|
||
export const ThemeViewer: React.FC = () => { | ||
const theme: Theme = useTheme() | ||
|
||
return ( | ||
<div style={{ margin: 2 }}> | ||
<Typography variant="h4" gutterBottom> | ||
Material-UI Theme Viewer | ||
</Typography> | ||
<RecursiveAccordion data={theme as unknown as Record<string, unknown>} /> | ||
</div> | ||
) | ||
} |
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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,4 @@ | ||
export * from './dataism/index.ts' | ||
export * from './ThemeExtensions/index.ts' | ||
export * from './xylabs/index.ts' | ||
export * from './xyo-website/index.ts' |
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
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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
50 changes: 50 additions & 0 deletions
50
...theme/src/showcase/dashboard/DataViewers/Charts/LineCharts/DailyVerificationLineChart.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,50 @@ | ||
// DailyVerificationLineChart.tsx | ||
|
||
import { useTheme } from '@mui/material' | ||
import React from 'react' | ||
import { | ||
Area, AreaChart, CartesianGrid, ResponsiveContainer, | ||
Tooltip, XAxis, YAxis, | ||
} from 'recharts' | ||
|
||
import { CustomDataTooltip, type DailyVerificationChartProps } from '../Shared/index.ts' | ||
|
||
export const DailyVerificationLineChart: React.FC<DailyVerificationChartProps> = ({ data }) => { | ||
const theme = useTheme() | ||
|
||
return ( | ||
<ResponsiveContainer width="100%" height={400}> | ||
<AreaChart | ||
data={data} | ||
margin={{ | ||
top: 10, | ||
right: 30, | ||
left: 0, | ||
bottom: 0, | ||
}} | ||
> | ||
<CartesianGrid stroke={theme.palette.background.paper} /> | ||
<XAxis dataKey="day" /> | ||
<YAxis width={20} /> | ||
<Tooltip | ||
content={( | ||
<CustomDataTooltip | ||
tooltipData={[ | ||
{ label: 'Day', dataKey: 'day' }, | ||
{ label: 'Verifications', dataKey: 'verifications' }, | ||
]} | ||
/> | ||
)} | ||
cursor={{ strokeDasharray: '3 3' }} | ||
/> | ||
<Area | ||
type="monotone" | ||
dataKey="verifications" | ||
stackId="1" | ||
stroke={theme.palette.primary.main} | ||
fill={theme.palette.primary.light} | ||
/> | ||
</AreaChart> | ||
</ResponsiveContainer> | ||
) | ||
} |
18 changes: 18 additions & 0 deletions
18
...ase/dashboard/DataViewers/Charts/LineCharts/DailyVerificationStackedAreaChart.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,18 @@ | ||
// DailyVerificationStackedAreaChart.stories.tsx | ||
|
||
import type { Meta, StoryFn } from '@storybook/react' | ||
import React from 'react' | ||
|
||
import { DailyVerificationStackedAreaChart } from './DailyVerificationStackedAreaChart.tsx' | ||
import { stackedVerificationData } from './sampleVerificationData.ts' | ||
|
||
export default { | ||
component: DailyVerificationStackedAreaChart, | ||
title: 'theme/showcase/charts/DailyVerificationStackedAreaChart', | ||
argTypes: {}, | ||
} as Meta<typeof DailyVerificationStackedAreaChart> | ||
|
||
const Template: StoryFn<typeof DailyVerificationStackedAreaChart> = args => <DailyVerificationStackedAreaChart {...args} /> | ||
|
||
export const Default = Template.bind({}) | ||
Default.args = { data: stackedVerificationData } |
63 changes: 63 additions & 0 deletions
63
...rc/showcase/dashboard/DataViewers/Charts/LineCharts/DailyVerificationStackedAreaChart.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,63 @@ | ||
import { useTheme } from '@mui/material' | ||
import React from 'react' | ||
import { | ||
Area, AreaChart, CartesianGrid, ResponsiveContainer, | ||
Tooltip, XAxis, YAxis, | ||
} from 'recharts' | ||
|
||
import type { DailyVerificationStackedChartProps } from '../Shared/index.ts' | ||
import { CustomDataTooltip } from '../Shared/index.ts' | ||
|
||
export const DailyVerificationStackedAreaChart: React.FC<DailyVerificationStackedChartProps> = ({ data }) => { | ||
const theme = useTheme() | ||
|
||
return ( | ||
<ResponsiveContainer width="100%" height={400}> | ||
<AreaChart | ||
data={data} | ||
margin={{ | ||
top: 10, | ||
right: 30, | ||
left: 0, | ||
bottom: 0, | ||
}} | ||
> | ||
<CartesianGrid stroke={theme.palette.background.paper} /> | ||
<XAxis dataKey="day" /> | ||
<YAxis width={20} /> | ||
<Tooltip | ||
content={( | ||
<CustomDataTooltip | ||
tooltipData={[ | ||
{ label: 'Day', dataKey: 'day' }, | ||
{ label: 'Verifications', dataKey: 'verifications' }, | ||
]} | ||
/> | ||
)} | ||
cursor={{ strokeDasharray: '3 3' }} | ||
/> | ||
<Area | ||
type="monotone" | ||
dataKey="mobile" | ||
stackId="1" | ||
stroke={theme.palette.primary.main} | ||
fill={theme.palette.primary.main} | ||
/> | ||
<Area | ||
type="monotone" | ||
dataKey="web" | ||
stackId="1" | ||
stroke={theme.palette.secondary.main} | ||
fill={theme.palette.secondary.light} | ||
/> | ||
<Area | ||
type="monotone" | ||
dataKey="email" | ||
stackId="1" | ||
stroke={theme.palette.success.main} | ||
fill={theme.palette.success.light} | ||
/> | ||
</AreaChart> | ||
</ResponsiveContainer> | ||
) | ||
} |
Oops, something went wrong.