@availity/mui-stepper 2.0.1 → 3.0.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,43 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [3.0.0](https://github.com/Availity/element/compare/@availity/mui-stepper@2.0.2...@availity/mui-stepper@3.0.0) (2026-06-16)
6
+
7
+ ### Dependency Updates
8
+
9
+ * `mui-button` updated to version `2.0.2`
10
+ * `mui-layout` updated to version `2.0.2`
11
+ * `mui-paper` updated to version `2.0.2`
12
+ * `mui-typography` updated to version `2.0.2`
13
+ * `mui-icon` updated to version `2.0.2`
14
+
15
+ ### ⚠ BREAKING CHANGES
16
+
17
+ * CJS builds removed, packages are ESM-only.
18
+
19
+ - Convert all packages to ESM (type: module)
20
+ - Replace Jest with Vitest for all test targets
21
+ - Migrate ESLint to v9 flat config (eslint.config.js)
22
+ - Build output ESM-only (removed CJS dist/index.js require path)
23
+ - Upgrade @tanstack/react-query from v4 to v5
24
+ - Upgrade @availity/api-axios to v13
25
+ - Drop Node 20 support (engines: ^22.0.0 || ^24.0.0)
26
+ - Bump React to 19.2.7, MUI to 7.3.11, TypeScript to 5.9.3
27
+ - Simplify CI caching with built-in yarn cache action + Nx cache
28
+ - Modernize nx.json configuration
29
+ - Update husky hooks to use yarn directly
30
+ - Replace lint-staged nx affected with direct eslint
31
+
32
+ ### Features
33
+
34
+ * migrate to ESM, Vitest, and ESLint 9 flat config ([cc22bb4](https://github.com/Availity/element/commit/cc22bb4a230bc1f3b190f187c4e61249d015b25b))
35
+
36
+ ## [2.0.2](https://github.com/Availity/element/compare/@availity/mui-stepper@2.0.1...@availity/mui-stepper@2.0.2) (2026-02-02)
37
+
38
+ ### Dependency Updates
39
+
40
+ * `mui-button` updated to version `2.0.1`
41
+ * `mui-icon` updated to version `2.0.1`
5
42
  ## [2.0.1](https://github.com/Availity/element/compare/@availity/mui-stepper@2.0.0...@availity/mui-stepper@2.0.1) (2025-12-03)
6
43
 
7
44
  ### Dependency Updates
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![Version](https://img.shields.io/npm/v/@availity/mui-stepper.svg?style=for-the-badge)](https://www.npmjs.com/package/@availity/mui-stepper)
6
6
  [![NPM Downloads](https://img.shields.io/npm/dt/@availity/mui-stepper.svg?style=for-the-badge)](https://www.npmjs.com/package/@availity/mui-stepper)
7
- [![Dependency Status](https://img.shields.io/librariesio/release/npm/@availity/mui-stepper?style=for-the-badge)](https://github.com/Availity/element/blob/main/packages/mui-stepper/package.json)
7
+ [![Dependency Status](https://img.shields.io/librariesio/release/npm/@availity/mui-stepper?style=for-the-badge)](https://github.com/Availity/element/blob/main/packages/stepper/package.json)
8
8
 
9
9
  ## Documentation
10
10
 
package/dist/index.js CHANGED
@@ -1,174 +1,91 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
- var __getProtoOf = Object.getPrototypeOf;
10
- var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
- var __objRest = (source, exclude) => {
26
- var target = {};
27
- for (var prop in source)
28
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
- target[prop] = source[prop];
30
- if (source != null && __getOwnPropSymbols)
31
- for (var prop of __getOwnPropSymbols(source)) {
32
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
- target[prop] = source[prop];
34
- }
35
- return target;
36
- };
37
- var __export = (target, all) => {
38
- for (var name in all)
39
- __defProp(target, name, { get: all[name], enumerable: true });
40
- };
41
- var __copyProps = (to, from, except, desc) => {
42
- if (from && typeof from === "object" || typeof from === "function") {
43
- for (let key of __getOwnPropNames(from))
44
- if (!__hasOwnProp.call(to, key) && key !== except)
45
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
46
- }
47
- return to;
48
- };
49
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
50
- // If the importer is in node compatibility mode or this is not an ESM
51
- // file that has been converted to a CommonJS file using a Babel-
52
- // compatible transform (i.e. "__esModule" has not been set), then set
53
- // "default" to the CommonJS "module.exports" for node compatibility.
54
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
55
- mod
56
- ));
57
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
58
-
59
- // src/index.ts
60
- var index_exports = {};
61
- __export(index_exports, {
62
- Step: () => Step,
63
- StepButton: () => StepButton,
64
- StepConnector: () => StepConnector,
65
- StepContent: () => StepContent,
66
- StepIcon: () => StepIcon,
67
- StepLabel: () => StepLabel,
68
- Stepper: () => Stepper
69
- });
70
- module.exports = __toCommonJS(index_exports);
71
-
72
1
  // src/lib/Step.tsx
73
- var import_Step = __toESM(require("@mui/material/Step"));
74
- var import_jsx_runtime = require("react/jsx-runtime");
75
- var Step = (_a) => {
76
- var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
77
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Step.default, __spreadProps(__spreadValues({}, rest), { children }));
78
- };
2
+ import MuiStep from "@mui/material/Step";
3
+ import { jsx } from "react/jsx-runtime";
4
+ var Step = ({ children, ...rest }) => /* @__PURE__ */ jsx(MuiStep, { ...rest, children });
79
5
 
80
6
  // src/lib/StepButton.tsx
81
- var import_StepButton = __toESM(require("@mui/material/StepButton"));
82
- var import_jsx_runtime2 = require("react/jsx-runtime");
83
- var StepButton = (_a) => {
84
- var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
85
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_StepButton.default, __spreadProps(__spreadValues({}, rest), { disableRipple: true, disableTouchRipple: true, children }));
86
- };
7
+ import MuiStepButton from "@mui/material/StepButton";
8
+ import { jsx as jsx2 } from "react/jsx-runtime";
9
+ var StepButton = ({ children, ...rest }) => /* @__PURE__ */ jsx2(MuiStepButton, { ...rest, disableRipple: true, disableTouchRipple: true, children });
87
10
 
88
11
  // src/lib/StepConnector.tsx
89
- var import_StepConnector = __toESM(require("@mui/material/StepConnector"));
90
- var import_jsx_runtime3 = require("react/jsx-runtime");
91
- var StepConnector = (props) => {
92
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_StepConnector.default, __spreadValues({}, props));
93
- };
12
+ import MuiStepConnector from "@mui/material/StepConnector";
13
+ import { jsx as jsx3 } from "react/jsx-runtime";
14
+ var StepConnector = (props) => /* @__PURE__ */ jsx3(MuiStepConnector, { ...props });
94
15
 
95
16
  // src/lib/StepContent.tsx
96
- var import_StepContent = __toESM(require("@mui/material/StepContent"));
97
- var import_jsx_runtime4 = require("react/jsx-runtime");
98
- var StepContent = (_a) => {
99
- var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
100
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_StepContent.default, __spreadProps(__spreadValues({}, rest), { children }));
101
- };
17
+ import MuiStepContent from "@mui/material/StepContent";
18
+ import { jsx as jsx4 } from "react/jsx-runtime";
19
+ var StepContent = ({ children, ...rest }) => /* @__PURE__ */ jsx4(MuiStepContent, { ...rest, children });
102
20
 
103
21
  // src/lib/StepIcon.tsx
104
- var import_StepIcon = __toESM(require("@mui/material/StepIcon"));
105
- var import_mui_icon = require("@availity/mui-icon");
106
- var import_jsx_runtime5 = require("react/jsx-runtime");
107
- var StepIcon = (_a) => {
108
- var _b = _a, { error, completed, warning } = _b, rest = __objRest(_b, ["error", "completed", "warning"]);
22
+ import MuiStepIcon from "@mui/material/StepIcon";
23
+ import { SuccessCircleIcon, WarningCircleIcon } from "@availity/mui-icon";
24
+ import { jsx as jsx5 } from "react/jsx-runtime";
25
+ var StepIcon = ({ error, completed, warning, ...rest }) => {
109
26
  let tag = null;
110
- if (error) tag = import_mui_icon.WarningCircleIcon;
111
- if (warning) tag = (props) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_mui_icon.WarningCircleIcon, __spreadValues({ color: "warning" }, props));
112
- if (completed) tag = import_mui_icon.SuccessCircleIcon;
113
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_StepIcon.default, __spreadProps(__spreadValues({}, rest), { error, completed, as: tag }));
27
+ if (error) tag = WarningCircleIcon;
28
+ if (warning) tag = (props) => /* @__PURE__ */ jsx5(WarningCircleIcon, { color: "warning", ...props });
29
+ if (completed) tag = SuccessCircleIcon;
30
+ return /* @__PURE__ */ jsx5(MuiStepIcon, { ...rest, error, completed, as: tag });
114
31
  };
115
32
 
116
33
  // src/lib/StepLabel.tsx
117
- var import_StepLabel = __toESM(require("@mui/material/StepLabel"));
118
- var import_mui_typography = require("@availity/mui-typography");
119
- var import_jsx_runtime6 = require("react/jsx-runtime");
120
- var StepLabel = (_a) => {
121
- var _b = _a, { children, error, optional, warning } = _b, rest = __objRest(_b, ["children", "error", "optional", "warning"]);
34
+ import MuiStepLabel from "@mui/material/StepLabel";
35
+ import { Typography } from "@availity/mui-typography";
36
+ import { jsx as jsx6 } from "react/jsx-runtime";
37
+ var StepLabel = ({ children, error, optional, warning, ...rest }) => {
122
38
  if (typeof optional === "string") {
123
- optional = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_mui_typography.Typography, { variant: "caption", children: optional });
39
+ optional = /* @__PURE__ */ jsx6(Typography, { variant: "caption", children: optional });
124
40
  }
125
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
126
- import_StepLabel.default,
127
- __spreadProps(__spreadValues({
41
+ return /* @__PURE__ */ jsx6(
42
+ MuiStepLabel,
43
+ {
128
44
  StepIconProps: { error, warning },
129
45
  StepIconComponent: StepIcon,
130
46
  error,
131
- optional
132
- }, rest), {
47
+ optional,
48
+ ...rest,
133
49
  children
134
- })
50
+ }
135
51
  );
136
52
  };
137
- StepLabel.muiName = import_StepLabel.default.muiName;
53
+ StepLabel.muiName = MuiStepLabel.muiName;
138
54
 
139
55
  // src/lib/Stepper.tsx
140
- var import_react2 = require("react");
141
- var import_Stepper = __toESM(require("@mui/material/Stepper"));
56
+ import { useRef, useState, useEffect } from "react";
57
+ import MuiStepper from "@mui/material/Stepper";
142
58
 
143
59
  // ../button/src/lib/IconButton.tsx
144
- var import_react = require("react");
145
- var import_IconButton = __toESM(require("@mui/material/IconButton"));
146
- var import_Tooltip = __toESM(require("@mui/material/Tooltip"));
147
- var import_jsx_runtime7 = require("react/jsx-runtime");
60
+ import { forwardRef } from "react";
61
+ import { default as MuiIconButton } from "@mui/material/IconButton";
62
+ import Tooltip from "@mui/material/Tooltip";
63
+ import { jsx as jsx7 } from "react/jsx-runtime";
148
64
  var outlinedStyles = {
149
65
  borderRadius: ".25rem",
150
66
  border: 1
151
67
  };
152
- var IconButton = (0, import_react.forwardRef)((props, ref) => {
153
- const _a = props, { title, variant = "text", sx, size = "medium" } = _a, rest = __objRest(_a, ["title", "variant", "sx", "size"]);
154
- const styles = __spreadValues(__spreadValues({}, sx), variant === "outlined" && outlinedStyles);
155
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Tooltip.default, { title, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_IconButton.default, __spreadProps(__spreadValues({ "aria-label": title, sx: __spreadValues({}, styles) }, rest), { ref, size })) });
68
+ var IconButton = forwardRef((props, ref) => {
69
+ const { title, variant = "text", sx, size = "medium", ...rest } = props;
70
+ const styles = {
71
+ ...sx,
72
+ ...variant === "outlined" && outlinedStyles
73
+ };
74
+ return /* @__PURE__ */ jsx7(Tooltip, { title, children: /* @__PURE__ */ jsx7(MuiIconButton, { "aria-label": title, sx: { ...styles }, ...rest, ref, size }) });
156
75
  });
157
76
 
158
77
  // src/lib/Stepper.tsx
159
- var import_mui_icon2 = require("@availity/mui-icon");
78
+ import { NavigatePreviousIcon, NavigateNextIcon } from "@availity/mui-icon";
160
79
 
161
80
  // ../layout/src/lib/Grid.tsx
162
- var import_Grid = __toESM(require("@mui/material/Grid"));
163
- var import_jsx_runtime8 = require("react/jsx-runtime");
164
- var Grid = (args) => {
165
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_Grid.default, __spreadValues({}, args));
166
- };
81
+ import MuiGrid from "@mui/material/Grid";
82
+ import { jsx as jsx8 } from "react/jsx-runtime";
83
+ var Grid = (args) => /* @__PURE__ */ jsx8(MuiGrid, { ...args });
167
84
 
168
85
  // src/lib/Stepper.tsx
169
- var import_styles = require("@mui/material/styles");
170
- var import_jsx_runtime9 = require("react/jsx-runtime");
171
- var HiddenConnectorStepper = (0, import_styles.styled)(import_Stepper.default, {
86
+ import { styled } from "@mui/material/styles";
87
+ import { jsx as jsx9, jsxs } from "react/jsx-runtime";
88
+ var HiddenConnectorStepper = styled(MuiStepper, {
172
89
  name: "MuiStepper",
173
90
  slot: "AvHideConnector",
174
91
  overridesResolver: (props, styles) => styles.avHideConnector
@@ -177,14 +94,13 @@ var HiddenConnectorStepper = (0, import_styles.styled)(import_Stepper.default, {
177
94
  display: "none"
178
95
  }
179
96
  });
180
- var Stepper = (_a) => {
181
- var _b = _a, { children, connector, orientation, scrollButtons } = _b, rest = __objRest(_b, ["children", "connector", "orientation", "scrollButtons"]);
97
+ var Stepper = ({ children, connector, orientation, scrollButtons, ...rest }) => {
182
98
  const alternativeLabel = orientation !== "vertical";
183
- const Stepper2 = connector === null ? HiddenConnectorStepper : import_Stepper.default;
184
- const stepperRef = (0, import_react2.useRef)(null);
185
- const [showLeftButton, setShowLeftButton] = (0, import_react2.useState)(true);
186
- const [showRightButton, setShowRightButton] = (0, import_react2.useState)(true);
187
- (0, import_react2.useEffect)(() => {
99
+ const Stepper2 = connector === null ? HiddenConnectorStepper : MuiStepper;
100
+ const stepperRef = useRef(null);
101
+ const [showLeftButton, setShowLeftButton] = useState(true);
102
+ const [showRightButton, setShowRightButton] = useState(true);
103
+ useEffect(() => {
188
104
  const stepper = stepperRef.current;
189
105
  const handleScroll = () => {
190
106
  if (stepper) {
@@ -209,69 +125,64 @@ var Stepper = (_a) => {
209
125
  };
210
126
  }, []);
211
127
  const showScrollButtons = scrollButtons && orientation !== "vertical";
212
- const ScrollIconContainer = (0, import_styles.styled)("div")({
128
+ const ScrollIconContainer = styled("div")({
213
129
  width: "50px",
214
130
  flexShrink: 0,
215
131
  paddingTop: "15px"
216
132
  });
217
- return showScrollButtons ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Grid, { container: true, direction: "row", justifyContent: "space-between", wrap: "nowrap", children: [
218
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ScrollIconContainer, { style: { paddingRight: "8px" }, children: showLeftButton && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
133
+ return showScrollButtons ? /* @__PURE__ */ jsxs(Grid, { container: true, direction: "row", justifyContent: "space-between", wrap: "nowrap", children: [
134
+ /* @__PURE__ */ jsx9(ScrollIconContainer, { style: { paddingRight: "8px" }, children: showLeftButton && /* @__PURE__ */ jsx9(
219
135
  IconButton,
220
136
  {
221
137
  title: "Previous",
222
138
  variant: "outlined",
223
- onClick: () => {
224
- var _a2;
225
- return (_a2 = stepperRef.current) == null ? void 0 : _a2.scrollTo({ left: 0, behavior: "smooth" });
226
- },
227
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_mui_icon2.NavigatePreviousIcon, { fontSize: "xsmall" })
139
+ onClick: () => stepperRef.current?.scrollTo({ left: 0, behavior: "smooth" }),
140
+ children: /* @__PURE__ */ jsx9(NavigatePreviousIcon, { fontSize: "xsmall" })
228
141
  }
229
142
  ) }),
230
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
143
+ /* @__PURE__ */ jsx9(
231
144
  Stepper2,
232
- __spreadProps(__spreadValues({
145
+ {
233
146
  "aria-label": "multi-step process",
234
- role: "region"
235
- }, rest), {
147
+ role: "region",
148
+ ...rest,
236
149
  connector,
237
150
  orientation,
238
151
  alternativeLabel,
239
152
  ref: stepperRef,
240
153
  children,
241
154
  tabIndex: 0
242
- })
155
+ }
243
156
  ),
244
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ScrollIconContainer, { style: { paddingLeft: "8px" }, children: showRightButton && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
157
+ /* @__PURE__ */ jsx9(ScrollIconContainer, { style: { paddingLeft: "8px" }, children: showRightButton && /* @__PURE__ */ jsx9(
245
158
  IconButton,
246
159
  {
247
160
  title: "Next",
248
161
  variant: "outlined",
249
162
  onClick: () => {
250
- var _a2;
251
- (_a2 = stepperRef.current) == null ? void 0 : _a2.scrollTo({
163
+ stepperRef.current?.scrollTo({
252
164
  left: stepperRef.current.scrollWidth - stepperRef.current.clientWidth,
253
165
  behavior: "smooth"
254
166
  });
255
167
  },
256
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_mui_icon2.NavigateNextIcon, { fontSize: "xsmall" })
168
+ children: /* @__PURE__ */ jsx9(NavigateNextIcon, { fontSize: "xsmall" })
257
169
  }
258
170
  ) })
259
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
171
+ ] }) : /* @__PURE__ */ jsx9(
260
172
  Stepper2,
261
- __spreadProps(__spreadValues({
173
+ {
262
174
  "aria-label": "multi-step process",
263
- role: "region"
264
- }, rest), {
175
+ role: "region",
176
+ ...rest,
265
177
  connector,
266
178
  orientation,
267
179
  alternativeLabel,
268
180
  ref: stepperRef,
269
181
  children
270
- })
182
+ }
271
183
  );
272
184
  };
273
- // Annotate the CommonJS export names for ESM import in node:
274
- 0 && (module.exports = {
185
+ export {
275
186
  Step,
276
187
  StepButton,
277
188
  StepConnector,
@@ -279,4 +190,4 @@ var Stepper = (_a) => {
279
190
  StepIcon,
280
191
  StepLabel,
281
192
  Stepper
282
- });
193
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/mui-stepper",
3
- "version": "2.0.1",
3
+ "version": "3.0.0",
4
4
  "description": "Availity MUI Stepper Component - part of the @availity/element design system",
5
5
  "keywords": [
6
6
  "react",
@@ -21,38 +21,36 @@
21
21
  "author": "Availity Developers <AVOSS@availity.com>",
22
22
  "browser": "./dist/index.js",
23
23
  "main": "./dist/index.js",
24
- "module": "./dist/index.mjs",
25
24
  "types": "./dist/index.d.ts",
26
25
  "exports": {
27
- "./package.json": "./package.json",
28
26
  ".": {
29
27
  "types": "./dist/index.d.ts",
30
- "import": "./dist/index.mjs",
31
- "require": "./dist/index.js"
32
- }
28
+ "import": "./dist/index.js"
29
+ },
30
+ "./package.json": "./package.json"
33
31
  },
34
32
  "scripts": {
35
- "build": "tsup src/index.ts --format esm,cjs --dts",
36
- "dev": "tsup src/index.ts --format esm,cjs --watch --dts",
33
+ "build": "tsup src/index.ts --format esm --dts",
34
+ "dev": "tsup src/index.ts --format esm --watch --dts",
37
35
  "clean": "rm -rf dist",
38
36
  "clean:nm": "rm -rf node_modules",
39
37
  "publish": "yarn npm publish --tolerate-republish --access public",
40
38
  "publish:canary": "yarn npm publish --access public --tag canary"
41
39
  },
42
40
  "dependencies": {
43
- "@availity/mui-icon": "^2.0.1",
44
- "@availity/mui-typography": "^2.0.1"
41
+ "@availity/mui-icon": "^3.0.0",
42
+ "@availity/mui-typography": "^3.0.0"
45
43
  },
46
44
  "devDependencies": {
47
- "@availity/mui-button": "^2.0.1",
48
- "@availity/mui-layout": "^2.0.1",
49
- "@availity/mui-paper": "^2.0.1",
50
- "@availity/mui-typography": "^2.0.1",
51
- "@mui/material": "^7.3.4",
52
- "react": "19.2.0",
53
- "react-dom": "19.2.0",
54
- "tsup": "^8.4.0",
55
- "typescript": "^5.4.5"
45
+ "@availity/mui-button": "^3.0.0",
46
+ "@availity/mui-layout": "^3.0.0",
47
+ "@availity/mui-paper": "^3.0.0",
48
+ "@availity/mui-typography": "^3.0.0",
49
+ "@mui/material": "^7.3.11",
50
+ "react": "19.2.7",
51
+ "react-dom": "19.2.7",
52
+ "tsup": "^8.5.1",
53
+ "typescript": "^5.9.3"
56
54
  },
57
55
  "peerDependencies": {
58
56
  "@mui/material": "^7.0.0",
@@ -61,5 +59,6 @@
61
59
  "publishConfig": {
62
60
  "access": "public"
63
61
  },
64
- "sideEffects": false
62
+ "sideEffects": false,
63
+ "type": "module"
65
64
  }
package/project.json CHANGED
@@ -8,23 +8,20 @@
8
8
  "lint": {
9
9
  "executor": "@nx/eslint:lint",
10
10
  "options": {
11
- "eslintConfig": ".eslintrc.json",
12
11
  "silent": false,
13
12
  "fix": false,
14
13
  "cache": true,
15
14
  "cacheLocation": "./node_modules/.cache/stepper/.eslintcache",
16
15
  "maxWarnings": -1,
17
16
  "quiet": false,
18
- "noEslintrc": false,
19
17
  "hasTypeAwareRules": true,
20
18
  "cacheStrategy": "metadata"
21
19
  }
22
20
  },
23
21
  "test": {
24
- "executor": "@nx/jest:jest",
25
- "outputs": ["{workspaceRoot}/coverage/stepper"],
22
+ "executor": "nx:run-commands",
26
23
  "options": {
27
- "jestConfig": "packages/stepper/jest.config.js"
24
+ "command": "vitest run packages/stepper"
28
25
  }
29
26
  },
30
27
  "version": {
@@ -34,7 +31,9 @@
34
31
  "commitMessageFormat": "chore({projectName}): release version ${version} [skip ci]",
35
32
  "tagPrefix": "@availity/{projectName}@",
36
33
  "trackDeps": true,
37
- "skipCommitTypes": ["docs"]
34
+ "skipCommitTypes": [
35
+ "docs"
36
+ ]
38
37
  }
39
38
  }
40
39
  }
package/src/lib/Step.tsx CHANGED
@@ -2,6 +2,4 @@ import MuiStep, { StepProps as MuiStepProps } from '@mui/material/Step';
2
2
 
3
3
  export type StepProps = MuiStepProps;
4
4
 
5
- export const Step = ({ children, ...rest }: StepProps): React.JSX.Element => {
6
- return <MuiStep {...rest}>{children}</MuiStep>;
7
- };
5
+ export const Step = ({ children, ...rest }: StepProps): React.JSX.Element => <MuiStep {...rest}>{children}</MuiStep>;
@@ -10,7 +10,7 @@ describe('StepButton', () => {
10
10
  });
11
11
 
12
12
  test('should handle clicks', () => {
13
- const fn = jest.fn();
13
+ const fn = vi.fn();
14
14
  render(<StepButton onClick={fn}>Next</StepButton>);
15
15
 
16
16
  fireEvent.click(screen.getByText('Next'));
@@ -5,10 +5,8 @@ export type StepButtonProps = Omit<
5
5
  'centerRipple' | 'disableRipple' | 'disableTouchRipple' | 'focusRipple' | 'TouchRippleProps' | 'touchRippleRef'
6
6
  >;
7
7
 
8
- export const StepButton = ({ children, ...rest }: StepButtonProps): React.JSX.Element => {
9
- return (
8
+ export const StepButton = ({ children, ...rest }: StepButtonProps): React.JSX.Element => (
10
9
  <MuiStepButton {...rest} disableRipple disableTouchRipple>
11
10
  {children}
12
11
  </MuiStepButton>
13
12
  );
14
- };
@@ -2,6 +2,4 @@ import MuiStepConnector, { StepConnectorProps as MuiStepConnectorProps } from '@
2
2
 
3
3
  export type StepConnectorProps = MuiStepConnectorProps;
4
4
 
5
- export const StepConnector = (props: StepConnectorProps): React.JSX.Element => {
6
- return <MuiStepConnector {...props} />;
7
- };
5
+ export const StepConnector = (props: StepConnectorProps): React.JSX.Element => <MuiStepConnector {...props} />;
@@ -2,6 +2,4 @@ import MuiStepContent, { StepContentProps as MuiStepContentProps } from '@mui/ma
2
2
 
3
3
  export type StepContentProps = MuiStepContentProps;
4
4
 
5
- export const StepContent = ({ children, ...rest }: StepContentProps): React.JSX.Element => {
6
- return <MuiStepContent {...rest}>{children}</MuiStepContent>;
7
- };
5
+ export const StepContent = ({ children, ...rest }: StepContentProps): React.JSX.Element => <MuiStepContent {...rest}>{children}</MuiStepContent>;
@@ -1,7 +1,7 @@
1
1
  import MuiStepLabel, { StepLabelProps as MuiStepLabelProps } from '@mui/material/StepLabel';
2
2
 
3
- import { StepIcon, StepIconProps } from './StepIcon';
4
3
  import { Typography } from '@availity/mui-typography';
4
+ import { StepIcon, StepIconProps } from './StepIcon';
5
5
 
6
6
  export type StepLabelProps = Pick<StepIconProps, 'warning'> & MuiStepLabelProps;
7
7
 
@@ -1,4 +1,4 @@
1
- /* eslint-disable @typescript-eslint/no-empty-function */
1
+
2
2
  import { render, screen } from '@testing-library/react';
3
3
 
4
4
  import { Stepper } from './Stepper';
@@ -7,7 +7,9 @@ import { StepLabel } from './StepLabel';
7
7
 
8
8
  class ResizeObserver {
9
9
  observe() {}
10
+
10
11
  unobserve() {}
12
+
11
13
  disconnect() {}
12
14
  }
13
15
 
package/dist/index.d.mts DELETED
@@ -1,46 +0,0 @@
1
- import { StepProps as StepProps$1 } from '@mui/material/Step';
2
- import { StepButtonProps as StepButtonProps$1 } from '@mui/material/StepButton';
3
- import { StepConnectorProps as StepConnectorProps$1 } from '@mui/material/StepConnector';
4
- import { StepContentProps as StepContentProps$1 } from '@mui/material/StepContent';
5
- import { StepIconProps as StepIconProps$1 } from '@mui/material/StepIcon';
6
- import { SvgIconProps } from '@mui/material/SvgIcon';
7
- import { StepLabelProps as StepLabelProps$1 } from '@mui/material/StepLabel';
8
- import { StepperProps as StepperProps$1 } from '@mui/material/Stepper';
9
-
10
- type StepProps = StepProps$1;
11
- declare const Step: ({ children, ...rest }: StepProps) => React.JSX.Element;
12
-
13
- type StepButtonProps = Omit<StepButtonProps$1, 'centerRipple' | 'disableRipple' | 'disableTouchRipple' | 'focusRipple' | 'TouchRippleProps' | 'touchRippleRef'>;
14
- declare const StepButton: ({ children, ...rest }: StepButtonProps) => React.JSX.Element;
15
-
16
- type StepConnectorProps = StepConnectorProps$1;
17
- declare const StepConnector: (props: StepConnectorProps) => React.JSX.Element;
18
-
19
- type StepContentProps = StepContentProps$1;
20
- declare const StepContent: ({ children, ...rest }: StepContentProps) => React.JSX.Element;
21
-
22
- type Tag = ((props: SvgIconProps) => React.JSX.Element) | null;
23
- declare module '@mui/material/StepIcon' {
24
- interface StepIconProps {
25
- as?: Tag;
26
- warning?: boolean;
27
- }
28
- }
29
- type StepIconProps = {
30
- /** If `true`, the step will have a warning icon. */
31
- warning?: boolean;
32
- } & StepIconProps$1;
33
- declare const StepIcon: ({ error, completed, warning, ...rest }: StepIconProps) => React.JSX.Element;
34
-
35
- type StepLabelProps = Pick<StepIconProps, 'warning'> & StepLabelProps$1;
36
- declare const StepLabel: {
37
- ({ children, error, optional, warning, ...rest }: StepLabelProps): React.JSX.Element;
38
- muiName: string;
39
- };
40
-
41
- type StepperProps = {
42
- scrollButtons?: boolean;
43
- } & Omit<StepperProps$1, 'alternativeLabel' | 'elevation'>;
44
- declare const Stepper: ({ children, connector, orientation, scrollButtons, ...rest }: StepperProps) => React.JSX.Element;
45
-
46
- export { Step, StepButton, type StepButtonProps, StepConnector, type StepConnectorProps, StepContent, type StepContentProps, StepIcon, type StepIconProps, StepLabel, type StepLabelProps, type StepProps, Stepper, type StepperProps };
package/dist/index.mjs DELETED
@@ -1,242 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
32
-
33
- // src/lib/Step.tsx
34
- import MuiStep from "@mui/material/Step";
35
- import { jsx } from "react/jsx-runtime";
36
- var Step = (_a) => {
37
- var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
38
- return /* @__PURE__ */ jsx(MuiStep, __spreadProps(__spreadValues({}, rest), { children }));
39
- };
40
-
41
- // src/lib/StepButton.tsx
42
- import MuiStepButton from "@mui/material/StepButton";
43
- import { jsx as jsx2 } from "react/jsx-runtime";
44
- var StepButton = (_a) => {
45
- var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
46
- return /* @__PURE__ */ jsx2(MuiStepButton, __spreadProps(__spreadValues({}, rest), { disableRipple: true, disableTouchRipple: true, children }));
47
- };
48
-
49
- // src/lib/StepConnector.tsx
50
- import MuiStepConnector from "@mui/material/StepConnector";
51
- import { jsx as jsx3 } from "react/jsx-runtime";
52
- var StepConnector = (props) => {
53
- return /* @__PURE__ */ jsx3(MuiStepConnector, __spreadValues({}, props));
54
- };
55
-
56
- // src/lib/StepContent.tsx
57
- import MuiStepContent from "@mui/material/StepContent";
58
- import { jsx as jsx4 } from "react/jsx-runtime";
59
- var StepContent = (_a) => {
60
- var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
61
- return /* @__PURE__ */ jsx4(MuiStepContent, __spreadProps(__spreadValues({}, rest), { children }));
62
- };
63
-
64
- // src/lib/StepIcon.tsx
65
- import MuiStepIcon from "@mui/material/StepIcon";
66
- import { SuccessCircleIcon, WarningCircleIcon } from "@availity/mui-icon";
67
- import { jsx as jsx5 } from "react/jsx-runtime";
68
- var StepIcon = (_a) => {
69
- var _b = _a, { error, completed, warning } = _b, rest = __objRest(_b, ["error", "completed", "warning"]);
70
- let tag = null;
71
- if (error) tag = WarningCircleIcon;
72
- if (warning) tag = (props) => /* @__PURE__ */ jsx5(WarningCircleIcon, __spreadValues({ color: "warning" }, props));
73
- if (completed) tag = SuccessCircleIcon;
74
- return /* @__PURE__ */ jsx5(MuiStepIcon, __spreadProps(__spreadValues({}, rest), { error, completed, as: tag }));
75
- };
76
-
77
- // src/lib/StepLabel.tsx
78
- import MuiStepLabel from "@mui/material/StepLabel";
79
- import { Typography } from "@availity/mui-typography";
80
- import { jsx as jsx6 } from "react/jsx-runtime";
81
- var StepLabel = (_a) => {
82
- var _b = _a, { children, error, optional, warning } = _b, rest = __objRest(_b, ["children", "error", "optional", "warning"]);
83
- if (typeof optional === "string") {
84
- optional = /* @__PURE__ */ jsx6(Typography, { variant: "caption", children: optional });
85
- }
86
- return /* @__PURE__ */ jsx6(
87
- MuiStepLabel,
88
- __spreadProps(__spreadValues({
89
- StepIconProps: { error, warning },
90
- StepIconComponent: StepIcon,
91
- error,
92
- optional
93
- }, rest), {
94
- children
95
- })
96
- );
97
- };
98
- StepLabel.muiName = MuiStepLabel.muiName;
99
-
100
- // src/lib/Stepper.tsx
101
- import { useRef, useState, useEffect } from "react";
102
- import MuiStepper from "@mui/material/Stepper";
103
-
104
- // ../button/src/lib/IconButton.tsx
105
- import { forwardRef } from "react";
106
- import { default as MuiIconButton } from "@mui/material/IconButton";
107
- import Tooltip from "@mui/material/Tooltip";
108
- import { jsx as jsx7 } from "react/jsx-runtime";
109
- var outlinedStyles = {
110
- borderRadius: ".25rem",
111
- border: 1
112
- };
113
- var IconButton = forwardRef((props, ref) => {
114
- const _a = props, { title, variant = "text", sx, size = "medium" } = _a, rest = __objRest(_a, ["title", "variant", "sx", "size"]);
115
- const styles = __spreadValues(__spreadValues({}, sx), variant === "outlined" && outlinedStyles);
116
- return /* @__PURE__ */ jsx7(Tooltip, { title, children: /* @__PURE__ */ jsx7(MuiIconButton, __spreadProps(__spreadValues({ "aria-label": title, sx: __spreadValues({}, styles) }, rest), { ref, size })) });
117
- });
118
-
119
- // src/lib/Stepper.tsx
120
- import { NavigatePreviousIcon, NavigateNextIcon } from "@availity/mui-icon";
121
-
122
- // ../layout/src/lib/Grid.tsx
123
- import MuiGrid from "@mui/material/Grid";
124
- import { jsx as jsx8 } from "react/jsx-runtime";
125
- var Grid = (args) => {
126
- return /* @__PURE__ */ jsx8(MuiGrid, __spreadValues({}, args));
127
- };
128
-
129
- // src/lib/Stepper.tsx
130
- import { styled } from "@mui/material/styles";
131
- import { jsx as jsx9, jsxs } from "react/jsx-runtime";
132
- var HiddenConnectorStepper = styled(MuiStepper, {
133
- name: "MuiStepper",
134
- slot: "AvHideConnector",
135
- overridesResolver: (props, styles) => styles.avHideConnector
136
- })({
137
- ".MuiStepLabel-root::before, .MuiStepLabel-root::after, .MuiStepConnector-root": {
138
- display: "none"
139
- }
140
- });
141
- var Stepper = (_a) => {
142
- var _b = _a, { children, connector, orientation, scrollButtons } = _b, rest = __objRest(_b, ["children", "connector", "orientation", "scrollButtons"]);
143
- const alternativeLabel = orientation !== "vertical";
144
- const Stepper2 = connector === null ? HiddenConnectorStepper : MuiStepper;
145
- const stepperRef = useRef(null);
146
- const [showLeftButton, setShowLeftButton] = useState(true);
147
- const [showRightButton, setShowRightButton] = useState(true);
148
- useEffect(() => {
149
- const stepper = stepperRef.current;
150
- const handleScroll = () => {
151
- if (stepper) {
152
- setShowLeftButton(stepper.scrollLeft > 0);
153
- const isRight = Math.abs(stepper.scrollWidth - stepper.clientWidth - stepper.scrollLeft) <= 1;
154
- setShowRightButton(!isRight);
155
- }
156
- };
157
- const resizeObserver = new ResizeObserver(() => {
158
- handleScroll();
159
- });
160
- if (stepper) {
161
- stepper.addEventListener("scroll", handleScroll);
162
- resizeObserver.observe(stepper);
163
- handleScroll();
164
- }
165
- return () => {
166
- if (stepper) {
167
- stepper.removeEventListener("scroll", handleScroll);
168
- resizeObserver.disconnect();
169
- }
170
- };
171
- }, []);
172
- const showScrollButtons = scrollButtons && orientation !== "vertical";
173
- const ScrollIconContainer = styled("div")({
174
- width: "50px",
175
- flexShrink: 0,
176
- paddingTop: "15px"
177
- });
178
- return showScrollButtons ? /* @__PURE__ */ jsxs(Grid, { container: true, direction: "row", justifyContent: "space-between", wrap: "nowrap", children: [
179
- /* @__PURE__ */ jsx9(ScrollIconContainer, { style: { paddingRight: "8px" }, children: showLeftButton && /* @__PURE__ */ jsx9(
180
- IconButton,
181
- {
182
- title: "Previous",
183
- variant: "outlined",
184
- onClick: () => {
185
- var _a2;
186
- return (_a2 = stepperRef.current) == null ? void 0 : _a2.scrollTo({ left: 0, behavior: "smooth" });
187
- },
188
- children: /* @__PURE__ */ jsx9(NavigatePreviousIcon, { fontSize: "xsmall" })
189
- }
190
- ) }),
191
- /* @__PURE__ */ jsx9(
192
- Stepper2,
193
- __spreadProps(__spreadValues({
194
- "aria-label": "multi-step process",
195
- role: "region"
196
- }, rest), {
197
- connector,
198
- orientation,
199
- alternativeLabel,
200
- ref: stepperRef,
201
- children,
202
- tabIndex: 0
203
- })
204
- ),
205
- /* @__PURE__ */ jsx9(ScrollIconContainer, { style: { paddingLeft: "8px" }, children: showRightButton && /* @__PURE__ */ jsx9(
206
- IconButton,
207
- {
208
- title: "Next",
209
- variant: "outlined",
210
- onClick: () => {
211
- var _a2;
212
- (_a2 = stepperRef.current) == null ? void 0 : _a2.scrollTo({
213
- left: stepperRef.current.scrollWidth - stepperRef.current.clientWidth,
214
- behavior: "smooth"
215
- });
216
- },
217
- children: /* @__PURE__ */ jsx9(NavigateNextIcon, { fontSize: "xsmall" })
218
- }
219
- ) })
220
- ] }) : /* @__PURE__ */ jsx9(
221
- Stepper2,
222
- __spreadProps(__spreadValues({
223
- "aria-label": "multi-step process",
224
- role: "region"
225
- }, rest), {
226
- connector,
227
- orientation,
228
- alternativeLabel,
229
- ref: stepperRef,
230
- children
231
- })
232
- );
233
- };
234
- export {
235
- Step,
236
- StepButton,
237
- StepConnector,
238
- StepContent,
239
- StepIcon,
240
- StepLabel,
241
- Stepper
242
- };
package/jest.config.js DELETED
@@ -1,7 +0,0 @@
1
- const global = require('../../jest.config.global');
2
-
3
- module.exports = {
4
- ...global,
5
- displayName: 'stepper',
6
- coverageDirectory: '../../coverage/stepper',
7
- };
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../dist/out-tsc",
5
- "module": "commonjs",
6
- "types": ["jest", "node", "@testing-library/jest-dom"],
7
- "allowJs": true
8
- },
9
- "include": ["jest.config.ts", "**/*.test.js", "**/*.test.ts", "**/*.test.tsx", "**/*.d.ts"]
10
- }