Skip to content

Commit

Permalink
chore: remove toolbar as being developed in upstream primer
Browse files Browse the repository at this point in the history
  • Loading branch information
echarles committed May 20, 2024
1 parent 16409e5 commit 315a70f
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 172 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
"styled-components": "^5.3.10"
},
"devDependencies": {
"@storybook/addon-essentials": "^7.0.9",
"@storybook/addon-interactions": "^7.0.9",
"@storybook/addon-links": "^7.0.9",
"@storybook/blocks": "^7.0.9",
"@storybook/react": "^7.0.9",
"@storybook/react-vite": "^7.0.9",
"@storybook/testing-library": "^0.0.14-next.2",
"@storybook/addon-essentials": "^8.0.10",
"@storybook/addon-interactions": "^8.0.10",
"@storybook/addon-links": "^8.0.10",
"@storybook/blocks": "^8.0.10",
"@storybook/react": "^8.0.10",
"@storybook/react-vite": "^8.0.10",
"@storybook/testing-library": "^0.2.2",
"@types/react": "^18.2.12",
"@types/react-dom": "^18.2.5",
"@typescript-eslint/eslint-plugin": "^5.57.1",
Expand All @@ -49,7 +49,7 @@
"eslint-plugin-react-refresh": "^0.3.4",
"eslint-plugin-storybook": "^0.6.12",
"prop-types": "^15.8.1",
"storybook": "^7.0.9",
"storybook": "^8.0.10",
"typescript": "^5.0.2",
"vite": "^5.2.7"
}
Expand Down
8 changes: 4 additions & 4 deletions src/components/card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type CardProps = Omit<BoxProps, 'border'> & {
export type CardHeaderProps = {
title?: string;
description?: string;
leadingIcon?: React.ElementType;
leadingVisual?: React.ElementType;
action?: React.ReactNode;
}

Expand Down Expand Up @@ -78,10 +78,10 @@ export const Card: React.FC<CardProps> & {
};

Card.Header = (props) => {
const { title, description, leadingIcon, action } = props;
const { title, description, leadingVisual, action } = props;
return <Box display="flex" alignItems="center" sx={{p: 3}}>
{leadingIcon && <Box sx={{mr: 3}}>
<Octicon size="medium" icon={leadingIcon} />
{leadingVisual && <Box sx={{mr: 3}}>
<Octicon size="medium" icon={leadingVisual} />
</Box>}
<Box sx={{flexGrow: 1}}>
<Text display="block">{title}</Text>
Expand Down
6 changes: 3 additions & 3 deletions src/components/card/stories/Card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const CardDay: Story = {
},
render: (args) => <ThemedCard {...args} colorMode="day">
<Card.Header
leadingIcon={ProjectIcon}
leadingVisual={ProjectIcon}
title="Shrimp and Chorizo Paella"
description="September 14, 2016"
action={<IconButton aria-label="Menu" onClick={() => alert("Menu")} icon={ThreeBarsIcon} />}
Expand Down Expand Up @@ -87,7 +87,7 @@ export const CardDaySvg: Story = {
},
render: (args) => <ThemedCard {...args} colorMode="day">
<Card.Header
leadingIcon={ProjectIcon}
leadingVisual={ProjectIcon}
title="Shrimp and Chorizo Paella"
description="September 14, 2016"
action={<IconButton aria-label="Menu" onClick={() => alert("Menu")} icon={ThreeBarsIcon} />}
Expand Down Expand Up @@ -117,7 +117,7 @@ export const CardNight: Story = {
},
render: (args) => <ThemedCard {...args} colorMode="night">
<Card.Header
leadingIcon={ProjectIcon}
leadingVisual={ProjectIcon}
title="Shrimp and Chorizo Paella"
description="September 14, 2016"
action={<IconButton aria-label="Menu" onClick={() => alert("Menu")} icon={ThreeBarsIcon} />}
Expand Down
6 changes: 3 additions & 3 deletions src/components/closeable-flash/CloseableFlash.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { Box, Flash, FlashProps, Octicon, Text } from "@primer/react";
import { XIcon } from "@primer/octicons-react";

export type CloseableFlashProps = FlashProps & {
leadingIcon?: React.ElementType;
leadingVisual?: React.ElementType;
onClose?: () => void;
}

export const CloseableFlash: FC<CloseableFlashProps> = (props) => {
const {leadingIcon, variant, onClose, ...otherProps} = props;
const {leadingVisual, variant, onClose, ...otherProps} = props;
const [isVisible, setIsVisible] = useState(true);
const handleClose = () => {
if (onClose) {
Expand All @@ -23,7 +23,7 @@ export const CloseableFlash: FC<CloseableFlashProps> = (props) => {
<Flash variant={variant} {...otherProps}>
<Box display="flex" justifyContent="space-between" alignItems="center">
<Box sx={{ flexGrow: 1 }}>
{leadingIcon && <Octicon icon={leadingIcon} />}
{leadingVisual && <Octicon icon={leadingVisual} />}
<Text color={`${variant === "default" ? "accent" : (variant === "warning" ? "attention" : variant)}.fg`}>{props.children}</Text>
</Box>
<Box onClick={handleClose} sx={{cursor: "pointer"}}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const ThemedCloseableFlash = (props: {colorMode?: ThemeProviderProps["colorMode"
export const CloseableFlashDay: Story = {
args: {
variant: "success",
leadingIcon: CheckIcon,
leadingVisual: CheckIcon,
onClose: () => window.alert("closed")
},
render: (args) => <ThemedCloseableFlash {...args} colorMode="day">Success Flash</ThemedCloseableFlash>
Expand All @@ -49,7 +49,7 @@ export const CloseableFlashDay: Story = {
export const CloseableFlashNight: Story = {
args: {
variant: "success",
leadingIcon: CheckIcon,
leadingVisual: CheckIcon,
onClose: () => window.alert("closed")
},
render: (args) => <ThemedCloseableFlash {...args} colorMode="night">Success Flash</ThemedCloseableFlash>
Expand Down
66 changes: 0 additions & 66 deletions src/components/toolbar/Toolbar.tsx

This file was deleted.

85 changes: 0 additions & 85 deletions src/components/toolbar/stories/Toolbar.stories.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ export * from "./components/closeable-flash/CloseableFlash";
export * from "./components/icons/CircleIcon";
export * from "./components/overlay/Overlay";
export * from "./components/slider/Slider";
export * from "./components/toolbar/Toolbar";

0 comments on commit 315a70f

Please sign in to comment.