Skip to content

Commit

Permalink
feat: wrapped CircularProgress
Browse files Browse the repository at this point in the history
feat: wrapped CircularProgress
  • Loading branch information
jordankoschei-okta authored Apr 11, 2023
1 parent 67bef8c commit fda8978
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
24 changes: 24 additions & 0 deletions packages/odyssey-react-mui/src/CircularProgress.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*!
* Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and limitations under the License.
*/

import { CircularProgress as MuiCircularProgress } from "@mui/material";

export type CircularProgressProps = {
value?: number;
};

export const CircularProgress = ({ value }: CircularProgressProps) => (
<MuiCircularProgress
value={value}
variant={value ? "determinate" : "indeterminate"}
/>
);
3 changes: 1 addition & 2 deletions packages/odyssey-react-mui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export {
Box,
Button,
Chip,
CircularProgress,
createTheme,
CssBaseline,
Dialog,
Expand Down Expand Up @@ -69,7 +68,6 @@ export type {
BoxProps,
ButtonProps,
ChipProps,
CircularProgressProps,
CssBaselineProps,
DialogProps,
DialogActionsProps,
Expand Down Expand Up @@ -127,6 +125,7 @@ export { deepmerge, visuallyHidden } from "@mui/utils";
export * from "./Banner";
export * from "./Checkbox";
export * from "./CheckboxGroup";
export * from "./CircularProgress";
export * from "./createUniqueId";
export * from "./Icon";
export * from "./iconDictionary";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@ export default {
},
},
argTypes: {
variant: {
options: ["indeterminate", "determinate"],
control: { type: "radio" },
},
value: {
control: { type: "number" },
defaultValue: undefined,
},
},
decorators: [MuiThemeDecorator],
Expand All @@ -48,6 +45,5 @@ Indeterminate.args = {};

export const Determinate = Template.bind({});
Determinate.args = {
variant: "determinate",
value: 70,
};

0 comments on commit fda8978

Please sign in to comment.