@availity/mui-page-header 1.1.37 → 1.2.1

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,23 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.2.1](https://github.com/Availity/element/compare/@availity/mui-page-header@1.2.0...@availity/mui-page-header@1.2.1) (2025-08-21)
6
+
7
+ ### Dependency Updates
8
+
9
+ * `mui-spaces` updated to version `1.2.0`
10
+ ## [1.2.0](https://github.com/Availity/element/compare/@availity/mui-page-header@1.1.37...@availity/mui-page-header@1.2.0) (2025-08-20)
11
+
12
+
13
+ ### Features
14
+
15
+ * **mui-page-header:** add tab variant ([fd6bc4e](https://github.com/Availity/element/commit/fd6bc4ec9b467ef6e885fe27fdee35ac30b87758))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **mui-page-header:** button spacings ([8c36a05](https://github.com/Availity/element/commit/8c36a05d5502f2a9f476d83d9cc994eb36a32b3a))
21
+
5
22
  ## [1.1.37](https://github.com/Availity/element/compare/@availity/mui-page-header@1.1.36...@availity/mui-page-header@1.1.37) (2025-07-02)
6
23
 
7
24
  ### Dependency Updates
package/dist/index.d.mts CHANGED
@@ -40,7 +40,9 @@ interface PageHeaderProps {
40
40
  help?: Help;
41
41
  /** Logo attributes */
42
42
  logo?: LogoSpaceId | LogoPayerId;
43
+ /** The divider below the header, defaults to `<Divider />`. Can be replaced with `<TabList>`. */
44
+ divider?: JSX.Element;
43
45
  }
44
- declare const PageHeader: ({ breadcrumbs, buttons, feedback, headerText, logo, help, }: PageHeaderProps) => JSX.Element;
46
+ declare const PageHeader: ({ breadcrumbs, buttons, feedback, headerText, logo, help, divider }: PageHeaderProps) => JSX.Element;
45
47
 
46
48
  export { type ButtonsProps, type Help, PageHeader, type PageHeaderProps };
package/dist/index.d.ts CHANGED
@@ -40,7 +40,9 @@ interface PageHeaderProps {
40
40
  help?: Help;
41
41
  /** Logo attributes */
42
42
  logo?: LogoSpaceId | LogoPayerId;
43
+ /** The divider below the header, defaults to `<Divider />`. Can be replaced with `<TabList>`. */
44
+ divider?: JSX.Element;
43
45
  }
44
- declare const PageHeader: ({ breadcrumbs, buttons, feedback, headerText, logo, help, }: PageHeaderProps) => JSX.Element;
46
+ declare const PageHeader: ({ breadcrumbs, buttons, feedback, headerText, logo, help, divider }: PageHeaderProps) => JSX.Element;
45
47
 
46
48
  export { type ButtonsProps, type Help, PageHeader, type PageHeaderProps };
package/dist/index.js CHANGED
@@ -101,7 +101,8 @@ var PageHeader = ({
101
101
  feedback = false,
102
102
  headerText,
103
103
  logo,
104
- help
104
+ help,
105
+ divider = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_divider.Divider, {})
105
106
  }) => {
106
107
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
107
108
  import_mui_layout.Grid,
@@ -129,17 +130,17 @@ var PageHeader = ({
129
130
  logo && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_layout.Grid, { container: true, justifyContent: "end", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Logo, __spreadValues({}, logo)) })
130
131
  ] })
131
132
  ] }) : null,
132
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_mui_layout.Grid, { direction: "row", container: true, sx: { marginBottom: 2, alignItems: "center", justifyContent: "space-between" }, children: [
133
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_mui_layout.Grid, { direction: "row", container: true, sx: { marginBottom: 2, alignItems: "center", justifyContent: "space-between" }, spacing: 2, children: [
133
134
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_layout.Grid, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_typography.Typography, { variant: "h1", children: headerText }) }),
134
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_mui_layout.Grid, { container: true, sx: { width: "auto" }, children: [
135
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_mui_layout.Grid, { container: true, sx: { width: "auto" }, spacing: 2, children: [
135
136
  buttons && buttons.length > 0 && (buttons == null ? void 0 : buttons.map((_a) => {
136
137
  var _b = _a, { key } = _b, buttonProps = __objRest(_b, ["key"]);
137
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_layout.Grid, { marginLeft: 2, height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_button.Button, __spreadProps(__spreadValues({}, buttonProps), { size: "large", color: "secondary" })) }, key);
138
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_layout.Grid, { height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_button.Button, __spreadProps(__spreadValues({}, buttonProps), { size: "large", color: "secondary" })) }, key);
138
139
  })),
139
- feedback ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_layout.Grid, { sx: { marginLeft: 2, height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_feedback.Feedback, { appName: headerText }) }) : null
140
+ feedback ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_layout.Grid, { sx: { height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_feedback.Feedback, { appName: headerText }) }) : null
140
141
  ] })
141
142
  ] }),
