@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.
- package/dist/agent.js +148 -0
- package/dist/catalog-data.js +93 -0
- package/dist/catalog-entries.js +8 -0
- package/dist/chunk-432XYPDT.js +1012 -0
- package/dist/chunk-54QPRWEG.js +2800 -0
- package/dist/chunk-CKGGECAQ.js +239 -0
- package/dist/chunk-E3IJDSKY.js +173 -0
- package/dist/chunk-JQNZ5UUK.js +226 -0
- package/dist/chunk-LQLOG2V3.js +649 -0
- package/dist/chunk-MHUEIBJ3.js +117 -0
- package/dist/chunk-ORIOBWTD.js +112 -0
- package/dist/css/preset/motion.css +78 -0
- package/dist/css/preset/tailwind-theme.css +163 -0
- package/dist/css/shell/mobile/island.css +478 -0
- package/dist/hooks.js +25 -0
- package/dist/index.js +7165 -0
- package/dist/motion.js +113 -0
- package/dist/shell.js +5621 -0
- package/dist/types/agent/AgentStreamingState.d.ts +58 -0
- package/dist/types/agent/ProseSurface.d.ts +31 -0
- package/dist/types/agent/index.d.ts +8 -0
- package/dist/types/agent/phase-label.d.ts +13 -0
- package/dist/types/agent/presence/AgentPresenceWidget.d.ts +85 -0
- package/dist/types/agent/presence/BriefIdentity.d.ts +9 -0
- package/dist/types/agent/presence/CompactRead.d.ts +44 -0
- package/dist/types/agent/presence/CriteriaRail.d.ts +68 -0
- package/dist/types/agent/presence/DefaultNotch.d.ts +2 -0
- package/dist/types/agent/presence/FactChip.d.ts +10 -0
- package/dist/types/agent/presence/InlinePresenceRead.d.ts +25 -0
- package/dist/types/agent/presence/KnowledgePeek.d.ts +23 -0
- package/dist/types/agent/presence/LayoutMorphSkeleton.d.ts +59 -0
- package/dist/types/agent/presence/PresenceBrief.d.ts +29 -0
- package/dist/types/agent/presence/PresenceFiller.d.ts +24 -0
- package/dist/types/agent/presence/SourceSift.d.ts +48 -0
- package/dist/types/agent/presence/StreamRead.d.ts +50 -0
- package/dist/types/agent/presence/VoiceLine.d.ts +19 -0
- package/dist/types/agent/presence/band-beat.d.ts +40 -0
- package/dist/types/agent/presence/band-row.d.ts +188 -0
- package/dist/types/agent/presence/cite-image.d.ts +9 -0
- package/dist/types/agent/presence/class-names.d.ts +134 -0
- package/dist/types/agent/presence/element-view.d.ts +83 -0
- package/dist/types/agent/presence/fact-forms/baseline-forms.d.ts +20 -0
- package/dist/types/agent/presence/fact-forms/class-names.d.ts +14 -0
- package/dist/types/agent/presence/fact-forms/index.d.ts +3 -0
- package/dist/types/agent/presence/fact-forms/register.d.ts +9 -0
- package/dist/types/agent/presence/fact-rail.d.ts +76 -0
- package/dist/types/agent/presence/fact-slots.d.ts +97 -0
- package/dist/types/agent/presence/folded.d.ts +26 -0
- package/dist/types/agent/presence/forms.d.ts +5 -0
- package/dist/types/agent/presence/index.d.ts +39 -0
- package/dist/types/agent/presence/notch/PresenceNotch.d.ts +20 -0
- package/dist/types/agent/presence/parts.d.ts +29 -0
- package/dist/types/agent/presence/read-data.d.ts +48 -0
- package/dist/types/agent/presence/reads.d.ts +37 -0
- package/dist/types/agent/presence/sift-deck.d.ts +58 -0
- package/dist/types/agent/presence/source-cards/ArticleSourceCard.d.ts +4 -0
- package/dist/types/agent/presence/source-cards/CollectionSourceCard.d.ts +4 -0
- package/dist/types/agent/presence/source-cards/PolicySourceCard.d.ts +4 -0
- package/dist/types/agent/presence/source-cards/ProductSourceCard.d.ts +4 -0
- package/dist/types/agent/presence/source-cards/ReviewSourceCard.d.ts +4 -0
- package/dist/types/agent/presence/source-cards/SourceCard.d.ts +4 -0
- package/dist/types/agent/presence/source-cards/card-frame.d.ts +38 -0
- package/dist/types/agent/presence/source-cards/card-marks.d.ts +69 -0
- package/dist/types/agent/presence/source-cards/card-plate.d.ts +20 -0
- package/dist/types/agent/presence/source-cards/card-shell.d.ts +91 -0
- package/dist/types/agent/presence/source-cards/register.d.ts +6 -0
- package/dist/types/agent/presence/source-cards/review-passage.d.ts +53 -0
- package/dist/types/agent/presence/swatch.d.ts +4 -0
- package/dist/types/agent/presence/use-band-facts.d.ts +9 -0
- package/dist/types/agent/presence/use-forget-fact.d.ts +56 -0
- package/dist/types/agent/presence/use-measured-height.d.ts +11 -0
- package/dist/types/catalog-data/base.d.ts +2 -0
- package/dist/types/catalog-data/chat.d.ts +55 -0
- package/dist/types/catalog-data/content.d.ts +1129 -0
- package/dist/types/catalog-data/ecommerce.d.ts +4842 -0
- package/dist/types/catalog-data/index.d.ts +7 -0
- package/dist/types/catalog-data/social.d.ts +1552 -0
- package/dist/types/catalog-data/tokens.d.ts +20 -0
- package/dist/types/catalog-data/ugc.d.ts +50 -0
- package/dist/types/catalog-entries.d.ts +35 -0
- package/dist/types/catalog.d.ts +18 -0
- package/dist/types/components/SkeletonSwap.d.ts +27 -0
- package/dist/types/components/agentic/AgentText.d.ts +44 -0
- package/dist/types/components/agentic/Turn.d.ts +21 -0
- package/dist/types/components/browse/CanvasBootLoader.d.ts +16 -0
- package/dist/types/components/browse/ContinuationLoading.d.ts +22 -0
- package/dist/types/components/browse/canvas-booting.d.ts +37 -0
- package/dist/types/components/browse/constants.d.ts +2 -0
- package/dist/types/components/browse/index.d.ts +4 -0
- package/dist/types/components/chat/SuggestionCards.d.ts +2 -0
- package/dist/types/components/chat/index.d.ts +1 -0
- package/dist/types/components/content/FAQ.d.ts +12 -0
- package/dist/types/components/content/FeatureGrid.d.ts +11 -0
- package/dist/types/components/content/InfoCards.d.ts +16 -0
- package/dist/types/components/content/Reviews.d.ts +9 -0
- package/dist/types/components/content/RichText.d.ts +10 -0
- package/dist/types/components/content/article/ArticleDetail.d.ts +15 -0
- package/dist/types/components/content/article/BlogCard.d.ts +11 -0
- package/dist/types/components/content/article/BlogPosts.d.ts +19 -0
- package/dist/types/components/content/page/PageDetail.d.ts +13 -0
- package/dist/types/components/content/page/PolicyDetail.d.ts +23 -0
- package/dist/types/components/ecommerce/cart/AddToCartButton.d.ts +9 -0
- package/dist/types/components/ecommerce/cart/CartContent.d.ts +40 -0
- package/dist/types/components/ecommerce/cart/CartDrawer.d.ts +41 -0
- package/dist/types/components/ecommerce/cart/CartFoot.d.ts +30 -0
- package/dist/types/components/ecommerce/cart/CartLineItem.d.ts +13 -0
- package/dist/types/components/ecommerce/cart/CartLineRow.d.ts +17 -0
- package/dist/types/components/ecommerce/cart/CartPromoCode.d.ts +29 -0
- package/dist/types/components/ecommerce/cart/CartSummary.d.ts +7 -0
- package/dist/types/components/ecommerce/cart/CartWidget.d.ts +10 -0
- package/dist/types/components/ecommerce/cart/VariantPickerModal.d.ts +12 -0
- package/dist/types/components/ecommerce/cart/cart-format.d.ts +8 -0
- package/dist/types/components/ecommerce/cart/use-cart-view.d.ts +50 -0
- package/dist/types/components/ecommerce/collection/CollectionCard.d.ts +10 -0
- package/dist/types/components/ecommerce/collection/CollectionGrid.d.ts +8 -0
- package/dist/types/components/ecommerce/collection/CollectionList.d.ts +13 -0
- package/dist/types/components/ecommerce/collection/internal/CollectionListItem.d.ts +13 -0
- package/dist/types/components/ecommerce/product/AddToRegistry.d.ts +36 -0
- package/dist/types/components/ecommerce/product/ComparisonTable.d.ts +25 -0
- package/dist/types/components/ecommerce/product/ComparisonTableSkeleton.d.ts +11 -0
- package/dist/types/components/ecommerce/product/PresenceProductRail.d.ts +35 -0
- package/dist/types/components/ecommerce/product/ProductBadge.d.ts +9 -0
- package/dist/types/components/ecommerce/product/ProductCard.d.ts +27 -0
- package/dist/types/components/ecommerce/product/ProductDetail.d.ts +25 -0
- package/dist/types/components/ecommerce/product/ProductGallery.d.ts +19 -0
- package/dist/types/components/ecommerce/product/ProductGrid.d.ts +26 -0
- package/dist/types/components/ecommerce/product/ProductImage.d.ts +54 -0
- package/dist/types/components/ecommerce/product/ProductOption.d.ts +9 -0
- package/dist/types/components/ecommerce/product/ProductPrice.d.ts +8 -0
- package/dist/types/components/ecommerce/product/ProductVideoPlayer.d.ts +17 -0
- package/dist/types/components/ecommerce/product/comparison-table-parts.d.ts +41 -0
- package/dist/types/components/ecommerce/product/comparison-table-rows.d.ts +24 -0
- package/dist/types/components/ecommerce/product/image-trim.d.ts +35 -0
- package/dist/types/components/ecommerce/product/product-card-glyphs.d.ts +2 -0
- package/dist/types/components/ecommerce/product/registry-logos.d.ts +2 -0
- package/dist/types/components/ecommerce/product/trim-geometry.d.ts +45 -0
- package/dist/types/components/ecommerce/wishlist/WishlistDrawer.d.ts +16 -0
- package/dist/types/components/feedback/Skeleton.d.ts +13 -0
- package/dist/types/components/feedback/Thinking.d.ts +15 -0
- package/dist/types/components/layout/AspectRatio.d.ts +5 -0
- package/dist/types/components/layout/Backdrop.d.ts +32 -0
- package/dist/types/components/layout/Container.d.ts +6 -0
- package/dist/types/components/layout/Divider.d.ts +5 -0
- package/dist/types/components/layout/Drawer.d.ts +9 -0
- package/dist/types/components/layout/DrawerDockSlot.d.ts +40 -0
- package/dist/types/components/layout/Grid.d.ts +8 -0
- package/dist/types/components/layout/Modal.d.ts +25 -0
- package/dist/types/components/layout/Page.d.ts +11 -0
- package/dist/types/components/layout/Section.d.ts +6 -0
- package/dist/types/components/layout/Stack.d.ts +7 -0
- package/dist/types/components/marketing/AnnouncementBar.d.ts +15 -0
- package/dist/types/components/marketing/BrandStory.d.ts +19 -0
- package/dist/types/components/marketing/HeroBanner.d.ts +69 -0
- package/dist/types/components/marketing/HeroBannerFeatures.d.ts +10 -0
- package/dist/types/components/marketing/HeroBannerInline.d.ts +20 -0
- package/dist/types/components/marketing/PromoBanner.d.ts +11 -0
- package/dist/types/components/marketing/internal/AnnouncementLink.d.ts +5 -0
- package/dist/types/components/marketing/internal/AnnouncementMessage.d.ts +10 -0
- package/dist/types/components/navigation/Breadcrumbs.d.ts +10 -0
- package/dist/types/components/navigation/Footer.d.ts +15 -0
- package/dist/types/components/navigation/Header.d.ts +14 -0
- package/dist/types/components/navigation/internal/BreadcrumbLink.d.ts +5 -0
- package/dist/types/components/navigation/internal/FooterLink.d.ts +5 -0
- package/dist/types/components/navigation/internal/HeaderLink.d.ts +5 -0
- package/dist/types/components/shell/BaseMark.d.ts +11 -0
- package/dist/types/components/shell/CartPill.d.ts +13 -0
- package/dist/types/components/shell/ComposerDock.d.ts +9 -0
- package/dist/types/components/shell/ErrorBanner.d.ts +14 -0
- package/dist/types/components/shell/HistoryMenu.d.ts +15 -0
- package/dist/types/components/shell/MenuButton.d.ts +31 -0
- package/dist/types/components/shell/MountainRidges.d.ts +11 -0
- package/dist/types/components/shell/PendingTurn.d.ts +1 -0
- package/dist/types/components/shell/ShellTop.d.ts +35 -0
- package/dist/types/components/shell/brand-shell.d.ts +441 -0
- package/dist/types/components/shell/index.d.ts +9 -0
- package/dist/types/components/shell/marks/index.d.ts +5 -0
- package/dist/types/components/social/ReviewCard.d.ts +9 -0
- package/dist/types/components/social/ReviewSummary.d.ts +7 -0
- package/dist/types/components/social/TestimonialCard.d.ts +9 -0
- package/dist/types/components/social/TestimonialCarousel.d.ts +16 -0
- package/dist/types/components/social/UgcCard.d.ts +9 -0
- package/dist/types/components/social/UgcGallery.d.ts +8 -0
- package/dist/types/hooks/index.d.ts +8 -0
- package/dist/types/hooks/keyboard.d.ts +18 -0
- package/dist/types/hooks/use-container-width.d.ts +11 -0
- package/dist/types/hooks/use-dismiss-on-outside.d.ts +23 -0
- package/dist/types/hooks/use-focus-on-change.d.ts +8 -0
- package/dist/types/hooks/use-focus-trap.d.ts +12 -0
- package/dist/types/hooks/use-media-query.d.ts +12 -0
- package/dist/types/hooks/use-projection.d.ts +24 -0
- package/dist/types/hooks/use-reduced-motion.d.ts +1 -0
- package/dist/types/hooks/use-scroll-lock.d.ts +19 -0
- package/dist/types/hooks/use-scroll-threshold.d.ts +14 -0
- package/dist/types/hooks/use-textarea-autosize.d.ts +16 -0
- package/dist/types/index.d.ts +74 -0
- package/dist/types/labels-context.d.ts +18 -0
- package/dist/types/labels.d.ts +240 -0
- package/dist/types/motion/ease.d.ts +10 -0
- package/dist/types/motion/generation/ActiveBlockIndicator.d.ts +27 -0
- package/dist/types/motion/generation/BlurUpImage.d.ts +23 -0
- package/dist/types/motion/generation/ResolveEntrance.d.ts +22 -0
- package/dist/types/motion/generation/ShimmerSkeleton.d.ts +20 -0
- package/dist/types/motion/generation/WordReveal.d.ts +26 -0
- package/dist/types/motion/generation/index.d.ts +6 -0
- package/dist/types/motion/hooks/useInViewOnce.d.ts +14 -0
- package/dist/types/motion/hooks/useScrollDirection.d.ts +38 -0
- package/dist/types/motion/hooks/useScrollProgress.d.ts +23 -0
- package/dist/types/motion/hooks/useStableValue.d.ts +36 -0
- package/dist/types/motion/hooks/useSuccessFlash.d.ts +1 -0
- package/dist/types/motion/index.d.ts +18 -0
- package/dist/types/motion/presets.d.ts +335 -0
- package/dist/types/motion/primitives/Agent.d.ts +118 -0
- package/dist/types/motion/primitives/MorphRegion.d.ts +16 -0
- package/dist/types/motion/primitives/Parallax.d.ts +19 -0
- package/dist/types/motion/primitives/Pin.d.ts +26 -0
- package/dist/types/motion/primitives/Reveal.d.ts +29 -0
- package/dist/types/motion/primitives/RevealStagger.d.ts +16 -0
- package/dist/types/motion/primitives/StickyShelf.d.ts +18 -0
- package/dist/types/primitives/Badge/index.d.ts +12 -0
- package/dist/types/primitives/Button/index.d.ts +25 -0
- package/dist/types/primitives/Input/index.d.ts +5 -0
- package/dist/types/primitives/Money/index.d.ts +13 -0
- package/dist/types/primitives/Select/index.d.ts +5 -0
- package/dist/types/primitives/Skeleton/index.d.ts +4 -0
- package/dist/types/shell/AnimatedPlaceholder.d.ts +13 -0
- package/dist/types/shell/BottomSheet.d.ts +54 -0
- package/dist/types/shell/Button.d.ts +19 -0
- package/dist/types/shell/ChromeSurface.d.ts +33 -0
- package/dist/types/shell/Composer.d.ts +56 -0
- package/dist/types/shell/ComposerChipStrip.d.ts +9 -0
- package/dist/types/shell/ConversationTransition.d.ts +27 -0
- package/dist/types/shell/DictationButton.d.ts +24 -0
- package/dist/types/shell/DragSheet.d.ts +34 -0
- package/dist/types/shell/InlineCompletion.d.ts +38 -0
- package/dist/types/shell/LauncherDock.d.ts +40 -0
- package/dist/types/shell/ListeningWaveform.d.ts +18 -0
- package/dist/types/shell/MenuAccordionPanel.d.ts +26 -0
- package/dist/types/shell/MenuDrawer.d.ts +72 -0
- package/dist/types/shell/MenuFlyout.d.ts +22 -0
- package/dist/types/shell/MenuNav.d.ts +30 -0
- package/dist/types/shell/MenuNavBar.d.ts +22 -0
- package/dist/types/shell/ShellMenuChrome.d.ts +66 -0
- package/dist/types/shell/ShellScaffold.d.ts +92 -0
- package/dist/types/shell/SideDock.d.ts +75 -0
- package/dist/types/shell/Skeleton.d.ts +22 -0
- package/dist/types/shell/Spinner.d.ts +10 -0
- package/dist/types/shell/TypedPlaceholder.d.ts +11 -0
- package/dist/types/shell/VoiceControl.d.ts +23 -0
- package/dist/types/shell/VoiceIsland.d.ts +24 -0
- package/dist/types/shell/canvas-gutter-style.d.ts +15 -0
- package/dist/types/shell/composer/AttachButton.d.ts +14 -0
- package/dist/types/shell/composer/AttachmentStrip.d.ts +12 -0
- package/dist/types/shell/composer/ClearSessionButton.d.ts +16 -0
- package/dist/types/shell/composer/ConversationHistoryButton.d.ts +25 -0
- package/dist/types/shell/composer/ShareCanvasButton.d.ts +19 -0
- package/dist/types/shell/composer/ThreadJumpRail.d.ts +43 -0
- package/dist/types/shell/composer/composer-metrics.d.ts +6 -0
- package/dist/types/shell/composer/field-metrics.d.ts +97 -0
- package/dist/types/shell/composer/heic-convert.d.ts +6 -0
- package/dist/types/shell/composer/use-field-autosize.d.ts +26 -0
- package/dist/types/shell/composer/useComposerAttachments.d.ts +37 -0
- package/dist/types/shell/composer/usePromptComposer.d.ts +51 -0
- package/dist/types/shell/dock-context.d.ts +10 -0
- package/dist/types/shell/index.d.ts +36 -0
- package/dist/types/shell/menu-columns.d.ts +19 -0
- package/dist/types/shell/mobile/DefaultMobileShell.d.ts +88 -0
- package/dist/types/shell/mobile/IslandComposeGroup.d.ts +41 -0
- package/dist/types/shell/mobile/IslandInputBar.d.ts +61 -0
- package/dist/types/shell/mobile/IslandNavButtons.d.ts +20 -0
- package/dist/types/shell/mobile/IslandTrailingAction.d.ts +34 -0
- package/dist/types/shell/mobile/MobileChrome.d.ts +34 -0
- package/dist/types/shell/mobile/MobileVoiceConsole.d.ts +42 -0
- package/dist/types/shell/mobile/MorphIsland.d.ts +105 -0
- package/dist/types/shell/mobile/RestIsland.d.ts +41 -0
- package/dist/types/shell/mobile/constants.d.ts +26 -0
- package/dist/types/shell/mobile/document-scroll-ref.d.ts +22 -0
- package/dist/types/shell/mobile/hero-entry-point.d.ts +110 -0
- package/dist/types/shell/mobile/island-metrics.d.ts +131 -0
- package/dist/types/shell/mobile/sheet-detents.d.ts +49 -0
- package/dist/types/shell/mobile/turn-end-action.d.ts +44 -0
- package/dist/types/shell/mobile/use-blur-on-canvas-gesture.d.ts +31 -0
- package/dist/types/shell/mobile/use-island-fold-scroll.d.ts +28 -0
- package/dist/types/shell/mobile/use-keyboard-inset.d.ts +18 -0
- package/dist/types/shell/mobile/use-sheet-fold-gesture.d.ts +57 -0
- package/dist/types/shell/slots.d.ts +16 -0
- package/dist/types/shell/thread-reland.d.ts +22 -0
- package/dist/types/shell/use-dock-state.d.ts +54 -0
- package/dist/types/types/commerce.d.ts +1 -0
- package/dist/types/utils/cn.d.ts +2 -0
- package/dist/types/utils/format-money.d.ts +2 -0
- package/dist/types/utils/html-to-text.d.ts +8 -0
- package/dist/types/utils/sanitize-html.d.ts +12 -0
- package/dist/types/utils/use-backdrop-presence.d.ts +24 -0
- package/dist/types/utils/use-composer-mode.d.ts +26 -0
- package/dist/types/utils/use-is-seed-home.d.ts +13 -0
- package/dist/types/utils/use-safe-cart.d.ts +17 -0
- package/dist/types/utils/use-safe-facts.d.ts +9 -0
- package/dist/types/utils/use-safe-fourty-session.d.ts +15 -0
- package/package.json +80 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Measures an element's own rendered width via `ResizeObserver` — the
|
|
4
|
+
* correct signal for LAYOUT responsiveness (column counts, card sizing),
|
|
5
|
+
* as opposed to `useMediaQuery`/`useFormFactor`'s viewport width, which
|
|
6
|
+
* can't see how much of the viewport a sibling (a side dock, a drawer)
|
|
7
|
+
* has already taken. A grid that reads viewport width stays "desktop"
|
|
8
|
+
* and keeps its full column count even when the dock has left it a
|
|
9
|
+
* fraction of the screen — this hook is the fix for that class of bug.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useContainerWidth<T extends HTMLElement>(): [RefObject<T | null>, number];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Options {
|
|
3
|
+
/** When false, no listeners are attached. */
|
|
4
|
+
active: boolean;
|
|
5
|
+
/** Called when an outside interaction occurs. */
|
|
6
|
+
onDismiss: () => void;
|
|
7
|
+
/** Element whose interior counts as "inside". */
|
|
8
|
+
containerRef: React.RefObject<HTMLElement | null>;
|
|
9
|
+
/**
|
|
10
|
+
* Additional scrollers to treat as dismiss triggers (any scroll on
|
|
11
|
+
* them collapses the surface). `window` is always watched in addition.
|
|
12
|
+
* Pass refs whose `.current` may be null until the shell mounts.
|
|
13
|
+
*/
|
|
14
|
+
dismissOnScrollRefs?: ReadonlyArray<React.RefObject<HTMLElement | null>>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Outside-dismiss primitive — click outside, press Escape, or scroll
|
|
18
|
+
* the page / a registered scroller. Generic UI behaviour shared by
|
|
19
|
+
* composer surfaces, popovers, drawers; lives in SDK so brand UIs don't
|
|
20
|
+
* re-wire `window.addEventListener` for every floating element.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useDismissOnOutside({ active, onDismiss, containerRef, dismissOnScrollRefs, }: Options): void;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Focus an element when `active` flips true. Optional `delayMs` lets
|
|
4
|
+
* the focus call wait for an in-progress mount/animation to settle.
|
|
5
|
+
*
|
|
6
|
+
* Generic affordance — composer expansion, popover open, modal show.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useFocusOnChange(ref: React.RefObject<HTMLElement | null>, active: boolean, delayMs?: number): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* useFocusTrap — keep keyboard focus inside a container while `active`.
|
|
4
|
+
*
|
|
5
|
+
* The dialog pattern (WCAG 2.1.2): when a modal surface (cart drawer,
|
|
6
|
+
* side sheet) opens, focus moves into it, Tab/Shift+Tab cycle within
|
|
7
|
+
* it, and on close focus returns to the element that opened it.
|
|
8
|
+
*
|
|
9
|
+
* Listens on the container's `ownerDocument` — no window/document
|
|
10
|
+
* globals — so it works inside iframes and portals.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useFocusTrap(ref: React.RefObject<HTMLElement | null>, active: boolean): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Does the viewport match `query`?
|
|
3
|
+
*
|
|
4
|
+
* `false` until the effect runs, so the server and the first client paint
|
|
5
|
+
* agree — callers (notably `ShellScaffold`) are written around that.
|
|
6
|
+
*
|
|
7
|
+
* WHICH viewport is `ViewportWindowContext`'s business: the global window
|
|
8
|
+
* unless a host provides another. The session replay provides the iframe it
|
|
9
|
+
* portals the spacefront into, so the shell picks its mobile layout from the
|
|
10
|
+
* replayed phone's width rather than from the reviewer's monitor.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useMediaQuery(query: string): boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface ProjectionView {
|
|
2
|
+
/** True when a standing projection is hiding part of this entity. */
|
|
3
|
+
active: boolean;
|
|
4
|
+
/** True when the visitor toggled "show all" on this element. */
|
|
5
|
+
expanded: boolean;
|
|
6
|
+
/** How many items the projection hides. */
|
|
7
|
+
hiddenCount: number;
|
|
8
|
+
/** Axes the projection narrowed — render these as a label when
|
|
9
|
+
* collapsed; leave natively single-value axes hidden. */
|
|
10
|
+
trimmedAxes: string[];
|
|
11
|
+
/** The un-projected entity — render this instead of the trimmed prop
|
|
12
|
+
* when `expanded`. Typed `unknown`: the caller parses it with its own
|
|
13
|
+
* schema (the same one it already applies to the trimmed prop). */
|
|
14
|
+
fullEntity: unknown;
|
|
15
|
+
/** Flip trimmed ⇄ full for this element. */
|
|
16
|
+
toggle: () => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* `useProjection(projectionProp, entity)` — projection state for a
|
|
20
|
+
* component's primary entity. Pass the component's `__projection` prop and
|
|
21
|
+
* its (trimmed) entity prop. Returns `active: false` when nothing is
|
|
22
|
+
* projected.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useProjection(projectionProp: unknown, entity: unknown): ProjectionView;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useReducedMotion(): boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Locks the scrolling document while an overlay (drawer, menu, conversation
|
|
4
|
+
* sheet) is open, so a drag that starts inside the overlay can never chain out
|
|
5
|
+
* and scroll the canvas underneath it — the visitor comes back to the page
|
|
6
|
+
* they left.
|
|
7
|
+
*
|
|
8
|
+
* `overflow: hidden` on the scrolling element, NOT the `position: fixed` body
|
|
9
|
+
* technique: the mobile shell scrolls the real document with a `position:
|
|
10
|
+
* sticky` header (see `DefaultMobileShell`), and fixing the body collapses that
|
|
11
|
+
* whole model — the page jumps to the top and the sticky header detaches.
|
|
12
|
+
* `overflow: hidden` freezes scrolling while preserving the offset, so the
|
|
13
|
+
* canvas is exactly where it was when the overlay closes.
|
|
14
|
+
*
|
|
15
|
+
* Scoped through `anchorRef`'s `ownerDocument` rather than the global
|
|
16
|
+
* `document`, per the platform's no-`window` rule — correct even if the
|
|
17
|
+
* spacefront is mounted in an iframe or a popped-out document.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useScrollLock(locked: boolean, anchorRef: RefObject<HTMLElement | null>): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* `true` once `scrollerRef.current.scrollTop` crosses `threshold`,
|
|
4
|
+
* `false` again when it goes back under. Generic UI affordance — used by
|
|
5
|
+
* composer fold, sticky header elevation, scroll-progress chips.
|
|
6
|
+
*
|
|
7
|
+
* Works for both scroller shapes the shells use: an inner `overflow-y: auto`
|
|
8
|
+
* element (desktop `<main>`) and the DOCUMENT scroller (the mobile shell —
|
|
9
|
+
* see `DefaultMobileShell`'s scroll model). The document case needs `window`
|
|
10
|
+
* as the emitter: its `scroll` event targets `document` and bubbles to
|
|
11
|
+
* `window`, never passing through `documentElement`, so listening on the
|
|
12
|
+
* element itself would silently never fire.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useScrollThreshold(scrollerRef: React.RefObject<HTMLElement | null>, threshold: number): boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Options {
|
|
3
|
+
/** Caps growth at `maxLines * lineHeightPx` pixels. */
|
|
4
|
+
maxLines?: number;
|
|
5
|
+
/** Pixel line height used to compute the cap. Defaults to 22. */
|
|
6
|
+
lineHeightPx?: number;
|
|
7
|
+
/** Extra deps to re-measure on (e.g. an expanded/collapsed flag). */
|
|
8
|
+
extraDeps?: ReadonlyArray<unknown>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Grow a textarea with its content up to `maxLines`. Generic form
|
|
12
|
+
* behaviour — every brand composer wants this; brand decides the
|
|
13
|
+
* styling, SDK owns the resize math.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useTextareaAutosize(ref: React.RefObject<HTMLTextAreaElement | null>, value: string, { maxLines, lineHeightPx, extraDeps }?: Options): void;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export { components, catalog, componentMap, STRUCTURAL_BASELINE_RENDERERS } from './catalog';
|
|
2
|
+
export { PendingTurn, ShellTop, ComposerDock, ErrorBanner, CartPill, HistoryMenu, BaseMark, ShellMark, type ShellMarkProps, parseBaseShell, type BaseShellConfig, } from './components/shell';
|
|
3
|
+
export { DefaultNotch, PresenceNotch, AgentPresenceWidget, type AgentPresenceWidgetProps, registerDefaultPresenceForms, InlinePresenceRead, LayoutMorphSkeleton, Eyebrow, Rule, Fallback, Thought, Dossier, FoldedRead, BriefHandle, PresenceBriefBody, PresenceBriefDrawer, colorSwatch, readFacts, readLabel, type Fact, presenceClass, useMeasuredHeight, FactChips, useVisibleFacts, ProseSurface, type ProseSurfaceProps, } from './agent';
|
|
4
|
+
export { ComposerModeProvider, useComposerMode, type ComposerMode, } from './utils/use-composer-mode';
|
|
5
|
+
export { useIsSeedHome } from './utils/use-is-seed-home';
|
|
6
|
+
export { BackdropPresenceProvider, useBackdropPresence, type BackdropVariant, } from './utils/use-backdrop-presence';
|
|
7
|
+
export type { Money, Image, ProductVariant, Product, Collection, CartLine, Cart, } from './types/commerce';
|
|
8
|
+
export { cn } from './utils/cn';
|
|
9
|
+
export { formatMoney } from './utils/format-money';
|
|
10
|
+
export { htmlToText } from './utils/html-to-text';
|
|
11
|
+
export { sanitizeHtml } from './utils/sanitize-html';
|
|
12
|
+
export { useMediaQuery } from './hooks/use-media-query';
|
|
13
|
+
export { useScrollLock } from './hooks/use-scroll-lock';
|
|
14
|
+
export { useReducedMotion } from './hooks/use-reduced-motion';
|
|
15
|
+
export { useContainerWidth } from './hooks/use-container-width';
|
|
16
|
+
export { DEFAULT_LABELS, type Labels } from './labels';
|
|
17
|
+
export { LabelsProvider, useLabels, type LabelsProviderProps, type LabelOverrides } from './labels-context';
|
|
18
|
+
export { Button, type ButtonProps } from './primitives/Button';
|
|
19
|
+
export { Badge, type BadgeProps } from './primitives/Badge';
|
|
20
|
+
export { Skeleton, type SkeletonProps } from './primitives/Skeleton';
|
|
21
|
+
export { Money as MoneyDisplay, type MoneyProps } from './primitives/Money';
|
|
22
|
+
export { Input, type InputProps } from './primitives/Input';
|
|
23
|
+
export { Select, type SelectProps } from './primitives/Select';
|
|
24
|
+
export { Container, type ContainerProps } from './components/layout/Container';
|
|
25
|
+
export { Section, type SectionProps } from './components/layout/Section';
|
|
26
|
+
export { Grid, type GridProps } from './components/layout/Grid';
|
|
27
|
+
export { Stack, type StackProps } from './components/layout/Stack';
|
|
28
|
+
export { Divider, type DividerProps } from './components/layout/Divider';
|
|
29
|
+
export { AspectRatio, type AspectRatioProps } from './components/layout/AspectRatio';
|
|
30
|
+
export { Drawer, type DrawerProps } from './components/layout/Drawer';
|
|
31
|
+
export { DrawerDockSlot, type DrawerDockSlotProps } from './components/layout/DrawerDockSlot';
|
|
32
|
+
export { Modal, type ModalProps } from './components/layout/Modal';
|
|
33
|
+
export { AgentContinuationFoot, CanvasBootLoader } from './components/browse';
|
|
34
|
+
export { ProductCard, type ProductCardProps } from './components/ecommerce/product/ProductCard';
|
|
35
|
+
export { ProductGrid, type ProductGridProps } from './components/ecommerce/product/ProductGrid';
|
|
36
|
+
export { ProductGallery, type ProductGalleryProps } from './components/ecommerce/product/ProductGallery';
|
|
37
|
+
export { ProductImage, type ProductImageProps } from './components/ecommerce/product/ProductImage';
|
|
38
|
+
export { PresenceProductRail, HydratedProductRail, type PresenceProductRailProps } from './components/ecommerce/product/PresenceProductRail';
|
|
39
|
+
export { ProductPrice, type ProductPriceProps } from './components/ecommerce/product/ProductPrice';
|
|
40
|
+
export { ProductBadge, type ProductBadgeProps } from './components/ecommerce/product/ProductBadge';
|
|
41
|
+
export { ProductOption, type ProductOptionProps } from './components/ecommerce/product/ProductOption';
|
|
42
|
+
export { ComparisonTable, type ComparisonTableProps } from './components/ecommerce/product/ComparisonTable';
|
|
43
|
+
export { AddToRegistry, type RegistryProvider } from './components/ecommerce/product/AddToRegistry';
|
|
44
|
+
export { projectRowValues, rowWinnerIndex, type ComparisonRow } from './components/ecommerce/product/comparison-table-rows';
|
|
45
|
+
export { AddToCartButton, type AddToCartButtonProps } from './components/ecommerce/cart/AddToCartButton';
|
|
46
|
+
export { CartLineItem, type CartLineItemProps } from './components/ecommerce/cart/CartLineItem';
|
|
47
|
+
export { CartSummary, type CartSummaryProps } from './components/ecommerce/cart/CartSummary';
|
|
48
|
+
export { CartDrawer, type CartDrawerProps } from './components/ecommerce/cart/CartDrawer';
|
|
49
|
+
export { CartContent, type CartContentProps } from './components/ecommerce/cart/CartContent';
|
|
50
|
+
export { CartLineRow } from './components/ecommerce/cart/CartLineRow';
|
|
51
|
+
export { useCartView, type CartViewModel } from './components/ecommerce/cart/use-cart-view';
|
|
52
|
+
export { formatPrice } from './components/ecommerce/cart/cart-format';
|
|
53
|
+
export { default as CartWidget } from './components/ecommerce/cart/CartWidget';
|
|
54
|
+
export { VariantPickerModal } from './components/ecommerce/cart/VariantPickerModal';
|
|
55
|
+
export { WishlistDrawer, type WishlistDrawerProps } from './components/ecommerce/wishlist/WishlistDrawer';
|
|
56
|
+
export { CollectionCard, type CollectionCardProps } from './components/ecommerce/collection/CollectionCard';
|
|
57
|
+
export { CollectionGrid, type CollectionGridProps } from './components/ecommerce/collection/CollectionGrid';
|
|
58
|
+
export { HeroBanner, type HeroBannerProps } from './components/marketing/HeroBanner';
|
|
59
|
+
export { AnnouncementBar, type AnnouncementBarProps } from './components/marketing/AnnouncementBar';
|
|
60
|
+
export { PromoBanner, type PromoBannerProps } from './components/marketing/PromoBanner';
|
|
61
|
+
export { TestimonialCard, type TestimonialCardProps } from './components/social/TestimonialCard';
|
|
62
|
+
export { TestimonialCarousel, type TestimonialCarouselProps } from './components/social/TestimonialCarousel';
|
|
63
|
+
export { ReviewCard, type ReviewCardProps } from './components/social/ReviewCard';
|
|
64
|
+
export { ReviewSummary, type ReviewSummaryProps } from './components/social/ReviewSummary';
|
|
65
|
+
export { BlogCard, type BlogCardProps } from './components/content/article/BlogCard';
|
|
66
|
+
export { ArticleDetail } from './components/content/article/ArticleDetail';
|
|
67
|
+
export { PageDetail } from './components/content/page/PageDetail';
|
|
68
|
+
export { RichText, type RichTextProps } from './components/content/RichText';
|
|
69
|
+
export { FAQ, type FAQProps, type FAQItem } from './components/content/FAQ';
|
|
70
|
+
export { FeatureGrid, type FeatureGridProps, type Feature } from './components/content/FeatureGrid';
|
|
71
|
+
export { Header, type HeaderProps, type NavLink } from './components/navigation/Header';
|
|
72
|
+
export { Footer, type FooterProps, type FooterColumn } from './components/navigation/Footer';
|
|
73
|
+
export { Breadcrumbs, type BreadcrumbsProps, type BreadcrumbItem } from './components/navigation/Breadcrumbs';
|
|
74
|
+
export * from './components/chat';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type Labels } from './labels';
|
|
3
|
+
export type LabelOverrides = DeepPartial<Labels>;
|
|
4
|
+
type DeepPartial<T> = {
|
|
5
|
+
[K in keyof T]?: T[K] extends Record<string, unknown> | object ? DeepPartial<T[K]> : T[K];
|
|
6
|
+
};
|
|
7
|
+
export interface LabelsProviderProps {
|
|
8
|
+
/** Partial overrides — deep-merged onto DEFAULT_LABELS. */
|
|
9
|
+
overrides?: LabelOverrides;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare function LabelsProvider({ overrides, children }: LabelsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* Read the active labels map. Falls back to `DEFAULT_LABELS` outside a
|
|
15
|
+
* provider so storybook / catalog previews work without wrapping.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useLabels(): Labels;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI text constants — every visible string in the catalog components
|
|
3
|
+
* lives here so brand overrides + i18n have a single seam. Components
|
|
4
|
+
* read via `useLabels()` (see `LabelsContext`); the default export is
|
|
5
|
+
* the fallback merged with whatever the brand provides.
|
|
6
|
+
*
|
|
7
|
+
* RULES:
|
|
8
|
+
* - No string literals inside catalog components for visitor-facing
|
|
9
|
+
* text. Always go through this map.
|
|
10
|
+
* - Keys are intent-named ("addToBag", not "btn1"). Easy to grep.
|
|
11
|
+
* - Sub-objects group by feature (`product.*`, `cart.*`) so brand
|
|
12
|
+
* overrides can scope cleanly.
|
|
13
|
+
*/
|
|
14
|
+
export interface Labels {
|
|
15
|
+
product: {
|
|
16
|
+
addToBag: string;
|
|
17
|
+
added: string;
|
|
18
|
+
save: string;
|
|
19
|
+
saved: string;
|
|
20
|
+
inStock: string;
|
|
21
|
+
outOfStock: string;
|
|
22
|
+
/** Heading shown above the auto-surfaced reviews block on PDP. */
|
|
23
|
+
reviewsTitle: string;
|
|
24
|
+
/**
|
|
25
|
+
* Shown when the reviews surface has SETTLED with nothing to show. Not a
|
|
26
|
+
* skeleton and not blank: rendering nothing leaves whatever heading sits
|
|
27
|
+
* above it promising reviews over a void, which reads as a load failure.
|
|
28
|
+
*/
|
|
29
|
+
reviewsEmpty: string;
|
|
30
|
+
/** Spec-row dt labels — keep camelCase keys mapping to display text. */
|
|
31
|
+
specs: {
|
|
32
|
+
vendor: string;
|
|
33
|
+
type: string;
|
|
34
|
+
available: string;
|
|
35
|
+
rating: string;
|
|
36
|
+
tags: string;
|
|
37
|
+
variant: string;
|
|
38
|
+
};
|
|
39
|
+
/** Aria + sr-only copy. */
|
|
40
|
+
a11y: {
|
|
41
|
+
ratingLabel: (value: number, count: number) => string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
rating: {
|
|
45
|
+
/** Suffix after the numeric average — "4.8 · 230 reviews". */
|
|
46
|
+
reviewsCount: (count: number) => string;
|
|
47
|
+
};
|
|
48
|
+
variantPicker: {
|
|
49
|
+
/** Heading shown when add-to-cart needs a choice before it can proceed. */
|
|
50
|
+
title: string;
|
|
51
|
+
/** Dismiss without adding. */
|
|
52
|
+
dismiss: string;
|
|
53
|
+
};
|
|
54
|
+
canvas: {
|
|
55
|
+
/** Share the current canvas as a read-only link. */
|
|
56
|
+
share: string;
|
|
57
|
+
/** Confirmation after the link lands on the clipboard. */
|
|
58
|
+
shareCopied: string;
|
|
59
|
+
/** Shown when this canvas can't be shared (no session yet, sharing not
|
|
60
|
+
* configured). Says so plainly rather than offering a dead link. */
|
|
61
|
+
shareUnavailable: string;
|
|
62
|
+
shareA11y: string;
|
|
63
|
+
/** Popover heading. */
|
|
64
|
+
shareTitle: string;
|
|
65
|
+
/** What the recipient gets, and what stays yours — the sentence that makes
|
|
66
|
+
* the link safe to send without thinking about it. It must track the
|
|
67
|
+
* BEHAVIOUR: this copy once said "they do not get your conversation" after
|
|
68
|
+
* the fork began sending exactly that, which is worse than no copy at all
|
|
69
|
+
* — a reassurance that is false is the one thing a share surface cannot
|
|
70
|
+
* ship. */
|
|
71
|
+
shareExplain: string;
|
|
72
|
+
/** Copy CTA inside the popover. */
|
|
73
|
+
shareCopy: string;
|
|
74
|
+
/** How long the link stays alive. */
|
|
75
|
+
shareExpiry: (days: number) => string;
|
|
76
|
+
shareClose: string;
|
|
77
|
+
/** Opens the OS share sheet (mobile, Safari) — messages, WhatsApp, AirDrop,
|
|
78
|
+
* whatever the device offers. Absent elsewhere; Copy is the fallback. */
|
|
79
|
+
shareNative: string;
|
|
80
|
+
/** Subject/title handed to the OS sheet and to the receiving app. */
|
|
81
|
+
shareSubject: string;
|
|
82
|
+
};
|
|
83
|
+
chat: {
|
|
84
|
+
/** Composer textarea placeholder shown on first turn. */
|
|
85
|
+
placeholder: string;
|
|
86
|
+
/** Composer placeholder shown on follow-up turns (after first message). */
|
|
87
|
+
placeholderFollowUp: string;
|
|
88
|
+
};
|
|
89
|
+
voice: {
|
|
90
|
+
/** Aria-label for the mobile island's voice-mode trigger. */
|
|
91
|
+
speak: string;
|
|
92
|
+
};
|
|
93
|
+
presence: {
|
|
94
|
+
/** Aria-label for the badge counting facts the visitor hasn't revealed yet. */
|
|
95
|
+
newFacts: (count: number) => string;
|
|
96
|
+
/**
|
|
97
|
+
* THE BRIEF — everything the agent knows about this visitor.
|
|
98
|
+
*
|
|
99
|
+
* Every word here is read by a shopper, so none of it may be named after
|
|
100
|
+
* the thing that produced it. The two registers below are stamped
|
|
101
|
+
* server-side as `provenance: 'recalled' | 'inferred'` and rendered from
|
|
102
|
+
* `tier: 'profile' | 'session'`, and the copy said so out loud
|
|
103
|
+
* ("REMEMBERED — carried across visits", "WORKING OUT — derived this
|
|
104
|
+
* session"): schema vocabulary in a storefront header. What a register
|
|
105
|
+
* actually has to answer is WHEN — the one thing the brief knows that the
|
|
106
|
+
* band does not — so it answers it the way a person would.
|
|
107
|
+
*/
|
|
108
|
+
brief: {
|
|
109
|
+
/** Accessible name for the handle that reveals the brief. */
|
|
110
|
+
open: string;
|
|
111
|
+
/** …and the one that puts it away. */
|
|
112
|
+
close: string;
|
|
113
|
+
/**
|
|
114
|
+
* THE BRIEF'S FIRST LINE — who the agent is talking to.
|
|
115
|
+
*
|
|
116
|
+
* The registers below answer WHEN something was learned; this answers WHO,
|
|
117
|
+
* and it is the only line on the surface addressed TO the visitor rather
|
|
118
|
+
* than about them. Two states, never a third: a name we were given, or an
|
|
119
|
+
* invitation to give one. There is no "Hey there" — a greeting that
|
|
120
|
+
* addresses nobody is the surface pretending to a relationship it does not
|
|
121
|
+
* have, which is the one thing this panel exists not to do.
|
|
122
|
+
*/
|
|
123
|
+
identity: {
|
|
124
|
+
/** The greeting, when the visitor has told us what to call them. */
|
|
125
|
+
greeting: (name: string) => string;
|
|
126
|
+
/** The invitation, when they have not. Shown as the handle's label. */
|
|
127
|
+
invite: string;
|
|
128
|
+
/** Placeholder in the name field the invitation opens. There is no
|
|
129
|
+
* commit control — Enter takes the name, Escape abandons it, looking
|
|
130
|
+
* away takes what is there. */
|
|
131
|
+
placeholder: string;
|
|
132
|
+
/** Accessible name for the control that changes a name already given. */
|
|
133
|
+
change: (name: string) => string;
|
|
134
|
+
};
|
|
135
|
+
/** Accessible name for the band's `+N` tail — a door, not a caption. */
|
|
136
|
+
more: (count: number) => string;
|
|
137
|
+
/** Accessible name for one entry's dismiss control. */
|
|
138
|
+
forget: (label: string) => string;
|
|
139
|
+
/**
|
|
140
|
+
* Memory carried in from a prior visit — the trust reservoir, and the only
|
|
141
|
+
* claim on this surface that cannot be re-earned in a session.
|
|
142
|
+
*
|
|
143
|
+
* A HEADING AND NOTHING ELSE. Each register used to carry an explanatory
|
|
144
|
+
* note beside it ("you told me on an earlier visit", "picked up while
|
|
145
|
+
* we've been talking") — a sentence of scaffolding over two words of
|
|
146
|
+
* content, on a panel whose whole argument is that it says only what it
|
|
147
|
+
* knows. "From before" already says when.
|
|
148
|
+
*/
|
|
149
|
+
recalled: {
|
|
150
|
+
/** The register's heading. */
|
|
151
|
+
title: string;
|
|
152
|
+
/** Tooltip on a durable chip wherever it appears alone (the band). */
|
|
153
|
+
badge: string;
|
|
154
|
+
};
|
|
155
|
+
/** Worked out during this visit — the correctable guess. */
|
|
156
|
+
inferred: {
|
|
157
|
+
title: string;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* The status line under the morphing layout preview, one phrase per shape
|
|
162
|
+
* the preview cycles through (`LAYOUT_ARCHETYPES`, in that order).
|
|
163
|
+
*
|
|
164
|
+
* It is the fallback shown when the agent has no live read streaming, so it
|
|
165
|
+
* may only describe what is VISIBLY happening — never invented reasoning.
|
|
166
|
+
* It used to read "Arranging the columns", "Assembling the grid", "Placing
|
|
167
|
+
* the header", "Docking the sidebar": the layout engine's own parts list,
|
|
168
|
+
* narrated to a shopper who has never thought about a sidebar in their life.
|
|
169
|
+
* Same shapes, said the way a person would.
|
|
170
|
+
*/
|
|
171
|
+
composing: readonly string[];
|
|
172
|
+
};
|
|
173
|
+
menu: {
|
|
174
|
+
/** Leading row inside a department's expanded accordion (touch menu) that
|
|
175
|
+
* dispatches the department's own top-level action — the tap-target that
|
|
176
|
+
* preserves the "shop the whole department" intent a desktop visitor gets
|
|
177
|
+
* by clicking the department header. `label` is the department name. */
|
|
178
|
+
shopAll: (label: string) => string;
|
|
179
|
+
};
|
|
180
|
+
cart: {
|
|
181
|
+
/** Header title above the drawer body — defaults to "bag" per the
|
|
182
|
+
* base design language; brands that use "cart" terminology
|
|
183
|
+
* (e.g. Steve Madden) override here. */
|
|
184
|
+
title: string;
|
|
185
|
+
/** Empty-state primary line. */
|
|
186
|
+
empty: string;
|
|
187
|
+
/** Empty-state secondary hint. */
|
|
188
|
+
emptyHint: string;
|
|
189
|
+
/** Aria-label for the line-removal button. */
|
|
190
|
+
removeLine: string;
|
|
191
|
+
/** Secondary cart CTA — exits to the merchant's official store with
|
|
192
|
+
* the cart contents (rendered only when the cart carries a
|
|
193
|
+
* `storeCartUrl`). Brands override with their store name, e.g.
|
|
194
|
+
* "continue on stevemadden.com". */
|
|
195
|
+
viewOnStore: string;
|
|
196
|
+
/** Free-shipping threshold in the store's currency. Brands that
|
|
197
|
+
* offer free shipping above an amount set this; `null` (default)
|
|
198
|
+
* means the threshold is unknown and shipping defers to checkout. */
|
|
199
|
+
freeShippingThreshold: number | null;
|
|
200
|
+
/** Shipping row value when subtotal qualifies for free shipping. */
|
|
201
|
+
shippingFree: string;
|
|
202
|
+
/** Note shown when shipping (and therefore the final total) can
|
|
203
|
+
* only be determined at checkout. */
|
|
204
|
+
shippingDeferred: string;
|
|
205
|
+
/** Promo-code input placeholder + collapsed-toggle label. */
|
|
206
|
+
promoPlaceholder: string;
|
|
207
|
+
/** Promo-code apply button. */
|
|
208
|
+
promoApply: string;
|
|
209
|
+
/** Shown next to an applied code that doesn't qualify (expired,
|
|
210
|
+
* minimum not met). */
|
|
211
|
+
promoNotApplicable: string;
|
|
212
|
+
/** Inline error when the backend rejects a code outright
|
|
213
|
+
* (not found / malformed) — distinct from accepted-but-not-applicable. */
|
|
214
|
+
promoInvalid: string;
|
|
215
|
+
/** Discount row label (shown when an applied code lowers the total). */
|
|
216
|
+
discount: string;
|
|
217
|
+
/** Line-count noun beside the drawer title ("3 items"). Two forms rather
|
|
218
|
+
* than a formatter: `Labels` is a plain data contract, so a brand
|
|
219
|
+
* overrides the words without shipping code. */
|
|
220
|
+
itemSingular: string;
|
|
221
|
+
itemPlural: string;
|
|
222
|
+
/** Money-row labels in the drawer foot. Overridable like every other
|
|
223
|
+
* label — `labels.discount` already was, and leaving its neighbours as
|
|
224
|
+
* literals meant a brand could rename one row but not the rest. */
|
|
225
|
+
subtotal: string;
|
|
226
|
+
shipping: string;
|
|
227
|
+
total: string;
|
|
228
|
+
/** Stands in for a pending line's name while the add is in flight and the
|
|
229
|
+
* product is not yet known. A row that shows nothing reads as broken. */
|
|
230
|
+
linePending: string;
|
|
231
|
+
/** Stands in for a pending line's price. The amount is genuinely unknown
|
|
232
|
+
* until the backend accepts the line — printing "$0" asserts a price the
|
|
233
|
+
* store never quoted. */
|
|
234
|
+
linePendingPrice: string;
|
|
235
|
+
/** Footer note while any line is still pending: the totals shown are the
|
|
236
|
+
* last settled ones and do not yet include that line. */
|
|
237
|
+
totalsPending: string;
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
export declare const DEFAULT_LABELS: Labels;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Editorial easing curve — the slow-out settle (cubic-bezier(0.22,1,0.36,1))
|
|
3
|
+
* used across @fourty/ui presets, agentic primitives, and brand packages.
|
|
4
|
+
* Single source of truth; re-exported from `@fourty/ui/motion`.
|
|
5
|
+
*
|
|
6
|
+
* A JS easing function cannot cross into a CSS `transition` string, so brand
|
|
7
|
+
* packages that need the curve in inline CSS mirror it as an `--ease-editorial`
|
|
8
|
+
* custom property in their own tokens — one copy per medium, no more.
|
|
9
|
+
*/
|
|
10
|
+
export declare const editorialEase: (t: number) => number;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ActiveBlockTreatment } from '@40rty/ams-sdk';
|
|
3
|
+
export interface ActiveBlockIndicatorProps {
|
|
4
|
+
treatment: ActiveBlockTreatment;
|
|
5
|
+
/** True while this block is the one the agent is composing. */
|
|
6
|
+
active: boolean;
|
|
7
|
+
/** One indicator loop in seconds. */
|
|
8
|
+
loopS: number;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Marks the block the agent is currently composing.
|
|
15
|
+
*
|
|
16
|
+
* Variants (all monochrome-luxury safe — the color is the brand accent token,
|
|
17
|
+
* never a hardcoded gradient):
|
|
18
|
+
* - `beam` — a bright light segment travels the border (Magic UI / Linear
|
|
19
|
+
* lineage)
|
|
20
|
+
* - `glow` — a soft breathing border halo (Cursor lineage, more restrained)
|
|
21
|
+
* - `trail` — a long faint segment circling slowly (most subtle)
|
|
22
|
+
* - `none` — no indicator
|
|
23
|
+
*
|
|
24
|
+
* The indicator unmounts (fades 200ms) the moment `active` flips false — the
|
|
25
|
+
* "agent moved on" signal. Honors prefers-reduced-motion (renders nothing).
|
|
26
|
+
*/
|
|
27
|
+
export declare function ActiveBlockIndicator({ treatment, active, loopS, children, style, className, }: ActiveBlockIndicatorProps): React.ReactElement;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ImageTreatment } from '@40rty/ams-sdk';
|
|
3
|
+
export interface BlurUpImageProps {
|
|
4
|
+
src: string;
|
|
5
|
+
alt: string;
|
|
6
|
+
treatment: ImageTreatment;
|
|
7
|
+
/** Blur→sharp resolve duration in seconds. */
|
|
8
|
+
resolveS: number;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Product-image resolution.
|
|
14
|
+
*
|
|
15
|
+
* - `pop` — the browser default: image appears when loaded (baseline)
|
|
16
|
+
* - `blur-up` — the image renders blurred + slightly scaled the moment its
|
|
17
|
+
* first bytes paint, then resolves to sharp on load. The
|
|
18
|
+
* BlurHash / progressive-JPEG semantic: "resolving from
|
|
19
|
+
* uncertainty" — entity hydration made visceral.
|
|
20
|
+
*
|
|
21
|
+
* Pure compositor work (filter + transform on a single img).
|
|
22
|
+
*/
|
|
23
|
+
export declare function BlurUpImage({ src, alt, treatment, resolveS, style, className, }: BlurUpImageProps): React.ReactElement;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type EntranceTreatment, type GenerationTimings } from '@40rty/ams-sdk';
|
|
3
|
+
export interface ResolveEntranceProps {
|
|
4
|
+
treatment: EntranceTreatment;
|
|
5
|
+
timings: GenerationTimings;
|
|
6
|
+
/** Stagger slot (e.g. grid row index). Delay = index × rowStaggerS. */
|
|
7
|
+
staggerIndex?: number;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Plays the selected entrance once, on mount. The parent mounts this wrapper
|
|
14
|
+
* at the moment the element's content ARRIVES (never around skeletons), so
|
|
15
|
+
* every treatment — including the editorial mask reveal — only ever animates
|
|
16
|
+
* over real content.
|
|
17
|
+
*
|
|
18
|
+
* The motion itself comes from `buildEntranceProps` in @fourty/react — the
|
|
19
|
+
* exact spec the production SectionStage plays, so the playground previews
|
|
20
|
+
* what ships.
|
|
21
|
+
*/
|
|
22
|
+
export declare function ResolveEntrance({ treatment, timings, staggerIndex, children, style, className, }: ResolveEntranceProps): React.ReactElement;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type SkeletonTreatment } from '@40rty/ams-sdk';
|
|
3
|
+
export interface ShimmerSkeletonProps {
|
|
4
|
+
treatment: SkeletonTreatment;
|
|
5
|
+
/** One full sweep duration in seconds. */
|
|
6
|
+
durationS: number;
|
|
7
|
+
/** Shape comes from the caller (aspect-ratio / height / radius). */
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Skeleton block for not-yet-arrived content.
|
|
13
|
+
*
|
|
14
|
+
* `gray` — the baseline: a flat surface-alt box.
|
|
15
|
+
* `shimmer` — a soft highlight sweeps across the box on a loop: the "this is
|
|
16
|
+
* being composed right now" signal. The sweep itself is the shared
|
|
17
|
+
* `ShimmerSweep` from @fourty/react — the same one the production streaming
|
|
18
|
+
* placeholder uses, so the playground previews exactly what ships.
|
|
19
|
+
*/
|
|
20
|
+
export declare function ShimmerSkeleton({ treatment, durationS, style, className, }: ShimmerSkeletonProps): React.ReactElement;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type GenerationTimings, type TextTreatment } from '@40rty/ams-sdk';
|
|
3
|
+
export interface WordRevealProps {
|
|
4
|
+
text: string;
|
|
5
|
+
treatment: TextTreatment;
|
|
6
|
+
timings: GenerationTimings;
|
|
7
|
+
as?: 'h1' | 'h2' | 'h3' | 'p' | 'span';
|
|
8
|
+
/** Extra delay before the first word (seconds). */
|
|
9
|
+
delayS?: number;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Streamed-text resolution for canvas headlines / captions.
|
|
15
|
+
*
|
|
16
|
+
* - `instant` — plain text (baseline)
|
|
17
|
+
* - `word-blur` — each word resolves from blur, tight stagger (the
|
|
18
|
+
* Streamdown `blurIn` convention — the 2026 streaming-text
|
|
19
|
+
* standard)
|
|
20
|
+
* - `line-mask` — each word rises from behind its own baseline mask
|
|
21
|
+
* (editorial / fashion-typography reveal)
|
|
22
|
+
*
|
|
23
|
+
* Words are wrapped in inline-block spans; the full string stays in the
|
|
24
|
+
* accessibility tree (animation spans are aria-hidden).
|
|
25
|
+
*/
|
|
26
|
+
export declare function WordReveal({ text, treatment, timings, as, delayS, style, className, }: WordRevealProps): React.ReactElement;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { DEFAULT_GENERATION_STYLE, DEFAULT_GENERATION_TIMINGS, GENERATION_EASE, buildEntranceProps, useGenerationStyle, type ActiveBlockTreatment, type EntranceMotionProps, type EntranceTreatment, type GenerationStyle, type GenerationTimings, type ImageTreatment, type SkeletonTreatment, type TextTreatment } from '@40rty/ams-sdk';
|
|
2
|
+
export { ShimmerSkeleton, type ShimmerSkeletonProps } from './ShimmerSkeleton';
|
|
3
|
+
export { ActiveBlockIndicator, type ActiveBlockIndicatorProps } from './ActiveBlockIndicator';
|
|
4
|
+
export { ResolveEntrance, type ResolveEntranceProps } from './ResolveEntrance';
|
|
5
|
+
export { WordReveal, type WordRevealProps } from './WordReveal';
|
|
6
|
+
export { BlurUpImage, type BlurUpImageProps } from './BlurUpImage';
|