@availity/mui-snackbar 0.2.0 → 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
CHANGED
|
@@ -2,6 +2,36 @@
|
|
|
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-snackbar@1.0.0-alpha.0...@availity/mui-snackbar@1.0.0) (2025-02-25)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `mui-alert` updated to version `0.2.0`
|
|
10
|
+
* `mui-button` updated to version `0.2.0`
|
|
11
|
+
* `mui-layout` updated to version `0.2.0`
|
|
12
|
+
* `mui-transitions` updated to version `0.2.0`
|
|
13
|
+
|
|
14
|
+
### ⚠ BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* upgrade to @mui/material v6
|
|
17
|
+
|
|
18
|
+
### Miscellaneous Chores
|
|
19
|
+
|
|
20
|
+
* element v1 release ([a6e3567](https://github.com/Availity/element/commit/a6e35671185b9f13d25c7a39c4488ecb8774633e))
|
|
21
|
+
|
|
22
|
+
## [1.0.0-alpha.0](https://github.com/Availity/element/compare/@availity/mui-snackbar@0.2.0...@availity/mui-snackbar@1.0.0-alpha.0) (2025-02-24)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### ⚠ BREAKING CHANGES
|
|
26
|
+
|
|
27
|
+
* upgraded to @mui/material v6
|
|
28
|
+
* **element:** upgraded to @mui/material v6
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
* **element:** upgrade to @mui/material v6 ([cb958bb](https://github.com/Availity/element/commit/cb958bba99a4f1ee6dab323f0ff54b69e6fd3493))
|
|
33
|
+
* upgrade @mui/material ([571453a](https://github.com/Availity/element/commit/571453a34b21c344594ab4c03bc497d19aba942b))
|
|
34
|
+
|
|
5
35
|
## [0.2.0](https://github.com/Availity/element/compare/@availity/mui-snackbar@0.1.7...@availity/mui-snackbar@0.2.0) (2025-02-04)
|
|
6
36
|
|
|
7
37
|
### Dependency Updates
|
package/dist/index.js
CHANGED
|
@@ -42,11 +42,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
42
42
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
43
43
|
|
|
44
44
|
// src/index.ts
|
|
45
|
-
var
|
|
46
|
-
__export(
|
|
45
|
+
var index_exports = {};
|
|
46
|
+
__export(index_exports, {
|
|
47
47
|
Snackbar: () => Snackbar
|
|
48
48
|
});
|
|
49
|
-
module.exports = __toCommonJS(
|
|
49
|
+
module.exports = __toCommonJS(index_exports);
|
|
50
50
|
|
|
51
51
|
// src/lib/Snackbar.tsx
|
|
52
52
|
var import_Snackbar = __toESM(require("@mui/material/Snackbar"));
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Markdown } from '@storybook/blocks';
|
|
2
2
|
import { Meta } from '@storybook/addon-docs';
|
|
3
3
|
import ReadMe from './README.md?raw';
|
|
4
|
+
import CHANGELOG from './CHANGELOG.md?raw';
|
|
4
5
|
|
|
5
6
|
<Meta title="Components/Snackbar/Introduction" />
|
|
6
7
|
|
|
7
8
|
<Markdown>{ReadMe}</Markdown>
|
|
9
|
+
|
|
10
|
+
<Markdown>{CHANGELOG}</Markdown>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/mui-snackbar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Availity MUI Snackbar Component - part of the @availity/element design system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -40,18 +40,18 @@
|
|
|
40
40
|
"publish:canary": "yarn npm publish --access public --tag canary"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@availity/mui-alert": "0.
|
|
44
|
-
"@availity/mui-button": "0.
|
|
45
|
-
"@availity/mui-layout": "0.
|
|
46
|
-
"@availity/mui-transitions": "0.
|
|
47
|
-
"@mui/material": "^
|
|
43
|
+
"@availity/mui-alert": "1.0.0",
|
|
44
|
+
"@availity/mui-button": "1.0.0",
|
|
45
|
+
"@availity/mui-layout": "1.0.0",
|
|
46
|
+
"@availity/mui-transitions": "1.0.0",
|
|
47
|
+
"@mui/material": "^6.4.5",
|
|
48
48
|
"react": "18.2.0",
|
|
49
49
|
"react-dom": "18.2.0",
|
|
50
|
-
"tsup": "^8.
|
|
50
|
+
"tsup": "^8.3.6",
|
|
51
51
|
"typescript": "^5.4.5"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@mui/material": "^
|
|
54
|
+
"@mui/material": "^6.4.5",
|
|
55
55
|
"react": ">=16.3.0"
|
|
56
56
|
},
|
|
57
57
|
"publishConfig": {
|
|
@@ -24,11 +24,11 @@ const meta: Meta<typeof Snackbar> = {
|
|
|
24
24
|
|
|
25
25
|
export default meta;
|
|
26
26
|
|
|
27
|
-
const SnackbarStoryPreview = styled(
|
|
27
|
+
const SnackbarStoryPreview = styled('div', {
|
|
28
28
|
name: 'MuiSnackbar',
|
|
29
29
|
slot: 'Root',
|
|
30
30
|
overridesResolver: (props, styles) => styles.root,
|
|
31
|
-
})(
|
|
31
|
+
})({});
|
|
32
32
|
|
|
33
33
|
export const _Snackbar: StoryObj<typeof Snackbar> = {
|
|
34
34
|
render: (args: SnackbarProps) => {
|
|
@@ -38,10 +38,7 @@ export const _Snackbar: StoryObj<typeof Snackbar> = {
|
|
|
38
38
|
setOpen(true);
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
const handleClose = (
|
|
42
|
-
event: SyntheticEvent | Event,
|
|
43
|
-
reason?: SnackbarCloseReason,
|
|
44
|
-
) => {
|
|
41
|
+
const handleClose = (event: SyntheticEvent | Event, reason?: SnackbarCloseReason) => {
|
|
45
42
|
if (reason === 'clickaway') {
|
|
46
43
|
return;
|
|
47
44
|
}
|
|
@@ -56,19 +53,18 @@ export const _Snackbar: StoryObj<typeof Snackbar> = {
|
|
|
56
53
|
);
|
|
57
54
|
|
|
58
55
|
return (
|
|
59
|
-
<Box sx={{minHeight: '200px'}}>
|
|
56
|
+
<Box sx={{ minHeight: '200px' }}>
|
|
60
57
|
<Button onClick={handleClick}>Open Snackbar</Button>
|
|
61
|
-
<Snackbar
|
|
62
|
-
{
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<Alert icon={false} onClose={handleClose} action={action} severity='info'>Alert Text</Alert>
|
|
58
|
+
<Snackbar {...args} open={open}>
|
|
59
|
+
<Alert icon={false} onClose={handleClose} action={action} severity="info">
|
|
60
|
+
Alert Text
|
|
61
|
+
</Alert>
|
|
66
62
|
</Snackbar>
|
|
67
63
|
</Box>
|
|
68
64
|
);
|
|
69
65
|
},
|
|
70
66
|
args: {
|
|
71
|
-
anchorOrigin: { vertical: 'bottom', horizontal: 'left'},
|
|
67
|
+
anchorOrigin: { vertical: 'bottom', horizontal: 'left' },
|
|
72
68
|
autoHideDuration: 6000,
|
|
73
69
|
},
|
|
74
70
|
};
|
|
@@ -82,9 +78,13 @@ export const _Actions: StoryObj<typeof Snackbar> = {
|
|
|
82
78
|
setTimeout(() => setVisible(true), 1000);
|
|
83
79
|
};
|
|
84
80
|
|
|
85
|
-
const actionButton =
|
|
81
|
+
const actionButton = (
|
|
82
|
+
<Link component="button" onClick={onClose}>
|
|
83
|
+
Action Button
|
|
84
|
+
</Link>
|
|
85
|
+
);
|
|
86
86
|
|
|
87
|
-
const actionLink = <Link href=
|
|
87
|
+
const actionLink = <Link href="#">Action Link</Link>;
|
|
88
88
|
|
|
89
89
|
return (
|
|
90
90
|
<Grid container spacing={1} maxWidth="620px">
|
|
@@ -134,8 +134,8 @@ export const _Actions: StoryObj<typeof Snackbar> = {
|
|
|
134
134
|
</Collapse>
|
|
135
135
|
</Grid>
|
|
136
136
|
</Grid>
|
|
137
|
-
)
|
|
138
|
-
}
|
|
137
|
+
);
|
|
138
|
+
},
|
|
139
139
|
};
|
|
140
140
|
|
|
141
141
|
export const _Alerts: StoryObj<typeof Snackbar> = {
|
|
@@ -190,8 +190,8 @@ export const _Alerts: StoryObj<typeof Snackbar> = {
|
|
|
190
190
|
</Collapse>
|
|
191
191
|
</Grid>
|
|
192
192
|
</Grid>
|
|
193
|
-
)
|
|
194
|
-
}
|
|
193
|
+
);
|
|
194
|
+
},
|
|
195
195
|
};
|
|
196
196
|
|
|
197
197
|
interface SnackbarMessage {
|
|
@@ -204,9 +204,7 @@ export const _ConsecutiveSnackbars: StoryObj<typeof Snackbar> = {
|
|
|
204
204
|
render: () => {
|
|
205
205
|
const [snackPack, setSnackPack] = useState<readonly SnackbarMessage[]>([]);
|
|
206
206
|
const [open, setOpen] = useState(false);
|
|
207
|
-
const [messageInfo, setMessageInfo] = useState<SnackbarMessage | undefined>(
|
|
208
|
-
undefined,
|
|
209
|
-
);
|
|
207
|
+
const [messageInfo, setMessageInfo] = useState<SnackbarMessage | undefined>(undefined);
|
|
210
208
|
|
|
211
209
|
useEffect(() => {
|
|
212
210
|
if (snackPack.length && !messageInfo) {
|
|
@@ -224,10 +222,7 @@ export const _ConsecutiveSnackbars: StoryObj<typeof Snackbar> = {
|
|
|
224
222
|
setSnackPack((prev) => [...prev, { message, key: new Date().getTime() }]);
|
|
225
223
|
};
|
|
226
224
|
|
|
227
|
-
const handleClose = (
|
|
228
|
-
event: SyntheticEvent | Event,
|
|
229
|
-
reason?: SnackbarCloseReason,
|
|
230
|
-
) => {
|
|
225
|
+
const handleClose = (event: SyntheticEvent | Event, reason?: SnackbarCloseReason) => {
|
|
231
226
|
if (reason === 'clickaway') {
|
|
232
227
|
return;
|
|
233
228
|
}
|
|
@@ -241,10 +236,10 @@ export const _ConsecutiveSnackbars: StoryObj<typeof Snackbar> = {
|
|
|
241
236
|
return (
|
|
242
237
|
<Box minHeight="250px" gap="8px">
|
|
243
238
|
<Grid container spacing={2}>
|
|
244
|
-
<Grid
|
|
239
|
+
<Grid size={{ xs: 12 }}>
|
|
245
240
|
<Button onClick={handleClick('Message A')}>Show message A</Button>
|
|
246
241
|
</Grid>
|
|
247
|
-
<Grid
|
|
242
|
+
<Grid size={{ xs: 12 }}>
|
|
248
243
|
<Button onClick={handleClick('Message B')}>Show message B</Button>
|
|
249
244
|
</Grid>
|
|
250
245
|
</Grid>
|
|
@@ -261,5 +256,5 @@ export const _ConsecutiveSnackbars: StoryObj<typeof Snackbar> = {
|
|
|
261
256
|
</Snackbar>
|
|
262
257
|
</Box>
|
|
263
258
|
);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
259
|
+
},
|
|
260
|
+
};
|