@plasmicpkgs/radix-ui 0.0.3 → 0.0.8

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.
@@ -4,9 +4,10 @@ import clsx from 'clsx';
4
4
  import { pick, omit } from 'remeda';
5
5
  import registerComponent from '@plasmicapp/host/registerComponent';
6
6
  import '@plasmicapp/host/registerGlobalContext';
7
- import { Close, Overlay, Content as Content$1, Root as Root$1, Portal as Portal$1, Title, Description } from '@radix-ui/react-dialog';
7
+ import { Close, Content as Content$1, Root as Root$1, Trigger as Trigger$1, Portal as Portal$1, Title, Description, Overlay } from '@radix-ui/react-dialog';
8
8
  import { cva } from 'class-variance-authority';
9
9
  import { X } from 'lucide-react';
10
+ import { Provider, Root as Root$2, Trigger as Trigger$2, Content as Content$2 } from '@radix-ui/react-tooltip';
10
11
 
11
12
  function _extends() {
12
13
  _extends = Object.assign ? Object.assign.bind() : function (target) {
@@ -49,9 +50,9 @@ var useId = (_React$useId = useId$1) != null ? _React$useId : function () {
49
50
  /** Allow attaching pseudoclasses and other CSS selectors to this unique component instance */
50
51
  var StyleWrapper = function StyleWrapper(_ref) {
51
52
  var children = _ref.children,
52
- css = _ref.css;
53
+ cssStr = _ref.cssStr;
53
54
  var dynClass = "pd__" + useId().replace(/:/g, "");
54
- return createElement(Fragment, null, children(dynClass), createElement("style", null, dynClass ? css.replace(/&/g, "." + dynClass) : ""));
55
+ return createElement(Fragment, null, children(dynClass), createElement("style", null, dynClass ? cssStr.replace(/&/g, "." + dynClass) : ""));
55
56
  };
56
57
  var Animated = function Animated(_ref2) {
57
58
  var children = _ref2.children,
@@ -108,10 +109,10 @@ var Animated = function Animated(_ref2) {
108
109
  "zoom-exit": "--tw-exit-scale: " + exitScale + ";"
109
110
  };
110
111
  return createElement(StyleWrapper, {
111
- css: "\n &[data-state=\"closed\"] {\n animation-duration: " + exitDuration + "s;\n animation-timing-function: " + exitTiming + ";\n animation-delay: " + exitDelay + ";\n " + exitAnimations.map(function (exitAnimation) {
112
+ cssStr: "\n &&[data-state=closed] {\n animation-duration: " + exitDuration + "s;\n animation-timing-function: " + exitTiming + ";\n animation-delay: " + exitDelay + ";\n " + exitAnimations.map(function (exitAnimation) {
112
113
  var _animations$exitAnima;
113
114
  return (_animations$exitAnima = animations[exitAnimation]) != null ? _animations$exitAnima : "";
114
- }).join(" ") + "\n }\n &[data-state=\"open\"] {\n animation-duration: " + enterDuration + "s;\n animation-timing-function: " + enterTiming + ";\n animation-delay: " + enterDelay + ";\n " + enterAnimations.map(function (enterAnimation) {
115
+ }).join(" ") + "\n }\n &&,\n &&[data-state=open] {\n animation-duration: " + enterDuration + "s;\n animation-timing-function: " + enterTiming + ";\n animation-delay: " + enterDelay + ";\n " + enterAnimations.map(function (enterAnimation) {
115
116
  var _animations$enterAnim;
116
117
  return (_animations$enterAnim = animations[enterAnimation]) != null ? _animations$enterAnim : "";
117
118
  }).join(" ") + "\n }\n "
@@ -142,7 +143,7 @@ var animPropTypes = function animPropTypes(_ref3) {
142
143
  var _ps$exitAnimations;
143
144
  return (_ps$exitAnimations = ps.exitAnimations) != null ? _ps$exitAnimations : defaultExitAnimations;
144
145
  };
145
- return {
146
+ var props = {
146
147
  enterAnimations: {
147
148
  type: "choice",
148
149
  options: mungeNames(enterAnims),
@@ -252,26 +253,101 @@ var animPropTypes = function animPropTypes(_ref3) {
252
253
  suggestions: ["linear", "ease", "ease-in", "ease-out", "ease-in-out"]
253
254
  })
254
255
  };
256
+ return props;
255
257
  };
256
- var popoverProps = {
258
+ var overlayStates = {
257
259
  open: {
258
- type: "boolean",
259
- editOnly: true,
260
- uncontrolledProp: "defaultOpen"
260
+ type: "writable",
261
+ valueProp: "open",
262
+ onChangeProp: "onOpenChange",
263
+ variableType: "boolean"
264
+ }
265
+ };
266
+ var overlayProps = function overlayProps(_ref4) {
267
+ var _props;
268
+ var defaultSlotContent = _ref4.defaultSlotContent,
269
+ triggerSlotName = _ref4.triggerSlotName,
270
+ openDisplay = _ref4.openDisplay;
271
+ var props = (_props = {
272
+ open: {
273
+ type: "boolean",
274
+ displayName: openDisplay,
275
+ editOnly: true,
276
+ uncontrolledProp: "defaultOpen"
277
+ },
278
+ modal: {
279
+ type: "boolean",
280
+ advanced: true,
281
+ description: "Disable interaction with outside elements. Only popover content will be visible to screen readers."
282
+ },
283
+ onOpenChange: {
284
+ type: "eventHandler",
285
+ argTypes: [{
286
+ type: "boolean",
287
+ name: "open"
288
+ }]
289
+ }
290
+ }, _props[triggerSlotName] = _extends({
291
+ type: "slot",
292
+ defaultValue: [defaultSlotContent]
293
+ }, {
294
+ mergeWithParent: true
295
+ }), _props.themeResetClass = {
296
+ type: "themeResetClass"
297
+ }, _props);
298
+ return props;
299
+ };
300
+ function prefixClasses(x) {
301
+ return x.trim().split(/\s+/g).map(function (part) {
302
+ return "pl__" + part;
303
+ }).join(" ");
304
+ }
305
+ // Be careful formatting this!
306
+ // Note that these are magically prepended with pl__
307
+ var prefixedBaseStyles = /*#__PURE__*/"\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n.absolute {\n position: absolute;\n}\n.relative {\n position: relative;\n}\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n}\n.h-full {\n height: 100%;\n}\n.z-50 { z-index: 50; }\n.fixed { position: fixed; }\n.inset-0 { top: 0; left: 0; right: 0; bottom: 0; }\n.bottom-0 {\n bottom: 0px;\n}\n.left-0 {\n left: 0px;\n}\n.right-0 {\n right: 0px;\n}\n.top-0 {\n top: 0px;\n}\n.right-4 {\n right: 1rem;\n}\n.top-4 {\n top: 1rem;\n}\n.h-4 { height: 1rem; }\n.w-4 { width: 1rem; }\n.outline-none { outline: none; }\n\n@keyframes plsmc-enter {\n\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n\n@keyframes plsmc-exit {\n\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n.animate-in,\n.data-\\[state\\=open\\]\\:animate-in[data-state=open] {\n animation-name: plsmc-enter;\n animation-duration: 150ms;\n --tw-enter-opacity: initial;\n --tw-enter-scale: initial;\n --tw-enter-rotate: initial;\n --tw-enter-translate-x: initial;\n --tw-enter-translate-y: initial;\n}\n.animate-out,\n.data-\\[state\\=closed\\]\\:animate-out[data-state=closed] {\n animation-name: plsmc-exit;\n animation-duration: 150ms;\n --tw-exit-opacity: initial;\n --tw-exit-scale: initial;\n --tw-exit-rotate: initial;\n --tw-exit-translate-x: initial;\n --tw-exit-translate-y: initial;\n}\n.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom] {\n --tw-enter-translate-y: -0.5rem;\n}\n\n.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left] {\n --tw-enter-translate-x: 0.5rem;\n}\n\n.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right] {\n --tw-enter-translate-x: -0.5rem;\n}\n\n.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top] {\n --tw-enter-translate-y: 0.5rem;\n}\n\n".replace(/\n\./g, ".pl__");
308
+ function BaseStyles() {
309
+ // return <style>{prefixedBaseStyles}</style>;
310
+ return createElement("style", {
311
+ dangerouslySetInnerHTML: {
312
+ __html: prefixedBaseStyles
313
+ }
314
+ });
315
+ }
316
+ var popoverProps = /*#__PURE__*/_extends({
317
+ side: {
318
+ type: "choice",
319
+ options: ["top", "bottom", "left", "right"],
320
+ defaultValueHint: "bottom"
261
321
  },
262
- modal: {
263
- type: "boolean",
264
- advanced: true,
265
- description: "Disable interaction with outside elements. Only popover content will be visible to screen readers."
322
+ sideOffset: {
323
+ type: "number",
324
+ defaultValueHint: 4,
325
+ advanced: true
266
326
  },
267
- onOpenChange: {
268
- type: "eventHandler",
269
- argTypes: [{
270
- type: "boolean",
271
- name: "open"
272
- }]
327
+ align: {
328
+ type: "choice",
329
+ options: ["center", "start", "end"],
330
+ defaultValueHint: "center"
331
+ },
332
+ alignOffset: {
333
+ type: "number",
334
+ defaultValueHint: 0,
335
+ advanced: true
273
336
  }
274
- };
337
+ }, /*#__PURE__*/animPropTypes({
338
+ defaultEnterAnimations: function defaultEnterAnimations() {
339
+ return ["fade-in", "zoom-enter"];
340
+ },
341
+ defaultExitAnimations: function defaultExitAnimations() {
342
+ return ["fade-out", "zoom-exit"];
343
+ }
344
+ }), {
345
+ slideIn: {
346
+ type: "boolean",
347
+ defaultValueHint: true,
348
+ description: "Add additional subtle slide-in animation on reveal, which can depend on where the tooltip is dynamically placed."
349
+ }
350
+ });
275
351
 
276
352
  function registerComponentHelper(loader, component, meta) {
277
353
  if (loader) {
@@ -304,55 +380,50 @@ function Popover(_ref) {
304
380
  return createElement(Animated, Object.assign({
305
381
  enterAnimations: ["fade-in", "zoom-enter"],
306
382
  exitAnimations: ["fade-out", "zoom-exit"]
307
- }, animProps), function (plsmcId) {
383
+ }, animProps), function (dynClass) {
308
384
  return createElement(Root, {
309
385
  open: open,
310
386
  onOpenChange: onOpenChange,
311
387
  defaultOpen: defaultOpen,
312
388
  modal: modal
313
- }, trigger ? createElement(Trigger, null, children) : createElement(Anchor, null, children), createElement(Portal, null, createElement(Content, Object.assign({
314
- className: clsx("outline-none data-[state=open]:animate-in data-[state=closed]:animate-out", slideIn ? "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2" : "", plsmcId ? plsmcId : "", className, themeResetClass),
389
+ }, trigger ? createElement(Trigger, {
390
+ asChild: true
391
+ }, children) : createElement(Anchor, {
392
+ asChild: true
393
+ }, children), createElement(Portal, null, createElement(Content, Object.assign({
394
+ className: clsx(prefixClasses("outline-none data-[state=open]:animate-in data-[state=closed]:animate-out"), slideIn ? prefixClasses("data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2") : "", dynClass ? dynClass : "", className, themeResetClass),
315
395
  sideOffset: sideOffset
316
- }, rest), overlay)));
396
+ }, rest), overlay)), createElement(BaseStyles, null));
317
397
  });
318
398
  }
319
- Popover.displayName = Content.displayName;
399
+ Popover.displayName = "PlasmicRadixPopover";
320
400
  function registerPopover(PLASMIC) {
321
401
  registerComponentHelper(PLASMIC, Popover, {
322
402
  name: "hostless-radix-popover",
323
403
  displayName: "Popover",
324
404
  importPath: "@plasmicpkgs/radix-ui/popover",
325
405
  importName: "Popover",
326
- props: _extends({}, popoverProps, {
406
+ states: overlayStates,
407
+ props: _extends({}, overlayProps({
408
+ triggerSlotName: "children",
409
+ defaultSlotContent: {
410
+ type: "default-component",
411
+ kind: "button",
412
+ props: {
413
+ children: {
414
+ type: "text",
415
+ value: "Show popover"
416
+ }
417
+ }
418
+ }
419
+ }), {
327
420
  trigger: {
328
421
  type: "boolean",
329
422
  displayName: "Trigger on click",
330
423
  defaultValueHint: true,
331
424
  advanced: true
332
- },
333
- themeResetClass: {
334
- type: "themeResetClass"
335
- },
336
- side: {
337
- type: "choice",
338
- options: ["top", "bottom", "left", "right"],
339
- defaultValueHint: "bottom"
340
- },
341
- sideOffset: {
342
- type: "number",
343
- defaultValueHint: 4,
344
- advanced: true
345
- },
346
- align: {
347
- type: "choice",
348
- options: ["center", "start", "end"],
349
- defaultValueHint: "center"
350
- },
351
- alignOffset: {
352
- type: "number",
353
- defaultValueHint: 0,
354
- advanced: true
355
- },
425
+ }
426
+ }, popoverProps, {
356
427
  overlay: _extends({
357
428
  type: "slot",
358
429
  defaultValue: {
@@ -369,30 +440,11 @@ function registerPopover(PLASMIC) {
369
440
  boxShadow: "0px 4px 16px 0px #00000033",
370
441
  alignItems: "stretch"
371
442
  },
372
- children: ["Hello World"]
443
+ children: ["Here is the popover content."]
373
444
  }
374
445
  }, {
375
446
  mergeWithParent: true
376
- }),
377
- children: _extends({
378
- type: "slot",
379
- defaultValue: ["Popover here"]
380
- }, {
381
- mergeWithParent: true
382
447
  })
383
- }, animPropTypes({
384
- defaultEnterAnimations: function defaultEnterAnimations() {
385
- return ["fade-in", "zoom-enter"];
386
- },
387
- defaultExitAnimations: function defaultExitAnimations() {
388
- return ["fade-out", "zoom-exit"];
389
- }
390
- }), {
391
- slideIn: {
392
- type: "boolean",
393
- defaultValueHint: true,
394
- description: "Add additional subtle slide-in animation on reveal, which can depend on where the popover is dynamically placed."
395
- }
396
448
  })
397
449
  });
398
450
  }
@@ -400,34 +452,32 @@ function registerPopover(PLASMIC) {
400
452
  var _excluded$1 = ["className"],
401
453
  _excluded2 = ["className", "themeResetClass"],
402
454
  _excluded3 = ["className", "themeResetClass", "side"],
403
- _excluded4 = ["open", "onOpenChange", "modal", "className", "themeResetClass", "children", "noContain", "defaultOpen"];
404
- function prefixClasses(x) {
405
- return x.trim().split(/\s+/g).map(function (part) {
406
- return "plsmc__" + part;
407
- }).join(" ");
408
- }
409
- var baseSty = /*#__PURE__*/"\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n}\n.absolute {\n position: absolute;\n}\n.relative {\n position: relative;\n}\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n}\n.h-full {\n height: 100%;\n}\n.z-50 { z-index: 50; }\n.fixed { position: fixed; }\n.inset-0 { top: 0; left: 0; right: 0; bottom: 0; }\n.bottom-0 {\n bottom: 0px;\n}\n.left-0 {\n left: 0px;\n}\n.right-0 {\n right: 0px;\n}\n.top-0 {\n top: 0px;\n}\n.right-4 {\n right: 1rem;\n}\n.top-4 {\n top: 1rem;\n}\n.h-4 { height: 1rem; }\n.w-4 { width: 1rem; }\n.outline-none { outline: none; }\n\n@keyframes plsmc-enter {\n\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n\n@keyframes plsmc-exit {\n\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n.data-\\[state\\=open\\]\\:animate-in[data-state=open] {\n animation-name: plsmc-enter;\n animation-duration: 150ms;\n --tw-enter-opacity: initial;\n --tw-enter-scale: initial;\n --tw-enter-rotate: initial;\n --tw-enter-translate-x: initial;\n --tw-enter-translate-y: initial;\n}\n.data-\\[state\\=closed\\]\\:animate-out[data-state=closed] {\n animation-name: plsmc-exit;\n animation-duration: 150ms;\n --tw-exit-opacity: initial;\n --tw-exit-scale: initial;\n --tw-exit-rotate: initial;\n --tw-exit-translate-x: initial;\n --tw-exit-translate-y: initial;\n}\n.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom] {\n --tw-enter-translate-y: -0.5rem;\n}\n\n.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left] {\n --tw-enter-translate-x: 0.5rem;\n}\n\n.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right] {\n --tw-enter-translate-x: -0.5rem;\n}\n\n.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top] {\n --tw-enter-translate-y: 0.5rem;\n}\n\n".replace(/\n\./g, ".plsmc__");
455
+ _excluded4 = ["open", "onOpenChange", "modal", "themeResetClass", "children", "noContain", "defaultOpen", "triggerSlot", "overlayClassName"];
410
456
  var DialogClose = /*#__PURE__*/forwardRef(function (props) {
411
457
  var _props$children;
412
- return createElement(Close, Object.assign({}, props), (_props$children = props.children) != null ? _props$children : createElement(X, {
413
- className: prefixClasses("h-4 w-4") + " " + props.className
458
+ return createElement(Close, Object.assign({}, props, {
459
+ asChild: true
460
+ }), createElement("div", {
461
+ className: props.className
462
+ }, (_props$children = props.children) != null ? _props$children : createElement(X, {
463
+ className: prefixClasses("h-4 w-4")
414
464
  }), createElement("span", {
415
- className: "sr-only"
416
- }, "Close"));
465
+ className: prefixClasses("sr-only")
466
+ }, "Close")));
417
467
  });
418
- DialogClose.displayName = Close.displayName;
468
+ DialogClose.displayName = "PlasmicRadixDialogClose";
419
469
  var DialogOverlay = /*#__PURE__*/forwardRef(function (_ref, ref) {
420
470
  var className = _ref.className,
421
471
  props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
422
- return createElement(Animated, Object.assign({}, props), function (plsmcId) {
472
+ return createElement(Animated, Object.assign({}, props), function (dynClass) {
423
473
  return createElement(Overlay, Object.assign({
424
- className: clsx(["fixed inset-0 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out"].map(prefixClasses), plsmcId ? plsmcId : "", className)
474
+ className: clsx(["fixed inset-0 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out"].map(prefixClasses), dynClass ? dynClass : "", className)
425
475
  }, props, {
426
476
  ref: ref
427
477
  }));
428
478
  });
429
479
  });
430
- DialogOverlay.displayName = Overlay.displayName;
480
+ DialogOverlay.displayName = "PlasmicOverlay";
431
481
  var DialogContent = /*#__PURE__*/forwardRef(function (_ref2, ref) {
432
482
  var _animProps$enterAnima, _animProps$exitAnimat;
433
483
  var className = _ref2.className,
@@ -441,12 +491,12 @@ var DialogContent = /*#__PURE__*/forwardRef(function (_ref2, ref) {
441
491
  exitAnimations: (_animProps$exitAnimat = animProps.exitAnimations) != null ? _animProps$exitAnimat : ["zoom-exit", "fade-out"]
442
492
  }), function (dynClass) {
443
493
  return createElement(Content$1, Object.assign({}, rest, {
444
- className: clsx("fixed z-50 data-[state=open]:animate-in data-[state=closed]:animate-out", dynClass ? dynClass : "", themeResetClass, className),
494
+ className: clsx(prefixClasses("fixed z-50 outline-none relative data-[state=open]:animate-in data-[state=closed]:animate-out"), dynClass ? dynClass : "", themeResetClass, className),
445
495
  ref: ref
446
496
  }));
447
497
  });
448
498
  });
449
- DialogContent.displayName = Content$1.displayName;
499
+ DialogContent.displayName = "PlasmicRadixDialogContent";
450
500
  function getDefaultSheetAnims(side) {
451
501
  if (side === void 0) {
452
502
  side = "right";
@@ -470,18 +520,18 @@ var SheetContent = /*#__PURE__*/forwardRef(function (_ref3, ref) {
470
520
  return createElement(Animated, Object.assign({}, props, {
471
521
  enterAnimations: (_props$enterAnimation = props.enterAnimations) != null ? _props$enterAnimation : [defaultEnterAnimation],
472
522
  exitAnimations: (_props$exitAnimations = props.exitAnimations) != null ? _props$exitAnimations : [defaultExitAnimation]
473
- }), function (plsmcId) {
523
+ }), function (dynClass) {
474
524
  return createElement(Content$1, Object.assign({
475
525
  className: clsx(sheetVariants({
476
526
  side: side
477
- }), plsmcId ? plsmcId : "", className)
527
+ }), dynClass ? dynClass : "", className)
478
528
  }, props, {
479
529
  ref: ref
480
530
  }));
481
531
  });
482
532
  });
483
- SheetContent.displayName = Content$1.displayName;
484
- var sheetVariants = /*#__PURE__*/cva( /*#__PURE__*/prefixClasses("fixed z-50 data-[state=open]:animate-in data-[state=closed]:animate-out"), {
533
+ SheetContent.displayName = "PlasmicRadixSheetContent";
534
+ var sheetVariants = /*#__PURE__*/cva( /*#__PURE__*/prefixClasses("fixed z-50 outline-none relative data-[state=open]:animate-in data-[state=closed]:animate-out"), {
485
535
  variants: {
486
536
  side: {
487
537
  top: /*#__PURE__*/prefixClasses("inset-x-0 top-0"),
@@ -498,24 +548,31 @@ var Dialog = /*#__PURE__*/forwardRef(function (_ref4, ref) {
498
548
  var open = _ref4.open,
499
549
  onOpenChange = _ref4.onOpenChange,
500
550
  modal = _ref4.modal,
501
- className = _ref4.className,
502
551
  themeResetClass = _ref4.themeResetClass,
503
552
  children = _ref4.children,
504
553
  noContain = _ref4.noContain,
505
554
  defaultOpen = _ref4.defaultOpen,
555
+ triggerSlot = _ref4.triggerSlot,
556
+ overlayClassName = _ref4.overlayClassName,
506
557
  props = _objectWithoutPropertiesLoose(_ref4, _excluded4);
507
558
  return createElement(Root$1, {
508
559
  open: open,
509
560
  modal: modal,
510
561
  onOpenChange: onOpenChange,
511
562
  defaultOpen: defaultOpen
512
- }, createElement(Portal$1, null, noContain ? createElement(Fragment, null, createElement(DialogOverlay, Object.assign({}, props, {
513
- className: clsx(className, themeResetClass)
514
- })), children) : createElement(DialogOverlay, Object.assign({}, props, {
515
- className: clsx(className, themeResetClass)
516
- }), children)), createElement("style", null, baseSty));
563
+ }, createElement(Trigger$1, {
564
+ asChild: true
565
+ }, triggerSlot), createElement(Portal$1, null, noContain ? createElement(Fragment, null, createElement(DialogOverlay, Object.assign({
566
+ ref: ref
567
+ }, props, {
568
+ className: clsx(overlayClassName, themeResetClass)
569
+ })), children) : createElement(DialogOverlay, Object.assign({
570
+ ref: ref
571
+ }, props, {
572
+ className: clsx(overlayClassName, themeResetClass)
573
+ }), children)), createElement(BaseStyles, null));
517
574
  });
518
- Dialog.displayName = Root$1.displayName;
575
+ Dialog.displayName = "PlasmicRadixDialog";
519
576
  var DialogTitle = Title;
520
577
  var DialogDescription = Description;
521
578
  function registerDialog(PLASMIC) {
@@ -524,6 +581,7 @@ function registerDialog(PLASMIC) {
524
581
  displayName: "Dialog",
525
582
  importPath: "@plasmicpkgs/radix-ui/dialog",
526
583
  importName: "Dialog",
584
+ styleSections: false,
527
585
  defaultStyles: {
528
586
  // Note: unable to set position styles since Plasmic coerces to auto layout
529
587
  display: "flex",
@@ -532,15 +590,27 @@ function registerDialog(PLASMIC) {
532
590
  backdropFilter: "blur(10px)",
533
591
  background: "rgba(255,255,255,0.8)"
534
592
  },
535
- props: _extends({}, popoverProps, {
593
+ props: _extends({}, overlayProps({
594
+ defaultSlotContent: {
595
+ type: "default-component",
596
+ kind: "button",
597
+ props: {
598
+ children: {
599
+ type: "text",
600
+ value: "Show dialog"
601
+ }
602
+ }
603
+ },
604
+ triggerSlotName: "triggerSlot"
605
+ }), {
606
+ overlayClassName: {
607
+ type: "class"
608
+ },
536
609
  noContain: {
537
610
  type: "boolean",
538
611
  advanced: true,
539
612
  description: "Place the dialog content over the overlay instead of inside the overlay. Useful for separating their animations, but you also won't be able to conveniently set layout on the overlay as a parent."
540
613
  },
541
- themeResetClass: {
542
- type: "themeResetClass"
543
- },
544
614
  children: {
545
615
  type: "slot",
546
616
  allowedComponents: ["hostless-radix-sheet-content", "hostless-radix-dialog-content"],
@@ -549,7 +619,8 @@ function registerDialog(PLASMIC) {
549
619
  name: "hostless-radix-dialog-content"
550
620
  }
551
621
  }
552
- })
622
+ }),
623
+ states: overlayStates
553
624
  });
554
625
  registerComponentHelper(PLASMIC, DialogClose, {
555
626
  name: "hostless-radix-dialog-close",
@@ -704,10 +775,89 @@ function registerDialog(PLASMIC) {
704
775
  });
705
776
  }
706
777
 
778
+ var _excluded$2 = ["className", "sideOffset", "themeResetClass", "slideIn", "overlay", "delayDuration", "disableHoverableContent", "open", "onOpenChange", "defaultOpen", "children"];
779
+ var Tooltip = /*#__PURE__*/forwardRef(function (_ref, ref) {
780
+ var className = _ref.className,
781
+ _ref$sideOffset = _ref.sideOffset,
782
+ sideOffset = _ref$sideOffset === void 0 ? 4 : _ref$sideOffset,
783
+ themeResetClass = _ref.themeResetClass,
784
+ _ref$slideIn = _ref.slideIn,
785
+ slideIn = _ref$slideIn === void 0 ? true : _ref$slideIn,
786
+ overlay = _ref.overlay,
787
+ delayDuration = _ref.delayDuration,
788
+ disableHoverableContent = _ref.disableHoverableContent,
789
+ open = _ref.open,
790
+ onOpenChange = _ref.onOpenChange,
791
+ defaultOpen = _ref.defaultOpen,
792
+ children = _ref.children,
793
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
794
+ var _splitAnimProps = splitAnimProps(props),
795
+ animProps = _splitAnimProps[0],
796
+ rest = _splitAnimProps[1];
797
+ return createElement(Animated, Object.assign({
798
+ enterAnimations: ["fade-in", "zoom-enter"],
799
+ exitAnimations: ["fade-out", "zoom-exit"]
800
+ }, animProps), function (dynClass) {
801
+ return createElement(Provider, null, createElement(Root$2, Object.assign({}, {
802
+ delayDuration: delayDuration,
803
+ disableHoverableContent: disableHoverableContent,
804
+ open: open,
805
+ onOpenChange: onOpenChange,
806
+ defaultOpen: defaultOpen
807
+ }), createElement(Trigger$2, {
808
+ asChild: true
809
+ }, children), createElement(Content$2, Object.assign({
810
+ ref: ref,
811
+ sideOffset: sideOffset,
812
+ className: clsx(prefixClasses("animate-in data-[state=closed]:animate-out"), slideIn ? prefixClasses("data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2") : "", dynClass ? dynClass : "", className, themeResetClass)
813
+ }, rest), overlay), createElement(BaseStyles, null)));
814
+ });
815
+ });
816
+ Tooltip.displayName = "PlasmicRadixTooltip";
817
+ function registerTooltip(PLASMIC) {
818
+ registerComponentHelper(PLASMIC, Tooltip, {
819
+ name: "hostless-radix-tooltip",
820
+ displayName: "Tooltip",
821
+ importPath: "@plasmicpkgs/radix-ui/tooltip",
822
+ importName: "Tooltip",
823
+ props: _extends({}, overlayProps({
824
+ triggerSlotName: "children",
825
+ defaultSlotContent: {
826
+ type: "text",
827
+ value: "I have a tooltip."
828
+ },
829
+ openDisplay: "Preview open"
830
+ }), popoverProps, {
831
+ overlay: _extends({
832
+ type: "slot",
833
+ defaultValue: {
834
+ type: "vbox",
835
+ styles: {
836
+ padding: "16px",
837
+ width: "300px",
838
+ maxWidth: "100%",
839
+ borderWidth: "1px",
840
+ borderStyle: "solid",
841
+ borderColor: "#E2E8F0",
842
+ backgroundColor: "white",
843
+ borderRadius: "8px",
844
+ boxShadow: "0px 4px 16px 0px #00000033",
845
+ alignItems: "stretch"
846
+ },
847
+ children: ["Here is the tooltip content."]
848
+ }
849
+ }, {
850
+ mergeWithParent: true
851
+ })
852
+ })
853
+ });
854
+ }
855
+
707
856
  function registerAll(PLASMIC) {
708
857
  registerPopover(PLASMIC);
709
858
  registerDialog(PLASMIC);
859
+ registerTooltip(PLASMIC);
710
860
  }
711
861
 
712
- export { Dialog, DialogClose, DialogContent, DialogDescription, DialogTitle, Popover, SheetContent, prefixClasses, registerAll, registerDialog, registerPopover, sheetVariants };
862
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogTitle, Popover, SheetContent, Tooltip, popoverProps, registerAll, registerDialog, registerPopover, registerTooltip, sheetVariants };
713
863
  //# sourceMappingURL=radix-ui.esm.js.map