@cagatayfdn/flora-components 0.0.111 → 0.0.113

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
  };
@@ -1,21 +1,23 @@
1
- import { j as o } from "../../jsx-runtime-BcAkpsdy.js";
2
- import { c as e } from "../../index-BHf7G3IG.js";
3
- import '../../ScrollContainer.css';const r = "_container_hnayg_1", c = {
4
- container: r
5
- }, m = ({
1
+ import { j as e } from "../../jsx-runtime-BcAkpsdy.js";
2
+ import { c as r } from "../../index-BHf7G3IG.js";
3
+ import '../../ScrollContainer.css';const c = "_container_hnayg_1", i = {
4
+ container: c
5
+ }, d = ({
6
6
  children: t,
7
7
  maxHeight: s,
8
8
  height: a,
9
- className: n
10
- }) => /* @__PURE__ */ o.jsx(
9
+ className: n,
10
+ onScroll: o
11
+ }) => /* @__PURE__ */ e.jsx(
11
12
  "div",
12
13
  {
14
+ onScroll: o,
13
15
  "data-testid": "scroll-container",
14
- className: e(n, c.container),
16
+ className: r(n, i.container),
15
17
  style: { maxHeight: s, height: a },
16
18
  children: t
17
19
  }
18
20
  );
19
21
  export {
20
- m as default
22
+ d as default
21
23
  };
package/dist/index.d.mts CHANGED
@@ -1078,13 +1078,14 @@ export declare type RowProps = {
1078
1078
  className?: string;
1079
1079
  };
1080
1080
 
1081
- export declare const ScrollContainer: ({ children, maxHeight, height, className, }: ScrollContainerProps) => JSX.Element;
1081
+ export declare const ScrollContainer: ({ children, maxHeight, height, className, onScroll }: ScrollContainerProps) => JSX.Element;
1082
1082
 
1083
1083
  export declare type ScrollContainerProps = {
1084
1084
  children: ReactNode;
1085
1085
  maxHeight?: number;
1086
1086
  height?: string | number;
1087
1087
  className?: string;
1088
+ onScroll?: (e: React.UIEvent<HTMLDivElement>) => void;
1088
1089
  };
1089
1090
 
1090
1091
  export declare const Select: {
package/dist/index.d.ts CHANGED
@@ -1078,13 +1078,14 @@ export declare type RowProps = {
1078
1078
  className?: string;
1079
1079
  };
1080
1080
 
1081
- export declare const ScrollContainer: ({ children, maxHeight, height, className, }: ScrollContainerProps) => JSX.Element;
1081
+ export declare const ScrollContainer: ({ children, maxHeight, height, className, onScroll }: ScrollContainerProps) => JSX.Element;
1082
1082
 
1083
1083
  export declare type ScrollContainerProps = {
1084
1084
  children: ReactNode;
1085
1085
  maxHeight?: number;
1086
1086
  height?: string | number;
1087
1087
  className?: string;
1088
+ onScroll?: (e: React.UIEvent<HTMLDivElement>) => void;
1088
1089
  };
1089
1090
 
1090
1091
  export declare const Select: {
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.113",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",