triafly-ui-kit 1.0.65 → 1.0.67

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,28 +1,31 @@
1
- import { jsxs as a, jsx as n } from "react/jsx-runtime";
2
- import { useState as d, useEffect as u } from "react";
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";
3
3
  import '../../../assets/src/components/Ui/ButtonsArray/ButtonsArray.css';/* empty css */
4
- const p = ({ tabs: t, label: o, onChange: i, activeKey: e }) => {
5
- const [r, l] = d(e ?? t[0].key);
6
- u(() => {
7
- e != null ? l(e) : l(t[0].key);
8
- }, [e]);
9
- const c = (s) => {
10
- l(s), i && i(s);
11
- };
12
- return /* @__PURE__ */ a("div", { className: "buttons", children: [
13
- o && /* @__PURE__ */ n("span", { className: "buttons-label", children: o }),
14
- /* @__PURE__ */ n("div", { className: "buttons-bar", children: t.map((s) => /* @__PURE__ */ n(
15
- "button",
16
- {
17
- disabled: s.disabled,
18
- onClick: () => c(s.key),
19
- className: `button ${s.key === r ? "active" : ""} status-${s.status}`,
20
- children: s.label
21
- },
22
- s.key
23
- )) })
24
- ] });
25
- };
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);
12
+ };
13
+ return t.length === 0 ? null : /* @__PURE__ */ c("div", { className: "buttons", ref: i, children: [
14
+ o && /* @__PURE__ */ n("span", { className: "buttons-label", children: o }),
15
+ /* @__PURE__ */ n("div", { className: "buttons-bar", children: t.map((s) => /* @__PURE__ */ n(
16
+ "button",
17
+ {
18
+ disabled: s.disabled,
19
+ onClick: (l) => d(l, s.key),
20
+ className: `button ${s.key === u ? "active" : ""} status-${s.status}`,
21
+ children: s.label
22
+ },
23
+ s.key
24
+ )) })
25
+ ] });
26
+ }
27
+ );
28
+ k.displayName = "ButtonsArray";
26
29
  export {
27
- p as ButtonsArray
30
+ k as ButtonsArray
28
31
  };
package/dist/main.d.ts CHANGED
@@ -74,7 +74,7 @@ declare type ButtonProps = {
74
74
  iconTail?: ReactElement;
75
75
  };
76
76
 
77
- export declare const ButtonsArray: React.FC<ButtonsArrayProps>;
77
+ export declare const ButtonsArray: ForwardRefExoticComponent<ButtonsArrayProps & RefAttributes<HTMLDivElement>>;
78
78
 
79
79
  export declare interface ButtonsArrayProps {
80
80
  tabs: ButtonTab[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triafly-ui-kit",
3
- "version": "1.0.65",
3
+ "version": "1.0.67",
4
4
  "description": "UI Kit from Triafly",
5
5
  "main": "./dist/main.js",
6
6
  "module": "./dist/main.js",