@dust-tt/sparkle 0.2.211 → 0.2.213

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.211",
3
+ "version": "0.2.213",
4
4
  "scripts": {
5
5
  "build": "rm -rf dist && rollup -c",
6
6
  "build:with-tw-base": "rollup -c --environment INCLUDE_TW_BASE:true",
@@ -5,10 +5,12 @@ import { classNames } from "@sparkle/lib/utils";
5
5
 
6
6
  import { Icon } from "./Icon";
7
7
 
8
+ export type CheckBoxCheckedStatus = "checked" | "unchecked" | "partial";
9
+
8
10
  export interface CheckboxProps {
9
11
  variant?: "selectable" | "checkable";
10
12
  size?: "xs" | "sm";
11
- checked?: "checked" | "unchecked" | "partial";
13
+ checked?: CheckBoxCheckedStatus;
12
14
  disabled?: boolean;
13
15
  onChange: (checked: boolean) => void;
14
16
  className?: string;
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, { ComponentType } from "react";
2
2
 
3
3
  import { classNames } from "@sparkle/lib/utils";
4
4
 
@@ -19,6 +19,7 @@ export interface ContentMessageProps {
19
19
  | "pink"
20
20
  | "action"
21
21
  | "red";
22
+ icon?: ComponentType;
22
23
  }
23
24
 
24
25
  export function ContentMessage({
@@ -27,6 +28,7 @@ export function ContentMessage({
27
28
  children,
28
29
  size = "md",
29
30
  className = "",
31
+ icon,
30
32
  }: ContentMessageProps) {
31
33
  const variantClasses = {
32
34
  border: `s-border-${variant}-200`,
@@ -52,7 +54,7 @@ export function ContentMessage({
52
54
  <>
53
55
  <Icon
54
56
  size="md"
55
- visual={InformationCircleIcon}
57
+ visual={icon ?? InformationCircleIcon}
56
58
  className={classNames("s-shrink-0", variantClasses.iconColor)}
57
59
  />
58
60
  <div className="s-flex s-flex-col s-gap-2">
@@ -177,7 +177,7 @@ Tree.Item = function ({
177
177
  }}
178
178
  />
179
179
  )}
180
- {type === "leaf" && <div className="s-w-5"></div>}
180
+ {type === "leaf" && <div className="s-w-4"></div>}
181
181
  {checkbox && <Checkbox {...checkbox} size="xs" />}
182
182
  <Icon
183
183
  visual={visual}
@@ -1,7 +1,7 @@
1
1
  import type { Meta } from "@storybook/react";
2
2
  import React from "react";
3
3
 
4
- import { ContentMessage } from "../index_with_tw_base";
4
+ import { ContentMessage, HeartIcon } from "../index_with_tw_base";
5
5
 
6
6
  const meta = {
7
7
  title: "Components/ContentMessage",
@@ -19,8 +19,8 @@ export const ContentExample = () => (
19
19
  <ContentMessage title="This is a title" variant="pink">
20
20
  This is a message. It can be multiple lines long.
21
21
  </ContentMessage>
22
- <ContentMessage title="This is a title" variant="emerald">
23
- This is a message. It can be multiple lines long.
22
+ <ContentMessage title="This is a cat" variant="purple" icon={HeartIcon}>
23
+ This is a Soupinou. It is cute.
24
24
  </ContentMessage>
25
25
  <h2>Size "sm"</h2>
26
26
  <ContentMessage title="This is a title" size="sm">