@almadar/ui 5.25.1 → 5.26.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.
Files changed (48) hide show
  1. package/dist/avl/index.cjs +2001 -2178
  2. package/dist/avl/index.js +950 -1127
  3. package/dist/components/core/atoms/FlipContainer.d.ts +4 -4
  4. package/dist/components/core/atoms/Icon.d.ts +4 -2
  5. package/dist/components/core/atoms/ProgressBar.d.ts +1 -1
  6. package/dist/components/core/atoms/types.d.ts +6 -0
  7. package/dist/components/core/molecules/ArrayEditor.d.ts +15 -0
  8. package/dist/components/core/molecules/Carousel.d.ts +8 -2
  9. package/dist/components/core/molecules/Container.d.ts +4 -4
  10. package/dist/components/core/molecules/DateRangeSelector.d.ts +3 -4
  11. package/dist/components/core/molecules/DocSidebar.d.ts +4 -4
  12. package/dist/components/core/molecules/EdgeDecoration.d.ts +3 -2
  13. package/dist/components/core/molecules/Flex.d.ts +4 -4
  14. package/dist/components/core/molecules/FlipCard.d.ts +3 -4
  15. package/dist/components/core/molecules/GradientDivider.d.ts +3 -2
  16. package/dist/components/core/molecules/MapEditor.d.ts +16 -0
  17. package/dist/components/core/molecules/ObjectEditor.d.ts +15 -0
  18. package/dist/components/core/molecules/SidePanel.d.ts +4 -4
  19. package/dist/components/core/molecules/SortableList.d.ts +4 -5
  20. package/dist/components/core/molecules/ViolationAlert.d.ts +4 -9
  21. package/dist/components/core/molecules/index.d.ts +4 -3
  22. package/dist/components/core/molecules/markdown/CodeBlock.d.ts +44 -2
  23. package/dist/components/game/atoms/ResourceCounter.d.ts +3 -2
  24. package/dist/components/game/atoms/StateIndicator.d.ts +4 -5
  25. package/dist/components/game/atoms/StatusEffect.d.ts +2 -3
  26. package/dist/components/game/molecules/ActionButtons.d.ts +6 -0
  27. package/dist/components/game/molecules/GameHud.d.ts +2 -3
  28. package/dist/components/game/molecules/StatBadge.d.ts +6 -0
  29. package/dist/components/game/organisms/puzzles/state-architect/StateJsonView.d.ts +16 -0
  30. package/dist/components/game/organisms/puzzles/state-architect/index.d.ts +2 -2
  31. package/dist/components/index.cjs +2249 -1975
  32. package/dist/components/index.js +1349 -1075
  33. package/dist/docs/index.cjs +6014 -4606
  34. package/dist/docs/index.css +1252 -0
  35. package/dist/docs/index.d.cts +108 -16
  36. package/dist/docs/index.d.ts +2 -2
  37. package/dist/docs/index.js +5970 -4567
  38. package/dist/marketing/index.cjs +32 -9
  39. package/dist/marketing/index.d.cts +30 -20
  40. package/dist/marketing/index.js +32 -9
  41. package/dist/providers/index.cjs +1826 -2003
  42. package/dist/providers/index.js +925 -1102
  43. package/dist/runtime/index.cjs +1866 -2043
  44. package/dist/runtime/index.js +929 -1106
  45. package/package.json +1 -1
  46. package/dist/components/core/molecules/CodeViewer.d.ts +0 -70
  47. package/dist/components/core/molecules/DocCodeBlock.d.ts +0 -14
  48. package/dist/components/game/organisms/puzzles/state-architect/CodeView.d.ts +0 -24
@@ -3679,6 +3679,14 @@ function resolveIconForFamily(name, family) {
3679
3679
  }
3680
3680
  }
3681
3681
  }
