@mirror-physics/fractal-ui 0.2.0-next.2 → 0.2.0-next.20
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 +476 -79
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +594 -13
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +95 -4
- package/dist/index.d.ts +95 -4
- package/dist/index.js +462 -73
- package/dist/index.js.map +1 -1
- package/dist/lattice-FAYE5KWW.svg +3 -0
- package/dist/tokens.css +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -40,18 +40,24 @@ __export(index_exports, {
|
|
|
40
40
|
CardFooter: () => CardFooter,
|
|
41
41
|
CardHeader: () => CardHeader,
|
|
42
42
|
CardTitle: () => CardTitle,
|
|
43
|
+
Checkbox: () => Checkbox,
|
|
43
44
|
Chip: () => Chip,
|
|
45
|
+
ContentSwitcher: () => ContentSwitcher,
|
|
44
46
|
DataTable: () => DataTable,
|
|
45
47
|
Disclosure: () => Disclosure,
|
|
46
48
|
Dropdown: () => Dropdown,
|
|
47
49
|
FeatureCard: () => FeatureCard,
|
|
50
|
+
FileDropzone: () => FileDropzone,
|
|
48
51
|
FolderCard: () => FolderCard,
|
|
49
52
|
Input: () => Input,
|
|
50
53
|
Label: () => Label,
|
|
54
|
+
LatticeLoader: () => LatticeLoader,
|
|
51
55
|
Link: () => Link,
|
|
52
56
|
Modal: () => Modal,
|
|
57
|
+
Pagination: () => Pagination,
|
|
53
58
|
PromptCard: () => PromptCard,
|
|
54
59
|
PromptGrid: () => PromptGrid,
|
|
60
|
+
SidePanel: () => SidePanel,
|
|
55
61
|
Sidebar: () => Sidebar,
|
|
56
62
|
SidebarBrand: () => SidebarBrand,
|
|
57
63
|
SidebarFooter: () => SidebarFooter,
|
|
@@ -61,6 +67,8 @@ __export(index_exports, {
|
|
|
61
67
|
SidebarSection: () => SidebarSection,
|
|
62
68
|
SortableTable: () => SortableTable,
|
|
63
69
|
Tabs: () => Tabs,
|
|
70
|
+
TextButton: () => TextButton,
|
|
71
|
+
Textarea: () => Textarea,
|
|
64
72
|
Toggle: () => Toggle,
|
|
65
73
|
cn: () => cn,
|
|
66
74
|
useEscapeDismiss: () => useEscapeDismiss
|
|
@@ -119,7 +127,7 @@ var colorPalette = {
|
|
|
119
127
|
var sizeConfig = {
|
|
120
128
|
xs: { height: "28px", padding: "4px 8px", iconOnly: "28px", fontSize: "0.75rem" },
|
|
121
129
|
sm: { height: "32px", padding: "6px 12px", iconOnly: "32px", fontSize: "0.75rem" },
|
|
122
|
-
md: { height: "
|
|
130
|
+
md: { height: "40px", padding: "8px 16px", iconOnly: "40px", fontSize: "0.875rem" },
|
|
123
131
|
lg: { height: "44px", padding: "10px 20px", iconOnly: "44px", fontSize: "1rem" },
|
|
124
132
|
xl: { height: "56px", padding: "14px 28px", iconOnly: "56px", fontSize: "1rem" }
|
|
125
133
|
};
|
|
@@ -733,23 +741,52 @@ var Chip = React9.forwardRef(
|
|
|
733
741
|
);
|
|
734
742
|
Chip.displayName = "Chip";
|
|
735
743
|
|
|
736
|
-
// src/components/
|
|
737
|
-
var import_react2 = require("react");
|
|
744
|
+
// src/components/Checkbox/Checkbox.tsx
|
|
738
745
|
var import_fractal_icons3 = require("@mirror-physics/fractal-icons");
|
|
739
746
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
747
|
+
function Checkbox({ checked, onCheckedChange, className, disabled, onClick, onKeyDown, ...props }) {
|
|
748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
749
|
+
"button",
|
|
750
|
+
{
|
|
751
|
+
...props,
|
|
752
|
+
className: cn("fractal-checkbox", checked && "fractal-checkbox--checked", className),
|
|
753
|
+
type: "button",
|
|
754
|
+
role: "checkbox",
|
|
755
|
+
"aria-checked": checked,
|
|
756
|
+
disabled,
|
|
757
|
+
onClick: (event) => {
|
|
758
|
+
onClick?.(event);
|
|
759
|
+
if (!event.defaultPrevented) onCheckedChange(!checked);
|
|
760
|
+
},
|
|
761
|
+
onKeyDown: (event) => {
|
|
762
|
+
onKeyDown?.(event);
|
|
763
|
+
if (event.key === " " || event.key === "Enter") event.stopPropagation();
|
|
764
|
+
},
|
|
765
|
+
children: checked ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_fractal_icons3.CheckboxChecked, { "aria-hidden": "true", size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_fractal_icons3.Checkbox, { "aria-hidden": "true", size: 18 })
|
|
766
|
+
}
|
|
767
|
+
);
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
// src/components/SortableTable/SortableTable.tsx
|
|
771
|
+
var import_react2 = require("react");
|
|
772
|
+
var import_fractal_icons4 = require("@mirror-physics/fractal-icons");
|
|
773
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
740
774
|
function SortableTable({
|
|
741
775
|
columns,
|
|
742
776
|
data,
|
|
743
777
|
emptyMessage,
|
|
744
778
|
header,
|
|
745
779
|
size = "md",
|
|
780
|
+
embedded = false,
|
|
746
781
|
className,
|
|
747
782
|
defaultSortKey = void 0,
|
|
748
783
|
defaultSortDirection = null,
|
|
749
784
|
sortKey: controlledKey,
|
|
750
785
|
sortDirection: controlledDirection,
|
|
751
786
|
onSortChange,
|
|
752
|
-
highlightRow
|
|
787
|
+
highlightRow,
|
|
788
|
+
onRowClick,
|
|
789
|
+
rowAction
|
|
753
790
|
}) {
|
|
754
791
|
const [internalKey, setInternalKey] = (0, import_react2.useState)(defaultSortKey ?? null);
|
|
755
792
|
const [internalDirection, setInternalDirection] = (0, import_react2.useState)(defaultSortDirection);
|
|
@@ -802,13 +839,13 @@ function SortableTable({
|
|
|
802
839
|
onSortChange?.(nextKey, nextDirection);
|
|
803
840
|
}
|
|
804
841
|
};
|
|
805
|
-
return /* @__PURE__ */ (0,
|
|
806
|
-
header && /* @__PURE__ */ (0,
|
|
807
|
-
sorted.length === 0 ? /* @__PURE__ */ (0,
|
|
808
|
-
/* @__PURE__ */ (0,
|
|
842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: cn("fractal-sortable-table", `fractal-sortable-table--${size}`, embedded && "fractal-sortable-table--embedded", className), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "fractal-sortable-table-surface", children: [
|
|
843
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "fractal-sortable-table-header", children: header }),
|
|
844
|
+
sorted.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "fractal-sortable-table-empty", children: emptyMessage || "No data" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("table", { className: "fractal-sortable-table-table", children: [
|
|
845
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tr", { className: "fractal-sortable-table-thead-row", children: columns.map((col) => {
|
|
809
846
|
const isActive = activeKey === col.key && activeDirection !== null;
|
|
810
847
|
if (!col.sortable) {
|
|
811
|
-
return /* @__PURE__ */ (0,
|
|
848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
812
849
|
"th",
|
|
813
850
|
{
|
|
814
851
|
className: "fractal-sortable-table-th",
|
|
@@ -818,12 +855,12 @@ function SortableTable({
|
|
|
818
855
|
col.key
|
|
819
856
|
);
|
|
820
857
|
}
|
|
821
|
-
return /* @__PURE__ */ (0,
|
|
858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
822
859
|
"th",
|
|
823
860
|
{
|
|
824
861
|
className: "fractal-sortable-table-th fractal-sortable-table-th--sortable",
|
|
825
862
|
style: { width: col.width },
|
|
826
|
-
children: /* @__PURE__ */ (0,
|
|
863
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
827
864
|
"button",
|
|
828
865
|
{
|
|
829
866
|
type: "button",
|
|
@@ -834,8 +871,8 @@ function SortableTable({
|
|
|
834
871
|
onClick: () => handleSortClick(col.key),
|
|
835
872
|
"aria-sort": isActive ? activeDirection === "asc" ? "ascending" : "descending" : "none",
|
|
836
873
|
children: [
|
|
837
|
-
/* @__PURE__ */ (0,
|
|
838
|
-
/* @__PURE__ */ (0,
|
|
874
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: col.header }),
|
|
875
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "fractal-sortable-table-sort-icon", "aria-hidden": "true", children: isActive && activeDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_fractal_icons4.ArrowUp, { size: 14 }) : isActive && activeDirection === "desc" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_fractal_icons4.ArrowDown, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_fractal_icons4.ArrowsUpDown, { size: 14 }) })
|
|
839
876
|
]
|
|
840
877
|
}
|
|
841
878
|
)
|
|
@@ -843,21 +880,42 @@ function SortableTable({
|
|
|
843
880
|
col.key
|
|
844
881
|
);
|
|
845
882
|
}) }) }),
|
|
846
|
-
/* @__PURE__ */ (0,
|
|
883
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("tbody", { children: sorted.map((row, rowIndex) => {
|
|
847
884
|
const highlighted = highlightRow?.(row, rowIndex) ?? false;
|
|
848
|
-
|
|
885
|
+
const action = rowAction ? {
|
|
886
|
+
label: rowAction.label(row, rowIndex),
|
|
887
|
+
icon: rowAction.icon(row, rowIndex)
|
|
888
|
+
} : null;
|
|
889
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
849
890
|
"tr",
|
|
850
891
|
{
|
|
851
892
|
className: cn(
|
|
852
893
|
"fractal-sortable-table-row",
|
|
853
|
-
highlighted && "fractal-sortable-table-row--highlighted"
|
|
894
|
+
highlighted && "fractal-sortable-table-row--highlighted",
|
|
895
|
+
onRowClick && "fractal-sortable-table-row--interactive"
|
|
854
896
|
),
|
|
855
|
-
|
|
897
|
+
onClick: onRowClick ? () => onRowClick(row, rowIndex) : void 0,
|
|
898
|
+
onKeyDown: onRowClick ? (event) => {
|
|
899
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
900
|
+
event.preventDefault();
|
|
901
|
+
onRowClick(row, rowIndex);
|
|
902
|
+
}
|
|
903
|
+
} : void 0,
|
|
904
|
+
"aria-label": action?.label,
|
|
905
|
+
role: onRowClick ? "button" : void 0,
|
|
906
|
+
tabIndex: onRowClick ? 0 : void 0,
|
|
907
|
+
children: columns.map((col, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
856
908
|
"td",
|
|
857
909
|
{
|
|
858
|
-
className:
|
|
910
|
+
className: cn(
|
|
911
|
+
"fractal-sortable-table-td",
|
|
912
|
+
action && columnIndex === columns.length - 1 && "fractal-sortable-table-td--row-action"
|
|
913
|
+
),
|
|
859
914
|
style: { width: col.width, textAlign: col.align ?? "left" },
|
|
860
|
-
children:
|
|
915
|
+
children: [
|
|
916
|
+
col.render(row, rowIndex),
|
|
917
|
+
action && columnIndex === columns.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "fractal-sortable-table-row-action", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "fractal-sortable-table-row-action__icon", children: action.icon }) })
|
|
918
|
+
]
|
|
861
919
|
},
|
|
862
920
|
col.key
|
|
863
921
|
))
|
|
@@ -871,7 +929,7 @@ function SortableTable({
|
|
|
871
929
|
|
|
872
930
|
// src/components/Tabs/Tabs.tsx
|
|
873
931
|
var import_react3 = require("react");
|
|
874
|
-
var
|
|
932
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
875
933
|
function Tabs({
|
|
876
934
|
items,
|
|
877
935
|
defaultValue,
|
|
@@ -886,7 +944,22 @@ function Tabs({
|
|
|
886
944
|
);
|
|
887
945
|
const isControlled = controlledValue !== void 0;
|
|
888
946
|
const activeId = isControlled ? controlledValue : internalValue;
|
|
947
|
+
const tabListRef = (0, import_react3.useRef)(null);
|
|
889
948
|
const tabRefs = (0, import_react3.useRef)({});
|
|
949
|
+
const [indicator, setIndicator] = (0, import_react3.useState)(null);
|
|
950
|
+
(0, import_react3.useLayoutEffect)(() => {
|
|
951
|
+
const updateIndicator = () => {
|
|
952
|
+
const activeTab = tabRefs.current[activeId];
|
|
953
|
+
if (!activeTab) return;
|
|
954
|
+
setIndicator({ offset: activeTab.offsetLeft, width: activeTab.offsetWidth });
|
|
955
|
+
};
|
|
956
|
+
updateIndicator();
|
|
957
|
+
const list = tabListRef.current;
|
|
958
|
+
if (!list || typeof ResizeObserver === "undefined") return;
|
|
959
|
+
const observer = new ResizeObserver(updateIndicator);
|
|
960
|
+
observer.observe(list);
|
|
961
|
+
return () => observer.disconnect();
|
|
962
|
+
}, [activeId, items.length]);
|
|
890
963
|
const selectTab = (id) => {
|
|
891
964
|
if (isControlled) {
|
|
892
965
|
onValueChange?.(id);
|
|
@@ -896,6 +969,10 @@ function Tabs({
|
|
|
896
969
|
}
|
|
897
970
|
};
|
|
898
971
|
const focusable = items.filter((i) => !i.disabled);
|
|
972
|
+
const indicatorStyle = indicator ? {
|
|
973
|
+
"--fractal-tabs-indicator-offset": `${indicator.offset}px`,
|
|
974
|
+
"--fractal-tabs-indicator-width": `${indicator.width}px`
|
|
975
|
+
} : void 0;
|
|
899
976
|
const onKeyDown = (event) => {
|
|
900
977
|
const currentIndex = focusable.findIndex((i) => i.id === activeId);
|
|
901
978
|
if (currentIndex === -1) return;
|
|
@@ -921,41 +998,52 @@ function Tabs({
|
|
|
921
998
|
selectTab(nextId2);
|
|
922
999
|
requestAnimationFrame(() => tabRefs.current[nextId2]?.focus());
|
|
923
1000
|
};
|
|
924
|
-
return /* @__PURE__ */ (0,
|
|
925
|
-
/* @__PURE__ */ (0,
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
"
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
id
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
1001
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: cn("fractal-tabs", className), children: [
|
|
1002
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1003
|
+
"div",
|
|
1004
|
+
{
|
|
1005
|
+
ref: tabListRef,
|
|
1006
|
+
role: "tablist",
|
|
1007
|
+
"aria-label": ariaLabel,
|
|
1008
|
+
className: "fractal-tabs-list",
|
|
1009
|
+
"data-indicator-ready": indicator ? "true" : void 0,
|
|
1010
|
+
style: indicatorStyle,
|
|
1011
|
+
children: items.map((item) => {
|
|
1012
|
+
const isActive = item.id === activeId;
|
|
1013
|
+
const tabId = `${reactId}-tab-${item.id}`;
|
|
1014
|
+
const panelId = `${reactId}-panel-${item.id}`;
|
|
1015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1016
|
+
"button",
|
|
1017
|
+
{
|
|
1018
|
+
ref: (el) => {
|
|
1019
|
+
tabRefs.current[item.id] = el;
|
|
1020
|
+
},
|
|
1021
|
+
id: tabId,
|
|
1022
|
+
role: "tab",
|
|
1023
|
+
type: "button",
|
|
1024
|
+
"aria-selected": isActive,
|
|
1025
|
+
"aria-controls": panelId,
|
|
1026
|
+
tabIndex: isActive ? 0 : -1,
|
|
1027
|
+
disabled: item.disabled,
|
|
1028
|
+
className: cn(
|
|
1029
|
+
"fractal-tabs-trigger",
|
|
1030
|
+
isActive && "fractal-tabs-trigger--active",
|
|
1031
|
+
item.disabled && "fractal-tabs-trigger--disabled"
|
|
1032
|
+
),
|
|
1033
|
+
onClick: () => !item.disabled && selectTab(item.id),
|
|
1034
|
+
onKeyDown,
|
|
1035
|
+
children: item.label
|
|
1036
|
+
},
|
|
1037
|
+
item.id
|
|
1038
|
+
);
|
|
1039
|
+
})
|
|
1040
|
+
}
|
|
1041
|
+
),
|
|
954
1042
|
items.map((item) => {
|
|
955
1043
|
const tabId = `${reactId}-tab-${item.id}`;
|
|
956
1044
|
const panelId = `${reactId}-panel-${item.id}`;
|
|
957
1045
|
const isActive = item.id === activeId;
|
|
958
|
-
return /* @__PURE__ */ (0,
|
|
1046
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
959
1047
|
"div",
|
|
960
1048
|
{
|
|
961
1049
|
id: panelId,
|
|
@@ -971,10 +1059,55 @@ function Tabs({
|
|
|
971
1059
|
] });
|
|
972
1060
|
}
|
|
973
1061
|
|
|
1062
|
+
// src/components/ContentSwitcher/ContentSwitcher.tsx
|
|
1063
|
+
var React10 = __toESM(require("react"), 1);
|
|
1064
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1065
|
+
function ContentSwitcher({ items, value, onValueChange, ariaLabel, fullWidth = false, className }) {
|
|
1066
|
+
const buttonRefs = React10.useRef([]);
|
|
1067
|
+
const moveFocus = (index, direction) => {
|
|
1068
|
+
let nextIndex = index;
|
|
1069
|
+
do {
|
|
1070
|
+
nextIndex = (nextIndex + direction + items.length) % items.length;
|
|
1071
|
+
} while (items[nextIndex]?.disabled && nextIndex !== index);
|
|
1072
|
+
if (!items[nextIndex]?.disabled) {
|
|
1073
|
+
buttonRefs.current[nextIndex]?.focus();
|
|
1074
|
+
onValueChange(items[nextIndex].value);
|
|
1075
|
+
}
|
|
1076
|
+
};
|
|
1077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: cn("fractal-content-switcher", fullWidth && "fractal-content-switcher--full-width", className), role: "group", "aria-label": ariaLabel, children: items.map((item, index) => {
|
|
1078
|
+
const active = item.value === value;
|
|
1079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1080
|
+
"button",
|
|
1081
|
+
{
|
|
1082
|
+
className: cn("fractal-content-switcher__item", active && "fractal-content-switcher__item--active"),
|
|
1083
|
+
type: "button",
|
|
1084
|
+
"aria-pressed": active,
|
|
1085
|
+
disabled: item.disabled,
|
|
1086
|
+
onClick: () => onValueChange(item.value),
|
|
1087
|
+
onKeyDown: (event) => {
|
|
1088
|
+
if (event.key === "ArrowRight") {
|
|
1089
|
+
event.preventDefault();
|
|
1090
|
+
moveFocus(index, 1);
|
|
1091
|
+
}
|
|
1092
|
+
if (event.key === "ArrowLeft") {
|
|
1093
|
+
event.preventDefault();
|
|
1094
|
+
moveFocus(index, -1);
|
|
1095
|
+
}
|
|
1096
|
+
},
|
|
1097
|
+
ref: (element) => {
|
|
1098
|
+
buttonRefs.current[index] = element;
|
|
1099
|
+
},
|
|
1100
|
+
children: item.label
|
|
1101
|
+
},
|
|
1102
|
+
item.value
|
|
1103
|
+
);
|
|
1104
|
+
}) });
|
|
1105
|
+
}
|
|
1106
|
+
|
|
974
1107
|
// src/components/Disclosure/Disclosure.tsx
|
|
975
1108
|
var import_react4 = require("react");
|
|
976
|
-
var
|
|
977
|
-
var
|
|
1109
|
+
var import_fractal_icons5 = require("@mirror-physics/fractal-icons");
|
|
1110
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
978
1111
|
function Disclosure({
|
|
979
1112
|
title,
|
|
980
1113
|
meta,
|
|
@@ -982,6 +1115,7 @@ function Disclosure({
|
|
|
982
1115
|
defaultOpen = false,
|
|
983
1116
|
open: controlledOpen,
|
|
984
1117
|
onOpenChange,
|
|
1118
|
+
disabled = false,
|
|
985
1119
|
className,
|
|
986
1120
|
variant = "card"
|
|
987
1121
|
}) {
|
|
@@ -992,6 +1126,7 @@ function Disclosure({
|
|
|
992
1126
|
const isControlled = controlledOpen !== void 0;
|
|
993
1127
|
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
994
1128
|
const toggle = () => {
|
|
1129
|
+
if (disabled) return;
|
|
995
1130
|
const next = !isOpen;
|
|
996
1131
|
if (isControlled) {
|
|
997
1132
|
onOpenChange?.(next);
|
|
@@ -1000,17 +1135,18 @@ function Disclosure({
|
|
|
1000
1135
|
onOpenChange?.(next);
|
|
1001
1136
|
}
|
|
1002
1137
|
};
|
|
1003
|
-
return /* @__PURE__ */ (0,
|
|
1138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1004
1139
|
"div",
|
|
1005
1140
|
{
|
|
1006
1141
|
className: cn(
|
|
1007
1142
|
"fractal-disclosure",
|
|
1008
1143
|
variant === "card" && "fractal-disclosure--card",
|
|
1009
1144
|
isOpen && "fractal-disclosure--open",
|
|
1145
|
+
disabled && "fractal-disclosure--disabled",
|
|
1010
1146
|
className
|
|
1011
1147
|
),
|
|
1012
1148
|
children: [
|
|
1013
|
-
/* @__PURE__ */ (0,
|
|
1149
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1014
1150
|
"button",
|
|
1015
1151
|
{
|
|
1016
1152
|
type: "button",
|
|
@@ -1018,15 +1154,16 @@ function Disclosure({
|
|
|
1018
1154
|
className: "fractal-disclosure-trigger",
|
|
1019
1155
|
"aria-expanded": isOpen,
|
|
1020
1156
|
"aria-controls": panelId,
|
|
1157
|
+
disabled,
|
|
1021
1158
|
onClick: toggle,
|
|
1022
1159
|
children: [
|
|
1023
|
-
/* @__PURE__ */ (0,
|
|
1024
|
-
/* @__PURE__ */ (0,
|
|
1025
|
-
meta && /* @__PURE__ */ (0,
|
|
1160
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "fractal-disclosure-icon", "aria-hidden": "true", children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_fractal_icons5.ChevronDown, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_fractal_icons5.ChevronRight, { size: 16 }) }),
|
|
1161
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "fractal-disclosure-title", children: title }),
|
|
1162
|
+
meta && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "fractal-disclosure-meta", children: meta })
|
|
1026
1163
|
]
|
|
1027
1164
|
}
|
|
1028
1165
|
),
|
|
1029
|
-
/* @__PURE__ */ (0,
|
|
1166
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1030
1167
|
"div",
|
|
1031
1168
|
{
|
|
1032
1169
|
id: panelId,
|
|
@@ -1034,7 +1171,7 @@ function Disclosure({
|
|
|
1034
1171
|
"aria-labelledby": headerId,
|
|
1035
1172
|
className: "fractal-disclosure-panel",
|
|
1036
1173
|
hidden: !isOpen,
|
|
1037
|
-
children: /* @__PURE__ */ (0,
|
|
1174
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "fractal-disclosure-panel-inner", children })
|
|
1038
1175
|
}
|
|
1039
1176
|
)
|
|
1040
1177
|
]
|
|
@@ -1042,11 +1179,36 @@ function Disclosure({
|
|
|
1042
1179
|
);
|
|
1043
1180
|
}
|
|
1044
1181
|
|
|
1182
|
+
// src/components/LatticeLoader/LatticeLoader.tsx
|
|
1183
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1184
|
+
var LATTICE_COUNT = 160;
|
|
1185
|
+
var WAVE_PERIOD = 80;
|
|
1186
|
+
function LatticeLoader({ className, label = "Loading", ...props }) {
|
|
1187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1188
|
+
"span",
|
|
1189
|
+
{
|
|
1190
|
+
"aria-label": label,
|
|
1191
|
+
className: cn("fractal-lattice-loader", className),
|
|
1192
|
+
role: "progressbar",
|
|
1193
|
+
...props,
|
|
1194
|
+
children: Array.from({ length: LATTICE_COUNT }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1195
|
+
"span",
|
|
1196
|
+
{
|
|
1197
|
+
"aria-hidden": "true",
|
|
1198
|
+
className: "fractal-lattice-loader__cell",
|
|
1199
|
+
style: { "--fractal-lattice-index": index % WAVE_PERIOD }
|
|
1200
|
+
},
|
|
1201
|
+
index
|
|
1202
|
+
))
|
|
1203
|
+
}
|
|
1204
|
+
);
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1045
1207
|
// src/components/Sidebar/Sidebar.tsx
|
|
1046
|
-
var
|
|
1047
|
-
var
|
|
1048
|
-
var Sidebar =
|
|
1049
|
-
({ className, width, style, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1208
|
+
var React11 = __toESM(require("react"), 1);
|
|
1209
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1210
|
+
var Sidebar = React11.forwardRef(
|
|
1211
|
+
({ className, width, style, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1050
1212
|
"aside",
|
|
1051
1213
|
{
|
|
1052
1214
|
ref,
|
|
@@ -1057,24 +1219,24 @@ var Sidebar = React10.forwardRef(
|
|
|
1057
1219
|
)
|
|
1058
1220
|
);
|
|
1059
1221
|
Sidebar.displayName = "Sidebar";
|
|
1060
|
-
var SidebarHeader =
|
|
1061
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1222
|
+
var SidebarHeader = React11.forwardRef(
|
|
1223
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { ref, className: cn("fractal-sidebar__header", className), ...props })
|
|
1062
1224
|
);
|
|
1063
1225
|
SidebarHeader.displayName = "SidebarHeader";
|
|
1064
|
-
var SidebarBrand =
|
|
1065
|
-
({ className, type = "button", ...props }, ref) => /* @__PURE__ */ (0,
|
|
1226
|
+
var SidebarBrand = React11.forwardRef(
|
|
1227
|
+
({ className, type = "button", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { ref, type, className: cn("fractal-sidebar__brand", className), ...props })
|
|
1066
1228
|
);
|
|
1067
1229
|
SidebarBrand.displayName = "SidebarBrand";
|
|
1068
|
-
var SidebarNav =
|
|
1069
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1230
|
+
var SidebarNav = React11.forwardRef(
|
|
1231
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("nav", { ref, className: cn("fractal-sidebar__nav", className), ...props })
|
|
1070
1232
|
);
|
|
1071
1233
|
SidebarNav.displayName = "SidebarNav";
|
|
1072
|
-
var SidebarSection =
|
|
1073
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1234
|
+
var SidebarSection = React11.forwardRef(
|
|
1235
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { ref, className: cn("fractal-sidebar__section", className), ...props })
|
|
1074
1236
|
);
|
|
1075
1237
|
SidebarSection.displayName = "SidebarSection";
|
|
1076
|
-
var SidebarNavItem =
|
|
1077
|
-
({ active = false, icon, endAdornment, className, type = "button", children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1238
|
+
var SidebarNavItem = React11.forwardRef(
|
|
1239
|
+
({ active = false, icon, endAdornment, className, type = "button", children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1078
1240
|
"button",
|
|
1079
1241
|
{
|
|
1080
1242
|
ref,
|
|
@@ -1084,18 +1246,245 @@ var SidebarNavItem = React10.forwardRef(
|
|
|
1084
1246
|
"aria-current": active ? "page" : void 0,
|
|
1085
1247
|
...props,
|
|
1086
1248
|
children: [
|
|
1087
|
-
icon && /* @__PURE__ */ (0,
|
|
1088
|
-
/* @__PURE__ */ (0,
|
|
1089
|
-
endAdornment && /* @__PURE__ */ (0,
|
|
1249
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "fractal-sidebar__nav-item-icon", "aria-hidden": "true", children: icon }),
|
|
1250
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "fractal-sidebar__nav-item-label", children }),
|
|
1251
|
+
endAdornment && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "fractal-sidebar__nav-item-end", children: endAdornment })
|
|
1090
1252
|
]
|
|
1091
1253
|
}
|
|
1092
1254
|
)
|
|
1093
1255
|
);
|
|
1094
1256
|
SidebarNavItem.displayName = "SidebarNavItem";
|
|
1095
|
-
var SidebarFooter =
|
|
1096
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1257
|
+
var SidebarFooter = React11.forwardRef(
|
|
1258
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { ref, className: cn("fractal-sidebar__footer", className), ...props })
|
|
1097
1259
|
);
|
|
1098
1260
|
SidebarFooter.displayName = "SidebarFooter";
|
|
1261
|
+
|
|
1262
|
+
// src/components/SidePanel/SidePanel.tsx
|
|
1263
|
+
var import_react_dom2 = require("react-dom");
|
|
1264
|
+
var import_fractal_icons6 = require("@mirror-physics/fractal-icons");
|
|
1265
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1266
|
+
function SidePanel({ open, onClose, title, description, children, footer, size = "md", className }) {
|
|
1267
|
+
useEscapeDismiss(80, onClose, open);
|
|
1268
|
+
if (!open) return null;
|
|
1269
|
+
return (0, import_react_dom2.createPortal)(
|
|
1270
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "fractal-side-panel-overlay", onMouseDown: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1271
|
+
"aside",
|
|
1272
|
+
{
|
|
1273
|
+
className: cn("fractal-side-panel", `fractal-side-panel--${size}`, className),
|
|
1274
|
+
"aria-modal": "true",
|
|
1275
|
+
"aria-label": typeof title === "string" ? title : "Side panel",
|
|
1276
|
+
role: "dialog",
|
|
1277
|
+
onMouseDown: (event) => event.stopPropagation(),
|
|
1278
|
+
children: [
|
|
1279
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { className: "fractal-side-panel__header", children: [
|
|
1280
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "fractal-side-panel__heading", children: [
|
|
1281
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h2", { className: "fractal-side-panel__title", children: title }),
|
|
1282
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "fractal-side-panel__description", children: description })
|
|
1283
|
+
] }),
|
|
1284
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "fractal-side-panel__close", "aria-label": "Close panel", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_fractal_icons6.Close, { size: 18 }) })
|
|
1285
|
+
] }),
|
|
1286
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "fractal-side-panel__body", children }),
|
|
1287
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("footer", { className: "fractal-side-panel__footer", children: footer })
|
|
1288
|
+
]
|
|
1289
|
+
}
|
|
1290
|
+
) }),
|
|
1291
|
+
document.body
|
|
1292
|
+
);
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
// src/components/Textarea/Textarea.tsx
|
|
1296
|
+
var React12 = __toESM(require("react"), 1);
|
|
1297
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1298
|
+
var Textarea = React12.forwardRef(
|
|
1299
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("textarea", { ref, className: cn("fractal-textarea", className), ...props })
|
|
1300
|
+
);
|
|
1301
|
+
Textarea.displayName = "Textarea";
|
|
1302
|
+
|
|
1303
|
+
// src/components/TextButton/TextButton.tsx
|
|
1304
|
+
var React13 = __toESM(require("react"), 1);
|
|
1305
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1306
|
+
var TextButton = React13.forwardRef(
|
|
1307
|
+
({ className, icon, iconPosition = "start", size = "md", tone = "primary", children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1308
|
+
"button",
|
|
1309
|
+
{
|
|
1310
|
+
ref,
|
|
1311
|
+
className: cn("fractal-text-button", `fractal-text-button--${size}`, `fractal-text-button--${tone}`, className),
|
|
1312
|
+
type: "button",
|
|
1313
|
+
...props,
|
|
1314
|
+
children: [
|
|
1315
|
+
icon && iconPosition === "start" && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "fractal-text-button__icon", "aria-hidden": "true", children: icon }),
|
|
1316
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children }),
|
|
1317
|
+
icon && iconPosition === "end" && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "fractal-text-button__icon", "aria-hidden": "true", children: icon })
|
|
1318
|
+
]
|
|
1319
|
+
}
|
|
1320
|
+
)
|
|
1321
|
+
);
|
|
1322
|
+
TextButton.displayName = "TextButton";
|
|
1323
|
+
|
|
1324
|
+
// src/components/FileDropzone/FileDropzone.tsx
|
|
1325
|
+
var React14 = __toESM(require("react"), 1);
|
|
1326
|
+
var import_fractal_icons7 = require("@mirror-physics/fractal-icons");
|
|
1327
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1328
|
+
function FileDropzone({
|
|
1329
|
+
files,
|
|
1330
|
+
onFilesChange,
|
|
1331
|
+
accept,
|
|
1332
|
+
multiple = true,
|
|
1333
|
+
disabled = false,
|
|
1334
|
+
title = "Drop files here or click to browse",
|
|
1335
|
+
description = "Files stay attached to this record.",
|
|
1336
|
+
className
|
|
1337
|
+
}) {
|
|
1338
|
+
const inputId = React14.useId();
|
|
1339
|
+
const inputRef = React14.useRef(null);
|
|
1340
|
+
const [isDragging, setIsDragging] = React14.useState(false);
|
|
1341
|
+
const addFiles = (nextFiles) => {
|
|
1342
|
+
if (disabled) return;
|
|
1343
|
+
const additions = Array.from(nextFiles);
|
|
1344
|
+
if (additions.length === 0) return;
|
|
1345
|
+
onFilesChange(multiple ? [...files, ...additions] : additions.slice(0, 1));
|
|
1346
|
+
};
|
|
1347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: cn("fractal-file-dropzone", className), children: [
|
|
1348
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1349
|
+
"input",
|
|
1350
|
+
{
|
|
1351
|
+
ref: inputRef,
|
|
1352
|
+
id: inputId,
|
|
1353
|
+
className: "fractal-file-dropzone__input",
|
|
1354
|
+
type: "file",
|
|
1355
|
+
accept,
|
|
1356
|
+
multiple,
|
|
1357
|
+
disabled,
|
|
1358
|
+
onChange: (event) => {
|
|
1359
|
+
if (event.target.files) addFiles(event.target.files);
|
|
1360
|
+
event.target.value = "";
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
),
|
|
1364
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1365
|
+
"button",
|
|
1366
|
+
{
|
|
1367
|
+
className: "fractal-file-dropzone__target",
|
|
1368
|
+
"data-dragging": isDragging || void 0,
|
|
1369
|
+
type: "button",
|
|
1370
|
+
disabled,
|
|
1371
|
+
onClick: () => inputRef.current?.click(),
|
|
1372
|
+
onDragEnter: (event) => {
|
|
1373
|
+
event.preventDefault();
|
|
1374
|
+
if (!disabled) setIsDragging(true);
|
|
1375
|
+
},
|
|
1376
|
+
onDragOver: (event) => event.preventDefault(),
|
|
1377
|
+
onDragLeave: (event) => {
|
|
1378
|
+
event.preventDefault();
|
|
1379
|
+
setIsDragging(false);
|
|
1380
|
+
},
|
|
1381
|
+
onDrop: (event) => {
|
|
1382
|
+
event.preventDefault();
|
|
1383
|
+
setIsDragging(false);
|
|
1384
|
+
addFiles(event.dataTransfer.files);
|
|
1385
|
+
},
|
|
1386
|
+
children: [
|
|
1387
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_fractal_icons7.FileArrowUp, { "aria-hidden": "true", size: 20 }),
|
|
1388
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("span", { className: "fractal-file-dropzone__copy", children: [
|
|
1389
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "fractal-file-dropzone__title", children: title }),
|
|
1390
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "fractal-file-dropzone__description", children: description })
|
|
1391
|
+
] })
|
|
1392
|
+
]
|
|
1393
|
+
}
|
|
1394
|
+
),
|
|
1395
|
+
files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("ul", { className: "fractal-file-dropzone__files", "aria-label": "Attached files", children: files.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("li", { className: "fractal-file-dropzone__file", children: [
|
|
1396
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "fractal-file-dropzone__file-name", children: file.name }),
|
|
1397
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "fractal-file-dropzone__file-meta", children: formatFileSize(file.size) }),
|
|
1398
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1399
|
+
"button",
|
|
1400
|
+
{
|
|
1401
|
+
className: "fractal-file-dropzone__remove",
|
|
1402
|
+
type: "button",
|
|
1403
|
+
"aria-label": `Remove ${file.name}`,
|
|
1404
|
+
disabled,
|
|
1405
|
+
onClick: () => onFilesChange(files.filter((_, fileIndex) => fileIndex !== index)),
|
|
1406
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_fractal_icons7.Close, { "aria-hidden": "true", size: 14 })
|
|
1407
|
+
}
|
|
1408
|
+
)
|
|
1409
|
+
] }, `${file.name}-${file.size}-${index}`)) })
|
|
1410
|
+
] });
|
|
1411
|
+
}
|
|
1412
|
+
function formatFileSize(bytes) {
|
|
1413
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
1414
|
+
if (bytes < 1024 * 1024) return `${Math.round(bytes / 1024)} KB`;
|
|
1415
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
// src/components/Pagination/Pagination.tsx
|
|
1419
|
+
var import_fractal_icons8 = require("@mirror-physics/fractal-icons");
|
|
1420
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1421
|
+
function Pagination({
|
|
1422
|
+
page,
|
|
1423
|
+
pageSize,
|
|
1424
|
+
totalItems,
|
|
1425
|
+
onPageChange,
|
|
1426
|
+
pageSizeOptions,
|
|
1427
|
+
onPageSizeChange,
|
|
1428
|
+
ariaLabel = "Pagination",
|
|
1429
|
+
className
|
|
1430
|
+
}) {
|
|
1431
|
+
const totalPages = Math.max(1, Math.ceil(totalItems / pageSize));
|
|
1432
|
+
const currentPage = Math.min(Math.max(page, 1), totalPages);
|
|
1433
|
+
const start = totalItems === 0 ? 0 : (currentPage - 1) * pageSize + 1;
|
|
1434
|
+
const end = Math.min(currentPage * pageSize, totalItems);
|
|
1435
|
+
const canChangePageSize = pageSizeOptions != null && pageSizeOptions.length > 0 && onPageSizeChange != null;
|
|
1436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("nav", { className: cn("fractal-pagination", className), "aria-label": ariaLabel, children: [
|
|
1437
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "fractal-pagination__summary", children: totalItems === 0 ? "No results" : `${start}-${end} of ${totalItems}` }),
|
|
1438
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "fractal-pagination__controls", children: [
|
|
1439
|
+
canChangePageSize && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1440
|
+
Dropdown,
|
|
1441
|
+
{
|
|
1442
|
+
align: "right",
|
|
1443
|
+
className: "fractal-pagination__page-size",
|
|
1444
|
+
direction: "up",
|
|
1445
|
+
items: pageSizeOptions.map((option) => ({
|
|
1446
|
+
value: String(option),
|
|
1447
|
+
description: `${option} per page`
|
|
1448
|
+
})),
|
|
1449
|
+
onSelect: (value) => onPageSizeChange(Number(value)),
|
|
1450
|
+
selectedValue: String(pageSize),
|
|
1451
|
+
size: "sm",
|
|
1452
|
+
triggerLabel: "Results per page",
|
|
1453
|
+
triggerVariant: "tertiary"
|
|
1454
|
+
}
|
|
1455
|
+
),
|
|
1456
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1457
|
+
"button",
|
|
1458
|
+
{
|
|
1459
|
+
className: "fractal-pagination__button",
|
|
1460
|
+
type: "button",
|
|
1461
|
+
"aria-label": "Previous page",
|
|
1462
|
+
title: "Previous page",
|
|
1463
|
+
disabled: currentPage === 1 || totalItems === 0,
|
|
1464
|
+
onClick: () => onPageChange(currentPage - 1),
|
|
1465
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_fractal_icons8.ArrowLeft, { "aria-hidden": "true", size: 16 })
|
|
1466
|
+
}
|
|
1467
|
+
),
|
|
1468
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "fractal-pagination__page", "aria-current": "page", children: [
|
|
1469
|
+
currentPage,
|
|
1470
|
+
" of ",
|
|
1471
|
+
totalPages
|
|
1472
|
+
] }),
|
|
1473
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1474
|
+
"button",
|
|
1475
|
+
{
|
|
1476
|
+
className: "fractal-pagination__button",
|
|
1477
|
+
type: "button",
|
|
1478
|
+
"aria-label": "Next page",
|
|
1479
|
+
title: "Next page",
|
|
1480
|
+
disabled: currentPage === totalPages || totalItems === 0,
|
|
1481
|
+
onClick: () => onPageChange(currentPage + 1),
|
|
1482
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_fractal_icons8.ArrowRight, { "aria-hidden": "true", size: 16 })
|
|
1483
|
+
}
|
|
1484
|
+
)
|
|
1485
|
+
] })
|
|
1486
|
+
] });
|
|
1487
|
+
}
|
|
1099
1488
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1100
1489
|
0 && (module.exports = {
|
|
1101
1490
|
Alert,
|
|
@@ -1108,18 +1497,24 @@ SidebarFooter.displayName = "SidebarFooter";
|
|
|
1108
1497
|
CardFooter,
|
|
1109
1498
|
CardHeader,
|
|
1110
1499
|
CardTitle,
|
|
1500
|
+
Checkbox,
|
|
1111
1501
|
Chip,
|
|
1502
|
+
ContentSwitcher,
|
|
1112
1503
|
DataTable,
|
|
1113
1504
|
Disclosure,
|
|
1114
1505
|
Dropdown,
|
|
1115
1506
|
FeatureCard,
|
|
1507
|
+
FileDropzone,
|
|
1116
1508
|
FolderCard,
|
|
1117
1509
|
Input,
|
|
1118
1510
|
Label,
|
|
1511
|
+
LatticeLoader,
|
|
1119
1512
|
Link,
|
|
1120
1513
|
Modal,
|
|
1514
|
+
Pagination,
|
|
1121
1515
|
PromptCard,
|
|
1122
1516
|
PromptGrid,
|
|
1517
|
+
SidePanel,
|
|
1123
1518
|
Sidebar,
|
|
1124
1519
|
SidebarBrand,
|
|
1125
1520
|
SidebarFooter,
|
|
@@ -1129,6 +1524,8 @@ SidebarFooter.displayName = "SidebarFooter";
|
|
|
1129
1524
|
SidebarSection,
|
|
1130
1525
|
SortableTable,
|
|
1131
1526
|
Tabs,
|
|
1527
|
+
TextButton,
|
|
1528
|
+
Textarea,
|
|
1132
1529
|
Toggle,
|
|
1133
1530
|
cn,
|
|
1134
1531
|
useEscapeDismiss
|