Skip to content

Commit 315a70f

Browse files
committed
chore: remove toolbar as being developed in upstream primer
1 parent 16409e5 commit 315a70f

File tree

8 files changed

+20
-172
lines changed

8 files changed

+20
-172
lines changed

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
"styled-components": "^5.3.10"
3333
},
3434
"devDependencies": {
35-
"@storybook/addon-essentials": "^7.0.9",
36-
"@storybook/addon-interactions": "^7.0.9",
37-
"@storybook/addon-links": "^7.0.9",
38-
"@storybook/blocks": "^7.0.9",
39-
"@storybook/react": "^7.0.9",
40-
"@storybook/react-vite": "^7.0.9",
41-
"@storybook/testing-library": "^0.0.14-next.2",
35+
"@storybook/addon-essentials": "^8.0.10",
36+
"@storybook/addon-interactions": "^8.0.10",
37+
"@storybook/addon-links": "^8.0.10",
38+
"@storybook/blocks": "^8.0.10",
39+
"@storybook/react": "^8.0.10",
40+
"@storybook/react-vite": "^8.0.10",
41+
"@storybook/testing-library": "^0.2.2",
4242
"@types/react": "^18.2.12",
4343
"@types/react-dom": "^18.2.5",
4444
"@typescript-eslint/eslint-plugin": "^5.57.1",
@@ -49,7 +49,7 @@
4949
"eslint-plugin-react-refresh": "^0.3.4",
5050
"eslint-plugin-storybook": "^0.6.12",
5151
"prop-types": "^15.8.1",
52-
"storybook": "^7.0.9",
52+
"storybook": "^8.0.10",
5353
"typescript": "^5.0.2",
5454
"vite": "^5.2.7"
5555
}

src/components/card/Card.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export type CardProps = Omit<BoxProps, 'border'> & {
1010
export type CardHeaderProps = {
1111
title?: string;
1212
description?: string;
13-
leadingIcon?: React.ElementType;
13+
leadingVisual?: React.ElementType;
1414
action?: React.ReactNode;
1515
}
1616

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

8080
Card.Header = (props) => {
81-
const { title, description, leadingIcon, action } = props;
81+
const { title, description, leadingVisual, action } = props;
8282
return <Box display="flex" alignItems="center" sx={{p: 3}}>
83-
{leadingIcon && <Box sx={{mr: 3}}>
84-
<Octicon size="medium" icon={leadingIcon} />
83+
{leadingVisual && <Box sx={{mr: 3}}>
84+
<Octicon size="medium" icon={leadingVisual} />
8585
</Box>}
8686
<Box sx={{flexGrow: 1}}>
8787
<Text display="block">{title}</Text>

src/components/card/stories/Card.stories.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const CardDay: Story = {
5050
},
5151
render: (args) => <ThemedCard {...args} colorMode="day">
5252
<Card.Header
53-
leadingIcon={ProjectIcon}
53+
leadingVisual={ProjectIcon}
5454
title="Shrimp and Chorizo Paella"
5555
description="September 14, 2016"
5656
action={<IconButton aria-label="Menu" onClick={() => alert("Menu")} icon={ThreeBarsIcon} />}
@@ -87,7 +87,7 @@ export const CardDaySvg: Story = {
8787
},
8888
render: (args) => <ThemedCard {...args} colorMode="day">
8989
<Card.Header
90-
leadingIcon={ProjectIcon}
90+
leadingVisual={ProjectIcon}
9191
title="Shrimp and Chorizo Paella"
9292
description="September 14, 2016"
9393
action={<IconButton aria-label="Menu" onClick={() => alert("Menu")} icon={ThreeBarsIcon} />}
@@ -117,7 +117,7 @@ export const CardNight: Story = {
117117
},
118118
render: (args) => <ThemedCard {...args} colorMode="night">
119119
<Card.Header
120-
leadingIcon={ProjectIcon}
120+
leadingVisual={ProjectIcon}
121121
title="Shrimp and Chorizo Paella"
122122
description="September 14, 2016"
123123
action={<IconButton aria-label="Menu" onClick={() => alert("Menu")} icon={ThreeBarsIcon} />}

src/components/closeable-flash/CloseableFlash.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { Box, Flash, FlashProps, Octicon, Text } from "@primer/react";
33
import { XIcon } from "@primer/octicons-react";
44

55
export type CloseableFlashProps = FlashProps & {
6-
leadingIcon?: React.ElementType;
6+
leadingVisual?: React.ElementType;
77
onClose?: () => void;
88
}
99

1010
export const CloseableFlash: FC<CloseableFlashProps> = (props) => {
11-
const {leadingIcon, variant, onClose, ...otherProps} = props;
11+
const {leadingVisual, variant, onClose, ...otherProps} = props;
1212
const [isVisible, setIsVisible] = useState(true);
1313
const handleClose = () => {
1414
if (onClose) {
@@ -23,7 +23,7 @@ export const CloseableFlash: FC<CloseableFlashProps> = (props) => {
2323
<Flash variant={variant} {...otherProps}>
2424
<Box display="flex" justifyContent="space-between" alignItems="center">
2525
<Box sx={{ flexGrow: 1 }}>
26-
{leadingIcon && <Octicon icon={leadingIcon} />}
26+
{leadingVisual && <Octicon icon={leadingVisual} />}
2727
<Text color={`${variant === "default" ? "accent" : (variant === "warning" ? "attention" : variant)}.fg`}>{props.children}</Text>
2828
</Box>
2929
<Box onClick={handleClose} sx={{cursor: "pointer"}}>

src/components/closeable-flash/stories/CloseableFlash.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const ThemedCloseableFlash = (props: {colorMode?: ThemeProviderProps["colorMode"
4040
export const CloseableFlashDay: Story = {
4141
args: {
4242
variant: "success",
43-
leadingIcon: CheckIcon,
43+
leadingVisual: CheckIcon,
4444
onClose: () => window.alert("closed")
4545
},
4646
render: (args) => <ThemedCloseableFlash {...args} colorMode="day">Success Flash</ThemedCloseableFlash>
@@ -49,7 +49,7 @@ export const CloseableFlashDay: Story = {
4949
export const CloseableFlashNight: Story = {
5050
args: {
5151
variant: "success",
52-
leadingIcon: CheckIcon,
52+
leadingVisual: CheckIcon,
5353
onClose: () => window.alert("closed")
5454
},
5555
render: (args) => <ThemedCloseableFlash {...args} colorMode="night">Success Flash</ThemedCloseableFlash>

src/components/toolbar/Toolbar.tsx

Lines changed: 0 additions & 66 deletions
This file was deleted.

src/components/toolbar/stories/Toolbar.stories.tsx

Lines changed: 0 additions & 85 deletions
This file was deleted.

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ export * from "./components/closeable-flash/CloseableFlash";
44
export * from "./components/icons/CircleIcon";
55
export * from "./components/overlay/Overlay";
66
export * from "./components/slider/Slider";
7-
export * from "./components/toolbar/Toolbar";

0 commit comments

Comments
 (0)