@plasmicpkgs/radix-ui 0.0.27 → 0.0.29
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/index.js +14 -3
- package/dist/index.mjs +14 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -492,6 +492,16 @@ var popoverProps = {
|
|
|
492
492
|
description: "Add additional subtle slide-in animation on reveal, which can depend on where the tooltip is dynamically placed."
|
|
493
493
|
}
|
|
494
494
|
};
|
|
495
|
+
function unwrapSingleFragment(node) {
|
|
496
|
+
if (React.isValidElement(node) && node.type === React.Fragment) {
|
|
497
|
+
const children = React.Children.toArray(node.props.children);
|
|
498
|
+
if (children.length === 1) {
|
|
499
|
+
const props = { ...(0, import_remeda.omit)(node.props, ["children"]), key: node.key };
|
|
500
|
+
return /* @__PURE__ */ React.createElement("div", { ...props }, children[0]);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
return node;
|
|
504
|
+
}
|
|
495
505
|
|
|
496
506
|
// src/popover.tsx
|
|
497
507
|
function Popover({
|
|
@@ -527,7 +537,7 @@ function Popover({
|
|
|
527
537
|
defaultOpen,
|
|
528
538
|
modal
|
|
529
539
|
},
|
|
530
|
-
trigger ? /* @__PURE__ */ React2.createElement(PopoverPrimitive.Trigger, { asChild: true }, children) : /* @__PURE__ */ React2.createElement(PopoverPrimitive.Anchor, { asChild: true }, children),
|
|
540
|
+
trigger ? /* @__PURE__ */ React2.createElement(PopoverPrimitive.Trigger, { asChild: true }, unwrapSingleFragment(children)) : /* @__PURE__ */ React2.createElement(PopoverPrimitive.Anchor, { asChild: true }, children),
|
|
531
541
|
/* @__PURE__ */ React2.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React2.createElement(
|
|
532
542
|
PopoverPrimitive.Content,
|
|
533
543
|
{
|
|
@@ -574,6 +584,7 @@ function registerPopover(PLASMIC) {
|
|
|
574
584
|
type: "boolean",
|
|
575
585
|
displayName: "Trigger on click",
|
|
576
586
|
defaultValueHint: true,
|
|
587
|
+
description: `Instead of automatically showing the popover on click, you can toggle the popover's "open" state from any interaction. This enables more custom control over when it is shown.`,
|
|
577
588
|
advanced: true
|
|
578
589
|
},
|
|
579
590
|
...popoverProps,
|
|
@@ -732,7 +743,7 @@ var Dialog = React3.forwardRef(
|
|
|
732
743
|
onOpenChange,
|
|
733
744
|
defaultOpen
|
|
734
745
|
},
|
|
735
|
-
/* @__PURE__ */ React3.createElement(DialogPrimitive.Trigger, { asChild: true }, triggerSlot),
|
|
746
|
+
/* @__PURE__ */ React3.createElement(DialogPrimitive.Trigger, { asChild: true }, unwrapSingleFragment(triggerSlot)),
|
|
736
747
|
noContain ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(DialogPrimitive.Portal, null, /* @__PURE__ */ React3.createElement(
|
|
737
748
|
DialogOverlay,
|
|
738
749
|
{
|
|
@@ -1004,7 +1015,7 @@ var Tooltip = React4.forwardRef(
|
|
|
1004
1015
|
defaultOpen
|
|
1005
1016
|
}
|
|
1006
1017
|
},
|
|
1007
|
-
/* @__PURE__ */ React4.createElement(TooltipPrimitive.Trigger, { asChild: true }, children),
|
|
1018
|
+
/* @__PURE__ */ React4.createElement(TooltipPrimitive.Trigger, { asChild: true }, unwrapSingleFragment(children)),
|
|
1008
1019
|
/* @__PURE__ */ React4.createElement(
|
|
1009
1020
|
TooltipPrimitive.Content,
|
|
1010
1021
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -447,6 +447,16 @@ var popoverProps = {
|
|
|
447
447
|
description: "Add additional subtle slide-in animation on reveal, which can depend on where the tooltip is dynamically placed."
|
|
448
448
|
}
|
|
449
449
|
};
|
|
450
|
+
function unwrapSingleFragment(node) {
|
|
451
|
+
if (React.isValidElement(node) && node.type === React.Fragment) {
|
|
452
|
+
const children = React.Children.toArray(node.props.children);
|
|
453
|
+
if (children.length === 1) {
|
|
454
|
+
const props = { ...omit(node.props, ["children"]), key: node.key };
|
|
455
|
+
return /* @__PURE__ */ React.createElement("div", { ...props }, children[0]);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
return node;
|
|
459
|
+
}
|
|
450
460
|
|
|
451
461
|
// src/popover.tsx
|
|
452
462
|
function Popover({
|
|
@@ -482,7 +492,7 @@ function Popover({
|
|
|
482
492
|
defaultOpen,
|
|
483
493
|
modal
|
|
484
494
|
},
|
|
485
|
-
trigger ? /* @__PURE__ */ React2.createElement(PopoverPrimitive.Trigger, { asChild: true }, children) : /* @__PURE__ */ React2.createElement(PopoverPrimitive.Anchor, { asChild: true }, children),
|
|
495
|
+
trigger ? /* @__PURE__ */ React2.createElement(PopoverPrimitive.Trigger, { asChild: true }, unwrapSingleFragment(children)) : /* @__PURE__ */ React2.createElement(PopoverPrimitive.Anchor, { asChild: true }, children),
|
|
486
496
|
/* @__PURE__ */ React2.createElement(PopoverPrimitive.Portal, null, /* @__PURE__ */ React2.createElement(
|
|
487
497
|
PopoverPrimitive.Content,
|
|
488
498
|
{
|
|
@@ -529,6 +539,7 @@ function registerPopover(PLASMIC) {
|
|
|
529
539
|
type: "boolean",
|
|
530
540
|
displayName: "Trigger on click",
|
|
531
541
|
defaultValueHint: true,
|
|
542
|
+
description: `Instead of automatically showing the popover on click, you can toggle the popover's "open" state from any interaction. This enables more custom control over when it is shown.`,
|
|
532
543
|
advanced: true
|
|
533
544
|
},
|
|
534
545
|
...popoverProps,
|
|
@@ -687,7 +698,7 @@ var Dialog = React3.forwardRef(
|
|
|
687
698
|
onOpenChange,
|
|
688
699
|
defaultOpen
|
|
689
700
|
},
|
|
690
|
-
/* @__PURE__ */ React3.createElement(DialogPrimitive.Trigger, { asChild: true }, triggerSlot),
|
|
701
|
+
/* @__PURE__ */ React3.createElement(DialogPrimitive.Trigger, { asChild: true }, unwrapSingleFragment(triggerSlot)),
|
|
691
702
|
noContain ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(DialogPrimitive.Portal, null, /* @__PURE__ */ React3.createElement(
|
|
692
703
|
DialogOverlay,
|
|
693
704
|
{
|
|
@@ -959,7 +970,7 @@ var Tooltip = React4.forwardRef(
|
|
|
959
970
|
defaultOpen
|
|
960
971
|
}
|
|
961
972
|
},
|
|
962
|
-
/* @__PURE__ */ React4.createElement(TooltipPrimitive.Trigger, { asChild: true }, children),
|
|
973
|
+
/* @__PURE__ */ React4.createElement(TooltipPrimitive.Trigger, { asChild: true }, unwrapSingleFragment(children)),
|
|
963
974
|
/* @__PURE__ */ React4.createElement(
|
|
964
975
|
TooltipPrimitive.Content,
|
|
965
976
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/radix-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.29",
|
|
4
4
|
"description": "Radix UI components for Plasmic",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"analyze": "size-limit --why"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@plasmicapp/host": "1.0.
|
|
29
|
+
"@plasmicapp/host": "1.0.179",
|
|
30
30
|
"@size-limit/preset-small-lib": "^4.11.0",
|
|
31
31
|
"@types/node": "^14.0.26",
|
|
32
32
|
"@types/react": "^18.2.33",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"lucide-react": "^0.279.0",
|
|
57
57
|
"remeda": "^1.27.0"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "48a2877c3dc093d101508fcdde2fd213055fdab9"
|
|
60
60
|
}
|