@mirror-physics/fractal-ui 0.2.0-next.71 → 0.2.0-next.72
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 +331 -231
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +105 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +26 -1
- package/dist/index.d.ts +26 -1
- package/dist/index.js +330 -231
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -91,6 +91,7 @@ __export(index_exports, {
|
|
|
91
91
|
SidebarNav: () => SidebarNav,
|
|
92
92
|
SidebarNavItem: () => SidebarNavItem,
|
|
93
93
|
SidebarSection: () => SidebarSection,
|
|
94
|
+
Slider: () => Slider,
|
|
94
95
|
SortableTable: () => SortableTable,
|
|
95
96
|
SortableTableGhost: () => SortableTableGhost,
|
|
96
97
|
TableSearch: () => TableSearch,
|
|
@@ -907,10 +908,108 @@ function NumberInput({
|
|
|
907
908
|
] });
|
|
908
909
|
}
|
|
909
910
|
|
|
911
|
+
// src/components/Slider/Slider.tsx
|
|
912
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
913
|
+
function Slider(props) {
|
|
914
|
+
const {
|
|
915
|
+
min = 0,
|
|
916
|
+
max = 100,
|
|
917
|
+
step = 1,
|
|
918
|
+
disabled = false,
|
|
919
|
+
className,
|
|
920
|
+
showValues = true,
|
|
921
|
+
formatValue = (value) => value,
|
|
922
|
+
knobs = 1
|
|
923
|
+
} = props;
|
|
924
|
+
const span = Math.max(max - min, 1);
|
|
925
|
+
const rawValues = knobs === 2 ? props.value : [props.value];
|
|
926
|
+
const firstValue = clamp(rawValues[0], min, max);
|
|
927
|
+
const secondValue = knobs === 2 ? clamp(rawValues[1], firstValue, max) : firstValue;
|
|
928
|
+
const selectionStart = knobs === 2 ? firstValue : min;
|
|
929
|
+
const selectionEnd = secondValue;
|
|
930
|
+
const selectionStartPercent = (selectionStart - min) / span * 100;
|
|
931
|
+
const selectionEndPercent = (selectionEnd - min) / span * 100;
|
|
932
|
+
const changeSingleValue = (value) => {
|
|
933
|
+
;
|
|
934
|
+
props.onValueChange(clamp(value, min, max));
|
|
935
|
+
};
|
|
936
|
+
const changeRangeValue = (nextLower, nextUpper) => {
|
|
937
|
+
;
|
|
938
|
+
props.onValueChange([
|
|
939
|
+
clamp(nextLower, min, nextUpper),
|
|
940
|
+
clamp(nextUpper, nextLower, max)
|
|
941
|
+
]);
|
|
942
|
+
};
|
|
943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
944
|
+
"div",
|
|
945
|
+
{
|
|
946
|
+
className: cn("fractal-slider", disabled && "fractal-slider--disabled", className),
|
|
947
|
+
"data-disabled": disabled || void 0,
|
|
948
|
+
"data-knobs": knobs,
|
|
949
|
+
children: [
|
|
950
|
+
showValues && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "fractal-slider-values", "aria-hidden": "true", children: [
|
|
951
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("output", { children: formatValue(firstValue) }),
|
|
952
|
+
knobs === 2 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("output", { children: formatValue(secondValue) })
|
|
953
|
+
] }),
|
|
954
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
955
|
+
"div",
|
|
956
|
+
{
|
|
957
|
+
className: "fractal-slider-control",
|
|
958
|
+
style: {
|
|
959
|
+
"--fractal-slider-selection-start": `${selectionStartPercent}%`,
|
|
960
|
+
"--fractal-slider-selection-end": `${selectionEndPercent}%`
|
|
961
|
+
},
|
|
962
|
+
children: [
|
|
963
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "fractal-slider-track", "aria-hidden": "true" }),
|
|
964
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "fractal-slider-selection", "aria-hidden": "true" }),
|
|
965
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
966
|
+
"input",
|
|
967
|
+
{
|
|
968
|
+
"aria-label": knobs === 2 ? props.lowerAriaLabel ?? "Lower value" : props.ariaLabel ?? "Slider value",
|
|
969
|
+
disabled,
|
|
970
|
+
max,
|
|
971
|
+
min,
|
|
972
|
+
onChange: (event) => {
|
|
973
|
+
const nextValue = event.currentTarget.valueAsNumber;
|
|
974
|
+
if (knobs === 2) changeRangeValue(Math.min(nextValue, secondValue), secondValue);
|
|
975
|
+
else changeSingleValue(nextValue);
|
|
976
|
+
},
|
|
977
|
+
step,
|
|
978
|
+
type: "range",
|
|
979
|
+
value: firstValue
|
|
980
|
+
}
|
|
981
|
+
),
|
|
982
|
+
knobs === 2 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
983
|
+
"input",
|
|
984
|
+
{
|
|
985
|
+
"aria-label": props.upperAriaLabel ?? "Upper value",
|
|
986
|
+
disabled,
|
|
987
|
+
max,
|
|
988
|
+
min,
|
|
989
|
+
onChange: (event) => {
|
|
990
|
+
const nextValue = event.currentTarget.valueAsNumber;
|
|
991
|
+
changeRangeValue(firstValue, Math.max(nextValue, firstValue));
|
|
992
|
+
},
|
|
993
|
+
step,
|
|
994
|
+
type: "range",
|
|
995
|
+
value: secondValue
|
|
996
|
+
}
|
|
997
|
+
)
|
|
998
|
+
]
|
|
999
|
+
}
|
|
1000
|
+
)
|
|
1001
|
+
]
|
|
1002
|
+
}
|
|
1003
|
+
);
|
|
1004
|
+
}
|
|
1005
|
+
function clamp(value, minimum, maximum) {
|
|
1006
|
+
return Math.min(maximum, Math.max(minimum, value));
|
|
1007
|
+
}
|
|
1008
|
+
|
|
910
1009
|
// src/components/PasswordInput/PasswordInput.tsx
|
|
911
1010
|
var React7 = __toESM(require("react"), 1);
|
|
912
1011
|
var import_fractal_icons6 = require("@mirror-physics/fractal-icons");
|
|
913
|
-
var
|
|
1012
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
914
1013
|
var PasswordInput = React7.forwardRef(
|
|
915
1014
|
({
|
|
916
1015
|
className,
|
|
@@ -921,13 +1020,13 @@ var PasswordInput = React7.forwardRef(
|
|
|
921
1020
|
}, ref) => {
|
|
922
1021
|
const [passwordVisible, setPasswordVisible] = React7.useState(false);
|
|
923
1022
|
const toggleLabel = passwordVisible ? hidePasswordLabel : showPasswordLabel;
|
|
924
|
-
return /* @__PURE__ */ (0,
|
|
1023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
925
1024
|
"div",
|
|
926
1025
|
{
|
|
927
1026
|
className: cn("fractal-password-input", className),
|
|
928
1027
|
"data-password-visible": passwordVisible ? "" : void 0,
|
|
929
1028
|
children: [
|
|
930
|
-
/* @__PURE__ */ (0,
|
|
1029
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
931
1030
|
Input,
|
|
932
1031
|
{
|
|
933
1032
|
...props,
|
|
@@ -937,7 +1036,7 @@ var PasswordInput = React7.forwardRef(
|
|
|
937
1036
|
type: passwordVisible ? "text" : "password"
|
|
938
1037
|
}
|
|
939
1038
|
),
|
|
940
|
-
/* @__PURE__ */ (0,
|
|
1039
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
941
1040
|
"button",
|
|
942
1041
|
{
|
|
943
1042
|
type: "button",
|
|
@@ -947,7 +1046,7 @@ var PasswordInput = React7.forwardRef(
|
|
|
947
1046
|
disabled,
|
|
948
1047
|
title: toggleLabel,
|
|
949
1048
|
onClick: () => setPasswordVisible((visible) => !visible),
|
|
950
|
-
children: passwordVisible ? /* @__PURE__ */ (0,
|
|
1049
|
+
children: passwordVisible ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_fractal_icons6.EyeSlash, { "aria-hidden": "true", size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_fractal_icons6.Eye, { "aria-hidden": "true", size: 18 })
|
|
951
1050
|
}
|
|
952
1051
|
)
|
|
953
1052
|
]
|
|
@@ -959,9 +1058,9 @@ PasswordInput.displayName = "PasswordInput";
|
|
|
959
1058
|
|
|
960
1059
|
// src/components/Label/Label.tsx
|
|
961
1060
|
var React8 = __toESM(require("react"), 1);
|
|
962
|
-
var
|
|
1061
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
963
1062
|
var Label = React8.forwardRef(
|
|
964
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1063
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
965
1064
|
"label",
|
|
966
1065
|
{
|
|
967
1066
|
ref,
|
|
@@ -975,7 +1074,7 @@ Label.displayName = "Label";
|
|
|
975
1074
|
// src/components/Alert/Alert.tsx
|
|
976
1075
|
var React9 = __toESM(require("react"), 1);
|
|
977
1076
|
var import_fractal_icons7 = require("@mirror-physics/fractal-icons");
|
|
978
|
-
var
|
|
1077
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
979
1078
|
var defaultIcons = {
|
|
980
1079
|
default: import_fractal_icons7.CircleInfo,
|
|
981
1080
|
info: import_fractal_icons7.CircleInfo,
|
|
@@ -986,7 +1085,7 @@ var defaultIcons = {
|
|
|
986
1085
|
var Alert = React9.forwardRef(
|
|
987
1086
|
({ className, variant = "default", icon, children, ...props }, ref) => {
|
|
988
1087
|
const DefaultIcon = defaultIcons[variant];
|
|
989
|
-
return /* @__PURE__ */ (0,
|
|
1088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
990
1089
|
"div",
|
|
991
1090
|
{
|
|
992
1091
|
ref,
|
|
@@ -994,8 +1093,8 @@ var Alert = React9.forwardRef(
|
|
|
994
1093
|
className: cn("fractal-alert", `fractal-alert--${variant}`, className),
|
|
995
1094
|
...props,
|
|
996
1095
|
children: [
|
|
997
|
-
/* @__PURE__ */ (0,
|
|
998
|
-
/* @__PURE__ */ (0,
|
|
1096
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "fractal-alert-icon", "aria-hidden": true, children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DefaultIcon, { size: 18 }) }),
|
|
1097
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "fractal-alert-content", children })
|
|
999
1098
|
]
|
|
1000
1099
|
}
|
|
1001
1100
|
);
|
|
@@ -1003,18 +1102,18 @@ var Alert = React9.forwardRef(
|
|
|
1003
1102
|
);
|
|
1004
1103
|
Alert.displayName = "Alert";
|
|
1005
1104
|
var AlertTitle = React9.forwardRef(
|
|
1006
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1105
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h5", { ref, className: cn("fractal-alert-title", className), ...props })
|
|
1007
1106
|
);
|
|
1008
1107
|
AlertTitle.displayName = "AlertTitle";
|
|
1009
1108
|
var AlertDescription = React9.forwardRef(
|
|
1010
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1109
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ref, className: cn("fractal-alert-description", className), ...props })
|
|
1011
1110
|
);
|
|
1012
1111
|
AlertDescription.displayName = "AlertDescription";
|
|
1013
1112
|
|
|
1014
1113
|
// src/components/Toggle/Toggle.tsx
|
|
1015
|
-
var
|
|
1114
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1016
1115
|
function Toggle({ checked, onChange, label, className }) {
|
|
1017
|
-
return /* @__PURE__ */ (0,
|
|
1116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1018
1117
|
"button",
|
|
1019
1118
|
{
|
|
1020
1119
|
type: "button",
|
|
@@ -1023,8 +1122,8 @@ function Toggle({ checked, onChange, label, className }) {
|
|
|
1023
1122
|
className: cn("fractal-toggle", className),
|
|
1024
1123
|
onClick: () => onChange(!checked),
|
|
1025
1124
|
children: [
|
|
1026
|
-
/* @__PURE__ */ (0,
|
|
1027
|
-
label && /* @__PURE__ */ (0,
|
|
1125
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: cn("fractal-toggle-track", checked && "fractal-toggle-track--checked"), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: cn("fractal-toggle-thumb", checked && "fractal-toggle-thumb--checked") }) }),
|
|
1126
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "fractal-toggle-label", children: label })
|
|
1028
1127
|
]
|
|
1029
1128
|
}
|
|
1030
1129
|
);
|
|
@@ -1086,7 +1185,7 @@ function useEscapeDismiss(priority, handler, enabled = true) {
|
|
|
1086
1185
|
|
|
1087
1186
|
// src/components/UILoader/UILoader.tsx
|
|
1088
1187
|
var import_react3 = require("react");
|
|
1089
|
-
var
|
|
1188
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1090
1189
|
var LEFT = "M0 53C0 51 1.6 49.5 3.6 49.5h16.5c1 0 1.9.4 2.5 1L42.1 69.6c.7.7 1.1 1.6 1.1 2.5v16.2c0 2-1.6 3.5-3.6 3.5H23.1c-1 0-1.9-.4-2.5-1L1.1 71.7C.4 71 0 70.1 0 69.2V53Z";
|
|
1091
1190
|
var CENTER = "M0 3.5C0 1.6 1.6 0 3.6 0h16.5c1 0 1.9.4 2.5 1L92.5 69.6c.7.7 1 1.6 1 2.5v16.2c0 2-1.6 3.5-3.6 3.5H73.4c-1 0-1.9-.4-2.5-1L1.1 22.2C.4 21.6 0 20.7 0 19.7V3.5Z";
|
|
1092
1191
|
var RIGHT = "M50.4 3.5C50.4 1.6 52 0 54 0h16.5c1 0 1.9.4 2.5 1l69.8 68.6c.7.7 1.1 1.6 1.1 2.5v16.2c0 2-1.6 3.5-3.6 3.5h-16.5c-1 0-1.9-.4-2.5-1L51.4 22.2c-.7-.6-1-1.5-1-2.5V3.5Z";
|
|
@@ -1095,7 +1194,7 @@ function UILoader({ size = 48, tone = "neutral", className, style, label = "Load
|
|
|
1095
1194
|
const clipId = `fractal-ui-loader-clip-${rawId}`;
|
|
1096
1195
|
const gradientId = `fractal-ui-loader-gradient-${rawId}`;
|
|
1097
1196
|
const height = typeof size === "number" ? `${size}px` : size;
|
|
1098
|
-
return /* @__PURE__ */ (0,
|
|
1197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1099
1198
|
"span",
|
|
1100
1199
|
{
|
|
1101
1200
|
"aria-hidden": ariaHidden || void 0,
|
|
@@ -1103,35 +1202,35 @@ function UILoader({ size = 48, tone = "neutral", className, style, label = "Load
|
|
|
1103
1202
|
className: cn("fractal-ui-loader", `fractal-ui-loader--${tone}`, className),
|
|
1104
1203
|
role: ariaHidden ? void 0 : "status",
|
|
1105
1204
|
style,
|
|
1106
|
-
children: /* @__PURE__ */ (0,
|
|
1107
|
-
/* @__PURE__ */ (0,
|
|
1108
|
-
/* @__PURE__ */ (0,
|
|
1109
|
-
/* @__PURE__ */ (0,
|
|
1110
|
-
/* @__PURE__ */ (0,
|
|
1205
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { "aria-hidden": "true", fill: "none", viewBox: "0 0 144 92", style: { height, width: "auto" }, children: [
|
|
1206
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("defs", { children: [
|
|
1207
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("linearGradient", { id: gradientId, x1: "59", x2: "94.3", y1: "0", y2: "89.1", gradientUnits: "userSpaceOnUse", children: [
|
|
1208
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("stop", { className: "fractal-ui-loader__stop-start", offset: "0" }),
|
|
1209
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("stop", { className: "fractal-ui-loader__stop-end", offset: "1" })
|
|
1111
1210
|
] }),
|
|
1112
|
-
/* @__PURE__ */ (0,
|
|
1113
|
-
/* @__PURE__ */ (0,
|
|
1114
|
-
/* @__PURE__ */ (0,
|
|
1115
|
-
/* @__PURE__ */ (0,
|
|
1211
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("linearGradient", { id: `${gradientId}-shine`, x1: "0", x2: "1", y1: "0", y2: "0", children: [
|
|
1212
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("stop", { offset: "0.4", stopColor: "white", stopOpacity: "0" }),
|
|
1213
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("stop", { offset: "0.5", stopColor: "white", stopOpacity: "0.62" }),
|
|
1214
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("stop", { offset: "0.6", stopColor: "white", stopOpacity: "0" })
|
|
1116
1215
|
] }),
|
|
1117
|
-
/* @__PURE__ */ (0,
|
|
1118
|
-
/* @__PURE__ */ (0,
|
|
1119
|
-
/* @__PURE__ */ (0,
|
|
1120
|
-
/* @__PURE__ */ (0,
|
|
1216
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("clipPath", { id: clipId, children: [
|
|
1217
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: LEFT }),
|
|
1218
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: CENTER }),
|
|
1219
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: RIGHT })
|
|
1121
1220
|
] })
|
|
1122
1221
|
] }),
|
|
1123
|
-
/* @__PURE__ */ (0,
|
|
1124
|
-
/* @__PURE__ */ (0,
|
|
1125
|
-
/* @__PURE__ */ (0,
|
|
1126
|
-
/* @__PURE__ */ (0,
|
|
1222
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: CENTER, fill: `url(#${gradientId})` }),
|
|
1223
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: RIGHT, fill: `url(#${gradientId})` }),
|
|
1224
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: LEFT, fill: `url(#${gradientId})` }),
|
|
1225
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { clipPath: `url(#${clipId})`, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("g", { className: "fractal-ui-loader__shine-axis", transform: "translate(72 46) rotate(68.4)", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { className: "fractal-ui-loader__shine", x: "-160", y: "-100", width: "320", height: "200", fill: `url(#${gradientId}-shine)` }) }) })
|
|
1127
1226
|
] })
|
|
1128
1227
|
}
|
|
1129
1228
|
);
|
|
1130
1229
|
}
|
|
1131
1230
|
|
|
1132
1231
|
// src/components/Modal/Modal.tsx
|
|
1133
|
-
var
|
|
1134
|
-
var CloseIcon = () => /* @__PURE__ */ (0,
|
|
1232
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1233
|
+
var CloseIcon = () => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M12 4L4 12M4 4L12 12", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1135
1234
|
function Modal({ open, onClose, title, children, danger, warn, footer, noClose, closeDisabled = false, size = "sm", loading = false, loadingLabel = "Loading", scrollable = false, className }) {
|
|
1136
1235
|
const [bodyScrolled, setBodyScrolled] = React10.useState(false);
|
|
1137
1236
|
useEscapeDismiss(80, onClose, open && !noClose && !closeDisabled);
|
|
@@ -1142,13 +1241,13 @@ function Modal({ open, onClose, title, children, danger, warn, footer, noClose,
|
|
|
1142
1241
|
const sizeClass = `fractal-modal-panel--${size}`;
|
|
1143
1242
|
const accentClass = danger ? "fractal-modal-panel--danger" : warn ? "fractal-modal-panel--warn" : "";
|
|
1144
1243
|
return (0, import_react_dom.createPortal)(
|
|
1145
|
-
/* @__PURE__ */ (0,
|
|
1244
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "fractal-modal-overlay", onClick: noClose || closeDisabled ? void 0 : onClose, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1146
1245
|
"div",
|
|
1147
1246
|
{
|
|
1148
1247
|
className: cn("fractal-modal-panel", sizeClass, accentClass, scrollable && "fractal-modal-panel--scrollable", className),
|
|
1149
1248
|
onClick: (e) => e.stopPropagation(),
|
|
1150
1249
|
children: [
|
|
1151
|
-
/* @__PURE__ */ (0,
|
|
1250
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1152
1251
|
"div",
|
|
1153
1252
|
{
|
|
1154
1253
|
className: cn(
|
|
@@ -1157,12 +1256,12 @@ function Modal({ open, onClose, title, children, danger, warn, footer, noClose,
|
|
|
1157
1256
|
scrollable && bodyScrolled && "fractal-modal-title-row--scrolled"
|
|
1158
1257
|
),
|
|
1159
1258
|
children: [
|
|
1160
|
-
/* @__PURE__ */ (0,
|
|
1161
|
-
!noClose && /* @__PURE__ */ (0,
|
|
1259
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h3", { className: cn("fractal-modal-title", danger && "fractal-modal-title--danger", warn && "fractal-modal-title--warn"), children: title }),
|
|
1260
|
+
!noClose && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("button", { type: "button", onClick: onClose, title: "Close", disabled: closeDisabled, className: "fractal-modal-close", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CloseIcon, {}) })
|
|
1162
1261
|
]
|
|
1163
1262
|
}
|
|
1164
1263
|
),
|
|
1165
|
-
/* @__PURE__ */ (0,
|
|
1264
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1166
1265
|
"div",
|
|
1167
1266
|
{
|
|
1168
1267
|
"aria-busy": loading || void 0,
|
|
@@ -1173,10 +1272,10 @@ function Modal({ open, onClose, title, children, danger, warn, footer, noClose,
|
|
|
1173
1272
|
scrollable && "fractal-modal-body--scrollable"
|
|
1174
1273
|
),
|
|
1175
1274
|
onScroll: scrollable ? (event) => setBodyScrolled(event.currentTarget.scrollTop > 0) : void 0,
|
|
1176
|
-
children: loading ? /* @__PURE__ */ (0,
|
|
1275
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(UILoader, { label: loadingLabel }) : children
|
|
1177
1276
|
}
|
|
1178
1277
|
),
|
|
1179
|
-
footer && /* @__PURE__ */ (0,
|
|
1278
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: cn("fractal-modal-footer", scrollable && "fractal-modal-footer--divided"), children: footer })
|
|
1180
1279
|
]
|
|
1181
1280
|
}
|
|
1182
1281
|
) }),
|
|
@@ -1185,17 +1284,17 @@ function Modal({ open, onClose, title, children, danger, warn, footer, noClose,
|
|
|
1185
1284
|
}
|
|
1186
1285
|
|
|
1187
1286
|
// src/components/DataTable/DataTable.tsx
|
|
1188
|
-
var
|
|
1287
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1189
1288
|
function DataTable({ columns, data, emptyMessage, header, size = "md", className }) {
|
|
1190
|
-
return /* @__PURE__ */ (0,
|
|
1191
|
-
header && /* @__PURE__ */ (0,
|
|
1192
|
-
data.length === 0 ? /* @__PURE__ */ (0,
|
|
1193
|
-
/* @__PURE__ */ (0,
|
|
1194
|
-
/* @__PURE__ */ (0,
|
|
1289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: cn("fractal-datatable", `fractal-datatable--${size}`, className), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "fractal-datatable-surface", children: [
|
|
1290
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "fractal-datatable-header", children: header }),
|
|
1291
|
+
data.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "fractal-datatable-empty", children: emptyMessage || "No data" }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("table", { className: "fractal-datatable-table", children: [
|
|
1292
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("tr", { className: "fractal-datatable-thead-row", children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("th", { className: "fractal-datatable-th", style: { width: col.width }, children: col.header }, col.key)) }) }),
|
|
1293
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("tbody", { children: data.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1195
1294
|
"tr",
|
|
1196
1295
|
{
|
|
1197
1296
|
className: "fractal-datatable-row",
|
|
1198
|
-
children: columns.map((col) => /* @__PURE__ */ (0,
|
|
1297
|
+
children: columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("td", { className: "fractal-datatable-td", style: { width: col.width }, children: col.render(row, rowIndex) }, col.key))
|
|
1199
1298
|
},
|
|
1200
1299
|
rowIndex
|
|
1201
1300
|
)) })
|
|
@@ -1206,7 +1305,7 @@ function DataTable({ columns, data, emptyMessage, header, size = "md", className
|
|
|
1206
1305
|
// src/components/Dropdown/Dropdown.tsx
|
|
1207
1306
|
var React11 = __toESM(require("react"), 1);
|
|
1208
1307
|
var import_fractal_icons8 = require("@mirror-physics/fractal-icons");
|
|
1209
|
-
var
|
|
1308
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1210
1309
|
var MARGIN = 4;
|
|
1211
1310
|
function Dropdown({
|
|
1212
1311
|
items,
|
|
@@ -1302,8 +1401,8 @@ function Dropdown({
|
|
|
1302
1401
|
document.addEventListener("mousedown", handleClickOutside);
|
|
1303
1402
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1304
1403
|
}, [open]);
|
|
1305
|
-
return /* @__PURE__ */ (0,
|
|
1306
|
-
/* @__PURE__ */ (0,
|
|
1404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: cn("fractal-dropdown", className), children: [
|
|
1405
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1307
1406
|
"button",
|
|
1308
1407
|
{
|
|
1309
1408
|
ref: triggerRef,
|
|
@@ -1322,15 +1421,15 @@ function Dropdown({
|
|
|
1322
1421
|
triggerClassName
|
|
1323
1422
|
),
|
|
1324
1423
|
children: [
|
|
1325
|
-
triggerContent != null ? triggerContent : /* @__PURE__ */ (0,
|
|
1326
|
-
selected.icon != null && /* @__PURE__ */ (0,
|
|
1327
|
-
selected.description != null && (typeof selected.description !== "string" || selected.description !== "") && /* @__PURE__ */ (0,
|
|
1424
|
+
triggerContent != null ? triggerContent : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
1425
|
+
selected.icon != null && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "fractal-dropdown-icon fractal-dropdown-icon--trigger", children: selected.icon }),
|
|
1426
|
+
selected.description != null && (typeof selected.description !== "string" || selected.description !== "") && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "fractal-dropdown-selected-text", children: selected.description })
|
|
1328
1427
|
] }),
|
|
1329
|
-
!noChevron && !iconOnly && /* @__PURE__ */ (0,
|
|
1428
|
+
!noChevron && !iconOnly && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "fractal-dropdown-chevron", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChevronIcon, { size: size === "sm" ? 14 : 16 }) })
|
|
1330
1429
|
]
|
|
1331
1430
|
}
|
|
1332
1431
|
),
|
|
1333
|
-
open && /* @__PURE__ */ (0,
|
|
1432
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1334
1433
|
"div",
|
|
1335
1434
|
{
|
|
1336
1435
|
ref: panelRef,
|
|
@@ -1339,21 +1438,21 @@ function Dropdown({
|
|
|
1339
1438
|
className: cn("fractal-dropdown-panel", `fractal-dropdown-panel--${size}`, panelClassName),
|
|
1340
1439
|
style: panelStyle,
|
|
1341
1440
|
children: [
|
|
1342
|
-
label != null && /* @__PURE__ */ (0,
|
|
1441
|
+
label != null && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "fractal-dropdown-label", children: label }),
|
|
1343
1442
|
visibleItems.map((item, index) => {
|
|
1344
|
-
const topDivider = item.border === "top" ? /* @__PURE__ */ (0,
|
|
1345
|
-
const bottomDivider = item.border === "bottom" ? /* @__PURE__ */ (0,
|
|
1443
|
+
const topDivider = item.border === "top" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "fractal-dropdown-separator" }) : null;
|
|
1444
|
+
const bottomDivider = item.border === "bottom" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "fractal-dropdown-separator" }) : null;
|
|
1346
1445
|
if (item.kind === "header") {
|
|
1347
|
-
return /* @__PURE__ */ (0,
|
|
1446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(React11.Fragment, { children: [
|
|
1348
1447
|
topDivider,
|
|
1349
|
-
/* @__PURE__ */ (0,
|
|
1448
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { role: "presentation", className: "fractal-dropdown-label", children: item.description }),
|
|
1350
1449
|
bottomDivider
|
|
1351
1450
|
] }, `header-${index}`);
|
|
1352
1451
|
}
|
|
1353
1452
|
const isSelected = item.value === selectedValue;
|
|
1354
|
-
return /* @__PURE__ */ (0,
|
|
1453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(React11.Fragment, { children: [
|
|
1355
1454
|
topDivider,
|
|
1356
|
-
/* @__PURE__ */ (0,
|
|
1455
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1357
1456
|
"button",
|
|
1358
1457
|
{
|
|
1359
1458
|
type: "button",
|
|
@@ -1365,9 +1464,9 @@ function Dropdown({
|
|
|
1365
1464
|
},
|
|
1366
1465
|
className: "fractal-dropdown-option",
|
|
1367
1466
|
children: [
|
|
1368
|
-
item.icon != null && /* @__PURE__ */ (0,
|
|
1369
|
-
item.description != null && (typeof item.description !== "string" || item.description !== "") && /* @__PURE__ */ (0,
|
|
1370
|
-
item.trailing != null && /* @__PURE__ */ (0,
|
|
1467
|
+
item.icon != null && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "fractal-dropdown-icon", children: item.icon }),
|
|
1468
|
+
item.description != null && (typeof item.description !== "string" || item.description !== "") && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "fractal-dropdown-option-text", children: item.description }),
|
|
1469
|
+
item.trailing != null && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "fractal-dropdown-trailing", children: item.trailing })
|
|
1371
1470
|
]
|
|
1372
1471
|
}
|
|
1373
1472
|
),
|
|
@@ -1382,9 +1481,9 @@ function Dropdown({
|
|
|
1382
1481
|
|
|
1383
1482
|
// src/components/Link/Link.tsx
|
|
1384
1483
|
var React12 = __toESM(require("react"), 1);
|
|
1385
|
-
var
|
|
1484
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1386
1485
|
var Link = React12.forwardRef(
|
|
1387
|
-
({ className, theme = "default", size = "md", ...props }, ref) => /* @__PURE__ */ (0,
|
|
1486
|
+
({ className, theme = "default", size = "md", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1388
1487
|
"a",
|
|
1389
1488
|
{
|
|
1390
1489
|
ref,
|
|
@@ -1397,9 +1496,9 @@ Link.displayName = "Link";
|
|
|
1397
1496
|
|
|
1398
1497
|
// src/components/Chip/Chip.tsx
|
|
1399
1498
|
var React13 = __toESM(require("react"), 1);
|
|
1400
|
-
var
|
|
1499
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1401
1500
|
var Chip = React13.forwardRef(
|
|
1402
|
-
({ className, tone = "neutral", ...props }, ref) => /* @__PURE__ */ (0,
|
|
1501
|
+
({ className, tone = "neutral", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1403
1502
|
"span",
|
|
1404
1503
|
{
|
|
1405
1504
|
ref,
|
|
@@ -1412,7 +1511,7 @@ Chip.displayName = "Chip";
|
|
|
1412
1511
|
|
|
1413
1512
|
// src/components/Checkbox/Checkbox.tsx
|
|
1414
1513
|
var import_fractal_icons9 = require("@mirror-physics/fractal-icons");
|
|
1415
|
-
var
|
|
1514
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1416
1515
|
function Checkbox({
|
|
1417
1516
|
checked,
|
|
1418
1517
|
indeterminate = false,
|
|
@@ -1423,7 +1522,7 @@ function Checkbox({
|
|
|
1423
1522
|
onKeyDown,
|
|
1424
1523
|
...props
|
|
1425
1524
|
}) {
|
|
1426
|
-
return /* @__PURE__ */ (0,
|
|
1525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1427
1526
|
"button",
|
|
1428
1527
|
{
|
|
1429
1528
|
...props,
|
|
@@ -1445,10 +1544,10 @@ function Checkbox({
|
|
|
1445
1544
|
onKeyDown?.(event);
|
|
1446
1545
|
if (event.key === " " || event.key === "Enter") event.stopPropagation();
|
|
1447
1546
|
},
|
|
1448
|
-
children: indeterminate ? /* @__PURE__ */ (0,
|
|
1449
|
-
/* @__PURE__ */ (0,
|
|
1450
|
-
/* @__PURE__ */ (0,
|
|
1451
|
-
] }) : checked ? /* @__PURE__ */ (0,
|
|
1547
|
+
children: indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "fractal-checkbox__indeterminate-icon", "aria-hidden": "true", children: [
|
|
1548
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_fractal_icons9.Checkbox, { size: 18 }),
|
|
1549
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_fractal_icons9.Minus, { className: "fractal-checkbox__indeterminate-mark", size: 12 })
|
|
1550
|
+
] }) : checked ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_fractal_icons9.CheckboxChecked, { "aria-hidden": "true", size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_fractal_icons9.Checkbox, { "aria-hidden": "true", size: 18 })
|
|
1452
1551
|
}
|
|
1453
1552
|
);
|
|
1454
1553
|
}
|
|
@@ -1456,7 +1555,7 @@ function Checkbox({
|
|
|
1456
1555
|
// src/components/SortableTable/SortableTable.tsx
|
|
1457
1556
|
var import_react4 = require("react");
|
|
1458
1557
|
var import_fractal_icons10 = require("@mirror-physics/fractal-icons");
|
|
1459
|
-
var
|
|
1558
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1460
1559
|
function SortableTable({
|
|
1461
1560
|
columns,
|
|
1462
1561
|
data,
|
|
@@ -1551,16 +1650,16 @@ function SortableTable({
|
|
|
1551
1650
|
onSortChange?.(nextKey, nextDirection);
|
|
1552
1651
|
}
|
|
1553
1652
|
};
|
|
1554
|
-
return /* @__PURE__ */ (0,
|
|
1555
|
-
header && /* @__PURE__ */ (0,
|
|
1556
|
-
visibleRows.length === 0 ? /* @__PURE__ */ (0,
|
|
1557
|
-
/* @__PURE__ */ (0,
|
|
1558
|
-
selection && /* @__PURE__ */ (0,
|
|
1653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: cn("fractal-sortable-table", `fractal-sortable-table--${size}`, embedded && "fractal-sortable-table--embedded", className), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "fractal-sortable-table-surface", children: [
|
|
1654
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "fractal-sortable-table-header", children: header }),
|
|
1655
|
+
visibleRows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "fractal-sortable-table-empty", children: emptyMessage || "No data" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("table", { "aria-label": ariaLabel, className: "fractal-sortable-table-table", children: [
|
|
1656
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("tr", { className: "fractal-sortable-table-thead-row", children: [
|
|
1657
|
+
selection && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1559
1658
|
"th",
|
|
1560
1659
|
{
|
|
1561
1660
|
className: "fractal-sortable-table-th fractal-sortable-table-selection-cell",
|
|
1562
1661
|
scope: "col",
|
|
1563
|
-
children: /* @__PURE__ */ (0,
|
|
1662
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1564
1663
|
Checkbox,
|
|
1565
1664
|
{
|
|
1566
1665
|
"aria-label": selection.selectAllLabel ?? "Select all rows",
|
|
@@ -1586,7 +1685,7 @@ function SortableTable({
|
|
|
1586
1685
|
columns.map((col) => {
|
|
1587
1686
|
const isActive = activeKey === col.key && activeDirection !== null;
|
|
1588
1687
|
if (!col.sortable) {
|
|
1589
|
-
return /* @__PURE__ */ (0,
|
|
1688
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1590
1689
|
"th",
|
|
1591
1690
|
{
|
|
1592
1691
|
className: "fractal-sortable-table-th",
|
|
@@ -1597,13 +1696,13 @@ function SortableTable({
|
|
|
1597
1696
|
col.key
|
|
1598
1697
|
);
|
|
1599
1698
|
}
|
|
1600
|
-
return /* @__PURE__ */ (0,
|
|
1699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1601
1700
|
"th",
|
|
1602
1701
|
{
|
|
1603
1702
|
className: "fractal-sortable-table-th fractal-sortable-table-th--sortable",
|
|
1604
1703
|
scope: "col",
|
|
1605
1704
|
style: { width: col.width },
|
|
1606
|
-
children: /* @__PURE__ */ (0,
|
|
1705
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1607
1706
|
"button",
|
|
1608
1707
|
{
|
|
1609
1708
|
type: "button",
|
|
@@ -1614,8 +1713,8 @@ function SortableTable({
|
|
|
1614
1713
|
onClick: () => handleSortClick(col.key),
|
|
1615
1714
|
"aria-sort": isActive ? activeDirection === "asc" ? "ascending" : "descending" : "none",
|
|
1616
1715
|
children: [
|
|
1617
|
-
/* @__PURE__ */ (0,
|
|
1618
|
-
/* @__PURE__ */ (0,
|
|
1716
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: col.header }),
|
|
1717
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "fractal-sortable-table-sort-icon", "aria-hidden": "true", children: isActive && activeDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_fractal_icons10.ArrowUp, { size: 14 }) : isActive && activeDirection === "desc" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_fractal_icons10.ArrowDown, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_fractal_icons10.ArrowsUpDown, { size: 14 }) })
|
|
1619
1718
|
]
|
|
1620
1719
|
}
|
|
1621
1720
|
)
|
|
@@ -1624,7 +1723,7 @@ function SortableTable({
|
|
|
1624
1723
|
);
|
|
1625
1724
|
})
|
|
1626
1725
|
] }) }),
|
|
1627
|
-
/* @__PURE__ */ (0,
|
|
1726
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("tbody", { children: visibleRows.map((row, rowIndex) => {
|
|
1628
1727
|
const highlighted = highlightRow?.(row, rowIndex) ?? false;
|
|
1629
1728
|
const disabled = isRowDisabled?.(row) ?? false;
|
|
1630
1729
|
const selectionDisabled = disabled || (isRowSelectionDisabled?.(row) ?? false);
|
|
@@ -1633,7 +1732,7 @@ function SortableTable({
|
|
|
1633
1732
|
label: rowAction.label(row, rowIndex),
|
|
1634
1733
|
icon: rowAction.icon(row, rowIndex)
|
|
1635
1734
|
} : null;
|
|
1636
|
-
return /* @__PURE__ */ (0,
|
|
1735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1637
1736
|
"tr",
|
|
1638
1737
|
{
|
|
1639
1738
|
className: cn(
|
|
@@ -1657,7 +1756,7 @@ function SortableTable({
|
|
|
1657
1756
|
role: interactive ? "button" : void 0,
|
|
1658
1757
|
tabIndex: interactive ? 0 : void 0,
|
|
1659
1758
|
children: [
|
|
1660
|
-
selection && /* @__PURE__ */ (0,
|
|
1759
|
+
selection && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("td", { className: "fractal-sortable-table-td fractal-sortable-table-selection-cell", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1661
1760
|
Checkbox,
|
|
1662
1761
|
{
|
|
1663
1762
|
"aria-label": selection.getRowLabel(row),
|
|
@@ -1669,7 +1768,7 @@ function SortableTable({
|
|
|
1669
1768
|
}
|
|
1670
1769
|
}
|
|
1671
1770
|
) }),
|
|
1672
|
-
columns.map((col, columnIndex) => /* @__PURE__ */ (0,
|
|
1771
|
+
columns.map((col, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1673
1772
|
"td",
|
|
1674
1773
|
{
|
|
1675
1774
|
className: cn(
|
|
@@ -1679,7 +1778,7 @@ function SortableTable({
|
|
|
1679
1778
|
style: { width: col.width, textAlign: col.align ?? "left" },
|
|
1680
1779
|
children: [
|
|
1681
1780
|
col.render(row, rowIndex),
|
|
1682
|
-
action && columnIndex === columns.length - 1 && /* @__PURE__ */ (0,
|
|
1781
|
+
action && columnIndex === columns.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "fractal-sortable-table-row-action", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "fractal-sortable-table-row-action__icon", children: action.icon }) })
|
|
1683
1782
|
]
|
|
1684
1783
|
},
|
|
1685
1784
|
col.key
|
|
@@ -1695,7 +1794,7 @@ function SortableTable({
|
|
|
1695
1794
|
|
|
1696
1795
|
// src/components/Tabs/Tabs.tsx
|
|
1697
1796
|
var import_react5 = require("react");
|
|
1698
|
-
var
|
|
1797
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1699
1798
|
function Tabs({
|
|
1700
1799
|
items,
|
|
1701
1800
|
defaultValue,
|
|
@@ -1766,8 +1865,8 @@ function Tabs({
|
|
|
1766
1865
|
selectTab(nextId2);
|
|
1767
1866
|
requestAnimationFrame(() => tabRefs.current[nextId2]?.focus());
|
|
1768
1867
|
};
|
|
1769
|
-
return /* @__PURE__ */ (0,
|
|
1770
|
-
/* @__PURE__ */ (0,
|
|
1868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: cn("fractal-tabs", `fractal-tabs--${variant}`, divider && "fractal-tabs--divider", className), children: [
|
|
1869
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1771
1870
|
"div",
|
|
1772
1871
|
{
|
|
1773
1872
|
ref: tabListRef,
|
|
@@ -1780,7 +1879,7 @@ function Tabs({
|
|
|
1780
1879
|
const isActive = item.id === activeId;
|
|
1781
1880
|
const tabId = `${reactId}-tab-${item.id}`;
|
|
1782
1881
|
const panelId = `${reactId}-panel-${item.id}`;
|
|
1783
|
-
return /* @__PURE__ */ (0,
|
|
1882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1784
1883
|
"button",
|
|
1785
1884
|
{
|
|
1786
1885
|
ref: (el) => {
|
|
@@ -1811,7 +1910,7 @@ function Tabs({
|
|
|
1811
1910
|
const tabId = `${reactId}-tab-${item.id}`;
|
|
1812
1911
|
const panelId = `${reactId}-panel-${item.id}`;
|
|
1813
1912
|
const isActive = item.id === activeId;
|
|
1814
|
-
return /* @__PURE__ */ (0,
|
|
1913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1815
1914
|
"div",
|
|
1816
1915
|
{
|
|
1817
1916
|
id: panelId,
|
|
@@ -1829,7 +1928,7 @@ function Tabs({
|
|
|
1829
1928
|
|
|
1830
1929
|
// src/components/ContentSwitcher/ContentSwitcher.tsx
|
|
1831
1930
|
var React14 = __toESM(require("react"), 1);
|
|
1832
|
-
var
|
|
1931
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1833
1932
|
function ContentSwitcher({ items, value, onValueChange, ariaLabel, fullWidth = false, className }) {
|
|
1834
1933
|
const switcherRef = React14.useRef(null);
|
|
1835
1934
|
const buttonRefs = React14.useRef([]);
|
|
@@ -1887,7 +1986,7 @@ function ContentSwitcher({ items, value, onValueChange, ariaLabel, fullWidth = f
|
|
|
1887
1986
|
onValueChange(items[nextIndex].value);
|
|
1888
1987
|
}
|
|
1889
1988
|
};
|
|
1890
|
-
return /* @__PURE__ */ (0,
|
|
1989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1891
1990
|
"div",
|
|
1892
1991
|
{
|
|
1893
1992
|
className: cn("fractal-content-switcher", fullWidth && "fractal-content-switcher--full-width", className),
|
|
@@ -1895,10 +1994,10 @@ function ContentSwitcher({ items, value, onValueChange, ariaLabel, fullWidth = f
|
|
|
1895
1994
|
"aria-label": ariaLabel,
|
|
1896
1995
|
ref: switcherRef,
|
|
1897
1996
|
children: [
|
|
1898
|
-
/* @__PURE__ */ (0,
|
|
1997
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "fractal-content-switcher__indicator", "aria-hidden": true }),
|
|
1899
1998
|
items.map((item, index) => {
|
|
1900
1999
|
const active = item.value === value;
|
|
1901
|
-
return /* @__PURE__ */ (0,
|
|
2000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1902
2001
|
"button",
|
|
1903
2002
|
{
|
|
1904
2003
|
className: cn("fractal-content-switcher__item", active && "fractal-content-switcher__item--active"),
|
|
@@ -1932,7 +2031,7 @@ function ContentSwitcher({ items, value, onValueChange, ariaLabel, fullWidth = f
|
|
|
1932
2031
|
// src/components/Disclosure/Disclosure.tsx
|
|
1933
2032
|
var import_react6 = require("react");
|
|
1934
2033
|
var import_fractal_icons11 = require("@mirror-physics/fractal-icons");
|
|
1935
|
-
var
|
|
2034
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1936
2035
|
function Disclosure({
|
|
1937
2036
|
title,
|
|
1938
2037
|
meta,
|
|
@@ -1960,7 +2059,7 @@ function Disclosure({
|
|
|
1960
2059
|
onOpenChange?.(next);
|
|
1961
2060
|
}
|
|
1962
2061
|
};
|
|
1963
|
-
return /* @__PURE__ */ (0,
|
|
2062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1964
2063
|
"div",
|
|
1965
2064
|
{
|
|
1966
2065
|
className: cn(
|
|
@@ -1971,7 +2070,7 @@ function Disclosure({
|
|
|
1971
2070
|
className
|
|
1972
2071
|
),
|
|
1973
2072
|
children: [
|
|
1974
|
-
/* @__PURE__ */ (0,
|
|
2073
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1975
2074
|
"button",
|
|
1976
2075
|
{
|
|
1977
2076
|
type: "button",
|
|
@@ -1982,13 +2081,13 @@ function Disclosure({
|
|
|
1982
2081
|
disabled,
|
|
1983
2082
|
onClick: toggle,
|
|
1984
2083
|
children: [
|
|
1985
|
-
/* @__PURE__ */ (0,
|
|
1986
|
-
/* @__PURE__ */ (0,
|
|
1987
|
-
meta && /* @__PURE__ */ (0,
|
|
2084
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "fractal-disclosure-icon", "aria-hidden": "true", children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_fractal_icons11.ChevronDown, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_fractal_icons11.ChevronRight, { size: 16 }) }),
|
|
2085
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "fractal-disclosure-title", children: title }),
|
|
2086
|
+
meta && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "fractal-disclosure-meta", children: meta })
|
|
1988
2087
|
]
|
|
1989
2088
|
}
|
|
1990
2089
|
),
|
|
1991
|
-
/* @__PURE__ */ (0,
|
|
2090
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1992
2091
|
"div",
|
|
1993
2092
|
{
|
|
1994
2093
|
id: panelId,
|
|
@@ -1996,7 +2095,7 @@ function Disclosure({
|
|
|
1996
2095
|
"aria-labelledby": headerId,
|
|
1997
2096
|
className: "fractal-disclosure-panel",
|
|
1998
2097
|
hidden: !isOpen,
|
|
1999
|
-
children: /* @__PURE__ */ (0,
|
|
2098
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "fractal-disclosure-panel-inner", children })
|
|
2000
2099
|
}
|
|
2001
2100
|
)
|
|
2002
2101
|
]
|
|
@@ -2005,18 +2104,18 @@ function Disclosure({
|
|
|
2005
2104
|
}
|
|
2006
2105
|
|
|
2007
2106
|
// src/components/LatticeLoader/LatticeLoader.tsx
|
|
2008
|
-
var
|
|
2107
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2009
2108
|
var LATTICE_COUNT = 160;
|
|
2010
2109
|
var WAVE_PERIOD = 80;
|
|
2011
2110
|
function LatticeLoader({ className, label = "Loading", ...props }) {
|
|
2012
|
-
return /* @__PURE__ */ (0,
|
|
2111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2013
2112
|
"span",
|
|
2014
2113
|
{
|
|
2015
2114
|
"aria-label": label,
|
|
2016
2115
|
className: cn("fractal-lattice-loader", className),
|
|
2017
2116
|
role: "progressbar",
|
|
2018
2117
|
...props,
|
|
2019
|
-
children: Array.from({ length: LATTICE_COUNT }, (_, index) => /* @__PURE__ */ (0,
|
|
2118
|
+
children: Array.from({ length: LATTICE_COUNT }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2020
2119
|
"span",
|
|
2021
2120
|
{
|
|
2022
2121
|
"aria-hidden": "true",
|
|
@@ -2030,10 +2129,10 @@ function LatticeLoader({ className, label = "Loading", ...props }) {
|
|
|
2030
2129
|
}
|
|
2031
2130
|
|
|
2032
2131
|
// src/components/Ghost/Ghost.tsx
|
|
2033
|
-
var
|
|
2132
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2034
2133
|
var toCssLength = (value) => typeof value === "number" ? `${value}px` : value;
|
|
2035
2134
|
function Ghost({ className, width, height, radius, style, ...props }) {
|
|
2036
|
-
return /* @__PURE__ */ (0,
|
|
2135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2037
2136
|
"div",
|
|
2038
2137
|
{
|
|
2039
2138
|
"aria-hidden": "true",
|
|
@@ -2049,15 +2148,15 @@ function Ghost({ className, width, height, radius, style, ...props }) {
|
|
|
2049
2148
|
);
|
|
2050
2149
|
}
|
|
2051
2150
|
function GhostLine({ className, size = "md", width = "100%", ...props }) {
|
|
2052
|
-
return /* @__PURE__ */ (0,
|
|
2151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Ghost, { className: cn("fractal-ghost-line", `fractal-ghost-line--${size}`, className), width, ...props });
|
|
2053
2152
|
}
|
|
2054
2153
|
function ButtonGhost({ className, size = "md", iconOnly = false, width, ...props }) {
|
|
2055
|
-
return /* @__PURE__ */ (0,
|
|
2154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Ghost, { className: cn("fractal-ghost-button", `fractal-ghost-button--${size}`, iconOnly && "fractal-ghost-button--icon-only", className), width, ...props });
|
|
2056
2155
|
}
|
|
2057
2156
|
function CardGhost({ className, lines = 3, showHeader = true, ...props }) {
|
|
2058
|
-
return /* @__PURE__ */ (0,
|
|
2059
|
-
showHeader && /* @__PURE__ */ (0,
|
|
2060
|
-
/* @__PURE__ */ (0,
|
|
2157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { "aria-hidden": "true", className: cn("fractal-ghost-card", className), ...props, children: [
|
|
2158
|
+
showHeader && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { width: "38%" }),
|
|
2159
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "fractal-ghost-stack", children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { width: index === lines - 1 ? "62%" : "100%" }, index)) })
|
|
2061
2160
|
] });
|
|
2062
2161
|
}
|
|
2063
2162
|
function DataTableGhost({
|
|
@@ -2071,81 +2170,81 @@ function DataTableGhost({
|
|
|
2071
2170
|
...props
|
|
2072
2171
|
}) {
|
|
2073
2172
|
const cells = Array.from({ length: columns }, (_, index) => index);
|
|
2074
|
-
return /* @__PURE__ */ (0,
|
|
2075
|
-
(showHeader || headers) && /* @__PURE__ */ (0,
|
|
2076
|
-
/* @__PURE__ */ (0,
|
|
2173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { "aria-busy": "true", "aria-label": "Loading table", className: cn("fractal-ghost-table", `fractal-ghost-table--${size}`, className), role: "status", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("table", { className: "fractal-ghost-table__table", children: [
|
|
2174
|
+
(showHeader || headers) && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("tr", { className: "fractal-ghost-table__head-row", children: cells.map((index) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("th", { style: { width: columnWidths?.[index] }, children: headers?.[index] ?? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { size: "sm", width: index === columns - 1 ? "62%" : "76%" }) }, index)) }) }),
|
|
2175
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("tbody", { children: Array.from({ length: rows }, (_, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("tr", { className: "fractal-ghost-table__row", children: cells.map((columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("td", { style: { width: columnWidths?.[columnIndex] }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { width: `${[72, 54, 82, 63, 46][(rowIndex + columnIndex) % 5]}%` }) }, columnIndex)) }, rowIndex)) })
|
|
2077
2176
|
] }) });
|
|
2078
2177
|
}
|
|
2079
2178
|
function InputGhost({ className, labelWidth = "26%", ...props }) {
|
|
2080
|
-
return /* @__PURE__ */ (0,
|
|
2179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FormFieldGhost, { className, labelWidth, ...props });
|
|
2081
2180
|
}
|
|
2082
2181
|
function TextareaGhost({ className, labelWidth = "26%", ...props }) {
|
|
2083
|
-
return /* @__PURE__ */ (0,
|
|
2182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FormFieldGhost, { className, labelWidth, multiline: true, ...props });
|
|
2084
2183
|
}
|
|
2085
2184
|
function LabelGhost({ className, width = "26%", ...props }) {
|
|
2086
|
-
return /* @__PURE__ */ (0,
|
|
2185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { className: cn("fractal-ghost-label", className), size: "sm", width, ...props });
|
|
2087
2186
|
}
|
|
2088
2187
|
function FormFieldGhost({ className, labelWidth = "26%", multiline = false, ...props }) {
|
|
2089
|
-
return /* @__PURE__ */ (0,
|
|
2090
|
-
/* @__PURE__ */ (0,
|
|
2091
|
-
/* @__PURE__ */ (0,
|
|
2188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { "aria-hidden": "true", className: cn("fractal-ghost-field", className), ...props, children: [
|
|
2189
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(LabelGhost, { width: labelWidth }),
|
|
2190
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Ghost, { className: cn("fractal-ghost-field__control", multiline && "fractal-ghost-field__control--multiline") })
|
|
2092
2191
|
] });
|
|
2093
2192
|
}
|
|
2094
2193
|
function AlertGhost({ className, ...props }) {
|
|
2095
|
-
return /* @__PURE__ */ (0,
|
|
2096
|
-
/* @__PURE__ */ (0,
|
|
2097
|
-
/* @__PURE__ */ (0,
|
|
2194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { "aria-hidden": "true", className: cn("fractal-ghost-alert", className), ...props, children: [
|
|
2195
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { width: "30%" }),
|
|
2196
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { size: "sm", width: "78%" })
|
|
2098
2197
|
] });
|
|
2099
2198
|
}
|
|
2100
2199
|
function CheckboxGhost({ className, ...props }) {
|
|
2101
|
-
return /* @__PURE__ */ (0,
|
|
2102
|
-
/* @__PURE__ */ (0,
|
|
2103
|
-
/* @__PURE__ */ (0,
|
|
2200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { "aria-hidden": "true", className: cn("fractal-ghost-choice", className), ...props, children: [
|
|
2201
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Ghost, { className: "fractal-ghost-choice__control" }),
|
|
2202
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { width: "42%" })
|
|
2104
2203
|
] });
|
|
2105
2204
|
}
|
|
2106
2205
|
var ToggleGhost = CheckboxGhost;
|
|
2107
2206
|
function ChipGhost({ className, width = 74, ...props }) {
|
|
2108
|
-
return /* @__PURE__ */ (0,
|
|
2207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Ghost, { className: cn("fractal-ghost-chip", className), height: 24, width, ...props });
|
|
2109
2208
|
}
|
|
2110
2209
|
function LinkGhost({ className, width = 96, ...props }) {
|
|
2111
|
-
return /* @__PURE__ */ (0,
|
|
2210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { className: cn("fractal-ghost-link", className), size: "sm", width, ...props });
|
|
2112
2211
|
}
|
|
2113
2212
|
var TextButtonGhost = LinkGhost;
|
|
2114
2213
|
function DropdownGhost({ className, ...props }) {
|
|
2115
|
-
return /* @__PURE__ */ (0,
|
|
2116
|
-
/* @__PURE__ */ (0,
|
|
2117
|
-
/* @__PURE__ */ (0,
|
|
2214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { "aria-hidden": "true", className: cn("fractal-ghost-dropdown", className), ...props, children: [
|
|
2215
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { width: "38%" }),
|
|
2216
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Ghost, { className: "fractal-ghost-dropdown__chevron" })
|
|
2118
2217
|
] });
|
|
2119
2218
|
}
|
|
2120
2219
|
function ContentSwitcherGhost({ className, options = 3, ...props }) {
|
|
2121
|
-
return /* @__PURE__ */ (0,
|
|
2220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { "aria-hidden": "true", className: cn("fractal-ghost-switcher", className), ...props, children: Array.from({ length: options }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Ghost, {}, index)) });
|
|
2122
2221
|
}
|
|
2123
2222
|
var TabsGhost = ContentSwitcherGhost;
|
|
2124
2223
|
function DisclosureGhost({ className, ...props }) {
|
|
2125
|
-
return /* @__PURE__ */ (0,
|
|
2126
|
-
/* @__PURE__ */ (0,
|
|
2127
|
-
/* @__PURE__ */ (0,
|
|
2224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { "aria-hidden": "true", className: cn("fractal-ghost-disclosure", className), ...props, children: [
|
|
2225
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Ghost, { className: "fractal-ghost-disclosure__icon" }),
|
|
2226
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { width: "42%" })
|
|
2128
2227
|
] });
|
|
2129
2228
|
}
|
|
2130
2229
|
function PaginationGhost({ className, pages = 5, ...props }) {
|
|
2131
|
-
return /* @__PURE__ */ (0,
|
|
2230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { "aria-hidden": "true", className: cn("fractal-ghost-pagination", className), ...props, children: Array.from({ length: pages }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Ghost, {}, index)) });
|
|
2132
2231
|
}
|
|
2133
2232
|
function FileDropzoneGhost({ className, ...props }) {
|
|
2134
|
-
return /* @__PURE__ */ (0,
|
|
2135
|
-
/* @__PURE__ */ (0,
|
|
2136
|
-
/* @__PURE__ */ (0,
|
|
2137
|
-
/* @__PURE__ */ (0,
|
|
2233
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { "aria-hidden": "true", className: cn("fractal-ghost-dropzone", className), ...props, children: [
|
|
2234
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Ghost, { className: "fractal-ghost-dropzone__icon" }),
|
|
2235
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { width: "26%" }),
|
|
2236
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { size: "sm", width: "46%" })
|
|
2138
2237
|
] });
|
|
2139
2238
|
}
|
|
2140
2239
|
function PromptCardGhost({ className, ...props }) {
|
|
2141
|
-
return /* @__PURE__ */ (0,
|
|
2240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CardGhost, { className: cn("fractal-ghost-prompt-card", className), lines: 4, ...props });
|
|
2142
2241
|
}
|
|
2143
2242
|
function ConversationGhost({
|
|
2144
2243
|
className,
|
|
2145
2244
|
"aria-label": ariaLabel = "Loading conversation",
|
|
2146
2245
|
...props
|
|
2147
2246
|
}) {
|
|
2148
|
-
return /* @__PURE__ */ (0,
|
|
2247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2149
2248
|
"div",
|
|
2150
2249
|
{
|
|
2151
2250
|
"aria-busy": "true",
|
|
@@ -2154,54 +2253,54 @@ function ConversationGhost({
|
|
|
2154
2253
|
role: "status",
|
|
2155
2254
|
...props,
|
|
2156
2255
|
children: [
|
|
2157
|
-
/* @__PURE__ */ (0,
|
|
2158
|
-
/* @__PURE__ */ (0,
|
|
2159
|
-
/* @__PURE__ */ (0,
|
|
2160
|
-
/* @__PURE__ */ (0,
|
|
2256
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { "aria-hidden": "true", className: "fractal-ghost-conversation__message fractal-ghost-conversation__message--user", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "fractal-ghost-conversation__bubble", children: [
|
|
2257
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { width: "100%" }),
|
|
2258
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { width: "86%" }),
|
|
2259
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { width: "64%" })
|
|
2161
2260
|
] }) }),
|
|
2162
|
-
/* @__PURE__ */ (0,
|
|
2163
|
-
/* @__PURE__ */ (0,
|
|
2164
|
-
/* @__PURE__ */ (0,
|
|
2165
|
-
/* @__PURE__ */ (0,
|
|
2261
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { "aria-hidden": "true", className: "fractal-ghost-conversation__message fractal-ghost-conversation__message--assistant", children: [
|
|
2262
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { width: "92%" }),
|
|
2263
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { width: "78%" }),
|
|
2264
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { width: "58%" })
|
|
2166
2265
|
] })
|
|
2167
2266
|
]
|
|
2168
2267
|
}
|
|
2169
2268
|
);
|
|
2170
2269
|
}
|
|
2171
2270
|
function SortableTableGhost(props) {
|
|
2172
|
-
return /* @__PURE__ */ (0,
|
|
2271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DataTableGhost, { ...props });
|
|
2173
2272
|
}
|
|
2174
2273
|
function SidebarGhost({ className, items = 6, ...props }) {
|
|
2175
|
-
return /* @__PURE__ */ (0,
|
|
2176
|
-
/* @__PURE__ */ (0,
|
|
2177
|
-
/* @__PURE__ */ (0,
|
|
2178
|
-
/* @__PURE__ */ (0,
|
|
2179
|
-
/* @__PURE__ */ (0,
|
|
2274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("aside", { "aria-hidden": "true", className: cn("fractal-ghost-sidebar", className), ...props, children: [
|
|
2275
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Ghost, { className: "fractal-ghost-sidebar__brand" }),
|
|
2276
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "fractal-ghost-sidebar__items", children: Array.from({ length: items }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "fractal-ghost-sidebar__item", children: [
|
|
2277
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Ghost, {}),
|
|
2278
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { width: `${[54, 68, 44, 61][index % 4]}%` })
|
|
2180
2279
|
] }, index)) })
|
|
2181
2280
|
] });
|
|
2182
2281
|
}
|
|
2183
2282
|
function ModalGhost({ className, title, lines = 3, ...props }) {
|
|
2184
|
-
return /* @__PURE__ */ (0,
|
|
2283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SurfaceGhost, { className: cn("fractal-ghost-modal", className), title, lines, ...props });
|
|
2185
2284
|
}
|
|
2186
2285
|
function SidePanelGhost({ className, title, lines = 5, ...props }) {
|
|
2187
|
-
return /* @__PURE__ */ (0,
|
|
2286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SurfaceGhost, { className: cn("fractal-ghost-side-panel", className), title, lines, ...props });
|
|
2188
2287
|
}
|
|
2189
2288
|
function SurfaceGhost({ className, title, lines = 3, ...props }) {
|
|
2190
|
-
return /* @__PURE__ */ (0,
|
|
2191
|
-
/* @__PURE__ */ (0,
|
|
2192
|
-
/* @__PURE__ */ (0,
|
|
2193
|
-
/* @__PURE__ */ (0,
|
|
2289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { "aria-hidden": "true", className: cn("fractal-ghost-surface", className), ...props, children: [
|
|
2290
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "fractal-ghost-surface__header", children: [
|
|
2291
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { width: "42%" }),
|
|
2292
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Ghost, { className: "fractal-ghost-surface__close" })
|
|
2194
2293
|
] }),
|
|
2195
|
-
title && /* @__PURE__ */ (0,
|
|
2196
|
-
/* @__PURE__ */ (0,
|
|
2294
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "fractal-ghost-surface__title", children: title }),
|
|
2295
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "fractal-ghost-stack", children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(GhostLine, { width: index === lines - 1 ? "64%" : "100%" }, index)) })
|
|
2197
2296
|
] });
|
|
2198
2297
|
}
|
|
2199
2298
|
|
|
2200
2299
|
// src/components/Sidebar/Sidebar.tsx
|
|
2201
2300
|
var React15 = __toESM(require("react"), 1);
|
|
2202
|
-
var
|
|
2301
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2203
2302
|
var Sidebar = React15.forwardRef(
|
|
2204
|
-
({ className, width, compact = false, style, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2303
|
+
({ className, width, compact = false, style, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2205
2304
|
"aside",
|
|
2206
2305
|
{
|
|
2207
2306
|
ref,
|
|
@@ -2214,11 +2313,11 @@ var Sidebar = React15.forwardRef(
|
|
|
2214
2313
|
);
|
|
2215
2314
|
Sidebar.displayName = "Sidebar";
|
|
2216
2315
|
var SidebarHeader = React15.forwardRef(
|
|
2217
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2316
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref, className: cn("fractal-sidebar__header", className), ...props })
|
|
2218
2317
|
);
|
|
2219
2318
|
SidebarHeader.displayName = "SidebarHeader";
|
|
2220
2319
|
var SidebarBrand = React15.forwardRef(
|
|
2221
|
-
({ className, type = "button", ...props }, ref) => /* @__PURE__ */ (0,
|
|
2320
|
+
({ className, type = "button", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("button", { ref, type, className: cn("fractal-sidebar__brand", className), ...props })
|
|
2222
2321
|
);
|
|
2223
2322
|
SidebarBrand.displayName = "SidebarBrand";
|
|
2224
2323
|
function SidebarAccountMenu({
|
|
@@ -2229,7 +2328,7 @@ function SidebarAccountMenu({
|
|
|
2229
2328
|
icon,
|
|
2230
2329
|
className
|
|
2231
2330
|
}) {
|
|
2232
|
-
return /* @__PURE__ */ (0,
|
|
2331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2233
2332
|
Dropdown,
|
|
2234
2333
|
{
|
|
2235
2334
|
align: "left",
|
|
@@ -2239,9 +2338,9 @@ function SidebarAccountMenu({
|
|
|
2239
2338
|
panelClassName: "fractal-sidebar__account-panel",
|
|
2240
2339
|
selectedValue: "",
|
|
2241
2340
|
triggerClassName: "fractal-sidebar__account-trigger",
|
|
2242
|
-
triggerContent: /* @__PURE__ */ (0,
|
|
2243
|
-
icon && /* @__PURE__ */ (0,
|
|
2244
|
-
/* @__PURE__ */ (0,
|
|
2341
|
+
triggerContent: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
2342
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "fractal-sidebar__account-icon", "aria-hidden": "true", children: icon }),
|
|
2343
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "fractal-sidebar__account-name", children: name })
|
|
2245
2344
|
] }),
|
|
2246
2345
|
triggerLabel,
|
|
2247
2346
|
triggerVariant: "tertiary"
|
|
@@ -2249,15 +2348,15 @@ function SidebarAccountMenu({
|
|
|
2249
2348
|
);
|
|
2250
2349
|
}
|
|
2251
2350
|
var SidebarNav = React15.forwardRef(
|
|
2252
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2351
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("nav", { ref, className: cn("fractal-sidebar__nav", className), ...props })
|
|
2253
2352
|
);
|
|
2254
2353
|
SidebarNav.displayName = "SidebarNav";
|
|
2255
2354
|
var SidebarSection = React15.forwardRef(
|
|
2256
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2355
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref, className: cn("fractal-sidebar__section", className), ...props })
|
|
2257
2356
|
);
|
|
2258
2357
|
SidebarSection.displayName = "SidebarSection";
|
|
2259
2358
|
var SidebarNavItem = React15.forwardRef(
|
|
2260
|
-
({ active = false, icon, endAdornment, className, type = "button", children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2359
|
+
({ active = false, icon, endAdornment, className, type = "button", children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
2261
2360
|
"button",
|
|
2262
2361
|
{
|
|
2263
2362
|
ref,
|
|
@@ -2267,28 +2366,28 @@ var SidebarNavItem = React15.forwardRef(
|
|
|
2267
2366
|
"aria-current": active ? "page" : void 0,
|
|
2268
2367
|
...props,
|
|
2269
2368
|
children: [
|
|
2270
|
-
icon && /* @__PURE__ */ (0,
|
|
2271
|
-
/* @__PURE__ */ (0,
|
|
2272
|
-
endAdornment && /* @__PURE__ */ (0,
|
|
2369
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "fractal-sidebar__nav-item-icon", "aria-hidden": "true", children: icon }),
|
|
2370
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "fractal-sidebar__nav-item-label", children }),
|
|
2371
|
+
endAdornment && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "fractal-sidebar__nav-item-end", children: endAdornment })
|
|
2273
2372
|
]
|
|
2274
2373
|
}
|
|
2275
2374
|
)
|
|
2276
2375
|
);
|
|
2277
2376
|
SidebarNavItem.displayName = "SidebarNavItem";
|
|
2278
2377
|
var SidebarFooter = React15.forwardRef(
|
|
2279
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2378
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref, className: cn("fractal-sidebar__footer", className), ...props })
|
|
2280
2379
|
);
|
|
2281
2380
|
SidebarFooter.displayName = "SidebarFooter";
|
|
2282
2381
|
|
|
2283
2382
|
// src/components/SidePanel/SidePanel.tsx
|
|
2284
2383
|
var import_react_dom2 = require("react-dom");
|
|
2285
2384
|
var import_fractal_icons12 = require("@mirror-physics/fractal-icons");
|
|
2286
|
-
var
|
|
2385
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2287
2386
|
function SidePanel({ open, onClose, title, description, children, footer, size = "md", loading = false, loadingLabel = "Loading", className }) {
|
|
2288
2387
|
useEscapeDismiss(80, onClose, open);
|
|
2289
2388
|
if (!open) return null;
|
|
2290
2389
|
return (0, import_react_dom2.createPortal)(
|
|
2291
|
-
/* @__PURE__ */ (0,
|
|
2390
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "fractal-side-panel-overlay", onMouseDown: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2292
2391
|
"aside",
|
|
2293
2392
|
{
|
|
2294
2393
|
className: cn("fractal-side-panel", `fractal-side-panel--${size}`, className),
|
|
@@ -2297,15 +2396,15 @@ function SidePanel({ open, onClose, title, description, children, footer, size =
|
|
|
2297
2396
|
role: "dialog",
|
|
2298
2397
|
onMouseDown: (event) => event.stopPropagation(),
|
|
2299
2398
|
children: [
|
|
2300
|
-
/* @__PURE__ */ (0,
|
|
2301
|
-
/* @__PURE__ */ (0,
|
|
2302
|
-
typeof title === "string" ? /* @__PURE__ */ (0,
|
|
2303
|
-
description && /* @__PURE__ */ (0,
|
|
2399
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("header", { className: "fractal-side-panel__header", children: [
|
|
2400
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "fractal-side-panel__heading", children: [
|
|
2401
|
+
typeof title === "string" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h2", { className: "fractal-side-panel__title", children: title }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "fractal-side-panel__title", children: title }),
|
|
2402
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "fractal-side-panel__description", children: description })
|
|
2304
2403
|
] }),
|
|
2305
|
-
/* @__PURE__ */ (0,
|
|
2404
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { type: "button", className: "fractal-side-panel__close", "aria-label": "Close panel", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_fractal_icons12.Close, { size: 18 }) })
|
|
2306
2405
|
] }),
|
|
2307
|
-
/* @__PURE__ */ (0,
|
|
2308
|
-
footer && /* @__PURE__ */ (0,
|
|
2406
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { "aria-busy": loading || void 0, className: cn("fractal-side-panel__body", loading && "fractal-side-panel__body--loading"), children: loading ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(UILoader, { label: loadingLabel }) : children }),
|
|
2407
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("footer", { className: "fractal-side-panel__footer", children: footer })
|
|
2309
2408
|
]
|
|
2310
2409
|
}
|
|
2311
2410
|
) }),
|
|
@@ -2315,17 +2414,17 @@ function SidePanel({ open, onClose, title, description, children, footer, size =
|
|
|
2315
2414
|
|
|
2316
2415
|
// src/components/Textarea/Textarea.tsx
|
|
2317
2416
|
var React16 = __toESM(require("react"), 1);
|
|
2318
|
-
var
|
|
2417
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2319
2418
|
var Textarea = React16.forwardRef(
|
|
2320
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2419
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("textarea", { ref, className: cn("fractal-textarea", className), ...props })
|
|
2321
2420
|
);
|
|
2322
2421
|
Textarea.displayName = "Textarea";
|
|
2323
2422
|
|
|
2324
2423
|
// src/components/TextButton/TextButton.tsx
|
|
2325
2424
|
var React17 = __toESM(require("react"), 1);
|
|
2326
|
-
var
|
|
2425
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2327
2426
|
var TextButton = React17.forwardRef(
|
|
2328
|
-
({ className, icon, iconPosition = "start", size = "md", tone = "primary", children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2427
|
+
({ className, icon, iconPosition = "start", size = "md", tone = "primary", children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
2329
2428
|
"button",
|
|
2330
2429
|
{
|
|
2331
2430
|
ref,
|
|
@@ -2333,9 +2432,9 @@ var TextButton = React17.forwardRef(
|
|
|
2333
2432
|
type: "button",
|
|
2334
2433
|
...props,
|
|
2335
2434
|
children: [
|
|
2336
|
-
icon && iconPosition === "start" && /* @__PURE__ */ (0,
|
|
2337
|
-
/* @__PURE__ */ (0,
|
|
2338
|
-
icon && iconPosition === "end" && /* @__PURE__ */ (0,
|
|
2435
|
+
icon && iconPosition === "start" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "fractal-text-button__icon", "aria-hidden": "true", children: icon }),
|
|
2436
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children }),
|
|
2437
|
+
icon && iconPosition === "end" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "fractal-text-button__icon", "aria-hidden": "true", children: icon })
|
|
2339
2438
|
]
|
|
2340
2439
|
}
|
|
2341
2440
|
)
|
|
@@ -2345,7 +2444,7 @@ TextButton.displayName = "TextButton";
|
|
|
2345
2444
|
// src/components/FileDropzone/FileDropzone.tsx
|
|
2346
2445
|
var React18 = __toESM(require("react"), 1);
|
|
2347
2446
|
var import_fractal_icons13 = require("@mirror-physics/fractal-icons");
|
|
2348
|
-
var
|
|
2447
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2349
2448
|
function FileDropzone({
|
|
2350
2449
|
files,
|
|
2351
2450
|
onFilesChange,
|
|
@@ -2365,8 +2464,8 @@ function FileDropzone({
|
|
|
2365
2464
|
if (additions.length === 0) return;
|
|
2366
2465
|
onFilesChange(multiple ? [...files, ...additions] : additions.slice(0, 1));
|
|
2367
2466
|
};
|
|
2368
|
-
return /* @__PURE__ */ (0,
|
|
2369
|
-
/* @__PURE__ */ (0,
|
|
2467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: cn("fractal-file-dropzone", className), children: [
|
|
2468
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2370
2469
|
"input",
|
|
2371
2470
|
{
|
|
2372
2471
|
ref: inputRef,
|
|
@@ -2382,7 +2481,7 @@ function FileDropzone({
|
|
|
2382
2481
|
}
|
|
2383
2482
|
}
|
|
2384
2483
|
),
|
|
2385
|
-
/* @__PURE__ */ (0,
|
|
2484
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2386
2485
|
"button",
|
|
2387
2486
|
{
|
|
2388
2487
|
className: "fractal-file-dropzone__target",
|
|
@@ -2405,18 +2504,18 @@ function FileDropzone({
|
|
|
2405
2504
|
addFiles(event.dataTransfer.files);
|
|
2406
2505
|
},
|
|
2407
2506
|
children: [
|
|
2408
|
-
/* @__PURE__ */ (0,
|
|
2409
|
-
/* @__PURE__ */ (0,
|
|
2410
|
-
/* @__PURE__ */ (0,
|
|
2411
|
-
description && /* @__PURE__ */ (0,
|
|
2507
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_fractal_icons13.FileArrowUp, { "aria-hidden": "true", size: 20 }),
|
|
2508
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "fractal-file-dropzone__copy", children: [
|
|
2509
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "fractal-file-dropzone__title", children: title }),
|
|
2510
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "fractal-file-dropzone__description", children: description })
|
|
2412
2511
|
] })
|
|
2413
2512
|
]
|
|
2414
2513
|
}
|
|
2415
2514
|
),
|
|
2416
|
-
files.length > 0 && /* @__PURE__ */ (0,
|
|
2417
|
-
/* @__PURE__ */ (0,
|
|
2418
|
-
/* @__PURE__ */ (0,
|
|
2419
|
-
/* @__PURE__ */ (0,
|
|
2515
|
+
files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("ul", { className: "fractal-file-dropzone__files", "aria-label": "Attached files", children: files.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("li", { className: "fractal-file-dropzone__file", children: [
|
|
2516
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "fractal-file-dropzone__file-name", children: file.name }),
|
|
2517
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "fractal-file-dropzone__file-meta", children: formatFileSize(file.size) }),
|
|
2518
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2420
2519
|
"button",
|
|
2421
2520
|
{
|
|
2422
2521
|
className: "fractal-file-dropzone__remove",
|
|
@@ -2424,7 +2523,7 @@ function FileDropzone({
|
|
|
2424
2523
|
"aria-label": `Remove ${file.name}`,
|
|
2425
2524
|
disabled,
|
|
2426
2525
|
onClick: () => onFilesChange(files.filter((_, fileIndex) => fileIndex !== index)),
|
|
2427
|
-
children: /* @__PURE__ */ (0,
|
|
2526
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_fractal_icons13.Close, { "aria-hidden": "true", size: 14 })
|
|
2428
2527
|
}
|
|
2429
2528
|
)
|
|
2430
2529
|
] }, `${file.name}-${file.size}-${index}`)) })
|
|
@@ -2438,7 +2537,7 @@ function formatFileSize(bytes) {
|
|
|
2438
2537
|
|
|
2439
2538
|
// src/components/Pagination/Pagination.tsx
|
|
2440
2539
|
var import_fractal_icons14 = require("@mirror-physics/fractal-icons");
|
|
2441
|
-
var
|
|
2540
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2442
2541
|
function Pagination({
|
|
2443
2542
|
page,
|
|
2444
2543
|
pageSize,
|
|
@@ -2454,10 +2553,10 @@ function Pagination({
|
|
|
2454
2553
|
const start = totalItems === 0 ? 0 : (currentPage - 1) * pageSize + 1;
|
|
2455
2554
|
const end = Math.min(currentPage * pageSize, totalItems);
|
|
2456
2555
|
const canChangePageSize = pageSizeOptions != null && pageSizeOptions.length > 0 && onPageSizeChange != null;
|
|
2457
|
-
return /* @__PURE__ */ (0,
|
|
2458
|
-
/* @__PURE__ */ (0,
|
|
2459
|
-
/* @__PURE__ */ (0,
|
|
2460
|
-
canChangePageSize && /* @__PURE__ */ (0,
|
|
2556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("nav", { className: cn("fractal-pagination", className), "aria-label": ariaLabel, children: [
|
|
2557
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "fractal-pagination__summary", children: totalItems === 0 ? "No results" : `${start}-${end} of ${totalItems}` }),
|
|
2558
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "fractal-pagination__controls", children: [
|
|
2559
|
+
canChangePageSize && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2461
2560
|
Dropdown,
|
|
2462
2561
|
{
|
|
2463
2562
|
align: "right",
|
|
@@ -2474,7 +2573,7 @@ function Pagination({
|
|
|
2474
2573
|
triggerVariant: "tertiary"
|
|
2475
2574
|
}
|
|
2476
2575
|
),
|
|
2477
|
-
/* @__PURE__ */ (0,
|
|
2576
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2478
2577
|
"button",
|
|
2479
2578
|
{
|
|
2480
2579
|
className: "fractal-pagination__button",
|
|
@@ -2483,15 +2582,15 @@ function Pagination({
|
|
|
2483
2582
|
title: "Previous page",
|
|
2484
2583
|
disabled: currentPage === 1 || totalItems === 0,
|
|
2485
2584
|
onClick: () => onPageChange(currentPage - 1),
|
|
2486
|
-
children: /* @__PURE__ */ (0,
|
|
2585
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_fractal_icons14.ArrowLeft, { "aria-hidden": "true", size: 16 })
|
|
2487
2586
|
}
|
|
2488
2587
|
),
|
|
2489
|
-
/* @__PURE__ */ (0,
|
|
2588
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("span", { className: "fractal-pagination__page", "aria-current": "page", children: [
|
|
2490
2589
|
currentPage,
|
|
2491
2590
|
" of ",
|
|
2492
2591
|
totalPages
|
|
2493
2592
|
] }),
|
|
2494
|
-
/* @__PURE__ */ (0,
|
|
2593
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2495
2594
|
"button",
|
|
2496
2595
|
{
|
|
2497
2596
|
className: "fractal-pagination__button",
|
|
@@ -2500,7 +2599,7 @@ function Pagination({
|
|
|
2500
2599
|
title: "Next page",
|
|
2501
2600
|
disabled: currentPage === totalPages || totalItems === 0,
|
|
2502
2601
|
onClick: () => onPageChange(currentPage + 1),
|
|
2503
|
-
children: /* @__PURE__ */ (0,
|
|
2602
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_fractal_icons14.ArrowRight, { "aria-hidden": "true", size: 16 })
|
|
2504
2603
|
}
|
|
2505
2604
|
)
|
|
2506
2605
|
] })
|
|
@@ -2569,6 +2668,7 @@ function Pagination({
|
|
|
2569
2668
|
SidebarNav,
|
|
2570
2669
|
SidebarNavItem,
|
|
2571
2670
|
SidebarSection,
|
|
2671
|
+
Slider,
|
|
2572
2672
|
SortableTable,
|
|
2573
2673
|
SortableTableGhost,
|
|
2574
2674
|
TableSearch,
|