@cfx-dev/ui-components 2.1.11 → 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 +1 @@
1
- ._root_13qg4_1 table{width:100%;border-collapse:collapse;border-radius:var(--border-radius-small);overflow:hidden}._root_13qg4_1 th,._root_13qg4_1 td{text-align:left;padding:calc(var(--quant) * 1.5) calc(var(--quant) * .75);color:#fff;height:calc(var(--quant) * 8.75);box-sizing:border-box}._root_13qg4_1 ._radio_13qg4_14{text-align:center;min-width:calc(var(--quant) * 8.75)}._root_13qg4_1 ._radio_13qg4_14 button{display:inline-flex}._root_13qg4_1 ._pointer_13qg4_21{cursor:pointer}._root_13qg4_1 ._selectedRow_13qg4_24{background-color:rgba(var(--color-secondary),.4);box-shadow:0 -1px rgba(var(--color-primary),1) inset}._root_13qg4_1 th{position:sticky;top:0;z-index:0;background-color:rgba(var(--color-bg-light),1)}._root_13qg4_1 th ._headerContent_13qg4_34{display:flex;align-items:center;flex-direction:row;justify-content:space-between}._root_13qg4_1 th ._headerContent_13qg4_34._sortable_13qg4_40._empty_13qg4_40{justify-content:flex-end}._root_13qg4_1 th ._sortButton_13qg4_43{opacity:.5;padding:calc(var(--quant) * 2)}._root_13qg4_1 th:hover ._sortButton_13qg4_43{opacity:1}._root_13qg4_1 tr{box-shadow:0 -1px rgba(var(--color-bg-light),1) inset;box-sizing:border-box}._root_13qg4_1 tr:hover{background-color:rgba(var(--color-secondary),.2)}._root_13qg4_1 tr:hover:not(._selectedRow_13qg4_24){box-shadow:none}._root_13qg4_1 tr:last-child{border-bottom-left-radius:var(--border-radius-small);border-bottom-right-radius:var(--border-radius-small)}
1
+ ._root_1v0yo_1 table{width:100%;border-collapse:collapse;border-radius:var(--border-radius-small);overflow:hidden}._root_1v0yo_1 th,._root_1v0yo_1 td{text-align:left;padding:calc(var(--quant) * 1.5) calc(var(--quant) * .75);color:#fff;height:calc(var(--quant) * 8.75);box-sizing:border-box}._root_1v0yo_1 ._radio_1v0yo_14{text-align:center;padding:calc(var(--quant) * .25)}._root_1v0yo_1 ._radio_1v0yo_14 button{display:inline-flex}._root_1v0yo_1 ._pointer_1v0yo_21{cursor:pointer}._root_1v0yo_1 ._selectedRow_1v0yo_24{background-color:rgba(var(--color-secondary),.4);box-shadow:0 -1px rgba(var(--color-primary),1) inset}._root_1v0yo_1 th{position:sticky;top:0;z-index:0;background-color:rgba(var(--color-bg-light),1)}._root_1v0yo_1 th ._headerContent_1v0yo_34{display:flex;align-items:center;flex-direction:row;justify-content:space-between}._root_1v0yo_1 th ._headerContent_1v0yo_34._sortable_1v0yo_40._empty_1v0yo_40{justify-content:flex-end}._root_1v0yo_1 th ._sortButton_1v0yo_43{opacity:.5;padding:calc(var(--quant) * 2)}._root_1v0yo_1 th:hover ._sortButton_1v0yo_43{opacity:1}._root_1v0yo_1 tr{box-shadow:0 -1px rgba(var(--color-bg-light),1) inset;box-sizing:border-box}._root_1v0yo_1 tr:hover{background-color:rgba(var(--color-secondary),.2)}._root_1v0yo_1 tr:hover:not(._selectedRow_1v0yo_24){box-shadow:none}._root_1v0yo_1 tr:last-child{border-bottom-left-radius:var(--border-radius-small);border-bottom-right-radius:var(--border-radius-small)}
@@ -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
  };
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.11",
4
+ "version": "2.1.12",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "dist/main.js",