@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/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');
|
|
@@ -107,13 +108,17 @@ const ContentProvider = ({
|
|
|
107
108
|
"--right-slot-max-width": `${Math.ceil(maxWidth)}px`
|
|
108
109
|
}
|
|
109
110
|
});
|
|
110
|
-
return /* @__PURE__ */
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
112
|
+
Context$1.Provider,
|
|
113
|
+
{
|
|
114
|
+
value: {
|
|
115
|
+
rightSlotMount,
|
|
116
|
+
rightSlotDestroy,
|
|
117
|
+
containerSpacing
|
|
118
|
+
},
|
|
119
|
+
children: formattedChildren
|
|
115
120
|
}
|
|
116
|
-
|
|
121
|
+
);
|
|
117
122
|
};
|
|
118
123
|
const useContent = () => React.useContext(Context$1);
|
|
119
124
|
|
|
@@ -145,10 +150,7 @@ const RightSlot = (props) => {
|
|
|
145
150
|
return () => {
|
|
146
151
|
};
|
|
147
152
|
}, [rightSlotMount, rightSlotDestroy, ref]);
|
|
148
|
-
return /* @__PURE__ */
|
|
149
|
-
ref,
|
|
150
|
-
...props
|
|
151
|
-
});
|
|
153
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledRightSlot, { ref, ...props });
|
|
152
154
|
};
|
|
153
155
|
|
|
154
156
|
const HotkeySlot = designSystemStitches.styled(RightSlot, {
|
|
@@ -243,7 +245,7 @@ const useAriaDisabled = ({
|
|
|
243
245
|
onSelect,
|
|
244
246
|
onPointerMove,
|
|
245
247
|
onClick
|
|
246
|
-
},
|
|
248
|
+
}, closeOnCheck = true) => React.useMemo(
|
|
247
249
|
() => ({
|
|
248
250
|
"aria-disabled": designSystemUtils.booleanify(ariaDisabled) ? ariaDisabled : void 0,
|
|
249
251
|
onKeyDown: (e) => {
|
|
@@ -255,13 +257,13 @@ const useAriaDisabled = ({
|
|
|
255
257
|
onKeyDown == null ? void 0 : onKeyDown(e);
|
|
256
258
|
},
|
|
257
259
|
onSelect: (e) => {
|
|
258
|
-
if (preventDefault) {
|
|
259
|
-
e.preventDefault();
|
|
260
|
-
}
|
|
261
260
|
if (designSystemUtils.booleanify(ariaDisabled)) {
|
|
262
261
|
e.preventDefault();
|
|
263
262
|
return;
|
|
264
263
|
}
|
|
264
|
+
if (!closeOnCheck) {
|
|
265
|
+
e.preventDefault();
|
|
266
|
+
}
|
|
265
267
|
onSelect == null ? void 0 : onSelect(e);
|
|
266
268
|
},
|
|
267
269
|
onPointerMove: (e) => {
|
|
@@ -279,7 +281,7 @@ const useAriaDisabled = ({
|
|
|
279
281
|
onClick == null ? void 0 : onClick(e);
|
|
280
282
|
}
|
|
281
283
|
}),
|
|
282
|
-
[ariaDisabled, onKeyDown, onSelect, onPointerMove, onClick,
|
|
284
|
+
[ariaDisabled, onKeyDown, onSelect, onPointerMove, onClick, closeOnCheck]
|
|
283
285
|
);
|
|
284
286
|
|
|
285
287
|
const Context = React.createContext({
|
|
@@ -301,32 +303,56 @@ const ItemProvider = ({
|
|
|
301
303
|
const formattedChildren = hasSlot ? children : designSystemUtils.addPropsToChildren(children, () => true, {
|
|
302
304
|
"data-no-left-slot": ""
|
|
303
305
|
});
|
|
304
|
-
return /* @__PURE__ */
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
306
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
307
|
+
Context.Provider,
|
|
308
|
+
{
|
|
309
|
+
value: {
|
|
310
|
+
leftSlotMount,
|
|
311
|
+
leftSlotDestroy
|
|
312
|
+
},
|
|
313
|
+
children: formattedChildren
|
|
308
314
|
}
|
|
309
|
-
|
|
315
|
+
);
|
|
310
316
|
};
|
|
311
317
|
const useItem = () => React.useContext(Context);
|
|
312
318
|
|
|
313
|
-
const CheckboxItem = React__default["default"].forwardRef(
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
return /* @__PURE__ */ React__default["default"].createElement(ItemProvider, null, /* @__PURE__ */ React__default["default"].createElement(StyledCheckboxItem, {
|
|
317
|
-
...restProps,
|
|
318
|
-
...ariaDisabledProps,
|
|
319
|
-
ref: forwardRef,
|
|
319
|
+
const CheckboxItem = React__default["default"].forwardRef(
|
|
320
|
+
({
|
|
321
|
+
children,
|
|
320
322
|
checked,
|
|
323
|
+
onChange,
|
|
321
324
|
disabled,
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
325
|
+
closeOnSelect = false,
|
|
326
|
+
...restProps
|
|
327
|
+
}, forwardRef) => {
|
|
328
|
+
const ariaDisabledProps = useAriaDisabled(restProps, closeOnSelect);
|
|
329
|
+
const { "aria-disabled": ariaDisabled } = ariaDisabledProps;
|
|
330
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ItemProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
331
|
+
StyledCheckboxItem,
|
|
332
|
+
{
|
|
333
|
+
...restProps,
|
|
334
|
+
...ariaDisabledProps,
|
|
335
|
+
ref: forwardRef,
|
|
336
|
+
checked,
|
|
337
|
+
disabled,
|
|
338
|
+
onCheckedChange: onChange,
|
|
339
|
+
children: [
|
|
340
|
+
children,
|
|
341
|
+
/* @__PURE__ */ jsxRuntime.jsx(RightSlot, { children: /* @__PURE__ */ jsxRuntime.jsxs(StyledIndicator, { children: [
|
|
342
|
+
(disabled === true || designSystemUtils.booleanify(ariaDisabled)) && !checked && /* @__PURE__ */ jsxRuntime.jsx(
|
|
343
|
+
designSystemIcons.IconProhibit,
|
|
344
|
+
{
|
|
345
|
+
weight: "thin",
|
|
346
|
+
css: { square: "$3", display: "block" }
|
|
347
|
+
}
|
|
348
|
+
),
|
|
349
|
+
checked && /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconCheckMark, { css: { square: "$3", display: "block" } })
|
|
350
|
+
] }) })
|
|
351
|
+
]
|
|
352
|
+
}
|
|
353
|
+
) });
|
|
354
|
+
}
|
|
355
|
+
);
|
|
330
356
|
|
|
331
357
|
const CONTENT_GUTTER = parseInt(designSystemStitches.theme.space[150]);
|
|
332
358
|
const CONTENT_OFFSET = parseInt(designSystemStitches.theme.space[50]);
|
|
@@ -415,16 +441,19 @@ const ScrollableContent = ({
|
|
|
415
441
|
};
|
|
416
442
|
}, [maxHeight, overflow, containerSpacing]);
|
|
417
443
|
if (overflow === "auto") {
|
|
418
|
-
return /* @__PURE__ */
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
444
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
445
|
+
designSystemScrollArea.ScrollArea,
|
|
446
|
+
{
|
|
447
|
+
css: { margin: `-${CONTENT_BORDER_FOCUS_ITEM}` },
|
|
448
|
+
type: "always",
|
|
449
|
+
children: [
|
|
450
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystemScrollArea.ScrollArea.Viewport, { css: { ...getOverflowMaxHeight() }, children }),
|
|
451
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystemScrollArea.ScrollArea.Scrollbar, { orientation: "vertical", children: /* @__PURE__ */ jsxRuntime.jsx(designSystemScrollArea.ScrollArea.Thumb, {}) })
|
|
452
|
+
]
|
|
453
|
+
}
|
|
454
|
+
);
|
|
426
455
|
}
|
|
427
|
-
return /* @__PURE__ */
|
|
456
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
428
457
|
};
|
|
429
458
|
|
|
430
459
|
const Content = React__default["default"].forwardRef(
|
|
@@ -443,29 +472,31 @@ const Content = React__default["default"].forwardRef(
|
|
|
443
472
|
maxHeight,
|
|
444
473
|
children,
|
|
445
474
|
...restProps
|
|
446
|
-
}, forwardRef) => /* @__PURE__ */
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}
|
|
475
|
+
}, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(ContentProvider, { containerSpacing, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
476
|
+
StyledContent,
|
|
477
|
+
{
|
|
478
|
+
...restProps,
|
|
479
|
+
ref: forwardRef,
|
|
480
|
+
loop,
|
|
481
|
+
side,
|
|
482
|
+
sideOffset,
|
|
483
|
+
align,
|
|
484
|
+
alignOffset,
|
|
485
|
+
avoidCollisions,
|
|
486
|
+
collisionPadding,
|
|
487
|
+
sticky,
|
|
488
|
+
hideWhenDetached,
|
|
489
|
+
containerSpacing,
|
|
490
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ScrollableContent, { ...{ containerSpacing, maxHeight, overflow }, children })
|
|
491
|
+
}
|
|
492
|
+
) })
|
|
464
493
|
);
|
|
465
494
|
|
|
466
495
|
const StyledItem = designSystemStitches.styled(RadixDropdownMenu__namespace.Item, {
|
|
467
496
|
...itemDefaults,
|
|
468
497
|
variants: {
|
|
498
|
+
// This is a hack for the :has() selector
|
|
499
|
+
// Remove it after Firefox implements it
|
|
469
500
|
hasRightSlot: {
|
|
470
501
|
true: {
|
|
471
502
|
paddingRight: "$600"
|
|
@@ -477,25 +508,21 @@ const StyledItem = designSystemStitches.styled(RadixDropdownMenu__namespace.Item
|
|
|
477
508
|
const Item = React__default["default"].forwardRef(
|
|
478
509
|
({ disabled = false, ...restProps }, forwardRef) => {
|
|
479
510
|
const ariaDisabledProps = useAriaDisabled(restProps);
|
|
480
|
-
return /* @__PURE__ */
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
511
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ItemProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
512
|
+
StyledItem,
|
|
513
|
+
{
|
|
514
|
+
...restProps,
|
|
515
|
+
...ariaDisabledProps,
|
|
516
|
+
disabled,
|
|
517
|
+
ref: forwardRef
|
|
518
|
+
}
|
|
519
|
+
) });
|
|
486
520
|
}
|
|
487
521
|
);
|
|
488
522
|
|
|
489
523
|
const LinkItem = React__default["default"].forwardRef(({ children, href, ...restProps }, forwardRef) => {
|
|
490
524
|
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));
|
|
525
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Item, { asChild: true, ref: forwardRef, ...restProps, ...ariaDisabledProps, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href, children }) });
|
|
499
526
|
});
|
|
500
527
|
|
|
501
528
|
const StyledRadioGroup = designSystemStitches.styled(RadixDropdownMenu__namespace.RadioGroup, {
|
|
@@ -504,11 +531,14 @@ const StyledRadioGroup = designSystemStitches.styled(RadixDropdownMenu__namespac
|
|
|
504
531
|
|
|
505
532
|
const RadioGroup = React__default["default"].forwardRef((props, forwardRef) => {
|
|
506
533
|
const { onChange, ...restProps } = props;
|
|
507
|
-
return /* @__PURE__ */
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
534
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
535
|
+
StyledRadioGroup,
|
|
536
|
+
{
|
|
537
|
+
...restProps,
|
|
538
|
+
ref: forwardRef,
|
|
539
|
+
onValueChange: onChange
|
|
540
|
+
}
|
|
541
|
+
);
|
|
512
542
|
});
|
|
513
543
|
|
|
514
544
|
const StyledRadioContainer = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {
|
|
@@ -567,26 +597,31 @@ const StyledRadioItem = designSystemStitches.styled(RadixDropdownMenu__namespace
|
|
|
567
597
|
}
|
|
568
598
|
});
|
|
569
599
|
|
|
570
|
-
const RadioItem = React__default["default"].forwardRef(({ disabled = false,
|
|
571
|
-
const ariaDisabledProps = useAriaDisabled(restProps,
|
|
572
|
-
return /* @__PURE__ */
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
600
|
+
const RadioItem = React__default["default"].forwardRef(({ disabled, children, closeOnSelect = false, ...restProps }, forwardRef) => {
|
|
601
|
+
const ariaDisabledProps = useAriaDisabled(restProps, closeOnSelect);
|
|
602
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ItemProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
603
|
+
StyledRadioItem,
|
|
604
|
+
{
|
|
605
|
+
...restProps,
|
|
606
|
+
...ariaDisabledProps,
|
|
607
|
+
disabled,
|
|
608
|
+
ref: forwardRef,
|
|
609
|
+
children: [
|
|
610
|
+
children,
|
|
611
|
+
/* @__PURE__ */ jsxRuntime.jsx(RightSlot, { children: /* @__PURE__ */ jsxRuntime.jsxs(StyledRadioContainer, { children: [
|
|
612
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledPill, {}),
|
|
613
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledProhibited, { weight: "thin" })
|
|
614
|
+
] }) })
|
|
615
|
+
]
|
|
616
|
+
}
|
|
617
|
+
) });
|
|
580
618
|
});
|
|
581
619
|
|
|
582
620
|
const StyledSeparator = designSystemStitches.styled(RadixDropdownMenu__namespace.Separator, {
|
|
583
621
|
borderTop: "1px solid $border-neutrals-subtle"
|
|
584
622
|
});
|
|
585
623
|
|
|
586
|
-
const Separator = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */
|
|
587
|
-
...props,
|
|
588
|
-
ref: forwardRef
|
|
589
|
-
}));
|
|
624
|
+
const Separator = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledSeparator, { ...props, ref: forwardRef }));
|
|
590
625
|
|
|
591
626
|
const StyledSwitch = designSystemStitches.styled(designSystemPrimitive.Primitive.span, {
|
|
592
627
|
...designSystemBaseSwitch.styles.default,
|
|
@@ -605,16 +640,30 @@ const StyledSwitchItem = designSystemStitches.styled(RadixDropdownMenu__namespac
|
|
|
605
640
|
});
|
|
606
641
|
|
|
607
642
|
const SwitchItem = React__default["default"].forwardRef(
|
|
608
|
-
({
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
643
|
+
({
|
|
644
|
+
disabled,
|
|
645
|
+
checked,
|
|
646
|
+
onChange,
|
|
647
|
+
children,
|
|
648
|
+
closeOnSelect = false,
|
|
649
|
+
...restProps
|
|
650
|
+
}, forwardRef) => {
|
|
651
|
+
const ariaDisabledProps = useAriaDisabled(restProps, closeOnSelect);
|
|
652
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ItemProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
653
|
+
StyledSwitchItem,
|
|
654
|
+
{
|
|
655
|
+
...restProps,
|
|
656
|
+
...ariaDisabledProps,
|
|
657
|
+
disabled,
|
|
658
|
+
checked,
|
|
659
|
+
onCheckedChange: onChange,
|
|
660
|
+
ref: forwardRef,
|
|
661
|
+
children: [
|
|
662
|
+
children,
|
|
663
|
+
/* @__PURE__ */ jsxRuntime.jsx(RightSlot, { children: /* @__PURE__ */ jsxRuntime.jsx(StyledSwitch, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystemBaseSwitch.Thumb, {}) }) })
|
|
664
|
+
]
|
|
665
|
+
}
|
|
666
|
+
) });
|
|
618
667
|
}
|
|
619
668
|
);
|
|
620
669
|
|
|
@@ -637,13 +686,16 @@ const StyledTrigger = designSystemStitches.styled(RadixDropdownMenu__namespace.T
|
|
|
637
686
|
}
|
|
638
687
|
});
|
|
639
688
|
|
|
640
|
-
const Trigger = React__default["default"].forwardRef(({ asChild = false, onPress, onClick, ...restProps }, forwardRef) => /* @__PURE__ */
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
689
|
+
const Trigger = React__default["default"].forwardRef(({ asChild = false, onPress, onClick, ...restProps }, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
690
|
+
StyledTrigger,
|
|
691
|
+
{
|
|
692
|
+
...restProps,
|
|
693
|
+
onClick: onPress != null ? onPress : onClick,
|
|
694
|
+
ref: forwardRef,
|
|
695
|
+
unstyled: !asChild,
|
|
696
|
+
asChild
|
|
697
|
+
}
|
|
698
|
+
));
|
|
647
699
|
|
|
648
700
|
const StyledIconContainer = designSystemStitches.styled(designSystemPrimitive.Primitive.span, {
|
|
649
701
|
color: "$icon-neutrals-with-text",
|
|
@@ -663,17 +715,25 @@ const SubTrigger = React__default["default"].forwardRef(({ children, disabled =
|
|
|
663
715
|
onKeyDown: restProps.onKeyDown,
|
|
664
716
|
"aria-disabled": restProps["aria-disabled"]
|
|
665
717
|
});
|
|
666
|
-
return /* @__PURE__ */
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
718
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
719
|
+
StyledSubTrigger,
|
|
720
|
+
{
|
|
721
|
+
...restProps,
|
|
722
|
+
...ariaDisabledProps,
|
|
723
|
+
disabled,
|
|
724
|
+
ref: forwardRef,
|
|
725
|
+
children: [
|
|
726
|
+
children,
|
|
727
|
+
/* @__PURE__ */ jsxRuntime.jsx(RightSlot, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
728
|
+
StyledIconContainer,
|
|
729
|
+
{
|
|
730
|
+
"data-testid": process.env.NODE_ENV === "test" ? "submenu-arrow-icon" : void 0,
|
|
731
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystemIcons.IconChevronRight, { size: "small", weight: "thin" })
|
|
732
|
+
}
|
|
733
|
+
) })
|
|
734
|
+
]
|
|
735
|
+
}
|
|
736
|
+
);
|
|
677
737
|
});
|
|
678
738
|
|
|
679
739
|
const StyledSubContent = designSystemStitches.styled(
|
|
@@ -696,20 +756,20 @@ const SubContent = React__default["default"].forwardRef(
|
|
|
696
756
|
...restProps
|
|
697
757
|
}, forwardRef) => {
|
|
698
758
|
const { containerSpacing } = useContent();
|
|
699
|
-
return /* @__PURE__ */
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
}
|
|
759
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ContentProvider, { containerSpacing, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
760
|
+
StyledSubContent,
|
|
761
|
+
{
|
|
762
|
+
...restProps,
|
|
763
|
+
ref: forwardRef,
|
|
764
|
+
sideOffset,
|
|
765
|
+
alignOffset,
|
|
766
|
+
collisionPadding,
|
|
767
|
+
loop,
|
|
768
|
+
hideWhenDetached,
|
|
769
|
+
sticky,
|
|
770
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ScrollableContent, { ...{ containerSpacing, maxHeight, overflow }, children })
|
|
771
|
+
}
|
|
772
|
+
) });
|
|
713
773
|
}
|
|
714
774
|
);
|
|
715
775
|
|
|
@@ -718,23 +778,24 @@ const StyledSub = designSystemStitches.styled(RadixDropdownMenu__namespace.Sub,
|
|
|
718
778
|
const Sub = React__default["default"].forwardRef(
|
|
719
779
|
({ defaultOpen, onOpen, onClose, open, ...restProps }, forwardRef) => {
|
|
720
780
|
const [openState, setOpenState] = React.useState(defaultOpen);
|
|
721
|
-
return /* @__PURE__ */
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
781
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
782
|
+
StyledSub,
|
|
783
|
+
{
|
|
784
|
+
...restProps,
|
|
785
|
+
open: open != null ? open : openState,
|
|
786
|
+
onOpenChange: (newOpen) => {
|
|
787
|
+
if (open == null) {
|
|
788
|
+
setOpenState(newOpen);
|
|
789
|
+
}
|
|
790
|
+
newOpen ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
|
|
791
|
+
},
|
|
792
|
+
ref: forwardRef
|
|
793
|
+
}
|
|
794
|
+
);
|
|
732
795
|
}
|
|
733
796
|
);
|
|
734
797
|
|
|
735
|
-
const Portal = (props) => /* @__PURE__ */
|
|
736
|
-
...props
|
|
737
|
-
});
|
|
798
|
+
const Portal = (props) => /* @__PURE__ */ jsxRuntime.jsx(RadixDropdownMenu.Portal, { ...props });
|
|
738
799
|
|
|
739
800
|
const StyledIconSlot = designSystemStitches.styled(LeftSlot, {
|
|
740
801
|
square: "$5",
|
|
@@ -759,13 +820,7 @@ const IconSlot = React__default["default"].forwardRef(({ children, ...restProps
|
|
|
759
820
|
leftSlotMount();
|
|
760
821
|
return () => leftSlotDestroy();
|
|
761
822
|
}, [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));
|
|
823
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledIconSlot, { ref: forwardRef, ...restProps, children: /* @__PURE__ */ jsxRuntime.jsx(designSystemPrimitive.Primitive.svg, { asChild: true, "aria-hidden": true, children: formattedChildren }) });
|
|
769
824
|
});
|
|
770
825
|
|
|
771
826
|
const IllustrationSlot = React__default["default"].forwardRef((props, forwardRef) => {
|
|
@@ -774,10 +829,7 @@ const IllustrationSlot = React__default["default"].forwardRef((props, forwardRef
|
|
|
774
829
|
leftSlotMount();
|
|
775
830
|
return () => leftSlotDestroy();
|
|
776
831
|
}, [leftSlotMount, leftSlotDestroy]);
|
|
777
|
-
return /* @__PURE__ */
|
|
778
|
-
ref: forwardRef,
|
|
779
|
-
...props
|
|
780
|
-
});
|
|
832
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledIllustrationSlot, { ref: forwardRef, ...props });
|
|
781
833
|
});
|
|
782
834
|
|
|
783
835
|
const DropdownMenu = ({
|
|
@@ -790,18 +842,21 @@ const DropdownMenu = ({
|
|
|
790
842
|
...restProps
|
|
791
843
|
}) => {
|
|
792
844
|
const [openState, setOpenState] = React.useState(defaultOpen);
|
|
793
|
-
return /* @__PURE__ */
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
845
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
846
|
+
RadixDropdownMenu__namespace.Root,
|
|
847
|
+
{
|
|
848
|
+
...restProps,
|
|
849
|
+
dir: direction,
|
|
850
|
+
modal: interactOutside,
|
|
851
|
+
open: open != null ? open : openState,
|
|
852
|
+
onOpenChange: (newOpen) => {
|
|
853
|
+
if (open == null) {
|
|
854
|
+
setOpenState(newOpen);
|
|
855
|
+
}
|
|
856
|
+
newOpen ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
|
|
801
857
|
}
|
|
802
|
-
newOpen ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
|
|
803
858
|
}
|
|
804
|
-
|
|
859
|
+
);
|
|
805
860
|
};
|
|
806
861
|
DropdownMenu.CheckboxItem = CheckboxItem;
|
|
807
862
|
DropdownMenu.Content = Content;
|