@almadar/ui 5.30.0 → 5.31.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.
- package/dist/avl/index.cjs +401 -177
- package/dist/avl/index.js +401 -177
- package/dist/components/core/atoms/Card.d.ts +2 -0
- package/dist/components/core/atoms/Input.d.ts +2 -0
- package/dist/components/core/atoms/Select.d.ts +18 -6
- package/dist/components/core/atoms/Spinner.d.ts +2 -0
- package/dist/components/core/atoms/index.d.ts +1 -1
- package/dist/components/core/molecules/JsonTreeEditor.d.ts +3 -8
- package/dist/components/core/molecules/Menu.d.ts +4 -0
- package/dist/components/core/molecules/index.d.ts +1 -1
- package/dist/components/core/organisms/index.d.ts +0 -1
- package/dist/components/core/templates/index.d.ts +0 -3
- package/dist/components/game/molecules/index.d.ts +0 -1
- package/dist/components/game/molecules/three/patterns.d.ts +20 -0
- package/dist/components/index.cjs +428 -385
- package/dist/components/index.js +429 -385
- package/dist/docs/index.cjs +205 -172
- package/dist/docs/index.d.cts +4 -0
- package/dist/docs/index.js +146 -113
- package/dist/marketing/index.cjs +91 -54
- package/dist/marketing/index.d.cts +2 -0
- package/dist/marketing/index.js +58 -21
- package/dist/providers/index.cjs +400 -176
- package/dist/providers/index.js +400 -176
- package/dist/runtime/index.cjs +400 -176
- package/dist/runtime/index.js +400 -176
- package/package.json +16 -2
package/dist/marketing/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React9 = require('react');
|
|
4
4
|
var logger = require('@almadar/logger');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var LucideIcons2 = require('lucide-react');
|
|
@@ -28,7 +28,7 @@ function _interopNamespace(e) {
|
|
|
28
28
|
return Object.freeze(n);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var React9__default = /*#__PURE__*/_interopDefault(React9);
|
|
32
32
|
var LucideIcons2__namespace = /*#__PURE__*/_interopNamespace(LucideIcons2);
|
|
33
33
|
var PhosphorIcons__namespace = /*#__PURE__*/_interopNamespace(PhosphorIcons);
|
|
34
34
|
var TablerIcons__namespace = /*#__PURE__*/_interopNamespace(TablerIcons);
|
|
@@ -2515,10 +2515,10 @@ function cn(...inputs) {
|
|
|
2515
2515
|
}
|
|
2516
2516
|
logger.createLogger("almadar:eventbus");
|
|
2517
2517
|
logger.createLogger("almadar:eventbus:subscribe");
|
|
2518
|
-
var EventBusContext =
|
|
2519
|
-
var TraitScopeContext =
|
|
2518
|
+
var EventBusContext = React9.createContext(null);
|
|
2519
|
+
var TraitScopeContext = React9.createContext(null);
|
|
2520
2520
|
function useTraitScope() {
|
|
2521
|
-
return
|
|
2521
|
+
return React9.useContext(TraitScopeContext);
|
|
2522
2522
|
}
|
|
2523
2523
|
var log = logger.createLogger("almadar:eventbus");
|
|
2524
2524
|
var subLog2 = logger.createLogger("almadar:eventbus:subscribe");
|
|
@@ -2594,10 +2594,10 @@ var fallbackEventBus = {
|
|
|
2594
2594
|
}
|
|
2595
2595
|
};
|
|
2596
2596
|
function useEventBus() {
|
|
2597
|
-
const context =
|
|
2597
|
+
const context = React9.useContext(EventBusContext);
|
|
2598
2598
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
2599
2599
|
const scope = useTraitScope();
|
|
2600
|
-
return
|
|
2600
|
+
return React9.useMemo(() => {
|
|
2601
2601
|
if (!scope) {
|
|
2602
2602
|
return {
|
|
2603
2603
|
...baseBus,
|
|
@@ -2735,7 +2735,7 @@ var positionStyles = {
|
|
|
2735
2735
|
fixed: "fixed",
|
|
2736
2736
|
sticky: "sticky"
|
|
2737
2737
|
};
|
|
2738
|
-
var Box =
|
|
2738
|
+
var Box = React9__default.default.forwardRef(
|
|
2739
2739
|
({
|
|
2740
2740
|
padding,
|
|
2741
2741
|
paddingX,
|
|
@@ -2765,27 +2765,27 @@ var Box = React8__default.default.forwardRef(
|
|
|
2765
2765
|
...rest
|
|
2766
2766
|
}, ref) => {
|
|
2767
2767
|
const eventBus = useEventBus();
|
|
2768
|
-
const handleClick =
|
|
2768
|
+
const handleClick = React9.useCallback((e) => {
|
|
2769
2769
|
if (action) {
|
|
2770
2770
|
e.stopPropagation();
|
|
2771
2771
|
eventBus.emit(`UI:${action}`, actionPayload ?? {});
|
|
2772
2772
|
}
|
|
2773
2773
|
onClick?.(e);
|
|
2774
2774
|
}, [action, actionPayload, eventBus, onClick]);
|
|
2775
|
-
const handleMouseEnter =
|
|
2775
|
+
const handleMouseEnter = React9.useCallback((e) => {
|
|
2776
2776
|
if (hoverEvent) {
|
|
2777
2777
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
|
|
2778
2778
|
}
|
|
2779
2779
|
onMouseEnter?.(e);
|
|
2780
2780
|
}, [hoverEvent, eventBus, onMouseEnter]);
|
|
2781
|
-
const handleMouseLeave =
|
|
2781
|
+
const handleMouseLeave = React9.useCallback((e) => {
|
|
2782
2782
|
if (hoverEvent) {
|
|
2783
2783
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
|
|
2784
2784
|
}
|
|
2785
2785
|
onMouseLeave?.(e);
|
|
2786
2786
|
}, [hoverEvent, eventBus, onMouseLeave]);
|
|
2787
2787
|
const isClickable = action || onClick;
|
|
2788
|
-
return
|
|
2788
|
+
return React9__default.default.createElement(
|
|
2789
2789
|
Component,
|
|
2790
2790
|
{
|
|
2791
2791
|
ref,
|
|
@@ -3054,7 +3054,7 @@ function getIconFamilyServerSnapshot() {
|
|
|
3054
3054
|
return DEFAULT_FAMILY;
|
|
3055
3055
|
}
|
|
3056
3056
|
function useIconFamily() {
|
|
3057
|
-
return
|
|
3057
|
+
return React9.useSyncExternalStore(
|
|
3058
3058
|
subscribeIconFamily,
|
|
3059
3059
|
getIconFamilySnapshot,
|
|
3060
3060
|
getIconFamilyServerSnapshot
|
|
@@ -3747,7 +3747,7 @@ var Icon = ({
|
|
|
3747
3747
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
3748
3748
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
3749
3749
|
const family = useIconFamily();
|
|
3750
|
-
const RenderedComponent =
|
|
3750
|
+
const RenderedComponent = React9__default.default.useMemo(() => {
|
|
3751
3751
|
if (directIcon) return null;
|
|
3752
3752
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
3753
3753
|
}, [directIcon, effectiveName, family]);
|
|
@@ -3864,7 +3864,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
3864
3864
|
const IconComp = value;
|
|
3865
3865
|
return /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: sizeClass });
|
|
3866
3866
|
}
|
|
3867
|
-
if (
|
|
3867
|
+
if (React9__default.default.isValidElement(value)) {
|
|
3868
3868
|
return value;
|
|
3869
3869
|
}
|
|
3870
3870
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -3873,7 +3873,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
3873
3873
|
}
|
|
3874
3874
|
return value;
|
|
3875
3875
|
}
|
|
3876
|
-
var Button =
|
|
3876
|
+
var Button = React9__default.default.forwardRef(
|
|
3877
3877
|
({
|
|
3878
3878
|
className,
|
|
3879
3879
|
variant = "primary",
|
|
@@ -3969,7 +3969,7 @@ var sizeStyles2 = {
|
|
|
3969
3969
|
md: "px-2.5 py-1 text-sm",
|
|
3970
3970
|
lg: "px-3 py-1.5 text-base"
|
|
3971
3971
|
};
|
|
3972
|
-
var Badge =
|
|
3972
|
+
var Badge = React9__default.default.forwardRef(
|
|
3973
3973
|
({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
|
|
3974
3974
|
const iconSizes = {
|
|
3975
3975
|
sm: "h-icon-default w-icon-default",
|
|
@@ -4016,6 +4016,41 @@ var Badge = React8__default.default.forwardRef(
|
|
|
4016
4016
|
}
|
|
4017
4017
|
);
|
|
4018
4018
|
Badge.displayName = "Badge";
|
|
4019
|
+
var sizeStyles3 = {
|
|
4020
|
+
xs: "h-3 w-3",
|
|
4021
|
+
sm: "h-icon-default w-icon-default",
|
|
4022
|
+
md: "h-6 w-6",
|
|
4023
|
+
lg: "h-8 w-8"
|
|
4024
|
+
};
|
|
4025
|
+
var Spinner = React9__default.default.forwardRef(
|
|
4026
|
+
({ className, size = "md", overlay, ...props }, ref) => {
|
|
4027
|
+
if (overlay) {
|
|
4028
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4029
|
+
"div",
|
|
4030
|
+
{
|
|
4031
|
+
ref,
|
|
4032
|
+
className: cn(
|
|
4033
|
+
"absolute inset-0 z-10 flex items-center justify-center",
|
|
4034
|
+
"bg-background/60 backdrop-blur-sm",
|
|
4035
|
+
className
|
|
4036
|
+
),
|
|
4037
|
+
...props,
|
|
4038
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "loader", className: cn("animate-spin text-foreground", sizeStyles3[size]) })
|
|
4039
|
+
}
|
|
4040
|
+
);
|
|
4041
|
+
}
|
|
4042
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4043
|
+
"div",
|
|
4044
|
+
{
|
|
4045
|
+
ref,
|
|
4046
|
+
className: cn("text-foreground", className),
|
|
4047
|
+
...props,
|
|
4048
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "loader", className: cn("animate-spin", sizeStyles3[size]) })
|
|
4049
|
+
}
|
|
4050
|
+
);
|
|
4051
|
+
}
|
|
4052
|
+
);
|
|
4053
|
+
Spinner.displayName = "Spinner";
|
|
4019
4054
|
var variantStyles4 = {
|
|
4020
4055
|
default: [
|
|
4021
4056
|
"bg-card",
|
|
@@ -4069,7 +4104,7 @@ var lookStyles = {
|
|
|
4069
4104
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
4070
4105
|
"tile-image-first": "p-0 overflow-hidden"
|
|
4071
4106
|
};
|
|
4072
|
-
var Card =
|
|
4107
|
+
var Card = React9__default.default.forwardRef(
|
|
4073
4108
|
({
|
|
4074
4109
|
className,
|
|
4075
4110
|
variant = "bordered",
|
|
@@ -4080,6 +4115,7 @@ var Card = React8__default.default.forwardRef(
|
|
|
4080
4115
|
look = "elevated",
|
|
4081
4116
|
children,
|
|
4082
4117
|
action,
|
|
4118
|
+
loading,
|
|
4083
4119
|
onClick,
|
|
4084
4120
|
...props
|
|
4085
4121
|
}, ref) => {
|
|
@@ -4093,7 +4129,7 @@ var Card = React8__default.default.forwardRef(
|
|
|
4093
4129
|
{
|
|
4094
4130
|
ref,
|
|
4095
4131
|
className: cn(
|
|
4096
|
-
"rounded-container",
|
|
4132
|
+
"rounded-container relative",
|
|
4097
4133
|
"transition-all duration-[var(--transition-normal)]",
|
|
4098
4134
|
variantStyles4[variant],
|
|
4099
4135
|
paddingStyles2[padding],
|
|
@@ -4104,6 +4140,7 @@ var Card = React8__default.default.forwardRef(
|
|
|
4104
4140
|
onClick: handleClick,
|
|
4105
4141
|
...props,
|
|
4106
4142
|
children: [
|
|
4143
|
+
loading && /* @__PURE__ */ jsxRuntime.jsx(Spinner, { overlay: true, size: "md" }),
|
|
4107
4144
|
(title || subtitle) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-4", children: [
|
|
4108
4145
|
title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg text-card-foreground font-bold", children: title }),
|
|
4109
4146
|
subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mt-1", children: subtitle })
|
|
@@ -4115,9 +4152,9 @@ var Card = React8__default.default.forwardRef(
|
|
|
4115
4152
|
}
|
|
4116
4153
|
);
|
|
4117
4154
|
Card.displayName = "Card";
|
|
4118
|
-
var CardHeader =
|
|
4155
|
+
var CardHeader = React9__default.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
4119
4156
|
CardHeader.displayName = "CardHeader";
|
|
4120
|
-
var CardTitle =
|
|
4157
|
+
var CardTitle = React9__default.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4121
4158
|
"h3",
|
|
4122
4159
|
{
|
|
4123
4160
|
ref,
|
|
@@ -4130,11 +4167,11 @@ var CardTitle = React8__default.default.forwardRef(({ className, ...props }, ref
|
|
|
4130
4167
|
}
|
|
4131
4168
|
));
|
|
4132
4169
|
CardTitle.displayName = "CardTitle";
|
|
4133
|
-
var CardContent =
|
|
4170
|
+
var CardContent = React9__default.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("", className), ...props }));
|
|
4134
4171
|
CardContent.displayName = "CardContent";
|
|
4135
4172
|
var CardBody = CardContent;
|
|
4136
4173
|
CardBody.displayName = "CardBody";
|
|
4137
|
-
var CardFooter =
|
|
4174
|
+
var CardFooter = React9__default.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4138
4175
|
"div",
|
|
4139
4176
|
{
|
|
4140
4177
|
ref,
|
|
@@ -4291,7 +4328,7 @@ var paddingClasses = {
|
|
|
4291
4328
|
md: "py-16",
|
|
4292
4329
|
lg: "py-24"
|
|
4293
4330
|
};
|
|
4294
|
-
var ContentSection =
|
|
4331
|
+
var ContentSection = React9__default.default.forwardRef(
|
|
4295
4332
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
4296
4333
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4297
4334
|
Box,
|
|
@@ -4315,8 +4352,8 @@ var InstallBox = ({
|
|
|
4315
4352
|
label,
|
|
4316
4353
|
className
|
|
4317
4354
|
}) => {
|
|
4318
|
-
const [copied, setCopied] =
|
|
4319
|
-
const handleCopy =
|
|
4355
|
+
const [copied, setCopied] = React9.useState(false);
|
|
4356
|
+
const handleCopy = React9.useCallback(() => {
|
|
4320
4357
|
void navigator.clipboard.writeText(command);
|
|
4321
4358
|
setCopied(true);
|
|
4322
4359
|
const timer = setTimeout(() => setCopied(false), 2e3);
|
|
@@ -4893,7 +4930,7 @@ var StepFlow = ({
|
|
|
4893
4930
|
className
|
|
4894
4931
|
}) => {
|
|
4895
4932
|
if (orientation === "vertical") {
|
|
4896
|
-
return /* @__PURE__ */ jsxRuntime.jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4933
|
+
return /* @__PURE__ */ jsxRuntime.jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsxRuntime.jsx(React9__default.default.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
4897
4934
|
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "none", align: "center", children: [
|
|
4898
4935
|
/* @__PURE__ */ jsxRuntime.jsx(StepCircle, { step, index }),
|
|
4899
4936
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -4904,7 +4941,7 @@ var StepFlow = ({
|
|
|
4904
4941
|
] })
|
|
4905
4942
|
] }) }, index)) });
|
|
4906
4943
|
}
|
|
4907
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4944
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxRuntime.jsxs(React9__default.default.Fragment, { children: [
|
|
4908
4945
|
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
4909
4946
|
/* @__PURE__ */ jsxRuntime.jsx(StepCircle, { step, index }),
|
|
4910
4947
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -5112,8 +5149,8 @@ var Avatar = ({
|
|
|
5112
5149
|
actionPayload
|
|
5113
5150
|
}) => {
|
|
5114
5151
|
const eventBus = useEventBus();
|
|
5115
|
-
const [imgFailed, setImgFailed] =
|
|
5116
|
-
|
|
5152
|
+
const [imgFailed, setImgFailed] = React9__default.default.useState(false);
|
|
5153
|
+
React9__default.default.useEffect(() => {
|
|
5117
5154
|
setImgFailed(false);
|
|
5118
5155
|
}, [src]);
|
|
5119
5156
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -5430,10 +5467,10 @@ var AnimatedCounter = ({
|
|
|
5430
5467
|
duration = 1500,
|
|
5431
5468
|
className
|
|
5432
5469
|
}) => {
|
|
5433
|
-
const ref =
|
|
5434
|
-
const [displayValue, setDisplayValue] =
|
|
5435
|
-
const [hasAnimated, setHasAnimated] =
|
|
5436
|
-
const animate =
|
|
5470
|
+
const ref = React9.useRef(null);
|
|
5471
|
+
const [displayValue, setDisplayValue] = React9.useState("0");
|
|
5472
|
+
const [hasAnimated, setHasAnimated] = React9.useState(false);
|
|
5473
|
+
const animate = React9.useCallback(() => {
|
|
5437
5474
|
const { num, prefix, suffix, decimals } = parseValue(value);
|
|
5438
5475
|
if (num === 0) {
|
|
5439
5476
|
setDisplayValue(String(value));
|
|
@@ -5454,7 +5491,7 @@ var AnimatedCounter = ({
|
|
|
5454
5491
|
};
|
|
5455
5492
|
requestAnimationFrame(tick);
|
|
5456
5493
|
}, [value, duration]);
|
|
5457
|
-
|
|
5494
|
+
React9.useEffect(() => {
|
|
5458
5495
|
if (hasAnimated) return;
|
|
5459
5496
|
const el = ref.current;
|
|
5460
5497
|
if (!el) return;
|
|
@@ -5504,7 +5541,7 @@ var animatedStyles = {
|
|
|
5504
5541
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
5505
5542
|
"none": {}
|
|
5506
5543
|
};
|
|
5507
|
-
var AnimatedReveal =
|
|
5544
|
+
var AnimatedReveal = React9__default.default.forwardRef(
|
|
5508
5545
|
({
|
|
5509
5546
|
trigger = "scroll",
|
|
5510
5547
|
animation = "fade-up",
|
|
@@ -5519,10 +5556,10 @@ var AnimatedReveal = React8__default.default.forwardRef(
|
|
|
5519
5556
|
style,
|
|
5520
5557
|
...props
|
|
5521
5558
|
}, forwardedRef) => {
|
|
5522
|
-
const [isAnimated, setIsAnimated] =
|
|
5523
|
-
const internalRef =
|
|
5524
|
-
const hasAnimated =
|
|
5525
|
-
const setRef =
|
|
5559
|
+
const [isAnimated, setIsAnimated] = React9.useState(false);
|
|
5560
|
+
const internalRef = React9.useRef(null);
|
|
5561
|
+
const hasAnimated = React9.useRef(false);
|
|
5562
|
+
const setRef = React9.useCallback(
|
|
5526
5563
|
(node) => {
|
|
5527
5564
|
internalRef.current = node;
|
|
5528
5565
|
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
@@ -5530,7 +5567,7 @@ var AnimatedReveal = React8__default.default.forwardRef(
|
|
|
5530
5567
|
},
|
|
5531
5568
|
[forwardedRef]
|
|
5532
5569
|
);
|
|
5533
|
-
|
|
5570
|
+
React9.useEffect(() => {
|
|
5534
5571
|
if (trigger !== "scroll") return;
|
|
5535
5572
|
const el = internalRef.current;
|
|
5536
5573
|
if (!el) return;
|
|
@@ -5556,7 +5593,7 @@ var AnimatedReveal = React8__default.default.forwardRef(
|
|
|
5556
5593
|
setIsAnimated(false);
|
|
5557
5594
|
}
|
|
5558
5595
|
} : void 0;
|
|
5559
|
-
|
|
5596
|
+
React9.useEffect(() => {
|
|
5560
5597
|
if (trigger === "manual" && manualAnimate !== void 0) {
|
|
5561
5598
|
setIsAnimated(manualAnimate);
|
|
5562
5599
|
}
|
|
@@ -5586,9 +5623,9 @@ var AnimatedReveal = React8__default.default.forwardRef(
|
|
|
5586
5623
|
);
|
|
5587
5624
|
AnimatedReveal.displayName = "AnimatedReveal";
|
|
5588
5625
|
function useFetchedSvg(src) {
|
|
5589
|
-
const [svg, setSvg] =
|
|
5590
|
-
const cache =
|
|
5591
|
-
|
|
5626
|
+
const [svg, setSvg] = React9.useState(null);
|
|
5627
|
+
const cache = React9.useRef({});
|
|
5628
|
+
React9.useEffect(() => {
|
|
5592
5629
|
if (!src) {
|
|
5593
5630
|
setSvg(null);
|
|
5594
5631
|
return;
|
|
@@ -5657,7 +5694,7 @@ function applyMorphAnimation(container, animate, duration, delay, easing) {
|
|
|
5657
5694
|
el.style.opacity = animate ? "1" : "0";
|
|
5658
5695
|
});
|
|
5659
5696
|
}
|
|
5660
|
-
var AnimatedGraphic =
|
|
5697
|
+
var AnimatedGraphic = React9__default.default.forwardRef(
|
|
5661
5698
|
({
|
|
5662
5699
|
src,
|
|
5663
5700
|
svgContent,
|
|
@@ -5676,11 +5713,11 @@ var AnimatedGraphic = React8__default.default.forwardRef(
|
|
|
5676
5713
|
children,
|
|
5677
5714
|
...props
|
|
5678
5715
|
}, ref) => {
|
|
5679
|
-
const containerRef =
|
|
5716
|
+
const containerRef = React9.useRef(null);
|
|
5680
5717
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
5681
5718
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
5682
|
-
const prevAnimateRef =
|
|
5683
|
-
const setRef =
|
|
5719
|
+
const prevAnimateRef = React9.useRef(animate);
|
|
5720
|
+
const setRef = React9__default.default.useCallback(
|
|
5684
5721
|
(node) => {
|
|
5685
5722
|
containerRef.current = node;
|
|
5686
5723
|
if (typeof ref === "function") ref(node);
|
|
@@ -5688,7 +5725,7 @@ var AnimatedGraphic = React8__default.default.forwardRef(
|
|
|
5688
5725
|
},
|
|
5689
5726
|
[ref]
|
|
5690
5727
|
);
|
|
5691
|
-
|
|
5728
|
+
React9.useEffect(() => {
|
|
5692
5729
|
const el = containerRef.current;
|
|
5693
5730
|
if (!el || !strokeColor) return;
|
|
5694
5731
|
const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
@@ -5696,7 +5733,7 @@ var AnimatedGraphic = React8__default.default.forwardRef(
|
|
|
5696
5733
|
p.style.stroke = strokeColor;
|
|
5697
5734
|
});
|
|
5698
5735
|
}, [resolvedSvg, strokeColor]);
|
|
5699
|
-
|
|
5736
|
+
React9.useEffect(() => {
|
|
5700
5737
|
const el = containerRef.current;
|
|
5701
5738
|
if (!el || !resolvedSvg) return;
|
|
5702
5739
|
if (animation === "draw" || animation === "fill") {
|
|
@@ -5721,7 +5758,7 @@ var AnimatedGraphic = React8__default.default.forwardRef(
|
|
|
5721
5758
|
});
|
|
5722
5759
|
}
|
|
5723
5760
|
}, [resolvedSvg, animation]);
|
|
5724
|
-
|
|
5761
|
+
React9.useEffect(() => {
|
|
5725
5762
|
const el = containerRef.current;
|
|
5726
5763
|
if (!el) return;
|
|
5727
5764
|
const id = requestAnimationFrame(() => {
|
|
@@ -6521,7 +6558,7 @@ var GeometricPattern = ({
|
|
|
6521
6558
|
children,
|
|
6522
6559
|
className
|
|
6523
6560
|
}) => {
|
|
6524
|
-
const reactId =
|
|
6561
|
+
const reactId = React9.useId();
|
|
6525
6562
|
const patternId = `gp${reactId.replace(/:/g, "")}`;
|
|
6526
6563
|
const size = 60 * scale;
|
|
6527
6564
|
const stripHeight = 40 * scale;
|
|
@@ -6756,7 +6793,7 @@ var EdgeDecoration = ({
|
|
|
6756
6793
|
width = 15,
|
|
6757
6794
|
className
|
|
6758
6795
|
}) => {
|
|
6759
|
-
const id =
|
|
6796
|
+
const id = React9.useId();
|
|
6760
6797
|
const Variant = VARIANT_MAP2[variant];
|
|
6761
6798
|
const resolvedColor = color in colorTokenVars2 ? colorTokenVars2[color] : color;
|
|
6762
6799
|
const sides = side === "both" ? ["left", "right"] : [side];
|
|
@@ -316,6 +316,8 @@ interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
316
316
|
children?: React.ReactNode;
|
|
317
317
|
/** Declarative event key emitted on click for trait dispatch */
|
|
318
318
|
action?: EventKey;
|
|
319
|
+
/** Shows a skeleton/spinner overlay while true. */
|
|
320
|
+
loading?: boolean;
|
|
319
321
|
}
|
|
320
322
|
declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
321
323
|
|
package/dist/marketing/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React9, { createContext, useCallback, useState, useRef, useEffect, useContext, useMemo, useSyncExternalStore, useId } from 'react';
|
|
2
2
|
import { createLogger } from '@almadar/logger';
|
|
3
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import * as LucideIcons2 from 'lucide-react';
|
|
@@ -2708,7 +2708,7 @@ var positionStyles = {
|
|
|
2708
2708
|
fixed: "fixed",
|
|
2709
2709
|
sticky: "sticky"
|
|
2710
2710
|
};
|
|
2711
|
-
var Box =
|
|
2711
|
+
var Box = React9.forwardRef(
|
|
2712
2712
|
({
|
|
2713
2713
|
padding,
|
|
2714
2714
|
paddingX,
|
|
@@ -2758,7 +2758,7 @@ var Box = React8.forwardRef(
|
|
|
2758
2758
|
onMouseLeave?.(e);
|
|
2759
2759
|
}, [hoverEvent, eventBus, onMouseLeave]);
|
|
2760
2760
|
const isClickable = action || onClick;
|
|
2761
|
-
return
|
|
2761
|
+
return React9.createElement(
|
|
2762
2762
|
Component,
|
|
2763
2763
|
{
|
|
2764
2764
|
ref,
|
|
@@ -3720,7 +3720,7 @@ var Icon = ({
|
|
|
3720
3720
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
3721
3721
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
3722
3722
|
const family = useIconFamily();
|
|
3723
|
-
const RenderedComponent =
|
|
3723
|
+
const RenderedComponent = React9.useMemo(() => {
|
|
3724
3724
|
if (directIcon) return null;
|
|
3725
3725
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
3726
3726
|
}, [directIcon, effectiveName, family]);
|
|
@@ -3837,7 +3837,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
3837
3837
|
const IconComp = value;
|
|
3838
3838
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
3839
3839
|
}
|
|
3840
|
-
if (
|
|
3840
|
+
if (React9.isValidElement(value)) {
|
|
3841
3841
|
return value;
|
|
3842
3842
|
}
|
|
3843
3843
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -3846,7 +3846,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
3846
3846
|
}
|
|
3847
3847
|
return value;
|
|
3848
3848
|
}
|
|
3849
|
-
var Button =
|
|
3849
|
+
var Button = React9.forwardRef(
|
|
3850
3850
|
({
|
|
3851
3851
|
className,
|
|
3852
3852
|
variant = "primary",
|
|
@@ -3942,7 +3942,7 @@ var sizeStyles2 = {
|
|
|
3942
3942
|
md: "px-2.5 py-1 text-sm",
|
|
3943
3943
|
lg: "px-3 py-1.5 text-base"
|
|
3944
3944
|
};
|
|
3945
|
-
var Badge =
|
|
3945
|
+
var Badge = React9.forwardRef(
|
|
3946
3946
|
({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
|
|
3947
3947
|
const iconSizes = {
|
|
3948
3948
|
sm: "h-icon-default w-icon-default",
|
|
@@ -3989,6 +3989,41 @@ var Badge = React8.forwardRef(
|
|
|
3989
3989
|
}
|
|
3990
3990
|
);
|
|
3991
3991
|
Badge.displayName = "Badge";
|
|
3992
|
+
var sizeStyles3 = {
|
|
3993
|
+
xs: "h-3 w-3",
|
|
3994
|
+
sm: "h-icon-default w-icon-default",
|
|
3995
|
+
md: "h-6 w-6",
|
|
3996
|
+
lg: "h-8 w-8"
|
|
3997
|
+
};
|
|
3998
|
+
var Spinner = React9.forwardRef(
|
|
3999
|
+
({ className, size = "md", overlay, ...props }, ref) => {
|
|
4000
|
+
if (overlay) {
|
|
4001
|
+
return /* @__PURE__ */ jsx(
|
|
4002
|
+
"div",
|
|
4003
|
+
{
|
|
4004
|
+
ref,
|
|
4005
|
+
className: cn(
|
|
4006
|
+
"absolute inset-0 z-10 flex items-center justify-center",
|
|
4007
|
+
"bg-background/60 backdrop-blur-sm",
|
|
4008
|
+
className
|
|
4009
|
+
),
|
|
4010
|
+
...props,
|
|
4011
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "loader", className: cn("animate-spin text-foreground", sizeStyles3[size]) })
|
|
4012
|
+
}
|
|
4013
|
+
);
|
|
4014
|
+
}
|
|
4015
|
+
return /* @__PURE__ */ jsx(
|
|
4016
|
+
"div",
|
|
4017
|
+
{
|
|
4018
|
+
ref,
|
|
4019
|
+
className: cn("text-foreground", className),
|
|
4020
|
+
...props,
|
|
4021
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "loader", className: cn("animate-spin", sizeStyles3[size]) })
|
|
4022
|
+
}
|
|
4023
|
+
);
|
|
4024
|
+
}
|
|
4025
|
+
);
|
|
4026
|
+
Spinner.displayName = "Spinner";
|
|
3992
4027
|
var variantStyles4 = {
|
|
3993
4028
|
default: [
|
|
3994
4029
|
"bg-card",
|
|
@@ -4042,7 +4077,7 @@ var lookStyles = {
|
|
|
4042
4077
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
4043
4078
|
"tile-image-first": "p-0 overflow-hidden"
|
|
4044
4079
|
};
|
|
4045
|
-
var Card =
|
|
4080
|
+
var Card = React9.forwardRef(
|
|
4046
4081
|
({
|
|
4047
4082
|
className,
|
|
4048
4083
|
variant = "bordered",
|
|
@@ -4053,6 +4088,7 @@ var Card = React8.forwardRef(
|
|
|
4053
4088
|
look = "elevated",
|
|
4054
4089
|
children,
|
|
4055
4090
|
action,
|
|
4091
|
+
loading,
|
|
4056
4092
|
onClick,
|
|
4057
4093
|
...props
|
|
4058
4094
|
}, ref) => {
|
|
@@ -4066,7 +4102,7 @@ var Card = React8.forwardRef(
|
|
|
4066
4102
|
{
|
|
4067
4103
|
ref,
|
|
4068
4104
|
className: cn(
|
|
4069
|
-
"rounded-container",
|
|
4105
|
+
"rounded-container relative",
|
|
4070
4106
|
"transition-all duration-[var(--transition-normal)]",
|
|
4071
4107
|
variantStyles4[variant],
|
|
4072
4108
|
paddingStyles2[padding],
|
|
@@ -4077,6 +4113,7 @@ var Card = React8.forwardRef(
|
|
|
4077
4113
|
onClick: handleClick,
|
|
4078
4114
|
...props,
|
|
4079
4115
|
children: [
|
|
4116
|
+
loading && /* @__PURE__ */ jsx(Spinner, { overlay: true, size: "md" }),
|
|
4080
4117
|
(title || subtitle) && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
|
|
4081
4118
|
title && /* @__PURE__ */ jsx("h3", { className: "text-lg text-card-foreground font-bold", children: title }),
|
|
4082
4119
|
subtitle && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-1", children: subtitle })
|
|
@@ -4088,9 +4125,9 @@ var Card = React8.forwardRef(
|
|
|
4088
4125
|
}
|
|
4089
4126
|
);
|
|
4090
4127
|
Card.displayName = "Card";
|
|
4091
|
-
var CardHeader =
|
|
4128
|
+
var CardHeader = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
4092
4129
|
CardHeader.displayName = "CardHeader";
|
|
4093
|
-
var CardTitle =
|
|
4130
|
+
var CardTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4094
4131
|
"h3",
|
|
4095
4132
|
{
|
|
4096
4133
|
ref,
|
|
@@ -4103,11 +4140,11 @@ var CardTitle = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
4103
4140
|
}
|
|
4104
4141
|
));
|
|
4105
4142
|
CardTitle.displayName = "CardTitle";
|
|
4106
|
-
var CardContent =
|
|
4143
|
+
var CardContent = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
4107
4144
|
CardContent.displayName = "CardContent";
|
|
4108
4145
|
var CardBody = CardContent;
|
|
4109
4146
|
CardBody.displayName = "CardBody";
|
|
4110
|
-
var CardFooter =
|
|
4147
|
+
var CardFooter = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4111
4148
|
"div",
|
|
4112
4149
|
{
|
|
4113
4150
|
ref,
|
|
@@ -4264,7 +4301,7 @@ var paddingClasses = {
|
|
|
4264
4301
|
md: "py-16",
|
|
4265
4302
|
lg: "py-24"
|
|
4266
4303
|
};
|
|
4267
|
-
var ContentSection =
|
|
4304
|
+
var ContentSection = React9.forwardRef(
|
|
4268
4305
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
4269
4306
|
return /* @__PURE__ */ jsx(
|
|
4270
4307
|
Box,
|
|
@@ -4866,7 +4903,7 @@ var StepFlow = ({
|
|
|
4866
4903
|
className
|
|
4867
4904
|
}) => {
|
|
4868
4905
|
if (orientation === "vertical") {
|
|
4869
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
4906
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React9.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
4870
4907
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
4871
4908
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
4872
4909
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -4877,7 +4914,7 @@ var StepFlow = ({
|
|
|
4877
4914
|
] })
|
|
4878
4915
|
] }) }, index)) });
|
|
4879
4916
|
}
|
|
4880
|
-
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(
|
|
4917
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React9.Fragment, { children: [
|
|
4881
4918
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
4882
4919
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
4883
4920
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -5085,8 +5122,8 @@ var Avatar = ({
|
|
|
5085
5122
|
actionPayload
|
|
5086
5123
|
}) => {
|
|
5087
5124
|
const eventBus = useEventBus();
|
|
5088
|
-
const [imgFailed, setImgFailed] =
|
|
5089
|
-
|
|
5125
|
+
const [imgFailed, setImgFailed] = React9.useState(false);
|
|
5126
|
+
React9.useEffect(() => {
|
|
5090
5127
|
setImgFailed(false);
|
|
5091
5128
|
}, [src]);
|
|
5092
5129
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -5477,7 +5514,7 @@ var animatedStyles = {
|
|
|
5477
5514
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
5478
5515
|
"none": {}
|
|
5479
5516
|
};
|
|
5480
|
-
var AnimatedReveal =
|
|
5517
|
+
var AnimatedReveal = React9.forwardRef(
|
|
5481
5518
|
({
|
|
5482
5519
|
trigger = "scroll",
|
|
5483
5520
|
animation = "fade-up",
|
|
@@ -5630,7 +5667,7 @@ function applyMorphAnimation(container, animate, duration, delay, easing) {
|
|
|
5630
5667
|
el.style.opacity = animate ? "1" : "0";
|
|
5631
5668
|
});
|
|
5632
5669
|
}
|
|
5633
|
-
var AnimatedGraphic =
|
|
5670
|
+
var AnimatedGraphic = React9.forwardRef(
|
|
5634
5671
|
({
|
|
5635
5672
|
src,
|
|
5636
5673
|
svgContent,
|
|
@@ -5653,7 +5690,7 @@ var AnimatedGraphic = React8.forwardRef(
|
|
|
5653
5690
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
5654
5691
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
5655
5692
|
const prevAnimateRef = useRef(animate);
|
|
5656
|
-
const setRef =
|
|
5693
|
+
const setRef = React9.useCallback(
|
|
5657
5694
|
(node) => {
|
|
5658
5695
|
containerRef.current = node;
|
|
5659
5696
|
if (typeof ref === "function") ref(node);
|