fleet/frontend/components/buttons/Button/Button.stories.tsx
Gabriel Hernandez 8168ff3655
update storybook to 8.4.7 (#25451)
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`
2025-01-20 16:17:33 +00:00

69 lines
1.3 KiB
TypeScript

import { Meta, StoryObj } from "@storybook/react";
import { noop } from "lodash";
import Button from ".";
import "../../../index.scss";
const meta: Meta<typeof Button> = {
// TODO: change this after button is updated to a functional component. For
// some reason the typing is incorrect becuase Button is a class component.
component: Button as any,
title: "Components/Button",
argTypes: {
variant: {
options: [
"brand",
"success",
"alert",
"blue-green",
"grey",
"warning",
"link",
"label",
"text-link",
"text-icon",
"inverse",
"inverse-alert",
"block",
"unstyled",
"unstyled-modal-query",
"contextual-nav-item",
"small-text-icon",
"oversized",
],
control: "select",
},
type: {
options: ["button", "submit", "reset"],
control: "select",
},
},
args: {
autofocus: false,
className: "",
size: "",
tabIndex: 0,
title: "",
onClick: noop,
},
};
export default meta;
type Story = StoryObj<typeof Button>;
export const Default: Story = {
args: {
variant: "brand",
type: "button",
children: "Click Here",
},
};
export const Disabled: Story = {
args: {
...Default.args,
disabled: true,
},
};