@moontra/moonui 6.12.0 → 6.13.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/hooks/index.global.js +29 -0
- package/dist/hooks/index.global.js.map +1 -1
- package/dist/index.global.js +1 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/__tests__/progress-accessible-name.test.tsx +65 -0
- package/src/components/ui/progress.tsx +14 -0
package/dist/index.js
CHANGED
|
@@ -4924,6 +4924,7 @@ var Progress = React12__namespace.forwardRef(({
|
|
|
4924
4924
|
const normalizedValue = Math.max(0, Math.min(value, max));
|
|
4925
4925
|
const percentage = max > 0 ? normalizedValue / max * 100 : 0;
|
|
4926
4926
|
const label = valueLabel || `${Math.round(percentage)}%`;
|
|
4927
|
+
const hasExplicitName = props["aria-label"] != null || props["aria-labelledby"] != null;
|
|
4927
4928
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4928
4929
|
showValueLabel && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-between items-center mb-1", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4929
4930
|
"span",
|
|
@@ -4944,6 +4945,8 @@ var Progress = React12__namespace.forwardRef(({
|
|
|
4944
4945
|
"aria-valuemin": 0,
|
|
4945
4946
|
"aria-valuemax": max,
|
|
4946
4947
|
"aria-valuenow": indeterminate ? void 0 : normalizedValue,
|
|
4948
|
+
"aria-label": hasExplicitName ? void 0 : "Progress",
|
|
4949
|
+
"aria-valuetext": valueLabel,
|
|
4947
4950
|
...props,
|
|
4948
4951
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4949
4952
|
"div",
|