@sproutsocial/seeds-react-menu 1.12.3 → 1.15.10
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/.turbo/turbo-build.log +12 -12
- package/CHANGELOG.md +193 -0
- package/dist/esm/v3/index.js +726 -186
- package/dist/esm/v3/index.js.map +1 -1
- package/dist/index.d.mts +22 -22
- package/dist/index.d.ts +22 -22
- package/dist/v3/index.d.mts +199 -50
- package/dist/v3/index.d.ts +199 -50
- package/dist/v3/index.js +732 -185
- package/dist/v3/index.js.map +1 -1
- package/package.json +14 -14
- package/src/v3/ActionMenu.stories.tsx +260 -0
- package/src/v3/ActionMenu.tsx +345 -0
- package/src/v3/ActionMenuStyles.tsx +154 -0
- package/src/v3/Common/ComboboxStyles.tsx +41 -7
- package/src/v3/Common/SelectStyles.tsx +20 -6
- package/src/v3/Common/useSuppressEscapeClear.ts +20 -0
- package/src/v3/MenuButton.stories.tsx +118 -0
- package/src/v3/MenuButton.tsx +68 -0
- package/src/v3/MenuButtonStyles.tsx +38 -0
- package/src/v3/ModalStories.stories.tsx +159 -0
- package/src/v3/MultiCombobox.stories.tsx +157 -0
- package/src/v3/MultiCombobox.tsx +28 -8
- package/src/v3/MultiSearchableSelect.stories.tsx +42 -0
- package/src/v3/MultiSearchableSelect.tsx +11 -6
- package/src/v3/MultiSelect.stories.tsx +40 -0
- package/src/v3/MultiSelect.tsx +12 -3
- package/src/v3/SingleCombobox.stories.tsx +36 -0
- package/src/v3/SingleCombobox.tsx +17 -7
- package/src/v3/SingleSearchableSelect.stories.tsx +38 -0
- package/src/v3/SingleSearchableSelect.tsx +15 -7
- package/src/v3/SingleSelect.stories.tsx +36 -0
- package/src/v3/SingleSelect.tsx +12 -3
- package/src/v3/__tests__/MenuButton.test.tsx +80 -0
- package/src/v3/index.ts +2 -0
package/dist/v3/index.js
CHANGED
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/v3/index.ts
|
|
31
31
|
var v3_exports = {};
|
|
32
32
|
__export(v3_exports, {
|
|
33
|
+
ActionMenu: () => ActionMenu,
|
|
33
34
|
ComboboxActionButtons: () => ComboboxActionButtons,
|
|
34
35
|
ComboboxClear: () => ComboboxClear,
|
|
35
36
|
ComboboxEmpty: () => ComboboxEmpty,
|
|
@@ -52,6 +53,12 @@ __export(v3_exports, {
|
|
|
52
53
|
ComboboxTokenInput: () => ComboboxTokenInput,
|
|
53
54
|
ComboboxTokenInputGroup: () => ComboboxTokenInputGroup,
|
|
54
55
|
ComboboxTrigger: () => ComboboxTrigger,
|
|
56
|
+
MenuButton: () => MenuButton,
|
|
57
|
+
MenuGroup: () => MenuGroup,
|
|
58
|
+
MenuItem: () => MenuItem,
|
|
59
|
+
MenuRadioGroup: () => MenuRadioGroup,
|
|
60
|
+
MenuSub: () => MenuSub,
|
|
61
|
+
MenuSubTrigger: () => MenuSubTrigger,
|
|
55
62
|
MultiCombobox: () => MultiCombobox,
|
|
56
63
|
MultiSearchableSelect: () => MultiSearchableSelect,
|
|
57
64
|
MultiSelect: () => MultiSelect,
|
|
@@ -207,20 +214,50 @@ function groupItems(data, groupBy) {
|
|
|
207
214
|
|
|
208
215
|
// src/v3/Common/SelectStyles.tsx
|
|
209
216
|
var import_select2 = require("@base-ui/react/select");
|
|
210
|
-
var
|
|
217
|
+
var import_styled_components3 = __toESM(require("styled-components"));
|
|
211
218
|
var import_seeds_react_mixins = require("@sproutsocial/seeds-react-mixins");
|
|
212
|
-
|
|
219
|
+
|
|
220
|
+
// src/v3/Common/SelectIcons.tsx
|
|
221
|
+
var React3 = require("react");
|
|
222
|
+
var import_styled_components2 = __toESM(require("styled-components"));
|
|
223
|
+
var import_seeds_react_icon2 = require("@sproutsocial/seeds-react-icon");
|
|
224
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
225
|
+
var StyledChevron = import_styled_components2.default.div`
|
|
213
226
|
display: flex;
|
|
227
|
+
align-items: center;
|
|
228
|
+
transition: transform 0.15s;
|
|
229
|
+
${({ $isOpen }) => $isOpen && "transform: rotate(-180deg);"}
|
|
230
|
+
`;
|
|
231
|
+
function ChevronIcon() {
|
|
232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_icon2.Icon, { name: "chevron-down-outline", fixedWidth: true, "aria-hidden": true });
|
|
233
|
+
}
|
|
234
|
+
function ClearIcon() {
|
|
235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_icon2.Icon, { name: "circle-x-outline", fixedWidth: true, "aria-hidden": true, size: "mini" });
|
|
236
|
+
}
|
|
237
|
+
function CheckIcon2() {
|
|
238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_icon2.Icon, { name: "check-outline", fixedWidth: true, "aria-hidden": true });
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// src/v3/Common/SelectStyles.tsx
|
|
242
|
+
var invalidStyles = import_styled_components3.css`
|
|
243
|
+
border-color: ${({ theme }) => theme.colors.form.border.error};
|
|
244
|
+
|
|
245
|
+
${StyledChevron} {
|
|
246
|
+
color: ${({ theme }) => theme.colors.icon.error};
|
|
247
|
+
}
|
|
248
|
+
`;
|
|
249
|
+
var Field = import_styled_components3.default.div`
|
|
250
|
+
display: ${({ $fullWidth }) => $fullWidth === false ? "inline-flex" : "flex"};
|
|
214
251
|
flex-direction: column;
|
|
215
252
|
gap: ${({ theme }) => theme.space[200]};
|
|
216
|
-
width: 100%;
|
|
253
|
+
${({ $fullWidth }) => $fullWidth !== false && "width: 100%;"}
|
|
217
254
|
`;
|
|
218
|
-
var SelectLabel = (0,
|
|
255
|
+
var SelectLabel = (0, import_styled_components3.default)(import_select2.Select.Label)`
|
|
219
256
|
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
220
257
|
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
221
258
|
color: ${({ theme }) => theme.colors.text.body};
|
|
222
259
|
`;
|
|
223
|
-
var SelectTrigger = (0,
|
|
260
|
+
var SelectTrigger = (0, import_styled_components3.default)(import_select2.Select.Trigger)`
|
|
224
261
|
display: flex;
|
|
225
262
|
align-items: center;
|
|
226
263
|
justify-content: space-between;
|
|
@@ -255,21 +292,23 @@ var SelectTrigger = (0, import_styled_components2.default)(import_select2.Select
|
|
|
255
292
|
opacity: 0.4;
|
|
256
293
|
cursor: not-allowed;
|
|
257
294
|
}
|
|
295
|
+
|
|
296
|
+
${({ $isInvalid }) => $isInvalid && invalidStyles}
|
|
258
297
|
`;
|
|
259
|
-
var SelectValue = (0,
|
|
298
|
+
var SelectValue = (0, import_styled_components3.default)(import_select2.Select.Value)`
|
|
260
299
|
min-width: 0;
|
|
261
300
|
overflow: hidden;
|
|
262
301
|
`;
|
|
263
|
-
var SelectIcon = (0,
|
|
302
|
+
var SelectIcon = (0, import_styled_components3.default)(import_select2.Select.Icon)`
|
|
264
303
|
display: flex;
|
|
265
304
|
align-items: center;
|
|
266
305
|
color: ${({ theme }) => theme.colors.icon.base};
|
|
267
306
|
flex-shrink: 0;
|
|
268
307
|
`;
|
|
269
|
-
var SelectGroup = (0,
|
|
308
|
+
var SelectGroup = (0, import_styled_components3.default)(import_select2.Select.Group)`
|
|
270
309
|
display: block;
|
|
271
310
|
`;
|
|
272
|
-
var SelectGroupLabel = (0,
|
|
311
|
+
var SelectGroupLabel = (0, import_styled_components3.default)(import_select2.Select.GroupLabel)`
|
|
273
312
|
padding: ${({ theme }) => `${theme.space[300]} ${theme.space[300]} ${theme.space[200]}`};
|
|
274
313
|
font-size: ${({ theme }) => theme.typography[100].fontSize};
|
|
275
314
|
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
@@ -277,23 +316,23 @@ var SelectGroupLabel = (0, import_styled_components2.default)(import_select2.Sel
|
|
|
277
316
|
letter-spacing: 0.05em;
|
|
278
317
|
color: ${({ theme }) => theme.colors.text.subtext};
|
|
279
318
|
`;
|
|
280
|
-
var SelectSeparator = (0,
|
|
319
|
+
var SelectSeparator = (0, import_styled_components3.default)(import_select2.Select.Separator)`
|
|
281
320
|
height: 1px;
|
|
282
321
|
margin: ${({ theme }) => `${theme.space[200]} ${theme.space[300]}`};
|
|
283
322
|
background: ${({ theme }) => theme.colors.container.border.base};
|
|
284
323
|
`;
|
|
285
|
-
var SelectPositioner = (0,
|
|
324
|
+
var SelectPositioner = (0, import_styled_components3.default)(import_select2.Select.Positioner)`
|
|
286
325
|
width: var(--anchor-width);
|
|
287
326
|
z-index: 7;
|
|
288
327
|
`;
|
|
289
|
-
var SelectPopup = (0,
|
|
328
|
+
var SelectPopup = (0, import_styled_components3.default)(import_select2.Select.Popup)`
|
|
290
329
|
font-family: ${({ theme }) => theme.fontFamily};
|
|
291
330
|
background: ${({ theme }) => theme.colors.container.background.base};
|
|
292
331
|
border: 1px solid ${({ theme }) => theme.colors.container.border.base};
|
|
293
332
|
border-radius: ${({ theme }) => theme.radii[500]};
|
|
294
333
|
box-shadow: ${({ theme }) => theme.shadows.low};
|
|
295
334
|
outline: none;
|
|
296
|
-
max-height: min(var(--
|
|
335
|
+
max-height: min(var(--available-height, 400px), 400px);
|
|
297
336
|
overflow-y: auto;
|
|
298
337
|
padding: ${({ theme }) => theme.space[200]};
|
|
299
338
|
|
|
@@ -328,27 +367,6 @@ var SelectPopup = (0, import_styled_components2.default)(import_select2.Select.P
|
|
|
328
367
|
}
|
|
329
368
|
`;
|
|
330
369
|
|
|
331
|
-
// src/v3/Common/SelectIcons.tsx
|
|
332
|
-
var React3 = require("react");
|
|
333
|
-
var import_styled_components3 = __toESM(require("styled-components"));
|
|
334
|
-
var import_seeds_react_icon2 = require("@sproutsocial/seeds-react-icon");
|
|
335
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
336
|
-
var StyledChevron = import_styled_components3.default.div`
|
|
337
|
-
display: flex;
|
|
338
|
-
align-items: center;
|
|
339
|
-
transition: transform 0.15s;
|
|
340
|
-
${({ $isOpen }) => $isOpen && "transform: rotate(-180deg);"}
|
|
341
|
-
`;
|
|
342
|
-
function ChevronIcon() {
|
|
343
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_icon2.Icon, { name: "chevron-down-outline", fixedWidth: true, "aria-hidden": true });
|
|
344
|
-
}
|
|
345
|
-
function ClearIcon() {
|
|
346
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_icon2.Icon, { name: "circle-x-outline", fixedWidth: true, "aria-hidden": true, size: "mini" });
|
|
347
|
-
}
|
|
348
|
-
function CheckIcon2() {
|
|
349
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_seeds_react_icon2.Icon, { name: "check-outline", fixedWidth: true, "aria-hidden": true });
|
|
350
|
-
}
|
|
351
|
-
|
|
352
370
|
// src/v3/SingleSelect.tsx
|
|
353
371
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
354
372
|
var StyledValue = (0, import_styled_components4.default)(import_select3.Select.Value)`
|
|
@@ -363,8 +381,9 @@ var StyledValue = (0, import_styled_components4.default)(import_select3.Select.V
|
|
|
363
381
|
}
|
|
364
382
|
`;
|
|
365
383
|
function SingleSelect(props) {
|
|
366
|
-
const { id, placeholder, includePlaceholderItem } = props;
|
|
384
|
+
const { id, placeholder, includePlaceholderItem, fullWidth = true } = props;
|
|
367
385
|
const ariaDescribedBy = props["aria-describedby"];
|
|
386
|
+
const isInvalid = props.isInvalid;
|
|
368
387
|
const isChildrenMode = "children" in props && props.children != null;
|
|
369
388
|
const selectedItemId = props.selectedItemId;
|
|
370
389
|
const defaultSelectedItemId = props.defaultSelectedItemId;
|
|
@@ -411,7 +430,7 @@ function SingleSelect(props) {
|
|
|
411
430
|
}
|
|
412
431
|
}
|
|
413
432
|
}
|
|
414
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Field, { children: [
|
|
433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Field, { $fullWidth: fullWidth, children: [
|
|
415
434
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
416
435
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
417
436
|
import_select3.Select.Root,
|
|
@@ -422,10 +441,19 @@ function SingleSelect(props) {
|
|
|
422
441
|
onValueChange: handleValueChange,
|
|
423
442
|
id,
|
|
424
443
|
children: [
|
|
425
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
444
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
445
|
+
SelectTrigger,
|
|
446
|
+
{
|
|
447
|
+
"aria-describedby": ariaDescribedBy,
|
|
448
|
+
"aria-invalid": isInvalid || void 0,
|
|
449
|
+
"aria-required": props.required || void 0,
|
|
450
|
+
$isInvalid: isInvalid,
|
|
451
|
+
children: [
|
|
452
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StyledValue, { placeholder, children: renderSelection && selectedItem ? renderSelection(selectedItem) : void 0 }),
|
|
453
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SelectIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StyledChevron, { "data-chevron": true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ChevronIcon, {}) }) })
|
|
454
|
+
]
|
|
455
|
+
}
|
|
456
|
+
),
|
|
429
457
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_select3.Select.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SelectPositioner, { sideOffset: 8, alignItemWithTrigger: false, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(SelectPopup, { children: [
|
|
430
458
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_select3.Select.ScrollUpArrow, {}),
|
|
431
459
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_select3.Select.List, { children: children ? children : groupBy ? groupItems(data, groupBy).map((group, index, arr) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(React4.Fragment, { children: [
|
|
@@ -493,8 +521,9 @@ var Placeholder = import_styled_components5.default.div`
|
|
|
493
521
|
margin: 2px 8px 0px 0px;
|
|
494
522
|
`;
|
|
495
523
|
function MultiSelect(props) {
|
|
496
|
-
const { id, placeholder = "Select..." } = props;
|
|
524
|
+
const { id, placeholder = "Select...", fullWidth = true } = props;
|
|
497
525
|
const ariaDescribedBy = props["aria-describedby"];
|
|
526
|
+
const isInvalid = props.isInvalid;
|
|
498
527
|
const isChildrenMode = "children" in props && props.children != null;
|
|
499
528
|
const data = isChildrenMode ? [] : props.data;
|
|
500
529
|
const itemToString = isChildrenMode ? () => "" : props.itemToString;
|
|
@@ -539,7 +568,7 @@ function MultiSelect(props) {
|
|
|
539
568
|
onSelectedItemIdsChange(ids);
|
|
540
569
|
}
|
|
541
570
|
}
|
|
542
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Field, { children: [
|
|
571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Field, { $fullWidth: fullWidth, children: [
|
|
543
572
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
544
573
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
545
574
|
import_select4.Select.Root,
|
|
@@ -551,23 +580,32 @@ function MultiSelect(props) {
|
|
|
551
580
|
disabled: props.disabled,
|
|
552
581
|
id,
|
|
553
582
|
children: [
|
|
554
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
583
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
584
|
+
SelectTrigger,
|
|
585
|
+
{
|
|
586
|
+
"aria-describedby": ariaDescribedBy,
|
|
587
|
+
"aria-invalid": isInvalid || void 0,
|
|
588
|
+
"aria-required": props.required || void 0,
|
|
589
|
+
$isInvalid: isInvalid,
|
|
590
|
+
children: [
|
|
591
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SelectValue, { children: () => {
|
|
592
|
+
if (renderSelection) return renderSelection(selectedItems);
|
|
593
|
+
if (selectedItems.length === 0)
|
|
594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Placeholder, { children: placeholder });
|
|
595
|
+
const visibleItems = maxSelections != null ? selectedItems.slice(0, maxSelections) : selectedItems;
|
|
596
|
+
const overflowCount = maxSelections != null && selectedItems.length > maxSelections ? selectedItems.length - maxSelections : 0;
|
|
597
|
+
const text = visibleItems.map(
|
|
598
|
+
(item) => customRenderSelections ? customRenderSelections(item) : itemToString(item)
|
|
599
|
+
).join(", ");
|
|
600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(SelectionText, { children: [
|
|
601
|
+
text,
|
|
602
|
+
overflowCount > 0 ? `, +${overflowCount}` : ""
|
|
603
|
+
] });
|
|
604
|
+
} }),
|
|
605
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SelectIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(StyledChevron, { "data-chevron": true, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ChevronIcon, {}) }) })
|
|
606
|
+
]
|
|
607
|
+
}
|
|
608
|
+
),
|
|
571
609
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_select4.Select.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SelectPositioner, { sideOffset: 8, alignItemWithTrigger: false, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(SelectPopup, { children: [
|
|
572
610
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_select4.Select.ScrollUpArrow, {}),
|
|
573
611
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_select4.Select.List, { children: children ? children : groupBy ? groupItems(data, groupBy).map((group, index, arr) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(React5.Fragment, { children: [
|
|
@@ -608,12 +646,25 @@ function MultiSelect(props) {
|
|
|
608
646
|
}
|
|
609
647
|
|
|
610
648
|
// src/v3/SingleCombobox.tsx
|
|
611
|
-
var
|
|
649
|
+
var React9 = __toESM(require("react"));
|
|
612
650
|
var import_combobox3 = require("@base-ui/react/combobox");
|
|
613
651
|
var import_react_virtual2 = require("@tanstack/react-virtual");
|
|
614
652
|
|
|
615
|
-
// src/v3/Common/
|
|
653
|
+
// src/v3/Common/useSuppressEscapeClear.ts
|
|
616
654
|
var React6 = __toESM(require("react"));
|
|
655
|
+
function useSuppressEscapeClear(open) {
|
|
656
|
+
return React6.useCallback(
|
|
657
|
+
(event) => {
|
|
658
|
+
if (event.key === "Escape" && !open) {
|
|
659
|
+
event.stopPropagation();
|
|
660
|
+
}
|
|
661
|
+
},
|
|
662
|
+
[open]
|
|
663
|
+
);
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
// src/v3/Common/ComboboxItem.tsx
|
|
667
|
+
var React7 = __toESM(require("react"));
|
|
617
668
|
var import_seeds_react_radio2 = __toESM(require("@sproutsocial/seeds-react-radio"));
|
|
618
669
|
var import_seeds_react_checkbox3 = __toESM(require("@sproutsocial/seeds-react-checkbox"));
|
|
619
670
|
|
|
@@ -623,6 +674,13 @@ var import_styled_components6 = __toESM(require("styled-components"));
|
|
|
623
674
|
var import_seeds_react_mixins2 = require("@sproutsocial/seeds-react-mixins");
|
|
624
675
|
var import_seeds_react_checkbox2 = __toESM(require("@sproutsocial/seeds-react-checkbox"));
|
|
625
676
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
677
|
+
var invalidStyles2 = import_styled_components6.css`
|
|
678
|
+
border-color: ${({ theme }) => theme.colors.form.border.error};
|
|
679
|
+
|
|
680
|
+
${StyledChevron} {
|
|
681
|
+
color: ${({ theme }) => theme.colors.icon.error};
|
|
682
|
+
}
|
|
683
|
+
`;
|
|
626
684
|
var ComboboxLabel = import_styled_components6.default.label`
|
|
627
685
|
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
628
686
|
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
@@ -649,6 +707,8 @@ var ComboboxInputGroup = (0, import_styled_components6.default)(import_combobox.
|
|
|
649
707
|
opacity: 0.4;
|
|
650
708
|
cursor: not-allowed;
|
|
651
709
|
}
|
|
710
|
+
|
|
711
|
+
${({ $isInvalid }) => $isInvalid && invalidStyles2}
|
|
652
712
|
`;
|
|
653
713
|
var ComboboxInput = (0, import_styled_components6.default)(import_combobox.Combobox.Input)`
|
|
654
714
|
flex: 1;
|
|
@@ -696,7 +756,7 @@ var ComboboxActionButtons = import_styled_components6.default.div`
|
|
|
696
756
|
margin-left: auto;
|
|
697
757
|
gap: ${({ theme }) => theme.space[100]};
|
|
698
758
|
`;
|
|
699
|
-
var ComboboxClear = (0, import_styled_components6.default)(import_combobox.Combobox.Clear)`
|
|
759
|
+
var ComboboxClear = (0, import_styled_components6.default)(import_combobox.Combobox.Clear).attrs({ tabIndex: 0 })`
|
|
700
760
|
display: flex;
|
|
701
761
|
align-items: center;
|
|
702
762
|
justify-content: center;
|
|
@@ -713,6 +773,10 @@ var ComboboxClear = (0, import_styled_components6.default)(import_combobox.Combo
|
|
|
713
773
|
color: ${({ theme }) => theme.colors.text.body};
|
|
714
774
|
}
|
|
715
775
|
|
|
776
|
+
&:focus-visible {
|
|
777
|
+
${import_seeds_react_mixins2.focusRing}
|
|
778
|
+
}
|
|
779
|
+
|
|
716
780
|
&[data-empty] {
|
|
717
781
|
display: none;
|
|
718
782
|
}
|
|
@@ -745,7 +809,7 @@ var ComboboxPopup = (0, import_styled_components6.default)(import_combobox.Combo
|
|
|
745
809
|
box-shadow: ${({ theme }) => theme.shadows.medium};
|
|
746
810
|
outline: none;
|
|
747
811
|
width: 100%;
|
|
748
|
-
max-height: min(var(--
|
|
812
|
+
max-height: min(var(--available-height, 400px), 400px);
|
|
749
813
|
overflow-y: auto;
|
|
750
814
|
padding: 0;
|
|
751
815
|
|
|
@@ -912,6 +976,7 @@ var ComboboxToken = (0, import_styled_components6.default)(import_combobox.Combo
|
|
|
912
976
|
display: flex;
|
|
913
977
|
width: 100%;
|
|
914
978
|
flex-wrap: wrap;
|
|
979
|
+
gap: ${({ theme }) => theme.space[200]};
|
|
915
980
|
`;
|
|
916
981
|
var ComboboxTokenInputGroup = (0, import_styled_components6.default)(import_combobox.Combobox.InputGroup)`
|
|
917
982
|
display: flex;
|
|
@@ -936,6 +1001,8 @@ var ComboboxTokenInputGroup = (0, import_styled_components6.default)(import_comb
|
|
|
936
1001
|
opacity: 0.4;
|
|
937
1002
|
cursor: not-allowed;
|
|
938
1003
|
}
|
|
1004
|
+
|
|
1005
|
+
${({ $isInvalid }) => $isInvalid && invalidStyles2}
|
|
939
1006
|
`;
|
|
940
1007
|
var Token = import_styled_components6.default.span`
|
|
941
1008
|
display: inline-flex;
|
|
@@ -968,6 +1035,10 @@ var TokenRemove = import_styled_components6.default.button`
|
|
|
968
1035
|
cursor: pointer;
|
|
969
1036
|
padding: 0;
|
|
970
1037
|
line-height: 1;
|
|
1038
|
+
|
|
1039
|
+
&:focus-visible {
|
|
1040
|
+
${import_seeds_react_mixins2.focusRing}
|
|
1041
|
+
}
|
|
971
1042
|
`;
|
|
972
1043
|
var SearchableSelectTrigger = (0, import_styled_components6.default)(import_combobox.Combobox.Trigger)`
|
|
973
1044
|
display: flex;
|
|
@@ -1001,6 +1072,8 @@ var SearchableSelectTrigger = (0, import_styled_components6.default)(import_comb
|
|
|
1001
1072
|
opacity: 0.4;
|
|
1002
1073
|
cursor: not-allowed;
|
|
1003
1074
|
}
|
|
1075
|
+
|
|
1076
|
+
${({ $isInvalid }) => $isInvalid && invalidStyles2}
|
|
1004
1077
|
`;
|
|
1005
1078
|
var SearchableSelectTriggerIcon = (0, import_styled_components6.default)(import_combobox.Combobox.Icon)`
|
|
1006
1079
|
display: flex;
|
|
@@ -1083,6 +1156,8 @@ var SearchableSelectTokenTrigger = (0, import_styled_components6.default)(import
|
|
|
1083
1156
|
opacity: 0.4;
|
|
1084
1157
|
cursor: not-allowed;
|
|
1085
1158
|
}
|
|
1159
|
+
|
|
1160
|
+
${({ $isInvalid }) => $isInvalid && invalidStyles2}
|
|
1086
1161
|
`;
|
|
1087
1162
|
|
|
1088
1163
|
// src/v3/Common/ComboboxItem.tsx
|
|
@@ -1147,11 +1222,11 @@ function ComboboxItemInner({
|
|
|
1147
1222
|
}
|
|
1148
1223
|
);
|
|
1149
1224
|
}
|
|
1150
|
-
var ComboboxItem2 =
|
|
1225
|
+
var ComboboxItem2 = React7.forwardRef(ComboboxItemInner);
|
|
1151
1226
|
var ComboboxItem_default = ComboboxItem2;
|
|
1152
1227
|
|
|
1153
1228
|
// src/v3/Common/VirtualizedComboboxList.tsx
|
|
1154
|
-
var
|
|
1229
|
+
var React8 = __toESM(require("react"));
|
|
1155
1230
|
var import_combobox2 = require("@base-ui/react/combobox");
|
|
1156
1231
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
1157
1232
|
|
|
@@ -1191,7 +1266,7 @@ function VirtualizedComboboxList({
|
|
|
1191
1266
|
renderCreatableItem
|
|
1192
1267
|
}) {
|
|
1193
1268
|
const filteredItems = import_combobox2.Combobox.useFilteredItems();
|
|
1194
|
-
const scrollElementRef =
|
|
1269
|
+
const scrollElementRef = React8.useRef(null);
|
|
1195
1270
|
const virtualizer = (0, import_react_virtual.useVirtualizer)({
|
|
1196
1271
|
enabled: open,
|
|
1197
1272
|
count: filteredItems.length,
|
|
@@ -1203,8 +1278,8 @@ function VirtualizedComboboxList({
|
|
|
1203
1278
|
scrollPaddingStart: 4,
|
|
1204
1279
|
scrollPaddingEnd: 4
|
|
1205
1280
|
});
|
|
1206
|
-
|
|
1207
|
-
const handleScrollRef =
|
|
1281
|
+
React8.useImperativeHandle(virtualizerRef, () => virtualizer);
|
|
1282
|
+
const handleScrollRef = React8.useCallback(
|
|
1208
1283
|
(el) => {
|
|
1209
1284
|
scrollElementRef.current = el;
|
|
1210
1285
|
if (el) requestAnimationFrame(() => virtualizer.measure());
|
|
@@ -1348,9 +1423,11 @@ function SingleCombobox(props) {
|
|
|
1348
1423
|
id,
|
|
1349
1424
|
placeholder = "Search...",
|
|
1350
1425
|
emptyText = "No results found.",
|
|
1351
|
-
filter
|
|
1426
|
+
filter,
|
|
1427
|
+
fullWidth = true
|
|
1352
1428
|
} = props;
|
|
1353
1429
|
const ariaDescribedBy = props["aria-describedby"];
|
|
1430
|
+
const isInvalid = props.isInvalid;
|
|
1354
1431
|
const isChildrenMode = "children" in props && props.children != null;
|
|
1355
1432
|
const data = isChildrenMode ? [] : props.data;
|
|
1356
1433
|
const itemToString = isChildrenMode ? (_item) => "" : props.itemToString;
|
|
@@ -1364,17 +1441,18 @@ function SingleCombobox(props) {
|
|
|
1364
1441
|
const defaultSelectedItemId = props.defaultSelectedItemId;
|
|
1365
1442
|
const onSelectedItemIdChange = props.onSelectedItemIdChange;
|
|
1366
1443
|
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
1367
|
-
const [open, setOpen] =
|
|
1368
|
-
const virtualizerRef =
|
|
1444
|
+
const [open, setOpen] = React9.useState(false);
|
|
1445
|
+
const virtualizerRef = React9.useRef(null);
|
|
1446
|
+
const onInputKeyDownCapture = useSuppressEscapeClear(open);
|
|
1369
1447
|
const isControlled = selectedItemId !== void 0;
|
|
1370
|
-
const idToItem =
|
|
1448
|
+
const idToItem = React9.useCallback(
|
|
1371
1449
|
(id2) => {
|
|
1372
1450
|
if (id2 == null) return null;
|
|
1373
1451
|
return data.find((d) => String(d.id) === String(id2)) ?? null;
|
|
1374
1452
|
},
|
|
1375
1453
|
[data]
|
|
1376
1454
|
);
|
|
1377
|
-
const [internalValue, setInternalValue] =
|
|
1455
|
+
const [internalValue, setInternalValue] = React9.useState(
|
|
1378
1456
|
() => idToItem(defaultSelectedItemId)
|
|
1379
1457
|
);
|
|
1380
1458
|
const value = isControlled ? idToItem(selectedItemId) : internalValue;
|
|
@@ -1386,11 +1464,11 @@ function SingleCombobox(props) {
|
|
|
1386
1464
|
onSelectedItemIdChange(newItem ? newItem.id : null);
|
|
1387
1465
|
}
|
|
1388
1466
|
}
|
|
1389
|
-
const groups =
|
|
1467
|
+
const groups = React9.useMemo(
|
|
1390
1468
|
() => groupBy ? groupItems(data, groupBy) : null,
|
|
1391
1469
|
[data, groupBy]
|
|
1392
1470
|
);
|
|
1393
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Field, { children: [
|
|
1471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Field, { $fullWidth: fullWidth, children: [
|
|
1394
1472
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
1395
1473
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1396
1474
|
import_combobox3.Combobox.Root,
|
|
@@ -1411,29 +1489,38 @@ function SingleCombobox(props) {
|
|
|
1411
1489
|
if (!item || !virt) return;
|
|
1412
1490
|
const isStart = index === 0;
|
|
1413
1491
|
const isEnd = index === virt.options.count - 1;
|
|
1414
|
-
if (reason === "
|
|
1492
|
+
if (reason === "keyboard" && (isStart || isEnd)) {
|
|
1415
1493
|
queueMicrotask(() => {
|
|
1416
1494
|
virt.scrollToIndex(index, {
|
|
1417
|
-
align:
|
|
1495
|
+
align: isStart ? "start" : "end"
|
|
1418
1496
|
});
|
|
1419
1497
|
});
|
|
1420
1498
|
}
|
|
1421
1499
|
} : void 0,
|
|
1422
1500
|
children: [
|
|
1423
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1501
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1502
|
+
ComboboxInputGroup,
|
|
1503
|
+
{
|
|
1504
|
+
$isInvalid: isInvalid,
|
|
1505
|
+
onKeyDownCapture: onInputKeyDownCapture,
|
|
1506
|
+
children: [
|
|
1507
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1508
|
+
ComboboxInput,
|
|
1509
|
+
{
|
|
1510
|
+
placeholder,
|
|
1511
|
+
id,
|
|
1512
|
+
"aria-describedby": ariaDescribedBy,
|
|
1513
|
+
"aria-invalid": isInvalid || void 0,
|
|
1514
|
+
"aria-required": props.required || void 0
|
|
1515
|
+
}
|
|
1516
|
+
),
|
|
1517
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(ComboboxActionButtons, { children: [
|
|
1518
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ComboboxClear, { "aria-label": "Clear selection", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ClearIcon, {}) }),
|
|
1519
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ComboboxTrigger, { "aria-label": "Open popup", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(StyledChevron, { $isOpen: open, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ChevronIcon, {}) }) })
|
|
1520
|
+
] })
|
|
1521
|
+
]
|
|
1522
|
+
}
|
|
1523
|
+
),
|
|
1437
1524
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_combobox3.Combobox.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ComboboxPositioner, { sideOffset: 4, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1438
1525
|
ComboboxPopup,
|
|
1439
1526
|
{
|
|
@@ -1463,7 +1550,7 @@ function SingleCombobox(props) {
|
|
|
1463
1550
|
renderItem,
|
|
1464
1551
|
renderGroupHeading
|
|
1465
1552
|
}
|
|
1466
|
-
) : children ? children : groups ? (group, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1553
|
+
) : children ? children : groups ? ((group, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(React9.Fragment, { children: [
|
|
1467
1554
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(ComboboxGroup, { items: group.items, children: [
|
|
1468
1555
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ComboboxGroupLabel, { children: renderGroupHeading ? renderGroupHeading(group.value) : group.value }),
|
|
1469
1556
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_combobox3.Combobox.Collection, { children: (item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
@@ -1480,7 +1567,7 @@ function SingleCombobox(props) {
|
|
|
1480
1567
|
) })
|
|
1481
1568
|
] }),
|
|
1482
1569
|
index < groups.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ComboboxSeparator, {})
|
|
1483
|
-
] }, group.value) : (item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1570
|
+
] }, group.value)) : ((item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1484
1571
|
ComboboxItem_default,
|
|
1485
1572
|
{
|
|
1486
1573
|
value: item,
|
|
@@ -1491,7 +1578,7 @@ function SingleCombobox(props) {
|
|
|
1491
1578
|
renderItem: renderItem ? () => renderItem(item) : () => itemToString(item)
|
|
1492
1579
|
},
|
|
1493
1580
|
item.id
|
|
1494
|
-
)
|
|
1581
|
+
))
|
|
1495
1582
|
}
|
|
1496
1583
|
)
|
|
1497
1584
|
]
|
|
@@ -1504,7 +1591,7 @@ function SingleCombobox(props) {
|
|
|
1504
1591
|
}
|
|
1505
1592
|
|
|
1506
1593
|
// src/v3/MultiCombobox.tsx
|
|
1507
|
-
var
|
|
1594
|
+
var React10 = __toESM(require("react"));
|
|
1508
1595
|
var import_combobox4 = require("@base-ui/react/combobox");
|
|
1509
1596
|
var import_react_virtual3 = require("@tanstack/react-virtual");
|
|
1510
1597
|
var import_seeds_react_icon3 = __toESM(require("@sproutsocial/seeds-react-icon"));
|
|
@@ -1528,9 +1615,11 @@ function MultiCombobox(props) {
|
|
|
1528
1615
|
loadingText = "Loading...",
|
|
1529
1616
|
filter,
|
|
1530
1617
|
inputValue,
|
|
1531
|
-
onInputValueChange
|
|
1618
|
+
onInputValueChange,
|
|
1619
|
+
fullWidth = true
|
|
1532
1620
|
} = props;
|
|
1533
1621
|
const ariaDescribedBy = props["aria-describedby"];
|
|
1622
|
+
const isInvalid = props.isInvalid;
|
|
1534
1623
|
const isChildrenMode = "children" in props && props.children != null;
|
|
1535
1624
|
const data = isChildrenMode ? [] : props.data;
|
|
1536
1625
|
const itemToString = isChildrenMode ? (_item) => "" : props.itemToString;
|
|
@@ -1554,29 +1643,31 @@ function MultiCombobox(props) {
|
|
|
1554
1643
|
const defaultSelectedItemIds = props.defaultSelectedItemIds;
|
|
1555
1644
|
const onSelectedItemIdsChange = props.onSelectedItemIdsChange;
|
|
1556
1645
|
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
1557
|
-
const [open, setOpen] =
|
|
1558
|
-
const [internalInputValue, setInternalInputValue] =
|
|
1559
|
-
const skipNextInputChangeRef =
|
|
1560
|
-
const virtualizerRef =
|
|
1646
|
+
const [open, setOpen] = React10.useState(false);
|
|
1647
|
+
const [internalInputValue, setInternalInputValue] = React10.useState("");
|
|
1648
|
+
const skipNextInputChangeRef = React10.useRef(false);
|
|
1649
|
+
const virtualizerRef = React10.useRef(null);
|
|
1650
|
+
const inputRef = React10.useRef(null);
|
|
1651
|
+
const onInputKeyDownCapture = useSuppressEscapeClear(open);
|
|
1561
1652
|
const isControlled = selectedItemIds !== void 0;
|
|
1562
|
-
const idsToItems =
|
|
1653
|
+
const idsToItems = React10.useCallback(
|
|
1563
1654
|
(ids) => ids.map((id2) => data.find((d) => d.id === id2)).filter((d) => d != null),
|
|
1564
1655
|
[data]
|
|
1565
1656
|
);
|
|
1566
|
-
const [internalValue, setInternalValue] =
|
|
1657
|
+
const [internalValue, setInternalValue] = React10.useState(
|
|
1567
1658
|
() => defaultSelectedItemIds ? idsToItems(defaultSelectedItemIds) : []
|
|
1568
1659
|
);
|
|
1569
1660
|
const value = isControlled ? idsToItems(selectedItemIds) : internalValue;
|
|
1570
|
-
const visibleData =
|
|
1661
|
+
const visibleData = React10.useMemo(
|
|
1571
1662
|
() => removeSelectedItems ? data.filter((item) => !value.some((v) => v.id === item.id)) : data,
|
|
1572
1663
|
[data, value, removeSelectedItems]
|
|
1573
1664
|
);
|
|
1574
|
-
const groups =
|
|
1665
|
+
const groups = React10.useMemo(
|
|
1575
1666
|
() => groupBy ? groupItems(visibleData, groupBy) : null,
|
|
1576
1667
|
[visibleData, groupBy]
|
|
1577
1668
|
);
|
|
1578
1669
|
const currentInputValue = inputValue ?? internalInputValue;
|
|
1579
|
-
const creatableSentinel =
|
|
1670
|
+
const creatableSentinel = React10.useMemo(() => {
|
|
1580
1671
|
if (!creatableProp) return null;
|
|
1581
1672
|
const trimmed = currentInputValue.trim();
|
|
1582
1673
|
if (!trimmed) return null;
|
|
@@ -1587,7 +1678,7 @@ function MultiCombobox(props) {
|
|
|
1587
1678
|
if (exactExists) return null;
|
|
1588
1679
|
return makeCreatableSentinel(trimmed);
|
|
1589
1680
|
}, [creatableProp, currentInputValue, data, itemToString]);
|
|
1590
|
-
const flatItems =
|
|
1681
|
+
const flatItems = React10.useMemo(() => {
|
|
1591
1682
|
if (!selectHeadings && !selectAll) return null;
|
|
1592
1683
|
if (!groups && !selectAll) return null;
|
|
1593
1684
|
const rows = [];
|
|
@@ -1673,6 +1764,7 @@ function MultiCombobox(props) {
|
|
|
1673
1764
|
e.preventDefault();
|
|
1674
1765
|
e.stopPropagation();
|
|
1675
1766
|
setSelectedItems(value.filter((v) => v.id !== item.id));
|
|
1767
|
+
inputRef.current?.focus();
|
|
1676
1768
|
}
|
|
1677
1769
|
function renderSentinelRow(row) {
|
|
1678
1770
|
if (isSelectAllSentinel2(row)) {
|
|
@@ -1743,7 +1835,7 @@ function MultiCombobox(props) {
|
|
|
1743
1835
|
const rootItems = creatableSentinel && Array.isArray(baseItems) ? [...baseItems, creatableSentinel] : baseItems;
|
|
1744
1836
|
const hasSentinels = selectAll || selectHeadings;
|
|
1745
1837
|
const rootValue = hasSentinels ? [...value] : value;
|
|
1746
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Field, { children: [
|
|
1838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Field, { $fullWidth: fullWidth, children: [
|
|
1747
1839
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
1748
1840
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1749
1841
|
import_combobox4.Combobox.Root,
|
|
@@ -1754,7 +1846,10 @@ function MultiCombobox(props) {
|
|
|
1754
1846
|
open,
|
|
1755
1847
|
disabled: props.disabled,
|
|
1756
1848
|
onOpenChange: (nextOpen, eventDetails) => {
|
|
1757
|
-
if (!nextOpen && eventDetails.reason === "item-press")
|
|
1849
|
+
if (!nextOpen && eventDetails.reason === "item-press") {
|
|
1850
|
+
eventDetails.cancel();
|
|
1851
|
+
return;
|
|
1852
|
+
}
|
|
1758
1853
|
setOpen(nextOpen);
|
|
1759
1854
|
},
|
|
1760
1855
|
filter: creatableProp ? (item, query) => {
|
|
@@ -1787,10 +1882,10 @@ function MultiCombobox(props) {
|
|
|
1787
1882
|
if (!item || !virt) return;
|
|
1788
1883
|
const isStart = index === 0;
|
|
1789
1884
|
const isEnd = index === virt.options.count - 1;
|
|
1790
|
-
if (reason === "
|
|
1885
|
+
if (reason === "keyboard" && (isStart || isEnd)) {
|
|
1791
1886
|
queueMicrotask(() => {
|
|
1792
1887
|
virt.scrollToIndex(index, {
|
|
1793
|
-
align:
|
|
1888
|
+
align: isStart ? "start" : "end"
|
|
1794
1889
|
});
|
|
1795
1890
|
});
|
|
1796
1891
|
}
|
|
@@ -1817,42 +1912,52 @@ function MultiCombobox(props) {
|
|
|
1817
1912
|
},
|
|
1818
1913
|
items: rootItems,
|
|
1819
1914
|
children: [
|
|
1820
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1915
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1916
|
+
ComboboxTokenInputGroup,
|
|
1917
|
+
{
|
|
1918
|
+
$isInvalid: isInvalid,
|
|
1919
|
+
onKeyDownCapture: onInputKeyDownCapture,
|
|
1920
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(ComboboxToken, { children: [
|
|
1921
|
+
renderSelection ? renderSelection(value) : (() => {
|
|
1922
|
+
const visibleTokens = maxTokens != null ? value.slice(0, maxTokens) : value;
|
|
1923
|
+
const overflow = maxTokens != null ? value.length - maxTokens : 0;
|
|
1924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
1925
|
+
visibleTokens.map((item) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Token, { children: [
|
|
1926
|
+
renderToken ? renderToken(item) : itemToString(item),
|
|
1927
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1928
|
+
TokenRemove,
|
|
1929
|
+
{
|
|
1930
|
+
"aria-label": `Remove ${itemToString(item)}`,
|
|
1931
|
+
onPointerDown: (e) => e.preventDefault(),
|
|
1932
|
+
onClick: (e) => removeItem(item, e),
|
|
1933
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_seeds_react_icon3.default, { name: "x-outline", size: "mini" })
|
|
1934
|
+
}
|
|
1935
|
+
)
|
|
1936
|
+
] }, item.id)),
|
|
1937
|
+
overflow > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Token, { children: [
|
|
1938
|
+
"+",
|
|
1939
|
+
overflow
|
|
1940
|
+
] }, "__overflow")
|
|
1941
|
+
] });
|
|
1942
|
+
})(),
|
|
1943
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1944
|
+
ComboboxTokenInput,
|
|
1945
|
+
{
|
|
1946
|
+
ref: inputRef,
|
|
1947
|
+
id,
|
|
1948
|
+
placeholder: value.length > 0 ? "" : placeholder,
|
|
1949
|
+
"aria-describedby": ariaDescribedBy,
|
|
1950
|
+
"aria-invalid": isInvalid || void 0,
|
|
1951
|
+
"aria-required": props.required || void 0
|
|
1952
|
+
}
|
|
1953
|
+
),
|
|
1954
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(ComboboxActionButtons, { children: [
|
|
1955
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ComboboxClear, { "aria-label": "Clear all", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ClearIcon, {}) }),
|
|
1956
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ComboboxTrigger, { "aria-label": "Open popup", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(StyledChevron, { $isOpen: open, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChevronIcon, {}) }) })
|
|
1957
|
+
] })
|
|
1958
|
+
] })
|
|
1959
|
+
}
|
|
1960
|
+
),
|
|
1856
1961
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_combobox4.Combobox.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ComboboxPositioner, { sideOffset: 4, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1857
1962
|
ComboboxPopup,
|
|
1858
1963
|
{
|
|
@@ -1890,12 +1995,12 @@ function MultiCombobox(props) {
|
|
|
1890
1995
|
measureRef
|
|
1891
1996
|
) : void 0
|
|
1892
1997
|
}
|
|
1893
|
-
) : children ? children : flatItems ? (row) => renderSentinelRow(row) : groups ? (group, index) => {
|
|
1998
|
+
) : children ? children : flatItems ? ((row) => renderSentinelRow(row)) : groups ? ((group, index) => {
|
|
1894
1999
|
if (isCreatableSentinel(group)) {
|
|
1895
2000
|
return renderCreatableItem(group);
|
|
1896
2001
|
}
|
|
1897
2002
|
const g = group;
|
|
1898
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(React10.Fragment, { children: [
|
|
1899
2004
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(ComboboxGroup, { items: g.items, children: [
|
|
1900
2005
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ComboboxGroupLabel, { children: renderGroupHeading ? renderGroupHeading(g.value) : g.value }),
|
|
1901
2006
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_combobox4.Combobox.Collection, { children: (item) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
@@ -1913,7 +2018,7 @@ function MultiCombobox(props) {
|
|
|
1913
2018
|
] }),
|
|
1914
2019
|
index < groups.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ComboboxSeparator, {})
|
|
1915
2020
|
] }, g.value);
|
|
1916
|
-
} : (item) => {
|
|
2021
|
+
}) : ((item) => {
|
|
1917
2022
|
if (isCreatableSentinel(item)) {
|
|
1918
2023
|
return renderCreatableItem(item);
|
|
1919
2024
|
}
|
|
@@ -1930,7 +2035,7 @@ function MultiCombobox(props) {
|
|
|
1930
2035
|
},
|
|
1931
2036
|
dataItem.id
|
|
1932
2037
|
);
|
|
1933
|
-
}
|
|
2038
|
+
})
|
|
1934
2039
|
}
|
|
1935
2040
|
)
|
|
1936
2041
|
]
|
|
@@ -1943,7 +2048,7 @@ function MultiCombobox(props) {
|
|
|
1943
2048
|
}
|
|
1944
2049
|
|
|
1945
2050
|
// src/v3/SingleSearchableSelect.tsx
|
|
1946
|
-
var
|
|
2051
|
+
var React11 = __toESM(require("react"));
|
|
1947
2052
|
var import_combobox5 = require("@base-ui/react/combobox");
|
|
1948
2053
|
var import_react_virtual4 = require("@tanstack/react-virtual");
|
|
1949
2054
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
@@ -1956,9 +2061,11 @@ function SingleSearchableSelect(props) {
|
|
|
1956
2061
|
emptyText = "No results found.",
|
|
1957
2062
|
isLoading = false,
|
|
1958
2063
|
loadingText = "Loading...",
|
|
1959
|
-
filter
|
|
2064
|
+
filter,
|
|
2065
|
+
fullWidth = true
|
|
1960
2066
|
} = props;
|
|
1961
2067
|
const ariaDescribedBy = props["aria-describedby"];
|
|
2068
|
+
const isInvalid = props.isInvalid;
|
|
1962
2069
|
const isChildrenMode = "children" in props && props.children != null;
|
|
1963
2070
|
const data = isChildrenMode ? [] : props.data;
|
|
1964
2071
|
const itemToString = isChildrenMode ? (_item) => "" : props.itemToString;
|
|
@@ -1973,17 +2080,17 @@ function SingleSearchableSelect(props) {
|
|
|
1973
2080
|
const defaultSelectedItemId = props.defaultSelectedItemId;
|
|
1974
2081
|
const onSelectedItemIdChange = props.onSelectedItemIdChange;
|
|
1975
2082
|
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
1976
|
-
const [open, setOpen] =
|
|
1977
|
-
const virtualizerRef =
|
|
2083
|
+
const [open, setOpen] = React11.useState(false);
|
|
2084
|
+
const virtualizerRef = React11.useRef(null);
|
|
1978
2085
|
const isControlled = selectedItemId !== void 0;
|
|
1979
|
-
const idToItem =
|
|
2086
|
+
const idToItem = React11.useCallback(
|
|
1980
2087
|
(id2) => {
|
|
1981
2088
|
if (id2 == null) return null;
|
|
1982
2089
|
return data.find((d) => String(d.id) === String(id2)) ?? null;
|
|
1983
2090
|
},
|
|
1984
2091
|
[data]
|
|
1985
2092
|
);
|
|
1986
|
-
const [internalValue, setInternalValue] =
|
|
2093
|
+
const [internalValue, setInternalValue] = React11.useState(
|
|
1987
2094
|
() => idToItem(defaultSelectedItemId)
|
|
1988
2095
|
);
|
|
1989
2096
|
const value = isControlled ? idToItem(selectedItemId) : internalValue;
|
|
@@ -1994,11 +2101,11 @@ function SingleSearchableSelect(props) {
|
|
|
1994
2101
|
onSelectedItemIdChange(realItem ? realItem.id : null);
|
|
1995
2102
|
}
|
|
1996
2103
|
}
|
|
1997
|
-
const groups =
|
|
2104
|
+
const groups = React11.useMemo(
|
|
1998
2105
|
() => groupBy ? groupItems(data, groupBy) : null,
|
|
1999
2106
|
[data, groupBy]
|
|
2000
2107
|
);
|
|
2001
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Field, { children: [
|
|
2108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Field, { $fullWidth: fullWidth, children: [
|
|
2002
2109
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
2003
2110
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2004
2111
|
import_combobox5.Combobox.Root,
|
|
@@ -2024,19 +2131,29 @@ function SingleSearchableSelect(props) {
|
|
|
2024
2131
|
if (!item || !virt) return;
|
|
2025
2132
|
const isStart = index === 0;
|
|
2026
2133
|
const isEnd = index === virt.options.count - 1;
|
|
2027
|
-
if (reason === "
|
|
2134
|
+
if (reason === "keyboard" && (isStart || isEnd)) {
|
|
2028
2135
|
queueMicrotask(() => {
|
|
2029
2136
|
virt.scrollToIndex(index, {
|
|
2030
|
-
align:
|
|
2137
|
+
align: isStart ? "start" : "end"
|
|
2031
2138
|
});
|
|
2032
2139
|
});
|
|
2033
2140
|
}
|
|
2034
2141
|
} : void 0,
|
|
2035
2142
|
children: [
|
|
2036
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2143
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2144
|
+
SearchableSelectTrigger,
|
|
2145
|
+
{
|
|
2146
|
+
id,
|
|
2147
|
+
"aria-describedby": ariaDescribedBy,
|
|
2148
|
+
"aria-invalid": isInvalid || void 0,
|
|
2149
|
+
"aria-required": props.required || void 0,
|
|
2150
|
+
$isInvalid: isInvalid,
|
|
2151
|
+
children: [
|
|
2152
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SearchableSelectPlaceholder, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_combobox5.Combobox.Value, { placeholder, children: value ? renderSelection ? renderSelection(value) : itemToString(value) : placeholder }) }),
|
|
2153
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SearchableSelectTriggerIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(StyledChevron, { "data-chevron": true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChevronIcon, {}) }) })
|
|
2154
|
+
]
|
|
2155
|
+
}
|
|
2156
|
+
),
|
|
2040
2157
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_combobox5.Combobox.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ComboboxPositioner, { sideOffset: 4, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2041
2158
|
SearchableSelectPopup,
|
|
2042
2159
|
{
|
|
@@ -2074,7 +2191,7 @@ function SingleSearchableSelect(props) {
|
|
|
2074
2191
|
inputType,
|
|
2075
2192
|
renderItem
|
|
2076
2193
|
}
|
|
2077
|
-
) : children ? children : groups ? (group, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2194
|
+
) : children ? children : groups ? ((group, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(React11.Fragment, { children: [
|
|
2078
2195
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(ComboboxGroup, { items: group.items, children: [
|
|
2079
2196
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ComboboxGroupLabel, { children: renderGroupHeading ? renderGroupHeading(group.value) : group.value }),
|
|
2080
2197
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_combobox5.Combobox.Collection, { children: (item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
@@ -2091,7 +2208,7 @@ function SingleSearchableSelect(props) {
|
|
|
2091
2208
|
) })
|
|
2092
2209
|
] }),
|
|
2093
2210
|
index < groups.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ComboboxSeparator, {})
|
|
2094
|
-
] }, group.value) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
2211
|
+
] }, group.value)) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
2095
2212
|
includePlaceholderItem && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2096
2213
|
ComboboxItem_default,
|
|
2097
2214
|
{
|
|
@@ -2127,7 +2244,7 @@ function SingleSearchableSelect(props) {
|
|
|
2127
2244
|
}
|
|
2128
2245
|
|
|
2129
2246
|
// src/v3/MultiSearchableSelect.tsx
|
|
2130
|
-
var
|
|
2247
|
+
var React12 = __toESM(require("react"));
|
|
2131
2248
|
var import_combobox6 = require("@base-ui/react/combobox");
|
|
2132
2249
|
var import_react_virtual5 = require("@tanstack/react-virtual");
|
|
2133
2250
|
var import_seeds_react_icon4 = __toESM(require("@sproutsocial/seeds-react-icon"));
|
|
@@ -2157,9 +2274,11 @@ function MultiSearchableSelect(props) {
|
|
|
2157
2274
|
emptyText = "No results found.",
|
|
2158
2275
|
isLoading = false,
|
|
2159
2276
|
loadingText = "Loading...",
|
|
2160
|
-
filter
|
|
2277
|
+
filter,
|
|
2278
|
+
fullWidth = true
|
|
2161
2279
|
} = props;
|
|
2162
2280
|
const ariaDescribedBy = props["aria-describedby"];
|
|
2281
|
+
const isInvalid = props.isInvalid;
|
|
2163
2282
|
const isChildrenMode = "children" in props && props.children != null;
|
|
2164
2283
|
const data = isChildrenMode ? [] : props.data;
|
|
2165
2284
|
const itemToString = isChildrenMode ? (_item) => "" : props.itemToString;
|
|
@@ -2181,29 +2300,29 @@ function MultiSearchableSelect(props) {
|
|
|
2181
2300
|
const defaultSelectedItemIds = props.defaultSelectedItemIds;
|
|
2182
2301
|
const onSelectedItemIdsChange = props.onSelectedItemIdsChange;
|
|
2183
2302
|
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
2184
|
-
const [open, setOpen] =
|
|
2185
|
-
const [internalInputValue, setInternalInputValue] =
|
|
2186
|
-
const skipNextInputChangeRef =
|
|
2187
|
-
const virtualizerRef =
|
|
2303
|
+
const [open, setOpen] = React12.useState(false);
|
|
2304
|
+
const [internalInputValue, setInternalInputValue] = React12.useState("");
|
|
2305
|
+
const skipNextInputChangeRef = React12.useRef(false);
|
|
2306
|
+
const virtualizerRef = React12.useRef(null);
|
|
2188
2307
|
const isControlled = selectedItemIds !== void 0;
|
|
2189
|
-
const idsToItems =
|
|
2308
|
+
const idsToItems = React12.useCallback(
|
|
2190
2309
|
(ids) => ids.map((id2) => data.find((d) => d.id === id2)).filter((d) => d != null),
|
|
2191
2310
|
[data]
|
|
2192
2311
|
);
|
|
2193
|
-
const [internalValue, setInternalValue] =
|
|
2312
|
+
const [internalValue, setInternalValue] = React12.useState(
|
|
2194
2313
|
() => defaultSelectedItemIds ? idsToItems(defaultSelectedItemIds) : []
|
|
2195
2314
|
);
|
|
2196
2315
|
const value = isControlled ? idsToItems(selectedItemIds) : internalValue;
|
|
2197
|
-
const visibleData =
|
|
2316
|
+
const visibleData = React12.useMemo(
|
|
2198
2317
|
() => removeSelectedItems ? data.filter((item) => !value.some((v) => v.id === item.id)) : data,
|
|
2199
2318
|
[data, value, removeSelectedItems]
|
|
2200
2319
|
);
|
|
2201
|
-
const groups =
|
|
2320
|
+
const groups = React12.useMemo(
|
|
2202
2321
|
() => groupBy ? groupItems(visibleData, groupBy) : null,
|
|
2203
2322
|
[visibleData, groupBy]
|
|
2204
2323
|
);
|
|
2205
2324
|
const currentInputValue = internalInputValue;
|
|
2206
|
-
const creatableSentinel =
|
|
2325
|
+
const creatableSentinel = React12.useMemo(() => {
|
|
2207
2326
|
if (!creatableProp) return null;
|
|
2208
2327
|
const trimmed = currentInputValue.trim();
|
|
2209
2328
|
if (!trimmed) return null;
|
|
@@ -2214,7 +2333,7 @@ function MultiSearchableSelect(props) {
|
|
|
2214
2333
|
if (exactExists) return null;
|
|
2215
2334
|
return makeCreatableSentinel(trimmed);
|
|
2216
2335
|
}, [creatableProp, currentInputValue, data, itemToString]);
|
|
2217
|
-
const flatItems =
|
|
2336
|
+
const flatItems = React12.useMemo(() => {
|
|
2218
2337
|
if (!groups || !selectHeadings && !selectAll) return null;
|
|
2219
2338
|
const rows = [];
|
|
2220
2339
|
if (selectAll) rows.push(SELECT_ALL_SENTINEL2);
|
|
@@ -2358,7 +2477,7 @@ function MultiSearchableSelect(props) {
|
|
|
2358
2477
|
const rootItems = creatableSentinel && Array.isArray(baseItems) ? [...baseItems, creatableSentinel] : baseItems;
|
|
2359
2478
|
const hasSentinels = selectAll || selectHeadings;
|
|
2360
2479
|
const rootValue = hasSentinels ? [...value] : value;
|
|
2361
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Field, { children: [
|
|
2480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Field, { $fullWidth: fullWidth, children: [
|
|
2362
2481
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
2363
2482
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2364
2483
|
import_combobox6.Combobox.Root,
|
|
@@ -2391,10 +2510,10 @@ function MultiSearchableSelect(props) {
|
|
|
2391
2510
|
if (!item || !virt) return;
|
|
2392
2511
|
const isStart = index === 0;
|
|
2393
2512
|
const isEnd = index === virt.options.count - 1;
|
|
2394
|
-
if (reason === "
|
|
2513
|
+
if (reason === "keyboard" && (isStart || isEnd)) {
|
|
2395
2514
|
queueMicrotask(() => {
|
|
2396
2515
|
virt.scrollToIndex(index, {
|
|
2397
|
-
align:
|
|
2516
|
+
align: isStart ? "start" : "end"
|
|
2398
2517
|
});
|
|
2399
2518
|
});
|
|
2400
2519
|
}
|
|
@@ -2426,6 +2545,9 @@ function MultiSearchableSelect(props) {
|
|
|
2426
2545
|
{
|
|
2427
2546
|
id,
|
|
2428
2547
|
"aria-describedby": ariaDescribedBy,
|
|
2548
|
+
"aria-invalid": isInvalid || void 0,
|
|
2549
|
+
"aria-required": props.required || void 0,
|
|
2550
|
+
$isInvalid: isInvalid,
|
|
2429
2551
|
children: [
|
|
2430
2552
|
renderSelection ? renderSelection(value) : value.length > 0 ? (() => {
|
|
2431
2553
|
const visibleItems = maxSelections != null ? value.slice(0, maxSelections) : value;
|
|
@@ -2486,12 +2608,12 @@ function MultiSearchableSelect(props) {
|
|
|
2486
2608
|
measureRef
|
|
2487
2609
|
) : void 0
|
|
2488
2610
|
}
|
|
2489
|
-
) : children ? children : flatItems ? (row) => renderSentinelRow(row) : groups ? (group, index) => {
|
|
2611
|
+
) : children ? children : flatItems ? ((row) => renderSentinelRow(row)) : groups ? ((group, index) => {
|
|
2490
2612
|
if (isCreatableSentinel(group)) {
|
|
2491
2613
|
return renderCreatableItem(group);
|
|
2492
2614
|
}
|
|
2493
2615
|
const g = group;
|
|
2494
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2616
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(React12.Fragment, { children: [
|
|
2495
2617
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(ComboboxGroup, { items: g.items, children: [
|
|
2496
2618
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ComboboxGroupLabel, { children: renderGroupHeading ? renderGroupHeading(g.value) : g.value }),
|
|
2497
2619
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_combobox6.Combobox.Collection, { children: (item) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
@@ -2509,7 +2631,7 @@ function MultiSearchableSelect(props) {
|
|
|
2509
2631
|
] }),
|
|
2510
2632
|
index < groups.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ComboboxSeparator, {})
|
|
2511
2633
|
] }, g.value);
|
|
2512
|
-
} : (item) => {
|
|
2634
|
+
}) : ((item) => {
|
|
2513
2635
|
if (isCreatableSentinel(item)) {
|
|
2514
2636
|
return renderCreatableItem(item);
|
|
2515
2637
|
}
|
|
@@ -2526,7 +2648,7 @@ function MultiSearchableSelect(props) {
|
|
|
2526
2648
|
},
|
|
2527
2649
|
dataItem.id
|
|
2528
2650
|
);
|
|
2529
|
-
}
|
|
2651
|
+
})
|
|
2530
2652
|
}
|
|
2531
2653
|
)
|
|
2532
2654
|
]
|
|
@@ -2537,8 +2659,427 @@ function MultiSearchableSelect(props) {
|
|
|
2537
2659
|
)
|
|
2538
2660
|
] });
|
|
2539
2661
|
}
|
|
2662
|
+
|
|
2663
|
+
// src/v3/ActionMenu.tsx
|
|
2664
|
+
var React13 = __toESM(require("react"));
|
|
2665
|
+
var import_menu2 = require("@base-ui/react/menu");
|
|
2666
|
+
var import_seeds_react_radio3 = __toESM(require("@sproutsocial/seeds-react-radio"));
|
|
2667
|
+
var import_seeds_react_checkbox4 = __toESM(require("@sproutsocial/seeds-react-checkbox"));
|
|
2668
|
+
var import_seeds_react_icon5 = require("@sproutsocial/seeds-react-icon");
|
|
2669
|
+
|
|
2670
|
+
// src/v3/ActionMenuStyles.tsx
|
|
2671
|
+
var import_menu = require("@base-ui/react/menu");
|
|
2672
|
+
var import_styled_components8 = __toESM(require("styled-components"));
|
|
2673
|
+
var import_seeds_react_mixins3 = require("@sproutsocial/seeds-react-mixins");
|
|
2674
|
+
var ActionMenuTrigger = (0, import_styled_components8.default)(import_menu.Menu.Trigger)``;
|
|
2675
|
+
var ActionMenuPositioner = (0, import_styled_components8.default)(import_menu.Menu.Positioner)`
|
|
2676
|
+
min-width: var(--anchor-width);
|
|
2677
|
+
z-index: 7;
|
|
2678
|
+
`;
|
|
2679
|
+
var ActionMenuPopup = (0, import_styled_components8.default)(import_menu.Menu.Popup).attrs({
|
|
2680
|
+
"data-base-ui-swipe-ignore": ""
|
|
2681
|
+
})`
|
|
2682
|
+
font-family: ${({ theme }) => theme.fontFamily};
|
|
2683
|
+
background: ${({ theme }) => theme.colors.container.background.base};
|
|
2684
|
+
border: 1px solid ${({ theme }) => theme.colors.container.border.base};
|
|
2685
|
+
border-radius: ${({ theme }) => theme.radii[500]};
|
|
2686
|
+
box-shadow: ${({ theme }) => theme.shadows.low};
|
|
2687
|
+
outline: none;
|
|
2688
|
+
max-height: min(var(--available-height, 400px), 400px);
|
|
2689
|
+
overflow-y: auto;
|
|
2690
|
+
padding: ${({ theme }) => theme.space[300]};
|
|
2691
|
+
|
|
2692
|
+
&[data-open] {
|
|
2693
|
+
animation: action-menu-popup-in 120ms ease-out;
|
|
2694
|
+
}
|
|
2695
|
+
|
|
2696
|
+
&[data-closed] {
|
|
2697
|
+
animation: action-menu-popup-out 100ms ease-in;
|
|
2698
|
+
}
|
|
2699
|
+
|
|
2700
|
+
@keyframes action-menu-popup-in {
|
|
2701
|
+
from {
|
|
2702
|
+
opacity: 0;
|
|
2703
|
+
transform: scale(0.95);
|
|
2704
|
+
}
|
|
2705
|
+
to {
|
|
2706
|
+
opacity: 1;
|
|
2707
|
+
transform: scale(1);
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2710
|
+
|
|
2711
|
+
@keyframes action-menu-popup-out {
|
|
2712
|
+
from {
|
|
2713
|
+
opacity: 1;
|
|
2714
|
+
transform: scale(1);
|
|
2715
|
+
}
|
|
2716
|
+
to {
|
|
2717
|
+
opacity: 0;
|
|
2718
|
+
transform: scale(0.95);
|
|
2719
|
+
}
|
|
2720
|
+
}
|
|
2721
|
+
`;
|
|
2722
|
+
var ActionMenuGroup = (0, import_styled_components8.default)(import_menu.Menu.Group)`
|
|
2723
|
+
display: block;
|
|
2724
|
+
`;
|
|
2725
|
+
var ActionMenuGroupLabel = (0, import_styled_components8.default)(import_menu.Menu.GroupLabel)`
|
|
2726
|
+
padding: ${({ theme }) => `${theme.space[300]}`};
|
|
2727
|
+
font-size: ${({ theme }) => theme.typography[100].fontSize};
|
|
2728
|
+
color: ${({ theme }) => theme.colors.text.body};
|
|
2729
|
+
`;
|
|
2730
|
+
var ActionMenuSeparator = (0, import_styled_components8.default)(import_menu.Menu.Separator)`
|
|
2731
|
+
height: 1px;
|
|
2732
|
+
margin: ${({ theme }) => `${theme.space[300]} -${theme.space[300]}`};
|
|
2733
|
+
background: ${({ theme }) => theme.colors.container.border.base};
|
|
2734
|
+
`;
|
|
2735
|
+
var menuItemStyles = import_styled_components8.css`
|
|
2736
|
+
box-sizing: border-box;
|
|
2737
|
+
display: block;
|
|
2738
|
+
width: 100%;
|
|
2739
|
+
border-radius: ${({ theme }) => theme.radii[500]};
|
|
2740
|
+
background-color: ${({ theme }) => theme.colors.listItem.background.base};
|
|
2741
|
+
border: 1px solid ${({ theme }) => theme.colors.listItem.background.base};
|
|
2742
|
+
color: ${({ theme }) => theme.colors.text.body};
|
|
2743
|
+
font-family: ${({ theme }) => theme.fontFamily};
|
|
2744
|
+
font-weight: ${({ theme }) => theme.fontWeights.normal};
|
|
2745
|
+
text-align: left;
|
|
2746
|
+
text-decoration: none;
|
|
2747
|
+
padding: ${({ theme }) => theme.space[300]};
|
|
2748
|
+
outline: 0;
|
|
2749
|
+
${({ theme }) => theme.typography[200]};
|
|
2750
|
+
transition: all ${({ theme }) => theme.duration.fast};
|
|
2751
|
+
cursor: pointer;
|
|
2752
|
+
user-select: none;
|
|
2753
|
+
|
|
2754
|
+
&[data-highlighted] {
|
|
2755
|
+
border-color: ${({ theme }) => theme.colors.listItem.border.base};
|
|
2756
|
+
background-color: ${({ theme }) => theme.colors.listItem.background.hover};
|
|
2757
|
+
color: ${({ theme }) => theme.colors.text.body};
|
|
2758
|
+
text-decoration: none;
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
&[data-disabled] {
|
|
2762
|
+
cursor: not-allowed;
|
|
2763
|
+
opacity: 0.4;
|
|
2764
|
+
}
|
|
2765
|
+
`;
|
|
2766
|
+
var StyledMenuItem = (0, import_styled_components8.default)(import_menu.Menu.Item)`
|
|
2767
|
+
${menuItemStyles}
|
|
2768
|
+
`;
|
|
2769
|
+
var StyledCheckboxItem = (0, import_styled_components8.default)(import_menu.Menu.CheckboxItem)`
|
|
2770
|
+
${menuItemStyles}
|
|
2771
|
+
display: flex;
|
|
2772
|
+
align-items: center;
|
|
2773
|
+
gap: ${({ theme }) => theme.space[300]};
|
|
2774
|
+
`;
|
|
2775
|
+
var StyledRadioItem = (0, import_styled_components8.default)(import_menu.Menu.RadioItem)`
|
|
2776
|
+
${menuItemStyles}
|
|
2777
|
+
display: flex;
|
|
2778
|
+
align-items: center;
|
|
2779
|
+
gap: ${({ theme }) => theme.space[300]};
|
|
2780
|
+
`;
|
|
2781
|
+
var StyledCheckboxItemIndicator = (0, import_styled_components8.default)(import_menu.Menu.CheckboxItemIndicator)`
|
|
2782
|
+
display: flex;
|
|
2783
|
+
align-items: center;
|
|
2784
|
+
width: 16px;
|
|
2785
|
+
color: ${({ theme }) => theme.colors.text.body};
|
|
2786
|
+
`;
|
|
2787
|
+
var StyledRadioItemIndicator = (0, import_styled_components8.default)(import_menu.Menu.RadioItemIndicator)`
|
|
2788
|
+
display: flex;
|
|
2789
|
+
align-items: center;
|
|
2790
|
+
width: 16px;
|
|
2791
|
+
color: ${({ theme }) => theme.colors.text.body};
|
|
2792
|
+
`;
|
|
2793
|
+
var StyledSubmenuTrigger = (0, import_styled_components8.default)(import_menu.Menu.SubmenuTrigger)`
|
|
2794
|
+
${menuItemStyles}
|
|
2795
|
+
display: flex;
|
|
2796
|
+
align-items: center;
|
|
2797
|
+
gap: ${({ theme }) => theme.space[300]};
|
|
2798
|
+
justify-content: space-between;
|
|
2799
|
+
|
|
2800
|
+
&[data-popup-open] {
|
|
2801
|
+
border-color: ${({ theme }) => theme.colors.listItem.border.base};
|
|
2802
|
+
background-color: ${({ theme }) => theme.colors.listItem.background.hover};
|
|
2803
|
+
}
|
|
2804
|
+
`;
|
|
2805
|
+
var StyledLinkItem = (0, import_styled_components8.default)(import_menu.Menu.LinkItem)`
|
|
2806
|
+
${menuItemStyles}
|
|
2807
|
+
`;
|
|
2808
|
+
|
|
2809
|
+
// src/v3/ActionMenu.tsx
|
|
2810
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2811
|
+
function ActionMenu({
|
|
2812
|
+
trigger,
|
|
2813
|
+
children,
|
|
2814
|
+
open,
|
|
2815
|
+
defaultOpen,
|
|
2816
|
+
onOpenChange,
|
|
2817
|
+
disabled
|
|
2818
|
+
}) {
|
|
2819
|
+
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
2820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2821
|
+
import_menu2.Menu.Root,
|
|
2822
|
+
{
|
|
2823
|
+
open,
|
|
2824
|
+
defaultOpen,
|
|
2825
|
+
onOpenChange,
|
|
2826
|
+
children: [
|
|
2827
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
2828
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ActionMenuTrigger, { render: trigger, disabled }),
|
|
2829
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_menu2.Menu.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ActionMenuPositioner, { sideOffset: 8, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ActionMenuPopup, { children }) }) })
|
|
2830
|
+
]
|
|
2831
|
+
}
|
|
2832
|
+
);
|
|
2833
|
+
}
|
|
2834
|
+
function MenuGroup({
|
|
2835
|
+
children,
|
|
2836
|
+
label,
|
|
2837
|
+
showSeparator = false
|
|
2838
|
+
}) {
|
|
2839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
2840
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(ActionMenuGroup, { children: [
|
|
2841
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ActionMenuGroupLabel, { children: label }),
|
|
2842
|
+
children
|
|
2843
|
+
] }),
|
|
2844
|
+
showSeparator && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ActionMenuSeparator, {})
|
|
2845
|
+
] });
|
|
2846
|
+
}
|
|
2847
|
+
function MenuRadioGroup({
|
|
2848
|
+
children,
|
|
2849
|
+
value,
|
|
2850
|
+
defaultValue,
|
|
2851
|
+
onValueChange
|
|
2852
|
+
}) {
|
|
2853
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2854
|
+
import_menu2.Menu.RadioGroup,
|
|
2855
|
+
{
|
|
2856
|
+
value,
|
|
2857
|
+
defaultValue,
|
|
2858
|
+
onValueChange,
|
|
2859
|
+
children
|
|
2860
|
+
}
|
|
2861
|
+
);
|
|
2862
|
+
}
|
|
2863
|
+
function MenuItem(props) {
|
|
2864
|
+
const generatedId = React13.useId();
|
|
2865
|
+
if (props.type === "checkbox") {
|
|
2866
|
+
const {
|
|
2867
|
+
children: children2,
|
|
2868
|
+
checked,
|
|
2869
|
+
defaultChecked,
|
|
2870
|
+
onCheckedChange,
|
|
2871
|
+
disabled: disabled2,
|
|
2872
|
+
closeOnClick: closeOnClick2 = false,
|
|
2873
|
+
id
|
|
2874
|
+
} = props;
|
|
2875
|
+
const itemId = id ?? `checkbox-menu-item-${generatedId}`;
|
|
2876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2877
|
+
StyledCheckboxItem,
|
|
2878
|
+
{
|
|
2879
|
+
checked,
|
|
2880
|
+
defaultChecked,
|
|
2881
|
+
onCheckedChange,
|
|
2882
|
+
disabled: disabled2,
|
|
2883
|
+
closeOnClick: closeOnClick2,
|
|
2884
|
+
children: [
|
|
2885
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2886
|
+
StyledCheckboxItemIndicator,
|
|
2887
|
+
{
|
|
2888
|
+
keepMounted: true,
|
|
2889
|
+
render: (_indicatorProps, state) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2890
|
+
import_seeds_react_checkbox4.default,
|
|
2891
|
+
{
|
|
2892
|
+
checked: state.checked,
|
|
2893
|
+
onChange: () => {
|
|
2894
|
+
},
|
|
2895
|
+
tabIndex: -1,
|
|
2896
|
+
id: itemId,
|
|
2897
|
+
name: "menu-checkbox-item"
|
|
2898
|
+
}
|
|
2899
|
+
)
|
|
2900
|
+
}
|
|
2901
|
+
),
|
|
2902
|
+
children2
|
|
2903
|
+
]
|
|
2904
|
+
}
|
|
2905
|
+
);
|
|
2906
|
+
}
|
|
2907
|
+
if (props.type === "radio") {
|
|
2908
|
+
const { children: children2, value, disabled: disabled2, closeOnClick: closeOnClick2 = false } = props;
|
|
2909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2910
|
+
StyledRadioItem,
|
|
2911
|
+
{
|
|
2912
|
+
value,
|
|
2913
|
+
disabled: disabled2,
|
|
2914
|
+
closeOnClick: closeOnClick2,
|
|
2915
|
+
children: [
|
|
2916
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2917
|
+
StyledRadioItemIndicator,
|
|
2918
|
+
{
|
|
2919
|
+
keepMounted: true,
|
|
2920
|
+
render: (_indicatorProps, state) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2921
|
+
import_seeds_react_radio3.default,
|
|
2922
|
+
{
|
|
2923
|
+
checked: state.checked,
|
|
2924
|
+
onChange: () => {
|
|
2925
|
+
},
|
|
2926
|
+
tabIndex: -1,
|
|
2927
|
+
id: `radio-menu-item-${value}`,
|
|
2928
|
+
name: "menu-radio-item"
|
|
2929
|
+
}
|
|
2930
|
+
)
|
|
2931
|
+
}
|
|
2932
|
+
),
|
|
2933
|
+
children2
|
|
2934
|
+
]
|
|
2935
|
+
}
|
|
2936
|
+
);
|
|
2937
|
+
}
|
|
2938
|
+
const {
|
|
2939
|
+
children,
|
|
2940
|
+
onClick,
|
|
2941
|
+
disabled,
|
|
2942
|
+
closeOnClick = true,
|
|
2943
|
+
href,
|
|
2944
|
+
target
|
|
2945
|
+
} = props;
|
|
2946
|
+
if (href) {
|
|
2947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(StyledLinkItem, { href, target, closeOnClick, children });
|
|
2948
|
+
}
|
|
2949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2950
|
+
StyledMenuItem,
|
|
2951
|
+
{
|
|
2952
|
+
onClick,
|
|
2953
|
+
disabled,
|
|
2954
|
+
closeOnClick,
|
|
2955
|
+
children
|
|
2956
|
+
}
|
|
2957
|
+
);
|
|
2958
|
+
}
|
|
2959
|
+
function MenuSub({
|
|
2960
|
+
trigger,
|
|
2961
|
+
children,
|
|
2962
|
+
open,
|
|
2963
|
+
defaultOpen,
|
|
2964
|
+
onOpenChange,
|
|
2965
|
+
closeParentOnEsc = false
|
|
2966
|
+
}) {
|
|
2967
|
+
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
2968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2969
|
+
import_menu2.Menu.SubmenuRoot,
|
|
2970
|
+
{
|
|
2971
|
+
open,
|
|
2972
|
+
defaultOpen,
|
|
2973
|
+
onOpenChange,
|
|
2974
|
+
closeParentOnEsc,
|
|
2975
|
+
children: [
|
|
2976
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
2977
|
+
trigger,
|
|
2978
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_menu2.Menu.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ActionMenuPositioner, { sideOffset: getOffset, alignOffset: getOffset, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ActionMenuPopup, { children }) }) })
|
|
2979
|
+
]
|
|
2980
|
+
}
|
|
2981
|
+
);
|
|
2982
|
+
}
|
|
2983
|
+
function getOffset({ side }) {
|
|
2984
|
+
return side === "top" || side === "bottom" ? 4 : -8;
|
|
2985
|
+
}
|
|
2986
|
+
function MenuSubTrigger({
|
|
2987
|
+
children,
|
|
2988
|
+
disabled,
|
|
2989
|
+
label,
|
|
2990
|
+
openOnHover = true
|
|
2991
|
+
}) {
|
|
2992
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2993
|
+
StyledSubmenuTrigger,
|
|
2994
|
+
{
|
|
2995
|
+
disabled,
|
|
2996
|
+
label,
|
|
2997
|
+
openOnHover,
|
|
2998
|
+
children: [
|
|
2999
|
+
children,
|
|
3000
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_seeds_react_icon5.Icon, { name: "chevron-right-outline", fixedWidth: true, "aria-hidden": true })
|
|
3001
|
+
]
|
|
3002
|
+
}
|
|
3003
|
+
);
|
|
3004
|
+
}
|
|
3005
|
+
|
|
3006
|
+
// src/v3/MenuButton.tsx
|
|
3007
|
+
var React14 = require("react");
|
|
3008
|
+
var import_seeds_react_button2 = require("@sproutsocial/seeds-react-button");
|
|
3009
|
+
var import_seeds_react_icon6 = require("@sproutsocial/seeds-react-icon");
|
|
3010
|
+
|
|
3011
|
+
// src/v3/MenuButtonStyles.tsx
|
|
3012
|
+
var import_styled_components9 = __toESM(require("styled-components"));
|
|
3013
|
+
var import_seeds_react_button = require("@sproutsocial/seeds-react-button");
|
|
3014
|
+
var MenuButtonContainer = import_styled_components9.default.div`
|
|
3015
|
+
display: inline-flex;
|
|
3016
|
+
gap: 1px;
|
|
3017
|
+
`;
|
|
3018
|
+
var MainButton = (0, import_styled_components9.default)(import_seeds_react_button.Button)`
|
|
3019
|
+
&& {
|
|
3020
|
+
border-top-right-radius: 0;
|
|
3021
|
+
border-bottom-right-radius: 0;
|
|
3022
|
+
}
|
|
3023
|
+
`;
|
|
3024
|
+
var TriggerButton = (0, import_styled_components9.default)(import_seeds_react_button.Button)`
|
|
3025
|
+
&& {
|
|
3026
|
+
border-top-left-radius: 0;
|
|
3027
|
+
border-bottom-left-radius: 0;
|
|
3028
|
+
}
|
|
3029
|
+
|
|
3030
|
+
.Icon-svg {
|
|
3031
|
+
transition: transform ${({ theme }) => theme.duration.fast} ease;
|
|
3032
|
+
}
|
|
3033
|
+
|
|
3034
|
+
&[data-popup-open] .Icon-svg {
|
|
3035
|
+
transform: rotate(180deg);
|
|
3036
|
+
}
|
|
3037
|
+
`;
|
|
3038
|
+
|
|
3039
|
+
// src/v3/MenuButton.tsx
|
|
3040
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
3041
|
+
function MenuButton({
|
|
3042
|
+
actionMenu,
|
|
3043
|
+
appearance = "primary",
|
|
3044
|
+
size,
|
|
3045
|
+
disabled,
|
|
3046
|
+
menuButtonAriaLabel,
|
|
3047
|
+
children,
|
|
3048
|
+
...rest
|
|
3049
|
+
}) {
|
|
3050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(MenuButtonContainer, { children: [
|
|
3051
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3052
|
+
MainButton,
|
|
3053
|
+
{
|
|
3054
|
+
appearance,
|
|
3055
|
+
size,
|
|
3056
|
+
disabled,
|
|
3057
|
+
...rest,
|
|
3058
|
+
children
|
|
3059
|
+
}
|
|
3060
|
+
),
|
|
3061
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3062
|
+
ActionMenu,
|
|
3063
|
+
{
|
|
3064
|
+
disabled,
|
|
3065
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3066
|
+
TriggerButton,
|
|
3067
|
+
{
|
|
3068
|
+
appearance,
|
|
3069
|
+
size,
|
|
3070
|
+
disabled,
|
|
3071
|
+
ariaLabel: menuButtonAriaLabel,
|
|
3072
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_seeds_react_icon6.Icon, { name: "chevron-down-outline", fixedWidth: true, "aria-hidden": true })
|
|
3073
|
+
}
|
|
3074
|
+
),
|
|
3075
|
+
children: actionMenu
|
|
3076
|
+
}
|
|
3077
|
+
)
|
|
3078
|
+
] });
|
|
3079
|
+
}
|
|
2540
3080
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2541
3081
|
0 && (module.exports = {
|
|
3082
|
+
ActionMenu,
|
|
2542
3083
|
ComboboxActionButtons,
|
|
2543
3084
|
ComboboxClear,
|
|
2544
3085
|
ComboboxEmpty,
|
|
@@ -2561,6 +3102,12 @@ function MultiSearchableSelect(props) {
|
|
|
2561
3102
|
ComboboxTokenInput,
|
|
2562
3103
|
ComboboxTokenInputGroup,
|
|
2563
3104
|
ComboboxTrigger,
|
|
3105
|
+
MenuButton,
|
|
3106
|
+
MenuGroup,
|
|
3107
|
+
MenuItem,
|
|
3108
|
+
MenuRadioGroup,
|
|
3109
|
+
MenuSub,
|
|
3110
|
+
MenuSubTrigger,
|
|
2564
3111
|
MultiCombobox,
|
|
2565
3112
|
MultiSearchableSelect,
|
|
2566
3113
|
MultiSelect,
|