@moontra/moonui 6.12.0 → 6.14.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.mts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.global.js +2 -2
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -1
- package/dist/index.mjs.map +1 -1
- package/dist/lib/theme.global.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/__tests__/avatar-image-alt.test.tsx +54 -0
- package/src/components/ui/__tests__/progress-accessible-name.test.tsx +65 -0
- package/src/components/ui/avatar.tsx +16 -1
- package/src/components/ui/progress.tsx +14 -0
package/dist/index.mjs
CHANGED
|
@@ -309,10 +309,11 @@ var Avatar = React12.forwardRef(({ className, size, radius, variant, ...props },
|
|
|
309
309
|
}
|
|
310
310
|
));
|
|
311
311
|
Avatar.displayName = AvatarPrimitive.Root.displayName;
|
|
312
|
-
var AvatarImage = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
312
|
+
var AvatarImage = React12.forwardRef(({ className, alt = "", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
313
313
|
AvatarPrimitive.Image,
|
|
314
314
|
{
|
|
315
315
|
ref,
|
|
316
|
+
alt,
|
|
316
317
|
className: cn("moonui-theme", "aspect-square h-full w-full", className),
|
|
317
318
|
...props
|
|
318
319
|
}
|
|
@@ -4886,6 +4887,7 @@ var Progress = React12.forwardRef(({
|
|
|
4886
4887
|
const normalizedValue = Math.max(0, Math.min(value, max));
|
|
4887
4888
|
const percentage = max > 0 ? normalizedValue / max * 100 : 0;
|
|
4888
4889
|
const label = valueLabel || `${Math.round(percentage)}%`;
|
|
4890
|
+
const hasExplicitName = props["aria-label"] != null || props["aria-labelledby"] != null;
|
|
4889
4891
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4890
4892
|
showValueLabel && /* @__PURE__ */ jsx("div", { className: "flex justify-between items-center mb-1", children: /* @__PURE__ */ jsx(
|
|
4891
4893
|
"span",
|
|
@@ -4906,6 +4908,8 @@ var Progress = React12.forwardRef(({
|
|
|
4906
4908
|
"aria-valuemin": 0,
|
|
4907
4909
|
"aria-valuemax": max,
|
|
4908
4910
|
"aria-valuenow": indeterminate ? void 0 : normalizedValue,
|
|
4911
|
+
"aria-label": hasExplicitName ? void 0 : "Progress",
|
|
4912
|
+
"aria-valuetext": valueLabel,
|
|
4909
4913
|
...props,
|
|
4910
4914
|
children: /* @__PURE__ */ jsx(
|
|
4911
4915
|
"div",
|