@jetbrains/ring-ui-built 8.0.0-beta.2 → 8.0.0-beta.4
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 +1 -1
- package/components/_helpers/avatar-info.js +1 -1
- package/components/_helpers/heading.js +2 -2
- package/components/_helpers/icon-svg.js +1 -1
- package/components/_helpers/legacy-table.js +3 -0
- package/components/_helpers/tab-link.js +1 -1
- package/components/_helpers/table.js +1 -1
- package/components/_helpers/theme.js +50 -38
- package/components/alert/alert.js +2 -2
- package/components/alert-service/alert-service.js +1 -1
- package/components/auth/auth-core.js +1 -1
- package/components/auth/auth.js +1 -1
- package/components/auth/down-notification.js +1 -1
- package/components/auth/iframe-flow.js +2 -2
- package/components/auth/storage.js +1 -1
- package/components/auth-dialog/auth-dialog.js +1 -1
- package/components/auth-dialog-service/auth-dialog-service.js +2 -2
- package/components/avatar/avatar-info.js +1 -1
- package/components/avatar/avatar.js +1 -1
- package/components/avatar/fallback-avatar.js +1 -1
- package/components/avatar-stack/avatar-stack.js +1 -1
- package/components/banner/banner.js +1 -1
- package/components/button/button.js +1 -1
- package/components/button-group/button-group.js +1 -1
- package/components/checkbox/checkbox.d.ts +1 -1
- package/components/checkbox/checkbox.js +1 -1
- package/components/clipboard/clipboard.js +1 -1
- package/components/collapse/collapse-content.js +5 -5
- package/components/collapse/collapse-control.js +5 -5
- package/components/collapse/collapse.js +4 -4
- package/components/collapsible-group/collapsible-group.d.ts +20 -0
- package/components/collapsible-group/collapsible-group.js +382 -0
- package/components/components/util-stories.js +63 -1
- package/components/confirm/confirm.js +1 -1
- package/components/confirm-service/confirm-service.js +2 -2
- package/components/contenteditable/contenteditable.js +1 -1
- package/components/control-help/control-help.js +1 -1
- package/components/control-label/control-label.js +1 -1
- package/components/data-list/data-list.d.ts +1 -1
- package/components/data-list/data-list.js +1 -1
- package/components/data-list/data-list.mock.d.ts +1 -1
- package/components/data-list/data-list.mock.js +1 -1
- package/components/data-list/item.d.ts +1 -1
- package/components/data-list/item.js +1 -1
- package/components/data-list/selection.d.ts +1 -1
- package/components/data-list/selection.js +2 -2
- package/components/data-list/title.js +1 -1
- package/components/date-picker/date-input.js +1 -1
- package/components/date-picker/date-picker.js +1 -2
- package/components/date-picker/date-popup.js +4 -5
- package/components/date-picker/month-names.js +1 -1
- package/components/date-picker/month-slider.js +1 -1
- package/components/date-picker/month.js +1 -1
- package/components/date-picker/months.js +4 -5
- package/components/date-picker/use-scroll-behavior.js +45 -44
- package/components/date-picker/weekdays.js +1 -1
- package/components/date-picker/years.js +6 -7
- package/components/dialog/dialog.d.ts +2 -2
- package/components/dialog/dialog.js +3 -3
- package/components/dropdown/anchor.js +1 -1
- package/components/dropdown/dropdown.js +1 -1
- package/components/dropdown-menu/dropdown-menu.d.ts +4 -4
- package/components/dropdown-menu/dropdown-menu.js +68 -63
- package/components/editable-heading/editable-heading.d.ts +1 -2
- package/components/editable-heading/editable-heading.js +127 -113
- package/components/error-bubble/error-bubble.js +1 -1
- package/components/error-message/error-message.js +1 -1
- package/components/expand/collapsible-group.d.ts +8 -16
- package/components/expand/collapsible-group.js +34 -364
- package/components/footer/footer.js +1 -1
- package/components/global/compose-refs.d.ts +2 -1
- package/components/global/compose-refs.js +44 -8
- package/components/global/create-stateful-context.js +11 -11
- package/components/global/focus-sensor-hoc.js +1 -0
- package/components/global/focus-with-temporary-tabindex.d.ts +11 -0
- package/components/global/focus-with-temporary-tabindex.js +23 -0
- package/components/global/intersection-observer-context.d.ts +31 -11
- package/components/global/intersection-observer-context.js +55 -57
- package/components/global/is-within-interactive-element.d.ts +6 -0
- package/components/global/is-within-interactive-element.js +11 -0
- package/components/global/is-within-navigable-element.d.ts +6 -0
- package/components/global/is-within-navigable-element.js +11 -0
- package/components/global/parse-css-duration.d.ts +5 -0
- package/components/global/parse-css-duration.js +14 -0
- package/components/global/rerender-hoc.d.ts +4 -2
- package/components/global/rerender-hoc.js +11 -24
- package/components/global/schedule-with-cleanup.d.ts +12 -0
- package/components/global/schedule-with-cleanup.js +36 -0
- package/components/{legacy-table/selection.d.ts → global/table-selection.d.ts} +14 -14
- package/components/{legacy-table/selection.js → global/table-selection.js} +4 -4
- package/components/global/theme.d.ts +4 -3
- package/components/global/theme.js +2 -2
- package/components/header/header-icon.js +1 -1
- package/components/header/header.js +2 -2
- package/components/header/links.js +1 -1
- package/components/header/logo.js +1 -1
- package/components/header/profile.js +1 -1
- package/components/header/services.js +1 -1
- package/components/header/smart-profile.js +1 -1
- package/components/header/smart-services.js +1 -1
- package/components/heading/heading.js +4 -4
- package/components/i18n/i18n-context.js +4 -4
- package/components/icon/icon-svg.js +1 -1
- package/components/icon/icon.js +1 -1
- package/components/icon/index.js +1 -1
- package/components/input/input.d.ts +1 -1
- package/components/input/input.js +1 -1
- package/components/internal/column-animation.js +133 -0
- package/components/internal/table-header.js +1109 -0
- package/components/internal/virtual-items.js +353 -0
- package/components/island/adaptive-island-hoc.js +3 -3
- package/components/island/content.d.ts +7 -2
- package/components/island/content.js +27 -18
- package/components/island/header.js +1 -1
- package/components/island/island.js +1 -1
- package/components/legacy-table/cell.js +1 -1
- package/components/legacy-table/header-cell.js +4 -4
- package/components/legacy-table/header.js +2 -2
- package/components/legacy-table/multitable.d.ts +1 -1
- package/components/legacy-table/row-with-focus-sensor.js +2 -2
- package/components/legacy-table/row.d.ts +1 -1
- package/components/legacy-table/row.js +4 -4
- package/components/legacy-table/selection-adapter.d.ts +3 -3
- package/components/legacy-table/selection-shortcuts-hoc.d.ts +5 -5
- package/components/legacy-table/simple-table.d.ts +2 -2
- package/components/legacy-table/simple-table.js +4 -4
- package/components/legacy-table/smart-table.d.ts +5 -5
- package/components/legacy-table/smart-table.js +5 -5
- package/components/legacy-table/table.js +2 -2
- package/components/list/list-item.js +1 -1
- package/components/list/list-users-groups-source.js +1 -1
- package/components/list/list.js +1 -1
- package/components/login-dialog/login-dialog.js +1 -1
- package/components/login-dialog/service.js +2 -2
- package/components/markdown/markdown.js +2 -2
- package/components/message/message.js +2 -2
- package/components/old-browsers-message/white-list.js +2 -2
- package/components/pager/pager.js +1 -1
- package/components/popup/popup.d.ts +2 -0
- package/components/popup/popup.js +6 -2
- package/components/popup/popup.target.d.ts +3 -2
- package/components/popup/popup.target.js +32 -28
- package/components/popup-menu/popup-menu.js +1 -1
- package/components/query-assist/query-assist-suggestions.js +1 -1
- package/components/query-assist/query-assist.d.ts +3 -1
- package/components/query-assist/query-assist.js +2 -2
- package/components/radio/radio-item.d.ts +3 -3
- package/components/radio/radio-item.js +32 -18
- package/components/radio/radio.d.ts +2 -2
- package/components/radio/radio.js +2 -2
- package/components/scrollable-section/scrollable-section.js +1 -1
- package/components/select/chevron-button.js +1 -1
- package/components/select/select-filter.js +1 -1
- package/components/select/select-popup.d.ts +1 -1
- package/components/select/select-popup.js +1 -1
- package/components/select/select.d.ts +4 -2
- package/components/select/select.js +1 -1
- package/components/slider/slider.js +100 -96
- package/components/storage/storage-local.js +1 -1
- package/components/storage/storage.js +1 -1
- package/components/style.css +1 -1
- package/components/tab-trap/tab-trap.d.ts +3 -3
- package/components/tab-trap/tab-trap.js +83 -80
- package/components/table/default-item-renderer.d.ts +35 -11
- package/components/table/default-item-renderer.js +118 -171
- package/components/table/internal/column-animation.d.ts +16 -0
- package/components/table/internal/table-header.d.ts +4 -0
- package/components/table/internal/virtual-items.d.ts +34 -0
- package/components/table/item-virtualization.d.ts +35 -0
- package/components/table/item-virtualization.js +71 -0
- package/components/table/table-const.d.ts +40 -6
- package/components/table/table-const.js +15 -6
- package/components/table/table-primitives.d.ts +21 -0
- package/components/table/table-primitives.js +123 -0
- package/components/table/table-props.d.ts +280 -0
- package/components/table/table-props.js +1 -0
- package/components/table/table.d.ts +205 -224
- package/components/table/table.js +356 -14
- package/components/tabs/collapsible-more.js +1 -1
- package/components/tabs/collapsible-tab.js +1 -1
- package/components/tabs/collapsible-tabs.js +1 -1
- package/components/tabs/dumb-tabs.js +1 -1
- package/components/tabs/smart-tabs.js +1 -1
- package/components/tabs/tab-link.js +1 -1
- package/components/tabs/tabs.js +1 -1
- package/components/tag/tag.js +1 -1
- package/components/tags-input/tags-input.d.ts +3 -1
- package/components/tags-input/tags-input.js +1 -1
- package/components/tags-list/tags-list.js +1 -1
- package/components/toggle/toggle.js +1 -1
- package/components/tooltip/tooltip.js +3 -3
- package/components/upload/upload.d.ts +4 -3
- package/components/upload/upload.js +7 -29
- package/components/user-agreement/service.js +8 -8
- package/components/user-agreement/user-agreement.js +1 -1
- package/components/user-card/card.js +1 -1
- package/components/user-card/smart-user-card-tooltip.js +1 -1
- package/components/user-card/tooltip.js +1 -1
- package/components/user-card/user-card.js +1 -1
- package/components/util-stories.d.ts +26 -0
- package/package.json +7 -7
- package/components/_helpers/table2.js +0 -3
- package/components/date-picker/use-intersection-observer.d.ts +0 -6
- package/components/date-picker/use-intersection-observer.js +0 -93
- package/components/global/composeRefs.d.ts +0 -6
- package/components/global/composeRefs.js +0 -9
- package/components/global/use-event-callback.d.ts +0 -1
- package/components/global/use-event-callback.js +0 -44
- package/components/table/table-base.d.ts +0 -24
- package/components/table/table-base.js +0 -311
- package/components/table/table-component.d.ts +0 -53
- package/components/table/table-component.js +0 -316
- package/components/table/table-virtualize.d.ts +0 -32
- package/components/table/table-virtualize.js +0 -330
|
@@ -1,381 +1,51 @@
|
|
|
1
|
-
import { c } from 'react
|
|
2
|
-
import { forwardRef
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
11
|
-
import 'util-deprecate';
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import deprecate from 'util-deprecate';
|
|
4
|
+
import CollapsibleGroup from '../collapsible-group/collapsible-group.js';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
import 'classnames';
|
|
7
|
+
import '@jetbrains/icons/chevron-12px-right';
|
|
8
|
+
import '@jetbrains/icons/chevron-12px-down';
|
|
9
|
+
import '../icon/icon.js';
|
|
12
10
|
import '../icon/icon.constants.js';
|
|
13
11
|
import '../_helpers/icon-svg.js';
|
|
14
12
|
import '../global/memoize.js';
|
|
13
|
+
import '../collapse/collapse.js';
|
|
14
|
+
import '../collapse/collapse-context.js';
|
|
15
15
|
import '../collapse/consts.js';
|
|
16
|
+
import '../collapse/collapse-content.js';
|
|
16
17
|
import '../global/data-tests.js';
|
|
17
18
|
import '../global/dom.js';
|
|
18
19
|
import '../collapse/utils.js';
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
$
|
|
29
|
-
}
|
|
30
|
-
const {
|
|
31
|
-
avatar,
|
|
32
|
-
titleContent,
|
|
33
|
-
subtitle
|
|
34
|
-
} = t0;
|
|
35
|
-
const {
|
|
36
|
-
collapsed
|
|
37
|
-
} = useContext(CollapseContext);
|
|
38
|
-
let t1;
|
|
39
|
-
if ($[1] !== titleContent) {
|
|
40
|
-
t1 = /*#__PURE__*/jsx("span", {
|
|
41
|
-
className: styles.title,
|
|
42
|
-
children: titleContent
|
|
43
|
-
});
|
|
44
|
-
$[1] = titleContent;
|
|
45
|
-
$[2] = t1;
|
|
46
|
-
} else {
|
|
47
|
-
t1 = $[2];
|
|
48
|
-
}
|
|
49
|
-
let t2;
|
|
50
|
-
if ($[3] !== avatar || $[4] !== t1) {
|
|
51
|
-
t2 = /*#__PURE__*/jsxs("span", {
|
|
52
|
-
className: styles.avatarGroup,
|
|
53
|
-
children: [avatar, t1]
|
|
54
|
-
});
|
|
55
|
-
$[3] = avatar;
|
|
56
|
-
$[4] = t1;
|
|
57
|
-
$[5] = t2;
|
|
58
|
-
} else {
|
|
59
|
-
t2 = $[5];
|
|
60
|
-
}
|
|
61
|
-
let t3;
|
|
62
|
-
if ($[6] !== subtitle) {
|
|
63
|
-
t3 = subtitle ? /*#__PURE__*/jsxs("span", {
|
|
64
|
-
className: styles.subtitleGroup,
|
|
65
|
-
children: [/*#__PURE__*/jsx(Icon, {
|
|
66
|
-
className: styles.subtitleChevron,
|
|
67
|
-
glyph: chevronRightIcon,
|
|
68
|
-
"aria-hidden": true
|
|
69
|
-
}), /*#__PURE__*/jsx("span", {
|
|
70
|
-
className: styles.subtitle,
|
|
71
|
-
children: subtitle
|
|
72
|
-
})]
|
|
73
|
-
}) : null;
|
|
74
|
-
$[6] = subtitle;
|
|
75
|
-
$[7] = t3;
|
|
76
|
-
} else {
|
|
77
|
-
t3 = $[7];
|
|
78
|
-
}
|
|
79
|
-
let t4;
|
|
80
|
-
if ($[8] !== t2 || $[9] !== t3) {
|
|
81
|
-
t4 = /*#__PURE__*/jsxs("span", {
|
|
82
|
-
className: styles.headerContent,
|
|
83
|
-
children: [t2, t3]
|
|
84
|
-
});
|
|
85
|
-
$[8] = t2;
|
|
86
|
-
$[9] = t3;
|
|
87
|
-
$[10] = t4;
|
|
88
|
-
} else {
|
|
89
|
-
t4 = $[10];
|
|
90
|
-
}
|
|
91
|
-
const t5 = collapsed ? chevronRightIcon : chevron12pxDown;
|
|
92
|
-
let t6;
|
|
93
|
-
if ($[11] !== t5) {
|
|
94
|
-
t6 = /*#__PURE__*/jsx("span", {
|
|
95
|
-
className: styles.toggle,
|
|
96
|
-
"aria-hidden": true,
|
|
97
|
-
children: /*#__PURE__*/jsx(Icon, {
|
|
98
|
-
className: styles.toggleIcon,
|
|
99
|
-
glyph: t5
|
|
100
|
-
})
|
|
101
|
-
});
|
|
102
|
-
$[11] = t5;
|
|
103
|
-
$[12] = t6;
|
|
104
|
-
} else {
|
|
105
|
-
t6 = $[12];
|
|
106
|
-
}
|
|
107
|
-
let t7;
|
|
108
|
-
if ($[13] !== t4 || $[14] !== t6) {
|
|
109
|
-
t7 = /*#__PURE__*/jsxs("span", {
|
|
110
|
-
className: styles.header,
|
|
111
|
-
children: [t4, t6]
|
|
112
|
-
});
|
|
113
|
-
$[13] = t4;
|
|
114
|
-
$[14] = t6;
|
|
115
|
-
$[15] = t7;
|
|
116
|
-
} else {
|
|
117
|
-
t7 = $[15];
|
|
118
|
-
}
|
|
119
|
-
return t7;
|
|
120
|
-
}
|
|
121
|
-
function CollapsibleGroupHeader(t0) {
|
|
122
|
-
const $ = c(16);
|
|
123
|
-
if ($[0] !== "248ebb691e89143680b26b525c22d5d37f19214f4f7f322680c1c724fd0796c3") {
|
|
124
|
-
for (let $i = 0; $i < 16; $i += 1) {
|
|
125
|
-
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
126
|
-
}
|
|
127
|
-
$[0] = "248ebb691e89143680b26b525c22d5d37f19214f4f7f322680c1c724fd0796c3";
|
|
128
|
-
}
|
|
129
|
-
let avatar;
|
|
130
|
-
let buttonProps;
|
|
131
|
-
let subtitle;
|
|
132
|
-
let titleContent;
|
|
133
|
-
if ($[1] !== t0) {
|
|
134
|
-
({
|
|
135
|
-
avatar,
|
|
136
|
-
titleContent,
|
|
137
|
-
subtitle,
|
|
138
|
-
...buttonProps
|
|
139
|
-
} = t0);
|
|
140
|
-
$[1] = t0;
|
|
141
|
-
$[2] = avatar;
|
|
142
|
-
$[3] = buttonProps;
|
|
143
|
-
$[4] = subtitle;
|
|
144
|
-
$[5] = titleContent;
|
|
145
|
-
} else {
|
|
146
|
-
avatar = $[2];
|
|
147
|
-
buttonProps = $[3];
|
|
148
|
-
subtitle = $[4];
|
|
149
|
-
titleContent = $[5];
|
|
150
|
-
}
|
|
151
|
-
const {
|
|
152
|
-
setCollapsed,
|
|
153
|
-
collapsed,
|
|
154
|
-
id
|
|
155
|
-
} = useContext(CollapseContext);
|
|
156
|
-
const t1 = `collapse-content-${id}`;
|
|
157
|
-
const t2 = !collapsed;
|
|
158
|
-
let t3;
|
|
159
|
-
if ($[6] !== avatar || $[7] !== subtitle || $[8] !== titleContent) {
|
|
160
|
-
t3 = /*#__PURE__*/jsx(CollapsibleGroupHeaderContent, {
|
|
161
|
-
avatar: avatar,
|
|
162
|
-
titleContent: titleContent,
|
|
163
|
-
subtitle: subtitle
|
|
164
|
-
});
|
|
165
|
-
$[6] = avatar;
|
|
166
|
-
$[7] = subtitle;
|
|
167
|
-
$[8] = titleContent;
|
|
168
|
-
$[9] = t3;
|
|
169
|
-
} else {
|
|
170
|
-
t3 = $[9];
|
|
171
|
-
}
|
|
172
|
-
let t4;
|
|
173
|
-
if ($[10] !== buttonProps || $[11] !== setCollapsed || $[12] !== t1 || $[13] !== t2 || $[14] !== t3) {
|
|
174
|
-
t4 = /*#__PURE__*/jsx("button", {
|
|
175
|
-
type: "button",
|
|
176
|
-
...buttonProps,
|
|
177
|
-
className: styles.headerButton,
|
|
178
|
-
onClick: setCollapsed,
|
|
179
|
-
"aria-controls": t1,
|
|
180
|
-
"aria-expanded": t2,
|
|
181
|
-
children: t3
|
|
182
|
-
});
|
|
183
|
-
$[10] = buttonProps;
|
|
184
|
-
$[11] = setCollapsed;
|
|
185
|
-
$[12] = t1;
|
|
186
|
-
$[13] = t2;
|
|
187
|
-
$[14] = t3;
|
|
188
|
-
$[15] = t4;
|
|
189
|
-
} else {
|
|
190
|
-
t4 = $[15];
|
|
191
|
-
}
|
|
192
|
-
return t4;
|
|
193
|
-
}
|
|
194
|
-
function CollapsibleGroupHeaderStatic(t0) {
|
|
195
|
-
const $ = c(5);
|
|
196
|
-
if ($[0] !== "248ebb691e89143680b26b525c22d5d37f19214f4f7f322680c1c724fd0796c3") {
|
|
197
|
-
for (let $i = 0; $i < 5; $i += 1) {
|
|
198
|
-
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
199
|
-
}
|
|
200
|
-
$[0] = "248ebb691e89143680b26b525c22d5d37f19214f4f7f322680c1c724fd0796c3";
|
|
201
|
-
}
|
|
202
|
-
const {
|
|
203
|
-
avatar,
|
|
204
|
-
titleContent,
|
|
205
|
-
subtitle
|
|
206
|
-
} = t0;
|
|
207
|
-
let t1;
|
|
208
|
-
if ($[1] !== avatar || $[2] !== subtitle || $[3] !== titleContent) {
|
|
209
|
-
t1 = /*#__PURE__*/jsx("span", {
|
|
210
|
-
className: styles.headerStatic,
|
|
211
|
-
children: /*#__PURE__*/jsx(CollapsibleGroupHeaderContent, {
|
|
212
|
-
avatar: avatar,
|
|
213
|
-
titleContent: titleContent,
|
|
214
|
-
subtitle: subtitle
|
|
215
|
-
})
|
|
216
|
-
});
|
|
217
|
-
$[1] = avatar;
|
|
218
|
-
$[2] = subtitle;
|
|
219
|
-
$[3] = titleContent;
|
|
220
|
-
$[4] = t1;
|
|
221
|
-
} else {
|
|
222
|
-
t1 = $[4];
|
|
223
|
-
}
|
|
224
|
-
return t1;
|
|
225
|
-
}
|
|
226
|
-
const CollapsibleGroup = /*#__PURE__*/forwardRef((t0, ref) => {
|
|
227
|
-
const $ = c(29);
|
|
228
|
-
if ($[0] !== "248ebb691e89143680b26b525c22d5d37f19214f4f7f322680c1c724fd0796c3") {
|
|
229
|
-
for (let $i = 0; $i < 29; $i += 1) {
|
|
21
|
+
const warnDeprecation = deprecate(() => {}, '`CollapsibleGroup` from `@jetbrains/ring-ui/components/expand/collapsible-group` is deprecated and will be removed in Ring UI 8.0. Import it from `@jetbrains/ring-ui/components/collapsible-group/collapsible-group` instead.');
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated The `expand` module has been renamed to `collapsible-group`. This re-export will be removed in
|
|
24
|
+
* Ring UI 8.0. Use `CollapsibleGroup` from `@jetbrains/ring-ui/components/collapsible-group/collapsible-group` instead.
|
|
25
|
+
*/
|
|
26
|
+
const DeprecatedCollapsibleGroup = /*#__PURE__*/forwardRef((props, ref) => {
|
|
27
|
+
const $ = c(4);
|
|
28
|
+
if ($[0] !== "dc9f603c6e591e91f020cc5faed8f169e693dd93fe948fc345146a82715c1a34") {
|
|
29
|
+
for (let $i = 0; $i < 4; $i += 1) {
|
|
230
30
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
231
31
|
}
|
|
232
|
-
$[0] = "
|
|
233
|
-
}
|
|
234
|
-
const {
|
|
235
|
-
avatar,
|
|
236
|
-
title,
|
|
237
|
-
subtitle,
|
|
238
|
-
children,
|
|
239
|
-
className,
|
|
240
|
-
defaultExpanded: t1,
|
|
241
|
-
expanded: t2,
|
|
242
|
-
onChange: t3,
|
|
243
|
-
disableAnimation: t4,
|
|
244
|
-
interactive: t5,
|
|
245
|
-
"data-test": dataTest
|
|
246
|
-
} = t0;
|
|
247
|
-
const defaultExpanded = t1 === undefined ? false : t1;
|
|
248
|
-
const expanded = t2 === undefined ? null : t2;
|
|
249
|
-
const onChange = t3 === undefined ? _temp : t3;
|
|
250
|
-
const disableAnimation = t4 === undefined ? false : t4;
|
|
251
|
-
const interactive = t5 === undefined ? true : t5;
|
|
252
|
-
const [innerExpanded, setInnerExpanded] = useState(defaultExpanded);
|
|
253
|
-
const [hovered, setHovered] = useState(false);
|
|
254
|
-
const [focused, setFocused] = useState(false);
|
|
255
|
-
const isExpanded = expanded !== null && expanded !== void 0 ? expanded : innerExpanded;
|
|
256
|
-
let t6;
|
|
257
|
-
if ($[1] !== expanded || $[2] !== onChange) {
|
|
258
|
-
t6 = collapsed => {
|
|
259
|
-
const nextExpanded = !collapsed;
|
|
260
|
-
if (expanded == null) {
|
|
261
|
-
setInnerExpanded(nextExpanded);
|
|
262
|
-
}
|
|
263
|
-
onChange(nextExpanded);
|
|
264
|
-
};
|
|
265
|
-
$[1] = expanded;
|
|
266
|
-
$[2] = onChange;
|
|
267
|
-
$[3] = t6;
|
|
268
|
-
} else {
|
|
269
|
-
t6 = $[3];
|
|
270
|
-
}
|
|
271
|
-
const handleChange = t6;
|
|
272
|
-
let t7;
|
|
273
|
-
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
274
|
-
t7 = event => {
|
|
275
|
-
const nextTarget = event.relatedTarget;
|
|
276
|
-
if (nextTarget instanceof Node && event.currentTarget.contains(nextTarget)) {
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
setFocused(false);
|
|
280
|
-
};
|
|
281
|
-
$[4] = t7;
|
|
282
|
-
} else {
|
|
283
|
-
t7 = $[4];
|
|
284
|
-
}
|
|
285
|
-
const onBlur = t7;
|
|
286
|
-
let t8;
|
|
287
|
-
if ($[5] !== className || $[6] !== focused || $[7] !== hovered || $[8] !== isExpanded) {
|
|
288
|
-
t8 = classNames(styles.expand, className, {
|
|
289
|
-
[styles.hovered]: hovered,
|
|
290
|
-
[styles.expanded]: isExpanded,
|
|
291
|
-
[styles.focused]: focused
|
|
292
|
-
});
|
|
293
|
-
$[5] = className;
|
|
294
|
-
$[6] = focused;
|
|
295
|
-
$[7] = hovered;
|
|
296
|
-
$[8] = isExpanded;
|
|
297
|
-
$[9] = t8;
|
|
298
|
-
} else {
|
|
299
|
-
t8 = $[9];
|
|
300
|
-
}
|
|
301
|
-
const classes = t8;
|
|
302
|
-
const t9 = !defaultExpanded;
|
|
303
|
-
const t10 = expanded == null ? null : !expanded;
|
|
304
|
-
let t11;
|
|
305
|
-
if ($[10] !== avatar || $[11] !== interactive || $[12] !== subtitle || $[13] !== title) {
|
|
306
|
-
t11 = interactive ? /*#__PURE__*/jsx(CollapsibleGroupHeader, {
|
|
307
|
-
avatar: avatar,
|
|
308
|
-
titleContent: title,
|
|
309
|
-
subtitle: subtitle,
|
|
310
|
-
onMouseEnter: () => setHovered(true),
|
|
311
|
-
onMouseLeave: () => setHovered(false),
|
|
312
|
-
onFocus: () => setFocused(true),
|
|
313
|
-
onBlur: onBlur
|
|
314
|
-
}) : /*#__PURE__*/jsx(CollapsibleGroupHeaderStatic, {
|
|
315
|
-
avatar: avatar,
|
|
316
|
-
titleContent: title,
|
|
317
|
-
subtitle: subtitle
|
|
318
|
-
});
|
|
319
|
-
$[10] = avatar;
|
|
320
|
-
$[11] = interactive;
|
|
321
|
-
$[12] = subtitle;
|
|
322
|
-
$[13] = title;
|
|
323
|
-
$[14] = t11;
|
|
324
|
-
} else {
|
|
325
|
-
t11 = $[14];
|
|
326
|
-
}
|
|
327
|
-
let t12;
|
|
328
|
-
if ($[15] !== children) {
|
|
329
|
-
t12 = /*#__PURE__*/jsx(CollapseContent, {
|
|
330
|
-
children: /*#__PURE__*/jsx("div", {
|
|
331
|
-
className: styles.body,
|
|
332
|
-
children: children
|
|
333
|
-
})
|
|
334
|
-
});
|
|
335
|
-
$[15] = children;
|
|
336
|
-
$[16] = t12;
|
|
337
|
-
} else {
|
|
338
|
-
t12 = $[16];
|
|
339
|
-
}
|
|
340
|
-
let t13;
|
|
341
|
-
if ($[17] !== disableAnimation || $[18] !== handleChange || $[19] !== t10 || $[20] !== t11 || $[21] !== t12 || $[22] !== t9) {
|
|
342
|
-
t13 = /*#__PURE__*/jsxs(Collapse, {
|
|
343
|
-
defaultCollapsed: t9,
|
|
344
|
-
collapsed: t10,
|
|
345
|
-
onChange: handleChange,
|
|
346
|
-
disableAnimation: disableAnimation,
|
|
347
|
-
className: styles.collapseRoot,
|
|
348
|
-
children: [t11, t12]
|
|
349
|
-
});
|
|
350
|
-
$[17] = disableAnimation;
|
|
351
|
-
$[18] = handleChange;
|
|
352
|
-
$[19] = t10;
|
|
353
|
-
$[20] = t11;
|
|
354
|
-
$[21] = t12;
|
|
355
|
-
$[22] = t9;
|
|
356
|
-
$[23] = t13;
|
|
357
|
-
} else {
|
|
358
|
-
t13 = $[23];
|
|
32
|
+
$[0] = "dc9f603c6e591e91f020cc5faed8f169e693dd93fe948fc345146a82715c1a34";
|
|
359
33
|
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
34
|
+
warnDeprecation();
|
|
35
|
+
let t0;
|
|
36
|
+
if ($[1] !== props || $[2] !== ref) {
|
|
37
|
+
t0 = /*#__PURE__*/jsx(CollapsibleGroup, {
|
|
363
38
|
ref: ref,
|
|
364
|
-
|
|
365
|
-
"data-test": dataTest,
|
|
366
|
-
children: t13
|
|
39
|
+
...props
|
|
367
40
|
});
|
|
368
|
-
$[
|
|
369
|
-
$[
|
|
370
|
-
$[
|
|
371
|
-
$[27] = t13;
|
|
372
|
-
$[28] = t14;
|
|
41
|
+
$[1] = props;
|
|
42
|
+
$[2] = ref;
|
|
43
|
+
$[3] = t0;
|
|
373
44
|
} else {
|
|
374
|
-
|
|
45
|
+
t0 = $[3];
|
|
375
46
|
}
|
|
376
|
-
return
|
|
47
|
+
return t0;
|
|
377
48
|
});
|
|
378
|
-
|
|
379
|
-
function _temp() {}
|
|
49
|
+
DeprecatedCollapsibleGroup.displayName = 'CollapsibleGroup';
|
|
380
50
|
|
|
381
|
-
export {
|
|
51
|
+
export { DeprecatedCollapsibleGroup as default };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { type Ref } from 'react';
|
|
2
|
-
export declare function createComposedRef<T>(): import("memoize-one").MemoizedFn<(...refs: (Ref<T> | undefined)[]) => (value: T | null) => void>;
|
|
2
|
+
export declare function createComposedRef<T>(): import("memoize-one").MemoizedFn<(...refs: (Ref<T> | undefined)[]) => (value: T | null) => () => void>;
|
|
3
|
+
export declare function useComposedRef<T>(...refs: (Ref<T> | undefined)[]): Ref<T>;
|
|
@@ -1,16 +1,52 @@
|
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
|
+
import 'react';
|
|
1
3
|
import memoizeOne from 'memoize-one';
|
|
2
4
|
|
|
3
5
|
function composeRefs(...refs) {
|
|
4
|
-
return value =>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
return value => {
|
|
7
|
+
const cleanups = [];
|
|
8
|
+
refs.forEach(ref => {
|
|
9
|
+
if (typeof ref === 'function') {
|
|
10
|
+
const cleanup = ref(value);
|
|
11
|
+
if (typeof cleanup === 'function') {
|
|
12
|
+
cleanups.push(cleanup);
|
|
13
|
+
}
|
|
14
|
+
} else if (ref) {
|
|
15
|
+
ref.current = value;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return () => cleanups.forEach(cleanup => cleanup());
|
|
19
|
+
};
|
|
11
20
|
}
|
|
12
21
|
function createComposedRef() {
|
|
13
22
|
return memoizeOne(composeRefs);
|
|
14
23
|
}
|
|
24
|
+
function useComposedRef(...t0) {
|
|
25
|
+
const $ = c(4);
|
|
26
|
+
if ($[0] !== "27d6e427dad1098fabcf040df3e7a3018e96f8cc69541f012bb950b976d64df8") {
|
|
27
|
+
for (let $i = 0; $i < 4; $i += 1) {
|
|
28
|
+
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
29
|
+
}
|
|
30
|
+
$[0] = "27d6e427dad1098fabcf040df3e7a3018e96f8cc69541f012bb950b976d64df8";
|
|
31
|
+
}
|
|
32
|
+
const refs = t0;
|
|
33
|
+
let t1;
|
|
34
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
35
|
+
t1 = createComposedRef();
|
|
36
|
+
$[1] = t1;
|
|
37
|
+
} else {
|
|
38
|
+
t1 = $[1];
|
|
39
|
+
}
|
|
40
|
+
const composer = t1;
|
|
41
|
+
let t2;
|
|
42
|
+
if ($[2] !== refs) {
|
|
43
|
+
t2 = composer(...refs);
|
|
44
|
+
$[2] = refs;
|
|
45
|
+
$[3] = t2;
|
|
46
|
+
} else {
|
|
47
|
+
t2 = $[3];
|
|
48
|
+
}
|
|
49
|
+
return t2;
|
|
50
|
+
}
|
|
15
51
|
|
|
16
|
-
export { createComposedRef };
|
|
52
|
+
export { createComposedRef, useComposedRef };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c } from 'react
|
|
2
|
-
import { memo, createContext, useState,
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
|
+
import { memo, createContext, useState, use, useEffect } from 'react';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
function createStatefulContext(initialValue, name = '') {
|
|
@@ -7,11 +7,11 @@ function createStatefulContext(initialValue, name = '') {
|
|
|
7
7
|
const UpdateContext = /*#__PURE__*/createContext(() => {});
|
|
8
8
|
function Provider(t0) {
|
|
9
9
|
const $ = c(6);
|
|
10
|
-
if ($[0] !== "
|
|
10
|
+
if ($[0] !== "c32a3d1ce094187d9e31020169cf0e12fc089d2172bbc5ca2c801f434f79cb38") {
|
|
11
11
|
for (let $i = 0; $i < 6; $i += 1) {
|
|
12
12
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
13
13
|
}
|
|
14
|
-
$[0] = "
|
|
14
|
+
$[0] = "c32a3d1ce094187d9e31020169cf0e12fc089d2172bbc5ca2c801f434f79cb38";
|
|
15
15
|
}
|
|
16
16
|
const {
|
|
17
17
|
children
|
|
@@ -19,7 +19,7 @@ function createStatefulContext(initialValue, name = '') {
|
|
|
19
19
|
const [value, update] = useState(initialValue);
|
|
20
20
|
let t1;
|
|
21
21
|
if ($[1] !== children) {
|
|
22
|
-
t1 = /*#__PURE__*/jsx(UpdateContext
|
|
22
|
+
t1 = /*#__PURE__*/jsx(UpdateContext, {
|
|
23
23
|
value: update,
|
|
24
24
|
children: children
|
|
25
25
|
});
|
|
@@ -30,7 +30,7 @@ function createStatefulContext(initialValue, name = '') {
|
|
|
30
30
|
}
|
|
31
31
|
let t2;
|
|
32
32
|
if ($[3] !== t1 || $[4] !== value) {
|
|
33
|
-
t2 = /*#__PURE__*/jsx(ValueContext
|
|
33
|
+
t2 = /*#__PURE__*/jsx(ValueContext, {
|
|
34
34
|
value: value,
|
|
35
35
|
children: t1
|
|
36
36
|
});
|
|
@@ -45,13 +45,13 @@ function createStatefulContext(initialValue, name = '') {
|
|
|
45
45
|
Provider.displayName = `${name}Provider`;
|
|
46
46
|
function useUpdate(value, skipUpdate) {
|
|
47
47
|
const $ = c(6);
|
|
48
|
-
if ($[0] !== "
|
|
48
|
+
if ($[0] !== "c32a3d1ce094187d9e31020169cf0e12fc089d2172bbc5ca2c801f434f79cb38") {
|
|
49
49
|
for (let $i = 0; $i < 6; $i += 1) {
|
|
50
50
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
51
51
|
}
|
|
52
|
-
$[0] = "
|
|
52
|
+
$[0] = "c32a3d1ce094187d9e31020169cf0e12fc089d2172bbc5ca2c801f434f79cb38";
|
|
53
53
|
}
|
|
54
|
-
const update =
|
|
54
|
+
const update = use(UpdateContext);
|
|
55
55
|
let t0;
|
|
56
56
|
let t1;
|
|
57
57
|
if ($[1] !== skipUpdate || $[2] !== update || $[3] !== value) {
|
|
@@ -74,11 +74,11 @@ function createStatefulContext(initialValue, name = '') {
|
|
|
74
74
|
}
|
|
75
75
|
function Updater(t0) {
|
|
76
76
|
const $ = c(1);
|
|
77
|
-
if ($[0] !== "
|
|
77
|
+
if ($[0] !== "c32a3d1ce094187d9e31020169cf0e12fc089d2172bbc5ca2c801f434f79cb38") {
|
|
78
78
|
for (let $i = 0; $i < 1; $i += 1) {
|
|
79
79
|
$[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
80
80
|
}
|
|
81
|
-
$[0] = "
|
|
81
|
+
$[0] = "c32a3d1ce094187d9e31020169cf0e12fc089d2172bbc5ca2c801f434f79cb38";
|
|
82
82
|
}
|
|
83
83
|
const {
|
|
84
84
|
value,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Focuses an element, temporarily adding `tabindex="0"` if necessary.
|
|
3
|
+
*
|
|
4
|
+
* If the element does not already have a `tabindex` attribute, one is
|
|
5
|
+
* added before focusing and automatically removed when the element loses
|
|
6
|
+
* focus.
|
|
7
|
+
*
|
|
8
|
+
* This is useful when implementing roving tabindex patterns on elements
|
|
9
|
+
* that are not normally focusable.
|
|
10
|
+
*/
|
|
11
|
+
export declare function focusWithTemporaryTabIndex(element: HTMLElement): void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Focuses an element, temporarily adding `tabindex="0"` if necessary.
|
|
3
|
+
*
|
|
4
|
+
* If the element does not already have a `tabindex` attribute, one is
|
|
5
|
+
* added before focusing and automatically removed when the element loses
|
|
6
|
+
* focus.
|
|
7
|
+
*
|
|
8
|
+
* This is useful when implementing roving tabindex patterns on elements
|
|
9
|
+
* that are not normally focusable.
|
|
10
|
+
*/
|
|
11
|
+
function focusWithTemporaryTabIndex(element) {
|
|
12
|
+
if (!element.hasAttribute('tabindex')) {
|
|
13
|
+
element.tabIndex = 0;
|
|
14
|
+
function onBlur() {
|
|
15
|
+
element.removeAttribute('tabindex');
|
|
16
|
+
element.removeEventListener('blur', onBlur);
|
|
17
|
+
}
|
|
18
|
+
element.addEventListener('blur', onBlur);
|
|
19
|
+
}
|
|
20
|
+
element.focus();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { focusWithTemporaryTabIndex };
|
|
@@ -1,26 +1,46 @@
|
|
|
1
1
|
import { type RefObject } from 'react';
|
|
2
2
|
/**
|
|
3
|
+
* Provides access to a shared `IntersectionObserver` instance
|
|
4
|
+
* via the {@link IntersectionObserverContext} context.
|
|
5
|
+
*
|
|
6
|
+
* @see IntersectionObserverContext
|
|
7
|
+
*/
|
|
8
|
+
export interface IntersectionObserverHandle {
|
|
9
|
+
/**
|
|
10
|
+
* Starts observing an element.
|
|
11
|
+
*
|
|
12
|
+
* Returns a cleanup function that stops observing it.
|
|
13
|
+
*/
|
|
14
|
+
observe(element: Element, isIntersecting: (isIntersecting: boolean) => void): () => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Multiple components can share a single `IntersectionObserver` instance through this context.
|
|
18
|
+
*
|
|
3
19
|
* Usage:
|
|
4
20
|
*
|
|
5
21
|
* ```tsx
|
|
6
|
-
* <IntersectionObserverContext
|
|
22
|
+
* <IntersectionObserverContext value={useIntersectionObserverHandle()}>
|
|
7
23
|
* <YourComponent />
|
|
8
|
-
* </IntersectionObserverContext
|
|
24
|
+
* </IntersectionObserverContext>
|
|
9
25
|
*
|
|
10
26
|
* function YourComponent() {
|
|
11
27
|
* // Contains the current isIntersecting value
|
|
12
28
|
* const isIntersecting = useIsIntersecting(elementRef);
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
29
|
+
*
|
|
30
|
+
* // Or, to manually work with the IntersectionObserverHandle:
|
|
31
|
+
* const handle = use(IntersectionObserverContext);
|
|
32
|
+
* useEffect(() => {
|
|
33
|
+
* return handle.observe(elementRef.current, isIntersecting => { ... })
|
|
16
34
|
* })
|
|
17
35
|
* }
|
|
18
36
|
* ```
|
|
19
37
|
*/
|
|
20
|
-
export declare const IntersectionObserverContext: import("react").Context<IntersectionObserverHandle
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
38
|
+
export declare const IntersectionObserverContext: import("react").Context<IntersectionObserverHandle>;
|
|
39
|
+
/**
|
|
40
|
+
* Creates an IntersectionObserverHandle suitable for {@link IntersectionObserverContext}.
|
|
41
|
+
*/
|
|
42
|
+
export declare function useIntersectionObserverHandle(rootRef?: RefObject<HTMLElement | null>, rootMargin?: number, scrollMargin?: number): IntersectionObserverHandle;
|
|
43
|
+
/**
|
|
44
|
+
* Returns whether the referenced element is currently intersecting.
|
|
45
|
+
*/
|
|
25
46
|
export declare function useIsIntersecting(elementRef: RefObject<Element | null>): boolean;
|
|
26
|
-
export declare function useIsIntersectingListener(elementRef: RefObject<Element | null>, onChange: (isIntersecting: boolean) => void): void;
|