@jetbrains/ring-ui 7.0.62 → 7.0.64
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/components/alert/alert.css +1 -1
- package/components/alert/alert.d.ts +1 -1
- package/components/alert/alert.js +3 -3
- package/components/alert/container.css +2 -2
- package/components/alert/container.d.ts +1 -1
- package/components/alert/container.js +1 -1
- package/components/alert-service/alert-service.d.ts +2 -2
- package/components/analytics/{analytics__custom-plugin.d.ts → analytics-custom-plugin.d.ts} +1 -1
- package/components/analytics/{analytics__custom-plugin.js → analytics-custom-plugin.js} +2 -2
- package/components/auth/{auth__core.d.ts → auth-core.d.ts} +9 -8
- package/components/auth/{auth__core.js → auth-core.js} +14 -18
- package/components/auth/auth.d.ts +2 -2
- package/components/auth/auth.js +2 -2
- package/components/auth/background-flow.d.ts +2 -2
- package/components/auth/background-flow.js +0 -1
- package/components/auth/down-notification.css +1 -1
- package/components/auth/down-notification.js +1 -1
- package/components/auth/iframe-flow.d.ts +3 -3
- package/components/auth/iframe-flow.js +3 -5
- package/components/auth/request-builder.d.ts +2 -1
- package/components/auth/request-builder.js +1 -2
- package/components/auth/storage.d.ts +3 -3
- package/components/auth/storage.js +4 -8
- package/components/auth/token-validator.d.ts +2 -1
- package/components/auth/token-validator.js +6 -1
- package/components/auth/window-flow.d.ts +3 -3
- package/components/auth/window-flow.js +7 -7
- package/components/auth-dialog/auth-dialog.css +2 -2
- package/components/auth-dialog/auth-dialog.js +1 -1
- package/components/auth-dialog-service/auth-dialog-service.d.ts +1 -1
- package/components/avatar/avatar-info.d.ts +1 -1
- package/components/avatar/avatar.css +1 -1
- package/components/avatar/avatar.d.ts +1 -1
- package/components/avatar/avatar.figma.js +1 -1
- package/components/avatar/avatar.js +5 -7
- package/components/avatar/fallback-avatar.js +4 -8
- package/components/avatar-stack/avatar-stack.css +1 -1
- package/components/avatar-stack/avatar-stack.d.ts +3 -3
- package/components/avatar-stack/avatar-stack.figma.js +1 -1
- package/components/avatar-stack/avatar-stack.js +1 -1
- package/components/banner/banner.css +2 -2
- package/components/banner/banner.js +1 -1
- package/components/breadcrumbs/breadcrumbs.d.ts +1 -1
- package/components/breadcrumbs/breadcrumbs.figma.js +1 -1
- package/components/button/{button__classes.d.ts → button.classes.d.ts} +1 -1
- package/components/button/button.css +19 -16
- package/components/button/button.d.ts +4 -4
- package/components/button/button.figma.js +1 -1
- package/components/button/button.js +6 -6
- package/components/button-group/button-group.css +6 -6
- package/components/button-group/button-group.d.ts +1 -1
- package/components/button-group/button-group.js +1 -1
- package/components/button-group/caption.d.ts +1 -1
- package/components/button-set/button-set.css +2 -2
- package/components/button-set/button-set.d.ts +1 -1
- package/components/button-toolbar/button-toolbar.css +2 -2
- package/components/button-toolbar/button-toolbar.d.ts +1 -1
- package/components/caret/caret.js +23 -18
- package/components/checkbox/checkbox-group.figma.js +1 -1
- package/components/checkbox/checkbox.css +1 -1
- package/components/checkbox/checkbox.d.ts +1 -1
- package/components/checkbox/checkbox.figma.js +1 -1
- package/components/checkbox/checkbox.js +5 -5
- package/components/clipboard/clipboard.js +2 -2
- package/components/code/code.css +1 -1
- package/components/code/code.d.ts +1 -1
- package/components/code/code.js +5 -3
- package/components/collapse/collapse-content.d.ts +3 -3
- package/components/collapse/collapse-control.d.ts +2 -2
- package/components/collapse/collapse.css +1 -1
- package/components/collapse/collapse.d.ts +3 -3
- package/components/confirm/confirm.d.ts +1 -1
- package/components/confirm/confirm.js +1 -1
- package/components/confirm-service/confirm-service.d.ts +3 -3
- package/components/content-layout/content-layout.css +2 -2
- package/components/content-layout/content-layout.d.ts +1 -1
- package/components/content-layout/content-layout.js +2 -2
- package/components/content-layout/sidebar.d.ts +1 -1
- package/components/contenteditable/contenteditable.d.ts +1 -1
- package/components/contenteditable/contenteditable.js +2 -1
- package/components/control-help/control-help.css +1 -1
- package/components/control-help/control-help.d.ts +1 -1
- package/components/control-label/control-label.d.ts +1 -1
- package/components/data-list/data-list.css +1 -1
- package/components/data-list/data-list.d.ts +5 -5
- package/components/data-list/data-list.js +2 -2
- package/components/data-list/data-list.mock.d.ts +2 -2
- package/components/data-list/data-list.mock.js +20 -20
- package/components/data-list/item.d.ts +3 -3
- package/components/data-list/item.js +2 -2
- package/components/data-list/selection.d.ts +1 -1
- package/components/data-list/selection.js +8 -1
- package/components/data-list/title.d.ts +2 -2
- package/components/date-picker/consts.d.ts +1 -1
- package/components/date-picker/date-input.d.ts +1 -1
- package/components/date-picker/date-input.js +2 -2
- package/components/date-picker/date-picker.css +15 -15
- package/components/date-picker/date-picker.d.ts +5 -5
- package/components/date-picker/date-picker.js +17 -19
- package/components/date-picker/date-popup.d.ts +1 -1
- package/components/date-picker/date-popup.js +5 -3
- package/components/date-picker/day.d.ts +2 -2
- package/components/date-picker/day.js +4 -5
- package/components/date-picker/formats.js +1 -0
- package/components/date-picker/month-names.d.ts +1 -1
- package/components/date-picker/month-names.js +1 -1
- package/components/date-picker/month-slider.d.ts +2 -2
- package/components/date-picker/month-slider.js +1 -1
- package/components/date-picker/month.d.ts +1 -1
- package/components/date-picker/months.d.ts +1 -1
- package/components/date-picker/months.js +2 -2
- package/components/date-picker/years.d.ts +1 -1
- package/components/date-picker/years.js +2 -2
- package/components/dialog/{dialog__body-scroll-preventer.js → dialog-body-scroll-preventer.js} +6 -2
- package/components/dialog/dialog.css +5 -5
- package/components/dialog/dialog.d.ts +1 -1
- package/components/dialog/dialog.js +7 -7
- package/components/dropdown/anchor.d.ts +1 -1
- package/components/dropdown/dropdown.css +1 -1
- package/components/dropdown/dropdown.d.ts +2 -2
- package/components/dropdown/dropdown.js +2 -2
- package/components/dropdown-menu/dropdown-menu.d.ts +5 -5
- package/components/dropdown-menu/dropdown-menu.js +1 -1
- package/components/editable-heading/editable-heading.css +6 -8
- package/components/editable-heading/editable-heading.d.ts +1 -1
- package/components/editable-heading/editable-heading.js +3 -2
- package/components/error-bubble/error-bubble-legacy.css +3 -3
- package/components/error-bubble/error-bubble.css +5 -5
- package/components/error-bubble/error-bubble.d.ts +1 -1
- package/components/error-bubble/error-bubble.figma.js +1 -1
- package/components/error-bubble/error-bubble.js +2 -2
- package/components/error-message/error-message.css +1 -1
- package/components/error-message/error-message.d.ts +2 -2
- package/components/error-message/error-message.js +2 -2
- package/components/error-page/error-page.css +3 -3
- package/components/footer/footer.css +2 -2
- package/components/footer/footer.d.ts +1 -1
- package/components/footer/footer.js +1 -1
- package/components/form/form.css +3 -3
- package/components/global/compose-refs.d.ts +2 -0
- package/components/global/compose-refs.js +14 -0
- package/components/global/composeRefs.d.ts +6 -2
- package/components/global/composeRefs.js +7 -14
- package/components/global/create-stateful-context.d.ts +1 -1
- package/components/global/dom.d.ts +1 -1
- package/components/global/dom.js +2 -4
- package/components/global/focus-sensor-hoc.d.ts +1 -1
- package/components/global/focus-sensor-hoc.js +2 -2
- package/components/global/fuzzy-highlight.d.ts +2 -2
- package/components/global/get-event-key.d.ts +1 -1
- package/components/global/global.css +2 -2
- package/components/global/memoize.js +1 -1
- package/components/global/rerender-hoc.d.ts +1 -1
- package/components/global/rerender-hoc.js +2 -2
- package/components/global/theme.d.ts +1 -1
- package/components/global/theme.js +2 -2
- package/components/global/url.js +3 -3
- package/components/global/use-event-callback.js +1 -1
- package/components/global/variables.css +1 -1
- package/components/grid/col.d.ts +1 -1
- package/components/grid/col.js +1 -1
- package/components/grid/grid.css +4 -4
- package/components/grid/grid.d.ts +1 -1
- package/components/grid/grid.js +1 -1
- package/components/grid/row.d.ts +1 -1
- package/components/grid/row.js +1 -1
- package/components/group/group.css +1 -1
- package/components/group/group.d.ts +1 -1
- package/components/group/group.js +1 -1
- package/components/header/header-icon.d.ts +2 -2
- package/components/header/header.css +4 -4
- package/components/header/header.d.ts +1 -1
- package/components/header/links.d.ts +1 -1
- package/components/header/logo.d.ts +1 -1
- package/components/header/profile.d.ts +5 -5
- package/components/header/profile.js +3 -3
- package/components/header/services-link.d.ts +1 -1
- package/components/header/services-link.js +3 -3
- package/components/header/services.css +1 -1
- package/components/header/services.d.ts +2 -2
- package/components/header/services.js +3 -3
- package/components/header/smart-profile.d.ts +3 -3
- package/components/header/smart-profile.js +2 -1
- package/components/header/smart-services.d.ts +3 -3
- package/components/header/tray.d.ts +1 -1
- package/components/heading/heading.css +2 -2
- package/components/heading/heading.d.ts +1 -1
- package/components/http/http.mock.d.ts +1 -1
- package/components/hub-source/{hub-source__user.d.ts → hub-source-user.d.ts} +3 -2
- package/components/hub-source/{hub-source__users-groups.d.ts → hub-source-users-groups.d.ts} +3 -2
- package/components/hub-source/hub-source.d.ts +2 -2
- package/components/icon/{icon__svg.d.ts → icon-svg.d.ts} +1 -1
- package/components/icon/icon.css +5 -5
- package/components/icon/icon.d.ts +2 -2
- package/components/icon/icon.js +3 -3
- package/components/input/input-legacy.css +2 -2
- package/components/input/input.css +5 -5
- package/components/input/input.d.ts +3 -3
- package/components/input/input.figma.js +1 -1
- package/components/input/input.js +8 -8
- package/components/input-size/input-size.css +1 -1
- package/components/island/adaptive-island-hoc.d.ts +1 -1
- package/components/island/content.d.ts +1 -1
- package/components/island/content.js +2 -2
- package/components/island/header.d.ts +1 -1
- package/components/island/header.js +4 -4
- package/components/island/island.css +3 -3
- package/components/island/island.d.ts +1 -1
- package/components/line/line.css +1 -1
- package/components/link/clickable-link.d.ts +12 -0
- package/components/link/clickable-link.js +25 -0
- package/components/link/clickableLink.d.ts +11 -12
- package/components/link/clickableLink.js +4 -25
- package/components/link/link.css +1 -1
- package/components/link/link.d.ts +2 -2
- package/components/link/link.js +4 -4
- package/components/list/consts.d.ts +4 -5
- package/components/list/{list__custom.d.ts → list-custom.d.ts} +1 -1
- package/components/list/{list__custom.js → list-custom.js} +1 -1
- package/components/list/{list__hint.d.ts → list-hint.d.ts} +1 -1
- package/components/list/{list__hint.js → list-hint.js} +1 -1
- package/components/list/{list__item.d.ts → list-item.d.ts} +2 -2
- package/components/list/{list__item.js → list-item.js} +6 -5
- package/components/list/{list__separator.d.ts → list-separator.d.ts} +1 -1
- package/components/list/{list__separator.js → list-separator.js} +1 -1
- package/components/list/{list__title.d.ts → list-title.d.ts} +1 -1
- package/components/list/{list__title.js → list-title.js} +1 -1
- package/components/list/{list__users-groups-source.d.ts → list-users-groups-source.d.ts} +3 -2
- package/components/list/{list__users-groups-source.js → list-users-groups-source.js} +1 -1
- package/components/list/{list__classes.d.ts → list.classes.d.ts} +1 -1
- package/components/list/list.css +5 -5
- package/components/list/list.d.ts +7 -7
- package/components/list/list.js +34 -28
- package/components/loader/{loader__core.js → loader-core.js} +2 -2
- package/components/loader/loader.css +1 -1
- package/components/loader/loader.d.ts +2 -2
- package/components/loader/loader.js +1 -1
- package/components/loader-inline/loader-inline.css +2 -2
- package/components/loader-inline/loader-inline.d.ts +1 -1
- package/components/loader-screen/loader-screen.css +2 -2
- package/components/loader-screen/loader-screen.d.ts +1 -1
- package/components/login-dialog/login-dialog.css +2 -2
- package/components/login-dialog/login-dialog.d.ts +1 -1
- package/components/login-dialog/login-dialog.js +1 -1
- package/components/login-dialog/service.d.ts +1 -1
- package/components/markdown/markdown.css +3 -3
- package/components/markdown/markdown.d.ts +1 -1
- package/components/markdown/markdown.js +1 -1
- package/components/message/message.css +3 -3
- package/components/message/message.d.ts +4 -4
- package/components/message/message.js +3 -3
- package/components/old-browsers-message/old-browsers-message.css +2 -2
- package/components/old-browsers-message/old-browsers-message.js +1 -1
- package/components/pager/pager.css +1 -1
- package/components/pager/pager.d.ts +2 -2
- package/components/pager/pager.js +11 -12
- package/components/panel/panel.css +1 -1
- package/components/panel/panel.d.ts +1 -1
- package/components/panel/panel.js +1 -1
- package/components/permissions/{permissions__cache.js → permissions-cache.js} +4 -5
- package/components/permissions/permissions.d.ts +2 -2
- package/components/permissions/permissions.js +2 -4
- package/components/popup/popup.css +3 -3
- package/components/popup/popup.d.ts +2 -2
- package/components/popup/popup.js +6 -5
- package/components/popup/popup.target.d.ts +1 -1
- package/components/popup/position-css.js +6 -10
- package/components/popup/position.js +10 -10
- package/components/popup-menu/popup-menu.d.ts +4 -4
- package/components/progress-bar/progress-bar.css +6 -8
- package/components/progress-bar/progress-bar.d.ts +1 -1
- package/components/progress-bar/progress-bar.js +1 -1
- package/components/query-assist/{query-assist__suggestions.d.ts → query-assist-suggestions.d.ts} +1 -1
- package/components/query-assist/query-assist.css +11 -11
- package/components/query-assist/query-assist.d.ts +4 -4
- package/components/query-assist/query-assist.js +11 -11
- package/components/radio/{radio__item.d.ts → radio-item.d.ts} +1 -1
- package/components/radio/{radio__item.js → radio-item.js} +2 -2
- package/components/radio/radio.css +2 -2
- package/components/radio/radio.d.ts +2 -2
- package/components/radio/radio.js +1 -1
- package/components/scrollable-section/scrollable-section.d.ts +1 -1
- package/components/scrollable-section/scrollable-section.js +1 -1
- package/components/select/{select__filter.d.ts → select-filter.d.ts} +2 -2
- package/components/select/{select__filter.js → select-filter.js} +1 -1
- package/components/select/select-popup.css +5 -5
- package/components/select/{select__popup.d.ts → select-popup.d.ts} +8 -8
- package/components/select/{select__popup.js → select-popup.js} +11 -7
- package/components/select/select.css +10 -9
- package/components/select/select.d.ts +6 -6
- package/components/select/select.js +27 -25
- package/components/shortcuts/core.js +7 -7
- package/components/shortcuts/shortcuts-hoc.d.ts +2 -2
- package/components/shortcuts/shortcuts.d.ts +1 -1
- package/components/sidebar/sidebar.css +1 -1
- package/components/slider/slider.css +2 -2
- package/components/slider/slider.d.ts +5 -5
- package/components/slider/slider.js +5 -5
- package/components/slider/slider.utils.d.ts +1 -1
- package/components/slider/slider.utils.js +2 -4
- package/components/storage/{storage__local.d.ts → storage-local.d.ts} +1 -1
- package/components/storage/{storage__local.js → storage-local.js} +7 -7
- package/components/storage/storage.d.ts +1 -1
- package/components/storage/storage.js +1 -1
- package/components/tab-trap/tab-trap.css +1 -1
- package/components/tab-trap/tab-trap.d.ts +1 -1
- package/components/tab-trap/tab-trap.js +2 -5
- package/components/table/cell.d.ts +1 -1
- package/components/table/disable-hover-hoc.d.ts +1 -1
- package/components/table/header-cell.d.ts +1 -1
- package/components/table/header-cell.js +1 -1
- package/components/table/header.d.ts +2 -2
- package/components/table/header.js +2 -2
- package/components/table/multitable.d.ts +3 -3
- package/components/table/multitable.js +1 -1
- package/components/table/row-with-focus-sensor.d.ts +3 -3
- package/components/table/row.d.ts +4 -4
- package/components/table/row.js +1 -1
- package/components/table/selection-adapter.d.ts +2 -1
- package/components/table/selection-shortcuts-hoc.d.ts +4 -3
- package/components/table/selection-shortcuts-hoc.js +1 -3
- package/components/table/selection.js +4 -8
- package/components/table/simple-table.d.ts +2 -2
- package/components/table/smart-table.d.ts +2 -2
- package/components/table/table.css +6 -6
- package/components/table/table.d.ts +7 -7
- package/components/table/table.js +3 -3
- package/components/tabs/collapsible-more.d.ts +3 -3
- package/components/tabs/collapsible-more.js +2 -2
- package/components/tabs/collapsible-tab.d.ts +2 -2
- package/components/tabs/collapsible-tab.js +1 -1
- package/components/tabs/collapsible-tabs.d.ts +2 -2
- package/components/tabs/collapsible-tabs.js +6 -8
- package/components/tabs/custom-item.d.ts +2 -2
- package/components/tabs/dumb-tabs.d.ts +3 -3
- package/components/tabs/dumb-tabs.js +3 -3
- package/components/tabs/smart-tabs.d.ts +1 -1
- package/components/tabs/tab-link.d.ts +2 -2
- package/components/tabs/tab.d.ts +2 -2
- package/components/tabs/tabs.css +6 -6
- package/components/tag/tag.css +10 -8
- package/components/tag/tag.d.ts +5 -3
- package/components/tag/tag.js +5 -3
- package/components/tags-input/tags-input.css +3 -3
- package/components/tags-input/tags-input.d.ts +8 -8
- package/components/tags-input/tags-input.js +13 -7
- package/components/tags-list/tags-list.d.ts +2 -2
- package/components/tags-list/tags-list.js +1 -1
- package/components/text/text.css +1 -1
- package/components/text/text.d.ts +1 -1
- package/components/toggle/toggle.css +2 -2
- package/components/toggle/toggle.d.ts +1 -1
- package/components/toggle/toggle.js +1 -1
- package/components/tooltip/tooltip.css +1 -1
- package/components/tooltip/tooltip.d.ts +2 -2
- package/components/tooltip/tooltip.js +1 -1
- package/components/upload/upload.css +1 -1
- package/components/upload/upload.d.ts +3 -3
- package/components/upload/upload.js +2 -2
- package/components/user-agreement/service.d.ts +2 -2
- package/components/user-agreement/service.js +3 -5
- package/components/user-agreement/user-agreement.css +2 -2
- package/components/user-agreement/user-agreement.d.ts +1 -1
- package/components/user-agreement/user-agreement.js +1 -1
- package/components/user-card/card.d.ts +1 -1
- package/components/user-card/card.js +3 -2
- package/components/user-card/smart-user-card-tooltip.d.ts +2 -2
- package/components/user-card/smart-user-card-tooltip.js +1 -1
- package/components/user-card/tooltip.d.ts +3 -3
- package/components/user-card/user-card.css +1 -1
- package/package.json +4 -1
- /package/components/button/{button__classes.js → button.classes.js} +0 -0
- /package/components/dialog/{dialog__body-scroll-preventer.d.ts → dialog-body-scroll-preventer.d.ts} +0 -0
- /package/components/global/{variables.d.ts → variables.interface.d.ts} +0 -0
- /package/components/global/{variables.js → variables.interface.js} +0 -0
- /package/components/hub-source/{hub-source__user.js → hub-source-user.js} +0 -0
- /package/components/hub-source/{hub-source__users-groups.js → hub-source-users-groups.js} +0 -0
- /package/components/icon/{icon__svg.js → icon-svg.js} +0 -0
- /package/components/icon/{icon__constants.d.ts → icon.constants.d.ts} +0 -0
- /package/components/icon/{icon__constants.js → icon.constants.js} +0 -0
- /package/components/list/{list__classes.js → list.classes.js} +0 -0
- /package/components/loader/{loader__core.d.ts → loader-core.d.ts} +0 -0
- /package/components/old-browsers-message/{old-browsers-message__stop.d.ts → old-browsers-message-stop.d.ts} +0 -0
- /package/components/old-browsers-message/{old-browsers-message__stop.js → old-browsers-message-stop.js} +0 -0
- /package/components/permissions/{permissions__cache.d.ts → permissions-cache.d.ts} +0 -0
- /package/components/query-assist/{query-assist__suggestions.js → query-assist-suggestions.js} +0 -0
|
@@ -162,17 +162,13 @@ function extractLetters(name) {
|
|
|
162
162
|
if (names.length >= 2) {
|
|
163
163
|
return names[0][0].toUpperCase() + names[1][0].toUpperCase();
|
|
164
164
|
}
|
|
165
|
-
|
|
165
|
+
if (names.length === 1) {
|
|
166
166
|
if (names[0].length >= 2) {
|
|
167
167
|
return names[0].slice(0, 2).join('').toUpperCase();
|
|
168
168
|
}
|
|
169
|
-
|
|
170
|
-
return `${names[0][0].toUpperCase()}X`;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
return 'XX';
|
|
169
|
+
return `${names[0][0].toUpperCase()}X`;
|
|
175
170
|
}
|
|
171
|
+
return 'XX';
|
|
176
172
|
}
|
|
177
173
|
// https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0#gistcomment-2775538
|
|
178
174
|
const BASE = 32;
|
|
@@ -190,5 +186,5 @@ export default function FallbackAvatar({ username, size, round }) {
|
|
|
190
186
|
const underscore = sizes.underscore;
|
|
191
187
|
const radius = round ? '50%' : sizes.radius;
|
|
192
188
|
const gradientId = useMemo(() => getUID('gradient-'), []);
|
|
193
|
-
return (_jsxs("svg", { viewBox: `0 0 ${size} ${size}`, xmlns:
|
|
189
|
+
return (_jsxs("svg", { viewBox: `0 0 ${size} ${size}`, xmlns: 'http://www.w3.org/2000/svg', children: [_jsx("defs", { children: _jsxs("linearGradient", { id: gradientId, x1: '1', y1: '1', x2: '0', y2: '0', children: [_jsx("stop", { stopColor: fromColor, offset: '0' }), _jsx("stop", { stopColor: toColor, offset: '0.8' })] }) }), _jsxs("g", { children: [_jsx("rect", { fill: `url(#${gradientId})`, x: '0', y: '0', width: size, height: size, rx: radius, ry: radius }), _jsx("text", { x: sizes.text.x, y: sizes.text.y, fontFamily: "var(--ring-font-family, 'Arial, Helvetica, sans-serif')", fontSize: sizes.fontSize, fontWeight: '600', letterSpacing: sizes.letterSpacing, fill: '#FFFFFF', dominantBaseline: sizes.dominantBaseline, textAnchor: sizes.textAnchor, cursor: 'default', children: _jsx("tspan", { children: extractLetters(username) }) }), underscore && (_jsx("rect", { fill: '#FFFFFF', x: underscore.x, y: underscore.y, width: underscore.width, height: underscore.height })), _jsx("title", { children: username })] })] }));
|
|
194
190
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
2
|
-
import { ListDataItem } from '../list/consts';
|
|
3
|
-
import { DropdownMenuProps } from '../dropdown-menu/dropdown-menu';
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
import { type ListDataItem } from '../list/consts';
|
|
3
|
+
import { type DropdownMenuProps } from '../dropdown-menu/dropdown-menu';
|
|
4
4
|
import { Size } from '../avatar/avatar';
|
|
5
5
|
declare module 'csstype' {
|
|
6
6
|
interface Properties {
|
|
@@ -14,5 +14,5 @@ export default function AvatarStack({ children, className, size = Size.Size20, e
|
|
|
14
14
|
height: size,
|
|
15
15
|
'--ring-avatar-stack-index': Children.count(children),
|
|
16
16
|
fontSize: fontSizes[size],
|
|
17
|
-
}, anchor: _jsx("button", { type:
|
|
17
|
+
}, anchor: (_jsx("button", { type: 'button', className: styles.extraButton, children: _jsx(Avatar, { size: size, info: _jsx("span", { className: styles.extraText, children: `+${extraItems.length}` }) }) })), data: extraItems, menuProps: { offset: 4, ...dropdownMenuProps?.menuProps }, ...dropdownMenuProps })) : null] }));
|
|
18
18
|
}
|
|
@@ -33,6 +33,6 @@ export function Banner(props) {
|
|
|
33
33
|
[styles.warning]: mode === 'warning',
|
|
34
34
|
[styles.purple]: mode === 'purple',
|
|
35
35
|
[styles.grey]: mode === 'grey',
|
|
36
|
-
}, className), "data-test": dataTest, children: [withIcon && _jsx(Icon, { glyph: icon, className: styles.icon }), _jsxs("div", { children: [title && _jsx("div", { className: styles.title, children: title }), _jsx("div", { className: styles.description, children: children })] }), onClose && (_jsx(Tooltip, { title: closeButtonTitle ?? translations.close, className: styles.closeButtonWrapper, children: _jsx(Link, { className: styles.closeButton, pseudo: true, onClick: onClose, "aria-label":
|
|
36
|
+
}, className), "data-test": dataTest, children: [withIcon && _jsx(Icon, { glyph: icon, className: styles.icon }), _jsxs("div", { children: [title && _jsx("div", { className: styles.title, children: title }), _jsx("div", { className: styles.description, children: children })] }), onClose && (_jsx(Tooltip, { title: closeButtonTitle ?? translations.close, className: styles.closeButtonWrapper, children: _jsx(Link, { className: styles.closeButton, pseudo: true, onClick: onClose, "aria-label": 'Close', children: _jsx(Icon, { glyph: closeIcon }) }) }))] }));
|
|
37
37
|
}
|
|
38
38
|
export default React.memo(Banner);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ButtonProps } from './button';
|
|
1
|
+
import { type ButtonProps } from './button';
|
|
2
2
|
export declare function getButtonClasses({ className, active, disabled, loader, primary, success, error, secondary, ghost, short, inline, danger, delayed, icon, iconRight, height, children, }: ButtonProps): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import '../global/variables.css';
|
|
2
2
|
|
|
3
|
-
@value glyph from
|
|
3
|
+
@value glyph from '../icon/icon.css';
|
|
4
4
|
|
|
5
5
|
:root,
|
|
6
6
|
:host {
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
--ring-button-loader-components: var(--ring-main-components);
|
|
12
12
|
--ring-button-white-text-disabled-color: var(--ring-white-text-color);
|
|
13
13
|
--ring-button-icon-line-height: calc(var(--ring-unit) * 2);
|
|
14
|
+
|
|
15
|
+
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
:global(.ring-ui-theme-dark) {
|
|
@@ -25,6 +27,9 @@
|
|
|
25
27
|
--ring-button-line-height: var(--ring-line-height-lowest);
|
|
26
28
|
}
|
|
27
29
|
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
28
33
|
.heightM {
|
|
29
34
|
--ring-button-height: calc(var(--ring-unit) * 3.5);
|
|
30
35
|
--ring-button-padding-block: calc(var(--ring-unit) * 0.5);
|
|
@@ -282,7 +287,7 @@
|
|
|
282
287
|
|
|
283
288
|
&.inline {
|
|
284
289
|
&:hover {
|
|
285
|
-
|
|
290
|
+
--ring-button-background-color: var(--ring-tag-background-color);
|
|
286
291
|
}
|
|
287
292
|
|
|
288
293
|
&:active {
|
|
@@ -374,15 +379,13 @@
|
|
|
374
379
|
width: calc(100% + var(--ring-button-loader-width));
|
|
375
380
|
height: 100%;
|
|
376
381
|
|
|
377
|
-
content:
|
|
382
|
+
content: '';
|
|
378
383
|
animation: progress 1s linear infinite;
|
|
379
384
|
|
|
380
|
-
background-image: linear-gradient(
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
transparent 80%
|
|
385
|
-
);
|
|
385
|
+
background-image: linear-gradient(to right,
|
|
386
|
+
transparent,
|
|
387
|
+
rgba(var(--ring-button-loader-components), 0.4) 40%,
|
|
388
|
+
transparent 80%);
|
|
386
389
|
|
|
387
390
|
background-repeat: repeat;
|
|
388
391
|
background-size: var(--ring-button-loader-width);
|
|
@@ -390,16 +393,16 @@
|
|
|
390
393
|
}
|
|
391
394
|
|
|
392
395
|
.flat .loaderBackground {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
396
|
+
top: 0;
|
|
397
|
+
right: 0;
|
|
398
|
+
bottom: 0;
|
|
399
|
+
left: 0;
|
|
397
400
|
|
|
398
|
-
|
|
401
|
+
border-radius: var(--ring-border-radius);
|
|
399
402
|
}
|
|
400
403
|
|
|
401
404
|
.delayed::after {
|
|
402
|
-
content:
|
|
405
|
+
content: '…';
|
|
403
406
|
}
|
|
404
407
|
|
|
405
408
|
.short {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { PureComponent, ButtonHTMLAttributes } from 'react';
|
|
1
|
+
import { PureComponent, type ButtonHTMLAttributes } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { IconProps, IconType, Size } from '../icon/icon';
|
|
4
|
-
import { ClickableLinkProps } from '../link/
|
|
5
|
-
import { ControlsHeight, ControlsHeightContext } from '../global/controls-height';
|
|
3
|
+
import { type IconProps, type IconType, Size } from '../icon/icon';
|
|
4
|
+
import { type ClickableLinkProps } from '../link/clickable-link';
|
|
5
|
+
import { type ControlsHeight, ControlsHeightContext } from '../global/controls-height';
|
|
6
6
|
export interface ButtonBaseProps {
|
|
7
7
|
height?: ControlsHeight | undefined;
|
|
8
8
|
active?: boolean | null | undefined;
|
|
@@ -5,10 +5,10 @@ import chevronDown from '@jetbrains/icons/chevron-down';
|
|
|
5
5
|
import chevron12pxDown from '@jetbrains/icons/chevron-12px-down';
|
|
6
6
|
import deprecate from 'util-deprecate';
|
|
7
7
|
import Icon, { Size } from '../icon/icon';
|
|
8
|
-
import ClickableLink from '../link/
|
|
8
|
+
import ClickableLink from '../link/clickable-link';
|
|
9
9
|
import { ControlsHeightContext } from '../global/controls-height';
|
|
10
10
|
import styles from './button.css';
|
|
11
|
-
import { getButtonClasses } from './
|
|
11
|
+
import { getButtonClasses } from './button.classes';
|
|
12
12
|
const warnText = deprecate(() => { }, 'Button: "text" prop is deprecated and will be removed in 8.0. Use inline instead.');
|
|
13
13
|
function removeLinkProps(props) {
|
|
14
14
|
const { download, href, hrefLang, media, ping, target, type, referrerPolicy, onConditionalClick, onPlainLeftClick, activeClassName, ...restProps } = props;
|
|
@@ -33,8 +33,8 @@ export class Button extends PureComponent {
|
|
|
33
33
|
active, danger, delayed, loader, primary, success, error, secondary, ghost, short, text, dropdown, height,
|
|
34
34
|
// Props
|
|
35
35
|
icon, iconRight, iconSize, iconClassName, iconRightClassName, iconSuppressSizeWarning, className, children, inline, disabled, ...props } = this.props;
|
|
36
|
-
const isInline = inline ?? text ?? icon
|
|
37
|
-
if (text
|
|
36
|
+
const isInline = inline ?? text ?? !!icon;
|
|
37
|
+
if (text) {
|
|
38
38
|
warnText();
|
|
39
39
|
}
|
|
40
40
|
const classes = getButtonClasses({
|
|
@@ -45,11 +45,11 @@ export class Button extends PureComponent {
|
|
|
45
45
|
const content = (_jsxs(_Fragment, { children: [icon && (_jsx(Icon, { className: classNames(styles.icon, iconClassName), glyph: icon, size: iconSize, suppressSizeWarning: iconSuppressSizeWarning })), children, iconRight && _jsx(Icon, { className: classNames(styles.iconRight, iconRightClassName), glyph: iconRight }), dropdown && _jsx(Icon, { glyph: isInline ? chevron12pxDown : chevronDown, className: styles.dropdownIcon })] }));
|
|
46
46
|
const isDisabled = disabled || loader || undefined;
|
|
47
47
|
const commonProps = {
|
|
48
|
-
...(props.href
|
|
48
|
+
...(props.href !== undefined && isDisabled ? removeLinkProps(props) : props),
|
|
49
49
|
className: classes,
|
|
50
50
|
children: (_jsxs(_Fragment, { children: [loader && !isInline && _jsx("div", { className: styles.loaderBackground }), content] })),
|
|
51
51
|
};
|
|
52
|
-
return
|
|
52
|
+
return 'href' in this.props && this.props.href !== undefined ? (_jsx(ClickableLink, { ...commonProps })) : (_jsx("button", { ref: this.buttonRef, type: 'button', disabled: isDisabled, ...commonProps }));
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
export { Size as IconSize };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import '../global/variables.css';
|
|
2
2
|
|
|
3
|
-
@value button, active, flat from
|
|
3
|
+
@value button, active, flat from '../button/button.css';
|
|
4
4
|
|
|
5
5
|
:root,
|
|
6
6
|
:host {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
--ring-button-group-button-border-color: var(--ring-borders-color);
|
|
25
25
|
|
|
26
26
|
composes: common;
|
|
27
|
-
composes: buttonGroup from
|
|
27
|
+
composes: buttonGroup from '../button-toolbar/button-toolbar.css';
|
|
28
28
|
|
|
29
29
|
border-radius: var(--ring-border-radius);
|
|
30
30
|
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
|
|
59
59
|
width: var(--ring-border-radius);
|
|
60
60
|
|
|
61
|
-
content:
|
|
61
|
+
content: '';
|
|
62
62
|
|
|
63
63
|
box-shadow:
|
|
64
64
|
0 1px var(--ring-button-group-button-border-color) inset,
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
|
|
149
149
|
.split {
|
|
150
150
|
composes: common;
|
|
151
|
-
composes: buttonGroup from
|
|
151
|
+
composes: buttonGroup from '../button-toolbar/button-toolbar.css';
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
.common button,
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
.caption {
|
|
165
|
-
composes: font from
|
|
165
|
+
composes: font from '../global/global.css';
|
|
166
166
|
|
|
167
167
|
margin-right: var(--ring-unit);
|
|
168
168
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PureComponent, HTMLAttributes, ReactNode } from 'react';
|
|
1
|
+
import { PureComponent, type HTMLAttributes, type ReactNode } from 'react';
|
|
2
2
|
import Caption from './caption';
|
|
3
3
|
export interface ButtonGroupProps extends HTMLAttributes<HTMLElement> {
|
|
4
4
|
split?: boolean | null | undefined;
|
|
@@ -13,7 +13,7 @@ export default class ButtonGroup extends PureComponent {
|
|
|
13
13
|
render() {
|
|
14
14
|
const { className, split, 'data-test': dataTest, label, help, ...restProps } = this.props;
|
|
15
15
|
const classes = classNames(split ? styles.split : styles.buttonGroup, className, {
|
|
16
|
-
[styles.disabled]: Children.toArray(this.props.children).every(child => child
|
|
16
|
+
[styles.disabled]: Children.toArray(this.props.children).every(child => !!child &&
|
|
17
17
|
typeof child === 'object' &&
|
|
18
18
|
'props' in child &&
|
|
19
19
|
child.props.disabled),
|
|
@@ -38,9 +38,10 @@ export default class Caret {
|
|
|
38
38
|
* @return {number}
|
|
39
39
|
*/
|
|
40
40
|
getAbsolutePosition(node) {
|
|
41
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
41
42
|
let _curNode = node;
|
|
42
43
|
let curPos = 0;
|
|
43
|
-
while (_curNode
|
|
44
|
+
while (_curNode && _curNode !== this.target) {
|
|
44
45
|
while (_curNode.previousSibling) {
|
|
45
46
|
curPos += _curNode.previousSibling.textContent?.length ?? 0;
|
|
46
47
|
_curNode = _curNode.previousSibling;
|
|
@@ -68,14 +69,17 @@ export default class Caret {
|
|
|
68
69
|
const range2 = range1.cloneRange();
|
|
69
70
|
range2.selectNodeContents(this.target);
|
|
70
71
|
range2.setEnd(range1.endContainer, range1.endOffset);
|
|
72
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
71
73
|
const _curNode = range1.startContainer;
|
|
72
74
|
if (this.target === _curNode) {
|
|
73
|
-
return range1.startOffset === 0 || _curNode.textContent
|
|
75
|
+
return range1.startOffset === 0 || _curNode.textContent === null || _curNode.textContent === undefined
|
|
76
|
+
? 0
|
|
77
|
+
: _curNode.textContent.length;
|
|
74
78
|
}
|
|
75
|
-
|
|
79
|
+
if (!this.target.contains(_curNode)) {
|
|
76
80
|
return -1;
|
|
77
81
|
}
|
|
78
|
-
|
|
82
|
+
if (!_curNode) {
|
|
79
83
|
return ('selectionStart' in this.target && this.target.selectionStart) || -1;
|
|
80
84
|
}
|
|
81
85
|
const curPos = this.getAbsolutePosition(_curNode);
|
|
@@ -83,20 +87,16 @@ export default class Caret {
|
|
|
83
87
|
if (range1.startOffset === range1.endOffset) {
|
|
84
88
|
return curPos + range1.startOffset;
|
|
85
89
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
const startOffset = curPos + range1.startOffset;
|
|
96
|
-
const endPos = this.getAbsolutePosition(range1.endContainer);
|
|
97
|
-
const endOffset = endPos + range1.endOffset;
|
|
98
|
-
return { startOffset, endOffset, position: range2.toString().length };
|
|
90
|
+
return {
|
|
91
|
+
startOffset: curPos + range1.startOffset,
|
|
92
|
+
endOffset: curPos + range1.endOffset,
|
|
93
|
+
position: range2.toString().length,
|
|
94
|
+
};
|
|
99
95
|
}
|
|
96
|
+
const startOffset = curPos + range1.startOffset;
|
|
97
|
+
const endPos = this.getAbsolutePosition(range1.endContainer);
|
|
98
|
+
const endOffset = endPos + range1.endOffset;
|
|
99
|
+
return { startOffset, endOffset, position: range2.toString().length };
|
|
100
100
|
}
|
|
101
101
|
return ('selectionStart' in this.target && this.target.selectionStart) || -1;
|
|
102
102
|
}
|
|
@@ -108,6 +108,7 @@ export default class Caret {
|
|
|
108
108
|
*/
|
|
109
109
|
getRelativePosition(curNode, position) {
|
|
110
110
|
let curPos = 0;
|
|
111
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
111
112
|
let _curNode = curNode;
|
|
112
113
|
const nodeTypeText = 3;
|
|
113
114
|
if (!_curNode) {
|
|
@@ -117,6 +118,7 @@ export default class Caret {
|
|
|
117
118
|
while (_curNode.nodeType !== nodeTypeText) {
|
|
118
119
|
_curNode = _curNode.childNodes[0];
|
|
119
120
|
}
|
|
121
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
120
122
|
const _correctedPosition = position;
|
|
121
123
|
return { _curNode, _correctedPosition };
|
|
122
124
|
}
|
|
@@ -124,7 +126,7 @@ export default class Caret {
|
|
|
124
126
|
if (_curNode && _curNode.nodeType !== undefined) {
|
|
125
127
|
while (curPos < position && _curNode.nodeType !== nodeTypeText) {
|
|
126
128
|
i++;
|
|
127
|
-
if (_curNode.childNodes[i]
|
|
129
|
+
if (_curNode.childNodes[i]) {
|
|
128
130
|
curPos += _curNode.childNodes[i].textContent?.length ?? 0;
|
|
129
131
|
if (curPos >= position) {
|
|
130
132
|
_curNode = _curNode.childNodes[i];
|
|
@@ -137,6 +139,7 @@ export default class Caret {
|
|
|
137
139
|
}
|
|
138
140
|
}
|
|
139
141
|
}
|
|
142
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
140
143
|
const _correctedPosition = position - curPos;
|
|
141
144
|
return { _curNode, _correctedPosition };
|
|
142
145
|
}
|
|
@@ -153,8 +156,10 @@ export default class Caret {
|
|
|
153
156
|
if (typeof position === 'object') {
|
|
154
157
|
const range = new Range();
|
|
155
158
|
const start = this.getRelativePosition(curNode, position.startOffset);
|
|
159
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
156
160
|
range.setStart(start._curNode, start._correctedPosition);
|
|
157
161
|
const end = this.getRelativePosition(curNode, position.endOffset);
|
|
162
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
158
163
|
range.setEnd(end._curNode, end._correctedPosition);
|
|
159
164
|
correctedPosition = range;
|
|
160
165
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PureComponent, InputHTMLAttributes, CSSProperties, Ref, ReactNode } from 'react';
|
|
1
|
+
import { PureComponent, type InputHTMLAttributes, type CSSProperties, type Ref, type ReactNode } from 'react';
|
|
2
2
|
export interface CheckboxProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
3
|
label?: string | null | undefined;
|
|
4
4
|
containerClassName?: string | null | undefined;
|
|
@@ -4,7 +4,7 @@ import classNames from 'classnames';
|
|
|
4
4
|
import checkmarkIcon from '@jetbrains/icons/checkmark-12px';
|
|
5
5
|
import minusIcon from '@jetbrains/icons/remove-12px';
|
|
6
6
|
import Icon from '../icon/icon';
|
|
7
|
-
import { createComposedRef } from '../global/
|
|
7
|
+
import { createComposedRef } from '../global/compose-refs';
|
|
8
8
|
import ControlHelp from '../control-help/control-help';
|
|
9
9
|
import styles from './checkbox.css';
|
|
10
10
|
/**
|
|
@@ -18,19 +18,19 @@ export default class Checkbox extends PureComponent {
|
|
|
18
18
|
indeterminate: false,
|
|
19
19
|
};
|
|
20
20
|
componentDidMount() {
|
|
21
|
-
if (this.input
|
|
21
|
+
if (this.input) {
|
|
22
22
|
this.input.indeterminate = this.props.indeterminate;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
componentDidUpdate(prevProps) {
|
|
26
26
|
const { indeterminate } = this.props;
|
|
27
|
-
if (this.input
|
|
27
|
+
if (this.input && indeterminate !== prevProps.indeterminate) {
|
|
28
28
|
this.input.indeterminate = this.props.indeterminate;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
input;
|
|
32
32
|
inputRef = (el) => {
|
|
33
|
-
if (el
|
|
33
|
+
if (el) {
|
|
34
34
|
el.indeterminate = this.props.indeterminate;
|
|
35
35
|
}
|
|
36
36
|
this.input = el;
|
|
@@ -42,6 +42,6 @@ export default class Checkbox extends PureComponent {
|
|
|
42
42
|
const containerClasses = classNames(styles.checkbox, containerClassName);
|
|
43
43
|
const cellClasses = classNames(styles.cell, cellClassName);
|
|
44
44
|
const labelClasses = classNames(styles.label, labelClassName);
|
|
45
|
-
return (_jsxs("label", { className: containerClasses, style: containerStyle, "data-test":
|
|
45
|
+
return (_jsxs("label", { className: containerClasses, style: containerStyle, "data-test": 'ring-checkbox', children: [_jsx("input", { ...restProps, "data-checked": restProps.checked, ref: this.composedInputRef(this.inputRef, inputRef), type: 'checkbox', className: classes }), _jsx("div", { className: styles.cellWrapper, children: _jsxs("span", { className: cellClasses, children: [_jsx(Icon, { glyph: checkmarkIcon, className: styles.check }), _jsx(Icon, { glyph: minusIcon, className: styles.minus })] }) }), _jsxs("span", { className: labelClasses, children: [label || children, help && _jsx(ControlHelp, { children: help })] })] }));
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -35,7 +35,7 @@ async function copy(text, successMessage, errorMessage, delay = ALERT_DELAY, isH
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
const clipboard = {
|
|
38
|
-
copyText:
|
|
39
|
-
copyHTML:
|
|
38
|
+
copyText: (text, successMessage, errorMessage, delay = ALERT_DELAY) => copy(text, successMessage, errorMessage, delay),
|
|
39
|
+
copyHTML: (html, successMessage, errorMessage, delay = ALERT_DELAY) => copy(html, successMessage, errorMessage, delay, true),
|
|
40
40
|
};
|
|
41
41
|
export default clipboard;
|
package/components/code/code.css
CHANGED
package/components/code/code.js
CHANGED
|
@@ -32,12 +32,14 @@ export default class Code extends PureComponent {
|
|
|
32
32
|
code;
|
|
33
33
|
async highlight() {
|
|
34
34
|
const codeRef = this.codeRef;
|
|
35
|
-
if (codeRef
|
|
35
|
+
if (!codeRef) {
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
38
38
|
const { language, inline, replacer } = this.props;
|
|
39
39
|
if (!inline) {
|
|
40
|
-
if (language
|
|
40
|
+
if (language !== null &&
|
|
41
|
+
language !== undefined &&
|
|
42
|
+
(highlight.getLanguage(language) === null || highlight.getLanguage(language) === undefined)) {
|
|
41
43
|
await registerLanguage(language);
|
|
42
44
|
}
|
|
43
45
|
// @ts-expect-error https://github.com/highlightjs/highlight.js/issues/2945
|
|
@@ -69,7 +71,7 @@ export default class Code extends PureComponent {
|
|
|
69
71
|
[styles.inline]: inline,
|
|
70
72
|
[styles.softWrap]: softWrap,
|
|
71
73
|
});
|
|
72
|
-
return (_jsx(Tag, { className: classes, "data-test":
|
|
74
|
+
return (_jsx(Tag, { className: classes, "data-test": 'ring-code', children: _jsx("code", {
|
|
73
75
|
// should be focusable because it can be scrollable
|
|
74
76
|
tabIndex: inline ? -1 : 0, ref: this.initCodeRef, className: highlightStyles.highlightContainer, children: normalizeIndent(code) }) }));
|
|
75
77
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
|
|
1
|
+
import React, { type PropsWithChildren } from 'react';
|
|
2
|
+
interface Props {
|
|
3
3
|
minHeight?: number;
|
|
4
4
|
className?: string;
|
|
5
5
|
'data-test'?: string | null | undefined;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
7
|
/**
|
|
8
8
|
* @name CollapseContent
|
|
9
9
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
type ChildrenFunction = (collapsed: boolean) => React.ReactElement<any>;
|
|
3
|
-
|
|
3
|
+
interface Props {
|
|
4
4
|
children: ChildrenFunction | React.ReactElement<any>;
|
|
5
5
|
'data-test'?: string | null | undefined;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
7
|
/**
|
|
8
8
|
* @name CollapseControl
|
|
9
9
|
*/
|