@vkzstudio/muza-ui 1.0.36 → 1.0.37
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.
- package/dist/components/DataTable/DataTable.d.ts +6 -1
- package/dist/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.js +92 -79
- package/dist/components/DataTable/DataTable.stories.d.ts +1 -0
- package/dist/components/DataTable/DataTable.stories.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts +9 -0
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.js +23 -22
- package/dist/components/MuzaUIProvider/theme/colorShades.js +11 -10
- package/dist/components/Reorderable/Reorderable.d.ts +5 -0
- package/dist/components/Reorderable/Reorderable.d.ts.map +1 -1
- package/dist/components/Reorderable/Reorderable.js +166 -164
- package/dist/components/ReorderableTable/ReorderableTable.d.ts +6 -0
- package/dist/components/ReorderableTable/ReorderableTable.d.ts.map +1 -1
- package/dist/components/ReorderableTable/ReorderableTable.js +91 -80
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts +1 -0
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts.map +1 -1
- package/dist/muza-ui.css +1 -1
- package/package.json +1 -1
|
@@ -1,61 +1,62 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { motion as
|
|
4
|
-
import { ReorderableGroup as
|
|
5
|
-
import { Reorder as
|
|
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
|
|
8
|
-
const
|
|
9
|
-
data:
|
|
10
|
-
onReorder:
|
|
11
|
-
onSync:
|
|
12
|
-
syncDelay:
|
|
13
|
-
onSyncPendingChange:
|
|
14
|
-
onDragStart:
|
|
15
|
-
onDragEnd:
|
|
16
|
-
columns:
|
|
17
|
-
showHeader:
|
|
18
|
-
disabled:
|
|
19
|
-
isRowDisabled:
|
|
20
|
-
className:
|
|
21
|
-
isMovable:
|
|
22
|
-
animateItems:
|
|
23
|
-
layout:
|
|
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
|
-
},
|
|
26
|
+
}, j) => /* @__PURE__ */ e("div", { className: "w-full", children: /* @__PURE__ */ h(
|
|
26
27
|
"table",
|
|
27
28
|
{
|
|
28
|
-
ref:
|
|
29
|
+
ref: j,
|
|
29
30
|
className: d(
|
|
30
31
|
"-my-sm w-full border-separate border-spacing-y-sm",
|
|
31
|
-
|
|
32
|
+
H
|
|
32
33
|
),
|
|
33
34
|
...C,
|
|
34
35
|
children: [
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
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
|
-
|
|
48
|
+
o.className
|
|
48
49
|
),
|
|
49
|
-
children:
|
|
50
|
+
children: o.title
|
|
50
51
|
},
|
|
51
|
-
|
|
52
|
+
a
|
|
52
53
|
)),
|
|
53
54
|
/* @__PURE__ */ e(
|
|
54
|
-
|
|
55
|
+
l.th,
|
|
55
56
|
{
|
|
56
57
|
initial: !1,
|
|
57
58
|
animate: {
|
|
58
|
-
width:
|
|
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
|
-
|
|
67
|
+
k,
|
|
67
68
|
{
|
|
68
|
-
values:
|
|
69
|
-
onReorder:
|
|
70
|
-
onSync:
|
|
71
|
-
syncDelay:
|
|
72
|
-
onSyncPendingChange:
|
|
73
|
-
onDragStart:
|
|
74
|
-
onDragEnd:
|
|
75
|
-
disabled:
|
|
76
|
-
animatePresence:
|
|
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: (
|
|
80
|
-
const
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
-
|
|
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:
|
|
85
|
+
value: a,
|
|
85
86
|
as: "tr",
|
|
86
|
-
layout:
|
|
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
|
-
|
|
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
|
-
|
|
93
|
-
const
|
|
101
|
+
c.map((r, s) => {
|
|
102
|
+
const P = s === 0, y = s === c.length - 1;
|
|
94
103
|
return /* @__PURE__ */ e(
|
|
95
|
-
|
|
104
|
+
l.td,
|
|
96
105
|
{
|
|
97
106
|
initial: !1,
|
|
98
|
-
animate:
|
|
99
|
-
paddingRight:
|
|
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
|
-
|
|
113
|
+
y ? "pl-comp-table-p" : "px-comp-table-p",
|
|
105
114
|
{
|
|
106
|
-
"rounded-l-xl border-l":
|
|
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
|
-
|
|
118
|
+
r.className
|
|
110
119
|
),
|
|
111
|
-
children:
|
|
112
|
-
r
|
|
113
|
-
|
|
114
|
-
|
|
120
|
+
children: r.render ? r.render(
|
|
121
|
+
a[r.dataKey],
|
|
122
|
+
a,
|
|
123
|
+
p
|
|
115
124
|
) : /* @__PURE__ */ e(
|
|
116
|
-
|
|
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":
|
|
126
|
-
"line-clamp-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
|
|
138
|
+
children: a[r.dataKey]
|
|
130
139
|
}
|
|
131
140
|
)
|
|
132
141
|
},
|
|
133
|
-
|
|
142
|
+
s
|
|
134
143
|
);
|
|
135
144
|
}),
|
|
136
145
|
/* @__PURE__ */ e(
|
|
137
|
-
|
|
146
|
+
l.td,
|
|
138
147
|
{
|
|
148
|
+
"data-reorder-handle": !0,
|
|
139
149
|
initial: !1,
|
|
140
150
|
animate: {
|
|
141
|
-
width:
|
|
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
|
-
|
|
162
|
+
l.div,
|
|
152
163
|
{
|
|
153
164
|
initial: !1,
|
|
154
165
|
animate: {
|
|
155
|
-
opacity:
|
|
156
|
-
width:
|
|
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
|
-
|
|
172
|
+
z,
|
|
162
173
|
{
|
|
163
|
-
disabled: !
|
|
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(
|
|
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
|
-
|
|
188
|
+
a.id
|
|
178
189
|
);
|
|
179
190
|
})
|
|
180
191
|
}
|
|
181
192
|
)
|
|
182
193
|
]
|
|
183
194
|
}
|
|
184
|
-
) }),
|
|
185
|
-
|
|
195
|
+
) }), V = S(F);
|
|
196
|
+
V.displayName = "ReorderableTable";
|
|
186
197
|
export {
|
|
187
|
-
|
|
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;
|
|
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"}
|