@dust-tt/sparkle 0.2.457 → 0.2.459
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/AnimatedText.d.ts +1 -1
- package/dist/esm/components/AnimatedText.d.ts.map +1 -1
- package/dist/esm/components/AnimatedText.js +0 -27
- package/dist/esm/components/AnimatedText.js.map +1 -1
- package/dist/esm/components/Chip.d.ts +1 -1
- package/dist/esm/components/Chip.d.ts.map +1 -1
- package/dist/esm/components/Chip.js +2 -28
- package/dist/esm/components/Chip.js.map +1 -1
- package/dist/esm/components/ContentMessage.d.ts +1 -1
- package/dist/esm/components/ContentMessage.d.ts.map +1 -1
- package/dist/esm/components/ContentMessage.js +1 -46
- package/dist/esm/components/ContentMessage.js.map +1 -1
- package/dist/esm/components/DataTable.d.ts.map +1 -1
- package/dist/esm/components/DataTable.js +14 -17
- package/dist/esm/components/DataTable.js.map +1 -1
- package/dist/esm/components/Popup.d.ts.map +1 -1
- package/dist/esm/components/Popup.js +2 -3
- package/dist/esm/components/Popup.js.map +1 -1
- package/dist/esm/stories/Chip.stories.d.ts +3 -3
- package/dist/esm/stories/Chip.stories.d.ts.map +1 -1
- package/dist/esm/stories/Chip.stories.js +3 -3
- package/dist/esm/stories/Chip.stories.js.map +1 -1
- package/dist/esm/stories/ContentMessage.stories.js +1 -1
- package/dist/esm/stories/ContentMessage.stories.js.map +1 -1
- package/dist/esm/stories/ContextItem.stories.js +2 -2
- package/dist/esm/stories/ContextItem.stories.js.map +1 -1
- package/dist/esm/stories/SearchInput.stories.js +1 -1
- package/dist/esm/stories/SearchInput.stories.js.map +1 -1
- package/dist/esm/stories/Tree.stories.js +4 -4
- package/dist/esm/stories/Tree.stories.js.map +1 -1
- package/dist/sparkle.css +0 -240
- package/package.json +1 -1
- package/src/components/AnimatedText.tsx +0 -51
- package/src/components/Chip.tsx +2 -52
- package/src/components/ContentMessage.tsx +1 -51
- package/src/components/DataTable.tsx +15 -6
- package/src/components/Popup.tsx +3 -4
- package/src/stories/Chip.stories.tsx +2 -8
- package/src/stories/ContentMessage.stories.tsx +1 -1
- package/src/stories/ContextItem.stories.tsx +2 -2
- package/src/stories/SearchInput.stories.tsx +1 -1
- package/src/stories/Tree.stories.tsx +4 -4
|
@@ -5,15 +5,6 @@ import { Icon } from "@sparkle/components/Icon";
|
|
|
5
5
|
import { cn } from "@sparkle/lib/utils";
|
|
6
6
|
|
|
7
7
|
const CONTENT_MESSAGE_VARIANTS = [
|
|
8
|
-
"emerald",
|
|
9
|
-
"amber",
|
|
10
|
-
"slate",
|
|
11
|
-
"purple",
|
|
12
|
-
"sky",
|
|
13
|
-
"pink",
|
|
14
|
-
"action",
|
|
15
|
-
"red",
|
|
16
|
-
//New variants
|
|
17
8
|
"primary",
|
|
18
9
|
"warning",
|
|
19
10
|
"success",
|
|
@@ -36,20 +27,6 @@ const contentMessageVariants = cva(
|
|
|
36
27
|
{
|
|
37
28
|
variants: {
|
|
38
29
|
variant: {
|
|
39
|
-
emerald:
|
|
40
|
-
"s-bg-green-100 dark:s-bg-green-100-night s-border-transparent",
|
|
41
|
-
amber:
|
|
42
|
-
"s-bg-golden-100 dark:s-bg-golden-100-night s-border-transparent",
|
|
43
|
-
slate:
|
|
44
|
-
"s-bg-muted-background dark:s-bg-muted-background-night s-border s-border-border dark:s-border-border-night",
|
|
45
|
-
purple:
|
|
46
|
-
"s-bg-purple-100 dark:s-bg-purple-100-night s-border-transparent",
|
|
47
|
-
sky: "s-bg-sky-100 dark:s-bg-sky-100-night s-border-transparent",
|
|
48
|
-
pink: "s-bg-pink-100 dark:s-bg-pink-100-night s-border-transparent",
|
|
49
|
-
action:
|
|
50
|
-
"s-bg-highlight-100 dark:s-bg-highlight-100-night s-border-transparent",
|
|
51
|
-
red: "s-bg-red-100 dark:s-bg-red-100-night s-border-transparent",
|
|
52
|
-
// tbr
|
|
53
30
|
primary:
|
|
54
31
|
"s-bg-muted-background dark:s-bg-muted-background-night s-border-border dark:s-border-border-night",
|
|
55
32
|
success:
|
|
@@ -81,15 +58,6 @@ const contentMessageVariants = cva(
|
|
|
81
58
|
const iconVariants = cva("s-shrink-0", {
|
|
82
59
|
variants: {
|
|
83
60
|
variant: {
|
|
84
|
-
emerald: "s-text-green-800 dark:s-text-green-800-night",
|
|
85
|
-
amber: "s-text-golden-800 dark:s-text-golden-800-night",
|
|
86
|
-
slate: "s-text-primary-800 dark:s-text-primary-800-night",
|
|
87
|
-
purple: "s-text-purple-800 dark:s-text-purple-800-night",
|
|
88
|
-
sky: "s-text-sky-800 dark:s-text-sky-800-night",
|
|
89
|
-
pink: "s-text-pink-800 dark:s-text-pink-800-night",
|
|
90
|
-
action: "s-text-highlight-800 dark:s-text-highlight-800-night",
|
|
91
|
-
red: "s-text-red-800 dark:s-text-red-800-night",
|
|
92
|
-
// tbr
|
|
93
61
|
primary: "s-text-primary-800 dark:s-text-primary-800-night",
|
|
94
62
|
warning: "s-text-warning-800 dark:s-text-warning-800-night",
|
|
95
63
|
success: "s-text-success-800 dark:s-text-success-800-night",
|
|
@@ -106,15 +74,6 @@ const iconVariants = cva("s-shrink-0", {
|
|
|
106
74
|
const titleVariants = cva("s-text-sm s-font-semibold", {
|
|
107
75
|
variants: {
|
|
108
76
|
variant: {
|
|
109
|
-
emerald: "s-text-green-800 dark:s-text-green-800-night",
|
|
110
|
-
amber: "s-text-golden-800 dark:s-text-golden-800-night",
|
|
111
|
-
slate: "s-text-foreground dark:s-text-foreground-night",
|
|
112
|
-
purple: "s-text-purple-800 dark:s-text-purple-800-night",
|
|
113
|
-
sky: "s-text-sky-800 dark:s-text-sky-800-night",
|
|
114
|
-
pink: "s-text-pink-800 dark:s-text-pink-800-night",
|
|
115
|
-
action: "s-text-highlight-800 dark:s-text-highlight-800-night",
|
|
116
|
-
red: "s-text-red-800 dark:s-text-red-800-night",
|
|
117
|
-
// tbr
|
|
118
77
|
primary: "s-text-foreground dark:s-text-foreground-night",
|
|
119
78
|
warning: "s-text-warning-800 dark:s-text-warning-800-night",
|
|
120
79
|
success: "s-text-success-800 dark:s-text-success-800-night",
|
|
@@ -131,15 +90,6 @@ const titleVariants = cva("s-text-sm s-font-semibold", {
|
|
|
131
90
|
const textVariants = cva("s-text-sm", {
|
|
132
91
|
variants: {
|
|
133
92
|
variant: {
|
|
134
|
-
emerald: "s-text-green-950 dark:s-text-green-950-night",
|
|
135
|
-
amber: "s-text-golden-950 dark:s-text-golden-950-night",
|
|
136
|
-
slate: "s-text-muted-foreground dark:s-text-muted-foreground-night",
|
|
137
|
-
purple: "s-text-purple-950 dark:s-text-purple-950-night",
|
|
138
|
-
sky: "s-text-sky-950 dark:s-text-sky-950-night",
|
|
139
|
-
pink: "s-text-pink-950 dark:s-text-pink-950-night",
|
|
140
|
-
action: "s-text-highlight-950 dark:s-text-highlight-950-night",
|
|
141
|
-
red: "s-text-red-950 dark:s-text-red-950-night",
|
|
142
|
-
// tbr
|
|
143
93
|
primary: "s-text-muted-foreground dark:s-text-muted-foreground-night",
|
|
144
94
|
warning: "s-text-warning-950 dark:s-text-warning-950-night",
|
|
145
95
|
success: "s-text-success-950 dark:s-text-success-950-night",
|
|
@@ -164,7 +114,7 @@ export interface ContentMessageProps {
|
|
|
164
114
|
|
|
165
115
|
export function ContentMessage({
|
|
166
116
|
title,
|
|
167
|
-
variant = "
|
|
117
|
+
variant = "info",
|
|
168
118
|
children,
|
|
169
119
|
size = "md",
|
|
170
120
|
className = "",
|
|
@@ -175,14 +175,16 @@ export function DataTable<TData extends TBaseData>({
|
|
|
175
175
|
getFilteredRowModel: getFilteredRowModel(),
|
|
176
176
|
getPaginationRowModel: pagination ? getPaginationRowModel() : undefined,
|
|
177
177
|
onColumnFiltersChange: setColumnFilters,
|
|
178
|
-
|
|
178
|
+
...(enableRowSelection && {
|
|
179
|
+
onRowSelectionChange,
|
|
180
|
+
}),
|
|
179
181
|
state: {
|
|
180
182
|
columnFilters,
|
|
181
183
|
...(isServerSideSorting && {
|
|
182
184
|
sorting,
|
|
183
185
|
}),
|
|
184
186
|
pagination,
|
|
185
|
-
rowSelection,
|
|
187
|
+
...(enableRowSelection && { rowSelection }),
|
|
186
188
|
},
|
|
187
189
|
initialState: {
|
|
188
190
|
sorting,
|
|
@@ -256,7 +258,9 @@ export function DataTable<TData extends TBaseData>({
|
|
|
256
258
|
widthClassName={widthClassName}
|
|
257
259
|
key={row.id}
|
|
258
260
|
onClick={row.original.onClick}
|
|
259
|
-
|
|
261
|
+
{...(enableRowSelection && {
|
|
262
|
+
"data-selected": row.getIsSelected(),
|
|
263
|
+
})}
|
|
260
264
|
>
|
|
261
265
|
{row.getVisibleCells().map((cell) => {
|
|
262
266
|
const breakpoint = columnsBreakpoints[cell.column.id];
|
|
@@ -357,10 +361,13 @@ export function ScrollableDataTable<TData extends TBaseData>({
|
|
|
357
361
|
getCoreRowModel: getCoreRowModel(),
|
|
358
362
|
enableColumnResizing: true,
|
|
359
363
|
onRowSelectionChange,
|
|
360
|
-
enableRowSelection
|
|
364
|
+
...(enableRowSelection && {
|
|
365
|
+
onRowSelectionChange,
|
|
366
|
+
}),
|
|
361
367
|
state: {
|
|
362
|
-
rowSelection,
|
|
368
|
+
...(enableRowSelection && { rowSelection }),
|
|
363
369
|
},
|
|
370
|
+
enableRowSelection,
|
|
364
371
|
});
|
|
365
372
|
|
|
366
373
|
useEffect(() => {
|
|
@@ -505,7 +512,9 @@ export function ScrollableDataTable<TData extends TBaseData>({
|
|
|
505
512
|
widthClassName={widthClassName}
|
|
506
513
|
onClick={row.original.onClick}
|
|
507
514
|
className="s-absolute s-w-full"
|
|
508
|
-
|
|
515
|
+
{...(enableRowSelection && {
|
|
516
|
+
"data-selected": row.getIsSelected(),
|
|
517
|
+
})}
|
|
509
518
|
style={{
|
|
510
519
|
transform: `translateY(${virtualRow.start}px)`,
|
|
511
520
|
}}
|
package/src/components/Popup.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Transition } from "@headlessui/react";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
|
-
import { IconButton } from "@sparkle/components/IconButton";
|
|
5
4
|
import { XMarkIcon } from "@sparkle/icons/solid";
|
|
6
5
|
import { classNames } from "@sparkle/lib/utils";
|
|
7
6
|
|
|
@@ -47,13 +46,13 @@ export function Popup({
|
|
|
47
46
|
)}
|
|
48
47
|
>
|
|
49
48
|
<div className="s-flex">
|
|
50
|
-
<Chip color="
|
|
49
|
+
<Chip color="warning">{chipLabel}</Chip>
|
|
51
50
|
{onClose && (
|
|
52
51
|
<div className="-s-mr-1 -s-mt-1 s-flex s-grow s-items-start s-justify-end">
|
|
53
|
-
<
|
|
52
|
+
<Button
|
|
54
53
|
icon={XMarkIcon}
|
|
55
54
|
onClick={onClose}
|
|
56
|
-
variant="
|
|
55
|
+
variant="ghost"
|
|
57
56
|
size="sm"
|
|
58
57
|
/>
|
|
59
58
|
</div>
|
|
@@ -56,7 +56,7 @@ export const Basic: Story = {
|
|
|
56
56
|
args: {
|
|
57
57
|
label: "Example Chip",
|
|
58
58
|
size: "sm",
|
|
59
|
-
color: "
|
|
59
|
+
color: "primary",
|
|
60
60
|
isBusy: true,
|
|
61
61
|
onRemove: undefined,
|
|
62
62
|
},
|
|
@@ -65,7 +65,6 @@ export const Basic: Story = {
|
|
|
65
65
|
export const ThinkingChip = () => (
|
|
66
66
|
<Chip
|
|
67
67
|
size="sm"
|
|
68
|
-
color="slate"
|
|
69
68
|
label="Thinking, Searching"
|
|
70
69
|
isBusy
|
|
71
70
|
onClick={() => console.log()}
|
|
@@ -73,10 +72,5 @@ export const ThinkingChip = () => (
|
|
|
73
72
|
);
|
|
74
73
|
|
|
75
74
|
export const RemovableChip = () => (
|
|
76
|
-
<Chip
|
|
77
|
-
size="sm"
|
|
78
|
-
color="slate"
|
|
79
|
-
label="Remove me"
|
|
80
|
-
onRemove={() => alert("Removed")}
|
|
81
|
-
/>
|
|
75
|
+
<Chip size="sm" label="Remove me" onRemove={() => alert("Removed")} />
|
|
82
76
|
);
|
|
@@ -47,7 +47,7 @@ export const ListItemExample = () => (
|
|
|
47
47
|
visual={<Icon visual={FolderIcon} size="md" />}
|
|
48
48
|
>
|
|
49
49
|
<div className="s-py-2">
|
|
50
|
-
<Chip size="xs" label="Last Sync ~7 days ago" color="
|
|
50
|
+
<Chip size="xs" label="Last Sync ~7 days ago" color="green" />
|
|
51
51
|
</div>
|
|
52
52
|
<ContextItem.Description description="Lats, pricing, history of contacts, contact message" />
|
|
53
53
|
</ContextItem>
|
|
@@ -99,7 +99,7 @@ export const ListItemExample = () => (
|
|
|
99
99
|
>
|
|
100
100
|
<>
|
|
101
101
|
<div className="s-py-2">
|
|
102
|
-
<Chip label="Syncing…" color="
|
|
102
|
+
<Chip label="Syncing…" color="info" size="sm" isBusy />
|
|
103
103
|
</div>
|
|
104
104
|
<ContextItem.Description description="Teamspaces “General” and “Public”, pages “Engineering”, “Team Life”, “Marketing”, “Brand”, “Getting Started at Dust”, “Brand”, “Design”, “Product Decisions”, “Hiring”, “Man" />
|
|
105
105
|
</>
|
|
@@ -96,7 +96,7 @@ export function SearchInputWithPopoverScrollableExample() {
|
|
|
96
96
|
onSelectAll={() => console.log("select all")}
|
|
97
97
|
contentMessage={{
|
|
98
98
|
title: "You can add a custom message here",
|
|
99
|
-
variant: "
|
|
99
|
+
variant: "green",
|
|
100
100
|
icon: InformationCircleIcon,
|
|
101
101
|
className: "s-w-full",
|
|
102
102
|
size: "lg",
|
|
@@ -739,7 +739,7 @@ export const SelectDataSourceExample = () => {
|
|
|
739
739
|
<span className="s-text-sm s-text-muted-foreground">
|
|
740
740
|
Managed by: Stanislas Polu
|
|
741
741
|
</span>
|
|
742
|
-
<Chip size="sm" color="
|
|
742
|
+
<Chip size="sm" color="green" label="Syncing (235)" />
|
|
743
743
|
<Button
|
|
744
744
|
label="Manage"
|
|
745
745
|
icon={Cog6ToothIcon}
|
|
@@ -759,7 +759,7 @@ export const SelectDataSourceExample = () => {
|
|
|
759
759
|
<span className="s-text-sm s-text-muted-foreground">
|
|
760
760
|
Managed by: Stanislas Polu
|
|
761
761
|
</span>
|
|
762
|
-
<Chip size="sm" color="
|
|
762
|
+
<Chip size="sm" color="green" label="Syncing (235)" />
|
|
763
763
|
<Button
|
|
764
764
|
label="Manage"
|
|
765
765
|
icon={Cog6ToothIcon}
|
|
@@ -778,7 +778,7 @@ export const SelectDataSourceExample = () => {
|
|
|
778
778
|
<span className="s-text-sm s-text-muted-foreground">
|
|
779
779
|
Managed by: Stanislas Polu
|
|
780
780
|
</span>
|
|
781
|
-
<Chip size="sm" color="
|
|
781
|
+
<Chip size="sm" color="green" label="Syncing (235)" />
|
|
782
782
|
<Button
|
|
783
783
|
label="Manage"
|
|
784
784
|
icon={Cog6ToothIcon}
|
|
@@ -806,7 +806,7 @@ export const SelectDataSourceExample = () => {
|
|
|
806
806
|
<span className="s-text-sm s-text-muted-foreground">
|
|
807
807
|
Managed by: Stanislas Polu
|
|
808
808
|
</span>
|
|
809
|
-
<Chip size="sm" color="
|
|
809
|
+
<Chip size="sm" color="green" label="Syncing (235)" />
|
|
810
810
|
<Button
|
|
811
811
|
label="Manage"
|
|
812
812
|
icon={Cog6ToothIcon}
|