Skip to content

Commit

Permalink
chore(skeleton): add storybook playground story and cleanup (#12450)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
alisonjoseph and kodiakhq[bot] authored Nov 9, 2022
1 parent af2242c commit e885af3
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 195 deletions.
82 changes: 0 additions & 82 deletions packages/react/src/components/Skeleton/next/Skeleton.stories.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React from 'react';
import SkeletonIcon from '../SkeletonIcon';
import SkeletonIcon from '.';

const propsSkeleton = {
style: {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ const SkeletonPlaceholder = ({ className, ...other }) => {

SkeletonPlaceholder.propTypes = {
/**
* the class to be applied to the component
* Add a custom class to the component
* to set the height and width
*/
className: PropTypes.string,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Props } from '@storybook/addon-docs';
import { Story, Props, Preview } from '@storybook/addon-docs';

# SkeletonPlaceholder

Expand All @@ -10,6 +10,10 @@ import { Props } from '@storybook/addon-docs';

## Overview

<Preview>
<Story id="components-skeleton-skeletonplaceholder--default" />
</Preview>

## Component API

<Props />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright IBM Corp. 2016, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

/* eslint-disable no-console */

import React from 'react';

import SkeletonPlaceholder from '.';
import mdx from './SkeletonPlaceholder.mdx';

export default {
title: 'Components/Skeleton/SkeletonPlaceholder',
component: SkeletonPlaceholder,
parameters: {
docs: {
page: mdx,
},
},
};

export const Default = () => <SkeletonPlaceholder />;
47 changes: 0 additions & 47 deletions packages/react/src/components/SkeletonText/SkeletonText-story.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/react/src/components/SkeletonText/SkeletonText.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ SkeletonText.propTypes = {
*/
heading: PropTypes.bool,
/**
* the number of lines in a paragraph
* the number of lines shown if paragraph is true
*/
lineCount: PropTypes.number,
/**
Expand Down
6 changes: 5 additions & 1 deletion packages/react/src/components/SkeletonText/SkeletonText.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Props } from '@storybook/addon-docs';
import { Story, Props, Preview } from '@storybook/addon-docs';

# SkeletonText

Expand All @@ -10,6 +10,10 @@ import { Props } from '@storybook/addon-docs';

## Overview

<Preview>
<Story id="components-skeleton-skeletontext--default" />
</Preview>

## Component API

<Props />
Expand Down
57 changes: 57 additions & 0 deletions packages/react/src/components/SkeletonText/SkeletonText.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/**
* Copyright IBM Corp. 2016, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

/* eslint-disable no-console */

import React from 'react';

import SkeletonText from '.';
import mdx from './SkeletonText.mdx';

export default {
title: 'Components/Skeleton/SkeletonText',
component: SkeletonText,
parameters: {
docs: {
page: mdx,
},
},
};

export const Default = () => <SkeletonText />;

export const Playground = (args) => <SkeletonText {...args} />;

Playground.argTypes = {
className: {
control: false,
},
heading: {
control: {
type: 'boolean',
},
defaultValue: false,
},
paragraph: {
control: {
type: 'boolean',
},
defaultValue: false,
},
width: {
control: {
type: 'text',
},
defaultValue: '100%',
},
lineCount: {
control: {
type: 'number',
},
defaultValue: 3,
},
};

0 comments on commit e885af3

Please sign in to comment.