@cagatayfdn/flora-components 0.0.111 → 0.0.112

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,52 +1,60 @@
1
- import { j as o } from "../../jsx-runtime-BcAkpsdy.js";
2
- import x from "../Button/Button.js";
3
- import C from "../Modal/Modal.js";
4
- import N from "../../hooks/useNiceModal.js";
5
- import { ThemeAppearance as r, AppearanceButton as b } from "../../enums/appearance.js";
6
- import { c as h } from "../../index-BHf7G3IG.js";
7
- import { N as j } from "../../index-H7XbDVmH.js";
8
- import { u as _ } from "../../useTranslation-CnCPcxVj.js";
9
- import '../../Confirm.css';const B = "_btnWrap_ztmp0_1", M = "_dark_ztmp0_9", s = {
1
+ import { j as e } from "../../jsx-runtime-BcAkpsdy.js";
2
+ import { useEffect as h } from "react";
3
+ import w from "../Button/Button.js";
4
+ import N from "../Modal/Modal.js";
5
+ import b from "../../hooks/useNiceModal.js";
6
+ import { ThemeAppearance as c, AppearanceButton as j } from "../../enums/appearance.js";
7
+ import { c as _ } from "../../index-BHf7G3IG.js";
8
+ import { N as y } from "../../index-H7XbDVmH.js";
9
+ import { u as v } from "../../useTranslation-CnCPcxVj.js";
10
+ import '../../Confirm.css';const B = "_btnWrap_ztmp0_1", E = "_dark_ztmp0_9", l = {
10
11
  btnWrap: B,
11
- dark: M
12
- }, T = (a) => {
13
- const { t } = _(), [, c] = N(a.id), {
14
- onClose: e,
15
- okBtnCallback: i,
16
- isLoading: l,
17
- appearence: p = r.LIGHT,
18
- description: m,
19
- descriptionClassName: d,
20
- title: f = t("title.warning"),
21
- okBtnText: k = t("button.yes_proceed"),
22
- cancelBtnText: u = t("button.cancel")
23
- } = a, n = () => {
24
- c(), e && e();
12
+ dark: E
13
+ }, M = (t) => {
14
+ const { t: n } = v(), [, m] = b(t.id), {
15
+ onClose: o,
16
+ okBtnCallback: r,
17
+ isLoading: p,
18
+ appearence: d = c.LIGHT,
19
+ description: f,
20
+ descriptionClassName: k,
21
+ title: u = n("title.warning"),
22
+ okBtnText: x = n("button.yes_proceed"),
23
+ cancelBtnText: C = n("button.cancel")
24
+ } = t, a = () => {
25
+ m(), o && o();
25
26
  };
26
- return /* @__PURE__ */ o.jsxs(C, { title: f, appearance: p, onClose: n, children: [
27
- /* @__PURE__ */ o.jsx(
27
+ return h(() => {
28
+ const s = (i) => {
29
+ i.key === "Enter" && (i.preventDefault(), r());
30
+ };
31
+ return window.addEventListener("keydown", s), () => {
32
+ window.removeEventListener("keydown", s);
33
+ };
34
+ }, []), /* @__PURE__ */ e.jsxs(N, { title: u, appearance: d, onClose: a, children: [
35
+ /* @__PURE__ */ e.jsx(
28
36
  "p",
29
37
  {
30
- className: h(d, {
31
- [s.dark]: r.DARK
38
+ className: _(k, {
39
+ [l.dark]: c.DARK
32
40
  }),
33
- children: m
41
+ children: f
34
42
  }
35
43
  ),
36
- /* @__PURE__ */ o.jsxs("div", { className: s.btnWrap, children: [
37
- /* @__PURE__ */ o.jsx(
38
- x,
44
+ /* @__PURE__ */ e.jsxs("div", { className: l.btnWrap, children: [
45
+ /* @__PURE__ */ e.jsx(
46
+ w,
39
47
  {
40
- appearance: b.PRIMARY,
41
- onClick: i,
42
- isLoading: l,
43
- children: k
48
+ appearance: j.PRIMARY,
49
+ onClick: r,
50
+ isLoading: p,
51
+ children: x
44
52
  }
45
53
  ),
46
- /* @__PURE__ */ o.jsx("a", { className: "link", onClick: n, children: u })
54
+ /* @__PURE__ */ e.jsx("a", { className: "link", onClick: a, children: C })
47
55
  ] })
48
56
  ] });
49
- }, v = j.create(T);
57
+ }, K = y.create(M);
50
58
  export {
51
- v as default
59
+ K as default
52
60
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cagatayfdn/flora-components",
3
- "version": "0.0.111",
3
+ "version": "0.0.112",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",