@40rty/ams-ui 0.5.14 → 0.5.15

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.
@@ -18,3 +18,4 @@
18
18
  --fourty-convo-sheet-radius: var(--radius-card);
19
19
  --fourty-convo-composer-radius: var(--radius-input);
20
20
  }
21
+
@@ -1,11 +1,12 @@
1
1
  import * as React from 'react';
2
- import { type CanvasMotionStyle } from '@40rty/ams-sdk';
2
+ import { type CanvasLeadRule, type CanvasMotionStyle } from '@40rty/ams-sdk';
3
3
  /**
4
4
  * The conversation page's canvas: each turn opens with its own header (where
5
5
  * the visitor is, what the agent knows, their words, the answer), then the
6
6
  * blocks as a bento, one page per turn. A shell passes it as `canvas` and
7
7
  * `PageComposer` as `canvasComposer` to `ShellScaffold`.
8
8
  */
9
- export declare function ConversationCanvas({ motion }: {
9
+ export declare function ConversationCanvas({ motion, lead }: {
10
10
  motion?: CanvasMotionStyle;
11
+ lead?: CanvasLeadRule;
11
12
  }): React.ReactElement;
@@ -9,7 +9,8 @@ export declare const PAGE_COMPOSER_INPUT_ID = "fourty-page-composer";
9
9
  * `followUpsInPage`: the shell draws a turn's follow-ups in the page itself,
10
10
  * under the answer (`useConversationPage().followUps`), so the composer shows
11
11
  * chips only on the welcome page (its starters) — never a second set over the
12
- * answer. Without it the composer carries the follow-ups.
12
+ * answer. The kit's `TurnHeader` draws them and says so (`follow-ups-place`),
13
+ * so under it this holds without the prop. Otherwise the composer carries them.
13
14
  */
14
15
  export declare function PageComposer({ placeholder, starters, followUpsInPage }: {
15
16
  placeholder: string;
@@ -2,8 +2,15 @@ import * as React from 'react';
2
2
  /**
3
3
  * The top of a conversation turn page — where the visitor is in the conversation
4
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.
5
+ * words, and the answer. The agent's presence lives here too: while it works, a
6
+ * thinking row stands in for the answer. Hidden on the welcome page.
7
+ *
8
+ * ONE layout for every answer: the answer in a narrow column from the first
9
+ * frame, the page's lead block (`CanvasLeadSlot` — the first block the turn
10
+ * placed, when `ConversationCanvas` lets its type lead) landing beside it once
11
+ * the answer's words are out — words first, then the show. A page with no lead
12
+ * (a full product page below) keeps the same column, the rest of the answer
13
+ * taking the side, so nothing reflows when the turn settles. Below 880px the
14
+ * call comes first, its block right under it, then why and the question.
8
15
  */
9
16
  export declare function TurnHeader(): React.ReactElement | null;
@@ -0,0 +1,4 @@
1
+ /** For a turn header: it draws the follow-ups under the answer for as long as it is mounted. */
2
+ export declare function useDrawFollowUpsInPage(): void;
3
+ /** For a composer: whether the page draws the follow-ups, so it must not. */
4
+ export declare function useFollowUpsDrawnInPage(): boolean;
@@ -4,7 +4,7 @@ export { TurnHeader } from './TurnHeader';
4
4
  export { ResultSheet } from './ResultSheet';
5
5
  export { TurnCanvas } from './TurnCanvas';
6
6
  export { ClosingQuestion } from './ClosingQuestion';
7
- export { Facts, ThinkingBand, BentoSkeleton } from './presence-parts';
7
+ export { Facts, ThinkingBand, ThinkingLine, ReadingRow, useTurnScan, BentoSkeleton } from './presence-parts';
8
8
  export { Rich, RisingWords, crumbLabel, productNamed, wordsSettleInMs } from './turn-text';
9
9
  export { useActivityLine } from './activity-line';
10
10
  export { usePageProducts } from './use-page-products';
@@ -1,12 +1,40 @@
1
1
  import * as React from 'react';
2
- import { type ConversationFact } from '@40rty/ams-sdk';
2
+ import { type ConversationFact, type ScanningState } from '@40rty/ams-sdk';
3
3
  export declare const EASE: [number, number, number, number];
4
4
  /** What the agent knows; with `onForget`, each fact can be cleared (and all of them at once). */
5
5
  export declare function Facts({ facts, onForget }: {
6
6
  facts: ConversationFact[];
7
7
  onForget?: (fact: ConversationFact) => void;
8
8
  }): React.ReactElement;
9
- /** The agent at work, in the page: what it knows, what it is doing, what it is reading. */
9
+ /**
10
+ * What the agent looked through this turn — its thumbnails and a count. A row
11
+ * of one fixed height from the turn's first frame to its last: it stands above
12
+ * the thought while the agent works and stays above the answer as its
13
+ * provenance, so neither the thought nor the answer moves when it fills.
14
+ */
15
+ export declare function ReadingRow({ scan }: {
16
+ scan: ScanningState | null;
17
+ }): React.ReactElement;
18
+ /**
19
+ * The turn's reading, held for the whole turn: the live scan can clear when the
20
+ * turn ends, and the row must not empty under the answer it explains.
21
+ */
22
+ export declare function useTurnScan(turnKey: string | null): ScanningState | null;
23
+ /**
24
+ * The agent's thought while it works — always whole, never clipped: a streaming
25
+ * thought grows in place with its words rising in (`RisingWords`), and only a
26
+ * new thought crossfades, never sooner than it can be read (`steady-line.ts`).
27
+ * It leaves before the answer arrives, so the two never overlap.
28
+ */
29
+ export declare function ThinkingLine({ status }: {
30
+ status: string;
31
+ }): React.ReactElement;
32
+ /**
33
+ * The agent at work as one band — what it knows, what it is reading, what it
34
+ * is thinking. For a page that does not hold the reading row itself
35
+ * (`TurnHeader` places `ReadingRow` and `ThinkingLine` apart, so the row
36
+ * outlives the thought).
37
+ */
10
38
  export declare function ThinkingBand({ facts, status }: {
11
39
  facts: ConversationFact[];
12
40
  status: string;
@@ -0,0 +1,21 @@
1
+ /** How long a thought stays up before the next one may replace it — long enough to read, so the band never flickers. */
2
+ export declare const MIN_HOLD_MS = 1400;
3
+ export type LineChange = 'extend' | 'replace' | 'hold' | 'ignore';
4
+ /**
5
+ * What a new activity line does to the one on screen:
6
+ * - `extend` the same thought, streamed further — grows in place, no animation;
7
+ * - `replace` a new thought, swapped in (crossfade);
8
+ * - `hold` a new thought that arrived too soon — waits out the current one;
9
+ * - `ignore` the generic "working" line once a real one has shown — never step back to it.
10
+ */
11
+ export declare function lineChange(shown: string, next: string, generic: string, shownForMs: number): LineChange;
12
+ /**
13
+ * The agent's activity line, steadied for reading: a streaming thought grows in
14
+ * place, a new thought replaces it only after the current one has been up for
15
+ * `MIN_HOLD_MS`, and the generic line never interrupts a real one. `key` changes
16
+ * only on a replace — the one moment worth animating.
17
+ */
18
+ export declare function useSteadyLine(line: string, generic: string): {
19
+ text: string;
20
+ key: number;
21
+ };
@@ -0,0 +1,51 @@
1
+ import * as React from 'react';
2
+ import { type ConversationCrumb, type ConversationFact, type SuggestionAction, type TurnAsk } from '@40rty/ams-sdk';
3
+ export interface Crumb {
4
+ key: string;
5
+ label: string;
6
+ onClick: (() => void) | null;
7
+ }
8
+ /** The words for each step of the trail the hook lays out. */
9
+ export declare function wordCrumbs(crumbs: ConversationCrumb[], home: string, here: string): Crumb[];
10
+ export declare function Breadcrumbs({ crumbs }: {
11
+ crumbs: Crumb[];
12
+ }): React.ReactElement;
13
+ /**
14
+ * The turn, folded: shown while the visitor is on another page. Their
15
+ * question and the agent's headline sit on one line; opening it shows the
16
+ * whole answer text.
17
+ */
18
+ export declare function CollapsedTurn({ trail, question, headline, body, right }: {
19
+ trail: Crumb[];
20
+ question: string;
21
+ headline: string;
22
+ body: string;
23
+ right: React.ReactNode;
24
+ }): React.ReactElement;
25
+ /** The lead's place while its page is written: a heading and three cards, the shape most leads take. */
26
+ export declare function LeadReserve(): React.ReactElement;
27
+ /** The agent's next moves for this answer, under it — on the page, never over the composer. */
28
+ export declare function FollowUps({ actions, onTake }: {
29
+ actions: SuggestionAction[];
30
+ onTake: (action: SuggestionAction) => void;
31
+ }): React.ReactElement;
32
+ /** What the agent knows, as one line of pills beside the way back — each dropped by its own ×. */
33
+ export declare function FactPills({ facts, onForget }: {
34
+ facts: ConversationFact[];
35
+ onForget: (fact: ConversationFact) => void;
36
+ }): React.ReactElement;
37
+ /** Start over, as a quiet round icon at the end of the trail; its name is the tooltip and the accessible label. */
38
+ export declare function StartOverButton({ label, onClick }: {
39
+ label: string;
40
+ onClick: () => void;
41
+ }): React.ReactElement;
42
+ /**
43
+ * The question the answer closes on, at body size so the headline stays the
44
+ * page's one loud line. A choice's answers are the words to tap, underlined in
45
+ * the brand's highlight.
46
+ */
47
+ export declare function AskLine({ ask, answerable, onReply }: {
48
+ ask: TurnAsk;
49
+ answerable: boolean;
50
+ onReply: (answer: string) => void;
51
+ }): React.ReactElement;
@@ -23,13 +23,6 @@ export declare function Rich({ text, products }: {
23
23
  * turn's lead block, landing after the answer that names it) waits this long.
24
24
  */
25
25
  export declare function wordsSettleInMs(): number;
26
- /**
27
- * Text whose words rise into place out of a blur, one after another — the
28
- * design's headline reveal. Streaming-safe: a word that was already shown
29
- * never re-animates; new words queue behind any still entering, on the
30
- * page's one cascade (`cascadeEndS`), so a stalled stream resumes in order. `**bold**` is honoured, and a bold run that names one of
31
- * `products` is a link to it.
32
- */
33
26
  export declare function RisingWords({ text, products, delayS }: {
34
27
  text: string;
35
28
  products: readonly Product[];
package/package.json CHANGED
@@ -76,12 +76,12 @@
76
76
  "zod": "^3.23.0"
77
77
  },
78
78
  "peerDependencies": {
79
- "@40rty/ams-sdk": "0.5.14",
79
+ "@40rty/ams-sdk": "0.5.15",
80
80
  "lucide-react": ">=0.400.0",
81
81
  "react": ">=18.0.0",
82
82
  "react-dom": ">=18.0.0"
83
83
  },
84
- "version": "0.5.14",
84
+ "version": "0.5.15",
85
85
  "homepage": "https://docs.40rty.ai",
86
86
  "license": "UNLICENSED",
87
87
  "engines": {