norma-library 0.6.986 → 0.6.987
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/Card.tsx +4 -4
- package/src/components/IconButton.tsx +10 -28
- package/src/components/RangerSlider.tsx +5 -17
- package/src/components/Tabs.tsx +11 -23
- package/src/components/Tag.tsx +1 -1
- package/src/components/TimeLine/TimeLine.tsx +10 -22
- package/src/components/UncontrolledTabs/UncontrolledTabs.style.tsx +8 -24
- package/src/providers/NormaProvider.tsx +10 -5
- package/src/stories/NormaProvider.stories.tsx +0 -331
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "norma-library",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.987",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Olos/Norma-DS. Design System based on Material UI, developed with TypeScript and Styled Components to create reusable and consistent components in web applications.",
|
|
6
6
|
"scripts": {
|
package/src/components/Card.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ColorVariant } from '@/types';
|
|
2
2
|
import { Card as MuiCard } from '@mui/material';
|
|
3
|
-
import
|
|
4
|
-
import { palette } from '../helpers';
|
|
3
|
+
import React from 'react';
|
|
5
4
|
import styled from 'styled-components';
|
|
6
|
-
import {
|
|
5
|
+
import { palette } from '../helpers';
|
|
6
|
+
import { CardBaseProps } from '../interfaces';
|
|
7
7
|
|
|
8
8
|
const colorMap: Record<ColorVariant, string> = {
|
|
9
9
|
inherit: palette.inherit,
|
|
@@ -1,37 +1,19 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { IconButton as MuiIconButton } from '@mui/material';
|
|
2
|
+
import { styled, ThemeOptions, useTheme } from '@mui/material/styles';
|
|
3
|
+
import React from 'react';
|
|
3
4
|
import { IconButtonBaseProps } from '../interfaces';
|
|
4
|
-
import { palette } from '../helpers';
|
|
5
|
-
import { styled } from '@mui/material/styles';
|
|
6
|
-
import { ButtonVariant, ColorVariant } from '@/types';
|
|
7
|
-
|
|
8
|
-
const colorMap: Record<ColorVariant, string> = {
|
|
9
|
-
inherit: palette.inherit,
|
|
10
|
-
primary: palette.primary,
|
|
11
|
-
secondary: palette.secondary,
|
|
12
|
-
error: palette.error,
|
|
13
|
-
warning: palette.warning,
|
|
14
|
-
info: palette.info,
|
|
15
|
-
success: palette.success,
|
|
16
|
-
};
|
|
17
5
|
|
|
18
6
|
const IconButtonStyled = styled(MuiIconButton)<{
|
|
19
|
-
|
|
20
|
-
color: ColorVariant;
|
|
21
|
-
variant: ButtonVariant;
|
|
7
|
+
theme: ThemeOptions;
|
|
22
8
|
cursor: string;
|
|
23
|
-
}>(({
|
|
24
|
-
borderRadius:
|
|
25
|
-
border:
|
|
26
|
-
backgroundColor:
|
|
9
|
+
}>(({ theme, cursor }) => ({
|
|
10
|
+
borderRadius: '50%',
|
|
11
|
+
border: `1px solid ${theme.palette.primary.main}`,
|
|
12
|
+
backgroundColor: theme.palette.primary.main,
|
|
27
13
|
cursor: cursor,
|
|
28
14
|
}));
|
|
29
15
|
|
|
30
|
-
export const IconButton = ({
|
|
31
|
-
|
|
32
|
-
return
|
|
33
|
-
<IconButtonStyled circle={`${circle}`} color="primary" variant="text" cursor="default" {...props}>
|
|
34
|
-
{children}
|
|
35
|
-
</IconButtonStyled>
|
|
36
|
-
);
|
|
16
|
+
export const IconButton = ({ children, cursor = 'pointer', ...props }: IconButtonBaseProps) => {
|
|
17
|
+
const muiTheme = useTheme();
|
|
18
|
+
return <IconButtonStyled theme={muiTheme} cursor={cursor} {...props}>{children}</IconButtonStyled>;
|
|
37
19
|
};
|
|
@@ -1,23 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Box, Slider as MuiSlider, Typography } from '@mui/material';
|
|
3
|
-
import { palette } from '../helpers';
|
|
4
3
|
import { styled } from '@mui/material/styles';
|
|
5
|
-
import { ColorVariant } from '@/types';
|
|
6
4
|
import { RangerSliderBaseProps } from '@/interfaces/RangerSlider';
|
|
7
5
|
|
|
8
|
-
const
|
|
9
|
-
inherit: palette.inherit,
|
|
10
|
-
primary: palette.primary,
|
|
11
|
-
secondary: palette.secondary,
|
|
12
|
-
error: palette.error,
|
|
13
|
-
warning: palette.warning,
|
|
14
|
-
info: palette.info,
|
|
15
|
-
success: palette.success,
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const RangerSliderStyled = styled(MuiSlider)(() => ({
|
|
6
|
+
const RangerSliderStyled = styled(MuiSlider)(({ theme }) => ({
|
|
19
7
|
height: 8,
|
|
20
|
-
|
|
8
|
+
color: theme.palette.primary.main,
|
|
21
9
|
'& .MuiSlider-track': {
|
|
22
10
|
border: 'none',
|
|
23
11
|
},
|
|
@@ -25,7 +13,7 @@ const RangerSliderStyled = styled(MuiSlider)(() => ({
|
|
|
25
13
|
height: 18,
|
|
26
14
|
width: 18,
|
|
27
15
|
backgroundColor: '#FFF',
|
|
28
|
-
border: `2px solid ${
|
|
16
|
+
border: `2px solid ${theme.palette.primary.main}`,
|
|
29
17
|
'&:focus, &:hover, &.Mui-active, &.Mui-focusVisible': {
|
|
30
18
|
boxShadow: 'inherit',
|
|
31
19
|
},
|
|
@@ -34,7 +22,7 @@ const RangerSliderStyled = styled(MuiSlider)(() => ({
|
|
|
34
22
|
height: '8px',
|
|
35
23
|
position: 'absolute',
|
|
36
24
|
display: 'block',
|
|
37
|
-
background:
|
|
25
|
+
background: theme.palette.primary.main,
|
|
38
26
|
},
|
|
39
27
|
},
|
|
40
28
|
'& .MuiSlider-valueLabel': {
|
|
@@ -43,7 +31,7 @@ const RangerSliderStyled = styled(MuiSlider)(() => ({
|
|
|
43
31
|
top: 48,
|
|
44
32
|
position: 'absolute',
|
|
45
33
|
transition: 'none',
|
|
46
|
-
color:
|
|
34
|
+
color: theme.palette.primary.main,
|
|
47
35
|
'&:before': {
|
|
48
36
|
bottom: 'inherit',
|
|
49
37
|
top: '-8px',
|
package/src/components/Tabs.tsx
CHANGED
|
@@ -1,29 +1,17 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { Box, Tabs as MuiTabs, Tab } from '@mui/material';
|
|
2
|
+
import { styled, ThemeOptions, useTheme } from '@mui/material/styles';
|
|
3
|
+
import React from 'react';
|
|
3
4
|
import { TabPanelProps, TabsBaseProps } from '../interfaces';
|
|
4
|
-
import { palette } from '../helpers';
|
|
5
|
-
import { styled } from '@mui/material/styles';
|
|
6
|
-
import { ColorVariant } from '@/types';
|
|
7
|
-
|
|
8
|
-
const colorMap: Record<ColorVariant, string> = {
|
|
9
|
-
inherit: palette.inherit,
|
|
10
|
-
primary: palette.primary,
|
|
11
|
-
secondary: palette.secondary,
|
|
12
|
-
error: palette.error,
|
|
13
|
-
warning: palette.warning,
|
|
14
|
-
info: palette.info,
|
|
15
|
-
success: palette.success,
|
|
16
|
-
};
|
|
17
5
|
|
|
18
6
|
const TabsStyled = styled(MuiTabs)<{
|
|
19
|
-
|
|
20
|
-
}>(({
|
|
7
|
+
theme: ThemeOptions;
|
|
8
|
+
}>(({ theme }) => ({
|
|
21
9
|
borderBottom: '1px solid #e8e8e8',
|
|
22
10
|
'& .Mui-selected': {
|
|
23
|
-
color:
|
|
11
|
+
color: theme.palette.primary.main,
|
|
24
12
|
},
|
|
25
13
|
'& .MuiTabs-indicator': {
|
|
26
|
-
backgroundColor:
|
|
14
|
+
backgroundColor: theme.palette.primary.main,
|
|
27
15
|
},
|
|
28
16
|
'& .MuiButtonBase-root': {
|
|
29
17
|
textTransform: 'none',
|
|
@@ -32,10 +20,9 @@ const TabsStyled = styled(MuiTabs)<{
|
|
|
32
20
|
|
|
33
21
|
interface StyledTabProps {
|
|
34
22
|
label: string;
|
|
35
|
-
color: ColorVariant;
|
|
36
23
|
}
|
|
37
24
|
|
|
38
|
-
const TabStyled = styled((props: StyledTabProps) => <Tab disableRipple {...props} />)(({ theme
|
|
25
|
+
const TabStyled = styled((props: StyledTabProps) => <Tab disableRipple {...props} />)(({ theme }) => ({
|
|
39
26
|
textTransform: 'none',
|
|
40
27
|
fontWeight: theme.typography.fontWeightRegular,
|
|
41
28
|
fontSize: theme.typography.pxToRem(15),
|
|
@@ -45,7 +32,7 @@ const TabStyled = styled((props: StyledTabProps) => <Tab disableRipple {...props
|
|
|
45
32
|
top: '5px',
|
|
46
33
|
minWidth: '60px',
|
|
47
34
|
'&.Mui-selected': {
|
|
48
|
-
color:
|
|
35
|
+
color: theme.palette.primary.main,
|
|
49
36
|
},
|
|
50
37
|
'&.Mui-focusVisible': {
|
|
51
38
|
backgroundColor: 'rgba(100, 95, 228, 0.32)',
|
|
@@ -80,6 +67,7 @@ function a11yProps(index: number) {
|
|
|
80
67
|
}
|
|
81
68
|
|
|
82
69
|
export const Tabs = ({ data = [], color = 'primary', onChange, ...props }: TabsBaseProps) => {
|
|
70
|
+
const muiTheme = useTheme()
|
|
83
71
|
const [value, setValue] = React.useState(0);
|
|
84
72
|
|
|
85
73
|
const handleChange = (event: React.SyntheticEvent, newValue: number) => {
|
|
@@ -90,8 +78,8 @@ export const Tabs = ({ data = [], color = 'primary', onChange, ...props }: TabsB
|
|
|
90
78
|
return (
|
|
91
79
|
<Box sx={{ width: '100%' }}>
|
|
92
80
|
<Box>
|
|
93
|
-
<TabsStyled value={value}
|
|
94
|
-
{data && data.map((item, key) => <TabStyled label={item.label}
|
|
81
|
+
<TabsStyled value={value} onChange={handleChange} aria-label="basic tabs example" {...props} theme={muiTheme}>
|
|
82
|
+
{data && data.map((item, key) => <TabStyled label={item.label} {...a11yProps(key)} />)}
|
|
95
83
|
</TabsStyled>
|
|
96
84
|
</Box>
|
|
97
85
|
{data &&
|
package/src/components/Tag.tsx
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { Typography } from '@mui/material';
|
|
4
3
|
import {
|
|
5
4
|
Timeline,
|
|
6
|
-
TimelineItem,
|
|
7
|
-
TimelineSeparator,
|
|
8
5
|
TimelineConnector,
|
|
9
6
|
TimelineContent,
|
|
10
7
|
TimelineDot,
|
|
8
|
+
TimelineItem,
|
|
11
9
|
timelineItemClasses,
|
|
10
|
+
TimelineSeparator,
|
|
12
11
|
} from '@mui/lab';
|
|
12
|
+
import { Typography } from '@mui/material';
|
|
13
13
|
|
|
14
|
-
import {
|
|
15
|
-
import { ColorVariant } from '@/types';
|
|
14
|
+
import { ThemeOptions, useTheme } from '@mui/material/styles';
|
|
16
15
|
import styled from 'styled-components';
|
|
17
16
|
|
|
18
17
|
export interface TimeLineData {
|
|
@@ -23,23 +22,12 @@ export interface TimeLineData {
|
|
|
23
22
|
|
|
24
23
|
interface TimeLineProps {
|
|
25
24
|
data: TimeLineData[];
|
|
26
|
-
theme?:
|
|
27
|
-
color?: string;
|
|
25
|
+
theme?: ThemeOptions;
|
|
28
26
|
}
|
|
29
27
|
|
|
30
|
-
const
|
|
31
|
-
inherit: palette.inherit,
|
|
32
|
-
// primary: '#DB6619',
|
|
33
|
-
primary: palette.primary,
|
|
34
|
-
secondary: palette.secondary,
|
|
35
|
-
error: palette.error,
|
|
36
|
-
warning: palette.warning,
|
|
37
|
-
info: palette.info,
|
|
38
|
-
success: palette.success,
|
|
39
|
-
};
|
|
28
|
+
export const TimeLine: React.FC<TimeLineProps> = ({ data }) => {
|
|
40
29
|
|
|
41
|
-
|
|
42
|
-
const _mainColor = color || colorMap[theme];
|
|
30
|
+
const muiTheme = useTheme();
|
|
43
31
|
|
|
44
32
|
const NormaTimeLine = styled(Timeline)`
|
|
45
33
|
.${timelineItemClasses.root} {
|
|
@@ -56,7 +44,7 @@ export const TimeLine: React.FC<TimeLineProps> = ({ data, theme = 'primary', col
|
|
|
56
44
|
content: '';
|
|
57
45
|
width: 70%;
|
|
58
46
|
height: 70%;
|
|
59
|
-
background: ${
|
|
47
|
+
background: ${muiTheme.palette.primary.main};
|
|
60
48
|
position: absolute;
|
|
61
49
|
border-radius: 50%;
|
|
62
50
|
top: 50%;
|
|
@@ -73,7 +61,7 @@ export const TimeLine: React.FC<TimeLineProps> = ({ data, theme = 'primary', col
|
|
|
73
61
|
boxShadow: 'none',
|
|
74
62
|
padding: '6px',
|
|
75
63
|
margin: '0',
|
|
76
|
-
border: `3px solid ${
|
|
64
|
+
border: `3px solid ${muiTheme.palette.primary.main}`,
|
|
77
65
|
};
|
|
78
66
|
|
|
79
67
|
const lastStyle = {
|
|
@@ -93,7 +81,7 @@ export const TimeLine: React.FC<TimeLineProps> = ({ data, theme = 'primary', col
|
|
|
93
81
|
<TimelineItem key={key} sx={{ minHeight: 'auto' }}>
|
|
94
82
|
<TimelineSeparator>
|
|
95
83
|
<TimelineDot sx={_getDotStyle(!last)} />
|
|
96
|
-
{last && <TimelineConnector sx={{ bgcolor:
|
|
84
|
+
{last && <TimelineConnector sx={{ bgcolor: muiTheme.palette.primary.main, width: '5px' }} />}
|
|
97
85
|
</TimelineSeparator>
|
|
98
86
|
<TimelineContent sx={{ py: 0, pl: 2, pb: '35px' }}>
|
|
99
87
|
<Typography sx={{ m: 'auto 0' }} className="TimelineContent__Date" variant="body1">
|
|
@@ -1,35 +1,19 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { styled } from '@mui/material/styles';
|
|
3
|
-
import
|
|
2
|
+
import React from 'react';
|
|
4
3
|
|
|
5
4
|
import { Tab, Tabs } from '@mui/material';
|
|
6
|
-
import { ColorVariant } from '@/types';
|
|
7
|
-
import { palette } from '../../helpers';
|
|
8
|
-
|
|
9
|
-
const colorMap: Record<ColorVariant, string> = {
|
|
10
|
-
inherit: palette.inherit,
|
|
11
|
-
primary: palette.primary,
|
|
12
|
-
secondary: palette.secondary,
|
|
13
|
-
error: palette.error,
|
|
14
|
-
warning: palette.warning,
|
|
15
|
-
info: palette.info,
|
|
16
|
-
success: palette.success,
|
|
17
|
-
};
|
|
18
5
|
|
|
19
6
|
interface StyledTabProps {
|
|
20
7
|
label: string;
|
|
21
|
-
color: ColorVariant;
|
|
22
8
|
}
|
|
23
9
|
|
|
24
|
-
export const NormaTabs
|
|
25
|
-
|
|
26
|
-
}>(({ color }) => ({
|
|
27
|
-
borderBottom: '1px solid #e8e8e8',
|
|
10
|
+
export const NormaTabs = styled(Tabs)(({ theme }) => ({
|
|
11
|
+
borderBottom: `1px solid ${theme.palette.background.paper}`,
|
|
28
12
|
'& .Mui-selected': {
|
|
29
|
-
color:
|
|
13
|
+
color: theme.palette.primary.main,
|
|
30
14
|
},
|
|
31
15
|
'& .MuiTabs-indicator': {
|
|
32
|
-
backgroundColor:
|
|
16
|
+
backgroundColor: theme.palette.primary.main,
|
|
33
17
|
},
|
|
34
18
|
'& .MuiButtonBase-root': {
|
|
35
19
|
textTransform: 'none',
|
|
@@ -38,7 +22,7 @@ export const NormaTabs: React.ComponentType<TabsProps & { color: ColorVariant }>
|
|
|
38
22
|
|
|
39
23
|
export const NormaTab: React.ComponentType<StyledTabProps> = styled((props: StyledTabProps) => (
|
|
40
24
|
<Tab disableRipple {...props} />
|
|
41
|
-
))(({ theme
|
|
25
|
+
))(({ theme }) => ({
|
|
42
26
|
textTransform: 'none',
|
|
43
27
|
fontWeight: theme.typography.fontWeightRegular,
|
|
44
28
|
fontSize: theme.typography.pxToRem(15),
|
|
@@ -48,10 +32,10 @@ export const NormaTab: React.ComponentType<StyledTabProps> = styled((props: Styl
|
|
|
48
32
|
top: '5px',
|
|
49
33
|
minWidth: '60px',
|
|
50
34
|
'&.Mui-selected': {
|
|
51
|
-
color:
|
|
35
|
+
color: theme.palette.primary.main,
|
|
52
36
|
},
|
|
53
37
|
'&.Mui-focusVisible': {
|
|
54
|
-
backgroundColor:
|
|
38
|
+
backgroundColor: theme.palette.background.default,
|
|
55
39
|
},
|
|
56
40
|
}));
|
|
57
41
|
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ThemeProvider } from '@mui/material';
|
|
1
|
+
import { createTheme, ThemeProvider } from '@mui/material';
|
|
3
2
|
import { ThemeProviderProps } from "@mui/material/styles/ThemeProvider";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { newOlosPalette } from '../helpers';
|
|
4
5
|
|
|
5
|
-
export const NormaProvider = (props:ThemeProviderProps) => {
|
|
6
|
+
export const NormaProvider = (props: ThemeProviderProps) => {
|
|
6
7
|
const { theme, children } = props;
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
const newOlosTheme = createTheme({
|
|
10
|
+
palette: newOlosPalette,
|
|
11
|
+
})
|
|
12
|
+
|
|
8
13
|
return (
|
|
9
|
-
<ThemeProvider theme={theme}>
|
|
14
|
+
<ThemeProvider theme={theme ? theme : newOlosTheme}>
|
|
10
15
|
{children}
|
|
11
16
|
</ThemeProvider>
|
|
12
17
|
);
|
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
import { Box, Grid, Stack, Typography } from '@mui/material'
|
|
2
|
-
import { createTheme } from '@mui/material/styles'
|
|
3
|
-
import type { Meta } from '@storybook/react'
|
|
4
|
-
import { Accordion, Button, Card, Paper, ProgressBar, Tag } from '../components'
|
|
5
|
-
import { themes } from '../helpers'
|
|
6
|
-
import { NormaProvider } from '../providers/NormaProvider'
|
|
7
|
-
|
|
8
|
-
const meta = {
|
|
9
|
-
title: 'Providers/NormaProvider',
|
|
10
|
-
component: NormaProvider,
|
|
11
|
-
parameters: {
|
|
12
|
-
layout: 'centered',
|
|
13
|
-
},
|
|
14
|
-
tags: ['autodocs'],
|
|
15
|
-
argTypes: {
|
|
16
|
-
theme: {
|
|
17
|
-
control: 'select',
|
|
18
|
-
options: ['light', 'dark', 'newLight'],
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
} satisfies Meta<typeof NormaProvider>
|
|
22
|
-
|
|
23
|
-
export default meta
|
|
24
|
-
|
|
25
|
-
const ComponentShowcase = () => (
|
|
26
|
-
<Stack spacing={3} sx={{ width: '100%', maxWidth: 800, padding: 3 }}>
|
|
27
|
-
<Typography variant="h4" gutterBottom>
|
|
28
|
-
Norma Design System Components
|
|
29
|
-
</Typography>
|
|
30
|
-
|
|
31
|
-
<Paper elevation={2} sx={{ p: 3 }}>
|
|
32
|
-
<Typography variant="h6" gutterBottom>
|
|
33
|
-
Buttons
|
|
34
|
-
</Typography>
|
|
35
|
-
<Stack direction="row" spacing={2} flexWrap="wrap">
|
|
36
|
-
<Button variant="contained" color="primary">
|
|
37
|
-
Primary
|
|
38
|
-
</Button>
|
|
39
|
-
<Button variant="contained" color="secondary">
|
|
40
|
-
Secondary
|
|
41
|
-
</Button>
|
|
42
|
-
<Button variant="contained" color="error">
|
|
43
|
-
Error
|
|
44
|
-
</Button>
|
|
45
|
-
<Button variant="contained" color="success">
|
|
46
|
-
Success
|
|
47
|
-
</Button>
|
|
48
|
-
<Button variant="outlined" color="warning">
|
|
49
|
-
Warning
|
|
50
|
-
</Button>
|
|
51
|
-
</Stack>
|
|
52
|
-
</Paper>
|
|
53
|
-
|
|
54
|
-
<Paper elevation={2} sx={{ p: 3 }}>
|
|
55
|
-
<Typography variant="h6" gutterBottom>
|
|
56
|
-
Progress Bars
|
|
57
|
-
</Typography>
|
|
58
|
-
<Stack spacing={2}>
|
|
59
|
-
<ProgressBar value={25} />
|
|
60
|
-
<ProgressBar value={50} color="secondary" />
|
|
61
|
-
<ProgressBar value={75} color="success" />
|
|
62
|
-
<ProgressBar value={90} color="warning" />
|
|
63
|
-
</Stack>
|
|
64
|
-
</Paper>
|
|
65
|
-
|
|
66
|
-
<Paper elevation={2} sx={{ p: 3 }}>
|
|
67
|
-
<Typography variant="h6" gutterBottom>
|
|
68
|
-
Cards & Tags
|
|
69
|
-
</Typography>
|
|
70
|
-
<Grid container spacing={2}>
|
|
71
|
-
<Grid item xs={12} sm={6}>
|
|
72
|
-
<Card sx={{ p: 2 }}>
|
|
73
|
-
<Typography variant="h6" gutterBottom>
|
|
74
|
-
Sample Card
|
|
75
|
-
</Typography>
|
|
76
|
-
<Typography variant="body2">
|
|
77
|
-
Card content goes here with the current theme colors.
|
|
78
|
-
</Typography>
|
|
79
|
-
</Card>
|
|
80
|
-
</Grid>
|
|
81
|
-
<Grid item xs={12} sm={6}>
|
|
82
|
-
<Stack spacing={2}>
|
|
83
|
-
<Tag label="Primary Tag" color="primary" />
|
|
84
|
-
<Tag label="Secondary Tag" color="secondary" />
|
|
85
|
-
<Tag label="Success Tag" color="success" />
|
|
86
|
-
<Tag label="Error Tag" color="error" />
|
|
87
|
-
</Stack>
|
|
88
|
-
</Grid>
|
|
89
|
-
</Grid>
|
|
90
|
-
</Paper>
|
|
91
|
-
|
|
92
|
-
<Paper elevation={2} sx={{ p: 3 }}>
|
|
93
|
-
<Typography variant="h6" gutterBottom>
|
|
94
|
-
Accordion
|
|
95
|
-
</Typography>
|
|
96
|
-
<Accordion
|
|
97
|
-
label="Theme Configuration"
|
|
98
|
-
data={[
|
|
99
|
-
{
|
|
100
|
-
label: 'Theme Colors',
|
|
101
|
-
id: 'theme-colors',
|
|
102
|
-
children: <Typography>These components adapt to the current theme configuration.</Typography>,
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
label: 'Customization',
|
|
106
|
-
id: 'customization',
|
|
107
|
-
children: <Typography>You can customize colors by passing custom theme options to NormaProvider.</Typography>,
|
|
108
|
-
},
|
|
109
|
-
]}
|
|
110
|
-
/>
|
|
111
|
-
</Paper>
|
|
112
|
-
</Stack>
|
|
113
|
-
)
|
|
114
|
-
|
|
115
|
-
export const DefaultTheme = () => (
|
|
116
|
-
<NormaProvider theme={themes.light}>
|
|
117
|
-
<ComponentShowcase />
|
|
118
|
-
</NormaProvider>
|
|
119
|
-
)
|
|
120
|
-
|
|
121
|
-
DefaultTheme.storyName = 'Default Theme'
|
|
122
|
-
|
|
123
|
-
export const DarkTheme = () => (
|
|
124
|
-
<NormaProvider theme={themes.dark}>
|
|
125
|
-
<Box sx={{ backgroundColor: 'background.default', minHeight: '100vh', p: 2 }}>
|
|
126
|
-
<ComponentShowcase />
|
|
127
|
-
</Box>
|
|
128
|
-
</NormaProvider>
|
|
129
|
-
)
|
|
130
|
-
|
|
131
|
-
DarkTheme.storyName = 'Dark Theme'
|
|
132
|
-
|
|
133
|
-
export const CustomBlueTheme = () => {
|
|
134
|
-
const customTheme = createTheme({
|
|
135
|
-
palette: {
|
|
136
|
-
mode: 'light',
|
|
137
|
-
primary: {
|
|
138
|
-
main: '#1976d2',
|
|
139
|
-
light: '#42a5f5',
|
|
140
|
-
dark: '#1565c0',
|
|
141
|
-
},
|
|
142
|
-
secondary: {
|
|
143
|
-
main: '#dc004e',
|
|
144
|
-
light: '#ff5983',
|
|
145
|
-
dark: '#9a0036',
|
|
146
|
-
},
|
|
147
|
-
success: {
|
|
148
|
-
main: '#2e7d32',
|
|
149
|
-
},
|
|
150
|
-
warning: {
|
|
151
|
-
main: '#ed6c02',
|
|
152
|
-
},
|
|
153
|
-
error: {
|
|
154
|
-
main: '#d32f2f',
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
})
|
|
158
|
-
|
|
159
|
-
return (
|
|
160
|
-
<NormaProvider theme={customTheme}>
|
|
161
|
-
<ComponentShowcase />
|
|
162
|
-
</NormaProvider>
|
|
163
|
-
)
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
CustomBlueTheme.storyName = 'Custom Blue Theme'
|
|
167
|
-
|
|
168
|
-
export const CustomGreenTheme = () => {
|
|
169
|
-
const customTheme = createTheme({
|
|
170
|
-
palette: {
|
|
171
|
-
mode: 'light',
|
|
172
|
-
primary: {
|
|
173
|
-
main: '#388e3c',
|
|
174
|
-
light: '#6abf69',
|
|
175
|
-
dark: '#00600f',
|
|
176
|
-
},
|
|
177
|
-
secondary: {
|
|
178
|
-
main: '#7b1fa2',
|
|
179
|
-
light: '#ae52d4',
|
|
180
|
-
dark: '#4a0072',
|
|
181
|
-
},
|
|
182
|
-
success: {
|
|
183
|
-
main: '#4caf50',
|
|
184
|
-
},
|
|
185
|
-
warning: {
|
|
186
|
-
main: '#ff9800',
|
|
187
|
-
},
|
|
188
|
-
error: {
|
|
189
|
-
main: '#f44336',
|
|
190
|
-
},
|
|
191
|
-
},
|
|
192
|
-
})
|
|
193
|
-
|
|
194
|
-
return (
|
|
195
|
-
<NormaProvider theme={customTheme}>
|
|
196
|
-
<ComponentShowcase />
|
|
197
|
-
</NormaProvider>
|
|
198
|
-
)
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
CustomGreenTheme.storyName = 'Custom Green Theme'
|
|
202
|
-
|
|
203
|
-
export const CustomPurpleDarkTheme = () => {
|
|
204
|
-
const customTheme = createTheme({
|
|
205
|
-
palette: {
|
|
206
|
-
mode: 'dark',
|
|
207
|
-
primary: {
|
|
208
|
-
main: '#9c27b0',
|
|
209
|
-
light: '#d05ce3',
|
|
210
|
-
dark: '#6a0080',
|
|
211
|
-
},
|
|
212
|
-
secondary: {
|
|
213
|
-
main: '#ff6f00',
|
|
214
|
-
light: '#ffa040',
|
|
215
|
-
dark: '#c43e00',
|
|
216
|
-
},
|
|
217
|
-
background: {
|
|
218
|
-
default: '#121212',
|
|
219
|
-
paper: '#1e1e1e',
|
|
220
|
-
},
|
|
221
|
-
success: {
|
|
222
|
-
main: '#66bb6a',
|
|
223
|
-
},
|
|
224
|
-
warning: {
|
|
225
|
-
main: '#ffa726',
|
|
226
|
-
},
|
|
227
|
-
error: {
|
|
228
|
-
main: '#ef5350',
|
|
229
|
-
},
|
|
230
|
-
},
|
|
231
|
-
})
|
|
232
|
-
|
|
233
|
-
return (
|
|
234
|
-
<NormaProvider theme={customTheme}>
|
|
235
|
-
<Box sx={{ backgroundColor: 'background.default', minHeight: '100vh', p: 2 }}>
|
|
236
|
-
<ComponentShowcase />
|
|
237
|
-
</Box>
|
|
238
|
-
</NormaProvider>
|
|
239
|
-
)
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
CustomPurpleDarkTheme.storyName = 'Custom Purple Dark Theme'
|
|
243
|
-
|
|
244
|
-
export const MinimalExample = () => (
|
|
245
|
-
<NormaProvider theme={themes.light}>
|
|
246
|
-
<Stack spacing={2} alignItems="center" sx={{ p: 4 }}>
|
|
247
|
-
<Typography variant="h5" color="primary">
|
|
248
|
-
Welcome to Norma Design System
|
|
249
|
-
</Typography>
|
|
250
|
-
<Button variant="contained" color="primary">
|
|
251
|
-
Get Started
|
|
252
|
-
</Button>
|
|
253
|
-
<Tag label="v1.0.0" color="secondary" />
|
|
254
|
-
</Stack>
|
|
255
|
-
</NormaProvider>
|
|
256
|
-
)
|
|
257
|
-
|
|
258
|
-
MinimalExample.storyName = 'Minimal Example'
|
|
259
|
-
|
|
260
|
-
export const ThemeComparison = () => (
|
|
261
|
-
<Grid container spacing={4} sx={{ p: 2 }}>
|
|
262
|
-
<Grid item xs={12} md={4}>
|
|
263
|
-
<Typography variant="h6" gutterBottom align="center">
|
|
264
|
-
Default Light Theme
|
|
265
|
-
</Typography>
|
|
266
|
-
<NormaProvider theme={themes.light}>
|
|
267
|
-
<Paper sx={{ p: 2 }}>
|
|
268
|
-
<Stack spacing={2}>
|
|
269
|
-
<Button variant="contained" color="primary" fullWidth>
|
|
270
|
-
Primary Button
|
|
271
|
-
</Button>
|
|
272
|
-
<Button variant="contained" color="secondary" fullWidth>
|
|
273
|
-
Secondary Button
|
|
274
|
-
</Button>
|
|
275
|
-
<ProgressBar value={60} />
|
|
276
|
-
<Tag label="Sample Tag" color="primary" />
|
|
277
|
-
</Stack>
|
|
278
|
-
</Paper>
|
|
279
|
-
</NormaProvider>
|
|
280
|
-
</Grid>
|
|
281
|
-
|
|
282
|
-
<Grid item xs={12} md={4}>
|
|
283
|
-
<Typography variant="h6" gutterBottom align="center">
|
|
284
|
-
Dark Theme
|
|
285
|
-
</Typography>
|
|
286
|
-
<NormaProvider theme={themes.dark}>
|
|
287
|
-
<Paper sx={{ p: 2, backgroundColor: 'background.paper' }}>
|
|
288
|
-
<Stack spacing={2}>
|
|
289
|
-
<Button variant="contained" color="primary" fullWidth>
|
|
290
|
-
Primary Button
|
|
291
|
-
</Button>
|
|
292
|
-
<Button variant="contained" color="secondary" fullWidth>
|
|
293
|
-
Secondary Button
|
|
294
|
-
</Button>
|
|
295
|
-
<ProgressBar value={60} />
|
|
296
|
-
<Tag label="Sample Tag" color="primary" />
|
|
297
|
-
</Stack>
|
|
298
|
-
</Paper>
|
|
299
|
-
</NormaProvider>
|
|
300
|
-
</Grid>
|
|
301
|
-
|
|
302
|
-
<Grid item xs={12} md={4}>
|
|
303
|
-
<Typography variant="h6" gutterBottom align="center">
|
|
304
|
-
Custom Theme
|
|
305
|
-
</Typography>
|
|
306
|
-
<NormaProvider
|
|
307
|
-
theme={createTheme({
|
|
308
|
-
palette: {
|
|
309
|
-
primary: { main: '#e91e63' },
|
|
310
|
-
secondary: { main: '#00bcd4' },
|
|
311
|
-
}
|
|
312
|
-
})}
|
|
313
|
-
>
|
|
314
|
-
<Paper sx={{ p: 2 }}>
|
|
315
|
-
<Stack spacing={2}>
|
|
316
|
-
<Button variant="contained" color="primary" fullWidth>
|
|
317
|
-
Primary Button
|
|
318
|
-
</Button>
|
|
319
|
-
<Button variant="contained" color="secondary" fullWidth>
|
|
320
|
-
Secondary Button
|
|
321
|
-
</Button>
|
|
322
|
-
<ProgressBar value={60} />
|
|
323
|
-
<Tag label="Sample Tag" color="primary" />
|
|
324
|
-
</Stack>
|
|
325
|
-
</Paper>
|
|
326
|
-
</NormaProvider>
|
|
327
|
-
</Grid>
|
|
328
|
-
</Grid>
|
|
329
|
-
)
|
|
330
|
-
|
|
331
|
-
ThemeComparison.storyName = 'Theme Comparison'
|