Skip to content

Commit

Permalink
feat(doc): add Canvas tag to all components & disable shortcuts
Browse files Browse the repository at this point in the history
Signed-off-by: aurore.stagnol <[email protected]>
  • Loading branch information
astagnol authored and dpellier committed Feb 1, 2024
1 parent c0c7bef commit 22e47ab
Show file tree
Hide file tree
Showing 249 changed files with 2,097 additions and 1,249 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import GenericStyle from '@ovhcloud/ods-common-core/docs/generic-style.mdx';
import { Preview } from '@storybook/addon-docs/blocks';
import { Canvas } from '@storybook/addon-docs';

<GenericStyle />

## Usage

### Default

<Preview withSource="none">
<Canvas withSource="none">
<osds-accordion-group>
<osds-accordion>
<span slot="summary">
Expand All @@ -26,7 +26,7 @@ import { Preview } from '@storybook/addon-docs/blocks';
Nulla mollis tortor sed pretium mollis.
</osds-accordion>
</osds-accordion-group>
</Preview>
</Canvas >

```html
<osds-accordion-group>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Preview } from '@storybook/addon-docs/blocks';
import { Canvas } from '@storybook/addon-docs';

<Preview withSource="none">
<Canvas withSource="none">
<osds-accordion contrasted>
<span slot="summary">
Lorem ipsum
Expand All @@ -9,7 +9,7 @@ import { Preview } from '@storybook/addon-docs/blocks';
Fusce et nisi quis tellus porttitor pharetra facilisis id arcu.
Nulla mollis tortor sed pretium mollis.
</osds-accordion>
</Preview>
</Canvas >

```html
<osds-accordion contrasted>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Preview } from '@storybook/addon-docs/blocks';
import { Canvas } from '@storybook/addon-docs';

<Preview withSource="none">
<Canvas withSource="none">
<osds-accordion disabled>
<span slot="summary">
Lorem ipsum
Expand All @@ -10,7 +10,7 @@ import { Preview } from '@storybook/addon-docs/blocks';
quis, mattis quis metus. Vestibulum at elit porta, tincidunt diam in, mattis mauris. Duis tincidunt ut mauris a
faucibus. Nulla sodales lacus et nibh euismod, vel pellentesque justo condimentum.
</osds-accordion>
</Preview>
</Canvas >

```html

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Preview } from '@storybook/addon-docs/blocks';
import { Canvas } from '@storybook/addon-docs';

<Preview withSource="none">
<Canvas withSource="none">
<osds-accordion opened>
<span slot='summary'>
Lorem ipsum
Expand All @@ -10,7 +10,7 @@ import { Preview } from '@storybook/addon-docs/blocks';
quis, mattis quis metus. Vestibulum at elit porta, tincidunt diam in, mattis mauris. Duis tincidunt ut mauris a
faucibus. Nulla sodales lacus et nibh euismod, vel pellentesque justo condimentum.
</osds-accordion>
</Preview>
</Canvas >

```html

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Preview } from '@storybook/addon-docs/blocks';
import { Canvas } from '@storybook/addon-docs';

#### Summary
<Preview withSource="none">
<Canvas withSource="none">
<osds-accordion>
<span slot='summary'>Summary</span>
</osds-accordion>
</Preview>
</Canvas >

```html
<osds-accordion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import DisabledProperty from './properties/usage.disabled.mdx';
import OpenedProperty from './properties/usage.opened.mdx';
import Slot from './slots/usage.slot.mdx';
import GenericStyle from '@ovhcloud/ods-common-core/docs/generic-style.mdx';
import { Preview } from '@storybook/addon-docs/blocks';
import { Canvas } from '@storybook/addon-docs';

<GenericStyle />

## Usage

### Default

<Preview withSource="none">
<Canvas withSource="none">
<osds-accordion>
<span slot='summary'>
Lorem ipsum
Expand All @@ -20,7 +20,7 @@ import { Preview } from '@storybook/addon-docs/blocks';
Fusce et nisi quis tellus porttitor pharetra facilisis id arcu.
Nulla mollis tortor sed pretium mollis.
</osds-accordion>
</Preview>
</Canvas >

```html
<osds-accordion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Canvas } from '@storybook/addon-docs';

