@plasmicpkgs/radix-ui 0.0.26 → 0.0.28
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +25 -5
- package/dist/index.mjs +25 -5
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -469,7 +469,7 @@ var popoverProps = {
|
|
|
469
469
|
},
|
|
470
470
|
sideOffset: {
|
|
471
471
|
type: "number",
|
|
472
|
-
defaultValueHint:
|
|
472
|
+
defaultValueHint: 0,
|
|
473
473
|
advanced: true
|
|
474
474
|
},
|
|
475
475
|
align: {
|
|
@@ -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
|
{
|
|
@@ -894,6 +905,9 @@ function registerDialog(PLASMIC) {
|
|
|
894
905
|
parentComponentName: "hostless-radix-dialog",
|
|
895
906
|
defaultStyles: {
|
|
896
907
|
// No need for position here, just relying on layout container parent.
|
|
908
|
+
position: "relative",
|
|
909
|
+
margin: "10% auto",
|
|
910
|
+
// for horizontally centered dialog
|
|
897
911
|
padding: "24px",
|
|
898
912
|
borderRadius: "8px",
|
|
899
913
|
...dialogStyles
|
|
@@ -1001,7 +1015,7 @@ var Tooltip = React4.forwardRef(
|
|
|
1001
1015
|
defaultOpen
|
|
1002
1016
|
}
|
|
1003
1017
|
},
|
|
1004
|
-
/* @__PURE__ */ React4.createElement(TooltipPrimitive.Trigger, { asChild: true }, children),
|
|
1018
|
+
/* @__PURE__ */ React4.createElement(TooltipPrimitive.Trigger, { asChild: true }, unwrapSingleFragment(children)),
|
|
1005
1019
|
/* @__PURE__ */ React4.createElement(
|
|
1006
1020
|
TooltipPrimitive.Content,
|
|
1007
1021
|
{
|
|
@@ -1038,7 +1052,13 @@ function registerTooltip(PLASMIC) {
|
|
|
1038
1052
|
defaultSlotContent: { type: "text", value: "I have a tooltip." },
|
|
1039
1053
|
openDisplay: "Preview open"
|
|
1040
1054
|
}),
|
|
1041
|
-
...
|
|
1055
|
+
...{
|
|
1056
|
+
...popoverProps,
|
|
1057
|
+
side: {
|
|
1058
|
+
...popoverProps.side,
|
|
1059
|
+
defaultValueHint: "top"
|
|
1060
|
+
}
|
|
1061
|
+
},
|
|
1042
1062
|
overlay: {
|
|
1043
1063
|
type: "slot",
|
|
1044
1064
|
defaultValue: {
|
package/dist/index.mjs
CHANGED
|
@@ -424,7 +424,7 @@ var popoverProps = {
|
|
|
424
424
|
},
|
|
425
425
|
sideOffset: {
|
|
426
426
|
type: "number",
|
|
427
|
-
defaultValueHint:
|
|
427
|
+
defaultValueHint: 0,
|
|
428
428
|
advanced: true
|
|
429
429
|
},
|
|
430
430
|
align: {
|
|
@@ -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
|
{
|
|
@@ -849,6 +860,9 @@ function registerDialog(PLASMIC) {
|
|
|
849
860
|
parentComponentName: "hostless-radix-dialog",
|
|
850
861
|
defaultStyles: {
|
|
851
862
|
// No need for position here, just relying on layout container parent.
|
|
863
|
+
position: "relative",
|
|
864
|
+
margin: "10% auto",
|
|
865
|
+
// for horizontally centered dialog
|
|
852
866
|
padding: "24px",
|
|
853
867
|
borderRadius: "8px",
|
|
854
868
|
...dialogStyles
|
|
@@ -956,7 +970,7 @@ var Tooltip = React4.forwardRef(
|
|
|
956
970
|
defaultOpen
|
|
957
971
|
}
|
|
958
972
|
},
|
|
959
|
-
/* @__PURE__ */ React4.createElement(TooltipPrimitive.Trigger, { asChild: true }, children),
|
|
973
|
+
/* @__PURE__ */ React4.createElement(TooltipPrimitive.Trigger, { asChild: true }, unwrapSingleFragment(children)),
|
|
960
974
|
/* @__PURE__ */ React4.createElement(
|
|
961
975
|
TooltipPrimitive.Content,
|
|
962
976
|
{
|
|
@@ -993,7 +1007,13 @@ function registerTooltip(PLASMIC) {
|
|
|
993
1007
|
defaultSlotContent: { type: "text", value: "I have a tooltip." },
|
|
994
1008
|
openDisplay: "Preview open"
|
|
995
1009
|
}),
|
|
996
|
-
...
|
|
1010
|
+
...{
|
|
1011
|
+
...popoverProps,
|
|
1012
|
+
side: {
|
|
1013
|
+
...popoverProps.side,
|
|
1014
|
+
defaultValueHint: "top"
|
|
1015
|
+
}
|
|
1016
|
+
},
|
|
997
1017
|
overlay: {
|
|
998
1018
|
type: "slot",
|
|
999
1019
|
defaultValue: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/radix-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
4
4
|
"description": "Radix UI components for Plasmic",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"lucide-react": "^0.279.0",
|
|
57
57
|
"remeda": "^1.27.0"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "c9438f525cedcc1223760a7a4d7b37eb56e0977d"
|
|
60
60
|
}
|