-
Notifications
You must be signed in to change notification settings - Fork 844
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Storybook] Add stories for more components (letters R-S) - Part 4 (#…
…7733) Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com> Co-authored-by: Cee Chen <constance.chen@elastic.co>
- Loading branch information
1 parent
954ca22
commit 20e71da
Showing
18 changed files
with
286 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+927 Bytes
.loki/reference/chrome_desktop_Navigation_EuiSteps_EuiStepNumber_Playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.53 KB
...desktop_Navigation_EuiSteps_EuiStepsHorizontal_EuiStepHorizontal_Playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.2 KB
...esktop_Navigation_EuiSteps_EuiStepsHorizontal_EuiStepsHorizontal_Playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.96 KB
.loki/reference/chrome_desktop_Navigation_EuiSteps_EuiSteps_EuiStep_Playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+43.1 KB
.loki/reference/chrome_desktop_Navigation_EuiSteps_EuiSteps_Playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.7 KB
.loki/reference/chrome_desktop_Navigation_EuiSteps_EuiSubSteps_Playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.71 KB
.loki/reference/chrome_mobile_Navigation_EuiSteps_EuiStepNumber_Playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.21 KB
..._mobile_Navigation_EuiSteps_EuiStepsHorizontal_EuiStepHorizontal_Playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.4 KB
...mobile_Navigation_EuiSteps_EuiStepsHorizontal_EuiStepsHorizontal_Playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.81 KB
.loki/reference/chrome_mobile_Navigation_EuiSteps_EuiSteps_EuiStep_Playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+87.3 KB
.loki/reference/chrome_mobile_Navigation_EuiSteps_EuiSteps_Playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.88 KB
.loki/reference/chrome_mobile_Navigation_EuiSteps_EuiSubSteps_Playground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { hideStorybookControls } from '../../../.storybook/utils'; | ||
import { STATUS } from './step_number'; | ||
import { EuiStep, EuiStepProps } from './step'; | ||
|
||
const meta: Meta<EuiStepProps> = { | ||
title: 'Navigation/EuiSteps/EuiSteps/EuiStep', | ||
component: EuiStep, | ||
argTypes: { | ||
status: { options: [undefined, ...STATUS] }, | ||
}, | ||
args: { | ||
headingElement: 'p', | ||
titleSize: 's', | ||
step: 1, | ||
}, | ||
}; | ||
hideStorybookControls(meta, ['aria-label']); | ||
|
||
export default meta; | ||
type Story = StoryObj<EuiStepProps>; | ||
|
||
export const Playground: Story = { | ||
args: { | ||
title: 'Step 1', | ||
children: 'lorem ipsum', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { | ||
enableFunctionToggleControls, | ||
hideStorybookControls, | ||
} from '../../../.storybook/utils'; | ||
import { EuiStepHorizontal, EuiStepHorizontalProps } from './step_horizontal'; | ||
|
||
const meta: Meta<EuiStepHorizontalProps> = { | ||
title: 'Navigation/EuiSteps/EuiStepsHorizontal/EuiStepHorizontal', | ||
component: EuiStepHorizontal, | ||
args: { | ||
size: 'm', | ||
step: 1, | ||
status: 'incomplete', | ||
// set up for easier testing/QA | ||
disabled: false, | ||
}, | ||
}; | ||
hideStorybookControls(meta, ['aria-label']); | ||
enableFunctionToggleControls(meta, ['onClick']); | ||
|
||
export default meta; | ||
type Story = StoryObj<EuiStepHorizontalProps>; | ||
|
||
export const Playground: Story = { | ||
args: { | ||
title: 'Step 1', | ||
children: 'lorem ipsum', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { hideStorybookControls } from '../../../.storybook/utils'; | ||
import { EuiStepNumber, EuiStepNumberProps, STATUS } from './step_number'; | ||
|
||
const meta: Meta<EuiStepNumberProps> = { | ||
title: 'Navigation/EuiSteps/Subcomponents/EuiStepNumber', | ||
component: EuiStepNumber, | ||
argTypes: { | ||
status: { options: [undefined, ...STATUS] }, | ||
}, | ||
args: { | ||
titleSize: 's', | ||
}, | ||
}; | ||
hideStorybookControls(meta, ['aria-label']); | ||
|
||
export default meta; | ||
type Story = StoryObj<EuiStepNumberProps>; | ||
|
||
export const Playground: Story = { | ||
args: { | ||
number: 1, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { moveStorybookControlsToCategory } from '../../../.storybook/utils'; | ||
import { EuiSteps, EuiStepsProps } from './steps'; | ||
|
||
const meta: Meta<EuiStepsProps> = { | ||
title: 'Navigation/EuiSteps/EuiSteps', | ||
component: EuiSteps, | ||
args: { | ||
firstStepNumber: 1, | ||
headingElement: 'p', | ||
titleSize: 's', | ||
}, | ||
}; | ||
moveStorybookControlsToCategory( | ||
meta, | ||
['headingElement', 'titleSize'], | ||
'EuiStep props' | ||
); | ||
|
||
export default meta; | ||
type Story = StoryObj<EuiStepsProps>; | ||
|
||
export const Playground: Story = { | ||
args: { | ||
steps: [ | ||
{ | ||
title: 'Step 1', | ||
children: 'lorem ipsum', | ||
}, | ||
{ | ||
title: 'Step 2', | ||
children: 'lorem ipsum', | ||
status: 'current', | ||
}, | ||
{ | ||
title: 'Step 3', | ||
children: 'lorem ipsum', | ||
status: 'complete', | ||
}, | ||
{ | ||
title: 'Step 4', | ||
children: 'lorem ipsum', | ||
status: 'incomplete', | ||
}, | ||
{ | ||
title: 'Step 5', | ||
children: 'lorem ipsum', | ||
status: 'warning', | ||
}, | ||
{ | ||
title: 'Step 6', | ||
children: 'lorem ipsum', | ||
status: 'danger', | ||
}, | ||
{ | ||
title: 'Step 7', | ||
children: 'lorem ipsum', | ||
status: 'loading', | ||
}, | ||
{ | ||
title: 'Step 8', | ||
children: 'lorem ipsum', | ||
status: 'disabled', | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { action } from '@storybook/addon-actions'; | ||
|
||
import { moveStorybookControlsToCategory } from '../../../.storybook/utils'; | ||
import { | ||
EuiStepsHorizontal, | ||
EuiStepsHorizontalProps, | ||
} from './steps_horizontal'; | ||
|
||
const meta: Meta<EuiStepsHorizontalProps> = { | ||
title: 'Navigation/EuiSteps/EuiStepsHorizontal', | ||
component: EuiStepsHorizontal, | ||
args: { | ||
size: 'm', | ||
}, | ||
}; | ||
moveStorybookControlsToCategory(meta, ['size'], 'EuiStepHorizontal props'); | ||
|
||
export default meta; | ||
type Story = StoryObj<EuiStepsHorizontalProps>; | ||
|
||
const onClick = action('onClick'); | ||
|
||
export const Playground: Story = { | ||
args: { | ||
steps: [ | ||
{ | ||
title: 'Step 1', | ||
onClick, | ||
}, | ||
{ | ||
title: 'Step 2', | ||
status: 'current', | ||
onClick, | ||
}, | ||
{ | ||
title: 'Step 3', | ||
status: 'complete', | ||
onClick, | ||
}, | ||
{ | ||
title: 'Step 4', | ||
status: 'incomplete', | ||
onClick, | ||
}, | ||
{ | ||
title: 'Step 5', | ||
status: 'warning', | ||
onClick, | ||
}, | ||
{ | ||
title: 'Step 6', | ||
status: 'danger', | ||
onClick, | ||
}, | ||
{ | ||
title: 'Step 7', | ||
status: 'loading', | ||
onClick, | ||
}, | ||
{ | ||
title: 'Step 8', | ||
status: 'disabled', | ||
onClick, | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { EuiSubSteps, EuiSubStepsProps } from './sub_steps'; | ||
|
||
const meta: Meta<EuiSubStepsProps> = { | ||
title: 'Navigation/EuiSteps/Subcomponents/EuiSubSteps', | ||
component: EuiSubSteps, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<EuiSubStepsProps>; | ||
|
||
export const Playground: Story = { | ||
args: { | ||
children: 'lorem ipsum dolor sit', | ||
}, | ||
}; |