@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.d.cts CHANGED
@@ -8,6 +8,7 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
8
8
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
9
9
  import * as RPNInput from 'react-phone-number-input';
10
10
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
11
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
11
12
  import { ClassValue } from 'clsx';
12
13
 
13
14
  declare const buttonVariants: (props?: ({
@@ -669,6 +670,8 @@ interface PopoverProps {
669
670
  ok: () => void;
670
671
  cancel: () => void;
671
672
  }) => React$1.ReactNode);
673
+ onPointerDownOutside?: React$1.ComponentProps<typeof PopoverPrimitive.Content>['onPointerDownOutside'];
674
+ onOpenChange?: (open: boolean) => void;
672
675
  }
673
676
  declare const Popover: React$1.FC<PopoverProps>;
674
677
 
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
8
8
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
9
9
  import * as RPNInput from 'react-phone-number-input';
10
10
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
11
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
11
12
  import { ClassValue } from 'clsx';
12
13
 
13
14
  declare const buttonVariants: (props?: ({
@@ -669,6 +670,8 @@ interface PopoverProps {
669
670
  ok: () => void;
670
671
  cancel: () => void;
671
672
  }) => React$1.ReactNode);
673
+ onPointerDownOutside?: React$1.ComponentProps<typeof PopoverPrimitive.Content>['onPointerDownOutside'];
674
+ onOpenChange?: (open: boolean) => void;
672
675
  }
673
676
  declare const Popover: React$1.FC<PopoverProps>;
674
677
 
package/dist/index.js CHANGED
@@ -4262,18 +4262,24 @@ var Popover2 = (props) => {
4262
4262
  placement = "bottom",
4263
4263
  offset = 10,
4264
4264
  customContent,
4265
- children
4265
+ onOpenChange,
4266
+ children,
4267
+ ...rest
4266
4268
  } = props;
4267
4269
  const hasStrapline = typeof strapline === "string" ? strapline.trim() !== "" : strapline != null;
4268
4270
  const hasDescription = typeof description === "string" ? description.trim() !== "" : description != null;
4269
4271
  const [open, setOpen] = React40.useState(false);
4272
+ const handleOpenChange = (nextOpen) => {
4273
+ setOpen(nextOpen);
4274
+ onOpenChange?.(nextOpen);
4275
+ };
4270
4276
  const handleCancel = () => {
4271
4277
  onCancel?.();
4272
- setOpen(false);
4278
+ handleOpenChange(false);
4273
4279
  };
4274
4280
  const handleOk = () => {
4275
4281
  onOk?.();
4276
- setOpen(false);
4282
+ handleOpenChange(false);
4277
4283
  };
4278
4284
  const popoverClasses = "group bg-(--background-popover) popover w-80 max-w-[calc(100vw-2rem)] shadow-card-md border-none [&>span]:scale-240 rounded-8";
4279
4285
  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)]";
@@ -4308,7 +4314,7 @@ var Popover2 = (props) => {
4308
4314
  }
4309
4315
  };
4310
4316
  const { side, align } = mapPlacementToSideAndAlign2(placement);
4311
- return /* @__PURE__ */ jsxs30(Popover, { open, onOpenChange: setOpen, children: [
4317
+ return /* @__PURE__ */ jsxs30(Popover, { open, onOpenChange: handleOpenChange, children: [
4312
4318
  /* @__PURE__ */ jsx42(PopoverTrigger, { asChild: true, children }),
4313
4319
  /* @__PURE__ */ jsxs30(
4314
4320
  PopoverContent,
@@ -4317,9 +4323,10 @@ var Popover2 = (props) => {
4317
4323
  align,
4318
4324
  sideOffset: offset,
4319
4325
  className: cn(popoverClasses, className),
4326
+ ...rest,
4320
4327
  children: [
4321
4328
  showArrow && /* @__PURE__ */ jsx42(PopoverArrow, { className: popoverArrowClasses }),
4322
- customContent ? typeof customContent === "function" ? customContent({ close: () => setOpen(false), ok: handleOk, cancel: handleCancel }) : customContent : /* @__PURE__ */ jsxs30("div", { className: "grid gap-4", children: [
4329
+ customContent ? typeof customContent === "function" ? customContent({ close: () => handleOpenChange(false), ok: handleOk, cancel: handleCancel }) : customContent : /* @__PURE__ */ jsxs30("div", { className: "grid gap-4", children: [
4323
4330
  /* @__PURE__ */ jsxs30("div", { className: "space-y-2", children: [
4324
4331
  hasStrapline && /* @__PURE__ */ jsx42("span", { className: "caption text-secondary", children: strapline }),
4325
4332
  /* @__PURE__ */ jsx42("h4", { className: "subtitle-medium text-primary", children: title }),