@adecore/ui 0.50.7 → 0.51.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/Banner.js +30 -24
- package/package.json +1 -1
- package/src/Banner.tsx +7 -2
package/dist/Banner.js
CHANGED
|
@@ -2,7 +2,7 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { Icon } from "./Icon.js";
|
|
4
4
|
import { Surface } from "./Surface.js";
|
|
5
|
-
import { jsx as _jsx,
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
6
6
|
const TONE = {
|
|
7
7
|
attention: 'text-status-needs-you',
|
|
8
8
|
error: 'text-status-error',
|
|
@@ -24,44 +24,50 @@ export function Banner(t0) {
|
|
|
24
24
|
const placement = t1 === undefined ? "overlay" : t1;
|
|
25
25
|
const t2 = TONE[tone];
|
|
26
26
|
let t3;
|
|
27
|
-
if ($[0] !== t2) {
|
|
28
|
-
t3 =
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
if ($[0] !== icon || $[1] !== t2) {
|
|
28
|
+
t3 = /*#__PURE__*/_jsx("span", {
|
|
29
|
+
className: "flex h-(--text-sm--line-height) shrink-0 items-center",
|
|
30
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
31
|
+
icon: icon,
|
|
32
|
+
size: 16,
|
|
33
|
+
className: t2
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
$[0] = icon;
|
|
37
|
+
$[1] = t2;
|
|
38
|
+
$[2] = t3;
|
|
31
39
|
} else {
|
|
32
|
-
t3 = $[
|
|
40
|
+
t3 = $[2];
|
|
33
41
|
}
|
|
34
42
|
let t4;
|
|
35
|
-
if ($[
|
|
36
|
-
t4 = /*#__PURE__*/_jsx(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
className: t3
|
|
43
|
+
if ($[3] !== message) {
|
|
44
|
+
t4 = /*#__PURE__*/_jsx("span", {
|
|
45
|
+
className: "min-w-0 grow",
|
|
46
|
+
children: message
|
|
40
47
|
});
|
|
41
|
-
$[
|
|
42
|
-
$[3] = t3;
|
|
48
|
+
$[3] = message;
|
|
43
49
|
$[4] = t4;
|
|
44
50
|
} else {
|
|
45
51
|
t4 = $[4];
|
|
46
52
|
}
|
|
47
53
|
let t5;
|
|
48
|
-
if ($[5] !==
|
|
49
|
-
t5 = /*#__PURE__*/
|
|
50
|
-
className: "grow",
|
|
51
|
-
children:
|
|
54
|
+
if ($[5] !== t3 || $[6] !== t4) {
|
|
55
|
+
t5 = /*#__PURE__*/_jsxs("span", {
|
|
56
|
+
className: "flex min-w-0 grow items-start gap-3",
|
|
57
|
+
children: [t3, t4]
|
|
52
58
|
});
|
|
53
|
-
$[5] =
|
|
54
|
-
$[6] =
|
|
59
|
+
$[5] = t3;
|
|
60
|
+
$[6] = t4;
|
|
61
|
+
$[7] = t5;
|
|
55
62
|
} else {
|
|
56
|
-
t5 = $[
|
|
63
|
+
t5 = $[7];
|
|
57
64
|
}
|
|
58
65
|
let t6;
|
|
59
|
-
if ($[
|
|
66
|
+
if ($[8] !== children || $[9] !== t5) {
|
|
60
67
|
t6 = /*#__PURE__*/_jsxs(_Fragment, {
|
|
61
|
-
children: [
|
|
68
|
+
children: [t5, children]
|
|
62
69
|
});
|
|
63
|
-
$[
|
|
64
|
-
$[8] = t4;
|
|
70
|
+
$[8] = children;
|
|
65
71
|
$[9] = t5;
|
|
66
72
|
$[10] = t6;
|
|
67
73
|
} else {
|
package/package.json
CHANGED
package/src/Banner.tsx
CHANGED
|
@@ -34,8 +34,13 @@ export interface BannerProps {
|
|
|
34
34
|
export function Banner({ icon, tone, message, children, placement = 'overlay', className, ref }: BannerProps) {
|
|
35
35
|
const line = (
|
|
36
36
|
<>
|
|
37
|
-
|
|
38
|
-
<span className="grow">
|
|
37
|
+
{/* The mark sits at the first line, so a message that wraps does not pull it down to its middle. */}
|
|
38
|
+
<span className="flex min-w-0 grow items-start gap-3">
|
|
39
|
+
<span className="flex h-(--text-sm--line-height) shrink-0 items-center">
|
|
40
|
+
<Icon icon={icon} size={16} className={TONE[tone]} />
|
|
41
|
+
</span>
|
|
42
|
+
<span className="min-w-0 grow">{message}</span>
|
|
43
|
+
</span>
|
|
39
44
|
{children}
|
|
40
45
|
</>
|
|
41
46
|
);
|