@availity/mui-spaces 0.4.0 → 0.5.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 +12 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +15 -3
- package/dist/index.mjs +15 -3
- package/package.json +3 -3
- package/src/lib/SpacesImage.tsx +11 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.5.1](https://github.com/Availity/element/compare/@availity/mui-spaces@0.5.0...@availity/mui-spaces@0.5.1) (2024-11-20)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `mui-list` updated to version `0.5.0`
|
|
10
|
+
## [0.5.0](https://github.com/Availity/element/compare/@availity/mui-spaces@0.4.0...@availity/mui-spaces@0.5.0) (2024-11-06)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **mui-spaces:** allow custom Loaders in SpacesImage ([7a585c9](https://github.com/Availity/element/commit/7a585c9aeb1255abf56b87692f8c134820a20e60))
|
|
16
|
+
|
|
5
17
|
## [0.4.0](https://github.com/Availity/element/compare/@availity/mui-spaces@0.3.25...@availity/mui-spaces@0.4.0) (2024-10-31)
|
|
6
18
|
|
|
7
19
|
### Dependency Updates
|
package/dist/index.d.mts
CHANGED
|
@@ -240,6 +240,9 @@ type BaseSpacesImageProps = {
|
|
|
240
240
|
imageType?: 'url' | 'images.logo' | 'images.tile' | 'images.billboard' | 'images.promotional' | 'images.promotionalHover';
|
|
241
241
|
fallback?: string;
|
|
242
242
|
id?: string;
|
|
243
|
+
Loader?: ({ id }: {
|
|
244
|
+
id: string;
|
|
245
|
+
}) => JSX.Element;
|
|
243
246
|
};
|
|
244
247
|
type SpacesImageSpaceId = {
|
|
245
248
|
spaceId: string;
|
|
@@ -250,6 +253,6 @@ type SpacesImagePayerId = {
|
|
|
250
253
|
payerId: string;
|
|
251
254
|
} & BaseSpacesImageProps;
|
|
252
255
|
type SpacesImageProps = SpacesImageSpaceId | SpacesImagePayerId;
|
|
253
|
-
declare const SpacesImage: ({ spaceId, payerId, imageType, fallback, ...props }: SpacesImageProps) => react_jsx_runtime.JSX.Element | null;
|
|
256
|
+
declare const SpacesImage: ({ spaceId, payerId, imageType, fallback, Loader, ...props }: SpacesImageProps) => react_jsx_runtime.JSX.Element | null;
|
|
254
257
|
|
|
255
258
|
export { INITIAL_STATE, type Space, Spaces, SpacesAgreement, type SpacesAgreementProps, SpacesContext, SpacesDisclaimer, type SpacesDisclaimerProps, SpacesGhostText, type SpacesGhostTextProps, SpacesImage, type SpacesImageProps, SpacesLink, useSpaces, useSpacesContext };
|
package/dist/index.d.ts
CHANGED
|
@@ -240,6 +240,9 @@ type BaseSpacesImageProps = {
|
|
|
240
240
|
imageType?: 'url' | 'images.logo' | 'images.tile' | 'images.billboard' | 'images.promotional' | 'images.promotionalHover';
|
|
241
241
|
fallback?: string;
|
|
242
242
|
id?: string;
|
|
243
|
+
Loader?: ({ id }: {
|
|
244
|
+
id: string;
|
|
245
|
+
}) => JSX.Element;
|
|
243
246
|
};
|
|
244
247
|
type SpacesImageSpaceId = {
|
|
245
248
|
spaceId: string;
|
|
@@ -250,6 +253,6 @@ type SpacesImagePayerId = {
|
|
|
250
253
|
payerId: string;
|
|
251
254
|
} & BaseSpacesImageProps;
|
|
252
255
|
type SpacesImageProps = SpacesImageSpaceId | SpacesImagePayerId;
|
|
253
|
-
declare const SpacesImage: ({ spaceId, payerId, imageType, fallback, ...props }: SpacesImageProps) => react_jsx_runtime.JSX.Element | null;
|
|
256
|
+
declare const SpacesImage: ({ spaceId, payerId, imageType, fallback, Loader, ...props }: SpacesImageProps) => react_jsx_runtime.JSX.Element | null;
|
|
254
257
|
|
|
255
258
|
export { INITIAL_STATE, type Space, Spaces, SpacesAgreement, type SpacesAgreementProps, SpacesContext, SpacesDisclaimer, type SpacesDisclaimerProps, SpacesGhostText, type SpacesGhostTextProps, SpacesImage, type SpacesImageProps, SpacesLink, useSpaces, useSpacesContext };
|
package/dist/index.js
CHANGED
|
@@ -386,7 +386,19 @@ var import_mui_progress2 = require("@availity/mui-progress");
|
|
|
386
386
|
var import_react_image = require("react-image");
|
|
387
387
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
388
388
|
var SpacesImage = (_a) => {
|
|
389
|
-
var _b = _a, {
|
|
389
|
+
var _b = _a, {
|
|
390
|
+
spaceId,
|
|
391
|
+
payerId,
|
|
392
|
+
imageType = "url",
|
|
393
|
+
fallback,
|
|
394
|
+
Loader = import_mui_progress2.CircularProgress
|
|
395
|
+
} = _b, props = __objRest(_b, [
|
|
396
|
+
"spaceId",
|
|
397
|
+
"payerId",
|
|
398
|
+
"imageType",
|
|
399
|
+
"fallback",
|
|
400
|
+
"Loader"
|
|
401
|
+
]);
|
|
390
402
|
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
391
403
|
let spaces;
|
|
392
404
|
if (spaceId) {
|
|
@@ -406,7 +418,7 @@ var SpacesImage = (_a) => {
|
|
|
406
418
|
};
|
|
407
419
|
let url = imageMap[imageType];
|
|
408
420
|
if (!url && loading) {
|
|
409
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
421
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Loader, { id: `app-${id}-loading` });
|
|
410
422
|
}
|
|
411
423
|
if (!url && !loading && fallback) {
|
|
412
424
|
url = fallback;
|
|
@@ -419,7 +431,7 @@ var SpacesImage = (_a) => {
|
|
|
419
431
|
id: props.id || `app-img-${id}`,
|
|
420
432
|
src: url,
|
|
421
433
|
alt: `Space ${imageType}`,
|
|
422
|
-
loader: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
434
|
+
loader: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Loader, { id: `app-img-${id}-loading` })
|
|
423
435
|
}, props)
|
|
424
436
|
);
|
|
425
437
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -344,7 +344,19 @@ import { CircularProgress as CircularProgress2 } from "@availity/mui-progress";
|
|
|
344
344
|
import { Img } from "react-image";
|
|
345
345
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
346
346
|
var SpacesImage = (_a) => {
|
|
347
|
-
var _b = _a, {
|
|
347
|
+
var _b = _a, {
|
|
348
|
+
spaceId,
|
|
349
|
+
payerId,
|
|
350
|
+
imageType = "url",
|
|
351
|
+
fallback,
|
|
352
|
+
Loader = CircularProgress2
|
|
353
|
+
} = _b, props = __objRest(_b, [
|
|
354
|
+
"spaceId",
|
|
355
|
+
"payerId",
|
|
356
|
+
"imageType",
|
|
357
|
+
"fallback",
|
|
358
|
+
"Loader"
|
|
359
|
+
]);
|
|
348
360
|
var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
349
361
|
let spaces;
|
|
350
362
|
if (spaceId) {
|
|
@@ -364,7 +376,7 @@ var SpacesImage = (_a) => {
|
|
|
364
376
|
};
|
|
365
377
|
let url = imageMap[imageType];
|
|
366
378
|
if (!url && loading) {
|
|
367
|
-
return /* @__PURE__ */ jsx2(
|
|
379
|
+
return /* @__PURE__ */ jsx2(Loader, { id: `app-${id}-loading` });
|
|
368
380
|
}
|
|
369
381
|
if (!url && !loading && fallback) {
|
|
370
382
|
url = fallback;
|
|
@@ -377,7 +389,7 @@ var SpacesImage = (_a) => {
|
|
|
377
389
|
id: props.id || `app-img-${id}`,
|
|
378
390
|
src: url,
|
|
379
391
|
alt: `Space ${imageType}`,
|
|
380
|
-
loader: /* @__PURE__ */ jsx2(
|
|
392
|
+
loader: /* @__PURE__ */ jsx2(Loader, { id: `app-img-${id}-loading` })
|
|
381
393
|
}, props)
|
|
382
394
|
);
|
|
383
395
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/mui-spaces",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Availity MUI Spaces Component - part of the @availity/element design system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@availity/mui-favorites": "^0.2.0",
|
|
41
41
|
"@availity/mui-icon": "^0.11.0",
|
|
42
42
|
"@availity/mui-layout": "^0.2.0",
|
|
43
|
-
"@availity/mui-list": "^0.2.
|
|
43
|
+
"@availity/mui-list": "^0.2.1",
|
|
44
44
|
"@availity/mui-modal": "^0.1.8",
|
|
45
45
|
"@availity/mui-paper": "^0.1.9",
|
|
46
46
|
"@availity/mui-progress": "^0.4.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@availity/mui-favorites": "^0.2.0",
|
|
61
61
|
"@availity/mui-icon": "^0.11.0",
|
|
62
62
|
"@availity/mui-layout": "^0.2.0",
|
|
63
|
-
"@availity/mui-list": "^0.2.
|
|
63
|
+
"@availity/mui-list": "^0.2.1",
|
|
64
64
|
"@availity/mui-modal": "^0.1.8",
|
|
65
65
|
"@availity/mui-progress": "^0.4.0",
|
|
66
66
|
"@availity/mui-typography": "^0.2.1",
|
package/src/lib/SpacesImage.tsx
CHANGED
|
@@ -12,6 +12,7 @@ type BaseSpacesImageProps = {
|
|
|
12
12
|
| 'images.promotionalHover';
|
|
13
13
|
fallback?: string;
|
|
14
14
|
id?: string;
|
|
15
|
+
Loader?: ({ id }: { id: string }) => JSX.Element;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
type SpacesImageSpaceId = {
|
|
@@ -26,7 +27,14 @@ type SpacesImagePayerId = {
|
|
|
26
27
|
|
|
27
28
|
export type SpacesImageProps = SpacesImageSpaceId | SpacesImagePayerId;
|
|
28
29
|
|
|
29
|
-
export const SpacesImage = ({
|
|
30
|
+
export const SpacesImage = ({
|
|
31
|
+
spaceId,
|
|
32
|
+
payerId,
|
|
33
|
+
imageType = 'url',
|
|
34
|
+
fallback,
|
|
35
|
+
Loader = CircularProgress,
|
|
36
|
+
...props
|
|
37
|
+
}: SpacesImageProps) => {
|
|
30
38
|
let spaces;
|
|
31
39
|
|
|
32
40
|
if (spaceId) {
|
|
@@ -51,7 +59,7 @@ export const SpacesImage = ({ spaceId, payerId, imageType = 'url', fallback, ...
|
|
|
51
59
|
let url = imageMap[imageType];
|
|
52
60
|
|
|
53
61
|
if (!url && loading) {
|
|
54
|
-
return <
|
|
62
|
+
return <Loader id={`app-${id}-loading`} />;
|
|
55
63
|
}
|
|
56
64
|
|
|
57
65
|
if (!url && !loading && fallback) {
|
|
@@ -65,7 +73,7 @@ export const SpacesImage = ({ spaceId, payerId, imageType = 'url', fallback, ...
|
|
|
65
73
|
id={props.id || `app-img-${id}`}
|
|
66
74
|
src={url}
|
|
67
75
|
alt={`Space ${imageType}`}
|
|
68
|
-
loader={<
|
|
76
|
+
loader={<Loader id={`app-img-${id}-loading`} />}
|
|
69
77
|
{...props}
|
|
70
78
|
/>
|
|
71
79
|
);
|