@vkzstudio/muza-ui 1.0.15 → 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.
@@ -25,8 +25,10 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
25
25
  asChild?: boolean;
26
26
  /** React node displayed as an icon. Position controlled by `iconPosition`. */
27
27
  icon?: React.ReactNode;
28
- /** Places icon before (`start`) or after (`end`) the button text. @default 'start' */
28
+ /** Places icon before (`start`) or after (`end`) the button text. Ignored when `secondIcon` is provided. @default 'start' */
29
29
  iconPosition?: 'start' | 'end';
30
+ /** Optional trailing icon. When set, `icon` is always rendered at the start and `secondIcon` at the end, ignoring `iconPosition`. */
31
+ secondIcon?: React.ReactNode;
30
32
  /** Removes background, showing only text and icon with hover effects. @default false */
31
33
  ghost?: boolean;
32
34
  /** Applies destructive/error styling for delete or dangerous actions. @default false */
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAI5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD;;;;GAIG;AACH,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,IAAI,CAAC,YAAY,CAAC,OAAO,cAAc,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAChE;;;;OAIG;IACH,OAAO,CAAC,EACJ,SAAS,GACT,WAAW,GACX,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,YAAY,CAAA;IAChB;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAA;IACzC,mEAAmE;IACnE,SAAS,CAAC,EA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H,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IAC9B,qIAAqI;IACrI,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,wFAAwF;IACxF,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,wFAAwF;IACxF,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,QAAA,MAAM,MAAM,uFAiEX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
@@ -1,70 +1,71 @@
1
- import { jsxs as x, jsx as s } from "react/jsx-runtime";
2
- import * as b from "react";
1
+ import { jsxs as N, jsx as m } from "react/jsx-runtime";
2
+ import * as d from "react";
3
3
  import "class-variance-authority";
