@dust-tt/sparkle 0.2.464 → 0.2.465-rc-2

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.
Files changed (34) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/esm/components/Breadcrumbs.d.ts +15 -3
  3. package/dist/esm/components/Breadcrumbs.d.ts.map +1 -1
  4. package/dist/esm/components/Breadcrumbs.js +18 -3
  5. package/dist/esm/components/Breadcrumbs.js.map +1 -1
  6. package/dist/esm/components/DataTable.d.ts +3 -2
  7. package/dist/esm/components/DataTable.d.ts.map +1 -1
  8. package/dist/esm/components/DataTable.js +4 -4
  9. package/dist/esm/components/DataTable.js.map +1 -1
  10. package/dist/esm/components/Dialog.d.ts +9 -2
  11. package/dist/esm/components/Dialog.d.ts.map +1 -1
  12. package/dist/esm/components/Dialog.js +24 -17
  13. package/dist/esm/components/Dialog.js.map +1 -1
  14. package/dist/esm/components/index.d.ts +1 -0
  15. package/dist/esm/components/index.d.ts.map +1 -1
  16. package/dist/esm/components/index.js.map +1 -1
  17. package/dist/esm/stories/Breadcrumbs.stories.js +1 -1
  18. package/dist/esm/stories/Breadcrumbs.stories.js.map +1 -1
  19. package/dist/esm/stories/DataTable.stories.d.ts.map +1 -1
  20. package/dist/esm/stories/DataTable.stories.js +1 -1
  21. package/dist/esm/stories/DataTable.stories.js.map +1 -1
  22. package/dist/esm/stories/Dialog.stories.d.ts +1 -0
  23. package/dist/esm/stories/Dialog.stories.d.ts.map +1 -1
  24. package/dist/esm/stories/Dialog.stories.js +49 -15
  25. package/dist/esm/stories/Dialog.stories.js.map +1 -1
  26. package/dist/sparkle.css +4 -4
  27. package/package.json +1 -1
  28. package/src/components/Breadcrumbs.tsx +64 -9
  29. package/src/components/DataTable.tsx +10 -0
  30. package/src/components/Dialog.tsx +65 -38
  31. package/src/components/index.ts +1 -0
  32. package/src/stories/Breadcrumbs.stories.tsx +1 -1
  33. package/src/stories/DataTable.stories.tsx +1 -0
  34. package/src/stories/Dialog.stories.tsx +75 -25
@@ -1,7 +1,7 @@
1
1
  import type { Meta, StoryObj } from "@storybook/react";
2
2
  import React from "react";
3
3
 
4
- import { Button } from "@sparkle/components";
4
+ import { Avatar, Button, Input } from "@sparkle/components";
5
5
 
