@conboai/storybook.components 0.5.40 → 0.5.41

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,5 +12,6 @@ export interface ITabsBar {
12
12
  onEdit?: (id: string, value: string) => void;
13
13
  onAdd?: () => void;
14
14
  onClick?: (id: string) => void;
15
+ isDisabled?: boolean;
15
16
  }
16
17
  export declare const TabsBar: FC<ITabsBar>;
@@ -46848,108 +46848,111 @@ const Soe = ({
46848
46848
  minHeight: "6px",
46849
46849
  backgroundColor: e,
46850
46850
  borderRadius: "50%"
46851
- }), Moe = sr(({
46852
- value: e,
46853
- onEdit: t,
46854
- onDelete: n,
46855
- onClick: r,
46856
- showDelete: o,
46857
- color: i = "#ffffff",
46858
- isActive: s = !1
46859
- }) => {
46860
- const [l, c] = Ne(!1), [u, d] = Ne(e || "Untitled");
46861
- Ie(() => {
46862
- d(e);
46863
- }, [e]);
46864
- const h = () => c(!0), f = () => {
46865
- u || d(e || "Untitled"), c(!1);
46866
- }, b = (v) => {
46867
- t == null || t(v.target.value), d(v.target.value);
46868
- }, p = (v) => {
46869
- v.stopPropagation(), n && n();
46870
- }, g = (v) => {
46871
- v.key === "Enter" && c(!1);
46872
- }, m = Loe(i);
46873
- return /* @__PURE__ */ V.jsx(Xo, { title: u, children: /* @__PURE__ */ V.jsxs(
46874
- nn,
46875
- {
46876
- onClick: r,
46877
- container: !0,
46878
- sx: Eoe(s),
46879
- justifyContent: "space-between",
46880
- alignItems: "center",
46881
- flexWrap: "nowrap",
46882
- width: l ? "200px" : "auto",
46883
- maxWidth: "250px",
46884
- minWidth: l ? "120px" : "0",
46885
- gap: "6px",
46886
- children: [
46887
- /* @__PURE__ */ V.jsx(bt, { sx: m }),
46888
- l ? /* @__PURE__ */ V.jsx(
46889
- Ha,
46890
- {
46891
- autoFocus: !0,
46892
- sx: koe,
46893
- value: u,
46894
- variant: "standard",
46895
- onBlur: f,
46896
- onChange: b,
46897
- onKeyUp: g
46898
- }
46899
- ) : /* @__PURE__ */ V.jsx(
46900
- Ot,
46901
- {
46902
- noWrap: !0,
46903
- maxWidth: "100%",
46904
- minHeight: "10px",
46905
- flexGrow: "1",
46906
- textAlign: "center",
46907
- onDoubleClick: h,
46908
- children: u
46909
- }
46910
- ),
46911
- o ? /* @__PURE__ */ V.jsx(
46912
- Ot,
46913
- {
46914
- sx: Toe,
46915
- onClick: p,
46916
- className: "remove-icon",
46917
- children: /* @__PURE__ */ V.jsx(Cn, { icon: "remove", fillOpacity: "0.8", fill: "white" })
46918
- }
46919
- ) : /* @__PURE__ */ V.jsx(bt, { width: "10px", height: "24px" })
46920
- ]
46921
- }
46922
- ) });
46923
- }), ive = ({
46851
+ }), Moe = sr(
46852
+ ({
46853
+ value: e,
46854
+ onEdit: t,
46855
+ onDelete: n,
46856
+ onClick: r,
46857
+ showDelete: o,
46858
+ color: i = "#ffffff",
46859
+ isActive: s = !1
46860
+ }) => {
46861
+ const [l, c] = Ne(!1), [u, d] = Ne(e || "Untitled");
46862
+ Ie(() => {
46863
+ d(e);
46864
+ }, [e]);
46865
+ const h = () => c(!0), f = () => {
46866
+ u || d(e || "Untitled"), c(!1);
46867
+ }, b = (v) => {
46868
+ t == null || t(v.target.value), d(v.target.value);
46869
+ }, p = (v) => {
46870
+ v.stopPropagation(), n && n();
46871
+ }, g = (v) => {
46872
+ v.key === "Enter" && c(!1);
46873
+ }, m = Loe(i);
46874
+ return /* @__PURE__ */ V.jsx(Xo, { title: u, children: /* @__PURE__ */ V.jsxs(
46875
+ nn,
46876
+ {
46877
+ onClick: r,
46878
+ container: !0,
46879
+ sx: Eoe(s),
46880
+ justifyContent: "space-between",
46881
+ alignItems: "center",
46882
+ flexWrap: "nowrap",
46883
+ width: l ? "200px" : "auto",
46884
+ maxWidth: "250px",
46885
+ minWidth: l ? "120px" : "0",
46886
+ gap: "6px",
46887
+ children: [
46888
+ /* @__PURE__ */ V.jsx(bt, { sx: m }),
46889
+ l ? /* @__PURE__ */ V.jsx(
46890
+ Ha,
46891
+ {
46892
+ autoFocus: !0,
46893
+ sx: koe,
46894
+ value: u,
46895
+ variant: "standard",
46896
+ onBlur: f,
46897
+ onChange: b,
46898
+ onKeyUp: g
46899
+ }
46900
+ ) : /* @__PURE__ */ V.jsx(
46901
+ Ot,
46902
+ {
46903
+ noWrap: !0,
46904
+ maxWidth: "100%",
46905
+ minHeight: "10px",
46906
+ flexGrow: "1",
46907
+ textAlign: "center",
46908
+ onDoubleClick: h,
46909
+ children: u
46910
+ }
46911
+ ),
46912
+ o ? /* @__PURE__ */ V.jsx(
46913
+ Ot,
46914
+ {
46915
+ sx: Toe,
46916
+ onClick: p,
46917
+ className: "remove-icon",
46918
+ children: /* @__PURE__ */ V.jsx(Cn, { icon: "remove", fillOpacity: "0.8", fill: "white" })
46919
+ }
46920
+ ) : /* @__PURE__ */ V.jsx(bt, { width: "10px", height: "24px" })
46921
+ ]
46922
+ }
46923
+ ) });
46924
+ }
46925
+ ), ive = ({
46924
46926
  tabs: e = [],
46925
46927
  activeId: t,
46926
46928
  onDelete: n,
46927
46929
  onEdit: r,
46928
46930
  onAdd: o,
46929
- onClick: i
46931
+ onClick: i,
46932
+ isDisabled: s
46930
46933
  }) => {
46931
- const s = () => {
46934
+ const l = () => {
46932
46935
  o && o();
46933
- }, l = (u) => {
46934
- i == null || i(u);
46935
- }, c = () => e.map((u) => /* @__PURE__ */ V.jsx(
46936
+ }, c = (d) => {
46937
+ i == null || i(d);
46938
+ }, u = () => e.map((d) => /* @__PURE__ */ V.jsx(
46936
46939
  Moe,
46937
46940
  {
46938
- onEdit: (d) => {
46939
- r == null || r(u.id, d);
46941
+ onEdit: (h) => {
46942
+ r == null || r(d.id, h);
46940
46943
  },
46941
46944
  onClick: () => {
46942
- l(u.id);
46945
+ c(d.id);
46943
46946
  },
46944
46947
  onDelete: () => {
46945
- n == null || n(u.id);
46948
+ n == null || n(d.id);
46946
46949
  },
46947
- value: u.title,
46948
- color: u.color,
46950
+ value: d.title,
46951
+ color: d.color,
46949
46952
  showDelete: e.length > 1,
46950
- isActive: t === u.id
46953
+ isActive: t === d.id
46951
46954
  },
46952
- u.id
46955
+ d.id
46953
46956
  ));
46954
46957
  return e.length ? /* @__PURE__ */ V.jsx(
46955
46958
  nn,
@@ -46962,8 +46965,17 @@ const Soe = ({
46962
46965
  gridAutoFlow: "column",
46963
46966
  overflow: "hidden",
46964
46967
  children: /* @__PURE__ */ V.jsxs(bt, { display: "flex", flexDirection: "row", gap: "6px", flexWrap: "nowrap", children: [
46965
- c(),
46966
- /* @__PURE__ */ V.jsx(Ir, { onClick: s, variant: "text", sx: { minWidth: "40px" }, children: /* @__PURE__ */ V.jsx(Cn, { icon: "add", fill: "white" }) })
46968
+ u(),
46969
+ /* @__PURE__ */ V.jsx(
46970
+ Ir,
46971
+ {
46972
+ onClick: l,
46973
+ variant: "text",
46974
+ sx: { minWidth: "40px" },
46975
+ disabled: s,
46976
+ children: /* @__PURE__ */ V.jsx(Cn, { icon: "add", fill: "white" })
46977
+ }
46978
+ )
46967
46979
  ] })
46968
46980
  }
46969
46981
  ) : null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conboai/storybook.components",
3
- "version": "0.5.40",
3
+ "version": "0.5.41",
4
4
  "main": "dist/storybook.components.mjs",
5
5
  "types": "dist/build/index.d.ts",
6
6
  "files": [