@availity/mui-snackbar 0.1.7 → 1.0.0-alpha.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,32 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [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)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * upgraded to @mui/material v6
11
+ * **element:** upgraded to @mui/material v6
12
+
13
+ ### Features
14
+
15
+ * **element:** upgrade to @mui/material v6 ([cb958bb](https://github.com/Availity/element/commit/cb958bba99a4f1ee6dab323f0ff54b69e6fd3493))
16
+ * upgrade @mui/material ([571453a](https://github.com/Availity/element/commit/571453a34b21c344594ab4c03bc497d19aba942b))
17
+
18
+ ## [0.2.0](https://github.com/Availity/element/compare/@availity/mui-snackbar@0.1.7...@availity/mui-snackbar@0.2.0) (2025-02-04)
19
+
20
+ ### Dependency Updates
21
+
22
+ * `mui-alert` updated to version `0.1.7`
23
+ * `mui-button` updated to version `0.1.7`
24
+ * `mui-layout` updated to version `0.1.7`
25
+ * `mui-transitions` updated to version `0.1.7`
26
+
27
+ ### Features
28
+
29
+ * configure package.json to allow esm to be used ([5a5393d](https://github.com/Availity/element/commit/5a5393de761f52608e714dd94a05106937dd95db))
30
+
5
31
  ## [0.1.7](https://github.com/Availity/element/compare/@availity/mui-snackbar@0.1.6...@availity/mui-snackbar@0.1.7) (2025-01-27)
6
32
 
7
33
  ### 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 src_exports = {};
46
- __export(src_exports, {
45
+ var index_exports = {};
46
+ __export(index_exports, {
47
47
  Snackbar: () => Snackbar
48
48
  });
49
- module.exports = __toCommonJS(src_exports);
49
+ module.exports = __toCommonJS(index_exports);
50
50
 
51
51
  // src/lib/Snackbar.tsx
52
52
  var import_Snackbar = __toESM(require("@mui/material/Snackbar"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/mui-snackbar",
3
- "version": "0.1.7",
3
+ "version": "1.0.0-alpha.0",
4
4
  "description": "Availity MUI Snackbar 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",
@@ -32,18 +40,18 @@
32
40
  "publish:canary": "yarn npm publish --access public --tag canary"
33
41
  },
34
42
  "devDependencies": {
35
- "@availity/mui-alert": "0.7.4",
36
- "@availity/mui-button": "0.6.16",
37
- "@availity/mui-layout": "0.2.0",
38
- "@availity/mui-transitions": "0.3.5",
39
- "@mui/material": "^5.15.15",
43
+ "@availity/mui-alert": "1.0.0-alpha.0",
44
+ "@availity/mui-button": "1.0.0-alpha.0",
45
+ "@availity/mui-layout": "1.0.0-alpha.0",
46
+ "@availity/mui-transitions": "1.0.0-alpha.0",
47
+ "@mui/material": "^6.4.5",
40
48
  "react": "18.2.0",
41
49
  "react-dom": "18.2.0",
42
- "tsup": "^8.0.2",
50
+ "tsup": "^8.3.6",
43
51
  "typescript": "^5.4.5"
44
52
  },
45
53
  "peerDependencies": {
46
- "@mui/material": "^5.11.9",
54
+ "@mui/material": "^6.4.5",
47
55
  "react": ">=16.3.0"
48
56
  },
49
57
  "publishConfig": {
@@ -24,11 +24,11 @@ const meta: Meta<typeof Snackbar> = {
24
24
 
25
25
  export default meta;
26
26
 
27
- const SnackbarStoryPreview = styled("div", {
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
- {...args}
63
- open={open}
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 = <Link component="button" onClick={onClose}>Action Button</Link>;
81
+ const actionButton = (
82
+ <Link component="button" onClick={onClose}>
83
+ Action Button
84
+ </Link>
85
+ );
86
86
 
87
- const actionLink = <Link href='#' >Action Link</Link>;
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 xs={12}>
239
+ <Grid size={{ xs: 12 }}>
245
240
  <Button onClick={handleClick('Message A')}>Show message A</Button>
246
241
  </Grid>
247
- <Grid xs={12}>
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
+ };
File without changes