@almadar/ui 2.24.8 → 2.24.9

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.
@@ -3054,7 +3054,8 @@ var variantStyles2 = {
3054
3054
  ].join(" "),
3055
3055
  ghost: [
3056
3056
  "bg-transparent text-muted-foreground",
3057
- "hover:text-foreground hover:bg-muted",
3057
+ "border border-transparent",
3058
+ "hover:text-primary-foreground hover:bg-primary hover:border-primary",
3058
3059
  "active:scale-[var(--active-scale)]"
3059
3060
  ].join(" "),
3060
3061
  danger: [
@@ -3030,7 +3030,8 @@ var variantStyles2 = {
3030
3030
  ].join(" "),
3031
3031
  ghost: [
3032
3032
  "bg-transparent text-muted-foreground",
3033
- "hover:text-foreground hover:bg-muted",
3033
+ "border border-transparent",
3034
+ "hover:text-primary-foreground hover:bg-primary hover:border-primary",
3034
3035
  "active:scale-[var(--active-scale)]"
3035
3036
  ].join(" "),
3036
3037
  danger: [
@@ -3054,7 +3054,8 @@ var variantStyles2 = {
3054
3054
  ].join(" "),
3055
3055
  ghost: [
3056
3056
  "bg-transparent text-muted-foreground",
3057
- "hover:text-foreground hover:bg-muted",
3057
+ "border border-transparent",
3058
+ "hover:text-primary-foreground hover:bg-primary hover:border-primary",
3058
3059
  "active:scale-[var(--active-scale)]"
3059
3060
  ].join(" "),
3060
3061
  danger: [
@@ -3531,18 +3532,14 @@ var InstallBox = ({
3531
3532
  /* @__PURE__ */ jsxRuntime.jsx(
3532
3533
  Box,
3533
3534
  {
3534
- className: cn(
3535
- "bg-foreground",
3536
- "rounded-md",
3537
- "border-[length:var(--border-width)] border-border"
3538
- ),
3535
+ className: "bg-surface rounded-md border-[length:var(--border-width)] border-border",
3539
3536
  padding: "md",
3540
- children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "md", align: "center", children: [
3537
+ children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-3", children: [
3541
3538
  /* @__PURE__ */ jsxRuntime.jsx(
3542
3539
  Typography,
3543
3540
  {
3544
3541
  variant: "body2",
3545
- className: "font-mono flex-1 min-w-0 text-background select-all",
3542
+ className: "font-mono flex-1 min-w-0 select-all",
3546
3543
  truncate: true,
3547
3544
  children: command
3548
3545
  }
@@ -3551,10 +3548,12 @@ var InstallBox = ({
3551
3548
  Button,
3552
3549
  {
3553
3550
  variant: "ghost",
3554
- size: "md",
3551
+ size: "sm",
3552
+ leftIcon: copied ? "check" : "copy",
3555
3553
  onClick: handleCopy,
3556
- className: "flex-shrink-0 text-background hover:text-background",
3557
- children: copied ? "Copied!" : "Copy"
3554
+ className: "flex-shrink-0",
3555
+ "aria-label": copied ? "Copied" : "Copy to clipboard",
3556
+ children: copied ? "Copied" : "Copy"
3558
3557
  }
3559
3558
  )
3560
3559
  ] })
@@ -4659,6 +4658,289 @@ var AnimatedCounter = ({
4659
4658
  ] });
4660
4659
  };
4661
4660
  AnimatedCounter.displayName = "AnimatedCounter";
4661
+ var initialStyles = {
4662
+ "fade-up": { opacity: 0, transform: "translateY(24px)" },
4663
+ "fade-down": { opacity: 0, transform: "translateY(-24px)" },
4664
+ "fade-in": { opacity: 0 },
4665
+ "fade-left": { opacity: 0, transform: "translateX(24px)" },
4666
+ "fade-right": { opacity: 0, transform: "translateX(-24px)" },
4667
+ "scale": { opacity: 0, transform: "scale(0.92)" },
4668
+ "scale-up": { opacity: 0, transform: "scale(0.92) translateY(16px)" },
4669
+ "none": {}
4670
+ };
4671
+ var animatedStyles = {
4672
+ "fade-up": { opacity: 1, transform: "translateY(0)" },
4673
+ "fade-down": { opacity: 1, transform: "translateY(0)" },
4674
+ "fade-in": { opacity: 1 },
4675
+ "fade-left": { opacity: 1, transform: "translateX(0)" },
4676
+ "fade-right": { opacity: 1, transform: "translateX(0)" },
4677
+ "scale": { opacity: 1, transform: "scale(1)" },
4678
+ "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
4679
+ "none": {}
4680
+ };
4681
+ var AnimatedReveal = React5__default.default.forwardRef(
4682
+ ({
4683
+ trigger = "scroll",
4684
+ animation = "fade-up",
4685
+ duration = 600,
4686
+ delay = 0,
4687
+ threshold = 0.15,
4688
+ once = true,
4689
+ animate: manualAnimate,
4690
+ easing = "cubic-bezier(0.16, 1, 0.3, 1)",
4691
+ children,
4692
+ className,
4693
+ style,
4694
+ ...props
4695
+ }, forwardedRef) => {
4696
+ const [isAnimated, setIsAnimated] = React5.useState(false);
4697
+ const internalRef = React5.useRef(null);
4698
+ const hasAnimated = React5.useRef(false);
4699
+ const setRef = React5.useCallback(
4700
+ (node) => {
4701
+ internalRef.current = node;
4702
+ if (typeof forwardedRef === "function") forwardedRef(node);
4703
+ else if (forwardedRef) forwardedRef.current = node;
4704
+ },
4705
+ [forwardedRef]
4706
+ );
4707
+ React5.useEffect(() => {
4708
+ if (trigger !== "scroll") return;
4709
+ const el = internalRef.current;
4710
+ if (!el) return;
4711
+ const observer = new IntersectionObserver(
4712
+ ([entry]) => {
4713
+ if (entry.isIntersecting) {
4714
+ if (once && hasAnimated.current) return;
4715
+ hasAnimated.current = true;
4716
+ setIsAnimated(true);
4717
+ } else if (!once) {
4718
+ setIsAnimated(false);
4719
+ }
4720
+ },
4721
+ { threshold }
4722
+ );
4723
+ observer.observe(el);
4724
+ return () => observer.disconnect();
4725
+ }, [trigger, threshold, once]);
4726
+ const handleMouseEnter = trigger === "hover" ? () => setIsAnimated(true) : void 0;
4727
+ const handleMouseLeave = trigger === "hover" ? () => {
4728
+ if (!once || !hasAnimated.current) {
4729
+ hasAnimated.current = true;
4730
+ setIsAnimated(false);
4731
+ }
4732
+ } : void 0;
4733
+ React5.useEffect(() => {
4734
+ if (trigger === "manual" && manualAnimate !== void 0) {
4735
+ setIsAnimated(manualAnimate);
4736
+ }
4737
+ }, [trigger, manualAnimate]);
4738
+ const active = isAnimated;
4739
+ const currentStyle = active ? animatedStyles[animation] : initialStyles[animation];
4740
+ return /* @__PURE__ */ jsxRuntime.jsx(
4741
+ "div",
4742
+ {
4743
+ ref: setRef,
4744
+ className: cn("will-change-[opacity,transform]", className),
4745
+ style: {
4746
+ ...currentStyle,
4747
+ transitionProperty: "opacity, transform",
4748
+ transitionDuration: `${duration}ms`,
4749
+ transitionDelay: `${delay}ms`,
4750
+ transitionTimingFunction: easing,
4751
+ ...style
4752
+ },
4753
+ onMouseEnter: handleMouseEnter,
4754
+ onMouseLeave: handleMouseLeave,
4755
+ ...props,
4756
+ children: typeof children === "function" ? children(active) : children
4757
+ }
4758
+ );
4759
+ }
4760
+ );
4761
+ AnimatedReveal.displayName = "AnimatedReveal";
4762
+ function useFetchedSvg(src) {
4763
+ const [svg, setSvg] = React5.useState(null);
4764
+ const cache = React5.useRef({});
4765
+ React5.useEffect(() => {
4766
+ if (!src) {
4767
+ setSvg(null);
4768
+ return;
4769
+ }
4770
+ if (cache.current[src]) {
4771
+ setSvg(cache.current[src]);
4772
+ return;
4773
+ }
4774
+ let cancelled = false;
4775
+ fetch(src).then((res) => {
4776
+ if (!res.ok) throw new Error(`Failed to fetch SVG: ${res.status}`);
4777
+ return res.text();
4778
+ }).then((text) => {
4779
+ if (cancelled) return;
4780
+ cache.current[src] = text;
4781
+ setSvg(text);
4782
+ }).catch(() => {
4783
+ if (!cancelled) setSvg(null);
4784
+ });
4785
+ return () => {
4786
+ cancelled = true;
4787
+ };
4788
+ }, [src]);
4789
+ return svg;
4790
+ }
4791
+ function applyDrawAnimation(container, animate, duration, delay, easing) {
4792
+ const paths = container.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
4793
+ paths.forEach((el) => {
4794
+ if ("getTotalLength" in el && typeof el.getTotalLength === "function") {
4795
+ const len = el.getTotalLength();
4796
+ el.style.strokeDasharray = `${len}`;
4797
+ el.style.strokeDashoffset = animate ? "0" : `${len}`;
4798
+ el.style.transition = `stroke-dashoffset ${duration}ms ${easing} ${delay}ms`;
4799
+ }
4800
+ });
4801
+ }
4802
+ function applyFillAnimation(container, animate, duration, delay, easing, fillColor) {
4803
+ const paths = container.querySelectorAll("path, circle, ellipse, rect, polygon");
4804
+ paths.forEach((el) => {
4805
+ if ("getTotalLength" in el && typeof el.getTotalLength === "function") {
4806
+ const geom = el;
4807
+ const len = geom.getTotalLength();
4808
+ geom.style.strokeDasharray = `${len}`;
4809
+ geom.style.strokeDashoffset = animate ? "0" : `${len}`;
4810
+ geom.style.transition = `stroke-dashoffset ${duration * 0.6}ms ${easing} ${delay}ms, fill-opacity ${duration * 0.4}ms ${easing} ${delay + duration * 0.6}ms`;
4811
+ }
4812
+ if (fillColor) el.style.fill = fillColor;
4813
+ el.style.fillOpacity = animate ? "1" : "0";
4814
+ });
4815
+ }
4816
+ function applyPulseAnimation(container, animate, duration) {
4817
+ const svg = container.querySelector("svg");
4818
+ if (!svg) return;
4819
+ if (animate) {
4820
+ svg.style.animation = `ag-pulse ${duration}ms ease-in-out infinite`;
4821
+ } else {
4822
+ svg.style.animation = "none";
4823
+ }
4824
+ }
4825
+ function applyMorphAnimation(container, animate, duration, delay, easing) {
4826
+ const paths = container.querySelectorAll("path, circle, ellipse, rect, polygon");
4827
+ paths.forEach((el) => {
4828
+ el.style.transition = `all ${duration}ms ${easing} ${delay}ms`;
4829
+ el.style.transform = animate ? "scale(1)" : "scale(0)";
4830
+ el.style.transformOrigin = "center";
4831
+ el.style.opacity = animate ? "1" : "0";
4832
+ });
4833
+ }
4834
+ var AnimatedGraphic = React5__default.default.forwardRef(
4835
+ ({
4836
+ src,
4837
+ svgContent,
4838
+ animation = "draw",
4839
+ animate = false,
4840
+ duration = 1200,
4841
+ delay = 0,
4842
+ easing = "cubic-bezier(0.16, 1, 0.3, 1)",
4843
+ width,
4844
+ height,
4845
+ strokeColor,
4846
+ fillColor,
4847
+ alt,
4848
+ className,
4849
+ style,
4850
+ children,
4851
+ ...props
4852
+ }, ref) => {
4853
+ const containerRef = React5.useRef(null);
4854
+ const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
4855
+ const resolvedSvg = svgContent ?? fetchedSvg;
4856
+ const prevAnimateRef = React5.useRef(animate);
4857
+ const setRef = React5__default.default.useCallback(
4858
+ (node) => {
4859
+ containerRef.current = node;
4860
+ if (typeof ref === "function") ref(node);
4861
+ else if (ref) ref.current = node;
4862
+ },
4863
+ [ref]
4864
+ );
4865
+ React5.useEffect(() => {
4866
+ const el = containerRef.current;
4867
+ if (!el || !strokeColor) return;
4868
+ const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
4869
+ paths.forEach((p) => {
4870
+ p.style.stroke = strokeColor;
4871
+ });
4872
+ }, [resolvedSvg, strokeColor]);
4873
+ React5.useEffect(() => {
4874
+ const el = containerRef.current;
4875
+ if (!el || !resolvedSvg) return;
4876
+ if (animation === "draw" || animation === "fill") {
4877
+ const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
4878
+ paths.forEach((p) => {
4879
+ if ("getTotalLength" in p && typeof p.getTotalLength === "function") {
4880
+ const len = p.getTotalLength();
4881
+ p.style.strokeDasharray = `${len}`;
4882
+ p.style.strokeDashoffset = `${len}`;
4883
+ }
4884
+ if (animation === "fill") {
4885
+ p.style.fillOpacity = "0";
4886
+ }
4887
+ });
4888
+ }
4889
+ if (animation === "morph") {
4890
+ const paths = el.querySelectorAll("path, circle, ellipse, rect, polygon");
4891
+ paths.forEach((p) => {
4892
+ p.style.transform = "scale(0)";
4893
+ p.style.transformOrigin = "center";
4894
+ p.style.opacity = "0";
4895
+ });
4896
+ }
4897
+ }, [resolvedSvg, animation]);
4898
+ React5.useEffect(() => {
4899
+ const el = containerRef.current;
4900
+ if (!el) return;
4901
+ const id = requestAnimationFrame(() => {
4902
+ switch (animation) {
4903
+ case "draw":
4904
+ applyDrawAnimation(el, animate, duration, delay, easing);
4905
+ break;
4906
+ case "fill":
4907
+ applyFillAnimation(el, animate, duration, delay, easing, fillColor);
4908
+ break;
4909
+ case "pulse":
4910
+ applyPulseAnimation(el, animate, duration);
4911
+ break;
4912
+ case "morph":
4913
+ applyMorphAnimation(el, animate, duration, delay, easing);
4914
+ break;
4915
+ }
4916
+ });
4917
+ prevAnimateRef.current = animate;
4918
+ return () => cancelAnimationFrame(id);
4919
+ }, [animate, animation, duration, delay, easing, fillColor, resolvedSvg]);
4920
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4921
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: `@keyframes ag-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.04); opacity: 0.85; } }` }),
4922
+ /* @__PURE__ */ jsxRuntime.jsx(
4923
+ "div",
4924
+ {
4925
+ ref: setRef,
4926
+ className: cn("inline-flex items-center justify-center", className),
4927
+ style: { width, height, ...style },
4928
+ role: alt ? "img" : void 0,
4929
+ "aria-label": alt,
4930
+ ...props,
4931
+ children: resolvedSvg ? /* @__PURE__ */ jsxRuntime.jsx(
4932
+ "div",
4933
+ {
4934
+ className: "w-full h-full [&>svg]:w-full [&>svg]:h-full",
4935
+ dangerouslySetInnerHTML: { __html: resolvedSvg }
4936
+ }
4937
+ ) : children
4938
+ }
4939
+ )
4940
+ ] });
4941
+ }
4942
+ );
4943
+ AnimatedGraphic.displayName = "AnimatedGraphic";
4662
4944
  var PI = Math.PI;
4663
4945
  function lineIntersection(x1, y1, x2, y2, x3, y3, x4, y4) {
4664
4946
  const denom = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
@@ -5675,6 +5957,8 @@ var EdgeDecoration = ({
5675
5957
  EdgeDecoration.displayName = "EdgeDecoration";
5676
5958
 
5677
5959
  exports.AnimatedCounter = AnimatedCounter;
5960
+ exports.AnimatedGraphic = AnimatedGraphic;
5961
+ exports.AnimatedReveal = AnimatedReveal;
5678
5962
  exports.ArticleSection = ArticleSection;
5679
5963
  exports.Badge = Badge;
5680
5964
  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';