@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.
@@ -1,20 +1,25 @@
1
1
  import { j as e } from "../../jsx-runtime-BcAkpsdy.js";
2
- import { c as n } from "../../index-BHf7G3IG.js";
3
- import { useDrawer as i } from "./Provider.js";
4
- import c from "../Icon/index.js";
5
- import '../../index.css';const l = "_drawer_1bno3_1", m = "_header_1bno3_10", h = "_body_1bno3_32", s = {
6
- drawer: l,
7
- header: m,
8
- body: h
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 p({ id: r, children: d, title: t }) {
11
- const { state: o, closeDrawer: a } = i();
12
- return o[r] || !1 ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
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: () => a(r),
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: n(s.drawer), children: [
30
- /* @__PURE__ */ e.jsxs("div", { "data-testid": "drawer-header", className: s.header, children: [
31
- /* @__PURE__ */ e.jsx("div", { children: t }),
32
- /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(c, { onClick: () => a(r), name: "close" }) })
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: s.body, children: d })
39
+ /* @__PURE__ */ e.jsx("div", { "data-testid": "drawer-body", className: r.body, children: t })
35
40
  ] })
36
- ] }) : null;
41
+ ] });
37
42
  }
38
43
  export {
39
- p as default
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 = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cagatayfdn/flora-components",
3
- "version": "0.0.89",
3
+ "version": "0.0.90",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",