@ledgerhq/native-ui 0.23.0 → 0.23.1-nightly.1

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.
@@ -3,6 +3,7 @@ import { InputStatus } from ".";
3
3
  type AnimatedNotchedLabelProps = {
4
4
  placeholder: string;
5
5
  inputStatus: InputStatus;
6
+ value: string;
6
7
  };
7
- export declare const AnimatedNotchedLabel: ({ placeholder, inputStatus }: AnimatedNotchedLabelProps) => React.JSX.Element;
8
+ export declare const AnimatedNotchedLabel: ({ placeholder, inputStatus, value, }: AnimatedNotchedLabelProps) => React.JSX.Element;
8
9
  export {};
@@ -36,9 +36,9 @@ const LineCutout = styled(Flex) `
36
36
  width: ${(p) => p.labelWidth}px;
37
37
  background: ${(p) => inputBackgroundColor[p.status]};
38
38
  `;
39
- export const AnimatedNotchedLabel = ({ placeholder, inputStatus }) => {
39
+ export const AnimatedNotchedLabel = ({ placeholder, inputStatus, value, }) => {
40
40
  const [labelWidth, setLabelWidth] = useState(0);
41
- const notched = inputStatus !== "default";
41
+ const notched = inputStatus !== "default" || value.length > 0;
42
42
  const labelTop = useSharedValue(notched ? labelFinalPositions.top : labelInitialPositions.top);
43
43
  const labelLeft = useSharedValue(notched ? labelFinalPositions.left : labelInitialPositions.left);
44
44
  const fontSize = useSharedValue(notched ? labelFinalPositions.fontSize : labelInitialPositions.fontSize);
@@ -31,7 +31,7 @@ const AnimatedInput = (_a, ref) => {
31
31
  const inputStatus = getInputStatus({ focused, hasError: !!error, hasValue: !!value });
32
32
  const displayClearCross = inputStatus === "error" || inputStatus === "focused";
33
33
  return (React.createElement(InputContainer, { status: inputStatus, style: style },
34
- placeholder && React.createElement(AnimatedNotchedLabel, { placeholder: placeholder, inputStatus: inputStatus }),
34
+ placeholder && (React.createElement(AnimatedNotchedLabel, { placeholder: placeholder, inputStatus: inputStatus, value: value })),
35
35
  React.createElement(BaseInput, Object.assign({ ref: ref, onFocus: onFocus, onBlur: onBlur, error: error, value: value, color: theme ? inputTextColor[inputStatus]({ theme }) : "neutral.c100", inputContainerStyle: {
36
36
  backgroundColor: "none",
37
37
  borderColor: theme ? inputStatusColors[inputStatus]({ theme }) : "neutral.c100",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/native-ui",
3
- "version": "0.23.0",
3
+ "version": "0.23.1-nightly.1",
4
4
  "description": "Ledger Live - Mobile UI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -40,7 +40,7 @@
40
40
  "react-native-modal": "^13.0.0",
41
41
  "rn-range-slider": "2.1.1",
42
42
  "styled-system": "^5.1.5",
43
- "@ledgerhq/crypto-icons-ui": "^1.2.0",
43
+ "@ledgerhq/crypto-icons-ui": "^1.3.0-nightly.0",
44
44
  "@ledgerhq/icons-ui": "^0.7.0",
45
45
  "@ledgerhq/ui-shared": "^0.2.1"
46
46
  },