@availity/mui-progress 0.4.5 → 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 CHANGED
@@ -2,6 +2,25 @@
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
+
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)
13
+
14
+ ### Dependency Updates
15
+
16
+ * `mui-icon` updated to version `0.4.5`
17
+ * `mui-typography` updated to version `0.4.5`
18
+ * `mui-layout` updated to version `0.4.5`
19
+
20
+ ### Features
21
+
22
+ * configure package.json to allow esm to be used ([5a5393d](https://github.com/Availity/element/commit/5a5393de761f52608e714dd94a05106937dd95db))
23
+
5
24
  ## [0.4.5](https://github.com/Availity/element/compare/@availity/mui-progress@0.4.4...@availity/mui-progress@0.4.5) (2025-01-27)
6
25
 
7
26
  ### 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
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/mui-progress",
3
- "version": "0.4.5",
3
+ "version": "0.5.1",
4
4
  "description": "Availity MUI Progress Component - part of the @availity/element design system",
5
5
  "keywords": [
6
6
  "react",
@@ -23,6 +23,14 @@
23
23
  "main": "./dist/index.js",
24
24
  "module": "./dist/index.mjs",
25
25
  "types": "./dist/index.d.ts",
26
+ "exports": {
27
+ "./package.json": "./package.json",
28
+ ".": {
29
+ "types": "./dist/index.d.ts",
30
+ "import": "./dist/index.mjs",
31
+ "require": "./dist/index.js"
32
+ }
33
+ },
26
34
  "scripts": {
27
35
  "build": "tsup src/index.ts --format esm,cjs --dts",
28
36
  "dev": "tsup src/index.ts --format esm,cjs --watch --dts",
@@ -46,7 +54,7 @@
46
54
  "access": "public"
47
55
  },
48
56
  "dependencies": {
49
- "@availity/mui-icon": "^0.13.1",
50
- "@availity/mui-typography": "^0.2.1"
57
+ "@availity/mui-icon": "^0.14.0",
58
+ "@availity/mui-typography": "^0.3.0"
51
59
  }
52
60
  }
@@ -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
- <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
  };