@dust-tt/sparkle 0.5.11 → 0.5.13

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 (92) hide show
  1. package/dist/cjs/index.js +11 -14
  2. package/dist/cjs/index.js.map +4 -4
  3. package/dist/esm/components/AnimatedText.d.ts +1 -1
  4. package/dist/esm/components/AnimatedText.d.ts.map +1 -1
  5. package/dist/esm/components/AnimatedText.js +3 -0
  6. package/dist/esm/components/AnimatedText.js.map +1 -1
  7. package/dist/esm/components/Avatar.d.ts +2 -3
  8. package/dist/esm/components/Avatar.d.ts.map +1 -1
  9. package/dist/esm/components/Avatar.js +11 -3
  10. package/dist/esm/components/Avatar.js.map +1 -1
  11. package/dist/esm/components/Card.d.ts +1 -1
  12. package/dist/esm/components/Card.d.ts.map +1 -1
  13. package/dist/esm/components/Card.js +2 -1
  14. package/dist/esm/components/Card.js.map +1 -1
  15. package/dist/esm/components/Chip.d.ts +1 -1
  16. package/dist/esm/components/Chip.d.ts.map +1 -1
  17. package/dist/esm/components/Chip.js +8 -3
  18. package/dist/esm/components/Chip.js.map +1 -1
  19. package/dist/esm/components/Citation.js +1 -1
  20. package/dist/esm/components/Collapsible.d.ts.map +1 -1
  21. package/dist/esm/components/Collapsible.js +3 -4
  22. package/dist/esm/components/Collapsible.js.map +1 -1
  23. package/dist/esm/components/DataTable.d.ts.map +1 -1
  24. package/dist/esm/components/DataTable.js +2 -2
  25. package/dist/esm/components/DataTable.js.map +1 -1
  26. package/dist/esm/components/NavigationList.d.ts +2 -8
  27. package/dist/esm/components/NavigationList.d.ts.map +1 -1
  28. package/dist/esm/components/NavigationList.js +33 -31
  29. package/dist/esm/components/NavigationList.js.map +1 -1
  30. package/dist/esm/icons/app/Inbox.d.ts +5 -0
  31. package/dist/esm/icons/app/Inbox.d.ts.map +1 -0
  32. package/dist/esm/icons/app/Inbox.js +7 -0
  33. package/dist/esm/icons/app/Inbox.js.map +1 -0
  34. package/dist/esm/icons/app/SpaceClosed.d.ts +5 -0
  35. package/dist/esm/icons/app/SpaceClosed.d.ts.map +1 -0
  36. package/dist/esm/icons/app/SpaceClosed.js +5 -0
  37. package/dist/esm/icons/app/SpaceClosed.js.map +1 -0
  38. package/dist/esm/icons/app/SpaceOpen.d.ts +5 -0
  39. package/dist/esm/icons/app/SpaceOpen.d.ts.map +1 -0
  40. package/dist/esm/icons/app/SpaceOpen.js +5 -0
  41. package/dist/esm/icons/app/SpaceOpen.js.map +1 -0
  42. package/dist/esm/icons/app/Spaces.d.ts +5 -0
  43. package/dist/esm/icons/app/Spaces.d.ts.map +1 -0
  44. package/dist/esm/icons/app/Spaces.js +5 -0
  45. package/dist/esm/icons/app/Spaces.js.map +1 -0
  46. package/dist/esm/icons/app/index.d.ts +4 -0
  47. package/dist/esm/icons/app/index.d.ts.map +1 -1
  48. package/dist/esm/icons/app/index.js +4 -0
  49. package/dist/esm/icons/app/index.js.map +1 -1
  50. package/dist/esm/icons/src/app/inbox.svg +5 -0
  51. package/dist/esm/icons/src/app/space-closed.svg +3 -0
  52. package/dist/esm/icons/src/app/space-open.svg +3 -0
  53. package/dist/esm/icons/src/app/spaces.svg +3 -0
  54. package/dist/esm/lottie/collapseBar.d.ts +21 -21
  55. package/dist/esm/lottie/dragArea.d.ts +37 -37
  56. package/dist/esm/lottie/spinnerColor.d.ts +64 -64
  57. package/dist/esm/lottie/spinnerDark.d.ts +64 -64
  58. package/dist/esm/lottie/spinnerDarkLG.d.ts +134 -134
  59. package/dist/esm/lottie/spinnerLightLG.d.ts +134 -134
  60. package/dist/esm/lottie/spinnerLightXS.d.ts +38 -38
  61. package/dist/esm/stories/Avatar.stories.d.ts +1 -1
  62. package/dist/esm/stories/Avatar.stories.d.ts.map +1 -1
  63. package/dist/esm/stories/Avatar.stories.js +10 -4
  64. package/dist/esm/stories/Avatar.stories.js.map +1 -1
  65. package/dist/esm/stories/Card.stories.d.ts +1 -1
  66. package/dist/esm/stories/Chip.stories.d.ts +1 -1
  67. package/dist/esm/stories/NavigationList.stories.d.ts.map +1 -1
  68. package/dist/esm/stories/NavigationList.stories.js +61 -31
  69. package/dist/esm/stories/NavigationList.stories.js.map +1 -1
  70. package/dist/sparkle.css +1578 -1601
  71. package/package.json +8 -8
  72. package/src/components/AnimatedText.tsx +6 -0
  73. package/src/components/Avatar.tsx +10 -9
  74. package/src/components/Card.tsx +2 -1
  75. package/src/components/Chip.tsx +45 -11
  76. package/src/components/Citation.tsx +1 -1
  77. package/src/components/Collapsible.tsx +17 -13
  78. package/src/components/DataTable.tsx +1 -2
  79. package/src/components/NavigationList.tsx +83 -128
  80. package/src/icons/app/Inbox.tsx +17 -0
  81. package/src/icons/app/SpaceClosed.tsx +18 -0
  82. package/src/icons/app/SpaceOpen.tsx +20 -0
  83. package/src/icons/app/Spaces.tsx +20 -0
  84. package/src/icons/app/index.ts +4 -0
  85. package/src/icons/src/app/inbox.svg +5 -0
  86. package/src/icons/src/app/space-closed.svg +3 -0
  87. package/src/icons/src/app/space-open.svg +3 -0
  88. package/src/icons/src/app/spaces.svg +3 -0
  89. package/src/stories/Avatar.stories.tsx +6 -4
  90. package/src/stories/NavigationList.stories.tsx +111 -62
  91. package/dist/esm/icons/src/app/brain copie.svg +0 -3
  92. package/src/icons/src/app/brain copie.svg +0 -3
