mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 13:37:30 +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`
69 lines
1.3 KiB
TypeScript
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,
|
|
},
|
|
};
|