sevago-sso-fe 1.0.82 → 1.0.84

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.esm.js CHANGED
@@ -3,10 +3,10 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
3
3
  import { Stack, TableCell, tableCellClasses, LinearProgress, linearProgressClasses, useTheme as useTheme$2, Skeleton, Box, styled as styled$3, InputLabel, Link, Typography, Paper, IconButton, Fade, Tooltip, tooltipClasses, Avatar, Badge, Icon, Tabs, Tab, CircularProgress, Button, FormControlLabel, Checkbox, Dialog, DialogTitle, DialogContent, DialogActions, Collapse, FormControl, Select, MenuItem, Pagination, RadioGroup, Radio, ClickAwayListener } from "@mui/material";
4
4
  import * as React from "react";
5
5
  import React__default, { useState, useId, useEffect, useRef, Fragment as Fragment$1 } from "react";
6
+ import { motion, LayoutGroup, AnimatePresence, MotionConfig } from "framer-motion";
6
7
  import { unstable_createGetCssVar, createSpacing as createSpacing$1, useTheme as useTheme$1, Stack as Stack$1, Box as Box$1 } from "@mui/system";
7
8
  import styled$2 from "@emotion/styled";
8
9
  import "@emotion/react";
9
- import { motion, LayoutGroup, AnimatePresence, MotionConfig } from "framer-motion";
10
10
  import { useLocation, useNavigate } from "react-router-dom";
11
11
  import { Form } from "formik";
12
12
  const sevagoEHiringIcon = "data:image/svg+xml,%3csvg%20width='54'%20height='54'%20viewBox='0%200%2054%2054'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d_2505_587)'%3e%3cpath%20d='M26.9997%202C39.702%202%2049.9992%2012.2973%2049.9993%2024.9997C49.9993%2029.9065%2048.4622%2034.454%2045.844%2038.1882L48.8273%2041.1715L48.9707%2041.3213C50.3888%2042.8915%2050.3405%2045.3143%2048.8273%2046.8275C47.3143%2048.3405%2044.8913%2048.389%2043.3212%2046.9707L43.1715%2046.8275L40.188%2043.844C36.454%2046.4623%2031.9065%2047.9993%2026.9997%2047.9993C14.2972%2047.9992%204%2037.7022%204%2024.9997C4.00017%2012.2973%2014.2973%202.00017%2026.9997%202ZM26.9997%208.02533C17.6255%208.0255%2010.0255%2015.6255%2010.0253%2024.9997C10.0253%2034.374%2017.6253%2041.9738%2026.9997%2041.974C36.374%2041.974%2043.9738%2034.374%2043.9738%2024.9997C43.9737%2015.6255%2036.3738%208.02533%2026.9997%208.02533ZM29.1008%2027C30.9238%2027.0327%2032.7062%2027.5537%2034.2685%2028.5103C34.6045%2028.7162%2034.9277%2028.941%2035.2368%2029.1827C37.3037%2030.7973%2037.0545%2033.918%2034.9147%2035.4342C34.3567%2035.8295%2033.7702%2036.1848%2033.1585%2036.4955C31.266%2037.4562%2029.1842%2037.9708%2027.0695%2037.9993C24.9552%2038.0278%2022.8615%2037.569%2020.9448%2036.6598C20.3177%2036.3623%2019.7142%2036.0187%2019.1398%2035.6328C16.975%2034.1778%2016.6373%2031.0858%2018.6353%2029.4088C18.9863%2029.1143%2019.3567%2028.8417%2019.7453%2028.595C21.341%2027.5827%2023.1778%2027.0317%2025.0578%2027H29.1008ZM26.9997%2012C28.5908%2012%2030.1175%2012.6327%2031.2428%2013.7578C32.3677%2014.8828%2033.0003%2016.4083%2033.0005%2017.9993C33.0005%2019.5907%2032.3678%2021.1173%2031.2428%2022.2425C30.1175%2023.3677%2028.5908%2024.0003%2026.9997%2024.0003C25.4085%2024.0002%2023.8832%2023.3675%2022.758%2022.2425C21.6328%2021.1173%2021.0002%2019.5907%2021.0002%2017.9993C21.0005%2016.4083%2021.633%2014.8828%2022.758%2013.7578C23.8832%2012.6328%2025.4085%2012.0002%2026.9997%2012Z'%20fill='white'%20/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_2505_587'%20x='0'%20y='0'%20width='53.9994'%20height='53.9995'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'%20/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'%20/%3e%3cfeOffset%20dy='2'%20/%3e%3cfeGaussianBlur%20stdDeviation='2'%20/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'%20/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200.182083%200%200%200%200%200.243258%200%200%200%200%200.316667%200%200%200%200.16%200'%20/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_2505_587'%20/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_2505_587'%20result='shape'%20/%3e%3c/filter%3e%3c/defs%3e%3c/svg%3e";
