@jetbrains/ring-ui 7.0.11 → 7.0.12
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.d.ts +1 -1
- package/components/alert/alert.js +8 -14
- package/components/alert/container.js +3 -4
- package/components/alert-service/alert-service.d.ts +1 -1
- package/components/alert-service/alert-service.js +5 -8
- package/components/auth/down-notification.js +4 -12
- package/components/auth/iframe-flow.js +2 -3
- package/components/auth-dialog/auth-dialog.d.ts +1 -1
- package/components/auth-dialog/auth-dialog.js +2 -18
- package/components/auth-dialog-service/auth-dialog-service.js +2 -3
- package/components/avatar/avatar.d.ts +1 -1
- package/components/avatar/avatar.js +4 -8
- package/components/avatar/fallback-avatar.d.ts +1 -1
- package/components/avatar/fallback-avatar.js +2 -18
- package/components/breadcrumbs/breadcrumbs.d.ts +1 -1
- package/components/breadcrumbs/breadcrumbs.js +2 -4
- package/components/button/button.css +1 -1
- package/components/button/button.d.ts +1 -1
- package/components/button/button.js +4 -11
- package/components/button-group/button-group.d.ts +1 -1
- package/components/button-group/button-group.js +2 -5
- package/components/button-group/caption.d.ts +1 -1
- package/components/button-group/caption.js +2 -1
- package/components/button-set/button-set.d.ts +1 -1
- package/components/button-set/button-set.js +2 -3
- package/components/button-toolbar/button-toolbar.d.ts +1 -1
- package/components/button-toolbar/button-toolbar.js +2 -1
- package/components/checkbox/checkbox.d.ts +1 -1
- package/components/checkbox/checkbox.js +2 -13
- package/components/code/code.d.ts +1 -1
- package/components/code/code.js +5 -8
- package/components/collapse/collapse-content.js +3 -7
- package/components/collapse/collapse-control.js +3 -5
- package/components/collapse/collapse.js +8 -12
- package/components/confirm/confirm.d.ts +1 -1
- package/components/confirm/confirm.js +2 -15
- package/components/confirm-service/confirm-service.js +2 -3
- package/components/content-layout/content-layout.d.ts +1 -1
- package/components/content-layout/content-layout.js +2 -6
- package/components/content-layout/sidebar.d.ts +1 -1
- package/components/content-layout/sidebar.js +2 -11
- package/components/contenteditable/contenteditable.d.ts +2 -2
- package/components/contenteditable/contenteditable.js +6 -5
- package/components/control-help/control-help.d.ts +1 -1
- package/components/control-help/control-help.js +2 -1
- package/components/control-label/control-label.js +3 -5
- package/components/data-list/data-list.d.ts +3 -3
- package/components/data-list/data-list.js +8 -17
- package/components/data-list/data-list.mock.d.ts +1 -1
- package/components/data-list/data-list.mock.js +27 -72
- package/components/data-list/item.d.ts +2 -2
- package/components/data-list/item.js +7 -23
- package/components/data-list/title.d.ts +1 -1
- package/components/data-list/title.js +2 -11
- package/components/date-picker/date-input.d.ts +1 -1
- package/components/date-picker/date-input.js +2 -1
- package/components/date-picker/date-picker.d.ts +1 -1
- package/components/date-picker/date-picker.js +11 -23
- package/components/date-picker/date-popup.d.ts +1 -1
- package/components/date-picker/date-popup.js +9 -20
- package/components/date-picker/day.d.ts +1 -1
- package/components/date-picker/day.js +3 -4
- package/components/date-picker/month-names.d.ts +1 -1
- package/components/date-picker/month-names.js +7 -12
- package/components/date-picker/month-slider.d.ts +1 -1
- package/components/date-picker/month-slider.js +3 -4
- package/components/date-picker/month.d.ts +1 -1
- package/components/date-picker/month.js +3 -4
- package/components/date-picker/months.d.ts +1 -1
- package/components/date-picker/months.js +5 -8
- package/components/date-picker/weekdays.d.ts +1 -1
- package/components/date-picker/weekdays.js +3 -6
- package/components/date-picker/years.d.ts +1 -1
- package/components/date-picker/years.js +5 -8
- package/components/dialog/dialog.d.ts +1 -1
- package/components/dialog/dialog.js +12 -33
- package/components/dropdown/anchor.d.ts +1 -1
- package/components/dropdown/anchor.js +2 -3
- package/components/dropdown/dropdown.d.ts +1 -1
- package/components/dropdown/dropdown.js +7 -10
- package/components/dropdown-menu/dropdown-menu.js +4 -9
- package/components/editable-heading/editable-heading.d.ts +2 -2
- package/components/editable-heading/editable-heading.js +2 -30
- package/components/error-bubble/error-bubble.d.ts +1 -1
- package/components/error-bubble/error-bubble.js +2 -8
- package/components/error-message/error-message.d.ts +1 -1
- package/components/error-message/error-message.js +2 -10
- package/components/footer/footer.js +7 -14
- package/components/global/create-stateful-context.d.ts +1 -1
- package/components/global/create-stateful-context.js +2 -3
- package/components/global/focus-sensor-hoc.js +2 -1
- package/components/global/react-dom-renderer.d.ts +1 -1
- package/components/global/react-dom-renderer.js +2 -1
- package/components/global/rerender-hoc.js +3 -2
- package/components/global/theme.js +3 -11
- package/components/grid/col.d.ts +1 -1
- package/components/grid/col.js +2 -3
- package/components/grid/grid.d.ts +1 -1
- package/components/grid/grid.js +2 -3
- package/components/grid/row.d.ts +1 -1
- package/components/grid/row.js +2 -3
- package/components/group/group.d.ts +1 -1
- package/components/group/group.js +2 -3
- package/components/header/header-icon.d.ts +1 -1
- package/components/header/header-icon.js +2 -1
- package/components/header/header.d.ts +1 -1
- package/components/header/header.js +3 -4
- package/components/header/links.d.ts +1 -1
- package/components/header/links.js +2 -1
- package/components/header/logo.d.ts +1 -1
- package/components/header/logo.js +2 -3
- package/components/header/profile.d.ts +1 -1
- package/components/header/profile.js +6 -19
- package/components/header/services-link.d.ts +1 -1
- package/components/header/services-link.js +5 -6
- package/components/header/services.d.ts +1 -1
- package/components/header/services.js +10 -15
- package/components/header/smart-profile.d.ts +1 -1
- package/components/header/smart-profile.js +2 -1
- package/components/header/smart-services.d.ts +1 -1
- package/components/header/smart-services.js +2 -1
- package/components/header/tray.d.ts +1 -1
- package/components/header/tray.js +3 -4
- package/components/heading/heading.js +6 -7
- package/components/i18n/i18n-context.js +2 -1
- package/components/icon/icon.d.ts +1 -1
- package/components/icon/icon.js +2 -3
- package/components/icon/icon__svg.d.ts +1 -1
- package/components/icon/icon__svg.js +3 -2
- package/components/input/input.d.ts +1 -1
- package/components/input/input.js +2 -15
- package/components/island/adaptive-island-hoc.d.ts +2 -2
- package/components/island/adaptive-island-hoc.js +2 -5
- package/components/island/content.d.ts +1 -1
- package/components/island/content.js +5 -12
- package/components/island/header.d.ts +1 -1
- package/components/island/header.js +5 -12
- package/components/island/island.d.ts +3 -3
- package/components/island/island.js +2 -3
- package/components/link/clickableLink.d.ts +1 -1
- package/components/link/clickableLink.js +2 -4
- package/components/link/link.d.ts +4 -4
- package/components/link/link.js +3 -6
- package/components/list/list.d.ts +6 -6
- package/components/list/list.js +18 -38
- package/components/list/list__custom.d.ts +1 -1
- package/components/list/list__custom.js +2 -4
- package/components/list/list__hint.d.ts +1 -1
- package/components/list/list__hint.js +2 -3
- package/components/list/list__item.d.ts +1 -1
- package/components/list/list__item.js +3 -31
- package/components/list/list__link.d.ts +1 -1
- package/components/list/list__link.js +2 -3
- package/components/list/list__separator.d.ts +1 -1
- package/components/list/list__separator.js +2 -3
- package/components/list/list__title.d.ts +1 -1
- package/components/list/list__title.js +2 -8
- package/components/loader/loader.d.ts +1 -1
- package/components/loader/loader.js +2 -1
- package/components/loader-inline/loader-inline.d.ts +1 -1
- package/components/loader-inline/loader-inline.js +3 -5
- package/components/loader-screen/loader-screen.d.ts +1 -1
- package/components/loader-screen/loader-screen.js +2 -3
- package/components/login-dialog/login-dialog.d.ts +1 -1
- package/components/login-dialog/login-dialog.js +2 -9
- package/components/login-dialog/service.js +2 -3
- package/components/markdown/markdown.d.ts +1 -1
- package/components/markdown/markdown.js +2 -3
- package/components/message/message.d.ts +1 -1
- package/components/message/message.js +2 -21
- package/components/pager/pager.d.ts +5 -5
- package/components/pager/pager.js +11 -55
- package/components/panel/panel.d.ts +1 -1
- package/components/panel/panel.js +2 -3
- package/components/popup/popup.d.ts +2 -2
- package/components/popup/popup.js +13 -25
- package/components/popup/popup.target.js +3 -6
- package/components/popup-menu/popup-menu.d.ts +1 -1
- package/components/popup-menu/popup-menu.js +2 -3
- package/components/progress-bar/progress-bar.d.ts +1 -1
- package/components/progress-bar/progress-bar.js +2 -3
- package/components/query-assist/query-assist.d.ts +2 -2
- package/components/query-assist/query-assist.js +7 -45
- package/components/query-assist/query-assist__suggestions.d.ts +1 -1
- package/components/query-assist/query-assist__suggestions.js +5 -10
- package/components/radio/radio.d.ts +1 -1
- package/components/radio/radio.js +2 -1
- package/components/radio/radio__item.d.ts +1 -1
- package/components/radio/radio__item.js +3 -11
- package/components/scrollable-section/scrollable-section.d.ts +1 -1
- package/components/scrollable-section/scrollable-section.js +3 -2
- package/components/select/select.d.ts +3 -3
- package/components/select/select.js +43 -91
- package/components/select/select__filter.d.ts +1 -1
- package/components/select/select__filter.js +2 -5
- package/components/select/select__popup.d.ts +7 -7
- package/components/select/select__popup.js +13 -43
- package/components/shortcuts/shortcuts-hoc.d.ts +2 -2
- package/components/shortcuts/shortcuts-hoc.js +2 -3
- package/components/slider/slider.js +31 -49
- package/components/tab-trap/tab-trap.js +9 -15
- package/components/table/cell.d.ts +1 -1
- package/components/table/cell.js +2 -3
- package/components/table/disable-hover-hoc.d.ts +2 -2
- package/components/table/disable-hover-hoc.js +2 -1
- package/components/table/header-cell.d.ts +1 -1
- package/components/table/header-cell.js +2 -12
- package/components/table/header.d.ts +2 -2
- package/components/table/header.js +5 -18
- package/components/table/multitable.d.ts +1 -1
- package/components/table/multitable.js +3 -4
- package/components/table/row-with-focus-sensor.d.ts +1 -1
- package/components/table/row-with-focus-sensor.js +2 -1
- package/components/table/row.d.ts +1 -1
- package/components/table/row.js +5 -24
- package/components/table/selection-shortcuts-hoc.js +2 -1
- package/components/table/simple-table.d.ts +1 -1
- package/components/table/simple-table.js +2 -1
- package/components/table/smart-table.d.ts +1 -1
- package/components/table/smart-table.js +2 -1
- package/components/table/table.d.ts +4 -4
- package/components/table/table.js +8 -29
- package/components/tabs/collapsible-more.d.ts +3 -3
- package/components/tabs/collapsible-more.js +6 -13
- package/components/tabs/collapsible-tab.d.ts +1 -1
- package/components/tabs/collapsible-tab.js +3 -2
- package/components/tabs/collapsible-tabs.d.ts +2 -2
- package/components/tabs/collapsible-tabs.js +2 -10
- package/components/tabs/dumb-tabs.d.ts +2 -3
- package/components/tabs/dumb-tabs.js +3 -9
- package/components/tabs/smart-tabs.d.ts +1 -1
- package/components/tabs/smart-tabs.js +2 -3
- package/components/tabs/tab-link.d.ts +1 -1
- package/components/tabs/tab-link.js +2 -9
- package/components/tabs/tab.d.ts +1 -1
- package/components/tabs/tab.js +2 -3
- package/components/tag/tag.d.ts +5 -5
- package/components/tag/tag.js +15 -23
- package/components/tags-input/tags-input.d.ts +1 -1
- package/components/tags-input/tags-input.js +4 -12
- package/components/tags-list/tags-list.d.ts +2 -2
- package/components/tags-list/tags-list.js +4 -8
- package/components/text/text.d.ts +1 -1
- package/components/text/text.js +2 -3
- package/components/toggle/toggle.d.ts +1 -1
- package/components/toggle/toggle.js +2 -17
- package/components/tooltip/tooltip.d.ts +1 -1
- package/components/tooltip/tooltip.js +2 -11
- package/components/user-agreement/service.js +3 -12
- package/components/user-agreement/user-agreement.d.ts +1 -1
- package/components/user-agreement/user-agreement.js +2 -29
- package/components/user-card/card.d.ts +1 -1
- package/components/user-card/card.js +4 -37
- package/components/user-card/smart-user-card-tooltip.d.ts +2 -2
- package/components/user-card/smart-user-card-tooltip.js +3 -6
- package/components/user-card/tooltip.d.ts +2 -2
- package/components/user-card/tooltip.js +9 -12
- package/package.json +5 -5
|
@@ -92,6 +92,6 @@ export default class Alert extends PureComponent<AlertProps, State> {
|
|
|
92
92
|
*/
|
|
93
93
|
private _getIcon;
|
|
94
94
|
storeAlertRef: (node: HTMLDivElement | null) => void;
|
|
95
|
-
render():
|
|
95
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
96
96
|
}
|
|
97
97
|
export { default as Container } from './container';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { PureComponent } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import exceptionIcon from '@jetbrains/icons/exception';
|
|
5
5
|
import checkmarkIcon from '@jetbrains/icons/checkmark';
|
|
@@ -114,13 +114,11 @@ export default class Alert extends PureComponent {
|
|
|
114
114
|
* @private
|
|
115
115
|
*/
|
|
116
116
|
_getCaption() {
|
|
117
|
-
return (
|
|
117
|
+
return (_jsx("span", { className: classNames(styles.caption, this.props.captionClassName, {
|
|
118
118
|
[styles.withCloseButton]: this.props.closeable,
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
{this.props.children}
|
|
123
|
-
</span>);
|
|
119
|
+
}), onClick: this._handleCaptionsLinksClick,
|
|
120
|
+
// We only process clicks on `a` elements, see above
|
|
121
|
+
role: "presentation", children: this.props.children }));
|
|
124
122
|
}
|
|
125
123
|
/**
|
|
126
124
|
* @private
|
|
@@ -129,10 +127,10 @@ export default class Alert extends PureComponent {
|
|
|
129
127
|
_getIcon() {
|
|
130
128
|
const glyph = TypeToIcon[this.props.type];
|
|
131
129
|
if (glyph) {
|
|
132
|
-
return
|
|
130
|
+
return _jsx(Icon, { glyph: glyph, className: styles.icon, color: TypeToIconColor[this.props.type] || Color.DEFAULT });
|
|
133
131
|
}
|
|
134
132
|
else if (this.props.type === AlertType.LOADING) {
|
|
135
|
-
return
|
|
133
|
+
return _jsx(Loader, { className: styles.loader });
|
|
136
134
|
}
|
|
137
135
|
return '';
|
|
138
136
|
}
|
|
@@ -151,11 +149,7 @@ export default class Alert extends PureComponent {
|
|
|
151
149
|
});
|
|
152
150
|
const height = this.state.height;
|
|
153
151
|
const style = height ? { marginBottom: -height } : undefined;
|
|
154
|
-
return (
|
|
155
|
-
{this._getIcon()}
|
|
156
|
-
{this._getCaption()}
|
|
157
|
-
{this.props.closeable ? (<Button icon={closeIcon} className={classNames(styles.close, closeButtonClassName)} data-test="alert-close" aria-label="close alert" onClick={this.closeRequest}/>) : ('')}
|
|
158
|
-
</ThemeProvider>);
|
|
152
|
+
return (_jsxs(ThemeProvider, { theme: theme, className: classes, "data-test": dataTests('alert', dataTest), "data-test-type": type, style: style, ref: this.storeAlertRef, children: [this._getIcon(), this._getCaption(), this.props.closeable ? (_jsx(Button, { icon: closeIcon, className: classNames(styles.close, closeButtonClassName), "data-test": "alert-close", "aria-label": "close alert", onClick: this.closeRequest })) : ('')] }));
|
|
159
153
|
}
|
|
160
154
|
}
|
|
161
155
|
export { default as Container } from './container';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { Children, cloneElement, PureComponent, isValidElement } from 'react';
|
|
2
3
|
import { createPortal } from 'react-dom';
|
|
3
4
|
import classNames from 'classnames';
|
|
@@ -10,8 +11,7 @@ export default class Alerts extends PureComponent {
|
|
|
10
11
|
if (!show) {
|
|
11
12
|
return null;
|
|
12
13
|
}
|
|
13
|
-
return createPortal(
|
|
14
|
-
{Children.map(children, child => {
|
|
14
|
+
return createPortal(_jsx("div", { "data-test": "alert-container", className: classes, "aria-live": "polite", ...restProps, children: Children.map(children, child => {
|
|
15
15
|
if (!isValidElement(child)) {
|
|
16
16
|
return child;
|
|
17
17
|
}
|
|
@@ -19,7 +19,6 @@ export default class Alerts extends PureComponent {
|
|
|
19
19
|
return cloneElement(child, {
|
|
20
20
|
className: alertClassNames,
|
|
21
21
|
});
|
|
22
|
-
})}
|
|
23
|
-
</div>, document.body);
|
|
22
|
+
}) }), document.body);
|
|
24
23
|
}
|
|
25
24
|
}
|
|
@@ -14,7 +14,7 @@ declare class AlertService {
|
|
|
14
14
|
containerElement: HTMLDivElement;
|
|
15
15
|
reactRoot: import("react-dom/client").Root;
|
|
16
16
|
_getShowingAlerts(): AlertItem[];
|
|
17
|
-
renderAlertContainer(alerts: readonly AlertItem[]): import("react").JSX.Element;
|
|
17
|
+
renderAlertContainer(alerts: readonly AlertItem[]): import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
/**
|
|
19
19
|
* Renders alert container into virtual node to skip maintaining container
|
|
20
20
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { createRoot } from 'react-dom/client';
|
|
2
3
|
import getUID from '../global/get-uid';
|
|
3
4
|
import Alert, { ANIMATION_TIME, Container as AlertContainer } from '../alert/alert';
|
|
@@ -15,16 +16,12 @@ class AlertService {
|
|
|
15
16
|
}
|
|
16
17
|
renderAlertContainer(alerts) {
|
|
17
18
|
if (alerts.length === 0) {
|
|
18
|
-
return
|
|
19
|
+
return _jsx("span", {});
|
|
19
20
|
}
|
|
20
|
-
return (
|
|
21
|
-
{alerts.map(alert => {
|
|
21
|
+
return (_jsx(AlertContainer, { children: alerts.map(alert => {
|
|
22
22
|
const { message, key, ...rest } = alert;
|
|
23
|
-
return (
|
|
24
|
-
|
|
25
|
-
</Alert>);
|
|
26
|
-
})}
|
|
27
|
-
</AlertContainer>);
|
|
23
|
+
return (_jsx(Alert, { ...rest, children: message }, key));
|
|
24
|
+
}) }));
|
|
28
25
|
}
|
|
29
26
|
/**
|
|
30
27
|
* Renders alert container into virtual node to skip maintaining container
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import alertService from '../alert-service/alert-service';
|
|
3
3
|
import Alert from '../alert/alert';
|
|
4
4
|
import Link from '../link/link';
|
|
@@ -18,15 +18,7 @@ function renderAlert(message, type = Alert.Type.WARNING) {
|
|
|
18
18
|
}
|
|
19
19
|
function Message({ translations, onCheckAgain }) {
|
|
20
20
|
const { backendIsNotAvailable, checkAgain, errorMessage } = translations;
|
|
21
|
-
return (
|
|
22
|
-
<Group>
|
|
23
|
-
<div className={styles.title}>{backendIsNotAvailable}</div>
|
|
24
|
-
</Group>
|
|
25
|
-
<span className={styles.error}>{errorMessage} </span>
|
|
26
|
-
<Link onClick={onCheckAgain} data-test="check-again">
|
|
27
|
-
{checkAgain}
|
|
28
|
-
</Link>
|
|
29
|
-
</div>);
|
|
21
|
+
return (_jsxs("div", { "data-test": "ring-backend-down-notification", children: [_jsx(Group, { children: _jsx("div", { className: styles.title, children: backendIsNotAvailable }) }), _jsxs("span", { className: styles.error, children: [errorMessage, " "] }), _jsx(Link, { onClick: onCheckAgain, "data-test": "check-again", children: checkAgain })] }));
|
|
30
22
|
}
|
|
31
23
|
export default function onBackendDown({ onCheckAgain, translations }) {
|
|
32
24
|
async function checkAgainWithoutClosing(e) {
|
|
@@ -37,9 +29,9 @@ export default function onBackendDown({ onCheckAgain, translations }) {
|
|
|
37
29
|
await onCheckAgain();
|
|
38
30
|
}
|
|
39
31
|
catch (err) {
|
|
40
|
-
renderAlert(
|
|
32
|
+
renderAlert(_jsx(Message, { translations: translations, onCheckAgain: checkAgainWithoutClosing }));
|
|
41
33
|
}
|
|
42
34
|
}
|
|
43
|
-
renderAlert(
|
|
35
|
+
renderAlert(_jsx(Message, { translations: translations, onCheckAgain: checkAgainWithoutClosing }));
|
|
44
36
|
return () => alertService.remove(key);
|
|
45
37
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import loginDialogService from '../login-dialog/service';
|
|
2
3
|
import Link from '../link/link';
|
|
3
4
|
import AuthResponseParser from './response-parser';
|
|
@@ -22,9 +23,7 @@ export default class IFrameFlow {
|
|
|
22
23
|
const authRequest = await this._requestBuilder.prepareAuthRequest(
|
|
23
24
|
// eslint-disable-next-line camelcase
|
|
24
25
|
{ request_credentials: 'required', auth_mode: 'bypass_to_login' }, { nonRedirect: false });
|
|
25
|
-
const renderFallbackLink = () => (
|
|
26
|
-
{this._translations.nothingHappensLink}
|
|
27
|
-
</Link>);
|
|
26
|
+
const renderFallbackLink = () => (_jsx(Link, { href: authRequest.url, target: "_self", children: this._translations.nothingHappensLink }));
|
|
28
27
|
return new Promise((resolve, reject) => {
|
|
29
28
|
this.hideDialog = loginDialogService({
|
|
30
29
|
url: authRequest.url,
|
|
@@ -38,5 +38,5 @@ export default class AuthDialog extends Component<AuthDialogProps> {
|
|
|
38
38
|
componentWillUnmount(): void;
|
|
39
39
|
onEscPress: () => void;
|
|
40
40
|
onRetryPress: () => Promise<void>;
|
|
41
|
-
render(): import("react").JSX.Element;
|
|
41
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
42
42
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { Component } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import { Content } from '../island/island';
|
|
@@ -53,23 +54,6 @@ export default class AuthDialog extends Component {
|
|
|
53
54
|
const title = (this.props.title || defaultTitle)
|
|
54
55
|
.replace('%serviceName%', serviceName ?? '')
|
|
55
56
|
.replace('{{serviceName}}', serviceName ?? '');
|
|
56
|
-
return (
|
|
57
|
-
<Content>
|
|
58
|
-
<div className={styles.content}>
|
|
59
|
-
{serviceImage && <img alt={`${serviceName} logo`} className={styles.logo} src={serviceImage}/>}
|
|
60
|
-
<H2 className={styles.title}>{title}</H2>
|
|
61
|
-
{errorMessage && <div className={styles.error}>{errorMessage}</div>}
|
|
62
|
-
<Button primary className={styles.firstButton} data-test="auth-dialog-confirm-button" onClick={onConfirm}>
|
|
63
|
-
{confirmLabel}
|
|
64
|
-
</Button>
|
|
65
|
-
{onTryAgain && (<Button className={styles.button} data-test="auth-dialog-retry-button" onClick={() => this.onRetryPress()} loader={retrying} disabled={retrying}>
|
|
66
|
-
{tryAgainLabel}
|
|
67
|
-
</Button>)}
|
|
68
|
-
<Button className={styles.button} data-test="auth-dialog-cancel-button" onClick={onCancel}>
|
|
69
|
-
{cancelLabel}
|
|
70
|
-
</Button>
|
|
71
|
-
</div>
|
|
72
|
-
</Content>
|
|
73
|
-
</Dialog>);
|
|
57
|
+
return (_jsx(Dialog, { label: title, "data-test": "ring-auth-dialog", className: className, contentClassName: classNames(className, styles.dialog), onEscPress: this.onEscPress, show: show, trapFocus: true, children: _jsx(Content, { children: _jsxs("div", { className: styles.content, children: [serviceImage && _jsx("img", { alt: `${serviceName} logo`, className: styles.logo, src: serviceImage }), _jsx(H2, { className: styles.title, children: title }), errorMessage && _jsx("div", { className: styles.error, children: errorMessage }), _jsx(Button, { primary: true, className: styles.firstButton, "data-test": "auth-dialog-confirm-button", onClick: onConfirm, children: confirmLabel }), onTryAgain && (_jsx(Button, { className: styles.button, "data-test": "auth-dialog-retry-button", onClick: () => this.onRetryPress(), loader: retrying, disabled: retrying, children: tryAgainLabel })), _jsx(Button, { className: styles.button, "data-test": "auth-dialog-cancel-button", onClick: onCancel, children: cancelLabel })] }) }) }));
|
|
74
58
|
}
|
|
75
59
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { createRoot } from 'react-dom/client';
|
|
2
3
|
import { ControlsHeightContext, getGlobalControlsHeight } from '../global/controls-height';
|
|
3
4
|
import AuthDialog from '../auth-dialog/auth-dialog';
|
|
@@ -10,9 +11,7 @@ export const reactRoot = createRoot(containerElement);
|
|
|
10
11
|
* Renders AuthDialog into virtual node to skip maintaining container
|
|
11
12
|
*/
|
|
12
13
|
function renderAuthDialog(props) {
|
|
13
|
-
reactRoot.render(
|
|
14
|
-
<AuthDialog {...props}/>
|
|
15
|
-
</ControlsHeightContext.Provider>);
|
|
14
|
+
reactRoot.render(_jsx(ControlsHeightContext.Provider, { value: getGlobalControlsHeight(), children: _jsx(AuthDialog, { ...props }) }));
|
|
16
15
|
}
|
|
17
16
|
export default function showAuthDialog(props = {}) {
|
|
18
17
|
renderAuthDialog({
|
|
@@ -34,6 +34,6 @@ export default class Avatar extends PureComponent<AvatarProps> {
|
|
|
34
34
|
};
|
|
35
35
|
handleError: () => void;
|
|
36
36
|
handleSuccess: () => void;
|
|
37
|
-
render(): import("react").JSX.Element;
|
|
37
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
38
38
|
}
|
|
39
39
|
export type AvatarAttrs = JSX.LibraryManagedAttributes<typeof Avatar, AvatarProps>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { PureComponent } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import { encodeURL, isDataURI, parseQueryString } from '../global/url';
|
|
@@ -52,9 +53,7 @@ export default class Avatar extends PureComponent {
|
|
|
52
53
|
...style,
|
|
53
54
|
};
|
|
54
55
|
if (!url || this.state.errorUrl === url) {
|
|
55
|
-
return (
|
|
56
|
-
{username != null && <FallbackAvatar size={size} round={round} username={username}/>}
|
|
57
|
-
</span>);
|
|
56
|
+
return (_jsx("span", { ...restProps, "data-test": "avatar", className: classNames(styles.avatar, this.props.className, { [styles.empty]: username == null }), style: styleObj, children: username != null && _jsx(FallbackAvatar, { size: size, round: round, username: username }) }));
|
|
58
57
|
}
|
|
59
58
|
let src = url;
|
|
60
59
|
if (!skipParams && !isDataURI(url)) {
|
|
@@ -75,13 +74,10 @@ export default class Avatar extends PureComponent {
|
|
|
75
74
|
subavatarSizeString,
|
|
76
75
|
};
|
|
77
76
|
subavatarSrc = skipParams ? subavatar : encodeURL(urlStart, queryParams);
|
|
78
|
-
return (
|
|
79
|
-
<img {...restProps} onError={this.handleError} onLoad={this.handleSuccess} className={classNames(styles.avatar, this.props.className)} style={styleObj} src={src} alt="User avatar"/>
|
|
80
|
-
<img {...restProps} data-test="avatar" onError={this.handleError} onLoad={this.handleSuccess} className={classNames(styles.subavatar)} style={styleObjGroup} src={subavatarSrc} alt="Subavatar"/>
|
|
81
|
-
</div>);
|
|
77
|
+
return (_jsxs("div", { children: [_jsx("img", { ...restProps, onError: this.handleError, onLoad: this.handleSuccess, className: classNames(styles.avatar, this.props.className), style: styleObj, src: src, alt: "User avatar" }), _jsx("img", { ...restProps, "data-test": "avatar", onError: this.handleError, onLoad: this.handleSuccess, className: classNames(styles.subavatar), style: styleObjGroup, src: subavatarSrc, alt: "Subavatar" })] }));
|
|
82
78
|
}
|
|
83
79
|
else {
|
|
84
|
-
return (
|
|
80
|
+
return (_jsx("img", { ...restProps, "data-test": "avatar", onError: this.handleError, onLoad: this.handleSuccess, className: classNames(styles.avatar, this.props.className), style: styleObj, src: src, alt: "User avatar" }));
|
|
85
81
|
}
|
|
86
82
|
}
|
|
87
83
|
}
|
|
@@ -4,4 +4,4 @@ export interface FallbackAvatarProps {
|
|
|
4
4
|
size: Size;
|
|
5
5
|
round: boolean | null | undefined;
|
|
6
6
|
}
|
|
7
|
-
export default function FallbackAvatar({ username, size, round }: FallbackAvatarProps): import("react").JSX.Element;
|
|
7
|
+
export default function FallbackAvatar({ username, size, round }: FallbackAvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { useMemo } from 'react';
|
|
2
3
|
import getUID from '../global/get-uid';
|
|
3
4
|
const colorPairs = [
|
|
@@ -89,22 +90,5 @@ export default function FallbackAvatar({ username, size, round }) {
|
|
|
89
90
|
const sizes = Sizes[sizeKey];
|
|
90
91
|
const radius = round ? '50%' : sizes.radius;
|
|
91
92
|
const gradientId = useMemo(() => getUID('gradient-'), []);
|
|
92
|
-
return (
|
|
93
|
-
<defs>
|
|
94
|
-
<linearGradient id={gradientId} x1="0" y1="0" x2="0" y2="1">
|
|
95
|
-
<stop stopColor={fromColor} offset="0"/>
|
|
96
|
-
<stop stopColor={toColor} offset="1"/>
|
|
97
|
-
</linearGradient>
|
|
98
|
-
</defs>
|
|
99
|
-
<g>
|
|
100
|
-
<rect fill={`url(#${gradientId})`} x="0" y="0" width={sizeKey} height={sizeKey} rx={radius} ry={radius}/>
|
|
101
|
-
<text x={sizes.text.x} y={sizes.text.y} fontFamily="Arial, Helvetica, sans-serif" fontSize={sizes.fontSize} letterSpacing={sizes.letterSpacing} fill="#FFFFFF" textAnchor={sizes.textAnchor} cursor="default">
|
|
102
|
-
<tspan>{extractLetters(username)}</tspan>
|
|
103
|
-
{sizes.underscore && (<tspan x={sizes.underscore.x} y={sizes.underscore.y}>
|
|
104
|
-
{'_'}
|
|
105
|
-
</tspan>)}
|
|
106
|
-
</text>
|
|
107
|
-
<title>{username}</title>
|
|
108
|
-
</g>
|
|
109
|
-
</svg>);
|
|
93
|
+
return (_jsxs("svg", { viewBox: `0 0 ${sizeKey} ${sizeKey}`, xmlns: "http://www.w3.org/2000/svg", children: [_jsx("defs", { children: _jsxs("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [_jsx("stop", { stopColor: fromColor, offset: "0" }), _jsx("stop", { stopColor: toColor, offset: "1" })] }) }), _jsxs("g", { children: [_jsx("rect", { fill: `url(#${gradientId})`, x: "0", y: "0", width: sizeKey, height: sizeKey, rx: radius, ry: radius }), _jsxs("text", { x: sizes.text.x, y: sizes.text.y, fontFamily: "Arial, Helvetica, sans-serif", fontSize: sizes.fontSize, letterSpacing: sizes.letterSpacing, fill: "#FFFFFF", textAnchor: sizes.textAnchor, cursor: "default", children: [_jsx("tspan", { children: extractLetters(username) }), sizes.underscore && (_jsx("tspan", { x: sizes.underscore.x, y: sizes.underscore.y, children: '_' }))] }), _jsx("title", { children: username })] })] }));
|
|
110
94
|
}
|
|
@@ -3,4 +3,4 @@ export interface BreadcrumbsSeparatorAttrs {
|
|
|
3
3
|
separatorClassName?: string | null | undefined;
|
|
4
4
|
children?: ReactNode;
|
|
5
5
|
}
|
|
6
|
-
export default function Breadcrumbs({ separatorClassName, children }: BreadcrumbsSeparatorAttrs): import("react").JSX.Element[];
|
|
6
|
+
export default function Breadcrumbs({ separatorClassName, children }: BreadcrumbsSeparatorAttrs): import("react/jsx-runtime").JSX.Element[];
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import classNames from 'classnames';
|
|
2
3
|
import { Children, Fragment } from 'react';
|
|
3
4
|
import styles from './breadcrumbs.css';
|
|
4
5
|
export default function Breadcrumbs({ separatorClassName, children }) {
|
|
5
6
|
return Children.toArray(children).map((child, index) => (
|
|
6
7
|
// eslint-disable-next-line react/no-array-index-key
|
|
7
|
-
|
|
8
|
-
{index > 0 && <span className={classNames(styles.separator, separatorClassName)}>{'/'}</span>}
|
|
9
|
-
{child}
|
|
10
|
-
</Fragment>));
|
|
8
|
+
_jsxs(Fragment, { children: [index > 0 && _jsx("span", { className: classNames(styles.separator, separatorClassName), children: '/' }), child] }, index)));
|
|
11
9
|
}
|
|
@@ -42,7 +42,7 @@ export declare class Button extends PureComponent<ButtonProps> {
|
|
|
42
42
|
static contextType: React.Context<ControlsHeight>;
|
|
43
43
|
context: React.ContextType<typeof ControlsHeightContext>;
|
|
44
44
|
buttonRef: React.RefObject<HTMLButtonElement>;
|
|
45
|
-
render():
|
|
45
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
46
46
|
}
|
|
47
47
|
export { Size as IconSize };
|
|
48
48
|
export type ContainerProps<T extends ButtonProps> = JSX.LibraryManagedAttributes<typeof Button, T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { createRef, PureComponent } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import chevronDown from '@jetbrains/icons/chevron-down';
|
|
5
5
|
import chevron12pxDown from '@jetbrains/icons/chevron-12px-down';
|
|
@@ -35,21 +35,14 @@ export class Button extends PureComponent {
|
|
|
35
35
|
inline: isInline,
|
|
36
36
|
height: height ?? this.context,
|
|
37
37
|
});
|
|
38
|
-
const content = (
|
|
39
|
-
{icon && (<Icon className={classNames(styles.icon, iconClassName)} glyph={icon} size={iconSize} loading={loader && isInline} suppressSizeWarning={iconSuppressSizeWarning}/>)}
|
|
40
|
-
{children}
|
|
41
|
-
{dropdown && <Icon glyph={isInline ? chevron12pxDown : chevronDown} className={styles.dropdownIcon}/>}
|
|
42
|
-
</>);
|
|
38
|
+
const content = (_jsxs(_Fragment, { children: [icon && (_jsx(Icon, { className: classNames(styles.icon, iconClassName), glyph: icon, size: iconSize, loading: loader && isInline, suppressSizeWarning: iconSuppressSizeWarning })), children, dropdown && _jsx(Icon, { glyph: isInline ? chevron12pxDown : chevronDown, className: styles.dropdownIcon })] }));
|
|
43
39
|
const commonProps = {
|
|
44
40
|
tabIndex: loader ? -1 : 0,
|
|
45
41
|
...props,
|
|
46
42
|
className: classes,
|
|
47
|
-
children: (
|
|
48
|
-
{loader && !isInline && <div className={styles.loaderBackground}/>}
|
|
49
|
-
{content}
|
|
50
|
-
</>),
|
|
43
|
+
children: (_jsxs(_Fragment, { children: [loader && !isInline && _jsx("div", { className: styles.loaderBackground }), content] })),
|
|
51
44
|
};
|
|
52
|
-
return commonProps.href != null ? (
|
|
45
|
+
return commonProps.href != null ? (_jsx(ClickableLink, { ...commonProps })) : (_jsx("button", { ref: this.buttonRef, type: "button", ...commonProps }));
|
|
53
46
|
}
|
|
54
47
|
}
|
|
55
48
|
export { Size as IconSize };
|
|
@@ -10,6 +10,6 @@ export interface ButtonGroupProps extends HTMLAttributes<HTMLElement> {
|
|
|
10
10
|
* @name Button Group
|
|
11
11
|
*/
|
|
12
12
|
export default class ButtonGroup extends PureComponent<ButtonGroupProps> {
|
|
13
|
-
render(): import("react").JSX.Element;
|
|
13
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
}
|
|
15
15
|
export { Caption };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { PureComponent } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import dataTests from '../global/data-tests';
|
|
@@ -12,11 +13,7 @@ export default class ButtonGroup extends PureComponent {
|
|
|
12
13
|
render() {
|
|
13
14
|
const { className, split, 'data-test': dataTest, label, help, ...restProps } = this.props;
|
|
14
15
|
const classes = classNames(split ? styles.split : styles.buttonGroup, className);
|
|
15
|
-
return (
|
|
16
|
-
{label && <ControlLabel>{label}</ControlLabel>}
|
|
17
|
-
<div {...restProps} data-test={dataTests('ring-button-group', dataTest)} className={classes}/>
|
|
18
|
-
{help && <ControlHelp className={styles.help}>{help}</ControlHelp>}
|
|
19
|
-
</>);
|
|
16
|
+
return (_jsxs(_Fragment, { children: [label && _jsx(ControlLabel, { children: label }), _jsx("div", { ...restProps, "data-test": dataTests('ring-button-group', dataTest), className: classes }), help && _jsx(ControlHelp, { className: styles.help, children: help })] }));
|
|
20
17
|
}
|
|
21
18
|
}
|
|
22
19
|
export { Caption };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { PureComponent } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import styles from './button-group.css';
|
|
@@ -5,6 +6,6 @@ export default class Caption extends PureComponent {
|
|
|
5
6
|
render() {
|
|
6
7
|
const { className } = this.props;
|
|
7
8
|
const classes = classNames(styles.caption, className);
|
|
8
|
-
return
|
|
9
|
+
return _jsx("span", { ...this.props, className: classes });
|
|
9
10
|
}
|
|
10
11
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { PureComponent } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import dataTests from '../global/data-tests';
|
|
@@ -9,8 +10,6 @@ export default class ButtonSet extends PureComponent {
|
|
|
9
10
|
render() {
|
|
10
11
|
const { className, 'data-test': dataTest, children, ...restProps } = this.props;
|
|
11
12
|
const classes = classNames(styles.buttonSet, className);
|
|
12
|
-
return (
|
|
13
|
-
{children}
|
|
14
|
-
</div>);
|
|
13
|
+
return (_jsx("div", { ...restProps, "data-test": dataTests('ring-button-set', dataTest), className: classes, children: children }));
|
|
15
14
|
}
|
|
16
15
|
}
|
|
@@ -6,5 +6,5 @@ export interface ButtonToolbarProps extends HTMLAttributes<HTMLElement> {
|
|
|
6
6
|
* @name Button Toolbar
|
|
7
7
|
*/
|
|
8
8
|
export default class ButtonToolbar extends PureComponent<ButtonToolbarProps> {
|
|
9
|
-
render(): import("react").JSX.Element;
|
|
9
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { PureComponent } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import dataTests from '../global/data-tests';
|
|
@@ -9,6 +10,6 @@ export default class ButtonToolbar extends PureComponent {
|
|
|
9
10
|
render() {
|
|
10
11
|
const { className, 'data-test': dataTest, ...restProps } = this.props;
|
|
11
12
|
const classes = classNames(styles.buttonToolbar, className);
|
|
12
|
-
return
|
|
13
|
+
return _jsx("div", { ...restProps, "data-test": dataTests('ring-button-toolbar', dataTest), className: classes });
|
|
13
14
|
}
|
|
14
15
|
}
|
|
@@ -24,5 +24,5 @@ export default class Checkbox extends PureComponent<CheckboxProps> {
|
|
|
24
24
|
input?: HTMLInputElement | null;
|
|
25
25
|
inputRef: (el: HTMLInputElement | null) => void;
|
|
26
26
|
composedInputRef: import("memoize-one").MemoizedFn<(...refs: (Ref<HTMLInputElement> | undefined)[]) => (value: HTMLInputElement | null) => void>;
|
|
27
|
-
render(): import("react").JSX.Element;
|
|
27
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
28
28
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import { PureComponent } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import checkmarkIcon from '@jetbrains/icons/checkmark-12px';
|
|
@@ -41,18 +42,6 @@ export default class Checkbox extends PureComponent {
|
|
|
41
42
|
const containerClasses = classNames(styles.checkbox, containerClassName);
|
|
42
43
|
const cellClasses = classNames(styles.cell, cellClassName);
|
|
43
44
|
const labelClasses = classNames(styles.label, labelClassName);
|
|
44
|
-
return (
|
|
45
|
-
<input {...restProps} data-checked={restProps.checked} ref={this.composedInputRef(this.inputRef, inputRef)} type="checkbox" className={classes}/>
|
|
46
|
-
<div className={styles.cellWrapper}>
|
|
47
|
-
<span className={cellClasses}>
|
|
48
|
-
<Icon glyph={checkmarkIcon} className={styles.check}/>
|
|
49
|
-
<Icon glyph={minusIcon} className={styles.minus}/>
|
|
50
|
-
</span>
|
|
51
|
-
</div>
|
|
52
|
-
<span className={labelClasses}>
|
|
53
|
-
{label || children}
|
|
54
|
-
{help && <ControlHelp>{help}</ControlHelp>}
|
|
55
|
-
</span>
|
|
56
|
-
</label>);
|
|
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 })] })] }));
|
|
57
46
|
}
|
|
58
47
|
}
|
|
@@ -25,7 +25,7 @@ export default class Code extends PureComponent<CodeProps> {
|
|
|
25
25
|
highlight(): Promise<void>;
|
|
26
26
|
get codeRef(): HTMLElement | null | undefined;
|
|
27
27
|
get initCodeRef(): import("react").RefObject<HTMLElement> | ((ref: HTMLElement | null) => void);
|
|
28
|
-
render(): import("react").JSX.Element;
|
|
28
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
29
29
|
}
|
|
30
30
|
declare const code: (strings: TemplateStringsArray, ...interpolations: unknown[]) => void;
|
|
31
31
|
export { code, highlight };
|
package/components/code/code.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { PureComponent } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import highlight from 'highlight.js/lib/core';
|
|
@@ -68,14 +69,10 @@ export default class Code extends PureComponent {
|
|
|
68
69
|
[styles.inline]: inline,
|
|
69
70
|
[styles.softWrap]: softWrap,
|
|
70
71
|
});
|
|
71
|
-
return (
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
tabIndex={inline ? -1 : 0} ref={this.initCodeRef} className={highlightStyles.highlightContainer}>
|
|
75
|
-
{normalizeIndent(code)}
|
|
76
|
-
</code>
|
|
77
|
-
</Tag>);
|
|
72
|
+
return (_jsx(Tag, { className: classes, "data-test": "ring-code", children: _jsx("code", {
|
|
73
|
+
// should be focusable because it can be scrollable
|
|
74
|
+
tabIndex: inline ? -1 : 0, ref: this.initCodeRef, className: highlightStyles.highlightContainer, children: normalizeIndent(code) }) }));
|
|
78
75
|
}
|
|
79
76
|
}
|
|
80
|
-
const code = trivialTemplateTag((source) =>
|
|
77
|
+
const code = trivialTemplateTag((source) => _jsx(Code, { code: source }));
|
|
81
78
|
export { code, highlight };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect, useRef, useContext, useMemo } from 'react';
|
|
2
3
|
import classNames from 'classnames';
|
|
3
4
|
import dataTests from '../global/data-tests';
|
|
4
5
|
import { getRect } from '../global/dom';
|
|
@@ -70,11 +71,6 @@ export const CollapseContent = ({ children, minHeight = DEFAULT_HEIGHT, 'data-te
|
|
|
70
71
|
}, [duration, height, collapsed, minHeight]);
|
|
71
72
|
const fadeShouldBeVisible = useMemo(() => Boolean(minHeight && showFade), [minHeight, showFade]);
|
|
72
73
|
const shouldRenderContent = disableAnimation ? !collapsed : !shouldHideContent;
|
|
73
|
-
return (
|
|
74
|
-
<div ref={contentRef} data-test={dataTests(COLLAPSE_CONTENT_TEST_ID, dataTest)}>
|
|
75
|
-
{shouldRenderContent ? children : null}
|
|
76
|
-
</div>
|
|
77
|
-
{fadeShouldBeVisible && <div className={styles.fade}/>}
|
|
78
|
-
</div>);
|
|
74
|
+
return (_jsxs("div", { ref: containerRef, id: `collapse-content-${id}`, "data-test": dataTests(COLLAPSE_CONTENT_CONTAINER_TEST_ID), className: classNames(styles.container, { [styles.transition]: !disableAnimation }), style: style, children: [_jsx("div", { ref: contentRef, "data-test": dataTests(COLLAPSE_CONTENT_TEST_ID, dataTest), children: shouldRenderContent ? children : null }), fadeShouldBeVisible && _jsx("div", { className: styles.fade })] }));
|
|
79
75
|
};
|
|
80
76
|
export default CollapseContent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { useMemo, useContext, cloneElement } from 'react';
|
|
2
|
-
import * as React from 'react';
|
|
3
3
|
import dataTests from '../global/data-tests';
|
|
4
4
|
import { CollapseContext } from './collapse-context';
|
|
5
5
|
import { COLLAPSE_CONTROL_TEST_ID } from './consts';
|
|
@@ -14,12 +14,10 @@ export const CollapseControl = ({ children, 'data-test': dataTest }) => {
|
|
|
14
14
|
}
|
|
15
15
|
return children;
|
|
16
16
|
}, [children, collapsed]);
|
|
17
|
-
return (
|
|
18
|
-
{cloneElement(child, {
|
|
17
|
+
return (_jsx("p", { "data-test": dataTests(COLLAPSE_CONTROL_TEST_ID, dataTest), children: cloneElement(child, {
|
|
19
18
|
onClick: setCollapsed,
|
|
20
19
|
'aria-controls': `collapse-content-${id}`,
|
|
21
20
|
'aria-expanded': String(!collapsed),
|
|
22
|
-
})}
|
|
23
|
-
</p>);
|
|
21
|
+
}) }));
|
|
24
22
|
};
|
|
25
23
|
export default CollapseControl;
|