@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/module.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
1
2
|
import React, { createContext, useState, useRef, useCallback, useContext, useMemo } from 'react';
|
|
2
3
|
import * as RadixDropdownMenu from '@radix-ui/react-dropdown-menu';
|
|
3
4
|
import { Portal as Portal$1 } from '@radix-ui/react-dropdown-menu';
|
|
4
5
|
import { IconProhibit, IconCheckMark, IconChevronRight } from '@mirohq/design-system-icons';
|
|
5
|
-
import { addPropsToChildren, booleanify } from '@mirohq/design-system-utils';
|
|
6
|
+
import { addPropsToChildren, booleanify, mergeRefs } from '@mirohq/design-system-utils';
|
|
6
7
|
import { Primitive } from '@mirohq/design-system-primitive';
|
|
7
8
|
import { styled, theme } from '@mirohq/design-system-stitches';
|
|
8
9
|
import { focus, animations } from '@mirohq/design-system-styles';
|
|
9
10
|
import { useLayoutEffect } from '@mirohq/design-system-use-layout-effect';
|
|
10
11
|
import { ScrollArea } from '@mirohq/design-system-scroll-area';
|
|
11
12
|
import { styles, Thumb } from '@mirohq/design-system-base-switch';
|
|
13
|
+
import { isVirtualClick } from '@react-aria/utils';
|
|
12
14
|
import { styles as styles$1, isIconComponent } from '@mirohq/design-system-base-icon';
|
|
13
15
|
|
|
14
16
|
const ItemDescription = styled(Primitive.div, {
|
|
@@ -81,13 +83,17 @@ const ContentProvider = ({
|
|
|
81
83
|
"--right-slot-max-width": `${Math.ceil(maxWidth)}px`
|
|
82
84
|
}
|
|
83
85
|
});
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
return /* @__PURE__ */ jsx(
|
|
87
|
+
Context$1.Provider,
|
|
88
|
+
{
|
|
89
|
+
value: {
|
|
90
|
+
rightSlotMount,
|
|
91
|
+
rightSlotDestroy,
|
|
92
|
+
containerSpacing
|
|
93
|
+
},
|
|
94
|
+
children: formattedChildren
|
|
89
95
|
}
|
|
90
|
-
|
|
96
|
+
);
|
|
91
97
|
};
|
|
92
98
|
const useContent = () => useContext(Context$1);
|
|
93
99
|
|
|
@@ -119,10 +125,7 @@ const RightSlot = (props) => {
|
|
|
119
125
|
return () => {
|
|
120
126
|
};
|
|
121
127
|
}, [rightSlotMount, rightSlotDestroy, ref]);
|
|
122
|
-
return /* @__PURE__ */
|
|
123
|
-
ref,
|
|
124
|
-
...props
|
|
125
|
-
});
|
|
128
|
+
return /* @__PURE__ */ jsx(StyledRightSlot, { ref, ...props });
|
|
126
129
|
};
|
|
127
130
|
|
|
128
131
|
const HotkeySlot = styled(RightSlot, {
|
|
@@ -275,31 +278,46 @@ const ItemProvider = ({
|
|
|
275
278
|
const formattedChildren = hasSlot ? children : addPropsToChildren(children, () => true, {
|
|
276
279
|
"data-no-left-slot": ""
|
|
277
280
|
});
|
|
278
|
-
return /* @__PURE__ */
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
281
|
+
return /* @__PURE__ */ jsx(
|
|
282
|
+
Context.Provider,
|
|
283
|
+
{
|
|
284
|
+
value: {
|
|
285
|
+
leftSlotMount,
|
|
286
|
+
leftSlotDestroy
|
|
287
|
+
},
|
|
288
|
+
children: formattedChildren
|
|
282
289
|
}
|
|
283
|
-
|
|
290
|
+
);
|
|
284
291
|
};
|
|
285
292
|
const useItem = () => useContext(Context);
|
|
286
293
|
|
|
287
294
|
const CheckboxItem = React.forwardRef(({ children, checked, onChange, disabled, ...restProps }, forwardRef) => {
|
|
288
295
|
const ariaDisabledProps = useAriaDisabled(restProps, true);
|
|
289
296
|
const { "aria-disabled": ariaDisabled } = ariaDisabledProps;
|
|
290
|
-
return /* @__PURE__ */
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
297
|
+
return /* @__PURE__ */ jsx(ItemProvider, { children: /* @__PURE__ */ jsxs(
|
|
298
|
+
StyledCheckboxItem,
|
|
299
|
+
{
|
|
300
|
+
...restProps,
|
|
301
|
+
...ariaDisabledProps,
|
|
302
|
+
ref: forwardRef,
|
|
303
|
+
checked,
|
|
304
|
+
disabled,
|
|
305
|
+
onCheckedChange: onChange,
|
|
306
|
+
children: [
|
|
307
|
+
children,
|
|
308
|
+
/* @__PURE__ */ jsx(RightSlot, { children: /* @__PURE__ */ jsxs(StyledIndicator, { children: [
|
|
309
|
+
(disabled === true || booleanify(ariaDisabled)) && !checked && /* @__PURE__ */ jsx(
|
|
310
|
+
IconProhibit,
|
|
311
|
+
{
|
|
312
|
+
weight: "thin",
|
|
313
|
+
css: { square: "$3", display: "block" }
|
|
314
|
+
}
|
|
315
|
+
),
|
|
316
|
+
checked && /* @__PURE__ */ jsx(IconCheckMark, { css: { square: "$3", display: "block" } })
|
|
317
|
+
] }) })
|
|
318
|
+
]
|
|
319
|
+
}
|
|
320
|
+
) });
|
|
303
321
|
});
|
|
304
322
|
|
|
305
323
|
const CONTENT_GUTTER = parseInt(theme.space[150]);
|
|
@@ -389,16 +407,19 @@ const ScrollableContent = ({
|
|
|
389
407
|
};
|
|
390
408
|
}, [maxHeight, overflow, containerSpacing]);
|
|
391
409
|
if (overflow === "auto") {
|
|
392
|
-
return /* @__PURE__ */
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
410
|
+
return /* @__PURE__ */ jsxs(
|
|
411
|
+
ScrollArea,
|
|
412
|
+
{
|
|
413
|
+
css: { margin: `-${CONTENT_BORDER_FOCUS_ITEM}` },
|
|
414
|
+
type: "always",
|
|
415
|
+
children: [
|
|
416
|
+
/* @__PURE__ */ jsx(ScrollArea.Viewport, { css: { ...getOverflowMaxHeight() }, children }),
|
|
417
|
+
/* @__PURE__ */ jsx(ScrollArea.Scrollbar, { orientation: "vertical", children: /* @__PURE__ */ jsx(ScrollArea.Thumb, {}) })
|
|
418
|
+
]
|
|
419
|
+
}
|
|
420
|
+
);
|
|
400
421
|
}
|
|
401
|
-
return /* @__PURE__ */
|
|
422
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
402
423
|
};
|
|
403
424
|
|
|
404
425
|
const Content = React.forwardRef(
|
|
@@ -417,29 +438,31 @@ const Content = React.forwardRef(
|
|
|
417
438
|
maxHeight,
|
|
418
439
|
children,
|
|
419
440
|
...restProps
|
|
420
|
-
}, forwardRef) => /* @__PURE__ */
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
}
|
|
441
|
+
}, forwardRef) => /* @__PURE__ */ jsx(ContentProvider, { containerSpacing, children: /* @__PURE__ */ jsx(
|
|
442
|
+
StyledContent,
|
|
443
|
+
{
|
|
444
|
+
...restProps,
|
|
445
|
+
ref: forwardRef,
|
|
446
|
+
loop,
|
|
447
|
+
side,
|
|
448
|
+
sideOffset,
|
|
449
|
+
align,
|
|
450
|
+
alignOffset,
|
|
451
|
+
avoidCollisions,
|
|
452
|
+
collisionPadding,
|
|
453
|
+
sticky,
|
|
454
|
+
hideWhenDetached,
|
|
455
|
+
containerSpacing,
|
|
456
|
+
children: /* @__PURE__ */ jsx(ScrollableContent, { ...{ containerSpacing, maxHeight, overflow }, children })
|
|
457
|
+
}
|
|
458
|
+
) })
|
|
438
459
|
);
|
|
439
460
|
|
|
440
461
|
const StyledItem = styled(RadixDropdownMenu.Item, {
|
|
441
462
|
...itemDefaults,
|
|
442
463
|
variants: {
|
|
464
|
+
// This is a hack for the :has() selector
|
|
465
|
+
// Remove it after Firefox implements it
|
|
443
466
|
hasRightSlot: {
|
|
444
467
|
true: {
|
|
445
468
|
paddingRight: "$600"
|
|
@@ -451,25 +474,21 @@ const StyledItem = styled(RadixDropdownMenu.Item, {
|
|
|
451
474
|
const Item = React.forwardRef(
|
|
452
475
|
({ disabled = false, ...restProps }, forwardRef) => {
|
|
453
476
|
const ariaDisabledProps = useAriaDisabled(restProps);
|
|
454
|
-
return /* @__PURE__ */
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
477
|
+
return /* @__PURE__ */ jsx(ItemProvider, { children: /* @__PURE__ */ jsx(
|
|
478
|
+
StyledItem,
|
|
479
|
+
{
|
|
480
|
+
...restProps,
|
|
481
|
+
...ariaDisabledProps,
|
|
482
|
+
disabled,
|
|
483
|
+
ref: forwardRef
|
|
484
|
+
}
|
|
485
|
+
) });
|
|
460
486
|
}
|
|
461
487
|
);
|
|
462
488
|
|
|
463
489
|
const LinkItem = React.forwardRef(({ children, href, ...restProps }, forwardRef) => {
|
|
464
490
|
const ariaDisabledProps = useAriaDisabled(restProps);
|
|
465
|
-
return /* @__PURE__ */
|
|
466
|
-
asChild: true,
|
|
467
|
-
ref: forwardRef,
|
|
468
|
-
...restProps,
|
|
469
|
-
...ariaDisabledProps
|
|
470
|
-
}, /* @__PURE__ */ React.createElement("a", {
|
|
471
|
-
href
|
|
472
|
-
}, children));
|
|
491
|
+
return /* @__PURE__ */ jsx(Item, { asChild: true, ref: forwardRef, ...restProps, ...ariaDisabledProps, children: /* @__PURE__ */ jsx("a", { href, children }) });
|
|
473
492
|
});
|
|
474
493
|
|
|
475
494
|
const StyledRadioGroup = styled(RadixDropdownMenu.RadioGroup, {
|
|
@@ -478,11 +497,14 @@ const StyledRadioGroup = styled(RadixDropdownMenu.RadioGroup, {
|
|
|
478
497
|
|
|
479
498
|
const RadioGroup = React.forwardRef((props, forwardRef) => {
|
|
480
499
|
const { onChange, ...restProps } = props;
|
|
481
|
-
return /* @__PURE__ */
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
500
|
+
return /* @__PURE__ */ jsx(
|
|
501
|
+
StyledRadioGroup,
|
|
502
|
+
{
|
|
503
|
+
...restProps,
|
|
504
|
+
ref: forwardRef,
|
|
505
|
+
onValueChange: onChange
|
|
506
|
+
}
|
|
507
|
+
);
|
|
486
508
|
});
|
|
487
509
|
|
|
488
510
|
const StyledRadioContainer = styled(Primitive.div, {
|
|
@@ -543,24 +565,29 @@ const StyledRadioItem = styled(RadixDropdownMenu.RadioItem, {
|
|
|
543
565
|
|
|
544
566
|
const RadioItem = React.forwardRef(({ disabled = false, children, ...restProps }, forwardRef) => {
|
|
545
567
|
const ariaDisabledProps = useAriaDisabled(restProps, true);
|
|
546
|
-
return /* @__PURE__ */
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
568
|
+
return /* @__PURE__ */ jsx(ItemProvider, { children: /* @__PURE__ */ jsxs(
|
|
569
|
+
StyledRadioItem,
|
|
570
|
+
{
|
|
571
|
+
...restProps,
|
|
572
|
+
...ariaDisabledProps,
|
|
573
|
+
disabled,
|
|
574
|
+
ref: forwardRef,
|
|
575
|
+
children: [
|
|
576
|
+
children,
|
|
577
|
+
/* @__PURE__ */ jsx(RightSlot, { children: /* @__PURE__ */ jsxs(StyledRadioContainer, { children: [
|
|
578
|
+
/* @__PURE__ */ jsx(StyledPill, {}),
|
|
579
|
+
/* @__PURE__ */ jsx(StyledProhibited, { weight: "thin" })
|
|
580
|
+
] }) })
|
|
581
|
+
]
|
|
582
|
+
}
|
|
583
|
+
) });
|
|
554
584
|
});
|
|
555
585
|
|
|
556
586
|
const StyledSeparator = styled(RadixDropdownMenu.Separator, {
|
|
557
587
|
borderTop: "1px solid $border-neutrals-subtle"
|
|
558
588
|
});
|
|
559
589
|
|
|
560
|
-
const Separator = React.forwardRef((props, forwardRef) => /* @__PURE__ */
|
|
561
|
-
...props,
|
|
562
|
-
ref: forwardRef
|
|
563
|
-
}));
|
|
590
|
+
const Separator = React.forwardRef((props, forwardRef) => /* @__PURE__ */ jsx(StyledSeparator, { ...props, ref: forwardRef }));
|
|
564
591
|
|
|
565
592
|
const StyledSwitch = styled(Primitive.span, {
|
|
566
593
|
...styles.default,
|
|
@@ -581,14 +608,21 @@ const StyledSwitchItem = styled(RadixDropdownMenu.CheckboxItem, {
|
|
|
581
608
|
const SwitchItem = React.forwardRef(
|
|
582
609
|
({ disabled = false, checked, onChange, children, ...restProps }, forwardRef) => {
|
|
583
610
|
const ariaDisabledProps = useAriaDisabled(restProps, true);
|
|
584
|
-
return /* @__PURE__ */
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
611
|
+
return /* @__PURE__ */ jsx(ItemProvider, { children: /* @__PURE__ */ jsxs(
|
|
612
|
+
StyledSwitchItem,
|
|
613
|
+
{
|
|
614
|
+
...restProps,
|
|
615
|
+
...ariaDisabledProps,
|
|
616
|
+
disabled,
|
|
617
|
+
checked,
|
|
618
|
+
onCheckedChange: onChange,
|
|
619
|
+
ref: forwardRef,
|
|
620
|
+
children: [
|
|
621
|
+
children,
|
|
622
|
+
/* @__PURE__ */ jsx(RightSlot, { children: /* @__PURE__ */ jsx(StyledSwitch, { children: /* @__PURE__ */ jsx(Thumb, {}) }) })
|
|
623
|
+
]
|
|
624
|
+
}
|
|
625
|
+
) });
|
|
592
626
|
}
|
|
593
627
|
);
|
|
594
628
|
|
|
@@ -611,13 +645,32 @@ const StyledTrigger = styled(RadixDropdownMenu.Trigger, {
|
|
|
611
645
|
}
|
|
612
646
|
});
|
|
613
647
|
|
|
614
|
-
const Trigger = React.forwardRef(({ asChild = false, onPress, onClick, ...restProps }, forwardRef) =>
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
648
|
+
const Trigger = React.forwardRef(({ asChild = false, onPress, onClick, ...restProps }, forwardRef) => {
|
|
649
|
+
const ref = useRef(null);
|
|
650
|
+
const handleVirtualClick = (e) => {
|
|
651
|
+
var _a;
|
|
652
|
+
if (isVirtualClick(e.nativeEvent) && ref.current !== null) {
|
|
653
|
+
const pointerDownEvent = new MouseEvent("pointerdown", {
|
|
654
|
+
bubbles: true,
|
|
655
|
+
cancelable: true
|
|
656
|
+
});
|
|
657
|
+
(_a = ref.current) == null ? void 0 : _a.dispatchEvent(pointerDownEvent);
|
|
658
|
+
}
|
|
659
|
+
};
|
|
660
|
+
return /* @__PURE__ */ jsx(
|
|
661
|
+
StyledTrigger,
|
|
662
|
+
{
|
|
663
|
+
...restProps,
|
|
664
|
+
onClick: (e) => {
|
|
665
|
+
handleVirtualClick(e);
|
|
666
|
+
onClick == null ? void 0 : onClick(e);
|
|
667
|
+
},
|
|
668
|
+
ref: mergeRefs([ref, forwardRef]),
|
|
669
|
+
unstyled: !asChild,
|
|
670
|
+
asChild
|
|
671
|
+
}
|
|
672
|
+
);
|
|
673
|
+
});
|
|
621
674
|
|
|
622
675
|
const StyledIconContainer = styled(Primitive.span, {
|
|
623
676
|
color: "$icon-neutrals-with-text",
|
|
@@ -637,17 +690,25 @@ const SubTrigger = React.forwardRef(({ children, disabled = false, ...restProps
|
|
|
637
690
|
onKeyDown: restProps.onKeyDown,
|
|
638
691
|
"aria-disabled": restProps["aria-disabled"]
|
|
639
692
|
});
|
|
640
|
-
return /* @__PURE__ */
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
693
|
+
return /* @__PURE__ */ jsxs(
|
|
694
|
+
StyledSubTrigger,
|
|
695
|
+
{
|
|
696
|
+
...restProps,
|
|
697
|
+
...ariaDisabledProps,
|
|
698
|
+
disabled,
|
|
699
|
+
ref: forwardRef,
|
|
700
|
+
children: [
|
|
701
|
+
children,
|
|
702
|
+
/* @__PURE__ */ jsx(RightSlot, { children: /* @__PURE__ */ jsx(
|
|
703
|
+
StyledIconContainer,
|
|
704
|
+
{
|
|
705
|
+
"data-testid": process.env.NODE_ENV === "test" ? "submenu-arrow-icon" : void 0,
|
|
706
|
+
children: /* @__PURE__ */ jsx(IconChevronRight, { size: "small", weight: "thin" })
|
|
707
|
+
}
|
|
708
|
+
) })
|
|
709
|
+
]
|
|
710
|
+
}
|
|
711
|
+
);
|
|
651
712
|
});
|
|
652
713
|
|
|
653
714
|
const StyledSubContent = styled(
|
|
@@ -670,20 +731,20 @@ const SubContent = React.forwardRef(
|
|
|
670
731
|
...restProps
|
|
671
732
|
}, forwardRef) => {
|
|
672
733
|
const { containerSpacing } = useContent();
|
|
673
|
-
return /* @__PURE__ */
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
}
|
|
734
|
+
return /* @__PURE__ */ jsx(ContentProvider, { containerSpacing, children: /* @__PURE__ */ jsx(
|
|
735
|
+
StyledSubContent,
|
|
736
|
+
{
|
|
737
|
+
...restProps,
|
|
738
|
+
ref: forwardRef,
|
|
739
|
+
sideOffset,
|
|
740
|
+
alignOffset,
|
|
741
|
+
collisionPadding,
|
|
742
|
+
loop,
|
|
743
|
+
hideWhenDetached,
|
|
744
|
+
sticky,
|
|
745
|
+
children: /* @__PURE__ */ jsx(ScrollableContent, { ...{ containerSpacing, maxHeight, overflow }, children })
|
|
746
|
+
}
|
|
747
|
+
) });
|
|
687
748
|
}
|
|
688
749
|
);
|
|
689
750
|
|
|
@@ -692,23 +753,24 @@ const StyledSub = styled(RadixDropdownMenu.Sub, {});
|
|
|
692
753
|
const Sub = React.forwardRef(
|
|
693
754
|
({ defaultOpen, onOpen, onClose, open, ...restProps }, forwardRef) => {
|
|
694
755
|
const [openState, setOpenState] = useState(defaultOpen);
|
|
695
|
-
return /* @__PURE__ */
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
756
|
+
return /* @__PURE__ */ jsx(
|
|
757
|
+
StyledSub,
|
|
758
|
+
{
|
|
759
|
+
...restProps,
|
|
760
|
+
open: open != null ? open : openState,
|
|
761
|
+
onOpenChange: (newOpen) => {
|
|
762
|
+
if (open == null) {
|
|
763
|
+
setOpenState(newOpen);
|
|
764
|
+
}
|
|
765
|
+
newOpen ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
|
|
766
|
+
},
|
|
767
|
+
ref: forwardRef
|
|
768
|
+
}
|
|
769
|
+
);
|
|
706
770
|
}
|
|
707
771
|
);
|
|
708
772
|
|
|
709
|
-
const Portal = (props) => /* @__PURE__ */
|
|
710
|
-
...props
|
|
711
|
-
});
|
|
773
|
+
const Portal = (props) => /* @__PURE__ */ jsx(Portal$1, { ...props });
|
|
712
774
|
|
|
713
775
|
const StyledIconSlot = styled(LeftSlot, {
|
|
714
776
|
square: "$5",
|
|
@@ -733,13 +795,7 @@ const IconSlot = React.forwardRef(({ children, ...restProps }, forwardRef) => {
|
|
|
733
795
|
leftSlotMount();
|
|
734
796
|
return () => leftSlotDestroy();
|
|
735
797
|
}, [leftSlotMount, leftSlotDestroy]);
|
|
736
|
-
return /* @__PURE__ */
|
|
737
|
-
ref: forwardRef,
|
|
738
|
-
...restProps
|
|
739
|
-
}, /* @__PURE__ */ React.createElement(Primitive.svg, {
|
|
740
|
-
asChild: true,
|
|
741
|
-
"aria-hidden": true
|
|
742
|
-
}, formattedChildren));
|
|
798
|
+
return /* @__PURE__ */ jsx(StyledIconSlot, { ref: forwardRef, ...restProps, children: /* @__PURE__ */ jsx(Primitive.svg, { asChild: true, "aria-hidden": true, children: formattedChildren }) });
|
|
743
799
|
});
|
|
744
800
|
|
|
745
801
|
const IllustrationSlot = React.forwardRef((props, forwardRef) => {
|
|
@@ -748,10 +804,7 @@ const IllustrationSlot = React.forwardRef((props, forwardRef) => {
|
|
|
748
804
|
leftSlotMount();
|
|
749
805
|
return () => leftSlotDestroy();
|
|
750
806
|
}, [leftSlotMount, leftSlotDestroy]);
|
|
751
|
-
return /* @__PURE__ */
|
|
752
|
-
ref: forwardRef,
|
|
753
|
-
...props
|
|
754
|
-
});
|
|
807
|
+
return /* @__PURE__ */ jsx(StyledIllustrationSlot, { ref: forwardRef, ...props });
|
|
755
808
|
});
|
|
756
809
|
|
|
757
810
|
const DropdownMenu = ({
|
|
@@ -764,18 +817,21 @@ const DropdownMenu = ({
|
|
|
764
817
|
...restProps
|
|
765
818
|
}) => {
|
|
766
819
|
const [openState, setOpenState] = useState(defaultOpen);
|
|
767
|
-
return /* @__PURE__ */
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
820
|
+
return /* @__PURE__ */ jsx(
|
|
821
|
+
RadixDropdownMenu.Root,
|
|
822
|
+
{
|
|
823
|
+
...restProps,
|
|
824
|
+
dir: direction,
|
|
825
|
+
modal: interactOutside,
|
|
826
|
+
open: open != null ? open : openState,
|
|
827
|
+
onOpenChange: (newOpen) => {
|
|
828
|
+
if (open == null) {
|
|
829
|
+
setOpenState(newOpen);
|
|
830
|
+
}
|
|
831
|
+
newOpen ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
|
|
775
832
|
}
|
|
776
|
-
newOpen ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
|
|
777
833
|
}
|
|
778
|
-
|
|
834
|
+
);
|
|
779
835
|
};
|
|
780
836
|
DropdownMenu.CheckboxItem = CheckboxItem;
|
|
781
837
|
DropdownMenu.Content = Content;
|