@almadar/ui 2.26.0 → 2.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3531,18 +3531,14 @@ var InstallBox = ({
3531
3531
  /* @__PURE__ */ jsxRuntime.jsx(
3532
3532
  Box,
3533
3533
  {
3534
- className: cn(
3535
- "bg-foreground",
3536
- "rounded-md",
3537
- "border-[length:var(--border-width)] border-border"
3538
- ),
3534
+ className: "bg-surface rounded-md border-[length:var(--border-width)] border-border",
3539
3535
  padding: "md",
3540
- children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "md", align: "center", children: [
3536
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-3", children: [
3541
3537
  /* @__PURE__ */ jsxRuntime.jsx(
3542
3538
  Typography,
3543
3539
  {
3544
3540
  variant: "body2",
3545
- className: "font-mono flex-1 min-w-0 text-background select-all",
3541
+ className: "font-mono flex-1 min-w-0 select-all",
3546
3542
  truncate: true,
3547
3543
  children: command
3548
3544
  }
@@ -3551,10 +3547,12 @@ var InstallBox = ({
3551
3547
  Button,
3552
3548
  {
3553
3549
  variant: "ghost",
3554
- size: "md",
3550
+ size: "sm",
3551
+ leftIcon: copied ? "check" : "copy",
3555
3552
  onClick: handleCopy,
3556
- className: "flex-shrink-0 text-background hover:text-background",
3557
- children: copied ? "Copied!" : "Copy"
3553
+ className: "flex-shrink-0",
3554
+ "aria-label": copied ? "Copied" : "Copy to clipboard",
3555
+ children: copied ? "Copied" : "Copy"
3558
3556
  }
3559
3557
  )
3560
3558
  ] })
@@ -4659,6 +4657,289 @@ var AnimatedCounter = ({
4659
4657
  ] });
4660
4658
  };
4661
4659
  AnimatedCounter.displayName = "AnimatedCounter";
4660
+ var initialStyles = {
4661
+ "fade-up": { opacity: 0, transform: "translateY(24px)" },
4662
+ "fade-down": { opacity: 0, transform: "translateY(-24px)" },
4663
+ "fade-in": { opacity: 0 },
4664
+ "fade-left": { opacity: 0, transform: "translateX(24px)" },
4665
+ "fade-right": { opacity: 0, transform: "translateX(-24px)" },
4666
+ "scale": { opacity: 0, transform: "scale(0.92)" },
4667
+ "scale-up": { opacity: 0, transform: "scale(0.92) translateY(16px)" },
4668
+ "none": {}
4669
+ };
4670
+ var animatedStyles = {
4671
+ "fade-up": { opacity: 1, transform: "translateY(0)" },
4672
+ "fade-down": { opacity: 1, transform: "translateY(0)" },
4673
+ "fade-in": { opacity: 1 },
4674
+ "fade-left": { opacity: 1, transform: "translateX(0)" },
4675
+ "fade-right": { opacity: 1, transform: "translateX(0)" },
4676
+ "scale": { opacity: 1, transform: "scale(1)" },
4677
+ "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
4678
+ "none": {}
4679
+ };
4680
+ var AnimatedReveal = React5__default.default.forwardRef(
4681
+ ({
4682
+ trigger = "scroll",
4683
+ animation = "fade-up",
4684
+ duration = 600,
4685
+ delay = 0,
4686
+ threshold = 0.15,
4687
+ once = true,
4688
+ animate: manualAnimate,
4689
+ easing = "cubic-bezier(0.16, 1, 0.3, 1)",
4690
+ children,
4691
+ className,
4692
+ style,
4693
+ ...props
4694
+ }, forwardedRef) => {
4695
+ const [isAnimated, setIsAnimated] = React5.useState(false);
4696
+ const internalRef = React5.useRef(null);
4697
+ const hasAnimated = React5.useRef(false);
4698
+ const setRef = React5.useCallback(
4699
+ (node) => {
4700
+ internalRef.current = node;
4701
+ if (typeof forwardedRef === "function") forwardedRef(node);
4702
+ else if (forwardedRef) forwardedRef.current = node;
4703
+ },
4704
+ [forwardedRef]
4705
+ );
4706
+ React5.useEffect(() => {
4707
+ if (trigger !== "scroll") return;
4708
+ const el = internalRef.current;
4709
+ if (!el) return;
4710
+ const observer = new IntersectionObserver(
4711
+ ([entry]) => {
4712
+ if (entry.isIntersecting) {
4713
+ if (once && hasAnimated.current) return;
4714
+ hasAnimated.current = true;
4715
+ setIsAnimated(true);
4716
+ } else if (!once) {
4717
+ setIsAnimated(false);
4718
+ }
4719
+ },
4720
+ { threshold }
4721
+ );
4722
+ observer.observe(el);
4723
+ return () => observer.disconnect();
4724
+ }, [trigger, threshold, once]);
4725
+ const handleMouseEnter = trigger === "hover" ? () => setIsAnimated(true) : void 0;
4726
+ const handleMouseLeave = trigger === "hover" ? () => {
4727
+ if (!once || !hasAnimated.current) {
4728
+ hasAnimated.current = true;
4729
+ setIsAnimated(false);
4730
+ }
4731
+ } : void 0;
4732
+ React5.useEffect(() => {
4733
+ if (trigger === "manual" && manualAnimate !== void 0) {
4734
+ setIsAnimated(manualAnimate);
4735
+ }
4736
+ }, [trigger, manualAnimate]);
4737
+ const active = isAnimated;
4738
+ const currentStyle = active ? animatedStyles[animation] : initialStyles[animation];
4739
+ return /* @__PURE__ */ jsxRuntime.jsx(
4740
+ "div",
4741
+ {
4742
+ ref: setRef,
4743
+ className: cn("will-change-[opacity,transform]", className),
4744
+ style: {
4745
+ ...currentStyle,
4746
+ transitionProperty: "opacity, transform",
4747
+ transitionDuration: `${duration}ms`,
4748
+ transitionDelay: `${delay}ms`,
4749
+ transitionTimingFunction: easing,
4750
+ ...style
4751
+ },
4752
+ onMouseEnter: handleMouseEnter,
4753
+ onMouseLeave: handleMouseLeave,
4754
+ ...props,
4755
+ children: typeof children === "function" ? children(active) : children
4756
+ }
4757
+ );
4758
+ }
4759
+ );
4760
+ AnimatedReveal.displayName = "AnimatedReveal";
4761
+ function useFetchedSvg(src) {
4762
+ const [svg, setSvg] = React5.useState(null);
4763
+ const cache = React5.useRef({});
4764
+ React5.useEffect(() => {
4765
+ if (!src) {
4766
+ setSvg(null);
4767
+ return;
4768
+ }
4769
+ if (cache.current[src]) {
4770
+ setSvg(cache.current[src]);
4771
+ return;
4772
+ }
4773
+ let cancelled = false;
4774
+ fetch(src).then((res) => {
4775
+ if (!res.ok) throw new Error(`Failed to fetch SVG: ${res.status}`);
4776
+ return res.text();
4777
+ }).then((text) => {
4778
+ if (cancelled) return;
4779
+ cache.current[src] = text;
4780
+ setSvg(text);
4781
+ }).catch(() => {
4782
+ if (!cancelled) setSvg(null);
4783
+ });
4784
+ return () => {
4785
+ cancelled = true;
4786
+ };
4787
+ }, [src]);
4788
+ return svg;
4789
+ }
4790
+ function applyDrawAnimation(container, animate, duration, delay, easing) {
4791
+ const paths = container.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
4792
+ paths.forEach((el) => {
4793
+ if ("getTotalLength" in el && typeof el.getTotalLength === "function") {
4794
+ const len = el.getTotalLength();
4795
+ el.style.strokeDasharray = `${len}`;
4796
+ el.style.strokeDashoffset = animate ? "0" : `${len}`;
4797
+ el.style.transition = `stroke-dashoffset ${duration}ms ${easing} ${delay}ms`;
4798
+ }
4799
+ });
4800
+ }
4801
+ function applyFillAnimation(container, animate, duration, delay, easing, fillColor) {
4802
+ const paths = container.querySelectorAll("path, circle, ellipse, rect, polygon");
4803
+ paths.forEach((el) => {
4804
+ if ("getTotalLength" in el && typeof el.getTotalLength === "function") {
4805
+ const geom = el;
4806
+ const len = geom.getTotalLength();
4807
+ geom.style.strokeDasharray = `${len}`;
4808
+ geom.style.strokeDashoffset = animate ? "0" : `${len}`;
4809
+ geom.style.transition = `stroke-dashoffset ${duration * 0.6}ms ${easing} ${delay}ms, fill-opacity ${duration * 0.4}ms ${easing} ${delay + duration * 0.6}ms`;
4810
+ }
4811
+ if (fillColor) el.style.fill = fillColor;
4812
+ el.style.fillOpacity = animate ? "1" : "0";
4813
+ });
4814
+ }
4815
+ function applyPulseAnimation(container, animate, duration) {
4816
+ const svg = container.querySelector("svg");
4817
+ if (!svg) return;
4818
+ if (animate) {
4819
+ svg.style.animation = `ag-pulse ${duration}ms ease-in-out infinite`;
4820
+ } else {
4821
+ svg.style.animation = "none";
4822
+ }
4823
+ }
4824
+ function applyMorphAnimation(container, animate, duration, delay, easing) {
4825
+ const paths = container.querySelectorAll("path, circle, ellipse, rect, polygon");
4826
+ paths.forEach((el) => {
4827
+ el.style.transition = `all ${duration}ms ${easing} ${delay}ms`;
4828
+ el.style.transform = animate ? "scale(1)" : "scale(0)";
4829
+ el.style.transformOrigin = "center";
4830
+ el.style.opacity = animate ? "1" : "0";
4831
+ });
4832
+ }
4833
+ var AnimatedGraphic = React5__default.default.forwardRef(
4834
+ ({
4835
+ src,
4836
+ svgContent,
4837
+ animation = "draw",
4838
+ animate = false,
4839
+ duration = 1200,
4840
+ delay = 0,
4841
+ easing = "cubic-bezier(0.16, 1, 0.3, 1)",
4842
+ width,
4843
+ height,
4844
+ strokeColor,
4845
+ fillColor,
4846
+ alt,
4847
+ className,
4848
+ style,
4849
+ children,
4850
+ ...props
4851
+ }, ref) => {
4852
+ const containerRef = React5.useRef(null);
4853
+ const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
4854
+ const resolvedSvg = svgContent ?? fetchedSvg;
4855
+ const prevAnimateRef = React5.useRef(animate);
4856
+ const setRef = React5__default.default.useCallback(
4857
+ (node) => {
4858
+ containerRef.current = node;
4859
+ if (typeof ref === "function") ref(node);
4860
+ else if (ref) ref.current = node;
4861
+ },
4862
+ [ref]
4863
+ );
4864
+ React5.useEffect(() => {
4865
+ const el = containerRef.current;
4866
+ if (!el || !strokeColor) return;
4867
+ const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
4868
+ paths.forEach((p) => {
4869
+ p.style.stroke = strokeColor;
4870
+ });
4871
+ }, [resolvedSvg, strokeColor]);
4872
+ React5.useEffect(() => {
4873
+ const el = containerRef.current;
4874
+ if (!el || !resolvedSvg) return;
4875
+ if (animation === "draw" || animation === "fill") {
4876
+ const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
4877
+ paths.forEach((p) => {
4878
+ if ("getTotalLength" in p && typeof p.getTotalLength === "function") {
4879
+ const len = p.getTotalLength();
4880
+ p.style.strokeDasharray = `${len}`;
4881
+ p.style.strokeDashoffset = `${len}`;
4882
+ }
4883
+ if (animation === "fill") {
4884
+ p.style.fillOpacity = "0";
4885
+ }
4886
+ });
4887
+ }
4888
+ if (animation === "morph") {
4889
+ const paths = el.querySelectorAll("path, circle, ellipse, rect, polygon");
4890
+ paths.forEach((p) => {
4891
+ p.style.transform = "scale(0)";
4892
+ p.style.transformOrigin = "center";
4893
+ p.style.opacity = "0";
4894
+ });
4895
+ }
4896
+ }, [resolvedSvg, animation]);
4897
+ React5.useEffect(() => {
4898
+ const el = containerRef.current;
4899
+ if (!el) return;
4900
+ const id = requestAnimationFrame(() => {
4901
+ switch (animation) {
4902
+ case "draw":
4903
+ applyDrawAnimation(el, animate, duration, delay, easing);
4904
+ break;
4905
+ case "fill":
4906
+ applyFillAnimation(el, animate, duration, delay, easing, fillColor);
4907
+ break;
4908
+ case "pulse":
4909
+ applyPulseAnimation(el, animate, duration);
4910
+ break;
4911
+ case "morph":
4912
+ applyMorphAnimation(el, animate, duration, delay, easing);
4913
+ break;
4914
+ }
4915
+ });
4916
+ prevAnimateRef.current = animate;
4917
+ return () => cancelAnimationFrame(id);
4918
+ }, [animate, animation, duration, delay, easing, fillColor, resolvedSvg]);
4919
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4920
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: `@keyframes ag-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.04); opacity: 0.85; } }` }),
4921
+ /* @__PURE__ */ jsxRuntime.jsx(
4922
+ "div",
4923
+ {
4924
+ ref: setRef,
4925
+ className: cn("inline-flex items-center justify-center", className),
4926
+ style: { width, height, ...style },
4927
+ role: alt ? "img" : void 0,
4928
+ "aria-label": alt,
4929
+ ...props,
4930
+ children: resolvedSvg ? /* @__PURE__ */ jsxRuntime.jsx(
4931
+ "div",
4932
+ {
4933
+ className: "w-full h-full [&>svg]:w-full [&>svg]:h-full",
4934
+ dangerouslySetInnerHTML: { __html: resolvedSvg }
4935
+ }
4936
+ ) : children
4937
+ }
4938
+ )
4939
+ ] });
4940
+ }
4941
+ );
4942
+ AnimatedGraphic.displayName = "AnimatedGraphic";
4662
4943
  var PI = Math.PI;
