@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
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
|
|
|
2
2
|
import { Box, Text } from '../../primitives';
|
|
3
3
|
import { Switch } from './Switch';
|
|
4
4
|
|
|
5
|
-
const meta
|
|
5
|
+
const meta = {
|
|
6
6
|
id: 'rnative-switch',
|
|
7
7
|
title: 'Core/Switch',
|
|
8
8
|
component: Switch,
|
|
@@ -34,10 +34,10 @@ const meta: Meta<typeof Switch> = {
|
|
|
34
34
|
description: 'Callback function called when the checked state changes',
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
|
-
}
|
|
37
|
+
} satisfies Meta<typeof Switch>;
|
|
38
38
|
|
|
39
39
|
export default meta;
|
|
40
|
-
type Story = StoryObj<typeof
|
|
40
|
+
type Story = StoryObj<typeof Switch>;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* The base switch in its normal state.
|
|
@@ -3,7 +3,7 @@ import { Box } from '../../primitives/Box';
|
|
|
3
3
|
import { Check } from '../../symbols/icons/Check';
|
|
4
4
|
import { Tag } from './Tag';
|
|
5
5
|
|
|
6
|
-
const meta
|
|
6
|
+
const meta = {
|
|
7
7
|
component: Tag,
|
|
8
8
|
id: 'rnative-tag',
|
|
9
9
|
title: 'Core/Tag',
|
|
@@ -35,7 +35,7 @@ const meta: Meta<typeof Tag> = {
|
|
|
35
35
|
description: 'Show icon',
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
|
-
}
|
|
38
|
+
} satisfies Meta<typeof Tag>;
|
|
39
39
|
|
|
40
40
|
export default meta;
|
|
41
41
|
|
|
@@ -51,6 +51,9 @@ export const Base: Story = {
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
export const AppearanceShowcase: Story = {
|
|
54
|
+
args: {
|
|
55
|
+
label: 'Label',
|
|
56
|
+
},
|
|
54
57
|
render: () => (
|
|
55
58
|
<Box lx={{ flexDirection: 'column', gap: 's16' }}>
|
|
56
59
|
<Box lx={{ flexDirection: 'row', gap: 's4' }}>
|
|
@@ -80,6 +83,9 @@ export const AppearanceShowcase: Story = {
|
|
|
80
83
|
};
|
|
81
84
|
|
|
82
85
|
export const SizeShowcase: Story = {
|
|
86
|
+
args: {
|
|
87
|
+
label: 'Label',
|
|
88
|
+
},
|
|
83
89
|
render: () => (
|
|
84
90
|
<Box lx={{ flexDirection: 'row', alignItems: 'center', gap: 's4' }}>
|
|
85
91
|
<Tag size='md' label='Large Tag' />
|
|
@@ -89,6 +95,9 @@ export const SizeShowcase: Story = {
|
|
|
89
95
|
};
|
|
90
96
|
|
|
91
97
|
export const ContentTypeShowcase: Story = {
|
|
98
|
+
args: {
|
|
99
|
+
label: 'Label',
|
|
100
|
+
},
|
|
92
101
|
render: () => (
|
|
93
102
|
<Box lx={{ flexDirection: 'row', alignItems: 'center', gap: 's4' }}>
|
|
94
103
|
<Tag label='Label only' />
|
|
@@ -98,6 +107,9 @@ export const ContentTypeShowcase: Story = {
|
|
|
98
107
|
};
|
|
99
108
|
|
|
100
109
|
export const TruncateShowcase: Story = {
|
|
110
|
+
args: {
|
|
111
|
+
label: 'Label',
|
|
112
|
+
},
|
|
101
113
|
render: () => (
|
|
102
114
|
<Box lx={{ width: 's176' }}>
|
|
103
115
|
<Tag label='Very long custom Tag text that should truncate' />
|
|
@@ -28,6 +28,9 @@ figma.connect(
|
|
|
28
28
|
true: figma.string('counter'),
|
|
29
29
|
false: undefined,
|
|
30
30
|
}),
|
|
31
|
+
multiline: figma.enum('type', {
|
|
32
|
+
'multi-line': true,
|
|
33
|
+
}),
|
|
31
34
|
},
|
|
32
35
|
example: (props: any) => (
|
|
33
36
|
<TextInput
|
|
@@ -38,6 +41,7 @@ figma.connect(
|
|
|
38
41
|
helperText={props.helperText.label}
|
|
39
42
|
status={props.status}
|
|
40
43
|
maxCount={props.maxCount}
|
|
44
|
+
multiline={props.multiline}
|
|
41
45
|
onChangeText={() => {}}
|
|
42
46
|
/>
|
|
43
47
|
),
|
|
@@ -36,6 +36,21 @@ The label text automatically floats above the input when content is entered, pro
|
|
|
36
36
|
|
|
37
37
|
<Canvas of={TextInputStories.WithLabelAndPlaceholder} />
|
|
38
38
|
|
|
39
|
+
### Multiline
|
|
40
|
+
|
|
41
|
+
Set `multiline` to let the field grow with its content instead of scrolling sideways. Everything else is unchanged: floating label, clear button, helper text, and counter behave exactly as they do on a single-line field.
|
|
42
|
+
|
|
43
|
+
- `minLines`: height the field starts at, in lines. Defaults to `1`
|
|
44
|
+
- `maxLines`: growth ceiling, in lines. Once reached, the field scrolls internally instead of growing. Unbounded when omitted
|
|
45
|
+
|
|
46
|
+
<Canvas of={TextInputStories.WithMultiline} />
|
|
47
|
+
|
|
48
|
+
Equal `minLines` and `maxLines` give a fixed-height box that scrolls instead of growing:
|
|
49
|
+
|
|
50
|
+
<Canvas of={TextInputStories.WithMultilineFixedHeight} />
|
|
51
|
+
|
|
52
|
+
> **Note:** The scroll indicator inside a clamped field is drawn by the platform, so unlike the web component there is no `scrollbarWidth` prop to configure it.
|
|
53
|
+
|
|
39
54
|
### Clear Button
|
|
40
55
|
|
|
41
56
|
A clear button (×) appears **automatically** when input has content.
|
|
@@ -197,6 +212,16 @@ Combine `maxCount` with the native `maxLength` prop to hard-cap the input. The p
|
|
|
197
212
|
|
|
198
213
|
<Source of={TextInputStories.WithNativeMaxLength} />
|
|
199
214
|
|
|
215
|
+
### Multiline
|
|
216
|
+
|
|
217
|
+
`multiline` lets the field grow with its content, bounded by `minLines` and `maxLines`:
|
|
218
|
+
|
|
219
|
+
<Source of={TextInputStories.WithMultiline} />
|
|
220
|
+
|
|
221
|
+
Equal `minLines` and `maxLines` give a fixed-height box that scrolls once the ceiling is reached.
|
|
222
|
+
|
|
223
|
+
<Source of={TextInputStories.WithMultilineFixedHeight} />
|
|
224
|
+
|
|
200
225
|
### With Custom Styling
|
|
201
226
|
|
|
202
227
|
While the component comes with predefined styles, you can extend them using the `style` prop:
|
|
@@ -4,7 +4,7 @@ import { View } from 'react-native';
|
|
|
4
4
|
import { TextInput } from './TextInput';
|
|
5
5
|
import { type TextInputProps } from './types';
|
|
6
6
|
|
|
7
|
-
const meta
|
|
7
|
+
const meta = {
|
|
8
8
|
component: TextInput,
|
|
9
9
|
id: 'rnative-textinput',
|
|
10
10
|
title: 'Core/TextInput',
|
|
@@ -17,7 +17,7 @@ const meta: Meta<typeof TextInput> = {
|
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
|
-
}
|
|
20
|
+
} satisfies Meta<typeof TextInput>;
|
|
21
21
|
|
|
22
22
|
export default meta;
|
|
23
23
|
type Story = StoryObj<typeof TextInput>;
|
|
@@ -174,6 +174,33 @@ export const WithNeutralHint: Story = {
|
|
|
174
174
|
},
|
|
175
175
|
};
|
|
176
176
|
|
|
177
|
+
export const WithMultiline: Story = {
|
|
178
|
+
render: (args) => <TextInputStory {...args} />,
|
|
179
|
+
args: {
|
|
180
|
+
label: 'Note',
|
|
181
|
+
helperText: 'Grows from 2 to 5 lines, then scrolls',
|
|
182
|
+
multiline: true,
|
|
183
|
+
minLines: 2,
|
|
184
|
+
maxLines: 5,
|
|
185
|
+
editable: true,
|
|
186
|
+
hideClearButton: false,
|
|
187
|
+
keyboardType: 'default',
|
|
188
|
+
},
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export const WithMultilineFixedHeight: Story = {
|
|
192
|
+
render: (args) => <TextInputStory {...args} />,
|
|
193
|
+
args: {
|
|
194
|
+
label: 'Note',
|
|
195
|
+
multiline: true,
|
|
196
|
+
minLines: 4,
|
|
197
|
+
maxLines: 4,
|
|
198
|
+
editable: true,
|
|
199
|
+
hideClearButton: false,
|
|
200
|
+
keyboardType: 'default',
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
|
|
177
204
|
export const DisabledTextInput: Story = {
|
|
178
205
|
render: (args) => <TextInputStory {...args} initialValue='johndoe' />,
|
|
179
206
|
args: {
|
|
@@ -1,14 +1,40 @@
|
|
|
1
|
-
import { describe, expect, it } from '@jest/globals';
|
|
1
|
+
import { afterEach, describe, expect, it, jest } from '@jest/globals';
|
|
2
2
|
import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
|
|
3
3
|
import { render, screen } from '@testing-library/react-native';
|
|
4
4
|
import type { ReactElement } from 'react';
|
|
5
|
+
import { RuntimeConstants } from '../../../utils';
|
|
6
|
+
import { Pressable } from '../../primitives';
|
|
5
7
|
import { CheckmarkCircleFill } from '../../symbols/icons/CheckmarkCircleFill';
|
|
6
8
|
import { DeleteCircleFill } from '../../symbols/icons/DeleteCircleFill';
|
|
7
9
|
import { InformationFill } from '../../symbols/icons/InformationFill';
|
|
8
10
|
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
9
11
|
import { TextInput } from './TextInput';
|
|
12
|
+
import type { TextInputProps } from './types';
|
|
10
13
|
|
|
11
|
-
const { colors } = ledgerLiveThemes.dark;
|
|
14
|
+
const { colors, spacings } = ledgerLiveThemes.dark;
|
|
15
|
+
const { body1, body2 } = ledgerLiveThemes.dark.typographies.xs.body;
|
|
16
|
+
|
|
17
|
+
// Labelled fields use body2 plus a reserved label row; unlabelled (AddressInput)
|
|
18
|
+
// use body1. Chrome is padding (and that label row) so minLines={1} matches s48.
|
|
19
|
+
const geometries: {
|
|
20
|
+
name: string;
|
|
21
|
+
props: Partial<TextInputProps>;
|
|
22
|
+
lineHeight: number;
|
|
23
|
+
chrome: number;
|
|
24
|
+
}[] = [
|
|
25
|
+
{
|
|
26
|
+
name: 'labelled',
|
|
27
|
+
props: { label: 'Note' },
|
|
28
|
+
lineHeight: body2.lineHeight,
|
|
29
|
+
chrome: spacings.s16 + 2 * spacings.s6,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'unlabelled',
|
|
33
|
+
props: {},
|
|
34
|
+
lineHeight: body1.lineHeight,
|
|
35
|
+
chrome: 2 * spacings.s12,
|
|
36
|
+
},
|
|
37
|
+
];
|
|
12
38
|
|
|
13
39
|
const renderWithProvider = (
|
|
14
40
|
component: ReactElement,
|
|
@@ -170,4 +196,105 @@ describe('TextInput', () => {
|
|
|
170
196
|
expect(screen.UNSAFE_queryByType(DeleteCircleFill)).toBeNull();
|
|
171
197
|
});
|
|
172
198
|
});
|
|
199
|
+
|
|
200
|
+
// The height itself is native, so the bounds are all these tests can reach: the
|
|
201
|
+
// container carries the minLines floor, the input box carries the ceiling.
|
|
202
|
+
describe('Multiline', () => {
|
|
203
|
+
afterEach(() => {
|
|
204
|
+
jest.restoreAllMocks();
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
const field = () => screen.getByPlaceholderText('Write a note');
|
|
208
|
+
const container = () => screen.UNSAFE_getByType(Pressable);
|
|
209
|
+
|
|
210
|
+
const renderMultiline = (props: Partial<TextInputProps> = {}) =>
|
|
211
|
+
renderWithProvider(
|
|
212
|
+
<TextInput
|
|
213
|
+
placeholder='Write a note'
|
|
214
|
+
value=''
|
|
215
|
+
onChangeText={() => {}}
|
|
216
|
+
{...props}
|
|
217
|
+
/>,
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
it('stays single-line by default', () => {
|
|
221
|
+
renderMultiline({ label: 'Note' });
|
|
222
|
+
|
|
223
|
+
const { multiline, style } = field().props;
|
|
224
|
+
|
|
225
|
+
expect(multiline).toBeFalsy();
|
|
226
|
+
expect(style.minHeight).toBeUndefined();
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
describe.each(geometries)('$name', ({ props, lineHeight, chrome }) => {
|
|
230
|
+
const renderCase = (extra: Partial<TextInputProps> = {}) =>
|
|
231
|
+
renderMultiline({ ...props, multiline: true, ...extra });
|
|
232
|
+
|
|
233
|
+
it('floors the field at minLines and leaves it unbounded above', () => {
|
|
234
|
+
renderCase({ minLines: 2 });
|
|
235
|
+
|
|
236
|
+
expect(field().props.multiline).toBe(true);
|
|
237
|
+
expect(container().props.style.minHeight).toBe(2 * lineHeight + chrome);
|
|
238
|
+
expect(field().props.style.maxHeight).toBeUndefined();
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
// A box taller than its text would drop the value below the placeholder on
|
|
242
|
+
// Android, which centres a line within its box.
|
|
243
|
+
it('keeps the input box a single line whatever the floor is', () => {
|
|
244
|
+
renderCase({ minLines: 3 });
|
|
245
|
+
|
|
246
|
+
expect(field().props.style.minHeight).toBe(lineHeight);
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
it('caps the growth at maxLines', () => {
|
|
250
|
+
renderCase({ minLines: 2, maxLines: 4 });
|
|
251
|
+
|
|
252
|
+
expect(container().props.style.minHeight).toBe(2 * lineHeight + chrome);
|
|
253
|
+
expect(field().props.style.maxHeight).toBe(4 * lineHeight);
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
it('gives a fixed box when minLines and maxLines match', () => {
|
|
257
|
+
renderCase({ minLines: 3, maxLines: 3 });
|
|
258
|
+
|
|
259
|
+
expect(container().props.style.minHeight).toBe(3 * lineHeight + chrome);
|
|
260
|
+
expect(field().props.style.maxHeight).toBe(3 * lineHeight);
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
it('lets maxLines win over a taller minLines', () => {
|
|
264
|
+
renderCase({ minLines: 5, maxLines: 2 });
|
|
265
|
+
|
|
266
|
+
expect(container().props.style.minHeight).toBe(2 * lineHeight + chrome);
|
|
267
|
+
expect(field().props.style.maxHeight).toBe(2 * lineHeight);
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
it('takes the token line height on Android', () => {
|
|
271
|
+
jest.spyOn(RuntimeConstants, 'isAndroid', 'get').mockReturnValue(true);
|
|
272
|
+
|
|
273
|
+
renderCase();
|
|
274
|
+
|
|
275
|
+
expect(field().props.style.lineHeight).toBe(lineHeight);
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
it('leaves the line height natural on iOS', () => {
|
|
279
|
+
jest.spyOn(RuntimeConstants, 'isIOS', 'get').mockReturnValue(true);
|
|
280
|
+
|
|
281
|
+
renderCase();
|
|
282
|
+
|
|
283
|
+
expect(field().props.style.lineHeight).toBe(0);
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
it('still renders the clear button and the counter', () => {
|
|
288
|
+
renderMultiline({
|
|
289
|
+
label: 'Note',
|
|
290
|
+
multiline: true,
|
|
291
|
+
minLines: 2,
|
|
292
|
+
value: 'Hello',
|
|
293
|
+
maxCount: 32,
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
expect(screen.UNSAFE_getByType(DeleteCircleFill)).toBeTruthy();
|
|
297
|
+
expect(screen.getByText('5/32')).toBeTruthy();
|
|
298
|
+
});
|
|
299
|
+
});
|
|
173
300
|
});
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
TileTrailingContent,
|
|
12
12
|
} from './Tile';
|
|
13
13
|
|
|
14
|
-
const meta
|
|
14
|
+
const meta = {
|
|
15
15
|
component: Tile,
|
|
16
16
|
subcomponents: {
|
|
17
17
|
TileContent,
|
|
@@ -48,7 +48,7 @@ const meta: Meta<typeof Tile> = {
|
|
|
48
48
|
control: 'boolean',
|
|
49
49
|
},
|
|
50
50
|
},
|
|
51
|
-
}
|
|
51
|
+
} satisfies Meta<typeof Tile>;
|
|
52
52
|
|
|
53
53
|
export default meta;
|
|
54
54
|
type Story = StoryObj<typeof Tile>;
|
|
@@ -58,6 +58,7 @@ export const Base: Story = {
|
|
|
58
58
|
appearance: 'no-background',
|
|
59
59
|
disabled: false,
|
|
60
60
|
centered: false,
|
|
61
|
+
children: null,
|
|
61
62
|
},
|
|
62
63
|
render: (args) => (
|
|
63
64
|
<Tile {...args} lx={{ maxWidth: 's112' }}>
|
|
@@ -86,6 +87,9 @@ export const Base: Story = {
|
|
|
86
87
|
};
|
|
87
88
|
|
|
88
89
|
export const VariantsShowcase: Story = {
|
|
90
|
+
args: {
|
|
91
|
+
children: null,
|
|
92
|
+
},
|
|
89
93
|
render: () => (
|
|
90
94
|
<Box lx={{ flexDirection: 'column', gap: 's16' }}>
|
|
91
95
|
<Tile lx={{ maxWidth: 's176' }}>
|
|
@@ -128,6 +132,9 @@ export const VariantsShowcase: Story = {
|
|
|
128
132
|
};
|
|
129
133
|
|
|
130
134
|
export const WithSecondaryAction: Story = {
|
|
135
|
+
args: {
|
|
136
|
+
children: null,
|
|
137
|
+
},
|
|
131
138
|
render: () => (
|
|
132
139
|
<Tile
|
|
133
140
|
onLongPress={() => alert('Long press - secondary action triggered!')}
|
|
@@ -161,6 +168,9 @@ export const WithSecondaryAction: Story = {
|
|
|
161
168
|
};
|
|
162
169
|
|
|
163
170
|
export const HorizontalList: Story = {
|
|
171
|
+
args: {
|
|
172
|
+
children: null,
|
|
173
|
+
},
|
|
164
174
|
render: () => (
|
|
165
175
|
<Box lx={{ flexDirection: 'column', gap: 's16' }}>
|
|
166
176
|
<Box
|
|
@@ -207,6 +217,9 @@ export const HorizontalList: Story = {
|
|
|
207
217
|
};
|
|
208
218
|
|
|
209
219
|
export const ResponsiveLayout: Story = {
|
|
220
|
+
args: {
|
|
221
|
+
children: null,
|
|
222
|
+
},
|
|
210
223
|
render: () => (
|
|
211
224
|
<Box lx={{ width: 'full', flexDirection: 'column', gap: 's16' }}>
|
|
212
225
|
<Box>
|
|
@@ -235,6 +248,9 @@ export const ResponsiveLayout: Story = {
|
|
|
235
248
|
};
|
|
236
249
|
|
|
237
250
|
export const AppearanceShowcase: Story = {
|
|
251
|
+
args: {
|
|
252
|
+
children: null,
|
|
253
|
+
},
|
|
238
254
|
render: () => (
|
|
239
255
|
<Box lx={{ flexDirection: 'column', gap: 's24' }}>
|
|
240
256
|
<Box>
|
|
@@ -284,6 +300,9 @@ export const AppearanceShowcase: Story = {
|
|
|
284
300
|
};
|
|
285
301
|
|
|
286
302
|
export const CenteredShowcase: Story = {
|
|
303
|
+
args: {
|
|
304
|
+
children: null,
|
|
305
|
+
},
|
|
287
306
|
render: () => (
|
|
288
307
|
<Box lx={{ flexDirection: 'row', gap: 's8' }}>
|
|
289
308
|
<Tile appearance='card' lx={{ width: 's128' }}>
|
|
@@ -327,6 +346,9 @@ export const CenteredShowcase: Story = {
|
|
|
327
346
|
};
|
|
328
347
|
|
|
329
348
|
export const SizeShowcase: Story = {
|
|
349
|
+
args: {
|
|
350
|
+
children: null,
|
|
351
|
+
},
|
|
330
352
|
render: () => (
|
|
331
353
|
<Box lx={{ flexDirection: 'column', gap: 's24' }}>
|
|
332
354
|
<Box>
|
|
@@ -13,7 +13,7 @@ const iconOptions = {
|
|
|
13
13
|
Cart,
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
const meta
|
|
16
|
+
const meta = {
|
|
17
17
|
component: TileButton,
|
|
18
18
|
id: 'rnative-tilebutton',
|
|
19
19
|
title: 'Core/TileButton',
|
|
@@ -31,7 +31,7 @@ const meta: Meta<typeof TileButton> = {
|
|
|
31
31
|
action: 'pressed',
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
|
-
}
|
|
34
|
+
} satisfies Meta<typeof TileButton>;
|
|
35
35
|
|
|
36
36
|
export default meta;
|
|
37
37
|
type Story = StoryObj<typeof TileButton>;
|
|
@@ -52,6 +52,10 @@ export const Base: Story = {
|
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
export const AppearanceShowcase: Story = {
|
|
55
|
+
args: {
|
|
56
|
+
icon: Settings,
|
|
57
|
+
children: 'Settings',
|
|
58
|
+
},
|
|
55
59
|
render: (args) => (
|
|
56
60
|
<View style={{ gap: 16 }}>
|
|
57
61
|
<View style={{ flexDirection: 'row', gap: 16 }}>
|
|
@@ -67,6 +71,10 @@ export const AppearanceShowcase: Story = {
|
|
|
67
71
|
};
|
|
68
72
|
|
|
69
73
|
export const DisabledShowcase: Story = {
|
|
74
|
+
args: {
|
|
75
|
+
icon: Settings,
|
|
76
|
+
children: 'Settings',
|
|
77
|
+
},
|
|
70
78
|
render: (args) => (
|
|
71
79
|
<View style={{ flexDirection: 'row', gap: 16 }}>
|
|
72
80
|
<TileButton icon={Settings} onPress={args.onPress} disabled>
|
|
@@ -85,6 +93,10 @@ export const DisabledShowcase: Story = {
|
|
|
85
93
|
};
|
|
86
94
|
|
|
87
95
|
export const IconsShowcase: Story = {
|
|
96
|
+
args: {
|
|
97
|
+
icon: Settings,
|
|
98
|
+
children: 'Settings',
|
|
99
|
+
},
|
|
88
100
|
render: (args) => (
|
|
89
101
|
<View style={{ flexDirection: 'row', gap: 16 }}>
|
|
90
102
|
<TileButton icon={Settings} onPress={args.onPress}>
|
|
@@ -104,6 +116,10 @@ export const IconsShowcase: Story = {
|
|
|
104
116
|
};
|
|
105
117
|
|
|
106
118
|
export const GridLayout: Story = {
|
|
119
|
+
args: {
|
|
120
|
+
icon: Settings,
|
|
121
|
+
children: 'Settings',
|
|
122
|
+
},
|
|
107
123
|
render: (args) => (
|
|
108
124
|
<View style={{ width: 343, gap: 8 }}>
|
|
109
125
|
{/* 2-button row */}
|
|
@@ -142,6 +158,10 @@ export const GridLayout: Story = {
|
|
|
142
158
|
};
|
|
143
159
|
|
|
144
160
|
export const WidthShowcase: Story = {
|
|
161
|
+
args: {
|
|
162
|
+
icon: Settings,
|
|
163
|
+
children: 'Settings',
|
|
164
|
+
},
|
|
145
165
|
render: (args) => (
|
|
146
166
|
<View
|
|
147
167
|
style={{
|
|
@@ -163,6 +183,10 @@ export const WidthShowcase: Story = {
|
|
|
163
183
|
};
|
|
164
184
|
|
|
165
185
|
export const TruncationShowcase: Story = {
|
|
186
|
+
args: {
|
|
187
|
+
icon: Settings,
|
|
188
|
+
children: 'Settings',
|
|
189
|
+
},
|
|
166
190
|
render: (args) => (
|
|
167
191
|
<View style={{ flexDirection: 'row', gap: 16 }}>
|
|
168
192
|
<View style={{ width: 80 }}>
|
|
@@ -7,18 +7,21 @@ import { InteractiveIcon } from '../InteractiveIcon';
|
|
|
7
7
|
import { GlobalTooltipBottomSheet } from './GlobalTooltipBottomSheet';
|
|
8
8
|
import { Tooltip, TooltipTrigger, TooltipContent } from './Tooltip';
|
|
9
9
|
|
|
10
|
-
const meta
|
|
10
|
+
const meta = {
|
|
11
11
|
component: Tooltip,
|
|
12
12
|
subcomponents: { TooltipTrigger, TooltipContent },
|
|
13
13
|
id: 'rnative-tooltip',
|
|
14
14
|
title: 'Core/Tooltip',
|
|
15
|
-
}
|
|
15
|
+
} satisfies Meta<typeof Tooltip>;
|
|
16
16
|
|
|
17
17
|
export default meta;
|
|
18
18
|
|
|
19
19
|
type Story = StoryObj<typeof Tooltip>;
|
|
20
20
|
|
|
21
21
|
export const Base: Story = {
|
|
22
|
+
args: {
|
|
23
|
+
children: null,
|
|
24
|
+
},
|
|
22
25
|
render: () => (
|
|
23
26
|
<>
|
|
24
27
|
<Box
|
|
@@ -45,6 +48,9 @@ export const Base: Story = {
|
|
|
45
48
|
};
|
|
46
49
|
|
|
47
50
|
export const WithCustomContent: Story = {
|
|
51
|
+
args: {
|
|
52
|
+
children: null,
|
|
53
|
+
},
|
|
48
54
|
render: () => (
|
|
49
55
|
<>
|
|
50
56
|
<Box
|
|
@@ -83,6 +89,9 @@ export const WithCustomContent: Story = {
|
|
|
83
89
|
};
|
|
84
90
|
|
|
85
91
|
export const WithMultipleTooltips: Story = {
|
|
92
|
+
args: {
|
|
93
|
+
children: null,
|
|
94
|
+
},
|
|
86
95
|
render: () => (
|
|
87
96
|
<>
|
|
88
97
|
<Box
|
|
@@ -135,6 +144,9 @@ export const WithMultipleTooltips: Story = {
|
|
|
135
144
|
};
|
|
136
145
|
|
|
137
146
|
export const WithChangeCallback: Story = {
|
|
147
|
+
args: {
|
|
148
|
+
children: null,
|
|
149
|
+
},
|
|
138
150
|
render: () => {
|
|
139
151
|
return (
|
|
140
152
|
<>
|
|
@@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
|
|
|
2
2
|
import { Box } from '../../primitives/Box';
|
|
3
3
|
import { Trend } from './Trend';
|
|
4
4
|
|
|
5
|
-
const meta
|
|
5
|
+
const meta = {
|
|
6
6
|
component: Trend,
|
|
7
7
|
id: 'rnative-trend',
|
|
8
8
|
title: 'Core/Trend',
|
|
@@ -18,7 +18,7 @@ const meta: Meta<typeof Trend> = {
|
|
|
18
18
|
control: 'boolean',
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
|
-
}
|
|
21
|
+
} satisfies Meta<typeof Trend>;
|
|
22
22
|
|
|
23
23
|
export default meta;
|
|
24
24
|
|
|
@@ -33,6 +33,9 @@ export const Base: Story = {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
export const VariantShowcase: Story = {
|
|
36
|
+
args: {
|
|
37
|
+
value: 5.25,
|
|
38
|
+
},
|
|
36
39
|
render: () => (
|
|
37
40
|
<Box lx={{ flexDirection: 'column', gap: 's8' }}>
|
|
38
41
|
<Trend value={5.25} />
|
|
@@ -43,6 +46,9 @@ export const VariantShowcase: Story = {
|
|
|
43
46
|
};
|
|
44
47
|
|
|
45
48
|
export const SizeShowcase: Story = {
|
|
49
|
+
args: {
|
|
50
|
+
value: 5.25,
|
|
51
|
+
},
|
|
46
52
|
render: () => (
|
|
47
53
|
<Box lx={{ flexDirection: 'row', alignItems: 'center', gap: 's16' }}>
|
|
48
54
|
<Trend value={5.25} size='md' />
|
|
@@ -52,6 +58,9 @@ export const SizeShowcase: Story = {
|
|
|
52
58
|
};
|
|
53
59
|
|
|
54
60
|
export const DisabledShowcase: Story = {
|
|
61
|
+
args: {
|
|
62
|
+
value: 5.25,
|
|
63
|
+
},
|
|
55
64
|
render: () => (
|
|
56
65
|
<Box lx={{ flexDirection: 'column', gap: 's8' }}>
|
|
57
66
|
<Trend value={5.25} disabled />
|
|
@@ -20,13 +20,13 @@ describe('Trend Component', () => {
|
|
|
20
20
|
expect(getByText('5.50%')).toBeTruthy();
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
it('should render negative value', () => {
|
|
23
|
+
it('should render negative value without a minus sign', () => {
|
|
24
24
|
const { getByText } = render(
|
|
25
25
|
<TestWrapper>
|
|
26
26
|
<Trend value={-3.2} />
|
|
27
27
|
</TestWrapper>,
|
|
28
28
|
);
|
|
29
|
-
expect(getByText('
|
|
29
|
+
expect(getByText('3.20%')).toBeTruthy();
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
it('should render neutral when value is zero', () => {
|
|
@@ -84,15 +84,14 @@ describe('Trend Component', () => {
|
|
|
84
84
|
});
|
|
85
85
|
|
|
86
86
|
it('should render all variants side by side', () => {
|
|
87
|
-
const { getByText } = render(
|
|
87
|
+
const { getByText, getAllByText } = render(
|
|
88
88
|
<TestWrapper>
|
|
89
89
|
<Trend value={10} />
|
|
90
90
|
<Trend value={-10} />
|
|
91
91
|
<Trend value={0} />
|
|
92
92
|
</TestWrapper>,
|
|
93
93
|
);
|
|
94
|
-
expect(
|
|
95
|
-
expect(getByText('-10.00%')).toBeTruthy();
|
|
94
|
+
expect(getAllByText('10.00%')).toHaveLength(2);
|
|
96
95
|
expect(getByText('0.00%')).toBeTruthy();
|
|
97
96
|
});
|
|
98
97
|
|
|
@@ -57,8 +57,6 @@ export function Trend({
|
|
|
57
57
|
const iconColor = iconColorMap[variant];
|
|
58
58
|
|
|
59
59
|
const absoluteFormattedValue = `${Math.abs(value).toFixed(2)}%`;
|
|
60
|
-
const formattedValue =
|
|
61
|
-
value < 0 ? `-${absoluteFormattedValue}` : absoluteFormattedValue;
|
|
62
60
|
|
|
63
61
|
return (
|
|
64
62
|
<Box
|
|
@@ -74,7 +72,7 @@ export function Trend({
|
|
|
74
72
|
{Icon && (
|
|
75
73
|
<Icon size={iconSize} color={disabled ? 'disabled' : iconColor} />
|
|
76
74
|
)}
|
|
77
|
-
<Text style={styles.text}>{
|
|
75
|
+
<Text style={styles.text}>{absoluteFormattedValue}</Text>
|
|
78
76
|
</Box>
|
|
79
77
|
);
|
|
80
78
|
}
|