diff --git a/package.json b/package.json index fd4892f5d53d0..0cf2676cdc172 100644 --- a/package.json +++ b/package.json @@ -210,6 +210,7 @@ "@kbn/server-route-repository": "link:bazel-bin/packages/kbn-server-route-repository", "@kbn/shared-ux-avatar-solution": "link:bazel-bin/packages/shared-ux/avatar/solution", "@kbn/shared-ux-button-exit-full-screen": "link:bazel-bin/packages/shared-ux/button/exit_full_screen", + "@kbn/shared-ux-button-toolbar": "link:bazel-bin/packages/shared-ux/button_toolbar", "@kbn/shared-ux-components": "link:bazel-bin/packages/kbn-shared-ux-components", "@kbn/shared-ux-link-redirect-app": "link:bazel-bin/packages/shared-ux/link/redirect_app", "@kbn/shared-ux-page-analytics-no-data": "link:bazel-bin/packages/shared-ux/page/analytics_no_data", @@ -749,6 +750,7 @@ "@types/kbn__server-route-repository": "link:bazel-bin/packages/kbn-server-route-repository/npm_module_types", "@types/kbn__shared-ux-avatar-solution": "link:bazel-bin/packages/shared-ux/avatar/solution/npm_module_types", "@types/kbn__shared-ux-button-exit-full-screen": "link:bazel-bin/packages/shared-ux/button/exit_full_screen/npm_module_types", + "@types/kbn__shared-ux-button-toolbar": "link:bazel-bin/packages/shared-ux/button_toolbar/npm_module_types", "@types/kbn__shared-ux-components": "link:bazel-bin/packages/kbn-shared-ux-components/npm_module_types", "@types/kbn__shared-ux-link-redirect-app": "link:bazel-bin/packages/shared-ux/link/redirect_app/npm_module_types", "@types/kbn__shared-ux-page-analytics-no-data": "link:bazel-bin/packages/shared-ux/page/analytics_no_data/npm_module_types", diff --git a/packages/BUILD.bazel b/packages/BUILD.bazel index 9bcf6572cdc08..cc5c0e13dcccf 100644 --- a/packages/BUILD.bazel +++ b/packages/BUILD.bazel @@ -144,6 +144,7 @@ filegroup( "//packages/kbn-utility-types:build", "//packages/kbn-utils:build", "//packages/shared-ux/avatar/solution:build", + "//packages/shared-ux/button_toolbar:build", "//packages/shared-ux/button/exit_full_screen:build", "//packages/shared-ux/link/redirect_app:build", "//packages/shared-ux/page/analytics_no_data:build", @@ -276,6 +277,7 @@ filegroup( "//packages/kbn-utility-types:build_types", "//packages/kbn-utils:build_types", "//packages/shared-ux/avatar/solution:build_types", + "//packages/shared-ux/button_toolbar:build_types", "//packages/shared-ux/button/exit_full_screen:build_types", "//packages/shared-ux/link/redirect_app:build_types", "//packages/shared-ux/page/analytics_no_data:build_types", diff --git a/packages/kbn-bazel-packages/src/bazel_package_dirs.ts b/packages/kbn-bazel-packages/src/bazel_package_dirs.ts index a23b54317454a..5c0bfb5d4595b 100644 --- a/packages/kbn-bazel-packages/src/bazel_package_dirs.ts +++ b/packages/kbn-bazel-packages/src/bazel_package_dirs.ts @@ -21,6 +21,7 @@ import { REPO_ROOT } from '@kbn/utils'; */ export const BAZEL_PACKAGE_DIRS = [ 'packages', + 'packages/shared-ux', 'packages/shared-ux/*', 'packages/analytics', 'packages/analytics/shippers', diff --git a/packages/kbn-shared-ux-components/src/index.ts b/packages/kbn-shared-ux-components/src/index.ts index 68772ed90121c..970e584d95782 100644 --- a/packages/kbn-shared-ux-components/src/index.ts +++ b/packages/kbn-shared-ux-components/src/index.ts @@ -6,7 +6,6 @@ * Side Public License, v 1. */ -export { ToolbarButton, IconButtonGroup, AddFromLibraryButton, ToolbarPopover } from './toolbar'; export { KibanaPageTemplateSolutionNav } from './page_template/solution_nav'; // TODO: clintandrewhall - NoDataPageProps is a temporary addition until it is split into its own package diff --git a/packages/kbn-shared-ux-components/src/toolbar/buttons/add_from_library/__snapshots__/add_from_library.test.tsx.snap b/packages/kbn-shared-ux-components/src/toolbar/buttons/add_from_library/__snapshots__/add_from_library.test.tsx.snap deleted file mode 100644 index 520184f0f96dc..0000000000000 --- a/packages/kbn-shared-ux-components/src/toolbar/buttons/add_from_library/__snapshots__/add_from_library.test.tsx.snap +++ /dev/null @@ -1,76 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[` is rendered 1`] = ` - - - - - - - - - -`; diff --git a/packages/kbn-shared-ux-components/src/toolbar/buttons/add_from_library/add_from_library.mdx b/packages/kbn-shared-ux-components/src/toolbar/buttons/add_from_library/add_from_library.mdx deleted file mode 100644 index f6a2f92cd41eb..0000000000000 --- a/packages/kbn-shared-ux-components/src/toolbar/buttons/add_from_library/add_from_library.mdx +++ /dev/null @@ -1,10 +0,0 @@ ---- -id: sharedUX/Components/AddFromLibraryButton -slug: /shared-ux/components/toolbar/buttons/add_from_library -title: Add From Library Button -summary: An example of the primary button -tags: ['shared-ux', 'component'] -date: 2022-03-18 ---- - -This button is an example of the primary button. diff --git a/packages/kbn-shared-ux-components/src/toolbar/buttons/icon_button_group/__snapshots__/icon_button_group.test.tsx.snap b/packages/kbn-shared-ux-components/src/toolbar/buttons/icon_button_group/__snapshots__/icon_button_group.test.tsx.snap deleted file mode 100644 index 8091bd222d1a3..0000000000000 --- a/packages/kbn-shared-ux-components/src/toolbar/buttons/icon_button_group/__snapshots__/icon_button_group.test.tsx.snap +++ /dev/null @@ -1,326 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[` is rendered 1`] = ` - - - -
- - - Legend - - -
- - - - - - - , - , - , - , - ], - }, - } - } - isStringTag={false} - serialized={ - Object { - "map": undefined, - "name": "iuv015-EuiButtonGroup", - "next": undefined, - "styles": "&.euiButtonGroupButton{background-color:#FFF;border:1px solid #D3DAE6 !important;&:first-of-type{border-top-left-radius:6px !important;border-bottom-left-radius:6px !important;}&:last-of-type{border-top-right-radius:6px !important;border-bottom-right-radius:6px !important;}};;label:EuiButtonGroup;", - "toString": [Function], - } - } - /> - - - - - - -
-
-
-
-
-`; diff --git a/packages/kbn-shared-ux-components/src/toolbar/buttons/icon_button_group/icon_button_group.mdx b/packages/kbn-shared-ux-components/src/toolbar/buttons/icon_button_group/icon_button_group.mdx deleted file mode 100644 index 979bfb24a0f2f..0000000000000 --- a/packages/kbn-shared-ux-components/src/toolbar/buttons/icon_button_group/icon_button_group.mdx +++ /dev/null @@ -1,20 +0,0 @@ ---- -id: sharedUX/Components/Toolbar/Icon_Button_Group -slug: /shared-ux/components/toolbar/icon_button_group -title: Toolbar Icon Button Group -summary: 'An array of icon-only buttons for use in a toolbar' -tags: ['shared-ux', 'component'] -date: 2022-02-23 ---- - -> This documentation is in-progress. - -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: - -``` - { - label: 'Text', - onClick: clickHandler, - iconType: 'visText', - } -``` diff --git a/packages/kbn-shared-ux-components/src/toolbar/buttons/primary/__snapshots__/primary.test.tsx.snap b/packages/kbn-shared-ux-components/src/toolbar/buttons/primary/__snapshots__/primary.test.tsx.snap deleted file mode 100644 index fbe628e30314c..0000000000000 --- a/packages/kbn-shared-ux-components/src/toolbar/buttons/primary/__snapshots__/primary.test.tsx.snap +++ /dev/null @@ -1,101 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[` is rendered 1`] = ` - - - - - - - - - -`; diff --git a/packages/kbn-shared-ux-components/src/toolbar/buttons/primary/primary.mdx b/packages/kbn-shared-ux-components/src/toolbar/buttons/primary/primary.mdx deleted file mode 100644 index 5b72eb92360be..0000000000000 --- a/packages/kbn-shared-ux-components/src/toolbar/buttons/primary/primary.mdx +++ /dev/null @@ -1,12 +0,0 @@ ---- -id: sharedUX/Components/ToolbarButton -slug: /shared-ux/components/toolbar/buttons/primary -title: Toolbar Button -summary: An opinionated implementation of the toolbar extracted to just the button. -tags: ['shared-ux', 'component'] -date: 2022-03-30 ---- - -> This documentation is in-progress. - -This button is a part of the solution toolbar component. This button has primary styling and requires a label. OnClick handlers, icon side, and icon types are supported as an extension of EuiButtonProps. Icons by default are left of any labels within the button but can also be set to right. diff --git a/packages/kbn-shared-ux-components/src/toolbar/popovers/__snapshots__/popover.test.tsx.snap b/packages/kbn-shared-ux-components/src/toolbar/popovers/__snapshots__/popover.test.tsx.snap deleted file mode 100644 index c38d0b8e4cd7c..0000000000000 --- a/packages/kbn-shared-ux-components/src/toolbar/popovers/__snapshots__/popover.test.tsx.snap +++ /dev/null @@ -1,89 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[` is rendered 1`] = ` - - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - isOpen={false} - ownFocus={true} - panelPaddingSize="m" - > -
-
- - - - - - - -
-
-
-
-`; diff --git a/packages/shared-ux/button_toolbar/BUILD.bazel b/packages/shared-ux/button_toolbar/BUILD.bazel new file mode 100644 index 0000000000000..cbba92916a3a5 --- /dev/null +++ b/packages/shared-ux/button_toolbar/BUILD.bazel @@ -0,0 +1,138 @@ +load("@npm//@bazel/typescript:index.bzl", "ts_config") +load("@build_bazel_rules_nodejs//:index.bzl", "js_library") +load("//src/dev/bazel:index.bzl", "jsts_transpiler", "pkg_npm", "pkg_npm_types", "ts_project") + +PKG_DIRNAME = "button_toolbar" +PKG_REQUIRE_NAME = "@kbn/shared-ux-button-toolbar" + +SOURCE_FILES = glob( + [ + "src/**/*.ts", + "src/**/*.tsx", + "src/**/*.scss", + "src/**/*.mdx", + ], + exclude = [ + "**/*.test.*", + ], +) + +SRCS = SOURCE_FILES + +filegroup( + name = "srcs", + srcs = SRCS, +) + +NPM_MODULE_EXTRA_FILES = [ + "package.json", +] + +# In this array place runtime dependencies, including other packages and NPM packages +# which must be available for this code to run. +# +# To reference other packages use: +# "//repo/relative/path/to/package" +# eg. "//packages/kbn-utils" +# +# To reference a NPM package use: +# "@npm//name-of-package" +# eg. "@npm//lodash" +RUNTIME_DEPS = [ + "@npm//@elastic/eui", + "@npm//react", + "//packages/kbn-i18n-react", + "//packages/kbn-i18n", +] + +# In this array place dependencies necessary to build the types, which will include the +# :npm_module_types target of other packages and packages from NPM, including @types/* +# packages. +# +# To reference the types for another package use: +# "//repo/relative/path/to/package:npm_module_types" +# eg. "//packages/kbn-utils:npm_module_types" +# +# References to NPM packages work the same as RUNTIME_DEPS +TYPES_DEPS = [ + "@npm//@elastic/eui", + "@npm//@storybook/addon-actions", + "@npm//@types/jest", + "@npm//@types/node", + "@npm//@types/react", + "//packages/kbn-ambient-ui-types", + "//packages/kbn-i18n-react:npm_module_types", + "//packages/kbn-i18n:npm_module_types", +] + +jsts_transpiler( + name = "target_node", + srcs = SRCS, + build_pkg_name = package_name(), +) + +jsts_transpiler( + name = "target_web", + srcs = SRCS, + build_pkg_name = package_name(), + web = True, + additional_args = [ + "--copy-files", + "--quiet" + ], +) + +ts_config( + name = "tsconfig", + src = "tsconfig.json", + deps = [ + "//:tsconfig.base.json", + "//:tsconfig.bazel.json", + ], +) + +ts_project( + name = "tsc_types", + args = ['--pretty'], + srcs = SRCS, + deps = TYPES_DEPS, + declaration = True, + emit_declaration_only = True, + out_dir = "target_types", + root_dir = "src", + tsconfig = ":tsconfig", +) + +js_library( + name = PKG_DIRNAME, + srcs = NPM_MODULE_EXTRA_FILES, + deps = RUNTIME_DEPS + [":target_node", ":target_web"], + package_name = PKG_REQUIRE_NAME, + visibility = ["//visibility:public"], +) + +pkg_npm( + name = "npm_module", + deps = [":" + PKG_DIRNAME], +) + +filegroup( + name = "build", + srcs = [":npm_module"], + visibility = ["//visibility:public"], +) + +pkg_npm_types( + name = "npm_module_types", + srcs = SRCS, + deps = [":tsc_types"], + package_name = PKG_REQUIRE_NAME, + tsconfig = ":tsconfig", + visibility = ["//visibility:public"], +) + +filegroup( + name = "build_types", + srcs = [":npm_module_types"], + visibility = ["//visibility:public"], +) diff --git a/packages/shared-ux/button_toolbar/README.mdx b/packages/shared-ux/button_toolbar/README.mdx new file mode 100644 index 0000000000000..fb693dab44498 --- /dev/null +++ b/packages/shared-ux/button_toolbar/README.mdx @@ -0,0 +1,9 @@ +--- +id: sharedUX/ButtonToolbar +slug: /shared-ux/button-toolbar +title: Button Toolbar +summary: +tags: ['shared-ux', 'component'] +date: 2022-06-14 +--- + diff --git a/packages/shared-ux/button_toolbar/jest.config.js b/packages/shared-ux/button_toolbar/jest.config.js new file mode 100644 index 0000000000000..ae826337a4a68 --- /dev/null +++ b/packages/shared-ux/button_toolbar/jest.config.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../..', + roots: ['/packages/shared-ux/button_toolbar'], +}; diff --git a/packages/shared-ux/button_toolbar/package.json b/packages/shared-ux/button_toolbar/package.json new file mode 100644 index 0000000000000..c9a4569ee2e02 --- /dev/null +++ b/packages/shared-ux/button_toolbar/package.json @@ -0,0 +1,8 @@ +{ + "name": "@kbn/shared-ux-button-toolbar", + "private": true, + "version": "1.0.0", + "main": "./target_node/index.js", + "browser": "./target_web/index.js", + "license": "SSPL-1.0 OR Elastic License 2.0" +} \ No newline at end of file diff --git a/packages/shared-ux/button_toolbar/src/buttons/add_from_library/__snapshots__/add_from_library.test.tsx.snap b/packages/shared-ux/button_toolbar/src/buttons/add_from_library/__snapshots__/add_from_library.test.tsx.snap new file mode 100644 index 0000000000000..57921977baf2d --- /dev/null +++ b/packages/shared-ux/button_toolbar/src/buttons/add_from_library/__snapshots__/add_from_library.test.tsx.snap @@ -0,0 +1,587 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` is rendered 1`] = ` + + + + + + + + + +`; diff --git a/packages/kbn-shared-ux-components/src/toolbar/buttons/add_from_library/add_from_library.stories.tsx b/packages/shared-ux/button_toolbar/src/buttons/add_from_library/add_from_library.stories.tsx similarity index 61% rename from packages/kbn-shared-ux-components/src/toolbar/buttons/add_from_library/add_from_library.stories.tsx rename to packages/shared-ux/button_toolbar/src/buttons/add_from_library/add_from_library.stories.tsx index ea50431545028..75872ff2fe2f1 100644 --- a/packages/kbn-shared-ux-components/src/toolbar/buttons/add_from_library/add_from_library.stories.tsx +++ b/packages/shared-ux/button_toolbar/src/buttons/add_from_library/add_from_library.stories.tsx @@ -7,12 +7,12 @@ */ import React from 'react'; -import { AddFromLibraryButton } from './add_from_library'; -import mdx from './add_from_library.mdx'; +import { AddFromLibraryButton as Component } from './add_from_library'; +import mdx from '../../../README.mdx'; export default { - title: 'Toolbar/Buttons/Add From Library Button', - description: 'An implementation of the solution toolbar primary button', + title: 'Button Toolbar/Buttons', + description: 'An implementation of the toolbar primary button', parameters: { docs: { page: mdx, @@ -20,6 +20,6 @@ export default { }, }; -export const Component = () => { - return ; +export const AddFromLibraryButton = () => { + return ; }; diff --git a/packages/kbn-shared-ux-components/src/toolbar/buttons/add_from_library/add_from_library.test.tsx b/packages/shared-ux/button_toolbar/src/buttons/add_from_library/add_from_library.test.tsx similarity index 82% rename from packages/kbn-shared-ux-components/src/toolbar/buttons/add_from_library/add_from_library.test.tsx rename to packages/shared-ux/button_toolbar/src/buttons/add_from_library/add_from_library.test.tsx index a2ba1d8bff174..f573f6654e664 100644 --- a/packages/kbn-shared-ux-components/src/toolbar/buttons/add_from_library/add_from_library.test.tsx +++ b/packages/shared-ux/button_toolbar/src/buttons/add_from_library/add_from_library.test.tsx @@ -6,14 +6,14 @@ * Side Public License, v 1. */ -import { mount as enzymeMount } from 'enzyme'; import React from 'react'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; + import { AddFromLibraryButton } from './add_from_library'; describe('', () => { test('is rendered', () => { - const component = enzymeMount(); - + const component = mountWithIntl(); expect(component).toMatchSnapshot(); }); }); diff --git a/packages/kbn-shared-ux-components/src/toolbar/buttons/add_from_library/add_from_library.tsx b/packages/shared-ux/button_toolbar/src/buttons/add_from_library/add_from_library.tsx similarity index 68% rename from packages/kbn-shared-ux-components/src/toolbar/buttons/add_from_library/add_from_library.tsx rename to packages/shared-ux/button_toolbar/src/buttons/add_from_library/add_from_library.tsx index 190edc8f29491..fd35301d7210d 100644 --- a/packages/kbn-shared-ux-components/src/toolbar/buttons/add_from_library/add_from_library.tsx +++ b/packages/shared-ux/button_toolbar/src/buttons/add_from_library/add_from_library.tsx @@ -8,17 +8,20 @@ import { i18n } from '@kbn/i18n'; import React from 'react'; -import { ToolbarButton, Props as ToolbarButtonProps } from '../primary/primary'; +import { PrimaryButton, Props as ToolbarButtonProps } from '../primary/primary'; export type Props = Omit; const label = { getLibraryButtonLabel: () => - i18n.translate('sharedUXComponents.toolbar.buttons.addFromLibrary.libraryButtonLabel', { + i18n.translate('sharedUXPackages.buttonToolbar.buttons.addFromLibrary.libraryButtonLabel', { defaultMessage: 'Add from library', }), }; +/** + * A button that acts to add an item from the library to a solution, typically through a modal. + */ export const AddFromLibraryButton = ({ onClick, ...rest }: Props) => ( - + ); diff --git a/packages/kbn-shared-ux-components/src/toolbar/index.ts b/packages/shared-ux/button_toolbar/src/buttons/add_from_library/index.ts similarity index 56% rename from packages/kbn-shared-ux-components/src/toolbar/index.ts rename to packages/shared-ux/button_toolbar/src/buttons/add_from_library/index.ts index f3e74ace3e5ff..e831d84d237f2 100644 --- a/packages/kbn-shared-ux-components/src/toolbar/index.ts +++ b/packages/shared-ux/button_toolbar/src/buttons/add_from_library/index.ts @@ -5,7 +5,6 @@ * in compliance with, at your election, the Elastic License 2.0 or the Server * Side Public License, v 1. */ -export { ToolbarButton } from './buttons/primary/primary'; -export { IconButtonGroup } from './buttons/icon_button_group/icon_button_group'; -export { AddFromLibraryButton } from './buttons/add_from_library/add_from_library'; -export { ToolbarPopover } from './popovers/popover'; + +export { AddFromLibraryButton } from './add_from_library'; +export type { Props as AddFromLibraryButtonProps } from './add_from_library'; diff --git a/packages/shared-ux/button_toolbar/src/buttons/icon_button_group/__snapshots__/icon_button_group.test.tsx.snap b/packages/shared-ux/button_toolbar/src/buttons/icon_button_group/__snapshots__/icon_button_group.test.tsx.snap new file mode 100644 index 0000000000000..1bf442adb6163 --- /dev/null +++ b/packages/shared-ux/button_toolbar/src/buttons/icon_button_group/__snapshots__/icon_button_group.test.tsx.snap @@ -0,0 +1,384 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` is rendered 1`] = ` + + +
+ + + Legend + + +
+ + + + + + + , + , + , + , + ], + }, + } + } + isStringTag={false} + serialized={ + Object { + "map": undefined, + "name": "iuv015-EuiButtonGroup", + "next": undefined, + "styles": "&.euiButtonGroupButton{background-color:#FFF;border:1px solid #D3DAE6 !important;&:first-of-type{border-top-left-radius:6px !important;border-bottom-left-radius:6px !important;}&:last-of-type{border-top-right-radius:6px !important;border-bottom-right-radius:6px !important;}};;label:EuiButtonGroup;", + "toString": [Function], + } + } + /> + + + + + + +
+
+
+
+`; diff --git a/packages/kbn-shared-ux-components/src/toolbar/buttons/icon_button_group/icon_button_group.stories.tsx b/packages/shared-ux/button_toolbar/src/buttons/icon_button_group/icon_button_group.stories.tsx similarity index 70% rename from packages/kbn-shared-ux-components/src/toolbar/buttons/icon_button_group/icon_button_group.stories.tsx rename to packages/shared-ux/button_toolbar/src/buttons/icon_button_group/icon_button_group.stories.tsx index 988a5bddd513f..21fff3f3ed887 100644 --- a/packages/kbn-shared-ux-components/src/toolbar/buttons/icon_button_group/icon_button_group.stories.tsx +++ b/packages/shared-ux/button_toolbar/src/buttons/icon_button_group/icon_button_group.stories.tsx @@ -7,14 +7,13 @@ */ import { action } from '@storybook/addon-actions'; -import { Story } from '@storybook/react'; import React from 'react'; -import { IconButtonGroup } from './icon_button_group'; -import mdx from './icon_button_group.mdx'; +import { IconButtonGroup as Component } from './icon_button_group'; +import mdx from '../../../README.mdx'; export default { - title: 'Toolbar/Buttons/Icon Button Group', - description: 'A collection of buttons that is a part of a toolbar.', + title: 'Button Toolbar/Buttons', + description: 'A collection of icon buttons that is a part of a toolbar.', parameters: { docs: { page: mdx, @@ -51,13 +50,7 @@ const quickButtons = [ }, ]; -export const ConnectedComponent: Story<{ buttonCount: number }> = ({ buttonCount }) => { - return ( - - ); -}; - -ConnectedComponent.argTypes = { +const argTypes = { buttonCount: { defaultValue: 2, control: { @@ -68,3 +61,11 @@ ConnectedComponent.argTypes = { }, }, }; + +type Params = Record; + +export const IconButtonGroup = ({ buttonCount }: Params) => { + return ; +}; + +IconButtonGroup.argTypes = argTypes; diff --git a/packages/kbn-shared-ux-components/src/toolbar/buttons/icon_button_group/icon_button_group.styles.ts b/packages/shared-ux/button_toolbar/src/buttons/icon_button_group/icon_button_group.styles.ts similarity index 100% rename from packages/kbn-shared-ux-components/src/toolbar/buttons/icon_button_group/icon_button_group.styles.ts rename to packages/shared-ux/button_toolbar/src/buttons/icon_button_group/icon_button_group.styles.ts diff --git a/packages/kbn-shared-ux-components/src/toolbar/buttons/icon_button_group/icon_button_group.test.tsx b/packages/shared-ux/button_toolbar/src/buttons/icon_button_group/icon_button_group.test.tsx similarity index 60% rename from packages/kbn-shared-ux-components/src/toolbar/buttons/icon_button_group/icon_button_group.test.tsx rename to packages/shared-ux/button_toolbar/src/buttons/icon_button_group/icon_button_group.test.tsx index aefcd59fbd7d5..db5722986bcc0 100644 --- a/packages/kbn-shared-ux-components/src/toolbar/buttons/icon_button_group/icon_button_group.test.tsx +++ b/packages/shared-ux/button_toolbar/src/buttons/icon_button_group/icon_button_group.test.tsx @@ -7,27 +7,13 @@ */ import React from 'react'; -import { mount as enzymeMount, ReactWrapper } from 'enzyme'; -import { - mockServicesFactory, - SharedUxServices, - SharedUxServicesProvider, -} from '@kbn/shared-ux-services'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; import { IconButtonGroup } from './icon_button_group'; describe('', () => { - let services: SharedUxServices; - let mount: (element: JSX.Element) => ReactWrapper; - - beforeEach(() => { - services = mockServicesFactory(); - mount = (element: JSX.Element) => - enzymeMount({element}); - }); - test('is rendered', () => { - const component = mount( + const component = mountWithIntl( void; - /** - * HTML `title` attribute for tooltips if different from `label` - */ + /** HTML `title` attribute for tooltips if different from `label` */ title?: string; } +/** + * Props for `IconButtonGroup`. + */ export interface Props { - /** - * Required accessible legend for the whole group - */ + /** Required accessible legend for the whole group */ legend: EuiButtonGroupProps['legend']; - /** - * Array of `QuickButton`s - */ + /** Array of `IconButton` */ buttons: IconButton[]; } type Option = EuiButtonGroupOptionProps & Omit; +/** + * A group of buttons each performing an action, represented by an icon. + */ export const IconButtonGroup = ({ buttons, legend }: Props) => { const euiTheme = useEuiTheme(); const iconButtonGroupStyles = IconButtonGroupStyles(euiTheme); diff --git a/packages/shared-ux/button_toolbar/src/buttons/icon_button_group/index.ts b/packages/shared-ux/button_toolbar/src/buttons/icon_button_group/index.ts new file mode 100644 index 0000000000000..35dfe250cd054 --- /dev/null +++ b/packages/shared-ux/button_toolbar/src/buttons/icon_button_group/index.ts @@ -0,0 +1,10 @@ +/* + * 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 { IconButtonGroup } from './icon_button_group'; +export type { IconButton, Props as IconButtonGroupProps } from './icon_button_group'; diff --git a/packages/shared-ux/button_toolbar/src/buttons/index.ts b/packages/shared-ux/button_toolbar/src/buttons/index.ts new file mode 100644 index 0000000000000..c747130c769c7 --- /dev/null +++ b/packages/shared-ux/button_toolbar/src/buttons/index.ts @@ -0,0 +1,16 @@ +/* + * 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 { PrimaryButton } from './primary'; +export type { PrimaryButtonProps } from './primary'; + +export { IconButtonGroup } from './icon_button_group'; +export type { IconButtonGroupProps, IconButton } from './icon_button_group'; + +export { AddFromLibraryButton } from './add_from_library'; +export type { AddFromLibraryButtonProps } from './add_from_library'; diff --git a/packages/shared-ux/button_toolbar/src/buttons/primary/__snapshots__/primary.test.tsx.snap b/packages/shared-ux/button_toolbar/src/buttons/primary/__snapshots__/primary.test.tsx.snap new file mode 100644 index 0000000000000..dfd75c6ff000e --- /dev/null +++ b/packages/shared-ux/button_toolbar/src/buttons/primary/__snapshots__/primary.test.tsx.snap @@ -0,0 +1,465 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` is rendered 1`] = ` + + + + + + + +`; diff --git a/packages/shared-ux/button_toolbar/src/buttons/primary/index.ts b/packages/shared-ux/button_toolbar/src/buttons/primary/index.ts new file mode 100644 index 0000000000000..1d3220b3654aa --- /dev/null +++ b/packages/shared-ux/button_toolbar/src/buttons/primary/index.ts @@ -0,0 +1,10 @@ +/* + * 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 { PrimaryButton } from './primary'; +export type { Props as PrimaryButtonProps } from './primary'; diff --git a/packages/kbn-shared-ux-components/src/toolbar/buttons/primary/primary.stories.tsx b/packages/shared-ux/button_toolbar/src/buttons/primary/primary.stories.tsx similarity index 52% rename from packages/kbn-shared-ux-components/src/toolbar/buttons/primary/primary.stories.tsx rename to packages/shared-ux/button_toolbar/src/buttons/primary/primary.stories.tsx index a81be610c1508..fb3b53b160f4c 100644 --- a/packages/kbn-shared-ux-components/src/toolbar/buttons/primary/primary.stories.tsx +++ b/packages/shared-ux/button_toolbar/src/buttons/primary/primary.stories.tsx @@ -6,36 +6,38 @@ * Side Public License, v 1. */ -import { Story } from '@storybook/react'; import React from 'react'; -import { ToolbarButton } from './primary'; -import mdx from './primary.mdx'; + +import { PrimaryButton as Component } from './primary'; +import mdx from '../../../README.mdx'; + +const argTypes = { + iconType: { + control: { + type: 'radio', + expanded: true, + options: ['apps', 'logoGithub', 'folderCheck', 'documents'], + }, + }, +}; + +type Params = Record; export default { - title: 'Toolbar/Buttons/Primary button', + title: 'Button Toolbar/Buttons', description: 'A primary button that is a part of a toolbar.', parameters: { docs: { page: mdx, }, }, - argTypes: { - iconType: { - control: { - type: 'radio', - expanded: true, - options: ['apps', 'logoGithub', 'folderCheck', 'documents'], - }, - }, - }, + argTypes, }; -export const Component: Story<{ - iconType: any; -}> = ({ iconType }) => { - return ; +export const PrimaryButton = ({ iconType }: Params) => { + return ; }; -Component.args = { +PrimaryButton.args = { iconType: 'apps', }; diff --git a/packages/kbn-shared-ux-components/src/toolbar/buttons/primary/primary.test.tsx b/packages/shared-ux/button_toolbar/src/buttons/primary/primary.test.tsx similarity index 51% rename from packages/kbn-shared-ux-components/src/toolbar/buttons/primary/primary.test.tsx rename to packages/shared-ux/button_toolbar/src/buttons/primary/primary.test.tsx index 3e0e153f453e5..10cbe7cb4dff0 100644 --- a/packages/kbn-shared-ux-components/src/toolbar/buttons/primary/primary.test.tsx +++ b/packages/shared-ux/button_toolbar/src/buttons/primary/primary.test.tsx @@ -6,35 +6,20 @@ * Side Public License, v 1. */ -import { mount as enzymeMount, ReactWrapper } from 'enzyme'; import React from 'react'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; -import { - SharedUxServicesProvider, - SharedUxServices, - mockServicesFactory, -} from '@kbn/shared-ux-services'; - -import { ToolbarButton } from './primary'; +import { PrimaryButton } from './primary'; describe('', () => { - let services: SharedUxServices; - let mount: (element: JSX.Element) => ReactWrapper; - - beforeEach(() => { - services = mockServicesFactory(); - mount = (element: JSX.Element) => - enzymeMount({element}); - }); - test('is rendered', () => { - const component = mount(); - + const component = mountWithIntl(); expect(component).toMatchSnapshot(); }); + test('it can be passed a functional onClick handler', () => { const mockHandler = jest.fn(); - const component = mount(); + const component = mountWithIntl(); component.simulate('click'); expect(mockHandler).toHaveBeenCalled(); }); diff --git a/packages/kbn-shared-ux-components/src/toolbar/buttons/primary/primary.tsx b/packages/shared-ux/button_toolbar/src/buttons/primary/primary.tsx similarity index 81% rename from packages/kbn-shared-ux-components/src/toolbar/buttons/primary/primary.tsx rename to packages/shared-ux/button_toolbar/src/buttons/primary/primary.tsx index f935a08fe8434..4d2975db2682b 100644 --- a/packages/kbn-shared-ux-components/src/toolbar/buttons/primary/primary.tsx +++ b/packages/shared-ux/button_toolbar/src/buttons/primary/primary.tsx @@ -10,11 +10,17 @@ import React from 'react'; import { EuiButton } from '@elastic/eui'; import { EuiButtonPropsForButton } from '@elastic/eui/src/components/button/button'; +/** + * Props for `PrimaryButton`. + */ export interface Props extends Pick { label: string; } -export const ToolbarButton = ({ label, iconSide = 'left', ...rest }: Props) => { +/** + * A primary action button, usually appearing first in the toolbar. + */ +export const PrimaryButton = ({ label, iconSide = 'left', ...rest }: Props) => { return ( {label} diff --git a/packages/shared-ux/button_toolbar/src/index.ts b/packages/shared-ux/button_toolbar/src/index.ts new file mode 100644 index 0000000000000..6ee6230881039 --- /dev/null +++ b/packages/shared-ux/button_toolbar/src/index.ts @@ -0,0 +1,18 @@ +/* + * 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 { PrimaryButton, IconButtonGroup, AddFromLibraryButton } from './buttons'; +export type { + AddFromLibraryButtonProps, + IconButtonGroupProps, + IconButton, + PrimaryButtonProps, +} from './buttons'; + +export { ToolbarPopover } from './popover'; +export type { ToolbarPopoverProps } from './popover'; diff --git a/packages/shared-ux/button_toolbar/src/popover/__snapshots__/popover.test.tsx.snap b/packages/shared-ux/button_toolbar/src/popover/__snapshots__/popover.test.tsx.snap new file mode 100644 index 0000000000000..d727134b4dcdd --- /dev/null +++ b/packages/shared-ux/button_toolbar/src/popover/__snapshots__/popover.test.tsx.snap @@ -0,0 +1,395 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` is rendered 1`] = ` + + + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + intl={ + Object { + "defaultFormats": Object {}, + "defaultLocale": "en", + "formatDate": [Function], + "formatHTMLMessage": [Function], + "formatMessage": [Function], + "formatNumber": [Function], + "formatPlural": [Function], + "formatRelative": [Function], + "formatTime": [Function], + "formats": Object { + "date": Object { + "full": Object { + "day": "numeric", + "month": "long", + "weekday": "long", + "year": "numeric", + }, + "long": Object { + "day": "numeric", + "month": "long", + "year": "numeric", + }, + "medium": Object { + "day": "numeric", + "month": "short", + "year": "numeric", + }, + "short": Object { + "day": "numeric", + "month": "numeric", + "year": "2-digit", + }, + }, + "number": Object { + "currency": Object { + "style": "currency", + }, + "percent": Object { + "style": "percent", + }, + }, + "relative": Object { + "days": Object { + "units": "day", + }, + "hours": Object { + "units": "hour", + }, + "minutes": Object { + "units": "minute", + }, + "months": Object { + "units": "month", + }, + "seconds": Object { + "units": "second", + }, + "years": Object { + "units": "year", + }, + }, + "time": Object { + "full": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + "timeZoneName": "short", + }, + "long": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + "timeZoneName": "short", + }, + "medium": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + }, + "short": Object { + "hour": "numeric", + "minute": "numeric", + }, + }, + }, + "formatters": Object { + "getDateTimeFormat": [Function], + "getMessageFormat": [Function], + "getNumberFormat": [Function], + "getPluralFormat": [Function], + "getRelativeFormat": [Function], + }, + "locale": "en", + "messages": Object {}, + "now": [Function], + "onError": [Function], + "textComponent": Symbol(react.fragment), + "timeZone": null, + } + } + isOpen={false} + ownFocus={true} + panelPaddingSize="m" + > +
+
+ + + + + + + +
+
+
+
+`; diff --git a/packages/shared-ux/button_toolbar/src/popover/index.ts b/packages/shared-ux/button_toolbar/src/popover/index.ts new file mode 100644 index 0000000000000..10167b975f584 --- /dev/null +++ b/packages/shared-ux/button_toolbar/src/popover/index.ts @@ -0,0 +1,10 @@ +/* + * 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 { ToolbarPopover } from './popover'; +export type { Props as ToolbarPopoverProps } from './popover'; diff --git a/packages/kbn-shared-ux-components/src/toolbar/popovers/popover.mdx b/packages/shared-ux/button_toolbar/src/popover/popover.mdx similarity index 100% rename from packages/kbn-shared-ux-components/src/toolbar/popovers/popover.mdx rename to packages/shared-ux/button_toolbar/src/popover/popover.mdx diff --git a/packages/kbn-shared-ux-components/src/toolbar/popovers/popover.stories.tsx b/packages/shared-ux/button_toolbar/src/popover/popover.stories.tsx similarity index 66% rename from packages/kbn-shared-ux-components/src/toolbar/popovers/popover.stories.tsx rename to packages/shared-ux/button_toolbar/src/popover/popover.stories.tsx index f429cebd7071b..e0c37b035cbd9 100644 --- a/packages/kbn-shared-ux-components/src/toolbar/popovers/popover.stories.tsx +++ b/packages/shared-ux/button_toolbar/src/popover/popover.stories.tsx @@ -6,36 +6,43 @@ * Side Public License, v 1. */ -import { EuiContextMenu } from '@elastic/eui'; -import { ButtonContentIconSide } from '@elastic/eui/src/components/button/button_content'; -import { Story } from '@storybook/react'; import React from 'react'; -import { ToolbarPopover } from './popover'; -import mdx from './popover.mdx'; + +import { EuiContextMenu } from '@elastic/eui'; + +import { ToolbarPopover as Component } from './popover'; +import mdx from '../../README.mdx'; + +const argTypes = { + iconSide: { + control: { + type: 'radio', + options: ['left', 'right', 'undefined'], + }, + }, +}; + +type Params = Record; export default { - title: 'Toolbar/Popover', + title: 'Button Toolbar', description: 'A popover that is a part of a toolbar.', parameters: { docs: { page: mdx, }, }, - argTypes: { - iconSide: { - control: { - type: 'radio', - options: ['left', 'right', 'undefined'], - }, - }, - }, + argTypes, }; -export const Component: Story<{ - iconSide: ButtonContentIconSide | undefined; -}> = ({ iconSide }) => { +export const Popover = ({ iconSide }: Params) => { return ( - + {() => ( )} - +
); }; -Component.args = { +Popover.args = { iconSide: 'left', }; diff --git a/packages/kbn-shared-ux-components/src/toolbar/popovers/popover.test.tsx b/packages/shared-ux/button_toolbar/src/popover/popover.test.tsx similarity index 81% rename from packages/kbn-shared-ux-components/src/toolbar/popovers/popover.test.tsx rename to packages/shared-ux/button_toolbar/src/popover/popover.test.tsx index fcbf3d3542a16..022ab3fe56f51 100644 --- a/packages/kbn-shared-ux-components/src/toolbar/popovers/popover.test.tsx +++ b/packages/shared-ux/button_toolbar/src/popover/popover.test.tsx @@ -6,14 +6,15 @@ * Side Public License, v 1. */ -import { mount as enzymeMount } from 'enzyme'; import React from 'react'; +import { mountWithIntl } from '@kbn/test-jest-helpers'; + import { ToolbarPopover } from './popover'; describe('', () => { test('is rendered', () => { const isOpen = true; - const component = enzymeMount( !isOpen} />); + const component = mountWithIntl( !isOpen} />); expect(component).toMatchSnapshot(); }); @@ -21,9 +22,11 @@ describe('', () => { test('accepts an onClick handler', () => { const isOpen = true; const mockHandler = jest.fn(); - const component = enzymeMount( + + const component = mountWithIntl( !isOpen} onClick={mockHandler} /> ); + component.simulate('click'); expect(mockHandler).toHaveBeenCalled(); }); diff --git a/packages/kbn-shared-ux-components/src/toolbar/popovers/popover.tsx b/packages/shared-ux/button_toolbar/src/popover/popover.tsx similarity index 86% rename from packages/kbn-shared-ux-components/src/toolbar/popovers/popover.tsx rename to packages/shared-ux/button_toolbar/src/popover/popover.tsx index ceae588b61941..fdf60c1f0d5fa 100644 --- a/packages/kbn-shared-ux-components/src/toolbar/popovers/popover.tsx +++ b/packages/shared-ux/button_toolbar/src/popover/popover.tsx @@ -10,7 +10,7 @@ import React, { useState } from 'react'; import { EuiPopover } from '@elastic/eui'; import { Props as EuiPopoverProps } from '@elastic/eui/src/components/popover/popover'; -import { ToolbarButton, Props as ButtonProps } from '../buttons/primary/primary'; +import { PrimaryButton, Props as ButtonProps } from '../buttons/primary/primary'; type AllowedButtonProps = Omit; type AllowedPopoverProps = Omit< @@ -18,18 +18,24 @@ type AllowedPopoverProps = Omit< 'button' | 'isOpen' | 'closePopover' | 'anchorPosition' >; +/** + * Props for `ToolbarPopover`. + */ export type Props = AllowedButtonProps & AllowedPopoverProps & { children: (arg: { closePopover: () => void }) => React.ReactNode; }; +/** + * A button which opens a popover of additional actions within the toolbar. + */ export const ToolbarPopover = ({ label, iconType, children, iconSide, ...popover }: Props) => { const [isOpen, setIsOpen] = useState(false); const onButtonClick = () => setIsOpen((status) => !status); const closePopover = () => setIsOpen(false); - const button = ; + const button = ; return ( // the following ts-ignore is needed until typings/* directory is exposed for consumption to packages diff --git a/packages/shared-ux/button_toolbar/tsconfig.json b/packages/shared-ux/button_toolbar/tsconfig.json new file mode 100644 index 0000000000000..384042fcd7bd4 --- /dev/null +++ b/packages/shared-ux/button_toolbar/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../tsconfig.bazel.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "target_types", + "rootDir": "src", + "stripInternal": false, + "types": [ + "jest", + "node", + "react", + "@kbn/ambient-ui-types" + ] + }, + "include": [ + "src/**/*" + ] +} diff --git a/src/plugins/presentation_util/public/components/solution_toolbar/items/index.ts b/src/plugins/presentation_util/public/components/solution_toolbar/items/index.ts index 32972e4d2628d..cc6367bc3fcd5 100644 --- a/src/plugins/presentation_util/public/components/solution_toolbar/items/index.ts +++ b/src/plugins/presentation_util/public/components/solution_toolbar/items/index.ts @@ -10,7 +10,7 @@ export { SolutionToolbarButton } from './button'; export { SolutionToolbarPopover } from './popover'; export { AddFromLibraryButton } from './add_from_library'; export type { QuickButtonProps } from './quick_group'; -/** @deprecated use `IconButtonGroup` from `@kbn/shared-ux-components */ +/** @deprecated use `IconButtonGroup` from `@kbn/shared-ux-button-toolbar` */ export { QuickButtonGroup } from './quick_group'; export { PrimaryActionButton } from './primary_button'; export { PrimaryActionPopover } from './primary_popover'; diff --git a/src/plugins/presentation_util/public/index.ts b/src/plugins/presentation_util/public/index.ts index 35b13d248d8c8..cb1cbb60d4412 100644 --- a/src/plugins/presentation_util/public/index.ts +++ b/src/plugins/presentation_util/public/index.ts @@ -54,7 +54,7 @@ export { AddFromLibraryButton, PrimaryActionButton, PrimaryActionPopover, - /** @deprecated QuickButtonGroup - use `IconButtonGroup` from `@kbn/shared-ux-components */ + /** @deprecated QuickButtonGroup - use `IconButtonGroup` from `@kbn/shared-ux-button-toolbar` */ QuickButtonGroup, SolutionToolbar, SolutionToolbarButton, diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index b2f095bd838cb..3c492c1443bf7 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -5343,7 +5343,7 @@ "sharedUXComponents.noDataPage.elasticAgentCard.noPermission.title": "Contactez votre administrateur", "sharedUXComponents.noDataPage.elasticAgentCard.title": "Ajouter Elastic Agent", "sharedUXComponents.pageTemplate.noDataCard.description": "Continuer sans collecter de données", - "sharedUXComponents.toolbar.buttons.addFromLibrary.libraryButtonLabel": "Ajouter depuis la bibliothèque", + "sharedUXPackages.buttonToolbar.buttons.addFromLibrary.libraryButtonLabel": "Ajouter depuis la bibliothèque", "sharedUXPackages.noDataViewsPrompt.learnMore": "Envie d'en savoir plus ?", "sharedUXPackages.noDataViewsPrompt.readDocumentation": "Lisez les documents", "telemetry.callout.appliesSettingTitle": "Les modifications apportées à ce paramètre s'appliquent dans {allOfKibanaText} et sont enregistrées automatiquement.", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index fecfabdb7b16a..fa1ce7b24c45c 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -5445,7 +5445,7 @@ "sharedUXComponents.noDataPage.elasticAgentCard.noPermission.title": "管理者にお問い合わせください", "sharedUXComponents.noDataPage.elasticAgentCard.title": "Elasticエージェントの追加", "sharedUXComponents.pageTemplate.noDataCard.description": "データを収集せずに続行", - "sharedUXComponents.toolbar.buttons.addFromLibrary.libraryButtonLabel": "ライブラリから追加", + "sharedUXPackages.buttonToolbar.buttons.addFromLibrary.libraryButtonLabel": "ライブラリから追加", "sharedUXPackages.noDataViewsPrompt.learnMore": "詳細について", "sharedUXPackages.noDataViewsPrompt.readDocumentation": "ドキュメントを読む", "telemetry.callout.appliesSettingTitle": "この設定に加えた変更は {allOfKibanaText} に適用され、自動的に保存されます。", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 1cc41035906d5..9bcc45a9ca1ab 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -5456,7 +5456,7 @@ "sharedUXComponents.noDataPage.elasticAgentCard.noPermission.title": "请联系您的管理员", "sharedUXComponents.noDataPage.elasticAgentCard.title": "添加 Elastic 代理", "sharedUXComponents.pageTemplate.noDataCard.description": "继续,而不收集数据", - "sharedUXComponents.toolbar.buttons.addFromLibrary.libraryButtonLabel": "从库中添加", + "sharedUXPackages.buttonToolbar.buttons.addFromLibrary.libraryButtonLabel": "从库中添加", "sharedUXPackages.noDataViewsPrompt.learnMore": "希望了解详情?", "sharedUXPackages.noDataViewsPrompt.readDocumentation": "阅读文档", "telemetry.callout.appliesSettingTitle": "对此设置的更改将应用到{allOfKibanaText} 且会自动保存。", diff --git a/yarn.lock b/yarn.lock index 7d5e89b4f0ea7..649e628ecf74a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3375,6 +3375,10 @@ version "0.0.0" uid "" +"@kbn/shared-ux-button-toolbar@link:bazel-bin/packages/shared-ux/button_toolbar": + version "0.0.0" + uid "" + "@kbn/shared-ux-storybook@link:bazel-bin/packages/kbn-shared-ux-storybook": version "0.0.0" uid "" @@ -6742,6 +6746,10 @@ version "0.0.0" uid "" +"@types/kbn__shared-ux-button-toolbar@link:bazel-bin/packages/shared-ux/button_toolbar/npm_module_types": + version "0.0.0" + uid "" + "@types/kbn__shared-ux-storybook@link:bazel-bin/packages/kbn-shared-ux-storybook/npm_module_types": version "0.0.0" uid ""