@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,275 @@
|
|
|
1
|
+
import React, { Component, PureComponent } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import getEventKey from '../global/get-event-key';
|
|
5
|
+
import Select from '../select/select';
|
|
6
|
+
import TagsList from '../tags-list/tags-list';
|
|
7
|
+
import Caret from '../caret/caret';
|
|
8
|
+
import memoize from '../global/memoize';
|
|
9
|
+
import rerenderHOC from '../global/rerender-hoc';
|
|
10
|
+
import { Size } from '../input/input';
|
|
11
|
+
import { ControlsHeightContext } from '../global/controls-height';
|
|
12
|
+
import getUID from '../global/get-uid';
|
|
13
|
+
import inputStyles from '../input/input.css';
|
|
14
|
+
import ControlLabel from '../control-label/control-label';
|
|
15
|
+
import styles from './tags-input.css';
|
|
16
|
+
function noop() { }
|
|
17
|
+
/**
|
|
18
|
+
* @name Tags Input
|
|
19
|
+
*/
|
|
20
|
+
const POPUP_VERTICAL_SHIFT = 2;
|
|
21
|
+
export default class TagsInput extends PureComponent {
|
|
22
|
+
static propTypes = {
|
|
23
|
+
className: PropTypes.string,
|
|
24
|
+
tags: PropTypes.array,
|
|
25
|
+
/**
|
|
26
|
+
* Datasource should return array(or promise) of suggestions.
|
|
27
|
+
* Each suggestion should contain key and label fields.
|
|
28
|
+
* DataSource should handle caching and response racing (when later request
|
|
29
|
+
* responded earlier) by himself.
|
|
30
|
+
*/
|
|
31
|
+
dataSource: PropTypes.func,
|
|
32
|
+
onAddTag: PropTypes.func,
|
|
33
|
+
onRemoveTag: PropTypes.func,
|
|
34
|
+
customTagComponent: PropTypes.instanceOf(Component),
|
|
35
|
+
maxPopupHeight: PropTypes.number,
|
|
36
|
+
minPopupWidth: PropTypes.number,
|
|
37
|
+
placeholder: PropTypes.string,
|
|
38
|
+
canNotBeEmpty: PropTypes.bool,
|
|
39
|
+
disabled: PropTypes.bool,
|
|
40
|
+
autoOpen: PropTypes.bool,
|
|
41
|
+
renderOptimization: PropTypes.bool,
|
|
42
|
+
filter: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({ fn: PropTypes.func })]),
|
|
43
|
+
size: PropTypes.string,
|
|
44
|
+
height: PropTypes.string,
|
|
45
|
+
label: PropTypes.node,
|
|
46
|
+
loadingMessage: PropTypes.string,
|
|
47
|
+
notFoundMessage: PropTypes.string,
|
|
48
|
+
hint: PropTypes.node,
|
|
49
|
+
allowAddNewTags: PropTypes.bool
|
|
50
|
+
};
|
|
51
|
+
static defaultProps = {
|
|
52
|
+
dataSource: noop,
|
|
53
|
+
onAddTag: noop,
|
|
54
|
+
onRemoveTag: noop,
|
|
55
|
+
customTagComponent: null,
|
|
56
|
+
maxPopupHeight: 500,
|
|
57
|
+
minPopupWidth: 360,
|
|
58
|
+
canNotBeEmpty: false,
|
|
59
|
+
disabled: false,
|
|
60
|
+
autoOpen: false,
|
|
61
|
+
renderOptimization: true,
|
|
62
|
+
allowAddNewTags: false,
|
|
63
|
+
filter: { fn: () => true },
|
|
64
|
+
placeholder: 'Select an option',
|
|
65
|
+
size: Size.M
|
|
66
|
+
};
|
|
67
|
+
constructor(props) {
|
|
68
|
+
super(props);
|
|
69
|
+
this.ngModelStateField = TagsInput.ngModelStateField;
|
|
70
|
+
}
|
|
71
|
+
state = {
|
|
72
|
+
tags: [],
|
|
73
|
+
prevTags: null,
|
|
74
|
+
suggestions: [],
|
|
75
|
+
loading: true,
|
|
76
|
+
focused: false,
|
|
77
|
+
query: '',
|
|
78
|
+
activeIndex: 0
|
|
79
|
+
};
|
|
80
|
+
static getDerivedStateFromProps({ tags }, { prevTags }) {
|
|
81
|
+
const nextState = { prevTags: tags };
|
|
82
|
+
if (tags != null && tags !== prevTags) {
|
|
83
|
+
Object.assign(nextState, { tags, activeIndex: tags.length });
|
|
84
|
+
}
|
|
85
|
+
return nextState;
|
|
86
|
+
}
|
|
87
|
+
componentDidMount() {
|
|
88
|
+
if (this.props.autoOpen && !this.props.disabled) {
|
|
89
|
+
this.focusInput();
|
|
90
|
+
this.loadSuggestions();
|
|
91
|
+
this.select?._showPopup();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
static ngModelStateField = 'tags';
|
|
95
|
+
ngModelStateField;
|
|
96
|
+
static contextType = ControlsHeightContext;
|
|
97
|
+
id = this.props.id || getUID('ring-tags-list-');
|
|
98
|
+
node;
|
|
99
|
+
nodeRef = (node) => {
|
|
100
|
+
this.node = node;
|
|
101
|
+
};
|
|
102
|
+
input;
|
|
103
|
+
caret;
|
|
104
|
+
getInputNode() {
|
|
105
|
+
if (!this.input) {
|
|
106
|
+
this.input = this.select?.filter;
|
|
107
|
+
if (this.input) {
|
|
108
|
+
this.caret = new Caret(this.input);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return this.input;
|
|
112
|
+
}
|
|
113
|
+
setActiveIndex(activeIndex) {
|
|
114
|
+
this.setState({ activeIndex });
|
|
115
|
+
}
|
|
116
|
+
focusInput = () => {
|
|
117
|
+
this.getInputNode()?.focus();
|
|
118
|
+
};
|
|
119
|
+
focus = () => {
|
|
120
|
+
this.focusInput();
|
|
121
|
+
};
|
|
122
|
+
addTag = (tag) => {
|
|
123
|
+
if (tag == null) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const isUniqueTag = this.state.tags.filter(item => tag.key === item.key).length === 0;
|
|
127
|
+
this.select?.clear();
|
|
128
|
+
this.select?.filterValue('');
|
|
129
|
+
if (isUniqueTag) {
|
|
130
|
+
this.setState(prevState => ({
|
|
131
|
+
tags: prevState.tags.concat([tag])
|
|
132
|
+
}));
|
|
133
|
+
this.props.onAddTag({ tag });
|
|
134
|
+
this.setActiveIndex();
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
onRemoveTag(tagToRemove) {
|
|
138
|
+
return Promise.resolve(this.props.onRemoveTag({ tag: tagToRemove })).
|
|
139
|
+
then(() => {
|
|
140
|
+
const tags = this.state.tags.filter(tag => tag !== tagToRemove);
|
|
141
|
+
if (this.node) {
|
|
142
|
+
this.setState({ tags });
|
|
143
|
+
this.focusInput();
|
|
144
|
+
}
|
|
145
|
+
return tags;
|
|
146
|
+
}, this.focusInput);
|
|
147
|
+
}
|
|
148
|
+
clickHandler = (event) => {
|
|
149
|
+
if (event.target !== this.node && event.target.parentElement !== this.node) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
this.select?._clickHandler();
|
|
153
|
+
};
|
|
154
|
+
filterExistingTags = (suggestions) => {
|
|
155
|
+
const tagsMap = new Map(this.state.tags.map(tag => [tag.key, tag]));
|
|
156
|
+
return suggestions.filter(suggestion => !tagsMap.has(suggestion.key));
|
|
157
|
+
};
|
|
158
|
+
loadSuggestions = (query = '') => this.setState({ loading: true, query }, async () => {
|
|
159
|
+
try {
|
|
160
|
+
const suggestionsResult = this.props.dataSource({ query });
|
|
161
|
+
const allSuggestions = Array.isArray(suggestionsResult)
|
|
162
|
+
? suggestionsResult
|
|
163
|
+
: await suggestionsResult;
|
|
164
|
+
const suggestions = this.filterExistingTags(allSuggestions);
|
|
165
|
+
if (this.node && query === this.state.query) {
|
|
166
|
+
this.setState({ suggestions, loading: false });
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
catch (e) {
|
|
170
|
+
this.setState({ loading: false });
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
_focusHandler = () => {
|
|
174
|
+
this.setActiveIndex(null);
|
|
175
|
+
this.setState({ focused: true });
|
|
176
|
+
};
|
|
177
|
+
_blurHandler = () => {
|
|
178
|
+
this.setState({ focused: false });
|
|
179
|
+
};
|
|
180
|
+
selectTag = (moveForward) => {
|
|
181
|
+
const activeIndex = typeof this.state.activeIndex === 'number'
|
|
182
|
+
? this.state.activeIndex
|
|
183
|
+
: this.state.tags.length + 1;
|
|
184
|
+
let newActiveIndex = activeIndex + (moveForward ? 1 : -1);
|
|
185
|
+
if (newActiveIndex >= this.state.tags.length) {
|
|
186
|
+
newActiveIndex = this.state.tags.length - 1;
|
|
187
|
+
}
|
|
188
|
+
else if (newActiveIndex < 0) {
|
|
189
|
+
newActiveIndex = 0;
|
|
190
|
+
}
|
|
191
|
+
if (this.state.activeIndex !== newActiveIndex) {
|
|
192
|
+
this.setActiveIndex(newActiveIndex);
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
handleKeyDown = (event) => {
|
|
196
|
+
const key = getEventKey(event);
|
|
197
|
+
const isInputFocused = () => event.target instanceof Element &&
|
|
198
|
+
event.target.matches(this.getInputNode()?.tagName ?? '');
|
|
199
|
+
if (key === ' ' && this.props.allowAddNewTags) {
|
|
200
|
+
event.stopPropagation();
|
|
201
|
+
const value = this.getInputNode()?.value;
|
|
202
|
+
if (value != null && value !== '') {
|
|
203
|
+
this.handleTagCreation(value);
|
|
204
|
+
}
|
|
205
|
+
return true;
|
|
206
|
+
}
|
|
207
|
+
if (this.select?._popup?.isVisible()) {
|
|
208
|
+
return true;
|
|
209
|
+
}
|
|
210
|
+
if (key === 'ArrowLeft') {
|
|
211
|
+
if (this.getInputNode() && this.caret != null && Number(this.caret.getPosition()) > 0) {
|
|
212
|
+
return true;
|
|
213
|
+
}
|
|
214
|
+
this.selectTag();
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
if (key === 'ArrowRight' && !isInputFocused()) {
|
|
218
|
+
if (this.state.activeIndex === this.state.tags.length - 1) {
|
|
219
|
+
if (!this.props.disabled) {
|
|
220
|
+
this.getInputNode()?.focus();
|
|
221
|
+
this.setActiveIndex();
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
this.selectTag(true);
|
|
226
|
+
}
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
if (!this.props.disabled) {
|
|
230
|
+
if (key === 'Backspace' && !this.getInputNode()?.value) {
|
|
231
|
+
event.preventDefault();
|
|
232
|
+
const tagsLength = this.state.tags.length;
|
|
233
|
+
this.select?._hidePopup(true); // otherwise confirmation may be overlapped by popup
|
|
234
|
+
this.onRemoveTag(this.state.tags[tagsLength - 1]);
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
if ((key === 'Delete' || key === 'Backspace') && this.state.activeIndex != null &&
|
|
238
|
+
this.state.tags[this.state.activeIndex]) {
|
|
239
|
+
this.onRemoveTag(this.state.tags[this.state.activeIndex]).
|
|
240
|
+
then(() => this.selectTag(true));
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return true;
|
|
245
|
+
};
|
|
246
|
+
handleClick = memoize((tag) => () => {
|
|
247
|
+
this.setActiveIndex(this.state.tags.indexOf(tag));
|
|
248
|
+
});
|
|
249
|
+
handleRemove = memoize((tag) => () => this.onRemoveTag(tag));
|
|
250
|
+
handleTagCreation = (label) => {
|
|
251
|
+
this.addTag({ key: label, label });
|
|
252
|
+
};
|
|
253
|
+
select;
|
|
254
|
+
selectRef = (el) => {
|
|
255
|
+
this.select = el;
|
|
256
|
+
};
|
|
257
|
+
render() {
|
|
258
|
+
const { focused, tags, activeIndex } = this.state;
|
|
259
|
+
const { disabled, canNotBeEmpty, allowAddNewTags, filter, size, labelType, height = this.context, label } = this.props;
|
|
260
|
+
const classes = classNames(styles.tagsInput, [inputStyles[`size${size}`]], [inputStyles[`height${height}`]], {
|
|
261
|
+
[styles.tagsInputDisabled]: disabled,
|
|
262
|
+
[styles.tagsInputFocused]: focused
|
|
263
|
+
}, this.props.className);
|
|
264
|
+
return (<div
|
|
265
|
+
// it transfers focus to input
|
|
266
|
+
role="presentation" className={classes} onKeyDown={this.handleKeyDown} onClick={this.clickHandler} ref={this.nodeRef}>
|
|
267
|
+
{label && (<ControlLabel htmlFor={this.id} disabled={disabled} type={labelType}>{label}</ControlLabel>)}
|
|
268
|
+
|
|
269
|
+
<TagsList tags={tags} activeIndex={activeIndex} disabled={disabled} canNotBeEmpty={canNotBeEmpty} handleRemove={this.handleRemove} className={styles.tagsList} tagClassName={styles.tag} handleClick={this.handleClick} customTagComponent={this.props.customTagComponent}>
|
|
270
|
+
<Select id={this.id} ref={this.selectRef} size={Select.Size.AUTO} type={Select.Type.INPUT_WITHOUT_CONTROLS} inputPlaceholder={this.props.placeholder} data={this.state.suggestions} className={classNames(styles.tagsSelect)} onSelect={this.addTag} onFocus={this._focusHandler} onBlur={this._blurHandler} renderOptimization={this.props.renderOptimization} add={allowAddNewTags ? { prefix: 'Add new tag' } : undefined} onAdd={allowAddNewTags ? this.handleTagCreation : undefined} filter={filter} maxHeight={this.props.maxPopupHeight} minWidth={this.props.minPopupWidth} top={POPUP_VERTICAL_SHIFT} loading={this.state.loading} onFilter={this.loadSuggestions} onBeforeOpen={this.loadSuggestions} onKeyDown={this.handleKeyDown} disabled={this.props.disabled} loadingMessage={this.props.loadingMessage} notFoundMessage={this.props.notFoundMessage} hint={this.props.hint}/>
|
|
271
|
+
</TagsList>
|
|
272
|
+
</div>);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
export const RerenderableTagsInput = rerenderHOC(TagsInput);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React, { Component, ComponentType, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { TagAttrs } from '../tag/tag';
|
|
4
|
+
declare function noop(): void;
|
|
5
|
+
export interface TagType extends Omit<TagAttrs, 'onClick' | 'children'> {
|
|
6
|
+
label?: ReactNode;
|
|
7
|
+
key?: string | number | null | undefined;
|
|
8
|
+
}
|
|
9
|
+
export interface TagsListProps<T extends TagType> extends HTMLAttributes<HTMLElement> {
|
|
10
|
+
tags: readonly T[];
|
|
11
|
+
customTagComponent: ComponentType<TagAttrs>;
|
|
12
|
+
canNotBeEmpty: boolean;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
handleClick: (tag: T) => (e: React.MouseEvent<HTMLElement>) => void;
|
|
15
|
+
handleRemove: (tag: T) => (e: React.MouseEvent<HTMLElement>) => void;
|
|
16
|
+
activeIndex?: number | null | undefined;
|
|
17
|
+
tagClassName?: string | null | undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @name Tags List
|
|
21
|
+
*/
|
|
22
|
+
export default class TagsList<T extends TagType> extends Component<TagsListProps<T>> {
|
|
23
|
+
static propTypes: {
|
|
24
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
25
|
+
tags: PropTypes.Requireable<any[]>;
|
|
26
|
+
customTagComponent: PropTypes.Requireable<PropTypes.ReactComponentLike>;
|
|
27
|
+
activeIndex: PropTypes.Requireable<number>;
|
|
28
|
+
canNotBeEmpty: PropTypes.Requireable<boolean>;
|
|
29
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
30
|
+
handleClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
31
|
+
handleRemove: PropTypes.Requireable<(...args: any[]) => any>;
|
|
32
|
+
className: PropTypes.Requireable<string>;
|
|
33
|
+
tagClassName: PropTypes.Requireable<string>;
|
|
34
|
+
};
|
|
35
|
+
static defaultProps: {
|
|
36
|
+
customTagComponent: null;
|
|
37
|
+
canNotBeEmpty: boolean;
|
|
38
|
+
disabled: boolean;
|
|
39
|
+
handleClick: typeof noop;
|
|
40
|
+
handleRemove: typeof noop;
|
|
41
|
+
};
|
|
42
|
+
renderTag(tag: T, focusTag: boolean): React.JSX.Element;
|
|
43
|
+
render(): React.JSX.Element;
|
|
44
|
+
}
|
|
45
|
+
export type TagsListAttrs<T extends TagType = TagType> = JSX.LibraryManagedAttributes<typeof TagsList, TagsListProps<T>>;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import Tag from '../tag/tag';
|
|
5
|
+
function noop() { }
|
|
6
|
+
/**
|
|
7
|
+
* @name Tags List
|
|
8
|
+
*/
|
|
9
|
+
export default class TagsList extends Component {
|
|
10
|
+
static propTypes = {
|
|
11
|
+
children: PropTypes.node,
|
|
12
|
+
tags: PropTypes.array,
|
|
13
|
+
customTagComponent: PropTypes.elementType,
|
|
14
|
+
activeIndex: PropTypes.number,
|
|
15
|
+
canNotBeEmpty: PropTypes.bool,
|
|
16
|
+
disabled: PropTypes.bool,
|
|
17
|
+
handleClick: PropTypes.func,
|
|
18
|
+
handleRemove: PropTypes.func,
|
|
19
|
+
className: PropTypes.string,
|
|
20
|
+
tagClassName: PropTypes.string
|
|
21
|
+
};
|
|
22
|
+
static defaultProps = {
|
|
23
|
+
customTagComponent: null,
|
|
24
|
+
canNotBeEmpty: false,
|
|
25
|
+
disabled: false,
|
|
26
|
+
handleClick: noop,
|
|
27
|
+
handleRemove: noop
|
|
28
|
+
};
|
|
29
|
+
renderTag(tag, focusTag) {
|
|
30
|
+
const TagComponent = this.props.customTagComponent || Tag;
|
|
31
|
+
const readOnly = this.props.disabled || tag.readOnly ||
|
|
32
|
+
(this.props.canNotBeEmpty && this.props.tags.length === 1);
|
|
33
|
+
const { tagClassName } = this.props;
|
|
34
|
+
return (<TagComponent {...tag} readOnly={readOnly} disabled={this.props.disabled || tag.disabled} focused={focusTag} onClick={this.props.handleClick(tag)} onRemove={this.props.handleRemove(tag)} className={tagClassName}>{tag.label}</TagComponent>);
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
const { children, className, customTagComponent, canNotBeEmpty, handleClick, tagClassName, handleRemove, tags, activeIndex, ...props } = this.props;
|
|
38
|
+
const classes = classNames('ring-js-shortcuts', className);
|
|
39
|
+
const tagsList = (this.props.tags || []).map((tag, index) => this.renderTag(tag, this.props.activeIndex === index));
|
|
40
|
+
return (<div data-test="ring-tags-list" className={classes} {...props}>
|
|
41
|
+
{tagsList}
|
|
42
|
+
{children}
|
|
43
|
+
</div>);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@import "../global/variables.css";
|
|
2
|
+
|
|
3
|
+
.text {
|
|
4
|
+
color: var(--ring-text-color);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.sizeS {
|
|
8
|
+
font-size: var(--ring-font-size-smaller);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.sizeM {
|
|
12
|
+
font-size: var(--ring-font-size);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.sizeL {
|
|
16
|
+
font-size: var(--ring-font-size-larger);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.info {
|
|
20
|
+
color: var(--ring-secondary-color);
|
|
21
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { Component, HTMLAttributes } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
type TextSize = 's' | 'm' | 'l';
|
|
4
|
+
export interface TextProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
info?: boolean | null | undefined;
|
|
6
|
+
size?: TextSize;
|
|
7
|
+
'data-test'?: string | null | undefined;
|
|
8
|
+
}
|
|
9
|
+
declare const TextSize: Record<string, TextSize>;
|
|
10
|
+
/**
|
|
11
|
+
* @name Text
|
|
12
|
+
*/
|
|
13
|
+
export default class Text extends Component<TextProps> {
|
|
14
|
+
static propTypes: {
|
|
15
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
16
|
+
info: PropTypes.Requireable<boolean>;
|
|
17
|
+
size: PropTypes.Requireable<TextSize>;
|
|
18
|
+
className: PropTypes.Requireable<string>;
|
|
19
|
+
};
|
|
20
|
+
static Size: Record<string, TextSize>;
|
|
21
|
+
render(): React.JSX.Element;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import styles from './text.css';
|
|
5
|
+
const TextSize = {
|
|
6
|
+
S: 's',
|
|
7
|
+
M: 'm',
|
|
8
|
+
L: 'l'
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* @name Text
|
|
12
|
+
*/
|
|
13
|
+
export default class Text extends Component {
|
|
14
|
+
static propTypes = {
|
|
15
|
+
children: PropTypes.node,
|
|
16
|
+
info: PropTypes.bool,
|
|
17
|
+
size: PropTypes.oneOf(Object.keys(TextSize).map(it => TextSize[it])),
|
|
18
|
+
className: PropTypes.string
|
|
19
|
+
};
|
|
20
|
+
static Size = TextSize;
|
|
21
|
+
render() {
|
|
22
|
+
const { children, className, info, size, ...restProps } = this.props;
|
|
23
|
+
const classes = classNames(styles.text, className, {
|
|
24
|
+
[styles.info]: info,
|
|
25
|
+
[styles.sizeS]: size === Text.Size.S,
|
|
26
|
+
[styles.sizeM]: size === Text.Size.M,
|
|
27
|
+
[styles.sizeL]: size === Text.Size.L
|
|
28
|
+
});
|
|
29
|
+
return (<span className={classes} {...restProps}>{children}</span>);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
@import "../global/variables.css";
|
|
2
|
+
|
|
3
|
+
@value padding: 2px;
|
|
4
|
+
@value duration: 300ms;
|
|
5
|
+
@value timing-function: cubic-bezier(0.23, 1, 0.32, 1);
|
|
6
|
+
|
|
7
|
+
.toggle {
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
|
|
10
|
+
&:hover .switch {
|
|
11
|
+
transition: none;
|
|
12
|
+
|
|
13
|
+
background-color: var(--ring-border-hover-color);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&.disabled {
|
|
17
|
+
pointer-events: none;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.label {
|
|
22
|
+
margin-left: var(--ring-unit);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.leftLabel {
|
|
26
|
+
margin-right: var(--ring-unit);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.switchWrapper {
|
|
30
|
+
position: relative;
|
|
31
|
+
|
|
32
|
+
display: inline-block;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.input {
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: 0;
|
|
38
|
+
left: 0;
|
|
39
|
+
|
|
40
|
+
width: 100%;
|
|
41
|
+
height: 100%;
|
|
42
|
+
|
|
43
|
+
margin: 0;
|
|
44
|
+
|
|
45
|
+
opacity: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.switch {
|
|
49
|
+
--ring-toggle-item-color: var(--ring-white-text-color);
|
|
50
|
+
--ring-toggle-background-color: var(--ring-icon-color);
|
|
51
|
+
--ring-toggle-border-color: var(--ring-toggle-background-color);
|
|
52
|
+
--ring-switch-border-color: var(--ring-toggle-item-color);
|
|
53
|
+
|
|
54
|
+
position: relative;
|
|
55
|
+
|
|
56
|
+
display: block;
|
|
57
|
+
|
|
58
|
+
box-sizing: border-box;
|
|
59
|
+
|
|
60
|
+
width: 100%;
|
|
61
|
+
height: 100%;
|
|
62
|
+
|
|
63
|
+
transition: background-color timing-function duration;
|
|
64
|
+
|
|
65
|
+
border: solid 1px var(--ring-toggle-border-color);
|
|
66
|
+
|
|
67
|
+
background-color: var(--ring-toggle-background-color);
|
|
68
|
+
|
|
69
|
+
.input:focus + & {
|
|
70
|
+
box-shadow: inset 0 0 0 1px var(--ring-border-hover-color), 0 0 0 1px var(--ring-border-hover-color);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&::before {
|
|
74
|
+
position: absolute;
|
|
75
|
+
top: calc(padding - 1px);
|
|
76
|
+
left: -1px;
|
|
77
|
+
|
|
78
|
+
box-sizing: border-box;
|
|
79
|
+
|
|
80
|
+
width: calc(var(--ring-unit) * 1.5);
|
|
81
|
+
height: calc(var(--ring-unit) * 1.5);
|
|
82
|
+
|
|
83
|
+
content: "";
|
|
84
|
+
|
|
85
|
+
transition: transform timing-function duration;
|
|
86
|
+
|
|
87
|
+
transform: translateX(padding);
|
|
88
|
+
|
|
89
|
+
border: solid 1px var(--ring-switch-border-color);
|
|
90
|
+
|
|
91
|
+
border-radius: calc(var(--ring-unit) * 0.75);
|
|
92
|
+
background-color: var(--ring-toggle-item-color);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.input:checked + .switch {
|
|
97
|
+
--ring-toggle-background-color: var(--ring-main-color);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:checked:hover + .switch {
|
|
101
|
+
background-color: var(--ring-main-hover-color);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.size16 {
|
|
105
|
+
& .switchWrapper {
|
|
106
|
+
width: calc(var(--ring-unit) * 3);
|
|
107
|
+
height: calc(var(--ring-unit) * 2);
|
|
108
|
+
|
|
109
|
+
vertical-align: -3px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
& .switch {
|
|
113
|
+
border-radius: var(--ring-unit);
|
|
114
|
+
|
|
115
|
+
&::before {
|
|
116
|
+
width: calc(var(--ring-unit) * 1.5);
|
|
117
|
+
height: calc(var(--ring-unit) * 1.5);
|
|
118
|
+
|
|
119
|
+
border-radius: calc(var(--ring-unit) * 0.75);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* stylelint-disable-next-line selector-max-specificity */
|
|
124
|
+
& .input:checked + ::before {
|
|
125
|
+
transform: translateX(calc(var(--ring-unit) * 1.5 - padding));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.size14 {
|
|
130
|
+
& .switchWrapper {
|
|
131
|
+
width: calc(var(--ring-unit) * 3);
|
|
132
|
+
height: 14px;
|
|
133
|
+
|
|
134
|
+
vertical-align: -2px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
& .switch {
|
|
138
|
+
border-radius: 7px;
|
|
139
|
+
|
|
140
|
+
&::before {
|
|
141
|
+
width: 10px;
|
|
142
|
+
height: 10px;
|
|
143
|
+
|
|
144
|
+
border-radius: 5px;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* stylelint-disable-next-line selector-max-specificity */
|
|
149
|
+
& .input:checked + ::before {
|
|
150
|
+
transform: translateX(12px);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.size20 {
|
|
155
|
+
& .switchWrapper {
|
|
156
|
+
width: calc(var(--ring-unit) * 4);
|
|
157
|
+
height: calc(var(--ring-unit) * 2.5);
|
|
158
|
+
|
|
159
|
+
vertical-align: -5px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
& .switch {
|
|
163
|
+
border-radius: calc(var(--ring-unit) * 1.25);
|
|
164
|
+
|
|
165
|
+
&::before {
|
|
166
|
+
width: calc(var(--ring-unit) * 2);
|
|
167
|
+
height: calc(var(--ring-unit) * 2);
|
|
168
|
+
|
|
169
|
+
border-radius: calc(var(--ring-unit));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* stylelint-disable-next-line selector-max-specificity */
|
|
174
|
+
& .input:checked + ::before {
|
|
175
|
+
transform: translateX(calc(var(--ring-unit) * 2 - padding));
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* stylelint-disable-next-line selector-max-specificity */
|
|
180
|
+
.input:checked[disabled] + .switch {
|
|
181
|
+
--ring-toggle-background-color: var(--ring-border-selected-disabled-color);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/* stylelint-disable-next-line selector-max-specificity */
|
|
185
|
+
.input[disabled]:not(:checked) + .switch {
|
|
186
|
+
--ring-toggle-item-color: var(--ring-content-background-color);
|
|
187
|
+
--ring-toggle-background-color: var(--ring-disabled-background-color);
|
|
188
|
+
--ring-toggle-border-color: var(--ring-border-disabled-color);
|
|
189
|
+
--ring-switch-border-color: var(--ring-border-disabled-color);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.paleSwitch.paleSwitch {
|
|
193
|
+
--ring-toggle-background-color: var(--ring-pale-control-color);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.input:checked + .paleSwitch {
|
|
197
|
+
--ring-toggle-background-color: var(--ring-border-disabled-color);
|
|
198
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { InputHTMLAttributes, PureComponent, ReactNode } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
export declare const Size: {
|
|
4
|
+
Size14: string;
|
|
5
|
+
Size16: string;
|
|
6
|
+
Size20: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* @name Toggle
|
|
10
|
+
*/
|
|
11
|
+
export interface ToggleProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
12
|
+
size: string;
|
|
13
|
+
pale?: boolean | null | undefined;
|
|
14
|
+
leftLabel?: ReactNode;
|
|
15
|
+
'data-test'?: string | null | undefined;
|
|
16
|
+
}
|
|
17
|
+
declare class Toggle extends PureComponent<ToggleProps> {
|
|
18
|
+
static propTypes: {
|
|
19
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
20
|
+
name: PropTypes.Requireable<string>;
|
|
21
|
+
className: PropTypes.Requireable<string>;
|
|
22
|
+
title: PropTypes.Requireable<string>;
|
|
23
|
+
leftLabel: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
24
|
+
defaultChecked: PropTypes.Requireable<boolean>;
|
|
25
|
+
checked: PropTypes.Requireable<boolean>;
|
|
26
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
27
|
+
pale: PropTypes.Requireable<boolean>;
|
|
28
|
+
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
29
|
+
onTransitionEnd: PropTypes.Requireable<(...args: any[]) => any>;
|
|
30
|
+
size: PropTypes.Requireable<string>;
|
|
31
|
+
'data-test': PropTypes.Requireable<string>;
|
|
32
|
+
};
|
|
33
|
+
static defaultProps: {
|
|
34
|
+
size: string;
|
|
35
|
+
};
|
|
36
|
+
render(): React.JSX.Element;
|
|
37
|
+
}
|
|
38
|
+
export type ToggleAttrs = JSX.LibraryManagedAttributes<typeof Toggle, ToggleProps>;
|
|
39
|
+
export default Toggle;
|