From b9d1d4a293bd05addce3de2dac911190978ad1c6 Mon Sep 17 00:00:00 2001 From: Tommy Markley Date: Thu, 24 Mar 2022 22:18:16 +0000 Subject: [PATCH] Removes UI Framework KUI doc site * KUI components are no longer being developed and the dependencies for the doc site are related to CVEs. * Refactors grunt tasks for compiling KUI CSS. * Removes doc site related grunt tasks. * Removes all unused dependencies from the osd/ui-framework package. ### Issues Prerequisite for resolving #1096 (along with the EUI upgrade) Signed-off-by: Tommy Markley --- .eslintignore | 1 - .eslintrc.js | 2 - .gitignore | 2 - package.json | 3 +- packages/osd-ui-framework/Gruntfile.js | 158 +-- packages/osd-ui-framework/README.md | 7 +- .../doc_site/build/index.html | 13 - .../doc_site/src/actions/action_types.js | 45 - .../src/actions/code_viewer_actions.js | 41 - .../src/actions/example_nav_actions.js | 42 - .../doc_site/src/actions/index.js | 35 - .../doc_site/src/actions/sandbox_actions.js | 39 - .../doc_site/src/components/guide/_guide.scss | 108 -- .../components/guide_code/_guide_code.scss | 6 - .../src/components/guide_code/guide_code.js | 33 - .../guide_code_viewer/_guide_code_viewer.scss | 113 -- .../guide_code_viewer/guide_code_viewer.js | 100 -- .../src/components/guide_components.scss | 61 - .../components/guide_demo/_guide_demo.scss | 23 - .../src/components/guide_demo/guide_demo.js | 102 -- .../components/guide_link/_guide_link.scss | 9 - .../src/components/guide_link/guide_link.js | 37 - .../src/components/guide_nav/_guide_nav.scss | 206 ---- .../src/components/guide_nav/guide_nav.js | 224 ---- .../components/guide_page/_guide_page.scss | 42 - .../src/components/guide_page/guide_page.js | 93 -- .../guide_page/guide_page_container.js | 39 - .../_guide_page_side_nav.scss | 44 - .../guide_page_side_nav.js | 47 - .../guide_page_side_nav_item.js | 60 - .../guide_sandbox/_guide_sandbox.scss | 10 - .../components/guide_sandbox/guide_sandbox.js | 74 -- .../guide_sandbox_code_toggle.js | 60 - .../guide_sandbox_code_toggle_container.js | 38 - .../guide_section/_guide_section.scss | 38 - .../components/guide_section/guide_section.js | 81 -- .../guide_section/guide_section_container.js | 40 - .../guide_section/guide_section_types.js | 34 - .../components/guide_text/_guide_text.scss | 16 - .../src/components/guide_text/guide_text.js | 33 - .../doc_site/src/components/index.js | 43 - .../doc_site/src/images/hint-arrow.svg | 25 - .../doc_site/src/images/react-logo.svg | 15 - .../osd-ui-framework/doc_site/src/index.js | 99 -- .../osd-ui-framework/doc_site/src/main.scss | 7 - .../src/services/example/create_example.js | 46 - .../doc_site/src/services/index.js | 39 - .../src/services/js_injector/js_injector.js | 48 - .../doc_site/src/services/routes/routes.js | 186 --- .../src/services/string/render_to_html.js | 55 - .../doc_site/src/services/string/slugify.js | 56 - .../doc_site/src/store/configure_store.js | 60 - .../doc_site/src/store/index.js | 49 - .../src/store/reducers/code_viewer_reducer.js | 79 -- .../src/store/reducers/sandbox_reducer.js | 58 - .../src/store/reducers/sections_reducer.js | 68 -- .../doc_site/src/views/app_container.js | 62 - .../doc_site/src/views/app_view.js | 152 --- .../doc_site/src/views/bar/bar.js | 47 - .../doc_site/src/views/bar/bar_example.js | 126 -- .../doc_site/src/views/bar/bar_one_section.js | 44 - .../src/views/bar/bar_three_sections.js | 59 - .../doc_site/src/views/button/button_basic.js | 48 - .../src/views/button/button_danger.js | 46 - .../src/views/button/button_elements.js | 77 -- .../src/views/button/button_example.js | 343 ------ .../doc_site/src/views/button/button_group.js | 51 - .../src/views/button/button_group_united.js | 57 - .../src/views/button/button_hollow.js | 46 - .../src/views/button/button_loading.js | 85 -- .../src/views/button/button_primary.js | 46 - .../src/views/button/button_secondary.js | 46 - .../src/views/button/button_sizes.html | 55 - .../src/views/button/button_warning.js | 46 - .../src/views/button/button_with_icon.js | 78 -- .../views/collapse_button/collapse_button.js | 42 - .../collapse_button/collapse_button_aria.js | 70 -- .../collapse_button_example.js | 119 -- .../empty_table_prompt/empty_table_prompt.js | 52 - .../empty_table_prompt_example.js | 91 -- .../table_with_empty_prompt.js | 91 -- .../src/views/form/assisted_input.html | 14 - .../doc_site/src/views/form/check_box.js | 75 -- .../doc_site/src/views/form/form_example.js | 244 ---- .../doc_site/src/views/form/label.js | 38 - .../doc_site/src/views/form/search_input.html | 41 - .../doc_site/src/views/form/select.js | 95 -- .../doc_site/src/views/form/static_input.html | 6 - .../doc_site/src/views/form/text_area.js | 92 -- .../src/views/form/text_area_non_resizable.js | 54 - .../doc_site/src/views/form/text_input.js | 93 -- .../src/views/form_layout/field_group.js | 117 -- .../views/form_layout/form_layout_example.js | 62 - .../doc_site/src/views/home/home_view.js | 45 - .../doc_site/src/views/icon/icon.html | 1 - .../doc_site/src/views/icon/icon_basic.html | 1 - .../doc_site/src/views/icon/icon_error.html | 1 - .../doc_site/src/views/icon/icon_example.js | 180 --- .../src/views/icon/icon_inactive.html | 1 - .../doc_site/src/views/icon/icon_info.html | 1 - .../doc_site/src/views/icon/icon_spinner.html | 23 - .../doc_site/src/views/icon/icon_spinner.js | 30 - .../doc_site/src/views/icon/icon_success.html | 1 - .../doc_site/src/views/icon/icon_warning.html | 1 - .../views/info_panel/info_panel_error.html | 18 - .../views/info_panel/info_panel_example.js | 102 -- .../src/views/info_panel/info_panel_info.html | 22 - .../views/info_panel/info_panel_success.html | 18 - .../views/info_panel/info_panel_warning.html | 18 - .../doc_site/src/views/link/link.html | 4 - .../doc_site/src/views/link/link_example.js | 51 - .../views/local_nav/local_nav_breadcrumbs.js | 65 -- .../local_nav/local_nav_date_picker.html | 375 ------ .../src/views/local_nav/local_nav_dropdown.js | 136 --- .../local_nav/local_nav_dropdown_panels.js | 108 -- .../src/views/local_nav/local_nav_example.js | 253 ---- .../local_nav/local_nav_menu_item_states.js | 78 -- .../src/views/local_nav/local_nav_search.js | 103 -- .../views/local_nav/local_nav_search_error.js | 78 -- .../src/views/local_nav/local_nav_simple.js | 61 - .../src/views/local_nav/local_nav_tabs.js | 82 -- .../src/views/not_found/not_found_view.js | 55 - .../doc_site/src/views/pager/pager_buttons.js | 73 -- .../doc_site/src/views/pager/pager_example.js | 88 -- .../src/views/pager/tool_bar_pager.js | 51 - .../doc_site/src/views/panel/panel.html | 5 - .../doc_site/src/views/panel/panel_example.js | 84 -- .../panel/panel_with_header_sections.html | 19 - .../src/views/panel/panel_with_toolbar.html | 10 - .../src/views/status_text/status_text.html | 37 - .../views/status_text/status_text_error.html | 6 - .../views/status_text/status_text_example.js | 103 -- .../views/status_text/status_text_info.html | 6 - .../status_text/status_text_success.html | 6 - .../status_text/status_text_warning.html | 6 - .../doc_site/src/views/table/fluid_table.js | 137 --- .../doc_site/src/views/table/listing_table.js | 169 --- .../table/listing_table_loading_items.js | 101 -- .../table/listing_table_with_empty_prompt.js | 111 -- .../table/listing_table_with_no_items.js | 85 -- .../doc_site/src/views/table/table.js | 235 ---- .../doc_site/src/views/table/table_example.js | 200 ---- .../views/table/table_with_menu_buttons.js | 69 -- .../doc_site/src/views/tabs/tabs.js | 86 -- .../doc_site/src/views/tabs/tabs_example.js | 74 -- .../doc_site/src/views/tool_bar/tool_bar.js | 76 -- .../src/views/tool_bar/tool_bar_example.js | 94 -- .../src/views/tool_bar/tool_bar_footer.js | 54 - .../src/views/typography/sub_text.html | 3 - .../src/views/typography/sub_title.html | 3 - .../src/views/typography/subdued_type.html | 11 - .../doc_site/src/views/typography/text.html | 3 - .../src/views/typography/text_title.html | 3 - .../doc_site/src/views/typography/title.html | 3 - .../views/typography/typography_example.js | 141 --- .../vertical_rhythm/vertical_rhythm.html | 8 - .../vertical_rhythm_as_wrapper.html | 41 - .../vertical_rhythm_example.js | 104 -- .../vertical_rhythm_on_component.html | 35 - .../vertical_rhythm_small.html | 8 - .../doc_site/src/views/view/view_sandbox.html | 15 - .../doc_site/src/views/view/view_sandbox.js | 56 - .../doc_site/webpack.config.js | 95 -- packages/osd-ui-framework/package.json | 29 +- src/dev/jest/config.js | 2 +- src/dev/precommit_hook/casing_check_config.js | 3 - yarn.lock | 1014 +---------------- 167 files changed, 55 insertions(+), 11421 deletions(-) delete mode 100644 packages/osd-ui-framework/doc_site/build/index.html delete mode 100644 packages/osd-ui-framework/doc_site/src/actions/action_types.js delete mode 100644 packages/osd-ui-framework/doc_site/src/actions/code_viewer_actions.js delete mode 100644 packages/osd-ui-framework/doc_site/src/actions/example_nav_actions.js delete mode 100644 packages/osd-ui-framework/doc_site/src/actions/index.js delete mode 100644 packages/osd-ui-framework/doc_site/src/actions/sandbox_actions.js delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide/_guide.scss delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_code/_guide_code.scss delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_code/guide_code.js delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_code_viewer/_guide_code_viewer.scss delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_code_viewer/guide_code_viewer.js delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_components.scss delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_demo/_guide_demo.scss delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_demo/guide_demo.js delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_link/_guide_link.scss delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_link/guide_link.js delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_nav/_guide_nav.scss delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_nav/guide_nav.js delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_page/_guide_page.scss delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_page/guide_page.js delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_page/guide_page_container.js delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_page_side_nav/_guide_page_side_nav.scss delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_page_side_nav/guide_page_side_nav.js delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_page_side_nav/guide_page_side_nav_item.js delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_sandbox/_guide_sandbox.scss delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_sandbox/guide_sandbox.js delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_sandbox/guide_sandbox_code_toggle.js delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_sandbox/guide_sandbox_code_toggle_container.js delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_section/_guide_section.scss delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_section/guide_section.js delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_section/guide_section_container.js delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_section/guide_section_types.js delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_text/_guide_text.scss delete mode 100644 packages/osd-ui-framework/doc_site/src/components/guide_text/guide_text.js delete mode 100644 packages/osd-ui-framework/doc_site/src/components/index.js delete mode 100644 packages/osd-ui-framework/doc_site/src/images/hint-arrow.svg delete mode 100644 packages/osd-ui-framework/doc_site/src/images/react-logo.svg delete mode 100644 packages/osd-ui-framework/doc_site/src/index.js delete mode 100644 packages/osd-ui-framework/doc_site/src/main.scss delete mode 100644 packages/osd-ui-framework/doc_site/src/services/example/create_example.js delete mode 100644 packages/osd-ui-framework/doc_site/src/services/index.js delete mode 100644 packages/osd-ui-framework/doc_site/src/services/js_injector/js_injector.js delete mode 100644 packages/osd-ui-framework/doc_site/src/services/routes/routes.js delete mode 100644 packages/osd-ui-framework/doc_site/src/services/string/render_to_html.js delete mode 100644 packages/osd-ui-framework/doc_site/src/services/string/slugify.js delete mode 100644 packages/osd-ui-framework/doc_site/src/store/configure_store.js delete mode 100644 packages/osd-ui-framework/doc_site/src/store/index.js delete mode 100644 packages/osd-ui-framework/doc_site/src/store/reducers/code_viewer_reducer.js delete mode 100644 packages/osd-ui-framework/doc_site/src/store/reducers/sandbox_reducer.js delete mode 100644 packages/osd-ui-framework/doc_site/src/store/reducers/sections_reducer.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/app_container.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/app_view.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/bar/bar.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/bar/bar_example.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/bar/bar_one_section.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/bar/bar_three_sections.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/button/button_basic.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/button/button_danger.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/button/button_elements.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/button/button_example.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/button/button_group.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/button/button_group_united.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/button/button_hollow.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/button/button_loading.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/button/button_primary.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/button/button_secondary.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/button/button_sizes.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/button/button_warning.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/button/button_with_icon.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/collapse_button/collapse_button.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/collapse_button/collapse_button_aria.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/collapse_button/collapse_button_example.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/empty_table_prompt/empty_table_prompt.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/empty_table_prompt/empty_table_prompt_example.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/empty_table_prompt/table_with_empty_prompt.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/form/assisted_input.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/form/check_box.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/form/form_example.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/form/label.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/form/search_input.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/form/select.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/form/static_input.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/form/text_area.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/form/text_area_non_resizable.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/form/text_input.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/form_layout/field_group.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/form_layout/form_layout_example.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/home/home_view.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/icon/icon.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/icon/icon_basic.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/icon/icon_error.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/icon/icon_example.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/icon/icon_inactive.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/icon/icon_info.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/icon/icon_spinner.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/icon/icon_spinner.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/icon/icon_success.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/icon/icon_warning.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/info_panel/info_panel_error.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/info_panel/info_panel_example.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/info_panel/info_panel_info.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/info_panel/info_panel_success.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/info_panel/info_panel_warning.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/link/link.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/link/link_example.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/local_nav/local_nav_breadcrumbs.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/local_nav/local_nav_date_picker.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/local_nav/local_nav_dropdown.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/local_nav/local_nav_dropdown_panels.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/local_nav/local_nav_example.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/local_nav/local_nav_menu_item_states.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/local_nav/local_nav_search.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/local_nav/local_nav_search_error.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/local_nav/local_nav_simple.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/local_nav/local_nav_tabs.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/not_found/not_found_view.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/pager/pager_buttons.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/pager/pager_example.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/pager/tool_bar_pager.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/panel/panel.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/panel/panel_example.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/panel/panel_with_header_sections.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/panel/panel_with_toolbar.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/status_text/status_text.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/status_text/status_text_error.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/status_text/status_text_example.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/status_text/status_text_info.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/status_text/status_text_success.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/status_text/status_text_warning.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/table/fluid_table.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/table/listing_table.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/table/listing_table_loading_items.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/table/listing_table_with_empty_prompt.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/table/listing_table_with_no_items.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/table/table.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/table/table_example.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/table/table_with_menu_buttons.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/tabs/tabs.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/tabs/tabs_example.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/tool_bar/tool_bar.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/tool_bar/tool_bar_example.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/tool_bar/tool_bar_footer.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/typography/sub_text.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/typography/sub_title.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/typography/subdued_type.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/typography/text.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/typography/text_title.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/typography/title.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/typography/typography_example.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/vertical_rhythm/vertical_rhythm.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/vertical_rhythm/vertical_rhythm_as_wrapper.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/vertical_rhythm/vertical_rhythm_example.js delete mode 100644 packages/osd-ui-framework/doc_site/src/views/vertical_rhythm/vertical_rhythm_on_component.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/vertical_rhythm/vertical_rhythm_small.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/view/view_sandbox.html delete mode 100644 packages/osd-ui-framework/doc_site/src/views/view/view_sandbox.js delete mode 100644 packages/osd-ui-framework/doc_site/webpack.config.js diff --git a/.eslintignore b/.eslintignore index 6578c3edd84b..c516d7511b78 100644 --- a/.eslintignore +++ b/.eslintignore @@ -29,5 +29,4 @@ target /packages/osd-test/src/functional_test_runner/__tests__/fixtures/ /packages/osd-test/src/functional_test_runner/lib/config/__tests__/fixtures/ /packages/osd-ui-framework/dist -/packages/osd-ui-framework/doc_site/build /packages/osd-ui-shared-deps/flot_charts diff --git a/.eslintrc.js b/.eslintrc.js index 0640b9b91057..2381a3071913 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -400,7 +400,6 @@ module.exports = { { files: [ '**/public/**/*.js', - 'packages/osd-ui-framework/doc_site/src/**/*.js', 'src/fixtures/**/*.js', // TODO: this directory needs to be more obviously "public" (or go away) ], settings: { @@ -440,7 +439,6 @@ module.exports = { { files: [ 'packages/osd-ui-framework/**/*.test.js', - 'packages/osd-ui-framework/doc_site/**/*.js', 'packages/osd-ui-framework/Gruntfile.js', 'packages/osd-opensearch/src/**/*.js', 'packages/osd-interpreter/tasks/**/*.js', diff --git a/.gitignore b/.gitignore index d516495bceba..01c2aaeaf9ef 100644 --- a/.gitignore +++ b/.gitignore @@ -39,8 +39,6 @@ selenium *.swp *.swo *.out -/packages/osd-ui-framework/doc_site/build/* -!/packages/osd-ui-framework/doc_site/build/index.html package-lock.json .yo-rc.json .vscode diff --git a/package.json b/package.json index 7df8e5c87422..584b8fdbed3f 100644 --- a/package.json +++ b/package.json @@ -62,8 +62,7 @@ "lint:es": "node scripts/eslint", "lint:style": "node scripts/stylelint", "makelogs": "node scripts/makelogs", - "uiFramework:start": "cd packages/osd-ui-framework && yarn docSiteStart", - "uiFramework:build": "cd packages/osd-ui-framework && yarn docSiteBuild", + "uiFramework:compileCss": "cd packages/osd-ui-framework && yarn compileCss", "osd:watch": "node scripts/opensearch_dashboards --dev --logging.json=false", "build:types": "rm -rf ./target/types && tsc --p tsconfig.types.json", "docs:acceptApiChanges": "node --max-old-space-size=6144 scripts/check_published_api_changes.js --accept", diff --git a/packages/osd-ui-framework/Gruntfile.js b/packages/osd-ui-framework/Gruntfile.js index 1325d68dce52..9ad26b578e08 100644 --- a/packages/osd-ui-framework/Gruntfile.js +++ b/packages/osd-ui-framework/Gruntfile.js @@ -31,11 +31,6 @@ const sass = require('node-sass'); const postcss = require('postcss'); const postcssConfig = require('@osd/optimizer/postcss.config.js'); -const chokidar = require('chokidar'); -const { debounce } = require('lodash'); - -const platform = require('os').platform(); -const isPlatformWindows = /^win/.test(platform); module.exports = function (grunt) { grunt.initConfig({ @@ -71,122 +66,18 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-babel'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-copy'); - grunt.registerTask('prodBuild', ['clean:target', 'copy:makeProdBuild', 'babel:prodBuild']); - - grunt.registerTask('docSiteBuild', function () { - const done = this.async(); - - const serverCmd = { - cmd: isPlatformWindows ? '.\\node_modules\\.bin\\webpack.cmd' : './node_modules/.bin/webpack', - args: [ - '-p', - '--config=doc_site/webpack.config.js', - '--devtool=null', // Prevent the source map from being generated - ], - opts: { stdio: 'inherit' }, - }; - - const uiFrameworkServerBuild = new Promise((resolve, reject) => { - grunt.util.spawn(serverCmd, (error, result, code) => { - if (error || code !== 0) { - const message = result.stderr || result.stdout; - - grunt.log.error(message); - - return reject(); - } - - grunt.log.writeln(result); - - resolve(); - }); - }); - - uiFrameworkServerBuild.then(done); - }); - - grunt.registerTask('docSiteStart', function () { - const done = this.async(); - Promise.all([uiFrameworkWatch(), uiFrameworkServerStart()]).then(done); - }); - grunt.registerTask('compileCssLight', function () { - const done = this.async(); - uiFrameworkCompileLight().then(done); - }); + grunt.registerTask('prodBuild', ['clean:target', 'copy:makeProdBuild', 'babel:prodBuild']); - grunt.registerTask('compileCssDark', function () { + grunt.registerTask('compileCss', function () { const done = this.async(); - uiFrameworkCompileDark().then(done); + Promise.all([ + uiFrameworkCompile('src/kui_light.scss', 'dist/kui_light.css'), + uiFrameworkCompile('src/kui_dark.scss', 'dist/kui_dark.css'), + ]).then(done); }); - function uiFrameworkServerStart() { - const serverCmd = { - cmd: isPlatformWindows - ? '.\\node_modules\\.bin\\webpack-dev-server.cmd' - : './node_modules/.bin/webpack-dev-server', - args: [ - '--config=doc_site/webpack.config.js', - '--hot', - '--inline', - '--content-base=doc_site/build', - '--host=0.0.0.0', - '--port=8020', - ], - opts: { stdio: 'inherit' }, - }; - - return new Promise((resolve, reject) => { - grunt.util.spawn(serverCmd, (error, result, code) => { - if (error || code !== 0) { - const message = result.stderr || result.stdout; - - grunt.log.error(message); - - return reject(); - } - - grunt.log.writeln(result); - - resolve(); - }); - }); - } - - function uiFrameworkCompileLight() { - const src = 'src/kui_light.scss'; - const dest = 'dist/kui_light.css'; - - return new Promise((resolve) => { - sass.render( - { - file: src, - }, - function (error, result) { - if (error) { - grunt.log.error(error); - } - - postcss([postcssConfig]) - .process(result.css, { from: src, to: dest }) - .then((result) => { - grunt.file.write(dest, result.css); - - if (result.map) { - grunt.file.write(`${dest}.map`, result.map); - } - - resolve(); - }); - } - ); - }); - } - - function uiFrameworkCompileDark() { - const src = 'src/kui_dark.scss'; - const dest = 'dist/kui_dark.css'; - + function uiFrameworkCompile(src, dest) { return new Promise((resolve) => { sass.render( { @@ -212,39 +103,4 @@ module.exports = function (grunt) { ); }); } - - function uiFrameworkWatch() { - const debouncedCompile = debounce( - () => { - // Compile the SCSS in a separate process because node-sass throws a fatal error if it fails - // to compile. - grunt.util.spawn( - { - cmd: isPlatformWindows - ? '.\\node_modules\\.bin\\grunt.cmd' - : './node_modules/.bin/grunt', - args: ['compileCssLight', 'compileCssDark'], - }, - (error, result) => { - if (error) { - grunt.log.error(result.stdout); - } else { - grunt.log.writeln(result); - } - } - ); - }, - 400, - { leading: true } - ); - - return new Promise(() => { - debouncedCompile(); - - chokidar.watch('src', { ignoreInitial: true }).on('all', (event, path) => { - grunt.log.writeln(event, path); - debouncedCompile(); - }); - }); - } }; diff --git a/packages/osd-ui-framework/README.md b/packages/osd-ui-framework/README.md index f0b92f547fc6..fbc4f819acc2 100644 --- a/packages/osd-ui-framework/README.md +++ b/packages/osd-ui-framework/README.md @@ -6,12 +6,7 @@ This framework was used to build legacy layouts in Kibana 5.x and 6.x and is rep ## Documentation -Compile the CSS with `./node_modules/grunt/bin/grunt uiFramework:compileCss` (OS X) or -`.\node_modules\grunt\bin\grunt uiFramework:compileCss` (Windows). - -You can view interactive documentation by running `yarn uiFramework:start` and then visiting -[http://localhost:8020/](http://localhost:8020/). This will also start watching the SCSS files, and will recompile the CSS -automatically for you when you make changes. +Compile the CSS with `yarn uiFramework:compileCss`. You can run `node scripts/jest --watch` to watch for changes and run the tests as you code. diff --git a/packages/osd-ui-framework/doc_site/build/index.html b/packages/osd-ui-framework/doc_site/build/index.html deleted file mode 100644 index aed4fcf3ba4e..000000000000 --- a/packages/osd-ui-framework/doc_site/build/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - -
- - - diff --git a/packages/osd-ui-framework/doc_site/src/actions/action_types.js b/packages/osd-ui-framework/doc_site/src/actions/action_types.js deleted file mode 100644 index 1cb07ff486ff..000000000000 --- a/packages/osd-ui-framework/doc_site/src/actions/action_types.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import keyMirror from 'keymirror'; - -export default keyMirror({ - // Source code viewer actions - OPEN_CODE_VIEWER: null, - CLOSE_CODE_VIEWER: null, - - // Sandbox actions - OPEN_SANDBOX: null, - CLOSE_SANDBOX: null, - - // Example nav actions - REGISTER_SECTION: null, - UNREGISTER_SECTION: null, -}); diff --git a/packages/osd-ui-framework/doc_site/src/actions/code_viewer_actions.js b/packages/osd-ui-framework/doc_site/src/actions/code_viewer_actions.js deleted file mode 100644 index 1a6ae84bdab8..000000000000 --- a/packages/osd-ui-framework/doc_site/src/actions/code_viewer_actions.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import ActionTypes from './action_types'; - -export const openCodeViewer = (source, title) => ({ - type: ActionTypes.OPEN_CODE_VIEWER, - source, - title, -}); - -export const closeCodeViewer = () => ({ - type: ActionTypes.CLOSE_CODE_VIEWER, -}); diff --git a/packages/osd-ui-framework/doc_site/src/actions/example_nav_actions.js b/packages/osd-ui-framework/doc_site/src/actions/example_nav_actions.js deleted file mode 100644 index 40bb6269240e..000000000000 --- a/packages/osd-ui-framework/doc_site/src/actions/example_nav_actions.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import ActionTypes from './action_types'; - -export const registerSection = (id, name) => ({ - type: ActionTypes.REGISTER_SECTION, - id, - name, -}); - -export const unregisterSection = (id) => ({ - type: ActionTypes.UNREGISTER_SECTION, - id, -}); diff --git a/packages/osd-ui-framework/doc_site/src/actions/index.js b/packages/osd-ui-framework/doc_site/src/actions/index.js deleted file mode 100644 index 010511a4c350..000000000000 --- a/packages/osd-ui-framework/doc_site/src/actions/index.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export { openCodeViewer, closeCodeViewer } from './code_viewer_actions'; - -export { openSandbox, closeSandbox } from './sandbox_actions'; - -export { registerSection, unregisterSection } from './example_nav_actions'; diff --git a/packages/osd-ui-framework/doc_site/src/actions/sandbox_actions.js b/packages/osd-ui-framework/doc_site/src/actions/sandbox_actions.js deleted file mode 100644 index bb05bb7bbeef..000000000000 --- a/packages/osd-ui-framework/doc_site/src/actions/sandbox_actions.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import ActionTypes from './action_types'; - -export const openSandbox = () => ({ - type: ActionTypes.OPEN_SANDBOX, -}); - -export const closeSandbox = () => ({ - type: ActionTypes.CLOSE_SANDBOX, -}); diff --git a/packages/osd-ui-framework/doc_site/src/components/guide/_guide.scss b/packages/osd-ui-framework/doc_site/src/components/guide/_guide.scss deleted file mode 100644 index 81b6196a1311..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide/_guide.scss +++ /dev/null @@ -1,108 +0,0 @@ -html { - height: 100%; -} - -.guideBody { - height: 100%; - background-color: $euiColorFullShade; - margin: 0; - min-width: $guideMinWidth; -} - -/** - * 1. Expand container to fit the page if the content is shorter than the page, or expand with the - * content if it's taller than the page. - */ -.guide { - display: flex; - min-height: 100%; /* 1 */ -} - -.guideContent { - display: flex; - flex-direction: column; - flex: 1 1 auto; - padding-top: $guideNavHeight; - background-color: $guideBaseBackgroundColor; - transition: - padding-top $guideChromeTransition, - padding-right $guideCodeViewerTransition, - opacity $guideCodeViewerTransition; - - &.is-code-viewer-open { - padding-right: $guideCodeViewerWidth; - - @include whenNarrowerThan($guideNormalBreakpoint) { - padding-right: $guideCodeViewerSmallWidth; - } - } - - .is-guide-nav-open + & { - opacity: 0.7; - } - - &.is-chrome-hidden { - padding-top: 0; - } -} - -@media only screen and (max-width: 1300px) { - .guideHomePage { - justify-content: flex-start !important; - - .guideContentPage__content { - margin-left: 250px; - } - } -} - -.guideContentPage { - position: relative; - display: flex; - justify-content: center; - flex: 1 0 auto; - background-color: $euiColorEmptyShade; -} - -.guideContentPage__hint { - position: absolute; - top: 0; - left: 0; - width: 100%; - max-width: 260px; - max-height: 500px; - padding: 30px; - margin: 20px; - border-radius: 4px; - background-color: $euiColorLightestShade; - line-height: $guideLineHeight; -} - -.guideContentPage__content { - width: 100%; - max-width: 800px; - padding: 30px 60px; -} - -.guideHintArrow { - position: absolute; - top: -15px; - left: 12px; - background-image: url("images/hint-arrow.svg"); - width: 26px; - height: 40px; - background-repeat: no-repeat; - background-size: contain; -} - -.guideWarning { - border-left: 5px solid $euiColorAccent; - margin-top: 19px; - padding: 0 14px; - line-height: 21px; - color: $euiColorAccent; -} - -.guideBreak { - border: none; -} diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_code/_guide_code.scss b/packages/osd-ui-framework/doc_site/src/components/guide_code/_guide_code.scss deleted file mode 100644 index d62950f0923d..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_code/_guide_code.scss +++ /dev/null @@ -1,6 +0,0 @@ -.guideCode { - padding: 2px 4px; - font-family: "Ubuntu Mono", monospace; - background-color: $euiColorLightestShade; - color: $euiColorDarkShade; -} diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_code/guide_code.js b/packages/osd-ui-framework/doc_site/src/components/guide_code/guide_code.js deleted file mode 100644 index cc2ab60cf2b7..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_code/guide_code.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -export const GuideCode = (props) => {props.children}; diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_code_viewer/_guide_code_viewer.scss b/packages/osd-ui-framework/doc_site/src/components/guide_code_viewer/_guide_code_viewer.scss deleted file mode 100644 index d76adab84f2d..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_code_viewer/_guide_code_viewer.scss +++ /dev/null @@ -1,113 +0,0 @@ -.guideCodeViewer { - position: fixed; - top: $guideNavHeight; - right: 0; - bottom: 0; - width: $guideCodeViewerWidth; - padding: 6px 0 40px; - background-color: $euiColorEmptyShade; - transform: translateX($guideCodeViewerWidth); - transition: transform $guideCodeViewerTransition; - overflow: auto; - border-left: $euiBorderThin; - - @include scrollbar; - - @include whenNarrowerThan($guideNormalBreakpoint) { - width: $guideCodeViewerSmallWidth; - } - - &.is-code-viewer-open { - transform: translateX(0); - } -} - -.guideCodeViewer__header { - padding: 0 20px 6px; - line-height: $guideLineHeight; - border-bottom: $euiBorderThin; - font-size: 14px; - font-weight: 700; - margin-bottom: 10px; -} - -.guideCodeViewer__closeButton { - position: absolute; - top: 0; - right: 10px; - cursor: pointer; - padding: 10px; - border-radius: 3px; - color: $guideTextColor; - - &:hover { - color: $guideLinkHoverColor; - } -} - -.guideCodeViewer__title { - padding: 0 20px 6px; - border-bottom: $euiBorderThin; - line-height: $guideLineHeight; - font-size: 14px; -} - -.guideCodeViewer__content { - margin: 0 0 16px; -} - -// HLJS - -.hljs { - display: block; - padding: 15px 20px; - color: $euiColorDarkShade; - font-size: 14px; - line-height: 1.3; - font-family: "Ubuntu Mono", monospace; -} - -.hljs-keyword { - color: #b58900; -} - -.hljs-function { - .hljs-keyword { - color: #268bd2; - } - - .hljs-title { - color: #7441c6; - } -} - -.hljs-built_in { - color: #268bd2; -} - -.hljs-string { - color: #36958e; -} - -.hljs-comment { - color: #9d9d9d; -} - -.hljs-number, -.hljs-literal { - color: #d84a7e; -} - -.hljs-tag { - .hljs-name { - color: #63a35c; - } - - .hljs-attr { - color: #795da3; - } - - .hljs-string { - color: #df5000; - } -} diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_code_viewer/guide_code_viewer.js b/packages/osd-ui-framework/doc_site/src/components/guide_code_viewer/guide_code_viewer.js deleted file mode 100644 index 5d32b41f52ee..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_code_viewer/guide_code_viewer.js +++ /dev/null @@ -1,100 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import PropTypes from 'prop-types'; -import React, { Component } from 'react'; - -import classNames from 'classnames'; -import hljs from 'highlight.js'; - -export class GuideCodeViewer extends Component { - constructor(props) { - super(props); - } - - componentDidUpdate() { - if (this.refs.html) { - hljs.highlightBlock(this.refs.html); - } - - if (this.refs.javascript) { - hljs.highlightBlock(this.refs.javascript); - } - } - - renderSection(type, code) { - const typeToCodeClassMap = { - JavaScript: 'javascript', - HTML: 'html', - }; - - const codeClass = typeToCodeClassMap[type]; - - if (code) { - return ( -
-
{type}
-
-            
-              {code}
-            
-          
-
- ); - } - } - - render() { - const classes = classNames('guideCodeViewer', { - 'is-code-viewer-open': this.props.isOpen, - }); - - const codeSections = this.props.source.map((sourceObject) => - this.renderSection(sourceObject.type, sourceObject.code) - ); - - return ( -
-
{this.props.title}
- -
- - {codeSections} -
- ); - } -} - -GuideCodeViewer.propTypes = { - isOpen: PropTypes.bool, - onClose: PropTypes.func, - title: PropTypes.string, - source: PropTypes.array, -}; diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_components.scss b/packages/osd-ui-framework/doc_site/src/components/guide_components.scss deleted file mode 100644 index fc2a1b62056d..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_components.scss +++ /dev/null @@ -1,61 +0,0 @@ -@import "guide/guide"; -@import "guide_code/guide_code"; -@import "guide_code_viewer/guide_code_viewer"; -@import "guide_demo/guide_demo"; -@import "guide_link/guide_link"; -@import "guide_nav/guide_nav"; -@import "guide_page/guide_page"; -@import "guide_page_side_nav/guide_page_side_nav"; -@import "guide_sandbox/guide_sandbox"; -@import "guide_section/guide_section"; -@import "guide_text/guide_text"; - -$guideVerticalRhythm: $euiSize; -$guideLineHeight: $euiSizeL; -$guideNavHeight: 60px; -$guideSideNavWidth: 400px; -$guideSideNavSmallWidth: 220px; -$guideCodeViewerWidth: 660px; -$guideCodeViewerSmallWidth: 520px; -$guideCodeViewerTransition: 0.2s ease; -$guideChromeTransition: 0.3s ease; - -// Colors -$guideBaseBackgroundColor: $euiColorLightestShade; -$guidePanelBackgroundColor: $euiColorEmptyShade; -$guideTextColor: $euiColorDarkestShade; -$guideLinkColor: $euiColorPrimary; -$guideLinkHoverColor: darken($euiColorPrimary, 10%); - -// Breakpoints -$guideMinWidth: 840px; -$guideNormalBreakpoint: 1900px; - -@mixin whenNarrowerThan($browserWidth) { - @media only screen and (max-width: #{$browserWidth}) { - @content; - } -} - -@mixin whenWiderThan($browserWidth) { - @media only screen and (min-width: #{$browserWidth}) { - @content; - } -} - -@mixin scrollbar($color: $euiBorderColor) { - &::-webkit-scrollbar { - width: 16px; - height: 16px; - } - - &::-webkit-scrollbar-thumb { - background-color: $color; - border: 6px solid transparent; - background-clip: content-box; - } - - &::-webkit-scrollbar-track { - background-color: transparent; - } -} diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_demo/_guide_demo.scss b/packages/osd-ui-framework/doc_site/src/components/guide_demo/_guide_demo.scss deleted file mode 100644 index 050cdeaa6f94..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_demo/_guide_demo.scss +++ /dev/null @@ -1,23 +0,0 @@ -.guideDemo { - margin-top: $guideVerticalRhythm; -} - -.guideDemo--fullScreen { - width: 100%; - height: 100%; - margin-top: 0; -} - -.guideDemo__highlightGrid { - .kuiFlexItem { - background: transparentize($euiColorPrimary, 0.9); - padding: 16px; - } -} - -.guideDemo__highlightGridWrap { - .kuiFlexItem div { - background: transparentize($euiColorPrimary, 0.9); - padding: 16px; - } -} diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_demo/guide_demo.js b/packages/osd-ui-framework/doc_site/src/components/guide_demo/guide_demo.js deleted file mode 100644 index 729b1f7a88e5..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_demo/guide_demo.js +++ /dev/null @@ -1,102 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import PropTypes from 'prop-types'; -import React, { Component } from 'react'; - -import classNames from 'classnames'; - -export class GuideDemo extends Component { - componentDidMount() { - this.update(); - } - - componentDidUpdate() { - this.update(); - } - - update() { - // We'll just render the children if we have them. - if (this.props.children) { - return; - } - - // Inject HTML. - this.content.innerHTML = this.props.html; // eslint-disable-line no-unsanitized/property - - // Inject JS. - const js = document.createElement('script'); - js.type = 'text/javascript'; - js.innerHTML = this.props.js; // eslint-disable-line no-unsanitized/property - this.content.appendChild(js); - - // Inject CSS. - const css = document.createElement('style'); - css.innerHTML = this.props.css; // eslint-disable-line no-unsanitized/property - this.content.appendChild(css); - } - - render() { - const { - isFullScreen, - children, - className, - js, // eslint-disable-line no-unused-vars - html, // eslint-disable-line no-unused-vars - css, // eslint-disable-line no-unused-vars - ...rest - } = this.props; - - const classes = classNames('guideDemo', className, { - 'guideDemo--fullScreen': isFullScreen, - }); - - return ( -
(this.content = c)} {...rest}> - {children} -
- ); - } -} - -GuideDemo.propTypes = { - children: PropTypes.node, - js: PropTypes.string.isRequired, - html: PropTypes.string.isRequired, - css: PropTypes.string.isRequired, - isFullScreen: PropTypes.bool.isRequired, -}; - -GuideDemo.defaultProps = { - js: '', - html: '', - css: '', - isFullScreen: false, -}; diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_link/_guide_link.scss b/packages/osd-ui-framework/doc_site/src/components/guide_link/_guide_link.scss deleted file mode 100644 index 921ecac96b9b..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_link/_guide_link.scss +++ /dev/null @@ -1,9 +0,0 @@ -.guideLink { - color: $guideLinkColor; - text-decoration: none; - - &:hover { - color: $guideLinkHoverColor; - text-decoration: underline; - } -} diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_link/guide_link.js b/packages/osd-ui-framework/doc_site/src/components/guide_link/guide_link.js deleted file mode 100644 index e69f718037f0..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_link/guide_link.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -export const GuideLink = (props) => ( - - {props.children} - -); diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_nav/_guide_nav.scss b/packages/osd-ui-framework/doc_site/src/components/guide_nav/_guide_nav.scss deleted file mode 100644 index ad4882eb6efc..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_nav/_guide_nav.scss +++ /dev/null @@ -1,206 +0,0 @@ -.guideNav { - display: flex; - flex-direction: column; - position: fixed; - z-index: 10000; - top: 0; - left: 0; - right: 0; - min-width: $guideMinWidth; - height: $guideNavHeight; - border-bottom: $euiBorderThin; - color: $guideTextColor; - background-color: $guidePanelBackgroundColor; - transition: - top $guideChromeTransition, - height 0.3s ease, - box-shadow 0.3s linear; - overflow: hidden; - - @include euiBottomShadowMedium; - - &.is-guide-nav-open { - height: 100%; - - @include euiBottomShadow; - } - - &.is-chrome-hidden { - top: -$guideNavHeight; - } -} - -.guideNav__showButton { - position: fixed; - z-index: 9999; - top: 5px; - right: 5px; - font-size: 10px; - opacity: 0; - transition: opacity $guideChromeTransition; - - .is-chrome-hidden & { - opacity: 1; - } -} - -.guideNav__header { - position: relative; - flex: 0 0 auto; - display: flex; - align-items: center; - height: 60px; - padding: 0 20px; -} - -.guideNav__menu { - cursor: pointer; - margin-right: 10px; - padding: 10px; - border-radius: 3px; - - &.is-menu-button-pinned, - &:hover { - background-color: rgb(black, 0.05); - } - - &:active { - background-color: rgb(black, 0.2); - box-shadow: inset 0 2px 8px rgb(black, 0.1); - } -} - -.guideNav__title { - color: $guideTextColor; - text-decoration: none; - font-size: 18px; -} - -.guideNav__version { - margin-left: 10px; - font-weight: 300; - font-size: 14px; -} - -// TODO: [RENAMEME] replacement background-image might be needed -.guideNav__opensearchLogo { - position: absolute; - background-image: url("images/react-logo.svg"); - width: 106px; - height: 36px; - background-repeat: no-repeat; - background-size: contain; - left: 50%; - transform: translateX(-50%); -} - -.guideNavSearch { - margin: 0 20px; - width: 100%; - max-width: 400px; - font-size: 16px; - padding: 8px; - border: 1px solid rgba($guideTextColor, 0.2); - - &:focus { - border-color: $guideLinkHoverColor; - outline: none; - } -} - -/** - * 1. Height of the searchbox. - */ -.guideNavItemsContainer { - @include scrollbar; - - display: flex; - overflow: auto; - min-height: calc(100vh - #{$guideNavHeight + 40px}); /* 1 */ -} - -.guideNavItems { - display: flex; - flex-flow: column wrap; - align-items: flex-start; - align-content: flex-start; -} - -.guideNavSectionTitle { - min-width: 200px; - padding: 8px 20px; - margin-left: 5px; - font-size: 14px; - line-height: 20px; - font-weight: 700; -} - -.guideNavItem, -.guideNavNoItems { - min-width: 200px; - font-size: 20px; - line-height: 20px; - padding: 8px 20px; - margin-left: 5px; -} - -.guideNavItem { - display: flex; - align-items: center; -} - -.guideNavItem__link { - color: $guideTextColor; - text-decoration: none; - - &:hover { - color: $guideLinkHoverColor; - } -} - -.guideNavItem__reactLogo { - margin-left: 10px; - background-image: url("images/react-logo.svg"); - width: 24px; - height: 22px; - background-repeat: no-repeat; - background-size: contain; -} - -.guideNavNoItems { - color: rgba($guideTextColor, 0.5); - margin-top: 0; - margin-bottom: 0; -} - -.guideNavPaginationButtons { - position: absolute; - top: 20px; - right: 10px; -} - -.guideNavPaginationButton { - appearance: none; - line-height: 10px; - padding: 4px 20px; - color: $guideLinkHoverColor; - background-color: $euiColorEmptyShade; - border: 1px solid $guideLinkHoverColor; - border-radius: 3px; - cursor: pointer; - - &:hover, - &:active { - background-color: $euiColorLightestShade; - } - - &.guideNavPaginationButton-isDisabled { - pointer-events: none; - color: rgba($guideTextColor, 0.25); - border-color: rgba($guideTextColor, 0.25); - } - - & + & { - margin-left: 10px; - } -} diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_nav/guide_nav.js b/packages/osd-ui-framework/doc_site/src/components/guide_nav/guide_nav.js deleted file mode 100644 index 5605d979fd9f..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_nav/guide_nav.js +++ /dev/null @@ -1,224 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import PropTypes from 'prop-types'; -import React, { Component } from 'react'; - -import { Link } from 'react-router'; // eslint-disable-line - -import classNames from 'classnames'; - -export class GuideNav extends Component { - constructor(props) { - super(props); - - const currentRoute = props.routes[1]; - const nextRoute = this.props.getNextRoute(currentRoute.name); - const previousRoute = this.props.getPreviousRoute(currentRoute.name); - - this.state = { - search: '', - nextRoute, - previousRoute, - }; - - this.onSearchChange = this.onSearchChange.bind(this); - } - - onSearchChange(event) { - this.setState({ - search: event.target.value, - }); - } - - UNSAFE_componentWillReceiveProps(nextProps) { - const currentRoute = nextProps.routes[1]; - const nextRoute = this.props.getNextRoute(currentRoute.name); - const previousRoute = this.props.getPreviousRoute(currentRoute.name); - - this.setState({ - nextRoute, - previousRoute, - }); - } - - renderNoItems(name) { - return

