@almadar/ui 4.51.16 → 4.53.1

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.
@@ -1,5 +1,5 @@
1
- import * as React80 from 'react';
2
- import React80__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
1
+ import * as React83 from 'react';
2
+ import React83__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
3
3
  import { EventBusContext, useTraitScope, OrbitalProvider, TraitScopeProvider, VerificationProvider } from '@almadar/ui/providers';
4
4
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -780,89 +780,6 @@ var init_cn = __esm({
780
780
  "lib/cn.ts"() {
781
781
  }
782
782
  });
783
- function kebabToPascal(name) {
784
- return name.split("-").map((part) => {
785
- if (/^\d+$/.test(part)) return part;
786
- return part.charAt(0).toUpperCase() + part.slice(1);
787
- }).join("");
788
- }
789
- function resolveIcon(name) {
790
- const cached = resolvedCache.get(name);
791
- if (cached) return cached;
792
- const resolved = doResolve(name);
793
- resolvedCache.set(name, resolved);
794
- return resolved;
795
- }
796
- function doResolve(name) {
797
- if (iconAliases[name]) return iconAliases[name];
798
- const pascalName = kebabToPascal(name);
799
- const directLookup = LucideIcons[pascalName];
800
- if (directLookup && typeof directLookup === "object") return directLookup;
801
- const asIs = LucideIcons[name];
802
- if (asIs && typeof asIs === "object") return asIs;
803
- return LucideIcons.HelpCircle;
804
- }
805
- var iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
806
- var init_Icon = __esm({
807
- "components/atoms/Icon.tsx"() {
808
- init_cn();
809
- iconAliases = {
810
- "close": LucideIcons.X,
811
- "trash": LucideIcons.Trash2,
812
- "loader": LucideIcons.Loader2,
813
- "stop": LucideIcons.Square,
814
- "volume": LucideIcons.Volume2,
815
- "volume-off": LucideIcons.VolumeX,
816
- "refresh": LucideIcons.RefreshCw,
817
- "share": LucideIcons.Share2,
818
- "sort-asc": LucideIcons.ArrowUpNarrowWide,
819
- "sort-desc": LucideIcons.ArrowDownNarrowWide
820
- };
821
- resolvedCache = /* @__PURE__ */ new Map();
822
- sizeClasses = {
823
- xs: "w-3 h-3",
824
- sm: "w-4 h-4",
825
- md: "w-5 h-5",
826
- lg: "w-6 h-6",
827
- xl: "w-8 h-8"
828
- };
829
- animationClasses = {
830
- none: "",
831
- spin: "animate-spin",
832
- pulse: "animate-pulse"
833
- };
834
- Icon = ({
835
- icon,
836
- name,
837
- size = "md",
838
- color,
839
- animation = "none",
840
- className,
841
- strokeWidth,
842
- style
843
- }) => {
844
- const IconComponent = icon ?? (name ? resolveIcon(name) : LucideIcons.HelpCircle);
845
- const effectiveStrokeWidth = strokeWidth ?? void 0;
846
- return /* @__PURE__ */ jsx(
847
- IconComponent,
848
- {
849
- className: cn(
850
- sizeClasses[size],
851
- animationClasses[animation],
852
- color ? color : "text-current",
853
- className
854
- ),
855
- strokeWidth: effectiveStrokeWidth,
856
- style: {
857
- ...effectiveStrokeWidth === void 0 ? { strokeWidth: "var(--icon-stroke-width, 2)" } : {},
858
- ...style
859
- }
860
- }
861
- );
862
- };
863
- Icon.displayName = "Icon";
864
- }
865
- });
866
783
  var paddingStyles, paddingXStyles, paddingYStyles, marginStyles, marginXStyles, marginYStyles, bgStyles, roundedStyles, shadowStyles, displayStyles, overflowStyles, positionStyles, Box;
