mirror of
https://github.com/hazemKrimi/crimson-quirks-ui.git
synced 2026-05-01 18:20:28 +00:00
Update default theme
This commit is contained in:
@@ -11,7 +11,7 @@ const meta = {
|
|||||||
tags: ['!autodocs'],
|
tags: ['!autodocs'],
|
||||||
argTypes: {
|
argTypes: {
|
||||||
text: { control: 'text' },
|
text: { control: 'text' },
|
||||||
color: { options: ['client', 'productOwner', 'developer', 'admin'] },
|
color: { options: ['primary', 'secondary', 'tertiary'] },
|
||||||
},
|
},
|
||||||
} satisfies Meta<typeof Alert>;
|
} satisfies Meta<typeof Alert>;
|
||||||
|
|
||||||
@@ -22,6 +22,6 @@ type Story = StoryObj<typeof meta>;
|
|||||||
export const Example: Story = {
|
export const Example: Story = {
|
||||||
args: {
|
args: {
|
||||||
text: 'Alert',
|
text: 'Alert',
|
||||||
color: 'client'
|
color: 'primary'
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,10 +3,9 @@ import { Wrapper } from './styles';
|
|||||||
export type AlertProps = {
|
export type AlertProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
color:
|
color:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'success'
|
| 'success'
|
||||||
| 'warning'
|
| 'warning'
|
||||||
| 'error';
|
| 'error';
|
||||||
|
|||||||
@@ -2,10 +2,9 @@ import styled, { css } from 'styled-components';
|
|||||||
|
|
||||||
type WrapperProps = {
|
type WrapperProps = {
|
||||||
color:
|
color:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'success'
|
| 'success'
|
||||||
| 'warning'
|
| 'warning'
|
||||||
| 'error';
|
| 'error';
|
||||||
@@ -18,55 +17,10 @@ export const Wrapper = styled.div<WrapperProps>`
|
|||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
|
||||||
${({ color, theme }) => {
|
${({ color, theme }) => {
|
||||||
switch (color) {
|
|
||||||
case 'client':
|
|
||||||
return css`
|
return css`
|
||||||
border: 1px solid ${theme.colors.client.main};
|
border: 1px solid ${theme.colors[color].main};
|
||||||
color: ${theme.colors.client.main};
|
color: ${theme.colors[color].main};
|
||||||
background: ${theme.colors.client.light};
|
background: ${theme.colors[color].light};
|
||||||
`;
|
`;
|
||||||
case 'productOwner':
|
|
||||||
return css`
|
|
||||||
border: 1px solid ${theme.colors.productOwner.main};
|
|
||||||
color: ${theme.colors.productOwner.main};
|
|
||||||
background: ${theme.colors.productOwner.light};
|
|
||||||
`;
|
|
||||||
case 'developer':
|
|
||||||
return css`
|
|
||||||
border: 1px solid ${theme.colors.developer.main};
|
|
||||||
color: ${theme.colors.developer.main};
|
|
||||||
background: ${theme.colors.developer.light};
|
|
||||||
`;
|
|
||||||
case 'admin':
|
|
||||||
return css`
|
|
||||||
border: 1px solid ${theme.colors.admin.main};
|
|
||||||
color: ${theme.colors.admin.main};
|
|
||||||
background: ${theme.colors.admin.light};
|
|
||||||
`;
|
|
||||||
case 'success':
|
|
||||||
return css`
|
|
||||||
border: 1px solid ${theme.colors.success.main};
|
|
||||||
color: ${theme.colors.success.main};
|
|
||||||
background: ${theme.colors.success.light};
|
|
||||||
`;
|
|
||||||
case 'warning':
|
|
||||||
return css`
|
|
||||||
border: 1px solid ${theme.colors.warning.main};
|
|
||||||
color: ${theme.colors.warning.main};
|
|
||||||
background: ${theme.colors.warning.light};
|
|
||||||
`;
|
|
||||||
case 'error':
|
|
||||||
return css`
|
|
||||||
border: 1px solid ${theme.colors.error.main};
|
|
||||||
color: ${theme.colors.error.main};
|
|
||||||
background: ${theme.colors.error.light};
|
|
||||||
`;
|
|
||||||
default:
|
|
||||||
return css`
|
|
||||||
border: 1px solid ${theme.colors.client.main};
|
|
||||||
color: ${theme.colors.client.main};
|
|
||||||
background: ${theme.colors.client.light};
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const meta = {
|
|||||||
},
|
},
|
||||||
argTypes: {
|
argTypes: {
|
||||||
text: { control: 'text' },
|
text: { control: 'text' },
|
||||||
color: { options: ['client', 'productOwner', 'developer', 'admin'] },
|
color: { options: ['primary', 'secondary', 'tertiary'] },
|
||||||
size: { options: ['big', 'small'] },
|
size: { options: ['big', 'small'] },
|
||||||
},
|
},
|
||||||
} satisfies Meta<typeof Avatar>;
|
} satisfies Meta<typeof Avatar>;
|
||||||
@@ -22,6 +22,6 @@ type Story = StoryObj<typeof meta>;
|
|||||||
export const Example: Story = {
|
export const Example: Story = {
|
||||||
args: {
|
args: {
|
||||||
text: 'A',
|
text: 'A',
|
||||||
color: 'admin'
|
color: 'tertiary'
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Wrapper } from './styles';
|
|||||||
|
|
||||||
export type AvatarProps = {
|
export type AvatarProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
color?: 'client' | 'productOwner' | 'developer' | 'admin' | string;
|
color?: 'primary' | 'secondary' | 'tertiary' | string;
|
||||||
size?: 'small' | 'big';
|
size?: 'small' | 'big';
|
||||||
text: string;
|
text: string;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import styled, { css } from 'styled-components';
|
import styled, { css } from 'styled-components';
|
||||||
|
|
||||||
type WrapperProps = {
|
type WrapperProps = {
|
||||||
color?: 'client' | 'productOwner' | 'developer' | 'admin' | string;
|
color?: 'primary' | 'secondary' | 'tertiary' | string;
|
||||||
size?: 'small' | 'big';
|
size?: 'small' | 'big';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const meta = {
|
|||||||
layout: 'centered',
|
layout: 'centered',
|
||||||
},
|
},
|
||||||
argTypes: {
|
argTypes: {
|
||||||
color: { options: ['client', 'productOwner', 'developer', 'admin', 'error'] },
|
color: { options: ['primary', 'secondary', 'tertiary', 'error'] },
|
||||||
text: { control: 'text' },
|
text: { control: 'text' },
|
||||||
},
|
},
|
||||||
} satisfies Meta<typeof Button>;
|
} satisfies Meta<typeof Button>;
|
||||||
@@ -20,7 +20,7 @@ type Story = StoryObj<typeof meta>;
|
|||||||
|
|
||||||
export const Example: Story = {
|
export const Example: Story = {
|
||||||
args: {
|
args: {
|
||||||
color: 'admin',
|
color: 'secondary',
|
||||||
text: 'Hello, World!',
|
text: 'Hello, World!',
|
||||||
variant: 'primary-action'
|
variant: 'primary-action'
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import Spinner from '../Spinner';
|
|||||||
import { Wrapper } from './styles';
|
import { Wrapper } from './styles';
|
||||||
|
|
||||||
export type ButtonProps = {
|
export type ButtonProps = {
|
||||||
color: 'client' | 'productOwner' | 'developer' | 'admin' | 'error';
|
color: 'primary' | 'secondary' | 'tertiary' | 'error';
|
||||||
size?: 'small' | 'big';
|
size?: 'small' | 'big';
|
||||||
variant?: 'primary-action' | 'secondary-action' | 'outlined' | 'text';
|
variant?: 'primary-action' | 'secondary-action' | 'outlined' | 'text';
|
||||||
type?: 'submit' | 'button' | 'reset';
|
type?: 'submit' | 'button' | 'reset';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import styled, { css } from 'styled-components';
|
import styled, { css } from 'styled-components';
|
||||||
|
|
||||||
type WrapperProps = {
|
type WrapperProps = {
|
||||||
color: 'client' | 'productOwner' | 'developer' | 'admin' | 'error';
|
color: 'primary' | 'secondary' | 'tertiary' | 'error';
|
||||||
size?: 'small' | 'big';
|
size?: 'small' | 'big';
|
||||||
variant?: 'primary-action' | 'secondary-action' | 'outlined' | 'text';
|
variant?: 'primary-action' | 'secondary-action' | 'outlined' | 'text';
|
||||||
iconLeft?: React.ReactNode;
|
iconLeft?: React.ReactNode;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const meta = {
|
|||||||
layout: 'centered',
|
layout: 'centered',
|
||||||
},
|
},
|
||||||
argTypes: {
|
argTypes: {
|
||||||
color: { options: ['client', 'productOwner', 'developer', 'admin', 'error'] },
|
color: { options: ['primary', 'secondary', 'tertiary', 'error'] },
|
||||||
},
|
},
|
||||||
} satisfies Meta<typeof Card>;
|
} satisfies Meta<typeof Card>;
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ type Story = StoryObj<typeof meta>;
|
|||||||
|
|
||||||
export const Example: Story = {
|
export const Example: Story = {
|
||||||
args: {
|
args: {
|
||||||
color: 'developer',
|
color: 'secondary',
|
||||||
title: 'Card title',
|
title: 'Card title',
|
||||||
description: 'Card description',
|
description: 'Card description',
|
||||||
selected: true
|
selected: true
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export type CardProps = {
|
|||||||
selectable?: boolean;
|
selectable?: boolean;
|
||||||
selected?: boolean;
|
selected?: boolean;
|
||||||
toggleSelect?: () => void;
|
toggleSelect?: () => void;
|
||||||
color: 'client' | 'productOwner' | 'developer' | 'admin';
|
color: 'primary' | 'secondary' | 'tertiary';
|
||||||
};
|
};
|
||||||
|
|
||||||
const Card = ({
|
const Card = ({
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const meta = {
|
|||||||
},
|
},
|
||||||
tags: ['!autodocs'],
|
tags: ['!autodocs'],
|
||||||
argTypes: {
|
argTypes: {
|
||||||
color: { options: ['client', 'productOwner', 'developer', 'admin'] },
|
color: { options: ['primary', 'secondary', 'tertiary'] },
|
||||||
label: { control: 'text' },
|
label: { control: 'text' },
|
||||||
},
|
},
|
||||||
} satisfies Meta<typeof CheckBox>;
|
} satisfies Meta<typeof CheckBox>;
|
||||||
@@ -21,7 +21,7 @@ type Story = StoryObj<typeof meta>;
|
|||||||
|
|
||||||
export const Example: Story = {
|
export const Example: Story = {
|
||||||
args: {
|
args: {
|
||||||
color: 'admin',
|
color: 'primary',
|
||||||
label: 'Hello, World!',
|
label: 'Hello, World!',
|
||||||
checked: false,
|
checked: false,
|
||||||
onClick: () => window.alert('Clicked!'),
|
onClick: () => window.alert('Clicked!'),
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { Check } from '../../assets';
|
|||||||
|
|
||||||
export type CheckBoxProps = {
|
export type CheckBoxProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
color?: 'client' | 'productOwner' | 'developer' | 'admin';
|
color?: 'primary' | 'secondary' | 'tertiary';
|
||||||
label: string;
|
label: string;
|
||||||
checked: boolean;
|
checked: boolean;
|
||||||
onClick: () => void;
|
onClick: () => void;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import styled, { css } from 'styled-components';
|
import styled, { css } from 'styled-components';
|
||||||
|
|
||||||
type WrapperProps = {
|
type WrapperProps = {
|
||||||
color?: 'client' | 'productOwner' | 'developer' | 'admin';
|
color?: 'primary' | 'secondary' | 'tertiary';
|
||||||
checked: boolean;
|
checked: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -26,49 +26,18 @@ export const Wrapper = styled.div<WrapperProps>`
|
|||||||
}
|
}
|
||||||
|
|
||||||
${({ checked, color, theme }) => {
|
${({ checked, color, theme }) => {
|
||||||
if (!checked)
|
if (!checked || !color)
|
||||||
return css`
|
return css`
|
||||||
.checkbox {
|
.checkbox {
|
||||||
border: 2px solid ${theme.colors.black.main};
|
border: 2px solid ${theme.colors.black.main};
|
||||||
background: ${theme.colors.white.main};
|
background: ${theme.colors.white.main};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
switch (color) {
|
|
||||||
case 'client':
|
|
||||||
return css`
|
return css`
|
||||||
.checkbox {
|
.checkbox {
|
||||||
border: none;
|
border: none;
|
||||||
background: ${theme.colors.client.main};
|
background: ${theme.colors[color].main};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
case 'productOwner':
|
|
||||||
return css`
|
|
||||||
.checkbox {
|
|
||||||
border: none;
|
|
||||||
background: ${theme.colors.productOwner.main};
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
case 'developer':
|
|
||||||
return css`
|
|
||||||
.checkbox {
|
|
||||||
border: none;
|
|
||||||
background: ${theme.colors.developer.main};
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
case 'admin':
|
|
||||||
return css`
|
|
||||||
.checkbox {
|
|
||||||
border: none;
|
|
||||||
background: ${theme.colors.admin.main};
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
default:
|
|
||||||
return css`
|
|
||||||
.checkbox {
|
|
||||||
border: none;
|
|
||||||
background: ${theme.colors.client.main};
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const meta = {
|
|||||||
layout: 'centered',
|
layout: 'centered',
|
||||||
},
|
},
|
||||||
argTypes: {
|
argTypes: {
|
||||||
color: { options: ['client', 'productOwner', 'developer', 'admin'] },
|
color: { options: ['primary', 'secondary', 'tertiary'] },
|
||||||
text: { control: 'text' },
|
text: { control: 'text' },
|
||||||
variant: { options: ['outlined', 'filled'] },
|
variant: { options: ['outlined', 'filled'] },
|
||||||
},
|
},
|
||||||
@@ -21,7 +21,7 @@ type Story = StoryObj<typeof meta>;
|
|||||||
|
|
||||||
export const Example: Story = {
|
export const Example: Story = {
|
||||||
args: {
|
args: {
|
||||||
color: 'admin',
|
color: 'tertiary',
|
||||||
text: 'Hello, World!',
|
text: 'Hello, World!',
|
||||||
variant: 'filled'
|
variant: 'filled'
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,10 +5,9 @@ import Text from '../Text';
|
|||||||
export type ChipProps = {
|
export type ChipProps = {
|
||||||
variant?: 'outlined' | 'filled';
|
variant?: 'outlined' | 'filled';
|
||||||
color:
|
color:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'success'
|
| 'success'
|
||||||
| 'warning'
|
| 'warning'
|
||||||
| 'error';
|
| 'error';
|
||||||
|
|||||||
@@ -2,10 +2,9 @@ import styled, { css } from 'styled-components';
|
|||||||
|
|
||||||
type WrapperProps = {
|
type WrapperProps = {
|
||||||
color:
|
color:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'success'
|
| 'success'
|
||||||
| 'warning'
|
| 'warning'
|
||||||
| 'error';
|
| 'error';
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export const Example: Story = {
|
|||||||
render: () => {
|
render: () => {
|
||||||
return (
|
return (
|
||||||
<IconButton
|
<IconButton
|
||||||
color='admin'
|
color='secondary'
|
||||||
icon={<Add />}
|
icon={<Add />}
|
||||||
size='medium'
|
size='medium'
|
||||||
onClick={() => window.alert('Hello, World!')}
|
onClick={() => window.alert('Hello, World!')}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Wrapper } from './styles';
|
import { Wrapper } from './styles';
|
||||||
|
|
||||||
export type IconButtonProps = {
|
export type IconButtonProps = {
|
||||||
color?: 'client' | 'productOwner' | 'developer' | 'admin';
|
color?: 'primary' | 'secondary' | 'tertiary';
|
||||||
size?: 'small' | 'medium' | 'big';
|
size?: 'small' | 'medium' | 'big';
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
onClick: () => void;
|
onClick: () => void;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import styled, { css } from 'styled-components';
|
import styled, { css } from 'styled-components';
|
||||||
|
|
||||||
type WrapperProps = {
|
type WrapperProps = {
|
||||||
color?: 'client' | 'productOwner' | 'developer' | 'admin';
|
color?: 'primary' | 'secondary' | 'tertiary';
|
||||||
size?: 'small' | 'medium' | 'big';
|
size?: 'small' | 'medium' | 'big';
|
||||||
icon?: React.FunctionComponentElement<React.SVGProps<SVGSVGElement>>;
|
icon?: React.FunctionComponentElement<React.SVGProps<SVGSVGElement>>;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,10 +4,9 @@ import { Upload, Close } from '../../assets';
|
|||||||
export type ImagePreviewProps = {
|
export type ImagePreviewProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
color?:
|
color?:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'success'
|
| 'success'
|
||||||
| 'warning'
|
| 'warning'
|
||||||
| 'error'
|
| 'error'
|
||||||
|
|||||||
@@ -2,10 +2,9 @@ import styled, { css } from 'styled-components';
|
|||||||
|
|
||||||
type WrapperProps = {
|
type WrapperProps = {
|
||||||
color?:
|
color?:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'success'
|
| 'success'
|
||||||
| 'warning'
|
| 'warning'
|
||||||
| 'error'
|
| 'error'
|
||||||
@@ -31,7 +30,7 @@ export const Wrapper = styled.div<WrapperProps>`
|
|||||||
${({ deletable, color, theme }) =>
|
${({ deletable, color, theme }) =>
|
||||||
deletable &&
|
deletable &&
|
||||||
css`
|
css`
|
||||||
border: 2px solid ${theme.colors[color || 'client'].main};
|
border: 2px solid ${theme.colors[color || 'primary'].main};
|
||||||
`}
|
`}
|
||||||
|
|
||||||
.close {
|
.close {
|
||||||
@@ -40,7 +39,7 @@ export const Wrapper = styled.div<WrapperProps>`
|
|||||||
}
|
}
|
||||||
|
|
||||||
.close {
|
.close {
|
||||||
background: ${({ color, theme }) => theme.colors[color || 'client'].main};
|
background: ${({ color, theme }) => theme.colors[color || 'primary'].main};
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -67,7 +66,7 @@ export const Wrapper = styled.div<WrapperProps>`
|
|||||||
padding: 150px 30px;
|
padding: 150px 30px;
|
||||||
position: relative;
|
position: relative;
|
||||||
border: 2px solid
|
border: 2px solid
|
||||||
${({ color, theme }) => theme.colors[color || 'client'].main};
|
${({ color, theme }) => theme.colors[color || 'primary'].main};
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -92,7 +91,7 @@ export const Wrapper = styled.div<WrapperProps>`
|
|||||||
height: 25px;
|
height: 25px;
|
||||||
|
|
||||||
path {
|
path {
|
||||||
stroke: ${({ color, theme }) => theme.colors[color || 'client'].main};
|
stroke: ${({ color, theme }) => theme.colors[color || 'primary'].main};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const meta = {
|
|||||||
layout: 'centered',
|
layout: 'centered',
|
||||||
},
|
},
|
||||||
argTypes: {
|
argTypes: {
|
||||||
color: { options: ['client', 'productOwner', 'developer', 'admin'] },
|
color: { options: ['primary', 'secondary', 'tertiary'] },
|
||||||
},
|
},
|
||||||
} satisfies Meta<typeof Input>;
|
} satisfies Meta<typeof Input>;
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ type Story = StoryObj<typeof meta>;
|
|||||||
|
|
||||||
export const Example: Story = {
|
export const Example: Story = {
|
||||||
args: {
|
args: {
|
||||||
color: 'developer',
|
color: 'tertiary',
|
||||||
onChange: () => {}
|
onChange: () => {}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,10 +6,9 @@ import { Wrapper } from './styles';
|
|||||||
export type InputProps = {
|
export type InputProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
color?:
|
color?:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'success'
|
| 'success'
|
||||||
| 'warning'
|
| 'warning'
|
||||||
| 'error'
|
| 'error'
|
||||||
@@ -31,7 +30,7 @@ export type InputProps = {
|
|||||||
const Input = ({
|
const Input = ({
|
||||||
type = 'text',
|
type = 'text',
|
||||||
file = false,
|
file = false,
|
||||||
color = 'client',
|
color = 'primary',
|
||||||
label,
|
label,
|
||||||
name,
|
name,
|
||||||
placeholder,
|
placeholder,
|
||||||
|
|||||||
@@ -2,10 +2,9 @@ import styled, { css } from 'styled-components';
|
|||||||
|
|
||||||
type WrapperProps = {
|
type WrapperProps = {
|
||||||
color?:
|
color?:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'success'
|
| 'success'
|
||||||
| 'warning'
|
| 'warning'
|
||||||
| 'error'
|
| 'error'
|
||||||
@@ -94,76 +93,58 @@ export const Wrapper = styled.div<WrapperProps>`
|
|||||||
|
|
||||||
${({ color, theme }) => {
|
${({ color, theme }) => {
|
||||||
switch (color) {
|
switch (color) {
|
||||||
case 'client':
|
case 'primary':
|
||||||
return css`
|
return css`
|
||||||
.input {
|
.input {
|
||||||
background: ${theme.colors.client.light};
|
background: ${theme.colors.primary.light};
|
||||||
|
|
||||||
&:focus-within {
|
&:focus-within {
|
||||||
background: ${theme.colors.client.main};
|
background: ${theme.colors.primary.main};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type='file'] {
|
input[type='file'] {
|
||||||
color: ${theme.colors.client.main};
|
color: ${theme.colors.primary.main};
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon svg path {
|
.icon svg path {
|
||||||
stroke: ${theme.colors.client.main};
|
stroke: ${theme.colors.primary.main};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
case 'productOwner':
|
case 'secondary':
|
||||||
return css`
|
return css`
|
||||||
.input {
|
.input {
|
||||||
background: ${theme.colors.productOwner.light};
|
background: ${theme.colors.secondary.light};
|
||||||
|
|
||||||
&:focus-within {
|
&:focus-within {
|
||||||
background: ${theme.colors.productOwner.main};
|
background: ${theme.colors.secondary.main};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type='file'] {
|
input[type='file'] {
|
||||||
color: ${theme.colors.productOwner.main};
|
color: ${theme.colors.secondary.main};
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon svg path {
|
.icon svg path {
|
||||||
stroke: ${theme.colors.productOwner.main};
|
stroke: ${theme.colors.secondary.main};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
case 'developer':
|
case 'tertiary':
|
||||||
return css`
|
return css`
|
||||||
.input {
|
.input {
|
||||||
background: ${theme.colors.developer.light};
|
background: ${theme.colors.tertiary.light};
|
||||||
|
|
||||||
&:focus-within {
|
&:focus-within {
|
||||||
background: ${theme.colors.developer.main};
|
background: ${theme.colors.tertiary.main};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type='file'] {
|
input[type='file'] {
|
||||||
color: ${theme.colors.developer.main};
|
color: ${theme.colors.tertiary.main};
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon svg path {
|
.icon svg path {
|
||||||
stroke: ${theme.colors.developer.main};
|
stroke: ${theme.colors.tertiary.main};
|
||||||
}
|
|
||||||
`;
|
|
||||||
case 'admin':
|
|
||||||
return css`
|
|
||||||
.input {
|
|
||||||
background: ${theme.colors.admin.light};
|
|
||||||
|
|
||||||
&:focus-within {
|
|
||||||
background: ${theme.colors.admin.main};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type='file'] {
|
|
||||||
color: ${theme.colors.admin.main};
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon svg path {
|
|
||||||
stroke: ${theme.colors.admin.main};
|
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
case 'success':
|
case 'success':
|
||||||
@@ -239,19 +220,19 @@ export const Wrapper = styled.div<WrapperProps>`
|
|||||||
default:
|
default:
|
||||||
return css`
|
return css`
|
||||||
.input {
|
.input {
|
||||||
background: ${theme.colors.client.light};
|
background: ${theme.colors.primary.light};
|
||||||
|
|
||||||
&:focus-within {
|
&:focus-within {
|
||||||
background: ${theme.colors.client.main};
|
background: ${theme.colors.primary.main};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type='file'] {
|
input[type='file'] {
|
||||||
color: ${theme.colors.client.main};
|
color: ${theme.colors.primary.main};
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon svg path {
|
.icon svg path {
|
||||||
stroke: ${theme.colors.client.main};
|
stroke: ${theme.colors.primary.main};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,10 +6,9 @@ export type LinkProps = {
|
|||||||
url?: boolean;
|
url?: boolean;
|
||||||
children?: React.ReactNode | JSX.Element | string;
|
children?: React.ReactNode | JSX.Element | string;
|
||||||
color?:
|
color?:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'success'
|
| 'success'
|
||||||
| 'warning'
|
| 'warning'
|
||||||
| 'error'
|
| 'error'
|
||||||
|
|||||||
@@ -2,10 +2,9 @@ import styled, { css } from 'styled-components';
|
|||||||
|
|
||||||
type WrapperProps = {
|
type WrapperProps = {
|
||||||
color?:
|
color?:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'success'
|
| 'success'
|
||||||
| 'warning'
|
| 'warning'
|
||||||
| 'error'
|
| 'error'
|
||||||
@@ -45,68 +44,52 @@ export const Wrapper = styled.div<WrapperProps>`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
switch (color) {
|
switch (color) {
|
||||||
case 'client':
|
case 'primary':
|
||||||
return css`
|
return css`
|
||||||
color: ${theme.colors.client.main};
|
color: ${theme.colors.primary.main};
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: ${theme.colors.client.main};
|
color: ${theme.colors.primary.main};
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon svg path {
|
.icon svg path {
|
||||||
stroke: ${theme.colors.client.main};
|
stroke: ${theme.colors.primary.main};
|
||||||
}
|
}
|
||||||
|
|
||||||
a:visited {
|
a:visited {
|
||||||
color: ${theme.colors.client.main};
|
color: ${theme.colors.primary.main};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
case 'productOwner':
|
case 'secondary':
|
||||||
return css`
|
return css`
|
||||||
color: ${theme.colors.productOwner.main};
|
color: ${theme.colors.secondary.main};
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: ${theme.colors.productOwner.main};
|
color: ${theme.colors.secondary.main};
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon svg path {
|
.icon svg path {
|
||||||
stroke: ${theme.colors.productOwner.main};
|
stroke: ${theme.colors.secondary.main};
|
||||||
}
|
}
|
||||||
|
|
||||||
a:visited {
|
a:visited {
|
||||||
color: ${theme.colors.productOwner.main};
|
color: ${theme.colors.secondary.main};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
case 'developer':
|
case 'tertiary':
|
||||||
return css`
|
return css`
|
||||||
color: ${theme.colors.developer.main};
|
color: ${theme.colors.tertiary.main};
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: ${theme.colors.developer.main};
|
color: ${theme.colors.tertiary.main};
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon svg path {
|
.icon svg path {
|
||||||
stroke: ${theme.colors.developer.main};
|
stroke: ${theme.colors.tertiary.main};
|
||||||
}
|
}
|
||||||
|
|
||||||
a:visited {
|
a:visited {
|
||||||
color: ${theme.colors.developer.main};
|
color: ${theme.colors.tertiary.main};
|
||||||
}
|
|
||||||
`;
|
|
||||||
case 'admin':
|
|
||||||
return css`
|
|
||||||
color: ${theme.colors.admin.main};
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: ${theme.colors.admin.main};
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon svg path {
|
|
||||||
stroke: ${theme.colors.admin.main};
|
|
||||||
}
|
|
||||||
|
|
||||||
a:visited {
|
|
||||||
color: ${theme.colors.admin.main};
|
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
case 'success':
|
case 'success':
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const meta = {
|
|||||||
layout: 'centered',
|
layout: 'centered',
|
||||||
},
|
},
|
||||||
argTypes: {
|
argTypes: {
|
||||||
color: { options: ['client', 'productOwner', 'developer', 'admin', 'error'] },
|
color: { options: ['primary', 'secondary', 'tertiary', 'error'] },
|
||||||
title: { control: 'text' },
|
title: { control: 'text' },
|
||||||
description: { control: 'text' },
|
description: { control: 'text' },
|
||||||
},
|
},
|
||||||
@@ -21,7 +21,7 @@ type Story = StoryObj<typeof meta>;
|
|||||||
|
|
||||||
export const Example: Story = {
|
export const Example: Story = {
|
||||||
args: {
|
args: {
|
||||||
color: 'productOwner',
|
color: 'secondary',
|
||||||
title: 'Modal',
|
title: 'Modal',
|
||||||
description: 'This is a modal!',
|
description: 'This is a modal!',
|
||||||
onConfirm: () => {},
|
onConfirm: () => {},
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import Text from '../Text';
|
|||||||
import { Wrapper } from './styles';
|
import { Wrapper } from './styles';
|
||||||
|
|
||||||
export type ModalProps = {
|
export type ModalProps = {
|
||||||
color: 'client' | 'productOwner' | 'developer' | 'admin';
|
color: 'primary' | 'secondary' | 'tertiary';
|
||||||
title: string;
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
children?: React.ReactNode | JSX.Element | string;
|
children?: React.ReactNode | JSX.Element | string;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const meta = {
|
|||||||
layout: 'centered',
|
layout: 'centered',
|
||||||
},
|
},
|
||||||
argTypes: {
|
argTypes: {
|
||||||
color: { options: ['client', 'productOwner', 'developer', 'admin', 'error'] },
|
color: { options: ['primary', 'secondary', 'tertiary', 'error'] },
|
||||||
value: { control: 'text' },
|
value: { control: 'text' },
|
||||||
},
|
},
|
||||||
} satisfies Meta<typeof Search>;
|
} satisfies Meta<typeof Search>;
|
||||||
@@ -20,7 +20,7 @@ type Story = StoryObj<typeof meta>;
|
|||||||
|
|
||||||
export const Example: Story = {
|
export const Example: Story = {
|
||||||
args: {
|
args: {
|
||||||
color: 'productOwner',
|
color: 'secondary',
|
||||||
value: '',
|
value: '',
|
||||||
onChange: () => {},
|
onChange: () => {},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,10 +5,9 @@ import SearchIcon from '../../assets/icons/search.svg?react';
|
|||||||
export type SearchProps = {
|
export type SearchProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
color?:
|
color?:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'success'
|
| 'success'
|
||||||
| 'warning'
|
| 'warning'
|
||||||
| 'error'
|
| 'error'
|
||||||
@@ -20,7 +19,7 @@ export type SearchProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const Search = ({
|
const Search = ({
|
||||||
color = 'client',
|
color = 'primary',
|
||||||
value,
|
value,
|
||||||
onChange,
|
onChange,
|
||||||
...props
|
...props
|
||||||
|
|||||||
@@ -2,10 +2,9 @@ import styled, { css } from 'styled-components';
|
|||||||
|
|
||||||
type WrapperProps = {
|
type WrapperProps = {
|
||||||
color?:
|
color?:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'success'
|
| 'success'
|
||||||
| 'warning'
|
| 'warning'
|
||||||
| 'error'
|
| 'error'
|
||||||
@@ -53,44 +52,34 @@ export const Wrapper = styled.div<WrapperProps>`
|
|||||||
|
|
||||||
${({ color, theme }) => {
|
${({ color, theme }) => {
|
||||||
switch (color) {
|
switch (color) {
|
||||||
case 'client':
|
case 'primary':
|
||||||
return css`
|
return css`
|
||||||
.search {
|
.search {
|
||||||
background: ${theme.colors.client.light};
|
background: ${theme.colors.primary.light};
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon svg path {
|
.icon svg path {
|
||||||
stroke: ${theme.colors.client.main};
|
stroke: ${theme.colors.primary.main};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
case 'productOwner':
|
case 'secondary':
|
||||||
return css`
|
return css`
|
||||||
.search {
|
.search {
|
||||||
background: ${theme.colors.productOwner.light};
|
background: ${theme.colors.secondary.light};
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon svg path {
|
.icon svg path {
|
||||||
stroke: ${theme.colors.productOwner.main};
|
stroke: ${theme.colors.secondary.main};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
case 'developer':
|
case 'tertiary':
|
||||||
return css`
|
return css`
|
||||||
.search {
|
.search {
|
||||||
background: ${theme.colors.developer.light};
|
background: ${theme.colors.tertiary.light};
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon svg path {
|
.icon svg path {
|
||||||
stroke: ${theme.colors.developer.main};
|
stroke: ${theme.colors.tertiary.main};
|
||||||
}
|
|
||||||
`;
|
|
||||||
case 'admin':
|
|
||||||
return css`
|
|
||||||
.search {
|
|
||||||
background: ${theme.colors.admin.light};
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon svg path {
|
|
||||||
stroke: ${theme.colors.admin.main};
|
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
case 'success':
|
case 'success':
|
||||||
@@ -146,11 +135,11 @@ export const Wrapper = styled.div<WrapperProps>`
|
|||||||
default:
|
default:
|
||||||
return css`
|
return css`
|
||||||
.search {
|
.search {
|
||||||
background: ${theme.colors.client.light};
|
background: ${theme.colors.primary.light};
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon svg path {
|
.icon svg path {
|
||||||
stroke: ${theme.colors.client.main};
|
stroke: ${theme.colors.primary.main};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const meta = {
|
|||||||
layout: 'centered',
|
layout: 'centered',
|
||||||
},
|
},
|
||||||
argTypes: {
|
argTypes: {
|
||||||
color: { options: ['client', 'productOwner', 'developer', 'admin', 'error'] },
|
color: { options: ['primary', 'secondary', 'tertiary', 'admin', 'error'] },
|
||||||
value: { control: 'text' },
|
value: { control: 'text' },
|
||||||
},
|
},
|
||||||
} satisfies Meta<typeof Select>;
|
} satisfies Meta<typeof Select>;
|
||||||
@@ -20,7 +20,7 @@ type Story = StoryObj<typeof meta>;
|
|||||||
|
|
||||||
export const Example: Story = {
|
export const Example: Story = {
|
||||||
args: {
|
args: {
|
||||||
color: 'productOwner',
|
color: 'secondary',
|
||||||
value: '',
|
value: '',
|
||||||
options: [
|
options: [
|
||||||
{ value: '1', label: 'Option 1' },
|
{ value: '1', label: 'Option 1' },
|
||||||
|
|||||||
@@ -5,10 +5,9 @@ import Text from '../Text';
|
|||||||
export type SelectProps = {
|
export type SelectProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
color?:
|
color?:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'success'
|
| 'success'
|
||||||
| 'warning'
|
| 'warning'
|
||||||
| 'error'
|
| 'error'
|
||||||
@@ -27,7 +26,7 @@ export type SelectProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const Select = ({
|
const Select = ({
|
||||||
color = 'client',
|
color = 'primary',
|
||||||
label,
|
label,
|
||||||
name,
|
name,
|
||||||
value,
|
value,
|
||||||
|
|||||||
@@ -2,10 +2,9 @@ import styled, { css } from 'styled-components';
|
|||||||
|
|
||||||
type WrapperProps = {
|
type WrapperProps = {
|
||||||
color?:
|
color?:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'success'
|
| 'success'
|
||||||
| 'warning'
|
| 'warning'
|
||||||
| 'error'
|
| 'error'
|
||||||
@@ -68,28 +67,22 @@ export const Wrapper = styled.div<WrapperProps>`
|
|||||||
|
|
||||||
${({ color, theme }) => {
|
${({ color, theme }) => {
|
||||||
switch (color) {
|
switch (color) {
|
||||||
case 'client':
|
case 'primary':
|
||||||
return css`
|
return css`
|
||||||
.select {
|
.select {
|
||||||
background: ${theme.colors.client.light};
|
background: ${theme.colors.primary.light};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
case 'productOwner':
|
case 'secondary':
|
||||||
return css`
|
return css`
|
||||||
.select {
|
.select {
|
||||||
background: ${theme.colors.productOwner.light};
|
background: ${theme.colors.secondary.light};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
case 'developer':
|
case 'tertiary':
|
||||||
return css`
|
return css`
|
||||||
.select {
|
.select {
|
||||||
background: ${theme.colors.developer.light};
|
background: ${theme.colors.tertiary.light};
|
||||||
}
|
|
||||||
`;
|
|
||||||
case 'admin':
|
|
||||||
return css`
|
|
||||||
.select {
|
|
||||||
background: ${theme.colors.admin.light};
|
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
case 'success':
|
case 'success':
|
||||||
@@ -125,7 +118,7 @@ export const Wrapper = styled.div<WrapperProps>`
|
|||||||
default:
|
default:
|
||||||
return css`
|
return css`
|
||||||
.select {
|
.select {
|
||||||
background: ${theme.colors.client.light};
|
background: ${theme.colors.primary.light};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const meta = {
|
|||||||
},
|
},
|
||||||
tags: ['!autodocs'],
|
tags: ['!autodocs'],
|
||||||
argTypes: {
|
argTypes: {
|
||||||
color: { options: ['client', 'productOwner', 'developer', 'admin', 'error'] },
|
color: { options: ['primay', 'secondary', 'tertiary', 'error'] },
|
||||||
},
|
},
|
||||||
} satisfies Meta<typeof Spinner>;
|
} satisfies Meta<typeof Spinner>;
|
||||||
|
|
||||||
@@ -20,6 +20,6 @@ type Story = StoryObj<typeof meta>;
|
|||||||
|
|
||||||
export const Example: Story = {
|
export const Example: Story = {
|
||||||
args: {
|
args: {
|
||||||
color: 'client',
|
color: 'primary',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,17 +2,16 @@ import { Wrapper } from './styles';
|
|||||||
|
|
||||||
export type SpinnerProps = {
|
export type SpinnerProps = {
|
||||||
color?:
|
color?:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'white'
|
| 'white'
|
||||||
| 'black'
|
| 'black'
|
||||||
| 'gray';
|
| 'gray';
|
||||||
fullWidth?: boolean;
|
fullWidth?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Spinner = ({ fullWidth = false, color = 'client' }: SpinnerProps) => {
|
const Spinner = ({ fullWidth = false, color = 'primary' }: SpinnerProps) => {
|
||||||
return (
|
return (
|
||||||
<Wrapper fullWidth={fullWidth} color={color}>
|
<Wrapper fullWidth={fullWidth} color={color}>
|
||||||
<div className='lds-dual-ring'></div>
|
<div className='lds-dual-ring'></div>
|
||||||
|
|||||||
@@ -2,10 +2,9 @@ import styled, { css } from 'styled-components';
|
|||||||
|
|
||||||
type WrapperProps = {
|
type WrapperProps = {
|
||||||
color?:
|
color?:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'white'
|
| 'white'
|
||||||
| 'black'
|
| 'black'
|
||||||
| 'gray';
|
| 'gray';
|
||||||
@@ -38,12 +37,12 @@ export const Wrapper = styled.div<WrapperProps>`
|
|||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 6px solid
|
border: 6px solid
|
||||||
${({ theme, color }) =>
|
${({ theme, color }) =>
|
||||||
color ? theme.colors[color].main : theme.colors.client.main};
|
color ? theme.colors[color].main : theme.colors.primary.main};
|
||||||
border-color: ${({ theme, color }) =>
|
border-color: ${({ theme, color }) =>
|
||||||
color ? theme.colors[color].main : theme.colors.client.main}
|
color ? theme.colors[color].main : theme.colors.primary.main}
|
||||||
transparent
|
transparent
|
||||||
${({ theme, color }) =>
|
${({ theme, color }) =>
|
||||||
color ? theme.colors[color].main : theme.colors.client.main}
|
color ? theme.colors[color].main : theme.colors.primary.main}
|
||||||
transparent;
|
transparent;
|
||||||
animation: lds-dual-ring 1.2s linear infinite;
|
animation: lds-dual-ring 1.2s linear infinite;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const meta = {
|
|||||||
},
|
},
|
||||||
tags: ['!autodocs'],
|
tags: ['!autodocs'],
|
||||||
argTypes: {
|
argTypes: {
|
||||||
color: { options: ['client', 'productOwner', 'developer', 'admin', 'error'] },
|
color: { options: ['primary', 'secondary', 'tertiary', 'error'] },
|
||||||
variant: { options: ['display', 'headline', 'title', 'subheader', 'body', 'caption'] },
|
variant: { options: ['display', 'headline', 'title', 'subheader', 'body', 'caption'] },
|
||||||
weight: { options: ['initial', 'normal', 'bold'] },
|
weight: { options: ['initial', 'normal', 'bold'] },
|
||||||
},
|
},
|
||||||
@@ -22,7 +22,7 @@ type Story = StoryObj<typeof meta>;
|
|||||||
|
|
||||||
export const Example: Story = {
|
export const Example: Story = {
|
||||||
args: {
|
args: {
|
||||||
color: 'developer',
|
color: 'tertiary',
|
||||||
children: 'Text',
|
children: 'Text',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,10 +5,9 @@ export type TextProps = {
|
|||||||
className?: string;
|
className?: string;
|
||||||
variant?: 'display' | 'headline' | 'title' | 'subheader' | 'body' | 'caption';
|
variant?: 'display' | 'headline' | 'title' | 'subheader' | 'body' | 'caption';
|
||||||
color?:
|
color?:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'success'
|
| 'success'
|
||||||
| 'warning'
|
| 'warning'
|
||||||
| 'error'
|
| 'error'
|
||||||
|
|||||||
@@ -2,10 +2,9 @@ import styled, { css } from 'styled-components';
|
|||||||
|
|
||||||
type WrapperProps = {
|
type WrapperProps = {
|
||||||
color?:
|
color?:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'success'
|
| 'success'
|
||||||
| 'warning'
|
| 'warning'
|
||||||
| 'error'
|
| 'error'
|
||||||
@@ -26,21 +25,17 @@ export const Wrapper = styled.p<WrapperProps>`
|
|||||||
color: inherit;
|
color: inherit;
|
||||||
`;
|
`;
|
||||||
switch (color) {
|
switch (color) {
|
||||||
case 'client':
|
case 'primary':
|
||||||
return css`
|
return css`
|
||||||
color: ${theme.colors.client.main};
|
color: ${theme.colors.primary.main};
|
||||||
`;
|
`;
|
||||||
case 'productOwner':
|
case 'secondary':
|
||||||
return css`
|
return css`
|
||||||
color: ${theme.colors.productOwner.main};
|
color: ${theme.colors.secondary.main};
|
||||||
`;
|
`;
|
||||||
case 'developer':
|
case 'tertiary':
|
||||||
return css`
|
return css`
|
||||||
color: ${theme.colors.developer.main};
|
color: ${theme.colors.tertiary.main};
|
||||||
`;
|
|
||||||
case 'admin':
|
|
||||||
return css`
|
|
||||||
color: ${theme.colors.admin.main};
|
|
||||||
`;
|
`;
|
||||||
case 'success':
|
case 'success':
|
||||||
return css`
|
return css`
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const meta = {
|
|||||||
layout: 'centered',
|
layout: 'centered',
|
||||||
},
|
},
|
||||||
argTypes: {
|
argTypes: {
|
||||||
color: { options: ['client', 'productOwner', 'developer', 'admin', 'error'] },
|
color: { options: ['primary', 'secondary', 'tertiary', 'error'] },
|
||||||
},
|
},
|
||||||
} satisfies Meta<typeof TextArea>;
|
} satisfies Meta<typeof TextArea>;
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ type Story = StoryObj<typeof meta>;
|
|||||||
|
|
||||||
export const Example: Story = {
|
export const Example: Story = {
|
||||||
args: {
|
args: {
|
||||||
color: 'developer',
|
color: 'tertiary',
|
||||||
value: 'TextArea',
|
value: 'TextArea',
|
||||||
name: 'TextArea',
|
name: 'TextArea',
|
||||||
onChange: () => {}
|
onChange: () => {}
|
||||||
|
|||||||
@@ -5,10 +5,9 @@ import Text from '../Text';
|
|||||||
export type TextAreaProps = {
|
export type TextAreaProps = {
|
||||||
className?: string;
|
className?: string;
|
||||||
color?:
|
color?:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'success'
|
| 'success'
|
||||||
| 'warning'
|
| 'warning'
|
||||||
| 'error'
|
| 'error'
|
||||||
@@ -26,7 +25,7 @@ export type TextAreaProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const TextArea = ({
|
const TextArea = ({
|
||||||
color = 'client',
|
color = 'primary',
|
||||||
label,
|
label,
|
||||||
name,
|
name,
|
||||||
placeholder,
|
placeholder,
|
||||||
|
|||||||
@@ -2,10 +2,9 @@ import styled, { css } from 'styled-components';
|
|||||||
|
|
||||||
type WrapperProps = {
|
type WrapperProps = {
|
||||||
color?:
|
color?:
|
||||||
| 'client'
|
| 'primary'
|
||||||
| 'productOwner'
|
| 'secondary'
|
||||||
| 'developer'
|
| 'tertiary'
|
||||||
| 'admin'
|
|
||||||
| 'success'
|
| 'success'
|
||||||
| 'warning'
|
| 'warning'
|
||||||
| 'error'
|
| 'error'
|
||||||
@@ -64,28 +63,22 @@ export const Wrapper = styled.div<WrapperProps>`
|
|||||||
|
|
||||||
${({ color, theme }) => {
|
${({ color, theme }) => {
|
||||||
switch (color) {
|
switch (color) {
|
||||||
case 'client':
|
case 'primary':
|
||||||
return css`
|
return css`
|
||||||
.textarea {
|
.textarea {
|
||||||
background: ${theme.colors.client.light};
|
background: ${theme.colors.primary.light};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
case 'productOwner':
|
case 'secondary':
|
||||||
return css`
|
return css`
|
||||||
.textarea {
|
.textarea {
|
||||||
background: ${theme.colors.productOwner.light};
|
background: ${theme.colors.secondary.light};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
case 'developer':
|
case 'tertiary':
|
||||||
return css`
|
return css`
|
||||||
.textarea {
|
.textarea {
|
||||||
background: ${theme.colors.developer.light};
|
background: ${theme.colors.tertiary.light};
|
||||||
}
|
|
||||||
`;
|
|
||||||
case 'admin':
|
|
||||||
return css`
|
|
||||||
.textarea {
|
|
||||||
background: ${theme.colors.admin.light};
|
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
case 'success':
|
case 'success':
|
||||||
@@ -121,7 +114,7 @@ export const Wrapper = styled.div<WrapperProps>`
|
|||||||
default:
|
default:
|
||||||
return css`
|
return css`
|
||||||
.textarea {
|
.textarea {
|
||||||
background: ${theme.colors.client.light};
|
background: ${theme.colors.primary.light};
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+3
-8
@@ -38,22 +38,17 @@ declare module 'styled-components' {
|
|||||||
light: string;
|
light: string;
|
||||||
dark: string;
|
dark: string;
|
||||||
};
|
};
|
||||||
client: {
|
primary: {
|
||||||
main: string;
|
main: string;
|
||||||
light: string;
|
light: string;
|
||||||
dark: string;
|
dark: string;
|
||||||
};
|
};
|
||||||
productOwner: {
|
secondary: {
|
||||||
main: string;
|
main: string;
|
||||||
light: string;
|
light: string;
|
||||||
dark: string;
|
dark: string;
|
||||||
};
|
};
|
||||||
developer: {
|
tertiary: {
|
||||||
main: string;
|
|
||||||
light: string;
|
|
||||||
dark: string;
|
|
||||||
};
|
|
||||||
admin: {
|
|
||||||
main: string;
|
main: string;
|
||||||
light: string;
|
light: string;
|
||||||
dark: string;
|
dark: string;
|
||||||
|
|||||||
+18
-37
@@ -60,80 +60,61 @@ export const defaultTheme: DefaultTheme = {
|
|||||||
)`,
|
)`,
|
||||||
dark: '',
|
dark: '',
|
||||||
},
|
},
|
||||||
client: {
|
primary: {
|
||||||
main: '#5F6CAD',
|
main: '#BD1839',
|
||||||
light: `linear-gradient(
|
light: `linear-gradient(
|
||||||
rgba(255, 255, 255, .75),
|
rgba(255, 255, 255, .75),
|
||||||
rgba(255, 255, 255, .75)
|
rgba(255, 255, 255, .75)
|
||||||
),
|
),
|
||||||
linear-gradient(
|
linear-gradient(
|
||||||
#5F6CAD,
|
#BD1839,
|
||||||
#5F6CAD
|
#BD1839
|
||||||
)`,
|
)`,
|
||||||
dark: `linear-gradient(
|
dark: `linear-gradient(
|
||||||
rgba(0, 0, 0, .3),
|
rgba(0, 0, 0, .3),
|
||||||
rgba(0, 0, 0, .3)
|
rgba(0, 0, 0, .3)
|
||||||
),
|
),
|
||||||
linear-gradient(
|
linear-gradient(
|
||||||
#5F6CAD,
|
#BD1839,
|
||||||
#5F6CAD
|
#BD1839
|
||||||
)`,
|
)`,
|
||||||
},
|
},
|
||||||
productOwner: {
|
secondary: {
|
||||||
main: '#20063B',
|
main: '#131314',
|
||||||
light: `linear-gradient(
|
light: `linear-gradient(
|
||||||
rgba(255, 255, 255, .75),
|
rgba(255, 255, 255, .75),
|
||||||
rgba(255, 255, 255, .75)
|
rgba(255, 255, 255, .75)
|
||||||
),
|
),
|
||||||
linear-gradient(
|
linear-gradient(
|
||||||
#20063B,
|
#131314,
|
||||||
#20063B
|
#131314
|
||||||
)`,
|
)`,
|
||||||
dark: `linear-gradient(
|
dark: `linear-gradient(
|
||||||
rgba(0, 0, 0, .3),
|
rgba(0, 0, 0, .3),
|
||||||
rgba(0, 0, 0, .3)
|
rgba(0, 0, 0, .3)
|
||||||
),
|
),
|
||||||
linear-gradient(
|
linear-gradient(
|
||||||
#20063B,
|
#131314,
|
||||||
#20063B
|
#131314
|
||||||
)`,
|
)`,
|
||||||
},
|
},
|
||||||
developer: {
|
tertiary: {
|
||||||
main: '#ED7D3A',
|
main: '#E7E7E7',
|
||||||
light: `linear-gradient(
|
light: `linear-gradient(
|
||||||
rgba(255, 255, 255, .75),
|
rgba(255, 255, 255, .75),
|
||||||
rgba(255, 255, 255, .75)
|
rgba(255, 255, 255, .75)
|
||||||
),
|
),
|
||||||
linear-gradient(
|
linear-gradient(
|
||||||
#ED7D3A,
|
#E7E7E7,
|
||||||
#ED7D3A
|
#E7E7E7
|
||||||
)`,
|
)`,
|
||||||
dark: `linear-gradient(
|
dark: `linear-gradient(
|
||||||
rgba(0, 0, 0, .3),
|
rgba(0, 0, 0, .3),
|
||||||
rgba(0, 0, 0, .3)
|
rgba(0, 0, 0, .3)
|
||||||
),
|
),
|
||||||
linear-gradient(
|
linear-gradient(
|
||||||
#ED7D3A,
|
#E7E7E7,
|
||||||
#ED7D3A
|
#E7E7E7
|
||||||
)`,
|
|
||||||
},
|
|
||||||
admin: {
|
|
||||||
main: '#A30015',
|
|
||||||
light: `linear-gradient(
|
|
||||||
rgba(255, 255, 255, .75),
|
|
||||||
rgba(255, 255, 255, .75)
|
|
||||||
),
|
|
||||||
linear-gradient(
|
|
||||||
#A30015,
|
|
||||||
#A30015
|
|
||||||
)`,
|
|
||||||
dark: `linear-gradient(
|
|
||||||
rgba(0, 0, 0, .3),
|
|
||||||
rgba(0, 0, 0, .3)
|
|
||||||
),
|
|
||||||
linear-gradient(
|
|
||||||
#A30015,
|
|
||||||
#A30015
|
|
||||||
)`,
|
)`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user