mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
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`
66 lines
1.7 KiB
TypeScript
66 lines
1.7 KiB
TypeScript
/* eslint-disable no-alert */
|
|
import React from "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";
|
|
|
|
const meta: Meta<typeof ModalFooter> = {
|
|
title: "Components/ModalFooter",
|
|
component: ModalFooter,
|
|
};
|
|
|
|
export default meta;
|
|
|
|
type Story = StoryObj<typeof ModalFooter>;
|
|
|
|
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: Story = {
|
|
args: {
|
|
...Default.args,
|
|
isTopScrolling: true,
|
|
},
|
|
};
|
|
|
|
export const WithoutSecondaryButtons: Story = {
|
|
args: {
|
|
primaryButtons: Default.args?.primaryButtons,
|
|
secondaryButtons: undefined,
|
|
isTopScrolling: false,
|
|
},
|
|
};
|