@availity/mui-progress 0.5.0 → 0.5.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.
- package/CHANGELOG.md +7 -0
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/src/lib/LinearProgress.test.tsx +5 -0
- package/src/lib/LinearProgress.tsx +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.5.1](https://github.com/Availity/element/compare/@availity/mui-progress@0.5.0...@availity/mui-progress@0.5.1) (2025-02-19)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **mui-progress:** allow hiding of percentge ([168da9b](https://github.com/Availity/element/commit/168da9bfa7af44089cea27317e0d6ad9a057db3d))
|
|
11
|
+
|
|
5
12
|
## [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
13
|
|
|
7
14
|
### 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
|
-
|
|
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
|
-
|
|
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
|
@@ -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"]);
|
|
158
|
+
var _b = _a, { variant = "determinate", value = 0, sx, hidePercentage = false } = _b, props = __objRest(_b, ["variant", "value", "sx", "hidePercentage"]);
|
|
159
159
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Stack2, { direction: "row", 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
|
@@ -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"]);
|
|
126
|
+
var _b = _a, { variant = "determinate", value = 0, sx, hidePercentage = false } = _b, props = __objRest(_b, ["variant", "value", "sx", "hidePercentage"]);
|
|
127
127
|
return /* @__PURE__ */ jsxs2(Stack2, { direction: "row", 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
|
@@ -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
10
|
<Stack direction="row" 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
|
-
|
|
15
|
+
{!hidePercentage && (
|
|
16
|
+
<Typography variant="body2" sx={{ color: 'text.secondary', ml: 1 }}>{`${Math.round(value)}%`}</Typography>
|
|
17
|
+
)}
|
|
16
18
|
</Stack>
|
|
17
19
|
);
|
|
18
20
|
};
|