@adecore/ui 0.50.7 → 0.52.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 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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
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 = clsx("shrink-0", t2);
29
- $[0] = t2;
30
- $[1] = t3;
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 = $[1];
40
+ t3 = $[2];
33
41
  }
34
42
  let t4;
35
- if ($[2] !== icon || $[3] !== t3) {
36
- t4 = /*#__PURE__*/_jsx(Icon, {
37
- icon: icon,
38
- size: 16,
39
- className: t3
43
+ if ($[3] !== message) {
44
+ t4 = /*#__PURE__*/_jsx("span", {
45
+ className: "min-w-0 grow",
46
+ children: message
40
47
  });
41
- $[2] = icon;
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] !== message) {
49
- t5 = /*#__PURE__*/_jsx("span", {
50
- className: "grow",
51
- children: message
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] = message;
54
- $[6] = t5;
59
+ $[5] = t3;
60
+ $[6] = t4;
61
+ $[7] = t5;
55
62
  } else {
56
- t5 = $[6];
63
+ t5 = $[7];
57
64
  }
58
65
  let t6;
59
- if ($[7] !== children || $[8] !== t4 || $[9] !== t5) {
66
+ if ($[8] !== children || $[9] !== t5) {
60
67
  t6 = /*#__PURE__*/_jsxs(_Fragment, {
61
- children: [t4, t5, children]
68
+ children: [t5, children]
62
69
  });
63
- $[7] = children;
64
- $[8] = t4;
70
+ $[8] = children;
65
71
  $[9] = t5;
66
72
  $[10] = t6;
67
73
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adecore/ui",
3
- "version": "0.50.7",
3
+ "version": "0.52.0",
4
4
  "description": "React components, a theme, formatters and a settings dialog for desktop-grade apps on React 19, Base UI and Tailwind 4.",
5
5
  "license": "FSL-1.1-MIT",
6
6
  "author": "Bas Milius",
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
- <Icon icon={icon} size={16} className={clsx('shrink-0', TONE[tone])} />
38
- <span className="grow">{message}</span>
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
  );