-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For #25349 This updates storybook and its addons to 8.4.7. This is done to remove the transitive dependency on path-to-regexp, which is no longer used in this version of storybook. This will fix the original vulnerability issue for `path-to-regexp`
- Loading branch information
1 parent
ba665d2
commit 8168ff3
Showing
22 changed files
with
2,157 additions
and
5,161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
export const parameters = { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
} | ||
}; | ||
export const tags = ["autodocs"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
import React from "react"; | ||
import { Meta, Story } from "@storybook/react"; | ||
import { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import InfoBanner from "."; | ||
import { IInfoBannerProps } from "./InfoBanner"; | ||
|
||
import "../../index.scss"; | ||
|
||
export default { | ||
const meta: Meta<typeof InfoBanner> = { | ||
component: InfoBanner, | ||
title: "Components/InfoBanner", | ||
} as Meta; | ||
}; | ||
|
||
const Template: Story<IInfoBannerProps> = (props) => ( | ||
<InfoBanner {...props}> | ||
<div>This is an Info Banner.</div> | ||
</InfoBanner> | ||
); | ||
export default meta; | ||
|
||
export const Default = Template.bind({}); | ||
type Story = StoryObj<typeof InfoBanner>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
children: <div>This is an Info Banner.</div>, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,34 @@ | ||
import React from "react"; | ||
import { Meta, Story } from "@storybook/react"; | ||
import { Meta, StoryObj } from "@storybook/react"; | ||
import { noop } from "lodash"; | ||
|
||
import Modal from "."; | ||
import { IModalProps } from "./Modal"; | ||
|
||
import "../../index.scss"; | ||
|
||
export default { | ||
const meta: Meta<typeof Modal> = { | ||
component: Modal, | ||
title: "Components/Modal", | ||
args: { | ||
title: "Test modal", | ||
className: "", | ||
onExit: noop, | ||
}, | ||
} as Meta; | ||
}; | ||
|
||
const Template: Story<IModalProps> = (props) => ( | ||
<Modal {...props}> | ||
<div>This is a test description with lots of information.</div> | ||
</Modal> | ||
); | ||
export default meta; | ||
|
||
export const Default = Template.bind({}); | ||
type Story = StoryObj<typeof Modal>; | ||
|
||
export const Default: Story = { | ||
decorators: [ | ||
(Story) => ( | ||
<div style={{ height: "300px" }}> | ||
<Story /> | ||
</div> | ||
), | ||
], | ||
args: { | ||
children: <div>This is a test description with lots of information.</div>, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,66 @@ | ||
/* eslint-disable no-alert */ | ||
import React from "react"; | ||
import { Meta, Story } from "@storybook/react"; | ||
import { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import Button from "components/buttons/Button"; | ||
import Icon from "components/Icon"; | ||
import ActionsDropdown from "components/ActionsDropdown"; | ||
import ModalFooter from "./ModalFooter"; | ||
|
||
export default { | ||
const meta: Meta<typeof ModalFooter> = { | ||
title: "Components/ModalFooter", | ||
component: ModalFooter, | ||
} as Meta; | ||
}; | ||
|
||
export default meta; | ||
|
||
const Template: Story = (args) => ( | ||
<ModalFooter primaryButtons={<></>} {...args} /> | ||
); | ||
type Story = StoryObj<typeof ModalFooter>; | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = { | ||
primaryButtons: ( | ||
<> | ||
<ActionsDropdown | ||
className="modal-footer__manage-automations-dropdown" | ||
onChange={(value) => alert(`Selected action: ${value}`)} | ||
placeholder="More actions" | ||
isSearchable={false} | ||
options={[ | ||
{ value: "action1", label: "Action 1" }, | ||
{ value: "action2", label: "Action 2" }, | ||
]} | ||
menuPlacement="top" | ||
/> | ||
<Button onClick={() => alert("Done clicked")} variant="brand"> | ||
Done | ||
</Button> | ||
</> | ||
), | ||
secondaryButtons: ( | ||
<> | ||
<Button variant="icon" onClick={() => alert("Download clicked")}> | ||
<Icon name="download" /> | ||
</Button> | ||
<Button variant="icon" onClick={() => alert("Delete clicked")}> | ||
<Icon name="trash" color="ui-fleet-black-75" /> | ||
</Button> | ||
</> | ||
), | ||
isTopScrolling: false, | ||
export const Default: Story = { | ||
args: { | ||
primaryButtons: ( | ||
<> | ||
<ActionsDropdown | ||
className="modal-footer__manage-automations-dropdown" | ||
onChange={(value) => alert(`Selected action: ${value}`)} | ||
placeholder="More actions" | ||
isSearchable={false} | ||
options={[ | ||
{ value: "action1", label: "Action 1" }, | ||
{ value: "action2", label: "Action 2" }, | ||
]} | ||
menuPlacement="top" | ||
/> | ||
<Button onClick={() => alert("Done clicked")} variant="brand"> | ||
Done | ||
</Button> | ||
</> | ||
), | ||
secondaryButtons: ( | ||
<> | ||
<Button variant="icon" onClick={() => alert("Download clicked")}> | ||
<Icon name="download" /> | ||
</Button> | ||
<Button variant="icon" onClick={() => alert("Delete clicked")}> | ||
<Icon name="trash" color="ui-fleet-black-75" /> | ||
</Button> | ||
</> | ||
), | ||
isTopScrolling: false, | ||
}, | ||
}; | ||
|
||
export const WithTopScrolling = Template.bind({}); | ||
WithTopScrolling.args = { | ||
...Default.args, | ||
isTopScrolling: true, | ||
export const WithTopScrolling: Story = { | ||
args: { | ||
...Default.args, | ||
isTopScrolling: true, | ||
}, | ||
}; | ||
|
||
export const WithoutSecondaryButtons = Template.bind({}); | ||
WithoutSecondaryButtons.args = { | ||
primaryButtons: Default.args.primaryButtons, | ||
secondaryButtons: undefined, | ||
isTopScrolling: false, | ||
export const WithoutSecondaryButtons: Story = { | ||
args: { | ||
primaryButtons: Default.args?.primaryButtons, | ||
secondaryButtons: undefined, | ||
isTopScrolling: false, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.