@cfx-dev/ui-components 1.0.2 → 1.1.1

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 (59) hide show
  1. package/README.md +38 -38
  2. package/dist/Button.module-Cv-7p0xt.js +16 -0
  3. package/dist/assets/Button.css +1 -1
  4. package/dist/assets/Flex.css +1 -1
  5. package/dist/assets/Flyout.css +1 -1
  6. package/dist/assets/Input.css +1 -1
  7. package/dist/assets/Island.css +1 -1
  8. package/dist/assets/Pad.css +1 -1
  9. package/dist/assets/Popover.css +1 -1
  10. package/dist/assets/RichInput.css +1 -1
  11. package/dist/assets/Spacer.css +1 -1
  12. package/dist/assets/Textarea.css +1 -1
  13. package/dist/assets/global.css +1 -1
  14. package/dist/components/Button/Button.d.ts +1 -1
  15. package/dist/components/Button/Button.js +1 -1
  16. package/dist/components/Button/ButtonBar.js +1 -1
  17. package/dist/components/Flyout/Flyout.js +39 -39
  18. package/dist/components/Input/Input.d.ts +0 -1
  19. package/dist/components/Input/Input.js +58 -61
  20. package/dist/components/Input/RichInput.js +27 -27
  21. package/dist/components/InputDropzone/InputDropzone.js +122 -119
  22. package/dist/components/InputDropzone/ItemPreview.js +1 -1
  23. package/dist/components/Island/Island.js +23 -23
  24. package/dist/components/Layout/Flex/Flex.d.ts +1 -1
  25. package/dist/components/Layout/Flex/Flex.js +44 -43
  26. package/dist/components/Layout/Pad/Pad.d.ts +1 -1
  27. package/dist/components/Layout/Pad/Pad.js +30 -29
  28. package/dist/components/Modal/Modal.d.ts +2 -0
  29. package/dist/components/Modal/Modal.js +25 -23
  30. package/dist/components/Overlay/Overlay.js +13 -13
  31. package/dist/components/Popover/Popover.js +18 -18
  32. package/dist/components/Select/Select.d.ts +1 -1
  33. package/dist/components/Select/Select.js +239 -229
  34. package/dist/components/Spacer/Spacer.d.ts +1 -1
  35. package/dist/components/Spacer/Spacer.js +13 -12
  36. package/dist/components/Table/Table.js +41 -35
  37. package/dist/components/Text/Text.types.d.ts +1 -1
  38. package/dist/components/Textarea/Textarea.d.ts +0 -1
  39. package/dist/components/Textarea/Textarea.js +37 -40
  40. package/dist/iconBase-Bipuk9tK.js +112 -0
  41. package/dist/main.d.ts +1 -1
  42. package/dist/main.js +112 -113
  43. package/dist/style-guide/Icons/IconDisplayGrid.js +3 -3
  44. package/dist/style-guide/Icons/Icons.d.ts +13 -13
  45. package/dist/style-guide/Icons/Icons.js +36 -8
  46. package/dist/styles-scss/_ui.scss +167 -195
  47. package/dist/styles-scss/assets/images/checkered_dark.svg +7 -7
  48. package/dist/styles-scss/assets/images/checkered_light.svg +7 -7
  49. package/dist/styles-scss/global.scss +73 -75
  50. package/dist/styles-scss/theme_dark.scss +24 -24
  51. package/dist/styles-scss/theme_light.scss +54 -54
  52. package/dist/styles-scss/themes.scss +2 -2
  53. package/dist/styles-scss/tokens.scss +272 -274
  54. package/dist/utils/string.d.ts +16 -1
  55. package/dist/utils/string.js +46 -39
  56. package/package.json +71 -72
  57. package/dist/Button.module-Z6njvP9Z.js +0 -17
  58. package/dist/Icons-NE1cibCU.js +0 -107
  59. package/dist/index.esm-BkynlSN6.js +0 -72
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
 
3
- export type ButtonTheme = 'default' | 'default-blurred' | 'primary' | 'transparent';
3
+ export type ButtonTheme = 'default' | 'primary' | 'transparent';
4
4
  export type ButtonSize = 'normal' | 'small' | 'large';
