Skip to content

Commit 22f44b0

Browse files
rshen91cchaos
andauthored
Apply suggestions from code review
Co-authored-by: Caroline Horn <[email protected]>
1 parent faab6f2 commit 22f44b0

File tree

5 files changed

+17
-18
lines changed

5 files changed

+17
-18
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
2-
id: sharedUX/Components/SolutionToolbar/Quick_Group
3-
slug: /shared-ux/components/toolbar/solution_toolbar/quick_group
4-
title: Solution Toolbar Quick Group
5-
summary: 'An array of buttons for the solution toolbar'
2+
id: sharedUX/Components/Toolbar/Icon_Button_Group
3+
slug: /shared-ux/components/toolbar/icon_button_group
4+
title: Toolbar Icon Button Group
5+
summary: 'An array of icon-only buttons for use in a toolbar'
66
tags: ['shared-ux', 'component']
77
date: 2022-02-23
88
---
99

1010
> This documentation is in-progress.
1111
12-
This component requires a prop that consists of a series of buttons that can then be displayed based on the number of buttons desired. An example of a button that can be part of an array of quick buttons is included below:
12+
This component requires a prop that consists of a series of buttons that can then be displayed based on the number of buttons desired. An example of a button that can be part of an array of icon buttons is included below:
1313

1414
```
1515
{
1616
label: 'Text',
1717
onClick: clickHandler,
18-
IconType: 'visText',
18+
iconType: 'visText',
1919
}
2020
```

src/plugins/shared_ux/public/components/toolbar/buttons/icon_button_group/icon_button_group.stories.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import { IconButtonGroup } from './icon_button_group';
1313
import mdx from './icon_button_group.mdx';
1414

1515
export default {
16-
title: 'Toolbar/Toolbar Icon Button Group',
17-
description: 'A collection of buttons that is a part of the solution toolbar.',
16+
title: 'Toolbar/Icon Button Group',
17+
description: 'A collection of buttons that is a part of a toolbar.',
1818
parameters: {
1919
docs: {
2020
page: mdx,
@@ -46,7 +46,6 @@ const quickButtons = [
4646
},
4747
{
4848
label: 'Markup',
49-
getLegend: '',
5049
onClick: action('onMarkupClick'),
5150
iconType: 'visVega',
5251
},
@@ -62,7 +61,7 @@ export const ConnectedComponent: Story<{ quickButtonCount: number }> = ({ quickB
6261
};
6362

6463
ConnectedComponent.argTypes = {
65-
quickButtonCount: {
64+
buttonCount: {
6665
defaultValue: 2,
6766
control: {
6867
type: 'number',

src/plugins/shared_ux/public/components/toolbar/buttons/icon_button_group/icon_button_group.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
EuiButtonGroupProps,
1717
} from '@elastic/eui';
1818
import { IconButtonGroupStyles } from './icon_button_group.styles';
19-
export interface QuickButton {
19+
export interface IconButton {
2020
/**
2121
* The accessible button label
2222
*/
@@ -40,16 +40,16 @@ export interface Props {
4040
/**
4141
* Array of `QuickButton`s
4242
*/
43-
buttons: QuickButton[];
43+
buttons: IconButton[];
4444
}
4545

46-
type Option = EuiButtonGroupOptionProps & Omit<QuickButton, 'label'>;
46+
type Option = EuiButtonGroupOptionProps & Omit<IconButton, 'label'>;
4747

4848
export const IconButtonGroup = ({ buttons, legend }: Props) => {
4949
const euiTheme = useEuiTheme();
5050
const iconButtonGroupStyles = IconButtonGroupStyles(euiTheme);
5151

52-
const buttonGroupOptions: Option[] = buttons.map((button: QuickButton, index) => {
52+
const buttonGroupOptions: Option[] = buttons.map((button: IconButton, index) => {
5353
const { label, title = label, ...rest } = button;
5454

5555
return {
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
id: sharedUX/Components/ToolbarButton
2+
id: sharedUX/Components/Toolbar/Primary_Button
33
slug: /shared-ux/components/toolbar/buttons/primary
44
title: Toolbar Button
55
summary: An opinionated implementation of the toolbar extracted to just the button.
@@ -9,4 +9,4 @@ date: 2022-02-17
99

1010
> This documentation is in-progress.
1111
12-
This button is a part of the toolbar component. This button has primary styling and requires a label. OnClick handlers and icon types are supported as an extension of EuiButtonProps. Icons are always on the left of any labels within the button.
12+
This button is a part of the toolbar component. This button has primary styling and requires a `label`. Interaction (`onClick`) handlers and `iconType`s are supported as an extension of EuiButtonProps. Icons are always on the left of any labels within the button.

src/plugins/shared_ux/public/components/toolbar/buttons/primary/primary.stories.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import { ToolbarButton } from './primary';
1212
import mdx from './primary.mdx';
1313

1414
export default {
15-
title: 'Toolbar/Toolbar Button',
16-
description: 'A primary button that is a part of toolbar.',
15+
title: 'Toolbar/Primary button',
16+
description: 'A primary button that is a part of a toolbar.',
1717
parameters: {
1818
docs: {
1919
page: mdx,

0 commit comments

Comments
 (0)