@40rty/ams-ui 0.1.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 (299) hide show
  1. package/dist/agent.js +148 -0
  2. package/dist/catalog-data.js +93 -0
  3. package/dist/catalog-entries.js +8 -0
  4. package/dist/chunk-432XYPDT.js +1012 -0
  5. package/dist/chunk-54QPRWEG.js +2800 -0
  6. package/dist/chunk-CKGGECAQ.js +239 -0
  7. package/dist/chunk-E3IJDSKY.js +173 -0
  8. package/dist/chunk-JQNZ5UUK.js +226 -0
  9. package/dist/chunk-LQLOG2V3.js +649 -0
  10. package/dist/chunk-MHUEIBJ3.js +117 -0
  11. package/dist/chunk-ORIOBWTD.js +112 -0
  12. package/dist/css/preset/motion.css +78 -0
  13. package/dist/css/preset/tailwind-theme.css +163 -0
  14. package/dist/css/shell/mobile/island.css +478 -0
  15. package/dist/hooks.js +25 -0
  16. package/dist/index.js +7165 -0
  17. package/dist/motion.js +113 -0
  18. package/dist/shell.js +5621 -0
  19. package/dist/types/agent/AgentStreamingState.d.ts +58 -0
  20. package/dist/types/agent/ProseSurface.d.ts +31 -0
  21. package/dist/types/agent/index.d.ts +8 -0
  22. package/dist/types/agent/phase-label.d.ts +13 -0
  23. package/dist/types/agent/presence/AgentPresenceWidget.d.ts +85 -0
  24. package/dist/types/agent/presence/BriefIdentity.d.ts +9 -0
  25. package/dist/types/agent/presence/CompactRead.d.ts +44 -0
  26. package/dist/types/agent/presence/CriteriaRail.d.ts +68 -0
  27. package/dist/types/agent/presence/DefaultNotch.d.ts +2 -0
  28. package/dist/types/agent/presence/FactChip.d.ts +10 -0
  29. package/dist/types/agent/presence/InlinePresenceRead.d.ts +25 -0
  30. package/dist/types/agent/presence/KnowledgePeek.d.ts +23 -0
  31. package/dist/types/agent/presence/LayoutMorphSkeleton.d.ts +59 -0
  32. package/dist/types/agent/presence/PresenceBrief.d.ts +29 -0
  33. package/dist/types/agent/presence/PresenceFiller.d.ts +24 -0
  34. package/dist/types/agent/presence/SourceSift.d.ts +48 -0
  35. package/dist/types/agent/presence/StreamRead.d.ts +50 -0
  36. package/dist/types/agent/presence/VoiceLine.d.ts +19 -0
  37. package/dist/types/agent/presence/band-beat.d.ts +40 -0
  38. package/dist/types/agent/presence/band-row.d.ts +188 -0
  39. package/dist/types/agent/presence/cite-image.d.ts +9 -0
  40. package/dist/types/agent/presence/class-names.d.ts +134 -0
  41. package/dist/types/agent/presence/element-view.d.ts +83 -0
  42. package/dist/types/agent/presence/fact-forms/baseline-forms.d.ts +20 -0
  43. package/dist/types/agent/presence/fact-forms/class-names.d.ts +14 -0
  44. package/dist/types/agent/presence/fact-forms/index.d.ts +3 -0
  45. package/dist/types/agent/presence/fact-forms/register.d.ts +9 -0
  46. package/dist/types/agent/presence/fact-rail.d.ts +76 -0
  47. package/dist/types/agent/presence/fact-slots.d.ts +97 -0
  48. package/dist/types/agent/presence/folded.d.ts +26 -0
  49. package/dist/types/agent/presence/forms.d.ts +5 -0
  50. package/dist/types/agent/presence/index.d.ts +39 -0
  51. package/dist/types/agent/presence/notch/PresenceNotch.d.ts +20 -0
  52. package/dist/types/agent/presence/parts.d.ts +29 -0
  53. package/dist/types/agent/presence/read-data.d.ts +48 -0
  54. package/dist/types/agent/presence/reads.d.ts +37 -0
  55. package/dist/types/agent/presence/sift-deck.d.ts +58 -0
  56. package/dist/types/agent/presence/source-cards/ArticleSourceCard.d.ts +4 -0
  57. package/dist/types/agent/presence/source-cards/CollectionSourceCard.d.ts +4 -0
  58. package/dist/types/agent/presence/source-cards/PolicySourceCard.d.ts +4 -0
  59. package/dist/types/agent/presence/source-cards/ProductSourceCard.d.ts +4 -0
  60. package/dist/types/agent/presence/source-cards/ReviewSourceCard.d.ts +4 -0
  61. package/dist/types/agent/presence/source-cards/SourceCard.d.ts +4 -0
  62. package/dist/types/agent/presence/source-cards/card-frame.d.ts +38 -0
  63. package/dist/types/agent/presence/source-cards/card-marks.d.ts +69 -0
  64. package/dist/types/agent/presence/source-cards/card-plate.d.ts +20 -0
  65. package/dist/types/agent/presence/source-cards/card-shell.d.ts +91 -0
  66. package/dist/types/agent/presence/source-cards/register.d.ts +6 -0
  67. package/dist/types/agent/presence/source-cards/review-passage.d.ts +53 -0
  68. package/dist/types/agent/presence/swatch.d.ts +4 -0
  69. package/dist/types/agent/presence/use-band-facts.d.ts +9 -0
  70. package/dist/types/agent/presence/use-forget-fact.d.ts +56 -0
  71. package/dist/types/agent/presence/use-measured-height.d.ts +11 -0
  72. package/dist/types/catalog-data/base.d.ts +2 -0
  73. package/dist/types/catalog-data/chat.d.ts +55 -0
  74. package/dist/types/catalog-data/content.d.ts +1129 -0
  75. package/dist/types/catalog-data/ecommerce.d.ts +4842 -0
  76. package/dist/types/catalog-data/index.d.ts +7 -0
  77. package/dist/types/catalog-data/social.d.ts +1552 -0
  78. package/dist/types/catalog-data/tokens.d.ts +20 -0
  79. package/dist/types/catalog-data/ugc.d.ts +50 -0
  80. package/dist/types/catalog-entries.d.ts +35 -0
  81. package/dist/types/catalog.d.ts +18 -0
  82. package/dist/types/components/SkeletonSwap.d.ts +27 -0
  83. package/dist/types/components/agentic/AgentText.d.ts +44 -0
  84. package/dist/types/components/agentic/Turn.d.ts +21 -0
  85. package/dist/types/components/browse/CanvasBootLoader.d.ts +16 -0
  86. package/dist/types/components/browse/ContinuationLoading.d.ts +22 -0
  87. package/dist/types/components/browse/canvas-booting.d.ts +37 -0
  88. package/dist/types/components/browse/constants.d.ts +2 -0
  89. package/dist/types/components/browse/index.d.ts +4 -0
  90. package/dist/types/components/chat/SuggestionCards.d.ts +2 -0
  91. package/dist/types/components/chat/index.d.ts +1 -0
  92. package/dist/types/components/content/FAQ.d.ts +12 -0
  93. package/dist/types/components/content/FeatureGrid.d.ts +11 -0
  94. package/dist/types/components/content/InfoCards.d.ts +16 -0
  95. package/dist/types/components/content/Reviews.d.ts +9 -0
  96. package/dist/types/components/content/RichText.d.ts +10 -0
  97. package/dist/types/components/content/article/ArticleDetail.d.ts +15 -0
  98. package/dist/types/components/content/article/BlogCard.d.ts +11 -0
  99. package/dist/types/components/content/article/BlogPosts.d.ts +19 -0
  100. package/dist/types/components/content/page/PageDetail.d.ts +13 -0
  101. package/dist/types/components/content/page/PolicyDetail.d.ts +23 -0
  102. package/dist/types/components/ecommerce/cart/AddToCartButton.d.ts +9 -0
  103. package/dist/types/components/ecommerce/cart/CartContent.d.ts +40 -0
  104. package/dist/types/components/ecommerce/cart/CartDrawer.d.ts +41 -0
  105. package/dist/types/components/ecommerce/cart/CartFoot.d.ts +30 -0
  106. package/dist/types/components/ecommerce/cart/CartLineItem.d.ts +13 -0
  107. package/dist/types/components/ecommerce/cart/CartLineRow.d.ts +17 -0
  108. package/dist/types/components/ecommerce/cart/CartPromoCode.d.ts +29 -0
  109. package/dist/types/components/ecommerce/cart/CartSummary.d.ts +7 -0
  110. package/dist/types/components/ecommerce/cart/CartWidget.d.ts +10 -0
  111. package/dist/types/components/ecommerce/cart/VariantPickerModal.d.ts +12 -0
  112. package/dist/types/components/ecommerce/cart/cart-format.d.ts +8 -0
  113. package/dist/types/components/ecommerce/cart/use-cart-view.d.ts +50 -0
  114. package/dist/types/components/ecommerce/collection/CollectionCard.d.ts +10 -0
  115. package/dist/types/components/ecommerce/collection/CollectionGrid.d.ts +8 -0
  116. package/dist/types/components/ecommerce/collection/CollectionList.d.ts +13 -0
  117. package/dist/types/components/ecommerce/collection/internal/CollectionListItem.d.ts +13 -0
  118. package/dist/types/components/ecommerce/product/AddToRegistry.d.ts +36 -0
  119. package/dist/types/components/ecommerce/product/ComparisonTable.d.ts +25 -0
  120. package/dist/types/components/ecommerce/product/ComparisonTableSkeleton.d.ts +11 -0
  121. package/dist/types/components/ecommerce/product/PresenceProductRail.d.ts +35 -0
  122. package/dist/types/components/ecommerce/product/ProductBadge.d.ts +9 -0
  123. package/dist/types/components/ecommerce/product/ProductCard.d.ts +27 -0
  124. package/dist/types/components/ecommerce/product/ProductDetail.d.ts +25 -0
  125. package/dist/types/components/ecommerce/product/ProductGallery.d.ts +19 -0
  126. package/dist/types/components/ecommerce/product/ProductGrid.d.ts +26 -0
  127. package/dist/types/components/ecommerce/product/ProductImage.d.ts +54 -0
  128. package/dist/types/components/ecommerce/product/ProductOption.d.ts +9 -0
  129. package/dist/types/components/ecommerce/product/ProductPrice.d.ts +8 -0
  130. package/dist/types/components/ecommerce/product/ProductVideoPlayer.d.ts +17 -0
  131. package/dist/types/components/ecommerce/product/comparison-table-parts.d.ts +41 -0
  132. package/dist/types/components/ecommerce/product/comparison-table-rows.d.ts +24 -0
  133. package/dist/types/components/ecommerce/product/image-trim.d.ts +35 -0
  134. package/dist/types/components/ecommerce/product/product-card-glyphs.d.ts +2 -0
  135. package/dist/types/components/ecommerce/product/registry-logos.d.ts +2 -0
  136. package/dist/types/components/ecommerce/product/trim-geometry.d.ts +45 -0
  137. package/dist/types/components/ecommerce/wishlist/WishlistDrawer.d.ts +16 -0
  138. package/dist/types/components/feedback/Skeleton.d.ts +13 -0
  139. package/dist/types/components/feedback/Thinking.d.ts +15 -0
  140. package/dist/types/components/layout/AspectRatio.d.ts +5 -0
  141. package/dist/types/components/layout/Backdrop.d.ts +32 -0
  142. package/dist/types/components/layout/Container.d.ts +6 -0
  143. package/dist/types/components/layout/Divider.d.ts +5 -0
  144. package/dist/types/components/layout/Drawer.d.ts +9 -0
  145. package/dist/types/components/layout/DrawerDockSlot.d.ts +40 -0
  146. package/dist/types/components/layout/Grid.d.ts +8 -0
  147. package/dist/types/components/layout/Modal.d.ts +25 -0
  148. package/dist/types/components/layout/Page.d.ts +11 -0
  149. package/dist/types/components/layout/Section.d.ts +6 -0
  150. package/dist/types/components/layout/Stack.d.ts +7 -0
  151. package/dist/types/components/marketing/AnnouncementBar.d.ts +15 -0
  152. package/dist/types/components/marketing/BrandStory.d.ts +19 -0
  153. package/dist/types/components/marketing/HeroBanner.d.ts +69 -0
  154. package/dist/types/components/marketing/HeroBannerFeatures.d.ts +10 -0
  155. package/dist/types/components/marketing/HeroBannerInline.d.ts +20 -0
  156. package/dist/types/components/marketing/PromoBanner.d.ts +11 -0
  157. package/dist/types/components/marketing/internal/AnnouncementLink.d.ts +5 -0
  158. package/dist/types/components/marketing/internal/AnnouncementMessage.d.ts +10 -0
  159. package/dist/types/components/navigation/Breadcrumbs.d.ts +10 -0
  160. package/dist/types/components/navigation/Footer.d.ts +15 -0
  161. package/dist/types/components/navigation/Header.d.ts +14 -0
  162. package/dist/types/components/navigation/internal/BreadcrumbLink.d.ts +5 -0
  163. package/dist/types/components/navigation/internal/FooterLink.d.ts +5 -0
  164. package/dist/types/components/navigation/internal/HeaderLink.d.ts +5 -0
  165. package/dist/types/components/shell/BaseMark.d.ts +11 -0
  166. package/dist/types/components/shell/CartPill.d.ts +13 -0
  167. package/dist/types/components/shell/ComposerDock.d.ts +9 -0
  168. package/dist/types/components/shell/ErrorBanner.d.ts +14 -0
  169. package/dist/types/components/shell/HistoryMenu.d.ts +15 -0
  170. package/dist/types/components/shell/MenuButton.d.ts +31 -0
  171. package/dist/types/components/shell/MountainRidges.d.ts +11 -0
  172. package/dist/types/components/shell/PendingTurn.d.ts +1 -0
  173. package/dist/types/components/shell/ShellTop.d.ts +35 -0
  174. package/dist/types/components/shell/brand-shell.d.ts +441 -0
  175. package/dist/types/components/shell/index.d.ts +9 -0
  176. package/dist/types/components/shell/marks/index.d.ts +5 -0
  177. package/dist/types/components/social/ReviewCard.d.ts +9 -0
  178. package/dist/types/components/social/ReviewSummary.d.ts +7 -0
  179. package/dist/types/components/social/TestimonialCard.d.ts +9 -0
  180. package/dist/types/components/social/TestimonialCarousel.d.ts +16 -0
  181. package/dist/types/components/social/UgcCard.d.ts +9 -0
  182. package/dist/types/components/social/UgcGallery.d.ts +8 -0
  183. package/dist/types/hooks/index.d.ts +8 -0
  184. package/dist/types/hooks/keyboard.d.ts +18 -0
  185. package/dist/types/hooks/use-container-width.d.ts +11 -0
  186. package/dist/types/hooks/use-dismiss-on-outside.d.ts +23 -0
  187. package/dist/types/hooks/use-focus-on-change.d.ts +8 -0
  188. package/dist/types/hooks/use-focus-trap.d.ts +12 -0
  189. package/dist/types/hooks/use-media-query.d.ts +12 -0
  190. package/dist/types/hooks/use-projection.d.ts +24 -0
  191. package/dist/types/hooks/use-reduced-motion.d.ts +1 -0
  192. package/dist/types/hooks/use-scroll-lock.d.ts +19 -0
  193. package/dist/types/hooks/use-scroll-threshold.d.ts +14 -0
  194. package/dist/types/hooks/use-textarea-autosize.d.ts +16 -0
  195. package/dist/types/index.d.ts +74 -0
  196. package/dist/types/labels-context.d.ts +18 -0
  197. package/dist/types/labels.d.ts +240 -0
  198. package/dist/types/motion/ease.d.ts +10 -0
  199. package/dist/types/motion/generation/ActiveBlockIndicator.d.ts +27 -0
  200. package/dist/types/motion/generation/BlurUpImage.d.ts +23 -0
  201. package/dist/types/motion/generation/ResolveEntrance.d.ts +22 -0
  202. package/dist/types/motion/generation/ShimmerSkeleton.d.ts +20 -0
  203. package/dist/types/motion/generation/WordReveal.d.ts +26 -0
  204. package/dist/types/motion/generation/index.d.ts +6 -0
  205. package/dist/types/motion/hooks/useInViewOnce.d.ts +14 -0
  206. package/dist/types/motion/hooks/useScrollDirection.d.ts +38 -0
  207. package/dist/types/motion/hooks/useScrollProgress.d.ts +23 -0
  208. package/dist/types/motion/hooks/useStableValue.d.ts +36 -0
  209. package/dist/types/motion/hooks/useSuccessFlash.d.ts +1 -0
  210. package/dist/types/motion/index.d.ts +18 -0
  211. package/dist/types/motion/presets.d.ts +335 -0
  212. package/dist/types/motion/primitives/Agent.d.ts +118 -0
  213. package/dist/types/motion/primitives/MorphRegion.d.ts +16 -0
  214. package/dist/types/motion/primitives/Parallax.d.ts +19 -0
  215. package/dist/types/motion/primitives/Pin.d.ts +26 -0
  216. package/dist/types/motion/primitives/Reveal.d.ts +29 -0
  217. package/dist/types/motion/primitives/RevealStagger.d.ts +16 -0
  218. package/dist/types/motion/primitives/StickyShelf.d.ts +18 -0
  219. package/dist/types/primitives/Badge/index.d.ts +12 -0
  220. package/dist/types/primitives/Button/index.d.ts +25 -0
  221. package/dist/types/primitives/Input/index.d.ts +5 -0
  222. package/dist/types/primitives/Money/index.d.ts +13 -0
  223. package/dist/types/primitives/Select/index.d.ts +5 -0
  224. package/dist/types/primitives/Skeleton/index.d.ts +4 -0
  225. package/dist/types/shell/AnimatedPlaceholder.d.ts +13 -0
  226. package/dist/types/shell/BottomSheet.d.ts +54 -0
  227. package/dist/types/shell/Button.d.ts +19 -0
  228. package/dist/types/shell/ChromeSurface.d.ts +33 -0
  229. package/dist/types/shell/Composer.d.ts +56 -0
  230. package/dist/types/shell/ComposerChipStrip.d.ts +9 -0
  231. package/dist/types/shell/ConversationTransition.d.ts +27 -0
  232. package/dist/types/shell/DictationButton.d.ts +24 -0
  233. package/dist/types/shell/DragSheet.d.ts +34 -0
  234. package/dist/types/shell/InlineCompletion.d.ts +38 -0
  235. package/dist/types/shell/LauncherDock.d.ts +40 -0
  236. package/dist/types/shell/ListeningWaveform.d.ts +18 -0
  237. package/dist/types/shell/MenuAccordionPanel.d.ts +26 -0
  238. package/dist/types/shell/MenuDrawer.d.ts +72 -0
  239. package/dist/types/shell/MenuFlyout.d.ts +22 -0
  240. package/dist/types/shell/MenuNav.d.ts +30 -0
  241. package/dist/types/shell/MenuNavBar.d.ts +22 -0
  242. package/dist/types/shell/ShellMenuChrome.d.ts +66 -0
  243. package/dist/types/shell/ShellScaffold.d.ts +92 -0
  244. package/dist/types/shell/SideDock.d.ts +75 -0
  245. package/dist/types/shell/Skeleton.d.ts +22 -0
  246. package/dist/types/shell/Spinner.d.ts +10 -0
  247. package/dist/types/shell/TypedPlaceholder.d.ts +11 -0
  248. package/dist/types/shell/VoiceControl.d.ts +23 -0
  249. package/dist/types/shell/VoiceIsland.d.ts +24 -0
  250. package/dist/types/shell/canvas-gutter-style.d.ts +15 -0
  251. package/dist/types/shell/composer/AttachButton.d.ts +14 -0
  252. package/dist/types/shell/composer/AttachmentStrip.d.ts +12 -0
  253. package/dist/types/shell/composer/ClearSessionButton.d.ts +16 -0
  254. package/dist/types/shell/composer/ConversationHistoryButton.d.ts +25 -0
  255. package/dist/types/shell/composer/ShareCanvasButton.d.ts +19 -0
  256. package/dist/types/shell/composer/ThreadJumpRail.d.ts +43 -0
  257. package/dist/types/shell/composer/composer-metrics.d.ts +6 -0
  258. package/dist/types/shell/composer/field-metrics.d.ts +97 -0
  259. package/dist/types/shell/composer/heic-convert.d.ts +6 -0
  260. package/dist/types/shell/composer/use-field-autosize.d.ts +26 -0
  261. package/dist/types/shell/composer/useComposerAttachments.d.ts +37 -0
  262. package/dist/types/shell/composer/usePromptComposer.d.ts +51 -0
  263. package/dist/types/shell/dock-context.d.ts +10 -0
  264. package/dist/types/shell/index.d.ts +36 -0
  265. package/dist/types/shell/menu-columns.d.ts +19 -0
  266. package/dist/types/shell/mobile/DefaultMobileShell.d.ts +88 -0
  267. package/dist/types/shell/mobile/IslandComposeGroup.d.ts +41 -0
  268. package/dist/types/shell/mobile/IslandInputBar.d.ts +61 -0
  269. package/dist/types/shell/mobile/IslandNavButtons.d.ts +20 -0
  270. package/dist/types/shell/mobile/IslandTrailingAction.d.ts +34 -0
  271. package/dist/types/shell/mobile/MobileChrome.d.ts +34 -0
  272. package/dist/types/shell/mobile/MobileVoiceConsole.d.ts +42 -0
  273. package/dist/types/shell/mobile/MorphIsland.d.ts +105 -0
  274. package/dist/types/shell/mobile/RestIsland.d.ts +41 -0
  275. package/dist/types/shell/mobile/constants.d.ts +26 -0
  276. package/dist/types/shell/mobile/document-scroll-ref.d.ts +22 -0
  277. package/dist/types/shell/mobile/hero-entry-point.d.ts +110 -0
  278. package/dist/types/shell/mobile/island-metrics.d.ts +131 -0
  279. package/dist/types/shell/mobile/sheet-detents.d.ts +49 -0
  280. package/dist/types/shell/mobile/turn-end-action.d.ts +44 -0
  281. package/dist/types/shell/mobile/use-blur-on-canvas-gesture.d.ts +31 -0
  282. package/dist/types/shell/mobile/use-island-fold-scroll.d.ts +28 -0
  283. package/dist/types/shell/mobile/use-keyboard-inset.d.ts +18 -0
  284. package/dist/types/shell/mobile/use-sheet-fold-gesture.d.ts +57 -0
  285. package/dist/types/shell/slots.d.ts +16 -0
  286. package/dist/types/shell/thread-reland.d.ts +22 -0
  287. package/dist/types/shell/use-dock-state.d.ts +54 -0
  288. package/dist/types/types/commerce.d.ts +1 -0
  289. package/dist/types/utils/cn.d.ts +2 -0
  290. package/dist/types/utils/format-money.d.ts +2 -0
  291. package/dist/types/utils/html-to-text.d.ts +8 -0
  292. package/dist/types/utils/sanitize-html.d.ts +12 -0
  293. package/dist/types/utils/use-backdrop-presence.d.ts +24 -0
  294. package/dist/types/utils/use-composer-mode.d.ts +26 -0
  295. package/dist/types/utils/use-is-seed-home.d.ts +13 -0
  296. package/dist/types/utils/use-safe-cart.d.ts +17 -0
  297. package/dist/types/utils/use-safe-facts.d.ts +9 -0
  298. package/dist/types/utils/use-safe-fourty-session.d.ts +15 -0
  299. package/package.json +80 -0
