@mirohq/design-system-dropdown-menu 3.3.2 → 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 +231 -175
- package/dist/main.js.map +1 -1
- package/dist/module.js +232 -176
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +61 -51
- package/package.json +5 -4
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,6 +10,7 @@ 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');
|
|
14
16
|
var designSystemBaseIcon = require('@mirohq/design-system-base-icon');
|
|
@@ -106,13 +108,17 @@ const ContentProvider = ({
|
|
|
106
108
|
"--right-slot-max-width": `${Math.ceil(maxWidth)}px`
|
|
107
109
|
}
|
|
108
110
|
});
|
|
109
|
-
return /* @__PURE__ */
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
112
|
+
Context$1.Provider,
|
|
113
|
+
{
|
|
114
|
+
value: {
|
|
115
|
+
rightSlotMount,
|
|
116
|
+
rightSlotDestroy,
|
|
117
|
+
containerSpacing
|
|
118
|
+
},
|
|
119
|
+
children: formattedChildren
|
|
114
120
|
}
|
|
115
|
-
|
|
121
|
+
);
|
|
116
122
|
};
|
|
117
123
|
const useContent = () => React.useContext(Context$1);
|
|
118
124
|
|
|
@@ -135,7 +141,7 @@ const StyledRightSlot = designSystemStitches.styled(designSystemPrimitive.Primit
|
|
|
135
141
|
const RightSlot = (props) => {
|
|
136
142
|
const { rightSlotMount, rightSlotDestroy } = useContent();
|
|
137
143
|
const ref = React.useRef(null);
|
|
138
|
-
|
|
144
|
+
designSystemUseLayoutEffect.useLayoutEffect(() => {
|
|
139
145
|
if (ref.current !== null) {
|
|
140
146
|
const width = ref.current.getBoundingClientRect().width;
|
|
141
147
|
const index = rightSlotMount(width);
|
|
@@ -144,10 +150,7 @@ const RightSlot = (props) => {
|
|
|
144
150
|
return () => {
|
|
145
151
|
};
|
|
146
152
|
}, [rightSlotMount, rightSlotDestroy, ref]);
|
|
147
|
-
return /* @__PURE__ */
|
|
148
|
-
ref,
|
|
149
|
-
...props
|
|
150
|
-
});
|
|
153
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledRightSlot, { ref, ...props });
|
|
151
154
|
};
|
|
152
155
|
|
|
153
156
|
const HotkeySlot = designSystemStitches.styled(RightSlot, {
|
|
@@ -242,7 +245,7 @@ const useAriaDisabled = ({
|
|
|
242
245
|
onSelect,
|
|
243
246
|
onPointerMove,
|
|
244
247
|
onClick
|
|
245
|
-
},
|
|
248
|
+
}, closeOnCheck = true) => React.useMemo(
|
|
246
249
|
() => ({
|
|
247
250
|
"aria-disabled": designSystemUtils.booleanify(ariaDisabled) ? ariaDisabled : void 0,
|
|
248
251
|
onKeyDown: (e) => {
|
|
@@ -254,13 +257,13 @@ const useAriaDisabled = ({
|
|
|
254
257
|
onKeyDown == null ? void 0 : onKeyDown(e);
|
|
255
258
|
},
|
|
256
259
|
onSelect: (e) => {
|
|
257
|
-
if (preventDefault) {
|
|
258
|
-
e.preventDefault();
|
|
259
|
-
}
|
|
260
260
|
if (designSystemUtils.booleanify(ariaDisabled)) {
|
|
261
261
|
e.preventDefault();
|
|
262
262
|
return;
|
|
263
263
|
}
|
|
264
|
+
if (!closeOnCheck) {
|
|
265
|
+
e.preventDefault();
|
|
266
|
+
}
|
|
264
267
|
onSelect == null ? void 0 : onSelect(e);
|
|
265
268
|
},
|
|
266
269
|
onPointerMove: (e) => {
|
|
@@ -278,7 +281,7 @@ const useAriaDisabled = ({
|
|
|
278
281
|
onClick == null ? void 0 : onClick(e);
|
|
279
282
|
}
|
|
280
283
|
}),
|
|
281
|
-
[ariaDisabled, onKeyDown, onSelect, onPointerMove, onClick,
|
|
284
|
+
[ariaDisabled, onKeyDown, onSelect, onPointerMove, onClick, closeOnCheck]
|
|
282
285
|
);
|
|
283
286
|
|
|
284
287
|
const Context = React.createContext({
|
|
@@ -300,32 +303,56 @@ const ItemProvider = ({
|
|
|
300
303
|
const formattedChildren = hasSlot ? children : designSystemUtils.addPropsToChildren(children, () => true, {
|
|
301
304
|
"data-no-left-slot": ""
|
|
302
305
|
});
|
|
303
|
-
return /* @__PURE__ */
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
306
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
307
|
+
Context.Provider,
|
|
308
|
+
{
|
|
309
|
+
value: {
|
|
310
|
+
leftSlotMount,
|
|
311
|
+
leftSlotDestroy
|
|
312
|
+
},
|
|
313
|
+
children: formattedChildren
|
|
307
314
|
}
|
|
308
|
-
|
|
315
|
+
);
|
|
309
316
|
};
|
|
310
317
|
const useItem = () => React.useContext(Context);
|
|
311
318
|
|
|
312
|
-
const CheckboxItem = React__default["default"].forwardRef(
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
return /* @__PURE__ */ React__default["default"].createElement(ItemProvider, null, /* @__PURE__ */ React__default["default"].createElement(StyledCheckboxItem, {
|
|
316
|
-
...restProps,
|
|
317
|
-
...ariaDisabledProps,
|
|
318
|
-
ref: forwardRef,
|
|
319
|
+
const CheckboxItem = React__default["default"].forwardRef(
|
|
320
|
+
({
|
|
321
|
+
children,
|
|
319
322
|
checked,
|
|
323
|
+
onChange,
|
|
320
324
|
disabled,
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
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
|
+
);
|
|
329
356
|
|
|
330
357
|
const CONTENT_GUTTER = parseInt(designSystemStitches.theme.space[150]);
|
|
331
358
|
const CONTENT_OFFSET = parseInt(designSystemStitches.theme.space[50]);
|
|
@@ -414,16 +441,19 @@ const ScrollableContent = ({
|
|
|
414
441
|
};
|
|
415
442
|
}, [maxHeight, overflow, containerSpacing]);
|
|
416
443
|
if (overflow === "auto") {
|
|
417
|
-
return /* @__PURE__ */
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
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
|
+
);
|
|
425
455
|
}
|
|
426
|
-
return /* @__PURE__ */
|
|
456
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
427
457
|
};
|
|
428
458
|
|
|
429
459
|
const Content = React__default["default"].forwardRef(
|
|
@@ -442,29 +472,31 @@ const Content = React__default["default"].forwardRef(
|
|
|
442
472
|
maxHeight,
|
|
443
473
|
children,
|
|
444
474
|
...restProps
|
|
445
|
-
}, forwardRef) => /* @__PURE__ */
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}
|
|
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
|
+
) })
|
|
463
493
|
);
|
|
464
494
|
|
|
465
495
|
const StyledItem = designSystemStitches.styled(RadixDropdownMenu__namespace.Item, {
|
|
466
496
|
...itemDefaults,
|
|
467
497
|
variants: {
|
|
498
|
+
// This is a hack for the :has() selector
|
|
499
|
+
// Remove it after Firefox implements it
|
|
468
500
|
hasRightSlot: {
|
|
469
501
|
true: {
|
|
470
502
|
paddingRight: "$600"
|
|
@@ -476,25 +508,21 @@ const StyledItem = designSystemStitches.styled(RadixDropdownMenu__namespace.Item
|
|
|
476
508
|
const Item = React__default["default"].forwardRef(
|
|
477
509
|
({ disabled = false, ...restProps }, forwardRef) => {
|
|
478
510
|
const ariaDisabledProps = useAriaDisabled(restProps);
|
|
479
|
-
return /* @__PURE__ */
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
511
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ItemProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
512
|
+
StyledItem,
|
|
513
|
+
{
|
|
514
|
+
...restProps,
|
|
515
|
+
...ariaDisabledProps,
|
|
516
|
+
disabled,
|
|
517
|
+
ref: forwardRef
|
|
518
|
+
}
|
|
519
|
+
) });
|
|
485
520
|
}
|
|
486
521
|
);
|
|
487
522
|
|
|
488
523
|
const LinkItem = React__default["default"].forwardRef(({ children, href, ...restProps }, forwardRef) => {
|
|
489
524
|
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));
|
|
525
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Item, { asChild: true, ref: forwardRef, ...restProps, ...ariaDisabledProps, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href, children }) });
|
|
498
526
|
});
|
|
499
527
|
|
|
500
528
|
const StyledRadioGroup = designSystemStitches.styled(RadixDropdownMenu__namespace.RadioGroup, {
|
|
@@ -503,11 +531,14 @@ const StyledRadioGroup = designSystemStitches.styled(RadixDropdownMenu__namespac
|
|
|
503
531
|
|
|
504
532
|
const RadioGroup = React__default["default"].forwardRef((props, forwardRef) => {
|
|
505
533
|
const { onChange, ...restProps } = props;
|
|
506
|
-
return /* @__PURE__ */
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
534
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
535
|
+
StyledRadioGroup,
|
|
536
|
+
{
|
|
537
|
+
...restProps,
|
|
538
|
+
ref: forwardRef,
|
|
539
|
+
onValueChange: onChange
|
|
540
|
+
}
|
|
541
|
+
);
|
|
511
542
|
});
|
|
512
543
|
|
|
513
544
|
const StyledRadioContainer = designSystemStitches.styled(designSystemPrimitive.Primitive.div, {
|
|
@@ -566,26 +597,31 @@ const StyledRadioItem = designSystemStitches.styled(RadixDropdownMenu__namespace
|
|
|
566
597
|
}
|
|
567
598
|
});
|
|
568
599
|
|
|
569
|
-
const RadioItem = React__default["default"].forwardRef(({ disabled = false,
|
|
570
|
-
const ariaDisabledProps = useAriaDisabled(restProps,
|
|
571
|
-
return /* @__PURE__ */
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
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
|
+
) });
|
|
579
618
|
});
|
|
580
619
|
|
|
581
620
|
const StyledSeparator = designSystemStitches.styled(RadixDropdownMenu__namespace.Separator, {
|
|
582
621
|
borderTop: "1px solid $border-neutrals-subtle"
|
|
583
622
|
});
|
|
584
623
|
|
|
585
|
-
const Separator = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */
|
|
586
|
-
...props,
|
|
587
|
-
ref: forwardRef
|
|
588
|
-
}));
|
|
624
|
+
const Separator = React__default["default"].forwardRef((props, forwardRef) => /* @__PURE__ */ jsxRuntime.jsx(StyledSeparator, { ...props, ref: forwardRef }));
|
|
589
625
|
|
|
590
626
|
const StyledSwitch = designSystemStitches.styled(designSystemPrimitive.Primitive.span, {
|
|
591
627
|
...designSystemBaseSwitch.styles.default,
|
|
@@ -604,16 +640,30 @@ const StyledSwitchItem = designSystemStitches.styled(RadixDropdownMenu__namespac
|
|
|
604
640
|
});
|
|
605
641
|
|
|
606
642
|
const SwitchItem = React__default["default"].forwardRef(
|
|
607
|
-
({
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
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
|
+
) });
|
|
617
667
|
}
|
|
618
668
|
);
|
|
619
669
|
|
|
@@ -636,13 +686,16 @@ const StyledTrigger = designSystemStitches.styled(RadixDropdownMenu__namespace.T
|
|
|
636
686
|
}
|
|
637
687
|
});
|
|
638
688
|
|
|
639
|
-
const Trigger = React__default["default"].forwardRef(({ asChild = false, onPress, onClick, ...restProps }, forwardRef) => /* @__PURE__ */
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
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
|
+
));
|
|
646
699
|
|
|
647
700
|
const StyledIconContainer = designSystemStitches.styled(designSystemPrimitive.Primitive.span, {
|
|
648
701
|
color: "$icon-neutrals-with-text",
|
|
@@ -662,17 +715,25 @@ const SubTrigger = React__default["default"].forwardRef(({ children, disabled =
|
|
|
662
715
|
onKeyDown: restProps.onKeyDown,
|
|
663
716
|
"aria-disabled": restProps["aria-disabled"]
|
|
664
717
|
});
|
|
665
|
-
return /* @__PURE__ */
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
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
|
+
);
|
|
676
737
|
});
|
|
677
738
|
|
|
678
739
|
const StyledSubContent = designSystemStitches.styled(
|
|
@@ -695,20 +756,20 @@ const SubContent = React__default["default"].forwardRef(
|
|
|
695
756
|
...restProps
|
|
696
757
|
}, forwardRef) => {
|
|
697
758
|
const { containerSpacing } = useContent();
|
|
698
|
-
return /* @__PURE__ */
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
}
|
|
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
|
+
) });
|
|
712
773
|
}
|
|
713
774
|
);
|
|
714
775
|
|
|
@@ -717,23 +778,24 @@ const StyledSub = designSystemStitches.styled(RadixDropdownMenu__namespace.Sub,
|
|
|
717
778
|
const Sub = React__default["default"].forwardRef(
|
|
718
779
|
({ defaultOpen, onOpen, onClose, open, ...restProps }, forwardRef) => {
|
|
719
780
|
const [openState, setOpenState] = React.useState(defaultOpen);
|
|
720
|
-
return /* @__PURE__ */
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
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
|
+
);
|
|
731
795
|
}
|
|
732
796
|
);
|
|
733
797
|
|
|
734
|
-
const Portal = (props) => /* @__PURE__ */
|
|
735
|
-
...props
|
|
736
|
-
});
|
|
798
|
+
const Portal = (props) => /* @__PURE__ */ jsxRuntime.jsx(RadixDropdownMenu.Portal, { ...props });
|
|
737
799
|
|
|
738
800
|
const StyledIconSlot = designSystemStitches.styled(LeftSlot, {
|
|
739
801
|
square: "$5",
|
|
@@ -754,29 +816,20 @@ const IconSlot = React__default["default"].forwardRef(({ children, ...restProps
|
|
|
754
816
|
weight: "thin"
|
|
755
817
|
}
|
|
756
818
|
);
|
|
757
|
-
|
|
819
|
+
designSystemUseLayoutEffect.useLayoutEffect(() => {
|
|
758
820
|
leftSlotMount();
|
|
759
821
|
return () => leftSlotDestroy();
|
|
760
822
|
}, [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));
|
|
823
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledIconSlot, { ref: forwardRef, ...restProps, children: /* @__PURE__ */ jsxRuntime.jsx(designSystemPrimitive.Primitive.svg, { asChild: true, "aria-hidden": true, children: formattedChildren }) });
|
|
768
824
|
});
|
|
769
825
|
|
|
770
826
|
const IllustrationSlot = React__default["default"].forwardRef((props, forwardRef) => {
|
|
771
827
|
const { leftSlotMount, leftSlotDestroy } = useItem();
|
|
772
|
-
|
|
828
|
+
designSystemUseLayoutEffect.useLayoutEffect(() => {
|
|
773
829
|
leftSlotMount();
|
|
774
830
|
return () => leftSlotDestroy();
|
|
775
831
|
}, [leftSlotMount, leftSlotDestroy]);
|
|
776
|
-
return /* @__PURE__ */
|
|
777
|
-
ref: forwardRef,
|
|
778
|
-
...props
|
|
779
|
-
});
|
|
832
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledIllustrationSlot, { ref: forwardRef, ...props });
|
|
780
833
|
});
|
|
781
834
|
|
|
782
835
|
const DropdownMenu = ({
|
|
@@ -789,18 +842,21 @@ const DropdownMenu = ({
|
|
|
789
842
|
...restProps
|
|
790
843
|
}) => {
|
|
791
844
|
const [openState, setOpenState] = React.useState(defaultOpen);
|
|
792
|
-
return /* @__PURE__ */
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
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();
|
|
800
857
|
}
|
|
801
|
-
newOpen ? onOpen == null ? void 0 : onOpen() : onClose == null ? void 0 : onClose();
|
|
802
858
|
}
|
|
803
|
-
|
|
859
|
+
);
|
|
804
860
|
};
|
|
805
861
|
DropdownMenu.CheckboxItem = CheckboxItem;
|
|
806
862
|
DropdownMenu.Content = Content;
|