@@ -6670,6 +6670,98 @@ const IconRight = (props) => /* @__PURE__ */ jsx("svg", { width: "20", height: "
6670
6670
  strokeLinejoin: "round"
6671
6671
  }
6672
6672
  ) });
6673
+ const animationPresets = {
6674
+ fadeInUp: {
6675
+ initial: { opacity: 0, y: 50 },
6676
+ animate: { opacity: 1, y: 0 },
6677
+ transition: { duration: 0.2, ease: "easeOut" }
6678
+ },
6679
+ fadeInDown: {
6680
+ initial: { opacity: 0, y: -50 },
6681
+ animate: { opacity: 1, y: 0 },
6682
+ transition: { duration: 0.3, ease: "easeOut" }
6683
+ },
6684
+ fadeInLeft: {
6685
+ initial: { opacity: 0, x: -50 },
6686
+ animate: { opacity: 1, x: 0 },
6687
+ transition: { duration: 0.3, ease: "easeOut" }
6688
+ },
6689
+ fadeInRight: {
6690
+ initial: { opacity: 0, x: 50 },
6691
+ animate: { opacity: 1, x: 0 },
6692
+ transition: { duration: 0.3, ease: "easeOut" }
6693
+ },
6694
+ scaleIn: {
6695
+ initial: { opacity: 0, scale: 0.9 },
6696
+ animate: { opacity: 1, scale: 1 },
6697
+ transition: { duration: 0.3, ease: "easeOut" }
6698
+ },
6699
+ slideInUp: {
6700
+ initial: { opacity: 0, y: 20 },
6701
+ animate: { opacity: 1, y: 0 },
6702
+ transition: { duration: 0.4, ease: "easeOut" }
6703
+ },
6704
+ staggerItem: {
6705
+ initial: { opacity: 0, y: 30, scale: 0.9 },
6706
+ animate: { opacity: 1, y: 0, scale: 1 },
6707
+ transition: { duration: 0.4, delay: 0, ease: "easeOut" }
6708
+ },
6709
+ tabContent: {
6710
+ initial: { opacity: 0, y: 20 },
6711
+ animate: { opacity: 1, y: 0 },
6712
+ transition: { duration: 0.4, ease: "easeOut" }
6713
+ },
6714
+ tabUnderline: {
6715
+ initial: { scaleX: 0, opacity: 0 },
6716
+ animate: { scaleX: 1, opacity: 1 },
6717
+ exit: { scaleX: 0, opacity: 0 },
6718
+ transition: { duration: 0.3, ease: "easeInOut" }
6719
+ }
6720
+ };
6721
+ const MotionBox = ({
6722
+ children,
6723
+ sx,
6724
+ onClick,
6725
+ preset = "fadeInUp",
6726
+ delay,
6727
+ index,
6728
+ hover = false,
6729
+ ...motionProps
6730
+ }) => {
6731
+ const getAnimationProps = () => {
6732
+ if (preset) {
6733
+ const presetConfig = animationPresets[preset];
6734
+ if (preset === "staggerItem" && index !== void 0) {
6735
+ return {
6736
+ ...presetConfig,
6737
+ transition: {
6738
+ ...presetConfig.transition,
6739
+ delay: index * 0.05 + (delay || 0)
6740
+ }
6741
+ };
6742
+ }
6743
+ if (delay !== void 0) {
6744
+ return {
6745
+ ...presetConfig,
6746
+ transition: {
6747
+ ...presetConfig.transition,
6748
+ delay
6749
+ }
6750
+ };
6751
+ }
6752
+ return presetConfig;
6753
+ }
6754
+ return {};
6755
+ };
6756
+ const hoverProps = hover ? {
6757
+ whileHover: {
6758
+ y: -4,
6759
+ scale: 1.05,
6760
+ transition: { duration: 0.2 }
6761
+ }
6762
+ } : {};
6763
+ return /* @__PURE__ */ jsx(motion.div, { ...motionProps, ...getAnimationProps(), ...hoverProps, onClick, style: { ...sx }, children });
6764
+ };
6673
6765
  const StackRow = styled(Stack)(() => ({
6674
6766
  flexDirection: "row"
6675
6767
  }));
