@cfx-dev/ui-components 2.1.12 → 2.1.13

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.
Files changed (33) hide show
  1. package/dist/assets/Badge.css +1 -1
  2. package/dist/assets/IconButton.css +1 -1
  3. package/dist/assets/Input.css +1 -1
  4. package/dist/assets/InputDropzone.css +1 -1
  5. package/dist/assets/ItemPreview.css +1 -1
  6. package/dist/assets/RichInput.css +1 -1
  7. package/dist/assets/Select.css +1 -1
  8. package/dist/assets/Table.css +1 -1
  9. package/dist/assets/Tabular.css +1 -1
  10. package/dist/assets/global.css +1 -1
  11. package/dist/components/Badge/Badge.d.ts +2 -0
  12. package/dist/components/Badge/Badge.js +23 -21
  13. package/dist/components/Badge/BadgeShowcase.js +44 -22
  14. package/dist/components/IconButton/IconButton.d.ts +2 -0
  15. package/dist/components/IconButton/IconButton.js +27 -24
  16. package/dist/components/Input/Input.d.ts +2 -0
  17. package/dist/components/Input/Input.js +94 -72
  18. package/dist/components/Input/InputShowcase.js +24 -10
  19. package/dist/components/Input/RichInput.js +28 -28
  20. package/dist/components/InputDropzone/InputDropzone.d.ts +9 -1
  21. package/dist/components/InputDropzone/InputDropzone.js +316 -300
  22. package/dist/components/InputDropzone/InputDropzoneShowcase.js +28 -18
  23. package/dist/components/InputDropzone/ItemPreview.d.ts +2 -1
  24. package/dist/components/InputDropzone/ItemPreview.js +20 -18
  25. package/dist/components/Modal/ModalShowcase.js +18 -14
  26. package/dist/components/Select/Select.js +53 -53
  27. package/dist/components/Table/Table.d.ts +2 -0
  28. package/dist/components/Table/Table.js +87 -82
  29. package/dist/components/Tabular/Tabular.js +46 -46
  30. package/dist/main.d.ts +1 -1
  31. package/dist/main.js +43 -42
  32. package/dist/styles-scss/tokens.scss +5 -0
  33. package/package.json +1 -1
@@ -2,8 +2,10 @@ import { default as React } from 'react';
2
2
  import { IconName } from '../Icon';
3
3
 
4
4
  export type BadgeColor = 'success' | 'neutral' | 'warning' | 'error';
