@swisper.ai/web-chat-ui 0.0.7 → 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/components/chat-card/components/chat-card-header.d.ts.map +1 -1
- package/dist/components/chat-thinking-process/chat-thinking-process.d.ts.map +1 -1
- package/dist/components/rich-text-field/utils.d.ts +2 -2
- package/dist/index.css +1 -1
- package/dist/index.es.js +932 -930
- package/dist/index.es.js.map +1 -1
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.d.ts +20 -15
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.d.ts.map +1 -1
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.d.ts +0 -1
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.d.ts.map +1 -1
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts +4 -4
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts.map +1 -1
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.d.ts +13 -13
- package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/components/chat-card/components/chat-card-header.tsx +3 -7
- package/src/components/chat-thinking-process/chat-thinking-process.tsx +4 -12
- package/src/components/rich-text-area/__tests__/rich-text-area.spec.tsx +12 -2
- package/src/layouts/chat-card-three-column-layout/__stories__/stay-list.tsx +6 -9
- package/src/layouts/chat-card-three-column-layout/__tests__/chat-card-three-column-layout.sizing.test.ts +10 -12
- package/src/layouts/chat-card-three-column-layout/__tests__/chat-card-three-column-layout.spec.tsx +71 -26
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.json +18 -12
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.ts +0 -2
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.tsx +20 -56
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.tsx +36 -34
- package/src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.ts +33 -22
- package/src/layouts/chat-card-two-column-layout/__stories__/route-map.tsx +1 -1
- package/src/layouts/chat-card-two-column-layout/chat-card-two-column-layout.json +2 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
import { ChatCardThreeColumnLayoutDetailsPlacement } from './chat-card-three-column-layout.variants';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* The Details pane's content, or a function of whether the pane is currently floating.
|
|
5
5
|
*
|
|
6
|
-
* The function form exists because a floating pane
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* The function form exists because a floating pane can need different content, not just
|
|
7
|
+
* different styling: a surface with a shadow over Main, a flat one in the column. CSS alone
|
|
8
|
+
* cannot swap the component tree.
|
|
9
9
|
*/
|
|
10
10
|
export type ChatCardThreeColumnLayoutPaneChildren = ReactNode | ((isFloating: boolean) => ReactNode);
|
|
11
11
|
export interface ChatCardThreeColumnLayoutProps extends ComponentProps<'div'> {
|
|
@@ -26,23 +26,28 @@ export interface ChatCardThreeColumnLayoutProps extends ComponentProps<'div'> {
|
|
|
26
26
|
* breakpoints. The card is sized by the chat window, and a sidebar, a split view or the
|
|
27
27
|
* Storybook panel all make the viewport claim room the card doesn't have (or the
|
|
28
28
|
* reverse). The root measures itself, resolves the panes once (`resolveLayout`), and
|
|
29
|
-
* publishes the result twice: as data attributes for the CSS, and through context for
|
|
30
|
-
* render prop
|
|
29
|
+
* publishes the result twice: as data attributes for the CSS, and through context for
|
|
30
|
+
* Details' render prop. Both read the same numbers, so the content the render prop picks
|
|
31
|
+
* always matches where the pane is drawn.
|
|
31
32
|
*
|
|
32
33
|
* Height is not set here, because it belongs to the content (a map needs a fixed height, a
|
|
33
34
|
* table might not), so pass it in `className`.
|
|
34
35
|
*/
|
|
35
36
|
export declare const ChatCardThreeColumnLayout: import('react').ForwardRefExoticComponent<Omit<ChatCardThreeColumnLayoutProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
36
|
-
export interface ChatCardThreeColumnLayoutListProps extends
|
|
37
|
-
children:
|
|
37
|
+
export interface ChatCardThreeColumnLayoutListProps extends ComponentProps<'aside'> {
|
|
38
|
+
children: ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* Hides the pane while the layout is too narrow for the List column (`sm` and `md`). It
|
|
41
|
+
* stays mounted, so its state is still there when the column comes back.
|
|
42
|
+
*/
|
|
43
|
+
hideOnMobile?: boolean;
|
|
38
44
|
asChild?: boolean;
|
|
39
45
|
}
|
|
40
46
|
/**
|
|
41
|
-
* Column 1 when the layout has room for it beside a usable Main
|
|
42
|
-
*
|
|
43
|
-
* output changes when it switches.
|
|
47
|
+
* Column 1 when the layout has room for it beside a usable Main (`lg` and `xl`). Below that
|
|
48
|
+
* the layout does not place it: pass `hideOnMobile` to hide it there.
|
|
44
49
|
*
|
|
45
|
-
* `data-
|
|
50
|
+
* `data-size` is set too, for styling the pane by the layout's tier.
|
|
46
51
|
*/
|
|
47
52
|
export declare const ChatCardThreeColumnLayoutList: import('react').ForwardRefExoticComponent<Omit<ChatCardThreeColumnLayoutListProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
48
53
|
export interface ChatCardThreeColumnLayoutMainProps extends ComponentProps<'main'> {
|
|
@@ -73,9 +78,9 @@ export interface ChatCardThreeColumnLayoutPanelProps extends ComponentProps<'sec
|
|
|
73
78
|
asChild?: boolean;
|
|
74
79
|
}
|
|
75
80
|
/**
|
|
76
|
-
* An overlay covering everything but the List column (the whole layout when
|
|
77
|
-
* inset 12px. Mount it only while it is open. Main and Details stay mounted
|
|
78
|
-
* a map keeps its viewport and the open Details item survives closing the Panel.
|
|
81
|
+
* An overlay covering everything but the List column (the whole layout when there is no
|
|
82
|
+
* List column), inset 12px. Mount it only while it is open. Main and Details stay mounted
|
|
83
|
+
* under it, so a map keeps its viewport and the open Details item survives closing the Panel.
|
|
79
84
|
*
|
|
80
85
|
* The pane is transparent: draw the surface (background, radius, shadow) in its content,
|
|
81
86
|
* as for Details.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-card-three-column-layout.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-card-three-column-layout.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAC;AAcrE,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,0CAA0C,CAAC;AA0B1G;;;;;;GAMG;AACH,MAAM,MAAM,qCAAqC,GAC/C,SAAS,GAAG,CAAC,CAAC,UAAU,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC;AAMnD,MAAM,WAAW,8BAA+B,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC3E,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,yCAAyC,CAAC;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAkBD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,yBAAyB,wIAkCrC,CAAC;AAIF,MAAM,WAAW,kCAAmC,SAAQ,cAAc,CAAC,OAAO,CAAC;IACjF,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,4IAuBxC,CAAC;AAIH,MAAM,WAAW,kCAAmC,SAAQ,cAAc,CAAC,MAAM,CAAC;IAChF,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,4IAmBxC,CAAC;AAIH,MAAM,WAAW,qCAAsC,SAAQ,IAAI,CACjE,cAAc,CAAC,OAAO,CAAC,EACvB,UAAU,CACX;IACC,QAAQ,EAAE,qCAAqC,CAAC;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gCAAgC,+IA0B3C,CAAC;AAIH,MAAM,WAAW,mCAAoC,SAAQ,cAAc,CAAC,SAAS,CAAC;IACpF,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B,0IAmBzC,CAAC"}
|
package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.d.ts
CHANGED
|
@@ -26,7 +26,6 @@ export declare const XL_MIN_WIDTH: number;
|
|
|
26
26
|
export type ChatCardThreeColumnLayoutSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
27
27
|
export interface ChatCardThreeColumnLayoutResolved {
|
|
28
28
|
size: ChatCardThreeColumnLayoutSize;
|
|
29
|
-
isListFloating: boolean;
|
|
30
29
|
isDetailsFloating: boolean;
|
|
31
30
|
isDetailsSheet: boolean;
|
|
32
31
|
}
|
package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-card-three-column-layout.sizing.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,0CAA0C,CAAC;AAQ1G,eAAO,MAAM,aAAa,MAAM,CAAC;AACjC,2FAA2F;AAC3F,eAAO,MAAM,aAAa,MAAM,CAAC;AAEjC;;;;GAIG;AACH,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,2FAA2F;AAC3F,eAAO,MAAM,GAAG,IAAI,CAAC;AAErB;;;GAGG;AACH,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC,2DAA2D;AAC3D,eAAO,MAAM,YAAY,QAAuC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,YAAY,QAA+C,CAAC;AAEzE,8EAA8E;AAC9E,MAAM,MAAM,6BAA6B,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEtE,MAAM,WAAW,iCAAiC;IAChD,IAAI,EAAE,6BAA6B,CAAC;IACpC,
|
|
1
|
+
{"version":3,"file":"chat-card-three-column-layout.sizing.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.sizing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,0CAA0C,CAAC;AAQ1G,eAAO,MAAM,aAAa,MAAM,CAAC;AACjC,2FAA2F;AAC3F,eAAO,MAAM,aAAa,MAAM,CAAC;AAEjC;;;;GAIG;AACH,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,2FAA2F;AAC3F,eAAO,MAAM,GAAG,IAAI,CAAC;AAErB;;;GAGG;AACH,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC,2DAA2D;AAC3D,eAAO,MAAM,YAAY,QAAuC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,YAAY,QAA+C,CAAC;AAEzE,8EAA8E;AAC9E,MAAM,MAAM,6BAA6B,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEtE,MAAM,WAAW,iCAAiC;IAChD,IAAI,EAAE,6BAA6B,CAAC;IACpC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;CACzB;AASD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,GAAG,OAAO,EACvB,gBAAgB,EAAE,yCAAyC,GAC1D,iCAAiC,CAQnC"}
|
package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ declare const meta: Meta<typeof ChatCardThreeColumnLayout>;
|
|
|
5
5
|
export default meta;
|
|
6
6
|
type Story = StoryObj<typeof ChatCardThreeColumnLayout>;
|
|
7
7
|
/**
|
|
8
|
-
* An accommodation search. Below 698px of layout width the list is
|
|
9
|
-
*
|
|
8
|
+
* An accommodation search. Below 698px of layout width the list is hidden (`hideOnMobile`) and
|
|
9
|
+
* the map has the card to itself; from 698px it is a 290px column, and from 1132px a
|
|
10
10
|
* 358px one. Open a place for its Details: they float over the map until 1132px, then take a
|
|
11
11
|
* 358px third column. Every threshold is the layout's own width, not the viewport's.
|
|
12
12
|
*/
|
|
@@ -30,7 +30,7 @@ export declare const CollapsedCard: Story;
|
|
|
30
30
|
/**
|
|
31
31
|
* Drag the dashed window's right edge. The panes switch on the layout's own width: List becomes
|
|
32
32
|
* a 290px column at 698px, and at 1132px List widens to 358px and Details takes its 358px
|
|
33
|
-
* column, with
|
|
33
|
+
* column, with its render-prop content changing at the same moment. No browser resize needed,
|
|
34
34
|
* which is the point: the viewport never changes here.
|
|
35
35
|
*/
|
|
36
36
|
export declare const ResizableContainer: Story;
|
|
@@ -38,7 +38,7 @@ export declare const ResizableContainer: Story;
|
|
|
38
38
|
export declare const DefaultOpenAndCloseDetails: Story;
|
|
39
39
|
/** Closes the rooms Panel and checks that the map and the open place were mounted under it all along. */
|
|
40
40
|
export declare const PanelBackKeepsDetails: Story;
|
|
41
|
-
/** Resizes the chat window through the tiers and checks where each pane is drawn
|
|
41
|
+
/** Resizes the chat window through the tiers and checks where each pane is drawn. */
|
|
42
42
|
export declare const ResizableContainerSwitchesPanes: Story;
|
|
43
43
|
/** Expands the collapsed card from its header and checks it only then claims the chat window's width. */
|
|
44
44
|
export declare const CollapsedCardExpands: Story;
|
package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-card-three-column-layout.stories.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAkC5D,OAAO,EACL,yBAAyB,EAK1B,MAAM,iCAAiC,CAAC;AAGzC,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,0CAA0C,CAAC;AAE1G,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,yBAAyB,CAyChD,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,yBAAyB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-card-three-column-layout.stories.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAkC5D,OAAO,EACL,yBAAyB,EAK1B,MAAM,iCAAiC,CAAC;AAGzC,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,0CAA0C,CAAC;AAE1G,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,yBAAyB,CAyChD,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,yBAAyB,CAAC,CAAC;AA+GxD;;;;;GAKG;AACH,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,eAAe,EAAE,KAO7B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AAEF,sFAAsF;AACtF,eAAO,MAAM,cAAc,EAAE,KAQ5B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,KAM3B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAQhC,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,0BAA0B,EAAE,KAqCxC,CAAC;AAEF,yGAAyG;AACzG,eAAO,MAAM,qBAAqB,EAAE,KAoCnC,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,+BAA+B,EAAE,KAqD7C,CAAC;AAEF,yGAAyG;AACzG,eAAO,MAAM,oBAAoB,EAAE,KA2BlC,CAAC;AAEF,kIAAkI;AAClI,eAAO,MAAM,QAAQ,EAAE,KAsFtB,CAAC;AAEF,UAAU,wCAAwC;IAChD,gBAAgB,EAAE,yCAAyC,CAAC;IAC5D,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,iBAAS,mCAAmC,CAAC,EAC3C,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,SAAS,EACT,UAAU,EACV,QAAQ,EACR,UAAU,EACV,cAAc,EACd,YAAY,EACZ,YAAY,GACb,EAAE,wCAAwC,+BA2D1C;AAED,2HAA2H;AAC3H,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,OAAO,mCAAmC,CAwC3E,CAAC"}
|
package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.d.ts
CHANGED
|
@@ -24,15 +24,16 @@ export declare const DEFAULT_DETAILS_PLACEMENT: ChatCardThreeColumnLayoutDetails
|
|
|
24
24
|
*/
|
|
25
25
|
export declare const chatCardThreeColumnLayoutVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
26
26
|
/**
|
|
27
|
-
* Column 1
|
|
28
|
-
*
|
|
29
|
-
* the
|
|
27
|
+
* Column 1 at `lg` and `xl`. Below that the grid has no `list` area, so the column classes
|
|
28
|
+
* are keyed on the size: naming a missing area would add a stray track. `hideOnMobile`
|
|
29
|
+
* hides the pane at those sizes, without unmounting it.
|
|
30
30
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* grid item grows to its content and the card gets taller instead of scrolling.
|
|
31
|
+
* In the column, `min-h-0` + `overflow-hidden` keep a long list inside the row. Without them
|
|
32
|
+
* the grid item grows to its content and the card gets taller instead of scrolling.
|
|
34
33
|
*/
|
|
35
|
-
export declare const chatCardThreeColumnLayoutListVariants: (props?:
|
|
34
|
+
export declare const chatCardThreeColumnLayoutListVariants: (props?: ({
|
|
35
|
+
hideOnMobile?: boolean | null | undefined;
|
|
36
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
36
37
|
/**
|
|
37
38
|
* Column 2, the flexible `1fr` track. `min-w-0` because a grid item's minimum width is its
|
|
38
39
|
* content by default: a map or a wide table would push the track past the card. `relative`
|
|
@@ -47,9 +48,8 @@ export declare const chatCardThreeColumnLayoutMainVariants: (props?: import('cla
|
|
|
47
48
|
* - sheet: on a narrow layout, a bottom sheet at a fixed 85% height, so the pane does not
|
|
48
49
|
* change height as its content changes (the content scrolls instead)
|
|
49
50
|
*
|
|
50
|
-
* `z-20` keeps a floating Details above
|
|
51
|
-
*
|
|
52
|
-
* widening the `1fr` track past the card.
|
|
51
|
+
* `z-20` keeps a floating Details above Main's own overlays. `min-w-0` + `max-w-full` stop
|
|
52
|
+
* the fixed width from widening the `1fr` track past the card.
|
|
53
53
|
*/
|
|
54
54
|
export declare const chatCardThreeColumnLayoutDetailsVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
55
55
|
/**
|
|
@@ -57,9 +57,9 @@ export declare const chatCardThreeColumnLayoutDetailsVariants: (props?: import('
|
|
|
57
57
|
* card (all reviews, a filter form) while Main and Details stay mounted underneath.
|
|
58
58
|
*
|
|
59
59
|
* It spans columns in row 1 instead of being `absolute`, so it follows the grid template:
|
|
60
|
-
* from column 2 to the last one when List is a column, all of them
|
|
61
|
-
* never adds a track, so mounting it doesn't move Main. `z-30` keeps it above floating
|
|
62
|
-
* Details (`z-20`)
|
|
60
|
+
* from column 2 to the last one when List is a column (`lg`, `xl`), all of them otherwise.
|
|
61
|
+
* It never adds a track, so mounting it doesn't move Main. `z-30` keeps it above floating
|
|
62
|
+
* Details (`z-20`).
|
|
63
63
|
*/
|
|
64
64
|
export declare const chatCardThreeColumnLayoutPanelVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
65
65
|
/**
|
package/dist/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-card-three-column-layout.variants.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,MAAM,yCAAyC,GAAG,YAAY,GAAG,UAAU,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,yCAAwD,CAAC;AAmBjG;;;;;;;GAOG;AACH,eAAO,MAAM,iCAAiC,oFAS5C,CAAC;AAEH
|
|
1
|
+
{"version":3,"file":"chat-card-three-column-layout.variants.d.ts","sourceRoot":"","sources":["../../../src/layouts/chat-card-three-column-layout/chat-card-three-column-layout.variants.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,MAAM,yCAAyC,GAAG,YAAY,GAAG,UAAU,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,yCAAwD,CAAC;AAmBjG;;;;;;;GAOG;AACH,eAAO,MAAM,iCAAiC,oFAS5C,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,qCAAqC;;8EAiBjD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,oFAEhD,CAAC;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,wCAAwC,oFAMnD,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,sCAAsC,oFAIjD,CAAC;AAEH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qCAAqC,oFAIhD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swisper.ai/web-chat-ui",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "React components for the Swisper chat: messages, composer and cards",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"@radix-ui/react-slot": "^1.1.0",
|
|
66
66
|
"@shadcn/react": "^0.3.1",
|
|
67
67
|
"@swisper.ai/design-system": "0.0.4",
|
|
68
|
-
"@swisper.ai/icons": "0.0.
|
|
68
|
+
"@swisper.ai/icons": "0.0.5",
|
|
69
69
|
"@swisper.ai/tailwind-config": "0.0.4",
|
|
70
|
-
"@swisper.ai/ui": "0.
|
|
71
|
-
"@swisper.ai/web-core": "0.0.
|
|
70
|
+
"@swisper.ai/ui": "0.4.0",
|
|
71
|
+
"@swisper.ai/web-core": "0.0.4",
|
|
72
72
|
"@tanstack/react-virtual": "^3.14.5",
|
|
73
73
|
"chroma-js": "^3.2.0",
|
|
74
74
|
"class-variance-authority": "^0.7.1",
|
|
@@ -97,9 +97,9 @@
|
|
|
97
97
|
"zustand": "^5.0.5"
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
100
|
-
"@fintama/swisper-int-storybook-theme": "0.0.
|
|
100
|
+
"@fintama/swisper-int-storybook-theme": "0.0.2",
|
|
101
101
|
"@fintama/swisper-int-vite-config": "0.0.1",
|
|
102
|
-
"@fintama/swisper-int-vitest-config": "0.0.
|
|
102
|
+
"@fintama/swisper-int-vitest-config": "0.0.2",
|
|
103
103
|
"@storybook/addon-a11y": "10.6.0",
|
|
104
104
|
"@storybook/addon-docs": "10.6.0",
|
|
105
105
|
"@storybook/addon-vitest": "10.6.0",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
|
|
3
|
-
import { ChevronDownIcon } from '@swisper.ai/icons';
|
|
4
3
|
import {
|
|
4
|
+
CollapsibleChevron,
|
|
5
5
|
CollapsibleTrigger,
|
|
6
6
|
IconButton,
|
|
7
7
|
Tooltip,
|
|
@@ -264,14 +264,10 @@ export function ChatCardCollapsibleButton({ className, ...rest }: ChatCardCollap
|
|
|
264
264
|
data-slot="chat-card-collapsible-button"
|
|
265
265
|
shouldPreventCollapse={false}
|
|
266
266
|
isSemantic={false}
|
|
267
|
-
className={
|
|
268
|
-
'transition-transform duration-300',
|
|
269
|
-
'group-data-[state=open]/collapsible:rotate-180',
|
|
270
|
-
className,
|
|
271
|
-
)}
|
|
267
|
+
className={className}
|
|
272
268
|
{...rest}
|
|
273
269
|
>
|
|
274
|
-
<
|
|
270
|
+
<CollapsibleChevron />
|
|
275
271
|
</ChatCardActionButton>
|
|
276
272
|
);
|
|
277
273
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AnimatePresence, motion } from 'motion/react';
|
|
2
2
|
import React, { forwardRef, type ComponentProps, type ReactNode, useMemo } from 'react';
|
|
3
3
|
|
|
4
|
-
import { ChevronDownIcon } from '@swisper.ai/icons';
|
|
5
4
|
import {
|
|
6
5
|
Collapsible,
|
|
6
|
+
CollapsibleChevron,
|
|
7
7
|
CollapsibleContent,
|
|
8
8
|
CollapsibleTrigger,
|
|
9
9
|
Typography,
|
|
@@ -144,20 +144,12 @@ export function ChatThinkingProcessTriggerArrow({
|
|
|
144
144
|
...rest
|
|
145
145
|
}: ChatThinkingProcessTriggerArrowProps) {
|
|
146
146
|
return (
|
|
147
|
-
<
|
|
147
|
+
<CollapsibleChevron
|
|
148
148
|
data-slot="chat-thinking-process-trigger-arrow"
|
|
149
149
|
data-testid="chat-thinking-process-trigger-arrow"
|
|
150
|
-
|
|
151
|
-
className={cn(
|
|
152
|
-
'inline-flex shrink-0 items-center justify-center text-text-secondary',
|
|
153
|
-
'transition-transform duration-300',
|
|
154
|
-
'group-data-[state=open]/collapsible:rotate-180',
|
|
155
|
-
className,
|
|
156
|
-
)}
|
|
150
|
+
className={cn('items-center justify-center text-text-secondary', className)}
|
|
157
151
|
{...rest}
|
|
158
|
-
|
|
159
|
-
<ChevronDownIcon />
|
|
160
|
-
</span>
|
|
152
|
+
/>
|
|
161
153
|
);
|
|
162
154
|
}
|
|
163
155
|
|
|
@@ -43,16 +43,26 @@ async function settle() {
|
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
//
|
|
47
|
-
|
|
46
|
+
// jsdom has no `matchMedia`, so the function is assigned rather than spied on.
|
|
47
|
+
const { matchMedia } = window;
|
|
48
|
+
|
|
49
|
+
// The editor reads the desktop breakpoint token and matches it to decide whether to refocus; no
|
|
50
|
+
// stylesheet is loaded here.
|
|
48
51
|
beforeEach(() => {
|
|
49
52
|
document.documentElement.style.setProperty('--breakpoint-lg', '1024px');
|
|
53
|
+
window.matchMedia = ((query: string) => ({
|
|
54
|
+
matches: true,
|
|
55
|
+
media: query,
|
|
56
|
+
addEventListener() {},
|
|
57
|
+
removeEventListener() {},
|
|
58
|
+
})) as unknown as typeof window.matchMedia;
|
|
50
59
|
});
|
|
51
60
|
|
|
52
61
|
afterEach(() => {
|
|
53
62
|
cleanup();
|
|
54
63
|
vi.restoreAllMocks();
|
|
55
64
|
document.documentElement.style.removeProperty('--breakpoint-lg');
|
|
65
|
+
window.matchMedia = matchMedia;
|
|
56
66
|
});
|
|
57
67
|
|
|
58
68
|
describe('a value the parent renders', () => {
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import { ScrollArea, Typography } from '@swisper.ai/ui';
|
|
2
|
-
import { cn } from '@swisper.ai/web-core';
|
|
3
2
|
|
|
4
3
|
import type { Stay } from './types';
|
|
5
4
|
|
|
6
5
|
export interface StayListProps {
|
|
7
6
|
stays: Stay[];
|
|
8
|
-
/** Whether the List pane floats: a swipe strip over the map, not a scrolling column. */
|
|
9
|
-
isFloating: boolean;
|
|
10
7
|
selectedId: string | null;
|
|
11
8
|
onOpen: (stayId: string) => void;
|
|
12
9
|
}
|
|
13
10
|
|
|
14
|
-
/** The search results: a scrolling column of rows
|
|
15
|
-
export function StayList({ stays,
|
|
11
|
+
/** The search results: a scrolling column of rows. */
|
|
12
|
+
export function StayList({ stays, selectedId, onOpen }: StayListProps) {
|
|
16
13
|
const list = (
|
|
17
|
-
<ul className=
|
|
14
|
+
<ul className="flex flex-col gap-8">
|
|
18
15
|
{stays.map((stay) => (
|
|
19
|
-
<li key={stay.id}
|
|
16
|
+
<li key={stay.id}>
|
|
20
17
|
<button
|
|
21
18
|
type="button"
|
|
22
19
|
aria-pressed={stay.id === selectedId}
|
|
@@ -45,6 +42,6 @@ export function StayList({ stays, isFloating, selectedId, onOpen }: StayListProp
|
|
|
45
42
|
</ul>
|
|
46
43
|
);
|
|
47
44
|
|
|
48
|
-
// The
|
|
49
|
-
return
|
|
45
|
+
// The scroll area keeps a long list inside the column's row.
|
|
46
|
+
return <ScrollArea className="h-full">{list}</ScrollArea>;
|
|
50
47
|
}
|
|
@@ -3,8 +3,8 @@ import { describe, expect, test } from 'vitest';
|
|
|
3
3
|
import { resolveLayout } from '../chat-card-three-column-layout.sizing';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* The thresholds are the whole feature: every pane decision, in CSS and in
|
|
7
|
-
*
|
|
6
|
+
* The thresholds are the whole feature: every pane decision, in CSS and in Details' render
|
|
7
|
+
* prop, comes from this function. Each boundary is tested at its exact pixel and one
|
|
8
8
|
* below, so an off-by-one (a `>` for a `>=`, a forgotten gap) shows up here instead of as
|
|
9
9
|
* a pane that floats with room to spare.
|
|
10
10
|
*/
|
|
@@ -25,10 +25,10 @@ describe('size tiers', () => {
|
|
|
25
25
|
|
|
26
26
|
describe('with responsive placement', () => {
|
|
27
27
|
test.each([
|
|
28
|
-
[500, {
|
|
29
|
-
[660, {
|
|
30
|
-
[800, {
|
|
31
|
-
[1200, {
|
|
28
|
+
[500, { isDetailsFloating: true, isDetailsSheet: true }],
|
|
29
|
+
[660, { isDetailsFloating: true, isDetailsSheet: false }],
|
|
30
|
+
[800, { isDetailsFloating: true, isDetailsSheet: false }],
|
|
31
|
+
[1200, { isDetailsFloating: false, isDetailsSheet: false }],
|
|
32
32
|
])('at %ipx resolves %o', (width, expected) => {
|
|
33
33
|
expect(resolveLayout(width, 'responsive')).toMatchObject(expected);
|
|
34
34
|
});
|
|
@@ -43,13 +43,12 @@ describe('with responsive placement', () => {
|
|
|
43
43
|
describe('with floating placement', () => {
|
|
44
44
|
// The tiers still apply to List; only Details is kept off its column.
|
|
45
45
|
test.each([
|
|
46
|
-
[500, 'sm'
|
|
47
|
-
[800, 'lg'
|
|
48
|
-
[1920, 'xl'
|
|
49
|
-
])('at %ipx is %s
|
|
46
|
+
[500, 'sm'],
|
|
47
|
+
[800, 'lg'],
|
|
48
|
+
[1920, 'xl'],
|
|
49
|
+
])('at %ipx is %s, and details floats', (width, size) => {
|
|
50
50
|
expect(resolveLayout(width, 'floating')).toMatchObject({
|
|
51
51
|
size,
|
|
52
|
-
isListFloating,
|
|
53
52
|
isDetailsFloating: true,
|
|
54
53
|
});
|
|
55
54
|
});
|
|
@@ -61,7 +60,6 @@ describe('before the layout is measured', () => {
|
|
|
61
60
|
test('resolves to xl', () => {
|
|
62
61
|
expect(resolveLayout('unset', 'responsive')).toEqual({
|
|
63
62
|
size: 'xl',
|
|
64
|
-
isListFloating: false,
|
|
65
63
|
isDetailsFloating: false,
|
|
66
64
|
isDetailsSheet: false,
|
|
67
65
|
});
|
package/src/layouts/chat-card-three-column-layout/__tests__/chat-card-three-column-layout.spec.tsx
CHANGED
|
@@ -14,8 +14,8 @@ import type { ChatCardThreeColumnLayoutProps } from '../chat-card-three-column-l
|
|
|
14
14
|
* The thresholds have their own table in `chat-card-three-column-layout.sizing.test.ts`.
|
|
15
15
|
* What this file locks is the wiring: the root measures itself, and the width it measures
|
|
16
16
|
* reaches both halves of the contract. That means the data attributes the CSS keys on and
|
|
17
|
-
* the `isFloating`
|
|
18
|
-
* in a
|
|
17
|
+
* the `isFloating` Details' render prop receives. If they disagree, floating content gets
|
|
18
|
+
* drawn in a column, and no single-width visual check would notice.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
type ResizeCallback = (
|
|
@@ -63,9 +63,7 @@ afterEach(() => {
|
|
|
63
63
|
function renderLayout(props: Partial<ChatCardThreeColumnLayoutProps> = {}) {
|
|
64
64
|
return render(
|
|
65
65
|
<ChatCardThreeColumnLayout {...props}>
|
|
66
|
-
<ChatCardThreeColumnLayoutList>
|
|
67
|
-
{(isFloating) => <span>{isFloating ? 'list: strip' : 'list: column'}</span>}
|
|
68
|
-
</ChatCardThreeColumnLayoutList>
|
|
66
|
+
<ChatCardThreeColumnLayoutList>list</ChatCardThreeColumnLayoutList>
|
|
69
67
|
<ChatCardThreeColumnLayoutMain>map</ChatCardThreeColumnLayoutMain>
|
|
70
68
|
<ChatCardThreeColumnLayoutDetails>
|
|
71
69
|
{(isFloating) => <span>{isFloating ? 'details: floating' : 'details: column'}</span>}
|
|
@@ -82,30 +80,32 @@ function root() {
|
|
|
82
80
|
return screen.getByTestId('chat-card-three-column-layout');
|
|
83
81
|
}
|
|
84
82
|
|
|
83
|
+
function list() {
|
|
84
|
+
return screen.getByTestId('chat-card-three-column-layout-list');
|
|
85
|
+
}
|
|
86
|
+
|
|
85
87
|
function details() {
|
|
86
88
|
return screen.getByTestId('chat-card-three-column-layout-details');
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
describe('the measured width', () => {
|
|
90
92
|
test.each([
|
|
91
|
-
[500, '
|
|
92
|
-
[800, '
|
|
93
|
-
[1200, '
|
|
94
|
-
])('at %ipx renders "%s"
|
|
93
|
+
[500, 'details: floating'],
|
|
94
|
+
[800, 'details: floating'],
|
|
95
|
+
[1200, 'details: column'],
|
|
96
|
+
])('at %ipx renders "%s"', (width, detailsText) => {
|
|
95
97
|
layoutWidth = width;
|
|
96
98
|
const { container } = renderLayout();
|
|
97
99
|
|
|
98
|
-
expect(text(container)).toContain(list);
|
|
99
100
|
expect(text(container)).toContain(detailsText);
|
|
100
101
|
});
|
|
101
102
|
|
|
102
103
|
// The CSS switches on these attributes, so they must carry the same decision the render
|
|
103
|
-
//
|
|
104
|
+
// prop received. That agreement is why the layout is resolved once, at the root.
|
|
104
105
|
test('reaches the attributes the CSS keys on', () => {
|
|
105
106
|
layoutWidth = 800;
|
|
106
107
|
renderLayout();
|
|
107
108
|
|
|
108
|
-
expect(root().getAttribute('data-list-floating')).toBe('false');
|
|
109
109
|
expect(root().getAttribute('data-details-floating')).toBe('true');
|
|
110
110
|
expect(details().getAttribute('data-floating')).toBe('true');
|
|
111
111
|
expect(details().getAttribute('data-sheet')).toBe('false');
|
|
@@ -123,6 +123,18 @@ describe('the measured width', () => {
|
|
|
123
123
|
expect(root().getAttribute('data-size')).toBe(size);
|
|
124
124
|
});
|
|
125
125
|
|
|
126
|
+
// List and Panel are placed by the tier too, and their recipes key on their own attribute.
|
|
127
|
+
test.each([
|
|
128
|
+
[500, 'sm'],
|
|
129
|
+
[800, 'lg'],
|
|
130
|
+
[1200, 'xl'],
|
|
131
|
+
])('at %ipx gives List size %s', (width, size) => {
|
|
132
|
+
layoutWidth = width;
|
|
133
|
+
renderLayout();
|
|
134
|
+
|
|
135
|
+
expect(list().getAttribute('data-size')).toBe(size);
|
|
136
|
+
});
|
|
137
|
+
|
|
126
138
|
test('marks a floating details pane as a sheet on a narrow layout', () => {
|
|
127
139
|
layoutWidth = 500;
|
|
128
140
|
renderLayout();
|
|
@@ -144,12 +156,10 @@ describe('resizing', () => {
|
|
|
144
156
|
|
|
145
157
|
resizeTo(500);
|
|
146
158
|
|
|
147
|
-
expect(text(container)).toContain('list: strip');
|
|
148
159
|
expect(text(container)).toContain('details: floating');
|
|
149
160
|
|
|
150
161
|
resizeTo(1440);
|
|
151
162
|
|
|
152
|
-
expect(text(container)).toContain('list: column');
|
|
153
163
|
expect(text(container)).toContain('details: column');
|
|
154
164
|
});
|
|
155
165
|
|
|
@@ -157,11 +167,11 @@ describe('resizing', () => {
|
|
|
157
167
|
// pane would drop the consumer's scroll position and any state above the render prop.
|
|
158
168
|
test('keeps the same pane element across a threshold', () => {
|
|
159
169
|
renderLayout();
|
|
160
|
-
const before =
|
|
170
|
+
const before = details();
|
|
161
171
|
|
|
162
172
|
resizeTo(500);
|
|
163
173
|
|
|
164
|
-
expect(
|
|
174
|
+
expect(details()).toBe(before);
|
|
165
175
|
});
|
|
166
176
|
});
|
|
167
177
|
|
|
@@ -180,7 +190,7 @@ describe('the root element', () => {
|
|
|
180
190
|
});
|
|
181
191
|
|
|
182
192
|
describe('the parts', () => {
|
|
183
|
-
test('
|
|
193
|
+
test('Details accepts plain children as well as a render prop', () => {
|
|
184
194
|
render(
|
|
185
195
|
<ChatCardThreeColumnLayout>
|
|
186
196
|
<ChatCardThreeColumnLayoutList>plain list</ChatCardThreeColumnLayoutList>
|
|
@@ -234,6 +244,41 @@ describe('the parts', () => {
|
|
|
234
244
|
});
|
|
235
245
|
});
|
|
236
246
|
|
|
247
|
+
describe('hideOnMobile on List', () => {
|
|
248
|
+
function renderList(hideOnMobile?: boolean) {
|
|
249
|
+
return render(
|
|
250
|
+
<ChatCardThreeColumnLayout>
|
|
251
|
+
<ChatCardThreeColumnLayoutList hideOnMobile={hideOnMobile}>
|
|
252
|
+
list
|
|
253
|
+
</ChatCardThreeColumnLayoutList>
|
|
254
|
+
<ChatCardThreeColumnLayoutMain>map</ChatCardThreeColumnLayoutMain>
|
|
255
|
+
</ChatCardThreeColumnLayout>,
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// jsdom applies no Tailwind, so the classes are what can be checked: hidden at sm and md only.
|
|
260
|
+
test('hides the pane on a layout with no List column', () => {
|
|
261
|
+
renderList(true);
|
|
262
|
+
|
|
263
|
+
expect(list().className).toContain('data-[size=sm]:hidden');
|
|
264
|
+
expect(list().className).toContain('data-[size=md]:hidden');
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
test('leaves the pane alone by default', () => {
|
|
268
|
+
renderList();
|
|
269
|
+
|
|
270
|
+
expect(list().className).not.toContain(':hidden');
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
// Hidden, not unmounted: the list's scroll position and state come back with the column.
|
|
274
|
+
test('keeps the pane mounted when it is hidden', () => {
|
|
275
|
+
layoutWidth = 500;
|
|
276
|
+
renderList(true);
|
|
277
|
+
|
|
278
|
+
expect(screen.getByText('list')).not.toBeNull();
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
|
|
237
282
|
describe('the panel', () => {
|
|
238
283
|
function renderWithPanel() {
|
|
239
284
|
return render(
|
|
@@ -250,25 +295,25 @@ describe('the panel', () => {
|
|
|
250
295
|
return screen.getByTestId('chat-card-three-column-layout-panel');
|
|
251
296
|
}
|
|
252
297
|
|
|
253
|
-
// The CSS spans the panel from column 2 while List is a column, and over all of
|
|
254
|
-
//
|
|
298
|
+
// The CSS spans the panel from column 2 while List is a column (lg, xl), and over all of
|
|
299
|
+
// it otherwise; this attribute is the switch.
|
|
255
300
|
test.each([
|
|
256
|
-
[500, '
|
|
257
|
-
[800, '
|
|
258
|
-
[1200, '
|
|
259
|
-
])('at %ipx publishes
|
|
301
|
+
[500, 'sm'],
|
|
302
|
+
[800, 'lg'],
|
|
303
|
+
[1200, 'xl'],
|
|
304
|
+
])('at %ipx publishes size %s', (width, size) => {
|
|
260
305
|
layoutWidth = width;
|
|
261
306
|
renderWithPanel();
|
|
262
307
|
|
|
263
|
-
expect(panel().getAttribute('data-
|
|
308
|
+
expect(panel().getAttribute('data-size')).toBe(size);
|
|
264
309
|
});
|
|
265
310
|
|
|
266
|
-
test('follows
|
|
311
|
+
test('follows the layout when it is resized', () => {
|
|
267
312
|
renderWithPanel();
|
|
268
313
|
|
|
269
314
|
resizeTo(500);
|
|
270
315
|
|
|
271
|
-
expect(panel().getAttribute('data-
|
|
316
|
+
expect(panel().getAttribute('data-size')).toBe('sm');
|
|
272
317
|
});
|
|
273
318
|
|
|
274
319
|
// The point of the panel over a replacement view: the map and the open item keep their state.
|