@@ -0,0 +1,20 @@
1
+ import type { SVGProps } from "react";
2
+ import * as React from "react";
3
+ const SvgSpaces = (props: SVGProps<SVGSVGElement>) => (
4
+ <svg
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ width="1em"
7
+ height="1em"
8
+ fill="none"
9
+ viewBox="0 0 24 24"
10
+ {...props}
11
+ >
12
+ <path
13
+ fill="currentColor"
14
+ fillRule="evenodd"
15
+ d="M17 5.75V11l5 2.75v5.5L17 22l-5-2.75L7 22l-5-2.75v-5.5L7 11V5.75L12 3l5 2.75ZM4.073 14.89 7 16.5l2.926-1.61L7 13.282l-2.927 1.61Zm10 0L17 16.5l2.926-1.61L17 13.282l-2.927 1.61Zm-5-8L12 8.5l2.926-1.61L12 5.282l-2.927 1.61Z"
16
+ clipRule="evenodd"
17
+ />
18
+ </svg>
19
+ );
20
+ export default SvgSpaces;
@@ -88,6 +88,7 @@ export { default as HexagonIcon } from "./Hexagon";
88
88
  export { default as HistoryIcon } from "./History";
89
89
  export { default as HomeIcon } from "./Home";
90
90
  export { default as ImageIcon } from "./Image";
