@almadar/ui 4.51.15 → 4.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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);
@@ -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,16 +21909,15 @@ 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}`;
21809
21916
  }),
21810
- // eslint-disable-next-line react-hooks/exhaustive-deps
21811
21917
  [itemIdsSignature]
21812
21918
  );
21813
21919
  const itemsContentSig = items.map((it, idx) => String(it[dndItemIdField] ?? `__${idx}`)).join("|");
21814
- React81__default.useEffect(() => {
21920
+ React84__default.useEffect(() => {
21815
21921
  const root = isRoot ? null : parentRoot;
21816
21922
  if (root) {
21817
21923
  root.clearOptimisticOrder(ownGroup);
@@ -21819,20 +21925,20 @@ function useDataDnd(args) {
21819
21925
  clearOptimisticOrder(ownGroup);
21820
21926
  }
21821
21927
  }, [itemsContentSig, ownGroup]);
21822
- const zonesRef = React81__default.useRef(/* @__PURE__ */ new Map());
21823
- const registerZone = React81__default.useCallback((zoneId2, meta2) => {
21928
+ const zonesRef = React84__default.useRef(/* @__PURE__ */ new Map());
21929
+ const registerZone = React84__default.useCallback((zoneId2, meta2) => {
21824
21930
  zonesRef.current.set(zoneId2, meta2);
21825
21931
  }, []);
21826
- const unregisterZone = React81__default.useCallback((zoneId2) => {
21932
+ const unregisterZone = React84__default.useCallback((zoneId2) => {
21827
21933
  zonesRef.current.delete(zoneId2);
21828
21934
  }, []);
21829
- const [activeDrag, setActiveDrag] = React81__default.useState(null);
21830
- const [overZoneGroup, setOverZoneGroup] = React81__default.useState(null);
21831
- 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(
21832
21938
  () => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
21833
21939
  [ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
21834
21940
  );
21835
- React81__default.useEffect(() => {
21941
+ React84__default.useEffect(() => {
21836
21942
  const target = isRoot ? null : parentRoot;
21837
21943
  if (!target) {
21838
21944
  zonesRef.current.set(zoneId, meta);
@@ -21851,7 +21957,7 @@ function useDataDnd(args) {
21851
21957
  }, [parentRoot, isRoot, zoneId, meta]);
21852
21958
  const sensors = useAlmadarDndSensors(true);
21853
21959
  const collisionDetection = almadarDndCollisionDetection;
21854
- const findZoneByItem = React81__default.useCallback(
21960
+ const findZoneByItem = React84__default.useCallback(
21855
21961
  (id) => {
21856
21962
  for (const z of zonesRef.current.values()) {
21857
21963
  if (z.itemIds.includes(id)) return z;
@@ -21860,7 +21966,7 @@ function useDataDnd(args) {
21860
21966
  },
21861
21967
  []
21862
21968
  );
21863
- React81__default.useCallback(
21969
+ React84__default.useCallback(
21864
21970
  (group) => {
21865
21971
  for (const z of zonesRef.current.values()) {
21866
21972
  if (z.group === group) return z;
@@ -21869,7 +21975,7 @@ function useDataDnd(args) {
21869
21975
  },
21870
21976
  []
21871
21977
  );
21872
- const handleDragEnd = React81__default.useCallback(
21978
+ const handleDragEnd = React84__default.useCallback(
21873
21979
  (event) => {
21874
21980
  const { active, over } = event;
21875
21981
  const activeIdStr = String(active.id);
@@ -21960,8 +22066,8 @@ function useDataDnd(args) {
21960
22066
  },
21961
22067
  [eventBus]
21962
22068
  );
21963
- const sortableData = React81__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
21964
- const SortableItem = React81__default.useCallback(
22069
+ const sortableData = React84__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
22070
+ const SortableItem = React84__default.useCallback(
21965
22071
  ({ id, children }) => {
21966
22072
  const {
21967
22073
  attributes,
@@ -22001,7 +22107,7 @@ function useDataDnd(args) {
22001
22107
  id: droppableId,
22002
22108
  data: sortableData
22003
22109
  });
22004
- const ctx = React81__default.useContext(RootCtx);
22110
+ const ctx = React84__default.useContext(RootCtx);
22005
22111
  const activeDrag2 = ctx?.activeDrag ?? null;
22006
22112
  const overZoneGroup2 = ctx?.overZoneGroup ?? null;
22007
22113
  const isThisZoneOver = overZoneGroup2 === ownGroup;
@@ -22016,7 +22122,7 @@ function useDataDnd(args) {
22016
22122
  showForeignPlaceholder,
22017
22123
  ctxAvailable: ctx != null
22018
22124
  });
22019
- React81__default.useEffect(() => {
22125
+ React84__default.useEffect(() => {
22020
22126
  dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
22021
22127
  }, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
22022
22128
  return /* @__PURE__ */ jsx(
@@ -22030,11 +22136,11 @@ function useDataDnd(args) {
22030
22136
  }
22031
22137
  );
22032
22138
  };
22033
- const rootContextValue = React81__default.useMemo(
22139
+ const rootContextValue = React84__default.useMemo(
22034
22140
  () => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
22035
22141
  [registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
22036
22142
  );
22037
- const handleDragStart = React81__default.useCallback((event) => {
22143
+ const handleDragStart = React84__default.useCallback((event) => {
22038
22144
  const sourceZone = findZoneByItem(event.active.id);
22039
22145
  const rect = event.active.rect.current.initial;
22040
22146
  const height = rect?.height && rect.height > 0 ? rect.height : 64;
@@ -22053,7 +22159,7 @@ function useDataDnd(args) {
22053
22159
  isRoot
22054
22160
  });
22055
22161
  }, [findZoneByItem, isRoot, zoneId]);
22056
- const handleDragOver = React81__default.useCallback((event) => {
22162
+ const handleDragOver = React84__default.useCallback((event) => {
22057
22163
  const { active, over } = event;
22058
22164
  const overData = over?.data?.current;
22059
22165
  const overGroup = overData?.dndGroup ?? null;
@@ -22123,7 +22229,7 @@ function useDataDnd(args) {
22123
22229
  return next;
22124
22230
  });
22125
22231
  }, []);
22126
- const handleDragCancel = React81__default.useCallback((event) => {
22232
+ const handleDragCancel = React84__default.useCallback((event) => {
22127
22233
  setActiveDrag(null);
22128
22234
  setOverZoneGroup(null);
22129
22235
  dndLog.warn("dragCancel", {
@@ -22131,12 +22237,12 @@ function useDataDnd(args) {
22131
22237
  reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
22132
22238
  });
22133
22239
  }, []);
22134
- const handleDragEndWithCleanup = React81__default.useCallback((event) => {
22240
+ const handleDragEndWithCleanup = React84__default.useCallback((event) => {
22135
22241
  handleDragEnd(event);
22136
22242
  setActiveDrag(null);
22137
22243
  setOverZoneGroup(null);
22138
22244
  }, [handleDragEnd]);
22139
- const wrapContainer = React81__default.useCallback(
22245
+ const wrapContainer = React84__default.useCallback(
22140
22246
  (children) => {
22141
22247
  if (!enabled) return children;
22142
22248
  const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
@@ -22190,7 +22296,7 @@ var init_useDataDnd = __esm({
22190
22296
  init_useAlmadarDndCollision();
22191
22297
  init_Box();
22192
22298
  dndLog = createLogger("almadar:ui:dnd");
22193
- RootCtx = React81__default.createContext(null);
22299
+ RootCtx = React84__default.createContext(null);
22194
22300
  }
22195
22301
  });
22196
22302
  function fieldLabel2(key) {
@@ -22679,7 +22785,7 @@ function DataList({
22679
22785
  }) {
22680
22786
  const eventBus = useEventBus();
22681
22787
  const { t } = useTranslate();
22682
- const [visibleCount, setVisibleCount] = React81__default.useState(pageSize || Infinity);
22788
+ const [visibleCount, setVisibleCount] = React84__default.useState(pageSize || Infinity);
22683
22789
  const fieldDefs = fields ?? columns ?? [];
22684
22790
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
22685
22791
  const dnd = useDataDnd({
@@ -22698,7 +22804,7 @@ function DataList({
22698
22804
  const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
22699
22805
  const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
22700
22806
  const hasRenderProp = typeof children === "function";
22701
- React81__default.useEffect(() => {
22807
+ React84__default.useEffect(() => {
22702
22808
  const renderItemTypeOf = typeof schemaRenderItem;
22703
22809
  const childrenTypeOf = typeof children;
22704
22810
  if (data.length > 0 && !hasRenderProp) {
@@ -22755,7 +22861,7 @@ function DataList({
22755
22861
  const items2 = data.map((item) => item);
22756
22862
  const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
22757
22863
  const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
22758
- 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: [
22759
22865
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
22760
22866
  group.items.map((itemData, index) => {
22761
22867
  const id = itemData.id || `${gi}-${index}`;
@@ -22943,7 +23049,7 @@ function DataList({
22943
23049
  className
22944
23050
  ),
22945
23051
  children: [
22946
- groups.map((group, gi) => /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
23052
+ groups.map((group, gi) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
22947
23053
  group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
22948
23054
  group.items.map(
22949
23055
  (itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
@@ -23401,7 +23507,16 @@ var init_FilterGroup = __esm({
23401
23507
  onClear: () => handleFilterSelect(`${filter.field}_to`, null)
23402
23508
  }
23403
23509
  )
23404
- ] }) : /* @__PURE__ */ jsx(
23510
+ ] }) : resolveFilterType(filter) === "text" ? /* @__PURE__ */ jsx(
23511
+ Input,
23512
+ {
23513
+ value: selectedValues[filter.field] || "",
23514
+ onChange: (e) => handleFilterSelect(filter.field, e.target.value || null),
23515
+ placeholder: filter.label,
23516
+ clearable: true,
23517
+ onClear: () => handleFilterSelect(filter.field, null)
23518
+ }
23519
+ ) : /* @__PURE__ */ jsx(
23405
23520
  Select,
23406
23521
  {
23407
23522
  value: selectedValues[filter.field] || "all",
@@ -23468,7 +23583,17 @@ var init_FilterGroup = __esm({
23468
23583
  className: "text-sm min-w-[100px]"
23469
23584
  }
23470
23585
  )
23471
- ] }) : /* @__PURE__ */ jsx(
23586
+ ] }) : resolveFilterType(filter) === "text" ? /* @__PURE__ */ jsx(
23587
+ Input,
23588
+ {
23589
+ value: selectedValues[filter.field] || "",
23590
+ onChange: (e) => handleFilterSelect(filter.field, e.target.value || null),
23591
+ placeholder: filter.label,
23592
+ clearable: true,
23593
+ onClear: () => handleFilterSelect(filter.field, null),
23594
+ className: "text-sm"
23595
+ }
23596
+ ) : /* @__PURE__ */ jsx(
23472
23597
  Select,
23473
23598
  {
23474
23599
  value: selectedValues[filter.field] || "all",
@@ -23573,7 +23698,17 @@ var init_FilterGroup = __esm({
23573
23698
  className: "min-w-[130px]"
23574
23699
  }
23575
23700
  )
23576
- ] }) : /* @__PURE__ */ jsx(
23701
+ ] }) : resolveFilterType(filter) === "text" ? /* @__PURE__ */ jsx(
23702
+ Input,
23703
+ {
23704
+ value: selectedValues[filter.field] || "",
23705
+ onChange: (e) => handleFilterSelect(filter.field, e.target.value || null),
23706
+ placeholder: filter.label,
23707
+ clearable: true,
23708
+ onClear: () => handleFilterSelect(filter.field, null),
23709
+ className: "min-w-[160px]"
23710
+ }
23711
+ ) : /* @__PURE__ */ jsx(
23577
23712
  Select,
23578
23713
  {
23579
23714
  value: selectedValues[filter.field] || "all",
@@ -24143,6 +24278,8 @@ var SidePanel;
24143
24278
  var init_SidePanel = __esm({
24144
24279
  "components/molecules/SidePanel.tsx"() {
24145
24280
  "use client";
24281
+ init_Aside();
24282
+ init_Box();
24146
24283
  init_Button();
24147
24284
  init_Typography();
24148
24285
  init_cn();
@@ -24152,7 +24289,7 @@ var init_SidePanel = __esm({
24152
24289
  children,
24153
24290
  isOpen,
24154
24291
  onClose,
24155
- width = "w-96",
24292
+ width = "w-full sm:w-96",
24156
24293
  position = "right",
24157
24294
  showOverlay = true,
24158
24295
  className,
@@ -24166,14 +24303,14 @@ var init_SidePanel = __esm({
24166
24303
  if (!isOpen) return null;
24167
24304
  return /* @__PURE__ */ jsxs(Fragment, { children: [
24168
24305
  showOverlay && /* @__PURE__ */ jsx(
24169
- "div",
24306
+ Box,
24170
24307
  {
24171
24308
  className: "fixed inset-0 bg-white/80 backdrop-blur-sm z-40 lg:hidden",
24172
24309
  onClick: handleClose
24173
24310
  }
24174
24311
  ),
24175
24312
  /* @__PURE__ */ jsxs(
24176
- "aside",
24313
+ Aside,
24177
24314
  {
24178
24315
  className: cn(
24179
24316
  "fixed top-16 lg:top-0 bottom-0 z-[60]",
@@ -24187,7 +24324,7 @@ var init_SidePanel = __esm({
24187
24324
  className
24188
24325
  ),
24189
24326
  children: [
24190
- /* @__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: [
24191
24328
  /* @__PURE__ */ jsx(Typography, { variant: "h6", children: title }),
24192
24329
  /* @__PURE__ */ jsx(
24193
24330
  Button,
@@ -24197,11 +24334,11 @@ var init_SidePanel = __esm({
24197
24334
  icon: X,
24198
24335
  onClick: handleClose,
24199
24336
  "aria-label": "Close panel",
24200
- children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
24337
+ children: /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", className: "sr-only", children: "Close" })
24201
24338
  }
24202
24339
  )
24203
24340
  ] }),
24204
- /* @__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 })
24205
24342
  ]
24206
24343
  }
24207
24344
  )
@@ -24252,7 +24389,7 @@ var init_WizardProgress = __esm({
24252
24389
  children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
24253
24390
  const isActive = index === currentStep;
24254
24391
  const isCompleted = index < currentStep;
24255
- return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
24392
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
24256
24393
  /* @__PURE__ */ jsx(
24257
24394
  "button",
24258
24395
  {
@@ -24377,7 +24514,9 @@ var init_WizardNavigation = __esm({
24377
24514
  {
24378
24515
  border: true,
24379
24516
  className: cn(
24380
- "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",
24381
24520
  compact ? "px-4 py-2" : "px-6 py-4",
24382
24521
  className
24383
24522
  ),
@@ -25308,7 +25447,7 @@ function InventoryGrid({
25308
25447
  const eventBus = useEventBus();
25309
25448
  const slotCount = totalSlots ?? items.length;
25310
25449
  const emptySlotCount = Math.max(0, slotCount - items.length);
25311
- const handleSelect = React81.useCallback(
25450
+ const handleSelect = React84.useCallback(
25312
25451
  (id) => {
25313
25452
  onSelect?.(id);
25314
25453
  if (selectEvent) {
@@ -25521,15 +25660,15 @@ function GameCanvas2D({
25521
25660
  fps = 60,
25522
25661
  className
25523
25662
  }) {
25524
- const canvasRef = React81.useRef(null);
25525
- const rafRef = React81.useRef(0);
25526
- const frameRef = React81.useRef(0);
25527
- const lastTimeRef = React81.useRef(0);
25528
- 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);
25529
25668
  onDrawRef.current = onDraw;
25530
- const onTickRef = React81.useRef(onTick);
25669
+ const onTickRef = React84.useRef(onTick);
25531
25670
  onTickRef.current = onTick;
25532
- React81.useEffect(() => {
25671
+ React84.useEffect(() => {
25533
25672
  const canvas = canvasRef.current;
25534
25673
  if (!canvas) return;
25535
25674
  const ctx = canvas.getContext("2d");
@@ -25818,7 +25957,7 @@ function TurnPanel({
25818
25957
  className
25819
25958
  }) {
25820
25959
  const eventBus = useEventBus();
25821
- const handleAction = React81.useCallback(
25960
+ const handleAction = React84.useCallback(
25822
25961
  (event) => {
25823
25962
  if (event) {
25824
25963
  eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
@@ -25964,7 +26103,7 @@ function UnitCommandBar({
25964
26103
  className
25965
26104
  }) {
25966
26105
  const eventBus = useEventBus();
25967
- const handleCommand = React81.useCallback(
26106
+ const handleCommand = React84.useCallback(
25968
26107
  (event) => {
25969
26108
  if (event) {
25970
26109
  eventBus.emit(event, { unitId: selectedUnitId });
@@ -26449,7 +26588,7 @@ function GameMenu({
26449
26588
  } catch {
26450
26589
  }
26451
26590
  const eventBus = eventBusProp || eventBusFromHook;
26452
- const handleOptionClick = React81.useCallback(
26591
+ const handleOptionClick = React84.useCallback(
26453
26592
  (option) => {
26454
26593
  if (option.event && eventBus) {
26455
26594
  eventBus.emit(`UI:${option.event}`, { option });
@@ -26563,7 +26702,7 @@ function GameOverScreen({
26563
26702
  } catch {
26564
26703
  }
26565
26704
  const eventBus = eventBusProp || eventBusFromHook;
26566
- const handleActionClick = React81.useCallback(
26705
+ const handleActionClick = React84.useCallback(
26567
26706
  (action) => {
26568
26707
  if (action.event && eventBus) {
26569
26708
  eventBus.emit(`UI:${action.event}`, { action });
@@ -29222,7 +29361,7 @@ var init_StepFlow = __esm({
29222
29361
  className
29223
29362
  }) => {
29224
29363
  if (orientation === "vertical") {
29225
- 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: [
29364
+ 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: [
29226
29365
  /* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
29227
29366
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
29228
29367
  showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
@@ -29233,7 +29372,7 @@ var init_StepFlow = __esm({
29233
29372
  ] })
29234
29373
  ] }) }, index)) });
29235
29374
  }
29236
- 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: [
29375
+ 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: [
29237
29376
  /* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
29238
29377
  /* @__PURE__ */ jsx(StepCircle, { step, index }),
29239
29378
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
@@ -29301,9 +29440,9 @@ var init_SplitSection = __esm({
29301
29440
  className
29302
29441
  ),
29303
29442
  padding: "lg",
29304
- 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: [
29305
- /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0 lg:min-w-[45%]", children: textContent }),
29306
- /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0 lg:max-w-[50%]", children: mediaContent })
29443
+ 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: [
29444
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0 md:min-w-[45%]", children: textContent }),
29445
+ /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0 md:max-w-[50%]", children: mediaContent })
29307
29446
  ] })
29308
29447
  }
29309
29448
  );
@@ -30115,7 +30254,7 @@ var init_LikertScale = __esm({
30115
30254
  md: "text-base",
30116
30255
  lg: "text-lg"
30117
30256
  };
30118
- LikertScale = React81__default.forwardRef(
30257
+ LikertScale = React84__default.forwardRef(
30119
30258
  ({
30120
30259
  question,
30121
30260
  options = DEFAULT_LIKERT_OPTIONS,
@@ -30127,7 +30266,7 @@ var init_LikertScale = __esm({
30127
30266
  variant = "radios",
30128
30267
  className
30129
30268
  }, ref) => {
30130
- const groupId = React81__default.useId();
30269
+ const groupId = React84__default.useId();
30131
30270
  const eventBus = useEventBus();
30132
30271
  const handleSelect = useCallback(
30133
30272
  (next) => {
@@ -32131,7 +32270,7 @@ var init_VersionDiff = __esm({
32131
32270
  /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", className: "flex-wrap", children: [
32132
32271
  /* @__PURE__ */ jsx(Icon, { icon: GitCommit, size: "sm", className: "text-muted-foreground" }),
32133
32272
  /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "whitespace-nowrap", children: "Compare" }),
32134
- /* @__PURE__ */ jsx(Box, { className: "min-w-[160px]", children: /* @__PURE__ */ jsx(
32273
+ /* @__PURE__ */ jsx(Box, { className: "min-w-0 md:min-w-[160px]", children: /* @__PURE__ */ jsx(
32135
32274
  Select,
32136
32275
  {
32137
32276
  options,
@@ -32141,7 +32280,7 @@ var init_VersionDiff = __esm({
32141
32280
  }
32142
32281
  ) }),
32143
32282
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: "to" }),
32144
- /* @__PURE__ */ jsx(Box, { className: "min-w-[160px]", children: /* @__PURE__ */ jsx(
32283
+ /* @__PURE__ */ jsx(Box, { className: "min-w-0 md:min-w-[160px]", children: /* @__PURE__ */ jsx(
32145
32284
  Select,
32146
32285
  {
32147
32286
  options,
@@ -32206,8 +32345,8 @@ var init_VersionDiff = __esm({
32206
32345
  ]
32207
32346
  }
32208
32347
  ),
32209
- /* @__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: [
32210
- /* @__PURE__ */ jsx(Box, { className: "border-r border-border", children: /* @__PURE__ */ jsx(VStack, { gap: "none", className: "font-mono text-xs", children: beforeLines.map((line, idx) => {
32348
+ /* @__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: [
32349
+ /* @__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) => {
32211
32350
  const isRemoved = line.type === "removed";
32212
32351
  return /* @__PURE__ */ jsxs(
32213
32352
  HStack,
@@ -32353,7 +32492,7 @@ var init_DocBreadcrumb = __esm({
32353
32492
  "aria-label": "Breadcrumb",
32354
32493
  children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
32355
32494
  const isLast = idx === items.length - 1;
32356
- return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
32495
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
32357
32496
  idx > 0 && /* @__PURE__ */ jsx(
32358
32497
  Icon,
32359
32498
  {
@@ -33243,7 +33382,7 @@ var init_MiniStateMachine = __esm({
33243
33382
  const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
33244
33383
  const tc = transitionCounts[s.name] ?? 0;
33245
33384
  const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
33246
- return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
33385
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
33247
33386
  /* @__PURE__ */ jsx(
33248
33387
  AvlState,
33249
33388
  {
@@ -34620,7 +34759,7 @@ var init_DocumentViewer = __esm({
34620
34759
  }
34621
34760
  });
34622
34761
  function extractTitle(children) {
34623
- if (!React81__default.isValidElement(children)) return void 0;
34762
+ if (!React84__default.isValidElement(children)) return void 0;
34624
34763
  const props = children.props;
34625
34764
  if (typeof props.title === "string") {
34626
34765
  return props.title;
@@ -34675,7 +34814,7 @@ function LinearView({
34675
34814
  /* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
34676
34815
  const isDone = i < currentIdx;
34677
34816
  const isCurrent = i === currentIdx;
34678
- return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
34817
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
34679
34818
  i > 0 && /* @__PURE__ */ jsx(
34680
34819
  Typography,
34681
34820
  {
@@ -35576,12 +35715,12 @@ var init_Form = __esm({
35576
35715
  const isSchemaEntity = isOrbitalEntitySchema(entity);
35577
35716
  const resolvedEntity = isSchemaEntity ? entity : void 0;
35578
35717
  const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
35579
- const normalizedInitialData = React81__default.useMemo(() => {
35718
+ const normalizedInitialData = React84__default.useMemo(() => {
35580
35719
  const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
35581
35720
  const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
35582
35721
  return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
35583
35722
  }, [entity, initialData]);
35584
- const entityDerivedFields = React81__default.useMemo(() => {
35723
+ const entityDerivedFields = React84__default.useMemo(() => {
35585
35724
  if (fields && fields.length > 0) return void 0;
35586
35725
  if (!resolvedEntity) return void 0;
35587
35726
  return resolvedEntity.fields.map(
@@ -35600,16 +35739,16 @@ var init_Form = __esm({
35600
35739
  const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
35601
35740
  const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
35602
35741
  const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
35603
- const [formData, setFormData] = React81__default.useState(
35742
+ const [formData, setFormData] = React84__default.useState(
35604
35743
  normalizedInitialData
35605
35744
  );
35606
- const [collapsedSections, setCollapsedSections] = React81__default.useState(
35745
+ const [collapsedSections, setCollapsedSections] = React84__default.useState(
35607
35746
  /* @__PURE__ */ new Set()
35608
35747
  );
35609
- const [submitError, setSubmitError] = React81__default.useState(null);
35610
- const formRef = React81__default.useRef(null);
35748
+ const [submitError, setSubmitError] = React84__default.useState(null);
35749
+ const formRef = React84__default.useRef(null);
35611
35750
  const formMode = props.mode;
35612
- const mountedRef = React81__default.useRef(false);
35751
+ const mountedRef = React84__default.useRef(false);
35613
35752
  if (!mountedRef.current) {
35614
35753
  mountedRef.current = true;
35615
35754
  debug("forms", "mount", {
@@ -35622,7 +35761,7 @@ var init_Form = __esm({
35622
35761
  });
35623
35762
  }
35624
35763
  const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
35625
- const evalContext = React81__default.useMemo(
35764
+ const evalContext = React84__default.useMemo(
35626
35765
  () => ({
35627
35766
  formValues: formData,
35628
35767
  globalVariables: externalContext?.globalVariables ?? {},
@@ -35631,7 +35770,7 @@ var init_Form = __esm({
35631
35770
  }),
35632
35771
  [formData, externalContext]
35633
35772
  );
35634
- React81__default.useEffect(() => {
35773
+ React84__default.useEffect(() => {
35635
35774
  debug("forms", "initialData-sync", {
35636
35775
  mode: formMode,
35637
35776
  normalizedInitialData,
@@ -35642,7 +35781,7 @@ var init_Form = __esm({
35642
35781
  setFormData(normalizedInitialData);
35643
35782
  }
35644
35783
  }, [normalizedInitialData]);
35645
- const processCalculations = React81__default.useCallback(
35784
+ const processCalculations = React84__default.useCallback(
35646
35785
  (changedFieldId, newFormData) => {
35647
35786
  if (!hiddenCalculations.length) return;
35648
35787
  const context = {
@@ -35667,7 +35806,7 @@ var init_Form = __esm({
35667
35806
  },
35668
35807
  [hiddenCalculations, externalContext, eventBus]
35669
35808
  );
35670
- const checkViolations = React81__default.useCallback(
35809
+ const checkViolations = React84__default.useCallback(
35671
35810
  (changedFieldId, newFormData) => {
35672
35811
  if (!violationTriggers.length) return;
35673
35812
  const context = {
@@ -35705,7 +35844,7 @@ var init_Form = __esm({
35705
35844
  processCalculations(name, newFormData);
35706
35845
  checkViolations(name, newFormData);
35707
35846
  };
35708
- const isFieldVisible = React81__default.useCallback(
35847
+ const isFieldVisible = React84__default.useCallback(
35709
35848
  (fieldName) => {
35710
35849
  const condition = conditionalFields[fieldName];
35711
35850
  if (!condition) return true;
@@ -35713,7 +35852,7 @@ var init_Form = __esm({
35713
35852
  },
35714
35853
  [conditionalFields, evalContext]
35715
35854
  );
35716
- const isSectionVisible = React81__default.useCallback(
35855
+ const isSectionVisible = React84__default.useCallback(
35717
35856
  (section) => {
35718
35857
  if (!section.condition) return true;
35719
35858
  return Boolean(evaluateFormExpression(section.condition, evalContext));
@@ -35789,7 +35928,7 @@ var init_Form = __esm({
35789
35928
  eventBus.emit(`UI:${onCancel}`);
35790
35929
  }
35791
35930
  };
35792
- const renderField = React81__default.useCallback(
35931
+ const renderField = React84__default.useCallback(
35793
35932
  (field) => {
35794
35933
  const fieldName = field.name || field.field;
35795
35934
  if (!fieldName) return null;
@@ -35810,7 +35949,7 @@ var init_Form = __esm({
35810
35949
  [formData, isFieldVisible, relationsData, relationsLoading, isLoading]
35811
35950
  );
35812
35951
  const effectiveFields = entityDerivedFields ?? fields;
35813
- const normalizedFields = React81__default.useMemo(() => {
35952
+ const normalizedFields = React84__default.useMemo(() => {
35814
35953
  if (!effectiveFields || effectiveFields.length === 0) return [];
35815
35954
  return effectiveFields.map((field) => {
35816
35955
  if (typeof field === "string") {
@@ -35832,7 +35971,7 @@ var init_Form = __esm({
35832
35971
  return field;
35833
35972
  });
35834
35973
  }, [effectiveFields, resolvedEntity]);
35835
- const schemaFields = React81__default.useMemo(() => {
35974
+ const schemaFields = React84__default.useMemo(() => {
35836
35975
  if (normalizedFields.length === 0) return null;
35837
35976
  if (isDebugEnabled()) {
35838
35977
  debugGroup(`Form: ${entityName || "unknown"}`);
@@ -35842,7 +35981,7 @@ var init_Form = __esm({
35842
35981
  }
35843
35982
  return normalizedFields.map(renderField).filter(Boolean);
35844
35983
  }, [normalizedFields, renderField, entityName, conditionalFields]);
35845
- const sectionElements = React81__default.useMemo(() => {
35984
+ const sectionElements = React84__default.useMemo(() => {
35846
35985
  if (!sections || sections.length === 0) return null;
35847
35986
  return sections.map((section) => {
35848
35987
  if (!isSectionVisible(section)) {
@@ -37568,7 +37707,7 @@ var init_List = __esm({
37568
37707
  if (entity && typeof entity === "object" && "id" in entity) return [entity];
37569
37708
  return [];
37570
37709
  }, [entity]);
37571
- const getItemActions = React81__default.useCallback(
37710
+ const getItemActions = React84__default.useCallback(
37572
37711
  (item) => {
37573
37712
  if (!itemActions) return [];
37574
37713
  if (typeof itemActions === "function") {
@@ -38041,7 +38180,7 @@ var init_MediaGallery = __esm({
38041
38180
  [selectable, selectedItems, selectionEvent, eventBus]
38042
38181
  );
38043
38182
  const entityData = Array.isArray(entity) ? entity : [];
38044
- const items = React81__default.useMemo(() => {
38183
+ const items = React84__default.useMemo(() => {
38045
38184
  if (propItems) return propItems;
38046
38185
  if (entityData.length === 0) return [];
38047
38186
  return entityData.map((record, idx) => ({
@@ -38205,7 +38344,7 @@ var init_MediaGallery = __esm({
38205
38344
  }
38206
38345
  });
38207
38346
  function extractTitle2(children) {
38208
- if (!React81__default.isValidElement(children)) return void 0;
38347
+ if (!React84__default.isValidElement(children)) return void 0;
38209
38348
  const props = children.props;
38210
38349
  if (typeof props.title === "string") {
38211
38350
  return props.title;
@@ -38918,7 +39057,7 @@ var init_PageHeader = __esm({
38918
39057
  info: "bg-info/10 text-info"
38919
39058
  };
38920
39059
  return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
38921
- 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: [
39060
+ 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: [
38922
39061
  idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
38923
39062
  crumb.href ? /* @__PURE__ */ jsx(
38924
39063
  "a",
@@ -39214,7 +39353,7 @@ var init_debugRegistry = __esm({
39214
39353
  }
39215
39354
  });
39216
39355
  function useDebugData() {
39217
- const [data, setData] = React81.useState(() => ({
39356
+ const [data, setData] = React84.useState(() => ({
39218
39357
  traits: [],
39219
39358
  ticks: [],
39220
39359
  guards: [],
@@ -39228,7 +39367,7 @@ function useDebugData() {
39228
39367
  },
39229
39368
  lastUpdate: Date.now()
39230
39369
  }));
39231
- React81.useEffect(() => {
39370
+ React84.useEffect(() => {
39232
39371
  const updateData = () => {
39233
39372
  setData({
39234
39373
  traits: getAllTraits(),
@@ -39337,12 +39476,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
39337
39476
  return positions;
39338
39477
  }
39339
39478
  function WalkMinimap() {
39340
- const [walkStep, setWalkStep] = React81.useState(null);
39341
- const [traits2, setTraits] = React81.useState([]);
39342
- const [coveredEdges, setCoveredEdges] = React81.useState([]);
39343
- const [completedTraits, setCompletedTraits] = React81.useState(/* @__PURE__ */ new Set());
39344
- const prevTraitRef = React81.useRef(null);
39345
- React81.useEffect(() => {
39479
+ const [walkStep, setWalkStep] = React84.useState(null);
39480
+ const [traits2, setTraits] = React84.useState([]);
39481
+ const [coveredEdges, setCoveredEdges] = React84.useState([]);
39482
+ const [completedTraits, setCompletedTraits] = React84.useState(/* @__PURE__ */ new Set());
39483
+ const prevTraitRef = React84.useRef(null);
39484
+ React84.useEffect(() => {
39346
39485
  const interval = setInterval(() => {
39347
39486
  const w = window;
39348
39487
  const step = w.__orbitalWalkStep;
@@ -39789,15 +39928,15 @@ var init_EntitiesTab = __esm({
39789
39928
  }
39790
39929
  });
39791
39930
  function EventFlowTab({ events: events2 }) {
39792
- const [filter, setFilter] = React81.useState("all");
39793
- const containerRef = React81.useRef(null);
39794
- const [autoScroll, setAutoScroll] = React81.useState(true);
39795
- React81.useEffect(() => {
39931
+ const [filter, setFilter] = React84.useState("all");
39932
+ const containerRef = React84.useRef(null);
39933
+ const [autoScroll, setAutoScroll] = React84.useState(true);
39934
+ React84.useEffect(() => {
39796
39935
  if (autoScroll && containerRef.current) {
39797
39936
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
39798
39937
  }
39799
39938
  }, [events2.length, autoScroll]);
39800
- const filteredEvents = React81.useMemo(() => {
39939
+ const filteredEvents = React84.useMemo(() => {
39801
39940
  if (filter === "all") return events2;
39802
39941
  return events2.filter((e) => e.type === filter);
39803
39942
  }, [events2, filter]);
@@ -39916,7 +40055,7 @@ var init_EventFlowTab = __esm({
39916
40055
  }
39917
40056
  });
39918
40057
  function GuardsPanel({ guards }) {
39919
- const [filter, setFilter] = React81.useState("all");
40058
+ const [filter, setFilter] = React84.useState("all");
39920
40059
  if (guards.length === 0) {
39921
40060
  return /* @__PURE__ */ jsx(
39922
40061
  EmptyState,
@@ -39929,7 +40068,7 @@ function GuardsPanel({ guards }) {
39929
40068
  }
39930
40069
  const passedCount = guards.filter((g) => g.result).length;
39931
40070
  const failedCount = guards.length - passedCount;
39932
- const filteredGuards = React81.useMemo(() => {
40071
+ const filteredGuards = React84.useMemo(() => {
39933
40072
  if (filter === "all") return guards;
39934
40073
  if (filter === "passed") return guards.filter((g) => g.result);
39935
40074
  return guards.filter((g) => !g.result);
@@ -40090,10 +40229,10 @@ function EffectBadge({ effect }) {
40090
40229
  ] });
40091
40230
  }
40092
40231
  function TransitionTimeline({ transitions }) {
40093
- const containerRef = React81.useRef(null);
40094
- const [autoScroll, setAutoScroll] = React81.useState(true);
40095
- const [expandedId, setExpandedId] = React81.useState(null);
40096
- React81.useEffect(() => {
40232
+ const containerRef = React84.useRef(null);
40233
+ const [autoScroll, setAutoScroll] = React84.useState(true);
40234
+ const [expandedId, setExpandedId] = React84.useState(null);
40235
+ React84.useEffect(() => {
40097
40236
  if (autoScroll && containerRef.current) {
40098
40237
  containerRef.current.scrollTop = containerRef.current.scrollHeight;
40099
40238
  }
@@ -40379,9 +40518,9 @@ function getAllEvents(traits2) {
40379
40518
  }
40380
40519
  function EventDispatcherTab({ traits: traits2, schema }) {
40381
40520
  const eventBus = useEventBus();
40382
- const [log12, setLog] = React81.useState([]);
40383
- const prevStatesRef = React81.useRef(/* @__PURE__ */ new Map());
40384
- React81.useEffect(() => {
40521
+ const [log12, setLog] = React84.useState([]);
40522
+ const prevStatesRef = React84.useRef(/* @__PURE__ */ new Map());
40523
+ React84.useEffect(() => {
40385
40524
  for (const trait of traits2) {
40386
40525
  const prev = prevStatesRef.current.get(trait.id);
40387
40526
  if (prev && prev !== trait.currentState) {
@@ -40551,10 +40690,10 @@ function VerifyModePanel({
40551
40690
  serverCount,
40552
40691
  localCount
40553
40692
  }) {
40554
- const [expanded, setExpanded] = React81.useState(true);
40555
- const scrollRef = React81.useRef(null);
40556
- const prevCountRef = React81.useRef(0);
40557
- React81.useEffect(() => {
40693
+ const [expanded, setExpanded] = React84.useState(true);
40694
+ const scrollRef = React84.useRef(null);
40695
+ const prevCountRef = React84.useRef(0);
40696
+ React84.useEffect(() => {
40558
40697
  if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
40559
40698
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
40560
40699
  }
@@ -40620,10 +40759,10 @@ function RuntimeDebugger({
40620
40759
  defaultTab,
40621
40760
  schema
40622
40761
  }) {
40623
- const [isCollapsed, setIsCollapsed] = React81.useState(mode === "verify" ? true : defaultCollapsed);
40624
- const [isVisible, setIsVisible] = React81.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
40762
+ const [isCollapsed, setIsCollapsed] = React84.useState(mode === "verify" ? true : defaultCollapsed);
40763
+ const [isVisible, setIsVisible] = React84.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
40625
40764
  const debugData = useDebugData();
40626
- React81.useEffect(() => {
40765
+ React84.useEffect(() => {
40627
40766
  if (mode === "inline") return;
40628
40767
  return onDebugToggle((enabled) => {
40629
40768
  setIsVisible(enabled);
@@ -40632,7 +40771,7 @@ function RuntimeDebugger({
40632
40771
  }
40633
40772
  });
40634
40773
  }, [mode]);
40635
- React81.useEffect(() => {
40774
+ React84.useEffect(() => {
40636
40775
  if (mode === "inline") return;
40637
40776
  const handleKeyDown = (e) => {
40638
40777
  if (e.key === "`" && isVisible) {