You can `disabled` some items, but you cannot disable the entire `breadcrumb`.

export const displayBreadcrumbItem = () => {
Expand All @@ -12,7 +14,10 @@ export const displayBreadcrumbItem = () => {
}, 0);
};

<osds-breadcrumb id="disabled-breadcrumb-item"></osds-breadcrumb>
<Canvas withSource="none">
<osds-breadcrumb id="disabled-breadcrumb-item"></osds-breadcrumb>
</Canvas >

<>{ displayBreadcrumbItem() }</>

```html
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Canvas } from '@storybook/addon-docs';

export const displayContrastedBreadcrumb = () => {
setTimeout(() => {
const contrastedBreadcrumbUsage = document.querySelector('#contrasted-breadcrumb');
Expand All @@ -10,9 +12,10 @@ export const displayContrastedBreadcrumb = () => {
}, 0);
};

<div class='contrasted'>
<osds-breadcrumb id="contrasted-breadcrumb" contrasted></osds-breadcrumb>
</div>
<Canvas withSource="none" className='contrasted'>
<osds-breadcrumb id="contrasted-breadcrumb" contrasted></osds-breadcrumb>
</Canvas >

<>{ displayContrastedBreadcrumb() }</>

```html
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import ContrastedProperty from './properties/breadcrumb/usage.contrasted.mdx';
import DisabledProperty from './properties/breadcrumb-item/usage.disabled.mdx';
import GenericStyle from '@ovhcloud/ods-common-core/docs/generic-style.mdx';
import { Canvas } from '@storybook/addon-docs';

<GenericStyle />

## Usage

## Breadcrumb
### Default

export const displayBreadcrumb = () => {
setTimeout(() => {
const defaultBreadcrumbUsage = document.querySelector('#default-breadcrumb');
Expand All @@ -21,7 +21,10 @@ export const displayBreadcrumb = () => {
}, 0);
};

<osds-breadcrumb id="default-breadcrumb"></osds-breadcrumb>
<Canvas withSource="none">
<osds-breadcrumb id="default-breadcrumb"></osds-breadcrumb>
</Canvas >

<>{ displayBreadcrumb() }</>

```html
Expand Down Expand Up @@ -54,7 +57,10 @@ export const displayCollapseBreadcrumb = () => {
}, 0);
};

<osds-breadcrumb id="collapse-breadcrumb"></osds-breadcrumb>
<Canvas withSource="none">
<osds-breadcrumb id="collapse-breadcrumb"></osds-breadcrumb>
</Canvas >

<>{ displayCollapseBreadcrumb() }</>

```html
Expand Down Expand Up @@ -88,7 +94,10 @@ export const displayIconBreadcrumbItem = () => {
}, 0);
};

<osds-breadcrumb id="icon-breadcrumb-item"></osds-breadcrumb>
<Canvas withSource="none">
<osds-breadcrumb id="icon-breadcrumb-item"></osds-breadcrumb>
</Canvas >

<>{ displayIconBreadcrumbItem() }</>

```html
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<div class='container'>
import { Canvas } from '@storybook/addon-docs';

<Canvas withSource="none">
<osds-button size='sm' circle>Small</osds-button>
<osds-button circle>Default</osds-button>
<osds-button circle><osds-icon name='ellipsis-vertical' contrasted></osds-icon></osds-button>
<osds-button circle><osds-icon name='ellipsis-vertical' contrasted size='xs'></osds-icon></osds-button>
</div>
</Canvas >

```html
<osds-button size='sm' circle>Small</osds-button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<div class="container">
<osds-button>Default</osds-button>
<osds-button color='primary'>Primary</osds-button>
<osds-button color='error'>Error</osds-button>
</div>
import { Canvas } from '@storybook/addon-docs';

<Canvas withSource="none">
<osds-button inline>Default</osds-button>
<osds-button inline color='primary'>Primary</osds-button>
<osds-button inline color='error'>Error</osds-button>
</Canvas >

```html
<osds-button>Default</osds-button>
<osds-button color='primary'>Primary</osds-button>
<osds-button color='error'>Error</osds-button>
<osds-button inline>Default</osds-button>
<osds-button inline color='primary'>Primary</osds-button>
<osds-button inline color='error'>Error</osds-button>
```

Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<div class='contrasted'>
import { Canvas } from '@storybook/addon-docs';

