@sproutsocial/seeds-react-menu 1.12.3 → 1.13.0
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 +13 -13
- package/CHANGELOG.md +10 -0
- package/dist/esm/v3/index.js +368 -14
- 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 +156 -50
- package/dist/v3/index.d.ts +156 -50
- package/dist/v3/index.js +374 -14
- package/dist/v3/index.js.map +1 -1
- package/package.json +1 -1
- package/src/v3/ActionMenu.stories.tsx +260 -0
- package/src/v3/ActionMenu.tsx +345 -0
- package/src/v3/ActionMenuStyles.tsx +153 -0
- package/src/v3/Common/SelectStyles.tsx +4 -3
- package/src/v3/ModalStories.stories.tsx +159 -0
- package/src/v3/MultiCombobox.stories.tsx +17 -0
- package/src/v3/MultiCombobox.tsx +3 -1
- package/src/v3/MultiSearchableSelect.stories.tsx +18 -0
- package/src/v3/MultiSearchableSelect.tsx +3 -1
- package/src/v3/MultiSelect.stories.tsx +17 -0
- package/src/v3/MultiSelect.tsx +3 -2
- package/src/v3/SingleCombobox.stories.tsx +17 -0
- package/src/v3/SingleCombobox.tsx +3 -1
- package/src/v3/SingleSearchableSelect.stories.tsx +18 -0
- package/src/v3/SingleSearchableSelect.tsx +3 -1
- package/src/v3/SingleSelect.stories.tsx +17 -0
- package/src/v3/SingleSelect.tsx +3 -2
- package/src/v3/index.ts +1 -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,11 @@ __export(v3_exports, {
|
|
|
52
53
|
ComboboxTokenInput: () => ComboboxTokenInput,
|
|
53
54
|
ComboboxTokenInputGroup: () => ComboboxTokenInputGroup,
|
|
54
55
|
ComboboxTrigger: () => ComboboxTrigger,
|
|
56
|
+
MenuGroup: () => MenuGroup,
|
|
57
|
+
MenuItem: () => MenuItem,
|
|
58
|
+
MenuRadioGroup: () => MenuRadioGroup,
|
|
59
|
+
MenuSub: () => MenuSub,
|
|
60
|
+
MenuSubTrigger: () => MenuSubTrigger,
|
|
55
61
|
MultiCombobox: () => MultiCombobox,
|
|
56
62
|
MultiSearchableSelect: () => MultiSearchableSelect,
|
|
57
63
|
MultiSelect: () => MultiSelect,
|
|
@@ -210,10 +216,10 @@ var import_select2 = require("@base-ui/react/select");
|
|
|
210
216
|
var import_styled_components2 = __toESM(require("styled-components"));
|
|
211
217
|
var import_seeds_react_mixins = require("@sproutsocial/seeds-react-mixins");
|
|
212
218
|
var Field = import_styled_components2.default.div`
|
|
213
|
-
display: flex;
|
|
219
|
+
display: ${({ $fullWidth }) => $fullWidth === false ? "inline-flex" : "flex"};
|
|
214
220
|
flex-direction: column;
|
|
215
221
|
gap: ${({ theme }) => theme.space[200]};
|
|
216
|
-
width: 100%;
|
|
222
|
+
${({ $fullWidth }) => $fullWidth !== false && "width: 100%;"}
|
|
217
223
|
`;
|
|
218
224
|
var SelectLabel = (0, import_styled_components2.default)(import_select2.Select.Label)`
|
|
219
225
|
font-size: ${({ theme }) => theme.typography[200].fontSize};
|
|
@@ -363,7 +369,7 @@ var StyledValue = (0, import_styled_components4.default)(import_select3.Select.V
|
|
|
363
369
|
}
|
|
364
370
|
`;
|
|
365
371
|
function SingleSelect(props) {
|
|
366
|
-
const { id, placeholder, includePlaceholderItem } = props;
|
|
372
|
+
const { id, placeholder, includePlaceholderItem, fullWidth = true } = props;
|
|
367
373
|
const ariaDescribedBy = props["aria-describedby"];
|
|
368
374
|
const isChildrenMode = "children" in props && props.children != null;
|
|
369
375
|
const selectedItemId = props.selectedItemId;
|
|
@@ -411,7 +417,7 @@ function SingleSelect(props) {
|
|
|
411
417
|
}
|
|
412
418
|
}
|
|
413
419
|
}
|
|
414
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Field, { children: [
|
|
420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Field, { $fullWidth: fullWidth, children: [
|
|
415
421
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
416
422
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
417
423
|
import_select3.Select.Root,
|
|
@@ -493,7 +499,7 @@ var Placeholder = import_styled_components5.default.div`
|
|
|
493
499
|
margin: 2px 8px 0px 0px;
|
|
494
500
|
`;
|
|
495
501
|
function MultiSelect(props) {
|
|
496
|
-
const { id, placeholder = "Select..." } = props;
|
|
502
|
+
const { id, placeholder = "Select...", fullWidth = true } = props;
|
|
497
503
|
const ariaDescribedBy = props["aria-describedby"];
|
|
498
504
|
const isChildrenMode = "children" in props && props.children != null;
|
|
499
505
|
const data = isChildrenMode ? [] : props.data;
|
|
@@ -539,7 +545,7 @@ function MultiSelect(props) {
|
|
|
539
545
|
onSelectedItemIdsChange(ids);
|
|
540
546
|
}
|
|
541
547
|
}
|
|
542
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Field, { children: [
|
|
548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Field, { $fullWidth: fullWidth, children: [
|
|
543
549
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
544
550
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
545
551
|
import_select4.Select.Root,
|
|
@@ -1348,7 +1354,8 @@ function SingleCombobox(props) {
|
|
|
1348
1354
|
id,
|
|
1349
1355
|
placeholder = "Search...",
|
|
1350
1356
|
emptyText = "No results found.",
|
|
1351
|
-
filter
|
|
1357
|
+
filter,
|
|
1358
|
+
fullWidth = true
|
|
1352
1359
|
} = props;
|
|
1353
1360
|
const ariaDescribedBy = props["aria-describedby"];
|
|
1354
1361
|
const isChildrenMode = "children" in props && props.children != null;
|
|
@@ -1390,7 +1397,7 @@ function SingleCombobox(props) {
|
|
|
1390
1397
|
() => groupBy ? groupItems(data, groupBy) : null,
|
|
1391
1398
|
[data, groupBy]
|
|
1392
1399
|
);
|
|
1393
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Field, { children: [
|
|
1400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Field, { $fullWidth: fullWidth, children: [
|
|
1394
1401
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
1395
1402
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1396
1403
|
import_combobox3.Combobox.Root,
|
|
@@ -1528,7 +1535,8 @@ function MultiCombobox(props) {
|
|
|
1528
1535
|
loadingText = "Loading...",
|
|
1529
1536
|
filter,
|
|
1530
1537
|
inputValue,
|
|
1531
|
-
onInputValueChange
|
|
1538
|
+
onInputValueChange,
|
|
1539
|
+
fullWidth = true
|
|
1532
1540
|
} = props;
|
|
1533
1541
|
const ariaDescribedBy = props["aria-describedby"];
|
|
1534
1542
|
const isChildrenMode = "children" in props && props.children != null;
|
|
@@ -1743,7 +1751,7 @@ function MultiCombobox(props) {
|
|
|
1743
1751
|
const rootItems = creatableSentinel && Array.isArray(baseItems) ? [...baseItems, creatableSentinel] : baseItems;
|
|
1744
1752
|
const hasSentinels = selectAll || selectHeadings;
|
|
1745
1753
|
const rootValue = hasSentinels ? [...value] : value;
|
|
1746
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Field, { children: [
|
|
1754
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Field, { $fullWidth: fullWidth, children: [
|
|
1747
1755
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
1748
1756
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1749
1757
|
import_combobox4.Combobox.Root,
|
|
@@ -1956,7 +1964,8 @@ function SingleSearchableSelect(props) {
|
|
|
1956
1964
|
emptyText = "No results found.",
|
|
1957
1965
|
isLoading = false,
|
|
1958
1966
|
loadingText = "Loading...",
|
|
1959
|
-
filter
|
|
1967
|
+
filter,
|
|
1968
|
+
fullWidth = true
|
|
1960
1969
|
} = props;
|
|
1961
1970
|
const ariaDescribedBy = props["aria-describedby"];
|
|
1962
1971
|
const isChildrenMode = "children" in props && props.children != null;
|
|
@@ -1998,7 +2007,7 @@ function SingleSearchableSelect(props) {
|
|
|
1998
2007
|
() => groupBy ? groupItems(data, groupBy) : null,
|
|
1999
2008
|
[data, groupBy]
|
|
2000
2009
|
);
|
|
2001
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Field, { children: [
|
|
2010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Field, { $fullWidth: fullWidth, children: [
|
|
2002
2011
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
2003
2012
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2004
2013
|
import_combobox5.Combobox.Root,
|
|
@@ -2157,7 +2166,8 @@ function MultiSearchableSelect(props) {
|
|
|
2157
2166
|
emptyText = "No results found.",
|
|
2158
2167
|
isLoading = false,
|
|
2159
2168
|
loadingText = "Loading...",
|
|
2160
|
-
filter
|
|
2169
|
+
filter,
|
|
2170
|
+
fullWidth = true
|
|
2161
2171
|
} = props;
|
|
2162
2172
|
const ariaDescribedBy = props["aria-describedby"];
|
|
2163
2173
|
const isChildrenMode = "children" in props && props.children != null;
|
|
@@ -2358,7 +2368,7 @@ function MultiSearchableSelect(props) {
|
|
|
2358
2368
|
const rootItems = creatableSentinel && Array.isArray(baseItems) ? [...baseItems, creatableSentinel] : baseItems;
|
|
2359
2369
|
const hasSentinels = selectAll || selectHeadings;
|
|
2360
2370
|
const rootValue = hasSentinels ? [...value] : value;
|
|
2361
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Field, { children: [
|
|
2371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Field, { $fullWidth: fullWidth, children: [
|
|
2362
2372
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
2363
2373
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
2364
2374
|
import_combobox6.Combobox.Root,
|
|
@@ -2537,8 +2547,353 @@ function MultiSearchableSelect(props) {
|
|
|
2537
2547
|
)
|
|
2538
2548
|
] });
|
|
2539
2549
|
}
|
|
2550
|
+
|
|
2551
|
+
// src/v3/ActionMenu.tsx
|
|
2552
|
+
var React12 = __toESM(require("react"));
|
|
2553
|
+
var import_menu2 = require("@base-ui/react/menu");
|
|
2554
|
+
var import_seeds_react_radio3 = __toESM(require("@sproutsocial/seeds-react-radio"));
|
|
2555
|
+
var import_seeds_react_checkbox4 = __toESM(require("@sproutsocial/seeds-react-checkbox"));
|
|
2556
|
+
var import_seeds_react_icon5 = require("@sproutsocial/seeds-react-icon");
|
|
2557
|
+
|
|
2558
|
+
// src/v3/ActionMenuStyles.tsx
|
|
2559
|
+
var import_menu = require("@base-ui/react/menu");
|
|
2560
|
+
var import_styled_components8 = __toESM(require("styled-components"));
|
|
2561
|
+
var import_seeds_react_mixins3 = require("@sproutsocial/seeds-react-mixins");
|
|
2562
|
+
var ActionMenuTrigger = (0, import_styled_components8.default)(import_menu.Menu.Trigger)``;
|
|
2563
|
+
var ActionMenuPositioner = (0, import_styled_components8.default)(import_menu.Menu.Positioner)`
|
|
2564
|
+
min-width: var(--anchor-width);
|
|
2565
|
+
z-index: 7;
|
|
2566
|
+
`;
|
|
2567
|
+
var ActionMenuPopup = (0, import_styled_components8.default)(import_menu.Menu.Popup)`
|
|
2568
|
+
font-family: ${({ theme }) => theme.fontFamily};
|
|
2569
|
+
background: ${({ theme }) => theme.colors.container.background.base};
|
|
2570
|
+
border: 1px solid ${({ theme }) => theme.colors.container.border.base};
|
|
2571
|
+
border-radius: ${({ theme }) => theme.radii[500]};
|
|
2572
|
+
box-shadow: ${({ theme }) => theme.shadows.low};
|
|
2573
|
+
outline: none;
|
|
2574
|
+
max-height: min(var(--base-ui-available-height, 400px), 400px);
|
|
2575
|
+
overflow-y: auto;
|
|
2576
|
+
padding: ${({ theme }) => theme.space[200]};
|
|
2577
|
+
|
|
2578
|
+
&[data-open] {
|
|
2579
|
+
animation: action-menu-popup-in 120ms ease-out;
|
|
2580
|
+
}
|
|
2581
|
+
|
|
2582
|
+
&[data-closed] {
|
|
2583
|
+
animation: action-menu-popup-out 100ms ease-in;
|
|
2584
|
+
}
|
|
2585
|
+
|
|
2586
|
+
@keyframes action-menu-popup-in {
|
|
2587
|
+
from {
|
|
2588
|
+
opacity: 0;
|
|
2589
|
+
transform: scale(0.95);
|
|
2590
|
+
}
|
|
2591
|
+
to {
|
|
2592
|
+
opacity: 1;
|
|
2593
|
+
transform: scale(1);
|
|
2594
|
+
}
|
|
2595
|
+
}
|
|
2596
|
+
|
|
2597
|
+
@keyframes action-menu-popup-out {
|
|
2598
|
+
from {
|
|
2599
|
+
opacity: 1;
|
|
2600
|
+
transform: scale(1);
|
|
2601
|
+
}
|
|
2602
|
+
to {
|
|
2603
|
+
opacity: 0;
|
|
2604
|
+
transform: scale(0.95);
|
|
2605
|
+
}
|
|
2606
|
+
}
|
|
2607
|
+
`;
|
|
2608
|
+
var ActionMenuGroup = (0, import_styled_components8.default)(import_menu.Menu.Group)`
|
|
2609
|
+
display: block;
|
|
2610
|
+
`;
|
|
2611
|
+
var ActionMenuGroupLabel = (0, import_styled_components8.default)(import_menu.Menu.GroupLabel)`
|
|
2612
|
+
padding: ${({ theme }) => `${theme.space[300]} ${theme.space[300]} ${theme.space[200]}`};
|
|
2613
|
+
font-size: ${({ theme }) => theme.typography[100].fontSize};
|
|
2614
|
+
font-weight: ${({ theme }) => theme.fontWeights.semibold};
|
|
2615
|
+
text-transform: uppercase;
|
|
2616
|
+
letter-spacing: 0.05em;
|
|
2617
|
+
color: ${({ theme }) => theme.colors.text.subtext};
|
|
2618
|
+
`;
|
|
2619
|
+
var ActionMenuSeparator = (0, import_styled_components8.default)(import_menu.Menu.Separator)`
|
|
2620
|
+
height: 1px;
|
|
2621
|
+
margin: ${({ theme }) => `${theme.space[200]} ${theme.space[300]}`};
|
|
2622
|
+
background: ${({ theme }) => theme.colors.container.border.base};
|
|
2623
|
+
`;
|
|
2624
|
+
var menuItemStyles = import_styled_components8.css`
|
|
2625
|
+
box-sizing: border-box;
|
|
2626
|
+
display: block;
|
|
2627
|
+
width: 100%;
|
|
2628
|
+
border-radius: ${({ theme }) => theme.radii[500]};
|
|
2629
|
+
background-color: ${({ theme }) => theme.colors.listItem.background.base};
|
|
2630
|
+
border: 1px solid ${({ theme }) => theme.colors.listItem.background.base};
|
|
2631
|
+
color: ${({ theme }) => theme.colors.text.body};
|
|
2632
|
+
font-family: ${({ theme }) => theme.fontFamily};
|
|
2633
|
+
font-weight: ${({ theme }) => theme.fontWeights.normal};
|
|
2634
|
+
text-align: left;
|
|
2635
|
+
text-decoration: none;
|
|
2636
|
+
padding: ${({ theme }) => theme.space[300]};
|
|
2637
|
+
outline: 0;
|
|
2638
|
+
${({ theme }) => theme.typography[200]};
|
|
2639
|
+
transition: all ${({ theme }) => theme.duration.fast};
|
|
2640
|
+
cursor: pointer;
|
|
2641
|
+
user-select: none;
|
|
2642
|
+
|
|
2643
|
+
&[data-highlighted] {
|
|
2644
|
+
border-color: ${({ theme }) => theme.colors.listItem.border.base};
|
|
2645
|
+
background-color: ${({ theme }) => theme.colors.listItem.background.hover};
|
|
2646
|
+
color: ${({ theme }) => theme.colors.text.body};
|
|
2647
|
+
text-decoration: none;
|
|
2648
|
+
}
|
|
2649
|
+
|
|
2650
|
+
&[data-disabled] {
|
|
2651
|
+
cursor: not-allowed;
|
|
2652
|
+
opacity: 0.4;
|
|
2653
|
+
}
|
|
2654
|
+
`;
|
|
2655
|
+
var StyledMenuItem = (0, import_styled_components8.default)(import_menu.Menu.Item)`
|
|
2656
|
+
${menuItemStyles}
|
|
2657
|
+
`;
|
|
2658
|
+
var StyledCheckboxItem = (0, import_styled_components8.default)(import_menu.Menu.CheckboxItem)`
|
|
2659
|
+
${menuItemStyles}
|
|
2660
|
+
display: flex;
|
|
2661
|
+
align-items: center;
|
|
2662
|
+
gap: ${({ theme }) => theme.space[300]};
|
|
2663
|
+
`;
|
|
2664
|
+
var StyledRadioItem = (0, import_styled_components8.default)(import_menu.Menu.RadioItem)`
|
|
2665
|
+
${menuItemStyles}
|
|
2666
|
+
display: flex;
|
|
2667
|
+
align-items: center;
|
|
2668
|
+
gap: ${({ theme }) => theme.space[300]};
|
|
2669
|
+
`;
|
|
2670
|
+
var StyledCheckboxItemIndicator = (0, import_styled_components8.default)(import_menu.Menu.CheckboxItemIndicator)`
|
|
2671
|
+
display: flex;
|
|
2672
|
+
align-items: center;
|
|
2673
|
+
width: 16px;
|
|
2674
|
+
color: ${({ theme }) => theme.colors.text.body};
|
|
2675
|
+
`;
|
|
2676
|
+
var StyledRadioItemIndicator = (0, import_styled_components8.default)(import_menu.Menu.RadioItemIndicator)`
|
|
2677
|
+
display: flex;
|
|
2678
|
+
align-items: center;
|
|
2679
|
+
width: 16px;
|
|
2680
|
+
color: ${({ theme }) => theme.colors.text.body};
|
|
2681
|
+
`;
|
|
2682
|
+
var StyledSubmenuTrigger = (0, import_styled_components8.default)(import_menu.Menu.SubmenuTrigger)`
|
|
2683
|
+
${menuItemStyles}
|
|
2684
|
+
display: flex;
|
|
2685
|
+
align-items: center;
|
|
2686
|
+
gap: ${({ theme }) => theme.space[300]};
|
|
2687
|
+
justify-content: space-between;
|
|
2688
|
+
|
|
2689
|
+
&[data-popup-open] {
|
|
2690
|
+
border-color: ${({ theme }) => theme.colors.listItem.border.base};
|
|
2691
|
+
background-color: ${({ theme }) => theme.colors.listItem.background.hover};
|
|
2692
|
+
}
|
|
2693
|
+
`;
|
|
2694
|
+
var StyledLinkItem = (0, import_styled_components8.default)(import_menu.Menu.LinkItem)`
|
|
2695
|
+
${menuItemStyles}
|
|
2696
|
+
`;
|
|
2697
|
+
|
|
2698
|
+
// src/v3/ActionMenu.tsx
|
|
2699
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2700
|
+
function ActionMenu({
|
|
2701
|
+
trigger,
|
|
2702
|
+
children,
|
|
2703
|
+
open,
|
|
2704
|
+
defaultOpen,
|
|
2705
|
+
onOpenChange,
|
|
2706
|
+
disabled
|
|
2707
|
+
}) {
|
|
2708
|
+
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
2709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2710
|
+
import_menu2.Menu.Root,
|
|
2711
|
+
{
|
|
2712
|
+
open,
|
|
2713
|
+
defaultOpen,
|
|
2714
|
+
onOpenChange,
|
|
2715
|
+
children: [
|
|
2716
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
2717
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ActionMenuTrigger, { render: trigger, disabled }),
|
|
2718
|
+
/* @__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 }) }) })
|
|
2719
|
+
]
|
|
2720
|
+
}
|
|
2721
|
+
);
|
|
2722
|
+
}
|
|
2723
|
+
function MenuGroup({
|
|
2724
|
+
children,
|
|
2725
|
+
label,
|
|
2726
|
+
showSeparator = false
|
|
2727
|
+
}) {
|
|
2728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
2729
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(ActionMenuGroup, { children: [
|
|
2730
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ActionMenuGroupLabel, { children: label }),
|
|
2731
|
+
children
|
|
2732
|
+
] }),
|
|
2733
|
+
showSeparator && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ActionMenuSeparator, {})
|
|
2734
|
+
] });
|
|
2735
|
+
}
|
|
2736
|
+
function MenuRadioGroup({
|
|
2737
|
+
children,
|
|
2738
|
+
value,
|
|
2739
|
+
defaultValue,
|
|
2740
|
+
onValueChange
|
|
2741
|
+
}) {
|
|
2742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2743
|
+
import_menu2.Menu.RadioGroup,
|
|
2744
|
+
{
|
|
2745
|
+
value,
|
|
2746
|
+
defaultValue,
|
|
2747
|
+
onValueChange,
|
|
2748
|
+
children
|
|
2749
|
+
}
|
|
2750
|
+
);
|
|
2751
|
+
}
|
|
2752
|
+
function MenuItem(props) {
|
|
2753
|
+
const generatedId = React12.useId();
|
|
2754
|
+
if (props.type === "checkbox") {
|
|
2755
|
+
const {
|
|
2756
|
+
children: children2,
|
|
2757
|
+
checked,
|
|
2758
|
+
defaultChecked,
|
|
2759
|
+
onCheckedChange,
|
|
2760
|
+
disabled: disabled2,
|
|
2761
|
+
closeOnClick: closeOnClick2 = false,
|
|
2762
|
+
id
|
|
2763
|
+
} = props;
|
|
2764
|
+
const itemId = id ?? `checkbox-menu-item-${generatedId}`;
|
|
2765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2766
|
+
StyledCheckboxItem,
|
|
2767
|
+
{
|
|
2768
|
+
checked,
|
|
2769
|
+
defaultChecked,
|
|
2770
|
+
onCheckedChange,
|
|
2771
|
+
disabled: disabled2,
|
|
2772
|
+
closeOnClick: closeOnClick2,
|
|
2773
|
+
children: [
|
|
2774
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2775
|
+
StyledCheckboxItemIndicator,
|
|
2776
|
+
{
|
|
2777
|
+
keepMounted: true,
|
|
2778
|
+
render: (_indicatorProps, state) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2779
|
+
import_seeds_react_checkbox4.default,
|
|
2780
|
+
{
|
|
2781
|
+
checked: state.checked,
|
|
2782
|
+
onChange: () => {
|
|
2783
|
+
},
|
|
2784
|
+
tabIndex: -1,
|
|
2785
|
+
id: itemId,
|
|
2786
|
+
name: "menu-checkbox-item"
|
|
2787
|
+
}
|
|
2788
|
+
)
|
|
2789
|
+
}
|
|
2790
|
+
),
|
|
2791
|
+
children2
|
|
2792
|
+
]
|
|
2793
|
+
}
|
|
2794
|
+
);
|
|
2795
|
+
}
|
|
2796
|
+
if (props.type === "radio") {
|
|
2797
|
+
const { children: children2, value, disabled: disabled2, closeOnClick: closeOnClick2 = false } = props;
|
|
2798
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2799
|
+
StyledRadioItem,
|
|
2800
|
+
{
|
|
2801
|
+
value,
|
|
2802
|
+
disabled: disabled2,
|
|
2803
|
+
closeOnClick: closeOnClick2,
|
|
2804
|
+
children: [
|
|
2805
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2806
|
+
StyledRadioItemIndicator,
|
|
2807
|
+
{
|
|
2808
|
+
keepMounted: true,
|
|
2809
|
+
render: (_indicatorProps, state) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2810
|
+
import_seeds_react_radio3.default,
|
|
2811
|
+
{
|
|
2812
|
+
checked: state.checked,
|
|
2813
|
+
onChange: () => {
|
|
2814
|
+
},
|
|
2815
|
+
tabIndex: -1,
|
|
2816
|
+
id: `radio-menu-item-${value}`,
|
|
2817
|
+
name: "menu-radio-item"
|
|
2818
|
+
}
|
|
2819
|
+
)
|
|
2820
|
+
}
|
|
2821
|
+
),
|
|
2822
|
+
children2
|
|
2823
|
+
]
|
|
2824
|
+
}
|
|
2825
|
+
);
|
|
2826
|
+
}
|
|
2827
|
+
const {
|
|
2828
|
+
children,
|
|
2829
|
+
onClick,
|
|
2830
|
+
disabled,
|
|
2831
|
+
closeOnClick = true,
|
|
2832
|
+
href,
|
|
2833
|
+
target
|
|
2834
|
+
} = props;
|
|
2835
|
+
if (href) {
|
|
2836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(StyledLinkItem, { href, target, closeOnClick, children });
|
|
2837
|
+
}
|
|
2838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2839
|
+
StyledMenuItem,
|
|
2840
|
+
{
|
|
2841
|
+
onClick,
|
|
2842
|
+
disabled,
|
|
2843
|
+
closeOnClick,
|
|
2844
|
+
children
|
|
2845
|
+
}
|
|
2846
|
+
);
|
|
2847
|
+
}
|
|
2848
|
+
function MenuSub({
|
|
2849
|
+
trigger,
|
|
2850
|
+
children,
|
|
2851
|
+
open,
|
|
2852
|
+
defaultOpen,
|
|
2853
|
+
onOpenChange,
|
|
2854
|
+
closeParentOnEsc = false
|
|
2855
|
+
}) {
|
|
2856
|
+
const { containerRef, portalContainer } = useSeedsPortalContainer();
|
|
2857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2858
|
+
import_menu2.Menu.SubmenuRoot,
|
|
2859
|
+
{
|
|
2860
|
+
open,
|
|
2861
|
+
defaultOpen,
|
|
2862
|
+
onOpenChange,
|
|
2863
|
+
closeParentOnEsc,
|
|
2864
|
+
children: [
|
|
2865
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ref: containerRef, style: { position: "relative" } }),
|
|
2866
|
+
trigger,
|
|
2867
|
+
/* @__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 }) }) })
|
|
2868
|
+
]
|
|
2869
|
+
}
|
|
2870
|
+
);
|
|
2871
|
+
}
|
|
2872
|
+
function getOffset({ side }) {
|
|
2873
|
+
return side === "top" || side === "bottom" ? 4 : -8;
|
|
2874
|
+
}
|
|
2875
|
+
function MenuSubTrigger({
|
|
2876
|
+
children,
|
|
2877
|
+
disabled,
|
|
2878
|
+
label,
|
|
2879
|
+
openOnHover = true
|
|
2880
|
+
}) {
|
|
2881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2882
|
+
StyledSubmenuTrigger,
|
|
2883
|
+
{
|
|
2884
|
+
disabled,
|
|
2885
|
+
label,
|
|
2886
|
+
openOnHover,
|
|
2887
|
+
children: [
|
|
2888
|
+
children,
|
|
2889
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_seeds_react_icon5.Icon, { name: "chevron-right-outline", fixedWidth: true, "aria-hidden": true })
|
|
2890
|
+
]
|
|
2891
|
+
}
|
|
2892
|
+
);
|
|
2893
|
+
}
|
|
2540
2894
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2541
2895
|
0 && (module.exports = {
|
|
2896
|
+
ActionMenu,
|
|
2542
2897
|
ComboboxActionButtons,
|
|
2543
2898
|
ComboboxClear,
|
|
2544
2899
|
ComboboxEmpty,
|
|
@@ -2561,6 +2916,11 @@ function MultiSearchableSelect(props) {
|
|
|
2561
2916
|
ComboboxTokenInput,
|
|
2562
2917
|
ComboboxTokenInputGroup,
|
|
2563
2918
|
ComboboxTrigger,
|
|
2919
|
+
MenuGroup,
|
|
2920
|
+
MenuItem,
|
|
2921
|
+
MenuRadioGroup,
|
|
2922
|
+
MenuSub,
|
|
2923
|
+
MenuSubTrigger,
|
|
2564
2924
|
MultiCombobox,
|
|
2565
2925
|
MultiSearchableSelect,
|
|
2566
2926
|
MultiSelect,
|