5
5
  export interface ButtonProps {
6
6
  text?: React.ReactNode;
@@ -2,7 +2,7 @@ import { jsx as c, jsxs as j, Fragment as w } from "react/jsx-runtime";
2
2
  import b from "react";
3
3
  import { clsx as z } from "../../utils/clsx.js";
4
4
  import { noop as p } from "../../utils/functional.js";
5
- import { s as t } from "../../Button.module-Z6njvP9Z.js";
5
+ import { s as t } from "../../Button.module-Cv-7p0xt.js";
6
6
  function F(a) {
7
7
  const {
8
8
  text: e = null,
@@ -1,6 +1,6 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
2
  import { clsx as s } from "../../utils/clsx.js";
3
- import { s as a } from "../../Button.module-Z6njvP9Z.js";
3
+ import { s as a } from "../../Button.module-Cv-7p0xt.js";
4
4
  function e(r) {
5
5
  const {
6
6
  children: o,
@@ -1,57 +1,57 @@
1
- import { jsxs as i, jsx as s } from "react/jsx-runtime";
1
+ import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
2
  import _ from "react";
3
- import { F as p } from "../../Combination-Dp_plIQU.js";
4
- import { Button as h } from "../Button/Button.js";
3
+ import { F as h } from "../../Combination-Dp_plIQU.js";
4
+ import { Button as y } from "../Button/Button.js";
5
5
  import { Interactive as f } from "../Interactive/Interactive.js";
6
- import { I as u } from "../../Icons-NE1cibCU.js";
6
+ import { Icons as u } from "../../style-guide/Icons/Icons.js";
7
7
  import { clsx as l } from "../../utils/clsx.js";
8
- import { noop as v } from "../../utils/functional.js";
9
- import { useOutlet as b, useKeyboardClose as z } from "../../utils/hooks.js";
10
- import '../../assets/Flyout.css';const N = "_root_11ks7_1", C = "_holder_11ks7_6", y = "_active_11ks7_15", F = "_backdrop_11ks7_15", x = "_mask_11ks7_28", I = "_content_11ks7_90", L = "_header_11ks7_95", O = "_title_11ks7_101", e = {
11
- root: N,
12
- "size-normal": "_size-normal_11ks7_6",
13
- holder: C,
14
- "size-small": "_size-small_11ks7_9",
15
- "size-xsmall": "_size-xsmall_11ks7_12",
16
- active: y,
17
- backdrop: F,
18
- "backdrop-appearance": "_backdrop-appearance_11ks7_1",
19
- mask: x,
20
- "holder-appearance": "_holder-appearance_11ks7_1",
21
- content: I,
22
- header: L,
8
+ import { noop as x } from "../../utils/functional.js";
9
+ import { useOutlet as k, useKeyboardClose as v } from "../../utils/hooks.js";
10
+ import '../../assets/Flyout.css';const b = "_root_xny34_1", z = "_holder_xny34_6", N = "_active_xny34_15", C = "_backdrop_xny34_15", F = "_mask_xny34_28", L = "_content_xny34_83", I = "_header_xny34_88", O = "_title_xny34_94", e = {
11
+ root: b,
12
+ "size-normal": "_size-normal_xny34_6",
13
+ holder: z,
14
+ "size-small": "_size-small_xny34_9",
15
+ "size-xsmall": "_size-xsmall_xny34_12",
16
+ active: N,
17
+ backdrop: C,
18
+ "backdrop-appearance": "_backdrop-appearance_xny34_1",
19
+ mask: F,
20
+ "holder-appearance": "_holder-appearance_xny34_1",
21
+ content: L,
22
+ header: I,
23
23
  title: O
24
24
  }, E = "flyout-outlet";
25
25
  function T(c) {
26
26
  const {
27
- disabled: o = !1,
28
- size: a = "normal",
29
- onClose: r = v,
30
- children: n,
27
+ disabled: t = !1,
28
+ size: n = "normal",
29
+ onClose: r = x,
30
+ children: a,
31
31
  holderClassName: d
32
- } = c, m = b(E);
32
+ } = c, m = k(E);
33
33
  _.useEffect(() => {
34
- if (o)
34
+ if (t)
35
35
  return;
36
- const t = document.getElementById("cfxui-root");
37
- return t == null || t.classList.add("shrink"), () => t == null ? void 0 : t.classList.remove("shrink");
38
- }, [o]), z(r);
39
- const k = l(e.root, e[`size-${a}`], {
40
- [e.active]: !o
36
+ const s = document.getElementById("cfxui-root");
37
+ return s == null || s.classList.add("shrink"), () => s == null ? void 0 : s.classList.remove("shrink");
38
+ }, [t]), v(r);
39
+ const p = l(e.root, e[`size-${n}`], {
40
+ [e.active]: !t
41
41
  });
42
- return /* @__PURE__ */ s(m, { children: /* @__PURE__ */ i("div", { className: k, children: [
43
- /* @__PURE__ */ s(f, { showPointer: !1, className: e.backdrop, onClick: r }),
44
- /* @__PURE__ */ s("div", { className: e.mask, children: /* @__PURE__ */ s("div", { className: l(e.holder, d), children: /* @__PURE__ */ s(p, { disabled: !!o, className: e.content, children: n }) }) })
42
+ return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ i("div", { className: p, children: [
43
+ /* @__PURE__ */ o(f, { showPointer: !1, className: e.backdrop, onClick: r }),
44
+ /* @__PURE__ */ o("div", { className: e.mask, children: /* @__PURE__ */ o("div", { className: l(e.holder, d), children: /* @__PURE__ */ o(h, { disabled: !!t, className: e.content, children: a }) }) })
45
45
  ] }) });
46
46
  }
47
- T.Header = _.forwardRef(function(o, a) {
47
+ T.Header = _.forwardRef(function(t, n) {
48
48
  const {
49
49
  onClose: r,
50
- children: n
51
- } = o;
52
- return /* @__PURE__ */ i("div", { ref: a, className: e.header, children: [
53
- /* @__PURE__ */ s("div", { className: e.title, children: n }),
54
- !!r && /* @__PURE__ */ s(h, { size: "large", icon: u.exit, onClick: r })
50
+ children: a
51
+ } = t;
52
+ return /* @__PURE__ */ i("div", { ref: n, className: e.header, children: [
53
+ /* @__PURE__ */ o("div", { className: e.title, children: a }),
54
+ !!r && /* @__PURE__ */ o(y, { size: "large", icon: u.exit, onClick: r })
55
55
  ] });
56
56
  });
57
57
  export {
@@ -20,7 +20,6 @@ export type InputProps = TypeSpecific & {
20
20
  autofocus?: boolean;
21
21
  pattern?: RegExp;
22
22
  className?: string;
23
- backdropBlur?: boolean;
24
23
  inputClassName?: string;
25
24
  inputRef?: React.Ref<HTMLInputElement>;
26
25
  label?: React.ReactNode;
@@ -1,96 +1,93 @@
1
- import { jsxs as r, jsx as c } from "react/jsx-runtime";
2
- import n from "react";
1
+ import { jsxs as n, jsx as c } from "react/jsx-runtime";
2
+ import r from "react";
3
3
  import { Indicator as q } from "../Indicator/Indicator.js";
4
- import { clsx as H } from "../../utils/clsx.js";
5
- import { getValue as J } from "../../utils/getValue.js";
4
+ import { clsx as B } from "../../utils/clsx.js";
5
+ import { getValue as H } from "../../utils/getValue.js";
6
6
  import { useDynamicRef as i } from "../../utils/hooks.js";
7
- import '../../assets/Input.css';const O = "_root_gmtev_1", P = "_input_gmtev_1", Q = "_small_gmtev_8", U = "_large_gmtev_12", Y = "_decorator_gmtev_60", Z = "_error_gmtev_68", $ = "_disabled_gmtev_72", ee = "_description_gmtev_106", e = {
8
- root: O,
9
- input: P,
10
- small: Q,
11
- large: U,
12
- "full-width": "_full-width_gmtev_57",
13
- decorator: Y,
14
- error: Z,
15
- disabled: $,
16
- description: ee,
17
- "backdrop-blur": "_backdrop-blur_gmtev_111"
18
- }, ce = n.forwardRef(function(t, g) {
7
+ import '../../assets/Input.css';const J = "_root_1eaux_1", O = "_input_1eaux_1", P = "_small_1eaux_8", Q = "_large_1eaux_12", U = "_decorator_1eaux_60", Y = "_error_1eaux_68", Z = "_disabled_1eaux_72", $ = "_description_1eaux_106", e = {
8
+ root: J,
9
+ input: O,
10
+ small: P,
11
+ large: Q,
12
+ "full-width": "_full-width_1eaux_57",
13
+ decorator: U,
14
+ error: Y,
15
+ disabled: Z,
16
+ description: $
17
+ }, le = r.forwardRef(function(o, N) {
19
18
  const {
20
- label: d,
21
- value: v,
22
- onChange: N,
23
- onSubmit: C,
24
- onKeyDown: k = () => !1,
19
+ label: u,
20
+ value: b,
21
+ onChange: C,
22
+ onSubmit: g,
23
+ onKeyDown: w = () => !1,
25
24
  pattern: a,
26
- tabIndex: w,
27
- error: y = !1,
28
- fullWidth: I = !1,
29
- showLoader: u = !1,
30
- noSpellCheck: R = !1,
31
- autofocus: x = !1,
25
+ tabIndex: y,
26
+ error: I = !1,
27
+ fullWidth: R = !1,
28
+ showLoader: d = !1,
29
+ noSpellCheck: v = !1,
30
+ autofocus: E = !1,
32
31
  disabled: m = !1,
33
- className: E = "",
32
+ className: k = "",
34
33
  placeholder: D = "",
35
34
  inputClassName: S = "",
36
35
  inputRef: F,
37
36
  description: _ = "",
38
37
  type: K = "text",
39
38
  size: A = "normal",
40
- decorator: l,
41
- backdropBlur: j = !1
42
- } = t, G = t.type === "number" && (t.min ?? Number.MIN_SAFE_INTEGER) || void 0, M = t.type === "number" && (t.max ?? Number.MAX_SAFE_INTEGER) || void 0, f = n.useId(), p = i(N), T = i(k), b = i(C), V = n.useCallback(
43
- (o) => {
39
+ decorator: s
40
+ } = o, j = o.type === "number" && (o.min ?? Number.MIN_SAFE_INTEGER) || void 0, G = o.type === "number" && (o.max ?? Number.MAX_SAFE_INTEGER) || void 0, f = r.useId(), p = i(C), M = i(w), h = i(g), T = r.useCallback(
41
+ (t) => {
44
42
  const {
45
- value: s
46
- } = o.target;
43
+ value: l
44
+ } = t.target;
47
45
  if (a) {
48
- a.test(s) && p.current(s);
46
+ a.test(l) && p.current(l);
49
47
  return;
50
48
  }
51
- return p.current(s);
49
+ return p.current(l);
52
50
  },
53
51
  [a]
54
- ), z = n.useCallback((o) => {
55
- T.current(o) || b.current && o.key === "Enter" && b.current();
56
- }, []), B = u || l ? /* @__PURE__ */ r("div", { className: e.decorator, children: [
57
- !!u && /* @__PURE__ */ c(q, {}),
58
- !!l && J(l)
59
- ] }) : null, h = /* @__PURE__ */ r("div", { className: e.input, children: [
52
+ ), V = r.useCallback((t) => {
53
+ M.current(t) || h.current && t.key === "Enter" && h.current();
54
+ }, []), z = d || s ? /* @__PURE__ */ n("div", { className: e.decorator, children: [
55
+ !!d && /* @__PURE__ */ c(q, {}),
56
+ !!s && H(s)
57
+ ] }) : null, x = /* @__PURE__ */ n("div", { className: e.input, children: [
60
58
  /* @__PURE__ */ c(
61
59
  "input",
62
60
  {
63
61
  id: f,
64
62
  ref: F,
65
63
  type: K,
66
- tabIndex: w,
67
- autoFocus: x,
64
+ tabIndex: y,
65
+ autoFocus: E,
68
66
  className: S,
69
- value: v,
67
+ value: b,
70
68
  placeholder: D,
71
69
  disabled: m,
72
- onChange: V,
73
- onKeyDown: z,
74
- spellCheck: !R,
75
- min: G,
76
- max: M
70
+ onChange: T,
71
+ onKeyDown: V,
72
+ spellCheck: !v,
73
+ min: j,
74
+ max: G
77
75
  }
78
76
  ),
79
- B
80
- ] }), L = _ ? /* @__PURE__ */ c("div", { className: e.description, children: _ }) : null, W = d ? /* @__PURE__ */ r("label", { htmlFor: f, children: [
81
- d,
82
- h
83
- ] }) : h, X = H(e.root, e[A], E, {
84
- [e["full-width"]]: I,
85
- [e.error]: y,
86
- [e.disabled]: m,
87
- [e["backdrop-blur"]]: j
77
+ z
78
+ ] }), L = _ ? /* @__PURE__ */ c("div", { className: e.description, children: _ }) : null, W = u ? /* @__PURE__ */ n("label", { htmlFor: f, children: [
79
+ u,
80
+ x
81
+ ] }) : x, X = B(e.root, e[A], k, {
82
+ [e["full-width"]]: R,
83
+ [e.error]: I,
84
+ [e.disabled]: m
88
85
  });
89
- return /* @__PURE__ */ r("div", { ref: g, className: X, children: [
86
+ return /* @__PURE__ */ n("div", { ref: N, className: X, children: [
90
87
  W,
91
88
  L
92
89
  ] });
93
90
  });
94
91
  export {
95
- ce as Input
92
+ le as Input
96
93
  };
@@ -1,16 +1,16 @@
1
- import { jsxs as B, jsx as o } from "react/jsx-runtime";
2
- import r from "react";
3
- import { Button as D } from "../Button/Button.js";
4
- import { I as F } from "../../Icons-NE1cibCU.js";
5
- import { clsx as L } from "../../utils/clsx.js";
1
+ import { jsxs as y, jsx as t } from "react/jsx-runtime";
2
+ import n from "react";
3
+ import { Button as B } from "../Button/Button.js";
4
+ import { Icons as D } from "../../style-guide/Icons/Icons.js";
5
+ import { clsx as F } from "../../utils/clsx.js";
6
6
  import { useDynamicRef as i } from "../../utils/hooks.js";
7
- import '../../assets/RichInput.css';const T = "_root_16on4_1", j = "_renderer_16on4_1", z = "_small_16on4_8", E = "_large_16on4_13", H = "_clear_16on4_95", t = {
8
- root: T,
9
- renderer: j,
7
+ import '../../assets/RichInput.css';const L = "_root_1n2jn_1", T = "_renderer_1n2jn_1", z = "_small_1n2jn_8", E = "_large_1n2jn_13", H = "_clear_1n2jn_88", o = {
8
+ root: L,
9
+ renderer: T,
10
10
  small: z,
11
11
  large: E,
12
12
  clear: H
13
- }, O = r.forwardRef(function(f, m) {
13
+ }, O = n.forwardRef(function(f, m) {
14
14
  const {
15
15
  size: d = "normal",
16
16
  value: c,
@@ -20,42 +20,42 @@ import '../../assets/RichInput.css';const T = "_root_16on4_1", j = "_renderer_16
20
20
  onSelect: g,
21
21
  onKeyDown: C,
22
22
  className: R,
23
- rendered: S,
24
- placeholder: x,
25
- autoFocus: k,
26
- withClearButton: I = !1
27
- } = f, s = r.useRef(null), n = r.useRef(null), a = i(p), u = i(g), N = r.useCallback((e) => {
23
+ rendered: j,
24
+ placeholder: S,
25
+ autoFocus: x,
26
+ withClearButton: k = !1
27
+ } = f, s = n.useRef(null), r = n.useRef(null), a = i(p), u = i(g), N = n.useCallback((e) => {
28
28
  a.current(e.target.value);
29
- }, []), b = r.useCallback(() => {
29
+ }, []), b = n.useCallback(() => {
30
30
  var e;
31
31
  a.current(""), (e = s.current) == null || e.focus();
32
- }, []), v = r.useCallback((e) => {
32
+ }, []), I = n.useCallback((e) => {
33
33
  if (!u.current || !(e.target instanceof HTMLInputElement))
34
34
  return;
35
35
  const l = e.target;
36
36
  u.current(l.selectionStart, l.selectionEnd, l.selectionDirection);
37
- }, []), w = r.useCallback((e) => {
38
- n.current && (n.current.scrollTop = e.target.scrollTop, n.current.scrollLeft = e.target.scrollLeft);
39
- }, []), y = L(t.root, R, t[d]);
40
- return /* @__PURE__ */ B("div", { ref: m, className: y, children: [
41
- /* @__PURE__ */ o(
37
+ }, []), v = n.useCallback((e) => {
38
+ r.current && (r.current.scrollTop = e.target.scrollTop, r.current.scrollLeft = e.target.scrollLeft);
39
+ }, []), w = F(o.root, R, o[d]);
40
+ return /* @__PURE__ */ y("div", { ref: m, className: w, children: [
41
+ /* @__PURE__ */ t(
42
42
  "input",
43
43
  {
44
44
  ref: s,
45
- autoFocus: k,
45
+ autoFocus: x,
46
46
  type: "text",
47
47
  value: c,
48
48
  onChange: N,
49
- placeholder: x,
49
+ placeholder: S,
50
50
  onBlur: h,
51
51
  onFocus: _,
52
- onScroll: w,
53
- onSelect: v,
52
+ onScroll: v,
53
+ onSelect: I,
54
54
  onKeyDown: C
55
55
  }
56
56
  ),
57
- /* @__PURE__ */ o("div", { ref: n, className: t.renderer, children: S }),
58
- I && c && /* @__PURE__ */ o("div", { className: t.clear, children: /* @__PURE__ */ o(D, { size: "small", icon: F.exit, onClick: b }) })
57
+ /* @__PURE__ */ t("div", { ref: r, className: o.renderer, children: j }),
58
+ k && c && /* @__PURE__ */ t("div", { className: o.clear, children: /* @__PURE__ */ t(B, { size: "small", icon: D.exit, onClick: b }) })
59
59
  ] });
60
60
  });
61
61
  export {