@mirohq/design-system-dropdown-menu 3.3.3 → 3.4.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/dist/main.js +227 -172
- package/dist/main.js.map +1 -1
- package/dist/module.js +227 -172
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +61 -51
- package/package.json +3 -3
package/dist/module.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
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';
|
|
@@ -81,13 +82,17 @@ const ContentProvider = ({
|
|
|
81
82
|
"--right-slot-max-width": `${Math.ceil(maxWidth)}px`
|
|
82
83
|
}
|
|
83
84
|
});
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
return /* @__PURE__ */ jsx(
|
|
86
|
+
Context$1.Provider,
|
|
87
|
+
{
|
|
88
|
+
value: {
|
|
89
|
+
rightSlotMount,
|
|
90
|
+
rightSlotDestroy,
|
|
91
|
+
containerSpacing
|
|
92
|
+
},
|
|
93
|
+
children: formattedChildren
|
|
89
94
|
}
|
|
90
|
-
|
|
95
|
+
);
|
|
91
96
|
};
|
|
92
97
|
const useContent = () => useContext(Context$1);
|
|
93
98
|
|
|
@@ -119,10 +124,7 @@ const RightSlot = (props) => {
|
|
|
119
124
|
return () => {
|
|
120
125
|
};
|
|
121
126
|
}, [rightSlotMount, rightSlotDestroy, ref]);
|
|
122
|
-
return /* @__PURE__ */
|
|
123
|
-
ref,
|
|
124
|
-
...props
|
|
125
|
-
});
|
|
127
|
+
return /* @__PURE__ */ jsx(StyledRightSlot, { ref, ...props });
|
|
126
128
|
};
|
|
127
129
|
|
|
128
130
|
const HotkeySlot = styled(RightSlot, {
|
|
@@ -217,7 +219,7 @@ const useAriaDisabled = ({
|
|
|
217
219
|
onSelect,
|
|
218
220
|
onPointerMove,
|
|
219
221
|
onClick
|
|
220
|
-
},
|
|
222
|
+
}, closeOnCheck = true) => useMemo(
|
|
221
223
|
() => ({
|
|
222
224
|
"aria-disabled": booleanify(ariaDisabled) ? ariaDisabled : void 0,
|
|
223
225
|
onKeyDown: (e) => {
|
|
@@ -229,13 +231,13 @@ const useAriaDisabled = ({
|
|
|
229
231
|
onKeyDown == null ? void 0 : onKeyDown(e);
|
|
230
232
|
},
|
|
231
233
|
onSelect: (e) => {
|
|
232
|
-
if (preventDefault) {
|
|
233
|
-
e.preventDefault();
|
|
234
|
-
}
|
|
235
234
|
if (booleanify(ariaDisabled)) {
|
|
236
235
|
e.preventDefault();
|
|
237
236
|
return;
|
|
238
237
|
}
|
|
238
|
+
if (!closeOnCheck) {
|
|
239
|
+
e.preventDefault();
|
|
240
|
+
}
|
|
239
241
|
onSelect == null ? void 0 : onSelect(e);
|
|
240
242
|
},
|
|
241
243
|
onPointerMove: (e) => {
|
|
@@ -253,7 +255,7 @@ const useAriaDisabled = ({
|
|
|
253
255
|
onClick == null ? void 0 : onClick(e);
|
|
254
256
|
}
|
|
255
257
|
}),
|
|
256
|
-
[ariaDisabled, onKeyDown, onSelect, onPointerMove, onClick,
|
|
258
|
+
[ariaDisabled, onKeyDown, onSelect, onPointerMove, onClick, closeOnCheck]
|
|
257
259
|
);
|
|
258
260
|
|
|
259
261
|
const Context = createContext({
|
|
@@ -275,32 +277,56 @@ const ItemProvider = ({
|
|
|
275
277
|
const formattedChildren = hasSlot ? children : addPropsToChildren(children, () => true, {
|
|
276
278
|
"data-no-left-slot": ""
|
|
277
279
|
});
|
|
278
|
-
return /* @__PURE__ */
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
280
|
+
return /* @__PURE__ */ jsx(
|
|
281
|
+
Context.Provider,
|
|
282
|
+
{
|
|
283
|
+
value: {
|
|
284
|
+
leftSlotMount,
|
|
285
|
+
leftSlotDestroy
|
|
286
|
+
},
|
|
287
|
+
children: formattedChildren
|
|
282
288
|
}
|
|
283
|
-
|
|
289
|
+
);
|
|
284
290
|
};
|
|
285
291
|
const useItem = () => useContext(Context);
|
|
286
292
|
|
|
287
|
-
const CheckboxItem = React.forwardRef(
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
return /* @__PURE__ */ React.createElement(ItemProvider, null, /* @__PURE__ */ React.createElement(StyledCheckboxItem, {
|
|
291
|
-
...restProps,
|
|
292
|
-
...ariaDisabledProps,
|
|
293
|
-
ref: forwardRef,
|
|
293
|
+
const CheckboxItem = React.forwardRef(
|
|
294
|
+
({
|
|
295
|
+
children,
|
|
294
296
|
checked,
|
|
297
|
+
onChange,
|
|
295
298
|
disabled,
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
299
|
+
closeOnSelect = false,
|
|
300
|
+
...restProps
|
|
301
|
+
}, forwardRef) => {
|
|
302
|
+
const ariaDisabledProps = useAriaDisabled(restProps, closeOnSelect);
|
|
303
|
+
const { "aria-disabled": ariaDisabled } = ariaDisabledProps;
|
|
304
|
+
return /* @__PURE__ */ jsx(ItemProvider, { children: /* @__PURE__ */ jsxs(
|
|
305
|
+
StyledCheckboxItem,
|
|
306
|
+
{
|
|
307
|
+
...restProps,
|
|
308
|
+
...ariaDisabledProps,
|
|
309
|
+
ref: forwardRef,
|
|
310
|
+
checked,
|
|
311
|
+
disabled,
|
|
312
|
+
onCheckedChange: onChange,
|
|
313
|
+
children: [
|
|
314
|
+
children,
|
|
315
|
+
/* @__PURE__ */ jsx(RightSlot, { children: /* @__PURE__ */ jsxs(StyledIndicator, { children: [
|
|
316
|
+
(disabled === true || booleanify(ariaDisabled)) && !checked && /* @__PURE__ */ jsx(
|
|
317
|
+
IconProhibit,
|
|
318
|
+
{
|
|
319
|
+
weight: "thin",
|
|
320
|
+
css: { square: "$3", display: "block" }
|
|
321
|
+
}
|
|
322
|
+
),
|
|
323
|
+
checked && /* @__PURE__ */ jsx(IconCheckMark, { css: { square: "$3", display: "block" } })
|
|
324
|
+
] }) })
|
|
325
|
+
]
|
|
326
|
+
}
|
|
327
|
+
) });
|
|
328
|
+
}
|
|
329
|
+
);
|
|
304
330
|
|
|
305
331
|
const CONTENT_GUTTER = parseInt(theme.space[150]);
|
|
306
332
|
const CONTENT_OFFSET = parseInt(theme.space[50]);
|
|
@@ -389,16 +415,19 @@ const ScrollableContent = ({
|
|
|
389
415
|
};
|
|
390
416
|
}, [maxHeight, overflow, containerSpacing]);
|
|
391
417
|
if (overflow === "auto") {
|
|
392
|
-
return /* @__PURE__ */
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
418
|
+
return /* @__PURE__ */ jsxs(
|
|
419
|
+
ScrollArea,
|
|
420
|
+
{
|
|
421
|
+
css: { margin: `-${CONTENT_BORDER_FOCUS_ITEM}` },
|
|
422
|
+
type: "always",
|
|
423
|
+
children: [
|
|
424
|
+
/* @__PURE__ */ jsx(ScrollArea.Viewport, { css: { ...getOverflowMaxHeight() }, children }),
|
|
425
|
+
/* @__PURE__ */ jsx(ScrollArea.Scrollbar, { orientation: "vertical", children: /* @__PURE__ */ jsx(ScrollArea.Thumb, {}) })
|
|
426
|
+
]
|
|
427
|
+
}
|
|
428
|
+
);
|
|
400
429
|
}
|
|
401
|
-
return /* @__PURE__ */
|
|
430
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
402
431
|
};
|
|
403
432
|
|
|
404
433
|
const Content = React.forwardRef(
|
|
@@ -417,29 +446,31 @@ const Content = React.forwardRef(
|
|
|
417
446
|
maxHeight,
|
|
418
447
|
children,
|
|
419
448
|
...restProps
|
|
420
|
-
}, forwardRef) => /* @__PURE__ */
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
}
|
|
449
|
+
}, forwardRef) => /* @__PURE__ */ jsx(ContentProvider, { containerSpacing, children: /* @__PURE__ */ jsx(
|
|
450
|
+
StyledContent,
|
|
451
|
+
{
|
|
452
|
+
...restProps,
|
|
453
|
+
ref: forwardRef,
|
|
454
|
+
loop,
|
|
455
|
+
side,
|
|
456
|
+
sideOffset,
|
|
457
|
+
align,
|
|
458
|
+
alignOffset,
|
|
459
|
+
avoidCollisions,
|
|
460
|
+
collisionPadding,
|
|
461
|
+
sticky,
|
|
462
|
+
hideWhenDetached,
|
|
463
|
+
containerSpacing,
|
|
464
|
+
children: /* @__PURE__ */ jsx(ScrollableContent, { ...{ containerSpacing, maxHeight, overflow }, children })
|
|
465
|
+
}
|
|
466
|
+
) })
|
|
438
467
|
);
|
|
439
468
|
|
|
440
469
|
const StyledItem = styled(RadixDropdownMenu.Item, {
|
|
441
470
|
...itemDefaults,
|
|
442
471
|
variants: {
|
|
472
|
+
// This is a hack for the :has() selector
|
|
473
|
+
// Remove it after Firefox implements it
|
|
443
474
|
hasRightSlot: {
|
|
444
475
|
true: {
|
|
445
476
|
paddingRight: "$600"
|
|
@@ -451,25 +482,21 @@ const StyledItem = styled(RadixDropdownMenu.Item, {
|
|
|
451
482
|
const Item = React.forwardRef(
|
|
452
483
|
({ disabled = false, ...restProps }, forwardRef) => {
|
|
453
484
|
const ariaDisabledProps = useAriaDisabled(restProps);
|
|
454
|
-
return /* @__PURE__ */
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
485
|
+
return /* @__PURE__ */ jsx(ItemProvider, { children: /* @__PURE__ */ jsx(
|
|
486
|
+
StyledItem,
|
|
487
|
+
{
|
|
488
|
+
...restProps,
|
|
489
|
+
...ariaDisabledProps,
|
|
490
|
+
disabled,
|
|
491
|
+
ref: forwardRef
|
|
492
|
+
}
|
|
493
|
+
) });
|
|
460
494
|
}
|
|
461
495
|
);
|
|
462
496
|
|
|
463
497
|
const LinkItem = React.forwardRef(({ children, href, ...restProps }, forwardRef) => {
|
|
464
498
|
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));
|
|
499
|
+
return /* @__PURE__ */ jsx(Item, { asChild: true, ref: forwardRef, ...restProps, ...ariaDisabledProps, children: /* @__PURE__ */ jsx("a", { href, children }) });
|
|
473
500
|
});
|
|
474
501
|
|
|
475
502
|
const StyledRadioGroup = styled(RadixDropdownMenu.RadioGroup, {
|
|
@@ -478,11 +505,14 @@ const StyledRadioGroup = styled(RadixDropdownMenu.RadioGroup, {
|
|
|
478
505
|
|
|
479
506
|
const RadioGroup = React.forwardRef((props, forwardRef) => {
|
|
480
507
|
const { onChange, ...restProps } = props;
|
|
481
|
-
return /* @__PURE__ */
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
508
|
+
return /* @__PURE__ */ jsx(
|
|
509
|
+
StyledRadioGroup,
|
|
510
|
+
{
|
|
511
|
+
...restProps,
|
|
512
|
+
ref: forwardRef,
|
|
513
|
+
onValueChange: onChange
|
|
514
|
+
}
|
|
515
|
+
);
|
|
486
516
|
});
|
|
487
517
|
|
|
488
518
|
const StyledRadioContainer = styled(Primitive.div, {
|
|
@@ -541,26 +571,31 @@ const StyledRadioItem = styled(RadixDropdownMenu.RadioItem, {
|
|
|
541
571
|
}
|
|
542
572
|
});
|
|
543
573
|
|
|
544
|
-
const RadioItem = React.forwardRef(({ disabled = false,
|
|
545
|
-
const ariaDisabledProps = useAriaDisabled(restProps,
|
|
546
|
-
return /* @__PURE__ */
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
574
|
+
const RadioItem = React.forwardRef(({ disabled, children, closeOnSelect = false, ...restProps }, forwardRef) => {
|
|
575
|
+
const ariaDisabledProps = useAriaDisabled(restProps, closeOnSelect);
|
|
576
|
+
return /* @__PURE__ */ jsx(ItemProvider, { children: /* @__PURE__ */ jsxs(
|
|
577
|
+
StyledRadioItem,
|
|
578
|
+
{
|
|
579
|
+
...restProps,
|
|
580
|
+
...ariaDisabledProps,
|
|
581
|
+
disabled,
|
|
582
|
+
ref: forwardRef,
|
|
583
|
+
children: [
|
|
584
|
+
children,
|
|
585
|
+
/* @__PURE__ */ jsx(RightSlot, { children: /* @__PURE__ */ jsxs(StyledRadioContainer, { children: [
|
|
586
|
+
/* @__PURE__ */ jsx(StyledPill, {}),
|
|
587
|
+
/* @__PURE__ */ jsx(StyledProhibited, { weight: "thin" })
|
|
588
|
+
] }) })
|
|
589
|
+
]
|
|
590
|
+
}
|
|
591
|
+
) });
|
|
554
592
|
});
|
|
555
593
|
|
|
556
594
|
const StyledSeparator = styled(RadixDropdownMenu.Separator, {
|
|
557
595
|
borderTop: "1px solid $border-neutrals-subtle"
|
|
558
596
|
});
|
|
559
597
|
|
|
560
|
-
const Separator = React.forwardRef((props, forwardRef) => /* @__PURE__ */
|
|
561
|
-
...props,
|
|
562
|
-
ref: forwardRef
|
|
563
|
-
}));
|
|
598
|
+
const Separator = React.forwardRef((props, forwardRef) => /* @__PURE__ */ jsx(StyledSeparator, { ...props, ref: forwardRef }));
|
|
564
599
|
|
|
565
600
|
const StyledSwitch = styled(Primitive.span, {
|
|
566
601
|
...styles.default,
|
|
@@ -579,16 +614,30 @@ const StyledSwitchItem = styled(RadixDropdownMenu.CheckboxItem, {
|
|
|
579
614
|
});
|
|
580
615
|
|
|
581
616
|
const SwitchItem = React.forwardRef(
|
|
582
|
-
({
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
617
|
+
({
|
|
618
|
+
disabled,
|
|
619
|
+
checked,
|
|
620
|
+
onChange,
|
|
621
|
+
children,
|
|
622
|
+
closeOnSelect = false,
|
|
623
|
+
...restProps
|
|
624
|
+
}, forwardRef) => {
|
|
625
|
+
const ariaDisabledProps = useAriaDisabled(restProps, closeOnSelect);
|
|
626
|
+
return /* @__PURE__ */ jsx(ItemProvider, { children: /* @__PURE__ */ jsxs(
|
|
627
|
+
StyledSwitchItem,
|
|
628
|
+
{
|
|
629
|
+
...restProps,
|
|
630
|
+
...ariaDisabledProps,
|
|
631
|
+
disabled,
|
|
632
|
+
checked,
|
|
633
|
+
onCheckedChange: onChange,
|
|
634
|
+
ref: forwardRef,
|
|
635
|
+
children: [
|
|
636
|
+
children,
|
|
637
|
+
/* @__PURE__ */ jsx(RightSlot, { children: /* @__PURE__ */ jsx(StyledSwitch, { children: /* @__PURE__ */ jsx(Thumb, {}) }) })
|
|
638
|
+
]
|
|
639
|
+
}
|
|
640
|
+
) });
|
|
592
641
|
}
|
|
593
642
|
);
|
|
594
643
|
|
|
@@ -611,13 +660,16 @@ const StyledTrigger = styled(RadixDropdownMenu.Trigger, {
|
|
|
611
660
|
}
|
|
612
661
|
});
|
|
613
662
|
|
|
614
|
-
const Trigger = React.forwardRef(({ asChild = false, onPress, onClick, ...restProps }, forwardRef) => /* @__PURE__ */
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
663
|
+
const Trigger = React.forwardRef(({ asChild = false, onPress, onClick, ...restProps }, forwardRef) => /* @__PURE__ */ jsx(
|
|
664
|
+
StyledTrigger,
|
|
665
|
+
{
|
|
666
|
+
...restProps,
|
|
667
|
+
onClick: onPress != null ? onPress : onClick,
|
|
668
|
+
ref: forwardRef,
|
|
669
|
+
unstyled: !asChild,
|
|
670
|
+
asChild
|
|
671
|
+
}
|
|
672
|
+
));
|
|
621
673
|
|
|
622
674
|
const StyledIconContainer = styled(Primitive.span, {
|
|
623
675
|
color: "$icon-neutrals-with-text",
|
|
@@ -637,17 +689,25 @@ const SubTrigger = React.forwardRef(({ children, disabled = false, ...restProps
|
|
|
637
689
|
onKeyDown: restProps.onKeyDown,
|
|
638
690
|
"aria-disabled": restProps["aria-disabled"]
|
|
639
691
|
});
|
|
640
|
-
return /* @__PURE__ */
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
692
|
+
return /* @__PURE__ */ jsxs(
|
|
693
|
+
StyledSubTrigger,
|
|
694
|
+
{
|
|
695
|
+
...restProps,
|
|
696
|
+
...ariaDisabledProps,
|
|
697
|
+
disabled,
|
|
698
|
+
ref: forwardRef,
|
|
699
|
+
children: [
|
|
700
|
+
children,
|
|
701
|
+
/* @__PURE__ */ jsx(RightSlot, { children: /* @__PURE__ */ jsx(
|
|
702
|
+
StyledIconContainer,
|
|
703
|
+
{
|
|
704
|
+
"data-testid": process.env.NODE_ENV === "test" ? "submenu-arrow-icon" : void 0,
|
|
705
|
+
children: /* @__PURE__ */ jsx(IconChevronRight, { size: "small", weight: "thin" })
|
|
706
|
+
}
|
|
707
|
+
) })
|
|
708
|
+
]
|
|
709
|
+
}
|
|
710
|
+
);
|
|
651
711
|
});
|
|
652
712
|
|
|
653
713
|
const StyledSubContent = styled(
|
|
@@ -670,20 +730,20 @@ const SubContent = React.forwardRef(
|
|
|
670
730
|
...restProps
|
|
671
731
|
}, forwardRef) => {
|
|
672
732
|
const { containerSpacing } = useContent();
|
|
673
|
-
return /* @__PURE__ */
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
}
|
|
733
|
+
return /* @__PURE__ */ jsx(ContentProvider, { containerSpacing, children: /* @__PURE__ */ jsx(
|
|
734
|
+
StyledSubContent,
|
|
735
|
+
{
|
|
736
|
+
...restProps,
|
|
737
|
+
ref: forwardRef,
|
|
738
|
+
sideOffset,
|
|
739
|
+
alignOffset,
|
|
740
|
+
collisionPadding,
|
|
741
|
+
loop,
|
|
742
|
+
hideWhenDetached,
|
|
743
|
+
sticky,
|
|
744
|
+
children: /* @__PURE__ */ jsx(ScrollableContent, { ...{ containerSpacing, maxHeight, overflow }, children })
|
|
745
|
+
}
|
|
746
|
+
) });
|
|
687
747
|
}
|
|
688
748
|
);
|
|
689
749
|
|
|
@@ -692,23 +752,24 @@ const StyledSub = styled(RadixDropdownMenu.Sub, {});
|
|
|
692
752
|
const Sub = React.forwardRef(
|
|
693
753
|
({ defaultOpen, onOpen, onClose, open, ...restProps }, forwardRef) => {
|
|
694
754
|
const [openState, setOpenState] = useState(defaultOpen);
|
|
695
|
-
return /* @__PURE__ */
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
755
|
+
return /* @__PURE__ */ jsx(
|
|
756
|
+
StyledSub,
|
|
757
|
+
{
|
|
758
|
+
...restProps,
|
|
759
|
+
open: open != null ? open : openState,
|
|
760
|
+
onOpenChange: (newOpen) => {
|
|
761
|
+
if (open == null) {
|
|
762
|
+
setOpenState(newOpen);
|
|
763
|
+
}
|
|
764
|
+
newOpen ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
|
|
765
|
+
},
|
|
766
|
+
ref: forwardRef
|
|
767
|
+
}
|
|
768
|
+
);
|
|
706
769
|
}
|
|
707
770
|
);
|
|
708
771
|
|
|
709
|
-
const Portal = (props) => /* @__PURE__ */
|
|
710
|
-
...props
|
|
711
|
-
});
|
|
772
|
+
const Portal = (props) => /* @__PURE__ */ jsx(Portal$1, { ...props });
|
|
712
773
|
|
|
713
774
|
const StyledIconSlot = styled(LeftSlot, {
|
|
714
775
|
square: "$5",
|
|
@@ -733,13 +794,7 @@ const IconSlot = React.forwardRef(({ children, ...restProps }, forwardRef) => {
|
|
|
733
794
|
leftSlotMount();
|
|
734
795
|
return () => leftSlotDestroy();
|
|
735
796
|
}, [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));
|
|
797
|
+
return /* @__PURE__ */ jsx(StyledIconSlot, { ref: forwardRef, ...restProps, children: /* @__PURE__ */ jsx(Primitive.svg, { asChild: true, "aria-hidden": true, children: formattedChildren }) });
|
|
743
798
|
});
|
|
744
799
|
|
|
745
800
|
const IllustrationSlot = React.forwardRef((props, forwardRef) => {
|
|
@@ -748,10 +803,7 @@ const IllustrationSlot = React.forwardRef((props, forwardRef) => {
|
|
|
748
803
|
leftSlotMount();
|
|
749
804
|
return () => leftSlotDestroy();
|
|
750
805
|
}, [leftSlotMount, leftSlotDestroy]);
|
|
751
|
-
return /* @__PURE__ */
|
|
752
|
-
ref: forwardRef,
|
|
753
|
-
...props
|
|
754
|
-
});
|
|
806
|
+
return /* @__PURE__ */ jsx(StyledIllustrationSlot, { ref: forwardRef, ...props });
|
|
755
807
|
});
|
|
756
808
|
|
|
757
809
|
const DropdownMenu = ({
|
|
@@ -764,18 +816,21 @@ const DropdownMenu = ({
|
|
|
764
816
|
...restProps
|
|
765
817
|
}) => {
|
|
766
818
|
const [openState, setOpenState] = useState(defaultOpen);
|
|
767
|
-
return /* @__PURE__ */
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
819
|
+
return /* @__PURE__ */ jsx(
|
|
820
|
+
RadixDropdownMenu.Root,
|
|
821
|
+
{
|
|
822
|
+
...restProps,
|
|
823
|
+
dir: direction,
|
|
824
|
+
modal: interactOutside,
|
|
825
|
+
open: open != null ? open : openState,
|
|
826
|
+
onOpenChange: (newOpen) => {
|
|
827
|
+
if (open == null) {
|
|
828
|
+
setOpenState(newOpen);
|
|
829
|
+
}
|
|
830
|
+
newOpen ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
|
|
775
831
|
}
|
|
776
|
-
newOpen ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
|
|
777
832
|
}
|
|
778
|
-
|
|
833
|
+
);
|
|
779
834
|
};
|
|
780
835
|
DropdownMenu.CheckboxItem = CheckboxItem;
|
|
781
836
|
DropdownMenu.Content = Content;
|