-
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.
[EuiButtonIcon] Add Storybook playground
+ configure all playgrounds to sort props by required first, then alphabetical
- Loading branch information
Showing
3 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
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
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
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,40 @@ | ||
/* | ||
* 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 { icon } from '../../icon/assets/face_happy'; // TODO: Remove this once icons can be loaded by strings | ||
import { EuiButtonIcon, EuiButtonIconProps } from './button_icon'; | ||
|
||
const meta: Meta<EuiButtonIconProps> = { | ||
title: 'EuiButtonIcon', | ||
component: EuiButtonIcon, | ||
argTypes: { | ||
iconType: { | ||
// TODO: Storybook can't load icons dynamically | ||
// Disable user `iconType` input/controls for now | ||
control: 'function', | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<EuiButtonIconProps>; | ||
|
||
export const Playground: Story = { | ||
args: { | ||
iconType: icon, // TODO: Storybook can't load icons dynamically | ||
color: 'primary', | ||
display: 'empty', | ||
size: 'xs', | ||
iconSize: 'm', | ||
isDisabled: false, | ||
isLoading: false, | ||
isSelected: false, | ||
}, | ||
}; |