<Canvas withSource="none" className="contrasted">
<osds-button inline contrasted>Contrasted</osds-button>
</div>
</Canvas >

```html
<osds-button inline contrasted>Contrasted</osds-button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<div class="container">
import { Canvas } from '@storybook/addon-docs';

<Canvas withSource="none">
<osds-button size='sm' disabled>Small</osds-button>
<osds-button disabled>Default</osds-button>
<osds-button variant='ghost' disabled>Ghost</osds-button>
<osds-button variant='flat' disabled>Flat</osds-button>
<osds-button variant='stroked' disabled>Stroked</osds-button>
</div>
</Canvas >

```html
<osds-button size='sm' disabled>Small</osds-button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<osds-button inline>Inline</osds-button>
import { Canvas } from '@storybook/addon-docs';

<Canvas withSource="none">
<osds-button inline>Inline</osds-button>
</Canvas >

```html
<osds-button inline>Inline</osds-button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<div class="container">
import { Canvas } from '@storybook/addon-docs';

<Canvas withSource="none">
<osds-button>Default</osds-button>
<osds-button size='sm'>Small</osds-button>
<osds-button size='md'>Medium</osds-button>
</div>
</Canvas >

```html
<osds-button>Default</osds-button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<osds-button text-align='center'>Center</osds-button>
<osds-button text-align='start'>Start</osds-button>
<osds-button text-align='end'>End</osds-button>
import { Canvas } from '@storybook/addon-docs';

<Canvas withSource="none">
<osds-button text-align='center'>Center</osds-button>
<osds-button text-align='start'>Start</osds-button>
<osds-button text-align='end'>End</osds-button>
</Canvas >

```html
<osds-button text-align='center'>Center</osds-button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<div class="container">
<osds-button variant='flat'>Flat</osds-button>
<osds-button variant='stroked'>Stroked</osds-button>
<osds-button variant='ghost'>Ghost</osds-button>
</div>
import { Canvas } from '@storybook/addon-docs';

<Canvas withSource="none">
<osds-button inline variant='flat'>Flat</osds-button>
<osds-button inline variant='stroked'>Stroked</osds-button>
<osds-button inline variant='ghost'>Ghost</osds-button>
</Canvas >

```html
<osds-button variant='flat'>Flat</osds-button>
<osds-button variant='stroked'>Stroked</osds-button>
<osds-button variant='ghost'>Ghost</osds-button>
<osds-button inline variant='flat'>Flat</osds-button>
<osds-button inline variant='stroked'>Stroked</osds-button>
<osds-button inline variant='ghost'>Ghost</osds-button>
```
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { Preview } from '@storybook/addon-docs/blocks';
import { Canvas } from '@storybook/addon-docs';

#### Start
<Preview withSource="none">
<div class="container">
<osds-button>
<span slot='start'>Start</span>
MainContent
</osds-button>
</div>
</Preview>
<Canvas withSource="none">
<osds-button>
<span slot='start'>Start</span>
MainContent
</osds-button>
</Canvas >

```html
<osds-button>
Expand All @@ -18,14 +16,12 @@ import { Preview } from '@storybook/addon-docs/blocks';
```

#### End
<Preview withSource="none">
<div class="container">
<osds-button>
MainContent
<span slot='end'>End</span>
</osds-button>
</div>
</Preview>
<Canvas withSource="none">
<osds-button>
MainContent
<span slot='end'>End</span>
</osds-button>
</Canvas >

```html
<osds-button>
Expand All @@ -35,15 +31,13 @@ import { Preview } from '@storybook/addon-docs/blocks';
```

#### Start and end
<Preview withSource="none">
<div class="container">
<osds-button>
<span slot='start'>Start</span>
MainContent
<span slot='end'>End</span>
</osds-button>
</div>
</Preview>
<Canvas withSource="none">
<osds-button>
<span slot='start'>Start</span>
MainContent
<span slot='end'>End</span>
</osds-button>
</Canvas >

```html
<osds-button>
Expand Down
Loading

0 comments on commit 22e47ab

Please sign in to comment.