867
784
  var init_Box = __esm({
868
785
  "components/atoms/Box.tsx"() {
@@ -971,7 +888,7 @@ var init_Box = __esm({
971
888
  fixed: "fixed",
972
889
  sticky: "sticky"
973
890
  };
974
- Box = React80__default.forwardRef(
891
+ Box = React83__default.forwardRef(
975
892
  ({
976
893
  padding,
977
894
  paddingX,
@@ -1021,38 +938,26 @@ var init_Box = __esm({
1021
938
  onMouseLeave?.(e);
1022
939
  }, [hoverEvent, eventBus, onMouseLeave]);
1023
940
  const isClickable = action || onClick;
1024
- const Comp = Component;
1025
- return /* @__PURE__ */ jsx(
1026
- Comp,
941
+ return React83__default.createElement(
942
+ Component,
1027
943
  {
1028
944
  ref,
1029
945
  className: cn(
1030
- // Padding
1031
946
  padding && paddingStyles[padding],
1032
947
  paddingX && paddingXStyles[paddingX],
1033
948
  paddingY && paddingYStyles[paddingY],
1034
- // Margin
1035
949
  margin && marginStyles[margin],
1036
950
  marginX && marginXStyles[marginX],
1037
951
  marginY && marginYStyles[marginY],
1038
- // Background
1039
952
  bgStyles[bg],
1040
- // Border - uses theme variables
1041
953
  border && "border-[length:var(--border-width)] border-border",
1042
- // Rounded
1043
954
  roundedStyles[rounded],
1044
- // Shadow
1045
955
  shadowStyles[shadow],
1046
- // Display
1047
956
  display && displayStyles[display],
1048
- // Dimensions
1049
957
  fullWidth && "w-full",
1050
958
  fullHeight && "h-full",
1051
- // Overflow
1052
959
  overflow && overflowStyles[overflow],
1053
- // Position
1054
960
  position && positionStyles[position],
1055
- // Cursor for clickable
1056
961
  isClickable && "cursor-pointer",
1057
962
  className
1058
963
  ),
@@ -1060,15 +965,271 @@ var init_Box = __esm({
1060
965
  onMouseEnter: hoverEvent || onMouseEnter ? handleMouseEnter : void 0,
1061
966
  onMouseLeave: hoverEvent || onMouseLeave ? handleMouseLeave : void 0,
1062
967
  style: maxWidth ? { maxWidth, ...rest.style } : rest.style,
1063
- ...rest,
1064
- children
1065
- }
968
+ ...rest
969
+ },
970
+ children
1066
971
  );
1067
972
  }
1068
973
  );
1069
974
  Box.displayName = "Box";
1070
975
  }
1071
976
  });
977
+ function kebabToPascal(name) {
978
+ return name.split("-").map((part) => {
979
+ if (/^\d+$/.test(part)) return part;
980
+ return part.charAt(0).toUpperCase() + part.slice(1);
981
+ }).join("");
982
+ }
983
+ function resolveIcon(name) {
984
+ const cached = resolvedCache.get(name);
985
+ if (cached) return cached;
986
+ const resolved = doResolve(name);
987
+ resolvedCache.set(name, resolved);
988
+ return resolved;
989
+ }
990
+ function doResolve(name) {
991
+ if (iconAliases[name]) return iconAliases[name];
992
+ const pascalName = kebabToPascal(name);
993
+ const directLookup = LucideIcons[pascalName];
994
+ if (directLookup && typeof directLookup === "object") return directLookup;
995
+ const asIs = LucideIcons[name];
996
+ if (asIs && typeof asIs === "object") return asIs;
997
+ return LucideIcons.HelpCircle;
998
+ }
999
+ var iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
1000
+ var init_Icon = __esm({
1001
+ "components/atoms/Icon.tsx"() {
1002
+ init_cn();
1003
+ iconAliases = {
1004
+ "close": LucideIcons.X,
1005
+ "trash": LucideIcons.Trash2,
1006
+ "loader": LucideIcons.Loader2,
1007
+ "stop": LucideIcons.Square,
1008
+ "volume": LucideIcons.Volume2,
1009
+ "volume-off": LucideIcons.VolumeX,
1010
+ "refresh": LucideIcons.RefreshCw,
1011
+ "share": LucideIcons.Share2,
1012
+ "sort-asc": LucideIcons.ArrowUpNarrowWide,
1013
+ "sort-desc": LucideIcons.ArrowDownNarrowWide
1014
+ };
1015
+ resolvedCache = /* @__PURE__ */ new Map();
1016
+ sizeClasses = {
1017
+ xs: "w-3 h-3",
1018
+ sm: "w-4 h-4",
1019
+ md: "w-5 h-5",
1020
+ lg: "w-6 h-6",
1021
+ xl: "w-8 h-8"
1022
+ };
1023
+ animationClasses = {
1024
+ none: "",
1025
+ spin: "animate-spin",
1026
+ pulse: "animate-pulse"
1027
+ };
1028
+ Icon = ({
1029
+ icon,
1030
+ name,
1031
+ size = "md",
1032
+ color,
1033
+ animation = "none",
1034
+ className,
1035
+ strokeWidth,
1036
+ style
1037
+ }) => {
1038
+ const IconComponent = icon ?? (name ? resolveIcon(name) : LucideIcons.HelpCircle);
1039
+ const effectiveStrokeWidth = strokeWidth ?? void 0;
1040
+ return /* @__PURE__ */ jsx(
1041
+ IconComponent,
1042
+ {
1043
+ className: cn(
1044
+ sizeClasses[size],
1045
+ animationClasses[animation],
1046
+ color ? color : "text-current",
1047
+ className
1048
+ ),
1049
+ strokeWidth: effectiveStrokeWidth,
1050
+ style: {
1051
+ ...effectiveStrokeWidth === void 0 ? { strokeWidth: "var(--icon-stroke-width, 2)" } : {},
1052
+ ...style
1053
+ }
1054
+ }
1055
+ );
1056
+ };
1057
+ Icon.displayName = "Icon";
1058
+ }
1059
+ });
1060
+ function resolveIconProp(value, sizeClass) {
1061
+ if (!value) return null;
1062
+ if (typeof value === "string") {
1063
+ const Resolved = resolveIcon(value);
1064
+ return Resolved ? /* @__PURE__ */ jsx(Resolved, { className: sizeClass }) : null;
1065
+ }
1066
+ if (typeof value === "function") {
1067
+ const IconComp = value;
1068
+ return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1069
+ }
1070
+ if (React83__default.isValidElement(value)) {
1071
+ return value;
1072
+ }
1073
+ if (typeof value === "object" && value !== null && "render" in value) {
1074
+ const IconComp = value;
1075
+ return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1076
+ }
1077
+ return value;
1078
+ }
1079
+ var variantStyles, sizeStyles, iconSizeStyles, Button;
1080
+ var init_Button = __esm({
1081
+ "components/atoms/Button.tsx"() {
1082
+ "use client";
1083
+ init_cn();
1084
+ init_useEventBus();
1085
+ init_Icon();
1086
+ variantStyles = {
1087
+ primary: [
1088
+ "bg-primary text-primary-foreground",
1089
+ "border-none",
1090
+ "shadow-sm",
1091
+ "hover:bg-primary-hover hover:shadow-lg",
1092
+ "active:scale-[var(--active-scale)] active:shadow-sm"
1093
+ ].join(" "),
1094
+ secondary: [
1095
+ "bg-transparent text-accent",
1096
+ "border border-accent",
1097
+ "hover:bg-accent hover:text-white hover:border-accent",
1098
+ "active:scale-[var(--active-scale)]"
1099
+ ].join(" "),
1100
+ ghost: [
1101
+ "bg-transparent text-muted-foreground",
1102
+ "border border-transparent",
1103
+ "hover:text-primary-foreground hover:bg-primary hover:border-primary",
1104
+ "active:scale-[var(--active-scale)]"
1105
+ ].join(" "),
1106
+ danger: [
1107
+ "bg-surface text-error",
1108
+ "border-[length:var(--border-width)] border-error",
1109
+ "shadow-sm",
1110
+ "hover:bg-error hover:text-error-foreground hover:shadow-lg",
1111
+ "active:scale-[var(--active-scale)] active:shadow-sm"
1112
+ ].join(" "),
1113
+ success: [
1114
+ "bg-surface text-success",
1115
+ "border-[length:var(--border-width)] border-success",
1116
+ "shadow-sm",
1117
+ "hover:bg-success hover:text-success-foreground hover:shadow-lg",
1118
+ "active:scale-[var(--active-scale)] active:shadow-sm"
1119
+ ].join(" "),
1120
+ warning: [
1121
+ "bg-surface text-warning",
1122
+ "border-[length:var(--border-width)] border-warning",
1123
+ "shadow-sm",
1124
+ "hover:bg-warning hover:text-warning-foreground hover:shadow-lg",
1125
+ "active:scale-[var(--active-scale)] active:shadow-sm"
1126
+ ].join(" "),
1127
+ // "default" is an alias for secondary
1128
+ default: [
1129
+ "bg-secondary text-secondary-foreground",
1130
+ "border-[length:var(--border-width-thin)] border-border",
1131
+ "hover:bg-secondary-hover",
1132
+ "active:scale-[var(--active-scale)]"
1133
+ ].join(" ")
1134
+ };
1135
+ variantStyles.destructive = variantStyles.danger;
1136
+ sizeStyles = {
1137
+ sm: "px-3 py-1.5 text-sm",
1138
+ md: "px-4 py-2 text-sm",
1139
+ lg: "px-6 py-3 text-base"
1140
+ };
1141
+ iconSizeStyles = {
1142
+ sm: "h-3.5 w-3.5",
1143
+ md: "h-4 w-4",
1144
+ lg: "h-5 w-5"
1145
+ };
1146
+ Button = React83__default.forwardRef(
1147
+ ({
1148
+ className,
1149
+ variant = "primary",
1150
+ size = "md",
1151
+ isLoading = false,
1152
+ disabled,
1153
+ leftIcon,
1154
+ rightIcon,
1155
+ icon: iconProp,
1156
+ iconRight: iconRightProp,
1157
+ action,
1158
+ actionPayload,
1159
+ label,
1160
+ children,
1161
+ onClick,
1162
+ ...props
1163
+ }, ref) => {
1164
+ const eventBus = useEventBus();
1165
+ const leftIconValue = leftIcon || iconProp;
1166
+ const rightIconValue = rightIcon || iconRightProp;
1167
+ const resolvedLeftIcon = resolveIconProp(leftIconValue, iconSizeStyles[size]);
1168
+ const resolvedRightIcon = resolveIconProp(rightIconValue, iconSizeStyles[size]);
1169
+ const handleClick = (e) => {
1170
+ if (action) {
1171
+ eventBus.emit(`UI:${action}`, actionPayload ?? {});
1172
+ }
1173
+ onClick?.(e);
1174
+ };
1175
+ return /* @__PURE__ */ jsxs(
1176
+ "button",
1177
+ {
1178
+ ref,
1179
+ disabled: disabled || isLoading,
1180
+ className: cn(
1181
+ "inline-flex items-center justify-center gap-2",
1182
+ "font-[var(--font-weight-medium)]",
1183
+ "rounded-sm",
1184
+ "cursor-pointer",
1185
+ "transition-all duration-[var(--transition-normal)]",
1186
+ "focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-ring focus:ring-offset-[length:var(--focus-ring-offset)]",
1187
+ "disabled:opacity-50 disabled:cursor-not-allowed",
1188
+ variantStyles[variant],
1189
+ sizeStyles[size],
1190
+ className
1191
+ ),
1192
+ onClick: handleClick,
1193
+ ...props,
1194
+ "data-testid": props["data-testid"] ?? (action ? `action-${action}` : void 0),
1195
+ children: [
1196
+ isLoading ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : resolvedLeftIcon && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: resolvedLeftIcon }),
1197
+ children || label,
1198
+ resolvedRightIcon && !isLoading && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: resolvedRightIcon })
1199
+ ]
1200
+ }
1201
+ );
1202
+ }
1203
+ );
1204
+ Button.displayName = "Button";
1205
+ }
1206
+ });
1207
+ var Dialog;
1208
+ var init_Dialog = __esm({
1209
+ "components/atoms/Dialog.tsx"() {
1210
+ init_cn();
1211
+ Dialog = React83__default.forwardRef(
1212
+ ({
1213
+ role = "dialog",
1214
+ "aria-modal": ariaModal = true,
1215
+ className,
1216
+ children,
1217
+ ...rest
1218
+ }, ref) => /* @__PURE__ */ jsx(
1219
+ "dialog",
1220
+ {
1221
+ ref,
1222
+ role,
1223
+ "aria-modal": ariaModal,
1224
+ className: cn(className),
1225
+ ...rest,
1226
+ children
1227
+ }
1228
+ )
1229
+ );
1230
+ Dialog.displayName = "Dialog";
1231
+ }
1232
+ });
1072
1233
 
1073
1234
  // components/atoms/Typography.tsx
1074
1235
  var Typography_exports = {};
@@ -1077,11 +1238,11 @@ __export(Typography_exports, {
1077
1238
  Text: () => Text,
1078
1239
  Typography: () => Typography
1079
1240
  });
1080
- var variantStyles, colorStyles, weightStyles, defaultElements, typographySizeStyles, overflowStyles2, Typography, sizeStyles, Heading, Text;
1241
+ var variantStyles2, colorStyles, weightStyles, defaultElements, typographySizeStyles, overflowStyles2, Typography, sizeStyles2, Heading, Text;
1081
1242
  var init_Typography = __esm({
1082
1243
  "components/atoms/Typography.tsx"() {
1083
1244
  init_cn();
1084
- variantStyles = {
1245
+ variantStyles2 = {
1085
1246
  h1: "text-4xl font-bold tracking-tight text-foreground",
1086
1247
  h2: "text-3xl font-bold tracking-tight text-foreground",
1087
1248
  h3: "text-2xl font-bold text-foreground",
@@ -1173,7 +1334,7 @@ var init_Typography = __esm({
1173
1334
  {
1174
1335
  id,
1175
1336
  className: cn(
1176
- variantStyles[variant],
1337
+ variantStyles2[variant],
1177
1338
  colorStyles[color],
1178
1339
  weight && weightStyles[weight],
1179
1340
  size && typographySizeStyles[size],
@@ -1188,7 +1349,7 @@ var init_Typography = __esm({
1188
1349
  );
1189
1350
  };
1190
1351
  Typography.displayName = "Typography";
1191
- sizeStyles = {
1352
+ sizeStyles2 = {
1192
1353
  xs: "text-xs",
1193
1354
  sm: "text-sm",
1194
1355
  md: "text-base",
@@ -1204,7 +1365,7 @@ var init_Typography = __esm({
1204
1365
  ...props
1205
1366
  }) => {
1206
1367
  const variant = `h${level}`;
1207
- const sizeClass = size ? sizeStyles[size] : void 0;
1368
+ const sizeClass = size ? sizeStyles2[size] : void 0;
1208
1369
  return /* @__PURE__ */ jsx(
1209
1370
  Typography,
1210
1371
  {
@@ -1271,8 +1432,9 @@ var sizeClasses2, minWidths, Modal;
1271
1432
  var init_Modal = __esm({
1272
1433
  "components/molecules/Modal.tsx"() {
1273
1434
  "use client";
1274
- init_Icon();
1275
1435
  init_Box();
1436
+ init_Button();
1437
+ init_Dialog();
1276
1438
  init_Typography();
1277
1439
  init_Overlay();
1278
1440
  init_cn();
@@ -1365,7 +1527,7 @@ var init_Modal = __esm({
1365
1527
  }
1366
1528
  ),
1367
1529
  /* @__PURE__ */ jsx(
1368
- "div",
1530
+ Box,
1369
1531
  {
1370
1532
  className: cn(
1371
1533
  "fixed inset-0 z-50 pointer-events-none",
@@ -1374,17 +1536,17 @@ var init_Modal = __esm({
1374
1536
  ),
1375
1537
  style: { paddingTop: "10vh" },
1376
1538
  children: /* @__PURE__ */ jsxs(
1377
- Box,
1539
+ Dialog,
1378
1540
  {
1379
1541
  ref: modalRef,
1380
- bg: "surface",
1381
- border: true,
1382
- shadow: "lg",
1383
- rounded: "md",
1542
+ open: true,
1384
1543
  className: cn(
1385
- "pointer-events-auto w-full flex flex-col",
1544
+ // Reset browser-default dialog chrome — we own styling.
1545
+ "m-0 p-0 border-0 bg-transparent",
1546
+ // Pre-existing dialog frame
1547
+ "pointer-events-auto w-full flex flex-col bg-surface border shadow-lg rounded-md",
1386
1548
  sizeClasses2[size],
1387
- "max-sm:max-w-full max-sm:rounded-b-none max-sm:rounded-t-2xl",
1549
+ "max-sm:max-w-full max-sm:min-w-0 max-sm:rounded-b-none max-sm:rounded-t-2xl",
1388
1550
  className
1389
1551
  ),
1390
1552
  style: {
@@ -1395,12 +1557,10 @@ var init_Modal = __esm({
1395
1557
  transition: isDragging.current ? "none" : "transform 200ms ease-out"
1396
1558
  }
1397
1559
  },
1398
- role: "dialog",
1399
- "aria-modal": "true",
1400
1560
  ...title && { "aria-labelledby": "modal-title" },
1401
1561
  children: [
1402
1562
  /* @__PURE__ */ jsx(
1403
- "div",
1563
+ Box,
1404
1564
  {
1405
1565
  className: "hidden max-sm:flex justify-center py-2 cursor-grab active:cursor-grabbing touch-none",
1406
1566
  onPointerDown: (e) => {
@@ -1426,11 +1586,11 @@ var init_Modal = __esm({
1426
1586
  isDragging.current = false;
1427
1587
  setDragY(0);
1428
1588
  },
1429
- children: /* @__PURE__ */ jsx("div", { className: "w-10 h-1 rounded-full bg-border" })
1589
+ children: /* @__PURE__ */ jsx(Box, { className: "w-10 h-1 rounded-full bg-border" })
1430
1590
  }
1431
1591
  ),
1432
1592
  (title || showCloseButton) && /* @__PURE__ */ jsxs(
1433
- "div",
1593
+ Box,
1434
1594
  {
1435
1595
  className: cn(
1436
1596
  "px-6 py-4 flex items-center justify-between",
@@ -1439,25 +1599,22 @@ var init_Modal = __esm({
1439
1599
  children: [
1440
1600
  title && /* @__PURE__ */ jsx(Typography, { variant: "h4", as: "h2", id: "modal-title", children: title }),
1441
1601
  showCloseButton && /* @__PURE__ */ jsx(
1442
- "button",
1602
+ Button,
1443
1603
  {
1444
- type: "button",
1604
+ variant: "ghost",
1605
+ size: "sm",
1606
+ icon: X,
1445
1607
  onClick: handleClose,
1446
1608
  "data-event": "CLOSE",
1447
- className: cn(
1448
- "p-1 transition-colors rounded-sm",
1449
- "hover:bg-muted"
1450
- ),
1451
- "aria-label": "Close modal",
1452
- children: /* @__PURE__ */ jsx(Icon, { icon: X, size: "md" })
1609
+ "aria-label": "Close modal"
1453
1610
  }
1454
1611
  )
1455
1612
  ]
1456
1613
  }
1457
1614
  ),
1458
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto p-6", children }),
1615
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto p-6", children }),
1459
1616
  footer && /* @__PURE__ */ jsx(
1460
- "div",
1617
+ Box,
1461
1618
  {
1462
1619
  className: cn(
1463
1620
  "px-6 py-4 bg-muted",
@@ -1480,21 +1637,19 @@ var sizeWidths, Drawer;
1480
1637
  var init_Drawer = __esm({
1481
1638
  "components/molecules/Drawer.tsx"() {
1482
1639
  "use client";
1483
- init_Icon();
1484
1640
  init_Box();
1641
+ init_Button();
1485
1642
  init_Typography();
1486
1643
  init_Overlay();
1487
1644
  init_cn();
1488
1645
  init_useEventBus();
1489
1646
  sizeWidths = {
1490
- sm: "w-80",
1647
+ sm: "w-full sm:w-80",
1491
1648
  // 320px
1492
- md: "w-96",
1649
+ md: "w-full sm:w-96",
1493
1650
  // 384px
1494
- lg: "w-[480px]",
1495
- // 480px
1496
- xl: "w-[640px]",
1497
- // 640px
1651
+ lg: "w-full sm:w-[480px]",
1652
+ xl: "w-full sm:w-[640px]",
1498
1653
  full: "w-screen"
1499
1654
  };
1500
1655
  Drawer = ({
@@ -1592,7 +1747,7 @@ var init_Drawer = __esm({
1592
1747
  ...title && { "aria-labelledby": "drawer-title" },
1593
1748
  children: [
1594
1749
  (title || showCloseButton) && /* @__PURE__ */ jsxs(
1595
- "div",
1750
+ Box,
1596
1751
  {
1597
1752
  className: cn(
1598
1753
  "px-6 py-4 flex items-center justify-between shrink-0",
@@ -1601,25 +1756,22 @@ var init_Drawer = __esm({
1601
1756
  children: [
1602
1757
  title && /* @__PURE__ */ jsx(Typography, { variant: "h4", as: "h2", id: "drawer-title", children: title }),
1603
1758
  showCloseButton && /* @__PURE__ */ jsx(
1604
- "button",
1759
+ Button,
1605
1760
  {
1606
- type: "button",
1761
+ variant: "ghost",
1762
+ size: "sm",
1763
+ icon: X,
1607
1764
  onClick: handleClose,
1608
- className: cn(
1609
- "p-1 transition-colors rounded-sm",
1610
- "hover:bg-muted",
1611
- !title && "ml-auto"
1612
- ),
1613
1765
  "aria-label": "Close drawer",
1614
- children: /* @__PURE__ */ jsx(Icon, { icon: X, size: "md" })
1766
+ className: cn(!title && "ml-auto")
1615
1767
  }
1616
1768
  )
1617
1769
  ]
1618
1770
  }
1619
1771
  ),
1620
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto p-6", children }),
1772
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto p-6", children }),
1621
1773
  footer && /* @__PURE__ */ jsx(
1622
- "div",
1774
+ Box,
1623
1775
  {
1624
1776
  className: cn(
1625
1777
  "px-6 py-4 shrink-0 bg-muted",
@@ -1660,153 +1812,6 @@ var init_Drawer = __esm({
1660
1812
  Drawer.displayName = "Drawer";
1661
1813
  }
1662
1814
  });
1663
- function resolveIconProp(value, sizeClass) {
1664
- if (!value) return null;
1665
- if (typeof value === "string") {
1666
- const Resolved = resolveIcon(value);
1667
- return Resolved ? /* @__PURE__ */ jsx(Resolved, { className: sizeClass }) : null;
1668
- }
1669
- if (typeof value === "function") {
1670
- const IconComp = value;
1671
- return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1672
- }
1673
- if (React80__default.isValidElement(value)) {
1674
- return value;
1675
- }
1676
- if (typeof value === "object" && value !== null && "render" in value) {
1677
- const IconComp = value;
1678
- return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1679
- }
1680
- return value;
1681
- }
1682
- var variantStyles2, sizeStyles2, iconSizeStyles, Button;
1683
- var init_Button = __esm({
1684
- "components/atoms/Button.tsx"() {
1685
- "use client";
1686
- init_cn();
1687
- init_useEventBus();
1688
- init_Icon();
1689
- variantStyles2 = {
1690
- primary: [
1691
- "bg-primary text-primary-foreground",
1692
- "border-none",
1693
- "shadow-sm",
1694
- "hover:bg-primary-hover hover:shadow-lg",
1695
- "active:scale-[var(--active-scale)] active:shadow-sm"
1696
- ].join(" "),
1697
- secondary: [
1698
- "bg-transparent text-accent",
1699
- "border border-accent",
1700
- "hover:bg-accent hover:text-white hover:border-accent",
1701
- "active:scale-[var(--active-scale)]"
1702
- ].join(" "),
1703
- ghost: [
1704
- "bg-transparent text-muted-foreground",
1705
- "border border-transparent",
1706
- "hover:text-primary-foreground hover:bg-primary hover:border-primary",
1707
- "active:scale-[var(--active-scale)]"
1708
- ].join(" "),
1709
- danger: [
1710
- "bg-surface text-error",
1711
- "border-[length:var(--border-width)] border-error",
1712
- "shadow-sm",
1713
- "hover:bg-error hover:text-error-foreground hover:shadow-lg",
1714
- "active:scale-[var(--active-scale)] active:shadow-sm"
1715
- ].join(" "),
1716
- success: [
1717
- "bg-surface text-success",
1718
- "border-[length:var(--border-width)] border-success",
1719
- "shadow-sm",
1720
- "hover:bg-success hover:text-success-foreground hover:shadow-lg",
1721
- "active:scale-[var(--active-scale)] active:shadow-sm"
1722
- ].join(" "),
1723
- warning: [
1724
- "bg-surface text-warning",
1725
- "border-[length:var(--border-width)] border-warning",
1726
- "shadow-sm",
1727
- "hover:bg-warning hover:text-warning-foreground hover:shadow-lg",
1728
- "active:scale-[var(--active-scale)] active:shadow-sm"
1729
- ].join(" "),
1730
- // "default" is an alias for secondary
1731
- default: [
1732
- "bg-secondary text-secondary-foreground",
1733
- "border-[length:var(--border-width-thin)] border-border",
1734
- "hover:bg-secondary-hover",
1735
- "active:scale-[var(--active-scale)]"
1736
- ].join(" ")
1737
- };
1738
- variantStyles2.destructive = variantStyles2.danger;
1739
- sizeStyles2 = {
1740
- sm: "px-3 py-1.5 text-sm",
1741
- md: "px-4 py-2 text-sm",
1742
- lg: "px-6 py-3 text-base"
1743
- };
1744
- iconSizeStyles = {
1745
- sm: "h-3.5 w-3.5",
1746
- md: "h-4 w-4",
1747
- lg: "h-5 w-5"
1748
- };
1749
- Button = React80__default.forwardRef(
1750
- ({
1751
- className,
1752
- variant = "primary",
1753
- size = "md",
1754
- isLoading = false,
1755
- disabled,
1756
- leftIcon,
1757
- rightIcon,
1758
- icon: iconProp,
1759
- iconRight: iconRightProp,
1760
- action,
1761
- actionPayload,
1762
- label,
1763
- children,
1764
- onClick,
1765
- ...props
1766
- }, ref) => {
1767
- const eventBus = useEventBus();
1768
- const leftIconValue = leftIcon || iconProp;
1769
- const rightIconValue = rightIcon || iconRightProp;
1770
- const resolvedLeftIcon = resolveIconProp(leftIconValue, iconSizeStyles[size]);
1771
- const resolvedRightIcon = resolveIconProp(rightIconValue, iconSizeStyles[size]);
1772
- const handleClick = (e) => {
1773
- if (action) {
1774
- eventBus.emit(`UI:${action}`, actionPayload ?? {});
1775
- }
1776
- onClick?.(e);
1777
- };
1778
- return /* @__PURE__ */ jsxs(
1779
- "button",
1780
- {
1781
- ref,
1782
- disabled: disabled || isLoading,
1783
- className: cn(
1784
- "inline-flex items-center justify-center gap-2",
1785
- "font-[var(--font-weight-medium)]",
1786
- "rounded-sm",
1787
- "cursor-pointer",
1788
- "transition-all duration-[var(--transition-normal)]",
1789
- "focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-ring focus:ring-offset-[length:var(--focus-ring-offset)]",
1790
- "disabled:opacity-50 disabled:cursor-not-allowed",
1791
- variantStyles2[variant],
1792
- sizeStyles2[size],
1793
- className
1794
- ),
1795
- onClick: handleClick,
1796
- ...props,
1797
- "data-testid": props["data-testid"] ?? (action ? `action-${action}` : void 0),
1798
- children: [
1799
- isLoading ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : resolvedLeftIcon && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: resolvedLeftIcon }),
1800
- children || label,
1801
- resolvedRightIcon && !isLoading && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: resolvedRightIcon })
1802
- ]
1803
- }
1804
- );
1805
- }
1806
- );
1807
- Button.displayName = "Button";
1808
- }
1809
- });
1810
1815
  var variantStyles3, sizeStyles3, Badge;
1811
1816
  var init_Badge = __esm({
1812
1817
  "components/atoms/Badge.tsx"() {
@@ -1849,7 +1854,7 @@ var init_Badge = __esm({
1849
1854
  md: "px-2.5 py-1 text-sm",
1850
1855
  lg: "px-3 py-1.5 text-base"
1851
1856
  };
1852
- Badge = React80__default.forwardRef(
1857
+ Badge = React83__default.forwardRef(
1853
1858
  ({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
1854
1859
  const iconSizes3 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
1855
1860
  const resolvedIcon = typeof icon === "string" ? (() => {
@@ -1882,6 +1887,7 @@ var variantClasses, iconMap, iconColors, Toast;
1882
1887
  var init_Toast = __esm({
1883
1888
  "components/molecules/Toast.tsx"() {
1884
1889
  "use client";
1890
+ init_Box();
1885
1891
  init_Icon();
1886
1892
  init_Typography();
1887
1893
  init_Button();
@@ -1939,17 +1945,20 @@ var init_Toast = __esm({
1939
1945
  return () => clearTimeout(timer);
1940
1946
  }, [duration, onDismiss, dismissEvent]);
1941
1947
  return /* @__PURE__ */ jsx(
1942
- "div",
1948
+ Box,
1943
1949
  {
1944
1950
  className: cn(
1945
- "border-l-4 p-4 shadow min-w-[300px] max-w-md",
1951
+ // `min-w-[300px]` only kicks in at `sm:` and above so a phone
1952
+ // viewport doesn't get a toast wider than the screen near the
1953
+ // edge. `max-w-[calc(100vw-2rem)]` clamps to viewport too.
1954
+ "border-l-4 p-4 shadow min-w-0 sm:min-w-[300px] max-w-md max-w-[calc(100vw-2rem)]",
1946
1955
  "rounded-sm",
1947
1956
  variantClasses[variant],
1948
1957
  className
1949
1958
  ),
1950
1959
  role: "alert",
1951
- children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
1952
- /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 mt-0.5", children: /* @__PURE__ */ jsx(
1960
+ children: /* @__PURE__ */ jsxs(Box, { className: "flex items-start gap-3", children: [
1961
+ /* @__PURE__ */ jsx(Box, { className: "flex-shrink-0 mt-0.5", children: /* @__PURE__ */ jsx(
1953
1962
  Icon,
1954
1963
  {
1955
1964
  icon: iconMap[variant],
@@ -1957,25 +1966,22 @@ var init_Toast = __esm({
1957
1966
  className: iconColors[variant]
1958
1967
  }
1959
1968
  ) }),
1960
- /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
1969
+ /* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0", children: [
1961
1970
  title && /* @__PURE__ */ jsx(Typography, { variant: "h6", className: "mb-1", children: title }),
1962
1971
  /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-sm", children: message }),
1963
- actionLabel && (onAction || actionEvent) && /* @__PURE__ */ jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: handleAction, children: actionLabel }) })
1972
+ actionLabel && (onAction || actionEvent) && /* @__PURE__ */ jsx(Box, { className: "mt-3", children: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: handleAction, children: actionLabel }) })
1964
1973
  ] }),
1965
- /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 flex-shrink-0", children: [
1974
+ /* @__PURE__ */ jsxs(Box, { className: "flex items-start gap-2 flex-shrink-0", children: [
1966
1975
  badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: badge }),
1967
1976
  dismissible && /* @__PURE__ */ jsx(
1968
- "button",
1977
+ Button,
1969
1978
  {
1970
- type: "button",
1979
+ variant: "ghost",
1980
+ size: "sm",
1981
+ icon: X,
1971
1982
  onClick: handleDismiss,
1972
- className: cn(
1973
- "flex-shrink-0 p-1 transition-colors rounded-sm",
1974
- "hover:bg-muted",
1975
- "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2"
1976
- ),
1977
1983
  "aria-label": "Dismiss toast",
1978
- children: /* @__PURE__ */ jsx(Icon, { icon: X, size: "sm" })
1984
+ className: "flex-shrink-0"
1979
1985
  }
1980
1986
  )
1981
1987
  ] })
@@ -2143,7 +2149,7 @@ var init_SvgFlow = __esm({
2143
2149
  opacity = 1,
2144
2150
  className
2145
2151
  }) => {
2146
- const markerId = React80__default.useMemo(() => {
2152
+ const markerId = React83__default.useMemo(() => {
2147
2153
  flowIdCounter += 1;
2148
2154
  return `almadar-flow-arrow-${flowIdCounter}`;
2149
2155
  }, []);
@@ -2686,7 +2692,7 @@ var init_SvgRing = __esm({
2686
2692
  className,
2687
2693
  label
2688
2694
  }) => {
2689
- const gradientId = React80__default.useMemo(() => {
2695
+ const gradientId = React83__default.useMemo(() => {
2690
2696
  ringIdCounter += 1;
2691
2697
  return `almadar-ring-glow-${ringIdCounter}`;
2692
2698
  }, []);
@@ -2847,7 +2853,7 @@ var Input;
2847
2853
  var init_Input = __esm({
2848
2854
  "components/atoms/Input.tsx"() {
2849
2855
  init_cn();
2850
- Input = React80__default.forwardRef(
2856
+ Input = React83__default.forwardRef(
2851
2857
  ({
2852
2858
  className,
2853
2859
  inputType,
@@ -2965,7 +2971,7 @@ var Label;
2965
2971
  var init_Label = __esm({
2966
2972
  "components/atoms/Label.tsx"() {
2967
2973
  init_cn();
2968
- Label = React80__default.forwardRef(
2974
+ Label = React83__default.forwardRef(
2969
2975
  ({ className, required, children, ...props }, ref) => {
2970
2976
  return /* @__PURE__ */ jsxs(
2971
2977
  "label",
@@ -2991,7 +2997,7 @@ var Textarea;
2991
2997
  var init_Textarea = __esm({
2992
2998
  "components/atoms/Textarea.tsx"() {
2993
2999
  init_cn();
2994
- Textarea = React80__default.forwardRef(
3000
+ Textarea = React83__default.forwardRef(
2995
3001
  ({ className, error, ...props }, ref) => {
2996
3002
  return /* @__PURE__ */ jsx(
2997
3003
  "textarea",
@@ -3020,7 +3026,7 @@ var Select;
3020
3026
  var init_Select = __esm({
3021
3027
  "components/atoms/Select.tsx"() {
3022
3028
  init_cn();
3023
- Select = React80__default.forwardRef(
3029
+ Select = React83__default.forwardRef(
3024
3030
  ({ className, options, placeholder, error, ...props }, ref) => {
3025
3031
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
3026
3032
  /* @__PURE__ */ jsxs(
@@ -3062,7 +3068,7 @@ var Checkbox;
3062
3068
  var init_Checkbox = __esm({
3063
3069
  "components/atoms/Checkbox.tsx"() {
3064
3070
  init_cn();
3065
- Checkbox = React80__default.forwardRef(
3071
+ Checkbox = React83__default.forwardRef(
3066
3072
  ({ className, label, id, ...props }, ref) => {
3067
3073
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
3068
3074
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
@@ -3144,7 +3150,7 @@ var init_Card = __esm({
3144
3150
  md: "shadow",
3145
3151
  lg: "shadow-lg"
3146
3152
  };
3147
- Card = React80__default.forwardRef(
3153
+ Card = React83__default.forwardRef(
3148
3154
  ({
3149
3155
  className,
3150
3156
  variant = "bordered",
@@ -3180,9 +3186,9 @@ var init_Card = __esm({
3180
3186
  }
3181
3187
  );
3182
3188
  Card.displayName = "Card";
3183
- CardHeader = React80__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
3189
+ CardHeader = React83__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
3184
3190
  CardHeader.displayName = "CardHeader";
3185
- CardTitle = React80__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3191
+ CardTitle = React83__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3186
3192
  "h3",
3187
3193
  {
3188
3194
  ref,
@@ -3195,11 +3201,11 @@ var init_Card = __esm({
3195
3201
  }
3196
3202
  ));
3197
3203
  CardTitle.displayName = "CardTitle";
3198
- CardContent = React80__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
3204
+ CardContent = React83__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
3199
3205
  CardContent.displayName = "CardContent";
3200
3206
  CardBody = CardContent;
3201
3207
  CardBody.displayName = "CardBody";
3202
- CardFooter = React80__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3208
+ CardFooter = React83__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
3203
3209
  "div",
3204
3210
  {
3205
3211
  ref,
@@ -3254,7 +3260,7 @@ var init_FilterPill = __esm({
3254
3260
  md: "w-3.5 h-3.5",
3255
3261
  lg: "w-4 h-4"
3256
3262
  };
3257
- FilterPill = React80__default.forwardRef(
3263
+ FilterPill = React83__default.forwardRef(
3258
3264
  ({
3259
3265
  className,
3260
3266
  variant = "default",
@@ -3333,7 +3339,7 @@ var init_Spinner = __esm({
3333
3339
  md: "h-6 w-6",
3334
3340
  lg: "h-8 w-8"
3335
3341
  };
3336
- Spinner = React80__default.forwardRef(
3342
+ Spinner = React83__default.forwardRef(
3337
3343
  ({ className, size = "md", ...props }, ref) => {
3338
3344
  return /* @__PURE__ */ jsx(
3339
3345
  "div",
@@ -3781,7 +3787,7 @@ var Radio;
3781
3787
  var init_Radio = __esm({
3782
3788
  "components/atoms/Radio.tsx"() {
3783
3789
  init_cn();
3784
- Radio = React80__default.forwardRef(
3790
+ Radio = React83__default.forwardRef(
3785
3791
  ({
3786
3792
  label,
3787
3793
  helperText,
@@ -3953,7 +3959,7 @@ var init_Switch = __esm({
3953
3959
  "components/atoms/Switch.tsx"() {
3954
3960
  "use client";
3955
3961
  init_cn();
3956
- Switch = React80.forwardRef(
3962
+ Switch = React83.forwardRef(
3957
3963
  ({
3958
3964
  checked,
3959
3965
  defaultChecked = false,
@@ -3964,10 +3970,10 @@ var init_Switch = __esm({
3964
3970
  name,
3965
3971
  className
3966
3972
  }, ref) => {
3967
- const [isChecked, setIsChecked] = React80.useState(
3973
+ const [isChecked, setIsChecked] = React83.useState(
3968
3974
  checked !== void 0 ? checked : defaultChecked
3969
3975
  );
3970
- React80.useEffect(() => {
3976
+ React83.useEffect(() => {
3971
3977
  if (checked !== void 0) {
3972
3978
  setIsChecked(checked);
3973
3979
  }
@@ -4442,6 +4448,16 @@ var init_FlipContainer = __esm({
4442
4448
  FlipContainer.displayName = "FlipContainer";
4443
4449
  }
4444
4450
  });
4451
+ var Aside;
4452
+ var init_Aside = __esm({
4453
+ "components/atoms/Aside.tsx"() {
4454
+ init_cn();
4455
+ Aside = React83__default.forwardRef(
4456
+ ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
4457
+ );
4458
+ Aside.displayName = "Aside";
4459
+ }
4460
+ });
4445
4461
  function toSharedContext(ctx) {
4446
4462
  return createMinimalContext(
4447
4463
  {
@@ -4513,8 +4529,8 @@ var init_LawReferenceTooltip = __esm({
4513
4529
  position = "top",
4514
4530
  className
4515
4531
  }) => {
4516
- const [isVisible, setIsVisible] = React80__default.useState(false);
4517
- const timeoutRef = React80__default.useRef(null);
4532
+ const [isVisible, setIsVisible] = React83__default.useState(false);
4533
+ const timeoutRef = React83__default.useRef(null);
4518
4534
  const handleMouseEnter = () => {
4519
4535
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4520
4536
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -4523,7 +4539,7 @@ var init_LawReferenceTooltip = __esm({
4523
4539
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4524
4540
  setIsVisible(false);
4525
4541
  };
4526
- React80__default.useEffect(() => {
4542
+ React83__default.useEffect(() => {
4527
4543
  return () => {
4528
4544
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4529
4545
  };
@@ -4733,7 +4749,7 @@ var init_StatusDot = __esm({
4733
4749
  md: "w-2.5 h-2.5",
4734
4750
  lg: "w-3 h-3"
4735
4751
  };
4736
- StatusDot = React80__default.forwardRef(
4752
+ StatusDot = React83__default.forwardRef(
4737
4753
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
4738
4754
  return /* @__PURE__ */ jsx(
4739
4755
  "span",
@@ -4786,7 +4802,7 @@ var init_TrendIndicator = __esm({
4786
4802
  down: TrendingDown,
4787
4803
  flat: ArrowRight
4788
4804
  };
4789
- TrendIndicator = React80__default.forwardRef(
4805
+ TrendIndicator = React83__default.forwardRef(
4790
4806
  ({
4791
4807
  className,
4792
4808
  value,
@@ -4853,7 +4869,7 @@ var init_RangeSlider = __esm({
4853
4869
  md: "w-4 h-4",
4854
4870
  lg: "w-5 h-5"
4855
4871
  };
4856
- RangeSlider = React80__default.forwardRef(
4872
+ RangeSlider = React83__default.forwardRef(
4857
4873
  ({
4858
4874
  className,
4859
4875
  min = 0,
@@ -5386,7 +5402,7 @@ var init_ContentSection = __esm({
5386
5402
  md: "py-16",
5387
5403
  lg: "py-24"
5388
5404
  };
5389
- ContentSection = React80__default.forwardRef(
5405
+ ContentSection = React83__default.forwardRef(
5390
5406
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
5391
5407
  return /* @__PURE__ */ jsx(
5392
5408
  Box,
@@ -5920,7 +5936,7 @@ var init_AnimatedReveal = __esm({
5920
5936
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
5921
5937
  "none": {}
5922
5938
  };
5923
- AnimatedReveal = React80__default.forwardRef(
5939
+ AnimatedReveal = React83__default.forwardRef(
5924
5940
  ({
5925
5941
  trigger = "scroll",
5926
5942
  animation = "fade-up",
@@ -6080,7 +6096,7 @@ var init_AnimatedGraphic = __esm({
6080
6096
  "components/atoms/AnimatedGraphic.tsx"() {
6081
6097
  "use client";
6082
6098
  init_cn();
6083
- AnimatedGraphic = React80__default.forwardRef(
6099
+ AnimatedGraphic = React83__default.forwardRef(
6084
6100
  ({
6085
6101
  src,
6086
6102
  svgContent,
@@ -6103,7 +6119,7 @@ var init_AnimatedGraphic = __esm({
6103
6119
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
6104
6120
  const resolvedSvg = svgContent ?? fetchedSvg;
6105
6121
  const prevAnimateRef = useRef(animate);
6106
- const setRef = React80__default.useCallback(
6122
+ const setRef = React83__default.useCallback(
6107
6123
  (node) => {
6108
6124
  containerRef.current = node;
6109
6125
  if (typeof ref === "function") ref(node);
@@ -6328,9 +6344,9 @@ function ScoreDisplay({
6328
6344
  ...rest
6329
6345
  }) {
6330
6346
  const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
6331
- const [displayValue, setDisplayValue] = React80.useState(resolvedValue);
6332
- const [isAnimating, setIsAnimating] = React80.useState(false);
6333
- React80.useEffect(() => {
6347
+ const [displayValue, setDisplayValue] = React83.useState(resolvedValue);
6348
+ const [isAnimating, setIsAnimating] = React83.useState(false);
6349
+ React83.useEffect(() => {
6334
6350
  if (!animated || displayValue === resolvedValue) {
6335
6351
  setDisplayValue(resolvedValue);
6336
6352
  return;
@@ -6400,9 +6416,9 @@ function ControlButton({
6400
6416
  className
6401
6417
  }) {
6402
6418
  const eventBus = useEventBus();
6403
- const [isPressed, setIsPressed] = React80.useState(false);
6419
+ const [isPressed, setIsPressed] = React83.useState(false);
6404
6420
  const actualPressed = pressed ?? isPressed;
6405
- const handlePointerDown = React80.useCallback(
6421
+ const handlePointerDown = React83.useCallback(
6406
6422
  (e) => {
6407
6423
  e.preventDefault();
6408
6424
  if (disabled) return;
@@ -6412,7 +6428,7 @@ function ControlButton({
6412
6428
  },
6413
6429
  [disabled, pressEvent, eventBus, onPress]
6414
6430
  );
6415
- const handlePointerUp = React80.useCallback(
6431
+ const handlePointerUp = React83.useCallback(
6416
6432
  (e) => {
6417
6433
  e.preventDefault();
6418
6434
  if (disabled) return;
@@ -6422,7 +6438,7 @@ function ControlButton({
6422
6438
  },
6423
6439
  [disabled, releaseEvent, eventBus, onRelease]
6424
6440
  );
6425
- const handlePointerLeave = React80.useCallback(
6441
+ const handlePointerLeave = React83.useCallback(
6426
6442
  (e) => {
6427
6443
  if (isPressed) {
6428
6444
  setIsPressed(false);
@@ -7328,9 +7344,9 @@ function MiniMap({
7328
7344
  viewportRect,
7329
7345
  className
7330
7346
  }) {
7331
- const canvasRef = React80.useRef(null);
7332
- const frameRef = React80.useRef(0);
7333
- React80.useEffect(() => {
7347
+ const canvasRef = React83.useRef(null);
7348
+ const frameRef = React83.useRef(0);
7349
+ React83.useEffect(() => {
7334
7350
  const canvas = canvasRef.current;
7335
7351
  if (!canvas) return;
7336
7352
  const ctx = canvas.getContext("2d");
@@ -7493,7 +7509,7 @@ var init_ErrorBoundary = __esm({
7493
7509
  "use client";
7494
7510
  init_cn();
7495
7511
  init_ErrorState();
7496
- ErrorBoundary = class extends React80__default.Component {
7512
+ ErrorBoundary = class extends React83__default.Component {
7497
7513
  constructor(props) {
7498
7514
  super(props);
7499
7515
  __publicField(this, "reset", () => {
@@ -8073,7 +8089,7 @@ var init_HeroSection = __esm({
8073
8089
  HeroSection.displayName = "HeroSection";
8074
8090
  }
8075
8091
  });
8076
- var ArticleSection;
8092
+ var maxWidthMap, ArticleSection;
8077
8093
  var init_ArticleSection = __esm({
8078
8094
  "components/molecules/ArticleSection.tsx"() {
8079
8095
  "use client";
@@ -8081,6 +8097,11 @@ var init_ArticleSection = __esm({
8081
8097
  init_Box();
8082
8098
  init_Stack();
8083
8099
  init_Typography();
8100
+ maxWidthMap = {
8101
+ sm: "max-w-full sm:max-w-xl md:max-w-2xl",
8102
+ md: "max-w-full sm:max-w-2xl md:max-w-3xl",
8103
+ lg: "max-w-full sm:max-w-3xl md:max-w-4xl"
8104
+ };
8084
8105
  ArticleSection = ({
8085
8106
  title,
8086
8107
  children,
@@ -8095,7 +8116,7 @@ var init_ArticleSection = __esm({
8095
8116
  className
8096
8117
  ),
8097
8118
  padding: "md",
8098
- children: /* @__PURE__ */ jsxs(VStack, { gap: "lg", align: "start", children: [
8119
+ children: /* @__PURE__ */ jsxs(VStack, { gap: "lg", align: "start", className: cn("w-full mx-auto", maxWidthMap[maxWidth]), children: [
8099
8120
  /* @__PURE__ */ jsx(Typography, { variant: "h2", children: title }),
8100
8121
  /* @__PURE__ */ jsx(Box, { className: "w-full", children })
8101
8122
  ] })
@@ -8147,6 +8168,7 @@ var init_TeamCard = __esm({
8147
8168
  var gapStyles2, colStyles, SimpleGrid;
8148
8169
  var init_SimpleGrid = __esm({
8149
8170
  "components/molecules/SimpleGrid.tsx"() {
8171
+ init_Box();
8150
8172
  init_cn();
8151
8173
  gapStyles2 = {
8152
8174
  none: "gap-0",
@@ -8159,10 +8181,10 @@ var init_SimpleGrid = __esm({
8159
8181
  colStyles = {
8160
8182
  1: "grid-cols-1",
8161
8183
  2: "grid-cols-1 sm:grid-cols-2",
8162
- 3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
8163
- 4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",
8164
- 5: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5",
8165
- 6: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6"
8184
+ 3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3",
8185
+ 4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
8186
+ 5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",
8187
+ 6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6"
8166
8188
  };
8167
8189
  SimpleGrid = ({
8168
8190
  minChildWidth = 250,
@@ -8173,12 +8195,12 @@ var init_SimpleGrid = __esm({
8173
8195
  children
8174
8196
  }) => {
8175
8197
  if (cols) {
8176
- return /* @__PURE__ */ jsx("div", { className: cn("grid", colStyles[cols], gapStyles2[gap], className), children });
8198
+ return /* @__PURE__ */ jsx(Box, { className: cn("grid", colStyles[cols], gapStyles2[gap], className), children });
8177
8199
  }
8178
8200
  const minWidth = typeof minChildWidth === "number" ? `${minChildWidth}px` : minChildWidth;
8179
8201
  const templateColumns = maxCols ? `repeat(auto-fit, minmax(min(${minWidth}, 100%), 1fr))` : `repeat(auto-fit, minmax(${minWidth}, 1fr))`;
8180
8202
  return /* @__PURE__ */ jsx(
8181
- "div",
8203
+ Box,
8182
8204
  {
8183
8205
  className: cn("grid", gapStyles2[gap], className),
8184
8206
  style: {
@@ -8568,8 +8590,8 @@ var init_Tooltip = __esm({
8568
8590
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
8569
8591
  };
8570
8592
  }, []);
8571
- const triggerElement = React80__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
8572
- const trigger = React80__default.cloneElement(triggerElement, {
8593
+ const triggerElement = React83__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
8594
+ const trigger = React83__default.cloneElement(triggerElement, {
8573
8595
  ref: triggerRef,
8574
8596
  onMouseEnter: handleMouseEnter,
8575
8597
  onMouseLeave: handleMouseLeave,
@@ -8690,8 +8712,8 @@ var init_Popover = __esm({
8690
8712
  onMouseEnter: handleOpen,
8691
8713
  onMouseLeave: handleClose
8692
8714
  };
8693
- const childElement = React80__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
8694
- const triggerElement = React80__default.cloneElement(
8715
+ const childElement = React83__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
8716
+ const triggerElement = React83__default.cloneElement(
8695
8717
  childElement,
8696
8718
  {
8697
8719
  ref: triggerRef,
@@ -8740,6 +8762,7 @@ var Menu;
8740
8762
  var init_Menu = __esm({
8741
8763
  "components/molecules/Menu.tsx"() {
8742
8764
  "use client";
8765
+ init_Box();
8743
8766
  init_Icon();
8744
8767
  init_Divider();
8745
8768
  init_Typography();
@@ -8808,8 +8831,8 @@ var init_Menu = __esm({
8808
8831
  "bottom-start": "top-full left-0 mt-2",
8809
8832
  "bottom-end": "top-full right-0 mt-2"
8810
8833
  };
8811
- const triggerChild = React80__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
8812
- const triggerElement = React80__default.cloneElement(
8834
+ const triggerChild = React83__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
8835
+ const triggerElement = React83__default.cloneElement(
8813
8836
  triggerChild,
8814
8837
  {
8815
8838
  ref: triggerRef,
@@ -8821,17 +8844,17 @@ var init_Menu = __esm({
8821
8844
  "border-[length:var(--border-width)] border-border",
8822
8845
  "shadow",
8823
8846
  "rounded-sm",
8824
- "min-w-[200px] py-1"
8847
+ "min-w-0 sm:min-w-[200px] max-w-[calc(100vw-1rem)] py-1"
8825
8848
  );
8826
8849
  const renderMenuItem = (item, hasSubMenu, index) => {
8827
8850
  const itemId = item.id ?? `item-${item.label.toLowerCase().replace(/\s+/g, "-")}-${index}`;
8828
8851
  const isDanger = item.variant === "danger";
8829
8852
  return /* @__PURE__ */ jsx(
8830
- "button",
8853
+ Box,
8831
8854
  {
8832
- type: "button",
8833
- onClick: () => handleItemClick({ ...item, id: itemId }),
8834
- disabled: item.disabled,
8855
+ as: "button",
8856
+ onClick: () => !item.disabled && handleItemClick({ ...item, id: itemId }),
8857
+ "aria-disabled": item.disabled || void 0,
8835
8858
  onMouseEnter: () => hasSubMenu && setActiveSubMenu(itemId),
8836
8859
  "data-testid": item.event ? `action-${item.event}` : void 0,
8837
8860
  className: cn(
@@ -8843,7 +8866,7 @@ var init_Menu = __esm({
8843
8866
  item.disabled && "cursor-not-allowed",
8844
8867
  isDanger && "text-error hover:bg-error/10"
8845
8868
  ),
8846
- children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: [
8869
+ children: /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-3 flex-1 min-w-0", children: [
8847
8870
  item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, size: "sm", className: "flex-shrink-0" }) : /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm", className: "flex-shrink-0" })),
8848
8871
  /* @__PURE__ */ jsx(
8849
8872
  Typography,
@@ -8868,10 +8891,10 @@ var init_Menu = __esm({
8868
8891
  if (isDivider) {
8869
8892
  return /* @__PURE__ */ jsx(Divider, { className: "my-1" }, `divider-${index}`);
8870
8893
  }
8871
- return /* @__PURE__ */ jsxs("div", { children: [
8894
+ return /* @__PURE__ */ jsxs(Box, { children: [
8872
8895
  renderMenuItem(item, !!hasSubMenu, index),
8873
8896
  hasSubMenu && activeSubMenu === itemId && item.subMenu && /* @__PURE__ */ jsx(
8874
- "div",
8897
+ Box,
8875
8898
  {
8876
8899
  className: cn(
8877
8900
  "absolute left-full top-0 ml-2 z-50",
@@ -8883,10 +8906,10 @@ var init_Menu = __esm({
8883
8906
  ] }, itemId);
8884
8907
  });
8885
8908
  };
8886
- return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
8909
+ return /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
8887
8910
  triggerElement,
8888
8911
  isOpen && triggerRect && /* @__PURE__ */ jsx(
8889
- "div",
8912
+ Box,
8890
8913
  {
8891
8914
  ref: menuRef,
8892
8915
  className: cn(
@@ -9225,13 +9248,13 @@ var init_MapView = __esm({
9225
9248
  shadowSize: [41, 41]
9226
9249
  });
9227
9250
  L.Marker.prototype.options.icon = defaultIcon;
9228
- const { useEffect: useEffect68, useRef: useRef65, useCallback: useCallback112, useState: useState99 } = React80__default;
9251
+ const { useEffect: useEffect69, useRef: useRef65, useCallback: useCallback112, useState: useState100 } = React83__default;
9229
9252
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
9230
9253
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
9231
9254
  function MapUpdater({ centerLat, centerLng, zoom }) {
9232
9255
  const map = useMap();
9233
9256
  const prevRef = useRef65({ centerLat, centerLng, zoom });
9234
- useEffect68(() => {
9257
+ useEffect69(() => {
9235
9258
  const prev = prevRef.current;
9236
9259
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
9237
9260
  map.setView([centerLat, centerLng], zoom);
@@ -9242,7 +9265,7 @@ var init_MapView = __esm({
9242
9265
  }
9243
9266
  function MapClickHandler({ onMapClick }) {
9244
9267
  const map = useMap();
9245
- useEffect68(() => {
9268
+ useEffect69(() => {
9246
9269
  if (!onMapClick) return;
9247
9270
  const handler = (e) => {
9248
9271
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -9270,7 +9293,7 @@ var init_MapView = __esm({
9270
9293
  showAttribution = true
9271
9294
  }) {
9272
9295
  const eventBus = useEventBus2();
9273
- const [clickedPosition, setClickedPosition] = useState99(null);
9296
+ const [clickedPosition, setClickedPosition] = useState100(null);
9274
9297
  const handleMapClick = useCallback112((lat, lng) => {
9275
9298
  if (showClickedPin) {
9276
9299
  setClickedPosition({ lat, lng });
@@ -9471,7 +9494,7 @@ function InputPattern({
9471
9494
  fieldName
9472
9495
  }) {
9473
9496
  const { emit } = useEventBus();
9474
- const [localValue, setLocalValue] = React80__default.useState(value);
9497
+ const [localValue, setLocalValue] = React83__default.useState(value);
9475
9498
  const handleChange = (e) => {
9476
9499
  setLocalValue(e.target.value);
9477
9500
  if (onChange) {
@@ -9509,7 +9532,7 @@ function TextareaPattern({
9509
9532
  fieldName
9510
9533
  }) {
9511
9534
  const { emit } = useEventBus();
9512
- const [localValue, setLocalValue] = React80__default.useState(value);
9535
+ const [localValue, setLocalValue] = React83__default.useState(value);
9513
9536
  const handleChange = (e) => {
9514
9537
  setLocalValue(e.target.value);
9515
9538
  if (onChange) {
@@ -9541,7 +9564,7 @@ function SelectPattern({
9541
9564
  fieldName
9542
9565
  }) {
9543
9566
  const { emit } = useEventBus();
9544
- const [localValue, setLocalValue] = React80__default.useState(value);
9567
+ const [localValue, setLocalValue] = React83__default.useState(value);
9545
9568
  const handleChange = (e) => {
9546
9569
  setLocalValue(e.target.value);
9547
9570
  if (onChange) {
@@ -9570,7 +9593,7 @@ function CheckboxPattern({
9570
9593
  className
9571
9594
  }) {
9572
9595
  const { emit } = useEventBus();
9573
- const [localChecked, setLocalChecked] = React80__default.useState(checked);
9596
+ const [localChecked, setLocalChecked] = React83__default.useState(checked);
9574
9597
  const handleChange = (e) => {
9575
9598
  setLocalChecked(e.target.checked);
9576
9599
  if (onChange) {
@@ -9801,8 +9824,8 @@ function ActionButtons({
9801
9824
  disabled
9802
9825
  }) {
9803
9826
  const eventBus = useEventBus();
9804
- const [activeButtons, setActiveButtons] = React80.useState(/* @__PURE__ */ new Set());
9805
- const handlePress = React80.useCallback(
9827
+ const [activeButtons, setActiveButtons] = React83.useState(/* @__PURE__ */ new Set());
9828
+ const handlePress = React83.useCallback(
9806
9829
  (id) => {
9807
9830
  setActiveButtons((prev) => new Set(prev).add(id));
9808
9831
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -9810,7 +9833,7 @@ function ActionButtons({
9810
9833
  },
9811
9834
  [actionEvent, eventBus, onAction]
9812
9835
  );
9813
- const handleRelease = React80.useCallback(
9836
+ const handleRelease = React83.useCallback(
9814
9837
  (id) => {
9815
9838
  setActiveButtons((prev) => {
9816
9839
  const next = new Set(prev);
@@ -12673,7 +12696,7 @@ var init_MarkdownContent = __esm({
12673
12696
  init_Box();
12674
12697
  init_useTranslate();
12675
12698
  init_cn();
12676
- MarkdownContent = React80__default.memo(
12699
+ MarkdownContent = React83__default.memo(
12677
12700
  ({ content, direction, className }) => {
12678
12701
  const { t: _t } = useTranslate();
12679
12702
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -12891,7 +12914,7 @@ var init_CodeBlock = __esm({
12891
12914
  log7 = createLogger("almadar:ui:markdown-code");
12892
12915
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
12893
12916
  HIDDEN_LINE_NUMBERS = { display: "none" };
12894
- CodeBlock = React80__default.memo(
12917
+ CodeBlock = React83__default.memo(
12895
12918
  ({
12896
12919
  code: rawCode,
12897
12920
  language = "text",
@@ -14150,7 +14173,7 @@ var init_StateMachineView = __esm({
14150
14173
  style: { top: title ? 30 : 0 },
14151
14174
  children: [
14152
14175
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
14153
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React80__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
14176
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React83__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
14154
14177
  StateNode,
14155
14178
  {
14156
14179
  state,
@@ -15731,27 +15754,23 @@ var init_Grid = __esm({
15731
15754
  as: Component = "div"
15732
15755
  }) => {
15733
15756
  const mergedStyle = rows ? { gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`, ...style } : style;
15734
- const Comp = Component;
15735
- return /* @__PURE__ */ jsx(
15736
- Comp,
15757
+ return React83__default.createElement(
15758
+ Component,
15737
15759
  {
15738
15760
  className: cn(
15739
15761
  "grid",
15740
15762
  getColsClass(cols),
15741
- // Gap (rowGap/colGap override gap)
15742
15763
  rowGap ? rowGapStyles[rowGap] : colGap ? void 0 : gapStyles3[gap],
15743
15764
  colGap ? colGapStyles[colGap] : rowGap ? void 0 : void 0,
15744
15765
  rowGap && colGap ? `${rowGapStyles[rowGap]} ${colGapStyles[colGap]}` : void 0,
15745
- // Alignment
15746
15766
  alignItems && alignStyles2[alignItems],
15747
15767
  justifyItems && justifyStyles2[justifyItems],
15748
- // Flow
15749
15768
  flow && flowStyles[flow],
15750
15769
  className
15751
15770
  ),
15752
- style: mergedStyle,
15753
- children
15754
- }
15771
+ style: mergedStyle
15772
+ },
15773
+ children
15755
15774
  );
15756
15775
  };
15757
15776
  Grid.displayName = "Grid";
@@ -16703,6 +16722,35 @@ var init_ButtonGroup = __esm({
16703
16722
  ButtonGroup.displayName = "ButtonGroup";
16704
16723
  }
16705
16724
  });
16725
+ function dayWindowForViewport(width) {
16726
+ if (width <= 640) return 1;
16727
+ if (width <= 1024) return 3;
16728
+ return 7;
16729
+ }
16730
+ function useDayWindow(override) {
16731
+ const [w, setW] = useState(() => {
16732
+ if (override !== "auto") return override;
16733
+ if (typeof window === "undefined") return 7;
16734
+ return dayWindowForViewport(window.innerWidth);
16735
+ });
16736
+ useEffect(() => {
16737
+ if (override !== "auto") {
16738
+ setW(override);
16739
+ return void 0;
16740
+ }
16741
+ if (typeof window === "undefined") return void 0;
16742
+ const onResize = () => setW(dayWindowForViewport(window.innerWidth));
16743
+ onResize();
16744
+ window.addEventListener("resize", onResize);
16745
+ return () => window.removeEventListener("resize", onResize);
16746
+ }, [override]);
16747
+ return w;
16748
+ }
16749
+ function formatDateRange(start, end) {
16750
+ const startStr = start.toLocaleDateString(void 0, SHORT_DATE);
16751
+ const endStr = end.toLocaleDateString(void 0, SHORT_DATE);
16752
+ return start.toDateString() === end.toDateString() ? startStr : `${startStr} \u2013 ${endStr}`;
16753
+ }
16706
16754
  function getStartOfWeek(date) {
16707
16755
  const d = new Date(date);
16708
16756
  const day = d.getDay();
@@ -16743,7 +16791,8 @@ function CalendarGrid({
16743
16791
  longPressEvent,
16744
16792
  longPressPayload,
16745
16793
  swipeLeftEvent,
16746
- swipeRightEvent
16794
+ swipeRightEvent,
16795
+ dayWindow = "auto"
16747
16796
  }) {
16748
16797
  const eventBus = useEventBus();
16749
16798
  const longPressTimer = useRef(null);
@@ -16759,6 +16808,26 @@ function CalendarGrid({
16759
16808
  () => timeSlots ?? generateDefaultTimeSlots(),
16760
16809
  [timeSlots]
16761
16810
  );
16811
+ const visibleCount = useDayWindow(dayWindow);
16812
+ const [dayOffset, setDayOffset] = useState(0);
16813
+ useEffect(() => {
16814
+ if (dayOffset + visibleCount > 7) {
16815
+ setDayOffset(Math.max(0, 7 - visibleCount));
16816
+ }
16817
+ }, [visibleCount, dayOffset]);
16818
+ const visibleDays = useMemo(
16819
+ () => weekDays.slice(dayOffset, dayOffset + visibleCount),
16820
+ [weekDays, dayOffset, visibleCount]
16821
+ );
16822
+ const canPrev = dayOffset > 0;
16823
+ const canNext = dayOffset + visibleCount < 7;
16824
+ const stepPrev = useCallback(() => {
16825
+ setDayOffset((d) => Math.max(0, d - visibleCount));
16826
+ }, [visibleCount]);
16827
+ const stepNext = useCallback(() => {
16828
+ setDayOffset((d) => Math.min(7 - visibleCount, d + visibleCount));
16829
+ }, [visibleCount]);
16830
+ const gridColsClass = visibleCount === 1 ? "grid-cols-2" : visibleCount === 3 ? "grid-cols-4" : "grid-cols-8";
16762
16831
  const handleSlotClick = useCallback(
16763
16832
  (day, time) => {
16764
16833
  onSlotClick?.(day, time);
@@ -16810,93 +16879,124 @@ function CalendarGrid({
16810
16879
  },
16811
16880
  event.id
16812
16881
  );
16813
- return /* @__PURE__ */ jsx(
16882
+ return /* @__PURE__ */ jsxs(
16814
16883
  Box,
16815
16884
  {
16816
- className: cn("overflow-x-auto", className),
16885
+ className,
16817
16886
  ...swipeLeftEvent || swipeRightEvent ? {
16818
16887
  onPointerDown: swipe.onPointerDown,
16819
16888
  onPointerMove: swipe.onPointerMove,
16820
16889
  onPointerUp: swipe.onPointerUp,
16821
16890
  onPointerCancel: swipe.onPointerCancel
16822
16891
  } : {},
16823
- children: /* @__PURE__ */ jsxs(Box, { className: "min-w-[800px]", children: [
16824
- /* @__PURE__ */ jsxs(Box, { className: "grid grid-cols-8 border-b border-border", children: [
16825
- /* @__PURE__ */ jsx(Box, { className: "p-2" }),
16826
- weekDays.map((day) => {
16827
- const isToday = day.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
16828
- const count = eventsForDayCount(day);
16829
- return /* @__PURE__ */ jsxs(
16830
- Box,
16831
- {
16832
- className: "border-l border-border",
16833
- children: [
16834
- /* @__PURE__ */ jsx(
16835
- DayCell,
16836
- {
16837
- date: day,
16838
- isToday,
16839
- onClick: onDayClick
16840
- }
16841
- ),
16842
- count > 0 && /* @__PURE__ */ jsx(Box, { className: "text-center pb-1", children: /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: count }) })
16843
- ]
16844
- },
16845
- day.toISOString()
16846
- );
16847
- })
16892
+ children: [
16893
+ visibleCount < 7 && /* @__PURE__ */ jsxs(HStack, { align: "center", justify: "between", className: "mb-2 px-2", children: [
16894
+ /* @__PURE__ */ jsx(
16895
+ Button,
16896
+ {
16897
+ variant: "ghost",
16898
+ size: "sm",
16899
+ icon: ChevronLeft,
16900
+ onClick: stepPrev,
16901
+ "aria-disabled": !canPrev || void 0,
16902
+ "aria-label": "Previous days",
16903
+ children: "Prev"
16904
+ }
16905
+ ),
16906
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: formatDateRange(visibleDays[0], visibleDays[visibleDays.length - 1]) }),
16907
+ /* @__PURE__ */ jsx(
16908
+ Button,
16909
+ {
16910
+ variant: "ghost",
16911
+ size: "sm",
16912
+ iconRight: ChevronRight,
16913
+ onClick: stepNext,
16914
+ "aria-disabled": !canNext || void 0,
16915
+ "aria-label": "Next days",
16916
+ children: "Next"
16917
+ }
16918
+ )
16848
16919
  ] }),
16849
- /* @__PURE__ */ jsx(Box, { className: "max-h-[500px] overflow-y-auto", children: resolvedTimeSlots.map((time) => /* @__PURE__ */ jsxs(
16850
- Box,
16851
- {
16852
- className: "grid grid-cols-8 border-b border-border",
16853
- children: [
16854
- /* @__PURE__ */ jsx(Box, { className: "p-2 text-right pr-3", children: /* @__PURE__ */ jsx(
16855
- Typography,
16920
+ /* @__PURE__ */ jsxs(Box, { children: [
16921
+ /* @__PURE__ */ jsxs(Box, { className: cn("grid border-b border-border", gridColsClass), children: [
16922
+ /* @__PURE__ */ jsx(Box, { className: "p-2" }),
16923
+ visibleDays.map((day) => {
16924
+ const isToday = day.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
16925
+ const count = eventsForDayCount(day);
16926
+ return /* @__PURE__ */ jsxs(
16927
+ Box,
16856
16928
  {
16857
- variant: "small",
16858
- className: "text-muted-foreground",
16859
- children: time
16860
- }
16861
- ) }),
16862
- weekDays.map((day) => {
16863
- const slotEvents = events2.filter(
16864
- (ev) => eventInSlot(ev, day, time)
16865
- );
16866
- const isToday = day.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
16867
- return /* @__PURE__ */ jsx(
16868
- TimeSlotCell,
16869
- {
16870
- time,
16871
- isOccupied: slotEvents.length > 0,
16872
- onClick: () => handleSlotClick(day, time),
16873
- className: cn(
16874
- "border-l border-border",
16875
- isToday && "bg-blue-50/30"
16929
+ className: "border-l border-border",
16930
+ children: [
16931
+ /* @__PURE__ */ jsx(
16932
+ DayCell,
16933
+ {
16934
+ date: day,
16935
+ isToday,
16936
+ onClick: onDayClick
16937
+ }
16876
16938
  ),
16877
- ...longPressEvent ? {
16878
- onPointerDown: () => startLongPress(day, time),
16879
- onPointerUp: clearLongPress,
16880
- onPointerCancel: clearLongPress
16881
- } : {},
16882
- children: /* @__PURE__ */ jsx(VStack, { gap: "xs", children: slotEvents.map(renderEvent) })
16883
- },
16884
- `${day.toISOString()}-${time}`
16885
- );
16886
- })
16887
- ]
16888
- },
16889
- time
16890
- )) })
16891
- ] })
16939
+ count > 0 && /* @__PURE__ */ jsx(Box, { className: "text-center pb-1", children: /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: count }) })
16940
+ ]
16941
+ },
16942
+ day.toISOString()
16943
+ );
16944
+ })
16945
+ ] }),
16946
+ /* @__PURE__ */ jsx(Box, { className: "max-h-[500px] overflow-y-auto", children: resolvedTimeSlots.map((time) => /* @__PURE__ */ jsxs(
16947
+ Box,
16948
+ {
16949
+ className: cn("grid border-b border-border", gridColsClass),
16950
+ children: [
16951
+ /* @__PURE__ */ jsx(Box, { className: "p-2 text-right pr-3", children: /* @__PURE__ */ jsx(
16952
+ Typography,
16953
+ {
16954
+ variant: "small",
16955
+ className: "text-muted-foreground",
16956
+ children: time
16957
+ }
16958
+ ) }),
16959
+ visibleDays.map((day) => {
16960
+ const slotEvents = events2.filter(
16961
+ (ev) => eventInSlot(ev, day, time)
16962
+ );
16963
+ const isToday = day.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
16964
+ return /* @__PURE__ */ jsx(
16965
+ TimeSlotCell,
16966
+ {
16967
+ time,
16968
+ isOccupied: slotEvents.length > 0,
16969
+ onClick: () => handleSlotClick(day, time),
16970
+ className: cn(
16971
+ "border-l border-border",
16972
+ isToday && "bg-blue-50/30"
16973
+ ),
16974
+ ...longPressEvent ? {
16975
+ onPointerDown: () => startLongPress(day, time),
16976
+ onPointerUp: clearLongPress,
16977
+ onPointerCancel: clearLongPress
16978
+ } : {},
16979
+ children: /* @__PURE__ */ jsx(VStack, { gap: "xs", children: slotEvents.map(renderEvent) })
16980
+ },
16981
+ `${day.toISOString()}-${time}`
16982
+ );
16983
+ })
16984
+ ]
16985
+ },
16986
+ time
16987
+ )) })
16988
+ ] })
16989
+ ]
16892
16990
  }
16893
16991
  );
16894
16992
  }
16993
+ var SHORT_DATE;
16895
16994
  var init_CalendarGrid = __esm({
16896
16995
  "components/molecules/CalendarGrid.tsx"() {
16897
16996
  "use client";
16898
16997
  init_cn();
16899
16998
  init_Box();
16999
+ init_Button();
16900
17000
  init_Stack();
16901
17001
  init_Typography();
16902
17002
  init_Badge();
@@ -16904,6 +17004,7 @@ var init_CalendarGrid = __esm({
16904
17004
  init_TimeSlotCell();
16905
17005
  init_useEventBus();
16906
17006
  init_useSwipeGesture();
17007
+ SHORT_DATE = { month: "short", day: "numeric" };
16907
17008
  CalendarGrid.displayName = "CalendarGrid";
16908
17009
  }
16909
17010
  });
@@ -20065,9 +20166,9 @@ var init_Tabs = __esm({
20065
20166
  className
20066
20167
  }) => {
20067
20168
  const rawItems = items ?? tabs ?? [];
20068
- const safeItems = rawItems.map((item) => ({
20069
- ...item,
20070
- id: item.id || item.value || ""
20169
+ const safeItems = rawItems.map(({ id, value, ...rest }) => ({
20170
+ ...rest,
20171
+ id: id || value || ""
20071
20172
  }));
20072
20173
  const eventBus = useEventBus();
20073
20174
  const { t } = useTranslate();
@@ -20136,7 +20237,12 @@ var init_Tabs = __esm({
20136
20237
  role: "tablist",
20137
20238
  className: cn(
20138
20239
  "flex",
20139
- orientation === "horizontal" ? "flex-row border-b-[length:var(--border-width)] border-border" : "flex-col border-r-[length:var(--border-width)] border-border",
20240
+ // Horizontal tab strip becomes a horizontally-scrollable lane
20241
+ // below its container width — phones with many tabs scroll
20242
+ // instead of clipping. `snap-x` snaps to each tab; the
20243
+ // scrollbar is hidden for a cleaner affordance (the swipe
20244
+ // gesture is the discoverability cue).
20245
+ orientation === "horizontal" ? "flex-row border-b-[length:var(--border-width)] border-border overflow-x-auto snap-x snap-mandatory [&::-webkit-scrollbar]:hidden" : "flex-col border-r-[length:var(--border-width)] border-border",
20140
20246
  variant === "pills" && "gap-1 p-1 bg-muted border-0 rounded-md",
20141
20247
  variant === "underline" && orientation === "vertical" && "border-b-0"
20142
20248
  ),
@@ -20158,7 +20264,8 @@ var init_Tabs = __esm({
20158
20264
  onKeyDown: (e) => handleKeyDown(e, index),
20159
20265
  "data-active": isActive,
20160
20266
  className: cn(
20161
- "flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all",
20267
+ "flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all whitespace-nowrap",
20268
+ orientation === "horizontal" && "snap-start shrink-0",
20162
20269
  "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
20163
20270
  isDisabled && "opacity-50 cursor-not-allowed",
20164
20271
  variantClasses2[variant],
@@ -20923,7 +21030,7 @@ function CraftingRecipe({
20923
21030
  className
20924
21031
  }) {
20925
21032
  const eventBus = useEventBus();
20926
- const handleCraft = React80.useCallback(() => {
21033
+ const handleCraft = React83.useCallback(() => {
20927
21034
  onCraft?.();
20928
21035
  if (craftEvent) {
20929
21036
  eventBus.emit(craftEvent, { output: output.label });
@@ -20940,7 +21047,7 @@ function CraftingRecipe({
20940
21047
  children: [
20941
21048
  /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
20942
21049
  const hasSufficient = ingredient.available >= ingredient.required;
20943
- return /* @__PURE__ */ jsxs(React80.Fragment, { children: [
21050
+ return /* @__PURE__ */ jsxs(React83.Fragment, { children: [
20944
21051
  /* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
20945
21052
  ItemSlot,
20946
21053
  {
@@ -21003,8 +21110,8 @@ function DPad({
21003
21110
  }) {
21004
21111
  const eventBus = useEventBus();
21005
21112
  const sizes = sizeMap15[size];
21006
- const [activeDirections, setActiveDirections] = React80.useState(/* @__PURE__ */ new Set());
21007
- const handlePress = React80.useCallback(
21113
+ const [activeDirections, setActiveDirections] = React83.useState(/* @__PURE__ */ new Set());
21114
+ const handlePress = React83.useCallback(
21008
21115
  (direction) => {
21009
21116
  setActiveDirections((prev) => new Set(prev).add(direction));
21010
21117
  if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
@@ -21012,7 +21119,7 @@ function DPad({
21012
21119
  },
21013
21120
  [directionEvent, eventBus, onDirection]
21014
21121
  );
21015
- const handleRelease = React80.useCallback(
21122
+ const handleRelease = React83.useCallback(
21016
21123
  (direction) => {
21017
21124
  setActiveDirections((prev) => {
21018
21125
  const next = new Set(prev);
@@ -21204,12 +21311,12 @@ var init_DashboardLayout = __esm({
21204
21311
  HStack,
21205
21312
  {
21206
21313
  gap: "none",
21207
- className: "min-h-screen w-full bg-background dark:bg-background items-stretch",
21314
+ className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background items-stretch",
21208
21315
  children: [
21209
21316
  sidebarOpen && /* @__PURE__ */ jsx(
21210
21317
  Box,
21211
21318
  {
21212
- className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 lg:hidden",
21319
+ className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 @lg/dashboard:hidden",
21213
21320
  onClick: () => setSidebarOpen(false)
21214
21321
  }
21215
21322
  ),
@@ -21219,7 +21326,7 @@ var init_DashboardLayout = __esm({
21219
21326
  as: "aside",
21220
21327
  className: cn(
21221
21328
  "z-30 w-64 flex-shrink-0 bg-card dark:bg-card border-r border-border dark:border-border",
21222
- "fixed inset-y-0 left-0 lg:static lg:translate-x-0 lg:h-auto",
21329
+ "fixed inset-y-0 left-0 @lg/dashboard:static @lg/dashboard:translate-x-0 @lg/dashboard:h-auto",
21223
21330
  "transform transition-transform duration-200 ease-in-out",
21224
21331
  "flex flex-col",
21225
21332
  sidebarOpen ? "translate-x-0" : "-translate-x-full"
@@ -21256,7 +21363,7 @@ var init_DashboardLayout = __esm({
21256
21363
  Button,
21257
21364
  {
21258
21365
  variant: "ghost",
21259
- className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
21366
+ className: "@lg/dashboard:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
21260
21367
  onClick: () => setSidebarOpen(false),
21261
21368
  children: /* @__PURE__ */ jsx(X, { className: "h-5 w-5" })
21262
21369
  }
@@ -21295,19 +21402,19 @@ var init_DashboardLayout = __esm({
21295
21402
  {
21296
21403
  align: "center",
21297
21404
  justify: "between",
21298
- className: "h-full px-3 sm:px-4 gap-2 sm:gap-4",
21405
+ className: "h-full px-3 @sm/dashboard:px-4 gap-2 @sm/dashboard:gap-4",
21299
21406
  children: [
21300
21407
  /* @__PURE__ */ jsx(
21301
21408
  Button,
21302
21409
  {
21303
21410
  variant: "ghost",
21304
- className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground touch-manipulation min-h-[44px] min-w-[44px] flex items-center justify-center",
21411
+ className: "@lg/dashboard:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground touch-manipulation min-h-[44px] min-w-[44px] flex items-center justify-center",
21305
21412
  onClick: () => setSidebarOpen(true),
21306
21413
  "aria-label": "Open sidebar",
21307
21414
  children: /* @__PURE__ */ jsx(Menu$1, { className: "h-5 w-5" })
21308
21415
  }
21309
21416
  ),
21310
- searchEnabled && /* @__PURE__ */ jsx(Box, { className: "hidden sm:block flex-1 min-w-0 xl:max-w-md", children: /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
21417
+ searchEnabled && /* @__PURE__ */ jsx(Box, { className: "hidden @sm/dashboard:block flex-1 min-w-0 @xl/dashboard:max-w-md", children: /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
21311
21418
  /* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground dark:text-muted-foreground" }),
21312
21419
  /* @__PURE__ */ jsx(
21313
21420
  Input,
@@ -21392,12 +21499,12 @@ var init_DashboardLayout = __esm({
21392
21499
  Typography,
21393
21500
  {
21394
21501
  variant: "small",
21395
- className: "hidden sm:block text-sm font-medium text-foreground dark:text-foreground",
21502
+ className: "hidden @sm/dashboard:block text-sm font-medium text-foreground dark:text-foreground",
21396
21503
  as: "span",
21397
21504
  children: user.name
21398
21505
  }
21399
21506
  ),
21400
- /* @__PURE__ */ jsx(ChevronDown, { className: "hidden sm:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
21507
+ /* @__PURE__ */ jsx(ChevronDown, { className: "hidden @sm/dashboard:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
21401
21508
  ]
21402
21509
  }
21403
21510
  ),
@@ -21454,7 +21561,7 @@ var init_DashboardLayout = __esm({
21454
21561
  )
21455
21562
  }
21456
21563
  ),
21457
- /* @__PURE__ */ jsx(Box, { as: "main", className: "flex-1 p-3 sm:p-4 md:p-6", children })
21564
+ /* @__PURE__ */ jsx(Box, { as: "main", className: "flex-1 p-3 @sm/dashboard:p-4 @md/dashboard:p-6", children })
21458
21565
  ] })
21459
21566
  ]
21460
21567
  }
@@ -21539,14 +21646,14 @@ function useDataDnd(args) {
21539
21646
  const isZone = Boolean(dragGroup || accepts || sortable);
21540
21647
  const enabled = isZone || Boolean(dndRoot);
21541
21648
  const eventBus = useEventBus();
21542
- const parentRoot = React80__default.useContext(RootCtx);
21649
+ const parentRoot = React83__default.useContext(RootCtx);
21543
21650
  const isRoot = enabled && parentRoot === null;
21544
- const zoneId = React80__default.useId();
21651
+ const zoneId = React83__default.useId();
21545
21652
  const ownGroup = dragGroup ?? accepts ?? zoneId;
21546
- const [optimisticOrders, setOptimisticOrders] = React80__default.useState(() => /* @__PURE__ */ new Map());
21547
- const optimisticOrdersRef = React80__default.useRef(optimisticOrders);
21653
+ const [optimisticOrders, setOptimisticOrders] = React83__default.useState(() => /* @__PURE__ */ new Map());
21654
+ const optimisticOrdersRef = React83__default.useRef(optimisticOrders);
21548
21655
  optimisticOrdersRef.current = optimisticOrders;
21549
- const clearOptimisticOrder = React80__default.useCallback((group) => {
21656
+ const clearOptimisticOrder = React83__default.useCallback((group) => {
21550
21657
  setOptimisticOrders((prev) => {
21551
21658
  if (!prev.has(group)) return prev;
21552
21659
  const next = new Map(prev);
@@ -21571,7 +21678,7 @@ function useDataDnd(args) {
21571
21678
  const raw = it[dndItemIdField];
21572
21679
  return String(raw ?? `__idx_${idx}`);
21573
21680
  }).join("|");
21574
- const itemIds = React80__default.useMemo(
21681
+ const itemIds = React83__default.useMemo(
21575
21682
  () => orderedItems.map((it, idx) => {
21576
21683
  const raw = it[dndItemIdField];
21577
21684
  return raw ?? `__idx_${idx}`;
@@ -21579,7 +21686,7 @@ function useDataDnd(args) {
21579
21686
  [itemIdsSignature]
21580
21687
  );
21581
21688
  const itemsContentSig = items.map((it, idx) => String(it[dndItemIdField] ?? `__${idx}`)).join("|");
21582
- React80__default.useEffect(() => {
21689
+ React83__default.useEffect(() => {
21583
21690
  const root = isRoot ? null : parentRoot;
21584
21691
  if (root) {
21585
21692
  root.clearOptimisticOrder(ownGroup);
@@ -21587,20 +21694,20 @@ function useDataDnd(args) {
21587
21694
  clearOptimisticOrder(ownGroup);
21588
21695
  }
21589
21696
  }, [itemsContentSig, ownGroup]);
21590
- const zonesRef = React80__default.useRef(/* @__PURE__ */ new Map());
21591
- const registerZone = React80__default.useCallback((zoneId2, meta2) => {
21697
+ const zonesRef = React83__default.useRef(/* @__PURE__ */ new Map());
21698
+ const registerZone = React83__default.useCallback((zoneId2, meta2) => {
21592
21699
  zonesRef.current.set(zoneId2, meta2);
21593
21700
  }, []);
21594
- const unregisterZone = React80__default.useCallback((zoneId2) => {
21701
+ const unregisterZone = React83__default.useCallback((zoneId2) => {
21595
21702
  zonesRef.current.delete(zoneId2);
21596
21703
  }, []);
21597
- const [activeDrag, setActiveDrag] = React80__default.useState(null);
21598
- const [overZoneGroup, setOverZoneGroup] = React80__default.useState(null);
21599
- const meta = React80__default.useMemo(
21704
+ const [activeDrag, setActiveDrag] = React83__default.useState(null);
21705
+ const [overZoneGroup, setOverZoneGroup] = React83__default.useState(null);
21706
+ const meta = React83__default.useMemo(
21600
21707
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
21601
21708
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
21602
21709
  );
21603
- React80__default.useEffect(() => {
21710
+ React83__default.useEffect(() => {
21604
21711
  const target = isRoot ? null : parentRoot;
21605
21712
  if (!target) {
21606
21713
  zonesRef.current.set(zoneId, meta);
@@ -21619,7 +21726,7 @@ function useDataDnd(args) {
21619
21726
  }, [parentRoot, isRoot, zoneId, meta]);
21620
21727
  const sensors = useAlmadarDndSensors(true);
21621
21728
  const collisionDetection = almadarDndCollisionDetection;
21622
- const findZoneByItem = React80__default.useCallback(
21729
+ const findZoneByItem = React83__default.useCallback(
21623
21730
  (id) => {
21624
21731
  for (const z of zonesRef.current.values()) {
21625
21732
  if (z.itemIds.includes(id)) return z;
@@ -21628,7 +21735,7 @@ function useDataDnd(args) {
21628
21735
  },
21629
21736
  []
21630
21737
  );
21631
- React80__default.useCallback(
21738
+ React83__default.useCallback(
21632
21739
  (group) => {
21633
21740
  for (const z of zonesRef.current.values()) {
21634
21741
  if (z.group === group) return z;
@@ -21637,7 +21744,7 @@ function useDataDnd(args) {
21637
21744
  },
21638
21745
  []
21639
21746
  );
21640
- const handleDragEnd = React80__default.useCallback(
21747
+ const handleDragEnd = React83__default.useCallback(
21641
21748
  (event) => {
21642
21749
  const { active, over } = event;
21643
21750
  const activeIdStr = String(active.id);
@@ -21728,8 +21835,8 @@ function useDataDnd(args) {
21728
21835
  },
21729
21836
  [eventBus]
21730
21837
  );
21731
- const sortableData = React80__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
21732
- const SortableItem = React80__default.useCallback(
21838
+ const sortableData = React83__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
21839
+ const SortableItem = React83__default.useCallback(
21733
21840
  ({ id, children }) => {
21734
21841
  const {
21735
21842
  attributes,
@@ -21769,7 +21876,7 @@ function useDataDnd(args) {
21769
21876
  id: droppableId,
21770
21877
  data: sortableData
21771
21878
  });
21772
- const ctx = React80__default.useContext(RootCtx);
21879
+ const ctx = React83__default.useContext(RootCtx);
21773
21880
  const activeDrag2 = ctx?.activeDrag ?? null;
21774
21881
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
21775
21882
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -21784,7 +21891,7 @@ function useDataDnd(args) {
21784
21891
  showForeignPlaceholder,
21785
21892
  ctxAvailable: ctx != null
21786
21893
  });
21787
- React80__default.useEffect(() => {
21894
+ React83__default.useEffect(() => {
21788
21895
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
21789
21896
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
21790
21897
  return /* @__PURE__ */ jsx(
@@ -21798,11 +21905,11 @@ function useDataDnd(args) {
21798
21905
  }
21799
21906
  );
21800
21907
  };
21801
- const rootContextValue = React80__default.useMemo(
21908
+ const rootContextValue = React83__default.useMemo(
21802
21909
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
21803
21910
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
21804
21911
  );
21805
- const handleDragStart = React80__default.useCallback((event) => {
21912
+ const handleDragStart = React83__default.useCallback((event) => {
21806
21913
  const sourceZone = findZoneByItem(event.active.id);
21807
21914
  const rect = event.active.rect.current.initial;
21808
21915
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -21821,7 +21928,7 @@ function useDataDnd(args) {
21821
21928
  isRoot
21822
21929
  });
21823
21930
  }, [findZoneByItem, isRoot, zoneId]);
21824
- const handleDragOver = React80__default.useCallback((event) => {
21931
+ const handleDragOver = React83__default.useCallback((event) => {
21825
21932
  const { active, over } = event;
21826
21933
  const overData = over?.data?.current;
21827
21934
  const overGroup = overData?.dndGroup ?? null;
@@ -21891,7 +21998,7 @@ function useDataDnd(args) {
21891
21998
  return next;
21892
21999
  });
21893
22000
  }, []);
21894
- const handleDragCancel = React80__default.useCallback((event) => {
22001
+ const handleDragCancel = React83__default.useCallback((event) => {
21895
22002
  setActiveDrag(null);
21896
22003
  setOverZoneGroup(null);
21897
22004
  dndLog.warn("dragCancel", {
@@ -21899,12 +22006,12 @@ function useDataDnd(args) {
21899
22006
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
21900
22007
  });
21901
22008
  }, []);
21902
- const handleDragEndWithCleanup = React80__default.useCallback((event) => {
22009
+ const handleDragEndWithCleanup = React83__default.useCallback((event) => {
21903
22010
  handleDragEnd(event);
21904
22011
  setActiveDrag(null);
21905
22012
  setOverZoneGroup(null);
21906
22013
  }, [handleDragEnd]);
21907
- const wrapContainer = React80__default.useCallback(
22014
+ const wrapContainer = React83__default.useCallback(
21908
22015
  (children) => {
21909
22016
  if (!enabled) return children;
21910
22017
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -21958,7 +22065,7 @@ var init_useDataDnd = __esm({
21958
22065
  init_useAlmadarDndCollision();
21959
22066
  init_Box();
21960
22067
  dndLog = createLogger("almadar:ui:dnd");
21961
- RootCtx = React80__default.createContext(null);
22068
+ RootCtx = React83__default.createContext(null);
21962
22069
  }
21963
22070
  });
21964
22071
  function fieldLabel2(key) {
@@ -22447,7 +22554,7 @@ function DataList({
22447
22554
  }) {
22448
22555
  const eventBus = useEventBus();
22449
22556
  const { t } = useTranslate();
22450
- const [visibleCount, setVisibleCount] = React80__default.useState(pageSize || Infinity);
22557
+ const [visibleCount, setVisibleCount] = React83__default.useState(pageSize || Infinity);
22451
22558
  const fieldDefs = fields ?? columns ?? [];
22452
22559
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
22453
22560
  const dnd = useDataDnd({
@@ -22466,7 +22573,7 @@ function DataList({
22466
22573
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
22467
22574
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
22468
22575
  const hasRenderProp = typeof children === "function";
22469
- React80__default.useEffect(() => {
22576
+ React83__default.useEffect(() => {
22470
22577
  const renderItemTypeOf = typeof schemaRenderItem;
22471
22578
  const childrenTypeOf = typeof children;
22472
22579
  if (data.length > 0 && !hasRenderProp) {
@@ -22523,7 +22630,7 @@ function DataList({
22523
22630
  const items2 = data.map((item) => item);
22524
22631
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
22525
22632
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
22526
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React80__default.Fragment, { children: [
22633
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
22527
22634
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
22528
22635
  group.items.map((itemData, index) => {
22529
22636
  const id = itemData.id || `${gi}-${index}`;
@@ -22711,7 +22818,7 @@ function DataList({
22711
22818
  className
22712
22819
  ),
22713
22820
  children: [
22714
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React80__default.Fragment, { children: [
22821
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
22715
22822
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
22716
22823
  group.items.map(
22717
22824
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -23876,6 +23983,8 @@ var SidePanel;
23876
23983
  var init_SidePanel = __esm({
23877
23984
  "components/molecules/SidePanel.tsx"() {
23878
23985
  "use client";
23986
+ init_Aside();
23987
+ init_Box();
23879
23988
  init_Button();
23880
23989
  init_Typography();
23881
23990
  init_cn();
@@ -23885,7 +23994,7 @@ var init_SidePanel = __esm({
23885
23994
  children,
23886
23995
  isOpen,
23887
23996
  onClose,
23888
- width = "w-96",
23997
+ width = "w-full sm:w-96",
23889
23998
  position = "right",
23890
23999
  showOverlay = true,
23891
24000
  className,
@@ -23899,14 +24008,14 @@ var init_SidePanel = __esm({
23899
24008
  if (!isOpen) return null;
23900
24009
  return /* @__PURE__ */ jsxs(Fragment, { children: [
23901
24010
  showOverlay && /* @__PURE__ */ jsx(
23902
- "div",
24011
+ Box,
23903
24012
  {
23904
24013
  className: "fixed inset-0 bg-white/80 backdrop-blur-sm z-40 lg:hidden",
23905
24014
  onClick: handleClose
23906
24015
  }
23907
24016
  ),
23908
24017
  /* @__PURE__ */ jsxs(
23909
- "aside",
24018
+ Aside,
23910
24019
  {
23911
24020
  className: cn(
23912
24021
  "fixed top-16 lg:top-0 bottom-0 z-[60]",
@@ -23920,7 +24029,7 @@ var init_SidePanel = __esm({
23920
24029
  className
23921
24030
  ),
23922
24031
  children: [
23923
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-4 border-b-2 border-border sticky top-0 bg-card z-10", children: [
24032
+ /* @__PURE__ */ jsxs(Box, { className: "flex items-center justify-between p-4 border-b-2 border-border sticky top-0 bg-card z-10", children: [
23924
24033
  /* @__PURE__ */ jsx(Typography, { variant: "h6", children: title }),
23925
24034
  /* @__PURE__ */ jsx(
23926
24035
  Button,
@@ -23930,11 +24039,11 @@ var init_SidePanel = __esm({
23930
24039
  icon: X,
23931
24040
  onClick: handleClose,
23932
24041
  "aria-label": "Close panel",
23933
- children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
24042
+ children: /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", className: "sr-only", children: "Close" })
23934
24043
  }
23935
24044
  )
23936
24045
  ] }),
23937
- /* @__PURE__ */ jsx("div", { className: "p-4 flex-1 overflow-y-auto", children })
24046
+ /* @__PURE__ */ jsx(Box, { className: "p-4 flex-1 overflow-y-auto", children })
23938
24047
  ]
23939
24048
  }
23940
24049
  )
@@ -23985,7 +24094,7 @@ var init_WizardProgress = __esm({
23985
24094
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
23986
24095
  const isActive = index === currentStep;
23987
24096
  const isCompleted = index < currentStep;
23988
- return /* @__PURE__ */ jsxs(React80__default.Fragment, { children: [
24097
+ return /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
23989
24098
  /* @__PURE__ */ jsx(
23990
24099
  "button",
23991
24100
  {
@@ -24110,7 +24219,9 @@ var init_WizardNavigation = __esm({
24110
24219
  {
24111
24220
  border: true,
24112
24221
  className: cn(
24113
- "border-t-2 border-x-0 border-b-0 border-border flex justify-between items-center",
24222
+ // `flex-wrap gap-2` lets the Back / Step / Next trio reflow on
24223
+ // narrow viewports rather than crushing the step counter.
24224
+ "border-t-2 border-x-0 border-b-0 border-border flex flex-wrap gap-2 justify-between items-center",
24114
24225
  compact ? "px-4 py-2" : "px-6 py-4",
24115
24226
  className
24116
24227
  ),
@@ -25041,7 +25152,7 @@ function InventoryGrid({
25041
25152
  const eventBus = useEventBus();
25042
25153
  const slotCount = totalSlots ?? items.length;
25043
25154
  const emptySlotCount = Math.max(0, slotCount - items.length);
25044
- const handleSelect = React80.useCallback(
25155
+ const handleSelect = React83.useCallback(
25045
25156
  (id) => {
25046
25157
  onSelect?.(id);
25047
25158
  if (selectEvent) {
@@ -25254,15 +25365,15 @@ function GameCanvas2D({
25254
25365
  fps = 60,
25255
25366
  className
25256
25367
  }) {
25257
- const canvasRef = React80.useRef(null);
25258
- const rafRef = React80.useRef(0);
25259
- const frameRef = React80.useRef(0);
25260
- const lastTimeRef = React80.useRef(0);
25261
- const onDrawRef = React80.useRef(onDraw);
25368
+ const canvasRef = React83.useRef(null);
25369
+ const rafRef = React83.useRef(0);
25370
+ const frameRef = React83.useRef(0);
25371
+ const lastTimeRef = React83.useRef(0);
25372
+ const onDrawRef = React83.useRef(onDraw);
25262
25373
  onDrawRef.current = onDraw;
25263
- const onTickRef = React80.useRef(onTick);
25374
+ const onTickRef = React83.useRef(onTick);
25264
25375
  onTickRef.current = onTick;
25265
- React80.useEffect(() => {
25376
+ React83.useEffect(() => {
25266
25377
  const canvas = canvasRef.current;
25267
25378
  if (!canvas) return;
25268
25379
  const ctx = canvas.getContext("2d");
@@ -25551,7 +25662,7 @@ function TurnPanel({
25551
25662
  className
25552
25663
  }) {
25553
25664
  const eventBus = useEventBus();
25554
- const handleAction = React80.useCallback(
25665
+ const handleAction = React83.useCallback(
25555
25666
  (event) => {
25556
25667
  if (event) {
25557
25668
  eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
@@ -25697,7 +25808,7 @@ function UnitCommandBar({
25697
25808
  className
25698
25809
  }) {
25699
25810
  const eventBus = useEventBus();
25700
- const handleCommand = React80.useCallback(
25811
+ const handleCommand = React83.useCallback(
25701
25812
  (event) => {
25702
25813
  if (event) {
25703
25814
  eventBus.emit(event, { unitId: selectedUnitId });
@@ -26182,7 +26293,7 @@ function GameMenu({
26182
26293
  } catch {
26183
26294
  }
26184
26295
  const eventBus = eventBusProp || eventBusFromHook;
26185
- const handleOptionClick = React80.useCallback(
26296
+ const handleOptionClick = React83.useCallback(
26186
26297
  (option) => {
26187
26298
  if (option.event && eventBus) {
26188
26299
  eventBus.emit(`UI:${option.event}`, { option });
@@ -26296,7 +26407,7 @@ function GameOverScreen({
26296
26407
  } catch {
26297
26408
  }
26298
26409
  const eventBus = eventBusProp || eventBusFromHook;
26299
- const handleActionClick = React80.useCallback(
26410
+ const handleActionClick = React83.useCallback(
26300
26411
  (action) => {
26301
26412
  if (action.event && eventBus) {
26302
26413
  eventBus.emit(`UI:${action.event}`, { action });
@@ -28805,7 +28916,16 @@ var init_StepFlow = __esm({
28805
28916
  "flex items-center justify-center",
28806
28917
  "bg-primary text-primary-foreground"
28807
28918
  ),
28808
- children: /* @__PURE__ */ jsx("span", { className: "font-semibold text-sm text-primary-foreground leading-none", children: step.number ?? index + 1 })
28919
+ children: /* @__PURE__ */ jsx(
28920
+ Typography,
28921
+ {
28922
+ as: "span",
28923
+ variant: "small",
28924
+ weight: "semibold",
28925
+ className: "text-primary-foreground leading-none",
28926
+ children: step.number ?? index + 1
28927
+ }
28928
+ )
28809
28929
  }
28810
28930
  );
28811
28931
  };
@@ -28817,7 +28937,7 @@ var init_StepFlow = __esm({
28817
28937
  className
28818
28938
  }) => {
28819
28939
  if (orientation === "vertical") {
28820
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React80__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
28940
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React83__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
28821
28941
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
28822
28942
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
28823
28943
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -28828,7 +28948,7 @@ var init_StepFlow = __esm({
28828
28948
  ] })
28829
28949
  ] }) }, index)) });
28830
28950
  }
28831
- return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React80__default.Fragment, { children: [
28951
+ return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
28832
28952
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
28833
28953
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
28834
28954
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -28896,9 +29016,9 @@ var init_SplitSection = __esm({
28896
29016
  className
28897
29017
  ),
28898
29018
  padding: "lg",
28899
- children: /* @__PURE__ */ jsxs(Box, { className: cn("w-full flex flex-col lg:flex-row gap-10 lg:gap-16 items-center", isImageLeft && "lg:flex-row-reverse"), children: [
28900
- /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0 lg:min-w-[45%]", children: textContent }),
28901
- /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0 lg:max-w-[50%]", children: mediaContent })
29019
+ children: /* @__PURE__ */ jsxs(Box, { className: cn("w-full flex flex-col md:flex-row gap-8 md:gap-12 lg:gap-16 items-center", isImageLeft && "md:flex-row-reverse"), children: [
29020
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0 md:min-w-[45%]", children: textContent }),
29021
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0 md:max-w-[50%]", children: mediaContent })
28902
29022
  ] })
28903
29023
  }
28904
29024
  );
@@ -29710,7 +29830,7 @@ var init_LikertScale = __esm({
29710
29830
  md: "text-base",
29711
29831
  lg: "text-lg"
29712
29832
  };
29713
- LikertScale = React80__default.forwardRef(
29833
+ LikertScale = React83__default.forwardRef(
29714
29834
  ({
29715
29835
  question,
29716
29836
  options = DEFAULT_LIKERT_OPTIONS,
@@ -29722,7 +29842,7 @@ var init_LikertScale = __esm({
29722
29842
  variant = "radios",
29723
29843
  className
29724
29844
  }, ref) => {
29725
- const groupId = React80__default.useId();
29845
+ const groupId = React83__default.useId();
29726
29846
  const eventBus = useEventBus();
29727
29847
  const handleSelect = useCallback(
29728
29848
  (next) => {
@@ -30530,64 +30650,68 @@ var init_PositionedCanvas = __esm({
30530
30650
  },
30531
30651
  [onSelect, selectEvent, eventBus]
30532
30652
  );
30533
- return /* @__PURE__ */ jsx(
30534
- Box,
30535
- {
30536
- ref: containerRef,
30537
- "data-testid": "positioned-canvas",
30538
- className: cn(
30539
- "relative bg-background border border-border rounded-md overflow-hidden",
30540
- className
30541
- ),
30542
- style: { width, height },
30543
- onClick: handleContainerClick,
30544
- children: items.map((item) => {
30545
- const status = item.status ?? "empty";
30546
- const shape = item.shape ?? "round";
30547
- const isSelected = selectedId === item.id;
30548
- const isDragging = draggingId === item.id;
30549
- const statusBadge = STATUS_BADGE[status];
30550
- return /* @__PURE__ */ jsxs(
30551
- Box,
30552
- {
30553
- "data-testid": `item-node-${item.id}`,
30554
- "data-status": status,
30555
- className: cn(
30556
- "absolute flex flex-col items-center justify-center gap-1 border-2 select-none",
30557
- "transition-shadow",
30558
- STATUS_CLASSES[status],
30559
- getShapeClasses(shape),
30560
- editable ? "cursor-move" : "cursor-pointer",
30561
- isSelected && "outline outline-2 outline-offset-2 outline-primary shadow-md",
30562
- isDragging && "shadow-lg z-10"
30563
- ),
30564
- style: { left: item.x, top: item.y, touchAction: "none" },
30565
- onPointerDown: (e) => handlePointerDown(e, item),
30566
- onPointerMove: handlePointerMove,
30567
- onPointerUp: (e) => handlePointerUp(e, item),
30568
- onPointerCancel: (e) => handlePointerUp(e, item),
30569
- children: [
30570
- /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", children: [
30571
- getStatusIcon(status),
30572
- /* @__PURE__ */ jsx(Typography, { variant: "body2", weight: "semibold", children: item.label })
30573
- ] }),
30574
- /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: item.partySize !== void 0 && status === "seated" ? `${item.partySize}/${item.capacity}` : `Cap ${item.capacity}` }),
30575
- status === "seated" && item.serverName && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "truncate max-w-[80%]", children: item.serverName }),
30576
- isSelected && /* @__PURE__ */ jsx(
30577
- Badge,
30578
- {
30579
- variant: statusBadge.variant,
30580
- size: "sm",
30581
- className: "absolute -top-2 -right-2",
30582
- children: statusBadge.label
30583
- }
30584
- )
30585
- ]
30586
- },
30587
- item.id
30588
- );
30589
- })
30590
- }
30653
+ return (
30654
+ // Outer scroll viewport: caps the visual footprint to the parent's
30655
+ // available width on small screens. The inner plane keeps its fixed
30656
+ // {width × height} coordinate system (items are positioned by
30657
+ // absolute item.x/item.y), so a phone-sized viewport pans inside
30658
+ // the larger logical canvas rather than busting the layout.
30659
+ /* @__PURE__ */ jsx(Box, { className: cn("max-w-full overflow-auto rounded-md", className), children: /* @__PURE__ */ jsx(
30660
+ Box,
30661
+ {
30662
+ ref: containerRef,
30663
+ "data-testid": "positioned-canvas",
30664
+ className: "relative bg-background border border-border rounded-md overflow-hidden",
30665
+ style: { width, height },
30666
+ onClick: handleContainerClick,
30667
+ children: items.map((item) => {
30668
+ const status = item.status ?? "empty";
30669
+ const shape = item.shape ?? "round";
30670
+ const isSelected = selectedId === item.id;
30671
+ const isDragging = draggingId === item.id;
30672
+ const statusBadge = STATUS_BADGE[status];
30673
+ return /* @__PURE__ */ jsxs(
30674
+ Box,
30675
+ {
30676
+ "data-testid": `item-node-${item.id}`,
30677
+ "data-status": status,
30678
+ className: cn(
30679
+ "absolute flex flex-col items-center justify-center gap-1 border-2 select-none",
30680
+ "transition-shadow",
30681
+ STATUS_CLASSES[status],
30682
+ getShapeClasses(shape),
30683
+ editable ? "cursor-move" : "cursor-pointer",
30684
+ isSelected && "outline outline-2 outline-offset-2 outline-primary shadow-md",
30685
+ isDragging && "shadow-lg z-10"
30686
+ ),
30687
+ style: { left: item.x, top: item.y, touchAction: "none" },
30688
+ onPointerDown: (e) => handlePointerDown(e, item),
30689
+ onPointerMove: handlePointerMove,
30690
+ onPointerUp: (e) => handlePointerUp(e, item),
30691
+ onPointerCancel: (e) => handlePointerUp(e, item),
30692
+ children: [
30693
+ /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", children: [
30694
+ getStatusIcon(status),
30695
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", weight: "semibold", children: item.label })
30696
+ ] }),
30697
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: item.partySize !== void 0 && status === "seated" ? `${item.partySize}/${item.capacity}` : `Cap ${item.capacity}` }),
30698
+ status === "seated" && item.serverName && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "truncate max-w-[80%]", children: item.serverName }),
30699
+ isSelected && /* @__PURE__ */ jsx(
30700
+ Badge,
30701
+ {
30702
+ variant: statusBadge.variant,
30703
+ size: "sm",
30704
+ className: "absolute -top-2 -right-2",
30705
+ children: statusBadge.label
30706
+ }
30707
+ )
30708
+ ]
30709
+ },
30710
+ item.id
30711
+ );
30712
+ })
30713
+ }
30714
+ ) })
30591
30715
  );
30592
30716
  };
30593
30717
  PositionedCanvas.displayName = "PositionedCanvas";
@@ -31726,7 +31850,7 @@ var init_VersionDiff = __esm({
31726
31850
  /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", className: "flex-wrap", children: [
31727
31851
  /* @__PURE__ */ jsx(Icon, { icon: GitCommit, size: "sm", className: "text-muted-foreground" }),
31728
31852
  /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "whitespace-nowrap", children: "Compare" }),
31729
- /* @__PURE__ */ jsx(Box, { className: "min-w-[160px]", children: /* @__PURE__ */ jsx(
31853
+ /* @__PURE__ */ jsx(Box, { className: "min-w-0 md:min-w-[160px]", children: /* @__PURE__ */ jsx(
31730
31854
  Select,
31731
31855
  {
31732
31856
  options,
@@ -31736,7 +31860,7 @@ var init_VersionDiff = __esm({
31736
31860
  }
31737
31861
  ) }),
31738
31862
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: "to" }),
31739
- /* @__PURE__ */ jsx(Box, { className: "min-w-[160px]", children: /* @__PURE__ */ jsx(
31863
+ /* @__PURE__ */ jsx(Box, { className: "min-w-0 md:min-w-[160px]", children: /* @__PURE__ */ jsx(
31740
31864
  Select,
31741
31865
  {
31742
31866
  options,
@@ -31801,8 +31925,8 @@ var init_VersionDiff = __esm({
31801
31925
  ]
31802
31926
  }
31803
31927
  ),
31804
- /* @__PURE__ */ jsx(Box, { className: "overflow-auto bg-muted/20", style: { maxHeight: 600 }, children: activeView === "side-by-side" ? /* @__PURE__ */ jsxs(Box, { className: "grid grid-cols-2", children: [
31805
- /* @__PURE__ */ jsx(Box, { className: "border-r border-border", children: /* @__PURE__ */ jsx(VStack, { gap: "none", className: "font-mono text-xs", children: beforeLines.map((line, idx) => {
31928
+ /* @__PURE__ */ jsx(Box, { className: "overflow-auto bg-muted/20", style: { maxHeight: 600 }, children: activeView === "side-by-side" ? /* @__PURE__ */ jsxs(Box, { className: "grid grid-cols-1 md:grid-cols-2", children: [
31929
+ /* @__PURE__ */ jsx(Box, { className: "border-b md:border-b-0 md:border-r border-border", children: /* @__PURE__ */ jsx(VStack, { gap: "none", className: "font-mono text-xs", children: beforeLines.map((line, idx) => {
31806
31930
  const isRemoved = line.type === "removed";
31807
31931
  return /* @__PURE__ */ jsxs(
31808
31932
  HStack,
@@ -31948,7 +32072,7 @@ var init_DocBreadcrumb = __esm({
31948
32072
  "aria-label": "Breadcrumb",
31949
32073
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
31950
32074
  const isLast = idx === items.length - 1;
31951
- return /* @__PURE__ */ jsxs(React80__default.Fragment, { children: [
32075
+ return /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
31952
32076
  idx > 0 && /* @__PURE__ */ jsx(
31953
32077
  Icon,
31954
32078
  {
@@ -32838,7 +32962,7 @@ var init_MiniStateMachine = __esm({
32838
32962
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
32839
32963
  const tc = transitionCounts[s.name] ?? 0;
32840
32964
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
32841
- return /* @__PURE__ */ jsxs(React80__default.Fragment, { children: [
32965
+ return /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
32842
32966
  /* @__PURE__ */ jsx(
32843
32967
  AvlState,
32844
32968
  {
@@ -34215,7 +34339,7 @@ var init_DocumentViewer = __esm({
34215
34339
  }
34216
34340
  });
34217
34341
  function extractTitle(children) {
34218
- if (!React80__default.isValidElement(children)) return void 0;
34342
+ if (!React83__default.isValidElement(children)) return void 0;
34219
34343
  const props = children.props;
34220
34344
  if (typeof props.title === "string") {
34221
34345
  return props.title;
@@ -34270,7 +34394,7 @@ function LinearView({
34270
34394
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
34271
34395
  const isDone = i < currentIdx;
34272
34396
  const isCurrent = i === currentIdx;
34273
- return /* @__PURE__ */ jsxs(React80__default.Fragment, { children: [
34397
+ return /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
34274
34398
  i > 0 && /* @__PURE__ */ jsx(
34275
34399
  Typography,
34276
34400
  {
@@ -35171,12 +35295,12 @@ var init_Form = __esm({
35171
35295
  const isSchemaEntity = isOrbitalEntitySchema(entity);
35172
35296
  const resolvedEntity = isSchemaEntity ? entity : void 0;
35173
35297
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
35174
- const normalizedInitialData = React80__default.useMemo(() => {
35298
+ const normalizedInitialData = React83__default.useMemo(() => {
35175
35299
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
35176
35300
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
35177
35301
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
35178
35302
  }, [entity, initialData]);
35179
- const entityDerivedFields = React80__default.useMemo(() => {
35303
+ const entityDerivedFields = React83__default.useMemo(() => {
35180
35304
  if (fields && fields.length > 0) return void 0;
35181
35305
  if (!resolvedEntity) return void 0;
35182
35306
  return resolvedEntity.fields.map(
@@ -35195,16 +35319,16 @@ var init_Form = __esm({
35195
35319
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
35196
35320
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
35197
35321
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
35198
- const [formData, setFormData] = React80__default.useState(
35322
+ const [formData, setFormData] = React83__default.useState(
35199
35323
  normalizedInitialData
35200
35324
  );
35201
- const [collapsedSections, setCollapsedSections] = React80__default.useState(
35325
+ const [collapsedSections, setCollapsedSections] = React83__default.useState(
35202
35326
  /* @__PURE__ */ new Set()
35203
35327
  );
35204
- const [submitError, setSubmitError] = React80__default.useState(null);
35205
- const formRef = React80__default.useRef(null);
35328
+ const [submitError, setSubmitError] = React83__default.useState(null);
35329
+ const formRef = React83__default.useRef(null);
35206
35330
  const formMode = props.mode;
35207
- const mountedRef = React80__default.useRef(false);
35331
+ const mountedRef = React83__default.useRef(false);
35208
35332
  if (!mountedRef.current) {
35209
35333
  mountedRef.current = true;
35210
35334
  debug("forms", "mount", {
@@ -35217,7 +35341,7 @@ var init_Form = __esm({
35217
35341
  });
35218
35342
  }
35219
35343
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
35220
- const evalContext = React80__default.useMemo(
35344
+ const evalContext = React83__default.useMemo(
35221
35345
  () => ({
35222
35346
  formValues: formData,
35223
35347
  globalVariables: externalContext?.globalVariables ?? {},
@@ -35226,7 +35350,7 @@ var init_Form = __esm({
35226
35350
  }),
35227
35351
  [formData, externalContext]
35228
35352
  );
35229
- React80__default.useEffect(() => {
35353
+ React83__default.useEffect(() => {
35230
35354
  debug("forms", "initialData-sync", {
35231
35355
  mode: formMode,
35232
35356
  normalizedInitialData,
@@ -35237,7 +35361,7 @@ var init_Form = __esm({
35237
35361
  setFormData(normalizedInitialData);
35238
35362
  }
35239
35363
  }, [normalizedInitialData]);
35240
- const processCalculations = React80__default.useCallback(
35364
+ const processCalculations = React83__default.useCallback(
35241
35365
  (changedFieldId, newFormData) => {
35242
35366
  if (!hiddenCalculations.length) return;
35243
35367
  const context = {
@@ -35262,7 +35386,7 @@ var init_Form = __esm({
35262
35386
  },
35263
35387
  [hiddenCalculations, externalContext, eventBus]
35264
35388
  );
35265
- const checkViolations = React80__default.useCallback(
35389
+ const checkViolations = React83__default.useCallback(
35266
35390
  (changedFieldId, newFormData) => {
35267
35391
  if (!violationTriggers.length) return;
35268
35392
  const context = {
@@ -35300,7 +35424,7 @@ var init_Form = __esm({
35300
35424
  processCalculations(name, newFormData);
35301
35425
  checkViolations(name, newFormData);
35302
35426
  };
35303
- const isFieldVisible = React80__default.useCallback(
35427
+ const isFieldVisible = React83__default.useCallback(
35304
35428
  (fieldName) => {
35305
35429
  const condition = conditionalFields[fieldName];
35306
35430
  if (!condition) return true;
@@ -35308,7 +35432,7 @@ var init_Form = __esm({
35308
35432
  },
35309
35433
  [conditionalFields, evalContext]
35310
35434
  );
35311
- const isSectionVisible = React80__default.useCallback(
35435
+ const isSectionVisible = React83__default.useCallback(
35312
35436
  (section) => {
35313
35437
  if (!section.condition) return true;
35314
35438
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -35384,7 +35508,7 @@ var init_Form = __esm({
35384
35508
  eventBus.emit(`UI:${onCancel}`);
35385
35509
  }
35386
35510
  };
35387
- const renderField = React80__default.useCallback(
35511
+ const renderField = React83__default.useCallback(
35388
35512
  (field) => {
35389
35513
  const fieldName = field.name || field.field;
35390
35514
  if (!fieldName) return null;
@@ -35405,7 +35529,7 @@ var init_Form = __esm({
35405
35529
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
35406
35530
  );
35407
35531
  const effectiveFields = entityDerivedFields ?? fields;
35408
- const normalizedFields = React80__default.useMemo(() => {
35532
+ const normalizedFields = React83__default.useMemo(() => {
35409
35533
  if (!effectiveFields || effectiveFields.length === 0) return [];
35410
35534
  return effectiveFields.map((field) => {
35411
35535
  if (typeof field === "string") {
@@ -35427,7 +35551,7 @@ var init_Form = __esm({
35427
35551
  return field;
35428
35552
  });
35429
35553
  }, [effectiveFields, resolvedEntity]);
35430
- const schemaFields = React80__default.useMemo(() => {
35554
+ const schemaFields = React83__default.useMemo(() => {
35431
35555
  if (normalizedFields.length === 0) return null;
35432
35556
  if (isDebugEnabled()) {
35433
35557
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -35437,7 +35561,7 @@ var init_Form = __esm({
35437
35561
  }
35438
35562
  return normalizedFields.map(renderField).filter(Boolean);
35439
35563
  }, [normalizedFields, renderField, entityName, conditionalFields]);
35440
- const sectionElements = React80__default.useMemo(() => {
35564
+ const sectionElements = React83__default.useMemo(() => {
35441
35565
  if (!sections || sections.length === 0) return null;
35442
35566
  return sections.map((section) => {
35443
35567
  if (!isSectionVisible(section)) {
@@ -37163,7 +37287,7 @@ var init_List = __esm({
37163
37287
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
37164
37288
  return [];
37165
37289
  }, [entity]);
37166
- const getItemActions = React80__default.useCallback(
37290
+ const getItemActions = React83__default.useCallback(
37167
37291
  (item) => {
37168
37292
  if (!itemActions) return [];
37169
37293
  if (typeof itemActions === "function") {
@@ -37636,7 +37760,7 @@ var init_MediaGallery = __esm({
37636
37760
  [selectable, selectedItems, selectionEvent, eventBus]
37637
37761
  );
37638
37762
  const entityData = Array.isArray(entity) ? entity : [];
37639
- const items = React80__default.useMemo(() => {
37763
+ const items = React83__default.useMemo(() => {
37640
37764
  if (propItems) return propItems;
37641
37765
  if (entityData.length === 0) return [];
37642
37766
  return entityData.map((record, idx) => ({
@@ -37800,7 +37924,7 @@ var init_MediaGallery = __esm({
37800
37924
  }
37801
37925
  });
37802
37926
  function extractTitle2(children) {
37803
- if (!React80__default.isValidElement(children)) return void 0;
37927
+ if (!React83__default.isValidElement(children)) return void 0;
37804
37928
  const props = children.props;
37805
37929
  if (typeof props.title === "string") {
37806
37930
  return props.title;
@@ -38513,7 +38637,7 @@ var init_PageHeader = __esm({
38513
38637
  info: "bg-info/10 text-info"
38514
38638
  };
38515
38639
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
38516
- breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React80__default.Fragment, { children: [
38640
+ breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
38517
38641
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
38518
38642
  crumb.href ? /* @__PURE__ */ jsx(
38519
38643
  "a",
@@ -38828,7 +38952,7 @@ var init_debugRegistry = __esm({
38828
38952
  }
38829
38953
  });
38830
38954
  function useDebugData() {
38831
- const [data, setData] = React80.useState(() => ({
38955
+ const [data, setData] = React83.useState(() => ({
38832
38956
  traits: [],
38833
38957
  ticks: [],
38834
38958
  guards: [],
@@ -38842,7 +38966,7 @@ function useDebugData() {
38842
38966
  },
38843
38967
  lastUpdate: Date.now()
38844
38968
  }));
38845
- React80.useEffect(() => {
38969
+ React83.useEffect(() => {
38846
38970
  const updateData = () => {
38847
38971
  setData({
38848
38972
  traits: getAllTraits(),
@@ -38951,12 +39075,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
38951
39075
  return positions;
38952
39076
  }
38953
39077
  function WalkMinimap() {
38954
- const [walkStep, setWalkStep] = React80.useState(null);
38955
- const [traits2, setTraits] = React80.useState([]);
38956
- const [coveredEdges, setCoveredEdges] = React80.useState([]);
38957
- const [completedTraits, setCompletedTraits] = React80.useState(/* @__PURE__ */ new Set());
38958
- const prevTraitRef = React80.useRef(null);
38959
- React80.useEffect(() => {
39078
+ const [walkStep, setWalkStep] = React83.useState(null);
39079
+ const [traits2, setTraits] = React83.useState([]);
39080
+ const [coveredEdges, setCoveredEdges] = React83.useState([]);
39081
+ const [completedTraits, setCompletedTraits] = React83.useState(/* @__PURE__ */ new Set());
39082
+ const prevTraitRef = React83.useRef(null);
39083
+ React83.useEffect(() => {
38960
39084
  const interval = setInterval(() => {
38961
39085
  const w = window;
38962
39086
  const step = w.__orbitalWalkStep;
@@ -39403,15 +39527,15 @@ var init_EntitiesTab = __esm({
39403
39527
  }
39404
39528
  });
39405
39529
  function EventFlowTab({ events: events2 }) {
39406
- const [filter, setFilter] = React80.useState("all");
39407
- const containerRef = React80.useRef(null);
39408
- const [autoScroll, setAutoScroll] = React80.useState(true);
39409
- React80.useEffect(() => {
39530
+ const [filter, setFilter] = React83.useState("all");
39531
+ const containerRef = React83.useRef(null);
39532
+ const [autoScroll, setAutoScroll] = React83.useState(true);
39533
+ React83.useEffect(() => {
39410
39534
  if (autoScroll && containerRef.current) {
39411
39535
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
39412
39536
  }
39413
39537
  }, [events2.length, autoScroll]);
39414
- const filteredEvents = React80.useMemo(() => {
39538
+ const filteredEvents = React83.useMemo(() => {
39415
39539
  if (filter === "all") return events2;
39416
39540
  return events2.filter((e) => e.type === filter);
39417
39541
  }, [events2, filter]);
@@ -39530,7 +39654,7 @@ var init_EventFlowTab = __esm({
39530
39654
  }
39531
39655
  });
39532
39656
  function GuardsPanel({ guards }) {
39533
- const [filter, setFilter] = React80.useState("all");
39657
+ const [filter, setFilter] = React83.useState("all");
39534
39658
  if (guards.length === 0) {
39535
39659
  return /* @__PURE__ */ jsx(
39536
39660
  EmptyState,
@@ -39543,7 +39667,7 @@ function GuardsPanel({ guards }) {
39543
39667
  }
39544
39668
  const passedCount = guards.filter((g) => g.result).length;
39545
39669
  const failedCount = guards.length - passedCount;
39546
- const filteredGuards = React80.useMemo(() => {
39670
+ const filteredGuards = React83.useMemo(() => {
39547
39671
  if (filter === "all") return guards;
39548
39672
  if (filter === "passed") return guards.filter((g) => g.result);
39549
39673
  return guards.filter((g) => !g.result);
@@ -39704,10 +39828,10 @@ function EffectBadge({ effect }) {
39704
39828
  ] });
39705
39829
  }
39706
39830
  function TransitionTimeline({ transitions }) {
39707
- const containerRef = React80.useRef(null);
39708
- const [autoScroll, setAutoScroll] = React80.useState(true);
39709
- const [expandedId, setExpandedId] = React80.useState(null);
39710
- React80.useEffect(() => {
39831
+ const containerRef = React83.useRef(null);
39832
+ const [autoScroll, setAutoScroll] = React83.useState(true);
39833
+ const [expandedId, setExpandedId] = React83.useState(null);
39834
+ React83.useEffect(() => {
39711
39835
  if (autoScroll && containerRef.current) {
39712
39836
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
39713
39837
  }
@@ -39993,9 +40117,9 @@ function getAllEvents(traits2) {
39993
40117
  }
39994
40118
  function EventDispatcherTab({ traits: traits2, schema }) {
39995
40119
  const eventBus = useEventBus();
39996
- const [log12, setLog] = React80.useState([]);
39997
- const prevStatesRef = React80.useRef(/* @__PURE__ */ new Map());
39998
- React80.useEffect(() => {
40120
+ const [log12, setLog] = React83.useState([]);
40121
+ const prevStatesRef = React83.useRef(/* @__PURE__ */ new Map());
40122
+ React83.useEffect(() => {
39999
40123
  for (const trait of traits2) {
40000
40124
  const prev = prevStatesRef.current.get(trait.id);
40001
40125
  if (prev && prev !== trait.currentState) {
@@ -40165,10 +40289,10 @@ function VerifyModePanel({
40165
40289
  serverCount,
40166
40290
  localCount
40167
40291
  }) {
40168
- const [expanded, setExpanded] = React80.useState(true);
40169
- const scrollRef = React80.useRef(null);
40170
- const prevCountRef = React80.useRef(0);
40171
- React80.useEffect(() => {
40292
+ const [expanded, setExpanded] = React83.useState(true);
40293
+ const scrollRef = React83.useRef(null);
40294
+ const prevCountRef = React83.useRef(0);
40295
+ React83.useEffect(() => {
40172
40296
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
40173
40297
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
40174
40298
  }
@@ -40234,10 +40358,10 @@ function RuntimeDebugger({
40234
40358
  defaultTab,
40235
40359
  schema
40236
40360
  }) {
40237
- const [isCollapsed, setIsCollapsed] = React80.useState(mode === "verify" ? true : defaultCollapsed);
40238
- const [isVisible, setIsVisible] = React80.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
40361
+ const [isCollapsed, setIsCollapsed] = React83.useState(mode === "verify" ? true : defaultCollapsed);
40362
+ const [isVisible, setIsVisible] = React83.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
40239
40363
  const debugData = useDebugData();
40240
- React80.useEffect(() => {
40364
+ React83.useEffect(() => {
40241
40365
  if (mode === "inline") return;
40242
40366
  return onDebugToggle((enabled) => {
40243
40367
  setIsVisible(enabled);
@@ -40246,7 +40370,7 @@ function RuntimeDebugger({
40246
40370
  }
40247
40371
  });
40248
40372
  }, [mode]);
40249
- React80.useEffect(() => {
40373
+ React83.useEffect(() => {
40250
40374
  if (mode === "inline") return;
40251
40375
  const handleKeyDown = (e) => {
40252
40376
  if (e.key === "`" && isVisible) {
@@ -40795,7 +40919,7 @@ function SequenceBar({
40795
40919
  onSlotRemove(index);
40796
40920
  }, [onSlotRemove, playing]);
40797
40921
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
40798
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React80__default.Fragment, { children: [
40922
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
40799
40923
  i > 0 && /* @__PURE__ */ jsx(
40800
40924
  Typography,
40801
40925
  {
@@ -42197,7 +42321,7 @@ var init_StatCard = __esm({
42197
42321
  const labelToUse = propLabel ?? propTitle;
42198
42322
  const eventBus = useEventBus();
42199
42323
  const { t } = useTranslate();
42200
- const handleActionClick = React80__default.useCallback(() => {
42324
+ const handleActionClick = React83__default.useCallback(() => {
42201
42325
  if (action?.event) {
42202
42326
  eventBus.emit(`UI:${action.event}`, {});
42203
42327
  }
@@ -42208,7 +42332,7 @@ var init_StatCard = __esm({
42208
42332
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
42209
42333
  const isLoading = externalLoading ?? false;
42210
42334
  const error = externalError;
42211
- const computeMetricValue = React80__default.useCallback(
42335
+ const computeMetricValue = React83__default.useCallback(
42212
42336
  (metric, items) => {
42213
42337
  if (metric.value !== void 0) {
42214
42338
  return metric.value;
@@ -42247,7 +42371,7 @@ var init_StatCard = __esm({
42247
42371
  },
42248
42372
  []
42249
42373
  );
42250
- const schemaStats = React80__default.useMemo(() => {
42374
+ const schemaStats = React83__default.useMemo(() => {
42251
42375
  if (!metrics || metrics.length === 0) return null;
42252
42376
  return metrics.map((metric) => ({
42253
42377
  label: metric.label,
@@ -42255,7 +42379,7 @@ var init_StatCard = __esm({
42255
42379
  format: metric.format
42256
42380
  }));
42257
42381
  }, [metrics, data, computeMetricValue]);
42258
- const calculatedTrend = React80__default.useMemo(() => {
42382
+ const calculatedTrend = React83__default.useMemo(() => {
42259
42383
  if (manualTrend !== void 0) return manualTrend;
42260
42384
  if (previousValue === void 0 || currentValue === void 0)
42261
42385
  return void 0;
@@ -43366,7 +43490,7 @@ var init_Timeline = __esm({
43366
43490
  }) => {
43367
43491
  const { t } = useTranslate();
43368
43492
  const entityData = Array.isArray(entity) ? entity : [];
43369
- const items = React80__default.useMemo(() => {
43493
+ const items = React83__default.useMemo(() => {
43370
43494
  if (propItems) return propItems;
43371
43495
  if (entityData.length === 0) return [];
43372
43496
  return entityData.map((record, idx) => {
@@ -43473,7 +43597,7 @@ var init_Timeline = __esm({
43473
43597
  }
43474
43598
  });
43475
43599
  function extractToastProps(children) {
43476
- if (!React80__default.isValidElement(children)) {
43600
+ if (!React83__default.isValidElement(children)) {
43477
43601
  if (typeof children === "string") {
43478
43602
  return { message: children };
43479
43603
  }
@@ -43511,7 +43635,7 @@ var init_ToastSlot = __esm({
43511
43635
  eventBus.emit("UI:CLOSE");
43512
43636
  };
43513
43637
  if (!isVisible) return null;
43514
- const isCustomContent = React80__default.isValidElement(children) && !message;
43638
+ const isCustomContent = React83__default.isValidElement(children) && !message;
43515
43639
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
43516
43640
  Toast,
43517
43641
  {
@@ -43780,7 +43904,7 @@ var init_WizardContainer = __esm({
43780
43904
  const isCompleted = index < currentStep;
43781
43905
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
43782
43906
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
43783
- return /* @__PURE__ */ jsxs(React80__default.Fragment, { children: [
43907
+ return /* @__PURE__ */ jsxs(React83__default.Fragment, { children: [
43784
43908
  /* @__PURE__ */ jsx(
43785
43909
  Button,
43786
43910
  {
@@ -44162,12 +44286,12 @@ var init_WorldMapTemplate = __esm({
44162
44286
  }
44163
44287
  });
44164
44288
  function lazyThree(name, loader) {
44165
- const Lazy = React80__default.lazy(() => loader().then((m) => ({ default: m[name] })));
44289
+ const Lazy = React83__default.lazy(() => loader().then((m) => ({ default: m[name] })));
44166
44290
  function ThreeWrapper(props) {
44167
- return React80__default.createElement(
44168
- React80__default.Suspense,
44291
+ return React83__default.createElement(
44292
+ React83__default.Suspense,
44169
44293
  { fallback: null },
44170
- React80__default.createElement(Lazy, props)
44294
+ React83__default.createElement(Lazy, props)
44171
44295
  );
44172
44296
  }
44173
44297
  ThreeWrapper.displayName = `Lazy(${name})`;
@@ -44186,6 +44310,7 @@ var init_component_registry_generated = __esm({
44186
44310
  init_AnimatedGraphic();
44187
44311
  init_AnimatedReveal();
44188
44312
  init_ArticleSection();
44313
+ init_Aside();
44189
44314
  init_AuthLayout();
44190
44315
  init_BattleBoard();
44191
44316
  init_BattleTemplate();
@@ -44240,6 +44365,7 @@ var init_component_registry_generated = __esm({
44240
44365
  init_DayCell();
44241
44366
  init_DebuggerBoard();
44242
44367
  init_DetailPanel();
44368
+ init_Dialog();
44243
44369
  init_DialogueBox();
44244
44370
  init_DialogueBubble();
44245
44371
  init_DocBreadcrumb();
@@ -44453,6 +44579,7 @@ var init_component_registry_generated = __esm({
44453
44579
  "AnimatedGraphic": AnimatedGraphic,
44454
44580
  "AnimatedReveal": AnimatedReveal,
44455
44581
  "ArticleSection": ArticleSection,
44582
+ "Aside": Aside,
44456
44583
  "AuthLayout": AuthLayout,
44457
44584
  "Avatar": AvatarPattern,
44458
44585
  "AvatarPattern": AvatarPattern,
@@ -44522,6 +44649,7 @@ var init_component_registry_generated = __esm({
44522
44649
  "DayCell": DayCell,
44523
44650
  "DebuggerBoard": DebuggerBoard,
44524
44651
  "DetailPanel": DetailPanel,
44652
+ "Dialog": Dialog,
44525
44653
  "DialogueBox": DialogueBox,
44526
44654
  "DialogueBubble": DialogueBubble,
44527
44655
  "Divider": DividerPattern,
@@ -44775,7 +44903,7 @@ function SuspenseConfigProvider({
44775
44903
  config,
44776
44904
  children
44777
44905
  }) {
44778
- return React80__default.createElement(
44906
+ return React83__default.createElement(
44779
44907
  SuspenseConfigContext.Provider,
44780
44908
  { value: config },
44781
44909
  children
@@ -45258,7 +45386,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
45258
45386
  const key = `${parentId}-${index}-trait:${traitName}`;
45259
45387
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
45260
45388
  }
45261
- return /* @__PURE__ */ jsx(React80__default.Fragment, { children: child }, `${parentId}-${index}`);
45389
+ return /* @__PURE__ */ jsx(React83__default.Fragment, { children: child }, `${parentId}-${index}`);
45262
45390
  }
45263
45391
  if (!child || typeof child !== "object") return null;
45264
45392
  const childId = `${parentId}-${index}`;
@@ -45295,14 +45423,14 @@ function isPatternConfig(value) {
45295
45423
  if (value === null || value === void 0) return false;
45296
45424
  if (typeof value !== "object") return false;
45297
45425
  if (Array.isArray(value)) return false;
45298
- if (React80__default.isValidElement(value)) return false;
45426
+ if (React83__default.isValidElement(value)) return false;
45299
45427
  if (value instanceof Date) return false;
45300
45428
  if (typeof value === "function") return false;
45301
45429
  const record = value;
45302
45430
  return "type" in record && typeof record.type === "string";
45303
45431
  }
45304
45432
  function isPlainConfigObject(value) {
45305
- if (React80__default.isValidElement(value)) return false;
45433
+ if (React83__default.isValidElement(value)) return false;
45306
45434
  if (value instanceof Date) return false;
45307
45435
  const proto = Object.getPrototypeOf(value);
45308
45436
  return proto === Object.prototype || proto === null;
@@ -45663,7 +45791,7 @@ function resolveLambdaBindings(body, argName, arg) {
45663
45791
  if (Array.isArray(body)) {
45664
45792
  return body.map((b) => resolveLambdaBindings(b, argName, arg));
45665
45793
  }
45666
- if (body !== null && typeof body === "object" && !React80__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
45794
+ if (body !== null && typeof body === "object" && !React83__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
45667
45795
  const out = {};
45668
45796
  for (const [k, v] of Object.entries(body)) {
45669
45797
  out[k] = resolveLambdaBindings(v, argName, arg);
@@ -45682,7 +45810,7 @@ function getSlotContentRenderer2() {
45682
45810
  function makeLambdaFn(argName, lambdaBody, callerKey) {
45683
45811
  return (item, index) => {
45684
45812
  const resolvedBody = resolveLambdaBindings(lambdaBody, argName, item);
45685
- if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React80__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
45813
+ if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React83__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
45686
45814
  return null;
45687
45815
  }
45688
45816
  const record = resolvedBody;
@@ -45700,7 +45828,7 @@ function makeLambdaFn(argName, lambdaBody, callerKey) {
45700
45828
  props: childProps,
45701
45829
  priority: 0
45702
45830
  };
45703
- return React80__default.createElement(SlotContentRenderer2, { content: childContent });
45831
+ return React83__default.createElement(SlotContentRenderer2, { content: childContent });
45704
45832
  };
45705
45833
  }
45706
45834
  function convertNode(node, callerKey) {
@@ -45719,7 +45847,7 @@ function convertNode(node, callerKey) {
45719
45847
  });
45720
45848
  return anyChanged ? mapped : node;
45721
45849
  }
45722
- if (typeof node === "object" && !React80__default.isValidElement(node) && !(node instanceof Date)) {
45850
+ if (typeof node === "object" && !React83__default.isValidElement(node) && !(node instanceof Date)) {
45723
45851
  return convertObjectProps(node);
45724
45852
  }
45725
45853
  return node;