@cfx-dev/ui-components 2.1.10 → 2.1.12

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,72 +1,72 @@
1
- import { jsx as r, jsxs as W, Fragment as g } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as g, Fragment as B } from "react/jsx-runtime";
2
2
  import m from "react";
3
- import { Icon as B } from "../Icon/Icon.js";
4
- import { clsx as q } from "../../utils/clsx.js";
3
+ import { Icon as q } from "../Icon/Icon.js";
4
+ import { clsx as I } from "../../utils/clsx.js";
5
5
  import { noop as h } from "../../utils/functional.js";
6
- import '../../assets/Button.css';const I = "_root_1hwl6_1", M = "_fullWidth_1hwl6_35", j = "_primary_1hwl6_55", F = "_secondary_1hwl6_76", R = "_linked_1hwl6_118", v = "_quicklink_1hwl6_143", D = "_icon_1hwl6_150", L = "_icononly_1hwl6_175", U = "_decorator_1hwl6_180", o = {
7
- root: I,
8
- fullWidth: M,
9
- primary: j,
6
+ import '../../assets/Button.css';const M = "_root_1n01a_1", j = "_fullWidth_1n01a_33", w = "_primary_1n01a_53", F = "_secondary_1n01a_74", R = "_linked_1n01a_116", v = "_quicklink_1n01a_141", D = "_icon_1n01a_148", L = "_icononly_1n01a_173", U = "_decorator_1n01a_178", o = {
7
+ root: M,
8
+ fullWidth: j,
9
+ primary: w,
10
10
  secondary: F,
11
- "on-light": "_on-light_1hwl6_97",
11
+ "on-light": "_on-light_1n01a_95",
12
12
  linked: R,
13
13
  quicklink: v,
14
14
  icon: D,
15
15
  icononly: L,
16
16
  decorator: U
17
17
  };
18
- function z(c) {
18
+ function z(a) {
19
19
  const {
20
- text: t = null,
21
- icon: l,
22
- decorator: n = null
23
- } = c;
24
- return /* @__PURE__ */ W(g, { children: [
25
- t,
26
- !!l && /* @__PURE__ */ r(B, { name: l, className: o.icon }),
27
- !!n && /* @__PURE__ */ r("div", { className: o.decorator, children: n })
20
+ text: n = null,
21
+ icon: e,
22
+ decorator: t = null
23
+ } = a;
24
+ return /* @__PURE__ */ g(B, { children: [
25
+ n,
26
+ !!e && /* @__PURE__ */ r(q, { name: e, className: o.icon }),
27
+ !!t && /* @__PURE__ */ r("div", { className: o.decorator, children: t })
28
28
  ] });
29
29
  }
30
- function A(c) {
30
+ function A(a) {
31
31
  const {
32
- text: t = null,
33
- icon: l,
34
- theme: n = "default",
35
- disabled: a = !1,
32
+ text: n = null,
33
+ icon: e,
34
+ theme: t = "default",
35
+ disabled: c = !1,
36
36
  className: u = "",
37
37
  autofocus: d = !1,
38
38
  fullWidth: i = !1,
39
39
  tabIndex: s
40
- } = c;
41
- return q(o.root, o[n], u, {
42
- [o.disabled]: a,
43
- [o.icononly]: !!l && (t === null || typeof t > "u"),
44
- [o.text]: !!t,
40
+ } = a;
41
+ return I(o.root, o[t], u, {
42
+ [o.disabled]: c,
43
+ [o.icononly]: !!e && (n === null || typeof n > "u"),
44
+ [o.text]: !!n,
45
45
  [o.autofocus]: d || typeof s < "u",
46
46
  [o.fullWidth]: i
47
47
  });
48
48
  }
49
- const O = m.forwardRef(function(t, l) {
49
+ const O = m.forwardRef(function(n, e) {
50
50
  const {
51
- text: n = null,
52
- icon: a,
51
+ text: t = null,
52
+ icon: c,
53
53
  title: u = "",
54
54
  type: d = "button",
55
55
  className: i = "",
56
56
  theme: s = "default",
57
- disabled: e = !1,
57
+ disabled: l = !1,
58
58
  onClick: k = h,
59
59
  onMouseDown: p = h,
60
- onMouseUp: w = h,
60
+ onMouseUp: b = h,
61
61
  autofocus: f = !1,
62
62
  tabIndex: _,
63
63
  fullWidth: y = !1,
64
- ariaLabel: b = ""
65
- } = t, x = m.useMemo(() => A({
66
- text: n,
67
- icon: a,
64
+ ariaLabel: x = ""
65
+ } = n, C = m.useMemo(() => A({
66
+ text: t,
67
+ icon: c,
68
68
  theme: s,
69
- disabled: e,
69
+ disabled: l,
70
70
  className: i,
71
71
  autofocus: f,
72
72
  fullWidth: y,
@@ -75,29 +75,29 @@ const O = m.forwardRef(function(t, l) {
75
75
  f,
76
76
  i,
77
77
  y,
78
- e,
79
- a,
78
+ l,
79
+ c,
80
80
  _,
81
- n,
81
+ t,
82
82
  s
83
- ]), C = m.useCallback((N) => {
84
- e || k(N);
85
- }, [e, k]);
83
+ ]), N = m.useCallback((W) => {
84
+ l || k(W);
85
+ }, [l, k]);
86
86
  return /* @__PURE__ */ r(
87
87
  "button",
88
88
  {
89
- ref: l,
90
- disabled: e,
91
- className: x,
92
- onClick: C,
89
+ ref: e,
90
+ disabled: l,
91
+ className: C,
92
+ onClick: N,
93
93
  onMouseDown: p,
94
- onMouseUp: w,
94
+ onMouseUp: b,
95
95
  autoFocus: f,
96
96
  tabIndex: _,
97
97
  title: u,
98
98
  type: d,
99
- "aria-label": b,
100
- children: /* @__PURE__ */ r(z, { ...t })
99
+ "aria-label": x,
100
+ children: /* @__PURE__ */ r(z, { ...n })
101
101
  }
102
102
  );
103
103
  });
@@ -1,35 +1,35 @@
1
1
  import { jsxs as p, jsx as o } from "react/jsx-runtime";
2
- import b from "react";
3
- import { Icon as c } from "../Icon/Icon.js";
4
- import { clsx as h } from "../../utils/clsx.js";
5
- import '../../assets/InfoPanel.css';const k = "_rootUnset_1cbhk_1", u = "_root_1cbhk_1", v = "_interactive_1cbhk_19", y = "_interactiveIcon_1cbhk_22", f = "_icon_1cbhk_70", x = "_content_1cbhk_74", t = {
6
- rootUnset: k,
7
- root: u,
8
- interactive: v,
9
- interactiveIcon: y,
10
- "type-neutral": "_type-neutral_1cbhk_34",
11
- "type-error": "_type-error_1cbhk_41",
12
- "type-success": "_type-success_1cbhk_48",
13
- "type-warning": "_type-warning_1cbhk_55",
14
- "size-small": "_size-small_1cbhk_62",
15
- "size-large": "_size-large_1cbhk_66",
16
- icon: f,
17
- content: x
2
+ import u from "react";
3
+ import { Icon as r } from "../Icon/Icon.js";
4
+ import { clsx as v } from "../../utils/clsx.js";
5
+ import '../../assets/InfoPanel.css';const y = "_rootUnset_5rtl4_1", f = "_root_5rtl4_1", x = "_interactive_5rtl4_19", z = "_interactiveIcon_5rtl4_22", d = "_icon_5rtl4_70", I = "_content_5rtl4_74", t = {
6
+ rootUnset: y,
7
+ root: f,
8
+ interactive: x,
9
+ interactiveIcon: z,
10
+ "type-neutral": "_type-neutral_5rtl4_34",
11
+ "type-error": "_type-error_5rtl4_41",
12
+ "type-success": "_type-success_5rtl4_48",
13
+ "type-warning": "_type-warning_5rtl4_55",
14
+ "size-small": "_size-small_5rtl4_62",
15
+ "size-large": "_size-large_5rtl4_66",
16
+ icon: d,
17
+ content: I
18
18
  };
19
- function z(s) {
19
+ function N(s) {
20
20
  const {
21
- type: r = "neutral",
21
+ type: c = "neutral",
22
22
  size: a = "normal",
23
23
  className: i,
24
24
  onClick: e,
25
- ariaLabel: _,
25
+ ariaLabel: l,
26
26
  icon: n,
27
- children: l
28
- } = s, m = h(
27
+ children: _
28
+ } = s, m = v(
29
29
  t.rootUnset,
30
30
  t.root,
31
31
  i,
32
- t[`type-${r}`],
32
+ t[`type-${c}`],
33
33
  t[`size-${a}`],
34
34
  {
35
35
  [t.interactive]: !!e
@@ -41,16 +41,16 @@ function z(s) {
41
41
  type: e ? "button" : void 0,
42
42
  className: m,
43
43
  onClick: e,
44
- "aria-label": _,
44
+ "aria-label": l,
45
45
  children: [
46
- n && /* @__PURE__ */ o(c, { size: "xxsmall", name: n, className: t.icon }),
47
- /* @__PURE__ */ o("div", { className: t.content, children: l }),
48
- e && /* @__PURE__ */ o(c, { size: "xxsmall", name: "LeftArrow", className: t.interactiveIcon })
46
+ n && /* @__PURE__ */ o(r, { size: "xxsmall", name: n, className: t.icon }),
47
+ /* @__PURE__ */ o("div", { className: t.content, children: _ }),
48
+ e && /* @__PURE__ */ o(r, { size: "xxsmall", name: "LeftArrow", className: t.interactiveIcon })
49
49
  ]
50
50
  }
51
51
  );
52
52
  }
53
- const U = b.memo(z);
53
+ const R = u.memo(N);
54
54
  export {
55
- U as default
55
+ R as default
56
56
  };
@@ -1,26 +1,26 @@
1
- import { jsx as t, jsxs as C } from "react/jsx-runtime";
2
- import l, { useState as k } from "react";
3
- import g from "../Checkbox/Checkbox.js";
4
- import B from "../IconButton/IconButton.js";
5
- import { Text as v } from "../Text/Text.js";
6
- import { clsx as y } from "../../utils/clsx.js";
7
- import '../../assets/Table.css';const $ = "_root_13qg4_1", T = "_radio_13qg4_14", j = "_pointer_13qg4_21", z = "_selectedRow_13qg4_24", A = "_headerContent_13qg4_34", E = "_sortable_13qg4_40", O = "_empty_13qg4_40", S = "_sortButton_13qg4_43", r = {
8
- root: $,
9
- radio: T,
10
- pointer: j,
11
- selectedRow: z,
12
- headerContent: A,
13
- sortable: E,
14
- empty: O,
15
- sortButton: S
1
+ import { jsx as t, jsxs as y } from "react/jsx-runtime";
2
+ import l, { useState as C } from "react";
3
+ import B from "../Checkbox/Checkbox.js";
4
+ import $ from "../IconButton/IconButton.js";
5
+ import { Text as T } from "../Text/Text.js";
6
+ import { clsx as x } from "../../utils/clsx.js";
7
+ import '../../assets/Table.css';const j = "_root_1v0yo_1", z = "_radio_1v0yo_14", A = "_pointer_1v0yo_21", E = "_selectedRow_1v0yo_24", O = "_headerContent_1v0yo_34", S = "_sortable_1v0yo_40", F = "_empty_1v0yo_40", H = "_sortButton_1v0yo_43", r = {
8
+ root: j,
9
+ radio: z,
10
+ pointer: A,
11
+ selectedRow: E,
12
+ headerContent: O,
13
+ sortable: S,
14
+ empty: F,
15
+ sortButton: H
16
16
  };
17
- function F(h) {
17
+ function V(h) {
18
18
  const {
19
19
  item: e,
20
20
  onSortClick: o
21
21
  } = h, s = l.useCallback(() => {
22
22
  o && o(e.sortKey || e.text);
23
- }, [e.sortKey, e.text, o]), b = y(r.headerContent, {
23
+ }, [e.sortKey, e.text, o]), b = x(r.headerContent, {
24
24
  [r.sortable]: e.sortable,
25
25
  [r.empty]: !e.text
26
26
  });
@@ -29,10 +29,10 @@ function F(h) {
29
29
  {
30
30
  className: e.sortable ? r.pointer : void 0,
31
31
  onClick: e.sortable ? s : void 0,
32
- children: /* @__PURE__ */ C("div", { className: b, children: [
33
- /* @__PURE__ */ t(v, { color: "secondary", weight: "bold", uppercase: !0, size: "xxsmall", children: e.text }),
32
+ children: /* @__PURE__ */ y("div", { className: b, children: [
33
+ /* @__PURE__ */ t(T, { color: "secondary", weight: "bold", uppercase: !0, size: "xxsmall", children: e.text }),
34
34
  !!e.sortable && /* @__PURE__ */ t(
35
- B,
35
+ $,
36
36
  {
37
37
  className: r.sortButton,
38
38
  color: "secondary",
@@ -44,7 +44,7 @@ function F(h) {
44
44
  }
45
45
  );
46
46
  }
47
- function H(h) {
47
+ function q(h) {
48
48
  const {
49
49
  index: e,
50
50
  includeRadio: o = !1,
@@ -58,18 +58,18 @@ function H(h) {
58
58
  );
59
59
  }, [a, e]), _ = l.useCallback(() => {
60
60
  a(e);
61
- }, [a, e]), p = y({
61
+ }, [a, e]), p = x({
62
62
  [r.selectedRow]: s === e,
63
63
  [r.pointer]: o
64
64
  });
65
- return /* @__PURE__ */ C(
65
+ return /* @__PURE__ */ y(
66
66
  "tr",
67
67
  {
68
68
  className: p,
69
69
  onClick: o ? _ : void 0,
70
70
  children: [
71
71
  o && /* @__PURE__ */ t("td", { className: r.radio, children: /* @__PURE__ */ t(
72
- g,
72
+ B,
73
73
  {
74
74
  size: "small",
75
75
  onCheckedChange: f,
@@ -86,7 +86,7 @@ function H(h) {
86
86
  `row-${e}`
87
87
  );
88
88
  }
89
- function L({
89
+ function M({
90
90
  headers: h = [],
91
91
  data: e = [],
92
92
  includeRadio: o = !1,
@@ -97,10 +97,10 @@ function L({
97
97
  sortOrder: f = "asc",
98
98
  onSortChange: _
99
99
  }) {
100
- const [p, n] = k(m), [u, d] = k(a), [w, x] = k(f), q = l.useCallback((c) => {
101
- const R = u === c && w === "asc" ? "desc" : "asc";
102
- d(c), x(R), _ == null || _(c, R);
103
- }, [_, u, w]), N = l.useCallback(
100
+ const [p, n] = C(m), [u, d] = C(a), [k, v] = C(f), R = l.useCallback((c) => {
101
+ const w = u === c && k === "asc" ? "desc" : "asc";
102
+ d(c), v(w), _ == null || _(c, w);
103
+ }, [_, u, k]), N = l.useCallback(
104
104
  (c) => {
105
105
  const i = c === p ? null : c;
106
106
  n(i), s == null || s(i);
@@ -112,21 +112,21 @@ function L({
112
112
  }, [m]), l.useEffect(() => {
113
113
  d(a);
114
114
  }, [a]), l.useEffect(() => {
115
- x(f);
116
- }, [f]), /* @__PURE__ */ t("div", { className: r.root, children: /* @__PURE__ */ C("table", { children: [
117
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ C("tr", { children: [
115
+ v(f);
116
+ }, [f]), /* @__PURE__ */ t("div", { className: r.root, children: /* @__PURE__ */ y("table", { children: [
117
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ y("tr", { children: [
118
118
  o && /* @__PURE__ */ t("th", { "aria-label": "Select Row" }),
119
119
  h.map((c, i) => /* @__PURE__ */ t(
120
- F,
120
+ V,
121
121
  {
122
122
  item: c,
123
- onSortClick: q
123
+ onSortClick: R
124
124
  },
125
125
  `header-${i}`
126
126
  ))
127
127
  ] }) }),
128
128
  /* @__PURE__ */ t("tbody", { children: e.map((c, i) => /* @__PURE__ */ t(
129
- H,
129
+ q,
130
130
  {
131
131
  index: i,
132
132
  item: c,
@@ -140,6 +140,6 @@ function L({
140
140
  ] }) });
141
141
  }
142
142
  export {
143
- L as Table,
144
- F as TableHeaderItem
143
+ M as Table,
144
+ V as TableHeaderItem
145
145
  };
@@ -1,62 +1,62 @@
1
1
  import { jsxs as d, jsx as p } from "react/jsx-runtime";
2
- import a from "react";
3
- import { Interactive as x } from "../Interactive/Interactive.js";
2
+ import l from "react";
3
+ import { Interactive as D } from "../Interactive/Interactive.js";
4
4
  import { clsx as _ } from "../../utils/clsx.js";
5
- import '../../assets/ToggleGroup.css';const D = "_root_1ha4w_1", j = "_disabled_1ha4w_7", k = "_descripted_1ha4w_11", E = "_multiline_1ha4w_14", L = "_options_1ha4w_18", O = "_option_1ha4w_18", S = "_description_1ha4w_25", G = "_active_1ha4w_70", e = {
6
- root: D,
7
- disabled: j,
8
- descripted: k,
9
- multiline: E,
10
- options: L,
11
- option: O,
12
- description: S,
5
+ import '../../assets/ToggleGroup.css';const j = "_root_1500i_1", k = "_disabled_1500i_6", E = "_descripted_1500i_10", L = "_multiline_1500i_13", O = "_options_1500i_17", S = "_option_1500i_17", w = "_description_1500i_24", G = "_active_1500i_69", e = {
6
+ root: j,
7
+ disabled: k,
8
+ descripted: E,
9
+ multiline: L,
10
+ options: O,
11
+ option: S,
12
+ description: w,
13
13
  active: G
14
- }, m = (l, i) => {
14
+ }, m = (a, s) => {
15
15
  var o;
16
- return ((o = i.find((t) => t.value === l)) == null ? void 0 : o.description) || "";
17
- }, y = a.memo(function(i) {
16
+ return ((o = s.find((i) => i.value === a)) == null ? void 0 : o.description) || "";
17
+ }, y = l.memo(function(s) {
18
18
  const {
19
19
  value: o,
20
- options: t,
20
+ options: i,
21
21
  onChange: r,
22
22
  className: u = "",
23
- disabled: h = !1,
24
- multiline: v = !1
25
- } = i, [n, c] = a.useState(m(o, t)), f = a.useMemo(
26
- () => t.map((s, N) => {
27
- const b = () => {
28
- r(s.value);
29
- }, C = () => {
30
- c(s.description || "");
23
+ disabled: v = !1,
24
+ multiline: f = !1
25
+ } = s, [n, c] = l.useState(m(o, i)), h = l.useMemo(
26
+ () => i.map((t, b) => {
27
+ const C = () => {
28
+ r(t.value);
31
29
  }, M = () => {
32
- c(m(o, t));
33
- }, g = _(e.option, {
34
- [e.active]: s.value === o
30
+ c(t.description || "");
31
+ }, g = () => {
32
+ c(m(o, i));
33
+ }, x = _(e.option, {
34
+ [e.active]: t.value === o
35
35
  });
36
36
  return /* @__PURE__ */ d(
37
- x,
37
+ D,
38
38
  {
39
- className: g,
40
- tabIndex: N,
41
- onClick: b,
42
- onMouseEnter: C,
43
- onMouseLeave: M,
39
+ className: x,
40
+ tabIndex: b,
41
+ onClick: C,
42
+ onMouseEnter: M,
43
+ onMouseLeave: g,
44
44
  children: [
45
- s.icon || null,
46
- s.label
45
+ t.icon || null,
46
+ t.label
47
47
  ]
48
48
  },
49
- s.value
49
+ t.value
50
50
  );
51
51
  }),
52
- [o, t, r, c]
53
- ), w = _(e.root, u, {
54
- [e.disabled]: h,
52
+ [o, i, r, c]
53
+ ), N = _(e.root, u, {
54
+ [e.disabled]: v,
55
55
  [e.descripted]: n,
56
- [e.multiline]: v
56
+ [e.multiline]: f
57
57
  });
58
- return /* @__PURE__ */ d("div", { className: w, children: [
59
- /* @__PURE__ */ p("div", { className: e.options, children: f }),
58
+ return /* @__PURE__ */ d("div", { className: N, children: [
59
+ /* @__PURE__ */ p("div", { className: e.options, children: h }),
60
60
  n && /* @__PURE__ */ p("div", { className: e.description, children: n })
61
61
  ] });
62
62
  });
@@ -118,9 +118,13 @@ li::marker {
118
118
  .util-z-index-9000 {
119
119
  z-index: ui.zindex('max');
120
120
  }
121
+ .util-text-unselectable,
122
+ .util-text-unselectable * {
123
+ user-select: none !important;
124
+ }
121
125
  .util-text-selectable,
122
126
  .util-text-selectable * {
123
- user-select: text !important;
127
+ user-select: text;
124
128
  }
125
129
  .util-flex-grow {
126
130
  flex-grow: 1;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cfx-dev/ui-components",
3
3
  "private": false,
4
- "version": "2.1.10",
4
+ "version": "2.1.12",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "dist/main.js",