@cognite/aura 1.46766.0 → 1.46840.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.
Files changed (29) hide show
  1. package/DESIGN.md +12 -0
  2. package/dist/components/ui/core/alert/alert.gallery.d.ts +2 -0
  3. package/dist/components/ui/core/alert/alert.gallery.js +54 -0
  4. package/dist/components/ui/core/alert/alert.gallery.js.map +1 -0
  5. package/dist/components/ui/core/avatar/avatar.gallery.d.ts +2 -0
  6. package/dist/components/ui/core/avatar/avatar.gallery.js +67 -0
  7. package/dist/components/ui/core/avatar/avatar.gallery.js.map +1 -0
  8. package/dist/components/ui/core/badge/badge.gallery.d.ts +2 -0
  9. package/dist/components/ui/core/badge/badge.gallery.js +64 -0
  10. package/dist/components/ui/core/badge/badge.gallery.js.map +1 -0
  11. package/dist/components/ui/core/checkbox/checkbox.gallery.d.ts +2 -0
  12. package/dist/components/ui/core/checkbox/checkbox.gallery.js +36 -0
  13. package/dist/components/ui/core/checkbox/checkbox.gallery.js.map +1 -0
  14. package/dist/components/ui/core/message/message-response-default-streamdown-controls.d.ts +4 -5
  15. package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +5 -6
  16. package/dist/components/ui/core/message/message-response-default-streamdown-controls.js.map +1 -1
  17. package/dist/components/ui/core/message/message.js +6 -1
  18. package/dist/components/ui/core/message/message.js.map +1 -1
  19. package/dist/components/ui/core/switch/switch.gallery.d.ts +2 -0
  20. package/dist/components/ui/core/switch/switch.gallery.js +67 -0
  21. package/dist/components/ui/core/switch/switch.gallery.js.map +1 -0
  22. package/dist/styles.css +1 -1
  23. package/dist/styles.source.css +14 -0
  24. package/package.json +2 -2
  25. package/src/components/ui/core/alert/alert.md +46 -0
  26. package/src/components/ui/core/avatar/avatar.md +30 -0
  27. package/src/components/ui/core/badge/badge.md +32 -0
  28. package/src/components/ui/core/checkbox/checkbox.md +37 -0
  29. package/src/components/ui/core/switch/switch.md +26 -0
package/DESIGN.md CHANGED
@@ -991,6 +991,12 @@ Anytime you need to reference a component in Storybook, use the following URL an
991
991
 
992
992
  Anytime you need to reference a component in docs, use the following URL and replace the slug with the component's doc slug: https://docs.cognite.com/aura-design-system/primitives/{docs-slug}
993
993
 
994
+ #### Component guidance files
995
+
996
+ Some components have full usage guidance in a Markdown file next to their source, linked from their section below as **Full guidance**.
997
+ These files ship in the npm package and are importable as `@cognite/aura/docs/{component}`, with a matching example gallery at `@cognite/aura/examples/{component}`.
998
+ When a component has a guidance file, treat it as the primary reference and its section below as a summary.
999
+
994
1000
  #### Accordion
995
1001
 
996
1002
  **Storybook-slug:** accordion
@@ -1068,6 +1074,7 @@ Action toolbar is a transient bottom-aligned action row that appears when users
1068
1074
 
1069
1075
  **Storybook-slug:** alert
1070
1076
  **Docs-slug:** alert
1077
+ **Full guidance:** [alert.md](./src/components/ui/core/alert/alert.md)
1071
1078
 
1072
1079
  **Definition**
1073
1080
  Alert communicates contextual, medium-emphasis information inside page/task flow. It is not a blocking modal.
@@ -1126,6 +1133,7 @@ Short, focused confirmation or acknowledgment that interrupts the user for a cle
1126
1133
 
1127
1134
  **Storybook-slug:** avatar
1128
1135
  **Docs-slug:** avatar
1136
+ **Full guidance:** [avatar.md](./src/components/ui/core/avatar/avatar.md)
1129
1137
 
1130
1138
  **Definition**
1131
1139
  Avatar visually represents a user, team, or concept and helps recognition in collaborative UI.
@@ -1151,6 +1159,7 @@ Avatar visually represents a user, team, or concept and helps recognition in col
1151
1159
 
1152
1160
  **Storybook-slug:** badge
1153
1161
  **Docs-slug:** badge
1162
+ **Full guidance:** [badge.md](./src/components/ui/core/badge/badge.md)
1154
1163
 
1155
1164
  **Definition**
1156
1165
  Compact label for status, category, or metadata.
@@ -1227,6 +1236,7 @@ Hierarchical navigation aid that shows users their current location within the p
1227
1236
 
1228
1237
  **Storybook-slug:** button
1229
1238
  **Docs-slug:** button
1239
+ **Full guidance:** [button.md](./src/components/ui/core/button/button.md)
1230
1240
 
1231
1241
  **Definition**
1232
1242
  Primary control for discrete actions.
@@ -1299,6 +1309,7 @@ A structural container with optional header, body, and footer slots for displayi
1299
1309
 
1300
1310
  **Storybook-slug:** checkbox
1301
1311
  **Docs-slug:** checkbox
1312
+ **Full guidance:** [checkbox.md](./src/components/ui/core/checkbox/checkbox.md)
1302
1313
 
1303
1314
  **Definition**
1304
1315
  Enables users to independently select one or multiple options. Can appear standalone or within menus, tree views, tables, or cards.
@@ -2074,6 +2085,7 @@ Lightweight, auto-dismiss feedback for outcomes that do not need a blocking surf
2074
2085
 
2075
2086
  **Storybook-slug:** switch
2076
2087
  **Docs-slug:** switch
2088
+ **Full guidance:** [switch.md](./src/components/ui/core/switch/switch.md)
2077
2089
 
2078
2090
  **Definition**
2079
2091
  A binary toggle control that turns a setting on or off, with changes taking effect immediately.
