@almadar/ui 4.45.0 → 4.47.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.
@@ -6011,12 +6011,15 @@ function ControlButton({
6011
6011
  sizeMap3[size] ?? sizeMap3.md,
6012
6012
  shapeMap[shape] ?? shapeMap.circle,
6013
6013
  variantMap[variant] ?? variantMap.secondary,
6014
- actualPressed && "scale-95 brightness-110 border-white",
6014
+ actualPressed && "scale-95 brightness-110 border-foreground",
6015
6015
  disabled && "opacity-50 cursor-not-allowed",
6016
6016
  className
6017
6017
  ),
6018
6018
  children: [
6019
- icon && /* @__PURE__ */ jsx("span", { className: "text-2xl", children: icon }),
6019
+ icon && /* @__PURE__ */ jsx("span", { className: "text-2xl", children: typeof icon === "string" ? (() => {
6020
+ const I = resolveIcon(icon);
6021
+ return I ? /* @__PURE__ */ jsx(I, { className: "w-6 h-6" }) : null;
6022
+ })() : icon }),
6020
6023
  label && !icon && /* @__PURE__ */ jsx("span", { children: label })
6021
6024
  ]
6022
6025
  }
@@ -6028,6 +6031,7 @@ var init_ControlButton = __esm({
6028
6031
  "use client";
6029
6032
  init_cn();
6030
6033
  init_useEventBus();
6034
+ init_Icon();
6031
6035
  sizeMap3 = {
6032
6036
  sm: "w-10 h-10 text-sm",
6033
6037
  md: "w-14 h-14 text-base",
@@ -6040,9 +6044,9 @@ var init_ControlButton = __esm({
6040
6044
  square: "rounded-md"
6041
6045
  };
6042
6046
  variantMap = {
6043
- primary: "bg-blue-600 text-[var(--color-foreground)] border-blue-400 hover:bg-blue-500",
6044
- secondary: "bg-[var(--color-surface,#374151)] text-[var(--color-foreground)] border-gray-500 hover:bg-gray-600",
6045
- ghost: "bg-transparent text-[var(--color-foreground)] border-white/30 hover:bg-white/10"
6047
+ primary: "bg-primary text-primary-foreground border-primary hover:bg-primary-hover",
6048
+ secondary: "bg-secondary text-secondary-foreground border-border hover:bg-secondary-hover",
6049
+ ghost: "bg-transparent text-foreground border-border hover:bg-muted"
6046
6050
  };
6047
6051
  ControlButton.displayName = "ControlButton";
6048
6052
  }
@@ -6770,8 +6774,8 @@ function ChoiceButton({
6770
6774
  className: cn(
6771
6775
  "w-full text-left px-4 py-2.5 rounded-md border transition-all duration-150",
6772
6776
  "flex items-center gap-2",
6773
- selected ? "bg-yellow-500/20 border-yellow-400 text-yellow-300" : "bg-white/5 border-white/10 text-[var(--color-foreground)] hover:bg-white/10 hover:border-white/30",
6774
- disabled && "opacity-40 cursor-not-allowed hover:bg-white/5 hover:border-white/10",
6777
+ selected ? "bg-accent/15 border-accent text-foreground" : "bg-muted/40 border-border text-foreground hover:bg-muted hover:border-border",
6778
+ disabled && "opacity-40 cursor-not-allowed hover:bg-muted/40 hover:border-border",
6775
6779
  className
6776
6780
  ),
6777
6781
  children: [
@@ -6780,7 +6784,7 @@ function ChoiceButton({
6780
6784
  {
6781
6785
  className: cn(
6782
6786
  "flex-shrink-0 font-mono font-bold text-sm",
6783
- selected ? "text-yellow-400" : "text-gray-500"
6787
+ selected ? "text-accent" : "text-muted-foreground"
6784
6788
  ),
6785
6789
  children: [
6786
6790
  index,
@@ -6821,7 +6825,7 @@ function ActionButton({
6821
6825
  disabled: isDisabled,
6822
6826
  onClick,
6823
6827
  className: cn(
6824
- "relative inline-flex items-center gap-1.5 rounded-md border font-medium text-[var(--color-foreground)] overflow-hidden transition-colors duration-150",
6828
+ "relative inline-flex items-center gap-1.5 rounded-md border font-medium overflow-hidden transition-colors duration-150",
6825
6829
  sizes.button,
6826
6830
  variantStyles8[variant],
6827
6831
  isDisabled && "opacity-60 cursor-not-allowed",
@@ -6831,7 +6835,7 @@ function ActionButton({
6831
6835
  onCooldown && /* @__PURE__ */ jsx(
6832
6836
  "div",
6833
6837
  {
6834
- className: "absolute inset-0 bg-black/60 pointer-events-none",
6838
+ className: "absolute inset-0 bg-foreground/40 pointer-events-none",
6835
6839
  style: {
6836
6840
  clipPath: `conic-gradient(from 0deg, transparent ${360 - cooldownDeg}deg, black ${360 - cooldownDeg}deg)`,
6837
6841
  WebkitClipPath: `conic-gradient(from 0deg, transparent ${360 - cooldownDeg}deg, black ${360 - cooldownDeg}deg)`,
@@ -6839,13 +6843,16 @@ function ActionButton({
6839
6843
  }
6840
6844
  }
6841
6845
  ),
6842
- icon && /* @__PURE__ */ jsx("span", { className: cn("flex-shrink-0", sizes.icon), children: icon }),
6846
+ icon && /* @__PURE__ */ jsx("span", { className: cn("flex-shrink-0", sizes.icon), children: typeof icon === "string" ? (() => {
6847
+ const I = resolveIcon(icon);
6848
+ return I ? /* @__PURE__ */ jsx(I, { className: "w-4 h-4" }) : null;
6849
+ })() : icon }),
6843
6850
  /* @__PURE__ */ jsx("span", { className: "relative z-10", children: label }),
6844
6851
  hotkey && /* @__PURE__ */ jsx(
6845
6852
  "span",
6846
6853
  {
6847
6854
  className: cn(
6848
- "absolute top-0.5 right-0.5 bg-black/50 text-gray-300 rounded font-mono leading-tight",
6855
+ "absolute top-0.5 right-0.5 bg-foreground/30 text-primary-foreground rounded font-mono leading-tight",
6849
6856
  sizes.hotkey
6850
6857
  ),
6851
6858
  children: hotkey
@@ -6859,15 +6866,16 @@ var sizeMap13, variantStyles8;
6859
6866
  var init_ActionButton = __esm({
6860
6867
  "components/atoms/game/ActionButton.tsx"() {
6861
6868
  init_cn();
6869
+ init_Icon();
6862
6870
  sizeMap13 = {
6863
6871
  sm: { button: "px-3 py-1.5 text-xs", hotkey: "text-[9px] px-1", icon: "text-xs" },
6864
6872
  md: { button: "px-4 py-2 text-sm", hotkey: "text-[10px] px-1.5", icon: "text-sm" },
6865
6873
  lg: { button: "px-5 py-2.5 text-base", hotkey: "text-xs px-2", icon: "text-base" }
6866
6874
  };
6867
6875
  variantStyles8 = {
6868
- primary: "bg-blue-600 hover:bg-blue-500 border-blue-400/40",
6869
- secondary: "bg-gray-700 hover:bg-gray-600 border-gray-500/40",
6870
- danger: "bg-red-700 hover:bg-red-600 border-red-400/40"
6876
+ primary: "bg-primary text-primary-foreground hover:bg-primary-hover border-primary",
6877
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-hover border-border",
6878
+ danger: "bg-error text-error-foreground hover:bg-error/90 border-error"
6871
6879
  };
6872
6880
  ActionButton.displayName = "ActionButton";
6873
6881
  }
@@ -21519,7 +21527,7 @@ function DataGrid({
21519
21527
  onClick: handleActionClick(action, itemData),
21520
21528
  "data-testid": `action-${action.event}`,
21521
21529
  "data-row-id": String(itemData.id),
21522
- className: "text-error hover:bg-error/10 px-2",
21530
+ className: "text-error hover:text-error hover:bg-error/10 px-2",
21523
21531
  children: [
21524
21532
  action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs" }),
21525
21533
  action.label
@@ -24112,7 +24120,7 @@ function StatBadge({
24112
24120
  const I = resolveIcon(icon);
24113
24121
  return I ? /* @__PURE__ */ jsx(I, { className: "w-4 h-4" }) : icon;
24114
24122
  })() : icon }),
24115
- /* @__PURE__ */ jsx("span", { className: "text-gray-400 font-medium", children: label }),
24123
+ /* @__PURE__ */ jsx("span", { className: "text-muted-foreground font-medium", children: label }),
24116
24124
  format === "hearts" && max && /* @__PURE__ */ jsx(
24117
24125
  HealthBar,
24118
24126
  {
@@ -24139,7 +24147,7 @@ function StatBadge({
24139
24147
  animated: true
24140
24148
  }
24141
24149
  ),
24142
- format === "text" && /* @__PURE__ */ jsx("span", { className: "font-bold text-[var(--color-foreground)]", children: value })
24150
+ format === "text" && /* @__PURE__ */ jsx("span", { className: "font-bold text-foreground", children: value })
24143
24151
  ]
24144
24152
  }
24145
24153
  );
@@ -24157,11 +24165,11 @@ var init_StatBadge = __esm({
24157
24165
  lg: "text-base px-4 py-2"
24158
24166
  };
24159
24167
  variantMap2 = {
24160
- default: "bg-[var(--color-card)]/80 border-gray-700",
24161
- primary: "bg-blue-900/80 border-blue-700",
24162
- success: "bg-green-900/80 border-green-700",
24163
- warning: "bg-yellow-900/80 border-yellow-700",
24164
- danger: "bg-red-900/80 border-red-700"
24168
+ default: "bg-card/80 border-border text-foreground",
24169
+ primary: "bg-primary/15 border-primary/40 text-foreground",
24170
+ success: "bg-success/15 border-success/40 text-foreground",
24171
+ warning: "bg-warning/15 border-warning/40 text-foreground",
24172
+ danger: "bg-error/15 border-error/40 text-foreground"
24165
24173
  };
24166
24174
  StatBadge.displayName = "StatBadge";
24167
24175
  }
@@ -36734,9 +36742,45 @@ var init_List = __esm({
36734
36742
  List3.displayName = "List";
36735
36743
  }
36736
36744
  });
36737
- var DefaultEmptyDetail, MasterDetail;
36745
+ function MasterDetail({
36746
+ entity,
36747
+ masterFields,
36748
+ detailFields: _detailFields,
36749
+ // Captured but not used here - detail handled separately
36750
+ loading: externalLoading,
36751
+ isLoading: externalIsLoading,
36752
+ error: externalError,
36753
+ className,
36754
+ ...rest
36755
+ }) {
36756
+ const loading = externalLoading ?? false;
36757
+ const isLoading = externalIsLoading ?? false;
36758
+ const error = externalError ?? null;
36759
+ return /* @__PURE__ */ jsx(
36760
+ DataTable,
36761
+ {
36762
+ fields: masterFields,
36763
+ columns: masterFields,
36764
+ entity,
36765
+ isLoading: loading || isLoading,
36766
+ error,
36767
+ className,
36768
+ emptyTitle: "No items found",
36769
+ emptyDescription: "Create your first item to get started.",
36770
+ ...rest
36771
+ }
36772
+ );
36773
+ }
36738
36774
  var init_MasterDetail = __esm({
36739
- "components/organisms/layout/MasterDetail.tsx"() {
36775
+ "components/organisms/MasterDetail.tsx"() {
36776
+ "use client";
36777
+ init_DataTable();
36778
+ MasterDetail.displayName = "MasterDetail";
36779
+ }
36780
+ });
36781
+ var DefaultEmptyDetail, MasterDetailLayout;
36782
+ var init_MasterDetailLayout = __esm({
36783
+ "components/organisms/layout/MasterDetailLayout.tsx"() {
36740
36784
  init_cn();
36741
36785
  init_Typography();
36742
36786
  DefaultEmptyDetail = () => /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center h-full border-2 border-dashed border-border", children: /* @__PURE__ */ jsx(
@@ -36747,7 +36791,7 @@ var init_MasterDetail = __esm({
36747
36791
  children: "Select an item to view details"
36748
36792
  }
36749
36793
  ) });
36750
- MasterDetail = ({
36794
+ MasterDetailLayout = ({
36751
36795
  master,
36752
36796
  detail,
36753
36797
  emptyDetail,
@@ -36782,7 +36826,7 @@ var init_MasterDetail = __esm({
36782
36826
  }
36783
36827
  );
36784
36828
  };
36785
- MasterDetail.displayName = "MasterDetail";
36829
+ MasterDetailLayout.displayName = "MasterDetailLayout";
36786
36830
  }
36787
36831
  });
36788
36832
  var COLUMN_CLASSES, ASPECT_CLASSES, MediaGallery;
@@ -43518,6 +43562,7 @@ var init_component_registry_generated = __esm({
43518
43562
  init_LoadingState();
43519
43563
  init_MarkdownContent();
43520
43564
  init_MasterDetail();
43565
+ init_MasterDetailLayout();
43521
43566
  init_MatrixQuestion();
43522
43567
  init_MediaGallery();
43523
43568
  init_Meter();
@@ -43812,6 +43857,7 @@ var init_component_registry_generated = __esm({
43812
43857
  "MapViewPattern": MapViewPattern,
43813
43858
  "MarkdownContent": MarkdownContent,
43814
43859
  "MasterDetail": MasterDetail,
43860
+ "MasterDetailLayout": MasterDetailLayout,
43815
43861
  "MatrixQuestion": MatrixQuestion,
43816
43862
  "MediaGallery": MediaGallery,
43817
43863
  "Menu": MenuPattern,