@kopexa/drawer 10.0.10 → 12.0.0
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/{chunk-QUOFOYOZ.mjs → chunk-4DCIRIDK.mjs} +1 -1
- package/dist/{chunk-ZHAZ2QI3.mjs → chunk-PI2WIR3H.mjs} +33 -22
- package/dist/drawer.d.mts +20 -11
- package/dist/drawer.d.ts +20 -11
- package/dist/drawer.js +33 -32
- package/dist/drawer.mjs +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +33 -32
- package/dist/index.mjs +2 -2
- package/dist/namespace.d.mts +1 -1
- package/dist/namespace.d.ts +1 -1
- package/dist/namespace.js +33 -32
- package/dist/namespace.mjs +2 -2
- package/package.json +8 -8
|
@@ -6,10 +6,11 @@ var __export = (target, all) => {
|
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
// src/drawer.tsx
|
|
9
|
+
import { Dialog as SheetPrimitive } from "@base-ui-components/react/dialog";
|
|
9
10
|
import { CloseIcon } from "@kopexa/icons";
|
|
10
11
|
import { createContext } from "@kopexa/react-utils";
|
|
12
|
+
import { cn } from "@kopexa/shared-utils";
|
|
11
13
|
import { drawer } from "@kopexa/theme";
|
|
12
|
-
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
13
14
|
|
|
14
15
|
// ../../hooks/use-callback-ref/src/index.ts
|
|
15
16
|
import { useCallback, useInsertionEffect, useRef } from "react";
|
|
@@ -76,7 +77,7 @@ var DrawerRoot = (props) => {
|
|
|
76
77
|
});
|
|
77
78
|
const styles = drawer({ size, radius, placement });
|
|
78
79
|
return /* @__PURE__ */ jsx(DrawerProvider, { value: { styles, open, placement }, children: /* @__PURE__ */ jsx(
|
|
79
|
-
|
|
80
|
+
SheetPrimitive.Root,
|
|
80
81
|
{
|
|
81
82
|
"data-slot": "dialog",
|
|
82
83
|
open,
|
|
@@ -85,24 +86,34 @@ var DrawerRoot = (props) => {
|
|
|
85
86
|
}
|
|
86
87
|
) });
|
|
87
88
|
};
|
|
88
|
-
function DrawerTrigger({
|
|
89
|
-
|
|
89
|
+
function DrawerTrigger({
|
|
90
|
+
asChild = false,
|
|
91
|
+
children,
|
|
92
|
+
...props
|
|
93
|
+
}) {
|
|
94
|
+
return /* @__PURE__ */ jsx(
|
|
95
|
+
SheetPrimitive.Trigger,
|
|
96
|
+
{
|
|
97
|
+
"data-slot": "drawer-trigger",
|
|
98
|
+
render: asChild ? children : void 0,
|
|
99
|
+
...props,
|
|
100
|
+
children: !asChild && children
|
|
101
|
+
}
|
|
102
|
+
);
|
|
90
103
|
}
|
|
91
104
|
function DrawerPortal({ ...props }) {
|
|
92
|
-
return /* @__PURE__ */ jsx(
|
|
105
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Portal, { "data-slot": "drawer-portal", ...props });
|
|
93
106
|
}
|
|
94
107
|
function DrawerClose({ ...props }) {
|
|
95
|
-
return /* @__PURE__ */ jsx(
|
|
108
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Close, { "data-slot": "drawer-close", ...props });
|
|
96
109
|
}
|
|
97
110
|
function DrawerOverlay({ className, ...props }) {
|
|
98
111
|
const { styles } = useDrawerContext();
|
|
99
112
|
return /* @__PURE__ */ jsx(
|
|
100
|
-
|
|
113
|
+
SheetPrimitive.Backdrop,
|
|
101
114
|
{
|
|
102
115
|
"data-slot": "drawer-overlay",
|
|
103
|
-
className: styles.overlay(
|
|
104
|
-
className
|
|
105
|
-
}),
|
|
116
|
+
className: cn(styles.overlay(), className),
|
|
106
117
|
...props
|
|
107
118
|
}
|
|
108
119
|
);
|
|
@@ -113,15 +124,15 @@ var DrawerContent = (props) => {
|
|
|
113
124
|
return /* @__PURE__ */ jsxs(DrawerPortal, { "data-slot": "drawer-portal", children: [
|
|
114
125
|
/* @__PURE__ */ jsx(DrawerOverlay, {}),
|
|
115
126
|
/* @__PURE__ */ jsxs(
|
|
116
|
-
|
|
127
|
+
SheetPrimitive.Popup,
|
|
117
128
|
{
|
|
118
129
|
"data-slot": "drawer-content",
|
|
119
|
-
className: styles.content(
|
|
130
|
+
className: cn(styles.content(), className),
|
|
120
131
|
...rest,
|
|
121
132
|
children: [
|
|
122
133
|
children,
|
|
123
134
|
showCloseButton && /* @__PURE__ */ jsxs(
|
|
124
|
-
|
|
135
|
+
SheetPrimitive.Close,
|
|
125
136
|
{
|
|
126
137
|
"data-slot": "dialog-close",
|
|
127
138
|
className: styles.close(),
|
|
@@ -142,7 +153,7 @@ function DrawerHeader({ className, ...props }) {
|
|
|
142
153
|
"div",
|
|
143
154
|
{
|
|
144
155
|
"data-slot": "drawer-header",
|
|
145
|
-
className: styles.header(
|
|
156
|
+
className: cn(styles.header(), className),
|
|
146
157
|
...props
|
|
147
158
|
}
|
|
148
159
|
);
|
|
@@ -153,7 +164,7 @@ function DrawerFooter({ className, ...props }) {
|
|
|
153
164
|
"div",
|
|
154
165
|
{
|
|
155
166
|
"data-slot": "drawer-footer",
|
|
156
|
-
className: styles.footer(
|
|
167
|
+
className: cn(styles.footer(), className),
|
|
157
168
|
...props
|
|
158
169
|
}
|
|
159
170
|
);
|
|
@@ -164,7 +175,7 @@ function DrawerBody({ className, ...props }) {
|
|
|
164
175
|
"div",
|
|
165
176
|
{
|
|
166
177
|
"data-slot": "drawer-body",
|
|
167
|
-
className: styles.body(
|
|
178
|
+
className: cn(styles.body(), className),
|
|
168
179
|
...props
|
|
169
180
|
}
|
|
170
181
|
);
|
|
@@ -172,10 +183,10 @@ function DrawerBody({ className, ...props }) {
|
|
|
172
183
|
function DrawerTitle({ className, ...props }) {
|
|
173
184
|
const { styles } = useDrawerContext();
|
|
174
185
|
return /* @__PURE__ */ jsx(
|
|
175
|
-
|
|
186
|
+
SheetPrimitive.Title,
|
|
176
187
|
{
|
|
177
188
|
"data-slot": "drawer-title",
|
|
178
|
-
className: styles.title(
|
|
189
|
+
className: cn(styles.title(), className),
|
|
179
190
|
...props
|
|
180
191
|
}
|
|
181
192
|
);
|
|
@@ -186,10 +197,10 @@ function DrawerDescription({
|
|
|
186
197
|
}) {
|
|
187
198
|
const { styles } = useDrawerContext();
|
|
188
199
|
return /* @__PURE__ */ jsx(
|
|
189
|
-
|
|
200
|
+
SheetPrimitive.Description,
|
|
190
201
|
{
|
|
191
202
|
"data-slot": "drawer-description",
|
|
192
|
-
className: styles.description(
|
|
203
|
+
className: cn(styles.description(), className),
|
|
193
204
|
...props
|
|
194
205
|
}
|
|
195
206
|
);
|
|
@@ -200,10 +211,10 @@ function DrawerCloseTrigger({
|
|
|
200
211
|
}) {
|
|
201
212
|
const { styles } = useDrawerContext();
|
|
202
213
|
return /* @__PURE__ */ jsx(
|
|
203
|
-
|
|
214
|
+
SheetPrimitive.Close,
|
|
204
215
|
{
|
|
205
216
|
"data-slot": "drawer-close-trigger",
|
|
206
|
-
className: styles.closeTrigger(
|
|
217
|
+
className: cn(styles.closeTrigger(), className),
|
|
207
218
|
...props
|
|
208
219
|
}
|
|
209
220
|
);
|
package/dist/drawer.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ComponentProps } from 'react';
|
|
4
|
+
import { Dialog } from '@base-ui-components/react/dialog';
|
|
4
5
|
import { drawer, DrawerVariantProps } from '@kopexa/theme';
|
|
5
|
-
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
6
6
|
|
|
7
7
|
type DrawerContextValue = {
|
|
8
8
|
styles: ReturnType<typeof drawer>;
|
|
@@ -12,17 +12,26 @@ type DrawerContextValue = {
|
|
|
12
12
|
declare const DrawerProvider: react.Provider<DrawerContextValue>;
|
|
13
13
|
declare const useDrawerContext: () => DrawerContextValue;
|
|
14
14
|
|
|
15
|
-
type DrawerRootProps = ComponentProps<typeof
|
|
15
|
+
type DrawerRootProps = Omit<ComponentProps<typeof Dialog.Root>, "onOpenChange"> & DrawerVariantProps & {
|
|
16
|
+
onOpenChange?: (open: boolean) => void;
|
|
17
|
+
};
|
|
16
18
|
declare const DrawerRoot: (props: DrawerRootProps) => react_jsx_runtime.JSX.Element;
|
|
17
|
-
type DrawerTriggerProps = ComponentProps<typeof
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
type DrawerTriggerProps = ComponentProps<typeof Dialog.Trigger> & {
|
|
20
|
+
/**
|
|
21
|
+
* If true, the child element will be used as the trigger element.
|
|
22
|
+
* You should use render={} instead of asChild going forward.
|
|
23
|
+
* @deprecated please use render={}
|
|
24
|
+
*/
|
|
25
|
+
asChild?: boolean;
|
|
26
|
+
};
|
|
27
|
+
declare function DrawerTrigger({ asChild, children, ...props }: DrawerTriggerProps): react_jsx_runtime.JSX.Element;
|
|
28
|
+
type DrawerPortalProps = ComponentProps<typeof Dialog.Portal>;
|
|
20
29
|
declare function DrawerPortal({ ...props }: DrawerPortalProps): react_jsx_runtime.JSX.Element;
|
|
21
|
-
type DrawerCloseProps = ComponentProps<typeof
|
|
30
|
+
type DrawerCloseProps = ComponentProps<typeof Dialog.Close>;
|
|
22
31
|
declare function DrawerClose({ ...props }: DrawerCloseProps): react_jsx_runtime.JSX.Element;
|
|
23
|
-
type DrawerOverlayProps = ComponentProps<typeof
|
|
32
|
+
type DrawerOverlayProps = ComponentProps<typeof Dialog.Backdrop>;
|
|
24
33
|
declare function DrawerOverlay({ className, ...props }: DrawerOverlayProps): react_jsx_runtime.JSX.Element;
|
|
25
|
-
type DrawerContentProps = ComponentProps<typeof
|
|
34
|
+
type DrawerContentProps = ComponentProps<typeof Dialog.Popup> & {
|
|
26
35
|
showCloseButton?: boolean;
|
|
27
36
|
};
|
|
28
37
|
declare const DrawerContent: (props: DrawerContentProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -32,11 +41,11 @@ type DrawerFooterProps = ComponentProps<"div">;
|
|
|
32
41
|
declare function DrawerFooter({ className, ...props }: DrawerFooterProps): react_jsx_runtime.JSX.Element;
|
|
33
42
|
type DrawerBodyProps = ComponentProps<"div">;
|
|
34
43
|
declare function DrawerBody({ className, ...props }: DrawerBodyProps): react_jsx_runtime.JSX.Element;
|
|
35
|
-
type DrawerTitleProps = ComponentProps<typeof
|
|
44
|
+
type DrawerTitleProps = ComponentProps<typeof Dialog.Title>;
|
|
36
45
|
declare function DrawerTitle({ className, ...props }: DrawerTitleProps): react_jsx_runtime.JSX.Element;
|
|
37
|
-
type DrawerDescriptionProps = ComponentProps<typeof
|
|
46
|
+
type DrawerDescriptionProps = ComponentProps<typeof Dialog.Description>;
|
|
38
47
|
declare function DrawerDescription({ className, ...props }: DrawerDescriptionProps): react_jsx_runtime.JSX.Element;
|
|
39
|
-
type DrawerCloseTriggerProps = ComponentProps<typeof
|
|
48
|
+
type DrawerCloseTriggerProps = ComponentProps<typeof Dialog.Close>;
|
|
40
49
|
declare function DrawerCloseTrigger({ className, ...props }: DrawerCloseTriggerProps): react_jsx_runtime.JSX.Element;
|
|
41
50
|
|
|
42
51
|
export { DrawerBody, type DrawerBodyProps, DrawerClose, type DrawerCloseProps, DrawerCloseTrigger, type DrawerCloseTriggerProps, DrawerContent, type DrawerContentProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, DrawerOverlay, type DrawerOverlayProps, DrawerPortal, type DrawerPortalProps, DrawerProvider, DrawerRoot, type DrawerRootProps, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps, useDrawerContext };
|
package/dist/drawer.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ComponentProps } from 'react';
|
|
4
|
+
import { Dialog } from '@base-ui-components/react/dialog';
|
|
4
5
|
import { drawer, DrawerVariantProps } from '@kopexa/theme';
|
|
5
|
-
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
6
6
|
|
|
7
7
|
type DrawerContextValue = {
|
|
8
8
|
styles: ReturnType<typeof drawer>;
|
|
@@ -12,17 +12,26 @@ type DrawerContextValue = {
|
|
|
12
12
|
declare const DrawerProvider: react.Provider<DrawerContextValue>;
|
|
13
13
|
declare const useDrawerContext: () => DrawerContextValue;
|
|
14
14
|
|
|
15
|
-
type DrawerRootProps = ComponentProps<typeof
|
|
15
|
+
type DrawerRootProps = Omit<ComponentProps<typeof Dialog.Root>, "onOpenChange"> & DrawerVariantProps & {
|
|
16
|
+
onOpenChange?: (open: boolean) => void;
|
|
17
|
+
};
|
|
16
18
|
declare const DrawerRoot: (props: DrawerRootProps) => react_jsx_runtime.JSX.Element;
|
|
17
|
-
type DrawerTriggerProps = ComponentProps<typeof
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
type DrawerTriggerProps = ComponentProps<typeof Dialog.Trigger> & {
|
|
20
|
+
/**
|
|
21
|
+
* If true, the child element will be used as the trigger element.
|
|
22
|
+
* You should use render={} instead of asChild going forward.
|
|
23
|
+
* @deprecated please use render={}
|
|
24
|
+
*/
|
|
25
|
+
asChild?: boolean;
|
|
26
|
+
};
|
|
27
|
+
declare function DrawerTrigger({ asChild, children, ...props }: DrawerTriggerProps): react_jsx_runtime.JSX.Element;
|
|
28
|
+
type DrawerPortalProps = ComponentProps<typeof Dialog.Portal>;
|
|
20
29
|
declare function DrawerPortal({ ...props }: DrawerPortalProps): react_jsx_runtime.JSX.Element;
|
|
21
|
-
type DrawerCloseProps = ComponentProps<typeof
|
|
30
|
+
type DrawerCloseProps = ComponentProps<typeof Dialog.Close>;
|
|
22
31
|
declare function DrawerClose({ ...props }: DrawerCloseProps): react_jsx_runtime.JSX.Element;
|
|
23
|
-
type DrawerOverlayProps = ComponentProps<typeof
|
|
32
|
+
type DrawerOverlayProps = ComponentProps<typeof Dialog.Backdrop>;
|
|
24
33
|
declare function DrawerOverlay({ className, ...props }: DrawerOverlayProps): react_jsx_runtime.JSX.Element;
|
|
25
|
-
type DrawerContentProps = ComponentProps<typeof
|
|
34
|
+
type DrawerContentProps = ComponentProps<typeof Dialog.Popup> & {
|
|
26
35
|
showCloseButton?: boolean;
|
|
27
36
|
};
|
|
28
37
|
declare const DrawerContent: (props: DrawerContentProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -32,11 +41,11 @@ type DrawerFooterProps = ComponentProps<"div">;
|
|
|
32
41
|
declare function DrawerFooter({ className, ...props }: DrawerFooterProps): react_jsx_runtime.JSX.Element;
|
|
33
42
|
type DrawerBodyProps = ComponentProps<"div">;
|
|
34
43
|
declare function DrawerBody({ className, ...props }: DrawerBodyProps): react_jsx_runtime.JSX.Element;
|
|
35
|
-
type DrawerTitleProps = ComponentProps<typeof
|
|
44
|
+
type DrawerTitleProps = ComponentProps<typeof Dialog.Title>;
|
|
36
45
|
declare function DrawerTitle({ className, ...props }: DrawerTitleProps): react_jsx_runtime.JSX.Element;
|
|
37
|
-
type DrawerDescriptionProps = ComponentProps<typeof
|
|
46
|
+
type DrawerDescriptionProps = ComponentProps<typeof Dialog.Description>;
|
|
38
47
|
declare function DrawerDescription({ className, ...props }: DrawerDescriptionProps): react_jsx_runtime.JSX.Element;
|
|
39
|
-
type DrawerCloseTriggerProps = ComponentProps<typeof
|
|
48
|
+
type DrawerCloseTriggerProps = ComponentProps<typeof Dialog.Close>;
|
|
40
49
|
declare function DrawerCloseTrigger({ className, ...props }: DrawerCloseTriggerProps): react_jsx_runtime.JSX.Element;
|
|
41
50
|
|
|
42
51
|
export { DrawerBody, type DrawerBodyProps, DrawerClose, type DrawerCloseProps, DrawerCloseTrigger, type DrawerCloseTriggerProps, DrawerContent, type DrawerContentProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, DrawerOverlay, type DrawerOverlayProps, DrawerPortal, type DrawerPortalProps, DrawerProvider, DrawerRoot, type DrawerRootProps, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps, useDrawerContext };
|
package/dist/drawer.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
|
-
var __create = Object.create;
|
|
4
3
|
var __defProp = Object.defineProperty;
|
|
5
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
7
|
var __export = (target, all) => {
|
|
10
8
|
for (var name in all)
|
|
@@ -18,14 +16,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
16
|
}
|
|
19
17
|
return to;
|
|
20
18
|
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
20
|
|
|
31
21
|
// src/drawer.tsx
|
|
@@ -47,10 +37,11 @@ __export(drawer_exports, {
|
|
|
47
37
|
useDrawerContext: () => useDrawerContext
|
|
48
38
|
});
|
|
49
39
|
module.exports = __toCommonJS(drawer_exports);
|
|
40
|
+
var import_dialog = require("@base-ui-components/react/dialog");
|
|
50
41
|
var import_icons = require("@kopexa/icons");
|
|
51
42
|
var import_react_utils = require("@kopexa/react-utils");
|
|
43
|
+
var import_shared_utils = require("@kopexa/shared-utils");
|
|
52
44
|
var import_theme = require("@kopexa/theme");
|
|
53
|
-
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
54
45
|
|
|
55
46
|
// ../../hooks/use-callback-ref/src/index.ts
|
|
56
47
|
var import_react = require("react");
|
|
@@ -117,7 +108,7 @@ var DrawerRoot = (props) => {
|
|
|
117
108
|
});
|
|
118
109
|
const styles = (0, import_theme.drawer)({ size, radius, placement });
|
|
119
110
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerProvider, { value: { styles, open, placement }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
120
|
-
|
|
111
|
+
import_dialog.Dialog.Root,
|
|
121
112
|
{
|
|
122
113
|
"data-slot": "dialog",
|
|
123
114
|
open,
|
|
@@ -126,24 +117,34 @@ var DrawerRoot = (props) => {
|
|
|
126
117
|
}
|
|
127
118
|
) });
|
|
128
119
|
};
|
|
129
|
-
function DrawerTrigger({
|
|
130
|
-
|
|
120
|
+
function DrawerTrigger({
|
|
121
|
+
asChild = false,
|
|
122
|
+
children,
|
|
123
|
+
...props
|
|
124
|
+
}) {
|
|
125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
126
|
+
import_dialog.Dialog.Trigger,
|
|
127
|
+
{
|
|
128
|
+
"data-slot": "drawer-trigger",
|
|
129
|
+
render: asChild ? children : void 0,
|
|
130
|
+
...props,
|
|
131
|
+
children: !asChild && children
|
|
132
|
+
}
|
|
133
|
+
);
|
|
131
134
|
}
|
|
132
135
|
function DrawerPortal({ ...props }) {
|
|
133
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Portal, { "data-slot": "drawer-portal", ...props });
|
|
134
137
|
}
|
|
135
138
|
function DrawerClose({ ...props }) {
|
|
136
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Close, { "data-slot": "drawer-close", ...props });
|
|
137
140
|
}
|
|
138
141
|
function DrawerOverlay({ className, ...props }) {
|
|
139
142
|
const { styles } = useDrawerContext();
|
|
140
143
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
141
|
-
|
|
144
|
+
import_dialog.Dialog.Backdrop,
|
|
142
145
|
{
|
|
143
146
|
"data-slot": "drawer-overlay",
|
|
144
|
-
className: styles.overlay(
|
|
145
|
-
className
|
|
146
|
-
}),
|
|
147
|
+
className: (0, import_shared_utils.cn)(styles.overlay(), className),
|
|
147
148
|
...props
|
|
148
149
|
}
|
|
149
150
|
);
|
|
@@ -154,15 +155,15 @@ var DrawerContent = (props) => {
|
|
|
154
155
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DrawerPortal, { "data-slot": "drawer-portal", children: [
|
|
155
156
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerOverlay, {}),
|
|
156
157
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
157
|
-
|
|
158
|
+
import_dialog.Dialog.Popup,
|
|
158
159
|
{
|
|
159
160
|
"data-slot": "drawer-content",
|
|
160
|
-
className: styles.content(
|
|
161
|
+
className: (0, import_shared_utils.cn)(styles.content(), className),
|
|
161
162
|
...rest,
|
|
162
163
|
children: [
|
|
163
164
|
children,
|
|
164
165
|
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
165
|
-
|
|
166
|
+
import_dialog.Dialog.Close,
|
|
166
167
|
{
|
|
167
168
|
"data-slot": "dialog-close",
|
|
168
169
|
className: styles.close(),
|
|
@@ -183,7 +184,7 @@ function DrawerHeader({ className, ...props }) {
|
|
|
183
184
|
"div",
|
|
184
185
|
{
|
|
185
186
|
"data-slot": "drawer-header",
|
|
186
|
-
className: styles.header(
|
|
187
|
+
className: (0, import_shared_utils.cn)(styles.header(), className),
|
|
187
188
|
...props
|
|
188
189
|
}
|
|
189
190
|
);
|
|
@@ -194,7 +195,7 @@ function DrawerFooter({ className, ...props }) {
|
|
|
194
195
|
"div",
|
|
195
196
|
{
|
|
196
197
|
"data-slot": "drawer-footer",
|
|
197
|
-
className: styles.footer(
|
|
198
|
+
className: (0, import_shared_utils.cn)(styles.footer(), className),
|
|
198
199
|
...props
|
|
199
200
|
}
|
|
200
201
|
);
|
|
@@ -205,7 +206,7 @@ function DrawerBody({ className, ...props }) {
|
|
|
205
206
|
"div",
|
|
206
207
|
{
|
|
207
208
|
"data-slot": "drawer-body",
|
|
208
|
-
className: styles.body(
|
|
209
|
+
className: (0, import_shared_utils.cn)(styles.body(), className),
|
|
209
210
|
...props
|
|
210
211
|
}
|
|
211
212
|
);
|
|
@@ -213,10 +214,10 @@ function DrawerBody({ className, ...props }) {
|
|
|
213
214
|
function DrawerTitle({ className, ...props }) {
|
|
214
215
|
const { styles } = useDrawerContext();
|
|
215
216
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
216
|
-
|
|
217
|
+
import_dialog.Dialog.Title,
|
|
217
218
|
{
|
|
218
219
|
"data-slot": "drawer-title",
|
|
219
|
-
className: styles.title(
|
|
220
|
+
className: (0, import_shared_utils.cn)(styles.title(), className),
|
|
220
221
|
...props
|
|
221
222
|
}
|
|
222
223
|
);
|
|
@@ -227,10 +228,10 @@ function DrawerDescription({
|
|
|
227
228
|
}) {
|
|
228
229
|
const { styles } = useDrawerContext();
|
|
229
230
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
230
|
-
|
|
231
|
+
import_dialog.Dialog.Description,
|
|
231
232
|
{
|
|
232
233
|
"data-slot": "drawer-description",
|
|
233
|
-
className: styles.description(
|
|
234
|
+
className: (0, import_shared_utils.cn)(styles.description(), className),
|
|
234
235
|
...props
|
|
235
236
|
}
|
|
236
237
|
);
|
|
@@ -241,10 +242,10 @@ function DrawerCloseTrigger({
|
|
|
241
242
|
}) {
|
|
242
243
|
const { styles } = useDrawerContext();
|
|
243
244
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
244
|
-
|
|
245
|
+
import_dialog.Dialog.Close,
|
|
245
246
|
{
|
|
246
247
|
"data-slot": "drawer-close-trigger",
|
|
247
|
-
className: styles.closeTrigger(
|
|
248
|
+
className: (0, import_shared_utils.cn)(styles.closeTrigger(), className),
|
|
248
249
|
...props
|
|
249
250
|
}
|
|
250
251
|
);
|
package/dist/drawer.mjs
CHANGED
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
|
-
var __create = Object.create;
|
|
4
3
|
var __defProp = Object.defineProperty;
|
|
5
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
7
|
var __export = (target, all) => {
|
|
10
8
|
for (var name in all)
|
|
@@ -18,14 +16,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
16
|
}
|
|
19
17
|
return to;
|
|
20
18
|
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
20
|
|
|
31
21
|
// src/index.ts
|
|
@@ -37,10 +27,11 @@ __export(index_exports, {
|
|
|
37
27
|
module.exports = __toCommonJS(index_exports);
|
|
38
28
|
|
|
39
29
|
// src/drawer.tsx
|
|
30
|
+
var import_dialog = require("@base-ui-components/react/dialog");
|
|
40
31
|
var import_icons = require("@kopexa/icons");
|
|
41
32
|
var import_react_utils = require("@kopexa/react-utils");
|
|
33
|
+
var import_shared_utils = require("@kopexa/shared-utils");
|
|
42
34
|
var import_theme = require("@kopexa/theme");
|
|
43
|
-
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
44
35
|
|
|
45
36
|
// ../../hooks/use-callback-ref/src/index.ts
|
|
46
37
|
var import_react = require("react");
|
|
@@ -107,7 +98,7 @@ var DrawerRoot = (props) => {
|
|
|
107
98
|
});
|
|
108
99
|
const styles = (0, import_theme.drawer)({ size, radius, placement });
|
|
109
100
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerProvider, { value: { styles, open, placement }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
110
|
-
|
|
101
|
+
import_dialog.Dialog.Root,
|
|
111
102
|
{
|
|
112
103
|
"data-slot": "dialog",
|
|
113
104
|
open,
|
|
@@ -116,24 +107,34 @@ var DrawerRoot = (props) => {
|
|
|
116
107
|
}
|
|
117
108
|
) });
|
|
118
109
|
};
|
|
119
|
-
function DrawerTrigger({
|
|
120
|
-
|
|
110
|
+
function DrawerTrigger({
|
|
111
|
+
asChild = false,
|
|
112
|
+
children,
|
|
113
|
+
...props
|
|
114
|
+
}) {
|
|
115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
116
|
+
import_dialog.Dialog.Trigger,
|
|
117
|
+
{
|
|
118
|
+
"data-slot": "drawer-trigger",
|
|
119
|
+
render: asChild ? children : void 0,
|
|
120
|
+
...props,
|
|
121
|
+
children: !asChild && children
|
|
122
|
+
}
|
|
123
|
+
);
|
|
121
124
|
}
|
|
122
125
|
function DrawerPortal({ ...props }) {
|
|
123
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Portal, { "data-slot": "drawer-portal", ...props });
|
|
124
127
|
}
|
|
125
128
|
function DrawerClose({ ...props }) {
|
|
126
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Close, { "data-slot": "drawer-close", ...props });
|
|
127
130
|
}
|
|
128
131
|
function DrawerOverlay({ className, ...props }) {
|
|
129
132
|
const { styles } = useDrawerContext();
|
|
130
133
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
131
|
-
|
|
134
|
+
import_dialog.Dialog.Backdrop,
|
|
132
135
|
{
|
|
133
136
|
"data-slot": "drawer-overlay",
|
|
134
|
-
className: styles.overlay(
|
|
135
|
-
className
|
|
136
|
-
}),
|
|
137
|
+
className: (0, import_shared_utils.cn)(styles.overlay(), className),
|
|
137
138
|
...props
|
|
138
139
|
}
|
|
139
140
|
);
|
|
@@ -144,15 +145,15 @@ var DrawerContent = (props) => {
|
|
|
144
145
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DrawerPortal, { "data-slot": "drawer-portal", children: [
|
|
145
146
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerOverlay, {}),
|
|
146
147
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
147
|
-
|
|
148
|
+
import_dialog.Dialog.Popup,
|
|
148
149
|
{
|
|
149
150
|
"data-slot": "drawer-content",
|
|
150
|
-
className: styles.content(
|
|
151
|
+
className: (0, import_shared_utils.cn)(styles.content(), className),
|
|
151
152
|
...rest,
|
|
152
153
|
children: [
|
|
153
154
|
children,
|
|
154
155
|
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
155
|
-
|
|
156
|
+
import_dialog.Dialog.Close,
|
|
156
157
|
{
|
|
157
158
|
"data-slot": "dialog-close",
|
|
158
159
|
className: styles.close(),
|
|
@@ -173,7 +174,7 @@ function DrawerHeader({ className, ...props }) {
|
|
|
173
174
|
"div",
|
|
174
175
|
{
|
|
175
176
|
"data-slot": "drawer-header",
|
|
176
|
-
className: styles.header(
|
|
177
|
+
className: (0, import_shared_utils.cn)(styles.header(), className),
|
|
177
178
|
...props
|
|
178
179
|
}
|
|
179
180
|
);
|
|
@@ -184,7 +185,7 @@ function DrawerFooter({ className, ...props }) {
|
|
|
184
185
|
"div",
|
|
185
186
|
{
|
|
186
187
|
"data-slot": "drawer-footer",
|
|
187
|
-
className: styles.footer(
|
|
188
|
+
className: (0, import_shared_utils.cn)(styles.footer(), className),
|
|
188
189
|
...props
|
|
189
190
|
}
|
|
190
191
|
);
|
|
@@ -195,7 +196,7 @@ function DrawerBody({ className, ...props }) {
|
|
|
195
196
|
"div",
|
|
196
197
|
{
|
|
197
198
|
"data-slot": "drawer-body",
|
|
198
|
-
className: styles.body(
|
|
199
|
+
className: (0, import_shared_utils.cn)(styles.body(), className),
|
|
199
200
|
...props
|
|
200
201
|
}
|
|
201
202
|
);
|
|
@@ -203,10 +204,10 @@ function DrawerBody({ className, ...props }) {
|
|
|
203
204
|
function DrawerTitle({ className, ...props }) {
|
|
204
205
|
const { styles } = useDrawerContext();
|
|
205
206
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
206
|
-
|
|
207
|
+
import_dialog.Dialog.Title,
|
|
207
208
|
{
|
|
208
209
|
"data-slot": "drawer-title",
|
|
209
|
-
className: styles.title(
|
|
210
|
+
className: (0, import_shared_utils.cn)(styles.title(), className),
|
|
210
211
|
...props
|
|
211
212
|
}
|
|
212
213
|
);
|
|
@@ -217,10 +218,10 @@ function DrawerDescription({
|
|
|
217
218
|
}) {
|
|
218
219
|
const { styles } = useDrawerContext();
|
|
219
220
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
220
|
-
|
|
221
|
+
import_dialog.Dialog.Description,
|
|
221
222
|
{
|
|
222
223
|
"data-slot": "drawer-description",
|
|
223
|
-
className: styles.description(
|
|
224
|
+
className: (0, import_shared_utils.cn)(styles.description(), className),
|
|
224
225
|
...props
|
|
225
226
|
}
|
|
226
227
|
);
|
|
@@ -231,10 +232,10 @@ function DrawerCloseTrigger({
|
|
|
231
232
|
}) {
|
|
232
233
|
const { styles } = useDrawerContext();
|
|
233
234
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
234
|
-
|
|
235
|
+
import_dialog.Dialog.Close,
|
|
235
236
|
{
|
|
236
237
|
"data-slot": "drawer-close-trigger",
|
|
237
|
-
className: styles.closeTrigger(
|
|
238
|
+
className: (0, import_shared_utils.cn)(styles.closeTrigger(), className),
|
|
238
239
|
...props
|
|
239
240
|
}
|
|
240
241
|
);
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
namespace_exports
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4DCIRIDK.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useDrawerContext
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PI2WIR3H.mjs";
|
|
8
8
|
export {
|
|
9
9
|
namespace_exports as Drawer,
|
|
10
10
|
useDrawerContext
|
package/dist/namespace.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DrawerBody, DrawerBodyProps, DrawerClose, DrawerCloseProps, DrawerCloseTrigger, DrawerCloseTriggerProps, DrawerContent, DrawerContentProps, DrawerDescription, DrawerDescriptionProps, DrawerFooter, DrawerFooterProps, DrawerHeader, DrawerHeaderProps, DrawerOverlay, DrawerOverlayProps, DrawerPortal, DrawerPortalProps, DrawerRoot, DrawerRootProps, DrawerTitle, DrawerTitleProps, DrawerTrigger, DrawerTriggerProps } from './drawer.mjs';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
4
|
+
import '@base-ui-components/react/dialog';
|
|
4
5
|
import '@kopexa/theme';
|
|
5
|
-
import '@radix-ui/react-dialog';
|
|
6
6
|
|
|
7
7
|
declare namespace namespace {
|
|
8
8
|
export { DrawerBody as Body, DrawerBodyProps as BodyProps, DrawerClose as Close, DrawerCloseProps as CloseProps, DrawerCloseTrigger as CloseTrigger, DrawerCloseTriggerProps as CloseTriggerProps, DrawerContent as Content, DrawerContentProps as ContentProps, DrawerDescription as Description, DrawerDescriptionProps as DescriptionProps, DrawerFooter as Footer, DrawerFooterProps as FooterProps, DrawerHeader as Header, DrawerHeaderProps as HeaderProps, DrawerOverlay as Overlay, DrawerOverlayProps as OverlayProps, DrawerPortal as Portal, DrawerPortalProps as PortalProps, DrawerRoot as Root, DrawerRootProps as RootProps, DrawerTitle as Title, DrawerTitleProps as TitleProps, DrawerTrigger as Trigger, DrawerTriggerProps as TriggerProps };
|
package/dist/namespace.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DrawerBody, DrawerBodyProps, DrawerClose, DrawerCloseProps, DrawerCloseTrigger, DrawerCloseTriggerProps, DrawerContent, DrawerContentProps, DrawerDescription, DrawerDescriptionProps, DrawerFooter, DrawerFooterProps, DrawerHeader, DrawerHeaderProps, DrawerOverlay, DrawerOverlayProps, DrawerPortal, DrawerPortalProps, DrawerRoot, DrawerRootProps, DrawerTitle, DrawerTitleProps, DrawerTrigger, DrawerTriggerProps } from './drawer.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
4
|
+
import '@base-ui-components/react/dialog';
|
|
4
5
|
import '@kopexa/theme';
|
|
5
|
-
import '@radix-ui/react-dialog';
|
|
6
6
|
|
|
7
7
|
declare namespace namespace {
|
|
8
8
|
export { DrawerBody as Body, DrawerBodyProps as BodyProps, DrawerClose as Close, DrawerCloseProps as CloseProps, DrawerCloseTrigger as CloseTrigger, DrawerCloseTriggerProps as CloseTriggerProps, DrawerContent as Content, DrawerContentProps as ContentProps, DrawerDescription as Description, DrawerDescriptionProps as DescriptionProps, DrawerFooter as Footer, DrawerFooterProps as FooterProps, DrawerHeader as Header, DrawerHeaderProps as HeaderProps, DrawerOverlay as Overlay, DrawerOverlayProps as OverlayProps, DrawerPortal as Portal, DrawerPortalProps as PortalProps, DrawerRoot as Root, DrawerRootProps as RootProps, DrawerTitle as Title, DrawerTitleProps as TitleProps, DrawerTrigger as Trigger, DrawerTriggerProps as TriggerProps };
|
package/dist/namespace.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
|
-
var __create = Object.create;
|
|
4
3
|
var __defProp = Object.defineProperty;
|
|
5
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
7
|
var __export = (target, all) => {
|
|
10
8
|
for (var name in all)
|
|
@@ -18,14 +16,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
16
|
}
|
|
19
17
|
return to;
|
|
20
18
|
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
20
|
|
|
31
21
|
// src/namespace.ts
|
|
@@ -47,10 +37,11 @@ __export(namespace_exports, {
|
|
|
47
37
|
module.exports = __toCommonJS(namespace_exports);
|
|
48
38
|
|
|
49
39
|
// src/drawer.tsx
|
|
40
|
+
var import_dialog = require("@base-ui-components/react/dialog");
|
|
50
41
|
var import_icons = require("@kopexa/icons");
|
|
51
42
|
var import_react_utils = require("@kopexa/react-utils");
|
|
43
|
+
var import_shared_utils = require("@kopexa/shared-utils");
|
|
52
44
|
var import_theme = require("@kopexa/theme");
|
|
53
|
-
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
54
45
|
|
|
55
46
|
// ../../hooks/use-callback-ref/src/index.ts
|
|
56
47
|
var import_react = require("react");
|
|
@@ -117,7 +108,7 @@ var DrawerRoot = (props) => {
|
|
|
117
108
|
});
|
|
118
109
|
const styles = (0, import_theme.drawer)({ size, radius, placement });
|
|
119
110
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerProvider, { value: { styles, open, placement }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
120
|
-
|
|
111
|
+
import_dialog.Dialog.Root,
|
|
121
112
|
{
|
|
122
113
|
"data-slot": "dialog",
|
|
123
114
|
open,
|
|
@@ -126,24 +117,34 @@ var DrawerRoot = (props) => {
|
|
|
126
117
|
}
|
|
127
118
|
) });
|
|
128
119
|
};
|
|
129
|
-
function DrawerTrigger({
|
|
130
|
-
|
|
120
|
+
function DrawerTrigger({
|
|
121
|
+
asChild = false,
|
|
122
|
+
children,
|
|
123
|
+
...props
|
|
124
|
+
}) {
|
|
125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
126
|
+
import_dialog.Dialog.Trigger,
|
|
127
|
+
{
|
|
128
|
+
"data-slot": "drawer-trigger",
|
|
129
|
+
render: asChild ? children : void 0,
|
|
130
|
+
...props,
|
|
131
|
+
children: !asChild && children
|
|
132
|
+
}
|
|
133
|
+
);
|
|
131
134
|
}
|
|
132
135
|
function DrawerPortal({ ...props }) {
|
|
133
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Portal, { "data-slot": "drawer-portal", ...props });
|
|
134
137
|
}
|
|
135
138
|
function DrawerClose({ ...props }) {
|
|
136
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dialog.Dialog.Close, { "data-slot": "drawer-close", ...props });
|
|
137
140
|
}
|
|
138
141
|
function DrawerOverlay({ className, ...props }) {
|
|
139
142
|
const { styles } = useDrawerContext();
|
|
140
143
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
141
|
-
|
|
144
|
+
import_dialog.Dialog.Backdrop,
|
|
142
145
|
{
|
|
143
146
|
"data-slot": "drawer-overlay",
|
|
144
|
-
className: styles.overlay(
|
|
145
|
-
className
|
|
146
|
-
}),
|
|
147
|
+
className: (0, import_shared_utils.cn)(styles.overlay(), className),
|
|
147
148
|
...props
|
|
148
149
|
}
|
|
149
150
|
);
|
|
@@ -154,15 +155,15 @@ var DrawerContent = (props) => {
|
|
|
154
155
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DrawerPortal, { "data-slot": "drawer-portal", children: [
|
|
155
156
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(DrawerOverlay, {}),
|
|
156
157
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
157
|
-
|
|
158
|
+
import_dialog.Dialog.Popup,
|
|
158
159
|
{
|
|
159
160
|
"data-slot": "drawer-content",
|
|
160
|
-
className: styles.content(
|
|
161
|
+
className: (0, import_shared_utils.cn)(styles.content(), className),
|
|
161
162
|
...rest,
|
|
162
163
|
children: [
|
|
163
164
|
children,
|
|
164
165
|
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
165
|
-
|
|
166
|
+
import_dialog.Dialog.Close,
|
|
166
167
|
{
|
|
167
168
|
"data-slot": "dialog-close",
|
|
168
169
|
className: styles.close(),
|
|
@@ -183,7 +184,7 @@ function DrawerHeader({ className, ...props }) {
|
|
|
183
184
|
"div",
|
|
184
185
|
{
|
|
185
186
|
"data-slot": "drawer-header",
|
|
186
|
-
className: styles.header(
|
|
187
|
+
className: (0, import_shared_utils.cn)(styles.header(), className),
|
|
187
188
|
...props
|
|
188
189
|
}
|
|
189
190
|
);
|
|
@@ -194,7 +195,7 @@ function DrawerFooter({ className, ...props }) {
|
|
|
194
195
|
"div",
|
|
195
196
|
{
|
|
196
197
|
"data-slot": "drawer-footer",
|
|
197
|
-
className: styles.footer(
|
|
198
|
+
className: (0, import_shared_utils.cn)(styles.footer(), className),
|
|
198
199
|
...props
|
|
199
200
|
}
|
|
200
201
|
);
|
|
@@ -205,7 +206,7 @@ function DrawerBody({ className, ...props }) {
|
|
|
205
206
|
"div",
|
|
206
207
|
{
|
|
207
208
|
"data-slot": "drawer-body",
|
|
208
|
-
className: styles.body(
|
|
209
|
+
className: (0, import_shared_utils.cn)(styles.body(), className),
|
|
209
210
|
...props
|
|
210
211
|
}
|
|
211
212
|
);
|
|
@@ -213,10 +214,10 @@ function DrawerBody({ className, ...props }) {
|
|
|
213
214
|
function DrawerTitle({ className, ...props }) {
|
|
214
215
|
const { styles } = useDrawerContext();
|
|
215
216
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
216
|
-
|
|
217
|
+
import_dialog.Dialog.Title,
|
|
217
218
|
{
|
|
218
219
|
"data-slot": "drawer-title",
|
|
219
|
-
className: styles.title(
|
|
220
|
+
className: (0, import_shared_utils.cn)(styles.title(), className),
|
|
220
221
|
...props
|
|
221
222
|
}
|
|
222
223
|
);
|
|
@@ -227,10 +228,10 @@ function DrawerDescription({
|
|
|
227
228
|
}) {
|
|
228
229
|
const { styles } = useDrawerContext();
|
|
229
230
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
230
|
-
|
|
231
|
+
import_dialog.Dialog.Description,
|
|
231
232
|
{
|
|
232
233
|
"data-slot": "drawer-description",
|
|
233
|
-
className: styles.description(
|
|
234
|
+
className: (0, import_shared_utils.cn)(styles.description(), className),
|
|
234
235
|
...props
|
|
235
236
|
}
|
|
236
237
|
);
|
|
@@ -241,10 +242,10 @@ function DrawerCloseTrigger({
|
|
|
241
242
|
}) {
|
|
242
243
|
const { styles } = useDrawerContext();
|
|
243
244
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
244
|
-
|
|
245
|
+
import_dialog.Dialog.Close,
|
|
245
246
|
{
|
|
246
247
|
"data-slot": "drawer-close-trigger",
|
|
247
|
-
className: styles.closeTrigger(
|
|
248
|
+
className: (0, import_shared_utils.cn)(styles.closeTrigger(), className),
|
|
248
249
|
...props
|
|
249
250
|
}
|
|
250
251
|
);
|
package/dist/namespace.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-4DCIRIDK.mjs";
|
|
3
3
|
import {
|
|
4
4
|
DrawerBody,
|
|
5
5
|
DrawerClose,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
DrawerRoot,
|
|
14
14
|
DrawerTitle,
|
|
15
15
|
DrawerTrigger
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-PI2WIR3H.mjs";
|
|
17
17
|
export {
|
|
18
18
|
DrawerBody as Body,
|
|
19
19
|
DrawerClose as Close,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kopexa/drawer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "A drawer for kopexa",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"drawer"
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": ">=19.0.0-rc.0",
|
|
29
29
|
"react-dom": ">=19.0.0-rc.0",
|
|
30
|
-
"@kopexa/theme": "1.
|
|
30
|
+
"@kopexa/theme": "2.1.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@
|
|
34
|
-
"@kopexa/
|
|
35
|
-
"@kopexa/
|
|
36
|
-
"@kopexa/
|
|
37
|
-
"@kopexa/
|
|
38
|
-
"@kopexa/
|
|
33
|
+
"@base-ui-components/react": "1.0.0-beta.3",
|
|
34
|
+
"@kopexa/icons": "12.0.0",
|
|
35
|
+
"@kopexa/motion-utils": "12.0.0",
|
|
36
|
+
"@kopexa/react-utils": "3.0.0",
|
|
37
|
+
"@kopexa/shared-utils": "2.0.0",
|
|
38
|
+
"@kopexa/use-controllable-state": "2.0.0"
|
|
39
39
|
},
|
|
40
40
|
"clean-package": "../../../clean-package.config.json",
|
|
41
41
|
"module": "dist/index.mjs",
|