@luscii-healthtech/web-ui 64.5.2 → 64.6.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/dist/esm/components/ActionCard/ActionIcon.js +4 -7
- package/dist/esm/components/ActionCard/ActionIcon.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.development.js +4 -6
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/components/ActionCard/ActionIcon.d.ts +8 -0
- package/dist/src/generated/components/ActionCard/ActionIcon.d.ts +8 -0
- package/dist/src/generated/index.d.ts +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/stories/ActionIcon.stories.d.ts +40 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useState
|
|
2
|
+
import { useState } from 'react';
|
|
3
3
|
import { Box } from '../Box/Box.js';
|
|
4
4
|
import '../../vendor/tslib/tslib.es6.js';
|
|
5
5
|
import 'classnames';
|
|
@@ -31,15 +31,12 @@ const workflowIcons = {
|
|
|
31
31
|
};
|
|
32
32
|
const isWorkflowType = (type) => type in workflowIcons;
|
|
33
33
|
const ActionIcon = ({ type, iconUrl, size = 20 }) => {
|
|
34
|
-
const [
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
setHasImageError(false);
|
|
37
|
-
}, [type, iconUrl]);
|
|
34
|
+
const [failedUrl, setFailedUrl] = useState(null);
|
|
38
35
|
if (type === "measurement") {
|
|
39
|
-
if (!iconUrl ||
|
|
36
|
+
if (!iconUrl || failedUrl === iconUrl) {
|
|
40
37
|
return jsx(ImageIcon, { "aria-hidden": true, width: size, height: size, className: "ui:shrink-0 ui:text-slate-300" });
|
|
41
38
|
}
|
|
42
|
-
return jsx(Image, { src: iconUrl, alt: "", "data-chromatic": "ignore", width: size, height: size, className: "ui:shrink-0", showIconOnFailure: false, wrapperClassName: "ui:shrink-0", onError: () =>
|
|
39
|
+
return jsx(Image, { src: iconUrl, alt: "", "data-chromatic": "ignore", width: size, height: size, className: "ui:shrink-0", showIconOnFailure: false, wrapperClassName: "ui:shrink-0", onError: () => setFailedUrl(iconUrl) });
|
|
43
40
|
}
|
|
44
41
|
if (isWorkflowType(type)) {
|
|
45
42
|
const WorkflowIcon = workflowIcons[type];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionIcon.js","sources":["../../../../../../src/components/ActionCard/ActionIcon.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;;;;AAyCA,MAAM,SAAA,GAAY;AAAA,EAChB,WAAA,EAAa,4BAAA;AAAA,EACb,OAAA,EAAS,wBAAA;AAAA,EACT,MAAA,EAAQ,uBAAA;AAAA,EACR,WAAA,EAAa;;AAUf,MAAM,aAAA,GAAgB;AAAA,EACpB,WAAA,EAAa,cAAA;AAAA,EACb,aAAA,EAAe,gBAAA;AAAA,EACf,kBAAA,EAAoB,gBAAA;AAAA,EACpB,cAAA,EAAgB,UAAA;AAAA,EAChB,mBAAA,EAAqB;;AAGvB,MAAM,cAAA,GAAiB,CAAC,IAAA,KACtB,IAAA,IAAQ,aAAA;
|
|
1
|
+
{"version":3,"file":"ActionIcon.js","sources":["../../../../../../src/components/ActionCard/ActionIcon.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;;;;;;;;;;;;;;AAyCA,MAAM,SAAA,GAAY;AAAA,EAChB,WAAA,EAAa,4BAAA;AAAA,EACb,OAAA,EAAS,wBAAA;AAAA,EACT,MAAA,EAAQ,uBAAA;AAAA,EACR,WAAA,EAAa;;AAUf,MAAM,aAAA,GAAgB;AAAA,EACpB,WAAA,EAAa,cAAA;AAAA,EACb,aAAA,EAAe,gBAAA;AAAA,EACf,kBAAA,EAAoB,gBAAA;AAAA,EACpB,cAAA,EAAgB,UAAA;AAAA,EAChB,mBAAA,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E/B,EAAA,OACEA,GAAA,CAAC,QAAA,EAAQ,EAAA,aAAA,EAAA,IAAA,EAAa,KAAA,EAAO,IAAA,EAAM,MAAA,EAAQ,IAAA,EAAM,SAAA,EAAU,aAAA,EAAa,CAAA;AAE5E;;"}
|
package/dist/esm/index.js
CHANGED
|
@@ -78,6 +78,7 @@ export { Tag } from './components/Tag/Tag.js';
|
|
|
78
78
|
export { TagGroup } from './components/Tag/TagGroup.js';
|
|
79
79
|
export { InstrumentCard } from './components/InstrumentCard/InstrumentCard.js';
|
|
80
80
|
export { ActionCard } from './components/ActionCard/ActionCard.js';
|
|
81
|
+
export { ActionIcon } from './components/ActionCard/ActionIcon.js';
|
|
81
82
|
export { ActionCardDetailed } from './components/ActionCardDetailed/ActionCardDetailed.js';
|
|
82
83
|
export { Textarea } from './components/Textarea/Textarea.js';
|
|
83
84
|
export { TextEditor } from './components/TextEditor/TextEditor.js';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5207,15 +5207,12 @@ const workflowIcons = {
|
|
|
5207
5207
|
};
|
|
5208
5208
|
const isWorkflowType = (type) => type in workflowIcons;
|
|
5209
5209
|
const ActionIcon = ({ type, iconUrl, size = 20 }) => {
|
|
5210
|
-
const [
|
|
5211
|
-
React.useEffect(() => {
|
|
5212
|
-
setHasImageError(false);
|
|
5213
|
-
}, [type, iconUrl]);
|
|
5210
|
+
const [failedUrl, setFailedUrl] = React.useState(null);
|
|
5214
5211
|
if (type === "measurement") {
|
|
5215
|
-
if (!iconUrl ||
|
|
5212
|
+
if (!iconUrl || failedUrl === iconUrl) {
|
|
5216
5213
|
return jsxRuntime.jsx(ImageIcon, { "aria-hidden": true, width: size, height: size, className: "ui:shrink-0 ui:text-slate-300" });
|
|
5217
5214
|
}
|
|
5218
|
-
return jsxRuntime.jsx(Image$1, { src: iconUrl, alt: "", "data-chromatic": "ignore", width: size, height: size, className: "ui:shrink-0", showIconOnFailure: false, wrapperClassName: "ui:shrink-0", onError: () =>
|
|
5215
|
+
return jsxRuntime.jsx(Image$1, { src: iconUrl, alt: "", "data-chromatic": "ignore", width: size, height: size, className: "ui:shrink-0", showIconOnFailure: false, wrapperClassName: "ui:shrink-0", onError: () => setFailedUrl(iconUrl) });
|
|
5219
5216
|
}
|
|
5220
5217
|
if (isWorkflowType(type)) {
|
|
5221
5218
|
const WorkflowIcon = workflowIcons[type];
|
|
@@ -8520,6 +8517,7 @@ exports.ActionCardDetailed = ActionCardDetailed;
|
|
|
8520
8517
|
exports.ActionContactColoredIcon = ActionContactColoredIcon;
|
|
8521
8518
|
exports.ActionController = ActionController;
|
|
8522
8519
|
exports.ActionHeartRateColoredIcon = ActionHeartRateColoredIcon;
|
|
8520
|
+
exports.ActionIcon = ActionIcon;
|
|
8523
8521
|
exports.ActionInformationColoredIcon = ActionInformationColoredIcon;
|
|
8524
8522
|
exports.ActionLessonColoredIcon = ActionLessonColoredIcon;
|
|
8525
8523
|
exports.ActionLungsColoredIcon = ActionLungsColoredIcon;
|