From 2a82f1363a6245a6106ab07ff1d8b762cc138d57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Go=CC=88khan=20O=CC=88ztu=CC=88rk?= Date: Wed, 28 Sep 2022 15:03:51 +0300 Subject: [PATCH] feat: docs improvements --- src/components/Badge/Badge.stories.mdx | 69 +++++++++++++--- src/components/Button/Button.stories.mdx | 46 ++++++----- src/components/Checkbox/Checkbox.stories.mdx | 27 ++++++- src/components/Chips/Chip.stories.mdx | 51 +++++++++++- src/components/Dropdown/Dropdown.stories.mdx | 18 ++++- src/components/Icon/Icon.stories.mdx | 22 ++++- src/components/Switch/Switch.stories.mdx | 81 +++++++------------ src/components/TabItem/TabItem.stories.mdx | 30 +++++-- src/components/Tabs/Tabs.stories.mdx | 30 +++++-- .../Textfield/Textfield.stories.mdx | 33 +++++--- src/components/Tooltip/Tooltip.stories.mdx | 38 ++++++++- 11 files changed, 323 insertions(+), 122 deletions(-) diff --git a/src/components/Badge/Badge.stories.mdx b/src/components/Badge/Badge.stories.mdx index 2a7b39f..59b1a13 100644 --- a/src/components/Badge/Badge.stories.mdx +++ b/src/components/Badge/Badge.stories.mdx @@ -115,45 +115,88 @@ export const ButtonTemplate = (args) => ({ # Badges +## Overview + {Default.bind({})} + + +### Playground + + + +## Stories + +### Right + + {Default.bind({})} + + +### With Content + + + {ButtonTemplate.bind({})} + + + +### With Icon + + + {Default.bind({})} + + +### Hover + + {Default.bind({})} + + +### Bottom + + {Default.bind({})} + + +### Left + + - {ButtonTemplate.bind({})} + {Default.bind({})} - - diff --git a/src/components/Button/Button.stories.mdx b/src/components/Button/Button.stories.mdx index 9c0c5da..29a5485 100644 --- a/src/components/Button/Button.stories.mdx +++ b/src/components/Button/Button.stories.mdx @@ -100,7 +100,29 @@ export const Default = ({ slot1, slot2, ...rest }) => { }; }; -# Primary +# Button + + + Primary', + }} + > + {Default.bind({})} + + + +### Playground + + + +## Stories + +### Primary { -# Secondary +### Secondary { -# Icon +### Icon { -# Text +### Text { -# Outline +### Outline { {Default.bind({})} - -# Reference - - - -# Usage - -```html -Default template -``` - -```js -Default template -``` diff --git a/src/components/Checkbox/Checkbox.stories.mdx b/src/components/Checkbox/Checkbox.stories.mdx index c3ee1ac..23bfea8 100644 --- a/src/components/Checkbox/Checkbox.stories.mdx +++ b/src/components/Checkbox/Checkbox.stories.mdx @@ -69,11 +69,11 @@ export const Default = (args) => { }; }; -# Default +# Checkbox { -# Reference +### Playground + + + +## Stories - +### Default + + + + {Default.bind({})} + + diff --git a/src/components/Chips/Chip.stories.mdx b/src/components/Chips/Chip.stories.mdx index d534b7a..89733d7 100644 --- a/src/components/Chips/Chip.stories.mdx +++ b/src/components/Chips/Chip.stories.mdx @@ -78,10 +78,29 @@ export const Default = (args) => ({ # Chips + + + {Default.bind({})} + + + +### Playground + + + +## Stories + +### Primary + {Default.bind({})} + + +### Secondary + + ({ > {Default.bind({})} + + +### Success + + ({ > {Default.bind({})} + + +### Danger + + ({ > {Default.bind({})} + + +### Warning + + ({ > {Default.bind({})} + + +### Info + + ({ > {Default.bind({})} + + +### Light + + ({ > {Default.bind({})} + + +### Dark + + ({ {Default.bind({})} - - diff --git a/src/components/Dropdown/Dropdown.stories.mdx b/src/components/Dropdown/Dropdown.stories.mdx index 19653a6..9214c31 100644 --- a/src/components/Dropdown/Dropdown.stories.mdx +++ b/src/components/Dropdown/Dropdown.stories.mdx @@ -241,11 +241,25 @@ export const WithIcon = (args) => { }; }; +# Dropdown + + + + + +### Playground + + + +## Stories + +### Default + - +### With Icon { args={{ content: '', autoSize: false }} /> - - diff --git a/src/components/Icon/Icon.stories.mdx b/src/components/Icon/Icon.stories.mdx index 2666994..4a98f18 100644 --- a/src/components/Icon/Icon.stories.mdx +++ b/src/components/Icon/Icon.stories.mdx @@ -53,7 +53,7 @@ export const Default = (args) => { { +### Playground + + + # Reference ##### You can use any icon from Material Design Icons: [Material Icons](https://fonts.google.com/icons?icon.set=Material+Icons) - +## Stories + +### Default + + + + {Default.bind({})} + + diff --git a/src/components/Switch/Switch.stories.mdx b/src/components/Switch/Switch.stories.mdx index 842faa2..2417432 100644 --- a/src/components/Switch/Switch.stories.mdx +++ b/src/components/Switch/Switch.stories.mdx @@ -54,9 +54,28 @@ export const Default = (args) => { }; }; -# All the sizes +# Switch -
+ + + {Default.bind({})} + + + +### Playground + + + +## Stories + +### Small { > {Default.bind({})} + + +### Medium + + { > {Default.bind({})} + + +### Large + + { {Default.bind({})} - -# Reference - -
- - - -# Notes - -
-

- This component is a wrapper around the input element. -

-

- The value prop is passed to the input element. -

-

- The disabled prop is passed to the input element. -

-

- The size prop is passed to the input element. -

- -# Installation - -
- -

Install the component with:

- -```js -import { Switch } from '@/components/Switch'; -``` - -# Examples - -
- -
Basic using
- -```html - -``` - -
Advance using
- -```html - -``` diff --git a/src/components/TabItem/TabItem.stories.mdx b/src/components/TabItem/TabItem.stories.mdx index ca899b2..d5eb818 100644 --- a/src/components/TabItem/TabItem.stories.mdx +++ b/src/components/TabItem/TabItem.stories.mdx @@ -105,7 +105,25 @@ export const Default = (args) => ({ `, }); -# Default +# TabItem + + + + {Default.bind({})} + + + +### Playground + + + +## Stories + +### Default ({ -# Icon Only +### Icon Only ({ -# Pill +### Pill ({ -# Icon Pill +### Icon Pill ({ -# Text Only +### Text Only ({ {Default.bind({})} - - diff --git a/src/components/Tabs/Tabs.stories.mdx b/src/components/Tabs/Tabs.stories.mdx index 2db8d37..c8fcb3d 100644 --- a/src/components/Tabs/Tabs.stories.mdx +++ b/src/components/Tabs/Tabs.stories.mdx @@ -96,7 +96,25 @@ export const Default = (args) => ({ `, }); -# Default +# Tabs + + + + {Default.bind({})} + + + +### Playground + + + +## Stories + +### Default ({ -# Icon Only +### Icon Only ({ -# Pill +### Pill ({ -# Icon Pill +### Icon Pill ({ -# Text Only +### Text Only ({ {Default.bind({})} - - diff --git a/src/components/Textfield/Textfield.stories.mdx b/src/components/Textfield/Textfield.stories.mdx index ef83968..22fc83a 100644 --- a/src/components/Textfield/Textfield.stories.mdx +++ b/src/components/Textfield/Textfield.stories.mdx @@ -132,11 +132,11 @@ export const Default = (args) => { }; }; -# Default +# Textfield { -# Reference +### Playground - + -# Usage +## Stories -```html -Default template -``` +### Default -```js -Default template -``` + + + {Default.bind({})} + + diff --git a/src/components/Tooltip/Tooltip.stories.mdx b/src/components/Tooltip/Tooltip.stories.mdx index f79328d..561a514 100644 --- a/src/components/Tooltip/Tooltip.stories.mdx +++ b/src/components/Tooltip/Tooltip.stories.mdx @@ -167,6 +167,30 @@ export const Default = ({ slot, ...args }) => { }; }; +# Tooltip + + + ', + content: 'Icon tooltip content prop mdx', + placement: 'bottom', + }} + > + {Default.bind({})} + + + +### Playground + + + +## Stories + +### Icon + { > {Default.bind({})} + + +### Text + + { > {Default.bind({})} + + +### Button + + { {Default.bind({})} - -# Reference - -