@availity/mui-drawer 0.1.3 → 1.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 +40 -0
- package/dist/index.js +55 -126
- package/package.json +24 -25
- package/project.json +5 -6
- package/dist/index.d.mts +0 -13
- package/dist/index.mjs +0 -129
- package/jest.config.js +0 -7
- package/tsconfig.spec.json +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [1.0.0](https://github.com/Availity/element/compare/@availity/mui-drawer@0.1.4...@availity/mui-drawer@1.0.0) (2026-06-16)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `mui-backdrop` updated to version `0.1.4`
|
|
10
|
+
* `mui-button` updated to version `0.1.4`
|
|
11
|
+
* `mui-icon` updated to version `0.1.4`
|
|
12
|
+
* `mui-layout` updated to version `0.1.4`
|
|
13
|
+
* `mui-typography` updated to version `0.1.4`
|
|
14
|
+
* `mui-checkbox` updated to version `0.1.4`
|
|
15
|
+
* `mui-form-utils` updated to version `0.1.4`
|
|
16
|
+
* `mui-list` updated to version `0.1.4`
|
|
17
|
+
|
|
18
|
+
### ⚠ BREAKING CHANGES
|
|
19
|
+
|
|
20
|
+
* CJS builds removed, packages are ESM-only.
|
|
21
|
+
|
|
22
|
+
- Convert all packages to ESM (type: module)
|
|
23
|
+
- Replace Jest with Vitest for all test targets
|
|
24
|
+
- Migrate ESLint to v9 flat config (eslint.config.js)
|
|
25
|
+
- Build output ESM-only (removed CJS dist/index.js require path)
|
|
26
|
+
- Upgrade @tanstack/react-query from v4 to v5
|
|
27
|
+
- Upgrade @availity/api-axios to v13
|
|
28
|
+
- Drop Node 20 support (engines: ^22.0.0 || ^24.0.0)
|
|
29
|
+
- Bump React to 19.2.7, MUI to 7.3.11, TypeScript to 5.9.3
|
|
30
|
+
- Simplify CI caching with built-in yarn cache action + Nx cache
|
|
31
|
+
- Modernize nx.json configuration
|
|
32
|
+
- Update husky hooks to use yarn directly
|
|
33
|
+
- Replace lint-staged nx affected with direct eslint
|
|
34
|
+
|
|
35
|
+
### Features
|
|
36
|
+
|
|
37
|
+
* migrate to ESM, Vitest, and ESLint 9 flat config ([cc22bb4](https://github.com/Availity/element/commit/cc22bb4a230bc1f3b190f187c4e61249d015b25b))
|
|
38
|
+
|
|
39
|
+
## [0.1.4](https://github.com/Availity/element/compare/@availity/mui-drawer@0.1.3...@availity/mui-drawer@0.1.4) (2026-05-27)
|
|
40
|
+
|
|
41
|
+
### Dependency Updates
|
|
42
|
+
|
|
43
|
+
* `mui-form-utils` updated to version `0.1.3`
|
|
44
|
+
* `mui-list` updated to version `0.1.3`
|
|
5
45
|
## [0.1.3](https://github.com/Availity/element/compare/@availity/mui-drawer@0.1.2...@availity/mui-drawer@0.1.3) (2026-03-03)
|
|
6
46
|
|
|
7
47
|
### Dependency Updates
|
package/dist/index.js
CHANGED
|
@@ -1,123 +1,47 @@
|
|
|
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
|
-
Drawer: () => Drawer
|
|
63
|
-
});
|
|
64
|
-
module.exports = __toCommonJS(index_exports);
|
|
65
|
-
|
|
66
1
|
// src/lib/Drawer.tsx
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
var StyledDrawerHeader =
|
|
2
|
+
import MuiDrawer from "@mui/material/Drawer";
|
|
3
|
+
import { Backdrop } from "@availity/mui-backdrop";
|
|
4
|
+
import { Box, Grid } from "@availity/mui-layout";
|
|
5
|
+
import { Typography } from "@availity/mui-typography";
|
|
6
|
+
import { IconButton } from "@availity/mui-button";
|
|
7
|
+
import { CloseIcon } from "@availity/mui-icon";
|
|
8
|
+
import { styled } from "@mui/material/styles";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
var StyledDrawerHeader = styled(Grid, {
|
|
76
11
|
name: "MuiDrawer",
|
|
77
12
|
slot: "AvDrawerHeader"
|
|
78
13
|
})();
|
|
79
|
-
var StyledDrawerHeaderText =
|
|
14
|
+
var StyledDrawerHeaderText = styled(Typography, {
|
|
80
15
|
name: "MuiDrawer",
|
|
81
16
|
slot: "AvDrawerHeaderText"
|
|
82
17
|
})();
|
|
83
|
-
var StyledDrawerContent =
|
|
18
|
+
var StyledDrawerContent = styled(Box, {
|
|
84
19
|
name: "MuiDrawer",
|
|
85
20
|
slot: "AvDrawerContent"
|
|
86
21
|
})();
|
|
87
|
-
var Drawer = (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"size",
|
|
106
|
-
"slots",
|
|
107
|
-
"slotProps"
|
|
108
|
-
]);
|
|
109
|
-
var _a2, _b2;
|
|
110
|
-
const drawerHeader = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(StyledDrawerHeader, { container: true, children: [
|
|
111
|
-
header && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledDrawerHeaderText, { variant: "h5", children: header }),
|
|
112
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_mui_layout.Grid, { flexShrink: 0, paddingLeft: 2, container: true, alignItems: "center", justifyContent: "flex-end", flexWrap: "nowrap", children: [
|
|
113
|
-
actions && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_layout.Grid, { paddingRight: 1, children: actions }),
|
|
114
|
-
onClose && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
115
|
-
import_mui_button.IconButton,
|
|
22
|
+
var Drawer = ({
|
|
23
|
+
anchor = "right",
|
|
24
|
+
actions,
|
|
25
|
+
children,
|
|
26
|
+
contentPadding,
|
|
27
|
+
header,
|
|
28
|
+
onClose,
|
|
29
|
+
size = "medium",
|
|
30
|
+
slots,
|
|
31
|
+
slotProps,
|
|
32
|
+
...rest
|
|
33
|
+
}) => {
|
|
34
|
+
const drawerHeader = /* @__PURE__ */ jsxs(StyledDrawerHeader, { container: true, children: [
|
|
35
|
+
header && /* @__PURE__ */ jsx(StyledDrawerHeaderText, { variant: "h5", children: header }),
|
|
36
|
+
/* @__PURE__ */ jsxs(Grid, { flexShrink: 0, paddingLeft: 2, container: true, alignItems: "center", justifyContent: "flex-end", flexWrap: "nowrap", children: [
|
|
37
|
+
actions && /* @__PURE__ */ jsx(Grid, { paddingRight: 1, children: actions }),
|
|
38
|
+
onClose && /* @__PURE__ */ jsx(
|
|
39
|
+
IconButton,
|
|
116
40
|
{
|
|
117
41
|
title: "close drawer",
|
|
118
42
|
"aria-label": "close drawer",
|
|
119
43
|
onClick: () => onClose(!rest.open, "backdropClick"),
|
|
120
|
-
children: /* @__PURE__ */
|
|
44
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
121
45
|
}
|
|
122
46
|
)
|
|
123
47
|
] })
|
|
@@ -128,36 +52,41 @@ var Drawer = (_a) => {
|
|
|
128
52
|
large: { width: "600px", breakpoint: 624 }
|
|
129
53
|
};
|
|
130
54
|
const { width, breakpoint } = sizes[size];
|
|
131
|
-
return /* @__PURE__ */
|
|
132
|
-
|
|
133
|
-
|
|
55
|
+
return /* @__PURE__ */ jsxs(
|
|
56
|
+
MuiDrawer,
|
|
57
|
+
{
|
|
58
|
+
...rest,
|
|
134
59
|
anchor,
|
|
135
60
|
onClose,
|
|
136
|
-
slots:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
61
|
+
slots: {
|
|
62
|
+
...slots,
|
|
63
|
+
backdrop: Backdrop
|
|
64
|
+
},
|
|
65
|
+
slotProps: {
|
|
66
|
+
...slotProps,
|
|
67
|
+
paper: {
|
|
68
|
+
...slotProps?.paper,
|
|
69
|
+
sx: anchor === "left" || anchor === "right" ? {
|
|
70
|
+
...slotProps?.paper?.sx,
|
|
142
71
|
width,
|
|
143
72
|
[`@media (max-width: ${breakpoint}px)`]: {
|
|
144
73
|
width: "calc(100% - 24px)"
|
|
145
74
|
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
transition:
|
|
75
|
+
} : slotProps?.paper?.sx
|
|
76
|
+
},
|
|
77
|
+
transition: {
|
|
149
78
|
easing: { enter: "cubic-bezier(0.4, 0, 1, 1)", exit: "cubic-bezier(0.0, 0, 0.2, 1)" },
|
|
150
|
-
timeout: { enter: 225, exit: 195 }
|
|
151
|
-
|
|
152
|
-
|
|
79
|
+
timeout: { enter: 225, exit: 195 },
|
|
80
|
+
...slotProps?.transition
|
|
81
|
+
}
|
|
82
|
+
},
|
|
153
83
|
children: [
|
|
154
84
|
header || actions ? drawerHeader : null,
|
|
155
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ jsx(StyledDrawerContent, { padding: contentPadding ? "0px 24px" : 0, children })
|
|
156
86
|
]
|
|
157
|
-
}
|
|
87
|
+
}
|
|
158
88
|
);
|
|
159
89
|
};
|
|
160
|
-
|
|
161
|
-
0 && (module.exports = {
|
|
90
|
+
export {
|
|
162
91
|
Drawer
|
|
163
|
-
}
|
|
92
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/mui-drawer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Availity MUI Drawer Component - part of the @availity/element design system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -21,47 +21,46 @@
|
|
|
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.
|
|
31
|
-
|
|
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
|
|
36
|
-
"dev": "tsup src/index.ts --format esm
|
|
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
|
"devDependencies": {
|
|
43
|
-
"@availity/mui-button": "
|
|
44
|
-
"@availity/mui-checkbox": "
|
|
45
|
-
"@availity/mui-form-utils": "
|
|
46
|
-
"@availity/mui-icon": "
|
|
47
|
-
"@availity/mui-layout": "
|
|
48
|
-
"@availity/mui-list": "
|
|
49
|
-
"@mui/material": "^7.3.
|
|
50
|
-
"react": "19.2.
|
|
51
|
-
"react-dom": "19.2.
|
|
52
|
-
"tsup": "^8.
|
|
53
|
-
"typescript": "^5.
|
|
41
|
+
"@availity/mui-button": "3.0.0",
|
|
42
|
+
"@availity/mui-checkbox": "3.0.0",
|
|
43
|
+
"@availity/mui-form-utils": "3.0.0",
|
|
44
|
+
"@availity/mui-icon": "3.0.0",
|
|
45
|
+
"@availity/mui-layout": "3.0.0",
|
|
46
|
+
"@availity/mui-list": "3.0.0",
|
|
47
|
+
"@mui/material": "^7.3.11",
|
|
48
|
+
"react": "19.2.7",
|
|
49
|
+
"react-dom": "19.2.7",
|
|
50
|
+
"tsup": "^8.5.1",
|
|
51
|
+
"typescript": "^5.9.3"
|
|
54
52
|
},
|
|
55
53
|
"peerDependencies": {
|
|
56
|
-
"@availity/mui-backdrop": "
|
|
57
|
-
"@availity/mui-button": "
|
|
58
|
-
"@availity/mui-icon": "
|
|
59
|
-
"@availity/mui-layout": "
|
|
60
|
-
"@availity/mui-typography": "
|
|
54
|
+
"@availity/mui-backdrop": "3.0.0",
|
|
55
|
+
"@availity/mui-button": "3.0.0",
|
|
56
|
+
"@availity/mui-icon": "3.0.0",
|
|
57
|
+
"@availity/mui-layout": "3.0.0",
|
|
58
|
+
"@availity/mui-typography": "3.0.0",
|
|
61
59
|
"@mui/material": "^7.0.0",
|
|
62
60
|
"react": ">=17.0.0"
|
|
63
61
|
},
|
|
64
62
|
"publishConfig": {
|
|
65
63
|
"access": "public"
|
|
66
|
-
}
|
|
64
|
+
},
|
|
65
|
+
"type": "module"
|
|
67
66
|
}
|
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/drawer/.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": "
|
|
25
|
-
"outputs": ["{workspaceRoot}/coverage/drawer"],
|
|
22
|
+
"executor": "nx:run-commands",
|
|
26
23
|
"options": {
|
|
27
|
-
"
|
|
24
|
+
"command": "vitest run packages/drawer"
|
|
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": [
|
|
34
|
+
"skipCommitTypes": [
|
|
35
|
+
"docs"
|
|
36
|
+
]
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
39
|
}
|
package/dist/index.d.mts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DrawerProps as DrawerProps$1 } from '@mui/material/Drawer';
|
|
2
|
-
|
|
3
|
-
interface DrawerProps extends Omit<DrawerProps$1, 'slots' | 'elevation'> {
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
slots?: Omit<DrawerProps$1['slots'], 'backdrop' | 'paper'>;
|
|
6
|
-
actions?: React.ReactNode;
|
|
7
|
-
header?: string;
|
|
8
|
-
size?: 'small' | 'medium' | 'large';
|
|
9
|
-
contentPadding?: boolean;
|
|
10
|
-
}
|
|
11
|
-
declare const Drawer: ({ anchor, actions, children, contentPadding, header, onClose, size, slots, slotProps, ...rest }: DrawerProps) => React.JSX.Element;
|
|
12
|
-
|
|
13
|
-
export { Drawer, type DrawerProps };
|
package/dist/index.mjs
DELETED
|
@@ -1,129 +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/Drawer.tsx
|
|
34
|
-
import MuiDrawer from "@mui/material/Drawer";
|
|
35
|
-
import { Backdrop } from "@availity/mui-backdrop";
|
|
36
|
-
import { Box, Grid } from "@availity/mui-layout";
|
|
37
|
-
import { Typography } from "@availity/mui-typography";
|
|
38
|
-
import { IconButton } from "@availity/mui-button";
|
|
39
|
-
import { CloseIcon } from "@availity/mui-icon";
|
|
40
|
-
import { styled } from "@mui/material/styles";
|
|
41
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
42
|
-
var StyledDrawerHeader = styled(Grid, {
|
|
43
|
-
name: "MuiDrawer",
|
|
44
|
-
slot: "AvDrawerHeader"
|
|
45
|
-
})();
|
|
46
|
-
var StyledDrawerHeaderText = styled(Typography, {
|
|
47
|
-
name: "MuiDrawer",
|
|
48
|
-
slot: "AvDrawerHeaderText"
|
|
49
|
-
})();
|
|
50
|
-
var StyledDrawerContent = styled(Box, {
|
|
51
|
-
name: "MuiDrawer",
|
|
52
|
-
slot: "AvDrawerContent"
|
|
53
|
-
})();
|
|
54
|
-
var Drawer = (_a) => {
|
|
55
|
-
var _b = _a, {
|
|
56
|
-
anchor = "right",
|
|
57
|
-
actions,
|
|
58
|
-
children,
|
|
59
|
-
contentPadding,
|
|
60
|
-
header,
|
|
61
|
-
onClose,
|
|
62
|
-
size = "medium",
|
|
63
|
-
slots,
|
|
64
|
-
slotProps
|
|
65
|
-
} = _b, rest = __objRest(_b, [
|
|
66
|
-
"anchor",
|
|
67
|
-
"actions",
|
|
68
|
-
"children",
|
|
69
|
-
"contentPadding",
|
|
70
|
-
"header",
|
|
71
|
-
"onClose",
|
|
72
|
-
"size",
|
|
73
|
-
"slots",
|
|
74
|
-
"slotProps"
|
|
75
|
-
]);
|
|
76
|
-
var _a2, _b2;
|
|
77
|
-
const drawerHeader = /* @__PURE__ */ jsxs(StyledDrawerHeader, { container: true, children: [
|
|
78
|
-
header && /* @__PURE__ */ jsx(StyledDrawerHeaderText, { variant: "h5", children: header }),
|
|
79
|
-
/* @__PURE__ */ jsxs(Grid, { flexShrink: 0, paddingLeft: 2, container: true, alignItems: "center", justifyContent: "flex-end", flexWrap: "nowrap", children: [
|
|
80
|
-
actions && /* @__PURE__ */ jsx(Grid, { paddingRight: 1, children: actions }),
|
|
81
|
-
onClose && /* @__PURE__ */ jsx(
|
|
82
|
-
IconButton,
|
|
83
|
-
{
|
|
84
|
-
title: "close drawer",
|
|
85
|
-
"aria-label": "close drawer",
|
|
86
|
-
onClick: () => onClose(!rest.open, "backdropClick"),
|
|
87
|
-
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
88
|
-
}
|
|
89
|
-
)
|
|
90
|
-
] })
|
|
91
|
-
] });
|
|
92
|
-
const sizes = {
|
|
93
|
-
small: { width: "326px", breakpoint: 350 },
|
|
94
|
-
medium: { width: "400px", breakpoint: 424 },
|
|
95
|
-
large: { width: "600px", breakpoint: 624 }
|
|
96
|
-
};
|
|
97
|
-
const { width, breakpoint } = sizes[size];
|
|
98
|
-
return /* @__PURE__ */ jsxs(
|
|
99
|
-
MuiDrawer,
|
|
100
|
-
__spreadProps(__spreadValues({}, rest), {
|
|
101
|
-
anchor,
|
|
102
|
-
onClose,
|
|
103
|
-
slots: __spreadProps(__spreadValues({}, slots), {
|
|
104
|
-
backdrop: Backdrop
|
|
105
|
-
}),
|
|
106
|
-
slotProps: __spreadProps(__spreadValues({}, slotProps), {
|
|
107
|
-
paper: __spreadProps(__spreadValues({}, slotProps == null ? void 0 : slotProps.paper), {
|
|
108
|
-
sx: anchor === "left" || anchor === "right" ? __spreadProps(__spreadValues({}, (_a2 = slotProps == null ? void 0 : slotProps.paper) == null ? void 0 : _a2.sx), {
|
|
109
|
-
width,
|
|
110
|
-
[`@media (max-width: ${breakpoint}px)`]: {
|
|
111
|
-
width: "calc(100% - 24px)"
|
|
112
|
-
}
|
|
113
|
-
}) : (_b2 = slotProps == null ? void 0 : slotProps.paper) == null ? void 0 : _b2.sx
|
|
114
|
-
}),
|
|
115
|
-
transition: __spreadValues({
|
|
116
|
-
easing: { enter: "cubic-bezier(0.4, 0, 1, 1)", exit: "cubic-bezier(0.0, 0, 0.2, 1)" },
|
|
117
|
-
timeout: { enter: 225, exit: 195 }
|
|
118
|
-
}, slotProps == null ? void 0 : slotProps.transition)
|
|
119
|
-
}),
|
|
120
|
-
children: [
|
|
121
|
-
header || actions ? drawerHeader : null,
|
|
122
|
-
/* @__PURE__ */ jsx(StyledDrawerContent, { padding: contentPadding ? "0px 24px" : 0, children })
|
|
123
|
-
]
|
|
124
|
-
})
|
|
125
|
-
);
|
|
126
|
-
};
|
|
127
|
-
export {
|
|
128
|
-
Drawer
|
|
129
|
-
};
|
package/jest.config.js
DELETED
package/tsconfig.spec.json
DELETED
|
@@ -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": ["**/*.test.js", "**/*.test.ts", "**/*.test.tsx", "**/*.d.ts"]
|
|
10
|
-
}
|