Skip to content

Commit

Permalink
chore(inline-loading): storybook controls (#12283)
Browse files Browse the repository at this point in the history
Co-authored-by: TJ Egan <tw15egan@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Oct 17, 2022
1 parent d98cd74 commit 56921b1
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 123 deletions.
3 changes: 0 additions & 3 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3738,9 +3738,6 @@ Map {
"render": [Function],
},
"InlineLoading" => Object {
"defaultProps": Object {
"successDelay": 1500,
},
"propTypes": Object {
"className": Object {
"type": "string",
Expand Down
113 changes: 0 additions & 113 deletions packages/react/src/components/InlineLoading/InlineLoading-story.js

This file was deleted.

5 changes: 1 addition & 4 deletions packages/react/src/components/InlineLoading/InlineLoading.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function InlineLoading({
iconDescription,
description,
onSuccess,
successDelay,
successDelay = 1500,
...other
}) {
const prefix = usePrefix();
Expand Down Expand Up @@ -110,6 +110,3 @@ InlineLoading.propTypes = {
*/
successDelay: PropTypes.number,
};
InlineLoading.defaultProps = {
successDelay: 1500,
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Props } from '@storybook/addon-docs';
import { Props, Preview, Story } from '@storybook/addon-docs';
import InlineLoading from '../InlineLoading';

# InlineLoading

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

## Overview

<Preview>
<Story id="components-inlineloading--default" />
</Preview>

## Component API

<Props />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@
*/

import React, { useState } from 'react';
import Button from '../../Button';
import InlineLoading from '../';
import Button from '../Button';
import InlineLoading from '.';
import mdx from './InlineLoading.mdx';

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

export const Default = () => (
Expand Down Expand Up @@ -78,3 +84,35 @@ export const UxExample = () => {
</MockSubmission>
);
};

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

Playground.argTypes = {
className: {
table: {
disable: true,
},
},
description: {
control: {
type: 'text',
},
defaultValue: 'Loading',
},
iconDescription: {
control: {
type: 'text',
},
defaultValue: 'Loading data...',
},
onSuccess: {
table: {
disable: true,
},
},
successDelay: {
table: {
disable: true,
},
},
};

0 comments on commit 56921b1

Please sign in to comment.