2021-12-08 12:17:49 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2022-11-02 16:46:14 +00:00
|
|
|
import type { Story, Meta } from '@storybook/react';
|
2021-12-08 12:17:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import Chip, { ChipProps } from '../chip';
|
|
|
|
const availableElements = [ 'li', 'div', 'span' ];
|
|
|
|
const availableRadii = [ 'none', 'small', 'medium', 'large' ];
|
|
|
|
|
|
|
|
export default {
|
2023-11-08 11:13:49 +00:00
|
|
|
title: 'External Components/Chip',
|
2021-12-08 12:17:49 +00:00
|
|
|
component: Chip,
|
|
|
|
argTypes: {
|
|
|
|
element: {
|
|
|
|
control: 'radio',
|
|
|
|
options: availableElements,
|
|
|
|
},
|
|
|
|
className: {
|
|
|
|
control: 'text',
|
|
|
|
},
|
|
|
|
radius: {
|
|
|
|
control: 'radio',
|
|
|
|
options: availableRadii,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
} as Meta< ChipProps >;
|
|
|
|
|
|
|
|
const Template: Story< ChipProps > = ( args ) => <Chip { ...args } />;
|
|
|
|
|
|
|
|
export const Default = Template.bind( {} );
|
|
|
|
Default.args = {
|
|
|
|
element: 'li',
|
|
|
|
text: 'Take me to the casino!',
|
|
|
|
screenReaderText: "I'm a chip, me",
|
|
|
|
};
|