@bizapps/ui 1.2.2 → 1.2.3
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/main.cjs +20 -9
- package/dist/main.cjs.map +1 -1
- package/dist/main.d.cts +19 -1
- package/dist/main.d.ts +19 -1
- package/dist/main.js +20 -9
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -1598,7 +1598,8 @@ var ease = {
|
|
|
1598
1598
|
smooth: [0.4, 0, 0.2, 1],
|
|
1599
1599
|
enter: [0, 0, 0.2, 1],
|
|
1600
1600
|
exit: [0.4, 0, 1, 1],
|
|
1601
|
-
linear: [0, 0, 1, 1]
|
|
1601
|
+
linear: [0, 0, 1, 1],
|
|
1602
|
+
drawer: [0.22, 1, 0.36, 1]
|
|
1602
1603
|
};
|
|
1603
1604
|
var spring = {
|
|
1604
1605
|
gentle: { type: "spring", stiffness: 260, damping: 28 },
|
|
@@ -1642,6 +1643,15 @@ var transition = {
|
|
|
1642
1643
|
card: {
|
|
1643
1644
|
duration: duration.fast,
|
|
1644
1645
|
ease: ease.smooth
|
|
1646
|
+
},
|
|
1647
|
+
// Drawer / slide panel — smooth enter, fast exit
|
|
1648
|
+
drawer: {
|
|
1649
|
+
duration: 0.3,
|
|
1650
|
+
ease: ease.drawer
|
|
1651
|
+
},
|
|
1652
|
+
drawerExit: {
|
|
1653
|
+
duration: 0.2,
|
|
1654
|
+
ease: ease.exit
|
|
1645
1655
|
}
|
|
1646
1656
|
};
|
|
1647
1657
|
var fadeIn = {
|
|
@@ -8364,14 +8374,15 @@ function DataTableSearch({
|
|
|
8364
8374
|
)
|
|
8365
8375
|
] });
|
|
8366
8376
|
}
|
|
8367
|
-
var DrawerContext = react.createContext(false);
|
|
8368
|
-
function Drawer({ children, open, onOpenChange, ...props }) {
|
|
8377
|
+
var DrawerContext = react.createContext({ isOpen: false, modal: true });
|
|
8378
|
+
function Drawer({ children, open, onOpenChange, modal = true, ...props }) {
|
|
8369
8379
|
const [internalOpen, setInternalOpen] = react.useState(props.defaultOpen ?? false);
|
|
8370
8380
|
const isOpen = open !== void 0 ? open : internalOpen;
|
|
8371
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DrawerContext.Provider, { value: isOpen, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8381
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DrawerContext.Provider, { value: { isOpen, modal }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8372
8382
|
radixUi.Dialog.Root,
|
|
8373
8383
|
{
|
|
8374
8384
|
"data-slot": "drawer",
|
|
8385
|
+
modal,
|
|
8375
8386
|
...props,
|
|
8376
8387
|
open: isOpen,
|
|
8377
8388
|
onOpenChange: (v) => {
|
|
@@ -8389,7 +8400,7 @@ function DrawerClose({ ...props }) {
|
|
|
8389
8400
|
return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Close, { "data-slot": "drawer-close", ...props });
|
|
8390
8401
|
}
|
|
8391
8402
|
function DrawerPortal({ children, ...props }) {
|
|
8392
|
-
const isOpen = react.useContext(DrawerContext);
|
|
8403
|
+
const { isOpen } = react.useContext(DrawerContext);
|
|
8393
8404
|
return /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Portal, { forceMount: true, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.AnimatePresence, { mode: "sync", children: isOpen && children }) });
|
|
8394
8405
|
}
|
|
8395
8406
|
function DrawerOverlay({ className, ...props }) {
|
|
@@ -8427,8 +8438,9 @@ function DrawerContent({
|
|
|
8427
8438
|
const xInitial = side === "right" ? "100%" : side === "left" ? "-100%" : 0;
|
|
8428
8439
|
const yInitial = side === "bottom" ? "100%" : side === "top" ? "-100%" : 0;
|
|
8429
8440
|
const dragRef = react.useRef(null);
|
|
8441
|
+
const { modal } = react.useContext(DrawerContext);
|
|
8430
8442
|
return /* @__PURE__ */ jsxRuntime.jsxs(DrawerPortal, { children: [
|
|
8431
|
-
/* @__PURE__ */ jsxRuntime.jsx(DrawerOverlay, {}),
|
|
8443
|
+
modal && /* @__PURE__ */ jsxRuntime.jsx(DrawerOverlay, {}),
|
|
8432
8444
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8433
8445
|
radixUi.Dialog.Content,
|
|
8434
8446
|
{
|
|
@@ -8452,9 +8464,8 @@ function DrawerContent({
|
|
|
8452
8464
|
{
|
|
8453
8465
|
className: cn("flex flex-col", isHorizontal && "h-full"),
|
|
8454
8466
|
initial: { x: xInitial, y: yInitial, opacity: 0 },
|
|
8455
|
-
animate: { x: 0, y: 0, opacity: 1 },
|
|
8456
|
-
exit: { x: xInitial, y: yInitial, opacity: 0 },
|
|
8457
|
-
transition: transition.sidebar,
|
|
8467
|
+
animate: { x: 0, y: 0, opacity: 1, transition: transition.drawer },
|
|
8468
|
+
exit: { x: xInitial, y: yInitial, opacity: 0, transition: transition.drawerExit },
|
|
8458
8469
|
children: [
|
|
8459
8470
|
children,
|
|
8460
8471
|
showCloseButton && /* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Close, { "data-slot": "drawer-close", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|