/* eslint-disable react/prop-types */ import {Fragment} from 'react'; import styled from '@emotion/styled'; import {action} from '@storybook/addon-actions'; import Button from 'sentry/components/button'; import ButtonBar from 'sentry/components/buttonBar'; import DropdownButton from 'sentry/components/dropdownButton'; import DropdownLink from 'sentry/components/dropdownLink'; import NavigationButtonGroup from 'sentry/components/navigationButtonGroup'; import {IconDelete} from 'sentry/icons/iconDelete'; const Item = styled('span')` padding: 12px; `; const WideButton = styled(Button)` width: 200px; `; export default { title: 'Components/Buttons', component: Button, }; export const _Button = ({icon, onClick, ...args}) => ( ); _Button.args = { title: 'title', priority: undefined, size: undefined, borderless: false, translucentBorder: false, icon: false, busy: false, disabled: false, }; _Button.argTypes = { priority: { control: { type: 'select', options: ['default', 'primary', 'danger', 'link', 'form'], }, }, size: { control: { type: 'select', options: ['zero', 'xs', 'sm', 'md'], }, }, }; export const Overview = ({busy}) => (

Priorities

Sizes

Icons

Alignment

Aligned left Aligned right

States (busy/disabled)

); Overview.storyName = 'Overview'; Overview.args = { busy: true, }; Overview.parameters = { docs: { description: { story: 'An overview of all the different buttons and states', }, }, }; export const _DropdownButton = () => ( Closed Open ); _DropdownButton.storyName = 'Dropdown Button'; _DropdownButton.parameters = { docs: { description: { story: 'A button meant to be used with some sort of dropdown', }, }, }; export const _ButtonBar = ({gap}) => (

With a Gap

Merged Buttons with "active" button

Multiple Merged Buttons with "active" button

Works with DropdownLink

First DropdownLink} /> Second DropdownLink} /> Third DropdownLink} /> Second DropdownLink} /> First DropdownLink} /> Third DropdownLink} />
); _ButtonBar.storyName = 'Button Bar'; _ButtonBar.args = { /** Button gap */ gap: 1, }; _ButtonBar.argTypes = { gap: { control: { type: 'select', options: [0.25, 0.5, 0.75, 1, 1.5, 2, 3, 4], }, }, }; _ButtonBar.parameters = { docs: { description: { story: 'Buttons in a Bar container', }, }, }; export const _NavigationButtonGroup = () => ( ); _NavigationButtonGroup.storyName = 'Navigation Button Group'; _NavigationButtonGroup.info = 'Navigation Buttons Group'; const StartButtonBar = styled(ButtonBar)` justify-content: flex-start; margin-bottom: 6px; `;