@ledgerhq/native-ui 0.25.2 → 0.25.3-spl-tokens-test.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.
- package/lib/components/Form/Input/AnimatedInputSelect/Select.d.ts +9 -0
- package/lib/components/Form/Input/AnimatedInputSelect/Select.d.ts.map +1 -0
- package/lib/components/Form/Input/AnimatedInputSelect/Select.js +26 -0
- package/lib/components/Form/Input/AnimatedInputSelect/index.d.ts +13 -0
- package/lib/components/Form/Input/AnimatedInputSelect/index.d.ts.map +1 -0
- package/lib/components/Form/Input/AnimatedInputSelect/index.js +30 -0
- package/lib/components/Form/Input/index.d.ts +1 -0
- package/lib/components/Form/Input/index.d.ts.map +1 -1
- package/lib/components/Form/Input/index.js +1 -0
- package/lib/components/cta/Button/index.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface SelectProps {
|
|
3
|
+
text: string;
|
|
4
|
+
color: string;
|
|
5
|
+
onPressSelect?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const SelectComponent: ({ text, color, onPressSelect }: SelectProps) => React.JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../../src/components/Form/Input/AnimatedInputSelect/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAyB1B,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IAEd,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,eAAO,MAAM,eAAe,mCAAoC,WAAW,sBAS1E,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import styled from "styled-components/native";
|
|
3
|
+
import Flex from "../../../Layout/Flex/index";
|
|
4
|
+
import Text from "../../../Text/index";
|
|
5
|
+
import ChevronDown from "@ledgerhq/icons-ui/native/ChevronDown";
|
|
6
|
+
import { TouchableOpacity } from "react-native";
|
|
7
|
+
const Container = styled(Flex) `
|
|
8
|
+
border-left-width: 1px;
|
|
9
|
+
border-left-color: ${(p) => p.color};
|
|
10
|
+
width: 50%;
|
|
11
|
+
`;
|
|
12
|
+
const StyledTouchableOpacity = styled(TouchableOpacity) `
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
flex-direction: row;
|
|
15
|
+
align-items: center;
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: auto;
|
|
18
|
+
padding: ${({ theme }) => theme.space[6]}px 0px ${({ theme }) => theme.space[6]}px
|
|
19
|
+
${({ theme }) => theme.space[6]}px;
|
|
20
|
+
`;
|
|
21
|
+
export const SelectComponent = ({ text, color, onPressSelect }) => {
|
|
22
|
+
return (React.createElement(Container, { color: color },
|
|
23
|
+
React.createElement(StyledTouchableOpacity, { onPress: onPressSelect },
|
|
24
|
+
React.createElement(Text, { variant: "large" }, text),
|
|
25
|
+
React.createElement(ChevronDown, null))));
|
|
26
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type InputProps as BaseInputType } from "../BaseInput/index";
|
|
3
|
+
import { StyleProp, ViewStyle, TextInput } from "react-native";
|
|
4
|
+
export interface AnimatedInputProps extends BaseInputType {
|
|
5
|
+
selectProps: {
|
|
6
|
+
onPressSelect?: () => void;
|
|
7
|
+
text: string;
|
|
8
|
+
};
|
|
9
|
+
style?: StyleProp<ViewStyle>;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: React.ForwardRefExoticComponent<AnimatedInputProps & React.RefAttributes<TextInput>>;
|
|
12
|
+
export default _default;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React from "react";
|
|
13
|
+
import { AnimatedInput } from "..";
|
|
14
|
+
import { useTheme } from "styled-components/native";
|
|
15
|
+
import { useAnimatedInputFocus } from "../AnimatedInput/useAnimatedInputFocus";
|
|
16
|
+
import { getInputStatus, inputStatusColors } from "../AnimatedInput/inputTextColor";
|
|
17
|
+
import { SelectComponent } from "./Select";
|
|
18
|
+
const AnimatedInputSelect = (_a, ref) => {
|
|
19
|
+
var { selectProps } = _a, textInputProps = __rest(_a, ["selectProps"]);
|
|
20
|
+
const { placeholder, onFocus: onFocusCallback, onBlur: onBlurCallback, error, value, onChange } = textInputProps, rest = __rest(textInputProps, ["placeholder", "onFocus", "onBlur", "error", "value", "onChange"]);
|
|
21
|
+
const { onPressSelect, text } = selectProps;
|
|
22
|
+
const theme = useTheme();
|
|
23
|
+
const { onFocus, onBlur, focused } = useAnimatedInputFocus({
|
|
24
|
+
onFocusCallback,
|
|
25
|
+
onBlurCallback,
|
|
26
|
+
});
|
|
27
|
+
const inputStatus = getInputStatus({ focused, hasError: !!error, hasValue: !!value });
|
|
28
|
+
return (React.createElement(AnimatedInput, Object.assign({ 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)));
|
|
29
|
+
};
|
|
30
|
+
export default React.forwardRef(AnimatedInputSelect);
|
|
@@ -4,4 +4,5 @@ export { default as NumberInput } from "./NumberInput";
|
|
|
4
4
|
export { default as QrCodeInput } from "./QrCodeInput";
|
|
5
5
|
export { default as SearchInput } from "./SearchInput";
|
|
6
6
|
export { default as AnimatedInput } from "./AnimatedInput";
|
|
7
|
+
export { default as AnimatedInputSelect } from "./AnimatedInputSelect";
|
|
7
8
|
//# 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"}
|
|
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"}
|
|
@@ -4,3 +4,4 @@ export { default as NumberInput } from "./NumberInput";
|
|
|
4
4
|
export { default as QrCodeInput } from "./QrCodeInput";
|
|
5
5
|
export { default as SearchInput } from "./SearchInput";
|
|
6
6
|
export { default as AnimatedInput } from "./AnimatedInput";
|
|
7
|
+
export { default as AnimatedInputSelect } from "./AnimatedInputSelect";
|
|
@@ -84,7 +84,7 @@ const ButtonContainer = (props) => {
|
|
|
84
84
|
const Button = (props) => {
|
|
85
85
|
const { Icon, children, type = "default", iconName, disabled = false, pending = false, displayContentWhenPending = false, testID, } = props;
|
|
86
86
|
const theme = useTheme();
|
|
87
|
-
return (React.createElement(Base, Object.assign({}, props, { type: type, iconButton: (!!Icon || !!iconName) && !children,
|
|
87
|
+
return (React.createElement(Base, Object.assign({ activeOpacity: 1 }, props, { type: type, iconButton: (!!Icon || !!iconName) && !children, disabled: disabled || pending, testID: testID }),
|
|
88
88
|
React.createElement(View, null,
|
|
89
89
|
React.createElement(ButtonContainer, Object.assign({}, props, { type: type, hide: pending && !displayContentWhenPending })),
|
|
90
90
|
pending && !displayContentWhenPending ? (React.createElement(SpinnerContainer, { displayContentWhenPending: displayContentWhenPending },
|