@@ -0,0 +1,2 @@
1
+ import type { ReactElement } from "react";
2
+ export declare function AlertGallery(): ReactElement;
@@ -0,0 +1,54 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Alert, AlertDescription, AlertTitle } from "./alert.js";
3
+ export function AlertGallery() {
4
+ return /*#__PURE__*/ _jsxs("div", {
5
+ className: "w-100 space-y-4",
6
+ children: [
7
+ /*#__PURE__*/ _jsxs(Alert, {
8
+ children: [
9
+ /*#__PURE__*/ _jsx(AlertTitle, {
10
+ children: "Default Alert"
11
+ }),
12
+ /*#__PURE__*/ _jsx(AlertDescription, {
13
+ children: "This is the default alert style."
14
+ })
15
+ ]
16
+ }),
17
+ /*#__PURE__*/ _jsxs(Alert, {
18
+ variant: "info",
19
+ children: [
20
+ /*#__PURE__*/ _jsx(AlertTitle, {
21
+ children: "Info Alert"
22
+ }),
23
+ /*#__PURE__*/ _jsx(AlertDescription, {
24
+ children: "This is the info alert style."
25
+ })
26
+ ]
27
+ }),
28
+ /*#__PURE__*/ _jsxs(Alert, {
29
+ variant: "warning",
30
+ children: [
31
+ /*#__PURE__*/ _jsx(AlertTitle, {
32
+ children: "Warning Alert"
33
+ }),
34
+ /*#__PURE__*/ _jsx(AlertDescription, {
35
+ children: "This is the warning alert style."
36
+ })
37
+ ]
38
+ }),
39
+ /*#__PURE__*/ _jsxs(Alert, {
40
+ variant: "error",
41
+ children: [
42
+ /*#__PURE__*/ _jsx(AlertTitle, {
43
+ children: "Error Alert"
44
+ }),
45
+ /*#__PURE__*/ _jsx(AlertDescription, {
46
+ children: "This is the error alert style."
47
+ })
48
+ ]
49
+ })
50
+ ]
51
+ });
52
+ }
53
+
54
+ //# sourceMappingURL=alert.gallery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/components/ui/core/alert/alert.gallery.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\n\nimport { Alert, AlertDescription, AlertTitle } from './alert';\n\nexport function AlertGallery(): ReactElement {\n return (\n <div className=\"w-100 space-y-4\">\n <Alert>\n <AlertTitle>Default Alert</AlertTitle>\n <AlertDescription>This is the default alert style.</AlertDescription>\n </Alert>\n <Alert variant=\"info\">\n <AlertTitle>Info Alert</AlertTitle>\n <AlertDescription>This is the info alert style.</AlertDescription>\n </Alert>\n <Alert variant=\"warning\">\n <AlertTitle>Warning Alert</AlertTitle>\n <AlertDescription>This is the warning alert style.</AlertDescription>\n </Alert>\n <Alert variant=\"error\">\n <AlertTitle>Error Alert</AlertTitle>\n <AlertDescription>This is the error alert style.</AlertDescription>\n </Alert>\n </div>\n );\n}\n"],"names":["Alert","AlertDescription","AlertTitle","AlertGallery","div","className","variant"],"mappings":";AAEA,SAASA,KAAK,EAAEC,gBAAgB,EAAEC,UAAU,QAAQ,aAAU;AAE9D,OAAO,SAASC;IACd,qBACE,MAACC;QAAIC,WAAU;;0BACb,MAACL;;kCACC,KAACE;kCAAW;;kCACZ,KAACD;kCAAiB;;;;0BAEpB,MAACD;gBAAMM,SAAQ;;kCACb,KAACJ;kCAAW;;kCACZ,KAACD;kCAAiB;;;;0BAEpB,MAACD;gBAAMM,SAAQ;;kCACb,KAACJ;kCAAW;;kCACZ,KAACD;kCAAiB;;;;0BAEpB,MAACD;gBAAMM,SAAQ;;kCACb,KAACJ;kCAAW;;kCACZ,KAACD;kCAAiB;;;;;;AAI1B"}
@@ -0,0 +1,2 @@
1
+ import type { ReactElement } from "react";
2
+ export declare function AvatarGallery(): ReactElement;
@@ -0,0 +1,67 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Avatar, AvatarFallback } from "./avatar.js";
3
+ export function AvatarGallery() {
4
+ return /*#__PURE__*/ _jsxs("div", {
5
+ className: "flex flex-wrap gap-4",
6
+ children: [
7
+ /*#__PURE__*/ _jsx(Avatar, {
8
+ variant: "decorative-1",
9
+ "aria-label": "Mountain decorative avatar",
10
+ children: /*#__PURE__*/ _jsx(AvatarFallback, {
11
+ children: "PJ"
12
+ })
13
+ }),
14
+ /*#__PURE__*/ _jsx(Avatar, {
15
+ variant: "decorative-2",
16
+ "aria-label": "Fjord decorative avatar",
17
+ children: /*#__PURE__*/ _jsx(AvatarFallback, {
18
+ children: "PJ"
19
+ })
20
+ }),
21
+ /*#__PURE__*/ _jsx(Avatar, {
22
+ variant: "decorative-3",
23
+ "aria-label": "Nordic decorative avatar",
24
+ children: /*#__PURE__*/ _jsx(AvatarFallback, {
25
+ children: "PJ"
26
+ })
27
+ }),
28
+ /*#__PURE__*/ _jsx(Avatar, {
29
+ variant: "decorative-4",
30
+ "aria-label": "Aurora decorative avatar",
31
+ children: /*#__PURE__*/ _jsx(AvatarFallback, {
32
+ children: "PJ"
33
+ })
34
+ }),
35
+ /*#__PURE__*/ _jsx(Avatar, {
36
+ variant: "decorative-5",
37
+ "aria-label": "Dusk decorative avatar",
38
+ children: /*#__PURE__*/ _jsx(AvatarFallback, {
39
+ children: "PJ"
40
+ })
41
+ }),
42
+ /*#__PURE__*/ _jsx(Avatar, {
43
+ variant: "decorative-6",
44
+ "aria-label": "Amber decorative avatar",
45
+ children: /*#__PURE__*/ _jsx(AvatarFallback, {
46
+ children: "PJ"
47
+ })
48
+ }),
49
+ /*#__PURE__*/ _jsx(Avatar, {
50
+ variant: "decorative-7",
51
+ "aria-label": "Pink decorative avatar",
52
+ children: /*#__PURE__*/ _jsx(AvatarFallback, {
53
+ children: "PJ"
54
+ })
55
+ }),
56
+ /*#__PURE__*/ _jsx(Avatar, {
57
+ variant: "overflow",
58
+ "aria-label": "Overflow colorway avatar",
59
+ children: /*#__PURE__*/ _jsx(AvatarFallback, {
60
+ children: "+4"
61
+ })
62
+ })
63
+ ]
64
+ });
65
+ }
66
+
67
+ //# sourceMappingURL=avatar.gallery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/components/ui/core/avatar/avatar.gallery.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\n\nimport { Avatar, AvatarFallback } from './avatar';\n\nexport function AvatarGallery(): ReactElement {\n return (\n <div className=\"flex flex-wrap gap-4\">\n <Avatar variant=\"decorative-1\" aria-label=\"Mountain decorative avatar\">\n <AvatarFallback>PJ</AvatarFallback>\n </Avatar>\n <Avatar variant=\"decorative-2\" aria-label=\"Fjord decorative avatar\">\n <AvatarFallback>PJ</AvatarFallback>\n </Avatar>\n <Avatar variant=\"decorative-3\" aria-label=\"Nordic decorative avatar\">\n <AvatarFallback>PJ</AvatarFallback>\n </Avatar>\n <Avatar variant=\"decorative-4\" aria-label=\"Aurora decorative avatar\">\n <AvatarFallback>PJ</AvatarFallback>\n </Avatar>\n <Avatar variant=\"decorative-5\" aria-label=\"Dusk decorative avatar\">\n <AvatarFallback>PJ</AvatarFallback>\n </Avatar>\n <Avatar variant=\"decorative-6\" aria-label=\"Amber decorative avatar\">\n <AvatarFallback>PJ</AvatarFallback>\n </Avatar>\n <Avatar variant=\"decorative-7\" aria-label=\"Pink decorative avatar\">\n <AvatarFallback>PJ</AvatarFallback>\n </Avatar>\n <Avatar variant=\"overflow\" aria-label=\"Overflow colorway avatar\">\n <AvatarFallback>+4</AvatarFallback>\n </Avatar>\n </div>\n );\n}\n"],"names":["Avatar","AvatarFallback","AvatarGallery","div","className","variant","aria-label"],"mappings":";AAEA,SAASA,MAAM,EAAEC,cAAc,QAAQ,cAAW;AAElD,OAAO,SAASC;IACd,qBACE,MAACC;QAAIC,WAAU;;0BACb,KAACJ;gBAAOK,SAAQ;gBAAeC,cAAW;0BACxC,cAAA,KAACL;8BAAe;;;0BAElB,KAACD;gBAAOK,SAAQ;gBAAeC,cAAW;0BACxC,cAAA,KAACL;8BAAe;;;0BAElB,KAACD;gBAAOK,SAAQ;gBAAeC,cAAW;0BACxC,cAAA,KAACL;8BAAe;;;0BAElB,KAACD;gBAAOK,SAAQ;gBAAeC,cAAW;0BACxC,cAAA,KAACL;8BAAe;;;0BAElB,KAACD;gBAAOK,SAAQ;gBAAeC,cAAW;0BACxC,cAAA,KAACL;8BAAe;;;0BAElB,KAACD;gBAAOK,SAAQ;gBAAeC,cAAW;0BACxC,cAAA,KAACL;8BAAe;;;0BAElB,KAACD;gBAAOK,SAAQ;gBAAeC,cAAW;0BACxC,cAAA,KAACL;8BAAe;;;0BAElB,KAACD;gBAAOK,SAAQ;gBAAWC,cAAW;0BACpC,cAAA,KAACL;8BAAe;;;;;AAIxB"}
@@ -0,0 +1,2 @@
1
+ import type { ReactElement } from "react";
2
+ export declare function BadgeGallery(): ReactElement;
@@ -0,0 +1,64 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { IconAlertTriangle, IconArchive, IconCircleCheck, IconHexagon, IconInnerShadowTopLeft } from "@tabler/icons-react";
3
+ import { Badge } from "./badge.js";
4
+ export function BadgeGallery() {
5
+ return /*#__PURE__*/ _jsxs("div", {
6
+ className: "flex max-w-120 flex-wrap justify-center gap-2",
7
+ children: [
8
+ /*#__PURE__*/ _jsx(Badge, {
9
+ variant: "decorative-1",
10
+ children: "Decorative 1"
11
+ }),
12
+ /*#__PURE__*/ _jsx(Badge, {
13
+ variant: "decorative-3",
14
+ children: "Decorative 3"
15
+ }),
16
+ /*#__PURE__*/ _jsx(Badge, {
17
+ variant: "decorative-5",
18
+ children: "Decorative 5"
19
+ }),
20
+ /*#__PURE__*/ _jsxs(Badge, {
21
+ variant: "inProgress",
22
+ children: [
23
+ /*#__PURE__*/ _jsx(IconInnerShadowTopLeft, {}),
24
+ "In progress"
25
+ ]
26
+ }),
27
+ /*#__PURE__*/ _jsxs(Badge, {
28
+ variant: "success",
29
+ children: [
30
+ /*#__PURE__*/ _jsx(IconCircleCheck, {}),
31
+ "Success"
32
+ ]
33
+ }),
34
+ /*#__PURE__*/ _jsxs(Badge, {
35
+ variant: "warning",
36
+ children: [
37
+ /*#__PURE__*/ _jsx(IconAlertTriangle, {}),
38
+ "Warning"
39
+ ]
40
+ }),
41
+ /*#__PURE__*/ _jsxs(Badge, {
42
+ variant: "error",
43
+ children: [
44
+ /*#__PURE__*/ _jsx(IconHexagon, {}),
45
+ "Error"
46
+ ]
47
+ }),
48
+ /*#__PURE__*/ _jsxs(Badge, {
49
+ variant: "archived",
50
+ children: [
51
+ /*#__PURE__*/ _jsx(IconArchive, {}),
52
+ "Archived"
53
+ ]
54
+ }),
55
+ /*#__PURE__*/ _jsx(Badge, {
56
+ variant: "secondary",
57
+ dot: true,
58
+ children: "12"
59
+ })
60
+ ]
61
+ });
62
+ }
63
+
64
+ //# sourceMappingURL=badge.gallery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/components/ui/core/badge/badge.gallery.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\n\nimport {\n IconAlertTriangle,\n IconArchive,\n IconCircleCheck,\n IconHexagon,\n IconInnerShadowTopLeft,\n} from '@tabler/icons-react';\n\nimport { Badge } from './badge';\n\nexport function BadgeGallery(): ReactElement {\n return (\n <div className=\"flex max-w-120 flex-wrap justify-center gap-2\">\n <Badge variant=\"decorative-1\">Decorative 1</Badge>\n <Badge variant=\"decorative-3\">Decorative 3</Badge>\n <Badge variant=\"decorative-5\">Decorative 5</Badge>\n <Badge variant=\"inProgress\">\n <IconInnerShadowTopLeft />\n In progress\n </Badge>\n <Badge variant=\"success\">\n <IconCircleCheck />\n Success\n </Badge>\n <Badge variant=\"warning\">\n <IconAlertTriangle />\n Warning\n </Badge>\n <Badge variant=\"error\">\n <IconHexagon />\n Error\n </Badge>\n <Badge variant=\"archived\">\n <IconArchive />\n Archived\n </Badge>\n <Badge variant=\"secondary\" dot>\n 12\n </Badge>\n </div>\n );\n}\n"],"names":["IconAlertTriangle","IconArchive","IconCircleCheck","IconHexagon","IconInnerShadowTopLeft","Badge","BadgeGallery","div","className","variant","dot"],"mappings":";AAEA,SACEA,iBAAiB,EACjBC,WAAW,EACXC,eAAe,EACfC,WAAW,EACXC,sBAAsB,QACjB,sBAAsB;AAE7B,SAASC,KAAK,QAAQ,aAAU;AAEhC,OAAO,SAASC;IACd,qBACE,MAACC;QAAIC,WAAU;;0BACb,KAACH;gBAAMI,SAAQ;0BAAe;;0BAC9B,KAACJ;gBAAMI,SAAQ;0BAAe;;0BAC9B,KAACJ;gBAAMI,SAAQ;0BAAe;;0BAC9B,MAACJ;gBAAMI,SAAQ;;kCACb,KAACL;oBAAyB;;;0BAG5B,MAACC;gBAAMI,SAAQ;;kCACb,KAACP;oBAAkB;;;0BAGrB,MAACG;gBAAMI,SAAQ;;kCACb,KAACT;oBAAoB;;;0BAGvB,MAACK;gBAAMI,SAAQ;;kCACb,KAACN;oBAAc;;;0BAGjB,MAACE;gBAAMI,SAAQ;;kCACb,KAACR;oBAAc;;;0BAGjB,KAACI;gBAAMI,SAAQ;gBAAYC,GAAG;0BAAC;;;;AAKrC"}
@@ -0,0 +1,2 @@
1
+ import type { ReactElement } from "react";
2
+ export declare function CheckboxGallery(): ReactElement;
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { CheckboxGroup, CheckboxItem, CheckboxItemControl, CheckboxItemLabel } from "./checkbox.js";
3
+ export function CheckboxGallery() {
4
+ return /*#__PURE__*/ _jsxs(CheckboxGroup, {
5
+ children: [
6
+ /*#__PURE__*/ _jsxs(CheckboxItem, {
7
+ children: [
8
+ /*#__PURE__*/ _jsx(CheckboxItemControl, {
9
+ defaultChecked: true
10
+ }),
11
+ /*#__PURE__*/ _jsx(CheckboxItemLabel, {
12
+ children: "Option 1"
13
+ })
14
+ ]
15
+ }),
16
+ /*#__PURE__*/ _jsxs(CheckboxItem, {
17
+ children: [
18
+ /*#__PURE__*/ _jsx(CheckboxItemControl, {}),
19
+ /*#__PURE__*/ _jsx(CheckboxItemLabel, {
20
+ children: "Option 2"
21
+ })
22
+ ]
23
+ }),
24
+ /*#__PURE__*/ _jsxs(CheckboxItem, {
25
+ children: [
26
+ /*#__PURE__*/ _jsx(CheckboxItemControl, {}),
27
+ /*#__PURE__*/ _jsx(CheckboxItemLabel, {
28
+ children: "Option 3"
29
+ })
30
+ ]
31
+ })
32
+ ]
33
+ });
34
+ }
35
+
36
+ //# sourceMappingURL=checkbox.gallery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/components/ui/core/checkbox/checkbox.gallery.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\n\nimport {\n CheckboxGroup,\n CheckboxItem,\n CheckboxItemControl,\n CheckboxItemLabel,\n} from './checkbox';\n\nexport function CheckboxGallery(): ReactElement {\n return (\n <CheckboxGroup>\n <CheckboxItem>\n <CheckboxItemControl defaultChecked />\n <CheckboxItemLabel>Option 1</CheckboxItemLabel>\n </CheckboxItem>\n <CheckboxItem>\n <CheckboxItemControl />\n <CheckboxItemLabel>Option 2</CheckboxItemLabel>\n </CheckboxItem>\n <CheckboxItem>\n <CheckboxItemControl />\n <CheckboxItemLabel>Option 3</CheckboxItemLabel>\n </CheckboxItem>\n </CheckboxGroup>\n );\n}\n"],"names":["CheckboxGroup","CheckboxItem","CheckboxItemControl","CheckboxItemLabel","CheckboxGallery","defaultChecked"],"mappings":";AAEA,SACEA,aAAa,EACbC,YAAY,EACZC,mBAAmB,EACnBC,iBAAiB,QACZ,gBAAa;AAEpB,OAAO,SAASC;IACd,qBACE,MAACJ;;0BACC,MAACC;;kCACC,KAACC;wBAAoBG,cAAc;;kCACnC,KAACF;kCAAkB;;;;0BAErB,MAACF;;kCACC,KAACC;kCACD,KAACC;kCAAkB;;;;0BAErB,MAACF;;kCACC,KAACC;kCACD,KAACC;kCAAkB;;;;;;AAI3B"}
@@ -2,10 +2,9 @@ import type { ControlsConfig } from "streamdown";
2
2
  /**
3
3
  * Default Streamdown `controls` for assistant markdown (`MessageResponse`).
4
4
  *
5
- * - **Mermaid:** Enables copy, download, and pan/zoom (AX-117, AX-118). Fullscreen is
6
- * disabled: it uses a portal to `document.body`, which breaks scoped / prefixed CSS in
7
- * micro-frontend hosts until upstream supports a configurable portal root.
8
- * - **Code / table:** Off so chat keeps a simpler surface; callers may override via the
9
- * `controls` prop on `MessageResponse`.
5
+ * - **Mermaid:** Copy, download, pan/zoom and fullscreen are on (AX-117, AX-118, KCIH-1232).
6
+ * Fullscreen renders into the Aura portal container so it stays inside the Aura style scope.
7
+ * - **Code / table:** Off so chat keeps a simpler surface.
8
+ * Callers may override via the `controls` prop on `MessageResponse`.
10
9
  */
