@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,16 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface RevealStaggerProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
/** Stagger delay between siblings, in seconds. Default 0.06. */
|
|
5
|
+
gap?: number;
|
|
6
|
+
/** IntersectionObserver threshold. Default 0.2. */
|
|
7
|
+
amount?: number;
|
|
8
|
+
/** Defer until this is false. Wire to streaming state if needed. */
|
|
9
|
+
defer?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Stagger-reveal wrapper. Wraps each direct child in a motion item so they
|
|
14
|
+
* rise into view sequentially when the parent enters the viewport.
|
|
15
|
+
*/
|
|
16
|
+
export declare function RevealStagger({ children, gap, amount, defer, className, }: RevealStaggerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ReactNode, type RefObject } from 'react';
|
|
2
|
+
export interface StickyShelfProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
/** CSS top offset for the sticky position. Default 0. */
|
|
5
|
+
top?: number | string;
|
|
6
|
+
/**
|
|
7
|
+
* Optional anchor — when this ref's bottom edge scrolls past the shelf's
|
|
8
|
+
* bottom edge, the shelf releases (returns to normal flow visually).
|
|
9
|
+
*/
|
|
10
|
+
releaseAt?: RefObject<HTMLElement | null>;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Sticky shelf with optional release point. Without `releaseAt`, behaves as
|
|
15
|
+
* a plain `position: sticky`. With it, the shelf goes invisible once the
|
|
16
|
+
* anchor scrolls past, freeing the space below.
|
|
17
|
+
*/
|
|
18
|
+
export declare function StickyShelf({ children, top, releaseAt, className }: StickyShelfProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const variants: {
|
|
3
|
+
readonly default: "bg-[var(--fourty-color-bg-subtle)] text-[var(--fourty-color-text)]";
|
|
4
|
+
readonly sale: "bg-[var(--fourty-color-sale)] text-white";
|
|
5
|
+
readonly success: "bg-emerald-100 text-emerald-800";
|
|
6
|
+
readonly outline: "border border-[var(--fourty-color-border)] text-[var(--fourty-color-text)]";
|
|
7
|
+
};
|
|
8
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
9
|
+
variant?: keyof typeof variants;
|
|
10
|
+
}
|
|
11
|
+
export declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const variants: {
|
|
3
|
+
readonly primary: "bg-[var(--fourty-btn-bg)] text-[var(--fourty-btn-color)]";
|
|
4
|
+
readonly accent: "bg-[var(--fourty-color-accent)] text-white";
|
|
5
|
+
readonly inverse: "bg-[var(--fourty-color-on-dark)] text-[var(--fourty-color-primary)] [--fourty-btn-hover-fill:rgba(0,0,0,0.15)]";
|
|
6
|
+
readonly secondary: "bg-transparent border border-[var(--fourty-color-border)] text-[var(--fourty-color-text)]";
|
|
7
|
+
readonly ghost: "bg-transparent text-[var(--fourty-color-text)]";
|
|
8
|
+
readonly shoppay: "bg-[var(--fourty-color-shoppay)] text-white";
|
|
9
|
+
};
|
|
10
|
+
declare const sizes: {
|
|
11
|
+
readonly sm: "h-8 px-3 text-sm";
|
|
12
|
+
readonly md: "h-10 px-4 text-sm";
|
|
13
|
+
readonly lg: "h-12 px-6 text-base";
|
|
14
|
+
};
|
|
15
|
+
export type ButtonHoverEffect = 'none' | 'darken' | 'wipeUp';
|
|
16
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
17
|
+
variant?: keyof typeof variants;
|
|
18
|
+
size?: keyof typeof sizes;
|
|
19
|
+
/** Per-instance override of the brand's hover contract. Omit to inherit
|
|
20
|
+
* whatever the active theme's tokens.css sets for --fourty-btn-hover-*. */
|
|
21
|
+
hoverEffect?: ButtonHoverEffect;
|
|
22
|
+
asChild?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Money as MoneyType } from '../../types/commerce';
|
|
3
|
+
export interface MoneyProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
/** Money object with amount and currencyCode */
|
|
5
|
+
money?: MoneyType;
|
|
6
|
+
/** Direct amount (use with currency prop) */
|
|
7
|
+
amount?: number;
|
|
8
|
+
/** Currency code (ISO 4217), default 'USD' */
|
|
9
|
+
currency?: string;
|
|
10
|
+
/** Locale for formatting */
|
|
11
|
+
locale?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const Money: React.ForwardRefExoticComponent<MoneyProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* AnimatedPlaceholder — renders the agent-streamed placeholder text
|
|
4
|
+
* with a clean crossfade between rotation entries. Keeps the visual
|
|
5
|
+
* affordance of a placeholder (italic, muted, ellipsis-clipped) and
|
|
6
|
+
* swaps the underlying string with a brief fade + tiny vertical drift
|
|
7
|
+
* so the rotation reads as agent-driven rather than mechanical.
|
|
8
|
+
*
|
|
9
|
+
* Honors `prefers-reduced-motion` — sets the new string instantly.
|
|
10
|
+
*/
|
|
11
|
+
export declare function AnimatedPlaceholder({ text }: {
|
|
12
|
+
text: string;
|
|
13
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/** The sheet rests at one of two detents (the minimized desktop model: a
|
|
3
|
+
* collapsed presence bar that opens to the full composer panel):
|
|
4
|
+
* - `peek` — the collapsed presence bar (the agent read + an open affordance).
|
|
5
|
+
* - `full` — the whole chat thread + composer (the desktop dock, vertical). */
|
|
6
|
+
export type SheetDetent = 'peek' | 'full';
|
|
7
|
+
/** Drag API handed to the peek / body render-props so they can move the sheet
|
|
8
|
+
* between detents (tap the peek to open; navigation collapses it). */
|
|
9
|
+
export interface BottomSheetApi {
|
|
10
|
+
/** Open the sheet to `full` — the thread + composer. */
|
|
11
|
+
expand: () => void;
|
|
12
|
+
/** Back to the collapsed peek. */
|
|
13
|
+
collapse: () => void;
|
|
14
|
+
/** Current resting detent — the peek render-prop keys its content off it. */
|
|
15
|
+
detent: SheetDetent;
|
|
16
|
+
}
|
|
17
|
+
export interface BottomSheetProps {
|
|
18
|
+
/** Accessible label for the dialog — required. */
|
|
19
|
+
label: string;
|
|
20
|
+
/** The always-visible collapsed surface (the "island"). A render-prop so it
|
|
21
|
+
* can drive the sheet (expand on tap). It is given a fixed-height window
|
|
22
|
+
* (`peekHeight`) and clips/fills within it. */
|
|
23
|
+
peek: (api: BottomSheetApi) => React.ReactNode;
|
|
24
|
+
/** Collapsed peek height in px (the island envelope: handle + chips + read).
|
|
25
|
+
* FIXED — the collapsed pill shows exactly this, independent of the island's
|
|
26
|
+
* content, so a streaming read/chip height change can never move the resting
|
|
27
|
+
* sheet. The island clips/fills within it. Default 120. */
|
|
28
|
+
peekHeight?: number;
|
|
29
|
+
/** Fully-open height as a fraction of the dynamic viewport (0–1). Default 0.92. */
|
|
30
|
+
heightFraction?: number;
|
|
31
|
+
/** Notified when the resting detent changes. */
|
|
32
|
+
onDetentChange?: (detent: SheetDetent) => void;
|
|
33
|
+
/** Bump this to force the sheet back to its peek (a new turn started). The
|
|
34
|
+
* initial value is a no-op; each change collapses. */
|
|
35
|
+
collapseSignal?: number;
|
|
36
|
+
/** Brand override hook merged onto the content surface. */
|
|
37
|
+
className?: string;
|
|
38
|
+
/** Body revealed as the sheet rises — the thread + composer. Mounted lazily
|
|
39
|
+
* on first expand. A render-prop receives the same drag API as `peek`. */
|
|
40
|
+
children: React.ReactNode | ((api: BottomSheetApi) => React.ReactNode);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* `BottomSheet` — the mobile spacefront's primary surface: a persistent,
|
|
44
|
+
* draggable sheet always present at its collapsed peek (the "island"), dragging
|
|
45
|
+
* continuously up to the full chat (the Apple-Maps model).
|
|
46
|
+
*
|
|
47
|
+
* Composited-first by construction: the ONLY animated properties are the sheet's
|
|
48
|
+
* `transform` (translateY) and the scrim's `opacity` — both free on the
|
|
49
|
+
* compositor, so the drag never triggers layout/paint. All chrome (radius,
|
|
50
|
+
* shadow, colour, border) is STATIC CSS on the class hooks. Snap targets derive
|
|
51
|
+
* from the measured HEADER height (the small fixed-height island), never from
|
|
52
|
+
* the chat body — so a streaming turn can't perturb the resting pill.
|
|
53
|
+
*/
|
|
54
|
+
export declare function BottomSheet({ label, peek, peekHeight, heightFraction, onDetentChange, collapseSignal, className, children, }: BottomSheetProps): React.ReactElement;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { LucideIcon } from 'lucide-react';
|
|
3
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'agent' | 'suggestion' | 'icon-only' | 'destructive';
|
|
4
|
+
export type ButtonSize = 'sm' | 'md' | 'lg';
|
|
5
|
+
export interface ButtonProps {
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
size?: ButtonSize;
|
|
8
|
+
label?: string;
|
|
9
|
+
Icon?: LucideIcon;
|
|
10
|
+
iconPosition?: 'left' | 'right';
|
|
11
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
loading?: boolean;
|
|
14
|
+
fullWidth?: boolean;
|
|
15
|
+
ariaLabel?: string;
|
|
16
|
+
type?: 'button' | 'submit' | 'reset';
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export declare function Button({ variant, size, label, Icon, iconPosition, onClick, disabled, loading, fullWidth, ariaLabel, type, children, }: ButtonProps): React.ReactElement;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface ChromeSurfaceProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the surface paints at all. The mobile bar is always painted (it
|
|
5
|
+
* owns real flow space); the desktop header overlay paints only once the
|
|
6
|
+
* canvas has scrolled under it, and fades in on the way.
|
|
7
|
+
*/
|
|
8
|
+
visible: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the surface carries its lift. A shadow with nothing under it is
|
|
11
|
+
* grime on the page, so chrome earns the lift exactly while canvas content
|
|
12
|
+
* is passing beneath it.
|
|
13
|
+
*/
|
|
14
|
+
lifted: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* ChromeSurface — the paint layer behind a shell's chrome bar: brand surface,
|
|
18
|
+
* blur, bottom hairline, and the scrolled lift. One definition of what
|
|
19
|
+
* platform chrome LOOKS like, shared by the mobile top bar (`MobileChrome`)
|
|
20
|
+
* and the desktop header overlay (`ShellMenuChrome`), so the two can't drift.
|
|
21
|
+
*
|
|
22
|
+
* It's a separate absolutely-positioned child rather than a background on the
|
|
23
|
+
* bar itself for two reasons: Safari's Liquid Glass toolbar scans
|
|
24
|
+
* `position: fixed`/`sticky` elements near the viewport edges and reads THEIR
|
|
25
|
+
* OWN `background-color` to tint its own chrome (keeping the sticky node
|
|
26
|
+
* transparent to that scan avoids it), and a separate layer can cross-fade its
|
|
27
|
+
* whole appearance without touching the bar's live content.
|
|
28
|
+
*
|
|
29
|
+
* Every value is a brand token: `--fourty-color-surface`,
|
|
30
|
+
* `--fourty-color-border`, and `--fourty-topbar-shadow` for the lift (set it
|
|
31
|
+
* to `none` to opt a brand out of lifting entirely).
|
|
32
|
+
*/
|
|
33
|
+
export declare function ChromeSurface({ visible, lifted }: ChromeSurfaceProps): React.ReactElement;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SuggestionAction } from '@40rty/ams-sdk';
|
|
3
|
+
import { type ComposerAttachmentsApi } from './composer/useComposerAttachments';
|
|
4
|
+
/** Render-prop signature for the thread-message list. Composer owns the
|
|
5
|
+
* scroller element; the brand supplies the row layout / empty state by
|
|
6
|
+
* rendering inside the scroller using the provided ref. */
|
|
7
|
+
export type ThreadHistoryRenderer = (scrollerRef: React.RefObject<HTMLElement | null>) => React.ReactNode;
|
|
8
|
+
export interface ComposerProps {
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
starterSuggestions?: string[];
|
|
11
|
+
/** Brand-supplied thread row renderer. Composer owns the scroller +
|
|
12
|
+
* scroll-padding; brand decides row visuals + empty intro. */
|
|
13
|
+
threadHistory: ThreadHistoryRenderer;
|
|
14
|
+
/** Invoked when the visitor taps an agent follow-up chip. Composer is
|
|
15
|
+
* dumb shell chrome — it reports the tapped chip; the harness (the
|
|
16
|
+
* brand shell) owns the dispatch. */
|
|
17
|
+
onChipSelect: (action: SuggestionAction) => void;
|
|
18
|
+
/** Type-to-focus: when the visitor starts typing a printable key and no
|
|
19
|
+
* other input is focused, grab the keystroke into the composer (focus +
|
|
20
|
+
* insert the char) — like Linear / Gmail. Default ON for the standalone
|
|
21
|
+
* spacefront. Embedded widgets should pass `false`: on a merchant's own
|
|
22
|
+
* page, hijacking every keystroke into our widget is hostile. */
|
|
23
|
+
typeToFocus?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Offer the read-only SHARE link beside the session utilities.
|
|
26
|
+
*
|
|
27
|
+
* OFF by default. Sharing mints a token that hands a stranger a frozen copy
|
|
28
|
+
* of this visitor's canvas and thread, so it is a decision a space makes
|
|
29
|
+
* deliberately rather than a control every composer grows on its own. The
|
|
30
|
+
* button and its whole flow are unchanged — this only decides whether the
|
|
31
|
+
* composer mounts it.
|
|
32
|
+
*/
|
|
33
|
+
shareCanvas?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* External attachments controller. Provide it to run the composer in
|
|
36
|
+
* "controlled" mode — the mobile shell lifts `useComposerAttachments()` so a
|
|
37
|
+
* rest-island camera trigger and this composer share ONE state (a file
|
|
38
|
+
* attached from the island shows up here, ready to caption + send). Omit on
|
|
39
|
+
* desktop; the composer owns its own controller.
|
|
40
|
+
*/
|
|
41
|
+
attachments?: ComposerAttachmentsApi;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Composer — the conversation side panel: thread history scroller, agent
|
|
45
|
+
* follow-up chips, and the message input.
|
|
46
|
+
*
|
|
47
|
+
* Positioning contract: the panel **fills its positioned parent**
|
|
48
|
+
* (`position: absolute; inset: 0`). The brand shell owns where the panel
|
|
49
|
+
* sits — by mounting it inside `<SideDock>`, which also owns the reveal
|
|
50
|
+
* choreography (slide, keep-mounted, inert). The Composer itself never
|
|
51
|
+
* positions against the viewport: `position: fixed` inside a transformed
|
|
52
|
+
* ancestor (the dock's slide) resolves against that ancestor while the
|
|
53
|
+
* transform is live, then snaps to the viewport when the transform
|
|
54
|
+
* clears — a guaranteed end-of-animation jump.
|
|
55
|
+
*/
|
|
56
|
+
export declare function Composer({ placeholder, starterSuggestions, threadHistory, onChipSelect, typeToFocus, shareCanvas, attachments: attachmentsController, }: ComposerProps): React.ReactElement;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SuggestionAction } from '@40rty/ams-sdk';
|
|
3
|
+
export declare function ComposerChipStrip({ value, starterSuggestions, onStarterClick, onChipSelect, orientation, }: {
|
|
4
|
+
value: string;
|
|
5
|
+
starterSuggestions?: string[];
|
|
6
|
+
onStarterClick: (text: string) => void;
|
|
7
|
+
onChipSelect: (action: SuggestionAction) => void;
|
|
8
|
+
orientation?: 'list' | 'row';
|
|
9
|
+
}): React.ReactElement | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* `ConversationTransition` — lays a freshly switched / started conversation
|
|
4
|
+
* INTO view. Wrap the agent canvas AND the thread in one each; both key on
|
|
5
|
+
* `sessionId`, so when the conversation changes they re-mount and rise in
|
|
6
|
+
* together.
|
|
7
|
+
*
|
|
8
|
+
* No fade-out, no blank gap: the SDK holds the prior `sessionId` (and the prior
|
|
9
|
+
* canvas view) through the switch's network round-trip — see
|
|
10
|
+
* `teardownSessionLocal({ hold })` — so the OLD view stays fully on screen
|
|
11
|
+
* until the new conversation is ready. Only then does `sessionId` change, this
|
|
12
|
+
* re-keys, and the new content eases up from a slight offset. The visitor never
|
|
13
|
+
* sees an empty frame; the new layout simply arrives.
|
|
14
|
+
*
|
|
15
|
+
* No `AnimatePresence`: the canvas + thread are live store-subscribed, so a
|
|
16
|
+
* kept-mounted "outgoing" copy would just re-render the new content (a hard
|
|
17
|
+
* swap). Re-keying drops the old instantly and the single incoming layer plays
|
|
18
|
+
* a clean entrance.
|
|
19
|
+
*
|
|
20
|
+
* Inert within a conversation — `sessionId` is stable during a streaming turn,
|
|
21
|
+
* so this never re-keys mid-turn and never touches per-turn canvas motion.
|
|
22
|
+
*/
|
|
23
|
+
export declare function ConversationTransition({ children, className, style, }: {
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
className?: string;
|
|
26
|
+
style?: React.CSSProperties;
|
|
27
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface DictationButtonProps {
|
|
3
|
+
/** True while a dictation session is active (drives the listening pulse). */
|
|
4
|
+
listening: boolean;
|
|
5
|
+
/** Whether the browser supports dictation. The button renders nothing when
|
|
6
|
+
* false, so an unsupported browser (Firefox) simply has no mic. */
|
|
7
|
+
supported: boolean;
|
|
8
|
+
/** Start / stop the session. */
|
|
9
|
+
onToggle: () => void;
|
|
10
|
+
/** Brand override hooks — merged after the token-based defaults. */
|
|
11
|
+
className?: string;
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* `DictationButton` — the composer's themeable speech-to-text trigger.
|
|
16
|
+
*
|
|
17
|
+
* Dumb + presentational: the speech engine lives in `useDictation`
|
|
18
|
+
* (`@fourty/react`). Idle shows the mic glyph; while listening it morphs into a
|
|
19
|
+
* ChatGPT-style waveform — bouncing bars in the themeable active colour
|
|
20
|
+
* (`--fourty-mic-active`, falling back to `--color-primary`; idle uses
|
|
21
|
+
* `--fourty-mic-idle` → `--color-text-muted`). Pair it with `useDictation` in a
|
|
22
|
+
* composer — see `Composer` for the canonical wiring.
|
|
23
|
+
*/
|
|
24
|
+
export declare function DictationButton({ listening, supported, onToggle, className, style, }: DictationButtonProps): React.ReactElement | null;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface DragSheetProps {
|
|
3
|
+
/** Controlled visibility — the host owns open/close. */
|
|
4
|
+
open: boolean;
|
|
5
|
+
/** Called on any dismissal: scrim tap, drag-down past threshold, flick-down. */
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
/** Accessible label for the dialog — required. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Open height as a fraction of the dynamic viewport (0–1). Default 0.72. */
|
|
10
|
+
heightFraction?: number;
|
|
11
|
+
/** Size the (default-detent) sheet to its CONTENT instead of a fixed fraction —
|
|
12
|
+
* "just tall enough" for a short exchange + the input, capped at
|
|
13
|
+
* `heightFraction` of the viewport (then the thread scrolls). Dragging up still
|
|
14
|
+
* snaps to full-screen. Default false (fixed fraction). */
|
|
15
|
+
fit?: boolean;
|
|
16
|
+
/** Brand override hook merged onto the panel surface. */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** Sheet contents (thread + composer). Fills the body under the grab handle. */
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* DragSheet — a MODAL, drag-to-dismiss bottom sheet (distinct from the
|
|
23
|
+
* persistent-peek `BottomSheet`). It is mounted only while `open`, slides up over
|
|
24
|
+
* a dimming scrim, and fully dismisses back to nothing — the familiar "regular
|
|
25
|
+
* bottom sheet" interaction: drag the grab handle down (or flick, or tap the
|
|
26
|
+
* scrim) to exit.
|
|
27
|
+
*
|
|
28
|
+
* Composited-first: the only animated properties are the panel `transform`
|
|
29
|
+
* (translateY) and the scrim `opacity`. Drag is bound to the grab handle only
|
|
30
|
+
* (`dragListener={false}` + `dragControls`), so the inner thread scrolls freely
|
|
31
|
+
* without the sheet hijacking the gesture. All chrome (surface, radius, shadow)
|
|
32
|
+
* is static CSS on the class hooks.
|
|
33
|
+
*/
|
|
34
|
+
export declare function DragSheet({ open, onClose, label, heightFraction, fit, className, children, }: DragSheetProps): React.ReactElement;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Inline prompt completion — a self-contained composer plugin.
|
|
4
|
+
*
|
|
5
|
+
* Renders the agent-free "ghost text" continuation of what the visitor
|
|
6
|
+
* is typing (shell / editor / browser-omnibox style) and accepts it on
|
|
7
|
+
* Tab or a click. Everything the feature needs lives here so the
|
|
8
|
+
* Composer stays dumb: it mounts this once and hands over the textarea
|
|
9
|
+
* ref + an accept callback.
|
|
10
|
+
*
|
|
11
|
+
* The matching logic is the pure `useInlineCompletion` hook; this
|
|
12
|
+
* component owns the FEATURE: assembling the corpus, mirroring the
|
|
13
|
+
* textarea's caret/focus, drawing the overlay, and the Tab/Escape/click
|
|
14
|
+
* key handling. No network, no LLM — it runs off the visitor's own
|
|
15
|
+
* history + brand seeds + the agent's turn-fresh placeholder examples,
|
|
16
|
+
* so it never touches the agent latency budget.
|
|
17
|
+
*
|
|
18
|
+
* Rendered as a child of the composer's `position: relative` input
|
|
19
|
+
* wrapper, so the overlay positions over the textarea.
|
|
20
|
+
*/
|
|
21
|
+
export interface InlineCompletionProps {
|
|
22
|
+
/** The composer's textarea: read for live caret position, refocused on
|
|
23
|
+
* accept, and the single source for the overlay's text metrics. */
|
|
24
|
+
textareaRef: React.RefObject<HTMLTextAreaElement | null>;
|
|
25
|
+
/** Current composer value (the composer owns the controlled input). */
|
|
26
|
+
value: string;
|
|
27
|
+
/** Accept the completion — the composer sets its value to `full` and
|
|
28
|
+
* runs its own on-input side effects (autosize). */
|
|
29
|
+
onAccept: (full: string) => void;
|
|
30
|
+
/** Brand starter prompts — seed corpus so completion is useful for a
|
|
31
|
+
* fresh visitor before any history exists. */
|
|
32
|
+
starterSuggestions?: ReadonlyArray<string>;
|
|
33
|
+
/** Report the ghost's laid-out content height (px) so the composer can grow
|
|
34
|
+
* the field to fit it — see `useFieldAutosize`. `0` whenever no ghost shows,
|
|
35
|
+
* which lets the field collapse straight back to the typed text. */
|
|
36
|
+
onGhostHeight: (px: number) => void;
|
|
37
|
+
}
|
|
38
|
+
export declare function InlineCompletion({ textareaRef, value, onAccept, starterSuggestions, onGhostHeight, }: InlineCompletionProps): React.ReactElement | null;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface LauncherDockProps {
|
|
3
|
+
/** The launcher buttons (account / wishlist / cart / chat …). */
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** Desktop pin: distance from the top of the canvas region in px. Default 12. */
|
|
6
|
+
top?: number;
|
|
7
|
+
/** Desktop pin: distance from the right edge in px. Default 16. */
|
|
8
|
+
right?: number;
|
|
9
|
+
/** Desktop pin: stacking order — must clear the side dock. Default 50. */
|
|
10
|
+
zIndex?: number;
|
|
11
|
+
/** Gap between the launcher buttons in px. Default 4. */
|
|
12
|
+
gap?: number;
|
|
13
|
+
/** Brand class hook for cross-cutting theme CSS driven by ANCESTOR state
|
|
14
|
+
* (e.g. SM's canvas-thinking fold-out), not by anything this component
|
|
15
|
+
* can see. */
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* LauncherDock — placement authority for a shell's `launchers` slot.
|
|
20
|
+
*
|
|
21
|
+
* The cluster itself is brand chrome (the brand's own glyphs, counts, and
|
|
22
|
+
* handlers); WHERE it sits is the shell's call, and the two shells answer
|
|
23
|
+
* differently:
|
|
24
|
+
*
|
|
25
|
+
* • DESKTOP — pinned absolutely over the canvas at the top-right, above the
|
|
26
|
+
* side dock, so the cart is never clipped when the dock slides in. The
|
|
27
|
+
* brand tunes the pin (`top` / `right` / `zIndex`) to its own header
|
|
28
|
+
* geometry, since that's the row the cluster aligns against.
|
|
29
|
+
* • MOBILE — left IN FLOW. The platform top bar (`MobileChrome`) has a
|
|
30
|
+
* right cell that vertically centres whatever it's given, so the cluster
|
|
31
|
+
* lands on the same centre line as the bar's hamburger and brand mark.
|
|
32
|
+
*
|
|
33
|
+
* That split is why placement can't live in the brand: every brand used to
|
|
34
|
+
* hand-roll the same `absolute top-13 right-6` pin, which is right for the
|
|
35
|
+
* desktop canvas and wrong inside the mobile bar — an absolute box anchored
|
|
36
|
+
* 13px from the top of a 56px bar hangs its 44px touch targets past the
|
|
37
|
+
* bar's own centre, so the icons sagged below the logo they should line up
|
|
38
|
+
* with. One authority, one pin, both shells correct.
|
|
39
|
+
*/
|
|
40
|
+
export declare function LauncherDock({ children, top, right, zIndex, gap, className, }: LauncherDockProps): React.ReactElement;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface ListeningWaveformProps {
|
|
3
|
+
/** Bar colour — a CSS colour or custom-property reference. */
|
|
4
|
+
color: string;
|
|
5
|
+
/** Per-bar width in px. Default 2.5 (the composer mic footprint). */
|
|
6
|
+
barWidth?: number;
|
|
7
|
+
/** Gap between bars in px. Default 2.5. */
|
|
8
|
+
gap?: number;
|
|
9
|
+
/** Row height in px. Default 16 (the composer mic footprint). */
|
|
10
|
+
height?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* `ListeningWaveform` — the bouncing-bars "I'm listening" indicator. Bars stay
|
|
14
|
+
* sharp (crisp, not rounded) to fit the stencilled SM voice; brand colour comes
|
|
15
|
+
* in via `color`. Scale it up (`barWidth`/`gap`/`height`) for the full-screen
|
|
16
|
+
* voice overlay; the default footprint matches the composer mic glyph.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ListeningWaveform({ color, barWidth, gap, height, }: ListeningWaveformProps): React.ReactElement;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ShellMenuItem } from '@40rty/ams-sdk';
|
|
3
|
+
import type { MenuDrawerItem } from './MenuDrawer';
|
|
4
|
+
/**
|
|
5
|
+
* MenuAccordionPanel — the touch drill-down for a department. Where DESKTOP
|
|
6
|
+
* unfolds a `megaMenu` in a hover flyout BESIDE the list (`MenuFlyout`), touch
|
|
7
|
+
* has no hover and no horizontal room, so the sub-categories expand INLINE
|
|
8
|
+
* beneath the tapped row, in the same single scrolling column. Columns stack
|
|
9
|
+
* vertically (they wrap side-by-side in the desktop flyout); both render their
|
|
10
|
+
* links through the shared `MenuColumn`, so the two paths never drift.
|
|
11
|
+
*
|
|
12
|
+
* A leading "Shop all X" row dispatches the department's OWN top-level action —
|
|
13
|
+
* the intent a desktop visitor gets by clicking the department header, which on
|
|
14
|
+
* touch is otherwise swallowed by the tap that opens this panel. Rendered only
|
|
15
|
+
* when the department carries its own `action`.
|
|
16
|
+
*
|
|
17
|
+
* The parent (`MenuNav`) owns the open/close state and wraps this in
|
|
18
|
+
* `AnimatePresence`; the panel animates its own height so the expand/collapse
|
|
19
|
+
* reads as a calm push, not a snap. Height animates on the outer box while
|
|
20
|
+
* padding lives on an inner box, so the reveal grows smoothly instead of
|
|
21
|
+
* jumping the padding in at frame one.
|
|
22
|
+
*/
|
|
23
|
+
export declare function MenuAccordionPanel({ item, onPick, }: {
|
|
24
|
+
item: MenuDrawerItem;
|
|
25
|
+
onPick: (item: ShellMenuItem) => void;
|
|
26
|
+
}): React.ReactElement | null;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AgentSignalInput, ShellMenuItem } from '@40rty/ams-sdk';
|
|
3
|
+
/**
|
|
4
|
+
* Platform category drawer — the "shop by category" navigation a storefront
|
|
5
|
+
* visitor reaches for, extracted out of Steve Madden's shell so any brand can
|
|
6
|
+
* mount the same pattern (SM, babysense, …) instead of re-implementing it.
|
|
7
|
+
* Split into dumb pieces so the shell (the common parent) owns open/close state:
|
|
8
|
+
*
|
|
9
|
+
* - `MenuTrigger` — the button that opens the drawer. The brand supplies its
|
|
10
|
+
* own glyph (and optionally a label word); the trigger carries neither.
|
|
11
|
+
* - `MenuDrawer` — the left-anchored slide-in panel. `position: fixed`
|
|
12
|
+
* directly on its own backdrop/panel roots — deliberately NOT
|
|
13
|
+
* `absolute` against whatever ancestor `ShellMenuChrome` happens to be
|
|
14
|
+
* mounted inside (that ancestor can be a short, header-height row, e.g.
|
|
15
|
+
* the mobile shell's sticky `MobileChrome` — an `absolute` overlay
|
|
16
|
+
* would collapse to THAT box's height instead of covering the screen).
|
|
17
|
+
* `fixed` pins it to the true viewport regardless of where it's mounted,
|
|
18
|
+
* same reasoning as `MorphIsland`'s own `position: fixed` root.
|
|
19
|
+
* - `MenuNav` — the department rows. Interaction adapts to the visitor's
|
|
20
|
+
* form factor: desktop HOVERS a `megaMenu` open in the side `MenuFlyout`;
|
|
21
|
+
* touch (no hover, no horizontal room) TAPS it open as an inline
|
|
22
|
+
* accordion (`MenuAccordionPanel`) instead — so the sub-categories are
|
|
23
|
+
* reachable on a phone and the side flyout, which would overflow it, is
|
|
24
|
+
* never used.
|
|
25
|
+
* - `MenuFlyout` — the desktop drill-down pane a `megaMenu` row unfolds.
|
|
26
|
+
*
|
|
27
|
+
* All pieces are presentational and purely token-driven (`--color-*`,
|
|
28
|
+
* `--font-*`) — a brand reskins the whole drawer through its `tokens.css`.
|
|
29
|
+
* The drawer reports the selected item through `onSelectItem`; the harness
|
|
30
|
+
* owns what a selection means (dispatch the item's AgentSignal).
|
|
31
|
+
*/
|
|
32
|
+
/** One drill-down column (title + links) within a department flyout. */
|
|
33
|
+
export interface MenuDrawerColumn {
|
|
34
|
+
title: string;
|
|
35
|
+
links: ShellMenuItem[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A drawer entry. `action` is optional — a pure category grouping (no
|
|
39
|
+
* agentic action of its own, only its `megaMenu` children carry actions)
|
|
40
|
+
* renders as a row that opens its flyout on click/hover instead of
|
|
41
|
+
* dispatching. A leaf entry supplies `action` and no `megaMenu`.
|
|
42
|
+
*/
|
|
43
|
+
export interface MenuDrawerItem {
|
|
44
|
+
label: string;
|
|
45
|
+
action?: AgentSignalInput;
|
|
46
|
+
hint?: string;
|
|
47
|
+
icon?: string;
|
|
48
|
+
megaMenu?: {
|
|
49
|
+
columns: MenuDrawerColumn[];
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** Trigger that opens the drawer. Transparent on the canvas, matching the rest
|
|
53
|
+
* of a brand's floating chrome — the brand supplies its own `icon` glyph.
|
|
54
|
+
* `label` is the optional word beside the glyph: omit it for the ICON-ONLY
|
|
55
|
+
* trigger (what the mobile bar mounts — the glyph alone is the universal
|
|
56
|
+
* hamburger, and the word costs width the centered brand mark needs). The
|
|
57
|
+
* accessible name comes from `aria-label` either way. */
|
|
58
|
+
export declare function MenuTrigger({ onClick, icon, label, }: {
|
|
59
|
+
onClick: () => void;
|
|
60
|
+
icon: React.ReactNode;
|
|
61
|
+
label?: string;
|
|
62
|
+
}): React.ReactElement;
|
|
63
|
+
/** Left-anchored slide-in category drawer. Fixed to the viewport; backdrop
|
|
64
|
+
* dims the canvas behind it. Adapts hover-flyout (desktop) vs inline-accordion
|
|
65
|
+
* (touch) via the visitor's form factor. */
|
|
66
|
+
export declare function MenuDrawer({ open, items, onClose, onSelectItem, panelWidth, }: {
|
|
67
|
+
open: boolean;
|
|
68
|
+
items: MenuDrawerItem[];
|
|
69
|
+
onClose: () => void;
|
|
70
|
+
onSelectItem: (item: ShellMenuItem) => void;
|
|
71
|
+
panelWidth?: number;
|
|
72
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ShellMenuItem } from '@40rty/ams-sdk';
|
|
3
|
+
import type { MenuDrawerItem } from './MenuDrawer';
|
|
4
|
+
/**
|
|
5
|
+
* MenuFlyout — the second pane of the platform category drawer on DESKTOP
|
|
6
|
+
* (hover-driven). When a drawer row carrying a `megaMenu` is hovered, its
|
|
7
|
+
* columns unfold here, directly beside the drawer list. A flex sibling of the
|
|
8
|
+
* list (not an absolute overlay) so the two panes share one hover region:
|
|
9
|
+
* leaving the whole wrapper is what dismisses it, so the pointer can travel
|
|
10
|
+
* list → flyout without the panel collapsing under it.
|
|
11
|
+
*
|
|
12
|
+
* Touch has no hover, so the mobile drawer drills DOWN in place instead — see
|
|
13
|
+
* `MenuAccordionPanel`. Both render their links through the shared `MenuColumn`.
|
|
14
|
+
*
|
|
15
|
+
* Dumb chrome, same as the drawer: it reports a picked link through `onPick`;
|
|
16
|
+
* the harness owns the dispatch. Purely token-driven so any brand reskins it
|
|
17
|
+
* through CSS vars.
|
|
18
|
+
*/
|
|
19
|
+
export declare function MenuFlyout({ item, onPick, }: {
|
|
20
|
+
item: MenuDrawerItem;
|
|
21
|
+
onPick: (link: ShellMenuItem) => void;
|
|
22
|
+
}): React.ReactElement | null;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ShellMenuItem } from '@40rty/ams-sdk';
|
|
3
|
+
import type { MenuDrawerItem } from './MenuDrawer';
|
|
4
|
+
export type MenuNavMode = 'hover' | 'accordion';
|
|
5
|
+
/**
|
|
6
|
+
* MenuNav — the department rows of the platform category drawer. One list,
|
|
7
|
+
* two interaction modes wired off the visitor's form factor:
|
|
8
|
+
*
|
|
9
|
+
* - `hover` (desktop, fine pointer) — hovering a row opens its `megaMenu` in
|
|
10
|
+
* the side `MenuFlyout` (the parent renders it as a sibling of the drawer,
|
|
11
|
+
* keyed off the same open index); a row with its own `action` dispatches on
|
|
12
|
+
* click, a pure grouping opens its flyout. Unchanged from the original
|
|
13
|
+
* desktop drawer.
|
|
14
|
+
* - `accordion` (touch, coarse pointer / phone width) — there is no hover, so
|
|
15
|
+
* a tap on a department with a `megaMenu` DRILLS DOWN in place: it toggles
|
|
16
|
+
* an inline `MenuAccordionPanel` beneath the row instead of dispatching, so
|
|
17
|
+
* the sub-categories are actually reachable (and the side flyout, which
|
|
18
|
+
* would overflow a phone, is never used). Leaf rows still dispatch on tap.
|
|
19
|
+
*
|
|
20
|
+
* Dumb chrome: reports a picked item through `onPick`; the parent owns what a
|
|
21
|
+
* selection means and owns the single open-index state (so the lit row, the
|
|
22
|
+
* desktop flyout, and the inline panel can never disagree).
|
|
23
|
+
*/
|
|
24
|
+
export declare function MenuNav({ items, mode, openIndex, onOpenChange, onPick, }: {
|
|
25
|
+
items: MenuDrawerItem[];
|
|
26
|
+
mode: MenuNavMode;
|
|
27
|
+
openIndex: number | null;
|
|
28
|
+
onOpenChange: (index: number | null) => void;
|
|
29
|
+
onPick: (item: ShellMenuItem) => void;
|
|
30
|
+
}): React.ReactElement;
|