@cfx-dev/ui-components 3.0.1 → 3.0.2

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.
@@ -12,7 +12,7 @@ export interface TabularItem {
12
12
  }
13
13
  export interface TabularProps {
14
14
  items: TabularItem[];
15
- activeItem: string;
15
+ activeItem?: string;
16
16
  onActivate?: (id: string) => void;
17
17
  itemClassName?: string;
18
18
  className?: string;
@@ -1,6 +1,8 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import e from "react";
3
- import { Tabular as m } from "./Tabular.js";
1
+ import { jsxs as e, jsx as t } from "react/jsx-runtime";
2
+ import a from "react";
3
+ import { Flex as i } from "../Layout/Flex/Flex.js";
4
+ import { Text as m } from "../Text/Text.js";
5
+ import { Tabular as r } from "./Tabular.js";
4
6
  const l = [
5
7
  {
6
8
  id: "item1",
@@ -30,18 +32,34 @@ const l = [
30
32
  disabled: !0
31
33
  }
32
34
  ];
33
- function o() {
34
- const [i, a] = e.useState("item1");
35
- return /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
36
- m,
37
- {
38
- items: l,
39
- activeItem: i,
40
- onActivate: a
41
- }
42
- ) });
35
+ function d() {
36
+ const [o, c] = a.useState("item1"), [n, s] = a.useState(void 0);
37
+ return /* @__PURE__ */ e(i, { gap: "large", vertical: !0, children: [
38
+ /* @__PURE__ */ e(i, { gap: "normal", vertical: !0, children: [
39
+ /* @__PURE__ */ t(m, { children: "With default activeItem" }),
40
+ /* @__PURE__ */ t(
41
+ r,
42
+ {
43
+ items: l,
44
+ activeItem: o,
45
+ onActivate: c
46
+ }
47
+ )
48
+ ] }),
49
+ /* @__PURE__ */ e(i, { gap: "normal", vertical: !0, children: [
50
+ /* @__PURE__ */ t(m, { children: "Without activeItem" }),
51
+ /* @__PURE__ */ t(
52
+ r,
53
+ {
54
+ items: l,
55
+ activeItem: n,
56
+ onActivate: s
57
+ }
58
+ )
59
+ ] })
60
+ ] });
43
61
  }
44
- const d = e.memo(o);
62
+ const b = a.memo(d);
45
63
  export {
46
- d as default
64
+ b as default
47
65
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cfx-dev/ui-components",
3
3
  "private": false,
4
- "version": "3.0.1",
4
+ "version": "3.0.2",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "dist/main.js",