@jetbrains/ring-ui-built 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +202 -0
- package/README.md +103 -0
- package/components/_helpers/_rollupPluginBabelHelpers.js +648 -0
- package/components/_helpers/anchor.js +31 -0
- package/components/_helpers/badge.js +3 -0
- package/components/_helpers/button__classes.js +34 -0
- package/components/_helpers/caption.js +31 -0
- package/components/_helpers/card.js +132 -0
- package/components/_helpers/date-picker.js +3 -0
- package/components/_helpers/dialog__body-scroll-preventer.js +54 -0
- package/components/_helpers/grid.js +3 -0
- package/components/_helpers/header.js +3 -0
- package/components/_helpers/heading.js +3 -0
- package/components/_helpers/icon__svg.js +75 -0
- package/components/_helpers/input.js +235 -0
- package/components/_helpers/island.js +3 -0
- package/components/_helpers/link.js +3 -0
- package/components/_helpers/list.js +3 -0
- package/components/_helpers/query-assist__suggestions.js +102 -0
- package/components/_helpers/select__filter.js +94 -0
- package/components/_helpers/services-link.js +48 -0
- package/components/_helpers/sidebar.js +123 -0
- package/components/_helpers/tab-link.js +34 -0
- package/components/_helpers/table.js +3 -0
- package/components/_helpers/theme.js +95 -0
- package/components/_helpers/title.js +103 -0
- package/components/alert/alert.d.ts +113 -0
- package/components/alert/alert.js +294 -0
- package/components/alert/container.d.ts +15 -0
- package/components/alert/container.js +52 -0
- package/components/alert-service/alert-service.d.ts +36 -0
- package/components/alert-service/alert-service.js +220 -0
- package/components/analytics/analytics.d.ts +18 -0
- package/components/analytics/analytics.js +31 -0
- package/components/analytics/analytics__custom-plugin.d.ts +28 -0
- package/components/analytics/analytics__custom-plugin.js +89 -0
- package/components/auth/auth.d.ts +3 -0
- package/components/auth/auth.js +133 -0
- package/components/auth/auth__core.d.ts +236 -0
- package/components/auth/auth__core.js +1653 -0
- package/components/auth/background-flow.d.ts +31 -0
- package/components/auth/background-flow.js +147 -0
- package/components/auth/down-notification.d.ts +15 -0
- package/components/auth/down-notification.js +157 -0
- package/components/auth/iframe-flow.d.ts +20 -0
- package/components/auth/iframe-flow.js +196 -0
- package/components/auth/request-builder.d.ts +48 -0
- package/components/auth/request-builder.js +104 -0
- package/components/auth/response-parser.d.ts +70 -0
- package/components/auth/response-parser.js +138 -0
- package/components/auth/storage.d.ts +112 -0
- package/components/auth/storage.js +429 -0
- package/components/auth/token-validator.d.ts +93 -0
- package/components/auth/token-validator.js +269 -0
- package/components/auth/window-flow.d.ts +26 -0
- package/components/auth/window-flow.js +154 -0
- package/components/auth-dialog/auth-dialog.d.ts +60 -0
- package/components/auth-dialog/auth-dialog.js +221 -0
- package/components/auth-dialog-service/auth-dialog-service.d.ts +6 -0
- package/components/auth-dialog-service/auth-dialog-service.js +92 -0
- package/components/avatar/avatar-example-datauri.d.ts +1 -0
- package/components/avatar/avatar-example-datauri.js +4 -0
- package/components/avatar/avatar.d.ts +52 -0
- package/components/avatar/avatar.js +183 -0
- package/components/avatar/fallback-avatar.d.ts +17 -0
- package/components/avatar/fallback-avatar.js +151 -0
- package/components/badge/badge.d.ts +24 -0
- package/components/badge/badge.js +59 -0
- package/components/button/button.d.ts +67 -0
- package/components/button/button.js +131 -0
- package/components/button/button__classes.d.ts +2 -0
- package/components/button/button__classes.js +2 -0
- package/components/button-group/button-group.d.ts +18 -0
- package/components/button-group/button-group.js +48 -0
- package/components/button-group/caption.d.ts +8 -0
- package/components/button-group/caption.js +5 -0
- package/components/button-set/button-set.d.ts +16 -0
- package/components/button-set/button-set.js +47 -0
- package/components/button-toolbar/button-toolbar.d.ts +16 -0
- package/components/button-toolbar/button-toolbar.js +46 -0
- package/components/caret/caret.d.ts +66 -0
- package/components/caret/caret.js +259 -0
- package/components/checkbox/checkbox.d.ts +45 -0
- package/components/checkbox/checkbox.js +130 -0
- package/components/clipboard/clipboard-fallback.d.ts +2 -0
- package/components/clipboard/clipboard-fallback.js +42 -0
- package/components/clipboard/clipboard.d.ts +5 -0
- package/components/clipboard/clipboard.js +185 -0
- package/components/code/code.d.ts +44 -0
- package/components/code/code.js +191 -0
- package/components/confirm/confirm.d.ts +48 -0
- package/components/confirm/confirm.js +153 -0
- package/components/confirm-service/confirm-service.d.ts +21 -0
- package/components/confirm-service/confirm-service.js +141 -0
- package/components/content-layout/content-layout.d.ts +26 -0
- package/components/content-layout/content-layout.js +79 -0
- package/components/content-layout/sidebar.d.ts +31 -0
- package/components/content-layout/sidebar.js +7 -0
- package/components/contenteditable/contenteditable.d.ts +47 -0
- package/components/contenteditable/contenteditable.js +84 -0
- package/components/control-label/control-label.d.ts +11 -0
- package/components/control-label/control-label.js +36 -0
- package/components/data-list/data-list.d.ts +85 -0
- package/components/data-list/data-list.js +251 -0
- package/components/data-list/data-list.mock.d.ts +16 -0
- package/components/data-list/data-list.mock.js +192 -0
- package/components/data-list/item.d.ts +50 -0
- package/components/data-list/item.js +235 -0
- package/components/data-list/selection.d.ts +16 -0
- package/components/data-list/selection.js +148 -0
- package/components/data-list/title.d.ts +26 -0
- package/components/data-list/title.js +28 -0
- package/components/date-picker/consts.d.ts +98 -0
- package/components/date-picker/consts.js +46 -0
- package/components/date-picker/date-input.d.ts +47 -0
- package/components/date-picker/date-input.js +177 -0
- package/components/date-picker/date-picker.d.ts +77 -0
- package/components/date-picker/date-picker.js +404 -0
- package/components/date-picker/date-popup.d.ts +55 -0
- package/components/date-picker/date-popup.js +488 -0
- package/components/date-picker/day.d.ts +30 -0
- package/components/date-picker/day.js +133 -0
- package/components/date-picker/formats.d.ts +2 -0
- package/components/date-picker/formats.js +3 -0
- package/components/date-picker/month-names.d.ts +13 -0
- package/components/date-picker/month-names.js +110 -0
- package/components/date-picker/month-slider.d.ts +29 -0
- package/components/date-picker/month-slider.js +93 -0
- package/components/date-picker/month.d.ts +14 -0
- package/components/date-picker/month.js +58 -0
- package/components/date-picker/months.d.ts +11 -0
- package/components/date-picker/months.js +133 -0
- package/components/date-picker/weekdays.d.ts +13 -0
- package/components/date-picker/weekdays.js +39 -0
- package/components/date-picker/years.d.ts +25 -0
- package/components/date-picker/years.js +134 -0
- package/components/dialog/dialog.d.ts +64 -0
- package/components/dialog/dialog.js +240 -0
- package/components/dialog/dialog__body-scroll-preventer.d.ts +9 -0
- package/components/dialog/dialog__body-scroll-preventer.js +6 -0
- package/components/dropdown/anchor.d.ts +11 -0
- package/components/dropdown/anchor.js +24 -0
- package/components/dropdown/dropdown.d.ts +87 -0
- package/components/dropdown/dropdown.js +247 -0
- package/components/dropdown-menu/dropdown-menu.d.ts +36 -0
- package/components/dropdown-menu/dropdown-menu.js +199 -0
- package/components/editable-heading/editable-heading.d.ts +32 -0
- package/components/editable-heading/editable-heading.js +276 -0
- package/components/error-bubble/error-bubble.d.ts +18 -0
- package/components/error-bubble/error-bubble.js +88 -0
- package/components/error-message/error-message.d.ts +27 -0
- package/components/error-message/error-message.js +78 -0
- package/components/footer/footer.d.ts +28 -0
- package/components/footer/footer.js +118 -0
- package/components/global/compose.d.ts +7 -0
- package/components/global/compose.js +17 -0
- package/components/global/composeRefs.d.ts +3 -0
- package/components/global/composeRefs.js +19 -0
- package/components/global/controls-height.d.ts +9 -0
- package/components/global/controls-height.js +19 -0
- package/components/global/create-stateful-context.d.ts +27 -0
- package/components/global/create-stateful-context.js +49 -0
- package/components/global/data-tests.d.ts +3 -0
- package/components/global/data-tests.js +30 -0
- package/components/global/dom.d.ts +37 -0
- package/components/global/dom.js +151 -0
- package/components/global/focus-sensor-hoc.d.ts +19 -0
- package/components/global/focus-sensor-hoc.js +165 -0
- package/components/global/fuzzy-highlight.d.ts +11 -0
- package/components/global/fuzzy-highlight.js +90 -0
- package/components/global/get-event-key.d.ts +2 -0
- package/components/global/get-event-key.js +101 -0
- package/components/global/get-uid.d.ts +1 -0
- package/components/global/get-uid.js +22 -0
- package/components/global/inject-styles.d.ts +3 -0
- package/components/global/inject-styles.js +22 -0
- package/components/global/linear-function.d.ts +6 -0
- package/components/global/linear-function.js +15 -0
- package/components/global/listeners.d.ts +8 -0
- package/components/global/listeners.js +58 -0
- package/components/global/memoize.d.ts +1 -0
- package/components/global/memoize.js +23 -0
- package/components/global/normalize-indent.d.ts +1 -0
- package/components/global/normalize-indent.js +60 -0
- package/components/global/promise-with-timeout.d.ts +5 -0
- package/components/global/promise-with-timeout.js +19 -0
- package/components/global/prop-types.d.ts +4 -0
- package/components/global/prop-types.js +9 -0
- package/components/global/react-dom-renderer.d.ts +16 -0
- package/components/global/react-dom-renderer.js +54 -0
- package/components/global/react-render-adapter.d.ts +1 -0
- package/components/global/react-render-adapter.js +6 -0
- package/components/global/rerender-hoc.d.ts +10 -0
- package/components/global/rerender-hoc.js +46 -0
- package/components/global/schedule-raf.d.ts +1 -0
- package/components/global/schedule-raf.js +28 -0
- package/components/global/sniffer.d.ts +3 -0
- package/components/global/sniffer.js +6 -0
- package/components/global/theme.d.ts +21 -0
- package/components/global/theme.js +42 -0
- package/components/global/trivial-template-tag.d.ts +1 -0
- package/components/global/trivial-template-tag.js +21 -0
- package/components/global/typescript-utils.d.ts +2 -0
- package/components/global/typescript-utils.js +8 -0
- package/components/global/url.d.ts +57 -0
- package/components/global/url.js +142 -0
- package/components/global/use-event-callback.d.ts +1 -0
- package/components/global/use-event-callback.js +17 -0
- package/components/global/variables.d.ts +89 -0
- package/components/global/variables.js +1 -0
- package/components/grid/col.d.ts +31 -0
- package/components/grid/col.js +80 -0
- package/components/grid/grid.d.ts +14 -0
- package/components/grid/grid.js +46 -0
- package/components/grid/row.d.ts +40 -0
- package/components/grid/row.js +75 -0
- package/components/group/group.d.ts +12 -0
- package/components/group/group.js +39 -0
- package/components/header/header.d.ts +34 -0
- package/components/header/header.js +189 -0
- package/components/header/logo.d.ts +14 -0
- package/components/header/logo.js +51 -0
- package/components/header/profile.d.ts +75 -0
- package/components/header/profile.js +258 -0
- package/components/header/services-link.d.ts +25 -0
- package/components/header/services-link.js +13 -0
- package/components/header/services.d.ts +33 -0
- package/components/header/services.js +174 -0
- package/components/header/smart-profile.d.ts +36 -0
- package/components/header/smart-profile.js +303 -0
- package/components/header/smart-services.d.ts +26 -0
- package/components/header/smart-services.js +192 -0
- package/components/header/tray-icon.d.ts +32 -0
- package/components/header/tray-icon.js +57 -0
- package/components/header/tray.d.ts +9 -0
- package/components/header/tray.js +41 -0
- package/components/heading/heading.d.ts +25 -0
- package/components/heading/heading.js +69 -0
- package/components/http/http.d.ts +61 -0
- package/components/http/http.js +386 -0
- package/components/http/http.mock.d.ts +20 -0
- package/components/http/http.mock.js +113 -0
- package/components/hub-source/hub-source.d.ts +44 -0
- package/components/hub-source/hub-source.js +217 -0
- package/components/hub-source/hub-source__user.d.ts +4 -0
- package/components/hub-source/hub-source__user.js +60 -0
- package/components/hub-source/hub-source__users-groups.d.ts +24 -0
- package/components/hub-source/hub-source__users-groups.js +86 -0
- package/components/i18n/i18n-context.d.ts +13 -0
- package/components/i18n/i18n-context.js +27 -0
- package/components/i18n/i18n.d.ts +59 -0
- package/components/i18n/i18n.js +139 -0
- package/components/icon/icon.d.ts +43 -0
- package/components/icon/icon.js +109 -0
- package/components/icon/icon__constants.d.ts +30 -0
- package/components/icon/icon__constants.js +34 -0
- package/components/icon/icon__svg.d.ts +15 -0
- package/components/icon/icon__svg.js +14 -0
- package/components/icon/index.d.ts +2 -0
- package/components/icon/index.js +17 -0
- package/components/input/input.d.ts +77 -0
- package/components/input/input.js +35 -0
- package/components/island/adaptive-island-hoc.d.ts +61 -0
- package/components/island/adaptive-island-hoc.js +53 -0
- package/components/island/content.d.ts +43 -0
- package/components/island/content.js +151 -0
- package/components/island/header.d.ts +8 -0
- package/components/island/header.js +100 -0
- package/components/island/island.d.ts +78 -0
- package/components/island/island.js +60 -0
- package/components/island-legacy/content-legacy.d.ts +10 -0
- package/components/island-legacy/content-legacy.js +34 -0
- package/components/island-legacy/header-legacy.d.ts +10 -0
- package/components/island-legacy/header-legacy.js +36 -0
- package/components/island-legacy/island-legacy.d.ts +12 -0
- package/components/island-legacy/island-legacy.js +36 -0
- package/components/link/clickableLink.d.ts +20 -0
- package/components/link/clickableLink.js +69 -0
- package/components/link/link.d.ts +138 -0
- package/components/link/link.js +86 -0
- package/components/list/consts.d.ts +77 -0
- package/components/list/consts.js +27 -0
- package/components/list/list.d.ts +205 -0
- package/components/list/list.js +802 -0
- package/components/list/list__custom.d.ts +6 -0
- package/components/list/list__custom.js +92 -0
- package/components/list/list__hint.d.ts +15 -0
- package/components/list/list__hint.js +33 -0
- package/components/list/list__item.d.ts +8 -0
- package/components/list/list__item.js +237 -0
- package/components/list/list__link.d.ts +9 -0
- package/components/list/list__link.js +76 -0
- package/components/list/list__separator.d.ts +5 -0
- package/components/list/list__separator.js +39 -0
- package/components/list/list__title.d.ts +5 -0
- package/components/list/list__title.js +48 -0
- package/components/list/list__users-groups-source.d.ts +27 -0
- package/components/list/list__users-groups-source.js +195 -0
- package/components/loader/loader.d.ts +28 -0
- package/components/loader/loader.js +93 -0
- package/components/loader/loader__core.d.ts +75 -0
- package/components/loader/loader__core.js +327 -0
- package/components/loader-inline/loader-inline.d.ts +18 -0
- package/components/loader-inline/loader-inline.js +50 -0
- package/components/loader-screen/loader-screen.d.ts +17 -0
- package/components/loader-screen/loader-screen.js +64 -0
- package/components/login-dialog/login-dialog.d.ts +47 -0
- package/components/login-dialog/login-dialog.js +216 -0
- package/components/login-dialog/service.d.ts +2 -0
- package/components/login-dialog/service.js +98 -0
- package/components/markdown/markdown.d.ts +12 -0
- package/components/markdown/markdown.js +43 -0
- package/components/message/message.d.ts +55 -0
- package/components/message/message.js +267 -0
- package/components/old-browsers-message/old-browsers-message.d.ts +2 -0
- package/components/old-browsers-message/old-browsers-message.js +92 -0
- package/components/old-browsers-message/old-browsers-message__stop.d.ts +1 -0
- package/components/old-browsers-message/old-browsers-message__stop.js +11 -0
- package/components/old-browsers-message/white-list.d.ts +2 -0
- package/components/old-browsers-message/white-list.js +37 -0
- package/components/pager/pager.d.ts +78 -0
- package/components/pager/pager.js +390 -0
- package/components/panel/panel.d.ts +12 -0
- package/components/panel/panel.js +39 -0
- package/components/permissions/permissions.d.ts +111 -0
- package/components/permissions/permissions.js +221 -0
- package/components/permissions/permissions__cache.d.ts +93 -0
- package/components/permissions/permissions__cache.js +257 -0
- package/components/popup/popup.consts.d.ts +37 -0
- package/components/popup/popup.consts.js +44 -0
- package/components/popup/popup.d.ts +147 -0
- package/components/popup/popup.js +424 -0
- package/components/popup/popup.target.d.ts +7 -0
- package/components/popup/popup.target.js +24 -0
- package/components/popup/position.d.ts +30 -0
- package/components/popup/position.js +271 -0
- package/components/popup-menu/popup-menu.d.ts +80 -0
- package/components/popup-menu/popup-menu.js +141 -0
- package/components/progress-bar/progress-bar.d.ts +64 -0
- package/components/progress-bar/progress-bar.js +120 -0
- package/components/query-assist/query-assist.d.ts +306 -0
- package/components/query-assist/query-assist.js +1098 -0
- package/components/query-assist/query-assist__suggestions.d.ts +29 -0
- package/components/query-assist/query-assist__suggestions.js +75 -0
- package/components/radio/radio.d.ts +18 -0
- package/components/radio/radio.js +48 -0
- package/components/radio/radio__item.d.ts +28 -0
- package/components/radio/radio__item.js +88 -0
- package/components/select/select.d.ts +276 -0
- package/components/select/select.js +1310 -0
- package/components/select/select__filter.d.ts +19 -0
- package/components/select/select__filter.js +85 -0
- package/components/select/select__popup.d.ts +166 -0
- package/components/select/select__popup.js +631 -0
- package/components/shortcuts/core.d.ts +74 -0
- package/components/shortcuts/core.js +249 -0
- package/components/shortcuts/shortcut-title.d.ts +1 -0
- package/components/shortcuts/shortcut-title.js +56 -0
- package/components/shortcuts/shortcuts-hoc.d.ts +65 -0
- package/components/shortcuts/shortcuts-hoc.js +61 -0
- package/components/shortcuts/shortcuts.d.ts +28 -0
- package/components/shortcuts/shortcuts.js +92 -0
- package/components/storage/storage.d.ts +18 -0
- package/components/storage/storage.js +92 -0
- package/components/storage/storage__fallback.d.ts +79 -0
- package/components/storage/storage__fallback.js +254 -0
- package/components/storage/storage__local.d.ts +38 -0
- package/components/storage/storage__local.js +217 -0
- package/components/style.css +1 -0
- package/components/tab-trap/tab-trap.d.ts +43 -0
- package/components/tab-trap/tab-trap.js +180 -0
- package/components/table/cell.d.ts +13 -0
- package/components/table/cell.js +37 -0
- package/components/table/disable-hover-hoc.d.ts +64 -0
- package/components/table/disable-hover-hoc.js +62 -0
- package/components/table/header-cell.d.ts +43 -0
- package/components/table/header-cell.js +109 -0
- package/components/table/header.d.ts +56 -0
- package/components/table/header.js +151 -0
- package/components/table/multitable.d.ts +25 -0
- package/components/table/multitable.js +140 -0
- package/components/table/row-with-focus-sensor.d.ts +18 -0
- package/components/table/row-with-focus-sensor.js +117 -0
- package/components/table/row.d.ts +59 -0
- package/components/table/row.js +299 -0
- package/components/table/selection-adapter.d.ts +5 -0
- package/components/table/selection-adapter.js +14 -0
- package/components/table/selection-shortcuts-hoc.d.ts +17 -0
- package/components/table/selection-shortcuts-hoc.js +205 -0
- package/components/table/selection.d.ts +47 -0
- package/components/table/selection.js +257 -0
- package/components/table/smart-table.d.ts +64 -0
- package/components/table/smart-table.js +149 -0
- package/components/table/table.d.ts +159 -0
- package/components/table/table.js +463 -0
- package/components/tabs/collapsible-more.d.ts +29 -0
- package/components/tabs/collapsible-more.js +222 -0
- package/components/tabs/collapsible-tab.d.ts +16 -0
- package/components/tabs/collapsible-tab.js +88 -0
- package/components/tabs/collapsible-tabs.d.ts +43 -0
- package/components/tabs/collapsible-tabs.js +354 -0
- package/components/tabs/custom-item.d.ts +9 -0
- package/components/tabs/custom-item.js +11 -0
- package/components/tabs/dumb-tabs.d.ts +35 -0
- package/components/tabs/dumb-tabs.js +189 -0
- package/components/tabs/smart-tabs.d.ts +20 -0
- package/components/tabs/smart-tabs.js +141 -0
- package/components/tabs/tab-link.d.ts +18 -0
- package/components/tabs/tab-link.js +13 -0
- package/components/tabs/tab.d.ts +27 -0
- package/components/tabs/tab.js +41 -0
- package/components/tabs/tabs.d.ts +7 -0
- package/components/tabs/tabs.js +99 -0
- package/components/tag/tag.d.ts +64 -0
- package/components/tag/tag.js +213 -0
- package/components/tags-input/tags-input.d.ts +138 -0
- package/components/tags-input/tags-input.js +534 -0
- package/components/tags-list/tags-list.d.ts +46 -0
- package/components/tags-list/tags-list.js +102 -0
- package/components/text/text.d.ts +23 -0
- package/components/text/text.js +57 -0
- package/components/toggle/toggle.d.ts +39 -0
- package/components/toggle/toggle.js +86 -0
- package/components/tooltip/tooltip.d.ts +65 -0
- package/components/tooltip/tooltip.js +229 -0
- package/components/user-agreement/service.d.ts +69 -0
- package/components/user-agreement/service.js +487 -0
- package/components/user-agreement/toolbox.eula.d.ts +2 -0
- package/components/user-agreement/toolbox.eula.js +3 -0
- package/components/user-agreement/user-agreement.d.ts +60 -0
- package/components/user-agreement/user-agreement.js +172 -0
- package/components/user-card/card.d.ts +70 -0
- package/components/user-card/card.js +80 -0
- package/components/user-card/smart-user-card-tooltip.d.ts +20 -0
- package/components/user-card/smart-user-card-tooltip.js +172 -0
- package/components/user-card/tooltip.d.ts +36 -0
- package/components/user-card/tooltip.js +144 -0
- package/components/user-card/user-card.d.ts +11 -0
- package/components/user-card/user-card.js +85 -0
- package/package.json +118 -0
- package/typings.d.ts +43 -0
@@ -0,0 +1,100 @@
|
|
1
|
+
import { _ as _defineProperty, a as _inherits, b as _createSuper, c as _classCallCheck, d as _createClass, e as _objectWithoutProperties, f as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.concat.js';
|
3
|
+
import React, { Component } from 'react';
|
4
|
+
import PropTypes from 'prop-types';
|
5
|
+
import classNames from 'classnames';
|
6
|
+
import { interpolateLinear } from '../global/linear-function.js';
|
7
|
+
import { m as modules_e6a056e1 } from '../_helpers/island.js';
|
8
|
+
import { PhaseContext } from './adaptive-island-hoc.js';
|
9
|
+
|
10
|
+
var _excluded = ["children", "className", "wrapWithTitle", "border", "phase"];
|
11
|
+
var Start = {
|
12
|
+
FONT_SIZE: 24,
|
13
|
+
LINE_HEIGHT: 28,
|
14
|
+
PADDING_TOP: 24,
|
15
|
+
PADDING_BOTTOM: 0,
|
16
|
+
X: 0,
|
17
|
+
Y: 0,
|
18
|
+
SPACING: 0
|
19
|
+
};
|
20
|
+
var End = {
|
21
|
+
FONT_SIZE: 13,
|
22
|
+
LINE_HEIGHT: 20,
|
23
|
+
PADDING_TOP: 16,
|
24
|
+
PADDING_BOTTOM: 8,
|
25
|
+
// Compensation
|
26
|
+
X: 0.4,
|
27
|
+
Y: 0.1,
|
28
|
+
SPACING: 1.09
|
29
|
+
};
|
30
|
+
var BORDER_APPEAR_PHASE = 0.5;
|
31
|
+
var Header = /*#__PURE__*/function (_Component) {
|
32
|
+
_inherits(Header, _Component);
|
33
|
+
var _super = _createSuper(Header);
|
34
|
+
function Header() {
|
35
|
+
_classCallCheck(this, Header);
|
36
|
+
return _super.apply(this, arguments);
|
37
|
+
}
|
38
|
+
_createClass(Header, [{
|
39
|
+
key: "style",
|
40
|
+
value: function style(name) {
|
41
|
+
var _this$props$phase;
|
42
|
+
return interpolateLinear(Start[name], End[name], (_this$props$phase = this.props.phase) !== null && _this$props$phase !== void 0 ? _this$props$phase : 0);
|
43
|
+
}
|
44
|
+
}, {
|
45
|
+
key: "render",
|
46
|
+
value: function render() {
|
47
|
+
var _this$props = this.props,
|
48
|
+
children = _this$props.children,
|
49
|
+
className = _this$props.className,
|
50
|
+
wrapWithTitle = _this$props.wrapWithTitle,
|
51
|
+
border = _this$props.border,
|
52
|
+
phase = _this$props.phase,
|
53
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
54
|
+
var classes = classNames(modules_e6a056e1.header, className, {
|
55
|
+
[modules_e6a056e1.withBottomBorder]: border || phase != null && phase >= BORDER_APPEAR_PHASE
|
56
|
+
});
|
57
|
+
var headerStyle = phase != null ? {
|
58
|
+
lineHeight: "".concat(this.style('LINE_HEIGHT'), "px"),
|
59
|
+
// need to append px because number is a valid line-height value
|
60
|
+
paddingTop: this.style('PADDING_TOP'),
|
61
|
+
paddingBottom: this.style('PADDING_BOTTOM')
|
62
|
+
} : undefined;
|
63
|
+
var scaleFont = phase != null && this.style('FONT_SIZE') / Start.FONT_SIZE;
|
64
|
+
var titleStyle = phase != null && phase < 1 ? {
|
65
|
+
fontSize: Start.FONT_SIZE,
|
66
|
+
transform: "translate(".concat(this.style('X'), "px, ").concat(this.style('Y'), "px) scale(").concat(scaleFont, ")"),
|
67
|
+
letterSpacing: this.style('SPACING')
|
68
|
+
} : undefined;
|
69
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, restProps, {
|
70
|
+
"data-test": "ring-island-header",
|
71
|
+
className: classes,
|
72
|
+
style: headerStyle
|
73
|
+
}), wrapWithTitle && /*#__PURE__*/React.createElement("h2", {
|
74
|
+
className: modules_e6a056e1.title,
|
75
|
+
style: titleStyle
|
76
|
+
}, children), !wrapWithTitle && children);
|
77
|
+
}
|
78
|
+
}]);
|
79
|
+
return Header;
|
80
|
+
}(Component);
|
81
|
+
_defineProperty(Header, "propTypes", {
|
82
|
+
children: PropTypes.node,
|
83
|
+
className: PropTypes.string,
|
84
|
+
border: PropTypes.bool,
|
85
|
+
wrapWithTitle: PropTypes.bool,
|
86
|
+
phase: PropTypes.number
|
87
|
+
});
|
88
|
+
_defineProperty(Header, "defaultProps", {
|
89
|
+
wrapWithTitle: true
|
90
|
+
});
|
91
|
+
var HeaderWrapper = function HeaderWrapper(props) {
|
92
|
+
return /*#__PURE__*/React.createElement(PhaseContext.Consumer, null, function (phase) {
|
93
|
+
var addProps = phase != null ? {
|
94
|
+
phase
|
95
|
+
} : {};
|
96
|
+
return /*#__PURE__*/React.createElement(Header, _extends({}, props, addProps));
|
97
|
+
});
|
98
|
+
};
|
99
|
+
|
100
|
+
export { HeaderWrapper as default };
|
@@ -0,0 +1,78 @@
|
|
1
|
+
import React, { Component, HTMLAttributes } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
export interface IslandProps extends HTMLAttributes<HTMLElement> {
|
4
|
+
narrow?: boolean | null | undefined;
|
5
|
+
withoutPaddings?: boolean | null | undefined;
|
6
|
+
'data-test'?: string | null | undefined;
|
7
|
+
}
|
8
|
+
/**
|
9
|
+
* @name Island
|
10
|
+
*/
|
11
|
+
export default class Island extends Component<IslandProps> {
|
12
|
+
static propTypes: {
|
13
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
14
|
+
className: PropTypes.Requireable<string>;
|
15
|
+
narrow: PropTypes.Requireable<boolean>;
|
16
|
+
withoutPaddings: PropTypes.Requireable<boolean>;
|
17
|
+
'data-test': PropTypes.Requireable<string>;
|
18
|
+
};
|
19
|
+
render(): React.JSX.Element;
|
20
|
+
}
|
21
|
+
export declare const AdaptiveIsland: {
|
22
|
+
new (props: IslandProps | Readonly<IslandProps>): {
|
23
|
+
state: {
|
24
|
+
phase: null;
|
25
|
+
};
|
26
|
+
onContentScroll: ({ scrollTop, scrollHeight, clientHeight }: Element) => void;
|
27
|
+
render(): React.JSX.Element;
|
28
|
+
context: unknown;
|
29
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<IslandProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
30
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
31
|
+
readonly props: Readonly<IslandProps>;
|
32
|
+
refs: {
|
33
|
+
[key: string]: React.ReactInstance;
|
34
|
+
};
|
35
|
+
componentDidMount?(): void;
|
36
|
+
shouldComponentUpdate?(nextProps: Readonly<IslandProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
37
|
+
componentWillUnmount?(): void;
|
38
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
39
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<IslandProps>, prevState: Readonly<{}>): any;
|
40
|
+
componentDidUpdate?(prevProps: Readonly<IslandProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
41
|
+
componentWillMount?(): void;
|
42
|
+
UNSAFE_componentWillMount?(): void;
|
43
|
+
componentWillReceiveProps?(nextProps: Readonly<IslandProps>, nextContext: any): void;
|
44
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<IslandProps>, nextContext: any): void;
|
45
|
+
componentWillUpdate?(nextProps: Readonly<IslandProps>, nextState: Readonly<{}>, nextContext: any): void;
|
46
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<IslandProps>, nextState: Readonly<{}>, nextContext: any): void;
|
47
|
+
};
|
48
|
+
new (props: IslandProps, context: any): {
|
49
|
+
state: {
|
50
|
+
phase: null;
|
51
|
+
};
|
52
|
+
onContentScroll: ({ scrollTop, scrollHeight, clientHeight }: Element) => void;
|
53
|
+
render(): React.JSX.Element;
|
54
|
+
context: unknown;
|
55
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<IslandProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
56
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
57
|
+
readonly props: Readonly<IslandProps>;
|
58
|
+
refs: {
|
59
|
+
[key: string]: React.ReactInstance;
|
60
|
+
};
|
61
|
+
componentDidMount?(): void;
|
62
|
+
shouldComponentUpdate?(nextProps: Readonly<IslandProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
63
|
+
componentWillUnmount?(): void;
|
64
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
65
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<IslandProps>, prevState: Readonly<{}>): any;
|
66
|
+
componentDidUpdate?(prevProps: Readonly<IslandProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
67
|
+
componentWillMount?(): void;
|
68
|
+
UNSAFE_componentWillMount?(): void;
|
69
|
+
componentWillReceiveProps?(nextProps: Readonly<IslandProps>, nextContext: any): void;
|
70
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<IslandProps>, nextContext: any): void;
|
71
|
+
componentWillUpdate?(nextProps: Readonly<IslandProps>, nextState: Readonly<{}>, nextContext: any): void;
|
72
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<IslandProps>, nextState: Readonly<{}>, nextContext: any): void;
|
73
|
+
};
|
74
|
+
propTypes: React.WeakValidationMap<IslandProps> | undefined;
|
75
|
+
contextType?: React.Context<any> | undefined;
|
76
|
+
};
|
77
|
+
export { default as Header } from './header';
|
78
|
+
export { default as Content } from './content';
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import { _ as _defineProperty, a as _inherits, b as _createSuper, c as _classCallCheck, d as _createClass, e as _objectWithoutProperties, f as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import React, { Component } from 'react';
|
3
|
+
import PropTypes from 'prop-types';
|
4
|
+
import classNames from 'classnames';
|
5
|
+
import joinDataTestAttributes from '../global/data-tests.js';
|
6
|
+
import adaptiveIslandHOC from './adaptive-island-hoc.js';
|
7
|
+
import { m as modules_e6a056e1 } from '../_helpers/island.js';
|
8
|
+
export { default as Header } from './header.js';
|
9
|
+
export { default as Content } from './content.js';
|
10
|
+
import 'core-js/modules/es.array.reduce.js';
|
11
|
+
import 'core-js/modules/es.object.to-string.js';
|
12
|
+
import 'core-js/modules/es.object.entries.js';
|
13
|
+
import 'core-js/modules/es.array.concat.js';
|
14
|
+
import '../global/linear-function.js';
|
15
|
+
import 'element-resize-detector';
|
16
|
+
import '../global/schedule-raf.js';
|
17
|
+
|
18
|
+
var _excluded = ["children", "className", "narrow", "withoutPaddings", "data-test"];
|
19
|
+
/**
|
20
|
+
* @name Island
|
21
|
+
*/
|
22
|
+
var Island = /*#__PURE__*/function (_Component) {
|
23
|
+
_inherits(Island, _Component);
|
24
|
+
var _super = _createSuper(Island);
|
25
|
+
function Island() {
|
26
|
+
_classCallCheck(this, Island);
|
27
|
+
return _super.apply(this, arguments);
|
28
|
+
}
|
29
|
+
_createClass(Island, [{
|
30
|
+
key: "render",
|
31
|
+
value: function render() {
|
32
|
+
var _this$props = this.props,
|
33
|
+
children = _this$props.children,
|
34
|
+
className = _this$props.className,
|
35
|
+
narrow = _this$props.narrow,
|
36
|
+
withoutPaddings = _this$props.withoutPaddings,
|
37
|
+
dataTest = _this$props['data-test'],
|
38
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
39
|
+
var classes = classNames(modules_e6a056e1.island, className, {
|
40
|
+
[modules_e6a056e1.narrowIsland]: narrow,
|
41
|
+
[modules_e6a056e1.withoutPaddings]: withoutPaddings
|
42
|
+
});
|
43
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, restProps, {
|
44
|
+
className: classes,
|
45
|
+
"data-test": joinDataTestAttributes('ring-island', dataTest)
|
46
|
+
}), children);
|
47
|
+
}
|
48
|
+
}]);
|
49
|
+
return Island;
|
50
|
+
}(Component);
|
51
|
+
_defineProperty(Island, "propTypes", {
|
52
|
+
children: PropTypes.node,
|
53
|
+
className: PropTypes.string,
|
54
|
+
narrow: PropTypes.bool,
|
55
|
+
withoutPaddings: PropTypes.bool,
|
56
|
+
'data-test': PropTypes.string
|
57
|
+
});
|
58
|
+
var AdaptiveIsland = adaptiveIslandHOC(Island);
|
59
|
+
|
60
|
+
export { AdaptiveIsland, Island as default };
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React, { HTMLAttributes, PureComponent } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import './island-legacy.css';
|
4
|
+
export default class Content extends PureComponent<HTMLAttributes<HTMLElement>> {
|
5
|
+
static propTypes: {
|
6
|
+
className: PropTypes.Requireable<string>;
|
7
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
8
|
+
};
|
9
|
+
render(): React.JSX.Element;
|
10
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { _ as _defineProperty, a as _inherits, b as _createSuper, c as _classCallCheck, d as _createClass, e as _objectWithoutProperties, f as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import React, { PureComponent } from 'react';
|
3
|
+
import PropTypes from 'prop-types';
|
4
|
+
import classNames from 'classnames';
|
5
|
+
|
6
|
+
var _excluded = ["children", "className"];
|
7
|
+
var Content = /*#__PURE__*/function (_PureComponent) {
|
8
|
+
_inherits(Content, _PureComponent);
|
9
|
+
var _super = _createSuper(Content);
|
10
|
+
function Content() {
|
11
|
+
_classCallCheck(this, Content);
|
12
|
+
return _super.apply(this, arguments);
|
13
|
+
}
|
14
|
+
_createClass(Content, [{
|
15
|
+
key: "render",
|
16
|
+
value: function render() {
|
17
|
+
var _this$props = this.props,
|
18
|
+
children = _this$props.children,
|
19
|
+
className = _this$props.className,
|
20
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
21
|
+
var classes = classNames('ring-island__content', className);
|
22
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, restProps, {
|
23
|
+
className: classes
|
24
|
+
}), children);
|
25
|
+
}
|
26
|
+
}]);
|
27
|
+
return Content;
|
28
|
+
}(PureComponent);
|
29
|
+
_defineProperty(Content, "propTypes", {
|
30
|
+
className: PropTypes.string,
|
31
|
+
children: PropTypes.node
|
32
|
+
});
|
33
|
+
|
34
|
+
export { Content as default };
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React, { HTMLAttributes, PureComponent } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import './island-legacy.css';
|
4
|
+
export default class Header extends PureComponent<HTMLAttributes<HTMLElement>> {
|
5
|
+
static propTypes: {
|
6
|
+
className: PropTypes.Requireable<string>;
|
7
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
8
|
+
};
|
9
|
+
render(): React.JSX.Element;
|
10
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { _ as _defineProperty, a as _inherits, b as _createSuper, c as _classCallCheck, d as _createClass, e as _objectWithoutProperties, f as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import React, { PureComponent } from 'react';
|
3
|
+
import PropTypes from 'prop-types';
|
4
|
+
import classNames from 'classnames';
|
5
|
+
|
6
|
+
var _excluded = ["children", "className"];
|
7
|
+
var Header = /*#__PURE__*/function (_PureComponent) {
|
8
|
+
_inherits(Header, _PureComponent);
|
9
|
+
var _super = _createSuper(Header);
|
10
|
+
function Header() {
|
11
|
+
_classCallCheck(this, Header);
|
12
|
+
return _super.apply(this, arguments);
|
13
|
+
}
|
14
|
+
_createClass(Header, [{
|
15
|
+
key: "render",
|
16
|
+
value: function render() {
|
17
|
+
var _this$props = this.props,
|
18
|
+
children = _this$props.children,
|
19
|
+
className = _this$props.className,
|
20
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
21
|
+
var classes = classNames('ring-island__header', className);
|
22
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, restProps, {
|
23
|
+
className: classes
|
24
|
+
}), /*#__PURE__*/React.createElement("div", {
|
25
|
+
className: "ring-island__title"
|
26
|
+
}, children));
|
27
|
+
}
|
28
|
+
}]);
|
29
|
+
return Header;
|
30
|
+
}(PureComponent);
|
31
|
+
_defineProperty(Header, "propTypes", {
|
32
|
+
className: PropTypes.string,
|
33
|
+
children: PropTypes.node
|
34
|
+
});
|
35
|
+
|
36
|
+
export { Header as default };
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React, { HTMLAttributes, PureComponent } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import './island-legacy.css';
|
4
|
+
export default class Island extends PureComponent<HTMLAttributes<HTMLElement>> {
|
5
|
+
static propTypes: {
|
6
|
+
className: PropTypes.Requireable<string>;
|
7
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
8
|
+
};
|
9
|
+
render(): React.JSX.Element;
|
10
|
+
}
|
11
|
+
export { default as Header } from './header-legacy';
|
12
|
+
export { default as Content } from './content-legacy';
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { _ as _defineProperty, a as _inherits, b as _createSuper, c as _classCallCheck, d as _createClass, e as _objectWithoutProperties, f as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import React, { PureComponent } from 'react';
|
3
|
+
import PropTypes from 'prop-types';
|
4
|
+
import classNames from 'classnames';
|
5
|
+
export { default as Header } from './header-legacy.js';
|
6
|
+
export { default as Content } from './content-legacy.js';
|
7
|
+
|
8
|
+
var _excluded = ["children", "className"];
|
9
|
+
var Island = /*#__PURE__*/function (_PureComponent) {
|
10
|
+
_inherits(Island, _PureComponent);
|
11
|
+
var _super = _createSuper(Island);
|
12
|
+
function Island() {
|
13
|
+
_classCallCheck(this, Island);
|
14
|
+
return _super.apply(this, arguments);
|
15
|
+
}
|
16
|
+
_createClass(Island, [{
|
17
|
+
key: "render",
|
18
|
+
value: function render() {
|
19
|
+
var _this$props = this.props,
|
20
|
+
children = _this$props.children,
|
21
|
+
className = _this$props.className,
|
22
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
23
|
+
var classes = classNames('ring-island', className);
|
24
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, restProps, {
|
25
|
+
className: classes
|
26
|
+
}), children);
|
27
|
+
}
|
28
|
+
}]);
|
29
|
+
return Island;
|
30
|
+
}(PureComponent);
|
31
|
+
_defineProperty(Island, "propTypes", {
|
32
|
+
className: PropTypes.string,
|
33
|
+
children: PropTypes.node
|
34
|
+
});
|
35
|
+
|
36
|
+
export { Island as default };
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import React, { PureComponent, AnchorHTMLAttributes } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
export interface ClickableLinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
4
|
+
onConditionalClick?: ((isPlainLeft: boolean, e: React.MouseEvent<HTMLAnchorElement>) => void) | null | undefined;
|
5
|
+
onPlainLeftClick?: ((e: React.MouseEvent<HTMLAnchorElement>) => void) | null | undefined;
|
6
|
+
activeClassName?: string | null | undefined;
|
7
|
+
disabled?: boolean | undefined;
|
8
|
+
}
|
9
|
+
export default class ClickableLink extends PureComponent<ClickableLinkProps> {
|
10
|
+
static propTypes: {
|
11
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
12
|
+
onPlainLeftClick: PropTypes.Requireable<(...args: any[]) => any>;
|
13
|
+
onConditionalClick: PropTypes.Requireable<(...args: any[]) => any>;
|
14
|
+
activeClassName: PropTypes.Requireable<string>;
|
15
|
+
href: PropTypes.Validator<string>;
|
16
|
+
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
17
|
+
};
|
18
|
+
onClick: (e: React.MouseEvent<HTMLAnchorElement>) => void;
|
19
|
+
render(): React.JSX.Element;
|
20
|
+
}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import { _ as _defineProperty, a as _inherits, b as _createSuper, c as _classCallCheck, k as _assertThisInitialized, d as _createClass, e as _objectWithoutProperties, f as _extends } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.array.concat.js';
|
3
|
+
import React, { PureComponent } from 'react';
|
4
|
+
import PropTypes from 'prop-types';
|
5
|
+
|
6
|
+
var _excluded = ["onConditionalClick", "onPlainLeftClick", "activeClassName", "href", "children"];
|
7
|
+
var LEFT_BUTTON = 0;
|
8
|
+
// Cmd/Ctrl/Shift/Alt + Click should trigger default browser behaviour. Same applies to non-left clicks
|
9
|
+
var isPlainLeftClick = function isPlainLeftClick(e) {
|
10
|
+
return e.button === LEFT_BUTTON && !e.altKey && !e.ctrlKey && !e.metaKey && !e.shiftKey;
|
11
|
+
};
|
12
|
+
var ClickableLink = /*#__PURE__*/function (_PureComponent) {
|
13
|
+
_inherits(ClickableLink, _PureComponent);
|
14
|
+
var _super = _createSuper(ClickableLink);
|
15
|
+
function ClickableLink() {
|
16
|
+
var _this;
|
17
|
+
_classCallCheck(this, ClickableLink);
|
18
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
19
|
+
args[_key] = arguments[_key];
|
20
|
+
}
|
21
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
22
|
+
_defineProperty(_assertThisInitialized(_this), "onClick", function (e) {
|
23
|
+
var _this$props = _this.props,
|
24
|
+
onClick = _this$props.onClick,
|
25
|
+
onConditionalClick = _this$props.onConditionalClick,
|
26
|
+
onPlainLeftClick = _this$props.onPlainLeftClick;
|
27
|
+
var isPlainLeft = isPlainLeftClick(e);
|
28
|
+
if (onClick) {
|
29
|
+
onClick(e);
|
30
|
+
}
|
31
|
+
if (onConditionalClick) {
|
32
|
+
onConditionalClick(isPlainLeft, e);
|
33
|
+
}
|
34
|
+
if (onPlainLeftClick && isPlainLeft) {
|
35
|
+
e.preventDefault();
|
36
|
+
onPlainLeftClick(e);
|
37
|
+
}
|
38
|
+
});
|
39
|
+
return _this;
|
40
|
+
}
|
41
|
+
_createClass(ClickableLink, [{
|
42
|
+
key: "render",
|
43
|
+
value: function render() {
|
44
|
+
var _this$props2 = this.props;
|
45
|
+
_this$props2.onConditionalClick;
|
46
|
+
_this$props2.onPlainLeftClick;
|
47
|
+
_this$props2.activeClassName;
|
48
|
+
var href = _this$props2.href,
|
49
|
+
children = _this$props2.children,
|
50
|
+
restProps = _objectWithoutProperties(_this$props2, _excluded);
|
51
|
+
return /*#__PURE__*/React.createElement("a", _extends({
|
52
|
+
href: href
|
53
|
+
}, restProps, {
|
54
|
+
onClick: this.onClick
|
55
|
+
}), children);
|
56
|
+
}
|
57
|
+
}]);
|
58
|
+
return ClickableLink;
|
59
|
+
}(PureComponent);
|
60
|
+
_defineProperty(ClickableLink, "propTypes", {
|
61
|
+
onClick: PropTypes.func,
|
62
|
+
onPlainLeftClick: PropTypes.func,
|
63
|
+
onConditionalClick: PropTypes.func,
|
64
|
+
activeClassName: PropTypes.string,
|
65
|
+
href: PropTypes.string.isRequired,
|
66
|
+
children: PropTypes.node.isRequired
|
67
|
+
});
|
68
|
+
|
69
|
+
export { ClickableLink as default };
|
@@ -0,0 +1,138 @@
|
|
1
|
+
import React, { ReactNode, ComponentType } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import { ClickableLinkProps } from './clickableLink';
|
4
|
+
/**
|
5
|
+
* @name Link
|
6
|
+
*/
|
7
|
+
export interface LinkBaseProps {
|
8
|
+
active?: boolean | null | undefined;
|
9
|
+
inherit?: boolean | null | undefined;
|
10
|
+
pseudo?: boolean | null | undefined;
|
11
|
+
hover?: boolean | null | undefined;
|
12
|
+
'data-test'?: string | null | undefined;
|
13
|
+
children: ReactNode;
|
14
|
+
}
|
15
|
+
export type LinkProps<P extends ClickableLinkProps = ClickableLinkProps> = Omit<P, keyof LinkBaseProps> & LinkBaseProps;
|
16
|
+
export declare function linkHOC<P extends ClickableLinkProps>(ComposedComponent: ComponentType<P> | string): {
|
17
|
+
new (props: LinkProps<P> | Readonly<LinkProps<P>>): {
|
18
|
+
render(): React.JSX.Element;
|
19
|
+
context: unknown;
|
20
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<LinkProps<P>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
21
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
22
|
+
readonly props: Readonly<LinkProps<P>>;
|
23
|
+
state: Readonly<{}>;
|
24
|
+
refs: {
|
25
|
+
[key: string]: React.ReactInstance;
|
26
|
+
};
|
27
|
+
componentDidMount?(): void;
|
28
|
+
shouldComponentUpdate?(nextProps: Readonly<LinkProps<P>>, nextState: Readonly<{}>, nextContext: any): boolean;
|
29
|
+
componentWillUnmount?(): void;
|
30
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
31
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<LinkProps<P>>, prevState: Readonly<{}>): any;
|
32
|
+
componentDidUpdate?(prevProps: Readonly<LinkProps<P>>, prevState: Readonly<{}>, snapshot?: any): void;
|
33
|
+
componentWillMount?(): void;
|
34
|
+
UNSAFE_componentWillMount?(): void;
|
35
|
+
componentWillReceiveProps?(nextProps: Readonly<LinkProps<P>>, nextContext: any): void;
|
36
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<LinkProps<P>>, nextContext: any): void;
|
37
|
+
componentWillUpdate?(nextProps: Readonly<LinkProps<P>>, nextState: Readonly<{}>, nextContext: any): void;
|
38
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<LinkProps<P>>, nextState: Readonly<{}>, nextContext: any): void;
|
39
|
+
};
|
40
|
+
new (props: LinkProps<P>, context: any): {
|
41
|
+
render(): React.JSX.Element;
|
42
|
+
context: unknown;
|
43
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<LinkProps<P>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
44
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
45
|
+
readonly props: Readonly<LinkProps<P>>;
|
46
|
+
state: Readonly<{}>;
|
47
|
+
refs: {
|
48
|
+
[key: string]: React.ReactInstance;
|
49
|
+
};
|
50
|
+
componentDidMount?(): void;
|
51
|
+
shouldComponentUpdate?(nextProps: Readonly<LinkProps<P>>, nextState: Readonly<{}>, nextContext: any): boolean;
|
52
|
+
componentWillUnmount?(): void;
|
53
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
54
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<LinkProps<P>>, prevState: Readonly<{}>): any;
|
55
|
+
componentDidUpdate?(prevProps: Readonly<LinkProps<P>>, prevState: Readonly<{}>, snapshot?: any): void;
|
56
|
+
componentWillMount?(): void;
|
57
|
+
UNSAFE_componentWillMount?(): void;
|
58
|
+
componentWillReceiveProps?(nextProps: Readonly<LinkProps<P>>, nextContext: any): void;
|
59
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<LinkProps<P>>, nextContext: any): void;
|
60
|
+
componentWillUpdate?(nextProps: Readonly<LinkProps<P>>, nextState: Readonly<{}>, nextContext: any): void;
|
61
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<LinkProps<P>>, nextState: Readonly<{}>, nextContext: any): void;
|
62
|
+
};
|
63
|
+
propTypes: {
|
64
|
+
className: PropTypes.Requireable<string>;
|
65
|
+
active: PropTypes.Requireable<boolean>;
|
66
|
+
inherit: PropTypes.Requireable<boolean>;
|
67
|
+
pseudo: PropTypes.Requireable<boolean>;
|
68
|
+
hover: PropTypes.Requireable<boolean>;
|
69
|
+
children: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
70
|
+
'data-test': PropTypes.Requireable<string>;
|
71
|
+
href: PropTypes.Requireable<string>;
|
72
|
+
onPlainLeftClick: PropTypes.Requireable<(...args: any[]) => any>;
|
73
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
74
|
+
};
|
75
|
+
contextType?: React.Context<any> | undefined;
|
76
|
+
};
|
77
|
+
declare const _default: {
|
78
|
+
new (props: LinkProps<ClickableLinkProps> | Readonly<LinkProps<ClickableLinkProps>>): {
|
79
|
+
render(): React.JSX.Element;
|
80
|
+
context: unknown;
|
81
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<LinkProps<ClickableLinkProps>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
82
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
83
|
+
readonly props: Readonly<LinkProps<ClickableLinkProps>>;
|
84
|
+
state: Readonly<{}>;
|
85
|
+
refs: {
|
86
|
+
[key: string]: React.ReactInstance;
|
87
|
+
};
|
88
|
+
componentDidMount?(): void;
|
89
|
+
shouldComponentUpdate?(nextProps: Readonly<LinkProps<ClickableLinkProps>>, nextState: Readonly<{}>, nextContext: any): boolean;
|
90
|
+
componentWillUnmount?(): void;
|
91
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
92
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<LinkProps<ClickableLinkProps>>, prevState: Readonly<{}>): any;
|
93
|
+
componentDidUpdate?(prevProps: Readonly<LinkProps<ClickableLinkProps>>, prevState: Readonly<{}>, snapshot?: any): void;
|
94
|
+
componentWillMount?(): void;
|
95
|
+
UNSAFE_componentWillMount?(): void;
|
96
|
+
componentWillReceiveProps?(nextProps: Readonly<LinkProps<ClickableLinkProps>>, nextContext: any): void;
|
97
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<LinkProps<ClickableLinkProps>>, nextContext: any): void;
|
98
|
+
componentWillUpdate?(nextProps: Readonly<LinkProps<ClickableLinkProps>>, nextState: Readonly<{}>, nextContext: any): void;
|
99
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<LinkProps<ClickableLinkProps>>, nextState: Readonly<{}>, nextContext: any): void;
|
100
|
+
};
|
101
|
+
new (props: LinkProps<ClickableLinkProps>, context: any): {
|
102
|
+
render(): React.JSX.Element;
|
103
|
+
context: unknown;
|
104
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<LinkProps<ClickableLinkProps>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
105
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
106
|
+
readonly props: Readonly<LinkProps<ClickableLinkProps>>;
|
107
|
+
state: Readonly<{}>;
|
108
|
+
refs: {
|
109
|
+
[key: string]: React.ReactInstance;
|
110
|
+
};
|
111
|
+
componentDidMount?(): void;
|
112
|
+
shouldComponentUpdate?(nextProps: Readonly<LinkProps<ClickableLinkProps>>, nextState: Readonly<{}>, nextContext: any): boolean;
|
113
|
+
componentWillUnmount?(): void;
|
114
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
115
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<LinkProps<ClickableLinkProps>>, prevState: Readonly<{}>): any;
|
116
|
+
componentDidUpdate?(prevProps: Readonly<LinkProps<ClickableLinkProps>>, prevState: Readonly<{}>, snapshot?: any): void;
|
117
|
+
componentWillMount?(): void;
|
118
|
+
UNSAFE_componentWillMount?(): void;
|
119
|
+
componentWillReceiveProps?(nextProps: Readonly<LinkProps<ClickableLinkProps>>, nextContext: any): void;
|
120
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<LinkProps<ClickableLinkProps>>, nextContext: any): void;
|
121
|
+
componentWillUpdate?(nextProps: Readonly<LinkProps<ClickableLinkProps>>, nextState: Readonly<{}>, nextContext: any): void;
|
122
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<LinkProps<ClickableLinkProps>>, nextState: Readonly<{}>, nextContext: any): void;
|
123
|
+
};
|
124
|
+
propTypes: {
|
125
|
+
className: PropTypes.Requireable<string>;
|
126
|
+
active: PropTypes.Requireable<boolean>;
|
127
|
+
inherit: PropTypes.Requireable<boolean>;
|
128
|
+
pseudo: PropTypes.Requireable<boolean>;
|
129
|
+
hover: PropTypes.Requireable<boolean>;
|
130
|
+
children: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike | ((...args: any[]) => any)>>;
|
131
|
+
'data-test': PropTypes.Requireable<string>;
|
132
|
+
href: PropTypes.Requireable<string>;
|
133
|
+
onPlainLeftClick: PropTypes.Requireable<(...args: any[]) => any>;
|
134
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
135
|
+
};
|
136
|
+
contextType?: React.Context<any> | undefined;
|
137
|
+
};
|
138
|
+
export default _default;
|