@ledgerhq/lumen-ui-rnative 0.1.37 → 0.1.38
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/dist/module/lib/Components/AmountInput/AmountInput.js +109 -72
- package/dist/module/lib/Components/AmountInput/AmountInput.js.map +1 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.mdx +12 -0
- package/dist/module/lib/Components/AmountInput/AmountInput.stories.js +53 -0
- package/dist/module/lib/Components/AmountInput/AmountInput.stories.js.map +1 -1
- package/dist/module/lib/Components/Avatar/Avatar.js +6 -5
- package/dist/module/lib/Components/Avatar/Avatar.js.map +1 -1
- package/dist/module/lib/Components/Avatar/Avatar.mdx +2 -0
- package/dist/module/lib/Components/Avatar/Avatar.test.js +10 -13
- package/dist/module/lib/Components/Avatar/Avatar.test.js.map +1 -1
- package/dist/module/lib/Components/DotIcon/DotIcon.js +7 -4
- package/dist/module/lib/Components/DotIcon/DotIcon.js.map +1 -1
- package/dist/module/lib/Components/DotIcon/DotIcon.stories.js +10 -0
- package/dist/module/lib/Components/DotIcon/DotIcon.stories.js.map +1 -1
- package/dist/module/lib/Components/DotIndicator/DotIndicator.js +5 -5
- package/dist/module/lib/Components/DotIndicator/DotIndicator.js.map +1 -1
- package/dist/module/lib/Components/DotIndicator/DotIndicator.mdx +4 -4
- package/dist/module/lib/Components/DotIndicator/DotIndicator.stories.js +3 -3
- package/dist/module/lib/Components/DotIndicator/DotIndicator.test.js +12 -2
- package/dist/module/lib/Components/DotIndicator/DotIndicator.test.js.map +1 -1
- package/dist/module/lib/Components/DotSymbol/DotSymbol.js +7 -4
- package/dist/module/lib/Components/DotSymbol/DotSymbol.js.map +1 -1
- package/dist/module/lib/Components/DotSymbol/DotSymbol.stories.js +19 -0
- package/dist/module/lib/Components/DotSymbol/DotSymbol.stories.js.map +1 -1
- package/dist/module/lib/Components/Label/Label.js +1 -1
- package/dist/module/lib/Components/MediaButton/MediaButton.js +2 -2
- package/dist/module/lib/Components/MediaButton/MediaButton.mdx +2 -2
- package/dist/module/lib/Components/MediaImage/MediaImage.js +4 -2
- package/dist/module/lib/Components/MediaImage/MediaImage.js.map +1 -1
- package/dist/module/lib/Components/MediaImage/MediaImage.mdx +1 -1
- package/dist/module/lib/Components/MediaImage/MediaImage.stories.js +12 -0
- package/dist/module/lib/Components/MediaImage/MediaImage.stories.js.map +1 -1
- package/dist/module/lib/Components/OptionList/OptionList.mdx +1 -1
- package/dist/module/lib/Components/ThemeProvider/ThemeProvider.js +2 -5
- package/dist/module/lib/Components/ThemeProvider/ThemeProvider.js.map +1 -1
- package/dist/module/lib/Components/index.js +0 -1
- package/dist/module/lib/Components/index.js.map +1 -1
- package/dist/module/lib/Symbols/Icons/Lightbulb.js +3 -3
- package/dist/module/lib/Symbols/Icons/Lightbulb.js.map +1 -1
- package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts +1 -1
- package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/AmountInput/types.d.ts +12 -0
- package/dist/typescript/src/lib/Components/AmountInput/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Avatar/Avatar.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/DotIcon/DotIcon.d.ts +2 -1
- package/dist/typescript/src/lib/Components/DotIcon/DotIcon.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/DotIcon/types.d.ts +1 -1
- package/dist/typescript/src/lib/Components/DotIcon/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/DotIndicator/types.d.ts +2 -2
- package/dist/typescript/src/lib/Components/DotSymbol/DotSymbol.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/DotSymbol/types.d.ts +1 -1
- package/dist/typescript/src/lib/Components/DotSymbol/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Label/Label.d.ts +1 -1
- package/dist/typescript/src/lib/Components/MediaButton/MediaButton.d.ts +2 -2
- package/dist/typescript/src/lib/Components/MediaImage/MediaImage.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/MediaImage/types.d.ts +1 -1
- package/dist/typescript/src/lib/Components/MediaImage/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/index.d.ts +0 -1
- package/dist/typescript/src/lib/Components/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/lib/Components/AmountInput/AmountInput.mdx +12 -0
- package/src/lib/Components/AmountInput/AmountInput.stories.tsx +68 -1
- package/src/lib/Components/AmountInput/AmountInput.tsx +118 -75
- package/src/lib/Components/AmountInput/types.ts +14 -0
- package/src/lib/Components/Avatar/Avatar.mdx +2 -0
- package/src/lib/Components/Avatar/Avatar.test.tsx +16 -18
- package/src/lib/Components/Avatar/Avatar.tsx +9 -8
- package/src/lib/Components/DotIcon/DotIcon.stories.tsx +8 -0
- package/src/lib/Components/DotIcon/DotIcon.tsx +4 -1
- package/src/lib/Components/DotIcon/types.ts +1 -1
- package/src/lib/Components/DotIndicator/DotIndicator.mdx +4 -4
- package/src/lib/Components/DotIndicator/DotIndicator.stories.tsx +2 -2
- package/src/lib/Components/DotIndicator/DotIndicator.test.tsx +12 -2
- package/src/lib/Components/DotIndicator/DotIndicator.tsx +5 -5
- package/src/lib/Components/DotIndicator/types.ts +2 -2
- package/src/lib/Components/DotSymbol/DotSymbol.stories.tsx +15 -0
- package/src/lib/Components/DotSymbol/DotSymbol.tsx +4 -1
- package/src/lib/Components/DotSymbol/types.ts +1 -1
- package/src/lib/Components/Label/Label.tsx +1 -1
- package/src/lib/Components/MediaButton/MediaButton.mdx +2 -2
- package/src/lib/Components/MediaButton/MediaButton.tsx +2 -2
- package/src/lib/Components/MediaImage/MediaImage.mdx +1 -1
- package/src/lib/Components/MediaImage/MediaImage.stories.tsx +3 -0
- package/src/lib/Components/MediaImage/MediaImage.tsx +2 -0
- package/src/lib/Components/MediaImage/types.ts +1 -1
- package/src/lib/Components/OptionList/OptionList.mdx +1 -1
- package/src/lib/Components/ThemeProvider/ThemeProvider.tsx +1 -4
- package/src/lib/Components/index.ts +0 -1
- package/src/lib/Symbols/Icons/Lightbulb.tsx +3 -3
- package/dist/module/lib/Components/Select/GlobalSelectBottomSheet.js +0 -155
- package/dist/module/lib/Components/Select/GlobalSelectBottomSheet.js.map +0 -1
- package/dist/module/lib/Components/Select/GlobalSelectContext.js +0 -78
- package/dist/module/lib/Components/Select/GlobalSelectContext.js.map +0 -1
- package/dist/module/lib/Components/Select/Select.js +0 -366
- package/dist/module/lib/Components/Select/Select.js.map +0 -1
- package/dist/module/lib/Components/Select/Select.mdx +0 -596
- package/dist/module/lib/Components/Select/Select.stories.js +0 -304
- package/dist/module/lib/Components/Select/Select.stories.js.map +0 -1
- package/dist/module/lib/Components/Select/Select.test.js +0 -123
- package/dist/module/lib/Components/Select/Select.test.js.map +0 -1
- package/dist/module/lib/Components/Select/SelectContext.js +0 -38
- package/dist/module/lib/Components/Select/SelectContext.js.map +0 -1
- package/dist/module/lib/Components/Select/index.js +0 -6
- package/dist/module/lib/Components/Select/index.js.map +0 -1
- package/dist/module/lib/Components/Select/types.js +0 -4
- package/dist/module/lib/Components/Select/types.js.map +0 -1
- package/dist/typescript/src/lib/Components/Select/GlobalSelectBottomSheet.d.ts +0 -20
- package/dist/typescript/src/lib/Components/Select/GlobalSelectBottomSheet.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/Select/GlobalSelectContext.d.ts +0 -44
- package/dist/typescript/src/lib/Components/Select/GlobalSelectContext.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/Select/Select.d.ts +0 -52
- package/dist/typescript/src/lib/Components/Select/Select.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/Select/SelectContext.d.ts +0 -36
- package/dist/typescript/src/lib/Components/Select/SelectContext.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/Select/index.d.ts +0 -4
- package/dist/typescript/src/lib/Components/Select/index.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/Select/types.d.ts +0 -130
- package/dist/typescript/src/lib/Components/Select/types.d.ts.map +0 -1
- package/src/lib/Components/Select/GlobalSelectBottomSheet.tsx +0 -180
- package/src/lib/Components/Select/GlobalSelectContext.tsx +0 -103
- package/src/lib/Components/Select/Select.mdx +0 -596
- package/src/lib/Components/Select/Select.stories.tsx +0 -266
- package/src/lib/Components/Select/Select.test.tsx +0 -117
- package/src/lib/Components/Select/Select.tsx +0 -469
- package/src/lib/Components/Select/SelectContext.tsx +0 -68
- package/src/lib/Components/Select/index.ts +0 -3
- package/src/lib/Components/Select/types.ts +0 -149
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Svg","Path","createIcon","jsx","_jsx","Lightbulb","width","height","fill","viewBox","children","stroke","strokeLinecap","strokeLinejoin","strokeWidth","d"],"sourceRoot":"../../../../../src","sources":["lib/Symbols/Icons/Lightbulb.tsx"],"mappings":";;AAAA,OAAOA,GAAG,IAAIC,IAAI,QAAQ,kBAAkB;AAC5C,OAAOC,UAAU,MAAM,qCAAkC;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA7BA,SAAAC,GAAA,IAAAC,IAAA;AA8BA,OAAO,MAAMC,SAAS,GAAGH,UAAU,CACjC,WAAW,eACXE,IAAA,CAACJ,GAAG;EAACM,KAAK,EAAE,EAAG;EAACC,MAAM,EAAE,EAAG;EAACC,IAAI,EAAC,cAAc;EAACC,OAAO,EAAC,WAAW;EAAAC,QAAA,eACjEN,IAAA,CAACH,IAAI;IACHU,MAAM,EAAC,cAAc;IACrBC,aAAa,EAAC,OAAO;IACrBC,cAAc,EAAC,OAAO;IACtBC,WAAW,EAAE,GAAI;IACjBC,CAAC,EAAC;
|
|
1
|
+
{"version":3,"names":["Svg","Path","createIcon","jsx","_jsx","Lightbulb","width","height","fill","viewBox","children","stroke","strokeLinecap","strokeLinejoin","strokeWidth","d"],"sourceRoot":"../../../../../src","sources":["lib/Symbols/Icons/Lightbulb.tsx"],"mappings":";;AAAA,OAAOA,GAAG,IAAIC,IAAI,QAAQ,kBAAkB;AAC5C,OAAOC,UAAU,MAAM,qCAAkC;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA7BA,SAAAC,GAAA,IAAAC,IAAA;AA8BA,OAAO,MAAMC,SAAS,GAAGH,UAAU,CACjC,WAAW,eACXE,IAAA,CAACJ,GAAG;EAACM,KAAK,EAAE,EAAG;EAACC,MAAM,EAAE,EAAG;EAACC,IAAI,EAAC,cAAc;EAACC,OAAO,EAAC,WAAW;EAAAC,QAAA,eACjEN,IAAA,CAACH,IAAI;IACHU,MAAM,EAAC,cAAc;IACrBC,aAAa,EAAC,OAAO;IACrBC,cAAc,EAAC,OAAO;IACtBC,WAAW,EAAE,GAAI;IACjBC,CAAC,EAAC;EAAkY,CACrY;AAAC,CACC,CACP,CAAC","ignoreList":[]}
|
|
@@ -4,5 +4,5 @@ import { type AmountInputProps } from './types';
|
|
|
4
4
|
* This is a controlled component - both `value` and `onChange` props are required.
|
|
5
5
|
* The currency text can be positioned either on the left or right side of the input.
|
|
6
6
|
*/
|
|
7
|
-
export declare const AmountInput: ({ lx, style, currencyText, currencyPosition, editable, disabled: disabledProp, maxIntegerLength, maxDecimalLength, allowDecimals, thousandsSeparator, value, onChangeText, isInvalid, ref, ...props }: AmountInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const AmountInput: ({ lx, style, size, align, currencyText, currencyPosition, editable, disabled: disabledProp, maxIntegerLength, maxDecimalLength, allowDecimals, thousandsSeparator, value, onChangeText, isInvalid, ref, ...props }: AmountInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
//# sourceMappingURL=AmountInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmountInput.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/AmountInput/AmountInput.tsx"],"names":[],"mappings":"AAiBA,OAAO,
|
|
1
|
+
{"version":3,"file":"AmountInput.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/AmountInput/AmountInput.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAEL,KAAK,gBAAgB,EAEtB,MAAM,SAAS,CAAC;AAEjB;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,oNAkBzB,gBAAgB,4CA0JlB,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { TextInputProps, ViewStyle } from 'react-native';
|
|
2
2
|
import type { BoxProps } from '../Utility';
|
|
3
|
+
export type AmountInputSize = 'md' | 'sm';
|
|
4
|
+
export type AmountInputAlign = 'center' | 'start' | 'end';
|
|
3
5
|
export type AmountInputProps = Omit<TextInputProps, 'value' | 'onChangeText'> & {
|
|
4
6
|
/**
|
|
5
7
|
* The controlled value of the input
|
|
@@ -11,6 +13,16 @@ export type AmountInputProps = Omit<TextInputProps, 'value' | 'onChangeText'> &
|
|
|
11
13
|
* @required
|
|
12
14
|
*/
|
|
13
15
|
onChangeText: (text: string) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Visual size of the amount input.
|
|
18
|
+
* @default 'md'
|
|
19
|
+
*/
|
|
20
|
+
size?: AmountInputSize;
|
|
21
|
+
/**
|
|
22
|
+
* Horizontal alignment of the amount and currency.
|
|
23
|
+
* @default 'center'
|
|
24
|
+
*/
|
|
25
|
+
align?: AmountInputAlign;
|
|
14
26
|
/**
|
|
15
27
|
* The currency text (e.g. USD, EUR)
|
|
16
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/AmountInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,cAAc,EACd,OAAO,GAAG,cAAc,CACzB,GAAG;IACF;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB;;;OAGG;IACH,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACpC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,GAAG,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/AmountInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1C,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;AAE1D,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,cAAc,EACd,OAAO,GAAG,cAAc,CACzB,GAAG;IACF;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB;;;OAGG;IACH,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC;;;OAGG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB;;;OAGG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACpC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,GAAG,QAAQ,CAAC"}
|
|
@@ -15,5 +15,5 @@ import type { AvatarProps } from './types';
|
|
|
15
15
|
* // With notification indicator
|
|
16
16
|
* <Avatar src="https://example.com/photo.jpg" showNotification />
|
|
17
17
|
*/
|
|
18
|
-
export declare const Avatar: ({ lx, style, src, alt, size, showNotification, testID, ref, ...props }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const Avatar: ({ lx, style, src, alt, size, showNotification: showNotificationProp, testID, ref, ...props }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Avatar/Avatar.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Avatar/Avatar.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAmD3C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM,GAAI,8FAUpB,WAAW,4CAyDb,CAAC"}
|
|
@@ -4,12 +4,13 @@ export declare const mediaImageDotIconSizeMap: {
|
|
|
4
4
|
readonly 48: 20;
|
|
5
5
|
readonly 56: 24;
|
|
6
6
|
readonly 64: 24;
|
|
7
|
+
readonly 72: 32;
|
|
7
8
|
};
|
|
8
9
|
export declare const spotDotIconSizeMap: {
|
|
9
10
|
readonly 40: 16;
|
|
10
11
|
readonly 48: 20;
|
|
11
12
|
readonly 56: 24;
|
|
12
|
-
readonly 72:
|
|
13
|
+
readonly 72: 32;
|
|
13
14
|
};
|
|
14
15
|
/**
|
|
15
16
|
* A wrapper component that positions a small icon indicator at a configurable
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DotIcon.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/DotIcon/DotIcon.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAGV,YAAY,EAEb,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"DotIcon.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/DotIcon/DotIcon.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAGV,YAAY,EAEb,MAAM,SAAS,CAAC;AAgBjB,eAAO,MAAM,wBAAwB;;;;;;CAMW,CAAC;AAEjD,eAAO,MAAM,kBAAkB;;;;;CAKiB,CAAC;AAyEjD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,OAAO;8GAYjB,YAAY;;CAyBd,CAAC"}
|
|
@@ -2,7 +2,7 @@ import type { ComponentType, ReactNode } from 'react';
|
|
|
2
2
|
import type { StyleProp, TextStyle } from 'react-native';
|
|
3
3
|
import type { StyledViewProps } from '../../../styles';
|
|
4
4
|
import type { IconSize } from '../Icon';
|
|
5
|
-
export type DotIconSize = 16 | 20 | 24;
|
|
5
|
+
export type DotIconSize = 16 | 20 | 24 | 32;
|
|
6
6
|
export type DotIconPin = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
|
|
7
7
|
export type DotIconAppearance = 'success' | 'muted' | 'error';
|
|
8
8
|
export type DotIconProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/DotIcon/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,MAAM,WAAW,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/DotIcon/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,MAAM,WAAW,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE5C,MAAM,MAAM,UAAU,GAClB,WAAW,GACX,SAAS,GACT,cAAc,GACd,YAAY,CAAC;AAEjB,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAE9D,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,IAAI,EAAE,aAAa,CAAC;QAAE,IAAI,CAAC,EAAE,QAAQ,CAAC;QAAC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;KAAE,CAAC,CAAC;IACvE;;OAEG;IACH,UAAU,EAAE,iBAAiB,CAAC;IAC9B;;;OAGG;IACH,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -3,9 +3,9 @@ import type { StyledViewProps } from '../../../styles';
|
|
|
3
3
|
export type DotIndicatorProps = {
|
|
4
4
|
/**
|
|
5
5
|
* The size of the dot indicator.
|
|
6
|
-
* @default
|
|
6
|
+
* @default md
|
|
7
7
|
*/
|
|
8
|
-
size?: '
|
|
8
|
+
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
9
9
|
/**
|
|
10
10
|
* The appearance of the dot indicator.
|
|
11
11
|
* @default base
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DotSymbol.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/DotSymbol/DotSymbol.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,KAAK,EAAgB,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"DotSymbol.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/DotSymbol/DotSymbol.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,KAAK,EAAgB,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAsB3E,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,cAAc,EAAE,aAAa,CAWtE,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,QAAQ,EAAE,aAAa,CAM1D,CAAC;AAgEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS;gGAYnB,cAAc;;CAwChB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { StyledViewProps } from '../../../styles';
|
|
3
|
-
export type DotSymbolSize = 8 | 10 | 12 | 16 | 20 | 24;
|
|
3
|
+
export type DotSymbolSize = 8 | 10 | 12 | 16 | 20 | 24 | 32;
|
|
4
4
|
export type DotSymbolPin = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
|
|
5
5
|
export type DotSymbolProps = {
|
|
6
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/DotSymbol/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/DotSymbol/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE5D,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,SAAS,GACT,cAAc,GACd,YAAY,CAAC;AAEjB,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,YAAY,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -3,7 +3,7 @@ import type { LabelProps } from './types';
|
|
|
3
3
|
* A label that should be used to describe a form field.
|
|
4
4
|
*
|
|
5
5
|
* Either choices fields like checkbox, switch or radio.
|
|
6
|
-
* Or text fields like input, textarea,
|
|
6
|
+
* Or text fields like input, textarea, option list, etc.
|
|
7
7
|
*/
|
|
8
8
|
export declare const Label: ({ style, lx, disabled: disabledProp, children, onPress, onLongPress, ref, ...props }: LabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
//# sourceMappingURL=Label.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { MediaButtonProps } from './types';
|
|
2
2
|
/**
|
|
3
|
-
* Media button for
|
|
3
|
+
* Media button for option list/dropdown components. Displays a label with an optional
|
|
4
4
|
* leading content and a trailing chevron indicator.
|
|
5
5
|
*
|
|
6
|
-
* This component is intended to be used exclusively as the trigger inside
|
|
6
|
+
* This component is intended to be used exclusively as the trigger inside an OptionList or
|
|
7
7
|
* dropdown pattern. It should not be used as a standalone action button — use `Button`
|
|
8
8
|
* or `IconButton` instead.
|
|
9
9
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaImage.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/MediaImage/MediaImage.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAmB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"MediaImage.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/MediaImage/MediaImage.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAmB,MAAM,SAAS,CAAC;AAiBhF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAWtD,CAAC;AAgDF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,UAAU,GAAI,gGAYxB,eAAe,4CA+CjB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StyledViewProps } from '../../../styles';
|
|
2
|
-
export type MediaImageSize = 12 | 16 | 20 | 24 | 32 | 40 | 48 | 56 | 64;
|
|
2
|
+
export type MediaImageSize = 12 | 16 | 20 | 24 | 32 | 40 | 48 | 56 | 64 | 72;
|
|
3
3
|
export type MediaImageShape = 'square' | 'circle';
|
|
4
4
|
export type MediaImageProps = {
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/MediaImage/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/MediaImage/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE7E,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAElD,MAAM,MAAM,eAAe,GAAG;IAC5B;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/ThemeProvider/ThemeProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/ThemeProvider/ThemeProvider.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAIlD,QAAA,MAAM,aAAa,GAAI,4CAKpB,kBAAkB,4CAUpB,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-rnative",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.38",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"!**/*.tsbuildinfo"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@ledgerhq/lumen-utils-shared": "0.1.
|
|
45
|
+
"@ledgerhq/lumen-utils-shared": "0.1.5",
|
|
46
46
|
"i18next": "^23.7.0",
|
|
47
47
|
"react-i18next": "^14.0.0"
|
|
48
48
|
},
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@types/react": "^19.0.0",
|
|
54
54
|
"@gorhom/bottom-sheet": "^5.0.0",
|
|
55
|
-
"@ledgerhq/lumen-design-core": "0.1.
|
|
55
|
+
"@ledgerhq/lumen-design-core": "0.1.16",
|
|
56
56
|
"react": "^19.0.0",
|
|
57
57
|
"react-native": "~0.79.7",
|
|
58
58
|
"react-native-reanimated": "^4.1.0",
|
|
@@ -29,6 +29,18 @@ AmountInput is a specialized input component designed for handling numeric value
|
|
|
29
29
|
|
|
30
30
|
> **Layout:** The AmountInput component takes the full width of its container by default. You can control the width by using the `style` prop or by wrapping in a container.
|
|
31
31
|
|
|
32
|
+
### Size
|
|
33
|
+
|
|
34
|
+
Use the `size` prop to control typography scale.
|
|
35
|
+
|
|
36
|
+
<Canvas of={AmountInputStories.Size} />
|
|
37
|
+
|
|
38
|
+
### Alignment
|
|
39
|
+
|
|
40
|
+
Use the `align` prop to position the amount within its container. Defaults to `center`. Use `start` or `end` for left- or right-aligned layouts.
|
|
41
|
+
|
|
42
|
+
<Canvas of={AmountInputStories.Alignment} />
|
|
43
|
+
|
|
32
44
|
### Currency Text Position
|
|
33
45
|
|
|
34
46
|
The currency text can be positioned on either the **left** (default) or **right** side of the input:
|
|
@@ -2,7 +2,18 @@ import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { View } from 'react-native';
|
|
4
4
|
import { AmountInput } from './AmountInput';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
type AmountInputAlign,
|
|
7
|
+
type AmountInputProps,
|
|
8
|
+
type AmountInputSize,
|
|
9
|
+
} from './types';
|
|
10
|
+
|
|
11
|
+
const ALIGNMENTS: AmountInputAlign[] = ['start', 'center', 'end'];
|
|
12
|
+
|
|
13
|
+
const SIZES: { size: AmountInputSize; value: string }[] = [
|
|
14
|
+
{ size: 'md', value: '1234.56' },
|
|
15
|
+
{ size: 'sm', value: '55 555' },
|
|
16
|
+
];
|
|
6
17
|
|
|
7
18
|
const meta: Meta<typeof AmountInput> = {
|
|
8
19
|
component: AmountInput,
|
|
@@ -16,6 +27,15 @@ const meta: Meta<typeof AmountInput> = {
|
|
|
16
27
|
},
|
|
17
28
|
},
|
|
18
29
|
},
|
|
30
|
+
argTypes: {
|
|
31
|
+
isInvalid: {
|
|
32
|
+
control: 'boolean',
|
|
33
|
+
description: 'Marks the input as invalid for error styling.',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
args: {
|
|
37
|
+
isInvalid: false,
|
|
38
|
+
},
|
|
19
39
|
};
|
|
20
40
|
|
|
21
41
|
export default meta;
|
|
@@ -68,6 +88,53 @@ export const WithValue: Story = {
|
|
|
68
88
|
},
|
|
69
89
|
};
|
|
70
90
|
|
|
91
|
+
export const Size: Story = {
|
|
92
|
+
render: () => (
|
|
93
|
+
<View
|
|
94
|
+
style={{
|
|
95
|
+
width: '100%',
|
|
96
|
+
maxWidth: 320,
|
|
97
|
+
alignItems: 'center',
|
|
98
|
+
gap: 24,
|
|
99
|
+
padding: 24,
|
|
100
|
+
}}
|
|
101
|
+
>
|
|
102
|
+
{SIZES.map(({ size, value }) => (
|
|
103
|
+
<AmountInput
|
|
104
|
+
key={size}
|
|
105
|
+
size={size}
|
|
106
|
+
value={value}
|
|
107
|
+
currencyText='$'
|
|
108
|
+
onChangeText={() => {}}
|
|
109
|
+
/>
|
|
110
|
+
))}
|
|
111
|
+
</View>
|
|
112
|
+
),
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const Alignment: Story = {
|
|
116
|
+
render: () => (
|
|
117
|
+
<View
|
|
118
|
+
style={{
|
|
119
|
+
width: '100%',
|
|
120
|
+
maxWidth: 320,
|
|
121
|
+
gap: 24,
|
|
122
|
+
padding: 24,
|
|
123
|
+
}}
|
|
124
|
+
>
|
|
125
|
+
{ALIGNMENTS.map((align) => (
|
|
126
|
+
<AmountInput
|
|
127
|
+
key={align}
|
|
128
|
+
align={align}
|
|
129
|
+
value='1234.56'
|
|
130
|
+
currencyText='$'
|
|
131
|
+
onChangeText={() => {}}
|
|
132
|
+
/>
|
|
133
|
+
))}
|
|
134
|
+
</View>
|
|
135
|
+
),
|
|
136
|
+
};
|
|
137
|
+
|
|
71
138
|
export const CurrencyPositionLeft: Story = {
|
|
72
139
|
render: (args) => <AmountInputStory {...args} />,
|
|
73
140
|
args: {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
useDisabledContext,
|
|
5
5
|
} from '@ledgerhq/lumen-utils-shared';
|
|
6
6
|
import { useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
7
|
-
import { Pressable, StyleSheet, TextInput } from 'react-native';
|
|
7
|
+
import { Pressable, StyleSheet, TextInput, View } from 'react-native';
|
|
8
8
|
import Animated, {
|
|
9
9
|
Easing,
|
|
10
10
|
useAnimatedStyle,
|
|
@@ -13,9 +13,13 @@ import Animated, {
|
|
|
13
13
|
withSequence,
|
|
14
14
|
withTiming,
|
|
15
15
|
} from 'react-native-reanimated';
|
|
16
|
-
import { useStyleSheet } from '../../../styles';
|
|
16
|
+
import { useStyleSheet, useTheme } from '../../../styles';
|
|
17
17
|
import { Box } from '../Utility';
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
type AmountInputAlign,
|
|
20
|
+
type AmountInputProps,
|
|
21
|
+
type AmountInputSize,
|
|
22
|
+
} from './types';
|
|
19
23
|
|
|
20
24
|
/**
|
|
21
25
|
* AmountInput component for handling numeric input with currency display.
|
|
@@ -25,6 +29,8 @@ import { type AmountInputProps } from './types';
|
|
|
25
29
|
export const AmountInput = ({
|
|
26
30
|
lx = {},
|
|
27
31
|
style,
|
|
32
|
+
size = 'md',
|
|
33
|
+
align = 'center',
|
|
28
34
|
currencyText,
|
|
29
35
|
currencyPosition = 'left',
|
|
30
36
|
editable,
|
|
@@ -48,16 +54,20 @@ export const AmountInput = ({
|
|
|
48
54
|
});
|
|
49
55
|
|
|
50
56
|
const translateX = useSharedValue(0);
|
|
51
|
-
const animatedFontSize = useSharedValue(getFontSize(inputValue));
|
|
57
|
+
const animatedFontSize = useSharedValue(getFontSize(inputValue, size));
|
|
52
58
|
const caretOpacity = useSharedValue(0);
|
|
53
59
|
|
|
54
60
|
useImperativeHandle(ref, () => inputRef.current as TextInput, []);
|
|
55
61
|
|
|
62
|
+
const { theme } = useTheme();
|
|
56
63
|
const styles = useStyles({
|
|
64
|
+
size,
|
|
65
|
+
align,
|
|
57
66
|
hasValue: !!inputValue,
|
|
58
67
|
isEditable: !disabled,
|
|
59
68
|
isInvalid,
|
|
60
69
|
});
|
|
70
|
+
const caretFixedHeight = size === 'sm' ? theme.sizes.s28 : 0;
|
|
61
71
|
|
|
62
72
|
const animatedInputStyle = useAnimatedStyle(
|
|
63
73
|
() => ({
|
|
@@ -79,13 +89,13 @@ export const AmountInput = ({
|
|
|
79
89
|
const animatedCaretStyle = useAnimatedStyle(
|
|
80
90
|
() => ({
|
|
81
91
|
opacity: caretOpacity.value,
|
|
82
|
-
height: animatedFontSize.value,
|
|
92
|
+
height: size === 'sm' ? caretFixedHeight : animatedFontSize.value,
|
|
83
93
|
}),
|
|
84
|
-
[caretOpacity, animatedFontSize],
|
|
94
|
+
[caretOpacity, animatedFontSize, size, caretFixedHeight],
|
|
85
95
|
);
|
|
86
96
|
|
|
87
97
|
useEffect(() => {
|
|
88
|
-
const newSize = getFontSize(inputValue);
|
|
98
|
+
const newSize = getFontSize(inputValue, size);
|
|
89
99
|
|
|
90
100
|
translateX.value = withSequence(
|
|
91
101
|
withTiming(4, { duration: 0 }),
|
|
@@ -99,7 +109,7 @@ export const AmountInput = ({
|
|
|
99
109
|
duration: 250,
|
|
100
110
|
easing: Easing.bezier(0.4, 0, 0.2, 1),
|
|
101
111
|
});
|
|
102
|
-
}, [inputValue, animatedFontSize, translateX]);
|
|
112
|
+
}, [inputValue, size, animatedFontSize, translateX]);
|
|
103
113
|
|
|
104
114
|
useEffect(() => {
|
|
105
115
|
if (isFocused && !disabled) {
|
|
@@ -164,94 +174,127 @@ export const AmountInput = ({
|
|
|
164
174
|
style={styles.hiddenInput}
|
|
165
175
|
{...props}
|
|
166
176
|
/>
|
|
167
|
-
<
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
{currencyPosition === 'left' && CurrencyText}
|
|
173
|
-
|
|
174
|
-
{/** display text that mirrors the hidden input's value */}
|
|
175
|
-
<Animated.Text
|
|
176
|
-
style={[styles.displayText, animatedInputStyle, style]}
|
|
177
|
-
allowFontScaling={false}
|
|
177
|
+
<View style={styles.alignRow}>
|
|
178
|
+
<Pressable
|
|
179
|
+
onPress={handlePress}
|
|
180
|
+
style={styles.pressable}
|
|
181
|
+
accessibilityLabel={props.accessibilityLabel || 'Amount input'}
|
|
178
182
|
>
|
|
179
|
-
{
|
|
180
|
-
|
|
183
|
+
{currencyPosition === 'left' && CurrencyText}
|
|
184
|
+
|
|
185
|
+
{/** display text that mirrors the hidden input's value */}
|
|
186
|
+
<Animated.Text
|
|
187
|
+
style={[styles.displayText, animatedInputStyle, style]}
|
|
188
|
+
allowFontScaling={false}
|
|
189
|
+
>
|
|
190
|
+
{inputValue || '0'}
|
|
191
|
+
</Animated.Text>
|
|
181
192
|
|
|
182
|
-
|
|
183
|
-
|
|
193
|
+
{/** custom caret */}
|
|
194
|
+
<Animated.View style={[styles.caret, animatedCaretStyle]} />
|
|
184
195
|
|
|
185
|
-
|
|
186
|
-
|
|
196
|
+
{currencyPosition === 'right' && CurrencyText}
|
|
197
|
+
</Pressable>
|
|
198
|
+
</View>
|
|
187
199
|
</Box>
|
|
188
200
|
);
|
|
189
201
|
};
|
|
190
202
|
|
|
203
|
+
const SIZE_TYPOGRAPHY = {
|
|
204
|
+
md: 'heading0SemiBold',
|
|
205
|
+
sm: 'heading2SemiBold',
|
|
206
|
+
} as const satisfies Record<
|
|
207
|
+
AmountInputSize,
|
|
208
|
+
'heading0SemiBold' | 'heading2SemiBold'
|
|
209
|
+
>;
|
|
210
|
+
|
|
211
|
+
const ALIGN_ROW_JUSTIFY = {
|
|
212
|
+
center: 'center',
|
|
213
|
+
start: 'flex-start',
|
|
214
|
+
end: 'flex-end',
|
|
215
|
+
} as const satisfies Record<
|
|
216
|
+
AmountInputAlign,
|
|
217
|
+
'center' | 'flex-start' | 'flex-end'
|
|
218
|
+
>;
|
|
219
|
+
|
|
191
220
|
const useStyles = ({
|
|
221
|
+
size,
|
|
222
|
+
align,
|
|
192
223
|
hasValue,
|
|
193
224
|
isEditable,
|
|
194
225
|
isInvalid,
|
|
195
226
|
}: {
|
|
227
|
+
size: AmountInputSize;
|
|
228
|
+
align: AmountInputAlign;
|
|
196
229
|
hasValue: boolean;
|
|
197
230
|
isEditable: boolean;
|
|
198
231
|
isInvalid: boolean;
|
|
199
232
|
}) => {
|
|
200
233
|
return useStyleSheet(
|
|
201
|
-
(t) =>
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
opacity: 0,
|
|
210
|
-
},
|
|
211
|
-
pressable: {
|
|
212
|
-
flexDirection: 'row',
|
|
213
|
-
alignItems: 'center',
|
|
214
|
-
justifyContent: 'center',
|
|
215
|
-
},
|
|
216
|
-
displayText: StyleSheet.flatten([
|
|
217
|
-
{
|
|
218
|
-
height: t.sizes.s56,
|
|
219
|
-
backgroundColor: 'transparent',
|
|
220
|
-
color: t.colors.text.base,
|
|
221
|
-
alignItems: 'flex-start',
|
|
222
|
-
...t.typographies.heading0SemiBold,
|
|
223
|
-
},
|
|
224
|
-
!hasValue && {
|
|
225
|
-
color: t.colors.text.mutedSubtle,
|
|
226
|
-
},
|
|
227
|
-
!isEditable && {
|
|
228
|
-
color: t.colors.text.disabled,
|
|
229
|
-
},
|
|
230
|
-
isInvalid && {
|
|
231
|
-
color: t.colors.text.error,
|
|
234
|
+
(t) => {
|
|
235
|
+
const typography = t.typographies[SIZE_TYPOGRAPHY[size]];
|
|
236
|
+
const displayHeight = size === 'md' ? t.sizes.s56 : t.sizes.s36;
|
|
237
|
+
|
|
238
|
+
return {
|
|
239
|
+
container: {
|
|
240
|
+
position: 'relative',
|
|
241
|
+
width: t.sizes.full,
|
|
232
242
|
},
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
243
|
+
hiddenInput: {
|
|
244
|
+
position: 'absolute',
|
|
245
|
+
width: t.sizes.full,
|
|
246
|
+
height: t.sizes.full,
|
|
247
|
+
opacity: 0,
|
|
238
248
|
},
|
|
239
|
-
|
|
240
|
-
|
|
249
|
+
alignRow: {
|
|
250
|
+
width: t.sizes.full,
|
|
251
|
+
flexDirection: 'row',
|
|
252
|
+
justifyContent: ALIGN_ROW_JUSTIFY[align],
|
|
241
253
|
},
|
|
242
|
-
|
|
243
|
-
|
|
254
|
+
pressable: {
|
|
255
|
+
flexDirection: 'row',
|
|
256
|
+
alignItems: 'center',
|
|
244
257
|
},
|
|
245
|
-
|
|
246
|
-
|
|
258
|
+
displayText: StyleSheet.flatten([
|
|
259
|
+
{
|
|
260
|
+
height: displayHeight,
|
|
261
|
+
backgroundColor: 'transparent',
|
|
262
|
+
color: t.colors.text.base,
|
|
263
|
+
alignItems: 'flex-start',
|
|
264
|
+
...typography,
|
|
265
|
+
},
|
|
266
|
+
!hasValue && {
|
|
267
|
+
color: t.colors.text.mutedSubtle,
|
|
268
|
+
},
|
|
269
|
+
!isEditable && {
|
|
270
|
+
color: t.colors.text.disabled,
|
|
271
|
+
},
|
|
272
|
+
isInvalid && {
|
|
273
|
+
color: t.colors.text.error,
|
|
274
|
+
},
|
|
275
|
+
]),
|
|
276
|
+
currency: StyleSheet.flatten([
|
|
277
|
+
{
|
|
278
|
+
color: t.colors.text.base,
|
|
279
|
+
...typography,
|
|
280
|
+
},
|
|
281
|
+
!hasValue && {
|
|
282
|
+
color: t.colors.text.mutedSubtle,
|
|
283
|
+
},
|
|
284
|
+
!isEditable && {
|
|
285
|
+
color: t.colors.text.disabled,
|
|
286
|
+
},
|
|
287
|
+
isInvalid && {
|
|
288
|
+
color: t.colors.text.error,
|
|
289
|
+
},
|
|
290
|
+
]),
|
|
291
|
+
caret: {
|
|
292
|
+
marginHorizontal: t.spacings.s2,
|
|
293
|
+
width: t.sizes.s2,
|
|
294
|
+
backgroundColor: t.colors.text.active,
|
|
247
295
|
},
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
width: t.sizes.s2,
|
|
252
|
-
backgroundColor: t.colors.text.active,
|
|
253
|
-
},
|
|
254
|
-
}),
|
|
255
|
-
[hasValue, isEditable, isInvalid],
|
|
296
|
+
};
|
|
297
|
+
},
|
|
298
|
+
[size, align, hasValue, isEditable, isInvalid],
|
|
256
299
|
);
|
|
257
300
|
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { TextInputProps, ViewStyle } from 'react-native';
|
|
2
2
|
import type { BoxProps } from '../Utility';
|
|
3
3
|
|
|
4
|
+
export type AmountInputSize = 'md' | 'sm';
|
|
5
|
+
|
|
6
|
+
export type AmountInputAlign = 'center' | 'start' | 'end';
|
|
7
|
+
|
|
4
8
|
export type AmountInputProps = Omit<
|
|
5
9
|
TextInputProps,
|
|
6
10
|
'value' | 'onChangeText'
|
|
@@ -15,6 +19,16 @@ export type AmountInputProps = Omit<
|
|
|
15
19
|
* @required
|
|
16
20
|
*/
|
|
17
21
|
onChangeText: (text: string) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Visual size of the amount input.
|
|
24
|
+
* @default 'md'
|
|
25
|
+
*/
|
|
26
|
+
size?: AmountInputSize;
|
|
27
|
+
/**
|
|
28
|
+
* Horizontal alignment of the amount and currency.
|
|
29
|
+
* @default 'center'
|
|
30
|
+
*/
|
|
31
|
+
align?: AmountInputAlign;
|
|
18
32
|
/**
|
|
19
33
|
* The currency text (e.g. USD, EUR)
|
|
20
34
|
*/
|