@embedreach/components 0.1.52 → 0.1.54

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.
@@ -29424,12 +29424,12 @@ function getHullPresorted(points) {
29424
29424
  }
29425
29425
  var Provider = TooltipProvider$1;
29426
29426
  var Root3$1 = Tooltip$1;
29427
- var Trigger$5 = TooltipTrigger$1;
29427
+ var Trigger$4 = TooltipTrigger$1;
29428
29428
  var Portal$5 = TooltipPortal;
29429
29429
  var Content2$4 = TooltipContent$1;
29430
29430
  const TooltipProvider = Provider;
29431
29431
  const Tooltip = Root3$1;
29432
- const TooltipTrigger = Trigger$5;
29432
+ const TooltipTrigger = Trigger$4;
29433
29433
  const TooltipContent = React.forwardRef(({ className: className2, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(Portal$5, { children: /* @__PURE__ */ jsx(
29434
29434
  Content2$4,
29435
29435
  {
@@ -32534,7 +32534,7 @@ var Dialog$1 = (props) => {
32534
32534
  };
32535
32535
  Dialog$1.displayName = DIALOG_NAME;
32536
32536
  var TRIGGER_NAME$4 = "DialogTrigger";
32537
- var DialogTrigger$1 = React.forwardRef(
32537
+ var DialogTrigger = React.forwardRef(
32538
32538
  (props, forwardedRef) => {
32539
32539
  const { __scopeDialog, ...triggerProps } = props;
32540
32540
  const context = useDialogContext(TRIGGER_NAME$4, __scopeDialog);
@@ -32554,7 +32554,7 @@ var DialogTrigger$1 = React.forwardRef(
32554
32554
  );
32555
32555
  }
32556
32556
  );
32557
- DialogTrigger$1.displayName = TRIGGER_NAME$4;
32557
+ DialogTrigger.displayName = TRIGGER_NAME$4;
32558
32558
  var PORTAL_NAME$4 = "DialogPortal";
32559
32559
  var [PortalProvider$2, usePortalContext$2] = createDialogContext(PORTAL_NAME$4, {
32560
32560
  forceMount: void 0
@@ -32789,7 +32789,6 @@ var DescriptionWarning = ({ contentRef, descriptionId }) => {
32789
32789
  return null;
32790
32790
  };
32791
32791
  var Root$5 = Dialog$1;
32792
- var Trigger$4 = DialogTrigger$1;
32793
32792
  var Portal$3 = DialogPortal$1;
32794
32793
  var Overlay = DialogOverlay$1;
32795
32794
  var Content$1 = DialogContent$1;
@@ -32854,7 +32853,6 @@ var VisuallyHidden = React.forwardRef(
32854
32853
  );
32855
32854
  VisuallyHidden.displayName = NAME$2;
32856
32855
  const Dialog = Root$5;
32857
- const DialogTrigger = Trigger$4;
32858
32856
  const DialogPortal = ({ ...props }) => /* @__PURE__ */ jsx(Portal$3, { children: /* @__PURE__ */ jsx("div", { "data-reach-root": true, children: props.children }) });
32859
32857
  const DialogOverlay = React.forwardRef(({ className: className2, ...props }, ref) => /* @__PURE__ */ jsx(
32860
32858
  Overlay,
@@ -35999,9 +35997,9 @@ const ComboboxSelect = ({
35999
35997
  /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
36000
35998
  Button$1,
36001
35999
  {
36002
- variant: "outline",
36003
36000
  "aria-expanded": open,
36004
36001
  className: "w-[200px] justify-between",
36002
+ variant: "outline",
36005
36003
  children: [
36006
36004
  value ? options.find((option) => option.value === value)?.label : placeholder,
36007
36005
  /* @__PURE__ */ jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })
@@ -40602,52 +40600,44 @@ function SegmentBuilder({
40602
40600
  ] });
40603
40601
  }
40604
40602
  function SegmentBuilderDialog({
40605
- open: openProp = false,
40606
- onClose,
40603
+ open,
40604
+ setOpen,
40607
40605
  segmentId,
40608
40606
  onSegmentUpdated
40609
40607
  }) {
40610
- const [open, setClose] = React.useState(openProp);
40611
- const setOpen = (open2) => {
40612
- setClose(open2);
40613
- onClose?.();
40614
- };
40615
- return /* @__PURE__ */ jsxs(Dialog, { open, onOpenChange: setOpen, children: [
40616
- /* @__PURE__ */ jsx(DialogTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button$1, { variant: "outline", children: [
40617
- /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" }),
40618
- segmentId ? "Edit Segment" : "Create New Segment"
40619
- ] }) }),
40620
- /* @__PURE__ */ jsxs(
40621
- DialogContent,
40622
- {
40623
- className: "flex max-h-[90dvh] flex-col gap-0 p-0 max-w-4xl overflow-visible",
40624
- hideCloseButton: true,
40625
- children: [
40626
- /* @__PURE__ */ jsx(DialogHeader, { className: "p-8 pb-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
40627
- /* @__PURE__ */ jsx(DialogTitle, { className: "text-3xl font-normal", children: segmentId ? "Edit Segment" : "Create Segment" }),
40628
- /* @__PURE__ */ jsx(
40629
- Button$1,
40630
- {
40631
- variant: "ghost",
40632
- size: "icon",
40633
- onClick: () => setOpen(false),
40634
- className: "h-8 w-8",
40635
- children: /* @__PURE__ */ jsx(X$2, { className: "h-4 w-4" })
40636
- }
40637
- )
40638
- ] }) }),
40608
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs(
40609
+ DialogContent,
40610
+ {
40611
+ className: "flex max-h-[90dvh] flex-col gap-0 p-0 max-w-4xl overflow-visible",
40612
+ hideCloseButton: true,
40613
+ children: [
40614
+ /* @__PURE__ */ jsx(DialogHeader, { className: "p-8 pb-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
40615
+ /* @__PURE__ */ jsx(DialogTitle, { className: "text-3xl font-normal", children: segmentId ? "Edit Segment" : "Create Segment" }),
40639
40616
  /* @__PURE__ */ jsx(
40640
- SegmentBuilder,
40617
+ Button$1,
40641
40618
  {
40642
- segmentId,
40643
- setOpen,
40644
- onSegmentUpdated
40619
+ variant: "ghost",
40620
+ size: "icon",
40621
+ onClick: () => setOpen(false),
40622
+ className: "h-8 w-8",
40623
+ children: /* @__PURE__ */ jsx(X$2, { className: "h-4 w-4" })
40645
40624
  }
40646
40625
  )
40647
- ]
40648
- }
40649
- )
40650
- ] });
40626
+ ] }) }),
40627
+ /* @__PURE__ */ jsx(
40628
+ SegmentBuilder,
40629
+ {
40630
+ segmentId,
40631
+ setOpen: (val) => {
40632
+ setOpen(val);
40633
+ onSegmentUpdated?.(false);
40634
+ },
40635
+ onSegmentUpdated
40636
+ }
40637
+ )
40638
+ ]
40639
+ }
40640
+ ) });
40651
40641
  }
40652
40642
  const AllSegmentList = () => {
40653
40643
  const [searchQuery, setSearchQuery] = React__default.useState("");
@@ -40686,7 +40676,7 @@ const AllSegmentList = () => {
40686
40676
  SegmentBuilderDialog,
40687
40677
  {
40688
40678
  open: createNewSegmentDialogOpen,
40689
- onClose: () => setCreateNewSegmentDialogOpen(false),
40679
+ setOpen: setCreateNewSegmentDialogOpen,
40690
40680
  segmentId: selectedSegment
40691
40681
  }
40692
40682
  ) })
@@ -46634,7 +46624,7 @@ const SelectAudience = ({ iconDefinitions, automation }) => {
46634
46624
  SegmentBuilderDialog,
46635
46625
  {
46636
46626
  open: openCreateSegmentDialog,
46637
- onClose: () => setOpenCreateSegmentDialog(false)
46627
+ setOpen: setOpenCreateSegmentDialog
46638
46628
  }
46639
46629
  )
46640
46630
  ] })
package/dist/index.d.ts CHANGED
@@ -106,14 +106,14 @@ declare interface SDKCallbacks {
106
106
  onTenantInformationRequested?: () => void;
107
107
  }
108
108
 
109
- export declare function SegmentBuilderDialog({ open: openProp, onClose, segmentId, onSegmentUpdated, }: SegmentBuilderDialogProps): JSX_2.Element;
109
+ export declare function SegmentBuilderDialog({ open, setOpen, segmentId, onSegmentUpdated, }: SegmentBuilderDialogProps): JSX_2.Element;
110
110
 
111
111
  declare interface SegmentBuilderDialogProps {
112
112
  /**
113
113
  * Control the open state of the dialog
114
114
  */
115
115
  open: boolean;
116
- onClose: () => void;
116
+ setOpen: (open: boolean) => void;
117
117
  /**
118
118
  * Optional callback when the segment builder is closed
119
119
  * @param createdSegment - The created segment id or false if the segment was not created, 'error' if there was an error