Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(skeleton): add storybook playground story and cleanup #12450

Merged
merged 2 commits into from
Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 />;

This file was deleted.

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
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
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,
},
};