@manhphi1309/drawer 0.2.5 → 0.2.7
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 +2 -4
- package/dist/index.d.cts +2 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +2 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -25,7 +25,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
25
25
|
let react = require("react");
|
|
26
26
|
react = __toESM(react);
|
|
27
27
|
let vaul = require("vaul");
|
|
28
|
-
let _manhphi1309_hooks = require("@manhphi1309/hooks");
|
|
29
28
|
let _manhphi1309_utils = require("@manhphi1309/utils");
|
|
30
29
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
31
30
|
//#region index.tsx
|
|
@@ -45,7 +44,6 @@ function Drawer({ ...props }) {
|
|
|
45
44
|
if (!isControlled) setInternalOpen(newOpen);
|
|
46
45
|
onOpenChange?.(newOpen);
|
|
47
46
|
}, [isControlled, onOpenChange]);
|
|
48
|
-
(0, _manhphi1309_hooks.useThemeColorAnimation)(open ?? false);
|
|
49
47
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DrawerContext.Provider, {
|
|
50
48
|
value: {
|
|
51
49
|
open: open ?? false,
|
|
@@ -172,10 +170,10 @@ function DrawerContent({ className, children, panels, activePanelIndex = 0, onPa
|
|
|
172
170
|
})
|
|
173
171
|
});
|
|
174
172
|
}
|
|
175
|
-
function DrawerHeader({ className, leftAction, rightAction, children, ...props }) {
|
|
173
|
+
function DrawerHeader({ className, leftAction, rightAction, withSeparator = false, children, ...props }) {
|
|
176
174
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
177
175
|
"data-slot": "drawer-header",
|
|
178
|
-
className: (0, _manhphi1309_utils.cn)("flex items-center px-4 py-2 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:text-left", className),
|
|
176
|
+
className: (0, _manhphi1309_utils.cn)("flex items-center px-4 py-2 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:text-left", withSeparator && "border-b border-border", className),
|
|
179
177
|
...props,
|
|
180
178
|
children: leftAction || rightAction ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
181
179
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
package/dist/index.d.cts
CHANGED
|
@@ -42,11 +42,13 @@ declare function DrawerHeader({
|
|
|
42
42
|
className,
|
|
43
43
|
leftAction,
|
|
44
44
|
rightAction,
|
|
45
|
+
withSeparator,
|
|
45
46
|
children,
|
|
46
47
|
...props
|
|
47
48
|
}: React.ComponentProps<"div"> & {
|
|
48
49
|
leftAction?: React.ReactNode;
|
|
49
50
|
rightAction?: React.ReactNode;
|
|
51
|
+
withSeparator?: boolean;
|
|
50
52
|
}): React.JSX.Element;
|
|
51
53
|
declare function DrawerFooter({
|
|
52
54
|
className,
|
package/dist/index.d.mts
CHANGED
|
@@ -42,11 +42,13 @@ declare function DrawerHeader({
|
|
|
42
42
|
className,
|
|
43
43
|
leftAction,
|
|
44
44
|
rightAction,
|
|
45
|
+
withSeparator,
|
|
45
46
|
children,
|
|
46
47
|
...props
|
|
47
48
|
}: React.ComponentProps<"div"> & {
|
|
48
49
|
leftAction?: React.ReactNode;
|
|
49
50
|
rightAction?: React.ReactNode;
|
|
51
|
+
withSeparator?: boolean;
|
|
50
52
|
}): React.JSX.Element;
|
|
51
53
|
declare function DrawerFooter({
|
|
52
54
|
className,
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { Drawer as Drawer$1 } from "vaul";
|
|
4
|
-
import { useThemeColorAnimation } from "@manhphi1309/hooks";
|
|
5
4
|
import { cn } from "@manhphi1309/utils";
|
|
6
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
6
|
//#region index.tsx
|
|
@@ -21,7 +20,6 @@ function Drawer({ ...props }) {
|
|
|
21
20
|
if (!isControlled) setInternalOpen(newOpen);
|
|
22
21
|
onOpenChange?.(newOpen);
|
|
23
22
|
}, [isControlled, onOpenChange]);
|
|
24
|
-
useThemeColorAnimation(open ?? false);
|
|
25
23
|
return /* @__PURE__ */ jsx(DrawerContext.Provider, {
|
|
26
24
|
value: {
|
|
27
25
|
open: open ?? false,
|
|
@@ -148,10 +146,10 @@ function DrawerContent({ className, children, panels, activePanelIndex = 0, onPa
|
|
|
148
146
|
})
|
|
149
147
|
});
|
|
150
148
|
}
|
|
151
|
-
function DrawerHeader({ className, leftAction, rightAction, children, ...props }) {
|
|
149
|
+
function DrawerHeader({ className, leftAction, rightAction, withSeparator = false, children, ...props }) {
|
|
152
150
|
return /* @__PURE__ */ jsx("div", {
|
|
153
151
|
"data-slot": "drawer-header",
|
|
154
|
-
className: cn("flex items-center px-4 py-2 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:text-left", className),
|
|
152
|
+
className: cn("flex items-center px-4 py-2 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:text-left", withSeparator && "border-b border-border", className),
|
|
155
153
|
...props,
|
|
156
154
|
children: leftAction || rightAction ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
157
155
|
/* @__PURE__ */ jsx("div", {
|