@dust-tt/sparkle 0.2.68-alpha → 0.2.68-alpha-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.
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
interface BannerProps {
|
|
3
|
+
allowDismiss: boolean;
|
|
3
4
|
classNames: string;
|
|
4
5
|
ctaLabel?: string;
|
|
5
6
|
hidden: boolean;
|
|
6
7
|
label: string;
|
|
7
8
|
onClick?: () => void;
|
|
9
|
+
onDismiss?: () => void;
|
|
8
10
|
title: string;
|
|
9
11
|
}
|
|
10
12
|
export declare function Banner(props: BannerProps): React.JSX.Element;
|
|
11
13
|
export declare namespace Banner {
|
|
12
14
|
var defaultProps: {
|
|
15
|
+
allowDismiss: boolean;
|
|
13
16
|
classNames: string;
|
|
14
17
|
hidden: boolean;
|
|
15
18
|
};
|
package/dist/esm/index.js
CHANGED
|
@@ -32281,6 +32281,7 @@ function AssistantPreview(props) {
|
|
|
32281
32281
|
|
|
32282
32282
|
// Define defaultProps for the Banner component.
|
|
32283
32283
|
Banner.defaultProps = {
|
|
32284
|
+
allowDismiss: true,
|
|
32284
32285
|
classNames: "",
|
|
32285
32286
|
hidden: false,
|
|
32286
32287
|
};
|
|
@@ -32296,7 +32297,12 @@ function Banner(props) {
|
|
|
32296
32297
|
props.label),
|
|
32297
32298
|
props.ctaLabel && (React__default.createElement(Button, { label: props.ctaLabel, variant: "tertiary", onClick: props.onClick }))),
|
|
32298
32299
|
React__default.createElement("div", { className: "s-flex s-flex-1 s-justify-end" },
|
|
32299
|
-
React__default.createElement("a", { className: "focus-visible:outline-offset-[-4px] s--m-3 s-p-3", onClick: function () {
|
|
32300
|
+
React__default.createElement("a", { className: "focus-visible:outline-offset-[-4px] s--m-3 s-p-3", onClick: function () {
|
|
32301
|
+
setIsDismissed(true);
|
|
32302
|
+
if (props.onDismiss) {
|
|
32303
|
+
props.onDismiss();
|
|
32304
|
+
}
|
|
32305
|
+
} },
|
|
32300
32306
|
React__default.createElement("span", { className: "s-sr-only" }, "Dismiss"),
|
|
32301
32307
|
React__default.createElement(SvgXMark$1, { className: "s-h-5 s-w-5 s-text-white", "aria-hidden": "true" })))));
|
|
32302
32308
|
}
|