@geomak/ui 7.5.2 → 7.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 CHANGED
@@ -1630,6 +1630,47 @@ function Badge({
1630
1630
  !hidden && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute -top-1 -right-1 flex", children: indicator })
1631
1631
  ] });
1632
1632
  }
1633
+ var TONE_BG = {
1634
+ info: "bg-[color-mix(in_srgb,var(--color-info)_12%,transparent)]",
1635
+ success: "bg-[color-mix(in_srgb,var(--color-success)_12%,transparent)]",
1636
+ warning: "bg-[color-mix(in_srgb,var(--color-warning)_15%,transparent)]",
1637
+ danger: "bg-[color-mix(in_srgb,var(--color-error)_12%,transparent)]"
1638
+ };
1639
+ var TONE_FG = {
1640
+ info: "text-status-info",
1641
+ success: "text-status-success",
1642
+ warning: "text-status-warning",
1643
+ danger: "text-status-error"
1644
+ };
1645
+ var DEFAULT_ICON = {
1646
+ info: /* @__PURE__ */ jsxRuntime.jsx(chunk4V4U2W7K_cjs.Info, { size: 18 }),
1647
+ success: /* @__PURE__ */ jsxRuntime.jsx(chunk4V4U2W7K_cjs.CheckCircle, { size: 18 }),
1648
+ warning: /* @__PURE__ */ jsxRuntime.jsx(chunk4V4U2W7K_cjs.Warning, { size: 18 }),
1649
+ danger: /* @__PURE__ */ jsxRuntime.jsx(chunk4V4U2W7K_cjs.Error, { size: 18 })
1650
+ };
1651
+ function Banner({ tone, children, icon, onDismiss, className = "" }) {
1652
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1653
+ "div",
1654
+ {
1655
+ role: tone === "warning" || tone === "danger" ? "alert" : "status",
1656
+ className: cx("flex w-full items-start gap-2.5 rounded-md p-3 text-sm text-foreground", TONE_BG[tone], className),
1657
+ children: [
1658
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx("mt-0.5 flex h-[18px] w-[18px] flex-shrink-0 items-center justify-center", TONE_FG[tone]), children: icon ?? DEFAULT_ICON[tone] }),
1659
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0 flex-1", children }),
1660
+ onDismiss && /* @__PURE__ */ jsxRuntime.jsx(
1661
+ "button",
1662
+ {
1663
+ type: "button",
1664
+ onClick: onDismiss,
1665
+ "aria-label": "Dismiss",
1666
+ className: "-mr-1 -mt-1 flex h-6 w-6 flex-shrink-0 self-start items-center justify-center rounded-md text-foreground-muted transition-colors hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-accent",
1667
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunk4V4U2W7K_cjs.X, { size: 16 })
1668
+ }
1669
+ )
1670
+ ]
1671
+ }
1672
+ );
1673
+ }
1633
1674
  var SIZES = {
1634
1675
  sm: { box: "h-7 w-7 text-xs", center: 14, title: "text-xs", desc: "text-[11px]" },
1635
1676
  md: { box: "h-9 w-9 text-sm", center: 18, title: "text-sm", desc: "text-xs" }
@@ -2515,52 +2556,68 @@ function PopConfirm({
2515
2556
  onCancel?.();
2516
2557
  setOpen(false);
2517
2558
  };
2518
- return /* @__PURE__ */ jsxRuntime.jsxs(Popover__namespace.Root, { open: isOpen, onOpenChange: (o) => o ? setOpen(true) : handleCancel(), children: [
2519
- /* @__PURE__ */ jsxRuntime.jsx(Popover__namespace.Trigger, { asChild: true, children }),
2520
- /* @__PURE__ */ jsxRuntime.jsx(Popover__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
2521
- Popover__namespace.Content,
2522
- {
2523
- side,
2524
- sideOffset: 8,
2525
- collisionPadding: 12,
2526
- className: cx("z-[400] focus:outline-none", className),
2527
- children: [
2528
- /* @__PURE__ */ jsxRuntime.jsxs(
2529
- framerMotion.motion.div,
2530
- {
2531
- initial: { opacity: 0, scale: 0.95 },
2532
- animate: { opacity: 1, scale: 1 },
2533
- transition: { duration: 0.12, ease: [0.16, 1, 0.3, 1] },
2534
- className: "w-64 rounded-lg border border-border bg-surface p-3.5 shadow-lg",
2535
- children: [
2536
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2.5", children: [
2537
- icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `mt-0.5 flex h-5 w-5 flex-shrink-0 items-center justify-center ${ICON_COLOR[tone]}`, children: icon }),
2538
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
2539
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-medium text-foreground", children: title }),
2540
- description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 text-xs text-foreground-secondary leading-snug", children: description })
2541
- ] })
2542
- ] }),
2543
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 flex justify-end gap-2", children: [
2544
- /* @__PURE__ */ jsxRuntime.jsx(Button_default, { content: cancelText, size: "sm", variant: "ghost", onClick: handleCancel }),
2545
- /* @__PURE__ */ jsxRuntime.jsx(
2546
- Button_default,
2547
- {
2548
- content: confirmText,
2549
- size: "sm",
2550
- variant: CONFIRM_VARIANT[tone],
2551
- loading,
2552
- onClick: handleConfirm
2553
- }
2554
- )
2555
- ] })
2556
- ]
2557
- }
2558
- ),
2559
- /* @__PURE__ */ jsxRuntime.jsx(Popover__namespace.Arrow, { className: "fill-surface" })
2560
- ]
2561
- }
2562
- ) })
2563
- ] });
2559
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2560
+ Popover__namespace.Root,
2561
+ {
2562
+ open: isOpen,
2563
+ onOpenChange: (o) => {
2564
+ if (o) setOpen(true);
2565
+ else if (!loading) handleCancel();
2566
+ },
2567
+ children: [
2568
+ /* @__PURE__ */ jsxRuntime.jsx(Popover__namespace.Trigger, { asChild: true, children }),
2569
+ /* @__PURE__ */ jsxRuntime.jsx(Popover__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
2570
+ Popover__namespace.Content,
2571
+ {
2572
+ side,
2573
+ sideOffset: 8,
2574
+ collisionPadding: 12,
2575
+ className: cx("z-[400] focus:outline-none", className),
2576
+ onEscapeKeyDown: (e) => {
2577
+ if (loading) e.preventDefault();
2578
+ },
2579
+ onInteractOutside: (e) => {
2580
+ if (loading) e.preventDefault();
2581
+ },
2582
+ children: [
2583
+ /* @__PURE__ */ jsxRuntime.jsxs(
2584
+ framerMotion.motion.div,
2585
+ {
2586
+ initial: { opacity: 0, scale: 0.95 },
2587
+ animate: { opacity: 1, scale: 1 },
2588
+ transition: { duration: 0.12, ease: [0.16, 1, 0.3, 1] },
2589
+ className: "w-64 rounded-lg border border-border bg-surface p-3.5 shadow-lg",
2590
+ children: [
2591
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2.5", children: [
2592
+ icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `mt-0.5 flex h-5 w-5 flex-shrink-0 items-center justify-center ${ICON_COLOR[tone]}`, children: icon }),
2593
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
2594
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-medium text-foreground", children: title }),
2595
+ description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 text-xs text-foreground-secondary leading-snug", children: description })
2596
+ ] })
2597
+ ] }),
2598
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 flex justify-end gap-2", children: [
2599
+ /* @__PURE__ */ jsxRuntime.jsx(Button_default, { content: cancelText, size: "sm", variant: "ghost", disabled: loading, onClick: handleCancel }),
2600
+ /* @__PURE__ */ jsxRuntime.jsx(
2601
+ Button_default,
2602
+ {
2603
+ content: confirmText,
2604
+ size: "sm",
2605
+ variant: CONFIRM_VARIANT[tone],
2606
+ loading,
2607
+ onClick: handleConfirm
2608
+ }
2609
+ )
2610
+ ] })
2611
+ ]
2612
+ }
2613
+ ),
2614
+ /* @__PURE__ */ jsxRuntime.jsx(Popover__namespace.Arrow, { className: "fill-surface" })
2615
+ ]
2616
+ }
2617
+ ) })
2618
+ ]
2619
+ }
2620
+ );
2564
2621
  }
2565
2622
  var DEFAULT_EVENTS = ["mousemove", "mousedown", "keydown", "touchstart", "scroll", "wheel"];
2566
2623
  var formatTime = (ms) => {
@@ -10329,6 +10386,7 @@ exports.AppShell = AppShell;
10329
10386
  exports.AutoComplete = AutoComplete;
10330
10387
  exports.Avatar = Avatar;
10331
10388
  exports.Badge = Badge;
10389
+ exports.Banner = Banner;
10332
10390
  exports.Blog = Blog;
10333
10391
  exports.Box = Box;
10334
10392
  exports.Breadcrumbs = Breadcrumbs;