@ledgerhq/native-ui 0.49.1-nightly.20251115023630 → 0.50.0-nightly.20251119023741

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 (58) hide show
  1. package/lib/components/Carousel/index.d.ts.map +1 -1
  2. package/lib/components/Carousel/index.js +3 -1
  3. package/lib/components/Form/Checkbox/index.js +1 -1
  4. package/lib/components/Form/Input/AnimatedInputSelect/Select.js +1 -1
  5. package/lib/components/Form/Input/AnimatedInputSelect/index.d.ts.map +1 -1
  6. package/lib/components/Form/Input/AnimatedInputSelect/index.js +4 -4
  7. package/lib/components/Form/Input/{AnimatedInput → AnimatedInputSelect}/inputTextColor.d.ts +1 -13
  8. package/lib/components/Form/Input/AnimatedInputSelect/inputTextColor.d.ts.map +1 -0
  9. package/lib/components/Form/Input/AnimatedInputSelect/inputTextColor.js +15 -0
  10. package/lib/components/Form/Input/AnimatedInputSelect/useAnimatedInputFocus.d.ts.map +1 -0
  11. package/lib/components/Form/Input/{AnimatedInput → AnimatedInputSelect}/useAnimatedInputFocus.js +2 -2
  12. package/lib/components/Form/Input/index.d.ts +0 -1
  13. package/lib/components/Form/Input/index.d.ts.map +1 -1
  14. package/lib/components/Form/Input/index.js +0 -1
  15. package/lib/components/Icon/CryptoIcon.d.ts +0 -1
  16. package/lib/components/Icon/CryptoIcon.d.ts.map +1 -1
  17. package/lib/components/Icon/CryptoIcon.js +0 -6
  18. package/lib/components/Icon/Icon.d.ts +0 -1
  19. package/lib/components/Icon/Icon.d.ts.map +1 -1
  20. package/lib/components/Icon/Icon.js +0 -8
  21. package/lib/components/Layout/Box/index.d.ts +0 -1
  22. package/lib/components/Layout/Box/index.d.ts.map +1 -1
  23. package/lib/components/Layout/List/VerticalTimeline/index.d.ts.map +1 -1
  24. package/lib/components/Layout/List/VerticalTimeline/index.js +2 -2
  25. package/lib/components/Layout/Modals/BaseModal/index.d.ts +3 -3
  26. package/lib/components/Layout/Modals/BaseModal/index.d.ts.map +1 -1
  27. package/lib/components/Layout/Modals/BaseModal/index.js +18 -22
  28. package/lib/components/Layout/Modals/BottomDrawer/index.d.ts.map +1 -1
  29. package/lib/components/Layout/Modals/BottomDrawer/index.js +1 -1
  30. package/lib/components/Loader/InfiniteLoader/index.d.ts.map +1 -1
  31. package/lib/components/Loader/InfiniteLoader/index.js +10 -12
  32. package/lib/components/Navigation/StoriesIndicator/index.d.ts.map +1 -1
  33. package/lib/components/Navigation/StoriesIndicator/index.js +24 -11
  34. package/lib/components/Tabs/Chip/index.js +3 -3
  35. package/lib/components/cta/Button/index.d.ts +6 -4
  36. package/lib/components/cta/Button/index.d.ts.map +1 -1
  37. package/lib/components/cta/Button/index.js +4 -4
  38. package/lib/components/cta/Link/index.d.ts +4 -3
  39. package/lib/components/cta/Link/index.d.ts.map +1 -1
  40. package/lib/components/cta/Link/index.js +7 -3
  41. package/lib/components/cta/index.d.ts +2 -2
  42. package/lib/components/cta/index.d.ts.map +1 -1
  43. package/lib/pre-ldls/components/AccountItem/AccountItem.d.ts.map +1 -1
  44. package/lib/pre-ldls/components/AccountItem/AccountItem.js +1 -1
  45. package/package.json +10 -9
  46. package/lib/components/Form/Input/AnimatedInput/AnimatedNotchedLabel.d.ts +0 -10
  47. package/lib/components/Form/Input/AnimatedInput/AnimatedNotchedLabel.d.ts.map +0 -1
  48. package/lib/components/Form/Input/AnimatedInput/AnimatedNotchedLabel.js +0 -75
  49. package/lib/components/Form/Input/AnimatedInput/index.d.ts +0 -10
  50. package/lib/components/Form/Input/AnimatedInput/index.d.ts.map +0 -1
  51. package/lib/components/Form/Input/AnimatedInput/index.js +0 -34
  52. package/lib/components/Form/Input/AnimatedInput/inputTextColor.d.ts.map +0 -1
  53. package/lib/components/Form/Input/AnimatedInput/inputTextColor.js +0 -27
  54. package/lib/components/Form/Input/AnimatedInput/useAnimatedInputFocus.d.ts.map +0 -1
  55. package/lib/helpers/getDeviceSize.d.ts +0 -6
  56. package/lib/helpers/getDeviceSize.d.ts.map +0 -1
  57. package/lib/helpers/getDeviceSize.js +0 -3
  58. /package/lib/components/Form/Input/{AnimatedInput → AnimatedInputSelect}/useAnimatedInputFocus.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Carousel/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,EAEL,UAAU,EACV,SAAS,EAIV,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG5D,QAAA,MAAM,oBAAoB;;gBAEzB,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,iBAAiB,CAAC;IAC1C;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,GAAG,KAAK,EAAE,aAAa,EAAE,OAAO,KAAK,IAAI,CAAC;IACrE;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,cAAc,CAAC,EAAE,YAAY,CAAC;IAC9B;;;OAGG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,CAAC;IACpE;;;OAGG;IACH,4BAA4B,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAExD,kBAAkB,CAAC,EACf,KAAK,CAAC,aAAa,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,M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,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,cAAc,CAAC,EAAE,YAAY,CAAC;IAC9B;;;OAGG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,CAAC;IACpE;;;OAGG;IACH,4BAA4B,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAExD,kBAAkB,CAAC,EACf,KAAK,CAAC,aAAa,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC,GACF,KAAK,CAAC,YAAY,CAAC;IAEvB;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAEvC;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C,CAAC,CAAC;AAOH,iBAAS,QAAQ,CAAC,EAChB,WAAe,EACf,SAAS,EACT,eAAsB,EACtB,iBAAyB,EACzB,cAAc,EACd,4BAA4B,EAC5B,eAAe,EACf,QAAQ,EACR,UAAU,EACV,kBAAmC,EACnC,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,cAAc,GACf,EAAE,KAAK,qBA6KP;;AAED,wBAAoC"}
@@ -64,7 +64,8 @@ function Carousel({ activeIndex = 0, autoDelay, restartAfterEnd = true, scrollOn
64
64
  }
65
65
  }, [slidesLength, activeIndexState, scrollToIndex, onOverflow, itemWidth, onManualChange]);
66
66
  const onScroll = ({ nativeEvent: { contentOffset, contentSize }, }) => {
67
- const newIndex = Math.abs(Math.round((contentOffset.x / contentSize.width) * slidesLength));
67
+ const computed = Math.abs(Math.round((contentOffset.x / contentSize.width) * slidesLength));
68
+ const newIndex = Math.min(slidesLength - 1, Math.max(0, computed));
68
69
  setActiveIndexState(newIndex);
69
70
  onChange && onChange(newIndex);
70
71
  };
@@ -106,6 +107,7 @@ function Carousel({ activeIndex = 0, autoDelay, restartAfterEnd = true, scrollOn
106
107
  const currentTime = new Date().getTime();
107
108
  if (!maxDurationOfTap || currentTime - tapTime <= maxDurationOfTap) {
108
109
  onTap(event);
110
+ setTapTime(0);
109
111
  }
110
112
  }, [maxDurationOfTap, onTap, tapTime]);
