-
Notifications
You must be signed in to change notification settings - Fork 0
feat(ui-rnative): add BaseInput #296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
fbbf909
initial draft
aquelemiguel 3032f96
position clear button correctly
aquelemiguel 4364a14
use pressable instead of touchableopacity
aquelemiguel aa64f0a
add animation for lable
aquelemiguel 087312a
add containerclassname
aquelemiguel cea5e81
some more introp
aquelemiguel b52c160
fix ring not existing
aquelemiguel af72e49
input animation tweaks
aquelemiguel e8e5a28
patch spacing bc of border-2
aquelemiguel 4e61068
add platform specific spacing for web
aquelemiguel ca19672
fix ref issue
aquelemiguel 86c8685
use text-base for clear icon
aquelemiguel e660653
simplify translates
aquelemiguel 51e5dc7
move disabled styles conditionally
aquelemiguel 6ce285b
slight border fix
aquelemiguel 5a07dd0
simplify styles further
aquelemiguel de1ff9a
just use react-native-reanimated
aquelemiguel 540fc04
truncate
aquelemiguel c2b2e44
better sandbox
aquelemiguel ece473d
add suffix support
aquelemiguel f05b1d2
generate docs
aquelemiguel 8968598
Merge branch 'main' into dls-348
aquelemiguel 898fbc9
Merge branch 'main' into dls-348
aquelemiguel ee0e1f0
remove pressable style callback
aquelemiguel d86e071
move containerClassName to parent container
aquelemiguel 4fd6303
use text-muted for clear circle
aquelemiguel 64e0b67
rename containerClassName -> className
aquelemiguel 45b41d7
omit non-classnames
aquelemiguel 9f0be3a
use valid classname
aquelemiguel 37590bb
no styling input in the case of textinput
aquelemiguel aaa0e08
only push docs
aquelemiguel 1175641
add in construction wording
aquelemiguel 126dbd9
more docs
aquelemiguel d86ea5c
add version plan
aquelemiguel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| '@ledgerhq/ldls-ui-rnative': patch | ||
| '@ledgerhq/ldls-ui-react': patch | ||
| --- | ||
|
|
||
| feat(ui-rnative): add BaseInput |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| import { TextInput } from '@ledgerhq/ldls-ui-rnative'; | ||
| import { Eye, EyeCross } from '@ledgerhq/ldls-ui-rnative/symbols'; | ||
| import { useEffect, useState } from 'react'; | ||
| import { Alert, Pressable, View } from 'react-native'; | ||
|
|
||
| export function Inputs() { | ||
| const [team, setTeam] = useState<string>(); | ||
| const [isTeamValid, setIsTeamValid] = useState(true); | ||
|
|
||
| useEffect(() => { | ||
| if (team) { | ||
| setIsTeamValid(team.toLowerCase() === 'ldls'); | ||
| } | ||
| }, [team]); | ||
|
|
||
| const [showPassword, setShowPassword] = useState(false); | ||
|
|
||
| return ( | ||
| <View className='gap-8'> | ||
| <TextInput | ||
| label='Username' | ||
| className='min-w-full' | ||
| onClear={() => | ||
| Alert.alert('Custom handler', 'You found an easter egg!', [ | ||
| { text: 'Okay', style: 'default' }, | ||
| ]) | ||
| } | ||
| /> | ||
| <TextInput | ||
| label='Password' | ||
| className='min-w-full' | ||
| secureTextEntry={!showPassword} | ||
| hideClearButton | ||
| suffix={ | ||
| <Pressable onPress={() => setShowPassword(!showPassword)}> | ||
| {showPassword ? ( | ||
| <EyeCross size={20} className='text-base' /> | ||
| ) : ( | ||
| <Eye size={20} className='text-base' /> | ||
| )} | ||
| </Pressable> | ||
| } | ||
| /> | ||
| <TextInput | ||
| label='Company' | ||
| className='min-w-full' | ||
| defaultValue='Ledger' | ||
| editable={false} | ||
| /> | ||
| <TextInput | ||
| label='Team' | ||
| className='min-w-full' | ||
| value={team} | ||
| onChangeText={setTeam} | ||
| errorMessage={ | ||
| !isTeamValid && team !== undefined | ||
| ? 'Team must match "ldls"!' | ||
| : undefined | ||
| } | ||
| /> | ||
| <TextInput | ||
| label='A very long label that should really be truncated at different breakpoints' | ||
| className='min-w-full' | ||
| defaultValue='This is a default value!' | ||
| /> | ||
| </View> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.