@dust-tt/sparkle 0.2.573 → 0.2.574

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dust-tt/sparkle",
3
- "version": "0.2.573",
3
+ "version": "0.2.574",
4
4
  "scripts": {
5
5
  "build": "rm -rf dist && npm run tailwind && npm run build:esm && npm run build:cjs",
6
6
  "tailwind": "tailwindcss -i ./src/styles/tailwind.css -o dist/sparkle.css",
@@ -1,14 +0,0 @@
1
- import React from "react";
2
- export interface MessageCardProps {
3
- className?: string;
4
- haveImage?: boolean;
5
- imageSrc?: string;
6
- announcementTitle?: string;
7
- announcementMessage: string;
8
- learnMoreHref?: string;
9
- onLearnMore?: () => void;
10
- onDismiss?: () => void;
11
- dismissible?: boolean;
12
- }
13
- export declare const MessageCard: React.ForwardRefExoticComponent<MessageCardProps & React.RefAttributes<HTMLDivElement>>;
14
- //# sourceMappingURL=AnnouncementCard.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnnouncementCard.d.ts","sourceRoot":"","sources":["../../../src/components/AnnouncementCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,WAAW,yFAsEvB,CAAC"}
@@ -1,25 +0,0 @@
1
- import { __assign, __rest } from "tslib";
2
- import React from "react";
3
- import { Button } from "../components/Button";
4
- import { cn } from "../lib/utils";
5
- export var MessageCard = React.forwardRef(function (_a, ref) {
6
- var className = _a.className, _b = _a.haveImage, haveImage = _b === void 0 ? false : _b, imageSrc = _a.imageSrc, _c = _a.announcementTitle, announcementTitle = _c === void 0 ? "New on Dust" : _c, announcementMessage = _a.announcementMessage, learnMoreHref = _a.learnMoreHref, onLearnMore = _a.onLearnMore, onDismiss = _a.onDismiss, _d = _a.dismissible, dismissible = _d === void 0 ? true : _d, props = __rest(_a, ["className", "haveImage", "imageSrc", "announcementTitle", "announcementMessage", "learnMoreHref", "onLearnMore", "onDismiss", "dismissible"]);
7
- var handleLearnMore = function () {
8
- if (onLearnMore) {
9
- onLearnMore();
10
- }
11
- else if (learnMoreHref) {
12
- window.open(learnMoreHref, "_blank", "noopener,noreferrer");
13
- }
14
- };
15
- return (React.createElement("div", __assign({ ref: ref, className: cn("s-flex s-flex-col s-overflow-hidden", "s-bg-white dark:s-bg-black", "s-rounded-2xl s-shadow-md", "s-border s-border-border/0 dark:s-border-border-night/0", className) }, props),
16
- haveImage && imageSrc && (React.createElement("div", { className: "s-relative s-h-48 s-overflow-hidden s-rounded-t-2xl s-bg-cover s-bg-center s-bg-no-repeat", style: { backgroundImage: "url(".concat(imageSrc, ")") } })),
17
- React.createElement("div", { className: "s-p-4" },
18
- React.createElement("div", { className: "s-mb-2 s-text-sm s-font-medium s-text-primary dark:s-text-primary-night" }, announcementTitle),
19
- React.createElement("h4", { className: "s-mb-4 s-text-lg s-font-medium s-leading-tight s-text-foreground dark:s-text-foreground-night" }, announcementMessage),
20
- React.createElement("div", { className: "s-flex s-items-center s-justify-between" },
21
- React.createElement(Button, { variant: "highlight", size: "sm", onClick: handleLearnMore, label: "Learn more" }),
22
- dismissible && onDismiss && (React.createElement(Button, { variant: "ghost", size: "sm", onClick: onDismiss, label: "Dismiss" }))))));
23
- });
24
- MessageCard.displayName = "MessageCard";
25
- //# sourceMappingURL=AnnouncementCard.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnnouncementCard.js","sourceRoot":"","sources":["../../../src/components/AnnouncementCard.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,EAAE,EAAE,MAAM,oBAAoB,CAAC;AAcxC,MAAM,CAAC,IAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CACzC,UACE,EAWC,EACD,GAAG;IAXD,IAAA,SAAS,eAAA,EACT,iBAAiB,EAAjB,SAAS,mBAAG,KAAK,KAAA,EACjB,QAAQ,cAAA,EACR,yBAAiC,EAAjC,iBAAiB,mBAAG,aAAa,KAAA,EACjC,mBAAmB,yBAAA,EACnB,aAAa,mBAAA,EACb,WAAW,iBAAA,EACX,SAAS,eAAA,EACT,mBAAkB,EAAlB,WAAW,mBAAG,IAAI,KAAA,EACf,KAAK,cAVV,8IAWC,CADS;IAIV,IAAM,eAAe,GAAG;QACtB,IAAI,WAAW,EAAE,CAAC;YAChB,WAAW,EAAE,CAAC;QAChB,CAAC;aAAM,IAAI,aAAa,EAAE,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,sCACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,qCAAqC,EACrC,4BAA4B,EAC5B,2BAA2B,EAC3B,yDAAyD,EACzD,SAAS,CACV,IACG,KAAK;QAER,SAAS,IAAI,QAAQ,IAAI,CACxB,6BACE,SAAS,EAAC,2FAA2F,EACrG,KAAK,EAAE,EAAE,eAAe,EAAE,cAAO,QAAQ,MAAG,EAAE,GAC9C,CACH;QAED,6BAAK,SAAS,EAAC,OAAO;YACpB,6BAAK,SAAS,EAAC,yEAAyE,IACrF,iBAAiB,CACd;YACN,4BAAI,SAAS,EAAC,+FAA+F,IAC1G,mBAAmB,CACjB;YACL,6BAAK,SAAS,EAAC,yCAAyC;gBACtD,oBAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,IAAI,EACT,OAAO,EAAE,eAAe,EACxB,KAAK,EAAC,YAAY,GAClB;gBACD,WAAW,IAAI,SAAS,IAAI,CAC3B,oBAAC,MAAM,IACL,OAAO,EAAC,OAAO,EACf,IAAI,EAAC,IAAI,EACT,OAAO,EAAE,SAAS,EAClB,KAAK,EAAC,SAAS,GACf,CACH,CACG,CACF,CACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC"}
@@ -1,8 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { MessageCard } from "../components/MessageCard";
3
- declare const meta: Meta<typeof MessageCard>;
4
- export default meta;
5
- type Story = StoryObj<typeof meta>;
6
- export declare const Default: Story;
7
- export declare const WithoutImage: Story;
8
- //# sourceMappingURL=AnnouncementCard.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnnouncementCard.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/AnnouncementCard.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAiDlC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAK1B,CAAC"}
@@ -1,60 +0,0 @@
1
- import { MessageCard } from "../components/MessageCard";
2
- var meta = {
3
- title: "Components/MessageCard",
4
- component: MessageCard,
5
- parameters: {
6
- layout: "centered",
7
- docs: {
8
- description: {
9
- component: "A dismissible message card component designed for sidebar usage, featuring an optional image section and a new feature announcement section.",
10
- },
11
- },
12
- },
13
- argTypes: {
14
- haveImage: {
15
- control: { type: "boolean" },
16
- description: "Whether to show an image in the top section",
17
- },
18
- imageSrc: {
19
- control: { type: "text" },
20
- description: "URL of the image to display in the top section",
21
- if: { arg: "haveImage", truthy: true },
22
- },
23
- announcementTitle: {
24
- control: { type: "text" },
25
- description: "Title for the announcement section",
26
- },
27
- announcementMessage: {
28
- control: { type: "text" },
29
- description: "The main announcement message",
30
- },
31
- dismissible: {
32
- control: { type: "boolean" },
33
- description: "Whether the card can be dismissed",
34
- },
35
- onDismiss: {
36
- description: "Callback when dismiss button is clicked",
37
- },
38
- },
39
- args: {
40
- haveImage: true,
41
- imageSrc: "https://blog.dust.tt/content/images/size/w2000/2025/05/cover.jpg",
42
- announcementTitle: "New on Dust",
43
- announcementMessage: "Create interactive content with Dust Shareables",
44
- dismissible: true,
45
- onDismiss: function () {
46
- alert("Dismiss clicked!");
47
- },
48
- },
49
- };
50
- export default meta;
51
- export var Default = {
52
- args: {},
53
- };
54
- export var WithoutImage = {
55
- args: {
56
- haveImage: false,
57
- imageSrc: undefined,
58
- },
59
- };
60
- //# sourceMappingURL=AnnouncementCard.stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnnouncementCard.stories.js","sourceRoot":"","sources":["../../../src/stories/AnnouncementCard.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,IAAM,IAAI,GAA6B;IACrC,KAAK,EAAE,wBAAwB;IAC/B,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,SAAS,EACP,8IAA8I;aACjJ;SACF;KACF;IACD,QAAQ,EAAE;QACR,SAAS,EAAE;YACT,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;YAC5B,WAAW,EAAE,6CAA6C;SAC3D;QACD,QAAQ,EAAE;YACR,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;YACzB,WAAW,EAAE,gDAAgD;YAC7D,EAAE,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE;SACvC;QACD,iBAAiB,EAAE;YACjB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;YACzB,WAAW,EAAE,oCAAoC;SAClD;QACD,mBAAmB,EAAE;YACnB,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;YACzB,WAAW,EAAE,+BAA+B;SAC7C;QACD,WAAW,EAAE;YACX,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;YAC5B,WAAW,EAAE,mCAAmC;SACjD;QACD,SAAS,EAAE;YACT,WAAW,EAAE,yCAAyC;SACvD;KACF;IACD,IAAI,EAAE;QACJ,SAAS,EAAE,IAAI;QACf,QAAQ,EACN,kEAAkE;QACpE,iBAAiB,EAAE,aAAa;QAChC,mBAAmB,EAAE,iDAAiD;QACtE,WAAW,EAAE,IAAI;QACjB,SAAS,EAAE;YACT,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAC5B,CAAC;KACF;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,IAAM,OAAO,GAAU;IAC5B,IAAI,EAAE,EAAE;CACT,CAAC;AAEF,MAAM,CAAC,IAAM,YAAY,GAAU;IACjC,IAAI,EAAE;QACJ,SAAS,EAAE,KAAK;QAChB,QAAQ,EAAE,SAAS;KACpB;CACF,CAAC"}
@@ -1,90 +0,0 @@
1
- import React from "react";
2
-
3
- import { Button } from "@sparkle/components/Button";
4
- import { cn } from "@sparkle/lib/utils";
5
-
6
- export interface MessageCardProps {
7
- className?: string;
8
- haveImage?: boolean;
9
- imageSrc?: string;
10
- announcementTitle?: string;
11
- announcementMessage: string;
12
- learnMoreHref?: string;
13
- onLearnMore?: () => void;
14
- onDismiss?: () => void;
15
- dismissible?: boolean;
16
- }
17
-
18
- export const MessageCard = React.forwardRef<HTMLDivElement, MessageCardProps>(
19
- (
20
- {
21
- className,
22
- haveImage = false,
23
- imageSrc,
24
- announcementTitle = "New on Dust",
25
- announcementMessage,
26
- learnMoreHref,
27
- onLearnMore,
28
- onDismiss,
29
- dismissible = true,
30
- ...props
31
- },
32
- ref
33
- ) => {
34
- const handleLearnMore = () => {
35
- if (onLearnMore) {
36
- onLearnMore();
37
- } else if (learnMoreHref) {
38
- window.open(learnMoreHref, "_blank", "noopener,noreferrer");
39
- }
40
- };
41
-
42
- return (
43
- <div
44
- ref={ref}
45
- className={cn(
46
- "s-flex s-flex-col s-overflow-hidden",
47
- "s-bg-white dark:s-bg-black",
48
- "s-rounded-2xl s-shadow-md",
49
- "s-border s-border-border/0 dark:s-border-border-night/0",
50
- className
51
- )}
52
- {...props}
53
- >
54
- {haveImage && imageSrc && (
55
- <div
56
- className="s-relative s-h-48 s-overflow-hidden s-rounded-t-2xl s-bg-cover s-bg-center s-bg-no-repeat"
57
- style={{ backgroundImage: `url(${imageSrc})` }}
58
- />
59
- )}
60
-
61
- <div className="s-p-4">
62
- <div className="s-mb-2 s-text-sm s-font-medium s-text-primary dark:s-text-primary-night">
63
- {announcementTitle}
64
- </div>
65
- <h4 className="s-mb-4 s-text-lg s-font-medium s-leading-tight s-text-foreground dark:s-text-foreground-night">
66
- {announcementMessage}
67
- </h4>
68
- <div className="s-flex s-items-center s-justify-between">
69
- <Button
70
- variant="highlight"
71
- size="sm"
72
- onClick={handleLearnMore}
73
- label="Learn more"
74
- />
75
- {dismissible && onDismiss && (
76
- <Button
77
- variant="ghost"
78
- size="sm"
79
- onClick={onDismiss}
80
- label="Dismiss"
81
- />
82
- )}
83
- </div>
84
- </div>
85
- </div>
86
- );
87
- }
88
- );
89
-
90
- MessageCard.displayName = "MessageCard";
@@ -1,68 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
-
3
- import { MessageCard } from "../components/MessageCard";
4
-
5
- const meta: Meta<typeof MessageCard> = {
6
- title: "Components/MessageCard",
7
- component: MessageCard,
8
- parameters: {
9
- layout: "centered",
10
- docs: {
11
- description: {
12
- component:
13
- "A dismissible message card component designed for sidebar usage, featuring an optional image section and a new feature announcement section.",
14
- },
15
- },
16
- },
17
- argTypes: {
18
- haveImage: {
19
- control: { type: "boolean" },
20
- description: "Whether to show an image in the top section",
21
- },
22
- imageSrc: {
23
- control: { type: "text" },
24
- description: "URL of the image to display in the top section",
25
- if: { arg: "haveImage", truthy: true },
26
- },
27
- announcementTitle: {
28
- control: { type: "text" },
29
- description: "Title for the announcement section",
30
- },
31
- announcementMessage: {
32
- control: { type: "text" },
33
- description: "The main announcement message",
34
- },
35
- dismissible: {
36
- control: { type: "boolean" },
37
- description: "Whether the card can be dismissed",
38
- },
39
- onDismiss: {
40
- description: "Callback when dismiss button is clicked",
41
- },
42
- },
43
- args: {
44
- haveImage: true,
45
- imageSrc:
46
- "https://blog.dust.tt/content/images/size/w2000/2025/05/cover.jpg",
47
- announcementTitle: "New on Dust",
48
- announcementMessage: "Create interactive content with Dust Shareables",
49
- dismissible: true,
50
- onDismiss: () => {
51
- alert("Dismiss clicked!");
52
- },
53
- },
54
- };
55
-
56
- export default meta;
57
- type Story = StoryObj<typeof meta>;
58
-
59
- export const Default: Story = {
60
- args: {},
61
- };
62
-
63
- export const WithoutImage: Story = {
64
- args: {
65
- haveImage: false,
66
- imageSrc: undefined,
67
- },
68
- };