{`No ${name} match your search`}

; - } - - renderPagination() { - const previousClasses = classNames('guideNavPaginationButton', { - 'guideNavPaginationButton-isDisabled': !this.state.previousRoute, - }); - - const previousButton = ( - - - - ); - - const nextClasses = classNames('guideNavPaginationButton', { - 'guideNavPaginationButton-isDisabled': !this.state.nextRoute, - }); - - const nextButton = ( - - - - ); - - let hideChromeButton; - - if (this.props.isSandbox) { - hideChromeButton = ( - - ); - } - - return ( -
- {hideChromeButton} - {previousButton} - {nextButton} -
- ); - } - - render() { - const classes = classNames('guideNav', { - 'is-guide-nav-open': this.props.isNavOpen, - 'is-chrome-hidden': !this.props.isChromeVisible, - }); - - const buttonClasses = classNames('guideNav__menu fa fa-bars', { - 'is-menu-button-pinned': this.props.isNavOpen, - }); - - const componentNavItems = this.props.components - .filter((item) => item.name.toLowerCase().indexOf(this.state.search.toLowerCase()) !== -1) - .map((item, index) => { - const icon = item.hasReact ?
: undefined; - return ( -
- - {item.name} - - - {icon} -
- ); - }); - - const sandboxNavItems = this.props.sandboxes - .filter((item) => item.name.toLowerCase().indexOf(this.state.search.toLowerCase()) !== -1) - .map((item, index) => { - const icon = item.hasReact ?
: undefined; - return ( -
- - {item.name} - - - {icon} -
- ); - }); - - return ( -
- - ); - } -} - -GuideNav.propTypes = { - isChromeVisible: PropTypes.bool, - isNavOpen: PropTypes.bool, - isSandbox: PropTypes.bool, - onToggleNav: PropTypes.func, - onHideChrome: PropTypes.func, - onShowChrome: PropTypes.func, - onClickNavItem: PropTypes.func, - version: PropTypes.string, - routes: PropTypes.array, - getNextRoute: PropTypes.func, - getPreviousRoute: PropTypes.func, - components: PropTypes.array, - sandboxes: PropTypes.array, -}; diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_page/_guide_page.scss b/packages/osd-ui-framework/doc_site/src/components/guide_page/_guide_page.scss deleted file mode 100644 index 92b55359fdaa..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_page/_guide_page.scss +++ /dev/null @@ -1,42 +0,0 @@ -.guidePage { - display: flex; - flex: 1 0 auto; - padding-bottom: 20px; -} - -.guidePageBody { - $topMargin: 40px; - $leftMargin: 120px + $guideSideNavWidth; - $rightMargin: 80px; - $scrollBarWidth: 20px; - - background-color: $guidePanelBackgroundColor; - border: $euiBorderThin; - border-radius: 4px; - flex: 1 1 auto; - padding: 40px 60px; - margin: $topMargin $rightMargin 0 $leftMargin; - width: calc(100vw - #{$leftMargin + $rightMargin + $scrollBarWidth}); - - .is-code-viewer-open & { - width: calc(100vw - #{$leftMargin + $rightMargin + $scrollBarWidth + $guideCodeViewerWidth}); - } - - @include whenNarrowerThan($guideNormalBreakpoint) { - $leftMargin: 20px + $guideSideNavSmallWidth; - $rightMargin: 20px; - - margin: $topMargin $rightMargin 0 $leftMargin; - width: calc(100vw - #{$leftMargin + $rightMargin + $scrollBarWidth}); - - .is-code-viewer-open & { - width: calc(100vw - #{$leftMargin + $rightMargin + $scrollBarWidth + $guideCodeViewerSmallWidth}); - } - } -} - -.guidePageKillScreen { - background-color: tintOrShade($euiColorDanger, 90%, 70%); - padding: $euiSizeL; - margin-bottom: $euiSizeL; -} diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_page/guide_page.js b/packages/osd-ui-framework/doc_site/src/components/guide_page/guide_page.js deleted file mode 100644 index e832ed1bb56c..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_page/guide_page.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import PropTypes from 'prop-types'; -import React, { Component } from 'react'; - -import { GuidePageSideNav, GuidePageSideNavItem } from '../'; - -export class GuidePage extends Component { - constructor(props) { - super(props); - - this.onClickLink = this.onClickLink.bind(this); - } - - onClickLink(id) { - // Scroll to element. - // eslint-disable-next-line no-undef - $('html, body').animate( - { - // eslint-disable-next-line no-undef - scrollTop: $(`#${id}`).offset().top - 100, - }, - 250 - ); - } - - renderSideNavMenu() { - // Traverse sections and build side nav from it. - return this.props.sections.map((section, index) => { - return ( - - {section.name} - - ); - }); - } - - render() { - return ( - - ); - } -} - -GuidePage.propTypes = { - children: PropTypes.any, - title: PropTypes.string, - sections: PropTypes.array, -}; diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_page/guide_page_container.js b/packages/osd-ui-framework/doc_site/src/components/guide_page/guide_page_container.js deleted file mode 100644 index 99a7f47e6995..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_page/guide_page_container.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { connect } from 'react-redux'; -import { getSections } from '../../store'; -import { GuidePage } from './guide_page'; - -const mapStateToProps = (state) => ({ - sections: getSections(state), -}); - -export const GuidePageContainer = connect(mapStateToProps)(GuidePage); diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_page_side_nav/_guide_page_side_nav.scss b/packages/osd-ui-framework/doc_site/src/components/guide_page_side_nav/_guide_page_side_nav.scss deleted file mode 100644 index b9063dac5f5f..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_page_side_nav/_guide_page_side_nav.scss +++ /dev/null @@ -1,44 +0,0 @@ -.guidePageSideNav { - position: fixed; - top: 70px; - left: 10px; - bottom: 10px; - width: $guideSideNavWidth; - overflow: auto; - z-index: 100; - padding: 12px 20px; - - @include scrollbar; - - @include whenNarrowerThan($guideNormalBreakpoint) { - width: $guideSideNavSmallWidth; - } -} - -.guidePageSideNav__title { - padding-bottom: 10px; - margin-bottom: 7px; - font-size: 22px; - line-height: $guideLineHeight; - opacity: 0.8; -} - -.guidePageSideNavMenu { - line-height: $guideLineHeight; -} - -.guidePageSideNavMenu__item { - & + & { - margin-top: 6px; - } -} - -.guidePageSideNavMenu__itemLink { - cursor: pointer; - color: $guideTextColor; - text-decoration: none; - - &:hover { - color: $guideLinkHoverColor; - } -} diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_page_side_nav/guide_page_side_nav.js b/packages/osd-ui-framework/doc_site/src/components/guide_page_side_nav/guide_page_side_nav.js deleted file mode 100644 index d7d00347b95b..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_page_side_nav/guide_page_side_nav.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import PropTypes from 'prop-types'; -import React from 'react'; - -export const GuidePageSideNav = (props) => { - return ( -
-
{props.title}
- -
{props.children}
-
- ); -}; - -GuidePageSideNav.propTypes = { - title: PropTypes.string, - children: PropTypes.any, -}; diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_page_side_nav/guide_page_side_nav_item.js b/packages/osd-ui-framework/doc_site/src/components/guide_page_side_nav/guide_page_side_nav_item.js deleted file mode 100644 index 2ce874096cb8..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_page_side_nav/guide_page_side_nav_item.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import PropTypes from 'prop-types'; -import React, { Component } from 'react'; - -export class GuidePageSideNavItem extends Component { - constructor(props) { - super(props); - - this.onClick = this.onClick.bind(this); - } - - onClick() { - this.props.onClick(this.props.id); - } - - render() { - return ( -
-
- {this.props.children} -
-
- ); - } -} - -GuidePageSideNavItem.propTypes = { - id: PropTypes.string, - children: PropTypes.any, - onClick: PropTypes.func, -}; diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_sandbox/_guide_sandbox.scss b/packages/osd-ui-framework/doc_site/src/components/guide_sandbox/_guide_sandbox.scss deleted file mode 100644 index 9a13abd7e8e6..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_sandbox/_guide_sandbox.scss +++ /dev/null @@ -1,10 +0,0 @@ -.guideSandbox { - width: 100%; - height: 100%; -} - -.guideSandboxCodeToggle { - position: fixed; - top: 70px; - right: 10px; -} diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_sandbox/guide_sandbox.js b/packages/osd-ui-framework/doc_site/src/components/guide_sandbox/guide_sandbox.js deleted file mode 100644 index a11b5ddf866b..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_sandbox/guide_sandbox.js +++ /dev/null @@ -1,74 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { bindActionCreators } from 'redux'; -import { connect } from 'react-redux'; - -import { getIsSandbox } from '../../store'; - -import { openSandbox, closeSandbox } from '../../actions'; - -function mapStateToProps(state) { - return { - isSandbox: getIsSandbox(state), - }; -} - -function mapDispatchToProps(dispatch) { - const actions = { - openSandbox, - closeSandbox, - }; - - return bindActionCreators(actions, dispatch); -} - -class GuideSandboxComponent extends Component { - UNSAFE_componentWillMount() { - this.props.openSandbox(); - } - - componentWillUnmount() { - this.props.closeSandbox(); - } - - render() { - return
{this.props.children}
; - } -} - -GuideSandboxComponent.propTypes = { - openSandbox: PropTypes.func, - closeSandbox: PropTypes.func, -}; - -export const GuideSandbox = connect(mapStateToProps, mapDispatchToProps)(GuideSandboxComponent); diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_sandbox/guide_sandbox_code_toggle.js b/packages/osd-ui-framework/doc_site/src/components/guide_sandbox/guide_sandbox_code_toggle.js deleted file mode 100644 index fea5722ae067..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_sandbox/guide_sandbox_code_toggle.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import PropTypes from 'prop-types'; -import React, { Component } from 'react'; - -export class GuideSandboxCodeToggle extends Component { - constructor(props) { - super(props); - this.onClickSource = this.onClickSource.bind(this); - } - - onClickSource() { - this.props.openCodeViewer(this.props.source, this.props.title); - } - - render() { - return ( - - ); - } -} - -GuideSandboxCodeToggle.propTypes = { - source: PropTypes.array, - title: PropTypes.string, - openCodeViewer: PropTypes.func, -}; diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_sandbox/guide_sandbox_code_toggle_container.js b/packages/osd-ui-framework/doc_site/src/components/guide_sandbox/guide_sandbox_code_toggle_container.js deleted file mode 100644 index 13a90031c0cd..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_sandbox/guide_sandbox_code_toggle_container.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { connect } from 'react-redux'; - -import { GuideSandboxCodeToggle } from './guide_sandbox_code_toggle'; -import { openCodeViewer } from '../../actions'; - -export const GuideSandboxCodeToggleContainer = connect(null, { - openCodeViewer, -})(GuideSandboxCodeToggle); diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_section/_guide_section.scss b/packages/osd-ui-framework/doc_site/src/components/guide_section/_guide_section.scss deleted file mode 100644 index 6263486876ed..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_section/_guide_section.scss +++ /dev/null @@ -1,38 +0,0 @@ -.guideSection { - margin-bottom: 40px; -} - -.guideSection__header { - display: flex; - justify-content: space-between; - align-items: center; - padding-bottom: 2px; - line-height: $guideLineHeight; -} - -.guideSection__title { - font-size: 18px; - font-weight: 700; -} - -.guideSection__sourceButton { - appearance: none; - line-height: 10px; - padding: 4px 10px; - color: $guideLinkHoverColor; - background-color: $euiColorEmptyShade; - border: 1px solid $guideLinkHoverColor; - border-radius: 3px; - cursor: pointer; - transform: translateX(0); - transition: transform $guideChromeTransition; - - &:hover, - &:active { - background-color: $euiColorLightestShade; - } - - .is-chrome-hidden & { - transform: translateX(60px); - } -} diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_section/guide_section.js b/packages/osd-ui-framework/doc_site/src/components/guide_section/guide_section.js deleted file mode 100644 index cc12bbfbea83..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_section/guide_section.js +++ /dev/null @@ -1,81 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import PropTypes from 'prop-types'; -import React, { Component } from 'react'; - -import Slugify from '../../services/string/slugify'; - -export class GuideSection extends Component { - constructor(props) { - super(props); - this.onClickSource = this.onClickSource.bind(this); - } - - getId() { - return Slugify.one(this.props.title); - } - - onClickSource() { - this.props.openCodeViewer(this.props.source, this.props.title); - } - - UNSAFE_componentWillMount() { - this.props.registerSection(this.getId(), this.props.title); - } - - componentWillUnmount() { - this.props.unregisterSection(this.getId()); - } - - render() { - return ( -
-
-
{this.props.title}
- -
- - {this.props.children} -
- ); - } -} - -GuideSection.propTypes = { - title: PropTypes.string, - source: PropTypes.array, - children: PropTypes.any, - openCodeViewer: PropTypes.func, - registerSection: PropTypes.func, - unregisterSection: PropTypes.func, -}; diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_section/guide_section_container.js b/packages/osd-ui-framework/doc_site/src/components/guide_section/guide_section_container.js deleted file mode 100644 index 13f7e077f070..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_section/guide_section_container.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { connect } from 'react-redux'; - -import { GuideSection } from './guide_section'; -import { openCodeViewer, registerSection, unregisterSection } from '../../actions'; - -export const GuideSectionContainer = connect(null, { - openCodeViewer, - registerSection, - unregisterSection, -})(GuideSection); diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_section/guide_section_types.js b/packages/osd-ui-framework/doc_site/src/components/guide_section/guide_section_types.js deleted file mode 100644 index b958daef3d8d..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_section/guide_section_types.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export const GuideSectionTypes = { - JS: 'JavaScript', - HTML: 'HTML', -}; diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_text/_guide_text.scss b/packages/osd-ui-framework/doc_site/src/components/guide_text/_guide_text.scss deleted file mode 100644 index 11c6be092180..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_text/_guide_text.scss +++ /dev/null @@ -1,16 +0,0 @@ -.guideTitle { - font-weight: 700; - font-size: 22px; - line-height: 1.5; - margin: 0; -} - -.guideText { - font-size: 14px; - line-height: 1.5; - margin: $guideVerticalRhythm 0 0; -} - -.guideText--noMargin { - margin-top: 0; -} diff --git a/packages/osd-ui-framework/doc_site/src/components/guide_text/guide_text.js b/packages/osd-ui-framework/doc_site/src/components/guide_text/guide_text.js deleted file mode 100644 index bb7f05fff02d..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/guide_text/guide_text.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -export const GuideText = (props) =>
{props.children}
; diff --git a/packages/osd-ui-framework/doc_site/src/components/index.js b/packages/osd-ui-framework/doc_site/src/components/index.js deleted file mode 100644 index 678507fb4cda..000000000000 --- a/packages/osd-ui-framework/doc_site/src/components/index.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export { GuideCode } from './guide_code/guide_code'; -export { GuideCodeViewer } from './guide_code_viewer/guide_code_viewer'; -export { GuideDemo } from './guide_demo/guide_demo'; -export { GuideLink } from './guide_link/guide_link'; -export { GuideNav } from './guide_nav/guide_nav'; -export { GuidePageContainer as GuidePage } from './guide_page/guide_page_container'; -export { GuidePageSideNav } from './guide_page_side_nav/guide_page_side_nav'; -export { GuidePageSideNavItem } from './guide_page_side_nav/guide_page_side_nav_item'; -export { GuideSandbox } from './guide_sandbox/guide_sandbox'; -export { GuideSandboxCodeToggleContainer as GuideSandboxCodeToggle } from './guide_sandbox/guide_sandbox_code_toggle_container'; -export { GuideSectionContainer as GuideSection } from './guide_section/guide_section_container'; -export { GuideSectionTypes } from './guide_section/guide_section_types'; -export { GuideText } from './guide_text/guide_text'; diff --git a/packages/osd-ui-framework/doc_site/src/images/hint-arrow.svg b/packages/osd-ui-framework/doc_site/src/images/hint-arrow.svg deleted file mode 100644 index b78f16f4bef4..000000000000 --- a/packages/osd-ui-framework/doc_site/src/images/hint-arrow.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - arrow - Created with Sketch. - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/packages/osd-ui-framework/doc_site/src/images/react-logo.svg b/packages/osd-ui-framework/doc_site/src/images/react-logo.svg deleted file mode 100644 index 360cb427c9e6..000000000000 --- a/packages/osd-ui-framework/doc_site/src/images/react-logo.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - react-logo - Created with Sketch. - - - - - \ No newline at end of file diff --git a/packages/osd-ui-framework/doc_site/src/index.js b/packages/osd-ui-framework/doc_site/src/index.js deleted file mode 100644 index 401c60a8dc55..000000000000 --- a/packages/osd-ui-framework/doc_site/src/index.js +++ /dev/null @@ -1,99 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -require('./main.scss'); - -import 'core-js/stable'; -import 'regenerator-runtime/runtime'; -import React from 'react'; -import ReactDOM from 'react-dom'; -import { Provider } from 'react-redux'; -import { Router, hashHistory } from 'react-router'; // eslint-disable-line - -// Store. -import configureStore from './store/configure_store'; - -// Guide views. -import AppContainer from './views/app_container'; -import { HomeView } from './views/home/home_view'; -import { NotFoundView } from './views/not_found/not_found_view'; - -import { Routes } from './services'; - -const store = configureStore(); - -const childRoutes = [].concat(Routes.getAppRoutes()); -childRoutes.push({ - path: '*', - component: NotFoundView, - name: 'Page Not Found', -}); - -const routes = [ - { - path: '/', - component: AppContainer, - indexRoute: { - component: HomeView, - source: 'views/home/HomeView', - }, - childRoutes, - }, -]; - -// Update document title with route name. -const onRouteEnter = (route) => { - const leafRoute = route.routes[route.routes.length - 1]; - document.title = leafRoute.name - ? `OpenSearch Dashboards UI Framework - ${leafRoute.name}` - : 'OpenSearch Dashboards UI Framework'; -}; - -const syncTitleWithRoutes = (routesList) => { - if (!routesList) return; - routesList.forEach((route) => { - route.onEnter = onRouteEnter; // eslint-disable-line no-param-reassign - if (route.indexRoute) { - // Index routes have a weird relationship with their "parent" routes, - // so it seems we need to give their own onEnter hooks. - route.indexRoute.onEnter = onRouteEnter; // eslint-disable-line no-param-reassign - } - syncTitleWithRoutes(route.childRoutes); - }); -}; - -syncTitleWithRoutes(routes); - -ReactDOM.render( - - - , - document.getElementById('guide') -); diff --git a/packages/osd-ui-framework/doc_site/src/main.scss b/packages/osd-ui-framework/doc_site/src/main.scss deleted file mode 100644 index 6b114c693b47..000000000000 --- a/packages/osd-ui-framework/doc_site/src/main.scss +++ /dev/null @@ -1,7 +0,0 @@ -@import "~@elastic/eui/src/themes/eui/eui_colors_dark"; -@import "~@elastic/eui/src/global_styling/functions/index"; -@import "~@elastic/eui/src/global_styling/variables/index"; -@import "~@elastic/eui/src/global_styling/mixins/index"; -@import "~@elastic/eui/src/global_styling/reset/index"; -@import "../../dist/kui_dark.css"; -@import "./components/guide_components"; diff --git a/packages/osd-ui-framework/doc_site/src/services/example/create_example.js b/packages/osd-ui-framework/doc_site/src/services/example/create_example.js deleted file mode 100644 index d9387cc7f94e..000000000000 --- a/packages/osd-ui-framework/doc_site/src/services/example/create_example.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* eslint import/named: 0 */ -import { GuideExample } from '../../components'; - -export default function creatExample(examples) { - class Example extends GuideExample { - constructor(props) { - super(props, examples); - } - } - - Example.propTypes = { - ...GuideExample.propTypes, - }; - - return Example; -} diff --git a/packages/osd-ui-framework/doc_site/src/services/index.js b/packages/osd-ui-framework/doc_site/src/services/index.js deleted file mode 100644 index 91123c856b3b..000000000000 --- a/packages/osd-ui-framework/doc_site/src/services/index.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export { renderToHtml } from './string/render_to_html'; - -export { default as createExample } from './example/create_example'; - -export { default as JsInjector } from './js_injector/js_injector'; - -export { default as Routes } from './routes/routes'; - -export { default as Slugify } from './string/slugify'; diff --git a/packages/osd-ui-framework/doc_site/src/services/js_injector/js_injector.js b/packages/osd-ui-framework/doc_site/src/services/js_injector/js_injector.js deleted file mode 100644 index 5cccfac934ca..000000000000 --- a/packages/osd-ui-framework/doc_site/src/services/js_injector/js_injector.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import $ from 'jquery'; - -const ID_ATTRIBUTE = 'injected-js-tag-id'; - -export default { - inject(js, id) { - if (id) { - $(`[${ID_ATTRIBUTE}=${id}]`).remove(); - } - - const script = $(``); - $('body').append(script); - }, - - remove(id) { - $(`[${ID_ATTRIBUTE}=${id}]`).remove(); - }, -}; diff --git a/packages/osd-ui-framework/doc_site/src/services/routes/routes.js b/packages/osd-ui-framework/doc_site/src/services/routes/routes.js deleted file mode 100644 index 299e3126b595..000000000000 --- a/packages/osd-ui-framework/doc_site/src/services/routes/routes.js +++ /dev/null @@ -1,186 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import Slugify from '../string/slugify'; - -import BarExample from '../../views/bar/bar_example'; - -import ButtonExample from '../../views/button/button_example'; - -import CollapseButtonExample from '../../views/collapse_button/collapse_button_example'; - -import FormExample from '../../views/form/form_example'; - -import FormLayoutExample from '../../views/form_layout/form_layout_example'; - -import IconExample from '../../views/icon/icon_example'; - -import InfoPanelExample from '../../views/info_panel/info_panel_example'; - -import LinkExample from '../../views/link/link_example'; - -import LocalNavExample from '../../views/local_nav/local_nav_example'; - -import PagerExample from '../../views/pager/pager_example'; - -import PanelExample from '../../views/panel/panel_example'; - -import EmptyTablePromptExample from '../../views/empty_table_prompt/empty_table_prompt_example'; - -import StatusTextExample from '../../views/status_text/status_text_example'; - -import TableExample from '../../views/table/table_example'; - -import TabsExample from '../../views/tabs/tabs_example'; - -import ToolBarExample from '../../views/tool_bar/tool_bar_example'; - -import TypographyExample from '../../views/typography/typography_example'; - -import VerticalRhythmExample from '../../views/vertical_rhythm/vertical_rhythm_example'; - -import ViewSandbox from '../../views/view/view_sandbox'; - -// Component route names should match the component name exactly. -const components = [ - { - name: 'Bar', - component: BarExample, - hasReact: true, - }, - { - name: 'Button', - component: ButtonExample, - hasReact: true, - }, - { - name: 'CollapseButton', - component: CollapseButtonExample, - hasReact: true, - }, - { - name: 'EmptyTablePrompt', - component: EmptyTablePromptExample, - hasReact: true, - }, - { - name: 'Form', - component: FormExample, - }, - { - name: 'FormLayout', - component: FormLayoutExample, - hasReact: true, - }, - { - name: 'Icon', - component: IconExample, - }, - { - name: 'InfoPanel', - component: InfoPanelExample, - }, - { - name: 'Link', - component: LinkExample, - }, - { - name: 'LocalNav', - component: LocalNavExample, - hasReact: true, - }, - { - name: 'Pager', - component: PagerExample, - hasReact: true, - }, - { - name: 'Panel', - component: PanelExample, - }, - { - name: 'StatusText', - component: StatusTextExample, - }, - { - name: 'Table', - component: TableExample, - hasReact: true, - }, - { - name: 'Tabs', - component: TabsExample, - hasReact: true, - }, - { - name: 'ToolBar', - component: ToolBarExample, - hasReact: true, - }, - { - name: 'Typography', - component: TypographyExample, - }, - { - name: 'VerticalRhythm', - component: VerticalRhythmExample, - }, -]; - -const sandboxes = [ - { - name: 'View', - component: ViewSandbox, - }, -]; - -const allRoutes = components.concat(sandboxes); - -export default { - components: Slugify.each(components, 'name', 'path'), - sandboxes: Slugify.each(sandboxes, 'name', 'path'), - getAppRoutes: function getAppRoutes() { - return allRoutes; - }, - getPreviousRoute: function getPreviousRoute(routeName) { - const index = allRoutes.findIndex((item) => { - return item.name === routeName; - }); - - return index >= 0 ? allRoutes[index - 1] : undefined; - }, - getNextRoute: function getNextRoute(routeName) { - const index = allRoutes.findIndex((item) => { - return item.name === routeName; - }); - - return index < allRoutes.length - 1 ? allRoutes[index + 1] : undefined; - }, -}; diff --git a/packages/osd-ui-framework/doc_site/src/services/string/render_to_html.js b/packages/osd-ui-framework/doc_site/src/services/string/render_to_html.js deleted file mode 100644 index 052d2f3ec073..000000000000 --- a/packages/osd-ui-framework/doc_site/src/services/string/render_to_html.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -import { render, configure } from 'enzyme'; - -import EnzymeAdapter from 'enzyme-adapter-react-16'; - -import html from 'html'; - -configure({ adapter: new EnzymeAdapter() }); - -export function renderToHtml(componentReference, props = {}) { - // If there's a failure, just return an empty string. The actual component itself should - // trip an error boundary in the UI when it fails. - try { - // Create the React element, render it and get its HTML, then format it prettily. - const element = React.createElement(componentReference, props); - const htmlString = render(element).html(); - return html.prettyPrint(htmlString, { - indent_size: 2, - unformatted: [], // Expand all tags, including spans - }); - } catch (e) { - return ''; - } -} diff --git a/packages/osd-ui-framework/doc_site/src/services/string/slugify.js b/packages/osd-ui-framework/doc_site/src/services/string/slugify.js deleted file mode 100644 index cf23d8360f60..000000000000 --- a/packages/osd-ui-framework/doc_site/src/services/string/slugify.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * Lowercases input and replaces spaces with hyphens: - * e.g. 'GridView Example' -> 'gridview-example' - */ -function one(str) { - const parts = str - .toLowerCase() - .replace(/[-]+/g, ' ') - .replace(/[^\w^\s]+/g, '') - .replace(/ +/g, ' ') - .split(' '); - return parts.join('-'); -} - -function each(items, src, dest) { - return items.map((item) => { - const _item = item; - _item[dest] = one(_item[src]); - return _item; - }); -} - -export default { - one, - each, -}; diff --git a/packages/osd-ui-framework/doc_site/src/store/configure_store.js b/packages/osd-ui-framework/doc_site/src/store/configure_store.js deleted file mode 100644 index 048fe07405e7..000000000000 --- a/packages/osd-ui-framework/doc_site/src/store/configure_store.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { applyMiddleware, createStore, compose } from 'redux'; -import thunk from 'redux-thunk'; -import { browserHistory } from 'react-router'; // eslint-disable-line -import { routerMiddleware, routerReducer } from 'react-router-redux'; - -import codeViewerReducer from './reducers/code_viewer_reducer'; -import sandboxReducer from './reducers/sandbox_reducer'; -import sectionsReducer from './reducers/sections_reducer'; - -/** - * @param {Object} initialState An object defining the application's initial - * state. - */ -export default function configureStore(initialState) { - function rootReducer(state = {}, action) { - return { - routing: routerReducer(state.routing, action), - codeViewer: codeViewerReducer(state.codeViewer, action), - sandbox: sandboxReducer(state.sandbox, action), - sections: sectionsReducer(state.sections, action), - }; - } - - const finalStore = compose(applyMiddleware(thunk, routerMiddleware(browserHistory)))(createStore)( - rootReducer, - initialState - ); - - return finalStore; -} diff --git a/packages/osd-ui-framework/doc_site/src/store/index.js b/packages/osd-ui-framework/doc_site/src/store/index.js deleted file mode 100644 index fcd48f054c04..000000000000 --- a/packages/osd-ui-framework/doc_site/src/store/index.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -export function getIsCodeViewerOpen(state) { - return state.codeViewer.isOpen; -} - -export function getIsSandbox(state) { - return state.sandbox.isSandbox; -} - -export function getSections(state) { - return state.sections.sections; -} - -export function getSource(state) { - return state.codeViewer.source; -} - -export function getTitle(state) { - return state.codeViewer.title; -} diff --git a/packages/osd-ui-framework/doc_site/src/store/reducers/code_viewer_reducer.js b/packages/osd-ui-framework/doc_site/src/store/reducers/code_viewer_reducer.js deleted file mode 100644 index 88b561919688..000000000000 --- a/packages/osd-ui-framework/doc_site/src/store/reducers/code_viewer_reducer.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { LOCATION_CHANGE } from 'react-router-redux'; - -import ActionTypes from '../../actions/action_types'; - -const defaultState = { - isOpen: false, - codesBySlug: {}, - source: undefined, - title: undefined, -}; - -export default function codeViewerReducer(state = defaultState, action) { - switch (action.type) { - case ActionTypes.OPEN_CODE_VIEWER: { - const { source, title } = action; - - if (state.code === source) { - // If we are opening the existing code, then close the viewer. - return { - ...state, - isOpen: false, - source: undefined, - title: undefined, - }; - } - - return { - ...state, - isOpen: true, - source, - title, - }; - } - - case LOCATION_CHANGE: // Close Code Viewer when we navigate somewhere. - case ActionTypes.CLOSE_CODE_VIEWER: { - return { - ...state, - isOpen: false, - source: undefined, - }; - } - - default: - break; - } - - return state; -} diff --git a/packages/osd-ui-framework/doc_site/src/store/reducers/sandbox_reducer.js b/packages/osd-ui-framework/doc_site/src/store/reducers/sandbox_reducer.js deleted file mode 100644 index a2cd4a677cd4..000000000000 --- a/packages/osd-ui-framework/doc_site/src/store/reducers/sandbox_reducer.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import ActionTypes from '../../actions/action_types'; - -const defaultState = { - isSandbox: false, -}; - -export default function sandboxReducer(state = defaultState, action) { - switch (action.type) { - case ActionTypes.OPEN_SANDBOX: { - return { - ...state, - isSandbox: true, - }; - } - - case ActionTypes.CLOSE_SANDBOX: { - return { - ...state, - isSandbox: false, - }; - } - - default: - break; - } - - return state; -} diff --git a/packages/osd-ui-framework/doc_site/src/store/reducers/sections_reducer.js b/packages/osd-ui-framework/doc_site/src/store/reducers/sections_reducer.js deleted file mode 100644 index 7e508a3164b2..000000000000 --- a/packages/osd-ui-framework/doc_site/src/store/reducers/sections_reducer.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import ActionTypes from '../../actions/action_types'; - -const defaultState = { - sections: [], -}; - -export default function sectionsReducer(state = defaultState, action) { - switch (action.type) { - case ActionTypes.REGISTER_SECTION: { - const sections = state.sections.slice(); - sections.push({ - id: action.id, - name: action.name, - }); - - return { - ...state, - sections: sections, - }; - } - - case ActionTypes.UNREGISTER_SECTION: { - const sections = state.sections.slice(); - const index = sections.findIndex((section) => section.id === action.id); - sections.splice(index, 1); - - return { - ...state, - sections: sections, - }; - } - - default: - break; - } - - return state; -} diff --git a/packages/osd-ui-framework/doc_site/src/views/app_container.js b/packages/osd-ui-framework/doc_site/src/views/app_container.js deleted file mode 100644 index 7edcc07689a5..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/app_container.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { bindActionCreators } from 'redux'; -import { connect } from 'react-redux'; - -import { getIsCodeViewerOpen, getIsSandbox, getSections, getSource, getTitle } from '../store'; - -import { AppView } from './app_view'; - -import { openCodeViewer, closeCodeViewer, registerSection, unregisterSection } from '../actions'; - -function mapStateToProps(state, ownProps) { - return { - routes: ownProps.routes, - isCodeViewerOpen: getIsCodeViewerOpen(state), - isSandbox: getIsSandbox(state), - source: getSource(state), - title: getTitle(state), - sections: getSections(state), - }; -} - -function mapDispatchToProps(dispatch) { - const actions = { - openCodeViewer, - closeCodeViewer, - registerSection, - unregisterSection, - }; - - return bindActionCreators(actions, dispatch); -} - -export default connect(mapStateToProps, mapDispatchToProps)(AppView); diff --git a/packages/osd-ui-framework/doc_site/src/views/app_view.js b/packages/osd-ui-framework/doc_site/src/views/app_view.js deleted file mode 100644 index 3063436d783d..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/app_view.js +++ /dev/null @@ -1,152 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import PropTypes from 'prop-types'; -import React, { Component } from 'react'; - -import classNames from 'classnames'; - -import { Routes } from '../services'; - -import { GuideCodeViewer, GuideNav } from '../components'; - -// Inject version into header. -const pkg = require('../../../../../package.json'); - -export class AppView extends Component { - constructor(props) { - super(props); - - this.state = { - isNavOpen: false, - isChromeVisible: !props.isSandbox, - }; - - this.onClickNavItem = this.onClickNavItem.bind(this); - this.onToggleNav = this.onToggleNav.bind(this); - this.onCloseCodeViewer = this.onCloseCodeViewer.bind(this); - this.onHideChrome = this.onHideChrome.bind(this); - this.onShowChrome = this.onShowChrome.bind(this); - } - - onClickNavItem() { - this.setState({ - isNavOpen: false, - }); - } - - onCloseCodeViewer() { - this.props.closeCodeViewer(); - } - - onToggleNav() { - this.setState({ - isNavOpen: !this.state.isNavOpen, - }); - } - - onHideChrome() { - this.setState({ - isChromeVisible: false, - isNavOpen: false, - }); - - this.props.closeCodeViewer(); - } - - onShowChrome() { - this.setState({ - isChromeVisible: true, - }); - } - - UNSAFE_componentWillReceiveProps(nextProps) { - // Only force the chrome to be hidden if we're navigating from a non-sandbox to a sandbox. - if (!this.props.isSandbox && nextProps.isSandbox) { - this.setState({ - isChromeVisible: false, - }); - } - } - - render() { - const contentClasses = classNames('guideContent', { - 'is-code-viewer-open': this.props.isCodeViewerOpen, - 'is-chrome-hidden': !this.state.isChromeVisible, - }); - - return ( -
- - -
{this.props.children}
- - -
- ); - } -} - -AppView.propTypes = { - children: PropTypes.any, - routes: PropTypes.array.isRequired, - isSandbox: PropTypes.bool, - openCodeViewer: PropTypes.func, - closeCodeViewer: PropTypes.func, - isCodeViewerOpen: PropTypes.bool, - registerSection: PropTypes.func, - unregisterSection: PropTypes.func, - sections: PropTypes.array, - source: PropTypes.array, - title: PropTypes.string, -}; - -AppView.defaultProps = { - source: [], -}; diff --git a/packages/osd-ui-framework/doc_site/src/views/bar/bar.js b/packages/osd-ui-framework/doc_site/src/views/bar/bar.js deleted file mode 100644 index afe32069029c..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/bar/bar.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -import { KuiBar, KuiBarSection } from '../../../../components'; - -export default () => ( - - -
The Great American Novel
-
- - - - -
pages
-
-
-); diff --git a/packages/osd-ui-framework/doc_site/src/views/bar/bar_example.js b/packages/osd-ui-framework/doc_site/src/views/bar/bar_example.js deleted file mode 100644 index 6bffe8f0f631..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/bar/bar_example.js +++ /dev/null @@ -1,126 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* eslint-disable import/no-duplicates */ - -import React from 'react'; -import { renderToHtml } from '../../services'; - -import { GuideDemo, GuidePage, GuideSection, GuideSectionTypes, GuideText } from '../../components'; - -import Bar from './bar'; -import barSource from '!!raw-loader!./bar'; -const barHtml = renderToHtml(Bar); - -import BarOneSection from './bar_one_section'; -import barOneSectionSource from '!!raw-loader!./bar_one_section'; -const barOneSectionHtml = renderToHtml(BarOneSection); - -import BarThreeSections from './bar_three_sections'; -import barThreeSectionsSource from '!!raw-loader!./bar_three_sections'; -const barThreeSectionsHtml = renderToHtml(BarThreeSections); - -export default (props) => ( - - - - Use the Bar to organize controls in a horizontal layout. This is especially useful for - surfacing controls in the corners of a view. - - - - Note: Instead of using this component with a Table, try using the - ControlledTable, ToolBar, and ToolBarFooter components. - - - - - - - - - - A Bar with one section will align it to the right, by default. To align it to the left, just - add another section and leave it empty, or don’t use a Bar at all. - - - - - - - - - - Technically the Bar can contain three or more sections, but there’s no established - use-case for this. - - - - - - - -); diff --git a/packages/osd-ui-framework/doc_site/src/views/bar/bar_one_section.js b/packages/osd-ui-framework/doc_site/src/views/bar/bar_one_section.js deleted file mode 100644 index 7ae124a9f7ed..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/bar/bar_one_section.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -import { KuiBar, KuiBarSection, KuiButton } from '../../../../components'; - -export default () => ( - - -
- See previous 10 pages - See next 10 pages -
-
-
-); diff --git a/packages/osd-ui-framework/doc_site/src/views/bar/bar_three_sections.js b/packages/osd-ui-framework/doc_site/src/views/bar/bar_three_sections.js deleted file mode 100644 index 88d49da6a5af..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/bar/bar_three_sections.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -import { KuiBar, KuiBarSection, KuiButton, KuiButtonGroup } from '../../../../components'; - -export default () => ( - - -
The Great American Novel
-
- - - - Create new page - Clear all pages - - - - - - -
pages
- - - Undo - Redo - -
-
-); diff --git a/packages/osd-ui-framework/doc_site/src/views/button/button_basic.js b/packages/osd-ui-framework/doc_site/src/views/button/button_basic.js deleted file mode 100644 index c07326a37ff3..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/button/button_basic.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -import { KuiButton } from '../../../../components'; - -export default () => ( -
- window.alert('Button clicked')}> - Basic button - - -
-
- - window.alert('Button clicked')} disabled> - Basic button, disabled - -
-); diff --git a/packages/osd-ui-framework/doc_site/src/views/button/button_danger.js b/packages/osd-ui-framework/doc_site/src/views/button/button_danger.js deleted file mode 100644 index 1d7d646c1761..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/button/button_danger.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -import { KuiButton } from '../../../../components'; - -export default () => ( -
- Danger button - -
-
- - - Danger button, disabled - -
-); diff --git a/packages/osd-ui-framework/doc_site/src/views/button/button_elements.js b/packages/osd-ui-framework/doc_site/src/views/button/button_elements.js deleted file mode 100644 index 6515020e1282..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/button/button_elements.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -import { KuiButton, KuiLinkButton, KuiSubmitButton } from '../../../../components'; - -export default () => ( -
- Button element - -
-
- -
{ - e.preventDefault(); - window.alert('Submit'); - }} - > - Submit input element -
- -
- -
{ - e.preventDefault(); - window.alert('Submit'); - }} - > - - Submit input element, disabled - -
- -
- - - Anchor element - - -
-
- - - Anchor element, disabled - -
-); diff --git a/packages/osd-ui-framework/doc_site/src/views/button/button_example.js b/packages/osd-ui-framework/doc_site/src/views/button/button_example.js deleted file mode 100644 index 30e98b90a0c0..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/button/button_example.js +++ /dev/null @@ -1,343 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* eslint-disable import/no-duplicates */ - -import React from 'react'; - -import { renderToHtml } from '../../services'; - -import { GuideDemo, GuidePage, GuideSection, GuideSectionTypes, GuideText } from '../../components'; - -import Basic from './button_basic'; -import basicSource from '!!raw-loader!./button_basic'; -const basicHtml = renderToHtml(Basic); - -import Hollow from './button_hollow'; -import hollowSource from '!!raw-loader!./button_hollow'; -const hollowHtml = renderToHtml(Hollow); - -import Primary from './button_primary'; -import primarySource from '!!raw-loader!./button_primary'; -const primaryHtml = renderToHtml(Primary); - -import Secondary from './button_secondary'; -import secondarySource from '!!raw-loader!./button_secondary'; -const secondaryHtml = renderToHtml(Secondary); - -import Danger from './button_danger'; -import dangerSource from '!!raw-loader!./button_danger'; -const dangerHtml = renderToHtml(Danger); - -import Warning from './button_warning'; -import warningSource from '!!raw-loader!./button_danger'; -const warningHtml = renderToHtml(Warning); - -import Loading from './button_loading'; -import loadingSource from '!!raw-loader!./button_loading'; -const loadingHtml = renderToHtml(Loading, { isLoading: true }); - -import WithIcon from './button_with_icon'; -import withIconSource from '!!raw-loader!./button_with_icon'; -const withIconHtml = renderToHtml(WithIcon); - -import ButtonGroup from './button_group'; -import buttonGroupSource from '!!raw-loader!./button_group'; -const buttonGroupHtml = renderToHtml(ButtonGroup); - -import ButtonGroupUnited from './button_group_united'; -import buttonGroupUnitedSource from '!!raw-loader!./button_group_united'; -const buttonGroupUnitedHtml = renderToHtml(ButtonGroupUnited); - -import Elements from './button_elements'; -import elementsSource from '!!raw-loader!./button_elements'; -const elementsHtml = renderToHtml(Elements); - -import sizesHtml from './button_sizes.html'; - -export default (props) => ( - - - - Use the basic button for navigation elements or controls that are not the primary focus of - the page (ex: pagination, toggles...etc). - - - - - - - - - - Use the hollow Button when presenting a neutral action, e.g. a “Cancel” button. - - - - - - - - - - Use the primary Button to represent the most common action. Generally, there won’t be - a need to present more than one of these at a time. - - - - - - - - - - Secondary buttons are usually used for actions (“do this”) that are optional - actions on a page. - - - - - - - - - Danger Buttons represent irreversible, potentially regrettable actions. - - - - - - - - Warning Buttons represent potentially notable actions. - - - - - - - - - - - - - - -

- You can toss an icon into a Button, with or without text. You can also use a predefined - icon or specify custom icon classes. If you have a button without textual content, make - sure you set the aria-label attribute with a textual representation for - screen readers (see last example below). -

-
- - - - -
- - - - - - - - - - Use the united version of the ButtonGroup to emphasize the close relationship within a set - of Buttons, and differentiate them from Buttons outside of the set. - - - - They support containing a single Button, so that Buttons can be dynamically added and - removed. - - - - - - - - - - You can create a Button using a button element, link, or input[type=“submit”]. - - - - - - - - - - -
-); diff --git a/packages/osd-ui-framework/doc_site/src/views/button/button_group.js b/packages/osd-ui-framework/doc_site/src/views/button/button_group.js deleted file mode 100644 index 6ee6a78f6723..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/button/button_group.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -import { KuiButton, KuiButtonGroup } from '../../../../components'; - -export default () => ( -
- - Cancel - - Duplicate - - Save - - -
- - - Button group with one button - -
-); diff --git a/packages/osd-ui-framework/doc_site/src/views/button/button_group_united.js b/packages/osd-ui-framework/doc_site/src/views/button/button_group_united.js deleted file mode 100644 index b65e4e3fb4ba..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/button/button_group_united.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -import { KuiButton, KuiButtonGroup, KuiButtonIcon } from '../../../../components'; - -export default () => ( -
- - Option A - - Option B - - Option C - - -
- - - } - /> - - } /> - -
-); diff --git a/packages/osd-ui-framework/doc_site/src/views/button/button_hollow.js b/packages/osd-ui-framework/doc_site/src/views/button/button_hollow.js deleted file mode 100644 index 36c18b44cdee..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/button/button_hollow.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -import { KuiButton } from '../../../../components'; - -export default () => ( -
- Hollow button - -
-
- - - Hollow button, disabled - -
-); diff --git a/packages/osd-ui-framework/doc_site/src/views/button/button_loading.js b/packages/osd-ui-framework/doc_site/src/views/button/button_loading.js deleted file mode 100644 index 15baf6be181b..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/button/button_loading.js +++ /dev/null @@ -1,85 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React, { Component } from 'react'; - -import { KuiButtonIcon, KuiButton } from '../../../../components'; - -export default class LoadingButton extends Component { - constructor(props) { - super(); - - this.state = { - isLoading: props.isLoading || false, - }; - - this.onClick = this.onClick.bind(this); - } - - onClick() { - this.setState({ - isLoading: true, - }); - - setTimeout(() => { - this.setState({ - isLoading: false, - }); - }, 3000); - } - - render() { - return ( -
- - {this.state.isLoading ? 'Loading...' : 'Load more'} - - -
-
- - } - isLoading={this.state.isLoading} - disabled={this.state.isLoading} - > - {this.state.isLoading ? 'Creating...' : 'Create'} - -
- ); - } -} diff --git a/packages/osd-ui-framework/doc_site/src/views/button/button_primary.js b/packages/osd-ui-framework/doc_site/src/views/button/button_primary.js deleted file mode 100644 index 87dac0e04518..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/button/button_primary.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -import { KuiButton } from '../../../../components'; - -export default () => ( -
- Primary button - -
-
- - - Primary button, disabled - -
-); diff --git a/packages/osd-ui-framework/doc_site/src/views/button/button_secondary.js b/packages/osd-ui-framework/doc_site/src/views/button/button_secondary.js deleted file mode 100644 index 2f651508a882..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/button/button_secondary.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -import { KuiButton } from '../../../../components'; - -export default () => ( -
- Secondary button - -
-
- - - Secondary button, disabled - -
-); diff --git a/packages/osd-ui-framework/doc_site/src/views/button/button_sizes.html b/packages/osd-ui-framework/doc_site/src/views/button/button_sizes.html deleted file mode 100644 index 36a27c78a48c..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/button/button_sizes.html +++ /dev/null @@ -1,55 +0,0 @@ -
- Small button -
- -
- -
- Small button with icon -
- -
- -
- Full-width button -
- -
- -
- Full-width button with icon -
- -
- -
-
- Button A -
- -
- Button B -
- -
- Button C -
-
- -
- -
-
- Button A -
- -
- Button B -
- -
- Button C -
-
diff --git a/packages/osd-ui-framework/doc_site/src/views/button/button_warning.js b/packages/osd-ui-framework/doc_site/src/views/button/button_warning.js deleted file mode 100644 index cebf77ca32bf..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/button/button_warning.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -import { KuiButton } from '../../../../components'; - -export default () => ( -
- Warning button - -
-
- - - Warning button, disabled - -
-); diff --git a/packages/osd-ui-framework/doc_site/src/views/button/button_with_icon.js b/packages/osd-ui-framework/doc_site/src/views/button/button_with_icon.js deleted file mode 100644 index 1d2a0d160b8c..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/button/button_with_icon.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -import { KuiButton, KuiButtonIcon } from '../../../../components'; - -export default () => ( -
- }> - Create - - -
-
- - }> - Delete - - -
-
- - }> - Previous - - -
-
- - } iconPosition="right"> - Next - - -
-
- - }> - Loading - - -
-
- - } - /> -
-); diff --git a/packages/osd-ui-framework/doc_site/src/views/collapse_button/collapse_button.js b/packages/osd-ui-framework/doc_site/src/views/collapse_button/collapse_button.js deleted file mode 100644 index 28274f850fe9..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/collapse_button/collapse_button.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -import { KuiCollapseButton } from '../../../../components'; - -export default () => ( -
- - - - -
-); diff --git a/packages/osd-ui-framework/doc_site/src/views/collapse_button/collapse_button_aria.js b/packages/osd-ui-framework/doc_site/src/views/collapse_button/collapse_button_aria.js deleted file mode 100644 index 8de6d0634f0a..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/collapse_button/collapse_button_aria.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React, { Component } from 'react'; - -import { KuiCollapseButton } from '../../../../components'; - -import { htmlIdGenerator } from '../../../../src/services'; - -export default class extends Component { - constructor(props) { - super(props); - this.state = { - isExpanded: false, - }; - } - - onToggleContent = (ev) => { - ev.preventDefault(); - this.setState((state) => ({ - isExpanded: !state.isExpanded, - })); - }; - - render() { - const { isExpanded } = this.state; - const idGen = htmlIdGenerator(); - return ( -
- -
- Here is some collapsible content. -
-
- ); - } -} diff --git a/packages/osd-ui-framework/doc_site/src/views/collapse_button/collapse_button_example.js b/packages/osd-ui-framework/doc_site/src/views/collapse_button/collapse_button_example.js deleted file mode 100644 index 2db50fc26ac9..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/collapse_button/collapse_button_example.js +++ /dev/null @@ -1,119 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* eslint-disable import/no-duplicates */ - -import React from 'react'; -import { renderToHtml } from '../../services'; - -import { GuideDemo, GuidePage, GuideSection, GuideSectionTypes, GuideText } from '../../components'; - -import CollapseButton from './collapse_button'; -import collapseButtonSource from '!!raw-loader!./collapse_button'; -const collapseButtonHtml = renderToHtml(CollapseButton); - -import CollapseButtonAria from './collapse_button_aria'; -import collapseButtonAriaSource from '!!raw-loader!./collapse_button_aria'; -const collapseButtonAriaHtml = renderToHtml(CollapseButtonAria); - -export default (props) => ( - - - - Use this button to collapse and expand panels, drawers, sidebars, legends, and other - containers. - - - - - - - - - - To make an expandable element properly accessible you should add the following - ARIA-attributes to it: -
-
- aria-expanded -
-
- should be true or false depending on the state of the - collapsable content. -
-
- aria-controls -
-
- should reference the id of the actual collapsable content element. -
-
- aria-label -
-
- should contain a label like "Toggle panel" or preferably more specific what it - toggles (e.g. "Toggle filter actions"). You don’t need to switch the - label when the state changes, since a screen reader will use aria-expanded{' '} - to read out the current state. -
-
- The following example demonstrate the usage of these attributes. -
- - - - -
-
-); diff --git a/packages/osd-ui-framework/doc_site/src/views/empty_table_prompt/empty_table_prompt.js b/packages/osd-ui-framework/doc_site/src/views/empty_table_prompt/empty_table_prompt.js deleted file mode 100644 index 6d702042feed..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/empty_table_prompt/empty_table_prompt.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -import { KuiEmptyTablePrompt, KuiLinkButton, KuiButtonIcon } from '../../../../components'; - -export function EmptyTablePrompt() { - return ( - } - aria-label="Add a new item" - data-test-subj="addNewPromptButton" - buttonType="primary" - href="#" - > - Add a new item - - } - message="Uh oh, You have no items!" - /> - ); -} diff --git a/packages/osd-ui-framework/doc_site/src/views/empty_table_prompt/empty_table_prompt_example.js b/packages/osd-ui-framework/doc_site/src/views/empty_table_prompt/empty_table_prompt_example.js deleted file mode 100644 index 7ff48dd4729e..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/empty_table_prompt/empty_table_prompt_example.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* eslint-disable import/no-duplicates */ - -import React from 'react'; -import { renderToHtml } from '../../services'; - -import { GuideDemo, GuidePage, GuideSection, GuideSectionTypes, GuideText } from '../../components'; - -import { EmptyTablePrompt } from './empty_table_prompt'; -import emptyTablePromptSource from '!!raw-loader!./empty_table_prompt'; // eslint-disable-line import/default -const emptyTablePromptHtml = renderToHtml(EmptyTablePrompt); - -import { ControlledTableWithEmptyPrompt } from './table_with_empty_prompt'; -import tableWithEmptyPromptSource from '!!raw-loader!./table_with_empty_prompt'; // eslint-disable-line import/default -const tableWithEmptyPromptHtml = renderToHtml(ControlledTableWithEmptyPrompt); - -export default (props) => ( - - - - Use this prompt when a table has no results. It helps create space and provides a place to - prompt the user to follow some next actions, such as creating an item. - - - - - - - - - Wrap in an EmptyTablePromptPanel when using with a controlled table. - - - - - - -); diff --git a/packages/osd-ui-framework/doc_site/src/views/empty_table_prompt/table_with_empty_prompt.js b/packages/osd-ui-framework/doc_site/src/views/empty_table_prompt/table_with_empty_prompt.js deleted file mode 100644 index 976cde39213a..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/empty_table_prompt/table_with_empty_prompt.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React from 'react'; - -import { - KuiEmptyTablePrompt, - KuiEmptyTablePromptPanel, - KuiToolBar, - KuiToolBarSearchBox, - KuiPager, - KuiLinkButton, - KuiButtonIcon, - KuiButtonGroup, -} from '../../../../components'; - -export function ControlledTableWithEmptyPrompt() { - return ( -
- - {}} /> -
- {}} - onPreviousPage={() => {}} - /> -
-
- - - } - aria-label="Add a new dashboard" - data-test-subj="addNewDashPromptButton" - buttonType="primary" - href="#" - > - Add a new dashboard - - - } - aria-label="Add a new visualization" - data-test-subj="addNewVizPromptButton" - buttonType="primary" - href="#" - > - Add a new visualization - - - } - message="You have no items. Would you like to add one?" - /> - -
- ); -} diff --git a/packages/osd-ui-framework/doc_site/src/views/form/assisted_input.html b/packages/osd-ui-framework/doc_site/src/views/form/assisted_input.html deleted file mode 100644 index d950f0e50119..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/form/assisted_input.html +++ /dev/null @@ -1,14 +0,0 @@ -
- - -
-

