diff --git a/src/harmony/Kanban/Kanban.module.css b/src/harmony/Kanban/Kanban.module.css new file mode 100644 index 00000000..19bad764 --- /dev/null +++ b/src/harmony/Kanban/Kanban.module.css @@ -0,0 +1,50 @@ +.KanbanContainer { + display: flex; +} + +.KanbanColumn { + width: 328px; + flex-grow: 0; + flex-shrink: 0; + padding: var(--gap-s) var(--gap-sm); + border-right: 1px solid var(--gray-900); +} + +.KanbanColumn:last-child { + border-right: 0; +} + +.KanbanCard { + background: var(--layer); + padding: var(--gap-s) var(--gap-sm); + border-radius: var(--radius-m); + border: 1px solid var(--gray-900); +} + +.KanbanCard:not(:last-child) { + margin-bottom: var(--gap-sm); +} + +.KanbanCardInfo { + color: var(--text-ghost); + display: flex; + gap: var(--gap-s); +} + +.KanbanCardInfo:not(:last-child) { + margin-bottom: var(--gap-xs); +} + +.KanbanCardContent { + display: flex; + flex-wrap: nowrap; + gap: var(--gap-xs); +} + +.KanbanCardContent:not(:last-child){ + margin-bottom: var(--gap-xs); +} + +.KanbanCardContentItem { + flex: 1; +} diff --git a/src/harmony/Kanban/Kanban.stories.tsx b/src/harmony/Kanban/Kanban.stories.tsx new file mode 100644 index 00000000..2d1f1e62 --- /dev/null +++ b/src/harmony/Kanban/Kanban.stories.tsx @@ -0,0 +1,153 @@ +import React, { FC, ReactNode } from 'react'; +import type { Meta, StoryFn } from '@storybook/react'; +import { IconMessageTextOutline } from '@taskany/icons'; + +import { Badge } from '../Badge/Badge'; +import { State } from '../State/State'; +import { Text } from '../Text/Text'; +import { Dropdown as DropdownProvider, DropdownTrigger } from '../Dropdown/Dropdown'; +import { FlatProgressBar } from '../FlatProgressBar/FlatProgressBar'; + +import { KanbanContainer } from './KanbanContainer'; +import { KanbanColumn } from './KanbanColumn'; +import { KanbanCard } from './KanbanCard'; +import { KanbanCardTitle } from './KanbanCardTitle'; +import { KanbanCardInfo } from './KanbanCardInfo'; +import { KanbanCardContent } from './KanbanCardContent'; +import { KanbanCardContentItem } from './KanbanCardContentItem'; + +const meta: Meta = { + title: '@harmony/Kanban', + component: KanbanContainer, +}; + +export default meta; + +const Dropdown = ({ children, label }: { children: ReactNode; label: string }) => { + return ( + + + {children} + + + ); +}; + +const Card: FC<{ + counter: number; + title: string; + subInfo?: string; + progress: number; +}> = ({ counter, title, subInfo, progress }) => { + return ( + + {title} + + } /> + {subInfo} + + + + + Minulin Timur + + + + + + + Q4/2023 + + + + + Low + + + + + + ); +}; + +const columns = [ + { + state: { + color: 'var(--status-in-progress)', + title: 'In Progress', + }, + data: [ + { + title: '[news] Автоматизиция тестирования', + subInfo: 'updated 4 weeks ago', + counter: 6, + progress: 33, + }, + { + title: 'Повысить экономию трайбов за счет роста автоматизации', + subInfo: 'updated 6 days ago', + counter: 12, + progress: 60, + }, + ], + }, + + { + state: { + color: 'var(--status-finished)', + title: 'Finished', + }, + data: [ + { + title: 'Принять окончательное решение по ключевым проектам', + subInfo: 'updated 1 day ago', + counter: 14, + progress: 100, + }, + ], + }, + + { + state: { + color: 'var(--status-failed)', + title: 'Failed', + }, + data: [ + { + title: 'Повысить экономию трайбов за счет роста автоматизации', + subInfo: 'updated last month', + counter: 10, + progress: 13, + }, + { + title: 'Принять окончательное решение по ключевым проектам', + subInfo: 'updated 4 hours ago', + counter: 12, + progress: 63, + }, + { + title: '[news] Автоматизиция тестирования', + subInfo: 'updated just now', + counter: 9, + progress: 80, + }, + ], + }, +]; + +export const Default: StoryFn = () => { + return ( + + {columns.map((column, i) => ( + +
+ +
+ {column.data.map((item, j) => ( + + ))} +
+ ))} +
+ ); +}; diff --git a/src/harmony/Kanban/KanbanCard.tsx b/src/harmony/Kanban/KanbanCard.tsx new file mode 100644 index 00000000..da692b55 --- /dev/null +++ b/src/harmony/Kanban/KanbanCard.tsx @@ -0,0 +1,12 @@ +import React, { FC, HTMLAttributes } from 'react'; +import cn from 'classnames'; + +import s from './Kanban.module.css'; + +export const KanbanCard: FC> = ({ children, className, ...rest }) => { + return ( +
+ {children} +
+ ); +}; diff --git a/src/harmony/Kanban/KanbanCardContent.tsx b/src/harmony/Kanban/KanbanCardContent.tsx new file mode 100644 index 00000000..ad852019 --- /dev/null +++ b/src/harmony/Kanban/KanbanCardContent.tsx @@ -0,0 +1,12 @@ +import React, { FC, HTMLAttributes } from 'react'; +import cn from 'classnames'; + +import s from './Kanban.module.css'; + +export const KanbanCardContent: FC> = ({ children, className, ...rest }) => { + return ( +
+ {children} +
+ ); +}; diff --git a/src/harmony/Kanban/KanbanCardContentItem.tsx b/src/harmony/Kanban/KanbanCardContentItem.tsx new file mode 100644 index 00000000..8ec41be0 --- /dev/null +++ b/src/harmony/Kanban/KanbanCardContentItem.tsx @@ -0,0 +1,12 @@ +import React, { FC, HTMLAttributes } from 'react'; +import cn from 'classnames'; + +import s from './Kanban.module.css'; + +export const KanbanCardContentItem: FC> = ({ children, className, ...rest }) => { + return ( +
+ {children} +
+ ); +}; diff --git a/src/harmony/Kanban/KanbanCardInfo.tsx b/src/harmony/Kanban/KanbanCardInfo.tsx new file mode 100644 index 00000000..9ab238d9 --- /dev/null +++ b/src/harmony/Kanban/KanbanCardInfo.tsx @@ -0,0 +1,12 @@ +import React, { FC, HTMLAttributes } from 'react'; +import cn from 'classnames'; + +import s from './Kanban.module.css'; + +export const KanbanCardInfo: FC> = ({ children, className, ...rest }) => { + return ( +
+ {children} +
+ ); +}; diff --git a/src/harmony/Kanban/KanbanCardTitle.tsx b/src/harmony/Kanban/KanbanCardTitle.tsx new file mode 100644 index 00000000..86dac231 --- /dev/null +++ b/src/harmony/Kanban/KanbanCardTitle.tsx @@ -0,0 +1,11 @@ +import React, { FC, ComponentProps } from 'react'; + +import { Text } from '../Text/Text'; + +export const KanbanCardTitle: FC> = ({ children, ...rest }) => { + return ( + + {children} + + ); +}; diff --git a/src/harmony/Kanban/KanbanColumn.tsx b/src/harmony/Kanban/KanbanColumn.tsx new file mode 100644 index 00000000..dfc8301f --- /dev/null +++ b/src/harmony/Kanban/KanbanColumn.tsx @@ -0,0 +1,12 @@ +import React, { FC, HTMLAttributes } from 'react'; +import cn from 'classnames'; + +import s from './Kanban.module.css'; + +export const KanbanColumn: FC> = ({ children, className, ...rest }) => { + return ( +
+ {children} +
+ ); +}; diff --git a/src/harmony/Kanban/KanbanContainer.tsx b/src/harmony/Kanban/KanbanContainer.tsx new file mode 100644 index 00000000..9a405659 --- /dev/null +++ b/src/harmony/Kanban/KanbanContainer.tsx @@ -0,0 +1,12 @@ +import React, { FC, HTMLAttributes } from 'react'; +import cn from 'classnames'; + +import s from './Kanban.module.css'; + +export const KanbanContainer: FC> = ({ children, className, ...rest }) => { + return ( +
+ {children} +
+ ); +}; diff --git a/src/harmony/index.ts b/src/harmony/index.ts index 48450aa2..e804f54a 100644 --- a/src/harmony/index.ts +++ b/src/harmony/index.ts @@ -3,6 +3,13 @@ export * from './AutoComplete/AutoComplete'; export * from './Badge/Badge'; export * from './Breadcrumbs/Breadcrumbs'; export * from './Button/Button'; +export * from './Canban/CanbanCard'; +export * from './Canban/CanbanCardContent'; +export * from './Canban/CanbanCardContentItem'; +export * from './Canban/CanbanCardInfo'; +export * from './Canban/CanbanCardTitle'; +export * from './Canban/CanbanColumn'; +export * from './Canban/CanbanContainer'; export * from './Card/Card'; export * from './Checkbox/Checkbox'; export * from './Circle/Circle';