@dust-tt/sparkle 0.2.575 → 0.2.576
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/Dialog.d.ts +4 -1
- package/dist/esm/components/Dialog.d.ts.map +1 -1
- package/dist/esm/components/Dialog.js +12 -4
- package/dist/esm/components/Dialog.js.map +1 -1
- package/dist/esm/components/MessageCard.d.ts.map +1 -1
- package/dist/esm/components/MessageCard.js.map +1 -1
- package/dist/esm/components/MultiPageDialog.d.ts +1 -0
- package/dist/esm/components/MultiPageDialog.d.ts.map +1 -1
- package/dist/esm/components/MultiPageDialog.js +9 -6
- package/dist/esm/components/MultiPageDialog.js.map +1 -1
- package/dist/esm/components/Resizable.js +1 -1
- package/dist/esm/stories/Dialog.stories.d.ts.map +1 -1
- package/dist/esm/stories/Dialog.stories.js +5 -3
- package/dist/esm/stories/Dialog.stories.js.map +1 -1
- package/dist/esm/stories/MultiPageDialog.stories.d.ts.map +1 -1
- package/dist/esm/stories/MultiPageDialog.stories.js +14 -7
- package/dist/esm/stories/MultiPageDialog.stories.js.map +1 -1
- package/dist/sparkle.css +10 -0
- package/package.json +1 -1
- package/src/components/Dialog.tsx +40 -15
- package/src/components/MessageCard.tsx +1 -4
- package/src/components/MultiPageDialog.tsx +25 -9
- package/src/components/Resizable.tsx +1 -1
- package/src/stories/Dialog.stories.tsx +18 -2
- package/src/stories/MultiPageDialog.stories.tsx +30 -9
|
@@ -48,7 +48,7 @@ const ResizableHandle = ({
|
|
|
48
48
|
<div
|
|
49
49
|
className={cn(
|
|
50
50
|
"s-absolute s-flex s-h-6 s-w-2 s-items-center s-justify-center s-rounded-2xl",
|
|
51
|
-
"s-border-gray-100 s-
|
|
51
|
+
"s-border s-border-gray-100 s-bg-white"
|
|
52
52
|
)}
|
|
53
53
|
>
|
|
54
54
|
<div className="s-w-px" />
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
|
-
import { Avatar, Button, Input } from "@sparkle/components";
|
|
4
|
+
import { Avatar, Button, Input, SearchInput } from "@sparkle/components";
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
Dialog,
|
|
@@ -168,7 +168,16 @@ export const LargeContent: Story = {
|
|
|
168
168
|
<DialogHeader>
|
|
169
169
|
<DialogTitle>Terms of Service</DialogTitle>
|
|
170
170
|
</DialogHeader>
|
|
171
|
-
<DialogContainer
|
|
171
|
+
<DialogContainer
|
|
172
|
+
fixedContent={
|
|
173
|
+
<SearchInput
|
|
174
|
+
value=""
|
|
175
|
+
onChange={() => {}}
|
|
176
|
+
name="search-terms"
|
|
177
|
+
placeholder="Search terms..."
|
|
178
|
+
/>
|
|
179
|
+
}
|
|
180
|
+
>
|
|
172
181
|
<div className="s-space-y-4">
|
|
173
182
|
<h3 className="s-font-semibold">1. Introduction</h3>
|
|
174
183
|
<p className="s-text-sm s-text-muted-foreground">
|
|
@@ -203,6 +212,13 @@ export const LargeContent: Story = {
|
|
|
203
212
|
architecto dolorem corrupti accusamus optio neque officia
|
|
204
213
|
perferendis molestiae.
|
|
205
214
|
</p>
|
|
215
|
+
<h3 className="s-font-semibold">6. Additional Terms</h3>
|
|
216
|
+
<p className="s-text-sm s-text-muted-foreground">
|
|
217
|
+
More content to make the dialog scrollable and test the fixed
|
|
218
|
+
search input functionality. Lorem ipsum dolor sit amet consectetur
|
|
219
|
+
adipisicing elit. Quod possimus sit modi reprehenderit sed dolorem
|
|
220
|
+
nisi nostrum.
|
|
221
|
+
</p>
|
|
206
222
|
</div>
|
|
207
223
|
</DialogContainer>
|
|
208
224
|
<DialogFooter
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import React, { useState } from "react";
|
|
3
3
|
|
|
4
|
+
import { SearchInput } from "@sparkle/components";
|
|
4
5
|
import { Button } from "@sparkle/components/Button";
|
|
5
6
|
import {
|
|
6
7
|
MultiPageDialog,
|
|
@@ -274,6 +275,7 @@ export const SimpleToolDialog: Story = {
|
|
|
274
275
|
</MultiPageDialogTrigger>
|
|
275
276
|
<MultiPageDialogContent
|
|
276
277
|
pages={toolPages}
|
|
278
|
+
showHeaderNavigation={false}
|
|
277
279
|
currentPageId="tool-selection"
|
|
278
280
|
onPageChange={() => {}}
|
|
279
281
|
size="xl"
|
|
@@ -709,6 +711,7 @@ export const ScrollableContent: Story = {
|
|
|
709
711
|
render: () => {
|
|
710
712
|
const [currentPageId, setCurrentPageId] = useState("long-form");
|
|
711
713
|
const [isOpen, setIsOpen] = useState(false);
|
|
714
|
+
const [searchTerm, setSearchTerm] = useState("");
|
|
712
715
|
|
|
713
716
|
const handleSave = () => {
|
|
714
717
|
alert("Long form submitted!");
|
|
@@ -738,8 +741,17 @@ export const ScrollableContent: Story = {
|
|
|
738
741
|
{
|
|
739
742
|
id: "long-form",
|
|
740
743
|
title: "Long Form Content",
|
|
741
|
-
description:
|
|
744
|
+
description:
|
|
745
|
+
"This page demonstrates scrollable content with fixed search",
|
|
742
746
|
icon: DocumentTextIcon,
|
|
747
|
+
fixedContent: (
|
|
748
|
+
<SearchInput
|
|
749
|
+
value={searchTerm}
|
|
750
|
+
onChange={setSearchTerm}
|
|
751
|
+
name="search-content"
|
|
752
|
+
placeholder="Search through content..."
|
|
753
|
+
/>
|
|
754
|
+
),
|
|
743
755
|
content: (
|
|
744
756
|
<div className="s-space-y-6">
|
|
745
757
|
<div>
|
|
@@ -748,9 +760,16 @@ export const ScrollableContent: Story = {
|
|
|
748
760
|
</h3>
|
|
749
761
|
<p className="s-text-sm s-text-muted-foreground">
|
|
750
762
|
This page contains a lot of content to demonstrate scrolling
|
|
751
|
-
functionality
|
|
752
|
-
|
|
763
|
+
functionality with a fixed search input. The search input stays
|
|
764
|
+
visible while scrolling through the content below.
|
|
753
765
|
</p>
|
|
766
|
+
{searchTerm && (
|
|
767
|
+
<div className="s-rounded-md s-border s-bg-yellow-50 s-p-3">
|
|
768
|
+
<p className="s-text-sm s-text-yellow-800">
|
|
769
|
+
🔍 Searching for: <strong>{searchTerm}</strong>
|
|
770
|
+
</p>
|
|
771
|
+
</div>
|
|
772
|
+
)}
|
|
754
773
|
</div>
|
|
755
774
|
|
|
756
775
|
{Array.from({ length: 15 }, (_, i) => (
|
|
@@ -793,12 +812,13 @@ export const ScrollableContent: Story = {
|
|
|
793
812
|
|
|
794
813
|
<div className="s-rounded-md s-border s-bg-blue-50 s-p-4">
|
|
795
814
|
<h4 className="s-mb-2 s-text-sm s-font-semibold s-text-blue-900">
|
|
796
|
-
|
|
815
|
+
Fixed Content Test Complete
|
|
797
816
|
</h4>
|
|
798
817
|
<p className="s-text-xs s-text-blue-700">
|
|
799
|
-
If you can see this message, the
|
|
800
|
-
working correctly! The
|
|
801
|
-
|
|
818
|
+
If you can see this message, the fixed content functionality is
|
|
819
|
+
working correctly! The search input remains fixed at the top
|
|
820
|
+
while this content scrolls. Try scrolling back up - the search
|
|
821
|
+
input should always be visible.
|
|
802
822
|
</p>
|
|
803
823
|
</div>
|
|
804
824
|
</div>
|
|
@@ -836,13 +856,14 @@ export const ScrollableContent: Story = {
|
|
|
836
856
|
return (
|
|
837
857
|
<MultiPageDialog open={isOpen} onOpenChange={setIsOpen}>
|
|
838
858
|
<MultiPageDialogTrigger asChild>
|
|
839
|
-
<Button label="Open
|
|
859
|
+
<Button label="Open Fixed Content Test Dialog" />
|
|
840
860
|
</MultiPageDialogTrigger>
|
|
841
861
|
<MultiPageDialogContent
|
|
842
862
|
pages={scrollablePages}
|
|
843
863
|
currentPageId={currentPageId}
|
|
844
864
|
onPageChange={setCurrentPageId}
|
|
845
|
-
size="
|
|
865
|
+
size="xl"
|
|
866
|
+
height="xl"
|
|
846
867
|
leftButton={{
|
|
847
868
|
label: "Cancel",
|
|
848
869
|
variant: "outline",
|