@40rty/ams-ui 0.5.3 → 0.5.4
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/types/conversation/ClosingQuestion.d.ts +13 -0
- package/dist/types/conversation/ConversationCanvas.d.ts +11 -0
- package/dist/types/conversation/PageComposer.d.ts +12 -0
- package/dist/types/conversation/ResultSheet.d.ts +9 -0
- package/dist/types/conversation/TurnCanvas.d.ts +12 -0
- package/dist/types/conversation/TurnHeader.d.ts +9 -0
- package/dist/types/conversation/activity-line.d.ts +3 -0
- package/dist/types/conversation/blocks/ProductTile.d.ts +31 -0
- package/dist/types/conversation/blocks/blocks.d.ts +27 -0
- package/dist/types/conversation/blocks/index.d.ts +7 -0
- package/dist/types/conversation/blocks/product-blocks.d.ts +3 -0
- package/dist/types/conversation/blocks/schemas.d.ts +4322 -0
- package/dist/types/conversation/index.d.ts +11 -0
- package/dist/types/conversation/presence-parts.d.ts +15 -0
- package/dist/types/conversation/turn-text.d.ts +31 -0
- package/dist/types/conversation/use-page-products.d.ts +3 -0
- package/package.json +2 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type TurnAsk } from '@40rty/ams-sdk';
|
|
3
|
+
/**
|
|
4
|
+
* The question the agent closed its answer on, set as the answer's last line:
|
|
5
|
+
* larger, in ink, with the design's arrow. A `choice` question's answers are
|
|
6
|
+
* the words to tap, in place in the sentence — tapping one replies with it.
|
|
7
|
+
* Only the newest settled turn's answers can be tapped.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ClosingQuestion({ ask, answerable, onReply }: {
|
|
10
|
+
ask: TurnAsk;
|
|
11
|
+
answerable: boolean;
|
|
12
|
+
onReply: (answer: string) => void;
|
|
13
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type CanvasMotionStyle } from '@40rty/ams-sdk';
|
|
3
|
+
/**
|
|
4
|
+
* The conversation page's canvas: each turn opens with its own header (where
|
|
5
|
+
* the visitor is, what the agent knows, their words, the answer), then the
|
|
6
|
+
* blocks as a bento, one page per turn. A shell passes it as `canvas` and
|
|
7
|
+
* `PageComposer` as `canvasComposer` to `ShellScaffold`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ConversationCanvas({ motion }: {
|
|
10
|
+
motion?: CanvasMotionStyle;
|
|
11
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/** Id of the page's input (its label target; tests find it by it). */
|
|
3
|
+
export declare const PAGE_COMPOSER_INPUT_ID = "fourty-page-composer";
|
|
4
|
+
/**
|
|
5
|
+
* The conversation page's prompt input, IN the page: the agent's follow-up chips over
|
|
6
|
+
* one bar pinned to the bottom of the canvas. While the agent works, the bar
|
|
7
|
+
* reads what it is doing instead of taking input.
|
|
8
|
+
*/
|
|
9
|
+
export declare function PageComposer({ placeholder, starters }: {
|
|
10
|
+
placeholder: string;
|
|
11
|
+
starters: string[];
|
|
12
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The agent's result page: one sheet holding the answer's header, its blocks
|
|
4
|
+
* and its closing question. The welcome page is the brand's own page, so the
|
|
5
|
+
* sheet is there only while a turn's page is on screen.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ResultSheet({ children }: {
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The canvas under a turn. Once the visitor has asked something, the welcome
|
|
4
|
+
* page's sections are not part of the answer: while the canvas still holds the
|
|
5
|
+
* untouched welcome layout it stands aside, so the turn's header is the whole
|
|
6
|
+
* page. While a new turn works, the page stays sharp and in place — the
|
|
7
|
+
* answer may change it rather than replace it. It stays mounted — the engine
|
|
8
|
+
* keeps its state and scroll.
|
|
9
|
+
*/
|
|
10
|
+
export declare function TurnCanvas({ children }: {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The top of a conversation turn page — where the visitor is in the conversation
|
|
4
|
+
* (crumbs back through every turn), what the agent knows, the visitor's own
|
|
5
|
+
* words, and the answer set as the page's headline. The agent's presence
|
|
6
|
+
* lives here too: while it works, a thinking row stands in for the answer.
|
|
7
|
+
* Hidden on the welcome page.
|
|
8
|
+
*/
|
|
9
|
+
export declare function TurnHeader(): React.ReactElement | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Product } from '@40rty/ams-sdk';
|
|
3
|
+
/** What a block hands the brand's tile beside the product: a corner badge, a one-line note. */
|
|
4
|
+
export interface ConversationTileProps {
|
|
5
|
+
product: Product;
|
|
6
|
+
badge?: string;
|
|
7
|
+
blurb?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function ConversationProvider({ tile, children }: {
|
|
10
|
+
tile: React.ComponentType<ConversationTileProps>;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}): React.ReactElement;
|
|
13
|
+
/**
|
|
14
|
+
* The block's products with a reserved slot (`null`) for every ref still
|
|
15
|
+
* resolving — the platform's reserve-and-reveal count — so a block is its
|
|
16
|
+
* final size from the frame it lands and each tile fills in place.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useReserved<T>(items: T[]): Array<T | null>;
|
|
19
|
+
/** A product in a block, drawn by the brand's tile. Each tile is its own container. */
|
|
20
|
+
export declare function ProductTile(props: ConversationTileProps): React.ReactElement;
|
|
21
|
+
/** A tile's footprint while its product resolves. */
|
|
22
|
+
export declare function TileReserve({ blurb }: {
|
|
23
|
+
blurb?: string;
|
|
24
|
+
}): React.ReactElement;
|
|
25
|
+
/**
|
|
26
|
+
* Whether a product list has landed: true from the first render where no slot
|
|
27
|
+
* was still reserved, and it stays true. Reserved tiles are for the first
|
|
28
|
+
* load only — after it, a block stays on the platform's item engine, so a
|
|
29
|
+
* swap or edit (which re-resolves the list) animates instead of remounting.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useLanded(reserved: boolean): boolean;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const PILL_SOLID = "inline-flex h-12 min-h-12 items-center justify-center whitespace-nowrap rounded-[var(--fourty-convo-radius)] [text-transform:var(--fourty-convo-button-transform)] px-5 text-sm font-medium leading-5 cursor-pointer [transition:background-color_0.3s,color_0.3s,border-color_0.3s,opacity_0.3s] border border-[var(--fourty-convo-ink)] bg-[var(--fourty-convo-ink)] text-[var(--fourty-convo-sheet)] hover:bg-[var(--fourty-convo-sheet)] hover:text-[var(--fourty-convo-ink)] disabled:cursor-default disabled:opacity-40";
|
|
3
|
+
export declare const PILL_OUTLINE = "inline-flex h-12 min-h-12 items-center justify-center whitespace-nowrap rounded-[var(--fourty-convo-radius)] [text-transform:var(--fourty-convo-button-transform)] px-5 text-sm font-medium leading-5 cursor-pointer [transition:background-color_0.3s,color_0.3s,border-color_0.3s,opacity_0.3s] border border-current bg-transparent text-current hover:border-[var(--fourty-convo-ink)] hover:bg-[var(--fourty-convo-ink)] hover:text-[var(--fourty-convo-sheet)]";
|
|
4
|
+
/**
|
|
5
|
+
* A product feed inside a block: tiles run edge to edge across the sheet,
|
|
6
|
+
* three across, split by hairlines — the grid breaks out of the card's
|
|
7
|
+
* padding to the sheet's edges.
|
|
8
|
+
*/
|
|
9
|
+
export declare const FEED_GRID = "-mx-8 -mb-8 grid grid-cols-3 gap-px overflow-hidden bg-[var(--fourty-convo-rule)] @max-[900px]:grid-cols-2 @max-[560px]:grid-cols-1 max-[1025px]:-mx-4 max-[1025px]:-mb-4 [&>*]:bg-[var(--fourty-convo-sheet)]";
|
|
10
|
+
export type CardTone = 'plain' | 'highlight' | 'accent';
|
|
11
|
+
export declare function Card({ children, tone }: {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
tone?: CardTone;
|
|
14
|
+
}): React.ReactElement;
|
|
15
|
+
/** A block's small label — muted in whatever ink the card carries. */
|
|
16
|
+
export declare function Eyebrow({ children }: {
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}): React.ReactElement;
|
|
19
|
+
/** A block's heading: 32px bold, 24px where the block is narrow. */
|
|
20
|
+
export declare function Title({ children }: {
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
}): React.ReactElement;
|
|
23
|
+
export declare const guidedPick: import("@40rty/ams-sdk").CatalogComponent;
|
|
24
|
+
export declare const paths: import("@40rty/ams-sdk").CatalogComponent;
|
|
25
|
+
export declare const note: import("@40rty/ams-sdk").CatalogComponent;
|
|
26
|
+
export declare const facts: import("@40rty/ams-sdk").CatalogComponent;
|
|
27
|
+
export declare const explain: import("@40rty/ams-sdk").CatalogComponent;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { explain, facts, guidedPick, note, paths } from './blocks';
|
|
2
|
+
import { shortlist, tradeoff, verdict } from './product-blocks';
|
|
3
|
+
export { explain, facts, guidedPick, note, paths, shortlist, tradeoff, verdict };
|
|
4
|
+
export { Card, Eyebrow, Title, PILL_SOLID, PILL_OUTLINE, FEED_GRID, type CardTone } from './blocks';
|
|
5
|
+
export { ConversationProvider, ProductTile, TileReserve, useReserved, useLanded, type ConversationTileProps } from './ProductTile';
|
|
6
|
+
/** Every shared reasoning block, for a brand to spread into its declarations (or pick from). */
|
|
7
|
+
export declare const conversationBlocks: import("@40rty/ams-sdk").CatalogComponent[];
|