@cagatayfdn/flora-components 0.0.89 → 0.0.90
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/components/Drawer/index.js +23 -18
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import { j as e } from "../../jsx-runtime-BcAkpsdy.js";
|
|
2
|
-
import { c
|
|
3
|
-
import { useDrawer as
|
|
4
|
-
import
|
|
5
|
-
import '../../index.css';const
|
|
6
|
-
drawer:
|
|
7
|
-
header:
|
|
8
|
-
body:
|
|
2
|
+
import { c } from "../../index-BHf7G3IG.js";
|
|
3
|
+
import { useDrawer as l } from "./Provider.js";
|
|
4
|
+
import m from "../Icon/index.js";
|
|
5
|
+
import '../../index.css';const h = "_drawer_1bno3_1", w = "_header_1bno3_10", x = "_body_1bno3_32", r = {
|
|
6
|
+
drawer: h,
|
|
7
|
+
header: w,
|
|
8
|
+
body: x
|
|
9
9
|
};
|
|
10
|
-
function
|
|
11
|
-
const { state:
|
|
12
|
-
|
|
10
|
+
function u({ id: s, children: t, title: o, onClose: a }) {
|
|
11
|
+
const { state: i, closeDrawer: n } = l();
|
|
12
|
+
if (!(i[s] || !1))
|
|
13
|
+
return null;
|
|
14
|
+
const d = () => {
|
|
15
|
+
n(s), a && a();
|
|
16
|
+
};
|
|
17
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
13
18
|
/* @__PURE__ */ e.jsx(
|
|
14
19
|
"div",
|
|
15
20
|
{
|
|
16
21
|
"data-testid": "drawer-overlay",
|
|
17
|
-
onClick:
|
|
22
|
+
onClick: d,
|
|
18
23
|
style: {
|
|
19
24
|
position: "fixed",
|
|
20
25
|
top: 0,
|
|
@@ -26,15 +31,15 @@ function p({ id: r, children: d, title: t }) {
|
|
|
26
31
|
}
|
|
27
32
|
}
|
|
28
33
|
),
|
|
29
|
-
/* @__PURE__ */ e.jsxs("div", { "data-testid": "drawer", className:
|
|
30
|
-
/* @__PURE__ */ e.jsxs("div", { "data-testid": "drawer-header", className:
|
|
31
|
-
/* @__PURE__ */ e.jsx("div", { children:
|
|
32
|
-
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
|
|
34
|
+
/* @__PURE__ */ e.jsxs("div", { "data-testid": "drawer", className: c(r.drawer), children: [
|
|
35
|
+
/* @__PURE__ */ e.jsxs("div", { "data-testid": "drawer-header", className: r.header, children: [
|
|
36
|
+
/* @__PURE__ */ e.jsx("div", { children: o }),
|
|
37
|
+
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(m, { onClick: d, name: "close" }) })
|
|
33
38
|
] }),
|
|
34
|
-
/* @__PURE__ */ e.jsx("div", { "data-testid": "drawer-body", className:
|
|
39
|
+
/* @__PURE__ */ e.jsx("div", { "data-testid": "drawer-body", className: r.body, children: t })
|
|
35
40
|
] })
|
|
36
|
-
] })
|
|
41
|
+
] });
|
|
37
42
|
}
|
|
38
43
|
export {
|
|
39
|
-
|
|
44
|
+
u as default
|
|
40
45
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -438,7 +438,7 @@ export declare type DividerProps = {
|
|
|
438
438
|
margin?: string;
|
|
439
439
|
};
|
|
440
440
|
|
|
441
|
-
export declare function Drawer({ id, children, title }: DrawerProps): JSX_2.Element | null;
|
|
441
|
+
export declare function Drawer({ id, children, title, onClose }: DrawerProps): JSX_2.Element | null;
|
|
442
442
|
|
|
443
443
|
export declare type DrawerContextType = {
|
|
444
444
|
state: DrawerState;
|
|
@@ -450,6 +450,7 @@ export declare type DrawerProps = {
|
|
|
450
450
|
id: string;
|
|
451
451
|
children: React.ReactNode;
|
|
452
452
|
title: string;
|
|
453
|
+
onClose?: () => void;
|
|
453
454
|
};
|
|
454
455
|
|
|
455
456
|
declare type DrawerState = {
|
package/dist/index.d.ts
CHANGED
|
@@ -438,7 +438,7 @@ export declare type DividerProps = {
|
|
|
438
438
|
margin?: string;
|
|
439
439
|
};
|
|
440
440
|
|
|
441
|
-
export declare function Drawer({ id, children, title }: DrawerProps): JSX_2.Element | null;
|
|
441
|
+
export declare function Drawer({ id, children, title, onClose }: DrawerProps): JSX_2.Element | null;
|
|
442
442
|
|
|
443
443
|
export declare type DrawerContextType = {
|
|
444
444
|
state: DrawerState;
|
|
@@ -450,6 +450,7 @@ export declare type DrawerProps = {
|
|
|
450
450
|
id: string;
|
|
451
451
|
children: React.ReactNode;
|
|
452
452
|
title: string;
|
|
453
|
+
onClose?: () => void;
|
|
453
454
|
};
|
|
454
455
|
|
|
455
456
|
declare type DrawerState = {
|