@dtdot/lego 0.19.6 → 0.19.9

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.
@@ -28,6 +28,7 @@ const UploadInnerContainer = styled.div `
28
28
  const LoaderContainer = styled.div `
29
29
  width: 100%;
30
30
  height: 100%;
31
+ min-height: 142px;
31
32
  display: flex;
32
33
  justify-content: center;
33
34
  align-items: center;
@@ -7,7 +7,7 @@ import styled, { css } from 'styled-components';
7
7
  import getThemeControlColours from '../../theme/helpers/getThemeControlColours';
8
8
  import useFormNode, { getValue } from '../Form/useFormNode.hook';
9
9
  export const INPUT_HEIGHT = 48;
10
- const InputContainer = styled(motion.div) `
10
+ const InputContainer = styled.div `
11
11
  position: relative;
12
12
  margin: 2px 0;
13
13
 
@@ -117,13 +117,14 @@ const Input = React.forwardRef(function ForwardRefInput(props, ref) {
117
117
  onBlur();
118
118
  }
119
119
  };
120
+ const animationVariant = error ? (isFocused ? 'errorFocus' : 'error') : undefined;
120
121
  return (React.createElement("div", null,
121
122
  label && React.createElement(InputLabel, { htmlFor: name }, label),
122
- React.createElement(InputContainer, { animate: error ? (isFocused ? 'errorFocus' : 'error') : undefined, "data-cy": dataCy },
123
- React.createElement(StyledInput, { ref: ref, variants: inputVariants, transition: { type: 'spring', duration: 0.3 }, type: type, name: name, placeholder: placeholder, value: getValue(value, contextValue), onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur, autoFocus: autoFocus, "data-cy": 'input' }),
123
+ React.createElement(InputContainer, { "data-cy": dataCy },
124
+ React.createElement(StyledInput, { ref: ref, animate: animationVariant, variants: inputVariants, transition: { type: 'spring', duration: 0.3 }, type: type, name: name, placeholder: placeholder, value: getValue(value, contextValue), onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur, autoFocus: autoFocus, "data-cy": 'input' }),
124
125
  React.createElement(ErrorContainer, { animate: error ? 'show' : undefined, style: { opacity: 0 }, variants: errorVariants, transition: { type: 'spring', duration: 0.3 }, "data-cy": 'error-indicator' },
125
126
  React.createElement(ErrorInner, null,
126
127
  React.createElement(FontAwesomeIcon, { icon: faExclamationCircle }))),
127
- error && (React.createElement(ErrorMessage, { style: { opacity: 0, y: 0 }, variants: messageVariants, transition: { type: 'spring', duration: 0.3 }, "data-cy": 'error-message' }, error)))));
128
+ error && (React.createElement(ErrorMessage, { style: { opacity: 0, y: 0 }, animate: animationVariant, variants: messageVariants, transition: { type: 'spring', duration: 0.3 }, "data-cy": 'error-message' }, error)))));
128
129
  });
129
130
  export default Input;
@@ -103,7 +103,7 @@ const LiveList = ({ value: inputValue, name, onChange: propsOnChange }) => {
103
103
  return (React.createElement("div", { "data-cy": 'live-list' },
104
104
  value.map((val) => (React.createElement(LiveListRow, { key: val.id, id: val.id, value: val.value, error: contextError ? contextError[val.id] : undefined, onChange: (newVal) => handleRowChange(val.id, newVal), onRemove: () => handleRowRemove(val.id) }))),
105
105
  React.createElement(AddRow, null,
106
- React.createElement(AddRowInner, { style: { scale: 1 }, whileHover: 'hover', variants: addVariants, onClick: handleRowAdd },
106
+ React.createElement(AddRowInner, { style: { scale: 1 }, whileHover: 'hover', variants: addVariants, onClick: handleRowAdd, "data-cy": 'button-add-list-item' },
107
107
  React.createElement(IconContainer, null,
108
108
  React.createElement(FontAwesomeIcon, { icon: faPlusCircle })),
109
109
  "add"))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dtdot/lego",
3
- "version": "0.19.6",
3
+ "version": "0.19.9",
4
4
  "description": "Some reusable components for building my applications",
5
5
  "main": "build/index.js",
6
6
  "scripts": {