@@ -6842,98 +6934,6 @@ const ImageElement = ({
6842
6934
  )
6843
6935
  ] });
6844
6936
  };
6845
- const animationPresets = {
6846
- fadeInUp: {
6847
- initial: { opacity: 0, y: 50 },
6848
- animate: { opacity: 1, y: 0 },
6849
- transition: { duration: 0.2, ease: "easeOut" }
6850
- },
6851
- fadeInDown: {
6852
- initial: { opacity: 0, y: -50 },
6853
- animate: { opacity: 1, y: 0 },
6854
- transition: { duration: 0.3, ease: "easeOut" }
6855
- },
6856
- fadeInLeft: {
6857
- initial: { opacity: 0, x: -50 },
6858
- animate: { opacity: 1, x: 0 },
6859
- transition: { duration: 0.3, ease: "easeOut" }
6860
- },
6861
- fadeInRight: {
6862
- initial: { opacity: 0, x: 50 },
6863
- animate: { opacity: 1, x: 0 },
6864
- transition: { duration: 0.3, ease: "easeOut" }
6865
- },
6866
- scaleIn: {
6867
- initial: { opacity: 0, scale: 0.9 },
6868
- animate: { opacity: 1, scale: 1 },
6869
- transition: { duration: 0.3, ease: "easeOut" }
6870
- },
6871
- slideInUp: {
6872
- initial: { opacity: 0, y: 20 },
6873
- animate: { opacity: 1, y: 0 },
6874
- transition: { duration: 0.4, ease: "easeOut" }
6875
- },
6876
- staggerItem: {
6877
- initial: { opacity: 0, y: 30, scale: 0.9 },
6878
- animate: { opacity: 1, y: 0, scale: 1 },
6879
- transition: { duration: 0.4, delay: 0, ease: "easeOut" }
6880
- },
6881
- tabContent: {
6882
- initial: { opacity: 0, y: 20 },
6883
- animate: { opacity: 1, y: 0 },
6884
- transition: { duration: 0.4, ease: "easeOut" }
6885
- },
6886
- tabUnderline: {
6887
- initial: { scaleX: 0, opacity: 0 },
6888
- animate: { scaleX: 1, opacity: 1 },
6889
- exit: { scaleX: 0, opacity: 0 },
6890
- transition: { duration: 0.3, ease: "easeInOut" }
6891
- }
6892
- };
6893
- const MotionBox = ({
6894
- children,
6895
- sx,
6896
- onClick,
6897
- preset = "fadeInUp",
6898
- delay,
6899
- index,
6900
- hover = false,
6901
- ...motionProps
6902
- }) => {
6903
- const getAnimationProps = () => {
6904
- if (preset) {
6905
- const presetConfig = animationPresets[preset];
6906
- if (preset === "staggerItem" && index !== void 0) {
6907
- return {
6908
- ...presetConfig,
6909
- transition: {
6910
- ...presetConfig.transition,
6911
- delay: index * 0.05 + (delay || 0)
6912
- }
6913
- };
6914
- }
6915
- if (delay !== void 0) {
6916
- return {
6917
- ...presetConfig,
6918
- transition: {
6919
- ...presetConfig.transition,
6920
- delay
6921
- }
6922
- };
6923
- }
6924
- return presetConfig;
6925
- }
6926
- return {};
6927
- };
6928
- const hoverProps = hover ? {
6929
- whileHover: {
6930
- y: -4,
6931
- scale: 1.05,
6932
- transition: { duration: 0.2 }
6933
- }
6934
- } : {};
6935
- return /* @__PURE__ */ jsx(motion.div, { ...motionProps, ...getAnimationProps(), ...hoverProps, onClick, style: { ...sx }, children });
6936
- };
6937
6937
  const ImageBrand = styled(ImageElement)(({ theme }) => ({
6938
6938
  height: HEIGHT_ELEMENT_OTHER,
6939
6939
  border: `1px solid ${theme.palette.divider}`,
@@ -7195,6 +7195,39 @@ const TypographyFilter = styled$3(Typography)(({ theme }) => ({
7195
7195
  textWrap: "nowrap",
7196
7196
  padding: `0px ${PADDING_GAP_LAYOUT}`
7197
7197
  }));
7198
+ const AppGridItem = ({
7199
+ app,
7200
+ iconSize,
7201
+ iconRadius,
7202
+ titleVariant = "subtitle1",
7203
+ titleColor,
7204
+ showNameApps = true,
7205
+ direction = "column"
7206
+ }) => {
7207
+ return /* @__PURE__ */ jsxs(Stack$1, { sx: { flexDirection: direction }, children: [
7208
+ /* @__PURE__ */ jsx(
7209
+ StackRowAlignJustCenter,
7210
+ {
7211
+ sx: {
7212
+ width: iconSize,
7213
+ height: iconSize,
7214
+ borderRadius: iconRadius,
7215
+ mb: 1.5,
7216
+ background: app.color
7217
+ },
7218
+ children: /* @__PURE__ */ jsx(
7219
+ ImageElement,
7220
+ {
7221
+ sx: { width: iconSize * 0.56, height: iconSize * 0.56 },
7222
+ url: app.icon,
7223
+ sizeType: ImageSizeType.SQUARE
7224
+ }
7225
+ )
7226
+ }
7227
+ ),
7228
+ showNameApps && /* @__PURE__ */ jsx(Typography, { variant: titleVariant, sx: { color: titleColor }, children: app.content })
7229
+ ] });
7230
+ };
7198
7231
  const AppGrid = ({
7199
7232
  apps,
7200
7233
  columns = 5,
@@ -7231,7 +7264,7 @@ const AppGrid = ({
7231
7264
  },
7232
7265
  children: [
7233
7266
  visibleApps.map((app, index) => {
7234
- return /* @__PURE__ */ jsxs(
7267
+ return /* @__PURE__ */ jsx(
7235
7268
  MotionBox,
7236
7269
  {
7237
7270
  preset: "staggerItem",
@@ -7245,29 +7278,16 @@ const AppGrid = ({
7245
7278
  flexDirection: "column"
7246
7279
  },
7247
7280
  onClick: () => onClickApp(app),
7248
- children: [
7249
- /* @__PURE__ */ jsx(
7250
- StackRowAlignJustCenter,
7251
- {
7252
- sx: {
7253
- width: iconSize,
7254
- height: iconSize,
7255
- borderRadius: iconRadius,
7256
- mb: 1.5,
7257
- background: app.color
7258
- },
7259
- children: /* @__PURE__ */ jsx(
7260
- ImageElement,
7261
- {
7262
- sx: { width: iconSize * 0.56, height: iconSize * 0.56 },
7263
- url: app.icon,
7264
- sizeType: ImageSizeType.SQUARE
7265
- }
7266
- )
7267
- }
7268
- ),
7269
- /* @__PURE__ */ jsx(Typography, { variant: titleVariant, sx: { color: titleColor ?? theme.palette.common.white }, children: app.content })
7270
- ]
7281
+ children: /* @__PURE__ */ jsx(
7282
+ AppGridItem,
7283
+ {
7284
+ app,
7285
+ iconSize,
7286
+ iconRadius,
7287
+ titleVariant,
7288
+ titleColor: titleColor ?? theme.palette.common.white
7289
+ }
7290
+ )
7271
7291
  },
7272
7292
  index
7273
7293
  );
@@ -9751,11 +9771,24 @@ const SystemMonitorSidebarPart = ({
9751
9771
  position,
9752
9772
  blacklist,
9753
9773
  env,
9754
- onClickApp
9774
+ onClickApp,
9775
+ showNameApps = false,
9776
+ direction = "row"
9755
9777
  }) => {
9756
9778
  const [open, setOpen] = useState(false);
9779
+ const [currentApp, setCurrentApp] = useState(null);
9780
+ useEffect(() => {
9781
+ const href = window.location.href;
9782
+ const matchedKey = Object.keys(APP_OBJ).find((key) => {
9783
+ const app = APP_OBJ[key];
9784
+ const target = app.path[env];
9785
+ return !!target && href.startsWith(target);
9786
+ });
9787
+ setCurrentApp(matchedKey ? APP_OBJ[matchedKey] : null);
9788
+ }, [window.location.href]);
9757
9789
  return /* @__PURE__ */ jsxs(Fragment, { children: [
9758
9790
  /* @__PURE__ */ jsx(ImageElement, { url: IconAppsSidebar, onClick: () => setOpen(true), sizeType: ImageSizeType.SQUARE }),
9791
+ currentApp && /* @__PURE__ */ jsx(AppGridItem, { app: currentApp, iconSize: 32, iconRadius: 6, showNameApps, direction }),
9759
9792
  /* @__PURE__ */ jsx(
9760
9793
  AppsSidebar,
9761
9794
  {
@@ -9772,6 +9805,13 @@ const SystemMonitorSidebarPart = ({
9772
9805
  const SystemMonitorScreen = ({ blacklist, env, onClickApp }) => {
9773
9806
  const theme = useTheme();
9774
9807
  const [tab, setTab] = useState(AppGroup.ALL);
9808
+ const getAppsForGroup = (group) => Object.keys(APP_OBJ).filter((key) => {
9809
+ const e = APP_OBJ[key];
9810
+ const isBlacklisted = !!blacklist?.includes(key);
9811
+ const isInSelectedGroup = group === AppGroup.ALL ? true : e.group === group;
9812
+ return !isBlacklisted && isInSelectedGroup;
9813
+ }).map((key) => APP_OBJ[key]);
9814
+ const appsForCurrentTab = getAppsForGroup(tab);
9775
9815
  return /* @__PURE__ */ jsx(
9776
9816
  MotionBox,
9777
9817
  {
@@ -9803,28 +9843,29 @@ const SystemMonitorScreen = ({ blacklist, env, onClickApp }) => {
9803
9843
  width: "100%",
9804
9844
  justifyContent: "flex-start"
9805
9845
  },
9806
- children: Object.values(AppGroup).map((g) => /* @__PURE__ */ jsx(MotionBox, { sx: { position: "relative" }, preset: "tabUnderline", children: /* @__PURE__ */ jsx(
9807
- Typography,
9808
- {
9809
- onClick: () => setTab(g),
9810
- sx: {
9811
- cursor: "pointer",
9812
- color: tab === g ? theme.palette.common.white : theme.palette.grey[300]
9813
- },
9814
- children: g
9846
+ children: Object.values(AppGroup).map((g) => {
9847
+ const appsForGroup = getAppsForGroup(g);
9848
+ if (appsForGroup.length === 0) {
9849
+ return null;
9815
9850
  }
9816
- ) }, g))
9851
+ return /* @__PURE__ */ jsx(MotionBox, { sx: { position: "relative" }, preset: "tabUnderline", children: /* @__PURE__ */ jsx(
9852
+ Typography,
9853
+ {
9854
+ onClick: () => setTab(g),
9855
+ sx: {
9856
+ cursor: "pointer",
9857
+ color: tab === g ? theme.palette.common.white : theme.palette.grey[300]
9858
+ },
9859
+ children: g
9860
+ }
9861
+ ) }, g);
9862
+ })
9817
9863
  }
9818
9864
  ),
9819
9865
  /* @__PURE__ */ jsx(MotionBox, { preset: "tabContent", children: /* @__PURE__ */ jsx(
9820
9866
  AppGrid,
9821
9867
  {
9822
- apps: Object.keys(APP_OBJ).filter((key) => {
9823
- const e = APP_OBJ[key];
9824
- const isBlacklisted = !!blacklist?.includes(key);
9825
- const isInSelectedGroup = tab === AppGroup.ALL ? true : e.group === tab;
9826
- return !isBlacklisted && isInSelectedGroup;
9827
- }).map((key) => APP_OBJ[key]),
9868
+ apps: appsForCurrentTab,
9828
9869
  iconSize: 80,
9829
9870
  iconRadius: 7,
9830
9871
  gap: PADDING_GAP_TAB,
@@ -9842,6 +9883,7 @@ export {
9842
9883
  APP_GROUP_COLOR,
9843
9884
  APP_OBJ,
9844
9885
  AppGrid,
9886
+ AppGridItem,
9845
9887
  AppGroup,
9846
9888
  AppType,
9847
9889
  AppsSidebar,