@dust-tt/sparkle 0.2.254-rc-1 → 0.2.254
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 +456 -3879
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/BarHeader.js +3 -3
- package/dist/esm/components/BarHeader.js.map +1 -1
- package/dist/esm/components/Breadcrumbs.js +1 -1
- package/dist/esm/components/Breadcrumbs.js.map +1 -1
- package/dist/esm/components/Button.d.ts +3 -5
- package/dist/esm/components/Button.d.ts.map +1 -1
- package/dist/esm/components/Button.js +3 -11
- package/dist/esm/components/Button.js.map +1 -1
- package/dist/esm/components/Citation.d.ts.map +1 -1
- package/dist/esm/components/Citation.js +1 -1
- package/dist/esm/components/Citation.js.map +1 -1
- package/dist/esm/components/DataTable.d.ts.map +1 -1
- package/dist/esm/components/DataTable.js +2 -1
- package/dist/esm/components/DataTable.js.map +1 -1
- package/dist/esm/components/Dialog.d.ts +1 -2
- package/dist/esm/components/Dialog.d.ts.map +1 -1
- package/dist/esm/components/Dialog.js.map +1 -1
- package/dist/esm/components/DropdownMenu.d.ts +2 -2
- package/dist/esm/components/DropdownMenu.d.ts.map +1 -1
- package/dist/esm/components/DropdownMenu.js +5 -8
- package/dist/esm/components/DropdownMenu.js.map +1 -1
- package/dist/esm/components/ElementDialog.d.ts +1 -1
- package/dist/esm/components/ElementDialog.d.ts.map +1 -1
- package/dist/esm/components/ElementDialog.js +2 -2
- package/dist/esm/components/ElementDialog.js.map +1 -1
- package/dist/esm/components/IconButton.d.ts +2 -2
- package/dist/esm/components/IconButton.d.ts.map +1 -1
- package/dist/esm/components/IconButton.js +2 -2
- package/dist/esm/components/IconButton.js.map +1 -1
- package/dist/esm/components/IconToggleButton.d.ts +2 -2
- package/dist/esm/components/IconToggleButton.d.ts.map +1 -1
- package/dist/esm/components/IconToggleButton.js +2 -2
- package/dist/esm/components/IconToggleButton.js.map +1 -1
- package/dist/esm/components/Input.js.map +1 -1
- package/dist/esm/components/Modal.d.ts +6 -5
- package/dist/esm/components/Modal.d.ts.map +1 -1
- package/dist/esm/components/Modal.js +4 -4
- package/dist/esm/components/Modal.js.map +1 -1
- package/dist/esm/components/Searchbar.d.ts.map +1 -1
- package/dist/esm/components/Searchbar.js.map +1 -1
- package/dist/esm/components/Tab.js +1 -1
- package/dist/esm/components/Tab.js.map +1 -1
- package/dist/esm/components/Tooltip.d.ts +7 -13
- package/dist/esm/components/Tooltip.d.ts.map +1 -1
- package/dist/esm/components/Tooltip.js +42 -18
- package/dist/esm/components/Tooltip.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 +3 -3
- package/dist/esm/components/Tree.js.map +1 -1
- package/dist/esm/components/index.d.ts +1 -1
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/stories/Button.stories.d.ts +0 -2
- package/dist/esm/stories/Button.stories.d.ts.map +1 -1
- package/dist/esm/stories/Button.stories.js +3 -14
- package/dist/esm/stories/Button.stories.js.map +1 -1
- package/dist/esm/stories/Citation.stories.js +1 -1
- package/dist/esm/stories/Citation.stories.js.map +1 -1
- package/dist/esm/stories/DataTable.stories.d.ts.map +1 -1
- package/dist/esm/stories/DataTable.stories.js.map +1 -1
- package/dist/esm/stories/Dialog.stories.d.ts.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 +2 -2
- package/dist/esm/stories/DropdownMenu.stories.js.map +1 -1
- package/dist/esm/stories/IconButton.stories.js +3 -3
- package/dist/esm/stories/IconButton.stories.js.map +1 -1
- package/dist/esm/stories/Modal.stories.d.ts.map +1 -1
- package/dist/esm/stories/Modal.stories.js +6 -1
- package/dist/esm/stories/Modal.stories.js.map +1 -1
- package/dist/esm/stories/TextArea.stories.d.ts.map +1 -1
- package/dist/esm/stories/TextArea.stories.js +3 -18
- package/dist/esm/stories/TextArea.stories.js.map +1 -1
- package/dist/esm/stories/Tooltip.stories.d.ts +8 -3
- package/dist/esm/stories/Tooltip.stories.d.ts.map +1 -1
- package/dist/esm/stories/Tooltip.stories.js +23 -10
- package/dist/esm/stories/Tooltip.stories.js.map +1 -1
- package/dist/esm/stories/Tree.stories.js.map +1 -1
- package/dist/sparkle.css +68 -0
- package/package.json +1 -3
- package/src/components/BarHeader.tsx +3 -0
- package/src/components/Breadcrumbs.tsx +4 -1
- package/src/components/Button.tsx +14 -17
- package/src/components/Citation.tsx +7 -1
- package/src/components/DataTable.tsx +8 -11
- package/src/components/Dialog.tsx +4 -4
- package/src/components/DropdownMenu.tsx +31 -42
- package/src/components/ElementDialog.tsx +1 -4
- package/src/components/IconButton.tsx +6 -9
- package/src/components/IconToggleButton.tsx +6 -9
- package/src/components/Input.tsx +1 -1
- package/src/components/Modal.tsx +17 -11
- package/src/components/Searchbar.tsx +4 -2
- package/src/components/Tab.tsx +1 -1
- package/src/components/Tooltip.tsx +78 -48
- package/src/components/Tree.tsx +3 -1
- package/src/components/index.ts +1 -7
- package/src/stories/Button.stories.tsx +3 -46
- package/src/stories/Citation.stories.tsx +1 -1
- package/src/stories/DataTable.stories.tsx +1 -3
- package/src/stories/Dialog.stories.tsx +0 -1
- package/src/stories/DropdownMenu.stories.tsx +3 -6
- package/src/stories/IconButton.stories.tsx +3 -3
- package/src/stories/Modal.stories.tsx +17 -0
- package/src/stories/TextArea.stories.tsx +4 -19
- package/src/stories/Tooltip.stories.tsx +50 -31
- package/src/stories/Tree.stories.tsx +1 -1
package/src/components/index.ts
CHANGED
|
@@ -43,12 +43,6 @@ export { SliderToggle } from "./SliderToggle";
|
|
|
43
43
|
export { default as Spinner } from "./Spinner";
|
|
44
44
|
export { Tab } from "./Tab";
|
|
45
45
|
export { TextArea } from "./TextArea";
|
|
46
|
-
export {
|
|
47
|
-
Tooltip,
|
|
48
|
-
TooltipContent,
|
|
49
|
-
TooltipProvider,
|
|
50
|
-
TooltipRoot,
|
|
51
|
-
TooltipTrigger,
|
|
52
|
-
} from "./Tooltip";
|
|
46
|
+
export { Tooltip } from "./Tooltip";
|
|
53
47
|
export { Tree } from "./Tree";
|
|
54
48
|
export { ZoomableImageCitationWrapper } from "./ZoomableImageCitationWrapper";
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
Button,
|
|
6
|
-
Cog6ToothIcon,
|
|
7
|
-
Tooltip,
|
|
8
|
-
TooltipContent,
|
|
9
|
-
TooltipProvider,
|
|
10
|
-
TooltipRoot,
|
|
11
|
-
TooltipTrigger,
|
|
12
|
-
} from "../index_with_tw_base";
|
|
4
|
+
import { Button, Cog6ToothIcon } from "../index_with_tw_base";
|
|
13
5
|
|
|
14
6
|
const meta = {
|
|
15
7
|
title: "Primitives/Button",
|
|
@@ -572,41 +564,6 @@ export const ButtonSelectExamples = () => (
|
|
|
572
564
|
</div>
|
|
573
565
|
);
|
|
574
566
|
|
|
575
|
-
export const ButtonWithTooltipManualInstantiation = () => {
|
|
576
|
-
return (
|
|
577
|
-
<TooltipProvider>
|
|
578
|
-
<TooltipRoot>
|
|
579
|
-
<TooltipTrigger>
|
|
580
|
-
<Button
|
|
581
|
-
labelVisible={true}
|
|
582
|
-
label="New conversation"
|
|
583
|
-
icon={Cog6ToothIcon}
|
|
584
|
-
hasMagnifying={false}
|
|
585
|
-
/>
|
|
586
|
-
</TooltipTrigger>
|
|
587
|
-
<TooltipContent>
|
|
588
|
-
<p>Hello</p>
|
|
589
|
-
</TooltipContent>
|
|
590
|
-
</TooltipRoot>
|
|
591
|
-
</TooltipProvider>
|
|
592
|
-
)}
|
|
593
|
-
|
|
594
|
-
export const ButtonWithTooltip = () => {
|
|
595
|
-
return (
|
|
596
|
-
<Tooltip
|
|
597
|
-
trigger={
|
|
598
|
-
<Button
|
|
599
|
-
labelVisible={true}
|
|
600
|
-
label="New conversation"
|
|
601
|
-
icon={Cog6ToothIcon}
|
|
602
|
-
hasMagnifying={false}
|
|
603
|
-
/>
|
|
604
|
-
}
|
|
605
|
-
label={"Hello"}
|
|
606
|
-
/>
|
|
607
|
-
)
|
|
608
|
-
}
|
|
609
|
-
|
|
610
567
|
export const Primary: Story = {
|
|
611
568
|
args: {
|
|
612
569
|
variant: "primary",
|
|
@@ -665,7 +622,7 @@ export const IconOnlyPlusTooltip: Story = {
|
|
|
665
622
|
labelVisible: false,
|
|
666
623
|
icon: Cog6ToothIcon,
|
|
667
624
|
disabled: false,
|
|
668
|
-
tooltipPosition: "
|
|
625
|
+
tooltipPosition: "below",
|
|
669
626
|
},
|
|
670
627
|
};
|
|
671
628
|
|
|
@@ -677,7 +634,7 @@ export const IconOnlyNoTooltip: Story = {
|
|
|
677
634
|
labelVisible: false,
|
|
678
635
|
icon: Cog6ToothIcon,
|
|
679
636
|
disabled: false,
|
|
680
|
-
tooltipPosition: "
|
|
637
|
+
tooltipPosition: "below",
|
|
681
638
|
disabledTooltip: true,
|
|
682
639
|
},
|
|
683
640
|
};
|
|
@@ -133,7 +133,7 @@ export const CitationsExample = () => (
|
|
|
133
133
|
type="google_drive"
|
|
134
134
|
index="3"
|
|
135
135
|
href="https://www.google.com"
|
|
136
|
-
description="Write a 120 character description of the citation here to be displayed in the citation list.
|
|
136
|
+
description="Write a 120 character description of the citation here to be displayed in the citation list."
|
|
137
137
|
isBlinking={true}
|
|
138
138
|
/>
|
|
139
139
|
<Citation
|
|
@@ -161,9 +161,7 @@ const columns: ColumnDef<Data>[] = [
|
|
|
161
161
|
width: "100px",
|
|
162
162
|
},
|
|
163
163
|
cell: (info) => (
|
|
164
|
-
<DataTable.CellContentWithCopy>
|
|
165
|
-
{info.row.original.addedBy}
|
|
166
|
-
</DataTable.CellContentWithCopy>
|
|
164
|
+
<DataTable.CellContentWithCopy>{info.row.original.addedBy}</DataTable.CellContentWithCopy>
|
|
167
165
|
),
|
|
168
166
|
},
|
|
169
167
|
{
|
|
@@ -48,10 +48,7 @@ export const DropdownExample = () => {
|
|
|
48
48
|
<div className="s-flex s-gap-6">
|
|
49
49
|
<div className="s-text-sm">Action</div>
|
|
50
50
|
<DropdownMenu>
|
|
51
|
-
<DropdownMenu.Button
|
|
52
|
-
label="Action"
|
|
53
|
-
onClick={() => console.log("CLICK")}
|
|
54
|
-
/>
|
|
51
|
+
<DropdownMenu.Button label="Action" onClick={() => console.log("CLICK")}/>
|
|
55
52
|
<DropdownMenu.Items width={220}>
|
|
56
53
|
<DropdownMenu.SectionHeader label="Edition" />
|
|
57
54
|
<DropdownMenu.Item
|
|
@@ -314,7 +311,7 @@ export const DropdownExample = () => {
|
|
|
314
311
|
<DropdownMenu.Button
|
|
315
312
|
icon={ChatBubbleBottomCenterTextIcon}
|
|
316
313
|
tooltip="Moonlab"
|
|
317
|
-
tooltipPosition="
|
|
314
|
+
tooltipPosition="below"
|
|
318
315
|
/>
|
|
319
316
|
<DropdownMenu.Items origin="topLeft" width={120}>
|
|
320
317
|
<DropdownMenu.Item label="item 1 is longish" link={{ href: "#" }} />
|
|
@@ -358,7 +355,7 @@ export const DropdownExample = () => {
|
|
|
358
355
|
<DropdownMenu.Button
|
|
359
356
|
icon={ChatBubbleBottomCenterTextIcon}
|
|
360
357
|
tooltip="Moonlab"
|
|
361
|
-
tooltipPosition="
|
|
358
|
+
tooltipPosition="below"
|
|
362
359
|
/>
|
|
363
360
|
<DropdownMenu.Items origin="topLeft">
|
|
364
361
|
<DropdownMenu.Item label="item 1" link={{ href: "#" }} />
|
|
@@ -22,7 +22,7 @@ export const IconButtonWithTooltip: Story = {
|
|
|
22
22
|
args: {
|
|
23
23
|
variant: "primary",
|
|
24
24
|
tooltip: "Your settings",
|
|
25
|
-
tooltipPosition: "
|
|
25
|
+
tooltipPosition: "below",
|
|
26
26
|
icon: Cog6ToothIcon,
|
|
27
27
|
},
|
|
28
28
|
};
|
|
@@ -31,7 +31,7 @@ export const IconButtonSecondary: Story = {
|
|
|
31
31
|
args: {
|
|
32
32
|
variant: "secondary",
|
|
33
33
|
tooltip: "This a secondary IconButton",
|
|
34
|
-
tooltipPosition: "
|
|
34
|
+
tooltipPosition: "below",
|
|
35
35
|
icon: Cog6ToothIcon,
|
|
36
36
|
},
|
|
37
37
|
};
|
|
@@ -40,7 +40,7 @@ export const IconButtonTertiary: Story = {
|
|
|
40
40
|
args: {
|
|
41
41
|
variant: "tertiary",
|
|
42
42
|
tooltip: "This a tertiary IconButton",
|
|
43
|
-
tooltipPosition: "
|
|
43
|
+
tooltipPosition: "below",
|
|
44
44
|
icon: Cog6ToothIcon,
|
|
45
45
|
},
|
|
46
46
|
};
|
|
@@ -21,6 +21,8 @@ export const ModalExample = () => {
|
|
|
21
21
|
const [inputValue, setInputValue] = useState("initial value");
|
|
22
22
|
const [isRightSideWideModalOpen, setIsRightSideWideModalOpen] =
|
|
23
23
|
useState(false);
|
|
24
|
+
const [isAlertModalOpen, setIsAlertModalOpen] = useState(false);
|
|
25
|
+
|
|
24
26
|
return (
|
|
25
27
|
<Page.Layout gap="md">
|
|
26
28
|
<Modal
|
|
@@ -121,6 +123,20 @@ export const ModalExample = () => {
|
|
|
121
123
|
I'm the modal content
|
|
122
124
|
</div>
|
|
123
125
|
</Modal>
|
|
126
|
+
<Modal
|
|
127
|
+
isOpen={isAlertModalOpen}
|
|
128
|
+
onClose={() => {}}
|
|
129
|
+
onSave={() => {}}
|
|
130
|
+
isSaving={false}
|
|
131
|
+
hasChanged={false}
|
|
132
|
+
variant="side-sm"
|
|
133
|
+
title="Alert modal"
|
|
134
|
+
alertModal
|
|
135
|
+
action={undefined}
|
|
136
|
+
>
|
|
137
|
+
This is an alert modal.
|
|
138
|
+
<Button label="Ok" onClick={() => setIsAlertModalOpen(false)} />
|
|
139
|
+
</Modal>
|
|
124
140
|
<div className="s-flex s-flex-col s-items-start s-gap-3">
|
|
125
141
|
<div className="s-text-lg s-font-bold">Fullscreen</div>
|
|
126
142
|
<Button
|
|
@@ -140,6 +156,7 @@ export const ModalExample = () => {
|
|
|
140
156
|
label="Modal right side wide"
|
|
141
157
|
onClick={() => setIsRightSideWideModalOpen(true)}
|
|
142
158
|
/>
|
|
159
|
+
<Button label="Alert modal" onClick={() => setIsAlertModalOpen(true)} />
|
|
143
160
|
</div>
|
|
144
161
|
</Page.Layout>
|
|
145
162
|
);
|
|
@@ -23,13 +23,8 @@ export const TextAreaExample = () => {
|
|
|
23
23
|
<TextArea
|
|
24
24
|
placeholder="placeholder"
|
|
25
25
|
onChange={(e) => {
|
|
26
|
-
console.log(e.target.value)
|
|
27
|
-
setTextValues([
|
|
28
|
-
e.target.value,
|
|
29
|
-
textValues[1],
|
|
30
|
-
textValues[2],
|
|
31
|
-
textValues[3],
|
|
32
|
-
]);
|
|
26
|
+
console.log(e.target.value)
|
|
27
|
+
setTextValues([e.target.value, textValues[1], textValues[2], textValues[3]])
|
|
33
28
|
}}
|
|
34
29
|
minRows={2}
|
|
35
30
|
defaultValue={textValues[0]}
|
|
@@ -39,12 +34,7 @@ export const TextAreaExample = () => {
|
|
|
39
34
|
defaultValue={textValues[1]}
|
|
40
35
|
error={"errored because blah"}
|
|
41
36
|
onChange={(e) =>
|
|
42
|
-
setTextValues([
|
|
43
|
-
textValues[0],
|
|
44
|
-
e.target.value,
|
|
45
|
-
textValues[2],
|
|
46
|
-
textValues[3],
|
|
47
|
-
])
|
|
37
|
+
setTextValues([textValues[0], e.target.value, textValues[2], textValues[3]])
|
|
48
38
|
}
|
|
49
39
|
showErrorLabel
|
|
50
40
|
/>
|
|
@@ -52,12 +42,7 @@ export const TextAreaExample = () => {
|
|
|
52
42
|
placeholder="placeholder"
|
|
53
43
|
defaultValue={textValues[2]}
|
|
54
44
|
onChange={(e) =>
|
|
55
|
-
setTextValues([
|
|
56
|
-
textValues[0],
|
|
57
|
-
textValues[1],
|
|
58
|
-
e.target.value,
|
|
59
|
-
textValues[3],
|
|
60
|
-
])
|
|
45
|
+
setTextValues([textValues[0], textValues[1], e.target.value, textValues[3]])
|
|
61
46
|
}
|
|
62
47
|
error={"errored because blah"}
|
|
63
48
|
/>
|
|
@@ -1,43 +1,62 @@
|
|
|
1
|
-
import type { Meta } from "@storybook/react";
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
Icon,
|
|
6
|
-
RobotIcon,
|
|
7
|
-
Tooltip,
|
|
8
|
-
TooltipContent,
|
|
9
|
-
TooltipProvider,
|
|
10
|
-
TooltipRoot,
|
|
11
|
-
TooltipTrigger,
|
|
12
|
-
} from "../index_with_tw_base";
|
|
4
|
+
import { Tooltip } from "../index_with_tw_base";
|
|
13
5
|
|
|
14
6
|
const meta = {
|
|
15
7
|
title: "Primitives/Tooltip",
|
|
16
|
-
component:
|
|
17
|
-
} satisfies Meta<typeof
|
|
8
|
+
component: Tooltip,
|
|
9
|
+
} satisfies Meta<typeof Tooltip>;
|
|
18
10
|
|
|
19
11
|
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
20
13
|
|
|
21
|
-
export const
|
|
22
|
-
|
|
14
|
+
export const TooltipAbove: Story = {
|
|
15
|
+
args: {
|
|
16
|
+
label: "This is a tooltip",
|
|
17
|
+
children: "Hover me",
|
|
18
|
+
position: "above",
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const TooltipBelow: Story = {
|
|
23
|
+
args: {
|
|
24
|
+
label: "This is a tooltip",
|
|
25
|
+
children: "Hover me",
|
|
26
|
+
position: "below",
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const ToolTipWithContent = () => (
|
|
31
|
+
<div className="s-pl-32">
|
|
32
|
+
<Tooltip
|
|
33
|
+
contentChildren={
|
|
34
|
+
<div className="s-w-64">
|
|
35
|
+
<div className="s-flex s-flex-col s-gap-y-2 s-break-words">
|
|
36
|
+
<div className="s-flex s-font-semibold">
|
|
37
|
+
This is a more complex tooltip:
|
|
38
|
+
</div>
|
|
39
|
+
<div className="s-flex s-flex-wrap s-break-words">
|
|
40
|
+
It has some content that is long here and describes something
|
|
41
|
+
about the content associated with this.
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
}
|
|
46
|
+
position="below"
|
|
47
|
+
>
|
|
48
|
+
Hover me
|
|
49
|
+
</Tooltip>
|
|
50
|
+
</div>
|
|
23
51
|
);
|
|
24
52
|
|
|
25
|
-
export const
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}}
|
|
53
|
+
export const TooltipLongLabel = () => (
|
|
54
|
+
<div className="s-pl-64">
|
|
55
|
+
<Tooltip
|
|
56
|
+
label="This is a tooltip with a very long label that should wrap onto multiple lines. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor."
|
|
57
|
+
position="below"
|
|
31
58
|
>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<TooltipContent side="right" sideOffset={50}>
|
|
36
|
-
This is a tooltip with a very long label that should wrap onto multiple
|
|
37
|
-
lines. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non
|
|
38
|
-
risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec,
|
|
39
|
-
ultricies sed, dolor.
|
|
40
|
-
</TooltipContent>
|
|
41
|
-
</TooltipRoot>
|
|
42
|
-
</TooltipProvider>
|
|
59
|
+
Hover me
|
|
60
|
+
</Tooltip>
|
|
61
|
+
</div>
|
|
43
62
|
);
|