@lunit/oui 2.2.17 → 2.2.19

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,14 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useState } from 'react';
2
+ import { forwardRef } from 'react';
3
3
  import { uniqueId } from 'lodash';
4
4
  import { Box, Typography } from '@mui/material';
5
5
  import { Project } from '../../../icons';
6
6
  import theme from '../../../theme';
7
7
  import { InputMsg, BaseTextFieldContainer, BaseTextFieldBox, } from '../../BaseTextField/BaseTextField.styled';
8
8
  import { FileInputLabel, LeftIconContainer, RightIconContainer } from '../TextInput.styled';
9
- function fileNameFromFullPath(path) {
10
- return path.split('\\').pop();
11
- }
12
9
  const FileInput = forwardRef((props, ref) => {
13
10
  const { error, helperMsg, leftIcon, rightIcon, inputSX, type: inputType, value, onChange, onClick, ...inputProps } = props;
14
11
  // Unique ID used to select hidden file input and click on it
@@ -17,14 +14,9 @@ const FileInput = forwardRef((props, ref) => {
17
14
  paddingRight: '44px',
18
15
  width: '100%',
19
16
  };
20
- const [labelText, setLabelText] = useState('');
21
17
  const handleChange = (event) => {
22
- const filePath = event.target.value;
23
- if (filePath) {
24
- setLabelText(fileNameFromFullPath(filePath));
25
- }
26
18
  onChange?.(event);
27
19
  };
28
- 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 })), _jsxs(FileInputLabel, { disabled: props.disabled, readOnly: props.readOnly, large: props.large, error: !!error, leftIcon: leftIcon, sx: baseSX, children: [_jsx("input", { ref: ref, type: "file", name: uID, accept: props.accept, style: { display: 'none' }, disabled: inputProps.disabled, onChange: handleChange, readOnly: false }), labelText ? (_jsx(Box, { children: labelText })) : (_jsx(Typography, { variant: "body5", sx: { color: theme.palette.neutralGrey[45] }, children: props.placeholder })), _jsx(RightIconContainer, { sx: { pointerEvents: 'none' }, children: _jsx(Project, {}) })] })] }), error ? (_jsx(InputMsg, { variant: "body5", error: true, children: error })) : (helperMsg && _jsx(InputMsg, { variant: "body5", children: helperMsg }))] }));
20
+ 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 })), _jsxs(FileInputLabel, { disabled: props.disabled, readOnly: props.readOnly, large: props.large, error: !!error, leftIcon: leftIcon, sx: baseSX, children: [_jsx("input", { ref: ref, type: "file", name: uID, accept: props.accept, style: { display: 'none' }, disabled: inputProps.disabled, onChange: handleChange, readOnly: false }), value ? (_jsx(Box, { children: value })) : (_jsx(Typography, { variant: "body5", sx: { color: theme.palette.neutralGrey[45] }, children: props.placeholder })), _jsx(RightIconContainer, { sx: { pointerEvents: 'none' }, children: _jsx(Project, {}) })] })] }), error ? (_jsx(InputMsg, { variant: "body5", error: true, children: error })) : (helperMsg && _jsx(InputMsg, { variant: "body5", children: helperMsg }))] }));
29
21
  });
30
22
  export default FileInput;
@@ -12,7 +12,7 @@ const ToggleControlGroup = ({ componentType = 'toggleGroup', size = 'medium', ti
12
12
  if (!childToggles.length)
13
13
  throw new Error("The 'childToggles' prop must contain at least one child toggle.");
14
14
  return (_jsxs(ToggleControlGroupContainer, { children: [_jsx(ToggleControl, { isParent: true, componentType: "toggle", bar: bar, disabled: disabled, size: size, title: title, tooltip: tooltip, checked: checked, isDimmed: isDimmed, onChange: onChange }), childToggles?.map((child, index) => {
15
- return (_jsx(ToggleControl, { componentType: "toggle", title: child.title, size: size, tooltip: child.tooltip, symbol: child.symbol, color: child.color, isDimmed: child.isDimmed || isDimmed, checked: child.checked, disabled: child.disabled, onChange: (event) => {
15
+ return (_jsx(ToggleControl, { componentType: "toggle", title: child.title, size: child.size, tooltip: child.tooltip, symbol: child.symbol, color: child.color, isDimmed: child.isDimmed || isDimmed, checked: child.checked, disabled: child.disabled, onChange: (event) => {
16
16
  child.onChange(event);
17
17
  }, bar: child.bar }, uuidV4()));
18
18
  })] }));
@@ -12,16 +12,14 @@ export const PresentationTypography = (props) => {
12
12
  if (size === 'small-bold') {
13
13
  return (_jsx(Typography, { variant: "body8", ...rest, sx: { fontWeight: 'bold', color: isDimmed ? theme.palette.neutralGrey[40] : 'inherit' } }));
14
14
  }
15
- if (size === 'medium') {
16
- return (_jsx(Typography, { variant: "body5", ...rest, sx: { color: isDimmed ? theme.palette.neutralGrey[40] : 'inherit' } }));
17
- }
18
15
  if (size === 'medium-bold') {
19
16
  return (_jsx(Typography, { variant: "body_b1", ...rest, sx: { color: isDimmed ? theme.palette.neutralGrey[40] : 'inherit' } }));
20
17
  }
21
18
  if (size === 'large-bold') {
22
19
  return (_jsx(Typography, { variant: "h9", ...rest, sx: { color: isDimmed ? theme.palette.neutralGrey[40] : 'inherit' } }));
23
20
  }
24
- return _jsx(Typography, { ...rest });
21
+ // Fallback to medium size
22
+ return (_jsx(Typography, { variant: "body5", ...rest, sx: { color: isDimmed ? theme.palette.neutralGrey[40] : 'inherit' } }));
25
23
  };
26
24
  export const PresentationSymbolIcon = ({ symbol, color = 'black', isDimmed = false, }) => {
27
25
  if (symbol === 'circle') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunit/oui",
3
- "version": "2.2.17",
3
+ "version": "2.2.19",
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)"