@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 React81 from 'react';
2
- import React81__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId } from 'react';
1
+ import * as React84 from 'react';
2
+ import React84__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId } from 'react';
3
3
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
4
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
5
5
  import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
@@ -496,89 +496,6 @@ var init_cn = __esm({
496
496
  "lib/cn.ts"() {
497
497
  }
498
498
  });
499
- function kebabToPascal(name) {
500
- return name.split("-").map((part) => {
501
- if (/^\d+$/.test(part)) return part;
502
- return part.charAt(0).toUpperCase() + part.slice(1);
503
- }).join("");
504
- }
505
- function resolveIcon(name) {
506
- const cached = resolvedCache.get(name);
507
- if (cached) return cached;
508
- const resolved = doResolve(name);
509
- resolvedCache.set(name, resolved);
510
- return resolved;
511
- }
512
- function doResolve(name) {
513
- if (iconAliases[name]) return iconAliases[name];
514
- const pascalName = kebabToPascal(name);
515
- const directLookup = LucideIcons[pascalName];
516
- if (directLookup && typeof directLookup === "object") return directLookup;
517
- const asIs = LucideIcons[name];
518
- if (asIs && typeof asIs === "object") return asIs;
519
- return LucideIcons.HelpCircle;
520
- }
521
- var iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
522
- var init_Icon = __esm({
523
- "components/atoms/Icon.tsx"() {
524
- init_cn();
525
- iconAliases = {
526
- "close": LucideIcons.X,
527
- "trash": LucideIcons.Trash2,
528
- "loader": LucideIcons.Loader2,
529
- "stop": LucideIcons.Square,
530
- "volume": LucideIcons.Volume2,
531
- "volume-off": LucideIcons.VolumeX,
532
- "refresh": LucideIcons.RefreshCw,
533
- "share": LucideIcons.Share2,
534
- "sort-asc": LucideIcons.ArrowUpNarrowWide,
535
- "sort-desc": LucideIcons.ArrowDownNarrowWide
536
- };
537
- resolvedCache = /* @__PURE__ */ new Map();
538
- sizeClasses = {
539
- xs: "w-3 h-3",
540
- sm: "w-4 h-4",
541
- md: "w-5 h-5",
542
- lg: "w-6 h-6",
543
- xl: "w-8 h-8"
544
- };
545
- animationClasses = {
546
- none: "",
547
- spin: "animate-spin",
548
- pulse: "animate-pulse"
549
- };
550
- Icon = ({
551
- icon,
552
- name,
553
- size = "md",
554
- color,
555
- animation = "none",
556
- className,
557
- strokeWidth,
558
- style
559
- }) => {
560
- const IconComponent = icon ?? (name ? resolveIcon(name) : LucideIcons.HelpCircle);
561
- const effectiveStrokeWidth = strokeWidth ?? void 0;
562
- return /* @__PURE__ */ jsx(
563
- IconComponent,
564
- {
565
- className: cn(
566
- sizeClasses[size],
567
- animationClasses[animation],
568
- color ? color : "text-current",
569
- className
570
- ),
571
- strokeWidth: effectiveStrokeWidth,
572
- style: {
573
- ...effectiveStrokeWidth === void 0 ? { strokeWidth: "var(--icon-stroke-width, 2)" } : {},
574
- ...style
575
- }
576
- }
577
- );
578
- };
579
- Icon.displayName = "Icon";
580
- }
581
- });
582
499
  var paddingStyles, paddingXStyles, paddingYStyles, marginStyles, marginXStyles, marginYStyles, bgStyles, roundedStyles, shadowStyles, displayStyles, overflowStyles, positionStyles, Box;
