@ledgerhq/lumen-ui-rnative 0.1.57 → 0.1.59
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/animations/Pulse/Pulse.stories.js +9 -0
- package/dist/module/lib/Components/animations/Pulse/Pulse.stories.js.map +1 -1
- package/dist/module/lib/Components/animations/Spin/Spin.stories.js +3 -0
- package/dist/module/lib/Components/animations/Spin/Spin.stories.js.map +1 -1
- package/dist/module/lib/Components/core/AddressInput/AddressInput.figma.js +4 -0
- package/dist/module/lib/Components/core/AddressInput/AddressInput.figma.js.map +1 -1
- package/dist/module/lib/Components/core/AddressInput/AddressInput.js +18 -6
- package/dist/module/lib/Components/core/AddressInput/AddressInput.js.map +1 -1
- package/dist/module/lib/Components/core/AddressInput/AddressInput.mdx +26 -1
- package/dist/module/lib/Components/core/AddressInput/AddressInput.stories.js +30 -0
- package/dist/module/lib/Components/core/AddressInput/AddressInput.stories.js.map +1 -1
- package/dist/module/lib/Components/core/AmountDisplay/AmountDisplay.stories.js +6 -0
- package/dist/module/lib/Components/core/AmountDisplay/AmountDisplay.stories.js.map +1 -1
- package/dist/module/lib/Components/core/AmountInput/AmountInput.stories.js +64 -44
- package/dist/module/lib/Components/core/AmountInput/AmountInput.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Banner/Banner.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Button/Button.stories.js +21 -0
- package/dist/module/lib/Components/core/Button/Button.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Card/Card.figma.js +17 -1
- package/dist/module/lib/Components/core/Card/Card.figma.js.map +1 -1
- package/dist/module/lib/Components/core/Card/Card.js +36 -24
- package/dist/module/lib/Components/core/Card/Card.js.map +1 -1
- package/dist/module/lib/Components/core/Card/Card.mdx +10 -1
- package/dist/module/lib/Components/core/Card/Card.stories.js +78 -2
- package/dist/module/lib/Components/core/Card/Card.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Card/Card.test.js +31 -3
- package/dist/module/lib/Components/core/Card/Card.test.js.map +1 -1
- package/dist/module/lib/Components/core/CardButton/CardButton.stories.js +15 -0
- package/dist/module/lib/Components/core/CardButton/CardButton.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Checkbox/Checkbox.stories.js.map +1 -1
- package/dist/module/lib/Components/core/ContentBanner/ContentBanner.stories.js +13 -0
- package/dist/module/lib/Components/core/ContentBanner/ContentBanner.stories.js.map +1 -1
- package/dist/module/lib/Components/core/DescriptionItem/DescriptionItem.stories.js +11 -0
- package/dist/module/lib/Components/core/DescriptionItem/DescriptionItem.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Divider/Divider.stories.js.map +1 -1
- package/dist/module/lib/Components/core/IconButton/IconButton.stories.js +10 -0
- package/dist/module/lib/Components/core/IconButton/IconButton.stories.js.map +1 -1
- package/dist/module/lib/Components/core/InteractiveIcon/InteractiveIcon.stories.js +12 -0
- package/dist/module/lib/Components/core/InteractiveIcon/InteractiveIcon.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Link/Link.stories.js.map +1 -1
- package/dist/module/lib/Components/core/ListItem/ListItem.stories.js +21 -3
- package/dist/module/lib/Components/core/ListItem/ListItem.stories.js.map +1 -1
- package/dist/module/lib/Components/core/MediaBanner/MediaBanner.stories.js +18 -1
- package/dist/module/lib/Components/core/MediaBanner/MediaBanner.stories.js.map +1 -1
- package/dist/module/lib/Components/core/MediaButton/MediaButton.stories.js +9 -0
- package/dist/module/lib/Components/core/MediaButton/MediaButton.stories.js.map +1 -1
- package/dist/module/lib/Components/core/MediaCard/MediaCard.stories.js +13 -0
- package/dist/module/lib/Components/core/MediaCard/MediaCard.stories.js.map +1 -1
- package/dist/module/lib/Components/core/MediaTag/MediaTag.stories.js +13 -0
- package/dist/module/lib/Components/core/MediaTag/MediaTag.stories.js.map +1 -1
- package/dist/module/lib/Components/core/NavBar/NavBar.stories.js.map +1 -1
- package/dist/module/lib/Components/core/OptionList/OptionList.stories.js +52 -0
- package/dist/module/lib/Components/core/OptionList/OptionList.stories.js.map +1 -1
- package/dist/module/lib/Components/core/SearchInput/SearchInput.stories.js.map +1 -1
- package/dist/module/lib/Components/core/SectionHeader/SectionHeader.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Skeleton/Skeleton.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Spinner/Spinner.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Spot/Spot.stories.js +20 -0
- package/dist/module/lib/Components/core/Spot/Spot.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Stepper/Stepper.stories.js +4 -0
- package/dist/module/lib/Components/core/Stepper/Stepper.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Subheader/Subheader.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Switch/Switch.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Tag/Tag.stories.js +12 -0
- package/dist/module/lib/Components/core/Tag/Tag.stories.js.map +1 -1
- package/dist/module/lib/Components/core/TextInput/TextInput.figma.js +4 -0
- package/dist/module/lib/Components/core/TextInput/TextInput.figma.js.map +1 -1
- package/dist/module/lib/Components/core/TextInput/TextInput.mdx +25 -0
- package/dist/module/lib/Components/core/TextInput/TextInput.stories.js +29 -0
- package/dist/module/lib/Components/core/TextInput/TextInput.stories.js.map +1 -1
- package/dist/module/lib/Components/core/TextInput/TextInput.test.js +125 -2
- package/dist/module/lib/Components/core/TextInput/TextInput.test.js.map +1 -1
- package/dist/module/lib/Components/core/Tile/Tile.stories.js +23 -1
- package/dist/module/lib/Components/core/Tile/Tile.stories.js.map +1 -1
- package/dist/module/lib/Components/core/TileButton/TileButton.stories.js +24 -0
- package/dist/module/lib/Components/core/TileButton/TileButton.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Tooltip/Tooltip.stories.js +12 -0
- package/dist/module/lib/Components/core/Tooltip/Tooltip.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Trend/Trend.js +1 -2
- package/dist/module/lib/Components/core/Trend/Trend.js.map +1 -1
- package/dist/module/lib/Components/core/Trend/Trend.stories.js +9 -0
- package/dist/module/lib/Components/core/Trend/Trend.stories.js.map +1 -1
- package/dist/module/lib/Components/core/Trend/Trend.test.js +5 -5
- package/dist/module/lib/Components/core/Trend/Trend.test.js.map +1 -1
- package/dist/module/lib/Components/internal/BaseInput/BaseInput.js +114 -201
- package/dist/module/lib/Components/internal/BaseInput/BaseInput.js.map +1 -1
- package/dist/module/lib/Components/internal/BaseInput/BaseInputCounter.js +32 -0
- package/dist/module/lib/Components/internal/BaseInput/BaseInputCounter.js.map +1 -0
- package/dist/module/lib/Components/internal/BaseInput/BaseInputHelperText.js +60 -0
- package/dist/module/lib/Components/internal/BaseInput/BaseInputHelperText.js.map +1 -0
- package/dist/module/lib/Components/internal/BaseInput/BaseInputLabel.js +126 -0
- package/dist/module/lib/Components/internal/BaseInput/BaseInputLabel.js.map +1 -0
- package/dist/module/lib/Components/internal/BaseInput/multilineLayout.js +34 -0
- package/dist/module/lib/Components/internal/BaseInput/multilineLayout.js.map +1 -0
- package/dist/module/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.js +46 -0
- package/dist/module/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.js.map +1 -0
- package/dist/module/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.test.js +111 -0
- package/dist/module/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.test.js.map +1 -0
- package/dist/module/lib/Components/primitives/Box/Box.stories.js.map +1 -1
- package/dist/module/lib/Components/primitives/Gradient/LinearGradient/LinearGradient.stories.js +14 -0
- package/dist/module/lib/Components/primitives/Gradient/LinearGradient/LinearGradient.stories.js.map +1 -1
- package/dist/module/lib/Components/primitives/Gradient/RadialGradient/RadialGradient.stories.js +8 -0
- package/dist/module/lib/Components/primitives/Gradient/RadialGradient/RadialGradient.stories.js.map +1 -1
- package/dist/module/lib/Components/primitives/Pressable/Pressable.stories.js.map +1 -1
- package/dist/module/lib/Components/primitives/Text/Text.stories.js.map +1 -1
- package/dist/module/lib/Components/symbols/Icon/Icon.stories.js.map +1 -1
- package/dist/module/lib/Components/symbols/icons/CalendarRefresh.js +50 -0
- package/dist/module/lib/Components/symbols/icons/CalendarRefresh.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/CodeShield.js +50 -0
- package/dist/module/lib/Components/symbols/icons/CodeShield.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/CoinStacked.js +50 -0
- package/dist/module/lib/Components/symbols/icons/CoinStacked.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Craft.js +50 -0
- package/dist/module/lib/Components/symbols/icons/Craft.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Equal.js +49 -0
- package/dist/module/lib/Components/symbols/icons/Equal.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/File.js +50 -0
- package/dist/module/lib/Components/symbols/icons/File.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/FileShield.js +50 -0
- package/dist/module/lib/Components/symbols/icons/FileShield.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Fire.js +51 -0
- package/dist/module/lib/Components/symbols/icons/Fire.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Handshake.js +50 -0
- package/dist/module/lib/Components/symbols/icons/Handshake.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/MailShield.js +50 -0
- package/dist/module/lib/Components/symbols/icons/MailShield.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Merge.js +50 -0
- package/dist/module/lib/Components/symbols/icons/Merge.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Minimize.js +50 -0
- package/dist/module/lib/Components/symbols/icons/Minimize.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Nested.js +50 -0
- package/dist/module/lib/Components/symbols/icons/Nested.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/NotEqual.js +49 -0
- package/dist/module/lib/Components/symbols/icons/NotEqual.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/PeopleShield.js +50 -0
- package/dist/module/lib/Components/symbols/icons/PeopleShield.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Pin.js +50 -0
- package/dist/module/lib/Components/symbols/icons/Pin.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/PinFill.js +47 -0
- package/dist/module/lib/Components/symbols/icons/PinFill.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Receive.js +50 -0
- package/dist/module/lib/Components/symbols/icons/Receive.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Retry.js +50 -0
- package/dist/module/lib/Components/symbols/icons/Retry.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Send.js +50 -0
- package/dist/module/lib/Components/symbols/icons/Send.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/Servers.js +50 -0
- package/dist/module/lib/Components/symbols/icons/Servers.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/SubArrow.js +50 -0
- package/dist/module/lib/Components/symbols/icons/SubArrow.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/UsbCircleFill.js +52 -0
- package/dist/module/lib/Components/symbols/icons/UsbCircleFill.js.map +1 -0
- package/dist/module/lib/Components/symbols/icons/WarningCircleFill.js +47 -0
- package/dist/module/lib/Components/symbols/icons/WarningCircleFill.js.map +1 -0
- package/dist/module/lib/Components/symbols/index.js +24 -0
- package/dist/module/lib/Components/symbols/index.js.map +1 -1
- package/dist/module/lib/utils/index.js +0 -1
- package/dist/module/lib/utils/index.js.map +1 -1
- package/dist/typescript/src/lib/Components/core/AddressInput/AddressInput.d.ts +1 -1
- package/dist/typescript/src/lib/Components/core/AddressInput/AddressInput.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/Card/Card.d.ts +1 -1
- package/dist/typescript/src/lib/Components/core/Card/Card.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/Card/types.d.ts +6 -0
- package/dist/typescript/src/lib/Components/core/Card/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/SearchInput/types.d.ts +1 -1
- package/dist/typescript/src/lib/Components/core/SearchInput/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/core/Trend/Trend.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInput.d.ts +1 -1
- package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInput.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputCounter.d.ts +8 -0
- package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputCounter.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputHelperText.d.ts +8 -0
- package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputHelperText.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputLabel.d.ts +8 -0
- package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputLabel.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/internal/BaseInput/multilineLayout.d.ts +27 -0
- package/dist/typescript/src/lib/Components/internal/BaseInput/multilineLayout.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/internal/BaseInput/types.d.ts +48 -1
- package/dist/typescript/src/lib/Components/internal/BaseInput/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.d.ts +27 -0
- package/dist/typescript/src/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/CalendarRefresh.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/CalendarRefresh.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/CodeShield.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/CodeShield.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/CoinStacked.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/CoinStacked.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Craft.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Craft.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Equal.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Equal.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/File.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/File.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/FileShield.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/FileShield.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Fire.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Fire.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Handshake.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Handshake.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/MailShield.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/MailShield.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Merge.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Merge.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Minimize.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Minimize.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Nested.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Nested.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/NotEqual.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/NotEqual.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/PeopleShield.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/PeopleShield.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Pin.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Pin.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/PinFill.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/PinFill.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Receive.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Receive.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Retry.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Retry.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Send.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Send.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Servers.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/Servers.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/SubArrow.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/SubArrow.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/UsbCircleFill.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/UsbCircleFill.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/icons/WarningCircleFill.d.ts +35 -0
- package/dist/typescript/src/lib/Components/symbols/icons/WarningCircleFill.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/symbols/index.d.ts +24 -0
- package/dist/typescript/src/lib/Components/symbols/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/utils/index.d.ts +0 -1
- package/dist/typescript/src/lib/utils/index.d.ts.map +1 -1
- package/dist/typescript/src/styles/types/create.types.d.ts +1 -3
- package/dist/typescript/src/styles/types/create.types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/lib/Components/animations/Pulse/Pulse.stories.tsx +7 -2
- package/src/lib/Components/animations/Spin/Spin.stories.tsx +5 -2
- package/src/lib/Components/core/AddressInput/AddressInput.figma.tsx +4 -0
- package/src/lib/Components/core/AddressInput/AddressInput.mdx +26 -1
- package/src/lib/Components/core/AddressInput/AddressInput.stories.tsx +30 -2
- package/src/lib/Components/core/AddressInput/AddressInput.tsx +24 -8
- package/src/lib/Components/core/AmountDisplay/AmountDisplay.stories.tsx +8 -2
- package/src/lib/Components/core/AmountInput/AmountInput.stories.tsx +33 -13
- package/src/lib/Components/core/Avatar/Avatar.stories.tsx +1 -1
- package/src/lib/Components/core/AvatarButton/AvatarButton.stories.tsx +1 -1
- package/src/lib/Components/core/Banner/Banner.stories.tsx +2 -2
- package/src/lib/Components/core/Button/Button.stories.tsx +23 -2
- package/src/lib/Components/core/Card/Card.figma.tsx +20 -0
- package/src/lib/Components/core/Card/Card.mdx +10 -1
- package/src/lib/Components/core/Card/Card.stories.tsx +63 -2
- package/src/lib/Components/core/Card/Card.test.tsx +35 -3
- package/src/lib/Components/core/Card/Card.tsx +46 -26
- package/src/lib/Components/core/Card/types.ts +7 -0
- package/src/lib/Components/core/CardButton/CardButton.stories.tsx +17 -2
- package/src/lib/Components/core/Checkbox/Checkbox.stories.tsx +3 -3
- package/src/lib/Components/core/ContentBanner/ContentBanner.stories.tsx +15 -2
- package/src/lib/Components/core/DescriptionItem/DescriptionItem.stories.tsx +13 -2
- package/src/lib/Components/core/Divider/Divider.stories.tsx +2 -2
- package/src/lib/Components/core/DotCount/DotCount.stories.tsx +1 -1
- package/src/lib/Components/core/DotIcon/DotIcon.stories.tsx +1 -1
- package/src/lib/Components/core/DotIndicator/DotIndicator.stories.tsx +1 -1
- package/src/lib/Components/core/DotSymbol/DotSymbol.stories.tsx +1 -1
- package/src/lib/Components/core/IconButton/IconButton.stories.tsx +12 -2
- package/src/lib/Components/core/InteractiveIcon/InteractiveIcon.stories.tsx +14 -2
- package/src/lib/Components/core/Link/Link.stories.tsx +2 -2
- package/src/lib/Components/core/ListItem/ListItem.stories.tsx +18 -0
- package/src/lib/Components/core/MediaBanner/MediaBanner.stories.tsx +19 -2
- package/src/lib/Components/core/MediaButton/MediaButton.stories.tsx +11 -2
- package/src/lib/Components/core/MediaCard/MediaCard.stories.tsx +13 -0
- package/src/lib/Components/core/MediaImage/MediaImage.stories.tsx +1 -1
- package/src/lib/Components/core/MediaTag/MediaTag.stories.tsx +15 -2
- package/src/lib/Components/core/NavBar/NavBar.stories.tsx +2 -2
- package/src/lib/Components/core/OptionList/OptionList.stories.tsx +52 -0
- package/src/lib/Components/core/PageIndicator/PageIndicator.stories.tsx +1 -1
- package/src/lib/Components/core/SearchInput/SearchInput.stories.tsx +2 -2
- package/src/lib/Components/core/SearchInput/types.ts +4 -1
- package/src/lib/Components/core/SectionHeader/SectionHeader.stories.tsx +2 -2
- package/src/lib/Components/core/SegmentedControl/SegmentedControl.stories.tsx +1 -1
- package/src/lib/Components/core/Skeleton/Skeleton.stories.tsx +2 -2
- package/src/lib/Components/core/Spinner/Spinner.stories.tsx +2 -2
- package/src/lib/Components/core/Spot/Spot.stories.tsx +22 -2
- package/src/lib/Components/core/Stepper/Stepper.stories.tsx +6 -2
- package/src/lib/Components/core/Subheader/Subheader.stories.tsx +2 -2
- package/src/lib/Components/core/Switch/Switch.stories.tsx +3 -3
- package/src/lib/Components/core/TabBar/TabBar.stories.tsx +1 -1
- package/src/lib/Components/core/Tag/Tag.stories.tsx +14 -2
- package/src/lib/Components/core/TextInput/TextInput.figma.tsx +4 -0
- package/src/lib/Components/core/TextInput/TextInput.mdx +25 -0
- package/src/lib/Components/core/TextInput/TextInput.stories.tsx +29 -2
- package/src/lib/Components/core/TextInput/TextInput.test.tsx +129 -2
- package/src/lib/Components/core/Tile/Tile.stories.tsx +24 -2
- package/src/lib/Components/core/TileButton/TileButton.stories.tsx +26 -2
- package/src/lib/Components/core/Tooltip/Tooltip.stories.tsx +14 -2
- package/src/lib/Components/core/Trend/Trend.stories.tsx +11 -2
- package/src/lib/Components/core/Trend/Trend.test.tsx +4 -5
- package/src/lib/Components/core/Trend/Trend.tsx +1 -3
- package/src/lib/Components/internal/BaseInput/BaseInput.tsx +123 -242
- package/src/lib/Components/internal/BaseInput/BaseInputCounter.tsx +35 -0
- package/src/lib/Components/internal/BaseInput/BaseInputHelperText.tsx +57 -0
- package/src/lib/Components/internal/BaseInput/BaseInputLabel.tsx +137 -0
- package/src/lib/Components/internal/BaseInput/multilineLayout.ts +49 -0
- package/src/lib/Components/internal/BaseInput/types.ts +49 -1
- package/src/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.test.ts +110 -0
- package/src/lib/Components/internal/BaseInput/useBaseInputValue/useBaseInputValue.ts +72 -0
- package/src/lib/Components/primitives/Box/Box.stories.tsx +2 -2
- package/src/lib/Components/primitives/Gradient/LinearGradient/LinearGradient.stories.tsx +6 -2
- package/src/lib/Components/primitives/Gradient/RadialGradient/RadialGradient.stories.tsx +5 -2
- package/src/lib/Components/primitives/Pressable/Pressable.stories.tsx +2 -2
- package/src/lib/Components/primitives/Text/Text.stories.tsx +2 -2
- package/src/lib/Components/symbols/Icon/Icon.stories.tsx +2 -2
- package/src/lib/Components/symbols/icons/CalendarRefresh.tsx +45 -0
- package/src/lib/Components/symbols/icons/CodeShield.tsx +45 -0
- package/src/lib/Components/symbols/icons/CoinStacked.tsx +45 -0
- package/src/lib/Components/symbols/icons/Craft.tsx +45 -0
- package/src/lib/Components/symbols/icons/Equal.tsx +44 -0
- package/src/lib/Components/symbols/icons/File.tsx +45 -0
- package/src/lib/Components/symbols/icons/FileShield.tsx +45 -0
- package/src/lib/Components/symbols/icons/Fire.tsx +46 -0
- package/src/lib/Components/symbols/icons/Handshake.tsx +45 -0
- package/src/lib/Components/symbols/icons/MailShield.tsx +45 -0
- package/src/lib/Components/symbols/icons/Merge.tsx +45 -0
- package/src/lib/Components/symbols/icons/Minimize.tsx +45 -0
- package/src/lib/Components/symbols/icons/Nested.tsx +45 -0
- package/src/lib/Components/symbols/icons/NotEqual.tsx +44 -0
- package/src/lib/Components/symbols/icons/PeopleShield.tsx +45 -0
- package/src/lib/Components/symbols/icons/Pin.tsx +45 -0
- package/src/lib/Components/symbols/icons/PinFill.tsx +42 -0
- package/src/lib/Components/symbols/icons/Receive.tsx +45 -0
- package/src/lib/Components/symbols/icons/Retry.tsx +45 -0
- package/src/lib/Components/symbols/icons/Send.tsx +45 -0
- package/src/lib/Components/symbols/icons/Servers.tsx +45 -0
- package/src/lib/Components/symbols/icons/SubArrow.tsx +45 -0
- package/src/lib/Components/symbols/icons/UsbCircleFill.tsx +48 -0
- package/src/lib/Components/symbols/icons/WarningCircleFill.tsx +42 -0
- package/src/lib/Components/symbols/index.ts +24 -0
- package/src/lib/utils/index.ts +0 -1
- package/src/styles/types/create.types.ts +6 -6
- package/dist/module/lib/utils/react/extractTextFromChildren.js +0 -23
- package/dist/module/lib/utils/react/extractTextFromChildren.js.map +0 -1
- package/dist/module/lib/utils/react/index.js +0 -4
- package/dist/module/lib/utils/react/index.js.map +0 -1
- package/dist/typescript/src/lib/utils/react/extractTextFromChildren.d.ts +0 -8
- package/dist/typescript/src/lib/utils/react/extractTextFromChildren.d.ts.map +0 -1
- package/dist/typescript/src/lib/utils/react/index.d.ts +0 -2
- package/dist/typescript/src/lib/utils/react/index.d.ts.map +0 -1
- package/src/lib/utils/react/extractTextFromChildren.ts +0 -32
- package/src/lib/utils/react/index.ts +0 -1
|
@@ -3,36 +3,20 @@ import {
|
|
|
3
3
|
resolveBaseInputPlaceholder,
|
|
4
4
|
useDisabledContext,
|
|
5
5
|
} from '@ledgerhq/lumen-utils-shared';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
useEffect,
|
|
9
|
-
useImperativeHandle,
|
|
10
|
-
useRef,
|
|
11
|
-
useState,
|
|
12
|
-
} from 'react';
|
|
13
|
-
import { StyleSheet, Text, TextInput, View } from 'react-native';
|
|
14
|
-
import Animated, {
|
|
15
|
-
interpolate,
|
|
16
|
-
useSharedValue,
|
|
17
|
-
useAnimatedStyle,
|
|
18
|
-
withTiming,
|
|
19
|
-
cancelAnimation,
|
|
20
|
-
} from 'react-native-reanimated';
|
|
6
|
+
import { useState } from 'react';
|
|
7
|
+
import { StyleSheet, TextInput, View } from 'react-native';
|
|
21
8
|
import { useCommonTranslation } from '../../../../i18n';
|
|
22
|
-
import type { LumenStyleSheetTheme } from '../../../../styles';
|
|
23
9
|
import { useStyleSheet, useTheme } from '../../../../styles';
|
|
24
10
|
import { RuntimeConstants } from '../../../utils';
|
|
25
|
-
import { useTimingConfig } from '../../animations/useTimingConfig';
|
|
26
11
|
import { InteractiveIcon } from '../../core/InteractiveIcon';
|
|
27
12
|
import { Box, Pressable } from '../../primitives';
|
|
28
|
-
import { CheckmarkCircleFill } from '../../symbols/icons/CheckmarkCircleFill';
|
|
29
13
|
import { DeleteCircleFill } from '../../symbols/icons/DeleteCircleFill';
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
} from './
|
|
14
|
+
import { BaseInputCounter } from './BaseInputCounter';
|
|
15
|
+
import { BaseInputHelperText } from './BaseInputHelperText';
|
|
16
|
+
import { BaseInputLabel } from './BaseInputLabel';
|
|
17
|
+
import { getMultilineLayout, getMultilineMinHeight } from './multilineLayout';
|
|
18
|
+
import { type BaseInputProps, type BaseInputStatus } from './types';
|
|
19
|
+
import { useBaseInputValue } from './useBaseInputValue/useBaseInputValue';
|
|
36
20
|
|
|
37
21
|
export const BaseInput = ({
|
|
38
22
|
lx,
|
|
@@ -53,6 +37,10 @@ export const BaseInput = ({
|
|
|
53
37
|
suffix,
|
|
54
38
|
ref,
|
|
55
39
|
placeholder: placeholderProp,
|
|
40
|
+
onClear,
|
|
41
|
+
multiline = false,
|
|
42
|
+
minLines = 1,
|
|
43
|
+
maxLines,
|
|
56
44
|
...props
|
|
57
45
|
}: BaseInputProps) => {
|
|
58
46
|
const disabled = useDisabledContext({
|
|
@@ -61,18 +49,23 @@ export const BaseInput = ({
|
|
|
61
49
|
});
|
|
62
50
|
const { t } = useCommonTranslation();
|
|
63
51
|
const { theme } = useTheme();
|
|
64
|
-
const inputRef = useRef<TextInput>(null);
|
|
65
|
-
useImperativeHandle(ref, () => inputRef.current as TextInput);
|
|
66
|
-
|
|
67
|
-
const [uncontrolledValue, setUncontrolledValue] = useState(
|
|
68
|
-
props.defaultValue || '',
|
|
69
|
-
);
|
|
70
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
71
52
|
|
|
72
|
-
const
|
|
73
|
-
|
|
53
|
+
const {
|
|
54
|
+
inputRef,
|
|
55
|
+
composedRef,
|
|
56
|
+
value,
|
|
57
|
+
hasContent,
|
|
58
|
+
handleChangeText,
|
|
59
|
+
handleClear,
|
|
60
|
+
} = useBaseInputValue({
|
|
61
|
+
value: props.value,
|
|
62
|
+
defaultValue: props.defaultValue,
|
|
63
|
+
onChangeText: onChangeTextProp,
|
|
64
|
+
onClear,
|
|
65
|
+
ref,
|
|
66
|
+
});
|
|
74
67
|
|
|
75
|
-
const
|
|
68
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
76
69
|
|
|
77
70
|
const { inputPlaceholder, labelStaysFloatedWithPlaceholder } =
|
|
78
71
|
resolveBaseInputPlaceholder({
|
|
@@ -87,42 +80,19 @@ export const BaseInput = ({
|
|
|
87
80
|
const showCount = Boolean(maxCount && maxCount > 0);
|
|
88
81
|
const showHelper = !!helperText;
|
|
89
82
|
|
|
90
|
-
const handleChangeText = useCallback(
|
|
91
|
-
(text: string) => {
|
|
92
|
-
if (!isControlled) {
|
|
93
|
-
setUncontrolledValue(text);
|
|
94
|
-
}
|
|
95
|
-
onChangeTextProp?.(text);
|
|
96
|
-
},
|
|
97
|
-
[isControlled, onChangeTextProp],
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
const handleClear = () => {
|
|
101
|
-
if (isControlled) {
|
|
102
|
-
onChangeTextProp?.('');
|
|
103
|
-
} else {
|
|
104
|
-
setUncontrolledValue('');
|
|
105
|
-
}
|
|
106
|
-
props.onClear?.();
|
|
107
|
-
};
|
|
108
|
-
|
|
109
83
|
// Both properties can be used to determine if the input is editable.
|
|
110
84
|
const isEditable = editable !== false && !readOnly && !disabled;
|
|
111
85
|
|
|
86
|
+
const hasLabel = !!label;
|
|
87
|
+
|
|
112
88
|
const styles = useStyles({
|
|
113
89
|
status,
|
|
114
90
|
isFocused,
|
|
115
91
|
isEditable: !disabled,
|
|
116
|
-
hasLabel
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
hasContent,
|
|
121
|
-
isFocused,
|
|
122
|
-
showClearButton,
|
|
123
|
-
status,
|
|
124
|
-
isEditable: !disabled,
|
|
125
|
-
labelStaysFloatedWithPlaceholder,
|
|
92
|
+
hasLabel,
|
|
93
|
+
multiline,
|
|
94
|
+
minLines,
|
|
95
|
+
maxLines,
|
|
126
96
|
});
|
|
127
97
|
|
|
128
98
|
return (
|
|
@@ -136,7 +106,7 @@ export const BaseInput = ({
|
|
|
136
106
|
{prefix}
|
|
137
107
|
|
|
138
108
|
<TextInput
|
|
139
|
-
ref={
|
|
109
|
+
ref={composedRef}
|
|
140
110
|
value={value}
|
|
141
111
|
placeholder={inputPlaceholder}
|
|
142
112
|
style={StyleSheet.flatten([styles.input, inputStyle])}
|
|
@@ -148,20 +118,27 @@ export const BaseInput = ({
|
|
|
148
118
|
autoCorrect={false}
|
|
149
119
|
selectionColor={theme.colors.text.active}
|
|
150
120
|
placeholderTextColor={theme.colors.text.muted}
|
|
121
|
+
multiline={multiline}
|
|
122
|
+
// iOS hands the drag to the parent by default and the container Pressable
|
|
123
|
+
// claims it, which stops a clamped field from scrolling.
|
|
124
|
+
rejectResponderTermination={!multiline}
|
|
151
125
|
{...props}
|
|
152
126
|
/>
|
|
153
127
|
|
|
154
128
|
{label && (
|
|
155
|
-
<
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
129
|
+
<BaseInputLabel
|
|
130
|
+
isFocused={isFocused}
|
|
131
|
+
hasContent={hasContent}
|
|
132
|
+
showClearButton={showClearButton}
|
|
133
|
+
status={status}
|
|
134
|
+
isEditable={!disabled}
|
|
135
|
+
labelStaysFloatedWithPlaceholder={
|
|
136
|
+
labelStaysFloatedWithPlaceholder
|
|
137
|
+
}
|
|
138
|
+
style={labelStyle}
|
|
162
139
|
>
|
|
163
140
|
{label}
|
|
164
|
-
</
|
|
141
|
+
</BaseInputLabel>
|
|
165
142
|
)}
|
|
166
143
|
|
|
167
144
|
{(suffix || (!hideClearButton && !disabled)) && (
|
|
@@ -200,53 +177,36 @@ export const BaseInput = ({
|
|
|
200
177
|
);
|
|
201
178
|
};
|
|
202
179
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
{!status && <InformationFill size={16} color='muted' />}
|
|
212
|
-
{status === 'error' && <DeleteCircleFill size={16} color='error' />}
|
|
213
|
-
{status === 'success' && (
|
|
214
|
-
<CheckmarkCircleFill size={16} color='success' />
|
|
215
|
-
)}
|
|
216
|
-
<Text style={styles.helperText}>{helperText}</Text>
|
|
217
|
-
</View>
|
|
218
|
-
);
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
const BaseInputCounter = ({ count, maxCount }: BaseInputCounterProps) => {
|
|
222
|
-
const styles = useCounterStyles();
|
|
223
|
-
|
|
224
|
-
return (
|
|
225
|
-
<Text style={styles.counterText} accessibilityLiveRegion='polite'>
|
|
226
|
-
{`${count}/${maxCount}`}
|
|
227
|
-
</Text>
|
|
228
|
-
);
|
|
180
|
+
type StyleParams = {
|
|
181
|
+
status: BaseInputStatus | undefined;
|
|
182
|
+
isFocused: boolean;
|
|
183
|
+
isEditable: boolean;
|
|
184
|
+
hasLabel: boolean;
|
|
185
|
+
multiline: boolean;
|
|
186
|
+
minLines: number;
|
|
187
|
+
maxLines: number | undefined;
|
|
229
188
|
};
|
|
230
189
|
|
|
231
|
-
const
|
|
190
|
+
const useRowStyles = ({
|
|
232
191
|
status,
|
|
233
192
|
isFocused,
|
|
234
193
|
isEditable,
|
|
235
194
|
hasLabel,
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
hasLabel: boolean;
|
|
241
|
-
}) => {
|
|
195
|
+
multiline,
|
|
196
|
+
minLines,
|
|
197
|
+
maxLines,
|
|
198
|
+
}: StyleParams) => {
|
|
242
199
|
return useStyleSheet(
|
|
243
200
|
(t) => {
|
|
244
|
-
const hasStatusBorder = status === 'error' || status === 'success';
|
|
245
201
|
const statusBorderColors = {
|
|
246
202
|
error: t.colors.border.error,
|
|
247
203
|
success: t.colors.border.success,
|
|
248
204
|
} as const;
|
|
249
205
|
const statusBorderColor = status ? statusBorderColors[status] : undefined;
|
|
206
|
+
const borderWidth =
|
|
207
|
+
statusBorderColor && !isFocused ? t.borderWidth.s1 : t.borderWidth.s2;
|
|
208
|
+
|
|
209
|
+
const { paddingVertical } = getMultilineLayout(t, hasLabel);
|
|
250
210
|
|
|
251
211
|
return {
|
|
252
212
|
container: StyleSheet.flatten([
|
|
@@ -260,22 +220,52 @@ const useStyles = ({
|
|
|
260
220
|
paddingHorizontal: t.spacings.s16,
|
|
261
221
|
borderRadius: t.borderRadius.sm,
|
|
262
222
|
backgroundColor: t.colors.bg.muted,
|
|
263
|
-
borderWidth
|
|
223
|
+
borderWidth,
|
|
264
224
|
borderColor: 'transparent',
|
|
265
225
|
overflow: 'hidden',
|
|
266
226
|
},
|
|
267
|
-
|
|
268
|
-
statusBorderColor && {
|
|
269
|
-
borderWidth: isFocused ? t.borderWidth.s2 : t.borderWidth.s1,
|
|
270
|
-
borderColor: statusBorderColor,
|
|
271
|
-
},
|
|
227
|
+
statusBorderColor && { borderColor: statusBorderColor },
|
|
272
228
|
!isEditable && {
|
|
273
229
|
backgroundColor: t.colors.bg.disabled,
|
|
274
230
|
},
|
|
275
231
|
isFocused &&
|
|
276
|
-
!
|
|
232
|
+
!statusBorderColor &&
|
|
277
233
|
isEditable && { borderColor: t.colors.border.active },
|
|
234
|
+
multiline && {
|
|
235
|
+
alignItems: 'flex-start',
|
|
236
|
+
paddingVertical,
|
|
237
|
+
minHeight: getMultilineMinHeight(t, {
|
|
238
|
+
hasLabel,
|
|
239
|
+
minLines,
|
|
240
|
+
maxLines,
|
|
241
|
+
}),
|
|
242
|
+
},
|
|
278
243
|
]),
|
|
244
|
+
suffixContainer: StyleSheet.flatten([
|
|
245
|
+
{
|
|
246
|
+
minWidth: t.sizes.s20,
|
|
247
|
+
alignItems: 'center',
|
|
248
|
+
justifyContent: 'center',
|
|
249
|
+
},
|
|
250
|
+
multiline && { marginTop: t.spacings.s2 },
|
|
251
|
+
]),
|
|
252
|
+
};
|
|
253
|
+
},
|
|
254
|
+
[status, isFocused, isEditable, hasLabel, multiline, minLines, maxLines],
|
|
255
|
+
);
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
const useInputStyles = ({
|
|
259
|
+
isEditable,
|
|
260
|
+
hasLabel,
|
|
261
|
+
multiline,
|
|
262
|
+
maxLines,
|
|
263
|
+
}: Omit<StyleParams, 'status' | 'isFocused' | 'minLines'>) => {
|
|
264
|
+
return useStyleSheet(
|
|
265
|
+
(t) => {
|
|
266
|
+
const { lineHeight, labelRowHeight } = getMultilineLayout(t, hasLabel);
|
|
267
|
+
|
|
268
|
+
return {
|
|
279
269
|
input: StyleSheet.flatten([
|
|
280
270
|
{
|
|
281
271
|
position: 'relative',
|
|
@@ -300,149 +290,40 @@ const useStyles = ({
|
|
|
300
290
|
backgroundColor: t.colors.bg.disabled,
|
|
301
291
|
color: t.colors.text.disabled,
|
|
302
292
|
},
|
|
293
|
+
multiline && {
|
|
294
|
+
paddingTop: 0,
|
|
295
|
+
paddingBottom: 0,
|
|
296
|
+
marginTop: labelRowHeight,
|
|
297
|
+
minHeight: lineHeight,
|
|
298
|
+
maxHeight: maxLines ? maxLines * lineHeight : undefined,
|
|
299
|
+
},
|
|
300
|
+
multiline && RuntimeConstants.isAndroid && { lineHeight },
|
|
303
301
|
]),
|
|
304
|
-
footerContainer: {
|
|
305
|
-
marginTop: t.spacings.s8,
|
|
306
|
-
flexDirection: 'row',
|
|
307
|
-
alignItems: 'flex-start',
|
|
308
|
-
justifyContent: 'space-between',
|
|
309
|
-
gap: t.spacings.s8,
|
|
310
|
-
},
|
|
311
|
-
suffixContainer: {
|
|
312
|
-
minWidth: t.sizes.s20,
|
|
313
|
-
alignItems: 'center',
|
|
314
|
-
justifyContent: 'center',
|
|
315
|
-
},
|
|
316
302
|
};
|
|
317
303
|
},
|
|
318
|
-
[
|
|
304
|
+
[isEditable, hasLabel, multiline, maxLines],
|
|
319
305
|
);
|
|
320
306
|
};
|
|
321
307
|
|
|
322
|
-
const
|
|
323
|
-
status,
|
|
324
|
-
}: {
|
|
325
|
-
status: BaseInputProps['status'];
|
|
326
|
-
}) => {
|
|
308
|
+
const useFooterStyles = () => {
|
|
327
309
|
return useStyleSheet(
|
|
328
310
|
(t) => ({
|
|
329
|
-
|
|
330
|
-
|
|
311
|
+
footerContainer: {
|
|
312
|
+
marginTop: t.spacings.s8,
|
|
331
313
|
flexDirection: 'row',
|
|
332
|
-
alignItems: '
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
helperText: {
|
|
336
|
-
...t.typographies.body3,
|
|
337
|
-
flex: 1,
|
|
338
|
-
color: {
|
|
339
|
-
error: t.colors.text.error,
|
|
340
|
-
success: t.colors.text.success,
|
|
341
|
-
default: t.colors.text.muted,
|
|
342
|
-
}[status ?? 'default'],
|
|
343
|
-
},
|
|
344
|
-
}),
|
|
345
|
-
[status],
|
|
346
|
-
);
|
|
347
|
-
};
|
|
348
|
-
|
|
349
|
-
const useCounterStyles = () => {
|
|
350
|
-
return useStyleSheet(
|
|
351
|
-
(t) => ({
|
|
352
|
-
counterText: {
|
|
353
|
-
...t.typographies.body3,
|
|
354
|
-
flexShrink: 0,
|
|
355
|
-
color: t.colors.text.muted,
|
|
314
|
+
alignItems: 'flex-start',
|
|
315
|
+
justifyContent: 'space-between',
|
|
316
|
+
gap: t.spacings.s8,
|
|
356
317
|
},
|
|
357
318
|
}),
|
|
358
319
|
[],
|
|
359
320
|
);
|
|
360
321
|
};
|
|
361
322
|
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
}
|
|
366
|
-
isFloatingLabel: boolean;
|
|
367
|
-
theme: LumenStyleSheetTheme;
|
|
368
|
-
}) => {
|
|
369
|
-
const floatingAnimation = useSharedValue(isFloatingLabel ? 1 : 0);
|
|
370
|
-
const timingConfig = useTimingConfig({
|
|
371
|
-
duration: 150,
|
|
372
|
-
easing: 'linear',
|
|
373
|
-
});
|
|
374
|
-
|
|
375
|
-
useEffect(() => {
|
|
376
|
-
floatingAnimation.value = withTiming(isFloatingLabel ? 1 : 0, timingConfig);
|
|
377
|
-
|
|
378
|
-
return () => cancelAnimation(floatingAnimation);
|
|
379
|
-
}, [isFloatingLabel, timingConfig, floatingAnimation]);
|
|
380
|
-
|
|
381
|
-
const animatedStyle = useAnimatedStyle(
|
|
382
|
-
() => ({
|
|
383
|
-
top: interpolate(
|
|
384
|
-
floatingAnimation.value,
|
|
385
|
-
[0, 1],
|
|
386
|
-
[theme.spacings.s14, theme.spacings.s6],
|
|
387
|
-
),
|
|
388
|
-
fontSize: interpolate(
|
|
389
|
-
floatingAnimation.value,
|
|
390
|
-
[0, 1],
|
|
391
|
-
[theme.typographies.body2.fontSize, theme.typographies.body4.fontSize],
|
|
392
|
-
),
|
|
393
|
-
}),
|
|
394
|
-
[floatingAnimation, theme],
|
|
395
|
-
);
|
|
396
|
-
|
|
397
|
-
return { animatedStyle };
|
|
398
|
-
};
|
|
399
|
-
|
|
400
|
-
const useFloatingLabelStyles = ({
|
|
401
|
-
isFocused,
|
|
402
|
-
hasContent,
|
|
403
|
-
showClearButton,
|
|
404
|
-
status,
|
|
405
|
-
isEditable,
|
|
406
|
-
labelStaysFloatedWithPlaceholder,
|
|
407
|
-
}: {
|
|
408
|
-
isFocused: boolean;
|
|
409
|
-
hasContent: boolean;
|
|
410
|
-
showClearButton: boolean;
|
|
411
|
-
status: 'error' | 'success' | undefined;
|
|
412
|
-
isEditable: boolean;
|
|
413
|
-
labelStaysFloatedWithPlaceholder: boolean;
|
|
414
|
-
}) => {
|
|
415
|
-
const { theme } = useTheme();
|
|
416
|
-
|
|
417
|
-
const { label } = useStyleSheet(
|
|
418
|
-
(t) => ({
|
|
419
|
-
label: StyleSheet.flatten([
|
|
420
|
-
{
|
|
421
|
-
position: 'absolute',
|
|
422
|
-
left: t.spacings.s16,
|
|
423
|
-
width: t.sizes.full,
|
|
424
|
-
color: t.colors.text.muted,
|
|
425
|
-
},
|
|
426
|
-
hasContent &&
|
|
427
|
-
showClearButton && {
|
|
428
|
-
width: '92%',
|
|
429
|
-
},
|
|
430
|
-
status === 'error' && {
|
|
431
|
-
color: t.colors.text.error,
|
|
432
|
-
},
|
|
433
|
-
!isEditable && {
|
|
434
|
-
color: t.colors.text.disabled,
|
|
435
|
-
},
|
|
436
|
-
]),
|
|
437
|
-
}),
|
|
438
|
-
[hasContent, showClearButton, status, isEditable],
|
|
439
|
-
);
|
|
440
|
-
|
|
441
|
-
const { animatedStyle } = useAnimatedFloatingLabel({
|
|
442
|
-
theme,
|
|
443
|
-
isFloatingLabel:
|
|
444
|
-
isFocused || hasContent || labelStaysFloatedWithPlaceholder,
|
|
445
|
-
});
|
|
323
|
+
const useStyles = (params: StyleParams) => {
|
|
324
|
+
const { container, suffixContainer } = useRowStyles(params);
|
|
325
|
+
const { input } = useInputStyles(params);
|
|
326
|
+
const { footerContainer } = useFooterStyles();
|
|
446
327
|
|
|
447
|
-
return {
|
|
328
|
+
return { container, input, suffixContainer, footerContainer };
|
|
448
329
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { TextStyle } from 'react-native';
|
|
2
|
+
import { Text } from 'react-native';
|
|
3
|
+
import { useStyleSheet } from '../../../../styles';
|
|
4
|
+
import type { BaseInputCounterProps } from './types';
|
|
5
|
+
|
|
6
|
+
const useCounterStyles = (): { counterText: TextStyle } => {
|
|
7
|
+
return useStyleSheet(
|
|
8
|
+
(t) => ({
|
|
9
|
+
counterText: {
|
|
10
|
+
...t.typographies.body3,
|
|
11
|
+
flexShrink: 0,
|
|
12
|
+
color: t.colors.text.muted,
|
|
13
|
+
},
|
|
14
|
+
}),
|
|
15
|
+
[],
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Character counter rendered below the control inside `BaseInput`.
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export const BaseInputCounter = ({
|
|
25
|
+
count,
|
|
26
|
+
maxCount,
|
|
27
|
+
}: BaseInputCounterProps) => {
|
|
28
|
+
const styles = useCounterStyles();
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<Text style={styles.counterText} accessibilityLiveRegion='polite'>
|
|
32
|
+
{`${count}/${maxCount}`}
|
|
33
|
+
</Text>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { TextStyle, ViewStyle } from 'react-native';
|
|
2
|
+
import { Text, View } from 'react-native';
|
|
3
|
+
import { useStyleSheet } from '../../../../styles';
|
|
4
|
+
import { CheckmarkCircleFill } from '../../symbols/icons/CheckmarkCircleFill';
|
|
5
|
+
import { DeleteCircleFill } from '../../symbols/icons/DeleteCircleFill';
|
|
6
|
+
import { InformationFill } from '../../symbols/icons/InformationFill';
|
|
7
|
+
import type { BaseInputHelperTextProps, BaseInputProps } from './types';
|
|
8
|
+
|
|
9
|
+
const useHelperTextStyles = ({
|
|
10
|
+
status,
|
|
11
|
+
}: {
|
|
12
|
+
status: BaseInputProps['status'];
|
|
13
|
+
}): { helperContainer: ViewStyle; helperText: TextStyle } => {
|
|
14
|
+
return useStyleSheet(
|
|
15
|
+
(t) => ({
|
|
16
|
+
helperContainer: {
|
|
17
|
+
flex: 1,
|
|
18
|
+
flexDirection: 'row',
|
|
19
|
+
alignItems: 'flex-start',
|
|
20
|
+
gap: t.spacings.s2,
|
|
21
|
+
},
|
|
22
|
+
helperText: {
|
|
23
|
+
...t.typographies.body3,
|
|
24
|
+
flex: 1,
|
|
25
|
+
color: {
|
|
26
|
+
error: t.colors.text.error,
|
|
27
|
+
success: t.colors.text.success,
|
|
28
|
+
default: t.colors.text.muted,
|
|
29
|
+
}[status ?? 'default'],
|
|
30
|
+
},
|
|
31
|
+
}),
|
|
32
|
+
[status],
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Hint, error or success copy rendered below the control inside `BaseInput`.
|
|
38
|
+
*
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
export const BaseInputHelperText = ({
|
|
42
|
+
helperText,
|
|
43
|
+
status,
|
|
44
|
+
}: BaseInputHelperTextProps) => {
|
|
45
|
+
const styles = useHelperTextStyles({ status });
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<View style={styles.helperContainer}>
|
|
49
|
+
{!status && <InformationFill size={16} color='muted' />}
|
|
50
|
+
{status === 'error' && <DeleteCircleFill size={16} color='error' />}
|
|
51
|
+
{status === 'success' && (
|
|
52
|
+
<CheckmarkCircleFill size={16} color='success' />
|
|
53
|
+
)}
|
|
54
|
+
<Text style={styles.helperText}>{helperText}</Text>
|
|
55
|
+
</View>
|
|
56
|
+
);
|
|
57
|
+
};
|