@lunit/oui 1.3.0 → 2.0.0

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.
Files changed (113) hide show
  1. package/dist/assets/ic-copy-coordinates-outlined-20px.js +1 -1
  2. package/dist/components/Alert/Alert.utils.js +3 -3
  3. package/dist/components/Chip/Chip.utils.js +3 -3
  4. package/dist/components/TextField/TextArea.types.d.ts +2 -1
  5. package/dist/components/TextField/TextInput.js +5 -1
  6. package/dist/components/TextField/TextInput.styled.js +2 -1
  7. package/dist/components/TextField/TextInput.types.d.ts +6 -2
  8. package/dist/components/TextField/TextInput.utils.d.ts +3 -3
  9. package/dist/components/TextField/TextInput.utils.js +4 -2
  10. package/dist/components/TextField/components/Buttons.d.ts +7 -1
  11. package/dist/components/TextField/components/Buttons.js +15 -1
  12. package/dist/components/TextField/components/FileInput.d.ts +4 -0
  13. package/dist/components/TextField/components/FileInput.js +21 -0
  14. package/dist/components/Toggle/Toggle.d.ts +3 -0
  15. package/dist/components/Toggle/Toggle.js +16 -0
  16. package/dist/components/Toggle/Toggle.styled.d.ts +7 -0
  17. package/dist/components/Toggle/Toggle.styled.js +90 -0
  18. package/dist/components/Toggle/Toggle.types.d.ts +18 -0
  19. package/dist/components/Toggle/Toggle.types.js +1 -0
  20. package/dist/components/Toggle/index.d.ts +4 -0
  21. package/dist/components/Toggle/index.js +2 -0
  22. package/dist/components/UploadManager/UploadManager.js +2 -2
  23. package/dist/components/index.d.ts +1 -0
  24. package/dist/components/index.js +1 -0
  25. package/dist/icons/index.d.ts +1 -1
  26. package/dist/icons/index.js +1 -1
  27. package/dist/index.d.ts +1 -0
  28. package/dist/index.js +1 -0
  29. package/dist/presentations/Accordion/Accordion.d.ts +3 -0
  30. package/dist/presentations/Accordion/Accordion.js +21 -0
  31. package/dist/presentations/Accordion/Accordion.styled.d.ts +22 -0
  32. package/dist/presentations/Accordion/Accordion.styled.js +39 -0
  33. package/dist/presentations/Accordion/Accordion.types.d.ts +22 -0
  34. package/dist/presentations/Accordion/Accordion.types.js +1 -0
  35. package/dist/presentations/Accordion/index.d.ts +2 -0
  36. package/dist/presentations/Accordion/index.js +2 -0
  37. package/dist/presentations/AnalysisBar/AnalysisBar.d.ts +3 -0
  38. package/dist/presentations/AnalysisBar/AnalysisBar.js +26 -0
  39. package/dist/presentations/AnalysisBar/AnalysisBar.styled.d.ts +31 -0
  40. package/dist/presentations/AnalysisBar/AnalysisBar.styled.js +103 -0
  41. package/dist/presentations/AnalysisBar/AnalysisBar.types.d.ts +11 -0
  42. package/dist/presentations/AnalysisBar/AnalysisBar.types.js +1 -0
  43. package/dist/presentations/AnalysisBar/AnalysisBar.utils.d.ts +5 -0
  44. package/dist/presentations/AnalysisBar/AnalysisBar.utils.js +34 -0
  45. package/dist/presentations/AnalysisBar/HeatmapGraphIcon/HeatmapGraphSVG.d.ts +3 -0
  46. package/dist/presentations/AnalysisBar/HeatmapGraphIcon/HeatmapGraphSVG.js +3 -0
  47. package/dist/presentations/AnalysisBar/HeatmapGraphIcon/index.d.ts +7 -0
  48. package/dist/presentations/AnalysisBar/HeatmapGraphIcon/index.js +8 -0
  49. package/dist/presentations/AnalysisBar/index.d.ts +4 -0
  50. package/dist/presentations/AnalysisBar/index.js +2 -0
  51. package/dist/presentations/FreeText/FreeText.d.ts +3 -0
  52. package/dist/presentations/FreeText/FreeText.js +27 -0
  53. package/dist/presentations/FreeText/FreeText.types.d.ts +9 -0
  54. package/dist/presentations/FreeText/FreeText.types.js +1 -0
  55. package/dist/presentations/FreeText/index.d.ts +4 -0
  56. package/dist/presentations/FreeText/index.js +2 -0
  57. package/dist/presentations/Histogram/Histogram.d.ts +3 -0
  58. package/dist/presentations/Histogram/Histogram.js +15 -0
  59. package/dist/presentations/Histogram/Histogram.styled.d.ts +23 -0
  60. package/dist/presentations/Histogram/Histogram.styled.js +47 -0
  61. package/dist/presentations/Histogram/Histogram.types.d.ts +27 -0
  62. package/dist/presentations/Histogram/Histogram.types.js +1 -0
  63. package/dist/presentations/Histogram/Histogram.utils.d.ts +23 -0
  64. package/dist/presentations/Histogram/Histogram.utils.js +45 -0
  65. package/dist/presentations/Histogram/HistogramCharts.d.ts +3 -0
  66. package/dist/presentations/Histogram/HistogramCharts.js +20 -0
  67. package/dist/presentations/Histogram/HistogramTabs.d.ts +3 -0
  68. package/dist/presentations/Histogram/HistogramTabs.js +27 -0
  69. package/dist/presentations/Histogram/index.d.ts +4 -0
  70. package/dist/presentations/Histogram/index.js +2 -0
  71. package/dist/presentations/HorizonDivider/HorizonDivider.d.ts +3 -0
  72. package/dist/presentations/HorizonDivider/HorizonDivider.js +6 -0
  73. package/dist/presentations/HorizonDivider/HorizonDivider.types.d.ts +4 -0
  74. package/dist/presentations/HorizonDivider/HorizonDivider.types.js +1 -0
  75. package/dist/presentations/HorizonDivider/index.d.ts +4 -0
  76. package/dist/presentations/HorizonDivider/index.js +2 -0
  77. package/dist/presentations/Score/Score.d.ts +3 -0
  78. package/dist/presentations/Score/Score.js +9 -0
  79. package/dist/presentations/Score/Score.types.d.ts +13 -0
  80. package/dist/presentations/Score/Score.types.js +1 -0
  81. package/dist/presentations/Score/index.d.ts +4 -0
  82. package/dist/presentations/Score/index.js +2 -0
  83. package/dist/presentations/Statistic/Statistic.d.ts +3 -0
  84. package/dist/presentations/Statistic/Statistic.js +12 -0
  85. package/dist/presentations/Statistic/Statistic.styled.d.ts +11 -0
  86. package/dist/presentations/Statistic/Statistic.styled.js +17 -0
  87. package/dist/presentations/Statistic/Statistic.types.d.ts +11 -0
  88. package/dist/presentations/Statistic/Statistic.types.js +1 -0
  89. package/dist/presentations/Statistic/index.d.ts +4 -0
  90. package/dist/presentations/Statistic/index.js +2 -0
  91. package/dist/presentations/ToggleControl/ToggleControl.d.ts +3 -0
  92. package/dist/presentations/ToggleControl/ToggleControl.js +22 -0
  93. package/dist/presentations/ToggleControl/ToggleControl.styled.d.ts +15 -0
  94. package/dist/presentations/ToggleControl/ToggleControl.styled.js +27 -0
  95. package/dist/presentations/ToggleControl/ToggleControl.types.d.ts +21 -0
  96. package/dist/presentations/ToggleControl/ToggleControl.types.js +1 -0
  97. package/dist/presentations/ToggleControl/index.d.ts +4 -0
  98. package/dist/presentations/ToggleControl/index.js +2 -0
  99. package/dist/presentations/ToggleControlGroup/ToggleControlGroup.d.ts +3 -0
  100. package/dist/presentations/ToggleControlGroup/ToggleControlGroup.js +32 -0
  101. package/dist/presentations/ToggleControlGroup/ToggleControlGroup.styled.d.ts +4 -0
  102. package/dist/presentations/ToggleControlGroup/ToggleControlGroup.styled.js +9 -0
  103. package/dist/presentations/ToggleControlGroup/ToggleControlGroup.types.d.ts +21 -0
  104. package/dist/presentations/ToggleControlGroup/ToggleControlGroup.types.js +1 -0
  105. package/dist/presentations/ToggleControlGroup/index.d.ts +2 -0
  106. package/dist/presentations/ToggleControlGroup/index.js +2 -0
  107. package/dist/presentations/index.d.ts +9 -0
  108. package/dist/presentations/index.js +9 -0
  109. package/dist/presentations/presentations.styled.d.ts +3 -0
  110. package/dist/presentations/presentations.styled.js +91 -0
  111. package/dist/presentations/presentations.types.d.ts +12 -0
  112. package/dist/presentations/presentations.types.js +1 -0
  113. package/package.json +3 -1
