@mirohq/design-system-dropdown-menu 3.3.2 → 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 +221 -164
- package/dist/main.js.map +1 -1
- package/dist/module.js +223 -166
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +49 -51
- package/package.json +10 -8
package/dist/module.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
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';
|
|
10
|
+
import { useLayoutEffect } from '@mirohq/design-system-use-layout-effect';
|
|
9
11
|
import { ScrollArea } from '@mirohq/design-system-scroll-area';
|
|
10
12
|
import { styles, Thumb } from '@mirohq/design-system-base-switch';
|
|
13
|
+
import { isVirtualClick } from '@react-aria/utils';
|
|
11
14
|
import { styles as styles$1, isIconComponent } from '@mirohq/design-system-base-icon';
|
|
12
15
|
|
|
13
16
|
const ItemDescription = styled(Primitive.div, {
|
|
@@ -80,13 +83,17 @@ const ContentProvider = ({
|
|
|
80
83
|
"--right-slot-max-width": `${Math.ceil(maxWidth)}px`
|
|
81
84
|
}
|
|
82
85
|
});
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
return /* @__PURE__ */ jsx(
|
|
87
|
+
Context$1.Provider,
|
|
88
|
+
{
|
|
89
|
+
value: {
|
|
90
|
+
rightSlotMount,
|
|
91
|
+
rightSlotDestroy,
|
|
92
|
+
containerSpacing
|
|
93
|
+
},
|
|
94
|
+
children: formattedChildren
|
|
88
95
|
}
|
|
89
|
-
|
|
96
|
+
);
|
|
90
97
|
};
|
|
91
98
|
const useContent = () => useContext(Context$1);
|
|
92
99
|
|
|
@@ -109,7 +116,7 @@ const StyledRightSlot = styled(Primitive.div, {
|
|
|
109
116
|
const RightSlot = (props) => {
|
|
110
117
|
const { rightSlotMount, rightSlotDestroy } = useContent();
|
|
111
118
|
const ref = useRef(null);
|
|
112
|
-
|
|
119
|
+
useLayoutEffect(() => {
|
|
113
120
|
if (ref.current !== null) {
|
|
114
121
|
const width = ref.current.getBoundingClientRect().width;
|
|
115
122
|
const index = rightSlotMount(width);
|
|
@@ -118,10 +125,7 @@ const RightSlot = (props) => {
|
|
|
118
125
|
return () => {
|
|
119
126
|
};
|
|
120
127
|
}, [rightSlotMount, rightSlotDestroy, ref]);
|
|
121
|
-
return /* @__PURE__ */
|
|
122
|
-
ref,
|
|
123
|
-
...props
|
|
124
|
-
});
|
|
128
|
+
return /* @__PURE__ */ jsx(StyledRightSlot, { ref, ...props });
|
|
125
129
|
};
|
|
126
130
|
|
|
127
131
|
const HotkeySlot = styled(RightSlot, {
|
|
@@ -274,31 +278,46 @@ const ItemProvider = ({
|
|
|
274
278
|
const formattedChildren = hasSlot ? children : addPropsToChildren(children, () => true, {
|
|
275
279
|
"data-no-left-slot": ""
|
|
276
280
|
});
|
|
277
|
-
return /* @__PURE__ */
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
+
return /* @__PURE__ */ jsx(
|
|
282
|
+
Context.Provider,
|
|
283
|
+
{
|
|
284
|
+
value: {
|
|
285
|
+
leftSlotMount,
|
|
286
|
+
leftSlotDestroy
|
|
287
|
+
},
|
|
288
|
+
children: formattedChildren
|
|
281
289
|
}
|
|
282
|
-
|
|
290
|
+
);
|
|
283
291
|
};
|
|
284
292
|
const useItem = () => useContext(Context);
|
|
285
293
|
|
|
286
294
|
const CheckboxItem = React.forwardRef(({ children, checked, onChange, disabled, ...restProps }, forwardRef) => {
|
|
287
295
|
const ariaDisabledProps = useAriaDisabled(restProps, true);
|
|
288
296
|
const { "aria-disabled": ariaDisabled } = ariaDisabledProps;
|
|
289
|
-
return /* @__PURE__ */
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
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
|
+
) });
|
|
302
321
|
});
|
|
303
322
|
|
|
304
323
|
const CONTENT_GUTTER = parseInt(theme.space[150]);
|
|
@@ -388,16 +407,19 @@ const ScrollableContent = ({
|
|
|
388
407
|
};
|
|
389
408
|
}, [maxHeight, overflow, containerSpacing]);
|
|
390
409
|
if (overflow === "auto") {
|
|
391
|
-
return /* @__PURE__ */
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
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
|
+
);
|
|
399
421
|
}
|
|
400
|
-
return /* @__PURE__ */
|
|
422
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
401
423
|
};
|
|
402
424
|
|
|
403
425
|
const Content = React.forwardRef(
|
|
@@ -416,29 +438,31 @@ const Content = React.forwardRef(
|
|
|
416
438
|
maxHeight,
|
|
417
439
|
children,
|
|
418
440
|
...restProps
|
|
419
|
-
}, forwardRef) => /* @__PURE__ */
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
}
|
|
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
|
+
) })
|
|
437
459
|
);
|
|
438
460
|
|
|
439
461
|
const StyledItem = styled(RadixDropdownMenu.Item, {
|
|
440
462
|
...itemDefaults,
|
|
441
463
|
variants: {
|
|
464
|
+
// This is a hack for the :has() selector
|
|
465
|
+
// Remove it after Firefox implements it
|
|
442
466
|
hasRightSlot: {
|
|
443
467
|
true: {
|
|
444
468
|
paddingRight: "$600"
|
|
@@ -450,25 +474,21 @@ const StyledItem = styled(RadixDropdownMenu.Item, {
|
|
|
450
474
|
const Item = React.forwardRef(
|
|
451
475
|
({ disabled = false, ...restProps }, forwardRef) => {
|
|
452
476
|
const ariaDisabledProps = useAriaDisabled(restProps);
|
|
453
|
-
return /* @__PURE__ */
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
477
|
+
return /* @__PURE__ */ jsx(ItemProvider, { children: /* @__PURE__ */ jsx(
|
|
478
|
+
StyledItem,
|
|
479
|
+
{
|
|
480
|
+
...restProps,
|
|
481
|
+
...ariaDisabledProps,
|
|
482
|
+
disabled,
|
|
483
|
+
ref: forwardRef
|
|
484
|
+
}
|
|
485
|
+
) });
|
|
459
486
|
}
|
|
460
487
|
);
|
|
461
488
|
|
|
462
489
|
const LinkItem = React.forwardRef(({ children, href, ...restProps }, forwardRef) => {
|
|
463
490
|
const ariaDisabledProps = useAriaDisabled(restProps);
|
|
464
|
-
return /* @__PURE__ */
|
|
465
|
-
asChild: true,
|
|
466
|
-
ref: forwardRef,
|
|
467
|
-
...restProps,
|
|
468
|
-
...ariaDisabledProps
|
|
469
|
-
}, /* @__PURE__ */ React.createElement("a", {
|
|
470
|
-
href
|
|
471
|
-
}, children));
|
|
491
|
+
return /* @__PURE__ */ jsx(Item, { asChild: true, ref: forwardRef, ...restProps, ...ariaDisabledProps, children: /* @__PURE__ */ jsx("a", { href, children }) });
|
|
472
492
|
});
|
|
473
493
|
|
|
474
494
|
const StyledRadioGroup = styled(RadixDropdownMenu.RadioGroup, {
|
|
@@ -477,11 +497,14 @@ const StyledRadioGroup = styled(RadixDropdownMenu.RadioGroup, {
|
|
|
477
497
|
|
|
478
498
|
const RadioGroup = React.forwardRef((props, forwardRef) => {
|
|
479
499
|
const { onChange, ...restProps } = props;
|
|
480
|
-
return /* @__PURE__ */
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
500
|
+
return /* @__PURE__ */ jsx(
|
|
501
|
+
StyledRadioGroup,
|
|
502
|
+
{
|
|
503
|
+
...restProps,
|
|
504
|
+
ref: forwardRef,
|
|
505
|
+
onValueChange: onChange
|
|
506
|
+
}
|
|
507
|
+
);
|
|
485
508
|
});
|
|
486
509
|
|
|
487
510
|
const StyledRadioContainer = styled(Primitive.div, {
|
|
@@ -542,24 +565,29 @@ const StyledRadioItem = styled(RadixDropdownMenu.RadioItem, {
|
|
|
542
565
|
|
|
543
566
|
const RadioItem = React.forwardRef(({ disabled = false, children, ...restProps }, forwardRef) => {
|
|
544
567
|
const ariaDisabledProps = useAriaDisabled(restProps, true);
|
|
545
|
-
return /* @__PURE__ */
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
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
|
+
) });
|
|
553
584
|
});
|
|
554
585
|
|
|
555
586
|
const StyledSeparator = styled(RadixDropdownMenu.Separator, {
|
|
556
587
|
borderTop: "1px solid $border-neutrals-subtle"
|
|
557
588
|
});
|
|
558
589
|
|
|
559
|
-
const Separator = React.forwardRef((props, forwardRef) => /* @__PURE__ */
|
|
560
|
-
...props,
|
|
561
|
-
ref: forwardRef
|
|
562
|
-
}));
|
|
590
|
+
const Separator = React.forwardRef((props, forwardRef) => /* @__PURE__ */ jsx(StyledSeparator, { ...props, ref: forwardRef }));
|
|
563
591
|
|
|
564
592
|
const StyledSwitch = styled(Primitive.span, {
|
|
565
593
|
...styles.default,
|
|
@@ -580,14 +608,21 @@ const StyledSwitchItem = styled(RadixDropdownMenu.CheckboxItem, {
|
|
|
580
608
|
const SwitchItem = React.forwardRef(
|
|
581
609
|
({ disabled = false, checked, onChange, children, ...restProps }, forwardRef) => {
|
|
582
610
|
const ariaDisabledProps = useAriaDisabled(restProps, true);
|
|
583
|
-
return /* @__PURE__ */
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
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
|
+
) });
|
|
591
626
|
}
|
|
592
627
|
);
|
|
593
628
|
|
|
@@ -610,13 +645,32 @@ const StyledTrigger = styled(RadixDropdownMenu.Trigger, {
|
|
|
610
645
|
}
|
|
611
646
|
});
|
|
612
647
|
|
|
613
|
-
const Trigger = React.forwardRef(({ asChild = false, onPress, onClick, ...restProps }, forwardRef) =>
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
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
|
+
});
|
|
620
674
|
|
|
621
675
|
const StyledIconContainer = styled(Primitive.span, {
|
|
622
676
|
color: "$icon-neutrals-with-text",
|
|
@@ -636,17 +690,25 @@ const SubTrigger = React.forwardRef(({ children, disabled = false, ...restProps
|
|
|
636
690
|
onKeyDown: restProps.onKeyDown,
|
|
637
691
|
"aria-disabled": restProps["aria-disabled"]
|
|
638
692
|
});
|
|
639
|
-
return /* @__PURE__ */
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
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
|
+
);
|
|
650
712
|
});
|
|
651
713
|
|
|
652
714
|
const StyledSubContent = styled(
|
|
@@ -669,20 +731,20 @@ const SubContent = React.forwardRef(
|
|
|
669
731
|
...restProps
|
|
670
732
|
}, forwardRef) => {
|
|
671
733
|
const { containerSpacing } = useContent();
|
|
672
|
-
return /* @__PURE__ */
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
}
|
|
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
|
+
) });
|
|
686
748
|
}
|
|
687
749
|
);
|
|
688
750
|
|
|
@@ -691,23 +753,24 @@ const StyledSub = styled(RadixDropdownMenu.Sub, {});
|
|
|
691
753
|
const Sub = React.forwardRef(
|
|
692
754
|
({ defaultOpen, onOpen, onClose, open, ...restProps }, forwardRef) => {
|
|
693
755
|
const [openState, setOpenState] = useState(defaultOpen);
|
|
694
|
-
return /* @__PURE__ */
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
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
|
+
);
|
|
705
770
|
}
|
|
706
771
|
);
|
|
707
772
|
|
|
708
|
-
const Portal = (props) => /* @__PURE__ */
|
|
709
|
-
...props
|
|
710
|
-
});
|
|
773
|
+
const Portal = (props) => /* @__PURE__ */ jsx(Portal$1, { ...props });
|
|
711
774
|
|
|
712
775
|
const StyledIconSlot = styled(LeftSlot, {
|
|
713
776
|
square: "$5",
|
|
@@ -728,29 +791,20 @@ const IconSlot = React.forwardRef(({ children, ...restProps }, forwardRef) => {
|
|
|
728
791
|
weight: "thin"
|
|
729
792
|
}
|
|
730
793
|
);
|
|
731
|
-
|
|
794
|
+
useLayoutEffect(() => {
|
|
732
795
|
leftSlotMount();
|
|
733
796
|
return () => leftSlotDestroy();
|
|
734
797
|
}, [leftSlotMount, leftSlotDestroy]);
|
|
735
|
-
return /* @__PURE__ */
|
|
736
|
-
ref: forwardRef,
|
|
737
|
-
...restProps
|
|
738
|
-
}, /* @__PURE__ */ React.createElement(Primitive.svg, {
|
|
739
|
-
asChild: true,
|
|
740
|
-
"aria-hidden": true
|
|
741
|
-
}, formattedChildren));
|
|
798
|
+
return /* @__PURE__ */ jsx(StyledIconSlot, { ref: forwardRef, ...restProps, children: /* @__PURE__ */ jsx(Primitive.svg, { asChild: true, "aria-hidden": true, children: formattedChildren }) });
|
|
742
799
|
});
|
|
743
800
|
|
|
744
801
|
const IllustrationSlot = React.forwardRef((props, forwardRef) => {
|
|
745
802
|
const { leftSlotMount, leftSlotDestroy } = useItem();
|
|
746
|
-
|
|
803
|
+
useLayoutEffect(() => {
|
|
747
804
|
leftSlotMount();
|
|
748
805
|
return () => leftSlotDestroy();
|
|
749
806
|
}, [leftSlotMount, leftSlotDestroy]);
|
|
750
|
-
return /* @__PURE__ */
|
|
751
|
-
ref: forwardRef,
|
|
752
|
-
...props
|
|
753
|
-
});
|
|
807
|
+
return /* @__PURE__ */ jsx(StyledIllustrationSlot, { ref: forwardRef, ...props });
|
|
754
808
|
});
|
|
755
809
|
|
|
756
810
|
const DropdownMenu = ({
|
|
@@ -763,18 +817,21 @@ const DropdownMenu = ({
|
|
|
763
817
|
...restProps
|
|
764
818
|
}) => {
|
|
765
819
|
const [openState, setOpenState] = useState(defaultOpen);
|
|
766
|
-
return /* @__PURE__ */
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
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();
|
|
774
832
|
}
|
|
775
|
-
newOpen ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
|
|
776
833
|
}
|
|
777
|
-
|
|
834
|
+
);
|
|
778
835
|
};
|
|
779
836
|
DropdownMenu.CheckboxItem = CheckboxItem;
|
|
780
837
|
DropdownMenu.Content = Content;
|