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