@@ -1,3 +1,3 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- const SvgIcCopyCoordinatesoutlined20Px = (props) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", viewBox: "0 0 20 20", ...props, children: _jsx("path", { fill: "#4E4E50", fillRule: "evenodd", d: "M5 0a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zM4 2a1 1 0 0 1 1-1h11a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zM1 5a1 1 0 0 1 1-1V3a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2h-1a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm10-1.5v2a.5.5 0 0 1-1 0v-2a.5.5 0 0 1 1 0m0 8v-2a.5.5 0 0 0-1 0v2a.5.5 0 0 0 1 0m1-4a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5M8.5 7h-2a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1", clipRule: "evenodd" }) }));
2
+ const SvgIcCopyCoordinatesoutlined20Px = (props) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", viewBox: "0 0 20 20", ...props, children: _jsx("path", { fillRule: "evenodd", d: "M5 0a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zM4 2a1 1 0 0 1 1-1h11a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zM1 5a1 1 0 0 1 1-1V3a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2h-1a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm10-1.5v2a.5.5 0 0 1-1 0v-2a.5.5 0 0 1 1 0m0 8v-2a.5.5 0 0 0-1 0v2a.5.5 0 0 0 1 0m1-4a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5M8.5 7h-2a.5.5 0 0 0 0 1h2a.5.5 0 0 0 0-1", clipRule: "evenodd" }) }));
3
3
  export default SvgIcCopyCoordinatesoutlined20Px;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Success, Error, Information } from '../../icons';
