@dust-tt/sparkle 0.2.446 → 0.2.448
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/AssistantCard.js +1 -1
- package/dist/esm/components/AssistantCard.js.map +1 -1
- package/dist/esm/components/AttachmentChip.d.ts +9 -0
- package/dist/esm/components/AttachmentChip.d.ts.map +1 -0
- package/dist/esm/components/AttachmentChip.js +10 -0
- package/dist/esm/components/AttachmentChip.js.map +1 -0
- package/dist/esm/components/Avatar.js +2 -2
- package/dist/esm/components/Avatar.js.map +1 -1
- package/dist/esm/components/BarHeader.js +1 -1
- package/dist/esm/components/BarHeader.js.map +1 -1
- package/dist/esm/components/Button.d.ts.map +1 -1
- package/dist/esm/components/Button.js +15 -9
- package/dist/esm/components/Button.js.map +1 -1
- package/dist/esm/components/Chip.d.ts.map +1 -1
- package/dist/esm/components/Chip.js +3 -2
- package/dist/esm/components/Chip.js.map +1 -1
- package/dist/esm/components/ContextItem.js +3 -3
- package/dist/esm/components/ContextItem.js.map +1 -1
- package/dist/esm/components/Dialog.js +1 -1
- package/dist/esm/components/Dialog.js.map +1 -1
- package/dist/esm/components/DropzoneOverlay.js +2 -2
- package/dist/esm/components/DropzoneOverlay.js.map +1 -1
- package/dist/esm/components/Page.js +10 -10
- package/dist/esm/components/Page.js.map +1 -1
- package/dist/esm/components/PriceTable.d.ts.map +1 -1
- package/dist/esm/components/PriceTable.js +3 -3
- package/dist/esm/components/PriceTable.js.map +1 -1
- package/dist/esm/components/Sheet.js +1 -1
- package/dist/esm/components/Sheet.js.map +1 -1
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/components/markdown/List.d.ts.map +1 -1
- package/dist/esm/components/markdown/List.js +1 -3
- package/dist/esm/components/markdown/List.js.map +1 -1
- package/dist/esm/components/markdown/Markdown.js +7 -7
- package/dist/esm/components/markdown/Markdown.js.map +1 -1
- package/dist/esm/stories/AttachmentChip.stories.d.ts +17 -0
- package/dist/esm/stories/AttachmentChip.stories.d.ts.map +1 -0
- package/dist/esm/stories/AttachmentChip.stories.js +63 -0
- package/dist/esm/stories/AttachmentChip.stories.js.map +1 -0
- package/dist/esm/stories/ConversationMessage.stories.js +1 -1
- package/dist/esm/stories/ConversationMessage.stories.js.map +1 -1
- package/dist/esm/stories/Typography.stories.d.ts.map +1 -1
- package/dist/esm/stories/Typography.stories.js +1 -0
- package/dist/esm/stories/Typography.stories.js.map +1 -1
- package/dist/sparkle.css +78 -90
- package/package.json +1 -1
- package/src/components/AssistantCard.tsx +1 -1
- package/src/components/AttachmentChip.tsx +33 -0
- package/src/components/Avatar.tsx +2 -2
- package/src/components/BarHeader.tsx +1 -1
- package/src/components/Button.tsx +18 -9
- package/src/components/Chip.tsx +7 -7
- package/src/components/ContextItem.tsx +3 -3
- package/src/components/Dialog.tsx +1 -1
- package/src/components/DropzoneOverlay.tsx +2 -2
- package/src/components/Page.tsx +10 -10
- package/src/components/PriceTable.tsx +6 -7
- package/src/components/Sheet.tsx +1 -1
- package/src/components/index.ts +1 -0
- package/src/components/markdown/List.tsx +1 -3
- package/src/components/markdown/Markdown.tsx +7 -7
- package/src/stories/AttachmentChip.stories.tsx +83 -0
- package/src/stories/ConversationMessage.stories.tsx +3 -2
- package/src/stories/Typography.stories.tsx +1 -0
package/src/components/Page.tsx
CHANGED
|
@@ -89,10 +89,10 @@ interface PagePProps {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
const PsizeClasses = {
|
|
92
|
-
xs: "s-
|
|
93
|
-
sm: "s-
|
|
94
|
-
md: "s-
|
|
95
|
-
lg: "s-
|
|
92
|
+
xs: "s-copy-xs",
|
|
93
|
+
sm: "s-copy-sm",
|
|
94
|
+
md: "s-copy-base",
|
|
95
|
+
lg: "s-copy-lg",
|
|
96
96
|
};
|
|
97
97
|
|
|
98
98
|
Page.P = function ({ children, variant, size = "sm" }: PagePProps) {
|
|
@@ -119,12 +119,12 @@ Page.H = function ({ children, variant = "h3" }: PageHProps) {
|
|
|
119
119
|
const Component = variant;
|
|
120
120
|
|
|
121
121
|
const hSizes = {
|
|
122
|
-
h1: "s-
|
|
123
|
-
h2: "s-
|
|
124
|
-
h3: "s-
|
|
125
|
-
h4: "s-
|
|
126
|
-
h5: "s-
|
|
127
|
-
h6: "s-
|
|
122
|
+
h1: "s-heading-4xl",
|
|
123
|
+
h2: "s-heading-3xl",
|
|
124
|
+
h3: "s-heading-2xl",
|
|
125
|
+
h4: "s-heading-xl",
|
|
126
|
+
h5: "s-heading-lg",
|
|
127
|
+
h6: "s-heading-base",
|
|
128
128
|
};
|
|
129
129
|
|
|
130
130
|
return (
|
|
@@ -90,8 +90,8 @@ export function PriceTable({
|
|
|
90
90
|
>
|
|
91
91
|
<div
|
|
92
92
|
className={classNames(
|
|
93
|
-
size === "xs" ? "s-
|
|
94
|
-
"s-w-full s-text-right
|
|
93
|
+
size === "xs" ? "s-heading-2xl" : "s-heading-3xl",
|
|
94
|
+
"s-w-full s-text-right",
|
|
95
95
|
"s-text-foreground"
|
|
96
96
|
)}
|
|
97
97
|
>
|
|
@@ -100,17 +100,16 @@ export function PriceTable({
|
|
|
100
100
|
<div className="-s-mt-2 s-flex s-flex-row s-items-baseline s-gap-2">
|
|
101
101
|
<span
|
|
102
102
|
className={classNames(
|
|
103
|
-
size === "xs" ? "s-
|
|
104
|
-
textColorTable[color]
|
|
105
|
-
"s-font-bold"
|
|
103
|
+
size === "xs" ? "s-heading-3xl" : "s-heading-4xl",
|
|
104
|
+
textColorTable[color]
|
|
106
105
|
)}
|
|
107
106
|
>
|
|
108
107
|
{price}
|
|
109
108
|
</span>
|
|
110
109
|
<span
|
|
111
110
|
className={classNames(
|
|
112
|
-
"s-
|
|
113
|
-
size === "xs" ? "s-
|
|
111
|
+
"s-text-foreground",
|
|
112
|
+
size === "xs" ? "s-heading-base" : "s-heading-lg"
|
|
114
113
|
)}
|
|
115
114
|
>
|
|
116
115
|
{priceLabel}
|
package/src/components/Sheet.tsx
CHANGED
|
@@ -221,7 +221,7 @@ const SheetTitle = React.forwardRef<
|
|
|
221
221
|
{icon && <Icon visual={icon} size="lg" className="s-text-foreground" />}
|
|
222
222
|
<SheetPrimitive.Title
|
|
223
223
|
ref={ref}
|
|
224
|
-
className={cn("s-
|
|
224
|
+
className={cn("s-heading-lg", className)}
|
|
225
225
|
{...props}
|
|
226
226
|
/>
|
|
227
227
|
</>
|
package/src/components/index.ts
CHANGED
|
@@ -43,9 +43,7 @@ export function OlBlock({
|
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export const liBlockVariants = cva([
|
|
47
|
-
"s-break-words first:s-pt-0 last:s-pb-0 s-py-1 @md:s-py-2",
|
|
48
|
-
]);
|
|
46
|
+
export const liBlockVariants = cva(["s-break-words first:s-pt-0 last:s-pb-0"]);
|
|
49
47
|
|
|
50
48
|
interface LiBlockProps {
|
|
51
49
|
children: React.ReactNode;
|
|
@@ -28,13 +28,13 @@ import { sanitizeContent } from "@sparkle/components/markdown/utils";
|
|
|
28
28
|
import { cn } from "@sparkle/lib/utils";
|
|
29
29
|
|
|
30
30
|
const sizes = {
|
|
31
|
-
p: "s-
|
|
32
|
-
h1: "s-
|
|
33
|
-
h2: "s-
|
|
34
|
-
h3: "s-
|
|
35
|
-
h4: "s-
|
|
36
|
-
h5: "s-text-base
|
|
37
|
-
h6: "s-text-
|
|
31
|
+
p: "s-copy-sm @sm:s-text-base @sm:s-leading-7",
|
|
32
|
+
h1: "s-heading-3xl",
|
|
33
|
+
h2: "s-heading-2xl",
|
|
34
|
+
h3: "s-heading-xl",
|
|
35
|
+
h4: "s-heading-lg",
|
|
36
|
+
h5: "s-text-base s-font-bold",
|
|
37
|
+
h6: "s-text-base s-font-regular s-italic",
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
function showUnsupportedDirective() {
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
import { AttachmentChip } from "@sparkle/components";
|
|
5
|
+
import { DocumentIcon, DocumentTextIcon } from "@sparkle/icons";
|
|
6
|
+
import { NotionLogo } from "@sparkle/logo";
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
title: "Components/AttachmentChip",
|
|
10
|
+
component: AttachmentChip,
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: "centered",
|
|
13
|
+
},
|
|
14
|
+
tags: ["autodocs"],
|
|
15
|
+
} satisfies Meta<typeof AttachmentChip>;
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
|
|
20
|
+
const ParagraphWrapper = ({ children }: { children: React.ReactNode }) => (
|
|
21
|
+
<div className="s-rounded-lg s-bg-primary-50 s-p-8 s-text-base">
|
|
22
|
+
<p className="s-mb-4 s-inline-flex s-items-center s-gap-2">
|
|
23
|
+
<span className="s-font-semibold s-text-highlight">@soupi</span> here is
|
|
24
|
+
an attachment {children} for you.
|
|
25
|
+
</p>
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export const Document: Story = {
|
|
30
|
+
args: {
|
|
31
|
+
label: "document.pdf",
|
|
32
|
+
icon: NotionLogo,
|
|
33
|
+
},
|
|
34
|
+
decorators: [
|
|
35
|
+
(Story) => (
|
|
36
|
+
<ParagraphWrapper>
|
|
37
|
+
<Story />
|
|
38
|
+
</ParagraphWrapper>
|
|
39
|
+
),
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const Image: Story = {
|
|
44
|
+
args: {
|
|
45
|
+
label: "image.jpg",
|
|
46
|
+
icon: NotionLogo,
|
|
47
|
+
},
|
|
48
|
+
decorators: [
|
|
49
|
+
(Story) => (
|
|
50
|
+
<ParagraphWrapper>
|
|
51
|
+
<Story />
|
|
52
|
+
</ParagraphWrapper>
|
|
53
|
+
),
|
|
54
|
+
],
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const Text: Story = {
|
|
58
|
+
args: {
|
|
59
|
+
label: "text.txt",
|
|
60
|
+
icon: DocumentTextIcon,
|
|
61
|
+
},
|
|
62
|
+
decorators: [
|
|
63
|
+
(Story) => (
|
|
64
|
+
<ParagraphWrapper>
|
|
65
|
+
<Story />
|
|
66
|
+
</ParagraphWrapper>
|
|
67
|
+
),
|
|
68
|
+
],
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const LongLabel: Story = {
|
|
72
|
+
args: {
|
|
73
|
+
label: "very_long_document_name_that_will_be_truncated.pdf",
|
|
74
|
+
icon: DocumentIcon,
|
|
75
|
+
},
|
|
76
|
+
decorators: [
|
|
77
|
+
(Story) => (
|
|
78
|
+
<ParagraphWrapper>
|
|
79
|
+
<Story />
|
|
80
|
+
</ParagraphWrapper>
|
|
81
|
+
),
|
|
82
|
+
],
|
|
83
|
+
};
|
|
@@ -102,10 +102,11 @@ export const ConversationExample = () => {
|
|
|
102
102
|
|
|
103
103
|
const example = `
|
|
104
104
|
# Level 1 Title
|
|
105
|
-
|
|
106
105
|
## Level 2 Title
|
|
107
|
-
|
|
108
106
|
### Level 3 Title
|
|
107
|
+
#### Level 4 Title
|
|
108
|
+
##### Level 5 Title
|
|
109
|
+
###### Level 6 Title
|
|
109
110
|
|
|
110
111
|
This is a paragraph with **bold** text and *italic* text. This is \`code\` block:
|
|
111
112
|
\`\`\`
|