triafly-ui-kit 1.0.16 → 1.0.17
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 .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}
|
1
|
+
.buttons .buttons-bar{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,20 +1,28 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { useState as
|
3
|
-
import '../../../assets/ButtonsArray.css';const
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
2
|
+
import { useState as u } from "react";
|
3
|
+
import '../../../assets/ButtonsArray.css';const p = ({
|
4
|
+
tabs: i,
|
5
|
+
label: a,
|
6
|
+
initialActiveTab: r = 0,
|
7
|
+
onChange: c
|
8
|
+
}) => {
|
9
|
+
const [n, o] = u(r), l = (s, t) => {
|
10
|
+
o(s), c && c(t);
|
11
|
+
};
|
12
|
+
return /* @__PURE__ */ d("div", { className: "buttons", children: [
|
13
|
+
a && /* @__PURE__ */ e("span", { children: a }),
|
14
|
+
/* @__PURE__ */ e("div", { className: "buttons-bar", children: i.map((s, t) => /* @__PURE__ */ e(
|
7
15
|
"button",
|
8
16
|
{
|
9
|
-
|
10
|
-
|
11
|
-
|
17
|
+
disabled: s.disabled,
|
18
|
+
onClick: () => l(t, s.key),
|
19
|
+
className: `button ${t === n ? "active" : ""} status-${s.status}`,
|
20
|
+
children: s.label
|
12
21
|
},
|
13
|
-
|
14
|
-
)) })
|
15
|
-
/* @__PURE__ */ s("div", { className: "buttons-content", children: e[a].content })
|
22
|
+
s.key
|
23
|
+
)) })
|
16
24
|
] });
|
17
25
|
};
|
18
26
|
export {
|
19
|
-
|
27
|
+
p as ButtonsArray
|
20
28
|
};
|
package/dist/main.d.ts
CHANGED
@@ -56,11 +56,6 @@ declare type BreakpointValuesTriafly<T> = {
|
|
56
56
|
|
57
57
|
export declare const Button: default_2.FC<ButtonProps>;
|
58
58
|
|
59
|
-
declare interface Button_2 {
|
60
|
-
label: string;
|
61
|
-
content: React.ReactNode;
|
62
|
-
}
|
63
|
-
|
64
59
|
declare type ButtonProps = {
|
65
60
|
style?: default_2.CSSProperties;
|
66
61
|
label?: string;
|
@@ -79,7 +74,17 @@ declare type ButtonProps = {
|
|
79
74
|
export declare const ButtonsArray: React.FC<ButtonsArrayProps>;
|
80
75
|
|
81
76
|
export declare interface ButtonsArrayProps {
|
82
|
-
|
77
|
+
tabs: ButtonTab[];
|
78
|
+
label?: string;
|
79
|
+
initialActiveTab?: number;
|
80
|
+
onChange?: (status: string | number) => void;
|
81
|
+
}
|
82
|
+
|
83
|
+
declare interface ButtonTab {
|
84
|
+
label: string;
|
85
|
+
status?: StatusType_2;
|
86
|
+
key: string | number;
|
87
|
+
disabled?: boolean;
|
83
88
|
}
|
84
89
|
|
85
90
|
export declare const Checkbox: React.FC<CheckboxProps>;
|
@@ -1048,6 +1053,8 @@ declare type SkeletonProps = {
|
|
1048
1053
|
|
1049
1054
|
declare type StatusType = "default" | "success" | "warning" | "error" | "active" | "blocked" | "done" | "loading" | (string & {});
|
1050
1055
|
|
1056
|
+
declare type StatusType_2 = "none" | "error" | "warning" | "success";
|
1057
|
+
|
1051
1058
|
export declare const Switch: default_2.FC<SwitchProps>;
|
1052
1059
|
|
1053
1060
|
declare type SwitchProps = {
|