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
|
2
|
-
import { forwardRef as
|
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
|
5
|
-
({ tabs:
|
6
|
-
const [
|
7
|
-
|
8
|
-
|
9
|
-
}, [
|
10
|
-
const d = (s,
|
11
|
-
s.stopPropagation(), s.preventDefault(), r
|
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
|
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:
|
15
|
+
/* @__PURE__ */ n("div", { className: "buttons-bar", children: e.map((s) => /* @__PURE__ */ n(
|
16
16
|
"button",
|
17
17
|
{
|
18
|
-
disabled: s.disabled,
|
19
|
-
onClick: (
|
20
|
-
className: `button ${s.key ===
|
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
|
-
|
28
|
+
h.displayName = "ButtonsArray";
|
29
29
|
export {
|
30
|
-
|
30
|
+
h as ButtonsArray
|
31
31
|
};
|
package/dist/main.d.ts
CHANGED