2
+ import { Success, Warning, Information } from '../../icons';
3
3
  import theme from '../../theme';
4
4
  export const getIcons = (severity) => {
5
5
  switch (severity) {
@@ -8,9 +8,9 @@ export const getIcons = (severity) => {
8
8
  case 'success':
9
9
  return _jsx(Success, {});
10
10
  case 'error':
11
- return _jsx(Error, {});
11
+ return _jsx(Warning, {});
12
12
  default:
13
- return _jsx(Error, {});
13
+ return _jsx(Warning, {});
14
14
  }
15
15
  };
16
16
  export const getBackgroundColor = (severity) => {
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Error16, StartT2 } from '../../icons';
2
+ import { Warning16, StartT2 } from '../../icons';
3
3
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
4
  const presetMap = {
5
5
  default: {
@@ -22,7 +22,7 @@ const presetMap = {
22
22
  failed: {
23
23
  className: 'presetFailed',
24
24
  label: 'Failed',
25
- icon: _jsx(Error16, {}),
25
+ icon: _jsx(Warning16, {}),
26
26
  },
27
27
  ready: {
28
28
  className: 'presetReady',
@@ -41,7 +41,7 @@ const presetMap = {
41
41
  invalid: {
42
42
  className: 'presetInvalid',
43
43
  label: 'Invalid',
44
- icon: _jsx(Error16, {}),
44
+ icon: _jsx(Warning16, {}),
45
45
  },
46
46
  };
47
47
  // eslint-disable-next-line import/prefer-default-export
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import type { BoxProps } from '@mui/material';
2
+ import type { BoxProps, SxProps } from '@mui/material';
3
3
  import type { HelperMsgProps, RootTextFieldProps } from '../BaseTextField/BaseTextField.types';
4
4
  interface RootTextAreaProps extends Omit<RootTextFieldProps, 'BoxProps'> {
5
5
  multiline: 'true';
@@ -10,6 +10,7 @@ interface RootTextAreaProps extends Omit<RootTextFieldProps, 'BoxProps'> {
10
10
  width?: string | number;
11
11
  height?: string | number;
12
12
  OuterBoxProps?: BoxProps;
13
+ sx?: SxProps;
13
14
  }
14
15
  interface TextAreaWithHelperMsgProps extends Omit<RootTextAreaProps, 'error' | 'multiline'>, Omit<HelperMsgProps, 'error'> {
15
16
  error?: string;
@@ -2,11 +2,15 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from 'react';
3
3
  import PasswordInput from './components/PasswordInput';
4
4
  import NormalTextInput from './components/NormalTextInput';
5
- import isPasswordInput from './TextInput.utils';
5
+ import { isPasswordInput, isFileInput } from './TextInput.utils';
6
+ import FileInput from './components/FileInput';
6
7
  const TextInput = forwardRef((props, ref) => {
7
8
  if (isPasswordInput(props)) {
8
9
  return (_jsx(PasswordInput, { ...props, ref: ref }));
9
10
  }
11
+ if (isFileInput(props)) {
12
+ return (_jsx(FileInput, { ...props, ref: ref }));
13
+ }
10
14
  return (_jsx(NormalTextInput, { ...props, ref: ref }));
11
15
  });
12
16
  export default TextInput;
@@ -21,8 +21,9 @@ const BaseTextInput = styled('input', {
21
21
  'width',
22
22
  'OuterBoxProps',
23
23
  'InputContainerProps',
24
+ 'sx',
24
25
  ].includes(prop.toString()),
25
- })(({ theme, large, error, leftIcon, width }) => {
26
+ })(({ theme, large, error, leftIcon, width, type }) => {
26
27
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
28
  let resultStyle = {
28
29
  ...baseTextInputStyle(theme),
@@ -20,7 +20,11 @@ interface NormalTextInputProps extends InputWithHelperMsgProps {
20
20
  onClearButtonClick?: () => void;
21
21
  rightIcon?: React.ReactNode;
22
22
  }
23
+ interface FileInputProps extends NormalTextInputProps {
24
+ type: 'file';
25
+ accept: string;
26
+ }
23
27
  interface PasswordTextInputProps extends PasswordInputWithHelperMsgProps {
24
28
  }
25
- type TextInputProps = PasswordTextInputProps | NormalTextInputProps;
26
- export type { TextInputProps, NormalTextInputProps, PasswordTextInputProps, RootTextInputProps };
29
+ type TextInputProps = PasswordTextInputProps | NormalTextInputProps | FileInputProps;
30
+ export type { TextInputProps, NormalTextInputProps, PasswordTextInputProps, FileInputProps, RootTextInputProps, };
@@ -1,3 +1,3 @@
1
- import type { PasswordTextInputProps, TextInputProps } from './TextInput.types';
2
- declare function isPasswordInput(props: TextInputProps): props is PasswordTextInputProps;
3
- export default isPasswordInput;
1
+ import type { FileInputProps, PasswordTextInputProps, TextInputProps } from './TextInput.types';
2
+ export declare function isPasswordInput(props: TextInputProps): props is PasswordTextInputProps;
3
+ export declare function isFileInput(props: TextInputProps): props is FileInputProps;
@@ -1,5 +1,7 @@
1
1
  // Function for inferring required input by props
2
- function isPasswordInput(props) {
2
+ export function isPasswordInput(props) {
3
3
  return props.type === 'password';
4
4
  }
5
- export default isPasswordInput;
5
+ export function isFileInput(props) {
6
+ return props.type === 'file';
7
+ }
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  declare function ClearButton({ onClick }: {
2
3
  onClick?: () => void;
3
4
  }): import("react/jsx-runtime").JSX.Element;
@@ -5,4 +6,9 @@ declare function ShowHidePasswordButton({ onClick, isHidden, }: {
5
6
  onClick?: (event: any) => void;
6
7
  isHidden: boolean;
7
8
  }): import("react/jsx-runtime").JSX.Element;
8
- export { ClearButton, ShowHidePasswordButton };
9
+ declare function FileInputWrapperButton({ children, onClick, width, }: {
10
+ children: React.ReactNode;
11
+ onClick: () => void;
12
+ width?: string | number;
13
+ }): import("react/jsx-runtime").JSX.Element;
14
+ export { ClearButton, ShowHidePasswordButton, FileInputWrapperButton };
@@ -7,4 +7,18 @@ function ClearButton({ onClick }) {
7
7
  function ShowHidePasswordButton({ onClick, isHidden, }) {
8
8
  return (_jsx(ButtonWrapper, { onClick: onClick, children: isHidden ? _jsx(HideSmall, {}) : _jsx(ShowSmall, {}) }));
9
9
  }
10
- export { ClearButton, ShowHidePasswordButton };
10
+ function FileInputWrapperButton({ children, onClick, width, }) {
11
+ return (_jsx("button", { onClick: onClick, style: {
12
+ position: 'unset',
13
+ width: width,
14
+ color: 'unset',
15
+ letterSpacing: 'unset',
16
+ margin: 'unset',
17
+ border: 'unset',
18
+ paddingInline: 'unset',
19
+ paddingBlock: 'unset',
20
+ backgroundColor: 'unset',
21
+ cursor: 'pointer',
22
+ }, children: children }));
23
+ }
24
+ export { ClearButton, ShowHidePasswordButton, FileInputWrapperButton };
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { FileInputProps } from '../TextInput.types';
3
+ declare const FileInput: React.ForwardRefExoticComponent<FileInputProps & React.RefAttributes<HTMLInputElement>>;
4
+ export default FileInput;
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useRef, useState } from 'react';
3
+ import { InputMsg, BaseTextFieldContainer, BaseTextFieldBox, } from '../../BaseTextField/BaseTextField.styled';
4
+ import { BaseTextInput, LeftIconContainer, RightIconContainer } from '../TextInput.styled';
5
+ import { FileInputWrapperButton } from './Buttons';
6
+ import { Project } from '../../../icons';
7
+ const FileInput = forwardRef((props, ref) => {
8
+ const { error, helperMsg, leftIcon, rightIcon, onClearButtonClick, inputSX, type: inputType, ...inputProps } = props;
9
+ const [fileName, setFileName] = useState('');
10
+ const fileRef = useRef(null);
11
+ const baseSX = inputSX ?? {
12
+ paddingRight: '44px',
13
+ pointerEvents: 'none',
14
+ };
15
+ return (_jsxs(BaseTextFieldBox, { ...props.OuterBoxProps, width: props.width, children: [_jsxs(BaseTextFieldContainer, { ...props.InputContainerProps, width: props.width, children: [leftIcon && (_jsx(LeftIconContainer, { sx: inputProps.disabled ? { opacity: '0.8' } : undefined, children: leftIcon })), _jsx("input", { ref: fileRef, type: "file", accept: props.accept, style: { display: 'none' }, onChange: (e) => {
16
+ setFileName(e.target.value.split('\\').pop());
17
+ } }), _jsxs(FileInputWrapperButton, { onClick: () => fileRef?.current?.click(), width: props.width, children: [_jsx(BaseTextInput, { ...inputProps, ref: ref, type: "text", error: !!error, value: fileName,
18
+ // @Tobio89: this dummy onchange clears an error without triggering unwanted style changes
19
+ onChange: () => { }, leftIcon: leftIcon, sx: baseSX }), _jsx(RightIconContainer, { children: _jsx(Project, {}) })] })] }), error ? (_jsx(InputMsg, { variant: "body5", error: true, children: error })) : (helperMsg && _jsx(InputMsg, { variant: "body5", children: helperMsg }))] }));
20
+ });
21
+ export default FileInput;
@@ -0,0 +1,3 @@
1
+ import type { ToggleProps } from './Toggle.types';
2
+ declare const Toggle: ({ value, name, checked, defaultChecked, disabled, required, onChange, onChangeCapture, inputProps, inputRef, label, labelPlacement, toggleColor, indeterminate, ...rootProps }: ToggleProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default Toggle;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import clsx from 'clsx';
3
+ import { Typography } from '@mui/material';
4
+ import { Container, StyledIndeterminateToggle, StyledToggle } from './Toggle.styled';
5
+ const Toggle = ({ value, name, checked, defaultChecked, disabled, required, onChange, onChangeCapture, inputProps, inputRef, label, labelPlacement = 'right', toggleColor, indeterminate, ...rootProps }) => {
6
+ const ToggleComponent = indeterminate ? StyledIndeterminateToggle : StyledToggle;
7
+ return (_jsxs(Container, { ...rootProps, className: clsx('toggle', { 'is-disabled': disabled }, rootProps.className), component: label != null ? 'label' : 'span', children: [_jsx(ToggleComponent, { disableRipple: true, value: true, name: name,
8
+ // indeterminate가 true인 Toggle을 클릭했을 때
9
+ // 발생하는 change event target의 checked property의 일관성을 보장함
10
+ checked: indeterminate ? true : checked, defaultChecked: defaultChecked, disabled: disabled, required: required, onChange: onChange, onChangeCapture: onChangeCapture, inputProps: inputProps, inputRef: inputRef, focusRipple: false, toggleColor: toggleColor }), label && (_jsx(Typography, { variant: "body_m1", sx: {
11
+ display: 'flex',
12
+ alignItems: 'center',
13
+ order: labelPlacement === 'left' ? -1 : 1,
14
+ }, children: label }))] }));
15
+ };
16
+ export default Toggle;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { ToggleProps } from './Toggle.types';
3
+ export declare const Container: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
4
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
5
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
6
+ export declare const StyledToggle: import("@emotion/styled").StyledComponent<import("@mui/material").SwitchProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & ToggleProps, {}, {}>;
7
+ export declare const StyledIndeterminateToggle: import("@emotion/styled").StyledComponent<import("@mui/material").SwitchProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & ToggleProps, {}, {}>;
@@ -0,0 +1,90 @@
1
+ import { Box, styled, Switch } from '@mui/material';
2
+ export const Container = styled(Box)(({ theme }) => ({
3
+ display: 'inline-flex',
4
+ gap: theme.spacing(2),
5
+ pointerEvents: 'none',
6
+ '&.is-disabled': {
7
+ opacity: 0.4,
8
+ },
9
+ '&:not(:last-child)': {
10
+ marginBottom: '6px',
11
+ },
12
+ }));
13
+ export const StyledToggle = styled(Switch, {
14
+ shouldForwardProp: (prop) => prop !== 'toggleColor',
15
+ })(({ theme, toggleColor, disabled }) => ({
16
+ width: '32px',
17
+ height: '22px',
18
+ borderRadius: '9px',
19
+ padding: '2px',
20
+ backgroundColor: 'transparent',
21
+ pointerEvents: 'auto',
22
+ opacity: disabled ? 0.4 : 1,
23
+ '& .MuiSwitch-switchBase': {
24
+ transition: 'all 100ms ease-in-out',
25
+ padding: '4px',
26
+ },
27
+ '& .MuiSwitch-thumb': {
28
+ width: '14px',
29
+ height: '14px',
30
+ background: theme.palette.neutralGrey[0],
31
+ boxShadow: '0px 0px 1px rgba(0, 0, 0, 0.4)',
32
+ },
33
+ '& .MuiSwitch-track': {
34
+ opacity: 1,
35
+ borderRadius: '12px',
36
+ backgroundColor: theme.palette.neutralGrey[45],
37
+ },
38
+ '& .MuiSwitch-switchBase .MuiSwitch-input': {
39
+ width: '200%',
40
+ height: '100%',
41
+ top: 0,
42
+ left: '-50%',
43
+ },
44
+ '& .MuiSwitch-switchBase.Mui-checked': {
45
+ transform: 'translateX(10px)',
46
+ color: theme.palette.neutralGrey[0],
47
+ },
48
+ '& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track': {
49
+ opacity: 1,
50
+ backgroundColor: toggleColor || theme.palette.lunitTeal[40],
51
+ },
52
+ '& .MuiSwitch-switchBase.Mui-disabled + .MuiSwitch-track': {
53
+ opacity: 1,
54
+ },
55
+ '& .MuiSwitch-switchBase.Mui-focusVisible': {
56
+ boxShadow: 'none',
57
+ background: 'transparent',
58
+ borderColor: 'transparent',
59
+ outline: 'none',
60
+ },
61
+ '& .MuiSwitch-switchBase.Mui-focusVisible + .MuiSwitch-track::after': {
62
+ borderRadius: '12px',
63
+ content: '""',
64
+ position: 'absolute',
65
+ border: `1px solid ${theme.palette.lunitTeal[10]}`,
66
+ boxSizing: 'border-box',
67
+ top: '1px',
68
+ left: '1px',
69
+ bottom: '1px',
70
+ right: '1px',
71
+ },
72
+ }));
73
+ export const StyledIndeterminateToggle = styled(StyledToggle)({
74
+ padding: '2px',
75
+ cursor: 'pointer',
76
+ '& .MuiSwitch-thumb': {
77
+ height: '2px',
78
+ width: '12px',
79
+ borderRadius: '2px',
80
+ boxShadow: 'none',
81
+ },
82
+ '& .MuiSwitch-switchBase.Mui-checked': {
83
+ padding: '10px 5px',
84
+ left: '50%',
85
+ transform: 'translateX(-50%)',
86
+ },
87
+ '& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track': {
88
+ borderRadius: '12px',
89
+ },
90
+ });
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import type { BoxProps, Color, SwitchProps as MuiSwitchProps } from '@mui/material';
3
+ export interface ToggleProps extends Omit<BoxProps<'span'>, 'onChange' | 'onChangeCapture'> {
4
+ value?: MuiSwitchProps['value'];
5
+ name?: MuiSwitchProps['name'];
6
+ checked?: MuiSwitchProps['checked'];
7
+ defaultChecked?: MuiSwitchProps['defaultChecked'];
8
+ disabled?: MuiSwitchProps['disabled'];
9
+ required?: MuiSwitchProps['required'];
10
+ onChange?: MuiSwitchProps['onChange'];
11
+ onChangeCapture?: MuiSwitchProps['onChangeCapture'];
12
+ inputProps?: MuiSwitchProps['inputProps'];
13
+ inputRef?: MuiSwitchProps['inputRef'];
14
+ indeterminate?: boolean;
15
+ label?: string;
16
+ labelPlacement?: 'left' | 'right';
17
+ toggleColor?: React.CSSProperties['color'] | Color;
18
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import Toggle from './Toggle';
2
+ import type { ToggleProps } from './Toggle.types';
3
+ export { Toggle };
4
+ export type { ToggleProps };
@@ -0,0 +1,2 @@
1
+ import Toggle from './Toggle';
2
+ export { Toggle };
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Grow, Typography, Box } from '@mui/material';
3
- import { ArrowUp, Close, Success, Error16, RefreshLeft } from '../../icons';
3
+ import { ArrowUp, Close, Success, Warning16, RefreshLeft } from '../../icons';
4
4
  import { useState, Fragment, useMemo } from 'react';
5
5
  import { Divider } from '../Divider';
6
6
  import { Button } from '../Button';
@@ -51,7 +51,7 @@ const UploadFile = ({ file, onCancel, onRetry }) => {
51
51
  if (onRetry)
52
52
  onRetry(file.id);
53
53
  }
54
- }, icon: mouseOnErrorIconButton ? (_jsx(RefreshLeft, { style: { color: theme.palette.neutralGrey[0] } })) : (_jsx(Error16, { style: { color: theme.palette.red[5] } })), variant: "ghost", color: "secondary", sx: {
54
+ }, icon: mouseOnErrorIconButton ? (_jsx(RefreshLeft, { style: { color: theme.palette.neutralGrey[0] } })) : (_jsx(Warning16, { style: { color: theme.palette.red[5] } })), variant: "ghost", color: "secondary", sx: {
55
55
  cursor: file.meta.retry ? 'pointer' : 'default',
56
56
  } }) }) })] })), !file.meta?.errorMessage && file.meta?.postProcessConverting && (_jsxs(Typography, { variant: "body5", sx: {
57
57
  marginRight: '30px',
@@ -20,5 +20,6 @@ export * from './Radio';
20
20
  export * from './Stepper';
21
21
  export * from './TabbedPanel';
22
22
  export * from './TextField';
23
+ export * from './Toggle';
23
24
  export * from './Tooltip';
24
25
  export * from './UploadManager';
@@ -20,5 +20,6 @@ export * from './Radio';
20
20
  export * from './Stepper';
21
21
  export * from './TabbedPanel';
22
22
  export * from './TextField';
23
+ export * from './Toggle';
23
24
  export * from './Tooltip';
24
25
  export * from './UploadManager';
@@ -160,7 +160,7 @@ export { TagT1 } from '@lunit/design-system-icons';
160
160
  export { TagT2 } from '@lunit/design-system-icons';
161
161
  export { TagT3 } from '@lunit/design-system-icons';
162
162
  export { Text } from '@lunit/design-system-icons';
163
- export { Toggle } from '@lunit/design-system-icons';
163
+ export { Toggle as ToggleIcon } from '@lunit/design-system-icons';
164
164
  export { Undo } from '@lunit/design-system-icons';
165
165
  export { Unlock } from '@lunit/design-system-icons';
166
166
  export { UploadFolder } from '@lunit/design-system-icons';
@@ -160,7 +160,7 @@ export { TagT1 } from '@lunit/design-system-icons';
160
160
  export { TagT2 } from '@lunit/design-system-icons';
161
161
  export { TagT3 } from '@lunit/design-system-icons';
162
162
  export { Text } from '@lunit/design-system-icons';
163
- export { Toggle } from '@lunit/design-system-icons';
163
+ export { Toggle as ToggleIcon } from '@lunit/design-system-icons';
164
164
  export { Undo } from '@lunit/design-system-icons';
165
165
  export { Unlock } from '@lunit/design-system-icons';
166
166
  export { UploadFolder } from '@lunit/design-system-icons';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import theme from './theme';
2
2
  export { theme };
3
3
  export * from './components';
4
+ export * from './presentations';
4
5
  export * from './icons';
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import theme from './theme';
2
2
  export { theme };
3
3
  export * from './components';
4
+ export * from './presentations';
4
5
  export * from './icons';
@@ -0,0 +1,3 @@
1
+ import { AccordionProps } from './Accordion.types';
2
+ declare const Accordion: ({ componentType, MuiAccordionProps, AccordionDetailsProps, AccordionSummaryProps, size, tooltip, title, items, metrics, isOpen, onChange, }: AccordionProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default Accordion;
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { v4 as uuidV4 } from 'uuid';
3
+ import { Box } from '@mui/material';
4
+ import theme from '../../theme';
5
+ import { ArrowDown, Information } from '../../icons';
6
+ import { Tooltip } from '../../components';
7
+ import { BaseAccordion, BaseAccordionDetails, BaseAccordionSummary } from './Accordion.styled';
8
+ import { PresentationTypography } from '../presentations.styled';
9
+ import { FreeText } from '../FreeText';
10
+ import { Statistic } from '../Statistic';
11
+ import { Score } from '../Score';
12
+ const Accordion = ({ componentType = 'accordion', MuiAccordionProps, AccordionDetailsProps, AccordionSummaryProps, size = 'medium', tooltip = [], title, items, metrics, isOpen, onChange, }) => {
13
+ return (_jsxs(BaseAccordion, { ...MuiAccordionProps, expanded: isOpen, onChange: onChange, sx: { alignItems: 'center' }, children: [_jsxs(BaseAccordionSummary, { expandIcon: _jsx(ArrowDown, { sx: { fill: theme.palette.neutralGrey[40] } }), ...AccordionSummaryProps, 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: {
14
+ marginRight: size.includes('small') ? '4px' : '6px',
15
+ display: 'flex',
16
+ alignItems: 'center',
17
+ }, children: _jsx(Information, {}) }) })), _jsx(PresentationTypography, { size: size, children: title }), metrics && (_jsx(PresentationTypography, { size: size, children: _jsxs(Box, { sx: { marginLeft: '4px' }, children: [": ", metrics] }) }))] }), _jsx(BaseAccordionDetails, { ...AccordionDetailsProps, sx: { display: 'flex', flexDirection: 'column', gap: '8px' }, children: items.map((item) => {
18
+ return (_jsxs(_Fragment, { children: [item.componentType === 'statistic' && _jsx(Statistic, { ...item }), item.componentType === 'freeText' && _jsx(FreeText, { ...item }), item.componentType === 'score' && _jsx(Score, { ...item })] }));
19
+ }) })] }));
20
+ };
21
+ export default Accordion;
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ declare const BaseAccordion: import("@emotion/styled").StyledComponent<{
3
+ children: NonNullable<import("react").ReactNode>;
4
+ classes?: Partial<import("@mui/material").AccordionClasses> | undefined;
5
+ defaultExpanded?: boolean | undefined;
6
+ disabled?: boolean | undefined;
7
+ disableGutters?: boolean | undefined;
8
+ expanded?: boolean | undefined;
9
+ onChange?: ((event: import("react").SyntheticEvent<Element, Event>, expanded: boolean) => void) | undefined;
10
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
11
+ TransitionComponent?: import("react").JSXElementConstructor<import("@mui/material/transitions").TransitionProps & {
12
+ children?: import("react").ReactElement<any, any> | undefined;
13
+ }> | undefined;
14
+ TransitionProps?: import("@mui/material/transitions").TransitionProps | undefined;
15
+ } & Omit<import("@mui/material").PaperOwnProps, "classes" | "onChange"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
16
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
17
+ }, "disabled" | "expanded" | "square" | keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | "onChange" | "elevation" | "TransitionComponent" | "disableGutters" | "defaultExpanded" | "TransitionProps"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
18
+ declare const BaseAccordionSummary: import("@emotion/styled").StyledComponent<import("@mui/material").AccordionSummaryOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
19
+ ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
20
+ }, "disabled" | "style" | "classes" | "className" | "children" | "sx" | "tabIndex" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "expandIcon"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
21
+ declare const BaseAccordionDetails: import("@emotion/styled").StyledComponent<import("@mui/material").AccordionDetailsProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
22
+ export { BaseAccordion, BaseAccordionDetails, BaseAccordionSummary };
@@ -0,0 +1,39 @@
1
+ import { Accordion, AccordionDetails, AccordionSummary, styled } from '@mui/material';
2
+ const baseAccordionStyle = {
3
+ background: 'transparent',
4
+ padding: '0',
5
+ border: 'none',
6
+ boxShadow: 'none',
7
+ minHeight: '36px',
8
+ '&::before': {
9
+ display: 'none', // This removes an extra divider line
10
+ },
11
+ '&.Mui-expanded': {
12
+ margin: 0,
13
+ minHeight: 'initial',
14
+ },
15
+ };
16
+ const baseAccordionSummaryStyle = {
17
+ height: '36px',
18
+ };
19
+ const baseAccordionDetailStyle = {
20
+ paddingTop: '8px',
21
+ };
22
+ const BaseAccordion = styled(Accordion)(() => {
23
+ return {
24
+ ...baseAccordionStyle,
25
+ };
26
+ });
27
+ const BaseAccordionSummary = styled(AccordionSummary)(() => {
28
+ return {
29
+ ...baseAccordionStyle,
30
+ ...baseAccordionSummaryStyle,
31
+ };
32
+ });
33
+ const BaseAccordionDetails = styled(AccordionDetails)(() => {
34
+ return {
35
+ ...baseAccordionStyle,
36
+ ...baseAccordionDetailStyle,
37
+ };
38
+ });
39
+ export { BaseAccordion, BaseAccordionDetails, BaseAccordionSummary };
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ import type { AccordionDetailsProps, AccordionSummaryProps, AccordionProps as MuiAccordionProps } from '@mui/material';
3
+ import { PresentationElementSize } from '../presentations.types';
4
+ import { FreeTextProps } from '../FreeText';
5
+ import { StatisticProps } from '../Statistic';
6
+ import { ScoreProps } from '../Score';
7
+ export interface AccordionSpec {
8
+ componentType: 'accordion';
9
+ title: string;
10
+ size?: PresentationElementSize;
11
+ items: (StatisticProps | FreeTextProps | ScoreProps)[];
12
+ isOpen?: boolean;
13
+ tooltip?: (StatisticProps | FreeTextProps)[];
14
+ metrics?: string;
15
+ }
16
+ interface AccordionProps extends AccordionSpec {
17
+ MuiAccordionProps?: MuiAccordionProps;
18
+ AccordionSummaryProps?: AccordionSummaryProps;
19
+ AccordionDetailsProps?: AccordionDetailsProps;
20
+ onChange?: (event: React.SyntheticEvent, expanded: boolean) => void;
21
+ }
22
+ export type { AccordionProps };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import Accordion from './Accordion';
2
+ export { Accordion };
@@ -0,0 +1,2 @@
1
+ import Accordion from './Accordion';
2
+ export { Accordion };
@@ -0,0 +1,3 @@
1
+ import type { AnalysisBarProps } from './AnalysisBar.types';
2
+ declare const AnalysisBar: ({ componentType, expressionValue, caption, expressionLevels, segments, isDimmed, }: AnalysisBarProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default AnalysisBar;
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box } from '@mui/material';
3
+ import { AnalysisBarSegmentContainer, AnalysisBarOuter, AxisLabels, GraphAxisLabel, GraphScoreIndicator, GraphSegment, } from './AnalysisBar.styled';
4
+ import { adjustBarSegmentWidth, parseStringValToNumber } from './AnalysisBar.utils';
5
+ import HeatmapGraphSVG from './HeatmapGraphIcon/HeatmapGraphSVG';
6
+ const Segments = ({ segments, adjustForOnePercent }) => {
7
+ if (!segments) {
8
+ return null;
9
+ }
10
+ if (segments?.length === 1 && segments[0].color === 'jet') {
11
+ return (_jsx(Box, { sx: { width: '100%', height: '12px', transform: 'scaleY(0.8) translateY(-10px)' }, children: _jsx(HeatmapGraphSVG, { width: 'auto', height: 'auto' }) }));
12
+ }
13
+ return (_jsx(_Fragment, { children: segments?.map((segment, i) => {
14
+ if (segment.color === 'jet') {
15
+ return (_jsx(HeatmapGraphSVG, { width: `${segment.width}%`, height: 'auto' }));
16
+ }
17
+ return (_jsx(GraphSegment, { color: segment.color, width: adjustForOnePercent ? adjustBarSegmentWidth(segment.width) : segment.width }, i));
18
+ }) }));
19
+ };
20
+ const AnalysisBar = ({ componentType = 'analysisBar', expressionValue, caption, expressionLevels, segments, isDimmed = false, }) => {
21
+ const hasAdjustedOnePercentSegment = segments?.[0].width === 1;
22
+ return (_jsxs(AnalysisBarOuter, { className: "analysis-bar", isDimmed: isDimmed, children: [_jsxs(AnalysisBarSegmentContainer, { children: [expressionValue && (_jsx(GraphScoreIndicator, { adjustForOnePercent: hasAdjustedOnePercentSegment, value: expressionValue })), _jsx(Segments, { segments: segments, adjustForOnePercent: hasAdjustedOnePercentSegment })] }), _jsxs(AxisLabels, { children: [expressionLevels.map((val, i) => {
23
+ return (_jsx(GraphAxisLabel, { label: val, adjustForOnePercent: hasAdjustedOnePercentSegment, leftPos: parseStringValToNumber(val) }, i));
24
+ }), caption && (_jsx(GraphAxisLabel, { label: caption, adjustForOnePercent: hasAdjustedOnePercentSegment, leftPos: 50 }))] })] }));
25
+ };
26
+ export default AnalysisBar;
@@ -0,0 +1,31 @@
1
+ import React, { type PropsWithChildren } from 'react';
2
+ export declare const AnalysisBarOuter: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
3
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
4
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
5
+ isDimmed: boolean;
6
+ }, {}, {}>;
7
+ export declare const AnalysisBarSegmentContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
8
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
9
+ }, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
10
+ export declare const GraphScoreIndicator: ({ value, adjustForOnePercent, }: {
11
+ value: string;
12
+ adjustForOnePercent: boolean;
13
+ }) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const GraphAxisLabel: ({ label, leftPos, adjustForOnePercent, }: {
15
+ label: string;
16
+ leftPos: number;
17
+ adjustForOnePercent: boolean;
18
+ }) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const AxisLabels: ({ children }: {
20
+ percent?: boolean;
21
+ } & PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const AnalysisBarCaption: ({ label }: {
23
+ label: string;
24
+ }) => import("react/jsx-runtime").JSX.Element;
25
+ interface GraphSegmentProps {
26
+ color: string | undefined;
27
+ width: number;
28
+ square?: boolean;
29
+ }
30
+ export declare const GraphSegment: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & GraphSegmentProps, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
31
+ export {};