@availity/mui-spaces 0.3.2 → 0.3.4
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 +17 -0
- package/dist/index.d.mts +8 -6
- package/dist/index.d.ts +8 -6
- package/dist/index.js +142 -195
- package/dist/index.mjs +135 -188
- package/package.json +11 -11
- package/src/lib/SpacesLink/SpacesLink.test.tsx +6 -49
- package/src/lib/SpacesLink/SpacesLink.tsx +70 -38
- package/src/lib/SpacesLink/spaces-link-types.tsx +7 -5
- package/src/lib/SpacesLink/useLink.test.tsx +1 -1
package/dist/index.mjs
CHANGED
|
@@ -804,27 +804,6 @@ var CardContent = (_a) => {
|
|
|
804
804
|
import { useTheme } from "@mui/material/styles";
|
|
805
805
|
import { default as MuiCardHeader } from "@mui/material/CardHeader";
|
|
806
806
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
807
|
-
var CardHeader = (_a) => {
|
|
808
|
-
var _b = _a, {
|
|
809
|
-
titleTypographyProps,
|
|
810
|
-
subheaderTypographyProps
|
|
811
|
-
} = _b, rest = __objRest(_b, [
|
|
812
|
-
"titleTypographyProps",
|
|
813
|
-
"subheaderTypographyProps"
|
|
814
|
-
]);
|
|
815
|
-
var _a2, _b2, _c, _d;
|
|
816
|
-
const theme = useTheme();
|
|
817
|
-
const titleVariant = (_d = (_c = (_b2 = (_a2 = theme.components) == null ? void 0 : _a2.MuiCardHeader) == null ? void 0 : _b2.defaultProps) == null ? void 0 : _c.titleTypographyProps) == null ? void 0 : _d.variant;
|
|
818
|
-
return /* @__PURE__ */ jsx11(
|
|
819
|
-
MuiCardHeader,
|
|
820
|
-
__spreadProps(__spreadValues({}, rest), {
|
|
821
|
-
titleTypographyProps: __spreadValues({
|
|
822
|
-
variant: titleVariant
|
|
823
|
-
}, titleTypographyProps),
|
|
824
|
-
subheaderTypographyProps: __spreadValues({ variant: "subtitle2" }, subheaderTypographyProps)
|
|
825
|
-
})
|
|
826
|
-
);
|
|
827
|
-
};
|
|
828
807
|
|
|
829
808
|
// ../card/src/lib/CardMedia.tsx
|
|
830
809
|
import { default as MuiCardMedia } from "@mui/material/CardMedia";
|
|
@@ -832,15 +811,11 @@ import { jsx as jsx12 } from "react/jsx-runtime";
|
|
|
832
811
|
|
|
833
812
|
// src/lib/SpacesLink/SpacesLink.tsx
|
|
834
813
|
import { Typography as Typography3 } from "@availity/mui-typography";
|
|
835
|
-
import { NavigateTopIcon, FileIcon } from "@availity/mui-icon";
|
|
836
814
|
import { useMemo as useMemo2, cloneElement } from "react";
|
|
837
815
|
|
|
838
816
|
// ../chip/src/lib/Chip.tsx
|
|
839
817
|
import { default as MuiChip } from "@mui/material/Chip";
|
|
840
818
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
841
|
-
var Chip = (props) => {
|
|
842
|
-
return /* @__PURE__ */ jsx13(MuiChip, __spreadProps(__spreadValues({}, props), { color: "default", size: "medium" }));
|
|
843
|
-
};
|
|
844
819
|
|
|
845
820
|
// ../chip/src/lib/StatusChip.tsx
|
|
846
821
|
import { default as MuiChip2 } from "@mui/material/Chip";
|
|
@@ -850,63 +825,8 @@ var StatusChip = (_a) => {
|
|
|
850
825
|
return /* @__PURE__ */ jsx14(MuiChip2, __spreadProps(__spreadValues({ color }, rest), { size: "small" }));
|
|
851
826
|
};
|
|
852
827
|
|
|
853
|
-
//
|
|
854
|
-
import
|
|
855
|
-
import { default as MuiLink } from "@mui/material/Link";
|
|
856
|
-
import { OpenInNewIcon } from "@availity/mui-icon";
|
|
857
|
-
import { jsx as jsx15, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
858
|
-
var ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\d+\-.]*?:/;
|
|
859
|
-
var WINDOWS_PATH_REGEX = /^[a-zA-Z]:\\/;
|
|
860
|
-
function isAbsoluteUrl2(url) {
|
|
861
|
-
if (WINDOWS_PATH_REGEX.test(url)) {
|
|
862
|
-
return false;
|
|
863
|
-
}
|
|
864
|
-
return ABSOLUTE_URL_REGEX.test(url);
|
|
865
|
-
}
|
|
866
|
-
var getUrl2 = (url = "") => {
|
|
867
|
-
return `/public/apps/home/#!/loadApp?appUrl=${encodeURIComponent(url)}`;
|
|
868
|
-
};
|
|
869
|
-
var getLocation = (href) => {
|
|
870
|
-
const location = document.createElement("a");
|
|
871
|
-
location.href = href;
|
|
872
|
-
return location;
|
|
873
|
-
};
|
|
874
|
-
var setRel = (url, target, absolute) => {
|
|
875
|
-
if (target === "_blank" && absolute) {
|
|
876
|
-
const dest = getLocation(url);
|
|
877
|
-
if (dest.hostname !== window.location.hostname) {
|
|
878
|
-
return "noopener noreferrer";
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
return void 0;
|
|
882
|
-
};
|
|
883
|
-
var Link = forwardRef((props, ref) => {
|
|
884
|
-
const _a = props, { href, target = "_self", children, onClick, loadApp = true, rel, iconPosition = "start" } = _a, rest = __objRest(_a, ["href", "target", "children", "onClick", "loadApp", "rel", "iconPosition"]);
|
|
885
|
-
const absolute = isAbsoluteUrl2(href);
|
|
886
|
-
const encode = !(absolute || !loadApp);
|
|
887
|
-
const url = encode ? getUrl2(href) : href;
|
|
888
|
-
const NewWindowIcon = target === "_blank" ? /* @__PURE__ */ jsx15(OpenInNewIcon, {}) : null;
|
|
889
|
-
const startIcon = iconPosition === "start";
|
|
890
|
-
const endIcon = iconPosition === "end";
|
|
891
|
-
return /* @__PURE__ */ jsx15(
|
|
892
|
-
MuiLink,
|
|
893
|
-
__spreadProps(__spreadValues({
|
|
894
|
-
href: url,
|
|
895
|
-
target,
|
|
896
|
-
onClick: (event) => onClick && onClick(event, url),
|
|
897
|
-
rel: rel || setRel(url, target, absolute)
|
|
898
|
-
}, rest), {
|
|
899
|
-
ref,
|
|
900
|
-
children: /* @__PURE__ */ jsxs4("span", { children: [
|
|
901
|
-
startIcon && NewWindowIcon,
|
|
902
|
-
" ",
|
|
903
|
-
children,
|
|
904
|
-
" ",
|
|
905
|
-
endIcon && NewWindowIcon
|
|
906
|
-
] })
|
|
907
|
-
})
|
|
908
|
-
);
|
|
909
|
-
});
|
|
828
|
+
// src/lib/SpacesLink/SpacesLink.tsx
|
|
829
|
+
import Link from "@mui/material/Link";
|
|
910
830
|
|
|
911
831
|
// ../favorites/src/lib/Favorites.tsx
|
|
912
832
|
import { createContext as createContext3, useContext as useContext3, useEffect as useEffect4, useState as useState3, useMemo } from "react";
|
|
@@ -919,7 +839,7 @@ import { avSettingsApi } from "@availity/api-axios";
|
|
|
919
839
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
920
840
|
|
|
921
841
|
// ../favorites/src/lib/Favorites.tsx
|
|
922
|
-
import { jsx as
|
|
842
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
923
843
|
var FavoritesContext = createContext3(null);
|
|
924
844
|
var noOp = () => {
|
|
925
845
|
};
|
|
@@ -955,10 +875,10 @@ var useFavorites = (id) => {
|
|
|
955
875
|
|
|
956
876
|
// ../tooltip/src/lib/Tooltip.tsx
|
|
957
877
|
import { default as MuiTooltip } from "@mui/material/Tooltip";
|
|
958
|
-
import { jsx as
|
|
878
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
959
879
|
var Tooltip = (props) => {
|
|
960
880
|
const _a = props, { children, dangerouslySetTransitionTimer } = _a, rest = __objRest(_a, ["children", "dangerouslySetTransitionTimer"]);
|
|
961
|
-
return /* @__PURE__ */
|
|
881
|
+
return /* @__PURE__ */ jsx16(
|
|
962
882
|
MuiTooltip,
|
|
963
883
|
__spreadProps(__spreadValues({}, rest), {
|
|
964
884
|
TransitionProps: { timeout: dangerouslySetTransitionTimer !== void 0 ? dangerouslySetTransitionTimer : 100 },
|
|
@@ -971,14 +891,14 @@ var Tooltip = (props) => {
|
|
|
971
891
|
// ../favorites/src/lib/FavoriteHeart.tsx
|
|
972
892
|
import { HeartIcon, HeartEmptyIcon } from "@availity/mui-icon";
|
|
973
893
|
import { styled } from "@mui/material/styles";
|
|
974
|
-
import { jsx as
|
|
894
|
+
import { jsx as jsx17, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
975
895
|
var icons = {
|
|
976
|
-
spinner: /* @__PURE__ */
|
|
977
|
-
unknownDisabledHeart: /* @__PURE__ */
|
|
978
|
-
favoritedDisabledHeart: /* @__PURE__ */
|
|
979
|
-
unfavoritedDisabledHeart: /* @__PURE__ */
|
|
980
|
-
favoritedHeart: /* @__PURE__ */
|
|
981
|
-
unfavoritedHeart: /* @__PURE__ */
|
|
896
|
+
spinner: /* @__PURE__ */ jsx17(CircularProgress, { "aria-hidden": true, size: "small", loadingCaption: false }),
|
|
897
|
+
unknownDisabledHeart: /* @__PURE__ */ jsx17(HeartIcon, { "aria-hidden": true, color: "disabled" }),
|
|
898
|
+
favoritedDisabledHeart: /* @__PURE__ */ jsx17(HeartIcon, { "aria-hidden": true, color: "error", opacity: "0.6" }),
|
|
899
|
+
unfavoritedDisabledHeart: /* @__PURE__ */ jsx17(HeartEmptyIcon, { "aria-hidden": true, color: "disabled", opacity: "0.6" }),
|
|
900
|
+
favoritedHeart: /* @__PURE__ */ jsx17(HeartIcon, { "aria-hidden": true, color: "error" }),
|
|
901
|
+
unfavoritedHeart: /* @__PURE__ */ jsx17(HeartEmptyIcon, { "aria-hidden": true, color: "secondary" })
|
|
982
902
|
};
|
|
983
903
|
var FavoriteHeartContainer = styled("div", { name: "AvFavoriteHeart", slot: "root" })({});
|
|
984
904
|
var FavoriteInput = styled("input", {
|
|
@@ -1035,9 +955,9 @@ var FavoriteHeart = ({
|
|
|
1035
955
|
onMouseDown,
|
|
1036
956
|
style: { cursor }
|
|
1037
957
|
};
|
|
1038
|
-
return /* @__PURE__ */
|
|
1039
|
-
/* @__PURE__ */
|
|
1040
|
-
/* @__PURE__ */
|
|
958
|
+
return /* @__PURE__ */ jsxs4(FavoriteHeartContainer, { children: [
|
|
959
|
+
/* @__PURE__ */ jsx17(FavoriteIcon, { children: icons[iconKey] }),
|
|
960
|
+
/* @__PURE__ */ jsx17(
|
|
1041
961
|
"span",
|
|
1042
962
|
{
|
|
1043
963
|
style: {
|
|
@@ -1055,7 +975,7 @@ var FavoriteHeart = ({
|
|
|
1055
975
|
children: isLastClickedFavorite && status === "reloading" ? "Loading..." : isLastClickedFavorite && status === "error" ? "An error has occurred. Please try again." : ""
|
|
1056
976
|
}
|
|
1057
977
|
),
|
|
1058
|
-
disabled ? /* @__PURE__ */
|
|
978
|
+
disabled ? /* @__PURE__ */ jsx17(FavoriteInput, __spreadValues({}, favoriteInputProps)) : /* @__PURE__ */ jsx17(Tooltip, { title: tooltipContent, placement: "top", children: /* @__PURE__ */ jsx17(FavoriteInput, __spreadValues({}, favoriteInputProps)) })
|
|
1059
979
|
] });
|
|
1060
980
|
};
|
|
1061
981
|
|
|
@@ -1064,37 +984,37 @@ import { Grid as Grid2, Box as Box2 } from "@availity/mui-layout";
|
|
|
1064
984
|
|
|
1065
985
|
// ../list/src/lib/List.tsx
|
|
1066
986
|
import MuiList from "@mui/material/List";
|
|
1067
|
-
import { jsx as
|
|
987
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1068
988
|
|
|
1069
989
|
// ../list/src/lib/ListItem.tsx
|
|
1070
990
|
import MuiListItem from "@mui/material/ListItem";
|
|
1071
|
-
import { forwardRef
|
|
1072
|
-
import { jsx as
|
|
1073
|
-
var ListItem =
|
|
1074
|
-
return /* @__PURE__ */
|
|
991
|
+
import { forwardRef } from "react";
|
|
992
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
993
|
+
var ListItem = forwardRef((props, ref) => {
|
|
994
|
+
return /* @__PURE__ */ jsx19(MuiListItem, __spreadProps(__spreadValues({}, props), { ref }));
|
|
1075
995
|
});
|
|
1076
996
|
|
|
1077
997
|
// ../list/src/lib/ListItemAvatar.tsx
|
|
1078
998
|
import MuiListItemAvatar from "@mui/material/ListItemAvatar";
|
|
1079
|
-
import { jsx as
|
|
999
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1080
1000
|
|
|
1081
1001
|
// ../list/src/lib/ListItemButton.tsx
|
|
1082
1002
|
import MuiListItemButton from "@mui/material/ListItemButton";
|
|
1083
|
-
import { forwardRef as
|
|
1084
|
-
import { jsx as
|
|
1085
|
-
var ListItemButton =
|
|
1086
|
-
return /* @__PURE__ */
|
|
1003
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
1004
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1005
|
+
var ListItemButton = forwardRef2((props, ref) => {
|
|
1006
|
+
return /* @__PURE__ */ jsx21(MuiListItemButton, __spreadProps(__spreadValues({}, props), { ref }));
|
|
1087
1007
|
});
|
|
1088
1008
|
|
|
1089
1009
|
// ../list/src/lib/ListItemIcon.tsx
|
|
1090
1010
|
import MuiListItemIcon from "@mui/material/ListItemIcon";
|
|
1091
|
-
import { jsx as
|
|
1011
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1092
1012
|
|
|
1093
1013
|
// ../list/src/lib/ListItemStatusCard.tsx
|
|
1094
|
-
import { forwardRef as
|
|
1014
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
1095
1015
|
import { styled as styled2, useThemeProps } from "@mui/material/styles";
|
|
1096
1016
|
import MuiListItem2 from "@mui/material/ListItem";
|
|
1097
|
-
import { jsx as
|
|
1017
|
+
import { jsx as jsx23, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1098
1018
|
var ListItemStatusCardSlot = styled2(MuiListItem2, {
|
|
1099
1019
|
name: "AvListItemStatusCard",
|
|
1100
1020
|
slot: "root",
|
|
@@ -1129,37 +1049,38 @@ var StatusAccent = styled2("div", {
|
|
|
1129
1049
|
borderBottomLeftRadius: "3px",
|
|
1130
1050
|
content: "''"
|
|
1131
1051
|
}));
|
|
1132
|
-
var ListItemStatusCard =
|
|
1052
|
+
var ListItemStatusCard = forwardRef3((props, ref) => {
|
|
1133
1053
|
const _a = props, { alignItems = "flex-start", children, color } = _a, rest = __objRest(_a, ["alignItems", "children", "color"]);
|
|
1134
1054
|
const themeProps = useThemeProps({ props, name: "AvListItemStatusCard" });
|
|
1135
1055
|
const ownerState = __spreadProps(__spreadValues({}, themeProps), { color });
|
|
1136
|
-
return /* @__PURE__ */
|
|
1137
|
-
/* @__PURE__ */
|
|
1056
|
+
return /* @__PURE__ */ jsxs5(ListItemStatusCardSlot, __spreadProps(__spreadValues({ alignItems, divider: false, ownerState }, rest), { ref, children: [
|
|
1057
|
+
/* @__PURE__ */ jsx23(StatusAccent, { className: "AvListItemStatusCard-statusAccent" }),
|
|
1138
1058
|
children
|
|
1139
1059
|
] }));
|
|
1140
1060
|
});
|
|
1141
1061
|
|
|
1142
1062
|
// ../list/src/lib/ListItemText.tsx
|
|
1143
1063
|
import MuiListItemText from "@mui/material/ListItemText";
|
|
1144
|
-
import { jsx as
|
|
1064
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1145
1065
|
var ListItemText = (_a) => {
|
|
1146
1066
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
|
1147
|
-
return /* @__PURE__ */
|
|
1067
|
+
return /* @__PURE__ */ jsx24(MuiListItemText, __spreadProps(__spreadValues({}, rest), { children }));
|
|
1148
1068
|
};
|
|
1149
1069
|
|
|
1150
1070
|
// ../list/src/lib/ListSubheader.tsx
|
|
1151
1071
|
import MuiListSubheader from "@mui/material/ListSubheader";
|
|
1152
|
-
import { jsx as
|
|
1072
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1153
1073
|
|
|
1154
1074
|
// src/lib/SpacesLink/SpacesLink.tsx
|
|
1155
1075
|
import ReactMarkdown2 from "react-markdown";
|
|
1076
|
+
import { styled as styled3 } from "@mui/material/styles";
|
|
1156
1077
|
|
|
1157
1078
|
// src/lib/SpacesLink/useLink.tsx
|
|
1158
1079
|
import { useCurrentUser } from "@availity/hooks";
|
|
1159
1080
|
|
|
1160
1081
|
// src/lib/SpacesLink/linkHandlers.tsx
|
|
1161
1082
|
import nativeForm from "@availity/native-form";
|
|
1162
|
-
import { isAbsoluteUrl as
|
|
1083
|
+
import { isAbsoluteUrl as isAbsoluteUrl2 } from "@availity/resolve-url";
|
|
1163
1084
|
var openLink = (space, params) => __async(void 0, null, function* () {
|
|
1164
1085
|
var _a, _b, _c;
|
|
1165
1086
|
if (!((_a = space == null ? void 0 : space.link) == null ? void 0 : _a.url)) {
|
|
@@ -1167,7 +1088,7 @@ var openLink = (space, params) => __async(void 0, null, function* () {
|
|
|
1167
1088
|
}
|
|
1168
1089
|
if (params == null ? void 0 : params.akaname)
|
|
1169
1090
|
yield updateTopApps(space, params.akaname);
|
|
1170
|
-
const url = !
|
|
1091
|
+
const url = !isAbsoluteUrl2(space.link.url) ? getUrl(updateUrl(space.link.url, "spaceId", (params == null ? void 0 : params.payerSpaceId) || ((_c = (_b = space.parents) == null ? void 0 : _b[0]) == null ? void 0 : _c.id)), false, false) : space.link.url;
|
|
1171
1092
|
const target = getTarget(space.link.target);
|
|
1172
1093
|
window.open(url, target);
|
|
1173
1094
|
});
|
|
@@ -1295,7 +1216,11 @@ var useLink = (spaceOrSpaceId, options) => {
|
|
|
1295
1216
|
};
|
|
1296
1217
|
|
|
1297
1218
|
// src/lib/SpacesLink/SpacesLink.tsx
|
|
1298
|
-
import { jsx as
|
|
1219
|
+
import { jsx as jsx26, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1220
|
+
var SpacesLinkContainer = styled3(Box2, { name: "AvSpacesLink", slot: "root" })({});
|
|
1221
|
+
var DateInfo = styled3(Grid2, { name: "AvSpacesLink", slot: "AvDateInfo" })({});
|
|
1222
|
+
var SpacesLinkFavoriteHeart = styled3(Grid2, { name: "AvSpacesLink", slot: "AvFavoriteHeart" })({});
|
|
1223
|
+
var IconLink = styled3(Link, { name: "AvSpacesLink", slot: "IconLink" })({});
|
|
1299
1224
|
var getDisplayDate = (date) => dayjs2(date).format("MM/DD/YYYY");
|
|
1300
1225
|
var getContainerTag = (propTag, variant) => {
|
|
1301
1226
|
if (variant && variant !== "default")
|
|
@@ -1309,8 +1234,8 @@ var getBodyTag = (propTag, variant) => {
|
|
|
1309
1234
|
};
|
|
1310
1235
|
var getTitleTag = (propTag, variant) => {
|
|
1311
1236
|
if (variant && variant !== "default")
|
|
1312
|
-
return
|
|
1313
|
-
return propTag ||
|
|
1237
|
+
return Link;
|
|
1238
|
+
return propTag || Link;
|
|
1314
1239
|
};
|
|
1315
1240
|
var getTextTag = (propTag, variant) => {
|
|
1316
1241
|
if (variant && variant !== "default")
|
|
@@ -1324,7 +1249,7 @@ var SpacesLink = (_a) => {
|
|
|
1324
1249
|
className,
|
|
1325
1250
|
children,
|
|
1326
1251
|
favorite,
|
|
1327
|
-
icon,
|
|
1252
|
+
icon: FileIcon,
|
|
1328
1253
|
showName = true,
|
|
1329
1254
|
showNew,
|
|
1330
1255
|
showDate,
|
|
@@ -1383,20 +1308,20 @@ var SpacesLink = (_a) => {
|
|
|
1383
1308
|
const [linkSpace, props] = useLink(propSpace || spaceId, { clientId: propsClientId, linkAttributes });
|
|
1384
1309
|
const showUrl = !(linkSpace == null ? void 0 : linkSpace.isGhosted) && ((_a2 = linkSpace == null ? void 0 : linkSpace.link) == null ? void 0 : _a2.url);
|
|
1385
1310
|
const favoriteIcon = useMemo2(
|
|
1386
|
-
() => (linkSpace == null ? void 0 : linkSpace.configurationId) && favorite && /* @__PURE__ */
|
|
1311
|
+
() => (linkSpace == null ? void 0 : linkSpace.configurationId) && favorite && /* @__PURE__ */ jsx26(SpacesLinkFavoriteHeart, { children: /* @__PURE__ */ jsx26(
|
|
1387
1312
|
FavoriteHeart,
|
|
1388
1313
|
{
|
|
1389
1314
|
id: `${idPrefix}${linkSpace == null ? void 0 : linkSpace.configurationId}`,
|
|
1390
1315
|
name: linkSpace == null ? void 0 : linkSpace.name,
|
|
1391
1316
|
onChange: (_, e) => e.stopPropagation()
|
|
1392
1317
|
}
|
|
1393
|
-
),
|
|
1318
|
+
) }),
|
|
1394
1319
|
[favorite, linkSpace == null ? void 0 : linkSpace.configurationId, linkSpace == null ? void 0 : linkSpace.name, idPrefix]
|
|
1395
1320
|
);
|
|
1396
1321
|
const dateInfo = useMemo2(
|
|
1397
|
-
() => (showNew || showDate) && /* @__PURE__ */
|
|
1398
|
-
showNew && (linkSpace == null ? void 0 : linkSpace.isNew) && /* @__PURE__ */
|
|
1399
|
-
showDate && /* @__PURE__ */
|
|
1322
|
+
() => (showNew || showDate) && /* @__PURE__ */ jsxs6(DateInfo, { textAlign: stacked ? "center" : "right", children: [
|
|
1323
|
+
showNew && (linkSpace == null ? void 0 : linkSpace.isNew) && /* @__PURE__ */ jsx26(StatusChip, { id: `${idPrefix}app-new-badge-${linkSpace == null ? void 0 : linkSpace.configurationId}`, label: "New!", color: "secondary" }),
|
|
1324
|
+
showDate && /* @__PURE__ */ jsx26(
|
|
1400
1325
|
Typography3,
|
|
1401
1326
|
{
|
|
1402
1327
|
id: `${idPrefix}app-date-badge-${linkSpace == null ? void 0 : linkSpace.configurationId}`,
|
|
@@ -1409,12 +1334,12 @@ var SpacesLink = (_a) => {
|
|
|
1409
1334
|
[linkSpace == null ? void 0 : linkSpace.activeDate, linkSpace == null ? void 0 : linkSpace.isNew, showDate, showNew, stacked, linkSpace == null ? void 0 : linkSpace.configurationId, idPrefix]
|
|
1410
1335
|
);
|
|
1411
1336
|
const customBadgeDisplay = useMemo2(
|
|
1412
|
-
() => customBadgeText && /* @__PURE__ */
|
|
1337
|
+
() => customBadgeText && /* @__PURE__ */ jsx26(
|
|
1413
1338
|
Box2,
|
|
1414
1339
|
{
|
|
1415
1340
|
textAlign: stacked ? "center" : "inherit",
|
|
1416
|
-
marginRight: variant !== "card" && (showDate || showNew && (linkSpace == null ? void 0 : linkSpace.isNew)) ?
|
|
1417
|
-
children: /* @__PURE__ */
|
|
1341
|
+
marginRight: variant !== "card" && (showDate || showNew && (linkSpace == null ? void 0 : linkSpace.isNew)) ? 1 : void 0,
|
|
1342
|
+
children: /* @__PURE__ */ jsx26(
|
|
1418
1343
|
StatusChip,
|
|
1419
1344
|
{
|
|
1420
1345
|
color: customBadgeColor || "info",
|
|
@@ -1437,7 +1362,7 @@ var SpacesLink = (_a) => {
|
|
|
1437
1362
|
]
|
|
1438
1363
|
);
|
|
1439
1364
|
if (isLoading) {
|
|
1440
|
-
return /* @__PURE__ */
|
|
1365
|
+
return /* @__PURE__ */ jsx26(CircularProgress, __spreadValues({ id: `${idPrefix}app-${linkSpace == null ? void 0 : linkSpace.configurationId}-loading` }, rest));
|
|
1441
1366
|
}
|
|
1442
1367
|
const Tag = getContainerTag(tag, variant);
|
|
1443
1368
|
const BodyTag = getBodyTag(bodyTag, variant);
|
|
@@ -1453,63 +1378,85 @@ var SpacesLink = (_a) => {
|
|
|
1453
1378
|
}, analytics), props));
|
|
1454
1379
|
}
|
|
1455
1380
|
};
|
|
1456
|
-
return /* @__PURE__ */
|
|
1457
|
-
|
|
1381
|
+
return /* @__PURE__ */ jsx26(
|
|
1382
|
+
SpacesLinkContainer,
|
|
1458
1383
|
__spreadProps(__spreadValues({
|
|
1384
|
+
component: Tag,
|
|
1459
1385
|
title: linkSpace == null ? void 0 : linkSpace.name,
|
|
1460
1386
|
className
|
|
1461
1387
|
}, rest), {
|
|
1462
1388
|
style: __spreadValues({}, style),
|
|
1463
1389
|
role: variant === "list" ? "listitem" : role,
|
|
1464
|
-
children: /* @__PURE__ */
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1390
|
+
children: /* @__PURE__ */ jsx26(BodyTag, { style: { width: "100%" }, children: /* @__PURE__ */ jsxs6(
|
|
1391
|
+
Grid2,
|
|
1392
|
+
{
|
|
1393
|
+
alignItems: !showDescription || stacked ? "center" : "start",
|
|
1394
|
+
direction: stacked ? "column" : "row",
|
|
1395
|
+
container: true,
|
|
1396
|
+
flexWrap: "nowrap",
|
|
1397
|
+
children: [
|
|
1398
|
+
!stacked && favoriteIcon,
|
|
1399
|
+
FileIcon && (linkSpace == null ? void 0 : linkSpace.url) && ((_b2 = linkSpace == null ? void 0 : linkSpace.type) == null ? void 0 : _b2.toUpperCase()) === "FILE" ? /* @__PURE__ */ jsx26(
|
|
1400
|
+
IconLink,
|
|
1401
|
+
{
|
|
1402
|
+
target: "_blank",
|
|
1403
|
+
href: linkSpace == null ? void 0 : linkSpace.url,
|
|
1404
|
+
role: "link",
|
|
1405
|
+
"aria-labelledby": `${idPrefix}app-title-${linkSpace == null ? void 0 : linkSpace.configurationId}`,
|
|
1406
|
+
children: /* @__PURE__ */ jsx26(FileIcon, { "data-testid": "icon" })
|
|
1407
|
+
}
|
|
1408
|
+
) : null,
|
|
1409
|
+
children ? renderChildren() : body && /* @__PURE__ */ jsxs6(Grid2, { id: `${idPrefix}${linkSpace == null ? void 0 : linkSpace.type}-${linkSpace == null ? void 0 : linkSpace.configurationId}`, flexGrow: 1, children: [
|
|
1410
|
+
/* @__PURE__ */ jsx26(
|
|
1411
|
+
Box2,
|
|
1412
|
+
{
|
|
1413
|
+
marginBottom: !customBadgeDisplay && (!showDescription || !(linkSpace == null ? void 0 : linkSpace.description)) ? 0 : void 0,
|
|
1414
|
+
paddingTop: stacked ? 3 : void 0,
|
|
1415
|
+
textAlign: stacked ? "center" : void 0,
|
|
1416
|
+
children: /* @__PURE__ */ jsx26(
|
|
1417
|
+
TitleTag,
|
|
1418
|
+
__spreadProps(__spreadValues(__spreadValues({
|
|
1419
|
+
id: `${idPrefix}app-title-${linkSpace == null ? void 0 : linkSpace.configurationId}`,
|
|
1420
|
+
className: titleClassName,
|
|
1421
|
+
tabIndex: 0,
|
|
1422
|
+
style: {
|
|
1423
|
+
cursor: showUrl ? "pointer" : "not-allowed"
|
|
1424
|
+
}
|
|
1425
|
+
}, analytics), props), {
|
|
1426
|
+
role: showUrl ? "link" : role,
|
|
1427
|
+
"aria-label": linkSpace == null ? void 0 : linkSpace.name,
|
|
1428
|
+
"aria-describedby": showNew && (linkSpace == null ? void 0 : linkSpace.isNew) ? `${idPrefix}app-new-badge-${linkSpace == null ? void 0 : linkSpace.configurationId}` : void 0,
|
|
1429
|
+
variant: variant === "list" ? "h5" : "h6",
|
|
1430
|
+
title: showName ? linkSpace == null ? void 0 : linkSpace.name : void 0,
|
|
1431
|
+
children: showName ? linkSpace == null ? void 0 : linkSpace.name : void 0
|
|
1432
|
+
})
|
|
1433
|
+
)
|
|
1434
|
+
}
|
|
1435
|
+
),
|
|
1436
|
+
stacked && dateInfo,
|
|
1437
|
+
showDescription && (linkSpace == null ? void 0 : linkSpace.description) && /* @__PURE__ */ jsx26(
|
|
1438
|
+
TextTag,
|
|
1439
|
+
{
|
|
1440
|
+
component: "div",
|
|
1480
1441
|
style: {
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
children:
|
|
1490
|
-
}
|
|
1491
|
-
)
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
textAlign: stacked ? "center" : void 0,
|
|
1500
|
-
overflow: "hidden",
|
|
1501
|
-
whiteSpace: maxDescriptionWidth ? "nowrap" : void 0,
|
|
1502
|
-
width: maxDescriptionWidth,
|
|
1503
|
-
textOverflow: "ellipsis",
|
|
1504
|
-
id: `${idPrefix}app-description-${linkSpace == null ? void 0 : linkSpace.configurationId}`,
|
|
1505
|
-
children: /* @__PURE__ */ jsx27(ReactMarkdown2, { className: "Card-text", children: linkSpace == null ? void 0 : linkSpace.description })
|
|
1506
|
-
}
|
|
1507
|
-
),
|
|
1508
|
-
variant === "card" && customBadgeDisplay
|
|
1509
|
-
] }),
|
|
1510
|
-
variant !== "card" && customBadgeDisplay,
|
|
1511
|
-
!stacked && dateInfo
|
|
1512
|
-
] }) })
|
|
1442
|
+
marginTop: ".5rem",
|
|
1443
|
+
textAlign: stacked ? "center" : void 0,
|
|
1444
|
+
overflow: "hidden",
|
|
1445
|
+
whiteSpace: maxDescriptionWidth ? "nowrap" : void 0,
|
|
1446
|
+
width: maxDescriptionWidth,
|
|
1447
|
+
textOverflow: "ellipsis"
|
|
1448
|
+
},
|
|
1449
|
+
id: `${idPrefix}app-description-${linkSpace == null ? void 0 : linkSpace.configurationId}`,
|
|
1450
|
+
children: /* @__PURE__ */ jsx26(ReactMarkdown2, { children: linkSpace == null ? void 0 : linkSpace.description })
|
|
1451
|
+
}
|
|
1452
|
+
),
|
|
1453
|
+
variant === "card" && customBadgeDisplay
|
|
1454
|
+
] }),
|
|
1455
|
+
variant !== "card" && customBadgeDisplay,
|
|
1456
|
+
!stacked && dateInfo
|
|
1457
|
+
]
|
|
1458
|
+
}
|
|
1459
|
+
) })
|
|
1513
1460
|
})
|
|
1514
1461
|
);
|
|
1515
1462
|
};
|
|
@@ -1517,14 +1464,14 @@ var SpacesLink = (_a) => {
|
|
|
1517
1464
|
// src/lib/SpacesAgreement.tsx
|
|
1518
1465
|
import { Typography as Typography4 } from "@availity/mui-typography";
|
|
1519
1466
|
import ReactMarkdown3 from "react-markdown";
|
|
1520
|
-
import { jsx as
|
|
1467
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1521
1468
|
var SpacesAgreement = ({ spaceId, markdown = false, id: elementId }) => {
|
|
1522
1469
|
const spaces = useSpaces(spaceId);
|
|
1523
1470
|
if (spaces && spaces.length > 0) {
|
|
1524
1471
|
const { description: agreement, id } = spaces[0];
|
|
1525
1472
|
if (agreement) {
|
|
1526
|
-
const children = markdown ? /* @__PURE__ */
|
|
1527
|
-
return /* @__PURE__ */
|
|
1473
|
+
const children = markdown ? /* @__PURE__ */ jsx27(ReactMarkdown3, { children: agreement }) : agreement;
|
|
1474
|
+
return /* @__PURE__ */ jsx27(Typography4, { variant: "agreement", id: elementId || `spaces-agreement-${spaceId || id}`, children });
|
|
1528
1475
|
}
|
|
1529
1476
|
}
|
|
1530
1477
|
return null;
|
|
@@ -1533,7 +1480,7 @@ var SpacesAgreement = ({ spaceId, markdown = false, id: elementId }) => {
|
|
|
1533
1480
|
// src/lib/SpacesDisclaimer.tsx
|
|
1534
1481
|
import { Disclaimer } from "@availity/mui-disclaimer";
|
|
1535
1482
|
import ReactMarkdown4 from "react-markdown";
|
|
1536
|
-
import { jsx as
|
|
1483
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1537
1484
|
var SpacesDisclaimer = (_a) => {
|
|
1538
1485
|
var _b = _a, {
|
|
1539
1486
|
accent = true,
|
|
@@ -1550,8 +1497,8 @@ var SpacesDisclaimer = (_a) => {
|
|
|
1550
1497
|
if (spaces && spaces.length > 0) {
|
|
1551
1498
|
const { description: disclaimer, id } = spaces[0];
|
|
1552
1499
|
if (disclaimer) {
|
|
1553
|
-
const children = markdown ? /* @__PURE__ */
|
|
1554
|
-
return /* @__PURE__ */
|
|
1500
|
+
const children = markdown ? /* @__PURE__ */ jsx28(ReactMarkdown4, { children: disclaimer }) : disclaimer;
|
|
1501
|
+
return /* @__PURE__ */ jsx28(
|
|
1555
1502
|
Disclaimer,
|
|
1556
1503
|
__spreadValues({
|
|
1557
1504
|
accent,
|
|
@@ -1565,14 +1512,14 @@ var SpacesDisclaimer = (_a) => {
|
|
|
1565
1512
|
};
|
|
1566
1513
|
|
|
1567
1514
|
// src/lib/SpacesGhostText.tsx
|
|
1568
|
-
import { jsx as
|
|
1515
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1569
1516
|
var SpacesGhostText = (_a) => {
|
|
1570
1517
|
var _b = _a, { spaceId, id } = _b, props = __objRest(_b, ["spaceId", "id"]);
|
|
1571
1518
|
var _a2;
|
|
1572
1519
|
const spaces = useSpaces(spaceId);
|
|
1573
1520
|
const space = spaces == null ? void 0 : spaces[0];
|
|
1574
1521
|
if (space == null ? void 0 : space.isGhosted) {
|
|
1575
|
-
return /* @__PURE__ */
|
|
1522
|
+
return /* @__PURE__ */ jsx29("small", __spreadProps(__spreadValues({ id: id || `app-ghost-text-${spaceId}` }, props), { children: /* @__PURE__ */ jsx29("em", { children: (_a2 = space == null ? void 0 : space.meta) == null ? void 0 : _a2.ghostText }) }));
|
|
1576
1523
|
}
|
|
1577
1524
|
return null;
|
|
1578
1525
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@availity/mui-spaces",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "Availity MUI Spaces Component - part of the @availity/element design system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"publish:canary": "yarn npm publish --access public --tag canary"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@availity/mui-button": "^0.6.
|
|
36
|
-
"@availity/mui-dialog": "^0.1.
|
|
37
|
-
"@availity/mui-disclaimer": "^0.1.
|
|
38
|
-
"@availity/mui-icon": "^0.
|
|
35
|
+
"@availity/mui-button": "^0.6.8",
|
|
36
|
+
"@availity/mui-dialog": "^0.1.9",
|
|
37
|
+
"@availity/mui-disclaimer": "^0.1.2",
|
|
38
|
+
"@availity/mui-icon": "^0.9.0",
|
|
39
39
|
"@availity/mui-layout": "^0.1.6",
|
|
40
|
-
"@availity/mui-modal": "^0.1.
|
|
40
|
+
"@availity/mui-modal": "^0.1.5",
|
|
41
41
|
"@availity/mui-typography": "^0.2.0",
|
|
42
42
|
"@mui/material": "^5.15.15",
|
|
43
43
|
"react": "18.2.0",
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"typescript": "^5.4.5"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@availity/mui-button": "^0.6.
|
|
50
|
-
"@availity/mui-dialog": "^0.1.
|
|
51
|
-
"@availity/mui-disclaimer": "^0.1.
|
|
52
|
-
"@availity/mui-icon": "^0.
|
|
49
|
+
"@availity/mui-button": "^0.6.8",
|
|
50
|
+
"@availity/mui-dialog": "^0.1.9",
|
|
51
|
+
"@availity/mui-disclaimer": "^0.1.2",
|
|
52
|
+
"@availity/mui-icon": "^0.9.0",
|
|
53
53
|
"@availity/mui-layout": "^0.1.6",
|
|
54
|
-
"@availity/mui-modal": "^0.1.
|
|
54
|
+
"@availity/mui-modal": "^0.1.5",
|
|
55
55
|
"@availity/mui-typography": "^0.2.0",
|
|
56
56
|
"@mui/material": "^5.11.9",
|
|
57
57
|
"react": ">=16.3.0"
|