@jetbrains/ring-ui-built 7.0.65 → 7.0.70
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/_helpers/anchor.js +12 -17
- package/components/_helpers/avatar-info.js +4 -5
- package/components/_helpers/button.classes.js +20 -21
- package/components/_helpers/caption.js +3 -3
- package/components/_helpers/card.js +26 -32
- package/components/_helpers/dialog-body-scroll-preventer.js +1 -2
- package/components/_helpers/icon-svg.js +9 -12
- package/components/_helpers/input.js +78 -86
- package/components/_helpers/loader-core.js +260 -0
- package/components/_helpers/query-assist-suggestions.js +0 -1
- package/components/_helpers/select-filter.js +19 -26
- package/components/_helpers/services-link.js +9 -12
- package/components/_helpers/sidebar.js +36 -44
- package/components/_helpers/tab-link.js +9 -11
- package/components/_helpers/theme.js +20 -24
- package/components/_helpers/title.js +12 -17
- package/components/alert/alert.js +41 -49
- package/components/alert/container.js +9 -12
- package/components/alert-service/alert-service.js +23 -32
- package/components/analytics/analytics-custom-plugin.js +12 -17
- package/components/analytics/analytics.js +1 -3
- package/components/auth/auth-core.js +128 -170
- package/components/auth/auth.js +3 -10
- package/components/auth/background-flow.js +5 -8
- package/components/auth/down-notification.js +9 -17
- package/components/auth/iframe-flow.js +13 -19
- package/components/auth/request-builder.js +4 -9
- package/components/auth/response-parser.js +9 -12
- package/components/auth/storage.js +12 -18
- package/components/auth/token-validator.js +19 -30
- package/components/auth/window-flow.js +22 -27
- package/components/auth-dialog/auth-dialog.js +40 -48
- package/components/auth-dialog-service/auth-dialog-service.js +10 -13
- package/components/avatar/avatar.figma.js +6 -6
- package/components/avatar/avatar.js +58 -59
- package/components/avatar/fallback-avatar.js +8 -11
- package/components/avatar-stack/avatar-stack.figma.js +10 -11
- package/components/avatar-stack/avatar-stack.js +25 -31
- package/components/banner/banner.js +0 -6
- package/components/breadcrumbs/breadcrumbs.figma.js +8 -6
- package/components/breadcrumbs/breadcrumbs.js +4 -5
- package/components/button/button.figma.js +15 -10
- package/components/button/button.js +59 -64
- package/components/button-group/button-group.js +11 -15
- package/components/button-group/caption.js +0 -1
- package/components/button-set/button-set.js +9 -12
- package/components/button-toolbar/button-toolbar.js +8 -11
- package/components/caret/caret.js +20 -28
- package/components/checkbox/checkbox-group.figma.js +8 -10
- package/components/checkbox/checkbox.figma.js +5 -5
- package/components/checkbox/checkbox.js +27 -35
- package/components/clipboard/clipboard-fallback.js +3 -3
- package/components/clipboard/clipboard.js +3 -16
- package/components/code/code.js +8 -14
- package/components/collapse/collapse-content.js +10 -15
- package/components/collapse/collapse-control.js +5 -7
- package/components/collapse/collapse.js +9 -11
- package/components/collapse/utils.js +1 -1
- package/components/confirm/confirm.js +17 -26
- package/components/confirm-service/confirm-service.js +30 -31
- package/components/content-layout/content-layout.js +21 -28
- package/components/content-layout/sidebar.js +0 -2
- package/components/contenteditable/contenteditable.js +23 -28
- package/components/control-help/control-help.js +8 -10
- package/components/control-label/control-label.js +12 -17
- package/components/data-list/data-list.js +57 -65
- package/components/data-list/data-list.mock.js +0 -4
- package/components/data-list/item.js +65 -72
- package/components/data-list/selection.js +11 -19
- package/components/data-list/title.js +0 -4
- package/components/date-picker/consts.js +3 -4
- package/components/date-picker/date-input.js +25 -33
- package/components/date-picker/date-picker.js +179 -193
- package/components/date-picker/date-popup.js +135 -127
- package/components/date-picker/day.d.ts +1 -1
- package/components/date-picker/day.js +24 -30
- package/components/date-picker/month-names.js +7 -12
- package/components/date-picker/month-slider.js +16 -22
- package/components/date-picker/month.js +3 -5
- package/components/date-picker/months.js +6 -6
- package/components/date-picker/weekdays.js +0 -1
- package/components/date-picker/years.js +20 -26
- package/components/dialog/dialog-body-scroll-preventer.js +0 -1
- package/components/dialog/dialog.js +73 -83
- package/components/dropdown/anchor.js +0 -4
- package/components/dropdown/dropdown.js +98 -114
- package/components/dropdown-menu/dropdown-menu.js +80 -79
- package/components/editable-heading/editable-heading.js +48 -54
- package/components/error-bubble/error-bubble.figma.js +4 -4
- package/components/error-bubble/error-bubble.js +9 -13
- package/components/error-message/error-message.js +1 -6
- package/components/footer/footer.js +11 -15
- package/components/global/compose-refs.js +1 -4
- package/components/global/compose.js +1 -4
- package/components/global/configuration.js +3 -3
- package/components/global/controls-height.js +0 -1
- package/components/global/create-stateful-context.js +10 -14
- package/components/global/data-tests.js +2 -10
- package/components/global/dom.js +6 -19
- package/components/global/focus-sensor-hoc.js +74 -87
- package/components/global/fuzzy-highlight.js +3 -8
- package/components/global/get-uid.js +1 -1
- package/components/global/inject-styles.js +5 -6
- package/components/global/listeners.js +2 -11
- package/components/global/memoize.js +0 -2
- package/components/global/normalize-indent.js +2 -6
- package/components/global/promise-with-timeout.js +4 -5
- package/components/global/react-dom-renderer.js +4 -9
- package/components/global/rerender-hoc.js +8 -11
- package/components/global/schedule-raf.js +1 -2
- package/components/global/theme.js +0 -5
- package/components/global/trivial-template-tag.js +1 -6
- package/components/global/url.js +2 -6
- package/components/global/use-event-callback.js +2 -3
- package/components/grid/col.js +7 -18
- package/components/grid/grid.js +9 -14
- package/components/grid/row.js +7 -11
- package/components/group/group.js +9 -12
- package/components/header/header-icon.js +8 -13
- package/components/header/header.js +16 -27
- package/components/header/links.js +7 -10
- package/components/header/logo.js +12 -16
- package/components/header/profile.js +73 -83
- package/components/header/services-link.js +0 -2
- package/components/header/services.js +32 -43
- package/components/header/smart-profile.js +44 -59
- package/components/header/smart-services.js +33 -45
- package/components/header/tray.js +8 -10
- package/components/heading/heading.js +27 -27
- package/components/http/http.js +120 -125
- package/components/http/http.mock.js +6 -10
- package/components/hub-source/hub-source-user.js +6 -13
- package/components/hub-source/hub-source-users-groups.js +8 -12
- package/components/hub-source/hub-source.js +8 -10
- package/components/i18n/i18n-context.js +4 -7
- package/components/i18n/i18n.js +5 -5
- package/components/icon/icon-svg.js +0 -4
- package/components/icon/icon.js +28 -32
- package/components/icon/index.js +0 -4
- package/components/input/input.figma.js +8 -8
- package/components/input/input.js +0 -4
- package/components/island/adaptive-island-hoc.js +19 -23
- package/components/island/content.js +70 -75
- package/components/island/header.js +21 -21
- package/components/island/island.js +11 -14
- package/components/link/clickable-link.js +30 -37
- package/components/link/link.js +27 -29
- package/components/list/list-custom.js +6 -11
- package/components/list/list-item.js +49 -56
- package/components/list/list-separator.js +0 -1
- package/components/list/list-title.js +0 -1
- package/components/list/list-users-groups-source.js +14 -22
- package/components/list/list.classes.js +8 -9
- package/components/list/list.js +387 -404
- package/components/loader/loader-core.js +2 -265
- package/components/loader/loader.d.ts +8 -0
- package/components/loader/loader.js +43 -29
- package/components/loader-inline/loader-inline.js +9 -12
- package/components/loader-screen/loader-screen.js +10 -14
- package/components/login-dialog/login-dialog.js +46 -54
- package/components/login-dialog/service.js +13 -15
- package/components/message/message.js +65 -79
- package/components/old-browsers-message/old-browsers-message-stop.js +0 -3
- package/components/old-browsers-message/old-browsers-message.js +1 -4
- package/components/old-browsers-message/white-list.js +5 -7
- package/components/pager/pager.js +73 -88
- package/components/panel/panel.js +9 -12
- package/components/permissions/permissions-cache.js +6 -8
- package/components/permissions/permissions.js +19 -21
- package/components/popup/popup.js +136 -145
- package/components/popup/popup.target.js +8 -10
- package/components/popup/position-css.js +19 -27
- package/components/popup/position.js +22 -28
- package/components/popup-menu/popup-menu.js +27 -37
- package/components/progress-bar/progress-bar.js +26 -32
- package/components/query-assist/query-assist-suggestions.js +0 -6
- package/components/query-assist/query-assist.js +432 -468
- package/components/radio/radio-item.js +30 -40
- package/components/radio/radio.js +6 -10
- package/components/scrollable-section/scrollable-section.js +7 -10
- package/components/select/select-filter.js +0 -6
- package/components/select/select-popup.js +155 -174
- package/components/select/select.js +464 -479
- package/components/shortcuts/core.js +40 -45
- package/components/shortcuts/shortcut-title.js +0 -1
- package/components/shortcuts/shortcuts-hoc.js +9 -15
- package/components/shortcuts/shortcuts.js +3 -5
- package/components/slider/slider.js +53 -66
- package/components/slider/slider.utils.js +1 -4
- package/components/storage/storage-local.js +2 -8
- package/components/storage/storage.js +0 -5
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.js +21 -30
- package/components/table/cell.js +3 -4
- package/components/table/disable-hover-hoc.js +24 -28
- package/components/table/header-cell.js +30 -38
- package/components/table/header.js +20 -28
- package/components/table/multitable.js +81 -101
- package/components/table/row-with-focus-sensor.js +17 -28
- package/components/table/row.js +89 -99
- package/components/table/selection-adapter.js +0 -2
- package/components/table/selection-shortcuts-hoc.js +159 -161
- package/components/table/selection.js +23 -31
- package/components/table/simple-table.js +16 -22
- package/components/table/smart-table.js +19 -26
- package/components/table/table.js +137 -146
- package/components/tabs/collapsible-more.js +34 -47
- package/components/tabs/collapsible-tab.js +28 -33
- package/components/tabs/collapsible-tabs.js +18 -26
- package/components/tabs/custom-item.js +3 -6
- package/components/tabs/dumb-tabs.js +48 -64
- package/components/tabs/smart-tabs.js +14 -23
- package/components/tabs/tab-link.js +0 -2
- package/components/tabs/tab.js +0 -1
- package/components/tabs/tabs.js +0 -7
- package/components/tag/tag.js +30 -35
- package/components/tags-input/tags-input.js +192 -218
- package/components/tags-list/tags-list.js +26 -31
- package/components/text/text.js +16 -19
- package/components/toggle/toggle.js +19 -23
- package/components/tooltip/tooltip.js +110 -121
- package/components/upload/upload.js +19 -28
- package/components/user-agreement/service.js +247 -252
- package/components/user-agreement/toolbox.eula.js +160 -1
- package/components/user-agreement/user-agreement.js +23 -32
- package/components/user-card/card.js +0 -5
- package/components/user-card/smart-user-card-tooltip.js +41 -50
- package/components/user-card/tooltip.js +32 -38
- package/components/user-card/user-card.js +0 -5
- package/package.json +9 -3
- package/components/_helpers/_rollupPluginBabelHelpers.js +0 -72
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { c as _taggedTemplateLiteral } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import figma from '@figma/code-connect';
|
|
3
2
|
|
|
4
|
-
var _templateObject;
|
|
5
3
|
const instance = figma.selectedInstance;
|
|
6
4
|
const size = instance.getString('Size');
|
|
7
5
|
const state = instance.getString('State');
|
|
@@ -22,7 +20,7 @@ const DEFAULT_SIZE = 'M';
|
|
|
22
20
|
const isDefaultSize = size === DEFAULT_SIZE;
|
|
23
21
|
if (!isDefaultSize) {
|
|
24
22
|
imports.push("import {ControlsHeight} from '@jetbrains/ring-ui/components/global/controls-height'");
|
|
25
|
-
props.push(
|
|
23
|
+
props.push(`height={ControlsHeight.${size}}`);
|
|
26
24
|
}
|
|
27
25
|
switch (state) {
|
|
28
26
|
case 'disabled':
|
|
@@ -44,20 +42,22 @@ if (clearable) {
|
|
|
44
42
|
props.push('onClear={() => {}}');
|
|
45
43
|
}
|
|
46
44
|
if (hasLabel) {
|
|
47
|
-
props.push(
|
|
45
|
+
props.push(`label="${label}"`);
|
|
48
46
|
}
|
|
49
47
|
if (hasHelpText) {
|
|
50
|
-
props.push(
|
|
48
|
+
props.push(`help="${helpText}"`);
|
|
51
49
|
}
|
|
52
50
|
if (hasText) {
|
|
53
|
-
props.push(
|
|
51
|
+
props.push(`defaultValue="${text}"`);
|
|
54
52
|
}
|
|
55
53
|
if (hasPlaceholder) {
|
|
56
|
-
props.push(
|
|
54
|
+
props.push(`placeholder="${placeholder}"`);
|
|
57
55
|
}
|
|
58
56
|
var input_figma = {
|
|
59
57
|
id: 'input',
|
|
60
|
-
example: figma.code
|
|
58
|
+
example: figma.code`${imports.join('\n')}
|
|
59
|
+
|
|
60
|
+
<Input ${props.map(prop => `${prop} `).join('')}/>`
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
export { input_figma as default };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
1
|
import 'react/jsx-runtime';
|
|
4
2
|
import 'react';
|
|
5
3
|
import 'classnames';
|
|
@@ -20,8 +18,6 @@ import '../link/clickable-link.js';
|
|
|
20
18
|
import '../_helpers/button.classes.js';
|
|
21
19
|
import '../icon/icon.constants.js';
|
|
22
20
|
import '../_helpers/icon-svg.js';
|
|
23
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
24
|
-
import 'core-js/modules/es.string.replace.js';
|
|
25
21
|
import '../global/memoize.js';
|
|
26
22
|
import '../global/configuration.js';
|
|
27
23
|
import '../i18n/i18n.js';
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
1
|
import { jsx } from 'react/jsx-runtime';
|
|
4
2
|
import { createContext, Component } from 'react';
|
|
5
3
|
import { interpolateLinear } from '../global/linear-function.js';
|
|
@@ -10,32 +8,30 @@ const PhaseContext = /*#__PURE__*/createContext(null);
|
|
|
10
8
|
const ScrollHandlerContext = /*#__PURE__*/createContext(null);
|
|
11
9
|
function adaptiveIslandHOC(ComposedComponent) {
|
|
12
10
|
return class AdaptiveIsland extends Component {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
}
|
|
11
|
+
state = {
|
|
12
|
+
phase: null
|
|
13
|
+
};
|
|
14
|
+
onContentScroll = ({
|
|
15
|
+
scrollTop,
|
|
16
|
+
scrollHeight,
|
|
17
|
+
clientHeight
|
|
18
|
+
}) => {
|
|
19
|
+
var _this$state$phase;
|
|
20
|
+
if (scrollHeight - clientHeight >= interpolateLinear(TITLE_RESIZE_THRESHOLD, TITLE_RESIZE_END, (_this$state$phase = this.state.phase) !== null && _this$state$phase !== void 0 ? _this$state$phase : 0)) {
|
|
21
|
+
const phase = Math.min(1, Math.max(0, scrollTop) / TITLE_RESIZE_END);
|
|
22
|
+
this.setState({
|
|
23
|
+
phase
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
};
|
|
33
27
|
render() {
|
|
34
28
|
return jsx(PhaseContext.Provider, {
|
|
35
29
|
value: this.state.phase,
|
|
36
30
|
children: jsx(ScrollHandlerContext.Provider, {
|
|
37
31
|
value: this.onContentScroll,
|
|
38
|
-
children: jsx(ComposedComponent,
|
|
32
|
+
children: jsx(ComposedComponent, {
|
|
33
|
+
...this.props
|
|
34
|
+
})
|
|
39
35
|
})
|
|
40
36
|
});
|
|
41
37
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
2
|
import { forwardRef, Component } from 'react';
|
|
5
3
|
import classNames from 'classnames';
|
|
@@ -9,61 +7,20 @@ import { s as styles } from '../_helpers/island.js';
|
|
|
9
7
|
import { ScrollHandlerContext } from './adaptive-island-hoc.js';
|
|
10
8
|
import '../global/linear-function.js';
|
|
11
9
|
|
|
12
|
-
const _excluded = ["children", "className", "bottomBorder", "scrollableWrapperClassName", "onScroll", "onScrollToBottom", "fade", "tabIndex"];
|
|
13
10
|
const scheduleScrollAction = scheduleRAF();
|
|
14
11
|
const noop = () => {};
|
|
15
12
|
const END_DISTANCE = 16;
|
|
16
13
|
class Content extends Component {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
_defineProperty(this, "setWrapper", node => {
|
|
28
|
-
if (!node) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
this.wrapperNode = node;
|
|
32
|
-
this.resizeDetector.listenTo(node, this.calculateScrollPosition);
|
|
33
|
-
});
|
|
34
|
-
_defineProperty(this, "calculateScrollPosition", () => scheduleScrollAction(() => {
|
|
35
|
-
const {
|
|
36
|
-
scrollableNode
|
|
37
|
-
} = this;
|
|
38
|
-
if (!scrollableNode) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
this.props.onScroll(scrollableNode);
|
|
42
|
-
const {
|
|
43
|
-
scrollTop,
|
|
44
|
-
scrollHeight,
|
|
45
|
-
offsetHeight
|
|
46
|
-
} = scrollableNode;
|
|
47
|
-
const scrolledToTop = scrollTop === 0;
|
|
48
|
-
const scrolledToBottom = offsetHeight + scrollTop >= scrollHeight - END_DISTANCE;
|
|
49
|
-
if (scrolledToBottom) {
|
|
50
|
-
var _this$props$onScrollT, _this$props;
|
|
51
|
-
(_this$props$onScrollT = (_this$props = this.props).onScrollToBottom) === null || _this$props$onScrollT === void 0 || _this$props$onScrollT.call(_this$props);
|
|
52
|
-
}
|
|
53
|
-
this.setState({
|
|
54
|
-
scrolledToTop,
|
|
55
|
-
scrolledToBottom
|
|
56
|
-
});
|
|
57
|
-
}));
|
|
58
|
-
_defineProperty(this, "scrollableNode", void 0);
|
|
59
|
-
_defineProperty(this, "setScrollableNodeAndCalculatePosition", node => {
|
|
60
|
-
if (!node) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
this.scrollableNode = node;
|
|
64
|
-
this.calculateScrollPosition();
|
|
65
|
-
});
|
|
66
|
-
}
|
|
14
|
+
static defaultProps = {
|
|
15
|
+
fade: true,
|
|
16
|
+
bottomBorder: false,
|
|
17
|
+
onScroll: noop,
|
|
18
|
+
onScrollToBottom: noop
|
|
19
|
+
};
|
|
20
|
+
state = {
|
|
21
|
+
scrolledToTop: true,
|
|
22
|
+
scrolledToBottom: false
|
|
23
|
+
};
|
|
67
24
|
componentWillUnmount() {
|
|
68
25
|
this.scrollableNode = null;
|
|
69
26
|
if (!this.wrapperNode) {
|
|
@@ -71,19 +28,60 @@ class Content extends Component {
|
|
|
71
28
|
}
|
|
72
29
|
this.resizeDetector.removeAllListeners(this.wrapperNode);
|
|
73
30
|
}
|
|
31
|
+
resizeDetector = createResizeDetector({
|
|
32
|
+
strategy: 'scroll'
|
|
33
|
+
});
|
|
34
|
+
wrapperNode;
|
|
35
|
+
setWrapper = node => {
|
|
36
|
+
if (!node) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this.wrapperNode = node;
|
|
40
|
+
this.resizeDetector.listenTo(node, this.calculateScrollPosition);
|
|
41
|
+
};
|
|
42
|
+
calculateScrollPosition = () => scheduleScrollAction(() => {
|
|
43
|
+
const {
|
|
44
|
+
scrollableNode
|
|
45
|
+
} = this;
|
|
46
|
+
if (!scrollableNode) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.props.onScroll(scrollableNode);
|
|
50
|
+
const {
|
|
51
|
+
scrollTop,
|
|
52
|
+
scrollHeight,
|
|
53
|
+
offsetHeight
|
|
54
|
+
} = scrollableNode;
|
|
55
|
+
const scrolledToTop = scrollTop === 0;
|
|
56
|
+
const scrolledToBottom = offsetHeight + scrollTop >= scrollHeight - END_DISTANCE;
|
|
57
|
+
if (scrolledToBottom) {
|
|
58
|
+
this.props.onScrollToBottom?.();
|
|
59
|
+
}
|
|
60
|
+
this.setState({
|
|
61
|
+
scrolledToTop,
|
|
62
|
+
scrolledToBottom
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
scrollableNode;
|
|
66
|
+
setScrollableNodeAndCalculatePosition = node => {
|
|
67
|
+
if (!node) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
this.scrollableNode = node;
|
|
71
|
+
this.calculateScrollPosition();
|
|
72
|
+
};
|
|
74
73
|
render() {
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
restProps = _objectWithoutProperties(_this$props2, _excluded);
|
|
74
|
+
const {
|
|
75
|
+
children,
|
|
76
|
+
className,
|
|
77
|
+
bottomBorder,
|
|
78
|
+
scrollableWrapperClassName,
|
|
79
|
+
onScroll,
|
|
80
|
+
onScrollToBottom,
|
|
81
|
+
fade,
|
|
82
|
+
tabIndex,
|
|
83
|
+
...restProps
|
|
84
|
+
} = this.props;
|
|
87
85
|
const {
|
|
88
86
|
scrolledToTop,
|
|
89
87
|
scrolledToBottom
|
|
@@ -95,7 +93,8 @@ class Content extends Component {
|
|
|
95
93
|
[styles.withBottomBorder]: bottomBorder && !scrolledToBottom
|
|
96
94
|
});
|
|
97
95
|
const scrollableWrapperClasses = classNames(styles.scrollableWrapper, scrollableWrapperClassName);
|
|
98
|
-
return jsx("div",
|
|
96
|
+
return jsx("div", {
|
|
97
|
+
...restProps,
|
|
99
98
|
"data-test": 'ring-island-content',
|
|
100
99
|
className: classes,
|
|
101
100
|
children: jsxs("div", {
|
|
@@ -108,24 +107,20 @@ class Content extends Component {
|
|
|
108
107
|
children: children
|
|
109
108
|
}), !fade && children]
|
|
110
109
|
})
|
|
111
|
-
})
|
|
110
|
+
});
|
|
112
111
|
}
|
|
113
112
|
}
|
|
114
|
-
_defineProperty(Content, "defaultProps", {
|
|
115
|
-
fade: true,
|
|
116
|
-
bottomBorder: false,
|
|
117
|
-
onScroll: noop,
|
|
118
|
-
onScrollToBottom: noop
|
|
119
|
-
});
|
|
120
113
|
const ContentWrapper = /*#__PURE__*/forwardRef((props, ref) => jsx(ScrollHandlerContext.Consumer, {
|
|
121
114
|
children: onScroll => {
|
|
122
115
|
const addProps = onScroll ? {
|
|
123
116
|
onScroll,
|
|
124
117
|
bottomBorder: true
|
|
125
118
|
} : {};
|
|
126
|
-
return jsx(Content,
|
|
119
|
+
return jsx(Content, {
|
|
120
|
+
...props,
|
|
121
|
+
...addProps,
|
|
127
122
|
ref: ref
|
|
128
|
-
})
|
|
123
|
+
});
|
|
129
124
|
}
|
|
130
125
|
}));
|
|
131
126
|
ContentWrapper.displayName = 'ContentWrapper';
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
2
|
import { Component } from 'react';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
4
|
import { interpolateLinear } from '../global/linear-function.js';
|
|
6
5
|
import { s as styles } from '../_helpers/island.js';
|
|
7
6
|
import { PhaseContext } from './adaptive-island-hoc.js';
|
|
8
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
9
7
|
|
|
10
|
-
const _excluded = ["children", "className", "wrapWithTitle", "border", "phase"];
|
|
11
8
|
const Start = {
|
|
12
9
|
FONT_SIZE: 24,
|
|
13
10
|
LINE_HEIGHT: 28,
|
|
@@ -29,6 +26,9 @@ const End = {
|
|
|
29
26
|
};
|
|
30
27
|
const BORDER_APPEAR_PHASE = 0.5;
|
|
31
28
|
class Header extends Component {
|
|
29
|
+
static defaultProps = {
|
|
30
|
+
wrapWithTitle: true
|
|
31
|
+
};
|
|
32
32
|
style(name) {
|
|
33
33
|
var _this$props$phase;
|
|
34
34
|
return interpolateLinear(Start[name], End[name], (_this$props$phase = this.props.phase) !== null && _this$props$phase !== void 0 ? _this$props$phase : 0);
|
|
@@ -39,7 +39,7 @@ class Header extends Component {
|
|
|
39
39
|
const scaleFont = this.style('FONT_SIZE') / Start.FONT_SIZE;
|
|
40
40
|
return {
|
|
41
41
|
fontSize: Start.FONT_SIZE,
|
|
42
|
-
transform:
|
|
42
|
+
transform: `translate(${this.style('X')}px, ${this.style('Y')}px) scale(${scaleFont})`,
|
|
43
43
|
letterSpacing: this.style('SPACING')
|
|
44
44
|
};
|
|
45
45
|
}
|
|
@@ -48,26 +48,26 @@ class Header extends Component {
|
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
render() {
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
|
51
|
+
const {
|
|
52
|
+
children,
|
|
53
|
+
className,
|
|
54
|
+
wrapWithTitle,
|
|
55
|
+
border,
|
|
56
|
+
phase,
|
|
57
|
+
...restProps
|
|
58
|
+
} = this.props;
|
|
60
59
|
const classes = classNames(styles.header, className, {
|
|
61
60
|
[styles.withBottomBorder]: border || phase && phase >= BORDER_APPEAR_PHASE
|
|
62
61
|
});
|
|
63
62
|
const headerStyle = phase !== null && phase !== undefined ? {
|
|
64
|
-
lineHeight:
|
|
63
|
+
lineHeight: `${this.style('LINE_HEIGHT')}px`,
|
|
65
64
|
// need to append px because number is a valid line-height value
|
|
66
65
|
paddingTop: this.style('PADDING_TOP'),
|
|
67
66
|
paddingBottom: this.style('PADDING_BOTTOM')
|
|
68
67
|
} : undefined;
|
|
69
68
|
const titleStyle = this.getTitleStyle(phase);
|
|
70
|
-
return jsxs("div",
|
|
69
|
+
return jsxs("div", {
|
|
70
|
+
...restProps,
|
|
71
71
|
"data-test": 'ring-island-header',
|
|
72
72
|
className: classes,
|
|
73
73
|
style: headerStyle,
|
|
@@ -76,18 +76,18 @@ class Header extends Component {
|
|
|
76
76
|
style: titleStyle,
|
|
77
77
|
children: children
|
|
78
78
|
}), !wrapWithTitle && children]
|
|
79
|
-
})
|
|
79
|
+
});
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
_defineProperty(Header, "defaultProps", {
|
|
83
|
-
wrapWithTitle: true
|
|
84
|
-
});
|
|
85
82
|
const HeaderWrapper = props => jsx(PhaseContext.Consumer, {
|
|
86
83
|
children: phase => {
|
|
87
84
|
const addProps = phase !== null && phase !== undefined ? {
|
|
88
85
|
phase
|
|
89
86
|
} : {};
|
|
90
|
-
return jsx(Header,
|
|
87
|
+
return jsx(Header, {
|
|
88
|
+
...props,
|
|
89
|
+
...addProps
|
|
90
|
+
});
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { Component } from 'react';
|
|
4
3
|
import classNames from 'classnames';
|
|
@@ -7,35 +6,33 @@ import adaptiveIslandHOC from './adaptive-island-hoc.js';
|
|
|
7
6
|
import { s as styles } from '../_helpers/island.js';
|
|
8
7
|
export { default as Header } from './header.js';
|
|
9
8
|
export { default as Content } from './content.js';
|
|
10
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
11
9
|
import '../global/linear-function.js';
|
|
12
10
|
import 'element-resize-detector';
|
|
13
11
|
import '../global/schedule-raf.js';
|
|
14
12
|
|
|
15
|
-
const _excluded = ["children", "className", "narrow", "withoutPaddings", "data-test"];
|
|
16
13
|
/**
|
|
17
14
|
* @name Island
|
|
18
15
|
*/
|
|
19
16
|
class Island extends Component {
|
|
20
17
|
render() {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
|
18
|
+
const {
|
|
19
|
+
children,
|
|
20
|
+
className,
|
|
21
|
+
narrow,
|
|
22
|
+
withoutPaddings,
|
|
23
|
+
'data-test': dataTest,
|
|
24
|
+
...restProps
|
|
25
|
+
} = this.props;
|
|
30
26
|
const classes = classNames(styles.island, className, {
|
|
31
27
|
[styles.narrowIsland]: narrow,
|
|
32
28
|
[styles.withoutPaddings]: withoutPaddings
|
|
33
29
|
});
|
|
34
|
-
return jsx("div",
|
|
30
|
+
return jsx("div", {
|
|
31
|
+
...restProps,
|
|
35
32
|
className: classes,
|
|
36
33
|
"data-test": joinDataTestAttributes('ring-island', dataTest),
|
|
37
34
|
children: children
|
|
38
|
-
})
|
|
35
|
+
});
|
|
39
36
|
}
|
|
40
37
|
}
|
|
41
38
|
const AdaptiveIsland = adaptiveIslandHOC(Island);
|
|
@@ -1,50 +1,43 @@
|
|
|
1
|
-
import { _ as _defineProperty, a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
1
|
import { jsx } from 'react/jsx-runtime';
|
|
4
2
|
import { PureComponent } from 'react';
|
|
5
3
|
|
|
6
|
-
const _excluded = ["onConditionalClick", "onPlainLeftClick", "activeClassName", "href", "children"];
|
|
7
4
|
const LEFT_BUTTON = 0;
|
|
8
5
|
// Cmd/Ctrl/Shift/Alt + Click should trigger default browser behaviour. Same applies to non-left clicks
|
|
9
6
|
const isPlainLeftClick = e => e.button === LEFT_BUTTON && !e.altKey && !e.ctrlKey && !e.metaKey && !e.shiftKey;
|
|
10
7
|
class ClickableLink extends PureComponent {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
}
|
|
8
|
+
onClick = e => {
|
|
9
|
+
const {
|
|
10
|
+
onClick,
|
|
11
|
+
onConditionalClick,
|
|
12
|
+
onPlainLeftClick
|
|
13
|
+
} = this.props;
|
|
14
|
+
const isPlainLeft = isPlainLeftClick(e);
|
|
15
|
+
if (onClick) {
|
|
16
|
+
onClick(e);
|
|
17
|
+
}
|
|
18
|
+
if (onConditionalClick) {
|
|
19
|
+
onConditionalClick(isPlainLeft, e);
|
|
20
|
+
}
|
|
21
|
+
if (onPlainLeftClick && isPlainLeft) {
|
|
22
|
+
e.preventDefault();
|
|
23
|
+
onPlainLeftClick(e);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
32
26
|
render() {
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}, restProps), {}, {
|
|
27
|
+
const {
|
|
28
|
+
onConditionalClick,
|
|
29
|
+
onPlainLeftClick,
|
|
30
|
+
activeClassName,
|
|
31
|
+
href,
|
|
32
|
+
children,
|
|
33
|
+
...restProps
|
|
34
|
+
} = this.props;
|
|
35
|
+
return jsx("a", {
|
|
36
|
+
href: href,
|
|
37
|
+
...restProps,
|
|
45
38
|
onClick: this.onClick,
|
|
46
39
|
children: children
|
|
47
|
-
})
|
|
40
|
+
});
|
|
48
41
|
}
|
|
49
42
|
}
|
|
50
43
|
|
package/components/link/link.js
CHANGED
|
@@ -1,31 +1,27 @@
|
|
|
1
|
-
import { a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { PureComponent } from 'react';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
4
|
import joinDataTestAttributes from '../global/data-tests.js';
|
|
6
5
|
import ClickableLink from './clickable-link.js';
|
|
7
6
|
import { l as linkStyles } from '../_helpers/link.js';
|
|
8
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
9
7
|
|
|
10
|
-
const _excluded = ["active", "inherit", "pseudo", "hover", "className", "data-test", "href", "children", "onPlainLeftClick", "onClick"];
|
|
11
8
|
function linkHOC(ComposedComponent) {
|
|
12
9
|
const isCustom = typeof ComposedComponent !== 'string' && ComposedComponent !== ClickableLink;
|
|
13
10
|
return class Link extends PureComponent {
|
|
14
11
|
render() {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
|
12
|
+
const {
|
|
13
|
+
active,
|
|
14
|
+
inherit,
|
|
15
|
+
pseudo,
|
|
16
|
+
hover,
|
|
17
|
+
className,
|
|
18
|
+
'data-test': dataTest,
|
|
19
|
+
href,
|
|
20
|
+
children,
|
|
21
|
+
onPlainLeftClick,
|
|
22
|
+
onClick,
|
|
23
|
+
...restProps
|
|
24
|
+
} = this.props;
|
|
29
25
|
const useButton = pseudo || !isCustom && (href === null || href === undefined);
|
|
30
26
|
const classes = classNames(linkStyles.link, className, {
|
|
31
27
|
[linkStyles.active]: active,
|
|
@@ -35,30 +31,32 @@ function linkHOC(ComposedComponent) {
|
|
|
35
31
|
});
|
|
36
32
|
let props = restProps;
|
|
37
33
|
if (isCustom && !props.activeClassName) {
|
|
38
|
-
props =
|
|
34
|
+
props = {
|
|
35
|
+
...props,
|
|
39
36
|
activeClassName: linkStyles.active
|
|
40
|
-
}
|
|
37
|
+
};
|
|
41
38
|
}
|
|
42
39
|
if (useButton) {
|
|
43
|
-
return jsx("button",
|
|
44
|
-
type: 'button'
|
|
45
|
-
|
|
40
|
+
return jsx("button", {
|
|
41
|
+
type: 'button',
|
|
42
|
+
...props,
|
|
46
43
|
className: classes,
|
|
47
44
|
onClick: onClick || onPlainLeftClick,
|
|
48
45
|
"data-test": joinDataTestAttributes('ring-link', dataTest),
|
|
49
46
|
children: children
|
|
50
|
-
})
|
|
47
|
+
});
|
|
51
48
|
}
|
|
52
|
-
return jsx(ComposedComponent,
|
|
49
|
+
return jsx(ComposedComponent, {
|
|
50
|
+
...props,
|
|
53
51
|
href: href,
|
|
54
52
|
className: classes,
|
|
55
|
-
onClick: onClick
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
onClick: onClick,
|
|
54
|
+
...(typeof ComposedComponent !== 'string' ? {
|
|
55
|
+
onPlainLeftClick
|
|
56
|
+
} : {}),
|
|
59
57
|
"data-test": joinDataTestAttributes('ring-link', dataTest),
|
|
60
58
|
children: children
|
|
61
|
-
})
|
|
59
|
+
});
|
|
62
60
|
}
|
|
63
61
|
};
|
|
64
62
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
1
|
import { jsx } from 'react/jsx-runtime';
|
|
4
2
|
import { PureComponent } from 'react';
|
|
5
3
|
import joinDataTestAttributes from '../global/data-tests.js';
|
|
@@ -10,15 +8,12 @@ import './consts.js';
|
|
|
10
8
|
import '../_helpers/list.js';
|
|
11
9
|
|
|
12
10
|
class ListCustom extends PureComponent {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
11
|
+
handleKeyPress = event => {
|
|
12
|
+
const key = getEventKey(event);
|
|
13
|
+
if (key === 'Enter' || key === ' ') {
|
|
14
|
+
this.props.onClick(event);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
22
17
|
render() {
|
|
23
18
|
const {
|
|
24
19
|
disabled,
|