4663
4944
  function lineIntersection(x1, y1, x2, y2, x3, y3, x4, y4) {
4664
4945
  const denom = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
@@ -5675,6 +5956,8 @@ var EdgeDecoration = ({
5675
5956
  EdgeDecoration.displayName = "EdgeDecoration";
5676
5957
 
5677
5958
  exports.AnimatedCounter = AnimatedCounter;
5959
+ exports.AnimatedGraphic = AnimatedGraphic;
5960
+ exports.AnimatedReveal = AnimatedReveal;
5678
5961
  exports.ArticleSection = ArticleSection;
5679
5962
  exports.Badge = Badge;
5680
5963
  exports.Box = Box;
@@ -828,6 +828,59 @@ interface AnimatedCounterProps {
828
828
  }
829
829
  declare const AnimatedCounter: React.FC<AnimatedCounterProps>;
830
830
 
831
+ type RevealTrigger = 'scroll' | 'hover' | 'manual';
832
+ type RevealAnimation = 'fade-up' | 'fade-down' | 'fade-in' | 'fade-left' | 'fade-right' | 'scale' | 'scale-up' | 'none';
833
+ interface AnimatedRevealProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
834
+ /** What triggers the animation */
835
+ trigger?: RevealTrigger;
836
+ /** Built-in animation preset */
837
+ animation?: RevealAnimation;
838
+ /** Animation duration in ms (default: 600) */
839
+ duration?: number;
840
+ /** Delay before animation starts in ms (default: 0) */
841
+ delay?: number;
842
+ /** How much of the element must be visible before triggering, 0-1 (default: 0.15) */
843
+ threshold?: number;
844
+ /** Animate only the first time the element enters the viewport (default: true) */
845
+ once?: boolean;
846
+ /** Manual control: when trigger='manual', set this to true to animate */
847
+ animate?: boolean;
848
+ /** Easing function (default: cubic-bezier(0.16, 1, 0.3, 1)) */
849
+ easing?: string;
850
+ /** Children: ReactNode or render function receiving animated state */
851
+ children: React.ReactNode | ((animated: boolean) => React.ReactNode);
852
+ }
853
+ declare const AnimatedReveal: React.ForwardRefExoticComponent<AnimatedRevealProps & React.RefAttributes<HTMLDivElement>>;
854
+
855
+ type GraphicAnimation = 'draw' | 'fill' | 'pulse' | 'morph';
856
+ interface AnimatedGraphicProps extends React.HTMLAttributes<HTMLDivElement> {
857
+ /** URL to an SVG file. Fetched and inlined to enable stroke/fill animations. */
858
+ src?: string;
859
+ /** Inline SVG string. Takes precedence over src if both provided. */
860
+ svgContent?: string;
861
+ /** Animation type applied to SVG paths/shapes */
862
+ animation?: GraphicAnimation;
863
+ /** Whether to run the animation (default: false). Controlled externally or via AnimatedReveal. */
864
+ animate?: boolean;
865
+ /** Animation duration in ms (default: 1200) */
866
+ duration?: number;
867
+ /** Delay before animation starts in ms (default: 0) */
868
+ delay?: number;
869
+ /** Easing function (default: cubic-bezier(0.16, 1, 0.3, 1)) */
870
+ easing?: string;
871
+ /** Width of the graphic container */
872
+ width?: string | number;
873
+ /** Height of the graphic container */
874
+ height?: string | number;
875
+ /** Stroke color override for SVG paths */
876
+ strokeColor?: string;
877
+ /** Fill color for the 'fill' animation end state */
878
+ fillColor?: string;
879
+ /** Alt text for accessibility */
880
+ alt?: string;
881
+ }
882
+ declare const AnimatedGraphic: React.ForwardRefExoticComponent<AnimatedGraphicProps & React.RefAttributes<HTMLDivElement>>;
883
+
831
884
  /**
832
885
  * PatternTile Atom
833
886
  *
@@ -939,4 +992,4 @@ interface EdgeDecorationProps {
939
992
  }
940
993
  declare const EdgeDecoration: React.FC<EdgeDecorationProps>;
941
994
 
942
- export { AnimatedCounter, type AnimatedCounterProps, ArticleSection, type ArticleSectionProps, Badge, Box, Button, CTABanner, type CTABannerProps, Card, CaseStudyCard, type CaseStudyCardProps, Center, CommunityLinks, type CommunityLinksProps, ContentSection, type ContentSectionProps, Divider, EdgeDecoration, type EdgeDecorationProps, type EdgeSide, type EdgeVariant, FeatureCard, type FeatureCardProps, FeatureGrid, type FeatureGridProps, type FooterLinkColumn, type FooterLinkItem, GeometricPattern, type GeometricPatternProps, GradientDivider, type GradientDividerProps, HStack, HeroSection, type HeroSectionProps, Icon, InstallBox, type InstallBoxProps, MarketingFooter, type MarketingFooterProps, PatternTile, type PatternTileProps, type PatternVariant, PricingCard, type PricingCardProps, PricingGrid, type PricingGridProps, PullQuote, type PullQuoteProps, ServiceCatalog, type ServiceCatalogProps, ShowcaseCard, type ShowcaseCardProps, SimpleGrid, Spacer, SplitSection, type SplitSectionProps, StatsGrid, type StatsGridProps, StepFlow, type StepFlowProps, type StepItemProps, TagCloud, type TagCloudProps, TeamCard, type TeamCardProps, Typography, VStack, getTileDimensions };
995
+ export { AnimatedCounter, type AnimatedCounterProps, AnimatedGraphic, type AnimatedGraphicProps, AnimatedReveal, type AnimatedRevealProps, ArticleSection, type ArticleSectionProps, Badge, Box, Button, CTABanner, type CTABannerProps, Card, CaseStudyCard, type CaseStudyCardProps, Center, CommunityLinks, type CommunityLinksProps, ContentSection, type ContentSectionProps, Divider, EdgeDecoration, type EdgeDecorationProps, type EdgeSide, type EdgeVariant, FeatureCard, type FeatureCardProps, FeatureGrid, type FeatureGridProps, type FooterLinkColumn, type FooterLinkItem, GeometricPattern, type GeometricPatternProps, GradientDivider, type GradientDividerProps, type GraphicAnimation, HStack, HeroSection, type HeroSectionProps, Icon, InstallBox, type InstallBoxProps, MarketingFooter, type MarketingFooterProps, PatternTile, type PatternTileProps, type PatternVariant, PricingCard, type PricingCardProps, PricingGrid, type PricingGridProps, PullQuote, type PullQuoteProps, type RevealAnimation, type RevealTrigger, ServiceCatalog, type ServiceCatalogProps, ShowcaseCard, type ShowcaseCardProps, SimpleGrid, Spacer, SplitSection, type SplitSectionProps, StatsGrid, type StatsGridProps, StepFlow, type StepFlowProps, type StepItemProps, TagCloud, type TagCloudProps, TeamCard, type TeamCardProps, Typography, VStack, getTileDimensions };
@@ -60,6 +60,10 @@ export { PullQuote } from '../components/molecules/PullQuote';
60
60
  export type { PullQuoteProps } from '../components/molecules/PullQuote';
61
61
  export { AnimatedCounter } from '../components/molecules/AnimatedCounter';
62
62
  export type { AnimatedCounterProps } from '../components/molecules/AnimatedCounter';
63
+ export { AnimatedReveal } from '../components/atoms/AnimatedReveal';
64
+ export type { AnimatedRevealProps, RevealTrigger, RevealAnimation } from '../components/atoms/AnimatedReveal';
65
+ export { AnimatedGraphic } from '../components/atoms/AnimatedGraphic';
66
+ export type { AnimatedGraphicProps, GraphicAnimation } from '../components/atoms/AnimatedGraphic';
63
67
  export { PatternTile, getTileDimensions } from '../components/atoms/PatternTile';
64
68
  export type { PatternTileProps, PatternVariant } from '../components/atoms/PatternTile';
65
69
  export { GeometricPattern } from '../components/molecules/GeometricPattern';