@dust-tt/sparkle 0.2.146 → 0.2.147

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.
@@ -0,0 +1,7 @@
1
+ import type { Emoji, EmojiMartData as EmojiData, Skin as EmojiSkin } from "@emoji-mart/data";
2
+ export type EmojiSkinType = Pick<Emoji, "id" | "name" | "keywords"> & {
3
+ native: string;
4
+ shortcodes: string;
5
+ unified: string;
6
+ };
7
+ export { EmojiData, EmojiSkin };
@@ -0,0 +1,17 @@
1
+ export type AvatarBackgroundColorType = `bg-${string}`;
2
+ /**
3
+ * This helper extracts emojis and background color from a Dust url.
4
+ * URL structure is defined as such:
5
+ * https://{host}/emojis/bg-{backgroundColor}/{id}/{unified}.
6
+ */
7
+ export declare function getEmojiAndBackgroundFromUrl(url: string): {
8
+ backgroundColor: `bg-${string}`;
9
+ id: string;
10
+ unified: string;
11
+ skinEmoji: string;
12
+ } | null;
13
+ export declare function createEmojiAndBackgroundUrlSuffix({ backgroundColor, id, unified, }: {
14
+ backgroundColor: AvatarBackgroundColorType;
15
+ id: string;
16
+ unified: string;
17
+ }): string;
@@ -1,5 +1,7 @@
1
1
  import { SparkleContext } from "./context";
2
2
  export { SparkleContext };
3
+ import * as avatarUtils from "./lib/avatar/utils";
4
+ export { avatarUtils };
3
5
  import { Div3D, Hover3D } from "./components/Hover3D";
4
6
  export { Div3D, Hover3D };
5
7
  import { Hoverable } from "./components/Hoverable";
@@ -8,6 +10,8 @@ import { Button } from "./components/Button";
8
10
  export { Button };
9
11
  import { CardButton } from "./components/CardButton";
10
12
  export { CardButton };
13
+ import { EmojiPicker } from "./components/EmojiPicker";
14
+ export { EmojiPicker };
11
15
  import { SliderToggle } from "./components/SliderToggle";
12
16
  export { SliderToggle };
13
17
  import { Collapsible } from "./components/Collapsible";
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- interface ColorPickerProps {
3
- onColorSelect: (color: string) => void;
4
- colors: string[];
2
+ interface ColorPickerProps<T extends string> {
3
+ onColorSelect: (color: T) => void;
4
+ colors: T[];
5
5
  }
6
- export declare function ColorPicker({ colors, onColorSelect }: ColorPickerProps): React.JSX.Element;
6
+ export declare function ColorPicker<T extends string>({ colors, onColorSelect, }: ColorPickerProps<T>): React.JSX.Element;
7
7
  export {};
@@ -0,0 +1,16 @@
1
+ import type { EmojiMartData } from "@emoji-mart/data";
2
+ import React from "react";
3
+ import { EmojiSkinType } from "@sparkle/lib/avatar/types";
4
+ interface EmojiPickerProps {
5
+ data?: EmojiMartData;
6
+ onEmojiSelect: (emoji: EmojiSkinType) => void;
7
+ previewPosition?: "none";
8
+ theme: "dark" | "light";
9
+ }
10
+ export declare function EmojiPicker({ data, onEmojiSelect, previewPosition, theme, }: EmojiPickerProps): React.JSX.Element;
11
+ export declare namespace EmojiPicker {
12
+ var defaults: {
13
+ previewPosition: string;
14
+ };
15
+ }
16
+ export {};