@selectwin/kit 0.1.251 → 0.1.253
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/SelectAvatar.d.ts +3 -1
- package/dist/SelectAvatar.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/SelectAvatar.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ type SelectAvatarOwnProps = {
|
|
|
21
21
|
};
|
|
22
22
|
export type SelectAvatarProps = SelectAvatarOwnProps & Omit<ComponentPropsWithoutRef<'span'>, keyof SelectAvatarOwnProps>;
|
|
23
23
|
export declare const SelectAvatar: import('react').ForwardRefExoticComponent<SelectAvatarOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref">, keyof SelectAvatarOwnProps> & import('react').RefAttributes<HTMLSpanElement>>;
|
|
24
|
-
/** The letters that stand for a name: the first letter, or first + last word's first letters.
|
|
24
|
+
/** The letters that stand for a name: the first letter, or first + last word's first letters.
|
|
25
|
+
* Só letra e número contam (0.1.253): "Plataform (main)" → "PM", não "P(" — o parêntese, a aspa e o traço solto
|
|
26
|
+
* não são inicial, e a palavra que é só pontuação ("—", "&") não conta. */
|
|
25
27
|
export declare function avatarInitials(name: string | undefined, count?: 1 | 2): string;
|
|
26
28
|
export {};
|
package/dist/SelectAvatar.js
CHANGED
|
@@ -23,7 +23,7 @@ var r = e(function({ name: e, src: r, icon: a, dashed: o = !1, round: s = !1, si
|
|
|
23
23
|
});
|
|
24
24
|
});
|
|
25
25
|
function i(e, t = 1) {
|
|
26
|
-
let n = (e ?? "").trim().split(/\s+/).filter(Boolean);
|
|
26
|
+
let n = (e ?? "").trim().split(/\s+/).map((e) => e.replace(/[^\p{L}\p{M}\p{N}]/gu, "")).filter(Boolean);
|
|
27
27
|
if (n.length === 0) return "?";
|
|
28
28
|
let r = n[0][0].toUpperCase();
|
|
29
29
|
return t === 1 || n.length === 1 ? r : r + n[n.length - 1][0].toUpperCase();
|