@availity/mui-spaces 0.3.4 → 0.3.6

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/index.mjs CHANGED
@@ -51,7 +51,7 @@ var __async = (__this, __arguments, generator) => {
51
51
  };
52
52
 
53
53
  // src/lib/Spaces.tsx
54
- import { createContext as createContext2, useContext as useContext2, useReducer as useReducer2, useEffect as useEffect3 } from "react";
54
+ import { createContext as createContext2, useContext as useContext2, useReducer as useReducer2, useEffect as useEffect2 } from "react";
55
55
  import { useQueries } from "@tanstack/react-query";
56
56
 
57
57
  // src/lib/spaces-data.tsx
@@ -303,74 +303,12 @@ var updateTopApps = (space, akaname) => __async(void 0, null, function* () {
303
303
  });
304
304
 
305
305
  // src/lib/modals/DisclaimerModal.tsx
306
- import { useState as useState2, useEffect as useEffect2 } from "react";
306
+ import { useState, useEffect } from "react";
307
307
  import { avWebQLApi as avWebQLApi2 } from "@availity/api-axios";
308
308
  import ReactMarkdown from "react-markdown";
309
-
310
- // ../progress/src/lib/CircularProgress.tsx
311
- import { useEffect, useState } from "react";
312
- import {
313
- default as MuiCircularProgress
314
- } from "@mui/material/CircularProgress";
315
- import Stack from "@mui/material/Stack";
316
- import { SuccessCircleIcon, WarningCircleIcon } from "@availity/mui-icon";
317
- import { Typography } from "@availity/mui-typography";
318
- import { jsx, jsxs } from "react/jsx-runtime";
319
- var StatusIcon = ({ status, size }) => {
320
- const fontSize = size === "small" ? "medium" : "large";
321
- switch (status) {
322
- case "error":
323
- return /* @__PURE__ */ jsx(WarningCircleIcon, { color: "error", fontSize, titleAccess: "loading error" });
324
- case "success":
325
- return /* @__PURE__ */ jsx(SuccessCircleIcon, { color: "success", fontSize, titleAccess: "loading successful" });
326
- default:
327
- return null;
328
- }
329
- };
330
- var getCaptionText = (status) => ({
331
- loading: "Loading",
332
- error: "Loading error",
333
- success: "Loading successful"
334
- })[status] || "";
335
- var CircularProgress = (_a) => {
336
- var _b = _a, {
337
- loadingCaption = true,
338
- error = false,
339
- success = false,
340
- size = "default"
341
- } = _b, props = __objRest(_b, [
342
- "loadingCaption",
343
- "error",
344
- "success",
345
- "size"
346
- ]);
347
- const [status, setStatus] = useState("loading");
348
- useEffect(() => {
349
- if (error) {
350
- setStatus("error");
351
- } else if (success) {
352
- setStatus("success");
353
- } else {
354
- setStatus("loading");
355
- }
356
- }, [error, success]);
357
- return /* @__PURE__ */ jsxs(Stack, { width: "fit-content", alignItems: "center", children: [
358
- status === "loading" ? /* @__PURE__ */ jsx(
359
- MuiCircularProgress,
360
- __spreadProps(__spreadValues({
361
- "aria-label": "Loading"
362
- }, props), {
363
- size: size === "small" ? 24 : 40,
364
- variant: "indeterminate"
365
- })
366
- ) : /* @__PURE__ */ jsx(StatusIcon, { status, size }),
367
- /* @__PURE__ */ jsx(Typography, { marginTop: "8px", variant: "caption", children: loadingCaption || error || success ? getCaptionText(status) : null })
368
- ] });
369
- };
370
-
371
- // src/lib/modals/DisclaimerModal.tsx
309
+ import { CircularProgress } from "@availity/mui-progress";
372
310
  import { DialogContent } from "@availity/mui-dialog";
373
- import { jsx as jsx2 } from "react/jsx-runtime";
311
+ import { jsx } from "react/jsx-runtime";
374
312
  var disclaimerQuery = `query disclaimerFindOne($id: ID!) {
375
313
  configurationFindOne(id: $id) {
376
314
  ... on Text {
@@ -379,8 +317,8 @@ var disclaimerQuery = `query disclaimerFindOne($id: ID!) {
379
317
  }
