@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,37 @@
|
|
|
1
|
+
import { type AttachmentRef } from '@40rty/ams-sdk';
|
|
2
|
+
export type AttachmentStatus = 'uploading' | 'ready' | 'error';
|
|
3
|
+
/** One composer attachment through its lifecycle: picked → uploading → ready /
|
|
4
|
+
* error. The composer renders these as thumbnails; only `ready` ones are sent. */
|
|
5
|
+
export interface ComposerAttachment {
|
|
6
|
+
localId: string;
|
|
7
|
+
name: string;
|
|
8
|
+
mimeType: string;
|
|
9
|
+
size: number;
|
|
10
|
+
/** Object URL for an image preview; null for non-image files. */
|
|
11
|
+
previewUrl: string | null;
|
|
12
|
+
status: AttachmentStatus;
|
|
13
|
+
/** Set once the upload resolves (`status === 'ready'`). */
|
|
14
|
+
ref: AttachmentRef | null;
|
|
15
|
+
/** Visitor-safe failure message (`status === 'error'`). */
|
|
16
|
+
error: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface ComposerAttachmentsApi {
|
|
19
|
+
attachments: ComposerAttachment[];
|
|
20
|
+
/** Validate + start uploading each file; rejects show as error thumbnails. */
|
|
21
|
+
addFiles: (files: FileList | File[]) => void;
|
|
22
|
+
remove: (localId: string) => void;
|
|
23
|
+
/** Drop everything (after send) and revoke object URLs. */
|
|
24
|
+
clear: () => void;
|
|
25
|
+
/** True while any upload is in flight — the composer blocks send. */
|
|
26
|
+
hasPending: boolean;
|
|
27
|
+
/** Refs for the successfully-uploaded files, in order. */
|
|
28
|
+
readyRefs: AttachmentRef[];
|
|
29
|
+
}
|
|
30
|
+
/** The accept attribute for a file input — derived from the shared allow-list. */
|
|
31
|
+
export declare const ATTACHMENT_ACCEPT: string;
|
|
32
|
+
/**
|
|
33
|
+
* Composer attachment state machine. Owns picking, client validation, the
|
|
34
|
+
* upload (via `session.uploadAttachment`), removal, and object-URL lifecycle.
|
|
35
|
+
* The composer stays presentational — it renders `attachments` and calls back.
|
|
36
|
+
*/
|
|
37
|
+
export declare function useComposerAttachments(): ComposerAttachmentsApi;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ComposerAttachmentsApi } from './useComposerAttachments';
|
|
3
|
+
export interface UsePromptComposerOptions {
|
|
4
|
+
/**
|
|
5
|
+
* External attachments controller. Provide it to run in "controlled" mode —
|
|
6
|
+
* a brand shell that LIFTS `useComposerAttachments()` (e.g. the mobile shell
|
|
7
|
+
* sharing one state between a rest-island camera trigger and the composer)
|
|
8
|
+
* passes the shared controller here. Omit and the hook owns its own. The
|
|
9
|
+
* internal instance always runs (an idle controller when controlled —
|
|
10
|
+
* harmless) since hooks can't be conditional.
|
|
11
|
+
*/
|
|
12
|
+
attachments?: ComposerAttachmentsApi;
|
|
13
|
+
}
|
|
14
|
+
export interface UsePromptComposerApi {
|
|
15
|
+
/** Current draft text. */
|
|
16
|
+
value: string;
|
|
17
|
+
/** Set the draft. Wire to the textarea `onChange` and any type-to-focus path. */
|
|
18
|
+
setValue: (next: string) => void;
|
|
19
|
+
/** Attachment state machine (controlled or internal — see options). */
|
|
20
|
+
attachments: ComposerAttachmentsApi;
|
|
21
|
+
/** Speech-to-text state for a `DictationButton`. */
|
|
22
|
+
dictation: {
|
|
23
|
+
listening: boolean;
|
|
24
|
+
supported: boolean;
|
|
25
|
+
toggle: () => void;
|
|
26
|
+
};
|
|
27
|
+
/** Clipboard handler — promotes pasted image/file bytes into attachments. */
|
|
28
|
+
onPaste: (e: React.ClipboardEvent<HTMLTextAreaElement>) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Sendable when there's text OR a ready attachment, and no upload is still in
|
|
31
|
+
* flight (so a file never gets left out of the turn it was attached to).
|
|
32
|
+
*/
|
|
33
|
+
canSend: boolean;
|
|
34
|
+
/** Send the turn (text + ready attachment refs), then clear draft + strip. */
|
|
35
|
+
submit: () => void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* `usePromptComposer` — the headless behavior shared by every prompt-input
|
|
39
|
+
* surface (the side-dock `Composer`, a hero-embedded entry box, a mobile voice
|
|
40
|
+
* island). Owns the cross-cutting wiring — draft state, attachment
|
|
41
|
+
* upload lifecycle, dictation that appends onto typed text, paste-to-attach,
|
|
42
|
+
* the send gate, and the send-then-clear — over the ONE `FourtySession`.
|
|
43
|
+
*
|
|
44
|
+
* It is presentation-free: a consumer renders its own chrome (textarea, send
|
|
45
|
+
* button, `AttachButton` / `DictationButton` / `AttachmentStrip`) and wires the
|
|
46
|
+
* returned handlers in. Surface-specific behavior (type-to-focus, a streaming
|
|
47
|
+
* stop/abort morph, autosize policy, agent-placeholder rotation) stays in the
|
|
48
|
+
* consumer — this hook is only the shared core, so the brand connects through
|
|
49
|
+
* ONE composition hook rather than re-deriving the upload + dictation plumbing.
|
|
50
|
+
*/
|
|
51
|
+
export declare function usePromptComposer(options?: UsePromptComposerOptions): UsePromptComposerApi;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ShellDockState } from './slots';
|
|
3
|
+
export declare function ShellDockProvider({ value, children }: {
|
|
4
|
+
value: ShellDockState;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}): React.ReactElement;
|
|
7
|
+
/** Reads the live dock-open state. Throws outside a `ShellScaffold` — a
|
|
8
|
+
* canvas component that depends on dock visibility has nothing sane to
|
|
9
|
+
* fall back to, so a missing provider should fail loud, not render wrong. */
|
|
10
|
+
export declare function useShellDock(): ShellDockState;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export { Composer, type ComposerProps, type ThreadHistoryRenderer } from './Composer';
|
|
2
|
+
export { ConversationTransition } from './ConversationTransition';
|
|
3
|
+
export { ShareCanvasButton } from './composer/ShareCanvasButton';
|
|
4
|
+
export { DictationButton, type DictationButtonProps } from './DictationButton';
|
|
5
|
+
export { ListeningWaveform, type ListeningWaveformProps } from './ListeningWaveform';
|
|
6
|
+
export { VoiceControl, type VoiceControlProps } from './VoiceControl';
|
|
7
|
+
export { VoiceIsland, type VoiceIslandProps } from './VoiceIsland';
|
|
8
|
+
export { DragSheet, type DragSheetProps } from './DragSheet';
|
|
9
|
+
export { BottomSheet, type BottomSheetProps, type BottomSheetApi, } from './BottomSheet';
|
|
10
|
+
export { InlineCompletion, type InlineCompletionProps } from './InlineCompletion';
|
|
11
|
+
export { ComposerChipStrip } from './ComposerChipStrip';
|
|
12
|
+
export { AnimatedPlaceholder } from './AnimatedPlaceholder';
|
|
13
|
+
export { TypedPlaceholder } from './TypedPlaceholder';
|
|
14
|
+
export { useComposerAttachments, type ComposerAttachmentsApi, type ComposerAttachment, } from './composer/useComposerAttachments';
|
|
15
|
+
export { AttachButton, type AttachButtonProps } from './composer/AttachButton';
|
|
16
|
+
export { AttachmentStrip, type AttachmentStripProps } from './composer/AttachmentStrip';
|
|
17
|
+
export { usePromptComposer, type UsePromptComposerApi, type UsePromptComposerOptions, } from './composer/usePromptComposer';
|
|
18
|
+
export { ClearSessionButton, type ClearSessionButtonProps } from './composer/ClearSessionButton';
|
|
19
|
+
export { ConversationHistoryButton, type ConversationHistoryButtonProps } from './composer/ConversationHistoryButton';
|
|
20
|
+
export { SideDock, useSideDockSpacing, SIDE_DOCK_REVEAL_MS, SIDE_DOCK_EASE, type SideDockProps, } from './SideDock';
|
|
21
|
+
export { ShellScaffold, resolveShellSlot, type ShellScaffoldProps, type ShellSlot, type ShellDockState, } from './ShellScaffold';
|
|
22
|
+
export { useShellDock, ShellDockProvider } from './dock-context';
|
|
23
|
+
export { MenuTrigger, MenuDrawer, type MenuDrawerItem, type MenuDrawerColumn, } from './MenuDrawer';
|
|
24
|
+
export { MenuFlyout } from './MenuFlyout';
|
|
25
|
+
export { MenuNavBar } from './MenuNavBar';
|
|
26
|
+
export { ShellMenuChrome, type ShellMenuChromeProps } from './ShellMenuChrome';
|
|
27
|
+
export { LauncherDock, type LauncherDockProps } from './LauncherDock';
|
|
28
|
+
export { ChromeSurface, type ChromeSurfaceProps } from './ChromeSurface';
|
|
29
|
+
export { DefaultMobileShell, type DefaultMobileShellProps, } from './mobile/DefaultMobileShell';
|
|
30
|
+
export { MobileVoiceConsole, type MobileVoiceConsoleProps, } from './mobile/MobileVoiceConsole';
|
|
31
|
+
export { MorphIsland, type MorphIslandProps, type MorphIslandHandle, } from './mobile/MorphIsland';
|
|
32
|
+
export { VOICE_ISLAND_HEIGHT, ISLAND_BOTTOM_GAP, ISLAND_KEYBOARD_GAP, KEYBOARD_LIKELY_MIN_PX } from './mobile/island-metrics';
|
|
33
|
+
export { useClaimHeroEntryPoint, useOnScreen } from './mobile/hero-entry-point';
|
|
34
|
+
export { Spinner } from './Spinner';
|
|
35
|
+
export { Button, type ButtonProps, type ButtonVariant, type ButtonSize } from './Button';
|
|
36
|
+
export { Skeleton, type SkeletonProps } from './Skeleton';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ShellMenuItem } from '@40rty/ams-sdk';
|
|
3
|
+
import type { MenuDrawerColumn } from './MenuDrawer';
|
|
4
|
+
/**
|
|
5
|
+
* MenuColumn — one drill-down column (a title + its links) inside a department's
|
|
6
|
+
* mega-menu. Shared between the desktop hover `MenuFlyout` (columns wrap
|
|
7
|
+
* side-by-side beside the drawer list) and the touch `MenuAccordionPanel`
|
|
8
|
+
* (columns stack inline beneath the tapped department row). Extracted so both
|
|
9
|
+
* render links from ONE definition — same button, same states — instead of two
|
|
10
|
+
* drifting copies.
|
|
11
|
+
*
|
|
12
|
+
* Dumb chrome: it reports a picked link through `onPick`; the harness owns the
|
|
13
|
+
* dispatch. Purely token-driven (`--color-*`, `--font-*`) so any brand reskins
|
|
14
|
+
* it through CSS vars.
|
|
15
|
+
*/
|
|
16
|
+
export declare function MenuColumn({ column, onPick, }: {
|
|
17
|
+
column: MenuDrawerColumn;
|
|
18
|
+
onPick: (link: ShellMenuItem) => void;
|
|
19
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ShellSlot } from '../slots';
|
|
3
|
+
export interface DefaultMobileShellProps {
|
|
4
|
+
/** The agent canvas (e.g. `<FourtyCanvas />`). Wrapped in ConversationTransition. */
|
|
5
|
+
canvas: React.ReactNode;
|
|
6
|
+
/** Brand footer, placed after the canvas in document flow. */
|
|
7
|
+
footer?: React.ReactNode;
|
|
8
|
+
/** Composer (thread + input) — lifted into the morph island's conversation sheet. */
|
|
9
|
+
composer: ShellSlot;
|
|
10
|
+
/** Top presence band — desktop mounts this above the canvas (see
|
|
11
|
+
* `ShellScaffold`'s own `presenceNotch`); mobile has no persistent top
|
|
12
|
+
* band of its own, so it's prepended inside the conversation sheet
|
|
13
|
+
* instead — the one place on mobile with room for it, and the visitor is
|
|
14
|
+
* already looking at the thread when they'd want to see it. Carries the
|
|
15
|
+
* standing knowledge (dossier) chips. Omit to render none. */
|
|
16
|
+
presenceNotch?: React.ReactNode;
|
|
17
|
+
/** Control cluster (cart / wishlist / account) — the top chrome's right cell.
|
|
18
|
+
* Expected IN FLOW (see `LauncherDock`): the cell centres it on the bar's own
|
|
19
|
+
* line, alongside the hamburger and the brand mark. */
|
|
20
|
+
launchers?: ShellSlot;
|
|
21
|
+
/** Cart / wishlist drawers — rendered over everything. */
|
|
22
|
+
drawers?: ShellSlot;
|
|
23
|
+
/** Brand mark — pinned left in the top chrome. */
|
|
24
|
+
logo?: ShellSlot;
|
|
25
|
+
/**
|
|
26
|
+
* `ScrollContainerContext`'s ref, forwarded from the brand shell (same
|
|
27
|
+
* prop the desktop shell attaches to its own real `overflow-y: auto`
|
|
28
|
+
* scroller). This shell resolves it to `document.scrollingElement`
|
|
29
|
+
* instead — see `document-scroll-ref.ts` — since the canvas is genuine
|
|
30
|
+
* in-flow document content, not an inner scroller of its own.
|
|
31
|
+
*/
|
|
32
|
+
scrollRef?: React.Ref<HTMLElement>;
|
|
33
|
+
/** Horizontal gutter applied to canvas content. Default 16. */
|
|
34
|
+
gutter?: number;
|
|
35
|
+
/** Rest-affordance copy shown on the island input bar. */
|
|
36
|
+
placeholder?: string;
|
|
37
|
+
/** Brand-authored example prompts the resting island CYCLES through before
|
|
38
|
+
* the agent has a rotation of its own — the first screen is exactly where
|
|
39
|
+
* a live rotation earns its keep, and the agent's own examples do not
|
|
40
|
+
* exist until a turn has ended. Omit for a single static placeholder. */
|
|
41
|
+
placeholderExamples?: readonly string[];
|
|
42
|
+
/** The brand's mark for the collapsed island pill — passed through to
|
|
43
|
+
* `MobileVoiceConsole`/`MorphIsland`, which own the drawing contract. */
|
|
44
|
+
collapsedMark?: React.ReactNode;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* DefaultMobileShell — the platform's default mobile spacefront experience.
|
|
48
|
+
*
|
|
49
|
+
* Generic, tokenized, slot-driven. Full-bleed canvas under a slim glass top
|
|
50
|
+
* chrome bar (logo + launchers), with the platform MORPH ISLAND at the bottom:
|
|
51
|
+
* ONE surface that IS both the resting voice/compose island AND the full
|
|
52
|
+
* conversation sheet, dragged continuously between them (`MobileVoiceConsole` /
|
|
53
|
+
* `MorphIsland`). The island carries the agent's presence read; the conversation
|
|
54
|
+
* sheet mounts the brand's `composer` slot. A brand re-skins the whole thing
|
|
55
|
+
* (square dark vs rounded navy) purely through its `tokens.css`
|
|
56
|
+
* (`--fourty-island-radius`, `--fourty-island-shadow`, `--fourty-island-scrim`);
|
|
57
|
+
* a brand with a genuinely bespoke mobile supplies a full custom `mobile`
|
|
58
|
+
* override to `ShellScaffold` instead.
|
|
59
|
+
*
|
|
60
|
+
* SCROLL MODEL — genuine DOCUMENT scroll, not an app-shell-with-inner-
|
|
61
|
+
* scroller. This is load-bearing, not a style choice: confirmed on PHYSICAL
|
|
62
|
+
* iOS hardware (the Simulator's software renderer does NOT reproduce this)
|
|
63
|
+
* that Safari's Liquid Glass bottom toolbar only composites real content
|
|
64
|
+
* behind its translucent chrome for genuinely-scrolled document content — a
|
|
65
|
+
* `position: fixed` app-shell, at ANY declared height (including one sized
|
|
66
|
+
* past the visible viewport specifically to reach under the toolbar), gets
|
|
67
|
+
* clipped/covered by Safari's own chrome layer on real hardware regardless.
|
|
68
|
+
*
|
|
69
|
+
* So: the canvas is normal in-flow content (no inner `overflow-y: auto`
|
|
70
|
+
* scroller, no non-scrolling wrapper), the page grows past one screen height
|
|
71
|
+
* when content requires it, and the DOCUMENT scrolls — exactly how Safari's
|
|
72
|
+
* own toolbar hide/show and chrome-compositing were designed to work, and
|
|
73
|
+
* how ordinary (non-app-shell) websites get this for free. The header uses
|
|
74
|
+
* `position: sticky` (pins during scroll of its scrolling ancestor — the
|
|
75
|
+
* document — without requiring that ancestor to be non-scrollable, unlike
|
|
76
|
+
* `fixed`, which also — per the same hardware finding — doesn't reliably
|
|
77
|
+
* paint/stay visible near the bottom edge; MobileChrome is a TOP-anchored
|
|
78
|
+
* sticky element, unaffected). The floating island uses `position: fixed`
|
|
79
|
+
* directly on its own root (`MorphIsland`), pinned to the true viewport
|
|
80
|
+
* independent of document scroll — a small floating control, not the
|
|
81
|
+
* whole-screen edge-to-edge content layer that hardware mishandles.
|
|
82
|
+
*
|
|
83
|
+
* The scroll-container ref (`ScrollContainerContext`, read by canvas-motion /
|
|
84
|
+
* viewport-focus / page-navigation-scroll elsewhere) is resolved to
|
|
85
|
+
* `document.scrollingElement` via a REF CALLBACK on the shell's own root
|
|
86
|
+
* (see `document-scroll-ref.ts` for why a callback, not an effect).
|
|
87
|
+
*/
|
|
88
|
+
export declare function DefaultMobileShell(props: DefaultMobileShellProps): React.ReactElement;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ComposerAttachmentsApi } from '../composer/useComposerAttachments';
|
|
3
|
+
/**
|
|
4
|
+
* IslandComposeGroup — the resting island's compose pair: the leading `+` add
|
|
5
|
+
* button and the REAL inline textarea (the visitor types straight into it, no
|
|
6
|
+
* sheet round-trip). The voice switch is NOT here — it sits in the bar's
|
|
7
|
+
* trailing cluster beside send, where the row's actions live. Pure UI —
|
|
8
|
+
* `IslandInputBar` owns the draft state (`usePromptComposer`) and swaps this
|
|
9
|
+
* whole group out for the presence notch while a turn streams (see
|
|
10
|
+
* `IslandInputBar`'s `showStop`).
|
|
11
|
+
*
|
|
12
|
+
* THE FIELD WRAPS AND GROWS. It used to be pinned to one line with
|
|
13
|
+
* `white-space: nowrap` and a fixed height, so a draft wider than the bar
|
|
14
|
+
* scrolled sideways beneath the caret: you could see the word being typed and
|
|
15
|
+
* nothing before it. It now wraps, and the box grows a line at a time up to
|
|
16
|
+
* `ISLAND_FIELD_MAX_LINES` before holding and scrolling internally — the same
|
|
17
|
+
* `useFieldAutosize` the dock composer runs (driven by `IslandInputBar`, which
|
|
18
|
+
* owns the draft), given the island's own smaller cap. No layout work is
|
|
19
|
+
* needed above: the island face is already an
|
|
20
|
+
* auto-height surface whose size changes are FLIP-animated by `MorphIsland`,
|
|
21
|
+
* and the shell's canvas clearance tracks the island's measured height, so the
|
|
22
|
+
* page reflows under a growing draft on its own.
|
|
23
|
+
*/
|
|
24
|
+
export declare function IslandComposeGroup({ value, onValueChange, onKeyDown, onPaste, onFocus, onBlur, placeholder, placeholderAnimated, attachments, taRef, }: {
|
|
25
|
+
value: string;
|
|
26
|
+
onValueChange: (value: string) => void;
|
|
27
|
+
onKeyDown: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
28
|
+
onPaste: (e: React.ClipboardEvent<HTMLTextAreaElement>) => void;
|
|
29
|
+
onFocus?: () => void;
|
|
30
|
+
onBlur?: () => void;
|
|
31
|
+
placeholder: string;
|
|
32
|
+
/** True when `placeholder` is one entry of a ROTATION rather than a fixed
|
|
33
|
+
* line — the field then crossfades between entries. */
|
|
34
|
+
placeholderAnimated?: boolean;
|
|
35
|
+
attachments: ComposerAttachmentsApi;
|
|
36
|
+
/** The field element, owned by `IslandInputBar`: it runs the autosize pass
|
|
37
|
+
* against this node and blurs it on send — sending is the visitor saying
|
|
38
|
+
* they are done typing, and on a phone that has to take the keyboard with
|
|
39
|
+
* it. */
|
|
40
|
+
taRef: React.RefObject<HTMLTextAreaElement | null>;
|
|
41
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ComposerAttachmentsApi } from '../composer/useComposerAttachments';
|
|
3
|
+
/**
|
|
4
|
+
* IslandInputBar — the resting island's one input row, composed of exactly
|
|
5
|
+
* two swappable groups plus a trailing cluster:
|
|
6
|
+
* - IDLE / composing: `IslandComposeGroup` (leading `+` + textarea).
|
|
7
|
+
* - STREAMING, no queued draft (`showStop`): the `notch` slot — the SAME
|
|
8
|
+
* compact presence face (scanning deck / live read) the desktop notch
|
|
9
|
+
* renders, passed down from `RestIsland` — replaces the whole group.
|
|
10
|
+
* The trailing slot is exactly one of Send / Stop / Voice (see
|
|
11
|
+
* `IslandTrailingAction`) — never a fourth state, never two mounted at once.
|
|
12
|
+
* So the resting row is `+` · field · commit: one control either side of the
|
|
13
|
+
* field, and the field is the only thing carrying a label. Nothing here merely
|
|
14
|
+
* re-arranges chrome — the grab handle above owns raising the sheet, and the
|
|
15
|
+
* nav arrows mount only when an axis actually has somewhere to go.
|
|
16
|
+
*
|
|
17
|
+
* Behaviour (draft, attachment lifecycle, paste-to-attach, the
|
|
18
|
+
* send gate) is the shared `usePromptComposer` over the ONE session — the
|
|
19
|
+
* same core the sheet's `Composer` runs, wired to the same lifted
|
|
20
|
+
* attachments controller so a photo attached here shows in both surfaces.
|
|
21
|
+
*
|
|
22
|
+
* A fresh draft typed mid-turn immediately swaps the compose group back in
|
|
23
|
+
* (the visitor is queuing their next ask) and offers Send instead of
|
|
24
|
+
* fighting Stop for the trailing slot — `showStop` is `isStreaming &&
|
|
25
|
+
* !canSend`, the same gate the desktop Composer's Send→Stop morph uses.
|
|
26
|
+
*/
|
|
27
|
+
export declare function IslandInputBar({ onSpeak, attachments, placeholder, placeholderAnimated, height, onFocus, onBlur, isStreaming, onStop, notch, onNotchClick, notchExpanded, }: {
|
|
28
|
+
/** Enter voice mode — the trailing slot's idle state. */
|
|
29
|
+
onSpeak: () => void;
|
|
30
|
+
/** The shell-lifted attachments controller, shared with the sheet composer. */
|
|
31
|
+
attachments: ComposerAttachmentsApi;
|
|
32
|
+
/** Resting placeholder (the agent's live nudge, else the brand default). */
|
|
33
|
+
placeholder: string;
|
|
34
|
+
/** True when `placeholder` is a ROTATING entry rather than the brand's one
|
|
35
|
+
* static line — the field then crossfades between them instead of hard-
|
|
36
|
+
* cutting. See `IslandComposeGroup`. */
|
|
37
|
+
placeholderAnimated?: boolean;
|
|
38
|
+
/** The bar's resting height, from the shell's one source of truth. */
|
|
39
|
+
height: number;
|
|
40
|
+
/** Textarea gained focus — the visitor is composing (drives the island's
|
|
41
|
+
* focus-gated chip rail). */
|
|
42
|
+
onFocus?: () => void;
|
|
43
|
+
/** Textarea lost focus. */
|
|
44
|
+
onBlur?: () => void;
|
|
45
|
+
/** True while a turn is in flight — drives the compose-group ↔ notch swap
|
|
46
|
+
* and the trailing action. */
|
|
47
|
+
isStreaming: boolean;
|
|
48
|
+
/** Visitor-initiated cancel of the in-flight turn. */
|
|
49
|
+
onStop: () => void;
|
|
50
|
+
/** The presence notch content (owned/composed by `RestIsland` — this bar
|
|
51
|
+
* doesn't know or care whether it's the scanning face or a pre-scan
|
|
52
|
+
* read), shown in place of the whole compose group while streaming. */
|
|
53
|
+
notch: React.ReactNode;
|
|
54
|
+
/** Tap-to-expand the notch in place — reveals more of what's happening
|
|
55
|
+
* right now (NOT the island⇄sheet morph). */
|
|
56
|
+
onNotchClick: () => void;
|
|
57
|
+
/** Whether the notch is currently expanded in place — switches the read
|
|
58
|
+
* region from a clipped single line to the scrollable full read (with a
|
|
59
|
+
* bottom scroll-fade). */
|
|
60
|
+
notchExpanded: boolean;
|
|
61
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* IslandNavButtons — the resting island's leading Back / Forward pair.
|
|
4
|
+
*
|
|
5
|
+
* Both fold the SAME two axes (pushed page views and conversation turns)
|
|
6
|
+
* into one action via `useCanvasBack` / `useCanvasForward`, so neither
|
|
7
|
+
* button knows or cares which axis it is stepping.
|
|
8
|
+
*
|
|
9
|
+
* **Each is mount-gated on its own axis, independently.** A disabled-but-
|
|
10
|
+
* present arrow would be permanent dead chrome on a bar this narrow — and
|
|
11
|
+
* Forward is empty far more often than not (it only fills after a Back).
|
|
12
|
+
* Gating the mount instead means the row carries exactly the moves that
|
|
13
|
+
* are actually available: nothing at the start of a session, Back alone
|
|
14
|
+
* once there's history, both only while the visitor is mid-history.
|
|
15
|
+
*
|
|
16
|
+
* They live in one component rather than inline in `IslandInputBar` so the
|
|
17
|
+
* two nav hooks sit with the chrome they drive, and the pair can never
|
|
18
|
+
* drift apart in size or spacing.
|
|
19
|
+
*/
|
|
20
|
+
export declare function IslandNavButtons(): React.ReactElement | null;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* IslandTrailingAction — the input row's one trailing slot, three mutually
|
|
4
|
+
* exclusive states:
|
|
5
|
+
* - Send — there's a draft (or a ready attachment) to send.
|
|
6
|
+
* - Stop — a turn is streaming and the visitor hasn't queued a fresh
|
|
7
|
+
* draft (`session.abortGeneration()` — the same visitor-cancel
|
|
8
|
+
* path the desktop Composer's Send→Stop morph uses).
|
|
9
|
+
* - Voice — idle, nothing to send: speak the ask instead of typing it.
|
|
10
|
+
*
|
|
11
|
+
* All three are the SAME slot because they are the same intent: commit this
|
|
12
|
+
* ask. Speaking is just the other way to author one, so it costs no extra
|
|
13
|
+
* control — the slot simply shows whichever commit is available. (Voice used
|
|
14
|
+
* to sit at the head of the row as permanent chrome, and a separate chevron
|
|
15
|
+
* trailed it to raise the sheet; the chevron is gone because the grab handle
|
|
16
|
+
* directly above already owns that, by drag or by tap.)
|
|
17
|
+
*
|
|
18
|
+
* Exactly one state is ever mounted; the caller (`IslandInputBar`) owns
|
|
19
|
+
* deciding which.
|
|
20
|
+
*/
|
|
21
|
+
export type IslandTrailingActionState = {
|
|
22
|
+
kind: 'send';
|
|
23
|
+
onSend: () => void;
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'stop';
|
|
26
|
+
onStop: () => void;
|
|
27
|
+
} | {
|
|
28
|
+
kind: 'voice';
|
|
29
|
+
onSpeak: () => void;
|
|
30
|
+
label: string;
|
|
31
|
+
};
|
|
32
|
+
export declare function IslandTrailingAction({ state }: {
|
|
33
|
+
state: IslandTrailingActionState;
|
|
34
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface MobileChromeProps {
|
|
3
|
+
/** Brand mark (logo) — pinned left. Resolved node. */
|
|
4
|
+
logo?: React.ReactNode;
|
|
5
|
+
/** Control cluster (cart / wishlist / account) — pinned right. Resolved node. */
|
|
6
|
+
launchers?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* MobileChrome — the platform's slim glass top bar for the default mobile shell.
|
|
10
|
+
* A hairline-bottomed, tokenized surface floating over the full-bleed canvas:
|
|
11
|
+
* the brand `logo` slot (`ShellMenuChrome` — corner hamburger + centred brand
|
|
12
|
+
* mark, laid out across the bar) and the `launchers` slot in its own right cell.
|
|
13
|
+
* Both cells CENTRE their content vertically, which is the bar's one alignment
|
|
14
|
+
* rule: hamburger, mark, and launcher glyphs all read as one horizontal line.
|
|
15
|
+
* Slot content must therefore stay in flow (see `LauncherDock`) — an absolutely
|
|
16
|
+
* pinned cluster opts out of that line. Purely token-driven — a brand re-skins
|
|
17
|
+
* the bar entirely through its `tokens.css`.
|
|
18
|
+
*
|
|
19
|
+
* `position: sticky` (not `fixed`) — the mobile shell uses genuine document
|
|
20
|
+
* scroll (see DefaultMobileShell's doc comment), and sticky pins during
|
|
21
|
+
* scroll of its scrolling ancestor without requiring that ancestor to be
|
|
22
|
+
* non-scrollable, unlike `fixed`. The visible surface lives on an ABSOLUTE
|
|
23
|
+
* (not sticky) child, `ChromeSurface` — see its doc for why.
|
|
24
|
+
*
|
|
25
|
+
* ELEVATION — at rest the bar sits in flow ABOVE the canvas: nothing is behind
|
|
26
|
+
* it, so it needs no lift and stays flat (a shadow with nothing under it is
|
|
27
|
+
* just grime on the page). The moment the document scrolls, canvas content
|
|
28
|
+
* starts passing beneath it, and a flat bar with only a hairline reads as the
|
|
29
|
+
* content JAMMING into the chrome — a headline sliced mid-glyph with no
|
|
30
|
+
* separation. So the bar earns a lift exactly while there's something under
|
|
31
|
+
* it to lift off: `data-scrolled` flips at the first pixel of scroll. Same
|
|
32
|
+
* shape as every storefront header, babysense's own included.
|
|
33
|
+
*/
|
|
34
|
+
export declare function MobileChrome({ logo, launchers }: MobileChromeProps): React.ReactElement;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface MobileVoiceConsoleProps {
|
|
3
|
+
/** Resting-bar placeholder (agent nudge falls back to this). */
|
|
4
|
+
placeholder: string;
|
|
5
|
+
/** Brand-authored example prompts the resting island CYCLES through before
|
|
6
|
+
* the agent has a rotation of its own — the first screen is exactly where
|
|
7
|
+
* a live rotation earns its keep, and the agent's own examples do not
|
|
8
|
+
* exist until a turn has ended. Omit for a single static placeholder. */
|
|
9
|
+
placeholderExamples?: readonly string[];
|
|
10
|
+
/** The full conversation surface (the brand's Composer + thread history) for the
|
|
11
|
+
* morphed sheet face. Receives `close` so a nav / send inside it can collapse
|
|
12
|
+
* the surface. Slot-driven — the platform console never imports a brand thread. */
|
|
13
|
+
historySheet: (close: () => void) => React.ReactNode;
|
|
14
|
+
/** Reports the island face's live measured height — see `MorphIsland`'s prop
|
|
15
|
+
* of the same name. Threaded straight through so the shell can size the
|
|
16
|
+
* canvas's bottom clearance to it. */
|
|
17
|
+
onIslandHeightChange?: (height: number) => void;
|
|
18
|
+
/** True when this console is MOUNTING because a brand hero just handed the
|
|
19
|
+
* entry point back — the island rises into place rather than being there.
|
|
20
|
+
* See `MorphIsland`'s prop of the same name. */
|
|
21
|
+
enterFromFloor?: boolean;
|
|
22
|
+
/** The brand's mark for the collapsed pill — threaded straight through to
|
|
23
|
+
* `MorphIsland`, which documents the drawing contract. */
|
|
24
|
+
collapsedMark?: React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* MobileVoiceConsole — the single bottom surface, voice-first. ONE entity is both
|
|
28
|
+
* the resting island AND the conversation sheet: `MorphIsland` morphs continuously
|
|
29
|
+
* between them as its grip is dragged (no separate modal). This console only routes
|
|
30
|
+
* the three top-level states around it:
|
|
31
|
+
* • rest — the `MorphIsland` (island ⇄ sheet), the default.
|
|
32
|
+
* • listening — the live `VoiceIsland` (waveform + transcript, auto-submits).
|
|
33
|
+
* • folded — reading down the canvas condenses the island, in place, to a
|
|
34
|
+
* small pill holding its own glyph. It stays that way until the
|
|
35
|
+
* visitor asks it back: a tap on the pill, or a scroll home to
|
|
36
|
+
* the top.
|
|
37
|
+
*
|
|
38
|
+
* Platform infra, fully tokenized — a brand re-skins it (rounded navy vs square
|
|
39
|
+
* dark) purely through its `tokens.css`, and supplies its own conversation surface
|
|
40
|
+
* through the `historySheet` slot.
|
|
41
|
+
*/
|
|
42
|
+
export declare function MobileVoiceConsole({ placeholder, placeholderExamples, historySheet, onIslandHeightChange, enterFromFloor, collapsedMark }: MobileVoiceConsoleProps): React.ReactElement;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ComposerAttachmentsApi } from '../composer/useComposerAttachments';
|
|
3
|
+
export interface MorphIslandHandle {
|
|
4
|
+
open: () => void;
|
|
5
|
+
close: () => void;
|
|
6
|
+
}
|
|
7
|
+
export interface MorphIslandProps {
|
|
8
|
+
placeholder: string;
|
|
9
|
+
/** Brand-authored example prompts the resting island CYCLES through before
|
|
10
|
+
* the agent has a rotation of its own — the first screen is exactly where
|
|
11
|
+
* a live rotation earns its keep, and the agent's own examples do not
|
|
12
|
+
* exist until a turn has ended. Omit for a single static placeholder. */
|
|
13
|
+
placeholderExamples?: readonly string[];
|
|
14
|
+
attachments: ComposerAttachmentsApi;
|
|
15
|
+
onSpeak: () => void;
|
|
16
|
+
/** True while the island should sit COLLAPSED — the visitor is actively
|
|
17
|
+
* scrolling the canvas and reading, so the bar gets out of the way rather
|
|
18
|
+
* than competing for attention, and comes back the moment they scroll up,
|
|
19
|
+
* reach the top, or tap it (see `MobileVoiceConsole`).
|
|
20
|
+
*
|
|
21
|
+
* Collapsing CONDENSES the surface in place, to a small pill
|
|
22
|
+
* (`ISLAND_COLLAPSED_W` × `ISLAND_COLLAPSED_H`) centred at the island's own
|
|
23
|
+
* dock. It does not travel: the two earlier designs both moved it out of
|
|
24
|
+
* sight — first a fade to nothing, then a sink to a 10px sliver at the
|
|
25
|
+
* screen's bottom edge — and both left the visitor with nothing they could
|
|
26
|
+
* reliably find or reach for. The pill stays where the island was, so there
|
|
27
|
+
* is ONE body on screen the whole time and it never has to reappear from
|
|
28
|
+
* anywhere.
|
|
29
|
+
*
|
|
30
|
+
* The surface stays mounted throughout, and every property that moves
|
|
31
|
+
* (width, height, radius, the faces' opacity) is driven off the one
|
|
32
|
+
* `foldT` value — so the condense and the expand are the same move, run
|
|
33
|
+
* in opposite directions. */
|
|
34
|
+
folded: boolean;
|
|
35
|
+
/** The resting gap between the island and the VISIBLE floor, in px — the
|
|
36
|
+
* `bottomOffset` MINUS the browser-chrome inset baked into it. The ARRIVAL
|
|
37
|
+
* (`enterFromFloor`) rises from the visible floor, not the layout
|
|
38
|
+
* viewport's: starting from the full offset would launch the island from
|
|
39
|
+
* under the browser toolbar, which is the exact hazard `bottomOffset` exists
|
|
40
|
+
* to clear. */
|
|
41
|
+
restGapPx: number;
|
|
42
|
+
/** Tapped the collapsed pill — the visitor is reaching for the island, so
|
|
43
|
+
* bring it back and hold it there (the console owns the reprieve). */
|
|
44
|
+
onSummon?: () => void;
|
|
45
|
+
/** The full conversation surface (the brand's Composer + thread history),
|
|
46
|
+
* mounted in the sheet face. Receives `close` so a nav / send inside it can
|
|
47
|
+
* collapse the surface back to the island. Slot-driven so this platform
|
|
48
|
+
* surface never imports a brand's thread/composer directly. */
|
|
49
|
+
historySheet: (close: () => void) => React.ReactNode;
|
|
50
|
+
/** CSS length for the surface's distance from the shell bottom — clears the
|
|
51
|
+
* safe area + the browser toolbar, so the input never hides behind the URL bar
|
|
52
|
+
* at any morph progress. */
|
|
53
|
+
bottomOffset: string;
|
|
54
|
+
/** Rise from below the floor on mount instead of simply being there — the
|
|
55
|
+
* island ARRIVING after a brand hero handed the entry point back, rather
|
|
56
|
+
* than the island that has been docked since first paint. See
|
|
57
|
+
* `ISLAND_ENTER_SPRING` and `hero-entry-point.tsx`. */
|
|
58
|
+
enterFromFloor?: boolean;
|
|
59
|
+
/** True when the OPEN sheet should sit FLUSH on the screen bottom (native
|
|
60
|
+
* bottom-sheet anchoring) instead of floating at `bottomOffset` — the rest
|
|
61
|
+
* island keeps floating either way. The console passes `false` while the
|
|
62
|
+
* keyboard is up (the sheet then rides above the keys, never the floor). */
|
|
63
|
+
sheetFlush: boolean;
|
|
64
|
+
/** Notifies the shell when the surface crosses into / out of the sheet state,
|
|
65
|
+
* so it can drop the folding/scroll logic while the sheet is open. */
|
|
66
|
+
onOpenChange?: (open: boolean) => void;
|
|
67
|
+
/** Reports the island face's live measured height (read + chips + input,
|
|
68
|
+
* auto-wrapped) so the shell can reserve exactly that much canvas
|
|
69
|
+
* clearance — a composing island carrying follow-up chips is taller than
|
|
70
|
+
* the single-line rest state, and a static clearance would let it overlap
|
|
71
|
+
* the canvas beneath it. */
|
|
72
|
+
onIslandHeightChange?: (height: number) => void;
|
|
73
|
+
/** The resting bar's compose field gained or lost focus — threaded straight
|
|
74
|
+
* through from `RestIsland` so the console can veto the fold while the
|
|
75
|
+
* visitor is typing. */
|
|
76
|
+
onComposeFocusChange?: (focused: boolean) => void;
|
|
77
|
+
/** The mark the pill carries once it has condensed. Slot-driven because the
|
|
78
|
+
* best answer is brand-owned: Babysense passes its own lowercase b, which
|
|
79
|
+
* says whose assistant this is in a way no platform glyph can. Omit for
|
|
80
|
+
* `DEFAULT_COLLAPSED_MARK`.
|
|
81
|
+
*
|
|
82
|
+
* Draw it as an SVG at 20 x 20 on a 24-unit box, stroked at 1.75 with round
|
|
83
|
+
* caps, so it sits at the same optical weight as the bar's own chrome. Leave
|
|
84
|
+
* the stroke as `currentColor` — the surface repaints it (see
|
|
85
|
+
* `--fourty-island-collapsed-paint`), which is what lets the nacre sweep run
|
|
86
|
+
* through a mark the platform has never seen. */
|
|
87
|
+
collapsedMark?: React.ReactNode;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* MorphIsland — ONE surface that IS both the resting island and the conversation
|
|
91
|
+
* sheet; dragging its grip morphs continuously between them (no separate modal).
|
|
92
|
+
*
|
|
93
|
+
* A single `progress` motion value (0 = island, 1 = full sheet) is driven 1:1 by
|
|
94
|
+
* a pan on the top grip and snaps to an end on release. Everything the eye reads
|
|
95
|
+
* as "the island becoming the sheet" is a transform of that one value:
|
|
96
|
+
* • the surface grows in HEIGHT (bottom-pinned so the input never leaves screen)
|
|
97
|
+
* • it WIDENS from the centred island card to full-bleed (shrinking side inset)
|
|
98
|
+
* • its INK slab lifts (a dark overlay fades) to the surface sheet
|
|
99
|
+
* • the island face (read + input) crossfades out; the thread + composer in
|
|
100
|
+
* • a scrim dims the canvas behind it
|
|
101
|
+
* The same entity throughout — never unmounted and swapped for a modal. The slab
|
|
102
|
+
* radius (`--fourty-island-radius`, default 0), lift shadow, and scrim colour are
|
|
103
|
+
* all tokens, so a brand re-skins the whole morph purely through its `tokens.css`.
|
|
104
|
+
*/
|
|
105
|
+
export declare const MorphIsland: React.ForwardRefExoticComponent<MorphIslandProps & React.RefAttributes<MorphIslandHandle>>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SuggestionAction } from '@40rty/ams-sdk';
|
|
3
|
+
import { type ComposerAttachmentsApi } from '../composer/useComposerAttachments';
|
|
4
|
+
/**
|
|
5
|
+
* RestIsland — the island FACE of the morph surface. The resting island NEVER
|
|
6
|
+
* expands for a running turn — it's the same single-line footprint idle or
|
|
7
|
+
* mid-turn. While the agent works, the notch (`AgentPresenceWidget`'s compact
|
|
8
|
+
* mobile face — the same scanning deck / live read the desktop presence band
|
|
9
|
+
* uses) TEMPORARILY REPLACES the whole voice+field+attach group; only the
|
|
10
|
+
* trailing action survives, swapped to Stop (`session.abortGeneration()`,
|
|
11
|
+
* the same visitor-cancel path the desktop Composer's Send→Stop morph
|
|
12
|
+
* already uses). One row, always — never a second block stacked above it.
|
|
13
|
+
* Presentational + size-passive otherwise: the host `MorphIsland` owns the
|
|
14
|
+
* slab, width, drag, and eases the height (auto-wrap → nothing clips).
|
|
15
|
+
*
|
|
16
|
+
* The follow-up chip rail is the one thing that still blooms in — but only
|
|
17
|
+
* while COMPOSING (focus-gated), never while a turn runs.
|
|
18
|
+
*
|
|
19
|
+
* Knowledge (dossier) chips STAND at rest (`PresenceBriefRail`) — one scrolling
|
|
20
|
+
* row of every constraint the agent holds, each dismissible. They used to peek
|
|
21
|
+
* for 4.2s after a turn settled and fold away; a surface whose whole claim is
|
|
22
|
+
* "I know these things about you" cannot erase that claim on a timer, and on a
|
|
23
|
+
* phone there is no drawer to move it to, so this row IS the brief.
|
|
24
|
+
*
|
|
25
|
+
* Staged attachments sit between the chip rail and the input bar, ungated —
|
|
26
|
+
* see the strip's own comment for why focus-gating them would be wrong.
|
|
27
|
+
*/
|
|
28
|
+
export declare function RestIsland({ onSpeak, attachments, onChipSelect, placeholder, placeholderExamples, onComposeFocusChange, }: {
|
|
29
|
+
onSpeak: () => void;
|
|
30
|
+
attachments: ComposerAttachmentsApi;
|
|
31
|
+
onChipSelect: (action: SuggestionAction) => void;
|
|
32
|
+
placeholder: string;
|
|
33
|
+
/** Brand-authored example prompts that CYCLE in the field before the agent
|
|
34
|
+
* has a rotation of its own. See `useComposerPlaceholder`'s `seed`. */
|
|
35
|
+
placeholderExamples?: readonly string[];
|
|
36
|
+
/** Reports the compose field's focus, already debounced through the blur
|
|
37
|
+
* delay below. The shell vetoes the fold on it — an island being typed
|
|
38
|
+
* into may not sink out from under the visitor. Same signal, two readers:
|
|
39
|
+
* the chip rail here, the fold gate two levels up. */
|
|
40
|
+
onComposeFocusChange?: (focused: boolean) => void;
|
|
41
|
+
}): React.ReactElement;
|