From e2ba14681b75427acc6cc5e0e9aaca933ae58971 Mon Sep 17 00:00:00 2001 From: Riya Lohia Date: Fri, 17 Jul 2020 18:09:55 +0530 Subject: [PATCH] feat: adds spinner and buttonGroup example stories --- .../atoms/button/__stories__/Cancel.story.tsx | 2 +- .../button/__stories__/Download.story.tsx | 26 +++++----- .../__stories__/IconLeftSecondary.story.tsx | 24 +++++----- .../LargeIconRightPrimary.story.tsx | 26 +++++----- .../__stories__/LoadingPrimary.story.tsx | 23 ++++----- .../__stories__/MenuHorizontal.story.tsx | 22 ++++----- .../atoms/button/__stories__/Submit.story.tsx | 2 +- .../atoms/chip/_stories_/Action.story.tsx | 1 + .../atoms/chip/_stories_/Input.story.tsx | 17 +++---- .../atoms/chip/_stories_/Selection.story.tsx | 18 +++---- .../message/__stories__/Success.story.tsx | 16 +++++++ .../__stories__/SuccessWithTitle.story.tsx | 17 +++++++ .../__stories__/FiftyPercent.story.tsx | 10 ++-- .../__stories__/ZeroPercent.story.tsx | 15 ------ .../__stories__/SeventyFivePercent.story.tsx | 16 ------- .../__stories__/InlineLoader.story.tsx | 20 ++++++++ .../spinner/__stories__/ModalLoader.story.tsx | 15 ++++++ .../__stories__/Completed.story.tsx | 14 +++--- .../statusHint/__stories__/Inactive.story.tsx | 14 +++--- .../statusHint/__stories__/Ongoing.story.tsx | 14 +++--- .../statusHint/__stories__/alert.story.tsx | 14 +++--- .../statusHint/__stories__/default.story.tsx | 12 ++--- .../statusHint/__stories__/info.story.tsx | 2 + .../statusHint/__stories__/success.story.tsx | 14 +++--- .../switchInput/__stories__/Regular.story.tsx | 1 + .../switchInput/__stories__/Tiny.story.tsx | 1 + .../buttonGroup/IconButtonGroup.story.tsx | 36 ++++++++++++++ .../buttonGroup/LabelButtonGroup.story.tsx | 39 +++++++++++++++ .../buttonGroup/SplitButton.story.tsx | 48 +++++++++++++++++++ css/src/components/grid.css | 9 ++++ 30 files changed, 338 insertions(+), 150 deletions(-) create mode 100644 core/components/atoms/message/__stories__/Success.story.tsx create mode 100644 core/components/atoms/message/__stories__/SuccessWithTitle.story.tsx delete mode 100644 core/components/atoms/progressBar/__stories__/ZeroPercent.story.tsx delete mode 100644 core/components/atoms/progressRing/__stories__/SeventyFivePercent.story.tsx create mode 100644 core/components/atoms/spinner/__stories__/InlineLoader.story.tsx create mode 100644 core/components/atoms/spinner/__stories__/ModalLoader.story.tsx create mode 100644 core/components/molecules/buttonGroup/IconButtonGroup.story.tsx create mode 100644 core/components/molecules/buttonGroup/LabelButtonGroup.story.tsx create mode 100644 core/components/molecules/buttonGroup/SplitButton.story.tsx diff --git a/core/components/atoms/button/__stories__/Cancel.story.tsx b/core/components/atoms/button/__stories__/Cancel.story.tsx index 171d6aee9b..b775650a25 100644 --- a/core/components/atoms/button/__stories__/Cancel.story.tsx +++ b/core/components/atoms/button/__stories__/Cancel.story.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import Button from '../Button'; -export const cancel = () => ( +export const cancelButton = () => ( - ); +export const downloadButton = () => ( + +); export default { title: 'Atoms|Button', diff --git a/core/components/atoms/button/__stories__/IconLeftSecondary.story.tsx b/core/components/atoms/button/__stories__/IconLeftSecondary.story.tsx index 49ec7ea986..bdf76d589f 100644 --- a/core/components/atoms/button/__stories__/IconLeftSecondary.story.tsx +++ b/core/components/atoms/button/__stories__/IconLeftSecondary.story.tsx @@ -2,18 +2,18 @@ import * as React from 'react'; import Button from '../Button'; export const iconLeftSecondary = () => ( - - ); + +); export default { title: 'Atoms|Button', diff --git a/core/components/atoms/button/__stories__/LargeIconRightPrimary.story.tsx b/core/components/atoms/button/__stories__/LargeIconRightPrimary.story.tsx index b242fb6df8..0a0b1fc9b8 100644 --- a/core/components/atoms/button/__stories__/LargeIconRightPrimary.story.tsx +++ b/core/components/atoms/button/__stories__/LargeIconRightPrimary.story.tsx @@ -1,19 +1,19 @@ import * as React from 'react'; import Button from '../Button'; -export const LargeIconRightPrimary = () => ( - - ); +export const LargeIconRightPrimary = () => ( + +); export default { title: 'Atoms|Button', diff --git a/core/components/atoms/button/__stories__/LoadingPrimary.story.tsx b/core/components/atoms/button/__stories__/LoadingPrimary.story.tsx index 5b83ccf8dd..4d67ba57e6 100644 --- a/core/components/atoms/button/__stories__/LoadingPrimary.story.tsx +++ b/core/components/atoms/button/__stories__/LoadingPrimary.story.tsx @@ -1,16 +1,17 @@ import * as React from 'react'; import Button from '../Button'; -export const loadingPrimary = () => ( - - ); + +export const loadingPrimary = () => ( + +); export default { title: 'Atoms|Button', diff --git a/core/components/atoms/button/__stories__/MenuHorizontal.story.tsx b/core/components/atoms/button/__stories__/MenuHorizontal.story.tsx index fc1553a21a..3d1830176f 100644 --- a/core/components/atoms/button/__stories__/MenuHorizontal.story.tsx +++ b/core/components/atoms/button/__stories__/MenuHorizontal.story.tsx @@ -2,17 +2,17 @@ import * as React from 'react'; import Button from '../Button'; export const menuHorizontal = () => ( - - ); + +); export default { title: 'Atoms|Button', diff --git a/core/components/atoms/button/__stories__/Submit.story.tsx b/core/components/atoms/button/__stories__/Submit.story.tsx index 5331d943e8..40fd1d7905 100644 --- a/core/components/atoms/button/__stories__/Submit.story.tsx +++ b/core/components/atoms/button/__stories__/Submit.story.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import Button from '../Button'; -export const submit = () => ( +export const submitButton = () => ( + + + +); + +export default { + title: 'Molecules|ButtonGroup', + component: Button, + parameters: { + docs: { + docPage: { + title: 'Button' + } + } + } +}; diff --git a/core/components/molecules/buttonGroup/SplitButton.story.tsx b/core/components/molecules/buttonGroup/SplitButton.story.tsx new file mode 100644 index 0000000000..007ac576fe --- /dev/null +++ b/core/components/molecules/buttonGroup/SplitButton.story.tsx @@ -0,0 +1,48 @@ +import * as React from 'react'; +import Button from '@/components/atoms/button'; +import Dropdown from '@/components/atoms/dropdown'; + +const options = [ + { + label: 'Download All', + value: 'Download All' + }, + { + label: 'Download Selected', + value: 'Download Selected' + } +]; + +export const splitButton = () => ( +
+ +
+ +
+
+); + +export default { + title: 'Molecules|ButtonGroup', + component: Button, + parameters: { + docs: { + docPage: { + title: 'Button' + } + } + } +}; diff --git a/css/src/components/grid.css b/css/src/components/grid.css index be122b648f..2183c02631 100644 --- a/css/src/components/grid.css +++ b/css/src/components/grid.css @@ -38,6 +38,15 @@ border-right: 3px solid var(--secondary); } +.Grid::-webkit-scrollbar { + width: var(--spacing); +} + +.Grid::-webkit-scrollbar-thumb { + background: var(--secondary); + border-radius: var(--spacing-m); +} + .Grid-pinned::-webkit-scrollbar { display: none; }