@bubo-squared/ui-framework 0.2.29 → 0.2.30

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.cjs CHANGED
@@ -4338,18 +4338,24 @@ var Popover2 = (props) => {
4338
4338
  placement = "bottom",
4339
4339
  offset = 10,
4340
4340
  customContent,
4341
- children
4341
+ onOpenChange,
4342
+ children,
4343
+ ...rest
4342
4344
  } = props;
4343
4345
  const hasStrapline = typeof strapline === "string" ? strapline.trim() !== "" : strapline != null;
4344
4346
  const hasDescription = typeof description === "string" ? description.trim() !== "" : description != null;
4345
4347
  const [open, setOpen] = React40.useState(false);
4348
+ const handleOpenChange = (nextOpen) => {
4349
+ setOpen(nextOpen);
4350
+ onOpenChange?.(nextOpen);
4351
+ };
4346
4352
  const handleCancel = () => {
4347
4353
  onCancel?.();
4348
- setOpen(false);
4354
+ handleOpenChange(false);
4349
4355
  };
4350
4356
  const handleOk = () => {
4351
4357
  onOk?.();
4352
- setOpen(false);
4358
+ handleOpenChange(false);
4353
4359
  };
4354
4360
  const popoverClasses = "group bg-(--background-popover) popover w-80 max-w-[calc(100vw-2rem)] shadow-card-md border-none [&>span]:scale-240 rounded-8";
4355
4361
  const popoverArrowClasses = "relative fill-(--background-popover) transition-[filter,transform] group-data-[side=top]:top-[-2px] group-data-[side=top]:drop-shadow-[0px_2px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=bottom]:drop-shadow-[0px_1px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=left]:drop-shadow-[0px_2px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=right]:drop-shadow-[0px_2px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)]";
@@ -4384,7 +4390,7 @@ var Popover2 = (props) => {
4384
4390
  }
4385
4391
  };
4386
4392
  const { side, align } = mapPlacementToSideAndAlign2(placement);
4387
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
4393
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Popover, { open, onOpenChange: handleOpenChange, children: [
4388
4394
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PopoverTrigger, { asChild: true, children }),
4389
4395
  /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
4390
4396
  PopoverContent,
@@ -4393,9 +4399,10 @@ var Popover2 = (props) => {
4393
4399
  align,
4394
4400
  sideOffset: offset,
4395
4401
  className: cn(popoverClasses, className),
4402
+ ...rest,
4396
4403
  children: [
4397
4404
  showArrow && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PopoverArrow, { className: popoverArrowClasses }),
4398
- customContent ? typeof customContent === "function" ? customContent({ close: () => setOpen(false), ok: handleOk, cancel: handleCancel }) : customContent : /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "grid gap-4", children: [
4405
+ customContent ? typeof customContent === "function" ? customContent({ close: () => handleOpenChange(false), ok: handleOk, cancel: handleCancel }) : customContent : /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "grid gap-4", children: [
4399
4406
  /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "space-y-2", children: [
4400
4407
  hasStrapline && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "caption text-secondary", children: strapline }),
4401
4408
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h4", { className: "subtitle-medium text-primary", children: title }),