diff --git a/src/assets/icon/BackPush.svg b/src/assets/icon/BackPush.svg index dae901ba..8f347d10 100644 --- a/src/assets/icon/BackPush.svg +++ b/src/assets/icon/BackPush.svg @@ -1,3 +1,3 @@ - - + + diff --git a/src/components/common/chips/Chips.stories.tsx b/src/components/common/chips/Chips.stories.tsx new file mode 100644 index 00000000..bedd0369 --- /dev/null +++ b/src/components/common/chips/Chips.stories.tsx @@ -0,0 +1,23 @@ +import type { Meta, StoryObj } from '@storybook/react' +import Chips from './Chips' + +const meta: Meta = { + component: Chips, + tags: ['autodocs'], + title: 'components/Chips', + argTypes: { + label: { + control: 'text' + }, + isSelected: { + control: 'select', + options: [true, false] + } + } +} +export default meta +type Story = StoryObj + +export const Default: Story = { + render: (args) => +} diff --git a/src/components/common/chips/Chips.tsx b/src/components/common/chips/Chips.tsx new file mode 100644 index 00000000..79d361c6 --- /dev/null +++ b/src/components/common/chips/Chips.tsx @@ -0,0 +1,18 @@ +interface ChipsProps { + label: string + isSelected: boolean +} +const Chips = ({ label, isSelected }: ChipsProps) => { + return ( +
+ {label} +
+ ) +} + +export default Chips diff --git a/src/components/common/icon/Icon.tsx b/src/components/common/icon/Icon.tsx index 08ba4a90..ac009b0b 100644 --- a/src/components/common/icon/Icon.tsx +++ b/src/components/common/icon/Icon.tsx @@ -2,12 +2,15 @@ import Icons from './Icons' export type IconType = keyof typeof Icons export interface IconProps { - icon: IconType + icon?: IconType classStyle?: string onClick?: () => void } const Icon = ({ icon, classStyle, onClick }: IconProps) => { + if (!icon) { + return null + } const SvgIcon = Icons[icon] return } diff --git a/src/components/common/standardButton/StandardButton.stories.tsx b/src/components/common/standardButton/StandardButton.stories.tsx new file mode 100644 index 00000000..33d912be --- /dev/null +++ b/src/components/common/standardButton/StandardButton.stories.tsx @@ -0,0 +1,29 @@ +import type { Meta, StoryObj } from '@storybook/react' +import StandardButton from './StandardButton' + +const meta: Meta = { + component: StandardButton, + tags: ['autodocs'], + title: 'components/StandardButton', + argTypes: { + label: { + control: 'text' + }, + state: { + control: 'select', + options: ['disabled', 'enabled'] + }, + style: { + control: 'select', + options: ['outlined', 'filled'] + } + } +} +export default meta +type Story = StoryObj + +export const Default: Story = { + render: (args) => ( + + ) +} diff --git a/src/components/common/standardButton/StandardButton.tsx b/src/components/common/standardButton/StandardButton.tsx new file mode 100644 index 00000000..641b64a1 --- /dev/null +++ b/src/components/common/standardButton/StandardButton.tsx @@ -0,0 +1,25 @@ +interface StandardButtonProps { + label: string + state: 'disabled' | 'enabled' + style: 'outlined' | 'filled' +} +const StandardButton = ({ label, state, style }: StandardButtonProps) => { + return ( +
+ {label} +
+ ) +} + +export default StandardButton diff --git a/src/components/common/topNavigation/TopNavigation.stories.tsx b/src/components/common/topNavigation/TopNavigation.stories.tsx new file mode 100644 index 00000000..14fff8a8 --- /dev/null +++ b/src/components/common/topNavigation/TopNavigation.stories.tsx @@ -0,0 +1,62 @@ +import type { Meta, StoryObj } from '@storybook/react' +import TopNavigation from './TopNavigation' +import Icons from '../icon/Icons' + +const iconNames = [...Object.keys(Icons), undefined] as ( + | keyof typeof Icons + | undefined +)[] + +const meta: Meta = { + component: TopNavigation, + tags: ['autodocs'], + title: 'components/TopNavigation', + argTypes: { + title: { + control: 'text' + }, + type: { + control: 'select', + options: ['left', 'center'] + }, + icon1: { + control: 'select', + options: iconNames + }, + icon2: { + control: 'select', + options: iconNames + }, + icon3: { + control: 'select', + options: iconNames + } + // icon1: { + // control: 'select', + // options: ['SideBar', 'Alarm', undefined] + // }, + // icon2: { + // control: 'select', + // options: ['SideBar', 'Alarm', undefined] + // }, + // icon3: { + // control: 'select', + // options: ['SideBar', 'Alarm', undefined] + // } + } +} + +export default meta +type Story = StoryObj + +export const Default: Story = { + render: (args) => ( + + ) +} diff --git a/src/components/common/topNavigation/TopNavigation.tsx b/src/components/common/topNavigation/TopNavigation.tsx new file mode 100644 index 00000000..96d107f7 --- /dev/null +++ b/src/components/common/topNavigation/TopNavigation.tsx @@ -0,0 +1,44 @@ +import Icon, { IconType } from '../icon/Icon' + +interface TopNavigationProps { + title: string + type: 'left' | 'center' + // icon1: 'SideBar' | 'Alarm' | undefined + // icon2: 'SideBar' | 'Alarm' | undefined + // icon3: 'SideBar' | 'Alarm' | undefined + icon1: IconType | undefined + icon2: IconType | undefined + icon3: IconType | undefined +} +const TopNavigation = ({ + title, + type, + icon1, + icon2, + icon3 +}: TopNavigationProps) => { + return ( +
+ + {type === 'left' ? ( + <> +
{title}
+
+ + + +
+ + ) : ( +
+ {title} +
+ )} + {/*
{title}
*/} +
+ ) +} + +export default TopNavigation diff --git a/tailwind.config.js b/tailwind.config.js index efaae3e2..3b8a4d79 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -47,7 +47,7 @@ export default { r200: 'rgba(244,244,244,1)' }, gray: { - 5: '#F2F2F2', + 5: '#F7F7F7', 10: '#E4E4E4', 20: '#D4D3D3', 30: '#C7C7C7',