Skip to content

Commit 038e186

Browse files
authored
Merge pull request #2717 from Teradata/chore/DSYS-685
build(storybook): add mdx documentation to skeleton
2 parents e464bb9 + 903f12c commit 038e186

8 files changed

Lines changed: 56 additions & 2 deletions

File tree

libs/components/.storybook/main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ const rootMain = require('../../../.storybook/main.js');
22
const { mergeConfig } = require('vite');
33

44
// Use the following syntax to add addons!
5-
((rootMain.stories = ['../**/*.stories.@(js|jsx|ts|tsx|mdx)']),
5+
((rootMain.stories = [
6+
'../**/*.stories.@(js|jsx|ts|tsx)',
7+
'../**/Overview.mdx',
8+
]),
69
(rootMain.core = { builder: '@storybook/builder-vite' }));
710
module.exports = {
811
...rootMain,
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import * as DialogStories from './dialog.stories';
1818
{/* <Story id="components-dialog--anatomy" /> is deprecated, please migrate it to <Story of={referenceToStory} /> see: https://storybook.js.org/migration-guides/7.0 */}
1919

2020
{' '}
21+
2122
<Story id="components-dialog--anatomy" />
2223

2324
---
@@ -29,11 +30,13 @@ import * as DialogStories from './dialog.stories';
2930
{/* <Story id="components-dialog--logout" /> is deprecated, please migrate it to <Story of={referenceToStory} /> see: https://storybook.js.org/migration-guides/7.0 */}
3031

3132
{' '}
33+
3234
<Story id="components-dialog--logout" />
3335

3436
### Destructive dialog
3537

3638
{/* <Story id="components-dialog--udf" /> is deprecated, please migrate it to <Story of={referenceToStory} /> see: https://storybook.js.org/migration-guides/7.0 */}
3739

3840
{' '}
41+
3942
<Story id="components-dialog--udf" />
File renamed without changes.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { Canvas, Meta, Source } from '@storybook/addon-docs/blocks';
2+
import { useDarkMode } from '@vueless/storybook-dark-mode';
3+
import * as SkeletonStories from './skeleton.stories';
4+
5+
export const DarkSource = (props) => {
6+
const isDark = useDarkMode();
7+
return <Source {...props} dark={isDark} />;
8+
};
9+
10+
<Meta of={SkeletonStories} />
11+
12+
# Skeleton
13+
14+
These examples use [skeleton-elements](https://skeleton-elements.nolimits4web.com/) — a third-party
15+
library for skeleton screen / ghost element effects. The stories below show how to integrate it.
16+
17+
---
18+
19+
## Setup
20+
21+
**1. Install**
22+
23+
<DarkSource language="bash" code="npm install skeleton-elements" />
24+
25+
**2. Import styles**
26+
27+
<DarkSource language="js" code="import 'skeleton-elements/css';" />
28+
29+
**3. Apply classes to your markup**
30+
31+
<DarkSource
32+
language="html"
33+
code={`<p class="skeleton-text skeleton-effect-fade">Loading…</p>
34+
<div class="skeleton-block skeleton-effect-wave" style="height: 200px;"></div>`}
35+
/>
36+
37+
Effect modifiers: `skeleton-effect-fade` · `skeleton-effect-wave` · `skeleton-effect-pulse`
38+
39+
---
40+
41+
## STORIES
42+
43+
<Canvas of={SkeletonStories.DataTable} />
44+
45+
<Canvas of={SkeletonStories.Typography} />
46+
47+
<Canvas of={SkeletonStories.Content} />
48+
49+
<Canvas of={SkeletonStories.Checkbox} />

libs/components/src/skeleton/skeleton.stories.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import 'skeleton-elements/css';
99

1010
export default {
1111
title: 'Components/Skeleton',
12-
tags: ['autodocs'],
1312
};
1413

1514
const skeletonClsName = 'skeleton-text';

0 commit comments

Comments
 (0)