@@ -0,0 +1,1012 @@
1
+ 'use client';
2
+
3
+ // src/motion/primitives/Reveal.tsx
4
+ import { useRef } from "react";
5
+ import { motion, useReducedMotion } from "framer-motion";
6
+
7
+ // src/motion/hooks/useInViewOnce.ts
8
+ import { useLayoutEffect, useState } from "react";
9
+ function useInViewOnce(ref, options = {}) {
10
+ const { amount = 0.25, rootMargin = "0px", root = null } = options;
11
+ const [seen, setSeen] = useState(false);
12
+ useLayoutEffect(() => {
13
+ if (seen) return;
14
+ const node = ref.current;
15
+ if (!node) return;
16
+ if (typeof window !== "undefined" && typeof node.getBoundingClientRect === "function") {
17
+ const rect = node.getBoundingClientRect();
18
+ const vh = window.innerHeight;
19
+ const vw = window.innerWidth;
20
+ const visibleH = Math.min(rect.bottom, vh) - Math.max(rect.top, 0);
21
+ const visibleW = Math.min(rect.right, vw) - Math.max(rect.left, 0);
22
+ const totalH = rect.height;
23
+ const totalW = rect.width;
24
+ if (totalH > 0 && totalW > 0) {
25
+ const ratio = Math.max(0, visibleH) * Math.max(0, visibleW) / (totalH * totalW);
26
+ if (ratio >= amount) {
27
+ setSeen(true);
28
+ return;
29
+ }
30
+ }
31
+ }
32
+ if (typeof IntersectionObserver === "undefined") {
33
+ setSeen(true);
34
+ return;
35
+ }
36
+ const observer = new IntersectionObserver(
37
+ (entries) => {
38
+ for (const entry of entries) {
39
+ if (entry.isIntersecting) {
40
+ setSeen(true);
41
+ observer.disconnect();
42
+ return;
43
+ }
44
+ }
45
+ },
46
+ { threshold: amount, rootMargin, root }
47
+ );
48
+ observer.observe(node);
49
+ return () => observer.disconnect();
50
+ }, [ref, amount, rootMargin, root, seen]);
51
+ return seen;
52
+ }
53
+
54
+ // src/motion/ease.ts
55
+ import { cubicBezier } from "framer-motion";
56
+ var editorialEase = cubicBezier(0.22, 1, 0.36, 1);
57
+
58
+ // src/motion/presets.ts
59
+ var motionPresets = {
60
+ fadeIn: {
61
+ hidden: { opacity: 0 },
62
+ visible: { opacity: 1, transition: { duration: 0.3 } }
63
+ },
64
+ fadeUp: {
65
+ hidden: { opacity: 0, y: 16 },
66
+ visible: { opacity: 1, y: 0, transition: { duration: 0.7, ease: editorialEase } }
67
+ },
68
+ riseStagger: {
69
+ hidden: {},
70
+ visible: { transition: { staggerChildren: 0.06, delayChildren: 0.04 } }
71
+ },
72
+ riseStaggerItem: {
73
+ hidden: { opacity: 0, y: 16 },
74
+ visible: { opacity: 1, y: 0, transition: { duration: 0.7, ease: editorialEase } }
75
+ },
76
+ morphIn: {
77
+ hidden: { opacity: 0, scale: 0.96 },
78
+ visible: { opacity: 1, scale: 1, transition: { duration: 0.5, ease: editorialEase } }
79
+ },
80
+ pinReveal: {
81
+ hidden: { opacity: 0, y: 40 },
82
+ visible: { opacity: 1, y: 0, transition: { duration: 0.9, ease: editorialEase } }
83
+ },
84
+ softScale: {
85
+ hidden: { opacity: 0, scale: 1.05 },
86
+ visible: { opacity: 1, scale: 1, transition: { duration: 1.2, ease: editorialEase } }
87
+ },
88
+ slideInLeft: {
89
+ hidden: { opacity: 0, x: -40 },
90
+ visible: { opacity: 1, x: 0, transition: { duration: 0.6, ease: editorialEase } }
91
+ },
92
+ slideInRight: {
93
+ hidden: { x: "100%" },
94
+ visible: { x: 0, transition: { duration: 0.3, ease: editorialEase } },
95
+ exit: { x: "100%", transition: { duration: 0.25 } }
96
+ },
97
+ editorialMask: {
98
+ hidden: { clipPath: "inset(0 100% 0 0)" },
99
+ visible: { clipPath: "inset(0 0% 0 0)", transition: { duration: 1, ease: editorialEase } }
100
+ }
101
+ };
102
+ var updatePresets = {
103
+ contentUpdate: {
104
+ idle: { opacity: 1 },
105
+ pulse: { opacity: [1, 0.7, 1], transition: { duration: 0.35, ease: "easeInOut" } }
106
+ },
107
+ textCrossfade: {
108
+ enter: { opacity: 0 },
109
+ visible: { opacity: 1, transition: { duration: 0.15, ease: "easeIn" } },
110
+ exit: { opacity: 0, transition: { duration: 0.15, ease: "easeOut" } }
111
+ },
112
+ listItemEnter: {
113
+ hidden: { opacity: 0, y: 12, scale: 0.96 },
114
+ visible: { opacity: 1, y: 0, scale: 1, transition: { duration: 0.3, ease: editorialEase } }
115
+ },
116
+ listItemExit: {
117
+ exit: { opacity: 0, scale: 0.92, transition: { duration: 0.2, ease: "easeIn" } }
118
+ }
119
+ };
120
+ var chipEntry = {
121
+ hidden: { opacity: 0 },
122
+ // The set lands from chip-gen in one signal, so the whole group mounts
123
+ // at once — but a slight per-chip delay (well under the old 90ms stagger)
124
+ // keeps a subtle cascade instead of every chip popping in unison. No
125
+ // transform: a `y`/scale offset here fights the container's own layout
126
+ // reflow when the rail's height changes, leaving chips visibly stuck
127
+ // mid-animation instead of settling.
128
+ visible: (i) => ({
129
+ opacity: 1,
130
+ transition: { delay: typeof i === "number" ? i * 0.045 : 0, duration: 0.18, ease: "easeOut" }
131
+ }),
132
+ // Old set lifts up and out as the new one fades in — directional
133
+ // continuity reads as the rail advancing, not flickering.
134
+ exit: { opacity: 0, y: -6, transition: { duration: 0.14, ease: "easeIn" } }
135
+ };
136
+ var hoverPresets = {
137
+ scaleOnHover: { whileHover: { scale: 1.02 }, transition: { duration: 0.2 } },
138
+ imageZoom: { whileHover: { scale: 1.08 }, transition: { duration: 0.4 } },
139
+ cardHoverLift: {
140
+ whileHover: { y: -4, transition: { duration: 0.25, ease: editorialEase } }
141
+ }
142
+ };
143
+ var pressPresets = {
144
+ icon: {
145
+ whileHover: { y: -1, scale: 1.06 },
146
+ whileTap: { scale: 0.9 },
147
+ transition: { duration: 0.16, ease: editorialEase }
148
+ },
149
+ primary: {
150
+ whileHover: { y: -1, scale: 1.02 },
151
+ whileTap: { scale: 0.97 },
152
+ transition: { duration: 0.18, ease: editorialEase }
153
+ },
154
+ chip: {
155
+ whileHover: { y: -2, scale: 1.04 },
156
+ whileTap: { scale: 0.96 },
157
+ transition: { duration: 0.18, ease: editorialEase }
158
+ }
159
+ };
160
+ var successFlash = {
161
+ idle: { scale: 1 },
162
+ flash: {
163
+ scale: [1, 1.08, 0.98, 1],
164
+ transition: { duration: 0.55, ease: editorialEase, times: [0, 0.3, 0.65, 1] }
165
+ }
166
+ };
167
+ var panelSlideIn = {
168
+ hidden: { x: 24, opacity: 0 },
169
+ visible: {
170
+ x: 0,
171
+ opacity: 1,
172
+ transition: { duration: 0.5, ease: editorialEase }
173
+ }
174
+ };
175
+ var inputFocusRing = {
176
+ idle: {
177
+ boxShadow: "0 0 0 0px rgba(0,0,0,0)",
178
+ transition: { duration: 0.18, ease: editorialEase }
179
+ },
180
+ focused: {
181
+ boxShadow: "0 0 0 3px color-mix(in srgb, var(--color-primary) 18%, transparent)",
182
+ transition: { duration: 0.22, ease: editorialEase }
183
+ }
184
+ };
185
+
186
+ // src/motion/primitives/Reveal.tsx
187
+ import { jsx } from "react/jsx-runtime";
188
+ function Reveal({
189
+ children,
190
+ preset = "fadeUp",
191
+ variants,
192
+ once = true,
193
+ amount = 0.25,
194
+ defer = false,
195
+ className
196
+ }) {
197
+ const reduce = useReducedMotion();
198
+ const ref = useRef(null);
199
+ const seen = useInViewOnce(ref, { amount });
200
+ const resolvedVariants = variants ? variants : motionPresets[preset];
201
+ const animate3 = reduce || defer ? "visible" : seen || !once ? "visible" : "hidden";
202
+ const initial = reduce ? "visible" : "hidden";
203
+ return /* @__PURE__ */ jsx(motion.div, { ref, className, initial, animate: animate3, variants: resolvedVariants, children });
204
+ }
205
+
206
+ // src/motion/primitives/RevealStagger.tsx
207
+ import { Children, useRef as useRef2 } from "react";
208
+ import { motion as motion2, useReducedMotion as useReducedMotion2 } from "framer-motion";
209
+ import { jsx as jsx2 } from "react/jsx-runtime";
210
+ function RevealStagger({
211
+ children,
212
+ gap = 0.06,
213
+ amount = 0.2,
214
+ defer = false,
215
+ className
216
+ }) {
217
+ const reduce = useReducedMotion2();
218
+ const ref = useRef2(null);
219
+ const seen = useInViewOnce(ref, { amount });
220
+ const animate3 = reduce || defer ? "visible" : seen ? "visible" : "hidden";
221
+ const initial = reduce ? "visible" : "hidden";
222
+ const parentVariants = {
223
+ hidden: {},
224
+ visible: { transition: { staggerChildren: gap, delayChildren: 0.04 } }
225
+ };
226
+ return /* @__PURE__ */ jsx2(motion2.div, { ref, className, initial, animate: animate3, variants: parentVariants, children: Children.map(children, (child, i) => /* @__PURE__ */ jsx2(motion2.div, { variants: motionPresets.riseStaggerItem, children: child }, i)) });
227
+ }
228
+
229
+ // src/motion/primitives/Pin.tsx
230
+ import { useRef as useRef3 } from "react";
231
+ import { motion as motion3, useReducedMotion as useReducedMotion3, useScroll, useTransform } from "framer-motion";
232
+ import useMeasure from "react-use-measure";
233
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
234
+ function Pin({ children, distance = 1, render, container, className }) {
235
+ const reduce = useReducedMotion3();
236
+ const sectionRef = useRef3(null);
237
+ const [measureRef, bounds] = useMeasure();
238
+ const { scrollYProgress } = useScroll({
239
+ target: sectionRef,
240
+ container,
241
+ offset: ["start start", "end start"]
242
+ });
243
+ const stageHeight = bounds.height > 0 ? bounds.height : 0;
244
+ const totalHeight = stageHeight * (1 + distance);
245
+ const translateY = useTransform(
246
+ scrollYProgress,
247
+ [0, 1],
248
+ [0, stageHeight * distance]
249
+ );
250
+ if (reduce) {
251
+ return /* @__PURE__ */ jsxs("div", { ref: sectionRef, className, children: [
252
+ /* @__PURE__ */ jsx3("div", { ref: measureRef, children }),
253
+ render ? render({ progress: scrollYProgress }) : null
254
+ ] });
255
+ }
256
+ return /* @__PURE__ */ jsx3(
257
+ "div",
258
+ {
259
+ ref: sectionRef,
260
+ className,
261
+ style: { height: totalHeight > 0 ? totalHeight : void 0, position: "relative" },
262
+ children: /* @__PURE__ */ jsxs(
263
+ motion3.div,
264
+ {
265
+ ref: measureRef,
266
+ style: { y: translateY, position: "sticky", top: 0 },
267
+ children: [
268
+ children,
269
+ render ? render({ progress: scrollYProgress }) : null
270
+ ]
271
+ }
272
+ )
273
+ }
274
+ );
275
+ }
276
+
277
+ // src/motion/primitives/Parallax.tsx
278
+ import { useRef as useRef4 } from "react";
279
+ import { motion as motion4, useReducedMotion as useReducedMotion4, useScroll as useScroll2, useTransform as useTransform2 } from "framer-motion";
280
+ import { jsx as jsx4 } from "react/jsx-runtime";
281
+ function Parallax({ children, speed = 0.3, axis = "y", container, className }) {
282
+ const reduce = useReducedMotion4();
283
+ const ref = useRef4(null);
284
+ const { scrollYProgress } = useScroll2({
285
+ target: ref,
286
+ container,
287
+ offset: ["start end", "end start"]
288
+ });
289
+ const range = 200 * speed;
290
+ const transformValue = useTransform2(scrollYProgress, [0, 1], [range, -range]);
291
+ if (reduce) {
292
+ return /* @__PURE__ */ jsx4("div", { ref, className, children });
293
+ }
294
+ const motionStyle = axis === "y" ? { y: transformValue } : { x: transformValue };
295
+ return /* @__PURE__ */ jsx4(motion4.div, { ref, className, style: motionStyle, children });
296
+ }
297
+
298
+ // src/motion/primitives/StickyShelf.tsx
299
+ import { useEffect, useRef as useRef5, useState as useState2 } from "react";
300
+ import { jsx as jsx5 } from "react/jsx-runtime";
301
+ function StickyShelf({ children, top = 0, releaseAt, className }) {
302
+ const ref = useRef5(null);
303
+ const [released, setReleased] = useState2(false);
304
+ useEffect(() => {
305
+ if (!releaseAt) return;
306
+ const anchor = releaseAt.current;
307
+ if (!anchor) return;
308
+ if (typeof IntersectionObserver === "undefined") return;
309
+ const observer = new IntersectionObserver(
310
+ (entries) => {
311
+ for (const entry of entries) {
312
+ setReleased(!entry.isIntersecting && entry.boundingClientRect.top < 0);
313
+ }
314
+ },
315
+ { threshold: 0 }
316
+ );
317
+ observer.observe(anchor);
318
+ return () => observer.disconnect();
319
+ }, [releaseAt]);
320
+ return /* @__PURE__ */ jsx5(
321
+ "div",
322
+ {
323
+ ref,
324
+ className,
325
+ style: {
326
+ position: released ? "relative" : "sticky",
327
+ top,
328
+ visibility: released ? "hidden" : "visible"
329
+ },
330
+ children
331
+ }
332
+ );
333
+ }
334
+
335
+ // src/motion/primitives/MorphRegion.tsx
336
+ import { motion as motion5, useReducedMotion as useReducedMotion5 } from "framer-motion";
337
+ import { jsx as jsx6 } from "react/jsx-runtime";
338
+ function MorphRegion({ id, children, className }) {
339
+ const reduce = useReducedMotion5();
340
+ if (reduce) {
341
+ return /* @__PURE__ */ jsx6("div", { className, children });
342
+ }
343
+ return /* @__PURE__ */ jsx6(motion5.div, { layoutId: id, className, children });
344
+ }
345
+
346
+ // src/motion/primitives/Agent.tsx
347
+ import * as React from "react";
348
+ import {
349
+ motion as motion6,
350
+ useReducedMotion as useReducedMotion6
351
+ } from "framer-motion";
352
+ import { buildEntranceProps, useGenerationStyle } from "@40rty/ams-sdk";
353
+ import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
354
+ function AgentReveal({
355
+ children,
356
+ as = "div",
357
+ className,
358
+ style,
359
+ delay
360
+ }) {
361
+ const reduce = useReducedMotion6();
362
+ const generation = useGenerationStyle();
363
+ if (reduce === true) {
364
+ return as === "span" ? /* @__PURE__ */ jsx7("span", { className, style, children }) : /* @__PURE__ */ jsx7("div", { className, style, children });
365
+ }
366
+ const Component = as === "span" ? motion6.span : motion6.div;
367
+ const entrance = buildEntranceProps(generation.entrance, generation.timings, 0, "forward");
368
+ const baseDelay = typeof entrance.transition.delay === "number" ? entrance.transition.delay : 0;
369
+ const transition = delay !== void 0 && delay > 0 ? { ...entrance.transition, delay: baseDelay + delay } : entrance.transition;
370
+ return /* @__PURE__ */ jsx7(
371
+ Component,
372
+ {
373
+ className,
374
+ style,
375
+ initial: entrance.initial,
376
+ animate: entrance.animate,
377
+ transition,
378
+ children
379
+ }
380
+ );
381
+ }
382
+ var ENTRANCE_ITEM = {
383
+ hidden: { opacity: 0, y: 12, filter: "blur(4px)" },
384
+ visible: {
385
+ opacity: 1,
386
+ y: 0,
387
+ filter: "blur(0px)",
388
+ transition: { duration: 0.5, ease: editorialEase }
389
+ }
390
+ };
391
+ var ENTRANCE_CONTAINER = {
392
+ hidden: {},
393
+ visible: { transition: { staggerChildren: 0.07, delayChildren: 0.05 } }
394
+ };
395
+ function AgentStagger({
396
+ children,
397
+ step,
398
+ delay = 0.05,
399
+ as = "div",
400
+ className,
401
+ style
402
+ }) {
403
+ const reduce = useReducedMotion6();
404
+ const generation = useGenerationStyle();
405
+ if (reduce === true) {
406
+ return as === "ul" ? /* @__PURE__ */ jsx7("ul", { className, style, children }) : as === "section" ? /* @__PURE__ */ jsx7("section", { className, style, children }) : /* @__PURE__ */ jsx7("div", { className, style, children });
407
+ }
408
+ const stagger = step !== void 0 ? step : generation.timings.rowStaggerS;
409
+ const variants = {
410
+ hidden: {},
411
+ visible: { transition: { staggerChildren: stagger, delayChildren: delay } }
412
+ };
413
+ const Component = as === "ul" ? motion6.ul : as === "section" ? motion6.section : motion6.div;
414
+ return /* @__PURE__ */ jsx7(
415
+ Component,
416
+ {
417
+ className,
418
+ style,
419
+ variants,
420
+ initial: "hidden",
421
+ animate: "visible",
422
+ children
423
+ }
424
+ );
425
+ }
426
+ function AgentStaggerItem({
427
+ children,
428
+ as = "div",
429
+ className,
430
+ style
431
+ }) {
432
+ const generation = useGenerationStyle();
433
+ const entrance = buildEntranceProps(generation.entrance, generation.timings, 0, "forward");
434
+ const variants = {
435
+ hidden: entrance.initial,
436
+ visible: { ...entrance.animate, transition: entrance.transition }
437
+ };
438
+ const Component = as === "li" ? motion6.li : as === "span" ? motion6.span : motion6.div;
439
+ return /* @__PURE__ */ jsx7(Component, { className, style, variants, children });
440
+ }
441
+ var agentStaggerVariants = {
442
+ container: ENTRANCE_CONTAINER,
443
+ item: ENTRANCE_ITEM
444
+ };
445
+ function AgentTypeIn({
446
+ text,
447
+ speed = 22,
448
+ delay = 0,
449
+ caret = true,
450
+ caretWhenDone = false,
451
+ as = "span",
452
+ className,
453
+ style
454
+ }) {
455
+ const reduce = useReducedMotion6();
456
+ const [count, setCount] = React.useState(reduce === true ? text.length : 0);
457
+ React.useEffect(() => {
458
+ if (reduce === true) {
459
+ setCount(text.length);
460
+ return;
461
+ }
462
+ setCount(0);
463
+ let cancelled = false;
464
+ let i = 0;
465
+ const tick = () => {
466
+ if (cancelled) return;
467
+ i += 1;
468
+ setCount(i);
469
+ if (i < text.length) {
470
+ window.setTimeout(tick, speed);
471
+ }
472
+ };
473
+ const handle = window.setTimeout(tick, delay);
474
+ return () => {
475
+ cancelled = true;
476
+ window.clearTimeout(handle);
477
+ };
478
+ }, [text, speed, delay, reduce]);
479
+ const done = count >= text.length;
480
+ const showCaret = caret && (!done || caretWhenDone);
481
+ const Tag = as;
482
+ return /* @__PURE__ */ jsxs2(Tag, { className, style, children: [
483
+ /* @__PURE__ */ jsx7("span", { "aria-hidden": !done, children: text.slice(0, count) }),
484
+ showCaret && /* @__PURE__ */ jsx7(AgentCaret, { inline: true }),
485
+ /* @__PURE__ */ jsx7(
486
+ "span",
487
+ {
488
+ style: {
489
+ position: "absolute",
490
+ width: 1,
491
+ height: 1,
492
+ overflow: "hidden",
493
+ clip: "rect(0 0 0 0)"
494
+ },
495
+ children: text
496
+ }
497
+ )
498
+ ] });
499
+ }
500
+ function AgentCaret({
501
+ inline = true,
502
+ height,
503
+ color
504
+ }) {
505
+ const reduce = useReducedMotion6();
506
+ const baseStyle = {
507
+ display: "inline-block",
508
+ width: 2,
509
+ height: height !== void 0 ? height : "1em",
510
+ marginLeft: inline ? 2 : 0,
511
+ verticalAlign: "text-bottom",
512
+ background: color !== void 0 ? color : "currentColor"
513
+ };
514
+ if (reduce === true) {
515
+ return /* @__PURE__ */ jsx7("span", { "aria-hidden": "true", style: { ...baseStyle, opacity: 0.6 } });
516
+ }
517
+ return /* @__PURE__ */ jsx7(
518
+ motion6.span,
519
+ {
520
+ "aria-hidden": "true",
521
+ style: baseStyle,
522
+ animate: { opacity: [1, 1, 0, 0] },
523
+ transition: { duration: 1, repeat: Infinity, ease: "linear" }
524
+ }
525
+ );
526
+ }
527
+ function AgentPulseOnChange({
528
+ value,
529
+ children,
530
+ as = "div",
531
+ className,
532
+ style
533
+ }) {
534
+ const reduce = useReducedMotion6();
535
+ const prev = React.useRef(value);
536
+ const [pulseKey, setPulseKey] = React.useState(0);
537
+ React.useEffect(() => {
538
+ if (prev.current === value) return;
539
+ prev.current = value;
540
+ setPulseKey((k) => k + 1);
541
+ }, [value]);
542
+ const Component = as === "span" ? motion6.span : motion6.div;
543
+ if (reduce === true) {
544
+ return /* @__PURE__ */ jsx7(Component, { className, style, children });
545
+ }
546
+ const transition = { duration: 0.45, ease: editorialEase };
547
+ return /* @__PURE__ */ jsx7(
548
+ Component,
549
+ {
550
+ className,
551
+ style,
552
+ animate: pulseKey === 0 ? void 0 : { scale: [1, 1.04, 1], opacity: [1, 0.85, 1] },
553
+ transition,
554
+ children
555
+ }
556
+ );
557
+ }
558
+ function AgentShimmer({
559
+ children,
560
+ duration = 1.4,
561
+ highlight = "rgba(255,255,255,0.55)",
562
+ className,
563
+ style
564
+ }) {
565
+ const reduce = useReducedMotion6();
566
+ return /* @__PURE__ */ jsxs2(
567
+ "div",
568
+ {
569
+ className,
570
+ style: { position: "relative", overflow: "hidden", ...style },
571
+ children: [
572
+ children,
573
+ reduce !== true && /* @__PURE__ */ jsx7(
574
+ motion6.div,
575
+ {
576
+ "aria-hidden": "true",
577
+ style: {
578
+ position: "absolute",
579
+ inset: 0,
580
+ background: `linear-gradient(100deg, transparent 0%, ${highlight} 50%, transparent 100%)`,
581
+ transform: "translateX(-100%)",
582
+ pointerEvents: "none"
583
+ },
584
+ animate: { x: ["-100%", "100%"] },
585
+ transition: { duration, ease: "linear", repeat: Infinity, repeatDelay: 0.4 }
586
+ }
587
+ )
588
+ ]
589
+ }
590
+ );
591
+ }
592
+
593
+ // src/motion/generation/index.ts
594
+ import { DEFAULT_GENERATION_STYLE, DEFAULT_GENERATION_TIMINGS, GENERATION_EASE as GENERATION_EASE2, buildEntranceProps as buildEntranceProps3, useGenerationStyle as useGenerationStyle2 } from "@40rty/ams-sdk";
595
+
596
+ // src/motion/generation/ShimmerSkeleton.tsx
597
+ import { ShimmerSweep } from "@40rty/ams-sdk";
598
+ import { jsx as jsx8 } from "react/jsx-runtime";
599
+ function ShimmerSkeleton({
600
+ treatment,
601
+ durationS,
602
+ style,
603
+ className
604
+ }) {
605
+ const base = {
606
+ position: "relative",
607
+ overflow: "hidden",
608
+ background: "var(--color-surface-alt, #f3f3f3)"
609
+ };
610
+ return /* @__PURE__ */ jsx8("div", { className, style: style !== void 0 ? { ...base, ...style } : base, children: treatment === "shimmer" && /* @__PURE__ */ jsx8(ShimmerSweep, { durationS }) });
611
+ }
612
+
613
+ // src/motion/generation/ActiveBlockIndicator.tsx
614
+ import * as React2 from "react";
615
+ import {
616
+ AnimatePresence,
617
+ animate,
618
+ motion as motion7,
619
+ useMotionTemplate,
620
+ useMotionValue,
621
+ useReducedMotion as useReducedMotion7
622
+ } from "framer-motion";
623
+ import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
624
+ var RING_COLOR = "color-mix(in srgb, var(--color-accent, #C5A084) 80%, transparent)";
625
+ var GLOW_RING = "color-mix(in srgb, var(--color-accent, #C5A084) 45%, transparent)";
626
+ var GLOW_HALO = "color-mix(in srgb, var(--color-accent, #C5A084) 22%, transparent)";
627
+ function PerimeterRing({
628
+ loopS,
629
+ thickness,
630
+ segment
631
+ }) {
632
+ const angle = useMotionValue(0);
633
+ React2.useEffect(() => {
634
+ const controls = animate(angle, 360, {
635
+ duration: loopS,
636
+ ease: "linear",
637
+ repeat: Infinity
638
+ });
639
+ return () => controls.stop();
640
+ }, [angle, loopS]);
641
+ const [from, peak] = segment;
642
+ const background = useMotionTemplate`conic-gradient(from ${angle}deg, transparent 0%, transparent ${from}%, ${RING_COLOR} ${peak}%, transparent 100%)`;
643
+ return /* @__PURE__ */ jsx9(
644
+ motion7.div,
645
+ {
646
+ "aria-hidden": true,
647
+ initial: { opacity: 0 },
648
+ animate: { opacity: 1 },
649
+ exit: { opacity: 0 },
650
+ transition: { duration: 0.2 },
651
+ style: {
652
+ position: "absolute",
653
+ inset: -1,
654
+ borderRadius: "inherit",
655
+ pointerEvents: "none",
656
+ padding: thickness,
657
+ WebkitMask: "linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)",
658
+ WebkitMaskComposite: "xor",
659
+ maskComposite: "exclude",
660
+ background
661
+ }
662
+ }
663
+ );
664
+ }
665
+ function GlowRing({ loopS }) {
666
+ return /* @__PURE__ */ jsx9(
667
+ motion7.div,
668
+ {
669
+ "aria-hidden": true,
670
+ initial: { opacity: 0 },
671
+ animate: { opacity: [0.55, 1, 0.55] },
672
+ exit: { opacity: 0 },
673
+ transition: {
674
+ opacity: { duration: loopS, repeat: Infinity, ease: "easeInOut" }
675
+ },
676
+ style: {
677
+ position: "absolute",
678
+ inset: 0,
679
+ borderRadius: "inherit",
680
+ pointerEvents: "none",
681
+ boxShadow: `0 0 0 1px ${GLOW_RING}, 0 0 28px ${GLOW_HALO}`
682
+ }
683
+ }
684
+ );
685
+ }
686
+ function ActiveBlockIndicator({
687
+ treatment,
688
+ active,
689
+ loopS,
690
+ children,
691
+ style,
692
+ className
693
+ }) {
694
+ const reduce = useReducedMotion7();
695
+ const showIndicator = active && treatment !== "none" && reduce !== true;
696
+ const base = { position: "relative" };
697
+ return /* @__PURE__ */ jsxs3("div", { className, style: style !== void 0 ? { ...base, ...style } : base, children: [
698
+ children,
699
+ /* @__PURE__ */ jsxs3(AnimatePresence, { children: [
700
+ showIndicator && treatment === "beam" && /* @__PURE__ */ jsx9(PerimeterRing, { loopS, thickness: 1.5, segment: [72, 88] }, "beam"),
701
+ showIndicator && treatment === "trail" && /* @__PURE__ */ jsx9(PerimeterRing, { loopS: loopS * 1.6, thickness: 1, segment: [30, 78] }, "trail"),
702
+ showIndicator && treatment === "glow" && /* @__PURE__ */ jsx9(GlowRing, { loopS }, "glow")
703
+ ] })
704
+ ] });
705
+ }
706
+
707
+ // src/motion/generation/ResolveEntrance.tsx
708
+ import { motion as motion8, useReducedMotion as useReducedMotion8 } from "framer-motion";
709
+ import { buildEntranceProps as buildEntranceProps2 } from "@40rty/ams-sdk";
710
+ import { jsx as jsx10 } from "react/jsx-runtime";
711
+ function ResolveEntrance({
712
+ treatment,
713
+ timings,
714
+ staggerIndex,
715
+ children,
716
+ style,
717
+ className
718
+ }) {
719
+ const reduce = useReducedMotion8();
720
+ const index = staggerIndex !== void 0 ? staggerIndex : 0;
721
+ if (reduce === true) {
722
+ return /* @__PURE__ */ jsx10("div", { className, style, children });
723
+ }
724
+ const entrance = buildEntranceProps2(treatment, timings, index, "forward");
725
+ return /* @__PURE__ */ jsx10(
726
+ motion8.div,
727
+ {
728
+ className,
729
+ style,
730
+ initial: entrance.initial,
731
+ animate: entrance.animate,
732
+ transition: entrance.transition,
733
+ children
734
+ }
735
+ );
736
+ }
737
+
738
+ // src/motion/generation/WordReveal.tsx
739
+ import { motion as motion9, useReducedMotion as useReducedMotion9 } from "framer-motion";
740
+ import { GENERATION_EASE } from "@40rty/ams-sdk";
741
+ import { jsx as jsx11 } from "react/jsx-runtime";
742
+ function WordReveal({
743
+ text,
744
+ treatment,
745
+ timings,
746
+ as = "span",
747
+ delayS,
748
+ style,
749
+ className
750
+ }) {
751
+ const reduce = useReducedMotion9();
752
+ const Tag = as;
753
+ const baseDelay = delayS !== void 0 ? delayS : 0;
754
+ if (treatment === "instant" || reduce === true) {
755
+ return /* @__PURE__ */ jsx11(Tag, { className, style, children: text });
756
+ }
757
+ const words = text.split(" ");
758
+ return /* @__PURE__ */ jsx11(Tag, { className, style, "aria-label": text, children: words.map((word, i) => {
759
+ const delay = baseDelay + i * timings.wordStaggerS;
760
+ if (treatment === "word-blur") {
761
+ return /* @__PURE__ */ jsx11(
762
+ motion9.span,
763
+ {
764
+ "aria-hidden": true,
765
+ style: { display: "inline-block", whiteSpace: "pre" },
766
+ initial: { opacity: 0, filter: "blur(6px)", y: 4 },
767
+ animate: { opacity: 1, filter: "blur(0px)", y: 0 },
768
+ transition: { delay, duration: 0.3, ease: "easeOut" },
769
+ children: i < words.length - 1 ? `${word} ` : word
770
+ },
771
+ `${word}-${i}`
772
+ );
773
+ }
774
+ return /* @__PURE__ */ jsx11(
775
+ "span",
776
+ {
777
+ "aria-hidden": true,
778
+ style: { display: "inline-block", overflow: "hidden", verticalAlign: "bottom", whiteSpace: "pre" },
779
+ children: /* @__PURE__ */ jsx11(
780
+ motion9.span,
781
+ {
782
+ style: { display: "inline-block" },
783
+ initial: { y: "110%" },
784
+ animate: { y: "0%" },
785
+ transition: { delay, duration: 0.5, ease: GENERATION_EASE },
786
+ children: i < words.length - 1 ? `${word} ` : word
787
+ }
788
+ )
789
+ },
790
+ `${word}-${i}`
791
+ );
792
+ }) });
793
+ }
794
+
795
+ // src/motion/generation/BlurUpImage.tsx
796
+ import * as React3 from "react";
797
+ import { motion as motion10, useReducedMotion as useReducedMotion10 } from "framer-motion";
798
+ import { jsx as jsx12 } from "react/jsx-runtime";
799
+ function BlurUpImage({
800
+ src,
801
+ alt,
802
+ treatment,
803
+ resolveS,
804
+ style,
805
+ className
806
+ }) {
807
+ const reduce = useReducedMotion10();
808
+ const [loaded, setLoaded] = React3.useState(false);
809
+ if (treatment === "pop" || reduce === true) {
810
+ return /* @__PURE__ */ jsx12("img", { src, alt, className, style });
811
+ }
812
+ return /* @__PURE__ */ jsx12(
813
+ motion10.img,
814
+ {
815
+ src,
816
+ alt,
817
+ className,
818
+ style,
819
+ onLoad: () => setLoaded(true),
820
+ initial: { filter: "blur(14px)", scale: 1.04, opacity: 0.85 },
821
+ animate: loaded ? { filter: "blur(0px)", scale: 1, opacity: 1 } : { filter: "blur(14px)", scale: 1.04, opacity: 0.85 },
822
+ transition: { duration: resolveS, ease: "easeOut" }
823
+ }
824
+ );
825
+ }
826
+
827
+ // src/motion/hooks/useScrollProgress.ts
828
+ import { useScroll as useScroll3 } from "framer-motion";
829
+ function useScrollProgress(options = {}) {
830
+ const { scrollY, scrollYProgress } = useScroll3({
831
+ target: options.target,
832
+ container: options.container,
833
+ offset: options.offset
834
+ });
835
+ return { scrollY, progress: scrollYProgress };
836
+ }
837
+
838
+ // src/motion/index.ts
839
+ import { scrollEventTarget as scrollEventTarget2 } from "@40rty/ams-sdk";
840
+
841
+ // src/motion/hooks/useScrollDirection.ts
842
+ import * as React4 from "react";
843
+ import { scrollEventTarget } from "@40rty/ams-sdk";
844
+ var INITIAL = { direction: "idle", atTop: true, collapsed: false };
845
+ function useScrollDirection({
846
+ container,
847
+ topThreshold = 24,
848
+ minDelta = 6
849
+ }) {
850
+ const [state, setState] = React4.useState(INITIAL);
851
+ const last = React4.useRef(0);
852
+ React4.useEffect(() => {
853
+ const el = container.current;
854
+ if (el === null) return;
855
+ last.current = el.scrollTop;
856
+ setState((prev) => {
857
+ const atTop = last.current <= topThreshold;
858
+ if (prev.atTop === atTop) return prev;
859
+ return { ...prev, atTop };
860
+ });
861
+ const apply = (latest) => {
862
+ const atTop = latest <= topThreshold;
863
+ const delta = latest - last.current;
864
+ setState((prev) => {
865
+ let { direction, collapsed } = prev;
866
+ if (atTop) {
867
+ direction = "idle";
868
+ collapsed = false;
869
+ } else if (delta > minDelta) {
870
+ direction = "down";
871
+ collapsed = true;
872
+ } else if (delta < -minDelta) {
873
+ direction = "up";
874
+ collapsed = false;
875
+ }
876
+ if (direction === prev.direction && collapsed === prev.collapsed && atTop === prev.atTop) {
877
+ return prev;
878
+ }
879
+ return { direction, atTop, collapsed };
880
+ });
881
+ if (Math.abs(delta) > minDelta || atTop) last.current = latest;
882
+ };
883
+ const onScroll = () => apply(el.scrollTop);
884
+ const target = scrollEventTarget(el);
885
+ target.addEventListener("scroll", onScroll, { passive: true });
886
+ return () => target.removeEventListener("scroll", onScroll);
887
+ }, [container, topThreshold, minDelta]);
888
+ return state;
889
+ }
890
+
891
+ // src/motion/hooks/useSuccessFlash.ts
892
+ import { useSuccessFlash } from "@40rty/ams-sdk";
893
+
894
+ // src/motion/hooks/useStableValue.ts
895
+ import { useEffect as useEffect5, useRef as useRef8, useState as useState6 } from "react";
896
+ function useStableValue(value, options) {
897
+ const settleMs = options?.settleMs ?? 250;
898
+ const immediateFirst = options?.immediateFirst ?? true;
899
+ const when = options?.when ?? "all";
900
+ const firstRef = useRef8(true);
901
+ const [stable, setStable] = useState6(value);
902
+ const timerRef = useRef8(null);
903
+ useEffect5(() => {
904
+ if (firstRef.current) {
905
+ firstRef.current = false;
906
+ if (immediateFirst) {
907
+ setStable(value);
908
+ return;
909
+ }
910
+ }
911
+ if (timerRef.current !== null) {
912
+ window.clearTimeout(timerRef.current);
913
+ timerRef.current = null;
914
+ }
915
+ if (settleMs <= 0) {
916
+ setStable(value);
917
+ return;
918
+ }
919
+ const truthy = Boolean(value);
920
+ const debounceThisChange = when === "all" || when === "falsy" && !truthy || when === "truthy" && truthy;
921
+ if (!debounceThisChange) {
922
+ setStable(value);
923
+ return;
924
+ }
925
+ const handle = window.setTimeout(() => {
926
+ setStable(value);
927
+ timerRef.current = null;
928
+ }, settleMs);
929
+ timerRef.current = handle;
930
+ return () => {
931
+ window.clearTimeout(handle);
932
+ if (timerRef.current === handle) timerRef.current = null;
933
+ };
934
+ }, [value, settleMs, immediateFirst, when]);
935
+ return stable;
936
+ }
937
+
938
+ // src/motion/index.ts
939
+ import {
940
+ motion as motion11,
941
+ AnimatePresence as AnimatePresence2,
942
+ LayoutGroup,
943
+ MotionConfig,
944
+ useMotionValue as useMotionValue2,
945
+ useTransform as useTransform3,
946
+ useSpring,
947
+ animate as animate2,
948
+ useDragControls,
949
+ useMotionValueEvent,
950
+ useScroll as useScroll4,
951
+ useInView,
952
+ useReducedMotion as useReducedMotion11,
953
+ useAnimationControls,
954
+ cubicBezier as cubicBezier2
955
+ } from "framer-motion";
956
+
957
+ export {
958
+ useInViewOnce,
959
+ editorialEase,
960
+ motionPresets,
961
+ updatePresets,
962
+ chipEntry,
963
+ hoverPresets,
964
+ pressPresets,
965
+ successFlash,
966
+ panelSlideIn,
967
+ inputFocusRing,
968
+ Reveal,
969
+ RevealStagger,
970
+ Pin,
971
+ Parallax,
972
+ StickyShelf,
973
+ MorphRegion,
974
+ AgentReveal,
975
+ AgentStagger,
976
+ AgentStaggerItem,
977
+ agentStaggerVariants,
978
+ AgentTypeIn,
979
+ AgentCaret,
980
+ AgentPulseOnChange,
981
+ AgentShimmer,
982
+ ShimmerSkeleton,
983
+ ActiveBlockIndicator,
984
+ ResolveEntrance,
985
+ WordReveal,
986
+ BlurUpImage,
987
+ DEFAULT_GENERATION_STYLE,
988
+ DEFAULT_GENERATION_TIMINGS,
989
+ GENERATION_EASE2 as GENERATION_EASE,
990
+ buildEntranceProps3 as buildEntranceProps,
991
+ useGenerationStyle2 as useGenerationStyle,
992
+ useScrollProgress,
993
+ useScrollDirection,
994
+ useSuccessFlash,
995
+ useStableValue,
996
+ scrollEventTarget2 as scrollEventTarget,
997
+ motion11 as motion,
998
+ AnimatePresence2 as AnimatePresence,
999
+ LayoutGroup,
1000
+ MotionConfig,
1001
+ useMotionValue2 as useMotionValue,
1002
+ useTransform3 as useTransform,
1003
+ useSpring,
1004
+ animate2 as animate,
1005
+ useDragControls,
1006
+ useMotionValueEvent,
1007
+ useScroll4 as useScroll,
1008
+ useInView,
1009
+ useReducedMotion11 as useReducedMotion,
1010
+ useAnimationControls,
1011
+ cubicBezier2 as cubicBezier
1012
+ };