@@ -41181,7 +41320,7 @@ function SequenceBar({
41181
41320
  onSlotRemove(index);
41182
41321
  }, [onSlotRemove, playing]);
41183
41322
  const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
41184
- return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
41323
+ return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
41185
41324
  i > 0 && /* @__PURE__ */ jsx(
41186
41325
  Typography,
41187
41326
  {
@@ -42583,7 +42722,7 @@ var init_StatCard = __esm({
42583
42722
  const labelToUse = propLabel ?? propTitle;
42584
42723
  const eventBus = useEventBus();
42585
42724
  const { t } = useTranslate();
42586
- const handleActionClick = React81__default.useCallback(() => {
42725
+ const handleActionClick = React84__default.useCallback(() => {
42587
42726
  if (action?.event) {
42588
42727
  eventBus.emit(`UI:${action.event}`, {});
42589
42728
  }
@@ -42594,7 +42733,7 @@ var init_StatCard = __esm({
42594
42733
  const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
42595
42734
  const isLoading = externalLoading ?? false;
42596
42735
  const error = externalError;
42597
- const computeMetricValue = React81__default.useCallback(
42736
+ const computeMetricValue = React84__default.useCallback(
42598
42737
  (metric, items) => {
42599
42738
  if (metric.value !== void 0) {
42600
42739
  return metric.value;
@@ -42633,7 +42772,7 @@ var init_StatCard = __esm({
42633
42772
  },
42634
42773
  []
42635
42774
  );
42636
- const schemaStats = React81__default.useMemo(() => {
42775
+ const schemaStats = React84__default.useMemo(() => {
42637
42776
  if (!metrics || metrics.length === 0) return null;
42638
42777
  return metrics.map((metric) => ({
42639
42778
  label: metric.label,
@@ -42641,7 +42780,7 @@ var init_StatCard = __esm({
42641
42780
  format: metric.format
42642
42781
  }));
42643
42782
  }, [metrics, data, computeMetricValue]);
42644
- const calculatedTrend = React81__default.useMemo(() => {
42783
+ const calculatedTrend = React84__default.useMemo(() => {
42645
42784
  if (manualTrend !== void 0) return manualTrend;
42646
42785
  if (previousValue === void 0 || currentValue === void 0)
42647
42786
  return void 0;
@@ -43752,7 +43891,7 @@ var init_Timeline = __esm({
43752
43891
  }) => {
43753
43892
  const { t } = useTranslate();
43754
43893
  const entityData = Array.isArray(entity) ? entity : [];
43755
- const items = React81__default.useMemo(() => {
43894
+ const items = React84__default.useMemo(() => {
43756
43895
  if (propItems) return propItems;
43757
43896
  if (entityData.length === 0) return [];
43758
43897
  return entityData.map((record, idx) => {
@@ -43859,7 +43998,7 @@ var init_Timeline = __esm({
43859
43998
  }
43860
43999
  });
43861
44000
  function extractToastProps(children) {
43862
- if (!React81__default.isValidElement(children)) {
44001
+ if (!React84__default.isValidElement(children)) {
43863
44002
  if (typeof children === "string") {
43864
44003
  return { message: children };
43865
44004
  }
@@ -43897,7 +44036,7 @@ var init_ToastSlot = __esm({
43897
44036
  eventBus.emit("UI:CLOSE");
43898
44037
  };
43899
44038
  if (!isVisible) return null;
43900
- const isCustomContent = React81__default.isValidElement(children) && !message;
44039
+ const isCustomContent = React84__default.isValidElement(children) && !message;
43901
44040
  return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
43902
44041
  Toast,
43903
44042
  {
@@ -44166,7 +44305,7 @@ var init_WizardContainer = __esm({
44166
44305
  const isCompleted = index < currentStep;
44167
44306
  const stepKey = step.id ?? step.tabId ?? `step-${index}`;
44168
44307
  const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
44169
- return /* @__PURE__ */ jsxs(React81__default.Fragment, { children: [
44308
+ return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
44170
44309
  /* @__PURE__ */ jsx(
44171
44310
  Button,
44172
44311
  {
@@ -44548,12 +44687,12 @@ var init_WorldMapTemplate = __esm({
44548
44687
  }
44549
44688
  });
44550
44689
  function lazyThree(name, loader) {
44551
- const Lazy = React81__default.lazy(() => loader().then((m) => ({ default: m[name] })));
44690
+ const Lazy = React84__default.lazy(() => loader().then((m) => ({ default: m[name] })));
44552
44691
  function ThreeWrapper(props) {
44553
- return React81__default.createElement(
44554
- React81__default.Suspense,
44692
+ return React84__default.createElement(
44693
+ React84__default.Suspense,
44555
44694
  { fallback: null },
44556
- React81__default.createElement(Lazy, props)
44695
+ React84__default.createElement(Lazy, props)
44557
44696
  );
44558
44697
  }
44559
44698
  ThreeWrapper.displayName = `Lazy(${name})`;
@@ -44572,6 +44711,7 @@ var init_component_registry_generated = __esm({
44572
44711
  init_AnimatedGraphic();
44573
44712
  init_AnimatedReveal();
44574
44713
  init_ArticleSection();
44714
+ init_Aside();
44575
44715
  init_AuthLayout();
44576
44716
  init_BattleBoard();
44577
44717
  init_BattleTemplate();
@@ -44626,6 +44766,7 @@ var init_component_registry_generated = __esm({
44626
44766
  init_DayCell();
44627
44767
  init_DebuggerBoard();
44628
44768
  init_DetailPanel();
44769
+ init_Dialog();
44629
44770
  init_DialogueBox();
44630
44771
  init_DialogueBubble();
44631
44772
  init_DocBreadcrumb();
@@ -44839,6 +44980,7 @@ var init_component_registry_generated = __esm({
44839
44980
  "AnimatedGraphic": AnimatedGraphic,
44840
44981
  "AnimatedReveal": AnimatedReveal,
44841
44982
  "ArticleSection": ArticleSection,
44983
+ "Aside": Aside,
44842
44984
  "AuthLayout": AuthLayout,
44843
44985
  "Avatar": AvatarPattern,
44844
44986
  "AvatarPattern": AvatarPattern,
@@ -44908,6 +45050,7 @@ var init_component_registry_generated = __esm({
44908
45050
  "DayCell": DayCell,
44909
45051
  "DebuggerBoard": DebuggerBoard,
44910
45052
  "DetailPanel": DetailPanel,
45053
+ "Dialog": Dialog,
44911
45054
  "DialogueBox": DialogueBox,
44912
45055
  "DialogueBubble": DialogueBubble,
44913
45056
  "Divider": DividerPattern,
@@ -45161,7 +45304,7 @@ function SuspenseConfigProvider({
45161
45304
  config,
45162
45305
  children
45163
45306
  }) {
45164
- return React81__default.createElement(
45307
+ return React84__default.createElement(
45165
45308
  SuspenseConfigContext.Provider,
45166
45309
  { value: config },
45167
45310
  children
@@ -45644,7 +45787,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
45644
45787
  const key = `${parentId}-${index}-trait:${traitName}`;
45645
45788
  return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
45646
45789
  }
45647
- return /* @__PURE__ */ jsx(React81__default.Fragment, { children: child }, `${parentId}-${index}`);
45790
+ return /* @__PURE__ */ jsx(React84__default.Fragment, { children: child }, `${parentId}-${index}`);
45648
45791
  }
45649
45792
  if (!child || typeof child !== "object") return null;
45650
45793
  const childId = `${parentId}-${index}`;
@@ -45681,14 +45824,14 @@ function isPatternConfig(value) {
45681
45824
  if (value === null || value === void 0) return false;
45682
45825
  if (typeof value !== "object") return false;
45683
45826
  if (Array.isArray(value)) return false;
45684
- if (React81__default.isValidElement(value)) return false;
45827
+ if (React84__default.isValidElement(value)) return false;
45685
45828
  if (value instanceof Date) return false;
45686
45829
  if (typeof value === "function") return false;
45687
45830
  const record = value;
45688
45831
  return "type" in record && typeof record.type === "string";
45689
45832
  }
45690
45833
  function isPlainConfigObject(value) {
45691
- if (React81__default.isValidElement(value)) return false;
45834
+ if (React84__default.isValidElement(value)) return false;
45692
45835
  if (value instanceof Date) return false;
45693
45836
  const proto = Object.getPrototypeOf(value);
45694
45837
  return proto === Object.prototype || proto === null;