11
10
  export declare const MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS: Exclude<ControlsConfig, boolean>;
@@ -1,18 +1,17 @@
1
1
  /**
2
2
  * Default Streamdown `controls` for assistant markdown (`MessageResponse`).
3
3
  *
4
- * - **Mermaid:** Enables copy, download, and pan/zoom (AX-117, AX-118). Fullscreen is
5
- * disabled: it uses a portal to `document.body`, which breaks scoped / prefixed CSS in
6
- * micro-frontend hosts until upstream supports a configurable portal root.
7
- * - **Code / table:** Off so chat keeps a simpler surface; callers may override via the
8
- * `controls` prop on `MessageResponse`.
4
+ * - **Mermaid:** Copy, download, pan/zoom and fullscreen are on (AX-117, AX-118, KCIH-1232).
5
+ * Fullscreen renders into the Aura portal container so it stays inside the Aura style scope.
6
+ * - **Code / table:** Off so chat keeps a simpler surface.
7
+ * Callers may override via the `controls` prop on `MessageResponse`.
9
8
  */ export const MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS = {
10
9
  code: false,
11
10
  table: false,
12
11
  mermaid: {
13
12
  copy: true,
14
13
  download: true,
15
- fullscreen: false,
14
+ fullscreen: true,
16
15
  panZoom: true
17
16
  }
18
17
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/ui/core/message/message-response-default-streamdown-controls.ts"],"sourcesContent":["import type { ControlsConfig } from 'streamdown';\n\n/**\n * Default Streamdown `controls` for assistant markdown (`MessageResponse`).\n *\n * - **Mermaid:** Enables copy, download, and pan/zoom (AX-117, AX-118). Fullscreen is\n * disabled: it uses a portal to `document.body`, which breaks scoped / prefixed CSS in\n * micro-frontend hosts until upstream supports a configurable portal root.\n * - **Code / table:** Off so chat keeps a simpler surface; callers may override via the\n * `controls` prop on `MessageResponse`.\n */\nexport const MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS: Exclude<\n ControlsConfig,\n boolean\n> = {\n code: false,\n table: false,\n mermaid: {\n copy: true,\n download: true,\n fullscreen: false,\n panZoom: true,\n },\n};\n"],"names":["MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS","code","table","mermaid","copy","download","fullscreen","panZoom"],"mappings":"AAEA;;;;;;;;CAQC,GACD,OAAO,MAAMA,+CAGT;IACFC,MAAM;IACNC,OAAO;IACPC,SAAS;QACPC,MAAM;QACNC,UAAU;QACVC,YAAY;QACZC,SAAS;IACX;AACF,EAAE"}
1
+ {"version":3,"sources":["../../../../../src/components/ui/core/message/message-response-default-streamdown-controls.ts"],"sourcesContent":["import type { ControlsConfig } from 'streamdown';\n\n/**\n * Default Streamdown `controls` for assistant markdown (`MessageResponse`).\n *\n * - **Mermaid:** Copy, download, pan/zoom and fullscreen are on (AX-117, AX-118, KCIH-1232).\n * Fullscreen renders into the Aura portal container so it stays inside the Aura style scope.\n * - **Code / table:** Off so chat keeps a simpler surface.\n * Callers may override via the `controls` prop on `MessageResponse`.\n */\nexport const MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS: Exclude<\n ControlsConfig,\n boolean\n> = {\n code: false,\n table: false,\n mermaid: {\n copy: true,\n download: true,\n fullscreen: true,\n panZoom: true,\n },\n};\n"],"names":["MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS","code","table","mermaid","copy","download","fullscreen","panZoom"],"mappings":"AAEA;;;;;;;CAOC,GACD,OAAO,MAAMA,+CAGT;IACFC,MAAM;IACNC,OAAO;IACPC,SAAS;QACPC,MAAM;QACNC,UAAU;QACVC,YAAY;QACZC,SAAS;IACX;AACF,EAAE"}
@@ -3,6 +3,7 @@ import { createContext, useCallback, useContext, useEffect, useMemo, useState }
3
3
  import { mermaid as mermaidPlugin } from "@streamdown/mermaid";
4
4
  import { IconChevronLeft, IconChevronRight, IconPaperclip, IconX } from "@tabler/icons-react";
5
5
  import { Streamdown } from "streamdown";
6
+ import { usePortalContainer } from "../../../../lib/portal-container-context.js";
6
7
  import { cn, getInitials } from "../../../../lib/utils.js";
7
8
  import { Avatar, AvatarFallback, AvatarIcon, AvatarImage } from "../avatar/avatar.js";
8
9
  import { Button } from "../button/button.js";
@@ -317,7 +318,9 @@ const messageResponseComponents = {
317
318
  children: children
318
319
  })
319
320
  };