91
+ export { default as InboxIcon } from "./Inbox";
91
92
  export { default as InformationCircleIcon } from "./InformationCircle";
92
93
  export { default as ItalicIcon } from "./Italic";
93
94
  export { default as LightbulbIcon } from "./Lightbulb";
@@ -129,6 +130,9 @@ export { default as SidebarLeftCloseIcon } from "./SidebarLeftClose";
129
130
  export { default as SidebarLeftOpenIcon } from "./SidebarLeftOpen";
130
131
  export { default as SidebarRightCloseIcon } from "./SidebarRightClose";
131
132
  export { default as SidebarRightOpenIcon } from "./SidebarRightOpen";
133
+ export { default as SpaceClosedIcon } from "./SpaceClosed";
134
+ export { default as SpaceOpenIcon } from "./SpaceOpen";
135
+ export { default as SpacesIcon } from "./Spaces";
132
136
  export { default as SparklesIcon } from "./Sparkles";
133
137
  export { default as SquareIcon } from "./Square";
134
138
  export { default as Square3Stack3DIcon } from "./Square3Stack3D";
@@ -0,0 +1,5 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M22 17.5L12 23L2 17.5V15L12 20.5L22 15V17.5Z" fill="#111418"/>
3
+ <path d="M22 13L12 18.5L2 13V10.5L12 16L22 10.5V13Z" fill="#111418"/>
4
+ <path d="M22 6.5V8.5L12 14L2 8.5V6.5L12 1L22 6.5Z" fill="#111418"/>
5
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M22 17.5L12 23L2 17.5V8.5L12 14L22 8.5V17.5ZM22 6.5L12 12L2 6.5L12 1L22 6.5Z" fill="#111418"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M22 6.5V17.5L12 23L2 17.5V6.5L12 1L22 6.5ZM4.07324 7.64062L12 12L19.9258 7.64062L12 3.28125L4.07324 7.64062Z" fill="#111418"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M17 5.75V11L22 13.75V19.25L17 22L12 19.25L7 22L2 19.25V13.75L7 11V5.75L12 3L17 5.75ZM4.07324 14.8906L7 16.5L9.92578 14.8906L7 13.2812L4.07324 14.8906ZM14.0732 14.8906L17 16.5L19.9258 14.8906L17 13.2812L14.0732 14.8906ZM9.07324 6.89062L12 8.5L14.9258 6.89062L12 5.28125L9.07324 6.89062Z" fill="#111418"/>
3
+ </svg>
@@ -257,7 +257,6 @@ export const AvatarStackExample: Story = {
257
257
  <Avatar.Stack
258
258
  size="xs"
259
259
  nbVisibleItems={3}
260
- isRounded
261
260
  avatars={[
262
261
  {
263
262
  name: "Isabelle Doe",
@@ -321,7 +320,6 @@ export const AvatarStackExample: Story = {
321
320
  <Avatar.Stack
322
321
  size="sm"
323
322
  nbVisibleItems={4}
324
- isRounded
325
323
  avatars={[
326
324
  {
327
325
  name: "Isabelle Doe",
@@ -433,16 +431,17 @@ export const AvatarStackExample: Story = {
433
431
  <Avatar.Stack
434
432
  size="xs"
435
433
  nbVisibleItems={3}
436
- isRounded
437
434
  orientation="vertical"
438
435
  avatars={[
439
436
  {
440
437
  name: "Isabelle Doe",
441
438
  visual: "https://dust.tt/static/droidavatar/Droid_Lime_3.jpg",
439
+ isRounded: true,
442
440
  },
443
441
  {
444
442
  name: "Rafael Doe",
445
443
  visual: "https://dust.tt/static/droidavatar/Droid_Yellow_3.jpg",
444
+ isRounded: true,
446
445
  },
447
446
  {
448
447
  name: "Aria Doe",
@@ -458,7 +457,6 @@ export const AvatarStackExample: Story = {
458
457
  <Avatar.Stack
459
458
  size="sm"
460
459
  nbVisibleItems={4}
461
- isRounded
462
460
  orientation="vertical"
463
461
  avatars={[
464
462
  {
@@ -468,6 +466,7 @@ export const AvatarStackExample: Story = {
468
466
  {
469
467
  name: "Rafael Doe",
470
468
  visual: "https://dust.tt/static/droidavatar/Droid_Yellow_3.jpg",
469
+ isRounded: true,
471
470
  },
472
471
  {
473
472
  name: "Aria Doe",
@@ -476,6 +475,7 @@ export const AvatarStackExample: Story = {
476
475
  {
477
476
  name: "Omar Doe",
478
477
  visual: "https://dust.tt/static/droidavatar/Droid_Pink_3.jpg",
478
+ isRounded: true,
479
479
  },
480
480
  ]}
481
481
  />
@@ -488,6 +488,7 @@ export const AvatarStackExample: Story = {
488
488
  {
489
489
  name: "Isabelle Doe",
490
490
  visual: "https://dust.tt/static/droidavatar/Droid_Lime_3.jpg",
491
+ isRounded: true,
491
492
  },
492
493
  {
493
494
  name: "Rafael Doe",
@@ -500,6 +501,7 @@ export const AvatarStackExample: Story = {
500
501
  {
501
502
  name: "Omar Doe",
502
503
  visual: "https://dust.tt/static/droidavatar/Droid_Pink_3.jpg",
504
+ isRounded: true,
503
505
  },
504
506
  ]}
505
507
  />
@@ -1,7 +1,10 @@
1
1
  import type { Meta } from "@storybook/react";
2
2
  import React, { useEffect, useState } from "react";
3
3
 
4
+ import { ActionInboxIcon } from "@sparkle/icons/actions";
4
5
  import {
6
+ Avatar,
7
+ Button,
5
8
  DropdownMenu,
6
9
  DropdownMenuContent,
7
10
  DropdownMenuItem,
@@ -11,10 +14,14 @@ import {
11
14
  NavigationListItemAction,
12
15
  NavigationListCollapsibleSection,
13
16
  NavigationListLabel,
14
- NavigationListLabelButton,
15
17
  PencilSquareIcon,
16
18
  TrashIcon,
17
19
  MoreIcon,
20
+ InboxIcon,
21
+ CollapsibleContent,
22
+ Collapsible,
23
+ CollapsibleTrigger,
24
+ PlusIcon,
18
25
  } from "../index_with_tw_base";
19
26
 
20
27
  const meta = {
@@ -50,7 +57,7 @@ export const Demo = () => {
50
57
  </DropdownMenuTrigger>
51
58
  <DropdownMenuContent>
52
59
  <DropdownMenuItem
53
- label={`Rename ${title}`}
60
+ label="Rename"
54
61
  icon={PencilSquareIcon}
55
62
  onClick={(e) => {
56
63
  e.preventDefault();
@@ -181,7 +188,7 @@ export const CollapsibleSection = () => {
181
188
  </DropdownMenuTrigger>
182
189
  <DropdownMenuContent>
183
190
  <DropdownMenuItem
184
- label={`Rename ${title}`}
191
+ label="Rename"
185
192
  icon={PencilSquareIcon}
186
193
  onClick={(e) => {
187
194
  e.preventDefault();
@@ -202,69 +209,111 @@ export const CollapsibleSection = () => {
202
209
  );
203
210
 
204
211
  return (
205
- <div className="s-flex s-h-[500px] s-w-full s-flex-row s-gap-12 s-bg-muted">
206
- <div className="s-h-[500px] s-w-[240px]">
207
- <NavigationList className="s-relative s-h-full s-w-full s-px-3 dark:s-bg-muted-background-night">
208
- {conversationTitles.map((section, sectionIndex) => (
212
+ <div className="s-dark:bg-muted-background-night s-flex s-h-[800px] s-w-[240px] s-flex-row s-border-r s-border-border s-bg-muted-background">
213
+ <NavigationList className="s-relative s-h-full s-w-full s-px-2 s-py-2 dark:s-bg-muted-background-night">
214
+ <NavigationListItem
215
+ icon={InboxIcon}
216
+ label="Inbox"
217
+ href="#"
218
+ onClick={(e) => {
219
+ e.preventDefault();
220
+ }}
221
+ />
222
+ <NavigationListLabel label="Hello" />
223
+ <NavigationListCollapsibleSection
224
+ label="Agents"
225
+ defaultOpen={true}
226
+ action={
209
227
  <>
210
- <NavigationListLabel label="Hello" key={0} />
211
- <NavigationListCollapsibleSection
212
- key={sectionIndex}
213
- label={section.label}
214
- defaultOpen={sectionIndex === 0}
215
- >
216
- {section.items.map((title, index) => {
217
- const itemIndex = allItems.indexOf(title);
218
- const getStatus = (idx: number) => {
219
- if (idx % 5 === 0) {
220
- return "unread";
221
- }
222
- if (idx % 3 === 0) {
223
- return "blocked";
224
- }
225
- return "idle";
226
- };
227
- return (
228
- <NavigationListItem
229
- key={index}
230
- href={index % 2 === 0 ? "#" : undefined}
231
- selected={itemIndex === selectedIndex}
232
- onClick={(e) => {
233
- if (!e.defaultPrevented) {
234
- e.preventDefault();
235
- setSelectedIndex(itemIndex);
236
- }
237
- }}
238
- label={title}
239
- className="s-w-full"
240
- moreMenu={getMoreMenu(title)}
241
- status={getStatus(index)}
242
- />
243
- );
244
- })}
245
- </NavigationListCollapsibleSection>
228
+ <Button
229
+ size="xmini"
230
+ icon={PlusIcon}
231
+ variant="ghost"
232
+ aria-label="Add new item"
233
+ onClick={(e) => {
234
+ e.preventDefault();
235
+ e.stopPropagation();
236
+ // Add action logic here
237
+ }}
238
+ />
239
+ <Button
240
+ size="xmini"
241
+ icon={MoreIcon}
242
+ variant="ghost"
243
+ aria-label="Add new item"
244
+ onClick={(e) => {
245
+ e.preventDefault();
246
+ e.stopPropagation();
247
+ // Add action logic here
248
+ }}
249
+ />
246
250
  </>
251
+ }
252
+ >
253
+ {[
254
+ {
255
+ handle: "alex",
256
+ name: "Alex",
257
+ emoji: "🤖",
258
+ color: "s-bg-blue-300",
259
+ },
260
+ {
261
+ handle: "sam",
262
+ name: "Sam",
263
+ emoji: "🎨",
264
+ color: "s-bg-violet-300",
265
+ },
266
+ {
267
+ handle: "taylor",
268
+ name: "Taylor",
269
+ emoji: "🚀",
270
+ color: "s-bg-pink-300",
271
+ },
272
+ {
273
+ handle: "jordan",
274
+ name: "Jordan",
275
+ emoji: "⚡",
276
+ color: "s-bg-orange-300",
277
+ },
278
+ {
279
+ handle: "riley",
280
+ name: "Riley",
281
+ emoji: "🌟",
282
+ color: "s-bg-golden-300",
283
+ },
284
+ {
285
+ handle: "casey",
286
+ name: "Casey",
287
+ emoji: "💡",
288
+ color: "s-bg-emerald-300",
289
+ },
290
+ ].map((agent, index) => (
291
+ <NavigationListItem
292
+ key={agent.handle}
293
+ href="#"
294
+ selected={false}
295
+ onClick={(e) => {
296
+ e.preventDefault();
297
+ }}
298
+ label={agent.name}
299
+ avatar={
300
+ <Avatar
301
+ size="xxs"
302
+ name={agent.handle}
303
+ emoji={agent.emoji}
304
+ backgroundColor={agent.color}
305
+ />
306
+ }
307
+ className="s-w-full"
308
+ />
247
309
  ))}
248
- </NavigationList>
249
- </div>
250
- <div className="s-h-[500px] s-w-[240px]">
251
- <NavigationList className="s-relative s-h-full s-w-full s-px-3 dark:s-bg-muted-background-night">
252
- {conversationTitles.map((section, sectionIndex) => (
310
+ </NavigationListCollapsibleSection>
311
+ {conversationTitles.map((section, sectionIndex) => (
312
+ <>
253
313
  <NavigationListCollapsibleSection
254
314
  key={sectionIndex}
255
315
  label={section.label}
256
316
  defaultOpen={sectionIndex === 0}
257
- action={
258
- <NavigationListLabelButton
259
- icon={MoreIcon}
260
- aria-label="Add new item"
261
- onClick={(e) => {
262
- e.preventDefault();
263
- e.stopPropagation();
264
- // Add action logic here
265
- }}
266
- />
267
- }
268
317
  >
269
318
  {section.items.map((title, index) => {
270
319
  const itemIndex = allItems.indexOf(title);
@@ -296,9 +345,9 @@ export const CollapsibleSection = () => {
296
345
  );
297
346
  })}
298
347
  </NavigationListCollapsibleSection>
299
- ))}
300
- </NavigationList>
301
- </div>
348
+ </>
349
+ ))}
350
+ </NavigationList>
302
351
  </div>
303
352
  );
304
353
  };
@@ -1,3 +0,0 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M8.5 2C6.567 2 5 3.567 5 5.5C5 5.68016 5.01364 5.85714 5.03993 6.02997C3.32436 6.25523 2 7.72295 2 9.5C2 10.4793 2.40223 11.3647 3.05051 12C2.40223 12.6353 2 13.5207 2 14.5C2 15.9018 2.82359 17.1104 4.01353 17.6693C4.00457 17.7785 4 17.8888 4 18C4 20.2091 5.79086 22 8 22C9.19469 22 10.2671 21.4762 11 20.6458V3.05051C10.3647 2.40223 9.47934 2 8.5 2ZM13 3.05051V20.6458C13.7329 21.4762 14.8053 22 16 22C18.2091 22 20 20.2091 20 18C20 17.8888 19.9954 17.7785 19.9865 17.6693C21.1764 17.1104 22 15.9018 22 14.5C22 13.5207 21.5978 12.6353 20.9495 12C21.5978 11.3647 22 10.4793 22 9.5C22 7.72295 20.6756 6.25523 18.9601 6.02997C18.9864 5.85714 19 5.68016 19 5.5C19 3.567 17.433 2 15.5 2C14.5207 2 13.6353 2.40223 13 3.05051Z" fill="#111418"/>
3
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M8.5 2C6.567 2 5 3.567 5 5.5C5 5.68016 5.01364 5.85714 5.03993 6.02997C3.32436 6.25523 2 7.72295 2 9.5C2 10.4793 2.40223 11.3647 3.05051 12C2.40223 12.6353 2 13.5207 2 14.5C2 15.9018 2.82359 17.1104 4.01353 17.6693C4.00457 17.7785 4 17.8888 4 18C4 20.2091 5.79086 22 8 22C9.19469 22 10.2671 21.4762 11 20.6458V3.05051C10.3647 2.40223 9.47934 2 8.5 2ZM13 3.05051V20.6458C13.7329 21.4762 14.8053 22 16 22C18.2091 22 20 20.2091 20 18C20 17.8888 19.9954 17.7785 19.9865 17.6693C21.1764 17.1104 22 15.9018 22 14.5C22 13.5207 21.5978 12.6353 20.9495 12C21.5978 11.3647 22 10.4793 22 9.5C22 7.72295 20.6756 6.25523 18.9601 6.02997C18.9864 5.85714 19 5.68016 19 5.5C19 3.567 17.433 2 15.5 2C14.5207 2 13.6353 2.40223 13 3.05051Z" fill="#111418"/>
3
- </svg>