583
500
  var init_Box = __esm({
584
501
  "components/atoms/Box.tsx"() {
@@ -687,7 +604,7 @@ var init_Box = __esm({
687
604
  fixed: "fixed",
688
605
  sticky: "sticky"
689
606
  };
690
- Box = React81__default.forwardRef(
607
+ Box = React84__default.forwardRef(
691
608
  ({
692
609
  padding,
693
610
  paddingX,
@@ -737,38 +654,26 @@ var init_Box = __esm({
737
654
  onMouseLeave?.(e);
738
655
  }, [hoverEvent, eventBus, onMouseLeave]);
739
656
  const isClickable = action || onClick;
740
- const Comp = Component;
741
- return /* @__PURE__ */ jsx(
742
- Comp,
657
+ return React84__default.createElement(
658
+ Component,
743
659
  {
744
660
  ref,
745
661
  className: cn(
746
- // Padding
747
662
  padding && paddingStyles[padding],
748
663
  paddingX && paddingXStyles[paddingX],
749
664
  paddingY && paddingYStyles[paddingY],
750
- // Margin
751
665
  margin && marginStyles[margin],
752
666
  marginX && marginXStyles[marginX],
753
667
  marginY && marginYStyles[marginY],
754
- // Background
755
668
  bgStyles[bg],
756
- // Border - uses theme variables
757
669
  border && "border-[length:var(--border-width)] border-border",
758
- // Rounded
759
670
  roundedStyles[rounded],
760
- // Shadow
761
671
  shadowStyles[shadow],
762
- // Display
763
672
  display && displayStyles[display],
764
- // Dimensions
765
673
  fullWidth && "w-full",
766
674
  fullHeight && "h-full",
767
- // Overflow
768
675
  overflow && overflowStyles[overflow],
769
- // Position
770
676
  position && positionStyles[position],
771
- // Cursor for clickable
772
677
  isClickable && "cursor-pointer",
773
678
  className
774
679
  ),
@@ -776,15 +681,271 @@ var init_Box = __esm({
776
681
  onMouseEnter: hoverEvent || onMouseEnter ? handleMouseEnter : void 0,
777
682
  onMouseLeave: hoverEvent || onMouseLeave ? handleMouseLeave : void 0,
778
683
  style: maxWidth ? { maxWidth, ...rest.style } : rest.style,
779
- ...rest,
780
- children
781
- }
684
+ ...rest
685
+ },
686
+ children
782
687
  );
783
688
  }
784
689
  );
785
690
  Box.displayName = "Box";
786
691
  }
787
692
  });
693
+ function kebabToPascal(name) {
694
+ return name.split("-").map((part) => {
695
+ if (/^\d+$/.test(part)) return part;
696
+ return part.charAt(0).toUpperCase() + part.slice(1);
697
+ }).join("");
698
+ }
699
+ function resolveIcon(name) {
700
+ const cached = resolvedCache.get(name);
701
+ if (cached) return cached;
702
+ const resolved = doResolve(name);
703
+ resolvedCache.set(name, resolved);
704
+ return resolved;
705
+ }
706
+ function doResolve(name) {
707
+ if (iconAliases[name]) return iconAliases[name];
708
+ const pascalName = kebabToPascal(name);
709
+ const directLookup = LucideIcons[pascalName];
710
+ if (directLookup && typeof directLookup === "object") return directLookup;
711
+ const asIs = LucideIcons[name];
712
+ if (asIs && typeof asIs === "object") return asIs;
713
+ return LucideIcons.HelpCircle;
714
+ }
715
+ var iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
716
+ var init_Icon = __esm({
717
+ "components/atoms/Icon.tsx"() {
718
+ init_cn();
719
+ iconAliases = {
720
+ "close": LucideIcons.X,
721
+ "trash": LucideIcons.Trash2,
722
+ "loader": LucideIcons.Loader2,
723
+ "stop": LucideIcons.Square,
724
+ "volume": LucideIcons.Volume2,
725
+ "volume-off": LucideIcons.VolumeX,
726
+ "refresh": LucideIcons.RefreshCw,
727
+ "share": LucideIcons.Share2,
728
+ "sort-asc": LucideIcons.ArrowUpNarrowWide,
729
+ "sort-desc": LucideIcons.ArrowDownNarrowWide
730
+ };
731
+ resolvedCache = /* @__PURE__ */ new Map();
732
+ sizeClasses = {
733
+ xs: "w-3 h-3",
734
+ sm: "w-4 h-4",
735
+ md: "w-5 h-5",
736
+ lg: "w-6 h-6",
737
+ xl: "w-8 h-8"
738
+ };
739
+ animationClasses = {
740
+ none: "",
741
+ spin: "animate-spin",
742
+ pulse: "animate-pulse"
743
+ };
744
+ Icon = ({
745
+ icon,
746
+ name,
747
+ size = "md",
748
+ color,
749
+ animation = "none",
750
+ className,
751
+ strokeWidth,
752
+ style
753
+ }) => {
754
+ const IconComponent = icon ?? (name ? resolveIcon(name) : LucideIcons.HelpCircle);
755
+ const effectiveStrokeWidth = strokeWidth ?? void 0;
756
+ return /* @__PURE__ */ jsx(
757
+ IconComponent,
758
+ {
759
+ className: cn(
760
+ sizeClasses[size],
761
+ animationClasses[animation],
762
+ color ? color : "text-current",
763
+ className
764
+ ),
765
+ strokeWidth: effectiveStrokeWidth,
766
+ style: {
767
+ ...effectiveStrokeWidth === void 0 ? { strokeWidth: "var(--icon-stroke-width, 2)" } : {},
768
+ ...style
769
+ }
770
+ }
771
+ );
772
+ };
773
+ Icon.displayName = "Icon";
774
+ }
775
+ });
776
+ function resolveIconProp(value, sizeClass) {
777
+ if (!value) return null;
778
+ if (typeof value === "string") {
779
+ const Resolved = resolveIcon(value);
780
+ return Resolved ? /* @__PURE__ */ jsx(Resolved, { className: sizeClass }) : null;
781
+ }
782
+ if (typeof value === "function") {
783
+ const IconComp = value;
784
+ return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
785
+ }
786
+ if (React84__default.isValidElement(value)) {
787
+ return value;
788
+ }
789
+ if (typeof value === "object" && value !== null && "render" in value) {
790
+ const IconComp = value;
791
+ return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
792
+ }
793
+ return value;
794
+ }
795
+ var variantStyles, sizeStyles, iconSizeStyles, Button;
796
+ var init_Button = __esm({
797
+ "components/atoms/Button.tsx"() {
798
+ "use client";
799
+ init_cn();
800
+ init_useEventBus();
801
+ init_Icon();
802
+ variantStyles = {
803
+ primary: [
804
+ "bg-primary text-primary-foreground",
805
+ "border-none",
806
+ "shadow-sm",
807
+ "hover:bg-primary-hover hover:shadow-lg",
808
+ "active:scale-[var(--active-scale)] active:shadow-sm"
809
+ ].join(" "),
810
+ secondary: [
811
+ "bg-transparent text-accent",
812
+ "border border-accent",
813
+ "hover:bg-accent hover:text-white hover:border-accent",
814
+ "active:scale-[var(--active-scale)]"
815
+ ].join(" "),
816
+ ghost: [
817
+ "bg-transparent text-muted-foreground",
818
+ "border border-transparent",
819
+ "hover:text-primary-foreground hover:bg-primary hover:border-primary",
820
+ "active:scale-[var(--active-scale)]"
821
+ ].join(" "),
822
+ danger: [
823
+ "bg-surface text-error",
824
+ "border-[length:var(--border-width)] border-error",
825
+ "shadow-sm",
826
+ "hover:bg-error hover:text-error-foreground hover:shadow-lg",
827
+ "active:scale-[var(--active-scale)] active:shadow-sm"
828
+ ].join(" "),
829
+ success: [
830
+ "bg-surface text-success",
831
+ "border-[length:var(--border-width)] border-success",
832
+ "shadow-sm",
833
+ "hover:bg-success hover:text-success-foreground hover:shadow-lg",
834
+ "active:scale-[var(--active-scale)] active:shadow-sm"
835
+ ].join(" "),
836
+ warning: [
837
+ "bg-surface text-warning",
838
+ "border-[length:var(--border-width)] border-warning",
839
+ "shadow-sm",
840
+ "hover:bg-warning hover:text-warning-foreground hover:shadow-lg",
841
+ "active:scale-[var(--active-scale)] active:shadow-sm"
842
+ ].join(" "),
843
+ // "default" is an alias for secondary
844
+ default: [
845
+ "bg-secondary text-secondary-foreground",
846
+ "border-[length:var(--border-width-thin)] border-border",
847
+ "hover:bg-secondary-hover",
848
+ "active:scale-[var(--active-scale)]"
849
+ ].join(" ")
850
+ };
851
+ variantStyles.destructive = variantStyles.danger;
852
+ sizeStyles = {
853
+ sm: "px-3 py-1.5 text-sm",
854
+ md: "px-4 py-2 text-sm",
855
+ lg: "px-6 py-3 text-base"
856
+ };
857
+ iconSizeStyles = {
858
+ sm: "h-3.5 w-3.5",
859
+ md: "h-4 w-4",
860
+ lg: "h-5 w-5"
861
+ };
862
+ Button = React84__default.forwardRef(
863
+ ({
864
+ className,
865
+ variant = "primary",
866
+ size = "md",
867
+ isLoading = false,
868
+ disabled,
869
+ leftIcon,
870
+ rightIcon,
871
+ icon: iconProp,
872
+ iconRight: iconRightProp,
873
+ action,
874
+ actionPayload,
875
+ label,
876
+ children,
877
+ onClick,
878
+ ...props
879
+ }, ref) => {
880
+ const eventBus = useEventBus();
881
+ const leftIconValue = leftIcon || iconProp;
882
+ const rightIconValue = rightIcon || iconRightProp;
883
+ const resolvedLeftIcon = resolveIconProp(leftIconValue, iconSizeStyles[size]);
884
+ const resolvedRightIcon = resolveIconProp(rightIconValue, iconSizeStyles[size]);
885
+ const handleClick = (e) => {
886
+ if (action) {
887
+ eventBus.emit(`UI:${action}`, actionPayload ?? {});
888
+ }
889
+ onClick?.(e);
890
+ };
891
+ return /* @__PURE__ */ jsxs(
892
+ "button",
893
+ {
894
+ ref,
895
+ disabled: disabled || isLoading,
896
+ className: cn(
897
+ "inline-flex items-center justify-center gap-2",
898
+ "font-[var(--font-weight-medium)]",
899
+ "rounded-sm",
900
+ "cursor-pointer",
901
+ "transition-all duration-[var(--transition-normal)]",
902
+ "focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-ring focus:ring-offset-[length:var(--focus-ring-offset)]",
903
+ "disabled:opacity-50 disabled:cursor-not-allowed",
904
+ variantStyles[variant],
905
+ sizeStyles[size],
906
+ className
907
+ ),
908
+ onClick: handleClick,
909
+ ...props,
910
+ "data-testid": props["data-testid"] ?? (action ? `action-${action}` : void 0),
911
+ children: [
912
+ isLoading ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : resolvedLeftIcon && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: resolvedLeftIcon }),
913
+ children || label,
914
+ resolvedRightIcon && !isLoading && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: resolvedRightIcon })
915
+ ]
916
+ }
917
+ );
918
+ }
919
+ );
920
+ Button.displayName = "Button";
921
+ }
922
+ });
923
+ var Dialog;
924
+ var init_Dialog = __esm({
925
+ "components/atoms/Dialog.tsx"() {
926
+ init_cn();
927
+ Dialog = React84__default.forwardRef(
928
+ ({
929
+ role = "dialog",
930
+ "aria-modal": ariaModal = true,
931
+ className,
932
+ children,
933
+ ...rest
934
+ }, ref) => /* @__PURE__ */ jsx(
935
+ "dialog",
936
+ {
937
+ ref,
938
+ role,
939
+ "aria-modal": ariaModal,
940
+ className: cn(className),
941
+ ...rest,
942
+ children
943
+ }
944
+ )
945
+ );
946
+ Dialog.displayName = "Dialog";
947
+ }
948
+ });
788
949
 
789
950
  // components/atoms/Typography.tsx
790
951
  var Typography_exports = {};
@@ -793,11 +954,11 @@ __export(Typography_exports, {
793
954
  Text: () => Text,
794
955
  Typography: () => Typography
795
956
  });
796
- var variantStyles, colorStyles, weightStyles, defaultElements, typographySizeStyles, overflowStyles2, Typography, sizeStyles, Heading, Text;
957
+ var variantStyles2, colorStyles, weightStyles, defaultElements, typographySizeStyles, overflowStyles2, Typography, sizeStyles2, Heading, Text;
797
958
  var init_Typography = __esm({
798
959
  "components/atoms/Typography.tsx"() {
799
960
  init_cn();
800
- variantStyles = {
961
+ variantStyles2 = {
801
962
  h1: "text-4xl font-bold tracking-tight text-foreground",
802
963
  h2: "text-3xl font-bold tracking-tight text-foreground",
803
964
  h3: "text-2xl font-bold text-foreground",
@@ -889,7 +1050,7 @@ var init_Typography = __esm({
889
1050
  {
890
1051
  id,
891
1052
  className: cn(
892
- variantStyles[variant],
1053
+ variantStyles2[variant],
893
1054
  colorStyles[color],
894
1055
  weight && weightStyles[weight],
895
1056
  size && typographySizeStyles[size],
@@ -904,7 +1065,7 @@ var init_Typography = __esm({
904
1065
  );
905
1066
  };
906
1067
  Typography.displayName = "Typography";
907
- sizeStyles = {
1068
+ sizeStyles2 = {
908
1069
  xs: "text-xs",
909
1070
  sm: "text-sm",
910
1071
  md: "text-base",
@@ -920,7 +1081,7 @@ var init_Typography = __esm({
920
1081
  ...props
921
1082
  }) => {
922
1083
  const variant = `h${level}`;
923
- const sizeClass = size ? sizeStyles[size] : void 0;
1084
+ const sizeClass = size ? sizeStyles2[size] : void 0;
924
1085
  return /* @__PURE__ */ jsx(
925
1086
  Typography,
926
1087
  {
@@ -987,8 +1148,9 @@ var sizeClasses2, minWidths, Modal;
987
1148
  var init_Modal = __esm({
988
1149
  "components/molecules/Modal.tsx"() {
989
1150
  "use client";
990
- init_Icon();
991
1151
  init_Box();
1152
+ init_Button();
1153
+ init_Dialog();
992
1154
  init_Typography();
993
1155
  init_Overlay();
994
1156
  init_cn();
@@ -1081,7 +1243,7 @@ var init_Modal = __esm({
1081
1243
  }
1082
1244
  ),
1083
1245
  /* @__PURE__ */ jsx(
1084
- "div",
1246
+ Box,
1085
1247
  {
1086
1248
  className: cn(
1087
1249
  "fixed inset-0 z-50 pointer-events-none",
@@ -1090,17 +1252,17 @@ var init_Modal = __esm({
1090
1252
  ),
1091
1253
  style: { paddingTop: "10vh" },
1092
1254
  children: /* @__PURE__ */ jsxs(
1093
- Box,
1255
+ Dialog,
1094
1256
  {
1095
1257
  ref: modalRef,
1096
- bg: "surface",
1097
- border: true,
1098
- shadow: "lg",
1099
- rounded: "md",
1258
+ open: true,
1100
1259
  className: cn(
1101
- "pointer-events-auto w-full flex flex-col",
1260
+ // Reset browser-default dialog chrome — we own styling.
1261
+ "m-0 p-0 border-0 bg-transparent",
1262
+ // Pre-existing dialog frame
1263
+ "pointer-events-auto w-full flex flex-col bg-surface border shadow-lg rounded-md",
1102
1264
  sizeClasses2[size],
1103
- "max-sm:max-w-full max-sm:rounded-b-none max-sm:rounded-t-2xl",
1265
+ "max-sm:max-w-full max-sm:min-w-0 max-sm:rounded-b-none max-sm:rounded-t-2xl",
1104
1266
  className
1105
1267
  ),
1106
1268
  style: {
@@ -1111,12 +1273,10 @@ var init_Modal = __esm({
1111
1273
  transition: isDragging.current ? "none" : "transform 200ms ease-out"
1112
1274
  }
1113
1275
  },
1114
- role: "dialog",
1115
- "aria-modal": "true",
1116
1276
  ...title && { "aria-labelledby": "modal-title" },
1117
1277
  children: [
1118
1278
  /* @__PURE__ */ jsx(
1119
- "div",
1279
+ Box,
1120
1280
  {
1121
1281
  className: "hidden max-sm:flex justify-center py-2 cursor-grab active:cursor-grabbing touch-none",
1122
1282
  onPointerDown: (e) => {
@@ -1142,11 +1302,11 @@ var init_Modal = __esm({
1142
1302
  isDragging.current = false;
1143
1303
  setDragY(0);
1144
1304
  },
1145
- children: /* @__PURE__ */ jsx("div", { className: "w-10 h-1 rounded-full bg-border" })
1305
+ children: /* @__PURE__ */ jsx(Box, { className: "w-10 h-1 rounded-full bg-border" })
1146
1306
  }
1147
1307
  ),
1148
1308
  (title || showCloseButton) && /* @__PURE__ */ jsxs(
1149
- "div",
1309
+ Box,
1150
1310
  {
1151
1311
  className: cn(
1152
1312
  "px-6 py-4 flex items-center justify-between",
@@ -1155,25 +1315,22 @@ var init_Modal = __esm({
1155
1315
  children: [
1156
1316
  title && /* @__PURE__ */ jsx(Typography, { variant: "h4", as: "h2", id: "modal-title", children: title }),
1157
1317
  showCloseButton && /* @__PURE__ */ jsx(
1158
- "button",
1318
+ Button,
1159
1319
  {
1160
- type: "button",
1320
+ variant: "ghost",
1321
+ size: "sm",
1322
+ icon: X,
1161
1323
  onClick: handleClose,
1162
1324
  "data-event": "CLOSE",
1163
- className: cn(
1164
- "p-1 transition-colors rounded-sm",
1165
- "hover:bg-muted"
1166
- ),
1167
- "aria-label": "Close modal",
1168
- children: /* @__PURE__ */ jsx(Icon, { icon: X, size: "md" })
1325
+ "aria-label": "Close modal"
1169
1326
  }
1170
1327
  )
1171
1328
  ]
1172
1329
  }
1173
1330
  ),
1174
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto p-6", children }),
1331
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto p-6", children }),
1175
1332
  footer && /* @__PURE__ */ jsx(
1176
- "div",
1333
+ Box,
1177
1334
  {
1178
1335
  className: cn(
1179
1336
  "px-6 py-4 bg-muted",
@@ -1196,21 +1353,19 @@ var sizeWidths, Drawer;
1196
1353
  var init_Drawer = __esm({
1197
1354
  "components/molecules/Drawer.tsx"() {
1198
1355
  "use client";
1199
- init_Icon();
1200
1356
  init_Box();
1357
+ init_Button();
1201
1358
  init_Typography();
1202
1359
  init_Overlay();
1203
1360
  init_cn();
1204
1361
  init_useEventBus();
1205
1362
  sizeWidths = {
1206
- sm: "w-80",
1363
+ sm: "w-full sm:w-80",
1207
1364
  // 320px
1208
- md: "w-96",
1365
+ md: "w-full sm:w-96",
1209
1366
  // 384px
1210
- lg: "w-[480px]",
1211
- // 480px
1212
- xl: "w-[640px]",
1213
- // 640px
1367
+ lg: "w-full sm:w-[480px]",
1368
+ xl: "w-full sm:w-[640px]",
1214
1369
  full: "w-screen"
1215
1370
  };
1216
1371
  Drawer = ({
@@ -1308,7 +1463,7 @@ var init_Drawer = __esm({
1308
1463
  ...title && { "aria-labelledby": "drawer-title" },
1309
1464
  children: [
1310
1465
  (title || showCloseButton) && /* @__PURE__ */ jsxs(
1311
- "div",
1466
+ Box,
1312
1467
  {
1313
1468
  className: cn(
1314
1469
  "px-6 py-4 flex items-center justify-between shrink-0",
@@ -1317,25 +1472,22 @@ var init_Drawer = __esm({
1317
1472
  children: [
1318
1473
  title && /* @__PURE__ */ jsx(Typography, { variant: "h4", as: "h2", id: "drawer-title", children: title }),
1319
1474
  showCloseButton && /* @__PURE__ */ jsx(
1320
- "button",
1475
+ Button,
1321
1476
  {
1322
- type: "button",
1477
+ variant: "ghost",
1478
+ size: "sm",
1479
+ icon: X,
1323
1480
  onClick: handleClose,
1324
- className: cn(
1325
- "p-1 transition-colors rounded-sm",
1326
- "hover:bg-muted",
1327
- !title && "ml-auto"
1328
- ),
1329
1481
  "aria-label": "Close drawer",
1330
- children: /* @__PURE__ */ jsx(Icon, { icon: X, size: "md" })
1482
+ className: cn(!title && "ml-auto")
1331
1483
  }
1332
1484
  )
1333
1485
  ]
1334
1486
  }
1335
1487
  ),
1336
- /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto p-6", children }),
1488
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto p-6", children }),
1337
1489
  footer && /* @__PURE__ */ jsx(
1338
- "div",
1490
+ Box,
1339
1491
  {
1340
1492
  className: cn(
1341
1493
  "px-6 py-4 shrink-0 bg-muted",
@@ -1376,153 +1528,6 @@ var init_Drawer = __esm({
1376
1528
  Drawer.displayName = "Drawer";
1377
1529
  }
1378
1530
  });
1379
- function resolveIconProp(value, sizeClass) {
1380
- if (!value) return null;
1381
- if (typeof value === "string") {
1382
- const Resolved = resolveIcon(value);
1383
- return Resolved ? /* @__PURE__ */ jsx(Resolved, { className: sizeClass }) : null;
1384
- }
1385
- if (typeof value === "function") {
1386
- const IconComp = value;
1387
- return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1388
- }
1389
- if (React81__default.isValidElement(value)) {
1390
- return value;
1391
- }
1392
- if (typeof value === "object" && value !== null && "render" in value) {
1393
- const IconComp = value;
1394
- return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
1395
- }
1396
- return value;
1397
- }
1398
- var variantStyles2, sizeStyles2, iconSizeStyles, Button;
1399
- var init_Button = __esm({
1400
- "components/atoms/Button.tsx"() {
1401
- "use client";
1402
- init_cn();
1403
- init_useEventBus();
1404
- init_Icon();
1405
- variantStyles2 = {
1406
- primary: [
1407
- "bg-primary text-primary-foreground",
1408
- "border-none",
1409
- "shadow-sm",
1410
- "hover:bg-primary-hover hover:shadow-lg",
1411
- "active:scale-[var(--active-scale)] active:shadow-sm"
1412
- ].join(" "),
1413
- secondary: [
1414
- "bg-transparent text-accent",
1415
- "border border-accent",
1416
- "hover:bg-accent hover:text-white hover:border-accent",
1417
- "active:scale-[var(--active-scale)]"
1418
- ].join(" "),
1419
- ghost: [
1420
- "bg-transparent text-muted-foreground",
1421
- "border border-transparent",
1422
- "hover:text-primary-foreground hover:bg-primary hover:border-primary",
1423
- "active:scale-[var(--active-scale)]"
1424
- ].join(" "),
1425
- danger: [
1426
- "bg-surface text-error",
1427
- "border-[length:var(--border-width)] border-error",
1428
- "shadow-sm",
1429
- "hover:bg-error hover:text-error-foreground hover:shadow-lg",
1430
- "active:scale-[var(--active-scale)] active:shadow-sm"
1431
- ].join(" "),
1432
- success: [
1433
- "bg-surface text-success",
1434
- "border-[length:var(--border-width)] border-success",
1435
- "shadow-sm",
1436
- "hover:bg-success hover:text-success-foreground hover:shadow-lg",
1437
- "active:scale-[var(--active-scale)] active:shadow-sm"
1438
- ].join(" "),
1439
- warning: [
1440
- "bg-surface text-warning",
1441
- "border-[length:var(--border-width)] border-warning",
1442
- "shadow-sm",
1443
- "hover:bg-warning hover:text-warning-foreground hover:shadow-lg",
1444
- "active:scale-[var(--active-scale)] active:shadow-sm"
1445
- ].join(" "),
1446
- // "default" is an alias for secondary
1447
- default: [
1448
- "bg-secondary text-secondary-foreground",
1449
- "border-[length:var(--border-width-thin)] border-border",
1450
- "hover:bg-secondary-hover",
1451
- "active:scale-[var(--active-scale)]"
1452
- ].join(" ")
1453
- };
1454
- variantStyles2.destructive = variantStyles2.danger;
1455
- sizeStyles2 = {
1456
- sm: "px-3 py-1.5 text-sm",
1457
- md: "px-4 py-2 text-sm",
1458
- lg: "px-6 py-3 text-base"
1459
- };
1460
- iconSizeStyles = {
1461
- sm: "h-3.5 w-3.5",
1462
- md: "h-4 w-4",
1463
- lg: "h-5 w-5"
1464
- };
1465
- Button = React81__default.forwardRef(
1466
- ({
1467
- className,
1468
- variant = "primary",
1469
- size = "md",
1470
- isLoading = false,
1471
- disabled,
1472
- leftIcon,
1473
- rightIcon,
1474
- icon: iconProp,
1475
- iconRight: iconRightProp,
1476
- action,
1477
- actionPayload,
1478
- label,
1479
- children,
1480
- onClick,
1481
- ...props
1482
- }, ref) => {
1483
- const eventBus = useEventBus();
1484
- const leftIconValue = leftIcon || iconProp;
1485
- const rightIconValue = rightIcon || iconRightProp;
1486
- const resolvedLeftIcon = resolveIconProp(leftIconValue, iconSizeStyles[size]);
1487
- const resolvedRightIcon = resolveIconProp(rightIconValue, iconSizeStyles[size]);
1488
- const handleClick = (e) => {
1489
- if (action) {
1490
- eventBus.emit(`UI:${action}`, actionPayload ?? {});
1491
- }
1492
- onClick?.(e);
1493
- };
1494
- return /* @__PURE__ */ jsxs(
1495
- "button",
1496
- {
1497
- ref,
1498
- disabled: disabled || isLoading,
1499
- className: cn(
1500
- "inline-flex items-center justify-center gap-2",
1501
- "font-[var(--font-weight-medium)]",
1502
- "rounded-sm",
1503
- "cursor-pointer",
1504
- "transition-all duration-[var(--transition-normal)]",
1505
- "focus:outline-none focus:ring-[length:var(--focus-ring-width)] focus:ring-ring focus:ring-offset-[length:var(--focus-ring-offset)]",
1506
- "disabled:opacity-50 disabled:cursor-not-allowed",
1507
- variantStyles2[variant],
1508
- sizeStyles2[size],
1509
- className
1510
- ),
1511
- onClick: handleClick,
1512
- ...props,
1513
- "data-testid": props["data-testid"] ?? (action ? `action-${action}` : void 0),
1514
- children: [
1515
- isLoading ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : resolvedLeftIcon && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: resolvedLeftIcon }),
1516
- children || label,
1517
- resolvedRightIcon && !isLoading && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: resolvedRightIcon })
1518
- ]
1519
- }
1520
- );
1521
- }
1522
- );
1523
- Button.displayName = "Button";
1524
- }
1525
- });
1526
1531
  var variantStyles3, sizeStyles3, Badge;
1527
1532
  var init_Badge = __esm({
1528
1533
  "components/atoms/Badge.tsx"() {
@@ -1565,7 +1570,7 @@ var init_Badge = __esm({
1565
1570
  md: "px-2.5 py-1 text-sm",
1566
1571
  lg: "px-3 py-1.5 text-base"
1567
1572
  };
1568
- Badge = React81__default.forwardRef(
1573
+ Badge = React84__default.forwardRef(
1569
1574
  ({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
1570
1575
  const iconSizes3 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
1571
1576
  const resolvedIcon = typeof icon === "string" ? (() => {
@@ -1598,6 +1603,7 @@ var variantClasses, iconMap, iconColors, Toast;
1598
1603
  var init_Toast = __esm({
1599
1604
  "components/molecules/Toast.tsx"() {
1600
1605
  "use client";
1606
+ init_Box();
1601
1607
  init_Icon();
1602
1608
  init_Typography();
1603
1609
  init_Button();
@@ -1655,17 +1661,20 @@ var init_Toast = __esm({
1655
1661
  return () => clearTimeout(timer);
1656
1662
  }, [duration, onDismiss, dismissEvent]);
1657
1663
  return /* @__PURE__ */ jsx(
1658
- "div",
1664
+ Box,
1659
1665
  {
1660
1666
  className: cn(
1661
- "border-l-4 p-4 shadow min-w-[300px] max-w-md",
1667
+ // `min-w-[300px]` only kicks in at `sm:` and above so a phone
1668
+ // viewport doesn't get a toast wider than the screen near the
1669
+ // edge. `max-w-[calc(100vw-2rem)]` clamps to viewport too.
1670
+ "border-l-4 p-4 shadow min-w-0 sm:min-w-[300px] max-w-md max-w-[calc(100vw-2rem)]",
1662
1671
  "rounded-sm",
1663
1672
  variantClasses[variant],
1664
1673
  className
1665
1674
  ),
1666
1675
  role: "alert",
1667
- children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
1668
- /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 mt-0.5", children: /* @__PURE__ */ jsx(
1676
+ children: /* @__PURE__ */ jsxs(Box, { className: "flex items-start gap-3", children: [
1677
+ /* @__PURE__ */ jsx(Box, { className: "flex-shrink-0 mt-0.5", children: /* @__PURE__ */ jsx(
1669
1678
  Icon,
1670
1679
  {
1671
1680
  icon: iconMap[variant],
@@ -1673,25 +1682,22 @@ var init_Toast = __esm({
1673
1682
  className: iconColors[variant]
1674
1683
  }
1675
1684
  ) }),
1676
- /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
1685
+ /* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0", children: [
1677
1686
  title && /* @__PURE__ */ jsx(Typography, { variant: "h6", className: "mb-1", children: title }),
1678
1687
  /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-sm", children: message }),
1679
- actionLabel && (onAction || actionEvent) && /* @__PURE__ */ jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: handleAction, children: actionLabel }) })
1688
+ actionLabel && (onAction || actionEvent) && /* @__PURE__ */ jsx(Box, { className: "mt-3", children: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: handleAction, children: actionLabel }) })
1680
1689
  ] }),
1681
- /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 flex-shrink-0", children: [
1690
+ /* @__PURE__ */ jsxs(Box, { className: "flex items-start gap-2 flex-shrink-0", children: [
1682
1691
  badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: badge }),
1683
1692
  dismissible && /* @__PURE__ */ jsx(
1684
- "button",
1693
+ Button,
1685
1694
  {
1686
- type: "button",
1695
+ variant: "ghost",
1696
+ size: "sm",
1697
+ icon: X,
1687
1698
  onClick: handleDismiss,
1688
- className: cn(
1689
- "flex-shrink-0 p-1 transition-colors rounded-sm",
1690
- "hover:bg-muted",
1691
- "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2"
1692
- ),
1693
1699
  "aria-label": "Dismiss toast",
1694
- children: /* @__PURE__ */ jsx(Icon, { icon: X, size: "sm" })
1700
+ className: "flex-shrink-0"
1695
1701
  }
1696
1702
  )
1697
1703
  ] })
@@ -1859,7 +1865,7 @@ var init_SvgFlow = __esm({
1859
1865
  opacity = 1,
1860
1866
  className
1861
1867
  }) => {
1862
- const markerId = React81__default.useMemo(() => {
1868
+ const markerId = React84__default.useMemo(() => {
1863
1869
  flowIdCounter += 1;
1864
1870
  return `almadar-flow-arrow-${flowIdCounter}`;
1865
1871
  }, []);
@@ -2402,7 +2408,7 @@ var init_SvgRing = __esm({
2402
2408
  className,
2403
2409
  label
2404
2410
  }) => {
2405
- const gradientId = React81__default.useMemo(() => {
2411
+ const gradientId = React84__default.useMemo(() => {
2406
2412
  ringIdCounter += 1;
2407
2413
  return `almadar-ring-glow-${ringIdCounter}`;
2408
2414
  }, []);
@@ -2563,7 +2569,7 @@ var Input;
2563
2569
  var init_Input = __esm({
2564
2570
  "components/atoms/Input.tsx"() {
2565
2571
  init_cn();
2566
- Input = React81__default.forwardRef(
2572
+ Input = React84__default.forwardRef(
2567
2573
  ({
2568
2574
  className,
2569
2575
  inputType,
@@ -2681,7 +2687,7 @@ var Label;
2681
2687
  var init_Label = __esm({
2682
2688
  "components/atoms/Label.tsx"() {
2683
2689
  init_cn();
2684
- Label = React81__default.forwardRef(
2690
+ Label = React84__default.forwardRef(
2685
2691
  ({ className, required, children, ...props }, ref) => {
2686
2692
  return /* @__PURE__ */ jsxs(
2687
2693
  "label",
@@ -2707,7 +2713,7 @@ var Textarea;
2707
2713
  var init_Textarea = __esm({
2708
2714
  "components/atoms/Textarea.tsx"() {
2709
2715
  init_cn();
2710
- Textarea = React81__default.forwardRef(
2716
+ Textarea = React84__default.forwardRef(
2711
2717
  ({ className, error, ...props }, ref) => {
2712
2718
  return /* @__PURE__ */ jsx(
2713
2719
  "textarea",
@@ -2736,7 +2742,7 @@ var Select;
2736
2742
  var init_Select = __esm({
2737
2743
  "components/atoms/Select.tsx"() {
2738
2744
  init_cn();
2739
- Select = React81__default.forwardRef(
2745
+ Select = React84__default.forwardRef(
2740
2746
  ({ className, options, placeholder, error, ...props }, ref) => {
2741
2747
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
2742
2748
  /* @__PURE__ */ jsxs(
@@ -2778,7 +2784,7 @@ var Checkbox;
2778
2784
  var init_Checkbox = __esm({
2779
2785
  "components/atoms/Checkbox.tsx"() {
2780
2786
  init_cn();
2781
- Checkbox = React81__default.forwardRef(
2787
+ Checkbox = React84__default.forwardRef(
2782
2788
  ({ className, label, id, ...props }, ref) => {
2783
2789
  const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
2784
2790
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
@@ -2860,7 +2866,7 @@ var init_Card = __esm({
2860
2866
  md: "shadow",
2861
2867
  lg: "shadow-lg"
2862
2868
  };
2863
- Card = React81__default.forwardRef(
2869
+ Card = React84__default.forwardRef(
2864
2870
  ({
2865
2871
  className,
2866
2872
  variant = "bordered",
@@ -2896,9 +2902,9 @@ var init_Card = __esm({
2896
2902
  }
2897
2903
  );
2898
2904
  Card.displayName = "Card";
2899
- CardHeader = React81__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
2905
+ CardHeader = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
2900
2906
  CardHeader.displayName = "CardHeader";
2901
- CardTitle = React81__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2907
+ CardTitle = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2902
2908
  "h3",
2903
2909
  {
2904
2910
  ref,
@@ -2911,11 +2917,11 @@ var init_Card = __esm({
2911
2917
  }
2912
2918
  ));
2913
2919
  CardTitle.displayName = "CardTitle";
2914
- CardContent = React81__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
2920
+ CardContent = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
2915
2921
  CardContent.displayName = "CardContent";
2916
2922
  CardBody = CardContent;
2917
2923
  CardBody.displayName = "CardBody";
2918
- CardFooter = React81__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2924
+ CardFooter = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2919
2925
  "div",
2920
2926
  {
2921
2927
  ref,
@@ -2970,7 +2976,7 @@ var init_FilterPill = __esm({
2970
2976
  md: "w-3.5 h-3.5",
2971
2977
  lg: "w-4 h-4"
2972
2978
  };
2973
- FilterPill = React81__default.forwardRef(
2979
+ FilterPill = React84__default.forwardRef(
2974
2980
  ({
2975
2981
  className,
2976
2982
  variant = "default",
@@ -3049,7 +3055,7 @@ var init_Spinner = __esm({
3049
3055
  md: "h-6 w-6",
3050
3056
  lg: "h-8 w-8"
3051
3057
  };
3052
- Spinner = React81__default.forwardRef(
3058
+ Spinner = React84__default.forwardRef(
3053
3059
  ({ className, size = "md", ...props }, ref) => {
3054
3060
  return /* @__PURE__ */ jsx(
3055
3061
  "div",
@@ -3497,7 +3503,7 @@ var Radio;
3497
3503
  var init_Radio = __esm({
3498
3504
  "components/atoms/Radio.tsx"() {
3499
3505
  init_cn();
3500
- Radio = React81__default.forwardRef(
3506
+ Radio = React84__default.forwardRef(
3501
3507
  ({
3502
3508
  label,
3503
3509
  helperText,
@@ -3669,7 +3675,7 @@ var init_Switch = __esm({
3669
3675
  "components/atoms/Switch.tsx"() {
3670
3676
  "use client";
3671
3677
  init_cn();
3672
- Switch = React81.forwardRef(
3678
+ Switch = React84.forwardRef(
3673
3679
  ({
3674
3680
  checked,
3675
3681
  defaultChecked = false,
@@ -3680,10 +3686,10 @@ var init_Switch = __esm({
3680
3686
  name,
3681
3687
  className
3682
3688
  }, ref) => {
3683
- const [isChecked, setIsChecked] = React81.useState(
3689
+ const [isChecked, setIsChecked] = React84.useState(
3684
3690
  checked !== void 0 ? checked : defaultChecked
3685
3691
  );
3686
- React81.useEffect(() => {
3692
+ React84.useEffect(() => {
3687
3693
  if (checked !== void 0) {
3688
3694
  setIsChecked(checked);
3689
3695
  }
@@ -4032,6 +4038,16 @@ var init_FlipContainer = __esm({
4032
4038
  FlipContainer.displayName = "FlipContainer";
4033
4039
  }
4034
4040
  });
4041
+ var Aside;
4042
+ var init_Aside = __esm({
4043
+ "components/atoms/Aside.tsx"() {
4044
+ init_cn();
4045
+ Aside = React84__default.forwardRef(
4046
+ ({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
4047
+ );
4048
+ Aside.displayName = "Aside";
4049
+ }
4050
+ });
4035
4051
  function toSharedContext(ctx) {
4036
4052
  return createMinimalContext(
4037
4053
  {
@@ -4103,8 +4119,8 @@ var init_LawReferenceTooltip = __esm({
4103
4119
  position = "top",
4104
4120
  className
4105
4121
  }) => {
4106
- const [isVisible, setIsVisible] = React81__default.useState(false);
4107
- const timeoutRef = React81__default.useRef(null);
4122
+ const [isVisible, setIsVisible] = React84__default.useState(false);
4123
+ const timeoutRef = React84__default.useRef(null);
4108
4124
  const handleMouseEnter = () => {
4109
4125
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4110
4126
  timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
@@ -4113,7 +4129,7 @@ var init_LawReferenceTooltip = __esm({
4113
4129
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4114
4130
  setIsVisible(false);
4115
4131
  };
4116
- React81__default.useEffect(() => {
4132
+ React84__default.useEffect(() => {
4117
4133
  return () => {
4118
4134
  if (timeoutRef.current) clearTimeout(timeoutRef.current);
4119
4135
  };
@@ -4323,7 +4339,7 @@ var init_StatusDot = __esm({
4323
4339
  md: "w-2.5 h-2.5",
4324
4340
  lg: "w-3 h-3"
4325
4341
  };
4326
- StatusDot = React81__default.forwardRef(
4342
+ StatusDot = React84__default.forwardRef(
4327
4343
  ({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
4328
4344
  return /* @__PURE__ */ jsx(
4329
4345
  "span",
@@ -4376,7 +4392,7 @@ var init_TrendIndicator = __esm({
4376
4392
  down: TrendingDown,
4377
4393
  flat: ArrowRight
4378
4394
  };
4379
- TrendIndicator = React81__default.forwardRef(
4395
+ TrendIndicator = React84__default.forwardRef(
4380
4396
  ({
4381
4397
  className,
4382
4398
  value,
@@ -4443,7 +4459,7 @@ var init_RangeSlider = __esm({
4443
4459
  md: "w-4 h-4",
4444
4460
  lg: "w-5 h-5"
4445
4461
  };
4446
- RangeSlider = React81__default.forwardRef(
4462
+ RangeSlider = React84__default.forwardRef(
4447
4463
  ({
4448
4464
  className,
4449
4465
  min = 0,
@@ -5011,7 +5027,7 @@ var init_ContentSection = __esm({
5011
5027
  md: "py-16",
5012
5028
  lg: "py-24"
5013
5029
  };
5014
- ContentSection = React81__default.forwardRef(
5030
+ ContentSection = React84__default.forwardRef(
5015
5031
  ({ children, background = "default", padding = "lg", id, className }, ref) => {
5016
5032
  return /* @__PURE__ */ jsx(
5017
5033
  Box,
@@ -5545,7 +5561,7 @@ var init_AnimatedReveal = __esm({
5545
5561
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
5546
5562
  "none": {}
5547
5563
  };
5548
- AnimatedReveal = React81__default.forwardRef(
5564
+ AnimatedReveal = React84__default.forwardRef(
5549
5565
  ({
5550
5566
  trigger = "scroll",
5551
5567
  animation = "fade-up",
@@ -5705,7 +5721,7 @@ var init_AnimatedGraphic = __esm({
5705
5721
  "components/atoms/AnimatedGraphic.tsx"() {
5706
5722
  "use client";
5707
5723
  init_cn();
5708
- AnimatedGraphic = React81__default.forwardRef(
5724
+ AnimatedGraphic = React84__default.forwardRef(
5709
5725
  ({
5710
5726
  src,
5711
5727
  svgContent,
@@ -5728,7 +5744,7 @@ var init_AnimatedGraphic = __esm({
5728
5744
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
5729
5745
  const resolvedSvg = svgContent ?? fetchedSvg;
5730
5746
  const prevAnimateRef = useRef(animate);
5731
- const setRef = React81__default.useCallback(
5747
+ const setRef = React84__default.useCallback(
5732
5748
  (node) => {
5733
5749
  containerRef.current = node;
5734
5750
  if (typeof ref === "function") ref(node);
@@ -5953,9 +5969,9 @@ function ScoreDisplay({
5953
5969
  ...rest
5954
5970
  }) {
5955
5971
  const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
5956
- const [displayValue, setDisplayValue] = React81.useState(resolvedValue);
5957
- const [isAnimating, setIsAnimating] = React81.useState(false);
5958
- React81.useEffect(() => {
5972
+ const [displayValue, setDisplayValue] = React84.useState(resolvedValue);
5973
+ const [isAnimating, setIsAnimating] = React84.useState(false);
5974
+ React84.useEffect(() => {
5959
5975
  if (!animated || displayValue === resolvedValue) {
5960
5976
  setDisplayValue(resolvedValue);
5961
5977
  return;
@@ -6025,9 +6041,9 @@ function ControlButton({
6025
6041
  className
6026
6042
  }) {
6027
6043
  const eventBus = useEventBus();
6028
- const [isPressed, setIsPressed] = React81.useState(false);
6044
+ const [isPressed, setIsPressed] = React84.useState(false);
6029
6045
  const actualPressed = pressed ?? isPressed;
6030
- const handlePointerDown = React81.useCallback(
6046
+ const handlePointerDown = React84.useCallback(
6031
6047
  (e) => {
6032
6048
  e.preventDefault();
6033
6049
  if (disabled) return;
@@ -6037,7 +6053,7 @@ function ControlButton({
6037
6053
  },
6038
6054
  [disabled, pressEvent, eventBus, onPress]
6039
6055
  );
6040
- const handlePointerUp = React81.useCallback(
6056
+ const handlePointerUp = React84.useCallback(
6041
6057
  (e) => {
6042
6058
  e.preventDefault();
6043
6059
  if (disabled) return;
@@ -6047,7 +6063,7 @@ function ControlButton({
6047
6063
  },
6048
6064
  [disabled, releaseEvent, eventBus, onRelease]
6049
6065
  );
6050
- const handlePointerLeave = React81.useCallback(
6066
+ const handlePointerLeave = React84.useCallback(
6051
6067
  (e) => {
6052
6068
  if (isPressed) {
6053
6069
  setIsPressed(false);
@@ -6953,9 +6969,9 @@ function MiniMap({
6953
6969
  viewportRect,
6954
6970
  className
6955
6971
  }) {
6956
- const canvasRef = React81.useRef(null);
6957
- const frameRef = React81.useRef(0);
6958
- React81.useEffect(() => {
6972
+ const canvasRef = React84.useRef(null);
6973
+ const frameRef = React84.useRef(0);
6974
+ React84.useEffect(() => {
6959
6975
  const canvas = canvasRef.current;
6960
6976
  if (!canvas) return;
6961
6977
  const ctx = canvas.getContext("2d");
@@ -7249,7 +7265,7 @@ var init_ErrorBoundary = __esm({
7249
7265
  "use client";
7250
7266
  init_cn();
7251
7267
  init_ErrorState();
7252
- ErrorBoundary = class extends React81__default.Component {
7268
+ ErrorBoundary = class extends React84__default.Component {
7253
7269
  constructor(props) {
7254
7270
  super(props);
7255
7271
  __publicField(this, "reset", () => {
@@ -8185,7 +8201,7 @@ var init_HeroSection = __esm({
8185
8201
  HeroSection.displayName = "HeroSection";
8186
8202
  }
8187
8203
  });
8188
- var ArticleSection;
8204
+ var maxWidthMap, ArticleSection;
8189
8205
  var init_ArticleSection = __esm({
8190
8206
  "components/molecules/ArticleSection.tsx"() {
8191
8207
  "use client";
@@ -8193,6 +8209,11 @@ var init_ArticleSection = __esm({
8193
8209
  init_Box();
8194
8210
  init_Stack();
8195
8211
  init_Typography();
8212
+ maxWidthMap = {
8213
+ sm: "max-w-full sm:max-w-xl md:max-w-2xl",
8214
+ md: "max-w-full sm:max-w-2xl md:max-w-3xl",
8215
+ lg: "max-w-full sm:max-w-3xl md:max-w-4xl"
8216
+ };
8196
8217
  ArticleSection = ({
8197
8218
  title,
8198
8219
  children,
@@ -8207,7 +8228,7 @@ var init_ArticleSection = __esm({
8207
8228
  className
8208
8229
  ),
8209
8230
  padding: "md",
8210
- children: /* @__PURE__ */ jsxs(VStack, { gap: "lg", align: "start", children: [
8231
+ children: /* @__PURE__ */ jsxs(VStack, { gap: "lg", align: "start", className: cn("w-full mx-auto", maxWidthMap[maxWidth]), children: [
8211
8232
  /* @__PURE__ */ jsx(Typography, { variant: "h2", children: title }),
8212
8233
  /* @__PURE__ */ jsx(Box, { className: "w-full", children })
8213
8234
  ] })
@@ -8259,6 +8280,7 @@ var init_TeamCard = __esm({
8259
8280
  var gapStyles2, colStyles, SimpleGrid;
8260
8281
  var init_SimpleGrid = __esm({
8261
8282
  "components/molecules/SimpleGrid.tsx"() {
8283
+ init_Box();
8262
8284
  init_cn();
8263
8285
  gapStyles2 = {
8264
8286
  none: "gap-0",
@@ -8271,10 +8293,10 @@ var init_SimpleGrid = __esm({
8271
8293
  colStyles = {
8272
8294
  1: "grid-cols-1",
8273
8295
  2: "grid-cols-1 sm:grid-cols-2",
8274
- 3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
8275
- 4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",
8276
- 5: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5",
8277
- 6: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6"
8296
+ 3: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3",
8297
+ 4: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4",
8298
+ 5: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5",
8299
+ 6: "grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6"
8278
8300
  };
8279
8301
  SimpleGrid = ({
8280
8302
  minChildWidth = 250,
@@ -8285,12 +8307,12 @@ var init_SimpleGrid = __esm({
8285
8307
  children
8286
8308
  }) => {
8287
8309
  if (cols) {
8288
- return /* @__PURE__ */ jsx("div", { className: cn("grid", colStyles[cols], gapStyles2[gap], className), children });
8310
+ return /* @__PURE__ */ jsx(Box, { className: cn("grid", colStyles[cols], gapStyles2[gap], className), children });
8289
8311
  }
8290
8312
  const minWidth = typeof minChildWidth === "number" ? `${minChildWidth}px` : minChildWidth;
8291
8313
  const templateColumns = maxCols ? `repeat(auto-fit, minmax(min(${minWidth}, 100%), 1fr))` : `repeat(auto-fit, minmax(${minWidth}, 1fr))`;
8292
8314
  return /* @__PURE__ */ jsx(
8293
- "div",
8315
+ Box,
8294
8316
  {
8295
8317
  className: cn("grid", gapStyles2[gap], className),
8296
8318
  style: {
@@ -8680,8 +8702,8 @@ var init_Tooltip = __esm({
8680
8702
  if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
8681
8703
  };
8682
8704
  }, []);
8683
- const triggerElement = React81__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
8684
- const trigger = React81__default.cloneElement(triggerElement, {
8705
+ const triggerElement = React84__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
8706
+ const trigger = React84__default.cloneElement(triggerElement, {
8685
8707
  ref: triggerRef,
8686
8708
  onMouseEnter: handleMouseEnter,
8687
8709
  onMouseLeave: handleMouseLeave,
@@ -8802,8 +8824,8 @@ var init_Popover = __esm({
8802
8824
  onMouseEnter: handleOpen,
8803
8825
  onMouseLeave: handleClose
8804
8826
  };
8805
- const childElement = React81__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
8806
- const triggerElement = React81__default.cloneElement(
8827
+ const childElement = React84__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
8828
+ const triggerElement = React84__default.cloneElement(
8807
8829
  childElement,
8808
8830
  {
8809
8831
  ref: triggerRef,
@@ -8852,6 +8874,7 @@ var Menu;
8852
8874
  var init_Menu = __esm({
8853
8875
  "components/molecules/Menu.tsx"() {
8854
8876
  "use client";
8877
+ init_Box();
8855
8878
  init_Icon();
8856
8879
  init_Divider();
8857
8880
  init_Typography();
@@ -8920,8 +8943,8 @@ var init_Menu = __esm({
8920
8943
  "bottom-start": "top-full left-0 mt-2",
8921
8944
  "bottom-end": "top-full right-0 mt-2"
8922
8945
  };
8923
- const triggerChild = React81__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
8924
- const triggerElement = React81__default.cloneElement(
8946
+ const triggerChild = React84__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
8947
+ const triggerElement = React84__default.cloneElement(
8925
8948
  triggerChild,
8926
8949
  {
8927
8950
  ref: triggerRef,
@@ -8933,17 +8956,17 @@ var init_Menu = __esm({
8933
8956
  "border-[length:var(--border-width)] border-border",
8934
8957
  "shadow",
8935
8958
  "rounded-sm",
8936
- "min-w-[200px] py-1"
8959
+ "min-w-0 sm:min-w-[200px] max-w-[calc(100vw-1rem)] py-1"
8937
8960
  );
8938
8961
  const renderMenuItem = (item, hasSubMenu, index) => {
8939
8962
  const itemId = item.id ?? `item-${item.label.toLowerCase().replace(/\s+/g, "-")}-${index}`;
8940
8963
  const isDanger = item.variant === "danger";
8941
8964
  return /* @__PURE__ */ jsx(
8942
- "button",
8965
+ Box,
8943
8966
  {
8944
- type: "button",
8945
- onClick: () => handleItemClick({ ...item, id: itemId }),
8946
- disabled: item.disabled,
8967
+ as: "button",
8968
+ onClick: () => !item.disabled && handleItemClick({ ...item, id: itemId }),
8969
+ "aria-disabled": item.disabled || void 0,
8947
8970
  onMouseEnter: () => hasSubMenu && setActiveSubMenu(itemId),
8948
8971
  "data-testid": item.event ? `action-${item.event}` : void 0,
8949
8972
  className: cn(
@@ -8955,7 +8978,7 @@ var init_Menu = __esm({
8955
8978
  item.disabled && "cursor-not-allowed",
8956
8979
  isDanger && "text-error hover:bg-error/10"
8957
8980
  ),
8958
- children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: [
8981
+ children: /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-3 flex-1 min-w-0", children: [
8959
8982
  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" })),
8960
8983
  /* @__PURE__ */ jsx(
8961
8984
  Typography,
@@ -8980,10 +9003,10 @@ var init_Menu = __esm({
8980
9003
  if (isDivider) {
8981
9004
  return /* @__PURE__ */ jsx(Divider, { className: "my-1" }, `divider-${index}`);
8982
9005
  }
8983
- return /* @__PURE__ */ jsxs("div", { children: [
9006
+ return /* @__PURE__ */ jsxs(Box, { children: [
8984
9007
  renderMenuItem(item, !!hasSubMenu, index),
8985
9008
  hasSubMenu && activeSubMenu === itemId && item.subMenu && /* @__PURE__ */ jsx(
8986
- "div",
9009
+ Box,
8987
9010
  {
8988
9011
  className: cn(
8989
9012
  "absolute left-full top-0 ml-2 z-50",
@@ -8995,10 +9018,10 @@ var init_Menu = __esm({
8995
9018
  ] }, itemId);
8996
9019
  });
8997
9020
  };
8998
- return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
9021
+ return /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
8999
9022
  triggerElement,
9000
9023
  isOpen && triggerRect && /* @__PURE__ */ jsx(
9001
- "div",
9024
+ Box,
9002
9025
  {
9003
9026
  ref: menuRef,
9004
9027
  className: cn(
@@ -9337,13 +9360,13 @@ var init_MapView = __esm({
9337
9360
  shadowSize: [41, 41]
9338
9361
  });
9339
9362
  L.Marker.prototype.options.icon = defaultIcon;
9340
- const { useEffect: useEffect67, useRef: useRef65, useCallback: useCallback112, useState: useState96 } = React81__default;
9363
+ const { useEffect: useEffect68, useRef: useRef65, useCallback: useCallback112, useState: useState97 } = React84__default;
9341
9364
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
9342
9365
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
9343
9366
  function MapUpdater({ centerLat, centerLng, zoom }) {
9344
9367
  const map = useMap();
9345
9368
  const prevRef = useRef65({ centerLat, centerLng, zoom });
9346
- useEffect67(() => {
9369
+ useEffect68(() => {
9347
9370
  const prev = prevRef.current;
9348
9371
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
9349
9372
  map.setView([centerLat, centerLng], zoom);
@@ -9354,7 +9377,7 @@ var init_MapView = __esm({
9354
9377
  }
9355
9378
  function MapClickHandler({ onMapClick }) {
9356
9379
  const map = useMap();
9357
- useEffect67(() => {
9380
+ useEffect68(() => {
9358
9381
  if (!onMapClick) return;
9359
9382
  const handler = (e) => {
9360
9383
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -9382,7 +9405,7 @@ var init_MapView = __esm({
9382
9405
  showAttribution = true
9383
9406
  }) {
9384
9407
  const eventBus = useEventBus2();
9385
- const [clickedPosition, setClickedPosition] = useState96(null);
9408
+ const [clickedPosition, setClickedPosition] = useState97(null);
9386
9409
  const handleMapClick = useCallback112((lat, lng) => {
9387
9410
  if (showClickedPin) {
9388
9411
  setClickedPosition({ lat, lng });
@@ -9583,7 +9606,7 @@ function InputPattern({
9583
9606
  fieldName
9584
9607
  }) {
9585
9608
  const { emit } = useEventBus();
9586
- const [localValue, setLocalValue] = React81__default.useState(value);
9609
+ const [localValue, setLocalValue] = React84__default.useState(value);
9587
9610
  const handleChange = (e) => {
9588
9611
  setLocalValue(e.target.value);
9589
9612
  if (onChange) {
@@ -9621,7 +9644,7 @@ function TextareaPattern({
9621
9644
  fieldName
9622
9645
  }) {
9623
9646
  const { emit } = useEventBus();
9624
- const [localValue, setLocalValue] = React81__default.useState(value);
9647
+ const [localValue, setLocalValue] = React84__default.useState(value);
9625
9648
  const handleChange = (e) => {
9626
9649
  setLocalValue(e.target.value);
9627
9650
  if (onChange) {
@@ -9653,7 +9676,7 @@ function SelectPattern({
9653
9676
  fieldName
9654
9677
  }) {
9655
9678
  const { emit } = useEventBus();
9656
- const [localValue, setLocalValue] = React81__default.useState(value);
9679
+ const [localValue, setLocalValue] = React84__default.useState(value);
9657
9680
  const handleChange = (e) => {
9658
9681
  setLocalValue(e.target.value);
9659
9682
  if (onChange) {
@@ -9682,7 +9705,7 @@ function CheckboxPattern({
9682
9705
  className
9683
9706
  }) {
9684
9707
  const { emit } = useEventBus();
9685
- const [localChecked, setLocalChecked] = React81__default.useState(checked);
9708
+ const [localChecked, setLocalChecked] = React84__default.useState(checked);
9686
9709
  const handleChange = (e) => {
9687
9710
  setLocalChecked(e.target.checked);
9688
9711
  if (onChange) {
@@ -9913,8 +9936,8 @@ function ActionButtons({
9913
9936
  disabled
9914
9937
  }) {
9915
9938
  const eventBus = useEventBus();
9916
- const [activeButtons, setActiveButtons] = React81.useState(/* @__PURE__ */ new Set());
9917
- const handlePress = React81.useCallback(
9939
+ const [activeButtons, setActiveButtons] = React84.useState(/* @__PURE__ */ new Set());
9940
+ const handlePress = React84.useCallback(
9918
9941
  (id) => {
9919
9942
  setActiveButtons((prev) => new Set(prev).add(id));
9920
9943
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
@@ -9922,7 +9945,7 @@ function ActionButtons({
9922
9945
  },
9923
9946
  [actionEvent, eventBus, onAction]
9924
9947
  );
9925
- const handleRelease = React81.useCallback(
9948
+ const handleRelease = React84.useCallback(
9926
9949
  (id) => {
9927
9950
  setActiveButtons((prev) => {
9928
9951
  const next = new Set(prev);
@@ -12773,7 +12796,7 @@ var init_MarkdownContent = __esm({
12773
12796
  init_Box();
12774
12797
  init_useTranslate();
12775
12798
  init_cn();
12776
- MarkdownContent = React81__default.memo(
12799
+ MarkdownContent = React84__default.memo(
12777
12800
  ({ content, direction, className }) => {
12778
12801
  const { t: _t } = useTranslate();
12779
12802
  const safeContent = typeof content === "string" ? content : String(content ?? "");
@@ -12991,7 +13014,7 @@ var init_CodeBlock = __esm({
12991
13014
  log8 = createLogger("almadar:ui:markdown-code");
12992
13015
  LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
12993
13016
  HIDDEN_LINE_NUMBERS = { display: "none" };
12994
- CodeBlock = React81__default.memo(
13017
+ CodeBlock = React84__default.memo(
12995
13018
  ({
12996
13019
  code: rawCode,
12997
13020
  language = "text",
@@ -14300,7 +14323,7 @@ var init_StateMachineView = __esm({
14300
14323
  style: { top: title ? 30 : 0 },
14301
14324
  children: [
14302
14325
  entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
14303
- states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React81__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
14326
+ states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React84__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
14304
14327
  StateNode,
14305
14328
  {
14306
14329
  state,
@@ -15881,27 +15904,23 @@ var init_Grid = __esm({
15881
15904
  as: Component = "div"
15882
15905
  }) => {
15883
15906
  const mergedStyle = rows ? { gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`, ...style } : style;
15884
- const Comp = Component;
15885
- return /* @__PURE__ */ jsx(
15886
- Comp,
15907
+ return React84__default.createElement(
15908
+ Component,
15887
15909
  {
15888
15910
  className: cn(
15889
15911
  "grid",
15890
15912
  getColsClass(cols),
15891
- // Gap (rowGap/colGap override gap)
15892
15913
  rowGap ? rowGapStyles[rowGap] : colGap ? void 0 : gapStyles3[gap],
15893
15914
  colGap ? colGapStyles[colGap] : rowGap ? void 0 : void 0,
15894
15915
  rowGap && colGap ? `${rowGapStyles[rowGap]} ${colGapStyles[colGap]}` : void 0,
15895
- // Alignment
15896
15916
  alignItems && alignStyles2[alignItems],
15897
15917
  justifyItems && justifyStyles2[justifyItems],
15898
- // Flow
15899
15918
  flow && flowStyles[flow],
15900
15919
  className
15901
15920
  ),
15902
- style: mergedStyle,
15903
- children
15904
- }
15921
+ style: mergedStyle
15922
+ },
15923
+ children
15905
15924
  );
15906
15925
  };
15907
15926
  Grid.displayName = "Grid";
@@ -16920,6 +16939,35 @@ var init_useSwipeGesture = __esm({
16920
16939
  "use client";
16921
16940
  }
16922
16941
  });
16942
+ function dayWindowForViewport(width) {
16943
+ if (width <= 640) return 1;
16944
+ if (width <= 1024) return 3;
16945
+ return 7;
16946
+ }
16947
+ function useDayWindow(override) {
16948
+ const [w, setW] = useState(() => {
16949
+ if (override !== "auto") return override;
16950
+ if (typeof window === "undefined") return 7;
16951
+ return dayWindowForViewport(window.innerWidth);
16952
+ });
16953
+ useEffect(() => {
16954
+ if (override !== "auto") {
16955
+ setW(override);
16956
+ return void 0;
16957
+ }
16958
+ if (typeof window === "undefined") return void 0;
16959
+ const onResize = () => setW(dayWindowForViewport(window.innerWidth));
16960
+ onResize();
16961
+ window.addEventListener("resize", onResize);
16962
+ return () => window.removeEventListener("resize", onResize);
16963
+ }, [override]);
16964
+ return w;
16965
+ }
16966
+ function formatDateRange(start, end) {
16967
+ const startStr = start.toLocaleDateString(void 0, SHORT_DATE);
16968
+ const endStr = end.toLocaleDateString(void 0, SHORT_DATE);
16969
+ return start.toDateString() === end.toDateString() ? startStr : `${startStr} \u2013 ${endStr}`;
16970
+ }
16923
16971
  function getStartOfWeek(date) {
16924
16972
  const d = new Date(date);
16925
16973
  const day = d.getDay();
@@ -16960,7 +17008,8 @@ function CalendarGrid({
16960
17008
  longPressEvent,
16961
17009
  longPressPayload,
16962
17010
  swipeLeftEvent,
16963
- swipeRightEvent
17011
+ swipeRightEvent,
17012
+ dayWindow = "auto"
16964
17013
  }) {
16965
17014
  const eventBus = useEventBus();
16966
17015
  const longPressTimer = useRef(null);
@@ -16976,6 +17025,26 @@ function CalendarGrid({
16976
17025
  () => timeSlots ?? generateDefaultTimeSlots(),
16977
17026
  [timeSlots]
16978
17027
  );
17028
+ const visibleCount = useDayWindow(dayWindow);
17029
+ const [dayOffset, setDayOffset] = useState(0);
17030
+ useEffect(() => {
17031
+ if (dayOffset + visibleCount > 7) {
17032
+ setDayOffset(Math.max(0, 7 - visibleCount));
17033
+ }
17034
+ }, [visibleCount, dayOffset]);
17035
+ const visibleDays = useMemo(
17036
+ () => weekDays.slice(dayOffset, dayOffset + visibleCount),
17037
+ [weekDays, dayOffset, visibleCount]
17038
+ );
17039
+ const canPrev = dayOffset > 0;
17040
+ const canNext = dayOffset + visibleCount < 7;
17041
+ const stepPrev = useCallback(() => {
17042
+ setDayOffset((d) => Math.max(0, d - visibleCount));
17043
+ }, [visibleCount]);
17044
+ const stepNext = useCallback(() => {
17045
+ setDayOffset((d) => Math.min(7 - visibleCount, d + visibleCount));
17046
+ }, [visibleCount]);
17047
+ const gridColsClass = visibleCount === 1 ? "grid-cols-2" : visibleCount === 3 ? "grid-cols-4" : "grid-cols-8";
16979
17048
  const handleSlotClick = useCallback(
16980
17049
  (day, time) => {
16981
17050
  onSlotClick?.(day, time);
@@ -17027,93 +17096,124 @@ function CalendarGrid({
17027
17096
  },
17028
17097
  event.id
17029
17098
  );
17030
- return /* @__PURE__ */ jsx(
17099
+ return /* @__PURE__ */ jsxs(
17031
17100
  Box,
17032
17101
  {
17033
- className: cn("overflow-x-auto", className),
17102
+ className,
17034
17103
  ...swipeLeftEvent || swipeRightEvent ? {
17035
17104
  onPointerDown: swipe.onPointerDown,
17036
17105
  onPointerMove: swipe.onPointerMove,
17037
17106
  onPointerUp: swipe.onPointerUp,
17038
17107
  onPointerCancel: swipe.onPointerCancel
17039
17108
  } : {},
17040
- children: /* @__PURE__ */ jsxs(Box, { className: "min-w-[800px]", children: [
17041
- /* @__PURE__ */ jsxs(Box, { className: "grid grid-cols-8 border-b border-border", children: [
17042
- /* @__PURE__ */ jsx(Box, { className: "p-2" }),
17043
- weekDays.map((day) => {
17044
- const isToday = day.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
17045
- const count = eventsForDayCount(day);
17046
- return /* @__PURE__ */ jsxs(
17047
- Box,
17048
- {
17049
- className: "border-l border-border",
17050
- children: [
17051
- /* @__PURE__ */ jsx(
17052
- DayCell,
17053
- {
17054
- date: day,
17055
- isToday,
17056
- onClick: onDayClick
17057
- }
17058
- ),
17059
- count > 0 && /* @__PURE__ */ jsx(Box, { className: "text-center pb-1", children: /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: count }) })
17060
- ]
17061
- },
17062
- day.toISOString()
17063
- );
17064
- })
17109
+ children: [
17110
+ visibleCount < 7 && /* @__PURE__ */ jsxs(HStack, { align: "center", justify: "between", className: "mb-2 px-2", children: [
17111
+ /* @__PURE__ */ jsx(
17112
+ Button,
17113
+ {
17114
+ variant: "ghost",
17115
+ size: "sm",
17116
+ icon: ChevronLeft,
17117
+ onClick: stepPrev,
17118
+ "aria-disabled": !canPrev || void 0,
17119
+ "aria-label": "Previous days",
17120
+ children: "Prev"
17121
+ }
17122
+ ),
17123
+ /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: formatDateRange(visibleDays[0], visibleDays[visibleDays.length - 1]) }),
17124
+ /* @__PURE__ */ jsx(
17125
+ Button,
17126
+ {
17127
+ variant: "ghost",
17128
+ size: "sm",
17129
+ iconRight: ChevronRight,
17130
+ onClick: stepNext,
17131
+ "aria-disabled": !canNext || void 0,
17132
+ "aria-label": "Next days",
17133
+ children: "Next"
17134
+ }
17135
+ )
17065
17136
  ] }),
17066
- /* @__PURE__ */ jsx(Box, { className: "max-h-[500px] overflow-y-auto", children: resolvedTimeSlots.map((time) => /* @__PURE__ */ jsxs(
17067
- Box,
17068
- {
17069
- className: "grid grid-cols-8 border-b border-border",
17070
- children: [
17071
- /* @__PURE__ */ jsx(Box, { className: "p-2 text-right pr-3", children: /* @__PURE__ */ jsx(
17072
- Typography,
17137
+ /* @__PURE__ */ jsxs(Box, { children: [
17138
+ /* @__PURE__ */ jsxs(Box, { className: cn("grid border-b border-border", gridColsClass), children: [
17139
+ /* @__PURE__ */ jsx(Box, { className: "p-2" }),
17140
+ visibleDays.map((day) => {
17141
+ const isToday = day.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
17142
+ const count = eventsForDayCount(day);
17143
+ return /* @__PURE__ */ jsxs(
17144
+ Box,
17073
17145
  {
17074
- variant: "small",
17075
- className: "text-muted-foreground",
17076
- children: time
17077
- }
17078
- ) }),
17079
- weekDays.map((day) => {
17080
- const slotEvents = events2.filter(
17081
- (ev) => eventInSlot(ev, day, time)
17082
- );
17083
- const isToday = day.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
17084
- return /* @__PURE__ */ jsx(
17085
- TimeSlotCell,
17086
- {
17087
- time,
17088
- isOccupied: slotEvents.length > 0,
17089
- onClick: () => handleSlotClick(day, time),
17090
- className: cn(
17091
- "border-l border-border",
17092
- isToday && "bg-blue-50/30"
17146
+ className: "border-l border-border",
17147
+ children: [
17148
+ /* @__PURE__ */ jsx(
17149
+ DayCell,
17150
+ {
17151
+ date: day,
17152
+ isToday,
17153
+ onClick: onDayClick
17154
+ }
17093
17155
  ),
17094
- ...longPressEvent ? {
17095
- onPointerDown: () => startLongPress(day, time),
17096
- onPointerUp: clearLongPress,
17097
- onPointerCancel: clearLongPress
17098
- } : {},
17099
- children: /* @__PURE__ */ jsx(VStack, { gap: "xs", children: slotEvents.map(renderEvent) })
17100
- },
17101
- `${day.toISOString()}-${time}`
17102
- );
17103
- })
17104
- ]
17105
- },
17106
- time
17107
- )) })
17108
- ] })
17156
+ count > 0 && /* @__PURE__ */ jsx(Box, { className: "text-center pb-1", children: /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: count }) })
17157
+ ]
17158
+ },
17159
+ day.toISOString()
17160
+ );
17161
+ })
17162
+ ] }),
17163
+ /* @__PURE__ */ jsx(Box, { className: "max-h-[500px] overflow-y-auto", children: resolvedTimeSlots.map((time) => /* @__PURE__ */ jsxs(
17164
+ Box,
17165
+ {
17166
+ className: cn("grid border-b border-border", gridColsClass),
17167
+ children: [
17168
+ /* @__PURE__ */ jsx(Box, { className: "p-2 text-right pr-3", children: /* @__PURE__ */ jsx(
17169
+ Typography,
17170
+ {
17171
+ variant: "small",
17172
+ className: "text-muted-foreground",
17173
+ children: time
17174
+ }
17175
+ ) }),
17176
+ visibleDays.map((day) => {
17177
+ const slotEvents = events2.filter(
17178
+ (ev) => eventInSlot(ev, day, time)
17179
+ );
17180
+ const isToday = day.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
17181
+ return /* @__PURE__ */ jsx(
17182
+ TimeSlotCell,
17183
+ {
17184
+ time,
17185
+ isOccupied: slotEvents.length > 0,
17186
+ onClick: () => handleSlotClick(day, time),
17187
+ className: cn(
17188
+ "border-l border-border",
17189
+ isToday && "bg-blue-50/30"
17190
+ ),
17191
+ ...longPressEvent ? {
17192
+ onPointerDown: () => startLongPress(day, time),
17193
+ onPointerUp: clearLongPress,
17194
+ onPointerCancel: clearLongPress
17195
+ } : {},
17196
+ children: /* @__PURE__ */ jsx(VStack, { gap: "xs", children: slotEvents.map(renderEvent) })
17197
+ },
17198
+ `${day.toISOString()}-${time}`
17199
+ );
17200
+ })
17201
+ ]
17202
+ },
17203
+ time
17204
+ )) })
17205
+ ] })
17206
+ ]
17109
17207
  }
17110
17208
  );
17111
17209
  }
17210
+ var SHORT_DATE;
17112
17211
  var init_CalendarGrid = __esm({
17113
17212
  "components/molecules/CalendarGrid.tsx"() {
17114
17213
  "use client";
17115
17214
  init_cn();
17116
17215
  init_Box();
17216
+ init_Button();
17117
17217
  init_Stack();
17118
17218
  init_Typography();
17119
17219
  init_Badge();
@@ -17121,6 +17221,7 @@ var init_CalendarGrid = __esm({
17121
17221
  init_TimeSlotCell();
17122
17222
  init_useEventBus();
17123
17223
  init_useSwipeGesture();
17224
+ SHORT_DATE = { month: "short", day: "numeric" };
17124
17225
  CalendarGrid.displayName = "CalendarGrid";
17125
17226
  }
17126
17227
  });
@@ -20282,9 +20383,9 @@ var init_Tabs = __esm({
20282
20383
  className
20283
20384
  }) => {
20284
20385
  const rawItems = items ?? tabs ?? [];
20285
- const safeItems = rawItems.map((item) => ({
20286
- ...item,
20287
- id: item.id || item.value || ""
20386
+ const safeItems = rawItems.map(({ id, value, ...rest }) => ({
20387
+ ...rest,
20388
+ id: id || value || ""
20288
20389
  }));
20289
20390
  const eventBus = useEventBus();
20290
20391
  const { t } = useTranslate();
@@ -20353,7 +20454,12 @@ var init_Tabs = __esm({
20353
20454
  role: "tablist",
20354
20455
  className: cn(
20355
20456
  "flex",
20356
- orientation === "horizontal" ? "flex-row border-b-[length:var(--border-width)] border-border" : "flex-col border-r-[length:var(--border-width)] border-border",
20457
+ // Horizontal tab strip becomes a horizontally-scrollable lane
20458
+ // below its container width — phones with many tabs scroll
20459
+ // instead of clipping. `snap-x` snaps to each tab; the
20460
+ // scrollbar is hidden for a cleaner affordance (the swipe
20461
+ // gesture is the discoverability cue).
20462
+ 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",
20357
20463
  variant === "pills" && "gap-1 p-1 bg-muted border-0 rounded-md",
20358
20464
  variant === "underline" && orientation === "vertical" && "border-b-0"
20359
20465
  ),
@@ -20375,7 +20481,8 @@ var init_Tabs = __esm({
20375
20481
  onKeyDown: (e) => handleKeyDown(e, index),
20376
20482
  "data-active": isActive,
20377
20483
  className: cn(
20378
- "flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all",
20484
+ "flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all whitespace-nowrap",
20485
+ orientation === "horizontal" && "snap-start shrink-0",
20379
20486
  "focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
20380
20487
  isDisabled && "opacity-50 cursor-not-allowed",
20381
20488
  variantClasses2[variant],
@@ -21140,7 +21247,7 @@ function CraftingRecipe({
21140
21247
  className
21141
21248
  }) {
21142
21249
  const eventBus = useEventBus();
21143
- const handleCraft = React81.useCallback(() => {
21250
+ const handleCraft = React84.useCallback(() => {
21144
21251
  onCraft?.();
21145
21252
  if (craftEvent) {
21146
21253
  eventBus.emit(craftEvent, { output: output.label });
@@ -21157,7 +21264,7 @@ function CraftingRecipe({
21157
21264
  children: [
21158
21265
  /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
21159
21266
  const hasSufficient = ingredient.available >= ingredient.required;
21160
- return /* @__PURE__ */ jsxs(React81.Fragment, { children: [
21267
+ return /* @__PURE__ */ jsxs(React84.Fragment, { children: [
21161
21268
  /* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
21162
21269
  ItemSlot,
21163
21270
  {
@@ -21220,8 +21327,8 @@ function DPad({
21220
21327
  }) {
21221
21328
  const eventBus = useEventBus();
21222
21329
  const sizes = sizeMap15[size];
21223
- const [activeDirections, setActiveDirections] = React81.useState(/* @__PURE__ */ new Set());
21224
- const handlePress = React81.useCallback(
21330
+ const [activeDirections, setActiveDirections] = React84.useState(/* @__PURE__ */ new Set());
21331
+ const handlePress = React84.useCallback(
21225
21332
  (direction) => {
21226
21333
  setActiveDirections((prev) => new Set(prev).add(direction));
21227
21334
  if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
@@ -21229,7 +21336,7 @@ function DPad({
21229
21336
  },
21230
21337
  [directionEvent, eventBus, onDirection]
21231
21338
  );
21232
- const handleRelease = React81.useCallback(
21339
+ const handleRelease = React84.useCallback(
21233
21340
  (direction) => {
21234
21341
  setActiveDirections((prev) => {
21235
21342
  const next = new Set(prev);
@@ -21435,12 +21542,12 @@ var init_DashboardLayout = __esm({
21435
21542
  HStack,
21436
21543
  {
21437
21544
  gap: "none",
21438
- className: "min-h-screen w-full bg-background dark:bg-background items-stretch",
21545
+ className: "@container/dashboard min-h-screen w-full bg-background dark:bg-background items-stretch",
21439
21546
  children: [
21440
21547
  sidebarOpen && /* @__PURE__ */ jsx(
21441
21548
  Box,
21442
21549
  {
21443
- className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 lg:hidden",
21550
+ className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 @lg/dashboard:hidden",
21444
21551
  onClick: () => setSidebarOpen(false)
21445
21552
  }
21446
21553
  ),
@@ -21450,7 +21557,7 @@ var init_DashboardLayout = __esm({
21450
21557
  as: "aside",
21451
21558
  className: cn(
21452
21559
  "z-30 w-64 flex-shrink-0 bg-card dark:bg-card border-r border-border dark:border-border",
21453
- "fixed inset-y-0 left-0 lg:static lg:translate-x-0 lg:h-auto",
21560
+ "fixed inset-y-0 left-0 @lg/dashboard:static @lg/dashboard:translate-x-0 @lg/dashboard:h-auto",
21454
21561
  "transform transition-transform duration-200 ease-in-out",
21455
21562
  "flex flex-col",
21456
21563
  sidebarOpen ? "translate-x-0" : "-translate-x-full"
@@ -21487,7 +21594,7 @@ var init_DashboardLayout = __esm({
21487
21594
  Button,
21488
21595
  {
21489
21596
  variant: "ghost",
21490
- className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
21597
+ className: "@lg/dashboard:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
21491
21598
  onClick: () => setSidebarOpen(false),
21492
21599
  children: /* @__PURE__ */ jsx(X, { className: "h-5 w-5" })
21493
21600
  }
@@ -21526,19 +21633,19 @@ var init_DashboardLayout = __esm({
21526
21633
  {
21527
21634
  align: "center",
21528
21635
  justify: "between",
21529
- className: "h-full px-3 sm:px-4 gap-2 sm:gap-4",
21636
+ className: "h-full px-3 @sm/dashboard:px-4 gap-2 @sm/dashboard:gap-4",
21530
21637
  children: [
21531
21638
  /* @__PURE__ */ jsx(
21532
21639
  Button,
21533
21640
  {
21534
21641
  variant: "ghost",
21535
- 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",
21642
+ 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",
21536
21643
  onClick: () => setSidebarOpen(true),
21537
21644
  "aria-label": "Open sidebar",
21538
21645
  children: /* @__PURE__ */ jsx(Menu$1, { className: "h-5 w-5" })
21539
21646
  }
21540
21647
  ),
21541
- searchEnabled && /* @__PURE__ */ jsx(Box, { className: "hidden sm:block flex-1 min-w-0 xl:max-w-md", children: /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
21648
+ 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: [
21542
21649
  /* @__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" }),
21543
21650
  /* @__PURE__ */ jsx(
21544
21651
  Input,
@@ -21623,12 +21730,12 @@ var init_DashboardLayout = __esm({
21623
21730
  Typography,
21624
21731
  {
21625
21732
  variant: "small",
21626
- className: "hidden sm:block text-sm font-medium text-foreground dark:text-foreground",
21733
+ className: "hidden @sm/dashboard:block text-sm font-medium text-foreground dark:text-foreground",
21627
21734
  as: "span",
21628
21735
  children: user.name
21629
21736
  }
21630
21737
  ),
21631
- /* @__PURE__ */ jsx(ChevronDown, { className: "hidden sm:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
21738
+ /* @__PURE__ */ jsx(ChevronDown, { className: "hidden @sm/dashboard:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
21632
21739
  ]
21633
21740
  }
21634
21741
  ),
@@ -21685,7 +21792,7 @@ var init_DashboardLayout = __esm({
21685
21792
  )
21686
21793
  }
21687
21794
  ),
21688
- /* @__PURE__ */ jsx(Box, { as: "main", className: "flex-1 p-3 sm:p-4 md:p-6", children })
21795
+ /* @__PURE__ */ jsx(Box, { as: "main", className: "flex-1 p-3 @sm/dashboard:p-4 @md/dashboard:p-6", children })
21689
21796
  ] })
21690
21797
  ]
21691
21798
  }
@@ -21770,14 +21877,14 @@ function useDataDnd(args) {
21770
21877
  const isZone = Boolean(dragGroup || accepts || sortable);
21771
21878
  const enabled = isZone || Boolean(dndRoot);
21772
21879
  const eventBus = useEventBus();
21773
- const parentRoot = React81__default.useContext(RootCtx);
21880
+ const parentRoot = React84__default.useContext(RootCtx);
21774
21881
  const isRoot = enabled && parentRoot === null;
21775
- const zoneId = React81__default.useId();
21882
+ const zoneId = React84__default.useId();
21776
21883
  const ownGroup = dragGroup ?? accepts ?? zoneId;
21777
- const [optimisticOrders, setOptimisticOrders] = React81__default.useState(() => /* @__PURE__ */ new Map());
21778
- const optimisticOrdersRef = React81__default.useRef(optimisticOrders);
21884
+ const [optimisticOrders, setOptimisticOrders] = React84__default.useState(() => /* @__PURE__ */ new Map());
21885
+ const optimisticOrdersRef = React84__default.useRef(optimisticOrders);
21779
21886
  optimisticOrdersRef.current = optimisticOrders;
21780
- const clearOptimisticOrder = React81__default.useCallback((group) => {
21887
+ const clearOptimisticOrder = React84__default.useCallback((group) => {
21781
21888
  setOptimisticOrders((prev) => {
21782
21889
  if (!prev.has(group)) return prev;
21783
21890
  const next = new Map(prev);
@@ -21802,7 +21909,7 @@ function useDataDnd(args) {
21802
21909
  const raw = it[dndItemIdField];
21803
21910
  return String(raw ?? `__idx_${idx}`);
21804
21911
  }).join("|");
21805
- const itemIds = React81__default.useMemo(
21912
+ const itemIds = React84__default.useMemo(
21806
21913
  () => orderedItems.map((it, idx) => {
21807
21914
  const raw = it[dndItemIdField];
21808
21915
  return raw ?? `__idx_${idx}`;
@@ -21810,7 +21917,7 @@ function useDataDnd(args) {
21810
21917
  [itemIdsSignature]
21811
21918
  );
21812
21919
  const itemsContentSig = items.map((it, idx) => String(it[dndItemIdField] ?? `__${idx}`)).join("|");
21813
- React81__default.useEffect(() => {
21920
+ React84__default.useEffect(() => {
21814
21921
  const root = isRoot ? null : parentRoot;
21815
21922
  if (root) {
21816
21923
  root.clearOptimisticOrder(ownGroup);
@@ -21818,20 +21925,20 @@ function useDataDnd(args) {
21818
21925
  clearOptimisticOrder(ownGroup);
21819
21926
  }
21820
21927
  }, [itemsContentSig, ownGroup]);
21821
- const zonesRef = React81__default.useRef(/* @__PURE__ */ new Map());
21822
- const registerZone = React81__default.useCallback((zoneId2, meta2) => {
21928
+ const zonesRef = React84__default.useRef(/* @__PURE__ */ new Map());
21929
+ const registerZone = React84__default.useCallback((zoneId2, meta2) => {
21823
21930
  zonesRef.current.set(zoneId2, meta2);
21824
21931
  }, []);
21825
- const unregisterZone = React81__default.useCallback((zoneId2) => {
21932
+ const unregisterZone = React84__default.useCallback((zoneId2) => {
21826
21933
  zonesRef.current.delete(zoneId2);
21827
21934
  }, []);
21828
- const [activeDrag, setActiveDrag] = React81__default.useState(null);
21829
- const [overZoneGroup, setOverZoneGroup] = React81__default.useState(null);
21830
- const meta = React81__default.useMemo(
21935
+ const [activeDrag, setActiveDrag] = React84__default.useState(null);
21936
+ const [overZoneGroup, setOverZoneGroup] = React84__default.useState(null);
21937
+ const meta = React84__default.useMemo(
21831
21938
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
21832
21939
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
21833
21940
  );
21834
- React81__default.useEffect(() => {
21941
+ React84__default.useEffect(() => {
21835
21942
  const target = isRoot ? null : parentRoot;
21836
21943
  if (!target) {
21837
21944
  zonesRef.current.set(zoneId, meta);
@@ -21850,7 +21957,7 @@ function useDataDnd(args) {
21850
21957
  }, [parentRoot, isRoot, zoneId, meta]);
21851
21958
  const sensors = useAlmadarDndSensors(true);
21852
21959
  const collisionDetection = almadarDndCollisionDetection;
21853
- const findZoneByItem = React81__default.useCallback(
21960
+ const findZoneByItem = React84__default.useCallback(
21854
21961
  (id) => {
21855
21962
  for (const z of zonesRef.current.values()) {
21856
21963
  if (z.itemIds.includes(id)) return z;
@@ -21859,7 +21966,7 @@ function useDataDnd(args) {
21859
21966
  },
21860
21967
  []
21861
21968
  );
21862
- React81__default.useCallback(
21969
+ React84__default.useCallback(
21863
21970
  (group) => {
21864
21971
  for (const z of zonesRef.current.values()) {
21865
21972
  if (z.group === group) return z;
@@ -21868,7 +21975,7 @@ function useDataDnd(args) {
21868
21975
  },
21869
21976
  []
21870
21977
  );
21871
- const handleDragEnd = React81__default.useCallback(
21978
+ const handleDragEnd = React84__default.useCallback(
21872
21979
  (event) => {
21873
21980
  const { active, over } = event;
21874
21981
  const activeIdStr = String(active.id);
@@ -21959,8 +22066,8 @@ function useDataDnd(args) {
21959
22066
  },
21960
22067
  [eventBus]
21961
22068
  );
21962
- const sortableData = React81__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
21963
- const SortableItem = React81__default.useCallback(
22069
+ const sortableData = React84__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
22070
+ const SortableItem = React84__default.useCallback(
21964
22071
  ({ id, children }) => {
21965
22072
  const {
21966
22073
  attributes,
@@ -22000,7 +22107,7 @@ function useDataDnd(args) {
22000
22107
  id: droppableId,
22001
22108
  data: sortableData
22002
22109
  });
22003
- const ctx = React81__default.useContext(RootCtx);
22110
+ const ctx = React84__default.useContext(RootCtx);
22004
22111
  const activeDrag2 = ctx?.activeDrag ?? null;
22005
22112
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
22006
22113
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -22015,7 +22122,7 @@ function useDataDnd(args) {
22015
22122
  showForeignPlaceholder,
22016
22123
  ctxAvailable: ctx != null
22017
22124
  });
22018
- React81__default.useEffect(() => {
22125
+ React84__default.useEffect(() => {
22019
22126
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
22020
22127
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
22021
22128
  return /* @__PURE__ */ jsx(
@@ -22029,11 +22136,11 @@ function useDataDnd(args) {
22029
22136
  }
22030
22137
  );
22031
22138
  };
22032
- const rootContextValue = React81__default.useMemo(
22139
+ const rootContextValue = React84__default.useMemo(
22033
22140
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
22034
22141
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
22035
22142
  );
22036
- const handleDragStart = React81__default.useCallback((event) => {
22143
+ const handleDragStart = React84__default.useCallback((event) => {
22037
22144
  const sourceZone = findZoneByItem(event.active.id);
22038
22145
  const rect = event.active.rect.current.initial;
22039
22146
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -22052,7 +22159,7 @@ function useDataDnd(args) {
22052
22159
  isRoot
22053
22160
  });
22054
22161
  }, [findZoneByItem, isRoot, zoneId]);
22055
- const handleDragOver = React81__default.useCallback((event) => {
22162
+ const handleDragOver = React84__default.useCallback((event) => {
22056
22163
  const { active, over } = event;
22057
22164
  const overData = over?.data?.current;
22058
22165
  const overGroup = overData?.dndGroup ?? null;
@@ -22122,7 +22229,7 @@ function useDataDnd(args) {
22122
22229
  return next;
22123
22230
  });
22124
22231
  }, []);
22125
- const handleDragCancel = React81__default.useCallback((event) => {
22232
+ const handleDragCancel = React84__default.useCallback((event) => {
22126
22233
  setActiveDrag(null);
22127
22234
  setOverZoneGroup(null);
22128
22235
  dndLog.warn("dragCancel", {
@@ -22130,12 +22237,12 @@ function useDataDnd(args) {
22130
22237
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
22131
22238
  });
22132
22239
  }, []);
22133
- const handleDragEndWithCleanup = React81__default.useCallback((event) => {
22240
+ const handleDragEndWithCleanup = React84__default.useCallback((event) => {
22134
22241
  handleDragEnd(event);
22135
22242
  setActiveDrag(null);
22136
22243
  setOverZoneGroup(null);
22137
22244
  }, [handleDragEnd]);
22138
- const wrapContainer = React81__default.useCallback(
22245
+ const wrapContainer = React84__default.useCallback(
22139
22246
  (children) => {
22140
22247
  if (!enabled) return children;
22141
22248
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -22189,7 +22296,7 @@ var init_useDataDnd = __esm({
22189
22296
  init_useAlmadarDndCollision();
22190
22297
  init_Box();
22191
22298
  dndLog = createLogger("almadar:ui:dnd");
22192
- RootCtx = React81__default.createContext(null);
22299
+ RootCtx = React84__default.createContext(null);
22193
22300
  }
22194
22301
  });
22195
22302
  function fieldLabel2(key) {
@@ -22678,7 +22785,7 @@ function DataList({
22678
22785
  }) {
22679
22786
  const eventBus = useEventBus();
22680
22787
  const { t } = useTranslate();
22681
- const [visibleCount, setVisibleCount] = React81__default.useState(pageSize || Infinity);
22788
+ const [visibleCount, setVisibleCount] = React84__default.useState(pageSize || Infinity);
22682
22789
  const fieldDefs = fields ?? columns ?? [];
22683
22790
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
22684
22791
  const dnd = useDataDnd({
@@ -22697,7 +22804,7 @@ function DataList({
22697
22804
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
22698
22805
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
22699
22806
  const hasRenderProp = typeof children === "function";
22700
- React81__default.useEffect(() => {
22807
+ React84__default.useEffect(() => {
22701
22808
  const renderItemTypeOf = typeof schemaRenderItem;
22702
22809
  const childrenTypeOf = typeof children;
22703
22810
  if (data.length > 0 && !hasRenderProp) {
@@ -22754,7 +22861,7 @@ function DataList({
22754
22861
  const items2 = data.map((item) => item);
22755
22862
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
22756
22863
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
22757
- return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
22864
+ return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
22758
22865
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
22759
22866
  group.items.map((itemData, index) => {
22760
22867
  const id = itemData.id || `${gi}-${index}`;
@@ -22942,7 +23049,7 @@ function DataList({
22942
23049
  className
22943
23050
  ),
22944
23051
  children: [
22945
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
23052
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
22946
23053
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
22947
23054
  group.items.map(
22948
23055
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -24171,6 +24278,8 @@ var SidePanel;
24171
24278
  var init_SidePanel = __esm({
24172
24279
  "components/molecules/SidePanel.tsx"() {
24173
24280
  "use client";
24281
+ init_Aside();
24282
+ init_Box();
24174
24283
  init_Button();
24175
24284
  init_Typography();
24176
24285
  init_cn();
@@ -24180,7 +24289,7 @@ var init_SidePanel = __esm({
24180
24289
  children,
24181
24290
  isOpen,
24182
24291
  onClose,
24183
- width = "w-96",
24292
+ width = "w-full sm:w-96",
24184
24293
  position = "right",
24185
24294
  showOverlay = true,
24186
24295
  className,
@@ -24194,14 +24303,14 @@ var init_SidePanel = __esm({
24194
24303
  if (!isOpen) return null;
24195
24304
  return /* @__PURE__ */ jsxs(Fragment, { children: [
24196
24305
  showOverlay && /* @__PURE__ */ jsx(
24197
- "div",
24306
+ Box,
24198
24307
  {
24199
24308
  className: "fixed inset-0 bg-white/80 backdrop-blur-sm z-40 lg:hidden",
24200
24309
  onClick: handleClose
24201
24310
  }
24202
24311
  ),
24203
24312
  /* @__PURE__ */ jsxs(
24204
- "aside",
24313
+ Aside,
24205
24314
  {
24206
24315
  className: cn(
24207
24316
  "fixed top-16 lg:top-0 bottom-0 z-[60]",
@@ -24215,7 +24324,7 @@ var init_SidePanel = __esm({
24215
24324
  className
24216
24325
  ),
24217
24326
  children: [
24218
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-4 border-b-2 border-border sticky top-0 bg-card z-10", children: [
24327
+ /* @__PURE__ */ jsxs(Box, { className: "flex items-center justify-between p-4 border-b-2 border-border sticky top-0 bg-card z-10", children: [
24219
24328
  /* @__PURE__ */ jsx(Typography, { variant: "h6", children: title }),
24220
24329
  /* @__PURE__ */ jsx(
24221
24330
  Button,
@@ -24225,11 +24334,11 @@ var init_SidePanel = __esm({
24225
24334
  icon: X,
24226
24335
  onClick: handleClose,
24227
24336
  "aria-label": "Close panel",
24228
- children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
24337
+ children: /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", className: "sr-only", children: "Close" })
24229
24338
  }
24230
24339
  )
24231
24340
  ] }),
24232
- /* @__PURE__ */ jsx("div", { className: "p-4 flex-1 overflow-y-auto", children })
24341
+ /* @__PURE__ */ jsx(Box, { className: "p-4 flex-1 overflow-y-auto", children })
24233
24342
  ]
24234
24343
  }
24235
24344
  )
@@ -24280,7 +24389,7 @@ var init_WizardProgress = __esm({
24280
24389
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
24281
24390
  const isActive = index === currentStep;
24282
24391
  const isCompleted = index < currentStep;
24283
- return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
24392
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
24284
24393
  /* @__PURE__ */ jsx(
24285
24394
  "button",
24286
24395
  {
@@ -24405,7 +24514,9 @@ var init_WizardNavigation = __esm({
24405
24514
  {
24406
24515
  border: true,
24407
24516
  className: cn(
24408
- "border-t-2 border-x-0 border-b-0 border-border flex justify-between items-center",
24517
+ // `flex-wrap gap-2` lets the Back / Step / Next trio reflow on
24518
+ // narrow viewports rather than crushing the step counter.
24519
+ "border-t-2 border-x-0 border-b-0 border-border flex flex-wrap gap-2 justify-between items-center",
24409
24520
  compact ? "px-4 py-2" : "px-6 py-4",
24410
24521
  className
24411
24522
  ),
@@ -25336,7 +25447,7 @@ function InventoryGrid({
25336
25447
  const eventBus = useEventBus();
25337
25448
  const slotCount = totalSlots ?? items.length;
25338
25449
  const emptySlotCount = Math.max(0, slotCount - items.length);
25339
- const handleSelect = React81.useCallback(
25450
+ const handleSelect = React84.useCallback(
25340
25451
  (id) => {
25341
25452
  onSelect?.(id);
25342
25453
  if (selectEvent) {
@@ -25549,15 +25660,15 @@ function GameCanvas2D({
25549
25660
  fps = 60,
25550
25661
  className
25551
25662
  }) {
25552
- const canvasRef = React81.useRef(null);
25553
- const rafRef = React81.useRef(0);
25554
- const frameRef = React81.useRef(0);
25555
- const lastTimeRef = React81.useRef(0);
25556
- const onDrawRef = React81.useRef(onDraw);
25663
+ const canvasRef = React84.useRef(null);
25664
+ const rafRef = React84.useRef(0);
25665
+ const frameRef = React84.useRef(0);
25666
+ const lastTimeRef = React84.useRef(0);
25667
+ const onDrawRef = React84.useRef(onDraw);
25557
25668
  onDrawRef.current = onDraw;
25558
- const onTickRef = React81.useRef(onTick);
25669
+ const onTickRef = React84.useRef(onTick);
25559
25670
  onTickRef.current = onTick;
25560
- React81.useEffect(() => {
25671
+ React84.useEffect(() => {
25561
25672
  const canvas = canvasRef.current;
25562
25673
  if (!canvas) return;
25563
25674
  const ctx = canvas.getContext("2d");
@@ -25846,7 +25957,7 @@ function TurnPanel({
25846
25957
  className
25847
25958
  }) {
25848
25959
  const eventBus = useEventBus();
25849
- const handleAction = React81.useCallback(
25960
+ const handleAction = React84.useCallback(
25850
25961
  (event) => {
25851
25962
  if (event) {
25852
25963
  eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
@@ -25992,7 +26103,7 @@ function UnitCommandBar({
25992
26103
  className
25993
26104
  }) {
25994
26105
  const eventBus = useEventBus();
25995
- const handleCommand = React81.useCallback(
26106
+ const handleCommand = React84.useCallback(
25996
26107
  (event) => {
25997
26108
  if (event) {
25998
26109
  eventBus.emit(event, { unitId: selectedUnitId });
@@ -26477,7 +26588,7 @@ function GameMenu({
26477
26588
  } catch {
26478
26589
  }
26479
26590
  const eventBus = eventBusProp || eventBusFromHook;
26480
- const handleOptionClick = React81.useCallback(
26591
+ const handleOptionClick = React84.useCallback(
26481
26592
  (option) => {
26482
26593
  if (option.event && eventBus) {
26483
26594
  eventBus.emit(`UI:${option.event}`, { option });
@@ -26591,7 +26702,7 @@ function GameOverScreen({
26591
26702
  } catch {
26592
26703
  }
26593
26704
  const eventBus = eventBusProp || eventBusFromHook;
26594
- const handleActionClick = React81.useCallback(
26705
+ const handleActionClick = React84.useCallback(
26595
26706
  (action) => {
26596
26707
  if (action.event && eventBus) {
26597
26708
  eventBus.emit(`UI:${action.event}`, { action });
@@ -29238,7 +29349,16 @@ var init_StepFlow = __esm({
29238
29349
  "flex items-center justify-center",
29239
29350
  "bg-primary text-primary-foreground"
29240
29351
  ),
29241
- children: /* @__PURE__ */ jsx("span", { className: "font-semibold text-sm text-primary-foreground leading-none", children: step.number ?? index + 1 })
29352
+ children: /* @__PURE__ */ jsx(
29353
+ Typography,
29354
+ {
29355
+ as: "span",
29356
+ variant: "small",
29357
+ weight: "semibold",
29358
+ className: "text-primary-foreground leading-none",
29359
+ children: step.number ?? index + 1
29360
+ }
29361
+ )
29242
29362
  }
29243
29363
  );
29244
29364
  };
@@ -29250,7 +29370,7 @@ var init_StepFlow = __esm({
29250
29370
  className
29251
29371
  }) => {
29252
29372
  if (orientation === "vertical") {
29253
- return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React81__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
29373
+ return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React84__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
29254
29374
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
29255
29375
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
29256
29376
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -29261,7 +29381,7 @@ var init_StepFlow = __esm({
29261
29381
  ] })
29262
29382
  ] }) }, index)) });
29263
29383
  }
29264
- 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(React81__default.Fragment, { children: [
29384
+ 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(React84__default.Fragment, { children: [
29265
29385
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
29266
29386
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
29267
29387
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -29329,9 +29449,9 @@ var init_SplitSection = __esm({
29329
29449
  className
29330
29450
  ),
29331
29451
  padding: "lg",
29332
- 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: [
29333
- /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0 lg:min-w-[45%]", children: textContent }),
29334
- /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0 lg:max-w-[50%]", children: mediaContent })
29452
+ 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: [
29453
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0 md:min-w-[45%]", children: textContent }),
29454
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0 md:max-w-[50%]", children: mediaContent })
29335
29455
  ] })
29336
29456
  }
29337
29457
  );
@@ -30143,7 +30263,7 @@ var init_LikertScale = __esm({
30143
30263
  md: "text-base",
30144
30264
  lg: "text-lg"
30145
30265
  };
30146
- LikertScale = React81__default.forwardRef(
30266
+ LikertScale = React84__default.forwardRef(
30147
30267
  ({
30148
30268
  question,
30149
30269
  options = DEFAULT_LIKERT_OPTIONS,
@@ -30155,7 +30275,7 @@ var init_LikertScale = __esm({
30155
30275
  variant = "radios",
30156
30276
  className
30157
30277
  }, ref) => {
30158
- const groupId = React81__default.useId();
30278
+ const groupId = React84__default.useId();
30159
30279
  const eventBus = useEventBus();
30160
30280
  const handleSelect = useCallback(
30161
30281
  (next) => {
@@ -30963,64 +31083,68 @@ var init_PositionedCanvas = __esm({
30963
31083
  },
30964
31084
  [onSelect, selectEvent, eventBus]
30965
31085
  );
30966
- return /* @__PURE__ */ jsx(
30967
- Box,
30968
- {
30969
- ref: containerRef,
30970
- "data-testid": "positioned-canvas",
30971
- className: cn(
30972
- "relative bg-background border border-border rounded-md overflow-hidden",
30973
- className
30974
- ),
30975
- style: { width, height },
30976
- onClick: handleContainerClick,
30977
- children: items.map((item) => {
30978
- const status = item.status ?? "empty";
30979
- const shape = item.shape ?? "round";
30980
- const isSelected = selectedId === item.id;
30981
- const isDragging = draggingId === item.id;
30982
- const statusBadge = STATUS_BADGE[status];
30983
- return /* @__PURE__ */ jsxs(
30984
- Box,
30985
- {
30986
- "data-testid": `item-node-${item.id}`,
30987
- "data-status": status,
30988
- className: cn(
30989
- "absolute flex flex-col items-center justify-center gap-1 border-2 select-none",
30990
- "transition-shadow",
30991
- STATUS_CLASSES[status],
30992
- getShapeClasses(shape),
30993
- editable ? "cursor-move" : "cursor-pointer",
30994
- isSelected && "outline outline-2 outline-offset-2 outline-primary shadow-md",
30995
- isDragging && "shadow-lg z-10"
30996
- ),
30997
- style: { left: item.x, top: item.y, touchAction: "none" },
30998
- onPointerDown: (e) => handlePointerDown(e, item),
30999
- onPointerMove: handlePointerMove,
31000
- onPointerUp: (e) => handlePointerUp(e, item),
31001
- onPointerCancel: (e) => handlePointerUp(e, item),
31002
- children: [
31003
- /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", children: [
31004
- getStatusIcon(status),
31005
- /* @__PURE__ */ jsx(Typography, { variant: "body2", weight: "semibold", children: item.label })
31006
- ] }),
31007
- /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: item.partySize !== void 0 && status === "seated" ? `${item.partySize}/${item.capacity}` : `Cap ${item.capacity}` }),
31008
- status === "seated" && item.serverName && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "truncate max-w-[80%]", children: item.serverName }),
31009
- isSelected && /* @__PURE__ */ jsx(
31010
- Badge,
31011
- {
31012
- variant: statusBadge.variant,
31013
- size: "sm",
31014
- className: "absolute -top-2 -right-2",
31015
- children: statusBadge.label
31016
- }
31017
- )
31018
- ]
31019
- },
31020
- item.id
31021
- );
31022
- })
31023
- }
31086
+ return (
31087
+ // Outer scroll viewport: caps the visual footprint to the parent's
31088
+ // available width on small screens. The inner plane keeps its fixed
31089
+ // {width × height} coordinate system (items are positioned by
31090
+ // absolute item.x/item.y), so a phone-sized viewport pans inside
31091
+ // the larger logical canvas rather than busting the layout.
31092
+ /* @__PURE__ */ jsx(Box, { className: cn("max-w-full overflow-auto rounded-md", className), children: /* @__PURE__ */ jsx(
31093
+ Box,
31094
+ {
31095
+ ref: containerRef,
31096
+ "data-testid": "positioned-canvas",
31097
+ className: "relative bg-background border border-border rounded-md overflow-hidden",
31098
+ style: { width, height },
31099
+ onClick: handleContainerClick,
31100
+ children: items.map((item) => {
31101
+ const status = item.status ?? "empty";
31102
+ const shape = item.shape ?? "round";
31103
+ const isSelected = selectedId === item.id;
31104
+ const isDragging = draggingId === item.id;
31105
+ const statusBadge = STATUS_BADGE[status];
31106
+ return /* @__PURE__ */ jsxs(
31107
+ Box,
31108
+ {
31109
+ "data-testid": `item-node-${item.id}`,
31110
+ "data-status": status,
31111
+ className: cn(
31112
+ "absolute flex flex-col items-center justify-center gap-1 border-2 select-none",
31113
+ "transition-shadow",
31114
+ STATUS_CLASSES[status],
31115
+ getShapeClasses(shape),
31116
+ editable ? "cursor-move" : "cursor-pointer",
31117
+ isSelected && "outline outline-2 outline-offset-2 outline-primary shadow-md",
31118
+ isDragging && "shadow-lg z-10"
31119
+ ),
31120
+ style: { left: item.x, top: item.y, touchAction: "none" },
31121
+ onPointerDown: (e) => handlePointerDown(e, item),
31122
+ onPointerMove: handlePointerMove,
31123
+ onPointerUp: (e) => handlePointerUp(e, item),
31124
+ onPointerCancel: (e) => handlePointerUp(e, item),
31125
+ children: [
31126
+ /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", children: [
31127
+ getStatusIcon(status),
31128
+ /* @__PURE__ */ jsx(Typography, { variant: "body2", weight: "semibold", children: item.label })
31129
+ ] }),
31130
+ /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: item.partySize !== void 0 && status === "seated" ? `${item.partySize}/${item.capacity}` : `Cap ${item.capacity}` }),
31131
+ status === "seated" && item.serverName && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "truncate max-w-[80%]", children: item.serverName }),
31132
+ isSelected && /* @__PURE__ */ jsx(
31133
+ Badge,
31134
+ {
31135
+ variant: statusBadge.variant,
31136
+ size: "sm",
31137
+ className: "absolute -top-2 -right-2",
31138
+ children: statusBadge.label
31139
+ }
31140
+ )
31141
+ ]
31142
+ },
31143
+ item.id
31144
+ );
31145
+ })
31146
+ }
31147
+ ) })
31024
31148
  );
31025
31149
  };
31026
31150
  PositionedCanvas.displayName = "PositionedCanvas";
@@ -32159,7 +32283,7 @@ var init_VersionDiff = __esm({
32159
32283
  /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", className: "flex-wrap", children: [
32160
32284
  /* @__PURE__ */ jsx(Icon, { icon: GitCommit, size: "sm", className: "text-muted-foreground" }),
32161
32285
  /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "whitespace-nowrap", children: "Compare" }),
32162
- /* @__PURE__ */ jsx(Box, { className: "min-w-[160px]", children: /* @__PURE__ */ jsx(
32286
+ /* @__PURE__ */ jsx(Box, { className: "min-w-0 md:min-w-[160px]", children: /* @__PURE__ */ jsx(
32163
32287
  Select,
32164
32288
  {
32165
32289
  options,
@@ -32169,7 +32293,7 @@ var init_VersionDiff = __esm({
32169
32293
  }
32170
32294
  ) }),
32171
32295
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: "to" }),
32172
- /* @__PURE__ */ jsx(Box, { className: "min-w-[160px]", children: /* @__PURE__ */ jsx(
32296
+ /* @__PURE__ */ jsx(Box, { className: "min-w-0 md:min-w-[160px]", children: /* @__PURE__ */ jsx(
32173
32297
  Select,
32174
32298
  {
32175
32299
  options,
@@ -32234,8 +32358,8 @@ var init_VersionDiff = __esm({
32234
32358
  ]
32235
32359
  }
32236
32360
  ),
32237
- /* @__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: [
32238
- /* @__PURE__ */ jsx(Box, { className: "border-r border-border", children: /* @__PURE__ */ jsx(VStack, { gap: "none", className: "font-mono text-xs", children: beforeLines.map((line, idx) => {
32361
+ /* @__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: [
32362
+ /* @__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) => {
32239
32363
  const isRemoved = line.type === "removed";
32240
32364
  return /* @__PURE__ */ jsxs(
32241
32365
  HStack,
@@ -32381,7 +32505,7 @@ var init_DocBreadcrumb = __esm({
32381
32505
  "aria-label": "Breadcrumb",
32382
32506
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
32383
32507
  const isLast = idx === items.length - 1;
32384
- return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
32508
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
32385
32509
  idx > 0 && /* @__PURE__ */ jsx(
32386
32510
  Icon,
32387
32511
  {
@@ -33271,7 +33395,7 @@ var init_MiniStateMachine = __esm({
33271
33395
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
33272
33396
  const tc = transitionCounts[s.name] ?? 0;
33273
33397
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
33274
- return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
33398
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
33275
33399
  /* @__PURE__ */ jsx(
33276
33400
  AvlState,
33277
33401
  {
@@ -34648,7 +34772,7 @@ var init_DocumentViewer = __esm({
34648
34772
  }
34649
34773
  });
34650
34774
  function extractTitle(children) {
34651
- if (!React81__default.isValidElement(children)) return void 0;
34775
+ if (!React84__default.isValidElement(children)) return void 0;
34652
34776
  const props = children.props;
34653
34777
  if (typeof props.title === "string") {
34654
34778
  return props.title;
@@ -34703,7 +34827,7 @@ function LinearView({
34703
34827
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
34704
34828
  const isDone = i < currentIdx;
34705
34829
  const isCurrent = i === currentIdx;
34706
- return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
34830
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
34707
34831
  i > 0 && /* @__PURE__ */ jsx(
34708
34832
  Typography,
34709
34833
  {
@@ -35604,12 +35728,12 @@ var init_Form = __esm({
35604
35728
  const isSchemaEntity = isOrbitalEntitySchema(entity);
35605
35729
  const resolvedEntity = isSchemaEntity ? entity : void 0;
35606
35730
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
35607
- const normalizedInitialData = React81__default.useMemo(() => {
35731
+ const normalizedInitialData = React84__default.useMemo(() => {
35608
35732
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
35609
35733
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
35610
35734
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
35611
35735
  }, [entity, initialData]);
35612
- const entityDerivedFields = React81__default.useMemo(() => {
35736
+ const entityDerivedFields = React84__default.useMemo(() => {
35613
35737
  if (fields && fields.length > 0) return void 0;
35614
35738
  if (!resolvedEntity) return void 0;
35615
35739
  return resolvedEntity.fields.map(
@@ -35628,16 +35752,16 @@ var init_Form = __esm({
35628
35752
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
35629
35753
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
35630
35754
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
35631
- const [formData, setFormData] = React81__default.useState(
35755
+ const [formData, setFormData] = React84__default.useState(
35632
35756
  normalizedInitialData
35633
35757
  );
35634
- const [collapsedSections, setCollapsedSections] = React81__default.useState(
35758
+ const [collapsedSections, setCollapsedSections] = React84__default.useState(
35635
35759
  /* @__PURE__ */ new Set()
35636
35760
  );
35637
- const [submitError, setSubmitError] = React81__default.useState(null);
35638
- const formRef = React81__default.useRef(null);
35761
+ const [submitError, setSubmitError] = React84__default.useState(null);
35762
+ const formRef = React84__default.useRef(null);
35639
35763
  const formMode = props.mode;
35640
- const mountedRef = React81__default.useRef(false);
35764
+ const mountedRef = React84__default.useRef(false);
35641
35765
  if (!mountedRef.current) {
35642
35766
  mountedRef.current = true;
35643
35767
  debug("forms", "mount", {
@@ -35650,7 +35774,7 @@ var init_Form = __esm({
35650
35774
  });
35651
35775
  }
35652
35776
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
35653
- const evalContext = React81__default.useMemo(
35777
+ const evalContext = React84__default.useMemo(
35654
35778
  () => ({
35655
35779
  formValues: formData,
35656
35780
  globalVariables: externalContext?.globalVariables ?? {},
@@ -35659,7 +35783,7 @@ var init_Form = __esm({
35659
35783
  }),
35660
35784
  [formData, externalContext]
35661
35785
  );
35662
- React81__default.useEffect(() => {
35786
+ React84__default.useEffect(() => {
35663
35787
  debug("forms", "initialData-sync", {
35664
35788
  mode: formMode,
35665
35789
  normalizedInitialData,
@@ -35670,7 +35794,7 @@ var init_Form = __esm({
35670
35794
  setFormData(normalizedInitialData);
35671
35795
  }
35672
35796
  }, [normalizedInitialData]);
35673
- const processCalculations = React81__default.useCallback(
35797
+ const processCalculations = React84__default.useCallback(
35674
35798
  (changedFieldId, newFormData) => {
35675
35799
  if (!hiddenCalculations.length) return;
35676
35800
  const context = {
@@ -35695,7 +35819,7 @@ var init_Form = __esm({
35695
35819
  },
35696
35820
  [hiddenCalculations, externalContext, eventBus]
35697
35821
  );
35698
- const checkViolations = React81__default.useCallback(
35822
+ const checkViolations = React84__default.useCallback(
35699
35823
  (changedFieldId, newFormData) => {
35700
35824
  if (!violationTriggers.length) return;
35701
35825
  const context = {
@@ -35733,7 +35857,7 @@ var init_Form = __esm({
35733
35857
  processCalculations(name, newFormData);
35734
35858
  checkViolations(name, newFormData);
35735
35859
  };
35736
- const isFieldVisible = React81__default.useCallback(
35860
+ const isFieldVisible = React84__default.useCallback(
35737
35861
  (fieldName) => {
35738
35862
  const condition = conditionalFields[fieldName];
35739
35863
  if (!condition) return true;
@@ -35741,7 +35865,7 @@ var init_Form = __esm({
35741
35865
  },
35742
35866
  [conditionalFields, evalContext]
35743
35867
  );
35744
- const isSectionVisible = React81__default.useCallback(
35868
+ const isSectionVisible = React84__default.useCallback(
35745
35869
  (section) => {
35746
35870
  if (!section.condition) return true;
35747
35871
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -35817,7 +35941,7 @@ var init_Form = __esm({
35817
35941
  eventBus.emit(`UI:${onCancel}`);
35818
35942
  }
35819
35943
  };
35820
- const renderField = React81__default.useCallback(
35944
+ const renderField = React84__default.useCallback(
35821
35945
  (field) => {
35822
35946
  const fieldName = field.name || field.field;
35823
35947
  if (!fieldName) return null;
@@ -35838,7 +35962,7 @@ var init_Form = __esm({
35838
35962
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
35839
35963
  );
35840
35964
  const effectiveFields = entityDerivedFields ?? fields;
35841
- const normalizedFields = React81__default.useMemo(() => {
35965
+ const normalizedFields = React84__default.useMemo(() => {
35842
35966
  if (!effectiveFields || effectiveFields.length === 0) return [];
35843
35967
  return effectiveFields.map((field) => {
35844
35968
  if (typeof field === "string") {
@@ -35860,7 +35984,7 @@ var init_Form = __esm({
35860
35984
  return field;
35861
35985
  });
35862
35986
  }, [effectiveFields, resolvedEntity]);
35863
- const schemaFields = React81__default.useMemo(() => {
35987
+ const schemaFields = React84__default.useMemo(() => {
35864
35988
  if (normalizedFields.length === 0) return null;
35865
35989
  if (isDebugEnabled()) {
35866
35990
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -35870,7 +35994,7 @@ var init_Form = __esm({
35870
35994
  }
35871
35995
  return normalizedFields.map(renderField).filter(Boolean);
35872
35996
  }, [normalizedFields, renderField, entityName, conditionalFields]);
35873
- const sectionElements = React81__default.useMemo(() => {
35997
+ const sectionElements = React84__default.useMemo(() => {
35874
35998
  if (!sections || sections.length === 0) return null;
35875
35999
  return sections.map((section) => {
35876
36000
  if (!isSectionVisible(section)) {
@@ -37596,7 +37720,7 @@ var init_List = __esm({
37596
37720
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
37597
37721
  return [];
37598
37722
  }, [entity]);
37599
- const getItemActions = React81__default.useCallback(
37723
+ const getItemActions = React84__default.useCallback(
37600
37724
  (item) => {
37601
37725
  if (!itemActions) return [];
37602
37726
  if (typeof itemActions === "function") {
@@ -38069,7 +38193,7 @@ var init_MediaGallery = __esm({
38069
38193
  [selectable, selectedItems, selectionEvent, eventBus]
38070
38194
  );
38071
38195
  const entityData = Array.isArray(entity) ? entity : [];
38072
- const items = React81__default.useMemo(() => {
38196
+ const items = React84__default.useMemo(() => {
38073
38197
  if (propItems) return propItems;
38074
38198
  if (entityData.length === 0) return [];
38075
38199
  return entityData.map((record, idx) => ({
@@ -38233,7 +38357,7 @@ var init_MediaGallery = __esm({
38233
38357
  }
38234
38358
  });
38235
38359
  function extractTitle2(children) {
38236
- if (!React81__default.isValidElement(children)) return void 0;
38360
+ if (!React84__default.isValidElement(children)) return void 0;
38237
38361
  const props = children.props;
38238
38362
  if (typeof props.title === "string") {
38239
38363
  return props.title;
@@ -38946,7 +39070,7 @@ var init_PageHeader = __esm({
38946
39070
  info: "bg-info/10 text-info"
38947
39071
  };
38948
39072
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
38949
- 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(React81__default.Fragment, { children: [
39073
+ 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(React84__default.Fragment, { children: [
38950
39074
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
38951
39075
  crumb.href ? /* @__PURE__ */ jsx(
38952
39076
  "a",
@@ -39242,7 +39366,7 @@ var init_debugRegistry = __esm({
39242
39366
  }
39243
39367
  });
39244
39368
  function useDebugData() {
39245
- const [data, setData] = React81.useState(() => ({
39369
+ const [data, setData] = React84.useState(() => ({
39246
39370
  traits: [],
39247
39371
  ticks: [],
39248
39372
  guards: [],
@@ -39256,7 +39380,7 @@ function useDebugData() {
39256
39380
  },
39257
39381
  lastUpdate: Date.now()
39258
39382
  }));
39259
- React81.useEffect(() => {
39383
+ React84.useEffect(() => {
39260
39384
  const updateData = () => {
39261
39385
  setData({
39262
39386
  traits: getAllTraits(),
@@ -39365,12 +39489,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
39365
39489
  return positions;
39366
39490
  }
39367
39491
  function WalkMinimap() {
39368
- const [walkStep, setWalkStep] = React81.useState(null);
39369
- const [traits2, setTraits] = React81.useState([]);
39370
- const [coveredEdges, setCoveredEdges] = React81.useState([]);
39371
- const [completedTraits, setCompletedTraits] = React81.useState(/* @__PURE__ */ new Set());
39372
- const prevTraitRef = React81.useRef(null);
39373
- React81.useEffect(() => {
39492
+ const [walkStep, setWalkStep] = React84.useState(null);
39493
+ const [traits2, setTraits] = React84.useState([]);
39494
+ const [coveredEdges, setCoveredEdges] = React84.useState([]);
39495
+ const [completedTraits, setCompletedTraits] = React84.useState(/* @__PURE__ */ new Set());
39496
+ const prevTraitRef = React84.useRef(null);
39497
+ React84.useEffect(() => {
39374
39498
  const interval = setInterval(() => {
39375
39499
  const w = window;
39376
39500
  const step = w.__orbitalWalkStep;
@@ -39817,15 +39941,15 @@ var init_EntitiesTab = __esm({
39817
39941
  }
39818
39942
  });
39819
39943
  function EventFlowTab({ events: events2 }) {
39820
- const [filter, setFilter] = React81.useState("all");
39821
- const containerRef = React81.useRef(null);
39822
- const [autoScroll, setAutoScroll] = React81.useState(true);
39823
- React81.useEffect(() => {
39944
+ const [filter, setFilter] = React84.useState("all");
39945
+ const containerRef = React84.useRef(null);
39946
+ const [autoScroll, setAutoScroll] = React84.useState(true);
39947
+ React84.useEffect(() => {
39824
39948
  if (autoScroll && containerRef.current) {
39825
39949
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
39826
39950
  }
39827
39951
  }, [events2.length, autoScroll]);
39828
- const filteredEvents = React81.useMemo(() => {
39952
+ const filteredEvents = React84.useMemo(() => {
39829
39953
  if (filter === "all") return events2;
39830
39954
  return events2.filter((e) => e.type === filter);
39831
39955
  }, [events2, filter]);
@@ -39944,7 +40068,7 @@ var init_EventFlowTab = __esm({
39944
40068
  }
39945
40069
  });
39946
40070
  function GuardsPanel({ guards }) {
39947
- const [filter, setFilter] = React81.useState("all");
40071
+ const [filter, setFilter] = React84.useState("all");
39948
40072
  if (guards.length === 0) {
39949
40073
  return /* @__PURE__ */ jsx(
39950
40074
  EmptyState,
@@ -39957,7 +40081,7 @@ function GuardsPanel({ guards }) {
39957
40081
  }
39958
40082
  const passedCount = guards.filter((g) => g.result).length;
39959
40083
  const failedCount = guards.length - passedCount;
39960
- const filteredGuards = React81.useMemo(() => {
40084
+ const filteredGuards = React84.useMemo(() => {
39961
40085
  if (filter === "all") return guards;
39962
40086
  if (filter === "passed") return guards.filter((g) => g.result);
39963
40087
  return guards.filter((g) => !g.result);
@@ -40118,10 +40242,10 @@ function EffectBadge({ effect }) {
40118
40242
  ] });
40119
40243
  }
40120
40244
  function TransitionTimeline({ transitions }) {
40121
- const containerRef = React81.useRef(null);
40122
- const [autoScroll, setAutoScroll] = React81.useState(true);
40123
- const [expandedId, setExpandedId] = React81.useState(null);
40124
- React81.useEffect(() => {
40245
+ const containerRef = React84.useRef(null);
40246
+ const [autoScroll, setAutoScroll] = React84.useState(true);
40247
+ const [expandedId, setExpandedId] = React84.useState(null);
40248
+ React84.useEffect(() => {
40125
40249
  if (autoScroll && containerRef.current) {
40126
40250
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
40127
40251
  }
@@ -40407,9 +40531,9 @@ function getAllEvents(traits2) {
40407
40531
  }
40408
40532
  function EventDispatcherTab({ traits: traits2, schema }) {
40409
40533
  const eventBus = useEventBus();
40410
- const [log12, setLog] = React81.useState([]);
40411
- const prevStatesRef = React81.useRef(/* @__PURE__ */ new Map());
40412
- React81.useEffect(() => {
40534
+ const [log12, setLog] = React84.useState([]);
40535
+ const prevStatesRef = React84.useRef(/* @__PURE__ */ new Map());
40536
+ React84.useEffect(() => {
40413
40537
  for (const trait of traits2) {
40414
40538
  const prev = prevStatesRef.current.get(trait.id);
40415
40539
  if (prev && prev !== trait.currentState) {
@@ -40579,10 +40703,10 @@ function VerifyModePanel({
40579
40703
  serverCount,
40580
40704
  localCount
40581
40705
  }) {
40582
- const [expanded, setExpanded] = React81.useState(true);
40583
- const scrollRef = React81.useRef(null);
40584
- const prevCountRef = React81.useRef(0);
40585
- React81.useEffect(() => {
40706
+ const [expanded, setExpanded] = React84.useState(true);
40707
+ const scrollRef = React84.useRef(null);
40708
+ const prevCountRef = React84.useRef(0);
40709
+ React84.useEffect(() => {
40586
40710
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
40587
40711
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
40588
40712
  }
@@ -40648,10 +40772,10 @@ function RuntimeDebugger({
40648
40772
  defaultTab,
40649
40773
  schema
40650
40774
  }) {
40651
- const [isCollapsed, setIsCollapsed] = React81.useState(mode === "verify" ? true : defaultCollapsed);
40652
- const [isVisible, setIsVisible] = React81.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
40775
+ const [isCollapsed, setIsCollapsed] = React84.useState(mode === "verify" ? true : defaultCollapsed);
40776
+ const [isVisible, setIsVisible] = React84.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
40653
40777
  const debugData = useDebugData();
40654
- React81.useEffect(() => {
40778
+ React84.useEffect(() => {
40655
40779
  if (mode === "inline") return;
40656
40780
  return onDebugToggle((enabled) => {
40657
40781
  setIsVisible(enabled);
@@ -40660,7 +40784,7 @@ function RuntimeDebugger({
40660
40784
  }
40661
40785
  });
40662
40786
  }, [mode]);
40663
- React81.useEffect(() => {
40787
+ React84.useEffect(() => {
40664
40788
  if (mode === "inline") return;
40665
40789
  const handleKeyDown = (e) => {
40666
40790
  if (e.key === "`" && isVisible) {
@@ -41209,7 +41333,7 @@ function SequenceBar({
41209
41333
  onSlotRemove(index);
41210
41334
  }, [onSlotRemove, playing]);
41211
41335
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
41212
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
41336
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
41213
41337
  i > 0 && /* @__PURE__ */ jsx(
41214
41338
  Typography,
41215
41339
  {
@@ -42611,7 +42735,7 @@ var init_StatCard = __esm({
42611
42735
  const labelToUse = propLabel ?? propTitle;
42612
42736
  const eventBus = useEventBus();
42613
42737
  const { t } = useTranslate();
42614
- const handleActionClick = React81__default.useCallback(() => {
42738
+ const handleActionClick = React84__default.useCallback(() => {
42615
42739
  if (action?.event) {
42616
42740
  eventBus.emit(`UI:${action.event}`, {});
42617
42741
  }
@@ -42622,7 +42746,7 @@ var init_StatCard = __esm({
42622
42746
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
42623
42747
  const isLoading = externalLoading ?? false;
42624
42748
  const error = externalError;
42625
- const computeMetricValue = React81__default.useCallback(
42749
+ const computeMetricValue = React84__default.useCallback(
42626
42750
  (metric, items) => {
42627
42751
  if (metric.value !== void 0) {
42628
42752
  return metric.value;
@@ -42661,7 +42785,7 @@ var init_StatCard = __esm({
42661
42785
  },
42662
42786
  []
42663
42787
  );
42664
- const schemaStats = React81__default.useMemo(() => {
42788
+ const schemaStats = React84__default.useMemo(() => {
42665
42789
  if (!metrics || metrics.length === 0) return null;
42666
42790
  return metrics.map((metric) => ({
42667
42791
  label: metric.label,
@@ -42669,7 +42793,7 @@ var init_StatCard = __esm({
42669
42793
  format: metric.format
42670
42794
  }));
42671
42795
  }, [metrics, data, computeMetricValue]);
42672
- const calculatedTrend = React81__default.useMemo(() => {
42796
+ const calculatedTrend = React84__default.useMemo(() => {
42673
42797
  if (manualTrend !== void 0) return manualTrend;
42674
42798
  if (previousValue === void 0 || currentValue === void 0)
42675
42799
  return void 0;
@@ -43780,7 +43904,7 @@ var init_Timeline = __esm({
43780
43904
  }) => {
43781
43905
  const { t } = useTranslate();
43782
43906
  const entityData = Array.isArray(entity) ? entity : [];
43783
- const items = React81__default.useMemo(() => {
43907
+ const items = React84__default.useMemo(() => {
43784
43908
  if (propItems) return propItems;
43785
43909
  if (entityData.length === 0) return [];
43786
43910
  return entityData.map((record, idx) => {
@@ -43887,7 +44011,7 @@ var init_Timeline = __esm({
43887
44011
  }
43888
44012
  });
43889
44013
  function extractToastProps(children) {
43890
- if (!React81__default.isValidElement(children)) {
44014
+ if (!React84__default.isValidElement(children)) {
43891
44015
  if (typeof children === "string") {
43892
44016
  return { message: children };
43893
44017
  }
@@ -43925,7 +44049,7 @@ var init_ToastSlot = __esm({
43925
44049
  eventBus.emit("UI:CLOSE");
43926
44050
  };
43927
44051
  if (!isVisible) return null;
43928
- const isCustomContent = React81__default.isValidElement(children) && !message;
44052
+ const isCustomContent = React84__default.isValidElement(children) && !message;
43929
44053
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
43930
44054
  Toast,
43931
44055
  {
@@ -44194,7 +44318,7 @@ var init_WizardContainer = __esm({
44194
44318
  const isCompleted = index < currentStep;
44195
44319
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
44196
44320
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
44197
- return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
44321
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
44198
44322
  /* @__PURE__ */ jsx(
44199
44323
  Button,
44200
44324
  {
@@ -44576,12 +44700,12 @@ var init_WorldMapTemplate = __esm({
44576
44700
  }
44577
44701
  });
44578
44702
  function lazyThree(name, loader) {
44579
- const Lazy = React81__default.lazy(() => loader().then((m) => ({ default: m[name] })));
44703
+ const Lazy = React84__default.lazy(() => loader().then((m) => ({ default: m[name] })));
44580
44704
  function ThreeWrapper(props) {
44581
- return React81__default.createElement(
44582
- React81__default.Suspense,
44705
+ return React84__default.createElement(
44706
+ React84__default.Suspense,
44583
44707
  { fallback: null },
44584
- React81__default.createElement(Lazy, props)
44708
+ React84__default.createElement(Lazy, props)
44585
44709
  );
44586
44710
  }
44587
44711
  ThreeWrapper.displayName = `Lazy(${name})`;
@@ -44600,6 +44724,7 @@ var init_component_registry_generated = __esm({
44600
44724
  init_AnimatedGraphic();
44601
44725
  init_AnimatedReveal();
44602
44726
  init_ArticleSection();
44727
+ init_Aside();
44603
44728
  init_AuthLayout();
44604
44729
  init_BattleBoard();
44605
44730
  init_BattleTemplate();
@@ -44654,6 +44779,7 @@ var init_component_registry_generated = __esm({
44654
44779
  init_DayCell();
44655
44780
  init_DebuggerBoard();
44656
44781
  init_DetailPanel();
44782
+ init_Dialog();
44657
44783
  init_DialogueBox();
44658
44784
  init_DialogueBubble();
44659
44785
  init_DocBreadcrumb();
@@ -44867,6 +44993,7 @@ var init_component_registry_generated = __esm({
44867
44993
  "AnimatedGraphic": AnimatedGraphic,
44868
44994
  "AnimatedReveal": AnimatedReveal,
44869
44995
  "ArticleSection": ArticleSection,
44996
+ "Aside": Aside,
44870
44997
  "AuthLayout": AuthLayout,
44871
44998
  "Avatar": AvatarPattern,
44872
44999
  "AvatarPattern": AvatarPattern,
@@ -44936,6 +45063,7 @@ var init_component_registry_generated = __esm({
44936
45063
  "DayCell": DayCell,
44937
45064
  "DebuggerBoard": DebuggerBoard,
44938
45065
  "DetailPanel": DetailPanel,
45066
+ "Dialog": Dialog,
44939
45067
  "DialogueBox": DialogueBox,
44940
45068
  "DialogueBubble": DialogueBubble,
44941
45069
  "Divider": DividerPattern,
@@ -45189,7 +45317,7 @@ function SuspenseConfigProvider({
45189
45317
  config,
45190
45318
  children
45191
45319
  }) {
45192
- return React81__default.createElement(
45320
+ return React84__default.createElement(
45193
45321
  SuspenseConfigContext.Provider,
45194
45322
  { value: config },
45195
45323
  children
@@ -45672,7 +45800,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
45672
45800
  const key = `${parentId}-${index}-trait:${traitName}`;
45673
45801
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
45674
45802
  }
45675
- return /* @__PURE__ */ jsx(React81__default.Fragment, { children: child }, `${parentId}-${index}`);
45803
+ return /* @__PURE__ */ jsx(React84__default.Fragment, { children: child }, `${parentId}-${index}`);
45676
45804
  }
45677
45805
  if (!child || typeof child !== "object") return null;
45678
45806
  const childId = `${parentId}-${index}`;
@@ -45709,14 +45837,14 @@ function isPatternConfig(value) {
45709
45837
  if (value === null || value === void 0) return false;
45710
45838
  if (typeof value !== "object") return false;
45711
45839
  if (Array.isArray(value)) return false;
45712
- if (React81__default.isValidElement(value)) return false;
45840
+ if (React84__default.isValidElement(value)) return false;
45713
45841
  if (value instanceof Date) return false;
45714
45842
  if (typeof value === "function") return false;
45715
45843
  const record = value;
45716
45844
  return "type" in record && typeof record.type === "string";
45717
45845
  }
45718
45846
  function isPlainConfigObject(value) {
45719
- if (React81__default.isValidElement(value)) return false;
45847
+ if (React84__default.isValidElement(value)) return false;
45720
45848
  if (value instanceof Date) return false;
45721
45849
  const proto = Object.getPrototypeOf(value);
45722
45850
  return proto === Object.prototype || proto === null;