@geomak/ui 1.5.2 → 1.6.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/index.cjs +37 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +37 -20
- package/dist/index.js.map +1 -1
- package/dist/styles.css +29 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -489,11 +489,11 @@ function Tooltip({
|
|
|
489
489
|
className: [
|
|
490
490
|
// Layout + typography
|
|
491
491
|
"pointer-events-none z-[500000] max-w-[220px] px-2.5 py-1.5",
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
"
|
|
495
|
-
//
|
|
496
|
-
"shadow-md",
|
|
492
|
+
// Inverted surface: dark on light, light on dark — both readable
|
|
493
|
+
"bg-foreground text-background",
|
|
494
|
+
"text-xs font-medium leading-snug",
|
|
495
|
+
// Shape + shadow
|
|
496
|
+
"rounded-md shadow-md",
|
|
497
497
|
// Out animation (always the same — just fade)
|
|
498
498
|
"data-[state=closed]:animate-tooltip-out",
|
|
499
499
|
// In animation — direction-aware
|
|
@@ -506,7 +506,7 @@ function Tooltip({
|
|
|
506
506
|
{
|
|
507
507
|
width: 10,
|
|
508
508
|
height: 5,
|
|
509
|
-
className: "fill-foreground
|
|
509
|
+
className: "fill-foreground"
|
|
510
510
|
}
|
|
511
511
|
)
|
|
512
512
|
]
|
|
@@ -817,8 +817,11 @@ function NotificationItem({
|
|
|
817
817
|
onClose,
|
|
818
818
|
reduced
|
|
819
819
|
}) {
|
|
820
|
+
const [hovered, setHovered] = React9.useState(false);
|
|
820
821
|
const initial = getInitialMotion(pos, reduced);
|
|
821
822
|
const center = pos.endsWith("center");
|
|
823
|
+
const duration = n.duration ?? 4e3;
|
|
824
|
+
const showProgress = !reduced && isFinite(duration) && duration > 0;
|
|
822
825
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
823
826
|
framerMotion.motion.div,
|
|
824
827
|
{
|
|
@@ -833,11 +836,13 @@ function NotificationItem({
|
|
|
833
836
|
scale: { type: "tween", duration: 0.22, ease: [0.16, 1, 0.3, 1] },
|
|
834
837
|
layout: { duration: 0.18 }
|
|
835
838
|
},
|
|
836
|
-
|
|
839
|
+
onMouseEnter: () => setHovered(true),
|
|
840
|
+
onMouseLeave: () => setHovered(false),
|
|
841
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
837
842
|
Toast__namespace.Root,
|
|
838
843
|
{
|
|
839
844
|
open: true,
|
|
840
|
-
duration
|
|
845
|
+
duration,
|
|
841
846
|
onOpenChange: (o) => {
|
|
842
847
|
if (!o) onClose(n.id);
|
|
843
848
|
},
|
|
@@ -847,22 +852,34 @@ function NotificationItem({
|
|
|
847
852
|
"focus:outline-none",
|
|
848
853
|
TYPE_BG[n.type ?? "info"]
|
|
849
854
|
].join(" "),
|
|
850
|
-
children:
|
|
851
|
-
/* @__PURE__ */ jsxRuntime.
|
|
852
|
-
|
|
853
|
-
/* @__PURE__ */ jsxRuntime.
|
|
854
|
-
|
|
855
|
+
children: [
|
|
856
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 p-3 pr-2.5", children: [
|
|
857
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-0.5 flex-shrink-0 text-white/90", children: /* @__PURE__ */ jsxRuntime.jsx(TypeIcon, { type: n.type ?? "info" }) }),
|
|
858
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
859
|
+
/* @__PURE__ */ jsxRuntime.jsx(Toast__namespace.Title, { className: "text-sm font-semibold text-white leading-snug", children: n.title }),
|
|
860
|
+
n.description && /* @__PURE__ */ jsxRuntime.jsx(Toast__namespace.Description, { className: "mt-0.5 text-xs text-white/75 leading-relaxed", children: n.description })
|
|
861
|
+
] }),
|
|
862
|
+
/* @__PURE__ */ jsxRuntime.jsx(Toast__namespace.Action, { asChild: true, altText: "Close", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
863
|
+
"button",
|
|
864
|
+
{
|
|
865
|
+
"aria-label": "Close",
|
|
866
|
+
onClick: () => onClose(n.id),
|
|
867
|
+
className: "flex-shrink-0 mt-0.5 rounded p-1 text-white/60 hover:text-white hover:bg-white/15 transition-colors duration-100 focus:outline-none focus-visible:ring-1 focus-visible:ring-white/50",
|
|
868
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 3L3 9M3 3l6 6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) })
|
|
869
|
+
}
|
|
870
|
+
) })
|
|
855
871
|
] }),
|
|
856
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
857
|
-
"
|
|
872
|
+
showProgress && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative h-[3px] bg-white/20 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
873
|
+
"div",
|
|
858
874
|
{
|
|
859
|
-
"
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
875
|
+
className: "absolute inset-0 bg-white/60 [transform-origin:left]",
|
|
876
|
+
style: {
|
|
877
|
+
animation: `notification-progress ${duration}ms linear forwards`,
|
|
878
|
+
animationPlayState: hovered ? "paused" : "running"
|
|
879
|
+
}
|
|
863
880
|
}
|
|
864
881
|
) })
|
|
865
|
-
]
|
|
882
|
+
]
|
|
866
883
|
}
|
|
867
884
|
)
|
|
868
885
|
}
|