3682
+ var colorTokenClasses = {
3683
+ primary: "text-primary",
3684
+ secondary: "text-secondary",
3685
+ success: "text-success",
3686
+ warning: "text-warning",
3687
+ error: "text-error",
3688
+ muted: "text-muted-foreground"
3689
+ };
3682
3690
  var iconAliases = {
3683
3691
  "close": LucideIcons2__namespace.X,
3684
3692
  "trash": LucideIcons2__namespace.Trash2,
@@ -3748,10 +3756,11 @@ var Icon = ({
3748
3756
  ...effectiveStrokeWidth === void 0 ? { strokeWidth: "var(--icon-stroke-width, 2)" } : {},
3749
3757
  ...style
3750
3758
  };
3759
+ const resolvedColor = color ? color in colorTokenClasses ? colorTokenClasses[color] : color : "text-current";
3751
3760
  const composedClassName = cn(
3752
3761
  sizeClasses[size],
3753
3762
  animationClasses[animation],
3754
- color ? color : "text-current",
3763
+ resolvedColor,
3755
3764
  className
3756
3765
  );
3757
3766
  if (directIcon) {
@@ -5095,7 +5104,6 @@ var Avatar = ({
5095
5104
  }, [src]);
5096
5105
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
5097
5106
  const IconComponent = typeof iconProp === "string" ? resolveIcon(iconProp) : iconProp;
5098
- const hasImage = !!src && !imgFailed;
5099
5107
  const hasIcon = !!IconComponent;
5100
5108
  const hasInitials = !!initials && !(hasIcon && !providedInitials);
5101
5109
  const getInitialsBackground = () => "bg-primary text-primary-foreground";
@@ -5121,15 +5129,13 @@ var Avatar = ({
5121
5129
  onClick: isClickable ? handleClick : void 0,
5122
5130
  role: isClickable ? "button" : void 0,
5123
5131
  tabIndex: isClickable ? 0 : void 0,
5124
- children: hasImage ? /* @__PURE__ */ jsxRuntime.jsx(
5132
+ children: src && !imgFailed ? /* @__PURE__ */ jsxRuntime.jsx(
5125
5133
  "img",
5126
5134
  {
5127
5135
  src,
5128
5136
  alt: alt || "Avatar",
5129
5137
  className: "w-full h-full object-cover",
5130
- onError: () => {
5131
- setImgFailed(true);
5132
- }
5138
+ onError: () => setImgFailed(true)
5133
5139
  }
5134
5140
  ) : hasInitials ? /* @__PURE__ */ jsxRuntime.jsx(
5135
5141
  "div",
@@ -5340,11 +5346,19 @@ var MarketingFooter = ({
5340
5346
  );
5341
5347
  };
5342
5348
  MarketingFooter.displayName = "MarketingFooter";
5349
+ var colorTokenVars = {
5350
+ primary: "var(--color-primary)",
5351
+ secondary: "var(--color-secondary)",
5352
+ success: "var(--color-success)",
5353
+ warning: "var(--color-warning)",
5354
+ error: "var(--color-error)",
5355
+ muted: "var(--color-muted)"
5356
+ };
5343
5357
  var GradientDivider = ({
5344
5358
  color,
5345
5359
  className
5346
5360
  }) => {
5347
- const centerColor = color ?? "var(--color-primary)";
5361
+ const centerColor = color ? color in colorTokenVars ? colorTokenVars[color] : color : "var(--color-primary)";
5348
5362
  return /* @__PURE__ */ jsxRuntime.jsx(
5349
5363
  Box,
5350
5364
  {
@@ -6585,6 +6599,14 @@ var GeometricPattern = ({
6585
6599
  );
6586
6600
  };
6587
6601
  GeometricPattern.displayName = "GeometricPattern";
6602
+ var colorTokenVars2 = {
6603
+ primary: "var(--color-primary)",
6604
+ secondary: "var(--color-secondary)",
6605
+ success: "var(--color-success)",
6606
+ warning: "var(--color-warning)",
6607
+ error: "var(--color-error)",
6608
+ muted: "var(--color-muted)"
6609
+ };
6588
6610
  function ArchSVG({
6589
6611
  facing,
6590
6612
  w,
@@ -6715,13 +6737,14 @@ var EdgeDecoration = ({
6715
6737
  variant = "arch",
6716
6738
  side = "both",
6717
6739
  opacity = 0.15,
6718
- color = "var(--color-primary)",
6740
+ color = "primary",
6719
6741
  strokeWidth = 0.5,
6720
6742
  width = 15,
6721
6743
  className
6722
6744
  }) => {
6723
6745
  const id = React8.useId();
6724
6746
  const Variant = VARIANT_MAP2[variant];
6747
+ const resolvedColor = color in colorTokenVars2 ? colorTokenVars2[color] : color;
6725
6748
  const sides = side === "both" ? ["left", "right"] : [side];
6726
6749
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: sides.map((s) => /* @__PURE__ */ jsxRuntime.jsx(
6727
6750
  "svg",
@@ -6744,7 +6767,7 @@ var EdgeDecoration = ({
6744
6767
  facing: s,
6745
6768
  w: 200,
6746
6769
  h: 600,
6747
- color,
6770
+ color: resolvedColor,
6748
6771
  strokeWidth
6749
6772
  }
6750
6773
  )
@@ -219,6 +219,29 @@ interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
219
219
  }
220
220
  declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
221
221
 
222
+ /**
223
+ * Cross-cutting atom-level prop shapes shared across the design system.
224
+ */
225
+ /**
226
+ * Canonical semantic color palette. Values are the Tailwind / CSS-var token
227
+ * names that every component in the design system understands. Prefer this
228
+ * over a bare `string` for any `color` or `variant` prop.
229
+ */
230
+ type ColorToken = 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'muted';
231
+ /**
232
+ * A labelled link/CTA used by marketing molecules (HeroSection, CTABanner,
233
+ * PricingCard) for their primary/secondary call-to-action props.
234
+ */
235
+ type LinkAction = {
236
+ label: string;
237
+ href: string;
238
+ };
239
+ /** An image with its required alt text. */
240
+ type ImageSource = {
241
+ src: string;
242
+ alt: string;
243
+ };
244
+
222
245
  /**
223
246
  * Icon Atom Component
224
247
  *
@@ -235,6 +258,7 @@ declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttri
235
258
 
236
259
  type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
237
260
  type IconAnimation = 'spin' | 'pulse' | 'none';
261
+
238
262
  interface IconProps {
239
263
  /**
240
264
  * Lucide icon component (preferred for type-safe usage), OR a canonical
@@ -246,8 +270,8 @@ interface IconProps {
246
270
  name?: string;
247
271
  /** Size of the icon */
248
272
  size?: IconSize;
249
- /** Color class (Tailwind color class) or 'inherit' for theme default */
250
- color?: string;
273
+ /** Semantic palette token or an arbitrary Tailwind color class. */
274
+ color?: ColorToken | string;
251
275
  /** Animation type */
252
276
  animation?: IconAnimation;
253
277
  /** Additional CSS classes */
@@ -387,20 +411,6 @@ interface ContentSectionProps {
387
411
  }
388
412
  declare const ContentSection: React.ForwardRefExoticComponent<ContentSectionProps & React.RefAttributes<HTMLDivElement>>;
389
413
 
390
- /**
391
- * A labelled link/CTA used by marketing molecules (HeroSection, CTABanner,
392
- * PricingCard) for their primary/secondary call-to-action props.
393
- */
394
- type LinkAction = {
395
- label: string;
396
- href: string;
397
- };
398
- /** An image with its required alt text. */
399
- type ImageSource = {
400
- src: string;
401
- alt: string;
402
- };
403
-
404
414
  /**
405
415
  * HeroSection Molecule Component
406
416
  *
@@ -822,8 +832,8 @@ declare const MarketingFooter: React.FC<MarketingFooterProps>;
822
832
  */
823
833
 
824
834
  interface GradientDividerProps {
825
- /** Override the center color (CSS value). Defaults to var(--color-primary). */
826
- color?: string;
835
+ /** Semantic palette token or a raw CSS color value. Defaults to 'primary'. */
836
+ color?: ColorToken | string;
827
837
  /** Additional class names */
828
838
  className?: string;
829
839
  }
@@ -1021,8 +1031,8 @@ interface EdgeDecorationProps {
1021
1031
  side?: EdgeSide;
1022
1032
  /** Overall opacity (default: 0.15) */
1023
1033
  opacity?: number;
1024
- /** Stroke color */
1025
- color?: string;
1034
+ /** Semantic palette token or a raw CSS color value for the stroke. */
1035
+ color?: ColorToken | string;
1026
1036
  /** Stroke width */
1027
1037
  strokeWidth?: number;
1028
1038
  /** Width of the decoration area as percentage of container (default: 15) */
@@ -3652,6 +3652,14 @@ function resolveIconForFamily(name, family) {
3652
3652
  }
3653
3653
  }
3654
3654
  }
3655
+ var colorTokenClasses = {
3656
+ primary: "text-primary",
3657
+ secondary: "text-secondary",
3658
+ success: "text-success",
3659
+ warning: "text-warning",
3660
+ error: "text-error",
3661
+ muted: "text-muted-foreground"
3662
+ };
3655
3663
  var iconAliases = {
3656
3664
  "close": LucideIcons2.X,
3657
3665
  "trash": LucideIcons2.Trash2,
@@ -3721,10 +3729,11 @@ var Icon = ({
3721
3729
  ...effectiveStrokeWidth === void 0 ? { strokeWidth: "var(--icon-stroke-width, 2)" } : {},
3722
3730
  ...style
3723
3731
  };
3732
+ const resolvedColor = color ? color in colorTokenClasses ? colorTokenClasses[color] : color : "text-current";
3724
3733
  const composedClassName = cn(
3725
3734
  sizeClasses[size],
3726
3735
  animationClasses[animation],
3727
- color ? color : "text-current",
3736
+ resolvedColor,
3728
3737
  className
3729
3738
  );
3730
3739
  if (directIcon) {
@@ -5068,7 +5077,6 @@ var Avatar = ({
5068
5077
  }, [src]);
5069
5078
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
5070
5079
  const IconComponent = typeof iconProp === "string" ? resolveIcon(iconProp) : iconProp;
5071
- const hasImage = !!src && !imgFailed;
5072
5080
  const hasIcon = !!IconComponent;
5073
5081
  const hasInitials = !!initials && !(hasIcon && !providedInitials);
5074
5082
  const getInitialsBackground = () => "bg-primary text-primary-foreground";
@@ -5094,15 +5102,13 @@ var Avatar = ({
5094
5102
  onClick: isClickable ? handleClick : void 0,
5095
5103
  role: isClickable ? "button" : void 0,
5096
5104
  tabIndex: isClickable ? 0 : void 0,
5097
- children: hasImage ? /* @__PURE__ */ jsx(
5105
+ children: src && !imgFailed ? /* @__PURE__ */ jsx(
5098
5106
  "img",
5099
5107
  {
5100
5108
  src,
5101
5109
  alt: alt || "Avatar",
5102
5110
  className: "w-full h-full object-cover",
5103
- onError: () => {
5104
- setImgFailed(true);
5105
- }
5111
+ onError: () => setImgFailed(true)
5106
5112
  }
5107
5113
  ) : hasInitials ? /* @__PURE__ */ jsx(
5108
5114
  "div",
@@ -5313,11 +5319,19 @@ var MarketingFooter = ({
5313
5319
  );
5314
5320
  };
5315
5321
  MarketingFooter.displayName = "MarketingFooter";
5322
+ var colorTokenVars = {
5323
+ primary: "var(--color-primary)",
5324
+ secondary: "var(--color-secondary)",
5325
+ success: "var(--color-success)",
5326
+ warning: "var(--color-warning)",
5327
+ error: "var(--color-error)",
5328
+ muted: "var(--color-muted)"
5329
+ };
5316
5330
  var GradientDivider = ({
5317
5331
  color,
5318
5332
  className
5319
5333
  }) => {
5320
- const centerColor = color ?? "var(--color-primary)";
5334
+ const centerColor = color ? color in colorTokenVars ? colorTokenVars[color] : color : "var(--color-primary)";
5321
5335
  return /* @__PURE__ */ jsx(
5322
5336
  Box,
5323
5337
  {
@@ -6558,6 +6572,14 @@ var GeometricPattern = ({
6558
6572
  );
6559
6573
  };
6560
6574
  GeometricPattern.displayName = "GeometricPattern";
6575
+ var colorTokenVars2 = {
6576
+ primary: "var(--color-primary)",
6577
+ secondary: "var(--color-secondary)",
6578
+ success: "var(--color-success)",
6579
+ warning: "var(--color-warning)",
6580
+ error: "var(--color-error)",
6581
+ muted: "var(--color-muted)"
6582
+ };
6561
6583
  function ArchSVG({
6562
6584
  facing,
6563
6585
  w,
@@ -6688,13 +6710,14 @@ var EdgeDecoration = ({
6688
6710
  variant = "arch",
6689
6711
  side = "both",
6690
6712
  opacity = 0.15,
6691
- color = "var(--color-primary)",
6713
+ color = "primary",
6692
6714
  strokeWidth = 0.5,
6693
6715
  width = 15,
6694
6716
  className
6695
6717
  }) => {
6696
6718
  const id = useId();
6697
6719
  const Variant = VARIANT_MAP2[variant];
6720
+ const resolvedColor = color in colorTokenVars2 ? colorTokenVars2[color] : color;
6698
6721
  const sides = side === "both" ? ["left", "right"] : [side];
6699
6722
  return /* @__PURE__ */ jsx(Fragment, { children: sides.map((s) => /* @__PURE__ */ jsx(
6700
6723
  "svg",
@@ -6717,7 +6740,7 @@ var EdgeDecoration = ({
6717
6740
  facing: s,
6718
6741
  w: 200,
6719
6742
  h: 600,
6720
- color,
6743
+ color: resolvedColor,
6721
6744
  strokeWidth
6722
6745
  }
6723
6746
  )