111
113
  return (React.createElement(Flex, { flex: 1, width: "100%", alignItems: "center", justifyContent: "center", ...containerProps },
@@ -18,7 +18,7 @@ const Square = styled(Flex).attrs({
18
18
  `;
19
19
  const Checkbox = ({ checked, onChange, disabled, label }) => {
20
20
  const { colors, space } = useTheme();
21
- return (React.createElement(Pressable, { onPress: onChange, disabled: disabled },
21
+ return (React.createElement(Pressable, { onPressIn: onChange, disabled: disabled },
22
22
  React.createElement(Flex, { flexDirection: "row", alignItems: "center" },
23
23
  React.createElement(Square, { checked: checked }, checked ? React.createElement(CheckAlone, { size: 13, color: colors.neutral.c00 }) : null),
24
24
  label ? (React.createElement(Text, { variant: "body", color: checked ? colors.primary.c90 : colors.neutral.c100, style: { marginLeft: space[2] } }, label)) : null)));
@@ -15,7 +15,7 @@ const StyledTouchableOpacity = styled(TouchableOpacity) `
15
15
  align-items: center;
16
16
  width: 100%;
17
17
  height: auto;
18
- padding: ${({ theme }) => theme.space[6]}px 0px ${({ theme }) => theme.space[6]}px
18
+ padding: ${({ theme }) => theme.space[4]}px 0px ${({ theme }) => theme.space[4]}px
19
19
  ${({ theme }) => theme.space[6]}px;
20
20
  `;
21
21
  export const SelectComponent = ({ text, color, onPressSelect }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Input/AnimatedInputSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,UAAU,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAM/D,MAAM,WAAW,kBAAmB,SAAQ,aAAa;IACvD,WAAW,EAAE;QACX,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;QAC3B,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;;AA8CD,wBAAqD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Input/AnimatedInputSelect/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAkB,EAAE,KAAK,UAAU,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEjF,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAM/D,MAAM,WAAW,kBAAmB,SAAQ,aAAa;IACvD,WAAW,EAAE;QACX,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;QAC3B,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;;AA8CD,wBAAqD"}
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
- import { AnimatedInput } from "..";
2
+ import BaseInput from "../BaseInput/index";
3
3
  import { useTheme } from "styled-components/native";
4
- import { useAnimatedInputFocus } from "../AnimatedInput/useAnimatedInputFocus";
5
- import { getInputStatus, inputStatusColors } from "../AnimatedInput/inputTextColor";
4
+ import { useAnimatedInputFocus } from "./useAnimatedInputFocus";
5
+ import { getInputStatus, inputStatusColors } from "./inputTextColor";
6
6
  import { SelectComponent } from "./Select";
7
7
  const AnimatedInputSelect = ({ selectProps, ...textInputProps }, ref) => {
8
8
  const { placeholder, onFocus: onFocusCallback, onBlur: onBlurCallback, error, value, onChange, ...rest } = textInputProps;
@@ -13,6 +13,6 @@ const AnimatedInputSelect = ({ selectProps, ...textInputProps }, ref) => {
13
13
  onBlurCallback,
14
14
  });
15
15
  const inputStatus = getInputStatus({ focused, hasError: !!error, hasValue: !!value });
16
- return (React.createElement(AnimatedInput, { value: value, ref: ref, onFocus: onFocus, onBlur: onBlur, renderRight: () => (React.createElement(SelectComponent, { text: text, color: inputStatusColors[inputStatus]({ theme }), onPressSelect: onPressSelect })), placeholder: placeholder, onChange: onChange, ...rest }));
16
+ return (React.createElement(BaseInput, { value: value, ref: ref, onFocus: onFocus, onBlur: onBlur, renderRight: () => (React.createElement(SelectComponent, { text: text, color: inputStatusColors[inputStatus]({ theme }), onPressSelect: onPressSelect })), placeholder: placeholder, onChange: onChange, ...rest }));
17
17
  };
18
18
  export default React.forwardRef(AnimatedInputSelect);
@@ -1,5 +1,5 @@
1
1
  import { Theme } from "src/styles/theme";
2
- export type CbThemeType = {
2
+ type CbThemeType = {
3
3
  theme: Theme;
4
4
  };
5
5
  export declare const inputStatusColors: {
@@ -8,18 +8,6 @@ export declare const inputStatusColors: {
8
8
  filled: ({ theme }: CbThemeType) => string;
9
9
  error: ({ theme }: CbThemeType) => string;
10
10
  };
11
- export declare const inputTextColor: {
12
- default: ({ theme }: CbThemeType) => string;
13
- focused: ({ theme }: CbThemeType) => string;
14
- filled: ({ theme }: CbThemeType) => string;
15
- error: ({ theme }: CbThemeType) => string;
16
- };
17
- export declare const inputBackgroundColor: {
18
- default: ({ theme }: CbThemeType) => string;
19
- focused: ({ theme }: CbThemeType) => string;
20
- filled: ({ theme }: CbThemeType) => string;
21
- error: ({ theme }: CbThemeType) => string;
22
- };
23
11
  type getInputStatusProps = {
24
12
  focused?: boolean;
25
13
  hasValue?: boolean;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inputTextColor.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Input/AnimatedInputSelect/inputTextColor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,iBAAiB;yBACP,WAAW;yBACX,WAAW;wBACZ,WAAW;uBACZ,WAAW;CAC/B,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,cAAc,oCAAqC,mBAAmB,+CAKlF,CAAC"}
@@ -0,0 +1,15 @@
1
+ export const inputStatusColors = {
2
+ default: ({ theme }) => theme.colors.opacityDefault.c50,
3
+ focused: ({ theme }) => theme.colors.primary.c80,
4
+ filled: ({ theme }) => theme.colors.neutral.c60,
5
+ error: ({ theme }) => theme.colors.error.c50,
6
+ };
7
+ export const getInputStatus = ({ focused, hasValue, hasError }) => {
8
+ if (hasError)
9
+ return "error";
10
+ if (focused)
11
+ return "focused";
12
+ if (hasValue)
13
+ return "filled";
14
+ return "default";
15
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAnimatedInputFocus.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Input/AnimatedInputSelect/useAnimatedInputFocus.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE7E,KAAK,0BAA0B,GAAG;IAChC,eAAe,CAAC,EAAE,CAChB,CAAC,EAAE,oBAAoB,CAAC,uBAAuB,CAAC,KAC7C,uBAAuB,GAAG,IAAI,CAAC;IACpC,cAAc,CAAC,EAAE,CACf,CAAC,EAAE,oBAAoB,CAAC,uBAAuB,CAAC,KAC7C,uBAAuB,GAAG,IAAI,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,qBAAqB,yCAG/B,0BAA0B;iBAGP,qBAAqB,uBAAuB,CAAC;gBAK9C,qBAAqB,uBAAuB,CAAC;;CAMjE,CAAC"}
@@ -3,11 +3,11 @@ export const useAnimatedInputFocus = ({ onFocusCallback, onBlurCallback, }) => {
3
3
  const [focused, setFocused] = useState(false);
4
4
  const onFocus = (e) => {
5
5
  setFocused(true);
6
- onFocusCallback && onFocusCallback(e);
6
+ onFocusCallback?.(e);
7
7
  };
8
8
  const onBlur = (e) => {
9
9
  setFocused(false);
10
- onBlurCallback && onBlurCallback(e);
10
+ onBlurCallback?.(e);
11
11
  };
12
12
  return { onFocus, onBlur, focused };
13
13
  };
@@ -3,6 +3,5 @@ export { default as LegendInput } from "./LegendInput";
3
3
  export { default as NumberInput } from "./NumberInput";
4
4
  export { default as QrCodeInput } from "./QrCodeInput";
5
5
  export { default as SearchInput } from "./SearchInput";
6
- export { default as AnimatedInput } from "./AnimatedInput";
7
6
  export { default as AnimatedInputSelect } from "./AnimatedInputSelect";
8
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Form/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -3,5 +3,4 @@ export { default as LegendInput } from "./LegendInput";
3
3
  export { default as NumberInput } from "./NumberInput";
4
4
  export { default as QrCodeInput } from "./QrCodeInput";
5
5
  export { default as SearchInput } from "./SearchInput";
6
- export { default as AnimatedInput } from "./AnimatedInput";
7
6
  export { default as AnimatedInputSelect } from "./AnimatedInputSelect";
@@ -9,7 +9,6 @@ export type Props = {
9
9
  tokenIcon?: string;
10
10
  fallbackIcon?: JSX.Element;
11
11
  };
12
- export declare const iconNames: string[];
13
12
  declare const CryptoIcon: ({ name, size, color, backgroundColor, circleIcon, disabled, tokenIcon, fallbackIcon, }: Props) => JSX.Element;
14
13
  export default CryptoIcon;
15
14
  //# sourceMappingURL=CryptoIcon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CryptoIcon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/CryptoIcon.tsx"],"names":[],"mappings":";AAQA,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CAC5B,CAAC;AAUF,eAAO,MAAM,SAAS,UAMrB,CAAC;AA6EF,QAAA,MAAM,UAAU,2FASb,KAAK,KAAG,WA0BV,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"CryptoIcon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/CryptoIcon.tsx"],"names":[],"mappings":";AAQA,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CAC5B,CAAC;AAqFF,QAAA,MAAM,UAAU,2FASb,KAAK,KAAG,WA0BV,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -4,12 +4,6 @@ import { ensureContrast } from "../../styles";
4
4
  import styled, { useTheme } from "styled-components/native";
5
5
  import Text from "../Text/index";
6
6
  import Flex from "../Layout/Flex";
7
- export const iconNames = Array.from(Object.keys(icons).reduce((set, rawKey) => {
8
- const key = rawKey;
9
- if (!set.has(key))
10
- set.add(key);
11
- return set;
12
- }, new Set()));
13
7
  const Container = styled(Flex).attrs((p) => ({
14
8
  heigth: p.size,
15
9
  width: p.size,
@@ -5,7 +5,6 @@ export type Props = {
5
5
  weight?: "Regular" | "Thin" | "Light" | "Medium" | "UltraLight";
6
6
  color?: string;
7
7
  };
8
- export declare const iconNames: string[];
9
8
  declare const Icon: ({ name, size, color, weight, }: Props) => JSX.Element | null;
10
9
  export default Icon;
11
10
  //# sourceMappingURL=Icon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":";AAGA,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,CAAC;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,SAAS,UAQrB,CAAC;AAEF,QAAA,MAAM,IAAI,mCAKP,KAAK,KAAG,WAAW,GAAG,IAQxB,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":";AAGA,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,CAAC;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,QAAA,MAAM,IAAI,mCAKP,KAAK,KAAG,WAAW,GAAG,IAQxB,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1,13 +1,5 @@
1
1
  import * as icons from "@ledgerhq/icons-ui/nativeLegacy";
2
2
  import React from "react";
3
- export const iconNames = Array.from(Object.keys(icons).reduce((set, rawKey) => {
4
- const key = rawKey
5
- .replace(/(.+)(Regular|Light|UltraLight|Thin|Medium)+$/g, "$1")
6
- .replace(/(.+)(Ultra)+$/g, "$1");
7
- if (!set.has(key))
8
- set.add(key);
9
- return set;
10
- }, new Set()));
11
3
  const Icon = ({ name, size = 16, color = "currentColor", weight = "Medium", }) => {
12
4
  const maybeIconName = `${name}${weight}`;
13
5
  if (maybeIconName in icons) {
@@ -1,5 +1,4 @@
1
1
  import { BaseStyledProps } from "../../styled";
2
- export type BoxProps = BaseStyledProps;
3
2
  declare const Box: import("styled-components").StyledComponent<typeof import("react-native").View, import("styled-components").DefaultTheme, BaseStyledProps, never>;
4
3
  export default Box;
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Box/index.ts"],"names":[],"mappings":"AAAA,OAAmB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D,MAAM,MAAM,QAAQ,GAAG,eAAe,CAAC;AAEvC,QAAA,MAAM,GAAG,mJAAqC,CAAC;AAE/C,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Box/index.ts"],"names":[],"mappings":"AAAA,OAAmB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D,QAAA,MAAM,GAAG,mJAAqC,CAAC;AAE/C,eAAe,GAAG,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Layout/List/VerticalTimeline/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAEL,UAAU,EAGV,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAqB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,MAAM,MAAM,KAAK,GAAG,eAAe,GAAG;IACpC,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,mBAAmB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;SAGK;IACL,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qBAAqB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAI7C,eAAe,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;CACtD,CAAC;AAEF,iBAAwB,gBAAgB,CAAC,EACvC,KAAK,EACL,mBAAmB,EACnB,cAAc,EACd,MAAM,EACN,UAAiB,EACjB,qBAAqB,EACrB,eAAsB,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,qBAuCP;kBAhDuB,gBAAgB;;;;;eAAhB,gBAAgB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Layout/List/VerticalTimeline/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAEL,UAAU,EAGV,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAqB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD,MAAM,MAAM,KAAK,GAAG,eAAe,GAAG;IACpC,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,mBAAmB,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;SAGK;IACL,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qBAAqB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAI7C,eAAe,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;CACtD,CAAC;AAEF,iBAAwB,gBAAgB,CAAC,EACvC,KAAK,EACL,mBAAmB,EACnB,cAAc,EACd,MAAM,EACN,UAAiB,EACjB,qBAAqB,EACrB,eAAsB,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,qBAyCP;kBAlDuB,gBAAgB;;;;;eAAhB,gBAAgB"}
@@ -18,8 +18,8 @@ export default function VerticalTimeline({ steps, formatEstimatedTime, setActive
18
18
  }, []);
19
19
  return (React.createElement(ScrollView, { ref: scrollViewRef, onLayout: onStepsContainerLayout, contentContainerStyle: contentContainerStyle },
20
20
  header,
21
- React.createElement(Flex, { ...props, onLayout: onStepsContainerLayout, flexDirection: "column" }, steps?.map((step, index) => (React.createElement(View, { onLayout: autoScroll && step.status === "active" ? onActiveStepLayout : undefined },
22
- React.createElement(TimelineItem, { key: step.title, item: step, formatEstimatedTime: formatEstimatedTime, isFirstItem: index === 0, isLastItem: index === steps.length - 1, setActiveIndex: setActiveIndex, index: index, parentScrollRef: parentScrollRef })))))));
21
+ React.createElement(Flex, { ...props, onLayout: onStepsContainerLayout, flexDirection: "column" }, steps?.map((step, index) => (React.createElement(View, { key: step.title, onLayout: autoScroll && step.status === "active" ? onActiveStepLayout : undefined },
22
+ React.createElement(TimelineItem, { item: step, formatEstimatedTime: formatEstimatedTime, isFirstItem: index === 0, isLastItem: index === steps.length - 1, setActiveIndex: setActiveIndex, index: index, parentScrollRef: parentScrollRef })))))));
23
23
  }
24
24
  const SubtitleText = (props) => (React.createElement(Text, { variant: "body", fontWeight: "semiBold", color: "neutral.c100", mb: 3, ...props }));
25
25
  const BodyText = (props) => (React.createElement(Text, { variant: "bodyLineHeight", fontWeight: "medium", color: "neutral.c80", ...props }));
@@ -1,6 +1,5 @@
1
1
  import React, { ReactNode } from "react";
2
- import { ModalProps } from "react-native-modal";
3
- import { StyleProp, ViewStyle } from "react-native";
2
+ import { ModalProps as RNModalProps, StyleProp, ViewStyle } from "react-native";
4
3
  import { IconOrElementType } from "../../../Icon/type";
5
4
  export type BaseModalProps = {
6
5
  isOpen?: boolean;
@@ -21,7 +20,8 @@ export type BaseModalProps = {
21
20
  CustomHeader?: React.ComponentType<{
22
21
  children?: ReactNode;
23
22
  }>;
24
- } & Partial<ModalProps>;
23
+ onModalHide?: () => void;
24
+ } & Partial<RNModalProps>;
25
25
  export declare function ModalHeader({ Icon, iconColor, title, description, subtitle, }: Pick<BaseModalProps, "Icon" | "iconColor" | "title" | "description" | "subtitle">): React.ReactElement | null;
26
26
  export declare function ModalHeaderCloseButton({ onClose, }: Pick<BaseModalProps, "onClose">): React.ReactElement;
27
27
  export declare function ModalHeaderBackButton({ onBack, }: Pick<BaseModalProps, "onBack">): React.ReactElement;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Layout/Modals/BaseModal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAe,MAAM,OAAO,CAAC;AACtD,OAAyB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAElE,OAAO,EAAE,SAAS,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAC;AAItE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AASvD,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC,kBAAkB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC1C,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;CAC9D,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AA0DxB,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,SAAS,EACT,KAAK,EACL,WAAW,EACX,QAAQ,GACT,EAAE,IAAI,CACL,cAAc,EACd,MAAM,GAAG,WAAW,GAAG,OAAO,GAAG,aAAa,GAAG,UAAU,CAC5D,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAsB5B;AAED,wBAAgB,sBAAsB,CAAC,EACrC,OAAO,GACR,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,YAAY,CAUtD;AAED,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,GACP,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,YAAY,CAUrD;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,MAAM,EACN,OAAkB,EAClB,MAAiB,EACjB,aAAa,EACb,aAAa,EACb,kBAAuB,EACvB,cAAmB,EACnB,UAAe,EACf,oBAAoB,EACpB,IAAI,EACJ,SAAS,EACT,KAAK,EACL,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,GAAG,IAAI,EACR,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CAiErC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Layout/Modals/BaseModal/index.tsx"],"names":[],"mappings":"AAA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AAa,GAAG,UAAU,CAC5D,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAsB5B;AAED,wBAAgB,sBAAsB,CAAC,EACrC,OAAO,GACR,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,YAAY,CAUtD;AAED,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,GACP,EAAE,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,YAAY,CAUrD;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,MAAM,EACN,OAAkB,EAClB,MAAiB,EACjB,aAAa,EACb,aAAa,EACb,kBAAuB,EACvB,cAAmB,EACnB,UAAe,EACf,oBAAoB,EACpB,IAAI,EACJ,SAAS,EACT,KAAK,EACL,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,GAAG,IAAI,EACR,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CAgErC"}
@@ -1,15 +1,12 @@
1
1
  import React, { useCallback } from "react";
2
- import ReactNativeModal from "react-native-modal";
2
+ import { Modal as RNModal, Pressable, TouchableOpacity, } from "react-native";
3
3
  import styled from "styled-components/native";
4
- import { TouchableOpacity } from "react-native";
5
- import sizes from "../../../../helpers/getDeviceSize";
6
4
  import Text from "../../../Text";
7
5
  import { BoxedIcon } from "../../../Icon";
8
6
  import { Flex } from "../../index";
9
7
  import { space } from "styled-system";
10
8
  import { Close, ArrowLeft } from "@ledgerhq/icons-ui/native";
11
9
  import { useTheme } from "styled-components/native";
12
- const { width, height } = sizes;
13
10
  const SafeContainer = styled.SafeAreaView `
14
11
  background-color: ${(p) => p.theme.colors.background.drawer};
15
12
  `;
@@ -79,28 +76,27 @@ export function ModalHeaderBackButton({ onBack, }) {
79
76
  React.createElement(ArrowLeft, { color: colors.neutral.c100, size: "M" }))));
80
77
  }
81
78
  export default function BaseModal({ isOpen, onClose = () => { }, onBack = () => { }, noCloseButton, hasBackButton, safeContainerStyle = {}, containerStyle = {}, modalStyle = {}, preventBackdropClick, Icon, iconColor, title, description, subtitle, children, onModalHide, CustomHeader, ...rest }) {
82
- const backDropProps = preventBackdropClick
83
- ? {}
84
- : {
85
- onBackdropPress: onClose,
86
- onBackButtonPress: onClose,
87
- onSwipeComplete: onClose,
88
- };
79
+ const canCloseViaBackdropOrBack = !preventBackdropClick;
89
80
  // Workaround: until this, onModalHide={onClose}, making onClose being called twice and onModalHide being never called
90
81
  // The real fix would be to have onModalHide={onModalHide} and make sure every usage on onClose in the consumers of this component
91
82
  // expect the correct behavior
92
83
  const onModalHideWithClose = useCallback(() => {
93
84
  onModalHide?.();
94
85
  }, [onModalHide]);
95
- return (React.createElement(ReactNativeModal, { ...backDropProps, ...rest, isVisible: !!isOpen, deviceWidth: width, deviceHeight: height, useNativeDriver: true, useNativeDriverForBackdrop: true, hideModalContentWhileAnimating: true, onModalHide: onModalHideWithClose, style: [defaultModalStyle, modalStyle] },
96
- React.createElement(SafeContainer, { style: safeContainerStyle },
97
- CustomHeader && (React.createElement(CustomHeader, null, !noCloseButton && React.createElement(ModalHeaderCloseButton, { onClose: onClose }))),
98
- React.createElement(Container, { style: containerStyle },
99
- React.createElement(Flex, { flexDirection: "row", justifyContent: "space-between", width: "100%", alignItems: "center" },
100
- !CustomHeader && onBack && hasBackButton && (React.createElement(Flex, { flex: 1, justifyContent: "flex-start" },
101
- React.createElement(ModalHeaderBackButton, { onBack: onBack }))),
102
- !CustomHeader && !noCloseButton && (React.createElement(Flex, { flex: 1, justifyContent: "flex-end" },
103
- React.createElement(ModalHeaderCloseButton, { onClose: onClose })))),
104
- React.createElement(ModalHeader, { Icon: Icon, iconColor: iconColor, title: title, description: description, subtitle: subtitle }),
105
- React.createElement(ContentContainer, null, children)))));
86
+ return (React.createElement(RNModal, { ...rest, visible: !!isOpen, transparent: true, animationType: "fade", onDismiss: onModalHideWithClose, onRequestClose: () => {
87
+ if (canCloseViaBackdropOrBack)
88
+ onClose?.();
89
+ } },
90
+ React.createElement(Pressable, { onPress: canCloseViaBackdropOrBack ? onClose : undefined, style: { flex: 1, backgroundColor: "rgba(0,0,0,0.7)" } },
91
+ React.createElement(Pressable, { onPress: () => { }, style: [defaultModalStyle, modalStyle] },
92
+ React.createElement(SafeContainer, { style: safeContainerStyle },
93
+ CustomHeader && (React.createElement(CustomHeader, null, !noCloseButton && React.createElement(ModalHeaderCloseButton, { onClose: onClose }))),
94
+ React.createElement(Container, { style: containerStyle },
95
+ React.createElement(Flex, { flexDirection: "row", justifyContent: "space-between", width: "100%", alignItems: "center" },
96
+ !CustomHeader && onBack && hasBackButton && (React.createElement(Flex, { flex: 1, justifyContent: "flex-start" },
97
+ React.createElement(ModalHeaderBackButton, { onBack: onBack }))),
98
+ !CustomHeader && !noCloseButton && (React.createElement(Flex, { flex: 1, justifyContent: "flex-end" },
99
+ React.createElement(ModalHeaderCloseButton, { onClose: onClose })))),
100
+ React.createElement(ModalHeader, { Icon: Icon, iconColor: iconColor, title: title, description: description, subtitle: subtitle }),
101
+ React.createElement(ContentContainer, null, children)))))));
106
102
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Layout/Modals/BottomDrawer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAkB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAyBzD,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CAYrC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Layout/Modals/BottomDrawer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAkB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAyBzD,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CAWrC"}
@@ -24,5 +24,5 @@ const modalStyleOverrides = StyleSheet.create({
24
24
  },
25
25
  });
26
26
  export default function BottomDrawer({ children, ...restProps }) {
27
- return (React.createElement(BaseModal, { ...restProps, modalStyle: modalStyleOverrides.modal, safeContainerStyle: modalStyleOverrides.safeContainer, containerStyle: [modalStyleOverrides.container, restProps.containerStyle], propagateSwipe: true }, children));
27
+ return (React.createElement(BaseModal, { ...restProps, modalStyle: modalStyleOverrides.modal, safeContainerStyle: modalStyleOverrides.safeContainer, containerStyle: [modalStyleOverrides.container, restProps.containerStyle] }, children));
28
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Loader/InfiniteLoader/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,GAAwD,MAAM,kBAAkB,CAAC;AAExF,OAAO,EAAgB,SAAS,EAAE,MAAM,eAAe,CAAC;AAiBxD,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,IAAS,EACT,KAAqB,EACrB,IAAY,EACZ,MAAW,EACX,GAAG,UAAU,EACd,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAuFrB;AAED,QAAA,MAAM,MAAM,2RAQX,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Loader/InfiniteLoader/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,GAAwD,MAAM,kBAAkB,CAAC;AAExF,OAAO,EAAgB,SAAS,EAAE,MAAM,eAAe,CAAC;AAiBxD,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,IAAS,EACT,KAAqB,EACrB,IAAY,EACZ,MAAW,EACX,GAAG,UAAU,EACd,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAsFrB;AAED,QAAA,MAAM,MAAM,2RAQX,CAAC"}
@@ -11,20 +11,18 @@ const strokeSystem = system({
11
11
  });
12
12
  export default function InfiniteLoader({ size = 38, color = "primary.c50", mock = false, testID = "", ...extraProps }) {
13
13
  const rotation = useSharedValue(0);
14
- // Start the rotation animation if not in mock mode
15
- useEffect(() => {
16
- if (!mock) {
17
- rotation.value = withRepeat(withTiming(360, {
18
- duration: 1000,
19
- easing: Easing.linear,
20
- }), mock ? 1 : -1, false);
21
- }
22
- return () => cancelAnimation(rotation);
23
- }, [mock, rotation.value]);
24
- // Animated style for rotation
25
14
  const animatedStyle = useAnimatedStyle(() => ({
26
15
  transform: [{ rotate: `${rotation.value}deg` }],
27
- }));
16
+ }), [rotation]);
17
+ useEffect(() => {
18
+ if (mock)
19
+ return;
20
+ rotation.value = withRepeat(withTiming(360, {
21
+ duration: 1000,
22
+ easing: Easing.linear,
23
+ }), mock ? 1 : -1, false);
24
+ return () => cancelAnimation(rotation);
25
+ }, [mock, rotation]);
28
26
  return (React.createElement(Animated.View, { style: [{ display: "flex", justifyContent: "center", alignItems: "center" }, animatedStyle], testID: testID },
29
27
  React.createElement(Loader, { size: size, stroke: color, viewBox: "0 0 38 38", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...extraProps },
30
28
  React.createElement(Defs, null,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Navigation/StoriesIndicator/index.tsx"],"names":[],"mappings":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DD,iBAAS,gBAAgB,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,qBAAqB,qBA0BvF;;AAED,wBAA4C"}
@@ -10,25 +10,38 @@ const ProgressBar = styled.View `
10
10
  width: 100%;
11
11
  `;
12
12
  const AnimatedProgressBar = Animated.createAnimatedComponent(ProgressBar);
13
- function ActiveProgressBar({ duration }) {
14
- const width = useSharedValue(0);
13
+ function ActiveProgressBar({ duration, containerWidth = 0, }) {
14
+ const animatedWidth = useSharedValue(0);
15
15
  useEffect(() => {
16
- width.value = 100;
17
- }, [width]);
16
+ animatedWidth.value = 0;
17
+ if (containerWidth > 0) {
18
+ animatedWidth.value = withTiming(containerWidth, {
19
+ duration: duration || 200,
20
+ easing: Easing.linear,
21
+ });
22
+ }
23
+ }, [containerWidth, duration, animatedWidth]);
18
24
  const animatedStyles = useAnimatedStyle(() => ({
19
- width: withTiming(`${width.value}%`, {
20
- duration: duration || 200,
21
- easing: Easing.linear,
22
- }),
23
- }), [width, duration]);
25
+ width: animatedWidth.value,
26
+ }));
24
27
  return React.createElement(AnimatedProgressBar, { style: animatedStyles });
25
28
  }
26
29
  function StoryBar({ full = false, isActive, duration }) {
27
- return (React.createElement(Flex, { height: 4, backgroundColor: "neutral.c50", margin: "auto", borderRadius: 2, flex: 1, mx: 1 }, isActive ? React.createElement(ActiveProgressBar, { duration: duration }) : full ? React.createElement(ProgressBar, null) : null));
30
+ const [containerWidth, setContainerWidth] = React.useState(0);
31
+ function renderProgressBar() {
32
+ if (isActive) {
33
+ return React.createElement(ActiveProgressBar, { duration: duration, containerWidth: containerWidth });
34
+ }
35
+ if (full) {
36
+ return React.createElement(ProgressBar, null);
37
+ }
38
+ return null;
39
+ }
40
+ return (React.createElement(Flex, { height: 4, backgroundColor: "neutral.c50", margin: "auto", borderRadius: 2, flex: 1, mx: 1, onLayout: (e) => setContainerWidth(e.nativeEvent.layout.width) }, renderProgressBar()));
28
41
  }
29
42
  function StoriesIndicator({ activeIndex, slidesLength, duration }) {
30
43
  const storiesArray = useMemo(() => new Array(slidesLength).fill(0), [slidesLength]);
31
- return (React.createElement(Flex, { flexDirection: "row", alignItems: "stretch", width: "100%", style: I18nManager.isRTL
44
+ return (React.createElement(Flex, { flexDirection: "row", alignItems: "stretch", width: "100%", pointerEvents: "none", style: I18nManager.isRTL
32
45
  ? {
33
46
  transform: [{ scaleX: -1 }],
34
47
  }
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
2
  import styled from "styled-components/native";
3
3
  import Text from "../../Text";
4
- import { TouchableOpacity } from "react-native";
4
+ import { Pressable } from "react-native";
5
5
  import TemplateTabs from "../TemplateTabs";
6
- const TabBox = styled(TouchableOpacity) `
6
+ const TabBox = styled(Pressable) `
7
7
  text-align: center;
8
8
  flex-grow: ${(p) => (p.stretchItems ? "1" : "0")};
9
9
  ${(p) => (p.stretchItems ? "margin: auto;" : "margin: auto 0;")}
@@ -11,7 +11,7 @@ const TabBox = styled(TouchableOpacity) `
11
11
  border-radius: 8px;
12
12
  background-color: ${(p) => p.isActive ? p.activeBg ?? p.theme.colors.primary.c20 : p.inactiveBg ?? "transparent"};
13
13
  `;
14
- export const ChipTab = ({ onPress, isActive, label, disabled, activeBg, activeColor, inactiveBg, inactiveColor, stretchItems, size = "medium", }) => (React.createElement(TabBox, { activeBg: activeBg, disabled: disabled, inactiveBg: inactiveBg, isActive: isActive, stretchItems: stretchItems, onPress: onPress, size: size },
14
+ export const ChipTab = ({ onPress, isActive, label, disabled, activeBg, activeColor, inactiveBg, inactiveColor, stretchItems, size = "medium", }) => (React.createElement(TabBox, { activeBg: activeBg, disabled: disabled, inactiveBg: inactiveBg, isActive: isActive, stretchItems: stretchItems, onPressIn: onPress, size: size },
15
15
  React.createElement(Text, { variant: "small", fontWeight: "semiBold", color: isActive ? activeColor ?? "palette.neutral.c100" : inactiveColor ?? "palette.neutral.c80", textAlign: "center" }, label)));
16
16
  const ChipTabs = (props) => (React.createElement(TemplateTabs, { ...props, Item: ChipTab }));
17
17
  export default ChipTabs;
@@ -1,10 +1,11 @@
1
1
  /// <reference types="styled-components-react-native" />
2
2
  import React from "react";
3
- import { TouchableOpacityProps, View } from "react-native";
3
+ import { PressableProps, StyleProp, View, ViewStyle } from "react-native";
4
4
  import { BaseStyledProps } from "../../styled";
5
5
  import { IconType } from "../../Icon/type";
6
- export type ButtonProps = TouchableOpacityProps & BaseStyledProps & {
7
- onPressWhenDisabled?: TouchableOpacityProps["onPress"];
6
+ export type ButtonProps = Omit<PressableProps, "onPress"> & BaseStyledProps & {
7
+ onPress?: PressableProps["onPress"] | (() => void);
8
+ onPressWhenDisabled?: PressableProps["onPress"];
8
9
  iconName?: string;
9
10
  type?: "main" | "shade" | "error" | "color" | "accent" | "default";
10
11
  size?: "small" | "medium" | "large";
@@ -19,9 +20,10 @@ export type ButtonProps = TouchableOpacityProps & BaseStyledProps & {
19
20
  isNewIcon?: boolean;
20
21
  Icon?: IconType | JSX.Element;
21
22
  };
22
- export declare const Base: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<TouchableOpacityProps & React.RefAttributes<View>>, import("styled-components").DefaultTheme, {
23
+ export declare const Base: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<PressableProps & React.RefAttributes<View>>, import("styled-components").DefaultTheme, {
23
24
  iconButton?: boolean | undefined;
24
25
  sizeVariant?: ButtonProps["size"];
26
+ style?: StyleProp<ViewStyle>;
25
27
  } & Omit<ButtonProps, "size">, never>;
26
28
  declare const Button: (props: ButtonProps) => React.ReactElement;
27
29
  export declare const PromisableButton: (props: ButtonProps) => React.ReactElement;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/cta/Button/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAG9D,OAAO,EAKL,qBAAqB,EACrB,IAAI,EACL,MAAM,cAAc,CAAC;AAKtB,OAAmB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC3D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useState, useMemo } from "react";
2
2
  import styled, { useTheme } from "styled-components/native";
3
- import { ActivityIndicator, TouchableOpacity, View, } from "react-native";
3
+ import { ActivityIndicator, Pressable, View, } from "react-native";
4
4
  import { buttonSizeStyle, getButtonColorStyle } from "../../cta/Button/getButtonStyle";
5
5
  import { ctaIconSize, ctaTextType } from "../../cta/getCtaStyle";
6
6
  import Text from "../../Text";
@@ -9,7 +9,7 @@ import baseStyled from "../../styled";
9
9
  const IconContainer = styled.View `
10
10
  ${(p) => p.iconButton ? "" : p.iconPosition === "left" ? `margin-right: 10px;` : `margin-left: 10px;`}
11
11
  `;
12
- export const Base = baseStyled(TouchableOpacity).attrs((p) => {
12
+ export const Base = baseStyled(Pressable).attrs((p) => {
13
13
  // if onPressWhenDisabled prop exists then the button will look
14
14
  // disabled but will still be press-able.
15
15
  const disabled = !p.onPressWhenDisabled && p.disabled;
@@ -79,7 +79,7 @@ const ButtonContainer = (props) => {
79
79
  const Button = (props) => {
80
80
  const { Icon, children, type = "default", iconName, disabled = false, pending = false, displayContentWhenPending = false, testID, } = props;
81
81
  const theme = useTheme();
82
- return (React.createElement(Base, { activeOpacity: 1, ...props, type: type, iconButton: (!!Icon || !!iconName) && !children, disabled: disabled || pending, testID: testID },
82
+ return (React.createElement(Base, { pointerEvents: "box-only", hitSlop: 16, ...props, style: (state) => [props.style, state.pressed ? { opacity: 1 } : {}], type: type, iconButton: (!!Icon || !!iconName) && !children, disabled: disabled || pending, testID: testID, accessible: true },
83
83
  React.createElement(View, null,
84
84
  React.createElement(ButtonContainer, { ...props, type: type, hide: pending && !displayContentWhenPending }),
85
85
  pending && !displayContentWhenPending ? (React.createElement(SpinnerContainer, { displayContentWhenPending: displayContentWhenPending },
@@ -100,7 +100,7 @@ export const PromisableButton = (props) => {
100
100
  setSpinnerOn(false);
101
101
  }
102
102
  }, [onPress]);
103
- return (React.createElement(Base, { ...props, type: type, iconButton: (!!Icon || !!iconName) && !children, disabled: disabled || spinnerOn, onPress: onPressHandler },
103
+ return (React.createElement(Base, { pointerEvents: "box-only", hitSlop: 16, ...props, type: type, iconButton: (!!Icon || !!iconName) && !children, disabled: disabled || spinnerOn, onPress: onPressHandler, accessible: true },
104
104
  React.createElement(View, null,
105
105
  React.createElement(ButtonContainer, { ...props, type: type, hide: spinnerOn }),
106
106
  React.createElement(SpinnerContainer, null,
@@ -1,7 +1,8 @@
1
1
  /// <reference types="styled-components-react-native" />
2
2
  import React from "react";
3
- import { TouchableOpacityProps } from "react-native";
4
- export type LinkProps = TouchableOpacityProps & {
3
+ import { PressableProps } from "react-native";
4
+ export type LinkProps = Omit<PressableProps, "onPress"> & {
5
+ onPress?: PressableProps["onPress"] | (() => void);
5
6
  Icon?: React.ComponentType<{
6
7
  size: number;
7
8
  color: string;
@@ -14,7 +15,7 @@ export type LinkProps = TouchableOpacityProps & {
14
15
  children?: React.ReactNode;
15
16
  numberOfLines?: number;
16
17
  };
17
- export declare const Base: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<TouchableOpacityProps & React.RefAttributes<import("react-native").View>>, import("styled-components").DefaultTheme, {}, never>;
18
+ export declare const Base: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<PressableProps & React.RefAttributes<import("react-native").View>>, import("styled-components").DefaultTheme, {}, never>;
18
19
  declare const Link: (props: LinkProps) => React.ReactElement;
19
20
  export default Link;
20
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/cta/Link/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAoB,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAMvE,MAAM,MAAM,SAAS,GAAG,qBAAqB,GAAG;IAC9C,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5D,IAAI,CA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AAC;CACxB,CAAC;AAUF,eAAO,MAAM,IAAI,sMAKhB,CAAC;AAgDF,QAAA,MAAM,IAAI,UAAW,SAAS,KAAG,MAAM,YAatC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { TouchableOpacity } from "react-native";
2
+ import { Pressable, } from "react-native";
3
3
  import styled, { useTheme } from "styled-components/native";
4
4
  import Text from "../../Text";
5
5
  import { getLinkColors } from "./getLinkStyle";
@@ -7,7 +7,7 @@ import { ctaIconSize, ctaTextType } from "../getCtaStyle";
7
7
  const IconContainer = styled.View `
8
8
  ${(p) => p.iconLink ? "" : p.iconPosition === "left" ? `margin-right: 4px;` : `margin-left: 4px;`}
9
9
  `;
10
- export const Base = styled(TouchableOpacity) `
10
+ export const Base = styled(Pressable) `
11
11
  flex-direction: row;
12
12
  text-align: center;
13
13
  align-items: center;
@@ -25,7 +25,11 @@ const LinkContainer = (props) => {
25
25
  };
26
26
  const Link = (props) => {
27
27
  const { type = "main", size = "medium" } = props;
28
- return (React.createElement(Base, { ...props, activeOpacity: 0.5 },
28
+ function style(state) {
29
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
30
+ return [props.style, state.pressed ? { opacity: 0.5 } : {}];
31
+ }
32
+ return (React.createElement(Base, { pointerEvents: "box-only", hitSlop: 16, ...props, style: style, accessible: true },
29
33
  React.createElement(LinkContainer, { ...props, type: type, size: size })));
30
34
  };
31
35
  export default Link;
@@ -1,4 +1,4 @@
1
- export { default as Button } from "./Button";
2
- export { default as Link } from "./Link";
1
+ export { default as Button, type ButtonProps } from "./Button";
2
+ export { default as Link, type LinkProps } from "./Link";
3
3
  export * from "./QuickAction";
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/cta/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/cta/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzD,cAAc,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AccountItem.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/AccountItem/AccountItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE;QACR,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;QACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,IAAI,CAAC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E,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,gBAAgB,CAAC;AAEvF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,SAAS,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yBAAyB,EAAE,MAAM,CAAC;CACnC,CAAC;AAkGF,eAAO,MAAM,WAAW,8FAOrB,gBAAgB,sBA+FlB,CAAC"}
@@ -103,7 +103,7 @@ export const AccountItem = ({ onClick, account, rightElement, showIcon = true, b
103
103
  React.createElement(AccountInfoContainer, null,
104
104
  React.createElement(NameRow, { style: { marginBottom: Number(tokens["spacing-xxxs"]) } },
105
105
  React.createElement(NameWrapper, null,
106
- React.createElement(Text, { variant: "largeLineHeight", fontWeight: "semiBold", color: String(tokens["colors-content-default-default"]), fontSize: "18px", numberOfLines: 1, ellipsizeMode: "tail" }, name)),
106
+ React.createElement(Text, { variant: "largeLineHeight", fontWeight: "semiBold", color: String(tokens["colors-content-default-default"]), fontSize: "18px", numberOfLines: 1, ellipsizeMode: "tail", testID: `account-item-name-${name}` }, name)),
107
107
  protocol && (React.createElement(TagWrapper, { style: { marginLeft: Number(tokens["spacing-xs"]) } },
108
108
  React.createElement(Tag, { textTransform: "uppercase" }, protocol)))),
109
109
  React.createElement(Address, { address: address, cryptoId: cryptoId, ticker: ticker, parentId: parentId, showIcon: showIcon, backgroundColor: cryptoIconBackgroundColor })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/native-ui",
3
- "version": "0.49.1-nightly.20251115023630",
3
+ "version": "0.50.0-nightly.20251119023741",
4
4
  "description": "Ledger Live - Mobile UI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,17 +37,17 @@
37
37
  "dependencies": {
38
38
  "@ledgerhq/crypto-icons": "1.1.3",
39
39
  "color": "^4.0.0",
40
- "react-native-modal": "14.0.0-rc.1",
41
40
  "rn-range-slider": "2.1.1",
42
41
  "styled-system": "^5.1.5",
43
- "@ledgerhq/crypto-icons-ui": "^1.23.0-nightly.20251115023630",
44
- "@ledgerhq/icons-ui": "^0.16.0",
42
+ "@ledgerhq/crypto-icons-ui": "^1.23.0-nightly.20251119023741",
43
+ "@ledgerhq/icons-ui": "^0.17.0-nightly.20251119023741",
45
44
  "@ledgerhq/ui-shared": "^0.5.0"
46
45
  },
47
46
  "peerDependencies": {
48
47
  "react": ">=17",
49
48
  "react-native": ">=0.64.0",
50
49
  "react-native-reanimated": "3.16.7",
50
+ "react-native-safe-area-context": ">=5.5.2",
51
51
  "react-native-svg": ">=12.1.1",
52
52
  "styled-components": "^5.3.3"
53
53
  },
@@ -71,8 +71,9 @@
71
71
  "@react-native-async-storage/async-storage": "2.1.2",
72
72
  "@react-native-community/cli-server-api": "^7.0.3",
73
73
  "@react-native-community/datetimepicker": "6.7.5",
74
- "@react-native-community/slider": "^4.4.2",
75
- "@react-native/assets-registry": "0.77.2",
74
+ "@react-native-community/slider": "^4.5.7",
75
+ "@react-native/assets-registry": "0.77.3",
76
+ "@react-native/babel-preset": "0.77.3",
76
77
  "@storybook/addon-actions": "^7.6.18",
77
78
  "@storybook/addon-controls": "^7.6.18",
78
79
  "@storybook/addon-essentials": "^7.6.18",
@@ -143,10 +144,10 @@
143
144
  "react": "18.3.1",
144
145
  "react-dom": "18.3.1",
145
146
  "react-is": "^18",
146
- "react-native": "0.77.2",
147
+ "react-native": "0.77.3",
147
148
  "react-native-reanimated": "3.16.7",
148
- "react-native-safe-area-context": "5.1.0",
149
- "react-native-svg": "15.11.2",
149
+ "react-native-safe-area-context": "5.6.1",
150
+ "react-native-svg": "15.12.1",
150
151
  "react-native-web": "~0.19.6",
151
152
  "regenerator-runtime": "^0.14.0",
152
153
  "rimraf": "^4.4.1",
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import { InputStatus } from ".";
3
- type AnimatedNotchedLabelProps = {
4
- placeholder: string;
5
- inputStatus: InputStatus;
6
- value: string;
7
- };
8
- export declare const AnimatedNotchedLabel: ({ placeholder, inputStatus, value, }: AnimatedNotchedLabelProps) => React.JSX.Element;
9
- export {};
10
- //# sourceMappingURL=AnimatedNotchedLabel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnimatedNotchedLabel.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Input/AnimatedInput/AnimatedNotchedLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAYxC,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC;AAkDhC,KAAK,yBAAyB,GAAG;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,oBAAoB,yCAI9B,yBAAyB,sBAyD3B,CAAC"}
@@ -1,75 +0,0 @@
1
- import React, { useState } from "react";
2
- import styled from "styled-components/native";
3
- import { Flex } from "../../../Layout";
4
- import { Text } from "react-native";
5
- import Animated, { useSharedValue, withTiming, useAnimatedStyle, useAnimatedReaction, Easing, } from "react-native-reanimated";
6
- import { inputTextColor, inputStatusColors, inputBackgroundColor } from "./inputTextColor";
7
- const labelPadding = 4;
8
- const labelInitialPositions = {
9
- top: 20.5,
10
- left: 16 - labelPadding,
11
- fontSize: 16,
12
- };
13
- const labelFinalPositions = {
14
- top: -7,
15
- left: 16 - labelPadding,
16
- fontSize: 12,
17
- };
18
- const LabelContainer = styled(Animated.View) `
19
- position: absolute;
20
- padding: ${`0 ${labelPadding}px`};
21
- overflow: visible;
22
- z-index: ${(p) => (p.notched ? 3 : 0)};
23
- `;
24
- const AnimatedText = Animated.createAnimatedComponent(Text);
25
- const LabelText = styled(AnimatedText) `
26
- include-font-padding: false;
27
- vertical-align: top;
28
- color: ${(p) => p.status === "default" ? inputTextColor[p.status] : inputStatusColors[p.status]};
29
- `;
30
- const LineCutout = styled(Flex) `
31
- position: absolute;
32
- height: 1px;
33
- top: 7px;
34
- left: 0px;
35
- width: ${(p) => p.labelWidth}px;
36
- background: ${(p) => inputBackgroundColor[p.status]};
37
- `;
38
- export const AnimatedNotchedLabel = ({ placeholder, inputStatus, value, }) => {
39
- const [labelWidth, setLabelWidth] = useState(0);
40
- const notched = inputStatus !== "default" || value.length > 0;
41
- const labelTop = useSharedValue(notched ? labelFinalPositions.top : labelInitialPositions.top);
42
- const labelLeft = useSharedValue(notched ? labelFinalPositions.left : labelInitialPositions.left);
43
- const fontSize = useSharedValue(notched ? labelFinalPositions.fontSize : labelInitialPositions.fontSize);
44
- const labelStyle = useAnimatedStyle(() => {
45
- return {
46
- top: labelTop.value,
47
- left: labelLeft.value,
48
- };
49
- });
50
- const labelFontSize = useAnimatedStyle(() => {
51
- return {
52
- fontSize: fontSize.value,
53
- };
54
- });
55
- useAnimatedReaction(() => notched, (isNotched) => {
56
- const targetTop = isNotched ? labelFinalPositions.top : labelInitialPositions.top;
57
- const targetLeft = isNotched ? labelFinalPositions.left : labelInitialPositions.left;
58
- const targetSize = isNotched ? labelFinalPositions.fontSize : labelInitialPositions.fontSize;
59
- labelTop.value = withTiming(targetTop, undefined, () => ({
60
- duration: 200,
61
- easing: Easing.inOut(Easing.quad),
62
- }));
63
- labelLeft.value = withTiming(targetLeft, undefined, () => ({
64
- duration: 200,
65
- easing: Easing.inOut(Easing.quad),
66
- }));
67
- fontSize.value = withTiming(targetSize, undefined, () => ({
68
- duration: 100,
69
- easing: Easing.inOut(Easing.quad),
70
- }));
71
- }, [notched]);
72
- return (React.createElement(LabelContainer, { onLayout: (event) => setLabelWidth(event.nativeEvent.layout.width), style: { ...labelStyle, elevation: notched ? 3 : 0 }, notched: notched },
73
- notched && React.createElement(LineCutout, { status: inputStatus, labelWidth: labelWidth }),
74
- React.createElement(LabelText, { style: { ...labelFontSize }, status: inputStatus }, placeholder)));
75
- };
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import { type InputProps as BaseInputType } from "../BaseInput/index";
3
- import { StyleProp, ViewStyle, TextInput } from "react-native";
4
- export type InputStatus = "default" | "focused" | "filled" | "error";
5
- export interface AnimatedInputProps extends BaseInputType {
6
- style?: StyleProp<ViewStyle>;
7
- }
8
- declare const _default: React.ForwardRefExoticComponent<AnimatedInputProps & React.RefAttributes<TextInput>>;
9
- export default _default;
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Input/AnimatedInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,UAAU,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAmB,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMhF,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AACrE,MAAM,WAAW,kBAAmB,SAAQ,aAAa;IACvD,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;;AAiED,wBAA+C"}
@@ -1,34 +0,0 @@
1
- import React from "react";
2
- import { BaseInput } from "..";
3
- import styled, { useTheme } from "styled-components/native";
4
- import { View } from "react-native";
5
- import { inputTextColor, inputStatusColors, getInputStatus } from "./inputTextColor";
6
- import { useAnimatedInputFocus } from "./useAnimatedInputFocus";
7
- import { AnimatedNotchedLabel } from "./AnimatedNotchedLabel";
8
- const InputContainer = styled(View) `
9
- position: relative;
10
- box-sizing: border-box;
11
- `;
12
- const AnimatedInput = ({ style = { width: "100%" }, ...textInputProps }, ref) => {
13
- const { placeholder, onFocus: onFocusCallback, onBlur: onBlurCallback, error, value, ...rest } = textInputProps;
14
- const theme = useTheme();
15
- const { onFocus, onBlur, focused } = useAnimatedInputFocus({
16
- onFocusCallback,
17
- onBlurCallback,
18
- });
19
- const inputStatus = getInputStatus({ focused, hasError: !!error, hasValue: !!value });
20
- const displayClearCross = inputStatus === "error" || inputStatus === "focused";
21
- return (React.createElement(InputContainer, { status: inputStatus, style: style },
22
- placeholder && (React.createElement(AnimatedNotchedLabel, { placeholder: placeholder, inputStatus: inputStatus, value: value })),
23
- React.createElement(BaseInput, { ref: ref, onFocus: onFocus, onBlur: onBlur, error: error, value: value, color: theme ? inputTextColor[inputStatus]({ theme }) : "neutral.c100", inputContainerStyle: {
24
- backgroundColor: "none",
25
- borderColor: theme ? inputStatusColors[inputStatus]({ theme }) : "neutral.c100",
26
- borderRadius: 8,
27
- height: inputStatus !== "error" ? 56 : 48,
28
- }, baseInputContainerStyle: {
29
- paddingRight: displayClearCross ? 8 : 14,
30
- }, inputErrorContainerStyles: {
31
- marginTop: 8,
32
- }, inputErrorColor: theme ? inputStatusColors[inputStatus]({ theme }) : "neutral.c100", showErrorIcon: true, ...rest })));
33
- };
34
- export default React.forwardRef(AnimatedInput);
@@ -1 +0,0 @@
1
- {"version":3,"file":"inputTextColor.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Input/AnimatedInput/inputTextColor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,iBAAiB;yBACP,WAAW;yBACX,WAAW;wBACZ,WAAW;uBACZ,WAAW;CAC/B,CAAC;AAEF,eAAO,MAAM,cAAc;yBACJ,WAAW;yBACX,WAAW;wBACZ,WAAW;uBACZ,WAAW;CAC/B,CAAC;AAEF,eAAO,MAAM,oBAAoB;yBACV,WAAW;yBACX,WAAW;wBACZ,WAAW;uBACZ,WAAW;CAC/B,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,cAAc,oCAAqC,mBAAmB,+CAKlF,CAAC"}
@@ -1,27 +0,0 @@
1
- export const inputStatusColors = {
2
- default: ({ theme }) => theme.colors.opacityDefault.c50,
3
- focused: ({ theme }) => theme.colors.primary.c80,
4
- filled: ({ theme }) => theme.colors.neutral.c60,
5
- error: ({ theme }) => theme.colors.error.c50,
6
- };
7
- export const inputTextColor = {
8
- default: ({ theme }) => theme.colors.opacityDefault.c70,
9
- focused: ({ theme }) => theme.colors.neutral.c100,
10
- filled: ({ theme }) => theme.colors.neutral.c100,
11
- error: ({ theme }) => theme.colors.neutral.c100,
12
- };
13
- export const inputBackgroundColor = {
14
- default: ({ theme }) => theme.colors.background.main,
15
- focused: ({ theme }) => theme.colors.background.main,
16
- filled: ({ theme }) => theme.colors.background.main,
17
- error: ({ theme }) => theme.colors.background.main,
18
- };
19
- export const getInputStatus = ({ focused, hasValue, hasError }) => {
20
- if (hasError)
21
- return "error";
22
- if (focused)
23
- return "focused";
24
- if (hasValue)
25
- return "filled";
26
- return "default";
27
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAnimatedInputFocus.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Input/AnimatedInput/useAnimatedInputFocus.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE7E,KAAK,0BAA0B,GAAG;IAChC,eAAe,CAAC,EAAE,CAChB,CAAC,EAAE,oBAAoB,CAAC,uBAAuB,CAAC,KAC7C,uBAAuB,GAAG,IAAI,CAAC;IACpC,cAAc,CAAC,EAAE,CACf,CAAC,EAAE,oBAAoB,CAAC,uBAAuB,CAAC,KAC7C,uBAAuB,GAAG,IAAI,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,qBAAqB,yCAG/B,0BAA0B;iBAGP,qBAAqB,uBAAuB,CAAC;gBAK9C,qBAAqB,uBAAuB,CAAC;;CAMjE,CAAC"}
@@ -1,6 +0,0 @@
1
- declare const _default: {
2
- width: number;
3
- height: number;
4
- };
5
- export default _default;
6
- //# sourceMappingURL=getDeviceSize.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDeviceSize.d.ts","sourceRoot":"","sources":["../../src/helpers/getDeviceSize.tsx"],"names":[],"mappings":";;;;AAIA,wBAAiC"}
@@ -1,3 +0,0 @@
1
- import { Dimensions } from "react-native";
2
- const { width, height } = Dimensions.get("window");
3
- export default { width, height };