5
+ export type BadgeSize = 'small' | 'normal';
5
6
  export interface BadgeProps {
6
7
  color?: BadgeColor;
8
+ size?: BadgeSize;
7
9
  icon?: IconName;
8
10
  children?: React.ReactNode;
9
11
  className?: string;
@@ -1,28 +1,30 @@
1
- import { jsxs as l, jsx as i } from "react/jsx-runtime";
2
- import m from "react";
3
- import { Icon as u } from "../Icon/Icon.js";
4
- import { clsx as f } from "../../utils/clsx.js";
5
- import '../../assets/Badge.css';const d = "_root_15tkr_1", h = "_success_15tkr_13", k = "_hoverable_15tkr_17", v = "_neutral_15tkr_20", b = "_warning_15tkr_24", g = "_error_15tkr_31", p = "_icon_15tkr_39", o = {
6
- root: d,
7
- success: h,
8
- hoverable: k,
9
- neutral: v,
1
+ import { jsxs as i, jsx as m } from "react/jsx-runtime";
2
+ import h from "react";
3
+ import { Icon as v } from "../Icon/Icon.js";
4
+ import { clsx as u } from "../../utils/clsx.js";
5
+ import '../../assets/Badge.css';const f = "_root_5qhvc_1", q = "_success_5qhvc_12", d = "_hoverable_5qhvc_16", x = "_neutral_5qhvc_19", b = "_warning_5qhvc_23", g = "_error_5qhvc_30", p = "_small_5qhvc_37", w = "_icon_5qhvc_41", o = {
6
+ root: f,
7
+ success: q,
8
+ hoverable: d,
9
+ neutral: x,
10
10
  warning: b,
11
11
  error: g,
12
- icon: p
13
- }, R = m.forwardRef(function(s, e) {
12
+ small: p,
13
+ icon: w
14
+ }, C = h.forwardRef(function(c, r) {
14
15
  const {
15
- color: t = "success",
16
- children: c,
17
- icon: r,
18
- className: n,
19
- hoverable: a = !1
20
- } = s, _ = f(o.root, n, o[t], { [o.hoverable]: a });
21
- return /* @__PURE__ */ l("div", { ref: e, className: _, children: [
22
- c,
23
- !!r && /* @__PURE__ */ i(u, { name: r, className: o.icon })
16
+ color: e = "success",
17
+ size: n = "normal",
18
+ children: a,
19
+ icon: s,
20
+ className: t,
21
+ hoverable: l = !1
22
+ } = c, _ = u(o.root, t, o[e], o[n], { [o.hoverable]: l });
23
+ return /* @__PURE__ */ i("div", { ref: r, className: _, children: [
24
+ a,
25
+ !!s && /* @__PURE__ */ m(v, { size: "xxsmall", name: s, className: o.icon })
24
26
  ] });
25
27
  });
26
28
  export {
27
- R as Badge
29
+ C as Badge
28
30
  };
@@ -1,56 +1,78 @@
1
1
  import { jsxs as e, jsx as r } from "react/jsx-runtime";
2
2
  import n from "react";
3
- import { Flex as c } from "../Layout/Flex/Flex.js";
4
- import { Text as l } from "../Text/Text.js";
5
- import { Badge as i } from "./Badge.js";
3
+ import { Flex as l } from "../Layout/Flex/Flex.js";
4
+ import { Text as i } from "../Text/Text.js";
5
+ import { Badge as c } from "./Badge.js";
6
6
  function o() {
7
- return /* @__PURE__ */ e(c, { gap: "large", vertical: !0, children: [
8
- /* @__PURE__ */ e(c, { gap: "normal", vertical: !0, children: [
9
- /* @__PURE__ */ r(l, { children: "Success" }),
7
+ return /* @__PURE__ */ e(l, { gap: "large", vertical: !0, children: [
8
+ /* @__PURE__ */ e(l, { gap: "normal", vertical: !0, children: [
9
+ /* @__PURE__ */ r(i, { children: "Success" }),
10
10
  /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
11
- i,
11
+ c,
12
12
  {
13
13
  color: "success",
14
- children: /* @__PURE__ */ r("p", { children: "success" })
14
+ children: "success"
15
15
  }
16
16
  ) })
17
17
  ] }),
18
- /* @__PURE__ */ e(c, { gap: "normal", vertical: !0, children: [
19
- /* @__PURE__ */ r(l, { children: "Neutral" }),
18
+ /* @__PURE__ */ e(l, { gap: "normal", vertical: !0, children: [
19
+ /* @__PURE__ */ r(i, { children: "Neutral" }),
20
20
  /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
21
- i,
21
+ c,
22
22
  {
23
23
  color: "neutral",
24
- children: /* @__PURE__ */ r("p", { children: "neutral" })
24
+ children: "neutral"
25
25
  }
26
26
  ) })
27
27
  ] }),
28
- /* @__PURE__ */ e(c, { gap: "normal", vertical: !0, children: [
29
- /* @__PURE__ */ r(l, { children: "Warning with hoverable" }),
28
+ /* @__PURE__ */ e(l, { gap: "normal", vertical: !0, children: [
29
+ /* @__PURE__ */ r(i, { children: "Warning with hoverable" }),
30
30
  /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
31
- i,
31
+ c,
32
32
  {
33
33
  color: "warning",
34
34
  icon: "MoreInfo",
35
35
  hoverable: !0,
36
- children: /* @__PURE__ */ r("p", { children: "warning" })
36
+ children: "warning"
37
37
  }
38
38
  ) })
39
39
  ] }),
40
- /* @__PURE__ */ e(c, { gap: "normal", vertical: !0, children: [
41
- /* @__PURE__ */ r(l, { children: "Error" }),
40
+ /* @__PURE__ */ e(l, { gap: "normal", vertical: !0, children: [
41
+ /* @__PURE__ */ r(i, { children: "Error" }),
42
42
  /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
43
- i,
43
+ c,
44
44
  {
45
45
  color: "error",
46
+ icon: "Sort",
47
+ children: "error"
48
+ }
49
+ ) })
50
+ ] }),
51
+ /* @__PURE__ */ e(l, { gap: "normal", vertical: !0, children: [
52
+ /* @__PURE__ */ r(i, { children: "Small" }),
53
+ /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
54
+ c,
55
+ {
56
+ size: "small",
57
+ children: "Small"
58
+ }
59
+ ) })
60
+ ] }),
61
+ /* @__PURE__ */ e(l, { gap: "normal", vertical: !0, children: [
62
+ /* @__PURE__ */ r(i, { children: "Small Error" }),
63
+ /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
64
+ c,
65
+ {
66
+ color: "error",
67
+ size: "small",
46
68
  icon: "MoreInfo",
47
- children: /* @__PURE__ */ r("p", { children: "error" })
69
+ children: "Small Error"
48
70
  }
49
71
  ) })
50
72
  ] })
51
73
  ] });
52
74
  }
53
- const u = n.memo(o);
75
+ const s = n.memo(o);
54
76
  export {
55
- u as default
77
+ s as default
56
78
  };
@@ -3,9 +3,11 @@ import { IconSize } from '../Icon';
3
3
  import { IconName } from '../Icons';
4
4
  import { TextColorProps } from '../Text';
5
5
 
6
+ type IconButtonAreaSize = 'small' | 'medium' | 'large';
6
7
  export interface IconButtonProps extends TextColorProps {
7
8
  name: IconName;
8
9
  size?: IconSize;
10
+ areaSize?: IconButtonAreaSize;
9
11
  onClick?: () => void;
10
12
  className?: string;
11
13
  disabled?: boolean;
@@ -1,35 +1,38 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import u from "react";
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import _ from "react";
3
3
  import { Icon as p } from "../Icon/Icon.js";
4
- import { clsx as _ } from "../../utils/clsx.js";
5
- import '../../assets/IconButton.css';const f = "_unset_1cc2r_1", b = "_root_1cc2r_5", t = {
6
- unset: f,
7
- root: b
4
+ import { clsx as x } from "../../utils/clsx.js";
5
+ import '../../assets/IconButton.css';const d = "_unset_1l0x5_1", f = "_root_1l0x5_5", b = "_medium_1l0x5_19", g = "_large_1l0x5_22", o = {
6
+ unset: d,
7
+ root: f,
8
+ medium: b,
9
+ large: g
8
10
  };
9
- function d(r) {
11
+ function y(e) {
10
12
  const {
11
- name: s,
12
- onClick: n,
13
- className: c,
14
- disabled: a,
15
- ariaLabel: e,
16
- size: l = "xxsmall",
17
- color: m = "primary",
18
- ...i
19
- } = r;
20
- return /* @__PURE__ */ o(
13
+ name: r,
14
+ onClick: s,
15
+ className: a,
16
+ disabled: l,
17
+ ariaLabel: n,
18
+ areaSize: m = "small",
19
+ size: c = "xxsmall",
20
+ color: i = "primary",
21
+ ...u
22
+ } = e;
23
+ return /* @__PURE__ */ t(
21
24
  "button",
22
25
  {
23
26
  type: "button",
24
- className: _(t.unset, t.root, c),
25
- onClick: n,
26
- disabled: a,
27
- "aria-label": e,
28
- children: /* @__PURE__ */ o(p, { as: "span", name: s, ...i, color: m, size: l })
27
+ className: x(o.unset, o.root, a, o[m]),
28
+ onClick: s,
29
+ disabled: l,
30
+ "aria-label": n,
31
+ children: /* @__PURE__ */ t(p, { as: "span", name: r, ...u, color: i, size: c })
29
32
  }
30
33
  );
31
34
  }
32
- const N = u.memo(d);
35
+ const h = _.memo(y);
33
36
  export {
34
- N as default
37
+ h as default
35
38
  };
@@ -2,6 +2,7 @@ import { default as React } from 'react';
2
2
  import { IconName } from '../Icon';
3
3
 
4
4
  export type InputSize = 'small' | 'normal' | 'large';
5
+ export type InputTheme = 'default' | 'onlight';
5
6
  type InputTypeSpecificProps = {
6
7
  type?: 'text' | 'password' | 'search';
7
8
  value?: string;
@@ -14,6 +15,7 @@ type InputTypeSpecificProps = {
14
15
  export type InputProps = InputTypeSpecificProps & {
15
16
  id?: string;
16
17
  size?: InputSize;
18
+ theme?: InputTheme;
17
19
  tabIndex?: number;
18
20
  autofocus?: boolean;
19
21
  pattern?: RegExp;
@@ -1,88 +1,110 @@
1
- import { jsxs as b, jsx as p } from "react/jsx-runtime";
2
- import o from "react";
3
- import { Icon as j } from "../Icon/Icon.js";
4
- import { Indicator as G } from "../Indicator/Indicator.js";
5
- import { clsx as T } from "../../utils/clsx.js";
6
- import { getValue as B } from "../../utils/getValue.js";
7
- import '../../assets/Input.css';const W = "_root_1truz_1", X = "_input_1truz_1", $ = "_small_1truz_5", q = "_large_1truz_9", H = "_placeholderIcon_1truz_75", J = "_empty_1truz_151", L = "_decorator_1truz_156", e = {
8
- root: W,
9
- input: X,
10
- small: $,
11
- large: q,
12
- placeholderIcon: H,
13
- "full-width": "_full-width_1truz_145",
14
- empty: J,
15
- decorator: L,
16
- "backdrop-blur": "_backdrop-blur_1truz_173"
17
- }, te = o.forwardRef(function(a, y) {
1
+ import { jsxs as G, jsx as t } from "react/jsx-runtime";
2
+ import r from "react";
3
+ import { Icon as T } from "../Icon/Icon.js";
4
+ import W from "../IconButton/IconButton.js";
5
+ import { Indicator as X } from "../Indicator/Indicator.js";
6
+ import { clsx as $ } from "../../utils/clsx.js";
7
+ import { getValue as q } from "../../utils/getValue.js";
8
+ import '../../assets/Input.css';const H = "_root_e1sis_1", J = "_input_e1sis_1", L = "_small_e1sis_5", O = "_large_e1sis_9", P = "_placeholderIcon_e1sis_72", Q = "_empty_e1sis_164", U = "_decorator_e1sis_169", Y = "_onlight_e1sis_186", e = {
9
+ root: H,
10
+ input: J,
11
+ small: L,
12
+ large: O,
13
+ placeholderIcon: P,
14
+ "full-width": "_full-width_e1sis_158",
15
+ empty: Q,
16
+ decorator: U,
17
+ onlight: Y,
18
+ "backdrop-blur": "_backdrop-blur_e1sis_240"
19
+ };
20
+ function Z(I) {
21
+ const {
22
+ decorator: o,
23
+ loading: i,
24
+ type: u,
25
+ hasValue: d,
26
+ onCleare: a
27
+ } = I;
28
+ return i ? /* @__PURE__ */ t("div", { className: e.decorator, children: /* @__PURE__ */ t(X, {}) }) : o ? /* @__PURE__ */ t("div", { className: e.decorator, children: q(o) }) : u === "search" && d ? /* @__PURE__ */ t("div", { className: e.decorator, children: /* @__PURE__ */ t(W, { size: "xsmall", areaSize: "large", name: "Close", onClick: a }) }) : null;
29
+ }
30
+ const se = r.forwardRef(function(o, i) {
18
31
  const {
19
- id: I,
20
- fullWidth: N = !1,
21
- value: r,
22
- onChange: c,
23
- onSubmit: u,
24
- onKeyDown: s,
25
- pattern: d,
26
- tabIndex: z,
27
- loading: h = !1,
28
- spellCheck: g = !0,
29
- autofocus: k = !1,
30
- disabled: w = !1,
31
- className: x = "",
32
- placeholder: l = "",
33
- placeholderIcon: n,
34
- type: C = "text",
32
+ id: u,
33
+ fullWidth: d = !1,
34
+ value: a,
35
+ onChange: m,
36
+ onSubmit: f,
37
+ onKeyDown: _,
38
+ pattern: p,
39
+ tabIndex: C,
40
+ loading: N = !1,
41
+ spellCheck: k = !0,
42
+ autofocus: w = !1,
43
+ disabled: x = !1,
44
+ className: v = "",
45
+ placeholder: s = "",
46
+ placeholderIcon: c,
47
+ type: g = "text",
35
48
  size: E = "normal",
36
- decorator: i,
37
- backdropBlur: v = !1
38
- } = a, [m, R] = o.useState(r), V = typeof m < "u" && m !== "" && m !== null || typeof r < "u" && r !== "" && r !== null, S = a.type === "number" && (a.min ?? Number.MIN_SAFE_INTEGER) || void 0, A = a.type === "number" && (a.max ?? Number.MAX_SAFE_INTEGER) || void 0, _ = o.useCallback((t) => {
39
- R(t), c && c(t);
40
- }, [c]), D = o.useCallback(
41
- (t) => {
49
+ theme: R = "default",
50
+ decorator: V,
51
+ backdropBlur: S = !1
52
+ } = o, [h, D] = r.useState(a), y = typeof h < "u" && h !== "" && h !== null || typeof a < "u" && a !== "" && a !== null, z = o.type === "number" && (o.min ?? Number.MIN_SAFE_INTEGER) || void 0, A = o.type === "number" && (o.max ?? Number.MAX_SAFE_INTEGER) || void 0, n = r.useCallback((l) => {
53
+ D(l), m && m(l);
54
+ }, [m]), F = r.useCallback(
55
+ (l) => {
42
56
  const {
43
- value: f
44
- } = t.target;
45
- if (d) {
46
- d.test(f) && _(f);
57
+ value: b
58
+ } = l.target;
59
+ if (p) {
60
+ p.test(b) && n(b);
47
61
  return;
48
62
  }
49
- _(f);
63
+ n(b);
50
64
  },
51
- [_, d]
52
- ), F = o.useCallback((t) => {
53
- s && s(t), u && t.key === "Enter" && u();
54
- }, [s, u]), K = T(e.root, e[E], x, {
55
- [e["full-width"]]: N,
56
- [e["backdrop-blur"]]: v,
57
- [e.empty]: !V
58
- }), M = o.useMemo(() => l ? n ? ` ${l.trim()}` : l.trim() : "", [l, n]);
59
- return /* @__PURE__ */ b("div", { className: K, children: [
60
- /* @__PURE__ */ p(
65
+ [n, p]
66
+ ), K = r.useCallback((l) => {
67
+ _ && _(l), f && l.key === "Enter" && f();
68
+ }, [_, f]), M = r.useCallback(() => {
69
+ n("");
70
+ }, [n]), j = $(e.root, e[E], e[R], v, {
71
+ [e["full-width"]]: d,
72
+ [e["backdrop-blur"]]: S,
73
+ [e.empty]: !y
74
+ }), B = r.useMemo(() => s ? c ? ` ${s.trim()}` : s.trim() : "", [s, c]);
75
+ return /* @__PURE__ */ G("div", { className: j, children: [
76
+ /* @__PURE__ */ t(
61
77
  "input",
62
78
  {
63
- id: I,
64
- ref: y,
65
- type: C,
66
- tabIndex: z,
67
- autoFocus: k,
79
+ id: u,
80
+ ref: i,
81
+ type: g,
82
+ tabIndex: C,
83
+ autoFocus: w,
68
84
  className: e.input,
69
- value: r,
70
- placeholder: M,
71
- disabled: w,
72
- onChange: D,
73
- onKeyDown: F,
74
- spellCheck: g,
75
- min: S,
85
+ value: a,
86
+ placeholder: B,
87
+ disabled: x,
88
+ onChange: F,
89
+ onKeyDown: K,
90
+ spellCheck: k,
91
+ min: z,
76
92
  max: A
77
93
  }
78
94
  ),
79
- n && /* @__PURE__ */ p(j, { name: n, className: e.placeholderIcon }),
80
- (h || !!i) && /* @__PURE__ */ b("div", { className: e.decorator, children: [
81
- !!h && /* @__PURE__ */ p(G, {}),
82
- !!i && B(i)
83
- ] })
95
+ c && /* @__PURE__ */ t(T, { name: c, className: e.placeholderIcon }),
96
+ /* @__PURE__ */ t(
97
+ Z,
98
+ {
99
+ decorator: V,
100
+ loading: N,
101
+ type: g,
102
+ hasValue: y,
103
+ onCleare: M
104
+ }
105
+ )
84
106
  ] });
85
107
  });
86
108
  export {
87
- te as default
109
+ se as default
88
110
  };
@@ -3,9 +3,9 @@ import i from "react";
3
3
  import { Flex as r } from "../Layout/Flex/Flex.js";
4
4
  import { Text as a } from "../Text/Text.js";
5
5
  import c from "./Input.js";
6
- const p = /^\+?[0-9]*$/;
7
- function u() {
8
- const [d, o] = i.useState(""), [n, h] = i.useState(0);
6
+ const m = /^\+?[0-9]*$/;
7
+ function s() {
8
+ const [d, h] = i.useState(""), [o, n] = i.useState(0), [t, p] = i.useState("");
9
9
  return /* @__PURE__ */ l(r, { gap: "large", vertical: !0, children: [
10
10
  /* @__PURE__ */ l(r, { gap: "normal", vertical: !0, children: [
11
11
  /* @__PURE__ */ e(a, { children: "Small" }),
@@ -45,12 +45,12 @@ function u() {
45
45
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
46
46
  c,
47
47
  {
48
- pattern: p,
48
+ pattern: m,
49
49
  placeholder: "Placeholder",
50
50
  size: "large",
51
51
  placeholderIcon: "Tick",
52
52
  value: d,
53
- onChange: o
53
+ onChange: h
54
54
  }
55
55
  ) })
56
56
  ] }),
@@ -67,7 +67,7 @@ function u() {
67
67
  ) })
68
68
  ] }),
69
69
  /* @__PURE__ */ l(r, { gap: "normal", vertical: !0, children: [
70
- /* @__PURE__ */ e(a, { children: "Number input with min=1 max=100" }),
70
+ /* @__PURE__ */ e(a, { children: "Type Number input with min=1 max=100" }),
71
71
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
72
72
  c,
73
73
  {
@@ -77,14 +77,28 @@ function u() {
77
77
  type: "number",
78
78
  min: 1,
79
79
  max: 100,
80
- value: n,
81
- onChange: (t) => h(Number(t))
80
+ value: o,
81
+ onChange: (u) => n(Number(u))
82
+ }
83
+ ) })
84
+ ] }),
85
+ /* @__PURE__ */ l(r, { gap: "normal", vertical: !0, children: [
86
+ /* @__PURE__ */ e(a, { children: "Type search" }),
87
+ /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
88
+ c,
89
+ {
90
+ placeholder: "Placeholder",
91
+ size: "large",
92
+ placeholderIcon: "Search",
93
+ type: "search",
94
+ value: t,
95
+ onChange: p
82
96
  }
83
97
  ) })
84
98
  ] })
85
99
  ] });
86
100
  }
87
- const z = i.memo(u);
101
+ const x = i.memo(s);
88
102
  export {
89
- z as default
103
+ x as default
90
104
  };
@@ -1,63 +1,63 @@
1
- import { jsxs as B, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as D, jsx as t } from "react/jsx-runtime";
2
2
  import r from "react";
3
- import { Button as D } from "../Button/Button.js";
4
- import { clsx as F } from "../../utils/clsx.js";
3
+ import { Button as F } from "../Button/Button.js";
4
+ import { clsx as I } from "../../utils/clsx.js";
5
5
  import { useDynamicRef as i } from "../../utils/hooks/useDynamicRef.js";
6
6
  import "../../utils/hooks/useGlobalKeyboardEvent.js";
7
7
  import "../../utils/hooks/useKeyboardClose.js";
8
8
  import "../../index-2hJuj4UN.js";
9
- import '../../assets/RichInput.css';const I = "_root_1w3oj_1", L = "_renderer_1w3oj_1", T = "_small_1w3oj_5", E = "_large_1w3oj_10", z = "_clear_1w3oj_144", n = {
10
- root: I,
11
- renderer: L,
12
- small: T,
9
+ import '../../assets/RichInput.css';const L = "_root_1vnop_1", T = "_renderer_1vnop_1", j = "_small_1vnop_5", E = "_large_1vnop_10", z = "_clear_1vnop_157", o = {
10
+ root: L,
11
+ renderer: T,
12
+ small: j,
13
13
  large: E,
14
14
  clear: z
15
15
  }, P = r.forwardRef(function(f, m) {
16
16
  const {
17
- size: d = "normal",
17
+ size: p = "normal",
18
18
  value: c,
19
- onChange: p,
19
+ onChange: d,
20
20
  onFocus: _,
21
21
  onBlur: h,
22
22
  onSelect: C,
23
23
  onKeyDown: g,
24
24
  className: R,
25
- rendered: w,
26
- placeholder: j,
27
- autoFocus: S,
28
- withClearButton: k = !1
29
- } = f, s = r.useRef(null), t = r.useRef(null), a = i(p), u = i(C), x = r.useCallback((e) => {
25
+ rendered: v,
26
+ placeholder: S,
27
+ autoFocus: k,
28
+ withClearButton: x = !1
29
+ } = f, s = r.useRef(null), n = r.useRef(null), a = i(d), u = i(C), N = r.useCallback((e) => {
30
30
  a.current(e.target.value);
31
- }, []), N = r.useCallback(() => {
31
+ }, []), b = r.useCallback(() => {
32
32
  var e;
33
33
  a.current(""), (e = s.current) == null || e.focus();
34
- }, []), b = r.useCallback((e) => {
34
+ }, []), w = r.useCallback((e) => {
35
35
  if (!u.current || !(e.target instanceof HTMLInputElement))
36
36
  return;
37
37
  const l = e.target;
38
38
  u.current(l.selectionStart, l.selectionEnd, l.selectionDirection);
39
- }, []), v = r.useCallback((e) => {
40
- t.current && (t.current.scrollTop = e.target.scrollTop, t.current.scrollLeft = e.target.scrollLeft);
41
- }, []), y = F(n.root, R, n[d]);
42
- return /* @__PURE__ */ B("div", { ref: m, className: y, children: [
43
- /* @__PURE__ */ o(
39
+ }, []), y = r.useCallback((e) => {
40
+ n.current && (n.current.scrollTop = e.target.scrollTop, n.current.scrollLeft = e.target.scrollLeft);
41
+ }, []), B = I(o.root, R, o[p]);
42
+ return /* @__PURE__ */ D("div", { ref: m, className: B, children: [
43
+ /* @__PURE__ */ t(
44
44
  "input",
45
45
  {
46
46
  ref: s,
47
- autoFocus: S,
47
+ autoFocus: k,
48
48
  type: "text",
49
49
  value: c,
50
- onChange: x,
51
- placeholder: j,
50
+ onChange: N,
51
+ placeholder: S,
52
52
  onBlur: h,
53
53
  onFocus: _,
54
- onScroll: v,
55
- onSelect: b,
54
+ onScroll: y,
55
+ onSelect: w,
56
56
  onKeyDown: g
57
57
  }
58
58
  ),
59
- /* @__PURE__ */ o("div", { ref: t, className: n.renderer, children: w }),
60
- k && c && /* @__PURE__ */ o("div", { className: n.clear, children: /* @__PURE__ */ o(D, { icon: "Close", onClick: N }) })
59
+ /* @__PURE__ */ t("div", { ref: n, className: o.renderer, children: v }),
60
+ x && c && /* @__PURE__ */ t("div", { className: o.clear, children: /* @__PURE__ */ t(F, { icon: "Close", onClick: b }) })
61
61
  ] });
62
62
  });
63
63
  export {
@@ -1,10 +1,18 @@
1
1
  import { default as React } from 'react';
2
- import { DropzoneOptions, FileWithPath as DropzoneFileWithPath } from 'react-dropzone';
2
+ import { DropzoneOptions, FileWithPath as DropzoneFileWithPath, FileError as DropzoneFileError, ErrorCode as DropzoneErrorCode } from 'react-dropzone';
3
3
 
4
4
  export type FileWithPath = DropzoneFileWithPath;
5
+ export type FileError = DropzoneFileError;
6
+ export type ErrorCode = DropzoneErrorCode;
7
+ export interface FileRejection {
8
+ file: FileWithPath;
9
+ errors: FileError[];
10
+ }
5
11
  export interface InputDropzoneProps extends DropzoneOptions {
6
12
  value?: FileWithPath[];
13
+ rejections?: FileRejection[];
7
14
  onRemoveFile?: (file: FileWithPath) => void;
15
+ onRemoveRejection?: (file: FileWithPath) => void;
8
16
  text?: string;
9
17
  linkText?: string;
10
18
  removeItemAriaLabel?: string;