@dust-tt/sparkle 0.2.641-rc-1 → 0.2.641-rc-2
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/cjs/index.js +1 -1
- package/dist/esm/components/AssistantCard.d.ts +1 -1
- package/dist/esm/components/AssistantCard.d.ts.map +1 -1
- package/dist/esm/components/Citation.d.ts +1 -1
- package/dist/esm/components/Citation.d.ts.map +1 -1
- package/dist/esm/components/Citation.js +13 -28
- package/dist/esm/components/Citation.js.map +1 -1
- package/dist/esm/components/ConversationMessage.d.ts +5 -1
- package/dist/esm/components/ConversationMessage.d.ts.map +1 -1
- package/dist/esm/components/ConversationMessage.js +11 -8
- package/dist/esm/components/ConversationMessage.js.map +1 -1
- package/dist/esm/components/markdown/Markdown.d.ts +5 -2
- package/dist/esm/components/markdown/Markdown.d.ts.map +1 -1
- package/dist/esm/components/markdown/Markdown.js +6 -4
- package/dist/esm/components/markdown/Markdown.js.map +1 -1
- package/dist/esm/components/markdown/useAnimatedText.d.ts +6 -0
- package/dist/esm/components/markdown/useAnimatedText.d.ts.map +1 -0
- package/dist/esm/components/markdown/useAnimatedText.js +28 -0
- package/dist/esm/components/markdown/useAnimatedText.js.map +1 -0
- package/dist/esm/icons/actions/Atom.js +1 -1
- package/dist/esm/icons/actions/Atom.js.map +1 -1
- package/dist/esm/icons/app/Atom.js +1 -1
- package/dist/esm/icons/app/Atom.js.map +1 -1
- package/dist/esm/stories/Citation.stories.d.ts +1 -1
- package/dist/esm/stories/Citation.stories.d.ts.map +1 -1
- package/dist/esm/stories/Citation.stories.js +25 -24
- package/dist/esm/stories/Citation.stories.js.map +1 -1
- package/dist/esm/stories/ConversationMessage.stories.d.ts +1 -0
- package/dist/esm/stories/ConversationMessage.stories.d.ts.map +1 -1
- package/dist/esm/stories/ConversationMessage.stories.js +26 -1
- package/dist/esm/stories/ConversationMessage.stories.js.map +1 -1
- package/dist/esm/stories/InteractiveImageGrid.stories.d.ts +1 -1
- package/dist/esm/styles/global.css +0 -12
- package/dist/esm/styles/global_with_tw_base.css +0 -21
- package/dist/esm/styles/tailwind.css +0 -11
- package/dist/sparkle.css +24 -42
- package/package.json +2 -1
- package/src/components/AssistantCard.tsx +1 -1
- package/src/components/Citation.tsx +37 -69
- package/src/components/ConversationMessage.tsx +36 -21
- package/src/components/markdown/Markdown.tsx +23 -12
- package/src/components/markdown/useAnimatedText.ts +38 -0
- package/src/icons/actions/Atom.tsx +1 -1
- package/src/icons/app/Atom.tsx +1 -1
- package/src/stories/Citation.stories.tsx +26 -44
- package/src/stories/ConversationMessage.stories.tsx +100 -0
- package/src/styles/global.css +0 -12
- package/src/styles/global_with_tw_base.css +0 -21
- package/src/styles/tailwind.css +0 -11
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Button, Citation, CitationClose, CitationDescription, CitationGrid, CitationIcons, CitationIndex, CitationTitle, DocumentIcon, ExternalLinkIcon, FaviconIcon, GlobeAltIcon, Icon, ImageIcon,
|
|
2
|
+
import { Button, Citation, CitationClose, CitationDescription, CitationGrid, CitationIcons, CitationImage, CitationIndex, CitationTitle, DocumentIcon, ExternalLinkIcon, FaviconIcon, GlobeAltIcon, Icon, ImageIcon, NotionLogo, Popover, SlackLogo, TableIcon, } from "../index_with_tw_base";
|
|
3
3
|
var meta = {
|
|
4
4
|
title: "Components/Citation",
|
|
5
5
|
component: Citation,
|
|
@@ -8,30 +8,31 @@ export default meta;
|
|
|
8
8
|
export var CitationsExample = function () { return (React.createElement("div", { className: "s-flex s-flex-col s-gap-8" },
|
|
9
9
|
"Example of attachement",
|
|
10
10
|
React.createElement(CitationGrid, null,
|
|
11
|
-
React.createElement(Citation, { onClick: function () { return alert("Card clicked"); }, tooltip: "@ed at 16:32 This is the latest ve" },
|
|
11
|
+
React.createElement(Citation, { onClick: function () { return alert("Card clicked"); }, className: "s-w-48", tooltip: "@ed at 16:32 This is the latest ve" },
|
|
12
12
|
React.createElement(CitationIcons, null,
|
|
13
13
|
React.createElement(Icon, { visual: SlackLogo, size: "sm" })),
|
|
14
14
|
React.createElement(CitationTitle, null, "Citation w/ tooltip"),
|
|
15
15
|
React.createElement(CitationDescription, null, "@ed at 16:32 This is the latest ve"))),
|
|
16
16
|
React.createElement(CitationGrid, null,
|
|
17
|
-
React.createElement(Citation, { onClick: function () { return alert("Card clicked"); }, tooltip: "@ed at 16:32 This is the latest ve" },
|
|
17
|
+
React.createElement(Citation, { onClick: function () { return alert("Card clicked"); }, className: "s-w-48", tooltip: "@ed at 16:32 This is the latest ve" },
|
|
18
18
|
React.createElement(CitationIcons, null,
|
|
19
19
|
React.createElement(Icon, { visual: SlackLogo, size: "sm" })),
|
|
20
20
|
React.createElement(CitationTitle, null, "Slack thread"),
|
|
21
21
|
React.createElement(CitationDescription, null, "@ed at 16:32 This is the latest ve")),
|
|
22
|
-
React.createElement(Citation, { onClick: function () { return alert("Card clicked"); } },
|
|
22
|
+
React.createElement(Citation, { onClick: function () { return alert("Card clicked"); }, className: "s-w-48" },
|
|
23
23
|
React.createElement(CitationIcons, null,
|
|
24
24
|
React.createElement(Icon, { visual: TableIcon, size: "sm" })),
|
|
25
25
|
React.createElement(CitationTitle, null, "extract_financa.csv")),
|
|
26
|
-
React.createElement(Citation, { onClick: function () { return alert("Card clicked"); } },
|
|
26
|
+
React.createElement(Citation, { onClick: function () { return alert("Card clicked"); }, className: "s-w-48" },
|
|
27
27
|
React.createElement(CitationIcons, null,
|
|
28
28
|
React.createElement(FaviconIcon, { websiteUrl: "https://www.linkedin.com", size: "sm" })),
|
|
29
29
|
React.createElement(CitationTitle, null, "Linkedin, Edouard Wautier")),
|
|
30
|
-
React.createElement(Citation, { onClick: function () { return alert("Card clicked"); } },
|
|
30
|
+
React.createElement(Citation, { onClick: function () { return alert("Card clicked"); }, className: "s-w-48" },
|
|
31
31
|
React.createElement(CitationIcons, null,
|
|
32
32
|
React.createElement(FaviconIcon, { websiteUrl: "https://github.com", size: "sm" })),
|
|
33
33
|
React.createElement(CitationTitle, null, "GitHub Repository")),
|
|
34
|
-
React.createElement(Citation, { onClick: function () { return alert("Card clicked"); },
|
|
34
|
+
React.createElement(Citation, { onClick: function () { return alert("Card clicked"); }, className: "s-w-48" },
|
|
35
|
+
React.createElement(CitationImage, { imgSrc: "https://dust.tt/static/droidavatar/Droid_Lime_3.jpg" }),
|
|
35
36
|
React.createElement(CitationIcons, null,
|
|
36
37
|
React.createElement(Icon, { visual: ImageIcon, size: "sm" })),
|
|
37
38
|
React.createElement(CitationTitle, null, "screenshot.png")),
|
|
@@ -54,45 +55,45 @@ export var CitationsExample = function () { return (React.createElement("div", {
|
|
|
54
55
|
React.createElement(CitationIcons, null,
|
|
55
56
|
React.createElement(Icon, { visual: GlobeAltIcon, size: "sm" })),
|
|
56
57
|
React.createElement(CitationTitle, null, "Linkedin, Edouard Wautier")),
|
|
57
|
-
React.createElement(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
React.createElement(
|
|
61
|
-
|
|
58
|
+
React.createElement(Citation, { onClick: function () { return alert("Card clicked"); }, className: "s-w-48", action: React.createElement(CitationClose, { onClick: function () { return alert("Close clicked"); } }) },
|
|
59
|
+
React.createElement(CitationImage, { imgSrc: "https://dust.tt/static/droidavatar/Droid_Lime_3.jpg" }),
|
|
60
|
+
React.createElement(CitationIcons, null,
|
|
61
|
+
React.createElement(Icon, { visual: ImageIcon, size: "sm" })),
|
|
62
|
+
React.createElement(CitationTitle, null, "screenshot.png"))),
|
|
62
63
|
"Example of citations in markdown",
|
|
63
64
|
React.createElement("div", null,
|
|
64
65
|
React.createElement(Popover, { trigger: React.createElement(CitationIndex, null, "1"), content: React.createElement(React.Fragment, null,
|
|
65
66
|
React.createElement(CitationIcons, null,
|
|
66
|
-
React.createElement(
|
|
67
|
-
React.createElement(
|
|
67
|
+
React.createElement(CitationIndex, null, "1"),
|
|
68
|
+
React.createElement(Icon, { visual: SlackLogo, size: "sm" })),
|
|
68
69
|
React.createElement(CitationTitle, null, "Hello"),
|
|
69
70
|
React.createElement(Button, { variant: "ghost", icon: ExternalLinkIcon, className: "s-absolute s-right-2 s-top-2" })) })),
|
|
70
71
|
"Example of dynamic grid",
|
|
71
72
|
React.createElement(CitationGrid, null,
|
|
72
73
|
React.createElement(Citation, { onClick: function () { return alert("Card clicked"); } },
|
|
73
74
|
React.createElement(CitationIcons, null,
|
|
74
|
-
React.createElement(
|
|
75
|
-
React.createElement(
|
|
75
|
+
React.createElement(CitationIndex, null, "1"),
|
|
76
|
+
React.createElement(Icon, { visual: SlackLogo, size: "sm" })),
|
|
76
77
|
React.createElement(CitationTitle, null, "Hello")),
|
|
77
78
|
React.createElement(Citation, { onClick: function () { return alert("Close action clicked"); } },
|
|
78
79
|
React.createElement(CitationIcons, null,
|
|
79
|
-
React.createElement(
|
|
80
|
-
React.createElement(
|
|
80
|
+
React.createElement(CitationIndex, null, "2"),
|
|
81
|
+
React.createElement(Icon, { visual: NotionLogo, size: "sm" })),
|
|
81
82
|
React.createElement(CitationTitle, null, "Hello")),
|
|
82
83
|
React.createElement(Citation, { onClick: function () { return alert("Close action clicked"); } },
|
|
83
84
|
React.createElement(CitationIcons, null,
|
|
84
|
-
React.createElement(
|
|
85
|
-
React.createElement(
|
|
85
|
+
React.createElement(CitationIndex, null, "3"),
|
|
86
|
+
React.createElement(Icon, { visual: DocumentIcon, size: "sm" })),
|
|
86
87
|
React.createElement(CitationTitle, null, "Hello")),
|
|
87
88
|
React.createElement(Citation, { onClick: function () { return alert("Close action clicked"); } },
|
|
88
89
|
React.createElement(CitationIcons, null,
|
|
89
|
-
React.createElement(
|
|
90
|
-
React.createElement(
|
|
90
|
+
React.createElement(CitationIndex, null, "4"),
|
|
91
|
+
React.createElement(FaviconIcon, { websiteUrl: "https://stackoverflow.com", size: "sm" })),
|
|
91
92
|
React.createElement(CitationTitle, null, "Stack Overflow Answer")),
|
|
92
93
|
React.createElement(Citation, { onClick: function () { return alert("Close action clicked"); } },
|
|
93
94
|
React.createElement(CitationIcons, null,
|
|
94
|
-
React.createElement(
|
|
95
|
-
React.createElement(
|
|
95
|
+
React.createElement(CitationIndex, null, "5"),
|
|
96
|
+
React.createElement(FaviconIcon, { websiteUrl: "https://www.wikipedia.org", size: "sm" })),
|
|
96
97
|
React.createElement(CitationTitle, null, "Wikipedia Article"))),
|
|
97
98
|
"Example of interactive content (list variant)",
|
|
98
99
|
React.createElement(CitationGrid, { variant: "list" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Citation.stories.js","sourceRoot":"","sources":["../../../src/stories/Citation.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,MAAM,EACN,QAAQ,EACR,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,IAAI,EACJ,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"Citation.stories.js","sourceRoot":"","sources":["../../../src/stories/Citation.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,MAAM,EACN,QAAQ,EACR,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,IAAI,EACJ,SAAS,EACT,UAAU,EACV,OAAO,EACP,SAAS,EACT,SAAS,GACV,MAAM,uBAAuB,CAAC;AAE/B,IAAM,IAAI,GAAG;IACX,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,QAAQ;CACY,CAAC;AAElC,eAAe,IAAI,CAAC;AAEpB,MAAM,CAAC,IAAM,gBAAgB,GAAG,cAAM,OAAA,CACpC,6BAAK,SAAS,EAAC,2BAA2B;;IAExC,oBAAC,YAAY;QACX,oBAAC,QAAQ,IACP,OAAO,EAA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,EAAC,IAAI,EAAC,IAAI,GAAG,CAClD;YAChB,oBAAC,aAAa,4BAAkC,CACvC,CACE;;IAEf,oBAAC,YAAY,IAAC,OAAO,EAAC,MAAM;QAC1B,oBAAC,QAAQ,IAAC,OAAO,EAAE,cAAM,OAAA,KAAK,CAAC,6BAA6B,CAAC,EAApC,CAAoC;YAC3D,oBAAC,aAAa,8BAAoC;YAClD,oBAAC,mBAAmB,wBAAoC,CAC/C;QACX,oBAAC,QAAQ,IAAC,OAAO,EAAE,cAAM,OAAA,KAAK,CAAC,6BAA6B,CAAC,EAApC,CAAoC;YAC3D,oBAAC,aAAa,iCAAuC;YACrD,oBAAC,mBAAmB,8BAA0C,CACrD;QACX,oBAAC,QAAQ,IAAC,OAAO,EAAE,cAAM,OAAA,KAAK,CAAC,6BAA6B,CAAC,EAApC,CAAoC;YAC3D,oBAAC,aAAa,iCAAuC;YACrD,oBAAC,mBAAmB,wBAAoC,CAC/C,CACE,CACX,CACP,EA7LqC,CA6LrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationMessage.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/ConversationMessage.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ConversationMessage.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/ConversationMessage.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAuB1B,QAAA,MAAM,IAAI;;CAEkC,CAAC;AAE7C,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,mBAAmB,yBA2F/B,CAAC;AAiEF,eAAO,MAAM,0BAA0B,yBAwEtC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Avatar, Button, Citation, CitationIcons, CitationTitle, ClockIcon, ConversationContainer, ConversationMessage, GithubIcon, HandThumbDownIcon, HandThumbUpIcon, Icon, Markdown, SlackLogo, TableIcon, } from "../index_with_tw_base";
|
|
2
|
+
import { ArrowPathIcon, AtomIcon, Avatar, Button, Citation, CitationIcons, CitationTitle, ClipboardIcon, ClockIcon, ConversationContainer, ConversationMessage, GithubIcon, HandThumbDownIcon, HandThumbUpIcon, Icon, Markdown, SlackLogo, TableIcon, } from "../index_with_tw_base";
|
|
3
3
|
var meta = {
|
|
4
4
|
title: "Modules/ConversationMessage",
|
|
5
5
|
};
|
|
@@ -32,4 +32,29 @@ export var ConversationExample = function () {
|
|
|
32
32
|
React.createElement(ConversationMessage, { type: "user", name: "Edouard", pictureUrl: "https://dust.tt/static/droidavatar/Droid_Lime_1.jpg", isDisabled: true, renderName: function (name) { return (React.createElement("span", { className: "s-text-gray-600 s-text-opacity-25" }, name)); } }, "This is a message with a disabled agent")))));
|
|
33
33
|
};
|
|
34
34
|
var example = "\n# Level 1 Title\n## Level 2 Title\n### Level 3 Title\n#### Level 4 Title\n##### Level 5 Title\n###### Level 6 Title\n\nThis is a paragraph with **bold** text and *italic* text. This is `code` block:\n```\nBlock \n```\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\n# Another Level 1 Title\n\nDemo of a list, showcasing our pets of the month:\n- Soupinou\n- Chawarma\n- Chalom\n- Anakine\n- Goose\n\nOrdered list: \n1. Soupinou\n2. Chawarma\n3. Chalom\n\n---\n\n### Demo of a quote below:\n\n> You take the blue pill - the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pill - you stay in Wonderland and I show you how deep the rabbit hole goes.\n\n> You take the blue pill - the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pill - you stay in Wonderland and I show you how deep the rabbit hole goes.\n\nAnother one, a short one:\n> Soupinou fait des miaou miaou.\n\n### Other stuff\n\n~~stuff~~\nlink www.x.com\nfootnote [^1]\n\n* [ ] to do\n* [x] done\n\n### Short Table\n\n| Date | High Temperature (\u00B0C) | Low Temperature (\u00B0C) |\n|-------------|-----------------------|----------------------|\n| October 25 | 19 | 14 |\n| October 26 | 17 | 12 |\n| October 27 | 16 | 10 |\n| October 28 | 16 | 9 |\n| October 29 | 17 | 8 |\n| October 30 | 19 | 8 |\n| October 31 | 19 | 10 |\n\n";
|
|
35
|
+
export var ConversationHandoffExample = function () {
|
|
36
|
+
return (React.createElement(React.Fragment, null,
|
|
37
|
+
React.createElement("div", { className: "s-flex s-w-full s-justify-center s-gap-6" },
|
|
38
|
+
React.createElement(ConversationContainer, null,
|
|
39
|
+
React.createElement(ConversationMessage, { type: "user", name: "Daph", pictureUrl: "https://avatars.githubusercontent.com/u/3803406?v=4", timestamp: "17:09" }, "Can you provide an overview of the major frontier language models and their specificities. I'm curious about technical details, benchmarks, business etc.. I need a complete picture"),
|
|
40
|
+
React.createElement(ConversationMessage, { type: "agent", name: "@soupinou", pictureUrl: "https://avatars.githubusercontent.com/u/138893015?&v=4", buttons: [
|
|
41
|
+
React.createElement(Button, { icon: ClipboardIcon, onClick: function () { }, size: "xs", variant: "outline" }),
|
|
42
|
+
React.createElement(Button, { icon: ArrowPathIcon, onClick: function () { }, size: "xs", variant: "outline" }),
|
|
43
|
+
] },
|
|
44
|
+
React.createElement(Markdown, { content: "Let me use Deep Dive to explore this comprehensively. I'll need some time to gather all the information." })),
|
|
45
|
+
React.createElement(ConversationMessage, { type: "agentAsTool", name: "Deep Dive", renderName: function (name) { return (React.createElement("span", { className: "s-inline-flex s-items-center s-text-faint dark:s-text-faint-night" },
|
|
46
|
+
React.createElement(Icon, { visual: AtomIcon, size: "sm" }),
|
|
47
|
+
React.createElement("span", { className: "s-ml-1" }, name))); }, citations: [
|
|
48
|
+
React.createElement(Citation, { href: "https://www.google.com" },
|
|
49
|
+
React.createElement(CitationIcons, null,
|
|
50
|
+
React.createElement(Icon, { visual: SlackLogo, size: "sm" })),
|
|
51
|
+
React.createElement(CitationTitle, null, "Source: Thread on #general message from @ed")),
|
|
52
|
+
React.createElement(Citation, { href: "https://www.google.com" },
|
|
53
|
+
React.createElement(CitationIcons, null,
|
|
54
|
+
React.createElement(Icon, { visual: GithubIcon, size: "sm" })),
|
|
55
|
+
React.createElement(CitationTitle, null, "PR from @henry")),
|
|
56
|
+
] },
|
|
57
|
+
React.createElement(Markdown, { content: handoffAnswer }))))));
|
|
58
|
+
};
|
|
59
|
+
var handoffAnswer = "\n**A Complete Technical Overview of Soupinou: The Frontier Feline Model**\n\nSoupinou represents a breakthrough in black cat architecture, featuring a revolutionary single-whisker design that challenges conventional multi-whisker paradigms. This asymmetric sensor configuration demonstrates remarkable efficiency gains in cuddle detection and lap-finding algorithms.\n\n**Technical Specifications:**\n- Processing unit: One (1) whisker sensor array\n- Color depth: Maximum black saturation\n- Purr frequency: Variable, optimized for human dopamine release\n- Cuddle latency: Near-zero response time\n\n**Benchmark Performance:**\n- Achieves 99.7% accuracy in identifying the exact moment you sit down\n- Outperforms all competitors in the \"appearing from nowhere when you're sad\" metric\n- Sets new industry standards for selective hearing (responds to treat bags but not \"get off the counter\")\n\n**Business Model:**\nOperates on a simple value exchange - provides unlimited affection in return for food, shelter, and accepting that everything you own now has black fur on it. Market penetration strategy involves strategic placement on keyboards during important work calls.\n\n**Limitations:**\nOccasional system crashes when presented with empty food bowl. Single whisker may cause slight navigation errors when squeezing through spaces designed for two-whiskered models.\n";
|
|
35
60
|
//# sourceMappingURL=ConversationMessage.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationMessage.stories.js","sourceRoot":"","sources":["../../../src/stories/ConversationMessage.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,MAAM,EACN,MAAM,EACN,QAAQ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AAQ,IAAC,IAAI,EAAC,wBAAwB;4BACrC,oBAAC,aAAa;gCACZ,oBAAC,IAAI,IAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAC,IAAI,GAAG,CACvB;4BAChB,oBAAC,aAAa,sDAEE,CACP;wBACX,oBAAC,QAAQ,IAAC,IAAI,EAAC,wBAAwB;4BACrC,oBAAC,aAAa;gCACZ,oBAAC,IAAI,IAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAC,IAAI,GAAG,CACxB;4BAChB,oBAAC,aAAa,gBAAsB,CAC3B;qBACZ;oBAED,oBAAC,QAAQ,IAAC,OAAO,EAAE,OAAO,GAAI,CACV;gBAEtB,oBAAC,mBAAmB,IAClB,IAAI,EAAC,MAAM,EACX,IAAI,EAAC,SAAS,EACd,UAAU,EAAC,qDAAqD,gSAO5C;gBAEtB,oBAAC,mBAAmB,IAClB,IAAI,EAAC,MAAM,EACX,IAAI,EAAC,SAAS,EACd,UAAU,EAAC,qDAAqD,EAChE,UAAU,EAAE,IAAI,EAChB,UAAU,EAAE,UAAC,IAAI,IAAK,OAAA,CACpB,8BAAM,SAAS,EAAC,mCAAmC,IAAE,IAAI,CAAQ,CAClE,EAFqB,CAErB,8CAGmB,CACA,CACpB,CACL,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,IAAM,OAAO,GAAG,qhEA6Df,CAAC"}
|
|
1
|
+
{"version":3,"file":"ConversationMessage.stories.js","sourceRoot":"","sources":["../../../src/stories/ConversationMessage.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,aAAa,EACb,QAAQ,EACR,MAAM,EACN,MAAM,EACN,QAAQ,EACR,aAAa,EACb,aAAa,EACb,aAAa,EACb,SAAS,EACT,qBAAqB,EACrB,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,SAAS,GACV,MAAM,uBAAuB,CAAC;AA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I,EAAC,IAAI,EACT,OAAO,EAAE,SAAS,GAClB;qBACH;oBAED,oBAAC,QAAQ,IACP,OAAO,EACL,0GAA0G,GAE5G,CACkB;gBACtB,oBAAC,mBAAmB,IAClB,IAAI,EAAC,aAAa,EAClB,IAAI,EAAC,WAAW,EAChB,UAAU,EAAE,UAAC,IAAI,IAAK,OAAA,CACpB,8BAAM,SAAS,EAAC,mEAAmE;wBACjF,oBAAC,IAAI,IAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAC,IAAI,GAAG;wBACpC,8BAAM,SAAS,EAAC,QAAQ,IAAE,IAAI,CAAQ,CACjC,CACR,EALqB,CAKrB,EACD,SAAS,EAAE;wBACT,oBAAC,QAAQ,IAAC,IAAI,EAAC,wBAAwB;4BACrC,oBAAC,aAAa;gCACZ,oBAAC,IAAI,IAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAC,IAAI,GAAG,CACvB;4BAChB,oBAAC,aAAa,sDAEE,CACP;wBACX,oBAAC,QAAQ,IAAC,IAAI,EAAC,wBAAwB;4BACrC,oBAAC,aAAa;gCACZ,oBAAC,IAAI,IAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAC,IAAI,GAAG,CACxB;4BAChB,oBAAC,aAAa,yBAA+B,CACpC;qBACZ;oBAED,oBAAC,QAAQ,IAAC,OAAO,EAAE,aAAa,GAAI,CAChB,CACA,CACpB,CACL,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,IAAM,aAAa,GAAG,w2CAqBrB,CAAC"}
|
|
@@ -4,7 +4,7 @@ declare const meta: {
|
|
|
4
4
|
component: React.ForwardRefExoticComponent<(import("../index_with_tw_base").CardProps & {
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
isLoading?: boolean | undefined;
|
|
7
|
-
tooltip?:
|
|
7
|
+
tooltip?: string | undefined;
|
|
8
8
|
}) & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
};
|
|
10
10
|
export default meta;
|
|
@@ -51,15 +51,3 @@
|
|
|
51
51
|
--tw-checker-color: theme("colors.slate.950"); /* Dark mode pattern color */
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
.s-blinking-cursor > :not(pre):last-child::after {
|
|
56
|
-
content: "";
|
|
57
|
-
width: 8px;
|
|
58
|
-
height: 16px;
|
|
59
|
-
@apply s-bg-success-400;
|
|
60
|
-
display: inline-block;
|
|
61
|
-
@apply s-animate-cursor-blink;
|
|
62
|
-
margin-left: 5px;
|
|
63
|
-
position: relative;
|
|
64
|
-
top: 4px;
|
|
65
|
-
}
|
|
@@ -2,27 +2,6 @@
|
|
|
2
2
|
@tailwind components;
|
|
3
3
|
@tailwind utilities;
|
|
4
4
|
|
|
5
|
-
.s-blinking-cursor > :not(pre):last-child::after {
|
|
6
|
-
content: "";
|
|
7
|
-
width: 8px;
|
|
8
|
-
height: 16px;
|
|
9
|
-
@apply s-bg-success-400;
|
|
10
|
-
display: inline-block;
|
|
11
|
-
@apply s-animate-cursor-blink;
|
|
12
|
-
margin-left: 5px;
|
|
13
|
-
position: relative;
|
|
14
|
-
top: 4px;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
@keyframes collapse-down {
|
|
18
|
-
from {
|
|
19
|
-
height: 0;
|
|
20
|
-
}
|
|
21
|
-
to {
|
|
22
|
-
height: var(--radix-collapsible-content-height);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
5
|
@keyframes collapse-up {
|
|
27
6
|
from {
|
|
28
7
|
height: var(--radix-collapsible-content-height);
|
|
@@ -2,17 +2,6 @@
|
|
|
2
2
|
@tailwind components;
|
|
3
3
|
@tailwind utilities;
|
|
4
4
|
|
|
5
|
-
.s-blinking-cursor > :not(pre):last-child::after {
|
|
6
|
-
content: "";
|
|
7
|
-
width: 8px;
|
|
8
|
-
height: 16px;
|
|
9
|
-
@apply s-bg-success-400;
|
|
10
|
-
display: inline-block;
|
|
11
|
-
@apply s-animate-cursor-blink;
|
|
12
|
-
margin-left: 5px;
|
|
13
|
-
position: relative;
|
|
14
|
-
top: 4px;
|
|
15
|
-
}
|
|
16
5
|
|
|
17
6
|
@keyframes bgblink {
|
|
18
7
|
0%,
|
package/dist/sparkle.css
CHANGED
|
@@ -1518,10 +1518,6 @@ select {
|
|
|
1518
1518
|
height: 1px;
|
|
1519
1519
|
}
|
|
1520
1520
|
|
|
1521
|
-
.s-max-h-40 {
|
|
1522
|
-
max-height: 10rem;
|
|
1523
|
-
}
|
|
1524
|
-
|
|
1525
1521
|
.s-max-h-72 {
|
|
1526
1522
|
max-height: 18rem;
|
|
1527
1523
|
}
|
|
@@ -1860,10 +1856,6 @@ select {
|
|
|
1860
1856
|
max-width: 80vh;
|
|
1861
1857
|
}
|
|
1862
1858
|
|
|
1863
|
-
.s-max-w-\[80vw\] {
|
|
1864
|
-
max-width: 80vw;
|
|
1865
|
-
}
|
|
1866
|
-
|
|
1867
1859
|
.s-max-w-\[900px\] {
|
|
1868
1860
|
max-width: 900px;
|
|
1869
1861
|
}
|
|
@@ -4312,6 +4304,11 @@ select {
|
|
|
4312
4304
|
padding-bottom: 1rem;
|
|
4313
4305
|
}
|
|
4314
4306
|
|
|
4307
|
+
.s-py-5 {
|
|
4308
|
+
padding-top: 1.25rem;
|
|
4309
|
+
padding-bottom: 1.25rem;
|
|
4310
|
+
}
|
|
4311
|
+
|
|
4315
4312
|
.s-py-8 {
|
|
4316
4313
|
padding-top: 2rem;
|
|
4317
4314
|
padding-bottom: 2rem;
|
|
@@ -4425,6 +4422,10 @@ select {
|
|
|
4425
4422
|
padding-top: 1.75rem;
|
|
4426
4423
|
}
|
|
4427
4424
|
|
|
4425
|
+
.s-pt-\[min\(8\%\,theme\(spacing\.3\)\)\] {
|
|
4426
|
+
padding-top: min(8%,0.75rem);
|
|
4427
|
+
}
|
|
4428
|
+
|
|
4428
4429
|
.s-text-left {
|
|
4429
4430
|
text-align: left;
|
|
4430
4431
|
}
|
|
@@ -4923,6 +4924,11 @@ select {
|
|
|
4923
4924
|
color: rgb(42 50 65 / var(--tw-text-opacity));
|
|
4924
4925
|
}
|
|
4925
4926
|
|
|
4927
|
+
.s-text-primary-200 {
|
|
4928
|
+
--tw-text-opacity: 1;
|
|
4929
|
+
color: rgb(211 213 217 / var(--tw-text-opacity));
|
|
4930
|
+
}
|
|
4931
|
+
|
|
4926
4932
|
.s-text-primary-400 {
|
|
4927
4933
|
--tw-text-opacity: 1;
|
|
4928
4934
|
color: rgb(150 156 165 / var(--tw-text-opacity));
|
|
@@ -5403,40 +5409,6 @@ select {
|
|
|
5403
5409
|
mask-image: radial-gradient(white,black);
|
|
5404
5410
|
}
|
|
5405
5411
|
|
|
5406
|
-
.s-blinking-cursor > :not(pre):last-child::after {
|
|
5407
|
-
content: "";
|
|
5408
|
-
width: 8px;
|
|
5409
|
-
height: 16px;
|
|
5410
|
-
--tw-bg-opacity: 1;
|
|
5411
|
-
background-color: rgb(145 193 116 / var(--tw-bg-opacity));
|
|
5412
|
-
display: inline-block;
|
|
5413
|
-
}
|
|
5414
|
-
|
|
5415
|
-
@keyframes s-cursor-blink {
|
|
5416
|
-
0% {
|
|
5417
|
-
opacity: 1;
|
|
5418
|
-
}
|
|
5419
|
-
|
|
5420
|
-
60% {
|
|
5421
|
-
opacity: 1;
|
|
5422
|
-
}
|
|
5423
|
-
|
|
5424
|
-
70% {
|
|
5425
|
-
opacity: 0;
|
|
5426
|
-
}
|
|
5427
|
-
|
|
5428
|
-
100% {
|
|
5429
|
-
opacity: 0;
|
|
5430
|
-
}
|
|
5431
|
-
}
|
|
5432
|
-
|
|
5433
|
-
.s-blinking-cursor > :not(pre):last-child::after {
|
|
5434
|
-
animation: s-cursor-blink 0.9s infinite;;
|
|
5435
|
-
margin-left: 5px;
|
|
5436
|
-
position: relative;
|
|
5437
|
-
top: 4px;
|
|
5438
|
-
}
|
|
5439
|
-
|
|
5440
5412
|
@keyframes bgblink {
|
|
5441
5413
|
0%,
|
|
5442
5414
|
100% {
|
|
@@ -7982,6 +7954,11 @@ select {
|
|
|
7982
7954
|
color: rgb(236 253 245 / var(--tw-text-opacity));
|
|
7983
7955
|
}
|
|
7984
7956
|
|
|
7957
|
+
:is(.s-dark .dark\:s-text-faint-night) {
|
|
7958
|
+
--tw-text-opacity: 1;
|
|
7959
|
+
color: rgb(84 93 108 / var(--tw-text-opacity));
|
|
7960
|
+
}
|
|
7961
|
+
|
|
7985
7962
|
:is(.s-dark .dark\:s-text-foreground-night) {
|
|
7986
7963
|
--tw-text-opacity: 1;
|
|
7987
7964
|
color: rgb(211 213 217 / var(--tw-text-opacity));
|
|
@@ -8192,6 +8169,11 @@ select {
|
|
|
8192
8169
|
color: rgb(255 241 247 / var(--tw-text-opacity));
|
|
8193
8170
|
}
|
|
8194
8171
|
|
|
8172
|
+
:is(.s-dark .dark\:s-text-primary-200-night) {
|
|
8173
|
+
--tw-text-opacity: 1;
|
|
8174
|
+
color: rgb(42 50 65 / var(--tw-text-opacity));
|
|
8175
|
+
}
|
|
8176
|
+
|
|
8195
8177
|
:is(.s-dark .dark\:s-text-primary-300) {
|
|
8196
8178
|
--tw-text-opacity: 1;
|
|
8197
8179
|
color: rgb(178 182 189 / var(--tw-text-opacity));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dust-tt/sparkle",
|
|
3
|
-
"version": "0.2.641-rc-
|
|
3
|
+
"version": "0.2.641-rc-2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "rm -rf dist && npm run tailwind && npm run build:esm && npm run build:cjs",
|
|
6
6
|
"tailwind": "tailwindcss -i ./src/styles/tailwind.css -o dist/sparkle.css",
|
|
@@ -118,6 +118,7 @@
|
|
|
118
118
|
"class-variance-authority": "^0.7.1",
|
|
119
119
|
"clsx": "^2.1.1",
|
|
120
120
|
"emoji-mart": "^5.5.2",
|
|
121
|
+
"framer-motion": "^12.23.22",
|
|
121
122
|
"lottie-react": "^2.4.0",
|
|
122
123
|
"lottie-web": "^5.12.2",
|
|
123
124
|
"mermaid": "^11.4.1",
|
|
@@ -1,19 +1,34 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
2
|
import React, { ReactNode } from "react";
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
Button,
|
|
6
|
+
Card,
|
|
7
|
+
CardProps,
|
|
8
|
+
Spinner,
|
|
9
|
+
Tooltip,
|
|
10
|
+
} from "@sparkle/components/";
|
|
6
11
|
import { XMarkIcon } from "@sparkle/icons/app";
|
|
7
12
|
import { cn } from "@sparkle/lib/utils";
|
|
8
13
|
|
|
9
14
|
type CitationProps = CardProps & {
|
|
10
15
|
children: React.ReactNode;
|
|
11
16
|
isLoading?: boolean;
|
|
12
|
-
tooltip?:
|
|
17
|
+
tooltip?: string;
|
|
13
18
|
};
|
|
14
19
|
|
|
15
20
|
const Citation = React.forwardRef<HTMLDivElement, CitationProps>(
|
|
16
|
-
(
|
|
21
|
+
(
|
|
22
|
+
{
|
|
23
|
+
children,
|
|
24
|
+
variant = "secondary",
|
|
25
|
+
isLoading,
|
|
26
|
+
className,
|
|
27
|
+
tooltip,
|
|
28
|
+
...props
|
|
29
|
+
},
|
|
30
|
+
ref
|
|
31
|
+
) => {
|
|
17
32
|
const hasDescription = React.useMemo(() => {
|
|
18
33
|
const childrenArray = React.Children.toArray(children);
|
|
19
34
|
return childrenArray.some(
|
|
@@ -32,73 +47,30 @@ const Citation = React.forwardRef<HTMLDivElement, CitationProps>(
|
|
|
32
47
|
{!hasDescription && <CitationDescription> </CitationDescription>}
|
|
33
48
|
</>
|
|
34
49
|
);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
// Extract link-related props if present (from CardProps union)
|
|
39
|
-
const action = (props as unknown as { action?: React.ReactNode }).action;
|
|
40
|
-
const { href, target, rel, replace, shallow, onClick, ...rest } =
|
|
41
|
-
props as unknown as LinkWrapperProps &
|
|
42
|
-
React.ButtonHTMLAttributes<HTMLDivElement>;
|
|
43
|
-
|
|
44
|
-
// Filter out CitationDescription & CitationImage from inline content
|
|
45
|
-
const inlineChildren = React.Children.toArray(
|
|
46
|
-
contentWithDescription
|
|
47
|
-
).filter(
|
|
48
|
-
(child) =>
|
|
49
|
-
!(
|
|
50
|
-
React.isValidElement(child) &&
|
|
51
|
-
(child.type === CitationDescription || child.type === CitationImage)
|
|
52
|
-
)
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
const chipContent = (
|
|
56
|
-
<div
|
|
50
|
+
const cardButton = (
|
|
51
|
+
<Card
|
|
57
52
|
ref={ref}
|
|
53
|
+
variant={variant}
|
|
54
|
+
size="sm"
|
|
58
55
|
className={cn(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"
|
|
63
|
-
"s-max-w-64 s-w-full s-truncate s-text-sm s-font-semibold",
|
|
56
|
+
"s-min-w-24 s-relative s-flex s-flex-none s-flex-col s-overflow-hidden",
|
|
57
|
+
// Use min() to maintain aspect ratio in grid mode (8% of width) while capping
|
|
58
|
+
// padding at 3 (0.75rem) for list mode to prevent excessive top padding on wide items.
|
|
59
|
+
"s-pt-[min(8%,theme(spacing.3))]",
|
|
64
60
|
className
|
|
65
61
|
)}
|
|
66
|
-
|
|
67
|
-
onClick={onClick as any}
|
|
68
|
-
role={onClick ? "button" : undefined}
|
|
69
|
-
tabIndex={onClick ? 0 : undefined}
|
|
70
|
-
{...(rest as any)}
|
|
71
|
-
>
|
|
72
|
-
{/* icons + title only */}
|
|
73
|
-
{inlineChildren}
|
|
74
|
-
{action && <div className="s-ml-1 s-flex s-items-center">{action}</div>}
|
|
75
|
-
{isLoading && (
|
|
76
|
-
<span className="s-ml-1 s-inline-flex">
|
|
77
|
-
<Spinner variant="dark" size="xs" />
|
|
78
|
-
</span>
|
|
79
|
-
)}
|
|
80
|
-
</div>
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
const chip = href ? (
|
|
84
|
-
<LinkWrapper
|
|
85
|
-
href={href}
|
|
86
|
-
target={target}
|
|
87
|
-
rel={rel}
|
|
88
|
-
replace={replace}
|
|
89
|
-
shallow={shallow}
|
|
62
|
+
{...props}
|
|
90
63
|
>
|
|
91
|
-
{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
chipContent
|
|
64
|
+
{contentWithDescription}
|
|
65
|
+
{isLoading && <CitationLoading />}
|
|
66
|
+
</Card>
|
|
95
67
|
);
|
|
96
68
|
|
|
97
69
|
if (tooltip) {
|
|
98
|
-
return <Tooltip trigger={
|
|
70
|
+
return <Tooltip trigger={cardButton} label={tooltip} />;
|
|
99
71
|
}
|
|
100
72
|
|
|
101
|
-
return
|
|
73
|
+
return cardButton;
|
|
102
74
|
}
|
|
103
75
|
);
|
|
104
76
|
|
|
@@ -114,6 +86,8 @@ const CitationIndex = React.forwardRef<
|
|
|
114
86
|
className={cn(
|
|
115
87
|
"s-z-10",
|
|
116
88
|
"s-flex s-h-4 s-w-4 s-items-center s-justify-center s-rounded-full s-text-xs s-font-semibold",
|
|
89
|
+
"s-text-primary-200 dark:s-text-primary-200-night",
|
|
90
|
+
"s-bg-primary-600 dark:s-bg-primary-600-night",
|
|
117
91
|
className
|
|
118
92
|
)}
|
|
119
93
|
{...props}
|
|
@@ -148,7 +122,7 @@ const CitationGrid = React.forwardRef<HTMLDivElement, CitationGridProps>(
|
|
|
148
122
|
return (
|
|
149
123
|
<div
|
|
150
124
|
ref={ref}
|
|
151
|
-
className={cn("s-min-w-60 s
|
|
125
|
+
className={cn("s-min-w-60 s-@container", className)}
|
|
152
126
|
{...props}
|
|
153
127
|
>
|
|
154
128
|
<div className={citationGridVariants({ variant })}>{children}</div>
|
|
@@ -232,13 +206,7 @@ const CitationIcons = React.forwardRef<
|
|
|
232
206
|
return (
|
|
233
207
|
<div
|
|
234
208
|
ref={ref}
|
|
235
|
-
className={cn(
|
|
236
|
-
"s-flex s-flex-row s-items-center s-justify-center",
|
|
237
|
-
"s-gap-1 s-rounded-lg s-p-1 s-text-xs s-font-medium",
|
|
238
|
-
"s-bg-muted-background dark:s-bg-muted-background-night",
|
|
239
|
-
"s-text-muted-foreground dark:s-text-muted-foreground-night",
|
|
240
|
-
className
|
|
241
|
-
)}
|
|
209
|
+
className={cn("s-flex s-items-center s-gap-2 s-pb-1", className)}
|
|
242
210
|
{...props}
|
|
243
211
|
>
|
|
244
212
|
{children}
|