320
- const MessageResponseMarkdown = ({ className, components, plugins, controls, ...props })=>/*#__PURE__*/ _jsx(Streamdown, {
321
+ const MessageResponseMarkdown = ({ className, components, plugins, controls, portal, ...props })=>{
322
+ const portalContainer = usePortalContainer();
323
+ return /*#__PURE__*/ _jsx(Streamdown, {
321
324
  className: cn('size-full', // Blockquote paragraph overrides
322
325
  '[&_blockquote_p]:text-sm', '[&_blockquote_p]:tracking-tight', // Inline code
323
326
  '[&_code]:relative', '[&_code]:rounded', '[&_code]:bg-muted-background', '[&_code]:px-[0.3rem]', '[&_code]:py-[0.2rem]', '[&_code]:font-mono', '[&_code]:text-sm', '[&_code]:font-semibold', // Code blocks (Streamdown container)
@@ -343,8 +346,10 @@ const MessageResponseMarkdown = ({ className, components, plugins, controls, ...
343
346
  ...plugins,
344
347
  mermaid: mermaidPlugin
345
348
  },
349
+ portal: portal ?? portalContainer,
346
350
  ...props
347
351
  });
352
+ };
348
353
  const MessageResponse = ({ id, role, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'data-testid': dataTestId, ...props })=>/*#__PURE__*/ _jsx("div", {
349
354
  "data-slot": "message-response",
350
355
  id: id,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/components/ui/core/message/message.tsx"],"sourcesContent":["import type {\n ComponentProps,\n HTMLAttributes,\n ReactElement,\n ReactNode,\n} from 'react';\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { mermaid as mermaidPlugin } from '@streamdown/mermaid';\nimport {\n IconChevronLeft,\n IconChevronRight,\n IconPaperclip,\n IconX,\n} from '@tabler/icons-react';\nimport type { JSX } from 'react/jsx-runtime';\nimport type { Components, ExtraProps } from 'streamdown';\nimport { Streamdown } from 'streamdown';\n\nimport type { FileUIPart, UIMessage } from '../../../../lib/ai/types';\nimport { cn, getInitials } from '../../../../lib/utils';\nimport {\n Avatar,\n AvatarFallback,\n AvatarIcon,\n AvatarImage,\n} from '../avatar/avatar';\nimport { Button } from '../button/button';\nimport { ButtonGroup, ButtonGroupText } from '../button-group/button-group';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../tooltip/tooltip';\n\nimport { MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS } from './message-response-default-streamdown-controls';\n\ntype MessageProps = HTMLAttributes<HTMLDivElement> & {\n isResponse?: boolean;\n};\n\nconst Message = ({\n className,\n isResponse = false,\n ...props\n}: MessageProps): ReactNode => (\n <div\n data-slot=\"message\"\n className={cn(\n 'group flex w-full items-start justify-start gap-3 mb-0 py-3',\n isResponse ? 'is-assistant items-start' : 'is-user flex-row-reverse',\n className\n )}\n {...props}\n />\n);\n\ntype MessageContentProps = HTMLAttributes<HTMLDivElement>;\n\nconst MessageContent = ({\n children,\n className,\n ...props\n}: MessageContentProps): ReactNode => (\n <div\n data-slot=\"message-content\"\n className={cn(\n 'is-user:dark flex flex-col gap-4 rounded-md text-base leading-tight tracking-tightest',\n 'max-w-4/5',\n 'group-[.is-user]:overflow-hidden group-[.is-user]:bg-medium-background group-[.is-user]:p-2 group-[.is-user]:text-base-foreground',\n 'group-[.is-assistant]:text-base-foreground group-[.is-assistant]:pt-1',\n className\n )}\n {...props}\n >\n {children}\n </div>\n);\n\ntype MessageAvatarProps = ComponentProps<typeof Avatar> & {\n avatarUrl?: string;\n name?: string;\n};\n\nconst MessageAvatar = ({\n avatarUrl,\n name,\n className,\n children,\n variant,\n sizes,\n ...props\n}: MessageAvatarProps): ReactNode => {\n const fallbackText = name ? getInitials(name) : 'ME';\n\n return (\n <Avatar\n data-slot=\"message-avatar\"\n className={cn('size-7 group-[.is-user]:mt-1', className)}\n variant={variant}\n sizes={sizes}\n {...props}\n >\n {children || (\n <>\n {avatarUrl && (\n <AvatarImage\n alt={name || ''}\n className=\"mt-0 mb-0\"\n src={avatarUrl}\n />\n )}\n <AvatarFallback>{fallbackText}</AvatarFallback>\n </>\n )}\n </Avatar>\n );\n};\n\ntype MessageAvatarIconProps = ComponentProps<typeof AvatarIcon>;\n\nconst MessageAvatarIcon = (props: MessageAvatarIconProps): ReactNode => (\n <AvatarIcon data-slot=\"message-avatar-icon\" {...props} />\n);\n\ntype MessageActionsProps = ComponentProps<'div'>;\n\nconst MessageActions = ({\n className,\n children,\n ...props\n}: MessageActionsProps): ReactNode => (\n <div\n data-slot=\"message-actions\"\n className={cn('flex items-center gap-2 pt-2', className)}\n {...props}\n >\n {children}\n </div>\n);\n\ntype MessageActionProps = ComponentProps<typeof Button> & {\n tooltip?: string;\n label?: string;\n};\n\nconst MessageAction = ({\n tooltip,\n children,\n label,\n className,\n variant = 'ghost',\n size = 'sm',\n ...props\n}: MessageActionProps): ReactNode => {\n const button = (\n <Button\n data-slot=\"message-action\"\n className={cn(\n 'relative icon-sm text-muted-foreground hover:text-base-foreground',\n className\n )}\n size={size}\n type=\"button\"\n variant={variant}\n {...props}\n >\n {children}\n <span className=\"sr-only\">{label || tooltip}</span>\n </Button>\n );\n\n if (tooltip) {\n return (\n <Tooltip>\n <TooltipTrigger render={button} />\n <TooltipContent>\n <p>{tooltip}</p>\n </TooltipContent>\n </Tooltip>\n );\n }\n\n return button;\n};\n\ntype MessageBranchContextType = {\n currentBranch: number;\n totalBranches: number;\n goToPrevious: () => void;\n goToNext: () => void;\n branches: ReactElement[];\n setBranches: (branches: ReactElement[]) => void;\n};\n\nconst MessageBranchContext = createContext<MessageBranchContextType | null>(\n null\n);\n\nconst useMessageBranch = () => {\n const context = useContext(MessageBranchContext);\n\n if (!context) {\n throw new Error(\n 'MessageBranch components must be used within MessageBranch'\n );\n }\n\n return context;\n};\n\ntype MessageBranchProps = HTMLAttributes<HTMLDivElement> & {\n defaultBranch?: number;\n onBranchChange?: (branchIndex: number) => void;\n};\n\nconst MessageBranch = ({\n defaultBranch = 0,\n onBranchChange,\n className,\n ...props\n}: MessageBranchProps): ReactNode => {\n const [currentBranch, setCurrentBranch] = useState(defaultBranch);\n const [branches, setBranches] = useState<ReactElement[]>([]);\n\n const goToPrevious = useCallback(() => {\n setCurrentBranch((prev) => {\n const newBranch = prev > 0 ? prev - 1 : branches.length - 1;\n onBranchChange?.(newBranch);\n return newBranch;\n });\n }, [branches.length, onBranchChange]);\n\n const goToNext = useCallback(() => {\n setCurrentBranch((prev) => {\n const newBranch = prev < branches.length - 1 ? prev + 1 : 0;\n onBranchChange?.(newBranch);\n return newBranch;\n });\n }, [branches.length, onBranchChange]);\n\n const contextValue = useMemo<MessageBranchContextType>(\n () => ({\n currentBranch,\n totalBranches: branches.length,\n goToPrevious,\n goToNext,\n branches,\n setBranches,\n }),\n [currentBranch, branches, goToPrevious, goToNext, setBranches]\n );\n\n return (\n <MessageBranchContext.Provider value={contextValue}>\n <div\n data-slot=\"message-branch\"\n className={cn('grid w-full gap-2 [&>div]:pb-0', className)}\n {...props}\n />\n </MessageBranchContext.Provider>\n );\n};\n\ntype MessageBranchContentProps = HTMLAttributes<HTMLDivElement>;\n\nconst MessageBranchContent = ({\n children,\n ...props\n}: MessageBranchContentProps): ReactNode[] => {\n const { currentBranch, setBranches, branches } = useMessageBranch();\n const childrenArray = useMemo(\n () => (Array.isArray(children) ? children : [children]),\n [children]\n );\n\n useEffect(() => {\n if (branches.length !== childrenArray.length) {\n setBranches(childrenArray);\n }\n }, [childrenArray, branches, setBranches]);\n\n return childrenArray.map((branch, index) => (\n <div\n data-slot=\"message-branch-content\"\n className={cn(\n 'grid gap-2 overflow-hidden [&>div]:pb-0',\n index === currentBranch ? 'block' : 'hidden'\n )}\n key={branch.key}\n {...props}\n >\n {branch}\n </div>\n ));\n};\n\ntype MessageBranchSelectorProps = HTMLAttributes<HTMLDivElement> & {\n from: UIMessage['role'];\n};\n\nconst MessageBranchSelector = ({\n ...props\n}: MessageBranchSelectorProps): ReactNode => {\n const { totalBranches } = useMessageBranch();\n\n if (totalBranches <= 1) {\n return null;\n }\n\n return (\n <ButtonGroup\n data-slot=\"message-branch-selector\"\n className=\"[&>*:not(:first-child)]:rounded-l-md [&>*:not(:last-child)]:rounded-r-md\"\n orientation=\"horizontal\"\n {...props}\n />\n );\n};\n\ntype MessageBranchPreviousProps = ComponentProps<typeof Button>;\n\nconst MessageBranchPrevious = ({\n children,\n ...props\n}: MessageBranchPreviousProps): ReactNode => {\n const { goToPrevious, totalBranches } = useMessageBranch();\n\n return (\n <Button\n data-slot=\"message-branch-previous\"\n aria-label=\"Previous branch\"\n disabled={totalBranches <= 1}\n onClick={goToPrevious}\n size=\"icon-sm\"\n type=\"button\"\n variant=\"ghost\"\n {...props}\n >\n {children ?? <IconChevronLeft size={14} />}\n </Button>\n );\n};\n\ntype MessageBranchNextProps = ComponentProps<typeof Button>;\n\nconst MessageBranchNext = ({\n children,\n ...props\n}: MessageBranchNextProps): ReactNode => {\n const { goToNext, totalBranches } = useMessageBranch();\n\n return (\n <Button\n data-slot=\"message-branch-next\"\n aria-label=\"Next branch\"\n disabled={totalBranches <= 1}\n onClick={goToNext}\n size=\"icon-sm\"\n type=\"button\"\n variant=\"ghost\"\n {...props}\n >\n {children ?? <IconChevronRight size={14} />}\n </Button>\n );\n};\n\ntype MessageBranchPageProps = HTMLAttributes<HTMLSpanElement>;\n\nconst MessageBranchPage = ({\n className,\n ...props\n}: MessageBranchPageProps): ReactNode => {\n const { currentBranch, totalBranches } = useMessageBranch();\n\n return (\n <ButtonGroupText\n data-slot=\"message-branch-page\"\n className={cn(\n 'border-none bg-transparent text-muted-foreground shadow-none px-2',\n className\n )}\n {...props}\n >\n {currentBranch + 1}/{totalBranches}\n </ButtonGroupText>\n );\n};\n\n/** Streamdown discards unrecognised props, so these go on a wrapper instead. */\ntype MessageResponseHostProps = Pick<\n HTMLAttributes<HTMLDivElement>,\n 'id' | 'role' | 'aria-label' | 'aria-labelledby' | 'aria-describedby'\n> & {\n 'data-testid'?: string;\n};\n\ntype MessageResponseProps = ComponentProps<typeof Streamdown> &\n MessageResponseHostProps;\n\ntype MarkdownComponentProps<T extends keyof JSX.IntrinsicElements> =\n JSX.IntrinsicElements[T] & ExtraProps;\n\nconst messageResponseComponents: Components = {\n h1: ({ children }: MarkdownComponentProps<'h1'>) => (\n <h1 className=\"mt-0 mb-2 scroll-m-20 text-xl font-medium tracking-tightest\">\n {children}\n </h1>\n ),\n h2: ({ children }: MarkdownComponentProps<'h2'>) => (\n <h2 className=\"mt-4 mb-1 scroll-m-20 text-lg font-medium tracking-tightest\">\n {children}\n </h2>\n ),\n h3: ({ children }: MarkdownComponentProps<'h3'>) => (\n <h3 className=\"mt-4 mb-1 scroll-m-20 text-base font-medium tracking-tighter\">\n {children}\n </h3>\n ),\n h4: ({ children }: MarkdownComponentProps<'h4'>) => (\n <h4 className=\"mt-2 mb-0 scroll-m-20 text-sm font-medium tracking-normal\">\n {children}\n </h4>\n ),\n h5: ({ children }: MarkdownComponentProps<'h5'>) => (\n <h5 className=\"mt-0 mb-0 scroll-m-20 text-xs font-medium tracking-tighter\">\n {children}\n </h5>\n ),\n h6: ({ children }: MarkdownComponentProps<'h6'>) => (\n <h6 className=\"mt-0 mb-0 scroll-m-20 text-2xs font-medium tracking-tighter\">\n {children}\n </h6>\n ),\n p: ({ children }: MarkdownComponentProps<'p'>) => (\n <p className=\"mt-2 mb-3 text-base font-normal leading-5 tracking-tightest\">\n {children}\n </p>\n ),\n strong: ({ children }: MarkdownComponentProps<'strong'>) => (\n <strong className=\"font-medium\">{children}</strong>\n ),\n em: ({ children }: MarkdownComponentProps<'em'>) => (\n <em className=\"italic\">{children}</em>\n ),\n b: ({ children }: MarkdownComponentProps<'b'>) => (\n <b className=\"font-medium\">{children}</b>\n ),\n i: ({ children }: MarkdownComponentProps<'i'>) => (\n <i className=\"italic\">{children}</i>\n ),\n ul: ({ children }: MarkdownComponentProps<'ul'>) => (\n <ul className=\"ml-8.25 mb-3 pt-2 pl-0 pb-0 list-disc text-base font-normal tracking-tightest\">\n {children}\n </ul>\n ),\n ol: ({ children }: MarkdownComponentProps<'ol'>) => (\n <ol className=\"ml-8.25 mb-3 pt-2 pl-0 pb-0 list-decimal text-base font-normal tracking-tightest\">\n {children}\n </ol>\n ),\n li: ({ children }: MarkdownComponentProps<'li'>) => (\n <li className=\"py-0\">{children}</li>\n ),\n blockquote: ({ children }: MarkdownComponentProps<'blockquote'>) => (\n <blockquote className=\"my-3 pr-2 pl-2 border-l border-l-default text-sm text-muted-foreground font-normal tracking-tight not-italic\">\n {children}\n </blockquote>\n ),\n hr: () => <hr className=\"my-4 border-default\" />,\n a: ({ children, href, ...props }: MarkdownComponentProps<'a'>) => (\n <a\n className=\"text-link-foreground no-underline hover:underline underline-offset-4\"\n href={href}\n {...props}\n >\n {children}\n </a>\n ),\n table: ({ children }: MarkdownComponentProps<'table'>) => (\n <div\n className=\"my-6 overflow-x-auto\"\n tabIndex={0}\n role=\"group\"\n aria-label=\"Atlas AI Chat Table\"\n >\n <table className=\"w-full\">{children}</table>\n </div>\n ),\n thead: ({ children }: MarkdownComponentProps<'thead'>) => (\n <thead>{children}</thead>\n ),\n tbody: ({ children }: MarkdownComponentProps<'tbody'>) => (\n <tbody>{children}</tbody>\n ),\n tr: ({ children }: MarkdownComponentProps<'tr'>) => (\n <tr className=\"m-0 border-t p-0 even:bg-muted-background\">{children}</tr>\n ),\n th: ({ children }: MarkdownComponentProps<'th'>) => (\n <th className=\"border px-4 py-2 text-left font-bold\">{children}</th>\n ),\n td: ({ children }: MarkdownComponentProps<'td'>) => (\n <td className=\"border px-4 py-2 text-left\">{children}</td>\n ),\n};\n\nconst MessageResponseMarkdown = ({\n className,\n components,\n plugins,\n controls,\n ...props\n}: ComponentProps<typeof Streamdown>): JSX.Element => (\n <Streamdown\n className={cn(\n 'size-full',\n // Blockquote paragraph overrides\n '[&_blockquote_p]:text-sm',\n '[&_blockquote_p]:tracking-tight',\n // Inline code\n '[&_code]:relative',\n '[&_code]:rounded',\n '[&_code]:bg-muted-background',\n '[&_code]:px-[0.3rem]',\n '[&_code]:py-[0.2rem]',\n '[&_code]:font-mono',\n '[&_code]:text-sm',\n '[&_code]:font-semibold',\n // Code blocks (Streamdown container)\n '[&_div[data-streamdown=\"code-block\"]]:my-4',\n '[&_div[data-streamdown=\"code-block\"]]:w-full',\n '[&_div[data-streamdown=\"code-block\"]]:overflow-hidden',\n '[&_div[data-streamdown=\"code-block\"]]:rounded-xl',\n '[&_div[data-streamdown=\"code-block\"]]:border',\n '[&_div[data-streamdown=\"code-block\"]]:border-default',\n // Code block header\n '[&_div[data-streamdown=\"code-block-header\"]]:flex',\n '[&_div[data-streamdown=\"code-block-header\"]]:items-center',\n '[&_div[data-streamdown=\"code-block-header\"]]:justify-between',\n '[&_div[data-streamdown=\"code-block-header\"]]:bg-muted-background/80',\n '[&_div[data-streamdown=\"code-block-header\"]]:px-4',\n '[&_div[data-streamdown=\"code-block-header\"]]:py-3',\n '[&_div[data-streamdown=\"code-block-header\"]]:text-xs',\n '[&_div[data-streamdown=\"code-block-header\"]]:text-muted-foreground',\n // Pre element inside code block\n '[&_div[data-streamdown=\"code-block\"]_pre]:m-0',\n '[&_div[data-streamdown=\"code-block\"]_pre]:overflow-x-auto',\n '[&_div[data-streamdown=\"code-block\"]_pre]:border-t',\n '[&_div[data-streamdown=\"code-block\"]_pre]:border-default',\n '[&_div[data-streamdown=\"code-block\"]_pre]:bg-card-background!',\n '[&_div[data-streamdown=\"code-block\"]_pre]:p-4',\n '[&_div[data-streamdown=\"code-block\"]_pre]:text-sm',\n '[&_div[data-streamdown=\"code-block\"]_pre]:text-medium-foreground!',\n // Code element inside pre\n '[&_div[data-streamdown=\"code-block\"]_pre_code]:static',\n '[&_div[data-streamdown=\"code-block\"]_pre_code]:rounded-none',\n '[&_div[data-streamdown=\"code-block\"]_pre_code]:bg-transparent',\n '[&_div[data-streamdown=\"code-block\"]_pre_code]:p-0',\n '[&_div[data-streamdown=\"code-block\"]_pre_code]:font-mono',\n '[&_div[data-streamdown=\"code-block\"]_pre_code]:text-sm',\n '[&_div[data-streamdown=\"code-block\"]_pre_code]:font-normal',\n // Code block buttons\n '[&_button[data-streamdown=\"code-block-copy-button\"]]:cursor-pointer',\n '[&_button[data-streamdown=\"code-block-copy-button\"]]:p-1',\n '[&_button[data-streamdown=\"code-block-copy-button\"]]:text-muted-foreground',\n '[&_button[data-streamdown=\"code-block-copy-button\"]]:transition-all',\n '[&_button[data-streamdown=\"code-block-copy-button\"]]:hover:text-base-foreground',\n '[&_button[data-streamdown=\"code-block-download-button\"]]:cursor-pointer',\n '[&_button[data-streamdown=\"code-block-download-button\"]]:p-1',\n '[&_button[data-streamdown=\"code-block-download-button\"]]:text-muted-foreground',\n '[&_button[data-streamdown=\"code-block-download-button\"]]:transition-all',\n '[&_button[data-streamdown=\"code-block-download-button\"]]:hover:text-base-foreground',\n // Regular pre blocks (not in Streamdown code blocks)\n '[&_pre:not([data-streamdown])]:my-3',\n '[&_pre:not([data-streamdown])]:mx-0',\n '[&_pre:not([data-streamdown])]:overflow-x-auto',\n '[&_pre:not([data-streamdown])]:rounded-md',\n '[&_pre:not([data-streamdown])]:border',\n '[&_pre:not([data-streamdown])]:bg-card-background',\n '[&_pre:not([data-streamdown])]:p-4',\n '[&_pre:not([data-streamdown])]:text-medium-foreground',\n '[&_pre:not([data-streamdown])]:text-sm',\n '[&_pre:not([data-streamdown])_code]:static',\n '[&_pre:not([data-streamdown])_code]:rounded-none',\n '[&_pre:not([data-streamdown])_code]:bg-transparent',\n '[&_pre:not([data-streamdown])_code]:px-0',\n '[&_pre:not([data-streamdown])_code]:py-0',\n '[&_pre:not([data-streamdown])_code]:font-mono',\n '[&_pre:not([data-streamdown])_code]:text-sm',\n '[&_pre:not([data-streamdown])_code]:font-normal',\n // Mermaid diagram blocks\n '[&_div[data-streamdown=\"mermaid-block\"]]:bg-card-background',\n '[&_div[data-streamdown=\"mermaid-block\"]]:text-base-foreground',\n '[&_div[data-streamdown=\"mermaid-block\"]]:flex',\n '[&_div[data-streamdown=\"mermaid-block\"]]:flex-col',\n '[&_div[data-streamdown=\"mermaid-block\"]]:rounded-lg',\n '[&_div[data-streamdown=\"mermaid-block\"]]:hover:bg-base-background-hover',\n '[&_div[data-streamdown=\"mermaid-block\"]]:border-0',\n // Positioning context for the action strip (see below)\n '[&_div[data-streamdown=\"mermaid-block\"]]:relative',\n // Nested scroll + sticky + pointer-events breaks hit-testing on Mermaid Copy/Download\n // (same class of issue as github.com/vercel/streamdown/issues/494). Force absolute strip.\n '[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!absolute',\n '[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!top-2',\n '[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!right-2',\n '[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!z-10',\n '[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!mt-0',\n '[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!pointer-events-auto',\n // Ensure mermaid container is tall enough for the toolbar (pan/zoom + actions)\n '[&_div[data-streamdown=\"mermaid-block\"]_.relative.w-full]:!min-h-28',\n // KaTeX sizing (overflow rules live in styles.source.css)\n '[&_.katex-display]:my-3',\n '[&_.katex]:text-[1em]',\n // First and last child margin resets\n '[&>*:first-child]:mt-0',\n '[&>*:last-child]:mb-0',\n className\n )}\n components={{ ...messageResponseComponents, ...components }}\n controls={controls ?? MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS}\n plugins={{ ...plugins, mermaid: mermaidPlugin }}\n {...props}\n />\n);\n\nconst MessageResponse = ({\n id,\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n 'data-testid': dataTestId,\n ...props\n}: MessageResponseProps): JSX.Element => (\n <div\n data-slot=\"message-response\"\n id={id}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n data-testid={dataTestId}\n >\n <MessageResponseMarkdown {...props} />\n </div>\n);\n\ntype MessageAttachmentProps = HTMLAttributes<HTMLDivElement> & {\n data: FileUIPart;\n className?: string;\n onRemove?: () => void;\n};\n\nfunction MessageAttachment({\n data,\n className,\n onRemove,\n ...props\n}: MessageAttachmentProps): ReactNode {\n const filename = data.filename || '';\n const mediaType =\n data.mediaType?.startsWith('image/') && data.url ? 'image' : 'file';\n const isImage = mediaType === 'image';\n const attachmentLabel = filename || (isImage ? 'Image' : 'Attachment');\n\n return (\n <div\n data-slot=\"message-attachment\"\n className={cn(\n 'group relative size-24 overflow-hidden rounded-lg',\n className\n )}\n {...props}\n >\n {isImage ? (\n <>\n <img\n alt={filename || 'attachment'}\n className=\"size-full object-cover\"\n height={100}\n src={data.url}\n width={100}\n />\n {onRemove && (\n <Button\n aria-label=\"Remove attachment\"\n className=\"absolute top-2 right-2 size-6 rounded-full bg-card-background/80 p-0 opacity-0 backdrop-blur-sm transition-opacity hover:bg-card-background group-hover:opacity-100 [&>svg]:size-3\"\n onClick={(e) => {\n e.stopPropagation();\n onRemove();\n }}\n type=\"button\"\n variant=\"ghost\"\n >\n <IconX />\n <span className=\"sr-only\">Remove</span>\n </Button>\n )}\n </>\n ) : (\n <>\n <Tooltip>\n <TooltipTrigger\n render={\n <div className=\"flex size-full shrink-0 items-center justify-center rounded-lg bg-muted-background text-muted-foreground\">\n <IconPaperclip className=\"size-4\" />\n </div>\n }\n />\n <TooltipContent>\n <p>{attachmentLabel}</p>\n </TooltipContent>\n </Tooltip>\n {onRemove && (\n <Button\n aria-label=\"Remove attachment\"\n className=\"size-6 shrink-0 rounded-full p-0 opacity-0 transition-opacity hover:bg-base-background-hover group-hover:opacity-100 [&>svg]:size-3\"\n onClick={(e) => {\n e.stopPropagation();\n onRemove();\n }}\n type=\"button\"\n variant=\"ghost\"\n >\n <IconX />\n <span className=\"sr-only\">Remove</span>\n </Button>\n )}\n </>\n )}\n </div>\n );\n}\n\ntype MessageAttachmentsProps = ComponentProps<'div'>;\n\nfunction MessageAttachments({\n children,\n className,\n ...props\n}: MessageAttachmentsProps): ReactNode {\n if (!children) {\n return null;\n }\n\n return (\n <div\n data-slot=\"message-attachments\"\n className={cn(\n 'ml-auto flex w-fit flex-wrap items-start gap-2',\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n}\n\ntype MessageToolbarProps = ComponentProps<'div'>;\n\nconst MessageToolbar = ({\n className,\n children,\n ...props\n}: MessageToolbarProps): ReactNode => (\n <div\n data-slot=\"message-toolbar\"\n className={cn(\n 'mt-4 flex w-full items-center justify-between gap-4',\n className\n )}\n {...props}\n >\n {children}\n </div>\n);\n\nexport {\n Message,\n MessageAction,\n MessageActions,\n MessageAttachment,\n MessageAttachments,\n MessageAvatar,\n MessageAvatarIcon,\n MessageBranch,\n MessageBranchContent,\n MessageBranchNext,\n MessageBranchPage,\n MessageBranchPrevious,\n MessageBranchSelector,\n MessageContent,\n MessageResponse,\n MessageToolbar,\n};\n"],"names":["createContext","useCallback","useContext","useEffect","useMemo","useState","mermaid","mermaidPlugin","IconChevronLeft","IconChevronRight","IconPaperclip","IconX","Streamdown","cn","getInitials","Avatar","AvatarFallback","AvatarIcon","AvatarImage","Button","ButtonGroup","ButtonGroupText","Tooltip","TooltipContent","TooltipTrigger","MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS","Message","className","isResponse","props","div","data-slot","MessageContent","children","MessageAvatar","avatarUrl","name","variant","sizes","fallbackText","alt","src","MessageAvatarIcon","MessageActions","MessageAction","tooltip","label","size","button","type","span","render","p","MessageBranchContext","useMessageBranch","context","Error","MessageBranch","defaultBranch","onBranchChange","currentBranch","setCurrentBranch","branches","setBranches","goToPrevious","prev","newBranch","length","goToNext","contextValue","totalBranches","Provider","value","MessageBranchContent","childrenArray","Array","isArray","map","branch","index","key","MessageBranchSelector","orientation","MessageBranchPrevious","aria-label","disabled","onClick","MessageBranchNext","MessageBranchPage","messageResponseComponents","h1","h2","h3","h4","h5","h6","strong","em","b","i","ul","ol","li","blockquote","hr","a","href","table","tabIndex","role","thead","tbody","tr","th","td","MessageResponseMarkdown","components","plugins","controls","MessageResponse","id","ariaLabel","ariaLabelledBy","ariaDescribedBy","dataTestId","aria-labelledby","aria-describedby","data-testid","MessageAttachment","data","onRemove","filename","mediaType","startsWith","url","isImage","attachmentLabel","img","height","width","e","stopPropagation","MessageAttachments","MessageToolbar"],"mappings":";AAMA,SACEA,aAAa,EACbC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,QAAQ;AAEf,SAASC,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KAACrB;gCAAIH,WAAU;0CACb,cAAA,KAACjB;oCAAciB,WAAU;;;;sCAI/B,KAACJ;sCACC,cAAA,KAAC6B;0CAAGoF;;;;;gBAGPN,0BACC,MAAC/G;oBACCiE,cAAW;oBACXzD,WAAU;oBACV2D,SAAS,CAACsD;wBACRA,EAAEC,eAAe;wBACjBX;oBACF;oBACAjF,MAAK;oBACLZ,SAAQ;;sCAER,KAAC1B;sCACD,KAACuC;4BAAKvB,WAAU;sCAAU;;;;;;;AAOxC;AAIA,SAASmH,mBAAmB,EAC1B7G,QAAQ,EACRN,SAAS,EACT,GAAGE,OACqB;IACxB,IAAI,CAACI,UAAU;QACb,OAAO;IACT;IAEA,qBACE,KAACH;QACCC,aAAU;QACVJ,WAAWd,GACT,kDACAc;QAED,GAAGE,KAAK;kBAERI;;AAGP;AAIA,MAAM8G,iBAAiB,CAAC,EACtBpH,SAAS,EACTM,QAAQ,EACR,GAAGJ,OACiB,iBACpB,KAACC;QACCC,aAAU;QACVJ,WAAWd,GACT,uDACAc;QAED,GAAGE,KAAK;kBAERI;;AAIL,SACEP,OAAO,EACPkB,aAAa,EACbD,cAAc,EACdqF,iBAAiB,EACjBc,kBAAkB,EAClB5G,aAAa,EACbQ,iBAAiB,EACjBe,aAAa,EACbgB,oBAAoB,EACpBc,iBAAiB,EACjBC,iBAAiB,EACjBL,qBAAqB,EACrBF,qBAAqB,EACrBjD,cAAc,EACduF,eAAe,EACfwB,cAAc,GACd"}
1
+ {"version":3,"sources":["../../../../../src/components/ui/core/message/message.tsx"],"sourcesContent":["import type {\n ComponentProps,\n HTMLAttributes,\n ReactElement,\n ReactNode,\n} from 'react';\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { mermaid as mermaidPlugin } from '@streamdown/mermaid';\nimport {\n IconChevronLeft,\n IconChevronRight,\n IconPaperclip,\n IconX,\n} from '@tabler/icons-react';\nimport type { JSX } from 'react/jsx-runtime';\nimport type { Components, ExtraProps } from 'streamdown';\nimport { Streamdown } from 'streamdown';\n\nimport type { FileUIPart, UIMessage } from '../../../../lib/ai/types';\nimport { usePortalContainer } from '../../../../lib/portal-container-context';\nimport { cn, getInitials } from '../../../../lib/utils';\nimport {\n Avatar,\n AvatarFallback,\n AvatarIcon,\n AvatarImage,\n} from '../avatar/avatar';\nimport { Button } from '../button/button';\nimport { ButtonGroup, ButtonGroupText } from '../button-group/button-group';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '../tooltip/tooltip';\n\nimport { MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS } from './message-response-default-streamdown-controls';\n\ntype MessageProps = HTMLAttributes<HTMLDivElement> & {\n isResponse?: boolean;\n};\n\nconst Message = ({\n className,\n isResponse = false,\n ...props\n}: MessageProps): ReactNode => (\n <div\n data-slot=\"message\"\n className={cn(\n 'group flex w-full items-start justify-start gap-3 mb-0 py-3',\n isResponse ? 'is-assistant items-start' : 'is-user flex-row-reverse',\n className\n )}\n {...props}\n />\n);\n\ntype MessageContentProps = HTMLAttributes<HTMLDivElement>;\n\nconst MessageContent = ({\n children,\n className,\n ...props\n}: MessageContentProps): ReactNode => (\n <div\n data-slot=\"message-content\"\n className={cn(\n 'is-user:dark flex flex-col gap-4 rounded-md text-base leading-tight tracking-tightest',\n 'max-w-4/5',\n 'group-[.is-user]:overflow-hidden group-[.is-user]:bg-medium-background group-[.is-user]:p-2 group-[.is-user]:text-base-foreground',\n 'group-[.is-assistant]:text-base-foreground group-[.is-assistant]:pt-1',\n className\n )}\n {...props}\n >\n {children}\n </div>\n);\n\ntype MessageAvatarProps = ComponentProps<typeof Avatar> & {\n avatarUrl?: string;\n name?: string;\n};\n\nconst MessageAvatar = ({\n avatarUrl,\n name,\n className,\n children,\n variant,\n sizes,\n ...props\n}: MessageAvatarProps): ReactNode => {\n const fallbackText = name ? getInitials(name) : 'ME';\n\n return (\n <Avatar\n data-slot=\"message-avatar\"\n className={cn('size-7 group-[.is-user]:mt-1', className)}\n variant={variant}\n sizes={sizes}\n {...props}\n >\n {children || (\n <>\n {avatarUrl && (\n <AvatarImage\n alt={name || ''}\n className=\"mt-0 mb-0\"\n src={avatarUrl}\n />\n )}\n <AvatarFallback>{fallbackText}</AvatarFallback>\n </>\n )}\n </Avatar>\n );\n};\n\ntype MessageAvatarIconProps = ComponentProps<typeof AvatarIcon>;\n\nconst MessageAvatarIcon = (props: MessageAvatarIconProps): ReactNode => (\n <AvatarIcon data-slot=\"message-avatar-icon\" {...props} />\n);\n\ntype MessageActionsProps = ComponentProps<'div'>;\n\nconst MessageActions = ({\n className,\n children,\n ...props\n}: MessageActionsProps): ReactNode => (\n <div\n data-slot=\"message-actions\"\n className={cn('flex items-center gap-2 pt-2', className)}\n {...props}\n >\n {children}\n </div>\n);\n\ntype MessageActionProps = ComponentProps<typeof Button> & {\n tooltip?: string;\n label?: string;\n};\n\nconst MessageAction = ({\n tooltip,\n children,\n label,\n className,\n variant = 'ghost',\n size = 'sm',\n ...props\n}: MessageActionProps): ReactNode => {\n const button = (\n <Button\n data-slot=\"message-action\"\n className={cn(\n 'relative icon-sm text-muted-foreground hover:text-base-foreground',\n className\n )}\n size={size}\n type=\"button\"\n variant={variant}\n {...props}\n >\n {children}\n <span className=\"sr-only\">{label || tooltip}</span>\n </Button>\n );\n\n if (tooltip) {\n return (\n <Tooltip>\n <TooltipTrigger render={button} />\n <TooltipContent>\n <p>{tooltip}</p>\n </TooltipContent>\n </Tooltip>\n );\n }\n\n return button;\n};\n\ntype MessageBranchContextType = {\n currentBranch: number;\n totalBranches: number;\n goToPrevious: () => void;\n goToNext: () => void;\n branches: ReactElement[];\n setBranches: (branches: ReactElement[]) => void;\n};\n\nconst MessageBranchContext = createContext<MessageBranchContextType | null>(\n null\n);\n\nconst useMessageBranch = () => {\n const context = useContext(MessageBranchContext);\n\n if (!context) {\n throw new Error(\n 'MessageBranch components must be used within MessageBranch'\n );\n }\n\n return context;\n};\n\ntype MessageBranchProps = HTMLAttributes<HTMLDivElement> & {\n defaultBranch?: number;\n onBranchChange?: (branchIndex: number) => void;\n};\n\nconst MessageBranch = ({\n defaultBranch = 0,\n onBranchChange,\n className,\n ...props\n}: MessageBranchProps): ReactNode => {\n const [currentBranch, setCurrentBranch] = useState(defaultBranch);\n const [branches, setBranches] = useState<ReactElement[]>([]);\n\n const goToPrevious = useCallback(() => {\n setCurrentBranch((prev) => {\n const newBranch = prev > 0 ? prev - 1 : branches.length - 1;\n onBranchChange?.(newBranch);\n return newBranch;\n });\n }, [branches.length, onBranchChange]);\n\n const goToNext = useCallback(() => {\n setCurrentBranch((prev) => {\n const newBranch = prev < branches.length - 1 ? prev + 1 : 0;\n onBranchChange?.(newBranch);\n return newBranch;\n });\n }, [branches.length, onBranchChange]);\n\n const contextValue = useMemo<MessageBranchContextType>(\n () => ({\n currentBranch,\n totalBranches: branches.length,\n goToPrevious,\n goToNext,\n branches,\n setBranches,\n }),\n [currentBranch, branches, goToPrevious, goToNext, setBranches]\n );\n\n return (\n <MessageBranchContext.Provider value={contextValue}>\n <div\n data-slot=\"message-branch\"\n className={cn('grid w-full gap-2 [&>div]:pb-0', className)}\n {...props}\n />\n </MessageBranchContext.Provider>\n );\n};\n\ntype MessageBranchContentProps = HTMLAttributes<HTMLDivElement>;\n\nconst MessageBranchContent = ({\n children,\n ...props\n}: MessageBranchContentProps): ReactNode[] => {\n const { currentBranch, setBranches, branches } = useMessageBranch();\n const childrenArray = useMemo(\n () => (Array.isArray(children) ? children : [children]),\n [children]\n );\n\n useEffect(() => {\n if (branches.length !== childrenArray.length) {\n setBranches(childrenArray);\n }\n }, [childrenArray, branches, setBranches]);\n\n return childrenArray.map((branch, index) => (\n <div\n data-slot=\"message-branch-content\"\n className={cn(\n 'grid gap-2 overflow-hidden [&>div]:pb-0',\n index === currentBranch ? 'block' : 'hidden'\n )}\n key={branch.key}\n {...props}\n >\n {branch}\n </div>\n ));\n};\n\ntype MessageBranchSelectorProps = HTMLAttributes<HTMLDivElement> & {\n from: UIMessage['role'];\n};\n\nconst MessageBranchSelector = ({\n ...props\n}: MessageBranchSelectorProps): ReactNode => {\n const { totalBranches } = useMessageBranch();\n\n if (totalBranches <= 1) {\n return null;\n }\n\n return (\n <ButtonGroup\n data-slot=\"message-branch-selector\"\n className=\"[&>*:not(:first-child)]:rounded-l-md [&>*:not(:last-child)]:rounded-r-md\"\n orientation=\"horizontal\"\n {...props}\n />\n );\n};\n\ntype MessageBranchPreviousProps = ComponentProps<typeof Button>;\n\nconst MessageBranchPrevious = ({\n children,\n ...props\n}: MessageBranchPreviousProps): ReactNode => {\n const { goToPrevious, totalBranches } = useMessageBranch();\n\n return (\n <Button\n data-slot=\"message-branch-previous\"\n aria-label=\"Previous branch\"\n disabled={totalBranches <= 1}\n onClick={goToPrevious}\n size=\"icon-sm\"\n type=\"button\"\n variant=\"ghost\"\n {...props}\n >\n {children ?? <IconChevronLeft size={14} />}\n </Button>\n );\n};\n\ntype MessageBranchNextProps = ComponentProps<typeof Button>;\n\nconst MessageBranchNext = ({\n children,\n ...props\n}: MessageBranchNextProps): ReactNode => {\n const { goToNext, totalBranches } = useMessageBranch();\n\n return (\n <Button\n data-slot=\"message-branch-next\"\n aria-label=\"Next branch\"\n disabled={totalBranches <= 1}\n onClick={goToNext}\n size=\"icon-sm\"\n type=\"button\"\n variant=\"ghost\"\n {...props}\n >\n {children ?? <IconChevronRight size={14} />}\n </Button>\n );\n};\n\ntype MessageBranchPageProps = HTMLAttributes<HTMLSpanElement>;\n\nconst MessageBranchPage = ({\n className,\n ...props\n}: MessageBranchPageProps): ReactNode => {\n const { currentBranch, totalBranches } = useMessageBranch();\n\n return (\n <ButtonGroupText\n data-slot=\"message-branch-page\"\n className={cn(\n 'border-none bg-transparent text-muted-foreground shadow-none px-2',\n className\n )}\n {...props}\n >\n {currentBranch + 1}/{totalBranches}\n </ButtonGroupText>\n );\n};\n\n/** Streamdown discards unrecognised props, so these go on a wrapper instead. */\ntype MessageResponseHostProps = Pick<\n HTMLAttributes<HTMLDivElement>,\n 'id' | 'role' | 'aria-label' | 'aria-labelledby' | 'aria-describedby'\n> & {\n 'data-testid'?: string;\n};\n\ntype MessageResponseProps = ComponentProps<typeof Streamdown> &\n MessageResponseHostProps;\n\ntype MarkdownComponentProps<T extends keyof JSX.IntrinsicElements> =\n JSX.IntrinsicElements[T] & ExtraProps;\n\nconst messageResponseComponents: Components = {\n h1: ({ children }: MarkdownComponentProps<'h1'>) => (\n <h1 className=\"mt-0 mb-2 scroll-m-20 text-xl font-medium tracking-tightest\">\n {children}\n </h1>\n ),\n h2: ({ children }: MarkdownComponentProps<'h2'>) => (\n <h2 className=\"mt-4 mb-1 scroll-m-20 text-lg font-medium tracking-tightest\">\n {children}\n </h2>\n ),\n h3: ({ children }: MarkdownComponentProps<'h3'>) => (\n <h3 className=\"mt-4 mb-1 scroll-m-20 text-base font-medium tracking-tighter\">\n {children}\n </h3>\n ),\n h4: ({ children }: MarkdownComponentProps<'h4'>) => (\n <h4 className=\"mt-2 mb-0 scroll-m-20 text-sm font-medium tracking-normal\">\n {children}\n </h4>\n ),\n h5: ({ children }: MarkdownComponentProps<'h5'>) => (\n <h5 className=\"mt-0 mb-0 scroll-m-20 text-xs font-medium tracking-tighter\">\n {children}\n </h5>\n ),\n h6: ({ children }: MarkdownComponentProps<'h6'>) => (\n <h6 className=\"mt-0 mb-0 scroll-m-20 text-2xs font-medium tracking-tighter\">\n {children}\n </h6>\n ),\n p: ({ children }: MarkdownComponentProps<'p'>) => (\n <p className=\"mt-2 mb-3 text-base font-normal leading-5 tracking-tightest\">\n {children}\n </p>\n ),\n strong: ({ children }: MarkdownComponentProps<'strong'>) => (\n <strong className=\"font-medium\">{children}</strong>\n ),\n em: ({ children }: MarkdownComponentProps<'em'>) => (\n <em className=\"italic\">{children}</em>\n ),\n b: ({ children }: MarkdownComponentProps<'b'>) => (\n <b className=\"font-medium\">{children}</b>\n ),\n i: ({ children }: MarkdownComponentProps<'i'>) => (\n <i className=\"italic\">{children}</i>\n ),\n ul: ({ children }: MarkdownComponentProps<'ul'>) => (\n <ul className=\"ml-8.25 mb-3 pt-2 pl-0 pb-0 list-disc text-base font-normal tracking-tightest\">\n {children}\n </ul>\n ),\n ol: ({ children }: MarkdownComponentProps<'ol'>) => (\n <ol className=\"ml-8.25 mb-3 pt-2 pl-0 pb-0 list-decimal text-base font-normal tracking-tightest\">\n {children}\n </ol>\n ),\n li: ({ children }: MarkdownComponentProps<'li'>) => (\n <li className=\"py-0\">{children}</li>\n ),\n blockquote: ({ children }: MarkdownComponentProps<'blockquote'>) => (\n <blockquote className=\"my-3 pr-2 pl-2 border-l border-l-default text-sm text-muted-foreground font-normal tracking-tight not-italic\">\n {children}\n </blockquote>\n ),\n hr: () => <hr className=\"my-4 border-default\" />,\n a: ({ children, href, ...props }: MarkdownComponentProps<'a'>) => (\n <a\n className=\"text-link-foreground no-underline hover:underline underline-offset-4\"\n href={href}\n {...props}\n >\n {children}\n </a>\n ),\n table: ({ children }: MarkdownComponentProps<'table'>) => (\n <div\n className=\"my-6 overflow-x-auto\"\n tabIndex={0}\n role=\"group\"\n aria-label=\"Atlas AI Chat Table\"\n >\n <table className=\"w-full\">{children}</table>\n </div>\n ),\n thead: ({ children }: MarkdownComponentProps<'thead'>) => (\n <thead>{children}</thead>\n ),\n tbody: ({ children }: MarkdownComponentProps<'tbody'>) => (\n <tbody>{children}</tbody>\n ),\n tr: ({ children }: MarkdownComponentProps<'tr'>) => (\n <tr className=\"m-0 border-t p-0 even:bg-muted-background\">{children}</tr>\n ),\n th: ({ children }: MarkdownComponentProps<'th'>) => (\n <th className=\"border px-4 py-2 text-left font-bold\">{children}</th>\n ),\n td: ({ children }: MarkdownComponentProps<'td'>) => (\n <td className=\"border px-4 py-2 text-left\">{children}</td>\n ),\n};\n\nconst MessageResponseMarkdown = ({\n className,\n components,\n plugins,\n controls,\n portal,\n ...props\n}: ComponentProps<typeof Streamdown>): JSX.Element => {\n const portalContainer = usePortalContainer();\n\n return (\n <Streamdown\n className={cn(\n 'size-full',\n // Blockquote paragraph overrides\n '[&_blockquote_p]:text-sm',\n '[&_blockquote_p]:tracking-tight',\n // Inline code\n '[&_code]:relative',\n '[&_code]:rounded',\n '[&_code]:bg-muted-background',\n '[&_code]:px-[0.3rem]',\n '[&_code]:py-[0.2rem]',\n '[&_code]:font-mono',\n '[&_code]:text-sm',\n '[&_code]:font-semibold',\n // Code blocks (Streamdown container)\n '[&_div[data-streamdown=\"code-block\"]]:my-4',\n '[&_div[data-streamdown=\"code-block\"]]:w-full',\n '[&_div[data-streamdown=\"code-block\"]]:overflow-hidden',\n '[&_div[data-streamdown=\"code-block\"]]:rounded-xl',\n '[&_div[data-streamdown=\"code-block\"]]:border',\n '[&_div[data-streamdown=\"code-block\"]]:border-default',\n // Code block header\n '[&_div[data-streamdown=\"code-block-header\"]]:flex',\n '[&_div[data-streamdown=\"code-block-header\"]]:items-center',\n '[&_div[data-streamdown=\"code-block-header\"]]:justify-between',\n '[&_div[data-streamdown=\"code-block-header\"]]:bg-muted-background/80',\n '[&_div[data-streamdown=\"code-block-header\"]]:px-4',\n '[&_div[data-streamdown=\"code-block-header\"]]:py-3',\n '[&_div[data-streamdown=\"code-block-header\"]]:text-xs',\n '[&_div[data-streamdown=\"code-block-header\"]]:text-muted-foreground',\n // Pre element inside code block\n '[&_div[data-streamdown=\"code-block\"]_pre]:m-0',\n '[&_div[data-streamdown=\"code-block\"]_pre]:overflow-x-auto',\n '[&_div[data-streamdown=\"code-block\"]_pre]:border-t',\n '[&_div[data-streamdown=\"code-block\"]_pre]:border-default',\n '[&_div[data-streamdown=\"code-block\"]_pre]:bg-card-background!',\n '[&_div[data-streamdown=\"code-block\"]_pre]:p-4',\n '[&_div[data-streamdown=\"code-block\"]_pre]:text-sm',\n '[&_div[data-streamdown=\"code-block\"]_pre]:text-medium-foreground!',\n // Code element inside pre\n '[&_div[data-streamdown=\"code-block\"]_pre_code]:static',\n '[&_div[data-streamdown=\"code-block\"]_pre_code]:rounded-none',\n '[&_div[data-streamdown=\"code-block\"]_pre_code]:bg-transparent',\n '[&_div[data-streamdown=\"code-block\"]_pre_code]:p-0',\n '[&_div[data-streamdown=\"code-block\"]_pre_code]:font-mono',\n '[&_div[data-streamdown=\"code-block\"]_pre_code]:text-sm',\n '[&_div[data-streamdown=\"code-block\"]_pre_code]:font-normal',\n // Code block buttons\n '[&_button[data-streamdown=\"code-block-copy-button\"]]:cursor-pointer',\n '[&_button[data-streamdown=\"code-block-copy-button\"]]:p-1',\n '[&_button[data-streamdown=\"code-block-copy-button\"]]:text-muted-foreground',\n '[&_button[data-streamdown=\"code-block-copy-button\"]]:transition-all',\n '[&_button[data-streamdown=\"code-block-copy-button\"]]:hover:text-base-foreground',\n '[&_button[data-streamdown=\"code-block-download-button\"]]:cursor-pointer',\n '[&_button[data-streamdown=\"code-block-download-button\"]]:p-1',\n '[&_button[data-streamdown=\"code-block-download-button\"]]:text-muted-foreground',\n '[&_button[data-streamdown=\"code-block-download-button\"]]:transition-all',\n '[&_button[data-streamdown=\"code-block-download-button\"]]:hover:text-base-foreground',\n // Regular pre blocks (not in Streamdown code blocks)\n '[&_pre:not([data-streamdown])]:my-3',\n '[&_pre:not([data-streamdown])]:mx-0',\n '[&_pre:not([data-streamdown])]:overflow-x-auto',\n '[&_pre:not([data-streamdown])]:rounded-md',\n '[&_pre:not([data-streamdown])]:border',\n '[&_pre:not([data-streamdown])]:bg-card-background',\n '[&_pre:not([data-streamdown])]:p-4',\n '[&_pre:not([data-streamdown])]:text-medium-foreground',\n '[&_pre:not([data-streamdown])]:text-sm',\n '[&_pre:not([data-streamdown])_code]:static',\n '[&_pre:not([data-streamdown])_code]:rounded-none',\n '[&_pre:not([data-streamdown])_code]:bg-transparent',\n '[&_pre:not([data-streamdown])_code]:px-0',\n '[&_pre:not([data-streamdown])_code]:py-0',\n '[&_pre:not([data-streamdown])_code]:font-mono',\n '[&_pre:not([data-streamdown])_code]:text-sm',\n '[&_pre:not([data-streamdown])_code]:font-normal',\n // Mermaid diagram blocks\n '[&_div[data-streamdown=\"mermaid-block\"]]:bg-card-background',\n '[&_div[data-streamdown=\"mermaid-block\"]]:text-base-foreground',\n '[&_div[data-streamdown=\"mermaid-block\"]]:flex',\n '[&_div[data-streamdown=\"mermaid-block\"]]:flex-col',\n '[&_div[data-streamdown=\"mermaid-block\"]]:rounded-lg',\n '[&_div[data-streamdown=\"mermaid-block\"]]:hover:bg-base-background-hover',\n '[&_div[data-streamdown=\"mermaid-block\"]]:border-0',\n // Positioning context for the action strip (see below)\n '[&_div[data-streamdown=\"mermaid-block\"]]:relative',\n // Nested scroll + sticky + pointer-events breaks hit-testing on Mermaid Copy/Download\n // (same class of issue as github.com/vercel/streamdown/issues/494). Force absolute strip.\n '[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!absolute',\n '[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!top-2',\n '[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!right-2',\n '[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!z-10',\n '[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!mt-0',\n '[&_div[data-streamdown=\"mermaid-block\"]>div:has([data-streamdown=\"mermaid-block-actions\"])]:!pointer-events-auto',\n // Ensure mermaid container is tall enough for the toolbar (pan/zoom + actions)\n '[&_div[data-streamdown=\"mermaid-block\"]_.relative.w-full]:!min-h-28',\n // KaTeX sizing (overflow rules live in styles.source.css)\n '[&_.katex-display]:my-3',\n '[&_.katex]:text-[1em]',\n // First and last child margin resets\n '[&>*:first-child]:mt-0',\n '[&>*:last-child]:mb-0',\n className\n )}\n components={{ ...messageResponseComponents, ...components }}\n controls={controls ?? MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS}\n plugins={{ ...plugins, mermaid: mermaidPlugin }}\n portal={portal ?? portalContainer}\n {...props}\n />\n );\n};\n\nconst MessageResponse = ({\n id,\n role,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n 'data-testid': dataTestId,\n ...props\n}: MessageResponseProps): JSX.Element => (\n <div\n data-slot=\"message-response\"\n id={id}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n data-testid={dataTestId}\n >\n <MessageResponseMarkdown {...props} />\n </div>\n);\n\ntype MessageAttachmentProps = HTMLAttributes<HTMLDivElement> & {\n data: FileUIPart;\n className?: string;\n onRemove?: () => void;\n};\n\nfunction MessageAttachment({\n data,\n className,\n onRemove,\n ...props\n}: MessageAttachmentProps): ReactNode {\n const filename = data.filename || '';\n const mediaType =\n data.mediaType?.startsWith('image/') && data.url ? 'image' : 'file';\n const isImage = mediaType === 'image';\n const attachmentLabel = filename || (isImage ? 'Image' : 'Attachment');\n\n return (\n <div\n data-slot=\"message-attachment\"\n className={cn(\n 'group relative size-24 overflow-hidden rounded-lg',\n className\n )}\n {...props}\n >\n {isImage ? (\n <>\n <img\n alt={filename || 'attachment'}\n className=\"size-full object-cover\"\n height={100}\n src={data.url}\n width={100}\n />\n {onRemove && (\n <Button\n aria-label=\"Remove attachment\"\n className=\"absolute top-2 right-2 size-6 rounded-full bg-card-background/80 p-0 opacity-0 backdrop-blur-sm transition-opacity hover:bg-card-background group-hover:opacity-100 [&>svg]:size-3\"\n onClick={(e) => {\n e.stopPropagation();\n onRemove();\n }}\n type=\"button\"\n variant=\"ghost\"\n >\n <IconX />\n <span className=\"sr-only\">Remove</span>\n </Button>\n )}\n </>\n ) : (\n <>\n <Tooltip>\n <TooltipTrigger\n render={\n <div className=\"flex size-full shrink-0 items-center justify-center rounded-lg bg-muted-background text-muted-foreground\">\n <IconPaperclip className=\"size-4\" />\n </div>\n }\n />\n <TooltipContent>\n <p>{attachmentLabel}</p>\n </TooltipContent>\n </Tooltip>\n {onRemove && (\n <Button\n aria-label=\"Remove attachment\"\n className=\"size-6 shrink-0 rounded-full p-0 opacity-0 transition-opacity hover:bg-base-background-hover group-hover:opacity-100 [&>svg]:size-3\"\n onClick={(e) => {\n e.stopPropagation();\n onRemove();\n }}\n type=\"button\"\n variant=\"ghost\"\n >\n <IconX />\n <span className=\"sr-only\">Remove</span>\n </Button>\n )}\n </>\n )}\n </div>\n );\n}\n\ntype MessageAttachmentsProps = ComponentProps<'div'>;\n\nfunction MessageAttachments({\n children,\n className,\n ...props\n}: MessageAttachmentsProps): ReactNode {\n if (!children) {\n return null;\n }\n\n return (\n <div\n data-slot=\"message-attachments\"\n className={cn(\n 'ml-auto flex w-fit flex-wrap items-start gap-2',\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n}\n\ntype MessageToolbarProps = ComponentProps<'div'>;\n\nconst MessageToolbar = ({\n className,\n children,\n ...props\n}: MessageToolbarProps): ReactNode => (\n <div\n data-slot=\"message-toolbar\"\n className={cn(\n 'mt-4 flex w-full items-center justify-between gap-4',\n className\n )}\n {...props}\n >\n {children}\n </div>\n);\n\nexport {\n Message,\n MessageAction,\n MessageActions,\n MessageAttachment,\n MessageAttachments,\n MessageAvatar,\n MessageAvatarIcon,\n MessageBranch,\n MessageBranchContent,\n MessageBranchNext,\n MessageBranchPage,\n MessageBranchPrevious,\n MessageBranchSelector,\n MessageContent,\n MessageResponse,\n MessageToolbar,\n};\n"],"names":["createContext","useCallback","useContext","useEffect","useMemo","useState","mermaid","mermaidPlugin","IconChevronLeft","IconChevronRight","IconPaperclip","IconX","Streamdown","usePortalContainer","cn","getInitials","Avatar","AvatarFallback","AvatarIcon","AvatarImage","Button","ButtonGroup","ButtonGroupText","Tooltip","TooltipContent","TooltipTrigger","MESSAGE_RESPONSE_DEFAULT_STREAMDOWN_CONTROLS","Message","className","isResponse","props","div","data-slot","MessageContent","children","MessageAvatar","avatarUrl","name","variant","sizes","fallbackText","alt","src","MessageAvatarIcon","MessageActions","MessageAction","tooltip","label","size","button","type","span","render","p","MessageBranchContext","useMessageBranch","context","Error","MessageBranch","defaultBranch","onBranchChange","currentBranch","setCurrentBranch","branches","setBranches","goToPrevious","prev","newBranch","length","goToNext","contextValue","totalBranches","Provider","value","MessageBranchContent","childrenArray","Array","isArray","map","branch","index","key","MessageBranchSelector","orientation","MessageBranchPrevious","aria-label","disabled","onClick","MessageBranchNext","MessageBranchPage","messageResponseComponents","h1","h2","h3","h4","h5","h6","strong","em","b","i","ul","ol","li","blockquote","hr","a","href","table","tabIndex","role","thead","tbody","tr","th","td","MessageResponseMarkdown","components","plugins","controls","portal","portalContainer","MessageResponse","id","ariaLabel","ariaLabelledBy","ariaDescribedBy","dataTestId","aria-labelledby","aria-describedby","data-testid","MessageAttachment","data","onRemove","filename","mediaType","startsWith","url","isImage","attachmentLabel","img","height","width","e","stopPropagation","MessageAttachments","MessageToolbar"],"mappings":";AAMA,SACEA,aAAa,EACbC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,QAAQ;AAEf,SAASC,WAAWC,aAAa,QAAQ,sBAAsB;AAC/D,SACEC,eAAe,EACfC,gBAAgB,EAChBC,aAAa,EACbC,KAAK,QACA,sBAAsB;AAG7B,SAASC,UAAU,QAAQ,aAAa;AAGxC,SAASC,kBAAkB,QAAQ,8CAA2C;AAC9E,SAASC,EAAE,EAAEC,WAAW,QAAQ,2BAAwB;AACxD,SACEC,MAAM,EACNC,cAAc,EACdC,UAAU,EACVC,WAAW,QACN,sBAAmB;AAC1B,SAASC,MAAM,QAAQ,sBAAmB;AAC1C,SAASC,WAAW,EAAEC,eAAe,QAAQ,kCAA+B;AAC5E,SAASC,OAAO,EAAEC,cAAc,EAAEC,cAAc,QAAQ,wBAAqB;AAE7E,SAASC,4CAA4C,QAAQ,oDAAiD;AAM9G,MAAMC,UAAU,CAAC,EACfC,SAAS,EACTC,aAAa,KAAK,EAClB,GAAGC,OACU,iBACb,KAACC;Q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IAExB,qBACE,KAACD;QACCgB,WAAWd,GACT,aACA,iCAAiC;QACjC,4BACA,mCACA,cAAc;QACd,qBACA,oBACA,gCACA,wBACA,wBACA,sBACA,oBACA,0BACA,qCAAqC;QACrC,8CACA,gDACA,yDACA,oDACA,gDACA,wDACA,oBAAoB;QACpB,qDACA,6DACA,gEACA,uEACA,qDACA,qDACA,wDACA,sEACA,gCAAgC;QAChC,iDACA,6DACA,sDACA,4DACA,iEACA,iDACA,qDACA,qEACA,0BAA0B;QAC1B,yDACA,+DACA,iEACA,sDACA,4DACA,0DACA,8DACA,qBAAqB;QACrB,uEACA,4DACA,8EACA,uEACA,mFACA,2EACA,gEACA,kFACA,2EACA,uFACA,qDAAqD;QACrD,uCACA,uCACA,kDACA,6CACA,yCACA,qDACA,sCACA,yDACA,0CACA,8CACA,oDACA,sDACA,4CACA,4CACA,iDACA,+CACA,mDACA,yBAAyB;QACzB,+DACA,iEACA,iDACA,qDACA,uDACA,2EACA,qDACA,uDAAuD;QACvD,qDACA,sFAAsF;QACtF,0FAA0F;QAC1F,yGACA,sGACA,wGACA,qGACA,qGACA,oHACA,+EAA+E;QAC/E,uEACA,0DAA0D;QAC1D,2BACA,yBACA,qCAAqC;QACrC,0BACA,yBACAc;QAEFyF,YAAY;YAAE,GAAG3B,yBAAyB;YAAE,GAAG2B,UAAU;QAAC;QAC1DE,UAAUA,YAAY7F;QACtB4F,SAAS;YAAE,GAAGA,OAAO;YAAEhH,SAASC;QAAc;QAC9CiH,QAAQA,UAAUC;QACjB,GAAG3F,KAAK;;AAGf;AAEA,MAAM4F,kBAAkB,CAAC,EACvBC,EAAE,EACFb,IAAI,EACJ,cAAcc,SAAS,EACvB,mBAAmBC,cAAc,EACjC,oBAAoBC,eAAe,EACnC,eAAeC,UAAU,EACzB,GAAGjG,OACkB,iBACrB,KAACC;QACCC,aAAU;QACV2F,IAAIA;QACJb,MAAMA;QACNzB,cAAYuC;QACZI,mBAAiBH;QACjBI,oBAAkBH;QAClBI,e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U;QACVJ,WAAWd,GACT,kDACAc;QAED,GAAGE,KAAK;kBAERI;;AAGP;AAIA,MAAMgH,iBAAiB,CAAC,EACtBtH,SAAS,EACTM,QAAQ,EACR,GAAGJ,OACiB,iBACpB,KAACC;QACCC,aAAU;QACVJ,WAAWd,GACT,uDACAc;QAED,GAAGE,KAAK;kBAERI;;AAIL,SACEP,OAAO,EACPkB,aAAa,EACbD,cAAc,EACduF,iBAAiB,EACjBc,kBAAkB,EAClB9G,aAAa,EACbQ,iBAAiB,EACjBe,aAAa,EACbgB,oBAAoB,EACpBc,iBAAiB,EACjBC,iBAAiB,EACjBL,qBAAqB,EACrBF,qBAAqB,EACrBjD,cAAc,EACdyF,eAAe,EACfwB,cAAc,GACd"}
@@ -0,0 +1,2 @@
1
+ import type { ReactElement } from "react";
2
+ export declare function SwitchGallery(): ReactElement;