@mirror-physics/fractal-ui 0.2.0-next.86 → 0.2.0-next.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.cjs +338 -324
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +51 -6
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +263 -249
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -765,13 +765,21 @@ PromptGrid.displayName = "PromptGrid";
|
|
|
765
765
|
|
|
766
766
|
// src/components/Input/Input.tsx
|
|
767
767
|
var React4 = __toESM(require("react"), 1);
|
|
768
|
+
|
|
769
|
+
// src/utils/FloatingFieldBorder.tsx
|
|
768
770
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
771
|
+
function FloatingFieldBorder({ label }) {
|
|
772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("fieldset", { className: "fractal-floating-field__border", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("legend", { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: label }) }) });
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
// src/components/Input/Input.tsx
|
|
776
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
769
777
|
var Input = React4.forwardRef(
|
|
770
778
|
({ className, type, controlSize = "lg", fieldLabel, id, placeholder, ...props }, ref) => {
|
|
771
779
|
const generatedId = React4.useId();
|
|
772
780
|
const fieldId = id ?? generatedId;
|
|
773
781
|
const floatingLabel = type === "search" ? void 0 : fieldLabel;
|
|
774
|
-
const input = /* @__PURE__ */ (0,
|
|
782
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
775
783
|
"input",
|
|
776
784
|
{
|
|
777
785
|
type,
|
|
@@ -785,7 +793,7 @@ var Input = React4.forwardRef(
|
|
|
785
793
|
}
|
|
786
794
|
);
|
|
787
795
|
if (!floatingLabel) return input;
|
|
788
|
-
return /* @__PURE__ */ (0,
|
|
796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
789
797
|
"div",
|
|
790
798
|
{
|
|
791
799
|
className: "fractal-floating-field",
|
|
@@ -793,7 +801,8 @@ var Input = React4.forwardRef(
|
|
|
793
801
|
"data-always-float": ["date", "datetime-local", "time", "month", "week", "color", "file", "range"].includes(type ?? "") || void 0,
|
|
794
802
|
children: [
|
|
795
803
|
input,
|
|
796
|
-
/* @__PURE__ */ (0,
|
|
804
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(FloatingFieldBorder, { label: fieldLabel ?? "" }),
|
|
805
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { className: "fractal-floating-field__label", htmlFor: fieldId, children: fieldLabel })
|
|
797
806
|
]
|
|
798
807
|
}
|
|
799
808
|
);
|
|
@@ -804,7 +813,7 @@ Input.displayName = "Input";
|
|
|
804
813
|
// src/components/TableSearch/TableSearch.tsx
|
|
805
814
|
var React5 = __toESM(require("react"), 1);
|
|
806
815
|
var import_fractal_icons4 = require("@mirror-physics/fractal-icons");
|
|
807
|
-
var
|
|
816
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
808
817
|
var TableSearch = React5.forwardRef(
|
|
809
818
|
({
|
|
810
819
|
searchType = "text",
|
|
@@ -817,15 +826,15 @@ var TableSearch = React5.forwardRef(
|
|
|
817
826
|
}, ref) => {
|
|
818
827
|
const isGlob = searchType === "glob";
|
|
819
828
|
const SearchIcon = isGlob ? import_fractal_icons4.MagnifyingGlassLines : import_fractal_icons4.MagnifyingGlass;
|
|
820
|
-
return /* @__PURE__ */ (0,
|
|
829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
821
830
|
"div",
|
|
822
831
|
{
|
|
823
832
|
className: cn("fractal-table-search", className),
|
|
824
833
|
"data-search-type": searchType,
|
|
825
834
|
"data-control-size": controlSize,
|
|
826
835
|
children: [
|
|
827
|
-
/* @__PURE__ */ (0,
|
|
828
|
-
/* @__PURE__ */ (0,
|
|
836
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SearchIcon, { className: "fractal-table-search__icon", size: 17, "aria-hidden": "true" }),
|
|
837
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
829
838
|
Input,
|
|
830
839
|
{
|
|
831
840
|
...props,
|
|
@@ -847,7 +856,7 @@ TableSearch.displayName = "TableSearch";
|
|
|
847
856
|
// src/components/NumberInput/NumberInput.tsx
|
|
848
857
|
var React6 = __toESM(require("react"), 1);
|
|
849
858
|
var import_fractal_icons5 = require("@mirror-physics/fractal-icons");
|
|
850
|
-
var
|
|
859
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
851
860
|
function NumberInput({
|
|
852
861
|
unit,
|
|
853
862
|
controlSize = "lg",
|
|
@@ -874,8 +883,8 @@ function NumberInput({
|
|
|
874
883
|
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
875
884
|
input.focus();
|
|
876
885
|
};
|
|
877
|
-
return /* @__PURE__ */ (0,
|
|
878
|
-
/* @__PURE__ */ (0,
|
|
886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { "data-control-size": controlSize, className: cn("fractal-number-input", unit && "fractal-number-input--with-unit", className), children: [
|
|
887
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
879
888
|
Input,
|
|
880
889
|
{
|
|
881
890
|
ref: inputRef,
|
|
@@ -890,7 +899,7 @@ function NumberInput({
|
|
|
890
899
|
...props
|
|
891
900
|
}
|
|
892
901
|
),
|
|
893
|
-
unit && /* @__PURE__ */ (0,
|
|
902
|
+
unit && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
894
903
|
"span",
|
|
895
904
|
{
|
|
896
905
|
className: "fractal-number-input-unit",
|
|
@@ -899,8 +908,8 @@ function NumberInput({
|
|
|
899
908
|
children: unit
|
|
900
909
|
}
|
|
901
910
|
),
|
|
902
|
-
/* @__PURE__ */ (0,
|
|
903
|
-
/* @__PURE__ */ (0,
|
|
911
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "fractal-number-input-controls", children: [
|
|
912
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
904
913
|
"button",
|
|
905
914
|
{
|
|
906
915
|
type: "button",
|
|
@@ -908,10 +917,10 @@ function NumberInput({
|
|
|
908
917
|
"aria-label": `Decrease ${controlLabel}`,
|
|
909
918
|
disabled: decrementDisabled,
|
|
910
919
|
onClick: () => changeByStep(-1),
|
|
911
|
-
children: /* @__PURE__ */ (0,
|
|
920
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_fractal_icons5.Minus, { "aria-hidden": "true", size: 16 })
|
|
912
921
|
}
|
|
913
922
|
),
|
|
914
|
-
/* @__PURE__ */ (0,
|
|
923
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
915
924
|
"button",
|
|
916
925
|
{
|
|
917
926
|
type: "button",
|
|
@@ -919,7 +928,7 @@ function NumberInput({
|
|
|
919
928
|
"aria-label": `Increase ${controlLabel}`,
|
|
920
929
|
disabled: incrementDisabled,
|
|
921
930
|
onClick: () => changeByStep(1),
|
|
922
|
-
children: /* @__PURE__ */ (0,
|
|
931
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_fractal_icons5.Plus, { "aria-hidden": "true", size: 16 })
|
|
923
932
|
}
|
|
924
933
|
)
|
|
925
934
|
] })
|
|
@@ -927,7 +936,7 @@ function NumberInput({
|
|
|
927
936
|
}
|
|
928
937
|
|
|
929
938
|
// src/components/Slider/Slider.tsx
|
|
930
|
-
var
|
|
939
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
931
940
|
function Slider(props) {
|
|
932
941
|
const {
|
|
933
942
|
min = 0,
|
|
@@ -973,18 +982,18 @@ function Slider(props) {
|
|
|
973
982
|
if (!(event.key in adjustments)) return null;
|
|
974
983
|
return value + adjustments[event.key];
|
|
975
984
|
};
|
|
976
|
-
return /* @__PURE__ */ (0,
|
|
985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
977
986
|
"div",
|
|
978
987
|
{
|
|
979
988
|
className: cn("fractal-slider", disabled && "fractal-slider--disabled", className),
|
|
980
989
|
"data-disabled": disabled || void 0,
|
|
981
990
|
"data-knobs": knobs,
|
|
982
991
|
children: [
|
|
983
|
-
showValues && /* @__PURE__ */ (0,
|
|
984
|
-
/* @__PURE__ */ (0,
|
|
985
|
-
knobs === 2 && /* @__PURE__ */ (0,
|
|
992
|
+
showValues && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "fractal-slider-values", "aria-hidden": "true", children: [
|
|
993
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("output", { children: formatValue(firstValue) }),
|
|
994
|
+
knobs === 2 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("output", { children: formatValue(secondValue) })
|
|
986
995
|
] }),
|
|
987
|
-
/* @__PURE__ */ (0,
|
|
996
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
988
997
|
"div",
|
|
989
998
|
{
|
|
990
999
|
className: "fractal-slider-control",
|
|
@@ -993,9 +1002,9 @@ function Slider(props) {
|
|
|
993
1002
|
"--fractal-slider-selection-end": `${selectionEndPercent}%`
|
|
994
1003
|
},
|
|
995
1004
|
children: [
|
|
996
|
-
/* @__PURE__ */ (0,
|
|
997
|
-
/* @__PURE__ */ (0,
|
|
998
|
-
/* @__PURE__ */ (0,
|
|
1005
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "fractal-slider-track", "aria-hidden": "true" }),
|
|
1006
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "fractal-slider-selection", "aria-hidden": "true" }),
|
|
1007
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
999
1008
|
"input",
|
|
1000
1009
|
{
|
|
1001
1010
|
"aria-label": knobs === 2 ? props.lowerAriaLabel ?? "Lower value" : props.ariaLabel ?? "Slider value",
|
|
@@ -1019,7 +1028,7 @@ function Slider(props) {
|
|
|
1019
1028
|
value: firstValue
|
|
1020
1029
|
}
|
|
1021
1030
|
),
|
|
1022
|
-
knobs === 2 && /* @__PURE__ */ (0,
|
|
1031
|
+
knobs === 2 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1023
1032
|
"input",
|
|
1024
1033
|
{
|
|
1025
1034
|
"aria-label": props.upperAriaLabel ?? "Upper value",
|
|
@@ -1055,7 +1064,7 @@ function clamp(value, minimum, maximum) {
|
|
|
1055
1064
|
// src/components/PasswordInput/PasswordInput.tsx
|
|
1056
1065
|
var React7 = __toESM(require("react"), 1);
|
|
1057
1066
|
var import_fractal_icons6 = require("@mirror-physics/fractal-icons");
|
|
1058
|
-
var
|
|
1067
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1059
1068
|
var PasswordInput = React7.forwardRef(
|
|
1060
1069
|
({
|
|
1061
1070
|
className,
|
|
@@ -1067,14 +1076,14 @@ var PasswordInput = React7.forwardRef(
|
|
|
1067
1076
|
}, ref) => {
|
|
1068
1077
|
const [passwordVisible, setPasswordVisible] = React7.useState(false);
|
|
1069
1078
|
const toggleLabel = passwordVisible ? hidePasswordLabel : showPasswordLabel;
|
|
1070
|
-
return /* @__PURE__ */ (0,
|
|
1079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1071
1080
|
"div",
|
|
1072
1081
|
{
|
|
1073
1082
|
className: cn("fractal-password-input", className),
|
|
1074
1083
|
"data-control-size": controlSize,
|
|
1075
1084
|
"data-password-visible": passwordVisible ? "" : void 0,
|
|
1076
1085
|
children: [
|
|
1077
|
-
/* @__PURE__ */ (0,
|
|
1086
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1078
1087
|
Input,
|
|
1079
1088
|
{
|
|
1080
1089
|
...props,
|
|
@@ -1085,7 +1094,7 @@ var PasswordInput = React7.forwardRef(
|
|
|
1085
1094
|
type: passwordVisible ? "text" : "password"
|
|
1086
1095
|
}
|
|
1087
1096
|
),
|
|
1088
|
-
/* @__PURE__ */ (0,
|
|
1097
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1089
1098
|
"button",
|
|
1090
1099
|
{
|
|
1091
1100
|
type: "button",
|
|
@@ -1095,7 +1104,7 @@ var PasswordInput = React7.forwardRef(
|
|
|
1095
1104
|
disabled,
|
|
1096
1105
|
title: toggleLabel,
|
|
1097
1106
|
onClick: () => setPasswordVisible((visible) => !visible),
|
|
1098
|
-
children: passwordVisible ? /* @__PURE__ */ (0,
|
|
1107
|
+
children: passwordVisible ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_fractal_icons6.EyeSlash, { "aria-hidden": "true", size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_fractal_icons6.Eye, { "aria-hidden": "true", size: 18 })
|
|
1099
1108
|
}
|
|
1100
1109
|
)
|
|
1101
1110
|
]
|
|
@@ -1107,9 +1116,9 @@ PasswordInput.displayName = "PasswordInput";
|
|
|
1107
1116
|
|
|
1108
1117
|
// src/components/Label/Label.tsx
|
|
1109
1118
|
var React8 = __toESM(require("react"), 1);
|
|
1110
|
-
var
|
|
1119
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1111
1120
|
var Label = React8.forwardRef(
|
|
1112
|
-
({ className, controlSize = "lg", ...props }, ref) => /* @__PURE__ */ (0,
|
|
1121
|
+
({ className, controlSize = "lg", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1113
1122
|
"label",
|
|
1114
1123
|
{
|
|
1115
1124
|
ref,
|
|
@@ -1124,7 +1133,7 @@ Label.displayName = "Label";
|
|
|
1124
1133
|
// src/components/Alert/Alert.tsx
|
|
1125
1134
|
var React9 = __toESM(require("react"), 1);
|
|
1126
1135
|
var import_fractal_icons7 = require("@mirror-physics/fractal-icons");
|
|
1127
|
-
var
|
|
1136
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1128
1137
|
var defaultIcons = {
|
|
1129
1138
|
default: import_fractal_icons7.CircleInfo,
|
|
1130
1139
|
info: import_fractal_icons7.CircleInfo,
|
|
@@ -1135,7 +1144,7 @@ var defaultIcons = {
|
|
|
1135
1144
|
var Alert = React9.forwardRef(
|
|
1136
1145
|
({ className, variant = "default", icon, children, ...props }, ref) => {
|
|
1137
1146
|
const DefaultIcon = defaultIcons[variant];
|
|
1138
|
-
return /* @__PURE__ */ (0,
|
|
1147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1139
1148
|
"div",
|
|
1140
1149
|
{
|
|
1141
1150
|
ref,
|
|
@@ -1143,8 +1152,8 @@ var Alert = React9.forwardRef(
|
|
|
1143
1152
|
className: cn("fractal-alert", `fractal-alert--${variant}`, className),
|
|
1144
1153
|
...props,
|
|
1145
1154
|
children: [
|
|
1146
|
-
/* @__PURE__ */ (0,
|
|
1147
|
-
/* @__PURE__ */ (0,
|
|
1155
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "fractal-alert-icon", "aria-hidden": true, children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DefaultIcon, { size: 18 }) }),
|
|
1156
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "fractal-alert-content", children })
|
|
1148
1157
|
]
|
|
1149
1158
|
}
|
|
1150
1159
|
);
|
|
@@ -1152,11 +1161,11 @@ var Alert = React9.forwardRef(
|
|
|
1152
1161
|
);
|
|
1153
1162
|
Alert.displayName = "Alert";
|
|
1154
1163
|
var AlertTitle = React9.forwardRef(
|
|
1155
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1164
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h5", { ref, className: cn("fractal-alert-title", className), ...props })
|
|
1156
1165
|
);
|
|
1157
1166
|
AlertTitle.displayName = "AlertTitle";
|
|
1158
1167
|
var AlertDescription = React9.forwardRef(
|
|
1159
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1168
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { ref, className: cn("fractal-alert-description", className), ...props })
|
|
1160
1169
|
);
|
|
1161
1170
|
AlertDescription.displayName = "AlertDescription";
|
|
1162
1171
|
|
|
@@ -1164,7 +1173,7 @@ AlertDescription.displayName = "AlertDescription";
|
|
|
1164
1173
|
var React10 = __toESM(require("react"), 1);
|
|
1165
1174
|
var import_react_dom = require("react-dom");
|
|
1166
1175
|
var import_fractal_icons8 = require("@mirror-physics/fractal-icons");
|
|
1167
|
-
var
|
|
1176
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1168
1177
|
var defaultIcons2 = {
|
|
1169
1178
|
default: import_fractal_icons8.CircleInfo,
|
|
1170
1179
|
info: import_fractal_icons8.CircleInfo,
|
|
@@ -1201,7 +1210,7 @@ var Toast = React10.forwardRef(function Toast2({
|
|
|
1201
1210
|
return () => window.clearTimeout(timeout);
|
|
1202
1211
|
}, [paused, resolvedDuration]);
|
|
1203
1212
|
const announcementRole = role ?? (variant === "error" ? "alert" : "status");
|
|
1204
|
-
return /* @__PURE__ */ (0,
|
|
1213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1205
1214
|
"div",
|
|
1206
1215
|
{
|
|
1207
1216
|
ref,
|
|
@@ -1227,17 +1236,17 @@ var Toast = React10.forwardRef(function Toast2({
|
|
|
1227
1236
|
},
|
|
1228
1237
|
...props,
|
|
1229
1238
|
children: [
|
|
1230
|
-
/* @__PURE__ */ (0,
|
|
1231
|
-
/* @__PURE__ */ (0,
|
|
1232
|
-
action && /* @__PURE__ */ (0,
|
|
1233
|
-
/* @__PURE__ */ (0,
|
|
1239
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { "aria-hidden": "true", className: "fractal-toast__icon", children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DefaultIcon, { size: 18 }) }),
|
|
1240
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "fractal-toast__content", children }),
|
|
1241
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "fractal-toast__action", children: action }),
|
|
1242
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1234
1243
|
"button",
|
|
1235
1244
|
{
|
|
1236
1245
|
"aria-label": dismissLabel,
|
|
1237
1246
|
className: "fractal-toast__dismiss",
|
|
1238
1247
|
onClick: onDismiss,
|
|
1239
1248
|
type: "button",
|
|
1240
|
-
children: /* @__PURE__ */ (0,
|
|
1249
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_fractal_icons8.Close, { "aria-hidden": "true", size: 14 })
|
|
1241
1250
|
}
|
|
1242
1251
|
)
|
|
1243
1252
|
]
|
|
@@ -1245,7 +1254,7 @@ var Toast = React10.forwardRef(function Toast2({
|
|
|
1245
1254
|
);
|
|
1246
1255
|
});
|
|
1247
1256
|
var ToastViewport = React10.forwardRef(function ToastViewport2({ children, className, portal = true, position = "top-center", ...props }, ref) {
|
|
1248
|
-
const viewport = /* @__PURE__ */ (0,
|
|
1257
|
+
const viewport = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1249
1258
|
"div",
|
|
1250
1259
|
{
|
|
1251
1260
|
ref,
|
|
@@ -1260,9 +1269,9 @@ var ToastViewport = React10.forwardRef(function ToastViewport2({ children, class
|
|
|
1260
1269
|
});
|
|
1261
1270
|
|
|
1262
1271
|
// src/components/Toggle/Toggle.tsx
|
|
1263
|
-
var
|
|
1272
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1264
1273
|
function Toggle({ checked, onChange, label, className }) {
|
|
1265
|
-
return /* @__PURE__ */ (0,
|
|
1274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1266
1275
|
"button",
|
|
1267
1276
|
{
|
|
1268
1277
|
type: "button",
|
|
@@ -1271,8 +1280,8 @@ function Toggle({ checked, onChange, label, className }) {
|
|
|
1271
1280
|
className: cn("fractal-toggle", className),
|
|
1272
1281
|
onClick: () => onChange(!checked),
|
|
1273
1282
|
children: [
|
|
1274
|
-
/* @__PURE__ */ (0,
|
|
1275
|
-
label && /* @__PURE__ */ (0,
|
|
1283
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: cn("fractal-toggle-track", checked && "fractal-toggle-track--checked"), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: cn("fractal-toggle-thumb", checked && "fractal-toggle-thumb--checked") }) }),
|
|
1284
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "fractal-toggle-label", children: label })
|
|
1276
1285
|
]
|
|
1277
1286
|
}
|
|
1278
1287
|
);
|
|
@@ -1334,7 +1343,7 @@ function useEscapeDismiss(priority, handler, enabled = true) {
|
|
|
1334
1343
|
|
|
1335
1344
|
// src/components/UILoader/UILoader.tsx
|
|
1336
1345
|
var import_react3 = require("react");
|
|
1337
|
-
var
|
|
1346
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1338
1347
|
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";
|
|
1339
1348
|
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";
|
|
1340
1349
|
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";
|
|
@@ -1343,7 +1352,7 @@ function UILoader({ size = 48, tone = "neutral", className, style, label = "Load
|
|
|
1343
1352
|
const clipId = `fractal-ui-loader-clip-${rawId}`;
|
|
1344
1353
|
const gradientId = `fractal-ui-loader-gradient-${rawId}`;
|
|
1345
1354
|
const height = typeof size === "number" ? `${size}px` : size;
|
|
1346
|
-
return /* @__PURE__ */ (0,
|
|
1355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1347
1356
|
"span",
|
|
1348
1357
|
{
|
|
1349
1358
|
"aria-hidden": ariaHidden || void 0,
|
|
@@ -1351,35 +1360,35 @@ function UILoader({ size = 48, tone = "neutral", className, style, label = "Load
|
|
|
1351
1360
|
className: cn("fractal-ui-loader", `fractal-ui-loader--${tone}`, className),
|
|
1352
1361
|
role: ariaHidden ? void 0 : "status",
|
|
1353
1362
|
style,
|
|
1354
|
-
children: /* @__PURE__ */ (0,
|
|
1355
|
-
/* @__PURE__ */ (0,
|
|
1356
|
-
/* @__PURE__ */ (0,
|
|
1357
|
-
/* @__PURE__ */ (0,
|
|
1358
|
-
/* @__PURE__ */ (0,
|
|
1363
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("svg", { "aria-hidden": "true", fill: "none", viewBox: "0 0 144 92", style: { height, width: "auto" }, children: [
|
|
1364
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("defs", { children: [
|
|
1365
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("linearGradient", { id: gradientId, x1: "59", x2: "94.3", y1: "0", y2: "89.1", gradientUnits: "userSpaceOnUse", children: [
|
|
1366
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("stop", { className: "fractal-ui-loader__stop-start", offset: "0" }),
|
|
1367
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("stop", { className: "fractal-ui-loader__stop-end", offset: "1" })
|
|
1359
1368
|
] }),
|
|
1360
|
-
/* @__PURE__ */ (0,
|
|
1361
|
-
/* @__PURE__ */ (0,
|
|
1362
|
-
/* @__PURE__ */ (0,
|
|
1363
|
-
/* @__PURE__ */ (0,
|
|
1369
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("linearGradient", { id: `${gradientId}-shine`, x1: "0", x2: "1", y1: "0", y2: "0", children: [
|
|
1370
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("stop", { offset: "0.4", stopColor: "white", stopOpacity: "0" }),
|
|
1371
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("stop", { offset: "0.5", stopColor: "white", stopOpacity: "0.62" }),
|
|
1372
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("stop", { offset: "0.6", stopColor: "white", stopOpacity: "0" })
|
|
1364
1373
|
] }),
|
|
1365
|
-
/* @__PURE__ */ (0,
|
|
1366
|
-
/* @__PURE__ */ (0,
|
|
1367
|
-
/* @__PURE__ */ (0,
|
|
1368
|
-
/* @__PURE__ */ (0,
|
|
1374
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("clipPath", { id: clipId, children: [
|
|
1375
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: LEFT }),
|
|
1376
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: CENTER }),
|
|
1377
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: RIGHT })
|
|
1369
1378
|
] })
|
|
1370
1379
|
] }),
|
|
1371
|
-
/* @__PURE__ */ (0,
|
|
1372
|
-
/* @__PURE__ */ (0,
|
|
1373
|
-
/* @__PURE__ */ (0,
|
|
1374
|
-
/* @__PURE__ */ (0,
|
|
1380
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: CENTER, fill: `url(#${gradientId})` }),
|
|
1381
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: RIGHT, fill: `url(#${gradientId})` }),
|
|
1382
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: LEFT, fill: `url(#${gradientId})` }),
|
|
1383
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("g", { clipPath: `url(#${clipId})`, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("g", { className: "fractal-ui-loader__shine-axis", transform: "translate(72 46) rotate(68.4)", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("rect", { className: "fractal-ui-loader__shine", x: "-160", y: "-100", width: "320", height: "200", fill: `url(#${gradientId}-shine)` }) }) })
|
|
1375
1384
|
] })
|
|
1376
1385
|
}
|
|
1377
1386
|
);
|
|
1378
1387
|
}
|
|
1379
1388
|
|
|
1380
1389
|
// src/components/Modal/Modal.tsx
|
|
1381
|
-
var
|
|
1382
|
-
var CloseIcon = () => /* @__PURE__ */ (0,
|
|
1390
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1391
|
+
var CloseIcon = () => /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.jsx)("path", { d: "M12 4L4 12M4 4L12 12", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1383
1392
|
function Modal({ open, onClose, title, children, danger, warn, footer, noClose, closeDisabled = false, size = "sm", loading = false, loadingLabel = "Loading", scrollable = false, className }) {
|
|
1384
1393
|
const [bodyScrolled, setBodyScrolled] = React11.useState(false);
|
|
1385
1394
|
useEscapeDismiss(80, onClose, open && !noClose && !closeDisabled);
|
|
@@ -1390,13 +1399,13 @@ function Modal({ open, onClose, title, children, danger, warn, footer, noClose,
|
|
|
1390
1399
|
const sizeClass = `fractal-modal-panel--${size}`;
|
|
1391
1400
|
const accentClass = danger ? "fractal-modal-panel--danger" : warn ? "fractal-modal-panel--warn" : "";
|
|
1392
1401
|
return (0, import_react_dom2.createPortal)(
|
|
1393
|
-
/* @__PURE__ */ (0,
|
|
1402
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "fractal-modal-overlay", onClick: noClose || closeDisabled ? void 0 : onClose, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1394
1403
|
"div",
|
|
1395
1404
|
{
|
|
1396
1405
|
className: cn("fractal-modal-panel", sizeClass, accentClass, scrollable && "fractal-modal-panel--scrollable", className),
|
|
1397
1406
|
onClick: (e) => e.stopPropagation(),
|
|
1398
1407
|
children: [
|
|
1399
|
-
/* @__PURE__ */ (0,
|
|
1408
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1400
1409
|
"div",
|
|
1401
1410
|
{
|
|
1402
1411
|
className: cn(
|
|
@@ -1405,12 +1414,12 @@ function Modal({ open, onClose, title, children, danger, warn, footer, noClose,
|
|
|
1405
1414
|
scrollable && bodyScrolled && "fractal-modal-title-row--scrolled"
|
|
1406
1415
|
),
|
|
1407
1416
|
children: [
|
|
1408
|
-
/* @__PURE__ */ (0,
|
|
1409
|
-
!noClose && /* @__PURE__ */ (0,
|
|
1417
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h3", { className: cn("fractal-modal-title", danger && "fractal-modal-title--danger", warn && "fractal-modal-title--warn"), children: title }),
|
|
1418
|
+
!noClose && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: onClose, title: "Close", disabled: closeDisabled, className: "fractal-modal-close", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CloseIcon, {}) })
|
|
1410
1419
|
]
|
|
1411
1420
|
}
|
|
1412
1421
|
),
|
|
1413
|
-
/* @__PURE__ */ (0,
|
|
1422
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1414
1423
|
"div",
|
|
1415
1424
|
{
|
|
1416
1425
|
"aria-busy": loading || void 0,
|
|
@@ -1421,10 +1430,10 @@ function Modal({ open, onClose, title, children, danger, warn, footer, noClose,
|
|
|
1421
1430
|
scrollable && "fractal-modal-body--scrollable"
|
|
1422
1431
|
),
|
|
1423
1432
|
onScroll: scrollable ? (event) => setBodyScrolled(event.currentTarget.scrollTop > 0) : void 0,
|
|
1424
|
-
children: loading ? /* @__PURE__ */ (0,
|
|
1433
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(UILoader, { label: loadingLabel }) : children
|
|
1425
1434
|
}
|
|
1426
1435
|
),
|
|
1427
|
-
footer && /* @__PURE__ */ (0,
|
|
1436
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: cn("fractal-modal-footer", scrollable && "fractal-modal-footer--divided"), children: footer })
|
|
1428
1437
|
]
|
|
1429
1438
|
}
|
|
1430
1439
|
) }),
|
|
@@ -1436,7 +1445,7 @@ function Modal({ open, onClose, title, children, danger, warn, footer, noClose,
|
|
|
1436
1445
|
var import_react4 = require("react");
|
|
1437
1446
|
var import_react_dom3 = require("react-dom");
|
|
1438
1447
|
var import_fractal_icons9 = require("@mirror-physics/fractal-icons");
|
|
1439
|
-
var
|
|
1448
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1440
1449
|
function TableOverflowMenu({ items, label, disabled, onSelect }) {
|
|
1441
1450
|
const id = (0, import_react4.useId)();
|
|
1442
1451
|
const trigger = (0, import_react4.useRef)(null);
|
|
@@ -1487,15 +1496,15 @@ function TableOverflowMenu({ items, label, disabled, onSelect }) {
|
|
|
1487
1496
|
if (disabled || items.length === 0) setOpen(false);
|
|
1488
1497
|
}, [disabled, items.length]);
|
|
1489
1498
|
if (items.length === 0) return null;
|
|
1490
|
-
return /* @__PURE__ */ (0,
|
|
1491
|
-
/* @__PURE__ */ (0,
|
|
1499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "fractal-table-overflow-trigger", children: [
|
|
1500
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1492
1501
|
Button,
|
|
1493
1502
|
{
|
|
1494
1503
|
ref: trigger,
|
|
1495
1504
|
buttonType: "ghost",
|
|
1496
1505
|
controlSize: "sm",
|
|
1497
1506
|
hasIconOnly: true,
|
|
1498
|
-
icon: /* @__PURE__ */ (0,
|
|
1507
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_fractal_icons9.Ellipsis, { "aria-hidden": true }),
|
|
1499
1508
|
"aria-label": label,
|
|
1500
1509
|
"aria-haspopup": "menu",
|
|
1501
1510
|
"aria-expanded": open,
|
|
@@ -1514,7 +1523,7 @@ function TableOverflowMenu({ items, label, disabled, onSelect }) {
|
|
|
1514
1523
|
}
|
|
1515
1524
|
}
|
|
1516
1525
|
),
|
|
1517
|
-
open && (0, import_react_dom3.createPortal)(/* @__PURE__ */ (0,
|
|
1526
|
+
open && (0, import_react_dom3.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1518
1527
|
"div",
|
|
1519
1528
|
{
|
|
1520
1529
|
ref: panel,
|
|
@@ -1542,7 +1551,7 @@ function TableOverflowMenu({ items, label, disabled, onSelect }) {
|
|
|
1542
1551
|
ordered.find((button) => button.textContent?.trim().toLocaleLowerCase().startsWith(event.key.toLocaleLowerCase()))?.focus();
|
|
1543
1552
|
}
|
|
1544
1553
|
},
|
|
1545
|
-
children: items.map((item) => /* @__PURE__ */ (0,
|
|
1554
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1546
1555
|
"button",
|
|
1547
1556
|
{
|
|
1548
1557
|
type: "button",
|
|
@@ -1554,7 +1563,7 @@ function TableOverflowMenu({ items, label, disabled, onSelect }) {
|
|
|
1554
1563
|
close();
|
|
1555
1564
|
},
|
|
1556
1565
|
children: [
|
|
1557
|
-
item.icon && /* @__PURE__ */ (0,
|
|
1566
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { "aria-hidden": "true", children: item.icon }),
|
|
1558
1567
|
item.label
|
|
1559
1568
|
]
|
|
1560
1569
|
},
|
|
@@ -1567,7 +1576,7 @@ function TableOverflowMenu({ items, label, disabled, onSelect }) {
|
|
|
1567
1576
|
|
|
1568
1577
|
// src/components/TableLayout/TableLayout.tsx
|
|
1569
1578
|
var import_react5 = require("react");
|
|
1570
|
-
var
|
|
1579
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1571
1580
|
var length = (value) => typeof value === "number" ? `${value}px` : value;
|
|
1572
1581
|
function columnStyle(column) {
|
|
1573
1582
|
return {
|
|
@@ -1603,7 +1612,7 @@ function useOverflow() {
|
|
|
1603
1612
|
}
|
|
1604
1613
|
function TableViewport({ children, maxHeight, label }) {
|
|
1605
1614
|
const { ref, overflow } = useOverflow();
|
|
1606
|
-
return /* @__PURE__ */ (0,
|
|
1615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { ref, className: "fractal-table-viewport", style: { maxHeight }, tabIndex: overflow ? 0 : void 0, role: overflow ? "region" : void 0, "aria-label": overflow ? `${label}, scrollable table` : void 0, children });
|
|
1607
1616
|
}
|
|
1608
1617
|
function TableCellContent({ children, label }) {
|
|
1609
1618
|
const { ref, overflow } = useOverflow();
|
|
@@ -1630,7 +1639,7 @@ function TableCellContent({ children, label }) {
|
|
|
1630
1639
|
cell.addEventListener("wheel", wheel, { passive: false });
|
|
1631
1640
|
return () => cell.removeEventListener("wheel", wheel);
|
|
1632
1641
|
}, [ref]);
|
|
1633
|
-
return /* @__PURE__ */ (0,
|
|
1642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1634
1643
|
"div",
|
|
1635
1644
|
{
|
|
1636
1645
|
ref,
|
|
@@ -1649,28 +1658,28 @@ function TableCellContent({ children, label }) {
|
|
|
1649
1658
|
else el.scrollLeft = event.key === "Home" ? 0 : el.scrollWidth * (getComputedStyle(el).direction === "rtl" ? -1 : 1);
|
|
1650
1659
|
} else if (event.key === " " || event.key === "Enter") event.stopPropagation();
|
|
1651
1660
|
},
|
|
1652
|
-
children: /* @__PURE__ */ (0,
|
|
1661
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "fractal-table-cell-content", children })
|
|
1653
1662
|
}
|
|
1654
1663
|
);
|
|
1655
1664
|
}
|
|
1656
1665
|
|
|
1657
1666
|
// src/components/DataTable/DataTable.tsx
|
|
1658
|
-
var
|
|
1667
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1659
1668
|
function DataTable({ columns, data, emptyMessage, header, size = "md", className, overflowMenu, layout = "fill", stickyHeader = false, stickyFirstColumn = false, maxHeight, "aria-label": ariaLabel = "Data table" }) {
|
|
1660
|
-
return /* @__PURE__ */ (0,
|
|
1661
|
-
header && /* @__PURE__ */ (0,
|
|
1662
|
-
data.length === 0 ? /* @__PURE__ */ (0,
|
|
1663
|
-
/* @__PURE__ */ (0,
|
|
1664
|
-
columns.map((col, columnIndex) => /* @__PURE__ */ (0,
|
|
1665
|
-
overflowMenu && /* @__PURE__ */ (0,
|
|
1669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("fractal-table-layout", "fractal-datatable", `fractal-datatable--${size}`, className), "data-overflow-menu": Boolean(overflowMenu), "data-table-layout": layout, "data-sticky-first": stickyFirstColumn, "data-sticky-header": stickyHeader, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "fractal-datatable-surface", children: [
|
|
1670
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "fractal-datatable-header", children: header }),
|
|
1671
|
+
data.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "fractal-datatable-empty", children: emptyMessage || "No data" }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TableViewport, { maxHeight, label: ariaLabel, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("table", { "aria-label": ariaLabel, className: "fractal-datatable-table", children: [
|
|
1672
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("tr", { className: "fractal-datatable-thead-row", children: [
|
|
1673
|
+
columns.map((col, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("th", { scope: "col", className: "fractal-datatable-th", style: columnStyle(col), "data-pinned-column": columnIndex === 0 ? "data" : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TableCellContent, { label: `${col.header} column`, children: col.header }) }, col.key)),
|
|
1674
|
+
overflowMenu && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("th", { scope: "col", "aria-label": "Row actions", className: "fractal-datatable-th fractal-table-overflow-cell", "data-pinned-column": "overflow" })
|
|
1666
1675
|
] }) }),
|
|
1667
|
-
/* @__PURE__ */ (0,
|
|
1676
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("tbody", { children: data.map((row, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1668
1677
|
"tr",
|
|
1669
1678
|
{
|
|
1670
1679
|
className: "fractal-datatable-row",
|
|
1671
1680
|
children: [
|
|
1672
|
-
columns.map((col, columnIndex) => /* @__PURE__ */ (0,
|
|
1673
|
-
overflowMenu && /* @__PURE__ */ (0,
|
|
1681
|
+
columns.map((col, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("td", { className: "fractal-datatable-td", style: columnStyle(col), "data-pinned-column": columnIndex === 0 ? "data" : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TableCellContent, { label: `${col.header || "Value"}, row ${rowIndex + 1}`, children: col.render(row, rowIndex) }) }, col.key)),
|
|
1682
|
+
overflowMenu && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("td", { className: "fractal-datatable-td fractal-table-overflow-cell", "data-pinned-column": "overflow", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TableOverflowMenu, { items: overflowMenu.items(row, rowIndex), label: overflowMenu.getLabel?.(row, rowIndex) ?? `Actions for row ${rowIndex + 1}`, disabled: overflowMenu.isDisabled?.(row, rowIndex), onSelect: (value) => overflowMenu.onSelect(value, row, rowIndex) }) })
|
|
1674
1683
|
]
|
|
1675
1684
|
},
|
|
1676
1685
|
rowIndex
|
|
@@ -1722,7 +1731,7 @@ function positionDropdown(trigger, panel, bounds, direction, align) {
|
|
|
1722
1731
|
}
|
|
1723
1732
|
|
|
1724
1733
|
// src/components/Dropdown/Dropdown.tsx
|
|
1725
|
-
var
|
|
1734
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1726
1735
|
function Dropdown({
|
|
1727
1736
|
items,
|
|
1728
1737
|
selectedValue = "",
|
|
@@ -1897,8 +1906,8 @@ function Dropdown({
|
|
|
1897
1906
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
1898
1907
|
}, [open]);
|
|
1899
1908
|
if (renderableItems.length === 0) return null;
|
|
1900
|
-
return /* @__PURE__ */ (0,
|
|
1901
|
-
/* @__PURE__ */ (0,
|
|
1909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { ref: rootRef, "data-control-size": size, "data-filled": multiple ? selectedValues.length > 0 : Boolean(selectedValue), "data-open": open, "data-clearable": canClear || void 0, className: cn("fractal-dropdown", fieldLabel && "fractal-floating-field fractal-floating-field--dropdown", className), children: [
|
|
1910
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1902
1911
|
"button",
|
|
1903
1912
|
{
|
|
1904
1913
|
ref: triggerRef,
|
|
@@ -1934,23 +1943,24 @@ function Dropdown({
|
|
|
1934
1943
|
triggerClassName
|
|
1935
1944
|
),
|
|
1936
1945
|
children: [
|
|
1937
|
-
/* @__PURE__ */ (0,
|
|
1938
|
-
selected?.icon != null && /* @__PURE__ */ (0,
|
|
1939
|
-
selected?.description != null && (typeof selected?.description !== "string" || selected?.description !== "") && /* @__PURE__ */ (0,
|
|
1946
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: fieldLabel ? "fractal-dropdown-field-value" : void 0, style: fieldLabel ? void 0 : { display: "contents" }, children: triggerContent != null ? triggerContent : /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
1947
|
+
selected?.icon != null && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "fractal-dropdown-icon fractal-dropdown-icon--trigger", children: selected?.icon }),
|
|
1948
|
+
selected?.description != null && (typeof selected?.description !== "string" || selected?.description !== "") && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "fractal-dropdown-selected-text", children: selected?.description })
|
|
1940
1949
|
] }) }),
|
|
1941
|
-
!noChevron && !iconOnly && /* @__PURE__ */ (0,
|
|
1950
|
+
!noChevron && !iconOnly && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "fractal-dropdown-chevron", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ChevronIcon, { size: size === "sm" ? 14 : 16 }) })
|
|
1942
1951
|
]
|
|
1943
1952
|
}
|
|
1944
1953
|
),
|
|
1945
|
-
canClear && /* @__PURE__ */ (0,
|
|
1954
|
+
canClear && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", className: "fractal-dropdown-clear", "aria-label": `Clear ${accessibleLabel}`, onClick: () => {
|
|
1946
1955
|
if (multiple) onSelectionChange?.([]);
|
|
1947
1956
|
else onSelect?.("");
|
|
1948
1957
|
setOpen(false);
|
|
1949
1958
|
setQuery("");
|
|
1950
1959
|
triggerRef.current?.focus();
|
|
1951
|
-
}, children: /* @__PURE__ */ (0,
|
|
1952
|
-
fieldLabel ? /* @__PURE__ */ (0,
|
|
1953
|
-
|
|
1960
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_fractal_icons10.Close, { "aria-hidden": "true" }) }),
|
|
1961
|
+
fieldLabel ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FloatingFieldBorder, { label: fieldLabel }) : null,
|
|
1962
|
+
fieldLabel ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { className: "fractal-floating-field__label", htmlFor: triggerId ?? `${menuId}-trigger`, children: fieldLabel }) : null,
|
|
1963
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1954
1964
|
"div",
|
|
1955
1965
|
{
|
|
1956
1966
|
ref: panelRef,
|
|
@@ -1970,26 +1980,26 @@ function Dropdown({
|
|
|
1970
1980
|
className: cn("fractal-dropdown-panel", `fractal-dropdown-panel--${size}`, panelClassName),
|
|
1971
1981
|
style: panelStyle,
|
|
1972
1982
|
children: [
|
|
1973
|
-
searchable && /* @__PURE__ */ (0,
|
|
1974
|
-
/* @__PURE__ */ (0,
|
|
1975
|
-
/* @__PURE__ */ (0,
|
|
1983
|
+
searchable && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { ref: searchContainerRef, className: "fractal-dropdown-search-container", "data-scrolled": optionsScrolled, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "fractal-dropdown-search", children: [
|
|
1984
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_fractal_icons10.MagnifyingGlass, { "aria-hidden": "true" }),
|
|
1985
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", { ref: searchRef, type: "search", "aria-label": searchPlaceholder, placeholder: searchPlaceholder, value: query, onChange: (event) => setQuery(event.target.value) })
|
|
1976
1986
|
] }) }),
|
|
1977
|
-
/* @__PURE__ */ (0,
|
|
1978
|
-
label != null && /* @__PURE__ */ (0,
|
|
1987
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { ref: optionsRef, className: "fractal-dropdown-options", onScroll: (event) => setOptionsScrolled(event.currentTarget.scrollTop > 0), role: "listbox", id: `${menuId}-options`, "aria-label": accessibleLabel, "aria-multiselectable": multiple || void 0, children: [
|
|
1988
|
+
label != null && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "fractal-dropdown-label", children: label }),
|
|
1979
1989
|
visibleItems.map((item, index) => {
|
|
1980
|
-
const topDivider = item.border === "top" ? /* @__PURE__ */ (0,
|
|
1981
|
-
const bottomDivider = item.border === "bottom" ? /* @__PURE__ */ (0,
|
|
1990
|
+
const topDivider = item.border === "top" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "fractal-dropdown-separator" }) : null;
|
|
1991
|
+
const bottomDivider = item.border === "bottom" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "fractal-dropdown-separator" }) : null;
|
|
1982
1992
|
if (item.kind === "header") {
|
|
1983
|
-
return /* @__PURE__ */ (0,
|
|
1993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(React12.Fragment, { children: [
|
|
1984
1994
|
topDivider,
|
|
1985
|
-
/* @__PURE__ */ (0,
|
|
1995
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { role: "presentation", className: "fractal-dropdown-label", children: item.description }),
|
|
1986
1996
|
bottomDivider
|
|
1987
1997
|
] }, `header-${index}`);
|
|
1988
1998
|
}
|
|
1989
1999
|
const isSelected = multiple ? selectedValues.includes(item.value) : item.value === selectedValue;
|
|
1990
|
-
return /* @__PURE__ */ (0,
|
|
2000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(React12.Fragment, { children: [
|
|
1991
2001
|
topDivider,
|
|
1992
|
-
/* @__PURE__ */ (0,
|
|
2002
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1993
2003
|
"button",
|
|
1994
2004
|
{
|
|
1995
2005
|
type: "button",
|
|
@@ -2005,17 +2015,17 @@ function Dropdown({
|
|
|
2005
2015
|
},
|
|
2006
2016
|
className: "fractal-dropdown-option",
|
|
2007
2017
|
children: [
|
|
2008
|
-
multiple && /* @__PURE__ */ (0,
|
|
2009
|
-
item.icon != null && /* @__PURE__ */ (0,
|
|
2010
|
-
item.description != null && (typeof item.description !== "string" || item.description !== "") && /* @__PURE__ */ (0,
|
|
2011
|
-
item.trailing != null && /* @__PURE__ */ (0,
|
|
2018
|
+
multiple && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "fractal-dropdown-checkbox", "data-checked": isSelected, "aria-hidden": "true", children: isSelected && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_fractal_icons10.Check, {}) }),
|
|
2019
|
+
item.icon != null && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "fractal-dropdown-icon", children: item.icon }),
|
|
2020
|
+
item.description != null && (typeof item.description !== "string" || item.description !== "") && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "fractal-dropdown-option-text", children: item.description }),
|
|
2021
|
+
item.trailing != null && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "fractal-dropdown-trailing", children: item.trailing })
|
|
2012
2022
|
]
|
|
2013
2023
|
}
|
|
2014
2024
|
),
|
|
2015
2025
|
bottomDivider
|
|
2016
2026
|
] }, item.value);
|
|
2017
2027
|
}),
|
|
2018
|
-
!selectableItems.length && /* @__PURE__ */ (0,
|
|
2028
|
+
!selectableItems.length && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { role: "status", className: "fractal-dropdown-label", children: emptyMessage })
|
|
2019
2029
|
] })
|
|
2020
2030
|
]
|
|
2021
2031
|
}
|
|
@@ -2025,9 +2035,9 @@ function Dropdown({
|
|
|
2025
2035
|
|
|
2026
2036
|
// src/components/Link/Link.tsx
|
|
2027
2037
|
var React13 = __toESM(require("react"), 1);
|
|
2028
|
-
var
|
|
2038
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2029
2039
|
var Link = React13.forwardRef(
|
|
2030
|
-
({ className, theme = "default", size = "md", ...props }, ref) => /* @__PURE__ */ (0,
|
|
2040
|
+
({ className, theme = "default", size = "md", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2031
2041
|
"a",
|
|
2032
2042
|
{
|
|
2033
2043
|
ref,
|
|
@@ -2040,9 +2050,9 @@ Link.displayName = "Link";
|
|
|
2040
2050
|
|
|
2041
2051
|
// src/components/Chip/Chip.tsx
|
|
2042
2052
|
var React14 = __toESM(require("react"), 1);
|
|
2043
|
-
var
|
|
2053
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2044
2054
|
var Chip = React14.forwardRef(
|
|
2045
|
-
({ className, tone = "neutral", ...props }, ref) => /* @__PURE__ */ (0,
|
|
2055
|
+
({ className, tone = "neutral", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2046
2056
|
"span",
|
|
2047
2057
|
{
|
|
2048
2058
|
ref,
|
|
@@ -2055,7 +2065,7 @@ Chip.displayName = "Chip";
|
|
|
2055
2065
|
|
|
2056
2066
|
// src/components/Checkbox/Checkbox.tsx
|
|
2057
2067
|
var import_fractal_icons11 = require("@mirror-physics/fractal-icons");
|
|
2058
|
-
var
|
|
2068
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2059
2069
|
function Checkbox({
|
|
2060
2070
|
checked,
|
|
2061
2071
|
indeterminate = false,
|
|
@@ -2066,7 +2076,7 @@ function Checkbox({
|
|
|
2066
2076
|
onKeyDown,
|
|
2067
2077
|
...props
|
|
2068
2078
|
}) {
|
|
2069
|
-
return /* @__PURE__ */ (0,
|
|
2079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2070
2080
|
"button",
|
|
2071
2081
|
{
|
|
2072
2082
|
...props,
|
|
@@ -2088,16 +2098,16 @@ function Checkbox({
|
|
|
2088
2098
|
onKeyDown?.(event);
|
|
2089
2099
|
if (event.key === " " || event.key === "Enter") event.stopPropagation();
|
|
2090
2100
|
},
|
|
2091
|
-
children: indeterminate ? /* @__PURE__ */ (0,
|
|
2092
|
-
/* @__PURE__ */ (0,
|
|
2093
|
-
/* @__PURE__ */ (0,
|
|
2094
|
-
] }) : checked ? /* @__PURE__ */ (0,
|
|
2101
|
+
children: indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "fractal-checkbox__indeterminate-icon", "aria-hidden": "true", children: [
|
|
2102
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_fractal_icons11.Checkbox, { size: 18 }),
|
|
2103
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_fractal_icons11.Minus, { className: "fractal-checkbox__indeterminate-mark", size: 12 })
|
|
2104
|
+
] }) : checked ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_fractal_icons11.CheckboxChecked, { "aria-hidden": "true", size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_fractal_icons11.Checkbox, { "aria-hidden": "true", size: 18 })
|
|
2095
2105
|
}
|
|
2096
2106
|
);
|
|
2097
2107
|
}
|
|
2098
2108
|
|
|
2099
2109
|
// src/components/Radio/Radio.tsx
|
|
2100
|
-
var
|
|
2110
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2101
2111
|
function Radio({
|
|
2102
2112
|
checked,
|
|
2103
2113
|
className,
|
|
@@ -2107,8 +2117,8 @@ function Radio({
|
|
|
2107
2117
|
onCheckedChange,
|
|
2108
2118
|
...props
|
|
2109
2119
|
}) {
|
|
2110
|
-
return /* @__PURE__ */ (0,
|
|
2111
|
-
/* @__PURE__ */ (0,
|
|
2120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: cn("fractal-radio", disabled && "fractal-radio--disabled", className), children: [
|
|
2121
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2112
2122
|
"input",
|
|
2113
2123
|
{
|
|
2114
2124
|
...props,
|
|
@@ -2119,10 +2129,10 @@ function Radio({
|
|
|
2119
2129
|
type: "radio"
|
|
2120
2130
|
}
|
|
2121
2131
|
),
|
|
2122
|
-
/* @__PURE__ */ (0,
|
|
2123
|
-
/* @__PURE__ */ (0,
|
|
2124
|
-
/* @__PURE__ */ (0,
|
|
2125
|
-
description && /* @__PURE__ */ (0,
|
|
2132
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { "aria-hidden": "true", className: "fractal-radio__control", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "fractal-radio__dot" }) }),
|
|
2133
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "fractal-radio__content", children: [
|
|
2134
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "fractal-radio__label", children: label }),
|
|
2135
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "fractal-radio__description", children: description })
|
|
2126
2136
|
] })
|
|
2127
2137
|
] });
|
|
2128
2138
|
}
|
|
@@ -2130,7 +2140,7 @@ function Radio({
|
|
|
2130
2140
|
// src/components/SortableTable/SortableTable.tsx
|
|
2131
2141
|
var import_react6 = require("react");
|
|
2132
2142
|
var import_fractal_icons12 = require("@mirror-physics/fractal-icons");
|
|
2133
|
-
var
|
|
2143
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2134
2144
|
function SortableTable({
|
|
2135
2145
|
columns,
|
|
2136
2146
|
data,
|
|
@@ -2230,17 +2240,17 @@ function SortableTable({
|
|
|
2230
2240
|
onSortChange?.(nextKey, nextDirection);
|
|
2231
2241
|
}
|
|
2232
2242
|
};
|
|
2233
|
-
return /* @__PURE__ */ (0,
|
|
2234
|
-
header && /* @__PURE__ */ (0,
|
|
2235
|
-
visibleRows.length === 0 ? /* @__PURE__ */ (0,
|
|
2236
|
-
/* @__PURE__ */ (0,
|
|
2237
|
-
selection && /* @__PURE__ */ (0,
|
|
2243
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: cn("fractal-table-layout", "fractal-sortable-table", `fractal-sortable-table--${size}`, embedded && "fractal-sortable-table--embedded", className), "data-overflow-menu": Boolean(overflowMenu), "data-table-layout": layout, "data-sticky-first": stickyFirstColumn, "data-sticky-header": stickyHeader, "data-table-selection": Boolean(selection), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "fractal-sortable-table-surface", children: [
|
|
2244
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "fractal-sortable-table-header", children: header }),
|
|
2245
|
+
visibleRows.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "fractal-sortable-table-empty", children: emptyMessage || "No data" }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableViewport, { maxHeight, label: ariaLabel || "Data table", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("table", { "aria-label": ariaLabel, className: "fractal-sortable-table-table", children: [
|
|
2246
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("tr", { className: "fractal-sortable-table-thead-row", children: [
|
|
2247
|
+
selection && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2238
2248
|
"th",
|
|
2239
2249
|
{
|
|
2240
2250
|
className: "fractal-sortable-table-th fractal-sortable-table-selection-cell",
|
|
2241
2251
|
"data-pinned-column": "selection",
|
|
2242
2252
|
scope: "col",
|
|
2243
|
-
children: /* @__PURE__ */ (0,
|
|
2253
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2244
2254
|
Checkbox,
|
|
2245
2255
|
{
|
|
2246
2256
|
"aria-label": selection.selectAllLabel ?? "Select all rows",
|
|
@@ -2266,26 +2276,26 @@ function SortableTable({
|
|
|
2266
2276
|
columns.map((col, columnIndex) => {
|
|
2267
2277
|
const isActive = activeKey === col.key && activeDirection !== null;
|
|
2268
2278
|
if (!col.sortable) {
|
|
2269
|
-
return /* @__PURE__ */ (0,
|
|
2279
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2270
2280
|
"th",
|
|
2271
2281
|
{
|
|
2272
2282
|
className: "fractal-sortable-table-th",
|
|
2273
2283
|
scope: "col",
|
|
2274
2284
|
style: columnStyle(col),
|
|
2275
2285
|
"data-pinned-column": columnIndex === 0 ? "data" : void 0,
|
|
2276
|
-
children: /* @__PURE__ */ (0,
|
|
2286
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableCellContent, { label: `${col.header} column`, children: col.header })
|
|
2277
2287
|
},
|
|
2278
2288
|
col.key
|
|
2279
2289
|
);
|
|
2280
2290
|
}
|
|
2281
|
-
return /* @__PURE__ */ (0,
|
|
2291
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2282
2292
|
"th",
|
|
2283
2293
|
{
|
|
2284
2294
|
className: "fractal-sortable-table-th fractal-sortable-table-th--sortable",
|
|
2285
2295
|
scope: "col",
|
|
2286
2296
|
style: columnStyle(col),
|
|
2287
2297
|
"data-pinned-column": columnIndex === 0 ? "data" : void 0,
|
|
2288
|
-
children: /* @__PURE__ */ (0,
|
|
2298
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableCellContent, { label: `${col.header} column`, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2289
2299
|
"button",
|
|
2290
2300
|
{
|
|
2291
2301
|
type: "button",
|
|
@@ -2296,8 +2306,8 @@ function SortableTable({
|
|
|
2296
2306
|
onClick: () => handleSortClick(col.key),
|
|
2297
2307
|
"aria-sort": isActive ? activeDirection === "asc" ? "ascending" : "descending" : "none",
|
|
2298
2308
|
children: [
|
|
2299
|
-
/* @__PURE__ */ (0,
|
|
2300
|
-
/* @__PURE__ */ (0,
|
|
2309
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: col.header }),
|
|
2310
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "fractal-sortable-table-sort-icon", "aria-hidden": "true", children: isActive && activeDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_fractal_icons12.ArrowUp, { size: 14 }) : isActive && activeDirection === "desc" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_fractal_icons12.ArrowDown, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_fractal_icons12.ArrowsUpDown, { size: 14 }) })
|
|
2301
2311
|
]
|
|
2302
2312
|
}
|
|
2303
2313
|
) })
|
|
@@ -2305,9 +2315,9 @@ function SortableTable({
|
|
|
2305
2315
|
col.key
|
|
2306
2316
|
);
|
|
2307
2317
|
}),
|
|
2308
|
-
overflowMenu && /* @__PURE__ */ (0,
|
|
2318
|
+
overflowMenu && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("th", { scope: "col", "aria-label": "Row actions", className: "fractal-sortable-table-th fractal-table-overflow-cell", "data-pinned-column": "overflow" })
|
|
2309
2319
|
] }) }),
|
|
2310
|
-
/* @__PURE__ */ (0,
|
|
2320
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("tbody", { children: visibleRows.map((row, rowIndex) => {
|
|
2311
2321
|
const highlighted = highlightRow?.(row, rowIndex) ?? false;
|
|
2312
2322
|
const disabled = isRowDisabled?.(row) ?? false;
|
|
2313
2323
|
const selectionDisabled = disabled || (isRowSelectionDisabled?.(row) ?? false);
|
|
@@ -2316,7 +2326,7 @@ function SortableTable({
|
|
|
2316
2326
|
label: rowAction.label(row, rowIndex),
|
|
2317
2327
|
icon: rowAction.icon(row, rowIndex)
|
|
2318
2328
|
} : null;
|
|
2319
|
-
return /* @__PURE__ */ (0,
|
|
2329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2320
2330
|
"tr",
|
|
2321
2331
|
{
|
|
2322
2332
|
className: cn(
|
|
@@ -2340,7 +2350,7 @@ function SortableTable({
|
|
|
2340
2350
|
role: interactive ? "button" : void 0,
|
|
2341
2351
|
tabIndex: interactive ? 0 : void 0,
|
|
2342
2352
|
children: [
|
|
2343
|
-
selection && /* @__PURE__ */ (0,
|
|
2353
|
+
selection && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("td", { className: "fractal-sortable-table-td fractal-sortable-table-selection-cell", "data-pinned-column": "selection", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2344
2354
|
Checkbox,
|
|
2345
2355
|
{
|
|
2346
2356
|
"aria-label": selection.getRowLabel(row),
|
|
@@ -2352,7 +2362,7 @@ function SortableTable({
|
|
|
2352
2362
|
}
|
|
2353
2363
|
}
|
|
2354
2364
|
) }),
|
|
2355
|
-
columns.map((col, columnIndex) => /* @__PURE__ */ (0,
|
|
2365
|
+
columns.map((col, columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
2356
2366
|
"td",
|
|
2357
2367
|
{
|
|
2358
2368
|
className: cn(
|
|
@@ -2363,13 +2373,13 @@ function SortableTable({
|
|
|
2363
2373
|
"data-column-align": col.align,
|
|
2364
2374
|
"data-pinned-column": columnIndex === 0 ? "data" : void 0,
|
|
2365
2375
|
children: [
|
|
2366
|
-
/* @__PURE__ */ (0,
|
|
2367
|
-
action && columnIndex === columns.length - 1 && /* @__PURE__ */ (0,
|
|
2376
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableCellContent, { label: `${col.header || "Value"}, row ${rowIndex + 1}`, children: col.render(row, rowIndex) }),
|
|
2377
|
+
action && columnIndex === columns.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "fractal-sortable-table-row-action", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "fractal-sortable-table-row-action__icon", children: action.icon }) })
|
|
2368
2378
|
]
|
|
2369
2379
|
},
|
|
2370
2380
|
col.key
|
|
2371
2381
|
)),
|
|
2372
|
-
overflowMenu && /* @__PURE__ */ (0,
|
|
2382
|
+
overflowMenu && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2373
2383
|
"td",
|
|
2374
2384
|
{
|
|
2375
2385
|
className: "fractal-sortable-table-td fractal-table-overflow-cell",
|
|
@@ -2377,7 +2387,7 @@ function SortableTable({
|
|
|
2377
2387
|
onClick: (event) => event.stopPropagation(),
|
|
2378
2388
|
onDoubleClick: (event) => event.stopPropagation(),
|
|
2379
2389
|
onKeyDown: (event) => event.stopPropagation(),
|
|
2380
|
-
children: /* @__PURE__ */ (0,
|
|
2390
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TableOverflowMenu, { items: overflowMenu.items(row, rowIndex), label: overflowMenu.getLabel?.(row, rowIndex) ?? `Actions for row ${rowIndex + 1}`, disabled: disabled || overflowMenu.isDisabled?.(row, rowIndex), onSelect: (value) => overflowMenu.onSelect(value, row, rowIndex) })
|
|
2381
2391
|
}
|
|
2382
2392
|
)
|
|
2383
2393
|
]
|
|
@@ -2391,7 +2401,7 @@ function SortableTable({
|
|
|
2391
2401
|
|
|
2392
2402
|
// src/components/Tabs/Tabs.tsx
|
|
2393
2403
|
var import_react7 = require("react");
|
|
2394
|
-
var
|
|
2404
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2395
2405
|
function Tabs({
|
|
2396
2406
|
items,
|
|
2397
2407
|
defaultValue,
|
|
@@ -2462,8 +2472,8 @@ function Tabs({
|
|
|
2462
2472
|
selectTab(nextId2);
|
|
2463
2473
|
requestAnimationFrame(() => tabRefs.current[nextId2]?.focus());
|
|
2464
2474
|
};
|
|
2465
|
-
return /* @__PURE__ */ (0,
|
|
2466
|
-
/* @__PURE__ */ (0,
|
|
2475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: cn("fractal-tabs", `fractal-tabs--${variant}`, divider && "fractal-tabs--divider", className), children: [
|
|
2476
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2467
2477
|
"div",
|
|
2468
2478
|
{
|
|
2469
2479
|
ref: tabListRef,
|
|
@@ -2476,7 +2486,7 @@ function Tabs({
|
|
|
2476
2486
|
const isActive = item.id === activeId;
|
|
2477
2487
|
const tabId = `${reactId}-tab-${item.id}`;
|
|
2478
2488
|
const panelId = `${reactId}-panel-${item.id}`;
|
|
2479
|
-
return /* @__PURE__ */ (0,
|
|
2489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2480
2490
|
"button",
|
|
2481
2491
|
{
|
|
2482
2492
|
ref: (el) => {
|
|
@@ -2507,7 +2517,7 @@ function Tabs({
|
|
|
2507
2517
|
const tabId = `${reactId}-tab-${item.id}`;
|
|
2508
2518
|
const panelId = `${reactId}-panel-${item.id}`;
|
|
2509
2519
|
const isActive = item.id === activeId;
|
|
2510
|
-
return /* @__PURE__ */ (0,
|
|
2520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2511
2521
|
"div",
|
|
2512
2522
|
{
|
|
2513
2523
|
id: panelId,
|
|
@@ -2525,7 +2535,7 @@ function Tabs({
|
|
|
2525
2535
|
|
|
2526
2536
|
// src/components/ContentSwitcher/ContentSwitcher.tsx
|
|
2527
2537
|
var React15 = __toESM(require("react"), 1);
|
|
2528
|
-
var
|
|
2538
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2529
2539
|
function ContentSwitcher({ items, value, onValueChange, ariaLabel, fullWidth = false, className }) {
|
|
2530
2540
|
const switcherRef = React15.useRef(null);
|
|
2531
2541
|
const buttonRefs = React15.useRef([]);
|
|
@@ -2583,7 +2593,7 @@ function ContentSwitcher({ items, value, onValueChange, ariaLabel, fullWidth = f
|
|
|
2583
2593
|
onValueChange(items[nextIndex].value);
|
|
2584
2594
|
}
|
|
2585
2595
|
};
|
|
2586
|
-
return /* @__PURE__ */ (0,
|
|
2596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
2587
2597
|
"div",
|
|
2588
2598
|
{
|
|
2589
2599
|
className: cn("fractal-content-switcher", fullWidth && "fractal-content-switcher--full-width", className),
|
|
@@ -2591,10 +2601,10 @@ function ContentSwitcher({ items, value, onValueChange, ariaLabel, fullWidth = f
|
|
|
2591
2601
|
"aria-label": ariaLabel,
|
|
2592
2602
|
ref: switcherRef,
|
|
2593
2603
|
children: [
|
|
2594
|
-
/* @__PURE__ */ (0,
|
|
2604
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "fractal-content-switcher__indicator", "aria-hidden": true }),
|
|
2595
2605
|
items.map((item, index) => {
|
|
2596
2606
|
const active = item.value === value;
|
|
2597
|
-
return /* @__PURE__ */ (0,
|
|
2607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2598
2608
|
"button",
|
|
2599
2609
|
{
|
|
2600
2610
|
className: cn("fractal-content-switcher__item", active && "fractal-content-switcher__item--active"),
|
|
@@ -2628,7 +2638,7 @@ function ContentSwitcher({ items, value, onValueChange, ariaLabel, fullWidth = f
|
|
|
2628
2638
|
// src/components/Disclosure/Disclosure.tsx
|
|
2629
2639
|
var import_react8 = require("react");
|
|
2630
2640
|
var import_fractal_icons13 = require("@mirror-physics/fractal-icons");
|
|
2631
|
-
var
|
|
2641
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2632
2642
|
function Disclosure({
|
|
2633
2643
|
title,
|
|
2634
2644
|
meta,
|
|
@@ -2656,7 +2666,7 @@ function Disclosure({
|
|
|
2656
2666
|
onOpenChange?.(next);
|
|
2657
2667
|
}
|
|
2658
2668
|
};
|
|
2659
|
-
return /* @__PURE__ */ (0,
|
|
2669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
2660
2670
|
"div",
|
|
2661
2671
|
{
|
|
2662
2672
|
className: cn(
|
|
@@ -2667,7 +2677,7 @@ function Disclosure({
|
|
|
2667
2677
|
className
|
|
2668
2678
|
),
|
|
2669
2679
|
children: [
|
|
2670
|
-
/* @__PURE__ */ (0,
|
|
2680
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
2671
2681
|
"button",
|
|
2672
2682
|
{
|
|
2673
2683
|
type: "button",
|
|
@@ -2678,13 +2688,13 @@ function Disclosure({
|
|
|
2678
2688
|
disabled,
|
|
2679
2689
|
onClick: toggle,
|
|
2680
2690
|
children: [
|
|
2681
|
-
/* @__PURE__ */ (0,
|
|
2682
|
-
/* @__PURE__ */ (0,
|
|
2683
|
-
meta && /* @__PURE__ */ (0,
|
|
2691
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "fractal-disclosure-icon", "aria-hidden": "true", children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_fractal_icons13.ChevronDown, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_fractal_icons13.ChevronRight, { size: 16 }) }),
|
|
2692
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "fractal-disclosure-title", children: title }),
|
|
2693
|
+
meta && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "fractal-disclosure-meta", children: meta })
|
|
2684
2694
|
]
|
|
2685
2695
|
}
|
|
2686
2696
|
),
|
|
2687
|
-
/* @__PURE__ */ (0,
|
|
2697
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2688
2698
|
"div",
|
|
2689
2699
|
{
|
|
2690
2700
|
id: panelId,
|
|
@@ -2692,7 +2702,7 @@ function Disclosure({
|
|
|
2692
2702
|
"aria-labelledby": headerId,
|
|
2693
2703
|
className: "fractal-disclosure-panel",
|
|
2694
2704
|
hidden: !isOpen,
|
|
2695
|
-
children: /* @__PURE__ */ (0,
|
|
2705
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "fractal-disclosure-panel-inner", children })
|
|
2696
2706
|
}
|
|
2697
2707
|
)
|
|
2698
2708
|
]
|
|
@@ -2701,18 +2711,18 @@ function Disclosure({
|
|
|
2701
2711
|
}
|
|
2702
2712
|
|
|
2703
2713
|
// src/components/LatticeLoader/LatticeLoader.tsx
|
|
2704
|
-
var
|
|
2714
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2705
2715
|
var LATTICE_COUNT = 160;
|
|
2706
2716
|
var WAVE_PERIOD = 80;
|
|
2707
2717
|
function LatticeLoader({ className, label = "Loading", ...props }) {
|
|
2708
|
-
return /* @__PURE__ */ (0,
|
|
2718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2709
2719
|
"span",
|
|
2710
2720
|
{
|
|
2711
2721
|
"aria-label": label,
|
|
2712
2722
|
className: cn("fractal-lattice-loader", className),
|
|
2713
2723
|
role: "progressbar",
|
|
2714
2724
|
...props,
|
|
2715
|
-
children: Array.from({ length: LATTICE_COUNT }, (_, index) => /* @__PURE__ */ (0,
|
|
2725
|
+
children: Array.from({ length: LATTICE_COUNT }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2716
2726
|
"span",
|
|
2717
2727
|
{
|
|
2718
2728
|
"aria-hidden": "true",
|
|
@@ -2726,10 +2736,10 @@ function LatticeLoader({ className, label = "Loading", ...props }) {
|
|
|
2726
2736
|
}
|
|
2727
2737
|
|
|
2728
2738
|
// src/components/Ghost/Ghost.tsx
|
|
2729
|
-
var
|
|
2739
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2730
2740
|
var toCssLength = (value) => typeof value === "number" ? `${value}px` : value;
|
|
2731
2741
|
function Ghost({ className, width, height, radius, style, ...props }) {
|
|
2732
|
-
return /* @__PURE__ */ (0,
|
|
2742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2733
2743
|
"div",
|
|
2734
2744
|
{
|
|
2735
2745
|
"aria-hidden": "true",
|
|
@@ -2745,15 +2755,15 @@ function Ghost({ className, width, height, radius, style, ...props }) {
|
|
|
2745
2755
|
);
|
|
2746
2756
|
}
|
|
2747
2757
|
function GhostLine({ className, size = "md", width = "100%", ...props }) {
|
|
2748
|
-
return /* @__PURE__ */ (0,
|
|
2758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Ghost, { className: cn("fractal-ghost-line", `fractal-ghost-line--${size}`, className), width, ...props });
|
|
2749
2759
|
}
|
|
2750
2760
|
function ButtonGhost({ className, size = "lg", controlSize, iconOnly = false, width, ...props }) {
|
|
2751
|
-
return /* @__PURE__ */ (0,
|
|
2761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Ghost, { "data-control-size": controlSize ?? size, className: cn("fractal-ghost-button", `fractal-ghost-button--${size}`, iconOnly && "fractal-ghost-button--icon-only", className), width, ...props });
|
|
2752
2762
|
}
|
|
2753
2763
|
function CardGhost({ className, lines = 3, showHeader = true, ...props }) {
|
|
2754
|
-
return /* @__PURE__ */ (0,
|
|
2755
|
-
showHeader && /* @__PURE__ */ (0,
|
|
2756
|
-
/* @__PURE__ */ (0,
|
|
2764
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { "aria-hidden": "true", className: cn("fractal-ghost-card", className), ...props, children: [
|
|
2765
|
+
showHeader && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { width: "38%" }),
|
|
2766
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "fractal-ghost-stack", children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { width: index === lines - 1 ? "62%" : "100%" }, index)) })
|
|
2757
2767
|
] });
|
|
2758
2768
|
}
|
|
2759
2769
|
function DataTableGhost({
|
|
@@ -2767,81 +2777,81 @@ function DataTableGhost({
|
|
|
2767
2777
|
...props
|
|
2768
2778
|
}) {
|
|
2769
2779
|
const cells = Array.from({ length: columns }, (_, index) => index);
|
|
2770
|
-
return /* @__PURE__ */ (0,
|
|
2771
|
-
(showHeader || headers) && /* @__PURE__ */ (0,
|
|
2772
|
-
/* @__PURE__ */ (0,
|
|
2780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.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_runtime31.jsxs)("table", { className: "fractal-ghost-table__table", children: [
|
|
2781
|
+
(showHeader || headers) && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("tr", { className: "fractal-ghost-table__head-row", children: cells.map((index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("th", { style: { width: columnWidths?.[index] }, children: headers?.[index] ?? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { size: "sm", width: index === columns - 1 ? "62%" : "76%" }) }, index)) }) }),
|
|
2782
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("tbody", { children: Array.from({ length: rows }, (_, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("tr", { className: "fractal-ghost-table__row", children: cells.map((columnIndex) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("td", { style: { width: columnWidths?.[columnIndex] }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { width: `${[72, 54, 82, 63, 46][(rowIndex + columnIndex) % 5]}%` }) }, columnIndex)) }, rowIndex)) })
|
|
2773
2783
|
] }) });
|
|
2774
2784
|
}
|
|
2775
2785
|
function InputGhost({ className, labelWidth = "26%", ...props }) {
|
|
2776
|
-
return /* @__PURE__ */ (0,
|
|
2786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(FormFieldGhost, { className, labelWidth, ...props });
|
|
2777
2787
|
}
|
|
2778
2788
|
function TextareaGhost({ className, labelWidth = "26%", ...props }) {
|
|
2779
|
-
return /* @__PURE__ */ (0,
|
|
2789
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(FormFieldGhost, { className, labelWidth, multiline: true, ...props });
|
|
2780
2790
|
}
|
|
2781
2791
|
function LabelGhost({ className, width = "26%", ...props }) {
|
|
2782
|
-
return /* @__PURE__ */ (0,
|
|
2792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { className: cn("fractal-ghost-label", className), size: "sm", width, ...props });
|
|
2783
2793
|
}
|
|
2784
2794
|
function FormFieldGhost({ className, labelWidth = "26%", multiline = false, controlSize = "lg", ...props }) {
|
|
2785
|
-
return /* @__PURE__ */ (0,
|
|
2786
|
-
/* @__PURE__ */ (0,
|
|
2787
|
-
/* @__PURE__ */ (0,
|
|
2795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { "aria-hidden": "true", "data-control-size": controlSize, className: cn("fractal-ghost-field", className), ...props, children: [
|
|
2796
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(LabelGhost, { width: labelWidth }),
|
|
2797
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Ghost, { className: cn("fractal-ghost-field__control", multiline && "fractal-ghost-field__control--multiline") })
|
|
2788
2798
|
] });
|
|
2789
2799
|
}
|
|
2790
2800
|
function AlertGhost({ className, ...props }) {
|
|
2791
|
-
return /* @__PURE__ */ (0,
|
|
2792
|
-
/* @__PURE__ */ (0,
|
|
2793
|
-
/* @__PURE__ */ (0,
|
|
2801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { "aria-hidden": "true", className: cn("fractal-ghost-alert", className), ...props, children: [
|
|
2802
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { width: "30%" }),
|
|
2803
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { size: "sm", width: "78%" })
|
|
2794
2804
|
] });
|
|
2795
2805
|
}
|
|
2796
2806
|
function CheckboxGhost({ className, ...props }) {
|
|
2797
|
-
return /* @__PURE__ */ (0,
|
|
2798
|
-
/* @__PURE__ */ (0,
|
|
2799
|
-
/* @__PURE__ */ (0,
|
|
2807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { "aria-hidden": "true", className: cn("fractal-ghost-choice", className), ...props, children: [
|
|
2808
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Ghost, { className: "fractal-ghost-choice__control" }),
|
|
2809
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { width: "42%" })
|
|
2800
2810
|
] });
|
|
2801
2811
|
}
|
|
2802
2812
|
var ToggleGhost = CheckboxGhost;
|
|
2803
2813
|
function ChipGhost({ className, width = 74, ...props }) {
|
|
2804
|
-
return /* @__PURE__ */ (0,
|
|
2814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Ghost, { className: cn("fractal-ghost-chip", className), height: 24, width, ...props });
|
|
2805
2815
|
}
|
|
2806
2816
|
function LinkGhost({ className, width = 96, ...props }) {
|
|
2807
|
-
return /* @__PURE__ */ (0,
|
|
2817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { className: cn("fractal-ghost-link", className), size: "sm", width, ...props });
|
|
2808
2818
|
}
|
|
2809
2819
|
var TextButtonGhost = LinkGhost;
|
|
2810
2820
|
function DropdownGhost({ className, controlSize = "lg", ...props }) {
|
|
2811
|
-
return /* @__PURE__ */ (0,
|
|
2812
|
-
/* @__PURE__ */ (0,
|
|
2813
|
-
/* @__PURE__ */ (0,
|
|
2821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { "aria-hidden": "true", "data-control-size": controlSize, className: cn("fractal-ghost-dropdown", className), ...props, children: [
|
|
2822
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { width: "38%" }),
|
|
2823
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Ghost, { className: "fractal-ghost-dropdown__chevron" })
|
|
2814
2824
|
] });
|
|
2815
2825
|
}
|
|
2816
2826
|
function ContentSwitcherGhost({ className, options = 3, ...props }) {
|
|
2817
|
-
return /* @__PURE__ */ (0,
|
|
2827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { "aria-hidden": "true", className: cn("fractal-ghost-switcher", className), ...props, children: Array.from({ length: options }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Ghost, {}, index)) });
|
|
2818
2828
|
}
|
|
2819
2829
|
var TabsGhost = ContentSwitcherGhost;
|
|
2820
2830
|
function DisclosureGhost({ className, ...props }) {
|
|
2821
|
-
return /* @__PURE__ */ (0,
|
|
2822
|
-
/* @__PURE__ */ (0,
|
|
2823
|
-
/* @__PURE__ */ (0,
|
|
2831
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { "aria-hidden": "true", className: cn("fractal-ghost-disclosure", className), ...props, children: [
|
|
2832
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Ghost, { className: "fractal-ghost-disclosure__icon" }),
|
|
2833
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { width: "42%" })
|
|
2824
2834
|
] });
|
|
2825
2835
|
}
|
|
2826
2836
|
function PaginationGhost({ className, pages = 5, ...props }) {
|
|
2827
|
-
return /* @__PURE__ */ (0,
|
|
2837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { "aria-hidden": "true", className: cn("fractal-ghost-pagination", className), ...props, children: Array.from({ length: pages }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Ghost, {}, index)) });
|
|
2828
2838
|
}
|
|
2829
2839
|
function FileDropzoneGhost({ className, ...props }) {
|
|
2830
|
-
return /* @__PURE__ */ (0,
|
|
2831
|
-
/* @__PURE__ */ (0,
|
|
2832
|
-
/* @__PURE__ */ (0,
|
|
2833
|
-
/* @__PURE__ */ (0,
|
|
2840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { "aria-hidden": "true", className: cn("fractal-ghost-dropzone", className), ...props, children: [
|
|
2841
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Ghost, { className: "fractal-ghost-dropzone__icon" }),
|
|
2842
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { width: "26%" }),
|
|
2843
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { size: "sm", width: "46%" })
|
|
2834
2844
|
] });
|
|
2835
2845
|
}
|
|
2836
2846
|
function PromptCardGhost({ className, ...props }) {
|
|
2837
|
-
return /* @__PURE__ */ (0,
|
|
2847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CardGhost, { className: cn("fractal-ghost-prompt-card", className), lines: 4, ...props });
|
|
2838
2848
|
}
|
|
2839
2849
|
function ConversationGhost({
|
|
2840
2850
|
className,
|
|
2841
2851
|
"aria-label": ariaLabel = "Loading conversation",
|
|
2842
2852
|
...props
|
|
2843
2853
|
}) {
|
|
2844
|
-
return /* @__PURE__ */ (0,
|
|
2854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2845
2855
|
"div",
|
|
2846
2856
|
{
|
|
2847
2857
|
"aria-busy": "true",
|
|
@@ -2850,54 +2860,54 @@ function ConversationGhost({
|
|
|
2850
2860
|
role: "status",
|
|
2851
2861
|
...props,
|
|
2852
2862
|
children: [
|
|
2853
|
-
/* @__PURE__ */ (0,
|
|
2854
|
-
/* @__PURE__ */ (0,
|
|
2855
|
-
/* @__PURE__ */ (0,
|
|
2856
|
-
/* @__PURE__ */ (0,
|
|
2863
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { "aria-hidden": "true", className: "fractal-ghost-conversation__message fractal-ghost-conversation__message--user", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "fractal-ghost-conversation__bubble", children: [
|
|
2864
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { width: "100%" }),
|
|
2865
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { width: "86%" }),
|
|
2866
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { width: "64%" })
|
|
2857
2867
|
] }) }),
|
|
2858
|
-
/* @__PURE__ */ (0,
|
|
2859
|
-
/* @__PURE__ */ (0,
|
|
2860
|
-
/* @__PURE__ */ (0,
|
|
2861
|
-
/* @__PURE__ */ (0,
|
|
2868
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { "aria-hidden": "true", className: "fractal-ghost-conversation__message fractal-ghost-conversation__message--assistant", children: [
|
|
2869
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { width: "92%" }),
|
|
2870
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { width: "78%" }),
|
|
2871
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { width: "58%" })
|
|
2862
2872
|
] })
|
|
2863
2873
|
]
|
|
2864
2874
|
}
|
|
2865
2875
|
);
|
|
2866
2876
|
}
|
|
2867
2877
|
function SortableTableGhost(props) {
|
|
2868
|
-
return /* @__PURE__ */ (0,
|
|
2878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DataTableGhost, { ...props });
|
|
2869
2879
|
}
|
|
2870
2880
|
function SidebarGhost({ className, items = 6, ...props }) {
|
|
2871
|
-
return /* @__PURE__ */ (0,
|
|
2872
|
-
/* @__PURE__ */ (0,
|
|
2873
|
-
/* @__PURE__ */ (0,
|
|
2874
|
-
/* @__PURE__ */ (0,
|
|
2875
|
-
/* @__PURE__ */ (0,
|
|
2881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("aside", { "aria-hidden": "true", className: cn("fractal-ghost-sidebar", className), ...props, children: [
|
|
2882
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Ghost, { className: "fractal-ghost-sidebar__brand" }),
|
|
2883
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "fractal-ghost-sidebar__items", children: Array.from({ length: items }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "fractal-ghost-sidebar__item", children: [
|
|
2884
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Ghost, {}),
|
|
2885
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { width: `${[54, 68, 44, 61][index % 4]}%` })
|
|
2876
2886
|
] }, index)) })
|
|
2877
2887
|
] });
|
|
2878
2888
|
}
|
|
2879
2889
|
function ModalGhost({ className, title, lines = 3, ...props }) {
|
|
2880
|
-
return /* @__PURE__ */ (0,
|
|
2890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SurfaceGhost, { className: cn("fractal-ghost-modal", className), title, lines, ...props });
|
|
2881
2891
|
}
|
|
2882
2892
|
function SidePanelGhost({ className, title, lines = 5, ...props }) {
|
|
2883
|
-
return /* @__PURE__ */ (0,
|
|
2893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SurfaceGhost, { className: cn("fractal-ghost-side-panel", className), title, lines, ...props });
|
|
2884
2894
|
}
|
|
2885
2895
|
function SurfaceGhost({ className, title, lines = 3, ...props }) {
|
|
2886
|
-
return /* @__PURE__ */ (0,
|
|
2887
|
-
/* @__PURE__ */ (0,
|
|
2888
|
-
/* @__PURE__ */ (0,
|
|
2889
|
-
/* @__PURE__ */ (0,
|
|
2896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { "aria-hidden": "true", className: cn("fractal-ghost-surface", className), ...props, children: [
|
|
2897
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "fractal-ghost-surface__header", children: [
|
|
2898
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { width: "42%" }),
|
|
2899
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Ghost, { className: "fractal-ghost-surface__close" })
|
|
2890
2900
|
] }),
|
|
2891
|
-
title && /* @__PURE__ */ (0,
|
|
2892
|
-
/* @__PURE__ */ (0,
|
|
2901
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "fractal-ghost-surface__title", children: title }),
|
|
2902
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "fractal-ghost-stack", children: Array.from({ length: lines }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(GhostLine, { width: index === lines - 1 ? "64%" : "100%" }, index)) })
|
|
2893
2903
|
] });
|
|
2894
2904
|
}
|
|
2895
2905
|
|
|
2896
2906
|
// src/components/Sidebar/Sidebar.tsx
|
|
2897
2907
|
var React16 = __toESM(require("react"), 1);
|
|
2898
|
-
var
|
|
2908
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2899
2909
|
var Sidebar = React16.forwardRef(
|
|
2900
|
-
({ className, width, compact = false, style, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2910
|
+
({ className, width, compact = false, style, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2901
2911
|
"aside",
|
|
2902
2912
|
{
|
|
2903
2913
|
ref,
|
|
@@ -2910,11 +2920,11 @@ var Sidebar = React16.forwardRef(
|
|
|
2910
2920
|
);
|
|
2911
2921
|
Sidebar.displayName = "Sidebar";
|
|
2912
2922
|
var SidebarHeader = React16.forwardRef(
|
|
2913
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2923
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { ref, className: cn("fractal-sidebar__header", className), ...props })
|
|
2914
2924
|
);
|
|
2915
2925
|
SidebarHeader.displayName = "SidebarHeader";
|
|
2916
2926
|
var SidebarBrand = React16.forwardRef(
|
|
2917
|
-
({ className, type = "button", ...props }, ref) => /* @__PURE__ */ (0,
|
|
2927
|
+
({ className, type = "button", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { ref, type, className: cn("fractal-sidebar__brand", className), ...props })
|
|
2918
2928
|
);
|
|
2919
2929
|
SidebarBrand.displayName = "SidebarBrand";
|
|
2920
2930
|
function SidebarAccountMenu({
|
|
@@ -2925,7 +2935,7 @@ function SidebarAccountMenu({
|
|
|
2925
2935
|
icon,
|
|
2926
2936
|
className
|
|
2927
2937
|
}) {
|
|
2928
|
-
return /* @__PURE__ */ (0,
|
|
2938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2929
2939
|
Dropdown,
|
|
2930
2940
|
{
|
|
2931
2941
|
align: "left",
|
|
@@ -2935,9 +2945,9 @@ function SidebarAccountMenu({
|
|
|
2935
2945
|
panelClassName: "fractal-sidebar__account-panel",
|
|
2936
2946
|
selectedValue: "",
|
|
2937
2947
|
triggerClassName: "fractal-sidebar__account-trigger",
|
|
2938
|
-
triggerContent: /* @__PURE__ */ (0,
|
|
2939
|
-
icon && /* @__PURE__ */ (0,
|
|
2940
|
-
/* @__PURE__ */ (0,
|
|
2948
|
+
triggerContent: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
2949
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "fractal-sidebar__account-icon", "aria-hidden": "true", children: icon }),
|
|
2950
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "fractal-sidebar__account-name", children: name })
|
|
2941
2951
|
] }),
|
|
2942
2952
|
triggerLabel,
|
|
2943
2953
|
triggerVariant: "tertiary"
|
|
@@ -2945,15 +2955,15 @@ function SidebarAccountMenu({
|
|
|
2945
2955
|
);
|
|
2946
2956
|
}
|
|
2947
2957
|
var SidebarNav = React16.forwardRef(
|
|
2948
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2958
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("nav", { ref, className: cn("fractal-sidebar__nav", className), ...props })
|
|
2949
2959
|
);
|
|
2950
2960
|
SidebarNav.displayName = "SidebarNav";
|
|
2951
2961
|
var SidebarSection = React16.forwardRef(
|
|
2952
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2962
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { ref, className: cn("fractal-sidebar__section", className), ...props })
|
|
2953
2963
|
);
|
|
2954
2964
|
SidebarSection.displayName = "SidebarSection";
|
|
2955
2965
|
var SidebarNavItem = React16.forwardRef(
|
|
2956
|
-
({ active = false, icon, endAdornment, className, type = "button", children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2966
|
+
({ active = false, icon, endAdornment, className, type = "button", children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
2957
2967
|
"button",
|
|
2958
2968
|
{
|
|
2959
2969
|
ref,
|
|
@@ -2963,16 +2973,16 @@ var SidebarNavItem = React16.forwardRef(
|
|
|
2963
2973
|
"aria-current": active ? "page" : void 0,
|
|
2964
2974
|
...props,
|
|
2965
2975
|
children: [
|
|
2966
|
-
icon && /* @__PURE__ */ (0,
|
|
2967
|
-
/* @__PURE__ */ (0,
|
|
2968
|
-
endAdornment && /* @__PURE__ */ (0,
|
|
2976
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "fractal-sidebar__nav-item-icon", "aria-hidden": "true", children: icon }),
|
|
2977
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "fractal-sidebar__nav-item-label", children }),
|
|
2978
|
+
endAdornment && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "fractal-sidebar__nav-item-end", children: endAdornment })
|
|
2969
2979
|
]
|
|
2970
2980
|
}
|
|
2971
2981
|
)
|
|
2972
2982
|
);
|
|
2973
2983
|
SidebarNavItem.displayName = "SidebarNavItem";
|
|
2974
2984
|
var SidebarFooter = React16.forwardRef(
|
|
2975
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
2985
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { ref, className: cn("fractal-sidebar__footer", className), ...props })
|
|
2976
2986
|
);
|
|
2977
2987
|
SidebarFooter.displayName = "SidebarFooter";
|
|
2978
2988
|
|
|
@@ -2980,7 +2990,7 @@ SidebarFooter.displayName = "SidebarFooter";
|
|
|
2980
2990
|
var React17 = __toESM(require("react"), 1);
|
|
2981
2991
|
var import_react_dom4 = require("react-dom");
|
|
2982
2992
|
var import_fractal_icons14 = require("@mirror-physics/fractal-icons");
|
|
2983
|
-
var
|
|
2993
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2984
2994
|
function SidePanel({ open, onClose, title, description, children, footer, size = "md", loading = false, loadingLabel = "Loading", className }) {
|
|
2985
2995
|
useEscapeDismiss(80, onClose, open);
|
|
2986
2996
|
const bodyRef = React17.useRef(null);
|
|
@@ -3016,7 +3026,7 @@ function SidePanel({ open, onClose, title, description, children, footer, size =
|
|
|
3016
3026
|
}, [open, loading]);
|
|
3017
3027
|
if (!open) return null;
|
|
3018
3028
|
return (0, import_react_dom4.createPortal)(
|
|
3019
|
-
/* @__PURE__ */ (0,
|
|
3029
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "fractal-side-panel-overlay", onMouseDown: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
3020
3030
|
"aside",
|
|
3021
3031
|
{
|
|
3022
3032
|
className: cn("fractal-side-panel", `fractal-side-panel--${size}`, className),
|
|
@@ -3025,15 +3035,15 @@ function SidePanel({ open, onClose, title, description, children, footer, size =
|
|
|
3025
3035
|
role: "dialog",
|
|
3026
3036
|
onMouseDown: (event) => event.stopPropagation(),
|
|
3027
3037
|
children: [
|
|
3028
|
-
/* @__PURE__ */ (0,
|
|
3029
|
-
/* @__PURE__ */ (0,
|
|
3030
|
-
typeof title === "string" ? /* @__PURE__ */ (0,
|
|
3031
|
-
description && /* @__PURE__ */ (0,
|
|
3038
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("header", { className: "fractal-side-panel__header", "data-scroll-divider": scrollEdges.above, children: [
|
|
3039
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "fractal-side-panel__heading", children: [
|
|
3040
|
+
typeof title === "string" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("h2", { className: "fractal-side-panel__title", children: title }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "fractal-side-panel__title", children: title }),
|
|
3041
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "fractal-side-panel__description", children: description })
|
|
3032
3042
|
] }),
|
|
3033
|
-
/* @__PURE__ */ (0,
|
|
3043
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("button", { type: "button", className: "fractal-side-panel__close", "aria-label": "Close panel", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_fractal_icons14.Close, { size: 18 }) })
|
|
3034
3044
|
] }),
|
|
3035
|
-
/* @__PURE__ */ (0,
|
|
3036
|
-
footer && /* @__PURE__ */ (0,
|
|
3045
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { ref: bodyRef, "aria-busy": loading || void 0, className: cn("fractal-side-panel__body", loading && "fractal-side-panel__body--loading"), children: loading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(UILoader, { label: loadingLabel }) : children }),
|
|
3046
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("footer", { className: "fractal-side-panel__footer", "data-scroll-divider": scrollEdges.below, children: footer })
|
|
3037
3047
|
]
|
|
3038
3048
|
}
|
|
3039
3049
|
) }),
|
|
@@ -3043,12 +3053,12 @@ function SidePanel({ open, onClose, title, description, children, footer, size =
|
|
|
3043
3053
|
|
|
3044
3054
|
// src/components/Textarea/Textarea.tsx
|
|
3045
3055
|
var React18 = __toESM(require("react"), 1);
|
|
3046
|
-
var
|
|
3056
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3047
3057
|
var Textarea = React18.forwardRef(
|
|
3048
3058
|
({ className, fieldLabel, textStyle = "source", id, placeholder, ...props }, ref) => {
|
|
3049
3059
|
const generatedId = React18.useId();
|
|
3050
3060
|
const fieldId = id ?? generatedId;
|
|
3051
|
-
const input = /* @__PURE__ */ (0,
|
|
3061
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
3052
3062
|
"textarea",
|
|
3053
3063
|
{
|
|
3054
3064
|
ref,
|
|
@@ -3059,9 +3069,10 @@ var Textarea = React18.forwardRef(
|
|
|
3059
3069
|
...props
|
|
3060
3070
|
}
|
|
3061
3071
|
);
|
|
3062
|
-
return fieldLabel ? /* @__PURE__ */ (0,
|
|
3072
|
+
return fieldLabel ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "fractal-floating-field fractal-floating-field--textarea", "data-control-size": "md", children: [
|
|
3063
3073
|
input,
|
|
3064
|
-
/* @__PURE__ */ (0,
|
|
3074
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FloatingFieldBorder, { label: fieldLabel ?? "" }),
|
|
3075
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("label", { className: "fractal-floating-field__label", htmlFor: fieldId, children: fieldLabel })
|
|
3065
3076
|
] }) : input;
|
|
3066
3077
|
}
|
|
3067
3078
|
);
|
|
@@ -3069,9 +3080,9 @@ Textarea.displayName = "Textarea";
|
|
|
3069
3080
|
|
|
3070
3081
|
// src/components/TextButton/TextButton.tsx
|
|
3071
3082
|
var React19 = __toESM(require("react"), 1);
|
|
3072
|
-
var
|
|
3083
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3073
3084
|
var TextButton = React19.forwardRef(
|
|
3074
|
-
({ className, icon, iconPosition = "start", size = "md", tone = "primary", children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
3085
|
+
({ className, icon, iconPosition = "start", size = "md", tone = "primary", children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
3075
3086
|
"button",
|
|
3076
3087
|
{
|
|
3077
3088
|
ref,
|
|
@@ -3079,9 +3090,9 @@ var TextButton = React19.forwardRef(
|
|
|
3079
3090
|
type: "button",
|
|
3080
3091
|
...props,
|
|
3081
3092
|
children: [
|
|
3082
|
-
icon && iconPosition === "start" && /* @__PURE__ */ (0,
|
|
3083
|
-
/* @__PURE__ */ (0,
|
|
3084
|
-
icon && iconPosition === "end" && /* @__PURE__ */ (0,
|
|
3093
|
+
icon && iconPosition === "start" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "fractal-text-button__icon", "aria-hidden": "true", children: icon }),
|
|
3094
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children }),
|
|
3095
|
+
icon && iconPosition === "end" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "fractal-text-button__icon", "aria-hidden": "true", children: icon })
|
|
3085
3096
|
]
|
|
3086
3097
|
}
|
|
3087
3098
|
)
|
|
@@ -3091,7 +3102,7 @@ TextButton.displayName = "TextButton";
|
|
|
3091
3102
|
// src/components/FileDropzone/FileDropzone.tsx
|
|
3092
3103
|
var React20 = __toESM(require("react"), 1);
|
|
3093
3104
|
var import_fractal_icons15 = require("@mirror-physics/fractal-icons");
|
|
3094
|
-
var
|
|
3105
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3095
3106
|
function FileDropzone({
|
|
3096
3107
|
files,
|
|
3097
3108
|
onFilesChange,
|
|
@@ -3111,8 +3122,8 @@ function FileDropzone({
|
|
|
3111
3122
|
if (additions.length === 0) return;
|
|
3112
3123
|
onFilesChange(multiple ? [...files, ...additions] : additions.slice(0, 1));
|
|
3113
3124
|
};
|
|
3114
|
-
return /* @__PURE__ */ (0,
|
|
3115
|
-
/* @__PURE__ */ (0,
|
|
3125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: cn("fractal-file-dropzone", className), children: [
|
|
3126
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3116
3127
|
"input",
|
|
3117
3128
|
{
|
|
3118
3129
|
ref: inputRef,
|
|
@@ -3128,7 +3139,7 @@ function FileDropzone({
|
|
|
3128
3139
|
}
|
|
3129
3140
|
}
|
|
3130
3141
|
),
|
|
3131
|
-
/* @__PURE__ */ (0,
|
|
3142
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
3132
3143
|
"button",
|
|
3133
3144
|
{
|
|
3134
3145
|
className: "fractal-file-dropzone__target",
|
|
@@ -3151,18 +3162,18 @@ function FileDropzone({
|
|
|
3151
3162
|
addFiles(event.dataTransfer.files);
|
|
3152
3163
|
},
|
|
3153
3164
|
children: [
|
|
3154
|
-
/* @__PURE__ */ (0,
|
|
3155
|
-
/* @__PURE__ */ (0,
|
|
3156
|
-
/* @__PURE__ */ (0,
|
|
3157
|
-
description && /* @__PURE__ */ (0,
|
|
3165
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_fractal_icons15.FileArrowUp, { "aria-hidden": "true", size: 20 }),
|
|
3166
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "fractal-file-dropzone__copy", children: [
|
|
3167
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "fractal-file-dropzone__title", children: title }),
|
|
3168
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "fractal-file-dropzone__description", children: description })
|
|
3158
3169
|
] })
|
|
3159
3170
|
]
|
|
3160
3171
|
}
|
|
3161
3172
|
),
|
|
3162
|
-
files.length > 0 && /* @__PURE__ */ (0,
|
|
3163
|
-
/* @__PURE__ */ (0,
|
|
3164
|
-
/* @__PURE__ */ (0,
|
|
3165
|
-
/* @__PURE__ */ (0,
|
|
3173
|
+
files.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("ul", { className: "fractal-file-dropzone__files", "aria-label": "Attached files", children: files.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("li", { className: "fractal-file-dropzone__file", children: [
|
|
3174
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "fractal-file-dropzone__file-name", children: file.name }),
|
|
3175
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "fractal-file-dropzone__file-meta", children: formatFileSize(file.size) }),
|
|
3176
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3166
3177
|
"button",
|
|
3167
3178
|
{
|
|
3168
3179
|
className: "fractal-file-dropzone__remove",
|
|
@@ -3170,7 +3181,7 @@ function FileDropzone({
|
|
|
3170
3181
|
"aria-label": `Remove ${file.name}`,
|
|
3171
3182
|
disabled,
|
|
3172
3183
|
onClick: () => onFilesChange(files.filter((_, fileIndex) => fileIndex !== index)),
|
|
3173
|
-
children: /* @__PURE__ */ (0,
|
|
3184
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_fractal_icons15.Close, { "aria-hidden": "true", size: 14 })
|
|
3174
3185
|
}
|
|
3175
3186
|
)
|
|
3176
3187
|
] }, `${file.name}-${file.size}-${index}`)) })
|
|
@@ -3184,7 +3195,7 @@ function formatFileSize(bytes) {
|
|
|
3184
3195
|
|
|
3185
3196
|
// src/components/Pagination/Pagination.tsx
|
|
3186
3197
|
var import_fractal_icons16 = require("@mirror-physics/fractal-icons");
|
|
3187
|
-
var
|
|
3198
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3188
3199
|
function Pagination({
|
|
3189
3200
|
page,
|
|
3190
3201
|
pageSize,
|
|
@@ -3200,10 +3211,10 @@ function Pagination({
|
|
|
3200
3211
|
const start = totalItems === 0 ? 0 : (currentPage - 1) * pageSize + 1;
|
|
3201
3212
|
const end = Math.min(currentPage * pageSize, totalItems);
|
|
3202
3213
|
const canChangePageSize = pageSizeOptions != null && pageSizeOptions.length > 0 && onPageSizeChange != null;
|
|
3203
|
-
return /* @__PURE__ */ (0,
|
|
3204
|
-
/* @__PURE__ */ (0,
|
|
3205
|
-
/* @__PURE__ */ (0,
|
|
3206
|
-
canChangePageSize && /* @__PURE__ */ (0,
|
|
3214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("nav", { className: cn("fractal-pagination", className), "aria-label": ariaLabel, children: [
|
|
3215
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "fractal-pagination__summary", children: totalItems === 0 ? "No results" : `${start}-${end} of ${totalItems}` }),
|
|
3216
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "fractal-pagination__controls", children: [
|
|
3217
|
+
canChangePageSize && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3207
3218
|
Dropdown,
|
|
3208
3219
|
{
|
|
3209
3220
|
align: "right",
|
|
@@ -3220,7 +3231,7 @@ function Pagination({
|
|
|
3220
3231
|
triggerVariant: "tertiary"
|
|
3221
3232
|
}
|
|
3222
3233
|
),
|
|
3223
|
-
/* @__PURE__ */ (0,
|
|
3234
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3224
3235
|
"button",
|
|
3225
3236
|
{
|
|
3226
3237
|
className: "fractal-pagination__button",
|
|
@@ -3229,15 +3240,15 @@ function Pagination({
|
|
|
3229
3240
|
title: "Previous page",
|
|
3230
3241
|
disabled: currentPage === 1 || totalItems === 0,
|
|
3231
3242
|
onClick: () => onPageChange(currentPage - 1),
|
|
3232
|
-
children: /* @__PURE__ */ (0,
|
|
3243
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_fractal_icons16.ArrowLeft, { "aria-hidden": "true", size: 16 })
|
|
3233
3244
|
}
|
|
3234
3245
|
),
|
|
3235
|
-
/* @__PURE__ */ (0,
|
|
3246
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "fractal-pagination__page", "aria-current": "page", children: [
|
|
3236
3247
|
currentPage,
|
|
3237
3248
|
" of ",
|
|
3238
3249
|
totalPages
|
|
3239
3250
|
] }),
|
|
3240
|
-
/* @__PURE__ */ (0,
|
|
3251
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3241
3252
|
"button",
|
|
3242
3253
|
{
|
|
3243
3254
|
className: "fractal-pagination__button",
|
|
@@ -3246,7 +3257,7 @@ function Pagination({
|
|
|
3246
3257
|
title: "Next page",
|
|
3247
3258
|
disabled: currentPage === totalPages || totalItems === 0,
|
|
3248
3259
|
onClick: () => onPageChange(currentPage + 1),
|
|
3249
|
-
children: /* @__PURE__ */ (0,
|
|
3260
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_fractal_icons16.ArrowRight, { "aria-hidden": "true", size: 16 })
|
|
3250
3261
|
}
|
|
3251
3262
|
)
|
|
3252
3263
|
] })
|
|
@@ -3256,7 +3267,7 @@ function Pagination({
|
|
|
3256
3267
|
// src/components/ColumnEditor/ColumnEditor.tsx
|
|
3257
3268
|
var React21 = __toESM(require("react"), 1);
|
|
3258
3269
|
var import_fractal_icons17 = require("@mirror-physics/fractal-icons");
|
|
3259
|
-
var
|
|
3270
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3260
3271
|
var equal = (a, b) => a.length === b.length && a.every((id, index) => id === b[index]);
|
|
3261
3272
|
function ColumnEditor({ items, value, onChange, label = "Edit columns", hiddenLabel = "Hidden columns", className }) {
|
|
3262
3273
|
const [open, setOpen] = React21.useState(false);
|
|
@@ -3396,7 +3407,7 @@ function ColumnEditor({ items, value, onChange, label = "Edit columns", hiddenLa
|
|
|
3396
3407
|
}
|
|
3397
3408
|
function row(key, isHidden, index) {
|
|
3398
3409
|
const item = items.find((item2) => item2.id === key);
|
|
3399
|
-
return /* @__PURE__ */ (0,
|
|
3410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
3400
3411
|
"li",
|
|
3401
3412
|
{
|
|
3402
3413
|
className: "fractal-column-editor__row",
|
|
@@ -3405,40 +3416,40 @@ function ColumnEditor({ items, value, onChange, label = "Edit columns", hiddenLa
|
|
|
3405
3416
|
"data-dragging": preview?.active === key || void 0,
|
|
3406
3417
|
onPointerDown: (event) => start(event, key),
|
|
3407
3418
|
children: [
|
|
3408
|
-
/* @__PURE__ */ (0,
|
|
3409
|
-
/* @__PURE__ */ (0,
|
|
3410
|
-
/* @__PURE__ */ (0,
|
|
3411
|
-
/* @__PURE__ */ (0,
|
|
3412
|
-
/* @__PURE__ */ (0,
|
|
3419
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_fractal_icons17.DotsSixVertical, { className: "fractal-column-editor__grip", "aria-hidden": "true" }),
|
|
3420
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "fractal-column-editor__name", children: item.label }),
|
|
3421
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "fractal-column-editor__actions", onPointerDown: (event) => event.stopPropagation(), children: isHidden ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Button, { buttonType: "ghost", controlSize: "sm", hasIconOnly: true, icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_fractal_icons17.Eye, { "aria-hidden": "true" }), "aria-label": `Show ${item.label} column`, onClick: () => commit([...committed, key], `${item.label} shown`) }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
|
|
3422
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Button, { buttonType: "ghost", controlSize: "sm", hasIconOnly: true, icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_fractal_icons17.ArrowUp, { "aria-hidden": "true" }), "aria-label": `Move ${item.label} up`, disabled: index === 0, onClick: () => move(key, -1) }),
|
|
3423
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Button, { buttonType: "ghost", controlSize: "sm", hasIconOnly: true, icon: index === visible.length - 1 && !item.required ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_fractal_icons17.EyeSlash, { "aria-hidden": "true" }) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_fractal_icons17.ArrowDown, { "aria-hidden": "true" }), "aria-label": index === visible.length - 1 && !item.required ? `Hide ${item.label} column` : `Move ${item.label} down`, disabled: index === visible.length - 1 && item.required, onClick: () => move(key, 1) })
|
|
3413
3424
|
] }) })
|
|
3414
3425
|
]
|
|
3415
3426
|
},
|
|
3416
3427
|
key
|
|
3417
3428
|
);
|
|
3418
3429
|
}
|
|
3419
|
-
return /* @__PURE__ */ (0,
|
|
3420
|
-
/* @__PURE__ */ (0,
|
|
3430
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: cn("fractal-column-editor", className), ref: root, children: [
|
|
3431
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Button, { ref: trigger, controlSize: "lg", buttonType: "secondary", icon: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_fractal_icons17.Gear, { "aria-hidden": "true" }), iconPosition: "right", "aria-haspopup": "dialog", "aria-expanded": open, "aria-controls": id, onClick: () => {
|
|
3421
3432
|
cancel();
|
|
3422
3433
|
setOpen((current) => !current);
|
|
3423
3434
|
}, children: label }),
|
|
3424
|
-
open ? /* @__PURE__ */ (0,
|
|
3425
|
-
/* @__PURE__ */ (0,
|
|
3426
|
-
/* @__PURE__ */ (0,
|
|
3427
|
-
/* @__PURE__ */ (0,
|
|
3435
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { id, className: "fractal-column-editor__panel", ref: panel, role: "dialog", "data-dragging": Boolean(preview) || void 0, "aria-label": label, tabIndex: -1, onPointerMove: update, onPointerUp: finish, onPointerCancel: cancel, onLostPointerCapture: cancel, children: [
|
|
3436
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("ol", { className: "fractal-column-editor__list", "data-column-editor-group": "visible", "aria-label": "Visible columns", children: visible.map((key, index) => row(key, false, index)) }),
|
|
3437
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("section", { "data-column-editor-group": "hidden", className: "fractal-column-editor__hidden", "aria-label": hiddenLabel, children: [
|
|
3438
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "fractal-column-editor__divider", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("span", { children: [
|
|
3428
3439
|
hiddenLabel,
|
|
3429
|
-
/* @__PURE__ */ (0,
|
|
3440
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_fractal_icons17.EyeSlash, { "aria-hidden": "true" })
|
|
3430
3441
|
] }) }),
|
|
3431
|
-
/* @__PURE__ */ (0,
|
|
3432
|
-
!hidden.length ? /* @__PURE__ */ (0,
|
|
3442
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("ol", { className: "fractal-column-editor__list", children: hidden.map((key, index) => row(key, true, index)) }),
|
|
3443
|
+
!hidden.length ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "fractal-column-editor__empty", children: "Drag columns here to hide them." }) : null
|
|
3433
3444
|
] }),
|
|
3434
|
-
/* @__PURE__ */ (0,
|
|
3445
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "fractal-column-editor__announcement", role: "status", "aria-live": "polite", children: announcement })
|
|
3435
3446
|
] }) : null
|
|
3436
3447
|
] });
|
|
3437
3448
|
}
|
|
3438
3449
|
|
|
3439
3450
|
// src/components/Tooltip/Tooltip.tsx
|
|
3440
3451
|
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
3441
|
-
var
|
|
3452
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3442
3453
|
function Tooltip({
|
|
3443
3454
|
content,
|
|
3444
3455
|
children,
|
|
@@ -3449,9 +3460,9 @@ function Tooltip({
|
|
|
3449
3460
|
className
|
|
3450
3461
|
}) {
|
|
3451
3462
|
if (disabled || content == null || content === "") return children;
|
|
3452
|
-
return /* @__PURE__ */ (0,
|
|
3453
|
-
/* @__PURE__ */ (0,
|
|
3454
|
-
/* @__PURE__ */ (0,
|
|
3463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TooltipPrimitive.Provider, { delayDuration: delay, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(TooltipPrimitive.Root, { children: [
|
|
3464
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TooltipPrimitive.Trigger, { asChild: true, children }),
|
|
3465
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
3455
3466
|
TooltipPrimitive.Content,
|
|
3456
3467
|
{
|
|
3457
3468
|
side: placement,
|
|
@@ -3459,7 +3470,10 @@ function Tooltip({
|
|
|
3459
3470
|
collisionPadding: 8,
|
|
3460
3471
|
className: cn("fractal-tooltip", className),
|
|
3461
3472
|
style: { "--tooltip-max-width": typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth },
|
|
3462
|
-
children:
|
|
3473
|
+
children: [
|
|
3474
|
+
content,
|
|
3475
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(TooltipPrimitive.Arrow, { className: "fractal-tooltip-arrow", width: 8, height: 4, "aria-hidden": "true" })
|
|
3476
|
+
]
|
|
3463
3477
|
}
|
|
3464
3478
|
) })
|
|
3465
3479
|
] }) });
|