@vkzstudio/muza-ui 1.0.36 → 1.0.38

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,61 +1,62 @@
1
- import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
- import { forwardRef as E } from "react";
3
- import { motion as n } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
4
- import { ReorderableGroup as D, ReorderableItem as R, ReorderableHandle as j } from "../Reorderable/Reorderable.js";
5
- import { Reorder as P } from "../Icons/CustomIcons.js";
1
+ import { jsx as e, jsxs as h } from "react/jsx-runtime";
2
+ import { forwardRef as S } from "react";
3
+ import { motion as l } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
4
+ import { ReorderableGroup as k, ReorderableItem as w, ReorderableHandle as z } from "../Reorderable/Reorderable.js";
5
+ import { Reorder as G } from "../Icons/CustomIcons.js";
6
6
  import { cn as d } from "../../utils/cn.js";
7
- import { typographyVariants as S, Typography as z } from "../Typography/Typography.js";
8
- const p = 72, u = 20, G = 24, W = 4, K = ({
9
- data: y,
10
- onReorder: N,
11
- onSync: g,
12
- syncDelay: x,
13
- onSyncPendingChange: L,
14
- onDragStart: _,
15
- onDragEnd: v,
16
- columns: o,
17
- showHeader: I = !1,
18
- disabled: b = !1,
19
- isRowDisabled: l,
20
- className: T,
21
- isMovable: s = !0,
22
- animateItems: w = !1,
23
- layout: A,
7
+ import { typographyVariants as W, Typography as K } from "../Typography/Typography.js";
8
+ const f = 72, N = 20, R = 24, U = 4, F = ({
9
+ data: g,
10
+ onReorder: x,
11
+ onSync: L,
12
+ syncDelay: v,
13
+ onSyncPendingChange: _,
14
+ onDragStart: I,
15
+ onDragEnd: T,
16
+ columns: c,
17
+ showHeader: A = !1,
18
+ disabled: u = !1,
19
+ isRowDisabled: m,
20
+ className: H,
21
+ isMovable: i = !0,
22
+ animateItems: O = !1,
23
+ layout: E,
24
+ onRowClick: n,
24
25
  ...C
25
- }, H) => /* @__PURE__ */ e("div", { className: "w-full", children: /* @__PURE__ */ m(
26
+ }, j) => /* @__PURE__ */ e("div", { className: "w-full", children: /* @__PURE__ */ h(
26
27
  "table",
27
28
  {
28
- ref: H,
29
+ ref: j,
29
30
  className: d(
30
31
  "-my-sm w-full border-separate border-spacing-y-sm",
31
- T
32
+ H
32
33
  ),
33
34
  ...C,
34
35
  children: [
35
- I && /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ m("tr", { children: [
36
- o.map((i, r) => /* @__PURE__ */ e(
36
+ A && /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ h("tr", { children: [
37
+ c.map((o, a) => /* @__PURE__ */ e(
37
38
  "th",
38
39
  {
39
40
  className: d(
40
- S({
41
+ W({
41
42
  size: "sm",
42
43
  uppercase: !0,
43
44
  variant: "body",
44
45
  weight: "medium"
45
46
  }),
46
47
  "px-comp-table-p text-left text-text-dark-secondary",
47
- i.className
48
+ o.className
48
49
  ),
49
- children: i.title
50
+ children: o.title
50
51
  },
51
- r
52
+ a
52
53
  )),
53
54
  /* @__PURE__ */ e(
54
- n.th,
55
+ l.th,
55
56
  {
56
57
  initial: !1,
57
58
  animate: {
58
- width: s ? p : u
59
+ width: i ? f : N
59
60
  },
60
61
  transition: { duration: 0.3, ease: "easeInOut" },
61
62
  className: "overflow-hidden"
@@ -63,57 +64,65 @@ const p = 72, u = 20, G = 24, W = 4, K = ({
63
64
  )
64
65
  ] }) }),
65
66
  /* @__PURE__ */ e(
66
- D,
67
+ k,
67
68
  {
68
- values: y,
69
- onReorder: N,
70
- onSync: g,
71
- syncDelay: x,
72
- onSyncPendingChange: L,
73
- onDragStart: _,
74
- onDragEnd: v,
75
- disabled: b,
76
- animatePresence: w,
69
+ values: g,
70
+ onReorder: x,
71
+ onSync: L,
72
+ syncDelay: v,
73
+ onSyncPendingChange: _,
74
+ onDragStart: I,
75
+ onDragEnd: T,
76
+ disabled: u,
77
+ animatePresence: O,
77
78
  as: "tbody",
78
79
  className: "contents",
79
- children: (i) => i.map((r, h) => {
80
- const O = (l == null ? void 0 : l(r, h)) ?? !1, t = b || O;
81
- return /* @__PURE__ */ m(
82
- R,
80
+ children: (o) => o.map((a, p) => {
81
+ const D = (m == null ? void 0 : m(a, p)) ?? !1, t = u || D, b = !!n && !t;
82
+ return /* @__PURE__ */ h(
83
+ w,
83
84
  {
84
- value: r,
85
+ value: a,
85
86
  as: "tr",
86
- layout: A,
87
+ layout: E,
87
88
  disabled: t,
88
89
  dragListenerDisabled: !0,
89
90
  whileDrag: t ? void 0 : { boxShadow: "0 8px 32px 0 rgba(59, 18, 107, 0.2)" },
90
- className: "group rounded-2xl",
91
+ onClick: b ? (r) => {
92
+ if (!b) return;
93
+ const s = r.target;
94
+ s != null && s.closest("[data-reorder-handle]") || n == null || n(a, p);
95
+ } : void 0,
96
+ className: d(
97
+ "group rounded-2xl",
98
+ b && "cursor-pointer"
99
+ ),
91
100
  children: [
92
- o.map((a, c) => {
93
- const k = c === 0, f = c === o.length - 1;
101
+ c.map((r, s) => {
102
+ const P = s === 0, y = s === c.length - 1;
94
103
  return /* @__PURE__ */ e(
95
- n.td,
104
+ l.td,
96
105
  {
97
106
  initial: !1,
98
- animate: f ? {
99
- paddingRight: s ? G : W
107
+ animate: y ? {
108
+ paddingRight: i ? R : U
100
109
  } : void 0,
101
110
  transition: { duration: 0.3, ease: "easeInOut" },
102
111
  className: d(
103
112
  "h-comp-table-h-def border-y border-stroke-base-secondary bg-surface-base-secondary align-middle",
104
- f ? "pl-comp-table-p" : "px-comp-table-p",
113
+ y ? "pl-comp-table-p" : "px-comp-table-p",
105
114
  {
106
- "rounded-l-xl border-l": k,
115
+ "rounded-l-xl border-l": P,
107
116
  "group-focus-within:border-icon-brand-focus group-hover:border-icon-brand-hover": !t
108
117
  },
109
- a.className
118
+ r.className
110
119
  ),
111
- children: a.render ? a.render(
112
- r[a.dataKey],
113
- r,
114
- h
120
+ children: r.render ? r.render(
121
+ a[r.dataKey],
122
+ a,
123
+ p
115
124
  ) : /* @__PURE__ */ e(
116
- z,
125
+ K,
117
126
  {
118
127
  variant: "body",
119
128
  size: "base",
@@ -122,50 +131,52 @@ const p = 72, u = 20, G = 24, W = 4, K = ({
122
131
  className: d(
123
132
  t && "text-text-dark-disabled",
124
133
  {
125
- "line-clamp-1": a.lineClamp === !0 || a.lineClamp === 1,
126
- "line-clamp-2": a.lineClamp === 2
134
+ "line-clamp-1": r.lineClamp === !0 || r.lineClamp === 1,
135
+ "line-clamp-2": r.lineClamp === 2
127
136
  }
128
137
  ),
129
- children: r[a.dataKey]
138
+ children: a[r.dataKey]
130
139
  }
131
140
  )
132
141
  },
133
- c
142
+ s
134
143
  );
135
144
  }),
136
145
  /* @__PURE__ */ e(
137
- n.td,
146
+ l.td,
138
147
  {
148
+ "data-reorder-handle": !0,
139
149
  initial: !1,
140
150
  animate: {
141
- width: s ? p : u
151
+ width: i ? f : N
142
152
  },
143
153
  transition: { duration: 0.3, ease: "easeInOut" },
144
154
  className: d(
145
155
  "h-comp-table-h-def min-w-[20px] rounded-r-xl border-y border-r border-stroke-base-secondary bg-surface-base-secondary align-middle",
146
156
  {
147
- "group-focus-within:border-icon-brand-focus group-hover:border-icon-brand-hover": !t
157
+ "group-focus-within:border-icon-brand-focus group-hover:border-icon-brand-hover": !t,
158
+ "cursor-default": !!n
148
159
  }
149
160
  ),
150
161
  children: /* @__PURE__ */ e(
151
- n.div,
162
+ l.div,
152
163
  {
153
164
  initial: !1,
154
165
  animate: {
155
- opacity: s ? 1 : 0,
156
- width: s ? p : 0
166
+ opacity: i ? 1 : 0,
167
+ width: i ? f : 0
157
168
  },
158
169
  transition: { duration: 0.3, ease: "easeInOut" },
159
170
  className: "flex h-full items-center justify-center overflow-hidden border-l border-stroke-base-secondary",
160
171
  children: /* @__PURE__ */ e(
161
- j,
172
+ z,
162
173
  {
163
- disabled: !s || t,
174
+ disabled: !i || t,
164
175
  className: d(
165
176
  "flex h-comp-button-h-sm w-comp-button-w-sm items-center justify-center focus-visible-default",
166
177
  t ? "text-text-dark-disabled" : "text-text-brand-def"
167
178
  ),
168
- children: /* @__PURE__ */ e(P, { className: "size-icon-default" })
179
+ children: /* @__PURE__ */ e(G, { className: "size-icon-default" })
169
180
  }
170
181
  )
171
182
  }
@@ -174,15 +185,15 @@ const p = 72, u = 20, G = 24, W = 4, K = ({
174
185
  )
175
186
  ]
176
187
  },
177
- r.id
188
+ a.id
178
189
  );
179
190
  })
180
191
  }
181
192
  )
182
193
  ]
183
194
  }
184
- ) }), U = E(K);
185
- U.displayName = "ReorderableTable";
195
+ ) }), V = S(F);
196
+ V.displayName = "ReorderableTable";
186
197
  export {
187
- U as ReorderableTable
198
+ V as ReorderableTable
188
199
  };
@@ -12,6 +12,7 @@ declare const meta: Meta<typeof ReorderableTable>;
12
12
  export default meta;
13
13
  type Story = StoryObj<typeof ReorderableTable<IBenefit>>;
14
14
  export declare const Default: Story;
15
+ export declare const WithRowClick: Story;
15
16
  export declare const WithoutHeader: Story;
16
17
  export declare const WithDisabledRow: Story;
17
18
  export declare const AnimatedRows: Story;
@@ -1 +1 @@
1
- {"version":3,"file":"ReorderableTable.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ReorderableTable/ReorderableTable.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAM3D,OAAO,EACL,gBAAgB,EAEjB,MAAM,oBAAoB,CAAA;AAE3B,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAA;CAC9B;AAyCD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CAiEvC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAA;AAExD,eAAO,MAAM,OAAO,EAAE,KAkHrB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAsG3B,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KA2G7B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KA0H1B,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAkG3B,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KA4FtB,CAAA"}
1
+ {"version":3,"file":"ReorderableTable.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ReorderableTable/ReorderableTable.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAc3D,OAAO,EACL,gBAAgB,EAEjB,MAAM,oBAAoB,CAAA;AAE3B,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAA;CAC9B;AAyCD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CAoEvC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAA;AAExD,eAAO,MAAM,OAAO,EAAE,KAkHrB,CAAA;AAMD,eAAO,MAAM,YAAY,EAAE,KAuL1B,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAsG3B,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KA2G7B,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KA0H1B,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAkG3B,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KA4FtB,CAAA"}
@@ -0,0 +1,7 @@
1
+ export * from './use-is-breakpoint';
2
+ export * from './use-is-desktop';
3
+ export * from './use-is-mobile';
4
+ export * from './use-is-tablet';
5
+ export * from './use-isomorphic-layout-effect';
6
+ export * from './use-media-query';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gCAAgC,CAAA;AAC9C,cAAc,mBAAmB,CAAA"}
@@ -1,7 +1,16 @@
1
- import { useMediaQuery as n } from "./use-media-query.js";
2
- const t = 40, e = 48, r = 64, i = () => n(`(min-width: ${t}rem)`), m = () => n(`(min-width: ${e}rem)`), o = () => n(`(min-width: ${r}rem)`);
1
+ import { useMediaQuery as t } from "./use-media-query.js";
2
+ const s = 40, n = 48, e = 64, r = 80, m = 96, i = 118, o = () => t(`(min-width: ${s}rem)`), c = () => t(`(max-width: ${s}rem)`), I = () => t(`(min-width: ${n}rem)`), x = () => t(`(max-width: ${n}rem)`), M = () => t(`(min-width: ${e}rem)`), d = () => t(`(max-width: ${e}rem)`), a = () => t(`(min-width: ${r}rem)`), h = () => t(`(max-width: ${r}rem)`), w = () => t(`(min-width: ${m}rem)`), $ = () => t(`(max-width: ${m}rem)`), X = () => t(`(min-width: ${i}rem)`), l = () => t(`(max-width: ${i}rem)`);
3
3
  export {
4
- o as useIsMinLg,
5
- m as useIsMinMd,
6
- i as useIsMinSm
4
+ $ as useIsMax2xl,
5
+ l as useIsMax3xl,
6
+ d as useIsMaxLg,
7
+ x as useIsMaxMd,
8
+ c as useIsMaxSm,
9
+ h as useIsMaxXl,
10
+ w as useIsMin2xl,
11
+ X as useIsMin3xl,
12
+ M as useIsMinLg,
13
+ I as useIsMinMd,
14
+ o as useIsMinSm,
15
+ a as useIsMinXl
7
16
  };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './components';
2
+ export * from './hooks';
2
3
  export * from './utils';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAA;AAEtB,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAA;AAEtB,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}