Skip to content

Commit a0398eb

Browse files
committed
added CircularProgress to demo how to add new built-in components
1 parent 481f12b commit a0398eb

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import MuiCircularProgress from "@mui/material/CircularProgress";
2+
3+
import { type ComponentState } from "@/lib/types/state/component";
4+
import type { ComponentProps } from "@/lib/component/Component";
5+
6+
interface CircularProgressState extends ComponentState {
7+
size?: number | string;
8+
value?: number;
9+
variant?: "determinate" | "indeterminate";
10+
}
11+
12+
interface CircularProgressProps extends ComponentProps, CircularProgressState {}
13+
14+
export function CircularProgress({
15+
id,
16+
style,
17+
size,
18+
value,
19+
variant,
20+
}: CircularProgressProps) {
21+
return (
22+
<MuiCircularProgress
23+
id={id}
24+
style={style}
25+
size={size}
26+
value={value}
27+
variant={variant}
28+
/>
29+
);
30+
}

chartlets.js/src/lib/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,15 @@ import { registry } from "@/lib/component/Registry";
4040
import { Box } from "@/lib/components/Box";
4141
import { Button } from "@/lib/components/Button";
4242
import { Checkbox } from "@/lib/components/Checkbox";
43+
import { CircularProgress } from "@/lib/components/CircularProgress";
4344
import { Plot } from "@/lib/components/Plot";
4445
import { Select } from "@/lib/components/Select";
4546
import { Typography } from "@/lib/components/Typography";
4647

4748
registry.register(Box);
4849
registry.register(Button);
4950
registry.register(Checkbox);
51+
registry.register(CircularProgress);
5052
registry.register(Plot);
5153
registry.register(Select);
5254
registry.register(Typography);

0 commit comments

Comments
 (0)