@dust-tt/sparkle 0.2.253 → 0.2.254-rc-1
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 +3876 -453
- 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 +5 -3
- package/dist/esm/components/Button.d.ts.map +1 -1
- package/dist/esm/components/Button.js +11 -3
- 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 +1 -2
- package/dist/esm/components/DataTable.js.map +1 -1
- package/dist/esm/components/Dialog.d.ts +2 -1
- 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 +8 -5
- 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 +5 -6
- 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 +13 -7
- package/dist/esm/components/Tooltip.d.ts.map +1 -1
- package/dist/esm/components/Tooltip.js +18 -42
- package/dist/esm/components/Tooltip.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 +2 -0
- package/dist/esm/stories/Button.stories.d.ts.map +1 -1
- package/dist/esm/stories/Button.stories.js +14 -3
- 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 +1 -6
- 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 +18 -3
- package/dist/esm/stories/TextArea.stories.js.map +1 -1
- package/dist/esm/stories/Tooltip.stories.d.ts +3 -8
- package/dist/esm/stories/Tooltip.stories.d.ts.map +1 -1
- package/dist/esm/stories/Tooltip.stories.js +10 -23
- package/dist/esm/stories/Tooltip.stories.js.map +1 -1
- package/dist/esm/stories/Tree.stories.js.map +1 -1
- package/dist/sparkle.css +0 -68
- package/package.json +3 -1
- package/src/components/BarHeader.tsx +0 -3
- package/src/components/Breadcrumbs.tsx +1 -4
- package/src/components/Button.tsx +17 -14
- package/src/components/Citation.tsx +1 -7
- package/src/components/DataTable.tsx +11 -8
- package/src/components/Dialog.tsx +4 -4
- package/src/components/DropdownMenu.tsx +42 -31
- package/src/components/ElementDialog.tsx +4 -1
- package/src/components/IconButton.tsx +9 -6
- package/src/components/IconToggleButton.tsx +9 -6
- package/src/components/Input.tsx +1 -1
- package/src/components/Modal.tsx +11 -17
- package/src/components/Searchbar.tsx +2 -4
- package/src/components/Tab.tsx +1 -1
- package/src/components/Tooltip.tsx +48 -78
- package/src/components/index.ts +7 -1
- package/src/stories/Button.stories.tsx +46 -3
- package/src/stories/Citation.stories.tsx +1 -1
- package/src/stories/DataTable.stories.tsx +3 -1
- package/src/stories/Dialog.stories.tsx +1 -0
- package/src/stories/DropdownMenu.stories.tsx +6 -3
- package/src/stories/IconButton.stories.tsx +3 -3
- package/src/stories/Modal.stories.tsx +0 -17
- package/src/stories/TextArea.stories.tsx +19 -4
- package/src/stories/Tooltip.stories.tsx +31 -50
- package/src/stories/Tree.stories.tsx +1 -1
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
Button,
|
|
6
|
+
Cog6ToothIcon,
|
|
7
|
+
Tooltip,
|
|
8
|
+
TooltipContent,
|
|
9
|
+
TooltipProvider,
|
|
10
|
+
TooltipRoot,
|
|
11
|
+
TooltipTrigger,
|
|
12
|
+
} from "../index_with_tw_base";
|
|
5
13
|
|
|
6
14
|
const meta = {
|
|
7
15
|
title: "Primitives/Button",
|
|
@@ -564,6 +572,41 @@ export const ButtonSelectExamples = () => (
|
|
|
564
572
|
</div>
|
|
565
573
|
);
|
|
566
574
|
|
|
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
|
+
|
|
567
610
|
export const Primary: Story = {
|
|
568
611
|
args: {
|
|
569
612
|
variant: "primary",
|
|
@@ -622,7 +665,7 @@ export const IconOnlyPlusTooltip: Story = {
|
|
|
622
665
|
labelVisible: false,
|
|
623
666
|
icon: Cog6ToothIcon,
|
|
624
667
|
disabled: false,
|
|
625
|
-
tooltipPosition: "
|
|
668
|
+
tooltipPosition: "bottom",
|
|
626
669
|
},
|
|
627
670
|
};
|
|
628
671
|
|
|
@@ -634,7 +677,7 @@ export const IconOnlyNoTooltip: Story = {
|
|
|
634
677
|
labelVisible: false,
|
|
635
678
|
icon: Cog6ToothIcon,
|
|
636
679
|
disabled: false,
|
|
637
|
-
tooltipPosition: "
|
|
680
|
+
tooltipPosition: "bottom",
|
|
638
681
|
disabledTooltip: true,
|
|
639
682
|
},
|
|
640
683
|
};
|
|
@@ -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. Write a 120 character description of the citation here to be displayed in the citation list. 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,7 +161,9 @@ const columns: ColumnDef<Data>[] = [
|
|
|
161
161
|
width: "100px",
|
|
162
162
|
},
|
|
163
163
|
cell: (info) => (
|
|
164
|
-
<DataTable.CellContentWithCopy>
|
|
164
|
+
<DataTable.CellContentWithCopy>
|
|
165
|
+
{info.row.original.addedBy}
|
|
166
|
+
</DataTable.CellContentWithCopy>
|
|
165
167
|
),
|
|
166
168
|
},
|
|
167
169
|
{
|
|
@@ -48,7 +48,10 @@ 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
|
|
51
|
+
<DropdownMenu.Button
|
|
52
|
+
label="Action"
|
|
53
|
+
onClick={() => console.log("CLICK")}
|
|
54
|
+
/>
|
|
52
55
|
<DropdownMenu.Items width={220}>
|
|
53
56
|
<DropdownMenu.SectionHeader label="Edition" />
|
|
54
57
|
<DropdownMenu.Item
|
|
@@ -311,7 +314,7 @@ export const DropdownExample = () => {
|
|
|
311
314
|
<DropdownMenu.Button
|
|
312
315
|
icon={ChatBubbleBottomCenterTextIcon}
|
|
313
316
|
tooltip="Moonlab"
|
|
314
|
-
tooltipPosition="
|
|
317
|
+
tooltipPosition="bottom"
|
|
315
318
|
/>
|
|
316
319
|
<DropdownMenu.Items origin="topLeft" width={120}>
|
|
317
320
|
<DropdownMenu.Item label="item 1 is longish" link={{ href: "#" }} />
|
|
@@ -355,7 +358,7 @@ export const DropdownExample = () => {
|
|
|
355
358
|
<DropdownMenu.Button
|
|
356
359
|
icon={ChatBubbleBottomCenterTextIcon}
|
|
357
360
|
tooltip="Moonlab"
|
|
358
|
-
tooltipPosition="
|
|
361
|
+
tooltipPosition="bottom"
|
|
359
362
|
/>
|
|
360
363
|
<DropdownMenu.Items origin="topLeft">
|
|
361
364
|
<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: "bottom",
|
|
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: "bottom",
|
|
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: "bottom",
|
|
44
44
|
icon: Cog6ToothIcon,
|
|
45
45
|
},
|
|
46
46
|
};
|
|
@@ -21,8 +21,6 @@ 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
|
-
|
|
26
24
|
return (
|
|
27
25
|
<Page.Layout gap="md">
|
|
28
26
|
<Modal
|
|
@@ -123,20 +121,6 @@ export const ModalExample = () => {
|
|
|
123
121
|
I'm the modal content
|
|
124
122
|
</div>
|
|
125
123
|
</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>
|
|
140
124
|
<div className="s-flex s-flex-col s-items-start s-gap-3">
|
|
141
125
|
<div className="s-text-lg s-font-bold">Fullscreen</div>
|
|
142
126
|
<Button
|
|
@@ -156,7 +140,6 @@ export const ModalExample = () => {
|
|
|
156
140
|
label="Modal right side wide"
|
|
157
141
|
onClick={() => setIsRightSideWideModalOpen(true)}
|
|
158
142
|
/>
|
|
159
|
-
<Button label="Alert modal" onClick={() => setIsAlertModalOpen(true)} />
|
|
160
143
|
</div>
|
|
161
144
|
</Page.Layout>
|
|
162
145
|
);
|
|
@@ -23,8 +23,13 @@ export const TextAreaExample = () => {
|
|
|
23
23
|
<TextArea
|
|
24
24
|
placeholder="placeholder"
|
|
25
25
|
onChange={(e) => {
|
|
26
|
-
console.log(e.target.value)
|
|
27
|
-
setTextValues([
|
|
26
|
+
console.log(e.target.value);
|
|
27
|
+
setTextValues([
|
|
28
|
+
e.target.value,
|
|
29
|
+
textValues[1],
|
|
30
|
+
textValues[2],
|
|
31
|
+
textValues[3],
|
|
32
|
+
]);
|
|
28
33
|
}}
|
|
29
34
|
minRows={2}
|
|
30
35
|
defaultValue={textValues[0]}
|
|
@@ -34,7 +39,12 @@ export const TextAreaExample = () => {
|
|
|
34
39
|
defaultValue={textValues[1]}
|
|
35
40
|
error={"errored because blah"}
|
|
36
41
|
onChange={(e) =>
|
|
37
|
-
setTextValues([
|
|
42
|
+
setTextValues([
|
|
43
|
+
textValues[0],
|
|
44
|
+
e.target.value,
|
|
45
|
+
textValues[2],
|
|
46
|
+
textValues[3],
|
|
47
|
+
])
|
|
38
48
|
}
|
|
39
49
|
showErrorLabel
|
|
40
50
|
/>
|
|
@@ -42,7 +52,12 @@ export const TextAreaExample = () => {
|
|
|
42
52
|
placeholder="placeholder"
|
|
43
53
|
defaultValue={textValues[2]}
|
|
44
54
|
onChange={(e) =>
|
|
45
|
-
setTextValues([
|
|
55
|
+
setTextValues([
|
|
56
|
+
textValues[0],
|
|
57
|
+
textValues[1],
|
|
58
|
+
e.target.value,
|
|
59
|
+
textValues[3],
|
|
60
|
+
])
|
|
46
61
|
}
|
|
47
62
|
error={"errored because blah"}
|
|
48
63
|
/>
|
|
@@ -1,62 +1,43 @@
|
|
|
1
|
-
import type { Meta
|
|
1
|
+
import type { Meta } from "@storybook/react";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
Icon,
|
|
6
|
+
RobotIcon,
|
|
7
|
+
Tooltip,
|
|
8
|
+
TooltipContent,
|
|
9
|
+
TooltipProvider,
|
|
10
|
+
TooltipRoot,
|
|
11
|
+
TooltipTrigger,
|
|
12
|
+
} from "../index_with_tw_base";
|
|
5
13
|
|
|
6
14
|
const meta = {
|
|
7
15
|
title: "Primitives/Tooltip",
|
|
8
|
-
component:
|
|
9
|
-
} satisfies Meta<typeof
|
|
16
|
+
component: TooltipProvider,
|
|
17
|
+
} satisfies Meta<typeof TooltipProvider>;
|
|
10
18
|
|
|
11
19
|
export default meta;
|
|
12
|
-
type Story = StoryObj<typeof meta>;
|
|
13
20
|
|
|
14
|
-
export const
|
|
15
|
-
|
|
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>
|
|
21
|
+
export const TooltipExample = () => (
|
|
22
|
+
<Tooltip trigger={<div>Hover</div>} label={<p>Add to library</p>} />
|
|
51
23
|
);
|
|
52
24
|
|
|
53
|
-
export const
|
|
54
|
-
<
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
25
|
+
export const TooltipWithManual = () => (
|
|
26
|
+
<TooltipProvider delayDuration={800} skipDelayDuration={500}>
|
|
27
|
+
<TooltipRoot
|
|
28
|
+
onOpenChange={(open: boolean) => {
|
|
29
|
+
console.log(`Is open: ${open}`);
|
|
30
|
+
}}
|
|
58
31
|
>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
32
|
+
<TooltipTrigger>
|
|
33
|
+
<Icon visual={RobotIcon} size="xs" />
|
|
34
|
+
</TooltipTrigger>
|
|
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>
|
|
62
43
|
);
|