@nebutra/ui 0.2.3 → 2.0.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.
Files changed (40) hide show
  1. package/dist/animate-in-BlvjVh2S.d.ts +250 -0
  2. package/dist/{canonical-Drca5UMj.d.ts → canonical-Bf4czR2u.d.ts} +13 -250
  3. package/dist/chat/index.d.ts +1 -0
  4. package/dist/chat/index.js +3 -0
  5. package/dist/chat/index.js.map +1 -0
  6. package/dist/components/index.d.ts +58 -123
  7. package/dist/components/index.js +219 -104
  8. package/dist/components/index.js.map +1 -1
  9. package/dist/editorial/index.d.ts +404 -0
  10. package/dist/editorial/index.js +868 -0
  11. package/dist/editorial/index.js.map +1 -0
  12. package/dist/icons/index.d.ts +1 -0
  13. package/dist/layout/index.js +6 -5
  14. package/dist/layout/index.js.map +1 -1
  15. package/dist/layouts/index.js +4 -13
  16. package/dist/layouts/index.js.map +1 -1
  17. package/dist/patterns/index.d.ts +1 -2
  18. package/dist/patterns/index.js +74 -55
  19. package/dist/patterns/index.js.map +1 -1
  20. package/dist/primitives/canonical.d.ts +3 -2
  21. package/dist/primitives/canonical.js +118 -72
  22. package/dist/primitives/canonical.js.map +1 -1
  23. package/dist/primitives/index.d.ts +78 -4
  24. package/dist/primitives/index.js +777 -453
  25. package/dist/primitives/index.js.map +1 -1
  26. package/dist/tailwind.preset.d.ts +2 -2
  27. package/dist/tailwind.preset.js +1 -1
  28. package/dist/tailwind.preset.js.map +1 -1
  29. package/dist/typography/fonts.css +2 -2
  30. package/dist/typography/index.d.ts +4 -4
  31. package/dist/typography/index.js +1 -1
  32. package/dist/typography/index.js.map +1 -1
  33. package/dist/utils/auth-surfaces.d.ts +33 -0
  34. package/dist/utils/auth-surfaces.js +9 -0
  35. package/dist/utils/auth-surfaces.js.map +1 -0
  36. package/dist/utils/index.d.ts +2 -4
  37. package/dist/utils/index.js +6 -3
  38. package/dist/utils/index.js.map +1 -1
  39. package/package.json +25 -7
  40. package/src/typography/fonts.css +2 -2
@@ -1,8 +1,4 @@
1
1
  "use client";
2
- import { Button as Button$1 } from '@lobehub/ui';
3
- export { ActionIcon, ActionIconGroup, Alert, Avatar, Button, Checkbox, DraggablePanel, DraggablePanelBody, DraggablePanelContainer, DraggablePanelFooter, DraggablePanelHeader, Flexbox, Form, FormGroup, FormItem, Highlighter, Image, Input, List, Markdown, Menu, Modal, SearchBar, Segmented, Select, SideNav, Tag, TextArea, Tooltip } from '@lobehub/ui';
4
- export { ChatInputArea, ChatItem, ChatList, MessageInput, MessageModal } from '@lobehub/ui/chat';
5
- export { default as Spotlight } from '@lobehub/ui/es/awesome/Spotlight/Spotlight';
6
2
  import { motion, AnimatePresence, useReducedMotion, m, LazyMotion, domAnimation } from 'framer-motion';
7
3
  export { AnimatePresence, LayoutGroup, LazyMotion, MotionConfig, animate, domAnimation, m, motion, useAnimationFrame, useInView, useMotionTemplate, useMotionValue, useReducedMotion, useScroll, useSpring, useTransform, useVelocity } from 'framer-motion';
8
4
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -11,7 +7,7 @@ import Image from 'next/image';
11
7
  import { Dialog as Dialog$1 } from '@base-ui/react/dialog';
12
8
  import * as React5 from 'react';
13
9
  import React5__default, { useEffectEvent, useId, useState } from 'react';
14
- import { colors, emerge, flow, brandSpring } from '@nebutra/brand';
10
+ import { colors, brandSpring, flow, emerge } from '@nebutra/brand';
15
11
  import { clsx } from 'clsx';