4
- import { ButtonLoader as N } from "./ButtonLoader.js";
5
- import { buttonVariants as B } from "./buttonVariants.js";
6
- import { cn as e } from "../../utils/cn.js";
7
- import { Typography as g } from "../Typography/Typography.js";
8
- const j = b.forwardRef(
4
+ import { ButtonLoader as B } from "./ButtonLoader.js";
5
+ import { buttonVariants as g } from "./buttonVariants.js";
6
+ import { cn as f } from "../../utils/cn.js";
7
+ import { Typography as j } from "../Typography/Typography.js";
8
+ const w = d.forwardRef(
9
9
  ({
10
- className: c,
11
- variant: f,
10
+ className: i,
11
+ variant: u,
12
12
  size: t,
13
- fullWidth: i,
14
- asChild: u = !1,
15
- icon: r,
16
- iconPosition: m = "start",
17
- ghost: l = !1,
18
- danger: n = !1,
19
- loading: a = !1,
20
- children: o,
21
- ...y
22
- }, d) => {
23
- const h = u ? "span" : "button", p = t === "icon" || l;
24
- return /* @__PURE__ */ x(
25
- h,
13
+ fullWidth: c,
14
+ asChild: l = !1,
15
+ icon: a,
16
+ iconPosition: p = "start",
17
+ secondIcon: s,
18
+ ghost: y = !1,
19
+ danger: e = !1,
20
+ loading: o = !1,
21
+ children: r,
22
+ ...h
23
+ }, x) => {
24
+ const b = l ? "span" : "button", n = t === "icon" || y;
25
+ return /* @__PURE__ */ N(
26
+ b,
26
27
  {
27
- className: e(
28
- B({
29
- variant: f,
28
+ className: f(
29
+ g({
30
+ variant: u,
30
31
  size: t,
31
- fullWidth: i,
32
- iconOnly: t === "icon" || !o,
33
- ghost: p,
34
- danger: n,
35
- loading: a,
36
- className: c
32
+ fullWidth: c,
33
+ iconOnly: t === "icon" || !r,
34
+ ghost: n,
35
+ danger: e,
36
+ loading: o,
37
+ className: i
37
38
  })
38
39
  ),
39
- ref: d,
40
- "data-ghost": p,
41
- "data-danger": n,
42
- ...y,
40
+ ref: x,
41
+ "data-ghost": n,
42
+ "data-danger": e,
43
+ ...h,
43
44
  children: [
44
- a && /* @__PURE__ */ s("span", { className: "absolute", children: /* @__PURE__ */ s(N, {}) }),
45
- m === "start" && r,
46
- o && /* @__PURE__ */ s(
47
- g,
45
+ o && /* @__PURE__ */ m("span", { className: "absolute", children: /* @__PURE__ */ m(B, {}) }),
46
+ (s || p === "start") && a,
47
+ r && /* @__PURE__ */ m(
48
+ j,
48
49
  {
49
50
  variant: "cta",
50
51
  size: t == "sm" || t == "xs" ? "sm" : "base",
51
52
  weight: "medium",
52
53
  component: "span",
53
54
  fixY: !0,
54
- className: e("transition-opacity", {
55
- "opacity-0": a
55
+ className: f("transition-opacity", {
56
+ "opacity-0": o
56
57
  }),
57
- children: o
58
+ children: r
58
59
  }
59
60
  ),
60
- m === "end" && r
61
+ s || p === "end" && a
61
62
  ]
62
63
  }
63
64
  );
64
65
  }
65
66
  );
66
- j.displayName = "Button";
67
+ w.displayName = "Button";
67
68
  export {
68
- j as Button,
69
- B as buttonVariants
69
+ w as Button,
70
+ g as buttonVariants
70
71
  };
@@ -12,5 +12,6 @@ export declare const AllVariants: Story;
12
12
  export declare const AllSizes: Story;
13
13
  export declare const InteractiveStates: Story;
14
14
  export declare const IconExamples: Story;
15
+ export declare const WithSecondIcon: Story;
15
16
  export declare const ResponsiveExample: Story;
16
17
  //# sourceMappingURL=Button.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAU3D,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAA;AAoBnD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CA6E7B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAA;AAEpC,eAAO,MAAM,OAAO,EAAE,KAarB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAetB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAe7B,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAoCtB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAgBvB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAyCzB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAkDtB,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAmF/B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KA8D1B,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAgC/B,CAAA"}
1
+ {"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAU3D,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAA;AAoBnD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAoF7B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAA;AAEpC,eAAO,MAAM,OAAO,EAAE,KAarB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAetB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAe7B,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAoCtB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAgBvB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAyCzB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAkDtB,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAmF/B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KA8D1B,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAgB5B,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAgC/B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../src/components/EmptyState/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,kDAAkD;AAClD,MAAM,WAAW,eAAe;IAC9B,kDAAkD;IAClD,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,aAAa,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IACzC,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAED,QAAA,MAAM,UAAU,GAAI,+DAOjB,eAAe,4CA6CjB,CAAA;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
1
+ {"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../src/components/EmptyState/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,kDAAkD;AAClD,MAAM,WAAW,eAAe;IAC9B,kDAAkD;IAClD,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,aAAa,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IACzC,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAED,QAAA,MAAM,UAAU,GAAI,+DAOjB,eAAe,4CA+CjB,CAAA;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
@@ -1,24 +1,24 @@
1
- import { jsxs as s, jsx as a } from "react/jsx-runtime";
2
- import { cn as r } from "../../utils/cn.js";
1
+ import { jsxs as r, jsx as a } from "react/jsx-runtime";
2
+ import { cn as m } from "../../utils/cn.js";
3
3
  import { Typography as c } from "../Typography/Typography.js";
4
- const x = ({
5
- icon: m,
6
- className: o,
4
+ const d = ({
5
+ icon: o,
6
+ className: i,
7
7
  headline: e,
8
8
  text: t,
9
- children: i,
9
+ children: s,
10
10
  buttonsLayout: l
11
- }) => /* @__PURE__ */ s(
11
+ }) => /* @__PURE__ */ r(
12
12
  "div",
13
13
  {
14
- className: r(
14
+ className: m(
15
15
  "flex flex-col items-center gap-comp-empty-state-gap",
16
16
  "[&>svg]:size-comp-empty-state-ico-size [&>svg]:text-gray-500",
17
- o
17
+ i
18
18
  ),
19
19
  children: [
20
- m,
21
- (e || t) && /* @__PURE__ */ s("div", { className: "flex flex-col gap-2xs text-center align-middle", children: [
20
+ o,
21
+ (e || t) && /* @__PURE__ */ r("div", { className: "flex flex-col gap-2xs text-center align-middle", children: [
22
22
  e && /* @__PURE__ */ a(
23
23
  c,
24
24
  {
@@ -42,18 +42,18 @@ const x = ({
42
42
  }
43
43
  )
44
44
  ] }),
45
- /* @__PURE__ */ a(
45
+ s && /* @__PURE__ */ a(
46
46
  "div",
47
47
  {
48
- className: r("flex gap-sm", {
48
+ className: m("flex gap-sm", {
49
49
  "flex-col": l === "vertical"
50
50
  }),
51
- children: i
51
+ children: s
52
52
  }
53
53
  )
54
54
  ]
55
55
  }
56
56
  );
57
57
  export {
58
- x as EmptyState
58
+ d as EmptyState
59
59
  };
@@ -14,7 +14,7 @@ interface ReorderableItemContextValue {
14
14
  moveItem: (direction: -1 | 1) => void;
15
15
  }
16
16
  declare const useReorderableItem: () => ReorderableItemContextValue;
17
- type ReorderableGroupElement = 'ul' | 'ol' | 'div';
17
+ type ReorderableGroupElement = 'ul' | 'ol' | 'div' | 'tbody';
18
18
  /**
19
19
  * Props for the ReorderableGroup component.
20
20
  * @typeParam T - Type of items in the reorderable list
@@ -1 +1 @@
1
- {"version":3,"file":"Reorderable.d.ts","sourceRoot":"","sources":["../../../src/components/Reorderable/Reorderable.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EAIjB,KAAK,YAAY,EACjB,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AACd,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,eAAe,EAEpB,KAAK,mBAAmB,EAGzB,MAAM,cAAc,CAAA;AAWrB,UAAU,4BAA4B,CAAC,CAAC,GAAG,OAAO;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,CAAC,EAAE,CAAA;IACZ,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE,KAAK,IAAI,CAAA;IACnC,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,CAAA;IAChB,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AAcD,QAAA,MAAM,mBAAmB,GAAI,CAAC,OACW,4BAA4B,CAAC,CAAC,CAAC,CAAA;AAExE,UAAU,2BAA2B;IACnC,YAAY,EAAE,YAAY,CAAA;IA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AE,MAAM,CAAA;IACrB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED,QAAA,MAAM,iBAAiB,sHAyHtB,CAAA;AAaD,KAAK,4BAA4B,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,CAAA;AAEvD,KAAK,+BAA+B,GAAG;IACrC,EAAE,EAAE,aAAa,CAAA;IACjB,GAAG,EAAE,cAAc,CAAA;IACnB,EAAE,EAAE,mBAAmB,CAAA;CACxB,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,0BAA0B,CACzC,CAAC,SAAS,4BAA4B,GAAG,IAAI;IAE7C,+DAA+D;IAC/D,EAAE,CAAC,EAAE,CAAC,CAAA;IACN,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,sBAAsB;IACtB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAuBD,QAAA,MAAM,qBAAqB,EAA6C,CACtE,CAAC,SAAS,4BAA4B,GAAG,IAAI,EAE7C,KAAK,EAAE,0BAA0B,CAAC,CAAC,CAAC,GAAG;IACrC,GAAG,CAAC,EAAE,YAAY,CAAC,+BAA+B,CAAC,CAAC,CAAC,CAAC,CAAA;CACvD,KACE,YAAY,CAChB;AAMD,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,GACnB,CAAA"}
1
+ {"version":3,"file":"Reorderable.d.ts","sourceRoot":"","sources":["../../../src/components/Reorderable/Reorderable.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EAIjB,KAAK,YAAY,EACjB,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AACd,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,eAAe,EAEpB,KAAK,mBAAmB,EAGzB,MAAM,cA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AC,CAAA;CACvD,KACE,YAAY,CAChB;AAMD,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,GACnB,CAAA"}
@@ -1,4 +1,4 @@
1
- import { jsx as u } from "react/jsx-runtime";
1
+ import { jsx as d } from "react/jsx-runtime";
2
2
  import { forwardRef as A, useContext as K, useRef as X, useCallback as N, createContext as k } from "react";
3
3
  import { useMuzaTranslations as M } from "../../translations/TranslationContext.js";
4
4
  import { AnimatePresence as O } from "../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.js";
@@ -20,8 +20,8 @@ const w = {
20
20
  }, Z = ({
21
21
  values: r,
22
22
  onReorder: s,
23
- axis: d = "y",
24
- as: b = "ol",
23
+ axis: b = "y",
24
+ as: l = "ol",
25
25
  disabled: a = !1,
26
26
  layoutScroll: n = !1,
27
27
  animatePresence: D,
@@ -29,30 +29,32 @@ const w = {
29
29
  className: I,
30
30
  children: f
31
31
  }, v) => {
32
- const l = M(), c = {
32
+ const c = M(), u = {
33
33
  disabled: a,
34
34
  values: r,
35
35
  onReorder: a ? void 0 : s,
36
- axis: d,
36
+ axis: b,
37
37
  animatePresence: !!D
38
- }, e = D === !0 ? { mode: "popLayout", initial: !1 } : D || null, m = e ? /* @__PURE__ */ u(O, { ...e, children: f }) : f;
39
- return /* @__PURE__ */ u(
38
+ }, e = D === !0 ? { mode: "popLayout", initial: !1 } : D || null, m = e ? /* @__PURE__ */ d(O, { ...e, children: f }) : f;
39
+ return /* @__PURE__ */ d(
40
40
  T.Provider,
41
41
  {
42
- value: c,
43
- children: /* @__PURE__ */ u(
42
+ value: u,
43
+ children: /* @__PURE__ */ d(
44
44
  j,
45
45
  {
46
46
  ref: v,
47
- axis: d,
47
+ axis: b,
48
48
  values: r,
49
49
  onReorder: a ? () => {
50
50
  } : s,
51
- as: b,
51
+ as: l,
52
52
  layoutScroll: n,
53
53
  style: x,
54
- role: "list",
55
- "aria-label": l.reorderableTable.listAriaLabel,
54
+ ...l !== "tbody" && {
55
+ role: "list",
56
+ "aria-label": c.reorderableTable.listAriaLabel
57
+ },
56
58
  className: C(I),
57
59
  children: m
58
60
  }
@@ -64,8 +66,8 @@ q.displayName = "ReorderableGroup";
64
66
  const B = ({
65
67
  value: r,
66
68
  as: s = "li",
67
- disabled: d = !1,
68
- dragListenerDisabled: b = !1,
69
+ disabled: b = !1,
70
+ dragListenerDisabled: l = !1,
69
71
  whileDrag: a,
70
72
  animation: n,
71
73
  className: D,
@@ -74,39 +76,39 @@ const B = ({
74
76
  }, f) => {
75
77
  const {
76
78
  disabled: v,
77
- values: l,
78
- onReorder: c,
79
+ values: c,
80
+ onReorder: u,
79
81
  axis: e,
80
82
  animatePresence: m
81
- } = _(), E = U(), L = d || v, p = !L && !b, t = n === !1 ? null : n === !0 ? w : typeof n == "object" ? {
83
+ } = _(), E = U(), L = b || v, p = !L && !l, t = n === !1 ? null : n === !0 ? w : typeof n == "object" ? {
82
84
  initial: n.initial ?? w.initial,
83
85
  animate: n.animate ?? w.animate,
84
86
  exit: n.exit ?? w.exit,
85
87
  transition: n.transition ?? w.transition
86
88
  } : m ? w : null, o = N(
87
89
  (i) => {
88
- if (!l || !c) return;
89
- const R = l.indexOf(r);
90
- if (R === -1) return;
91
- const y = R + i;
92
- if (y < 0 || y >= l.length) return;
93
- const g = [...l];
94
- g.splice(R, 1), g.splice(y, 0, r), c(g);
90
+ if (!c || !u) return;
91
+ const y = c.indexOf(r);
92
+ if (y === -1) return;
93
+ const R = y + i;
94
+ if (R < 0 || R >= c.length) return;
95
+ const g = [...c];
96
+ g.splice(y, 1), g.splice(R, 0, r), u(g);
95
97
  },
96
- [l, c, r]
98
+ [c, u, r]
97
99
  ), h = N(
98
100
  (i) => {
99
101
  if (!p) return;
100
- const R = e === "y" ? "ArrowUp" : "ArrowLeft", y = e === "y" ? "ArrowDown" : "ArrowRight";
101
- i.key === R ? (i.preventDefault(), o(-1)) : i.key === y && (i.preventDefault(), o(1));
102
+ const y = e === "y" ? "ArrowUp" : "ArrowLeft", R = e === "y" ? "ArrowDown" : "ArrowRight";
103
+ i.key === y ? (i.preventDefault(), o(-1)) : i.key === R && (i.preventDefault(), o(1));
102
104
  },
103
105
  [p, e, o]
104
106
  );
105
- return /* @__PURE__ */ u(
107
+ return /* @__PURE__ */ d(
106
108
  P.Provider,
107
109
  {
108
- value: { dragControls: E, dragListenerDisabled: b, moveItem: o },
109
- children: /* @__PURE__ */ u(
110
+ value: { dragControls: E, dragListenerDisabled: l, moveItem: o },
111
+ children: /* @__PURE__ */ d(
110
112
  z,
111
113
  {
112
114
  ref: f,
@@ -144,29 +146,29 @@ const Q = A(
144
146
  ({
145
147
  as: r = "button",
146
148
  disabled: s = !1,
147
- "aria-label": d,
148
- className: b,
149
+ "aria-label": b,
150
+ className: l,
149
151
  children: a
150
152
  }, n) => {
151
- const D = M(), x = d ?? D.reorderableTable.dragHandleAriaLabel, { disabled: I, axis: f } = _(), { dragControls: v, dragListenerDisabled: l, moveItem: c } = V(), e = l && !I && !s, m = X(!1), E = (o) => {
153
+ const D = M(), x = b ?? D.reorderableTable.dragHandleAriaLabel, { disabled: I, axis: f } = _(), { dragControls: v, dragListenerDisabled: c, moveItem: u } = V(), e = c && !I && !s, m = X(!1), E = (o) => {
152
154
  if (!e) return;
153
155
  m.current = !1;
154
- const h = o.clientX, i = o.clientY, R = (g) => {
156
+ const h = o.clientX, i = o.clientY, y = (g) => {
155
157
  const S = Math.abs(g.clientX - h), H = Math.abs(g.clientY - i);
156
158
  (S > G || H > G) && (m.current = !0);
157
- }, y = () => {
158
- document.removeEventListener("pointermove", R), document.removeEventListener("pointerup", y);
159
+ }, R = () => {
160
+ document.removeEventListener("pointermove", y), document.removeEventListener("pointerup", R);
159
161
  };
160
- document.addEventListener("pointermove", R), document.addEventListener("pointerup", y), v.start(o);
162
+ document.addEventListener("pointermove", y), document.addEventListener("pointerup", R), v.start(o);
161
163
  }, L = (o) => {
162
164
  m.current && (o.stopPropagation(), m.current = !1);
163
165
  }, p = N(
164
166
  (o) => {
165
167
  if (!e) return;
166
168
  const h = f === "y" ? "ArrowUp" : "ArrowLeft", i = f === "y" ? "ArrowDown" : "ArrowRight";
167
- o.key === h ? (o.preventDefault(), c(-1)) : o.key === i && (o.preventDefault(), c(1));
169
+ o.key === h ? (o.preventDefault(), u(-1)) : o.key === i && (o.preventDefault(), u(1));
168
170
  },
169
- [e, f, c]
171
+ [e, f, u]
170
172
  ), t = {
171
173
  "aria-label": x,
172
174
  "aria-roledescription": "sortable",
@@ -178,10 +180,10 @@ const Q = A(
178
180
  e && "cursor-grab active:cursor-grabbing",
179
181
  !e && "cursor-default",
180
182
  e && "focus-visible-default",
181
- b
183
+ l
182
184
  )
183
185
  };
184
- return r === "button" ? /* @__PURE__ */ u("button", { ref: n, type: "button", disabled: s, ...t, children: a }) : r === "div" ? /* @__PURE__ */ u(
186
+ return r === "button" ? /* @__PURE__ */ d("button", { ref: n, type: "button", disabled: s, ...t, children: a }) : r === "div" ? /* @__PURE__ */ d(
185
187
  "div",
186
188
  {
187
189
  ref: n,
@@ -190,7 +192,7 @@ const Q = A(
190
192
  ...t,
191
193
  children: a
192
194
  }
193
- ) : /* @__PURE__ */ u(
195
+ ) : /* @__PURE__ */ d(
194
196
  "span",
195
197
  {
196
198
  ref: n,
@@ -203,9 +205,9 @@ const Q = A(
203
205
  }
204
206
  );
205
207
  Q.displayName = "ReorderableHandle";
206
- const W = ({ as: r = "li", className: s, children: d }, b) => {
208
+ const W = ({ as: r = "li", className: s, children: b }, l) => {
207
209
  const a = Y[r];
208
- return /* @__PURE__ */ u(a, { ref: b, layout: !0, role: "listitem", className: C(s), children: d });
210
+ return /* @__PURE__ */ d(a, { ref: l, layout: !0, role: "listitem", className: C(s), children: b });
209
211
  }, $ = A(W);
210
212
  $.displayName = "ReorderableStaticItem";
211
213
  export {
@@ -7,9 +7,9 @@ import { cn as i } from "../../utils/cn.js";
7
7
  import { typographyVariants as O, Typography as k } from "../Typography/Typography.js";
8
8
  const p = 72, u = 20, E = 24, D = 4, R = ({
9
9
  data: b,
10
- onReorder: N,
10
+ onReorder: y,
11
11
  columns: o,
12
- showHeader: y = !1,
12
+ showHeader: N = !1,
13
13
  disabled: h = !1,
14
14
  isRowDisabled: l,
15
15
  className: g,
@@ -26,7 +26,7 @@ const p = 72, u = 20, E = 24, D = 4, R = ({
26
26
  ),
27
27
  ...L,
28
28
  children: [
29
- y && /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ m("tr", { children: [
29
+ N && /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ m("tr", { children: [
30
30
  o.map((r, d) => /* @__PURE__ */ e(
31
31
  "th",
32
32
  {
@@ -60,10 +60,10 @@ const p = 72, u = 20, E = 24, D = 4, R = ({
60
60
  w,
61
61
  {
62
62
  values: b,
63
- onReorder: N,
63
+ onReorder: y,
64
64
  disabled: h,
65
65
  animatePresence: x,
66
- as: "div",
66
+ as: "tbody",
67
67
  className: "contents",
68
68
  children: b.map((r, d) => {
69
69
  const v = (l == null ? void 0 : l(r, d)) ?? !1, t = h || v;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkzstudio/muza-ui",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "React component library built with Vite, shadcn/ui, and Tailwind CSS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",