@mirror-physics/fractal-ui 0.2.0-next.41 → 0.2.0-next.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +22 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +10 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +67 -50
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -831,27 +831,44 @@ var Chip = React10.forwardRef(
|
|
|
831
831
|
Chip.displayName = "Chip";
|
|
832
832
|
|
|
833
833
|
// src/components/Checkbox/Checkbox.tsx
|
|
834
|
-
import { Checkbox as CheckboxIcon, CheckboxChecked } from "@mirror-physics/fractal-icons";
|
|
835
|
-
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
836
|
-
function Checkbox({
|
|
834
|
+
import { Checkbox as CheckboxIcon, CheckboxChecked, Minus as Minus2 } from "@mirror-physics/fractal-icons";
|
|
835
|
+
import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
836
|
+
function Checkbox({
|
|
837
|
+
checked,
|
|
838
|
+
indeterminate = false,
|
|
839
|
+
onCheckedChange,
|
|
840
|
+
className,
|
|
841
|
+
disabled,
|
|
842
|
+
onClick,
|
|
843
|
+
onKeyDown,
|
|
844
|
+
...props
|
|
845
|
+
}) {
|
|
837
846
|
return /* @__PURE__ */ jsx15(
|
|
838
847
|
"button",
|
|
839
848
|
{
|
|
840
849
|
...props,
|
|
841
|
-
className: cn(
|
|
850
|
+
className: cn(
|
|
851
|
+
"fractal-checkbox",
|
|
852
|
+
(checked || indeterminate) && "fractal-checkbox--checked",
|
|
853
|
+
indeterminate && "fractal-checkbox--indeterminate",
|
|
854
|
+
className
|
|
855
|
+
),
|
|
842
856
|
type: "button",
|
|
843
857
|
role: "checkbox",
|
|
844
|
-
"aria-checked": checked,
|
|
858
|
+
"aria-checked": indeterminate ? "mixed" : checked,
|
|
845
859
|
disabled,
|
|
846
860
|
onClick: (event) => {
|
|
847
861
|
onClick?.(event);
|
|
848
|
-
if (!event.defaultPrevented) onCheckedChange(!checked);
|
|
862
|
+
if (!event.defaultPrevented) onCheckedChange(indeterminate || !checked);
|
|
849
863
|
},
|
|
850
864
|
onKeyDown: (event) => {
|
|
851
865
|
onKeyDown?.(event);
|
|
852
866
|
if (event.key === " " || event.key === "Enter") event.stopPropagation();
|
|
853
867
|
},
|
|
854
|
-
children:
|
|
868
|
+
children: indeterminate ? /* @__PURE__ */ jsxs12("span", { className: "fractal-checkbox__indeterminate-icon", "aria-hidden": "true", children: [
|
|
869
|
+
/* @__PURE__ */ jsx15(CheckboxIcon, { size: 18 }),
|
|
870
|
+
/* @__PURE__ */ jsx15(Minus2, { className: "fractal-checkbox__indeterminate-mark", size: 12 })
|
|
871
|
+
] }) : checked ? /* @__PURE__ */ jsx15(CheckboxChecked, { "aria-hidden": "true", size: 18 }) : /* @__PURE__ */ jsx15(CheckboxIcon, { "aria-hidden": "true", size: 18 })
|
|
855
872
|
}
|
|
856
873
|
);
|
|
857
874
|
}
|
|
@@ -859,7 +876,7 @@ function Checkbox({ checked, onCheckedChange, className, disabled, onClick, onKe
|
|
|
859
876
|
// src/components/SortableTable/SortableTable.tsx
|
|
860
877
|
import { useMemo, useState as useState3 } from "react";
|
|
861
878
|
import { ArrowUp, ArrowDown, ArrowsUpDown } from "@mirror-physics/fractal-icons";
|
|
862
|
-
import { jsx as jsx16, jsxs as
|
|
879
|
+
import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
863
880
|
function SortableTable({
|
|
864
881
|
columns,
|
|
865
882
|
data,
|
|
@@ -935,9 +952,9 @@ function SortableTable({
|
|
|
935
952
|
onSortChange?.(nextKey, nextDirection);
|
|
936
953
|
}
|
|
937
954
|
};
|
|
938
|
-
return /* @__PURE__ */ jsx16("div", { className: cn("fractal-sortable-table", `fractal-sortable-table--${size}`, embedded && "fractal-sortable-table--embedded", className), children: /* @__PURE__ */
|
|
955
|
+
return /* @__PURE__ */ jsx16("div", { className: cn("fractal-sortable-table", `fractal-sortable-table--${size}`, embedded && "fractal-sortable-table--embedded", className), children: /* @__PURE__ */ jsxs13("div", { className: "fractal-sortable-table-surface", children: [
|
|
939
956
|
header && /* @__PURE__ */ jsx16("div", { className: "fractal-sortable-table-header", children: header }),
|
|
940
|
-
sorted.length === 0 ? /* @__PURE__ */ jsx16("div", { className: "fractal-sortable-table-empty", children: emptyMessage || "No data" }) : /* @__PURE__ */
|
|
957
|
+
sorted.length === 0 ? /* @__PURE__ */ jsx16("div", { className: "fractal-sortable-table-empty", children: emptyMessage || "No data" }) : /* @__PURE__ */ jsxs13("table", { className: "fractal-sortable-table-table", children: [
|
|
941
958
|
/* @__PURE__ */ jsx16("thead", { children: /* @__PURE__ */ jsx16("tr", { className: "fractal-sortable-table-thead-row", children: columns.map((col) => {
|
|
942
959
|
const isActive = activeKey === col.key && activeDirection !== null;
|
|
943
960
|
if (!col.sortable) {
|
|
@@ -956,7 +973,7 @@ function SortableTable({
|
|
|
956
973
|
{
|
|
957
974
|
className: "fractal-sortable-table-th fractal-sortable-table-th--sortable",
|
|
958
975
|
style: { width: col.width },
|
|
959
|
-
children: /* @__PURE__ */
|
|
976
|
+
children: /* @__PURE__ */ jsxs13(
|
|
960
977
|
"button",
|
|
961
978
|
{
|
|
962
979
|
type: "button",
|
|
@@ -1000,7 +1017,7 @@ function SortableTable({
|
|
|
1000
1017
|
"aria-label": action?.label,
|
|
1001
1018
|
role: onRowClick ? "button" : void 0,
|
|
1002
1019
|
tabIndex: onRowClick ? 0 : void 0,
|
|
1003
|
-
children: columns.map((col, columnIndex) => /* @__PURE__ */
|
|
1020
|
+
children: columns.map((col, columnIndex) => /* @__PURE__ */ jsxs13(
|
|
1004
1021
|
"td",
|
|
1005
1022
|
{
|
|
1006
1023
|
className: cn(
|
|
@@ -1025,7 +1042,7 @@ function SortableTable({
|
|
|
1025
1042
|
|
|
1026
1043
|
// src/components/Tabs/Tabs.tsx
|
|
1027
1044
|
import { useId as useId2, useLayoutEffect as useLayoutEffect2, useRef as useRef4, useState as useState4 } from "react";
|
|
1028
|
-
import { jsx as jsx17, jsxs as
|
|
1045
|
+
import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1029
1046
|
function Tabs({
|
|
1030
1047
|
items,
|
|
1031
1048
|
defaultValue,
|
|
@@ -1096,7 +1113,7 @@ function Tabs({
|
|
|
1096
1113
|
selectTab(nextId2);
|
|
1097
1114
|
requestAnimationFrame(() => tabRefs.current[nextId2]?.focus());
|
|
1098
1115
|
};
|
|
1099
|
-
return /* @__PURE__ */
|
|
1116
|
+
return /* @__PURE__ */ jsxs14("div", { className: cn("fractal-tabs", `fractal-tabs--${variant}`, divider && "fractal-tabs--divider", className), children: [
|
|
1100
1117
|
/* @__PURE__ */ jsx17(
|
|
1101
1118
|
"div",
|
|
1102
1119
|
{
|
|
@@ -1159,7 +1176,7 @@ function Tabs({
|
|
|
1159
1176
|
|
|
1160
1177
|
// src/components/ContentSwitcher/ContentSwitcher.tsx
|
|
1161
1178
|
import * as React11 from "react";
|
|
1162
|
-
import { jsx as jsx18, jsxs as
|
|
1179
|
+
import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1163
1180
|
function ContentSwitcher({ items, value, onValueChange, ariaLabel, fullWidth = false, className }) {
|
|
1164
1181
|
const switcherRef = React11.useRef(null);
|
|
1165
1182
|
const buttonRefs = React11.useRef([]);
|
|
@@ -1217,7 +1234,7 @@ function ContentSwitcher({ items, value, onValueChange, ariaLabel, fullWidth = f
|
|
|
1217
1234
|
onValueChange(items[nextIndex].value);
|
|
1218
1235
|
}
|
|
1219
1236
|
};
|
|
1220
|
-
return /* @__PURE__ */
|
|
1237
|
+
return /* @__PURE__ */ jsxs15(
|
|
1221
1238
|
"div",
|
|
1222
1239
|
{
|
|
1223
1240
|
className: cn("fractal-content-switcher", fullWidth && "fractal-content-switcher--full-width", className),
|
|
@@ -1262,7 +1279,7 @@ function ContentSwitcher({ items, value, onValueChange, ariaLabel, fullWidth = f
|
|
|
1262
1279
|
// src/components/Disclosure/Disclosure.tsx
|
|
1263
1280
|
import { useId as useId3, useState as useState5 } from "react";
|
|
1264
1281
|
import { ChevronRight as ChevronRight2, ChevronDown as ChevronDown2 } from "@mirror-physics/fractal-icons";
|
|
1265
|
-
import { jsx as jsx19, jsxs as
|
|
1282
|
+
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1266
1283
|
function Disclosure({
|
|
1267
1284
|
title,
|
|
1268
1285
|
meta,
|
|
@@ -1290,7 +1307,7 @@ function Disclosure({
|
|
|
1290
1307
|
onOpenChange?.(next);
|
|
1291
1308
|
}
|
|
1292
1309
|
};
|
|
1293
|
-
return /* @__PURE__ */
|
|
1310
|
+
return /* @__PURE__ */ jsxs16(
|
|
1294
1311
|
"div",
|
|
1295
1312
|
{
|
|
1296
1313
|
className: cn(
|
|
@@ -1301,7 +1318,7 @@ function Disclosure({
|
|
|
1301
1318
|
className
|
|
1302
1319
|
),
|
|
1303
1320
|
children: [
|
|
1304
|
-
/* @__PURE__ */
|
|
1321
|
+
/* @__PURE__ */ jsxs16(
|
|
1305
1322
|
"button",
|
|
1306
1323
|
{
|
|
1307
1324
|
type: "button",
|
|
@@ -1360,7 +1377,7 @@ function LatticeLoader({ className, label = "Loading", ...props }) {
|
|
|
1360
1377
|
}
|
|
1361
1378
|
|
|
1362
1379
|
// src/components/Ghost/Ghost.tsx
|
|
1363
|
-
import { jsx as jsx21, jsxs as
|
|
1380
|
+
import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1364
1381
|
var toCssLength = (value) => typeof value === "number" ? `${value}px` : value;
|
|
1365
1382
|
function Ghost({ className, width, height, radius, style, ...props }) {
|
|
1366
1383
|
return /* @__PURE__ */ jsx21(
|
|
@@ -1385,7 +1402,7 @@ function ButtonGhost({ className, size = "md", iconOnly = false, width, ...props
|
|
|
1385
1402
|
return /* @__PURE__ */ jsx21(Ghost, { className: cn("fractal-ghost-button", `fractal-ghost-button--${size}`, iconOnly && "fractal-ghost-button--icon-only", className), width, ...props });
|
|
1386
1403
|
}
|
|
1387
1404
|
function CardGhost({ className, lines = 3, showHeader = true, ...props }) {
|
|
1388
|
-
return /* @__PURE__ */
|
|
1405
|
+
return /* @__PURE__ */ jsxs17("div", { "aria-hidden": "true", className: cn("fractal-ghost-card", className), ...props, children: [
|
|
1389
1406
|
showHeader && /* @__PURE__ */ jsx21(GhostLine, { width: "38%" }),
|
|
1390
1407
|
/* @__PURE__ */ jsx21("div", { className: "fractal-ghost-stack", children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ jsx21(GhostLine, { width: index === lines - 1 ? "62%" : "100%" }, index)) })
|
|
1391
1408
|
] });
|
|
@@ -1401,7 +1418,7 @@ function DataTableGhost({
|
|
|
1401
1418
|
...props
|
|
1402
1419
|
}) {
|
|
1403
1420
|
const cells = Array.from({ length: columns }, (_, index) => index);
|
|
1404
|
-
return /* @__PURE__ */ jsx21("div", { "aria-busy": "true", "aria-label": "Loading table", className: cn("fractal-ghost-table", `fractal-ghost-table--${size}`, className), role: "status", ...props, children: /* @__PURE__ */
|
|
1421
|
+
return /* @__PURE__ */ jsx21("div", { "aria-busy": "true", "aria-label": "Loading table", className: cn("fractal-ghost-table", `fractal-ghost-table--${size}`, className), role: "status", ...props, children: /* @__PURE__ */ jsxs17("table", { className: "fractal-ghost-table__table", children: [
|
|
1405
1422
|
(showHeader || headers) && /* @__PURE__ */ jsx21("thead", { children: /* @__PURE__ */ jsx21("tr", { className: "fractal-ghost-table__head-row", children: cells.map((index) => /* @__PURE__ */ jsx21("th", { style: { width: columnWidths?.[index] }, children: headers?.[index] ?? /* @__PURE__ */ jsx21(GhostLine, { size: "sm", width: index === columns - 1 ? "62%" : "76%" }) }, index)) }) }),
|
|
1406
1423
|
/* @__PURE__ */ jsx21("tbody", { children: Array.from({ length: rows }, (_, rowIndex) => /* @__PURE__ */ jsx21("tr", { className: "fractal-ghost-table__row", children: cells.map((columnIndex) => /* @__PURE__ */ jsx21("td", { style: { width: columnWidths?.[columnIndex] }, children: /* @__PURE__ */ jsx21(GhostLine, { width: `${[72, 54, 82, 63, 46][(rowIndex + columnIndex) % 5]}%` }) }, columnIndex)) }, rowIndex)) })
|
|
1407
1424
|
] }) });
|
|
@@ -1416,19 +1433,19 @@ function LabelGhost({ className, width = "26%", ...props }) {
|
|
|
1416
1433
|
return /* @__PURE__ */ jsx21(GhostLine, { className: cn("fractal-ghost-label", className), size: "sm", width, ...props });
|
|
1417
1434
|
}
|
|
1418
1435
|
function FormFieldGhost({ className, labelWidth = "26%", multiline = false, ...props }) {
|
|
1419
|
-
return /* @__PURE__ */
|
|
1436
|
+
return /* @__PURE__ */ jsxs17("div", { "aria-hidden": "true", className: cn("fractal-ghost-field", className), ...props, children: [
|
|
1420
1437
|
/* @__PURE__ */ jsx21(LabelGhost, { width: labelWidth }),
|
|
1421
1438
|
/* @__PURE__ */ jsx21(Ghost, { className: cn("fractal-ghost-field__control", multiline && "fractal-ghost-field__control--multiline") })
|
|
1422
1439
|
] });
|
|
1423
1440
|
}
|
|
1424
1441
|
function AlertGhost({ className, ...props }) {
|
|
1425
|
-
return /* @__PURE__ */
|
|
1442
|
+
return /* @__PURE__ */ jsxs17("div", { "aria-hidden": "true", className: cn("fractal-ghost-alert", className), ...props, children: [
|
|
1426
1443
|
/* @__PURE__ */ jsx21(GhostLine, { width: "30%" }),
|
|
1427
1444
|
/* @__PURE__ */ jsx21(GhostLine, { size: "sm", width: "78%" })
|
|
1428
1445
|
] });
|
|
1429
1446
|
}
|
|
1430
1447
|
function CheckboxGhost({ className, ...props }) {
|
|
1431
|
-
return /* @__PURE__ */
|
|
1448
|
+
return /* @__PURE__ */ jsxs17("div", { "aria-hidden": "true", className: cn("fractal-ghost-choice", className), ...props, children: [
|
|
1432
1449
|
/* @__PURE__ */ jsx21(Ghost, { className: "fractal-ghost-choice__control" }),
|
|
1433
1450
|
/* @__PURE__ */ jsx21(GhostLine, { width: "42%" })
|
|
1434
1451
|
] });
|
|
@@ -1442,7 +1459,7 @@ function LinkGhost({ className, width = 96, ...props }) {
|
|
|
1442
1459
|
}
|
|
1443
1460
|
var TextButtonGhost = LinkGhost;
|
|
1444
1461
|
function DropdownGhost({ className, ...props }) {
|
|
1445
|
-
return /* @__PURE__ */
|
|
1462
|
+
return /* @__PURE__ */ jsxs17("div", { "aria-hidden": "true", className: cn("fractal-ghost-dropdown", className), ...props, children: [
|
|
1446
1463
|
/* @__PURE__ */ jsx21(GhostLine, { width: "38%" }),
|
|
1447
1464
|
/* @__PURE__ */ jsx21(Ghost, { className: "fractal-ghost-dropdown__chevron" })
|
|
1448
1465
|
] });
|
|
@@ -1452,7 +1469,7 @@ function ContentSwitcherGhost({ className, options = 3, ...props }) {
|
|
|
1452
1469
|
}
|
|
1453
1470
|
var TabsGhost = ContentSwitcherGhost;
|
|
1454
1471
|
function DisclosureGhost({ className, ...props }) {
|
|
1455
|
-
return /* @__PURE__ */
|
|
1472
|
+
return /* @__PURE__ */ jsxs17("div", { "aria-hidden": "true", className: cn("fractal-ghost-disclosure", className), ...props, children: [
|
|
1456
1473
|
/* @__PURE__ */ jsx21(Ghost, { className: "fractal-ghost-disclosure__icon" }),
|
|
1457
1474
|
/* @__PURE__ */ jsx21(GhostLine, { width: "42%" })
|
|
1458
1475
|
] });
|
|
@@ -1461,7 +1478,7 @@ function PaginationGhost({ className, pages = 5, ...props }) {
|
|
|
1461
1478
|
return /* @__PURE__ */ jsx21("div", { "aria-hidden": "true", className: cn("fractal-ghost-pagination", className), ...props, children: Array.from({ length: pages }, (_, index) => /* @__PURE__ */ jsx21(Ghost, {}, index)) });
|
|
1462
1479
|
}
|
|
1463
1480
|
function FileDropzoneGhost({ className, ...props }) {
|
|
1464
|
-
return /* @__PURE__ */
|
|
1481
|
+
return /* @__PURE__ */ jsxs17("div", { "aria-hidden": "true", className: cn("fractal-ghost-dropzone", className), ...props, children: [
|
|
1465
1482
|
/* @__PURE__ */ jsx21(Ghost, { className: "fractal-ghost-dropzone__icon" }),
|
|
1466
1483
|
/* @__PURE__ */ jsx21(GhostLine, { width: "26%" }),
|
|
1467
1484
|
/* @__PURE__ */ jsx21(GhostLine, { size: "sm", width: "46%" })
|
|
@@ -1474,9 +1491,9 @@ function SortableTableGhost(props) {
|
|
|
1474
1491
|
return /* @__PURE__ */ jsx21(DataTableGhost, { ...props });
|
|
1475
1492
|
}
|
|
1476
1493
|
function SidebarGhost({ className, items = 6, ...props }) {
|
|
1477
|
-
return /* @__PURE__ */
|
|
1494
|
+
return /* @__PURE__ */ jsxs17("aside", { "aria-hidden": "true", className: cn("fractal-ghost-sidebar", className), ...props, children: [
|
|
1478
1495
|
/* @__PURE__ */ jsx21(Ghost, { className: "fractal-ghost-sidebar__brand" }),
|
|
1479
|
-
/* @__PURE__ */ jsx21("div", { className: "fractal-ghost-sidebar__items", children: Array.from({ length: items }, (_, index) => /* @__PURE__ */
|
|
1496
|
+
/* @__PURE__ */ jsx21("div", { className: "fractal-ghost-sidebar__items", children: Array.from({ length: items }, (_, index) => /* @__PURE__ */ jsxs17("div", { className: "fractal-ghost-sidebar__item", children: [
|
|
1480
1497
|
/* @__PURE__ */ jsx21(Ghost, {}),
|
|
1481
1498
|
/* @__PURE__ */ jsx21(GhostLine, { width: `${[54, 68, 44, 61][index % 4]}%` })
|
|
1482
1499
|
] }, index)) })
|
|
@@ -1489,8 +1506,8 @@ function SidePanelGhost({ className, title, lines = 5, ...props }) {
|
|
|
1489
1506
|
return /* @__PURE__ */ jsx21(SurfaceGhost, { className: cn("fractal-ghost-side-panel", className), title, lines, ...props });
|
|
1490
1507
|
}
|
|
1491
1508
|
function SurfaceGhost({ className, title, lines = 3, ...props }) {
|
|
1492
|
-
return /* @__PURE__ */
|
|
1493
|
-
/* @__PURE__ */
|
|
1509
|
+
return /* @__PURE__ */ jsxs17("div", { "aria-hidden": "true", className: cn("fractal-ghost-surface", className), ...props, children: [
|
|
1510
|
+
/* @__PURE__ */ jsxs17("div", { className: "fractal-ghost-surface__header", children: [
|
|
1494
1511
|
/* @__PURE__ */ jsx21(GhostLine, { width: "42%" }),
|
|
1495
1512
|
/* @__PURE__ */ jsx21(Ghost, { className: "fractal-ghost-surface__close" })
|
|
1496
1513
|
] }),
|
|
@@ -1501,7 +1518,7 @@ function SurfaceGhost({ className, title, lines = 3, ...props }) {
|
|
|
1501
1518
|
|
|
1502
1519
|
// src/components/Sidebar/Sidebar.tsx
|
|
1503
1520
|
import * as React12 from "react";
|
|
1504
|
-
import { Fragment as Fragment3, jsx as jsx22, jsxs as
|
|
1521
|
+
import { Fragment as Fragment3, jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1505
1522
|
var Sidebar = React12.forwardRef(
|
|
1506
1523
|
({ className, width, compact = false, style, ...props }, ref) => /* @__PURE__ */ jsx22(
|
|
1507
1524
|
"aside",
|
|
@@ -1541,7 +1558,7 @@ function SidebarAccountMenu({
|
|
|
1541
1558
|
panelClassName: "fractal-sidebar__account-panel",
|
|
1542
1559
|
selectedValue: "",
|
|
1543
1560
|
triggerClassName: "fractal-sidebar__account-trigger",
|
|
1544
|
-
triggerContent: /* @__PURE__ */
|
|
1561
|
+
triggerContent: /* @__PURE__ */ jsxs18(Fragment3, { children: [
|
|
1545
1562
|
icon && /* @__PURE__ */ jsx22("span", { className: "fractal-sidebar__account-icon", "aria-hidden": "true", children: icon }),
|
|
1546
1563
|
/* @__PURE__ */ jsx22("span", { className: "fractal-sidebar__account-name", children: name })
|
|
1547
1564
|
] }),
|
|
@@ -1559,7 +1576,7 @@ var SidebarSection = React12.forwardRef(
|
|
|
1559
1576
|
);
|
|
1560
1577
|
SidebarSection.displayName = "SidebarSection";
|
|
1561
1578
|
var SidebarNavItem = React12.forwardRef(
|
|
1562
|
-
({ active = false, icon, endAdornment, className, type = "button", children, ...props }, ref) => /* @__PURE__ */
|
|
1579
|
+
({ active = false, icon, endAdornment, className, type = "button", children, ...props }, ref) => /* @__PURE__ */ jsxs18(
|
|
1563
1580
|
"button",
|
|
1564
1581
|
{
|
|
1565
1582
|
ref,
|
|
@@ -1585,12 +1602,12 @@ SidebarFooter.displayName = "SidebarFooter";
|
|
|
1585
1602
|
// src/components/SidePanel/SidePanel.tsx
|
|
1586
1603
|
import { createPortal as createPortal2 } from "react-dom";
|
|
1587
1604
|
import { Close } from "@mirror-physics/fractal-icons";
|
|
1588
|
-
import { jsx as jsx23, jsxs as
|
|
1605
|
+
import { jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1589
1606
|
function SidePanel({ open, onClose, title, description, children, footer, size = "md", loading = false, loadingLabel = "Loading", className }) {
|
|
1590
1607
|
useEscapeDismiss(80, onClose, open);
|
|
1591
1608
|
if (!open) return null;
|
|
1592
1609
|
return createPortal2(
|
|
1593
|
-
/* @__PURE__ */ jsx23("div", { className: "fractal-side-panel-overlay", onMouseDown: onClose, children: /* @__PURE__ */
|
|
1610
|
+
/* @__PURE__ */ jsx23("div", { className: "fractal-side-panel-overlay", onMouseDown: onClose, children: /* @__PURE__ */ jsxs19(
|
|
1594
1611
|
"aside",
|
|
1595
1612
|
{
|
|
1596
1613
|
className: cn("fractal-side-panel", `fractal-side-panel--${size}`, className),
|
|
@@ -1599,8 +1616,8 @@ function SidePanel({ open, onClose, title, description, children, footer, size =
|
|
|
1599
1616
|
role: "dialog",
|
|
1600
1617
|
onMouseDown: (event) => event.stopPropagation(),
|
|
1601
1618
|
children: [
|
|
1602
|
-
/* @__PURE__ */
|
|
1603
|
-
/* @__PURE__ */
|
|
1619
|
+
/* @__PURE__ */ jsxs19("header", { className: "fractal-side-panel__header", children: [
|
|
1620
|
+
/* @__PURE__ */ jsxs19("div", { className: "fractal-side-panel__heading", children: [
|
|
1604
1621
|
typeof title === "string" ? /* @__PURE__ */ jsx23("h2", { className: "fractal-side-panel__title", children: title }) : /* @__PURE__ */ jsx23("div", { className: "fractal-side-panel__title", children: title }),
|
|
1605
1622
|
description && /* @__PURE__ */ jsx23("p", { className: "fractal-side-panel__description", children: description })
|
|
1606
1623
|
] }),
|
|
@@ -1625,9 +1642,9 @@ Textarea.displayName = "Textarea";
|
|
|
1625
1642
|
|
|
1626
1643
|
// src/components/TextButton/TextButton.tsx
|
|
1627
1644
|
import * as React14 from "react";
|
|
1628
|
-
import { jsx as jsx25, jsxs as
|
|
1645
|
+
import { jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1629
1646
|
var TextButton = React14.forwardRef(
|
|
1630
|
-
({ className, icon, iconPosition = "start", size = "md", tone = "primary", children, ...props }, ref) => /* @__PURE__ */
|
|
1647
|
+
({ className, icon, iconPosition = "start", size = "md", tone = "primary", children, ...props }, ref) => /* @__PURE__ */ jsxs20(
|
|
1631
1648
|
"button",
|
|
1632
1649
|
{
|
|
1633
1650
|
ref,
|
|
@@ -1647,7 +1664,7 @@ TextButton.displayName = "TextButton";
|
|
|
1647
1664
|
// src/components/FileDropzone/FileDropzone.tsx
|
|
1648
1665
|
import * as React15 from "react";
|
|
1649
1666
|
import { Close as Close2, FileArrowUp } from "@mirror-physics/fractal-icons";
|
|
1650
|
-
import { jsx as jsx26, jsxs as
|
|
1667
|
+
import { jsx as jsx26, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1651
1668
|
function FileDropzone({
|
|
1652
1669
|
files,
|
|
1653
1670
|
onFilesChange,
|
|
@@ -1667,7 +1684,7 @@ function FileDropzone({
|
|
|
1667
1684
|
if (additions.length === 0) return;
|
|
1668
1685
|
onFilesChange(multiple ? [...files, ...additions] : additions.slice(0, 1));
|
|
1669
1686
|
};
|
|
1670
|
-
return /* @__PURE__ */
|
|
1687
|
+
return /* @__PURE__ */ jsxs21("div", { className: cn("fractal-file-dropzone", className), children: [
|
|
1671
1688
|
/* @__PURE__ */ jsx26(
|
|
1672
1689
|
"input",
|
|
1673
1690
|
{
|
|
@@ -1684,7 +1701,7 @@ function FileDropzone({
|
|
|
1684
1701
|
}
|
|
1685
1702
|
}
|
|
1686
1703
|
),
|
|
1687
|
-
/* @__PURE__ */
|
|
1704
|
+
/* @__PURE__ */ jsxs21(
|
|
1688
1705
|
"button",
|
|
1689
1706
|
{
|
|
1690
1707
|
className: "fractal-file-dropzone__target",
|
|
@@ -1708,14 +1725,14 @@ function FileDropzone({
|
|
|
1708
1725
|
},
|
|
1709
1726
|
children: [
|
|
1710
1727
|
/* @__PURE__ */ jsx26(FileArrowUp, { "aria-hidden": "true", size: 20 }),
|
|
1711
|
-
/* @__PURE__ */
|
|
1728
|
+
/* @__PURE__ */ jsxs21("span", { className: "fractal-file-dropzone__copy", children: [
|
|
1712
1729
|
/* @__PURE__ */ jsx26("span", { className: "fractal-file-dropzone__title", children: title }),
|
|
1713
1730
|
description && /* @__PURE__ */ jsx26("span", { className: "fractal-file-dropzone__description", children: description })
|
|
1714
1731
|
] })
|
|
1715
1732
|
]
|
|
1716
1733
|
}
|
|
1717
1734
|
),
|
|
1718
|
-
files.length > 0 && /* @__PURE__ */ jsx26("ul", { className: "fractal-file-dropzone__files", "aria-label": "Attached files", children: files.map((file, index) => /* @__PURE__ */
|
|
1735
|
+
files.length > 0 && /* @__PURE__ */ jsx26("ul", { className: "fractal-file-dropzone__files", "aria-label": "Attached files", children: files.map((file, index) => /* @__PURE__ */ jsxs21("li", { className: "fractal-file-dropzone__file", children: [
|
|
1719
1736
|
/* @__PURE__ */ jsx26("span", { className: "fractal-file-dropzone__file-name", children: file.name }),
|
|
1720
1737
|
/* @__PURE__ */ jsx26("span", { className: "fractal-file-dropzone__file-meta", children: formatFileSize(file.size) }),
|
|
1721
1738
|
/* @__PURE__ */ jsx26(
|
|
@@ -1740,7 +1757,7 @@ function formatFileSize(bytes) {
|
|
|
1740
1757
|
|
|
1741
1758
|
// src/components/Pagination/Pagination.tsx
|
|
1742
1759
|
import { ArrowLeft, ArrowRight } from "@mirror-physics/fractal-icons";
|
|
1743
|
-
import { jsx as jsx27, jsxs as
|
|
1760
|
+
import { jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1744
1761
|
function Pagination({
|
|
1745
1762
|
page,
|
|
1746
1763
|
pageSize,
|
|
@@ -1756,9 +1773,9 @@ function Pagination({
|
|
|
1756
1773
|
const start = totalItems === 0 ? 0 : (currentPage - 1) * pageSize + 1;
|
|
1757
1774
|
const end = Math.min(currentPage * pageSize, totalItems);
|
|
1758
1775
|
const canChangePageSize = pageSizeOptions != null && pageSizeOptions.length > 0 && onPageSizeChange != null;
|
|
1759
|
-
return /* @__PURE__ */
|
|
1776
|
+
return /* @__PURE__ */ jsxs22("nav", { className: cn("fractal-pagination", className), "aria-label": ariaLabel, children: [
|
|
1760
1777
|
/* @__PURE__ */ jsx27("span", { className: "fractal-pagination__summary", children: totalItems === 0 ? "No results" : `${start}-${end} of ${totalItems}` }),
|
|
1761
|
-
/* @__PURE__ */
|
|
1778
|
+
/* @__PURE__ */ jsxs22("div", { className: "fractal-pagination__controls", children: [
|
|
1762
1779
|
canChangePageSize && /* @__PURE__ */ jsx27(
|
|
1763
1780
|
Dropdown,
|
|
1764
1781
|
{
|
|
@@ -1788,7 +1805,7 @@ function Pagination({
|
|
|
1788
1805
|
children: /* @__PURE__ */ jsx27(ArrowLeft, { "aria-hidden": "true", size: 16 })
|
|
1789
1806
|
}
|
|
1790
1807
|
),
|
|
1791
|
-
/* @__PURE__ */
|
|
1808
|
+
/* @__PURE__ */ jsxs22("span", { className: "fractal-pagination__page", "aria-current": "page", children: [
|
|
1792
1809
|
currentPage,
|
|
1793
1810
|
" of ",
|
|
1794
1811
|
totalPages
|