@camtomlabs/malix-design-system 0.3.0 → 0.4.1
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/README.md +69 -1
- package/dist/index.cjs +452 -291
- package/dist/index.d.cts +97 -3
- package/dist/index.d.ts +97 -3
- package/dist/index.js +437 -277
- package/package.json +5 -2
- package/src/compat-bootstrap.css +51 -0
- package/src/styles.css +127 -0
package/dist/index.js
CHANGED
|
@@ -1142,46 +1142,95 @@ function Overlay({ open, title, onClose, children }) {
|
|
|
1142
1142
|
}
|
|
1143
1143
|
|
|
1144
1144
|
// src/components/Modal.tsx
|
|
1145
|
+
import { useRef as useRef4 } from "react";
|
|
1146
|
+
import { createPortal as createPortal2 } from "react-dom";
|
|
1147
|
+
|
|
1148
|
+
// src/hooks/useOverlayBehavior.ts
|
|
1145
1149
|
import { useEffect as useEffect3, useRef as useRef3 } from "react";
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
function Modal({
|
|
1150
|
+
var FOCUSABLE_SELECTOR2 = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
1151
|
+
function useOverlayBehavior({
|
|
1149
1152
|
open,
|
|
1150
|
-
title,
|
|
1151
1153
|
onClose,
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
children
|
|
1154
|
+
panelRef,
|
|
1155
|
+
closeOnEsc = true,
|
|
1156
|
+
initialFocusRef
|
|
1156
1157
|
}) {
|
|
1157
|
-
const
|
|
1158
|
+
const previousActiveRef = useRef3(null);
|
|
1158
1159
|
useEffect3(() => {
|
|
1159
|
-
if (!open
|
|
1160
|
+
if (!open) return;
|
|
1160
1161
|
const panel = panelRef.current;
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
const
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
if (
|
|
1162
|
+
if (!panel) return;
|
|
1163
|
+
previousActiveRef.current = document.activeElement ?? null;
|
|
1164
|
+
const previousBodyOverflow = document.body.style.overflow;
|
|
1165
|
+
document.body.style.overflow = "hidden";
|
|
1166
|
+
const focusTimer = window.setTimeout(() => {
|
|
1167
|
+
if (initialFocusRef?.current) {
|
|
1168
|
+
initialFocusRef.current.focus();
|
|
1169
|
+
return;
|
|
1170
|
+
}
|
|
1171
|
+
const focusables = Array.from(
|
|
1172
|
+
panel.querySelectorAll(FOCUSABLE_SELECTOR2)
|
|
1173
|
+
);
|
|
1174
|
+
if (focusables.length > 0) {
|
|
1175
|
+
focusables[0].focus();
|
|
1176
|
+
} else {
|
|
1177
|
+
panel.focus();
|
|
1178
|
+
}
|
|
1179
|
+
}, 0);
|
|
1180
|
+
const onKeyDown = (event) => {
|
|
1181
|
+
if (event.key === "Escape" && closeOnEsc) {
|
|
1167
1182
|
event.preventDefault();
|
|
1168
1183
|
onClose();
|
|
1184
|
+
return;
|
|
1169
1185
|
}
|
|
1170
|
-
if (event.key
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
}
|
|
1186
|
+
if (event.key !== "Tab") return;
|
|
1187
|
+
const focusables = Array.from(
|
|
1188
|
+
panel.querySelectorAll(FOCUSABLE_SELECTOR2)
|
|
1189
|
+
);
|
|
1190
|
+
if (focusables.length === 0) {
|
|
1191
|
+
event.preventDefault();
|
|
1192
|
+
return;
|
|
1178
1193
|
}
|
|
1179
|
-
|
|
1194
|
+
const first = focusables[0];
|
|
1195
|
+
const last = focusables[focusables.length - 1];
|
|
1196
|
+
const active = document.activeElement;
|
|
1197
|
+
if (event.shiftKey && active === first) {
|
|
1198
|
+
event.preventDefault();
|
|
1199
|
+
last.focus();
|
|
1200
|
+
} else if (!event.shiftKey && active === last) {
|
|
1201
|
+
event.preventDefault();
|
|
1202
|
+
first.focus();
|
|
1203
|
+
}
|
|
1204
|
+
};
|
|
1180
1205
|
document.addEventListener("keydown", onKeyDown);
|
|
1181
|
-
return () =>
|
|
1182
|
-
|
|
1206
|
+
return () => {
|
|
1207
|
+
window.clearTimeout(focusTimer);
|
|
1208
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
1209
|
+
document.body.style.overflow = previousBodyOverflow;
|
|
1210
|
+
const previous = previousActiveRef.current;
|
|
1211
|
+
if (previous && typeof previous.focus === "function") {
|
|
1212
|
+
previous.focus();
|
|
1213
|
+
}
|
|
1214
|
+
};
|
|
1215
|
+
}, [open, onClose, panelRef, closeOnEsc, initialFocusRef]);
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
// src/components/Modal.tsx
|
|
1219
|
+
import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1220
|
+
function Modal({
|
|
1221
|
+
open,
|
|
1222
|
+
title,
|
|
1223
|
+
onClose,
|
|
1224
|
+
onConfirm,
|
|
1225
|
+
confirmLabel = "Confirm",
|
|
1226
|
+
cancelLabel = "Cancel",
|
|
1227
|
+
children
|
|
1228
|
+
}) {
|
|
1229
|
+
const panelRef = useRef4(null);
|
|
1230
|
+
useOverlayBehavior({ open, onClose, panelRef });
|
|
1183
1231
|
if (!open) return null;
|
|
1184
|
-
|
|
1232
|
+
if (typeof document === "undefined") return null;
|
|
1233
|
+
const content = /* @__PURE__ */ jsx29("div", { className: "malix-overlay-backdrop", onMouseDown: onClose, children: /* @__PURE__ */ jsxs25(
|
|
1185
1234
|
"div",
|
|
1186
1235
|
{
|
|
1187
1236
|
ref: panelRef,
|
|
@@ -1189,6 +1238,7 @@ function Modal({
|
|
|
1189
1238
|
role: "dialog",
|
|
1190
1239
|
"aria-modal": "true",
|
|
1191
1240
|
"aria-label": title,
|
|
1241
|
+
tabIndex: -1,
|
|
1192
1242
|
onMouseDown: (event) => event.stopPropagation(),
|
|
1193
1243
|
children: [
|
|
1194
1244
|
/* @__PURE__ */ jsxs25("div", { className: "malix-modal__header", children: [
|
|
@@ -1200,10 +1250,24 @@ function Modal({
|
|
|
1200
1250
|
className: "malix-modal__close",
|
|
1201
1251
|
onClick: onClose,
|
|
1202
1252
|
"aria-label": "Close",
|
|
1203
|
-
children: /* @__PURE__ */ jsxs25(
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1253
|
+
children: /* @__PURE__ */ jsxs25(
|
|
1254
|
+
"svg",
|
|
1255
|
+
{
|
|
1256
|
+
width: "18",
|
|
1257
|
+
height: "18",
|
|
1258
|
+
viewBox: "0 0 24 24",
|
|
1259
|
+
fill: "none",
|
|
1260
|
+
stroke: "currentColor",
|
|
1261
|
+
strokeWidth: "2",
|
|
1262
|
+
strokeLinecap: "round",
|
|
1263
|
+
strokeLinejoin: "round",
|
|
1264
|
+
"aria-hidden": "true",
|
|
1265
|
+
children: [
|
|
1266
|
+
/* @__PURE__ */ jsx29("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1267
|
+
/* @__PURE__ */ jsx29("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1268
|
+
]
|
|
1269
|
+
}
|
|
1270
|
+
)
|
|
1207
1271
|
}
|
|
1208
1272
|
)
|
|
1209
1273
|
] }),
|
|
@@ -1233,12 +1297,13 @@ function Modal({
|
|
|
1233
1297
|
]
|
|
1234
1298
|
}
|
|
1235
1299
|
) });
|
|
1300
|
+
return createPortal2(content, document.body);
|
|
1236
1301
|
}
|
|
1237
1302
|
|
|
1238
1303
|
// src/components/ConfirmDialog.tsx
|
|
1239
|
-
import {
|
|
1304
|
+
import { useId as useId2, useRef as useRef5 } from "react";
|
|
1305
|
+
import { createPortal as createPortal3 } from "react-dom";
|
|
1240
1306
|
import { jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
1241
|
-
var FOCUSABLE_SELECTOR3 = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
|
1242
1307
|
function ConfirmDialog({
|
|
1243
1308
|
open,
|
|
1244
1309
|
title,
|
|
@@ -1252,50 +1317,30 @@ function ConfirmDialog({
|
|
|
1252
1317
|
children,
|
|
1253
1318
|
loading = false
|
|
1254
1319
|
}) {
|
|
1255
|
-
const panelRef =
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
const focusables = Array.from(panel.querySelectorAll(FOCUSABLE_SELECTOR3));
|
|
1260
|
-
const first = focusables[0];
|
|
1261
|
-
const last = focusables[focusables.length - 1];
|
|
1262
|
-
first?.focus();
|
|
1263
|
-
function onKeyDown(event) {
|
|
1264
|
-
if (event.key === "Escape") {
|
|
1265
|
-
event.preventDefault();
|
|
1266
|
-
onCancel();
|
|
1267
|
-
}
|
|
1268
|
-
if (event.key === "Tab" && focusables.length > 0) {
|
|
1269
|
-
if (event.shiftKey && document.activeElement === first) {
|
|
1270
|
-
event.preventDefault();
|
|
1271
|
-
last?.focus();
|
|
1272
|
-
} else if (!event.shiftKey && document.activeElement === last) {
|
|
1273
|
-
event.preventDefault();
|
|
1274
|
-
first?.focus();
|
|
1275
|
-
}
|
|
1276
|
-
}
|
|
1277
|
-
}
|
|
1278
|
-
document.addEventListener("keydown", onKeyDown);
|
|
1279
|
-
return () => document.removeEventListener("keydown", onKeyDown);
|
|
1280
|
-
}, [open, onCancel]);
|
|
1320
|
+
const panelRef = useRef5(null);
|
|
1321
|
+
const titleId = useId2();
|
|
1322
|
+
const descriptionId = useId2();
|
|
1323
|
+
useOverlayBehavior({ open, onClose: onCancel, panelRef });
|
|
1281
1324
|
if (!open) return null;
|
|
1282
|
-
|
|
1325
|
+
if (typeof document === "undefined") return null;
|
|
1326
|
+
const content = /* @__PURE__ */ jsx30("div", { className: "malix-overlay-backdrop", onMouseDown: onCancel, children: /* @__PURE__ */ jsxs26(
|
|
1283
1327
|
"div",
|
|
1284
1328
|
{
|
|
1285
1329
|
ref: panelRef,
|
|
1286
1330
|
className: "malix-confirm-dialog",
|
|
1287
1331
|
role: "alertdialog",
|
|
1288
1332
|
"aria-modal": "true",
|
|
1289
|
-
"aria-labelledby":
|
|
1290
|
-
"aria-describedby": description ?
|
|
1333
|
+
"aria-labelledby": titleId,
|
|
1334
|
+
"aria-describedby": description ? descriptionId : void 0,
|
|
1291
1335
|
"data-variant": variant,
|
|
1336
|
+
tabIndex: -1,
|
|
1292
1337
|
onMouseDown: (event) => event.stopPropagation(),
|
|
1293
1338
|
children: [
|
|
1294
1339
|
/* @__PURE__ */ jsxs26("div", { className: "malix-confirm-dialog__content", children: [
|
|
1295
1340
|
icon ? /* @__PURE__ */ jsx30("div", { className: "malix-confirm-dialog__icon", children: icon }) : null,
|
|
1296
1341
|
/* @__PURE__ */ jsxs26("div", { className: "malix-confirm-dialog__text", children: [
|
|
1297
|
-
/* @__PURE__ */ jsx30("h3", { id:
|
|
1298
|
-
description ? /* @__PURE__ */ jsx30("p", { id:
|
|
1342
|
+
/* @__PURE__ */ jsx30("h3", { id: titleId, className: "malix-confirm-dialog__title", children: title }),
|
|
1343
|
+
description ? /* @__PURE__ */ jsx30("p", { id: descriptionId, className: "malix-confirm-dialog__description", children: description }) : null,
|
|
1299
1344
|
children
|
|
1300
1345
|
] })
|
|
1301
1346
|
] }),
|
|
@@ -1328,10 +1373,124 @@ function ConfirmDialog({
|
|
|
1328
1373
|
]
|
|
1329
1374
|
}
|
|
1330
1375
|
) });
|
|
1376
|
+
return createPortal3(content, document.body);
|
|
1331
1377
|
}
|
|
1332
1378
|
|
|
1333
|
-
// src/components/
|
|
1379
|
+
// src/components/Dialog.tsx
|
|
1380
|
+
import { createContext, useContext, useId as useId3, useRef as useRef6 } from "react";
|
|
1381
|
+
import { createPortal as createPortal4 } from "react-dom";
|
|
1334
1382
|
import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
1383
|
+
var DialogContext = createContext(null);
|
|
1384
|
+
function useDialogContext(component) {
|
|
1385
|
+
const ctx = useContext(DialogContext);
|
|
1386
|
+
if (!ctx) {
|
|
1387
|
+
throw new Error(
|
|
1388
|
+
`<Dialog.${component}> must be rendered inside <Dialog>. Wrap it in a <Dialog> component.`
|
|
1389
|
+
);
|
|
1390
|
+
}
|
|
1391
|
+
return ctx;
|
|
1392
|
+
}
|
|
1393
|
+
function Dialog({
|
|
1394
|
+
open,
|
|
1395
|
+
onClose,
|
|
1396
|
+
variant = "default",
|
|
1397
|
+
size = "md",
|
|
1398
|
+
closeOnBackdropClick = true,
|
|
1399
|
+
closeOnEsc = true,
|
|
1400
|
+
initialFocusRef,
|
|
1401
|
+
className,
|
|
1402
|
+
role = "dialog",
|
|
1403
|
+
children
|
|
1404
|
+
}) {
|
|
1405
|
+
const panelRef = useRef6(null);
|
|
1406
|
+
const titleId = useId3();
|
|
1407
|
+
const descriptionId = useId3();
|
|
1408
|
+
useOverlayBehavior({
|
|
1409
|
+
open,
|
|
1410
|
+
onClose,
|
|
1411
|
+
panelRef,
|
|
1412
|
+
closeOnEsc,
|
|
1413
|
+
initialFocusRef
|
|
1414
|
+
});
|
|
1415
|
+
if (!open) return null;
|
|
1416
|
+
if (typeof document === "undefined") return null;
|
|
1417
|
+
const handleBackdropMouseDown = closeOnBackdropClick ? onClose : void 0;
|
|
1418
|
+
const panelClassName = ["malix-dialog", className].filter(Boolean).join(" ");
|
|
1419
|
+
const contextValue = {
|
|
1420
|
+
onClose,
|
|
1421
|
+
titleId,
|
|
1422
|
+
descriptionId,
|
|
1423
|
+
variant
|
|
1424
|
+
};
|
|
1425
|
+
const content = /* @__PURE__ */ jsx31(DialogContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx31("div", { className: "malix-overlay-backdrop", onMouseDown: handleBackdropMouseDown, children: /* @__PURE__ */ jsx31(
|
|
1426
|
+
"div",
|
|
1427
|
+
{
|
|
1428
|
+
ref: panelRef,
|
|
1429
|
+
className: panelClassName,
|
|
1430
|
+
role,
|
|
1431
|
+
"aria-modal": "true",
|
|
1432
|
+
"aria-labelledby": titleId,
|
|
1433
|
+
"aria-describedby": descriptionId,
|
|
1434
|
+
"data-variant": variant,
|
|
1435
|
+
"data-size": size,
|
|
1436
|
+
tabIndex: -1,
|
|
1437
|
+
onMouseDown: (event) => event.stopPropagation(),
|
|
1438
|
+
children
|
|
1439
|
+
}
|
|
1440
|
+
) }) });
|
|
1441
|
+
return createPortal4(content, document.body);
|
|
1442
|
+
}
|
|
1443
|
+
function DialogHeader({
|
|
1444
|
+
children,
|
|
1445
|
+
showClose = true,
|
|
1446
|
+
closeLabel = "Close"
|
|
1447
|
+
}) {
|
|
1448
|
+
const { onClose, titleId } = useDialogContext("Header");
|
|
1449
|
+
return /* @__PURE__ */ jsxs27("div", { className: "malix-dialog__header", children: [
|
|
1450
|
+
/* @__PURE__ */ jsx31("h2", { className: "malix-dialog__title", id: titleId, children }),
|
|
1451
|
+
showClose ? /* @__PURE__ */ jsx31(
|
|
1452
|
+
"button",
|
|
1453
|
+
{
|
|
1454
|
+
type: "button",
|
|
1455
|
+
className: "malix-dialog__close",
|
|
1456
|
+
onClick: onClose,
|
|
1457
|
+
"aria-label": closeLabel,
|
|
1458
|
+
children: /* @__PURE__ */ jsxs27(
|
|
1459
|
+
"svg",
|
|
1460
|
+
{
|
|
1461
|
+
width: "18",
|
|
1462
|
+
height: "18",
|
|
1463
|
+
viewBox: "0 0 24 24",
|
|
1464
|
+
fill: "none",
|
|
1465
|
+
stroke: "currentColor",
|
|
1466
|
+
strokeWidth: "2",
|
|
1467
|
+
strokeLinecap: "round",
|
|
1468
|
+
strokeLinejoin: "round",
|
|
1469
|
+
"aria-hidden": "true",
|
|
1470
|
+
children: [
|
|
1471
|
+
/* @__PURE__ */ jsx31("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1472
|
+
/* @__PURE__ */ jsx31("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1473
|
+
]
|
|
1474
|
+
}
|
|
1475
|
+
)
|
|
1476
|
+
}
|
|
1477
|
+
) : null
|
|
1478
|
+
] });
|
|
1479
|
+
}
|
|
1480
|
+
function DialogBody({ children, className }) {
|
|
1481
|
+
const { descriptionId } = useDialogContext("Body");
|
|
1482
|
+
const bodyClassName = ["malix-dialog__body", className].filter(Boolean).join(" ");
|
|
1483
|
+
return /* @__PURE__ */ jsx31("div", { id: descriptionId, className: bodyClassName, children });
|
|
1484
|
+
}
|
|
1485
|
+
function DialogFooter({ children, align = "end" }) {
|
|
1486
|
+
return /* @__PURE__ */ jsx31("div", { className: "malix-dialog__footer", "data-align": align, children });
|
|
1487
|
+
}
|
|
1488
|
+
Dialog.Header = DialogHeader;
|
|
1489
|
+
Dialog.Body = DialogBody;
|
|
1490
|
+
Dialog.Footer = DialogFooter;
|
|
1491
|
+
|
|
1492
|
+
// src/components/GlassPopover.tsx
|
|
1493
|
+
import { jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
1335
1494
|
function GlassPopover({
|
|
1336
1495
|
title,
|
|
1337
1496
|
onClose,
|
|
@@ -1339,29 +1498,29 @@ function GlassPopover({
|
|
|
1339
1498
|
className,
|
|
1340
1499
|
...props
|
|
1341
1500
|
}) {
|
|
1342
|
-
return /* @__PURE__ */
|
|
1501
|
+
return /* @__PURE__ */ jsxs28(
|
|
1343
1502
|
"div",
|
|
1344
1503
|
{
|
|
1345
1504
|
className: `malix-glass-popover${className ? ` ${className}` : ""}`,
|
|
1346
1505
|
...props,
|
|
1347
1506
|
children: [
|
|
1348
|
-
title || onClose ? /* @__PURE__ */
|
|
1349
|
-
title ? /* @__PURE__ */
|
|
1350
|
-
onClose ? /* @__PURE__ */
|
|
1507
|
+
title || onClose ? /* @__PURE__ */ jsxs28("div", { className: "malix-glass-popover__header", children: [
|
|
1508
|
+
title ? /* @__PURE__ */ jsx32("span", { className: "malix-glass-popover__title", children: title }) : null,
|
|
1509
|
+
onClose ? /* @__PURE__ */ jsx32(
|
|
1351
1510
|
"button",
|
|
1352
1511
|
{
|
|
1353
1512
|
type: "button",
|
|
1354
1513
|
className: "malix-glass-popover__close",
|
|
1355
1514
|
onClick: onClose,
|
|
1356
1515
|
"aria-label": "Close",
|
|
1357
|
-
children: /* @__PURE__ */
|
|
1358
|
-
/* @__PURE__ */
|
|
1359
|
-
/* @__PURE__ */
|
|
1516
|
+
children: /* @__PURE__ */ jsxs28("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1517
|
+
/* @__PURE__ */ jsx32("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1518
|
+
/* @__PURE__ */ jsx32("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1360
1519
|
] })
|
|
1361
1520
|
}
|
|
1362
1521
|
) : null
|
|
1363
1522
|
] }) : null,
|
|
1364
|
-
/* @__PURE__ */
|
|
1523
|
+
/* @__PURE__ */ jsx32("div", { className: "malix-glass-popover__body", children })
|
|
1365
1524
|
]
|
|
1366
1525
|
}
|
|
1367
1526
|
);
|
|
@@ -1369,7 +1528,7 @@ function GlassPopover({
|
|
|
1369
1528
|
|
|
1370
1529
|
// src/components/Accordion.tsx
|
|
1371
1530
|
import { useState as useState3 } from "react";
|
|
1372
|
-
import { jsx as
|
|
1531
|
+
import { jsx as jsx33, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
1373
1532
|
function Accordion({
|
|
1374
1533
|
title,
|
|
1375
1534
|
children,
|
|
@@ -1379,14 +1538,14 @@ function Accordion({
|
|
|
1379
1538
|
...props
|
|
1380
1539
|
}) {
|
|
1381
1540
|
const [open, setOpen] = useState3(defaultOpen);
|
|
1382
|
-
return /* @__PURE__ */
|
|
1541
|
+
return /* @__PURE__ */ jsxs29(
|
|
1383
1542
|
"div",
|
|
1384
1543
|
{
|
|
1385
1544
|
className: `malix-accordion${className ? ` ${className}` : ""}`,
|
|
1386
1545
|
"data-open": open,
|
|
1387
1546
|
...props,
|
|
1388
1547
|
children: [
|
|
1389
|
-
/* @__PURE__ */
|
|
1548
|
+
/* @__PURE__ */ jsxs29(
|
|
1390
1549
|
"button",
|
|
1391
1550
|
{
|
|
1392
1551
|
type: "button",
|
|
@@ -1394,9 +1553,9 @@ function Accordion({
|
|
|
1394
1553
|
onClick: () => setOpen((prev) => !prev),
|
|
1395
1554
|
"aria-expanded": open,
|
|
1396
1555
|
children: [
|
|
1397
|
-
icon ? /* @__PURE__ */
|
|
1398
|
-
/* @__PURE__ */
|
|
1399
|
-
/* @__PURE__ */
|
|
1556
|
+
icon ? /* @__PURE__ */ jsx33("span", { className: "malix-accordion__icon", children: icon }) : null,
|
|
1557
|
+
/* @__PURE__ */ jsx33("span", { className: "malix-accordion__title", children: title }),
|
|
1558
|
+
/* @__PURE__ */ jsx33(
|
|
1400
1559
|
"svg",
|
|
1401
1560
|
{
|
|
1402
1561
|
className: "malix-accordion__chevron",
|
|
@@ -1409,20 +1568,20 @@ function Accordion({
|
|
|
1409
1568
|
strokeLinecap: "round",
|
|
1410
1569
|
strokeLinejoin: "round",
|
|
1411
1570
|
"aria-hidden": "true",
|
|
1412
|
-
children: /* @__PURE__ */
|
|
1571
|
+
children: /* @__PURE__ */ jsx33("polyline", { points: "6 9 12 15 18 9" })
|
|
1413
1572
|
}
|
|
1414
1573
|
)
|
|
1415
1574
|
]
|
|
1416
1575
|
}
|
|
1417
1576
|
),
|
|
1418
|
-
/* @__PURE__ */
|
|
1577
|
+
/* @__PURE__ */ jsx33("div", { className: "malix-accordion__body", children })
|
|
1419
1578
|
]
|
|
1420
1579
|
}
|
|
1421
1580
|
);
|
|
1422
1581
|
}
|
|
1423
1582
|
|
|
1424
1583
|
// src/components/Badge.tsx
|
|
1425
|
-
import { jsx as
|
|
1584
|
+
import { jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
1426
1585
|
function Badge({
|
|
1427
1586
|
variant = "default",
|
|
1428
1587
|
dot = false,
|
|
@@ -1430,41 +1589,41 @@ function Badge({
|
|
|
1430
1589
|
className,
|
|
1431
1590
|
...props
|
|
1432
1591
|
}) {
|
|
1433
|
-
return /* @__PURE__ */
|
|
1592
|
+
return /* @__PURE__ */ jsxs30(
|
|
1434
1593
|
"span",
|
|
1435
1594
|
{
|
|
1436
1595
|
className: `malix-badge${className ? ` ${className}` : ""}`,
|
|
1437
1596
|
"data-variant": variant,
|
|
1438
1597
|
...props,
|
|
1439
1598
|
children: [
|
|
1440
|
-
dot ? /* @__PURE__ */
|
|
1441
|
-
/* @__PURE__ */
|
|
1599
|
+
dot ? /* @__PURE__ */ jsx34("span", { className: "malix-badge__dot" }) : null,
|
|
1600
|
+
/* @__PURE__ */ jsx34("span", { className: "malix-badge__label", children })
|
|
1442
1601
|
]
|
|
1443
1602
|
}
|
|
1444
1603
|
);
|
|
1445
1604
|
}
|
|
1446
1605
|
|
|
1447
1606
|
// src/components/Banner.tsx
|
|
1448
|
-
import { jsx as
|
|
1607
|
+
import { jsx as jsx35, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
1449
1608
|
var defaultIcons = {
|
|
1450
|
-
info: /* @__PURE__ */
|
|
1451
|
-
/* @__PURE__ */
|
|
1452
|
-
/* @__PURE__ */
|
|
1453
|
-
/* @__PURE__ */
|
|
1609
|
+
info: /* @__PURE__ */ jsxs31("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1610
|
+
/* @__PURE__ */ jsx35("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1611
|
+
/* @__PURE__ */ jsx35("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
1612
|
+
/* @__PURE__ */ jsx35("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
1454
1613
|
] }),
|
|
1455
|
-
success: /* @__PURE__ */
|
|
1456
|
-
/* @__PURE__ */
|
|
1457
|
-
/* @__PURE__ */
|
|
1614
|
+
success: /* @__PURE__ */ jsxs31("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1615
|
+
/* @__PURE__ */ jsx35("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
|
|
1616
|
+
/* @__PURE__ */ jsx35("polyline", { points: "22 4 12 14.01 9 11.01" })
|
|
1458
1617
|
] }),
|
|
1459
|
-
warning: /* @__PURE__ */
|
|
1460
|
-
/* @__PURE__ */
|
|
1461
|
-
/* @__PURE__ */
|
|
1462
|
-
/* @__PURE__ */
|
|
1618
|
+
warning: /* @__PURE__ */ jsxs31("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1619
|
+
/* @__PURE__ */ jsx35("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" }),
|
|
1620
|
+
/* @__PURE__ */ jsx35("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
1621
|
+
/* @__PURE__ */ jsx35("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
1463
1622
|
] }),
|
|
1464
|
-
error: /* @__PURE__ */
|
|
1465
|
-
/* @__PURE__ */
|
|
1466
|
-
/* @__PURE__ */
|
|
1467
|
-
/* @__PURE__ */
|
|
1623
|
+
error: /* @__PURE__ */ jsxs31("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1624
|
+
/* @__PURE__ */ jsx35("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1625
|
+
/* @__PURE__ */ jsx35("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
|
|
1626
|
+
/* @__PURE__ */ jsx35("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
|
|
1468
1627
|
] })
|
|
1469
1628
|
};
|
|
1470
1629
|
function Banner({
|
|
@@ -1475,7 +1634,7 @@ function Banner({
|
|
|
1475
1634
|
className,
|
|
1476
1635
|
...props
|
|
1477
1636
|
}) {
|
|
1478
|
-
return /* @__PURE__ */
|
|
1637
|
+
return /* @__PURE__ */ jsxs31(
|
|
1479
1638
|
"div",
|
|
1480
1639
|
{
|
|
1481
1640
|
className: `malix-banner${className ? ` ${className}` : ""}`,
|
|
@@ -1483,18 +1642,18 @@ function Banner({
|
|
|
1483
1642
|
role: "alert",
|
|
1484
1643
|
...props,
|
|
1485
1644
|
children: [
|
|
1486
|
-
/* @__PURE__ */
|
|
1487
|
-
/* @__PURE__ */
|
|
1488
|
-
onClose ? /* @__PURE__ */
|
|
1645
|
+
/* @__PURE__ */ jsx35("span", { className: "malix-banner__icon", children: icon ?? defaultIcons[variant] }),
|
|
1646
|
+
/* @__PURE__ */ jsx35("span", { className: "malix-banner__content", children }),
|
|
1647
|
+
onClose ? /* @__PURE__ */ jsx35(
|
|
1489
1648
|
"button",
|
|
1490
1649
|
{
|
|
1491
1650
|
type: "button",
|
|
1492
1651
|
className: "malix-banner__close",
|
|
1493
1652
|
onClick: onClose,
|
|
1494
1653
|
"aria-label": "Dismiss",
|
|
1495
|
-
children: /* @__PURE__ */
|
|
1496
|
-
/* @__PURE__ */
|
|
1497
|
-
/* @__PURE__ */
|
|
1654
|
+
children: /* @__PURE__ */ jsxs31("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1655
|
+
/* @__PURE__ */ jsx35("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1656
|
+
/* @__PURE__ */ jsx35("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1498
1657
|
] })
|
|
1499
1658
|
}
|
|
1500
1659
|
) : null
|
|
@@ -1504,7 +1663,7 @@ function Banner({
|
|
|
1504
1663
|
}
|
|
1505
1664
|
|
|
1506
1665
|
// src/components/Checkbox.tsx
|
|
1507
|
-
import { jsx as
|
|
1666
|
+
import { jsx as jsx36, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
1508
1667
|
function Checkbox({
|
|
1509
1668
|
checked = false,
|
|
1510
1669
|
onChange,
|
|
@@ -1519,7 +1678,7 @@ function Checkbox({
|
|
|
1519
1678
|
onChange(!checked);
|
|
1520
1679
|
}
|
|
1521
1680
|
};
|
|
1522
|
-
const checkbox = /* @__PURE__ */
|
|
1681
|
+
const checkbox = /* @__PURE__ */ jsxs32(
|
|
1523
1682
|
"button",
|
|
1524
1683
|
{
|
|
1525
1684
|
type: "button",
|
|
@@ -1533,7 +1692,7 @@ function Checkbox({
|
|
|
1533
1692
|
onClick: handleClick,
|
|
1534
1693
|
...props,
|
|
1535
1694
|
children: [
|
|
1536
|
-
checked && !indeterminate ? /* @__PURE__ */
|
|
1695
|
+
checked && !indeterminate ? /* @__PURE__ */ jsx36(
|
|
1537
1696
|
"svg",
|
|
1538
1697
|
{
|
|
1539
1698
|
className: "malix-checkbox__icon",
|
|
@@ -1541,7 +1700,7 @@ function Checkbox({
|
|
|
1541
1700
|
fill: "none",
|
|
1542
1701
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1543
1702
|
"aria-hidden": "true",
|
|
1544
|
-
children: /* @__PURE__ */
|
|
1703
|
+
children: /* @__PURE__ */ jsx36(
|
|
1545
1704
|
"path",
|
|
1546
1705
|
{
|
|
1547
1706
|
d: "M2 6l3 3 5-5",
|
|
@@ -1553,7 +1712,7 @@ function Checkbox({
|
|
|
1553
1712
|
)
|
|
1554
1713
|
}
|
|
1555
1714
|
) : null,
|
|
1556
|
-
indeterminate ? /* @__PURE__ */
|
|
1715
|
+
indeterminate ? /* @__PURE__ */ jsx36(
|
|
1557
1716
|
"svg",
|
|
1558
1717
|
{
|
|
1559
1718
|
className: "malix-checkbox__icon",
|
|
@@ -1561,7 +1720,7 @@ function Checkbox({
|
|
|
1561
1720
|
fill: "none",
|
|
1562
1721
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1563
1722
|
"aria-hidden": "true",
|
|
1564
|
-
children: /* @__PURE__ */
|
|
1723
|
+
children: /* @__PURE__ */ jsx36(
|
|
1565
1724
|
"path",
|
|
1566
1725
|
{
|
|
1567
1726
|
d: "M2 6h8",
|
|
@@ -1576,16 +1735,16 @@ function Checkbox({
|
|
|
1576
1735
|
}
|
|
1577
1736
|
);
|
|
1578
1737
|
if (label) {
|
|
1579
|
-
return /* @__PURE__ */
|
|
1738
|
+
return /* @__PURE__ */ jsxs32("label", { className: "malix-checkbox-row", children: [
|
|
1580
1739
|
checkbox,
|
|
1581
|
-
/* @__PURE__ */
|
|
1740
|
+
/* @__PURE__ */ jsx36("span", { className: "malix-checkbox-row__label", children: label })
|
|
1582
1741
|
] });
|
|
1583
1742
|
}
|
|
1584
1743
|
return checkbox;
|
|
1585
1744
|
}
|
|
1586
1745
|
|
|
1587
1746
|
// src/components/Radio.tsx
|
|
1588
|
-
import { jsx as
|
|
1747
|
+
import { jsx as jsx37, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
1589
1748
|
function Radio({
|
|
1590
1749
|
checked = false,
|
|
1591
1750
|
onChange,
|
|
@@ -1601,7 +1760,7 @@ function Radio({
|
|
|
1601
1760
|
onChange(value);
|
|
1602
1761
|
}
|
|
1603
1762
|
};
|
|
1604
|
-
const radio = /* @__PURE__ */
|
|
1763
|
+
const radio = /* @__PURE__ */ jsx37(
|
|
1605
1764
|
"button",
|
|
1606
1765
|
{
|
|
1607
1766
|
type: "button",
|
|
@@ -1615,20 +1774,20 @@ function Radio({
|
|
|
1615
1774
|
"data-value": value,
|
|
1616
1775
|
onClick: handleClick,
|
|
1617
1776
|
...props,
|
|
1618
|
-
children: /* @__PURE__ */
|
|
1777
|
+
children: /* @__PURE__ */ jsx37("span", { className: "malix-radio__dot" })
|
|
1619
1778
|
}
|
|
1620
1779
|
);
|
|
1621
1780
|
if (label) {
|
|
1622
|
-
return /* @__PURE__ */
|
|
1781
|
+
return /* @__PURE__ */ jsxs33("label", { className: "malix-radio-row", children: [
|
|
1623
1782
|
radio,
|
|
1624
|
-
/* @__PURE__ */
|
|
1783
|
+
/* @__PURE__ */ jsx37("span", { className: "malix-radio-row__label", children: label })
|
|
1625
1784
|
] });
|
|
1626
1785
|
}
|
|
1627
1786
|
return radio;
|
|
1628
1787
|
}
|
|
1629
1788
|
|
|
1630
1789
|
// src/components/Toggle.tsx
|
|
1631
|
-
import { jsx as
|
|
1790
|
+
import { jsx as jsx38, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
1632
1791
|
function Toggle({
|
|
1633
1792
|
checked = false,
|
|
1634
1793
|
onChange,
|
|
@@ -1642,7 +1801,7 @@ function Toggle({
|
|
|
1642
1801
|
onChange(!checked);
|
|
1643
1802
|
}
|
|
1644
1803
|
};
|
|
1645
|
-
const toggle = /* @__PURE__ */
|
|
1804
|
+
const toggle = /* @__PURE__ */ jsx38(
|
|
1646
1805
|
"button",
|
|
1647
1806
|
{
|
|
1648
1807
|
type: "button",
|
|
@@ -1654,12 +1813,12 @@ function Toggle({
|
|
|
1654
1813
|
disabled,
|
|
1655
1814
|
onClick: handleClick,
|
|
1656
1815
|
...props,
|
|
1657
|
-
children: /* @__PURE__ */
|
|
1816
|
+
children: /* @__PURE__ */ jsx38("span", { className: "malix-toggle__knob" })
|
|
1658
1817
|
}
|
|
1659
1818
|
);
|
|
1660
1819
|
if (label) {
|
|
1661
|
-
return /* @__PURE__ */
|
|
1662
|
-
/* @__PURE__ */
|
|
1820
|
+
return /* @__PURE__ */ jsxs34("div", { className: "malix-toggle-row", children: [
|
|
1821
|
+
/* @__PURE__ */ jsx38("span", { className: "malix-toggle-row__label", children: label }),
|
|
1663
1822
|
toggle
|
|
1664
1823
|
] });
|
|
1665
1824
|
}
|
|
@@ -1667,7 +1826,7 @@ function Toggle({
|
|
|
1667
1826
|
}
|
|
1668
1827
|
|
|
1669
1828
|
// src/components/Select.tsx
|
|
1670
|
-
import { jsx as
|
|
1829
|
+
import { jsx as jsx39, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
1671
1830
|
function Select({
|
|
1672
1831
|
value,
|
|
1673
1832
|
placeholder,
|
|
@@ -1678,14 +1837,14 @@ function Select({
|
|
|
1678
1837
|
className,
|
|
1679
1838
|
...props
|
|
1680
1839
|
}) {
|
|
1681
|
-
return /* @__PURE__ */
|
|
1840
|
+
return /* @__PURE__ */ jsxs35(
|
|
1682
1841
|
"div",
|
|
1683
1842
|
{
|
|
1684
1843
|
className: `malix-select${className ? ` ${className}` : ""}`,
|
|
1685
1844
|
"data-filled": filled || void 0,
|
|
1686
1845
|
"data-disabled": disabled || void 0,
|
|
1687
1846
|
children: [
|
|
1688
|
-
/* @__PURE__ */
|
|
1847
|
+
/* @__PURE__ */ jsxs35(
|
|
1689
1848
|
"select",
|
|
1690
1849
|
{
|
|
1691
1850
|
className: "malix-select__native",
|
|
@@ -1694,12 +1853,12 @@ function Select({
|
|
|
1694
1853
|
onChange: (e) => onChange?.(e.target.value),
|
|
1695
1854
|
...props,
|
|
1696
1855
|
children: [
|
|
1697
|
-
placeholder ? /* @__PURE__ */
|
|
1698
|
-
options.map((opt) => /* @__PURE__ */
|
|
1856
|
+
placeholder ? /* @__PURE__ */ jsx39("option", { value: "", disabled: true, children: placeholder }) : null,
|
|
1857
|
+
options.map((opt) => /* @__PURE__ */ jsx39("option", { value: opt.value, children: opt.label }, opt.value))
|
|
1699
1858
|
]
|
|
1700
1859
|
}
|
|
1701
1860
|
),
|
|
1702
|
-
/* @__PURE__ */
|
|
1861
|
+
/* @__PURE__ */ jsx39("span", { className: "malix-select__icon", children: /* @__PURE__ */ jsx39("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx39(
|
|
1703
1862
|
"path",
|
|
1704
1863
|
{
|
|
1705
1864
|
d: "M4 6L8 10L12 6",
|
|
@@ -1715,7 +1874,7 @@ function Select({
|
|
|
1715
1874
|
}
|
|
1716
1875
|
|
|
1717
1876
|
// src/components/SelectGroup.tsx
|
|
1718
|
-
import { jsx as
|
|
1877
|
+
import { jsx as jsx40, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
1719
1878
|
function SelectGroup({
|
|
1720
1879
|
label,
|
|
1721
1880
|
helperText,
|
|
@@ -1724,23 +1883,23 @@ function SelectGroup({
|
|
|
1724
1883
|
className,
|
|
1725
1884
|
...props
|
|
1726
1885
|
}) {
|
|
1727
|
-
return /* @__PURE__ */
|
|
1886
|
+
return /* @__PURE__ */ jsxs36(
|
|
1728
1887
|
"div",
|
|
1729
1888
|
{
|
|
1730
1889
|
className: `malix-select-group${className ? ` ${className}` : ""}`,
|
|
1731
1890
|
"data-error": error || void 0,
|
|
1732
1891
|
...props,
|
|
1733
1892
|
children: [
|
|
1734
|
-
label ? /* @__PURE__ */
|
|
1893
|
+
label ? /* @__PURE__ */ jsx40("span", { className: "malix-select-group__label", children: label }) : null,
|
|
1735
1894
|
children,
|
|
1736
|
-
helperText ? /* @__PURE__ */
|
|
1895
|
+
helperText ? /* @__PURE__ */ jsx40("span", { className: "malix-select-group__helper", children: helperText }) : null
|
|
1737
1896
|
]
|
|
1738
1897
|
}
|
|
1739
1898
|
);
|
|
1740
1899
|
}
|
|
1741
1900
|
|
|
1742
1901
|
// src/components/SegmentedControl.tsx
|
|
1743
|
-
import { jsx as
|
|
1902
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
1744
1903
|
function SegmentedControl({
|
|
1745
1904
|
items,
|
|
1746
1905
|
value,
|
|
@@ -1748,13 +1907,13 @@ function SegmentedControl({
|
|
|
1748
1907
|
className,
|
|
1749
1908
|
...props
|
|
1750
1909
|
}) {
|
|
1751
|
-
return /* @__PURE__ */
|
|
1910
|
+
return /* @__PURE__ */ jsx41(
|
|
1752
1911
|
"div",
|
|
1753
1912
|
{
|
|
1754
1913
|
className: `malix-segmented-control${className ? ` ${className}` : ""}`,
|
|
1755
1914
|
role: "radiogroup",
|
|
1756
1915
|
...props,
|
|
1757
|
-
children: items.map((item) => /* @__PURE__ */
|
|
1916
|
+
children: items.map((item) => /* @__PURE__ */ jsx41(
|
|
1758
1917
|
"button",
|
|
1759
1918
|
{
|
|
1760
1919
|
type: "button",
|
|
@@ -1772,7 +1931,7 @@ function SegmentedControl({
|
|
|
1772
1931
|
}
|
|
1773
1932
|
|
|
1774
1933
|
// src/components/DataTable.tsx
|
|
1775
|
-
import { jsx as
|
|
1934
|
+
import { jsx as jsx42, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
1776
1935
|
function DataTable({
|
|
1777
1936
|
columns,
|
|
1778
1937
|
data,
|
|
@@ -1781,13 +1940,13 @@ function DataTable({
|
|
|
1781
1940
|
className,
|
|
1782
1941
|
...props
|
|
1783
1942
|
}) {
|
|
1784
|
-
return /* @__PURE__ */
|
|
1943
|
+
return /* @__PURE__ */ jsxs37(
|
|
1785
1944
|
"table",
|
|
1786
1945
|
{
|
|
1787
1946
|
className: `malix-data-table${className ? ` ${className}` : ""}`,
|
|
1788
1947
|
...props,
|
|
1789
1948
|
children: [
|
|
1790
|
-
/* @__PURE__ */
|
|
1949
|
+
/* @__PURE__ */ jsx42("thead", { children: /* @__PURE__ */ jsx42("tr", { className: "malix-data-table__header-row", children: columns.map((col) => /* @__PURE__ */ jsx42(
|
|
1791
1950
|
"th",
|
|
1792
1951
|
{
|
|
1793
1952
|
className: "malix-data-table__header-cell",
|
|
@@ -1796,16 +1955,16 @@ function DataTable({
|
|
|
1796
1955
|
},
|
|
1797
1956
|
col.key
|
|
1798
1957
|
)) }) }),
|
|
1799
|
-
/* @__PURE__ */
|
|
1958
|
+
/* @__PURE__ */ jsx42("tbody", { className: "malix-data-table__body", children: data.length > 0 ? data.map((row, rowIndex) => /* @__PURE__ */ jsx42(
|
|
1800
1959
|
"tr",
|
|
1801
1960
|
{
|
|
1802
1961
|
className: "malix-data-table__data-row",
|
|
1803
1962
|
"data-clickable": onRowClick ? true : void 0,
|
|
1804
1963
|
onClick: onRowClick ? () => onRowClick(row) : void 0,
|
|
1805
|
-
children: columns.map((col) => /* @__PURE__ */
|
|
1964
|
+
children: columns.map((col) => /* @__PURE__ */ jsx42("td", { className: "malix-data-table__cell", children: col.render ? col.render(row[col.key], row) : row[col.key] }, col.key))
|
|
1806
1965
|
},
|
|
1807
1966
|
rowIndex
|
|
1808
|
-
)) : /* @__PURE__ */
|
|
1967
|
+
)) : /* @__PURE__ */ jsx42("tr", { className: "malix-data-table__data-row", children: /* @__PURE__ */ jsx42(
|
|
1809
1968
|
"td",
|
|
1810
1969
|
{
|
|
1811
1970
|
className: "malix-data-table__cell",
|
|
@@ -1819,12 +1978,12 @@ function DataTable({
|
|
|
1819
1978
|
}
|
|
1820
1979
|
|
|
1821
1980
|
// src/components/Pagination.tsx
|
|
1822
|
-
import { jsx as
|
|
1981
|
+
import { jsx as jsx43, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
1823
1982
|
function ChevronLeft() {
|
|
1824
|
-
return /* @__PURE__ */
|
|
1983
|
+
return /* @__PURE__ */ jsx43("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx43("path", { d: "M10 12L6 8L10 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1825
1984
|
}
|
|
1826
1985
|
function ChevronRight() {
|
|
1827
|
-
return /* @__PURE__ */
|
|
1986
|
+
return /* @__PURE__ */ jsx43("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx43("path", { d: "M6 4L10 8L6 12", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1828
1987
|
}
|
|
1829
1988
|
function Pagination({
|
|
1830
1989
|
currentPage,
|
|
@@ -1836,14 +1995,14 @@ function Pagination({
|
|
|
1836
1995
|
const isFirstPage = currentPage <= 1;
|
|
1837
1996
|
const isLastPage = currentPage >= totalPages;
|
|
1838
1997
|
const pages = Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
1839
|
-
return /* @__PURE__ */
|
|
1998
|
+
return /* @__PURE__ */ jsxs38(
|
|
1840
1999
|
"nav",
|
|
1841
2000
|
{
|
|
1842
2001
|
className: `malix-pagination${className ? ` ${className}` : ""}`,
|
|
1843
2002
|
"data-variant": variant,
|
|
1844
2003
|
"aria-label": "Pagination",
|
|
1845
2004
|
children: [
|
|
1846
|
-
/* @__PURE__ */
|
|
2005
|
+
/* @__PURE__ */ jsx43(
|
|
1847
2006
|
"button",
|
|
1848
2007
|
{
|
|
1849
2008
|
type: "button",
|
|
@@ -1852,10 +2011,10 @@ function Pagination({
|
|
|
1852
2011
|
disabled: isFirstPage,
|
|
1853
2012
|
onClick: () => onPageChange(currentPage - 1),
|
|
1854
2013
|
"aria-label": "Previous page",
|
|
1855
|
-
children: /* @__PURE__ */
|
|
2014
|
+
children: /* @__PURE__ */ jsx43(ChevronLeft, {})
|
|
1856
2015
|
}
|
|
1857
2016
|
),
|
|
1858
|
-
variant === "full" ? pages.map((page) => /* @__PURE__ */
|
|
2017
|
+
variant === "full" ? pages.map((page) => /* @__PURE__ */ jsx43(
|
|
1859
2018
|
"button",
|
|
1860
2019
|
{
|
|
1861
2020
|
type: "button",
|
|
@@ -1866,12 +2025,12 @@ function Pagination({
|
|
|
1866
2025
|
children: page
|
|
1867
2026
|
},
|
|
1868
2027
|
page
|
|
1869
|
-
)) : /* @__PURE__ */
|
|
2028
|
+
)) : /* @__PURE__ */ jsxs38("span", { className: "malix-pagination__label", children: [
|
|
1870
2029
|
currentPage,
|
|
1871
2030
|
" of ",
|
|
1872
2031
|
totalPages
|
|
1873
2032
|
] }),
|
|
1874
|
-
/* @__PURE__ */
|
|
2033
|
+
/* @__PURE__ */ jsx43(
|
|
1875
2034
|
"button",
|
|
1876
2035
|
{
|
|
1877
2036
|
type: "button",
|
|
@@ -1880,7 +2039,7 @@ function Pagination({
|
|
|
1880
2039
|
disabled: isLastPage,
|
|
1881
2040
|
onClick: () => onPageChange(currentPage + 1),
|
|
1882
2041
|
"aria-label": "Next page",
|
|
1883
|
-
children: /* @__PURE__ */
|
|
2042
|
+
children: /* @__PURE__ */ jsx43(ChevronRight, {})
|
|
1884
2043
|
}
|
|
1885
2044
|
)
|
|
1886
2045
|
]
|
|
@@ -1889,30 +2048,30 @@ function Pagination({
|
|
|
1889
2048
|
}
|
|
1890
2049
|
|
|
1891
2050
|
// src/components/StatusDot.tsx
|
|
1892
|
-
import { jsx as
|
|
2051
|
+
import { jsx as jsx44, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
1893
2052
|
function StatusDot({
|
|
1894
2053
|
variant = "default",
|
|
1895
2054
|
label,
|
|
1896
2055
|
className,
|
|
1897
2056
|
...props
|
|
1898
2057
|
}) {
|
|
1899
|
-
return /* @__PURE__ */
|
|
2058
|
+
return /* @__PURE__ */ jsxs39(
|
|
1900
2059
|
"span",
|
|
1901
2060
|
{
|
|
1902
2061
|
className: `malix-status-dot${className ? ` ${className}` : ""}`,
|
|
1903
2062
|
"data-variant": variant,
|
|
1904
2063
|
...props,
|
|
1905
2064
|
children: [
|
|
1906
|
-
/* @__PURE__ */
|
|
1907
|
-
/* @__PURE__ */
|
|
2065
|
+
/* @__PURE__ */ jsx44("span", { className: "malix-status-dot__dot", "aria-hidden": "true" }),
|
|
2066
|
+
/* @__PURE__ */ jsx44("span", { className: "malix-status-dot__label", children: label })
|
|
1908
2067
|
]
|
|
1909
2068
|
}
|
|
1910
2069
|
);
|
|
1911
2070
|
}
|
|
1912
2071
|
|
|
1913
2072
|
// src/components/Dropzone.tsx
|
|
1914
|
-
import { useRef as
|
|
1915
|
-
import { jsx as
|
|
2073
|
+
import { useRef as useRef7, useState as useState4 } from "react";
|
|
2074
|
+
import { jsx as jsx45, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
1916
2075
|
function Dropzone({
|
|
1917
2076
|
onDrop,
|
|
1918
2077
|
accept,
|
|
@@ -1923,7 +2082,7 @@ function Dropzone({
|
|
|
1923
2082
|
...props
|
|
1924
2083
|
}) {
|
|
1925
2084
|
const [dragging, setDragging] = useState4(false);
|
|
1926
|
-
const inputRef =
|
|
2085
|
+
const inputRef = useRef7(null);
|
|
1927
2086
|
function handleDragOver(event) {
|
|
1928
2087
|
event.preventDefault();
|
|
1929
2088
|
if (!disabled) setDragging(true);
|
|
@@ -1947,7 +2106,7 @@ function Dropzone({
|
|
|
1947
2106
|
function handleClick() {
|
|
1948
2107
|
if (!disabled) inputRef.current?.click();
|
|
1949
2108
|
}
|
|
1950
|
-
return /* @__PURE__ */
|
|
2109
|
+
return /* @__PURE__ */ jsxs40(
|
|
1951
2110
|
"div",
|
|
1952
2111
|
{
|
|
1953
2112
|
className: `malix-dropzone${className ? ` ${className}` : ""}`,
|
|
@@ -1962,7 +2121,7 @@ function Dropzone({
|
|
|
1962
2121
|
"aria-disabled": disabled || void 0,
|
|
1963
2122
|
...props,
|
|
1964
2123
|
children: [
|
|
1965
|
-
/* @__PURE__ */
|
|
2124
|
+
/* @__PURE__ */ jsx45(
|
|
1966
2125
|
"input",
|
|
1967
2126
|
{
|
|
1968
2127
|
ref: inputRef,
|
|
@@ -1973,7 +2132,7 @@ function Dropzone({
|
|
|
1973
2132
|
"aria-hidden": "true"
|
|
1974
2133
|
}
|
|
1975
2134
|
),
|
|
1976
|
-
/* @__PURE__ */
|
|
2135
|
+
/* @__PURE__ */ jsxs40(
|
|
1977
2136
|
"svg",
|
|
1978
2137
|
{
|
|
1979
2138
|
className: "malix-dropzone__icon",
|
|
@@ -1987,23 +2146,23 @@ function Dropzone({
|
|
|
1987
2146
|
strokeLinejoin: "round",
|
|
1988
2147
|
"aria-hidden": "true",
|
|
1989
2148
|
children: [
|
|
1990
|
-
/* @__PURE__ */
|
|
1991
|
-
/* @__PURE__ */
|
|
1992
|
-
/* @__PURE__ */
|
|
2149
|
+
/* @__PURE__ */ jsx45("path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242" }),
|
|
2150
|
+
/* @__PURE__ */ jsx45("path", { d: "M12 12v9" }),
|
|
2151
|
+
/* @__PURE__ */ jsx45("path", { d: "m16 16-4-4-4 4" })
|
|
1993
2152
|
]
|
|
1994
2153
|
}
|
|
1995
2154
|
),
|
|
1996
|
-
/* @__PURE__ */
|
|
1997
|
-
/* @__PURE__ */
|
|
1998
|
-
/* @__PURE__ */
|
|
2155
|
+
/* @__PURE__ */ jsx45("span", { className: "malix-dropzone__title", children: title }),
|
|
2156
|
+
/* @__PURE__ */ jsx45("span", { className: "malix-dropzone__hint", children: hint }),
|
|
2157
|
+
/* @__PURE__ */ jsx45("span", { className: "malix-dropzone__browse-btn", children: "Browse files" })
|
|
1999
2158
|
]
|
|
2000
2159
|
}
|
|
2001
2160
|
);
|
|
2002
2161
|
}
|
|
2003
2162
|
|
|
2004
2163
|
// src/components/SplitPane.tsx
|
|
2005
|
-
import { useState as useState5, useCallback as useCallback2, useRef as
|
|
2006
|
-
import { jsx as
|
|
2164
|
+
import { useState as useState5, useCallback as useCallback2, useRef as useRef8, useEffect as useEffect4 } from "react";
|
|
2165
|
+
import { jsx as jsx46, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
2007
2166
|
function SplitPane({
|
|
2008
2167
|
leftPanel,
|
|
2009
2168
|
rightPanel,
|
|
@@ -2014,13 +2173,13 @@ function SplitPane({
|
|
|
2014
2173
|
...props
|
|
2015
2174
|
}) {
|
|
2016
2175
|
const [split, setSplit] = useState5(defaultSplit);
|
|
2017
|
-
const containerRef =
|
|
2018
|
-
const dragging =
|
|
2176
|
+
const containerRef = useRef8(null);
|
|
2177
|
+
const dragging = useRef8(false);
|
|
2019
2178
|
const onMouseDown = useCallback2((e) => {
|
|
2020
2179
|
e.preventDefault();
|
|
2021
2180
|
dragging.current = true;
|
|
2022
2181
|
}, []);
|
|
2023
|
-
|
|
2182
|
+
useEffect4(() => {
|
|
2024
2183
|
function onMouseMove(e) {
|
|
2025
2184
|
if (!dragging.current || !containerRef.current) return;
|
|
2026
2185
|
const rect = containerRef.current.getBoundingClientRect();
|
|
@@ -2038,18 +2197,18 @@ function SplitPane({
|
|
|
2038
2197
|
document.removeEventListener("mouseup", onMouseUp);
|
|
2039
2198
|
};
|
|
2040
2199
|
}, []);
|
|
2041
|
-
return /* @__PURE__ */
|
|
2200
|
+
return /* @__PURE__ */ jsxs41(
|
|
2042
2201
|
"div",
|
|
2043
2202
|
{
|
|
2044
2203
|
ref: containerRef,
|
|
2045
2204
|
className: `malix-split-pane${className ? ` ${className}` : ""}`,
|
|
2046
2205
|
...props,
|
|
2047
2206
|
children: [
|
|
2048
|
-
/* @__PURE__ */
|
|
2049
|
-
leftTitle ? /* @__PURE__ */
|
|
2207
|
+
/* @__PURE__ */ jsxs41("div", { className: "malix-split-pane__left", style: { width: `${split}%` }, children: [
|
|
2208
|
+
leftTitle ? /* @__PURE__ */ jsx46("span", { className: "malix-split-pane__panel-title", children: leftTitle }) : null,
|
|
2050
2209
|
leftPanel
|
|
2051
2210
|
] }),
|
|
2052
|
-
/* @__PURE__ */
|
|
2211
|
+
/* @__PURE__ */ jsxs41(
|
|
2053
2212
|
"div",
|
|
2054
2213
|
{
|
|
2055
2214
|
className: "malix-split-pane__handle",
|
|
@@ -2060,14 +2219,14 @@ function SplitPane({
|
|
|
2060
2219
|
"aria-label": "Resize panels",
|
|
2061
2220
|
onMouseDown,
|
|
2062
2221
|
children: [
|
|
2063
|
-
/* @__PURE__ */
|
|
2064
|
-
/* @__PURE__ */
|
|
2065
|
-
/* @__PURE__ */
|
|
2222
|
+
/* @__PURE__ */ jsx46("span", { className: "malix-split-pane__handle-dot", "aria-hidden": "true" }),
|
|
2223
|
+
/* @__PURE__ */ jsx46("span", { className: "malix-split-pane__handle-dot", "aria-hidden": "true" }),
|
|
2224
|
+
/* @__PURE__ */ jsx46("span", { className: "malix-split-pane__handle-dot", "aria-hidden": "true" })
|
|
2066
2225
|
]
|
|
2067
2226
|
}
|
|
2068
2227
|
),
|
|
2069
|
-
/* @__PURE__ */
|
|
2070
|
-
rightTitle ? /* @__PURE__ */
|
|
2228
|
+
/* @__PURE__ */ jsxs41("div", { className: "malix-split-pane__right", style: { width: `${100 - split}%` }, children: [
|
|
2229
|
+
rightTitle ? /* @__PURE__ */ jsx46("span", { className: "malix-split-pane__panel-title", children: rightTitle }) : null,
|
|
2071
2230
|
rightPanel
|
|
2072
2231
|
] })
|
|
2073
2232
|
]
|
|
@@ -2076,7 +2235,7 @@ function SplitPane({
|
|
|
2076
2235
|
}
|
|
2077
2236
|
|
|
2078
2237
|
// src/components/PricingCard.tsx
|
|
2079
|
-
import { jsx as
|
|
2238
|
+
import { jsx as jsx47, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
2080
2239
|
function PricingCard({
|
|
2081
2240
|
planName,
|
|
2082
2241
|
price,
|
|
@@ -2089,21 +2248,21 @@ function PricingCard({
|
|
|
2089
2248
|
className,
|
|
2090
2249
|
...props
|
|
2091
2250
|
}) {
|
|
2092
|
-
return /* @__PURE__ */
|
|
2251
|
+
return /* @__PURE__ */ jsxs42(
|
|
2093
2252
|
"div",
|
|
2094
2253
|
{
|
|
2095
2254
|
className: `malix-pricing-card${className ? ` ${className}` : ""}`,
|
|
2096
2255
|
"data-highlighted": highlighted || void 0,
|
|
2097
2256
|
...props,
|
|
2098
2257
|
children: [
|
|
2099
|
-
/* @__PURE__ */
|
|
2100
|
-
/* @__PURE__ */
|
|
2101
|
-
/* @__PURE__ */
|
|
2102
|
-
/* @__PURE__ */
|
|
2258
|
+
/* @__PURE__ */ jsx47("span", { className: "malix-pricing-card__badge", children: planName }),
|
|
2259
|
+
/* @__PURE__ */ jsxs42("div", { className: "malix-pricing-card__price-row", children: [
|
|
2260
|
+
/* @__PURE__ */ jsx47("span", { className: "malix-pricing-card__price", children: price }),
|
|
2261
|
+
/* @__PURE__ */ jsx47("span", { className: "malix-pricing-card__period", children: period })
|
|
2103
2262
|
] }),
|
|
2104
|
-
description ? /* @__PURE__ */
|
|
2105
|
-
/* @__PURE__ */
|
|
2106
|
-
/* @__PURE__ */
|
|
2263
|
+
description ? /* @__PURE__ */ jsx47("p", { className: "malix-pricing-card__description", children: description }) : null,
|
|
2264
|
+
/* @__PURE__ */ jsx47("ul", { className: "malix-pricing-card__features", children: features.map((feature, i) => /* @__PURE__ */ jsxs42("li", { className: "malix-pricing-card__feature-item", children: [
|
|
2265
|
+
/* @__PURE__ */ jsx47(
|
|
2107
2266
|
"svg",
|
|
2108
2267
|
{
|
|
2109
2268
|
className: "malix-pricing-card__check-icon",
|
|
@@ -2116,12 +2275,12 @@ function PricingCard({
|
|
|
2116
2275
|
strokeLinecap: "round",
|
|
2117
2276
|
strokeLinejoin: "round",
|
|
2118
2277
|
"aria-hidden": "true",
|
|
2119
|
-
children: /* @__PURE__ */
|
|
2278
|
+
children: /* @__PURE__ */ jsx47("polyline", { points: "20 6 9 17 4 12" })
|
|
2120
2279
|
}
|
|
2121
2280
|
),
|
|
2122
|
-
/* @__PURE__ */
|
|
2281
|
+
/* @__PURE__ */ jsx47("span", { children: feature })
|
|
2123
2282
|
] }, i)) }),
|
|
2124
|
-
/* @__PURE__ */
|
|
2283
|
+
/* @__PURE__ */ jsx47(
|
|
2125
2284
|
"button",
|
|
2126
2285
|
{
|
|
2127
2286
|
type: "button",
|
|
@@ -2136,7 +2295,7 @@ function PricingCard({
|
|
|
2136
2295
|
}
|
|
2137
2296
|
|
|
2138
2297
|
// src/components/OnboardingPopover.tsx
|
|
2139
|
-
import { jsx as
|
|
2298
|
+
import { jsx as jsx48, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
2140
2299
|
function OnboardingPopover({
|
|
2141
2300
|
step,
|
|
2142
2301
|
totalSteps,
|
|
@@ -2148,7 +2307,7 @@ function OnboardingPopover({
|
|
|
2148
2307
|
className,
|
|
2149
2308
|
...props
|
|
2150
2309
|
}) {
|
|
2151
|
-
return /* @__PURE__ */
|
|
2310
|
+
return /* @__PURE__ */ jsxs43(
|
|
2152
2311
|
"div",
|
|
2153
2312
|
{
|
|
2154
2313
|
className: `malix-onboarding-popover${className ? ` ${className}` : ""}`,
|
|
@@ -2156,16 +2315,16 @@ function OnboardingPopover({
|
|
|
2156
2315
|
"aria-label": `Step ${step} of ${totalSteps}: ${title}`,
|
|
2157
2316
|
...props,
|
|
2158
2317
|
children: [
|
|
2159
|
-
/* @__PURE__ */
|
|
2318
|
+
/* @__PURE__ */ jsxs43("span", { className: "malix-onboarding-popover__step", children: [
|
|
2160
2319
|
"Step ",
|
|
2161
2320
|
step,
|
|
2162
2321
|
" of ",
|
|
2163
2322
|
totalSteps
|
|
2164
2323
|
] }),
|
|
2165
|
-
/* @__PURE__ */
|
|
2166
|
-
/* @__PURE__ */
|
|
2167
|
-
/* @__PURE__ */
|
|
2168
|
-
onSkip ? /* @__PURE__ */
|
|
2324
|
+
/* @__PURE__ */ jsx48("h3", { className: "malix-onboarding-popover__title", children: title }),
|
|
2325
|
+
/* @__PURE__ */ jsx48("p", { className: "malix-onboarding-popover__description", children: description }),
|
|
2326
|
+
/* @__PURE__ */ jsxs43("div", { className: "malix-onboarding-popover__actions", children: [
|
|
2327
|
+
onSkip ? /* @__PURE__ */ jsx48(
|
|
2169
2328
|
"button",
|
|
2170
2329
|
{
|
|
2171
2330
|
type: "button",
|
|
@@ -2174,7 +2333,7 @@ function OnboardingPopover({
|
|
|
2174
2333
|
children: "Skip"
|
|
2175
2334
|
}
|
|
2176
2335
|
) : null,
|
|
2177
|
-
onNext ? /* @__PURE__ */
|
|
2336
|
+
onNext ? /* @__PURE__ */ jsx48(
|
|
2178
2337
|
"button",
|
|
2179
2338
|
{
|
|
2180
2339
|
type: "button",
|
|
@@ -2190,20 +2349,20 @@ function OnboardingPopover({
|
|
|
2190
2349
|
}
|
|
2191
2350
|
|
|
2192
2351
|
// src/components/CreditsIndicator.tsx
|
|
2193
|
-
import { jsx as
|
|
2352
|
+
import { jsx as jsx49, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
2194
2353
|
function CreditsIndicator({
|
|
2195
2354
|
remaining,
|
|
2196
2355
|
label = "Credits Remaining",
|
|
2197
2356
|
className,
|
|
2198
2357
|
...props
|
|
2199
2358
|
}) {
|
|
2200
|
-
return /* @__PURE__ */
|
|
2359
|
+
return /* @__PURE__ */ jsxs44(
|
|
2201
2360
|
"div",
|
|
2202
2361
|
{
|
|
2203
2362
|
className: `malix-credits-indicator${className ? ` ${className}` : ""}`,
|
|
2204
2363
|
...props,
|
|
2205
2364
|
children: [
|
|
2206
|
-
/* @__PURE__ */
|
|
2365
|
+
/* @__PURE__ */ jsx49("span", { className: "malix-credits-indicator__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsxs44(
|
|
2207
2366
|
"svg",
|
|
2208
2367
|
{
|
|
2209
2368
|
width: "20",
|
|
@@ -2215,15 +2374,15 @@ function CreditsIndicator({
|
|
|
2215
2374
|
strokeLinecap: "round",
|
|
2216
2375
|
strokeLinejoin: "round",
|
|
2217
2376
|
children: [
|
|
2218
|
-
/* @__PURE__ */
|
|
2219
|
-
/* @__PURE__ */
|
|
2220
|
-
/* @__PURE__ */
|
|
2377
|
+
/* @__PURE__ */ jsx49("ellipse", { cx: "12", cy: "6", rx: "8", ry: "3" }),
|
|
2378
|
+
/* @__PURE__ */ jsx49("path", { d: "M4 6v6c0 1.66 3.58 3 8 3s8-1.34 8-3V6" }),
|
|
2379
|
+
/* @__PURE__ */ jsx49("path", { d: "M4 12v6c0 1.66 3.58 3 8 3s8-1.34 8-3v-6" })
|
|
2221
2380
|
]
|
|
2222
2381
|
}
|
|
2223
2382
|
) }),
|
|
2224
|
-
/* @__PURE__ */
|
|
2225
|
-
/* @__PURE__ */
|
|
2226
|
-
/* @__PURE__ */
|
|
2383
|
+
/* @__PURE__ */ jsxs44("div", { className: "malix-credits-indicator__info", children: [
|
|
2384
|
+
/* @__PURE__ */ jsx49("span", { className: "malix-credits-indicator__label", children: label }),
|
|
2385
|
+
/* @__PURE__ */ jsx49("span", { className: "malix-credits-indicator__value", children: remaining })
|
|
2227
2386
|
] })
|
|
2228
2387
|
]
|
|
2229
2388
|
}
|
|
@@ -2231,7 +2390,7 @@ function CreditsIndicator({
|
|
|
2231
2390
|
}
|
|
2232
2391
|
|
|
2233
2392
|
// src/components/LanguageSelector.tsx
|
|
2234
|
-
import { jsx as
|
|
2393
|
+
import { jsx as jsx50, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
2235
2394
|
function LanguageSelector({
|
|
2236
2395
|
value,
|
|
2237
2396
|
options,
|
|
@@ -2241,13 +2400,13 @@ function LanguageSelector({
|
|
|
2241
2400
|
}) {
|
|
2242
2401
|
const selectedOption = options?.find((opt) => opt.value === value);
|
|
2243
2402
|
const displayLabel = selectedOption?.label ?? value;
|
|
2244
|
-
return /* @__PURE__ */
|
|
2403
|
+
return /* @__PURE__ */ jsxs45(
|
|
2245
2404
|
"div",
|
|
2246
2405
|
{
|
|
2247
2406
|
className: `malix-language-selector${className ? ` ${className}` : ""}`,
|
|
2248
2407
|
...props,
|
|
2249
2408
|
children: [
|
|
2250
|
-
/* @__PURE__ */
|
|
2409
|
+
/* @__PURE__ */ jsx50("span", { className: "malix-language-selector__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsxs45(
|
|
2251
2410
|
"svg",
|
|
2252
2411
|
{
|
|
2253
2412
|
width: "16",
|
|
@@ -2259,24 +2418,24 @@ function LanguageSelector({
|
|
|
2259
2418
|
strokeLinecap: "round",
|
|
2260
2419
|
strokeLinejoin: "round",
|
|
2261
2420
|
children: [
|
|
2262
|
-
/* @__PURE__ */
|
|
2263
|
-
/* @__PURE__ */
|
|
2264
|
-
/* @__PURE__ */
|
|
2421
|
+
/* @__PURE__ */ jsx50("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2422
|
+
/* @__PURE__ */ jsx50("line", { x1: "2", y1: "12", x2: "22", y2: "12" }),
|
|
2423
|
+
/* @__PURE__ */ jsx50("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" })
|
|
2265
2424
|
]
|
|
2266
2425
|
}
|
|
2267
2426
|
) }),
|
|
2268
|
-
/* @__PURE__ */
|
|
2427
|
+
/* @__PURE__ */ jsx50(
|
|
2269
2428
|
"select",
|
|
2270
2429
|
{
|
|
2271
2430
|
className: "malix-language-selector__select",
|
|
2272
2431
|
value,
|
|
2273
2432
|
onChange: (e) => onChange?.(e.target.value),
|
|
2274
2433
|
"aria-label": "Select language",
|
|
2275
|
-
children: options ? options.map((opt) => /* @__PURE__ */
|
|
2434
|
+
children: options ? options.map((opt) => /* @__PURE__ */ jsx50("option", { value: opt.value, children: opt.label }, opt.value)) : /* @__PURE__ */ jsx50("option", { value, children: displayLabel })
|
|
2276
2435
|
}
|
|
2277
2436
|
),
|
|
2278
|
-
/* @__PURE__ */
|
|
2279
|
-
/* @__PURE__ */
|
|
2437
|
+
/* @__PURE__ */ jsx50("span", { className: "malix-language-selector__label", children: displayLabel }),
|
|
2438
|
+
/* @__PURE__ */ jsx50("span", { className: "malix-language-selector__chevron", "aria-hidden": "true", children: /* @__PURE__ */ jsx50(
|
|
2280
2439
|
"svg",
|
|
2281
2440
|
{
|
|
2282
2441
|
width: "14",
|
|
@@ -2287,7 +2446,7 @@ function LanguageSelector({
|
|
|
2287
2446
|
strokeWidth: "2",
|
|
2288
2447
|
strokeLinecap: "round",
|
|
2289
2448
|
strokeLinejoin: "round",
|
|
2290
|
-
children: /* @__PURE__ */
|
|
2449
|
+
children: /* @__PURE__ */ jsx50("polyline", { points: "6 9 12 15 18 9" })
|
|
2291
2450
|
}
|
|
2292
2451
|
) })
|
|
2293
2452
|
]
|
|
@@ -2296,7 +2455,7 @@ function LanguageSelector({
|
|
|
2296
2455
|
}
|
|
2297
2456
|
|
|
2298
2457
|
// src/components/UserProfilePopover.tsx
|
|
2299
|
-
import { Fragment as Fragment2, jsx as
|
|
2458
|
+
import { Fragment as Fragment2, jsx as jsx51, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
2300
2459
|
function UserProfilePopover({
|
|
2301
2460
|
name,
|
|
2302
2461
|
email,
|
|
@@ -2307,26 +2466,26 @@ function UserProfilePopover({
|
|
|
2307
2466
|
className,
|
|
2308
2467
|
...props
|
|
2309
2468
|
}) {
|
|
2310
|
-
return /* @__PURE__ */
|
|
2469
|
+
return /* @__PURE__ */ jsxs46(
|
|
2311
2470
|
"div",
|
|
2312
2471
|
{
|
|
2313
2472
|
className: `malix-user-profile${className ? ` ${className}` : ""}`,
|
|
2314
2473
|
...props,
|
|
2315
2474
|
children: [
|
|
2316
|
-
/* @__PURE__ */
|
|
2317
|
-
avatar ? /* @__PURE__ */
|
|
2318
|
-
/* @__PURE__ */
|
|
2319
|
-
/* @__PURE__ */
|
|
2320
|
-
/* @__PURE__ */
|
|
2475
|
+
/* @__PURE__ */ jsxs46("div", { className: "malix-user-profile__header", children: [
|
|
2476
|
+
avatar ? /* @__PURE__ */ jsx51("span", { className: "malix-user-profile__avatar", children: avatar }) : null,
|
|
2477
|
+
/* @__PURE__ */ jsxs46("div", { className: "malix-user-profile__info", children: [
|
|
2478
|
+
/* @__PURE__ */ jsx51("span", { className: "malix-user-profile__name", children: name }),
|
|
2479
|
+
/* @__PURE__ */ jsx51("span", { className: "malix-user-profile__email", children: email })
|
|
2321
2480
|
] })
|
|
2322
2481
|
] }),
|
|
2323
|
-
credits !== void 0 ? /* @__PURE__ */
|
|
2324
|
-
/* @__PURE__ */
|
|
2325
|
-
/* @__PURE__ */
|
|
2482
|
+
credits !== void 0 ? /* @__PURE__ */ jsxs46("div", { className: "malix-user-profile__credits", children: [
|
|
2483
|
+
/* @__PURE__ */ jsx51("span", { className: "malix-user-profile__credits-label", children: "Credits" }),
|
|
2484
|
+
/* @__PURE__ */ jsx51("span", { className: "malix-user-profile__credits-value", children: credits })
|
|
2326
2485
|
] }) : null,
|
|
2327
|
-
menuItems && menuItems.length > 0 ? /* @__PURE__ */
|
|
2328
|
-
/* @__PURE__ */
|
|
2329
|
-
/* @__PURE__ */
|
|
2486
|
+
menuItems && menuItems.length > 0 ? /* @__PURE__ */ jsxs46(Fragment2, { children: [
|
|
2487
|
+
/* @__PURE__ */ jsx51("hr", { className: "malix-user-profile__divider" }),
|
|
2488
|
+
/* @__PURE__ */ jsx51("nav", { className: "malix-user-profile__menu", role: "menu", children: menuItems.map((item, i) => /* @__PURE__ */ jsxs46(
|
|
2330
2489
|
"button",
|
|
2331
2490
|
{
|
|
2332
2491
|
type: "button",
|
|
@@ -2334,23 +2493,23 @@ function UserProfilePopover({
|
|
|
2334
2493
|
role: "menuitem",
|
|
2335
2494
|
onClick: item.onClick,
|
|
2336
2495
|
children: [
|
|
2337
|
-
item.icon ? /* @__PURE__ */
|
|
2338
|
-
/* @__PURE__ */
|
|
2496
|
+
item.icon ? /* @__PURE__ */ jsx51("span", { className: "malix-user-profile__menu-item-icon", children: item.icon }) : null,
|
|
2497
|
+
/* @__PURE__ */ jsx51("span", { className: "malix-user-profile__menu-item-label", children: item.label })
|
|
2339
2498
|
]
|
|
2340
2499
|
},
|
|
2341
2500
|
i
|
|
2342
2501
|
)) })
|
|
2343
2502
|
] }) : null,
|
|
2344
|
-
onLogout ? /* @__PURE__ */
|
|
2345
|
-
/* @__PURE__ */
|
|
2346
|
-
/* @__PURE__ */
|
|
2503
|
+
onLogout ? /* @__PURE__ */ jsxs46(Fragment2, { children: [
|
|
2504
|
+
/* @__PURE__ */ jsx51("hr", { className: "malix-user-profile__divider" }),
|
|
2505
|
+
/* @__PURE__ */ jsxs46(
|
|
2347
2506
|
"button",
|
|
2348
2507
|
{
|
|
2349
2508
|
type: "button",
|
|
2350
2509
|
className: "malix-user-profile__logout",
|
|
2351
2510
|
onClick: onLogout,
|
|
2352
2511
|
children: [
|
|
2353
|
-
/* @__PURE__ */
|
|
2512
|
+
/* @__PURE__ */ jsxs46(
|
|
2354
2513
|
"svg",
|
|
2355
2514
|
{
|
|
2356
2515
|
width: "16",
|
|
@@ -2362,13 +2521,13 @@ function UserProfilePopover({
|
|
|
2362
2521
|
strokeLinecap: "round",
|
|
2363
2522
|
strokeLinejoin: "round",
|
|
2364
2523
|
children: [
|
|
2365
|
-
/* @__PURE__ */
|
|
2366
|
-
/* @__PURE__ */
|
|
2367
|
-
/* @__PURE__ */
|
|
2524
|
+
/* @__PURE__ */ jsx51("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }),
|
|
2525
|
+
/* @__PURE__ */ jsx51("polyline", { points: "16 17 21 12 16 7" }),
|
|
2526
|
+
/* @__PURE__ */ jsx51("line", { x1: "21", y1: "12", x2: "9", y2: "12" })
|
|
2368
2527
|
]
|
|
2369
2528
|
}
|
|
2370
2529
|
),
|
|
2371
|
-
/* @__PURE__ */
|
|
2530
|
+
/* @__PURE__ */ jsx51("span", { children: "Log out" })
|
|
2372
2531
|
]
|
|
2373
2532
|
}
|
|
2374
2533
|
)
|
|
@@ -2379,7 +2538,7 @@ function UserProfilePopover({
|
|
|
2379
2538
|
}
|
|
2380
2539
|
|
|
2381
2540
|
// src/components/ChatBubble.tsx
|
|
2382
|
-
import { jsx as
|
|
2541
|
+
import { jsx as jsx52, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
2383
2542
|
function ChatBubble({
|
|
2384
2543
|
variant,
|
|
2385
2544
|
message,
|
|
@@ -2388,22 +2547,22 @@ function ChatBubble({
|
|
|
2388
2547
|
className
|
|
2389
2548
|
}) {
|
|
2390
2549
|
const content = children ?? message;
|
|
2391
|
-
return /* @__PURE__ */
|
|
2550
|
+
return /* @__PURE__ */ jsxs47(
|
|
2392
2551
|
"div",
|
|
2393
2552
|
{
|
|
2394
2553
|
className: `malix-chat-bubble-row${className ? ` ${className}` : ""}`,
|
|
2395
2554
|
"data-variant": variant,
|
|
2396
2555
|
children: [
|
|
2397
|
-
/* @__PURE__ */
|
|
2398
|
-
variant === "user" && avatarInitials ? /* @__PURE__ */
|
|
2556
|
+
/* @__PURE__ */ jsx52("div", { className: "malix-chat-bubble", "data-variant": variant, children: /* @__PURE__ */ jsx52("span", { className: "malix-chat-bubble__text", children: content }) }),
|
|
2557
|
+
variant === "user" && avatarInitials ? /* @__PURE__ */ jsx52("span", { className: "malix-chat-bubble__avatar", children: avatarInitials }) : null
|
|
2399
2558
|
]
|
|
2400
2559
|
}
|
|
2401
2560
|
);
|
|
2402
2561
|
}
|
|
2403
2562
|
|
|
2404
2563
|
// src/components/AIAssistantPanel.tsx
|
|
2405
|
-
import { useState as useState6, useRef as
|
|
2406
|
-
import { jsx as
|
|
2564
|
+
import { useState as useState6, useRef as useRef9, useEffect as useEffect5 } from "react";
|
|
2565
|
+
import { jsx as jsx53, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
2407
2566
|
function AIAssistantPanel({
|
|
2408
2567
|
title = "AI Assistant",
|
|
2409
2568
|
messages,
|
|
@@ -2415,8 +2574,8 @@ function AIAssistantPanel({
|
|
|
2415
2574
|
className
|
|
2416
2575
|
}) {
|
|
2417
2576
|
const [draft, setDraft] = useState6("");
|
|
2418
|
-
const bodyRef =
|
|
2419
|
-
|
|
2577
|
+
const bodyRef = useRef9(null);
|
|
2578
|
+
useEffect5(() => {
|
|
2420
2579
|
if (bodyRef.current) {
|
|
2421
2580
|
bodyRef.current.scrollTop = bodyRef.current.scrollHeight;
|
|
2422
2581
|
}
|
|
@@ -2433,25 +2592,25 @@ function AIAssistantPanel({
|
|
|
2433
2592
|
handleSend();
|
|
2434
2593
|
}
|
|
2435
2594
|
};
|
|
2436
|
-
return /* @__PURE__ */
|
|
2437
|
-
/* @__PURE__ */
|
|
2438
|
-
/* @__PURE__ */
|
|
2439
|
-
/* @__PURE__ */
|
|
2440
|
-
onClose ? /* @__PURE__ */
|
|
2595
|
+
return /* @__PURE__ */ jsxs48("div", { className: `malix-ai-panel${className ? ` ${className}` : ""}`, children: [
|
|
2596
|
+
/* @__PURE__ */ jsxs48("div", { className: "malix-ai-panel__header", children: [
|
|
2597
|
+
/* @__PURE__ */ jsx53("span", { className: "malix-ai-panel__logo", children: /* @__PURE__ */ jsx53("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx53("path", { d: "M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z" }) }) }),
|
|
2598
|
+
/* @__PURE__ */ jsx53("span", { className: "malix-ai-panel__title", children: title }),
|
|
2599
|
+
onClose ? /* @__PURE__ */ jsx53(
|
|
2441
2600
|
"button",
|
|
2442
2601
|
{
|
|
2443
2602
|
type: "button",
|
|
2444
2603
|
className: "malix-ai-panel__close",
|
|
2445
2604
|
onClick: onClose,
|
|
2446
2605
|
"aria-label": "Close assistant",
|
|
2447
|
-
children: /* @__PURE__ */
|
|
2448
|
-
/* @__PURE__ */
|
|
2449
|
-
/* @__PURE__ */
|
|
2606
|
+
children: /* @__PURE__ */ jsxs48("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2607
|
+
/* @__PURE__ */ jsx53("path", { d: "M18 6 6 18" }),
|
|
2608
|
+
/* @__PURE__ */ jsx53("path", { d: "m6 6 12 12" })
|
|
2450
2609
|
] })
|
|
2451
2610
|
}
|
|
2452
2611
|
) : null
|
|
2453
2612
|
] }),
|
|
2454
|
-
/* @__PURE__ */
|
|
2613
|
+
/* @__PURE__ */ jsx53("div", { className: "malix-ai-panel__body", ref: bodyRef, children: messages.map((msg) => /* @__PURE__ */ jsx53(
|
|
2455
2614
|
ChatBubble,
|
|
2456
2615
|
{
|
|
2457
2616
|
variant: msg.variant,
|
|
@@ -2460,8 +2619,8 @@ function AIAssistantPanel({
|
|
|
2460
2619
|
},
|
|
2461
2620
|
msg.id
|
|
2462
2621
|
)) }),
|
|
2463
|
-
/* @__PURE__ */
|
|
2464
|
-
/* @__PURE__ */
|
|
2622
|
+
/* @__PURE__ */ jsx53("div", { className: "malix-ai-panel__footer", children: /* @__PURE__ */ jsxs48("div", { className: "malix-ai-panel__input-row", children: [
|
|
2623
|
+
/* @__PURE__ */ jsx53(
|
|
2465
2624
|
"input",
|
|
2466
2625
|
{
|
|
2467
2626
|
type: "text",
|
|
@@ -2474,7 +2633,7 @@ function AIAssistantPanel({
|
|
|
2474
2633
|
"aria-label": placeholder
|
|
2475
2634
|
}
|
|
2476
2635
|
),
|
|
2477
|
-
/* @__PURE__ */
|
|
2636
|
+
/* @__PURE__ */ jsx53(
|
|
2478
2637
|
"button",
|
|
2479
2638
|
{
|
|
2480
2639
|
type: "button",
|
|
@@ -2482,9 +2641,9 @@ function AIAssistantPanel({
|
|
|
2482
2641
|
onClick: handleSend,
|
|
2483
2642
|
disabled: disabled || !draft.trim(),
|
|
2484
2643
|
"aria-label": "Send message",
|
|
2485
|
-
children: /* @__PURE__ */
|
|
2486
|
-
/* @__PURE__ */
|
|
2487
|
-
/* @__PURE__ */
|
|
2644
|
+
children: /* @__PURE__ */ jsxs48("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2645
|
+
/* @__PURE__ */ jsx53("path", { d: "M12 19V5" }),
|
|
2646
|
+
/* @__PURE__ */ jsx53("path", { d: "m5 12 7-7 7 7" })
|
|
2488
2647
|
] })
|
|
2489
2648
|
}
|
|
2490
2649
|
)
|
|
@@ -2493,9 +2652,9 @@ function AIAssistantPanel({
|
|
|
2493
2652
|
}
|
|
2494
2653
|
|
|
2495
2654
|
// src/theme.ts
|
|
2496
|
-
import { createContext, createElement, useCallback as useCallback3, useContext, useEffect as
|
|
2655
|
+
import { createContext as createContext2, createElement, useCallback as useCallback3, useContext as useContext2, useEffect as useEffect6, useMemo, useState as useState7 } from "react";
|
|
2497
2656
|
var STORAGE_KEY = "malix-theme";
|
|
2498
|
-
var MalixThemeContext =
|
|
2657
|
+
var MalixThemeContext = createContext2(null);
|
|
2499
2658
|
function getSystemTheme() {
|
|
2500
2659
|
if (typeof window === "undefined") return "light";
|
|
2501
2660
|
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
@@ -2539,10 +2698,10 @@ function MalixThemeProvider({ children, defaultTheme = "system" }) {
|
|
|
2539
2698
|
return next;
|
|
2540
2699
|
});
|
|
2541
2700
|
}, []);
|
|
2542
|
-
|
|
2701
|
+
useEffect6(() => {
|
|
2543
2702
|
applyTheme(resolveTheme(theme));
|
|
2544
2703
|
}, [theme]);
|
|
2545
|
-
|
|
2704
|
+
useEffect6(() => {
|
|
2546
2705
|
if (theme !== "system") return;
|
|
2547
2706
|
const mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2548
2707
|
const handler = () => applyTheme(getSystemTheme());
|
|
@@ -2553,7 +2712,7 @@ function MalixThemeProvider({ children, defaultTheme = "system" }) {
|
|
|
2553
2712
|
return createElement(MalixThemeContext.Provider, { value }, children);
|
|
2554
2713
|
}
|
|
2555
2714
|
function useMalixTheme() {
|
|
2556
|
-
const ctx =
|
|
2715
|
+
const ctx = useContext2(MalixThemeContext);
|
|
2557
2716
|
if (!ctx) {
|
|
2558
2717
|
throw new Error("useMalixTheme must be used within a MalixThemeProvider");
|
|
2559
2718
|
}
|
|
@@ -2600,6 +2759,7 @@ export {
|
|
|
2600
2759
|
CreditsIndicator,
|
|
2601
2760
|
DataTable,
|
|
2602
2761
|
DateInput,
|
|
2762
|
+
Dialog,
|
|
2603
2763
|
Divider,
|
|
2604
2764
|
Dropzone,
|
|
2605
2765
|
EmptyState,
|