142
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_mui_divider.Divider, {})
143
+ divider
143
144
  ]
144
145
  }
145
146
  );
package/dist/index.mjs CHANGED
@@ -68,7 +68,8 @@ var PageHeader = ({
68
68
  feedback = false,
69
69
  headerText,
70
70
  logo,
71
- help
71
+ help,
72
+ divider = /* @__PURE__ */ jsx(Divider, {})
72
73
  }) => {
73
74
  return /* @__PURE__ */ jsxs(
74
75
  Grid,
@@ -96,17 +97,17 @@ var PageHeader = ({
96
97
  logo && /* @__PURE__ */ jsx(Grid, { container: true, justifyContent: "end", children: /* @__PURE__ */ jsx(Logo, __spreadValues({}, logo)) })
97
98
  ] })
98
99
  ] }) : null,
99
- /* @__PURE__ */ jsxs(Grid, { direction: "row", container: true, sx: { marginBottom: 2, alignItems: "center", justifyContent: "space-between" }, children: [
100
+ /* @__PURE__ */ jsxs(Grid, { direction: "row", container: true, sx: { marginBottom: 2, alignItems: "center", justifyContent: "space-between" }, spacing: 2, children: [
100
101
  /* @__PURE__ */ jsx(Grid, { children: /* @__PURE__ */ jsx(Typography, { variant: "h1", children: headerText }) }),
101
- /* @__PURE__ */ jsxs(Grid, { container: true, sx: { width: "auto" }, children: [
102
+ /* @__PURE__ */ jsxs(Grid, { container: true, sx: { width: "auto" }, spacing: 2, children: [
102
103
  buttons && buttons.length > 0 && (buttons == null ? void 0 : buttons.map((_a) => {
103
104
  var _b = _a, { key } = _b, buttonProps = __objRest(_b, ["key"]);
104
- return /* @__PURE__ */ jsx(Grid, { marginLeft: 2, height: "100%", children: /* @__PURE__ */ jsx(Button, __spreadProps(__spreadValues({}, buttonProps), { size: "large", color: "secondary" })) }, key);
105
+ return /* @__PURE__ */ jsx(Grid, { height: "100%", children: /* @__PURE__ */ jsx(Button, __spreadProps(__spreadValues({}, buttonProps), { size: "large", color: "secondary" })) }, key);
105
106
  })),
106
- feedback ? /* @__PURE__ */ jsx(Grid, { sx: { marginLeft: 2, height: "100%" }, children: /* @__PURE__ */ jsx(Feedback, { appName: headerText }) }) : null
107
+ feedback ? /* @__PURE__ */ jsx(Grid, { sx: { height: "100%" }, children: /* @__PURE__ */ jsx(Feedback, { appName: headerText }) }) : null
107
108
  ] })
108
109
  ] }),
109
- /* @__PURE__ */ jsx(Divider, {})
110
+ divider
110
111
  ]
111
112
  }
112
113
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/mui-page-header",
3
- "version": "1.1.37",
3
+ "version": "1.2.1",
4
4
  "description": "Availity MUI PageHeader Component - part of the @availity/element design system",
5
5
  "keywords": [
6
6
  "react",
@@ -45,6 +45,7 @@
45
45
  "@availity/mui-divider": "^1.0.2",
46
46
  "@availity/mui-layout": "^1.0.2",
47
47
  "@availity/mui-link": "^1.1.1",
48
+ "@availity/mui-tabs": "^1.2.2",
48
49
  "@availity/mui-typography": "^1.0.2",
49
50
  "@mui/material": "^6.4.5",
50
51
  "@tanstack/react-query": "^4.36.1",
@@ -60,7 +61,7 @@
60
61
  "@availity/mui-divider": "^1.0.2",
61
62
  "@availity/mui-layout": "^1.0.2",
62
63
  "@availity/mui-link": "^1.1.1",
63
- "@availity/mui-spaces": "^1.0.29",
64
+ "@availity/mui-spaces": "^1.0.30",
64
65
  "@availity/mui-typography": "^1.0.2",
65
66
  "@mui/material": "^6.4.5",
66
67
  "react": ">=16.3.0"
@@ -1,8 +1,10 @@
1
1
  // Each exported component in the package should have its own stories file
2
2
 
3
+ import { useState } from 'react';
3
4
  import type { Meta, StoryObj } from '@storybook/react';
4
5
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
5
6
  import { Spaces } from '@availity/mui-spaces';
7
+ import { Tab, TabContext, TabList, TabPanel } from '@availity/mui-tabs';
6
8
  import { PageHeader, PageHeaderProps } from './PageHeader';
7
9
 
8
10
  const meta: Meta<typeof PageHeader> = {
@@ -61,6 +63,38 @@ export const _PageHeaderDoubleButtons: StoryObj<typeof PageHeader> = {
61
63
  },
62
64
  };
63
65
 
66
+ /** Divider can be replaced with primary style `<TabList>` */
67
+ export const _PageHeaderTabs: StoryObj<typeof PageHeader> = {
68
+ render: (args: PageHeaderProps) => {
69
+ const [value, setValue] = useState('1');
70
+
71
+ const handleChange = (event: React.SyntheticEvent, newValue: string) => {
72
+ setValue(newValue);
73
+ };
74
+ return (
75
+ <TabContext value={value}>
76
+ <PageHeader
77
+ divider={
78
+ <TabList {...args} onChange={handleChange} aria-label="pageheader tabs example">
79
+ <Tab label="Tab One" value="1" />
80
+ <Tab label="Tab Two" value="2" />
81
+ <Tab label="Tab Three" value="3" />
82
+ </TabList>
83
+ }
84
+ {...args}
85
+ />
86
+ <TabPanel value="1" children={`Hello from Panel ${value}`} />
87
+ <TabPanel value="2" children={`Hello from Panel ${value}`} />
88
+ <TabPanel value="3" children={`Hello from Panel ${value}`} />
89
+ </TabContext>
90
+ );
91
+ },
92
+ args: {
93
+ headerText: 'This text is a child of PageHeader',
94
+ breadcrumbs: { active: 'This Page' },
95
+ },
96
+ };
97
+
64
98
  const queryClient = new QueryClient();
65
99
 
66
100
  export const _PageHeaderLogo: StoryObj<typeof PageHeader> = {
@@ -1,6 +1,7 @@
1
1
  import { render, waitForElementToBeRemoved } from '@testing-library/react';
2
2
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3
3
  import { Spaces } from '@availity/mui-spaces';
4
+ import { Tab, TabContext, TabList } from '@availity/mui-tabs';
4
5
  // eslint-disable-next-line @nx/enforce-module-boundaries
5
6
  import { server } from '@availity/mock/src/lib/server';
6
7
  import { PageHeader } from './PageHeader';
@@ -56,6 +57,21 @@ describe('PageHeader', () => {
56
57
  expect(getByText('Button 1')).toBeTruthy();
57
58
  });
58
59
 
60
+ test('should render page header with a replaced divider successfully', () => {
61
+ const { getByText } = render(
62
+ <TabContext value={1}>
63
+ <PageHeader
64
+ breadcrumbs={{ active: 'This page' }}
65
+ headerText="This is the header"
66
+ divider={<TabList><Tab value={1} label="Tab One"/></TabList>}
67
+ />
68
+ </TabContext>
69
+ );
70
+ expect(getByText('This is the header')).toBeTruthy();
71
+ expect(getByText('This page')).toBeTruthy();
72
+ expect(getByText('Tab One')).toBeTruthy();
73
+ });
74
+
59
75
  test('should render page header with a logo successfully', async () => {
60
76
  const queryClient = new QueryClient();
61
77
  const { getByText, container } = render(
@@ -51,6 +51,8 @@ export interface PageHeaderProps {
51
51
  help?: Help;
52
52
  /** Logo attributes */
53
53
  logo?: LogoSpaceId | LogoPayerId;
54
+ /** The divider below the header, defaults to `<Divider />`. Can be replaced with `<TabList>`. */
55
+ divider?: JSX.Element;
54
56
  }
55
57
 
56
58
  const Logo = (props: LogoSpaceId | LogoPayerId) => {
@@ -80,6 +82,7 @@ export const PageHeader = ({
80
82
  headerText,
81
83
  logo,
82
84
  help,
85
+ divider = <Divider />
83
86
  }: PageHeaderProps): JSX.Element => {
84
87
  return (
85
88
  <Grid
@@ -125,26 +128,26 @@ export const PageHeader = ({
125
128
  </Grid>
126
129
  ) : null}
127
130
 
128
- <Grid direction="row" container sx={{ marginBottom: 2, alignItems: 'center', justifyContent: 'space-between' }}>
131
+ <Grid direction="row" container sx={{ marginBottom: 2, alignItems: 'center', justifyContent: 'space-between' }} spacing={2}>
129
132
  <Grid>
130
133
  <Typography variant="h1" children={headerText} />
131
134
  </Grid>
132
- <Grid container sx={{ width: 'auto' }}>
135
+ <Grid container sx={{ width: 'auto' }} spacing={2}>
133
136
  {buttons &&
134
137
  buttons.length > 0 &&
135
138
  buttons?.map(({ key, ...buttonProps }) => (
136
- <Grid key={key} marginLeft={2} height="100%">
139
+ <Grid key={key} height="100%">
137
140
  <Button {...buttonProps} size="large" color="secondary" />
138
141
  </Grid>
139
142
  ))}
140
143
  {feedback ? (
141
- <Grid sx={{ marginLeft: 2, height: '100%' }}>
144
+ <Grid sx={{ height: '100%' }}>
142
145
  <Feedback appName={headerText} />
143
146
  </Grid>
144
147
  ) : null}
145
148
  </Grid>
146
149
  </Grid>
147
- <Divider />
150
+ { divider }
148
151
  </Grid>
149
152
  );
150
153
  };