@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.cjs
CHANGED
|
@@ -123,7 +123,7 @@ function spawnRipple(target, clientX, clientY, options = {}) {
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
// src/components/ui/button.tsx
|
|
126
|
-
var React = require("react");
|
|
126
|
+
var React = __toESM(require("react"), 1);
|
|
127
127
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
128
128
|
var import_class_variance_authority = require("class-variance-authority");
|
|
129
129
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
@@ -154,17 +154,12 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
);
|
|
157
|
-
|
|
158
|
-
className,
|
|
159
|
-
variant = "default",
|
|
160
|
-
size = "default",
|
|
161
|
-
asChild = false,
|
|
162
|
-
...props
|
|
163
|
-
}) {
|
|
157
|
+
var Button = React.forwardRef(({ className, variant = "default", size = "default", asChild = false, ...props }, ref) => {
|
|
164
158
|
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
165
159
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
166
160
|
Comp,
|
|
167
161
|
{
|
|
162
|
+
ref,
|
|
168
163
|
"data-slot": "button",
|
|
169
164
|
"data-variant": variant,
|
|
170
165
|
"data-size": size,
|
|
@@ -172,7 +167,8 @@ function Button({
|
|
|
172
167
|
...props
|
|
173
168
|
}
|
|
174
169
|
);
|
|
175
|
-
}
|
|
170
|
+
});
|
|
171
|
+
Button.displayName = "Button";
|
|
176
172
|
|
|
177
173
|
// src/components/Buttons/Button.tsx
|
|
178
174
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
@@ -4338,18 +4334,24 @@ var Popover2 = (props) => {
|
|
|
4338
4334
|
placement = "bottom",
|
|
4339
4335
|
offset = 10,
|
|
4340
4336
|
customContent,
|
|
4341
|
-
|
|
4337
|
+
onOpenChange,
|
|
4338
|
+
children,
|
|
4339
|
+
...rest
|
|
4342
4340
|
} = props;
|
|
4343
4341
|
const hasStrapline = typeof strapline === "string" ? strapline.trim() !== "" : strapline != null;
|
|
4344
4342
|
const hasDescription = typeof description === "string" ? description.trim() !== "" : description != null;
|
|
4345
4343
|
const [open, setOpen] = React40.useState(false);
|
|
4344
|
+
const handleOpenChange = (nextOpen) => {
|
|
4345
|
+
setOpen(nextOpen);
|
|
4346
|
+
onOpenChange?.(nextOpen);
|
|
4347
|
+
};
|
|
4346
4348
|
const handleCancel = () => {
|
|
4347
4349
|
onCancel?.();
|
|
4348
|
-
|
|
4350
|
+
handleOpenChange(false);
|
|
4349
4351
|
};
|
|
4350
4352
|
const handleOk = () => {
|
|
4351
4353
|
onOk?.();
|
|
4352
|
-
|
|
4354
|
+
handleOpenChange(false);
|
|
4353
4355
|
};
|
|
4354
4356
|
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
4357
|
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 +4386,7 @@ var Popover2 = (props) => {
|
|
|
4384
4386
|
}
|
|
4385
4387
|
};
|
|
4386
4388
|
const { side, align } = mapPlacementToSideAndAlign2(placement);
|
|
4387
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Popover, { open, onOpenChange:
|
|
4389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Popover, { open, onOpenChange: handleOpenChange, children: [
|
|
4388
4390
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PopoverTrigger, { asChild: true, children }),
|
|
4389
4391
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
4390
4392
|
PopoverContent,
|
|
@@ -4393,9 +4395,10 @@ var Popover2 = (props) => {
|
|
|
4393
4395
|
align,
|
|
4394
4396
|
sideOffset: offset,
|
|
4395
4397
|
className: cn(popoverClasses, className),
|
|
4398
|
+
...rest,
|
|
4396
4399
|
children: [
|
|
4397
4400
|
showArrow && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PopoverArrow, { className: popoverArrowClasses }),
|
|
4398
|
-
customContent ? typeof customContent === "function" ? customContent({ close: () =>
|
|
4401
|
+
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
4402
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "space-y-2", children: [
|
|
4400
4403
|
hasStrapline && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "caption text-secondary", children: strapline }),
|
|
4401
4404
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h4", { className: "subtitle-medium text-primary", children: title }),
|