@mirohq/design-system-dropdown-menu 3.3.3 → 3.3.4-use-press.2
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/dist/main.js +217 -161
- package/dist/main.js.map +1 -1
- package/dist/module.js +218 -162
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +49 -51
- package/package.json +9 -8
package/dist/main.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
6
|
var React = require('react');
|
|
6
7
|
var RadixDropdownMenu = require('@radix-ui/react-dropdown-menu');
|
|
7
8
|
var designSystemIcons = require('@mirohq/design-system-icons');
|
|
@@ -12,6 +13,7 @@ var designSystemStyles = require('@mirohq/design-system-styles');
|
|
|
12
13
|
var designSystemUseLayoutEffect = require('@mirohq/design-system-use-layout-effect');
|
|
13
14
|
var designSystemScrollArea = require('@mirohq/design-system-scroll-area');
|
|
14
15
|
var designSystemBaseSwitch = require('@mirohq/design-system-base-switch');
|
|
16
|
+
var utils = require('@react-aria/utils');
|
|
15
17
|
var designSystemBaseIcon = require('@mirohq/design-system-base-icon');
|
|
16
18
|
|
|
17
19
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -107,13 +109,17 @@ const ContentProvider = ({
|
|
|
107
109
|
"--right-slot-max-width": `${Math.ceil(maxWidth)}px`
|
|
108
110
|
}
|
|
109
111
|
});
|
|
110
|
-
return /* @__PURE__ */
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
113
|
+
Context$1.Provider,
|
|
114
|
+
{
|
|
115
|
+
value: {
|
|
116
|
+
rightSlotMount,
|
|
117
|
+
rightSlotDestroy,
|
|
118
|
+
containerSpacing
|
|
119
|
+
},
|
|
120
|
+
children: formattedChildren
|
|
115
121
|
}
|
|
116
|
-
|
|
122
|
+
);
|
|
117
123
|
};
|
|
118
124
|
const useContent = () => React.useContext(Context$1);
|
|
119
125
|
|
|
@@ -145,10 +151,7 @@ const RightSlot = (props) => {
|
|
|
145
151
|
return () => {
|
|
146
152
|
};
|
|
147
153
|
}, [rightSlotMount, rightSlotDestroy, ref]);
|
|
148
|
-
return /* @__PURE__ */
|
|
149
|
-
ref,
|
|
150
|
-
...props
|
|
151
|
-
});
|
|
154
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledRightSlot, { ref, ...props });
|
|
152
155
|
};
|
|
153
156
|
|
|
154
157
|
const HotkeySlot = designSystemStitches.styled(RightSlot, {
|
|
@@ -301,31 +304,46 @@ const ItemProvider = ({
|
|
|
301
304
|
const formattedChildren = hasSlot ? children : designSystemUtils.addPropsToChildren(children, () => true, {
|
|
302
305
|
"data-no-left-slot": ""
|
|
303
306
|
});
|
|
304
|
-
return /* @__PURE__ */
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
307
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
308
|
+
Context.Provider,
|
|
309
|
+
{
|
|
310
|
+
value: {
|
|
311
|
+
leftSlotMount,
|
|
312
|
+
leftSlotDestroy
|
|
313
|
+
},
|
|
314
|
+
children: formattedChildren
|
|
308
315
|
}
|
|
309
|
-
|
|
316
|
+
);
|
|
310
317
|
};
|
|
311
318
|
const useItem = () => React.useContext(Context);
|
|
312
319
|
|
|
313
320
|
const CheckboxItem = React__default["default"].forwardRef(({ children, checked, onChange, disabled, ...restProps }, forwardRef) => {
|
|
314
321
|
const ariaDisabledProps = useAriaDisabled(restProps, true);
|
|
315
322
|
const { "aria-disabled": ariaDisabled } = ariaDisabledProps;
|
|
316
|
-
return /* @__PURE__ */
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
323
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ItemProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
324
|
+
StyledCheckboxItem,
|
|
325
|
+
{
|
|
326
|
+
...restProps,
|
|
327
|
+
...ariaDisabledProps,
|
|
328
|
+
ref: forwardRef,
|
|
329
|
+
checked,
|
|
330
|
+
disabled,
|
|
331
|
+
onCheckedChange: onChange,
|
|
332
|
+
children: [
|
|
333
|
+
children,
|
|
334
|
+
/* @__PURE__ */ jsxRuntime.jsx(RightSlot, { children: /* @__PURE__ */ jsxRuntime.jsxs(StyledIndicator, { children: [
|
|
335
|
+
(disabled === true || designSystemUtils.booleanify(ariaDisabled)) && !checked && /* @__PURE__ */ jsxRuntime.jsx(
|
|
336
|
+
designSystemIcons.IconProhibit,
|
|
337
|
+
{
|
|
338
|
+
weight: "thin",
|
|
339
|
+
css: { square: "$3", display: "block" }
|
|
340
|
+
}
|
|
341
|
+
),
|
|
342
|
+
checked && /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconCheckMark, { css: { square: "$3", display: "block" } })
|
|
343
|
+
] }) })
|
|
344
|
+
]
|
|
345
|
+
}
|
|
346
|
+
) });
|
|
329
347
|
});
|
|
330
348
|
|
|
331
349
|
const CONTENT_GUTTER = parseInt(designSystemStitches.theme.space[150]);
|
|
@@ -415,16 +433,19 @@ const ScrollableContent = ({
|
|
|
415
433
|
};
|
|
416
434
|
}, [maxHeight, overflow, containerSpacing]);
|
|
417
435
|
if (overflow === "auto") {
|
|
418
|
-
return /* @__PURE__ */
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
436
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
437
|
+
designSystemScrollArea.ScrollArea,
|
|
438
|
+
{
|
|
439
|
+
css: { margin: `-${CONTENT_BORDER_FOCUS_ITEM}` },
|
|
440
|
+
type: "always",
|
|
441
|
+
children: [
|
|
442
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystemScrollArea.ScrollArea.Viewport, { css: { ...getOverflowMaxHeight() }, children }),
|
|
443
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystemScrollArea.ScrollArea.Scrollbar, { orientation: "vertical", children: /* @__PURE__ */ jsxRuntime.jsx(designSystemScrollArea.ScrollArea.Thumb, {}) })
|
|
444
|
+
]
|
|
445
|
+
}
|
|
446
|
+
);
|
|
426
447
|
}
|
|
427
|
-
return /* @__PURE__ */
|
|
448
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
428
449
|
};
|
|
429
450
|
|
|
430
451
|
const Content = React__default["default"].forwardRef(
|
|
@@ -443,29 +464,31 @@ const Content = React__default["default"].forwardRef(
|
|
|
443
464
|
maxHeight,
|
|
444
465
|
children,
|
|
445
466
|
...restProps
|
|
446
|
-
}, forwardRef) => /* @__PURE__ */
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}
|
|
467
|
+
}, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(ContentProvider, { containerSpacing, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
468
|
+
StyledContent,
|
|
469
|
+
{
|
|
470
|
+
...restProps,
|
|
471
|
+
ref: forwardRef,
|
|
472
|
+
loop,
|
|
473
|
+
side,
|
|
474
|
+
sideOffset,
|
|
475
|
+
align,
|
|
476
|
+
alignOffset,
|
|
477
|
+
avoidCollisions,
|
|
478
|
+
collisionPadding,
|
|
479
|
+
sticky,
|
|
480
|
+
hideWhenDetached,
|
|
481
|
+
containerSpacing,
|
|
482
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ScrollableContent, { ...{ containerSpacing, maxHeight, overflow }, children })
|
|
483
|
+
}
|
|
484
|
+
) })
|
|
464
485
|
);
|
|
465
486
|
|
|
466
487
|
const StyledItem = designSystemStitches.styled(RadixDropdownMenu__namespace.Item, {
|
|
467
488
|
...itemDefaults,
|
|
468
489
|
variants: {
|
|
490
|
+
// This is a hack for the :has() selector
|
|
491
|
+
// Remove it after Firefox implements it
|
|
469
492
|
hasRightSlot: {
|
|
470
493
|
true: {
|
|
471
494
|
paddingRight: "$600"
|
|
@@ -477,25 +500,21 @@ const StyledItem = designSystemStitches.styled(RadixDropdownMenu__namespace.Item
|
|
|
477
500
|
const Item = React__default["default"].forwardRef(
|
|
478
501
|
({ disabled = false, ...restProps }, forwardRef) => {
|
|
479
502
|
const ariaDisabledProps = useAriaDisabled(restProps);
|
|
480
|
-
return /* @__PURE__ */
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
503
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ItemProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
504
|
+
StyledItem,
|
|
505
|
+
{
|
|
506
|
+
...restProps,
|
|
507
|
+
...ariaDisabledProps,
|
|
508
|
+
disabled,
|
|
509
|
+
ref: forwardRef
|
|
510
|
+
}
|
|
511
|
+
) });
|
|
486
512
|
}
|
|
487
513
|
);
|
|
488
514
|
|
|
489
515
|
const LinkItem = React__default["default"].forwardRef(({ children, href, ...restProps }, forwardRef) => {
|
|
490
516
|
const ariaDisabledProps = useAriaDisabled(restProps);
|
|
491
|
-
return /* @__PURE__ */
|
|
492
|
-
asChild: true,
|
|
493
|
-
ref: forwardRef,
|
|
494
|
-
...restProps,
|
|
495
|
-
...ariaDisabledProps
|
|
496
|
-
}, /* @__PURE__ */ React__default["default"].createElement("a", {
|
|
497
|
-
href
|
|
498
|
-
}, children));
|
|
517
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Item, { asChild: true, ref: forwardRef, ...restProps, ...ariaDisabledProps, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href, children }) });
|
|
499
518
|
});
|
|
500
519
|
|
|
501
520
|
const StyledRadioGroup = designSystemStitches.styled(RadixDropdownMenu__namespace.RadioGroup, {
|
|
@@ -504,11 +523,14 @@ const StyledRadioGroup = designSystemStitches.styled(RadixDropdownMenu__namespac
|
|
|
504
523
|
|
|
505
524
|
const RadioGroup = React__default["default"].forwardRef((props, forwardRef) => {
|
|
506
525
|
const { onChange, ...restProps } = props;
|
|
507
|
-
return /* @__PURE__ */
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
526
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
527
|
+
StyledRadioGroup,
|
|
528
|
+
{
|
|
529
|
+
...restProps,
|
|
530
|
+
ref: forwardRef,
|
|
531
|
+
onValueChange: onChange
|
|
532
|
+
}
|
|
533
|
+
);
|
|
512
534
|
});
|
|
513
535
|
|
|
514
536
|
const StyledRadioContainer = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {
|
|
@@ -569,24 +591,29 @@ const StyledRadioItem = designSystemStitches.styled(RadixDropdownMenu__namespace
|
|
|
569
591
|
|
|
570
592
|
const RadioItem = React__default["default"].forwardRef(({ disabled = false, children, ...restProps }, forwardRef) => {
|
|
571
593
|
const ariaDisabledProps = useAriaDisabled(restProps, true);
|
|
572
|
-
return /* @__PURE__ */
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
594
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ItemProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
595
|
+
StyledRadioItem,
|
|
596
|
+
{
|
|
597
|
+
...restProps,
|
|
598
|
+
...ariaDisabledProps,
|
|
599
|
+
disabled,
|
|
600
|
+
ref: forwardRef,
|
|
601
|
+
children: [
|
|
602
|
+
children,
|
|
603
|
+
/* @__PURE__ */ jsxRuntime.jsx(RightSlot, { children: /* @__PURE__ */ jsxRuntime.jsxs(StyledRadioContainer, { children: [
|
|
604
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledPill, {}),
|
|
605
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledProhibited, { weight: "thin" })
|
|
606
|
+
] }) })
|
|
607
|
+
]
|
|
608
|
+
}
|
|
609
|
+
) });
|
|
580
610
|
});
|
|
581
611
|
|
|
582
612
|
const StyledSeparator = designSystemStitches.styled(RadixDropdownMenu__namespace.Separator, {
|
|
583
613
|
borderTop: "1px solid $border-neutrals-subtle"
|
|
584
614
|
});
|
|
585
615
|
|
|
586
|
-
const Separator = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */
|
|
587
|
-
...props,
|
|
588
|
-
ref: forwardRef
|
|
589
|
-
}));
|
|
616
|
+
const Separator = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledSeparator, { ...props, ref: forwardRef }));
|
|
590
617
|
|
|
591
618
|
const StyledSwitch = designSystemStitches.styled(designSystemPrimitive.Primitive.span, {
|
|
592
619
|
...designSystemBaseSwitch.styles.default,
|
|
@@ -607,14 +634,21 @@ const StyledSwitchItem = designSystemStitches.styled(RadixDropdownMenu__namespac
|
|
|
607
634
|
const SwitchItem = React__default["default"].forwardRef(
|
|
608
635
|
({ disabled = false, checked, onChange, children, ...restProps }, forwardRef) => {
|
|
609
636
|
const ariaDisabledProps = useAriaDisabled(restProps, true);
|
|
610
|
-
return /* @__PURE__ */
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
637
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ItemProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
638
|
+
StyledSwitchItem,
|
|
639
|
+
{
|
|
640
|
+
...restProps,
|
|
641
|
+
...ariaDisabledProps,
|
|
642
|
+
disabled,
|
|
643
|
+
checked,
|
|
644
|
+
onCheckedChange: onChange,
|
|
645
|
+
ref: forwardRef,
|
|
646
|
+
children: [
|
|
647
|
+
children,
|
|
648
|
+
/* @__PURE__ */ jsxRuntime.jsx(RightSlot, { children: /* @__PURE__ */ jsxRuntime.jsx(StyledSwitch, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystemBaseSwitch.Thumb, {}) }) })
|
|
649
|
+
]
|
|
650
|
+
}
|
|
651
|
+
) });
|
|
618
652
|
}
|
|
619
653
|
);
|
|
620
654
|
|
|
@@ -637,13 +671,32 @@ const StyledTrigger = designSystemStitches.styled(RadixDropdownMenu__namespace.T
|
|
|
637
671
|
}
|
|
638
672
|
});
|
|
639
673
|
|
|
640
|
-
const Trigger = React__default["default"].forwardRef(({ asChild = false, onPress, onClick, ...restProps }, forwardRef) =>
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
674
|
+
const Trigger = React__default["default"].forwardRef(({ asChild = false, onPress, onClick, ...restProps }, forwardRef) => {
|
|
675
|
+
const ref = React.useRef(null);
|
|
676
|
+
const handleVirtualClick = (e) => {
|
|
677
|
+
var _a;
|
|
678
|
+
if (utils.isVirtualClick(e.nativeEvent) && ref.current !== null) {
|
|
679
|
+
const pointerDownEvent = new MouseEvent("pointerdown", {
|
|
680
|
+
bubbles: true,
|
|
681
|
+
cancelable: true
|
|
682
|
+
});
|
|
683
|
+
(_a = ref.current) == null ? void 0 : _a.dispatchEvent(pointerDownEvent);
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
687
|
+
StyledTrigger,
|
|
688
|
+
{
|
|
689
|
+
...restProps,
|
|
690
|
+
onClick: (e) => {
|
|
691
|
+
handleVirtualClick(e);
|
|
692
|
+
onClick == null ? void 0 : onClick(e);
|
|
693
|
+
},
|
|
694
|
+
ref: designSystemUtils.mergeRefs([ref, forwardRef]),
|
|
695
|
+
unstyled: !asChild,
|
|
696
|
+
asChild
|
|
697
|
+
}
|
|
698
|
+
);
|
|
699
|
+
});
|
|
647
700
|
|
|
648
701
|
const StyledIconContainer = designSystemStitches.styled(designSystemPrimitive.Primitive.span, {
|
|
649
702
|
color: "$icon-neutrals-with-text",
|
|
@@ -663,17 +716,25 @@ const SubTrigger = React__default["default"].forwardRef(({ children, disabled =
|
|
|
663
716
|
onKeyDown: restProps.onKeyDown,
|
|
664
717
|
"aria-disabled": restProps["aria-disabled"]
|
|
665
718
|
});
|
|
666
|
-
return /* @__PURE__ */
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
719
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
720
|
+
StyledSubTrigger,
|
|
721
|
+
{
|
|
722
|
+
...restProps,
|
|
723
|
+
...ariaDisabledProps,
|
|
724
|
+
disabled,
|
|
725
|
+
ref: forwardRef,
|
|
726
|
+
children: [
|
|
727
|
+
children,
|
|
728
|
+
/* @__PURE__ */ jsxRuntime.jsx(RightSlot, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
729
|
+
StyledIconContainer,
|
|
730
|
+
{
|
|
731
|
+
"data-testid": process.env.NODE_ENV === "test" ? "submenu-arrow-icon" : void 0,
|
|
732
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconChevronRight, { size: "small", weight: "thin" })
|
|
733
|
+
}
|
|
734
|
+
) })
|
|
735
|
+
]
|
|
736
|
+
}
|
|
737
|
+
);
|
|
677
738
|
});
|
|
678
739
|
|
|
679
740
|
const StyledSubContent = designSystemStitches.styled(
|
|
@@ -696,20 +757,20 @@ const SubContent = React__default["default"].forwardRef(
|
|
|
696
757
|
...restProps
|
|
697
758
|
}, forwardRef) => {
|
|
698
759
|
const { containerSpacing } = useContent();
|
|
699
|
-
return /* @__PURE__ */
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
}
|
|
760
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ContentProvider, { containerSpacing, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
761
|
+
StyledSubContent,
|
|
762
|
+
{
|
|
763
|
+
...restProps,
|
|
764
|
+
ref: forwardRef,
|
|
765
|
+
sideOffset,
|
|
766
|
+
alignOffset,
|
|
767
|
+
collisionPadding,
|
|
768
|
+
loop,
|
|
769
|
+
hideWhenDetached,
|
|
770
|
+
sticky,
|
|
771
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ScrollableContent, { ...{ containerSpacing, maxHeight, overflow }, children })
|
|
772
|
+
}
|
|
773
|
+
) });
|
|
713
774
|
}
|
|
714
775
|
);
|
|
715
776
|
|
|
@@ -718,23 +779,24 @@ const StyledSub = designSystemStitches.styled(RadixDropdownMenu__namespace.Sub,
|
|
|
718
779
|
const Sub = React__default["default"].forwardRef(
|
|
719
780
|
({ defaultOpen, onOpen, onClose, open, ...restProps }, forwardRef) => {
|
|
720
781
|
const [openState, setOpenState] = React.useState(defaultOpen);
|
|
721
|
-
return /* @__PURE__ */
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
782
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
783
|
+
StyledSub,
|
|
784
|
+
{
|
|
785
|
+
...restProps,
|
|
786
|
+
open: open != null ? open : openState,
|
|
787
|
+
onOpenChange: (newOpen) => {
|
|
788
|
+
if (open == null) {
|
|
789
|
+
setOpenState(newOpen);
|
|
790
|
+
}
|
|
791
|
+
newOpen ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
|
|
792
|
+
},
|
|
793
|
+
ref: forwardRef
|
|
794
|
+
}
|
|
795
|
+
);
|
|
732
796
|
}
|
|
733
797
|
);
|
|
734
798
|
|
|
735
|
-
const Portal = (props) => /* @__PURE__ */
|
|
736
|
-
...props
|
|
737
|
-
});
|
|
799
|
+
const Portal = (props) => /* @__PURE__ */ jsxRuntime.jsx(RadixDropdownMenu.Portal, { ...props });
|
|
738
800
|
|
|
739
801
|
const StyledIconSlot = designSystemStitches.styled(LeftSlot, {
|
|
740
802
|
square: "$5",
|
|
@@ -759,13 +821,7 @@ const IconSlot = React__default["default"].forwardRef(({ children, ...restProps
|
|
|
759
821
|
leftSlotMount();
|
|
760
822
|
return () => leftSlotDestroy();
|
|
761
823
|
}, [leftSlotMount, leftSlotDestroy]);
|
|
762
|
-
return /* @__PURE__ */
|
|
763
|
-
ref: forwardRef,
|
|
764
|
-
...restProps
|
|
765
|
-
}, /* @__PURE__ */ React__default["default"].createElement(designSystemPrimitive.Primitive.svg, {
|
|
766
|
-
asChild: true,
|
|
767
|
-
"aria-hidden": true
|
|
768
|
-
}, formattedChildren));
|
|
824
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledIconSlot, { ref: forwardRef, ...restProps, children: /* @__PURE__ */ jsxRuntime.jsx(designSystemPrimitive.Primitive.svg, { asChild: true, "aria-hidden": true, children: formattedChildren }) });
|
|
769
825
|
});
|
|
770
826
|
|
|
771
827
|
const IllustrationSlot = React__default["default"].forwardRef((props, forwardRef) => {
|
|
@@ -774,10 +830,7 @@ const IllustrationSlot = React__default["default"].forwardRef((props, forwardRef
|
|
|
774
830
|
leftSlotMount();
|
|
775
831
|
return () => leftSlotDestroy();
|
|
776
832
|
}, [leftSlotMount, leftSlotDestroy]);
|
|
777
|
-
return /* @__PURE__ */
|
|
778
|
-
ref: forwardRef,
|
|
779
|
-
...props
|
|
780
|
-
});
|
|
833
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledIllustrationSlot, { ref: forwardRef, ...props });
|
|
781
834
|
});
|
|
782
835
|
|
|
783
836
|
const DropdownMenu = ({
|
|
@@ -790,18 +843,21 @@ const DropdownMenu = ({
|
|
|
790
843
|
...restProps
|
|
791
844
|
}) => {
|
|
792
845
|
const [openState, setOpenState] = React.useState(defaultOpen);
|
|
793
|
-
return /* @__PURE__ */
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
846
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
847
|
+
RadixDropdownMenu__namespace.Root,
|
|
848
|
+
{
|
|
849
|
+
...restProps,
|
|
850
|
+
dir: direction,
|
|
851
|
+
modal: interactOutside,
|
|
852
|
+
open: open != null ? open : openState,
|
|
853
|
+
onOpenChange: (newOpen) => {
|
|
854
|
+
if (open == null) {
|
|
855
|
+
setOpenState(newOpen);
|
|
856
|
+
}
|
|
857
|
+
newOpen ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
|
|
801
858
|
}
|
|
802
|
-
newOpen ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
|
|
803
859
|
}
|
|
804
|
-
|
|
860
|
+
);
|
|
805
861
|
};
|
|
806
862
|
DropdownMenu.CheckboxItem = CheckboxItem;
|
|
807
863
|
DropdownMenu.Content = Content;
|