@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/cjs/index.js CHANGED
@@ -32301,6 +32301,7 @@ function AssistantPreview(props) {
32301
32301
 
32302
32302
  // Define defaultProps for the Banner component.
32303
32303
  Banner.defaultProps = {
32304
+ allowDismiss: true,
32304
32305
  classNames: "",
32305
32306
  hidden: false,
32306
32307
  };
@@ -32316,7 +32317,12 @@ function Banner(props) {
32316
32317
  props.label),
32317
32318
  props.ctaLabel && (React.createElement(Button, { label: props.ctaLabel, variant: "tertiary", onClick: props.onClick }))),
32318
32319
  React.createElement("div", { className: "s-flex s-flex-1 s-justify-end" },
32319
- React.createElement("a", { className: "focus-visible:outline-offset-[-4px] s--m-3 s-p-3", onClick: function () { return setIsDismissed(true); } },
32320
+ React.createElement("a", { className: "focus-visible:outline-offset-[-4px] s--m-3 s-p-3", onClick: function () {
32321
+ setIsDismissed(true);
32322
+ if (props.onDismiss) {
32323
+ props.onDismiss();
32324
+ }
32325
+ } },
32320
32326
  React.createElement("span", { className: "s-sr-only" }, "Dismiss"),
32321
32327
  React.createElement(SvgXMark$1, { className: "s-h-5 s-w-5 s-text-white", "aria-hidden": "true" })))));
32322
32328
  }