16
12
  import { twMerge } from 'tailwind-merge';
17
13
  import { cva } from 'class-variance-authority';
@@ -23,7 +19,7 @@ import '@xyflow/react/dist/style.css';
23
19
  import { wouldCreateCycle } from '@nebutra/graph-model';
24
20
  import { Input as Input$1 } from '@base-ui/react/input';
25
21
 
26
- // src/components/index.ts
22
+ // src/shared/animation/motion/index.ts
27
23
 
28
24
  // src/shared/animation/motion/tokens.ts
29
25
  var animationDurations = {
@@ -311,32 +307,33 @@ var overlayZIndex = {
311
307
  tooltip: 1070
312
308
  };
313
309
  var overlayClassNames = {
314
- backdrop: "fixed inset-0 bg-black/40 backdrop-blur-sm transition-[opacity,display] duration-[var(--motion-duration-flow)] ease-[var(--ease-out)] data-ending-style:opacity-0 data-starting-style:opacity-0 motion-reduce:transition-none",
310
+ backdrop: "fixed inset-0 bg-black/40 backdrop-blur-sm transition-[opacity,display] duration-[var(--motion-duration-flow)] ease-[var(--ease-brand)] data-ending-style:opacity-0 data-starting-style:opacity-0 motion-reduce:transition-none",
315
311
  modalSurface: [
316
312
  "fixed left-1/2 top-1/2 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4",
317
313
  "border border-border/60 bg-background/95 p-6 text-foreground backdrop-blur-xl",
318
314
  "rounded-[var(--radius-xl)]",
319
315
  shadowClasses["2xl"],
320
316
  "outline-none",
321
- "transition-[opacity,transform,display] duration-[var(--motion-duration-flow)] ease-[var(--ease-out)]",
317
+ "transition-[opacity,transform,display] duration-[var(--motion-duration-flow)] ease-[var(--ease-brand)]",
322
318
  "data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0",
323
319
  "motion-reduce:transition-none motion-reduce:data-starting-style:transform-none motion-reduce:data-ending-style:transform-none"
324
320
  ].join(" "),
325
321
  popoverSurface: [
326
- "w-72 rounded-[var(--radius-lg)] border border-border/70 bg-popover/95 p-4 text-popover-foreground backdrop-blur-md",
322
+ "w-72 origin-[var(--transform-origin)] rounded-[var(--radius-lg)] border border-border/70 bg-popover/95 p-4 text-popover-foreground backdrop-blur-md",
327
323
  shadowClasses.xl,
328
- "outline-none transition-[opacity,transform,display] duration-[var(--motion-duration-flow)] ease-[var(--ease-out)]",
329
- "data-[open]:opacity-100 data-[closed]:opacity-0 data-[closed]:scale-95 data-[open]:scale-100",
324
+ "outline-none transition-[opacity,transform,display] duration-[var(--motion-duration-flow)] ease-[var(--ease-brand)]",
325
+ "data-[open]:opacity-100 data-[closed]:opacity-0 data-[closed]:scale-[0.97] data-[open]:scale-100",
330
326
  "motion-reduce:transition-none motion-reduce:data-[closed]:transform-none motion-reduce:data-[open]:transform-none"
331
327
  ].join(" "),
332
328
  tooltipSurface: [
333
- "overflow-hidden rounded-[var(--radius-md)] border border-border/70 bg-popover/95 px-3 py-1.5 text-sm text-popover-foreground backdrop-blur-md",
329
+ "origin-[var(--transform-origin)] overflow-hidden rounded-[var(--radius-md)] border border-border/70 bg-popover/95 px-3 py-1.5 text-sm text-popover-foreground backdrop-blur-md",
334
330
  shadowClasses.md,
335
- "transition-[opacity,transform,display] duration-[var(--motion-duration-flow)] ease-[var(--ease-out)]",
336
- "data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0",
331
+ "transition-[opacity,transform,display] duration-[var(--motion-duration-flow)] ease-[var(--ease-brand)]",
332
+ "data-starting-style:scale-[0.97] data-starting-style:opacity-0 data-ending-style:scale-[0.97] data-ending-style:opacity-0",
333
+ "data-[instant]:duration-0",
337
334
  "motion-reduce:transition-none motion-reduce:data-starting-style:transform-none motion-reduce:data-ending-style:transform-none"
338
335
  ].join(" "),
339
- closeButton: `absolute right-4 top-4 rounded-[var(--radius-sm)] opacity-70 ring-offset-background ${overlayFocusRingClassName} transition-opacity duration-[var(--motion-duration-micro)] ease-[var(--ease-out)] hover:opacity-100 disabled:pointer-events-none data-[open]:bg-accent data-[open]:text-muted-foreground motion-reduce:transition-none`
336
+ closeButton: `absolute right-4 top-4 rounded-[var(--radius-sm)] opacity-70 ring-offset-background ${overlayFocusRingClassName} transition-opacity duration-[var(--motion-duration-micro)] ease-[var(--ease-brand)] hover:opacity-100 disabled:pointer-events-none data-[open]:bg-accent data-[open]:text-muted-foreground motion-reduce:transition-none`
340
337
  };
341
338
  function cn(...inputs) {
342
339
  return twMerge(clsx(inputs));
@@ -560,7 +557,8 @@ var buttonVariants = cva(
560
557
  "inline-flex items-center justify-center gap-2 whitespace-nowrap",
561
558
  "rounded-[var(--btn-default-radius,var(--radius-md))]",
562
559
  "text-[length:var(--control-font-size-md,0.875rem)] font-[number:var(--font-weight-medium,500)]",
563
- "transition-colors duration-micro ease-out",
560
+ "transition-[color,background-color,border-color,transform] duration-flow ease-[var(--ease-brand)]",
561
+ "active:scale-[0.97] motion-reduce:active:scale-100 motion-reduce:transition-none",
564
562
  "disabled:pointer-events-none disabled:opacity-50",
565
563
  "aria-busy:cursor-wait"
566
564
  ].join(" "),
@@ -937,19 +935,54 @@ var Textarea = ({
937
935
  };
938
936
  Textarea.displayName = "Textarea";
939
937
  var DEFAULT_TOOLTIP_DELAY_MS = 150;
938
+ var SKIP_DELAY_WINDOW_MS = 400;
939
+ var lastTooltipOpenAt = 0;
940
+ var skipDelayListeners = /* @__PURE__ */ new Set();
941
+ function markTooltipOpened() {
942
+ lastTooltipOpenAt = Date.now();
943
+ for (const listener of skipDelayListeners) listener();
944
+ }
945
+ function shouldSkipDelay() {
946
+ return Date.now() - lastTooltipOpenAt < SKIP_DELAY_WINDOW_MS;
947
+ }
948
+ function useSkipDelay() {
949
+ const [, tick] = React5.useReducer((count) => count + 1, 0);
950
+ React5.useEffect(() => {
951
+ skipDelayListeners.add(tick);
952
+ return () => {
953
+ skipDelayListeners.delete(tick);
954
+ };
955
+ }, []);
956
+ return shouldSkipDelay();
957
+ }
958
+ var TooltipInstantContext = React5.createContext(false);
940
959
  var TooltipProvider = ({
941
960
  children,
942
961
  delayDuration = DEFAULT_TOOLTIP_DELAY_MS
943
962
  }) => {
944
- return /* @__PURE__ */ jsx(Tooltip$1.Provider, { delay: delayDuration, children });
963
+ const skipDelay = useSkipDelay();
964
+ return /* @__PURE__ */ jsx(Tooltip$1.Provider, { delay: skipDelay ? 0 : delayDuration, children });
945
965
  };
946
966
  var Tooltip = ({
947
967
  delayDuration,
948
968
  children,
969
+ onOpenChange,
949
970
  ...props
950
971
  }) => {
951
- const delay = delayDuration ?? DEFAULT_TOOLTIP_DELAY_MS;
952
- return /* @__PURE__ */ jsx(Tooltip$1.Provider, { delay, children: /* @__PURE__ */ jsx(Tooltip$1.Root, { ...props, children }) });
972
+ const skipDelay = useSkipDelay();
973
+ const instant = delayDuration == null && skipDelay;
974
+ const delay = delayDuration ?? (instant ? 0 : DEFAULT_TOOLTIP_DELAY_MS);
975
+ return /* @__PURE__ */ jsx(TooltipInstantContext.Provider, { value: instant, children: /* @__PURE__ */ jsx(Tooltip$1.Provider, { delay, children: /* @__PURE__ */ jsx(
976
+ Tooltip$1.Root,
977
+ {
978
+ ...props,
979
+ onOpenChange: (open, eventDetails) => {
980
+ if (open) markTooltipOpened();
981
+ onOpenChange?.(open, eventDetails);
982
+ },
983
+ children
984
+ }
985
+ ) }) });
953
986
  };
954
987
  var TooltipTrigger = ({
955
988
  asChild,
@@ -979,25 +1012,29 @@ var TooltipContent = ({
979
1012
  alignOffset = 0,
980
1013
  ref,
981
1014
  ...props
982
- }) => /* @__PURE__ */ jsx(Tooltip$1.Portal, { children: /* @__PURE__ */ jsx(
983
- Tooltip$1.Positioner,
984
- {
985
- side,
986
- align,
987
- sideOffset,
988
- alignOffset,
989
- style: { zIndex: overlayZIndex.tooltip },
990
- children: /* @__PURE__ */ jsx(
991
- Tooltip$1.Popup,
992
- {
993
- ref,
994
- className: cn(overlayClassNames.tooltipSurface, className),
995
- style: { zIndex: overlayZIndex.tooltip, ...style },
996
- ...props
997
- }
998
- )
999
- }
1000
- ) });
1015
+ }) => {
1016
+ const instant = React5.use(TooltipInstantContext);
1017
+ return /* @__PURE__ */ jsx(Tooltip$1.Portal, { children: /* @__PURE__ */ jsx(
1018
+ Tooltip$1.Positioner,
1019
+ {
1020
+ side,
1021
+ align,
1022
+ sideOffset,
1023
+ alignOffset,
1024
+ style: { zIndex: overlayZIndex.tooltip },
1025
+ children: /* @__PURE__ */ jsx(
1026
+ Tooltip$1.Popup,
1027
+ {
1028
+ ref,
1029
+ className: cn(overlayClassNames.tooltipSurface, className),
1030
+ "data-instant": instant || void 0,
1031
+ style: { zIndex: overlayZIndex.tooltip, ...style },
1032
+ ...props
1033
+ }
1034
+ )
1035
+ }
1036
+ ) });
1037
+ };
1001
1038
  TooltipContent.displayName = "TooltipContent";
1002
1039
  var MAX_VISUALIZER_BARS = 64;
1003
1040
  var VISUALIZER_BAR_STYLES = Array.from({ length: MAX_VISUALIZER_BARS }, (_, index) => ({
@@ -1330,7 +1367,7 @@ function PromptSubmitAction({
1330
1367
  size: "icon",
1331
1368
  className: cn(
1332
1369
  "h-8 w-8 rounded-full transition-[background-color,border-color,box-shadow,color,opacity,transform] duration-micro",
1333
- isRecording ? "bg-transparent hover:bg-accent text-destructive hover:text-destructive/80" : hasContent ? "bg-primary hover:bg-primary/90 text-primary-foreground" : "bg-transparent hover:bg-accent text-muted-foreground hover:text-foreground"
1370
+ isRecording ? "bg-transparent hover:bg-accent text-destructive hover:text-destructive/80" : hasContent ? "bg-primary hover:bg-primary/90 text-primary-foreground" : "bg-transparent hover:bg-accent text-muted-foreground hover:text-accent-foreground"
1334
1371
  ),
1335
1372
  onClick: onActivate,
1336
1373
  disabled: isLoading && !hasContent,
@@ -1576,90 +1613,168 @@ var PromptInputBox = (props) => {
1576
1613
  ] });
1577
1614
  };
1578
1615
  PromptInputBox.displayName = "PromptInputBox";
1579
- var emergeTransition = {
1580
- duration: emerge.transition.duration,
1581
- ease: [0.16, 1, 0.3, 1]
1582
- };
1583
- var flowTransition = {
1584
- duration: flow.transition.duration,
1585
- ease: [0, 0, 0.2, 1]
1616
+
1617
+ // src/tokens/motion.ts
1618
+ var motionDurations = {
1619
+ /** 300ms — content unveil (slide, expand, accordion, drawer) */
1620
+ reveal: 300};
1621
+ var motionVariants = {
1622
+ fadeInUp: {
1623
+ initial: { opacity: 0, transform: "translateY(20px)" },
1624
+ animate: { opacity: 1, transform: "translateY(0px)" },
1625
+ exit: { opacity: 0, transform: "translateY(10px)" }
1626
+ },
1627
+ scaleIn: {
1628
+ initial: { opacity: 0, scale: 0.95 },
1629
+ animate: { opacity: 1, scale: 1 },
1630
+ exit: { opacity: 0, scale: 0.95 }
1631
+ }};
1632
+ var staggerContainers = {
1633
+ fast: {
1634
+ initial: {},
1635
+ animate: { transition: { staggerChildren: 0.04, delayChildren: 0 } }
1636
+ },
1637
+ normal: {
1638
+ initial: {},
1639
+ animate: { transition: { staggerChildren: 0.06, delayChildren: 0.04 } }
1640
+ },
1641
+ slow: {
1642
+ initial: {},
1643
+ animate: { transition: { staggerChildren: 0.08, delayChildren: 0.05 } }
1644
+ }
1586
1645
  };
1587
- var defaultSpringTransition = {
1588
- type: "spring",
1589
- stiffness: brandSpring.default.stiffness,
1590
- damping: brandSpring.default.damping,
1591
- mass: brandSpring.default.mass
1646
+ var viewportSettings = {
1647
+ once: { once: true, margin: "-100px" }};
1648
+ var fadeInVariant = {
1649
+ initial: { opacity: 0 },
1650
+ animate: { opacity: 1 },
1651
+ exit: { opacity: 0 },
1652
+ transition: { duration: 0.3 }
1592
1653
  };
1593
1654
  var PRESETS = {
1655
+ /** 涌现 — materialize from the cloud (default) */
1594
1656
  emerge: {
1595
1657
  initial: emerge.initial,
1596
1658
  animate: emerge.animate,
1597
1659
  exit: emerge.exit,
1598
- transition: emergeTransition
1660
+ transition: emerge.transition
1599
1661
  },
1662
+ /** 流动 — stream horizontally */
1600
1663
  flow: {
1601
1664
  initial: flow.initial,
1602
1665
  animate: flow.animate,
1603
1666
  exit: flow.exit,
1604
- transition: flowTransition
1667
+ transition: flow.transition
1605
1668
  },
1606
- fade: {
1607
- initial: { opacity: 0 },
1608
- animate: { opacity: 1 },
1609
- exit: { opacity: 0 },
1610
- transition: { duration: 0.3 }
1669
+ /** Simple fade */
1670
+ fade: fadeInVariant,
1671
+ /** Fade + rise */
1672
+ fadeUp: motionVariants.fadeInUp,
1673
+ /** Scale in */
1674
+ scale: motionVariants.scaleIn,
1675
+ /**
1676
+ * Keyed content swap — short, symmetric, blur-softened. Rises in, sinks out.
1677
+ * Shorter and shallower than `emerge` on purpose: a swap replaces content the
1678
+ * reader is already looking at, so it must resolve inside the reveal rail.
1679
+ * Pair with `AnimateSwap`.
1680
+ */
1681
+ swap: {
1682
+ initial: { opacity: 0, transform: "translateY(10px)", filter: "blur(4px)" },
1683
+ animate: { opacity: 1, transform: "translateY(0px)", filter: "blur(0px)" },
1684
+ exit: { opacity: 0, transform: "translateY(-10px)", filter: "blur(4px)" },
1685
+ transition: { duration: motionDurations.reveal / 1e3 }
1611
1686
  },
1612
- fadeUp: {
1613
- initial: { opacity: 0, y: 16 },
1614
- animate: { opacity: 1, y: 0 },
1615
- exit: { opacity: 0, y: 16 },
1616
- transition: defaultSpringTransition
1687
+ /** Off-canvas panel entering from the right edge (drawer, sheet). */
1688
+ slideFromRight: {
1689
+ initial: { transform: "translateX(100%)" },
1690
+ animate: { transform: "translateX(0%)" },
1691
+ exit: { transform: "translateX(100%)" },
1692
+ transition: brandSpring.default
1617
1693
  },
1618
- scale: {
1619
- initial: { opacity: 0, scale: 0.95 },
1620
- animate: { opacity: 1, scale: 1 },
1621
- exit: { opacity: 0, scale: 0.95 },
1622
- transition: defaultSpringTransition
1694
+ /** Off-canvas panel entering from the left edge. */
1695
+ slideFromLeft: {
1696
+ initial: { transform: "translateX(-100%)" },
1697
+ animate: { transform: "translateX(0%)" },
1698
+ exit: { transform: "translateX(-100%)" },
1699
+ transition: brandSpring.default
1700
+ },
1701
+ /** Off-canvas panel entering from the top edge (banner, command bar). */
1702
+ slideFromTop: {
1703
+ initial: { transform: "translateY(-100%)" },
1704
+ animate: { transform: "translateY(0%)" },
1705
+ exit: { transform: "translateY(-100%)" },
1706
+ transition: brandSpring.default
1707
+ },
1708
+ /** Off-canvas panel entering from the bottom edge (mobile action sheet). */
1709
+ slideFromBottom: {
1710
+ initial: { transform: "translateY(100%)" },
1711
+ animate: { transform: "translateY(0%)" },
1712
+ exit: { transform: "translateY(100%)" },
1713
+ transition: brandSpring.default
1623
1714
  }
1624
1715
  };
1625
- var STAGGER = { fast: 0.05, normal: 0.1, slow: 0.2 };
1626
1716
  function MotionDiv(props) {
1627
1717
  return /* @__PURE__ */ jsx(LazyMotion, { features: domAnimation, children: /* @__PURE__ */ jsx(m.div, { ...props }) });
1628
1718
  }
1629
1719
  function AnimateIn(props) {
1630
- const { children, preset = "emerge", delay = 0, duration, inView = false, className } = props;
1720
+ const {
1721
+ children,
1722
+ preset = "fade",
1723
+ delay = 0,
1724
+ duration,
1725
+ inView = false,
1726
+ className,
1727
+ ...rest
1728
+ } = props;
1631
1729
  const shouldReduce = useReducedMotion();
1632
- const { initial, animate: animate2, exit, transition } = PRESETS[preset];
1633
- const t = {
1634
- ...transition,
1635
- ...delay ? { delay } : {},
1730
+ const base = PRESETS[preset] || PRESETS.fade;
1731
+ const initial = shouldReduce ? { opacity: 0 } : base.initial;
1732
+ const animate2 = shouldReduce ? { opacity: 1 } : base.animate;
1733
+ const exit = shouldReduce ? { opacity: 0 } : "exit" in base ? base.exit : void 0;
1734
+ const transition = {
1735
+ ...shouldReduce ? { duration: 0.15 } : base.transition,
1736
+ delay,
1636
1737
  ...duration ? { duration } : {}
1637
1738
  };
1638
- if (shouldReduce) return /* @__PURE__ */ jsx("div", { className, children });
1639
1739
  if (inView) {
1640
1740
  return /* @__PURE__ */ jsx(
1641
1741
  MotionDiv,
1642
1742
  {
1743
+ ...rest,
1643
1744
  className,
1644
1745
  initial,
1645
1746
  whileInView: animate2,
1646
- exit,
1647
- viewport: { once: true, margin: "-10%" },
1648
- transition: t,
1747
+ ...exit && { exit },
1748
+ transition,
1749
+ viewport: viewportSettings.once,
1649
1750
  children
1650
1751
  }
1651
1752
  );
1652
1753
  }
1653
- return /* @__PURE__ */ jsx(MotionDiv, { className, initial, animate: animate2, exit, transition: t, children });
1754
+ return /* @__PURE__ */ jsx(
1755
+ MotionDiv,
1756
+ {
1757
+ ...rest,
1758
+ className,
1759
+ initial,
1760
+ animate: animate2,
1761
+ ...exit && { exit },
1762
+ transition,
1763
+ children
1764
+ }
1765
+ );
1766
+ }
1767
+ function AnimateSwap(props) {
1768
+ const { swapKey, ...animateInProps } = props;
1769
+ return /* @__PURE__ */ jsx(LazyMotion, { features: domAnimation, children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsx(AnimateIn, { ...animateInProps }, swapKey) }) });
1654
1770
  }
1655
1771
  function AnimateInGroup(props) {
1656
1772
  const { children, stagger = "normal", inView = false, className } = props;
1657
1773
  const shouldReduce = useReducedMotion();
1658
- const variants = {
1659
- initial: {},
1660
- animate: { transition: { staggerChildren: STAGGER[stagger] } }
1661
- };
1662
- if (shouldReduce) return /* @__PURE__ */ jsx("div", { className, children });
1774
+ const container = staggerContainers[stagger];
1775
+ if (shouldReduce) {
1776
+ return /* @__PURE__ */ jsx("div", { className, children });
1777
+ }
1663
1778
  if (inView) {
1664
1779
  return /* @__PURE__ */ jsx(
1665
1780
  MotionDiv,
@@ -1667,13 +1782,13 @@ function AnimateInGroup(props) {
1667
1782
  className,
1668
1783
  initial: "initial",
1669
1784
  whileInView: "animate",
1670
- viewport: { once: true, margin: "-10%" },
1671
- variants,
1785
+ viewport: viewportSettings.once,
1786
+ variants: container,
1672
1787
  children
1673
1788
  }
1674
1789
  );
1675
1790
  }
1676
- return /* @__PURE__ */ jsx(MotionDiv, { className, initial: "initial", animate: "animate", variants, children });
1791
+ return /* @__PURE__ */ jsx(MotionDiv, { className, initial: "initial", animate: "animate", variants: container, children });
1677
1792
  }
1678
1793
  function AsciiText({ text, className = "", font = slant }) {
1679
1794
  const asciiTextRef = useAsciiText({
@@ -1938,14 +2053,14 @@ function removeFlowEdge(graph, flowEdgeId, edgeIdentity) {
1938
2053
  };
1939
2054
  }
1940
2055
  var XYFLOW_TOKEN_THEME = {
1941
- ["--xy-background-pattern-color"]: "var(--neutral-6)",
1942
- ["--xy-edge-stroke"]: "var(--neutral-8)",
1943
- ["--xy-connectionline-stroke"]: "var(--neutral-8)",
1944
- ["--xy-handle-background-color"]: "var(--neutral-9)",
1945
- ["--xy-handle-border-color"]: "var(--neutral-7)",
1946
- ["--xy-controls-button-background-color"]: "var(--neutral-2)",
1947
- ["--xy-controls-button-border-color"]: "var(--neutral-7)",
1948
- ["--xy-controls-button-color"]: "var(--neutral-11)"
2056
+ "--xy-background-pattern-color": "var(--neutral-6)",
2057
+ "--xy-edge-stroke": "var(--neutral-8)",
2058
+ "--xy-connectionline-stroke": "var(--neutral-8)",
2059
+ "--xy-handle-background-color": "var(--neutral-9)",
2060
+ "--xy-handle-border-color": "var(--neutral-7)",
2061
+ "--xy-controls-button-background-color": "var(--neutral-2)",
2062
+ "--xy-controls-button-border-color": "var(--neutral-7)",
2063
+ "--xy-controls-button-color": "var(--neutral-11)"
1949
2064
  };
1950
2065
  var nodeCardVariants = cva(
1951
2066
  "min-w-[160px] rounded-[var(--radius-lg)] border bg-neutral-2 px-3 py-2 text-neutral-12 shadow-sm transition-colors",
@@ -2032,7 +2147,7 @@ function NodeGraphCanvas({
2032
2147
  setRejection(result.reason);
2033
2148
  }
2034
2149
  };
2035
- return /* @__PURE__ */ jsx(AnimateIn, { preset: "emerge", children: /* @__PURE__ */ jsx(
2150
+ return /* @__PURE__ */ jsx(
2036
2151
  "div",
2037
2152
  {
2038
2153
  style: XYFLOW_TOKEN_THEME,
@@ -2067,11 +2182,11 @@ function NodeGraphCanvas({
2067
2182
  children: [
2068
2183
  /* @__PURE__ */ jsx("span", { children: rejection }),
2069
2184
  /* @__PURE__ */ jsx(
2070
- Button$1,
2185
+ Button,
2071
2186
  {
2072
- size: "small",
2073
- type: "text",
2074
- icon: /* @__PURE__ */ jsx(CrossSmall, { size: 14 }),
2187
+ size: "sm",
2188
+ variant: "ghost",
2189
+ prefix: /* @__PURE__ */ jsx(CrossSmall, { size: 14 }),
2075
2190
  "aria-label": "Dismiss connection error",
2076
2191
  onClick: () => setRejection(null),
2077
2192
  children: "Dismiss"
@@ -2084,7 +2199,7 @@ function NodeGraphCanvas({
2084
2199
  }
2085
2200
  ) })
2086
2201
  }
2087
- ) });
2202
+ );
2088
2203
  }
2089
2204
  var containerVariants = {
2090
2205
  hidden: { opacity: 0, y: 20 },
@@ -2419,7 +2534,7 @@ var inputControlButtonVariants = cva(
2419
2534
  [
2420
2535
  "absolute right-[var(--input-control-inset)] top-1/2 flex size-[var(--input-control-size)] -translate-y-1/2 items-center justify-center",
2421
2536
  "rounded-[var(--radius-sm)] text-muted-foreground transition-colors duration-micro ease-out",
2422
- "hover:bg-accent hover:text-foreground",
2537
+ "hover:bg-accent hover:text-accent-foreground",
2423
2538
  "focus-visible:outline-none",
2424
2539
  "disabled:pointer-events-none disabled:opacity-50",
2425
2540
  "[&_svg]:size-[var(--input-control-icon-size)]"
@@ -2771,7 +2886,7 @@ function TeamChat({
2771
2886
  "div",
2772
2887
  {
2773
2888
  className: cn(
2774
- "w-full max-w-[var(--container-content)] mx-auto p-6 bg-white dark:bg-black rounded-[var(--radius-3xl)] shadow-lg flex flex-col h-[550px] border border-border",
2889
+ "w-full max-w-content mx-auto p-6 bg-white dark:bg-black rounded-[var(--radius-3xl)] shadow-lg flex flex-col h-[550px] border border-border",
2775
2890
  className
2776
2891
  ),
2777
2892
  children: [
@@ -2886,6 +3001,6 @@ function TeamChat({
2886
3001
  );
2887
3002
  }
2888
3003
 
2889
- export { AnimateIn, AnimateInGroup, AnimatedCard, AnimatedDrawer, AnimatedList, AnimatedModal, AnimatedPopover, AsciiText, ChangelogWidget, FadeIn, ImageViewDialog, MAX_VISUALIZER_BARS, NodeGraphCanvas, OnboardingChecklist, PageTransition, PromptAttachmentPreviews, PromptInputBox, ScaleIn, SlideIn, TeamChat, VISUALIZER_BAR_STYLES, VoiceRecorder, animatedList, animatedListItem, animationDistances, animationDurations, animationEasings, animationSprings, animationTransitions, drawerSurface, fadeIn, formatRecordingTime, getFilePreviewKey, isImageFile, modalSurface, pageTransition, popoverSurface, preventDragDefaults, reducedMotionVariants, scaleIn, slideIn };
3004
+ export { AnimateIn, AnimateInGroup, AnimateSwap, AnimatedCard, AnimatedDrawer, AnimatedList, AnimatedModal, AnimatedPopover, AsciiText, ChangelogWidget, FadeIn, GRAPH_NODE_FLOW_TYPE, ImageViewDialog, MAX_VISUALIZER_BARS, NodeGraphCanvas, OnboardingChecklist, PageTransition, PromptAttachmentPreviews, PromptInputBox, ScaleIn, SlideIn, TeamChat, VISUALIZER_BAR_STYLES, VoiceRecorder, animatedList, animatedListItem, animationDistances, animationDurations, animationEasings, animationSprings, animationTransitions, applyNodePositions, drawerSurface, fadeIn, formatRecordingTime, getFilePreviewKey, graphToFlow, isImageFile, modalSurface, pageTransition, popoverSurface, preventDragDefaults, reducedMotionVariants, removeFlowEdge, removeNode, scaleIn, slideIn, tryAddEdge };
2890
3005
  //# sourceMappingURL=index.js.map
2891
3006
  //# sourceMappingURL=index.js.map