@availity/mui-transitions 0.1.1 → 0.2.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 +12 -0
- package/dist/index.d.mts +10 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +30 -5
- package/dist/index.mjs +27 -4
- package/jest.config.js +10 -0
- package/package.json +6 -4
- package/project.json +8 -9
- package/src/index.ts +1 -0
- package/src/lib/Collapse.stories.tsx +1 -1
- package/src/lib/Fade.stories.tsx +34 -0
- package/src/lib/Fade.test.tsx +14 -0
- package/src/lib/Fade.tsx +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.2.0](https://github.com/Availity/element/compare/@availity/mui-transitions@0.1.2...@availity/mui-transitions@0.2.0) (2024-06-21)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `mui-typography` updated to version `0.1.2`
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **mui-transitions:** add Fade component ([0a6e4b9](https://github.com/Availity/element/commit/0a6e4b9b31da786f26f64a66ceef789a57d302fe))
|
|
14
|
+
|
|
15
|
+
## [0.1.2](https://github.com/Availity/element/compare/@availity/mui-transitions@0.1.1...@availity/mui-transitions@0.1.2) (2024-04-19)
|
|
16
|
+
|
|
5
17
|
## [0.1.1](https://github.com/Availity/element/compare/@availity/mui-transitions@0.1.0...@availity/mui-transitions@0.1.1) (2024-04-04)
|
|
6
18
|
|
|
7
19
|
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CollapseProps as CollapseProps$1 } from '@mui/material/Collapse';
|
|
2
|
+
import { FadeProps as FadeProps$1 } from '@mui/material/Fade';
|
|
3
|
+
|
|
4
|
+
type CollapseProps = CollapseProps$1;
|
|
5
|
+
declare const Collapse: (props: CollapseProps) => JSX.Element;
|
|
6
|
+
|
|
7
|
+
type FadeProps = FadeProps$1;
|
|
8
|
+
declare const Fade: (props: FadeProps) => JSX.Element;
|
|
9
|
+
|
|
10
|
+
export { Collapse, type CollapseProps, Fade, type FadeProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { CollapseProps as CollapseProps$1 } from '@mui/material/Collapse';
|
|
2
|
+
import { FadeProps as FadeProps$1 } from '@mui/material/Fade';
|
|
2
3
|
|
|
3
4
|
type CollapseProps = CollapseProps$1;
|
|
4
5
|
declare const Collapse: (props: CollapseProps) => JSX.Element;
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
type FadeProps = FadeProps$1;
|
|
8
|
+
declare const Fade: (props: FadeProps) => JSX.Element;
|
|
9
|
+
|
|
10
|
+
export { Collapse, type CollapseProps, Fade, type FadeProps };
|
package/dist/index.js
CHANGED
|
@@ -3,8 +3,22 @@ var __create = Object.create;
|
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
8
22
|
var __export = (target, all) => {
|
|
9
23
|
for (var name in all)
|
|
10
24
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -18,6 +32,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
32
|
return to;
|
|
19
33
|
};
|
|
20
34
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
35
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
36
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
37
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
38
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
39
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
40
|
mod
|
|
23
41
|
));
|
|
@@ -26,7 +44,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
26
44
|
// src/index.ts
|
|
27
45
|
var src_exports = {};
|
|
28
46
|
__export(src_exports, {
|
|
29
|
-
Collapse: () => Collapse
|
|
47
|
+
Collapse: () => Collapse,
|
|
48
|
+
Fade: () => Fade
|
|
30
49
|
});
|
|
31
50
|
module.exports = __toCommonJS(src_exports);
|
|
32
51
|
|
|
@@ -34,11 +53,17 @@ module.exports = __toCommonJS(src_exports);
|
|
|
34
53
|
var import_Collapse = __toESM(require("@mui/material/Collapse"));
|
|
35
54
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
55
|
var Collapse = (props) => {
|
|
37
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Collapse.default, {
|
|
38
|
-
|
|
39
|
-
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Collapse.default, __spreadValues({}, props));
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// src/lib/Fade.tsx
|
|
60
|
+
var import_Fade = __toESM(require("@mui/material/Fade"));
|
|
61
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
62
|
+
var Fade = (props) => {
|
|
63
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_Fade.default, __spreadValues({}, props));
|
|
40
64
|
};
|
|
41
65
|
// Annotate the CommonJS export names for ESM import in node:
|
|
42
66
|
0 && (module.exports = {
|
|
43
|
-
Collapse
|
|
67
|
+
Collapse,
|
|
68
|
+
Fade
|
|
44
69
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,34 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
|
|
1
18
|
// src/lib/Collapse.tsx
|
|
2
19
|
import MuiCollapse from "@mui/material/Collapse";
|
|
3
20
|
import { jsx } from "react/jsx-runtime";
|
|
4
21
|
var Collapse = (props) => {
|
|
5
|
-
return /* @__PURE__ */ jsx(MuiCollapse, {
|
|
6
|
-
|
|
7
|
-
|
|
22
|
+
return /* @__PURE__ */ jsx(MuiCollapse, __spreadValues({}, props));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// src/lib/Fade.tsx
|
|
26
|
+
import MuiFade from "@mui/material/Fade";
|
|
27
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
28
|
+
var Fade = (props) => {
|
|
29
|
+
return /* @__PURE__ */ jsx2(MuiFade, __spreadValues({}, props));
|
|
8
30
|
};
|
|
9
31
|
export {
|
|
10
|
-
Collapse
|
|
32
|
+
Collapse,
|
|
33
|
+
Fade
|
|
11
34
|
};
|
package/jest.config.js
CHANGED
|
@@ -4,4 +4,14 @@ module.exports = {
|
|
|
4
4
|
...global,
|
|
5
5
|
displayName: 'transitions',
|
|
6
6
|
coverageDirectory: '../../coverage/transitions',
|
|
7
|
+
/* TODO: Update to latest Jest snapshotFormat
|
|
8
|
+
* By default Nx has kept the older style of Jest Snapshot formats
|
|
9
|
+
* to prevent breaking of any existing tests with snapshots.
|
|
10
|
+
* It's recommend you update to the latest format.
|
|
11
|
+
* You can do this by removing snapshotFormat property
|
|
12
|
+
* and running tests with --update-snapshot flag.
|
|
13
|
+
* Example: From within the project directory, run "nx test --update-snapshot"
|
|
14
|
+
* More info: https://jestjs.io/docs/upgrading-to-jest29#snapshot-format
|
|
15
|
+
*/
|
|
16
|
+
snapshotFormat: { escapeString: true, printBasicPrototype: true },
|
|
7
17
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/mui-transitions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Availity MUI Transitions Component - part of the @availity/element design system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -32,11 +32,13 @@
|
|
|
32
32
|
"publish:canary": "yarn npm publish --access public --tag canary"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@mui
|
|
35
|
+
"@availity/mui-alert": "^0.5.13",
|
|
36
|
+
"@availity/mui-typography": "^0.2.0",
|
|
37
|
+
"@mui/material": "^5.15.15",
|
|
36
38
|
"react": "18.2.0",
|
|
37
39
|
"react-dom": "18.2.0",
|
|
38
|
-
"tsup": "^
|
|
39
|
-
"typescript": "^4.
|
|
40
|
+
"tsup": "^8.0.2",
|
|
41
|
+
"typescript": "^5.4.5"
|
|
40
42
|
},
|
|
41
43
|
"peerDependencies": {
|
|
42
44
|
"@mui/material": "^5.11.9",
|
package/project.json
CHANGED
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
"tags": [],
|
|
7
7
|
"targets": {
|
|
8
8
|
"lint": {
|
|
9
|
-
"executor": "@
|
|
9
|
+
"executor": "@nx/eslint:lint",
|
|
10
10
|
"options": {
|
|
11
11
|
"eslintConfig": ".eslintrc.json",
|
|
12
|
-
"lintFilePatterns": ["packages/transitions/**/*.{js,ts}"],
|
|
13
12
|
"silent": false,
|
|
14
13
|
"fix": false,
|
|
15
14
|
"cache": true,
|
|
@@ -22,20 +21,20 @@
|
|
|
22
21
|
}
|
|
23
22
|
},
|
|
24
23
|
"test": {
|
|
25
|
-
"executor": "@
|
|
26
|
-
"outputs": ["coverage/transitions"],
|
|
24
|
+
"executor": "@nx/jest:jest",
|
|
25
|
+
"outputs": ["{workspaceRoot}/coverage/transitions"],
|
|
27
26
|
"options": {
|
|
28
|
-
"jestConfig": "packages/transitions/jest.config.js"
|
|
29
|
-
"passWithNoTests": true
|
|
27
|
+
"jestConfig": "packages/transitions/jest.config.js"
|
|
30
28
|
}
|
|
31
29
|
},
|
|
32
30
|
"version": {
|
|
33
31
|
"executor": "@jscutlery/semver:version",
|
|
34
32
|
"options": {
|
|
35
33
|
"preset": "conventional",
|
|
36
|
-
"commitMessageFormat": "chore(
|
|
37
|
-
"tagPrefix": "@availity
|
|
38
|
-
"trackDeps": true
|
|
34
|
+
"commitMessageFormat": "chore({projectName}): release version ${version} [skip ci]",
|
|
35
|
+
"tagPrefix": "@availity/{projectName}@",
|
|
36
|
+
"trackDeps": true,
|
|
37
|
+
"skipCommitTypes": ["docs"]
|
|
39
38
|
}
|
|
40
39
|
}
|
|
41
40
|
}
|
package/src/index.ts
CHANGED
|
@@ -13,7 +13,7 @@ import TableHead from '@mui/material/TableHead';
|
|
|
13
13
|
import TableRow from '@mui/material/TableRow';
|
|
14
14
|
import TableCell from '@mui/material/TableCell';
|
|
15
15
|
import TableBody from '@mui/material/TableBody';
|
|
16
|
-
import Alert from '@mui
|
|
16
|
+
import { Alert } from '@availity/mui-alert';
|
|
17
17
|
|
|
18
18
|
/** Expand from the start edge of the child element. */
|
|
19
19
|
const meta: Meta<typeof Collapse> = {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Each exported component in the package should have its own stories file
|
|
2
|
+
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
|
+
import { Alert } from '@availity/mui-alert';
|
|
6
|
+
import { Fade, FadeProps } from './Fade';
|
|
7
|
+
|
|
8
|
+
/** Expand from the start edge of the child element. */
|
|
9
|
+
const meta: Meta<typeof Fade> = {
|
|
10
|
+
title: 'Components/Transitions/Fade',
|
|
11
|
+
component: Fade,
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
|
|
17
|
+
export const _Fade: StoryObj<typeof Fade> = {
|
|
18
|
+
render: (args: FadeProps) => {
|
|
19
|
+
const [visible, setVisible] = useState(true);
|
|
20
|
+
|
|
21
|
+
const onClose = () => {
|
|
22
|
+
setVisible(false);
|
|
23
|
+
setTimeout(() => setVisible(true), 1000);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Fade in={visible} {...args}>
|
|
28
|
+
<div>
|
|
29
|
+
<Alert onClose={onClose}>Dismissable Alert</Alert>
|
|
30
|
+
</div>
|
|
31
|
+
</Fade>
|
|
32
|
+
);
|
|
33
|
+
},
|
|
34
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { render } from '@testing-library/react';
|
|
2
|
+
import { Typography } from '@availity/mui-typography';
|
|
3
|
+
import { Fade } from './Fade';
|
|
4
|
+
|
|
5
|
+
describe('Fade', () => {
|
|
6
|
+
test('should render successfully', () => {
|
|
7
|
+
const { getByText } = render(
|
|
8
|
+
<Fade>
|
|
9
|
+
<Typography>Test</Typography>
|
|
10
|
+
</Fade>
|
|
11
|
+
);
|
|
12
|
+
expect(getByText('Test')).toBeTruthy();
|
|
13
|
+
});
|
|
14
|
+
});
|