@primer/react 0.0.0-20260707214244 → 0.0.0-20260710131543
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/CHANGELOG.md +11 -3
- package/dist/ActionBar/ActionBar.js +130 -424
- package/dist/Autocomplete/AutocompleteMenu.js +44 -36
- package/dist/FilteredActionList/FilteredActionList.js +66 -155
- package/dist/FilteredActionList/useAnnouncements.js +66 -138
- package/dist/LabelGroup/LabelGroup.js +86 -129
- package/dist/Overlay/Overlay.js +45 -169
- package/dist/SegmentedControl/SegmentedControl-66516913.css +2 -0
- package/dist/SegmentedControl/SegmentedControl-66516913.css.map +1 -0
- package/dist/SegmentedControl/SegmentedControl.module.css.js +1 -1
- package/dist/TextInput/TextInput.js +7 -7
- package/dist/ToggleSwitch/ToggleSwitch.js +167 -186
- package/dist/TreeView/TreeView.js +309 -814
- package/dist/UnderlineNav/UnderlineNav-a06bbc74.css +2 -0
- package/dist/UnderlineNav/UnderlineNav-a06bbc74.css.map +1 -0
- package/dist/UnderlineNav/UnderlineNav.d.ts +5 -0
- package/dist/UnderlineNav/UnderlineNav.js +136 -129
- package/dist/UnderlineNav/UnderlineNav.module.css.js +2 -1
- package/dist/experimental/UnderlinePanels/UnderlinePanels.js +38 -95
- package/dist/hooks/useControllableState.js +3 -3
- package/dist/hooks/useMedia.js +44 -43
- package/dist/internal/components/UnderlineTabbedInterface-25587345.css +2 -0
- package/dist/internal/components/UnderlineTabbedInterface-25587345.css.map +1 -0
- package/dist/internal/components/UnderlineTabbedInterface.module.css.js +1 -1
- package/dist/internal/components/ValidationAnimationContainer.js +40 -34
- package/package.json +3 -1
- package/dist/SegmentedControl/SegmentedControl-a004561f.css +0 -2
- package/dist/SegmentedControl/SegmentedControl-a004561f.css.map +0 -1
- package/dist/UnderlineNav/UnderlineNav-47547980.css +0 -2
- package/dist/UnderlineNav/UnderlineNav-47547980.css.map +0 -1
- package/dist/internal/components/UnderlineTabbedInterface-1745a3d6.css +0 -2
- package/dist/internal/components/UnderlineTabbedInterface-1745a3d6.css.map +0 -1
|
@@ -43,7 +43,7 @@ const debounceAnnouncement = debounce((announcement) => {
|
|
|
43
43
|
announce(announcement);
|
|
44
44
|
}, 250);
|
|
45
45
|
function AutocompleteMenu(props) {
|
|
46
|
-
const $ = c(
|
|
46
|
+
const $ = c(78);
|
|
47
47
|
const autocompleteContext = useContext(AutocompleteContext);
|
|
48
48
|
const deferredInputContext = useContext(AutocompleteDeferredInputContext);
|
|
49
49
|
if (autocompleteContext === null || deferredInputContext === null) throw new Error("AutocompleteContext returned null values");
|
|
@@ -253,46 +253,54 @@ function AutocompleteMenu(props) {
|
|
|
253
253
|
t16 = $[54];
|
|
254
254
|
}
|
|
255
255
|
useEffect(t15, t16);
|
|
256
|
-
if (showMenu === false) {
|
|
257
|
-
const itemIdSortResult = [...sortedItemIds].sort(sortOnCloseFn ? sortOnCloseFn : getDefaultSortFn((itemId_0) => isItemSelected(itemId_0, selectedItemIds)));
|
|
258
|
-
if (!(itemIdSortResult.length === sortedItemIds.length && itemIdSortResult.every((element_0, index) => element_0 === sortedItemIds[index]))) setSortedItemIds(itemIdSortResult);
|
|
259
|
-
}
|
|
260
256
|
let t17;
|
|
261
257
|
let t18;
|
|
262
|
-
if ($[55] !== onOpenChange || $[56] !== showMenu) {
|
|
258
|
+
if ($[55] !== onOpenChange || $[56] !== selectedItemIds || $[57] !== showMenu || $[58] !== sortOnCloseFn || $[59] !== sortedItemIds) {
|
|
263
259
|
t17 = () => {
|
|
260
|
+
const itemIdSortResult = [...sortedItemIds].sort(sortOnCloseFn ? sortOnCloseFn : getDefaultSortFn((itemId_0) => isItemSelected(itemId_0, selectedItemIds)));
|
|
261
|
+
const sortResultMatchesState = itemIdSortResult.length === sortedItemIds.length && itemIdSortResult.every((element_0, index) => element_0 === sortedItemIds[index]);
|
|
262
|
+
if (showMenu === false && !sortResultMatchesState) setSortedItemIds(itemIdSortResult);
|
|
264
263
|
onOpenChange && onOpenChange(Boolean(showMenu));
|
|
265
264
|
};
|
|
266
|
-
t18 = [
|
|
265
|
+
t18 = [
|
|
266
|
+
showMenu,
|
|
267
|
+
onOpenChange,
|
|
268
|
+
selectedItemIds,
|
|
269
|
+
sortOnCloseFn,
|
|
270
|
+
sortedItemIds
|
|
271
|
+
];
|
|
267
272
|
$[55] = onOpenChange;
|
|
268
|
-
$[56] =
|
|
269
|
-
$[57] =
|
|
270
|
-
$[58] =
|
|
273
|
+
$[56] = selectedItemIds;
|
|
274
|
+
$[57] = showMenu;
|
|
275
|
+
$[58] = sortOnCloseFn;
|
|
276
|
+
$[59] = sortedItemIds;
|
|
277
|
+
$[60] = t17;
|
|
278
|
+
$[61] = t18;
|
|
271
279
|
} else {
|
|
272
|
-
t17 = $[
|
|
273
|
-
t18 = $[
|
|
280
|
+
t17 = $[60];
|
|
281
|
+
t18 = $[61];
|
|
274
282
|
}
|
|
275
283
|
useEffect(t17, t18);
|
|
276
284
|
let t19;
|
|
277
|
-
if ($[
|
|
285
|
+
if ($[62] !== selectedItemIds.length || $[63] !== setSelectedItemLength) {
|
|
278
286
|
t19 = () => {
|
|
279
287
|
if (selectedItemIds.length) setSelectedItemLength(selectedItemIds.length);
|
|
280
288
|
};
|
|
281
|
-
$[
|
|
282
|
-
$[
|
|
283
|
-
$[
|
|
284
|
-
} else t19 = $[
|
|
289
|
+
$[62] = selectedItemIds.length;
|
|
290
|
+
$[63] = setSelectedItemLength;
|
|
291
|
+
$[64] = t19;
|
|
292
|
+
} else t19 = $[64];
|
|
285
293
|
let t20;
|
|
286
|
-
if ($[
|
|
294
|
+
if ($[65] !== selectedItemIds || $[66] !== setSelectedItemLength) {
|
|
287
295
|
t20 = [selectedItemIds, setSelectedItemLength];
|
|
288
|
-
$[
|
|
289
|
-
$[
|
|
290
|
-
$[
|
|
291
|
-
} else t20 = $[
|
|
296
|
+
$[65] = selectedItemIds;
|
|
297
|
+
$[66] = setSelectedItemLength;
|
|
298
|
+
$[67] = t20;
|
|
299
|
+
} else t20 = $[67];
|
|
292
300
|
useEffect(t19, t20);
|
|
293
301
|
if (selectionVariant === "single" && selectedItemIds.length > 1) throw new Error("Autocomplete: selectionVariant \"single\" cannot be used with multiple selected items");
|
|
294
302
|
let t21;
|
|
295
|
-
if ($[
|
|
303
|
+
if ($[68] !== allItemsToRender || $[69] !== ariaLabelledBy || $[70] !== emptyStateText || $[71] !== id || $[72] !== loading || $[73] !== selectionVariant) {
|
|
296
304
|
t21 = loading ? /*#__PURE__*/ jsx("div", {
|
|
297
305
|
className: AutocompleteMenu_module_css_default.SpinnerWrapper,
|
|
298
306
|
children: /*#__PURE__*/ jsx(Spinner, {})
|
|
@@ -310,24 +318,24 @@ function AutocompleteMenu(props) {
|
|
|
310
318
|
children: emptyStateText
|
|
311
319
|
}) : null
|
|
312
320
|
});
|
|
313
|
-
$[
|
|
314
|
-
$[
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
$[
|
|
318
|
-
$[
|
|
319
|
-
$[
|
|
320
|
-
} else t21 = $[
|
|
321
|
+
$[68] = allItemsToRender;
|
|
322
|
+
$[69] = ariaLabelledBy;
|
|
323
|
+
$[70] = emptyStateText;
|
|
324
|
+
$[71] = id;
|
|
325
|
+
$[72] = loading;
|
|
326
|
+
$[73] = selectionVariant;
|
|
327
|
+
$[74] = t21;
|
|
328
|
+
} else t21 = $[74];
|
|
321
329
|
let t22;
|
|
322
|
-
if ($[
|
|
330
|
+
if ($[75] !== showMenu || $[76] !== t21) {
|
|
323
331
|
t22 = /*#__PURE__*/ jsx(VisuallyHidden, {
|
|
324
332
|
isVisible: showMenu,
|
|
325
333
|
children: t21
|
|
326
334
|
});
|
|
327
|
-
$[
|
|
328
|
-
$[
|
|
329
|
-
$[
|
|
330
|
-
} else t22 = $[
|
|
335
|
+
$[75] = showMenu;
|
|
336
|
+
$[76] = t21;
|
|
337
|
+
$[77] = t22;
|
|
338
|
+
} else t22 = $[77];
|
|
331
339
|
return t22;
|
|
332
340
|
}
|
|
333
341
|
function _temp5(item_2) {
|
|
@@ -12,7 +12,6 @@ import { FilteredActionListBodyLoader } from "./FilteredActionListLoaders.js";
|
|
|
12
12
|
import FilteredActionList_module_css_default from "./FilteredActionList.module.css.js";
|
|
13
13
|
import { useAnnouncements } from "./useAnnouncements.js";
|
|
14
14
|
import { FilteredActionListInput } from "./FilteredActionListInput.js";
|
|
15
|
-
import { c } from "react-compiler-runtime";
|
|
16
15
|
import { clsx } from "clsx";
|
|
17
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
17
|
import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -44,11 +43,11 @@ function FilteredActionList({ loading = false, placeholderText, filterValue: ext
|
|
|
44
43
|
const inputDescriptionTextId = useId$1();
|
|
45
44
|
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
46
45
|
const selectAllChecked = items.length > 0 && items.every((item) => item.selected);
|
|
47
|
-
const selectAllIndeterminate = !selectAllChecked && items.some((
|
|
46
|
+
const selectAllIndeterminate = !selectAllChecked && items.some((item) => item.selected);
|
|
48
47
|
const selectAllLabelText = selectAllChecked ? "Deselect all" : "Select all";
|
|
49
48
|
const getItemListForEachGroup = useCallback((groupId) => {
|
|
50
49
|
const itemsInGroup = [];
|
|
51
|
-
for (const
|
|
50
|
+
for (const item of items) if (item.groupId === groupId) itemsInGroup.push(item);
|
|
52
51
|
return itemsInGroup;
|
|
53
52
|
}, [items]);
|
|
54
53
|
const onInputKeyDown = useCallback((event) => {
|
|
@@ -65,7 +64,7 @@ function FilteredActionList({ loading = false, placeholderText, filterValue: ext
|
|
|
65
64
|
for (let i = 0; i < groupMetadata.length; i++) if (getItemListForEachGroup(groupMetadata[i].groupId).length > 0) break;
|
|
66
65
|
else firstGroupIndex++;
|
|
67
66
|
const firstGroup = groupMetadata[firstGroupIndex].groupId;
|
|
68
|
-
firstItem = items.filter((
|
|
67
|
+
firstItem = items.filter((item) => item.groupId === firstGroup)[0];
|
|
69
68
|
} else firstItem = items[0];
|
|
70
69
|
if (firstItem.onAction) {
|
|
71
70
|
firstItem.onAction(firstItem, event);
|
|
@@ -77,11 +76,11 @@ function FilteredActionList({ loading = false, placeholderText, filterValue: ext
|
|
|
77
76
|
groupMetadata,
|
|
78
77
|
getItemListForEachGroup
|
|
79
78
|
]);
|
|
80
|
-
const onInputKeyPress = useCallback((
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const activeDescendantEvent = new KeyboardEvent(
|
|
79
|
+
const onInputKeyPress = useCallback((event) => {
|
|
80
|
+
if (event.key === "Enter" && activeDescendantRef.current) {
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
event.nativeEvent.stopImmediatePropagation();
|
|
83
|
+
const activeDescendantEvent = new KeyboardEvent(event.type, event.nativeEvent);
|
|
85
84
|
activeDescendantRef.current.dispatchEvent(activeDescendantEvent);
|
|
86
85
|
}
|
|
87
86
|
}, [activeDescendantRef]);
|
|
@@ -100,10 +99,10 @@ function FilteredActionList({ loading = false, placeholderText, filterValue: ext
|
|
|
100
99
|
overscan: 10,
|
|
101
100
|
enabled: isVirtualized,
|
|
102
101
|
getItemKey: (index) => {
|
|
103
|
-
var _ref,
|
|
104
|
-
const
|
|
105
|
-
if (!
|
|
106
|
-
return (_ref = (
|
|
102
|
+
var _ref, _item$key, _item$id;
|
|
103
|
+
const item = items[index];
|
|
104
|
+
if (!item) return index.toString();
|
|
105
|
+
return (_ref = (_item$key = item.key) !== null && _item$key !== void 0 ? _item$key : (_item$id = item.id) === null || _item$id === void 0 ? void 0 : _item$id.toString()) !== null && _ref !== void 0 ? _ref : index.toString();
|
|
107
106
|
},
|
|
108
107
|
measureElement: (el) => el.scrollHeight
|
|
109
108
|
});
|
|
@@ -133,9 +132,9 @@ function FilteredActionList({ loading = false, placeholderText, filterValue: ext
|
|
|
133
132
|
onActiveDescendantChanged: (current, previous, directlyActivated) => {
|
|
134
133
|
activeDescendantRef.current = current;
|
|
135
134
|
if (isVirtualized && current) {
|
|
136
|
-
const
|
|
135
|
+
const index = current.getAttribute("data-index");
|
|
137
136
|
const range = virtualizer.range;
|
|
138
|
-
if (
|
|
137
|
+
if (index !== null && range && (Number(index) < range.startIndex || Number(index) >= range.endIndex)) virtualizer.scrollToIndex(Number(index), { align: "auto" });
|
|
139
138
|
}
|
|
140
139
|
if (current && scrollContainerRef.current && (directlyActivated || focusPrependedElements)) scrollIntoView(current, scrollContainerRef.current, {
|
|
141
140
|
...menuScrollMargins,
|
|
@@ -170,8 +169,8 @@ function FilteredActionList({ loading = false, placeholderText, filterValue: ext
|
|
|
170
169
|
if (!inputAndListContainerElement) return;
|
|
171
170
|
const list = listRef.current;
|
|
172
171
|
if (!list) return;
|
|
173
|
-
const handleFocusIn = (
|
|
174
|
-
if (
|
|
172
|
+
const handleFocusIn = (event) => {
|
|
173
|
+
if (event.target === inputRef.current || list.contains(event.target)) setIsInputFocused(inputRef.current && inputRef.current === document.activeElement ? true : false);
|
|
175
174
|
};
|
|
176
175
|
inputAndListContainerElement.addEventListener("focusin", handleFocusIn);
|
|
177
176
|
return () => {
|
|
@@ -193,8 +192,8 @@ function FilteredActionList({ loading = false, placeholderText, filterValue: ext
|
|
|
193
192
|
]);
|
|
194
193
|
useAnnouncements(items, usingRovingTabindex ? listRef : { current: listContainerElement }, inputRef, announcementsEnabled, loading, messageText, _PrivateFocusManagement);
|
|
195
194
|
useScrollFlash(scrollContainerRef);
|
|
196
|
-
const handleSelectAllChange = useCallback((
|
|
197
|
-
if (onSelectAllChange) onSelectAllChange(
|
|
195
|
+
const handleSelectAllChange = useCallback((e) => {
|
|
196
|
+
if (onSelectAllChange) onSelectAllChange(e.target.checked);
|
|
198
197
|
}, [onSelectAllChange]);
|
|
199
198
|
function getBodyContent() {
|
|
200
199
|
if (loading && scrollContainerRef.current && loadingType.appearsInBody) return /*#__PURE__*/ jsx(FilteredActionListBodyLoader, {
|
|
@@ -202,58 +201,58 @@ function FilteredActionList({ loading = false, placeholderText, filterValue: ext
|
|
|
202
201
|
height: scrollContainerRef.current.clientHeight
|
|
203
202
|
});
|
|
204
203
|
if (message) return message;
|
|
205
|
-
let
|
|
204
|
+
let firstGroupIndex = 0;
|
|
206
205
|
const renderListItems = () => {
|
|
207
|
-
if (groupMetadata !== null && groupMetadata !== void 0 && groupMetadata.length) return groupMetadata.map((group,
|
|
206
|
+
if (groupMetadata !== null && groupMetadata !== void 0 && groupMetadata.length) return groupMetadata.map((group, index) => {
|
|
208
207
|
var _group$header, _group$header2;
|
|
209
|
-
if (
|
|
208
|
+
if (index === firstGroupIndex && getItemListForEachGroup(group.groupId).length === 0) firstGroupIndex++;
|
|
210
209
|
return /*#__PURE__*/ jsxs(ActionList.Group, { children: [/*#__PURE__*/ jsx(ActionList.GroupHeading, {
|
|
211
210
|
variant: (_group$header = group.header) !== null && _group$header !== void 0 && _group$header.variant ? group.header.variant : void 0,
|
|
212
211
|
children: (_group$header2 = group.header) !== null && _group$header2 !== void 0 && _group$header2.title ? group.header.title : `Group ${group.groupId}`
|
|
213
|
-
}), getItemListForEachGroup(group.groupId).map(({ key: itemKey, ...
|
|
214
|
-
var _ref2,
|
|
215
|
-
const key = (_ref2 = itemKey !== null && itemKey !== void 0 ? itemKey : (
|
|
212
|
+
}), getItemListForEachGroup(group.groupId).map(({ key: itemKey, ...item }, itemIndex) => {
|
|
213
|
+
var _ref2, _item$id2;
|
|
214
|
+
const key = (_ref2 = itemKey !== null && itemKey !== void 0 ? itemKey : (_item$id2 = item.id) === null || _item$id2 === void 0 ? void 0 : _item$id2.toString()) !== null && _ref2 !== void 0 ? _ref2 : itemIndex.toString();
|
|
216
215
|
return /*#__PURE__*/ jsx(MappedActionListItem, {
|
|
217
|
-
className: clsx(FilteredActionList_module_css_default.ActionListItem, "className" in
|
|
216
|
+
className: clsx(FilteredActionList_module_css_default.ActionListItem, "className" in item ? item.className : void 0),
|
|
218
217
|
"data-input-focused": isInputFocused ? "" : void 0,
|
|
219
|
-
"data-first-child":
|
|
220
|
-
...
|
|
218
|
+
"data-first-child": index === firstGroupIndex && itemIndex === 0 ? "" : void 0,
|
|
219
|
+
...item,
|
|
221
220
|
renderItem: listProps.renderItem
|
|
222
221
|
}, key);
|
|
223
|
-
})] },
|
|
222
|
+
})] }, index);
|
|
224
223
|
});
|
|
225
|
-
if (isVirtualized && virtualizedItemEntries) return virtualizedItemEntries.map(({ virtualItem
|
|
226
|
-
var _ref3,
|
|
227
|
-
const
|
|
224
|
+
if (isVirtualized && virtualizedItemEntries) return virtualizedItemEntries.map(({ virtualItem, item: { key: itemKey, ...item }, index }) => {
|
|
225
|
+
var _ref3, _item$id3;
|
|
226
|
+
const key = (_ref3 = itemKey !== null && itemKey !== void 0 ? itemKey : (_item$id3 = item.id) === null || _item$id3 === void 0 ? void 0 : _item$id3.toString()) !== null && _ref3 !== void 0 ? _ref3 : index.toString();
|
|
228
227
|
return /*#__PURE__*/ jsx(MappedActionListItem, {
|
|
229
|
-
className: clsx(FilteredActionList_module_css_default.ActionListItem, "className" in
|
|
228
|
+
className: clsx(FilteredActionList_module_css_default.ActionListItem, "className" in item ? item.className : void 0),
|
|
230
229
|
"data-input-focused": isInputFocused ? "" : void 0,
|
|
231
|
-
"data-first-child":
|
|
232
|
-
"data-index":
|
|
233
|
-
ref: (
|
|
234
|
-
if (
|
|
230
|
+
"data-first-child": index === 0 ? "" : void 0,
|
|
231
|
+
"data-index": virtualItem.index,
|
|
232
|
+
ref: (node) => {
|
|
233
|
+
if (node) virtualizer.measureElement(node);
|
|
235
234
|
},
|
|
236
235
|
style: {
|
|
237
236
|
position: "absolute",
|
|
238
237
|
top: 0,
|
|
239
238
|
left: 0,
|
|
240
239
|
right: 0,
|
|
241
|
-
transform: `translateY(${
|
|
240
|
+
transform: `translateY(${virtualItem.start}px)`
|
|
242
241
|
},
|
|
243
|
-
...
|
|
242
|
+
...item,
|
|
244
243
|
renderItem: listProps.renderItem
|
|
245
|
-
},
|
|
244
|
+
}, key);
|
|
246
245
|
});
|
|
247
|
-
return items.map(({ key:
|
|
248
|
-
var _ref4,
|
|
249
|
-
const
|
|
246
|
+
return items.map(({ key: itemKey, ...item }, index) => {
|
|
247
|
+
var _ref4, _item$id4;
|
|
248
|
+
const key = (_ref4 = itemKey !== null && itemKey !== void 0 ? itemKey : (_item$id4 = item.id) === null || _item$id4 === void 0 ? void 0 : _item$id4.toString()) !== null && _ref4 !== void 0 ? _ref4 : index.toString();
|
|
250
249
|
return /*#__PURE__*/ jsx(MappedActionListItem, {
|
|
251
|
-
className: clsx(FilteredActionList_module_css_default.ActionListItem, "className" in
|
|
250
|
+
className: clsx(FilteredActionList_module_css_default.ActionListItem, "className" in item ? item.className : void 0),
|
|
252
251
|
"data-input-focused": isInputFocused ? "" : void 0,
|
|
253
|
-
"data-first-child":
|
|
254
|
-
...
|
|
252
|
+
"data-first-child": index === 0 ? "" : void 0,
|
|
253
|
+
...item,
|
|
255
254
|
renderItem: listProps.renderItem
|
|
256
|
-
},
|
|
255
|
+
}, key);
|
|
257
256
|
});
|
|
258
257
|
};
|
|
259
258
|
const actionListContent = /*#__PURE__*/ jsx(ActionList, {
|
|
@@ -334,115 +333,27 @@ function FilteredActionList({ loading = false, placeholderText, filterValue: ext
|
|
|
334
333
|
}
|
|
335
334
|
FilteredActionList.displayName = "FilteredActionList";
|
|
336
335
|
const MappedActionListItem = /*#__PURE__*/ forwardRef((item, ref) => {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
$[0] = item;
|
|
343
|
-
$[1] = t0;
|
|
344
|
-
} else t0 = $[1];
|
|
345
|
-
return t0;
|
|
346
|
-
}
|
|
347
|
-
let LeadingVisual;
|
|
348
|
-
let TrailingIcon;
|
|
349
|
-
let TrailingVisual;
|
|
350
|
-
let children;
|
|
351
|
-
let description;
|
|
352
|
-
let descriptionVariant;
|
|
353
|
-
let id;
|
|
354
|
-
let onAction;
|
|
355
|
-
let rest;
|
|
356
|
-
let text;
|
|
357
|
-
let trailingText;
|
|
358
|
-
if ($[2] !== item) {
|
|
359
|
-
({id, description, descriptionVariant, text, trailingVisual: TrailingVisual, leadingVisual: LeadingVisual, trailingText, trailingIcon: TrailingIcon, onAction, children, ...rest} = item);
|
|
360
|
-
$[2] = item;
|
|
361
|
-
$[3] = LeadingVisual;
|
|
362
|
-
$[4] = TrailingIcon;
|
|
363
|
-
$[5] = TrailingVisual;
|
|
364
|
-
$[6] = children;
|
|
365
|
-
$[7] = description;
|
|
366
|
-
$[8] = descriptionVariant;
|
|
367
|
-
$[9] = id;
|
|
368
|
-
$[10] = onAction;
|
|
369
|
-
$[11] = rest;
|
|
370
|
-
$[12] = text;
|
|
371
|
-
$[13] = trailingText;
|
|
372
|
-
} else {
|
|
373
|
-
LeadingVisual = $[3];
|
|
374
|
-
TrailingIcon = $[4];
|
|
375
|
-
TrailingVisual = $[5];
|
|
376
|
-
children = $[6];
|
|
377
|
-
description = $[7];
|
|
378
|
-
descriptionVariant = $[8];
|
|
379
|
-
id = $[9];
|
|
380
|
-
onAction = $[10];
|
|
381
|
-
rest = $[11];
|
|
382
|
-
text = $[12];
|
|
383
|
-
trailingText = $[13];
|
|
384
|
-
}
|
|
385
|
-
let t0;
|
|
386
|
-
if ($[14] !== item || $[15] !== onAction) {
|
|
387
|
-
t0 = (e) => {
|
|
336
|
+
if (typeof item.renderItem === "function") return item.renderItem(item);
|
|
337
|
+
const { id, description, descriptionVariant, text, trailingVisual: TrailingVisual, leadingVisual: LeadingVisual, trailingText, trailingIcon: TrailingIcon, onAction, children, ...rest } = item;
|
|
338
|
+
return /*#__PURE__*/ jsxs(ActionList.Item, {
|
|
339
|
+
role: "option",
|
|
340
|
+
onSelect: (e) => {
|
|
388
341
|
if (typeof onAction === "function") onAction(item, e);
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
children: description
|
|
405
|
-
}) : null;
|
|
406
|
-
$[19] = description;
|
|
407
|
-
$[20] = descriptionVariant;
|
|
408
|
-
$[21] = t2;
|
|
409
|
-
} else t2 = $[21];
|
|
410
|
-
let t3;
|
|
411
|
-
if ($[22] !== TrailingIcon || $[23] !== TrailingVisual || $[24] !== trailingText) {
|
|
412
|
-
t3 = TrailingVisual ? /*#__PURE__*/ jsx(ActionList.TrailingVisual, { children: typeof TrailingVisual !== "string" && isValidElementType(TrailingVisual) ? /*#__PURE__*/ jsx(TrailingVisual, {}) : TrailingVisual }) : TrailingIcon || trailingText ? /*#__PURE__*/ jsxs(ActionList.TrailingVisual, { children: [trailingText, TrailingIcon && /*#__PURE__*/ jsx(TrailingIcon, {})] }) : null;
|
|
413
|
-
$[22] = TrailingIcon;
|
|
414
|
-
$[23] = TrailingVisual;
|
|
415
|
-
$[24] = trailingText;
|
|
416
|
-
$[25] = t3;
|
|
417
|
-
} else t3 = $[25];
|
|
418
|
-
let t4;
|
|
419
|
-
if ($[26] !== children || $[27] !== id || $[28] !== ref || $[29] !== rest || $[30] !== t0 || $[31] !== t1 || $[32] !== t2 || $[33] !== t3 || $[34] !== text) {
|
|
420
|
-
t4 = /*#__PURE__*/ jsxs(ActionList.Item, {
|
|
421
|
-
role: "option",
|
|
422
|
-
onSelect: t0,
|
|
423
|
-
"data-id": id,
|
|
424
|
-
ref,
|
|
425
|
-
...rest,
|
|
426
|
-
children: [
|
|
427
|
-
t1,
|
|
428
|
-
children,
|
|
429
|
-
text,
|
|
430
|
-
t2,
|
|
431
|
-
t3
|
|
432
|
-
]
|
|
433
|
-
});
|
|
434
|
-
$[26] = children;
|
|
435
|
-
$[27] = id;
|
|
436
|
-
$[28] = ref;
|
|
437
|
-
$[29] = rest;
|
|
438
|
-
$[30] = t0;
|
|
439
|
-
$[31] = t1;
|
|
440
|
-
$[32] = t2;
|
|
441
|
-
$[33] = t3;
|
|
442
|
-
$[34] = text;
|
|
443
|
-
$[35] = t4;
|
|
444
|
-
} else t4 = $[35];
|
|
445
|
-
return t4;
|
|
342
|
+
},
|
|
343
|
+
"data-id": id,
|
|
344
|
+
ref,
|
|
345
|
+
...rest,
|
|
346
|
+
children: [
|
|
347
|
+
LeadingVisual ? /*#__PURE__*/ jsx(ActionList.LeadingVisual, { children: /*#__PURE__*/ jsx(LeadingVisual, {}) }) : null,
|
|
348
|
+
children,
|
|
349
|
+
text,
|
|
350
|
+
description ? /*#__PURE__*/ jsx(ActionList.Description, {
|
|
351
|
+
variant: descriptionVariant,
|
|
352
|
+
children: description
|
|
353
|
+
}) : null,
|
|
354
|
+
TrailingVisual ? /*#__PURE__*/ jsx(ActionList.TrailingVisual, { children: typeof TrailingVisual !== "string" && isValidElementType(TrailingVisual) ? /*#__PURE__*/ jsx(TrailingVisual, {}) : TrailingVisual }) : TrailingIcon || trailingText ? /*#__PURE__*/ jsxs(ActionList.TrailingVisual, { children: [trailingText, TrailingIcon && /*#__PURE__*/ jsx(TrailingIcon, {})] }) : null
|
|
355
|
+
]
|
|
356
|
+
});
|
|
446
357
|
});
|
|
447
358
|
FilteredActionList.displayName = "FilteredActionList";
|
|
448
359
|
//#endregion
|