asma-ui-core 3.45.1 → 3.45.2

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,22 +1,22 @@
1
1
  import { cn as n } from "../../../helpers/cn.js";
2
- import { resolveSx as T } from "../../../helpers/sx.js";
3
- import { ChevronRightIcon as H } from "../../icons/chevron-right-icon/ChevronRightIcon.js";
4
- import { ChevronLeftIcon as K } from "../../icons/chevron-left-icon/ChevronLeftIcon.js";
5
- import { consumerOverrides as M } from "../../../helpers/classOverride.js";
6
- import { TabsContext as V } from "./TabsContext.js";
7
- import { Children as _, cloneElement as q, isValidElement as z, useCallback as u, useLayoutEffect as F, useMemo as G, useRef as R, useState as E } from "react";
8
- import { jsx as l, jsxs as A } from "react/jsx-runtime";
9
- var I = 120, te = ({ value: i, onChange: m, variant: g = "standard", scrollButtons: w = "auto", centered: j, size: b = "default", className: x, sx: N, children: y }) => {
10
- const a = R(null), d = R(/* @__PURE__ */ new Map()), [h, O] = E({
2
+ import { resolveSx as M } from "../../../helpers/sx.js";
3
+ import { ChevronRightIcon as V } from "../../icons/chevron-right-icon/ChevronRightIcon.js";
4
+ import { ChevronLeftIcon as _ } from "../../icons/chevron-left-icon/ChevronLeftIcon.js";
5
+ import { consumerOverrides as q } from "../../../helpers/classOverride.js";
6
+ import { TabsContext as z } from "./TabsContext.js";
7
+ import { Children as F, cloneElement as G, isValidElement as J, useCallback as u, useLayoutEffect as Q, useMemo as U, useRef as E, useState as A } from "react";
8
+ import { jsx as l, jsxs as B } from "react/jsx-runtime";
9
+ var I = 120, le = ({ value: i, onChange: m, variant: g = "standard", scrollButtons: w = "auto", centered: j, size: b = "default", className: x, sx: N, children: y }) => {
10
+ const a = E(null), d = E(/* @__PURE__ */ new Map()), [h, O] = A({
11
11
  left: 0,
12
12
  width: 0,
13
13
  disabled: !1
14
- }), [c, W] = E({
14
+ }), [c, W] = A({
15
15
  left: !1,
16
16
  right: !1
17
17
  }), p = g === "scrollable", v = u((e, t) => {
18
18
  t ? d.current.set(e, t) : d.current.delete(e);
19
- }, []), k = u((e, t) => m?.(e, t), [m]), f = u(() => {
19
+ }, []), S = u((e, t) => m?.(e, t), [m]), f = u(() => {
20
20
  const e = d.current.get(i), t = a.current;
21
21
  if (e && O({
22
22
  left: e.offsetLeft,
@@ -30,19 +30,19 @@ var I = 120, te = ({ value: i, onChange: m, variant: g = "standard", scrollButto
30
30
  });
31
31
  }
32
32
  }, [i]);
33
- F(() => {
33
+ Q(() => {
34
34
  f();
35
35
  const e = a.current;
36
36
  if (!e) return;
37
37
  const t = new ResizeObserver(f);
38
38
  return t.observe(e), () => t.disconnect();
39
39
  }, [f, y]);
40
- const S = (e) => {
40
+ const k = (e) => {
41
41
  a.current?.scrollBy({
42
42
  left: e,
43
43
  behavior: "smooth"
44
44
  });
45
- }, B = (e) => {
45
+ }, D = (e) => {
46
46
  if (![
47
47
  "ArrowRight",
48
48
  "ArrowLeft",
@@ -55,42 +55,42 @@ var I = 120, te = ({ value: i, onChange: m, variant: g = "standard", scrollButto
55
55
  const o = t.findIndex((s) => s === document.activeElement);
56
56
  let r = o;
57
57
  e.key === "ArrowRight" ? r = (o + 1) % t.length : e.key === "ArrowLeft" ? r = (o - 1 + t.length) % t.length : e.key === "Home" ? r = 0 : e.key === "End" && (r = t.length - 1), t[r]?.focus();
58
- }, C = p && w !== !1 && (w === !0 || c.left || c.right), D = M(x, "padding-x"), P = G(() => ({
58
+ }, L = p && w !== !1, R = w === !0, P = L && (R || c.left), T = L && (R || c.right), H = q(x, "padding-x"), K = U(() => ({
59
59
  value: i,
60
60
  size: b,
61
- onSelect: k,
61
+ onSelect: S,
62
62
  register: v
63
63
  }), [
64
64
  i,
65
65
  b,
66
- k,
66
+ S,
67
67
  v
68
- ]), L = "flex h-10 w-10 shrink-0 items-center justify-center self-center rounded-[10%] border border-solid border-delta-500 text-delta-700 transition-colors hover:bg-gama-50 disabled:invisible";
69
- return /* @__PURE__ */ l(V.Provider, {
70
- value: P,
71
- children: /* @__PURE__ */ A("div", {
72
- className: n("relative flex items-center rounded-t-lg bg-white", !D && "px-4", x),
73
- style: T(N),
68
+ ]), C = "flex h-10 w-10 shrink-0 items-center justify-center self-center rounded-[10%] border border-solid border-delta-500 text-delta-700 transition-colors hover:bg-gama-50 disabled:invisible";
69
+ return /* @__PURE__ */ l(z.Provider, {
70
+ value: K,
71
+ children: /* @__PURE__ */ B("div", {
72
+ className: n("relative flex items-center rounded-t-lg bg-white", !H && "px-4", x),
73
+ style: M(N),
74
74
  children: [
75
- C && /* @__PURE__ */ l("button", {
75
+ P && /* @__PURE__ */ l("button", {
76
76
  type: "button",
77
77
  "aria-label": "scroll tabs left",
78
- className: n(L, "mr-2"),
78
+ className: n(C, "mr-2"),
79
79
  disabled: !c.left,
80
- onClick: () => S(-I),
81
- children: /* @__PURE__ */ l(K, {
80
+ onClick: () => k(-I),
81
+ children: /* @__PURE__ */ l(_, {
82
82
  width: 24,
83
83
  height: 24
84
84
  })
85
85
  }),
86
- /* @__PURE__ */ A("div", {
86
+ /* @__PURE__ */ B("div", {
87
87
  ref: a,
88
88
  role: "tablist",
89
89
  "aria-orientation": "horizontal",
90
- onKeyDown: B,
90
+ onKeyDown: D,
91
91
  onScroll: f,
92
92
  className: n("relative flex border-x-0 border-b border-t-0 border-solid border-delta-200 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", p ? "flex-1 overflow-x-auto" : "w-full", g === "fullWidth" && "[&>*]:flex-1", j && "justify-center", b === "small" && "min-h-9"),
93
- children: [_.map(y, (e, t) => z(e) ? q(e, { index: t }) : e), /* @__PURE__ */ l("span", {
93
+ children: [F.map(y, (e, t) => J(e) ? G(e, { index: t }) : e), /* @__PURE__ */ l("span", {
94
94
  "aria-hidden": !0,
95
95
  className: n("absolute bottom-0 h-0.5 transition-all duration-300", h.disabled ? "bg-delta-300" : "bg-gama-500"),
96
96
  style: {
@@ -99,13 +99,13 @@ var I = 120, te = ({ value: i, onChange: m, variant: g = "standard", scrollButto
99
99
  }
100
100
  })]
101
101
  }),
102
- C && /* @__PURE__ */ l("button", {
102
+ T && /* @__PURE__ */ l("button", {
103
103
  type: "button",
104
104
  "aria-label": "scroll tabs right",
105
- className: n(L, "ml-2"),
105
+ className: n(C, "ml-2"),
106
106
  disabled: !c.right,
107
- onClick: () => S(I),
108
- children: /* @__PURE__ */ l(H, {
107
+ onClick: () => k(I),
108
+ children: /* @__PURE__ */ l(V, {
109
109
  width: 24,
110
110
  height: 24
111
111
  })
@@ -115,5 +115,5 @@ var I = 120, te = ({ value: i, onChange: m, variant: g = "standard", scrollButto
115
115
  });
116
116
  };
117
117
  export {
118
- te as StyledTabs
118
+ le as StyledTabs
119
119
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.45.1",
6
+ "version": "3.45.2",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",