@camtomlabs/malix-design-system 0.3.0 → 0.4.0
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 +48 -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 +1 -1
- package/src/styles.css +127 -0
package/dist/index.cjs
CHANGED
|
@@ -45,6 +45,7 @@ __export(index_exports, {
|
|
|
45
45
|
CreditsIndicator: () => CreditsIndicator,
|
|
46
46
|
DataTable: () => DataTable,
|
|
47
47
|
DateInput: () => DateInput,
|
|
48
|
+
Dialog: () => Dialog,
|
|
48
49
|
Divider: () => Divider,
|
|
49
50
|
Dropzone: () => Dropzone,
|
|
50
51
|
EmptyState: () => EmptyState,
|
|
@@ -1234,46 +1235,95 @@ function Overlay({ open, title, onClose, children }) {
|
|
|
1234
1235
|
}
|
|
1235
1236
|
|
|
1236
1237
|
// src/components/Modal.tsx
|
|
1238
|
+
var import_react10 = require("react");
|
|
1239
|
+
var import_react_dom2 = require("react-dom");
|
|
1240
|
+
|
|
1241
|
+
// src/hooks/useOverlayBehavior.ts
|
|
1237
1242
|
var import_react9 = require("react");
|
|
1238
|
-
var
|
|
1239
|
-
|
|
1240
|
-
function Modal({
|
|
1243
|
+
var FOCUSABLE_SELECTOR2 = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
1244
|
+
function useOverlayBehavior({
|
|
1241
1245
|
open,
|
|
1242
|
-
title,
|
|
1243
1246
|
onClose,
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
children
|
|
1247
|
+
panelRef,
|
|
1248
|
+
closeOnEsc = true,
|
|
1249
|
+
initialFocusRef
|
|
1248
1250
|
}) {
|
|
1249
|
-
const
|
|
1251
|
+
const previousActiveRef = (0, import_react9.useRef)(null);
|
|
1250
1252
|
(0, import_react9.useEffect)(() => {
|
|
1251
|
-
if (!open
|
|
1253
|
+
if (!open) return;
|
|
1252
1254
|
const panel = panelRef.current;
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
const
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
if (
|
|
1255
|
+
if (!panel) return;
|
|
1256
|
+
previousActiveRef.current = document.activeElement ?? null;
|
|
1257
|
+
const previousBodyOverflow = document.body.style.overflow;
|
|
1258
|
+
document.body.style.overflow = "hidden";
|
|
1259
|
+
const focusTimer = window.setTimeout(() => {
|
|
1260
|
+
if (initialFocusRef?.current) {
|
|
1261
|
+
initialFocusRef.current.focus();
|
|
1262
|
+
return;
|
|
1263
|
+
}
|
|
1264
|
+
const focusables = Array.from(
|
|
1265
|
+
panel.querySelectorAll(FOCUSABLE_SELECTOR2)
|
|
1266
|
+
);
|
|
1267
|
+
if (focusables.length > 0) {
|
|
1268
|
+
focusables[0].focus();
|
|
1269
|
+
} else {
|
|
1270
|
+
panel.focus();
|
|
1271
|
+
}
|
|
1272
|
+
}, 0);
|
|
1273
|
+
const onKeyDown = (event) => {
|
|
1274
|
+
if (event.key === "Escape" && closeOnEsc) {
|
|
1259
1275
|
event.preventDefault();
|
|
1260
1276
|
onClose();
|
|
1277
|
+
return;
|
|
1261
1278
|
}
|
|
1262
|
-
if (event.key
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
}
|
|
1279
|
+
if (event.key !== "Tab") return;
|
|
1280
|
+
const focusables = Array.from(
|
|
1281
|
+
panel.querySelectorAll(FOCUSABLE_SELECTOR2)
|
|
1282
|
+
);
|
|
1283
|
+
if (focusables.length === 0) {
|
|
1284
|
+
event.preventDefault();
|
|
1285
|
+
return;
|
|
1270
1286
|
}
|
|
1271
|
-
|
|
1287
|
+
const first = focusables[0];
|
|
1288
|
+
const last = focusables[focusables.length - 1];
|
|
1289
|
+
const active = document.activeElement;
|
|
1290
|
+
if (event.shiftKey && active === first) {
|
|
1291
|
+
event.preventDefault();
|
|
1292
|
+
last.focus();
|
|
1293
|
+
} else if (!event.shiftKey && active === last) {
|
|
1294
|
+
event.preventDefault();
|
|
1295
|
+
first.focus();
|
|
1296
|
+
}
|
|
1297
|
+
};
|
|
1272
1298
|
document.addEventListener("keydown", onKeyDown);
|
|
1273
|
-
return () =>
|
|
1274
|
-
|
|
1299
|
+
return () => {
|
|
1300
|
+
window.clearTimeout(focusTimer);
|
|
1301
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
1302
|
+
document.body.style.overflow = previousBodyOverflow;
|
|
1303
|
+
const previous = previousActiveRef.current;
|
|
1304
|
+
if (previous && typeof previous.focus === "function") {
|
|
1305
|
+
previous.focus();
|
|
1306
|
+
}
|
|
1307
|
+
};
|
|
1308
|
+
}, [open, onClose, panelRef, closeOnEsc, initialFocusRef]);
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
// src/components/Modal.tsx
|
|
1312
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1313
|
+
function Modal({
|
|
1314
|
+
open,
|
|
1315
|
+
title,
|
|
1316
|
+
onClose,
|
|
1317
|
+
onConfirm,
|
|
1318
|
+
confirmLabel = "Confirm",
|
|
1319
|
+
cancelLabel = "Cancel",
|
|
1320
|
+
children
|
|
1321
|
+
}) {
|
|
1322
|
+
const panelRef = (0, import_react10.useRef)(null);
|
|
1323
|
+
useOverlayBehavior({ open, onClose, panelRef });
|
|
1275
1324
|
if (!open) return null;
|
|
1276
|
-
|
|
1325
|
+
if (typeof document === "undefined") return null;
|
|
1326
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "malix-overlay-backdrop", onMouseDown: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1277
1327
|
"div",
|
|
1278
1328
|
{
|
|
1279
1329
|
ref: panelRef,
|
|
@@ -1281,6 +1331,7 @@ function Modal({
|
|
|
1281
1331
|
role: "dialog",
|
|
1282
1332
|
"aria-modal": "true",
|
|
1283
1333
|
"aria-label": title,
|
|
1334
|
+
tabIndex: -1,
|
|
1284
1335
|
onMouseDown: (event) => event.stopPropagation(),
|
|
1285
1336
|
children: [
|
|
1286
1337
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "malix-modal__header", children: [
|
|
@@ -1292,10 +1343,24 @@ function Modal({
|
|
|
1292
1343
|
className: "malix-modal__close",
|
|
1293
1344
|
onClick: onClose,
|
|
1294
1345
|
"aria-label": "Close",
|
|
1295
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1346
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1347
|
+
"svg",
|
|
1348
|
+
{
|
|
1349
|
+
width: "18",
|
|
1350
|
+
height: "18",
|
|
1351
|
+
viewBox: "0 0 24 24",
|
|
1352
|
+
fill: "none",
|
|
1353
|
+
stroke: "currentColor",
|
|
1354
|
+
strokeWidth: "2",
|
|
1355
|
+
strokeLinecap: "round",
|
|
1356
|
+
strokeLinejoin: "round",
|
|
1357
|
+
"aria-hidden": "true",
|
|
1358
|
+
children: [
|
|
1359
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1360
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1361
|
+
]
|
|
1362
|
+
}
|
|
1363
|
+
)
|
|
1299
1364
|
}
|
|
1300
1365
|
)
|
|
1301
1366
|
] }),
|
|
@@ -1325,12 +1390,13 @@ function Modal({
|
|
|
1325
1390
|
]
|
|
1326
1391
|
}
|
|
1327
1392
|
) });
|
|
1393
|
+
return (0, import_react_dom2.createPortal)(content, document.body);
|
|
1328
1394
|
}
|
|
1329
1395
|
|
|
1330
1396
|
// src/components/ConfirmDialog.tsx
|
|
1331
|
-
var
|
|
1397
|
+
var import_react11 = require("react");
|
|
1398
|
+
var import_react_dom3 = require("react-dom");
|
|
1332
1399
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1333
|
-
var FOCUSABLE_SELECTOR3 = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
|
1334
1400
|
function ConfirmDialog({
|
|
1335
1401
|
open,
|
|
1336
1402
|
title,
|
|
@@ -1344,50 +1410,30 @@ function ConfirmDialog({
|
|
|
1344
1410
|
children,
|
|
1345
1411
|
loading = false
|
|
1346
1412
|
}) {
|
|
1347
|
-
const panelRef = (0,
|
|
1348
|
-
(0,
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
const focusables = Array.from(panel.querySelectorAll(FOCUSABLE_SELECTOR3));
|
|
1352
|
-
const first = focusables[0];
|
|
1353
|
-
const last = focusables[focusables.length - 1];
|
|
1354
|
-
first?.focus();
|
|
1355
|
-
function onKeyDown(event) {
|
|
1356
|
-
if (event.key === "Escape") {
|
|
1357
|
-
event.preventDefault();
|
|
1358
|
-
onCancel();
|
|
1359
|
-
}
|
|
1360
|
-
if (event.key === "Tab" && focusables.length > 0) {
|
|
1361
|
-
if (event.shiftKey && document.activeElement === first) {
|
|
1362
|
-
event.preventDefault();
|
|
1363
|
-
last?.focus();
|
|
1364
|
-
} else if (!event.shiftKey && document.activeElement === last) {
|
|
1365
|
-
event.preventDefault();
|
|
1366
|
-
first?.focus();
|
|
1367
|
-
}
|
|
1368
|
-
}
|
|
1369
|
-
}
|
|
1370
|
-
document.addEventListener("keydown", onKeyDown);
|
|
1371
|
-
return () => document.removeEventListener("keydown", onKeyDown);
|
|
1372
|
-
}, [open, onCancel]);
|
|
1413
|
+
const panelRef = (0, import_react11.useRef)(null);
|
|
1414
|
+
const titleId = (0, import_react11.useId)();
|
|
1415
|
+
const descriptionId = (0, import_react11.useId)();
|
|
1416
|
+
useOverlayBehavior({ open, onClose: onCancel, panelRef });
|
|
1373
1417
|
if (!open) return null;
|
|
1374
|
-
|
|
1418
|
+
if (typeof document === "undefined") return null;
|
|
1419
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "malix-overlay-backdrop", onMouseDown: onCancel, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
1375
1420
|
"div",
|
|
1376
1421
|
{
|
|
1377
1422
|
ref: panelRef,
|
|
1378
1423
|
className: "malix-confirm-dialog",
|
|
1379
1424
|
role: "alertdialog",
|
|
1380
1425
|
"aria-modal": "true",
|
|
1381
|
-
"aria-labelledby":
|
|
1382
|
-
"aria-describedby": description ?
|
|
1426
|
+
"aria-labelledby": titleId,
|
|
1427
|
+
"aria-describedby": description ? descriptionId : void 0,
|
|
1383
1428
|
"data-variant": variant,
|
|
1429
|
+
tabIndex: -1,
|
|
1384
1430
|
onMouseDown: (event) => event.stopPropagation(),
|
|
1385
1431
|
children: [
|
|
1386
1432
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "malix-confirm-dialog__content", children: [
|
|
1387
1433
|
icon ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "malix-confirm-dialog__icon", children: icon }) : null,
|
|
1388
1434
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "malix-confirm-dialog__text", children: [
|
|
1389
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h3", { id:
|
|
1390
|
-
description ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { id:
|
|
1435
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h3", { id: titleId, className: "malix-confirm-dialog__title", children: title }),
|
|
1436
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { id: descriptionId, className: "malix-confirm-dialog__description", children: description }) : null,
|
|
1391
1437
|
children
|
|
1392
1438
|
] })
|
|
1393
1439
|
] }),
|
|
@@ -1420,10 +1466,124 @@ function ConfirmDialog({
|
|
|
1420
1466
|
]
|
|
1421
1467
|
}
|
|
1422
1468
|
) });
|
|
1469
|
+
return (0, import_react_dom3.createPortal)(content, document.body);
|
|
1423
1470
|
}
|
|
1424
1471
|
|
|
1425
|
-
// src/components/
|
|
1472
|
+
// src/components/Dialog.tsx
|
|
1473
|
+
var import_react12 = require("react");
|
|
1474
|
+
var import_react_dom4 = require("react-dom");
|
|
1426
1475
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1476
|
+
var DialogContext = (0, import_react12.createContext)(null);
|
|
1477
|
+
function useDialogContext(component) {
|
|
1478
|
+
const ctx = (0, import_react12.useContext)(DialogContext);
|
|
1479
|
+
if (!ctx) {
|
|
1480
|
+
throw new Error(
|
|
1481
|
+
`<Dialog.${component}> must be rendered inside <Dialog>. Wrap it in a <Dialog> component.`
|
|
1482
|
+
);
|
|
1483
|
+
}
|
|
1484
|
+
return ctx;
|
|
1485
|
+
}
|
|
1486
|
+
function Dialog({
|
|
1487
|
+
open,
|
|
1488
|
+
onClose,
|
|
1489
|
+
variant = "default",
|
|
1490
|
+
size = "md",
|
|
1491
|
+
closeOnBackdropClick = true,
|
|
1492
|
+
closeOnEsc = true,
|
|
1493
|
+
initialFocusRef,
|
|
1494
|
+
className,
|
|
1495
|
+
role = "dialog",
|
|
1496
|
+
children
|
|
1497
|
+
}) {
|
|
1498
|
+
const panelRef = (0, import_react12.useRef)(null);
|
|
1499
|
+
const titleId = (0, import_react12.useId)();
|
|
1500
|
+
const descriptionId = (0, import_react12.useId)();
|
|
1501
|
+
useOverlayBehavior({
|
|
1502
|
+
open,
|
|
1503
|
+
onClose,
|
|
1504
|
+
panelRef,
|
|
1505
|
+
closeOnEsc,
|
|
1506
|
+
initialFocusRef
|
|
1507
|
+
});
|
|
1508
|
+
if (!open) return null;
|
|
1509
|
+
if (typeof document === "undefined") return null;
|
|
1510
|
+
const handleBackdropMouseDown = closeOnBackdropClick ? onClose : void 0;
|
|
1511
|
+
const panelClassName = ["malix-dialog", className].filter(Boolean).join(" ");
|
|
1512
|
+
const contextValue = {
|
|
1513
|
+
onClose,
|
|
1514
|
+
titleId,
|
|
1515
|
+
descriptionId,
|
|
1516
|
+
variant
|
|
1517
|
+
};
|
|
1518
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DialogContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "malix-overlay-backdrop", onMouseDown: handleBackdropMouseDown, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1519
|
+
"div",
|
|
1520
|
+
{
|
|
1521
|
+
ref: panelRef,
|
|
1522
|
+
className: panelClassName,
|
|
1523
|
+
role,
|
|
1524
|
+
"aria-modal": "true",
|
|
1525
|
+
"aria-labelledby": titleId,
|
|
1526
|
+
"aria-describedby": descriptionId,
|
|
1527
|
+
"data-variant": variant,
|
|
1528
|
+
"data-size": size,
|
|
1529
|
+
tabIndex: -1,
|
|
1530
|
+
onMouseDown: (event) => event.stopPropagation(),
|
|
1531
|
+
children
|
|
1532
|
+
}
|
|
1533
|
+
) }) });
|
|
1534
|
+
return (0, import_react_dom4.createPortal)(content, document.body);
|
|
1535
|
+
}
|
|
1536
|
+
function DialogHeader({
|
|
1537
|
+
children,
|
|
1538
|
+
showClose = true,
|
|
1539
|
+
closeLabel = "Close"
|
|
1540
|
+
}) {
|
|
1541
|
+
const { onClose, titleId } = useDialogContext("Header");
|
|
1542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "malix-dialog__header", children: [
|
|
1543
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h2", { className: "malix-dialog__title", id: titleId, children }),
|
|
1544
|
+
showClose ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1545
|
+
"button",
|
|
1546
|
+
{
|
|
1547
|
+
type: "button",
|
|
1548
|
+
className: "malix-dialog__close",
|
|
1549
|
+
onClick: onClose,
|
|
1550
|
+
"aria-label": closeLabel,
|
|
1551
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1552
|
+
"svg",
|
|
1553
|
+
{
|
|
1554
|
+
width: "18",
|
|
1555
|
+
height: "18",
|
|
1556
|
+
viewBox: "0 0 24 24",
|
|
1557
|
+
fill: "none",
|
|
1558
|
+
stroke: "currentColor",
|
|
1559
|
+
strokeWidth: "2",
|
|
1560
|
+
strokeLinecap: "round",
|
|
1561
|
+
strokeLinejoin: "round",
|
|
1562
|
+
"aria-hidden": "true",
|
|
1563
|
+
children: [
|
|
1564
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1565
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1566
|
+
]
|
|
1567
|
+
}
|
|
1568
|
+
)
|
|
1569
|
+
}
|
|
1570
|
+
) : null
|
|
1571
|
+
] });
|
|
1572
|
+
}
|
|
1573
|
+
function DialogBody({ children, className }) {
|
|
1574
|
+
const { descriptionId } = useDialogContext("Body");
|
|
1575
|
+
const bodyClassName = ["malix-dialog__body", className].filter(Boolean).join(" ");
|
|
1576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { id: descriptionId, className: bodyClassName, children });
|
|
1577
|
+
}
|
|
1578
|
+
function DialogFooter({ children, align = "end" }) {
|
|
1579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "malix-dialog__footer", "data-align": align, children });
|
|
1580
|
+
}
|
|
1581
|
+
Dialog.Header = DialogHeader;
|
|
1582
|
+
Dialog.Body = DialogBody;
|
|
1583
|
+
Dialog.Footer = DialogFooter;
|
|
1584
|
+
|
|
1585
|
+
// src/components/GlassPopover.tsx
|
|
1586
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1427
1587
|
function GlassPopover({
|
|
1428
1588
|
title,
|
|
1429
1589
|
onClose,
|
|
@@ -1431,37 +1591,37 @@ function GlassPopover({
|
|
|
1431
1591
|
className,
|
|
1432
1592
|
...props
|
|
1433
1593
|
}) {
|
|
1434
|
-
return /* @__PURE__ */ (0,
|
|
1594
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
1435
1595
|
"div",
|
|
1436
1596
|
{
|
|
1437
1597
|
className: `malix-glass-popover${className ? ` ${className}` : ""}`,
|
|
1438
1598
|
...props,
|
|
1439
1599
|
children: [
|
|
1440
|
-
title || onClose ? /* @__PURE__ */ (0,
|
|
1441
|
-
title ? /* @__PURE__ */ (0,
|
|
1442
|
-
onClose ? /* @__PURE__ */ (0,
|
|
1600
|
+
title || onClose ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "malix-glass-popover__header", children: [
|
|
1601
|
+
title ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "malix-glass-popover__title", children: title }) : null,
|
|
1602
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1443
1603
|
"button",
|
|
1444
1604
|
{
|
|
1445
1605
|
type: "button",
|
|
1446
1606
|
className: "malix-glass-popover__close",
|
|
1447
1607
|
onClick: onClose,
|
|
1448
1608
|
"aria-label": "Close",
|
|
1449
|
-
children: /* @__PURE__ */ (0,
|
|
1450
|
-
/* @__PURE__ */ (0,
|
|
1451
|
-
/* @__PURE__ */ (0,
|
|
1609
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1610
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1611
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1452
1612
|
] })
|
|
1453
1613
|
}
|
|
1454
1614
|
) : null
|
|
1455
1615
|
] }) : null,
|
|
1456
|
-
/* @__PURE__ */ (0,
|
|
1616
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "malix-glass-popover__body", children })
|
|
1457
1617
|
]
|
|
1458
1618
|
}
|
|
1459
1619
|
);
|
|
1460
1620
|
}
|
|
1461
1621
|
|
|
1462
1622
|
// src/components/Accordion.tsx
|
|
1463
|
-
var
|
|
1464
|
-
var
|
|
1623
|
+
var import_react13 = require("react");
|
|
1624
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1465
1625
|
function Accordion({
|
|
1466
1626
|
title,
|
|
1467
1627
|
children,
|
|
@@ -1470,15 +1630,15 @@ function Accordion({
|
|
|
1470
1630
|
className,
|
|
1471
1631
|
...props
|
|
1472
1632
|
}) {
|
|
1473
|
-
const [open, setOpen] = (0,
|
|
1474
|
-
return /* @__PURE__ */ (0,
|
|
1633
|
+
const [open, setOpen] = (0, import_react13.useState)(defaultOpen);
|
|
1634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
1475
1635
|
"div",
|
|
1476
1636
|
{
|
|
1477
1637
|
className: `malix-accordion${className ? ` ${className}` : ""}`,
|
|
1478
1638
|
"data-open": open,
|
|
1479
1639
|
...props,
|
|
1480
1640
|
children: [
|
|
1481
|
-
/* @__PURE__ */ (0,
|
|
1641
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
1482
1642
|
"button",
|
|
1483
1643
|
{
|
|
1484
1644
|
type: "button",
|
|
@@ -1486,9 +1646,9 @@ function Accordion({
|
|
|
1486
1646
|
onClick: () => setOpen((prev) => !prev),
|
|
1487
1647
|
"aria-expanded": open,
|
|
1488
1648
|
children: [
|
|
1489
|
-
icon ? /* @__PURE__ */ (0,
|
|
1490
|
-
/* @__PURE__ */ (0,
|
|
1491
|
-
/* @__PURE__ */ (0,
|
|
1649
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "malix-accordion__icon", children: icon }) : null,
|
|
1650
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "malix-accordion__title", children: title }),
|
|
1651
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1492
1652
|
"svg",
|
|
1493
1653
|
{
|
|
1494
1654
|
className: "malix-accordion__chevron",
|
|
@@ -1501,20 +1661,20 @@ function Accordion({
|
|
|
1501
1661
|
strokeLinecap: "round",
|
|
1502
1662
|
strokeLinejoin: "round",
|
|
1503
1663
|
"aria-hidden": "true",
|
|
1504
|
-
children: /* @__PURE__ */ (0,
|
|
1664
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("polyline", { points: "6 9 12 15 18 9" })
|
|
1505
1665
|
}
|
|
1506
1666
|
)
|
|
1507
1667
|
]
|
|
1508
1668
|
}
|
|
1509
1669
|
),
|
|
1510
|
-
/* @__PURE__ */ (0,
|
|
1670
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "malix-accordion__body", children })
|
|
1511
1671
|
]
|
|
1512
1672
|
}
|
|
1513
1673
|
);
|
|
1514
1674
|
}
|
|
1515
1675
|
|
|
1516
1676
|
// src/components/Badge.tsx
|
|
1517
|
-
var
|
|
1677
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1518
1678
|
function Badge({
|
|
1519
1679
|
variant = "default",
|
|
1520
1680
|
dot = false,
|
|
@@ -1522,41 +1682,41 @@ function Badge({
|
|
|
1522
1682
|
className,
|
|
1523
1683
|
...props
|
|
1524
1684
|
}) {
|
|
1525
|
-
return /* @__PURE__ */ (0,
|
|
1685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
1526
1686
|
"span",
|
|
1527
1687
|
{
|
|
1528
1688
|
className: `malix-badge${className ? ` ${className}` : ""}`,
|
|
1529
1689
|
"data-variant": variant,
|
|
1530
1690
|
...props,
|
|
1531
1691
|
children: [
|
|
1532
|
-
dot ? /* @__PURE__ */ (0,
|
|
1533
|
-
/* @__PURE__ */ (0,
|
|
1692
|
+
dot ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "malix-badge__dot" }) : null,
|
|
1693
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "malix-badge__label", children })
|
|
1534
1694
|
]
|
|
1535
1695
|
}
|
|
1536
1696
|
);
|
|
1537
1697
|
}
|
|
1538
1698
|
|
|
1539
1699
|
// src/components/Banner.tsx
|
|
1540
|
-
var
|
|
1700
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1541
1701
|
var defaultIcons = {
|
|
1542
|
-
info: /* @__PURE__ */ (0,
|
|
1543
|
-
/* @__PURE__ */ (0,
|
|
1544
|
-
/* @__PURE__ */ (0,
|
|
1545
|
-
/* @__PURE__ */ (0,
|
|
1702
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1703
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1704
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
1705
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
1546
1706
|
] }),
|
|
1547
|
-
success: /* @__PURE__ */ (0,
|
|
1548
|
-
/* @__PURE__ */ (0,
|
|
1549
|
-
/* @__PURE__ */ (0,
|
|
1707
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1708
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
|
|
1709
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("polyline", { points: "22 4 12 14.01 9 11.01" })
|
|
1550
1710
|
] }),
|
|
1551
|
-
warning: /* @__PURE__ */ (0,
|
|
1552
|
-
/* @__PURE__ */ (0,
|
|
1553
|
-
/* @__PURE__ */ (0,
|
|
1554
|
-
/* @__PURE__ */ (0,
|
|
1711
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1712
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("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" }),
|
|
1713
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
1714
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
1555
1715
|
] }),
|
|
1556
|
-
error: /* @__PURE__ */ (0,
|
|
1557
|
-
/* @__PURE__ */ (0,
|
|
1558
|
-
/* @__PURE__ */ (0,
|
|
1559
|
-
/* @__PURE__ */ (0,
|
|
1716
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1717
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
1718
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
|
|
1719
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
|
|
1560
1720
|
] })
|
|
1561
1721
|
};
|
|
1562
1722
|
function Banner({
|
|
@@ -1567,7 +1727,7 @@ function Banner({
|
|
|
1567
1727
|
className,
|
|
1568
1728
|
...props
|
|
1569
1729
|
}) {
|
|
1570
|
-
return /* @__PURE__ */ (0,
|
|
1730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
1571
1731
|
"div",
|
|
1572
1732
|
{
|
|
1573
1733
|
className: `malix-banner${className ? ` ${className}` : ""}`,
|
|
@@ -1575,18 +1735,18 @@ function Banner({
|
|
|
1575
1735
|
role: "alert",
|
|
1576
1736
|
...props,
|
|
1577
1737
|
children: [
|
|
1578
|
-
/* @__PURE__ */ (0,
|
|
1579
|
-
/* @__PURE__ */ (0,
|
|
1580
|
-
onClose ? /* @__PURE__ */ (0,
|
|
1738
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "malix-banner__icon", children: icon ?? defaultIcons[variant] }),
|
|
1739
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "malix-banner__content", children }),
|
|
1740
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1581
1741
|
"button",
|
|
1582
1742
|
{
|
|
1583
1743
|
type: "button",
|
|
1584
1744
|
className: "malix-banner__close",
|
|
1585
1745
|
onClick: onClose,
|
|
1586
1746
|
"aria-label": "Dismiss",
|
|
1587
|
-
children: /* @__PURE__ */ (0,
|
|
1588
|
-
/* @__PURE__ */ (0,
|
|
1589
|
-
/* @__PURE__ */ (0,
|
|
1747
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1748
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1749
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
1590
1750
|
] })
|
|
1591
1751
|
}
|
|
1592
1752
|
) : null
|
|
@@ -1596,7 +1756,7 @@ function Banner({
|
|
|
1596
1756
|
}
|
|
1597
1757
|
|
|
1598
1758
|
// src/components/Checkbox.tsx
|
|
1599
|
-
var
|
|
1759
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1600
1760
|
function Checkbox({
|
|
1601
1761
|
checked = false,
|
|
1602
1762
|
onChange,
|
|
@@ -1611,7 +1771,7 @@ function Checkbox({
|
|
|
1611
1771
|
onChange(!checked);
|
|
1612
1772
|
}
|
|
1613
1773
|
};
|
|
1614
|
-
const checkbox = /* @__PURE__ */ (0,
|
|
1774
|
+
const checkbox = /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
1615
1775
|
"button",
|
|
1616
1776
|
{
|
|
1617
1777
|
type: "button",
|
|
@@ -1625,7 +1785,7 @@ function Checkbox({
|
|
|
1625
1785
|
onClick: handleClick,
|
|
1626
1786
|
...props,
|
|
1627
1787
|
children: [
|
|
1628
|
-
checked && !indeterminate ? /* @__PURE__ */ (0,
|
|
1788
|
+
checked && !indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1629
1789
|
"svg",
|
|
1630
1790
|
{
|
|
1631
1791
|
className: "malix-checkbox__icon",
|
|
@@ -1633,7 +1793,7 @@ function Checkbox({
|
|
|
1633
1793
|
fill: "none",
|
|
1634
1794
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1635
1795
|
"aria-hidden": "true",
|
|
1636
|
-
children: /* @__PURE__ */ (0,
|
|
1796
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1637
1797
|
"path",
|
|
1638
1798
|
{
|
|
1639
1799
|
d: "M2 6l3 3 5-5",
|
|
@@ -1645,7 +1805,7 @@ function Checkbox({
|
|
|
1645
1805
|
)
|
|
1646
1806
|
}
|
|
1647
1807
|
) : null,
|
|
1648
|
-
indeterminate ? /* @__PURE__ */ (0,
|
|
1808
|
+
indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1649
1809
|
"svg",
|
|
1650
1810
|
{
|
|
1651
1811
|
className: "malix-checkbox__icon",
|
|
@@ -1653,7 +1813,7 @@ function Checkbox({
|
|
|
1653
1813
|
fill: "none",
|
|
1654
1814
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1655
1815
|
"aria-hidden": "true",
|
|
1656
|
-
children: /* @__PURE__ */ (0,
|
|
1816
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1657
1817
|
"path",
|
|
1658
1818
|
{
|
|
1659
1819
|
d: "M2 6h8",
|
|
@@ -1668,16 +1828,16 @@ function Checkbox({
|
|
|
1668
1828
|
}
|
|
1669
1829
|
);
|
|
1670
1830
|
if (label) {
|
|
1671
|
-
return /* @__PURE__ */ (0,
|
|
1831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("label", { className: "malix-checkbox-row", children: [
|
|
1672
1832
|
checkbox,
|
|
1673
|
-
/* @__PURE__ */ (0,
|
|
1833
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "malix-checkbox-row__label", children: label })
|
|
1674
1834
|
] });
|
|
1675
1835
|
}
|
|
1676
1836
|
return checkbox;
|
|
1677
1837
|
}
|
|
1678
1838
|
|
|
1679
1839
|
// src/components/Radio.tsx
|
|
1680
|
-
var
|
|
1840
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1681
1841
|
function Radio({
|
|
1682
1842
|
checked = false,
|
|
1683
1843
|
onChange,
|
|
@@ -1693,7 +1853,7 @@ function Radio({
|
|
|
1693
1853
|
onChange(value);
|
|
1694
1854
|
}
|
|
1695
1855
|
};
|
|
1696
|
-
const radio = /* @__PURE__ */ (0,
|
|
1856
|
+
const radio = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1697
1857
|
"button",
|
|
1698
1858
|
{
|
|
1699
1859
|
type: "button",
|
|
@@ -1707,20 +1867,20 @@ function Radio({
|
|
|
1707
1867
|
"data-value": value,
|
|
1708
1868
|
onClick: handleClick,
|
|
1709
1869
|
...props,
|
|
1710
|
-
children: /* @__PURE__ */ (0,
|
|
1870
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "malix-radio__dot" })
|
|
1711
1871
|
}
|
|
1712
1872
|
);
|
|
1713
1873
|
if (label) {
|
|
1714
|
-
return /* @__PURE__ */ (0,
|
|
1874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("label", { className: "malix-radio-row", children: [
|
|
1715
1875
|
radio,
|
|
1716
|
-
/* @__PURE__ */ (0,
|
|
1876
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "malix-radio-row__label", children: label })
|
|
1717
1877
|
] });
|
|
1718
1878
|
}
|
|
1719
1879
|
return radio;
|
|
1720
1880
|
}
|
|
1721
1881
|
|
|
1722
1882
|
// src/components/Toggle.tsx
|
|
1723
|
-
var
|
|
1883
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1724
1884
|
function Toggle({
|
|
1725
1885
|
checked = false,
|
|
1726
1886
|
onChange,
|
|
@@ -1734,7 +1894,7 @@ function Toggle({
|
|
|
1734
1894
|
onChange(!checked);
|
|
1735
1895
|
}
|
|
1736
1896
|
};
|
|
1737
|
-
const toggle = /* @__PURE__ */ (0,
|
|
1897
|
+
const toggle = /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1738
1898
|
"button",
|
|
1739
1899
|
{
|
|
1740
1900
|
type: "button",
|
|
@@ -1746,12 +1906,12 @@ function Toggle({
|
|
|
1746
1906
|
disabled,
|
|
1747
1907
|
onClick: handleClick,
|
|
1748
1908
|
...props,
|
|
1749
|
-
children: /* @__PURE__ */ (0,
|
|
1909
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "malix-toggle__knob" })
|
|
1750
1910
|
}
|
|
1751
1911
|
);
|
|
1752
1912
|
if (label) {
|
|
1753
|
-
return /* @__PURE__ */ (0,
|
|
1754
|
-
/* @__PURE__ */ (0,
|
|
1913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "malix-toggle-row", children: [
|
|
1914
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "malix-toggle-row__label", children: label }),
|
|
1755
1915
|
toggle
|
|
1756
1916
|
] });
|
|
1757
1917
|
}
|
|
@@ -1759,7 +1919,7 @@ function Toggle({
|
|
|
1759
1919
|
}
|
|
1760
1920
|
|
|
1761
1921
|
// src/components/Select.tsx
|
|
1762
|
-
var
|
|
1922
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1763
1923
|
function Select({
|
|
1764
1924
|
value,
|
|
1765
1925
|
placeholder,
|
|
@@ -1770,14 +1930,14 @@ function Select({
|
|
|
1770
1930
|
className,
|
|
1771
1931
|
...props
|
|
1772
1932
|
}) {
|
|
1773
|
-
return /* @__PURE__ */ (0,
|
|
1933
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
1774
1934
|
"div",
|
|
1775
1935
|
{
|
|
1776
1936
|
className: `malix-select${className ? ` ${className}` : ""}`,
|
|
1777
1937
|
"data-filled": filled || void 0,
|
|
1778
1938
|
"data-disabled": disabled || void 0,
|
|
1779
1939
|
children: [
|
|
1780
|
-
/* @__PURE__ */ (0,
|
|
1940
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
1781
1941
|
"select",
|
|
1782
1942
|
{
|
|
1783
1943
|
className: "malix-select__native",
|
|
@@ -1786,12 +1946,12 @@ function Select({
|
|
|
1786
1946
|
onChange: (e) => onChange?.(e.target.value),
|
|
1787
1947
|
...props,
|
|
1788
1948
|
children: [
|
|
1789
|
-
placeholder ? /* @__PURE__ */ (0,
|
|
1790
|
-
options.map((opt) => /* @__PURE__ */ (0,
|
|
1949
|
+
placeholder ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("option", { value: "", disabled: true, children: placeholder }) : null,
|
|
1950
|
+
options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("option", { value: opt.value, children: opt.label }, opt.value))
|
|
1791
1951
|
]
|
|
1792
1952
|
}
|
|
1793
1953
|
),
|
|
1794
|
-
/* @__PURE__ */ (0,
|
|
1954
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "malix-select__icon", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
1795
1955
|
"path",
|
|
1796
1956
|
{
|
|
1797
1957
|
d: "M4 6L8 10L12 6",
|
|
@@ -1807,7 +1967,7 @@ function Select({
|
|
|
1807
1967
|
}
|
|
1808
1968
|
|
|
1809
1969
|
// src/components/SelectGroup.tsx
|
|
1810
|
-
var
|
|
1970
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
1811
1971
|
function SelectGroup({
|
|
1812
1972
|
label,
|
|
1813
1973
|
helperText,
|
|
@@ -1816,23 +1976,23 @@ function SelectGroup({
|
|
|
1816
1976
|
className,
|
|
1817
1977
|
...props
|
|
1818
1978
|
}) {
|
|
1819
|
-
return /* @__PURE__ */ (0,
|
|
1979
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
1820
1980
|
"div",
|
|
1821
1981
|
{
|
|
1822
1982
|
className: `malix-select-group${className ? ` ${className}` : ""}`,
|
|
1823
1983
|
"data-error": error || void 0,
|
|
1824
1984
|
...props,
|
|
1825
1985
|
children: [
|
|
1826
|
-
label ? /* @__PURE__ */ (0,
|
|
1986
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "malix-select-group__label", children: label }) : null,
|
|
1827
1987
|
children,
|
|
1828
|
-
helperText ? /* @__PURE__ */ (0,
|
|
1988
|
+
helperText ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "malix-select-group__helper", children: helperText }) : null
|
|
1829
1989
|
]
|
|
1830
1990
|
}
|
|
1831
1991
|
);
|
|
1832
1992
|
}
|
|
1833
1993
|
|
|
1834
1994
|
// src/components/SegmentedControl.tsx
|
|
1835
|
-
var
|
|
1995
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
1836
1996
|
function SegmentedControl({
|
|
1837
1997
|
items,
|
|
1838
1998
|
value,
|
|
@@ -1840,13 +2000,13 @@ function SegmentedControl({
|
|
|
1840
2000
|
className,
|
|
1841
2001
|
...props
|
|
1842
2002
|
}) {
|
|
1843
|
-
return /* @__PURE__ */ (0,
|
|
2003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1844
2004
|
"div",
|
|
1845
2005
|
{
|
|
1846
2006
|
className: `malix-segmented-control${className ? ` ${className}` : ""}`,
|
|
1847
2007
|
role: "radiogroup",
|
|
1848
2008
|
...props,
|
|
1849
|
-
children: items.map((item) => /* @__PURE__ */ (0,
|
|
2009
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1850
2010
|
"button",
|
|
1851
2011
|
{
|
|
1852
2012
|
type: "button",
|
|
@@ -1864,7 +2024,7 @@ function SegmentedControl({
|
|
|
1864
2024
|
}
|
|
1865
2025
|
|
|
1866
2026
|
// src/components/DataTable.tsx
|
|
1867
|
-
var
|
|
2027
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
1868
2028
|
function DataTable({
|
|
1869
2029
|
columns,
|
|
1870
2030
|
data,
|
|
@@ -1873,13 +2033,13 @@ function DataTable({
|
|
|
1873
2033
|
className,
|
|
1874
2034
|
...props
|
|
1875
2035
|
}) {
|
|
1876
|
-
return /* @__PURE__ */ (0,
|
|
2036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
1877
2037
|
"table",
|
|
1878
2038
|
{
|
|
1879
2039
|
className: `malix-data-table${className ? ` ${className}` : ""}`,
|
|
1880
2040
|
...props,
|
|
1881
2041
|
children: [
|
|
1882
|
-
/* @__PURE__ */ (0,
|
|
2042
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("tr", { className: "malix-data-table__header-row", children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1883
2043
|
"th",
|
|
1884
2044
|
{
|
|
1885
2045
|
className: "malix-data-table__header-cell",
|
|
@@ -1888,16 +2048,16 @@ function DataTable({
|
|
|
1888
2048
|
},
|
|
1889
2049
|
col.key
|
|
1890
2050
|
)) }) }),
|
|
1891
|
-
/* @__PURE__ */ (0,
|
|
2051
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("tbody", { className: "malix-data-table__body", children: data.length > 0 ? data.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1892
2052
|
"tr",
|
|
1893
2053
|
{
|
|
1894
2054
|
className: "malix-data-table__data-row",
|
|
1895
2055
|
"data-clickable": onRowClick ? true : void 0,
|
|
1896
2056
|
onClick: onRowClick ? () => onRowClick(row) : void 0,
|
|
1897
|
-
children: columns.map((col) => /* @__PURE__ */ (0,
|
|
2057
|
+
children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "malix-data-table__cell", children: col.render ? col.render(row[col.key], row) : row[col.key] }, col.key))
|
|
1898
2058
|
},
|
|
1899
2059
|
rowIndex
|
|
1900
|
-
)) : /* @__PURE__ */ (0,
|
|
2060
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("tr", { className: "malix-data-table__data-row", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1901
2061
|
"td",
|
|
1902
2062
|
{
|
|
1903
2063
|
className: "malix-data-table__cell",
|
|
@@ -1911,12 +2071,12 @@ function DataTable({
|
|
|
1911
2071
|
}
|
|
1912
2072
|
|
|
1913
2073
|
// src/components/Pagination.tsx
|
|
1914
|
-
var
|
|
2074
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1915
2075
|
function ChevronLeft() {
|
|
1916
|
-
return /* @__PURE__ */ (0,
|
|
2076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("path", { d: "M10 12L6 8L10 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1917
2077
|
}
|
|
1918
2078
|
function ChevronRight() {
|
|
1919
|
-
return /* @__PURE__ */ (0,
|
|
2079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("path", { d: "M6 4L10 8L6 12", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1920
2080
|
}
|
|
1921
2081
|
function Pagination({
|
|
1922
2082
|
currentPage,
|
|
@@ -1928,14 +2088,14 @@ function Pagination({
|
|
|
1928
2088
|
const isFirstPage = currentPage <= 1;
|
|
1929
2089
|
const isLastPage = currentPage >= totalPages;
|
|
1930
2090
|
const pages = Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
1931
|
-
return /* @__PURE__ */ (0,
|
|
2091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
1932
2092
|
"nav",
|
|
1933
2093
|
{
|
|
1934
2094
|
className: `malix-pagination${className ? ` ${className}` : ""}`,
|
|
1935
2095
|
"data-variant": variant,
|
|
1936
2096
|
"aria-label": "Pagination",
|
|
1937
2097
|
children: [
|
|
1938
|
-
/* @__PURE__ */ (0,
|
|
2098
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
1939
2099
|
"button",
|
|
1940
2100
|
{
|
|
1941
2101
|
type: "button",
|
|
@@ -1944,10 +2104,10 @@ function Pagination({
|
|
|
1944
2104
|
disabled: isFirstPage,
|
|
1945
2105
|
onClick: () => onPageChange(currentPage - 1),
|
|
1946
2106
|
"aria-label": "Previous page",
|
|
1947
|
-
children: /* @__PURE__ */ (0,
|
|
2107
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ChevronLeft, {})
|
|
1948
2108
|
}
|
|
1949
2109
|
),
|
|
1950
|
-
variant === "full" ? pages.map((page) => /* @__PURE__ */ (0,
|
|
2110
|
+
variant === "full" ? pages.map((page) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
1951
2111
|
"button",
|
|
1952
2112
|
{
|
|
1953
2113
|
type: "button",
|
|
@@ -1958,12 +2118,12 @@ function Pagination({
|
|
|
1958
2118
|
children: page
|
|
1959
2119
|
},
|
|
1960
2120
|
page
|
|
1961
|
-
)) : /* @__PURE__ */ (0,
|
|
2121
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { className: "malix-pagination__label", children: [
|
|
1962
2122
|
currentPage,
|
|
1963
2123
|
" of ",
|
|
1964
2124
|
totalPages
|
|
1965
2125
|
] }),
|
|
1966
|
-
/* @__PURE__ */ (0,
|
|
2126
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
1967
2127
|
"button",
|
|
1968
2128
|
{
|
|
1969
2129
|
type: "button",
|
|
@@ -1972,7 +2132,7 @@ function Pagination({
|
|
|
1972
2132
|
disabled: isLastPage,
|
|
1973
2133
|
onClick: () => onPageChange(currentPage + 1),
|
|
1974
2134
|
"aria-label": "Next page",
|
|
1975
|
-
children: /* @__PURE__ */ (0,
|
|
2135
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ChevronRight, {})
|
|
1976
2136
|
}
|
|
1977
2137
|
)
|
|
1978
2138
|
]
|
|
@@ -1981,30 +2141,30 @@ function Pagination({
|
|
|
1981
2141
|
}
|
|
1982
2142
|
|
|
1983
2143
|
// src/components/StatusDot.tsx
|
|
1984
|
-
var
|
|
2144
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
1985
2145
|
function StatusDot({
|
|
1986
2146
|
variant = "default",
|
|
1987
2147
|
label,
|
|
1988
2148
|
className,
|
|
1989
2149
|
...props
|
|
1990
2150
|
}) {
|
|
1991
|
-
return /* @__PURE__ */ (0,
|
|
2151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
1992
2152
|
"span",
|
|
1993
2153
|
{
|
|
1994
2154
|
className: `malix-status-dot${className ? ` ${className}` : ""}`,
|
|
1995
2155
|
"data-variant": variant,
|
|
1996
2156
|
...props,
|
|
1997
2157
|
children: [
|
|
1998
|
-
/* @__PURE__ */ (0,
|
|
1999
|
-
/* @__PURE__ */ (0,
|
|
2158
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "malix-status-dot__dot", "aria-hidden": "true" }),
|
|
2159
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "malix-status-dot__label", children: label })
|
|
2000
2160
|
]
|
|
2001
2161
|
}
|
|
2002
2162
|
);
|
|
2003
2163
|
}
|
|
2004
2164
|
|
|
2005
2165
|
// src/components/Dropzone.tsx
|
|
2006
|
-
var
|
|
2007
|
-
var
|
|
2166
|
+
var import_react14 = require("react");
|
|
2167
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2008
2168
|
function Dropzone({
|
|
2009
2169
|
onDrop,
|
|
2010
2170
|
accept,
|
|
@@ -2014,8 +2174,8 @@ function Dropzone({
|
|
|
2014
2174
|
className,
|
|
2015
2175
|
...props
|
|
2016
2176
|
}) {
|
|
2017
|
-
const [dragging, setDragging] = (0,
|
|
2018
|
-
const inputRef = (0,
|
|
2177
|
+
const [dragging, setDragging] = (0, import_react14.useState)(false);
|
|
2178
|
+
const inputRef = (0, import_react14.useRef)(null);
|
|
2019
2179
|
function handleDragOver(event) {
|
|
2020
2180
|
event.preventDefault();
|
|
2021
2181
|
if (!disabled) setDragging(true);
|
|
@@ -2039,7 +2199,7 @@ function Dropzone({
|
|
|
2039
2199
|
function handleClick() {
|
|
2040
2200
|
if (!disabled) inputRef.current?.click();
|
|
2041
2201
|
}
|
|
2042
|
-
return /* @__PURE__ */ (0,
|
|
2202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
2043
2203
|
"div",
|
|
2044
2204
|
{
|
|
2045
2205
|
className: `malix-dropzone${className ? ` ${className}` : ""}`,
|
|
@@ -2054,7 +2214,7 @@ function Dropzone({
|
|
|
2054
2214
|
"aria-disabled": disabled || void 0,
|
|
2055
2215
|
...props,
|
|
2056
2216
|
children: [
|
|
2057
|
-
/* @__PURE__ */ (0,
|
|
2217
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2058
2218
|
"input",
|
|
2059
2219
|
{
|
|
2060
2220
|
ref: inputRef,
|
|
@@ -2065,7 +2225,7 @@ function Dropzone({
|
|
|
2065
2225
|
"aria-hidden": "true"
|
|
2066
2226
|
}
|
|
2067
2227
|
),
|
|
2068
|
-
/* @__PURE__ */ (0,
|
|
2228
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
2069
2229
|
"svg",
|
|
2070
2230
|
{
|
|
2071
2231
|
className: "malix-dropzone__icon",
|
|
@@ -2079,23 +2239,23 @@ function Dropzone({
|
|
|
2079
2239
|
strokeLinejoin: "round",
|
|
2080
2240
|
"aria-hidden": "true",
|
|
2081
2241
|
children: [
|
|
2082
|
-
/* @__PURE__ */ (0,
|
|
2083
|
-
/* @__PURE__ */ (0,
|
|
2084
|
-
/* @__PURE__ */ (0,
|
|
2242
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242" }),
|
|
2243
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("path", { d: "M12 12v9" }),
|
|
2244
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("path", { d: "m16 16-4-4-4 4" })
|
|
2085
2245
|
]
|
|
2086
2246
|
}
|
|
2087
2247
|
),
|
|
2088
|
-
/* @__PURE__ */ (0,
|
|
2089
|
-
/* @__PURE__ */ (0,
|
|
2090
|
-
/* @__PURE__ */ (0,
|
|
2248
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "malix-dropzone__title", children: title }),
|
|
2249
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "malix-dropzone__hint", children: hint }),
|
|
2250
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "malix-dropzone__browse-btn", children: "Browse files" })
|
|
2091
2251
|
]
|
|
2092
2252
|
}
|
|
2093
2253
|
);
|
|
2094
2254
|
}
|
|
2095
2255
|
|
|
2096
2256
|
// src/components/SplitPane.tsx
|
|
2097
|
-
var
|
|
2098
|
-
var
|
|
2257
|
+
var import_react15 = require("react");
|
|
2258
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2099
2259
|
function SplitPane({
|
|
2100
2260
|
leftPanel,
|
|
2101
2261
|
rightPanel,
|
|
@@ -2105,14 +2265,14 @@ function SplitPane({
|
|
|
2105
2265
|
className,
|
|
2106
2266
|
...props
|
|
2107
2267
|
}) {
|
|
2108
|
-
const [split, setSplit] = (0,
|
|
2109
|
-
const containerRef = (0,
|
|
2110
|
-
const dragging = (0,
|
|
2111
|
-
const onMouseDown = (0,
|
|
2268
|
+
const [split, setSplit] = (0, import_react15.useState)(defaultSplit);
|
|
2269
|
+
const containerRef = (0, import_react15.useRef)(null);
|
|
2270
|
+
const dragging = (0, import_react15.useRef)(false);
|
|
2271
|
+
const onMouseDown = (0, import_react15.useCallback)((e) => {
|
|
2112
2272
|
e.preventDefault();
|
|
2113
2273
|
dragging.current = true;
|
|
2114
2274
|
}, []);
|
|
2115
|
-
(0,
|
|
2275
|
+
(0, import_react15.useEffect)(() => {
|
|
2116
2276
|
function onMouseMove(e) {
|
|
2117
2277
|
if (!dragging.current || !containerRef.current) return;
|
|
2118
2278
|
const rect = containerRef.current.getBoundingClientRect();
|
|
@@ -2130,18 +2290,18 @@ function SplitPane({
|
|
|
2130
2290
|
document.removeEventListener("mouseup", onMouseUp);
|
|
2131
2291
|
};
|
|
2132
2292
|
}, []);
|
|
2133
|
-
return /* @__PURE__ */ (0,
|
|
2293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
2134
2294
|
"div",
|
|
2135
2295
|
{
|
|
2136
2296
|
ref: containerRef,
|
|
2137
2297
|
className: `malix-split-pane${className ? ` ${className}` : ""}`,
|
|
2138
2298
|
...props,
|
|
2139
2299
|
children: [
|
|
2140
|
-
/* @__PURE__ */ (0,
|
|
2141
|
-
leftTitle ? /* @__PURE__ */ (0,
|
|
2300
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "malix-split-pane__left", style: { width: `${split}%` }, children: [
|
|
2301
|
+
leftTitle ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "malix-split-pane__panel-title", children: leftTitle }) : null,
|
|
2142
2302
|
leftPanel
|
|
2143
2303
|
] }),
|
|
2144
|
-
/* @__PURE__ */ (0,
|
|
2304
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
2145
2305
|
"div",
|
|
2146
2306
|
{
|
|
2147
2307
|
className: "malix-split-pane__handle",
|
|
@@ -2152,14 +2312,14 @@ function SplitPane({
|
|
|
2152
2312
|
"aria-label": "Resize panels",
|
|
2153
2313
|
onMouseDown,
|
|
2154
2314
|
children: [
|
|
2155
|
-
/* @__PURE__ */ (0,
|
|
2156
|
-
/* @__PURE__ */ (0,
|
|
2157
|
-
/* @__PURE__ */ (0,
|
|
2315
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "malix-split-pane__handle-dot", "aria-hidden": "true" }),
|
|
2316
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "malix-split-pane__handle-dot", "aria-hidden": "true" }),
|
|
2317
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "malix-split-pane__handle-dot", "aria-hidden": "true" })
|
|
2158
2318
|
]
|
|
2159
2319
|
}
|
|
2160
2320
|
),
|
|
2161
|
-
/* @__PURE__ */ (0,
|
|
2162
|
-
rightTitle ? /* @__PURE__ */ (0,
|
|
2321
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "malix-split-pane__right", style: { width: `${100 - split}%` }, children: [
|
|
2322
|
+
rightTitle ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "malix-split-pane__panel-title", children: rightTitle }) : null,
|
|
2163
2323
|
rightPanel
|
|
2164
2324
|
] })
|
|
2165
2325
|
]
|
|
@@ -2168,7 +2328,7 @@ function SplitPane({
|
|
|
2168
2328
|
}
|
|
2169
2329
|
|
|
2170
2330
|
// src/components/PricingCard.tsx
|
|
2171
|
-
var
|
|
2331
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2172
2332
|
function PricingCard({
|
|
2173
2333
|
planName,
|
|
2174
2334
|
price,
|
|
@@ -2181,21 +2341,21 @@ function PricingCard({
|
|
|
2181
2341
|
className,
|
|
2182
2342
|
...props
|
|
2183
2343
|
}) {
|
|
2184
|
-
return /* @__PURE__ */ (0,
|
|
2344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
2185
2345
|
"div",
|
|
2186
2346
|
{
|
|
2187
2347
|
className: `malix-pricing-card${className ? ` ${className}` : ""}`,
|
|
2188
2348
|
"data-highlighted": highlighted || void 0,
|
|
2189
2349
|
...props,
|
|
2190
2350
|
children: [
|
|
2191
|
-
/* @__PURE__ */ (0,
|
|
2192
|
-
/* @__PURE__ */ (0,
|
|
2193
|
-
/* @__PURE__ */ (0,
|
|
2194
|
-
/* @__PURE__ */ (0,
|
|
2351
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "malix-pricing-card__badge", children: planName }),
|
|
2352
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "malix-pricing-card__price-row", children: [
|
|
2353
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "malix-pricing-card__price", children: price }),
|
|
2354
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "malix-pricing-card__period", children: period })
|
|
2195
2355
|
] }),
|
|
2196
|
-
description ? /* @__PURE__ */ (0,
|
|
2197
|
-
/* @__PURE__ */ (0,
|
|
2198
|
-
/* @__PURE__ */ (0,
|
|
2356
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { className: "malix-pricing-card__description", children: description }) : null,
|
|
2357
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("ul", { className: "malix-pricing-card__features", children: features.map((feature, i) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("li", { className: "malix-pricing-card__feature-item", children: [
|
|
2358
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2199
2359
|
"svg",
|
|
2200
2360
|
{
|
|
2201
2361
|
className: "malix-pricing-card__check-icon",
|
|
@@ -2208,12 +2368,12 @@ function PricingCard({
|
|
|
2208
2368
|
strokeLinecap: "round",
|
|
2209
2369
|
strokeLinejoin: "round",
|
|
2210
2370
|
"aria-hidden": "true",
|
|
2211
|
-
children: /* @__PURE__ */ (0,
|
|
2371
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("polyline", { points: "20 6 9 17 4 12" })
|
|
2212
2372
|
}
|
|
2213
2373
|
),
|
|
2214
|
-
/* @__PURE__ */ (0,
|
|
2374
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: feature })
|
|
2215
2375
|
] }, i)) }),
|
|
2216
|
-
/* @__PURE__ */ (0,
|
|
2376
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2217
2377
|
"button",
|
|
2218
2378
|
{
|
|
2219
2379
|
type: "button",
|
|
@@ -2228,7 +2388,7 @@ function PricingCard({
|
|
|
2228
2388
|
}
|
|
2229
2389
|
|
|
2230
2390
|
// src/components/OnboardingPopover.tsx
|
|
2231
|
-
var
|
|
2391
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2232
2392
|
function OnboardingPopover({
|
|
2233
2393
|
step,
|
|
2234
2394
|
totalSteps,
|
|
@@ -2240,7 +2400,7 @@ function OnboardingPopover({
|
|
|
2240
2400
|
className,
|
|
2241
2401
|
...props
|
|
2242
2402
|
}) {
|
|
2243
|
-
return /* @__PURE__ */ (0,
|
|
2403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
2244
2404
|
"div",
|
|
2245
2405
|
{
|
|
2246
2406
|
className: `malix-onboarding-popover${className ? ` ${className}` : ""}`,
|
|
@@ -2248,16 +2408,16 @@ function OnboardingPopover({
|
|
|
2248
2408
|
"aria-label": `Step ${step} of ${totalSteps}: ${title}`,
|
|
2249
2409
|
...props,
|
|
2250
2410
|
children: [
|
|
2251
|
-
/* @__PURE__ */ (0,
|
|
2411
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { className: "malix-onboarding-popover__step", children: [
|
|
2252
2412
|
"Step ",
|
|
2253
2413
|
step,
|
|
2254
2414
|
" of ",
|
|
2255
2415
|
totalSteps
|
|
2256
2416
|
] }),
|
|
2257
|
-
/* @__PURE__ */ (0,
|
|
2258
|
-
/* @__PURE__ */ (0,
|
|
2259
|
-
/* @__PURE__ */ (0,
|
|
2260
|
-
onSkip ? /* @__PURE__ */ (0,
|
|
2417
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("h3", { className: "malix-onboarding-popover__title", children: title }),
|
|
2418
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "malix-onboarding-popover__description", children: description }),
|
|
2419
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "malix-onboarding-popover__actions", children: [
|
|
2420
|
+
onSkip ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2261
2421
|
"button",
|
|
2262
2422
|
{
|
|
2263
2423
|
type: "button",
|
|
@@ -2266,7 +2426,7 @@ function OnboardingPopover({
|
|
|
2266
2426
|
children: "Skip"
|
|
2267
2427
|
}
|
|
2268
2428
|
) : null,
|
|
2269
|
-
onNext ? /* @__PURE__ */ (0,
|
|
2429
|
+
onNext ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2270
2430
|
"button",
|
|
2271
2431
|
{
|
|
2272
2432
|
type: "button",
|
|
@@ -2282,20 +2442,20 @@ function OnboardingPopover({
|
|
|
2282
2442
|
}
|
|
2283
2443
|
|
|
2284
2444
|
// src/components/CreditsIndicator.tsx
|
|
2285
|
-
var
|
|
2445
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2286
2446
|
function CreditsIndicator({
|
|
2287
2447
|
remaining,
|
|
2288
2448
|
label = "Credits Remaining",
|
|
2289
2449
|
className,
|
|
2290
2450
|
...props
|
|
2291
2451
|
}) {
|
|
2292
|
-
return /* @__PURE__ */ (0,
|
|
2452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
2293
2453
|
"div",
|
|
2294
2454
|
{
|
|
2295
2455
|
className: `malix-credits-indicator${className ? ` ${className}` : ""}`,
|
|
2296
2456
|
...props,
|
|
2297
2457
|
children: [
|
|
2298
|
-
/* @__PURE__ */ (0,
|
|
2458
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "malix-credits-indicator__icon", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
2299
2459
|
"svg",
|
|
2300
2460
|
{
|
|
2301
2461
|
width: "20",
|
|
@@ -2307,15 +2467,15 @@ function CreditsIndicator({
|
|
|
2307
2467
|
strokeLinecap: "round",
|
|
2308
2468
|
strokeLinejoin: "round",
|
|
2309
2469
|
children: [
|
|
2310
|
-
/* @__PURE__ */ (0,
|
|
2311
|
-
/* @__PURE__ */ (0,
|
|
2312
|
-
/* @__PURE__ */ (0,
|
|
2470
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("ellipse", { cx: "12", cy: "6", rx: "8", ry: "3" }),
|
|
2471
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("path", { d: "M4 6v6c0 1.66 3.58 3 8 3s8-1.34 8-3V6" }),
|
|
2472
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("path", { d: "M4 12v6c0 1.66 3.58 3 8 3s8-1.34 8-3v-6" })
|
|
2313
2473
|
]
|
|
2314
2474
|
}
|
|
2315
2475
|
) }),
|
|
2316
|
-
/* @__PURE__ */ (0,
|
|
2317
|
-
/* @__PURE__ */ (0,
|
|
2318
|
-
/* @__PURE__ */ (0,
|
|
2476
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "malix-credits-indicator__info", children: [
|
|
2477
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "malix-credits-indicator__label", children: label }),
|
|
2478
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "malix-credits-indicator__value", children: remaining })
|
|
2319
2479
|
] })
|
|
2320
2480
|
]
|
|
2321
2481
|
}
|
|
@@ -2323,7 +2483,7 @@ function CreditsIndicator({
|
|
|
2323
2483
|
}
|
|
2324
2484
|
|
|
2325
2485
|
// src/components/LanguageSelector.tsx
|
|
2326
|
-
var
|
|
2486
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
2327
2487
|
function LanguageSelector({
|
|
2328
2488
|
value,
|
|
2329
2489
|
options,
|
|
@@ -2333,13 +2493,13 @@ function LanguageSelector({
|
|
|
2333
2493
|
}) {
|
|
2334
2494
|
const selectedOption = options?.find((opt) => opt.value === value);
|
|
2335
2495
|
const displayLabel = selectedOption?.label ?? value;
|
|
2336
|
-
return /* @__PURE__ */ (0,
|
|
2496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
2337
2497
|
"div",
|
|
2338
2498
|
{
|
|
2339
2499
|
className: `malix-language-selector${className ? ` ${className}` : ""}`,
|
|
2340
2500
|
...props,
|
|
2341
2501
|
children: [
|
|
2342
|
-
/* @__PURE__ */ (0,
|
|
2502
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "malix-language-selector__icon", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
2343
2503
|
"svg",
|
|
2344
2504
|
{
|
|
2345
2505
|
width: "16",
|
|
@@ -2351,24 +2511,24 @@ function LanguageSelector({
|
|
|
2351
2511
|
strokeLinecap: "round",
|
|
2352
2512
|
strokeLinejoin: "round",
|
|
2353
2513
|
children: [
|
|
2354
|
-
/* @__PURE__ */ (0,
|
|
2355
|
-
/* @__PURE__ */ (0,
|
|
2356
|
-
/* @__PURE__ */ (0,
|
|
2514
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
2515
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("line", { x1: "2", y1: "12", x2: "22", y2: "12" }),
|
|
2516
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("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" })
|
|
2357
2517
|
]
|
|
2358
2518
|
}
|
|
2359
2519
|
) }),
|
|
2360
|
-
/* @__PURE__ */ (0,
|
|
2520
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2361
2521
|
"select",
|
|
2362
2522
|
{
|
|
2363
2523
|
className: "malix-language-selector__select",
|
|
2364
2524
|
value,
|
|
2365
2525
|
onChange: (e) => onChange?.(e.target.value),
|
|
2366
2526
|
"aria-label": "Select language",
|
|
2367
|
-
children: options ? options.map((opt) => /* @__PURE__ */ (0,
|
|
2527
|
+
children: options ? options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("option", { value: opt.value, children: opt.label }, opt.value)) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("option", { value, children: displayLabel })
|
|
2368
2528
|
}
|
|
2369
2529
|
),
|
|
2370
|
-
/* @__PURE__ */ (0,
|
|
2371
|
-
/* @__PURE__ */ (0,
|
|
2530
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "malix-language-selector__label", children: displayLabel }),
|
|
2531
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "malix-language-selector__chevron", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2372
2532
|
"svg",
|
|
2373
2533
|
{
|
|
2374
2534
|
width: "14",
|
|
@@ -2379,7 +2539,7 @@ function LanguageSelector({
|
|
|
2379
2539
|
strokeWidth: "2",
|
|
2380
2540
|
strokeLinecap: "round",
|
|
2381
2541
|
strokeLinejoin: "round",
|
|
2382
|
-
children: /* @__PURE__ */ (0,
|
|
2542
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("polyline", { points: "6 9 12 15 18 9" })
|
|
2383
2543
|
}
|
|
2384
2544
|
) })
|
|
2385
2545
|
]
|
|
@@ -2388,7 +2548,7 @@ function LanguageSelector({
|
|
|
2388
2548
|
}
|
|
2389
2549
|
|
|
2390
2550
|
// src/components/UserProfilePopover.tsx
|
|
2391
|
-
var
|
|
2551
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2392
2552
|
function UserProfilePopover({
|
|
2393
2553
|
name,
|
|
2394
2554
|
email,
|
|
@@ -2399,26 +2559,26 @@ function UserProfilePopover({
|
|
|
2399
2559
|
className,
|
|
2400
2560
|
...props
|
|
2401
2561
|
}) {
|
|
2402
|
-
return /* @__PURE__ */ (0,
|
|
2562
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
2403
2563
|
"div",
|
|
2404
2564
|
{
|
|
2405
2565
|
className: `malix-user-profile${className ? ` ${className}` : ""}`,
|
|
2406
2566
|
...props,
|
|
2407
2567
|
children: [
|
|
2408
|
-
/* @__PURE__ */ (0,
|
|
2409
|
-
avatar ? /* @__PURE__ */ (0,
|
|
2410
|
-
/* @__PURE__ */ (0,
|
|
2411
|
-
/* @__PURE__ */ (0,
|
|
2412
|
-
/* @__PURE__ */ (0,
|
|
2568
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "malix-user-profile__header", children: [
|
|
2569
|
+
avatar ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "malix-user-profile__avatar", children: avatar }) : null,
|
|
2570
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "malix-user-profile__info", children: [
|
|
2571
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "malix-user-profile__name", children: name }),
|
|
2572
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "malix-user-profile__email", children: email })
|
|
2413
2573
|
] })
|
|
2414
2574
|
] }),
|
|
2415
|
-
credits !== void 0 ? /* @__PURE__ */ (0,
|
|
2416
|
-
/* @__PURE__ */ (0,
|
|
2417
|
-
/* @__PURE__ */ (0,
|
|
2575
|
+
credits !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "malix-user-profile__credits", children: [
|
|
2576
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "malix-user-profile__credits-label", children: "Credits" }),
|
|
2577
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "malix-user-profile__credits-value", children: credits })
|
|
2418
2578
|
] }) : null,
|
|
2419
|
-
menuItems && menuItems.length > 0 ? /* @__PURE__ */ (0,
|
|
2420
|
-
/* @__PURE__ */ (0,
|
|
2421
|
-
/* @__PURE__ */ (0,
|
|
2579
|
+
menuItems && menuItems.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
2580
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("hr", { className: "malix-user-profile__divider" }),
|
|
2581
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("nav", { className: "malix-user-profile__menu", role: "menu", children: menuItems.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
2422
2582
|
"button",
|
|
2423
2583
|
{
|
|
2424
2584
|
type: "button",
|
|
@@ -2426,23 +2586,23 @@ function UserProfilePopover({
|
|
|
2426
2586
|
role: "menuitem",
|
|
2427
2587
|
onClick: item.onClick,
|
|
2428
2588
|
children: [
|
|
2429
|
-
item.icon ? /* @__PURE__ */ (0,
|
|
2430
|
-
/* @__PURE__ */ (0,
|
|
2589
|
+
item.icon ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "malix-user-profile__menu-item-icon", children: item.icon }) : null,
|
|
2590
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "malix-user-profile__menu-item-label", children: item.label })
|
|
2431
2591
|
]
|
|
2432
2592
|
},
|
|
2433
2593
|
i
|
|
2434
2594
|
)) })
|
|
2435
2595
|
] }) : null,
|
|
2436
|
-
onLogout ? /* @__PURE__ */ (0,
|
|
2437
|
-
/* @__PURE__ */ (0,
|
|
2438
|
-
/* @__PURE__ */ (0,
|
|
2596
|
+
onLogout ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
2597
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("hr", { className: "malix-user-profile__divider" }),
|
|
2598
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
2439
2599
|
"button",
|
|
2440
2600
|
{
|
|
2441
2601
|
type: "button",
|
|
2442
2602
|
className: "malix-user-profile__logout",
|
|
2443
2603
|
onClick: onLogout,
|
|
2444
2604
|
children: [
|
|
2445
|
-
/* @__PURE__ */ (0,
|
|
2605
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
2446
2606
|
"svg",
|
|
2447
2607
|
{
|
|
2448
2608
|
width: "16",
|
|
@@ -2454,13 +2614,13 @@ function UserProfilePopover({
|
|
|
2454
2614
|
strokeLinecap: "round",
|
|
2455
2615
|
strokeLinejoin: "round",
|
|
2456
2616
|
children: [
|
|
2457
|
-
/* @__PURE__ */ (0,
|
|
2458
|
-
/* @__PURE__ */ (0,
|
|
2459
|
-
/* @__PURE__ */ (0,
|
|
2617
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }),
|
|
2618
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("polyline", { points: "16 17 21 12 16 7" }),
|
|
2619
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("line", { x1: "21", y1: "12", x2: "9", y2: "12" })
|
|
2460
2620
|
]
|
|
2461
2621
|
}
|
|
2462
2622
|
),
|
|
2463
|
-
/* @__PURE__ */ (0,
|
|
2623
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { children: "Log out" })
|
|
2464
2624
|
]
|
|
2465
2625
|
}
|
|
2466
2626
|
)
|
|
@@ -2471,7 +2631,7 @@ function UserProfilePopover({
|
|
|
2471
2631
|
}
|
|
2472
2632
|
|
|
2473
2633
|
// src/components/ChatBubble.tsx
|
|
2474
|
-
var
|
|
2634
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
2475
2635
|
function ChatBubble({
|
|
2476
2636
|
variant,
|
|
2477
2637
|
message,
|
|
@@ -2480,22 +2640,22 @@ function ChatBubble({
|
|
|
2480
2640
|
className
|
|
2481
2641
|
}) {
|
|
2482
2642
|
const content = children ?? message;
|
|
2483
|
-
return /* @__PURE__ */ (0,
|
|
2643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
2484
2644
|
"div",
|
|
2485
2645
|
{
|
|
2486
2646
|
className: `malix-chat-bubble-row${className ? ` ${className}` : ""}`,
|
|
2487
2647
|
"data-variant": variant,
|
|
2488
2648
|
children: [
|
|
2489
|
-
/* @__PURE__ */ (0,
|
|
2490
|
-
variant === "user" && avatarInitials ? /* @__PURE__ */ (0,
|
|
2649
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "malix-chat-bubble", "data-variant": variant, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "malix-chat-bubble__text", children: content }) }),
|
|
2650
|
+
variant === "user" && avatarInitials ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "malix-chat-bubble__avatar", children: avatarInitials }) : null
|
|
2491
2651
|
]
|
|
2492
2652
|
}
|
|
2493
2653
|
);
|
|
2494
2654
|
}
|
|
2495
2655
|
|
|
2496
2656
|
// src/components/AIAssistantPanel.tsx
|
|
2497
|
-
var
|
|
2498
|
-
var
|
|
2657
|
+
var import_react16 = require("react");
|
|
2658
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
2499
2659
|
function AIAssistantPanel({
|
|
2500
2660
|
title = "AI Assistant",
|
|
2501
2661
|
messages,
|
|
@@ -2506,9 +2666,9 @@ function AIAssistantPanel({
|
|
|
2506
2666
|
disabled,
|
|
2507
2667
|
className
|
|
2508
2668
|
}) {
|
|
2509
|
-
const [draft, setDraft] = (0,
|
|
2510
|
-
const bodyRef = (0,
|
|
2511
|
-
(0,
|
|
2669
|
+
const [draft, setDraft] = (0, import_react16.useState)("");
|
|
2670
|
+
const bodyRef = (0, import_react16.useRef)(null);
|
|
2671
|
+
(0, import_react16.useEffect)(() => {
|
|
2512
2672
|
if (bodyRef.current) {
|
|
2513
2673
|
bodyRef.current.scrollTop = bodyRef.current.scrollHeight;
|
|
2514
2674
|
}
|
|
@@ -2525,25 +2685,25 @@ function AIAssistantPanel({
|
|
|
2525
2685
|
handleSend();
|
|
2526
2686
|
}
|
|
2527
2687
|
};
|
|
2528
|
-
return /* @__PURE__ */ (0,
|
|
2529
|
-
/* @__PURE__ */ (0,
|
|
2530
|
-
/* @__PURE__ */ (0,
|
|
2531
|
-
/* @__PURE__ */ (0,
|
|
2532
|
-
onClose ? /* @__PURE__ */ (0,
|
|
2688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: `malix-ai-panel${className ? ` ${className}` : ""}`, children: [
|
|
2689
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "malix-ai-panel__header", children: [
|
|
2690
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "malix-ai-panel__logo", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("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" }) }) }),
|
|
2691
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "malix-ai-panel__title", children: title }),
|
|
2692
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
2533
2693
|
"button",
|
|
2534
2694
|
{
|
|
2535
2695
|
type: "button",
|
|
2536
2696
|
className: "malix-ai-panel__close",
|
|
2537
2697
|
onClick: onClose,
|
|
2538
2698
|
"aria-label": "Close assistant",
|
|
2539
|
-
children: /* @__PURE__ */ (0,
|
|
2540
|
-
/* @__PURE__ */ (0,
|
|
2541
|
-
/* @__PURE__ */ (0,
|
|
2699
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2700
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("path", { d: "M18 6 6 18" }),
|
|
2701
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("path", { d: "m6 6 12 12" })
|
|
2542
2702
|
] })
|
|
2543
2703
|
}
|
|
2544
2704
|
) : null
|
|
2545
2705
|
] }),
|
|
2546
|
-
/* @__PURE__ */ (0,
|
|
2706
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "malix-ai-panel__body", ref: bodyRef, children: messages.map((msg) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
2547
2707
|
ChatBubble,
|
|
2548
2708
|
{
|
|
2549
2709
|
variant: msg.variant,
|
|
@@ -2552,8 +2712,8 @@ function AIAssistantPanel({
|
|
|
2552
2712
|
},
|
|
2553
2713
|
msg.id
|
|
2554
2714
|
)) }),
|
|
2555
|
-
/* @__PURE__ */ (0,
|
|
2556
|
-
/* @__PURE__ */ (0,
|
|
2715
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "malix-ai-panel__footer", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "malix-ai-panel__input-row", children: [
|
|
2716
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
2557
2717
|
"input",
|
|
2558
2718
|
{
|
|
2559
2719
|
type: "text",
|
|
@@ -2566,7 +2726,7 @@ function AIAssistantPanel({
|
|
|
2566
2726
|
"aria-label": placeholder
|
|
2567
2727
|
}
|
|
2568
2728
|
),
|
|
2569
|
-
/* @__PURE__ */ (0,
|
|
2729
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
2570
2730
|
"button",
|
|
2571
2731
|
{
|
|
2572
2732
|
type: "button",
|
|
@@ -2574,9 +2734,9 @@ function AIAssistantPanel({
|
|
|
2574
2734
|
onClick: handleSend,
|
|
2575
2735
|
disabled: disabled || !draft.trim(),
|
|
2576
2736
|
"aria-label": "Send message",
|
|
2577
|
-
children: /* @__PURE__ */ (0,
|
|
2578
|
-
/* @__PURE__ */ (0,
|
|
2579
|
-
/* @__PURE__ */ (0,
|
|
2737
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
2738
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("path", { d: "M12 19V5" }),
|
|
2739
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("path", { d: "m5 12 7-7 7 7" })
|
|
2580
2740
|
] })
|
|
2581
2741
|
}
|
|
2582
2742
|
)
|
|
@@ -2585,9 +2745,9 @@ function AIAssistantPanel({
|
|
|
2585
2745
|
}
|
|
2586
2746
|
|
|
2587
2747
|
// src/theme.ts
|
|
2588
|
-
var
|
|
2748
|
+
var import_react17 = require("react");
|
|
2589
2749
|
var STORAGE_KEY = "malix-theme";
|
|
2590
|
-
var MalixThemeContext = (0,
|
|
2750
|
+
var MalixThemeContext = (0, import_react17.createContext)(null);
|
|
2591
2751
|
function getSystemTheme() {
|
|
2592
2752
|
if (typeof window === "undefined") return "light";
|
|
2593
2753
|
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
@@ -2610,8 +2770,8 @@ function applyTheme(resolved) {
|
|
|
2610
2770
|
root.setAttribute("data-theme", resolved);
|
|
2611
2771
|
}
|
|
2612
2772
|
function MalixThemeProvider({ children, defaultTheme = "system" }) {
|
|
2613
|
-
const [theme, setThemeState] = (0,
|
|
2614
|
-
const setTheme = (0,
|
|
2773
|
+
const [theme, setThemeState] = (0, import_react17.useState)(() => getStoredTheme() ?? defaultTheme);
|
|
2774
|
+
const setTheme = (0, import_react17.useCallback)((next) => {
|
|
2615
2775
|
setThemeState(next);
|
|
2616
2776
|
try {
|
|
2617
2777
|
localStorage.setItem(STORAGE_KEY, next);
|
|
@@ -2619,7 +2779,7 @@ function MalixThemeProvider({ children, defaultTheme = "system" }) {
|
|
|
2619
2779
|
}
|
|
2620
2780
|
applyTheme(resolveTheme(next));
|
|
2621
2781
|
}, []);
|
|
2622
|
-
const toggleTheme = (0,
|
|
2782
|
+
const toggleTheme = (0, import_react17.useCallback)(() => {
|
|
2623
2783
|
setThemeState((prev) => {
|
|
2624
2784
|
const resolved = resolveTheme(prev);
|
|
2625
2785
|
const next = resolved === "dark" ? "light" : "dark";
|
|
@@ -2631,21 +2791,21 @@ function MalixThemeProvider({ children, defaultTheme = "system" }) {
|
|
|
2631
2791
|
return next;
|
|
2632
2792
|
});
|
|
2633
2793
|
}, []);
|
|
2634
|
-
(0,
|
|
2794
|
+
(0, import_react17.useEffect)(() => {
|
|
2635
2795
|
applyTheme(resolveTheme(theme));
|
|
2636
2796
|
}, [theme]);
|
|
2637
|
-
(0,
|
|
2797
|
+
(0, import_react17.useEffect)(() => {
|
|
2638
2798
|
if (theme !== "system") return;
|
|
2639
2799
|
const mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2640
2800
|
const handler = () => applyTheme(getSystemTheme());
|
|
2641
2801
|
mq.addEventListener("change", handler);
|
|
2642
2802
|
return () => mq.removeEventListener("change", handler);
|
|
2643
2803
|
}, [theme]);
|
|
2644
|
-
const value = (0,
|
|
2645
|
-
return (0,
|
|
2804
|
+
const value = (0, import_react17.useMemo)(() => ({ theme, setTheme, toggleTheme }), [theme, setTheme, toggleTheme]);
|
|
2805
|
+
return (0, import_react17.createElement)(MalixThemeContext.Provider, { value }, children);
|
|
2646
2806
|
}
|
|
2647
2807
|
function useMalixTheme() {
|
|
2648
|
-
const ctx = (0,
|
|
2808
|
+
const ctx = (0, import_react17.useContext)(MalixThemeContext);
|
|
2649
2809
|
if (!ctx) {
|
|
2650
2810
|
throw new Error("useMalixTheme must be used within a MalixThemeProvider");
|
|
2651
2811
|
}
|
|
@@ -2653,7 +2813,7 @@ function useMalixTheme() {
|
|
|
2653
2813
|
}
|
|
2654
2814
|
|
|
2655
2815
|
// src/components/Icon.tsx
|
|
2656
|
-
var
|
|
2816
|
+
var import_react18 = require("react");
|
|
2657
2817
|
var SIZE_MAP = {
|
|
2658
2818
|
xs: 12,
|
|
2659
2819
|
sm: 14,
|
|
@@ -2664,10 +2824,10 @@ var SIZE_MAP = {
|
|
|
2664
2824
|
function resolveSize(size) {
|
|
2665
2825
|
return typeof size === "number" ? size : SIZE_MAP[size];
|
|
2666
2826
|
}
|
|
2667
|
-
var Icon = (0,
|
|
2827
|
+
var Icon = (0, import_react18.forwardRef)(function Icon2({ as: Component, size = "md", label, ...props }, ref) {
|
|
2668
2828
|
const pixelSize = resolveSize(size);
|
|
2669
2829
|
const a11y = label ? { role: "img", "aria-label": label } : { "aria-hidden": true, focusable: false };
|
|
2670
|
-
return (0,
|
|
2830
|
+
return (0, import_react18.createElement)(Component, {
|
|
2671
2831
|
ref,
|
|
2672
2832
|
width: pixelSize,
|
|
2673
2833
|
height: pixelSize,
|
|
@@ -2693,6 +2853,7 @@ var Icon = (0, import_react16.forwardRef)(function Icon2({ as: Component, size =
|
|
|
2693
2853
|
CreditsIndicator,
|
|
2694
2854
|
DataTable,
|
|
2695
2855
|
DateInput,
|
|
2856
|
+
Dialog,
|
|
2696
2857
|
Divider,
|
|
2697
2858
|
Dropzone,
|
|
2698
2859
|
EmptyState,
|