@hybridcore/ui 1.5.28 → 1.5.29

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,33 +1,36 @@
1
- import { jsxs as f, jsx as i } from "react/jsx-runtime";
2
- import u from "react";
3
- import { Badge as s, Tab as T } from "@mui/material";
4
- import P from "./tab-panel.js";
5
- import b from "./appleTabs.style.js";
6
- import { TabsRoot as v } from "./styled.js";
7
- import { T as C } from "../../Tabs-DqdkJU6b.js";
8
- function d(n) {
1
+ import { jsxs as P, jsx as n } from "react/jsx-runtime";
2
+ import T from "react";
3
+ import { Badge as b, Tab as v } from "@mui/material";
4
+ import w from "./tab-panel.js";
5
+ import d from "./appleTabs.style.js";
6
+ import { TabsRoot as C } from "./styled.js";
7
+ import { T as S } from "../../Tabs-DqdkJU6b.js";
8
+ function g(t) {
9
9
  return {
10
- id: `simple-tab-${n}`,
11
- "aria-controls": `simple-tabpanel-${n}`
10
+ id: `simple-tab-${t}`,
11
+ "aria-controls": `simple-tabpanel-${t}`
12
12
  };
13
13
  }
14
14
  const A = ({
15
- defaultActive: n = 0,
16
- tabContents: r,
15
+ id: t = "tab",
16
+ defaultActive: s = 0,
17
+ tabContents: i,
17
18
  styleVariant: p,
18
- tabPanelStyle: h,
19
- onChange: t,
19
+ tabPanelStyle: m,
20
+ onChange: r,
20
21
  ...l
21
22
  }) => {
22
- const [g, m] = u.useState(n), e = t !== void 0 ? n : g, c = (o, a) => {
23
- m(a), t && t(a);
23
+ const e = new URLSearchParams(window.location.hash.substring(1)), [f, u] = T.useState(
24
+ Number(e.get(t)) ?? s
25
+ ), c = r !== void 0 ? s : f, h = (o, a) => {
26
+ u(a), r && r(a), e.set(t, a), window.location.hash = `#${e.toString()}`;
24
27
  };
25
- return /* @__PURE__ */ f(v, { children: [
26
- p === "APPLE" ? /* @__PURE__ */ i(b.Tabs, { value: e, onChange: c, ...l, children: r.map((o, a) => /* @__PURE__ */ i(
27
- b.Item,
28
+ return /* @__PURE__ */ P(C, { children: [
29
+ p === "APPLE" ? /* @__PURE__ */ n(d.Tabs, { value: c, onChange: h, ...l, children: i.map((o, a) => /* @__PURE__ */ n(
30
+ d.Item,
28
31
  {
29
- label: /* @__PURE__ */ i(
30
- s,
32
+ label: /* @__PURE__ */ n(
33
+ b,
31
34
  {
32
35
  badgeContent: o.badgeContent,
33
36
  color: o.badgeColor ?? "primary",
@@ -45,14 +48,14 @@ const A = ({
45
48
  ),
46
49
  icon: o.icon,
47
50
  iconPosition: o.iconPosition,
48
- ...d(a)
51
+ ...g(a)
49
52
  },
50
53
  a
51
- )) }) : /* @__PURE__ */ i(C, { value: e, onChange: c, ...l, children: r.map((o, a) => /* @__PURE__ */ i(
52
- T,
54
+ )) }) : /* @__PURE__ */ n(S, { value: c, onChange: h, ...l, children: i.map((o, a) => /* @__PURE__ */ n(
55
+ v,
53
56
  {
54
- label: /* @__PURE__ */ i(
55
- s,
57
+ label: /* @__PURE__ */ n(
58
+ b,
56
59
  {
57
60
  badgeContent: o.badgeContent,
58
61
  color: o.badgeColor ?? "primary",
@@ -70,18 +73,18 @@ const A = ({
70
73
  ),
71
74
  icon: o.icon,
72
75
  iconPosition: o.iconPosition,
73
- ...d(a)
76
+ ...g(a)
74
77
  },
75
78
  a
76
79
  )) }),
77
- r.map((o, a) => {
80
+ i.map((o, a) => {
78
81
  if (o.content)
79
- return /* @__PURE__ */ i(
80
- P,
82
+ return /* @__PURE__ */ n(
83
+ w,
81
84
  {
82
- value: e,
85
+ value: c,
83
86
  index: a,
84
- style: h,
87
+ style: m,
85
88
  children: o.content
86
89
  },
87
90
  a
package/dist/main.d.ts CHANGED
@@ -892,6 +892,7 @@ declare interface TabItem {
892
892
  export declare const Tabs: FC<TabsProps>;
893
893
 
894
894
  export declare interface TabsProps extends TabsProps_2 {
895
+ id?: string;
895
896
  defaultActive?: number;
896
897
  tabContents: TabContent[];
897
898
  styleVariant?: "DEFAULT" | "APPLE";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hybridcore/ui",
3
3
  "description": "Hybrid Core UI Library",
4
- "version": "1.5.28",
4
+ "version": "1.5.29",
5
5
  "author": "Hybrid Core",
6
6
  "license": "ISC",
7
7
  "type": "module",