@versini/ui-bubble 6.3.2 → 6.4.0
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/index.d.ts +11 -1
- package/dist/index.js +33 -10
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSX } from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
-
export declare const Bubble: ({ children, kind, className, contentClassName, footer, rawFooter, copyToClipboard, copyToClipboardFocusMode, copyToClipboardMode, noMaxWidth, tail, }: BubbleProps) => JSX.Element;
|
|
3
|
+
export declare const Bubble: ({ children, kind, className, contentClassName, footer, rawFooter, copyToClipboard, copyToClipboardFocusMode, copyToClipboardMode, noMaxWidth, tail, gradient, }: BubbleProps) => JSX.Element;
|
|
4
4
|
|
|
5
5
|
export declare const BUBBLE_CLASSNAME = "av-bubble";
|
|
6
6
|
|
|
@@ -60,6 +60,16 @@ export declare type BubbleProps = {
|
|
|
60
60
|
footer?: {
|
|
61
61
|
[key: string]: string | number | undefined | null;
|
|
62
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* The gradient intensity applied to the Bubble background.
|
|
65
|
+
* - "light": Subtle gradient with 80% opacity at the top
|
|
66
|
+
* - "medium": Medium gradient with 65% opacity at the top
|
|
67
|
+
* - "strong": Strong gradient with 50% opacity at the top
|
|
68
|
+
* - undefined: No gradient, solid background color
|
|
69
|
+
*
|
|
70
|
+
* @default undefined
|
|
71
|
+
*/
|
|
72
|
+
gradient?: "light" | "medium" | "strong";
|
|
63
73
|
/**
|
|
64
74
|
* The type of Bubble. This will change the color of the Bubble
|
|
65
75
|
* as well as the chevron location.
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
@versini/ui-bubble v6.
|
|
2
|
+
@versini/ui-bubble v6.4.0
|
|
3
3
|
© 2025 gizmette.com
|
|
4
4
|
*/
|
|
5
5
|
try {
|
|
6
6
|
if (!window.__VERSINI_UI_BUBBLE__) {
|
|
7
7
|
window.__VERSINI_UI_BUBBLE__ = {
|
|
8
|
-
version: "6.
|
|
9
|
-
buildTime: "11/
|
|
8
|
+
version: "6.4.0",
|
|
9
|
+
buildTime: "11/05/2025 08:07 PM EST",
|
|
10
10
|
homepage: "https://github.com/aversini/ui-components",
|
|
11
11
|
license: "MIT",
|
|
12
12
|
};
|
|
@@ -43,10 +43,31 @@ const getBubbleSizesClasses = ({ kind, noMaxWidth })=>{
|
|
|
43
43
|
"lg:max-w-3xl": kind === "left" && !noMaxWidth
|
|
44
44
|
});
|
|
45
45
|
};
|
|
46
|
-
const getBubbleColorClasses = ({ kind })=>{
|
|
46
|
+
const getBubbleColorClasses = ({ kind, gradient })=>{
|
|
47
|
+
// No gradient - solid colors
|
|
48
|
+
if (!gradient) {
|
|
49
|
+
return clsx({
|
|
50
|
+
"bg-surface-light dark:bg-surface-dark": kind === "left",
|
|
51
|
+
"bg-surface-accent": kind === "right"
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
// Gradient presets based on intensity
|
|
55
|
+
if (gradient === "light") {
|
|
56
|
+
return clsx({
|
|
57
|
+
"bg-gradient-to-b from-surface-light/80 to-surface-light dark:from-surface-dark/80 dark:to-surface-dark": kind === "left",
|
|
58
|
+
"bg-gradient-to-b from-surface-accent/80 to-surface-accent": kind === "right"
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
if (gradient === "medium") {
|
|
62
|
+
return clsx({
|
|
63
|
+
"bg-gradient-to-b from-surface-light/65 to-surface-light dark:from-surface-dark/65 dark:to-surface-dark": kind === "left",
|
|
64
|
+
"bg-gradient-to-b from-surface-accent/65 to-surface-accent": kind === "right"
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
// gradient === "strong"
|
|
47
68
|
return clsx({
|
|
48
|
-
"bg-surface-light dark:
|
|
49
|
-
"bg-surface-accent": kind === "right"
|
|
69
|
+
"bg-gradient-to-b from-surface-light/50 to-surface-light dark:from-surface-dark/50 dark:to-surface-dark": kind === "left",
|
|
70
|
+
"bg-gradient-to-b from-surface-accent/50 to-surface-accent": kind === "right"
|
|
50
71
|
});
|
|
51
72
|
};
|
|
52
73
|
const getBubbleTypographyClasses = ({ kind })=>{
|
|
@@ -68,7 +89,7 @@ const getBubbleBorderClasses = ({ kind, tail })=>{
|
|
|
68
89
|
});
|
|
69
90
|
}
|
|
70
91
|
};
|
|
71
|
-
const getBubbleClasses = ({ kind, className, contentClassName, noMaxWidth, tail })=>{
|
|
92
|
+
const getBubbleClasses = ({ kind, className, contentClassName, noMaxWidth, tail, gradient })=>{
|
|
72
93
|
const wrapper = clsx(BUBBLE_CLASSNAME, `${BUBBLE_CLASSNAME}-${kind}`, "flex items-start", {
|
|
73
94
|
"flex-row-reverse": kind === "right"
|
|
74
95
|
}, className);
|
|
@@ -78,7 +99,8 @@ const getBubbleClasses = ({ kind, className, contentClassName, noMaxWidth, tail
|
|
|
78
99
|
}), getBubbleTypographyClasses({
|
|
79
100
|
kind
|
|
80
101
|
}), getBubbleColorClasses({
|
|
81
|
-
kind
|
|
102
|
+
kind,
|
|
103
|
+
gradient
|
|
82
104
|
}), getBubbleBorderClasses({
|
|
83
105
|
kind,
|
|
84
106
|
tail
|
|
@@ -106,14 +128,15 @@ const getBubbleClasses = ({ kind, className, contentClassName, noMaxWidth, tail
|
|
|
106
128
|
|
|
107
129
|
// Special symbol to represent an empty footer row that should maintain its height
|
|
108
130
|
const BUBBLE_FOOTER_EMPTY = "FOOTER_EMPTY";
|
|
109
|
-
const Bubble = ({ children, kind = "left", className, contentClassName, footer, rawFooter, copyToClipboard, copyToClipboardFocusMode = "system", copyToClipboardMode = "system", noMaxWidth = false, tail = false })=>{
|
|
131
|
+
const Bubble = ({ children, kind = "left", className, contentClassName, footer, rawFooter, copyToClipboard, copyToClipboardFocusMode = "system", copyToClipboardMode = "system", noMaxWidth = false, tail = false, gradient })=>{
|
|
110
132
|
const [copied, setCopied] = useState(false);
|
|
111
133
|
const bubbleClasses = getBubbleClasses({
|
|
112
134
|
kind,
|
|
113
135
|
className,
|
|
114
136
|
contentClassName,
|
|
115
137
|
noMaxWidth,
|
|
116
|
-
tail
|
|
138
|
+
tail,
|
|
139
|
+
gradient
|
|
117
140
|
});
|
|
118
141
|
const isCopyToClipboardEnabled = Boolean(copyToClipboard) && (typeof copyToClipboard === "function" || typeof copyToClipboard === "string" || typeof children === "string");
|
|
119
142
|
// copy to clipboard function
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versini/ui-bubble",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Arno Versini",
|
|
6
6
|
"publishConfig": {
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"sideEffects": [
|
|
51
51
|
"**/*.css"
|
|
52
52
|
],
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "5d1f1fb9e759b875e7829b857494f1397ec14f4e"
|
|
54
54
|
}
|