@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/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');
|
|
@@ -9,8 +10,10 @@ var designSystemUtils = require('@mirohq/design-system-utils');
|
|
|
9
10
|
var designSystemPrimitive = require('@mirohq/design-system-primitive');
|
|
10
11
|
var designSystemStitches = require('@mirohq/design-system-stitches');
|
|
11
12
|
var designSystemStyles = require('@mirohq/design-system-styles');
|
|
13
|
+
var designSystemUseLayoutEffect = require('@mirohq/design-system-use-layout-effect');
|
|
12
14
|
var designSystemScrollArea = require('@mirohq/design-system-scroll-area');
|
|
13
15
|
var designSystemBaseSwitch = require('@mirohq/design-system-base-switch');
|
|
16
|
+
var utils = require('@react-aria/utils');
|
|
14
17
|
var designSystemBaseIcon = require('@mirohq/design-system-base-icon');
|
|
15
18
|
|
|
16
19
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -106,13 +109,17 @@ const ContentProvider = ({
|
|
|
106
109
|
"--right-slot-max-width": `${Math.ceil(maxWidth)}px`
|
|
107
110
|
}
|
|
108
111
|
});
|
|
109
|
-
return /* @__PURE__ */
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
113
|
+
Context$1.Provider,
|
|
114
|
+
{
|
|
115
|
+
value: {
|
|
116
|
+
rightSlotMount,
|
|
117
|
+
rightSlotDestroy,
|
|
118
|
+
containerSpacing
|
|
119
|
+
},
|
|
120
|
+
children: formattedChildren
|
|
114
121
|
}
|
|
115
|
-
|
|
122
|
+
);
|
|
116
123
|
};
|
|
117
124
|
const useContent = () => React.useContext(Context$1);
|
|
118
125
|
|
|
@@ -135,7 +142,7 @@ const StyledRightSlot = designSystemStitches.styled(designSystemPrimitive.Primit
|
|
|
135
142
|
const RightSlot = (props) => {
|
|
136
143
|
const { rightSlotMount, rightSlotDestroy } = useContent();
|
|
137
144
|
const ref = React.useRef(null);
|
|
138
|
-
|
|
145
|
+
designSystemUseLayoutEffect.useLayoutEffect(() => {
|
|
139
146
|
if (ref.current !== null) {
|
|
140
147
|
const width = ref.current.getBoundingClientRect().width;
|
|
141
148
|
const index = rightSlotMount(width);
|
|
@@ -144,10 +151,7 @@ const RightSlot = (props) => {
|
|
|
144
151
|
return () => {
|
|
145
152
|
};
|
|
146
153
|
}, [rightSlotMount, rightSlotDestroy, ref]);
|
|
147
|
-
return /* @__PURE__ */
|
|
148
|
-
ref,
|
|
149
|
-
...props
|
|
150
|
-
});
|
|
154
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledRightSlot, { ref, ...props });
|
|
151
155
|
};
|
|
152
156
|
|
|
153
157
|
const HotkeySlot = designSystemStitches.styled(RightSlot, {
|
|
@@ -300,31 +304,46 @@ const ItemProvider = ({
|
|
|
300
304
|
const formattedChildren = hasSlot ? children : designSystemUtils.addPropsToChildren(children, () => true, {
|
|
301
305
|
"data-no-left-slot": ""
|
|
302
306
|
});
|
|
303
|
-
return /* @__PURE__ */
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
308
|
+
Context.Provider,
|
|
309
|
+
{
|
|
310
|
+
value: {
|
|
311
|
+
leftSlotMount,
|
|
312
|
+
leftSlotDestroy
|
|
313
|
+
},
|
|
314
|
+
children: formattedChildren
|
|
307
315
|
}
|
|
308
|
-
|
|
316
|
+
);
|
|
309
317
|
};
|
|
310
318
|
const useItem = () => React.useContext(Context);
|
|
311
319
|
|
|
312
320
|
const CheckboxItem = React__default["default"].forwardRef(({ children, checked, onChange, disabled, ...restProps }, forwardRef) => {
|
|
313
321
|
const ariaDisabledProps = useAriaDisabled(restProps, true);
|
|
314
322
|
const { "aria-disabled": ariaDisabled } = ariaDisabledProps;
|
|
315
|
-
return /* @__PURE__ */
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
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
|
+
) });
|
|
328
347
|
});
|
|
329
348
|
|
|
330
349
|
const CONTENT_GUTTER = parseInt(designSystemStitches.theme.space[150]);
|
|
@@ -414,16 +433,19 @@ const ScrollableContent = ({
|
|
|
414
433
|
};
|
|
415
434
|
}, [maxHeight, overflow, containerSpacing]);
|
|
416
435
|
if (overflow === "auto") {
|
|
417
|
-
return /* @__PURE__ */
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
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
|
+
);
|
|
425
447
|
}
|
|
426
|
-
return /* @__PURE__ */
|
|
448
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
427
449
|
};
|
|
428
450
|
|
|
429
451
|
const Content = React__default["default"].forwardRef(
|
|
@@ -442,29 +464,31 @@ const Content = React__default["default"].forwardRef(
|
|
|
442
464
|
maxHeight,
|
|
443
465
|
children,
|
|
444
466
|
...restProps
|
|
445
|
-
}, forwardRef) => /* @__PURE__ */
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}
|
|
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
|
+
) })
|
|
463
485
|
);
|
|
464
486
|
|
|
465
487
|
const StyledItem = designSystemStitches.styled(RadixDropdownMenu__namespace.Item, {
|
|
466
488
|
...itemDefaults,
|
|
467
489
|
variants: {
|
|
490
|
+
// This is a hack for the :has() selector
|
|
491
|
+
// Remove it after Firefox implements it
|
|
468
492
|
hasRightSlot: {
|
|
469
493
|
true: {
|
|
470
494
|
paddingRight: "$600"
|
|
@@ -476,25 +500,21 @@ const StyledItem = designSystemStitches.styled(RadixDropdownMenu__namespace.Item
|
|
|
476
500
|
const Item = React__default["default"].forwardRef(
|
|
477
501
|
({ disabled = false, ...restProps }, forwardRef) => {
|
|
478
502
|
const ariaDisabledProps = useAriaDisabled(restProps);
|
|
479
|
-
return /* @__PURE__ */
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
503
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ItemProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
504
|
+
StyledItem,
|
|
505
|
+
{
|
|
506
|
+
...restProps,
|
|
507
|
+
...ariaDisabledProps,
|
|
508
|
+
disabled,
|
|
509
|
+
ref: forwardRef
|
|
510
|
+
}
|
|
511
|
+
) });
|
|
485
512
|
}
|
|
486
513
|
);
|
|
487
514
|
|
|
488
515
|
const LinkItem = React__default["default"].forwardRef(({ children, href, ...restProps }, forwardRef) => {
|
|
489
516
|
const ariaDisabledProps = useAriaDisabled(restProps);
|
|
490
|
-
return /* @__PURE__ */
|
|
491
|
-
asChild: true,
|
|
492
|
-
ref: forwardRef,
|
|
493
|
-
...restProps,
|
|
494
|
-
...ariaDisabledProps
|
|
495
|
-
}, /* @__PURE__ */ React__default["default"].createElement("a", {
|
|
496
|
-
href
|
|
497
|
-
}, children));
|
|
517
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Item, { asChild: true, ref: forwardRef, ...restProps, ...ariaDisabledProps, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href, children }) });
|
|
498
518
|
});
|
|
499
519
|
|
|
500
520
|
const StyledRadioGroup = designSystemStitches.styled(RadixDropdownMenu__namespace.RadioGroup, {
|
|
@@ -503,11 +523,14 @@ const StyledRadioGroup = designSystemStitches.styled(RadixDropdownMenu__namespac
|
|
|
503
523
|
|
|
504
524
|
const RadioGroup = React__default["default"].forwardRef((props, forwardRef) => {
|
|
505
525
|
const { onChange, ...restProps } = props;
|
|
506
|
-
return /* @__PURE__ */
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
526
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
527
|
+
StyledRadioGroup,
|
|
528
|
+
{
|
|
529
|
+
...restProps,
|
|
530
|
+
ref: forwardRef,
|
|
531
|
+
onValueChange: onChange
|
|
532
|
+
}
|
|
533
|
+
);
|
|
511
534
|
});
|
|
512
535
|
|
|
513
536
|
const StyledRadioContainer = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {
|
|
@@ -568,24 +591,29 @@ const StyledRadioItem = designSystemStitches.styled(RadixDropdownMenu__namespace
|
|
|
568
591
|
|
|
569
592
|
const RadioItem = React__default["default"].forwardRef(({ disabled = false, children, ...restProps }, forwardRef) => {
|
|
570
593
|
const ariaDisabledProps = useAriaDisabled(restProps, true);
|
|
571
|
-
return /* @__PURE__ */
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
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
|
+
) });
|
|
579
610
|
});
|
|
580
611
|
|
|
581
612
|
const StyledSeparator = designSystemStitches.styled(RadixDropdownMenu__namespace.Separator, {
|
|
582
613
|
borderTop: "1px solid $border-neutrals-subtle"
|
|
583
614
|
});
|
|
584
615
|
|
|
585
|
-
const Separator = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */
|
|
586
|
-
...props,
|
|
587
|
-
ref: forwardRef
|
|
588
|
-
}));
|
|
616
|
+
const Separator = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledSeparator, { ...props, ref: forwardRef }));
|
|
589
617
|
|
|
590
618
|
const StyledSwitch = designSystemStitches.styled(designSystemPrimitive.Primitive.span, {
|
|
591
619
|
...designSystemBaseSwitch.styles.default,
|
|
@@ -606,14 +634,21 @@ const StyledSwitchItem = designSystemStitches.styled(RadixDropdownMenu__namespac
|
|
|
606
634
|
const SwitchItem = React__default["default"].forwardRef(
|
|
607
635
|
({ disabled = false, checked, onChange, children, ...restProps }, forwardRef) => {
|
|
608
636
|
const ariaDisabledProps = useAriaDisabled(restProps, true);
|
|
609
|
-
return /* @__PURE__ */
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
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
|
+
) });
|
|
617
652
|
}
|
|
618
653
|
);
|
|
619
654
|
|
|
@@ -636,13 +671,32 @@ const StyledTrigger = designSystemStitches.styled(RadixDropdownMenu__namespace.T
|
|
|
636
671
|
}
|
|
637
672
|
});
|
|
638
673
|
|
|
639
|
-
const Trigger = React__default["default"].forwardRef(({ asChild = false, onPress, onClick, ...restProps }, forwardRef) =>
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
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
|
+
});
|
|
646
700
|
|
|
647
701
|
const StyledIconContainer = designSystemStitches.styled(designSystemPrimitive.Primitive.span, {
|
|
648
702
|
color: "$icon-neutrals-with-text",
|
|
@@ -662,17 +716,25 @@ const SubTrigger = React__default["default"].forwardRef(({ children, disabled =
|
|
|
662
716
|
onKeyDown: restProps.onKeyDown,
|
|
663
717
|
"aria-disabled": restProps["aria-disabled"]
|
|
664
718
|
});
|
|
665
|
-
return /* @__PURE__ */
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
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
|
+
);
|
|
676
738
|
});
|
|
677
739
|
|
|
678
740
|
const StyledSubContent = designSystemStitches.styled(
|
|
@@ -695,20 +757,20 @@ const SubContent = React__default["default"].forwardRef(
|
|
|
695
757
|
...restProps
|
|
696
758
|
}, forwardRef) => {
|
|
697
759
|
const { containerSpacing } = useContent();
|
|
698
|
-
return /* @__PURE__ */
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
}
|
|
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
|
+
) });
|
|
712
774
|
}
|
|
713
775
|
);
|
|
714
776
|
|
|
@@ -717,23 +779,24 @@ const StyledSub = designSystemStitches.styled(RadixDropdownMenu__namespace.Sub,
|
|
|
717
779
|
const Sub = React__default["default"].forwardRef(
|
|
718
780
|
({ defaultOpen, onOpen, onClose, open, ...restProps }, forwardRef) => {
|
|
719
781
|
const [openState, setOpenState] = React.useState(defaultOpen);
|
|
720
|
-
return /* @__PURE__ */
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
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
|
+
);
|
|
731
796
|
}
|
|
732
797
|
);
|
|
733
798
|
|
|
734
|
-
const Portal = (props) => /* @__PURE__ */
|
|
735
|
-
...props
|
|
736
|
-
});
|
|
799
|
+
const Portal = (props) => /* @__PURE__ */ jsxRuntime.jsx(RadixDropdownMenu.Portal, { ...props });
|
|
737
800
|
|
|
738
801
|
const StyledIconSlot = designSystemStitches.styled(LeftSlot, {
|
|
739
802
|
square: "$5",
|
|
@@ -754,29 +817,20 @@ const IconSlot = React__default["default"].forwardRef(({ children, ...restProps
|
|
|
754
817
|
weight: "thin"
|
|
755
818
|
}
|
|
756
819
|
);
|
|
757
|
-
|
|
820
|
+
designSystemUseLayoutEffect.useLayoutEffect(() => {
|
|
758
821
|
leftSlotMount();
|
|
759
822
|
return () => leftSlotDestroy();
|
|
760
823
|
}, [leftSlotMount, leftSlotDestroy]);
|
|
761
|
-
return /* @__PURE__ */
|
|
762
|
-
ref: forwardRef,
|
|
763
|
-
...restProps
|
|
764
|
-
}, /* @__PURE__ */ React__default["default"].createElement(designSystemPrimitive.Primitive.svg, {
|
|
765
|
-
asChild: true,
|
|
766
|
-
"aria-hidden": true
|
|
767
|
-
}, formattedChildren));
|
|
824
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledIconSlot, { ref: forwardRef, ...restProps, children: /* @__PURE__ */ jsxRuntime.jsx(designSystemPrimitive.Primitive.svg, { asChild: true, "aria-hidden": true, children: formattedChildren }) });
|
|
768
825
|
});
|
|
769
826
|
|
|
770
827
|
const IllustrationSlot = React__default["default"].forwardRef((props, forwardRef) => {
|
|
771
828
|
const { leftSlotMount, leftSlotDestroy } = useItem();
|
|
772
|
-
|
|
829
|
+
designSystemUseLayoutEffect.useLayoutEffect(() => {
|
|
773
830
|
leftSlotMount();
|
|
774
831
|
return () => leftSlotDestroy();
|
|
775
832
|
}, [leftSlotMount, leftSlotDestroy]);
|
|
776
|
-
return /* @__PURE__ */
|
|
777
|
-
ref: forwardRef,
|
|
778
|
-
...props
|
|
779
|
-
});
|
|
833
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledIllustrationSlot, { ref: forwardRef, ...props });
|
|
780
834
|
});
|
|
781
835
|
|
|
782
836
|
const DropdownMenu = ({
|
|
@@ -789,18 +843,21 @@ const DropdownMenu = ({
|
|
|
789
843
|
...restProps
|
|
790
844
|
}) => {
|
|
791
845
|
const [openState, setOpenState] = React.useState(defaultOpen);
|
|
792
|
-
return /* @__PURE__ */
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
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();
|
|
800
858
|
}
|
|
801
|
-
newOpen ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
|
|
802
859
|
}
|
|
803
|
-
|
|
860
|
+
);
|
|
804
861
|
};
|
|
805
862
|
DropdownMenu.CheckboxItem = CheckboxItem;
|
|
806
863
|
DropdownMenu.Content = Content;
|