@objectifthunes/whiteboard 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +709 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +325 -2
- package/dist/index.d.ts +325 -2
- package/dist/index.js +649 -0
- package/dist/index.js.map +1 -1
- package/dist/whiteboard.css +751 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -79,6 +79,22 @@ function X({ size, ...props }) {
|
|
|
79
79
|
/* @__PURE__ */ jsx("path", { d: "m6 6 12 12" })
|
|
80
80
|
] });
|
|
81
81
|
}
|
|
82
|
+
function Moon({ size, ...props }) {
|
|
83
|
+
return /* @__PURE__ */ jsx("svg", { ...defaults(size), ...props, children: /* @__PURE__ */ jsx("path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" }) });
|
|
84
|
+
}
|
|
85
|
+
function Sun({ size, ...props }) {
|
|
86
|
+
return /* @__PURE__ */ jsxs("svg", { ...defaults(size), ...props, children: [
|
|
87
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "4" }),
|
|
88
|
+
/* @__PURE__ */ jsx("path", { d: "M12 2v2" }),
|
|
89
|
+
/* @__PURE__ */ jsx("path", { d: "M12 20v2" }),
|
|
90
|
+
/* @__PURE__ */ jsx("path", { d: "m4.93 4.93 1.41 1.41" }),
|
|
91
|
+
/* @__PURE__ */ jsx("path", { d: "m17.66 17.66 1.41 1.41" }),
|
|
92
|
+
/* @__PURE__ */ jsx("path", { d: "M2 12h2" }),
|
|
93
|
+
/* @__PURE__ */ jsx("path", { d: "M20 12h2" }),
|
|
94
|
+
/* @__PURE__ */ jsx("path", { d: "m6.34 17.66-1.41 1.41" }),
|
|
95
|
+
/* @__PURE__ */ jsx("path", { d: "m19.07 4.93-1.41 1.41" })
|
|
96
|
+
] });
|
|
97
|
+
}
|
|
82
98
|
|
|
83
99
|
// src/store.ts
|
|
84
100
|
import { create } from "zustand";
|
|
@@ -878,11 +894,644 @@ function useWhiteboardLayout({
|
|
|
878
894
|
function cn(...args) {
|
|
879
895
|
return args.filter(Boolean).join(" ");
|
|
880
896
|
}
|
|
897
|
+
|
|
898
|
+
// src/Alert.tsx
|
|
899
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
900
|
+
var toneClasses = {
|
|
901
|
+
error: "status-error",
|
|
902
|
+
muted: "text-sm text-muted",
|
|
903
|
+
info: "ui-alert ui-alert--info",
|
|
904
|
+
success: "ui-alert ui-alert--success"
|
|
905
|
+
};
|
|
906
|
+
function Alert({ tone = "info", className, ...props }) {
|
|
907
|
+
return /* @__PURE__ */ jsx8("p", { className: cn(toneClasses[tone], className), ...props });
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
// src/Button.tsx
|
|
911
|
+
import { forwardRef } from "react";
|
|
912
|
+
import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
913
|
+
var variantClasses = {
|
|
914
|
+
primary: "",
|
|
915
|
+
secondary: "secondary-btn",
|
|
916
|
+
danger: "danger-btn"
|
|
917
|
+
};
|
|
918
|
+
var Button = forwardRef(function Button2({
|
|
919
|
+
variant = "primary",
|
|
920
|
+
fullWidth = false,
|
|
921
|
+
iconOnly = false,
|
|
922
|
+
loading = false,
|
|
923
|
+
disabled,
|
|
924
|
+
className,
|
|
925
|
+
children,
|
|
926
|
+
loadingText,
|
|
927
|
+
...props
|
|
928
|
+
}, ref) {
|
|
929
|
+
return /* @__PURE__ */ jsx9(
|
|
930
|
+
"button",
|
|
931
|
+
{
|
|
932
|
+
ref,
|
|
933
|
+
className: cn(variantClasses[variant], fullWidth && "full-width-btn", iconOnly && "icon-only-btn", className),
|
|
934
|
+
disabled: disabled || loading,
|
|
935
|
+
...props,
|
|
936
|
+
children: loading ? /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
937
|
+
/* @__PURE__ */ jsx9(Loader2, { size: 14, className: "icon-spin" }),
|
|
938
|
+
loadingText || children
|
|
939
|
+
] }) : children
|
|
940
|
+
}
|
|
941
|
+
);
|
|
942
|
+
});
|
|
943
|
+
|
|
944
|
+
// src/ButtonRow.tsx
|
|
945
|
+
import { createElement } from "react";
|
|
946
|
+
function ButtonRow({ as = "div", className, ...props }) {
|
|
947
|
+
return createElement(as, {
|
|
948
|
+
className: cn("button-row", className),
|
|
949
|
+
...props
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
// src/Chip.tsx
|
|
954
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
955
|
+
function Chip({ className, ...props }) {
|
|
956
|
+
return /* @__PURE__ */ jsx10("span", { className: cn("chip", className), ...props });
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
// src/ChoiceCard.tsx
|
|
960
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
961
|
+
function ChoiceCard({ active = false, className, ...props }) {
|
|
962
|
+
return /* @__PURE__ */ jsx11(
|
|
963
|
+
"button",
|
|
964
|
+
{
|
|
965
|
+
type: "button",
|
|
966
|
+
className: cn("choice-card", className),
|
|
967
|
+
"data-active": active,
|
|
968
|
+
...props
|
|
969
|
+
}
|
|
970
|
+
);
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
// src/List.tsx
|
|
974
|
+
import { createElement as createElement2 } from "react";
|
|
975
|
+
function List({ as = "ul", reset = true, className, ...props }) {
|
|
976
|
+
return createElement2(as, {
|
|
977
|
+
className: cn(reset && "list-reset", className),
|
|
978
|
+
...props
|
|
979
|
+
});
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
// src/Skeleton.tsx
|
|
983
|
+
import { createElement as createElement3 } from "react";
|
|
984
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
985
|
+
var radiusClasses = {
|
|
986
|
+
sm: "",
|
|
987
|
+
md: "skeleton--md",
|
|
988
|
+
pill: "skeleton--pill"
|
|
989
|
+
};
|
|
990
|
+
function Skeleton({ as = "div", radius = "sm", className, ...props }) {
|
|
991
|
+
return createElement3(as, {
|
|
992
|
+
className: cn("skeleton", radiusClasses[radius], className),
|
|
993
|
+
"aria-hidden": true,
|
|
994
|
+
...props
|
|
995
|
+
});
|
|
996
|
+
}
|
|
997
|
+
function InputSkeleton(props) {
|
|
998
|
+
const { className, ...rest } = props;
|
|
999
|
+
return /* @__PURE__ */ jsx12(Skeleton, { className: cn("skeleton-input", className), ...rest });
|
|
1000
|
+
}
|
|
1001
|
+
function ButtonSkeleton(props) {
|
|
1002
|
+
const { className, ...rest } = props;
|
|
1003
|
+
return /* @__PURE__ */ jsx12(Skeleton, { className: cn("skeleton-btn", className), ...rest });
|
|
1004
|
+
}
|
|
1005
|
+
function IconButtonSkeleton(props) {
|
|
1006
|
+
const { className, ...rest } = props;
|
|
1007
|
+
return /* @__PURE__ */ jsx12(Skeleton, { className: cn("skeleton-icon-btn", className), ...rest });
|
|
1008
|
+
}
|
|
1009
|
+
function SelectSkeleton(props) {
|
|
1010
|
+
const { className, ...rest } = props;
|
|
1011
|
+
return /* @__PURE__ */ jsx12(Skeleton, { className: cn("skeleton-select", className), ...rest });
|
|
1012
|
+
}
|
|
1013
|
+
function TextareaSkeleton(props) {
|
|
1014
|
+
const { className, ...rest } = props;
|
|
1015
|
+
return /* @__PURE__ */ jsx12(Skeleton, { className: cn("skeleton-textarea", className), ...rest });
|
|
1016
|
+
}
|
|
1017
|
+
function ThumbSkeleton(props) {
|
|
1018
|
+
const { className, ...rest } = props;
|
|
1019
|
+
return /* @__PURE__ */ jsx12(Skeleton, { className: cn("skeleton-thumb", className), ...rest });
|
|
1020
|
+
}
|
|
1021
|
+
function ChipSkeleton(props) {
|
|
1022
|
+
const { className, ...rest } = props;
|
|
1023
|
+
return /* @__PURE__ */ jsx12(Skeleton, { radius: "pill", className: cn("skeleton-chip", className), ...rest });
|
|
1024
|
+
}
|
|
1025
|
+
function TitleSkeleton(props) {
|
|
1026
|
+
const { className, ...rest } = props;
|
|
1027
|
+
return /* @__PURE__ */ jsx12(Skeleton, { className: cn("skeleton-title", className), ...rest });
|
|
1028
|
+
}
|
|
1029
|
+
function LineSkeleton({ short = false, className, ...props }) {
|
|
1030
|
+
return /* @__PURE__ */ jsx12(Skeleton, { className: cn("skeleton-line", short && "skeleton-line--short", className), ...props });
|
|
1031
|
+
}
|
|
1032
|
+
function AvatarSkeleton(props) {
|
|
1033
|
+
const { className, ...rest } = props;
|
|
1034
|
+
return /* @__PURE__ */ jsx12(Skeleton, { radius: "pill", className: cn("skeleton-avatar", className), ...rest });
|
|
1035
|
+
}
|
|
1036
|
+
function CanvasSkeleton(props) {
|
|
1037
|
+
const { className, ...rest } = props;
|
|
1038
|
+
return /* @__PURE__ */ jsx12(Skeleton, { className: cn("skeleton-canvas", className), ...rest });
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
// src/ChoiceGroup.tsx
|
|
1042
|
+
import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1043
|
+
function ChoiceGroup({
|
|
1044
|
+
options,
|
|
1045
|
+
value,
|
|
1046
|
+
onChange,
|
|
1047
|
+
className
|
|
1048
|
+
}) {
|
|
1049
|
+
return /* @__PURE__ */ jsx13(List, { className: cn("choice-list", className), children: options.map((option) => /* @__PURE__ */ jsx13("li", { children: /* @__PURE__ */ jsx13(
|
|
1050
|
+
ChoiceCard,
|
|
1051
|
+
{
|
|
1052
|
+
active: value === option.value,
|
|
1053
|
+
onClick: () => onChange(option.value),
|
|
1054
|
+
disabled: option.disabled,
|
|
1055
|
+
"data-has-description": option.description ? "true" : "false",
|
|
1056
|
+
children: option.description ? /* @__PURE__ */ jsxs9("span", { className: "choice-card__row", children: [
|
|
1057
|
+
/* @__PURE__ */ jsx13("span", { className: "choice-card__label", children: option.label }),
|
|
1058
|
+
/* @__PURE__ */ jsx13("span", { className: "choice-card__description", children: option.description })
|
|
1059
|
+
] }) : /* @__PURE__ */ jsx13("span", { className: "choice-card__label", children: option.label })
|
|
1060
|
+
}
|
|
1061
|
+
) }, option.value)) });
|
|
1062
|
+
}
|
|
1063
|
+
function ChoiceGroupSkeleton({ count = 4, className, withDescription = false }) {
|
|
1064
|
+
return /* @__PURE__ */ jsx13(List, { className: cn("choice-list", className), "aria-hidden": true, children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ jsx13("li", { children: /* @__PURE__ */ jsxs9("div", { className: "choice-card", children: [
|
|
1065
|
+
/* @__PURE__ */ jsx13(TitleSkeleton, { className: cn("skeleton-title--sm", !withDescription && "skeleton-choice-label") }),
|
|
1066
|
+
withDescription ? /* @__PURE__ */ jsx13(LineSkeleton, { short: true }) : null
|
|
1067
|
+
] }) }, `choice-skeleton-${i}`)) });
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
// src/CoordGrid.tsx
|
|
1071
|
+
import { jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1072
|
+
function CoordGrid({ className, ...props }) {
|
|
1073
|
+
return /* @__PURE__ */ jsx14("div", { className: cn("coord-grid", className), ...props });
|
|
1074
|
+
}
|
|
1075
|
+
function CoordInput({ axis, className, ...props }) {
|
|
1076
|
+
return /* @__PURE__ */ jsxs10("label", { className: cn("coord-input", className), children: [
|
|
1077
|
+
axis,
|
|
1078
|
+
" ",
|
|
1079
|
+
/* @__PURE__ */ jsx14("input", { type: "number", step: "0.01", ...props })
|
|
1080
|
+
] });
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
// src/Stack.tsx
|
|
1084
|
+
import { createElement as createElement4 } from "react";
|
|
1085
|
+
function Stack({
|
|
1086
|
+
as,
|
|
1087
|
+
size = "md",
|
|
1088
|
+
className,
|
|
1089
|
+
...props
|
|
1090
|
+
}) {
|
|
1091
|
+
return createElement4(as ?? "div", {
|
|
1092
|
+
className: cn(size === "sm" ? "panel-stack-sm" : "panel-stack", className),
|
|
1093
|
+
...props
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
// src/Typography.tsx
|
|
1098
|
+
import { createElement as createElement5 } from "react";
|
|
1099
|
+
var mutedSizeClasses = {
|
|
1100
|
+
xs: "text-xs",
|
|
1101
|
+
sm: "text-sm",
|
|
1102
|
+
md: ""
|
|
1103
|
+
};
|
|
1104
|
+
function AssetTitle({ as = "p", clamp = false, className, ...props }) {
|
|
1105
|
+
return createElement5(as, {
|
|
1106
|
+
className: cn("asset-title", clamp && "asset-title--clamp", className),
|
|
1107
|
+
...props
|
|
1108
|
+
});
|
|
1109
|
+
}
|
|
1110
|
+
function StoryTitle({ as = "h3", className, ...props }) {
|
|
1111
|
+
return createElement5(as, {
|
|
1112
|
+
className: cn("story-title", className),
|
|
1113
|
+
...props
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
1116
|
+
function MutedText({ as = "p", size = "sm", className, ...props }) {
|
|
1117
|
+
return createElement5(as, {
|
|
1118
|
+
className: cn(mutedSizeClasses[size], "text-muted", className),
|
|
1119
|
+
...props
|
|
1120
|
+
});
|
|
1121
|
+
}
|
|
1122
|
+
function PageTitle({ as = "h1", className, ...props }) {
|
|
1123
|
+
return createElement5(as, {
|
|
1124
|
+
className: cn("page-title", className),
|
|
1125
|
+
...props
|
|
1126
|
+
});
|
|
1127
|
+
}
|
|
1128
|
+
function SectionTitle({ as = "span", className, ...props }) {
|
|
1129
|
+
return createElement5(as, {
|
|
1130
|
+
className: cn("widget-section__title", className),
|
|
1131
|
+
...props
|
|
1132
|
+
});
|
|
1133
|
+
}
|
|
1134
|
+
function SectionDescription({ as = "p", className, ...props }) {
|
|
1135
|
+
return createElement5(as, {
|
|
1136
|
+
className: cn("widget-section__description", className),
|
|
1137
|
+
...props
|
|
1138
|
+
});
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
// src/EmptyState.tsx
|
|
1142
|
+
import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1143
|
+
function EmptyState({ title, description, action }) {
|
|
1144
|
+
return /* @__PURE__ */ jsxs11(Stack, { size: "sm", children: [
|
|
1145
|
+
/* @__PURE__ */ jsx15(AssetTitle, { children: title }),
|
|
1146
|
+
description ? /* @__PURE__ */ jsx15(MutedText, { children: description }) : null,
|
|
1147
|
+
action
|
|
1148
|
+
] });
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
// src/Field.tsx
|
|
1152
|
+
import { createElement as createElement6 } from "react";
|
|
1153
|
+
|
|
1154
|
+
// src/Label.tsx
|
|
1155
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1156
|
+
function Label({ className, ...props }) {
|
|
1157
|
+
return /* @__PURE__ */ jsx16("label", { className: cn("widget-label", className), ...props });
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
// src/Field.tsx
|
|
1161
|
+
import { Fragment as Fragment4, jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1162
|
+
function Field({
|
|
1163
|
+
as,
|
|
1164
|
+
label,
|
|
1165
|
+
htmlFor,
|
|
1166
|
+
hint,
|
|
1167
|
+
error,
|
|
1168
|
+
layout = "stack",
|
|
1169
|
+
className,
|
|
1170
|
+
children,
|
|
1171
|
+
...props
|
|
1172
|
+
}) {
|
|
1173
|
+
return createElement6(
|
|
1174
|
+
as ?? "div",
|
|
1175
|
+
{
|
|
1176
|
+
className: cn(layout === "control" ? "widget-control" : "panel-stack-sm", className),
|
|
1177
|
+
...props
|
|
1178
|
+
},
|
|
1179
|
+
/* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
1180
|
+
label ? /* @__PURE__ */ jsx17(Label, { htmlFor, children: label }) : null,
|
|
1181
|
+
children,
|
|
1182
|
+
hint ? /* @__PURE__ */ jsx17(MutedText, { size: "xs", children: hint }) : null,
|
|
1183
|
+
error ? /* @__PURE__ */ jsx17("p", { className: "field-error", children: error }) : null
|
|
1184
|
+
] })
|
|
1185
|
+
);
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
// src/GeneratingOverlay.tsx
|
|
1189
|
+
import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1190
|
+
function GeneratingOverlay({ isGenerating, children, message }) {
|
|
1191
|
+
return /* @__PURE__ */ jsxs13("div", { className: "generating-overlay-wrap", children: [
|
|
1192
|
+
children,
|
|
1193
|
+
isGenerating && /* @__PURE__ */ jsxs13("div", { className: "generating-overlay", "aria-live": "polite", children: [
|
|
1194
|
+
/* @__PURE__ */ jsx18(Loader2, { size: 20, className: "icon-spin" }),
|
|
1195
|
+
/* @__PURE__ */ jsx18("span", { children: message ?? "Generating, please wait\u2026" })
|
|
1196
|
+
] })
|
|
1197
|
+
] });
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
// src/IconText.tsx
|
|
1201
|
+
import { createElement as createElement7 } from "react";
|
|
1202
|
+
import { Fragment as Fragment5, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1203
|
+
function IconText({ as = "span", icon, className, children, ...props }) {
|
|
1204
|
+
return createElement7(
|
|
1205
|
+
as,
|
|
1206
|
+
{
|
|
1207
|
+
className: cn("inline-row", className),
|
|
1208
|
+
...props
|
|
1209
|
+
},
|
|
1210
|
+
/* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
1211
|
+
icon,
|
|
1212
|
+
children
|
|
1213
|
+
] })
|
|
1214
|
+
);
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
// src/ImageThumb.tsx
|
|
1218
|
+
import { useState as useState2 } from "react";
|
|
1219
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1220
|
+
function ImageThumb({
|
|
1221
|
+
src,
|
|
1222
|
+
alt,
|
|
1223
|
+
placeholder = "No image",
|
|
1224
|
+
size = "md",
|
|
1225
|
+
fit = "contain",
|
|
1226
|
+
onImageError,
|
|
1227
|
+
className,
|
|
1228
|
+
...props
|
|
1229
|
+
}) {
|
|
1230
|
+
const [failedSrc, setFailedSrc] = useState2(null);
|
|
1231
|
+
const failed = Boolean(src && failedSrc === src);
|
|
1232
|
+
const classes = cn("image-thumb", `image-thumb--${size}`, `image-thumb--fit-${fit}`, className);
|
|
1233
|
+
return /* @__PURE__ */ jsx19("div", { className: classes, ...props, children: src && !failed ? /* @__PURE__ */ jsx19(
|
|
1234
|
+
"img",
|
|
1235
|
+
{
|
|
1236
|
+
src,
|
|
1237
|
+
alt,
|
|
1238
|
+
className: "image-thumb__img",
|
|
1239
|
+
style: { objectFit: fit, objectPosition: "center" },
|
|
1240
|
+
onError: () => {
|
|
1241
|
+
setFailedSrc(src);
|
|
1242
|
+
onImageError?.();
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
) : /* @__PURE__ */ jsx19("span", { className: "image-thumb__placeholder", children: placeholder }) });
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
// src/Inline.tsx
|
|
1249
|
+
import { createElement as createElement8 } from "react";
|
|
1250
|
+
function Inline({
|
|
1251
|
+
as,
|
|
1252
|
+
justify = "start",
|
|
1253
|
+
className,
|
|
1254
|
+
...props
|
|
1255
|
+
}) {
|
|
1256
|
+
return createElement8(as ?? "div", {
|
|
1257
|
+
className: cn(justify === "between" ? "space-between" : "inline-row", className),
|
|
1258
|
+
...props
|
|
1259
|
+
});
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
// src/Input.tsx
|
|
1263
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
1264
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1265
|
+
var Input = forwardRef2(function Input2({ className, ...props }, ref) {
|
|
1266
|
+
return /* @__PURE__ */ jsx20("input", { ref, className: cn(className), ...props });
|
|
1267
|
+
});
|
|
1268
|
+
|
|
1269
|
+
// src/ItemCard.tsx
|
|
1270
|
+
import { createElement as createElement9 } from "react";
|
|
1271
|
+
function ItemCard({ as = "div", className, ...props }) {
|
|
1272
|
+
return createElement9(as, {
|
|
1273
|
+
className: cn("item-card", className),
|
|
1274
|
+
...props
|
|
1275
|
+
});
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
// src/ItemList.tsx
|
|
1279
|
+
import { createElement as createElement10 } from "react";
|
|
1280
|
+
function ItemList({ as = "div", className, ...props }) {
|
|
1281
|
+
return createElement10(as, {
|
|
1282
|
+
className: cn("item-list", className),
|
|
1283
|
+
...props
|
|
1284
|
+
});
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
// src/LoadingState.tsx
|
|
1288
|
+
import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1289
|
+
function LoadingState({ label = "Loading...", className }) {
|
|
1290
|
+
return /* @__PURE__ */ jsxs15("span", { className: cn("status-inline", className), children: [
|
|
1291
|
+
/* @__PURE__ */ jsx21(Loader2, { size: 14, className: "icon-spin" }),
|
|
1292
|
+
label
|
|
1293
|
+
] });
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
// src/PageLayout.tsx
|
|
1297
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1298
|
+
function PageShell({ children }) {
|
|
1299
|
+
return /* @__PURE__ */ jsx22("main", { className: "page-shell", children });
|
|
1300
|
+
}
|
|
1301
|
+
function PageCard({ children }) {
|
|
1302
|
+
return /* @__PURE__ */ jsx22("div", { className: "page-card", children });
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
// src/PanelCloseButton.tsx
|
|
1306
|
+
import { jsx as jsx23, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1307
|
+
function PanelCloseButton({ onClick, label = "Close" }) {
|
|
1308
|
+
return /* @__PURE__ */ jsxs16(Button, { variant: "secondary", className: "panel-close-btn", onClick, children: [
|
|
1309
|
+
/* @__PURE__ */ jsx23(X, { size: 14 }),
|
|
1310
|
+
label
|
|
1311
|
+
] });
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
// src/PanelSection.tsx
|
|
1315
|
+
import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1316
|
+
function PanelSection({ heading, description, actions, className, children, ...props }) {
|
|
1317
|
+
return /* @__PURE__ */ jsxs17("section", { className: cn("widget-section", className), ...props, children: [
|
|
1318
|
+
heading || actions ? /* @__PURE__ */ jsxs17("header", { className: actions ? "title-row" : void 0, children: [
|
|
1319
|
+
heading ? /* @__PURE__ */ jsx24(SectionTitle, { children: heading }) : null,
|
|
1320
|
+
actions
|
|
1321
|
+
] }) : null,
|
|
1322
|
+
description ? /* @__PURE__ */ jsx24(SectionDescription, { children: description }) : null,
|
|
1323
|
+
children
|
|
1324
|
+
] });
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
// src/PanelTitle.tsx
|
|
1328
|
+
import { jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1329
|
+
function PanelTitle({ icon: Icon, label }) {
|
|
1330
|
+
return /* @__PURE__ */ jsxs18("span", { className: "panel-title-with-icon", children: [
|
|
1331
|
+
/* @__PURE__ */ jsx25(Icon, { size: 13, className: "panel-title-icon" }),
|
|
1332
|
+
/* @__PURE__ */ jsx25("span", { children: label })
|
|
1333
|
+
] });
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
// src/PickerCard.tsx
|
|
1337
|
+
import { createElement as createElement11 } from "react";
|
|
1338
|
+
function PickerCard({ as = "button", className, ...props }) {
|
|
1339
|
+
return createElement11(as, {
|
|
1340
|
+
className: cn("picker-card", className),
|
|
1341
|
+
...props
|
|
1342
|
+
});
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
// src/PickerGrid.tsx
|
|
1346
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1347
|
+
var variantClasses2 = {
|
|
1348
|
+
elements: "picker-grid--elements",
|
|
1349
|
+
characters: "picker-grid--characters",
|
|
1350
|
+
library: "picker-grid--library"
|
|
1351
|
+
};
|
|
1352
|
+
function PickerGrid({ variant, className, ...props }) {
|
|
1353
|
+
return /* @__PURE__ */ jsx26(List, { className: cn("picker-grid", variantClasses2[variant], className), ...props });
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
// src/Pill.tsx
|
|
1357
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1358
|
+
var toneClasses2 = {
|
|
1359
|
+
default: "",
|
|
1360
|
+
success: "success",
|
|
1361
|
+
warning: "warning",
|
|
1362
|
+
danger: "danger"
|
|
1363
|
+
};
|
|
1364
|
+
function Pill({ tone = "default", className, ...props }) {
|
|
1365
|
+
return /* @__PURE__ */ jsx27("span", { className: cn("pill", toneClasses2[tone], className), ...props });
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
// src/Select.tsx
|
|
1369
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
1370
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1371
|
+
var Select = forwardRef3(function Select2({ className, ...props }, ref) {
|
|
1372
|
+
return /* @__PURE__ */ jsx28("select", { ref, className: cn(className), ...props });
|
|
1373
|
+
});
|
|
1374
|
+
|
|
1375
|
+
// src/SplitLayout.tsx
|
|
1376
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1377
|
+
var variantClasses3 = {
|
|
1378
|
+
element: "split-layout--element",
|
|
1379
|
+
character: "split-layout--character",
|
|
1380
|
+
user: "split-layout--user"
|
|
1381
|
+
};
|
|
1382
|
+
function SplitLayout({ variant, className, ...props }) {
|
|
1383
|
+
return /* @__PURE__ */ jsx29("div", { className: cn("split-layout", variantClasses3[variant], className), ...props });
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
// src/TagRow.tsx
|
|
1387
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1388
|
+
function TagRow({ className, ...props }) {
|
|
1389
|
+
return /* @__PURE__ */ jsx30("div", { className: cn("tag-row", className), ...props });
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
// src/Textarea.tsx
|
|
1393
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
1394
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1395
|
+
var Textarea = forwardRef4(function Textarea2({ className, ...props }, ref) {
|
|
1396
|
+
return /* @__PURE__ */ jsx31("textarea", { ref, className: cn(className), ...props });
|
|
1397
|
+
});
|
|
1398
|
+
|
|
1399
|
+
// src/ThemeToggle.tsx
|
|
1400
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1401
|
+
function ThemeToggle({ className, theme = "light", onToggle, lightIcon, darkIcon }) {
|
|
1402
|
+
return /* @__PURE__ */ jsx32("button", { className, onClick: onToggle, title: `Switch to ${theme === "light" ? "dark" : "light"} mode`, "aria-label": "Toggle theme", children: theme === "light" ? darkIcon ?? /* @__PURE__ */ jsx32(Moon, {}) : lightIcon ?? /* @__PURE__ */ jsx32(Sun, {}) });
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
// src/TitleRow.tsx
|
|
1406
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1407
|
+
function TitleRow({ className, ...props }) {
|
|
1408
|
+
return /* @__PURE__ */ jsx33("div", { className: cn("title-row", className), ...props });
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
// src/WidgetSkeletons.tsx
|
|
1412
|
+
import { jsx as jsx34, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1413
|
+
function PanelFormSkeleton({ inputs = 1, showButton = true, className, ...props }) {
|
|
1414
|
+
return /* @__PURE__ */ jsxs19(Stack, { className, ...props, children: [
|
|
1415
|
+
Array.from({ length: inputs }).map((_, i) => /* @__PURE__ */ jsx34(InputSkeleton, {}, `panel-form-input-${i}`)),
|
|
1416
|
+
showButton && /* @__PURE__ */ jsx34(ButtonSkeleton, {})
|
|
1417
|
+
] });
|
|
1418
|
+
}
|
|
1419
|
+
function StoryCardSkeleton() {
|
|
1420
|
+
return /* @__PURE__ */ jsxs19("article", { className: "story-card", children: [
|
|
1421
|
+
/* @__PURE__ */ jsx34("div", { className: "story-cover", children: /* @__PURE__ */ jsx34("div", { className: "story-cover__placeholder story-cover__placeholder--skeleton" }) }),
|
|
1422
|
+
/* @__PURE__ */ jsx34("div", { className: "story-card__overlay story-card__overlay--skeleton", children: /* @__PURE__ */ jsxs19("div", { className: "story-card__overlay-text", children: [
|
|
1423
|
+
/* @__PURE__ */ jsxs19(Inline, { as: "header", children: [
|
|
1424
|
+
/* @__PURE__ */ jsx34(ChipSkeleton, {}),
|
|
1425
|
+
/* @__PURE__ */ jsx34(ChipSkeleton, {})
|
|
1426
|
+
] }),
|
|
1427
|
+
/* @__PURE__ */ jsx34(TitleSkeleton, {}),
|
|
1428
|
+
/* @__PURE__ */ jsx34(LineSkeleton, { short: true })
|
|
1429
|
+
] }) })
|
|
1430
|
+
] });
|
|
1431
|
+
}
|
|
1432
|
+
function UserCardSkeleton() {
|
|
1433
|
+
return /* @__PURE__ */ jsx34(ItemCard, { as: "li", children: /* @__PURE__ */ jsxs19(SplitLayout, { variant: "user", children: [
|
|
1434
|
+
/* @__PURE__ */ jsx34(AvatarSkeleton, {}),
|
|
1435
|
+
/* @__PURE__ */ jsxs19(Stack, { size: "sm", children: [
|
|
1436
|
+
/* @__PURE__ */ jsx34(TitleSkeleton, {}),
|
|
1437
|
+
/* @__PURE__ */ jsx34(LineSkeleton, { short: true })
|
|
1438
|
+
] }),
|
|
1439
|
+
/* @__PURE__ */ jsxs19(Stack, { size: "sm", children: [
|
|
1440
|
+
/* @__PURE__ */ jsx34(ChipSkeleton, {}),
|
|
1441
|
+
/* @__PURE__ */ jsx34(SelectSkeleton, {})
|
|
1442
|
+
] })
|
|
1443
|
+
] }) });
|
|
1444
|
+
}
|
|
1445
|
+
function UserListSkeleton({ count = 3 }) {
|
|
1446
|
+
return /* @__PURE__ */ jsx34(ItemList, { as: "ul", children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ jsx34(UserCardSkeleton, {}, `user-skeleton-${i}`)) });
|
|
1447
|
+
}
|
|
1448
|
+
function AssetCardSkeleton() {
|
|
1449
|
+
return /* @__PURE__ */ jsxs19(ItemCard, { as: "li", children: [
|
|
1450
|
+
/* @__PURE__ */ jsxs19(Stack, { size: "sm", children: [
|
|
1451
|
+
/* @__PURE__ */ jsx34(ThumbSkeleton, { className: "asset-thumb" }),
|
|
1452
|
+
/* @__PURE__ */ jsx34(TitleSkeleton, {}),
|
|
1453
|
+
/* @__PURE__ */ jsxs19(TagRow, { children: [
|
|
1454
|
+
/* @__PURE__ */ jsx34(ChipSkeleton, {}),
|
|
1455
|
+
/* @__PURE__ */ jsx34(ChipSkeleton, {})
|
|
1456
|
+
] })
|
|
1457
|
+
] }),
|
|
1458
|
+
/* @__PURE__ */ jsxs19(ButtonRow, { children: [
|
|
1459
|
+
/* @__PURE__ */ jsx34(ButtonSkeleton, {}),
|
|
1460
|
+
/* @__PURE__ */ jsx34(ButtonSkeleton, {})
|
|
1461
|
+
] })
|
|
1462
|
+
] });
|
|
1463
|
+
}
|
|
1464
|
+
function PickerGridSkeleton({ count = 8, gridClass }) {
|
|
1465
|
+
return /* @__PURE__ */ jsx34(List, { className: cn("picker-grid", gridClass), children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ jsx34("li", { children: /* @__PURE__ */ jsx34(PickerCard, { as: "div", className: "picker-card--skeleton", children: /* @__PURE__ */ jsxs19(Stack, { size: "sm", children: [
|
|
1466
|
+
/* @__PURE__ */ jsx34(ThumbSkeleton, { className: "asset-thumb" }),
|
|
1467
|
+
/* @__PURE__ */ jsx34(LineSkeleton, { short: true })
|
|
1468
|
+
] }) }) }, `picker-skeleton-${i}`)) });
|
|
1469
|
+
}
|
|
881
1470
|
export {
|
|
1471
|
+
Alert,
|
|
1472
|
+
AssetCardSkeleton,
|
|
1473
|
+
AssetTitle,
|
|
1474
|
+
AvatarSkeleton,
|
|
1475
|
+
Button,
|
|
1476
|
+
ButtonRow,
|
|
1477
|
+
ButtonSkeleton,
|
|
1478
|
+
CanvasSkeleton,
|
|
1479
|
+
Chip,
|
|
1480
|
+
ChipSkeleton,
|
|
1481
|
+
ChoiceCard,
|
|
1482
|
+
ChoiceGroup,
|
|
1483
|
+
ChoiceGroupSkeleton,
|
|
882
1484
|
ConfirmDialog,
|
|
1485
|
+
CoordGrid,
|
|
1486
|
+
CoordInput,
|
|
1487
|
+
EmptyState,
|
|
1488
|
+
Field,
|
|
883
1489
|
FloatingPanel,
|
|
1490
|
+
GeneratingOverlay,
|
|
1491
|
+
IconButtonSkeleton,
|
|
1492
|
+
IconText,
|
|
1493
|
+
ImageThumb,
|
|
1494
|
+
Inline,
|
|
1495
|
+
Input,
|
|
1496
|
+
InputSkeleton,
|
|
1497
|
+
ItemCard,
|
|
1498
|
+
ItemList,
|
|
1499
|
+
Label,
|
|
1500
|
+
LineSkeleton,
|
|
1501
|
+
List,
|
|
1502
|
+
LoadingState,
|
|
884
1503
|
Minimap,
|
|
1504
|
+
MutedText,
|
|
1505
|
+
PageCard,
|
|
1506
|
+
PageShell,
|
|
1507
|
+
PageTitle,
|
|
1508
|
+
PanelCloseButton,
|
|
885
1509
|
PanelErrorBoundary,
|
|
1510
|
+
PanelFormSkeleton,
|
|
1511
|
+
PanelSection,
|
|
1512
|
+
PanelTitle,
|
|
1513
|
+
PickerCard,
|
|
1514
|
+
PickerGrid,
|
|
1515
|
+
PickerGridSkeleton,
|
|
1516
|
+
Pill,
|
|
1517
|
+
SectionDescription,
|
|
1518
|
+
SectionTitle,
|
|
1519
|
+
Select,
|
|
1520
|
+
SelectSkeleton,
|
|
1521
|
+
Skeleton,
|
|
1522
|
+
SplitLayout,
|
|
1523
|
+
Stack,
|
|
1524
|
+
StoryCardSkeleton,
|
|
1525
|
+
StoryTitle,
|
|
1526
|
+
TagRow,
|
|
1527
|
+
Textarea,
|
|
1528
|
+
TextareaSkeleton,
|
|
1529
|
+
ThemeToggle,
|
|
1530
|
+
ThumbSkeleton,
|
|
1531
|
+
TitleRow,
|
|
1532
|
+
TitleSkeleton,
|
|
1533
|
+
UserCardSkeleton,
|
|
1534
|
+
UserListSkeleton,
|
|
886
1535
|
WHITEBOARD_GRID,
|
|
887
1536
|
WhiteboardShell,
|
|
888
1537
|
ZoomBar,
|