@jetbrains/ring-ui 6.0.6-beta.0 → 6.0.6
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/README.md +1 -1
- package/components/alert/alert.css +146 -0
- package/components/alert/alert.d.ts +113 -0
- package/components/alert/alert.js +186 -0
- package/components/alert/container.css +26 -0
- package/components/alert/container.d.ts +15 -0
- package/components/alert/container.js +30 -0
- package/components/alert-service/alert-service.d.ts +36 -0
- package/components/alert-service/alert-service.js +108 -0
- package/components/alert-service/alert-service.stories.css +17 -0
- package/components/analytics/analytics.d.ts +18 -0
- package/components/analytics/analytics.js +18 -0
- package/components/analytics/analytics__custom-plugin.d.ts +28 -0
- package/components/analytics/analytics__custom-plugin.js +58 -0
- package/components/auth/auth.d.ts +3 -0
- package/components/auth/auth.js +42 -0
- package/components/auth/auth__core.d.ts +236 -0
- package/components/auth/auth__core.js +834 -0
- package/components/auth/background-flow.d.ts +31 -0
- package/components/auth/background-flow.js +97 -0
- package/components/auth/down-notification.css +15 -0
- package/components/auth/down-notification.d.ts +15 -0
- package/components/auth/down-notification.js +52 -0
- package/components/auth/iframe-flow.d.ts +20 -0
- package/components/auth/iframe-flow.js +81 -0
- package/components/auth/request-builder.d.ts +48 -0
- package/components/auth/request-builder.js +64 -0
- package/components/auth/response-parser.d.ts +70 -0
- package/components/auth/response-parser.js +99 -0
- package/components/auth/storage.d.ts +112 -0
- package/components/auth/storage.js +224 -0
- package/components/auth/token-validator.d.ts +93 -0
- package/components/auth/token-validator.js +169 -0
- package/components/auth/window-flow.d.ts +26 -0
- package/components/auth/window-flow.js +102 -0
- package/components/auth-dialog/auth-dialog.css +54 -0
- package/components/auth-dialog/auth-dialog.d.ts +60 -0
- package/components/auth-dialog/auth-dialog.js +93 -0
- package/components/auth-dialog-service/auth-dialog-service.d.ts +6 -0
- package/components/auth-dialog-service/auth-dialog-service.js +26 -0
- package/components/avatar/avatar-example-datauri.d.ts +1 -0
- package/components/avatar/avatar-example-datauri.js +24 -0
- package/components/avatar/avatar.css +27 -0
- package/components/avatar/avatar.d.ts +52 -0
- package/components/avatar/avatar.js +98 -0
- package/components/avatar/fallback-avatar.d.ts +17 -0
- package/components/avatar/fallback-avatar.js +113 -0
- package/components/badge/badge.css +42 -0
- package/components/badge/badge.d.ts +24 -0
- package/components/badge/badge.js +35 -0
- package/components/button/button.css +397 -0
- package/components/button/button.d.ts +67 -0
- package/components/button/button.js +70 -0
- package/components/button/button__classes.d.ts +2 -0
- package/components/button/button__classes.js +18 -0
- package/components/button-group/button-group.css +236 -0
- package/components/button-group/button-group.d.ts +18 -0
- package/components/button-group/button-group.js +21 -0
- package/components/button-group/caption.d.ts +8 -0
- package/components/button-group/caption.js +14 -0
- package/components/button-set/button-set.css +21 -0
- package/components/button-set/button-set.d.ts +16 -0
- package/components/button-set/button-set.js +22 -0
- package/components/button-toolbar/button-toolbar.css +25 -0
- package/components/button-toolbar/button-toolbar.d.ts +16 -0
- package/components/button-toolbar/button-toolbar.js +20 -0
- package/components/caret/caret.d.ts +66 -0
- package/components/caret/caret.js +216 -0
- package/components/checkbox/checkbox.css +146 -0
- package/components/checkbox/checkbox.d.ts +45 -0
- package/components/checkbox/checkbox.js +72 -0
- package/components/clipboard/clipboard-fallback.d.ts +2 -0
- package/components/clipboard/clipboard-fallback.js +44 -0
- package/components/clipboard/clipboard.d.ts +5 -0
- package/components/clipboard/clipboard.js +41 -0
- package/components/code/code.css +29 -0
- package/components/code/code.d.ts +44 -0
- package/components/code/code.js +94 -0
- package/components/code/highlight.css +112 -0
- package/components/collapse/collapse-content.d.ts +11 -0
- package/components/collapse/collapse-content.js +72 -0
- package/components/collapse/collapse-context.d.ts +10 -0
- package/components/collapse/collapse-context.js +10 -0
- package/components/collapse/collapse-control.d.ts +11 -0
- package/components/collapse/collapse-control.js +22 -0
- package/components/collapse/collapse.css +40 -0
- package/components/collapse/collapse.d.ts +12 -0
- package/components/collapse/collapse.js +26 -0
- package/components/collapse/collapse.stories.css +25 -0
- package/components/collapse/consts.d.ts +4 -0
- package/components/collapse/consts.js +4 -0
- package/components/collapse/utils.d.ts +1 -0
- package/components/collapse/utils.js +1 -0
- package/components/confirm/confirm.css +7 -0
- package/components/confirm/confirm.d.ts +48 -0
- package/components/confirm/confirm.js +59 -0
- package/components/confirm-service/confirm-service.d.ts +21 -0
- package/components/confirm-service/confirm-service.js +52 -0
- package/components/content-layout/content-layout.css +108 -0
- package/components/content-layout/content-layout.d.ts +26 -0
- package/components/content-layout/content-layout.js +45 -0
- package/components/content-layout/sidebar.d.ts +31 -0
- package/components/content-layout/sidebar.js +76 -0
- package/components/contenteditable/contenteditable.d.ts +47 -0
- package/components/contenteditable/contenteditable.js +47 -0
- package/components/control-label/control-label.css +23 -0
- package/components/control-label/control-label.d.ts +11 -0
- package/components/control-label/control-label.js +22 -0
- package/components/data-list/data-list.css +97 -0
- package/components/data-list/data-list.d.ts +85 -0
- package/components/data-list/data-list.js +119 -0
- package/components/data-list/data-list.mock.d.ts +16 -0
- package/components/data-list/data-list.mock.js +207 -0
- package/components/data-list/item.d.ts +50 -0
- package/components/data-list/item.js +114 -0
- package/components/data-list/selection.d.ts +16 -0
- package/components/data-list/selection.js +81 -0
- package/components/data-list/title.d.ts +26 -0
- package/components/data-list/title.js +65 -0
- package/components/date-picker/consts.d.ts +98 -0
- package/components/date-picker/consts.js +44 -0
- package/components/date-picker/date-input.d.ts +47 -0
- package/components/date-picker/date-input.js +91 -0
- package/components/date-picker/date-picker.css +602 -0
- package/components/date-picker/date-picker.d.ts +77 -0
- package/components/date-picker/date-picker.js +218 -0
- package/components/date-picker/date-popup.d.ts +55 -0
- package/components/date-picker/date-popup.js +347 -0
- package/components/date-picker/day.d.ts +30 -0
- package/components/date-picker/day.js +88 -0
- package/components/date-picker/formats.d.ts +2 -0
- package/components/date-picker/formats.js +1 -0
- package/components/date-picker/month-names.d.ts +13 -0
- package/components/date-picker/month-names.js +62 -0
- package/components/date-picker/month-slider.d.ts +29 -0
- package/components/date-picker/month-slider.js +56 -0
- package/components/date-picker/month.d.ts +14 -0
- package/components/date-picker/month.js +33 -0
- package/components/date-picker/months.d.ts +11 -0
- package/components/date-picker/months.js +101 -0
- package/components/date-picker/weekdays.d.ts +13 -0
- package/components/date-picker/weekdays.js +24 -0
- package/components/date-picker/years.d.ts +25 -0
- package/components/date-picker/years.js +87 -0
- package/components/dialog/dialog.css +137 -0
- package/components/dialog/dialog.d.ts +64 -0
- package/components/dialog/dialog.js +128 -0
- package/components/dialog/dialog__body-scroll-preventer.d.ts +9 -0
- package/components/dialog/dialog__body-scroll-preventer.js +43 -0
- package/components/dropdown/anchor.d.ts +11 -0
- package/components/dropdown/anchor.js +16 -0
- package/components/dropdown/dropdown.css +18 -0
- package/components/dropdown/dropdown.d.ts +87 -0
- package/components/dropdown/dropdown.js +159 -0
- package/components/dropdown-menu/dropdown-menu.d.ts +36 -0
- package/components/dropdown-menu/dropdown-menu.js +56 -0
- package/components/editable-heading/editable-heading.css +198 -0
- package/components/editable-heading/editable-heading.d.ts +32 -0
- package/components/editable-heading/editable-heading.js +141 -0
- package/components/error-bubble/error-bubble-legacy.css +77 -0
- package/components/error-bubble/error-bubble.css +54 -0
- package/components/error-bubble/error-bubble.d.ts +18 -0
- package/components/error-bubble/error-bubble.js +28 -0
- package/components/error-message/error-message.css +37 -0
- package/components/error-message/error-message.d.ts +27 -0
- package/components/error-message/error-message.js +37 -0
- package/components/error-page/error-page.css +24 -0
- package/components/error-page/error-page.gif +0 -0
- package/components/footer/footer.css +83 -0
- package/components/footer/footer.d.ts +28 -0
- package/components/footer/footer.js +97 -0
- package/components/form/form.css +266 -0
- package/components/form/form.stories.js +138 -0
- package/components/global/compose.d.ts +7 -0
- package/components/global/compose.js +4 -0
- package/components/global/composeRefs.d.ts +3 -0
- package/components/global/composeRefs.js +8 -0
- package/components/global/controls-height.d.ts +9 -0
- package/components/global/controls-height.js +16 -0
- package/components/global/create-stateful-context.d.ts +27 -0
- package/components/global/create-stateful-context.js +38 -0
- package/components/global/data-tests.d.ts +3 -0
- package/components/global/data-tests.js +17 -0
- package/components/global/dom.d.ts +37 -0
- package/components/global/dom.js +83 -0
- package/components/global/focus-sensor-hoc.d.ts +19 -0
- package/components/global/focus-sensor-hoc.js +102 -0
- package/components/global/fuzzy-highlight.d.ts +11 -0
- package/components/global/fuzzy-highlight.js +58 -0
- package/components/global/get-event-key.d.ts +2 -0
- package/components/global/get-event-key.js +100 -0
- package/components/global/get-uid.d.ts +1 -0
- package/components/global/get-uid.js +16 -0
- package/components/global/global.css +101 -0
- package/components/global/inject-styles.d.ts +3 -0
- package/components/global/inject-styles.js +12 -0
- package/components/global/linear-function.d.ts +6 -0
- package/components/global/linear-function.js +13 -0
- package/components/global/listeners.d.ts +8 -0
- package/components/global/listeners.js +27 -0
- package/components/global/memoize.d.ts +1 -0
- package/components/global/memoize.js +15 -0
- package/components/global/normalize-indent.d.ts +1 -0
- package/components/global/normalize-indent.js +30 -0
- package/components/global/promise-with-timeout.d.ts +5 -0
- package/components/global/promise-with-timeout.js +11 -0
- package/components/global/prop-types.d.ts +4 -0
- package/components/global/prop-types.js +4 -0
- package/components/global/react-dom-renderer.d.ts +16 -0
- package/components/global/react-dom-renderer.js +25 -0
- package/components/global/react-render-adapter.d.ts +1 -0
- package/components/global/react-render-adapter.js +3 -0
- package/components/global/rerender-hoc.d.ts +10 -0
- package/components/global/rerender-hoc.js +14 -0
- package/components/global/schedule-raf.d.ts +1 -0
- package/components/global/schedule-raf.js +27 -0
- package/components/global/sniffer.d.ts +3 -0
- package/components/global/sniffer.js +4 -0
- package/components/global/theme.d.ts +21 -0
- package/components/global/theme.js +70 -0
- package/components/global/trivial-template-tag.d.ts +1 -0
- package/components/global/trivial-template-tag.js +9 -0
- package/components/global/typescript-utils.d.ts +2 -0
- package/components/global/typescript-utils.js +2 -0
- package/components/global/url.d.ts +57 -0
- package/components/global/url.js +136 -0
- package/components/global/use-event-callback.d.ts +1 -0
- package/components/global/use-event-callback.js +14 -0
- package/components/global/variables.css +179 -0
- package/components/global/variables.d.ts +89 -0
- package/components/global/variables.js +1 -0
- package/components/global/variables_dark.css +132 -0
- package/components/grid/col.d.ts +31 -0
- package/components/grid/col.js +49 -0
- package/components/grid/grid.css +915 -0
- package/components/grid/grid.d.ts +14 -0
- package/components/grid/grid.js +22 -0
- package/components/grid/row.d.ts +40 -0
- package/components/grid/row.js +51 -0
- package/components/group/group.css +7 -0
- package/components/group/group.d.ts +12 -0
- package/components/group/group.js +20 -0
- package/components/header/header.css +169 -0
- package/components/header/header.d.ts +34 -0
- package/components/header/header.js +46 -0
- package/components/header/logo.d.ts +14 -0
- package/components/header/logo.js +22 -0
- package/components/header/profile.d.ts +75 -0
- package/components/header/profile.js +119 -0
- package/components/header/services-link.d.ts +25 -0
- package/components/header/services-link.js +26 -0
- package/components/header/services.css +97 -0
- package/components/header/services.d.ts +33 -0
- package/components/header/services.js +62 -0
- package/components/header/smart-profile.d.ts +36 -0
- package/components/header/smart-profile.js +86 -0
- package/components/header/smart-services.d.ts +26 -0
- package/components/header/smart-services.js +49 -0
- package/components/header/tray-icon.d.ts +32 -0
- package/components/header/tray-icon.js +20 -0
- package/components/header/tray.d.ts +9 -0
- package/components/header/tray.js +18 -0
- package/components/heading/heading.css +68 -0
- package/components/heading/heading.d.ts +25 -0
- package/components/heading/heading.js +52 -0
- package/components/http/http.d.ts +61 -0
- package/components/http/http.js +192 -0
- package/components/http/http.mock.d.ts +20 -0
- package/components/http/http.mock.js +52 -0
- package/components/hub-source/hub-source.d.ts +44 -0
- package/components/hub-source/hub-source.js +107 -0
- package/components/hub-source/hub-source__user.d.ts +4 -0
- package/components/hub-source/hub-source__user.js +20 -0
- package/components/hub-source/hub-source__users-groups.d.ts +24 -0
- package/components/hub-source/hub-source__users-groups.js +53 -0
- package/components/i18n/README.md +46 -0
- package/components/i18n/i18n-context.d.ts +13 -0
- package/components/i18n/i18n-context.js +14 -0
- package/components/i18n/i18n.d.ts +59 -0
- package/components/i18n/i18n.js +26 -0
- package/components/i18n/messages.json +53 -0
- package/components/icon/icon.css +100 -0
- package/components/icon/icon.d.ts +43 -0
- package/components/icon/icon.js +69 -0
- package/components/icon/icon__constants.d.ts +30 -0
- package/components/icon/icon__constants.js +32 -0
- package/components/icon/icon__svg.d.ts +15 -0
- package/components/icon/icon__svg.js +58 -0
- package/components/icon/index.d.ts +2 -0
- package/components/icon/index.js +2 -0
- package/components/input/input-legacy.css +123 -0
- package/components/input/input.css +194 -0
- package/components/input/input.d.ts +77 -0
- package/components/input/input.js +165 -0
- package/components/input-size/input-size.css +82 -0
- package/components/input-size/input-size.stories.js +73 -0
- package/components/island/adaptive-island-hoc.d.ts +61 -0
- package/components/island/adaptive-island-hoc.js +28 -0
- package/components/island/content.d.ts +43 -0
- package/components/island/content.js +100 -0
- package/components/island/header.d.ts +8 -0
- package/components/island/header.js +78 -0
- package/components/island/island.css +131 -0
- package/components/island/island.d.ts +78 -0
- package/components/island/island.js +31 -0
- package/components/island-legacy/content-legacy.d.ts +10 -0
- package/components/island-legacy/content-legacy.js +17 -0
- package/components/island-legacy/header-legacy.d.ts +10 -0
- package/components/island-legacy/header-legacy.js +19 -0
- package/components/island-legacy/island-legacy.css +98 -0
- package/components/island-legacy/island-legacy.d.ts +12 -0
- package/components/island-legacy/island-legacy.js +19 -0
- package/components/line/line.css +14 -0
- package/components/link/clickableLink.d.ts +20 -0
- package/components/link/clickableLink.js +33 -0
- package/components/link/link.css +64 -0
- package/components/link/link.d.ts +138 -0
- package/components/link/link.js +44 -0
- package/components/list/consts.d.ts +77 -0
- package/components/list/consts.js +25 -0
- package/components/list/list.css +298 -0
- package/components/list/list.d.ts +205 -0
- package/components/list/list.js +590 -0
- package/components/list/list.stories.css +3 -0
- package/components/list/list__custom.d.ts +6 -0
- package/components/list/list__custom.js +52 -0
- package/components/list/list__hint.d.ts +15 -0
- package/components/list/list__hint.js +16 -0
- package/components/list/list__item.d.ts +8 -0
- package/components/list/list__item.js +130 -0
- package/components/list/list__link.d.ts +9 -0
- package/components/list/list__link.js +43 -0
- package/components/list/list__separator.d.ts +5 -0
- package/components/list/list__separator.js +21 -0
- package/components/list/list__title.d.ts +5 -0
- package/components/list/list__title.js +28 -0
- package/components/list/list__users-groups-source.d.ts +27 -0
- package/components/list/list__users-groups-source.js +74 -0
- package/components/loader/loader.css +27 -0
- package/components/loader/loader.d.ts +28 -0
- package/components/loader/loader.js +44 -0
- package/components/loader/loader__core.d.ts +75 -0
- package/components/loader/loader__core.js +219 -0
- package/components/loader-inline/loader-inline.css +73 -0
- package/components/loader-inline/loader-inline.d.ts +18 -0
- package/components/loader-inline/loader-inline.js +27 -0
- package/components/loader-screen/loader-screen.css +29 -0
- package/components/loader-screen/loader-screen.d.ts +17 -0
- package/components/loader-screen/loader-screen.js +25 -0
- package/components/login-dialog/login-dialog.css +23 -0
- package/components/login-dialog/login-dialog.d.ts +47 -0
- package/components/login-dialog/login-dialog.js +84 -0
- package/components/login-dialog/service.d.ts +2 -0
- package/components/login-dialog/service.js +24 -0
- package/components/markdown/markdown.css +126 -0
- package/components/markdown/markdown.d.ts +12 -0
- package/components/markdown/markdown.js +25 -0
- package/components/message/message.css +61 -0
- package/components/message/message.d.ts +55 -0
- package/components/message/message.js +129 -0
- package/components/old-browsers-message/old-browsers-message.css +26 -0
- package/components/old-browsers-message/old-browsers-message.d.ts +2 -0
- package/components/old-browsers-message/old-browsers-message.js +83 -0
- package/components/old-browsers-message/old-browsers-message__stop.d.ts +1 -0
- package/components/old-browsers-message/old-browsers-message__stop.js +2 -0
- package/components/old-browsers-message/white-list.d.ts +2 -0
- package/components/old-browsers-message/white-list.js +25 -0
- package/components/pager/pager.css +19 -0
- package/components/pager/pager.d.ts +78 -0
- package/components/pager/pager.js +223 -0
- package/components/palette/palette.css +216 -0
- package/components/panel/panel.css +20 -0
- package/components/panel/panel.d.ts +12 -0
- package/components/panel/panel.js +20 -0
- package/components/permissions/permissions.d.ts +111 -0
- package/components/permissions/permissions.js +177 -0
- package/components/permissions/permissions__cache.d.ts +93 -0
- package/components/permissions/permissions__cache.js +228 -0
- package/components/popup/popup.consts.d.ts +37 -0
- package/components/popup/popup.consts.js +45 -0
- package/components/popup/popup.css +34 -0
- package/components/popup/popup.d.ts +147 -0
- package/components/popup/popup.js +312 -0
- package/components/popup/popup.target.d.ts +7 -0
- package/components/popup/popup.target.js +15 -0
- package/components/popup/position.d.ts +30 -0
- package/components/popup/position.js +202 -0
- package/components/popup-menu/popup-menu.d.ts +80 -0
- package/components/popup-menu/popup-menu.js +41 -0
- package/components/progress-bar/progress-bar.css +82 -0
- package/components/progress-bar/progress-bar.d.ts +64 -0
- package/components/progress-bar/progress-bar.js +76 -0
- package/components/query-assist/query-assist.css +275 -0
- package/components/query-assist/query-assist.d.ts +306 -0
- package/components/query-assist/query-assist.js +847 -0
- package/components/query-assist/query-assist__suggestions.d.ts +29 -0
- package/components/query-assist/query-assist__suggestions.js +60 -0
- package/components/radio/radio.css +122 -0
- package/components/radio/radio.d.ts +18 -0
- package/components/radio/radio.js +27 -0
- package/components/radio/radio__item.d.ts +28 -0
- package/components/radio/radio__item.js +41 -0
- package/components/select/select-popup.css +103 -0
- package/components/select/select.css +235 -0
- package/components/select/select.d.ts +276 -0
- package/components/select/select.js +957 -0
- package/components/select/select__filter.d.ts +19 -0
- package/components/select/select__filter.js +49 -0
- package/components/select/select__popup.d.ts +166 -0
- package/components/select/select__popup.js +408 -0
- package/components/shortcuts/core.d.ts +74 -0
- package/components/shortcuts/core.js +191 -0
- package/components/shortcuts/shortcut-title.d.ts +1 -0
- package/components/shortcuts/shortcut-title.js +50 -0
- package/components/shortcuts/shortcuts-hoc.d.ts +65 -0
- package/components/shortcuts/shortcuts-hoc.js +19 -0
- package/components/shortcuts/shortcuts.d.ts +28 -0
- package/components/shortcuts/shortcuts.js +50 -0
- package/components/sidebar/sidebar.css +157 -0
- package/components/storage/storage.d.ts +18 -0
- package/components/storage/storage.js +22 -0
- package/components/storage/storage__fallback.d.ts +79 -0
- package/components/storage/storage__fallback.js +181 -0
- package/components/storage/storage__local.d.ts +38 -0
- package/components/storage/storage__local.js +119 -0
- package/components/tab-trap/tab-trap.css +6 -0
- package/components/tab-trap/tab-trap.d.ts +43 -0
- package/components/tab-trap/tab-trap.js +125 -0
- package/components/table/cell.d.ts +13 -0
- package/components/table/cell.js +16 -0
- package/components/table/disable-hover-hoc.d.ts +64 -0
- package/components/table/disable-hover-hoc.js +32 -0
- package/components/table/header-cell.d.ts +43 -0
- package/components/table/header-cell.js +56 -0
- package/components/table/header.d.ts +56 -0
- package/components/table/header.js +67 -0
- package/components/table/multitable.d.ts +25 -0
- package/components/table/multitable.js +81 -0
- package/components/table/row-with-focus-sensor.d.ts +18 -0
- package/components/table/row-with-focus-sensor.js +25 -0
- package/components/table/row.d.ts +59 -0
- package/components/table/row.js +154 -0
- package/components/table/selection-adapter.d.ts +5 -0
- package/components/table/selection-adapter.js +10 -0
- package/components/table/selection-shortcuts-hoc.d.ts +17 -0
- package/components/table/selection-shortcuts-hoc.js +146 -0
- package/components/table/selection.d.ts +47 -0
- package/components/table/selection.js +150 -0
- package/components/table/smart-table.d.ts +64 -0
- package/components/table/smart-table.js +40 -0
- package/components/table/table.css +259 -0
- package/components/table/table.d.ts +159 -0
- package/components/table/table.examples2.json +19 -0
- package/components/table/table.js +231 -0
- package/components/table/table.stories.json +45 -0
- package/components/table-legacy/table-legacy.css +346 -0
- package/components/table-legacy/table-legacy__toolbar.css +25 -0
- package/components/tabs/collapsible-more.d.ts +29 -0
- package/components/tabs/collapsible-more.js +97 -0
- package/components/tabs/collapsible-tab.d.ts +16 -0
- package/components/tabs/collapsible-tab.js +34 -0
- package/components/tabs/collapsible-tabs.d.ts +43 -0
- package/components/tabs/collapsible-tabs.js +196 -0
- package/components/tabs/custom-item.d.ts +9 -0
- package/components/tabs/custom-item.js +5 -0
- package/components/tabs/dumb-tabs.d.ts +35 -0
- package/components/tabs/dumb-tabs.js +56 -0
- package/components/tabs/smart-tabs.d.ts +20 -0
- package/components/tabs/smart-tabs.js +25 -0
- package/components/tabs/tab-link.d.ts +18 -0
- package/components/tabs/tab-link.js +24 -0
- package/components/tabs/tab.d.ts +27 -0
- package/components/tabs/tab.js +19 -0
- package/components/tabs/tabs.css +223 -0
- package/components/tabs/tabs.d.ts +7 -0
- package/components/tabs/tabs.js +7 -0
- package/components/tag/tag.css +184 -0
- package/components/tag/tag.d.ts +64 -0
- package/components/tag/tag.js +130 -0
- package/components/tags-input/tags-input.css +100 -0
- package/components/tags-input/tags-input.d.ts +138 -0
- package/components/tags-input/tags-input.js +275 -0
- package/components/tags-list/tags-list.d.ts +46 -0
- package/components/tags-list/tags-list.js +45 -0
- package/components/text/text.css +21 -0
- package/components/text/text.d.ts +23 -0
- package/components/text/text.js +31 -0
- package/components/toggle/toggle.css +198 -0
- package/components/toggle/toggle.d.ts +39 -0
- package/components/toggle/toggle.js +46 -0
- package/components/tooltip/tooltip.css +17 -0
- package/components/tooltip/tooltip.d.ts +65 -0
- package/components/tooltip/tooltip.js +126 -0
- package/components/user-agreement/service.d.ts +69 -0
- package/components/user-agreement/service.js +242 -0
- package/components/user-agreement/toolbox.eula.d.ts +2 -0
- package/components/user-agreement/toolbox.eula.js +160 -0
- package/components/user-agreement/user-agreement.css +29 -0
- package/components/user-agreement/user-agreement.d.ts +60 -0
- package/components/user-agreement/user-agreement.js +80 -0
- package/components/user-card/card.d.ts +70 -0
- package/components/user-card/card.js +89 -0
- package/components/user-card/smart-user-card-tooltip.d.ts +20 -0
- package/components/user-card/smart-user-card-tooltip.js +47 -0
- package/components/user-card/tooltip.d.ts +36 -0
- package/components/user-card/tooltip.js +43 -0
- package/components/user-card/user-card.css +123 -0
- package/components/user-card/user-card.d.ts +11 -0
- package/components/user-card/user-card.js +11 -0
- package/package.json +61 -61
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React, { ReactElement, ReactNodeArray, HTMLAttributes, SyntheticEvent } from 'react';
|
|
2
|
+
import { SelectHandlerParams } from '../list/list';
|
|
3
|
+
import { AnchorProps, DropdownAttrs } from '../dropdown/dropdown';
|
|
4
|
+
import PopupMenu, { PopupMenuAttrs } from '../popup-menu/popup-menu';
|
|
5
|
+
import { ListDataItem } from '../list/consts';
|
|
6
|
+
export interface DropdownAnchorWrapperProps extends AnchorProps {
|
|
7
|
+
anchor: ReactElement | ReactNodeArray | string | ((props: AnchorProps, ariaProps: HTMLAttributes<HTMLElement>) => ReactElement | null);
|
|
8
|
+
activeListItemId?: string | null | undefined;
|
|
9
|
+
listId?: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface DropdownMenuProps<T = unknown> extends Omit<DropdownAttrs, 'anchor' | 'onSelect' | 'children'> {
|
|
12
|
+
anchor: ReactElement | ReactNodeArray | string | ((props: AnchorProps, ariaProps: HTMLAttributes<HTMLElement>) => ReactElement | null);
|
|
13
|
+
data?: readonly ListDataItem<T>[] | undefined;
|
|
14
|
+
ariaLabel?: string | null | undefined;
|
|
15
|
+
onSelect?: ((item: ListDataItem<T>, event: Event | SyntheticEvent, params?: SelectHandlerParams) => void) | undefined;
|
|
16
|
+
menuProps?: PopupMenuAttrs<T> | null | undefined;
|
|
17
|
+
}
|
|
18
|
+
declare const _default: (<T = unknown>(props: DropdownMenuProps<T> & {
|
|
19
|
+
ref?: React.Ref<PopupMenu<unknown>> | undefined;
|
|
20
|
+
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & {
|
|
21
|
+
ListProps: {
|
|
22
|
+
Type: typeof import("../list/consts").Type;
|
|
23
|
+
Dimension: {
|
|
24
|
+
ITEM_PADDING: number;
|
|
25
|
+
ITEM_HEIGHT: number;
|
|
26
|
+
COMPACT_ITEM_HEIGHT: number;
|
|
27
|
+
SEPARATOR_HEIGHT: number;
|
|
28
|
+
SEPARATOR_FIRST_HEIGHT: number;
|
|
29
|
+
SEPARATOR_TEXT_HEIGHT: number;
|
|
30
|
+
TITLE_HEIGHT: number;
|
|
31
|
+
INNER_PADDING: number;
|
|
32
|
+
MARGIN: number;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React, { useMemo, cloneElement } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import List, { ActiveItemContext } from '../list/list';
|
|
4
|
+
import Dropdown from '../dropdown/dropdown';
|
|
5
|
+
import PopupMenu from '../popup-menu/popup-menu';
|
|
6
|
+
import getUID from '../global/get-uid';
|
|
7
|
+
import Anchor from '../dropdown/anchor';
|
|
8
|
+
import { isArray } from '../global/typescript-utils';
|
|
9
|
+
const { children, ...dropdownPropTypes } = Dropdown.propTypes || {};
|
|
10
|
+
const { id: idPropType, data: dataPropType, ariaLabel: ariaLabelPropType, onSelect: onSelectPropType } = PopupMenu.propTypes || {};
|
|
11
|
+
const defaultAriaLabel = 'Dropdown menu';
|
|
12
|
+
function DropdownAnchorWrapper({ anchor, pinned, active, activeListItemId, listId, ...restProps }) {
|
|
13
|
+
const anchorAriaProps = useMemo(() => ({
|
|
14
|
+
...(listId ? { 'aria-haspopup': true } : {}),
|
|
15
|
+
...(activeListItemId ? { 'aria-activedescendant': activeListItemId, 'aria-owns': listId } : {}),
|
|
16
|
+
...(active ? { 'aria-expanded': true } : {})
|
|
17
|
+
}), [active, activeListItemId, listId]);
|
|
18
|
+
const anchorProps = useMemo(() => ({ active, pinned, ...restProps, ...anchorAriaProps }), [pinned, active, restProps, anchorAriaProps]);
|
|
19
|
+
const anchorComponentProps = useMemo(() => ({ ...anchorProps, pinned: `${anchorProps.pinned}` }), [anchorProps]);
|
|
20
|
+
if (typeof anchor === 'string') {
|
|
21
|
+
return (<Anchor {...anchorComponentProps}>{anchor}</Anchor>);
|
|
22
|
+
}
|
|
23
|
+
if (typeof anchor === 'function') {
|
|
24
|
+
return anchor(({ active, pinned, ...restProps }), anchorAriaProps);
|
|
25
|
+
}
|
|
26
|
+
if (!isArray(anchor)) {
|
|
27
|
+
return cloneElement(anchor, typeof anchor.type === 'string' ? anchorAriaProps : anchorComponentProps);
|
|
28
|
+
}
|
|
29
|
+
return (<div {...anchorAriaProps}>{anchor}</div>);
|
|
30
|
+
}
|
|
31
|
+
DropdownAnchorWrapper.propTypes = {
|
|
32
|
+
anchor: PropTypes.oneOfType([PropTypes.node, PropTypes.string, PropTypes.func]).isRequired,
|
|
33
|
+
pinned: PropTypes.bool,
|
|
34
|
+
active: PropTypes.bool,
|
|
35
|
+
activeListItemId: PropTypes.string,
|
|
36
|
+
listId: PropTypes.string
|
|
37
|
+
};
|
|
38
|
+
const DropdownMenu = React.forwardRef(function DropdownMenu({ id, anchor, ariaLabel, data, onSelect, menuProps, ...restDropdownProps }, forwardedRef) {
|
|
39
|
+
const listId = useMemo(() => id || getUID('dropdown-menu-list'), [id]);
|
|
40
|
+
return (<ActiveItemContext.Provider>
|
|
41
|
+
<Dropdown anchor={({ pinned, active, ...restAnchorProps }) => (<ActiveItemContext.ValueContext.Consumer>
|
|
42
|
+
{activeItemId => (<DropdownAnchorWrapper anchor={anchor} pinned={pinned} active={active} activeListItemId={activeItemId} listId={listId} {...restAnchorProps}/>)}
|
|
43
|
+
</ActiveItemContext.ValueContext.Consumer>)} {...restDropdownProps}>
|
|
44
|
+
<PopupMenu ref={forwardedRef} id={listId} ariaLabel={ariaLabel || defaultAriaLabel} closeOnSelect activateFirstItem data={data} onSelect={onSelect} {...menuProps}/>
|
|
45
|
+
</Dropdown>
|
|
46
|
+
</ActiveItemContext.Provider>);
|
|
47
|
+
});
|
|
48
|
+
DropdownMenu.propTypes = {
|
|
49
|
+
id: idPropType,
|
|
50
|
+
data: dataPropType,
|
|
51
|
+
ariaLabel: ariaLabelPropType,
|
|
52
|
+
onSelect: onSelectPropType,
|
|
53
|
+
menuProps: PropTypes.object,
|
|
54
|
+
...dropdownPropTypes
|
|
55
|
+
};
|
|
56
|
+
export default Object.assign(DropdownMenu, { ListProps: List.ListProps });
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
.editableHeading {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
|
|
5
|
+
min-width: 0;
|
|
6
|
+
|
|
7
|
+
&.fullSize {
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&.isEditing {
|
|
12
|
+
gap: var(--ring-unit);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.headingWrapperButton {
|
|
17
|
+
min-width: 0;
|
|
18
|
+
max-width: 100%;
|
|
19
|
+
margin: 0;
|
|
20
|
+
padding: 0;
|
|
21
|
+
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
user-select: text;
|
|
24
|
+
|
|
25
|
+
text-align: inherit;
|
|
26
|
+
|
|
27
|
+
color: inherit;
|
|
28
|
+
|
|
29
|
+
border: none;
|
|
30
|
+
border-radius: var(--ring-border-radius);
|
|
31
|
+
outline: none;
|
|
32
|
+
background: inherit;
|
|
33
|
+
|
|
34
|
+
font-size: inherit;
|
|
35
|
+
|
|
36
|
+
.disabled &,
|
|
37
|
+
.selectionMode & {
|
|
38
|
+
user-select: text;
|
|
39
|
+
|
|
40
|
+
border-radius: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&:focus-visible {
|
|
44
|
+
box-shadow: 0 0 0 2px var(--ring-border-hover-color);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.disabled &:focus,
|
|
48
|
+
.selectionMode &:focus {
|
|
49
|
+
box-shadow: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&:hover {
|
|
53
|
+
background-color: var(--ring-hover-background-color);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.disabled &:hover,
|
|
57
|
+
.selectionMode &:hover {
|
|
58
|
+
cursor: initial;
|
|
59
|
+
|
|
60
|
+
background-color: initial;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.heading {
|
|
65
|
+
display: -webkit-box;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
|
|
68
|
+
-webkit-line-clamp: 1;
|
|
69
|
+
-webkit-box-orient: vertical;
|
|
70
|
+
|
|
71
|
+
word-break: break-all;
|
|
72
|
+
|
|
73
|
+
border-radius: var(--ring-border-radius);
|
|
74
|
+
|
|
75
|
+
.multiline & {
|
|
76
|
+
-webkit-line-clamp: 3;
|
|
77
|
+
|
|
78
|
+
word-break: break-word;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.heading.heading,
|
|
83
|
+
.heading.heading:first-child {
|
|
84
|
+
margin: 6px 0;
|
|
85
|
+
|
|
86
|
+
line-height: 28px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.input {
|
|
90
|
+
margin-bottom: 2px;
|
|
91
|
+
padding: 0;
|
|
92
|
+
padding-top: 6px;
|
|
93
|
+
padding-bottom: 3px;
|
|
94
|
+
|
|
95
|
+
color: var(--ring-heading-color);
|
|
96
|
+
caret-color: var(--ring-main-color);
|
|
97
|
+
|
|
98
|
+
border: none;
|
|
99
|
+
border-bottom: 1px solid var(--ring-borders-color);
|
|
100
|
+
outline: none;
|
|
101
|
+
background-color: transparent;
|
|
102
|
+
|
|
103
|
+
font-family: var(--ring-font-family);
|
|
104
|
+
font-weight: bold;
|
|
105
|
+
line-height: 28px;
|
|
106
|
+
|
|
107
|
+
&::placeholder {
|
|
108
|
+
color: var(--ring-disabled-color);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&:focus {
|
|
112
|
+
margin-bottom: 1px;
|
|
113
|
+
|
|
114
|
+
border-bottom-width: 2px;
|
|
115
|
+
border-bottom-color: var(--ring-main-color);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&[disabled] {
|
|
119
|
+
background-color: initial;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.error & {
|
|
123
|
+
margin-bottom: 1px;
|
|
124
|
+
|
|
125
|
+
border-bottom-width: 2px;
|
|
126
|
+
border-bottom-color: var(--ring-icon-error-color);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.textarea {
|
|
131
|
+
resize: none;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.textareaNotOverflow {
|
|
135
|
+
overflow: hidden;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.textareaFade {
|
|
139
|
+
position: absolute;
|
|
140
|
+
bottom: 0;
|
|
141
|
+
left: 0;
|
|
142
|
+
|
|
143
|
+
width: 100%;
|
|
144
|
+
height: 30px;
|
|
145
|
+
|
|
146
|
+
content: "";
|
|
147
|
+
pointer-events: none;
|
|
148
|
+
|
|
149
|
+
background: linear-gradient(to bottom, rgba(var(--ring-content-background-components), 0), rgba(var(--ring-content-background-components), 1));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
.textareaWrapper {
|
|
154
|
+
position: relative;
|
|
155
|
+
|
|
156
|
+
display: flex;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.button {
|
|
160
|
+
margin: 6px 0;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.errorText {
|
|
164
|
+
margin: calc(var(--ring-unit) / 2) 0;
|
|
165
|
+
|
|
166
|
+
color: var(--ring-error-color);
|
|
167
|
+
|
|
168
|
+
font-size: var(--ring-font-size-smaller);
|
|
169
|
+
line-height: var(--ring-line-height-lowest);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.level1 {
|
|
173
|
+
font-size: 24px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.level2 {
|
|
177
|
+
font-size: 20px;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.level3 {
|
|
181
|
+
font-size: 16px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.sizeS {
|
|
185
|
+
max-width: calc(var(--ring-unit) * 12);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.sizeM {
|
|
189
|
+
max-width: calc(var(--ring-unit) * 30);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.sizeL {
|
|
193
|
+
max-width: calc(var(--ring-unit) * 50);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.sizeFULL {
|
|
197
|
+
max-width: 100%;
|
|
198
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React, { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { Levels } from '../heading/heading';
|
|
3
|
+
import { Size } from '../input/input';
|
|
4
|
+
export { Levels };
|
|
5
|
+
export { Size };
|
|
6
|
+
export interface EditableHeadingTranslations {
|
|
7
|
+
save: string;
|
|
8
|
+
cancel: string;
|
|
9
|
+
}
|
|
10
|
+
export type EditableHeadingProps = Omit<InputHTMLAttributes<HTMLInputElement | HTMLTextAreaElement>, 'value' | 'size'> & {
|
|
11
|
+
level?: Levels;
|
|
12
|
+
headingClassName?: string | null;
|
|
13
|
+
inputClassName?: string | null;
|
|
14
|
+
isEditing?: boolean;
|
|
15
|
+
isSavingPossible?: boolean;
|
|
16
|
+
isSaving?: boolean;
|
|
17
|
+
children?: string;
|
|
18
|
+
embedded?: boolean;
|
|
19
|
+
size?: Size;
|
|
20
|
+
onEdit?: () => void;
|
|
21
|
+
onSave?: () => void;
|
|
22
|
+
onCancel?: () => void;
|
|
23
|
+
'data-test'?: string | null;
|
|
24
|
+
error?: string;
|
|
25
|
+
multiline?: boolean;
|
|
26
|
+
maxInputRows?: number;
|
|
27
|
+
renderMenu?: () => React.ReactNode;
|
|
28
|
+
translations?: EditableHeadingTranslations;
|
|
29
|
+
};
|
|
30
|
+
export declare const EditableHeading: (props: EditableHeadingProps) => React.JSX.Element;
|
|
31
|
+
declare const _default: React.MemoExoticComponent<(props: EditableHeadingProps) => React.JSX.Element>;
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import React, { useCallback, useEffect } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import Heading, { Levels } from '../heading/heading';
|
|
4
|
+
import Button from '../button/button';
|
|
5
|
+
import { Size } from '../input/input';
|
|
6
|
+
import inputStyles from '../input/input.css';
|
|
7
|
+
import getUID from '../global/get-uid';
|
|
8
|
+
import Shortcuts from '../shortcuts/shortcuts';
|
|
9
|
+
import styles from './editable-heading.css';
|
|
10
|
+
export { Levels };
|
|
11
|
+
export { Size };
|
|
12
|
+
function noop() { }
|
|
13
|
+
export const EditableHeading = (props) => {
|
|
14
|
+
const { level = Levels.H1, className, headingClassName, inputClassName, children, isEditing = false, isSavingPossible = false, isSaving = false, embedded = false, size = Size.L, onEdit = noop, onSave = noop, onCancel = noop, autoFocus = true, 'data-test': dataTest, error, disabled, multiline = false, renderMenu = () => null, onFocus, onBlur, onChange, onScroll, maxInputRows, translations = {
|
|
15
|
+
save: 'Save',
|
|
16
|
+
cancel: 'Cancel'
|
|
17
|
+
}, ...restProps } = props;
|
|
18
|
+
const [shortcutsScope] = React.useState(getUID('ring-editable-heading-'));
|
|
19
|
+
const [isInFocus, setIsInFocus] = React.useState(false);
|
|
20
|
+
const [isMouseDown, setIsMouseDown] = React.useState(false);
|
|
21
|
+
const [isInSelectionMode, setIsInSelectionMode] = React.useState(false);
|
|
22
|
+
const textAreaRef = React.useRef(null);
|
|
23
|
+
const [isScrolledToBottom, setIsScrolledToBottom] = React.useState(false);
|
|
24
|
+
const [isOverflow, setIsOverflow] = React.useState(false);
|
|
25
|
+
const hasError = error !== undefined;
|
|
26
|
+
const isSaveDisabled = !isSavingPossible || !children || children.trim() === '' || hasError || isSaving;
|
|
27
|
+
const isCancelDisabled = isSaving;
|
|
28
|
+
const isShortcutsDisabled = !isInFocus || isSaving;
|
|
29
|
+
const shortcutsMap = React.useMemo(() => {
|
|
30
|
+
const map = {};
|
|
31
|
+
if (!isSaveDisabled) {
|
|
32
|
+
map.enter = onSave;
|
|
33
|
+
}
|
|
34
|
+
if (isCancelDisabled) {
|
|
35
|
+
map.esc = onCancel;
|
|
36
|
+
}
|
|
37
|
+
return map;
|
|
38
|
+
}, [isSaveDisabled, isCancelDisabled, onSave, onCancel]);
|
|
39
|
+
const classes = classNames(styles.editableHeading, className, {
|
|
40
|
+
[styles.fullSize]: isEditing && size === Size.FULL,
|
|
41
|
+
[styles.isEditing]: isEditing,
|
|
42
|
+
[styles.error]: hasError,
|
|
43
|
+
[styles.disabled]: disabled,
|
|
44
|
+
[styles.multiline]: multiline,
|
|
45
|
+
[styles.selectionMode]: isInSelectionMode
|
|
46
|
+
});
|
|
47
|
+
const headingClasses = classNames(styles.heading, headingClassName, styles[`size${size}`]);
|
|
48
|
+
const inputClasses = classNames('ring-js-shortcuts', styles.input, styles.textarea, { [styles.textareaNotOverflow]: !isOverflow }, inputStyles[`size${size}`], styles[`level${level}`], inputClassName);
|
|
49
|
+
const stretch = useCallback((el) => {
|
|
50
|
+
if (!el || !el.style) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
el.style.height = '0';
|
|
54
|
+
const { paddingTop, paddingBottom } = window.getComputedStyle(el);
|
|
55
|
+
el.style.height = `${el.scrollHeight - parseFloat(paddingTop) - parseFloat(paddingBottom)}px`;
|
|
56
|
+
}, []);
|
|
57
|
+
const checkValue = useCallback((el) => {
|
|
58
|
+
if (multiline && el != null && el.scrollHeight >= el.clientHeight) {
|
|
59
|
+
stretch(el);
|
|
60
|
+
}
|
|
61
|
+
}, [stretch, multiline]);
|
|
62
|
+
const checkOverflow = useCallback((el) => {
|
|
63
|
+
const scrollHeight = el.scrollHeight || 0;
|
|
64
|
+
const clientHeight = el.clientHeight || 0;
|
|
65
|
+
const scrollTop = el.scrollTop || 0;
|
|
66
|
+
setIsScrolledToBottom(scrollHeight - clientHeight <= scrollTop);
|
|
67
|
+
setIsOverflow(scrollHeight > clientHeight);
|
|
68
|
+
}, [setIsScrolledToBottom]);
|
|
69
|
+
const onHeadingMouseDown = React.useCallback(() => {
|
|
70
|
+
setIsMouseDown(true);
|
|
71
|
+
}, []);
|
|
72
|
+
const onMouseMove = React.useCallback(() => {
|
|
73
|
+
if (!isMouseDown) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
setIsInSelectionMode(true);
|
|
77
|
+
}, [isMouseDown]);
|
|
78
|
+
const onMouseUp = React.useCallback(() => {
|
|
79
|
+
if (isMouseDown && !isInSelectionMode && !disabled) {
|
|
80
|
+
onEdit();
|
|
81
|
+
}
|
|
82
|
+
setIsMouseDown(false);
|
|
83
|
+
setIsInSelectionMode(false);
|
|
84
|
+
}, [isMouseDown, isInSelectionMode, disabled, onEdit]);
|
|
85
|
+
const onInputFocus = React.useCallback((e) => {
|
|
86
|
+
setIsInFocus(true);
|
|
87
|
+
checkValue(e.target);
|
|
88
|
+
checkOverflow(e.target);
|
|
89
|
+
onFocus?.(e);
|
|
90
|
+
}, [onFocus, checkOverflow, checkValue]);
|
|
91
|
+
const onInputChange = React.useCallback((e) => {
|
|
92
|
+
checkValue(e.target);
|
|
93
|
+
checkOverflow(e.target);
|
|
94
|
+
onChange?.(e);
|
|
95
|
+
}, [onChange, checkOverflow, checkValue]);
|
|
96
|
+
const onInputScroll = React.useCallback((e) => {
|
|
97
|
+
checkOverflow(e.target);
|
|
98
|
+
onScroll?.(e);
|
|
99
|
+
}, [onScroll, checkOverflow]);
|
|
100
|
+
const onInputBlur = React.useCallback((e) => {
|
|
101
|
+
setIsInFocus(false);
|
|
102
|
+
onBlur?.(e);
|
|
103
|
+
}, [onBlur]);
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
window.addEventListener('mousemove', onMouseMove);
|
|
106
|
+
window.addEventListener('mouseup', onMouseUp);
|
|
107
|
+
return () => {
|
|
108
|
+
window.removeEventListener('mousemove', onMouseMove);
|
|
109
|
+
window.removeEventListener('mouseup', onMouseUp);
|
|
110
|
+
};
|
|
111
|
+
}, [onMouseMove, onMouseUp]);
|
|
112
|
+
return (<>
|
|
113
|
+
<div className={classes}>
|
|
114
|
+
{!disabled && isEditing
|
|
115
|
+
? (<>
|
|
116
|
+
<Shortcuts map={shortcutsMap} scope={shortcutsScope} disabled={isShortcutsDisabled}/>
|
|
117
|
+
|
|
118
|
+
{!multiline
|
|
119
|
+
? (<input className={inputClasses} value={children} autoFocus={autoFocus} data-test={dataTest} disabled={isSaving} onChange={onChange} {...restProps} onFocus={onInputFocus} onBlur={onInputBlur}/>)
|
|
120
|
+
: (<div className={classNames(styles.textareaWrapper, inputStyles[`size${size}`])}>
|
|
121
|
+
<textarea ref={textAreaRef} className={inputClasses} value={children} autoFocus={autoFocus} data-test={dataTest} disabled={isSaving} onChange={onInputChange} {...restProps} onFocus={onInputFocus} onBlur={onInputBlur} onScroll={onInputScroll} style={{ maxHeight: maxInputRows ? `${maxInputRows}lh` : '' }}/>
|
|
122
|
+
{!isScrolledToBottom && <div className={styles.textareaFade}/>}
|
|
123
|
+
</div>)}
|
|
124
|
+
</>)
|
|
125
|
+
: (<button type="button" className={styles.headingWrapperButton} onMouseDown={onHeadingMouseDown}>
|
|
126
|
+
<Heading className={headingClasses} level={level} data-test={dataTest}>{children}</Heading>
|
|
127
|
+
</button>)}
|
|
128
|
+
|
|
129
|
+
{!isEditing && (renderMenu())}
|
|
130
|
+
|
|
131
|
+
{isEditing && !embedded && (<>
|
|
132
|
+
<Button className={styles.button} primary disabled={isSaveDisabled} loader={isSaving} onClick={onSave}>{translations.save}</Button>
|
|
133
|
+
|
|
134
|
+
<Button className={styles.button} disabled={isCancelDisabled} onClick={onCancel}>{translations.cancel}</Button>
|
|
135
|
+
</>)}
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
{isEditing && error && (<div className={classNames(styles.errorText, inputStyles[`size${size}`])}>{error}</div>)}
|
|
139
|
+
</>);
|
|
140
|
+
};
|
|
141
|
+
export default React.memo(EditableHeading);
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
:global(.ring-error-bubble) {
|
|
2
|
+
position: absolute;
|
|
3
|
+
z-index: 2;
|
|
4
|
+
top: 0;
|
|
5
|
+
left: calc(100% + 2px);
|
|
6
|
+
|
|
7
|
+
display: none;
|
|
8
|
+
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
min-height: calc(3 * var(--ring-unit));
|
|
11
|
+
padding-right: calc(2 * var(--ring-unit));
|
|
12
|
+
padding-left: calc(2 * var(--ring-unit));
|
|
13
|
+
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
|
|
16
|
+
color: var(--ring-error-color);
|
|
17
|
+
border: 1px solid var(--ring-popup-border-color);
|
|
18
|
+
|
|
19
|
+
border-radius: var(--ring-border-radius);
|
|
20
|
+
background: var(--ring-popup-background-color);
|
|
21
|
+
box-shadow: var(--ring-popup-shadow);
|
|
22
|
+
|
|
23
|
+
font-family: var(--ring-font-family);
|
|
24
|
+
|
|
25
|
+
font-size: 12px;
|
|
26
|
+
|
|
27
|
+
line-height: 22px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:global(.ring-error-bubble.active) {
|
|
31
|
+
display: inline-block;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:global(.ring-error-bubble::before) {
|
|
35
|
+
position: absolute;
|
|
36
|
+
z-index: var(--ring-invisible-element-z-index);
|
|
37
|
+
top: 7px;
|
|
38
|
+
left: -5px;
|
|
39
|
+
|
|
40
|
+
display: block;
|
|
41
|
+
|
|
42
|
+
width: var(--ring-unit);
|
|
43
|
+
height: var(--ring-unit);
|
|
44
|
+
|
|
45
|
+
content: "";
|
|
46
|
+
transform: rotate(45deg);
|
|
47
|
+
|
|
48
|
+
border: 1px solid var(--ring-popup-border-color);
|
|
49
|
+
border-top: none;
|
|
50
|
+
border-right: none;
|
|
51
|
+
|
|
52
|
+
background: var(--ring-popup-background-color);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:global(.ring-error-bubble_material) {
|
|
56
|
+
padding-left: var(--ring-unit);
|
|
57
|
+
|
|
58
|
+
border: 0;
|
|
59
|
+
background: transparent none;
|
|
60
|
+
box-shadow: none;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:global(.ring-error-bubble_material::before) {
|
|
64
|
+
display: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:global(.ring-form__control .ring-error-bubble) {
|
|
68
|
+
top: 1px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* .ring-error-bubble requires a position: relative container.
|
|
73
|
+
* Use this class if your markup doesn't have one.
|
|
74
|
+
*/
|
|
75
|
+
:global(.ring-error-bubble-wrapper) {
|
|
76
|
+
position: relative;
|
|
77
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
@import "../global/variables.css";
|
|
2
|
+
|
|
3
|
+
.errorBubblePopup {
|
|
4
|
+
overflow: visible;
|
|
5
|
+
|
|
6
|
+
margin-left: 2px;
|
|
7
|
+
|
|
8
|
+
border: none;
|
|
9
|
+
|
|
10
|
+
box-shadow: none;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.errorBubbleWrapper {
|
|
14
|
+
display: inline-block;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.errorBubble {
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
min-height: calc(var(--ring-unit) * 3);
|
|
20
|
+
padding-right: calc(var(--ring-unit) * 2);
|
|
21
|
+
padding-left: calc(var(--ring-unit) * 2);
|
|
22
|
+
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
|
|
25
|
+
color: var(--ring-error-color);
|
|
26
|
+
|
|
27
|
+
border: 1px solid var(--ring-popup-border-color);
|
|
28
|
+
border-radius: var(--ring-border-radius);
|
|
29
|
+
|
|
30
|
+
background: var(--ring-popup-background-color);
|
|
31
|
+
box-shadow: var(--ring-popup-shadow);
|
|
32
|
+
|
|
33
|
+
font-size: 12px;
|
|
34
|
+
line-height: 22px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.errorBubble::before {
|
|
38
|
+
position: absolute;
|
|
39
|
+
top: var(--ring-unit);
|
|
40
|
+
left: -4px;
|
|
41
|
+
|
|
42
|
+
display: block;
|
|
43
|
+
|
|
44
|
+
width: var(--ring-unit);
|
|
45
|
+
height: var(--ring-unit);
|
|
46
|
+
|
|
47
|
+
content: "";
|
|
48
|
+
transform: rotate(45deg);
|
|
49
|
+
|
|
50
|
+
border: 1px solid var(--ring-popup-border-color);
|
|
51
|
+
border-top: none;
|
|
52
|
+
border-right: none;
|
|
53
|
+
background: var(--ring-popup-background-color);
|
|
54
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { PureComponent, ReactElement } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
export type ErrorBubbleProps<P> = Partial<P> & {
|
|
4
|
+
className?: string | null | undefined;
|
|
5
|
+
children: ReactElement<P> | ReactElement<P>[];
|
|
6
|
+
error?: string | null | undefined;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* @name Error Bubble
|
|
10
|
+
*/
|
|
11
|
+
export default class ErrorBubble<P> extends PureComponent<ErrorBubbleProps<P>> {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
error: PropTypes.Requireable<string>;
|
|
14
|
+
className: PropTypes.Requireable<string>;
|
|
15
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
16
|
+
};
|
|
17
|
+
render(): React.JSX.Element;
|
|
18
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React, { Children, cloneElement, PureComponent } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import Popup from '../popup/popup';
|
|
5
|
+
import { Directions } from '../popup/popup.consts';
|
|
6
|
+
import styles from './error-bubble.css';
|
|
7
|
+
/**
|
|
8
|
+
* @name Error Bubble
|
|
9
|
+
*/
|
|
10
|
+
export default class ErrorBubble extends PureComponent {
|
|
11
|
+
static propTypes = {
|
|
12
|
+
error: PropTypes.string,
|
|
13
|
+
className: PropTypes.string,
|
|
14
|
+
children: PropTypes.node
|
|
15
|
+
};
|
|
16
|
+
render() {
|
|
17
|
+
const { children, className, ...restProps } = this.props;
|
|
18
|
+
const errorBubbleClasses = classNames(styles.errorBubble, className);
|
|
19
|
+
return (<div className={styles.errorBubbleWrapper}>
|
|
20
|
+
{Children.map(children, (child) => cloneElement(child, { ...child.props, ...restProps }))}
|
|
21
|
+
{restProps.error && (<Popup trapFocus={false} className={styles.errorBubblePopup} hidden={false} attached={false} directions={[Directions.RIGHT_CENTER, Directions.RIGHT_BOTTOM, Directions.RIGHT_TOP]}>
|
|
22
|
+
<div className={errorBubbleClasses} data-test="ring-error-bubble">
|
|
23
|
+
{restProps.error}
|
|
24
|
+
</div>
|
|
25
|
+
</Popup>)}
|
|
26
|
+
</div>);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@import "../global/variables.css";
|
|
2
|
+
|
|
3
|
+
.errorMessage {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
|
|
9
|
+
max-width: 600px;
|
|
10
|
+
height: 100%;
|
|
11
|
+
margin: 0 auto;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.title {
|
|
15
|
+
font-size: 21px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.description {
|
|
19
|
+
font-size: 15px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.content {
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
|
|
25
|
+
color: var(--ring-text-color);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.content > .title,
|
|
29
|
+
.description {
|
|
30
|
+
margin-bottom: 16px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.icon {
|
|
34
|
+
margin: 0 16px 24px 0;
|
|
35
|
+
|
|
36
|
+
color: var(--ring-icon-secondary-color);
|
|
37
|
+
}
|