Skip to content

Commit 32ed908

Browse files
authored
Merge branch 'main' into forman-41-Switch
2 parents c6aecdb + 5743653 commit 32ed908

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

chartlets.js/CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
- using `return` object with `schema` property for callback return values
3939

4040
* New (MUI) components
41+
- `LinearProgress`
4142
- `Switch`
4243

4344
## Version 0.0.29 (from 2024/11/26)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { describe, it, expect } from "vitest";
2+
import { render, screen } from "@testing-library/react";
3+
import { LinearProgress } from "./LinearProgress";
4+
5+
describe("LinearProgress", () => {
6+
it("should render the LinearProgress component", () => {
7+
render(
8+
<LinearProgress
9+
type="LinearProgress"
10+
id="cp"
11+
value={75}
12+
onChange={() => {}}
13+
/>,
14+
);
15+
// to inspect rendered component, do:
16+
// expect(document.querySelector("#cp")).toEqual({});
17+
expect(screen.getByRole("progressbar")).not.toBeUndefined();
18+
});
19+
});
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import MuiLinearProgress from "@mui/material/LinearProgress";
2+
3+
import type { ComponentState, ComponentProps } from "@/index";
4+
5+
interface LinearProgressState extends ComponentState {
6+
value?: number;
7+
valueBuffer?: number;
8+
variant?: "determinate" | "indeterminate" | "buffer" | "query";
9+
}
10+
11+
interface LinearProgressProps extends ComponentProps, LinearProgressState {}
12+
13+
export function LinearProgress({
14+
id,
15+
style,
16+
value,
17+
variant,
18+
}: LinearProgressProps) {
19+
return (
20+
<MuiLinearProgress id={id} style={style} value={value} variant={variant} />
21+
);
22+
}

0 commit comments

Comments
 (0)