@tangle-network/ui 11.50.2 → 11.50.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @tangle-network/ui
2
2
 
3
+ ## 11.50.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 7ff67c6: `Progress` passes its `value` to the Radix root, so the bar announces `aria-valuenow` and reads `data-state="loading"` or `"complete"`. Before this, a screen reader heard every bar as indeterminate whatever it showed.
8
+
3
9
  ## 11.50.2
4
10
 
5
11
  ### Patch Changes
@@ -18,6 +18,7 @@ const Progress = React.forwardRef(({ className, value, variant = "default", tone
18
18
  className: "relative",
19
19
  children: [/* @__PURE__ */ jsx(ProgressPrimitive.Root, {
20
20
  ref,
21
+ value,
21
22
  className: cn("relative h-2 w-full overflow-hidden rounded-full bg-muted", className),
22
23
  ...props,
23
24
  children: /* @__PURE__ */ jsx(ProgressPrimitive.Indicator, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/ui",
3
- "version": "11.50.2",
3
+ "version": "11.50.3",
4
4
  "description": "Generic React UI components for Tangle products — primitives, chat, run, files, editor, markdown.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -0,0 +1,22 @@
1
+ import { render, screen } from "@testing-library/react";
2
+ import { describe, expect, it } from "vitest";
3
+ import { Progress } from "./progress";
4
+
5
+ describe("Progress", () => {
6
+ it("announces its reading and reads complete at its maximum", () => {
7
+ render(
8
+ <>
9
+ <Progress value={10} aria-label="Seats used" />
10
+ <Progress value={100} tone="danger" aria-label="Projects used" />
11
+ </>,
12
+ );
13
+ const seats = screen.getByRole("progressbar", { name: "Seats used" });
14
+ expect(seats).toHaveAttribute("aria-valuenow", "10");
15
+ expect(seats).toHaveAttribute("aria-valuemax", "100");
16
+ expect(seats).toHaveAttribute("data-state", "loading");
17
+ expect(screen.getByRole("progressbar", { name: "Projects used" })).toHaveAttribute(
18
+ "data-state",
19
+ "complete",
20
+ );
21
+ });
22
+ });
@@ -33,6 +33,7 @@ const Progress = React.forwardRef<
33
33
  <div className="relative">
34
34
  <ProgressPrimitive.Root
35
35
  ref={ref}
36
+ value={value}
36
37
  className={cn(
37
38
  "relative h-2 w-full overflow-hidden rounded-full bg-muted",
38
39
  className,