6
6
  import {
7
7
  Dialog,
@@ -12,6 +12,7 @@ import {
12
12
  DialogHeader,
13
13
  DialogTitle,
14
14
  DialogTrigger,
15
+ SlackLogo,
15
16
  } from "../index_with_tw_base";
16
17
 
17
18
  const meta: Meta<typeof Dialog> = {
@@ -49,6 +50,58 @@ export const Basic: Story = {
49
50
  label: "Save Changes",
50
51
  variant: "highlight",
51
52
  }}
53
+ permanentValidation={{
54
+ label: "Don't ask again",
55
+ checked: false,
56
+ onChange: () => {},
57
+ }}
58
+ />
59
+ </DialogContent>
60
+ </Dialog>
61
+ ),
62
+ };
63
+
64
+ export const ToolValidation: Story = {
65
+ render: () => (
66
+ <Dialog>
67
+ <DialogTrigger asChild>
68
+ <Button label="Open Dialog" />
69
+ </DialogTrigger>
70
+ <DialogContent>
71
+ <DialogHeader>
72
+ <DialogTitle
73
+ visual={<Avatar size="xs" icon={SlackLogo} hexBgColor="#421D51" />}
74
+ >
75
+ Confirm tool usage
76
+ </DialogTitle>
77
+ </DialogHeader>
78
+ <DialogContainer>
79
+ <div>
80
+ Allow [Agent_name] to use the tool (
81
+ <span className="s-mono s-text-muted-foreground dark:s-text-muted-foreground-night">
82
+ [toolset_name]
83
+ </span>
84
+ ,
85
+ <span className="s-mono s-text-muted-foreground dark:s-text-muted-foreground-night">
86
+ [tool_name]
87
+ </span>
88
+ )?
89
+ </div>
90
+ </DialogContainer>
91
+ <DialogFooter
92
+ leftButtonProps={{
93
+ label: "Cancel",
94
+ variant: "outline",
95
+ }}
96
+ rightButtonProps={{
97
+ label: "Save Changes",
98
+ variant: "highlight",
99
+ }}
100
+ permanentValidation={{
101
+ label: "Always allow",
102
+ checked: false,
103
+ onChange: () => {},
104
+ }}
52
105
  />
53
106
  </DialogContent>
54
107
  </Dialog>
@@ -61,37 +114,29 @@ export const WithForm: Story = {
61
114
  <DialogTrigger asChild>
62
115
  <Button label="Edit User" />
63
116
  </DialogTrigger>
64
- <DialogContent size="lg">
117
+ <DialogContent>
65
118
  <DialogHeader>
66
119
  <DialogTitle>Edit User Settings</DialogTitle>
67
120
  </DialogHeader>
68
121
  <DialogContainer>
69
- <div className="s-grid s-gap-4 s-py-4">
70
- <div className="s-grid s-gap-2">
71
- <label className="s-text-sm s-font-semibold">Name</label>
72
- <input
73
- className="s-border-input s-rounded-md s-border s-bg-transparent s-px-3 s-py-1 s-text-sm"
74
- placeholder="Enter name..."
75
- />
76
- </div>
77
- <div className="s-grid s-gap-2">
78
- <label className="s-text-sm s-font-semibold">Email</label>
79
- <input
80
- className="s-border-input s-rounded-md s-border s-bg-transparent s-px-3 s-py-1 s-text-sm"
81
- placeholder="Enter email..."
82
- type="email"
83
- />
84
- </div>
122
+ <div className="s-grid s-gap-4">
123
+ <Input label="Email" placeholder="Email" />
124
+ <Input label="Username" placeholder="Username" />
85
125
  </div>
86
126
  </DialogContainer>
87
127
  <DialogFooter
88
128
  leftButtonProps={{
89
129
  label: "Cancel",
90
- variant: "ghost",
130
+ variant: "outline",
91
131
  }}
92
132
  rightButtonProps={{
93
133
  label: "Save",
94
- variant: "primary",
134
+ variant: "highlight",
135
+ }}
136
+ permanentValidation={{
137
+ label: "Don't ask again",
138
+ checked: false,
139
+ onChange: () => {},
95
140
  }}
96
141
  />
97
142
  </DialogContent>
@@ -108,20 +153,25 @@ export const AlertDialog: Story = {
108
153
  <DialogContent size="md">
109
154
  <DialogHeader>
110
155
  <DialogTitle>Are you absolutely sure?</DialogTitle>
111
- <DialogDescription>
112
- This action cannot be undone. This will permanently delete your
113
- account and remove your data from our servers.
114
- </DialogDescription>
115
156
  </DialogHeader>
157
+ <DialogContainer>
158
+ This action cannot be undone. This will permanently delete your
159
+ account and remove your data from our servers.
160
+ </DialogContainer>
116
161
  <DialogFooter
117
162
  leftButtonProps={{
118
163
  label: "Cancel",
119
- variant: "ghost",
164
+ variant: "outline",
120
165
  }}
121
166
  rightButtonProps={{
122
167
  label: "Delete Account",
123
168
  variant: "warning",
124
169
  }}
170
+ permanentValidation={{
171
+ label: "Don't ask again",
172
+ checked: false,
173
+ onChange: () => {},
174
+ }}
125
175
  />
126
176
  </DialogContent>
127
177
  </Dialog>