mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 09:28:54 +00:00
* added storybook * added avatar component * added button story * added dropdown button story * removed unused ellipsis component * cleaned up modal path * reorganized enroll secrets table file * added flash story; removed unused persistent flash * added fleet ace story * added checkbox story * added dropdown story * added input story * fixed storybook build * fixed avatar * added input with icon story * added radio button story * added select targets dropdown story * added slider story * added tooltip story * added info banner story * removed unused loaders; added spinner story * added modal story * removed unused NumberPill * added pagination story * lint fixes * added documentation to run * modified documentation * fixed corelayout test * fixed format for date-fns * fixed date format that breaks tests * wait for page
59 lines
1.2 KiB
TypeScript
59 lines
1.2 KiB
TypeScript
import React from "react";
|
|
import { Meta, Story } from "@storybook/react";
|
|
import { noop } from "lodash";
|
|
|
|
import Button from ".";
|
|
import { IButtonProps } from "./Button";
|
|
|
|
import "../../../index.scss";
|
|
|
|
export default {
|
|
component: Button,
|
|
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",
|
|
],
|
|
control: "select",
|
|
},
|
|
type: {
|
|
options: ["button", "submit", "reset"],
|
|
control: "select",
|
|
},
|
|
},
|
|
args: {
|
|
autofocus: false,
|
|
className: "",
|
|
size: "",
|
|
tabIndex: 0,
|
|
title: "",
|
|
onClick: noop,
|
|
},
|
|
} as Meta;
|
|
|
|
const Template: Story<IButtonProps> = (props) => (
|
|
<Button {...props}>Click Here</Button>
|
|
);
|
|
|
|
export const Default = Template.bind({});
|
|
Default.args = { variant: "brand", type: "button" };
|
|
|
|
export const Disabled = Template.bind({});
|
|
Disabled.args = { ...Default.args, disabled: true };
|