mirror of
https://gitlab.com/bramw/baserow.git
synced 2025-02-05 21:39:51 +00:00
83 lines
1.8 KiB
Text
83 lines
1.8 KiB
Text
import { Meta, Story, Props, Canvas } from '@storybook/addon-docs/blocks'
|
|
import { config, withDesign } from 'storybook-addon-designs'
|
|
|
|
import Chips from '@baserow/modules/core/components/Chips'
|
|
|
|
<Meta
|
|
title="Baserow/Chips"
|
|
component={Chips}
|
|
parameters={{
|
|
backgrounds: {
|
|
default: 'white',
|
|
values: [
|
|
{ name: 'white', value: '#ffffff' },
|
|
{ name: 'light', value: '#eeeeee' },
|
|
{ name: 'dark', value: '#222222' },
|
|
],
|
|
},
|
|
}}
|
|
decorators={[withDesign]}
|
|
argTypes={{
|
|
default: {
|
|
defaultValue: 'Label',
|
|
},
|
|
active: {
|
|
control: {
|
|
type: 'boolean',
|
|
options: [true, false],
|
|
},
|
|
defaultValue: false,
|
|
},
|
|
disabled: {
|
|
control: {
|
|
type: 'boolean',
|
|
options: [true, false],
|
|
},
|
|
defaultValue: false,
|
|
},
|
|
icon: {
|
|
control: {
|
|
type: 'text',
|
|
},
|
|
defaultValue: '',
|
|
},
|
|
}}
|
|
/>
|
|
|
|
# Chips
|
|
|
|
export const Template = (args, { argTypes }) => ({
|
|
components: { Chips },
|
|
props: Object.keys(argTypes),
|
|
template: `
|
|
<Chips v-bind="$props">
|
|
<template v-slot>${args.default}</template>
|
|
</Chips>
|
|
`,
|
|
})
|
|
|
|
export const designConfig = {
|
|
type: 'figma',
|
|
url: 'https://www.figma.com/file/W7R2rQW7ohsZMeHRfEcPFW/Design-Library?node-id=453:3515&mode=dev',
|
|
}
|
|
|
|
<Canvas>
|
|
<Story
|
|
name="Chips"
|
|
parameters={{
|
|
design: config(designConfig),
|
|
}}
|
|
>
|
|
{Template.bind({})}
|
|
</Story>
|
|
</Canvas>
|
|
|
|
## Example
|
|
|
|
```javascript
|
|
<Chips>Lorem ipsum dolor sit amet</Chips>
|
|
```
|
|
|
|
## Props
|
|
|
|
<Props of={Chips} />
|