@availity/mui-progress 0.5.0 → 1.0.0-alpha.0

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
@@ -2,6 +2,27 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.0.0-alpha.0](https://github.com/Availity/element/compare/@availity/mui-progress@0.5.1...@availity/mui-progress@1.0.0-alpha.0) (2025-02-24)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * upgraded to @mui/material v6
11
+ * **element:** upgraded to @mui/material v6
12
+
13
+ ### Features
14
+
15
+ * **element:** upgrade to @mui/material v6 ([cb958bb](https://github.com/Availity/element/commit/cb958bba99a4f1ee6dab323f0ff54b69e6fd3493))
16
+ * upgrade @mui/material ([571453a](https://github.com/Availity/element/commit/571453a34b21c344594ab4c03bc497d19aba942b))
17
+ * upgrade to MUI v6 ([7febd6f](https://github.com/Availity/element/commit/7febd6fd4fd58e87e1c97a832cea3b4595a35d58))
18
+
19
+ ## [0.5.1](https://github.com/Availity/element/compare/@availity/mui-progress@0.5.0...@availity/mui-progress@0.5.1) (2025-02-19)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * **mui-progress:** allow hiding of percentge ([168da9b](https://github.com/Availity/element/commit/168da9bfa7af44089cea27317e0d6ad9a057db3d))
25
+
5
26
  ## [0.5.0](https://github.com/Availity/element/compare/@availity/mui-progress@0.4.5...@availity/mui-progress@0.5.0) (2025-02-04)
6
27
 
7
28
  ### Dependency Updates
package/dist/index.d.mts CHANGED
@@ -28,7 +28,9 @@ type StatusIconProps = {
28
28
  };
29
29
  declare const CircularProgress: ({ loadingCaption, error, success, size, ...props }: CircularProgressProps) => JSX.Element;
30
30
 
31
- type LinearProgressProps = Omit<LinearProgressProps$1, 'color'>;
32
- declare const LinearProgress: ({ variant, value, sx, ...props }: LinearProgressProps) => react_jsx_runtime.JSX.Element;
31
+ type LinearProgressProps = Omit<LinearProgressProps$1, 'color'> & {
32
+ hidePercentage?: boolean;
33
+ };
34
+ declare const LinearProgress: ({ variant, value, sx, hidePercentage, ...props }: LinearProgressProps) => react_jsx_runtime.JSX.Element;
33
35
 
34
36
  export { CircularProgress, type CircularProgressProps, LinearProgress, type LinearProgressProps, type StatusIconProps };
package/dist/index.d.ts CHANGED
@@ -28,7 +28,9 @@ type StatusIconProps = {
28
28
  };
29
29
  declare const CircularProgress: ({ loadingCaption, error, success, size, ...props }: CircularProgressProps) => JSX.Element;
30
30
 
31
- type LinearProgressProps = Omit<LinearProgressProps$1, 'color'>;
32
- declare const LinearProgress: ({ variant, value, sx, ...props }: LinearProgressProps) => react_jsx_runtime.JSX.Element;
31
+ type LinearProgressProps = Omit<LinearProgressProps$1, 'color'> & {
32
+ hidePercentage?: boolean;
33
+ };
34
+ declare const LinearProgress: ({ variant, value, sx, hidePercentage, ...props }: LinearProgressProps) => react_jsx_runtime.JSX.Element;
33
35
 
34
36
  export { CircularProgress, type CircularProgressProps, LinearProgress, type LinearProgressProps, type StatusIconProps };
package/dist/index.js CHANGED
@@ -57,12 +57,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
57
57
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
58
58
 
59
59
  // src/index.ts
60
- var src_exports = {};
61
- __export(src_exports, {
60
+ var index_exports = {};
61
+ __export(index_exports, {
62
62
  CircularProgress: () => CircularProgress,
63
63
  LinearProgress: () => LinearProgress
64
64
  });
65
- module.exports = __toCommonJS(src_exports);
65
+ module.exports = __toCommonJS(index_exports);
66
66
 
67
67
  // src/lib/CircularProgress.tsx
68
68
  var import_react = require("react");
@@ -109,7 +109,7 @@ var CircularProgress = (_a) => {
109
109
  setStatus("loading");
110
110
  }
111
111
  }, [error, success]);
112
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Stack.default, { width: "fit-content", alignItems: "center", children: [
112
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Stack.default, { sx: { width: "fit-content", alignItems: "center" }, children: [
113
113
  status === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
114
114
  import_CircularProgress.default,
115
115
  __spreadProps(__spreadValues({
@@ -119,7 +119,7 @@ var CircularProgress = (_a) => {
119
119
  variant: "indeterminate"
120
120
  })
121
121
  ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusIcon, { status, size }),
122
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_typography.Typography, { marginTop: "8px", variant: "caption", children: loadingCaption || error || success ? getCaptionText(status) : null })
122
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_typography.Typography, { sx: { marginTop: "8px" }, variant: "caption", children: loadingCaption || error || success ? getCaptionText(status) : null })
123
123
  ] });
124
124
  };
125
125
 
@@ -139,7 +139,7 @@ var import_Container = __toESM(require("@mui/material/Container"));
139
139
  var import_jsx_runtime3 = require("react/jsx-runtime");
140
140
 
141
141
  // ../layout/src/lib/Grid.tsx
142
- var import_Unstable_Grid2 = __toESM(require("@mui/material/Unstable_Grid2"));
142
+ var import_Grid2 = __toESM(require("@mui/material/Grid2"));
143
143
  var import_jsx_runtime4 = require("react/jsx-runtime");
144
144
 
145
145
  // ../layout/src/lib/Stack.tsx
@@ -155,11 +155,11 @@ var import_mui_typography2 = require("@availity/mui-typography");
155
155
  var import_LinearProgress = __toESM(require("@mui/material/LinearProgress"));
156
156
  var import_jsx_runtime6 = require("react/jsx-runtime");
157
157
  var LinearProgress = (_a) => {
158
- var _b = _a, { variant = "determinate", value = 0, sx } = _b, props = __objRest(_b, ["variant", "value", "sx"]);
159
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Stack2, { direction: "row", alignItems: "center", children: [
158
+ var _b = _a, { variant = "determinate", value = 0, sx, hidePercentage = false } = _b, props = __objRest(_b, ["variant", "value", "sx", "hidePercentage"]);
159
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Stack2, { direction: "row", sx: { alignItems: "center" }, children: [
160
160
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Box, { sx: { width: "100%", mr: 0.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_LinearProgress.default, __spreadProps(__spreadValues({ variant }, props), { value, color: "success", sx: __spreadValues({ width: "100%" }, sx) })) }),
161
161
  value === 100 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_mui_icon2.SuccessCircleIcon, { color: "success", "data-icon": "complete" }),
162
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_mui_typography2.Typography, { variant: "body2", sx: { color: "text.secondary", ml: 1 }, children: `${Math.round(value)}%` })
162
+ !hidePercentage && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_mui_typography2.Typography, { variant: "body2", sx: { color: "text.secondary", ml: 1 }, children: `${Math.round(value)}%` })
163
163
  ] });
164
164
  };
165
165
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.mjs CHANGED
@@ -77,7 +77,7 @@ var CircularProgress = (_a) => {
77
77
  setStatus("loading");
78
78
  }
79
79
  }, [error, success]);
80
- return /* @__PURE__ */ jsxs(Stack, { width: "fit-content", alignItems: "center", children: [
80
+ return /* @__PURE__ */ jsxs(Stack, { sx: { width: "fit-content", alignItems: "center" }, children: [
81
81
  status === "loading" ? /* @__PURE__ */ jsx(
82
82
  MuiCircularProgress,
83
83
  __spreadProps(__spreadValues({
@@ -87,7 +87,7 @@ var CircularProgress = (_a) => {
87
87
  variant: "indeterminate"
88
88
  })
89
89
  ) : /* @__PURE__ */ jsx(StatusIcon, { status, size }),
90
- /* @__PURE__ */ jsx(Typography, { marginTop: "8px", variant: "caption", children: loadingCaption || error || success ? getCaptionText(status) : null })
90
+ /* @__PURE__ */ jsx(Typography, { sx: { marginTop: "8px" }, variant: "caption", children: loadingCaption || error || success ? getCaptionText(status) : null })
91
91
  ] });
92
92
  };
93
93
 
@@ -107,7 +107,7 @@ import MuiContainer from "@mui/material/Container";
107
107
  import { jsx as jsx3 } from "react/jsx-runtime";
108
108
 
109
109
  // ../layout/src/lib/Grid.tsx
110
- import MuiGrid2 from "@mui/material/Unstable_Grid2";
110
+ import MuiGrid2 from "@mui/material/Grid2";
111
111
  import { jsx as jsx4 } from "react/jsx-runtime";
112
112
 
113
113
  // ../layout/src/lib/Stack.tsx
@@ -123,11 +123,11 @@ import { Typography as Typography2 } from "@availity/mui-typography";
123
123
  import MuiLinearProgress from "@mui/material/LinearProgress";
124
124
  import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
125
125
  var LinearProgress = (_a) => {
126
- var _b = _a, { variant = "determinate", value = 0, sx } = _b, props = __objRest(_b, ["variant", "value", "sx"]);
127
- return /* @__PURE__ */ jsxs2(Stack2, { direction: "row", alignItems: "center", children: [
126
+ var _b = _a, { variant = "determinate", value = 0, sx, hidePercentage = false } = _b, props = __objRest(_b, ["variant", "value", "sx", "hidePercentage"]);
127
+ return /* @__PURE__ */ jsxs2(Stack2, { direction: "row", sx: { alignItems: "center" }, children: [
128
128
  /* @__PURE__ */ jsx6(Box, { sx: { width: "100%", mr: 0.5 }, children: /* @__PURE__ */ jsx6(MuiLinearProgress, __spreadProps(__spreadValues({ variant }, props), { value, color: "success", sx: __spreadValues({ width: "100%" }, sx) })) }),
129
129
  value === 100 && /* @__PURE__ */ jsx6(SuccessCircleIcon2, { color: "success", "data-icon": "complete" }),
130
- /* @__PURE__ */ jsx6(Typography2, { variant: "body2", sx: { color: "text.secondary", ml: 1 }, children: `${Math.round(value)}%` })
130
+ !hidePercentage && /* @__PURE__ */ jsx6(Typography2, { variant: "body2", sx: { color: "text.secondary", ml: 1 }, children: `${Math.round(value)}%` })
131
131
  ] });
132
132
  };
133
133
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/mui-progress",
3
- "version": "0.5.0",
3
+ "version": "1.0.0-alpha.0",
4
4
  "description": "Availity MUI Progress Component - part of the @availity/element design system",
5
5
  "keywords": [
6
6
  "react",
@@ -40,21 +40,21 @@
40
40
  "publish:canary": "yarn npm publish --access public --tag canary"
41
41
  },
42
42
  "devDependencies": {
43
- "@mui/material": "^5.15.15",
43
+ "@mui/material": "^6.4.5",
44
44
  "react": "18.2.0",
45
45
  "react-dom": "18.2.0",
46
- "tsup": "^8.0.2",
46
+ "tsup": "^8.3.6",
47
47
  "typescript": "^5.4.5"
48
48
  },
49
49
  "peerDependencies": {
50
- "@mui/material": "^5.11.9",
50
+ "@mui/material": "^6.4.5",
51
51
  "react": ">=16.3.0"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  },
56
56
  "dependencies": {
57
- "@availity/mui-icon": "^0.14.0",
58
- "@availity/mui-typography": "^0.3.0"
57
+ "@availity/mui-icon": "^1.0.0-alpha.0",
58
+ "@availity/mui-typography": "^1.0.0-alpha.0"
59
59
  }
60
60
  }
@@ -52,7 +52,7 @@ const getCaptionText = (status: string) =>
52
52
  loading: 'Loading',
53
53
  error: 'Loading error',
54
54
  success: 'Loading successful',
55
- }[status] || '');
55
+ })[status] || '';
56
56
 
57
57
  export const CircularProgress = ({
58
58
  loadingCaption = true,
@@ -74,7 +74,7 @@ export const CircularProgress = ({
74
74
  }, [error, success]);
75
75
 
76
76
  return (
77
- <Stack width="fit-content" alignItems="center">
77
+ <Stack sx={{ width: 'fit-content', alignItems: 'center' }}>
78
78
  {status === 'loading' ? (
79
79
  <MuiCircularProgress
80
80
  aria-label="Loading"
@@ -85,7 +85,7 @@ export const CircularProgress = ({
85
85
  ) : (
86
86
  <StatusIcon status={status} size={size} />
87
87
  )}
88
- <Typography marginTop="8px" variant="caption">
88
+ <Typography sx={{ marginTop: '8px' }} variant="caption">
89
89
  {loadingCaption || error || success ? getCaptionText(status) : null}
90
90
  </Typography>
91
91
  </Stack>
@@ -25,4 +25,9 @@ describe('LinearProgress', () => {
25
25
  expect(screen.getByText('100%')).toBeDefined();
26
26
  expect(svgEl.classList.toString()).toContain('MuiSvgIcon-root');
27
27
  });
28
+
29
+ test('should not show value as percentage for indeterminate', () => {
30
+ render(<LinearProgress hidePercentage value={50} />);
31
+ expect(screen.queryByText('50%')).toBeNull();
32
+ });
28
33
  });
@@ -3,16 +3,18 @@ import { Box, Stack } from '@availity/mui-layout';
3
3
  import { Typography } from '@availity/mui-typography';
4
4
  import MuiLinearProgress, { LinearProgressProps as MuiLinearProgressProps } from '@mui/material/LinearProgress';
5
5
 
6
- export type LinearProgressProps = Omit<MuiLinearProgressProps, 'color'>;
6
+ export type LinearProgressProps = Omit<MuiLinearProgressProps, 'color'> & { hidePercentage?: boolean };
7
7
 
8
- export const LinearProgress = ({ variant = 'determinate', value = 0, sx, ...props }: LinearProgressProps) => {
8
+ export const LinearProgress = ({ variant = 'determinate', value = 0, sx, hidePercentage = false, ...props }: LinearProgressProps) => {
9
9
  return (
10
- <Stack direction="row" alignItems="center">
10
+ <Stack direction="row" sx={{ alignItems: 'center' }}>
11
11
  <Box sx={{ width: '100%', mr: 0.5 }}>
12
12
  <MuiLinearProgress variant={variant} {...props} value={value} color="success" sx={{ width: '100%', ...sx }} />
13
13
  </Box>
14
14
  {value === 100 && <SuccessCircleIcon color="success" data-icon="complete" />}
15
- <Typography variant="body2" sx={{ color: 'text.secondary', ml: 1 }}>{`${Math.round(value)}%`}</Typography>
15
+ {!hidePercentage && (
16
+ <Typography variant="body2" sx={{ color: 'text.secondary', ml: 1 }}>{`${Math.round(value)}%`}</Typography>
17
+ )}
16
18
  </Stack>
17
19
  );
18
20
  };
File without changes