diff --git a/.storybook/pages/CoursePlannerEdit/CoursePlannerEdit.tsx b/.storybook/pages/CoursePlannerEdit/CoursePlannerEdit.tsx index 7a8041c93..784bfd81b 100644 --- a/.storybook/pages/CoursePlannerEdit/CoursePlannerEdit.tsx +++ b/.storybook/pages/CoursePlannerEdit/CoursePlannerEdit.tsx @@ -32,8 +32,6 @@ import { TableHeaderCell, TableRow, Text, - Toolbar, - ToolbarItem, } from '../../../src'; import type { NewState } from '../../../src/components/DragDrop/DragDrop'; @@ -431,19 +429,17 @@ export const CoursePlannerEdit = () => { emptyContent: container1EmptyContent(), header: ( - - - - Available projects - - - + + + Available projects + + Add project - - + + ), }, @@ -452,19 +448,17 @@ export const CoursePlannerEdit = () => { emptyContent: container2EmptyContent(), header: ( - - - - Planned projects - - - + + + Planned projects + + Add project - - + + ), }, diff --git a/.storybook/pages/FeedbackOverview/FeedbackOverview.module.css b/.storybook/pages/FeedbackOverview/FeedbackOverview.module.css index 9d7ce57f7..133f69f59 100644 --- a/.storybook/pages/FeedbackOverview/FeedbackOverview.module.css +++ b/.storybook/pages/FeedbackOverview/FeedbackOverview.module.css @@ -1,9 +1,5 @@ @import '../../../src/design-tokens/mixins.css'; -.feedback-overview__toolbar { - padding-bottom: var(--eds-size-2); -} - .feedback-overview__card-header { margin-bottom: var(--eds-size-1); font: var(--eds-theme-typography-title-md); diff --git a/.storybook/pages/FeedbackOverview/FeedbackOverview.tsx b/.storybook/pages/FeedbackOverview/FeedbackOverview.tsx index 8c42567a3..046e8a223 100644 --- a/.storybook/pages/FeedbackOverview/FeedbackOverview.tsx +++ b/.storybook/pages/FeedbackOverview/FeedbackOverview.tsx @@ -14,8 +14,6 @@ import { Table, Text, TimelineNav, - Toolbar, - ToolbarItem, } from '../../../src'; import breakpoint from '../../../src/design-tokens/tier-1-definitions/breakpoints'; @@ -208,16 +206,11 @@ export const FeedbackOverview = ({ activeIndex = 0 }: Props) => { - - - - Feedback Overview - - - + + + Feedback Overview + + { /> Filters - - + + {isTable && ( @@ -405,16 +398,11 @@ export const FeedbackOverview = ({ activeIndex = 0 }: Props) => { } variant="number" > - - - - Checkpoint Progress - - - + + + Checkpoint Progress + + { /> Filters - - + + {isTable && ( diff --git a/src/components/DragDrop/DragDrop.stories.tsx b/src/components/DragDrop/DragDrop.stories.tsx index f40d1e2d9..666036a94 100644 --- a/src/components/DragDrop/DragDrop.stories.tsx +++ b/src/components/DragDrop/DragDrop.stories.tsx @@ -10,7 +10,6 @@ import { Heading, Icon, Text, - Toolbar, } from '../..'; import styles from './DragDrop.stories.module.css'; @@ -91,11 +90,11 @@ export const Default: StoryObj = { itemIds: ['item-1', 'item-2', 'item-3', 'item-4', 'item-5'], header: ( - + Available Projects - + ), }, @@ -298,11 +297,11 @@ export const Default: StoryObj = { ), header: ( - + Selected Projects - + ), }, @@ -365,11 +364,11 @@ export const HoveredHandle: StoryObj = { itemIds: ['item-1', 'item-2', 'item-3', 'item-4', 'item-5'], header: ( - + Available Projects - + ), }, @@ -492,11 +491,11 @@ export const HoveredHandle: StoryObj = { ), header: ( - + Selected Projects - + ), }, @@ -520,19 +519,17 @@ const InteractiveDragDrop = () => { itemIds: ['item-1', 'item-2', 'item-3', 'item-4', 'item-5'], header: ( - - - - Available projects - - - + + + Available projects + + Add project - - + + ), }, @@ -543,19 +540,17 @@ const InteractiveDragDrop = () => { itemIds: [], header: ( - - - - Planned projects - - - + + + Planned projects + + Add project - - + + ), }, @@ -566,19 +561,17 @@ const InteractiveDragDrop = () => { itemIds: [], header: ( - - - - Planned projects - - - + + + Planned projects + + Add project - - + + ), }, @@ -589,19 +582,17 @@ const InteractiveDragDrop = () => { itemIds: [], header: ( - - - - Planned projects - - - + + + Planned projects + + Add project - - + + ), }, diff --git a/src/components/DragDrop/__snapshots__/DragDrop.test.ts.snap b/src/components/DragDrop/__snapshots__/DragDrop.test.ts.snap index 14b236126..7f8fb1d7e 100644 --- a/src/components/DragDrop/__snapshots__/DragDrop.test.ts.snap +++ b/src/components/DragDrop/__snapshots__/DragDrop.test.ts.snap @@ -17,7 +17,7 @@ exports[` Default story renders snapshot 1`] = ` > Default story renders snapshot 1`] = ` > HoveredHandle story renders snapshot 1`] = ` > HoveredHandle story renders snapshot 1`] = ` > Interactive story renders snapshot 1`] = ` > - - - Available projects - - + Available projects + Interactive story renders snapshot 1`] = ` > - - - Planned projects - - + Planned projects + Interactive story renders snapshot 1`] = ` > - - - Planned projects - - + Planned projects + Interactive story renders snapshot 1`] = ` > - - - Planned projects - - + Planned projects + - - Left - - - Left - - - Left - - - Right - - > - ), - }, - argTypes: { - children: { - control: { - type: null, - }, - }, - }, -} as Meta; - -type Args = React.ComponentProps; - -export const Default: StoryObj = {}; -export const Bare: StoryObj = { - args: { - variant: 'bare', - }, -}; - -export const AlignTop: StoryObj = { - args: { - verticalAlign: 'top', - }, -}; - -export const AlignBottom: StoryObj = { - args: { - verticalAlign: 'bottom', - }, -}; diff --git a/src/components/Toolbar/Toolbar.test.ts b/src/components/Toolbar/Toolbar.test.ts deleted file mode 100644 index 8f1840ddc..000000000 --- a/src/components/Toolbar/Toolbar.test.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { generateSnapshots } from '@chanzuckerberg/story-utils'; -import * as stories from './Toolbar.stories'; - -describe('', () => { - generateSnapshots(stories); -}); diff --git a/src/components/Toolbar/Toolbar.tsx b/src/components/Toolbar/Toolbar.tsx deleted file mode 100644 index a426c40c9..000000000 --- a/src/components/Toolbar/Toolbar.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import clsx from 'clsx'; -import type { ReactNode } from 'react'; -import React from 'react'; -import ToolbarItem from '../ToolbarItem'; -import styles from './Toolbar.module.css'; - -export interface Props { - /** - * Child node(s) that can be nested inside component - */ - children?: ReactNode; - /** - * CSS class names that can be appended to the component. - */ - className?: string; - /** - * Vertical align - * - **bottom** vertically aligns toolbar items to the bottom of toolbar - * - **top** vertically aligns toolbar items to the top of toolbar - */ - variant?: 'bare'; - /** - * Vertical align: - * - **bottom** vertically aligns t - */ - verticalAlign?: 'bottom' | 'top'; -} - -/** - * `import {Toolbar} from "@chanzuckerberg/eds";` - * - * A container that houses form controls for filtering a data table based on the conditional props passed through. - */ -export const Toolbar = ({ - className, - children, - variant, - verticalAlign, - ...other -}: Props) => { - const componentClassName = clsx( - styles['toolbar'], - variant === 'bare' && styles['toolbar--bare'], - verticalAlign === 'bottom' && styles['toolbar--vertical-align-bottom'], - verticalAlign === 'top' && styles['toolbar--vertical-align-top'], - className, - ); - return ( - - {children} - - ); -}; - -Toolbar.Item = ToolbarItem; diff --git a/src/components/Toolbar/__snapshots__/Toolbar.test.ts.snap b/src/components/Toolbar/__snapshots__/Toolbar.test.ts.snap deleted file mode 100644 index deff1c4eb..000000000 --- a/src/components/Toolbar/__snapshots__/Toolbar.test.ts.snap +++ /dev/null @@ -1,173 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[` AlignBottom story renders snapshot 1`] = ` - - - - Left - - - - - Left - - - - - Left - - - - - Right - - - -`; - -exports[` AlignTop story renders snapshot 1`] = ` - - - - Left - - - - - Left - - - - - Left - - - - - Right - - - -`; - -exports[` Bare story renders snapshot 1`] = ` - - - - Left - - - - - Left - - - - - Left - - - - - Right - - - -`; - -exports[` Default story renders snapshot 1`] = ` - - - - Left - - - - - Left - - - - - Left - - - - - Right - - - -`; diff --git a/src/components/Toolbar/index.ts b/src/components/Toolbar/index.ts deleted file mode 100644 index 44fe9b3fa..000000000 --- a/src/components/Toolbar/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Toolbar as default } from './Toolbar'; diff --git a/src/components/ToolbarItem/ToolbarItem.tsx b/src/components/ToolbarItem/ToolbarItem.tsx deleted file mode 100644 index cd0f7777f..000000000 --- a/src/components/ToolbarItem/ToolbarItem.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import clsx from 'clsx'; -import type { ReactNode } from 'react'; -import React from 'react'; -import styles from '../Toolbar/Toolbar.module.css'; - -export interface Props { - /** - * Align variations: - * - **center** yields a ToolbarItem that appears centered within the Toolbar container - * - **right** yields a ToolbarItem that appears right-aligned within the Toolbar container - */ - align?: 'center' | 'right'; - /** - * Child node(s) that can be nested inside component - */ - children: ReactNode; - /** - * CSS class names that can be appended to the component. - */ - className?: string; -} - -/** - * `import {ToolbarItem} from "@chanzuckerberg/eds";` - * - * Used in the Toolbar component to filter the content based on alignment. - */ -export const ToolbarItem = ({ - align, - className, - children, - ...other -}: Props) => { - const componentClassName = clsx( - 'toolbar__item', - align === 'center' && styles['toolbar__item--align-center'], - align === 'right' && styles['toolbar__item--align-right'], - className, - ); - return ( - - {children} - - ); -}; diff --git a/src/components/ToolbarItem/index.ts b/src/components/ToolbarItem/index.ts deleted file mode 100644 index e7115632d..000000000 --- a/src/components/ToolbarItem/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { ToolbarItem as default } from './ToolbarItem'; diff --git a/src/index.ts b/src/index.ts index 8630dfeef..3883e1a7b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -93,8 +93,6 @@ export { default as TextareaField } from './components/TextareaField'; export { default as TimelineNav } from './components/TimelineNav'; export { default as Toast } from './components/Toast'; export { default as Toggle } from './components/Toggle'; -export { default as Toolbar } from './components/Toolbar'; -export { default as ToolbarItem } from './components/ToolbarItem'; export { default as Tooltip } from './components/Tooltip'; /**