@digital-ai/dot-components 2.5.1 → 2.5.3

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/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
1
+ import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import { useState, useEffect, useRef, useMemo, useContext, createContext, forwardRef, useCallback, Fragment as Fragment$1, createElement } from 'react';
4
- import { Tooltip, Icon, Typography, Accordion, AccordionSummary, AccordionDetails, AccordionActions, InputAdornment, InputLabel, TextField, Toolbar, Alert, Fade, Avatar, Button, darken, IconButton, Link, Drawer, List, ListItem, CircularProgress, Popper, MenuList, MenuItem, Paper, ClickAwayListener, ListItemIcon, Collapse, ListSubheader, Divider, ListItemText, Badge, useMediaQuery, Autocomplete, Chip, AvatarGroup, Breadcrumbs, ToggleButtonGroup, ToggleButton, Card, CardContent, CardHeader, FormControlLabel, Checkbox, FormControl, FormGroup, FormLabel, FormHelperText, Dialog, DialogContent, DialogActions, useTheme as useTheme$1, RadioGroup, Radio, Switch, Skeleton, Snackbar, ButtonGroup, TablePagination, TableContainer, TableCell, TableRow, TableBody, TableSortLabel, TableHead, Table, Tabs, Tab, LinearProgress } from '@mui/material';
3
+ import { useState, useEffect, useRef, useMemo, useContext, createContext, forwardRef, Fragment, useCallback, createElement } from 'react';
4
+ import { Tooltip, Icon, Typography, Accordion, AccordionSummary, AccordionDetails, AccordionActions, InputAdornment, InputLabel, TextField, Toolbar, Alert, Fade, Avatar, Button, darken, Link, List, ListItem, CircularProgress, Popper, MenuList, MenuItem, Paper, ClickAwayListener, Drawer, IconButton, ListItemIcon, Collapse, ListSubheader, Divider, ListItemText, Badge, useMediaQuery, Autocomplete, Chip, AvatarGroup, Breadcrumbs, ToggleButtonGroup, ToggleButton, Card, CardContent, CardHeader, FormControlLabel, Checkbox, FormControl, FormGroup, FormLabel, FormHelperText, Dialog, DialogContent, DialogActions, useTheme as useTheme$1, RadioGroup, Radio, Switch, Skeleton, Snackbar, ButtonGroup, TablePagination, TableContainer, TableCell, TableRow, TableBody, TableSortLabel, TableHead, Table, Tabs, Tab, LinearProgress } from '@mui/material';
5
5
  import '@digital-ai/dot-icons';
6
6
  import styled, { css, createGlobalStyle, ThemeProvider as ThemeProvider$1, keyframes } from 'styled-components';
7
7
  import { createTheme, ThemeProvider, alpha, useTheme } from '@mui/material/styles';
