triafly-ui-kit 1.0.67 → 1.0.69

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
- .buttons .buttons-bar{display:flex}.buttons .buttons-label{margin:0 0 8px;display:flex}.buttons .button{height:44px;padding:0 12px;display:flex;justify-content:center;align-items:center;border:1px solid var(--color-border-primary-default);background-color:var(--color-bg-neutral-basic-default);cursor:pointer}.buttons .button:not(:last-of-type){border-right:0 solid}.buttons .button:first-of-type{border-radius:8px 0 0 8px}.buttons .button:last-of-type{border-radius:0 8px 8px 0}.buttons .button:hover{background:#ddd}.buttons .button.active{background:var(--color-bg-neutral-light-default);font-weight:600}.buttons .button.status-error{color:var(--color-status-error-foreground)}.buttons .button.status-warning{color:var(--color-status-warning-foreground)}.buttons .button.status-success{color:var(--color-status-success-foreground)}
1
+ .buttons .buttons-bar{display:flex}.buttons .buttons-label{margin:0 0 8px;display:flex}.buttons .button{height:44px;padding:0 12px;display:flex;justify-content:center;align-items:center;border:1px solid var(--color-border-primary-default);background-color:var(--color-bg-neutral-basic-default);cursor:pointer}.buttons .button:not(:last-of-type){border-right:0 solid}.buttons .button:first-of-type{border-radius:8px 0 0 8px}.buttons .button:last-of-type{border-radius:0 8px 8px 0}.buttons .button:not(:disabled):hover{background:#ddd}.buttons .button:disabled{cursor:not-allowed;opacity:.6}.buttons .button.active{background:var(--color-bg-neutral-light-default);font-weight:600}.buttons .button.status-error{color:var(--color-status-error-foreground)}.buttons .button.status-warning{color:var(--color-status-warning-foreground)}.buttons .button.status-success{color:var(--color-status-success-foreground)}
@@ -1,23 +1,23 @@
1
- import { jsxs as c, jsx as n } from "react/jsx-runtime";
2
- import { forwardRef as m, useState as f, useEffect as p } from "react";
1
+ import { jsxs as m, jsx as n } from "react/jsx-runtime";
2
+ import { forwardRef as f, useState as p, useEffect as k } from "react";
3
3
  import '../../../assets/src/components/Ui/ButtonsArray/ButtonsArray.css';/* empty css */
4
- const k = m(
5
- ({ tabs: t, label: o, onChange: a, activeKey: e }, i) => {
6
- const [u, r] = f(e ?? t[0].key);
7
- p(() => {
8
- e != null ? r(e) : r(t[0].key);
9
- }, [e]);
10
- const d = (s, l) => {
11
- s.stopPropagation(), s.preventDefault(), r(l), a && a(l);
4
+ const h = f(
5
+ ({ tabs: e, label: o, onChange: a, activeKey: t, isDisabled: i }, u) => {
6
+ const [c, l] = p(t ?? e[0].key);
7
+ k(() => {
8
+ t != null ? l(t) : l(e[0].key);
9
+ }, [t]);
10
+ const d = (s, r) => {
11
+ s.stopPropagation(), s.preventDefault(), l(r), a && a(r);
12
12
  };
13
- return t.length === 0 ? null : /* @__PURE__ */ c("div", { className: "buttons", ref: i, children: [
13
+ return e.length === 0 ? null : /* @__PURE__ */ m("div", { className: "buttons", ref: u, children: [
14
14
  o && /* @__PURE__ */ n("span", { className: "buttons-label", children: o }),
15
- /* @__PURE__ */ n("div", { className: "buttons-bar", children: t.map((s) => /* @__PURE__ */ n(
15
+ /* @__PURE__ */ n("div", { className: "buttons-bar", children: e.map((s) => /* @__PURE__ */ n(
16
16
  "button",
17
17
  {
18
- disabled: s.disabled,
19
- onClick: (l) => d(l, s.key),
20
- className: `button ${s.key === u ? "active" : ""} status-${s.status}`,
18
+ disabled: i || s.disabled,
19
+ onClick: (r) => d(r, s.key),
20
+ className: `button ${s.key === c ? "active" : ""} status-${s.status}`,
21
21
  children: s.label
22
22
  },
23
23
  s.key
@@ -25,7 +25,7 @@ const k = m(
25
25
  ] });
26
26
  }
27
27
  );
28
- k.displayName = "ButtonsArray";
28
+ h.displayName = "ButtonsArray";
29
29
  export {
30
- k as ButtonsArray
30
+ h as ButtonsArray
31
31
  };
package/dist/main.d.ts CHANGED
@@ -81,6 +81,7 @@ export declare interface ButtonsArrayProps {
81
81
  label?: string;
82
82
  onChange?: (key: string | number) => void;
83
83
  activeKey?: string | number | null | undefined;
84
+ isDisabled: boolean;
84
85
  }
85
86
 
86
87
  declare interface ButtonTab {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triafly-ui-kit",
3
- "version": "1.0.67",
3
+ "version": "1.0.69",
4
4
  "description": "UI Kit from Triafly",
5
5
  "main": "./dist/main.js",
6
6
  "module": "./dist/main.js",