@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.
- package/dist/components/atoms/AnimatedGraphic.d.ts +29 -0
- package/dist/components/atoms/AnimatedReveal.d.ts +24 -0
- package/dist/components/atoms/index.d.ts +2 -0
- package/dist/components/index.cjs +1420 -1074
- package/dist/components/index.js +558 -214
- package/dist/components/organisms/debug/RuntimeDebugger.d.ts +2 -2
- package/dist/lib/index.cjs +62 -50
- package/dist/lib/index.js +62 -50
- package/dist/marketing/index.cjs +293 -10
- package/dist/marketing/index.d.cts +54 -1
- package/dist/marketing/index.d.ts +4 -0
- package/dist/marketing/index.js +293 -12
- package/dist/providers/index.cjs +445 -149
- package/dist/providers/index.js +357 -61
- package/dist/runtime/index.cjs +1344 -966
- package/dist/runtime/index.js +585 -207
- package/package.json +1 -1
package/dist/marketing/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React5, { createContext, useCallback,
|
|
1
|
+
import React5, { createContext, useCallback, useState, useRef, useEffect, useContext, useId } from 'react';
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import * as LucideIcons from 'lucide-react';
|
|
4
4
|
import { Loader2, Check, User } from 'lucide-react';
|
|
@@ -3507,18 +3507,14 @@ var InstallBox = ({
|
|
|
3507
3507
|
/* @__PURE__ */ jsx(
|
|
3508
3508
|
Box,
|
|
3509
3509
|
{
|
|
3510
|
-
className:
|
|
3511
|
-
"bg-foreground",
|
|
3512
|
-
"rounded-md",
|
|
3513
|
-
"border-[length:var(--border-width)] border-border"
|
|
3514
|
-
),
|
|
3510
|
+
className: "bg-surface rounded-md border-[length:var(--border-width)] border-border",
|
|
3515
3511
|
padding: "md",
|
|
3516
|
-
children: /* @__PURE__ */ jsxs(
|
|
3512
|
+
children: /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-3", children: [
|
|
3517
3513
|
/* @__PURE__ */ jsx(
|
|
3518
3514
|
Typography,
|
|
3519
3515
|
{
|
|
3520
3516
|
variant: "body2",
|
|
3521
|
-
className: "font-mono flex-1 min-w-0
|
|
3517
|
+
className: "font-mono flex-1 min-w-0 select-all",
|
|
3522
3518
|
truncate: true,
|
|
3523
3519
|
children: command
|
|
3524
3520
|
}
|
|
@@ -3527,10 +3523,12 @@ var InstallBox = ({
|
|
|
3527
3523
|
Button,
|
|
3528
3524
|
{
|
|
3529
3525
|
variant: "ghost",
|
|
3530
|
-
size: "
|
|
3526
|
+
size: "sm",
|
|
3527
|
+
leftIcon: copied ? "check" : "copy",
|
|
3531
3528
|
onClick: handleCopy,
|
|
3532
|
-
className: "flex-shrink-0
|
|
3533
|
-
|
|
3529
|
+
className: "flex-shrink-0",
|
|
3530
|
+
"aria-label": copied ? "Copied" : "Copy to clipboard",
|
|
3531
|
+
children: copied ? "Copied" : "Copy"
|
|
3534
3532
|
}
|
|
3535
3533
|
)
|
|
3536
3534
|
] })
|
|
@@ -4635,6 +4633,289 @@ var AnimatedCounter = ({
|
|
|
4635
4633
|
] });
|
|
4636
4634
|
};
|
|
4637
4635
|
AnimatedCounter.displayName = "AnimatedCounter";
|
|
4636
|
+
var initialStyles = {
|
|
4637
|
+
"fade-up": { opacity: 0, transform: "translateY(24px)" },
|
|
4638
|
+
"fade-down": { opacity: 0, transform: "translateY(-24px)" },
|
|
4639
|
+
"fade-in": { opacity: 0 },
|
|
4640
|
+
"fade-left": { opacity: 0, transform: "translateX(24px)" },
|
|
4641
|
+
"fade-right": { opacity: 0, transform: "translateX(-24px)" },
|
|
4642
|
+
"scale": { opacity: 0, transform: "scale(0.92)" },
|
|
4643
|
+
"scale-up": { opacity: 0, transform: "scale(0.92) translateY(16px)" },
|
|
4644
|
+
"none": {}
|
|
4645
|
+
};
|
|
4646
|
+
var animatedStyles = {
|
|
4647
|
+
"fade-up": { opacity: 1, transform: "translateY(0)" },
|
|
4648
|
+
"fade-down": { opacity: 1, transform: "translateY(0)" },
|
|
4649
|
+
"fade-in": { opacity: 1 },
|
|
4650
|
+
"fade-left": { opacity: 1, transform: "translateX(0)" },
|
|
4651
|
+
"fade-right": { opacity: 1, transform: "translateX(0)" },
|
|
4652
|
+
"scale": { opacity: 1, transform: "scale(1)" },
|
|
4653
|
+
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
4654
|
+
"none": {}
|
|
4655
|
+
};
|
|
4656
|
+
var AnimatedReveal = React5.forwardRef(
|
|
4657
|
+
({
|
|
4658
|
+
trigger = "scroll",
|
|
4659
|
+
animation = "fade-up",
|
|
4660
|
+
duration = 600,
|
|
4661
|
+
delay = 0,
|
|
4662
|
+
threshold = 0.15,
|
|
4663
|
+
once = true,
|
|
4664
|
+
animate: manualAnimate,
|
|
4665
|
+
easing = "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
4666
|
+
children,
|
|
4667
|
+
className,
|
|
4668
|
+
style,
|
|
4669
|
+
...props
|
|
4670
|
+
}, forwardedRef) => {
|
|
4671
|
+
const [isAnimated, setIsAnimated] = useState(false);
|
|
4672
|
+
const internalRef = useRef(null);
|
|
4673
|
+
const hasAnimated = useRef(false);
|
|
4674
|
+
const setRef = useCallback(
|
|
4675
|
+
(node) => {
|
|
4676
|
+
internalRef.current = node;
|
|
4677
|
+
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
4678
|
+
else if (forwardedRef) forwardedRef.current = node;
|
|
4679
|
+
},
|
|
4680
|
+
[forwardedRef]
|
|
4681
|
+
);
|
|
4682
|
+
useEffect(() => {
|
|
4683
|
+
if (trigger !== "scroll") return;
|
|
4684
|
+
const el = internalRef.current;
|
|
4685
|
+
if (!el) return;
|
|
4686
|
+
const observer = new IntersectionObserver(
|
|
4687
|
+
([entry]) => {
|
|
4688
|
+
if (entry.isIntersecting) {
|
|
4689
|
+
if (once && hasAnimated.current) return;
|
|
4690
|
+
hasAnimated.current = true;
|
|
4691
|
+
setIsAnimated(true);
|
|
4692
|
+
} else if (!once) {
|
|
4693
|
+
setIsAnimated(false);
|
|
4694
|
+
}
|
|
4695
|
+
},
|
|
4696
|
+
{ threshold }
|
|
4697
|
+
);
|
|
4698
|
+
observer.observe(el);
|
|
4699
|
+
return () => observer.disconnect();
|
|
4700
|
+
}, [trigger, threshold, once]);
|
|
4701
|
+
const handleMouseEnter = trigger === "hover" ? () => setIsAnimated(true) : void 0;
|
|
4702
|
+
const handleMouseLeave = trigger === "hover" ? () => {
|
|
4703
|
+
if (!once || !hasAnimated.current) {
|
|
4704
|
+
hasAnimated.current = true;
|
|
4705
|
+
setIsAnimated(false);
|
|
4706
|
+
}
|
|
4707
|
+
} : void 0;
|
|
4708
|
+
useEffect(() => {
|
|
4709
|
+
if (trigger === "manual" && manualAnimate !== void 0) {
|
|
4710
|
+
setIsAnimated(manualAnimate);
|
|
4711
|
+
}
|
|
4712
|
+
}, [trigger, manualAnimate]);
|
|
4713
|
+
const active = isAnimated;
|
|
4714
|
+
const currentStyle = active ? animatedStyles[animation] : initialStyles[animation];
|
|
4715
|
+
return /* @__PURE__ */ jsx(
|
|
4716
|
+
"div",
|
|
4717
|
+
{
|
|
4718
|
+
ref: setRef,
|
|
4719
|
+
className: cn("will-change-[opacity,transform]", className),
|
|
4720
|
+
style: {
|
|
4721
|
+
...currentStyle,
|
|
4722
|
+
transitionProperty: "opacity, transform",
|
|
4723
|
+
transitionDuration: `${duration}ms`,
|
|
4724
|
+
transitionDelay: `${delay}ms`,
|
|
4725
|
+
transitionTimingFunction: easing,
|
|
4726
|
+
...style
|
|
4727
|
+
},
|
|
4728
|
+
onMouseEnter: handleMouseEnter,
|
|
4729
|
+
onMouseLeave: handleMouseLeave,
|
|
4730
|
+
...props,
|
|
4731
|
+
children: typeof children === "function" ? children(active) : children
|
|
4732
|
+
}
|
|
4733
|
+
);
|
|
4734
|
+
}
|
|
4735
|
+
);
|
|
4736
|
+
AnimatedReveal.displayName = "AnimatedReveal";
|
|
4737
|
+
function useFetchedSvg(src) {
|
|
4738
|
+
const [svg, setSvg] = useState(null);
|
|
4739
|
+
const cache = useRef({});
|
|
4740
|
+
useEffect(() => {
|
|
4741
|
+
if (!src) {
|
|
4742
|
+
setSvg(null);
|
|
4743
|
+
return;
|
|
4744
|
+
}
|
|
4745
|
+
if (cache.current[src]) {
|
|
4746
|
+
setSvg(cache.current[src]);
|
|
4747
|
+
return;
|
|
4748
|
+
}
|
|
4749
|
+
let cancelled = false;
|
|
4750
|
+
fetch(src).then((res) => {
|
|
4751
|
+
if (!res.ok) throw new Error(`Failed to fetch SVG: ${res.status}`);
|
|
4752
|
+
return res.text();
|
|
4753
|
+
}).then((text) => {
|
|
4754
|
+
if (cancelled) return;
|
|
4755
|
+
cache.current[src] = text;
|
|
4756
|
+
setSvg(text);
|
|
4757
|
+
}).catch(() => {
|
|
4758
|
+
if (!cancelled) setSvg(null);
|
|
4759
|
+
});
|
|
4760
|
+
return () => {
|
|
4761
|
+
cancelled = true;
|
|
4762
|
+
};
|
|
4763
|
+
}, [src]);
|
|
4764
|
+
return svg;
|
|
4765
|
+
}
|
|
4766
|
+
function applyDrawAnimation(container, animate, duration, delay, easing) {
|
|
4767
|
+
const paths = container.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
4768
|
+
paths.forEach((el) => {
|
|
4769
|
+
if ("getTotalLength" in el && typeof el.getTotalLength === "function") {
|
|
4770
|
+
const len = el.getTotalLength();
|
|
4771
|
+
el.style.strokeDasharray = `${len}`;
|
|
4772
|
+
el.style.strokeDashoffset = animate ? "0" : `${len}`;
|
|
4773
|
+
el.style.transition = `stroke-dashoffset ${duration}ms ${easing} ${delay}ms`;
|
|
4774
|
+
}
|
|
4775
|
+
});
|
|
4776
|
+
}
|
|
4777
|
+
function applyFillAnimation(container, animate, duration, delay, easing, fillColor) {
|
|
4778
|
+
const paths = container.querySelectorAll("path, circle, ellipse, rect, polygon");
|
|
4779
|
+
paths.forEach((el) => {
|
|
4780
|
+
if ("getTotalLength" in el && typeof el.getTotalLength === "function") {
|
|
4781
|
+
const geom = el;
|
|
4782
|
+
const len = geom.getTotalLength();
|
|
4783
|
+
geom.style.strokeDasharray = `${len}`;
|
|
4784
|
+
geom.style.strokeDashoffset = animate ? "0" : `${len}`;
|
|
4785
|
+
geom.style.transition = `stroke-dashoffset ${duration * 0.6}ms ${easing} ${delay}ms, fill-opacity ${duration * 0.4}ms ${easing} ${delay + duration * 0.6}ms`;
|
|
4786
|
+
}
|
|
4787
|
+
if (fillColor) el.style.fill = fillColor;
|
|
4788
|
+
el.style.fillOpacity = animate ? "1" : "0";
|
|
4789
|
+
});
|
|
4790
|
+
}
|
|
4791
|
+
function applyPulseAnimation(container, animate, duration) {
|
|
4792
|
+
const svg = container.querySelector("svg");
|
|
4793
|
+
if (!svg) return;
|
|
4794
|
+
if (animate) {
|
|
4795
|
+
svg.style.animation = `ag-pulse ${duration}ms ease-in-out infinite`;
|
|
4796
|
+
} else {
|
|
4797
|
+
svg.style.animation = "none";
|
|
4798
|
+
}
|
|
4799
|
+
}
|
|
4800
|
+
function applyMorphAnimation(container, animate, duration, delay, easing) {
|
|
4801
|
+
const paths = container.querySelectorAll("path, circle, ellipse, rect, polygon");
|
|
4802
|
+
paths.forEach((el) => {
|
|
4803
|
+
el.style.transition = `all ${duration}ms ${easing} ${delay}ms`;
|
|
4804
|
+
el.style.transform = animate ? "scale(1)" : "scale(0)";
|
|
4805
|
+
el.style.transformOrigin = "center";
|
|
4806
|
+
el.style.opacity = animate ? "1" : "0";
|
|
4807
|
+
});
|
|
4808
|
+
}
|
|
4809
|
+
var AnimatedGraphic = React5.forwardRef(
|
|
4810
|
+
({
|
|
4811
|
+
src,
|
|
4812
|
+
svgContent,
|
|
4813
|
+
animation = "draw",
|
|
4814
|
+
animate = false,
|
|
4815
|
+
duration = 1200,
|
|
4816
|
+
delay = 0,
|
|
4817
|
+
easing = "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
4818
|
+
width,
|
|
4819
|
+
height,
|
|
4820
|
+
strokeColor,
|
|
4821
|
+
fillColor,
|
|
4822
|
+
alt,
|
|
4823
|
+
className,
|
|
4824
|
+
style,
|
|
4825
|
+
children,
|
|
4826
|
+
...props
|
|
4827
|
+
}, ref) => {
|
|
4828
|
+
const containerRef = useRef(null);
|
|
4829
|
+
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
4830
|
+
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
4831
|
+
const prevAnimateRef = useRef(animate);
|
|
4832
|
+
const setRef = React5.useCallback(
|
|
4833
|
+
(node) => {
|
|
4834
|
+
containerRef.current = node;
|
|
4835
|
+
if (typeof ref === "function") ref(node);
|
|
4836
|
+
else if (ref) ref.current = node;
|
|
4837
|
+
},
|
|
4838
|
+
[ref]
|
|
4839
|
+
);
|
|
4840
|
+
useEffect(() => {
|
|
4841
|
+
const el = containerRef.current;
|
|
4842
|
+
if (!el || !strokeColor) return;
|
|
4843
|
+
const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
4844
|
+
paths.forEach((p) => {
|
|
4845
|
+
p.style.stroke = strokeColor;
|
|
4846
|
+
});
|
|
4847
|
+
}, [resolvedSvg, strokeColor]);
|
|
4848
|
+
useEffect(() => {
|
|
4849
|
+
const el = containerRef.current;
|
|
4850
|
+
if (!el || !resolvedSvg) return;
|
|
4851
|
+
if (animation === "draw" || animation === "fill") {
|
|
4852
|
+
const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
4853
|
+
paths.forEach((p) => {
|
|
4854
|
+
if ("getTotalLength" in p && typeof p.getTotalLength === "function") {
|
|
4855
|
+
const len = p.getTotalLength();
|
|
4856
|
+
p.style.strokeDasharray = `${len}`;
|
|
4857
|
+
p.style.strokeDashoffset = `${len}`;
|
|
4858
|
+
}
|
|
4859
|
+
if (animation === "fill") {
|
|
4860
|
+
p.style.fillOpacity = "0";
|
|
4861
|
+
}
|
|
4862
|
+
});
|
|
4863
|
+
}
|
|
4864
|
+
if (animation === "morph") {
|
|
4865
|
+
const paths = el.querySelectorAll("path, circle, ellipse, rect, polygon");
|
|
4866
|
+
paths.forEach((p) => {
|
|
4867
|
+
p.style.transform = "scale(0)";
|
|
4868
|
+
p.style.transformOrigin = "center";
|
|
4869
|
+
p.style.opacity = "0";
|
|
4870
|
+
});
|
|
4871
|
+
}
|
|
4872
|
+
}, [resolvedSvg, animation]);
|
|
4873
|
+
useEffect(() => {
|
|
4874
|
+
const el = containerRef.current;
|
|
4875
|
+
if (!el) return;
|
|
4876
|
+
const id = requestAnimationFrame(() => {
|
|
4877
|
+
switch (animation) {
|
|
4878
|
+
case "draw":
|
|
4879
|
+
applyDrawAnimation(el, animate, duration, delay, easing);
|
|
4880
|
+
break;
|
|
4881
|
+
case "fill":
|
|
4882
|
+
applyFillAnimation(el, animate, duration, delay, easing, fillColor);
|
|
4883
|
+
break;
|
|
4884
|
+
case "pulse":
|
|
4885
|
+
applyPulseAnimation(el, animate, duration);
|
|
4886
|
+
break;
|
|
4887
|
+
case "morph":
|
|
4888
|
+
applyMorphAnimation(el, animate, duration, delay, easing);
|
|
4889
|
+
break;
|
|
4890
|
+
}
|
|
4891
|
+
});
|
|
4892
|
+
prevAnimateRef.current = animate;
|
|
4893
|
+
return () => cancelAnimationFrame(id);
|
|
4894
|
+
}, [animate, animation, duration, delay, easing, fillColor, resolvedSvg]);
|
|
4895
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4896
|
+
/* @__PURE__ */ jsx("style", { children: `@keyframes ag-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.04); opacity: 0.85; } }` }),
|
|
4897
|
+
/* @__PURE__ */ jsx(
|
|
4898
|
+
"div",
|
|
4899
|
+
{
|
|
4900
|
+
ref: setRef,
|
|
4901
|
+
className: cn("inline-flex items-center justify-center", className),
|
|
4902
|
+
style: { width, height, ...style },
|
|
4903
|
+
role: alt ? "img" : void 0,
|
|
4904
|
+
"aria-label": alt,
|
|
4905
|
+
...props,
|
|
4906
|
+
children: resolvedSvg ? /* @__PURE__ */ jsx(
|
|
4907
|
+
"div",
|
|
4908
|
+
{
|
|
4909
|
+
className: "w-full h-full [&>svg]:w-full [&>svg]:h-full",
|
|
4910
|
+
dangerouslySetInnerHTML: { __html: resolvedSvg }
|
|
4911
|
+
}
|
|
4912
|
+
) : children
|
|
4913
|
+
}
|
|
4914
|
+
)
|
|
4915
|
+
] });
|
|
4916
|
+
}
|
|
4917
|
+
);
|
|
4918
|
+
AnimatedGraphic.displayName = "AnimatedGraphic";
|
|
4638
4919
|
var PI = Math.PI;
|
|
4639
4920
|
function lineIntersection(x1, y1, x2, y2, x3, y3, x4, y4) {
|
|
4640
4921
|
const denom = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);
|
|
@@ -5650,4 +5931,4 @@ var EdgeDecoration = ({
|
|
|
5650
5931
|
};
|
|
5651
5932
|
EdgeDecoration.displayName = "EdgeDecoration";
|
|
5652
5933
|
|
|
5653
|
-
export { AnimatedCounter, ArticleSection, Badge, Box, Button, CTABanner, Card, CaseStudyCard, Center, CommunityLinks, ContentSection, Divider, EdgeDecoration, FeatureCard, FeatureGrid, GeometricPattern, GradientDivider, HStack, HeroSection, Icon, InstallBox, MarketingFooter, PatternTile, PricingCard, PricingGrid, PullQuote, ServiceCatalog, ShowcaseCard, SimpleGrid, Spacer, SplitSection, StatsGrid, StepFlow, TagCloud, TeamCard, Typography, VStack, getTileDimensions };
|
|
5934
|
+
export { AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Badge, Box, Button, CTABanner, Card, CaseStudyCard, Center, CommunityLinks, ContentSection, Divider, EdgeDecoration, FeatureCard, FeatureGrid, GeometricPattern, GradientDivider, HStack, HeroSection, Icon, InstallBox, MarketingFooter, PatternTile, PricingCard, PricingGrid, PullQuote, ServiceCatalog, ShowcaseCard, SimpleGrid, Spacer, SplitSection, StatsGrid, StepFlow, TagCloud, TeamCard, Typography, VStack, getTileDimensions };
|