@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.
@@ -9,16 +9,16 @@ const w = {}, D = (e, r) => {
9
9
  default:
10
10
  return e;
11
11
  }
12
- }, s = c(void 0), p = ({ children: e }) => {
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
- }, x = () => {
15
+ }, p = () => {
16
16
  const e = d(s);
17
17
  if (!e)
18
- throw new Error("useDrawer must be used within a DrawerProvider");
18
+ throw new Error("useDrawerContext must be used within a DrawerProvider");
19
19
  return e;
20
20
  };
21
21
  export {
22
- p as DrawerProvider,
23
- x as useDrawer
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 { useDrawer as f } from "./Provider.js";
3
+ import { useDrawerContext as f } from "./Provider.js";
4
4
  import h from "../Icon/index.js";
5
- import { useEffect as u } from "react";
6
- import '../../index.css';const x = "_drawer_1bno3_1", y = "_header_1bno3_10", p = "_body_1bno3_32", a = {
7
- drawer: x,
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: s, children: n, title: i, onClose: d }) {
12
- const { state: c, closeDrawer: l } = f(), t = c[s] || !1;
13
- if (!t)
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(s), d && d();
16
+ l(t), d && d();
17
17
  };
18
- return u(() => {
19
- if (!t)
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
- }, [t, s, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
27
+ }, [s, t, r]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
28
28
  /* @__PURE__ */ e.jsx(
29
29
  "div",
30
30
  {
@@ -1,13 +1,13 @@
1
- import { AuthProvider as o, useAuth as u } from "./useAauth.js";
2
- import { default as t } from "./useDisclosure.js";
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 l } from "./useMediaQuery.js";
5
- import { useDrawer as p } from "../components/Drawer/Provider.js";
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
- u as useAuth,
9
- t as useDisclosure,
10
- p as useDrawer,
11
- l as useMediaQuery,
8
+ t as useAuth,
9
+ s as useDisclosure,
10
+ m as useDrawerContext,
11
+ x as useMediaQuery,
12
12
  f as useNiceModal
13
13
  };
@@ -0,0 +1,9 @@
1
+ import { useDrawerContext as t } from "../components/Drawer/Provider.js";
2
+ import { useId as a } from "react";
3
+ function u() {
4
+ const r = a(), { openDrawer: e, closeDrawer: o } = t();
5
+ return [e, o, r];
6
+ }
7
+ export {
8
+ u as default
9
+ };
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 useDrawer: () => DrawerContextType;
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 useDrawer: () => DrawerContextType;
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 { useDrawer as $r } from "./components/Drawer/Provider.js";
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 useDrawer,
187
+ $r as useDrawerContext,
188
188
  Xr as useMediaQuery,
189
189
  Gr as useNiceModal
190
190
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cagatayfdn/flora-components",
3
- "version": "0.0.91",
3
+ "version": "0.0.92",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",