fix(security): Removed dependency on tar-fs by removing dependencies on storybook and sharp. (#5438)
This commit is contained in:
1 parent
a6408d6033
commit
80f314a422
28 files changed
+429
-5124
No files matched your search
@@ -1,171 +0,0 @@
|
||||
import { Button, ButtonEnums } from '../../../components';
|
||||
import { ArgsTable, Story, Canvas, Meta } from '@storybook/addon-docs';
|
||||
import {
|
||||
createComponentTemplate,
|
||||
createStoryMetaSettings,
|
||||
} from '../../../storybook/functions/create-component-story';
|
||||
|
||||
export const argTypes = {
|
||||
component: Button,
|
||||
title: 'Components/Button',
|
||||
};
|
||||
|
||||
<Meta
|
||||
title="Components/Button"
|
||||
component={Button}
|
||||
/>
|
||||
|
||||
export const buttonTemplate = createComponentTemplate(Button);
|
||||
|
||||
<Heading
|
||||
title="Button"
|
||||
componentRelativePath="Button/Button.tsx"
|
||||
/>
|
||||
|
||||
- [Overview](#overview)
|
||||
- [Props](#props)
|
||||
- [Usage](#usage)
|
||||
- [Contribute](#contribute)
|
||||
|
||||
## Overview
|
||||
|
||||
You can use the button component to create a button. It can be used in different ways, the default
|
||||
button is a simple button with text.
|
||||
|
||||
<Canvas>
|
||||
<Story
|
||||
name="Overview"
|
||||
args={{ children: 'Button', color: 'default' }}
|
||||
>
|
||||
{buttonTemplate.bind({})}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Props
|
||||
|
||||
<ArgsTable of={Button} />
|
||||
|
||||
## Usage
|
||||
|
||||
### Types
|
||||
|
||||
There can be different types of buttons: `primary`, and `secondary`.
|
||||
|
||||
<Canvas>
|
||||
<Story name="Types">
|
||||
<div className="flex space-x-2">
|
||||
<Button type={ButtonEnums.type.primary}>Primary Button</Button>
|
||||
<Button type={ButtonEnums.type.secondary}>Secondary Button</Button>
|
||||
</div>
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
### Sizes
|
||||
|
||||
There are different sizes for the button: `small`, and `medium`. The size refers to the button's
|
||||
height.
|
||||
|
||||
<Canvas>
|
||||
<Story name="Sizes">
|
||||
<div className="flex items-center space-x-2">
|
||||
<Button size={ButtonEnums.size.small}>Small Button</Button>
|
||||
<Button size={ButtonEnums.size.medium}>Medium Button</Button>
|
||||
</div>
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
### Mixing props
|
||||
|
||||
You can mix different props together to create a button.
|
||||
|
||||
<Canvas>
|
||||
<Story name="Custom">
|
||||
<Button
|
||||
type={ButtonEnums.type.secondary}
|
||||
size={ButtonEnums.size.small}
|
||||
>
|
||||
Small, Secondary Button
|
||||
</Button>
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
### Disabled
|
||||
|
||||
You can disable the button by setting the `disabled` property to true.
|
||||
|
||||
<Canvas>
|
||||
<Story name="Disabled">
|
||||
<Button disabled={true}>Disabled Button</Button>
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
### Start/End Icons
|
||||
|
||||
You can add an icon to the start of the button. It accepts an icon component.
|
||||
|
||||
<Canvas>
|
||||
<Story name="Start Icon">
|
||||
{() => {
|
||||
// svg icon for github
|
||||
const Github = () => {
|
||||
return (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
className="feather feather-github"
|
||||
>
|
||||
<path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path>
|
||||
</svg>
|
||||
);
|
||||
};
|
||||
return <Button startIcon={<Github />}>Start Icon Button</Button>;
|
||||
}}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
End Icon is the same as start icon, but for the end of the button.
|
||||
|
||||
<Canvas>
|
||||
<Story name="End Icon">
|
||||
{() => {
|
||||
// svg icon for github
|
||||
const Github = () => {
|
||||
return (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
className="feather feather-github"
|
||||
>
|
||||
<path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path>
|
||||
</svg>
|
||||
);
|
||||
};
|
||||
return (
|
||||
<Button
|
||||
startIcon={<Github />}
|
||||
endIcon={<Github />}
|
||||
>
|
||||
Start and End Icon Button
|
||||
</Button>
|
||||
);
|
||||
}}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Contribute
|
||||
|
||||
<Footer componentRelativePath="Button/__stories__/button.stories.mdx" />
|
||||
@@ -1,55 +0,0 @@
|
||||
import { Button, ButtonGroup, ButtonEnums } from '../../../components';
|
||||
|
||||
import { ArgsTable, Story, Canvas, Meta } from '@storybook/addon-docs';
|
||||
import {
|
||||
createComponentTemplate,
|
||||
createStoryMetaSettings,
|
||||
} from '../../../storybook/functions/create-component-story';
|
||||
|
||||
export const argTypes = {
|
||||
component: ButtonGroup,
|
||||
title: 'Components/ButtonGroup',
|
||||
};
|
||||
|
||||
<Meta
|
||||
title="Components/ButtonGroup"
|
||||
component={ButtonGroup}
|
||||
/>
|
||||
|
||||
<Heading
|
||||
title="ButtonGroup"
|
||||
componentRelativePath="ButtonGroup/ButtonGroup.tsx"
|
||||
/>
|
||||
|
||||
- [Overview](#overview)
|
||||
- [Props](#props)
|
||||
- [Usage](#usage)
|
||||
- [Contribute](#contribute)
|
||||
|
||||
## Overview
|
||||
|
||||
ButtonGroup is a container for a group of buttons.
|
||||
|
||||
<Canvas>
|
||||
<Story name="Overview">
|
||||
<ButtonGroup
|
||||
orientation={ButtonEnums.orientation.horizontal}
|
||||
activeIndex={0}
|
||||
onActiveIndexChange={index => console.log(index)}
|
||||
>
|
||||
<button onClick={() => console.log('Button 1111 clicked')}>Button 1</button>
|
||||
<button onClick={() => console.log('Button 222 clicked')}>Button 2</button>
|
||||
<button onClick={() => console.log('Button 33 clicked')}>Button 3</button>
|
||||
</ButtonGroup>
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Props
|
||||
|
||||
<ArgsTable of={ButtonGroup} />
|
||||
|
||||
## Usage
|
||||
|
||||
## Contribute
|
||||
|
||||
<Footer componentRelativePath="ButtonGroup/__stories__/buttonGroup.stories.mdx" />
|
||||
@@ -1,65 +0,0 @@
|
||||
import ContextMenu from '../ContextMenu';
|
||||
import { ArgsTable, Story, Canvas, Meta } from '@storybook/addon-docs';
|
||||
import { createComponentTemplate } from '../../../storybook/functions/create-component-story';
|
||||
|
||||
export const argTypes = {
|
||||
component: ContextMenu,
|
||||
title: 'Modals/ContextMenu',
|
||||
};
|
||||
|
||||
<Meta
|
||||
title="Modals/ContextMenu"
|
||||
component={ContextMenu}
|
||||
/>
|
||||
|
||||
export const contextMenueTemplate = createComponentTemplate(ContextMenu);
|
||||
|
||||
<Heading
|
||||
title="ContextMenu"
|
||||
componentRelativePath="ContextMenu/ContextMenu.tsx"
|
||||
/>
|
||||
|
||||
- [Overview](#overview)
|
||||
- [Props](#props)
|
||||
- [Contribute](#contribute)
|
||||
|
||||
## Overview
|
||||
|
||||
Context Menu is a component that is used to display a list of options to the user. This component
|
||||
can be used for use cases such as opening a list of options on user right click.
|
||||
|
||||
<Canvas>
|
||||
<Story
|
||||
name="Overview"
|
||||
args={{
|
||||
items: [
|
||||
{
|
||||
label: 'Delete measurement',
|
||||
actionType: 'Delete',
|
||||
action: item => {
|
||||
window.alert(`${item.label} clicked`);
|
||||
},
|
||||
value: {},
|
||||
},
|
||||
{
|
||||
label: 'Add Label',
|
||||
actionType: 'setLabel',
|
||||
action: item => {
|
||||
window.alert(`${item.label} clicked`);
|
||||
},
|
||||
value: {},
|
||||
},
|
||||
],
|
||||
}}
|
||||
>
|
||||
{contextMenueTemplate.bind({})}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Props
|
||||
|
||||
<ArgsTable of={ContextMenu} />
|
||||
|
||||
## Contribute
|
||||
|
||||
<Footer componentRelativePath="ContextMenu/__stories__/contextMenu.stories.mdx" />
|
||||
@@ -1,97 +0,0 @@
|
||||
import Icon from '../Icon';
|
||||
import { ICONS } from '../getIcon';
|
||||
|
||||
import { ArgsTable, Story, Canvas, Meta } from '@storybook/addon-docs';
|
||||
import { createComponentTemplate } from '../../../storybook/functions/create-component-story';
|
||||
|
||||
export const argTypes = {
|
||||
component: Icon,
|
||||
title: 'Components/Icon',
|
||||
};
|
||||
|
||||
<Meta
|
||||
title="Components/Icon"
|
||||
component={Icon}
|
||||
/>
|
||||
|
||||
export const IconTemplate = args => (
|
||||
// Todo: Icon colors
|
||||
<div className="h-8 w-8">
|
||||
<Icon {...args} />
|
||||
</div>
|
||||
);
|
||||
|
||||
<Heading
|
||||
title="Icon"
|
||||
componentRelativePath="Icon/Icon.tsx"
|
||||
/>
|
||||
|
||||
- [Overview](#overview)
|
||||
- [Props](#props)
|
||||
- [Usage](#usage)
|
||||
- [Contribute](#contribute)
|
||||
|
||||
## Overview
|
||||
|
||||
Icon is a component that renders the Icons.
|
||||
|
||||
<Canvas>
|
||||
<Story
|
||||
name="Overview"
|
||||
args={{
|
||||
name: 'clipboard',
|
||||
}}
|
||||
>
|
||||
{IconTemplate.bind({})}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Props
|
||||
|
||||
<ArgsTable of={Icon} />
|
||||
|
||||
## Usage
|
||||
|
||||
You can choose the icon from the list of icons. Here we have render all the icons.
|
||||
|
||||
<Canvas>
|
||||
<Story name="All Icons">
|
||||
{() => {
|
||||
const icons = Object.keys(ICONS);
|
||||
return (
|
||||
<div className="flex flex-wrap">
|
||||
{icons
|
||||
.filter(ic => ic !== 'magnifier')
|
||||
.map(icon => (
|
||||
<div className="m-4 flex flex-col items-center justify-center">
|
||||
<div class="h-8 w-8">
|
||||
<Icon name={icon} />
|
||||
</div>
|
||||
<div className="text-gray-600">{icon}</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Color
|
||||
|
||||
Icon colors can be changed by wrapping the icon in a div with the class name
|
||||
|
||||
<Canvas>
|
||||
<Story
|
||||
name="Colors"
|
||||
args={{
|
||||
name: 'clipboard',
|
||||
className: 'text-red-700',
|
||||
}}
|
||||
>
|
||||
{IconTemplate.bind({})}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Contribute
|
||||
|
||||
<Footer componentRelativePath="Icon/__stories__/icon.stories.mdx" />
|
||||
@@ -1,94 +0,0 @@
|
||||
import Input from '../Input';
|
||||
|
||||
import { ArgsTable, Story, Canvas, Meta } from '@storybook/addon-docs';
|
||||
import { createComponentTemplate } from '../../../storybook/functions/create-component-story';
|
||||
|
||||
export const argTypes = {
|
||||
component: Input,
|
||||
title: 'Components/Input',
|
||||
};
|
||||
|
||||
<Meta
|
||||
title="Components/Input"
|
||||
component={Input}
|
||||
/>
|
||||
|
||||
export const InputTemplate = createComponentTemplate(Input);
|
||||
|
||||
<Heading
|
||||
title="Input"
|
||||
componentRelativePath="Input/Input.tsx"
|
||||
/>
|
||||
|
||||
- [Overview](#overview)
|
||||
- [Props](#props)
|
||||
- [Usage](#usage)
|
||||
- [Contribute](#contribute)
|
||||
|
||||
## Overview
|
||||
|
||||
Input is a component that renders the Inputs.
|
||||
|
||||
<Canvas>
|
||||
<Story
|
||||
name="Overview"
|
||||
args={{
|
||||
label: 'Input',
|
||||
}}
|
||||
>
|
||||
{InputTemplate.bind({})}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Props
|
||||
|
||||
<ArgsTable of={Input} />
|
||||
|
||||
## Usage
|
||||
|
||||
### Transparent
|
||||
|
||||
<Canvas>
|
||||
<Story
|
||||
name="Transparent"
|
||||
args={{
|
||||
transparent: true,
|
||||
}}
|
||||
>
|
||||
{InputTemplate.bind({})}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
### Small Input
|
||||
|
||||
<Canvas>
|
||||
<Story
|
||||
name="Small"
|
||||
args={{
|
||||
smallInput: true,
|
||||
}}
|
||||
>
|
||||
{InputTemplate.bind({})}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
### Classnames
|
||||
|
||||
You can change the appearance of the container and label.
|
||||
|
||||
<Canvas>
|
||||
<Story
|
||||
name="ClassNames"
|
||||
args={{
|
||||
label: 'Input',
|
||||
containerClassName: 'bg-gray-500',
|
||||
labelClassName: 'text-yellow-500',
|
||||
}}
|
||||
>
|
||||
{InputTemplate.bind({})}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Contribute
|
||||
|
||||
<Footer componentRelativePath="Input/__stories__/input.stories.mdx" />
|
||||
@@ -1,59 +0,0 @@
|
||||
import InputFilterText from '../InputFilterText';
|
||||
import { ArgsTable, Story, Canvas, Meta } from '@storybook/addon-docs';
|
||||
|
||||
export const argTypes = {
|
||||
component: InputFilterText,
|
||||
title: 'Components/InputFilterText',
|
||||
};
|
||||
|
||||
<Meta
|
||||
title="Components/InputFilterText"
|
||||
component={InputFilterText}
|
||||
/>
|
||||
|
||||
export const InputFilterTextTemplate = args => (
|
||||
<div className="w-80">
|
||||
<InputFilterText {...args} />
|
||||
</div>
|
||||
);
|
||||
|
||||
<Heading
|
||||
title="InputFilterText"
|
||||
componentRelativePath="InputFilterText/InputFilterText.tsx"
|
||||
/>
|
||||
|
||||
- [Overview](#overview)
|
||||
- [Props](#props)
|
||||
- [Contribute](#contribute)
|
||||
|
||||
## Overview
|
||||
|
||||
InputFilterText is a component that is styled such that it can be used as a text input to filter a
|
||||
list of textual items. It allows you to enter any text. There are two (optional) callbacks that can
|
||||
be invoked as the characters of the text are entered: one callback is invoked as each character is
|
||||
typed and another is debounced so that any filtering can occur once the user has entered a
|
||||
significant amount of info and pausing by a configurable amount of time in milliseconds. The
|
||||
component also provides a button on the far right of the component that when clicked will clear the
|
||||
input text. The button only appears when there is text in the component.
|
||||
|
||||
<Canvas>
|
||||
<Story
|
||||
name="Overview"
|
||||
args={{
|
||||
className: 'w-full text-white',
|
||||
placeholder: 'Search for...',
|
||||
onChange: () => console.log('input text changed'),
|
||||
onDebounceChange: () => console.log('debounce text changed'),
|
||||
}}
|
||||
>
|
||||
{InputFilterTextTemplate.bind({})}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Props
|
||||
|
||||
<ArgsTable of={InputFilterText} />
|
||||
|
||||
## Contribute
|
||||
|
||||
<Footer componentRelativePath="InputFilterText/__stories__/InputFilterText.stories.mdx" />
|
||||
@@ -1,193 +0,0 @@
|
||||
import LegacyButton from '../LegacyButton';
|
||||
import { ArgsTable, Story, Canvas, Meta } from '@storybook/addon-docs';
|
||||
import {
|
||||
createComponentTemplate,
|
||||
createStoryMetaSettings,
|
||||
} from '../../../storybook/functions/create-component-story';
|
||||
|
||||
export const argTypes = {
|
||||
component: LegacyButton,
|
||||
title: 'Components/LegacyButton',
|
||||
};
|
||||
|
||||
<Meta
|
||||
title="Components/LegacyButton"
|
||||
component={LegacyButton}
|
||||
/>
|
||||
|
||||
export const buttonTemplate = createComponentTemplate(LegacyButton);
|
||||
|
||||
<Heading
|
||||
title="LegacyButton"
|
||||
componentRelativePath="LegacyButton/LegacyButton.tsx"
|
||||
/>
|
||||
|
||||
- [Overview](#overview)
|
||||
- [Props](#props)
|
||||
- [Usage](#usage)
|
||||
- [Contribute](#contribute)
|
||||
|
||||
## Overview
|
||||
|
||||
You can use the legacy button component to create a button. It can be used in different ways, the
|
||||
default button is a simple button with a text.
|
||||
|
||||
<Canvas>
|
||||
<Story
|
||||
name="Overview"
|
||||
args={{ children: 'LegacyButton', color: 'default' }}
|
||||
>
|
||||
{buttonTemplate.bind({})}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Props
|
||||
|
||||
<ArgsTable of={LegacyButton} />
|
||||
|
||||
## Usage
|
||||
|
||||
### Variants
|
||||
|
||||
There can be different variants of buttons: `text`, `outlined`, `contained`, and `disabled`.
|
||||
|
||||
<Canvas>
|
||||
<Story name="Variants">
|
||||
<div className="flex space-x-2">
|
||||
<LegacyButton variant="text">Text LegacyButton</LegacyButton>
|
||||
<LegacyButton variant="outlined">Outlined LegacyButton</LegacyButton>
|
||||
<LegacyButton variant="contained">Contained LegacyButton</LegacyButton>
|
||||
<LegacyButton variant="disabled">Disabled LegacyButton</LegacyButton>
|
||||
</div>
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
### Colors
|
||||
|
||||
There are different colors for the legacy button: `default`, `primary`, `secondary`, `white`,
|
||||
`black`, `inherit`, `light`.
|
||||
|
||||
<Canvas>
|
||||
<Story name="Colors">
|
||||
<div className="flex space-x-2">
|
||||
<LegacyButton color="default">Default LegacyButton</LegacyButton>
|
||||
<LegacyButton color="primary">Primary LegacyButton</LegacyButton>
|
||||
<LegacyButton color="secondary">Secondary LegacyButton</LegacyButton>
|
||||
<LegacyButton color="white">White LegacyButton</LegacyButton>
|
||||
<LegacyButton color="black">Black LegacyButton</LegacyButton>
|
||||
<LegacyButton color="inherit">Inherit LegacyButton</LegacyButton>
|
||||
<LegacyButton color="light">Light LegacyButton</LegacyButton>
|
||||
</div>
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
### Mixing props
|
||||
|
||||
You can mix different props together to create a legacy button.
|
||||
|
||||
<Canvas>
|
||||
<Story name="Custom">
|
||||
<LegacyButton
|
||||
color="secondary"
|
||||
variant="outlined"
|
||||
>
|
||||
Custom LegacyButton
|
||||
</LegacyButton>
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
### Disabled
|
||||
|
||||
You can disable the legacy button by setting the variant to `disabled`.
|
||||
|
||||
<Canvas>
|
||||
<Story name="Disabled">
|
||||
<LegacyButton variant="disabled">Disabled LegacyButton</LegacyButton>
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
### Start/End Icons
|
||||
|
||||
You can add an icon to the start of the legacy button. It accepts an icon component.
|
||||
|
||||
<Canvas>
|
||||
<Story name="Start Icon">
|
||||
{() => {
|
||||
// svg icon for github
|
||||
const Github = () => {
|
||||
return (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
className="feather feather-github"
|
||||
>
|
||||
<path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path>
|
||||
</svg>
|
||||
);
|
||||
};
|
||||
return <LegacyButton startIcon={<Github />}>Start Icon LegacyButton</LegacyButton>;
|
||||
}}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
End Icon is the same as start icon, but for the end of the legacy button.
|
||||
|
||||
<Canvas>
|
||||
<Story name="End Icon">
|
||||
{() => {
|
||||
// svg icon for github
|
||||
const Github = () => {
|
||||
return (
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
className="feather feather-github"
|
||||
>
|
||||
<path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path>
|
||||
</svg>
|
||||
);
|
||||
};
|
||||
return (
|
||||
<LegacyButton
|
||||
startIcon={<Github />}
|
||||
endIcon={<Github />}
|
||||
>
|
||||
Start and End Icon LegacyButton
|
||||
</LegacyButton>
|
||||
);
|
||||
}}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
### Full width
|
||||
|
||||
You can make the legacy button full width by setting the `fullWidth` prop to `true`.
|
||||
|
||||
<Canvas>
|
||||
<Story name="Full Width">
|
||||
<LegacyButton
|
||||
fullWidth
|
||||
color="secondary"
|
||||
>
|
||||
Full Width LegacyButton
|
||||
</LegacyButton>
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Contribute
|
||||
|
||||
<Footer componentRelativePath="LegacyButton/__stories__/legacyButton.stories.mdx" />
|
||||
-102
@@ -1,102 +0,0 @@
|
||||
import { LegacyButtonGroup, LegacyButton } from '../../../components';
|
||||
import { ArgsTable, Story, Canvas, Meta } from '@storybook/addon-docs';
|
||||
import {
|
||||
createComponentTemplate,
|
||||
createStoryMetaSettings,
|
||||
} from '../../../storybook/functions/create-component-story';
|
||||
|
||||
export const argTypes = {
|
||||
component: LegacyButtonGroup,
|
||||
title: 'Components/LegacyButtonGroup',
|
||||
};
|
||||
|
||||
<Meta
|
||||
title="Components/LegacyButtonGroup"
|
||||
component={LegacyButtonGroup}
|
||||
/>
|
||||
|
||||
export const LegacybuttonGroupTemplate = args => (
|
||||
<LegacyButtonGroup {...args}>
|
||||
<LegacyButton>One</LegacyButton>
|
||||
<LegacyButton>Two</LegacyButton>
|
||||
<LegacyButton>Three</LegacyButton>
|
||||
</LegacyButtonGroup>
|
||||
);
|
||||
|
||||
<Heading
|
||||
title="LegacyButtonGroup"
|
||||
componentRelativePath="LegacyButtonGroup/LegacyButtonGroup.tsx"
|
||||
/>
|
||||
|
||||
- [Overview](#overview)
|
||||
- [Props](#props)
|
||||
- [Usage](#usage)
|
||||
- [Contribute](#contribute)
|
||||
|
||||
## Overview
|
||||
|
||||
LegacyButtonGroup is a container for a group of buttons.
|
||||
|
||||
<Canvas>
|
||||
<Story name="Overview">{LegacybuttonGroupTemplate.bind({})}</Story>
|
||||
</Canvas>
|
||||
|
||||
## Props
|
||||
|
||||
<ArgsTable of={LegacyButtonGroup} />
|
||||
|
||||
## Usage
|
||||
|
||||
### Variants
|
||||
|
||||
There are three different variants of LegacyButtonGroup:
|
||||
|
||||
<Canvas>
|
||||
<Story name="Variants">
|
||||
<div className="flex flex-col space-y-2">
|
||||
<LegacyButtonGroup variant="text">
|
||||
<LegacyButton>Text</LegacyButton>
|
||||
<LegacyButton>Text</LegacyButton>
|
||||
<LegacyButton>Text</LegacyButton>
|
||||
</LegacyButtonGroup>
|
||||
<LegacyButtonGroup variant="outlined">
|
||||
<LegacyButton>Outlined</LegacyButton>
|
||||
<LegacyButton>Outlined</LegacyButton>
|
||||
<LegacyButton>Outlined</LegacyButton>
|
||||
</LegacyButtonGroup>
|
||||
<LegacyButtonGroup variant="contained">
|
||||
<LegacyButton>Contained</LegacyButton>
|
||||
<LegacyButton>Contained</LegacyButton>
|
||||
<LegacyButton>Contained</LegacyButton>
|
||||
</LegacyButtonGroup>
|
||||
</div>
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
### Orientation
|
||||
|
||||
You can change the orientation of the buttons in the group by setting the `orientation` prop.
|
||||
|
||||
<Canvas>
|
||||
<Story name="Orientation Horizontal">
|
||||
<LegacyButtonGroup orientation="horizontal">
|
||||
<LegacyButton>Horizontal-1</LegacyButton>
|
||||
<LegacyButton>Horizontal-2</LegacyButton>
|
||||
</LegacyButtonGroup>
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
Or vertical
|
||||
|
||||
<Canvas>
|
||||
<Story name="Orientation Vertical">
|
||||
<LegacyButtonGroup orientation="vertical">
|
||||
<LegacyButton>Vertical-1</LegacyButton>
|
||||
<LegacyButton>Vertical-2</LegacyButton>
|
||||
</LegacyButtonGroup>
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Contribute
|
||||
|
||||
<Footer componentRelativePath="LEgacyButtonGroup/__stories__/legacyButtonGroup.stories.mdx" />
|
||||
@@ -1,56 +0,0 @@
|
||||
import { Select } from '../../../components';
|
||||
import { ArgsTable, Story, Canvas, Meta } from '@storybook/addon-docs';
|
||||
|
||||
export const argTypes = {
|
||||
component: Select,
|
||||
title: 'Components/Select',
|
||||
};
|
||||
|
||||
<Meta
|
||||
title="Components/Select"
|
||||
component={Select}
|
||||
/>
|
||||
|
||||
export const SelectTemplate = args => (
|
||||
<div className="h-80 w-40">
|
||||
<Select {...args} />
|
||||
</div>
|
||||
);
|
||||
|
||||
<Heading
|
||||
title="Select"
|
||||
componentRelativePath="Select/Select.tsx"
|
||||
/>
|
||||
|
||||
- [Overview](#overview)
|
||||
- [Props](#props)
|
||||
- [Contribute](#contribute)
|
||||
|
||||
## Overview
|
||||
|
||||
Select is a component that allows you to select from a list
|
||||
|
||||
<Canvas>
|
||||
<Story
|
||||
name="Overview"
|
||||
args={{
|
||||
isClearable: false,
|
||||
onChange: item => alert(item.label),
|
||||
options: [
|
||||
{ label: 'item1', value: 1 },
|
||||
{ label: 'item2', value: 2 },
|
||||
],
|
||||
value: 2,
|
||||
}}
|
||||
>
|
||||
{SelectTemplate.bind({})}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Props
|
||||
|
||||
<ArgsTable of={Select} />
|
||||
|
||||
## Contribute
|
||||
|
||||
<Footer componentRelativePath="Select/__stories__/Select.stories.mdx" />
|
||||
-56
@@ -1,56 +0,0 @@
|
||||
import StudyListExpandedRow from '../StudyListExpandedRow';
|
||||
|
||||
import { ArgsTable, Story, Canvas, Meta } from '@storybook/addon-docs';
|
||||
import { createComponentTemplate } from '../../../storybook/functions/create-component-story';
|
||||
|
||||
export const argTypes = {
|
||||
component: StudyListExpandedRow,
|
||||
title: 'Components/StudyListExpandedRow',
|
||||
};
|
||||
|
||||
<Meta
|
||||
title="Components/StudyListExpandedRow"
|
||||
component={StudyListExpandedRow}
|
||||
/>
|
||||
|
||||
export const StudyListExpandedRowTemplate = createComponentTemplate(StudyListExpandedRow);
|
||||
|
||||
<Heading
|
||||
title="StudyListExpandedRow"
|
||||
componentRelativePath="StudyListExpandedRow/StudyListExpandedRow.js"
|
||||
/>
|
||||
|
||||
- [Overview](#overview)
|
||||
- [Props](#props)
|
||||
- [Contribute](#contribute)
|
||||
|
||||
## Overview
|
||||
|
||||
StudyListExpandedRow is a component that renders the StudyListExpandedRows.
|
||||
|
||||
<Canvas>
|
||||
<Story
|
||||
name="Overview"
|
||||
args={{
|
||||
seriesTableColumns: {
|
||||
description: 'Description',
|
||||
seriesNumber: 'Series',
|
||||
modality: 'Modality',
|
||||
instances: 'Instances',
|
||||
},
|
||||
seriesTableDataSource: [],
|
||||
}}
|
||||
>
|
||||
{StudyListExpandedRowTemplate.bind({})}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Props
|
||||
|
||||
<ArgsTable of={StudyListExpandedRow} />
|
||||
|
||||
## Usage
|
||||
|
||||
## Contribute
|
||||
|
||||
<Footer componentRelativePath="StudyListExpandedRow/__stories__/studyListExpandedRow.stories.mdx" />
|
||||
@@ -1,91 +0,0 @@
|
||||
import Tooltip from '../Tooltip';
|
||||
import Icon from '../../Icon';
|
||||
|
||||
import { ArgsTable, Story, Canvas, Meta } from '@storybook/addon-docs';
|
||||
import { createComponentTemplate } from '../../../storybook/functions/create-component-story';
|
||||
|
||||
export const argTypes = {
|
||||
component: Tooltip,
|
||||
title: 'Components/Tooltip',
|
||||
};
|
||||
|
||||
<Meta
|
||||
title="Components/Tooltip"
|
||||
component={Tooltip}
|
||||
/>
|
||||
|
||||
export const TooltipTemplate = args => (
|
||||
<div className="h-16 w-full">
|
||||
<div class="mx-auto h-8 w-8">
|
||||
<Tooltip {...args}>
|
||||
<Icon name="clipboard" />
|
||||
</Tooltip>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
<Heading
|
||||
title="Tooltip"
|
||||
componentRelativePath="Tooltip/Tooltip.js"
|
||||
/>
|
||||
|
||||
- [Overview](#overview)
|
||||
- [Props](#props)
|
||||
- [Usage](#usage)
|
||||
- [Contribute](#contribute)
|
||||
|
||||
## Overview
|
||||
|
||||
Tooltip is a component that renders the Tooltips.
|
||||
|
||||
<Canvas>
|
||||
<Story
|
||||
name="Overview"
|
||||
args={{
|
||||
content: 'Tooltip',
|
||||
}}
|
||||
>
|
||||
{TooltipTemplate.bind({})}
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Props
|
||||
|
||||
<ArgsTable of={Tooltip} />
|
||||
|
||||
## Usage
|
||||
|
||||
### Position
|
||||
|
||||
You can set the position of the tooltip by using the `position` prop.
|
||||
|
||||
<Canvas>
|
||||
<Story name="Position">
|
||||
<div className="m-8 h-16 w-full">
|
||||
<div class="mx-auto h-8 w-8">
|
||||
<Tooltip
|
||||
position="right"
|
||||
content="right"
|
||||
>
|
||||
<Icon name="clipboard" />
|
||||
<span>Right</span>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</div>
|
||||
<div className="m-8 h-16 w-full">
|
||||
<div class="mx-auto h-8 w-8">
|
||||
<Tooltip
|
||||
position="left"
|
||||
content="left"
|
||||
>
|
||||
<Icon name="clipboard" />
|
||||
<span>Left</span>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Contribute
|
||||
|
||||
<Footer componentRelativePath="Tooltip/__stories__/tooltip.stories.mdx" />
|
||||
@@ -1,218 +0,0 @@
|
||||
import Typography from '../Typography';
|
||||
|
||||
import { ArgsTable, Story, Canvas, Meta } from '@storybook/addon-docs';
|
||||
import { createComponentTemplate } from '../../../storybook/functions/create-component-story';
|
||||
|
||||
export const argTypes = {
|
||||
component: Typography,
|
||||
title: 'Foundations/Typography',
|
||||
};
|
||||
|
||||
<Meta
|
||||
title="Foundations/Typography"
|
||||
component={Typography}
|
||||
/>
|
||||
|
||||
<Heading
|
||||
title="Typography"
|
||||
componentRelativePath="Typography/Typography.js"
|
||||
/>
|
||||
|
||||
- [Overview](#overview)
|
||||
- [Props](#props)
|
||||
- [Usage](#usage)
|
||||
- [Contribute](#contribute)
|
||||
|
||||
## Overview
|
||||
|
||||
Typography is a component that renders the Typographys.
|
||||
|
||||
<Canvas>
|
||||
<Story name="Overview">
|
||||
<Typography
|
||||
variant="h1"
|
||||
className="text-blue-800"
|
||||
>
|
||||
Heading 1
|
||||
</Typography>
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
### Usage
|
||||
|
||||
#### Variants
|
||||
|
||||
There are several variants of the Typography component.
|
||||
|
||||
<Canvas>
|
||||
<Story name="Variants">
|
||||
<Typography
|
||||
variant="h1"
|
||||
className="text-blue-800"
|
||||
>
|
||||
Heading 1
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="h2"
|
||||
className="text-blue-800"
|
||||
>
|
||||
Heading 2
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="h3"
|
||||
className="text-blue-800"
|
||||
>
|
||||
Heading 3
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="h4"
|
||||
className="text-blue-800"
|
||||
>
|
||||
Heading 4
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="h5"
|
||||
className="text-blue-800"
|
||||
>
|
||||
Heading 5
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="h6"
|
||||
className="text-blue-800"
|
||||
>
|
||||
Heading 6
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="p"
|
||||
className="text-blue-800"
|
||||
>
|
||||
Paragraph
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle"
|
||||
className="text-blue-800"
|
||||
>
|
||||
Subtitle
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="caption"
|
||||
className="text-blue-800"
|
||||
>
|
||||
Caption
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="body"
|
||||
className="text-blue-800"
|
||||
>
|
||||
Body
|
||||
</Typography>
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
#### Text Color
|
||||
|
||||
You can use the `color` prop to change the color of the text.
|
||||
|
||||
<Canvas>
|
||||
<Story name="Text Color">
|
||||
<Typography
|
||||
variant="h5"
|
||||
color="primary"
|
||||
>
|
||||
Primary Color
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="h5"
|
||||
color="secondary"
|
||||
>
|
||||
Secondary Color
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="h5"
|
||||
color="error"
|
||||
>
|
||||
Error Color
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="h5"
|
||||
color="inherit"
|
||||
>
|
||||
Inherit Color
|
||||
</Typography>
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
#### Custom className
|
||||
|
||||
You can use the `className` prop to add a custom className to the Typography.
|
||||
|
||||
<Canvas>
|
||||
<Story name="Custom Class">
|
||||
<Typography
|
||||
variant="h5"
|
||||
className="text-red-400"
|
||||
>
|
||||
Custom Red Color
|
||||
</Typography>
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
#### Align
|
||||
|
||||
<Canvas>
|
||||
<Story name="Align">
|
||||
<Typography
|
||||
variant="body"
|
||||
align="left"
|
||||
color="primary"
|
||||
>
|
||||
Align Left: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tincidunt tempus
|
||||
ante, non blandit sem vehicula ac. Vestibulum in dolor commodo, elementum massa scelerisque,
|
||||
molestie nulla. Aenean sed odio interdum, rutrum ex at, volutpat diam. Donec vel tristique
|
||||
sem, eget iaculis velit. Aenean placerat justo
|
||||
</Typography>
|
||||
<br />
|
||||
<Typography
|
||||
variant="body"
|
||||
align="center"
|
||||
color="primary"
|
||||
>
|
||||
Align Center: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tincidunt tempus
|
||||
ante, non blandit sem vehicula ac. Vestibulum in dolor commodo, elementum massa scelerisque,
|
||||
molestie nulla. Aenean sed odio interdum, rutrum ex at, volutpat diam. Donec vel tristique
|
||||
sem, eget iaculis velit. Aenean placerat justo
|
||||
</Typography>
|
||||
<br />
|
||||
<Typography
|
||||
variant="body"
|
||||
align="right"
|
||||
color="primary"
|
||||
>
|
||||
Align Right: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tincidunt tempus
|
||||
ante, non blandit sem vehicula ac. Vestibulum in dolor commodo, elementum massa scelerisque,
|
||||
molestie nulla. Aenean sed odio interdum, rutrum ex at, volutpat diam. Donec vel tristique
|
||||
sem, eget iaculis velit. Aenean placerat justo
|
||||
</Typography>
|
||||
<br />
|
||||
<Typography
|
||||
variant="body"
|
||||
align="justify"
|
||||
color="primary"
|
||||
>
|
||||
Align Justify: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tincidunt tempus
|
||||
ante, non blandit sem vehicula ac. Vestibulum in dolor commodo, elementum massa scelerisque,
|
||||
molestie nulla. Aenean sed odio interdum, rutrum ex at, volutpat diam. Donec vel tristique
|
||||
sem, eget iaculis velit. Aenean placerat justo
|
||||
</Typography>
|
||||
</Story>
|
||||
</Canvas>
|
||||
|
||||
## Props
|
||||
|
||||
<ArgsTable of={Typography} />
|
||||
|
||||
## Usage
|
||||
|
||||
## Contribute
|
||||
|
||||
<Footer componentRelativePath="Typography/__stories__/typography.stories.mdx" />
|
||||
Reference in new issue
Block a user