@availity/mui-breadcrumbs 0.1.8 → 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 CHANGED
@@ -2,28 +2,41 @@
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-breadcrumbs@0.1.9...@availity/mui-breadcrumbs@0.2.0) (2023-12-14)
6
+
7
+
8
+ ### Features
9
+
10
+ * add form story ([11d1f6c](https://github.com/Availity/element/commit/11d1f6c6191540bf02ff42d4056ac553eecc8c73))
11
+
12
+ ## [0.1.9](https://github.com/Availity/element/compare/@availity/mui-breadcrumbs@0.1.8...@availity/mui-breadcrumbs@0.1.9) (2023-11-16)
13
+
14
+ ### Dependency Updates
15
+
16
+ - `mui-icon` updated to version `0.7.3`
17
+ - `mui-link` updated to version `0.2.4`
18
+
5
19
  ## [0.1.8](https://github.com/Availity/element/compare/@availity/mui-breadcrumbs@0.1.7...@availity/mui-breadcrumbs@0.1.8) (2023-11-08)
6
20
 
7
21
  ### Dependency Updates
8
22
 
9
- * `mui-icon` updated to version `0.7.2`
10
- * `mui-link` updated to version `0.2.3`
23
+ - `mui-icon` updated to version `0.7.2`
24
+ - `mui-link` updated to version `0.2.3`
25
+
11
26
  ## [0.1.7](https://github.com/Availity/element/compare/@availity/mui-breadcrumbs@0.1.6...@availity/mui-breadcrumbs@0.1.7) (2023-11-07)
12
27
 
13
28
  ## [0.1.6](https://github.com/Availity/element/compare/@availity/mui-breadcrumbs@0.1.5...@availity/mui-breadcrumbs@0.1.6) (2023-10-25)
14
29
 
15
-
16
30
  ### Bug Fixes
17
31
 
18
- * **mui-breadcrumbs:** home link should not use loadApp ([dfcb187](https://github.com/Availity/element/commit/dfcb18756888865e2ab25535993979ddc15b9747))
19
- * **mui-breadcrumbs:** remove target on home link ([81d553d](https://github.com/Availity/element/commit/81d553d2601a228259db84f3346fc3abba1c2a88))
32
+ - **mui-breadcrumbs:** home link should not use loadApp ([dfcb187](https://github.com/Availity/element/commit/dfcb18756888865e2ab25535993979ddc15b9747))
33
+ - **mui-breadcrumbs:** remove target on home link ([81d553d](https://github.com/Availity/element/commit/81d553d2601a228259db84f3346fc3abba1c2a88))
20
34
 
21
35
  ## [0.1.5](https://github.com/Availity/element/compare/@availity/mui-breadcrumbs@0.1.4...@availity/mui-breadcrumbs@0.1.5) (2023-10-25)
22
36
 
23
-
24
37
  ### Bug Fixes
25
38
 
26
- * **mui-breadcrumbs:** home link target and separator tweaks ([4eb1b5f](https://github.com/Availity/element/commit/4eb1b5f172d072fe14ac9dc5b9d22707de7ca0b5))
39
+ - **mui-breadcrumbs:** home link target and separator tweaks ([4eb1b5f](https://github.com/Availity/element/commit/4eb1b5f172d072fe14ac9dc5b9d22707de7ca0b5))
27
40
 
28
41
  ## [0.1.4](https://github.com/Availity/element/compare/@availity/mui-breadcrumbs@0.1.3...@availity/mui-breadcrumbs@0.1.4) (2023-10-06)
29
42
 
package/dist/index.js CHANGED
@@ -29,6 +29,18 @@ var import_material = require("@mui/material");
29
29
  var import_mui_icon = require("@availity/mui-icon");
30
30
  var import_mui_link = require("@availity/mui-link");
31
31
  var import_jsx_runtime = require("react/jsx-runtime");
32
+ var Breadcrumb = ({ name, url }) => {
33
+ const props = {
34
+ "aria-label": name,
35
+ children: name
36
+ };
37
+ return url ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_link.Link, {
38
+ ...props,
39
+ href: url
40
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, {
41
+ ...props
42
+ });
43
+ };
32
44
  var Breadcrumbs = ({
33
45
  active,
34
46
  children,
@@ -37,18 +49,6 @@ var Breadcrumbs = ({
37
49
  homeUrl = "/public/apps/dashboard",
38
50
  ...rest
39
51
  }) => {
40
- const renderBreadCrumb = ({ name = emptyState, url }) => {
41
- const props = {
42
- "aria-label": name,
43
- children: name
44
- };
45
- return url ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_link.Link, {
46
- ...props,
47
- href: url
48
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, {
49
- ...props
50
- });
51
- };
52
52
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Breadcrumbs, {
53
53
  ...rest,
54
54
  separator: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_icon.NavigateNextIcon, {
@@ -63,7 +63,10 @@ var Breadcrumbs = ({
63
63
  loadApp: false,
64
64
  children: "Home"
65
65
  }),
66
- crumbs && crumbs.length > 0 && crumbs.map((crumb) => renderBreadCrumb(crumb)),
66
+ crumbs && crumbs.length > 0 && crumbs.map(({ name = emptyState, url }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Breadcrumb, {
67
+ name,
68
+ url
69
+ }, name)),
67
70
  children,
68
71
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, {
69
72
  children: active || emptyState
package/dist/index.mjs CHANGED
@@ -3,6 +3,18 @@ import { Breadcrumbs as MuiBreadcrumbs, Typography } from "@mui/material";
3
3
  import { NavigateNextIcon, MoreHorizontalIcon } from "@availity/mui-icon";
4
4
  import { Link } from "@availity/mui-link";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
+ var Breadcrumb = ({ name, url }) => {
7
+ const props = {
8
+ "aria-label": name,
9
+ children: name
10
+ };
11
+ return url ? /* @__PURE__ */ jsx(Link, {
12
+ ...props,
13
+ href: url
14
+ }) : /* @__PURE__ */ jsx(Typography, {
15
+ ...props
16
+ });
17
+ };
6
18
  var Breadcrumbs = ({
7
19
  active,
8
20
  children,
@@ -11,18 +23,6 @@ var Breadcrumbs = ({
11
23
  homeUrl = "/public/apps/dashboard",
12
24
  ...rest
13
25
  }) => {
14
- const renderBreadCrumb = ({ name = emptyState, url }) => {
15
- const props = {
16
- "aria-label": name,
17
- children: name
18
- };
19
- return url ? /* @__PURE__ */ jsx(Link, {
20
- ...props,
21
- href: url
22
- }) : /* @__PURE__ */ jsx(Typography, {
23
- ...props
24
- });
25
- };
26
26
  return /* @__PURE__ */ jsxs(MuiBreadcrumbs, {
27
27
  ...rest,
28
28
  separator: /* @__PURE__ */ jsx(NavigateNextIcon, {
@@ -37,7 +37,10 @@ var Breadcrumbs = ({
37
37
  loadApp: false,
38
38
  children: "Home"
39
39
  }),
40
- crumbs && crumbs.length > 0 && crumbs.map((crumb) => renderBreadCrumb(crumb)),
40
+ crumbs && crumbs.length > 0 && crumbs.map(({ name = emptyState, url }) => /* @__PURE__ */ jsx(Breadcrumb, {
41
+ name,
42
+ url
43
+ }, name)),
41
44
  children,
42
45
  /* @__PURE__ */ jsx(Typography, {
43
46
  children: active || emptyState
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/mui-breadcrumbs",
3
- "version": "0.1.8",
3
+ "version": "0.2.0",
4
4
  "description": "Availity MUI Breadcrumbs Component - part of the @availity/element design system",
5
5
  "keywords": [
6
6
  "react",
@@ -46,7 +46,7 @@
46
46
  "access": "public"
47
47
  },
48
48
  "dependencies": {
49
- "@availity/mui-icon": "^0.7.2",
50
- "@availity/mui-link": "^0.2.3"
49
+ "@availity/mui-icon": "^0.7.3",
50
+ "@availity/mui-link": "^0.2.4"
51
51
  }
52
52
  }
@@ -26,6 +26,15 @@ export interface BreadcrumbsProps extends Omit<MuiBreadcrumbsProps, 'separator'
26
26
  homeUrl?: string;
27
27
  }
28
28
 
29
+ const Breadcrumb = ({ name, url }: Crumb) => {
30
+ const props = {
31
+ 'aria-label': name,
32
+ children: name,
33
+ };
34
+
35
+ return url ? <Link {...props} href={url} /> : <Typography {...props} />;
36
+ };
37
+
29
38
  export const Breadcrumbs = ({
30
39
  active,
31
40
  children,
@@ -34,15 +43,6 @@ export const Breadcrumbs = ({
34
43
  homeUrl = '/public/apps/dashboard',
35
44
  ...rest
36
45
  }: BreadcrumbsProps): JSX.Element => {
37
- const renderBreadCrumb = ({ name = emptyState, url }: Crumb) => {
38
- const props = {
39
- 'aria-label': name,
40
- children: name,
41
- };
42
-
43
- return url ? <Link {...props} href={url} /> : <Typography {...props} />;
44
- };
45
-
46
46
  return (
47
47
  <MuiBreadcrumbs
48
48
  {...rest}
@@ -53,9 +53,11 @@ export const Breadcrumbs = ({
53
53
  <Link aria-label="Home" href={homeUrl} loadApp={false}>
54
54
  Home
55
55
  </Link>
56
- {crumbs && crumbs.length > 0 && crumbs.map((crumb) => renderBreadCrumb(crumb))}
56
+ {crumbs &&
57
+ crumbs.length > 0 &&
58
+ crumbs.map(({ name = emptyState, url }) => <Breadcrumb name={name} url={url} key={name} />)}
57
59
  {children}
58
- {<Typography>{active || emptyState}</Typography>}
60
+ <Typography>{active || emptyState}</Typography>
59
61
  </MuiBreadcrumbs>
60
62
  );
61
63
  };