@cagatayfdn/flora-components 0.0.91 → 0.0.92
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/Provider.js +5 -5
- package/dist/components/Drawer/index.js +11 -11
- package/dist/hooks/index.js +8 -8
- package/dist/hooks/useDrawer.js +9 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
|
@@ -9,16 +9,16 @@ const w = {}, D = (e, r) => {
|
|
|
9
9
|
default:
|
|
10
10
|
return e;
|
|
11
11
|
}
|
|
12
|
-
}, s = c(void 0),
|
|
12
|
+
}, s = c(void 0), E = ({ children: e }) => {
|
|
13
13
|
const [r, o] = i(D, w), n = (t) => o({ type: "OPEN_DRAWER", id: t }), u = (t) => o({ type: "CLOSE_DRAWER", id: t });
|
|
14
14
|
return /* @__PURE__ */ a.jsx(s.Provider, { value: { state: r, openDrawer: n, closeDrawer: u }, children: e });
|
|
15
|
-
},
|
|
15
|
+
}, p = () => {
|
|
16
16
|
const e = d(s);
|
|
17
17
|
if (!e)
|
|
18
|
-
throw new Error("
|
|
18
|
+
throw new Error("useDrawerContext must be used within a DrawerProvider");
|
|
19
19
|
return e;
|
|
20
20
|
};
|
|
21
21
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
E as DrawerProvider,
|
|
23
|
+
p as useDrawerContext
|
|
24
24
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { j as e } from "../../jsx-runtime-BcAkpsdy.js";
|
|
2
2
|
import { c as w } from "../../index-BHf7G3IG.js";
|
|
3
|
-
import {
|
|
3
|
+
import { useDrawerContext as f } from "./Provider.js";
|
|
4
4
|
import h from "../Icon/index.js";
|
|
5
|
-
import { useEffect as
|
|
6
|
-
import '../../index.css';const
|
|
7
|
-
drawer:
|
|
5
|
+
import { useEffect as x } from "react";
|
|
6
|
+
import '../../index.css';const u = "_drawer_1bno3_1", y = "_header_1bno3_10", p = "_body_1bno3_32", a = {
|
|
7
|
+
drawer: u,
|
|
8
8
|
header: y,
|
|
9
9
|
body: p
|
|
10
10
|
};
|
|
11
|
-
function D({ id:
|
|
12
|
-
const { state: c, closeDrawer: l } = f(),
|
|
13
|
-
if (!
|
|
11
|
+
function D({ id: t, children: n, title: i, onClose: d }) {
|
|
12
|
+
const { state: c, closeDrawer: l } = f(), s = c[t] || !1;
|
|
13
|
+
if (!s)
|
|
14
14
|
return null;
|
|
15
15
|
const r = () => {
|
|
16
|
-
l(
|
|
16
|
+
l(t), d && d();
|
|
17
17
|
};
|
|
18
|
-
return
|
|
19
|
-
if (!
|
|
18
|
+
return x(() => {
|
|
19
|
+
if (!s)
|
|
20
20
|
return;
|
|
21
21
|
const o = (m) => {
|
|
22
22
|
m.key === "Escape" && r();
|
|
@@ -24,7 +24,7 @@ function D({ id: s, children: n, title: i, onClose: d }) {
|
|
|
24
24
|
return document.addEventListener("keydown", o), () => {
|
|
25
25
|
document.removeEventListener("keydown", o);
|
|
26
26
|
};
|
|
27
|
-
}, [
|
|
27
|
+
}, [s, t, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
28
28
|
/* @__PURE__ */ e.jsx(
|
|
29
29
|
"div",
|
|
30
30
|
{
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { AuthProvider as o, useAuth as
|
|
2
|
-
import { default as
|
|
1
|
+
import { AuthProvider as o, useAuth as t } from "./useAauth.js";
|
|
2
|
+
import { default as s } from "./useDisclosure.js";
|
|
3
3
|
import { default as f } from "./useNiceModal.js";
|
|
4
|
-
import { default as
|
|
5
|
-
import {
|
|
4
|
+
import { default as x } from "./useMediaQuery.js";
|
|
5
|
+
import { useDrawerContext as m } from "../components/Drawer/Provider.js";
|
|
6
6
|
export {
|
|
7
7
|
o as AuthProvider,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
t as useAuth,
|
|
9
|
+
s as useDisclosure,
|
|
10
|
+
m as useDrawerContext,
|
|
11
|
+
x as useMediaQuery,
|
|
12
12
|
f as useNiceModal
|
|
13
13
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -1377,7 +1377,7 @@ export declare function useDisclosure(isOpenInit?: boolean): {
|
|
|
1377
1377
|
onToggle: () => void;
|
|
1378
1378
|
};
|
|
1379
1379
|
|
|
1380
|
-
export declare const
|
|
1380
|
+
export declare const useDrawerContext: () => DrawerContextType;
|
|
1381
1381
|
|
|
1382
1382
|
export declare const useMediaQuery: ({ query, onMatch, onUnmatch }: MediaQueryProps) => boolean;
|
|
1383
1383
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1377,7 +1377,7 @@ export declare function useDisclosure(isOpenInit?: boolean): {
|
|
|
1377
1377
|
onToggle: () => void;
|
|
1378
1378
|
};
|
|
1379
1379
|
|
|
1380
|
-
export declare const
|
|
1380
|
+
export declare const useDrawerContext: () => DrawerContextType;
|
|
1381
1381
|
|
|
1382
1382
|
export declare const useMediaQuery: ({ query, onMatch, onUnmatch }: MediaQueryProps) => boolean;
|
|
1383
1383
|
|
package/dist/index.js
CHANGED
|
@@ -68,7 +68,7 @@ import { AuthProvider as zr, useAuth as Kr } from "./hooks/useAauth.js";
|
|
|
68
68
|
import { default as Yr } from "./hooks/useDisclosure.js";
|
|
69
69
|
import { default as Gr } from "./hooks/useNiceModal.js";
|
|
70
70
|
import { default as Xr } from "./hooks/useMediaQuery.js";
|
|
71
|
-
import {
|
|
71
|
+
import { useDrawerContext as $r } from "./components/Drawer/Provider.js";
|
|
72
72
|
import { default as ro, t as oo } from "./locales/i18n.js";
|
|
73
73
|
import { CLIENT_DATE_AND_TIME_FORMAT as to, CLIENT_DATE_AND_TIME_SHORT_FORMAT as fo, CLIENT_DATE_COMPARE_FORMAT as po, CLIENT_DATE_FILTER_FORMAT as lo, CLIENT_DATE_SHORT_FORMAT as mo, CLIENT_TIME_FORMAT as uo, CLIENT_TIME_FORMAT_PICKER as so, DateFormats as xo, MIN_DATE_TODAY as no, MIN_DATE_TOMORROW as io, SERVER_DATE_AND_TIME_FORMAT as To, SERVER_DATE_FORMAT as Ao, default as co, friendlyDate as Eo } from "./utils/date.js";
|
|
74
74
|
import { changeLanguage as Co, getCurrentLanguage as Do, getDatepickerLocale as Io } from "./utils/language.js";
|
|
@@ -184,7 +184,7 @@ export {
|
|
|
184
184
|
oo as t,
|
|
185
185
|
Kr as useAuth,
|
|
186
186
|
Yr as useDisclosure,
|
|
187
|
-
$r as
|
|
187
|
+
$r as useDrawerContext,
|
|
188
188
|
Xr as useMediaQuery,
|
|
189
189
|
Gr as useNiceModal
|
|
190
190
|
};
|