@lunit/oui 2.4.3 → 2.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  import type { LoadingIndicatorProps } from './LoadingIndicator.types';
2
- declare const LoadingIndicator: ({ message, details, loadingAnimation, }: LoadingIndicatorProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const LoadingIndicator: ({ message, details, loadingAnimation, dataTestId, }: LoadingIndicatorProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default LoadingIndicator;
@@ -4,7 +4,7 @@ import { Player } from '@lottiefiles/react-lottie-player';
4
4
  import { LoadingOverlay, LoadingIndicatorBox, LoadingMessage, LoadingDetails, } from './LoadingIndicator.styled';
5
5
  const DotLoadingAnimation = require('./assets/DotLoadingAnimation.json');
6
6
  const DnaLoadingAnimation = require('./assets/DnaLoadingAnimation.json');
7
- const LoadingIndicator = ({ message, details, loadingAnimation = 'dot', }) => {
8
- return (_jsx(LoadingOverlay, { children: _jsxs(LoadingIndicatorBox, { children: [_jsx(Player, { autoplay: true, loop: true, src: loadingAnimation === 'dot' ? DotLoadingAnimation : DnaLoadingAnimation, style: { height: '112px', width: '140px' } }), _jsx(LoadingMessage, { children: message }), _jsx(LoadingDetails, { children: details || (_jsxs(_Fragment, { children: ["Please wait.", _jsx("br", {}), "It may take a few minutes."] })) })] }) }));
7
+ const LoadingIndicator = ({ message, details, loadingAnimation = 'dot', dataTestId = 'loading-indicator', }) => {
8
+ return (_jsx(LoadingOverlay, { children: _jsxs(LoadingIndicatorBox, { "data-testid": dataTestId, children: [_jsx(Player, { autoplay: true, loop: true, src: loadingAnimation === 'dot' ? DotLoadingAnimation : DnaLoadingAnimation, style: { height: '112px', width: '140px' } }), _jsx(LoadingMessage, { children: message }), _jsx(LoadingDetails, { children: details || (_jsxs(_Fragment, { children: ["Please wait.", _jsx("br", {}), "It may take a few minutes."] })) })] }) }));
9
9
  };
10
10
  export default LoadingIndicator;
@@ -3,4 +3,5 @@ export interface LoadingIndicatorProps {
3
3
  message?: string;
4
4
  details?: ReactNode;
5
5
  loadingAnimation?: 'dot' | 'dna';
6
+ dataTestId?: string;
6
7
  }
@@ -19,7 +19,7 @@ const ToggleControl = ({ componentType = 'toggle', title, size = 'medium', symbo
19
19
  throw new Error("The 'checked' prop is required.");
20
20
  if (typeof checked !== 'boolean')
21
21
  throw new Error("The 'checked' prop must be a boolean.");
22
- return (_jsxs(ToggleControlOuter, { "data-toggle-name": `toggle-control-${title?.replace(/\s/g, '-')}`, hasBar: !!bar || !!content.length, style: { marginBottom: isParent ? '4px' : '0' }, children: [_jsxs(ToggleControlContainer, { className: "toggle-inner-container", size: size, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: '6px' }, className: "toggle-label", children: [!!tooltip.length && (_jsx(Tooltip, { arrow: true, size: "large", title: _jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: '8px' }, children: tooltip.map((item) => (_jsxs(Box, { children: [item.componentType === 'freeText' && (_jsx(FreeText, { componentType: item.componentType, size: item.size, content: item.content })), item.componentType === 'statistic' && (_jsx(Statistic, { componentType: item.componentType, title: item.title, size: item.size, layout: item.layout, symbol: item.symbol, color: item.color }))] }, uuidV4()))) }), children: _jsx(Box, { sx: {
22
+ return (_jsxs(ToggleControlOuter, { "data-testid": `toggle-control-${title?.replace(/\s/g, '-')}`, hasBar: !!bar || !!content.length, style: { marginBottom: isParent ? '4px' : '0' }, children: [_jsxs(ToggleControlContainer, { className: "toggle-inner-container", size: size, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: '6px' }, className: "toggle-label", children: [!!tooltip.length && (_jsx(Tooltip, { arrow: true, size: "large", title: _jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: '8px' }, children: tooltip.map((item) => (_jsxs(Box, { children: [item.componentType === 'freeText' && (_jsx(FreeText, { componentType: item.componentType, size: item.size, content: item.content })), item.componentType === 'statistic' && (_jsx(Statistic, { componentType: item.componentType, title: item.title, size: item.size, layout: item.layout, symbol: item.symbol, color: item.color }))] }, uuidV4()))) }), children: _jsx(Box, { sx: {
23
23
  display: 'flex',
24
24
  alignItems: 'center',
25
25
  }, children: _jsx(Information, {}) }) })), symbol && (_jsx(PresentationSymbolIcon, { symbol: symbol, color: color, isDimmed: isDimmed || !checked })), _jsx(PresentationTypography, { size: size, isDimmed: isDimmed || !checked, children: title })] }), _jsx(StyledToggle, { disabled: disabled || isDimmed, checked: checked, toggleColor: theme.palette.lunitTeal[70], onChange: onChange })] }), content.length > 0 && (_jsx(Box, { sx: { display: 'flex', flexDirection: 'column', gap: '8px' }, children: content.map((item) => (_jsx(Statistic, { ...item, isDimmed: isDimmed || !checked }, uuidV4()))) }, uuidV4())), bar && (_jsx(Box, { sx: { padding: '0 8px', fontSize: '14px', lineHeight: '8px' }, children: _jsx(AnalysisBar, { isDimmed: isDimmed || !checked, componentType: bar.componentType, expressionValue: bar.expressionValue, expressionLevels: bar.expressionLevels, expressionLabels: bar.expressionLabels, caption: bar.caption, segments: bar.segments }) }))] }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunit/oui",
3
- "version": "2.4.3",
3
+ "version": "2.4.4",
4
4
  "validate-branch-name": {
5
5
  "pattern": "^(main|develop)|(feature|fix|release|hotfix|qe)/.+$",
6
6
  "errorMsg": "The branch name is not correct. Please check the pattern. (ex. feature/add-something)"