@cocso-ui/react 1.2.0 → 1.2.1
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.
|
@@ -5,13 +5,20 @@ import { ComponentProps } from 'react';
|
|
|
5
5
|
type ProgressVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info";
|
|
6
6
|
type ProgressSize = "sm" | "md" | "lg";
|
|
7
7
|
interface ProgressProps extends ComponentProps<"div"> {
|
|
8
|
+
/**
|
|
9
|
+
* Accessible name. `role="progressbar"` is invalid without one — a screen
|
|
10
|
+
* reader announces a bar and nothing about what it measures — and the
|
|
11
|
+
* library cannot know it, so this defaults the way `Spinner` does rather
|
|
12
|
+
* than leaving the role unnamed.
|
|
13
|
+
*/
|
|
14
|
+
label?: string;
|
|
8
15
|
max?: number;
|
|
9
16
|
size?: ProgressSize;
|
|
10
17
|
value: number;
|
|
11
18
|
variant?: ProgressVariant;
|
|
12
19
|
}
|
|
13
20
|
/** Determinate progress indicator showing completion percentage. */
|
|
14
|
-
declare function Progress({ ref, className, style, variant, size, value, max, ...props }: ProgressProps): react_jsx_runtime.JSX.Element;
|
|
21
|
+
declare function Progress({ ref, className, style, variant, size, value, max, label, ...props }: ProgressProps): react_jsx_runtime.JSX.Element;
|
|
15
22
|
|
|
16
23
|
export { Progress };
|
|
17
24
|
export type { ProgressProps, ProgressSize, ProgressVariant };
|
|
@@ -15,11 +15,13 @@ function Progress({
|
|
|
15
15
|
size = "md",
|
|
16
16
|
value,
|
|
17
17
|
max = 100,
|
|
18
|
+
label = "Progress",
|
|
18
19
|
...props
|
|
19
20
|
}) {
|
|
20
21
|
const safeMax = max > 0 ? max : 100;
|
|
21
22
|
const percentage = Math.min(100, Math.max(0, value / safeMax * 100));
|
|
22
23
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
24
|
+
"aria-label": label,
|
|
23
25
|
"aria-valuemax": safeMax,
|
|
24
26
|
"aria-valuemin": 0,
|
|
25
27
|
"aria-valuenow": Math.min(Math.max(0, value), safeMax),
|
|
@@ -5,13 +5,20 @@ import { ComponentProps } from 'react';
|
|
|
5
5
|
type ProgressVariant = "primary" | "secondary" | "success" | "danger" | "warning" | "info";
|
|
6
6
|
type ProgressSize = "sm" | "md" | "lg";
|
|
7
7
|
interface ProgressProps extends ComponentProps<"div"> {
|
|
8
|
+
/**
|
|
9
|
+
* Accessible name. `role="progressbar"` is invalid without one — a screen
|
|
10
|
+
* reader announces a bar and nothing about what it measures — and the
|
|
11
|
+
* library cannot know it, so this defaults the way `Spinner` does rather
|
|
12
|
+
* than leaving the role unnamed.
|
|
13
|
+
*/
|
|
14
|
+
label?: string;
|
|
8
15
|
max?: number;
|
|
9
16
|
size?: ProgressSize;
|
|
10
17
|
value: number;
|
|
11
18
|
variant?: ProgressVariant;
|
|
12
19
|
}
|
|
13
20
|
/** Determinate progress indicator showing completion percentage. */
|
|
14
|
-
declare function Progress({ ref, className, style, variant, size, value, max, ...props }: ProgressProps): react_jsx_runtime.JSX.Element;
|
|
21
|
+
declare function Progress({ ref, className, style, variant, size, value, max, label, ...props }: ProgressProps): react_jsx_runtime.JSX.Element;
|
|
15
22
|
|
|
16
23
|
export { Progress };
|
|
17
24
|
export type { ProgressProps, ProgressSize, ProgressVariant };
|
|
@@ -12,11 +12,13 @@ function Progress({
|
|
|
12
12
|
size = "md",
|
|
13
13
|
value,
|
|
14
14
|
max = 100,
|
|
15
|
+
label = "Progress",
|
|
15
16
|
...props
|
|
16
17
|
}) {
|
|
17
18
|
const safeMax = max > 0 ? max : 100;
|
|
18
19
|
const percentage = Math.min(100, Math.max(0, value / safeMax * 100));
|
|
19
20
|
return /*#__PURE__*/jsx("div", {
|
|
21
|
+
"aria-label": label,
|
|
20
22
|
"aria-valuemax": safeMax,
|
|
21
23
|
"aria-valuemin": 0,
|
|
22
24
|
"aria-valuenow": Math.min(Math.max(0, value), safeMax),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocso-ui/react",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cocso/cocso-ui.git",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"@types/react": "^19.2.14",
|
|
50
50
|
"@types/react-dom": "^19.2.3",
|
|
51
51
|
"@vitest/coverage-v8": "^4.1.2",
|
|
52
|
+
"axe-core": "^4.13.0",
|
|
52
53
|
"jsdom": "^28.1.0",
|
|
53
54
|
"react": "^19.2.4",
|
|
54
55
|
"rollup": "^4.60.1",
|