@bubo-squared/ui-framework 0.2.29 → 0.2.31
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 +17 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
@@ -41,7 +41,7 @@ function spawnRipple(target, clientX, clientY, options = {}) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
// src/components/ui/button.tsx
|
|
44
|
-
import "react";
|
|
44
|
+
import * as React from "react";
|
|
45
45
|
import { Slot } from "@radix-ui/react-slot";
|
|
46
46
|
import { cva } from "class-variance-authority";
|
|
47
47
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
@@ -72,17 +72,12 @@ var buttonVariants = cva(
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
);
|
|
75
|
-
|
|
76
|
-
className,
|
|
77
|
-
variant = "default",
|
|
78
|
-
size = "default",
|
|
79
|
-
asChild = false,
|
|
80
|
-
...props
|
|
81
|
-
}) {
|
|
75
|
+
var Button = React.forwardRef(({ className, variant = "default", size = "default", asChild = false, ...props }, ref) => {
|
|
82
76
|
const Comp = asChild ? Slot : "button";
|
|
83
77
|
return /* @__PURE__ */ jsx2(
|
|
84
78
|
Comp,
|
|
85
79
|
{
|
|
80
|
+
ref,
|
|
86
81
|
"data-slot": "button",
|
|
87
82
|
"data-variant": variant,
|
|
88
83
|
"data-size": size,
|
|
@@ -90,7 +85,8 @@ function Button({
|
|
|
90
85
|
...props
|
|
91
86
|
}
|
|
92
87
|
);
|
|
93
|
-
}
|
|
88
|
+
});
|
|
89
|
+
Button.displayName = "Button";
|
|
94
90
|
|
|
95
91
|
// src/components/Buttons/Button.tsx
|
|
96
92
|
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
@@ -2431,7 +2427,7 @@ import "react";
|
|
|
2431
2427
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2432
2428
|
|
|
2433
2429
|
// ../../node_modules/.pnpm/lucide-react@0.555.0_react@19.2.3/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
2434
|
-
import { forwardRef as
|
|
2430
|
+
import { forwardRef as forwardRef20, createElement as createElement2 } from "react";
|
|
2435
2431
|
|
|
2436
2432
|
// ../../node_modules/.pnpm/lucide-react@0.555.0_react@19.2.3/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
|
2437
2433
|
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
@@ -2455,7 +2451,7 @@ var hasA11yProp = (props) => {
|
|
|
2455
2451
|
};
|
|
2456
2452
|
|
|
2457
2453
|
// ../../node_modules/.pnpm/lucide-react@0.555.0_react@19.2.3/node_modules/lucide-react/dist/esm/Icon.js
|
|
2458
|
-
import { forwardRef as
|
|
2454
|
+
import { forwardRef as forwardRef19, createElement } from "react";
|
|
2459
2455
|
|
|
2460
2456
|
// ../../node_modules/.pnpm/lucide-react@0.555.0_react@19.2.3/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
|
2461
2457
|
var defaultAttributes = {
|
|
@@ -2471,7 +2467,7 @@ var defaultAttributes = {
|
|
|
2471
2467
|
};
|
|
2472
2468
|
|
|
2473
2469
|
// ../../node_modules/.pnpm/lucide-react@0.555.0_react@19.2.3/node_modules/lucide-react/dist/esm/Icon.js
|
|
2474
|
-
var Icon2 =
|
|
2470
|
+
var Icon2 = forwardRef19(
|
|
2475
2471
|
({
|
|
2476
2472
|
color = "currentColor",
|
|
2477
2473
|
size = 24,
|
|
@@ -2503,7 +2499,7 @@ var Icon2 = forwardRef18(
|
|
|
2503
2499
|
|
|
2504
2500
|
// ../../node_modules/.pnpm/lucide-react@0.555.0_react@19.2.3/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
2505
2501
|
var createLucideIcon = (iconName, iconNode) => {
|
|
2506
|
-
const Component =
|
|
2502
|
+
const Component = forwardRef20(
|
|
2507
2503
|
({ className, ...props }, ref) => createElement2(Icon2, {
|
|
2508
2504
|
ref,
|
|
2509
2505
|
iconNode,
|
|
@@ -4262,18 +4258,24 @@ var Popover2 = (props) => {
|
|
|
4262
4258
|
placement = "bottom",
|
|
4263
4259
|
offset = 10,
|
|
4264
4260
|
customContent,
|
|
4265
|
-
|
|
4261
|
+
onOpenChange,
|
|
4262
|
+
children,
|
|
4263
|
+
...rest
|
|
4266
4264
|
} = props;
|
|
4267
4265
|
const hasStrapline = typeof strapline === "string" ? strapline.trim() !== "" : strapline != null;
|
|
4268
4266
|
const hasDescription = typeof description === "string" ? description.trim() !== "" : description != null;
|
|
4269
4267
|
const [open, setOpen] = React40.useState(false);
|
|
4268
|
+
const handleOpenChange = (nextOpen) => {
|
|
4269
|
+
setOpen(nextOpen);
|
|
4270
|
+
onOpenChange?.(nextOpen);
|
|
4271
|
+
};
|
|
4270
4272
|
const handleCancel = () => {
|
|
4271
4273
|
onCancel?.();
|
|
4272
|
-
|
|
4274
|
+
handleOpenChange(false);
|
|
4273
4275
|
};
|
|
4274
4276
|
const handleOk = () => {
|
|
4275
4277
|
onOk?.();
|
|
4276
|
-
|
|
4278
|
+
handleOpenChange(false);
|
|
4277
4279
|
};
|
|
4278
4280
|
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
4281
|
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 +4310,7 @@ var Popover2 = (props) => {
|
|
|
4308
4310
|
}
|
|
4309
4311
|
};
|
|
4310
4312
|
const { side, align } = mapPlacementToSideAndAlign2(placement);
|
|
4311
|
-
return /* @__PURE__ */ jsxs30(Popover, { open, onOpenChange:
|
|
4313
|
+
return /* @__PURE__ */ jsxs30(Popover, { open, onOpenChange: handleOpenChange, children: [
|
|
4312
4314
|
/* @__PURE__ */ jsx42(PopoverTrigger, { asChild: true, children }),
|
|
4313
4315
|
/* @__PURE__ */ jsxs30(
|
|
4314
4316
|
PopoverContent,
|
|
@@ -4317,9 +4319,10 @@ var Popover2 = (props) => {
|
|
|
4317
4319
|
align,
|
|
4318
4320
|
sideOffset: offset,
|
|
4319
4321
|
className: cn(popoverClasses, className),
|
|
4322
|
+
...rest,
|
|
4320
4323
|
children: [
|
|
4321
4324
|
showArrow && /* @__PURE__ */ jsx42(PopoverArrow, { className: popoverArrowClasses }),
|
|
4322
|
-
customContent ? typeof customContent === "function" ? customContent({ close: () =>
|
|
4325
|
+
customContent ? typeof customContent === "function" ? customContent({ close: () => handleOpenChange(false), ok: handleOk, cancel: handleCancel }) : customContent : /* @__PURE__ */ jsxs30("div", { className: "grid gap-4", children: [
|
|
4323
4326
|
/* @__PURE__ */ jsxs30("div", { className: "space-y-2", children: [
|
|
4324
4327
|
hasStrapline && /* @__PURE__ */ jsx42("span", { className: "caption text-secondary", children: strapline }),
|
|
4325
4328
|
/* @__PURE__ */ jsx42("h4", { className: "subtitle-medium text-primary", children: title }),
|