@newtone-dev/ui-react-web 0.20.0 → 0.21.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/avatar/avatar.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { ImgHTMLAttributes } from 'react';
|
|
2
2
|
export interface AvatarProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'alt'> {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Omitted, the avatar is its plate alone: no picture, no initials, no icon. For a person whose
|
|
5
|
+
* photograph has not arrived. Since 2026-10-01, react-web 0.21.0; avatar.md.
|
|
6
|
+
*/
|
|
7
|
+
src?: string;
|
|
4
8
|
/**
|
|
5
9
|
* Required, and by the type rather than by a runtime check -- the same strictness `Link` puts
|
|
6
10
|
* on `href`. A face with no name is the one thing this component must not let through, and an
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../src/avatar/avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAE7D,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC;IACjF,GAAG,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../src/avatar/avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAE7D,MAAM,WAAW,WAAY,SAAQ,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,EAAE,KAAK,CAAC;IACjF;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;;OAKG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,MAAM,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,WAAW,+BAmE1F"}
|
package/dist/avatar/avatar.js
CHANGED
|
@@ -33,6 +33,13 @@ export function Avatar({ src, alt, size, hoverSrc, className, style, ...rest })
|
|
|
33
33
|
// The diameter, written here since 2026-09-26 rather than declared by the caller's sheet: a
|
|
34
34
|
// consuming site declares no `--newtone-*` property (issue 201).
|
|
35
35
|
const sized = size === undefined ? style : { '--newtone-avatar-size': size, ...style };
|
|
36
|
+
// NO PICTURE IS A SPAN AND NOT AN `<img>` WITHOUT A SOURCE: each engine draws a sourceless
|
|
37
|
+
// `<img>` its own way -- an empty box, a broken-image glyph, nothing -- and none of them is the
|
|
38
|
+
// plate. `alt` keeps its meaning: a name makes the span an image named by it, and `""` hides it.
|
|
39
|
+
// `hoverSrc` has no rest picture to swap from, so it is ignored. avatar.md, *the plate alone*.
|
|
40
|
+
if (src === undefined) {
|
|
41
|
+
return (_jsx("span", { className: ['newtone-avatar', className].filter(Boolean).join(' '), style: sized, role: alt ? 'img' : undefined, "aria-label": alt || undefined, "aria-hidden": alt ? undefined : true }));
|
|
42
|
+
}
|
|
36
43
|
// TWO PICTURES ARE A SPAN, AND ONE IS STILL THE `<img>`, so every call site without `hoverSrc`
|
|
37
44
|
// renders exactly what it did. The plate moves to the span so it sits behind both; the caller's
|
|
38
45
|
// attributes stay on the rest picture, which is the one that carries the name. The hover picture
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.js","sourceRoot":"","sources":["../../src/avatar/avatar.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"avatar.js","sourceRoot":"","sources":["../../src/avatar/avatar.tsx"],"names":[],"mappings":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