@ledgerhq/lumen-ui-rnative 0.1.15 → 0.1.16
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/AddressInput/AddressInput.js +21 -10
- package/dist/module/lib/Components/AddressInput/AddressInput.js.map +1 -1
- package/dist/module/lib/Components/AddressInput/AddressInput.mdx +18 -2
- package/dist/module/lib/Components/AddressInput/AddressInput.stories.js +1 -23
- package/dist/module/lib/Components/AddressInput/AddressInput.stories.js.map +1 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.js +7 -6
- package/dist/module/lib/Components/AmountInput/AmountInput.js.map +1 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.mdx +5 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.stories.js +1 -36
- package/dist/module/lib/Components/AmountInput/AmountInput.stories.js.map +1 -1
- package/dist/module/lib/Components/BaseInput/BaseInput.js +54 -48
- package/dist/module/lib/Components/BaseInput/BaseInput.js.map +1 -1
- package/dist/module/lib/Components/MediaImage/MediaImage.js +102 -0
- package/dist/module/lib/Components/MediaImage/MediaImage.js.map +1 -0
- package/dist/module/lib/Components/MediaImage/MediaImage.mdx +103 -0
- package/dist/module/lib/Components/MediaImage/MediaImage.stories.js +91 -0
- package/dist/module/lib/Components/MediaImage/MediaImage.stories.js.map +1 -0
- package/dist/module/lib/Components/MediaImage/MediaImage.test.js +204 -0
- package/dist/module/lib/Components/MediaImage/MediaImage.test.js.map +1 -0
- package/dist/module/lib/Components/MediaImage/index.js +5 -0
- package/dist/module/lib/Components/MediaImage/index.js.map +1 -0
- package/dist/module/lib/Components/MediaImage/types.js +4 -0
- package/dist/module/lib/Components/MediaImage/types.js.map +1 -0
- package/dist/module/lib/Components/SearchInput/SearchInput.js +11 -2
- package/dist/module/lib/Components/SearchInput/SearchInput.js.map +1 -1
- package/dist/module/lib/Components/SearchInput/SearchInput.mdx +14 -2
- package/dist/module/lib/Components/SearchInput/SearchInput.stories.js +1 -19
- package/dist/module/lib/Components/SearchInput/SearchInput.stories.js.map +1 -1
- package/dist/module/lib/Components/TextInput/TextInput.mdx +14 -2
- package/dist/module/lib/Components/TextInput/TextInput.stories.js +1 -28
- package/dist/module/lib/Components/TextInput/TextInput.stories.js.map +1 -1
- package/dist/module/lib/Components/index.js +1 -0
- package/dist/module/lib/Components/index.js.map +1 -1
- package/dist/typescript/src/lib/Components/AddressInput/AddressInput.d.ts +1 -1
- package/dist/typescript/src/lib/Components/AddressInput/AddressInput.d.ts.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 +7 -0
- package/dist/typescript/src/lib/Components/AmountInput/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/BaseInput/BaseInput.d.ts +1 -1
- package/dist/typescript/src/lib/Components/BaseInput/BaseInput.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/BaseInput/types.d.ts +7 -0
- package/dist/typescript/src/lib/Components/BaseInput/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/MediaImage/MediaImage.d.ts +18 -0
- package/dist/typescript/src/lib/Components/MediaImage/MediaImage.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/MediaImage/index.d.ts +3 -0
- package/dist/typescript/src/lib/Components/MediaImage/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/MediaImage/types.d.ts +25 -0
- package/dist/typescript/src/lib/Components/MediaImage/types.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/SearchInput/SearchInput.d.ts +1 -1
- package/dist/typescript/src/lib/Components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/index.d.ts +1 -0
- package/dist/typescript/src/lib/Components/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/lib/Components/AddressInput/AddressInput.mdx +18 -2
- package/src/lib/Components/AddressInput/AddressInput.stories.tsx +1 -23
- package/src/lib/Components/AddressInput/AddressInput.tsx +15 -7
- package/src/lib/Components/AmountInput/AmountInput.mdx +5 -1
- package/src/lib/Components/AmountInput/AmountInput.stories.tsx +1 -36
- package/src/lib/Components/AmountInput/AmountInput.tsx +4 -3
- package/src/lib/Components/AmountInput/types.ts +7 -0
- package/src/lib/Components/BaseInput/BaseInput.tsx +66 -60
- package/src/lib/Components/BaseInput/types.ts +7 -0
- package/src/lib/Components/MediaImage/MediaImage.mdx +103 -0
- package/src/lib/Components/MediaImage/MediaImage.stories.tsx +55 -0
- package/src/lib/Components/MediaImage/MediaImage.test.tsx +179 -0
- package/src/lib/Components/MediaImage/MediaImage.tsx +117 -0
- package/src/lib/Components/MediaImage/index.ts +2 -0
- package/src/lib/Components/MediaImage/types.ts +27 -0
- package/src/lib/Components/SearchInput/SearchInput.mdx +14 -2
- package/src/lib/Components/SearchInput/SearchInput.stories.tsx +1 -19
- package/src/lib/Components/SearchInput/SearchInput.tsx +8 -1
- package/src/lib/Components/TextInput/TextInput.mdx +14 -2
- package/src/lib/Components/TextInput/TextInput.stories.tsx +1 -28
- package/src/lib/Components/index.ts +1 -0
|
@@ -19,24 +19,6 @@ const meta: Meta<typeof SearchInput> = {
|
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
|
-
argTypes: {
|
|
23
|
-
placeholder: {
|
|
24
|
-
control: 'text',
|
|
25
|
-
description: 'Placeholder text when input is empty',
|
|
26
|
-
},
|
|
27
|
-
errorMessage: {
|
|
28
|
-
control: 'text',
|
|
29
|
-
description: 'Error message to display below input',
|
|
30
|
-
},
|
|
31
|
-
editable: {
|
|
32
|
-
control: 'boolean',
|
|
33
|
-
description: 'Whether the input is editable',
|
|
34
|
-
},
|
|
35
|
-
hideClearButton: {
|
|
36
|
-
control: 'boolean',
|
|
37
|
-
description: 'Hide the clear button',
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
22
|
};
|
|
41
23
|
|
|
42
24
|
export default meta;
|
|
@@ -105,7 +87,7 @@ export const DisabledSearchInput: Story = {
|
|
|
105
87
|
),
|
|
106
88
|
args: {
|
|
107
89
|
placeholder: 'Search products',
|
|
108
|
-
|
|
90
|
+
disabled: true,
|
|
109
91
|
hideClearButton: false,
|
|
110
92
|
},
|
|
111
93
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useDisabledContext } from '@ledgerhq/lumen-utils-shared';
|
|
1
2
|
import { useStyleSheet } from '../../../styles';
|
|
2
3
|
import { Search as SearchIcon } from '../../Symbols';
|
|
3
4
|
import { BaseInput } from '../BaseInput';
|
|
@@ -8,18 +9,24 @@ export const SearchInput = ({
|
|
|
8
9
|
style,
|
|
9
10
|
containerStyle,
|
|
10
11
|
inputStyle,
|
|
12
|
+
disabled: disabledProp,
|
|
11
13
|
ref,
|
|
12
14
|
...props
|
|
13
15
|
}: SearchInputProps) => {
|
|
16
|
+
const disabled = useDisabledContext({
|
|
17
|
+
consumerName: 'SearchInput',
|
|
18
|
+
mergeWith: { disabled: disabledProp },
|
|
19
|
+
});
|
|
14
20
|
const styles = useAppearanceStyles(appearance);
|
|
15
21
|
|
|
16
22
|
return (
|
|
17
23
|
<BaseInput
|
|
18
24
|
ref={ref}
|
|
19
|
-
prefix={<SearchIcon size={20}
|
|
25
|
+
prefix={<SearchIcon size={20} accessible={false} disabled={disabled} />}
|
|
20
26
|
style={style}
|
|
21
27
|
containerStyle={[containerStyle, styles.container]}
|
|
22
28
|
inputStyle={[inputStyle, styles.input]}
|
|
29
|
+
disabled={disabledProp}
|
|
23
30
|
{...props}
|
|
24
31
|
/>
|
|
25
32
|
);
|
|
@@ -67,10 +67,14 @@ The error message will be automatically:
|
|
|
67
67
|
|
|
68
68
|
### Disabled State
|
|
69
69
|
|
|
70
|
-
The input can be disabled using the `
|
|
70
|
+
The input can be fully disabled using the `disabled` prop, which prevents interaction and applies a muted visual style.
|
|
71
71
|
|
|
72
72
|
<Canvas of={TextInputStories.DisabledTextInput} />
|
|
73
73
|
|
|
74
|
+
### Read-Only State
|
|
75
|
+
|
|
76
|
+
Alternatively, use `editable={false}` to prevent editing without applying the muted visual style. This is useful for displaying non-editable values that should still look like regular inputs.
|
|
77
|
+
|
|
74
78
|
### Keyboard Types
|
|
75
79
|
|
|
76
80
|
The component supports various React Native TextInput keyboard types:
|
|
@@ -270,7 +274,15 @@ Use the `keyboardType` prop to show the appropriate keyboard:
|
|
|
270
274
|
|
|
271
275
|
### Disabled State
|
|
272
276
|
|
|
273
|
-
Use the `
|
|
277
|
+
Use the `disabled` prop to disable the input with a muted visual style:
|
|
278
|
+
|
|
279
|
+
```tsx
|
|
280
|
+
<TextInput label='Username' value='johndoe' disabled />
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Read-Only State
|
|
284
|
+
|
|
285
|
+
Use the `editable` prop to make the input non-editable without the muted visual style:
|
|
274
286
|
|
|
275
287
|
```tsx
|
|
276
288
|
<TextInput label='Username' value='johndoe' editable={false} />
|
|
@@ -16,33 +16,6 @@ const meta: Meta<typeof TextInput> = {
|
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
|
-
argTypes: {
|
|
20
|
-
label: {
|
|
21
|
-
control: 'text',
|
|
22
|
-
description: 'Floating label text',
|
|
23
|
-
},
|
|
24
|
-
placeholder: {
|
|
25
|
-
control: 'text',
|
|
26
|
-
description: 'Placeholder text when input is empty',
|
|
27
|
-
},
|
|
28
|
-
errorMessage: {
|
|
29
|
-
control: 'text',
|
|
30
|
-
description: 'Error message to display below input',
|
|
31
|
-
},
|
|
32
|
-
editable: {
|
|
33
|
-
control: 'boolean',
|
|
34
|
-
description: 'Whether the input is editable',
|
|
35
|
-
},
|
|
36
|
-
hideClearButton: {
|
|
37
|
-
control: 'boolean',
|
|
38
|
-
description: 'Hide the clear button',
|
|
39
|
-
},
|
|
40
|
-
keyboardType: {
|
|
41
|
-
control: 'select',
|
|
42
|
-
options: ['default', 'email-address', 'numeric', 'phone-pad', 'url'],
|
|
43
|
-
description: 'Keyboard type for input',
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
19
|
};
|
|
47
20
|
|
|
48
21
|
export default meta;
|
|
@@ -108,7 +81,7 @@ export const DisabledTextInput: Story = {
|
|
|
108
81
|
render: (args) => <TextInputStory {...args} initialValue='johndoe' />,
|
|
109
82
|
args: {
|
|
110
83
|
label: 'Username',
|
|
111
|
-
|
|
84
|
+
disabled: true,
|
|
112
85
|
hideClearButton: false,
|
|
113
86
|
keyboardType: 'default',
|
|
114
87
|
},
|