@ledgerhq/lumen-ui-rnative 0.0.43 → 0.0.45
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/.storybook/Decorator.tsx +78 -13
- package/.storybook/docs/getting-started/ThemeProvider.mdx +1 -1
- package/.storybook/docs/style-system/lx.mdx +144 -0
- package/.storybook/docs/style-system/useCreate.mdx +95 -0
- package/.storybook/docs/style-system/useTheme.mdx +52 -0
- package/.storybook/preview-head.html +2 -2
- package/.storybook/{preview.ts → preview.tsx} +6 -1
- package/dist/package.json +2 -3
- package/dist/src/lib/Components/AddressInput/AddressInput.js +1 -1
- package/dist/src/lib/Components/AddressInput/AddressInput.stories.d.ts +7 -1
- package/dist/src/lib/Components/AddressInput/AddressInput.stories.d.ts.map +1 -1
- package/dist/src/lib/Components/AddressInput/AddressInput.stories.js +98 -9
- package/dist/src/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
- package/dist/src/lib/Components/AmountInput/AmountInput.js +3 -3
- package/dist/src/lib/Components/AmountInput/AmountInput.stories.d.ts +10 -1
- package/dist/src/lib/Components/AmountInput/AmountInput.stories.d.ts.map +1 -1
- package/dist/src/lib/Components/AmountInput/AmountInput.stories.js +162 -9
- package/dist/src/lib/Components/BaseInput/BaseInput.d.ts.map +1 -1
- package/dist/src/lib/Components/BaseInput/BaseInput.js +2 -19
- package/dist/src/lib/Components/BottomSheet/BottomSheet.js +1 -1
- package/dist/src/lib/Components/BottomSheet/BottomSheet.stories.js +8 -8
- package/dist/src/lib/Components/Button/BaseButton.d.ts +3 -3
- package/dist/src/lib/Components/Button/BaseButton.d.ts.map +1 -1
- package/dist/src/lib/Components/Button/BaseButton.js +99 -119
- package/dist/src/lib/Components/Button/Button.d.ts +4 -26
- package/dist/src/lib/Components/Button/Button.d.ts.map +1 -1
- package/dist/src/lib/Components/Button/Button.js +2 -2
- package/dist/src/lib/Components/Button/Button.stories.d.ts +1 -1
- package/dist/src/lib/Components/Button/Button.stories.d.ts.map +1 -1
- package/dist/src/lib/Components/Button/Button.stories.js +25 -48
- package/dist/src/lib/Components/Button/index.d.ts +1 -1
- package/dist/src/lib/Components/Button/index.d.ts.map +1 -1
- package/dist/src/lib/Components/Button/index.js +1 -1
- package/dist/src/lib/Components/Button/{BaseButton.types.d.ts → types.d.ts} +15 -10
- package/dist/src/lib/Components/Button/types.d.ts.map +1 -0
- package/dist/src/lib/Components/CardButton/CardButton.d.ts +4 -3
- package/dist/src/lib/Components/CardButton/CardButton.d.ts.map +1 -1
- package/dist/src/lib/Components/CardButton/CardButton.js +65 -71
- package/dist/src/lib/Components/CardButton/CardButton.stories.d.ts.map +1 -1
- package/dist/src/lib/Components/CardButton/CardButton.stories.js +28 -15
- package/dist/src/lib/Components/CardButton/index.d.ts +1 -1
- package/dist/src/lib/Components/CardButton/index.d.ts.map +1 -1
- package/dist/src/lib/Components/CardButton/index.js +1 -1
- package/dist/src/lib/Components/CardButton/{CardButton.types.d.ts → types.d.ts} +5 -4
- package/dist/src/lib/Components/CardButton/types.d.ts.map +1 -0
- package/dist/src/lib/Components/Icon/Icon.d.ts +6 -3
- package/dist/src/lib/Components/Icon/Icon.d.ts.map +1 -1
- package/dist/src/lib/Components/Icon/Icon.js +24 -25
- package/dist/src/lib/Components/Icon/Icon.stories.d.ts +2 -2
- package/dist/src/lib/Components/Icon/Icon.stories.d.ts.map +1 -1
- package/dist/src/lib/Components/Icon/Icon.stories.js +73 -19
- package/dist/src/lib/Components/Icon/createIcon.d.ts +1 -1
- package/dist/src/lib/Components/Icon/createIcon.d.ts.map +1 -1
- package/dist/src/lib/Components/Icon/createIcon.js +1 -2
- package/dist/src/lib/Components/Icon/index.d.ts +1 -1
- package/dist/src/lib/Components/Icon/index.d.ts.map +1 -1
- package/dist/src/lib/Components/Icon/index.js +1 -1
- package/dist/src/lib/Components/Icon/{Icon.types.d.ts → types.d.ts} +7 -4
- package/dist/src/lib/Components/Icon/types.d.ts.map +1 -0
- package/dist/src/lib/Components/IconButton/IconButton.d.ts +2 -19
- package/dist/src/lib/Components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/src/lib/Components/IconButton/IconButton.stories.d.ts.map +1 -1
- package/dist/src/lib/Components/IconButton/IconButton.stories.js +9 -11
- package/dist/src/lib/Components/IconButton/index.d.ts +1 -0
- package/dist/src/lib/Components/IconButton/index.d.ts.map +1 -1
- package/dist/src/lib/Components/IconButton/index.js +1 -0
- package/dist/src/lib/Components/IconButton/types.d.ts +12 -0
- package/dist/src/lib/Components/IconButton/types.d.ts.map +1 -0
- package/dist/src/lib/Components/InteractiveIcon/InteractiveIcon.d.ts +2 -2
- package/dist/src/lib/Components/InteractiveIcon/InteractiveIcon.d.ts.map +1 -1
- package/dist/src/lib/Components/InteractiveIcon/InteractiveIcon.figma.js +1 -1
- package/dist/src/lib/Components/InteractiveIcon/InteractiveIcon.js +34 -34
- package/dist/src/lib/Components/InteractiveIcon/InteractiveIcon.stories.d.ts +1 -1
- package/dist/src/lib/Components/InteractiveIcon/InteractiveIcon.stories.d.ts.map +1 -1
- package/dist/src/lib/Components/InteractiveIcon/InteractiveIcon.stories.js +22 -9
- package/dist/src/lib/Components/InteractiveIcon/types.d.ts +3 -7
- package/dist/src/lib/Components/InteractiveIcon/types.d.ts.map +1 -1
- package/dist/src/lib/Components/Link/Link.d.ts +7 -77
- package/dist/src/lib/Components/Link/Link.d.ts.map +1 -1
- package/dist/src/lib/Components/Link/Link.js +59 -75
- package/dist/src/lib/Components/Link/Link.stories.d.ts.map +1 -1
- package/dist/src/lib/Components/Link/Link.stories.js +34 -11
- package/dist/src/lib/Components/Link/index.d.ts +1 -0
- package/dist/src/lib/Components/Link/index.d.ts.map +1 -1
- package/dist/src/lib/Components/Link/index.js +1 -0
- package/dist/src/lib/Components/Link/types.d.ts +43 -0
- package/dist/src/lib/Components/Link/types.d.ts.map +1 -0
- package/dist/src/lib/Components/Link/types.js +1 -0
- package/dist/src/lib/Components/Search/Search.stories.d.ts +6 -1
- package/dist/src/lib/Components/Search/Search.stories.d.ts.map +1 -1
- package/dist/src/lib/Components/Search/Search.stories.js +71 -9
- package/dist/src/lib/Components/Select/Select.d.ts.map +1 -1
- package/dist/src/lib/Components/Select/Select.js +1 -17
- package/dist/src/lib/Components/Spinner/Spinner.d.ts +13 -16
- package/dist/src/lib/Components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/src/lib/Components/Spinner/Spinner.js +33 -5
- package/dist/src/lib/Components/Spinner/Spinner.stories.d.ts.map +1 -1
- package/dist/src/lib/Components/Spinner/Spinner.stories.js +1 -1
- package/dist/src/lib/Components/Spinner/index.d.ts +1 -0
- package/dist/src/lib/Components/Spinner/index.d.ts.map +1 -1
- package/dist/src/lib/Components/Spinner/index.js +1 -0
- package/dist/src/lib/Components/Spinner/types.d.ts +15 -0
- package/dist/src/lib/Components/Spinner/types.d.ts.map +1 -0
- package/dist/src/lib/Components/Spinner/types.js +1 -0
- package/dist/src/lib/Components/Tag/Tag.d.ts +2 -1
- package/dist/src/lib/Components/Tag/Tag.d.ts.map +1 -1
- package/dist/src/lib/Components/Tag/Tag.js +15 -4
- package/dist/src/lib/Components/Tag/Tag.stories.js +1 -1
- package/dist/src/lib/Components/Tag/Tag.types.d.ts +7 -1
- package/dist/src/lib/Components/Tag/Tag.types.d.ts.map +1 -1
- package/dist/src/lib/Components/TextInput/TextInput.stories.d.ts +8 -1
- package/dist/src/lib/Components/TextInput/TextInput.stories.d.ts.map +1 -1
- package/dist/src/lib/Components/TextInput/TextInput.stories.js +104 -9
- package/dist/src/lib/Components/Tile/Tile.d.ts.map +1 -1
- package/dist/src/lib/Components/Tile/Tile.js +54 -8
- package/dist/src/lib/Components/Tile/types.d.ts +14 -1
- package/dist/src/lib/Components/Tile/types.d.ts.map +1 -1
- package/dist/src/lib/Components/Tooltip/Tooltip.stories.js +2 -2
- package/dist/src/lib/Components/Utility/Box/Box.d.ts +39 -0
- package/dist/src/lib/Components/Utility/Box/Box.d.ts.map +1 -0
- package/dist/src/lib/Components/{Box → Utility/Box}/Box.js +10 -11
- package/dist/src/lib/Components/Utility/Box/Box.stories.d.ts.map +1 -0
- package/dist/src/lib/Components/{Box → Utility/Box}/Box.stories.js +13 -12
- package/dist/src/lib/Components/Utility/Box/index.d.ts +2 -0
- package/dist/src/lib/Components/Utility/Box/index.d.ts.map +1 -0
- package/dist/src/lib/Components/Utility/Pressable/Pressable.d.ts +34 -0
- package/dist/src/lib/Components/Utility/Pressable/Pressable.d.ts.map +1 -0
- package/dist/src/lib/Components/Utility/Pressable/Pressable.js +33 -0
- package/dist/src/lib/Components/Utility/Pressable/Pressable.stories.d.ts +7 -0
- package/dist/src/lib/Components/Utility/Pressable/Pressable.stories.d.ts.map +1 -0
- package/dist/src/lib/Components/Utility/Pressable/Pressable.stories.js +47 -0
- package/dist/src/lib/Components/Utility/Pressable/index.d.ts +3 -0
- package/dist/src/lib/Components/Utility/Pressable/index.d.ts.map +1 -0
- package/dist/src/lib/Components/Utility/Pressable/index.js +1 -0
- package/dist/src/lib/Components/Utility/Pressable/types.d.ts +3 -0
- package/dist/src/lib/Components/Utility/Pressable/types.d.ts.map +1 -0
- package/dist/src/lib/Components/Utility/Pressable/types.js +1 -0
- package/dist/src/lib/Components/Utility/Text/Text.d.ts +40 -0
- package/dist/src/lib/Components/Utility/Text/Text.d.ts.map +1 -0
- package/dist/src/lib/Components/{Text → Utility/Text}/Text.js +13 -9
- package/dist/src/lib/Components/Utility/Text/Text.stories.d.ts.map +1 -0
- package/dist/src/lib/Components/{Text → Utility/Text}/Text.stories.js +3 -3
- package/dist/src/lib/Components/Utility/Text/index.d.ts.map +1 -0
- package/dist/src/lib/Components/Utility/index.d.ts +4 -0
- package/dist/src/lib/Components/Utility/index.d.ts.map +1 -0
- package/dist/src/lib/Components/Utility/index.js +3 -0
- package/dist/src/lib/Components/index.d.ts +1 -3
- package/dist/src/lib/Components/index.d.ts.map +1 -1
- package/dist/src/lib/Components/index.js +1 -3
- package/dist/src/lib/utils/components/InjectStylesIntoChildren.d.ts +6 -5
- package/dist/src/lib/utils/components/InjectStylesIntoChildren.d.ts.map +1 -1
- package/dist/src/lib/utils/components/InjectStylesIntoChildren.js +6 -6
- package/dist/src/styles/LumenStyleSheet.d.ts +1 -1
- package/dist/src/styles/LumenStyleSheet.d.ts.map +1 -1
- package/dist/src/styles/Provider/createStylesheetTheme.d.ts +0 -1
- package/dist/src/styles/Provider/createStylesheetTheme.d.ts.map +1 -1
- package/dist/src/styles/Provider/createStylesheetTheme.js +0 -1
- package/dist/src/styles/create/useCreate.d.ts +2 -1
- package/dist/src/styles/create/useCreate.d.ts.map +1 -1
- package/dist/src/styles/create/useCreate.js +5 -5
- package/dist/src/styles/factories/areLxPropsEqual.d.ts +3 -0
- package/dist/src/styles/factories/areLxPropsEqual.d.ts.map +1 -0
- package/dist/src/styles/factories/areLxPropsEqual.js +15 -0
- package/dist/src/styles/factories/createStyledPressable.d.ts +26 -0
- package/dist/src/styles/factories/createStyledPressable.d.ts.map +1 -0
- package/dist/src/styles/factories/createStyledPressable.js +61 -0
- package/dist/src/styles/factories/createStyledText.d.ts +15 -26
- package/dist/src/styles/factories/createStyledText.d.ts.map +1 -1
- package/dist/src/styles/factories/createStyledText.js +13 -29
- package/dist/src/styles/factories/createStyledView.d.ts +7 -27
- package/dist/src/styles/factories/createStyledView.d.ts.map +1 -1
- package/dist/src/styles/factories/createStyledView.js +10 -30
- package/dist/src/styles/factories/index.d.ts +4 -0
- package/dist/src/styles/factories/index.d.ts.map +1 -0
- package/dist/src/styles/factories/index.js +3 -0
- package/dist/src/styles/index.d.ts +2 -3
- package/dist/src/styles/index.d.ts.map +1 -1
- package/dist/src/styles/index.js +2 -3
- package/dist/src/styles/resolveStyle/resolveConfig.d.ts +7 -7
- package/dist/src/styles/resolveStyle/resolveConfig.d.ts.map +1 -1
- package/dist/src/styles/resolveStyle/resolveConfig.js +9 -9
- package/dist/src/styles/resolveStyle/resolveStyle.d.ts +6 -20
- package/dist/src/styles/resolveStyle/resolveStyle.d.ts.map +1 -1
- package/dist/src/styles/resolveStyle/resolveStyle.js +4 -29
- package/dist/src/styles/types/create.types.d.ts +1 -1
- package/dist/src/styles/types/create.types.d.ts.map +1 -1
- package/dist/src/styles/types/styled.types.d.ts +72 -50
- package/dist/src/styles/types/styled.types.d.ts.map +1 -1
- package/dist/src/styles/types/utility.types.d.ts.map +1 -1
- package/dist/src/styles/utils/index.d.ts +2 -0
- package/dist/src/styles/utils/index.d.ts.map +1 -0
- package/dist/src/styles/utils/index.js +1 -0
- package/dist/src/styles/utils/mergeStyles.d.ts +16 -0
- package/dist/src/styles/utils/mergeStyles.d.ts.map +1 -0
- package/dist/src/styles/utils/mergeStyles.js +20 -0
- package/package.json +3 -4
- package/src/lib/Components/AddressInput/AddressInput.mdx +15 -4
- package/src/lib/Components/AddressInput/AddressInput.stories.tsx +133 -17
- package/src/lib/Components/AddressInput/AddressInput.tsx +1 -1
- package/src/lib/Components/AmountInput/AmountInput.mdx +20 -1
- package/src/lib/Components/AmountInput/AmountInput.stories.tsx +180 -17
- package/src/lib/Components/AmountInput/AmountInput.tsx +24 -15
- package/src/lib/Components/Banner/Banner.test.tsx +48 -15
- package/src/lib/Components/BaseInput/BaseInput.tsx +6 -35
- package/src/lib/Components/BottomSheet/BottomSheet.stories.tsx +8 -8
- package/src/lib/Components/BottomSheet/BottomSheet.tsx +1 -1
- package/src/lib/Components/Button/BaseButton.test.tsx +149 -0
- package/src/lib/Components/Button/BaseButton.tsx +193 -148
- package/src/lib/Components/Button/Button.mdx +34 -31
- package/src/lib/Components/Button/Button.stories.tsx +37 -58
- package/src/lib/Components/Button/Button.tsx +4 -11
- package/src/lib/Components/Button/index.ts +1 -1
- package/src/lib/Components/Button/{BaseButton.types.ts → types.ts} +14 -8
- package/src/lib/Components/CardButton/CardButton.mdx +15 -25
- package/src/lib/Components/CardButton/CardButton.stories.tsx +48 -22
- package/src/lib/Components/CardButton/CardButton.test.tsx +141 -0
- package/src/lib/Components/CardButton/CardButton.tsx +142 -108
- package/src/lib/Components/CardButton/index.ts +1 -1
- package/src/lib/Components/CardButton/{CardButton.types.ts → types.ts} +4 -3
- package/src/lib/Components/Checkbox/Checkbox.mdx +1 -1
- package/src/lib/Components/Checkbox/Checkbox.test.tsx +42 -17
- package/src/lib/Components/Icon/Icon.stories.tsx +143 -73
- package/src/lib/Components/Icon/Icon.test.tsx +84 -0
- package/src/lib/Components/Icon/Icon.tsx +32 -28
- package/src/lib/Components/Icon/createIcon.ts +2 -3
- package/src/lib/Components/Icon/index.ts +1 -1
- package/src/lib/Components/Icon/{Icon.types.ts → types.ts} +4 -3
- package/src/lib/Components/IconButton/IconButton.mdx +13 -10
- package/src/lib/Components/IconButton/IconButton.stories.tsx +12 -14
- package/src/lib/Components/IconButton/IconButton.test.tsx +141 -0
- package/src/lib/Components/IconButton/IconButton.tsx +3 -13
- package/src/lib/Components/IconButton/index.ts +1 -0
- package/src/lib/Components/IconButton/types.ts +12 -0
- package/src/lib/Components/InteractiveIcon/InteractiveIcon.figma.tsx +1 -1
- package/src/lib/Components/InteractiveIcon/InteractiveIcon.mdx +25 -27
- package/src/lib/Components/InteractiveIcon/InteractiveIcon.stories.tsx +82 -43
- package/src/lib/Components/InteractiveIcon/InteractiveIcon.test.tsx +30 -19
- package/src/lib/Components/InteractiveIcon/InteractiveIcon.tsx +78 -45
- package/src/lib/Components/InteractiveIcon/types.ts +4 -7
- package/src/lib/Components/Link/Link.mdx +8 -18
- package/src/lib/Components/Link/Link.stories.tsx +56 -25
- package/src/lib/Components/Link/Link.test.tsx +141 -51
- package/src/lib/Components/Link/Link.tsx +128 -150
- package/src/lib/Components/Link/index.ts +1 -0
- package/src/lib/Components/Link/types.ts +44 -0
- package/src/lib/Components/Search/Search.mdx +14 -1
- package/src/lib/Components/Search/Search.stories.tsx +94 -15
- package/src/lib/Components/Select/Select.test.tsx +8 -4
- package/src/lib/Components/Select/Select.tsx +4 -31
- package/src/lib/Components/Spinner/Spinner.stories.tsx +1 -5
- package/src/lib/Components/Spinner/Spinner.tsx +60 -34
- package/src/lib/Components/Spinner/index.ts +1 -0
- package/src/lib/Components/Spinner/types.ts +15 -0
- package/src/lib/Components/Switch/Switch.mdx +1 -1
- package/src/lib/Components/Tag/Tag.stories.tsx +2 -2
- package/src/lib/Components/Tag/Tag.tsx +22 -6
- package/src/lib/Components/Tag/Tag.types.ts +7 -8
- package/src/lib/Components/TextInput/TextInput.mdx +24 -4
- package/src/lib/Components/TextInput/TextInput.stories.tsx +131 -15
- package/src/lib/Components/Tile/Tile.test.tsx +100 -63
- package/src/lib/Components/Tile/Tile.tsx +64 -13
- package/src/lib/Components/Tile/types.ts +14 -1
- package/src/lib/Components/Tooltip/Tooltip.stories.tsx +2 -2
- package/src/lib/Components/Tooltip/Tooltip.test.tsx +8 -4
- package/src/lib/Components/{Box → Utility/Box}/Box.mdx +15 -13
- package/src/lib/Components/{Box → Utility/Box}/Box.stories.tsx +13 -11
- package/src/lib/Components/{Box → Utility/Box}/Box.tsx +11 -12
- package/src/lib/Components/Utility/Box/index.ts +1 -0
- package/src/lib/Components/Utility/Pressable/Pressable.mdx +103 -0
- package/src/lib/Components/Utility/Pressable/Pressable.stories.tsx +51 -0
- package/src/lib/Components/Utility/Pressable/Pressable.test.tsx +221 -0
- package/src/lib/Components/Utility/Pressable/Pressable.tsx +34 -0
- package/src/lib/Components/Utility/Pressable/index.ts +2 -0
- package/src/lib/Components/Utility/Pressable/types.ts +3 -0
- package/src/lib/Components/{Text → Utility/Text}/Text.mdx +15 -7
- package/src/lib/Components/{Text → Utility/Text}/Text.stories.tsx +3 -3
- package/src/lib/Components/Utility/Text/Text.tsx +39 -0
- package/src/lib/Components/Utility/index.ts +3 -0
- package/src/lib/Components/index.ts +1 -3
- package/src/lib/utils/components/InjectStylesIntoChildren.tsx +23 -14
- package/src/styles/Provider/createStylesheetTheme.ts +0 -1
- package/src/styles/create/useCreate.ts +8 -4
- package/src/styles/factories/areLxPropsEqual.ts +32 -0
- package/src/styles/factories/createStyledPressable.test.tsx +253 -0
- package/src/styles/factories/createStyledPressable.tsx +97 -0
- package/src/styles/factories/createStyledText.test.tsx +28 -20
- package/src/styles/factories/createStyledText.tsx +29 -49
- package/src/styles/factories/createStyledView.test.tsx +22 -16
- package/src/styles/factories/createStyledView.tsx +19 -53
- package/src/styles/factories/index.ts +3 -0
- package/src/styles/index.ts +2 -3
- package/src/styles/resolveStyle/resolveConfig.ts +16 -15
- package/src/styles/resolveStyle/resolveStyle.test.ts +13 -141
- package/src/styles/resolveStyle/resolveStyle.ts +10 -60
- package/src/styles/types/create.types.ts +1 -1
- package/src/styles/types/styled.types.ts +73 -105
- package/src/styles/types/utility.types.ts +1 -0
- package/src/styles/utils/index.ts +1 -0
- package/src/styles/utils/mergeStyles.test.ts +45 -0
- package/src/styles/utils/mergeStyles.ts +25 -0
- package/.storybook/docs/getting-started/StyleSystem.mdx +0 -133
- package/dist/src/lib/Components/Box/Box.d.ts +0 -592
- package/dist/src/lib/Components/Box/Box.d.ts.map +0 -1
- package/dist/src/lib/Components/Box/Box.stories.d.ts.map +0 -1
- package/dist/src/lib/Components/Box/Box.types.d.ts +0 -3
- package/dist/src/lib/Components/Box/Box.types.d.ts.map +0 -1
- package/dist/src/lib/Components/Box/index.d.ts +0 -3
- package/dist/src/lib/Components/Box/index.d.ts.map +0 -1
- package/dist/src/lib/Components/Button/BaseButton.types.d.ts.map +0 -1
- package/dist/src/lib/Components/CardButton/CardButton.types.d.ts.map +0 -1
- package/dist/src/lib/Components/Icon/Icon.types.d.ts.map +0 -1
- package/dist/src/lib/Components/Text/Text.d.ts +0 -602
- package/dist/src/lib/Components/Text/Text.d.ts.map +0 -1
- package/dist/src/lib/Components/Text/Text.stories.d.ts.map +0 -1
- package/dist/src/lib/Components/Text/index.d.ts.map +0 -1
- package/dist/src/lib/Components/_ToRemove/ToRemove.d.ts +0 -9
- package/dist/src/lib/Components/_ToRemove/ToRemove.d.ts.map +0 -1
- package/dist/src/lib/Components/_ToRemove/ToRemove.js +0 -43
- package/dist/src/styles/utils/styleVarianceAuthority.d.ts +0 -30
- package/dist/src/styles/utils/styleVarianceAuthority.d.ts.map +0 -1
- package/dist/src/styles/utils/styleVarianceAuthority.js +0 -97
- package/src/lib/Components/Box/Box.types.ts +0 -3
- package/src/lib/Components/Box/index.ts +0 -2
- package/src/lib/Components/Text/Text.tsx +0 -35
- package/src/lib/Components/_ToRemove/ToRemove.tsx +0 -65
- package/src/styles/utils/styleVarianceAuthority.test.ts +0 -302
- package/src/styles/utils/styleVarianceAuthority.ts +0 -154
- /package/dist/src/lib/Components/{Box/Box.types.js → Button/types.js} +0 -0
- /package/dist/src/lib/Components/{Button/BaseButton.types.js → CardButton/types.js} +0 -0
- /package/dist/src/lib/Components/{CardButton/CardButton.types.js → Icon/types.js} +0 -0
- /package/dist/src/lib/Components/{Icon/Icon.types.js → IconButton/types.js} +0 -0
- /package/dist/src/lib/Components/{Box → Utility/Box}/Box.stories.d.ts +0 -0
- /package/dist/src/lib/Components/{Box → Utility/Box}/index.js +0 -0
- /package/dist/src/lib/Components/{Text → Utility/Text}/Text.stories.d.ts +0 -0
- /package/dist/src/lib/Components/{Text → Utility/Text}/index.d.ts +0 -0
- /package/dist/src/lib/Components/{Text → Utility/Text}/index.js +0 -0
- /package/src/lib/Components/{Text → Utility/Text}/index.ts +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { TextInput, type TextInputProps } from './TextInput';
|
|
4
5
|
|
|
5
6
|
const meta: Meta<typeof TextInput> = {
|
|
6
7
|
component: TextInput,
|
|
@@ -14,25 +15,140 @@ const meta: Meta<typeof TextInput> = {
|
|
|
14
15
|
},
|
|
15
16
|
},
|
|
16
17
|
},
|
|
18
|
+
argTypes: {
|
|
19
|
+
label: {
|
|
20
|
+
control: 'text',
|
|
21
|
+
description: 'Floating label text',
|
|
22
|
+
},
|
|
23
|
+
placeholder: {
|
|
24
|
+
control: 'text',
|
|
25
|
+
description: 'Placeholder text when input is empty',
|
|
26
|
+
},
|
|
27
|
+
errorMessage: {
|
|
28
|
+
control: 'text',
|
|
29
|
+
description: 'Error message to display below input',
|
|
30
|
+
},
|
|
31
|
+
editable: {
|
|
32
|
+
control: 'boolean',
|
|
33
|
+
description: 'Whether the input is editable',
|
|
34
|
+
},
|
|
35
|
+
hideClearButton: {
|
|
36
|
+
control: 'boolean',
|
|
37
|
+
description: 'Hide the clear button',
|
|
38
|
+
},
|
|
39
|
+
keyboardType: {
|
|
40
|
+
control: 'select',
|
|
41
|
+
options: ['default', 'email-address', 'numeric', 'phone-pad', 'url'],
|
|
42
|
+
description: 'Keyboard type for input',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
17
45
|
};
|
|
18
46
|
|
|
19
47
|
export default meta;
|
|
20
48
|
type Story = StoryObj<typeof TextInput>;
|
|
21
49
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
50
|
+
const TextInputStory = (args: TextInputProps & { initialValue?: string }) => {
|
|
51
|
+
const [value, setValue] = useState(args.initialValue ?? '');
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<View className='flex min-h-400 items-center justify-center p-24'>
|
|
55
|
+
<View className='w-full max-w-320'>
|
|
56
|
+
<TextInput
|
|
57
|
+
{...args}
|
|
58
|
+
value={value}
|
|
59
|
+
onChangeText={setValue}
|
|
60
|
+
onClear={args.onClear}
|
|
61
|
+
/>
|
|
62
|
+
</View>
|
|
63
|
+
</View>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const Base: Story = {
|
|
68
|
+
render: (args) => <TextInputStory {...args} />,
|
|
69
|
+
args: {
|
|
70
|
+
label: 'Username',
|
|
71
|
+
editable: true,
|
|
72
|
+
hideClearButton: false,
|
|
73
|
+
keyboardType: 'default',
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const WithContent: Story = {
|
|
78
|
+
render: (args) => <TextInputStory {...args} initialValue='johndoe' />,
|
|
79
|
+
args: {
|
|
80
|
+
label: 'Username',
|
|
81
|
+
editable: true,
|
|
82
|
+
hideClearButton: false,
|
|
83
|
+
keyboardType: 'default',
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const WithError: Story = {
|
|
88
|
+
render: (args) => <TextInputStory {...args} initialValue='ab' />,
|
|
89
|
+
args: {
|
|
90
|
+
label: 'Username',
|
|
91
|
+
errorMessage: 'Username must be at least 3 characters',
|
|
92
|
+
editable: true,
|
|
93
|
+
hideClearButton: false,
|
|
94
|
+
keyboardType: 'default',
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const DisabledTextInput: Story = {
|
|
99
|
+
render: (args) => <TextInputStory {...args} initialValue='johndoe' />,
|
|
100
|
+
args: {
|
|
101
|
+
label: 'Username',
|
|
102
|
+
editable: false,
|
|
103
|
+
hideClearButton: false,
|
|
104
|
+
keyboardType: 'default',
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export const WithHiddenClearButton: Story = {
|
|
109
|
+
render: (args) => (
|
|
110
|
+
<TextInputStory {...args} initialValue='Content with hidden clear' />
|
|
111
|
+
),
|
|
112
|
+
args: {
|
|
113
|
+
label: 'Label',
|
|
114
|
+
editable: true,
|
|
115
|
+
hideClearButton: true,
|
|
116
|
+
keyboardType: 'default',
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export const WithClearCallback: Story = {
|
|
121
|
+
render: (args) => (
|
|
122
|
+
<TextInputStory
|
|
123
|
+
{...args}
|
|
124
|
+
initialValue='Click clear to see callback'
|
|
125
|
+
onClear={() => alert('Input cleared!')}
|
|
28
126
|
/>
|
|
29
127
|
),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
128
|
+
args: {
|
|
129
|
+
label: 'Label',
|
|
130
|
+
editable: true,
|
|
131
|
+
hideClearButton: false,
|
|
132
|
+
keyboardType: 'default',
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const EmailKeyboard: Story = {
|
|
137
|
+
render: (args) => <TextInputStory {...args} />,
|
|
138
|
+
args: {
|
|
139
|
+
label: 'Email',
|
|
140
|
+
editable: true,
|
|
141
|
+
hideClearButton: false,
|
|
142
|
+
keyboardType: 'email-address',
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export const PhoneKeyboard: Story = {
|
|
147
|
+
render: (args) => <TextInputStory {...args} />,
|
|
148
|
+
args: {
|
|
149
|
+
label: 'Phone Number',
|
|
150
|
+
editable: true,
|
|
151
|
+
hideClearButton: false,
|
|
152
|
+
keyboardType: 'phone-pad',
|
|
37
153
|
},
|
|
38
154
|
};
|
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
import { describe, it, expect, jest } from '@jest/globals';
|
|
2
|
+
import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
|
|
2
3
|
import { render, fireEvent } from '@testing-library/react-native';
|
|
4
|
+
import React from 'react';
|
|
3
5
|
import { Text } from 'react-native';
|
|
4
6
|
|
|
5
7
|
import { Settings } from '../../Symbols';
|
|
6
8
|
import { Spot } from '../Spot';
|
|
7
9
|
import { Tag } from '../Tag';
|
|
10
|
+
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
8
11
|
import { Tile } from './Tile';
|
|
9
12
|
|
|
13
|
+
const TestWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => (
|
|
14
|
+
<ThemeProvider themes={ledgerLiveThemes} colorScheme='dark' locale='en'>
|
|
15
|
+
{children}
|
|
16
|
+
</ThemeProvider>
|
|
17
|
+
);
|
|
18
|
+
|
|
10
19
|
describe('Tile Component', () => {
|
|
11
20
|
const mockSpot = <Spot appearance='icon' icon={Settings} />;
|
|
12
21
|
const mockTitle = 'Test Item';
|
|
13
22
|
|
|
14
23
|
it('should render correctly with required props', () => {
|
|
15
24
|
const { getByText, getByTestId } = render(
|
|
16
|
-
<
|
|
25
|
+
<TestWrapper>
|
|
26
|
+
<Tile leadingContent={mockSpot} title={mockTitle} testID='tile' />
|
|
27
|
+
</TestWrapper>,
|
|
17
28
|
);
|
|
18
29
|
|
|
19
30
|
expect(getByTestId('tile')).toBeTruthy();
|
|
@@ -23,12 +34,14 @@ describe('Tile Component', () => {
|
|
|
23
34
|
it('should render description when provided', () => {
|
|
24
35
|
const description = 'Test description';
|
|
25
36
|
const { getByText } = render(
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
37
|
+
<TestWrapper>
|
|
38
|
+
<Tile
|
|
39
|
+
leadingContent={mockSpot}
|
|
40
|
+
title={mockTitle}
|
|
41
|
+
description={description}
|
|
42
|
+
testID='tile'
|
|
43
|
+
/>
|
|
44
|
+
</TestWrapper>,
|
|
32
45
|
);
|
|
33
46
|
|
|
34
47
|
expect(getByText(mockTitle)).toBeTruthy();
|
|
@@ -37,7 +50,9 @@ describe('Tile Component', () => {
|
|
|
37
50
|
|
|
38
51
|
it('should render without description when not provided', () => {
|
|
39
52
|
const { getByText, queryByText } = render(
|
|
40
|
-
<
|
|
53
|
+
<TestWrapper>
|
|
54
|
+
<Tile leadingContent={mockSpot} title={mockTitle} testID='tile' />
|
|
55
|
+
</TestWrapper>,
|
|
41
56
|
);
|
|
42
57
|
|
|
43
58
|
expect(getByText(mockTitle)).toBeTruthy();
|
|
@@ -49,12 +64,14 @@ describe('Tile Component', () => {
|
|
|
49
64
|
const tagText = 'Test Tag';
|
|
50
65
|
const mockTag = <Tag label={tagText} />;
|
|
51
66
|
const { getByText } = render(
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
67
|
+
<TestWrapper>
|
|
68
|
+
<Tile
|
|
69
|
+
leadingContent={mockSpot}
|
|
70
|
+
title={mockTitle}
|
|
71
|
+
trailingContent={mockTag}
|
|
72
|
+
testID='tile'
|
|
73
|
+
/>
|
|
74
|
+
</TestWrapper>,
|
|
58
75
|
);
|
|
59
76
|
|
|
60
77
|
expect(getByText(mockTitle)).toBeTruthy();
|
|
@@ -65,12 +82,14 @@ describe('Tile Component', () => {
|
|
|
65
82
|
const trailingText = 'Custom Trailing';
|
|
66
83
|
const mockTrailing = <Text testID='custom-trailing'>{trailingText}</Text>;
|
|
67
84
|
const { getByTestId } = render(
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
85
|
+
<TestWrapper>
|
|
86
|
+
<Tile
|
|
87
|
+
leadingContent={mockSpot}
|
|
88
|
+
title={mockTitle}
|
|
89
|
+
trailingContent={mockTrailing}
|
|
90
|
+
testID='tile'
|
|
91
|
+
/>
|
|
92
|
+
</TestWrapper>,
|
|
74
93
|
);
|
|
75
94
|
|
|
76
95
|
expect(getByTestId('custom-trailing')).toBeTruthy();
|
|
@@ -79,12 +98,14 @@ describe('Tile Component', () => {
|
|
|
79
98
|
it('should call onPress handler when pressed', () => {
|
|
80
99
|
const handlePress = jest.fn();
|
|
81
100
|
const { getByTestId } = render(
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
101
|
+
<TestWrapper>
|
|
102
|
+
<Tile
|
|
103
|
+
leadingContent={mockSpot}
|
|
104
|
+
title={mockTitle}
|
|
105
|
+
onPress={handlePress}
|
|
106
|
+
testID='tile'
|
|
107
|
+
/>
|
|
108
|
+
</TestWrapper>,
|
|
88
109
|
);
|
|
89
110
|
|
|
90
111
|
fireEvent.press(getByTestId('tile'));
|
|
@@ -94,7 +115,9 @@ describe('Tile Component', () => {
|
|
|
94
115
|
|
|
95
116
|
it('should not call onPress when not provided', () => {
|
|
96
117
|
const { getByTestId } = render(
|
|
97
|
-
<
|
|
118
|
+
<TestWrapper>
|
|
119
|
+
<Tile leadingContent={mockSpot} title={mockTitle} testID='tile' />
|
|
120
|
+
</TestWrapper>,
|
|
98
121
|
);
|
|
99
122
|
|
|
100
123
|
// Should not throw error when pressing without onPress handler
|
|
@@ -106,12 +129,14 @@ describe('Tile Component', () => {
|
|
|
106
129
|
it('should call onLongPress handler when long pressed', () => {
|
|
107
130
|
const handleLongPress = jest.fn();
|
|
108
131
|
const { getByTestId } = render(
|
|
109
|
-
<
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
132
|
+
<TestWrapper>
|
|
133
|
+
<Tile
|
|
134
|
+
leadingContent={mockSpot}
|
|
135
|
+
title={mockTitle}
|
|
136
|
+
onLongPress={handleLongPress}
|
|
137
|
+
testID='tile'
|
|
138
|
+
/>
|
|
139
|
+
</TestWrapper>,
|
|
115
140
|
);
|
|
116
141
|
|
|
117
142
|
fireEvent(getByTestId('tile'), 'onLongPress');
|
|
@@ -123,13 +148,15 @@ describe('Tile Component', () => {
|
|
|
123
148
|
const handlePress = jest.fn();
|
|
124
149
|
const handleLongPress = jest.fn();
|
|
125
150
|
const { getByTestId } = render(
|
|
126
|
-
<
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
151
|
+
<TestWrapper>
|
|
152
|
+
<Tile
|
|
153
|
+
leadingContent={mockSpot}
|
|
154
|
+
title={mockTitle}
|
|
155
|
+
onPress={handlePress}
|
|
156
|
+
onLongPress={handleLongPress}
|
|
157
|
+
testID='tile'
|
|
158
|
+
/>
|
|
159
|
+
</TestWrapper>,
|
|
133
160
|
);
|
|
134
161
|
|
|
135
162
|
fireEvent.press(getByTestId('tile'));
|
|
@@ -144,7 +171,9 @@ describe('Tile Component', () => {
|
|
|
144
171
|
it('should forward testID prop to Pressable', () => {
|
|
145
172
|
const testId = 'custom-tile-id';
|
|
146
173
|
const { getByTestId } = render(
|
|
147
|
-
<
|
|
174
|
+
<TestWrapper>
|
|
175
|
+
<Tile leadingContent={mockSpot} title={mockTitle} testID={testId} />
|
|
176
|
+
</TestWrapper>,
|
|
148
177
|
);
|
|
149
178
|
|
|
150
179
|
expect(getByTestId(testId)).toBeTruthy();
|
|
@@ -152,12 +181,14 @@ describe('Tile Component', () => {
|
|
|
152
181
|
|
|
153
182
|
it('should forward additional Pressable props', () => {
|
|
154
183
|
const { getByTestId } = render(
|
|
155
|
-
<
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
184
|
+
<TestWrapper>
|
|
185
|
+
<Tile
|
|
186
|
+
leadingContent={mockSpot}
|
|
187
|
+
title={mockTitle}
|
|
188
|
+
testID='tile'
|
|
189
|
+
disabled={true}
|
|
190
|
+
/>
|
|
191
|
+
</TestWrapper>,
|
|
161
192
|
);
|
|
162
193
|
|
|
163
194
|
const pressable = getByTestId('tile');
|
|
@@ -167,12 +198,14 @@ describe('Tile Component', () => {
|
|
|
167
198
|
it('should support custom accessibility label', () => {
|
|
168
199
|
const customLabel = 'Custom accessibility label';
|
|
169
200
|
const { getByTestId } = render(
|
|
170
|
-
<
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
201
|
+
<TestWrapper>
|
|
202
|
+
<Tile
|
|
203
|
+
leadingContent={mockSpot}
|
|
204
|
+
title={mockTitle}
|
|
205
|
+
testID='tile'
|
|
206
|
+
accessibilityLabel={customLabel}
|
|
207
|
+
/>
|
|
208
|
+
</TestWrapper>,
|
|
176
209
|
);
|
|
177
210
|
|
|
178
211
|
const pressable = getByTestId('tile');
|
|
@@ -184,7 +217,9 @@ describe('Tile Component', () => {
|
|
|
184
217
|
<Text testID='custom-leading'>Custom Leading Content</Text>
|
|
185
218
|
);
|
|
186
219
|
const { getByTestId } = render(
|
|
187
|
-
<
|
|
220
|
+
<TestWrapper>
|
|
221
|
+
<Tile leadingContent={customLeading} title={mockTitle} testID='tile' />
|
|
222
|
+
</TestWrapper>,
|
|
188
223
|
);
|
|
189
224
|
|
|
190
225
|
expect(getByTestId('custom-leading')).toBeTruthy();
|
|
@@ -196,15 +231,17 @@ describe('Tile Component', () => {
|
|
|
196
231
|
const mockTag = <Tag label={tagText} />;
|
|
197
232
|
|
|
198
233
|
const { getByText, getByTestId } = render(
|
|
199
|
-
<
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
234
|
+
<TestWrapper>
|
|
235
|
+
<Tile
|
|
236
|
+
leadingContent={mockSpot}
|
|
237
|
+
title={mockTitle}
|
|
238
|
+
description={description}
|
|
239
|
+
trailingContent={mockTag}
|
|
240
|
+
onPress={jest.fn()}
|
|
241
|
+
onLongPress={jest.fn()}
|
|
242
|
+
testID='tile'
|
|
243
|
+
/>
|
|
244
|
+
</TestWrapper>,
|
|
208
245
|
);
|
|
209
246
|
|
|
210
247
|
expect(getByTestId('tile')).toBeTruthy();
|
|
@@ -6,19 +6,65 @@ import { TileProps } from './types';
|
|
|
6
6
|
|
|
7
7
|
const tileVariants = {
|
|
8
8
|
root: cva(
|
|
9
|
-
[
|
|
10
|
-
'relative flex w-full items-center gap-8 p-8',
|
|
11
|
-
'rounded-sm bg-base-transparent text-base transition-colors',
|
|
12
|
-
],
|
|
9
|
+
['relative flex w-full items-center gap-8 p-8', 'rounded-sm text-base'],
|
|
13
10
|
{
|
|
14
11
|
variants: {
|
|
12
|
+
appearance: {
|
|
13
|
+
'no-background': 'bg-base-transparent',
|
|
14
|
+
card: 'bg-surface',
|
|
15
|
+
},
|
|
15
16
|
pressed: {
|
|
16
|
-
true: '
|
|
17
|
-
false: '
|
|
17
|
+
true: '',
|
|
18
|
+
false: '',
|
|
19
|
+
},
|
|
20
|
+
disabled: {
|
|
21
|
+
true: '',
|
|
22
|
+
false: '',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
compoundVariants: [
|
|
26
|
+
{
|
|
27
|
+
appearance: 'no-background',
|
|
28
|
+
pressed: true,
|
|
29
|
+
disabled: false,
|
|
30
|
+
className: 'bg-base-transparent-pressed',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
appearance: 'card',
|
|
34
|
+
pressed: true,
|
|
35
|
+
disabled: false,
|
|
36
|
+
className: 'bg-surface-pressed',
|
|
18
37
|
},
|
|
38
|
+
],
|
|
39
|
+
defaultVariants: {
|
|
40
|
+
appearance: 'no-background',
|
|
41
|
+
pressed: false,
|
|
42
|
+
disabled: false,
|
|
19
43
|
},
|
|
20
44
|
},
|
|
21
45
|
),
|
|
46
|
+
title: cva('w-full truncate text-center body-3-semi-bold', {
|
|
47
|
+
variants: {
|
|
48
|
+
disabled: {
|
|
49
|
+
true: 'text-disabled',
|
|
50
|
+
false: 'text-base',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
defaultVariants: {
|
|
54
|
+
disabled: false,
|
|
55
|
+
},
|
|
56
|
+
}),
|
|
57
|
+
description: cva('w-full overflow-hidden truncate text-center body-3', {
|
|
58
|
+
variants: {
|
|
59
|
+
disabled: {
|
|
60
|
+
true: 'text-disabled',
|
|
61
|
+
false: 'text-muted',
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
defaultVariants: {
|
|
65
|
+
disabled: false,
|
|
66
|
+
},
|
|
67
|
+
}),
|
|
22
68
|
};
|
|
23
69
|
|
|
24
70
|
/**
|
|
@@ -49,6 +95,8 @@ export const Tile: FC<TileProps> = forwardRef<PressableRef, TileProps>(
|
|
|
49
95
|
description,
|
|
50
96
|
leadingContent,
|
|
51
97
|
trailingContent,
|
|
98
|
+
appearance = 'no-background',
|
|
99
|
+
disabled = false,
|
|
52
100
|
onPress,
|
|
53
101
|
onLongPress,
|
|
54
102
|
...props
|
|
@@ -60,26 +108,29 @@ export const Tile: FC<TileProps> = forwardRef<PressableRef, TileProps>(
|
|
|
60
108
|
ref={ref}
|
|
61
109
|
onPress={onPress}
|
|
62
110
|
onLongPress={onLongPress}
|
|
111
|
+
disabled={disabled}
|
|
63
112
|
{...props}
|
|
64
113
|
>
|
|
65
114
|
{({ pressed }) => (
|
|
66
|
-
<View
|
|
67
|
-
|
|
68
|
-
|
|
115
|
+
<View
|
|
116
|
+
className={tileVariants.root({ appearance, pressed, disabled })}
|
|
117
|
+
>
|
|
118
|
+
<View className='w-full items-center gap-8'>
|
|
119
|
+
<View className='items-center justify-center'>
|
|
69
120
|
{leadingContent}
|
|
70
121
|
</View>
|
|
71
|
-
<View className='
|
|
72
|
-
<View className='
|
|
122
|
+
<View className='w-full items-center gap-4'>
|
|
123
|
+
<View className='w-full items-center'>
|
|
73
124
|
<Text
|
|
74
125
|
numberOfLines={1}
|
|
75
|
-
className=
|
|
126
|
+
className={tileVariants.title({ disabled })}
|
|
76
127
|
>
|
|
77
128
|
{title}
|
|
78
129
|
</Text>
|
|
79
130
|
{description && (
|
|
80
131
|
<Text
|
|
81
132
|
numberOfLines={1}
|
|
82
|
-
className=
|
|
133
|
+
className={tileVariants.description({ disabled })}
|
|
83
134
|
>
|
|
84
135
|
{description}
|
|
85
136
|
</Text>
|
|
@@ -20,6 +20,19 @@ export type TileProps = {
|
|
|
20
20
|
* Accepts ReactNode such as <Tag label="New" appearance="base" />
|
|
21
21
|
*/
|
|
22
22
|
trailingContent?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* The visual style of the tile.
|
|
25
|
+
* - `no-background`: Transparent background with pressed state
|
|
26
|
+
* - `card`: Surface background with pressed state
|
|
27
|
+
* @default 'no-background'
|
|
28
|
+
*/
|
|
29
|
+
appearance?: 'no-background' | 'card';
|
|
30
|
+
/**
|
|
31
|
+
* Whether the tile is disabled.
|
|
32
|
+
* When disabled, the tile will not respond to press events and will appear dimmed.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
disabled?: boolean;
|
|
23
36
|
/**
|
|
24
37
|
* Callback function when the tile is pressed.
|
|
25
38
|
*/
|
|
@@ -29,4 +42,4 @@ export type TileProps = {
|
|
|
29
42
|
* Can be used to perform secondary actions.
|
|
30
43
|
*/
|
|
31
44
|
onLongPress?: PressableProps['onLongPress'];
|
|
32
|
-
} & Omit<PressableProps, 'onPress' | 'onLongPress'>;
|
|
45
|
+
} & Omit<PressableProps, 'onPress' | 'onLongPress' | 'disabled'>;
|
|
@@ -53,7 +53,7 @@ export const WithCustomContent: Story = {
|
|
|
53
53
|
Ut enim ad minim veniam, quis nostrud exercitation ullamco
|
|
54
54
|
laboris nisi ut aliquip ex ea commodo consequat.
|
|
55
55
|
</Text>
|
|
56
|
-
<Button size='
|
|
56
|
+
<Button size='sm' appearance='accent'>
|
|
57
57
|
Custom tooltip action
|
|
58
58
|
</Button>
|
|
59
59
|
</View>
|
|
@@ -92,7 +92,7 @@ export const WithMultipleTooltips: Story = {
|
|
|
92
92
|
|
|
93
93
|
<Tooltip>
|
|
94
94
|
<TooltipTrigger asChild>
|
|
95
|
-
<InteractiveIcon iconType='filled'
|
|
95
|
+
<InteractiveIcon iconType='filled' accessibilityLabel='Info'>
|
|
96
96
|
<Information />
|
|
97
97
|
</InteractiveIcon>
|
|
98
98
|
</TooltipTrigger>
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { describe, it, expect, jest } from '@jest/globals';
|
|
2
|
+
import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
|
|
2
3
|
import { render, fireEvent } from '@testing-library/react-native';
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import { Text, View } from 'react-native';
|
|
6
|
+
import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
|
|
5
7
|
import { GlobalTooltipBottomSheet } from './GlobalTooltipBottomSheet';
|
|
6
8
|
import { GlobalTooltipProvider } from './GlobalTooltipContext';
|
|
7
9
|
import { Tooltip, TooltipTrigger, TooltipContent } from './Tooltip';
|
|
8
10
|
|
|
9
11
|
const TestWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => (
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
<ThemeProvider themes={ledgerLiveThemes} colorScheme='dark' locale='en'>
|
|
13
|
+
<GlobalTooltipProvider>
|
|
14
|
+
{children}
|
|
15
|
+
<GlobalTooltipBottomSheet />
|
|
16
|
+
</GlobalTooltipProvider>
|
|
17
|
+
</ThemeProvider>
|
|
14
18
|
);
|
|
15
19
|
|
|
16
20
|
describe('Tooltip', () => {
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks';
|
|
2
2
|
import * as BoxStories from './Box.stories';
|
|
3
|
+
import { CustomTabs, Tab } from '../../../../../.storybook/components';
|
|
3
4
|
|
|
4
5
|
<Meta title='Utility/Box' of={BoxStories} />
|
|
5
6
|
|
|
6
7
|
# Box
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
<CustomTabs>
|
|
10
|
+
<Tab label="Overview ">
|
|
11
|
+
Box is a utility primitive that wraps React Native's `View` component with token-constrained style props from the design system theme.
|
|
12
|
+
|
|
13
|
+
Box exposes the `lx` property to consume tokens from the `ledgerLiveTheme`, see [lx documentation](/?path=/docs/style-system-lx--docs).
|
|
9
14
|
|
|
10
15
|
## Interactive Example
|
|
11
16
|
|
|
@@ -20,10 +25,12 @@ import { Box, Text } from '@ledgerhq/lumen-ui-rnative';
|
|
|
20
25
|
function Card() {
|
|
21
26
|
return (
|
|
22
27
|
<Box
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
lx={{
|
|
29
|
+
padding: 's16',
|
|
30
|
+
backgroundColor: 'accent',
|
|
31
|
+
borderRadius: 'md',
|
|
32
|
+
gap: 's8',
|
|
33
|
+
}}
|
|
27
34
|
>
|
|
28
35
|
<Text>Card content</Text>
|
|
29
36
|
</Box>
|
|
@@ -31,18 +38,13 @@ function Card() {
|
|
|
31
38
|
}
|
|
32
39
|
```
|
|
33
40
|
|
|
34
|
-
## Theme Tokens
|
|
35
|
-
|
|
36
|
-
Box consumes tokens from the `ledgerLiveTheme` for spacing, sizes, colors, and border radius.
|
|
37
|
-
|
|
38
41
|
## Escape Hatch
|
|
39
42
|
|
|
40
43
|
For values not covered by tokens, use raw numbers or the `style` prop:
|
|
41
44
|
|
|
42
45
|
```tsx
|
|
43
|
-
// Raw number for one-off values
|
|
44
|
-
<Box width={127} marginTop='s4' />
|
|
45
|
-
|
|
46
46
|
// Style prop for complete override
|
|
47
|
-
<Box marginTop
|
|
47
|
+
<Box lx={{ marginTop: 's4' }} style={{ width: 127 }} />
|
|
48
48
|
```
|
|
49
|
+
</Tab>
|
|
50
|
+
</CustomTabs>
|