@dust-tt/sparkle 0.2.274 → 0.2.276
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 +8245 -8259
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/AssistantPreview.d.ts.map +1 -1
- package/dist/esm/components/AssistantPreview.js +1 -1
- package/dist/esm/components/AssistantPreview.js.map +1 -1
- package/dist/esm/components/Banner.js +1 -1
- package/dist/esm/components/Banner.js.map +1 -1
- package/dist/esm/components/BarHeader.js +5 -5
- package/dist/esm/components/BarHeader.js.map +1 -1
- package/dist/esm/components/Button.d.ts +20 -24
- package/dist/esm/components/Button.d.ts.map +1 -1
- package/dist/esm/components/Button.js +76 -117
- package/dist/esm/components/Button.js.map +1 -1
- package/dist/esm/components/Citation.js +1 -1
- package/dist/esm/components/Citation.js.map +1 -1
- package/dist/esm/components/ConversationMessageActions.d.ts.map +1 -1
- package/dist/esm/components/ConversationMessageActions.js +2 -2
- package/dist/esm/components/ConversationMessageActions.js.map +1 -1
- package/dist/esm/components/DataTable.js +2 -2
- package/dist/esm/components/DataTable.js.map +1 -1
- package/dist/esm/components/Dialog.d.ts +2 -2
- package/dist/esm/components/Dialog.d.ts.map +1 -1
- package/dist/esm/components/Dialog.js +2 -2
- package/dist/esm/components/Dialog.js.map +1 -1
- package/dist/esm/components/FilterChips.d.ts.map +1 -1
- package/dist/esm/components/FilterChips.js +1 -1
- package/dist/esm/components/FilterChips.js.map +1 -1
- package/dist/esm/components/IconButton.d.ts +4 -3
- package/dist/esm/components/IconButton.d.ts.map +1 -1
- package/dist/esm/components/IconButton.js +41 -65
- package/dist/esm/components/IconButton.js.map +1 -1
- package/dist/esm/components/Input.d.ts.map +1 -1
- package/dist/esm/components/Input.js +20 -7
- package/dist/esm/components/Input.js.map +1 -1
- package/dist/esm/components/Label.js +1 -1
- package/dist/esm/components/Label.js.map +1 -1
- package/dist/esm/components/Markdown.d.ts.map +1 -1
- package/dist/esm/components/Markdown.js +2 -2
- package/dist/esm/components/Markdown.js.map +1 -1
- package/dist/esm/components/NavigationList.d.ts +18 -0
- package/dist/esm/components/NavigationList.d.ts.map +1 -0
- package/dist/esm/components/NavigationList.js +70 -0
- package/dist/esm/components/NavigationList.js.map +1 -0
- package/dist/esm/components/NewDropdown.js +2 -2
- package/dist/esm/components/NewDropdown.js.map +1 -1
- package/dist/esm/components/Notification.js +1 -1
- package/dist/esm/components/Notification.js.map +1 -1
- package/dist/esm/components/Pagination.d.ts.map +1 -1
- package/dist/esm/components/Pagination.js +2 -2
- package/dist/esm/components/Pagination.js.map +1 -1
- package/dist/esm/components/Popover.js +1 -1
- package/dist/esm/components/Popup.js +1 -1
- package/dist/esm/components/Popup.js.map +1 -1
- package/dist/esm/components/RadioGroup.d.ts.map +1 -1
- package/dist/esm/components/RadioGroup.js +4 -4
- package/dist/esm/components/RadioGroup.js.map +1 -1
- package/dist/esm/components/Searchbar.js +1 -1
- package/dist/esm/components/Searchbar.js.map +1 -1
- package/dist/esm/components/Spinner.d.ts +6 -2
- package/dist/esm/components/Spinner.d.ts.map +1 -1
- package/dist/esm/components/Spinner.js +34 -47
- package/dist/esm/components/Spinner.js.map +1 -1
- package/dist/esm/components/Tree.d.ts +2 -1
- package/dist/esm/components/Tree.d.ts.map +1 -1
- package/dist/esm/components/Tree.js +9 -9
- package/dist/esm/components/Tree.js.map +1 -1
- package/dist/esm/components/ZoomableImageCitationWrapper.js +1 -1
- package/dist/esm/components/index.d.ts +2 -1
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +2 -1
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/stories/Banner.stories.js +1 -1
- package/dist/esm/stories/Banner.stories.js.map +1 -1
- package/dist/esm/stories/Button.stories.d.ts +3 -16
- package/dist/esm/stories/Button.stories.d.ts.map +1 -1
- package/dist/esm/stories/Button.stories.js +54 -166
- package/dist/esm/stories/Button.stories.js.map +1 -1
- package/dist/esm/stories/CardButton.stories.js +1 -1
- package/dist/esm/stories/CardButton.stories.js.map +1 -1
- package/dist/esm/stories/ContextItem.stories.d.ts.map +1 -1
- package/dist/esm/stories/ContextItem.stories.js +5 -5
- package/dist/esm/stories/ContextItem.stories.js.map +1 -1
- package/dist/esm/stories/Dialog.stories.js +1 -1
- package/dist/esm/stories/Dialog.stories.js.map +1 -1
- package/dist/esm/stories/DropdownMenu.stories.d.ts.map +1 -1
- package/dist/esm/stories/DropdownMenu.stories.js +7 -7
- package/dist/esm/stories/DropdownMenu.stories.js.map +1 -1
- package/dist/esm/stories/IconButton.stories.js +4 -4
- package/dist/esm/stories/IconButton.stories.js.map +1 -1
- package/dist/esm/stories/Input.stories.js +1 -1
- package/dist/esm/stories/Input.stories.js.map +1 -1
- package/dist/esm/stories/Markdown.stories.d.ts +1 -2
- package/dist/esm/stories/Markdown.stories.d.ts.map +1 -1
- package/dist/esm/stories/Modal.stories.d.ts.map +1 -1
- package/dist/esm/stories/Modal.stories.js +1 -2
- package/dist/esm/stories/Modal.stories.js.map +1 -1
- package/dist/esm/stories/NavigationList.stories.d.ts +7 -0
- package/dist/esm/stories/NavigationList.stories.d.ts.map +1 -0
- package/dist/esm/stories/NavigationList.stories.js +140 -0
- package/dist/esm/stories/NavigationList.stories.js.map +1 -0
- package/dist/esm/stories/NewDropdown.stories.js +2 -2
- package/dist/esm/stories/NewDropdown.stories.js.map +1 -1
- package/dist/esm/stories/Page.stories.d.ts.map +1 -1
- package/dist/esm/stories/Page.stories.js +6 -6
- package/dist/esm/stories/Page.stories.js.map +1 -1
- package/dist/esm/stories/Popover.stories.js +1 -1
- package/dist/esm/stories/Popover.stories.js.map +1 -1
- package/dist/esm/stories/Searchbar.stories.js +3 -3
- package/dist/esm/stories/Searchbar.stories.js.map +1 -1
- package/dist/esm/stories/SliderToggle.stories.js +2 -2
- package/dist/esm/stories/SliderToggle.stories.js.map +1 -1
- package/dist/esm/stories/Tree.stories.d.ts.map +1 -1
- package/dist/esm/stories/Tree.stories.js +6 -6
- package/dist/esm/stories/Tree.stories.js.map +1 -1
- package/dist/sparkle.css +186 -281
- package/package.json +1 -1
- package/src/components/AssistantPreview.tsx +1 -5
- package/src/components/Banner.tsx +1 -1
- package/src/components/BarHeader.tsx +8 -11
- package/src/components/Button.tsx +169 -237
- package/src/components/Citation.tsx +1 -1
- package/src/components/ConversationMessageActions.tsx +3 -7
- package/src/components/DataTable.tsx +2 -2
- package/src/components/Dialog.tsx +5 -5
- package/src/components/FilterChips.tsx +1 -2
- package/src/components/IconButton.tsx +56 -87
- package/src/components/Input.tsx +44 -31
- package/src/components/Label.tsx +1 -1
- package/src/components/Markdown.tsx +2 -3
- package/src/components/NavigationList.tsx +137 -0
- package/src/components/NewDropdown.tsx +2 -2
- package/src/components/Notification.tsx +1 -1
- package/src/components/Pagination.tsx +2 -8
- package/src/components/Popover.tsx +1 -1
- package/src/components/Popup.tsx +1 -1
- package/src/components/RadioGroup.tsx +20 -22
- package/src/components/Searchbar.tsx +1 -1
- package/src/components/Spinner.tsx +45 -68
- package/src/components/Tree.tsx +11 -9
- package/src/components/ZoomableImageCitationWrapper.tsx +1 -1
- package/src/components/index.ts +6 -1
- package/src/stories/Banner.stories.tsx +1 -1
- package/src/stories/Button.stories.tsx +62 -607
- package/src/stories/CardButton.stories.tsx +1 -1
- package/src/stories/ContextItem.stories.tsx +6 -11
- package/src/stories/Dialog.stories.tsx +1 -1
- package/src/stories/DropdownMenu.stories.tsx +8 -27
- package/src/stories/IconButton.stories.tsx +4 -4
- package/src/stories/Input.stories.tsx +14 -14
- package/src/stories/Modal.stories.tsx +1 -2
- package/src/stories/NavigationList.stories.tsx +173 -0
- package/src/stories/NewDropdown.stories.tsx +2 -16
- package/src/stories/Page.stories.tsx +6 -9
- package/src/stories/Popover.stories.tsx +1 -1
- package/src/stories/Searchbar.stories.tsx +3 -3
- package/src/stories/SliderToggle.stories.tsx +2 -2
- package/src/stories/Tree.stories.tsx +6 -10
|
@@ -11,12 +11,27 @@ import animLightXS from "@sparkle/lottie/spinnerLight";
|
|
|
11
11
|
import animLightLG from "@sparkle/lottie/spinnerLightLG";
|
|
12
12
|
import animSimpleLight from "@sparkle/lottie/spinnerLightXS";
|
|
13
13
|
|
|
14
|
+
const SPINNER_SIZES = ["xs", "sm", "md", "lg", "xl", "xxl"] as const;
|
|
15
|
+
|
|
16
|
+
type SpinnerSizeType = (typeof SPINNER_SIZES)[number];
|
|
17
|
+
|
|
18
|
+
const SPINNER_VARIANTS = [
|
|
19
|
+
"color",
|
|
20
|
+
"light",
|
|
21
|
+
"dark",
|
|
22
|
+
"pink900",
|
|
23
|
+
"purple900",
|
|
24
|
+
"slate400",
|
|
25
|
+
] as const;
|
|
26
|
+
|
|
27
|
+
type SpinnerVariantType = (typeof SPINNER_VARIANTS)[number];
|
|
28
|
+
|
|
14
29
|
export interface SpinnerProps {
|
|
15
|
-
size?:
|
|
16
|
-
variant?:
|
|
30
|
+
size?: SpinnerSizeType;
|
|
31
|
+
variant?: SpinnerVariantType;
|
|
17
32
|
}
|
|
18
33
|
|
|
19
|
-
const pxSizeClasses = {
|
|
34
|
+
const pxSizeClasses: Record<SpinnerSizeType, string> = {
|
|
20
35
|
xs: "16",
|
|
21
36
|
sm: "20",
|
|
22
37
|
md: "24",
|
|
@@ -27,16 +42,12 @@ const pxSizeClasses = {
|
|
|
27
42
|
|
|
28
43
|
type LottieColorType = [number, number, number, number];
|
|
29
44
|
|
|
30
|
-
const colors:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
slate900: [0.0588, 0.0902, 0.1647, 1], // #0F172A
|
|
45
|
+
const colors: Record<Exclude<SpinnerVariantType, "color">, LottieColorType> = {
|
|
46
|
+
light: [1, 1, 1, 1],
|
|
47
|
+
dark: [0.0588, 0.0902, 0.1647, 1],
|
|
34
48
|
purple900: [0.298, 0.1137, 0.5843, 1], // #4C1D95
|
|
35
|
-
sky900: [0.0471, 0.2902, 0.4314, 1], // #0C4A6E
|
|
36
49
|
pink900: [0.5137, 0.0941, 0.2627, 1], // #831843
|
|
37
|
-
|
|
38
|
-
warning900: [0.498, 0.1137, 0.1137, 1], // #7F1D1D
|
|
39
|
-
action900: [0.1176, 0.2275, 0.5412, 1], // #1E3A8A
|
|
50
|
+
slate400: [0.5804, 0.6392, 0.7216, 1], // #94A3B8
|
|
40
51
|
};
|
|
41
52
|
|
|
42
53
|
const isColorArray = (arr: unknown): arr is LottieColorType => {
|
|
@@ -75,73 +86,39 @@ const Spinner: React.FC<SpinnerProps> = ({
|
|
|
75
86
|
|
|
76
87
|
switch (size) {
|
|
77
88
|
case "xs":
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
anim = animDarkXS;
|
|
85
|
-
break;
|
|
86
|
-
|
|
87
|
-
default:
|
|
88
|
-
anim = animColorXS;
|
|
89
|
-
}
|
|
89
|
+
anim =
|
|
90
|
+
variant === "light"
|
|
91
|
+
? animSimpleLight
|
|
92
|
+
: variant === "dark"
|
|
93
|
+
? animDarkXS
|
|
94
|
+
: animColorXS;
|
|
90
95
|
break;
|
|
91
|
-
|
|
92
96
|
case "xl":
|
|
93
97
|
case "xxl":
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
anim = animDarkLG;
|
|
101
|
-
break;
|
|
102
|
-
|
|
103
|
-
default:
|
|
104
|
-
anim = animColorLG;
|
|
105
|
-
}
|
|
98
|
+
anim =
|
|
99
|
+
variant === "light"
|
|
100
|
+
? animLightLG
|
|
101
|
+
: variant === "dark"
|
|
102
|
+
? animDarkLG
|
|
103
|
+
: animColorLG;
|
|
106
104
|
break;
|
|
107
|
-
|
|
108
105
|
default:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
anim = animDark;
|
|
116
|
-
break;
|
|
117
|
-
|
|
118
|
-
default:
|
|
119
|
-
anim = animColor;
|
|
120
|
-
}
|
|
106
|
+
anim =
|
|
107
|
+
variant === "light"
|
|
108
|
+
? animLightXS
|
|
109
|
+
: variant === "dark"
|
|
110
|
+
? animDark
|
|
111
|
+
: animColor;
|
|
121
112
|
}
|
|
122
113
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
if (newColor) {
|
|
129
|
-
replaceColors(animationData, newColor);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return (
|
|
133
|
-
<Lottie
|
|
134
|
-
animationData={animationData}
|
|
135
|
-
style={{ width: `${fullSize}px`, height: `${fullSize}px` }}
|
|
136
|
-
loop
|
|
137
|
-
autoplay
|
|
138
|
-
/>
|
|
139
|
-
);
|
|
140
|
-
}
|
|
114
|
+
const animationData =
|
|
115
|
+
variant === "color"
|
|
116
|
+
? anim
|
|
117
|
+
: replaceColors(JSON.parse(JSON.stringify(anim)), colors[variant]);
|
|
141
118
|
|
|
142
119
|
return (
|
|
143
120
|
<Lottie
|
|
144
|
-
animationData={
|
|
121
|
+
animationData={animationData}
|
|
145
122
|
style={{ width: `${fullSize}px`, height: `${fullSize}px` }}
|
|
146
123
|
loop
|
|
147
124
|
autoplay
|
package/src/components/Tree.tsx
CHANGED
|
@@ -14,6 +14,7 @@ export interface TreeProps {
|
|
|
14
14
|
isLoading?: boolean;
|
|
15
15
|
tailwindIconTextColor?: string;
|
|
16
16
|
variant?: "navigator" | "finder";
|
|
17
|
+
className?: string;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export function Tree({
|
|
@@ -22,6 +23,7 @@ export function Tree({
|
|
|
22
23
|
isBoxed = false,
|
|
23
24
|
tailwindIconTextColor,
|
|
24
25
|
variant = "finder",
|
|
26
|
+
className,
|
|
25
27
|
}: TreeProps) {
|
|
26
28
|
const modifiedChildren = React.Children.map(children, (child) => {
|
|
27
29
|
// /!\ Limitation: This stops on the first invalid element.
|
|
@@ -44,7 +46,7 @@ export function Tree({
|
|
|
44
46
|
});
|
|
45
47
|
|
|
46
48
|
return isLoading ? (
|
|
47
|
-
<div className="s-py-2 s-pl-4">
|
|
49
|
+
<div className={cn("s-py-2 s-pl-4", className)}>
|
|
48
50
|
<Spinner size="xs" variant="dark" />
|
|
49
51
|
</div>
|
|
50
52
|
) : (
|
|
@@ -52,7 +54,8 @@ export function Tree({
|
|
|
52
54
|
className={cn(
|
|
53
55
|
"s-flex s-flex-col s-gap-0.5 s-overflow-hidden",
|
|
54
56
|
isBoxed &&
|
|
55
|
-
"s-rounded-xl s-border s-border-structure-200 s-bg-structure-50 s-p-4"
|
|
57
|
+
"s-rounded-xl s-border s-border-structure-200 s-bg-structure-50 s-p-4",
|
|
58
|
+
className
|
|
56
59
|
)}
|
|
57
60
|
>
|
|
58
61
|
{modifiedChildren}
|
|
@@ -61,12 +64,11 @@ export function Tree({
|
|
|
61
64
|
}
|
|
62
65
|
|
|
63
66
|
const treeItemStyleClasses = {
|
|
64
|
-
base: "s-group/tree s-flex s-cursor-default s-flex-row s-items-center s-gap-2 s-py-
|
|
67
|
+
base: "s-group/tree s-flex s-cursor-default s-flex-row s-items-center s-gap-2 s-py-2",
|
|
65
68
|
isNavigatableBase:
|
|
66
|
-
"s-rounded-
|
|
67
|
-
isNavigatableUnselected:
|
|
68
|
-
|
|
69
|
-
isNavigatableSelected: "s-border-structure-200 s-bg-white",
|
|
69
|
+
"s-rounded-xl s-pl-1.5 s-pr-3 s-transition-colors s-duration-300 s-ease-out s-cursor-pointer",
|
|
70
|
+
isNavigatableUnselected: "s-bg-structure-150/0 hover:s-bg-structure-150",
|
|
71
|
+
isNavigatableSelected: "s-font-medium s-bg-structure-150",
|
|
70
72
|
};
|
|
71
73
|
|
|
72
74
|
interface TreeItemProps {
|
|
@@ -161,7 +163,7 @@ Tree.Item = function ({
|
|
|
161
163
|
<IconButton
|
|
162
164
|
icon={isExpanded ? ArrowDownSIcon : ArrowRightSIcon}
|
|
163
165
|
size="xs"
|
|
164
|
-
variant="
|
|
166
|
+
variant="outline"
|
|
165
167
|
onClick={(e) => {
|
|
166
168
|
e.stopPropagation();
|
|
167
169
|
if (effectiveOnChevronClick) {
|
|
@@ -172,7 +174,7 @@ Tree.Item = function ({
|
|
|
172
174
|
)}
|
|
173
175
|
{type === "leaf" && <div className="s-w-4 s-flex-shrink-0"></div>}
|
|
174
176
|
{checkbox && <Checkbox {...checkbox} size="xs" />}
|
|
175
|
-
<Icon visual={visual} size="
|
|
177
|
+
<Icon visual={visual} size="sm" className={tailwindIconTextColor} />
|
|
176
178
|
<div
|
|
177
179
|
className={`s-font-regular s-truncate s-text-sm s-text-element-900 ${labelClassName}`}
|
|
178
180
|
>
|
package/src/components/index.ts
CHANGED
|
@@ -44,6 +44,11 @@ export { Item } from "./Item";
|
|
|
44
44
|
export { Label } from "./Label";
|
|
45
45
|
export { Markdown } from "./Markdown";
|
|
46
46
|
export { Modal } from "./Modal";
|
|
47
|
+
export {
|
|
48
|
+
NavigationList,
|
|
49
|
+
NavigationListItem,
|
|
50
|
+
NavigationListLabel,
|
|
51
|
+
} from "./NavigationList";
|
|
47
52
|
export {
|
|
48
53
|
NewDropdownMenu,
|
|
49
54
|
NewDropdownMenuCheckboxItem,
|
|
@@ -74,7 +79,7 @@ export {
|
|
|
74
79
|
export { Popup } from "./Popup";
|
|
75
80
|
export { PriceTable } from "./PriceTable";
|
|
76
81
|
export { RadioGroup, RadioGroupChoice, RadioGroupItem } from "./RadioGroup";
|
|
77
|
-
export { ScrollArea } from "./ScrollArea";
|
|
82
|
+
export { ScrollArea, ScrollBar } from "./ScrollArea";
|
|
78
83
|
export { Searchbar } from "./Searchbar";
|
|
79
84
|
export { Separator } from "./Separator";
|
|
80
85
|
export { SliderToggle } from "./SliderToggle";
|
|
@@ -20,7 +20,7 @@ export const BasicBanner = () => {
|
|
|
20
20
|
<p>
|
|
21
21
|
Join us in Denver from June 7 – 9 to see what’s coming next
|
|
22
22
|
</p>
|
|
23
|
-
<Button variant="
|
|
23
|
+
<Button variant="ghost" size="sm" label="Register Now" />
|
|
24
24
|
</div>
|
|
25
25
|
</Banner>
|
|
26
26
|
<Banner variant="incident">
|