@almadar/ui 2.16.1 → 2.18.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/components/index.cjs +996 -996
- package/dist/components/index.js +134 -134
- package/dist/components/organisms/game/three/index.cjs +121 -121
- package/dist/components/organisms/game/three/index.js +3 -3
- package/dist/docs/index.cjs +33 -33
- package/dist/docs/index.js +11 -11
- package/dist/hooks/index.cjs +221 -221
- package/dist/hooks/index.js +2 -2
- package/dist/internals/event-bus-context.d.ts +15 -0
- package/dist/marketing/index.cjs +26 -26
- package/dist/marketing/index.js +13 -13
- package/dist/providers/EventBusProvider.d.ts +4 -20
- package/dist/providers/index.cjs +3 -1
- package/dist/providers/index.js +3 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React7, { forwardRef, useRef, useEffect, useImperativeHandle, createContext, useState, useMemo, useCallback, Component, useContext } from 'react';
|
|
2
2
|
import { useThree, useFrame, Canvas } from '@react-three/fiber';
|
|
3
3
|
import * as THREE6 from 'three';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -1818,7 +1818,7 @@ function UnitRenderer({
|
|
|
1818
1818
|
onAnimationStateChange,
|
|
1819
1819
|
animationSpeed = 1
|
|
1820
1820
|
}) {
|
|
1821
|
-
const handleUnitClick =
|
|
1821
|
+
const handleUnitClick = React7.useCallback(
|
|
1822
1822
|
(unit) => {
|
|
1823
1823
|
onUnitClick?.(unit);
|
|
1824
1824
|
},
|
|
@@ -2797,7 +2797,7 @@ var positionStyles = {
|
|
|
2797
2797
|
fixed: "fixed",
|
|
2798
2798
|
sticky: "sticky"
|
|
2799
2799
|
};
|
|
2800
|
-
var Box =
|
|
2800
|
+
var Box = React7.forwardRef(
|
|
2801
2801
|
({
|
|
2802
2802
|
padding,
|
|
2803
2803
|
paddingX,
|
package/dist/docs/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React3 = require('react');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var LucideIcons = require('lucide-react');
|
|
6
6
|
|
|
@@ -24,7 +24,7 @@ function _interopNamespace(e) {
|
|
|
24
24
|
return Object.freeze(n);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var React3__default = /*#__PURE__*/_interopDefault(React3);
|
|
28
28
|
var LucideIcons__namespace = /*#__PURE__*/_interopNamespace(LucideIcons);
|
|
29
29
|
|
|
30
30
|
// node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
@@ -2506,7 +2506,7 @@ var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
|
2506
2506
|
function cn(...inputs) {
|
|
2507
2507
|
return twMerge(clsx(inputs));
|
|
2508
2508
|
}
|
|
2509
|
-
var EventBusContext =
|
|
2509
|
+
var EventBusContext = React3.createContext(null);
|
|
2510
2510
|
|
|
2511
2511
|
// hooks/useEventBus.ts
|
|
2512
2512
|
function getGlobalEventBus() {
|
|
@@ -2576,7 +2576,7 @@ var fallbackEventBus = {
|
|
|
2576
2576
|
}
|
|
2577
2577
|
};
|
|
2578
2578
|
function useEventBus() {
|
|
2579
|
-
const context =
|
|
2579
|
+
const context = React3.useContext(EventBusContext);
|
|
2580
2580
|
return context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
2581
2581
|
}
|
|
2582
2582
|
var paddingStyles = {
|
|
@@ -2681,7 +2681,7 @@ var positionStyles = {
|
|
|
2681
2681
|
fixed: "fixed",
|
|
2682
2682
|
sticky: "sticky"
|
|
2683
2683
|
};
|
|
2684
|
-
var Box =
|
|
2684
|
+
var Box = React3__default.default.forwardRef(
|
|
2685
2685
|
({
|
|
2686
2686
|
padding,
|
|
2687
2687
|
paddingX,
|
|
@@ -2710,20 +2710,20 @@ var Box = React4__default.default.forwardRef(
|
|
|
2710
2710
|
...rest
|
|
2711
2711
|
}, ref) => {
|
|
2712
2712
|
const eventBus = useEventBus();
|
|
2713
|
-
const handleClick =
|
|
2713
|
+
const handleClick = React3.useCallback((e) => {
|
|
2714
2714
|
if (action) {
|
|
2715
2715
|
e.stopPropagation();
|
|
2716
2716
|
eventBus.emit(`UI:${action}`, actionPayload ?? {});
|
|
2717
2717
|
}
|
|
2718
2718
|
onClick?.(e);
|
|
2719
2719
|
}, [action, actionPayload, eventBus, onClick]);
|
|
2720
|
-
const handleMouseEnter =
|
|
2720
|
+
const handleMouseEnter = React3.useCallback((e) => {
|
|
2721
2721
|
if (hoverEvent) {
|
|
2722
2722
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
|
|
2723
2723
|
}
|
|
2724
2724
|
onMouseEnter?.(e);
|
|
2725
2725
|
}, [hoverEvent, eventBus, onMouseEnter]);
|
|
2726
|
-
const handleMouseLeave =
|
|
2726
|
+
const handleMouseLeave = React3.useCallback((e) => {
|
|
2727
2727
|
if (hoverEvent) {
|
|
2728
2728
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
|
|
2729
2729
|
}
|
|
@@ -3107,7 +3107,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
3107
3107
|
const IconComp = value;
|
|
3108
3108
|
return /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: sizeClass });
|
|
3109
3109
|
}
|
|
3110
|
-
if (
|
|
3110
|
+
if (React3__default.default.isValidElement(value)) {
|
|
3111
3111
|
return value;
|
|
3112
3112
|
}
|
|
3113
3113
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -3116,7 +3116,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
3116
3116
|
}
|
|
3117
3117
|
return value;
|
|
3118
3118
|
}
|
|
3119
|
-
var Button =
|
|
3119
|
+
var Button = React3__default.default.forwardRef(
|
|
3120
3120
|
({
|
|
3121
3121
|
className,
|
|
3122
3122
|
variant = "primary",
|
|
@@ -3216,7 +3216,7 @@ var shadowStyles2 = {
|
|
|
3216
3216
|
md: "shadow-[var(--shadow-main)]",
|
|
3217
3217
|
lg: "shadow-[var(--shadow-lg)]"
|
|
3218
3218
|
};
|
|
3219
|
-
var Card =
|
|
3219
|
+
var Card = React3__default.default.forwardRef(
|
|
3220
3220
|
({
|
|
3221
3221
|
className,
|
|
3222
3222
|
variant = "bordered",
|
|
@@ -3252,9 +3252,9 @@ var Card = React4__default.default.forwardRef(
|
|
|
3252
3252
|
}
|
|
3253
3253
|
);
|
|
3254
3254
|
Card.displayName = "Card";
|
|
3255
|
-
var CardHeader =
|
|
3255
|
+
var CardHeader = React3__default.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3256
3256
|
CardHeader.displayName = "CardHeader";
|
|
3257
|
-
var CardTitle =
|
|
3257
|
+
var CardTitle = React3__default.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3258
3258
|
"h3",
|
|
3259
3259
|
{
|
|
3260
3260
|
ref,
|
|
@@ -3267,11 +3267,11 @@ var CardTitle = React4__default.default.forwardRef(({ className, ...props }, ref
|
|
|
3267
3267
|
}
|
|
3268
3268
|
));
|
|
3269
3269
|
CardTitle.displayName = "CardTitle";
|
|
3270
|
-
var CardContent =
|
|
3270
|
+
var CardContent = React3__default.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("", className), ...props }));
|
|
3271
3271
|
CardContent.displayName = "CardContent";
|
|
3272
3272
|
var CardBody = CardContent;
|
|
3273
3273
|
CardBody.displayName = "CardBody";
|
|
3274
|
-
var CardFooter =
|
|
3274
|
+
var CardFooter = React3__default.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3275
3275
|
"div",
|
|
3276
3276
|
{
|
|
3277
3277
|
ref,
|
|
@@ -3350,7 +3350,7 @@ var Divider = ({
|
|
|
3350
3350
|
);
|
|
3351
3351
|
};
|
|
3352
3352
|
Divider.displayName = "Divider";
|
|
3353
|
-
var Input =
|
|
3353
|
+
var Input = React3__default.default.forwardRef(
|
|
3354
3354
|
({
|
|
3355
3355
|
className,
|
|
3356
3356
|
inputType,
|
|
@@ -3463,7 +3463,7 @@ var Input = React4__default.default.forwardRef(
|
|
|
3463
3463
|
);
|
|
3464
3464
|
Input.displayName = "Input";
|
|
3465
3465
|
var DocSidebarCategory = ({ item, depth }) => {
|
|
3466
|
-
const [expanded, setExpanded] =
|
|
3466
|
+
const [expanded, setExpanded] = React3.useState(
|
|
3467
3467
|
() => item.items?.some(function hasActive(child) {
|
|
3468
3468
|
if (child.active) return true;
|
|
3469
3469
|
return child.items?.some(hasActive) ?? false;
|
|
@@ -3618,7 +3618,7 @@ var DocBreadcrumb = ({
|
|
|
3618
3618
|
"aria-label": "Breadcrumb",
|
|
3619
3619
|
children: /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
3620
3620
|
const isLast = idx === items.length - 1;
|
|
3621
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3621
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React3__default.default.Fragment, { children: [
|
|
3622
3622
|
idx > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3623
3623
|
Icon,
|
|
3624
3624
|
{
|
|
@@ -3670,8 +3670,8 @@ function DocCodeBlock({
|
|
|
3670
3670
|
showLineNumbers = false,
|
|
3671
3671
|
className
|
|
3672
3672
|
}) {
|
|
3673
|
-
const [copied, setCopied] =
|
|
3674
|
-
const handleCopy =
|
|
3673
|
+
const [copied, setCopied] = React3.useState(false);
|
|
3674
|
+
const handleCopy = React3.useCallback(() => {
|
|
3675
3675
|
void navigator.clipboard.writeText(code).then(() => {
|
|
3676
3676
|
setCopied(true);
|
|
3677
3677
|
setTimeout(() => setCopied(false), 2e3);
|
|
@@ -3836,13 +3836,13 @@ function DocSearch({
|
|
|
3836
3836
|
onSearch,
|
|
3837
3837
|
className
|
|
3838
3838
|
}) {
|
|
3839
|
-
const [query, setQuery] =
|
|
3840
|
-
const [results, setResults] =
|
|
3841
|
-
const [isOpen, setIsOpen] =
|
|
3842
|
-
const [activeIndex, setActiveIndex] =
|
|
3843
|
-
const containerRef =
|
|
3844
|
-
const debounceRef =
|
|
3845
|
-
|
|
3839
|
+
const [query, setQuery] = React3.useState("");
|
|
3840
|
+
const [results, setResults] = React3.useState([]);
|
|
3841
|
+
const [isOpen, setIsOpen] = React3.useState(false);
|
|
3842
|
+
const [activeIndex, setActiveIndex] = React3.useState(-1);
|
|
3843
|
+
const containerRef = React3.useRef(null);
|
|
3844
|
+
const debounceRef = React3.useRef(void 0);
|
|
3845
|
+
React3.useEffect(() => {
|
|
3846
3846
|
function handleClickOutside(e) {
|
|
3847
3847
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
3848
3848
|
setIsOpen(false);
|
|
@@ -3851,7 +3851,7 @@ function DocSearch({
|
|
|
3851
3851
|
document.addEventListener("mousedown", handleClickOutside);
|
|
3852
3852
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
3853
3853
|
}, []);
|
|
3854
|
-
const performSearch =
|
|
3854
|
+
const performSearch = React3.useCallback(
|
|
3855
3855
|
(value) => {
|
|
3856
3856
|
if (!onSearch || !value.trim()) {
|
|
3857
3857
|
setResults([]);
|
|
@@ -3873,7 +3873,7 @@ function DocSearch({
|
|
|
3873
3873
|
},
|
|
3874
3874
|
[onSearch]
|
|
3875
3875
|
);
|
|
3876
|
-
const handleChange =
|
|
3876
|
+
const handleChange = React3.useCallback(
|
|
3877
3877
|
(e) => {
|
|
3878
3878
|
const value = e.target.value;
|
|
3879
3879
|
setQuery(value);
|
|
@@ -3886,18 +3886,18 @@ function DocSearch({
|
|
|
3886
3886
|
},
|
|
3887
3887
|
[performSearch]
|
|
3888
3888
|
);
|
|
3889
|
-
const handleFocus =
|
|
3889
|
+
const handleFocus = React3.useCallback(() => {
|
|
3890
3890
|
if (results.length > 0) {
|
|
3891
3891
|
setIsOpen(true);
|
|
3892
3892
|
}
|
|
3893
3893
|
}, [results]);
|
|
3894
|
-
const navigateTo =
|
|
3894
|
+
const navigateTo = React3.useCallback((href) => {
|
|
3895
3895
|
setIsOpen(false);
|
|
3896
3896
|
setQuery("");
|
|
3897
3897
|
setResults([]);
|
|
3898
3898
|
window.location.href = href;
|
|
3899
3899
|
}, []);
|
|
3900
|
-
const handleKeyDown =
|
|
3900
|
+
const handleKeyDown = React3.useCallback(
|
|
3901
3901
|
(e) => {
|
|
3902
3902
|
if (e.key === "Escape") {
|
|
3903
3903
|
setIsOpen(false);
|
|
@@ -3924,7 +3924,7 @@ function DocSearch({
|
|
|
3924
3924
|
},
|
|
3925
3925
|
[isOpen, results, activeIndex, navigateTo]
|
|
3926
3926
|
);
|
|
3927
|
-
|
|
3927
|
+
React3.useEffect(() => {
|
|
3928
3928
|
return () => {
|
|
3929
3929
|
if (debounceRef.current) {
|
|
3930
3930
|
clearTimeout(debounceRef.current);
|
package/dist/docs/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React3, { createContext, useCallback, useContext, useState, useRef, useEffect } from 'react';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import * as LucideIcons from 'lucide-react';
|
|
4
4
|
import { Loader2, ChevronDown, X } from 'lucide-react';
|
|
@@ -2657,7 +2657,7 @@ var positionStyles = {
|
|
|
2657
2657
|
fixed: "fixed",
|
|
2658
2658
|
sticky: "sticky"
|
|
2659
2659
|
};
|
|
2660
|
-
var Box =
|
|
2660
|
+
var Box = React3.forwardRef(
|
|
2661
2661
|
({
|
|
2662
2662
|
padding,
|
|
2663
2663
|
paddingX,
|
|
@@ -3083,7 +3083,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
3083
3083
|
const IconComp = value;
|
|
3084
3084
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
3085
3085
|
}
|
|
3086
|
-
if (
|
|
3086
|
+
if (React3.isValidElement(value)) {
|
|
3087
3087
|
return value;
|
|
3088
3088
|
}
|
|
3089
3089
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -3092,7 +3092,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
3092
3092
|
}
|
|
3093
3093
|
return value;
|
|
3094
3094
|
}
|
|
3095
|
-
var Button =
|
|
3095
|
+
var Button = React3.forwardRef(
|
|
3096
3096
|
({
|
|
3097
3097
|
className,
|
|
3098
3098
|
variant = "primary",
|
|
@@ -3192,7 +3192,7 @@ var shadowStyles2 = {
|
|
|
3192
3192
|
md: "shadow-[var(--shadow-main)]",
|
|
3193
3193
|
lg: "shadow-[var(--shadow-lg)]"
|
|
3194
3194
|
};
|
|
3195
|
-
var Card =
|
|
3195
|
+
var Card = React3.forwardRef(
|
|
3196
3196
|
({
|
|
3197
3197
|
className,
|
|
3198
3198
|
variant = "bordered",
|
|
@@ -3228,9 +3228,9 @@ var Card = React4.forwardRef(
|
|
|
3228
3228
|
}
|
|
3229
3229
|
);
|
|
3230
3230
|
Card.displayName = "Card";
|
|
3231
|
-
var CardHeader =
|
|
3231
|
+
var CardHeader = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3232
3232
|
CardHeader.displayName = "CardHeader";
|
|
3233
|
-
var CardTitle =
|
|
3233
|
+
var CardTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3234
3234
|
"h3",
|
|
3235
3235
|
{
|
|
3236
3236
|
ref,
|
|
@@ -3243,11 +3243,11 @@ var CardTitle = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
3243
3243
|
}
|
|
3244
3244
|
));
|
|
3245
3245
|
CardTitle.displayName = "CardTitle";
|
|
3246
|
-
var CardContent =
|
|
3246
|
+
var CardContent = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
3247
3247
|
CardContent.displayName = "CardContent";
|
|
3248
3248
|
var CardBody = CardContent;
|
|
3249
3249
|
CardBody.displayName = "CardBody";
|
|
3250
|
-
var CardFooter =
|
|
3250
|
+
var CardFooter = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3251
3251
|
"div",
|
|
3252
3252
|
{
|
|
3253
3253
|
ref,
|
|
@@ -3326,7 +3326,7 @@ var Divider = ({
|
|
|
3326
3326
|
);
|
|
3327
3327
|
};
|
|
3328
3328
|
Divider.displayName = "Divider";
|
|
3329
|
-
var Input =
|
|
3329
|
+
var Input = React3.forwardRef(
|
|
3330
3330
|
({
|
|
3331
3331
|
className,
|
|
3332
3332
|
inputType,
|
|
@@ -3594,7 +3594,7 @@ var DocBreadcrumb = ({
|
|
|
3594
3594
|
"aria-label": "Breadcrumb",
|
|
3595
3595
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
3596
3596
|
const isLast = idx === items.length - 1;
|
|
3597
|
-
return /* @__PURE__ */ jsxs(
|
|
3597
|
+
return /* @__PURE__ */ jsxs(React3.Fragment, { children: [
|
|
3598
3598
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
3599
3599
|
Icon,
|
|
3600
3600
|
{
|