Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Shared-UX] Migrate Toolbar component from presentation to shared-ux #137224

Merged
merged 43 commits into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d6258d7
initial commit
rshen91 Jul 26, 2022
58f006c
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Jul 26, 2022
602ae1e
update story
rshen91 Jul 27, 2022
81a4079
Merge remote-tracking branch 'origin/toolbar-package' into toolbar-pa…
rshen91 Jul 27, 2022
a74445d
Merge remote-tracking branch 'upstream/main' into toolbar-package
rshen91 Jul 27, 2022
fa02dcd
Merge branch 'main' into toolbar-package
kibanamachine Jul 27, 2022
a1e042c
lint fix
rshen91 Jul 27, 2022
64d4d37
Merge remote-tracking branch 'origin/toolbar-package' into toolbar-pa…
rshen91 Jul 27, 2022
54bbf14
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Jul 27, 2022
850dd16
update test
rshen91 Jul 27, 2022
dd3f12e
Merge remote-tracking branch 'origin/toolbar-package' into toolbar-pa…
rshen91 Jul 27, 2022
f02dc3f
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Jul 27, 2022
df574e0
Merge branch 'main' into toolbar-package
rshen91 Jul 27, 2022
93a01e4
Merge branch 'main' into toolbar-package
rshen91 Jul 28, 2022
fb9e938
first pass at mdx file
rshen91 Jul 28, 2022
c3850bd
Merge remote-tracking branch 'upstream/main' into toolbar-package
rshen91 Jul 29, 2022
715e4fa
add comments
rshen91 Jul 29, 2022
a8f40ec
Merge remote-tracking branch 'upstream/main' into toolbar-package
rshen91 Aug 1, 2022
2c4c902
add Button type
rshen91 Aug 1, 2022
324b26d
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Aug 1, 2022
12d653d
fix
rshen91 Aug 1, 2022
1f1a7c0
Merge remote-tracking branch 'origin/toolbar-package' into toolbar-pa…
rshen91 Aug 1, 2022
4d1176d
Merge branch 'main' into toolbar-package
rshen91 Aug 1, 2022
dcd451e
missed test update
rshen91 Aug 1, 2022
fa629f2
add error for over 120 buttons
rshen91 Aug 1, 2022
093d9a5
Merge branch 'main' into toolbar-package
rshen91 Aug 1, 2022
e68ff91
Merge branch 'main' into toolbar-package
rshen91 Aug 3, 2022
7cbec14
Merge remote-tracking branch 'upstream/main' into toolbar-package
rshen91 Aug 15, 2022
d24158c
Merge remote-tracking branch 'origin/toolbar-package' into toolbar-pa…
rshen91 Aug 15, 2022
7d44eeb
Merge remote-tracking branch 'upstream/main' into toolbar-package
rshen91 Aug 16, 2022
142ac4c
clean up documentation
rshen91 Aug 16, 2022
316bdcb
Merge branch 'main' into toolbar-package
rshen91 Aug 18, 2022
584cf07
Merge remote-tracking branch 'upstream/main' into toolbar-package
rshen91 Aug 22, 2022
df3ac81
Merge remote-tracking branch 'upstream/main' into toolbar-package
rshen91 Aug 23, 2022
b753e86
Merge remote-tracking branch 'upstream/main' into toolbar-package
rshen91 Aug 24, 2022
92a7e35
Merge remote-tracking branch 'upstream/main' into toolbar-package
rshen91 Aug 25, 2022
3247796
code review
rshen91 Aug 25, 2022
80931f6
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Aug 25, 2022
379590c
add test for clicking the button within the toolbar click event
rshen91 Aug 25, 2022
55bd1ad
Merge remote-tracking branch 'origin/toolbar-package' into toolbar-pa…
rshen91 Aug 25, 2022
e56c646
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Aug 25, 2022
3eda666
Merge branch 'main' into toolbar-package
kibanamachine Aug 29, 2022
1612efa
Merge branch 'main' into toolbar-package
rshen91 Aug 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions packages/shared-ux/button_toolbar/README.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
---
id: sharedUX/ButtonToolbar
slug: /shared-ux/button-toolbar
title: Button Toolbar
description:
tags: ['shared-ux', 'component']
date: 2022-06-14
id: sharedUX/Components/Toolbar
slug: /shared-ux/components/button_toolbar
title: Toolbar
summary: An implementation of the popover, primary button, icon button group and add from library button
tags: ['shared-ux', 'component', 'toolbar']
date: 2022-07-28
---

This `toolbar` component accepts a `children` prop. Children can include a `popover` or a generic `button`. It can also include the `IconButtonGroup` and `AddFromLibrary` component for soltuions.
Styling of the popover and button follow the primary styles.


```jsx
<Toolbar>
{{
primaryButton,
iconButtonGroup,
extraButtons,
addFromLibraryButton,
}}
</Toolbar>
```
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default {
},
};

const quickButtons = [
const iconButtons = [
{
label: 'Text',
onClick: action('onTextClick'),
Expand Down Expand Up @@ -65,7 +65,7 @@ const argTypes = {
type Params = Record<keyof typeof argTypes, any>;

export const IconButtonGroup = ({ buttonCount }: Params) => {
return <Component legend="Example icon group" buttons={quickButtons.slice(0, buttonCount)} />;
return <Component legend="Example icon group" buttons={iconButtons.slice(0, buttonCount)} />;
};

IconButtonGroup.argTypes = argTypes;
4 changes: 4 additions & 0 deletions packages/shared-ux/button_toolbar/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ export type {

export { ToolbarPopover } from './popover';
export type { ToolbarPopoverProps } from './popover';

export { Toolbar } from './toolbar';
export type { ToolbarProps } from './toolbar';
export type { ToolbarButton } from './toolbar';
2 changes: 1 addition & 1 deletion packages/shared-ux/button_toolbar/src/popover/popover.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ tags: ['shared-ux', 'component']
date: 2022-03-28
---

This component is a thing wrapper around `EuiPopover` that handles open and close state. Its open and close state is controlled by a `ToolbarButton` button component.
This component is a thin wrapper around `EuiPopover` that handles open and close state. Its open and close state is controlled by a `ToolbarButton` button component.
This popover requires a label and children.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions packages/shared-ux/button_toolbar/src/toolbar/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* 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.
*/

export { Toolbar } from './toolbar';

export type { Props as ToolbarProps } from './toolbar';

export type { ToolbarButton } from './toolbar';
Loading