380
318
  }`;
381
319
  var DisclaimerModal = ({ disclaimerId }) => {
382
- const [disclaimer, setDisclaimer] = useState2("");
383
- useEffect2(() => {
320
+ const [disclaimer, setDisclaimer] = useState("");
321
+ useEffect(() => {
384
322
  const fetchDisclaimer = () => __async(void 0, null, function* () {
385
323
  if (disclaimerId) {
386
324
  const result = yield avWebQLApi2.create({ query: disclaimerQuery, variables: { id: disclaimerId } });
@@ -389,17 +327,18 @@ var DisclaimerModal = ({ disclaimerId }) => {
389
327
  });
390
328
  fetchDisclaimer();
391
329
  }, [disclaimerId]);
392
- return /* @__PURE__ */ jsx2(DialogContent, { children: disclaimer ? /* @__PURE__ */ jsx2(ReactMarkdown, { children: disclaimer }) : /* @__PURE__ */ jsx2(CircularProgress, {}) });
330
+ return /* @__PURE__ */ jsx(DialogContent, { children: disclaimer ? /* @__PURE__ */ jsx(ReactMarkdown, { children: disclaimer }) : /* @__PURE__ */ jsx(CircularProgress, {}) });
393
331
  };
394
332
 
395
333
  // src/lib/modals/MultiPayerModal.tsx
396
334
  import { DialogContent as DialogContent2 } from "@availity/mui-dialog";
397
335
  import { Grid, Box } from "@availity/mui-layout";
398
- import { Typography as Typography2 } from "@availity/mui-typography";
336
+ import { Typography } from "@availity/mui-typography";
399
337
 
400
338
  // src/lib/SpacesImage.tsx
339
+ import { CircularProgress as CircularProgress2 } from "@availity/mui-progress";
401
340
  import { Img } from "react-image";
402
- import { jsx as jsx3 } from "react/jsx-runtime";
341
+ import { jsx as jsx2 } from "react/jsx-runtime";
403
342
  var SpacesImage = (_a) => {
404
343
  var _b = _a, { spaceId, payerId, imageType = "url", fallback } = _b, props = __objRest(_b, ["spaceId", "payerId", "imageType", "fallback"]);
405
344
  var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k;
@@ -421,29 +360,29 @@ var SpacesImage = (_a) => {
421
360
  };
422
361
  let url = imageMap[imageType];
423
362
  if (!url && loading) {
424
- return /* @__PURE__ */ jsx3(CircularProgress, { id: `app-${id}-loading` });
363
+ return /* @__PURE__ */ jsx2(CircularProgress2, { id: `app-${id}-loading` });
425
364
  }
426
365
  if (!url && !loading && fallback) {
427
366
  url = fallback;
428
367
  }
429
368
  if (!url || !id)
430
369
  return null;
431
- return /* @__PURE__ */ jsx3(
370
+ return /* @__PURE__ */ jsx2(
432
371
  Img,
433
372
  __spreadValues({
434
373
  id: props.id || `app-img-${id}`,
435
374
  src: url,
436
375
  alt: `Space ${imageType}`,
437
- loader: /* @__PURE__ */ jsx3(CircularProgress, { id: `app-img-${id}-loading` })
376
+ loader: /* @__PURE__ */ jsx2(CircularProgress2, { id: `app-img-${id}-loading` })
438
377
  }, props)
439
378
  );
440
379
  };
441
380
 
442
381
  // src/lib/modals/MultiPayerModal.tsx
443
- import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
444
- var MultiPayerModal = ({ parentPayerSpaces, name, state: { selectedOption }, setState }) => /* @__PURE__ */ jsxs2(DialogContent2, { children: [
445
- /* @__PURE__ */ jsx4(Typography2, { children: `Open ${name} as: ${selectedOption ? selectedOption.name || selectedOption.id : ""}` }),
446
- /* @__PURE__ */ jsx4(Grid, { direction: "row", children: parentPayerSpaces && parentPayerSpaces.map((payerSpace) => /* @__PURE__ */ jsx4(Box, { onClick: () => setState({ selectedOption: payerSpace }), children: /* @__PURE__ */ jsx4(SpacesImage, { spaceId: payerSpace.configurationId, imageType: "images.tile" }) })) })
382
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
383
+ var MultiPayerModal = ({ parentPayerSpaces, name, state: { selectedOption }, setState }) => /* @__PURE__ */ jsxs(DialogContent2, { children: [
384
+ /* @__PURE__ */ jsx3(Typography, { children: `Open ${name} as: ${selectedOption ? selectedOption.name || selectedOption.id : ""}` }),
385
+ /* @__PURE__ */ jsx3(Grid, { direction: "row", children: parentPayerSpaces && parentPayerSpaces.map((payerSpace) => /* @__PURE__ */ jsx3(Box, { onClick: () => setState({ selectedOption: payerSpace }), children: /* @__PURE__ */ jsx3(SpacesImage, { spaceId: payerSpace.configurationId, imageType: "images.tile" }) })) })
447
386
  ] });
448
387
 
449
388
  // src/lib/modals/modal-types.tsx
@@ -451,7 +390,7 @@ var isModalOptions = (action) => action.spaceType !== void 0;
451
390
  var isModalState = (action) => action.selectedOption !== void 0;
452
391
 
453
392
  // src/lib/modals/ModalProvider.tsx
454
- import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
393
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
455
394
  var MODAL_INITIAL_STATE = {
456
395
  isOpen: false,
457
396
  modalOptions: void 0,
@@ -535,23 +474,23 @@ var ModalProvider = ({ children }) => {
535
474
  const toggle = () => dispatch({ type: "RESET" });
536
475
  const buttonProps = (selectedModal == null ? void 0 : selectedModal.buttonProps) && (selectedModal == null ? void 0 : selectedModal.buttonProps(__spreadProps(__spreadValues({}, modalState), { modalOptions })));
537
476
  const Body = selectedModal == null ? void 0 : selectedModal.body;
538
- return /* @__PURE__ */ jsxs3(
477
+ return /* @__PURE__ */ jsxs2(
539
478
  ModalContext.Provider,
540
479
  {
541
480
  value: (modalType, modalOptions2) => dispatch(__spreadValues({ type: `OPEN_${modalType}` }, modalOptions2)),
542
481
  children: [
543
- /* @__PURE__ */ jsxs3(Dialog, { open: isOpen, children: [
544
- /* @__PURE__ */ jsx5(DialogTitle, { id: "disclaimer-header", children: modalOptions == null ? void 0 : modalOptions.title }),
545
- Body && /* @__PURE__ */ jsx5(
482
+ /* @__PURE__ */ jsxs2(Dialog, { open: isOpen, children: [
483
+ /* @__PURE__ */ jsx4(DialogTitle, { id: "disclaimer-header", children: modalOptions == null ? void 0 : modalOptions.title }),
484
+ Body && /* @__PURE__ */ jsx4(
546
485
  Body,
547
486
  __spreadProps(__spreadValues({}, modalOptions), {
548
487
  setState: (newState) => dispatch(__spreadValues({ type: "UPDATE_MODAL_STATE" }, newState)),
549
488
  state: modalState
550
489
  })
551
490
  ),
552
- /* @__PURE__ */ jsxs3(DialogActions, { children: [
553
- /* @__PURE__ */ jsx5(Button, { onClick: toggle, children: "Cancel" }),
554
- /* @__PURE__ */ jsx5(
491
+ /* @__PURE__ */ jsxs2(DialogActions, { children: [
492
+ /* @__PURE__ */ jsx4(Button, { onClick: toggle, children: "Cancel" }),
493
+ /* @__PURE__ */ jsx4(
555
494
  Button,
556
495
  __spreadProps(__spreadValues({
557
496
  color: "primary"
@@ -584,7 +523,7 @@ var ModalProvider = ({ children }) => {
584
523
  };
585
524
 
586
525
  // src/lib/Spaces.tsx
587
- import { jsx as jsx6 } from "react/jsx-runtime";
526
+ import { jsx as jsx5 } from "react/jsx-runtime";
588
527
  var INITIAL_STATE = {
589
528
  loading: true
590
529
  };
@@ -658,7 +597,7 @@ var Spaces = ({
658
597
  }
659
598
  ]
660
599
  });
661
- useEffect3(() => {
600
+ useEffect2(() => {
662
601
  if (isErrorByPayerIds || isErrorBySpaceIds) {
663
602
  dispatch({
664
603
  type: "ERROR",
@@ -667,7 +606,7 @@ var Spaces = ({
667
606
  });
668
607
  }
669
608
  }, [isErrorByPayerIds, isErrorBySpaceIds]);
670
- useEffect3(() => {
609
+ useEffect2(() => {
671
610
  dispatch({
672
611
  type: "LOADING",
673
612
  loading: true
@@ -734,7 +673,7 @@ var Spaces = ({
734
673
  return isReactNodeFunction(children) ? (() => children({ spaces: [spacesMap.values()], loading, error }))() : children;
735
674
  }
736
675
  };
737
- return /* @__PURE__ */ jsx6(
676
+ return /* @__PURE__ */ jsx5(
738
677
  SpacesContext.Provider,
739
678
  {
740
679
  value: {
@@ -744,7 +683,7 @@ var Spaces = ({
744
683
  loading: loading || isLoadingByPayerIds || isLoadingBySpaceIds,
745
684
  error
746
685
  },
747
- children: /* @__PURE__ */ jsx6(ModalProvider, { children: spacesChildren() })
686
+ children: /* @__PURE__ */ jsx5(ModalProvider, { children: spacesChildren() })
748
687
  }
749
688
  );
750
689
  };
@@ -773,307 +712,17 @@ var useSpaces = (...ids) => {
773
712
 
774
713
  // src/lib/SpacesLink/SpacesLink.tsx
775
714
  import dayjs2 from "dayjs";
776
-
777
- // ../card/src/lib/Card.tsx
778
- import { default as MuiCard } from "@mui/material/Card";
779
- import { jsx as jsx7 } from "react/jsx-runtime";
780
- var Card = (_a) => {
781
- var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
782
- return /* @__PURE__ */ jsx7(MuiCard, __spreadProps(__spreadValues({}, rest), { children }));
783
- };
784
-
785
- // ../card/src/lib/CardActionArea.tsx
786
- import {
787
- default as MuiCardActionArea
788
- } from "@mui/material/CardActionArea";
789
- import { jsx as jsx8 } from "react/jsx-runtime";
790
-
791
- // ../card/src/lib/CardActions.tsx
792
- import { default as MuiCardActions } from "@mui/material/CardActions";
793
- import { jsx as jsx9 } from "react/jsx-runtime";
794
-
795
- // ../card/src/lib/CardContent.tsx
796
- import { default as MuiCardContent } from "@mui/material/CardContent";
797
- import { jsx as jsx10 } from "react/jsx-runtime";
798
- var CardContent = (_a) => {
799
- var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
800
- return /* @__PURE__ */ jsx10(MuiCardContent, __spreadProps(__spreadValues({}, rest), { children }));
801
- };
802
-
803
- // ../card/src/lib/CardHeader.tsx
804
- import { useTheme } from "@mui/material/styles";
805
- import { default as MuiCardHeader } from "@mui/material/CardHeader";
806
- import { jsx as jsx11 } from "react/jsx-runtime";
807
-
808
- // ../card/src/lib/CardMedia.tsx
809
- import { default as MuiCardMedia } from "@mui/material/CardMedia";
810
- import { jsx as jsx12 } from "react/jsx-runtime";
811
-
812
- // src/lib/SpacesLink/SpacesLink.tsx
813
- import { Typography as Typography3 } from "@availity/mui-typography";
814
- import { useMemo as useMemo2, cloneElement } from "react";
815
-
816
- // ../chip/src/lib/Chip.tsx
817
- import { default as MuiChip } from "@mui/material/Chip";
818
- import { jsx as jsx13 } from "react/jsx-runtime";
819
-
820
- // ../chip/src/lib/StatusChip.tsx
821
- import { default as MuiChip2 } from "@mui/material/Chip";
822
- import { jsx as jsx14 } from "react/jsx-runtime";
823
- var StatusChip = (_a) => {
824
- var _b = _a, { color = "default" } = _b, rest = __objRest(_b, ["color"]);
825
- return /* @__PURE__ */ jsx14(MuiChip2, __spreadProps(__spreadValues({ color }, rest), { size: "small" }));
826
- };
827
-
828
- // src/lib/SpacesLink/SpacesLink.tsx
715
+ import { Card, CardContent } from "@availity/mui-card";
716
+ import { Typography as Typography2 } from "@availity/mui-typography";
717
+ import { useMemo, cloneElement } from "react";
718
+ import { StatusChip } from "@availity/mui-chip";
719
+ import { CircularProgress as CircularProgress3 } from "@availity/mui-progress";
829
720
  import Link from "@mui/material/Link";
830
-
831
- // ../favorites/src/lib/Favorites.tsx
832
- import { createContext as createContext3, useContext as useContext3, useEffect as useEffect4, useState as useState3, useMemo } from "react";
833
- import { useQueryClient as useQueryClient2 } from "@tanstack/react-query";
834
- import avMessages2 from "@availity/message-core";
835
-
836
- // ../favorites/src/lib/utils.ts
837
- import avMessages from "@availity/message-core";
838
- import { avSettingsApi } from "@availity/api-axios";
839
- import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
840
-
841
- // ../favorites/src/lib/Favorites.tsx
842
- import { jsx as jsx15 } from "react/jsx-runtime";
843
- var FavoritesContext = createContext3(null);
844
- var noOp = () => {
845
- };
846
- var useFavorites = (id) => {
847
- const context = useContext3(FavoritesContext);
848
- if (context === null) {
849
- throw new Error("useFavorites must be used within a FavoritesProvider");
850
- }
851
- const { favorites, queryStatus, mutationStatus, lastClickedFavoriteId, deleteFavorite, addFavorite } = context;
852
- const isLastClickedFavorite = lastClickedFavoriteId === id;
853
- const isFavorited = useMemo(() => {
854
- const fav = favorites == null ? void 0 : favorites.find((f) => f.id === id);
855
- return !!fav;
856
- }, [favorites, id]);
857
- const toggleFavorite = () => isFavorited ? deleteFavorite(id) : addFavorite(id);
858
- const isDisabled = queryStatus === "loading" || queryStatus === "idle" || mutationStatus === "loading";
859
- let status = "initLoading";
860
- if (queryStatus === "loading")
861
- status = "initLoading";
862
- if (mutationStatus === "loading")
863
- status = "reloading";
864
- if (queryStatus === "error" || mutationStatus === "error")
865
- status = "error";
866
- if (queryStatus === "success" && (mutationStatus === "success" || mutationStatus === "idle"))
867
- status = "success";
868
- return {
869
- isFavorited,
870
- status,
871
- isLastClickedFavorite,
872
- toggleFavorite: isDisabled ? noOp : toggleFavorite
873
- };
874
- };
875
-
876
- // ../tooltip/src/lib/Tooltip.tsx
877
- import { default as MuiTooltip } from "@mui/material/Tooltip";
878
- import { jsx as jsx16 } from "react/jsx-runtime";
879
- var Tooltip = (props) => {
880
- const _a = props, { children, dangerouslySetTransitionTimer } = _a, rest = __objRest(_a, ["children", "dangerouslySetTransitionTimer"]);
881
- return /* @__PURE__ */ jsx16(
882
- MuiTooltip,
883
- __spreadProps(__spreadValues({}, rest), {
884
- TransitionProps: { timeout: dangerouslySetTransitionTimer !== void 0 ? dangerouslySetTransitionTimer : 100 },
885
- arrow: true,
886
- children
887
- })
888
- );
889
- };
890
-
891
- // ../favorites/src/lib/FavoriteHeart.tsx
892
- import { HeartIcon, HeartEmptyIcon } from "@availity/mui-icon";
893
- import { styled } from "@mui/material/styles";
894
- import { jsx as jsx17, jsxs as jsxs4 } from "react/jsx-runtime";
895
- var icons = {
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" })
902
- };
903
- var FavoriteHeartContainer = styled("div", { name: "AvFavoriteHeart", slot: "root" })({});
904
- var FavoriteInput = styled("input", {
905
- name: "AvFavoriteHeart",
906
- slot: "input"
907
- })({});
908
- var FavoriteIcon = styled("div", {
909
- name: "AvFavoriteHeart",
910
- slot: "icon"
911
- })({});
912
- var FavoriteHeart = ({
913
- id,
914
- name,
915
- onChange,
916
- onMouseDown,
917
- disabled = false
918
- }) => {
919
- const { isFavorited, isLastClickedFavorite, status, toggleFavorite } = useFavorites(id);
920
- const handleChange = (event) => {
921
- onChange == null ? void 0 : onChange(isFavorited, event);
922
- toggleFavorite();
923
- };
924
- const handleKeyPress = (event) => {
925
- if (event.code === "Enter" || event.key === "Enter") {
926
- onChange == null ? void 0 : onChange(isFavorited, event);
927
- toggleFavorite();
928
- }
929
- };
930
- const iconKey = (() => {
931
- if (status === "initLoading")
932
- return "unknownDisabledHeart";
933
- if (status === "reloading") {
934
- if (isLastClickedFavorite)
935
- return "spinner";
936
- return isFavorited ? "favoritedDisabledHeart" : "unfavoritedDisabledHeart";
937
- }
938
- if (disabled) {
939
- return isFavorited ? "favoritedDisabledHeart" : "unfavoritedDisabledHeart";
940
- }
941
- if (isFavorited)
942
- return "favoritedHeart";
943
- return "unfavoritedHeart";
944
- })();
945
- const cursor = disabled || !isLastClickedFavorite && (status === "initLoading" || status === "reloading") ? "not-allowed" : void 0;
946
- const tooltipContent = `${isFavorited ? "Remove from" : "Add to"} My Favorites`;
947
- const favoriteInputProps = {
948
- onKeyDown: handleKeyPress,
949
- type: "checkbox",
950
- "aria-label": `Favorite ${name}`,
951
- id: `av-favorite-heart-${id}`,
952
- disabled,
953
- checked: isFavorited,
954
- onChange: handleChange,
955
- onMouseDown,
956
- style: { cursor }
957
- };
958
- return /* @__PURE__ */ jsxs4(FavoriteHeartContainer, { children: [
959
- /* @__PURE__ */ jsx17(FavoriteIcon, { children: icons[iconKey] }),
960
- /* @__PURE__ */ jsx17(
961
- "span",
962
- {
963
- style: {
964
- position: "absolute",
965
- width: "1px",
966
- height: "1px",
967
- padding: 0,
968
- margin: "-1px",
969
- overflow: "hidden",
970
- clip: "rect(0,0,0,0)",
971
- whiteSpace: "nowrap",
972
- border: 0
973
- },
974
- "aria-live": isLastClickedFavorite && (status === "reloading" || status === "error") ? "polite" : "off",
975
- children: isLastClickedFavorite && status === "reloading" ? "Loading..." : isLastClickedFavorite && status === "error" ? "An error has occurred. Please try again." : ""
976
- }
977
- ),
978
- disabled ? /* @__PURE__ */ jsx17(FavoriteInput, __spreadValues({}, favoriteInputProps)) : /* @__PURE__ */ jsx17(Tooltip, { title: tooltipContent, placement: "top", children: /* @__PURE__ */ jsx17(FavoriteInput, __spreadValues({}, favoriteInputProps)) })
979
- ] });
980
- };
981
-
982
- // src/lib/SpacesLink/SpacesLink.tsx
721
+ import { FavoriteHeart } from "@availity/mui-favorites";
983
722
  import { Grid as Grid2, Box as Box2 } from "@availity/mui-layout";
984
-
985
- // ../list/src/lib/List.tsx
986
- import MuiList from "@mui/material/List";
987
- import { jsx as jsx18 } from "react/jsx-runtime";
988
-
989
- // ../list/src/lib/ListItem.tsx
990
- import MuiListItem from "@mui/material/ListItem";
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 }));
995
- });
996
-
997
- // ../list/src/lib/ListItemAvatar.tsx
998
- import MuiListItemAvatar from "@mui/material/ListItemAvatar";
999
- import { jsx as jsx20 } from "react/jsx-runtime";
1000
-
1001
- // ../list/src/lib/ListItemButton.tsx
1002
- import MuiListItemButton from "@mui/material/ListItemButton";
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 }));
1007
- });
1008
-
1009
- // ../list/src/lib/ListItemIcon.tsx
1010
- import MuiListItemIcon from "@mui/material/ListItemIcon";
1011
- import { jsx as jsx22 } from "react/jsx-runtime";
1012
-
1013
- // ../list/src/lib/ListItemStatusCard.tsx
1014
- import { forwardRef as forwardRef3 } from "react";
1015
- import { styled as styled2, useThemeProps } from "@mui/material/styles";
1016
- import MuiListItem2 from "@mui/material/ListItem";
1017
- import { jsx as jsx23, jsxs as jsxs5 } from "react/jsx-runtime";
1018
- var ListItemStatusCardSlot = styled2(MuiListItem2, {
1019
- name: "AvListItemStatusCard",
1020
- slot: "root",
1021
- overridesResolver: (props, styles) => [styles.root, props.color && styles.color]
1022
- })(({ theme, ownerState }) => __spreadValues({
1023
- backgroundColor: theme.palette.background.paper,
1024
- border: `1px solid ${theme.palette.divider}`,
1025
- borderRadius: "4px",
1026
- marginBottom: "4px",
1027
- paddingLeft: "8px",
1028
- "&.MuiListItem-padding.MuiListItem-gutters": {
1029
- paddingLeft: "calc(16px + 8px)"
1030
- }
1031
- }, ownerState.color && ownerState.color !== "default" && {
1032
- ".AvListItemStatusCard-statusAccent": {
1033
- backgroundColor: `${theme.palette[ownerState.color].main}`
1034
- }
1035
- }));
1036
- var StatusAccent = styled2("div", {
1037
- name: "AvListItemStatusCard",
1038
- slot: "statusAccent",
1039
- overridesResolver: (props, styles) => [styles.statusAccent, props.color && styles.color]
1040
- })(({ theme }) => ({
1041
- position: "absolute",
1042
- left: 0,
1043
- top: 0,
1044
- height: "100%",
1045
- width: "8px",
1046
- backgroundColor: theme.palette.divider,
1047
- backgroundClip: "border-box",
1048
- borderTopLeftRadius: "3px",
1049
- borderBottomLeftRadius: "3px",
1050
- content: "''"
1051
- }));
1052
- var ListItemStatusCard = forwardRef3((props, ref) => {
1053
- const _a = props, { alignItems = "flex-start", children, color } = _a, rest = __objRest(_a, ["alignItems", "children", "color"]);
1054
- const themeProps = useThemeProps({ props, name: "AvListItemStatusCard" });
1055
- const ownerState = __spreadProps(__spreadValues({}, themeProps), { color });
1056
- return /* @__PURE__ */ jsxs5(ListItemStatusCardSlot, __spreadProps(__spreadValues({ alignItems, divider: false, ownerState }, rest), { ref, children: [
1057
- /* @__PURE__ */ jsx23(StatusAccent, { className: "AvListItemStatusCard-statusAccent" }),
1058
- children
1059
- ] }));
1060
- });
1061
-
1062
- // ../list/src/lib/ListItemText.tsx
1063
- import MuiListItemText from "@mui/material/ListItemText";
1064
- import { jsx as jsx24 } from "react/jsx-runtime";
1065
- var ListItemText = (_a) => {
1066
- var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
1067
- return /* @__PURE__ */ jsx24(MuiListItemText, __spreadProps(__spreadValues({}, rest), { children }));
1068
- };
1069
-
1070
- // ../list/src/lib/ListSubheader.tsx
1071
- import MuiListSubheader from "@mui/material/ListSubheader";
1072
- import { jsx as jsx25 } from "react/jsx-runtime";
1073
-
1074
- // src/lib/SpacesLink/SpacesLink.tsx
723
+ import { ListItem, ListItemText } from "@availity/mui-list";
1075
724
  import ReactMarkdown2 from "react-markdown";
1076
- import { styled as styled3 } from "@mui/material/styles";
725
+ import { styled } from "@mui/material/styles";
1077
726
 
1078
727
  // src/lib/SpacesLink/useLink.tsx
1079
728
  import { useCurrentUser } from "@availity/hooks";
@@ -1216,11 +865,11 @@ var useLink = (spaceOrSpaceId, options) => {
1216
865
  };
1217
866
 
1218
867
  // src/lib/SpacesLink/SpacesLink.tsx
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" })({});
868
+ import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
869
+ var SpacesLinkContainer = styled(Box2, { name: "AvSpacesLink", slot: "root" })({});
870
+ var DateInfo = styled(Grid2, { name: "AvSpacesLink", slot: "AvDateInfo" })({});
871
+ var SpacesLinkFavoriteHeart = styled(Grid2, { name: "AvSpacesLink", slot: "AvFavoriteHeart" })({});
872
+ var IconLink = styled(Link, { name: "AvSpacesLink", slot: "IconLink" })({});
1224
873
  var getDisplayDate = (date) => dayjs2(date).format("MM/DD/YYYY");
1225
874
  var getContainerTag = (propTag, variant) => {
1226
875
  if (variant && variant !== "default")
@@ -1239,7 +888,7 @@ var getTitleTag = (propTag, variant) => {
1239
888
  };
1240
889
  var getTextTag = (propTag, variant) => {
1241
890
  if (variant && variant !== "default")
1242
- return { card: Typography3, list: ListItemText }[variant];
891
+ return { card: Typography2, list: ListItemText }[variant];
1243
892
  return propTag || "div";
1244
893
  };
1245
894
  var SpacesLink = (_a) => {
@@ -1307,8 +956,8 @@ var SpacesLink = (_a) => {
1307
956
  const isLoading = loading || propsLoading;
1308
957
  const [linkSpace, props] = useLink(propSpace || spaceId, { clientId: propsClientId, linkAttributes });
1309
958
  const showUrl = !(linkSpace == null ? void 0 : linkSpace.isGhosted) && ((_a2 = linkSpace == null ? void 0 : linkSpace.link) == null ? void 0 : _a2.url);
1310
- const favoriteIcon = useMemo2(
1311
- () => (linkSpace == null ? void 0 : linkSpace.configurationId) && favorite && /* @__PURE__ */ jsx26(SpacesLinkFavoriteHeart, { children: /* @__PURE__ */ jsx26(
959
+ const favoriteIcon = useMemo(
960
+ () => (linkSpace == null ? void 0 : linkSpace.configurationId) && favorite && /* @__PURE__ */ jsx6(SpacesLinkFavoriteHeart, { children: /* @__PURE__ */ jsx6(
1312
961
  FavoriteHeart,
1313
962
  {
1314
963
  id: `${idPrefix}${linkSpace == null ? void 0 : linkSpace.configurationId}`,
@@ -1318,11 +967,11 @@ var SpacesLink = (_a) => {
1318
967
  ) }),
1319
968
  [favorite, linkSpace == null ? void 0 : linkSpace.configurationId, linkSpace == null ? void 0 : linkSpace.name, idPrefix]
1320
969
  );
1321
- const dateInfo = useMemo2(
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(
1325
- Typography3,
970
+ const dateInfo = useMemo(
971
+ () => (showNew || showDate) && /* @__PURE__ */ jsxs3(DateInfo, { textAlign: stacked ? "center" : "right", children: [
972
+ showNew && (linkSpace == null ? void 0 : linkSpace.isNew) && /* @__PURE__ */ jsx6(StatusChip, { id: `${idPrefix}app-new-badge-${linkSpace == null ? void 0 : linkSpace.configurationId}`, label: "New!", color: "secondary" }),
973
+ showDate && /* @__PURE__ */ jsx6(
974
+ Typography2,
1326
975
  {
1327
976
  id: `${idPrefix}app-date-badge-${linkSpace == null ? void 0 : linkSpace.configurationId}`,
1328
977
  variant: "caption",
@@ -1333,13 +982,13 @@ var SpacesLink = (_a) => {
1333
982
  ] }),
1334
983
  [linkSpace == null ? void 0 : linkSpace.activeDate, linkSpace == null ? void 0 : linkSpace.isNew, showDate, showNew, stacked, linkSpace == null ? void 0 : linkSpace.configurationId, idPrefix]
1335
984
  );
1336
- const customBadgeDisplay = useMemo2(
1337
- () => customBadgeText && /* @__PURE__ */ jsx26(
985
+ const customBadgeDisplay = useMemo(
986
+ () => customBadgeText && /* @__PURE__ */ jsx6(
1338
987
  Box2,
1339
988
  {
1340
989
  textAlign: stacked ? "center" : "inherit",
1341
990
  marginRight: variant !== "card" && (showDate || showNew && (linkSpace == null ? void 0 : linkSpace.isNew)) ? 1 : void 0,
1342
- children: /* @__PURE__ */ jsx26(
991
+ children: /* @__PURE__ */ jsx6(
1343
992
  StatusChip,
1344
993
  {
1345
994
  color: customBadgeColor || "info",
@@ -1362,7 +1011,7 @@ var SpacesLink = (_a) => {
1362
1011
  ]
1363
1012
  );
1364
1013
  if (isLoading) {
1365
- return /* @__PURE__ */ jsx26(CircularProgress, __spreadValues({ id: `${idPrefix}app-${linkSpace == null ? void 0 : linkSpace.configurationId}-loading` }, rest));
1014
+ return /* @__PURE__ */ jsx6(CircularProgress3, __spreadValues({ id: `${idPrefix}app-${linkSpace == null ? void 0 : linkSpace.configurationId}-loading` }, rest));
1366
1015
  }
1367
1016
  const Tag = getContainerTag(tag, variant);
1368
1017
  const BodyTag = getBodyTag(bodyTag, variant);
@@ -1378,7 +1027,7 @@ var SpacesLink = (_a) => {
1378
1027
  }, analytics), props));
1379
1028
  }
1380
1029
  };
1381
- return /* @__PURE__ */ jsx26(
1030
+ return /* @__PURE__ */ jsx6(
1382
1031
  SpacesLinkContainer,
1383
1032
  __spreadProps(__spreadValues({
1384
1033
  component: Tag,
@@ -1387,7 +1036,7 @@ var SpacesLink = (_a) => {
1387
1036
  }, rest), {
1388
1037
  style: __spreadValues({}, style),
1389
1038
  role: variant === "list" ? "listitem" : role,
1390
- children: /* @__PURE__ */ jsx26(BodyTag, { style: { width: "100%" }, children: /* @__PURE__ */ jsxs6(
1039
+ children: /* @__PURE__ */ jsx6(BodyTag, { style: { width: "100%" }, children: /* @__PURE__ */ jsxs3(
1391
1040
  Grid2,
1392
1041
  {
1393
1042
  alignItems: !showDescription || stacked ? "center" : "start",
@@ -1396,24 +1045,24 @@ var SpacesLink = (_a) => {
1396
1045
  flexWrap: "nowrap",
1397
1046
  children: [
1398
1047
  !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(
1048
+ FileIcon && (linkSpace == null ? void 0 : linkSpace.url) && ((_b2 = linkSpace == null ? void 0 : linkSpace.type) == null ? void 0 : _b2.toUpperCase()) === "FILE" ? /* @__PURE__ */ jsx6(
1400
1049
  IconLink,
1401
1050
  {
1402
1051
  target: "_blank",
1403
1052
  href: linkSpace == null ? void 0 : linkSpace.url,
1404
1053
  role: "link",
1405
1054
  "aria-labelledby": `${idPrefix}app-title-${linkSpace == null ? void 0 : linkSpace.configurationId}`,
1406
- children: /* @__PURE__ */ jsx26(FileIcon, { "data-testid": "icon" })
1055
+ children: /* @__PURE__ */ jsx6(FileIcon, { "data-testid": "icon" })
1407
1056
  }
1408
1057
  ) : 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(
1058
+ children ? renderChildren() : body && /* @__PURE__ */ jsxs3(Grid2, { id: `${idPrefix}${linkSpace == null ? void 0 : linkSpace.type}-${linkSpace == null ? void 0 : linkSpace.configurationId}`, flexGrow: 1, children: [
1059
+ /* @__PURE__ */ jsx6(
1411
1060
  Box2,
1412
1061
  {
1413
1062
  marginBottom: !customBadgeDisplay && (!showDescription || !(linkSpace == null ? void 0 : linkSpace.description)) ? 0 : void 0,
1414
1063
  paddingTop: stacked ? 3 : void 0,
1415
1064
  textAlign: stacked ? "center" : void 0,
1416
- children: /* @__PURE__ */ jsx26(
1065
+ children: /* @__PURE__ */ jsx6(
1417
1066
  TitleTag,
1418
1067
  __spreadProps(__spreadValues(__spreadValues({
1419
1068
  id: `${idPrefix}app-title-${linkSpace == null ? void 0 : linkSpace.configurationId}`,
@@ -1434,7 +1083,7 @@ var SpacesLink = (_a) => {
1434
1083
  }
1435
1084
  ),
1436
1085
  stacked && dateInfo,
1437
- showDescription && (linkSpace == null ? void 0 : linkSpace.description) && /* @__PURE__ */ jsx26(
1086
+ showDescription && (linkSpace == null ? void 0 : linkSpace.description) && /* @__PURE__ */ jsx6(
1438
1087
  TextTag,
1439
1088
  {
1440
1089
  component: "div",
@@ -1447,7 +1096,7 @@ var SpacesLink = (_a) => {
1447
1096
  textOverflow: "ellipsis"
1448
1097
  },
1449
1098
  id: `${idPrefix}app-description-${linkSpace == null ? void 0 : linkSpace.configurationId}`,
1450
- children: /* @__PURE__ */ jsx26(ReactMarkdown2, { children: linkSpace == null ? void 0 : linkSpace.description })
1099
+ children: /* @__PURE__ */ jsx6(ReactMarkdown2, { children: linkSpace == null ? void 0 : linkSpace.description })
1451
1100
  }
1452
1101
  ),
1453
1102
  variant === "card" && customBadgeDisplay
@@ -1462,16 +1111,16 @@ var SpacesLink = (_a) => {
1462
1111
  };
1463
1112
 
1464
1113
  // src/lib/SpacesAgreement.tsx
1465
- import { Typography as Typography4 } from "@availity/mui-typography";
1114
+ import { Typography as Typography3 } from "@availity/mui-typography";
1466
1115
  import ReactMarkdown3 from "react-markdown";
1467
- import { jsx as jsx27 } from "react/jsx-runtime";
1116
+ import { jsx as jsx7 } from "react/jsx-runtime";
1468
1117
  var SpacesAgreement = ({ spaceId, markdown = false, id: elementId }) => {
1469
1118
  const spaces = useSpaces(spaceId);
1470
1119
  if (spaces && spaces.length > 0) {
1471
1120
  const { description: agreement, id } = spaces[0];
1472
1121
  if (agreement) {
1473
- const children = markdown ? /* @__PURE__ */ jsx27(ReactMarkdown3, { children: agreement }) : agreement;
1474
- return /* @__PURE__ */ jsx27(Typography4, { variant: "agreement", id: elementId || `spaces-agreement-${spaceId || id}`, children });
1122
+ const children = markdown ? /* @__PURE__ */ jsx7(ReactMarkdown3, { children: agreement }) : agreement;
1123
+ return /* @__PURE__ */ jsx7(Typography3, { variant: "agreement", id: elementId || `spaces-agreement-${spaceId || id}`, children });
1475
1124
  }
1476
1125
  }
1477
1126
  return null;
@@ -1480,7 +1129,7 @@ var SpacesAgreement = ({ spaceId, markdown = false, id: elementId }) => {
1480
1129
  // src/lib/SpacesDisclaimer.tsx
1481
1130
  import { Disclaimer } from "@availity/mui-disclaimer";
1482
1131
  import ReactMarkdown4 from "react-markdown";
1483
- import { jsx as jsx28 } from "react/jsx-runtime";
1132
+ import { jsx as jsx8 } from "react/jsx-runtime";
1484
1133
  var SpacesDisclaimer = (_a) => {
1485
1134
  var _b = _a, {
1486
1135
  accent = true,
@@ -1497,8 +1146,8 @@ var SpacesDisclaimer = (_a) => {
1497
1146
  if (spaces && spaces.length > 0) {
1498
1147
  const { description: disclaimer, id } = spaces[0];
1499
1148
  if (disclaimer) {
1500
- const children = markdown ? /* @__PURE__ */ jsx28(ReactMarkdown4, { children: disclaimer }) : disclaimer;
1501
- return /* @__PURE__ */ jsx28(
1149
+ const children = markdown ? /* @__PURE__ */ jsx8(ReactMarkdown4, { children: disclaimer }) : disclaimer;
1150
+ return /* @__PURE__ */ jsx8(
1502
1151
  Disclaimer,
1503
1152
  __spreadValues({
1504
1153
  accent,
@@ -1512,14 +1161,14 @@ var SpacesDisclaimer = (_a) => {
1512
1161
  };
1513
1162
 
1514
1163
  // src/lib/SpacesGhostText.tsx
1515
- import { jsx as jsx29 } from "react/jsx-runtime";
1164
+ import { jsx as jsx9 } from "react/jsx-runtime";
1516
1165
  var SpacesGhostText = (_a) => {
1517
1166
  var _b = _a, { spaceId, id } = _b, props = __objRest(_b, ["spaceId", "id"]);
1518
1167
  var _a2;
1519
1168
  const spaces = useSpaces(spaceId);
1520
1169
  const space = spaces == null ? void 0 : spaces[0];
1521
1170
  if (space == null ? void 0 : space.isGhosted) {
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 }) }));
1171
+ return /* @__PURE__ */ jsx9("small", __spreadProps(__spreadValues({ id: id || `app-ghost-text-${spaceId}` }, props), { children: /* @__PURE__ */ jsx9("em", { children: (_a2 = space == null ? void 0 : space.meta) == null ? void 0 : _a2.ghostText }) }));
1523
1172
  }
1524
1173
  return null;
1525
1174
  };