- API docs -

-
-
diff --git a/packages/osd-ui-framework/doc_site/src/views/form/check_box.js b/packages/osd-ui-framework/doc_site/src/views/form/check_box.js deleted file mode 100644 index f00409aaeed1..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/form/check_box.js +++ /dev/null @@ -1,75 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import React, { Component } from 'react'; -import { KuiCheckBox, KuiCheckBoxLabel } from '../../../../components'; - -class KuiCheckBoxExample extends Component { - state = { - value1: false, - value2: true, - value3: true, - value4: false, - }; - - handleChange = (event, key) => { - this.setState({ [key]: event.target.checked }); - }; - - render() { - return ( -
- this.handleChange(event, 'value1')} - /> -
- this.handleChange(event, 'value2')} - /> -
- this.handleChange(event, 'value3')} - isDisabled - /> -
- this.handleChange(event, 'value4')} - /> -
- ); - } -} - -export default KuiCheckBoxExample; diff --git a/packages/osd-ui-framework/doc_site/src/views/form/form_example.js b/packages/osd-ui-framework/doc_site/src/views/form/form_example.js deleted file mode 100644 index 20bfc77e8a36..000000000000 --- a/packages/osd-ui-framework/doc_site/src/views/form/form_example.js +++ /dev/null @@ -1,244 +0,0 @@ -/* - * SPDX-License-Identifier: Apache-2.0 - * - * The OpenSearch Contributors require contributions made to - * this file be licensed under the Apache-2.0 license or a - * compatible open source license. - * - * Any modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/* eslint-disable import/no-duplicates */ - -import React from 'react'; -import { renderToHtml } from '../../services'; - -import { - GuideCode, - GuideDemo, - GuidePage, - GuideSection, - GuideSectionTypes, - GuideText, -} from '../../components'; - -import assistedInputHtml from './assisted_input.html'; -import searchInputHtml from './search_input.html'; -import staticInputHtml from './static_input.html'; - -import Label from './label'; -import labelSource from '!!raw-loader!./label'; -const labelHtml = renderToHtml(Label); - -import TextInput from './text_input'; -import textInputSource from '!!raw-loader!./text_input'; -const textInputHtml = renderToHtml(TextInput, { id: '1' }); - -import TextArea from './text_area'; -import textAreaSource from '!!raw-loader!./text_area'; -const textAreaHtml = renderToHtml(TextArea); - -import TextAreaNonResizable from './text_area_non_resizable'; -import textAreaNonResizableSource from '!!raw-loader!./text_area_non_resizable'; -const textAreaNonResizableHtml = renderToHtml(TextAreaNonResizable); - -import Select from './select'; -import selectSource from '!!raw-loader!./select'; -const selectHtml = renderToHtml(Select); - -import CheckBox from './check_box'; -import checkBoxSource from '!!raw-loader!./check_box'; -const checkBoxHtml = renderToHtml(CheckBox); - -export default (props) => ( - - - - Never forget to label every input element. You can either use a label{' '} - element with a for attribute referencing the{' '} - id of the input field, wrap the input field - within the label element or use aria-label or{' '} - aria-labelledby. - - - - For the sake of simplicity we haven’t labeled the input elements on this page - correctly. - - - - - - - - - - - - - - - Note: You have to specify right-side padding using a custom class or inline - style to keep the input text from overlapping with the assistance content. Use{' '} - em units for this padding so that it scales appropriately if the user - changes their root font-size. - - - - - - - - - - - - Use StaticInput to display dynamic content in a form which the user isn’t allowed to - edit. - - - - - - - -