@jetbrains/ring-ui-built 7.0.66 → 7.0.71
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 +16 -24
- 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,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 { forwardRef, useMemo, cloneElement } from 'react';
|
|
4
3
|
import List, { ActiveItemContext } from '../list/list.js';
|
|
@@ -7,9 +6,6 @@ import PopupMenu from '../popup-menu/popup-menu.js';
|
|
|
7
6
|
import getUID from '../global/get-uid.js';
|
|
8
7
|
import { A as Anchor } from '../_helpers/anchor.js';
|
|
9
8
|
import { isArray } from '../global/typescript-utils.js';
|
|
10
|
-
import 'core-js/modules/es.symbol.description.js';
|
|
11
|
-
import 'core-js/modules/es.string.trim.js';
|
|
12
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
13
9
|
import 'classnames';
|
|
14
10
|
import 'react-virtualized/dist/es/List';
|
|
15
11
|
import 'react-virtualized/dist/es/AutoSizer';
|
|
@@ -21,7 +17,6 @@ import '../global/data-tests.js';
|
|
|
21
17
|
import '../global/schedule-raf.js';
|
|
22
18
|
import '../global/memoize.js';
|
|
23
19
|
import '../global/dom.js';
|
|
24
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
25
20
|
import '../shortcuts/shortcuts.js';
|
|
26
21
|
import '../shortcuts/core.js';
|
|
27
22
|
import 'combokeys';
|
|
@@ -31,7 +26,6 @@ import '../global/create-stateful-context.js';
|
|
|
31
26
|
import '../list/list-item.js';
|
|
32
27
|
import '../avatar/avatar.js';
|
|
33
28
|
import '../global/url.js';
|
|
34
|
-
import 'core-js/modules/es.string.replace.js';
|
|
35
29
|
import '../_helpers/avatar-info.js';
|
|
36
30
|
import '../avatar/avatar-size.js';
|
|
37
31
|
import '../avatar/fallback-avatar.js';
|
|
@@ -64,112 +58,119 @@ import '../popup/popup.js';
|
|
|
64
58
|
import 'react-dom';
|
|
65
59
|
import '../tab-trap/tab-trap.js';
|
|
66
60
|
import '../popup/position.js';
|
|
67
|
-
import 'core-js/modules/es.array.sort.js';
|
|
68
61
|
import '../popup/popup.consts.js';
|
|
69
62
|
import '../popup/popup.target.js';
|
|
70
63
|
import '../popup/position-css.js';
|
|
71
64
|
|
|
72
|
-
const _excluded = ["anchor", "pinned", "active", "activeListItemId", "listId"],
|
|
73
|
-
_excluded2 = ["id", "anchor", "ariaLabel", "data", "onSelect", "menuProps", "children"],
|
|
74
|
-
_excluded3 = ["pinned", "active"];
|
|
75
65
|
const defaultAriaLabel = 'Dropdown menu';
|
|
76
|
-
function DropdownAnchorWrapper(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
66
|
+
function DropdownAnchorWrapper({
|
|
67
|
+
anchor,
|
|
68
|
+
pinned,
|
|
69
|
+
active,
|
|
70
|
+
activeListItemId,
|
|
71
|
+
listId,
|
|
72
|
+
...restProps
|
|
73
|
+
}) {
|
|
74
|
+
const anchorAriaProps = useMemo(() => ({
|
|
75
|
+
...(listId ? {
|
|
76
|
+
'aria-haspopup': true
|
|
77
|
+
} : {}),
|
|
78
|
+
...(activeListItemId ? {
|
|
79
|
+
'aria-activedescendant': activeListItemId,
|
|
80
|
+
'aria-owns': listId
|
|
81
|
+
} : {}),
|
|
82
|
+
...(active ? {
|
|
83
|
+
'aria-expanded': true
|
|
84
|
+
} : {})
|
|
85
|
+
}), [active, activeListItemId, listId]);
|
|
86
|
+
const anchorProps = useMemo(() => ({
|
|
94
87
|
active,
|
|
95
|
-
pinned
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
88
|
+
pinned,
|
|
89
|
+
...restProps,
|
|
90
|
+
...anchorAriaProps
|
|
91
|
+
}), [pinned, active, restProps, anchorAriaProps]);
|
|
92
|
+
const anchorComponentProps = useMemo(() => ({
|
|
93
|
+
...anchorProps,
|
|
94
|
+
pinned: `${anchorProps.pinned}`
|
|
99
95
|
}), [anchorProps]);
|
|
100
96
|
if (typeof anchor === 'string') {
|
|
101
|
-
return jsx(Anchor,
|
|
97
|
+
return jsx(Anchor, {
|
|
98
|
+
...anchorComponentProps,
|
|
102
99
|
children: anchor
|
|
103
|
-
})
|
|
100
|
+
});
|
|
104
101
|
}
|
|
105
102
|
if (typeof anchor === 'function') {
|
|
106
|
-
return anchor(
|
|
103
|
+
return anchor({
|
|
107
104
|
active,
|
|
108
|
-
pinned
|
|
109
|
-
|
|
105
|
+
pinned,
|
|
106
|
+
...restProps
|
|
107
|
+
}, anchorAriaProps);
|
|
110
108
|
}
|
|
111
109
|
if (!isArray(anchor)) {
|
|
112
110
|
return /*#__PURE__*/cloneElement(anchor, typeof anchor.type === 'string' ? anchorAriaProps : anchorComponentProps);
|
|
113
111
|
}
|
|
114
|
-
return jsx("div",
|
|
112
|
+
return jsx("div", {
|
|
113
|
+
...anchorAriaProps,
|
|
115
114
|
children: anchor
|
|
116
|
-
})
|
|
115
|
+
});
|
|
117
116
|
}
|
|
118
|
-
function renderDropdownMenuChildren(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
} = _ref2;
|
|
117
|
+
function renderDropdownMenuChildren({
|
|
118
|
+
children,
|
|
119
|
+
popupMenuProps
|
|
120
|
+
}) {
|
|
123
121
|
if (!children) {
|
|
124
|
-
return jsx(PopupMenu,
|
|
122
|
+
return jsx(PopupMenu, {
|
|
123
|
+
...popupMenuProps
|
|
124
|
+
});
|
|
125
125
|
}
|
|
126
|
-
return popupProps => children(
|
|
126
|
+
return popupProps => children({
|
|
127
|
+
...popupProps,
|
|
128
|
+
...popupMenuProps
|
|
129
|
+
});
|
|
127
130
|
}
|
|
128
|
-
const DropdownMenu = /*#__PURE__*/forwardRef(function DropdownMenu(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
restDropdownProps = _objectWithoutProperties(_ref3, _excluded2);
|
|
131
|
+
const DropdownMenu = /*#__PURE__*/forwardRef(function DropdownMenu({
|
|
132
|
+
id,
|
|
133
|
+
anchor,
|
|
134
|
+
ariaLabel,
|
|
135
|
+
data,
|
|
136
|
+
onSelect,
|
|
137
|
+
menuProps,
|
|
138
|
+
children,
|
|
139
|
+
...restDropdownProps
|
|
140
|
+
}, forwardedRef) {
|
|
139
141
|
const listId = useMemo(() => id || getUID('dropdown-menu-list'), [id]);
|
|
140
|
-
const popupMenuProps = useMemo(() =>
|
|
142
|
+
const popupMenuProps = useMemo(() => ({
|
|
141
143
|
ref: forwardedRef,
|
|
142
144
|
id: listId,
|
|
143
145
|
ariaLabel: ariaLabel || defaultAriaLabel,
|
|
144
146
|
closeOnSelect: true,
|
|
145
147
|
activateFirstItem: true,
|
|
146
148
|
data,
|
|
147
|
-
onSelect
|
|
148
|
-
|
|
149
|
+
onSelect,
|
|
150
|
+
...menuProps
|
|
151
|
+
}), [ariaLabel, data, forwardedRef, listId, menuProps, onSelect]);
|
|
149
152
|
return jsx(ActiveItemContext.Provider, {
|
|
150
|
-
children: jsx(Dropdown,
|
|
151
|
-
anchor:
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
}, restDropdownProps), {}, {
|
|
153
|
+
children: jsx(Dropdown, {
|
|
154
|
+
anchor: ({
|
|
155
|
+
pinned,
|
|
156
|
+
active,
|
|
157
|
+
...restAnchorProps
|
|
158
|
+
}) => jsx(ActiveItemContext.ValueContext.Consumer, {
|
|
159
|
+
children: activeItemId => jsx(DropdownAnchorWrapper, {
|
|
160
|
+
anchor: anchor,
|
|
161
|
+
pinned: pinned,
|
|
162
|
+
active: active,
|
|
163
|
+
activeListItemId: activeItemId,
|
|
164
|
+
listId: listId,
|
|
165
|
+
...restAnchorProps
|
|
166
|
+
})
|
|
167
|
+
}),
|
|
168
|
+
...restDropdownProps,
|
|
168
169
|
children: renderDropdownMenuChildren({
|
|
169
170
|
children,
|
|
170
171
|
popupMenuProps
|
|
171
172
|
})
|
|
172
|
-
})
|
|
173
|
+
})
|
|
173
174
|
});
|
|
174
175
|
});
|
|
175
176
|
var DropdownMenu$1 = Object.assign(DropdownMenu, {
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import 'core-js/modules/es.string.trim.js';
|
|
3
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
4
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
5
2
|
import * as React from 'react';
|
|
6
3
|
import { useCallback, useEffect } from 'react';
|
|
@@ -17,8 +14,6 @@ import '@jetbrains/icons/chevron-12px-down';
|
|
|
17
14
|
import '../icon/icon.js';
|
|
18
15
|
import '../icon/icon.constants.js';
|
|
19
16
|
import '../_helpers/icon-svg.js';
|
|
20
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
21
|
-
import 'core-js/modules/es.string.replace.js';
|
|
22
17
|
import '../global/memoize.js';
|
|
23
18
|
import '../link/clickable-link.js';
|
|
24
19
|
import '../global/controls-height.js';
|
|
@@ -38,41 +33,40 @@ import 'sniffr';
|
|
|
38
33
|
|
|
39
34
|
var styles = {"editableHeading":"ring-editable-heading-editableHeading","fullSize":"ring-editable-heading-fullSize","isEditing":"ring-editable-heading-isEditing","headingWrapperButton":"ring-editable-heading-headingWrapperButton","disabled":"ring-editable-heading-disabled","selectionMode":"ring-editable-heading-selectionMode","heading":"ring-editable-heading-heading","multiline":"ring-editable-heading-multiline","input":"ring-editable-heading-input","error":"ring-editable-heading-error","textarea":"ring-editable-heading-textarea","textareaNotOverflow":"ring-editable-heading-textareaNotOverflow","textareaFade":"ring-editable-heading-textareaFade","textareaWrapper":"ring-editable-heading-textareaWrapper","button":"ring-editable-heading-button","errorText":"ring-editable-heading-errorText","level1":"ring-editable-heading-level1","level2":"ring-editable-heading-level2","level3":"ring-editable-heading-level3","sizeS":"ring-editable-heading-sizeS","sizeM":"ring-editable-heading-sizeM","sizeL":"ring-editable-heading-sizeL","sizeFULL":"ring-editable-heading-sizeFULL"};
|
|
40
35
|
|
|
41
|
-
const _excluded = ["level", "className", "headingClassName", "inputClassName", "children", "isEditing", "isSavingPossible", "isSaving", "embedded", "size", "onEdit", "onSave", "onCancel", "autoFocus", "data-test", "error", "disabled", "multiline", "renderMenu", "onFocus", "onBlur", "onChange", "onScroll", "maxInputRows", "translations"];
|
|
42
36
|
function noop() {}
|
|
43
37
|
// eslint-disable-next-line complexity
|
|
44
38
|
const EditableHeading = props => {
|
|
45
39
|
const {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
40
|
+
level = Levels.H1,
|
|
41
|
+
className,
|
|
42
|
+
headingClassName,
|
|
43
|
+
inputClassName,
|
|
44
|
+
children,
|
|
45
|
+
isEditing = false,
|
|
46
|
+
isSavingPossible = false,
|
|
47
|
+
isSaving = false,
|
|
48
|
+
embedded = false,
|
|
49
|
+
size = Size.L,
|
|
50
|
+
onEdit = noop,
|
|
51
|
+
onSave = noop,
|
|
52
|
+
onCancel = noop,
|
|
53
|
+
autoFocus = true,
|
|
54
|
+
'data-test': dataTest,
|
|
55
|
+
error,
|
|
56
|
+
disabled,
|
|
57
|
+
multiline = false,
|
|
58
|
+
renderMenu = () => null,
|
|
59
|
+
onFocus,
|
|
60
|
+
onBlur,
|
|
61
|
+
onChange,
|
|
62
|
+
onScroll,
|
|
63
|
+
maxInputRows,
|
|
64
|
+
translations = {
|
|
65
|
+
save: 'Save',
|
|
66
|
+
cancel: 'Cancel'
|
|
67
|
+
},
|
|
68
|
+
...restProps
|
|
69
|
+
} = props;
|
|
76
70
|
const [shortcutsScope] = React.useState(getUID('ring-editable-heading-'));
|
|
77
71
|
const [isInFocus, setIsInFocus] = React.useState(false);
|
|
78
72
|
const [isMouseDown, setIsMouseDown] = React.useState(false);
|
|
@@ -102,10 +96,10 @@ const EditableHeading = props => {
|
|
|
102
96
|
[styles.multiline]: multiline,
|
|
103
97
|
[styles.selectionMode]: isInSelectionMode
|
|
104
98
|
});
|
|
105
|
-
const headingClasses = classNames(styles.heading, headingClassName, styles[
|
|
99
|
+
const headingClasses = classNames(styles.heading, headingClassName, styles[`size${size}`]);
|
|
106
100
|
const inputClasses = classNames('ring-js-shortcuts', styles.input, styles.textarea, {
|
|
107
101
|
[styles.textareaNotOverflow]: !isOverflow
|
|
108
|
-
}, inputStyles[
|
|
102
|
+
}, inputStyles[`size${size}`], styles[`level${level}`], inputClassName);
|
|
109
103
|
const stretch = useCallback(el => {
|
|
110
104
|
if (!el || !el.style) {
|
|
111
105
|
return;
|
|
@@ -115,7 +109,7 @@ const EditableHeading = props => {
|
|
|
115
109
|
paddingTop,
|
|
116
110
|
paddingBottom
|
|
117
111
|
} = window.getComputedStyle(el);
|
|
118
|
-
el.style.height =
|
|
112
|
+
el.style.height = `${el.scrollHeight - parseFloat(paddingTop) - parseFloat(paddingBottom)}px`;
|
|
119
113
|
}, []);
|
|
120
114
|
const checkValue = useCallback(el => {
|
|
121
115
|
if (multiline && el && el.scrollHeight >= el.clientHeight) {
|
|
@@ -149,20 +143,20 @@ const EditableHeading = props => {
|
|
|
149
143
|
setIsInFocus(true);
|
|
150
144
|
checkValue(e.target);
|
|
151
145
|
checkOverflow(e.target);
|
|
152
|
-
onFocus
|
|
146
|
+
onFocus?.(e);
|
|
153
147
|
}, [onFocus, checkOverflow, checkValue]);
|
|
154
148
|
const onInputChange = React.useCallback(e => {
|
|
155
149
|
checkValue(e.target);
|
|
156
150
|
checkOverflow(e.target);
|
|
157
|
-
onChange
|
|
151
|
+
onChange?.(e);
|
|
158
152
|
}, [onChange, checkOverflow, checkValue]);
|
|
159
153
|
const onInputScroll = React.useCallback(e => {
|
|
160
154
|
checkOverflow(e.target);
|
|
161
|
-
onScroll
|
|
155
|
+
onScroll?.(e);
|
|
162
156
|
}, [onScroll, checkOverflow]);
|
|
163
157
|
const onInputBlur = React.useCallback(e => {
|
|
164
158
|
setIsInFocus(false);
|
|
165
|
-
onBlur
|
|
159
|
+
onBlur?.(e);
|
|
166
160
|
}, [onBlur]);
|
|
167
161
|
useEffect(() => {
|
|
168
162
|
window.addEventListener('mousemove', onMouseMove);
|
|
@@ -180,34 +174,34 @@ const EditableHeading = props => {
|
|
|
180
174
|
map: shortcutsMap,
|
|
181
175
|
scope: shortcutsScope,
|
|
182
176
|
disabled: isShortcutsDisabled
|
|
183
|
-
}), !multiline ? jsx("input",
|
|
177
|
+
}), !multiline ? jsx("input", {
|
|
184
178
|
className: inputClasses,
|
|
185
179
|
value: children,
|
|
186
180
|
autoFocus: autoFocus,
|
|
187
181
|
"data-test": dataTest,
|
|
188
182
|
disabled: isSaving,
|
|
189
|
-
onChange: onChange
|
|
190
|
-
|
|
183
|
+
onChange: onChange,
|
|
184
|
+
...restProps,
|
|
191
185
|
onFocus: onInputFocus,
|
|
192
186
|
onBlur: onInputBlur
|
|
193
|
-
})
|
|
194
|
-
className: classNames(styles.textareaWrapper, inputStyles[
|
|
195
|
-
children: [jsx("textarea",
|
|
187
|
+
}) : jsxs("div", {
|
|
188
|
+
className: classNames(styles.textareaWrapper, inputStyles[`size${size}`]),
|
|
189
|
+
children: [jsx("textarea", {
|
|
196
190
|
ref: textAreaRef,
|
|
197
191
|
className: inputClasses,
|
|
198
192
|
value: children,
|
|
199
193
|
autoFocus: autoFocus,
|
|
200
194
|
"data-test": dataTest,
|
|
201
195
|
disabled: isSaving,
|
|
202
|
-
onChange: onInputChange
|
|
203
|
-
|
|
196
|
+
onChange: onInputChange,
|
|
197
|
+
...restProps,
|
|
204
198
|
onFocus: onInputFocus,
|
|
205
199
|
onBlur: onInputBlur,
|
|
206
200
|
onScroll: onInputScroll,
|
|
207
201
|
style: {
|
|
208
|
-
maxHeight: maxInputRows ?
|
|
202
|
+
maxHeight: maxInputRows ? `${maxInputRows}lh` : ''
|
|
209
203
|
}
|
|
210
|
-
})
|
|
204
|
+
}), !isScrolledToBottom && jsx("div", {
|
|
211
205
|
className: styles.textareaFade
|
|
212
206
|
})]
|
|
213
207
|
})]
|
|
@@ -237,7 +231,7 @@ const EditableHeading = props => {
|
|
|
237
231
|
})]
|
|
238
232
|
})]
|
|
239
233
|
}), isEditing && error && jsx("div", {
|
|
240
|
-
className: classNames(styles.errorText, inputStyles[
|
|
234
|
+
className: classNames(styles.errorText, inputStyles[`size${size}`]),
|
|
241
235
|
children: error
|
|
242
236
|
})]
|
|
243
237
|
});
|
|
@@ -1,14 +1,14 @@
|
|
|
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 error = instance.findLayers(() => true)[0].textContent;
|
|
7
5
|
const imports = ["import ErrorBubble from '@jetbrains/ring-ui/components/error-bubble/error-bubble'"];
|
|
8
|
-
const props = [
|
|
6
|
+
const props = [`error={\`${error}\``];
|
|
9
7
|
var errorBubble_figma = {
|
|
10
8
|
id: 'error-bubble',
|
|
11
|
-
example: figma.code
|
|
9
|
+
example: figma.code`${imports.join('\n')}
|
|
10
|
+
|
|
11
|
+
<ErrorBubble ${props.map(prop => `${prop} `).join('')}/>`
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export { errorBubble_figma as default };
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { PureComponent, Children, cloneElement } from 'react';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
4
|
import Popup from '../popup/popup.js';
|
|
6
5
|
import { Directions } from '../popup/popup.consts.js';
|
|
7
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
8
|
-
import 'core-js/modules/es.string.replace.js';
|
|
9
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
10
6
|
import 'react-dom';
|
|
11
7
|
import '../global/get-uid.js';
|
|
12
8
|
import '../global/schedule-raf.js';
|
|
@@ -20,29 +16,29 @@ import '../global/data-tests.js';
|
|
|
20
16
|
import '../tab-trap/tab-trap.js';
|
|
21
17
|
import '../global/configuration.js';
|
|
22
18
|
import '../popup/position.js';
|
|
23
|
-
import 'core-js/modules/es.array.sort.js';
|
|
24
19
|
import '../popup/popup.target.js';
|
|
25
20
|
import '../popup/position-css.js';
|
|
26
21
|
|
|
27
22
|
var styles = {"errorBubblePopup":"ring-error-bubble-errorBubblePopup","errorBubbleWrapper":"ring-error-bubble-errorBubbleWrapper","errorBubble":"ring-error-bubble-errorBubble"};
|
|
28
23
|
|
|
29
|
-
const _excluded = ["children", "className"];
|
|
30
24
|
/**
|
|
31
25
|
* @name Error Bubble
|
|
32
26
|
*/
|
|
33
27
|
class ErrorBubble extends PureComponent {
|
|
34
28
|
render() {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
restProps = _objectWithoutProperties(_this$props, _excluded);
|
|
29
|
+
const {
|
|
30
|
+
children,
|
|
31
|
+
className,
|
|
32
|
+
...restProps
|
|
33
|
+
} = this.props;
|
|
41
34
|
const errorBubbleClasses = classNames(styles.errorBubble, className);
|
|
42
35
|
return jsxs("div", {
|
|
43
36
|
className: styles.errorBubbleWrapper,
|
|
44
37
|
"data-test": 'ring-error-bubble-wrapper',
|
|
45
|
-
children: [children && Children.map(children, child => /*#__PURE__*/cloneElement(child,
|
|
38
|
+
children: [children && Children.map(children, child => /*#__PURE__*/cloneElement(child, {
|
|
39
|
+
...child.props,
|
|
40
|
+
...restProps
|
|
41
|
+
})), restProps.error && jsx(Popup, {
|
|
46
42
|
trapFocus: false,
|
|
47
43
|
className: styles.errorBubblePopup,
|
|
48
44
|
hidden: false,
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import 'core-js/modules/es.symbol.description.js';
|
|
2
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { Component } from 'react';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
4
|
import Icon from '../icon/icon.js';
|
|
6
5
|
import { Size } from '../icon/icon.constants.js';
|
|
7
6
|
import joinDataTestAttributes from '../global/data-tests.js';
|
|
8
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
9
7
|
import 'util-deprecate';
|
|
10
8
|
import '../_helpers/icon-svg.js';
|
|
11
|
-
import 'core-js/modules/es.regexp.exec.js';
|
|
12
|
-
import 'core-js/modules/es.string.replace.js';
|
|
13
9
|
import '../global/memoize.js';
|
|
14
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
15
10
|
|
|
16
11
|
var styles = {"errorMessage":"ring-error-message-errorMessage","title":"ring-error-message-title","description":"ring-error-message-description","content":"ring-error-message-content","icon":"ring-error-message-icon"};
|
|
17
12
|
|
|
@@ -43,7 +38,7 @@ class ErrorMessage extends Component {
|
|
|
43
38
|
children: [jsxs("div", {
|
|
44
39
|
className: styles.title,
|
|
45
40
|
"data-test": 'ring-error-message-title',
|
|
46
|
-
children: [code &&
|
|
41
|
+
children: [code && `${code}:`, " ", message]
|
|
47
42
|
}), description && jsx("div", {
|
|
48
43
|
className: styles.description,
|
|
49
44
|
children: description
|
|
@@ -2,19 +2,16 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { memo, isValidElement } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import Link from '../link/link.js';
|
|
5
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
6
5
|
import '../global/data-tests.js';
|
|
7
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
8
6
|
import '../link/clickable-link.js';
|
|
9
7
|
import '../_helpers/link.js';
|
|
10
8
|
|
|
11
9
|
var styles = {"footer":"ring-footer-footer ring-global-font","footerFloating":"ring-footer-footerFloating ring-footer-footer ring-global-font","column":"ring-footer-column","columnItem":"ring-footer-columnItem","columnLeft":"ring-footer-columnLeft ring-footer-column","columnCenter":"ring-footer-columnCenter ring-footer-column","line":"ring-footer-line","columnRight":"ring-footer-columnRight ring-footer-column","lineCenter":"ring-footer-lineCenter"};
|
|
12
10
|
|
|
13
|
-
const FooterColumn = /*#__PURE__*/memo(function FooterColumn(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = _ref;
|
|
11
|
+
const FooterColumn = /*#__PURE__*/memo(function FooterColumn({
|
|
12
|
+
position,
|
|
13
|
+
children
|
|
14
|
+
}) {
|
|
18
15
|
const classes = classNames({
|
|
19
16
|
[styles.columnLeft]: position === 'left',
|
|
20
17
|
[styles.columnCenter]: position === 'center',
|
|
@@ -71,14 +68,13 @@ const FooterLine = /*#__PURE__*/memo(function FooterLine(props) {
|
|
|
71
68
|
children: items.map(renderItem)
|
|
72
69
|
});
|
|
73
70
|
});
|
|
74
|
-
const Footer = /*#__PURE__*/memo(function Footer(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
} = _ref2;
|
|
71
|
+
const Footer = /*#__PURE__*/memo(function Footer({
|
|
72
|
+
floating,
|
|
73
|
+
className,
|
|
74
|
+
left,
|
|
75
|
+
center,
|
|
76
|
+
right
|
|
77
|
+
}) {
|
|
82
78
|
function content(elements, position) {
|
|
83
79
|
if (!elements) {
|
|
84
80
|
return false;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import memoizeOne from 'memoize-one';
|
|
2
2
|
|
|
3
|
-
function composeRefs() {
|
|
4
|
-
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
5
|
-
refs[_key] = arguments[_key];
|
|
6
|
-
}
|
|
3
|
+
function composeRefs(...refs) {
|
|
7
4
|
return value => refs.forEach(ref => {
|
|
8
5
|
if (typeof ref === 'function') {
|
|
9
6
|
ref(value);
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
|
2
|
-
|
|
3
1
|
var ControlsHeight;
|
|
4
2
|
(function (ControlsHeight) {
|
|
5
3
|
ControlsHeight["S"] = "S";
|
|
@@ -19,7 +17,9 @@ function configure(config) {
|
|
|
19
17
|
}
|
|
20
18
|
}
|
|
21
19
|
function getConfiguration() {
|
|
22
|
-
return
|
|
20
|
+
return {
|
|
21
|
+
...globalConfiguration
|
|
22
|
+
};
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export { ControlsHeight, configure, getConfiguration };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createContext } from 'react';
|
|
2
2
|
import deprecate from 'util-deprecate';
|
|
3
3
|
import { ControlsHeight, getConfiguration, configure } from './configuration.js';
|
|
4
|
-
import '../_helpers/_rollupPluginBabelHelpers.js';
|
|
5
4
|
|
|
6
5
|
// This can be used if React Context is not applicable, for example for alertService or Auth dialog
|
|
7
6
|
const configureGlobalControlsHeight = deprecate(value => {
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
1
|
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
import { memo, createContext, useState, useContext, useEffect } from 'react';
|
|
4
3
|
|
|
5
|
-
function createStatefulContext(initialValue) {
|
|
6
|
-
let name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
4
|
+
function createStatefulContext(initialValue, name = '') {
|
|
7
5
|
const ValueContext = /*#__PURE__*/createContext(initialValue);
|
|
8
6
|
const UpdateContext = /*#__PURE__*/createContext(() => {});
|
|
9
|
-
function Provider(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} = _ref;
|
|
7
|
+
function Provider({
|
|
8
|
+
children
|
|
9
|
+
}) {
|
|
13
10
|
const [value, update] = useState(initialValue);
|
|
14
11
|
return jsx(ValueContext.Provider, {
|
|
15
12
|
value: value,
|
|
@@ -19,7 +16,7 @@ function createStatefulContext(initialValue) {
|
|
|
19
16
|
})
|
|
20
17
|
});
|
|
21
18
|
}
|
|
22
|
-
Provider.displayName =
|
|
19
|
+
Provider.displayName = `${name}Provider`;
|
|
23
20
|
function useUpdate(value, skipUpdate) {
|
|
24
21
|
const update = useContext(UpdateContext);
|
|
25
22
|
useEffect(() => {
|
|
@@ -28,15 +25,14 @@ function createStatefulContext(initialValue) {
|
|
|
28
25
|
}
|
|
29
26
|
}, [update, value, skipUpdate]);
|
|
30
27
|
}
|
|
31
|
-
function Updater(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
} = _ref2;
|
|
28
|
+
function Updater({
|
|
29
|
+
value,
|
|
30
|
+
skipUpdate
|
|
31
|
+
}) {
|
|
36
32
|
useUpdate(value, skipUpdate);
|
|
37
33
|
return null;
|
|
38
34
|
}
|
|
39
|
-
Updater.displayName =
|
|
35
|
+
Updater.displayName = `${name}Updater`;
|
|
40
36
|
return {
|
|
41
37
|
ValueContext,
|
|
42
38
|
UpdateContext,
|