frosted-ui 0.0.1-canary.87 → 0.0.1-canary.89
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/dist/cjs/components/tooltip/tooltip.js +1 -1
- package/dist/cjs/helpers/emoji-colors.d.ts +20 -0
- package/dist/cjs/helpers/emoji-colors.js +1897 -0
- package/dist/cjs/helpers/emoji-colors.js.map +1 -0
- package/dist/cjs/helpers/index.d.ts +1 -0
- package/dist/cjs/helpers/index.js +1 -0
- package/dist/cjs/helpers/index.js.map +1 -1
- package/dist/esm/components/tooltip/tooltip.js +1 -1
- package/dist/esm/helpers/emoji-colors.d.ts +20 -0
- package/dist/esm/helpers/emoji-colors.js +1893 -0
- package/dist/esm/helpers/emoji-colors.js.map +1 -0
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +1 -0
- package/dist/esm/helpers/index.js.map +1 -1
- package/package.json +10 -2
- package/styles.css +17 -17
|
@@ -22,7 +22,7 @@ const Tooltip = (props) => {
|
|
|
22
22
|
React.createElement(radix_ui_1.Tooltip.Portal, { container: container, forceMount: forceMount },
|
|
23
23
|
React.createElement(theme_1.Theme, { asChild: true },
|
|
24
24
|
React.createElement(radix_ui_1.Tooltip.Content, { sideOffset: 4, collisionPadding: 10, ...tooltipContentProps, className: (0, classnames_1.default)('fui-TooltipContent', className) },
|
|
25
|
-
React.createElement(text_1.Text, { as: "p", className: "fui-TooltipText", size: "
|
|
25
|
+
React.createElement(text_1.Text, { as: "p", className: "fui-TooltipText", size: "2" }, content),
|
|
26
26
|
React.createElement(radix_ui_1.Tooltip.Arrow, { className: "fui-TooltipArrow" }))))));
|
|
27
27
|
};
|
|
28
28
|
exports.Tooltip = Tooltip;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { radixColorScales } from './radix-colors';
|
|
2
|
+
export type ColorScale = (typeof radixColorScales)[number] | 'gray';
|
|
3
|
+
/**
|
|
4
|
+
* Maps emojis to their corresponding color scale in the Frosted UI color system.
|
|
5
|
+
* The color is determined by analyzing the dominant color of the emoji and matching
|
|
6
|
+
* it to the closest color-9 shade in our color palette.
|
|
7
|
+
*/
|
|
8
|
+
export declare const emojiColorMap: Record<string, ColorScale>;
|
|
9
|
+
/**
|
|
10
|
+
* Gets the color scale for a given emoji.
|
|
11
|
+
* Returns `undefined` if the emoji is not found, allowing developers to provide their own fallback.
|
|
12
|
+
*
|
|
13
|
+
* @param emoji - The emoji string to look up
|
|
14
|
+
* @returns The corresponding ColorScale or `undefined` if not found
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* const color = getColorForEmoji('❤️') ?? 'gray'; // Use 'gray' as fallback
|
|
18
|
+
* const color = getColorForEmoji('❤️') || 'red'; // Use 'red' as fallback
|
|
19
|
+
*/
|
|
20
|
+
export declare function getColorForEmoji(emoji: string): ColorScale | undefined;
|