@availity/mui-spaces 1.1.2 → 2.0.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 +45 -0
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/introduction.mdx +1 -2
- package/package.json +31 -31
- package/src/lib/Spaces.stories.tsx +2 -2
- package/src/lib/Spaces.tsx +3 -3
- package/src/lib/SpacesAgreement.stories.tsx +1 -1
- package/src/lib/SpacesAgreement.test.tsx +3 -0
- package/src/lib/SpacesDisclaimer.stories.tsx +1 -1
- package/src/lib/SpacesDisclaimer.test.tsx +3 -0
- package/src/lib/SpacesGhostText.stories.tsx +1 -1
- package/src/lib/SpacesGhostText.test.tsx +3 -0
- package/src/lib/SpacesImage.stories.tsx +1 -1
- package/src/lib/SpacesImage.test.tsx +3 -0
- package/src/lib/SpacesImage.tsx +1 -1
- package/src/lib/SpacesLink/SpacesLink.tsx +4 -4
- package/src/lib/SpacesLink/spaces-link-types.tsx +6 -6
- package/src/lib/SpacesLink/useLink.test.tsx +3 -0
- package/src/lib/helpers.tsx +2 -2
- package/src/lib/modals/DisclaimerModal.test.tsx +3 -0
- package/src/lib/modals/modal-types.tsx +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,51 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [2.0.1](https://github.com/Availity/element/compare/@availity/mui-spaces@2.0.0...@availity/mui-spaces@2.0.1) (2025-12-03)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `mui-button` updated to version `2.0.0`
|
|
10
|
+
* `mui-card` updated to version `2.0.0`
|
|
11
|
+
* `mui-chip` updated to version `2.0.0`
|
|
12
|
+
* `mui-dialog` updated to version `2.0.0`
|
|
13
|
+
* `mui-disclaimer` updated to version `2.0.0`
|
|
14
|
+
* `mui-favorites` updated to version `2.0.0`
|
|
15
|
+
* `mui-icon` updated to version `2.0.0`
|
|
16
|
+
* `mui-layout` updated to version `2.0.0`
|
|
17
|
+
* `mui-list` updated to version `2.0.0`
|
|
18
|
+
* `mui-modal` updated to version `2.0.0`
|
|
19
|
+
* `mui-progress` updated to version `2.0.0`
|
|
20
|
+
* `mui-typography` updated to version `2.0.0`
|
|
21
|
+
* `mui-paper` updated to version `2.0.0`
|
|
22
|
+
## [2.0.0](https://github.com/Availity/element/compare/@availity/mui-spaces@1.1.2...@availity/mui-spaces@2.0.0) (2025-11-17)
|
|
23
|
+
|
|
24
|
+
### Dependency Updates
|
|
25
|
+
|
|
26
|
+
* `mui-button` updated to version `1.1.2`
|
|
27
|
+
* `mui-card` updated to version `1.1.2`
|
|
28
|
+
* `mui-chip` updated to version `1.1.2`
|
|
29
|
+
* `mui-dialog` updated to version `1.1.2`
|
|
30
|
+
* `mui-disclaimer` updated to version `1.1.2`
|
|
31
|
+
* `mui-favorites` updated to version `1.1.2`
|
|
32
|
+
* `mui-icon` updated to version `1.1.2`
|
|
33
|
+
* `mui-layout` updated to version `1.1.2`
|
|
34
|
+
* `mui-list` updated to version `1.1.2`
|
|
35
|
+
* `mui-modal` updated to version `1.1.2`
|
|
36
|
+
* `mui-progress` updated to version `1.1.2`
|
|
37
|
+
* `mui-typography` updated to version `1.1.2`
|
|
38
|
+
* `mui-paper` updated to version `1.1.2`
|
|
39
|
+
|
|
40
|
+
### ⚠ BREAKING CHANGES
|
|
41
|
+
|
|
42
|
+
* @mui/material upgraded to v7
|
|
43
|
+
* @mui/x-* upgraded to v8
|
|
44
|
+
* react upgraded to v19
|
|
45
|
+
|
|
46
|
+
### Features
|
|
47
|
+
|
|
48
|
+
* upgrade material and react dependencies ([51602a4](https://github.com/Availity/element/commit/51602a48c5304db6f61e2c7e772c9a3a4aa3f65c))
|
|
49
|
+
|
|
5
50
|
## [1.1.2](https://github.com/Availity/element/compare/@availity/mui-spaces@1.1.1...@availity/mui-spaces@1.1.2) (2025-10-30)
|
|
6
51
|
|
|
7
52
|
### Dependency Updates
|
package/dist/index.d.mts
CHANGED
|
@@ -120,7 +120,7 @@ declare const INITIAL_STATE: {
|
|
|
120
120
|
};
|
|
121
121
|
declare const SpacesContext: react.Context<SpacesContextType>;
|
|
122
122
|
declare const useSpacesContext: () => SpacesContextType;
|
|
123
|
-
declare const Spaces: ({ query, variables, operationName, clientId, children, payerIds, spaceIds, spaces: spacesFromProps, }: SpacesProps) => JSX.Element;
|
|
123
|
+
declare const Spaces: ({ query, variables, operationName, clientId, children, payerIds, spaceIds, spaces: spacesFromProps, }: SpacesProps) => React.JSX.Element;
|
|
124
124
|
declare const useSpaces: UseSpaces;
|
|
125
125
|
|
|
126
126
|
type SpacesLinkVariants = 'card' | 'list' | 'default' | undefined;
|
|
@@ -148,26 +148,26 @@ type SpacesLinkWithSpaceId = {
|
|
|
148
148
|
} & SpacesLinkProps;
|
|
149
149
|
type SpacesLinkProps = {
|
|
150
150
|
/** Children can be a react child or render prop. */
|
|
151
|
-
children?: JSX.Element | ((props: any | undefined) => JSX.Element);
|
|
151
|
+
children?: React.JSX.Element | ((props: any | undefined) => React.JSX.Element);
|
|
152
152
|
/** Tag to overwrite the root component rendered. */
|
|
153
|
-
tag?: ElementType<any, keyof JSX.IntrinsicElements>;
|
|
153
|
+
tag?: ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
154
154
|
/** Tag to overwrite the body component that renders the title, description and data values.
|
|
155
155
|
* It defaults to CardBody or div depending on the value of the variant prop.
|
|
156
156
|
*/
|
|
157
|
-
bodyTag?: ElementType<any, keyof JSX.IntrinsicElements>;
|
|
157
|
+
bodyTag?: ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
158
158
|
/** Tag to overwrite the title component. If variant prop is set to "card", defaults to CardTitle.
|
|
159
159
|
* If variant is set to "list", defaults to ListItemHeading. Overwise, defaults to div.
|
|
160
160
|
*/
|
|
161
|
-
titleTag?: ElementType<any, keyof JSX.IntrinsicElements>;
|
|
161
|
+
titleTag?: ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
162
162
|
/** Tag to overwrite the text component. If variant prop is set to "card", defaults to Card Text.
|
|
163
163
|
* If variant is set to "list", defaults to ListItemText. Otherwise, defaults to div.
|
|
164
164
|
*/
|
|
165
|
-
textTag?: ElementType<any, keyof JSX.IntrinsicElements>;
|
|
165
|
+
textTag?: ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
166
166
|
titleClassName?: string;
|
|
167
167
|
/** When true, utilizes the Card component for styling. */
|
|
168
168
|
card?: boolean;
|
|
169
169
|
/** When true, renders an @availity/mui-icon next to the title if present on the Space. */
|
|
170
|
-
icon?: (props: SvgIconProps) => JSX.Element;
|
|
170
|
+
icon?: (props: SvgIconProps) => React.JSX.Element;
|
|
171
171
|
/** When true, renders the Spaces description beneath the title. */
|
|
172
172
|
description?: boolean;
|
|
173
173
|
/** When passed in, provides predefined styles for the component.
|
|
@@ -251,7 +251,7 @@ type BaseSpacesImageProps = {
|
|
|
251
251
|
id?: string;
|
|
252
252
|
Loader?: ({ id }: {
|
|
253
253
|
id: string;
|
|
254
|
-
}) => JSX.Element;
|
|
254
|
+
}) => React.JSX.Element;
|
|
255
255
|
};
|
|
256
256
|
type SpacesImageSpaceId = {
|
|
257
257
|
spaceId: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -120,7 +120,7 @@ declare const INITIAL_STATE: {
|
|
|
120
120
|
};
|
|
121
121
|
declare const SpacesContext: react.Context<SpacesContextType>;
|
|
122
122
|
declare const useSpacesContext: () => SpacesContextType;
|
|
123
|
-
declare const Spaces: ({ query, variables, operationName, clientId, children, payerIds, spaceIds, spaces: spacesFromProps, }: SpacesProps) => JSX.Element;
|
|
123
|
+
declare const Spaces: ({ query, variables, operationName, clientId, children, payerIds, spaceIds, spaces: spacesFromProps, }: SpacesProps) => React.JSX.Element;
|
|
124
124
|
declare const useSpaces: UseSpaces;
|
|
125
125
|
|
|
126
126
|
type SpacesLinkVariants = 'card' | 'list' | 'default' | undefined;
|
|
@@ -148,26 +148,26 @@ type SpacesLinkWithSpaceId = {
|
|
|
148
148
|
} & SpacesLinkProps;
|
|
149
149
|
type SpacesLinkProps = {
|
|
150
150
|
/** Children can be a react child or render prop. */
|
|
151
|
-
children?: JSX.Element | ((props: any | undefined) => JSX.Element);
|
|
151
|
+
children?: React.JSX.Element | ((props: any | undefined) => React.JSX.Element);
|
|
152
152
|
/** Tag to overwrite the root component rendered. */
|
|
153
|
-
tag?: ElementType<any, keyof JSX.IntrinsicElements>;
|
|
153
|
+
tag?: ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
154
154
|
/** Tag to overwrite the body component that renders the title, description and data values.
|
|
155
155
|
* It defaults to CardBody or div depending on the value of the variant prop.
|
|
156
156
|
*/
|
|
157
|
-
bodyTag?: ElementType<any, keyof JSX.IntrinsicElements>;
|
|
157
|
+
bodyTag?: ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
158
158
|
/** Tag to overwrite the title component. If variant prop is set to "card", defaults to CardTitle.
|
|
159
159
|
* If variant is set to "list", defaults to ListItemHeading. Overwise, defaults to div.
|
|
160
160
|
*/
|
|
161
|
-
titleTag?: ElementType<any, keyof JSX.IntrinsicElements>;
|
|
161
|
+
titleTag?: ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
162
162
|
/** Tag to overwrite the text component. If variant prop is set to "card", defaults to Card Text.
|
|
163
163
|
* If variant is set to "list", defaults to ListItemText. Otherwise, defaults to div.
|
|
164
164
|
*/
|
|
165
|
-
textTag?: ElementType<any, keyof JSX.IntrinsicElements>;
|
|
165
|
+
textTag?: ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
166
166
|
titleClassName?: string;
|
|
167
167
|
/** When true, utilizes the Card component for styling. */
|
|
168
168
|
card?: boolean;
|
|
169
169
|
/** When true, renders an @availity/mui-icon next to the title if present on the Space. */
|
|
170
|
-
icon?: (props: SvgIconProps) => JSX.Element;
|
|
170
|
+
icon?: (props: SvgIconProps) => React.JSX.Element;
|
|
171
171
|
/** When true, renders the Spaces description beneath the title. */
|
|
172
172
|
description?: boolean;
|
|
173
173
|
/** When passed in, provides predefined styles for the component.
|
|
@@ -251,7 +251,7 @@ type BaseSpacesImageProps = {
|
|
|
251
251
|
id?: string;
|
|
252
252
|
Loader?: ({ id }: {
|
|
253
253
|
id: string;
|
|
254
|
-
}) => JSX.Element;
|
|
254
|
+
}) => React.JSX.Element;
|
|
255
255
|
};
|
|
256
256
|
type SpacesImageSpaceId = {
|
|
257
257
|
spaceId: string;
|
package/introduction.mdx
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/mui-spaces",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Availity MUI Spaces Component - part of the @availity/element design system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -40,41 +40,41 @@
|
|
|
40
40
|
"publish:canary": "yarn npm publish --access public --tag canary"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@availity/mui-button": "^
|
|
44
|
-
"@availity/mui-card": "^
|
|
45
|
-
"@availity/mui-chip": "^
|
|
46
|
-
"@availity/mui-dialog": "^
|
|
47
|
-
"@availity/mui-disclaimer": "^
|
|
48
|
-
"@availity/mui-favorites": "^
|
|
49
|
-
"@availity/mui-icon": "^
|
|
50
|
-
"@availity/mui-layout": "^
|
|
51
|
-
"@availity/mui-list": "^
|
|
52
|
-
"@availity/mui-modal": "^
|
|
53
|
-
"@availity/mui-paper": "^
|
|
54
|
-
"@availity/mui-progress": "^
|
|
55
|
-
"@availity/mui-typography": "^
|
|
56
|
-
"@mui/material": "^
|
|
57
|
-
"react": "
|
|
58
|
-
"react-dom": "
|
|
43
|
+
"@availity/mui-button": "^2.0.1",
|
|
44
|
+
"@availity/mui-card": "^2.0.1",
|
|
45
|
+
"@availity/mui-chip": "^2.0.1",
|
|
46
|
+
"@availity/mui-dialog": "^2.0.1",
|
|
47
|
+
"@availity/mui-disclaimer": "^2.0.1",
|
|
48
|
+
"@availity/mui-favorites": "^2.0.1",
|
|
49
|
+
"@availity/mui-icon": "^2.0.1",
|
|
50
|
+
"@availity/mui-layout": "^2.0.1",
|
|
51
|
+
"@availity/mui-list": "^2.0.1",
|
|
52
|
+
"@availity/mui-modal": "^2.0.1",
|
|
53
|
+
"@availity/mui-paper": "^2.0.1",
|
|
54
|
+
"@availity/mui-progress": "^2.0.1",
|
|
55
|
+
"@availity/mui-typography": "^2.0.1",
|
|
56
|
+
"@mui/material": "^7.3.4",
|
|
57
|
+
"react": "19.2.0",
|
|
58
|
+
"react-dom": "19.2.0",
|
|
59
59
|
"react-router-dom": "^6.30.0",
|
|
60
60
|
"tsup": "^8.4.0",
|
|
61
61
|
"typescript": "^5.4.5"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"@availity/mui-button": "^
|
|
65
|
-
"@availity/mui-card": "^
|
|
66
|
-
"@availity/mui-chip": "^
|
|
67
|
-
"@availity/mui-dialog": "^
|
|
68
|
-
"@availity/mui-disclaimer": "^
|
|
69
|
-
"@availity/mui-favorites": "^
|
|
70
|
-
"@availity/mui-icon": "^
|
|
71
|
-
"@availity/mui-layout": "^
|
|
72
|
-
"@availity/mui-list": "^
|
|
73
|
-
"@availity/mui-modal": "^
|
|
74
|
-
"@availity/mui-progress": "^
|
|
75
|
-
"@availity/mui-typography": "^
|
|
76
|
-
"@mui/material": "^
|
|
77
|
-
"react": ">=
|
|
64
|
+
"@availity/mui-button": "^2.0.1",
|
|
65
|
+
"@availity/mui-card": "^2.0.1",
|
|
66
|
+
"@availity/mui-chip": "^2.0.1",
|
|
67
|
+
"@availity/mui-dialog": "^2.0.1",
|
|
68
|
+
"@availity/mui-disclaimer": "^2.0.1",
|
|
69
|
+
"@availity/mui-favorites": "^2.0.1",
|
|
70
|
+
"@availity/mui-icon": "^2.0.1",
|
|
71
|
+
"@availity/mui-layout": "^2.0.1",
|
|
72
|
+
"@availity/mui-list": "^2.0.1",
|
|
73
|
+
"@availity/mui-modal": "^2.0.1",
|
|
74
|
+
"@availity/mui-progress": "^2.0.1",
|
|
75
|
+
"@availity/mui-typography": "^2.0.1",
|
|
76
|
+
"@mui/material": "^7.0.0",
|
|
77
|
+
"react": ">=17.0.0",
|
|
78
78
|
"react-router-dom": "^6.26.0"
|
|
79
79
|
},
|
|
80
80
|
"publishConfig": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Each exported component in the package should have its own stories file
|
|
2
2
|
|
|
3
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
4
4
|
import { Paper } from '@availity/mui-paper';
|
|
5
5
|
import { Typography } from '@availity/mui-typography';
|
|
6
6
|
import { Stack } from '@availity/mui-layout';
|
|
@@ -31,7 +31,7 @@ const SpaceComponent = ({ spaceId }: { spaceId: string }) => {
|
|
|
31
31
|
);
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
const SpaceContainer = ({ children }: { children?: React.ReactNode }): JSX.Element => {
|
|
34
|
+
const SpaceContainer = ({ children }: { children?: React.ReactNode }): React.JSX.Element => {
|
|
35
35
|
const { loading } = useSpacesContext();
|
|
36
36
|
return loading ? <span>loading...</span> : <div>{children}</div>;
|
|
37
37
|
};
|
package/src/lib/Spaces.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { useQueries } from '@tanstack/react-query';
|
|
|
3
3
|
import { spacesReducer, fetchAllSpaces } from './spaces-data';
|
|
4
4
|
import configurationFindMany from './configurationFindMany';
|
|
5
5
|
import { ModalProvider } from './modals/ModalProvider';
|
|
6
|
-
import type { Space, SpacesProps, SpacesContextType, UseSpaces } from './spaces-types';
|
|
6
|
+
import type { Space, SpacesProps, SpacesContextType, UseSpaces, SpacesReducerAction } from './spaces-types';
|
|
7
7
|
import { isReactNodeFunction } from './helpers';
|
|
8
8
|
|
|
9
9
|
export const INITIAL_STATE = {
|
|
@@ -23,9 +23,9 @@ export const Spaces = ({
|
|
|
23
23
|
payerIds,
|
|
24
24
|
spaceIds,
|
|
25
25
|
spaces: spacesFromProps,
|
|
26
|
-
}: SpacesProps): JSX.Element => {
|
|
26
|
+
}: SpacesProps): React.JSX.Element => {
|
|
27
27
|
const [{ previousSpacesMap, previousSpacesByConfigMap, previousSpacesByPayerMap, loading, error }, dispatch] =
|
|
28
|
-
useReducer(spacesReducer, INITIAL_STATE);
|
|
28
|
+
useReducer<SpacesContextType, [SpacesReducerAction]>(spacesReducer, INITIAL_STATE);
|
|
29
29
|
|
|
30
30
|
const spacesMap: Map<string, Space> = new Map(previousSpacesMap);
|
|
31
31
|
const configIdsMap: Map<string, Space> = new Map(previousSpacesByConfigMap);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Each exported component in the package should have its own stories file
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
3
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
4
4
|
import { Spaces } from './Spaces';
|
|
5
5
|
import { SpacesAgreement, SpacesAgreementProps } from './SpacesAgreement';
|
|
@@ -16,6 +16,9 @@ afterEach(() => {
|
|
|
16
16
|
server.resetHandlers();
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
+
// terminate the server
|
|
20
|
+
afterAll(() => server.close());
|
|
21
|
+
|
|
19
22
|
describe('SpacesAgreement', () => {
|
|
20
23
|
it('should render regular text successfully', async () => {
|
|
21
24
|
const queryClient = new QueryClient();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Each exported component in the package should have its own stories file
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
3
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
4
4
|
import { Spaces } from './Spaces';
|
|
5
5
|
import { SpacesDisclaimer, SpacesDisclaimerProps } from './SpacesDisclaimer';
|
|
@@ -16,6 +16,9 @@ afterEach(() => {
|
|
|
16
16
|
server.resetHandlers();
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
+
// terminate the server
|
|
20
|
+
afterAll(() => server.close());
|
|
21
|
+
|
|
19
22
|
describe('SpacesDisclaimer', () => {
|
|
20
23
|
it('should render regular text successfully', async () => {
|
|
21
24
|
const queryClient = new QueryClient();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Each exported component in the package should have its own stories file
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
3
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
4
4
|
import { Spaces } from './Spaces';
|
|
5
5
|
import { SpacesGhostText, SpacesGhostTextProps } from './SpacesGhostText';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Each exported component in the package should have its own stories file
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
3
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
4
4
|
import { Card, CardHeader, CardHeaderProps } from '@availity/mui-card';
|
|
5
5
|
import { Spaces } from './Spaces';
|
package/src/lib/SpacesImage.tsx
CHANGED
|
@@ -25,7 +25,7 @@ const IconLink = styled(Link, { name: 'AvSpacesLink', slot: 'IconLink' })({});
|
|
|
25
25
|
const getDisplayDate = (date: string | null | undefined) => dayjs(date).format('MM/DD/YYYY');
|
|
26
26
|
|
|
27
27
|
const getContainerTag = (
|
|
28
|
-
propTag: ElementType<any, keyof JSX.IntrinsicElements> | undefined,
|
|
28
|
+
propTag: ElementType<any, keyof React.JSX.IntrinsicElements> | undefined,
|
|
29
29
|
variant: SpacesLinkVariants
|
|
30
30
|
) => {
|
|
31
31
|
if (variant && variant !== 'default') return { card: Card, list: ListItem }[variant];
|
|
@@ -33,7 +33,7 @@ const getContainerTag = (
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
const getBodyTag = (
|
|
36
|
-
propTag: ElementType<any, keyof JSX.IntrinsicElements> | undefined,
|
|
36
|
+
propTag: ElementType<any, keyof React.JSX.IntrinsicElements> | undefined,
|
|
37
37
|
variant: SpacesLinkVariants
|
|
38
38
|
) => {
|
|
39
39
|
if (variant && variant !== 'default') return { card: CardContent, list: 'div' }[variant];
|
|
@@ -41,7 +41,7 @@ const getBodyTag = (
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
const getTitleTag = (
|
|
44
|
-
propTag: ElementType<any, keyof JSX.IntrinsicElements> | undefined,
|
|
44
|
+
propTag: ElementType<any, keyof React.JSX.IntrinsicElements> | undefined,
|
|
45
45
|
variant: SpacesLinkVariants,
|
|
46
46
|
showUrl?: boolean
|
|
47
47
|
) => {
|
|
@@ -51,7 +51,7 @@ const getTitleTag = (
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
const getTextTag = (
|
|
54
|
-
propTag: ElementType<any, keyof JSX.IntrinsicElements> | undefined,
|
|
54
|
+
propTag: ElementType<any, keyof React.JSX.IntrinsicElements> | undefined,
|
|
55
55
|
variant: SpacesLinkVariants
|
|
56
56
|
) => {
|
|
57
57
|
if (variant && variant !== 'default') return { card: Typography, list: ListItemText }[variant];
|
|
@@ -31,26 +31,26 @@ export type SpacesLinkWithSpaceId = {
|
|
|
31
31
|
|
|
32
32
|
export type SpacesLinkProps = {
|
|
33
33
|
/** Children can be a react child or render prop. */
|
|
34
|
-
children?: JSX.Element | ((props: any | undefined) => JSX.Element);
|
|
34
|
+
children?: React.JSX.Element | ((props: any | undefined) => React.JSX.Element);
|
|
35
35
|
/** Tag to overwrite the root component rendered. */
|
|
36
|
-
tag?: ElementType<any, keyof JSX.IntrinsicElements>;
|
|
36
|
+
tag?: ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
37
37
|
/** Tag to overwrite the body component that renders the title, description and data values.
|
|
38
38
|
* It defaults to CardBody or div depending on the value of the variant prop.
|
|
39
39
|
*/
|
|
40
|
-
bodyTag?: ElementType<any, keyof JSX.IntrinsicElements>;
|
|
40
|
+
bodyTag?: ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
41
41
|
/** Tag to overwrite the title component. If variant prop is set to "card", defaults to CardTitle.
|
|
42
42
|
* If variant is set to "list", defaults to ListItemHeading. Overwise, defaults to div.
|
|
43
43
|
*/
|
|
44
|
-
titleTag?: ElementType<any, keyof JSX.IntrinsicElements>;
|
|
44
|
+
titleTag?: ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
45
45
|
/** Tag to overwrite the text component. If variant prop is set to "card", defaults to Card Text.
|
|
46
46
|
* If variant is set to "list", defaults to ListItemText. Otherwise, defaults to div.
|
|
47
47
|
*/
|
|
48
|
-
textTag?: ElementType<any, keyof JSX.IntrinsicElements>;
|
|
48
|
+
textTag?: ElementType<any, keyof React.JSX.IntrinsicElements>;
|
|
49
49
|
titleClassName?: string;
|
|
50
50
|
/** When true, utilizes the Card component for styling. */
|
|
51
51
|
card?: boolean;
|
|
52
52
|
/** When true, renders an @availity/mui-icon next to the title if present on the Space. */
|
|
53
|
-
icon?: (props: SvgIconProps) => JSX.Element;
|
|
53
|
+
icon?: (props: SvgIconProps) => React.JSX.Element;
|
|
54
54
|
/** When true, renders the Spaces description beneath the title. */
|
|
55
55
|
description?: boolean;
|
|
56
56
|
/** When passed in, provides predefined styles for the component.
|
package/src/lib/helpers.tsx
CHANGED
|
@@ -31,8 +31,8 @@ export const getTarget = (target?: string) => {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export const isFunction = (
|
|
34
|
-
children: JSX.Element | ((props: any | undefined) => JSX.Element)
|
|
35
|
-
): children is (props: any | undefined) => JSX.Element => typeof children === 'function';
|
|
34
|
+
children: React.JSX.Element | ((props: any | undefined) => React.JSX.Element)
|
|
35
|
+
): children is (props: any | undefined) => React.JSX.Element => typeof children === 'function';
|
|
36
36
|
|
|
37
37
|
export const isReactNodeFunction = (
|
|
38
38
|
children: React.ReactNode | ((props: any | undefined) => React.ReactNode)
|
|
@@ -47,6 +47,9 @@ describe('DisclaimerModal', () => {
|
|
|
47
47
|
server.resetHandlers();
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
+
// terminate the server
|
|
51
|
+
afterAll(() => server.close());
|
|
52
|
+
|
|
50
53
|
it('renders modal when space metadata contains disclaimerId', async () => {
|
|
51
54
|
const { getByText } = render(<DisclaimerModal />);
|
|
52
55
|
|
|
@@ -56,8 +56,8 @@ export type ModalProviderState = {
|
|
|
56
56
|
modalState: ModalState;
|
|
57
57
|
selectedModal?: {
|
|
58
58
|
body?:
|
|
59
|
-
| (({ disclaimerId }: ModalProps) => JSX.Element)
|
|
60
|
-
| (({ parentPayerSpaces, name, state: { selectedOption }, setState }: ModalProps) => JSX.Element);
|
|
59
|
+
| (({ disclaimerId }: ModalProps) => React.JSX.Element)
|
|
60
|
+
| (({ parentPayerSpaces, name, state: { selectedOption }, setState }: ModalProps) => React.JSX.Element);
|
|
61
61
|
onSubmit?: (
|
|
62
62
|
props: ModalOptions,
|
|
63
63
|
modalState: ModalState,
|