@swisper.ai/web-chat-ui 0.1.0 → 0.2.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/README.md +2 -5
- package/dist/components/chat-card/chat-card.stories.d.ts.map +1 -1
- package/dist/components/chat-card-container/chat-card-container.stories.d.ts.map +1 -1
- package/dist/components/rich-text-field/rich-text-field.stories.d.ts.map +1 -1
- package/dist/components/rich-text-field/utils.d.ts +36 -36
- package/dist/index.css +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +1566 -1810
- package/dist/index.es.js.map +1 -1
- package/package.json +4 -4
- package/src/components/chat-card/chat-card.json +6 -6
- package/src/components/chat-card/chat-card.stories.tsx +6 -14
- package/src/components/chat-card/components/chat-card-body.tsx +1 -1
- package/src/components/chat-card-container/chat-card-container.json +6 -6
- package/src/components/chat-card-container/chat-card-container.stories.tsx +10 -18
- package/src/components/chat-container/chat-container.json +1 -1
- package/src/components/chat-list/chat-list-items.tsx +3 -3
- package/src/components/rich-text-field/rich-text-field.stories.tsx +3 -1
- package/src/index.ts +0 -1
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.d.ts +0 -97
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.d.ts.map +0 -1
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.stories.d.ts +0 -52
- package/dist/layouts/chat-card-list-layout/chat-card-list-layout.stories.d.ts.map +0 -1
- package/dist/layouts/chat-card-list-layout/index.d.ts +0 -3
- package/dist/layouts/chat-card-list-layout/index.d.ts.map +0 -1
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.d.ts +0 -89
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.d.ts.map +0 -1
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.d.ts +0 -44
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.d.ts.map +0 -1
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts +0 -62
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts.map +0 -1
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.d.ts +0 -81
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.d.ts.map +0 -1
- package/dist/layouts/chat-card-three-column-layout/index.d.ts +0 -5
- package/dist/layouts/chat-card-three-column-layout/index.d.ts.map +0 -1
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.d.ts +0 -37
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.d.ts.map +0 -1
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.sizing.d.ts +0 -12
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.sizing.d.ts.map +0 -1
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.d.ts +0 -40
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.d.ts.map +0 -1
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.variants.d.ts +0 -35
- package/dist/layouts/chat-card-two-column-layout/chat-card-two-column-layout.variants.d.ts.map +0 -1
- package/dist/layouts/chat-card-two-column-layout/index.d.ts +0 -4
- package/dist/layouts/chat-card-two-column-layout/index.d.ts.map +0 -1
- package/dist/layouts/index.d.ts +0 -4
- package/dist/layouts/index.d.ts.map +0 -1
- package/src/layouts/chat-card-list-layout/__stories__/fixtures.ts +0 -112
- package/src/layouts/chat-card-list-layout/__stories__/result-card.tsx +0 -36
- package/src/layouts/chat-card-list-layout/__stories__/types.ts +0 -31
- package/src/layouts/chat-card-list-layout/__tests__/chat-card-list-layout.spec.tsx +0 -204
- package/src/layouts/chat-card-list-layout/chat-card-list-layout.json +0 -129
- package/src/layouts/chat-card-list-layout/chat-card-list-layout.stories.tsx +0 -422
- package/src/layouts/chat-card-list-layout/chat-card-list-layout.tsx +0 -254
- package/src/layouts/chat-card-list-layout/index.ts +0 -11
- package/src/layouts/chat-card-three-column-layout/__stories__/fixtures.ts +0 -117
- package/src/layouts/chat-card-three-column-layout/__stories__/resizable-chat-window.tsx +0 -18
- package/src/layouts/chat-card-three-column-layout/__stories__/stay-details.tsx +0 -85
- package/src/layouts/chat-card-three-column-layout/__stories__/stay-list.tsx +0 -47
- package/src/layouts/chat-card-three-column-layout/__stories__/stay-map.tsx +0 -44
- package/src/layouts/chat-card-three-column-layout/__stories__/stay-rooms.tsx +0 -61
- package/src/layouts/chat-card-three-column-layout/__stories__/types.ts +0 -35
- package/src/layouts/chat-card-three-column-layout/__tests__/chat-card-three-column-layout.sizing.test.ts +0 -71
- package/src/layouts/chat-card-three-column-layout/__tests__/chat-card-three-column-layout.spec.tsx +0 -327
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.json +0 -153
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.ts +0 -76
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.tsx +0 -658
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.tsx +0 -293
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.ts +0 -146
- package/src/layouts/chat-card-three-column-layout/index.ts +0 -24
- package/src/layouts/chat-card-two-column-layout/__stories__/connection-itinerary.tsx +0 -51
- package/src/layouts/chat-card-two-column-layout/__stories__/fixtures.ts +0 -83
- package/src/layouts/chat-card-two-column-layout/__stories__/route-map.tsx +0 -24
- package/src/layouts/chat-card-two-column-layout/__stories__/types.ts +0 -15
- package/src/layouts/chat-card-two-column-layout/__tests__/chat-card-two-column-layout.spec.tsx +0 -109
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.json +0 -109
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.sizing.ts +0 -21
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.stories.tsx +0 -439
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.tsx +0 -141
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.variants.ts +0 -65
- package/src/layouts/chat-card-two-column-layout/index.ts +0 -17
- package/src/layouts/index.ts +0 -3
package/src/layouts/chat-card-two-column-layout/__tests__/chat-card-two-column-layout.spec.tsx
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { cleanup, render, screen } from '@testing-library/react';
|
|
2
|
-
import { afterEach, describe, expect, test, vi } from 'vitest';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
ChatCardTwoColumnLayout,
|
|
6
|
-
ChatCardTwoColumnLayoutAside,
|
|
7
|
-
ChatCardTwoColumnLayoutMain,
|
|
8
|
-
} from '../chat-card-two-column-layout';
|
|
9
|
-
import { TWO_COLUMN_MIN_WIDTH } from '../chat-card-two-column-layout.sizing';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* jsdom evaluates no container queries, so the switch itself is checked in Storybook. What
|
|
13
|
-
* this file locks is the structure the query depends on: the root is the named container,
|
|
14
|
-
* the panes sit directly in the grid it renders, and the threshold in the classes matches
|
|
15
|
-
* the sizing constants.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
afterEach(() => {
|
|
19
|
-
cleanup();
|
|
20
|
-
vi.restoreAllMocks();
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
function renderLayout() {
|
|
24
|
-
return render(
|
|
25
|
-
<ChatCardTwoColumnLayout className="h-[480px]">
|
|
26
|
-
<ChatCardTwoColumnLayoutAside>list</ChatCardTwoColumnLayoutAside>
|
|
27
|
-
<ChatCardTwoColumnLayoutMain>chart</ChatCardTwoColumnLayoutMain>
|
|
28
|
-
</ChatCardTwoColumnLayout>,
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
describe('ChatCardTwoColumnLayout', () => {
|
|
33
|
-
test('the root is the named container and keeps the consumer className', () => {
|
|
34
|
-
renderLayout();
|
|
35
|
-
|
|
36
|
-
const root = screen.getByTestId('chat-card-two-column-layout');
|
|
37
|
-
|
|
38
|
-
expect(root.className).toContain('@container/chat-card-two-column-layout');
|
|
39
|
-
expect(root.className).toContain('h-[480px]');
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
test('Aside and Main are direct children of the grid, in order', () => {
|
|
43
|
-
renderLayout();
|
|
44
|
-
|
|
45
|
-
const grid = screen.getByTestId('chat-card-two-column-layout-grid');
|
|
46
|
-
|
|
47
|
-
expect(grid.parentElement).toBe(screen.getByTestId('chat-card-two-column-layout'));
|
|
48
|
-
expect([...grid.children].map((child) => child.getAttribute('data-slot'))).toEqual([
|
|
49
|
-
'chat-card-two-column-layout-aside',
|
|
50
|
-
'chat-card-two-column-layout-main',
|
|
51
|
-
]);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
test('the grid switches at the width the sizing file derives', () => {
|
|
55
|
-
renderLayout();
|
|
56
|
-
|
|
57
|
-
expect(TWO_COLUMN_MIN_WIDTH).toBe(744);
|
|
58
|
-
expect(screen.getByTestId('chat-card-two-column-layout-grid').className).toContain(
|
|
59
|
-
`@[${TWO_COLUMN_MIN_WIDTH}px]/chat-card-two-column-layout:grid-cols-[336px_minmax(0,1fr)]`,
|
|
60
|
-
);
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
test('panes render semantic elements and merge className', () => {
|
|
64
|
-
render(
|
|
65
|
-
<ChatCardTwoColumnLayout>
|
|
66
|
-
<ChatCardTwoColumnLayoutAside className="p-[4px]">list</ChatCardTwoColumnLayoutAside>
|
|
67
|
-
<ChatCardTwoColumnLayoutMain>chart</ChatCardTwoColumnLayoutMain>
|
|
68
|
-
</ChatCardTwoColumnLayout>,
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
const aside = screen.getByTestId('chat-card-two-column-layout-aside');
|
|
72
|
-
|
|
73
|
-
expect(aside.tagName).toBe('ASIDE');
|
|
74
|
-
expect(aside.className).toContain('p-[4px]');
|
|
75
|
-
expect(screen.getByTestId('chat-card-two-column-layout-main').tagName).toBe('MAIN');
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
test('asChild renders the consumer element', () => {
|
|
79
|
-
render(
|
|
80
|
-
<ChatCardTwoColumnLayout asChild>
|
|
81
|
-
<section>
|
|
82
|
-
<ChatCardTwoColumnLayoutAside asChild>
|
|
83
|
-
<nav>list</nav>
|
|
84
|
-
</ChatCardTwoColumnLayoutAside>
|
|
85
|
-
<ChatCardTwoColumnLayoutMain>chart</ChatCardTwoColumnLayoutMain>
|
|
86
|
-
</section>
|
|
87
|
-
</ChatCardTwoColumnLayout>,
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
expect(screen.getByTestId('chat-card-two-column-layout-aside').tagName).toBe('NAV');
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
test.each([
|
|
94
|
-
[
|
|
95
|
-
'ChatCardTwoColumnLayoutAside',
|
|
96
|
-
<ChatCardTwoColumnLayoutAside key="a">x</ChatCardTwoColumnLayoutAside>,
|
|
97
|
-
],
|
|
98
|
-
[
|
|
99
|
-
'ChatCardTwoColumnLayoutMain',
|
|
100
|
-
<ChatCardTwoColumnLayoutMain key="m">x</ChatCardTwoColumnLayoutMain>,
|
|
101
|
-
],
|
|
102
|
-
])('%s throws outside the layout', (part, element) => {
|
|
103
|
-
vi.spyOn(console, 'error').mockImplementation(() => {});
|
|
104
|
-
|
|
105
|
-
expect(() => render(element)).toThrow(
|
|
106
|
-
`[web-chat-ui] "${part}" must be used within a ChatCardTwoColumnLayout`,
|
|
107
|
-
);
|
|
108
|
-
});
|
|
109
|
-
});
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../../../../int-eslint-config/schemas/component.schema.json",
|
|
3
|
-
"component": "chat-card-two-column-layout",
|
|
4
|
-
"purpose": "Responsive two-pane body for a chat card: Aside (a fixed 336px column) beside Main (flexible), stacked as Aside over Main when the layout is narrower than 744px. Parts: ChatCardTwoColumnLayout, ChatCardTwoColumnLayoutAside, ChatCardTwoColumnLayoutMain, plus chatCardTwoColumnLayoutCardVariants for the wrapping ChatCard.",
|
|
5
|
-
"anatomy": [
|
|
6
|
-
"import {",
|
|
7
|
-
" ChatCardTwoColumnLayout,",
|
|
8
|
-
" ChatCardTwoColumnLayoutAside,",
|
|
9
|
-
" ChatCardTwoColumnLayoutMain,",
|
|
10
|
-
"} from '@swisper.ai/web-chat-ui';",
|
|
11
|
-
"",
|
|
12
|
-
"<ChatCardTwoColumnLayout>",
|
|
13
|
-
" <ChatCardTwoColumnLayoutAside />",
|
|
14
|
-
" <ChatCardTwoColumnLayoutMain />",
|
|
15
|
-
"</ChatCardTwoColumnLayout>"
|
|
16
|
-
],
|
|
17
|
-
"useWhen": [
|
|
18
|
-
"A chat card shaped like \"a list or a summary + a canvas\", e.g. rows of figures beside a chart",
|
|
19
|
-
"Two panes that should sit side by side when the card is wide and stack when it is narrow, with nothing floating over Main",
|
|
20
|
-
"Main holds content that needs a fixed height, such as a map or a chart"
|
|
21
|
-
],
|
|
22
|
-
"avoidWhen": [
|
|
23
|
-
"A selected item needs its own pane, or a pane must float over Main or cover it — use web-chat-ui/chat-card-three-column-layout instead",
|
|
24
|
-
"The card has a single content area — put the content in web-chat-ui/ChatCardContent directly",
|
|
25
|
-
"Page-level layout outside a chat card — the widths and the card recipe are tuned for a card in a chat message"
|
|
26
|
-
],
|
|
27
|
-
"uxPrinciples": [
|
|
28
|
-
"The card is sized by the chat window, not the viewport, so the panes switch on the layout's own width",
|
|
29
|
-
"Main must stay wide enough to be useful beside the Aside column; below that, stack rather than squeeze"
|
|
30
|
-
],
|
|
31
|
-
"accessibility": {
|
|
32
|
-
"required": [
|
|
33
|
-
"Aside renders an <aside> and Main a <main>; a chat page usually already has a <main>, so use asChild to render a <section> or <div> for Main when that would create a second main landmark",
|
|
34
|
-
"Give a scrolling Aside an accessible name (aria-label) when its content scrolls independently"
|
|
35
|
-
],
|
|
36
|
-
"keyboard": [
|
|
37
|
-
"No keyboard handling of its own; DOM and tab order is always Aside, then Main, in both the stacked and the side-by-side arrangement"
|
|
38
|
-
],
|
|
39
|
-
"aria": [
|
|
40
|
-
"Sets no ARIA attributes; landmarks come from the <aside> and <main> elements (or the asChild element)"
|
|
41
|
-
],
|
|
42
|
-
"focus": ["The layout and its panes are not focusable; focus is per interactive child"]
|
|
43
|
-
},
|
|
44
|
-
"behaviour": {
|
|
45
|
-
"states": ["stacked (layout narrower than 744px)", "side by side (layout 744px or wider)"],
|
|
46
|
-
"rules": [
|
|
47
|
-
"The switch is a CSS container query on the layout's own width, not a viewport breakpoint; there is no JS measuring, so it also renders correctly on the server",
|
|
48
|
-
"Narrower than 744px: one column, Aside in the first row at its content height and Main in the second row taking the rest of the height",
|
|
49
|
-
"From 744px: Aside is a 336px column at full height with overflow hidden, and Main takes the remaining width",
|
|
50
|
-
"The root is the query container and renders the grid inside itself, because an element cannot query its own width; className goes on the root and gridClassName on that grid (e.g. gap-8 for a tighter gutter), merged after its defaults",
|
|
51
|
-
"The layout sets no height: give the root one in className (e.g. h-[480px]) when Main needs it; without it a map or chart in Main has no height",
|
|
52
|
-
"A long Aside list in the column makes the card taller unless its content has h-full and its own scroll (e.g. ui/scroll-area)",
|
|
53
|
-
"Main is position: relative, so consumers can anchor their own overlays to it",
|
|
54
|
-
"The panes query the layout's named container, so they only switch inside a ChatCardTwoColumnLayout; a two-column layout nested in another container still queries its own root",
|
|
55
|
-
"The exported pane cva recipes only work inside an element carrying chatCardTwoColumnLayoutVariants(), the named query container; a className on any part is merged over its recipe and wins",
|
|
56
|
-
"Aside and Main throw \"[web-chat-ui] … must be used within a ChatCardTwoColumnLayout\" when rendered outside the root",
|
|
57
|
-
"asChild on the root and on each pane renders the consumer's element instead of div / aside / main"
|
|
58
|
-
]
|
|
59
|
-
},
|
|
60
|
-
"composition": {
|
|
61
|
-
"allowedParents": ["web-chat-ui/ChatCardContent"],
|
|
62
|
-
"allowedChildren": [
|
|
63
|
-
"web-chat-ui/ChatCardTwoColumnLayoutAside",
|
|
64
|
-
"web-chat-ui/ChatCardTwoColumnLayoutMain",
|
|
65
|
-
"ui/scroll-area",
|
|
66
|
-
"web-map/map"
|
|
67
|
-
],
|
|
68
|
-
"avoidCombinations": [
|
|
69
|
-
"Wrapping Aside or Main in another element — they must be direct children of the root to sit in the grid; use asChild for a different element instead",
|
|
70
|
-
"The wrapping web-chat-ui/chat-card without chatCardTwoColumnLayoutCardVariants() — a grid of 1fr tracks has no intrinsic width, so the card shrinks to nothing inside a message",
|
|
71
|
-
"web-chat-ui/chat-card-container on its default fixed variant — it caps the card at the reading column, so the layout never reaches two columns; use variant=\"full\""
|
|
72
|
-
],
|
|
73
|
-
"contexts": ["chat card body", "chat thread"]
|
|
74
|
-
},
|
|
75
|
-
"content": {
|
|
76
|
-
"labelRules": [],
|
|
77
|
-
"helperTextRules": [],
|
|
78
|
-
"errorRules": []
|
|
79
|
-
},
|
|
80
|
-
"aiDecisionRules": [
|
|
81
|
-
{
|
|
82
|
-
"condition": "Building a card with a list or summary beside a chart or map",
|
|
83
|
-
"decision": "Render web-chat-ui/chat-card-container variant=\"full\" > web-chat-ui/chat-card with className={chatCardTwoColumnLayoutCardVariants()} > ChatCardBody > ChatCardContent > ChatCardTwoColumnLayout with Aside and Main",
|
|
84
|
-
"reason": "Without the card recipe the card collapses to zero width, and without variant=\"full\" it never gets wide enough for two columns"
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"condition": "The card is always stacked although the window is wide",
|
|
88
|
-
"decision": "Check that the ChatCard has chatCardTwoColumnLayoutCardVariants() and that its web-chat-ui/chat-card-container uses variant=\"full\"",
|
|
89
|
-
"reason": "The layout switches on its own width, so it stays stacked whenever the card is not given the width"
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"condition": "Main contains a map or a chart",
|
|
93
|
-
"decision": "Set a height on the root with className (e.g. h-[480px])",
|
|
94
|
-
"reason": "The layout sets no height, so the chart or map in Main renders blank"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"condition": "The Aside content is longer than the card height",
|
|
98
|
-
"decision": "Give the Aside content h-full and its own scroll, e.g. ui/scroll-area with className h-full",
|
|
99
|
-
"reason": "Otherwise the long list grows the card instead of scrolling inside the column"
|
|
100
|
-
}
|
|
101
|
-
],
|
|
102
|
-
"relatedComponents": [
|
|
103
|
-
"web-chat-ui/chat-card-three-column-layout",
|
|
104
|
-
"web-chat-ui/chat-card",
|
|
105
|
-
"web-chat-ui/chat-card-container",
|
|
106
|
-
"ui/scroll-area",
|
|
107
|
-
"web-map/map"
|
|
108
|
-
]
|
|
109
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* The recipes in `chat-card-two-column-layout.variants.ts` write these out as literal
|
|
3
|
-
* `336px` / `744px`, because Tailwind cannot read a constant, so change both together.
|
|
4
|
-
* Nothing reads them at runtime: the switch is a CSS container query. They are here so the
|
|
5
|
-
* threshold is derived in one place, not guessed.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/** Aside's fixed column width once the layout is wide enough for two columns. */
|
|
9
|
-
export const ASIDE_WIDTH = 336;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Narrowest Main may get beside the Aside column. The same 400px as the three-column
|
|
13
|
-
* layout: below it a map or a chart shows too little to be worth sitting beside anything.
|
|
14
|
-
*/
|
|
15
|
-
export const MIN_MAIN_WIDTH = 400;
|
|
16
|
-
|
|
17
|
-
/** Must equal the `gap-[8px]` on the grid, or the threshold is off by that much. */
|
|
18
|
-
export const GAP = 8;
|
|
19
|
-
|
|
20
|
-
/** From this layout width, Aside and Main sit side by side; below it they stack. */
|
|
21
|
-
export const TWO_COLUMN_MIN_WIDTH = ASIDE_WIDTH + GAP + MIN_MAIN_WIDTH;
|
|
@@ -1,439 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
import { expect } from 'storybook/test';
|
|
4
|
-
|
|
5
|
-
import { Button, Chip, ScrollArea, Typography } from '@swisper.ai/ui';
|
|
6
|
-
|
|
7
|
-
import { ParentBlock } from '../../__storybook__/parent-block';
|
|
8
|
-
import {
|
|
9
|
-
ChatCard,
|
|
10
|
-
ChatCardActions,
|
|
11
|
-
ChatCardBody,
|
|
12
|
-
ChatCardCollapsibleButton,
|
|
13
|
-
ChatCardContent,
|
|
14
|
-
ChatCardFooter,
|
|
15
|
-
ChatCardHeader,
|
|
16
|
-
ChatCardHeaderContent,
|
|
17
|
-
ChatCardTitle,
|
|
18
|
-
} from '../../components/chat-card';
|
|
19
|
-
import { ChatCardContainer } from '../../components/chat-card-container';
|
|
20
|
-
import { ChatContainer } from '../../components/chat-container';
|
|
21
|
-
import { ChatMessage, ChatMessageContent } from '../../components/chat-message';
|
|
22
|
-
|
|
23
|
-
import { ConnectionItinerary } from './__stories__/connection-itinerary';
|
|
24
|
-
import { ZURICH_TO_LUGANO, ZURICH_TO_PARADISO_DOOR_TO_DOOR } from './__stories__/fixtures';
|
|
25
|
-
import { RouteMap } from './__stories__/route-map';
|
|
26
|
-
import type { ItineraryStep } from './__stories__/types';
|
|
27
|
-
import {
|
|
28
|
-
ChatCardTwoColumnLayout,
|
|
29
|
-
ChatCardTwoColumnLayoutAside,
|
|
30
|
-
ChatCardTwoColumnLayoutMain,
|
|
31
|
-
} from './chat-card-two-column-layout';
|
|
32
|
-
import type { ChatCardTwoColumnLayoutProps } from './chat-card-two-column-layout';
|
|
33
|
-
import { chatCardTwoColumnLayoutCardVariants } from './chat-card-two-column-layout.variants';
|
|
34
|
-
|
|
35
|
-
const meta: Meta<typeof ChatCardTwoColumnLayout> = {
|
|
36
|
-
title: 'Chat/ChatCardTwoColumnLayout',
|
|
37
|
-
component: ChatCardTwoColumnLayout,
|
|
38
|
-
tags: ['autodocs'],
|
|
39
|
-
parameters: { layout: 'fullscreen' },
|
|
40
|
-
argTypes: {
|
|
41
|
-
children: {
|
|
42
|
-
control: false,
|
|
43
|
-
description: 'A `ChatCardTwoColumnLayoutAside` followed by a `ChatCardTwoColumnLayoutMain`.',
|
|
44
|
-
},
|
|
45
|
-
className: {
|
|
46
|
-
control: 'text',
|
|
47
|
-
description:
|
|
48
|
-
'Classes for the root, merged last. Set the height here (e.g. `h-120`); the layout sets none, and without one a map or chart in Main has no height.',
|
|
49
|
-
},
|
|
50
|
-
gridClassName: {
|
|
51
|
-
control: 'text',
|
|
52
|
-
description:
|
|
53
|
-
'Classes for the grid the root renders around the panes, merged after its defaults, e.g. `gap-8` for a tighter gutter.',
|
|
54
|
-
},
|
|
55
|
-
asChild: {
|
|
56
|
-
control: false,
|
|
57
|
-
description: 'Renders the single child element as the layout root instead of a `<div>`.',
|
|
58
|
-
table: { defaultValue: { summary: 'false' } },
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
args: {
|
|
62
|
-
className: 'h-120',
|
|
63
|
-
asChild: false,
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export default meta;
|
|
68
|
-
type Story = StoryObj<typeof ChatCardTwoColumnLayout>;
|
|
69
|
-
|
|
70
|
-
interface ConnectionLayoutProps extends Omit<ChatCardTwoColumnLayoutProps, 'children'> {
|
|
71
|
-
/** The itinerary rows in the Aside column. */
|
|
72
|
-
steps?: ItineraryStep[];
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/** The travel card's body: the itinerary in Aside, scrolling on its own, beside the route map in Main. */
|
|
76
|
-
function ConnectionLayout({ steps = ZURICH_TO_LUGANO, ...rest }: ConnectionLayoutProps) {
|
|
77
|
-
return (
|
|
78
|
-
<ChatCardTwoColumnLayout {...rest}>
|
|
79
|
-
<ChatCardTwoColumnLayoutAside aria-label="Itinerary">
|
|
80
|
-
<ScrollArea className="h-full">
|
|
81
|
-
<ConnectionItinerary steps={steps} />
|
|
82
|
-
</ScrollArea>
|
|
83
|
-
</ChatCardTwoColumnLayoutAside>
|
|
84
|
-
|
|
85
|
-
{/* A chat page already has a `<main>`, so Main renders a named section here. */}
|
|
86
|
-
<ChatCardTwoColumnLayoutMain asChild>
|
|
87
|
-
<section aria-label="Route map">
|
|
88
|
-
<RouteMap label="Map of the route from Zürich to Lugano" />
|
|
89
|
-
</section>
|
|
90
|
-
</ChatCardTwoColumnLayoutMain>
|
|
91
|
-
</ChatCardTwoColumnLayout>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/** The connection as a chat card. The card recipe gives it the width the two columns need. */
|
|
96
|
-
function ConnectionCard(props: ConnectionLayoutProps) {
|
|
97
|
-
return (
|
|
98
|
-
<ChatCard className={chatCardTwoColumnLayoutCardVariants()}>
|
|
99
|
-
<ChatCardHeader>
|
|
100
|
-
<ChatCardHeaderContent>
|
|
101
|
-
<ChatCardTitle>Zürich to Lugano</ChatCardTitle>
|
|
102
|
-
</ChatCardHeaderContent>
|
|
103
|
-
</ChatCardHeader>
|
|
104
|
-
<ChatCardBody>
|
|
105
|
-
<ChatCardContent>
|
|
106
|
-
<ConnectionLayout {...props} />
|
|
107
|
-
</ChatCardContent>
|
|
108
|
-
</ChatCardBody>
|
|
109
|
-
</ChatCard>
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/** The chat surface around the card. `full` lets the card grow past the reading column. */
|
|
114
|
-
function ChatWindow({ children }: { children: ReactNode }) {
|
|
115
|
-
return (
|
|
116
|
-
<ChatContainer className="h-auto py-16">
|
|
117
|
-
<ChatCardContainer variant="full">{children}</ChatCardContainer>
|
|
118
|
-
</ChatContainer>
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* From 744px of layout width, Aside is a 336px column beside Main; below it, Aside stacks
|
|
124
|
-
* above Main and Main takes the rest of the height. The threshold is the layout's own width,
|
|
125
|
-
* not the viewport's.
|
|
126
|
-
*/
|
|
127
|
-
export const Default: Story = {
|
|
128
|
-
render: (args) => (
|
|
129
|
-
<ChatWindow>
|
|
130
|
-
<ConnectionCard {...args} />
|
|
131
|
-
</ChatWindow>
|
|
132
|
-
),
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
/** A narrow card: Aside stacks above Main although the viewport is wide. */
|
|
136
|
-
export const Stacked: Story = {
|
|
137
|
-
parameters: { controls: { disable: true } },
|
|
138
|
-
render: () => (
|
|
139
|
-
<div className="w-125">
|
|
140
|
-
<ChatWindow>
|
|
141
|
-
<ConnectionCard className="h-150" />
|
|
142
|
-
</ChatWindow>
|
|
143
|
-
</div>
|
|
144
|
-
),
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Drag the dashed wrapper's right edge across 744px: the columns switch without the viewport
|
|
149
|
-
* changing, which is the point.
|
|
150
|
-
*/
|
|
151
|
-
export const ResizableContainer: Story = {
|
|
152
|
-
parameters: { controls: { disable: true } },
|
|
153
|
-
render: () => (
|
|
154
|
-
<div className="w-225 max-w-full min-w-90 resize-x overflow-auto border border-dashed border-card-border-base">
|
|
155
|
-
<ChatWindow>
|
|
156
|
-
<ConnectionCard className="h-150" />
|
|
157
|
-
</ChatWindow>
|
|
158
|
-
</div>
|
|
159
|
-
),
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
// TODO(echo-ds): the root is a plain div with no role or name, so it is found by its slot.
|
|
163
|
-
function getLayoutRoot(pane: HTMLElement) {
|
|
164
|
-
return pane.closest<HTMLElement>('[data-slot="chat-card-two-column-layout"]');
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/** Checks that a 1000px card puts Aside in a 336px column beside Main, both at the root's height. */
|
|
168
|
-
export const SideBySideColumns: Story = {
|
|
169
|
-
tags: ['e2e', '!autodocs'],
|
|
170
|
-
render: (args) => (
|
|
171
|
-
<div className="w-250">
|
|
172
|
-
<ChatWindow>
|
|
173
|
-
<ConnectionCard {...args} />
|
|
174
|
-
</ChatWindow>
|
|
175
|
-
</div>
|
|
176
|
-
),
|
|
177
|
-
play: async ({ canvas, step }) => {
|
|
178
|
-
const aside = canvas.getByRole('complementary', { name: 'Itinerary' });
|
|
179
|
-
const main = canvas.getByRole('region', { name: 'Route map' });
|
|
180
|
-
const asideBox = aside.getBoundingClientRect();
|
|
181
|
-
const mainBox = main.getBoundingClientRect();
|
|
182
|
-
|
|
183
|
-
await step('Aside is the fixed column, Main the flexible one', async () => {
|
|
184
|
-
await expect(asideBox.width).toBeCloseTo(336, 0);
|
|
185
|
-
await expect(mainBox.top).toBeCloseTo(asideBox.top, 0);
|
|
186
|
-
await expect(mainBox.left - asideBox.right).toBeCloseTo(16, 0);
|
|
187
|
-
await expect(mainBox.width).toBeGreaterThanOrEqual(400);
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
await step('The height on the root reaches both panes', async () => {
|
|
191
|
-
await expect(getLayoutRoot(aside)?.getBoundingClientRect().height).toBeCloseTo(480, 0);
|
|
192
|
-
await expect(asideBox.height).toBeCloseTo(480, 0);
|
|
193
|
-
await expect(mainBox.height).toBeCloseTo(480, 0);
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
await step('Aside comes before Main in the DOM', async () => {
|
|
197
|
-
await expect(
|
|
198
|
-
aside.compareDocumentPosition(main) & Node.DOCUMENT_POSITION_FOLLOWING,
|
|
199
|
-
).toBeTruthy();
|
|
200
|
-
});
|
|
201
|
-
},
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
/** Checks that a 500px card stacks Aside over Main at one width, and Main takes the height Aside leaves. */
|
|
205
|
-
export const StackedRows: Story = {
|
|
206
|
-
...Stacked,
|
|
207
|
-
tags: ['e2e', '!autodocs'],
|
|
208
|
-
play: async ({ canvas, step }) => {
|
|
209
|
-
const aside = canvas.getByRole('complementary', { name: 'Itinerary' });
|
|
210
|
-
const main = canvas.getByRole('region', { name: 'Route map' });
|
|
211
|
-
const rootBox = getLayoutRoot(aside)?.getBoundingClientRect();
|
|
212
|
-
const asideBox = aside.getBoundingClientRect();
|
|
213
|
-
const mainBox = main.getBoundingClientRect();
|
|
214
|
-
|
|
215
|
-
await step('Aside sits above Main in one column', async () => {
|
|
216
|
-
await expect(mainBox.top).toBeGreaterThanOrEqual(asideBox.bottom);
|
|
217
|
-
await expect(mainBox.left).toBeCloseTo(asideBox.left, 0);
|
|
218
|
-
await expect(mainBox.width).toBeCloseTo(asideBox.width, 0);
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
await step('Aside keeps its content height and Main takes the rest', async () => {
|
|
222
|
-
await expect(rootBox?.height).toBeCloseTo(600, 0);
|
|
223
|
-
await expect(asideBox.height).toBeLessThan(600);
|
|
224
|
-
await expect(mainBox.bottom).toBeCloseTo(rootBox?.bottom ?? 0, 0);
|
|
225
|
-
await expect(mainBox.height).toBeGreaterThan(0);
|
|
226
|
-
});
|
|
227
|
-
},
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
/** Checks that an itinerary longer than the card scrolls inside the Aside column instead of growing the card. */
|
|
231
|
-
export const LongAsideScrolls: Story = {
|
|
232
|
-
tags: ['e2e', '!autodocs'],
|
|
233
|
-
args: { className: 'h-60' },
|
|
234
|
-
render: (args) => (
|
|
235
|
-
<div className="w-250">
|
|
236
|
-
<ChatWindow>
|
|
237
|
-
<ConnectionCard {...args} steps={ZURICH_TO_PARADISO_DOOR_TO_DOOR} />
|
|
238
|
-
</ChatWindow>
|
|
239
|
-
</div>
|
|
240
|
-
),
|
|
241
|
-
play: async ({ canvas }) => {
|
|
242
|
-
const aside = canvas.getByRole('complementary', { name: 'Itinerary' });
|
|
243
|
-
// TODO(echo-ds): the scroll viewport has no role or name, so it is found by its slot.
|
|
244
|
-
const viewport = aside.querySelector<HTMLElement>('[data-slot="scroll-area-viewport"]');
|
|
245
|
-
|
|
246
|
-
await expect(getLayoutRoot(aside)?.getBoundingClientRect().height).toBeCloseTo(240, 0);
|
|
247
|
-
await expect(aside.getBoundingClientRect().height).toBeCloseTo(240, 0);
|
|
248
|
-
await expect(viewport?.scrollHeight).toBeGreaterThan(viewport?.clientHeight ?? 0);
|
|
249
|
-
await expect(canvas.getByText(/6900 Paradiso/)).toBeInTheDocument();
|
|
250
|
-
},
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
/** Checks that `gridClassName` reaches the grid: `gap-8` halves the gutter between the columns. */
|
|
254
|
-
export const GridClassNameGutter: Story = {
|
|
255
|
-
...SideBySideColumns,
|
|
256
|
-
tags: ['e2e', '!autodocs'],
|
|
257
|
-
args: { gridClassName: 'gap-8' },
|
|
258
|
-
play: async ({ canvas }) => {
|
|
259
|
-
const aside = canvas.getByRole('complementary', { name: 'Itinerary' });
|
|
260
|
-
const main = canvas.getByRole('region', { name: 'Route map' });
|
|
261
|
-
|
|
262
|
-
await expect(
|
|
263
|
-
main.getBoundingClientRect().left - aside.getBoundingClientRect().right,
|
|
264
|
-
).toBeCloseTo(8, 0);
|
|
265
|
-
await expect(aside.getBoundingClientRect().width).toBeCloseTo(336, 0);
|
|
266
|
-
},
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
/** The layout in each place it's allowed: straight in a card's content, in a card body with a footer under it, and in a chat thread. */
|
|
270
|
-
export const Examples: Story = {
|
|
271
|
-
parameters: { controls: { disable: true } },
|
|
272
|
-
render: () => (
|
|
273
|
-
<div className="flex flex-col gap-24 p-16">
|
|
274
|
-
<ParentBlock parent="web-chat-ui/ChatCardContent">
|
|
275
|
-
<ChatCard className={chatCardTwoColumnLayoutCardVariants()}>
|
|
276
|
-
<ChatCardHeader>
|
|
277
|
-
<ChatCardHeaderContent>
|
|
278
|
-
<ChatCardTitle>Zürich to Lugano</ChatCardTitle>
|
|
279
|
-
</ChatCardHeaderContent>
|
|
280
|
-
</ChatCardHeader>
|
|
281
|
-
<ChatCardBody>
|
|
282
|
-
<ChatCardContent>
|
|
283
|
-
<ConnectionLayout className="h-90" />
|
|
284
|
-
</ChatCardContent>
|
|
285
|
-
</ChatCardBody>
|
|
286
|
-
</ChatCard>
|
|
287
|
-
</ParentBlock>
|
|
288
|
-
|
|
289
|
-
<ParentBlock parent="chat card body">
|
|
290
|
-
<ChatCard className={chatCardTwoColumnLayoutCardVariants()}>
|
|
291
|
-
<ChatCardHeader>
|
|
292
|
-
<ChatCardHeaderContent>
|
|
293
|
-
<ChatCardTitle>Zürich to Lugano</ChatCardTitle>
|
|
294
|
-
</ChatCardHeaderContent>
|
|
295
|
-
<ChatCardActions className="flex items-center gap-4">
|
|
296
|
-
<Chip variant="outlined" size="2xs" color="success">
|
|
297
|
-
On time
|
|
298
|
-
</Chip>
|
|
299
|
-
<ChatCardCollapsibleButton />
|
|
300
|
-
</ChatCardActions>
|
|
301
|
-
</ChatCardHeader>
|
|
302
|
-
<ChatCardBody>
|
|
303
|
-
<ChatCardContent hasHeaderPadding={false}>
|
|
304
|
-
<ConnectionLayout className="h-90" />
|
|
305
|
-
</ChatCardContent>
|
|
306
|
-
<ChatCardFooter className="flex-wrap justify-between gap-12">
|
|
307
|
-
<Chip variant="outlined" size="2xs" color="info">
|
|
308
|
-
From CHF 34.00
|
|
309
|
-
</Chip>
|
|
310
|
-
<Button variant="primary">Select connection</Button>
|
|
311
|
-
</ChatCardFooter>
|
|
312
|
-
</ChatCardBody>
|
|
313
|
-
</ChatCard>
|
|
314
|
-
</ParentBlock>
|
|
315
|
-
|
|
316
|
-
<ParentBlock parent="chat thread">
|
|
317
|
-
<ChatContainer aria-label="Chat" className="h-auto gap-16 py-16">
|
|
318
|
-
<ChatMessage isQuestion className="px-message">
|
|
319
|
-
<ChatMessageContent>
|
|
320
|
-
<Typography>When is the next train from Zürich to Lugano?</Typography>
|
|
321
|
-
</ChatMessageContent>
|
|
322
|
-
</ChatMessage>
|
|
323
|
-
<ChatMessage className="px-message">
|
|
324
|
-
<ChatMessageContent>
|
|
325
|
-
<Typography>
|
|
326
|
-
The next connection leaves Höschgasse at 12:10 and reaches Lugano at 14:28, with one
|
|
327
|
-
change at Zürich HB.
|
|
328
|
-
</Typography>
|
|
329
|
-
</ChatMessageContent>
|
|
330
|
-
</ChatMessage>
|
|
331
|
-
<ChatCardContainer variant="full">
|
|
332
|
-
<ConnectionCard className="h-90" />
|
|
333
|
-
</ChatCardContainer>
|
|
334
|
-
</ChatContainer>
|
|
335
|
-
</ParentBlock>
|
|
336
|
-
</div>
|
|
337
|
-
),
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
interface ChatCardTwoColumnLayoutPlaygroundProps extends Omit<
|
|
341
|
-
ChatCardTwoColumnLayoutProps,
|
|
342
|
-
'children'
|
|
343
|
-
> {
|
|
344
|
-
width: number;
|
|
345
|
-
title: string;
|
|
346
|
-
stepCount: number;
|
|
347
|
-
hasScrollArea: boolean;
|
|
348
|
-
asideClassName: string;
|
|
349
|
-
mainClassName: string;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
function ChatCardTwoColumnLayoutPlayground({
|
|
353
|
-
width,
|
|
354
|
-
title,
|
|
355
|
-
stepCount,
|
|
356
|
-
hasScrollArea,
|
|
357
|
-
asideClassName,
|
|
358
|
-
mainClassName,
|
|
359
|
-
...rest
|
|
360
|
-
}: ChatCardTwoColumnLayoutPlaygroundProps) {
|
|
361
|
-
const itinerary = (
|
|
362
|
-
<ConnectionItinerary steps={ZURICH_TO_PARADISO_DOOR_TO_DOOR.slice(0, stepCount)} />
|
|
363
|
-
);
|
|
364
|
-
|
|
365
|
-
return (
|
|
366
|
-
// The width is a control, so it can only be an inline style.
|
|
367
|
-
<div style={{ width }} className="max-w-full">
|
|
368
|
-
<ChatWindow>
|
|
369
|
-
<ChatCard className={chatCardTwoColumnLayoutCardVariants()}>
|
|
370
|
-
<ChatCardHeader>
|
|
371
|
-
<ChatCardHeaderContent>
|
|
372
|
-
<ChatCardTitle>{title}</ChatCardTitle>
|
|
373
|
-
</ChatCardHeaderContent>
|
|
374
|
-
</ChatCardHeader>
|
|
375
|
-
<ChatCardBody>
|
|
376
|
-
<ChatCardContent>
|
|
377
|
-
<ChatCardTwoColumnLayout {...rest}>
|
|
378
|
-
<ChatCardTwoColumnLayoutAside aria-label="Itinerary" className={asideClassName}>
|
|
379
|
-
{hasScrollArea ? (
|
|
380
|
-
<ScrollArea className="h-full">{itinerary}</ScrollArea>
|
|
381
|
-
) : (
|
|
382
|
-
itinerary
|
|
383
|
-
)}
|
|
384
|
-
</ChatCardTwoColumnLayoutAside>
|
|
385
|
-
|
|
386
|
-
<ChatCardTwoColumnLayoutMain asChild className={mainClassName}>
|
|
387
|
-
<section aria-label="Route map">
|
|
388
|
-
<RouteMap label="Map of the route from Zürich to Paradiso" />
|
|
389
|
-
</section>
|
|
390
|
-
</ChatCardTwoColumnLayoutMain>
|
|
391
|
-
</ChatCardTwoColumnLayout>
|
|
392
|
-
</ChatCardContent>
|
|
393
|
-
</ChatCardBody>
|
|
394
|
-
</ChatCard>
|
|
395
|
-
</ChatWindow>
|
|
396
|
-
</div>
|
|
397
|
-
);
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
/** Both panes with the door-to-door itinerary, and the card width, the classes of every part and the Aside scroll on the Controls panel. */
|
|
401
|
-
export const Playground: StoryObj<typeof ChatCardTwoColumnLayoutPlayground> = {
|
|
402
|
-
tags: ['!autodocs'],
|
|
403
|
-
args: {
|
|
404
|
-
width: 1000,
|
|
405
|
-
title: 'Zürich, Feldeggstrasse to Paradiso',
|
|
406
|
-
stepCount: ZURICH_TO_PARADISO_DOOR_TO_DOOR.length,
|
|
407
|
-
hasScrollArea: true,
|
|
408
|
-
className: 'h-120',
|
|
409
|
-
gridClassName: '',
|
|
410
|
-
asideClassName: '',
|
|
411
|
-
mainClassName: '',
|
|
412
|
-
},
|
|
413
|
-
argTypes: {
|
|
414
|
-
width: {
|
|
415
|
-
control: { type: 'range', min: 360, max: 1200, step: 8 },
|
|
416
|
-
description:
|
|
417
|
-
'Width of the chat window in pixels. The columns switch when the layout inside the card reaches 744px.',
|
|
418
|
-
},
|
|
419
|
-
title: { control: 'text', description: 'Text of the wrapping card’s `ChatCardTitle`.' },
|
|
420
|
-
stepCount: {
|
|
421
|
-
control: { type: 'number', min: 1, max: ZURICH_TO_PARADISO_DOOR_TO_DOOR.length },
|
|
422
|
-
description: 'Number of itinerary steps in `ChatCardTwoColumnLayoutAside`.',
|
|
423
|
-
},
|
|
424
|
-
hasScrollArea: {
|
|
425
|
-
control: 'boolean',
|
|
426
|
-
description:
|
|
427
|
-
'Wraps the Aside content in a `ScrollArea` with `h-full`. Without it a long itinerary is cut off at the column’s height.',
|
|
428
|
-
},
|
|
429
|
-
asideClassName: {
|
|
430
|
-
control: 'text',
|
|
431
|
-
description: '`className` of `ChatCardTwoColumnLayoutAside`, merged over its recipe.',
|
|
432
|
-
},
|
|
433
|
-
mainClassName: {
|
|
434
|
-
control: 'text',
|
|
435
|
-
description: '`className` of `ChatCardTwoColumnLayoutMain`, merged over its recipe.',
|
|
436
|
-
},
|
|
437
|
-
},
|
|
438
|
-
render: (args) => <ChatCardTwoColumnLayoutPlayground {...args} />,
|
|
439
|
-
};
|