@camtomlabs/malix-design-system 0.1.2 → 0.1.3
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/LICENSE +19 -5
- package/dist/index.cjs +2338 -0
- package/dist/index.d.cts +524 -0
- package/dist/index.d.ts +524 -0
- package/dist/index.js +2251 -0
- package/package.json +21 -8
- package/src/components/Accordion.tsx +0 -52
- package/src/components/Avatar.tsx +0 -18
- package/src/components/Badge.tsx +0 -27
- package/src/components/Banner.tsx +0 -75
- package/src/components/Breadcrumb.tsx +0 -58
- package/src/components/Button.tsx +0 -47
- package/src/components/Card.tsx +0 -34
- package/src/components/ChatInput.tsx +0 -53
- package/src/components/Checkbox.tsx +0 -85
- package/src/components/CreditsIndicator.tsx +0 -41
- package/src/components/DataTable.tsx +0 -75
- package/src/components/DateInput.tsx +0 -57
- package/src/components/Divider.tsx +0 -12
- package/src/components/Dropzone.tsx +0 -94
- package/src/components/EmptyState.tsx +0 -65
- package/src/components/FileCard.tsx +0 -78
- package/src/components/FilterTabs.tsx +0 -49
- package/src/components/FlyoutMenu.tsx +0 -36
- package/src/components/GlassPopover.tsx +0 -38
- package/src/components/Header.tsx +0 -22
- package/src/components/Input.tsx +0 -18
- package/src/components/InputGroup.tsx +0 -37
- package/src/components/LanguageSelector.tsx +0 -81
- package/src/components/Modal.tsx +0 -104
- package/src/components/OnboardingPopover.tsx +0 -61
- package/src/components/OperationStatus.tsx +0 -73
- package/src/components/Overlay.tsx +0 -66
- package/src/components/Pagination.tsx +0 -89
- package/src/components/Pill.tsx +0 -19
- package/src/components/PricingCard.tsx +0 -74
- package/src/components/ProgressBar.tsx +0 -47
- package/src/components/Radio.tsx +0 -56
- package/src/components/SectionHeader.tsx +0 -32
- package/src/components/SegmentedControl.tsx +0 -42
- package/src/components/Select.tsx +0 -62
- package/src/components/SelectGroup.tsx +0 -32
- package/src/components/SelectionCard.tsx +0 -47
- package/src/components/SidebarItem.tsx +0 -27
- package/src/components/SidebarPanel.tsx +0 -84
- package/src/components/SplitPane.tsx +0 -85
- package/src/components/StatCard.tsx +0 -64
- package/src/components/StatusDot.tsx +0 -26
- package/src/components/Stepper.tsx +0 -40
- package/src/components/TabBar.tsx +0 -45
- package/src/components/Textarea.tsx +0 -43
- package/src/components/Toggle.tsx +0 -50
- package/src/components/Tooltip.tsx +0 -33
- package/src/components/UserProfilePopover.tsx +0 -100
- package/src/components/ValidationAlert.tsx +0 -72
- package/src/index.ts +0 -177
package/dist/index.js
ADDED
|
@@ -0,0 +1,2251 @@
|
|
|
1
|
+
// src/tokens.registry.json
|
|
2
|
+
var tokens_registry_default = {
|
|
3
|
+
version: 1,
|
|
4
|
+
tokens: [
|
|
5
|
+
"--malix-background-main",
|
|
6
|
+
"--malix-surface",
|
|
7
|
+
"--malix-surface-secondary",
|
|
8
|
+
"--malix-surface-hover",
|
|
9
|
+
"--malix-foreground",
|
|
10
|
+
"--malix-foreground-secondary",
|
|
11
|
+
"--malix-foreground-tertiary",
|
|
12
|
+
"--malix-foreground-disabled",
|
|
13
|
+
"--malix-border",
|
|
14
|
+
"--malix-border-strong",
|
|
15
|
+
"--malix-border-focus",
|
|
16
|
+
"--malix-overlay",
|
|
17
|
+
"--malix-cta-primary-bg",
|
|
18
|
+
"--malix-primary-hover",
|
|
19
|
+
"--malix-primary-active",
|
|
20
|
+
"--malix-primary-foreground",
|
|
21
|
+
"--malix-primary-light",
|
|
22
|
+
"--malix-success",
|
|
23
|
+
"--malix-success-light",
|
|
24
|
+
"--malix-success-foreground",
|
|
25
|
+
"--malix-warning",
|
|
26
|
+
"--malix-warning-light",
|
|
27
|
+
"--malix-warning-foreground",
|
|
28
|
+
"--malix-error",
|
|
29
|
+
"--malix-error-light",
|
|
30
|
+
"--malix-error-foreground",
|
|
31
|
+
"--malix-info",
|
|
32
|
+
"--malix-info-light",
|
|
33
|
+
"--malix-info-foreground",
|
|
34
|
+
"--malix-glass-bg",
|
|
35
|
+
"--malix-glass-border",
|
|
36
|
+
"--malix-glass-blur",
|
|
37
|
+
"--malix-sidebar-bg",
|
|
38
|
+
"--malix-sidebar-hover-bg",
|
|
39
|
+
"--malix-sidebar-active-bg",
|
|
40
|
+
"--malix-space-xs",
|
|
41
|
+
"--malix-space-sm",
|
|
42
|
+
"--malix-space-md",
|
|
43
|
+
"--malix-space-lg",
|
|
44
|
+
"--malix-space-xl",
|
|
45
|
+
"--malix-space-2xl",
|
|
46
|
+
"--malix-space-3xl",
|
|
47
|
+
"--malix-radius-sm",
|
|
48
|
+
"--malix-radius-md",
|
|
49
|
+
"--malix-radius-lg",
|
|
50
|
+
"--malix-radius-xl",
|
|
51
|
+
"--malix-radius-pill",
|
|
52
|
+
"--malix-text-xs",
|
|
53
|
+
"--malix-text-sm",
|
|
54
|
+
"--malix-text-base",
|
|
55
|
+
"--malix-text-lg",
|
|
56
|
+
"--malix-text-xl",
|
|
57
|
+
"--malix-text-2xl",
|
|
58
|
+
"--malix-font-body",
|
|
59
|
+
"--malix-font-heading",
|
|
60
|
+
"--malix-weight-normal",
|
|
61
|
+
"--malix-weight-medium",
|
|
62
|
+
"--malix-weight-semibold",
|
|
63
|
+
"--malix-weight-bold",
|
|
64
|
+
"--malix-shadow-btn-primary",
|
|
65
|
+
"--malix-shadow-btn-secondary",
|
|
66
|
+
"--malix-shadow-input",
|
|
67
|
+
"--malix-shadow-depth",
|
|
68
|
+
"--malix-shadow-card-l1",
|
|
69
|
+
"--malix-shadow-card-l2",
|
|
70
|
+
"--malix-shadow-card-l3",
|
|
71
|
+
"--malix-shadow-overlay",
|
|
72
|
+
"--malix-shadow-tooltip",
|
|
73
|
+
"--malix-shadow-sidebar",
|
|
74
|
+
"--malix-shadow-header"
|
|
75
|
+
]
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// src/components/Divider.tsx
|
|
79
|
+
import { jsx } from "react/jsx-runtime";
|
|
80
|
+
function Divider({ className, ...props }) {
|
|
81
|
+
return /* @__PURE__ */ jsx(
|
|
82
|
+
"hr",
|
|
83
|
+
{
|
|
84
|
+
className: `malix-divider${className ? ` ${className}` : ""}`,
|
|
85
|
+
...props
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// src/components/Avatar.tsx
|
|
91
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
92
|
+
function Avatar({ initials, size = 40, className, style, ...props }) {
|
|
93
|
+
return /* @__PURE__ */ jsx2(
|
|
94
|
+
"span",
|
|
95
|
+
{
|
|
96
|
+
className: `malix-avatar${className ? ` ${className}` : ""}`,
|
|
97
|
+
style: { width: size, height: size, borderRadius: size * 0.35, ...style },
|
|
98
|
+
...props,
|
|
99
|
+
children: /* @__PURE__ */ jsx2("span", { className: "malix-avatar__text", children: initials })
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// src/components/Pill.tsx
|
|
105
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
106
|
+
function Pill({ variant = "default", children, className, ...props }) {
|
|
107
|
+
return /* @__PURE__ */ jsx3(
|
|
108
|
+
"span",
|
|
109
|
+
{
|
|
110
|
+
className: `malix-pill${className ? ` ${className}` : ""}`,
|
|
111
|
+
"data-variant": variant,
|
|
112
|
+
...props,
|
|
113
|
+
children
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// src/components/Button.tsx
|
|
119
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
120
|
+
function Button({
|
|
121
|
+
hierarchy = "primary",
|
|
122
|
+
variant = "text",
|
|
123
|
+
icon,
|
|
124
|
+
badge,
|
|
125
|
+
loading = false,
|
|
126
|
+
disabled,
|
|
127
|
+
children,
|
|
128
|
+
label,
|
|
129
|
+
...props
|
|
130
|
+
}) {
|
|
131
|
+
const isDisabled = disabled || loading;
|
|
132
|
+
const isIconOnly = variant === "icon-only";
|
|
133
|
+
return /* @__PURE__ */ jsxs(
|
|
134
|
+
"button",
|
|
135
|
+
{
|
|
136
|
+
type: "button",
|
|
137
|
+
className: "malix-button",
|
|
138
|
+
"data-hierarchy": hierarchy,
|
|
139
|
+
"data-variant": variant,
|
|
140
|
+
"data-loading": loading,
|
|
141
|
+
disabled: isDisabled,
|
|
142
|
+
"aria-busy": loading || void 0,
|
|
143
|
+
"aria-label": isIconOnly ? label : props["aria-label"],
|
|
144
|
+
...props,
|
|
145
|
+
children: [
|
|
146
|
+
icon ? /* @__PURE__ */ jsx4("span", { className: "malix-button__icon", children: icon }) : null,
|
|
147
|
+
!isIconOnly ? /* @__PURE__ */ jsx4("span", { children: loading ? "Loading..." : children }) : null,
|
|
148
|
+
variant === "icon-badge" && badge ? /* @__PURE__ */ jsx4("span", { className: "malix-button__badge", children: badge }) : null,
|
|
149
|
+
isIconOnly && !icon ? /* @__PURE__ */ jsx4("span", { children: loading ? "..." : label }) : null
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// src/components/Input.tsx
|
|
156
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
157
|
+
function Input({ leadingIcon, ...props }) {
|
|
158
|
+
return /* @__PURE__ */ jsxs2("label", { className: "malix-input-wrap", children: [
|
|
159
|
+
leadingIcon ? /* @__PURE__ */ jsx5("span", { className: "malix-button__icon", children: leadingIcon }) : null,
|
|
160
|
+
/* @__PURE__ */ jsx5("input", { className: "malix-input", ...props })
|
|
161
|
+
] });
|
|
162
|
+
}
|
|
163
|
+
function SearchInput(props) {
|
|
164
|
+
return /* @__PURE__ */ jsx5(Input, { type: "search", placeholder: "Search", ...props });
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// src/components/InputGroup.tsx
|
|
168
|
+
import React from "react";
|
|
169
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
170
|
+
function InputGroup({
|
|
171
|
+
label,
|
|
172
|
+
helperText,
|
|
173
|
+
leadingIcon,
|
|
174
|
+
error,
|
|
175
|
+
id,
|
|
176
|
+
className,
|
|
177
|
+
...props
|
|
178
|
+
}) {
|
|
179
|
+
const inputId = id || `input-${React.useId()}`;
|
|
180
|
+
return /* @__PURE__ */ jsxs3("div", { className: `malix-input-group${className ? ` ${className}` : ""}`, "data-error": error || void 0, children: [
|
|
181
|
+
label ? /* @__PURE__ */ jsx6("label", { htmlFor: inputId, className: "malix-input-group__label", children: label }) : null,
|
|
182
|
+
/* @__PURE__ */ jsxs3("div", { className: "malix-input-group__field", children: [
|
|
183
|
+
leadingIcon ? /* @__PURE__ */ jsx6("span", { className: "malix-input-group__icon", children: leadingIcon }) : null,
|
|
184
|
+
/* @__PURE__ */ jsx6("input", { id: inputId, className: "malix-input", ...props })
|
|
185
|
+
] }),
|
|
186
|
+
helperText ? /* @__PURE__ */ jsx6("span", { className: "malix-input-group__helper", children: helperText }) : null
|
|
187
|
+
] });
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// src/components/Tooltip.tsx
|
|
191
|
+
import React2, { useId, useState } from "react";
|
|
192
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
193
|
+
function Tooltip({ content, children, placement = "top" }) {
|
|
194
|
+
const [open, setOpen] = useState(false);
|
|
195
|
+
const tooltipId = useId();
|
|
196
|
+
return /* @__PURE__ */ jsxs4(
|
|
197
|
+
"span",
|
|
198
|
+
{
|
|
199
|
+
className: "malix-tooltip-wrap",
|
|
200
|
+
onMouseEnter: () => setOpen(true),
|
|
201
|
+
onMouseLeave: () => setOpen(false),
|
|
202
|
+
onFocus: () => setOpen(true),
|
|
203
|
+
onBlur: () => setOpen(false),
|
|
204
|
+
children: [
|
|
205
|
+
React2.cloneElement(children, {
|
|
206
|
+
"aria-describedby": open ? tooltipId : void 0
|
|
207
|
+
}),
|
|
208
|
+
open ? /* @__PURE__ */ jsx7("span", { role: "tooltip", id: tooltipId, className: "malix-tooltip", "data-placement": placement, children: content }) : null
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// src/components/SidebarItem.tsx
|
|
215
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
216
|
+
function SidebarItem({
|
|
217
|
+
icon,
|
|
218
|
+
active = false,
|
|
219
|
+
children,
|
|
220
|
+
className,
|
|
221
|
+
...props
|
|
222
|
+
}) {
|
|
223
|
+
return /* @__PURE__ */ jsxs5(
|
|
224
|
+
"button",
|
|
225
|
+
{
|
|
226
|
+
type: "button",
|
|
227
|
+
className: `malix-sidebar-item${className ? ` ${className}` : ""}`,
|
|
228
|
+
"data-active": active || void 0,
|
|
229
|
+
"aria-current": active ? "page" : void 0,
|
|
230
|
+
...props,
|
|
231
|
+
children: [
|
|
232
|
+
icon ? /* @__PURE__ */ jsx8("span", { className: "malix-sidebar-item__icon", children: icon }) : null,
|
|
233
|
+
/* @__PURE__ */ jsx8("span", { className: "malix-sidebar-item__label", children })
|
|
234
|
+
]
|
|
235
|
+
}
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// src/components/FlyoutMenu.tsx
|
|
240
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
241
|
+
function FlyoutMenu({ items, className, ...props }) {
|
|
242
|
+
return /* @__PURE__ */ jsx9(
|
|
243
|
+
"nav",
|
|
244
|
+
{
|
|
245
|
+
className: `malix-flyout-menu${className ? ` ${className}` : ""}`,
|
|
246
|
+
role: "menu",
|
|
247
|
+
...props,
|
|
248
|
+
children: items.map((item, i) => /* @__PURE__ */ jsxs6(
|
|
249
|
+
"button",
|
|
250
|
+
{
|
|
251
|
+
type: "button",
|
|
252
|
+
className: "malix-flyout-menu__item",
|
|
253
|
+
"data-active": item.active || void 0,
|
|
254
|
+
role: "menuitem",
|
|
255
|
+
onClick: item.onClick,
|
|
256
|
+
children: [
|
|
257
|
+
item.icon ? /* @__PURE__ */ jsx9("span", { className: "malix-flyout-menu__icon", children: item.icon }) : null,
|
|
258
|
+
/* @__PURE__ */ jsx9("span", { className: "malix-flyout-menu__label", children: item.label })
|
|
259
|
+
]
|
|
260
|
+
},
|
|
261
|
+
i
|
|
262
|
+
))
|
|
263
|
+
}
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// src/components/SidebarPanel.tsx
|
|
268
|
+
import { useState as useState2 } from "react";
|
|
269
|
+
import { Fragment, jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
270
|
+
function SidebarPanel({
|
|
271
|
+
collapsed = false,
|
|
272
|
+
logo,
|
|
273
|
+
collapsedLogo,
|
|
274
|
+
navigation,
|
|
275
|
+
footer,
|
|
276
|
+
onToggleCollapse,
|
|
277
|
+
className,
|
|
278
|
+
...props
|
|
279
|
+
}) {
|
|
280
|
+
const [hovered, setHovered] = useState2(false);
|
|
281
|
+
return /* @__PURE__ */ jsxs7(
|
|
282
|
+
"aside",
|
|
283
|
+
{
|
|
284
|
+
className: `malix-sidebar-panel${className ? ` ${className}` : ""}`,
|
|
285
|
+
"data-collapsed": collapsed || void 0,
|
|
286
|
+
onMouseEnter: collapsed ? () => setHovered(true) : void 0,
|
|
287
|
+
onMouseLeave: collapsed ? () => setHovered(false) : void 0,
|
|
288
|
+
...props,
|
|
289
|
+
children: [
|
|
290
|
+
/* @__PURE__ */ jsxs7("div", { className: "malix-sidebar-panel__top", children: [
|
|
291
|
+
/* @__PURE__ */ jsx10("div", { className: "malix-sidebar-panel__brand", children: collapsed ? (
|
|
292
|
+
/* Collapsed: show isotype by default, toggle button on hover */
|
|
293
|
+
hovered && onToggleCollapse ? /* @__PURE__ */ jsx10(
|
|
294
|
+
"button",
|
|
295
|
+
{
|
|
296
|
+
type: "button",
|
|
297
|
+
className: "malix-sidebar-panel__toggle",
|
|
298
|
+
onClick: onToggleCollapse,
|
|
299
|
+
"aria-label": "Expand sidebar",
|
|
300
|
+
children: /* @__PURE__ */ jsxs7("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
301
|
+
/* @__PURE__ */ jsx10("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
302
|
+
/* @__PURE__ */ jsx10("path", { d: "M9 3v18" }),
|
|
303
|
+
/* @__PURE__ */ jsx10("path", { d: "m14 9 3 3-3 3" })
|
|
304
|
+
] })
|
|
305
|
+
}
|
|
306
|
+
) : /* @__PURE__ */ jsx10("span", { className: "malix-sidebar-panel__collapsed-logo", children: collapsedLogo ?? logo })
|
|
307
|
+
) : (
|
|
308
|
+
/* Expanded: logo + toggle button */
|
|
309
|
+
/* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
310
|
+
logo,
|
|
311
|
+
onToggleCollapse ? /* @__PURE__ */ jsx10(
|
|
312
|
+
"button",
|
|
313
|
+
{
|
|
314
|
+
type: "button",
|
|
315
|
+
className: "malix-sidebar-panel__toggle",
|
|
316
|
+
onClick: onToggleCollapse,
|
|
317
|
+
"aria-label": "Collapse sidebar",
|
|
318
|
+
children: /* @__PURE__ */ jsxs7("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
319
|
+
/* @__PURE__ */ jsx10("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
320
|
+
/* @__PURE__ */ jsx10("path", { d: "M9 3v18" }),
|
|
321
|
+
/* @__PURE__ */ jsx10("path", { d: "m16 15-3-3 3-3" })
|
|
322
|
+
] })
|
|
323
|
+
}
|
|
324
|
+
) : null
|
|
325
|
+
] })
|
|
326
|
+
) }),
|
|
327
|
+
/* @__PURE__ */ jsx10("nav", { className: "malix-sidebar-panel__nav", children: navigation })
|
|
328
|
+
] }),
|
|
329
|
+
footer ? /* @__PURE__ */ jsx10("div", { className: "malix-sidebar-panel__bottom", children: footer }) : null
|
|
330
|
+
]
|
|
331
|
+
}
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// src/components/Header.tsx
|
|
336
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
337
|
+
function Header({ pageTitle, actions, className, ...props }) {
|
|
338
|
+
return /* @__PURE__ */ jsxs8(
|
|
339
|
+
"header",
|
|
340
|
+
{
|
|
341
|
+
className: `malix-header${className ? ` ${className}` : ""}`,
|
|
342
|
+
...props,
|
|
343
|
+
children: [
|
|
344
|
+
/* @__PURE__ */ jsx11("div", { className: "malix-header__left", children: /* @__PURE__ */ jsx11("h1", { className: "malix-header__title", children: pageTitle }) }),
|
|
345
|
+
actions ? /* @__PURE__ */ jsx11("div", { className: "malix-header__right", children: actions }) : null
|
|
346
|
+
]
|
|
347
|
+
}
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// src/components/Card.tsx
|
|
352
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
353
|
+
function Card({
|
|
354
|
+
level = 1,
|
|
355
|
+
title,
|
|
356
|
+
description,
|
|
357
|
+
children,
|
|
358
|
+
className,
|
|
359
|
+
...props
|
|
360
|
+
}) {
|
|
361
|
+
return /* @__PURE__ */ jsxs9(
|
|
362
|
+
"div",
|
|
363
|
+
{
|
|
364
|
+
className: `malix-card${className ? ` ${className}` : ""}`,
|
|
365
|
+
"data-level": level,
|
|
366
|
+
...props,
|
|
367
|
+
children: [
|
|
368
|
+
title || description ? /* @__PURE__ */ jsxs9("div", { className: "malix-card__header", children: [
|
|
369
|
+
title ? /* @__PURE__ */ jsx12("h3", { className: "malix-card__title", children: title }) : null,
|
|
370
|
+
description ? /* @__PURE__ */ jsx12("p", { className: "malix-card__desc", children: description }) : null
|
|
371
|
+
] }) : null,
|
|
372
|
+
children ? /* @__PURE__ */ jsx12("div", { className: "malix-card__body", children }) : null
|
|
373
|
+
]
|
|
374
|
+
}
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// src/components/StatCard.tsx
|
|
379
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
380
|
+
function ChangeIcon({ type }) {
|
|
381
|
+
const shared = { width: 12, height: 12, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" };
|
|
382
|
+
switch (type) {
|
|
383
|
+
case "positive":
|
|
384
|
+
return /* @__PURE__ */ jsxs10("svg", { ...shared, children: [
|
|
385
|
+
/* @__PURE__ */ jsx13("polyline", { points: "22 7 13.5 15.5 8.5 10.5 2 17" }),
|
|
386
|
+
/* @__PURE__ */ jsx13("polyline", { points: "16 7 22 7 22 13" })
|
|
387
|
+
] });
|
|
388
|
+
case "negative":
|
|
389
|
+
return /* @__PURE__ */ jsxs10("svg", { ...shared, children: [
|
|
390
|
+
/* @__PURE__ */ jsx13("polyline", { points: "22 17 13.5 8.5 8.5 13.5 2 7" }),
|
|
391
|
+
/* @__PURE__ */ jsx13("polyline", { points: "16 17 22 17 22 11" })
|
|
392
|
+
] });
|
|
393
|
+
case "neutral":
|
|
394
|
+
return /* @__PURE__ */ jsx13("svg", { ...shared, children: /* @__PURE__ */ jsx13("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) });
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
function StatCard({
|
|
398
|
+
label,
|
|
399
|
+
value,
|
|
400
|
+
change,
|
|
401
|
+
changeType = "neutral",
|
|
402
|
+
className,
|
|
403
|
+
...props
|
|
404
|
+
}) {
|
|
405
|
+
return /* @__PURE__ */ jsxs10(
|
|
406
|
+
"div",
|
|
407
|
+
{
|
|
408
|
+
className: `malix-stat-card${className ? ` ${className}` : ""}`,
|
|
409
|
+
...props,
|
|
410
|
+
children: [
|
|
411
|
+
/* @__PURE__ */ jsx13("span", { className: "malix-stat-card__label", children: label }),
|
|
412
|
+
/* @__PURE__ */ jsx13("span", { className: "malix-stat-card__value", children: value }),
|
|
413
|
+
change ? /* @__PURE__ */ jsxs10("span", { className: "malix-stat-card__change", "data-type": changeType, children: [
|
|
414
|
+
/* @__PURE__ */ jsx13("span", { className: "malix-stat-card__change-icon", children: /* @__PURE__ */ jsx13(ChangeIcon, { type: changeType }) }),
|
|
415
|
+
change
|
|
416
|
+
] }) : null
|
|
417
|
+
]
|
|
418
|
+
}
|
|
419
|
+
);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
// src/components/DateInput.tsx
|
|
423
|
+
import React4 from "react";
|
|
424
|
+
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
425
|
+
function DateInput({
|
|
426
|
+
value,
|
|
427
|
+
placeholder = "dd/mm/yyyy",
|
|
428
|
+
onChange,
|
|
429
|
+
disabled,
|
|
430
|
+
className,
|
|
431
|
+
id,
|
|
432
|
+
...props
|
|
433
|
+
}) {
|
|
434
|
+
const inputId = id || `date-input-${React4.useId()}`;
|
|
435
|
+
const handleChange = (e) => {
|
|
436
|
+
onChange?.(e.target.value);
|
|
437
|
+
};
|
|
438
|
+
return /* @__PURE__ */ jsxs11(
|
|
439
|
+
"div",
|
|
440
|
+
{
|
|
441
|
+
className: `malix-date-input${className ? ` ${className}` : ""}`,
|
|
442
|
+
"data-filled": value ? true : void 0,
|
|
443
|
+
"data-disabled": disabled || void 0,
|
|
444
|
+
children: [
|
|
445
|
+
/* @__PURE__ */ jsx14(
|
|
446
|
+
"input",
|
|
447
|
+
{
|
|
448
|
+
id: inputId,
|
|
449
|
+
type: "date",
|
|
450
|
+
className: "malix-date-input__native",
|
|
451
|
+
value,
|
|
452
|
+
onChange: handleChange,
|
|
453
|
+
disabled,
|
|
454
|
+
"aria-label": placeholder,
|
|
455
|
+
...props
|
|
456
|
+
}
|
|
457
|
+
),
|
|
458
|
+
/* @__PURE__ */ jsx14("span", { className: "malix-date-input__value", children: value || placeholder }),
|
|
459
|
+
/* @__PURE__ */ jsx14("span", { className: "malix-date-input__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx14("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx14(
|
|
460
|
+
"path",
|
|
461
|
+
{
|
|
462
|
+
d: "M12.667 2.667H3.333C2.597 2.667 2 3.264 2 4v9.333c0 .737.597 1.334 1.333 1.334h9.334c.736 0 1.333-.597 1.333-1.334V4c0-.736-.597-1.333-1.333-1.333ZM10.667 1.333V4M5.333 1.333V4M2 6.667h12",
|
|
463
|
+
stroke: "currentColor",
|
|
464
|
+
strokeWidth: "1.33",
|
|
465
|
+
strokeLinecap: "round",
|
|
466
|
+
strokeLinejoin: "round"
|
|
467
|
+
}
|
|
468
|
+
) }) })
|
|
469
|
+
]
|
|
470
|
+
}
|
|
471
|
+
);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
// src/components/FilterTabs.tsx
|
|
475
|
+
import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
476
|
+
function FilterTabs({
|
|
477
|
+
items,
|
|
478
|
+
value,
|
|
479
|
+
onChange,
|
|
480
|
+
className,
|
|
481
|
+
...props
|
|
482
|
+
}) {
|
|
483
|
+
return /* @__PURE__ */ jsx15(
|
|
484
|
+
"div",
|
|
485
|
+
{
|
|
486
|
+
className: `malix-filter-tabs${className ? ` ${className}` : ""}`,
|
|
487
|
+
role: "tablist",
|
|
488
|
+
...props,
|
|
489
|
+
children: items.map((item) => {
|
|
490
|
+
const isActive = item.value === value;
|
|
491
|
+
return /* @__PURE__ */ jsxs12(
|
|
492
|
+
"button",
|
|
493
|
+
{
|
|
494
|
+
type: "button",
|
|
495
|
+
role: "tab",
|
|
496
|
+
className: "malix-filter-tabs__tab",
|
|
497
|
+
"data-active": isActive || void 0,
|
|
498
|
+
"aria-selected": isActive,
|
|
499
|
+
onClick: () => onChange(item.value),
|
|
500
|
+
children: [
|
|
501
|
+
/* @__PURE__ */ jsx15("span", { className: "malix-filter-tabs__tab-label", children: item.label }),
|
|
502
|
+
item.count != null ? /* @__PURE__ */ jsx15("span", { className: "malix-filter-tabs__tab-count", children: item.count }) : null
|
|
503
|
+
]
|
|
504
|
+
},
|
|
505
|
+
item.value
|
|
506
|
+
);
|
|
507
|
+
})
|
|
508
|
+
}
|
|
509
|
+
);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
// src/components/Breadcrumb.tsx
|
|
513
|
+
import React5 from "react";
|
|
514
|
+
import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
515
|
+
var DefaultSeparator = () => /* @__PURE__ */ jsx16("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx16("path", { d: "M6 3L11 8L6 13", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
516
|
+
function Breadcrumb({ items, separator, className, ...props }) {
|
|
517
|
+
return /* @__PURE__ */ jsx16(
|
|
518
|
+
"nav",
|
|
519
|
+
{
|
|
520
|
+
className: `malix-breadcrumb${className ? ` ${className}` : ""}`,
|
|
521
|
+
"aria-label": "Breadcrumb",
|
|
522
|
+
...props,
|
|
523
|
+
children: items.map((item, index) => {
|
|
524
|
+
const isLast = index === items.length - 1;
|
|
525
|
+
const isActive = item.active ?? isLast;
|
|
526
|
+
return /* @__PURE__ */ jsxs13(React5.Fragment, { children: [
|
|
527
|
+
/* @__PURE__ */ jsxs13("span", { className: "malix-breadcrumb__item", "data-active": isActive || void 0, children: [
|
|
528
|
+
item.icon ? /* @__PURE__ */ jsx16("span", { className: "malix-breadcrumb__icon", children: item.icon }) : null,
|
|
529
|
+
isActive || !item.href ? /* @__PURE__ */ jsx16("span", { className: "malix-breadcrumb__label", "aria-current": isActive ? "page" : void 0, children: item.label }) : /* @__PURE__ */ jsx16("a", { className: "malix-breadcrumb__label", href: item.href, children: item.label })
|
|
530
|
+
] }),
|
|
531
|
+
!isLast ? /* @__PURE__ */ jsx16("span", { className: "malix-breadcrumb__separator", "aria-hidden": "true", children: separator ?? /* @__PURE__ */ jsx16(DefaultSeparator, {}) }) : null
|
|
532
|
+
] }, index);
|
|
533
|
+
})
|
|
534
|
+
}
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
// src/components/ProgressBar.tsx
|
|
539
|
+
import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
540
|
+
function ProgressBar({
|
|
541
|
+
value,
|
|
542
|
+
label,
|
|
543
|
+
showPercent = true,
|
|
544
|
+
variant = "default",
|
|
545
|
+
className,
|
|
546
|
+
...props
|
|
547
|
+
}) {
|
|
548
|
+
const clampedValue = Math.max(0, Math.min(100, value));
|
|
549
|
+
return /* @__PURE__ */ jsxs14(
|
|
550
|
+
"div",
|
|
551
|
+
{
|
|
552
|
+
className: `malix-progress-bar${className ? ` ${className}` : ""}`,
|
|
553
|
+
"data-variant": variant,
|
|
554
|
+
role: "progressbar",
|
|
555
|
+
"aria-valuenow": clampedValue,
|
|
556
|
+
"aria-valuemin": 0,
|
|
557
|
+
"aria-valuemax": 100,
|
|
558
|
+
"aria-label": label,
|
|
559
|
+
...props,
|
|
560
|
+
children: [
|
|
561
|
+
label || showPercent ? /* @__PURE__ */ jsxs14("div", { className: "malix-progress-bar__label-row", children: [
|
|
562
|
+
label ? /* @__PURE__ */ jsx17("span", { className: "malix-progress-bar__label", children: label }) : null,
|
|
563
|
+
showPercent ? /* @__PURE__ */ jsxs14("span", { className: "malix-progress-bar__percent", children: [
|
|
564
|
+
clampedValue,
|
|
565
|
+
"%"
|
|
566
|
+
] }) : null
|
|
567
|
+
] }) : null,
|
|
568
|
+
/* @__PURE__ */ jsx17("div", { className: "malix-progress-bar__track", children: /* @__PURE__ */ jsx17(
|
|
569
|
+
"div",
|
|
570
|
+
{
|
|
571
|
+
className: "malix-progress-bar__fill",
|
|
572
|
+
style: { width: `${clampedValue}%` }
|
|
573
|
+
}
|
|
574
|
+
) })
|
|
575
|
+
]
|
|
576
|
+
}
|
|
577
|
+
);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// src/components/EmptyState.tsx
|
|
581
|
+
import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
582
|
+
var DefaultIcon = () => /* @__PURE__ */ jsxs15("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
583
|
+
/* @__PURE__ */ jsx18(
|
|
584
|
+
"path",
|
|
585
|
+
{
|
|
586
|
+
d: "M3 7V5C3 3.895 3.895 3 5 3H9L11 5H19C20.105 5 21 5.895 21 7V9",
|
|
587
|
+
stroke: "currentColor",
|
|
588
|
+
strokeWidth: "1.5",
|
|
589
|
+
strokeLinecap: "round",
|
|
590
|
+
strokeLinejoin: "round"
|
|
591
|
+
}
|
|
592
|
+
),
|
|
593
|
+
/* @__PURE__ */ jsx18(
|
|
594
|
+
"rect",
|
|
595
|
+
{
|
|
596
|
+
x: "2",
|
|
597
|
+
y: "9",
|
|
598
|
+
width: "20",
|
|
599
|
+
height: "12",
|
|
600
|
+
rx: "2",
|
|
601
|
+
stroke: "currentColor",
|
|
602
|
+
strokeWidth: "1.5",
|
|
603
|
+
strokeLinecap: "round",
|
|
604
|
+
strokeLinejoin: "round"
|
|
605
|
+
}
|
|
606
|
+
),
|
|
607
|
+
/* @__PURE__ */ jsx18(
|
|
608
|
+
"path",
|
|
609
|
+
{
|
|
610
|
+
d: "M9 15H15",
|
|
611
|
+
stroke: "currentColor",
|
|
612
|
+
strokeWidth: "1.5",
|
|
613
|
+
strokeLinecap: "round",
|
|
614
|
+
strokeLinejoin: "round"
|
|
615
|
+
}
|
|
616
|
+
)
|
|
617
|
+
] });
|
|
618
|
+
function EmptyState({
|
|
619
|
+
icon,
|
|
620
|
+
title,
|
|
621
|
+
description,
|
|
622
|
+
action,
|
|
623
|
+
className,
|
|
624
|
+
...props
|
|
625
|
+
}) {
|
|
626
|
+
return /* @__PURE__ */ jsxs15(
|
|
627
|
+
"div",
|
|
628
|
+
{
|
|
629
|
+
className: `malix-empty-state${className ? ` ${className}` : ""}`,
|
|
630
|
+
...props,
|
|
631
|
+
children: [
|
|
632
|
+
/* @__PURE__ */ jsx18("div", { className: "malix-empty-state__icon-wrap", children: icon ?? /* @__PURE__ */ jsx18(DefaultIcon, {}) }),
|
|
633
|
+
/* @__PURE__ */ jsx18("h3", { className: "malix-empty-state__title", children: title }),
|
|
634
|
+
description ? /* @__PURE__ */ jsx18("p", { className: "malix-empty-state__description", children: description }) : null,
|
|
635
|
+
action ? /* @__PURE__ */ jsx18("div", { className: "malix-empty-state__action", children: action }) : null
|
|
636
|
+
]
|
|
637
|
+
}
|
|
638
|
+
);
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
// src/components/Stepper.tsx
|
|
642
|
+
import React6 from "react";
|
|
643
|
+
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
644
|
+
function Stepper({ steps, className }) {
|
|
645
|
+
return /* @__PURE__ */ jsx19("div", { className: `malix-stepper${className ? ` ${className}` : ""}`, children: steps.map((step, index) => /* @__PURE__ */ jsxs16(React6.Fragment, { children: [
|
|
646
|
+
/* @__PURE__ */ jsxs16("div", { className: "malix-stepper__step", "data-status": step.status, children: [
|
|
647
|
+
/* @__PURE__ */ jsx19("span", { className: "malix-stepper__step-icon", children: step.status === "completed" ? /* @__PURE__ */ jsx19("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx19("path", { d: "M11.5 3.5L5.5 10L2.5 7", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) : step.icon ?? null }),
|
|
648
|
+
/* @__PURE__ */ jsx19("span", { className: "malix-stepper__step-label", children: step.label })
|
|
649
|
+
] }),
|
|
650
|
+
index < steps.length - 1 ? /* @__PURE__ */ jsx19("span", { className: "malix-stepper__connector" }) : null
|
|
651
|
+
] }, index)) });
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
// src/components/Textarea.tsx
|
|
655
|
+
import React7 from "react";
|
|
656
|
+
import { jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
657
|
+
function Textarea({
|
|
658
|
+
label,
|
|
659
|
+
helperText,
|
|
660
|
+
error,
|
|
661
|
+
errorMessage,
|
|
662
|
+
id,
|
|
663
|
+
className,
|
|
664
|
+
...props
|
|
665
|
+
}) {
|
|
666
|
+
const textareaId = id || `textarea-${React7.useId()}`;
|
|
667
|
+
const displayHelper = error && errorMessage ? errorMessage : helperText;
|
|
668
|
+
return /* @__PURE__ */ jsxs17(
|
|
669
|
+
"div",
|
|
670
|
+
{
|
|
671
|
+
className: `malix-textarea-group${className ? ` ${className}` : ""}`,
|
|
672
|
+
"data-error": error || void 0,
|
|
673
|
+
children: [
|
|
674
|
+
label ? /* @__PURE__ */ jsx20("label", { htmlFor: textareaId, className: "malix-textarea-group__label", children: label }) : null,
|
|
675
|
+
/* @__PURE__ */ jsx20(
|
|
676
|
+
"textarea",
|
|
677
|
+
{
|
|
678
|
+
id: textareaId,
|
|
679
|
+
className: "malix-textarea-group__field",
|
|
680
|
+
"aria-invalid": error || void 0,
|
|
681
|
+
...props
|
|
682
|
+
}
|
|
683
|
+
),
|
|
684
|
+
displayHelper ? /* @__PURE__ */ jsx20("span", { className: "malix-textarea-group__helper", children: displayHelper }) : null
|
|
685
|
+
]
|
|
686
|
+
}
|
|
687
|
+
);
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
// src/components/ChatInput.tsx
|
|
691
|
+
import { jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
692
|
+
function ChatInput({
|
|
693
|
+
value,
|
|
694
|
+
onChange,
|
|
695
|
+
onSend,
|
|
696
|
+
placeholder = "Type a message...",
|
|
697
|
+
disabled,
|
|
698
|
+
className
|
|
699
|
+
}) {
|
|
700
|
+
const handleKeyDown = (e) => {
|
|
701
|
+
if (e.key === "Enter" && !e.shiftKey && value.trim()) {
|
|
702
|
+
e.preventDefault();
|
|
703
|
+
onSend();
|
|
704
|
+
}
|
|
705
|
+
};
|
|
706
|
+
return /* @__PURE__ */ jsxs18("div", { className: `malix-chat-input${className ? ` ${className}` : ""}`, children: [
|
|
707
|
+
/* @__PURE__ */ jsx21(
|
|
708
|
+
"input",
|
|
709
|
+
{
|
|
710
|
+
type: "text",
|
|
711
|
+
className: "malix-chat-input__field",
|
|
712
|
+
value,
|
|
713
|
+
onChange: (e) => onChange(e.target.value),
|
|
714
|
+
onKeyDown: handleKeyDown,
|
|
715
|
+
placeholder,
|
|
716
|
+
disabled,
|
|
717
|
+
"aria-label": placeholder
|
|
718
|
+
}
|
|
719
|
+
),
|
|
720
|
+
/* @__PURE__ */ jsx21(
|
|
721
|
+
"button",
|
|
722
|
+
{
|
|
723
|
+
type: "button",
|
|
724
|
+
className: "malix-chat-input__send-btn",
|
|
725
|
+
onClick: onSend,
|
|
726
|
+
disabled: disabled || !value.trim(),
|
|
727
|
+
"aria-label": "Send message",
|
|
728
|
+
children: /* @__PURE__ */ jsxs18("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
729
|
+
/* @__PURE__ */ jsx21("path", { d: "M12 19V5" }),
|
|
730
|
+
/* @__PURE__ */ jsx21("path", { d: "m5 12 7-7 7 7" })
|
|
731
|
+
] })
|
|
732
|
+
}
|
|
733
|
+
)
|
|
734
|
+
] });
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
// src/components/SectionHeader.tsx
|
|
738
|
+
import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
739
|
+
function SectionHeader({
|
|
740
|
+
title,
|
|
741
|
+
description,
|
|
742
|
+
actions,
|
|
743
|
+
className,
|
|
744
|
+
...props
|
|
745
|
+
}) {
|
|
746
|
+
return /* @__PURE__ */ jsxs19(
|
|
747
|
+
"div",
|
|
748
|
+
{
|
|
749
|
+
className: `malix-section-header${className ? ` ${className}` : ""}`,
|
|
750
|
+
...props,
|
|
751
|
+
children: [
|
|
752
|
+
/* @__PURE__ */ jsxs19("div", { className: "malix-section-header__left", children: [
|
|
753
|
+
/* @__PURE__ */ jsx22("h2", { className: "malix-section-header__title", children: title }),
|
|
754
|
+
description ? /* @__PURE__ */ jsx22("p", { className: "malix-section-header__description", children: description }) : null
|
|
755
|
+
] }),
|
|
756
|
+
actions ? /* @__PURE__ */ jsx22("div", { className: "malix-section-header__actions", children: actions }) : null
|
|
757
|
+
]
|
|
758
|
+
}
|
|
759
|
+
);
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
// src/components/FileCard.tsx
|
|
763
|
+
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
764
|
+
var DefaultFileIcon = () => /* @__PURE__ */ jsxs20(
|
|
765
|
+
"svg",
|
|
766
|
+
{
|
|
767
|
+
width: "20",
|
|
768
|
+
height: "20",
|
|
769
|
+
viewBox: "0 0 24 24",
|
|
770
|
+
fill: "none",
|
|
771
|
+
stroke: "currentColor",
|
|
772
|
+
strokeWidth: "2",
|
|
773
|
+
strokeLinecap: "round",
|
|
774
|
+
strokeLinejoin: "round",
|
|
775
|
+
children: [
|
|
776
|
+
/* @__PURE__ */ jsx23("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
777
|
+
/* @__PURE__ */ jsx23("polyline", { points: "14 2 14 8 20 8" }),
|
|
778
|
+
/* @__PURE__ */ jsx23("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
|
|
779
|
+
/* @__PURE__ */ jsx23("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
|
|
780
|
+
/* @__PURE__ */ jsx23("polyline", { points: "10 9 9 9 8 9" })
|
|
781
|
+
]
|
|
782
|
+
}
|
|
783
|
+
);
|
|
784
|
+
var MoreVerticalIcon = () => /* @__PURE__ */ jsxs20(
|
|
785
|
+
"svg",
|
|
786
|
+
{
|
|
787
|
+
width: "16",
|
|
788
|
+
height: "16",
|
|
789
|
+
viewBox: "0 0 24 24",
|
|
790
|
+
fill: "currentColor",
|
|
791
|
+
children: [
|
|
792
|
+
/* @__PURE__ */ jsx23("circle", { cx: "12", cy: "5", r: "1.5" }),
|
|
793
|
+
/* @__PURE__ */ jsx23("circle", { cx: "12", cy: "12", r: "1.5" }),
|
|
794
|
+
/* @__PURE__ */ jsx23("circle", { cx: "12", cy: "19", r: "1.5" })
|
|
795
|
+
]
|
|
796
|
+
}
|
|
797
|
+
);
|
|
798
|
+
function FileCard({
|
|
799
|
+
fileName,
|
|
800
|
+
meta,
|
|
801
|
+
icon,
|
|
802
|
+
onAction,
|
|
803
|
+
className,
|
|
804
|
+
...props
|
|
805
|
+
}) {
|
|
806
|
+
return /* @__PURE__ */ jsxs20(
|
|
807
|
+
"div",
|
|
808
|
+
{
|
|
809
|
+
className: `malix-file-card${className ? ` ${className}` : ""}`,
|
|
810
|
+
...props,
|
|
811
|
+
children: [
|
|
812
|
+
/* @__PURE__ */ jsx23("div", { className: "malix-file-card__icon-wrap", children: /* @__PURE__ */ jsx23("span", { className: "malix-file-card__icon", children: icon ?? /* @__PURE__ */ jsx23(DefaultFileIcon, {}) }) }),
|
|
813
|
+
/* @__PURE__ */ jsxs20("div", { className: "malix-file-card__info", children: [
|
|
814
|
+
/* @__PURE__ */ jsx23("span", { className: "malix-file-card__name", children: fileName }),
|
|
815
|
+
meta ? /* @__PURE__ */ jsx23("span", { className: "malix-file-card__meta", children: meta }) : null
|
|
816
|
+
] }),
|
|
817
|
+
onAction ? /* @__PURE__ */ jsx23(
|
|
818
|
+
"button",
|
|
819
|
+
{
|
|
820
|
+
type: "button",
|
|
821
|
+
className: "malix-file-card__action",
|
|
822
|
+
onClick: onAction,
|
|
823
|
+
"aria-label": "More actions",
|
|
824
|
+
children: /* @__PURE__ */ jsx23(MoreVerticalIcon, {})
|
|
825
|
+
}
|
|
826
|
+
) : null
|
|
827
|
+
]
|
|
828
|
+
}
|
|
829
|
+
);
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
// src/components/TabBar.tsx
|
|
833
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
834
|
+
function TabBar({
|
|
835
|
+
items,
|
|
836
|
+
value,
|
|
837
|
+
onChange,
|
|
838
|
+
className,
|
|
839
|
+
...props
|
|
840
|
+
}) {
|
|
841
|
+
return /* @__PURE__ */ jsx24(
|
|
842
|
+
"div",
|
|
843
|
+
{
|
|
844
|
+
className: `malix-tab-bar${className ? ` ${className}` : ""}`,
|
|
845
|
+
role: "tablist",
|
|
846
|
+
...props,
|
|
847
|
+
children: items.map((item) => {
|
|
848
|
+
const isActive = item.value === value;
|
|
849
|
+
return /* @__PURE__ */ jsx24(
|
|
850
|
+
"button",
|
|
851
|
+
{
|
|
852
|
+
type: "button",
|
|
853
|
+
role: "tab",
|
|
854
|
+
className: "malix-tab-bar__tab",
|
|
855
|
+
"data-active": isActive || void 0,
|
|
856
|
+
"aria-selected": isActive,
|
|
857
|
+
onClick: () => onChange(item.value),
|
|
858
|
+
children: /* @__PURE__ */ jsx24("span", { className: "malix-tab-bar__tab-label", children: item.label })
|
|
859
|
+
},
|
|
860
|
+
item.value
|
|
861
|
+
);
|
|
862
|
+
})
|
|
863
|
+
}
|
|
864
|
+
);
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
// src/components/OperationStatus.tsx
|
|
868
|
+
import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
869
|
+
var DEFAULT_LABELS = {
|
|
870
|
+
active: "Active",
|
|
871
|
+
completed: "Completed",
|
|
872
|
+
failed: "Failed",
|
|
873
|
+
pending: "Pending"
|
|
874
|
+
};
|
|
875
|
+
function StatusIcon({ status }) {
|
|
876
|
+
const shared = { width: 14, height: 14, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" };
|
|
877
|
+
switch (status) {
|
|
878
|
+
case "active":
|
|
879
|
+
return /* @__PURE__ */ jsx25("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx25("circle", { cx: "7", cy: "7", r: "4" }) });
|
|
880
|
+
case "completed":
|
|
881
|
+
return /* @__PURE__ */ jsxs21("svg", { ...shared, children: [
|
|
882
|
+
/* @__PURE__ */ jsx25("circle", { cx: "12", cy: "12", r: "10" }),
|
|
883
|
+
/* @__PURE__ */ jsx25("path", { d: "m9 12 2 2 4-4" })
|
|
884
|
+
] });
|
|
885
|
+
case "failed":
|
|
886
|
+
return /* @__PURE__ */ jsxs21("svg", { ...shared, children: [
|
|
887
|
+
/* @__PURE__ */ jsx25("circle", { cx: "12", cy: "12", r: "10" }),
|
|
888
|
+
/* @__PURE__ */ jsx25("path", { d: "m15 9-6 6" }),
|
|
889
|
+
/* @__PURE__ */ jsx25("path", { d: "m9 9 6 6" })
|
|
890
|
+
] });
|
|
891
|
+
case "pending":
|
|
892
|
+
return /* @__PURE__ */ jsxs21("svg", { ...shared, children: [
|
|
893
|
+
/* @__PURE__ */ jsx25("circle", { cx: "12", cy: "12", r: "10" }),
|
|
894
|
+
/* @__PURE__ */ jsx25("polyline", { points: "12 6 12 12 16 14" })
|
|
895
|
+
] });
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
function OperationStatus({
|
|
899
|
+
status,
|
|
900
|
+
label,
|
|
901
|
+
className,
|
|
902
|
+
...props
|
|
903
|
+
}) {
|
|
904
|
+
return /* @__PURE__ */ jsxs21(
|
|
905
|
+
"span",
|
|
906
|
+
{
|
|
907
|
+
className: `malix-op-status${className ? ` ${className}` : ""}`,
|
|
908
|
+
"data-status": status,
|
|
909
|
+
...props,
|
|
910
|
+
children: [
|
|
911
|
+
/* @__PURE__ */ jsx25("span", { className: "malix-op-status__icon", children: /* @__PURE__ */ jsx25(StatusIcon, { status }) }),
|
|
912
|
+
/* @__PURE__ */ jsx25("span", { className: "malix-op-status__label", children: label ?? DEFAULT_LABELS[status] })
|
|
913
|
+
]
|
|
914
|
+
}
|
|
915
|
+
);
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
// src/components/ValidationAlert.tsx
|
|
919
|
+
import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
920
|
+
function AlertIcon({ variant }) {
|
|
921
|
+
const shared = { width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" };
|
|
922
|
+
switch (variant) {
|
|
923
|
+
case "error":
|
|
924
|
+
case "warning":
|
|
925
|
+
return /* @__PURE__ */ jsxs22("svg", { ...shared, children: [
|
|
926
|
+
/* @__PURE__ */ jsx26("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z" }),
|
|
927
|
+
/* @__PURE__ */ jsx26("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
928
|
+
/* @__PURE__ */ jsx26("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
929
|
+
] });
|
|
930
|
+
case "info":
|
|
931
|
+
return /* @__PURE__ */ jsxs22("svg", { ...shared, children: [
|
|
932
|
+
/* @__PURE__ */ jsx26("circle", { cx: "12", cy: "12", r: "10" }),
|
|
933
|
+
/* @__PURE__ */ jsx26("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
934
|
+
/* @__PURE__ */ jsx26("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
935
|
+
] });
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
function ValidationAlert({
|
|
939
|
+
title,
|
|
940
|
+
message,
|
|
941
|
+
onClose,
|
|
942
|
+
variant = "error",
|
|
943
|
+
className
|
|
944
|
+
}) {
|
|
945
|
+
return /* @__PURE__ */ jsxs22(
|
|
946
|
+
"div",
|
|
947
|
+
{
|
|
948
|
+
className: `malix-validation-alert${className ? ` ${className}` : ""}`,
|
|
949
|
+
"data-variant": variant,
|
|
950
|
+
role: "alert",
|
|
951
|
+
children: [
|
|
952
|
+
/* @__PURE__ */ jsx26("span", { className: "malix-validation-alert__icon", children: /* @__PURE__ */ jsx26(AlertIcon, { variant }) }),
|
|
953
|
+
/* @__PURE__ */ jsxs22("div", { className: "malix-validation-alert__content", children: [
|
|
954
|
+
/* @__PURE__ */ jsx26("span", { className: "malix-validation-alert__title", children: title }),
|
|
955
|
+
/* @__PURE__ */ jsx26("span", { className: "malix-validation-alert__message", children: message })
|
|
956
|
+
] }),
|
|
957
|
+
onClose ? /* @__PURE__ */ jsx26(
|
|
958
|
+
"button",
|
|
959
|
+
{
|
|
960
|
+
type: "button",
|
|
961
|
+
className: "malix-validation-alert__close",
|
|
962
|
+
onClick: onClose,
|
|
963
|
+
"aria-label": "Close",
|
|
964
|
+
children: /* @__PURE__ */ jsxs22("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
965
|
+
/* @__PURE__ */ jsx26("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
966
|
+
/* @__PURE__ */ jsx26("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
967
|
+
] })
|
|
968
|
+
}
|
|
969
|
+
) : null
|
|
970
|
+
]
|
|
971
|
+
}
|
|
972
|
+
);
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
// src/components/SelectionCard.tsx
|
|
976
|
+
import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
977
|
+
function SelectionCard({
|
|
978
|
+
title,
|
|
979
|
+
description,
|
|
980
|
+
icon,
|
|
981
|
+
active = false,
|
|
982
|
+
onClick,
|
|
983
|
+
className
|
|
984
|
+
}) {
|
|
985
|
+
return /* @__PURE__ */ jsxs23(
|
|
986
|
+
"div",
|
|
987
|
+
{
|
|
988
|
+
className: `malix-selection-card${className ? ` ${className}` : ""}`,
|
|
989
|
+
"data-active": active || void 0,
|
|
990
|
+
onClick,
|
|
991
|
+
role: onClick ? "button" : void 0,
|
|
992
|
+
tabIndex: onClick ? 0 : void 0,
|
|
993
|
+
onKeyDown: onClick ? (e) => {
|
|
994
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
995
|
+
e.preventDefault();
|
|
996
|
+
onClick();
|
|
997
|
+
}
|
|
998
|
+
} : void 0,
|
|
999
|
+
children: [
|
|
1000
|
+
icon ? /* @__PURE__ */ jsx27("span", { className: "malix-selection-card__icon-wrap", children: icon }) : null,
|
|
1001
|
+
/* @__PURE__ */ jsx27("span", { className: "malix-selection-card__title", children: title }),
|
|
1002
|
+
description ? /* @__PURE__ */ jsx27("span", { className: "malix-selection-card__description", children: description }) : null
|
|
1003
|
+
]
|
|
1004
|
+
}
|
|
1005
|
+
);
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
// src/components/Overlay.tsx
|
|
1009
|
+
import { useEffect, useRef } from "react";
|
|
1010
|
+
import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1011
|
+
var FOCUSABLE_SELECTOR = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
|
1012
|
+
function Overlay({ open, title, onClose, children }) {
|
|
1013
|
+
const panelRef = useRef(null);
|
|
1014
|
+
useEffect(() => {
|
|
1015
|
+
if (!open || !panelRef.current) return;
|
|
1016
|
+
const panel = panelRef.current;
|
|
1017
|
+
const focusables = Array.from(panel.querySelectorAll(FOCUSABLE_SELECTOR));
|
|
1018
|
+
const first = focusables[0];
|
|
1019
|
+
const last = focusables[focusables.length - 1];
|
|
1020
|
+
first?.focus();
|
|
1021
|
+
function onKeyDown(event) {
|
|
1022
|
+
if (event.key === "Escape") {
|
|
1023
|
+
event.preventDefault();
|
|
1024
|
+
onClose();
|
|
1025
|
+
}
|
|
1026
|
+
if (event.key === "Tab" && focusables.length > 0) {
|
|
1027
|
+
if (event.shiftKey && document.activeElement === first) {
|
|
1028
|
+
event.preventDefault();
|
|
1029
|
+
last?.focus();
|
|
1030
|
+
} else if (!event.shiftKey && document.activeElement === last) {
|
|
1031
|
+
event.preventDefault();
|
|
1032
|
+
first?.focus();
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
document.addEventListener("keydown", onKeyDown);
|
|
1037
|
+
return () => document.removeEventListener("keydown", onKeyDown);
|
|
1038
|
+
}, [open, onClose]);
|
|
1039
|
+
if (!open) return null;
|
|
1040
|
+
return /* @__PURE__ */ jsx28("div", { className: "malix-overlay-backdrop", onMouseDown: onClose, children: /* @__PURE__ */ jsxs24(
|
|
1041
|
+
"div",
|
|
1042
|
+
{
|
|
1043
|
+
ref: panelRef,
|
|
1044
|
+
className: "malix-overlay-panel",
|
|
1045
|
+
role: "dialog",
|
|
1046
|
+
"aria-modal": "true",
|
|
1047
|
+
"aria-label": title,
|
|
1048
|
+
onMouseDown: (event) => event.stopPropagation(),
|
|
1049
|
+
children: [
|
|
1050
|
+
/* @__PURE__ */ jsx28("h2", { className: "malix-overlay-title", children: title }),
|
|
1051
|
+
children,
|
|
1052
|
+
/* @__PURE__ */ jsx28("button", { type: "button", className: "malix-button malix-overlay-close", "data-hierarchy": "secondary", onClick: onClose, children: "Close" })
|
|
1053
|
+
]
|
|
1054
|
+
}
|
|
1055
|
+
) });
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
// src/components/Modal.tsx
|
|
1059
|
+
import { useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
1060
|
+
import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1061
|
+
var FOCUSABLE_SELECTOR2 = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
|
1062
|
+
function Modal({
|
|
1063
|
+
open,
|
|
1064
|
+
title,
|
|
1065
|
+
onClose,
|
|
1066
|
+
onConfirm,
|
|
1067
|
+
confirmLabel = "Confirm",
|
|
1068
|
+
cancelLabel = "Cancel",
|
|
1069
|
+
children
|
|
1070
|
+
}) {
|
|
1071
|
+
const panelRef = useRef2(null);
|
|
1072
|
+
useEffect2(() => {
|
|
1073
|
+
if (!open || !panelRef.current) return;
|
|
1074
|
+
const panel = panelRef.current;
|
|
1075
|
+
const focusables = Array.from(panel.querySelectorAll(FOCUSABLE_SELECTOR2));
|
|
1076
|
+
const first = focusables[0];
|
|
1077
|
+
const last = focusables[focusables.length - 1];
|
|
1078
|
+
first?.focus();
|
|
1079
|
+
function onKeyDown(event) {
|
|
1080
|
+
if (event.key === "Escape") {
|
|
1081
|
+
event.preventDefault();
|
|
1082
|
+
onClose();
|
|
1083
|
+
}
|
|
1084
|
+
if (event.key === "Tab" && focusables.length > 0) {
|
|
1085
|
+
if (event.shiftKey && document.activeElement === first) {
|
|
1086
|
+
event.preventDefault();
|
|
1087
|
+
last?.focus();
|
|
1088
|
+
} else if (!event.shiftKey && document.activeElement === last) {
|
|
1089
|
+
event.preventDefault();
|
|
1090
|
+
first?.focus();
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
document.addEventListener("keydown", onKeyDown);
|
|
1095
|
+
return () => document.removeEventListener("keydown", onKeyDown);
|
|
1096
|
+
}, [open, onClose]);
|
|
1097
|
+
if (!open) return null;
|
|
1098
|
+
return /* @__PURE__ */ jsx29("div", { className: "malix-overlay-backdrop", onMouseDown: onClose, children: /* @__PURE__ */ jsxs25(
|
|
1099
|
+
"div",
|
|
1100
|
+
{
|
|
1101
|
+
ref: panelRef,
|
|
1102
|
+
className: "malix-modal",
|
|
1103
|
+
role: "dialog",
|
|
1104
|
+
"aria-modal": "true",
|
|
1105
|
+
"aria-label": title,
|
|
1106
|
+
onMouseDown: (event) => event.stopPropagation(),
|
|
1107
|
+
children: [
|
|
1108
|
+
/* @__PURE__ */ jsxs25("div", { className: "malix-modal__header", children: [
|
|
1109
|
+
/* @__PURE__ */ jsx29("h2", { className: "malix-modal__title", children: title }),
|
|
1110
|
+
/* @__PURE__ */ jsx29(
|
|
1111
|
+
"button",
|
|
1112
|
+
{
|
|
1113
|
+
type: "button",
|
|
1114
|
+
className: "malix-modal__close",
|
|
1115
|
+
onClick: onClose,
|
|
1116
|
+
"aria-label": "Close",
|
|
1117
|
+
children: /* @__PURE__ */ jsxs25("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1118
|
+
/* @__PURE__ */ jsx29("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1119
|
+
/* @__PURE__ */ jsx29("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1120
|
+
] })
|
|
1121
|
+
}
|
|
1122
|
+
)
|
|
1123
|
+
] }),
|
|
1124
|
+
/* @__PURE__ */ jsx29("div", { className: "malix-modal__body", children }),
|
|
1125
|
+
/* @__PURE__ */ jsxs25("div", { className: "malix-modal__footer", children: [
|
|
1126
|
+
/* @__PURE__ */ jsx29(
|
|
1127
|
+
"button",
|
|
1128
|
+
{
|
|
1129
|
+
type: "button",
|
|
1130
|
+
className: "malix-button",
|
|
1131
|
+
"data-hierarchy": "secondary",
|
|
1132
|
+
onClick: onClose,
|
|
1133
|
+
children: /* @__PURE__ */ jsx29("span", { children: cancelLabel })
|
|
1134
|
+
}
|
|
1135
|
+
),
|
|
1136
|
+
onConfirm ? /* @__PURE__ */ jsx29(
|
|
1137
|
+
"button",
|
|
1138
|
+
{
|
|
1139
|
+
type: "button",
|
|
1140
|
+
className: "malix-button",
|
|
1141
|
+
"data-hierarchy": "primary",
|
|
1142
|
+
onClick: onConfirm,
|
|
1143
|
+
children: /* @__PURE__ */ jsx29("span", { children: confirmLabel })
|
|
1144
|
+
}
|
|
1145
|
+
) : null
|
|
1146
|
+
] })
|
|
1147
|
+
]
|
|
1148
|
+
}
|
|
1149
|
+
) });
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
// src/components/GlassPopover.tsx
|
|
1153
|
+
import { jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
1154
|
+
function GlassPopover({
|
|
1155
|
+
title,
|
|
1156
|
+
onClose,
|
|
1157
|
+
children,
|
|
1158
|
+
className,
|
|
1159
|
+
...props
|
|
1160
|
+
}) {
|
|
1161
|
+
return /* @__PURE__ */ jsxs26(
|
|
1162
|
+
"div",
|
|
1163
|
+
{
|
|
1164
|
+
className: `malix-glass-popover${className ? ` ${className}` : ""}`,
|
|
1165
|
+
...props,
|
|
1166
|
+
children: [
|
|
1167
|
+
title || onClose ? /* @__PURE__ */ jsxs26("div", { className: "malix-glass-popover__header", children: [
|
|
1168
|
+
title ? /* @__PURE__ */ jsx30("span", { className: "malix-glass-popover__title", children: title }) : null,
|
|
1169
|
+
onClose ? /* @__PURE__ */ jsx30(
|
|
1170
|
+
"button",
|
|
1171
|
+
{
|
|
1172
|
+
type: "button",
|
|
1173
|
+
className: "malix-glass-popover__close",
|
|
1174
|
+
onClick: onClose,
|
|
1175
|
+
"aria-label": "Close",
|
|
1176
|
+
children: /* @__PURE__ */ jsxs26("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1177
|
+
/* @__PURE__ */ jsx30("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1178
|
+
/* @__PURE__ */ jsx30("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1179
|
+
] })
|
|
1180
|
+
}
|
|
1181
|
+
) : null
|
|
1182
|
+
] }) : null,
|
|
1183
|
+
/* @__PURE__ */ jsx30("div", { className: "malix-glass-popover__body", children })
|
|
1184
|
+
]
|
|
1185
|
+
}
|
|
1186
|
+
);
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
// src/components/Accordion.tsx
|
|
1190
|
+
import { useState as useState3 } from "react";
|
|
1191
|
+
import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
1192
|
+
function Accordion({
|
|
1193
|
+
title,
|
|
1194
|
+
children,
|
|
1195
|
+
defaultOpen = false,
|
|
1196
|
+
icon,
|
|
1197
|
+
className,
|
|
1198
|
+
...props
|
|
1199
|
+
}) {
|
|
1200
|
+
const [open, setOpen] = useState3(defaultOpen);
|
|
1201
|
+
return /* @__PURE__ */ jsxs27(
|
|
1202
|
+
"div",
|
|
1203
|
+
{
|
|
1204
|
+
className: `malix-accordion${className ? ` ${className}` : ""}`,
|
|
1205
|
+
"data-open": open,
|
|
1206
|
+
...props,
|
|
1207
|
+
children: [
|
|
1208
|
+
/* @__PURE__ */ jsxs27(
|
|
1209
|
+
"button",
|
|
1210
|
+
{
|
|
1211
|
+
type: "button",
|
|
1212
|
+
className: "malix-accordion__header",
|
|
1213
|
+
onClick: () => setOpen((prev) => !prev),
|
|
1214
|
+
"aria-expanded": open,
|
|
1215
|
+
children: [
|
|
1216
|
+
icon ? /* @__PURE__ */ jsx31("span", { className: "malix-accordion__icon", children: icon }) : null,
|
|
1217
|
+
/* @__PURE__ */ jsx31("span", { className: "malix-accordion__title", children: title }),
|
|
1218
|
+
/* @__PURE__ */ jsx31(
|
|
1219
|
+
"svg",
|
|
1220
|
+
{
|
|
1221
|
+
className: "malix-accordion__chevron",
|
|
1222
|
+
width: "16",
|
|
1223
|
+
height: "16",
|
|
1224
|
+
viewBox: "0 0 24 24",
|
|
1225
|
+
fill: "none",
|
|
1226
|
+
stroke: "currentColor",
|
|
1227
|
+
strokeWidth: "2",
|
|
1228
|
+
strokeLinecap: "round",
|
|
1229
|
+
strokeLinejoin: "round",
|
|
1230
|
+
"aria-hidden": "true",
|
|
1231
|
+
children: /* @__PURE__ */ jsx31("polyline", { points: "6 9 12 15 18 9" })
|
|
1232
|
+
}
|
|
1233
|
+
)
|
|
1234
|
+
]
|
|
1235
|
+
}
|
|
1236
|
+
),
|
|
1237
|
+
/* @__PURE__ */ jsx31("div", { className: "malix-accordion__body", children })
|
|
1238
|
+
]
|
|
1239
|
+
}
|
|
1240
|
+
);
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
// src/components/Badge.tsx
|
|
1244
|
+
import { jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
1245
|
+
function Badge({
|
|
1246
|
+
variant = "default",
|
|
1247
|
+
dot = false,
|
|
1248
|
+
children,
|
|
1249
|
+
className,
|
|
1250
|
+
...props
|
|
1251
|
+
}) {
|
|
1252
|
+
return /* @__PURE__ */ jsxs28(
|
|
1253
|
+
"span",
|
|
1254
|
+
{
|
|
1255
|
+
className: `malix-badge${className ? ` ${className}` : ""}`,
|
|
1256
|
+
"data-variant": variant,
|
|
1257
|
+
...props,
|
|
1258
|
+
children: [
|
|
1259
|
+
dot ? /* @__PURE__ */ jsx32("span", { className: "malix-badge__dot" }) : null,
|
|
1260
|
+
/* @__PURE__ */ jsx32("span", { className: "malix-badge__label", children })
|
|
1261
|
+
]
|
|
1262
|
+
}
|
|
1263
|
+
);
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
// src/components/Banner.tsx
|
|
1267
|
+
import { jsx as jsx33, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
1268
|
+
var defaultIcons = {
|
|
1269
|
+
info: /* @__PURE__ */ jsxs29("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1270
|
+
/* @__PURE__ */ jsx33("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1271
|
+
/* @__PURE__ */ jsx33("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
1272
|
+
/* @__PURE__ */ jsx33("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
1273
|
+
] }),
|
|
1274
|
+
success: /* @__PURE__ */ jsxs29("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1275
|
+
/* @__PURE__ */ jsx33("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
|
|
1276
|
+
/* @__PURE__ */ jsx33("polyline", { points: "22 4 12 14.01 9 11.01" })
|
|
1277
|
+
] }),
|
|
1278
|
+
warning: /* @__PURE__ */ jsxs29("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1279
|
+
/* @__PURE__ */ jsx33("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
|
|
1280
|
+
/* @__PURE__ */ jsx33("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
1281
|
+
/* @__PURE__ */ jsx33("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
1282
|
+
] }),
|
|
1283
|
+
error: /* @__PURE__ */ jsxs29("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1284
|
+
/* @__PURE__ */ jsx33("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1285
|
+
/* @__PURE__ */ jsx33("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
|
|
1286
|
+
/* @__PURE__ */ jsx33("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
|
|
1287
|
+
] })
|
|
1288
|
+
};
|
|
1289
|
+
function Banner({
|
|
1290
|
+
variant = "info",
|
|
1291
|
+
onClose,
|
|
1292
|
+
icon,
|
|
1293
|
+
children,
|
|
1294
|
+
className,
|
|
1295
|
+
...props
|
|
1296
|
+
}) {
|
|
1297
|
+
return /* @__PURE__ */ jsxs29(
|
|
1298
|
+
"div",
|
|
1299
|
+
{
|
|
1300
|
+
className: `malix-banner${className ? ` ${className}` : ""}`,
|
|
1301
|
+
"data-variant": variant,
|
|
1302
|
+
role: "alert",
|
|
1303
|
+
...props,
|
|
1304
|
+
children: [
|
|
1305
|
+
/* @__PURE__ */ jsx33("span", { className: "malix-banner__icon", children: icon ?? defaultIcons[variant] }),
|
|
1306
|
+
/* @__PURE__ */ jsx33("span", { className: "malix-banner__content", children }),
|
|
1307
|
+
onClose ? /* @__PURE__ */ jsx33(
|
|
1308
|
+
"button",
|
|
1309
|
+
{
|
|
1310
|
+
type: "button",
|
|
1311
|
+
className: "malix-banner__close",
|
|
1312
|
+
onClick: onClose,
|
|
1313
|
+
"aria-label": "Dismiss",
|
|
1314
|
+
children: /* @__PURE__ */ jsxs29("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1315
|
+
/* @__PURE__ */ jsx33("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1316
|
+
/* @__PURE__ */ jsx33("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1317
|
+
] })
|
|
1318
|
+
}
|
|
1319
|
+
) : null
|
|
1320
|
+
]
|
|
1321
|
+
}
|
|
1322
|
+
);
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
// src/components/Checkbox.tsx
|
|
1326
|
+
import { jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
1327
|
+
function Checkbox({
|
|
1328
|
+
checked = false,
|
|
1329
|
+
onChange,
|
|
1330
|
+
disabled = false,
|
|
1331
|
+
label,
|
|
1332
|
+
indeterminate = false,
|
|
1333
|
+
className,
|
|
1334
|
+
...props
|
|
1335
|
+
}) {
|
|
1336
|
+
const handleClick = () => {
|
|
1337
|
+
if (!disabled && onChange) {
|
|
1338
|
+
onChange(!checked);
|
|
1339
|
+
}
|
|
1340
|
+
};
|
|
1341
|
+
const checkbox = /* @__PURE__ */ jsxs30(
|
|
1342
|
+
"button",
|
|
1343
|
+
{
|
|
1344
|
+
type: "button",
|
|
1345
|
+
role: "checkbox",
|
|
1346
|
+
className: `malix-checkbox${className ? ` ${className}` : ""}`,
|
|
1347
|
+
"data-checked": checked,
|
|
1348
|
+
"data-disabled": disabled,
|
|
1349
|
+
"data-indeterminate": indeterminate,
|
|
1350
|
+
"aria-checked": indeterminate ? "mixed" : checked,
|
|
1351
|
+
disabled,
|
|
1352
|
+
onClick: handleClick,
|
|
1353
|
+
...props,
|
|
1354
|
+
children: [
|
|
1355
|
+
checked && !indeterminate ? /* @__PURE__ */ jsx34(
|
|
1356
|
+
"svg",
|
|
1357
|
+
{
|
|
1358
|
+
className: "malix-checkbox__icon",
|
|
1359
|
+
viewBox: "0 0 12 12",
|
|
1360
|
+
fill: "none",
|
|
1361
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1362
|
+
"aria-hidden": "true",
|
|
1363
|
+
children: /* @__PURE__ */ jsx34(
|
|
1364
|
+
"path",
|
|
1365
|
+
{
|
|
1366
|
+
d: "M2 6l3 3 5-5",
|
|
1367
|
+
stroke: "currentColor",
|
|
1368
|
+
strokeWidth: "2",
|
|
1369
|
+
strokeLinecap: "round",
|
|
1370
|
+
strokeLinejoin: "round"
|
|
1371
|
+
}
|
|
1372
|
+
)
|
|
1373
|
+
}
|
|
1374
|
+
) : null,
|
|
1375
|
+
indeterminate ? /* @__PURE__ */ jsx34(
|
|
1376
|
+
"svg",
|
|
1377
|
+
{
|
|
1378
|
+
className: "malix-checkbox__icon",
|
|
1379
|
+
viewBox: "0 0 12 12",
|
|
1380
|
+
fill: "none",
|
|
1381
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1382
|
+
"aria-hidden": "true",
|
|
1383
|
+
children: /* @__PURE__ */ jsx34(
|
|
1384
|
+
"path",
|
|
1385
|
+
{
|
|
1386
|
+
d: "M2 6h8",
|
|
1387
|
+
stroke: "currentColor",
|
|
1388
|
+
strokeWidth: "2",
|
|
1389
|
+
strokeLinecap: "round"
|
|
1390
|
+
}
|
|
1391
|
+
)
|
|
1392
|
+
}
|
|
1393
|
+
) : null
|
|
1394
|
+
]
|
|
1395
|
+
}
|
|
1396
|
+
);
|
|
1397
|
+
if (label) {
|
|
1398
|
+
return /* @__PURE__ */ jsxs30("label", { className: "malix-checkbox-row", children: [
|
|
1399
|
+
checkbox,
|
|
1400
|
+
/* @__PURE__ */ jsx34("span", { className: "malix-checkbox-row__label", children: label })
|
|
1401
|
+
] });
|
|
1402
|
+
}
|
|
1403
|
+
return checkbox;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
// src/components/Radio.tsx
|
|
1407
|
+
import { jsx as jsx35, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
1408
|
+
function Radio({
|
|
1409
|
+
checked = false,
|
|
1410
|
+
onChange,
|
|
1411
|
+
disabled = false,
|
|
1412
|
+
label,
|
|
1413
|
+
name,
|
|
1414
|
+
value,
|
|
1415
|
+
className,
|
|
1416
|
+
...props
|
|
1417
|
+
}) {
|
|
1418
|
+
const handleClick = () => {
|
|
1419
|
+
if (!disabled && onChange) {
|
|
1420
|
+
onChange(value);
|
|
1421
|
+
}
|
|
1422
|
+
};
|
|
1423
|
+
const radio = /* @__PURE__ */ jsx35(
|
|
1424
|
+
"button",
|
|
1425
|
+
{
|
|
1426
|
+
type: "button",
|
|
1427
|
+
role: "radio",
|
|
1428
|
+
className: `malix-radio${className ? ` ${className}` : ""}`,
|
|
1429
|
+
"data-checked": checked,
|
|
1430
|
+
"data-disabled": disabled,
|
|
1431
|
+
"aria-checked": checked,
|
|
1432
|
+
disabled,
|
|
1433
|
+
"data-name": name,
|
|
1434
|
+
"data-value": value,
|
|
1435
|
+
onClick: handleClick,
|
|
1436
|
+
...props,
|
|
1437
|
+
children: /* @__PURE__ */ jsx35("span", { className: "malix-radio__dot" })
|
|
1438
|
+
}
|
|
1439
|
+
);
|
|
1440
|
+
if (label) {
|
|
1441
|
+
return /* @__PURE__ */ jsxs31("label", { className: "malix-radio-row", children: [
|
|
1442
|
+
radio,
|
|
1443
|
+
/* @__PURE__ */ jsx35("span", { className: "malix-radio-row__label", children: label })
|
|
1444
|
+
] });
|
|
1445
|
+
}
|
|
1446
|
+
return radio;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
// src/components/Toggle.tsx
|
|
1450
|
+
import { jsx as jsx36, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
1451
|
+
function Toggle({
|
|
1452
|
+
checked = false,
|
|
1453
|
+
onChange,
|
|
1454
|
+
disabled = false,
|
|
1455
|
+
label,
|
|
1456
|
+
className,
|
|
1457
|
+
...props
|
|
1458
|
+
}) {
|
|
1459
|
+
const handleClick = () => {
|
|
1460
|
+
if (!disabled && onChange) {
|
|
1461
|
+
onChange(!checked);
|
|
1462
|
+
}
|
|
1463
|
+
};
|
|
1464
|
+
const toggle = /* @__PURE__ */ jsx36(
|
|
1465
|
+
"button",
|
|
1466
|
+
{
|
|
1467
|
+
type: "button",
|
|
1468
|
+
role: "switch",
|
|
1469
|
+
className: `malix-toggle${className ? ` ${className}` : ""}`,
|
|
1470
|
+
"data-checked": checked,
|
|
1471
|
+
"data-disabled": disabled,
|
|
1472
|
+
"aria-checked": checked,
|
|
1473
|
+
disabled,
|
|
1474
|
+
onClick: handleClick,
|
|
1475
|
+
...props,
|
|
1476
|
+
children: /* @__PURE__ */ jsx36("span", { className: "malix-toggle__knob" })
|
|
1477
|
+
}
|
|
1478
|
+
);
|
|
1479
|
+
if (label) {
|
|
1480
|
+
return /* @__PURE__ */ jsxs32("div", { className: "malix-toggle-row", children: [
|
|
1481
|
+
/* @__PURE__ */ jsx36("span", { className: "malix-toggle-row__label", children: label }),
|
|
1482
|
+
toggle
|
|
1483
|
+
] });
|
|
1484
|
+
}
|
|
1485
|
+
return toggle;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
// src/components/Select.tsx
|
|
1489
|
+
import { jsx as jsx37, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
1490
|
+
function Select({
|
|
1491
|
+
value,
|
|
1492
|
+
placeholder,
|
|
1493
|
+
options = [],
|
|
1494
|
+
onChange,
|
|
1495
|
+
disabled,
|
|
1496
|
+
filled,
|
|
1497
|
+
className,
|
|
1498
|
+
...props
|
|
1499
|
+
}) {
|
|
1500
|
+
return /* @__PURE__ */ jsxs33(
|
|
1501
|
+
"div",
|
|
1502
|
+
{
|
|
1503
|
+
className: `malix-select${className ? ` ${className}` : ""}`,
|
|
1504
|
+
"data-filled": filled || void 0,
|
|
1505
|
+
"data-disabled": disabled || void 0,
|
|
1506
|
+
children: [
|
|
1507
|
+
/* @__PURE__ */ jsxs33(
|
|
1508
|
+
"select",
|
|
1509
|
+
{
|
|
1510
|
+
className: "malix-select__native",
|
|
1511
|
+
value,
|
|
1512
|
+
disabled,
|
|
1513
|
+
onChange: (e) => onChange?.(e.target.value),
|
|
1514
|
+
...props,
|
|
1515
|
+
children: [
|
|
1516
|
+
placeholder ? /* @__PURE__ */ jsx37("option", { value: "", disabled: true, children: placeholder }) : null,
|
|
1517
|
+
options.map((opt) => /* @__PURE__ */ jsx37("option", { value: opt.value, children: opt.label }, opt.value))
|
|
1518
|
+
]
|
|
1519
|
+
}
|
|
1520
|
+
),
|
|
1521
|
+
/* @__PURE__ */ jsx37("span", { className: "malix-select__icon", children: /* @__PURE__ */ jsx37("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx37(
|
|
1522
|
+
"path",
|
|
1523
|
+
{
|
|
1524
|
+
d: "M4 6L8 10L12 6",
|
|
1525
|
+
stroke: "currentColor",
|
|
1526
|
+
strokeWidth: "1.5",
|
|
1527
|
+
strokeLinecap: "round",
|
|
1528
|
+
strokeLinejoin: "round"
|
|
1529
|
+
}
|
|
1530
|
+
) }) })
|
|
1531
|
+
]
|
|
1532
|
+
}
|
|
1533
|
+
);
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
// src/components/SelectGroup.tsx
|
|
1537
|
+
import { jsx as jsx38, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
1538
|
+
function SelectGroup({
|
|
1539
|
+
label,
|
|
1540
|
+
helperText,
|
|
1541
|
+
error,
|
|
1542
|
+
children,
|
|
1543
|
+
className,
|
|
1544
|
+
...props
|
|
1545
|
+
}) {
|
|
1546
|
+
return /* @__PURE__ */ jsxs34(
|
|
1547
|
+
"div",
|
|
1548
|
+
{
|
|
1549
|
+
className: `malix-select-group${className ? ` ${className}` : ""}`,
|
|
1550
|
+
"data-error": error || void 0,
|
|
1551
|
+
...props,
|
|
1552
|
+
children: [
|
|
1553
|
+
label ? /* @__PURE__ */ jsx38("span", { className: "malix-select-group__label", children: label }) : null,
|
|
1554
|
+
children,
|
|
1555
|
+
helperText ? /* @__PURE__ */ jsx38("span", { className: "malix-select-group__helper", children: helperText }) : null
|
|
1556
|
+
]
|
|
1557
|
+
}
|
|
1558
|
+
);
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
// src/components/SegmentedControl.tsx
|
|
1562
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
1563
|
+
function SegmentedControl({
|
|
1564
|
+
items,
|
|
1565
|
+
value,
|
|
1566
|
+
onChange,
|
|
1567
|
+
className,
|
|
1568
|
+
...props
|
|
1569
|
+
}) {
|
|
1570
|
+
return /* @__PURE__ */ jsx39(
|
|
1571
|
+
"div",
|
|
1572
|
+
{
|
|
1573
|
+
className: `malix-segmented-control${className ? ` ${className}` : ""}`,
|
|
1574
|
+
role: "radiogroup",
|
|
1575
|
+
...props,
|
|
1576
|
+
children: items.map((item) => /* @__PURE__ */ jsx39(
|
|
1577
|
+
"button",
|
|
1578
|
+
{
|
|
1579
|
+
type: "button",
|
|
1580
|
+
className: "malix-segmented-control__item",
|
|
1581
|
+
role: "radio",
|
|
1582
|
+
"aria-checked": item.value === value,
|
|
1583
|
+
"data-active": item.value === value || void 0,
|
|
1584
|
+
onClick: () => onChange(item.value),
|
|
1585
|
+
children: item.label
|
|
1586
|
+
},
|
|
1587
|
+
item.value
|
|
1588
|
+
))
|
|
1589
|
+
}
|
|
1590
|
+
);
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
// src/components/DataTable.tsx
|
|
1594
|
+
import { jsx as jsx40, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
1595
|
+
function DataTable({
|
|
1596
|
+
columns,
|
|
1597
|
+
data,
|
|
1598
|
+
onRowClick,
|
|
1599
|
+
emptyMessage,
|
|
1600
|
+
className,
|
|
1601
|
+
...props
|
|
1602
|
+
}) {
|
|
1603
|
+
return /* @__PURE__ */ jsxs35(
|
|
1604
|
+
"table",
|
|
1605
|
+
{
|
|
1606
|
+
className: `malix-data-table${className ? ` ${className}` : ""}`,
|
|
1607
|
+
...props,
|
|
1608
|
+
children: [
|
|
1609
|
+
/* @__PURE__ */ jsx40("thead", { children: /* @__PURE__ */ jsx40("tr", { className: "malix-data-table__header-row", children: columns.map((col) => /* @__PURE__ */ jsx40(
|
|
1610
|
+
"th",
|
|
1611
|
+
{
|
|
1612
|
+
className: "malix-data-table__header-cell",
|
|
1613
|
+
style: col.width ? { width: col.width } : void 0,
|
|
1614
|
+
children: col.header
|
|
1615
|
+
},
|
|
1616
|
+
col.key
|
|
1617
|
+
)) }) }),
|
|
1618
|
+
/* @__PURE__ */ jsx40("tbody", { className: "malix-data-table__body", children: data.length > 0 ? data.map((row, rowIndex) => /* @__PURE__ */ jsx40(
|
|
1619
|
+
"tr",
|
|
1620
|
+
{
|
|
1621
|
+
className: "malix-data-table__data-row",
|
|
1622
|
+
"data-clickable": onRowClick ? true : void 0,
|
|
1623
|
+
onClick: onRowClick ? () => onRowClick(row) : void 0,
|
|
1624
|
+
children: columns.map((col) => /* @__PURE__ */ jsx40("td", { className: "malix-data-table__cell", children: col.render ? col.render(row[col.key], row) : row[col.key] }, col.key))
|
|
1625
|
+
},
|
|
1626
|
+
rowIndex
|
|
1627
|
+
)) : /* @__PURE__ */ jsx40("tr", { className: "malix-data-table__data-row", children: /* @__PURE__ */ jsx40(
|
|
1628
|
+
"td",
|
|
1629
|
+
{
|
|
1630
|
+
className: "malix-data-table__cell",
|
|
1631
|
+
colSpan: columns.length,
|
|
1632
|
+
children: emptyMessage || "No data available"
|
|
1633
|
+
}
|
|
1634
|
+
) }) })
|
|
1635
|
+
]
|
|
1636
|
+
}
|
|
1637
|
+
);
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
// src/components/Pagination.tsx
|
|
1641
|
+
import { jsx as jsx41, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
1642
|
+
function ChevronLeft() {
|
|
1643
|
+
return /* @__PURE__ */ jsx41("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx41("path", { d: "M10 12L6 8L10 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1644
|
+
}
|
|
1645
|
+
function ChevronRight() {
|
|
1646
|
+
return /* @__PURE__ */ jsx41("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx41("path", { d: "M6 4L10 8L6 12", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1647
|
+
}
|
|
1648
|
+
function Pagination({
|
|
1649
|
+
currentPage,
|
|
1650
|
+
totalPages,
|
|
1651
|
+
onPageChange,
|
|
1652
|
+
variant = "full",
|
|
1653
|
+
className
|
|
1654
|
+
}) {
|
|
1655
|
+
const isFirstPage = currentPage <= 1;
|
|
1656
|
+
const isLastPage = currentPage >= totalPages;
|
|
1657
|
+
const pages = Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
1658
|
+
return /* @__PURE__ */ jsxs36(
|
|
1659
|
+
"nav",
|
|
1660
|
+
{
|
|
1661
|
+
className: `malix-pagination${className ? ` ${className}` : ""}`,
|
|
1662
|
+
"data-variant": variant,
|
|
1663
|
+
"aria-label": "Pagination",
|
|
1664
|
+
children: [
|
|
1665
|
+
/* @__PURE__ */ jsx41(
|
|
1666
|
+
"button",
|
|
1667
|
+
{
|
|
1668
|
+
type: "button",
|
|
1669
|
+
className: "malix-pagination__arrow",
|
|
1670
|
+
"data-disabled": isFirstPage || void 0,
|
|
1671
|
+
disabled: isFirstPage,
|
|
1672
|
+
onClick: () => onPageChange(currentPage - 1),
|
|
1673
|
+
"aria-label": "Previous page",
|
|
1674
|
+
children: /* @__PURE__ */ jsx41(ChevronLeft, {})
|
|
1675
|
+
}
|
|
1676
|
+
),
|
|
1677
|
+
variant === "full" ? pages.map((page) => /* @__PURE__ */ jsx41(
|
|
1678
|
+
"button",
|
|
1679
|
+
{
|
|
1680
|
+
type: "button",
|
|
1681
|
+
className: "malix-pagination__item",
|
|
1682
|
+
"data-active": page === currentPage || void 0,
|
|
1683
|
+
"aria-current": page === currentPage ? "page" : void 0,
|
|
1684
|
+
onClick: () => onPageChange(page),
|
|
1685
|
+
children: page
|
|
1686
|
+
},
|
|
1687
|
+
page
|
|
1688
|
+
)) : /* @__PURE__ */ jsxs36("span", { className: "malix-pagination__label", children: [
|
|
1689
|
+
currentPage,
|
|
1690
|
+
" of ",
|
|
1691
|
+
totalPages
|
|
1692
|
+
] }),
|
|
1693
|
+
/* @__PURE__ */ jsx41(
|
|
1694
|
+
"button",
|
|
1695
|
+
{
|
|
1696
|
+
type: "button",
|
|
1697
|
+
className: "malix-pagination__arrow",
|
|
1698
|
+
"data-disabled": isLastPage || void 0,
|
|
1699
|
+
disabled: isLastPage,
|
|
1700
|
+
onClick: () => onPageChange(currentPage + 1),
|
|
1701
|
+
"aria-label": "Next page",
|
|
1702
|
+
children: /* @__PURE__ */ jsx41(ChevronRight, {})
|
|
1703
|
+
}
|
|
1704
|
+
)
|
|
1705
|
+
]
|
|
1706
|
+
}
|
|
1707
|
+
);
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
// src/components/StatusDot.tsx
|
|
1711
|
+
import { jsx as jsx42, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
1712
|
+
function StatusDot({
|
|
1713
|
+
variant = "default",
|
|
1714
|
+
label,
|
|
1715
|
+
className,
|
|
1716
|
+
...props
|
|
1717
|
+
}) {
|
|
1718
|
+
return /* @__PURE__ */ jsxs37(
|
|
1719
|
+
"span",
|
|
1720
|
+
{
|
|
1721
|
+
className: `malix-status-dot${className ? ` ${className}` : ""}`,
|
|
1722
|
+
"data-variant": variant,
|
|
1723
|
+
...props,
|
|
1724
|
+
children: [
|
|
1725
|
+
/* @__PURE__ */ jsx42("span", { className: "malix-status-dot__dot", "aria-hidden": "true" }),
|
|
1726
|
+
/* @__PURE__ */ jsx42("span", { className: "malix-status-dot__label", children: label })
|
|
1727
|
+
]
|
|
1728
|
+
}
|
|
1729
|
+
);
|
|
1730
|
+
}
|
|
1731
|
+
|
|
1732
|
+
// src/components/Dropzone.tsx
|
|
1733
|
+
import { useRef as useRef3, useState as useState4 } from "react";
|
|
1734
|
+
import { jsx as jsx43, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
1735
|
+
function Dropzone({
|
|
1736
|
+
onDrop,
|
|
1737
|
+
accept,
|
|
1738
|
+
title = "Drop files here",
|
|
1739
|
+
hint = "or click to browse",
|
|
1740
|
+
disabled = false,
|
|
1741
|
+
className,
|
|
1742
|
+
...props
|
|
1743
|
+
}) {
|
|
1744
|
+
const [dragging, setDragging] = useState4(false);
|
|
1745
|
+
const inputRef = useRef3(null);
|
|
1746
|
+
function handleDragOver(event) {
|
|
1747
|
+
event.preventDefault();
|
|
1748
|
+
if (!disabled) setDragging(true);
|
|
1749
|
+
}
|
|
1750
|
+
function handleDragLeave(event) {
|
|
1751
|
+
event.preventDefault();
|
|
1752
|
+
setDragging(false);
|
|
1753
|
+
}
|
|
1754
|
+
function handleDrop(event) {
|
|
1755
|
+
event.preventDefault();
|
|
1756
|
+
setDragging(false);
|
|
1757
|
+
if (disabled) return;
|
|
1758
|
+
const files = Array.from(event.dataTransfer.files);
|
|
1759
|
+
onDrop?.(files);
|
|
1760
|
+
}
|
|
1761
|
+
function handleInputChange(event) {
|
|
1762
|
+
const files = event.target.files ? Array.from(event.target.files) : [];
|
|
1763
|
+
if (files.length > 0) onDrop?.(files);
|
|
1764
|
+
event.target.value = "";
|
|
1765
|
+
}
|
|
1766
|
+
function handleClick() {
|
|
1767
|
+
if (!disabled) inputRef.current?.click();
|
|
1768
|
+
}
|
|
1769
|
+
return /* @__PURE__ */ jsxs38(
|
|
1770
|
+
"div",
|
|
1771
|
+
{
|
|
1772
|
+
className: `malix-dropzone${className ? ` ${className}` : ""}`,
|
|
1773
|
+
"data-dragging": dragging,
|
|
1774
|
+
"data-disabled": disabled,
|
|
1775
|
+
onDragOver: handleDragOver,
|
|
1776
|
+
onDragLeave: handleDragLeave,
|
|
1777
|
+
onDrop: handleDrop,
|
|
1778
|
+
onClick: handleClick,
|
|
1779
|
+
role: "button",
|
|
1780
|
+
tabIndex: disabled ? -1 : 0,
|
|
1781
|
+
"aria-disabled": disabled || void 0,
|
|
1782
|
+
...props,
|
|
1783
|
+
children: [
|
|
1784
|
+
/* @__PURE__ */ jsx43(
|
|
1785
|
+
"input",
|
|
1786
|
+
{
|
|
1787
|
+
ref: inputRef,
|
|
1788
|
+
type: "file",
|
|
1789
|
+
accept,
|
|
1790
|
+
onChange: handleInputChange,
|
|
1791
|
+
hidden: true,
|
|
1792
|
+
"aria-hidden": "true"
|
|
1793
|
+
}
|
|
1794
|
+
),
|
|
1795
|
+
/* @__PURE__ */ jsxs38(
|
|
1796
|
+
"svg",
|
|
1797
|
+
{
|
|
1798
|
+
className: "malix-dropzone__icon",
|
|
1799
|
+
width: "32",
|
|
1800
|
+
height: "32",
|
|
1801
|
+
viewBox: "0 0 24 24",
|
|
1802
|
+
fill: "none",
|
|
1803
|
+
stroke: "currentColor",
|
|
1804
|
+
strokeWidth: "1.5",
|
|
1805
|
+
strokeLinecap: "round",
|
|
1806
|
+
strokeLinejoin: "round",
|
|
1807
|
+
"aria-hidden": "true",
|
|
1808
|
+
children: [
|
|
1809
|
+
/* @__PURE__ */ jsx43("path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242" }),
|
|
1810
|
+
/* @__PURE__ */ jsx43("path", { d: "M12 12v9" }),
|
|
1811
|
+
/* @__PURE__ */ jsx43("path", { d: "m16 16-4-4-4 4" })
|
|
1812
|
+
]
|
|
1813
|
+
}
|
|
1814
|
+
),
|
|
1815
|
+
/* @__PURE__ */ jsx43("span", { className: "malix-dropzone__title", children: title }),
|
|
1816
|
+
/* @__PURE__ */ jsx43("span", { className: "malix-dropzone__hint", children: hint }),
|
|
1817
|
+
/* @__PURE__ */ jsx43("span", { className: "malix-dropzone__browse-btn", children: "Browse files" })
|
|
1818
|
+
]
|
|
1819
|
+
}
|
|
1820
|
+
);
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
// src/components/SplitPane.tsx
|
|
1824
|
+
import { useState as useState5, useCallback, useRef as useRef4, useEffect as useEffect3 } from "react";
|
|
1825
|
+
import { jsx as jsx44, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
1826
|
+
function SplitPane({
|
|
1827
|
+
leftPanel,
|
|
1828
|
+
rightPanel,
|
|
1829
|
+
leftTitle,
|
|
1830
|
+
rightTitle,
|
|
1831
|
+
defaultSplit = 50,
|
|
1832
|
+
className,
|
|
1833
|
+
...props
|
|
1834
|
+
}) {
|
|
1835
|
+
const [split, setSplit] = useState5(defaultSplit);
|
|
1836
|
+
const containerRef = useRef4(null);
|
|
1837
|
+
const dragging = useRef4(false);
|
|
1838
|
+
const onMouseDown = useCallback((e) => {
|
|
1839
|
+
e.preventDefault();
|
|
1840
|
+
dragging.current = true;
|
|
1841
|
+
}, []);
|
|
1842
|
+
useEffect3(() => {
|
|
1843
|
+
function onMouseMove(e) {
|
|
1844
|
+
if (!dragging.current || !containerRef.current) return;
|
|
1845
|
+
const rect = containerRef.current.getBoundingClientRect();
|
|
1846
|
+
const x = e.clientX - rect.left;
|
|
1847
|
+
const pct = Math.min(Math.max(x / rect.width * 100, 5), 95);
|
|
1848
|
+
setSplit(pct);
|
|
1849
|
+
}
|
|
1850
|
+
function onMouseUp() {
|
|
1851
|
+
dragging.current = false;
|
|
1852
|
+
}
|
|
1853
|
+
document.addEventListener("mousemove", onMouseMove);
|
|
1854
|
+
document.addEventListener("mouseup", onMouseUp);
|
|
1855
|
+
return () => {
|
|
1856
|
+
document.removeEventListener("mousemove", onMouseMove);
|
|
1857
|
+
document.removeEventListener("mouseup", onMouseUp);
|
|
1858
|
+
};
|
|
1859
|
+
}, []);
|
|
1860
|
+
return /* @__PURE__ */ jsxs39(
|
|
1861
|
+
"div",
|
|
1862
|
+
{
|
|
1863
|
+
ref: containerRef,
|
|
1864
|
+
className: `malix-split-pane${className ? ` ${className}` : ""}`,
|
|
1865
|
+
...props,
|
|
1866
|
+
children: [
|
|
1867
|
+
/* @__PURE__ */ jsxs39("div", { className: "malix-split-pane__left", style: { width: `${split}%` }, children: [
|
|
1868
|
+
leftTitle ? /* @__PURE__ */ jsx44("span", { className: "malix-split-pane__panel-title", children: leftTitle }) : null,
|
|
1869
|
+
leftPanel
|
|
1870
|
+
] }),
|
|
1871
|
+
/* @__PURE__ */ jsxs39(
|
|
1872
|
+
"div",
|
|
1873
|
+
{
|
|
1874
|
+
className: "malix-split-pane__handle",
|
|
1875
|
+
role: "separator",
|
|
1876
|
+
"aria-valuenow": Math.round(split),
|
|
1877
|
+
"aria-valuemin": 5,
|
|
1878
|
+
"aria-valuemax": 95,
|
|
1879
|
+
"aria-label": "Resize panels",
|
|
1880
|
+
onMouseDown,
|
|
1881
|
+
children: [
|
|
1882
|
+
/* @__PURE__ */ jsx44("span", { className: "malix-split-pane__handle-dot", "aria-hidden": "true" }),
|
|
1883
|
+
/* @__PURE__ */ jsx44("span", { className: "malix-split-pane__handle-dot", "aria-hidden": "true" }),
|
|
1884
|
+
/* @__PURE__ */ jsx44("span", { className: "malix-split-pane__handle-dot", "aria-hidden": "true" })
|
|
1885
|
+
]
|
|
1886
|
+
}
|
|
1887
|
+
),
|
|
1888
|
+
/* @__PURE__ */ jsxs39("div", { className: "malix-split-pane__right", style: { width: `${100 - split}%` }, children: [
|
|
1889
|
+
rightTitle ? /* @__PURE__ */ jsx44("span", { className: "malix-split-pane__panel-title", children: rightTitle }) : null,
|
|
1890
|
+
rightPanel
|
|
1891
|
+
] })
|
|
1892
|
+
]
|
|
1893
|
+
}
|
|
1894
|
+
);
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
// src/components/PricingCard.tsx
|
|
1898
|
+
import { jsx as jsx45, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
1899
|
+
function PricingCard({
|
|
1900
|
+
planName,
|
|
1901
|
+
price,
|
|
1902
|
+
period = "/month",
|
|
1903
|
+
description,
|
|
1904
|
+
features,
|
|
1905
|
+
ctaLabel = "Get Started",
|
|
1906
|
+
onCtaClick,
|
|
1907
|
+
highlighted = false,
|
|
1908
|
+
className,
|
|
1909
|
+
...props
|
|
1910
|
+
}) {
|
|
1911
|
+
return /* @__PURE__ */ jsxs40(
|
|
1912
|
+
"div",
|
|
1913
|
+
{
|
|
1914
|
+
className: `malix-pricing-card${className ? ` ${className}` : ""}`,
|
|
1915
|
+
"data-highlighted": highlighted || void 0,
|
|
1916
|
+
...props,
|
|
1917
|
+
children: [
|
|
1918
|
+
/* @__PURE__ */ jsx45("span", { className: "malix-pricing-card__badge", children: planName }),
|
|
1919
|
+
/* @__PURE__ */ jsxs40("div", { className: "malix-pricing-card__price-row", children: [
|
|
1920
|
+
/* @__PURE__ */ jsx45("span", { className: "malix-pricing-card__price", children: price }),
|
|
1921
|
+
/* @__PURE__ */ jsx45("span", { className: "malix-pricing-card__period", children: period })
|
|
1922
|
+
] }),
|
|
1923
|
+
description ? /* @__PURE__ */ jsx45("p", { className: "malix-pricing-card__description", children: description }) : null,
|
|
1924
|
+
/* @__PURE__ */ jsx45("ul", { className: "malix-pricing-card__features", children: features.map((feature, i) => /* @__PURE__ */ jsxs40("li", { className: "malix-pricing-card__feature-item", children: [
|
|
1925
|
+
/* @__PURE__ */ jsx45(
|
|
1926
|
+
"svg",
|
|
1927
|
+
{
|
|
1928
|
+
className: "malix-pricing-card__check-icon",
|
|
1929
|
+
width: "16",
|
|
1930
|
+
height: "16",
|
|
1931
|
+
viewBox: "0 0 24 24",
|
|
1932
|
+
fill: "none",
|
|
1933
|
+
stroke: "currentColor",
|
|
1934
|
+
strokeWidth: "2",
|
|
1935
|
+
strokeLinecap: "round",
|
|
1936
|
+
strokeLinejoin: "round",
|
|
1937
|
+
"aria-hidden": "true",
|
|
1938
|
+
children: /* @__PURE__ */ jsx45("polyline", { points: "20 6 9 17 4 12" })
|
|
1939
|
+
}
|
|
1940
|
+
),
|
|
1941
|
+
/* @__PURE__ */ jsx45("span", { children: feature })
|
|
1942
|
+
] }, i)) }),
|
|
1943
|
+
/* @__PURE__ */ jsx45(
|
|
1944
|
+
"button",
|
|
1945
|
+
{
|
|
1946
|
+
type: "button",
|
|
1947
|
+
className: "malix-pricing-card__cta",
|
|
1948
|
+
onClick: onCtaClick,
|
|
1949
|
+
children: ctaLabel
|
|
1950
|
+
}
|
|
1951
|
+
)
|
|
1952
|
+
]
|
|
1953
|
+
}
|
|
1954
|
+
);
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
// src/components/OnboardingPopover.tsx
|
|
1958
|
+
import { jsx as jsx46, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
1959
|
+
function OnboardingPopover({
|
|
1960
|
+
step,
|
|
1961
|
+
totalSteps,
|
|
1962
|
+
title,
|
|
1963
|
+
description,
|
|
1964
|
+
onNext,
|
|
1965
|
+
onSkip,
|
|
1966
|
+
nextLabel = "Next",
|
|
1967
|
+
className,
|
|
1968
|
+
...props
|
|
1969
|
+
}) {
|
|
1970
|
+
return /* @__PURE__ */ jsxs41(
|
|
1971
|
+
"div",
|
|
1972
|
+
{
|
|
1973
|
+
className: `malix-onboarding-popover${className ? ` ${className}` : ""}`,
|
|
1974
|
+
role: "dialog",
|
|
1975
|
+
"aria-label": `Step ${step} of ${totalSteps}: ${title}`,
|
|
1976
|
+
...props,
|
|
1977
|
+
children: [
|
|
1978
|
+
/* @__PURE__ */ jsxs41("span", { className: "malix-onboarding-popover__step", children: [
|
|
1979
|
+
"Step ",
|
|
1980
|
+
step,
|
|
1981
|
+
" of ",
|
|
1982
|
+
totalSteps
|
|
1983
|
+
] }),
|
|
1984
|
+
/* @__PURE__ */ jsx46("h3", { className: "malix-onboarding-popover__title", children: title }),
|
|
1985
|
+
/* @__PURE__ */ jsx46("p", { className: "malix-onboarding-popover__description", children: description }),
|
|
1986
|
+
/* @__PURE__ */ jsxs41("div", { className: "malix-onboarding-popover__actions", children: [
|
|
1987
|
+
onSkip ? /* @__PURE__ */ jsx46(
|
|
1988
|
+
"button",
|
|
1989
|
+
{
|
|
1990
|
+
type: "button",
|
|
1991
|
+
className: "malix-onboarding-popover__skip",
|
|
1992
|
+
onClick: onSkip,
|
|
1993
|
+
children: "Skip"
|
|
1994
|
+
}
|
|
1995
|
+
) : null,
|
|
1996
|
+
onNext ? /* @__PURE__ */ jsx46(
|
|
1997
|
+
"button",
|
|
1998
|
+
{
|
|
1999
|
+
type: "button",
|
|
2000
|
+
className: "malix-onboarding-popover__next-btn",
|
|
2001
|
+
onClick: onNext,
|
|
2002
|
+
children: nextLabel
|
|
2003
|
+
}
|
|
2004
|
+
) : null
|
|
2005
|
+
] })
|
|
2006
|
+
]
|
|
2007
|
+
}
|
|
2008
|
+
);
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2011
|
+
// src/components/CreditsIndicator.tsx
|
|
2012
|
+
import { jsx as jsx47, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
2013
|
+
function CreditsIndicator({
|
|
2014
|
+
remaining,
|
|
2015
|
+
label = "Credits Remaining",
|
|
2016
|
+
className,
|
|
2017
|
+
...props
|
|
2018
|
+
}) {
|
|
2019
|
+
return /* @__PURE__ */ jsxs42(
|
|
2020
|
+
"div",
|
|
2021
|
+
{
|
|
2022
|
+
className: `malix-credits-indicator${className ? ` ${className}` : ""}`,
|
|
2023
|
+
...props,
|
|
2024
|
+
children: [
|
|
2025
|
+
/* @__PURE__ */ jsx47("span", { className: "malix-credits-indicator__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsxs42(
|
|
2026
|
+
"svg",
|
|
2027
|
+
{
|
|
2028
|
+
width: "20",
|
|
2029
|
+
height: "20",
|
|
2030
|
+
viewBox: "0 0 24 24",
|
|
2031
|
+
fill: "none",
|
|
2032
|
+
stroke: "currentColor",
|
|
2033
|
+
strokeWidth: "2",
|
|
2034
|
+
strokeLinecap: "round",
|
|
2035
|
+
strokeLinejoin: "round",
|
|
2036
|
+
children: [
|
|
2037
|
+
/* @__PURE__ */ jsx47("ellipse", { cx: "12", cy: "6", rx: "8", ry: "3" }),
|
|
2038
|
+
/* @__PURE__ */ jsx47("path", { d: "M4 6v6c0 1.66 3.58 3 8 3s8-1.34 8-3V6" }),
|
|
2039
|
+
/* @__PURE__ */ jsx47("path", { d: "M4 12v6c0 1.66 3.58 3 8 3s8-1.34 8-3v-6" })
|
|
2040
|
+
]
|
|
2041
|
+
}
|
|
2042
|
+
) }),
|
|
2043
|
+
/* @__PURE__ */ jsxs42("div", { className: "malix-credits-indicator__info", children: [
|
|
2044
|
+
/* @__PURE__ */ jsx47("span", { className: "malix-credits-indicator__label", children: label }),
|
|
2045
|
+
/* @__PURE__ */ jsx47("span", { className: "malix-credits-indicator__value", children: remaining })
|
|
2046
|
+
] })
|
|
2047
|
+
]
|
|
2048
|
+
}
|
|
2049
|
+
);
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
// src/components/LanguageSelector.tsx
|
|
2053
|
+
import { jsx as jsx48, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
2054
|
+
function LanguageSelector({
|
|
2055
|
+
value,
|
|
2056
|
+
options,
|
|
2057
|
+
onChange,
|
|
2058
|
+
className,
|
|
2059
|
+
...props
|
|
2060
|
+
}) {
|
|
2061
|
+
const selectedOption = options?.find((opt) => opt.value === value);
|
|
2062
|
+
const displayLabel = selectedOption?.label ?? value;
|
|
2063
|
+
return /* @__PURE__ */ jsxs43(
|
|
2064
|
+
"div",
|
|
2065
|
+
{
|
|
2066
|
+
className: `malix-language-selector${className ? ` ${className}` : ""}`,
|
|
2067
|
+
...props,
|
|
2068
|
+
children: [
|
|
2069
|
+
/* @__PURE__ */ jsx48("span", { className: "malix-language-selector__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsxs43(
|
|
2070
|
+
"svg",
|
|
2071
|
+
{
|
|
2072
|
+
width: "16",
|
|
2073
|
+
height: "16",
|
|
2074
|
+
viewBox: "0 0 24 24",
|
|
2075
|
+
fill: "none",
|
|
2076
|
+
stroke: "currentColor",
|
|
2077
|
+
strokeWidth: "2",
|
|
2078
|
+
strokeLinecap: "round",
|
|
2079
|
+
strokeLinejoin: "round",
|
|
2080
|
+
children: [
|
|
2081
|
+
/* @__PURE__ */ jsx48("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2082
|
+
/* @__PURE__ */ jsx48("line", { x1: "2", y1: "12", x2: "22", y2: "12" }),
|
|
2083
|
+
/* @__PURE__ */ jsx48("path", { d: "M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10A15.3 15.3 0 0 1 12 2z" })
|
|
2084
|
+
]
|
|
2085
|
+
}
|
|
2086
|
+
) }),
|
|
2087
|
+
/* @__PURE__ */ jsx48(
|
|
2088
|
+
"select",
|
|
2089
|
+
{
|
|
2090
|
+
className: "malix-language-selector__select",
|
|
2091
|
+
value,
|
|
2092
|
+
onChange: (e) => onChange?.(e.target.value),
|
|
2093
|
+
"aria-label": "Select language",
|
|
2094
|
+
children: options ? options.map((opt) => /* @__PURE__ */ jsx48("option", { value: opt.value, children: opt.label }, opt.value)) : /* @__PURE__ */ jsx48("option", { value, children: displayLabel })
|
|
2095
|
+
}
|
|
2096
|
+
),
|
|
2097
|
+
/* @__PURE__ */ jsx48("span", { className: "malix-language-selector__label", children: displayLabel }),
|
|
2098
|
+
/* @__PURE__ */ jsx48("span", { className: "malix-language-selector__chevron", "aria-hidden": "true", children: /* @__PURE__ */ jsx48(
|
|
2099
|
+
"svg",
|
|
2100
|
+
{
|
|
2101
|
+
width: "14",
|
|
2102
|
+
height: "14",
|
|
2103
|
+
viewBox: "0 0 24 24",
|
|
2104
|
+
fill: "none",
|
|
2105
|
+
stroke: "currentColor",
|
|
2106
|
+
strokeWidth: "2",
|
|
2107
|
+
strokeLinecap: "round",
|
|
2108
|
+
strokeLinejoin: "round",
|
|
2109
|
+
children: /* @__PURE__ */ jsx48("polyline", { points: "6 9 12 15 18 9" })
|
|
2110
|
+
}
|
|
2111
|
+
) })
|
|
2112
|
+
]
|
|
2113
|
+
}
|
|
2114
|
+
);
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
// src/components/UserProfilePopover.tsx
|
|
2118
|
+
import { Fragment as Fragment2, jsx as jsx49, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
2119
|
+
function UserProfilePopover({
|
|
2120
|
+
name,
|
|
2121
|
+
email,
|
|
2122
|
+
avatar,
|
|
2123
|
+
menuItems,
|
|
2124
|
+
onLogout,
|
|
2125
|
+
credits,
|
|
2126
|
+
className,
|
|
2127
|
+
...props
|
|
2128
|
+
}) {
|
|
2129
|
+
return /* @__PURE__ */ jsxs44(
|
|
2130
|
+
"div",
|
|
2131
|
+
{
|
|
2132
|
+
className: `malix-user-profile${className ? ` ${className}` : ""}`,
|
|
2133
|
+
...props,
|
|
2134
|
+
children: [
|
|
2135
|
+
/* @__PURE__ */ jsxs44("div", { className: "malix-user-profile__header", children: [
|
|
2136
|
+
avatar ? /* @__PURE__ */ jsx49("span", { className: "malix-user-profile__avatar", children: avatar }) : null,
|
|
2137
|
+
/* @__PURE__ */ jsxs44("div", { className: "malix-user-profile__info", children: [
|
|
2138
|
+
/* @__PURE__ */ jsx49("span", { className: "malix-user-profile__name", children: name }),
|
|
2139
|
+
/* @__PURE__ */ jsx49("span", { className: "malix-user-profile__email", children: email })
|
|
2140
|
+
] })
|
|
2141
|
+
] }),
|
|
2142
|
+
credits !== void 0 ? /* @__PURE__ */ jsxs44("div", { className: "malix-user-profile__credits", children: [
|
|
2143
|
+
/* @__PURE__ */ jsx49("span", { className: "malix-user-profile__credits-label", children: "Credits" }),
|
|
2144
|
+
/* @__PURE__ */ jsx49("span", { className: "malix-user-profile__credits-value", children: credits })
|
|
2145
|
+
] }) : null,
|
|
2146
|
+
menuItems && menuItems.length > 0 ? /* @__PURE__ */ jsxs44(Fragment2, { children: [
|
|
2147
|
+
/* @__PURE__ */ jsx49("hr", { className: "malix-user-profile__divider" }),
|
|
2148
|
+
/* @__PURE__ */ jsx49("nav", { className: "malix-user-profile__menu", role: "menu", children: menuItems.map((item, i) => /* @__PURE__ */ jsxs44(
|
|
2149
|
+
"button",
|
|
2150
|
+
{
|
|
2151
|
+
type: "button",
|
|
2152
|
+
className: "malix-user-profile__menu-item",
|
|
2153
|
+
role: "menuitem",
|
|
2154
|
+
onClick: item.onClick,
|
|
2155
|
+
children: [
|
|
2156
|
+
item.icon ? /* @__PURE__ */ jsx49("span", { className: "malix-user-profile__menu-item-icon", children: item.icon }) : null,
|
|
2157
|
+
/* @__PURE__ */ jsx49("span", { className: "malix-user-profile__menu-item-label", children: item.label })
|
|
2158
|
+
]
|
|
2159
|
+
},
|
|
2160
|
+
i
|
|
2161
|
+
)) })
|
|
2162
|
+
] }) : null,
|
|
2163
|
+
onLogout ? /* @__PURE__ */ jsxs44(Fragment2, { children: [
|
|
2164
|
+
/* @__PURE__ */ jsx49("hr", { className: "malix-user-profile__divider" }),
|
|
2165
|
+
/* @__PURE__ */ jsxs44(
|
|
2166
|
+
"button",
|
|
2167
|
+
{
|
|
2168
|
+
type: "button",
|
|
2169
|
+
className: "malix-user-profile__logout",
|
|
2170
|
+
onClick: onLogout,
|
|
2171
|
+
children: [
|
|
2172
|
+
/* @__PURE__ */ jsxs44(
|
|
2173
|
+
"svg",
|
|
2174
|
+
{
|
|
2175
|
+
width: "16",
|
|
2176
|
+
height: "16",
|
|
2177
|
+
viewBox: "0 0 24 24",
|
|
2178
|
+
fill: "none",
|
|
2179
|
+
stroke: "currentColor",
|
|
2180
|
+
strokeWidth: "2",
|
|
2181
|
+
strokeLinecap: "round",
|
|
2182
|
+
strokeLinejoin: "round",
|
|
2183
|
+
children: [
|
|
2184
|
+
/* @__PURE__ */ jsx49("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }),
|
|
2185
|
+
/* @__PURE__ */ jsx49("polyline", { points: "16 17 21 12 16 7" }),
|
|
2186
|
+
/* @__PURE__ */ jsx49("line", { x1: "21", y1: "12", x2: "9", y2: "12" })
|
|
2187
|
+
]
|
|
2188
|
+
}
|
|
2189
|
+
),
|
|
2190
|
+
/* @__PURE__ */ jsx49("span", { children: "Log out" })
|
|
2191
|
+
]
|
|
2192
|
+
}
|
|
2193
|
+
)
|
|
2194
|
+
] }) : null
|
|
2195
|
+
]
|
|
2196
|
+
}
|
|
2197
|
+
);
|
|
2198
|
+
}
|
|
2199
|
+
export {
|
|
2200
|
+
Accordion,
|
|
2201
|
+
Avatar,
|
|
2202
|
+
Badge,
|
|
2203
|
+
Banner,
|
|
2204
|
+
Breadcrumb,
|
|
2205
|
+
Button,
|
|
2206
|
+
Card,
|
|
2207
|
+
ChatInput,
|
|
2208
|
+
Checkbox,
|
|
2209
|
+
CreditsIndicator,
|
|
2210
|
+
DataTable,
|
|
2211
|
+
DateInput,
|
|
2212
|
+
Divider,
|
|
2213
|
+
Dropzone,
|
|
2214
|
+
EmptyState,
|
|
2215
|
+
FileCard,
|
|
2216
|
+
FilterTabs,
|
|
2217
|
+
FlyoutMenu,
|
|
2218
|
+
GlassPopover,
|
|
2219
|
+
Header,
|
|
2220
|
+
Input,
|
|
2221
|
+
InputGroup,
|
|
2222
|
+
LanguageSelector,
|
|
2223
|
+
Modal,
|
|
2224
|
+
OnboardingPopover,
|
|
2225
|
+
OperationStatus,
|
|
2226
|
+
Overlay,
|
|
2227
|
+
Pagination,
|
|
2228
|
+
Pill,
|
|
2229
|
+
PricingCard,
|
|
2230
|
+
ProgressBar,
|
|
2231
|
+
Radio,
|
|
2232
|
+
SearchInput,
|
|
2233
|
+
SectionHeader,
|
|
2234
|
+
SegmentedControl,
|
|
2235
|
+
Select,
|
|
2236
|
+
SelectGroup,
|
|
2237
|
+
SelectionCard,
|
|
2238
|
+
SidebarItem,
|
|
2239
|
+
SidebarPanel,
|
|
2240
|
+
SplitPane,
|
|
2241
|
+
StatCard,
|
|
2242
|
+
StatusDot,
|
|
2243
|
+
Stepper,
|
|
2244
|
+
TabBar,
|
|
2245
|
+
Textarea,
|
|
2246
|
+
Toggle,
|
|
2247
|
+
Tooltip,
|
|
2248
|
+
UserProfilePopover,
|
|
2249
|
+
ValidationAlert,
|
|
2250
|
+
tokens_registry_default as tokenRegistry
|
|
2251
|
+
};
|