-
Notifications
You must be signed in to change notification settings - Fork 843
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Storybook] Add Playground stories for components with letter H (#7553)
- Loading branch information
Showing
6 changed files
with
211 additions
and
0 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
src/components/header/header_breadcrumbs/header_breadcrumbs.stories.tsx
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,47 @@ | ||
/* | ||
* 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 { EuiBreadcrumbsProps } from '../../breadcrumbs'; | ||
import { EuiHeaderBreadcrumbs } from './header_breadcrumbs'; | ||
|
||
const meta: Meta<EuiBreadcrumbsProps> = { | ||
title: 'EuiHeaderBreadcrumbs', | ||
component: EuiHeaderBreadcrumbs, | ||
args: { | ||
// Component defaults | ||
type: 'application', | ||
max: 4, | ||
truncate: true, | ||
responsive: { xs: 1, s: 2, m: 4 }, | ||
lastBreadcrumbIsCurrentPage: true, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<EuiBreadcrumbsProps>; | ||
|
||
export const Playground: Story = { | ||
args: { | ||
breadcrumbs: [ | ||
{ | ||
text: 'Breadcrumb 1', | ||
href: '#', | ||
}, | ||
{ | ||
text: 'Breadcrumb 2', | ||
href: '#', | ||
}, | ||
{ | ||
text: 'Current', | ||
href: '#', | ||
}, | ||
], | ||
}, | ||
}; |
31 changes: 31 additions & 0 deletions
31
src/components/header/header_links/header_link.stories.tsx
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,31 @@ | ||
/* | ||
* 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 { disableStorybookControls } from '../../../../.storybook/utils'; | ||
import { EuiHeaderLink, EuiHeaderLinkProps } from './header_link'; | ||
|
||
const meta: Meta<EuiHeaderLinkProps> = { | ||
title: 'EuiHeaderLink', | ||
component: EuiHeaderLink, | ||
// Component defaults | ||
args: { | ||
isActive: false, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<EuiHeaderLinkProps>; | ||
|
||
export const Playground: Story = { | ||
argTypes: disableStorybookControls(['buttonRef']), | ||
args: { | ||
children: 'Header link', | ||
}, | ||
}; |
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,35 @@ | ||
/* | ||
* 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 { EuiHealth, EuiHealthProps } from './health'; | ||
|
||
const meta: Meta<EuiHealthProps> = { | ||
title: 'EuiHealth', | ||
component: EuiHealth, | ||
argTypes: { | ||
color: { control: 'text' }, | ||
}, | ||
// Component defaults | ||
args: { | ||
textSize: 's', | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<EuiHealthProps>; | ||
|
||
export const Playground: Story = { | ||
argTypes: hideStorybookControls(['aria-label']), | ||
args: { | ||
children: 'Status', | ||
color: 'success', | ||
}, | ||
}; |
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,41 @@ | ||
/* | ||
* 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 { EuiHighlight, EuiHighlightProps } from './highlight'; | ||
|
||
const meta: Meta<EuiHighlightProps> = { | ||
title: 'EuiHighlight', | ||
component: EuiHighlight, | ||
argTypes: {}, | ||
// Component defaults | ||
args: { | ||
strict: false, | ||
highlightAll: false, | ||
hasScreenReaderHelpText: true, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<EuiHighlightProps>; | ||
|
||
export const Playground: Story = { | ||
args: { | ||
children: 'The quick brown fox jumped over the lazy dog.', | ||
search: 'Quick', | ||
}, | ||
}; | ||
|
||
export const MultipleSearchStrings: Story = { | ||
args: { | ||
children: 'The quick brown fox jumped over the lazy dog.', | ||
search: ['Fox', 'Dog'], | ||
highlightAll: true, | ||
}, | ||
}; |
30 changes: 30 additions & 0 deletions
30
src/components/horizontal_rule/horizontal_rule.stories.tsx
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,30 @@ | ||
/* | ||
* 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 { EuiHorizontalRule, EuiHorizontalRuleProps } from './horizontal_rule'; | ||
|
||
const meta: Meta<EuiHorizontalRuleProps> = { | ||
title: 'EuiHorizontalRule', | ||
component: EuiHorizontalRule, | ||
argTypes: {}, | ||
// Component defaults | ||
args: { | ||
size: 'full', | ||
margin: 'l', | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<EuiHorizontalRuleProps>; | ||
|
||
export const Playground: Story = { | ||
argTypes: hideStorybookControls(['aria-label']), | ||
}; |
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,27 @@ | ||
/* | ||
* 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 { EuiHideFor, EuiHideForProps } from './hide_for'; | ||
|
||
const meta: Meta<EuiHideForProps> = { | ||
title: 'EuiHideFor', | ||
component: EuiHideFor, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<EuiHideForProps>; | ||
|
||
export const Playground: Story = { | ||
args: { | ||
sizes: ['xs'], | ||
children: | ||
'Try changing the Storybook viewport, or adding the `l` size, to see how it affects the visibility of this text.', | ||
}, | ||
}; |