@@ -1396,7 +1396,7 @@ let applications = [{
1396
1396
  enabled: true,
1397
1397
  created_date: '2022-11-30T23:28:01.662721+00:00',
1398
1398
  modified_date: '2022-11-30T23:28:01.662721+00:00',
1399
- name: 'Agility',
1399
+ name: 'Agility 1',
1400
1400
  url: 'https://digital.ai/products/agility/',
1401
1401
  description: '',
1402
1402
  alternate_label: nullStr,
@@ -1411,7 +1411,7 @@ let applications = [{
1411
1411
  enabled: true,
1412
1412
  created_date: '2022-11-30T23:32:00.979159+00:00',
1413
1413
  modified_date: '2022-11-30T23:32:00.979159+00:00',
1414
- name: 'Contininuous Testing',
1414
+ name: 'Continuous Testing 1',
1415
1415
  url: 'https://digital.ai/products/continuous-testing/',
1416
1416
  description: '',
1417
1417
  alternate_label: nullStr,
@@ -1426,7 +1426,7 @@ let applications = [{
1426
1426
  enabled: true,
1427
1427
  created_date: '2022-12-30T23:32:00.979159+00:00',
1428
1428
  modified_date: '2022-12-30T23:32:00.979159+00:00',
1429
- name: 'Contininuous Testing 2',
1429
+ name: 'Continuous Testing 2',
1430
1430
  url: 'https://digital.ai/products/continuous-testing/',
1431
1431
  description: '',
1432
1432
  alternate_label: nullStr,
@@ -1772,694 +1772,604 @@ const DotButton = /*#__PURE__*/forwardRef(({
1772
1772
  }), void 0);
1773
1773
  });
1774
1774
 
1775
- const rootClassName$X = 'dot-icon-btn';
1776
- const StyledIconButton = styled(IconButton).withConfig({
1777
- displayName: "IconButtonstyles__StyledIconButton",
1778
- componentId: "eko0kb-0"
1779
- })(["", ""], () => css(["&.", "{font-size:inherit;padding:10px;.dot-icon.MuiIcon-fontSizeSmall{padding:1px;}&.MuiIconButton-sizeSmall{padding:3px;}&.ripple-disabled{&:hover,&:active,&:focus{background:", ";}}"], rootClassName$X, hoverGray));
1775
+ const rootClassName$X = 'dot-link';
1776
+ const StyledLink = styled(Link).withConfig({
1777
+ displayName: "Linkstyles__StyledLink",
1778
+ componentId: "sc-1lpmaww-0"
1779
+ })(["", ""], () => css(["&.", "{cursor:pointer;&:hover:not(.MuiLink-underlineHover){text-decoration:none;}}"], rootClassName$X));
1780
1780
 
1781
- const DotIconButton = ({
1781
+ const DotLink = ({
1782
1782
  ariaLabel,
1783
+ children,
1783
1784
  className,
1784
- color: _color = 'inherit',
1785
+ color: _color = 'primary',
1785
1786
  'data-testid': dataTestId,
1786
- disabled: _disabled = false,
1787
- disableRipple: _disableRipple = false,
1788
- iconId,
1789
- iconSize: _iconSize = 'small',
1787
+ href,
1790
1788
  onClick,
1789
+ onMouseEnter,
1790
+ onPointerDown,
1791
+ rel: _rel = 'noreferrer',
1792
+ tabIndex: _tabIndex = 0,
1793
+ target,
1791
1794
  tooltip,
1792
- size: _size = 'medium'
1795
+ underline
1793
1796
  }) => {
1794
- const rippleClassName = _disableRipple ? 'ripple-disabled' : '';
1795
- const rootClasses = useStylesWithRootClass(rootClassName$X, rippleClassName, className);
1797
+ const rootClasses = useStylesWithRootClass(rootClassName$X, className);
1798
+ const handleKeyPress = event => {
1799
+ if (onClick && event.key === 'Enter') {
1800
+ event.preventDefault();
1801
+ onClick(event);
1802
+ }
1803
+ };
1796
1804
  return jsx(DotTooltip, Object.assign({
1797
- "data-testid": "icon-button-tooltip",
1798
1805
  title: tooltip
1799
1806
  }, {
1800
- children: jsx(StyledIconButton, Object.assign({
1807
+ children: jsx(StyledLink, Object.assign({
1801
1808
  "aria-label": ariaLabel,
1802
1809
  classes: {
1803
1810
  root: rootClasses
1804
1811
  },
1805
1812
  color: _color,
1806
1813
  "data-testid": dataTestId,
1807
- disableRipple: _disableRipple,
1808
- disabled: _disabled,
1809
- onClick: event => onClick && onClick(event),
1810
- size: _size
1814
+ href: href,
1815
+ onClick: onClick,
1816
+ onKeyPress: handleKeyPress,
1817
+ onMouseEnter: onMouseEnter,
1818
+ onPointerDown: onPointerDown,
1819
+ rel: _rel,
1820
+ tabIndex: _tabIndex,
1821
+ target: target,
1822
+ underline: underline
1811
1823
  }, {
1812
- children: jsx(DotIcon, {
1813
- "data-testid": "button-icon",
1814
- fontSize: _iconSize,
1815
- iconId: iconId
1816
- }, void 0)
1824
+ children: children
1817
1825
  }), void 0)
1818
1826
  }), void 0);
1819
1827
  };
1820
1828
 
1821
- const DotInputLabel = ({
1822
- 'data-testid': dataTestId,
1823
- disabled: _disabled = false,
1824
- error: _error = false,
1825
- id,
1826
- label,
1827
- required
1828
- }) => {
1829
- return jsx(StyledInputLabel, Object.assign({
1830
- "data-testid": dataTestId,
1831
- classes: {
1832
- root: labelClassName
1833
- },
1834
- disabled: _disabled,
1835
- error: _error,
1836
- htmlFor: id,
1837
- required: required,
1838
- shrink: false,
1839
- variant: "outlined"
1840
- }, {
1841
- children: jsx(DotTypography, Object.assign({
1842
- variant: "subtitle2"
1843
- }, {
1844
- children: label
1845
- }), void 0)
1846
- }), void 0);
1847
- };
1829
+ const rootClassName$W = 'dot-list';
1830
+ const listItemRootClass = 'dot-list-item';
1831
+ const nestedListClassName = 'dot-nested-list';
1832
+ const nestedDrawerClassName = 'dot-nested-drawer';
1833
+ const StyledList = styled(List).withConfig({
1834
+ displayName: "Liststyles__StyledList",
1835
+ componentId: "wxwqwr-0"
1836
+ })(["", ""], ({
1837
+ theme
1838
+ }) => css(["&.", "{background:", ";.dot-icon{color:", ";}&.", " .", "{padding-left:", ";}.MuiListSubheader-root{padding:0;.MuiTypography-root{padding:", ";}}}"], rootClassName$W, theme.palette.layer.n0, theme.palette.layer.n700, nestedListClassName, listItemRootClass, theme.spacing(4), theme.spacing(1)));
1848
1839
 
1849
- const DELAY_MS = 300;
1850
- const EndAdornment = ({
1851
- endAdornmentTooltip,
1852
- error,
1853
- dataTestId,
1854
- endIcon,
1855
- success,
1856
- warning
1857
- }) => {
1858
- const renderIcon = iconType => jsx(DotIcon, {
1859
- "data-testid": dataTestId && `${dataTestId}-${iconType}-icon`,
1860
- iconId: `${iconType}-solid`
1861
- }, void 0);
1862
- const errorIcon = error && renderIcon('error');
1863
- const successIcon = success && renderIcon('check');
1864
- const warningIcon = warning && renderIcon('warning');
1865
- const endAdornmentIcon = endIcon || errorIcon || warningIcon || successIcon;
1866
- const styledAdornment = jsx(StyledAdornment, Object.assign({
1867
- className: `${adornmentIconClassName} end`,
1868
- position: "end"
1869
- }, {
1870
- children: endAdornmentIcon
1871
- }), void 0);
1872
- return endAdornmentTooltip ? jsx(DotTooltip, Object.assign({
1873
- title: endAdornmentTooltip
1874
- }, {
1875
- children: styledAdornment
1876
- }), void 0) : styledAdornment;
1840
+ const getChevronIcon = (nestedListType, isOpened) => {
1841
+ if (nestedListType !== 'expandable') {
1842
+ return 'chevron-right';
1843
+ }
1844
+ if (isOpened) {
1845
+ return 'chevron-up';
1846
+ }
1847
+ return 'chevron-down';
1877
1848
  };
1878
- const getInitialState = value => ({
1879
- inputValue: value || ''
1880
- });
1881
- const DotInputText = ({
1882
- autoComplete: _autoComplete = 'off',
1883
- autoFocus,
1849
+
1850
+ const flyoutListItemClassName = 'dot-flyout-list-item';
1851
+ const flyoutItemLinkClassName = 'dot-flyout-item-link';
1852
+ const listItemLinkClassName = 'dot-list-item-link';
1853
+ const StyledListItem = styled(ListItem).withConfig({
1854
+ displayName: "ListItemstyles__StyledListItem",
1855
+ componentId: "sc-1fawh8v-0"
1856
+ })(["", ""], ({
1857
+ theme
1858
+ }) => css(["&.", "{&.", "{padding:0;}p.MuiTypography-root{margin-bottom:0;}.", "{align-items:center;display:flex;flex-grow:2;}.", " .MuiIcon-root{margin-right:", ";}.dot-icon i:before{color:", ";}}"], listItemRootClass, flyoutListItemClassName, listItemLinkClassName, flyoutItemLinkClassName, theme.spacing(4), theme.palette.text.primary));
1859
+
1860
+ const rootClassName$V = 'dot-progress';
1861
+ const StyledCircularProgress = styled(CircularProgress).withConfig({
1862
+ displayName: "Progressstyles__StyledCircularProgress",
1863
+ componentId: "sc-1gs77rb-0"
1864
+ })(["&.", "{&.MuiCircularProgress-colorSecondary{color:#649a3d;}}"], rootClassName$V);
1865
+
1866
+ const DotProgress = ({
1867
+ ariaLabel,
1868
+ color: _color = 'secondary',
1884
1869
  className,
1885
- defaultValue,
1886
1870
  'data-testid': dataTestId,
1887
- disabled: _disabled = false,
1888
- error: _error = false,
1889
- endAdornmentTooltip,
1890
- fullWidth: _fullWidth = true,
1891
- hasDebounce,
1892
- helperText,
1893
- endIcon,
1894
- id,
1895
- inputRef,
1896
- label,
1897
- maxRows,
1898
- minRows,
1899
- multiline: _multiline = false,
1900
- name,
1901
- onBlur,
1902
- onChange,
1903
- onFocus,
1904
- onKeyDown,
1905
- onMouseUp,
1906
- persistentLabel,
1907
- placeholder,
1908
- readOnly: _readOnly = false,
1909
- required: _required = false,
1910
- shrink,
1911
- startIcon,
1912
- size: _size = 'small',
1913
- success,
1914
- type: _type = 'text',
1871
+ size: _size = 40,
1872
+ thickness: _thickness = 3.6,
1873
+ tooltip: _tooltip = 'loading data',
1915
1874
  value,
1916
- warning: _warning = false
1875
+ variant: _variant = 'indeterminate'
1917
1876
  }) => {
1918
- const hasError = _error && errorClassName;
1919
- const hasWarning = !_error && _warning && warningClassName;
1920
- const hasSuccess = !_error && !_warning && success && successClassName;
1921
- const hasEndAdornmentIcon = endIcon || _error || hasWarning || hasSuccess;
1922
- // This state is used only with debounce feature enabled
1923
- const [inputTextState, setInputTextState] = useState(hasDebounce && getInitialState(value));
1924
- const rootStyles = useStylesWithRootClass(rootClassName$10, hasError, hasWarning, hasSuccess, _readOnly ? 'read-only' : '');
1925
- // Used to control text value from the consumer component
1926
- // when debounce feature is enabled
1927
- useEffect(() => {
1928
- if (hasDebounce && value !== inputTextState.inputValue) {
1929
- setInputTextState(getInitialState(value));
1930
- }
1931
- }, [value]);
1932
- // Improve performance by avoiding callback execution
1933
- // on each keystroke (if debounce feature is active)
1934
- useEffect(() => {
1935
- // Do not proceed if debounce feature is turned
1936
- // off or there is no event defined
1937
- if (!hasDebounce || !inputTextState || !inputTextState.changeEvent || !onChange) return;
1938
- const handler = setTimeout(() => {
1939
- onChange(inputTextState.changeEvent);
1940
- }, DELAY_MS);
1941
- return () => clearTimeout(handler);
1942
- }, [inputTextState]);
1943
- const handleChange = e => {
1944
- // We need to have control over change event and input value separately
1945
- // so that we can set initial state via 'value' prop (if needed)
1946
- hasDebounce ? setInputTextState({
1947
- changeEvent: e,
1948
- inputValue: e.target.value
1949
- }) : onChange === null || onChange === void 0 ? void 0 : onChange(e);
1950
- };
1951
- const inputTextValue = hasDebounce ? inputTextState.inputValue : value;
1952
- // Don't use default value when debounce feature is enabled because
1953
- // in that case component is controlled
1954
- const defaultInputValue = hasDebounce ? undefined : defaultValue;
1955
- const startAdornmentIcon = () => {
1956
- if (!startIcon) return null;
1957
- return jsx(StyledAdornment, Object.assign({
1958
- className: `${adornmentIconClassName} start`,
1959
- position: "start"
1960
- }, {
1961
- children: startIcon
1962
- }), void 0);
1963
- };
1964
- const endAdornmentIcon = () => {
1965
- if (!hasEndAdornmentIcon) return null;
1966
- return jsx(EndAdornment, Object.assign({}, {
1967
- endAdornmentTooltip,
1968
- error: _error,
1969
- dataTestId,
1970
- endIcon,
1971
- success,
1972
- warning: _warning
1973
- }), void 0);
1974
- };
1975
- const wrapperClassName = useStylesWithRootClass(_fullWidth !== false ? 'dot-input-text--fullwidth' : '', className);
1976
- return jsxs(StyledTextFieldContainer, Object.assign({
1977
- className: wrapperClassName
1877
+ const rootClasses = useStylesWithRootClass(rootClassName$V, className);
1878
+ return jsx(DotTooltip, Object.assign({
1879
+ title: _tooltip
1978
1880
  }, {
1979
- children: [persistentLabel && jsx(DotInputLabel, Object.assign({}, {
1980
- disabled: _disabled,
1981
- error: _error,
1982
- id,
1983
- label,
1984
- required: _required
1985
- }), void 0), jsx(StyledTextField, {
1986
- InputProps: {
1987
- startAdornment: startAdornmentIcon(),
1988
- endAdornment: endAdornmentIcon()
1881
+ children: jsx(StyledCircularProgress, {
1882
+ "aria-label": ariaLabel,
1883
+ classes: {
1884
+ root: rootClasses
1989
1885
  },
1990
- "aria-label": name,
1991
- autoComplete: _autoComplete,
1992
- autoFocus: autoFocus,
1993
- classes: {
1994
- root: rootStyles
1995
- },
1996
- defaultValue: defaultInputValue,
1997
- disabled: _disabled,
1998
- error: _error,
1999
- focused: _readOnly ? false : undefined,
2000
- fullWidth: _fullWidth,
2001
- helperText: helperText,
2002
- id: id,
2003
- InputLabelProps: {
2004
- shrink: _type === 'date' ? true : shrink
2005
- },
2006
- inputProps: {
2007
- 'data-testid': dataTestId,
2008
- className: 'dot-input',
2009
- readOnly: _readOnly
2010
- },
2011
- inputRef: inputRef,
2012
- label: persistentLabel ? null : label,
2013
- multiline: _multiline,
2014
- name: name,
2015
- onBlur: onBlur,
2016
- onChange: hasDebounce ? handleChange : onChange,
2017
- onFocus: onFocus,
2018
- onKeyDown: onKeyDown,
2019
- onMouseUp: onMouseUp,
2020
- placeholder: placeholder,
2021
- required: _required,
2022
- minRows: _multiline ? minRows : null,
2023
- maxRows: _multiline ? maxRows : null,
1886
+ color: _color,
1887
+ "data-testid": dataTestId,
2024
1888
  size: _size,
2025
- type: _type,
2026
- value: inputTextValue,
2027
- variant: "outlined"
2028
- }, void 0)]
1889
+ thickness: _thickness,
1890
+ value: value,
1891
+ variant: _variant
1892
+ }, void 0)
2029
1893
  }), void 0);
2030
1894
  };
2031
1895
 
2032
- const rootClassName$W = 'dot-search-input';
2033
- const StyledSearchInput = styled.span.withConfig({
2034
- displayName: "SearchInputstyles__StyledSearchInput",
2035
- componentId: "qlwzku-0"
2036
- })(["", ""], () => css(["&.", "{}"], rootClassName$W));
1896
+ const levelBottom = -1;
1897
+ const levelFirst = 1;
1898
+ const levelSecond = 10;
1899
+ const levelThird = 100;
1900
+ const levelFourth = 1000;
1901
+ const levelTop = 9999;
2037
1902
 
2038
- function SearchInput({
2039
- 'data-testid': dataTestId,
2040
- autoFocus = true,
2041
- className,
2042
- disabled = false,
2043
- onChange,
2044
- onClear,
2045
- placeholder = 'Search',
2046
- tooltip = null,
2047
- value
2048
- }) {
2049
- const rootClasses = useStylesWithRootClass(rootClassName$W, className);
2050
- const [searchText, setSearchText] = useState(value);
2051
- let previousSearchText = '';
2052
- const handleChange = useCallback(event => {
2053
- previousSearchText = event.target.value;
2054
- setSearchText(event.target.value);
2055
- // Timeout is to give user a chance to finish typing before refreshing data.
2056
- setTimeout(function () {
2057
- if (onChange && event.target.value === previousSearchText) {
2058
- onChange(event.target.value);
2059
- }
2060
- }, 500);
2061
- }, [onChange]);
2062
- const handleClear = useCallback(() => {
2063
- setSearchText('');
2064
- onClear && onClear();
2065
- }, [onClear]);
2066
- const searchIcon = jsx(DotIcon, {
2067
- className: "search-icon",
2068
- iconId: "search"
2069
- }, void 0);
2070
- const clearSearchIcon = jsx(DotIconButton, {
2071
- iconId: "close",
2072
- onClick: handleClear,
2073
- size: "small",
2074
- tooltip: "Clear search text"
2075
- }, void 0);
2076
- return jsx(StyledSearchInput, Object.assign({
2077
- className: rootClasses
2078
- }, {
2079
- children: jsx(DotTooltip, Object.assign({
2080
- placement: "bottom",
2081
- title: tooltip
2082
- }, {
2083
- children: jsx(DotInputText, {
2084
- "data-testid": dataTestId,
2085
- autoFocus: autoFocus,
2086
- className: "search-text",
2087
- disabled: disabled,
2088
- endIcon: (searchText === null || searchText === void 0 ? void 0 : searchText.length) > 0 ? clearSearchIcon : null,
2089
- id: "app-instance-search-text",
2090
- name: "app-instance-search-text",
2091
- onChange: handleChange,
2092
- placeholder: placeholder,
2093
- startIcon: searchIcon,
2094
- value: searchText
2095
- }, void 0)
2096
- }), void 0)
2097
- }), void 0);
2098
- }
1903
+ var variables = /*#__PURE__*/Object.freeze({
1904
+ __proto__: null,
1905
+ levelBottom: levelBottom,
1906
+ levelFirst: levelFirst,
1907
+ levelSecond: levelSecond,
1908
+ levelThird: levelThird,
1909
+ levelFourth: levelFourth,
1910
+ levelTop: levelTop
1911
+ });
2099
1912
 
2100
- const rootClassName$V = 'dot-copy-button';
2101
- const StyledCopyButton = styled.span.withConfig({
2102
- displayName: "CopyButtonstyles__StyledCopyButton",
2103
- componentId: "sc-18ff0u-0"
1913
+ const rootClassName$U = 'dot-popper';
1914
+ const StyledPopper$1 = styled(Popper).withConfig({
1915
+ displayName: "Popperstyles__StyledPopper",
1916
+ componentId: "sd1h8p-0"
2104
1917
  })(["", ""], ({
2105
1918
  theme
2106
- }) => css(["&.", "{.copied-to-clipboard{color:", ";}}"], rootClassName$V, theme.palette.success[400]));
1919
+ }) => css(["&.", "{font-family:", ";font-size:", "px;}"], rootClassName$U, theme.typography.fontFamily, theme.typography.body1.fontSize));
2107
1920
 
2108
- const DotCopyButton = ({
2109
- ariaLabel: _ariaLabel = 'Copy to clipboard',
2110
- copiedTooltip: _copiedTooltip = 'Copied!',
2111
- copyTooltip: _copyTooltip = 'Copy to clipboard',
2112
- 'data-testid': dataTestId = 'dot-copy-button',
2113
- value
2114
- }) => {
2115
- const [showCopiedIcon, setShowCopiedIcon] = useState(false);
2116
- const copyToClipboard = () => {
2117
- // The check for navigator.clipboard.writeText is because this function is
2118
- // only supported in secure contexts (https). This will always be the case in
2119
- // production but not when running locally.
2120
- if (!navigator.clipboard || !navigator.clipboard.writeText) {
2121
- console.warn('Copy to clipboard is only supported in secure context (https)', value);
2122
- } else {
2123
- navigator.clipboard.writeText(value);
2124
- }
2125
- };
2126
- const copy = () => {
2127
- copyToClipboard();
2128
- setShowCopiedIcon(true);
2129
- setTimeout(function () {
2130
- setShowCopiedIcon(false);
2131
- }, 3000);
2132
- return false;
2133
- };
2134
- return jsxs(StyledCopyButton, Object.assign({
2135
- className: rootClassName$V,
2136
- "data-testid": dataTestId
2137
- }, {
2138
- children: [!showCopiedIcon && jsx(DotIconButton, {
2139
- ariaLabel: _ariaLabel,
2140
- "data-testid": `${dataTestId}-button`,
2141
- iconId: "duplicate",
2142
- onClick: copy,
2143
- size: "small",
2144
- tooltip: _copyTooltip
2145
- }, void 0), showCopiedIcon && jsx(DotIcon, {
2146
- className: "copied-to-clipboard",
2147
- "data-testid": `${dataTestId}-icon`,
2148
- fontSize: "small",
2149
- iconId: "check-solid",
2150
- tooltip: _copiedTooltip
2151
- }, void 0)]
2152
- }), void 0);
2153
- };
2154
-
2155
- const rootClassName$U = 'dot-link';
2156
- const StyledLink = styled(Link).withConfig({
2157
- displayName: "Linkstyles__StyledLink",
2158
- componentId: "sc-1lpmaww-0"
2159
- })(["", ""], () => css(["&.", "{cursor:pointer;&:hover:not(.MuiLink-underlineHover){text-decoration:none;}}"], rootClassName$U));
2160
-
2161
- const DotLink = ({
2162
- ariaLabel,
2163
- children,
2164
- className,
2165
- color: _color = 'primary',
2166
- 'data-testid': dataTestId,
2167
- href,
2168
- onClick,
2169
- onMouseEnter,
2170
- rel: _rel = 'noreferrer',
2171
- tabIndex: _tabIndex = 0,
2172
- target,
2173
- tooltip,
2174
- underline
2175
- }) => {
2176
- const rootClasses = useStylesWithRootClass(rootClassName$U, className);
2177
- const handleKeyPress = event => {
2178
- if (onClick && event.key === 'Enter') {
2179
- event.preventDefault();
2180
- onClick(event);
2181
- }
2182
- };
2183
- return jsx(DotTooltip, Object.assign({
2184
- title: tooltip
2185
- }, {
2186
- children: jsx(StyledLink, Object.assign({
2187
- "aria-label": ariaLabel,
2188
- classes: {
2189
- root: rootClasses
2190
- },
2191
- color: _color,
2192
- "data-testid": dataTestId,
2193
- href: href,
2194
- onClick: onClick,
2195
- onKeyPress: handleKeyPress,
2196
- onMouseEnter: onMouseEnter,
2197
- rel: _rel,
2198
- tabIndex: _tabIndex,
2199
- target: target,
2200
- underline: underline
2201
- }, {
2202
- children: children
2203
- }), void 0)
2204
- }), void 0);
2205
- };
2206
-
2207
- var img$6 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23279FEA'/%3e%3cpath d='M12.4332 16.3533V14.8333H11.5665V16.3533L10.7432 15.8933L9.85651 16.4033L11.9998 17.6366L14.1932 16.3733L13.3332 15.8766L12.4332 16.3533Z' fill='white'/%3e%3cpath d='M7.99328 10.1866L9.24661 10.9132L9.67995 10.1399L8.36995 9.4299L9.09328 9.01657V8.03323L7.11328 9.18323L7.11661 11.5532L7.99328 11.0566V10.1866Z' fill='white'/%3e%3cpath d='M14.6934 10.9133L15.9934 10.1733L15.99 11.0566L16.8867 11.5599V9.1766L14.81 7.98993L14.7767 8.9566L15.6167 9.45326L14.29 10.0799L14.6934 10.9133Z' fill='white'/%3e%3cpath d='M16.8801 12.5435L16.0001 12.0402V12.0935V13.7068L12.4167 11.6868V7.61015L13.9667 8.49015V7.51682L12.0001 6.35349L9.95006 7.52348V8.52348L11.4967 7.63015V11.6868L8.00006 13.8168V12.0202L7.12006 12.5235V14.8202L8.96672 15.8502L9.86672 15.3335L8.40006 14.5268L12.0001 12.4368L15.5567 14.5035L14.1301 15.3268L15.0567 15.8701L16.8701 14.8268L16.8801 12.5435Z' fill='white'/%3e%3c/svg%3e";
2208
-
2209
- var img$5 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23279FEA'/%3e%3cpath d='M14.1867 11.2667L12.1634 10.0833L10.1367 11.2667V13.62L12.1634 14.7867L14.1867 13.62V11.2667Z' fill='white'/%3e%3cpath d='M8.43666 12.0001L7.47333 11.1501V15.1667L10.41 16.8367V15.7034L8.43666 14.5401V12.0001Z' fill='white'/%3e%3cpath d='M15.8965 12V14.5833L13.9632 15.7033V16.9367L16.8532 15.1533V11.0967L15.8965 12Z' fill='white'/%3e%3cpath d='M12.1565 8.13333L14.7165 9.61333L15.4165 8.89L12.1565 7L8.87988 8.90667L9.57988 9.63333L12.1565 8.13333Z' fill='white'/%3e%3c/svg%3e";
2210
-
2211
- var img$4 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%2333D389'/%3e%3cpath d='M17.0033 7.62322H16.4567C16.3925 7.62863 16.3324 7.65679 16.2871 7.70264C16.2419 7.74848 16.2146 7.80898 16.21 7.87322V9.14322C15.7432 8.43248 15.1064 7.84955 14.3572 7.44732C13.6081 7.04509 12.7703 6.8363 11.92 6.83989C11.0845 6.84475 10.2627 7.05243 9.52515 7.44508C8.78763 7.83772 8.15649 8.40359 7.68598 9.09405C7.21547 9.7845 6.91966 10.5789 6.82398 11.4089C6.72831 12.2389 6.83562 13.0798 7.13669 13.8592C7.43777 14.6386 7.92361 15.3332 8.55245 15.8834C9.18128 16.4335 9.93431 16.8227 10.7468 17.0176C11.5593 17.2124 12.4069 17.207 13.2169 17.0019C14.0269 16.7967 14.7749 16.398 15.3967 15.8399C15.4257 15.8182 15.4492 15.79 15.4654 15.7576C15.4816 15.7252 15.49 15.6894 15.49 15.6532C15.49 15.617 15.4816 15.5813 15.4654 15.5489C15.4492 15.5165 15.4257 15.4883 15.3967 15.4666L14.9833 15.0532C14.9369 15.0135 14.8778 14.9917 14.8167 14.9917C14.7556 14.9917 14.6965 15.0135 14.65 15.0532C13.9076 15.7352 12.9312 16.1052 11.9233 16.0866C11.1892 16.087 10.4684 15.8897 9.83687 15.5154C9.20531 15.141 8.68627 14.6034 8.33429 13.9591C7.98231 13.3148 7.81039 12.5876 7.83662 11.8539C7.86284 11.1202 8.08624 10.4071 8.48332 9.78959C8.8804 9.17207 9.4365 8.67292 10.0932 8.34461C10.7499 8.0163 11.4828 7.87095 12.2151 7.92384C12.9474 7.97674 13.6519 8.22592 14.2545 8.6452C14.8572 9.06448 15.3358 9.63837 15.64 10.3066H14.1467C14.0828 10.3112 14.0227 10.3387 13.9774 10.384C13.9321 10.4293 13.9046 10.4893 13.9 10.5532V11.0466C13.9046 11.1104 13.9321 11.1705 13.9774 11.2158C14.0227 11.2611 14.0828 11.2886 14.1467 11.2932H17C17.0639 11.2886 17.124 11.2611 17.1693 11.2158C17.2146 11.1705 17.242 11.1104 17.2467 11.0466V7.87322C17.2422 7.8095 17.2154 7.74942 17.1708 7.70364C17.1263 7.65787 17.0669 7.62938 17.0033 7.62322Z' fill='white'/%3e%3cpath d='M12.1232 9.39987C12.1667 9.39747 12.2077 9.37914 12.2384 9.34839C12.2692 9.31764 12.2875 9.27662 12.2899 9.2332C12.2899 9.2332 12.3399 8.8332 12.3399 8.69987C12.3399 8.56653 12.2499 8.4932 12.1666 8.48987C11.5045 8.45232 10.8457 8.60791 10.2703 8.93771C9.69497 9.26752 9.22779 9.75734 8.92557 10.3477C8.62335 10.938 8.4991 11.6034 8.56792 12.263C8.63675 12.9226 8.89568 13.548 9.31325 14.0632C9.83849 14.7239 10.5905 15.1658 11.4232 15.3032C11.5166 15.3032 11.5999 15.2632 11.6299 15.1365C11.6299 15.1365 11.6999 14.8032 11.7132 14.6832C11.7233 14.639 11.7157 14.5927 11.692 14.554C11.6684 14.5154 11.6305 14.4876 11.5866 14.4765C11.225 14.4227 10.8806 14.2869 10.5795 14.0795C10.2785 13.8721 10.029 13.5986 9.84992 13.2799C9.64046 12.9274 9.51393 12.5318 9.47992 12.1232C9.44986 11.7648 9.49697 11.4042 9.61806 11.0655C9.73915 10.7269 9.93142 10.4181 10.1819 10.1601C10.4324 9.90199 10.7353 9.70061 11.0702 9.56947C11.405 9.43834 11.7641 9.38051 12.1232 9.39987Z' fill='white'/%3e%3cpath d='M13.9433 13.1568C13.96 13.1389 13.9724 13.1175 13.9796 13.0942C13.9868 13.0708 13.9885 13.0461 13.9846 13.0219C13.9808 12.9978 13.9714 12.9749 13.9573 12.9549C13.9432 12.9349 13.9247 12.9185 13.9033 12.9068L13.6133 12.7001C13.5739 12.6762 13.5272 12.6674 13.4818 12.6754C13.4364 12.6833 13.3955 12.7075 13.3666 12.7434C13.2321 12.9033 13.0642 13.0318 12.8747 13.12C12.6853 13.2082 12.4789 13.2538 12.2699 13.2538C12.061 13.2538 11.8546 13.2082 11.6651 13.12C11.4757 13.0318 11.3078 12.9033 11.1733 12.7434C11.1277 12.6913 11.0864 12.6356 11.0499 12.5768C10.9268 12.3776 10.8582 12.1495 10.8512 11.9155C10.8442 11.6814 10.8989 11.4496 11.0099 11.2434C11.0314 11.2102 11.0389 11.1699 11.0308 11.1312C11.0227 11.0925 10.9996 11.0585 10.9666 11.0368L10.6333 10.7901C10.5891 10.7715 10.5396 10.7697 10.4942 10.7851C10.4487 10.8004 10.4105 10.8319 10.3866 10.8734C10.2376 11.1465 10.153 11.45 10.1391 11.7608C10.1253 12.0716 10.1825 12.3815 10.3066 12.6668C10.4127 12.938 10.5831 13.1794 10.8033 13.3701C11.1902 13.7461 11.7104 13.9534 12.2499 13.9468C12.5743 13.9565 12.8964 13.8902 13.1905 13.753C13.4845 13.6158 13.7424 13.4116 13.9433 13.1568Z' fill='white'/%3e%3c/svg%3e";
2212
-
2213
- var img$3 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23279FEA'/%3e%3cpath d='M17.6865 10.0334C17.3062 9.49067 16.7772 9.06934 16.1632 8.82008C15.6426 8.61932 15.0801 8.55138 14.5267 8.62237C13.9733 8.69337 13.4462 8.90108 12.9932 9.22674C12.4991 9.62868 12.0519 10.0849 11.6598 10.5867L11.4232 10.8534L13.0198 11.5434L13.1498 11.4067C13.4002 11.1158 13.6697 10.8419 13.9565 10.5867C14.1891 10.4177 14.4599 10.3085 14.7448 10.269C15.0297 10.2294 15.3199 10.2607 15.5898 10.3601C15.916 10.4798 16.1929 10.7051 16.3765 11.0001C16.5305 11.2108 16.6383 11.4516 16.6932 11.7067C16.7448 11.9619 16.7448 12.2249 16.6932 12.4801C16.6319 12.8145 16.4783 13.125 16.2498 13.3767C16.0471 13.5809 15.7972 13.7319 15.5221 13.8162C15.2471 13.9005 14.9554 13.9156 14.6732 13.8601C14.318 13.7558 13.9714 13.6243 13.6365 13.4667L13.4598 13.3967L12.3032 14.6934L12.6365 14.8367C13.196 15.1144 13.7809 15.3376 14.3832 15.5034C14.841 15.5831 15.3102 15.5706 15.7632 15.4667C16.4116 15.3301 17.0012 14.9945 17.4498 14.5067C17.907 14.0252 18.2099 13.4182 18.3198 12.7634C18.4116 12.2979 18.4116 11.8189 18.3198 11.3534C18.186 10.8803 17.9717 10.4338 17.6865 10.0334Z' fill='white'/%3e%3cpath d='M12.8401 13.0499L11.2468 12.3599L11.1168 12.4966C10.8669 12.7942 10.5962 13.0738 10.3068 13.3332C10.0741 13.5023 9.80337 13.6115 9.51849 13.651C9.2336 13.6905 8.94336 13.6593 8.67345 13.5599C8.35219 13.4397 8.07852 13.2187 7.89345 12.9299C7.74251 12.7191 7.63591 12.4798 7.58012 12.2266C7.51653 11.9342 7.52262 11.6311 7.5979 11.3415C7.67318 11.052 7.81553 10.7842 8.01345 10.5599C8.2156 10.3551 8.46564 10.2039 8.74095 10.1201C9.01626 10.0363 9.30813 10.0225 9.59012 10.0799C9.94807 10.1781 10.2971 10.3063 10.6335 10.4632L10.8101 10.5299L11.9668 9.23324L11.6735 9.11324C11.1141 8.8326 10.5278 8.60924 9.92345 8.44657C9.37154 8.32869 8.79848 8.35611 8.26035 8.52614C7.72222 8.69617 7.23744 9.00299 6.85345 9.41657C6.38782 9.89208 6.08347 10.5019 5.98345 11.1599C5.88532 11.6248 5.88532 12.105 5.98345 12.5699C6.08588 13.0347 6.28211 13.4736 6.56012 13.8599C6.92983 14.4125 7.46217 14.8365 8.08345 15.0732C8.69864 15.3134 9.37049 15.369 10.0168 15.2332C10.4725 15.1299 10.9023 14.9348 11.2801 14.6599C11.7741 14.258 12.2214 13.8018 12.6135 13.2999L12.8401 13.0499Z' fill='white'/%3e%3c/svg%3e";
2214
-
2215
- var img$2 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23F7B731'/%3e%3cpath d='M17.0168 10.4836C16.8598 10.4819 16.704 10.5111 16.5583 10.5697C16.4126 10.6282 16.2799 10.715 16.1679 10.8249C16.0558 10.9348 15.9665 11.0658 15.9051 11.2103C15.8437 11.3548 15.8114 11.51 15.8101 11.667C15.8125 11.8887 15.8759 12.1056 15.9934 12.2936L15.3268 13.0036C15.1062 12.8766 14.8516 12.8214 14.5982 12.8459C14.3449 12.8704 14.1055 12.9733 13.9134 13.1403L13.2168 12.667C13.3204 12.3753 13.3514 12.0627 13.307 11.7564C13.2626 11.45 13.1441 11.1591 12.9619 10.9089C12.7796 10.6587 12.5391 10.4567 12.2611 10.3204C11.9832 10.1842 11.6762 10.1178 11.3668 10.127C10.9257 10.1237 10.4963 10.268 10.1468 10.537L9.2801 9.74364C9.38078 9.56935 9.43368 9.37158 9.43343 9.1703C9.43084 9.01345 9.39725 8.85866 9.33461 8.71484C9.27197 8.57101 9.18151 8.44099 9.06844 8.33225C8.95537 8.22352 8.82191 8.13821 8.67575 8.08124C8.52958 8.02427 8.3736 7.99677 8.21677 8.0003C7.89915 8.00103 7.59426 8.12525 7.36658 8.34671C7.13891 8.56817 7.00628 8.86949 6.99677 9.18697C6.99848 9.34467 7.03153 9.50046 7.09399 9.64528C7.15645 9.7901 7.24707 9.92106 7.36059 10.0305C7.4741 10.14 7.60825 10.2259 7.75524 10.283C7.90222 10.3402 8.0591 10.3676 8.21677 10.3636C8.43906 10.3609 8.65657 10.2987 8.84677 10.1836L9.71343 10.977C9.49991 11.2949 9.3884 11.6704 9.39376 12.0533C9.39912 12.4363 9.5211 12.8085 9.74343 13.1203L9.07677 13.8303C8.87595 13.7162 8.64759 13.6597 8.41677 13.667C8.18607 13.6729 7.96224 13.7467 7.77327 13.8791C7.5843 14.0116 7.43859 14.1968 7.35437 14.4117C7.27015 14.6265 7.25115 14.8615 7.29975 15.087C7.34836 15.3126 7.46241 15.5189 7.62763 15.68C7.79286 15.8411 8.00192 15.9499 8.22867 15.9928C8.45542 16.0357 8.68978 16.0108 8.90244 15.9212C9.11509 15.8315 9.2966 15.6812 9.42425 15.4889C9.5519 15.2967 9.62002 15.0711 9.6201 14.8403C9.61839 14.6452 9.57041 14.4533 9.4801 14.2803L10.1468 13.5703C10.5613 13.8772 11.0792 14.0102 11.5902 13.9411C12.1013 13.872 12.5653 13.6062 12.8834 13.2003L13.5501 13.637C13.5048 13.7597 13.4811 13.8894 13.4801 14.0203C13.4963 14.3289 13.6304 14.6196 13.8546 14.8323C14.0788 15.045 14.376 15.1636 14.6851 15.1636C14.9942 15.1636 15.2914 15.045 15.5156 14.8323C15.7398 14.6196 15.8739 14.3289 15.8901 14.0203C15.8923 13.8081 15.8333 13.5998 15.7201 13.4203L16.3868 12.7103C16.5613 12.81 16.7591 12.8617 16.9601 12.8603C17.1212 12.8706 17.2827 12.8481 17.4348 12.794C17.5869 12.74 17.7264 12.6555 17.8448 12.5458C17.9633 12.4361 18.0581 12.3035 18.1237 12.156C18.1893 12.0085 18.2241 11.8492 18.2261 11.6878C18.2282 11.5264 18.1974 11.3662 18.1356 11.2171C18.0737 11.068 17.9822 10.933 17.8666 10.8203C17.751 10.7077 17.6137 10.6198 17.463 10.5619C17.3123 10.504 17.1514 10.4774 16.9901 10.4836H17.0168ZM11.3501 13.2436C11.1161 13.2377 10.8891 13.163 10.6973 13.0287C10.5056 12.8944 10.3578 12.7065 10.2723 12.4886C10.1868 12.2707 10.1675 12.0325 10.2167 11.8036C10.266 11.5748 10.3816 11.3656 10.5492 11.2021C10.7167 11.0387 10.9288 10.9283 11.1588 10.8848C11.3887 10.8412 11.6264 10.8665 11.8422 10.9574C12.0579 11.0483 12.242 11.2007 12.3714 11.3957C12.5009 11.5907 12.57 11.8196 12.5701 12.0536C12.5657 12.3719 12.4357 12.6756 12.2085 12.8985C11.9812 13.1214 11.6751 13.2454 11.3568 13.2436H11.3501Z' fill='white'/%3e%3c/svg%3e";
1921
+ const flyoutMenuClassName = 'dot-flyout-menu';
1922
+ const rootClassName$T = 'dot-menu';
1923
+ const getListMaxHeight = maxHeight => isString$1(maxHeight) ? maxHeight : `${maxHeight}px`;
1924
+ const StyledPopper = styled(Popper).withConfig({
1925
+ displayName: "Menustyles__StyledPopper",
1926
+ componentId: "sc-134fmqu-0"
1927
+ })(["", ""], ({
1928
+ theme
1929
+ }) => css(["&.", "{font-family:", ";font-size:", "px;z-index:", ";}&.", ",&.", "{&.loading .MuiPaper-root{align-items:center;display:flex;justify-content:center;min-height:200px;min-width:200px;}ul,.dot-action-item{.dot-action-item-text{white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;}}ul{box-sizing:content-box;min-width:112px;overflow:auto;", " .dot-li{min-height:auto;}}.dot-action-item{height:", ";border-top:1px solid ", ";line-height:inherit;button.dot-button{border-radius:", ";justify-content:flex-start;height:100%;margin:0;&:focus-visible{background-color:", ";}.MuiButton-label{gap:", ";.MuiButton-startIcon{margin-left:0;.dot-icon{flex-shrink:0;}}}}}}"], rootClassName$U, theme.typography.fontFamily, theme.typography.body1.fontSize, levelSecond, rootClassName$T, rootClassName$U, ({
1930
+ $maxHeight
1931
+ }) => $maxHeight !== undefined && `
1932
+ max-height: ${getListMaxHeight($maxHeight)};
1933
+ `, theme.spacing(7), theme.palette.grey[100], theme.spacing(0, 0, 0.5, 0.5), theme.palette.layer.n100, theme.spacing(3)));
2216
1934
 
2217
- var img$1 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23205AB7'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M16.0859 8.30868C16.4108 8.42839 16.6831 8.6593 16.8542 8.96074L16.8628 8.97583L16.8705 8.99134C17.0174 9.28464 17.0775 9.61353 17.0441 9.93936C17.0123 11.03 16.8132 12.1093 16.4535 13.1395L16.4528 13.1415C16.1368 14.0377 15.4456 15.1335 14.6589 16.0108C14.2622 16.4533 13.8228 16.8611 13.3705 17.1668C12.9284 17.4656 12.4155 17.7067 11.8835 17.7262L11.8597 17.7271L11.8358 17.7262C11.291 17.7072 10.7708 17.4701 10.3204 17.1682C9.86244 16.8612 9.42376 16.4516 9.03057 16.0079C8.24999 15.1271 7.57941 14.0321 7.26533 13.1415L7.2645 13.1391C6.90532 12.1083 6.70674 11.0285 6.67566 9.93751C6.64229 9.61177 6.70236 9.28297 6.84922 8.98974L6.85684 8.97453L6.86522 8.95974C7.03585 8.65846 7.30747 8.42744 7.63179 8.30728L11.3874 6.76891C11.4429 6.74689 11.4996 6.7281 11.5571 6.71254C11.7538 6.6514 11.9644 6.6514 12.161 6.71254C12.2186 6.7281 12.2753 6.74693 12.3307 6.76895L12.3374 6.77159L16.0859 8.30868ZM11.9735 7.35255C11.8994 7.32695 11.8188 7.32695 11.7447 7.35255C11.7069 7.36213 11.6698 7.37415 11.6335 7.38855L7.87245 8.92913C7.69157 8.99369 7.53996 9.12117 7.44531 9.28828C7.35196 9.47467 7.31578 9.6845 7.34132 9.89139C7.36791 10.9234 7.55437 11.9449 7.89404 12.9198C8.45396 14.5075 10.3737 17.008 11.8591 17.06C13.2749 17.008 15.2642 14.5075 15.8241 12.9198C16.1642 11.9455 16.3512 10.9245 16.3784 9.89299C16.404 9.6861 16.3678 9.47627 16.2745 9.28988C16.1794 9.12247 16.0272 8.99495 15.8457 8.93073L12.0847 7.38855C12.0484 7.37415 12.0113 7.36213 11.9735 7.35255Z' fill='white'/%3e%3cpath d='M11.8631 8.29559L8.22357 9.77059V10.8904L11.8631 9.33705L15.5025 10.8904V9.77059L11.8631 8.29559Z' fill='white'/%3e%3cpath d='M10.6184 15.718C10.7942 16.0092 11.3957 16.4678 11.8633 16.4774C12.3078 16.4678 12.9324 16.0092 13.108 15.718C13.2835 15.4268 10.4426 15.427 10.6184 15.718Z' fill='white'/%3e%3c/svg%3e";
1935
+ const MENU_ITEM_HEIGHT_NORMAL = 48;
1936
+ const MENU_ITEM_HEIGHT_DENSE = 36;
1937
+ const DEFAULT_MAX_VISIBLE_ITEMS = 7;
2218
1938
 
2219
- var img = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='-8 -8 40 40' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M19.7521 0.348161H20.3976V2.23694H20.7722L20.7752 0.351063H21.4208V0.00290065L19.7521 0V0.348161Z' fill='%232B2B2B'/%3e %3cpath d='M22.31 0.00290065H21.7223V2.23114H22.0785L22.0816 0.438104H22.0877L22.718 2.23404H22.9799L23.6224 0.441005H23.6285L23.6255 2.23404H23.997L24 0.00290065H23.4093L22.8642 1.58994H22.8551L22.31 0.00290065Z' fill='%232B2B2B'/%3e %3cpath d='M16.4863 0C15.3048 0 14.5435 0.713733 14.5435 1.81915L14.5374 8.1557C13.3194 6.89362 11.4893 6.20309 9.34245 6.20019C4.36976 6.19729 0.00609663 10.3636 6.37628e-06 15.1219C-0.00608387 19.8453 4.35149 23.9942 9.32114 24C11.5258 24.0029 13.5904 22.9207 14.6836 21.853C14.8968 23.0135 15.6306 23.6489 16.7726 23.6489C17.7165 23.6489 18.4017 22.9584 18.4047 22.0068L18.4291 1.82495C18.4291 0.734042 17.6496 0.00290135 16.4863 0ZM9.28764 20.0803C6.42218 20.0774 4.08961 17.852 4.09266 15.1161C4.0957 12.383 6.43131 10.1605 9.29677 10.1634C12.1622 10.1663 14.4948 12.3917 14.4918 15.1277C14.4887 17.8607 12.1531 20.0832 9.28764 20.0803Z' fill='%232B2B2B'/%3e %3cpath d='M9.29431 11.7998C7.3363 11.7998 5.74979 13.3143 5.74979 15.1799C5.74979 17.0455 7.3363 18.56 9.29431 18.56C11.2523 18.56 12.8419 17.0455 12.8419 15.1799C12.8419 13.3143 11.2523 11.7998 9.29431 11.7998Z' fill='%23517934'/%3e%3c/svg%3e";
1939
+ const rootClassName$S = 'dot-ul';
1940
+ const listItemClassName$1 = 'dot-li';
1941
+ const listItemWithSubmenuClassName = 'dot-li-with-submenu';
1942
+ const StyledMenuList = styled(MenuList).withConfig({
1943
+ displayName: "MenuListstyles__StyledMenuList",
1944
+ componentId: "yqdwwg-0"
1945
+ })(["", ""], ({
1946
+ theme
1947
+ }) => css(["&.", "{.dot-li{font-size:", "px;justify-content:space-between;gap:", ";&:hover{background:", ";}&.Mui-selected,&.Mui-selected:hover{background:", ";}&.", "{padding-right:", ";}}}"], rootClassName$S, theme.typography.body1.fontSize, theme.spacing(3), hoverGray, lightSelectedGray, listItemWithSubmenuClassName, theme.spacing(0.5)));
2220
1948
 
2221
- // Takes a appType name and returns its logo as a data url.
2222
- // If appType does not exist the Digital.ai logo is returned.
2223
- const getLogoForAppType = appType => {
2224
- switch (appType) {
2225
- case 'Release':
2226
- {
2227
- return img$6;
2228
- }
2229
- case 'Deploy':
2230
- {
2231
- return img$5;
2232
- }
2233
- case 'Agility':
2234
- {
2235
- return img$4;
2236
- }
2237
- case 'Continuous Testing':
2238
- {
2239
- return img$3;
2240
- }
2241
- case 'Intelligence':
2242
- {
2243
- return img$2;
2244
- }
2245
- case 'Application Protection':
2246
- {
2247
- return img$1;
2248
- }
2249
- default:
2250
- {
2251
- return img;
2252
- }
1949
+ const getDefaultItemHeight = isDense => isDense ? MENU_ITEM_HEIGHT_DENSE : MENU_ITEM_HEIGHT_NORMAL;
1950
+ const calculateItemHeight = (isDense, customItemHeight, menuItemHeight) => {
1951
+ // Custom item height must NOT be lower than MENU_ITEM_HEIGHT_DENSE value
1952
+ if (customItemHeight && customItemHeight >= MENU_ITEM_HEIGHT_DENSE) {
1953
+ return customItemHeight;
1954
+ }
1955
+ const itemHeightType = typeof menuItemHeight;
1956
+ if (itemHeightType === 'number' || itemHeightType === 'string') {
1957
+ return menuItemHeight;
1958
+ } else {
1959
+ return getDefaultItemHeight(isDense);
2253
1960
  }
2254
1961
  };
2255
- const daiAppsHeaderMenuItem = (count = 0) => ({
2256
- children: jsxs(DotTypography, Object.assign({
2257
- className: "dai-apps-title"
2258
- }, {
2259
- children: ["DIGITAL.AI APPLICATIONS", count > 0 ? ` (${count})` : '']
2260
- }), "menu-item-dai-apps-title"),
2261
- key: 'dai-apps-title',
2262
- disabled: true,
2263
- divider: true,
2264
- height: 32
2265
- });
2266
- const createMenuItem = (url, title, subtitle = null) => jsxs("div", Object.assign({
2267
- className: "app-menu-item"
2268
- }, {
2269
- children: [jsx(DotLink, Object.assign({
2270
- href: url,
2271
- color: "textPrimary",
2272
- target: "_blank"
2273
- }, {
2274
- children: jsxs("div", Object.assign({
2275
- className: "logo-title"
2276
- }, {
2277
- children: [jsx(DotIcon, {
2278
- iconId: "open-new-tab"
2279
- }, void 0), jsxs("div", Object.assign({
2280
- className: "dot-app-switcher-app-title"
2281
- }, {
2282
- children: [jsx(DotTypography, Object.assign({
2283
- variant: "body1"
2284
- }, {
2285
- children: title
2286
- }), void 0), subtitle && jsx(DotTypography, Object.assign({
2287
- variant: "body2"
2288
- }, {
2289
- children: subtitle
2290
- }), void 0)]
2291
- }), void 0)]
2292
- }), void 0)
2293
- }), void 0), jsx(DotCopyButton, {
2294
- copyTooltip: "Copy application URL",
2295
- value: url
2296
- }, void 0)]
2297
- }), `app-menu-item-${title}`);
2298
- const createTopLevelMenuItem = (url, logo, title, openNewTab = true) => {
2299
- // Creates an entry in the AppSwitcher at the same level as the AppTypeLabels, used for the Platform link and
2300
- // Empty state current application link
2301
- const target = openNewTab ? '_blank' : '_self';
2302
- return jsxs(DotLink, Object.assign({
2303
- href: url,
2304
- color: "textPrimary",
2305
- target: target
2306
- }, {
2307
- children: [jsxs("div", Object.assign({
2308
- className: "logo-title"
2309
- }, {
2310
- children: [jsx(DotAvatar, {
2311
- alt: "app image",
2312
- imageSrc: logo,
2313
- type: "image",
2314
- variant: "circular"
2315
- }, void 0), jsx("div", Object.assign({
2316
- className: "dot-app-switcher-app-title"
2317
- }, {
2318
- children: jsx(DotTypography, Object.assign({
2319
- variant: "body1"
2320
- }, {
2321
- children: title
2322
- }), void 0)
2323
- }), void 0)]
2324
- }), void 0), openNewTab && jsx(DotIcon, {
2325
- iconId: "open-new-tab"
2326
- }, void 0)]
2327
- }), `top-menu-item-${title}`);
2328
- };
2329
- const createAppTypeLabel = (appTypeName, logo, appProps) => {
2330
- const logoProps = logo ? {
2331
- imageSrc: logo
2332
- } : {
2333
- iconId: 'collection'
2334
- };
2335
- return jsxs("div", Object.assign({
2336
- className: "logo-title"
2337
- }, {
2338
- children: [jsx(DotAvatar, Object.assign({}, logoProps, {
2339
- alt: "app image",
2340
- type: "image",
2341
- variant: "circular"
2342
- }), void 0), jsxs("div", Object.assign({
2343
- className: "dot-app-switcher-app-title"
2344
- }, {
2345
- children: [jsx(DotTypography, Object.assign({
2346
- variant: "body1"
2347
- }, {
2348
- children: appTypeName
2349
- }), void 0), jsxs(DotTypography, Object.assign({
2350
- variant: "body2"
2351
- }, {
2352
- children: ["Instance (", appProps.length, ")"]
2353
- }), void 0)]
2354
- }), void 0)]
2355
- }), void 0);
1962
+ const getNumberOfVisibleItems = (numberOfItems, maxVisibleItems) => {
1963
+ if (maxVisibleItems && maxVisibleItems > 0) {
1964
+ return maxVisibleItems <= numberOfItems ? maxVisibleItems : numberOfItems;
1965
+ }
1966
+ return DEFAULT_MAX_VISIBLE_ITEMS;
2356
1967
  };
2357
- const getInstanceStateText = application => {
2358
- if (application.instance_state === 1) {
2359
- return 'Production instance';
1968
+ const calculateMaxHeight = ({
1969
+ isDense,
1970
+ maxVisibleItems,
1971
+ menuItems,
1972
+ menuItemHeight
1973
+ }) => {
1974
+ // if menuItemHeight is "auto" set maxHeight as same
1975
+ if (typeof menuItemHeight === 'string') {
1976
+ return menuItemHeight;
2360
1977
  }
2361
- return 'Non-production instance';
1978
+ // If 'menuItemHeight' is set it will take precedence here
1979
+ const itemHeight = menuItemHeight ? menuItemHeight : getDefaultItemHeight(isDense);
1980
+ let maxHeight = 0;
1981
+ const numberOfVisibleItems = getNumberOfVisibleItems(menuItems.length, maxVisibleItems);
1982
+ const visibleItems = menuItems.slice(0, numberOfVisibleItems);
1983
+ visibleItems.forEach(({
1984
+ height
1985
+ }) => {
1986
+ const customItemHeight = height ? height : itemHeight;
1987
+ // + 3 is for bottom margin of menuItem
1988
+ maxHeight += customItemHeight + 3;
1989
+ });
1990
+ return maxHeight;
2362
1991
  };
1992
+ const checkForSubItems = menuItems => menuItems.some(menuItem => menuItem.items && menuItems.length > 0);
1993
+ const checkIfSubmenu = anchorElement => {
1994
+ if (!anchorElement) return false;
1995
+ return anchorElement.classList.contains(listItemWithSubmenuClassName);
1996
+ };
1997
+ const checkIfMenuItemSelected = (key, selectedKey, activeSubmenu) => {
1998
+ return selectedKey === key || activeSubmenu === key;
1999
+ };
2000
+ const checkForAutoFocus = (autoFocusItem, isFirstItem) => !!(autoFocusItem && isFirstItem);
2363
2001
 
2364
- const rootClassName$T = 'dot-drawer';
2365
- const StyledDrawer = styled(Drawer).withConfig({
2366
- displayName: "Drawerstyles__StyledDrawer",
2367
- componentId: "sc-1uiowy0-0"
2368
- })(["", ""], ({
2369
- theme
2370
- }) => css(["&.", " .MuiBackdrop-root{background-color:", ";}.dot-drawer-paper{height:", ";padding:", ";width:", ";}"], rootClassName$T, alpha(theme.palette.grey[900], 0.7), ({
2371
- height,
2372
- anchor
2373
- }) => anchor === 'left' || anchor === 'right' ? '100%' : height, theme.spacing(2), ({
2374
- width,
2375
- anchor
2376
- }) => anchor === 'bottom' || anchor === 'top' ? 'auto' : width));
2377
-
2378
- const rootClassName$S = 'dot-drawer-header';
2379
- const StyleDrawerHeader = styled.div.withConfig({
2380
- displayName: "DrawerHeaderstyles__StyleDrawerHeader",
2381
- componentId: "sc-2d2xd3-0"
2382
- })(["", ""], ({
2383
- theme
2384
- }) => css(["&.", "{padding:", ";display:flex;align-items:center;.close-button{margin-left:auto;}}"], rootClassName$S, theme.spacing(0, 0, 2)));
2385
-
2386
- const DotDrawerHeader = ({
2387
- ariaLabel,
2388
- children,
2002
+ /**
2003
+ * Since this component is used inside 'ClickAwayListener',
2004
+ * it needs to be contained within 'forwardRef' function
2005
+ */
2006
+ const DotMenuList = /*#__PURE__*/forwardRef(({
2007
+ autoFocusItem,
2389
2008
  className,
2390
2009
  'data-testid': dataTestId,
2391
- onClose,
2392
- variant
2393
- }) => {
2010
+ dense,
2011
+ id,
2012
+ maxVisibleItems,
2013
+ menuItemHeight,
2014
+ menuItems,
2015
+ onItemSelect,
2016
+ onKeyDown,
2017
+ onSubMenuCreate,
2018
+ selectedKey
2019
+ }, ref) => {
2394
2020
  const rootClasses = useStylesWithRootClass(rootClassName$S, className);
2395
- return jsxs(StyleDrawerHeader, Object.assign({
2396
- "aria-label": ariaLabel,
2397
- className: rootClasses,
2398
- "data-testid": dataTestId
2021
+ const [activeSubmenu, setActiveSubmenu] = useState(null);
2022
+ const [subItemAnchorEl, setSubItemAnchorEl] = useState(null);
2023
+ const openSubmenu = (target, itemKey) => {
2024
+ // Set new anchor for submenu and active submenu key
2025
+ // so that new submenu can be opened
2026
+ setSubItemAnchorEl(target);
2027
+ setActiveSubmenu(itemKey);
2028
+ };
2029
+ const closeActiveSubmenu = () => {
2030
+ // We want to clean active submenu state if it exists.
2031
+ // This will make previous submenu disappear when
2032
+ // hovering to item with no submenu items
2033
+ activeSubmenu && setActiveSubmenu(null);
2034
+ };
2035
+ const getMouseEnterHandler = (itemKey, hasSubmenu) => event => {
2036
+ hasSubmenu ? openSubmenu(event.currentTarget, itemKey) : closeActiveSubmenu();
2037
+ };
2038
+ return jsx(StyledMenuList, Object.assign({
2039
+ classes: {
2040
+ root: rootClasses
2041
+ },
2042
+ "data-testid": dataTestId,
2043
+ dense: dense,
2044
+ id: id,
2045
+ onKeyDown: onKeyDown,
2046
+ style: {
2047
+ height: calculateMaxHeight({
2048
+ isDense: dense,
2049
+ maxVisibleItems,
2050
+ menuItems,
2051
+ menuItemHeight
2052
+ })
2053
+ }
2399
2054
  }, {
2400
- children: [children, variant !== 'permanent' && jsx(DotIconButton, {
2401
- className: "close-button",
2402
- iconId: "close",
2403
- onClick: onClose
2404
- }, void 0)]
2405
- }), void 0);
2406
- };
2407
-
2408
- const rootClassName$R = 'dot-drawer-body';
2409
- const StyleDrawerBody = styled.div.withConfig({
2410
- displayName: "DrawerBodystyles__StyleDrawerBody",
2411
- componentId: "sc-1mpmjdk-0"
2412
- })(["", ""], () => css(["&.", "{display:flex;.dot-drawer-close-button{align-self:self-start;padding:0;margin-left:auto;}}"], rootClassName$R));
2055
+ children: menuItems.map((item, index) => {
2056
+ const {
2057
+ ariaLabel: itemAriaLabel,
2058
+ children,
2059
+ classes,
2060
+ disabled,
2061
+ divider,
2062
+ height,
2063
+ items: subItems,
2064
+ key
2065
+ } = item;
2066
+ const itemHeight = calculateItemHeight(dense, height, menuItemHeight);
2067
+ const isSelected = checkIfMenuItemSelected(key, selectedKey, activeSubmenu);
2068
+ const isFirstItem = index === 0;
2069
+ const hasSubmenu = !!subItems;
2070
+ const hasAutoFocus = checkForAutoFocus(autoFocusItem, isFirstItem);
2071
+ const menuItemClasses = useStylesWithRootClass(listItemClassName$1, hasSubmenu ? listItemWithSubmenuClassName : '', classes ? classes : '');
2072
+ const handleClick = event => {
2073
+ // Execute select callback only for items which does not have
2074
+ // submenu defined. If there is no menu or handler - prevent
2075
+ // further propagation of the current event so that click on
2076
+ // items with submenu does not close the menu
2077
+ !hasSubmenu && onItemSelect ? onItemSelect(event, key) : event.stopPropagation();
2078
+ };
2079
+ /**
2080
+ * If there is submenu, right arrow icon will be added
2081
+ * and sub-menu will be rendered
2082
+ */
2083
+ return jsxs(MenuItem, Object.assign({
2084
+ autoFocus: hasAutoFocus,
2085
+ "aria-label": itemAriaLabel,
2086
+ className: menuItemClasses,
2087
+ disabled: disabled,
2088
+ disableRipple: hasSubmenu,
2089
+ divider: divider,
2090
+ onClick: handleClick,
2091
+ onMouseEnter: getMouseEnterHandler(key, hasSubmenu),
2092
+ ref: ref,
2093
+ style: {
2094
+ height: itemHeight
2095
+ },
2096
+ selected: isSelected
2097
+ }, {
2098
+ children: [children, hasSubmenu && jsx(DotIcon, {
2099
+ "data-testid": "dot-item-arrow-icon",
2100
+ iconId: "arrow-right"
2101
+ }, void 0), hasSubmenu && onSubMenuCreate({
2102
+ anchorElement: subItemAnchorEl,
2103
+ isOpened: isSelected,
2104
+ subMenuId: key,
2105
+ subMenuItems: subItems
2106
+ })]
2107
+ }), key);
2108
+ })
2109
+ }), void 0);
2110
+ });
2413
2111
 
2414
- const DotDrawerBody = ({
2112
+ const DotMenu = ({
2113
+ anchorEl,
2415
2114
  ariaLabel,
2416
- children,
2417
2115
  className,
2418
2116
  'data-testid': dataTestId,
2419
- headerExists,
2420
- onClose,
2421
- variant
2117
+ dense: _dense = true,
2118
+ disablePortal,
2119
+ id,
2120
+ loading: _loading = false,
2121
+ maxVisibleItems: _maxVisibleItems = DEFAULT_MAX_VISIBLE_ITEMS,
2122
+ menuItemHeight,
2123
+ menuItems: _menuItems = [],
2124
+ menuPlacement: _menuPlacement = 'bottom',
2125
+ onLeave,
2126
+ onSelect,
2127
+ open: _open = false,
2128
+ selectedKey
2422
2129
  }) => {
2423
- const rootClasses = useStylesWithRootClass(rootClassName$R, className);
2424
- return jsxs(StyleDrawerBody, Object.assign({
2130
+ const rootClasses = useStylesWithRootClass(rootClassName$T, className, _loading ? 'loading' : '');
2131
+ const isSubmenu = checkIfSubmenu(anchorEl);
2132
+ const hasSubItems = checkForSubItems(_menuItems);
2133
+ // Timeout object is customizable when Menu component is either submenu
2134
+ // (it is opened within parent menu) or it contains at least one item which
2135
+ // has sub-items. This is done because when multi-level menu is closing it
2136
+ // will first close the parent and only then child menus - which looks
2137
+ // a bit weird - so here I'm giving it exit value of 0 so that it looks like
2138
+ // they all close at the same time. For "normal" menus, timeout is unnecessary.
2139
+ const timeout = isSubmenu || hasSubItems ? {
2140
+ exit: 0,
2141
+ enter: 300
2142
+ } : undefined;
2143
+ const handleSelect = (event, itemKey) => {
2144
+ onLeave && onLeave(event);
2145
+ onSelect && onSelect(event, id, itemKey);
2146
+ };
2147
+ const handleListKeyDown = event => {
2148
+ if (onLeave && event.key === 'Tab') {
2149
+ event.preventDefault();
2150
+ onLeave(event);
2151
+ }
2152
+ };
2153
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2154
+ const handleClickAway = event => {
2155
+ if (onLeave && (!anchorEl || !anchorEl.contains(event.currentTarget))) {
2156
+ onLeave(event);
2157
+ }
2158
+ };
2159
+ return jsx(StyledPopper, Object.assign({
2160
+ anchorEl: anchorEl,
2425
2161
  "aria-label": ariaLabel,
2426
2162
  className: rootClasses,
2427
- "data-testid": dataTestId
2163
+ "data-testid": dataTestId,
2164
+ disablePortal: disablePortal,
2165
+ open: _open,
2166
+ placement: _menuPlacement,
2167
+ role: undefined,
2168
+ transition: true
2428
2169
  }, {
2429
- children: [children, !headerExists && variant !== 'permanent' && jsx(DotIconButton, {
2430
- className: "dot-drawer-close-button",
2431
- iconId: "close",
2432
- onClick: onClose
2433
- }, void 0)]
2170
+ children: ({
2171
+ TransitionProps,
2172
+ placement
2173
+ }) => jsx(Fade, Object.assign({}, TransitionProps, {
2174
+ style: {
2175
+ transformOrigin: placement === 'bottom' ? 'center top' : 'center bottom'
2176
+ },
2177
+ timeout: timeout
2178
+ }, {
2179
+ children: jsx(Paper, {
2180
+ children: jsx(ClickAwayListener, Object.assign({
2181
+ onClickAway: handleClickAway
2182
+ }, {
2183
+ children: _loading ? jsx(DotProgress, {
2184
+ "data-testid": "loading-indicator",
2185
+ tooltip: "Loading Data...",
2186
+ value: 20
2187
+ }, void 0) : jsx(DotMenuList, {
2188
+ autoFocusItem: _open,
2189
+ "data-testid": `${dataTestId}-menu`,
2190
+ dense: _dense,
2191
+ id: id,
2192
+ maxVisibleItems: _maxVisibleItems,
2193
+ menuItemHeight: menuItemHeight,
2194
+ menuItems: _menuItems,
2195
+ onItemSelect: handleSelect,
2196
+ onKeyDown: handleListKeyDown,
2197
+ onSubMenuCreate: ({
2198
+ anchorElement,
2199
+ isOpened,
2200
+ subMenuId,
2201
+ subMenuItems
2202
+ }) => jsx(DotMenu, {
2203
+ anchorEl: anchorElement,
2204
+ menuPlacement: "right-start",
2205
+ id: subMenuId,
2206
+ menuItems: subMenuItems,
2207
+ open: isOpened,
2208
+ onLeave: onLeave,
2209
+ onSelect: onSelect,
2210
+ selectedKey: selectedKey
2211
+ }, void 0),
2212
+ selectedKey: selectedKey
2213
+ }, void 0)
2214
+ }), void 0)
2215
+ }, void 0)
2216
+ }), void 0)
2434
2217
  }), void 0);
2435
2218
  };
2436
2219
 
2437
- const rootClassName$Q = 'dot-drawer-footer';
2438
- const StyleDrawerFooter = styled.div.withConfig({
2439
- displayName: "DrawerFooterstyles__StyleDrawerFooter",
2440
- componentId: "sc-1ki05ze-0"
2220
+ const CreateUUID = () => {
2221
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
2222
+ const r = Math.random() * 16 | 0,
2223
+ v = c === 'x' ? r : r & 0x3 | 0x8;
2224
+ return v.toString(16);
2225
+ });
2226
+ };
2227
+
2228
+ const rootClassName$R = 'dot-drawer';
2229
+ const StyledDrawer = styled(Drawer).withConfig({
2230
+ displayName: "Drawerstyles__StyledDrawer",
2231
+ componentId: "sc-1uiowy0-0"
2441
2232
  })(["", ""], ({
2442
2233
  theme
2443
- }) => css(["&.", "{padding:", ";}"], rootClassName$Q, theme.spacing(2, 0, 0)));
2234
+ }) => css(["&.", " .MuiBackdrop-root{background-color:", ";}.dot-drawer-paper{height:", ";padding:", ";width:", ";}"], rootClassName$R, alpha(theme.palette.grey[900], 0.7), ({
2235
+ height,
2236
+ anchor
2237
+ }) => anchor === 'left' || anchor === 'right' ? '100%' : height, theme.spacing(2), ({
2238
+ width,
2239
+ anchor
2240
+ }) => anchor === 'bottom' || anchor === 'top' ? 'auto' : width));
2444
2241
 
2445
- const DotDrawerFooter = ({
2242
+ const rootClassName$Q = 'dot-drawer-header';
2243
+ const StyleDrawerHeader = styled.div.withConfig({
2244
+ displayName: "DrawerHeaderstyles__StyleDrawerHeader",
2245
+ componentId: "sc-2d2xd3-0"
2246
+ })(["", ""], ({
2247
+ theme
2248
+ }) => css(["&.", "{padding:", ";display:flex;align-items:center;.close-button{margin-left:auto;}}"], rootClassName$Q, theme.spacing(0, 0, 2)));
2249
+
2250
+ const rootClassName$P = 'dot-icon-btn';
2251
+ const StyledIconButton = styled(IconButton).withConfig({
2252
+ displayName: "IconButtonstyles__StyledIconButton",
2253
+ componentId: "eko0kb-0"
2254
+ })(["", ""], () => css(["&.", "{font-size:inherit;padding:10px;.dot-icon.MuiIcon-fontSizeSmall{padding:1px;}&.MuiIconButton-sizeSmall{padding:3px;}&.ripple-disabled{&:hover,&:active,&:focus{background:", ";}}"], rootClassName$P, hoverGray));
2255
+
2256
+ const DotIconButton = ({
2257
+ ariaLabel,
2258
+ className,
2259
+ color: _color = 'inherit',
2260
+ 'data-testid': dataTestId,
2261
+ disabled: _disabled = false,
2262
+ disableRipple: _disableRipple = false,
2263
+ iconId,
2264
+ iconSize: _iconSize = 'small',
2265
+ onClick,
2266
+ tooltip,
2267
+ size: _size = 'medium'
2268
+ }) => {
2269
+ const rippleClassName = _disableRipple ? 'ripple-disabled' : '';
2270
+ const rootClasses = useStylesWithRootClass(rootClassName$P, rippleClassName, className);
2271
+ return jsx(DotTooltip, Object.assign({
2272
+ "data-testid": "icon-button-tooltip",
2273
+ title: tooltip
2274
+ }, {
2275
+ children: jsx(StyledIconButton, Object.assign({
2276
+ "aria-label": ariaLabel,
2277
+ classes: {
2278
+ root: rootClasses
2279
+ },
2280
+ color: _color,
2281
+ "data-testid": dataTestId,
2282
+ disableRipple: _disableRipple,
2283
+ disabled: _disabled,
2284
+ onClick: event => onClick && onClick(event),
2285
+ size: _size
2286
+ }, {
2287
+ children: jsx(DotIcon, {
2288
+ "data-testid": "button-icon",
2289
+ fontSize: _iconSize,
2290
+ iconId: iconId
2291
+ }, void 0)
2292
+ }), void 0)
2293
+ }), void 0);
2294
+ };
2295
+
2296
+ const DotDrawerHeader = ({
2446
2297
  ariaLabel,
2447
2298
  children,
2448
2299
  className,
2449
- 'data-testid': dataTestId
2300
+ 'data-testid': dataTestId,
2301
+ onClose,
2302
+ variant
2450
2303
  }) => {
2451
2304
  const rootClasses = useStylesWithRootClass(rootClassName$Q, className);
2452
- return jsx(StyleDrawerFooter, Object.assign({
2305
+ return jsxs(StyleDrawerHeader, Object.assign({
2453
2306
  "aria-label": ariaLabel,
2454
2307
  className: rootClasses,
2455
2308
  "data-testid": dataTestId
2456
2309
  }, {
2457
- children: children
2310
+ children: [children, variant !== 'permanent' && jsx(DotIconButton, {
2311
+ className: "close-button",
2312
+ iconId: "close",
2313
+ onClick: onClose
2314
+ }, void 0)]
2458
2315
  }), void 0);
2459
2316
  };
2460
2317
 
2461
- const DotDrawer = ({
2462
- anchor: _anchor = 'right',
2318
+ const rootClassName$O = 'dot-drawer-body';
2319
+ const StyleDrawerBody = styled.div.withConfig({
2320
+ displayName: "DrawerBodystyles__StyleDrawerBody",
2321
+ componentId: "sc-1mpmjdk-0"
2322
+ })(["", ""], () => css(["&.", "{display:flex;.dot-drawer-close-button{align-self:self-start;padding:0;margin-left:auto;}}"], rootClassName$O));
2323
+
2324
+ const DotDrawerBody = ({
2325
+ ariaLabel,
2326
+ children,
2327
+ className,
2328
+ 'data-testid': dataTestId,
2329
+ headerExists,
2330
+ onClose,
2331
+ variant
2332
+ }) => {
2333
+ const rootClasses = useStylesWithRootClass(rootClassName$O, className);
2334
+ return jsxs(StyleDrawerBody, Object.assign({
2335
+ "aria-label": ariaLabel,
2336
+ className: rootClasses,
2337
+ "data-testid": dataTestId
2338
+ }, {
2339
+ children: [children, !headerExists && variant !== 'permanent' && jsx(DotIconButton, {
2340
+ className: "dot-drawer-close-button",
2341
+ iconId: "close",
2342
+ onClick: onClose
2343
+ }, void 0)]
2344
+ }), void 0);
2345
+ };
2346
+
2347
+ const rootClassName$N = 'dot-drawer-footer';
2348
+ const StyleDrawerFooter = styled.div.withConfig({
2349
+ displayName: "DrawerFooterstyles__StyleDrawerFooter",
2350
+ componentId: "sc-1ki05ze-0"
2351
+ })(["", ""], ({
2352
+ theme
2353
+ }) => css(["&.", "{padding:", ";}"], rootClassName$N, theme.spacing(2, 0, 0)));
2354
+
2355
+ const DotDrawerFooter = ({
2356
+ ariaLabel,
2357
+ children,
2358
+ className,
2359
+ 'data-testid': dataTestId
2360
+ }) => {
2361
+ const rootClasses = useStylesWithRootClass(rootClassName$N, className);
2362
+ return jsx(StyleDrawerFooter, Object.assign({
2363
+ "aria-label": ariaLabel,
2364
+ className: rootClasses,
2365
+ "data-testid": dataTestId
2366
+ }, {
2367
+ children: children
2368
+ }), void 0);
2369
+ };
2370
+
2371
+ const DotDrawer = ({
2372
+ anchor: _anchor = 'right',
2463
2373
  ariaLabel,
2464
2374
  className,
2465
2375
  children,
@@ -2485,7 +2395,7 @@ const DotDrawer = ({
2485
2395
  onClose(event);
2486
2396
  }
2487
2397
  };
2488
- const rootClasses = useStylesWithRootClass(rootClassName$T, className);
2398
+ const rootClasses = useStylesWithRootClass(rootClassName$R, className);
2489
2399
  const headerExists = !!drawerHeaderProps;
2490
2400
  const bodyTestId = drawerBodyProps ? drawerBodyProps[`data-testid`] : 'drawer-body';
2491
2401
  return jsxs(StyledDrawer, Object.assign({
@@ -2528,990 +2438,1186 @@ const DotDrawer = ({
2528
2438
  }), void 0);
2529
2439
  };
2530
2440
 
2531
- const rootClassName$P = 'dot-app-switcher';
2532
- const StyledAppSwitcher = styled(DotDrawer).withConfig({
2533
- displayName: "AppSwitcherstyles__StyledAppSwitcher",
2534
- componentId: "hhxfqg-0"
2441
+ const fadeIn = keyframes(["from{opacity:0;}to{opacity:1;}"]);
2442
+ const StyledDotDrawer = styled(DotDrawer).withConfig({
2443
+ displayName: "NestedListstyles__StyledDotDrawer",
2444
+ componentId: "sc-1wwoqos-0"
2535
2445
  })(["", ""], ({
2536
- theme
2537
- }) => css(["&.", "{.app-menu-item{display:flex;justify-content:space-between;align-items:center;}.dot-link,.product-menu-item{display:flex;justify-content:space-between;align-items:center;width:100%;height:64px;text-decoration:none;cursor:pointer;}.logo-title{display:flex;align-items:center;gap:24px;width:100%;}.dot-avatar{flex-basis:40px;}.dai-apps-title{display:flex;align-items:center;height:32px;padding:", ";background-color:", ";}.dot-app-switcher-app-title{min-width:150px;}.dot-icon{flex-basis:content;}.app-switcher-header{.app-switcher-header-title{padding-left:", ";display:flex;align-items:center;}display:flex;justify-content:space-between;align-items:end;border-bottom:1px solid ", ";margin:", ";padding-bottom:", ";.app-switcher-label{padding-left:", ";}}.app-switcher-back-button{&.dot-button.MuiButton-text{padding-left:0;}}.product-heading{display:flex;align-items:center;gap:24px;padding-bottom:", ";}.product-applications{width:100%;overflow-y:auto;}.product-applications-search{margin-bottom:", ";}}"], rootClassName$P, theme.spacing(0, 0, 0, 1), theme.palette.grey[50], theme.spacing(2), theme.palette.grey[200], theme.spacing(0, -2, 2), theme.spacing(1), theme.spacing(3), theme.spacing(3), theme.spacing(3)));
2446
+ open
2447
+ }) => css(["&.", "{.dot-drawer-paper{z-index:", ";animation:", ";}}"], nestedDrawerClassName, open ? levelFirst : levelBottom, open && css(["", " 0.2s cubic-bezier(1,0,1,.01);"], fadeIn)));
2538
2448
 
2539
- const DotAppSwitcherView = ({
2540
- activeApp,
2541
- apps,
2542
- className,
2543
- noAppTypeLabel: _noAppTypeLabel = 'Other',
2544
- platformConsoleUrl,
2545
- onClose,
2546
- open,
2547
- searchInstancesThreshold: _searchInstancesThreshold = 5,
2548
- selectedAppType,
2549
- yOffset: _yOffset = 48,
2550
- zIndex: _zIndex = 990
2449
+ const DEFAULT_TOOLTIP_PLACEMENT = 'top-start';
2450
+ const DotListDivider = ({
2451
+ item,
2452
+ index
2551
2453
  }) => {
2552
- const dotCoreApiContext = useDotCoreApiContext();
2553
- let setSelectedAppType = null;
2554
- if (dotCoreApiContext !== null) {
2555
- setSelectedAppType = dotCoreApiContext.setSelectedAppSwitcherAppType;
2556
- }
2557
- const rootClasses = useStylesWithRootClass(rootClassName$P, className);
2558
- const [appTypeMap, setAppTypeMap] = useState();
2559
- const [appTypeLabels, setAppTypeLabels] = useState();
2560
- const [appTypeMenuItems, setAppTypeMenuItems] = useState();
2561
- const [selectedAppTypeAlt, setSelectedAppTypeAlt] = useState(null);
2562
- const [searchText, setSearchText] = useState('');
2563
- if (!setSelectedAppType) {
2564
- selectedAppType = selectedAppTypeAlt;
2565
- setSelectedAppType = setSelectedAppTypeAlt;
2454
+ if (item.text) {
2455
+ return jsx(ListSubheader, Object.assign({
2456
+ disableSticky: true
2457
+ }, {
2458
+ children: jsx(DotTypography, Object.assign({
2459
+ variant: "overline"
2460
+ }, {
2461
+ children: item.text
2462
+ }), void 0)
2463
+ }), void 0);
2566
2464
  }
2567
- const showApps = useCallback(appType => {
2568
- setSelectedAppType(appType);
2569
- }, []);
2570
- const showAppTypes = useCallback(() => {
2571
- setSearchText('');
2572
- setSelectedAppType(null);
2573
- }, []);
2574
- const populateAppTypeMap = useCallback(() => {
2575
- const newAppTypeMap = new Map();
2576
- // we'll put Other at the end
2577
- const otherApps = [];
2578
- apps === null || apps === void 0 ? void 0 : apps.forEach(app => {
2579
- const instanceStateText = getInstanceStateText(app);
2580
- const children = createMenuItem(app.url, app.name, instanceStateText);
2581
- const searchableContent = `${app.name} ${instanceStateText}`;
2582
- const appTypeName = app.logo_product_name;
2583
- let appTypeApps;
2584
- if (appTypeName) {
2585
- appTypeApps = newAppTypeMap.get(appTypeName);
2586
- if (!appTypeApps) {
2587
- appTypeApps = [];
2588
- newAppTypeMap.set(appTypeName, appTypeApps);
2589
- }
2590
- } else {
2591
- appTypeApps = otherApps;
2592
- }
2593
- appTypeApps.push({
2594
- children,
2595
- searchableContent,
2596
- key: app.id,
2597
- height: 64
2598
- });
2599
- });
2600
- const keys = Array.from(newAppTypeMap.keys()).sort();
2601
- const sortedAppTypeMap = new Map();
2602
- for (const appType of keys) {
2603
- sortedAppTypeMap.set(appType, newAppTypeMap.get(appType));
2604
- }
2605
- let appTypeCount = sortedAppTypeMap.size;
2606
- if (platformConsoleUrl) {
2607
- appTypeCount++;
2608
- }
2609
- if (otherApps.length > 0) {
2610
- sortedAppTypeMap.set(_noAppTypeLabel, otherApps);
2611
- }
2612
- setAppTypeMap(sortedAppTypeMap);
2613
- const menuItems = [daiAppsHeaderMenuItem(appTypeCount)];
2614
- if (platformConsoleUrl) {
2615
- const children = createTopLevelMenuItem(platformConsoleUrl, getLogoForAppType('Platform'), 'Digital.ai Platform', !window.location.href.startsWith(platformConsoleUrl));
2616
- menuItems.push({
2617
- children,
2618
- key: 'app-switcher-platform-link',
2619
- height: 64
2620
- });
2465
+ return jsx(Divider, {
2466
+ "aria-hidden": true,
2467
+ "data-testid": `divider-${index}`
2468
+ }, void 0);
2469
+ };
2470
+ const DotList = ({
2471
+ ariaLabel,
2472
+ children,
2473
+ className,
2474
+ component: _component = 'ul',
2475
+ 'data-testid': dataTestId,
2476
+ dense: _dense = false,
2477
+ disablePadding: _disablePadding = false,
2478
+ items: _items = [],
2479
+ menuPlacement: _menuPlacement = 'right-start',
2480
+ nestedDrawerLeftSpacing: _nestedDrawerLeftSpacing = 240,
2481
+ nestedListType: _nestedListType = 'expandable',
2482
+ width: _width = 240
2483
+ }) => {
2484
+ const rootClasses = useStylesWithRootClass(rootClassName$W, className);
2485
+ const listWidth = typeof _width === 'number' ? `${_width}px` : _width;
2486
+ const listRef = useRef();
2487
+ const [listItemIndex, setListItemIndex] = useState(null);
2488
+ const updateSelectedListItem = currentIndex => {
2489
+ currentIndex === listItemIndex ? setListItemIndex(null) : setListItemIndex(currentIndex);
2490
+ };
2491
+ return jsxs(StyledList, Object.assign({
2492
+ "aria-label": ariaLabel,
2493
+ classes: {
2494
+ root: rootClasses
2495
+ },
2496
+ component: _component,
2497
+ "data-testid": dataTestId,
2498
+ dense: _dense,
2499
+ disablePadding: _disablePadding,
2500
+ ref: listRef,
2501
+ style: {
2502
+ width: listWidth
2621
2503
  }
2622
- const newAppTypeLabels = new Map();
2623
- sortedAppTypeMap.forEach((singleTypeApps, appTypeName) => {
2624
- if ((singleTypeApps === null || singleTypeApps === void 0 ? void 0 : singleTypeApps.length) > 0) {
2625
- const logo = appTypeName === _noAppTypeLabel ? null : getLogoForAppType(appTypeName);
2626
- newAppTypeLabels.set(appTypeName, {
2627
- logo,
2628
- singleTypeApps
2629
- });
2630
- menuItems.push({
2631
- children: jsxs("div", Object.assign({
2632
- className: "product-menu-item",
2633
- onClick: () => showApps(appTypeName)
2634
- }, {
2635
- children: [createAppTypeLabel(appTypeName, logo, singleTypeApps), jsx(DotIcon, {
2636
- iconId: "chevron-right"
2637
- }, void 0)]
2638
- }), `menu-item-${appTypeName}`),
2639
- key: appTypeName,
2640
- height: 64
2641
- });
2504
+ }, {
2505
+ children: [_items.map((item, index) => {
2506
+ const handleListItemClick = e => {
2507
+ var _a;
2508
+ updateSelectedListItem(index);
2509
+ (_a = item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, e);
2510
+ };
2511
+ const handleMenuLeave = event => {
2512
+ var _a, _b;
2513
+ // Remove index only if clicked element is not found within the list
2514
+ if (!((_a = listRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
2515
+ setListItemIndex(null);
2516
+ (_b = item.onMenuLeave) === null || _b === void 0 ? void 0 : _b.call(item, event);
2517
+ }
2518
+ };
2519
+ if (item.child) {
2520
+ return jsx(Fragment, {
2521
+ children: item.child
2522
+ }, `item-child-${index}`);
2642
2523
  }
2643
- });
2644
- setAppTypeMenuItems(menuItems);
2645
- setAppTypeLabels(newAppTypeLabels);
2646
- }, [apps]);
2647
- const emptyState = useCallback(() => {
2648
- const currentAppMenuItem = createTopLevelMenuItem(window.location.href, getLogoForAppType(activeApp.product), activeApp.name, false);
2649
- setAppTypeMenuItems([daiAppsHeaderMenuItem(), {
2650
- children: currentAppMenuItem,
2651
- key: 'no_applications_configured',
2652
- height: 64,
2653
- disabled: true
2654
- }]);
2655
- }, [activeApp]);
2656
- useEffect(() => {
2657
- if ((apps === null || apps === void 0 ? void 0 : apps.length) > 0) {
2658
- populateAppTypeMap();
2659
- } else {
2660
- emptyState();
2661
- }
2662
- }, [apps]);
2663
- const onAppInstanceSearchTextChange = useCallback(text => {
2664
- setSearchText(text);
2665
- }, []);
2666
- const clearAppInstanceSearchText = useCallback(() => {
2667
- setSearchText('');
2668
- }, []);
2669
- const closeHandler = useCallback(event => {
2670
- setSearchText('');
2671
- onClose && onClose(event);
2672
- }, [onClose]);
2673
- const filteredAppInstances = useCallback(() => {
2674
- var _a;
2675
- return (_a = appTypeMap.get(selectedAppType)) === null || _a === void 0 ? void 0 : _a.filter(item => {
2676
- let isMatch = !searchText;
2677
- if (searchText) {
2678
- const testStr = isLowerCase(searchText) ? item.searchableContent.toLowerCase() : item.searchableContent;
2679
- isMatch = testStr.indexOf(searchText) >= 0;
2524
+ if (item.divider) {
2525
+ return jsx(DotListDivider, {
2526
+ index: index,
2527
+ item: item
2528
+ }, `divider-${index}`);
2680
2529
  }
2681
- return isMatch;
2682
- }).map(item => item.children);
2683
- }, [appTypeMap, selectedAppType, searchText]);
2684
- const content = () => {
2685
- var _a;
2686
- if (selectedAppType && appTypeMap && appTypeLabels) {
2687
- const labelConfig = appTypeLabels.get(selectedAppType);
2688
- return jsxs(Fragment, {
2689
- children: [jsx("span", {
2690
- children: jsx(DotButton, Object.assign({
2691
- className: "app-switcher-back-button",
2692
- type: "text",
2693
- onClick: showAppTypes,
2694
- startIcon: jsx(DotIcon, {
2695
- iconId: "back"
2696
- }, void 0)
2697
- }, {
2698
- children: jsx("span", {
2699
- children: "Back"
2700
- }, void 0)
2701
- }), void 0)
2702
- }, void 0), jsx("div", Object.assign({
2703
- className: "product-heading"
2704
- }, {
2705
- children: createAppTypeLabel(selectedAppType, labelConfig.logo, labelConfig.singleTypeApps)
2706
- }), void 0), ((_a = appTypeMap === null || appTypeMap === void 0 ? void 0 : appTypeMap.get(selectedAppType)) === null || _a === void 0 ? void 0 : _a.length) >= _searchInstancesThreshold && jsx("div", {
2707
- children: jsx(SearchInput, {
2708
- "data-testid": "app-instance-search-input",
2709
- onChange: onAppInstanceSearchTextChange,
2710
- onClear: clearAppInstanceSearchText,
2711
- value: searchText
2712
- }, void 0)
2713
- }, void 0), jsx("div", Object.assign({
2714
- className: "product-applications"
2715
- }, {
2716
- children: filteredAppInstances()
2717
- }), void 0)]
2718
- }, void 0);
2719
- }
2720
- return appTypeMenuItems === null || appTypeMenuItems === void 0 ? void 0 : appTypeMenuItems.map(item => item.children);
2721
- };
2722
- const header = {
2723
- className: 'app-switcher-header',
2724
- children: jsxs("div", Object.assign({
2725
- className: "app-switcher-header-title",
2726
- style: {
2727
- marginTop: _yOffset + 'px',
2728
- width: '80%'
2729
- }
2730
- }, {
2731
- children: [jsx(DotAvatar, {
2732
- iconId: "apps",
2733
- alt: "app image",
2734
- type: "image",
2735
- variant: "circular"
2736
- }, void 0), jsx(DotTypography, Object.assign({
2737
- className: "app-switcher-label"
2738
- }, {
2739
- children: "App switcher"
2740
- }), void 0)]
2741
- }), void 0)
2742
- };
2743
- return jsx(StyledAppSwitcher, Object.assign({
2744
- className: rootClasses,
2745
- ModalProps: {
2746
- style: {
2747
- zIndex: _zIndex
2748
- },
2749
- hideBackdrop: true
2750
- },
2751
- drawerHeaderProps: header,
2752
- variant: "temporary",
2753
- width: "340px",
2754
- open: open,
2755
- onClose: closeHandler
2756
- }, {
2757
- children: content()
2530
+ return jsx(DotListItem, {
2531
+ className: item.className,
2532
+ component: item.component,
2533
+ "data-testid": `${dataTestId}-item-${index}`,
2534
+ endIcon: item.endIcon,
2535
+ href: item.href,
2536
+ isOpened: listItemIndex === index,
2537
+ items: item.items,
2538
+ menuPlacement: _menuPlacement,
2539
+ nestedDrawerLeftSpacing: _nestedDrawerLeftSpacing,
2540
+ nestedListType: _nestedListType,
2541
+ onClick: item.href && !item.onClick ? null : handleListItemClick,
2542
+ onMenuLeave: handleMenuLeave,
2543
+ primaryText: item.primaryText,
2544
+ secondaryText: item.secondaryText,
2545
+ selected: item.selected,
2546
+ startIcon: item.startIcon,
2547
+ target: item.target,
2548
+ text: item.text,
2549
+ tooltip: item.tooltip,
2550
+ tooltipPlacement: item.tooltipPlacement || DEFAULT_TOOLTIP_PLACEMENT
2551
+ }, index);
2552
+ }), children]
2758
2553
  }), void 0);
2759
2554
  };
2760
- const DotAppSwitcher = _a => {
2761
- var {
2762
- accountId,
2763
- includePlatformConsole = true,
2764
- onClose
2765
- } = _a,
2766
- commonProps = __rest(_a, ["accountId", "includePlatformConsole", "onClose"]);
2767
- const {
2768
- applications,
2769
- applicationsLoading,
2770
- applicationsError,
2771
- loadApplications,
2772
- isAppSwitcherOpen: open,
2773
- platformConsoleUrl,
2774
- setIsAppSwitcherOpen: setOpen,
2775
- selectedAppSwitcherAppType: selectedAppType,
2776
- setSelectedAppSwitcherAppType: setSelectedAppType
2777
- } = useDotCoreApiContext();
2778
- useEffect(() => {
2779
- if ((!applications || applications.length === 0) && open) {
2780
- loadApplications(accountId);
2781
- }
2782
- }, [accountId, open]);
2783
- if (applicationsError) {
2784
- console.error('Error loading application list in AppSwitcher', applicationsError);
2785
- }
2786
- const closeHandler = useCallback(event => {
2787
- setOpen(false);
2788
- setSelectedAppType(null);
2789
- onClose && onClose(event);
2790
- }, [onClose]);
2791
- const viewProps = includePlatformConsole ? Object.assign(Object.assign({}, commonProps), {
2792
- platformConsoleUrl
2793
- }) : Object.assign({}, commonProps);
2794
- if (!applicationsLoading && !applicationsError) {
2795
- return jsx(DotAppSwitcherView, Object.assign({}, viewProps, {
2796
- open: open,
2797
- apps: applications,
2798
- selectedAppType: selectedAppType,
2799
- onClose: closeHandler
2800
- }), void 0);
2801
- }
2802
- return null;
2803
- };
2804
-
2805
- const rootClassName$O = 'dot-list';
2806
- const listItemRootClass = 'dot-list-item';
2807
- const nestedListClassName = 'dot-nested-list';
2808
- const nestedDrawerClassName = 'dot-nested-drawer';
2809
- const StyledList = styled(List).withConfig({
2810
- displayName: "Liststyles__StyledList",
2811
- componentId: "wxwqwr-0"
2812
- })(["", ""], ({
2813
- theme
2814
- }) => css(["&.", "{background:", ";.dot-icon{color:", ";}&.", " .", "{padding-left:", ";}.MuiListSubheader-root{padding:0;.MuiTypography-root{padding:", ";}}}"], rootClassName$O, theme.palette.layer.n0, theme.palette.layer.n700, nestedListClassName, listItemRootClass, theme.spacing(4), theme.spacing(1)));
2815
-
2816
- const getChevronIcon = (nestedListType, isOpened) => {
2817
- if (nestedListType !== 'expandable') {
2818
- return 'chevron-right';
2819
- }
2820
- if (isOpened) {
2821
- return 'chevron-up';
2822
- }
2823
- return 'chevron-down';
2824
- };
2825
-
2826
- const flyoutListItemClassName = 'dot-flyout-list-item';
2827
- const flyoutItemLinkClassName = 'dot-flyout-item-link';
2828
- const listItemLinkClassName = 'dot-list-item-link';
2829
- const StyledListItem = styled(ListItem).withConfig({
2830
- displayName: "ListItemstyles__StyledListItem",
2831
- componentId: "sc-1fawh8v-0"
2832
- })(["", ""], ({
2833
- theme
2834
- }) => css(["&.", "{&.", "{padding:0;}p.MuiTypography-root{margin-bottom:0;}.", "{align-items:center;display:flex;flex-grow:2;}.", " .MuiIcon-root{margin-right:", ";}.dot-icon i:before{color:", ";}}"], listItemRootClass, flyoutListItemClassName, listItemLinkClassName, flyoutItemLinkClassName, theme.spacing(4), theme.palette.text.primary));
2835
-
2836
- const rootClassName$N = 'dot-progress';
2837
- const StyledCircularProgress = styled(CircularProgress).withConfig({
2838
- displayName: "Progressstyles__StyledCircularProgress",
2839
- componentId: "sc-1gs77rb-0"
2840
- })(["&.", "{&.MuiCircularProgress-colorSecondary{color:#649a3d;}}"], rootClassName$N);
2841
-
2842
- const DotProgress = ({
2555
+ const DotListItem = ({
2843
2556
  ariaLabel,
2844
- color: _color = 'secondary',
2845
2557
  className,
2558
+ component: _component2 = 'li',
2846
2559
  'data-testid': dataTestId,
2847
- size: _size = 40,
2848
- thickness: _thickness = 3.6,
2849
- tooltip: _tooltip = 'loading data',
2850
- value,
2851
- variant: _variant = 'indeterminate'
2560
+ divider: _divider = false,
2561
+ endIcon,
2562
+ href,
2563
+ isOpened,
2564
+ onClick,
2565
+ onMenuLeave,
2566
+ items: _items2 = [],
2567
+ menuPlacement,
2568
+ nestedDrawerLeftSpacing,
2569
+ nestedListType,
2570
+ primaryText,
2571
+ secondaryText,
2572
+ selected,
2573
+ startIcon,
2574
+ target,
2575
+ text,
2576
+ tooltip,
2577
+ tooltipPlacement: _tooltipPlacement = DEFAULT_TOOLTIP_PLACEMENT
2852
2578
  }) => {
2853
- const rootClasses = useStylesWithRootClass(rootClassName$N, className);
2854
- return jsx(DotTooltip, Object.assign({
2855
- title: _tooltip
2579
+ const hasChildren = _items2.length > 0;
2580
+ const isFlyout = nestedListType === 'menu' && hasChildren;
2581
+ const [anchorEl, setAnchorEl] = useState(null);
2582
+ const showEndIcon = endIcon || hasChildren;
2583
+ const rootClasses = useStylesWithRootClass(listItemRootClass, className, isOpened ? 'open' : '');
2584
+ const toggleOpen = event => setAnchorEl(event.currentTarget);
2585
+ const handleClick = event => {
2586
+ onClick === null || onClick === void 0 ? void 0 : onClick(event);
2587
+ toggleOpen(event);
2588
+ };
2589
+ const handleMenuLeave = event => onMenuLeave(event);
2590
+ const renderListItemText = () => primaryText && secondaryText ? jsx(ListItemText, {
2591
+ primary: primaryText,
2592
+ secondary: secondaryText
2593
+ }, void 0) : jsx(DotTypography, Object.assign({
2594
+ variant: "body1"
2856
2595
  }, {
2857
- children: jsx(StyledCircularProgress, {
2858
- "aria-label": ariaLabel,
2859
- classes: {
2860
- root: rootClasses
2861
- },
2862
- color: _color,
2863
- "data-testid": dataTestId,
2864
- size: _size,
2865
- thickness: _thickness,
2866
- value: value,
2867
- variant: _variant
2868
- }, void 0)
2596
+ children: text
2869
2597
  }), void 0);
2598
+ const renderListItemEndIcon = () => {
2599
+ if (hasChildren || !endIcon) {
2600
+ return jsx(DotIcon, {
2601
+ iconId: hasChildren && getChevronIcon(nestedListType, isOpened)
2602
+ }, void 0);
2603
+ }
2604
+ return endIcon;
2605
+ };
2606
+ return jsxs(Fragment$1, {
2607
+ children: [jsx(DotTooltip, Object.assign({
2608
+ "data-testid": `${dataTestId}-tooltip`,
2609
+ placement: _tooltipPlacement,
2610
+ title: tooltip
2611
+ }, {
2612
+ children: jsxs(StyledListItem, Object.assign({
2613
+ "aria-label": ariaLabel,
2614
+ button: true,
2615
+ classes: {
2616
+ root: rootClasses
2617
+ },
2618
+ component: href && !onClick ? 'a' : _component2,
2619
+ "data-testid": dataTestId,
2620
+ divider: _divider,
2621
+ href: onClick ? null : href,
2622
+ onClick: onClick || !href ? handleClick : null,
2623
+ selected: isFlyout ? isOpened : selected,
2624
+ target: target
2625
+ }, {
2626
+ children: [jsxs("span", Object.assign({
2627
+ className: listItemLinkClassName
2628
+ }, {
2629
+ children: [startIcon && jsx(ListItemIcon, {
2630
+ children: startIcon
2631
+ }, void 0), renderListItemText()]
2632
+ }), void 0), showEndIcon && renderListItemEndIcon()]
2633
+ }), void 0)
2634
+ }), void 0), hasChildren && jsx(NestedList, {
2635
+ anchorEl: anchorEl,
2636
+ ariaLabel: "nested list",
2637
+ "data-testid": "nestedList",
2638
+ items: _items2,
2639
+ menuPlacement: menuPlacement,
2640
+ nestedDrawerLeftSpacing: nestedDrawerLeftSpacing,
2641
+ onMenuLeave: handleMenuLeave,
2642
+ open: isOpened,
2643
+ type: nestedListType
2644
+ }, void 0)]
2645
+ }, void 0);
2870
2646
  };
2871
-
2872
- const levelBottom = -1;
2873
- const levelFirst = 1;
2874
- const levelSecond = 10;
2875
- const levelThird = 100;
2876
- const levelFourth = 1000;
2877
- const levelTop = 9999;
2878
-
2879
- var variables = /*#__PURE__*/Object.freeze({
2880
- __proto__: null,
2881
- levelBottom: levelBottom,
2882
- levelFirst: levelFirst,
2883
- levelSecond: levelSecond,
2884
- levelThird: levelThird,
2885
- levelFourth: levelFourth,
2886
- levelTop: levelTop
2887
- });
2888
-
2889
- const rootClassName$M = 'dot-popper';
2890
- const StyledPopper$1 = styled(Popper).withConfig({
2891
- displayName: "Popperstyles__StyledPopper",
2892
- componentId: "sd1h8p-0"
2893
- })(["", ""], ({
2894
- theme
2895
- }) => css(["&.", "{font-family:", ";font-size:", "px;}"], rootClassName$M, theme.typography.fontFamily, theme.typography.body1.fontSize));
2896
-
2897
- const flyoutMenuClassName = 'dot-flyout-menu';
2898
- const rootClassName$L = 'dot-menu';
2899
- const getListMaxHeight = maxHeight => isString$1(maxHeight) ? maxHeight : `${maxHeight}px`;
2900
- const StyledPopper = styled(Popper).withConfig({
2901
- displayName: "Menustyles__StyledPopper",
2902
- componentId: "sc-134fmqu-0"
2903
- })(["", ""], ({
2904
- theme
2905
- }) => css(["&.", "{font-family:", ";font-size:", "px;z-index:", ";}&.", ",&.", "{&.loading .MuiPaper-root{align-items:center;display:flex;justify-content:center;min-height:200px;min-width:200px;}ul,.dot-action-item{.dot-action-item-text{white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis;}}ul{box-sizing:content-box;min-width:112px;overflow:auto;", " .dot-li{min-height:auto;}}.dot-action-item{height:", ";border-top:1px solid ", ";line-height:inherit;button.dot-button{border-radius:", ";justify-content:flex-start;height:100%;margin:0;&:focus-visible{background-color:", ";}.MuiButton-label{gap:", ";.MuiButton-startIcon{margin-left:0;.dot-icon{flex-shrink:0;}}}}}}"], rootClassName$M, theme.typography.fontFamily, theme.typography.body1.fontSize, levelSecond, rootClassName$L, rootClassName$M, ({
2906
- $maxHeight
2907
- }) => $maxHeight !== undefined && `
2908
- max-height: ${getListMaxHeight($maxHeight)};
2909
- `, theme.spacing(7), theme.palette.grey[100], theme.spacing(0, 0, 0.5, 0.5), theme.palette.layer.n100, theme.spacing(3)));
2910
-
2911
- const MENU_ITEM_HEIGHT_NORMAL = 48;
2912
- const MENU_ITEM_HEIGHT_DENSE = 36;
2913
- const DEFAULT_MAX_VISIBLE_ITEMS = 7;
2914
-
2915
- const rootClassName$K = 'dot-ul';
2916
- const listItemClassName$1 = 'dot-li';
2917
- const listItemWithSubmenuClassName = 'dot-li-with-submenu';
2918
- const StyledMenuList = styled(MenuList).withConfig({
2919
- displayName: "MenuListstyles__StyledMenuList",
2920
- componentId: "yqdwwg-0"
2921
- })(["", ""], ({
2922
- theme
2923
- }) => css(["&.", "{.dot-li{font-size:", "px;justify-content:space-between;gap:", ";&:hover{background:", ";}&.Mui-selected,&.Mui-selected:hover{background:", ";}&.", "{padding-right:", ";}}}"], rootClassName$K, theme.typography.body1.fontSize, theme.spacing(3), hoverGray, lightSelectedGray, listItemWithSubmenuClassName, theme.spacing(0.5)));
2924
-
2925
- const getDefaultItemHeight = isDense => isDense ? MENU_ITEM_HEIGHT_DENSE : MENU_ITEM_HEIGHT_NORMAL;
2926
- const calculateItemHeight = (isDense, customItemHeight, menuItemHeight) => {
2927
- // Custom item height must NOT be lower than MENU_ITEM_HEIGHT_DENSE value
2928
- if (customItemHeight && customItemHeight >= MENU_ITEM_HEIGHT_DENSE) {
2929
- return customItemHeight;
2930
- }
2931
- const itemHeightType = typeof menuItemHeight;
2932
- if (itemHeightType === 'number' || itemHeightType === 'string') {
2933
- return menuItemHeight;
2934
- } else {
2935
- return getDefaultItemHeight(isDense);
2936
- }
2937
- };
2938
- const getNumberOfVisibleItems = (numberOfItems, maxVisibleItems) => {
2939
- if (maxVisibleItems && maxVisibleItems > 0) {
2940
- return maxVisibleItems <= numberOfItems ? maxVisibleItems : numberOfItems;
2941
- }
2942
- return DEFAULT_MAX_VISIBLE_ITEMS;
2943
- };
2944
- const calculateMaxHeight = ({
2945
- isDense,
2946
- maxVisibleItems,
2947
- menuItems,
2948
- menuItemHeight
2647
+ const NestedList = ({
2648
+ ariaLabel,
2649
+ anchorEl,
2650
+ 'data-testid': dataTestId,
2651
+ items,
2652
+ menuPlacement,
2653
+ nestedDrawerLeftSpacing,
2654
+ onMenuLeave,
2655
+ open,
2656
+ parentItemIndex,
2657
+ type
2949
2658
  }) => {
2950
- // if menuItemHeight is "auto" set maxHeight as same
2951
- if (typeof menuItemHeight === 'string') {
2952
- return menuItemHeight;
2659
+ const flyoutItemClasses = useStylesWithRootClass(listItemRootClass, flyoutListItemClassName);
2660
+ const flyoutSpanClasses = useStylesWithRootClass(listItemLinkClassName, flyoutItemLinkClassName);
2661
+ if (type === 'expandable') {
2662
+ return jsx(Collapse, Object.assign({
2663
+ in: open,
2664
+ timeout: "auto",
2665
+ unmountOnExit: true
2666
+ }, {
2667
+ children: jsx(DotList, {
2668
+ ariaLabel: ariaLabel,
2669
+ className: nestedListClassName,
2670
+ component: "div",
2671
+ "data-testid": dataTestId,
2672
+ disablePadding: true,
2673
+ items: items
2674
+ }, parentItemIndex)
2675
+ }), void 0);
2676
+ }
2677
+ if (type === 'menu') {
2678
+ const menuItems = items.map((item, index) => {
2679
+ const {
2680
+ href,
2681
+ target,
2682
+ onClick,
2683
+ tooltip,
2684
+ tooltipPlacement = DEFAULT_TOOLTIP_PLACEMENT,
2685
+ text
2686
+ } = item;
2687
+ return {
2688
+ children: jsx(DotTooltip, Object.assign({
2689
+ placement: tooltipPlacement,
2690
+ title: tooltip
2691
+ }, {
2692
+ children: jsx(StyledListItem, Object.assign({
2693
+ className: flyoutItemClasses,
2694
+ component: href && !onClick ? 'a' : null,
2695
+ "data-testid": `${dataTestId}-item-${index}`,
2696
+ href: href,
2697
+ onClick: onClick,
2698
+ target: target
2699
+ }, {
2700
+ children: jsxs("span", Object.assign({
2701
+ className: flyoutSpanClasses
2702
+ }, {
2703
+ children: [item.startIcon, jsx(DotTypography, Object.assign({
2704
+ variant: "body1"
2705
+ }, {
2706
+ children: text
2707
+ }), void 0)]
2708
+ }), void 0)
2709
+ }), `${parentItemIndex}-${index}`)
2710
+ }), `${parentItemIndex}-${index}-tooltip`),
2711
+ classes: '',
2712
+ key: String(index)
2713
+ };
2714
+ });
2715
+ return jsx(DotMenu, {
2716
+ anchorEl: anchorEl,
2717
+ ariaLabel: ariaLabel,
2718
+ className: flyoutMenuClassName,
2719
+ "data-testid": dataTestId,
2720
+ id: CreateUUID(),
2721
+ menuItemHeight: "auto",
2722
+ menuItems: menuItems,
2723
+ menuPlacement: menuPlacement,
2724
+ onLeave: onMenuLeave,
2725
+ open: open
2726
+ }, parentItemIndex);
2727
+ }
2728
+ if (type === 'drawer') {
2729
+ return jsx(StyledDotDrawer, Object.assign({
2730
+ PaperProps: {
2731
+ style: {
2732
+ left: `${nestedDrawerLeftSpacing}px`
2733
+ }
2734
+ },
2735
+ anchor: "left",
2736
+ className: nestedDrawerClassName,
2737
+ "data-testid": "nested-drawer",
2738
+ open: open,
2739
+ variant: "persistent"
2740
+ }, {
2741
+ children: jsx(DotList, {
2742
+ ariaLabel: ariaLabel,
2743
+ className: nestedListClassName,
2744
+ component: "div",
2745
+ "data-testid": dataTestId,
2746
+ disablePadding: true,
2747
+ items: items,
2748
+ width: '100%'
2749
+ }, parentItemIndex)
2750
+ }), void 0);
2953
2751
  }
2954
- // If 'menuItemHeight' is set it will take precedence here
2955
- const itemHeight = menuItemHeight ? menuItemHeight : getDefaultItemHeight(isDense);
2956
- let maxHeight = 0;
2957
- const numberOfVisibleItems = getNumberOfVisibleItems(menuItems.length, maxVisibleItems);
2958
- const visibleItems = menuItems.slice(0, numberOfVisibleItems);
2959
- visibleItems.forEach(({
2960
- height
2961
- }) => {
2962
- const customItemHeight = height ? height : itemHeight;
2963
- // + 3 is for bottom margin of menuItem
2964
- maxHeight += customItemHeight + 3;
2965
- });
2966
- return maxHeight;
2967
- };
2968
- const checkForSubItems = menuItems => menuItems.some(menuItem => menuItem.items && menuItems.length > 0);
2969
- const checkIfSubmenu = anchorElement => {
2970
- if (!anchorElement) return false;
2971
- return anchorElement.classList.contains(listItemWithSubmenuClassName);
2972
- };
2973
- const checkIfMenuItemSelected = (key, selectedKey, activeSubmenu) => {
2974
- return selectedKey === key || activeSubmenu === key;
2975
2752
  };
2976
- const checkForAutoFocus = (autoFocusItem, isFirstItem) => !!(autoFocusItem && isFirstItem);
2977
2753
 
2978
- /**
2979
- * Since this component is used inside 'ClickAwayListener',
2980
- * it needs to be contained within 'forwardRef' function
2981
- */
2982
- const DotMenuList = /*#__PURE__*/forwardRef(({
2983
- autoFocusItem,
2984
- className,
2754
+ const DotInputLabel = ({
2985
2755
  'data-testid': dataTestId,
2986
- dense,
2756
+ disabled: _disabled = false,
2757
+ error: _error = false,
2987
2758
  id,
2988
- maxVisibleItems,
2989
- menuItemHeight,
2990
- menuItems,
2991
- onItemSelect,
2992
- onKeyDown,
2993
- onSubMenuCreate,
2994
- selectedKey
2995
- }, ref) => {
2996
- const rootClasses = useStylesWithRootClass(rootClassName$K, className);
2997
- const [activeSubmenu, setActiveSubmenu] = useState(null);
2998
- const [subItemAnchorEl, setSubItemAnchorEl] = useState(null);
2999
- const openSubmenu = (target, itemKey) => {
3000
- // Set new anchor for submenu and active submenu key
3001
- // so that new submenu can be opened
3002
- setSubItemAnchorEl(target);
3003
- setActiveSubmenu(itemKey);
3004
- };
3005
- const closeActiveSubmenu = () => {
3006
- // We want to clean active submenu state if it exists.
3007
- // This will make previous submenu disappear when
3008
- // hovering to item with no submenu items
3009
- activeSubmenu && setActiveSubmenu(null);
3010
- };
3011
- const getMouseEnterHandler = (itemKey, hasSubmenu) => event => {
3012
- hasSubmenu ? openSubmenu(event.currentTarget, itemKey) : closeActiveSubmenu();
3013
- };
3014
- return jsx(StyledMenuList, Object.assign({
2759
+ label,
2760
+ required
2761
+ }) => {
2762
+ return jsx(StyledInputLabel, Object.assign({
2763
+ "data-testid": dataTestId,
3015
2764
  classes: {
3016
- root: rootClasses
2765
+ root: labelClassName
3017
2766
  },
3018
- "data-testid": dataTestId,
3019
- dense: dense,
3020
- id: id,
3021
- onKeyDown: onKeyDown,
3022
- style: {
3023
- height: calculateMaxHeight({
3024
- isDense: dense,
3025
- maxVisibleItems,
3026
- menuItems,
3027
- menuItemHeight
3028
- })
3029
- }
2767
+ disabled: _disabled,
2768
+ error: _error,
2769
+ htmlFor: id,
2770
+ required: required,
2771
+ shrink: false,
2772
+ variant: "outlined"
3030
2773
  }, {
3031
- children: menuItems.map((item, index) => {
3032
- const {
3033
- ariaLabel: itemAriaLabel,
3034
- children,
3035
- classes,
3036
- disabled,
3037
- divider,
3038
- height,
3039
- items: subItems,
3040
- key
3041
- } = item;
3042
- const itemHeight = calculateItemHeight(dense, height, menuItemHeight);
3043
- const isSelected = checkIfMenuItemSelected(key, selectedKey, activeSubmenu);
3044
- const isFirstItem = index === 0;
3045
- const hasSubmenu = !!subItems;
3046
- const hasAutoFocus = checkForAutoFocus(autoFocusItem, isFirstItem);
3047
- const menuItemClasses = useStylesWithRootClass(listItemClassName$1, hasSubmenu ? listItemWithSubmenuClassName : '', classes ? classes : '');
3048
- const handleClick = event => {
3049
- // Execute select callback only for items which does not have
3050
- // submenu defined. If there is no menu or handler - prevent
3051
- // further propagation of the current event so that click on
3052
- // items with submenu does not close the menu
3053
- !hasSubmenu && onItemSelect ? onItemSelect(event, key) : event.stopPropagation();
3054
- };
3055
- /**
3056
- * If there is submenu, right arrow icon will be added
3057
- * and sub-menu will be rendered
3058
- */
3059
- return jsxs(MenuItem, Object.assign({
3060
- autoFocus: hasAutoFocus,
3061
- "aria-label": itemAriaLabel,
3062
- className: menuItemClasses,
3063
- disabled: disabled,
3064
- disableRipple: hasSubmenu,
3065
- divider: divider,
3066
- onClick: handleClick,
3067
- onMouseEnter: getMouseEnterHandler(key, hasSubmenu),
3068
- ref: ref,
3069
- style: {
3070
- height: itemHeight
3071
- },
3072
- selected: isSelected
3073
- }, {
3074
- children: [children, hasSubmenu && jsx(DotIcon, {
3075
- "data-testid": "dot-item-arrow-icon",
3076
- iconId: "arrow-right"
3077
- }, void 0), hasSubmenu && onSubMenuCreate({
3078
- anchorElement: subItemAnchorEl,
3079
- isOpened: isSelected,
3080
- subMenuId: key,
3081
- subMenuItems: subItems
3082
- })]
3083
- }), key);
3084
- })
2774
+ children: jsx(DotTypography, Object.assign({
2775
+ variant: "subtitle2"
2776
+ }, {
2777
+ children: label
2778
+ }), void 0)
3085
2779
  }), void 0);
3086
- });
2780
+ };
3087
2781
 
3088
- const DotMenu = ({
3089
- anchorEl,
3090
- ariaLabel,
2782
+ const DELAY_MS = 300;
2783
+ const EndAdornment = ({
2784
+ endAdornmentTooltip,
2785
+ error,
2786
+ dataTestId,
2787
+ endIcon,
2788
+ success,
2789
+ warning
2790
+ }) => {
2791
+ const renderIcon = iconType => jsx(DotIcon, {
2792
+ "data-testid": dataTestId && `${dataTestId}-${iconType}-icon`,
2793
+ iconId: `${iconType}-solid`
2794
+ }, void 0);
2795
+ const errorIcon = error && renderIcon('error');
2796
+ const successIcon = success && renderIcon('check');
2797
+ const warningIcon = warning && renderIcon('warning');
2798
+ const endAdornmentIcon = endIcon || errorIcon || warningIcon || successIcon;
2799
+ const styledAdornment = jsx(StyledAdornment, Object.assign({
2800
+ className: `${adornmentIconClassName} end`,
2801
+ position: "end"
2802
+ }, {
2803
+ children: endAdornmentIcon
2804
+ }), void 0);
2805
+ return endAdornmentTooltip ? jsx(DotTooltip, Object.assign({
2806
+ title: endAdornmentTooltip
2807
+ }, {
2808
+ children: styledAdornment
2809
+ }), void 0) : styledAdornment;
2810
+ };
2811
+ const getInitialState = value => ({
2812
+ inputValue: value || ''
2813
+ });
2814
+ const DotInputText = ({
2815
+ autoComplete: _autoComplete = 'off',
2816
+ autoFocus,
3091
2817
  className,
2818
+ defaultValue,
3092
2819
  'data-testid': dataTestId,
3093
- dense: _dense = true,
3094
- disablePortal,
2820
+ disabled: _disabled = false,
2821
+ error: _error = false,
2822
+ endAdornmentTooltip,
2823
+ fullWidth: _fullWidth = true,
2824
+ hasDebounce,
2825
+ helperText,
2826
+ endIcon,
3095
2827
  id,
3096
- loading: _loading = false,
3097
- maxVisibleItems: _maxVisibleItems = DEFAULT_MAX_VISIBLE_ITEMS,
3098
- menuItemHeight,
3099
- menuItems: _menuItems = [],
3100
- menuPlacement: _menuPlacement = 'bottom',
3101
- onLeave,
3102
- onSelect,
3103
- open: _open = false,
3104
- selectedKey
2828
+ inputRef,
2829
+ label,
2830
+ maxRows,
2831
+ minRows,
2832
+ multiline: _multiline = false,
2833
+ name,
2834
+ onBlur,
2835
+ onChange,
2836
+ onFocus,
2837
+ onKeyDown,
2838
+ onMouseUp,
2839
+ persistentLabel,
2840
+ placeholder,
2841
+ readOnly: _readOnly = false,
2842
+ required: _required = false,
2843
+ shrink,
2844
+ startIcon,
2845
+ size: _size = 'small',
2846
+ success,
2847
+ type: _type = 'text',
2848
+ value,
2849
+ warning: _warning = false
3105
2850
  }) => {
3106
- const rootClasses = useStylesWithRootClass(rootClassName$L, className, _loading ? 'loading' : '');
3107
- const isSubmenu = checkIfSubmenu(anchorEl);
3108
- const hasSubItems = checkForSubItems(_menuItems);
3109
- // Timeout object is customizable when Menu component is either submenu
3110
- // (it is opened within parent menu) or it contains at least one item which
3111
- // has sub-items. This is done because when multi-level menu is closing it
3112
- // will first close the parent and only then child menus - which looks
3113
- // a bit weird - so here I'm giving it exit value of 0 so that it looks like
3114
- // they all close at the same time. For "normal" menus, timeout is unnecessary.
3115
- const timeout = isSubmenu || hasSubItems ? {
3116
- exit: 0,
3117
- enter: 300
3118
- } : undefined;
3119
- const handleSelect = (event, itemKey) => {
3120
- onLeave && onLeave(event);
3121
- onSelect && onSelect(event, id, itemKey);
3122
- };
3123
- const handleListKeyDown = event => {
3124
- if (onLeave && event.key === 'Tab') {
3125
- event.preventDefault();
3126
- onLeave(event);
3127
- }
3128
- };
3129
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3130
- const handleClickAway = event => {
3131
- if (onLeave && (!anchorEl || !anchorEl.contains(event.currentTarget))) {
3132
- onLeave(event);
2851
+ const hasError = _error && errorClassName;
2852
+ const hasWarning = !_error && _warning && warningClassName;
2853
+ const hasSuccess = !_error && !_warning && success && successClassName;
2854
+ const hasEndAdornmentIcon = endIcon || _error || hasWarning || hasSuccess;
2855
+ // This state is used only with debounce feature enabled
2856
+ const [inputTextState, setInputTextState] = useState(hasDebounce && getInitialState(value));
2857
+ const rootStyles = useStylesWithRootClass(rootClassName$10, hasError, hasWarning, hasSuccess, _readOnly ? 'read-only' : '');
2858
+ // Used to control text value from the consumer component
2859
+ // when debounce feature is enabled
2860
+ useEffect(() => {
2861
+ if (hasDebounce && value !== inputTextState.inputValue) {
2862
+ setInputTextState(getInitialState(value));
3133
2863
  }
2864
+ }, [value]);
2865
+ // Improve performance by avoiding callback execution
2866
+ // on each keystroke (if debounce feature is active)
2867
+ useEffect(() => {
2868
+ // Do not proceed if debounce feature is turned
2869
+ // off or there is no event defined
2870
+ if (!hasDebounce || !inputTextState || !inputTextState.changeEvent || !onChange) return;
2871
+ const handler = setTimeout(() => {
2872
+ onChange(inputTextState.changeEvent);
2873
+ }, DELAY_MS);
2874
+ return () => clearTimeout(handler);
2875
+ }, [inputTextState]);
2876
+ const handleChange = e => {
2877
+ // We need to have control over change event and input value separately
2878
+ // so that we can set initial state via 'value' prop (if needed)
2879
+ hasDebounce ? setInputTextState({
2880
+ changeEvent: e,
2881
+ inputValue: e.target.value
2882
+ }) : onChange === null || onChange === void 0 ? void 0 : onChange(e);
3134
2883
  };
3135
- return jsx(StyledPopper, Object.assign({
3136
- anchorEl: anchorEl,
3137
- "aria-label": ariaLabel,
3138
- className: rootClasses,
3139
- "data-testid": dataTestId,
3140
- disablePortal: disablePortal,
3141
- open: _open,
3142
- placement: _menuPlacement,
3143
- role: undefined,
3144
- transition: true
3145
- }, {
3146
- children: ({
3147
- TransitionProps,
3148
- placement
3149
- }) => jsx(Fade, Object.assign({}, TransitionProps, {
3150
- style: {
3151
- transformOrigin: placement === 'bottom' ? 'center top' : 'center bottom'
3152
- },
3153
- timeout: timeout
2884
+ const inputTextValue = hasDebounce ? inputTextState.inputValue : value;
2885
+ // Don't use default value when debounce feature is enabled because
2886
+ // in that case component is controlled
2887
+ const defaultInputValue = hasDebounce ? undefined : defaultValue;
2888
+ const startAdornmentIcon = () => {
2889
+ if (!startIcon) return null;
2890
+ return jsx(StyledAdornment, Object.assign({
2891
+ className: `${adornmentIconClassName} start`,
2892
+ position: "start"
3154
2893
  }, {
3155
- children: jsx(Paper, {
3156
- children: jsx(ClickAwayListener, Object.assign({
3157
- onClickAway: handleClickAway
3158
- }, {
3159
- children: _loading ? jsx(DotProgress, {
3160
- "data-testid": "loading-indicator",
3161
- tooltip: "Loading Data...",
3162
- value: 20
3163
- }, void 0) : jsx(DotMenuList, {
3164
- autoFocusItem: _open,
3165
- "data-testid": `${dataTestId}-menu`,
3166
- dense: _dense,
3167
- id: id,
3168
- maxVisibleItems: _maxVisibleItems,
3169
- menuItemHeight: menuItemHeight,
3170
- menuItems: _menuItems,
3171
- onItemSelect: handleSelect,
3172
- onKeyDown: handleListKeyDown,
3173
- onSubMenuCreate: ({
3174
- anchorElement,
3175
- isOpened,
3176
- subMenuId,
3177
- subMenuItems
3178
- }) => jsx(DotMenu, {
3179
- anchorEl: anchorElement,
3180
- menuPlacement: "right-start",
3181
- id: subMenuId,
3182
- menuItems: subMenuItems,
3183
- open: isOpened,
3184
- onLeave: onLeave,
3185
- onSelect: onSelect,
3186
- selectedKey: selectedKey
3187
- }, void 0),
3188
- selectedKey: selectedKey
3189
- }, void 0)
3190
- }), void 0)
3191
- }, void 0)
3192
- }), void 0)
2894
+ children: startIcon
2895
+ }), void 0);
2896
+ };
2897
+ const endAdornmentIcon = () => {
2898
+ if (!hasEndAdornmentIcon) return null;
2899
+ return jsx(EndAdornment, Object.assign({}, {
2900
+ endAdornmentTooltip,
2901
+ error: _error,
2902
+ dataTestId,
2903
+ endIcon,
2904
+ success,
2905
+ warning: _warning
2906
+ }), void 0);
2907
+ };
2908
+ const wrapperClassName = useStylesWithRootClass(_fullWidth !== false ? 'dot-input-text--fullwidth' : '', className);
2909
+ return jsxs(StyledTextFieldContainer, Object.assign({
2910
+ className: wrapperClassName
2911
+ }, {
2912
+ children: [persistentLabel && jsx(DotInputLabel, Object.assign({}, {
2913
+ disabled: _disabled,
2914
+ error: _error,
2915
+ id,
2916
+ label,
2917
+ required: _required
2918
+ }), void 0), jsx(StyledTextField, {
2919
+ InputProps: {
2920
+ startAdornment: startAdornmentIcon(),
2921
+ endAdornment: endAdornmentIcon()
2922
+ },
2923
+ "aria-label": name,
2924
+ autoComplete: _autoComplete,
2925
+ autoFocus: autoFocus,
2926
+ classes: {
2927
+ root: rootStyles
2928
+ },
2929
+ defaultValue: defaultInputValue,
2930
+ disabled: _disabled,
2931
+ error: _error,
2932
+ focused: _readOnly ? false : undefined,
2933
+ fullWidth: _fullWidth,
2934
+ helperText: helperText,
2935
+ id: id,
2936
+ InputLabelProps: {
2937
+ shrink: _type === 'date' ? true : shrink
2938
+ },
2939
+ inputProps: {
2940
+ 'data-testid': dataTestId,
2941
+ className: 'dot-input',
2942
+ readOnly: _readOnly
2943
+ },
2944
+ inputRef: inputRef,
2945
+ label: persistentLabel ? null : label,
2946
+ multiline: _multiline,
2947
+ name: name,
2948
+ onBlur: onBlur,
2949
+ onChange: hasDebounce ? handleChange : onChange,
2950
+ onFocus: onFocus,
2951
+ onKeyDown: onKeyDown,
2952
+ onMouseUp: onMouseUp,
2953
+ placeholder: placeholder,
2954
+ required: _required,
2955
+ minRows: _multiline ? minRows : null,
2956
+ maxRows: _multiline ? maxRows : null,
2957
+ size: _size,
2958
+ type: _type,
2959
+ value: inputTextValue,
2960
+ variant: "outlined"
2961
+ }, void 0)]
3193
2962
  }), void 0);
3194
2963
  };
3195
2964
 
3196
- const CreateUUID = () => {
3197
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
3198
- const r = Math.random() * 16 | 0,
3199
- v = c === 'x' ? r : r & 0x3 | 0x8;
3200
- return v.toString(16);
3201
- });
3202
- };
2965
+ const rootClassName$M = 'dot-search-input';
2966
+ const StyledSearchInput = styled.span.withConfig({
2967
+ displayName: "SearchInputstyles__StyledSearchInput",
2968
+ componentId: "qlwzku-0"
2969
+ })(["", ""], () => css(["&.", "{}"], rootClassName$M));
3203
2970
 
3204
- const fadeIn = keyframes(["from{opacity:0;}to{opacity:1;}"]);
3205
- const StyledDotDrawer = styled(DotDrawer).withConfig({
3206
- displayName: "NestedListstyles__StyledDotDrawer",
3207
- componentId: "sc-1wwoqos-0"
2971
+ function SearchInput({
2972
+ 'data-testid': dataTestId,
2973
+ autoFocus = true,
2974
+ className,
2975
+ disabled = false,
2976
+ onChange,
2977
+ onClear,
2978
+ placeholder = 'Search',
2979
+ tooltip = null,
2980
+ value
2981
+ }) {
2982
+ const rootClasses = useStylesWithRootClass(rootClassName$M, className);
2983
+ const [searchText, setSearchText] = useState(value);
2984
+ let previousSearchText = '';
2985
+ const handleChange = useCallback(event => {
2986
+ previousSearchText = event.target.value;
2987
+ setSearchText(event.target.value);
2988
+ // Timeout is to give user a chance to finish typing before refreshing data.
2989
+ setTimeout(function () {
2990
+ if (onChange && event.target.value === previousSearchText) {
2991
+ onChange(event.target.value);
2992
+ }
2993
+ }, 500);
2994
+ }, [onChange]);
2995
+ const handleClear = useCallback(() => {
2996
+ setSearchText('');
2997
+ onClear && onClear();
2998
+ }, [onClear]);
2999
+ const searchIcon = jsx(DotIcon, {
3000
+ className: "search-icon",
3001
+ iconId: "search"
3002
+ }, void 0);
3003
+ const clearSearchIcon = jsx(DotIconButton, {
3004
+ iconId: "close",
3005
+ onClick: handleClear,
3006
+ size: "small",
3007
+ tooltip: "Clear search text"
3008
+ }, void 0);
3009
+ return jsx(StyledSearchInput, Object.assign({
3010
+ className: rootClasses
3011
+ }, {
3012
+ children: jsx(DotTooltip, Object.assign({
3013
+ placement: "bottom",
3014
+ title: tooltip
3015
+ }, {
3016
+ children: jsx(DotInputText, {
3017
+ "data-testid": dataTestId,
3018
+ autoFocus: autoFocus,
3019
+ className: "search-text",
3020
+ disabled: disabled,
3021
+ endIcon: (searchText === null || searchText === void 0 ? void 0 : searchText.length) > 0 ? clearSearchIcon : null,
3022
+ id: "app-instance-search-text",
3023
+ name: "app-instance-search-text",
3024
+ onChange: handleChange,
3025
+ placeholder: placeholder,
3026
+ startIcon: searchIcon,
3027
+ value: searchText
3028
+ }, void 0)
3029
+ }), void 0)
3030
+ }), void 0);
3031
+ }
3032
+
3033
+ const rootClassName$L = 'dot-copy-button';
3034
+ const StyledCopyButton = styled.span.withConfig({
3035
+ displayName: "CopyButtonstyles__StyledCopyButton",
3036
+ componentId: "sc-18ff0u-0"
3208
3037
  })(["", ""], ({
3209
- open
3210
- }) => css(["&.", "{.dot-drawer-paper{z-index:", ";animation:", ";}}"], nestedDrawerClassName, open ? levelFirst : levelBottom, open && css(["", " 0.2s cubic-bezier(1,0,1,.01);"], fadeIn)));
3038
+ theme
3039
+ }) => css(["&.", "{.copied-to-clipboard{color:", ";}}"], rootClassName$L, theme.palette.success[400]));
3211
3040
 
3212
- const DEFAULT_TOOLTIP_PLACEMENT = 'top-start';
3213
- const DotListDivider = ({
3214
- item,
3215
- index
3216
- }) => {
3217
- if (item.text) {
3218
- return jsx(ListSubheader, Object.assign({
3219
- disableSticky: true
3220
- }, {
3221
- children: jsx(DotTypography, Object.assign({
3222
- variant: "overline"
3223
- }, {
3224
- children: item.text
3225
- }), void 0)
3226
- }), void 0);
3227
- }
3228
- return jsx(Divider, {
3229
- "aria-hidden": true,
3230
- "data-testid": `divider-${index}`
3231
- }, void 0);
3232
- };
3233
- const DotList = ({
3234
- ariaLabel,
3235
- children,
3236
- className,
3237
- component: _component = 'ul',
3238
- 'data-testid': dataTestId,
3239
- dense: _dense = false,
3240
- disablePadding: _disablePadding = false,
3241
- items: _items = [],
3242
- menuPlacement: _menuPlacement = 'right-start',
3243
- nestedDrawerLeftSpacing: _nestedDrawerLeftSpacing = 240,
3244
- nestedListType: _nestedListType = 'expandable',
3245
- width: _width = 240
3041
+ const DotCopyButton = ({
3042
+ ariaLabel: _ariaLabel = 'Copy to clipboard',
3043
+ copiedTooltip: _copiedTooltip = 'Copied!',
3044
+ copyTooltip: _copyTooltip = 'Copy to clipboard',
3045
+ 'data-testid': dataTestId = 'dot-copy-button',
3046
+ value
3246
3047
  }) => {
3247
- const rootClasses = useStylesWithRootClass(rootClassName$O, className);
3248
- const listWidth = typeof _width === 'number' ? `${_width}px` : _width;
3249
- const listRef = useRef();
3250
- const [listItemIndex, setListItemIndex] = useState(null);
3251
- const updateSelectedListItem = currentIndex => {
3252
- currentIndex === listItemIndex ? setListItemIndex(null) : setListItemIndex(currentIndex);
3253
- };
3254
- return jsxs(StyledList, Object.assign({
3255
- "aria-label": ariaLabel,
3256
- classes: {
3257
- root: rootClasses
3258
- },
3259
- component: _component,
3260
- "data-testid": dataTestId,
3261
- dense: _dense,
3262
- disablePadding: _disablePadding,
3263
- ref: listRef,
3264
- style: {
3265
- width: listWidth
3048
+ const [showCopiedIcon, setShowCopiedIcon] = useState(false);
3049
+ const copyToClipboard = () => {
3050
+ // The check for navigator.clipboard.writeText is because this function is
3051
+ // only supported in secure contexts (https). This will always be the case in
3052
+ // production but not when running locally.
3053
+ if (!navigator.clipboard || !navigator.clipboard.writeText) {
3054
+ console.warn('Copy to clipboard is only supported in secure context (https)', value);
3055
+ } else {
3056
+ navigator.clipboard.writeText(value);
3266
3057
  }
3267
- }, {
3268
- children: [_items.map((item, index) => {
3269
- const handleListItemClick = e => {
3270
- var _a;
3271
- updateSelectedListItem(index);
3272
- (_a = item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, e);
3273
- };
3274
- const handleMenuLeave = event => {
3275
- var _a, _b;
3276
- // Remove index only if clicked element is not found within the list
3277
- if (!((_a = listRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
3278
- setListItemIndex(null);
3279
- (_b = item.onMenuLeave) === null || _b === void 0 ? void 0 : _b.call(item, event);
3280
- }
3281
- };
3282
- if (item.child) {
3283
- return jsx(Fragment$1, {
3284
- children: item.child
3285
- }, `item-child-${index}`);
3058
+ };
3059
+ const copy = () => {
3060
+ copyToClipboard();
3061
+ setShowCopiedIcon(true);
3062
+ setTimeout(function () {
3063
+ setShowCopiedIcon(false);
3064
+ }, 3000);
3065
+ return false;
3066
+ };
3067
+ return jsxs(StyledCopyButton, Object.assign({
3068
+ className: rootClassName$L,
3069
+ "data-testid": dataTestId
3070
+ }, {
3071
+ children: [!showCopiedIcon && jsx(DotIconButton, {
3072
+ ariaLabel: _ariaLabel,
3073
+ "data-testid": `${dataTestId}-button`,
3074
+ iconId: "duplicate",
3075
+ onClick: copy,
3076
+ size: "small",
3077
+ tooltip: _copyTooltip
3078
+ }, void 0), showCopiedIcon && jsx(DotIcon, {
3079
+ className: "copied-to-clipboard",
3080
+ "data-testid": `${dataTestId}-icon`,
3081
+ fontSize: "small",
3082
+ iconId: "check-solid",
3083
+ tooltip: _copiedTooltip
3084
+ }, void 0)]
3085
+ }), void 0);
3086
+ };
3087
+
3088
+ var img$6 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23279FEA'/%3e%3cpath d='M12.4332 16.3533V14.8333H11.5665V16.3533L10.7432 15.8933L9.85651 16.4033L11.9998 17.6366L14.1932 16.3733L13.3332 15.8766L12.4332 16.3533Z' fill='white'/%3e%3cpath d='M7.99328 10.1866L9.24661 10.9132L9.67995 10.1399L8.36995 9.4299L9.09328 9.01657V8.03323L7.11328 9.18323L7.11661 11.5532L7.99328 11.0566V10.1866Z' fill='white'/%3e%3cpath d='M14.6934 10.9133L15.9934 10.1733L15.99 11.0566L16.8867 11.5599V9.1766L14.81 7.98993L14.7767 8.9566L15.6167 9.45326L14.29 10.0799L14.6934 10.9133Z' fill='white'/%3e%3cpath d='M16.8801 12.5435L16.0001 12.0402V12.0935V13.7068L12.4167 11.6868V7.61015L13.9667 8.49015V7.51682L12.0001 6.35349L9.95006 7.52348V8.52348L11.4967 7.63015V11.6868L8.00006 13.8168V12.0202L7.12006 12.5235V14.8202L8.96672 15.8502L9.86672 15.3335L8.40006 14.5268L12.0001 12.4368L15.5567 14.5035L14.1301 15.3268L15.0567 15.8701L16.8701 14.8268L16.8801 12.5435Z' fill='white'/%3e%3c/svg%3e";
3089
+
3090
+ var img$5 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23279FEA'/%3e%3cpath d='M14.1867 11.2667L12.1634 10.0833L10.1367 11.2667V13.62L12.1634 14.7867L14.1867 13.62V11.2667Z' fill='white'/%3e%3cpath d='M8.43666 12.0001L7.47333 11.1501V15.1667L10.41 16.8367V15.7034L8.43666 14.5401V12.0001Z' fill='white'/%3e%3cpath d='M15.8965 12V14.5833L13.9632 15.7033V16.9367L16.8532 15.1533V11.0967L15.8965 12Z' fill='white'/%3e%3cpath d='M12.1565 8.13333L14.7165 9.61333L15.4165 8.89L12.1565 7L8.87988 8.90667L9.57988 9.63333L12.1565 8.13333Z' fill='white'/%3e%3c/svg%3e";
3091
+
3092
+ var img$4 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%2333D389'/%3e%3cpath d='M17.0033 7.62322H16.4567C16.3925 7.62863 16.3324 7.65679 16.2871 7.70264C16.2419 7.74848 16.2146 7.80898 16.21 7.87322V9.14322C15.7432 8.43248 15.1064 7.84955 14.3572 7.44732C13.6081 7.04509 12.7703 6.8363 11.92 6.83989C11.0845 6.84475 10.2627 7.05243 9.52515 7.44508C8.78763 7.83772 8.15649 8.40359 7.68598 9.09405C7.21547 9.7845 6.91966 10.5789 6.82398 11.4089C6.72831 12.2389 6.83562 13.0798 7.13669 13.8592C7.43777 14.6386 7.92361 15.3332 8.55245 15.8834C9.18128 16.4335 9.93431 16.8227 10.7468 17.0176C11.5593 17.2124 12.4069 17.207 13.2169 17.0019C14.0269 16.7967 14.7749 16.398 15.3967 15.8399C15.4257 15.8182 15.4492 15.79 15.4654 15.7576C15.4816 15.7252 15.49 15.6894 15.49 15.6532C15.49 15.617 15.4816 15.5813 15.4654 15.5489C15.4492 15.5165 15.4257 15.4883 15.3967 15.4666L14.9833 15.0532C14.9369 15.0135 14.8778 14.9917 14.8167 14.9917C14.7556 14.9917 14.6965 15.0135 14.65 15.0532C13.9076 15.7352 12.9312 16.1052 11.9233 16.0866C11.1892 16.087 10.4684 15.8897 9.83687 15.5154C9.20531 15.141 8.68627 14.6034 8.33429 13.9591C7.98231 13.3148 7.81039 12.5876 7.83662 11.8539C7.86284 11.1202 8.08624 10.4071 8.48332 9.78959C8.8804 9.17207 9.4365 8.67292 10.0932 8.34461C10.7499 8.0163 11.4828 7.87095 12.2151 7.92384C12.9474 7.97674 13.6519 8.22592 14.2545 8.6452C14.8572 9.06448 15.3358 9.63837 15.64 10.3066H14.1467C14.0828 10.3112 14.0227 10.3387 13.9774 10.384C13.9321 10.4293 13.9046 10.4893 13.9 10.5532V11.0466C13.9046 11.1104 13.9321 11.1705 13.9774 11.2158C14.0227 11.2611 14.0828 11.2886 14.1467 11.2932H17C17.0639 11.2886 17.124 11.2611 17.1693 11.2158C17.2146 11.1705 17.242 11.1104 17.2467 11.0466V7.87322C17.2422 7.8095 17.2154 7.74942 17.1708 7.70364C17.1263 7.65787 17.0669 7.62938 17.0033 7.62322Z' fill='white'/%3e%3cpath d='M12.1232 9.39987C12.1667 9.39747 12.2077 9.37914 12.2384 9.34839C12.2692 9.31764 12.2875 9.27662 12.2899 9.2332C12.2899 9.2332 12.3399 8.8332 12.3399 8.69987C12.3399 8.56653 12.2499 8.4932 12.1666 8.48987C11.5045 8.45232 10.8457 8.60791 10.2703 8.93771C9.69497 9.26752 9.22779 9.75734 8.92557 10.3477C8.62335 10.938 8.4991 11.6034 8.56792 12.263C8.63675 12.9226 8.89568 13.548 9.31325 14.0632C9.83849 14.7239 10.5905 15.1658 11.4232 15.3032C11.5166 15.3032 11.5999 15.2632 11.6299 15.1365C11.6299 15.1365 11.6999 14.8032 11.7132 14.6832C11.7233 14.639 11.7157 14.5927 11.692 14.554C11.6684 14.5154 11.6305 14.4876 11.5866 14.4765C11.225 14.4227 10.8806 14.2869 10.5795 14.0795C10.2785 13.8721 10.029 13.5986 9.84992 13.2799C9.64046 12.9274 9.51393 12.5318 9.47992 12.1232C9.44986 11.7648 9.49697 11.4042 9.61806 11.0655C9.73915 10.7269 9.93142 10.4181 10.1819 10.1601C10.4324 9.90199 10.7353 9.70061 11.0702 9.56947C11.405 9.43834 11.7641 9.38051 12.1232 9.39987Z' fill='white'/%3e%3cpath d='M13.9433 13.1568C13.96 13.1389 13.9724 13.1175 13.9796 13.0942C13.9868 13.0708 13.9885 13.0461 13.9846 13.0219C13.9808 12.9978 13.9714 12.9749 13.9573 12.9549C13.9432 12.9349 13.9247 12.9185 13.9033 12.9068L13.6133 12.7001C13.5739 12.6762 13.5272 12.6674 13.4818 12.6754C13.4364 12.6833 13.3955 12.7075 13.3666 12.7434C13.2321 12.9033 13.0642 13.0318 12.8747 13.12C12.6853 13.2082 12.4789 13.2538 12.2699 13.2538C12.061 13.2538 11.8546 13.2082 11.6651 13.12C11.4757 13.0318 11.3078 12.9033 11.1733 12.7434C11.1277 12.6913 11.0864 12.6356 11.0499 12.5768C10.9268 12.3776 10.8582 12.1495 10.8512 11.9155C10.8442 11.6814 10.8989 11.4496 11.0099 11.2434C11.0314 11.2102 11.0389 11.1699 11.0308 11.1312C11.0227 11.0925 10.9996 11.0585 10.9666 11.0368L10.6333 10.7901C10.5891 10.7715 10.5396 10.7697 10.4942 10.7851C10.4487 10.8004 10.4105 10.8319 10.3866 10.8734C10.2376 11.1465 10.153 11.45 10.1391 11.7608C10.1253 12.0716 10.1825 12.3815 10.3066 12.6668C10.4127 12.938 10.5831 13.1794 10.8033 13.3701C11.1902 13.7461 11.7104 13.9534 12.2499 13.9468C12.5743 13.9565 12.8964 13.8902 13.1905 13.753C13.4845 13.6158 13.7424 13.4116 13.9433 13.1568Z' fill='white'/%3e%3c/svg%3e";
3093
+
3094
+ var img$3 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23279FEA'/%3e%3cpath d='M17.6865 10.0334C17.3062 9.49067 16.7772 9.06934 16.1632 8.82008C15.6426 8.61932 15.0801 8.55138 14.5267 8.62237C13.9733 8.69337 13.4462 8.90108 12.9932 9.22674C12.4991 9.62868 12.0519 10.0849 11.6598 10.5867L11.4232 10.8534L13.0198 11.5434L13.1498 11.4067C13.4002 11.1158 13.6697 10.8419 13.9565 10.5867C14.1891 10.4177 14.4599 10.3085 14.7448 10.269C15.0297 10.2294 15.3199 10.2607 15.5898 10.3601C15.916 10.4798 16.1929 10.7051 16.3765 11.0001C16.5305 11.2108 16.6383 11.4516 16.6932 11.7067C16.7448 11.9619 16.7448 12.2249 16.6932 12.4801C16.6319 12.8145 16.4783 13.125 16.2498 13.3767C16.0471 13.5809 15.7972 13.7319 15.5221 13.8162C15.2471 13.9005 14.9554 13.9156 14.6732 13.8601C14.318 13.7558 13.9714 13.6243 13.6365 13.4667L13.4598 13.3967L12.3032 14.6934L12.6365 14.8367C13.196 15.1144 13.7809 15.3376 14.3832 15.5034C14.841 15.5831 15.3102 15.5706 15.7632 15.4667C16.4116 15.3301 17.0012 14.9945 17.4498 14.5067C17.907 14.0252 18.2099 13.4182 18.3198 12.7634C18.4116 12.2979 18.4116 11.8189 18.3198 11.3534C18.186 10.8803 17.9717 10.4338 17.6865 10.0334Z' fill='white'/%3e%3cpath d='M12.8401 13.0499L11.2468 12.3599L11.1168 12.4966C10.8669 12.7942 10.5962 13.0738 10.3068 13.3332C10.0741 13.5023 9.80337 13.6115 9.51849 13.651C9.2336 13.6905 8.94336 13.6593 8.67345 13.5599C8.35219 13.4397 8.07852 13.2187 7.89345 12.9299C7.74251 12.7191 7.63591 12.4798 7.58012 12.2266C7.51653 11.9342 7.52262 11.6311 7.5979 11.3415C7.67318 11.052 7.81553 10.7842 8.01345 10.5599C8.2156 10.3551 8.46564 10.2039 8.74095 10.1201C9.01626 10.0363 9.30813 10.0225 9.59012 10.0799C9.94807 10.1781 10.2971 10.3063 10.6335 10.4632L10.8101 10.5299L11.9668 9.23324L11.6735 9.11324C11.1141 8.8326 10.5278 8.60924 9.92345 8.44657C9.37154 8.32869 8.79848 8.35611 8.26035 8.52614C7.72222 8.69617 7.23744 9.00299 6.85345 9.41657C6.38782 9.89208 6.08347 10.5019 5.98345 11.1599C5.88532 11.6248 5.88532 12.105 5.98345 12.5699C6.08588 13.0347 6.28211 13.4736 6.56012 13.8599C6.92983 14.4125 7.46217 14.8365 8.08345 15.0732C8.69864 15.3134 9.37049 15.369 10.0168 15.2332C10.4725 15.1299 10.9023 14.9348 11.2801 14.6599C11.7741 14.258 12.2214 13.8018 12.6135 13.2999L12.8401 13.0499Z' fill='white'/%3e%3c/svg%3e";
3095
+
3096
+ var img$2 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23F7B731'/%3e%3cpath d='M17.0168 10.4836C16.8598 10.4819 16.704 10.5111 16.5583 10.5697C16.4126 10.6282 16.2799 10.715 16.1679 10.8249C16.0558 10.9348 15.9665 11.0658 15.9051 11.2103C15.8437 11.3548 15.8114 11.51 15.8101 11.667C15.8125 11.8887 15.8759 12.1056 15.9934 12.2936L15.3268 13.0036C15.1062 12.8766 14.8516 12.8214 14.5982 12.8459C14.3449 12.8704 14.1055 12.9733 13.9134 13.1403L13.2168 12.667C13.3204 12.3753 13.3514 12.0627 13.307 11.7564C13.2626 11.45 13.1441 11.1591 12.9619 10.9089C12.7796 10.6587 12.5391 10.4567 12.2611 10.3204C11.9832 10.1842 11.6762 10.1178 11.3668 10.127C10.9257 10.1237 10.4963 10.268 10.1468 10.537L9.2801 9.74364C9.38078 9.56935 9.43368 9.37158 9.43343 9.1703C9.43084 9.01345 9.39725 8.85866 9.33461 8.71484C9.27197 8.57101 9.18151 8.44099 9.06844 8.33225C8.95537 8.22352 8.82191 8.13821 8.67575 8.08124C8.52958 8.02427 8.3736 7.99677 8.21677 8.0003C7.89915 8.00103 7.59426 8.12525 7.36658 8.34671C7.13891 8.56817 7.00628 8.86949 6.99677 9.18697C6.99848 9.34467 7.03153 9.50046 7.09399 9.64528C7.15645 9.7901 7.24707 9.92106 7.36059 10.0305C7.4741 10.14 7.60825 10.2259 7.75524 10.283C7.90222 10.3402 8.0591 10.3676 8.21677 10.3636C8.43906 10.3609 8.65657 10.2987 8.84677 10.1836L9.71343 10.977C9.49991 11.2949 9.3884 11.6704 9.39376 12.0533C9.39912 12.4363 9.5211 12.8085 9.74343 13.1203L9.07677 13.8303C8.87595 13.7162 8.64759 13.6597 8.41677 13.667C8.18607 13.6729 7.96224 13.7467 7.77327 13.8791C7.5843 14.0116 7.43859 14.1968 7.35437 14.4117C7.27015 14.6265 7.25115 14.8615 7.29975 15.087C7.34836 15.3126 7.46241 15.5189 7.62763 15.68C7.79286 15.8411 8.00192 15.9499 8.22867 15.9928C8.45542 16.0357 8.68978 16.0108 8.90244 15.9212C9.11509 15.8315 9.2966 15.6812 9.42425 15.4889C9.5519 15.2967 9.62002 15.0711 9.6201 14.8403C9.61839 14.6452 9.57041 14.4533 9.4801 14.2803L10.1468 13.5703C10.5613 13.8772 11.0792 14.0102 11.5902 13.9411C12.1013 13.872 12.5653 13.6062 12.8834 13.2003L13.5501 13.637C13.5048 13.7597 13.4811 13.8894 13.4801 14.0203C13.4963 14.3289 13.6304 14.6196 13.8546 14.8323C14.0788 15.045 14.376 15.1636 14.6851 15.1636C14.9942 15.1636 15.2914 15.045 15.5156 14.8323C15.7398 14.6196 15.8739 14.3289 15.8901 14.0203C15.8923 13.8081 15.8333 13.5998 15.7201 13.4203L16.3868 12.7103C16.5613 12.81 16.7591 12.8617 16.9601 12.8603C17.1212 12.8706 17.2827 12.8481 17.4348 12.794C17.5869 12.74 17.7264 12.6555 17.8448 12.5458C17.9633 12.4361 18.0581 12.3035 18.1237 12.156C18.1893 12.0085 18.2241 11.8492 18.2261 11.6878C18.2282 11.5264 18.1974 11.3662 18.1356 11.2171C18.0737 11.068 17.9822 10.933 17.8666 10.8203C17.751 10.7077 17.6137 10.6198 17.463 10.5619C17.3123 10.504 17.1514 10.4774 16.9901 10.4836H17.0168ZM11.3501 13.2436C11.1161 13.2377 10.8891 13.163 10.6973 13.0287C10.5056 12.8944 10.3578 12.7065 10.2723 12.4886C10.1868 12.2707 10.1675 12.0325 10.2167 11.8036C10.266 11.5748 10.3816 11.3656 10.5492 11.2021C10.7167 11.0387 10.9288 10.9283 11.1588 10.8848C11.3887 10.8412 11.6264 10.8665 11.8422 10.9574C12.0579 11.0483 12.242 11.2007 12.3714 11.3957C12.5009 11.5907 12.57 11.8196 12.5701 12.0536C12.5657 12.3719 12.4357 12.6756 12.2085 12.8985C11.9812 13.1214 11.6751 13.2454 11.3568 13.2436H11.3501Z' fill='white'/%3e%3c/svg%3e";
3097
+
3098
+ var img$1 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23205AB7'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M16.0859 8.30868C16.4108 8.42839 16.6831 8.6593 16.8542 8.96074L16.8628 8.97583L16.8705 8.99134C17.0174 9.28464 17.0775 9.61353 17.0441 9.93936C17.0123 11.03 16.8132 12.1093 16.4535 13.1395L16.4528 13.1415C16.1368 14.0377 15.4456 15.1335 14.6589 16.0108C14.2622 16.4533 13.8228 16.8611 13.3705 17.1668C12.9284 17.4656 12.4155 17.7067 11.8835 17.7262L11.8597 17.7271L11.8358 17.7262C11.291 17.7072 10.7708 17.4701 10.3204 17.1682C9.86244 16.8612 9.42376 16.4516 9.03057 16.0079C8.24999 15.1271 7.57941 14.0321 7.26533 13.1415L7.2645 13.1391C6.90532 12.1083 6.70674 11.0285 6.67566 9.93751C6.64229 9.61177 6.70236 9.28297 6.84922 8.98974L6.85684 8.97453L6.86522 8.95974C7.03585 8.65846 7.30747 8.42744 7.63179 8.30728L11.3874 6.76891C11.4429 6.74689 11.4996 6.7281 11.5571 6.71254C11.7538 6.6514 11.9644 6.6514 12.161 6.71254C12.2186 6.7281 12.2753 6.74693 12.3307 6.76895L12.3374 6.77159L16.0859 8.30868ZM11.9735 7.35255C11.8994 7.32695 11.8188 7.32695 11.7447 7.35255C11.7069 7.36213 11.6698 7.37415 11.6335 7.38855L7.87245 8.92913C7.69157 8.99369 7.53996 9.12117 7.44531 9.28828C7.35196 9.47467 7.31578 9.6845 7.34132 9.89139C7.36791 10.9234 7.55437 11.9449 7.89404 12.9198C8.45396 14.5075 10.3737 17.008 11.8591 17.06C13.2749 17.008 15.2642 14.5075 15.8241 12.9198C16.1642 11.9455 16.3512 10.9245 16.3784 9.89299C16.404 9.6861 16.3678 9.47627 16.2745 9.28988C16.1794 9.12247 16.0272 8.99495 15.8457 8.93073L12.0847 7.38855C12.0484 7.37415 12.0113 7.36213 11.9735 7.35255Z' fill='white'/%3e%3cpath d='M11.8631 8.29559L8.22357 9.77059V10.8904L11.8631 9.33705L15.5025 10.8904V9.77059L11.8631 8.29559Z' fill='white'/%3e%3cpath d='M10.6184 15.718C10.7942 16.0092 11.3957 16.4678 11.8633 16.4774C12.3078 16.4678 12.9324 16.0092 13.108 15.718C13.2835 15.4268 10.4426 15.427 10.6184 15.718Z' fill='white'/%3e%3c/svg%3e";
3099
+
3100
+ var img = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='-8 -8 40 40' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M19.7521 0.348161H20.3976V2.23694H20.7722L20.7752 0.351063H21.4208V0.00290065L19.7521 0V0.348161Z' fill='%232B2B2B'/%3e %3cpath d='M22.31 0.00290065H21.7223V2.23114H22.0785L22.0816 0.438104H22.0877L22.718 2.23404H22.9799L23.6224 0.441005H23.6285L23.6255 2.23404H23.997L24 0.00290065H23.4093L22.8642 1.58994H22.8551L22.31 0.00290065Z' fill='%232B2B2B'/%3e %3cpath d='M16.4863 0C15.3048 0 14.5435 0.713733 14.5435 1.81915L14.5374 8.1557C13.3194 6.89362 11.4893 6.20309 9.34245 6.20019C4.36976 6.19729 0.00609663 10.3636 6.37628e-06 15.1219C-0.00608387 19.8453 4.35149 23.9942 9.32114 24C11.5258 24.0029 13.5904 22.9207 14.6836 21.853C14.8968 23.0135 15.6306 23.6489 16.7726 23.6489C17.7165 23.6489 18.4017 22.9584 18.4047 22.0068L18.4291 1.82495C18.4291 0.734042 17.6496 0.00290135 16.4863 0ZM9.28764 20.0803C6.42218 20.0774 4.08961 17.852 4.09266 15.1161C4.0957 12.383 6.43131 10.1605 9.29677 10.1634C12.1622 10.1663 14.4948 12.3917 14.4918 15.1277C14.4887 17.8607 12.1531 20.0832 9.28764 20.0803Z' fill='%232B2B2B'/%3e %3cpath d='M9.29431 11.7998C7.3363 11.7998 5.74979 13.3143 5.74979 15.1799C5.74979 17.0455 7.3363 18.56 9.29431 18.56C11.2523 18.56 12.8419 17.0455 12.8419 15.1799C12.8419 13.3143 11.2523 11.7998 9.29431 11.7998Z' fill='%23517934'/%3e%3c/svg%3e";
3101
+
3102
+ // Takes a appType name and returns its logo as a data url.
3103
+ // If appType does not exist the Digital.ai logo is returned.
3104
+ const getLogoForAppType = appType => {
3105
+ switch (appType) {
3106
+ case 'Release':
3107
+ {
3108
+ return img$6;
3286
3109
  }
3287
- if (item.divider) {
3288
- return jsx(DotListDivider, {
3289
- index: index,
3290
- item: item
3291
- }, `divider-${index}`);
3110
+ case 'Deploy':
3111
+ {
3112
+ return img$5;
3292
3113
  }
3293
- return jsx(DotListItem, {
3294
- className: item.className,
3295
- component: item.component,
3296
- "data-testid": `${dataTestId}-item-${index}`,
3297
- endIcon: item.endIcon,
3298
- href: item.href,
3299
- isOpened: listItemIndex === index,
3300
- items: item.items,
3301
- menuPlacement: _menuPlacement,
3302
- nestedDrawerLeftSpacing: _nestedDrawerLeftSpacing,
3303
- nestedListType: _nestedListType,
3304
- onClick: item.href && !item.onClick ? null : handleListItemClick,
3305
- onMenuLeave: handleMenuLeave,
3306
- primaryText: item.primaryText,
3307
- secondaryText: item.secondaryText,
3308
- selected: item.selected,
3309
- startIcon: item.startIcon,
3310
- target: item.target,
3311
- text: item.text,
3312
- tooltip: item.tooltip,
3313
- tooltipPlacement: item.tooltipPlacement || DEFAULT_TOOLTIP_PLACEMENT
3314
- }, index);
3315
- }), children]
3316
- }), void 0);
3114
+ case 'Agility':
3115
+ {
3116
+ return img$4;
3117
+ }
3118
+ case 'Continuous Testing':
3119
+ {
3120
+ return img$3;
3121
+ }
3122
+ case 'Intelligence':
3123
+ {
3124
+ return img$2;
3125
+ }
3126
+ case 'Application Protection':
3127
+ {
3128
+ return img$1;
3129
+ }
3130
+ default:
3131
+ {
3132
+ return img;
3133
+ }
3134
+ }
3317
3135
  };
3318
- const DotListItem = ({
3319
- ariaLabel,
3320
- className,
3321
- component: _component2 = 'li',
3322
- 'data-testid': dataTestId,
3323
- divider: _divider = false,
3324
- endIcon,
3325
- href,
3326
- isOpened,
3327
- onClick,
3328
- onMenuLeave,
3329
- items: _items2 = [],
3330
- menuPlacement,
3331
- nestedDrawerLeftSpacing,
3332
- nestedListType,
3333
- primaryText,
3334
- secondaryText,
3335
- selected,
3336
- startIcon,
3337
- target,
3338
- text,
3339
- tooltip,
3340
- tooltipPlacement: _tooltipPlacement = DEFAULT_TOOLTIP_PLACEMENT
3341
- }) => {
3342
- const hasChildren = _items2.length > 0;
3343
- const isFlyout = nestedListType === 'menu' && hasChildren;
3344
- const [anchorEl, setAnchorEl] = useState(null);
3345
- const showEndIcon = endIcon || hasChildren;
3346
- const rootClasses = useStylesWithRootClass(listItemRootClass, className, isOpened ? 'open' : '');
3347
- const toggleOpen = event => setAnchorEl(event.currentTarget);
3348
- const handleClick = event => {
3349
- onClick === null || onClick === void 0 ? void 0 : onClick(event);
3350
- toggleOpen(event);
3136
+ const daiAppsHeaderMenuItem = (count = 0) => {
3137
+ return sectionHeaderMenuItem('DIGITAL.AI APPLICATIONS', count, true, false);
3138
+ };
3139
+ const sectionHeaderMenuItem = (title, count, showEmpty = false, showCount = true) => {
3140
+ const children = showEmpty || count > 0 ? jsxs(DotTypography, Object.assign({
3141
+ className: "section-title"
3142
+ }, {
3143
+ children: [title, showCount && count > 0 ? ` (${count})` : '']
3144
+ }), `menu-item-section-title-${title}`) : null;
3145
+ return {
3146
+ children,
3147
+ key: `section-header-${title}`
3351
3148
  };
3352
- const handleMenuLeave = event => onMenuLeave(event);
3353
- const renderListItemText = () => primaryText && secondaryText ? jsx(ListItemText, {
3354
- primary: primaryText,
3355
- secondary: secondaryText
3356
- }, void 0) : jsx(DotTypography, Object.assign({
3357
- variant: "body1"
3149
+ };
3150
+ const createMenuItem = (url, title, subtitle, onClick) => jsxs("div", Object.assign({
3151
+ className: "app-menu-item"
3152
+ }, {
3153
+ children: [jsx(DotLink, Object.assign({
3154
+ href: url,
3155
+ color: "textPrimary",
3156
+ target: "_blank",
3157
+ onClick: onClick,
3158
+ onPointerDown: onClick
3358
3159
  }, {
3359
- children: text
3160
+ children: jsxs("div", Object.assign({
3161
+ className: "logo-title"
3162
+ }, {
3163
+ children: [jsx("div", Object.assign({
3164
+ className: "start-icon"
3165
+ }, {
3166
+ children: jsx(DotIcon, {
3167
+ iconId: "open-new-tab"
3168
+ }, void 0)
3169
+ }), void 0), jsxs("div", Object.assign({
3170
+ className: "dot-app-switcher-app-title"
3171
+ }, {
3172
+ children: [jsx(DotTypography, Object.assign({
3173
+ variant: "body1"
3174
+ }, {
3175
+ children: title
3176
+ }), void 0), subtitle && jsx(DotTypography, Object.assign({
3177
+ variant: "body2"
3178
+ }, {
3179
+ children: subtitle
3180
+ }), void 0)]
3181
+ }), void 0)]
3182
+ }), void 0)
3183
+ }), void 0), jsx(DotCopyButton, {
3184
+ copyTooltip: "Copy application URL",
3185
+ value: url
3186
+ }, void 0)]
3187
+ }), `app-menu-item-${title}`);
3188
+ const createTopLevelMenuItem = (url, logo, title, openNewTab = true) => {
3189
+ // Creates an entry in the AppSwitcher at the same level as the AppTypeLabels, used for the Platform link and
3190
+ // Empty state current application link
3191
+ const target = openNewTab ? '_blank' : '_self';
3192
+ return jsxs(DotLink, Object.assign({
3193
+ href: url,
3194
+ color: "textPrimary",
3195
+ target: target
3196
+ }, {
3197
+ children: [jsxs("div", Object.assign({
3198
+ className: "logo-title"
3199
+ }, {
3200
+ children: [jsx(DotAvatar, {
3201
+ alt: "app image",
3202
+ imageSrc: logo,
3203
+ type: "image",
3204
+ variant: "circular"
3205
+ }, void 0), jsx("div", Object.assign({
3206
+ className: "dot-app-switcher-app-title"
3207
+ }, {
3208
+ children: jsx(DotTypography, Object.assign({
3209
+ variant: "body1"
3210
+ }, {
3211
+ children: title
3212
+ }), void 0)
3213
+ }), void 0)]
3214
+ }), void 0), openNewTab && jsx(DotIcon, {
3215
+ iconId: "open-new-tab"
3216
+ }, void 0)]
3217
+ }), `top-menu-item-${title}`);
3218
+ };
3219
+ const createAppTypeLabel = (appTypeName, logo, appProps) => {
3220
+ const logoProps = logo ? {
3221
+ imageSrc: logo
3222
+ } : {
3223
+ iconId: 'collection'
3224
+ };
3225
+ return jsxs("div", Object.assign({
3226
+ className: "logo-title"
3227
+ }, {
3228
+ children: [jsx(DotAvatar, Object.assign({}, logoProps, {
3229
+ alt: "app image",
3230
+ type: "image",
3231
+ variant: "circular"
3232
+ }), void 0), jsxs("div", Object.assign({
3233
+ className: "dot-app-switcher-app-title"
3234
+ }, {
3235
+ children: [jsx(DotTypography, Object.assign({
3236
+ variant: "body1"
3237
+ }, {
3238
+ children: appTypeName
3239
+ }), void 0), jsxs(DotTypography, Object.assign({
3240
+ variant: "body2"
3241
+ }, {
3242
+ children: ["Instance (", appProps.length, ")"]
3243
+ }), void 0)]
3244
+ }), void 0)]
3360
3245
  }), void 0);
3361
- const renderListItemEndIcon = () => {
3362
- if (hasChildren || !endIcon) {
3363
- return jsx(DotIcon, {
3364
- iconId: hasChildren && getChevronIcon(nestedListType, isOpened)
3365
- }, void 0);
3246
+ };
3247
+ const getInstanceStateText = application => {
3248
+ if (application.instance_state === 1) {
3249
+ return 'Production';
3250
+ }
3251
+ return 'Non-production';
3252
+ };
3253
+ const sortRecentAppInstancesFn = (a, b) => {
3254
+ const appA = a.application;
3255
+ const appB = b.application;
3256
+ return sortAppInstancesFn(appA, appB);
3257
+ };
3258
+ const sortAppInstancesFn = (a, b) => {
3259
+ let result = a.name.localeCompare(b.name);
3260
+ if (result === 0) {
3261
+ if (a.instance_state > b.instance_state) {
3262
+ result = -1;
3263
+ } else if (a.instance_state < b.instance_state) {
3264
+ result = 1;
3265
+ }
3266
+ }
3267
+ return result;
3268
+ };
3269
+ const RECENT_INSTANCES_KEY = 'dot-app-switcher-recent-app-instances';
3270
+ const recentAppInstancesSetter = (latestInstance, maxRecentItems
3271
+ //): (RecentAppInstance[]) => RecentAppInstance[])=> {
3272
+ ) => {
3273
+ return orig => {
3274
+ const lastAccess = Date.now();
3275
+ let isNew = true;
3276
+ let oldestIndex = 0;
3277
+ let oldestAccess = lastAccess;
3278
+ orig.forEach((item, index) => {
3279
+ if (item.application.id === latestInstance.id) {
3280
+ isNew = false;
3281
+ // don't need to rerender so eventually returning orig
3282
+ item.lastAccess = lastAccess;
3283
+ }
3284
+ if (item.lastAccess < oldestAccess) {
3285
+ oldestIndex = index;
3286
+ oldestAccess = item.lastAccess;
3287
+ }
3288
+ });
3289
+ if (isNew) {
3290
+ const newRecentItem = {
3291
+ application: latestInstance,
3292
+ lastAccess
3293
+ };
3294
+ let newRecent;
3295
+ if (orig.length >= maxRecentItems) {
3296
+ newRecent = [...orig];
3297
+ newRecent.splice(oldestIndex, 1, newRecentItem);
3298
+ } else {
3299
+ newRecent = [...orig, newRecentItem];
3300
+ }
3301
+ newRecent.sort(sortRecentAppInstancesFn);
3302
+ localStorage.setItem(RECENT_INSTANCES_KEY, JSON.stringify(newRecent));
3303
+ return newRecent;
3304
+ }
3305
+ return orig;
3306
+ };
3307
+ };
3308
+
3309
+ const rootClassName$K = 'dot-app-switcher';
3310
+ const StyledAppSwitcher = styled(DotDrawer).withConfig({
3311
+ displayName: "AppSwitcherstyles__StyledAppSwitcher",
3312
+ componentId: "hhxfqg-0"
3313
+ })(["", ""], ({
3314
+ theme
3315
+ }) => css(["&.", "{.dot-drawer-paper{padding:0;width:382px;}.content{padding:", ";overflow-y:auto;}.app-menu-item{display:flex;justify-content:space-between;align-items:center;}.dot-link,.product-menu-item{display:flex;justify-content:space-between;align-items:center;width:100%;height:60px;margin-bottom:", ";text-decoration:none;cursor:pointer;}.logo-title{display:flex;align-items:center;gap:16px;width:100%;.start-icon{width:40px;display:flex;justify-content:space-around;align-items:center;}}.dot-avatar{flex-basis:40px;}.section-title{display:flex;align-items:center;height:30px;padding:", ";margin:", ";border-bottom:1px solid ", ";}.dot-app-switcher-app-title{min-width:150px;}.dot-icon{flex-basis:content;}.app-switcher-header{.app-switcher-header-title{display:flex;align-items:center;}display:flex;justify-content:space-between;align-items:end;border-bottom:1px solid ", ";padding:", ";.app-switcher-label{padding-left:", ";}}.app-switcher-back-button{&.dot-button.MuiButton-text{padding-left:0;}}.product-heading{display:flex;align-items:center;gap:16px;}.product-applications{margin-top:", ";width:100%;}.app-instance-search{margin-top:", ";}}"], rootClassName$K, theme.spacing(0, 2, 1, 2), theme.spacing(1), theme.spacing(0, 0, 0, 2), theme.spacing(0, -2, 0), theme.palette.grey[100], theme.palette.grey[100], theme.spacing(0, 2, 1, 2), theme.spacing(2), theme.spacing(2), theme.spacing(2)));
3316
+
3317
+ const DotAppSwitcherView = ({
3318
+ activeApp,
3319
+ apps,
3320
+ className,
3321
+ maxRecentInstances: _maxRecentInstances = 5,
3322
+ noAppTypeLabel: _noAppTypeLabel = 'Other',
3323
+ platformConsoleUrl,
3324
+ onClose,
3325
+ open,
3326
+ searchInstancesThreshold: _searchInstancesThreshold = 5,
3327
+ selectedAppType,
3328
+ yOffset: _yOffset = 56,
3329
+ zIndex: _zIndex = 990
3330
+ }) => {
3331
+ const dotCoreApiContext = useDotCoreApiContext();
3332
+ let setSelectedAppType = null;
3333
+ if (dotCoreApiContext !== null) {
3334
+ setSelectedAppType = dotCoreApiContext.setSelectedAppSwitcherAppType;
3335
+ }
3336
+ const rootClasses = useStylesWithRootClass(rootClassName$K, className);
3337
+ const [appTypeMap, setAppTypeMap] = useState();
3338
+ const [appTypeLabels, setAppTypeLabels] = useState();
3339
+ const [appTypeMenuItems, setAppTypeMenuItems] = useState();
3340
+ const [selectedAppTypeAlt, setSelectedAppTypeAlt] = useState(null);
3341
+ const [searchText, setSearchText] = useState('');
3342
+ const cachedRecentItemsJson = localStorage.getItem(RECENT_INSTANCES_KEY);
3343
+ const [recentAppInstances, setRecentAppInstances] = useState(cachedRecentItemsJson ? JSON.parse(cachedRecentItemsJson) : []);
3344
+ if (!setSelectedAppType) {
3345
+ selectedAppType = selectedAppTypeAlt;
3346
+ setSelectedAppType = setSelectedAppTypeAlt;
3347
+ }
3348
+ const showApps = useCallback(appType => {
3349
+ setSelectedAppType(appType);
3350
+ }, []);
3351
+ const showAppTypes = useCallback(() => {
3352
+ setSearchText('');
3353
+ setSelectedAppType(null);
3354
+ }, []);
3355
+ const populateAppTypeMap = useCallback(() => {
3356
+ const newAppTypeMap = new Map();
3357
+ // we'll put Other at the end
3358
+ const otherApps = [];
3359
+ apps === null || apps === void 0 ? void 0 : apps.forEach(app => {
3360
+ const instanceStateText = `${getInstanceStateText(app)} instance`;
3361
+ const children = createMenuItem(app.url, app.name, instanceStateText, e => {
3362
+ handleRecentInstance(e, app);
3363
+ });
3364
+ const searchableContent = `${app.name} ${instanceStateText}`;
3365
+ const appTypeName = app.logo_product_name;
3366
+ let appTypeApps;
3367
+ if (appTypeName) {
3368
+ appTypeApps = newAppTypeMap.get(appTypeName);
3369
+ if (!appTypeApps) {
3370
+ appTypeApps = [];
3371
+ newAppTypeMap.set(appTypeName, appTypeApps);
3372
+ }
3373
+ } else {
3374
+ appTypeApps = otherApps;
3375
+ }
3376
+ appTypeApps.push({
3377
+ application: app,
3378
+ children,
3379
+ searchableContent,
3380
+ key: app.id
3381
+ });
3382
+ });
3383
+ const keys = Array.from(newAppTypeMap.keys()).sort();
3384
+ const sortedAppTypeMap = new Map();
3385
+ for (const appType of keys) {
3386
+ const appTypeApps = newAppTypeMap.get(appType);
3387
+ appTypeApps.sort((a, b) => {
3388
+ return sortAppInstancesFn(a.application, b.application);
3389
+ });
3390
+ sortedAppTypeMap.set(appType, appTypeApps);
3391
+ }
3392
+ let appTypeCount = sortedAppTypeMap.size;
3393
+ if (platformConsoleUrl) {
3394
+ appTypeCount++;
3395
+ }
3396
+ if (otherApps.length > 0) {
3397
+ otherApps.sort((a, b) => {
3398
+ return sortAppInstancesFn(a.application, b.application);
3399
+ });
3400
+ sortedAppTypeMap.set(_noAppTypeLabel, otherApps);
3401
+ }
3402
+ setAppTypeMap(sortedAppTypeMap);
3403
+ const menuItems = [daiAppsHeaderMenuItem(appTypeCount)];
3404
+ if (platformConsoleUrl) {
3405
+ const children = createTopLevelMenuItem(platformConsoleUrl, getLogoForAppType('Platform'), 'Digital.ai Platform', !window.location.href.startsWith(platformConsoleUrl));
3406
+ menuItems.push({
3407
+ children,
3408
+ key: 'app-switcher-platform-link'
3409
+ });
3410
+ }
3411
+ const newAppTypeLabels = new Map();
3412
+ sortedAppTypeMap.forEach((singleTypeApps, appTypeName) => {
3413
+ if ((singleTypeApps === null || singleTypeApps === void 0 ? void 0 : singleTypeApps.length) > 0) {
3414
+ const logo = appTypeName === _noAppTypeLabel ? null : getLogoForAppType(appTypeName);
3415
+ newAppTypeLabels.set(appTypeName, {
3416
+ logo,
3417
+ singleTypeApps
3418
+ });
3419
+ menuItems.push({
3420
+ children: jsxs(DotLink, Object.assign({
3421
+ className: "product-menu-item",
3422
+ onClick: () => showApps(appTypeName)
3423
+ }, {
3424
+ children: [createAppTypeLabel(appTypeName, logo, singleTypeApps), jsx(DotIcon, {
3425
+ iconId: "chevron-right"
3426
+ }, void 0)]
3427
+ }), `menu-item-${appTypeName}`),
3428
+ key: appTypeName
3429
+ });
3430
+ }
3431
+ });
3432
+ setAppTypeMenuItems(menuItems);
3433
+ setAppTypeLabels(newAppTypeLabels);
3434
+ }, [apps]);
3435
+ const emptyState = useCallback(() => {
3436
+ const currentAppMenuItem = createTopLevelMenuItem(window.location.href, getLogoForAppType(activeApp.product), activeApp.name, false);
3437
+ setAppTypeMenuItems([daiAppsHeaderMenuItem(), {
3438
+ children: currentAppMenuItem,
3439
+ key: 'no_applications_configured'
3440
+ }]);
3441
+ }, [activeApp]);
3442
+ useEffect(() => {
3443
+ if ((apps === null || apps === void 0 ? void 0 : apps.length) > 0) {
3444
+ populateAppTypeMap();
3445
+ } else {
3446
+ emptyState();
3447
+ }
3448
+ }, [apps]);
3449
+ const onAppInstanceSearchTextChange = useCallback(text => {
3450
+ setSearchText(text);
3451
+ }, []);
3452
+ const clearAppInstanceSearchText = useCallback(() => {
3453
+ setSearchText('');
3454
+ }, []);
3455
+ const closeHandler = useCallback(event => {
3456
+ setSearchText('');
3457
+ onClose && onClose(event);
3458
+ }, [onClose]);
3459
+ const filteredAppInstances = useCallback(() => {
3460
+ var _a;
3461
+ return (_a = appTypeMap.get(selectedAppType)) === null || _a === void 0 ? void 0 : _a.filter(item => {
3462
+ let isMatch = !searchText;
3463
+ if (searchText) {
3464
+ const testStr = isLowerCase(searchText) ? item.searchableContent.toLowerCase() : item.searchableContent;
3465
+ isMatch = testStr.indexOf(searchText) >= 0;
3466
+ }
3467
+ return isMatch;
3468
+ }).map(item => item.children);
3469
+ }, [appTypeMap, selectedAppType, searchText]);
3470
+ const handleRecentInstance = useCallback((event, latestInstance) => {
3471
+ // middle button counts; click to open context menu does not
3472
+ if (event.button < 2) {
3473
+ setRecentAppInstances(recentAppInstancesSetter(latestInstance, _maxRecentInstances));
3474
+ }
3475
+ }, [recentAppInstances]);
3476
+ const recentAppInstancesSection = jsxs(Fragment$1, {
3477
+ children: [sectionHeaderMenuItem('RECENT', recentAppInstances.length).children, jsx("div", Object.assign({
3478
+ className: "product-applications"
3479
+ }, {
3480
+ children: recentAppInstances.map(item => {
3481
+ const app = item.application;
3482
+ return createMenuItem(app.url, app.name, `${app.logo_product_name} - ${getInstanceStateText(app)}`, e => {
3483
+ handleRecentInstance(e, app);
3484
+ });
3485
+ })
3486
+ }), void 0)]
3487
+ }, void 0);
3488
+ const content = () => {
3489
+ var _a;
3490
+ if (selectedAppType && appTypeMap && appTypeLabels) {
3491
+ const labelConfig = appTypeLabels.get(selectedAppType);
3492
+ return jsxs("div", Object.assign({
3493
+ className: "content"
3494
+ }, {
3495
+ children: [jsx("span", {
3496
+ children: jsx(DotButton, Object.assign({
3497
+ className: "app-switcher-back-button",
3498
+ type: "text",
3499
+ onClick: showAppTypes,
3500
+ startIcon: jsx(DotIcon, {
3501
+ iconId: "back"
3502
+ }, void 0)
3503
+ }, {
3504
+ children: jsx("span", {
3505
+ children: "Back"
3506
+ }, void 0)
3507
+ }), void 0)
3508
+ }, void 0), jsx("div", Object.assign({
3509
+ className: "product-heading"
3510
+ }, {
3511
+ children: createAppTypeLabel(selectedAppType, labelConfig.logo, labelConfig.singleTypeApps)
3512
+ }), void 0), ((_a = appTypeMap === null || appTypeMap === void 0 ? void 0 : appTypeMap.get(selectedAppType)) === null || _a === void 0 ? void 0 : _a.length) >= _searchInstancesThreshold && jsx("div", Object.assign({
3513
+ className: "app-instance-search"
3514
+ }, {
3515
+ children: jsx(SearchInput, {
3516
+ "data-testid": "app-instance-search-input",
3517
+ onChange: onAppInstanceSearchTextChange,
3518
+ onClear: clearAppInstanceSearchText,
3519
+ value: searchText
3520
+ }, void 0)
3521
+ }), void 0), jsx("div", Object.assign({
3522
+ className: "product-applications"
3523
+ }, {
3524
+ children: filteredAppInstances()
3525
+ }), void 0)]
3526
+ }), void 0);
3527
+ } else {
3528
+ return jsxs("div", Object.assign({
3529
+ className: "content"
3530
+ }, {
3531
+ children: [jsx(DotList, {
3532
+ items: appTypeMenuItems === null || appTypeMenuItems === void 0 ? void 0 : appTypeMenuItems.map(item => ({
3533
+ child: item.children
3534
+ })),
3535
+ width: "100%"
3536
+ }, void 0), recentAppInstancesSection]
3537
+ }), void 0);
3366
3538
  }
3367
- return endIcon;
3368
3539
  };
3369
- return jsxs(Fragment, {
3370
- children: [jsx(DotTooltip, Object.assign({
3371
- "data-testid": `${dataTestId}-tooltip`,
3372
- placement: _tooltipPlacement,
3373
- title: tooltip
3540
+ const header = {
3541
+ className: 'app-switcher-header',
3542
+ children: jsxs("div", Object.assign({
3543
+ className: "app-switcher-header-title",
3544
+ style: {
3545
+ marginTop: _yOffset + 'px',
3546
+ width: '80%'
3547
+ }
3374
3548
  }, {
3375
- children: jsxs(StyledListItem, Object.assign({
3376
- "aria-label": ariaLabel,
3377
- button: true,
3378
- classes: {
3379
- root: rootClasses
3380
- },
3381
- component: href && !onClick ? 'a' : _component2,
3382
- "data-testid": dataTestId,
3383
- divider: _divider,
3384
- href: onClick ? null : href,
3385
- onClick: onClick || !href ? handleClick : null,
3386
- selected: isFlyout ? isOpened : selected,
3387
- target: target
3549
+ children: [jsx(DotAvatar, {
3550
+ iconId: "apps",
3551
+ alt: "app image",
3552
+ type: "image",
3553
+ variant: "circular"
3554
+ }, void 0), jsx(DotTypography, Object.assign({
3555
+ className: "app-switcher-label"
3388
3556
  }, {
3389
- children: [jsxs("span", Object.assign({
3390
- className: listItemLinkClassName
3391
- }, {
3392
- children: [startIcon && jsx(ListItemIcon, {
3393
- children: startIcon
3394
- }, void 0), renderListItemText()]
3395
- }), void 0), showEndIcon && renderListItemEndIcon()]
3396
- }), void 0)
3397
- }), void 0), hasChildren && jsx(NestedList, {
3398
- anchorEl: anchorEl,
3399
- ariaLabel: "nested list",
3400
- "data-testid": "nestedList",
3401
- items: _items2,
3402
- menuPlacement: menuPlacement,
3403
- nestedDrawerLeftSpacing: nestedDrawerLeftSpacing,
3404
- onMenuLeave: handleMenuLeave,
3405
- open: isOpened,
3406
- type: nestedListType
3407
- }, void 0)]
3408
- }, void 0);
3557
+ children: "App switcher"
3558
+ }), void 0)]
3559
+ }), void 0)
3560
+ };
3561
+ return jsx(StyledAppSwitcher, Object.assign({
3562
+ className: rootClasses,
3563
+ ModalProps: {
3564
+ style: {
3565
+ zIndex: _zIndex
3566
+ },
3567
+ hideBackdrop: true
3568
+ },
3569
+ drawerHeaderProps: header,
3570
+ variant: "temporary",
3571
+ width: "340px",
3572
+ open: open,
3573
+ onClose: closeHandler
3574
+ }, {
3575
+ children: content()
3576
+ }), void 0);
3409
3577
  };
3410
- const NestedList = ({
3411
- ariaLabel,
3412
- anchorEl,
3413
- 'data-testid': dataTestId,
3414
- items,
3415
- menuPlacement,
3416
- nestedDrawerLeftSpacing,
3417
- onMenuLeave,
3418
- open,
3419
- parentItemIndex,
3420
- type
3421
- }) => {
3422
- const flyoutItemClasses = useStylesWithRootClass(listItemRootClass, flyoutListItemClassName);
3423
- const flyoutSpanClasses = useStylesWithRootClass(listItemLinkClassName, flyoutItemLinkClassName);
3424
- if (type === 'expandable') {
3425
- return jsx(Collapse, Object.assign({
3426
- in: open,
3427
- timeout: "auto",
3428
- unmountOnExit: true
3429
- }, {
3430
- children: jsx(DotList, {
3431
- ariaLabel: ariaLabel,
3432
- className: nestedListClassName,
3433
- component: "div",
3434
- "data-testid": dataTestId,
3435
- disablePadding: true,
3436
- items: items
3437
- }, parentItemIndex)
3438
- }), void 0);
3439
- }
3440
- if (type === 'menu') {
3441
- const menuItems = items.map((item, index) => {
3442
- const {
3443
- href,
3444
- target,
3445
- onClick,
3446
- tooltip,
3447
- tooltipPlacement = DEFAULT_TOOLTIP_PLACEMENT,
3448
- text
3449
- } = item;
3450
- return {
3451
- children: jsx(DotTooltip, Object.assign({
3452
- placement: tooltipPlacement,
3453
- title: tooltip
3454
- }, {
3455
- children: jsx(StyledListItem, Object.assign({
3456
- className: flyoutItemClasses,
3457
- component: href && !onClick ? 'a' : null,
3458
- "data-testid": `${dataTestId}-item-${index}`,
3459
- href: href,
3460
- onClick: onClick,
3461
- target: target
3462
- }, {
3463
- children: jsxs("span", Object.assign({
3464
- className: flyoutSpanClasses
3465
- }, {
3466
- children: [item.startIcon, jsx(DotTypography, Object.assign({
3467
- variant: "body1"
3468
- }, {
3469
- children: text
3470
- }), void 0)]
3471
- }), void 0)
3472
- }), `${parentItemIndex}-${index}`)
3473
- }), `${parentItemIndex}-${index}-tooltip`),
3474
- classes: '',
3475
- key: String(index)
3476
- };
3477
- });
3478
- return jsx(DotMenu, {
3479
- anchorEl: anchorEl,
3480
- ariaLabel: ariaLabel,
3481
- className: flyoutMenuClassName,
3482
- "data-testid": dataTestId,
3483
- id: CreateUUID(),
3484
- menuItemHeight: "auto",
3485
- menuItems: menuItems,
3486
- menuPlacement: menuPlacement,
3487
- onLeave: onMenuLeave,
3488
- open: open
3489
- }, parentItemIndex);
3578
+ const DotAppSwitcher = _a => {
3579
+ var {
3580
+ accountId,
3581
+ includePlatformConsole = true,
3582
+ onClose
3583
+ } = _a,
3584
+ commonProps = __rest(_a, ["accountId", "includePlatformConsole", "onClose"]);
3585
+ const {
3586
+ applications,
3587
+ applicationsLoading,
3588
+ applicationsError,
3589
+ loadApplications,
3590
+ isAppSwitcherOpen: open,
3591
+ platformConsoleUrl,
3592
+ setIsAppSwitcherOpen: setOpen,
3593
+ selectedAppSwitcherAppType: selectedAppType,
3594
+ setSelectedAppSwitcherAppType: setSelectedAppType
3595
+ } = useDotCoreApiContext();
3596
+ useEffect(() => {
3597
+ if ((!applications || applications.length === 0) && open) {
3598
+ loadApplications(accountId);
3599
+ }
3600
+ }, [accountId, open]);
3601
+ if (applicationsError) {
3602
+ console.error('Error loading application list in AppSwitcher', applicationsError);
3490
3603
  }
3491
- if (type === 'drawer') {
3492
- return jsx(StyledDotDrawer, Object.assign({
3493
- PaperProps: {
3494
- style: {
3495
- left: `${nestedDrawerLeftSpacing}px`
3496
- }
3497
- },
3498
- anchor: "left",
3499
- className: nestedDrawerClassName,
3500
- "data-testid": "nested-drawer",
3604
+ const closeHandler = useCallback(event => {
3605
+ setOpen(false);
3606
+ setSelectedAppType(null);
3607
+ onClose && onClose(event);
3608
+ }, [onClose]);
3609
+ const viewProps = includePlatformConsole ? Object.assign(Object.assign({}, commonProps), {
3610
+ platformConsoleUrl
3611
+ }) : Object.assign({}, commonProps);
3612
+ if (!applicationsLoading && !applicationsError) {
3613
+ return jsx(DotAppSwitcherView, Object.assign({}, viewProps, {
3501
3614
  open: open,
3502
- variant: "persistent"
3503
- }, {
3504
- children: jsx(DotList, {
3505
- ariaLabel: ariaLabel,
3506
- className: nestedListClassName,
3507
- component: "div",
3508
- "data-testid": dataTestId,
3509
- disablePadding: true,
3510
- items: items,
3511
- width: '100%'
3512
- }, parentItemIndex)
3615
+ apps: applications,
3616
+ selectedAppType: selectedAppType,
3617
+ onClose: closeHandler
3513
3618
  }), void 0);
3514
3619
  }
3620
+ return null;
3515
3621
  };
3516
3622
 
3517
3623
  var _path$2, _path2$2, _path3, _path4;
@@ -3702,7 +3808,7 @@ const Header = ({
3702
3808
  appLogo: appLogo,
3703
3809
  appLogoSmall: appLogoSmall,
3704
3810
  smallOnly: !isOpen
3705
- }, void 0) : jsxs(Fragment, {
3811
+ }, void 0) : jsxs(Fragment$1, {
3706
3812
  children: [jsx(DotAvatar, Object.assign({}, titleAvatarProps), void 0), isOpen && jsx(DotTypography, Object.assign({
3707
3813
  variant: "h4"
3708
3814
  }, {
@@ -3965,7 +4071,7 @@ const DotAppToolbar = ({
3965
4071
  borderBottomColor: borderColor
3966
4072
  }
3967
4073
  }, {
3968
- children: [showMainMenu && jsxs(Fragment, {
4074
+ children: [showMainMenu && jsxs(Fragment$1, {
3969
4075
  children: [jsx("div", Object.assign({
3970
4076
  className: "dot-main-menu-btn"
3971
4077
  }, {
@@ -4064,7 +4170,7 @@ const StyledAutocomplete = styled(Autocomplete).withConfig({
4064
4170
  componentId: "j2sgjy-0"
4065
4171
  })(["", ""], ({
4066
4172
  theme
4067
- }) => css(["&.", "{&.", " .dot-text-field .", "{height:56px;padding-left:", ";}.", "{padding-top:", ";padding-bottom:", ";}.dot-chip:first-child{margin-left:", ";}.dot-text-field{.", "{height:", ";}.warning-icon{color:", ";}.error-icon{color:", ";}}}"], rootClassName$F, inputMediumClassName, inputRootClassName, theme.spacing(2), inputRootClassName, theme.spacing(0), theme.spacing(0), theme.spacing(0), inputRootClassName, theme.spacing(5), theme.palette.warning.main, theme.palette.error.main));
4173
+ }) => css(["&.", "{&.", " .dot-text-field .", "{height:56px;padding-left:", ";}.", "{padding-top:", ";padding-bottom:", ";}.dot-chip:first-child{margin-left:", ";}.dot-text-field{.", "{min-height:", ";}.warning-icon{color:", ";}.error-icon{color:", ";}}}"], rootClassName$F, inputMediumClassName, inputRootClassName, theme.spacing(2), inputRootClassName, theme.spacing(0), theme.spacing(0), theme.spacing(0), inputRootClassName, theme.spacing(5), theme.palette.warning.main, theme.palette.error.main));
4068
4174
 
4069
4175
  const rootClassName$E = 'dot-chip';
4070
4176
  const StyledChip = styled(Chip).withConfig({
@@ -4271,7 +4377,7 @@ const DotAutoComplete = ({
4271
4377
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4272
4378
  const DotPopper = props => {
4273
4379
  if (!isActionItemDefined) return jsx(StyledPopper, Object.assign({}, props, {
4274
- className: rootClassName$M,
4380
+ className: rootClassName$U,
4275
4381
  disablePortal: _disablePortal,
4276
4382
  "$maxHeight": maxHeight
4277
4383
  }), void 0);
@@ -4295,7 +4401,7 @@ const DotAutoComplete = ({
4295
4401
  const paperProps = props.children.props;
4296
4402
  const paperChildren = paperProps.children;
4297
4403
  return jsx(StyledPopper, Object.assign({}, props, {
4298
- className: rootClassName$M,
4404
+ className: rootClassName$U,
4299
4405
  disablePortal: _disablePortal,
4300
4406
  "$maxHeight": maxHeight
4301
4407
  }, {
@@ -4388,7 +4494,7 @@ const DotAutoComplete = ({
4388
4494
  children: icon
4389
4495
  }), void 0) : icon;
4390
4496
  };
4391
- return jsxs(Fragment, {
4497
+ return jsxs(Fragment$1, {
4392
4498
  children: [loading && jsx(DotProgress, {
4393
4499
  color: "inherit",
4394
4500
  size: 20
@@ -4446,7 +4552,7 @@ const DotAutoComplete = ({
4446
4552
  // at least pick up any styling that is used there. Should additional
4447
4553
  // functionality be added to DotInputText we will have to make a
4448
4554
  // decision about if/how to expose it here.
4449
- jsxs(Fragment, {
4555
+ jsxs(Fragment$1, {
4450
4556
  children: [persistentLabel && jsx(DotInputLabel, Object.assign({
4451
4557
  "data-testid": dataTestId && `${dataTestId}-persistent-label`,
4452
4558
  id: inputId
@@ -4902,7 +5008,7 @@ const DotButtonToggle = ({
4902
5008
  key,
4903
5009
  value: optionValue
4904
5010
  };
4905
- const children = jsxs(Fragment, {
5011
+ const children = jsxs(Fragment$1, {
4906
5012
  children: [optionIconId && jsx(DotIcon, {
4907
5013
  className: "dot-toggle-icon",
4908
5014
  iconId: optionIconId
@@ -6791,7 +6897,7 @@ const DotDynamicForm = ({
6791
6897
  }
6792
6898
  case 'custom-element':
6793
6899
  {
6794
- return jsx(Fragment$1, {
6900
+ return jsx(Fragment, {
6795
6901
  children: customElement
6796
6902
  }, elementIndex);
6797
6903
  }
@@ -6944,13 +7050,12 @@ const DotInlineEdit = ({
6944
7050
  const [showTooltip, setShowTooltip] = useState(false);
6945
7051
  const [originalValue, setOriginalValue] = useState('');
6946
7052
  const [inputValue, setInputValue] = useState(_value);
6947
- const isNotReadOnlyOrEditing = !readOnly && !editing;
6948
7053
  const inputRef = useRef();
6949
7054
  const inlineEditRef = useRef();
6950
7055
  const isSaveDisabled = checkIfEmptyValue(inputValue);
6951
7056
  const rootClasses = useStylesWithRootClass(rootClassName$m, className, editing ? editModeClassName : '');
6952
7057
  const handleShowTooltip = visible => {
6953
- if (isNotReadOnlyOrEditing) {
7058
+ if (!editing) {
6954
7059
  setShowTooltip(visible);
6955
7060
  }
6956
7061
  };
@@ -7021,7 +7126,7 @@ const DotInlineEdit = ({
7021
7126
  };
7022
7127
  const renderViewMode = () => {
7023
7128
  const viewModeClasses = useStylesWithRootClass(viewModeClassName, readOnly ? readOnlyClassName : '');
7024
- const viewModeChildren = jsxs(Fragment, {
7129
+ const viewModeChildren = jsxs(Fragment$1, {
7025
7130
  children: [jsx(DotTypography, Object.assign({
7026
7131
  className: "dot-view-mode-typography",
7027
7132
  "data-testid": dataTestId && `${dataTestId}-view-mode-typography`,
@@ -7050,7 +7155,7 @@ const DotInlineEdit = ({
7050
7155
  };
7051
7156
  const renderEditMode = () => {
7052
7157
  const textFieldClasses = useStylesWithRootClass(editTextFieldClassName, isSaveDisabled ? 'dot-empty-value' : '');
7053
- return jsxs(Fragment, {
7158
+ return jsxs(Fragment$1, {
7054
7159
  children: [jsx(TextField, {
7055
7160
  InputProps: {
7056
7161
  endAdornment: renderEndAdornment()
@@ -7484,7 +7589,7 @@ const DotSplitButton = ({
7484
7589
  setOpen(false);
7485
7590
  onOptionClick(itemKey);
7486
7591
  };
7487
- return jsxs(Fragment, {
7592
+ return jsxs(Fragment$1, {
7488
7593
  children: [jsxs(StyledSplitButtonGroup, Object.assign({
7489
7594
  "aria-label": ariaLabel,
7490
7595
  className: rootClasses,
@@ -7924,7 +8029,7 @@ const DotTableBody = ({
7924
8029
  }, index);
7925
8030
  });
7926
8031
  };
7927
- return jsxs(Fragment, {
8032
+ return jsxs(Fragment$1, {
7928
8033
  children: [jsx(StyledTableBody, Object.assign({
7929
8034
  classes: {
7930
8035
  root: rootClassName$a
@@ -8153,7 +8258,7 @@ const DotTableSelectionToolbar = ({
8153
8258
  variant: "h3"
8154
8259
  }, {
8155
8260
  children: [selectedRowsNumber, " selected"]
8156
- }), void 0), onClearAll && jsxs(Fragment, {
8261
+ }), void 0), onClearAll && jsxs(Fragment$1, {
8157
8262
  children: [jsx(DotTypography, Object.assign({
8158
8263
  className: "dot-selected-rows-divider"
8159
8264
  }, {
@@ -8485,7 +8590,7 @@ const DotTableActions = ({
8485
8590
  onClick: action.onClick
8486
8591
  }, `action-${index}`));
8487
8592
  };
8488
- return jsxs(Fragment, {
8593
+ return jsxs(Fragment$1, {
8489
8594
  children: [jsxs(TableActionsContainer, Object.assign({
8490
8595
  className: rootClassName$6,
8491
8596
  ref: wrapperRef
@@ -8679,7 +8784,7 @@ const renderSelectFilesButton = (isUploadDisabled, onButtonClick) => jsx(DotButt
8679
8784
  }, {
8680
8785
  children: "Select file(s)"
8681
8786
  }), void 0);
8682
- const renderActiveDragArea = () => jsxs(Fragment, {
8787
+ const renderActiveDragArea = () => jsxs(Fragment$1, {
8683
8788
  children: [jsx(DotIcon, {
8684
8789
  iconId: "upload-file"
8685
8790
  }, void 0), jsx(DotTypography, Object.assign({
@@ -8688,7 +8793,7 @@ const renderActiveDragArea = () => jsxs(Fragment, {
8688
8793
  children: "Drop the file(s) here ..."
8689
8794
  }), void 0)]
8690
8795
  }, void 0);
8691
- const renderDragAndDropArea = (isUploadDisabled, onSelectButtonClick) => jsxs(Fragment, {
8796
+ const renderDragAndDropArea = (isUploadDisabled, onSelectButtonClick) => jsxs(Fragment$1, {
8692
8797
  children: [jsx(DotIcon, {
8693
8798
  iconId: "upload-file"
8694
8799
  }, void 0), jsxs(DotTypography, Object.assign({
@@ -8894,7 +8999,7 @@ const DotPopper = ({
8894
8999
  open,
8895
9000
  placement
8896
9001
  }) => {
8897
- const rootClasses = useStylesWithRootClass(rootClassName$M, className);
9002
+ const rootClasses = useStylesWithRootClass(rootClassName$U, className);
8898
9003
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
8899
9004
  const handleClickAway = event => {
8900
9005
  if (onClickAway && (!anchorEl || !anchorEl.contains(event.currentTarget))) {