@ledgerhq/lumen-ui-rnative 0.0.44 → 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.js +2 -2
- 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 +2 -2
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,MAAM;;uGAKjB,CAAC"}
|
|
@@ -17,8 +17,8 @@ import { BaseButton } from './BaseButton';
|
|
|
17
17
|
* Click Me
|
|
18
18
|
* </Button>
|
|
19
19
|
*
|
|
20
|
-
* // Full-width button with
|
|
21
|
-
* <Button appearance="accent" isFull={true}
|
|
20
|
+
* // Full-width button with lx props
|
|
21
|
+
* <Button appearance="accent" isFull={true} lx={{ marginTop: 's16' }}>
|
|
22
22
|
* Submit
|
|
23
23
|
* </Button>
|
|
24
24
|
*/
|
|
@@ -11,6 +11,6 @@ export declare const ContentTypesShowcase: Story;
|
|
|
11
11
|
export declare const SizesShowcase: Story;
|
|
12
12
|
export declare const StatesShowcase: Story;
|
|
13
13
|
export declare const ResponsiveLayout: Story;
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const LabelTruncate: Story;
|
|
15
15
|
export declare const InteractiveLoadingStates: Story;
|
|
16
16
|
//# sourceMappingURL=Button.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Button/Button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Button/Button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAIvE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CA2B7B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAC;AASrC,eAAO,MAAM,IAAI,EAAE,KAiBlB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAoBtB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAoBrB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAqBhC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KASlC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAc3B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAY5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAiB9B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAc3B,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,KAsCtC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Plus, Settings } from '../../Symbols';
|
|
4
|
+
import { Box, Text } from '../Utility';
|
|
4
5
|
import { Button } from './Button';
|
|
5
6
|
const meta = {
|
|
6
7
|
component: Button,
|
|
@@ -17,47 +18,17 @@ const meta = {
|
|
|
17
18
|
argTypes: {
|
|
18
19
|
appearance: {
|
|
19
20
|
control: 'select',
|
|
20
|
-
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
size: {
|
|
31
|
-
control: 'select',
|
|
32
|
-
options: ['sm', 'md', 'lg'],
|
|
33
|
-
description: 'The size of the button',
|
|
34
|
-
},
|
|
35
|
-
disabled: {
|
|
36
|
-
control: 'boolean',
|
|
37
|
-
description: 'Whether the button is disabled',
|
|
38
|
-
},
|
|
39
|
-
loading: {
|
|
40
|
-
control: 'boolean',
|
|
41
|
-
description: 'Whether the button is in loading state',
|
|
42
|
-
},
|
|
43
|
-
icon: {
|
|
44
|
-
control: 'select',
|
|
45
|
-
description: 'Optional icon component to display',
|
|
46
|
-
options: ['None', 'Plus', 'Settings'],
|
|
47
|
-
mapping: {
|
|
48
|
-
None: undefined,
|
|
49
|
-
Plus: Plus,
|
|
50
|
-
Settings: Settings,
|
|
21
|
+
icon: {
|
|
22
|
+
control: 'select',
|
|
23
|
+
description: 'Optional icon component to display',
|
|
24
|
+
options: ['None', 'Plus', 'Settings'],
|
|
25
|
+
mapping: {
|
|
26
|
+
None: undefined,
|
|
27
|
+
Plus: Plus,
|
|
28
|
+
Settings: Settings,
|
|
29
|
+
},
|
|
51
30
|
},
|
|
52
31
|
},
|
|
53
|
-
children: {
|
|
54
|
-
control: 'text',
|
|
55
|
-
description: 'The content to be displayed inside the button',
|
|
56
|
-
},
|
|
57
|
-
isFull: {
|
|
58
|
-
control: 'boolean',
|
|
59
|
-
description: 'Whether the button is full width',
|
|
60
|
-
},
|
|
61
32
|
},
|
|
62
33
|
};
|
|
63
34
|
export default meta;
|
|
@@ -66,6 +37,7 @@ export const Base = {
|
|
|
66
37
|
appearance: 'base',
|
|
67
38
|
children: 'Base Button',
|
|
68
39
|
},
|
|
40
|
+
render: (args) => _jsx(Button, { ...args }),
|
|
69
41
|
parameters: {
|
|
70
42
|
docs: {
|
|
71
43
|
source: {
|
|
@@ -130,23 +102,28 @@ export const AppearanceShowcase = {
|
|
|
130
102
|
{ name: 'No Background', appearance: 'no-background' },
|
|
131
103
|
{ name: 'Red', appearance: 'red' },
|
|
132
104
|
];
|
|
133
|
-
return (_jsx(
|
|
105
|
+
return (_jsx(Box, { lx: { flexDirection: 'row', gap: 's16', padding: 's8' }, children: appearances.map(({ name, appearance }) => (_jsx(Button, { appearance: appearance, children: name }, appearance))) }));
|
|
134
106
|
},
|
|
135
107
|
};
|
|
136
108
|
export const ContentTypesShowcase = {
|
|
137
|
-
render: () => (_jsxs(
|
|
109
|
+
render: () => (_jsxs(Box, { lx: { flexDirection: 'row', alignItems: 'center', gap: 's4' }, children: [_jsx(Button, { appearance: 'base', children: "Text Only" }), _jsx(Button, { appearance: 'base', icon: Plus, children: "With Icon" })] })),
|
|
138
110
|
};
|
|
139
111
|
export const SizesShowcase = {
|
|
140
|
-
render: () => (_jsxs(
|
|
112
|
+
render: () => (_jsxs(Box, { lx: { flexDirection: 'row', alignItems: 'center', gap: 's4' }, children: [_jsx(Button, { appearance: 'base', size: 'sm', children: "Small" }), _jsx(Button, { appearance: 'base', size: 'md', children: "Medium" }), _jsx(Button, { appearance: 'base', size: 'lg', icon: Settings, children: "Large" })] })),
|
|
141
113
|
};
|
|
142
114
|
export const StatesShowcase = {
|
|
143
|
-
render: () => (_jsxs(
|
|
115
|
+
render: () => (_jsxs(Box, { lx: { flexDirection: 'row', alignItems: 'center', gap: 's4' }, children: [_jsx(Button, { appearance: 'base', children: "Default" }), _jsx(Button, { appearance: 'base', disabled: true, children: "Disabled" }), _jsx(Button, { appearance: 'base', loading: true, children: "Loading" })] })),
|
|
144
116
|
};
|
|
145
117
|
export const ResponsiveLayout = {
|
|
146
|
-
render: () => (_jsxs(
|
|
118
|
+
render: () => (_jsxs(Box, { lx: {
|
|
119
|
+
flexDirection: 'column',
|
|
120
|
+
gap: 's8',
|
|
121
|
+
padding: 's8',
|
|
122
|
+
alignItems: 'flex-start',
|
|
123
|
+
}, children: [_jsx(Button, { appearance: 'base', children: "Short" }), _jsx(Button, { appearance: 'base', children: "Medium length button" }), _jsx(Button, { appearance: 'base', icon: Plus, children: "This is a longer button text to show dynamic width" })] })),
|
|
147
124
|
};
|
|
148
|
-
export const
|
|
149
|
-
render: () => (_jsxs(
|
|
125
|
+
export const LabelTruncate = {
|
|
126
|
+
render: () => (_jsxs(Box, { children: [_jsx(Text, { typography: 'body4SemiBold', lx: { color: 'muted' }, children: "This container has a fixed width." }), _jsx(Box, { lx: { width: 's400', padding: 's16' }, children: _jsx(Button, { icon: Plus, children: "This Base button has a fixed width container that should fit the content width." }) })] })),
|
|
150
127
|
};
|
|
151
128
|
export const InteractiveLoadingStates = {
|
|
152
129
|
render: () => {
|
|
@@ -161,6 +138,6 @@ export const InteractiveLoadingStates = {
|
|
|
161
138
|
setStates((prev) => ({ ...prev, [key]: 'red' }));
|
|
162
139
|
setTimeout(() => setStates((prev) => ({ ...prev, [key]: 'idle' })), 2000);
|
|
163
140
|
};
|
|
164
|
-
return (_jsxs(
|
|
141
|
+
return (_jsxs(Box, { lx: { flexDirection: 'row', alignItems: 'center', gap: 's4' }, children: [_jsx(Button, { appearance: 'red', loading: states.text === 'loading', onPress: () => handleClick('text'), children: states.text === 'red' ? 'Error!' : 'Text Only' }), _jsx(Button, { appearance: 'base', loading: states.withIcon === 'loading', onPress: () => handleClick('withIcon'), icon: Settings, children: states.withIcon === 'red' ? 'Settings Error!' : 'With Icon' })] }));
|
|
165
142
|
},
|
|
166
143
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Button/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Button/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './Button';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './types';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { StyledPressableProps } from '../../../styles';
|
|
3
4
|
import { IconSize } from '../Icon';
|
|
4
5
|
export type BaseButtonProps = {
|
|
5
6
|
/**
|
|
@@ -8,6 +9,7 @@ export type BaseButtonProps = {
|
|
|
8
9
|
appearance?: 'base' | 'gray' | 'accent' | 'transparent' | 'no-background' | 'red';
|
|
9
10
|
/**
|
|
10
11
|
* The size variant of the button.
|
|
12
|
+
* @default md
|
|
11
13
|
*/
|
|
12
14
|
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
13
15
|
/**
|
|
@@ -21,21 +23,24 @@ export type BaseButtonProps = {
|
|
|
21
23
|
/**
|
|
22
24
|
* An optional icon component to render inside the button.
|
|
23
25
|
*/
|
|
24
|
-
icon?:
|
|
26
|
+
icon?: ComponentType<{
|
|
25
27
|
size?: IconSize;
|
|
26
|
-
|
|
28
|
+
style?: StyleProp<ViewStyle>;
|
|
27
29
|
}>;
|
|
28
30
|
/**
|
|
29
31
|
* Whether the button is disabled.
|
|
30
32
|
*/
|
|
31
33
|
disabled?: boolean;
|
|
32
34
|
/**
|
|
33
|
-
*
|
|
35
|
+
* The content to display inside the button.
|
|
34
36
|
*/
|
|
35
|
-
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
} & Omit<StyledPressableProps, 'children'>;
|
|
39
|
+
export type ButtonProps = {
|
|
36
40
|
/**
|
|
37
|
-
* The
|
|
41
|
+
* The size variant of the button.
|
|
42
|
+
* @default md
|
|
38
43
|
*/
|
|
39
|
-
|
|
40
|
-
} & Omit<
|
|
41
|
-
//# sourceMappingURL=
|
|
44
|
+
size?: 'sm' | 'md' | 'lg';
|
|
45
|
+
} & Omit<BaseButtonProps, 'size'>;
|
|
46
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Button/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,UAAU,CAAC,EACP,MAAM,GACN,MAAM,GACN,QAAQ,GACR,aAAa,GACb,eAAe,GACf,KAAK,CAAC;IACV;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;QAAE,IAAI,CAAC,EAAE,QAAQ,CAAC;QAAC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;KAAE,CAAC,CAAC;IACxE;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GAAG,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC;AAE3C,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B,GAAG,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { View } from 'react-native';
|
|
|
8
8
|
* @see {@link https://ldls.vercel.app/?path=/docs/react-native_action-cardbutton--docs Storybook}
|
|
9
9
|
* @see {@link https://ldls.vercel.app/?path=/docs/react-native_action-cardbutton--docs#dos-and-donts Guidelines}
|
|
10
10
|
*
|
|
11
|
-
* @warning The `
|
|
11
|
+
* @warning The `lx` prop should only be used for layout adjustments like margins or positioning.
|
|
12
12
|
* Do not use it to modify the card button's core appearance (colors, padding, etc). Use the `appearance` prop instead.
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
@@ -17,6 +17,7 @@ import { View } from 'react-native';
|
|
|
17
17
|
*
|
|
18
18
|
* <CardButton title="Click Me" onPress={() => console.log('Clicked!')} />
|
|
19
19
|
*
|
|
20
|
+
* @example
|
|
20
21
|
* // Card button with icon and description
|
|
21
22
|
* import { CardButton } from '@ledgerhq/lumen-ui-rnative';
|
|
22
23
|
* import { Info } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
@@ -33,10 +34,10 @@ export declare const CardButton: React.ForwardRefExoticComponent<{
|
|
|
33
34
|
disabled?: boolean;
|
|
34
35
|
icon?: React.ComponentType<{
|
|
35
36
|
size?: import("../Icon").IconSize;
|
|
36
|
-
|
|
37
|
+
style?: import("react-native").StyleProp<import("react-native").ViewStyle>;
|
|
37
38
|
}>;
|
|
38
39
|
title: string;
|
|
39
40
|
description?: string;
|
|
40
41
|
hideChevron?: boolean;
|
|
41
|
-
} & Omit<import("
|
|
42
|
+
} & Omit<import("../../../styles").StyledPressableProps, "disabled"> & React.RefAttributes<View>>;
|
|
42
43
|
//# sourceMappingURL=CardButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardButton.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/CardButton/CardButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CardButton.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/CardButton/CardButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAQ,IAAI,EAAE,MAAM,cAAc,CAAC;AAuF1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,UAAU;;;;YAlGZ,CAAC;aAAiB,CAAC;;;;;iGA4I7B,CAAC"}
|
|
@@ -1,72 +1,64 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cva } from 'class-variance-authority';
|
|
3
2
|
import React from 'react';
|
|
4
|
-
import { Text,
|
|
3
|
+
import { Text, View } from 'react-native';
|
|
4
|
+
import { LumenStyleSheet, mergeStyles } from '../../../styles';
|
|
5
5
|
import { ChevronRight } from '../../Symbols';
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
import { Pressable } from '../Utility';
|
|
7
|
+
const useStyles = ({ appearance, disabled, pressed, }) => {
|
|
8
|
+
return LumenStyleSheet.useCreate((t) => {
|
|
9
|
+
const bgColors = {
|
|
10
|
+
base: t.colors.bg.muted,
|
|
11
|
+
outline: 'transparent',
|
|
12
|
+
};
|
|
13
|
+
const pressedBgColors = {
|
|
14
|
+
base: t.colors.bg.mutedPressed,
|
|
15
|
+
outline: t.colors.bg.baseTransparentPressed,
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
container: mergeStyles({
|
|
19
|
+
flexDirection: 'row',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
width: t.sizes.full,
|
|
22
|
+
gap: t.spacings.s12,
|
|
23
|
+
padding: t.spacings.s12,
|
|
24
|
+
borderRadius: t.borderRadius.sm,
|
|
25
|
+
backgroundColor: bgColors[appearance],
|
|
26
|
+
}, appearance === 'outline' && {
|
|
27
|
+
borderStyle: 'dashed',
|
|
28
|
+
borderWidth: t.borderWidth.s1,
|
|
29
|
+
borderColor: t.colors.border.mutedSubtle,
|
|
30
|
+
}, pressed && {
|
|
31
|
+
backgroundColor: pressedBgColors[appearance],
|
|
32
|
+
}, pressed &&
|
|
33
|
+
appearance === 'outline' && {
|
|
34
|
+
borderColor: t.colors.border.mutedSubtlePressed,
|
|
35
|
+
}, disabled && {
|
|
36
|
+
backgroundColor: appearance === 'outline' ? 'transparent' : t.colors.bg.disabled,
|
|
37
|
+
}, disabled &&
|
|
38
|
+
appearance === 'outline' && {
|
|
39
|
+
borderColor: t.colors.border.disabled,
|
|
40
|
+
}),
|
|
41
|
+
contentWrapper: {
|
|
42
|
+
flex: 1,
|
|
43
|
+
minWidth: 0,
|
|
44
|
+
flexDirection: 'column',
|
|
45
|
+
gap: t.spacings.s4,
|
|
13
46
|
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
47
|
+
title: mergeStyles(t.typographies.body1SemiBold, {
|
|
48
|
+
color: disabled ? t.colors.text.disabled : t.colors.text.base,
|
|
49
|
+
minWidth: 0,
|
|
50
|
+
textAlign: 'left',
|
|
51
|
+
}),
|
|
52
|
+
description: mergeStyles(t.typographies.body2, {
|
|
53
|
+
color: disabled ? t.colors.text.disabled : t.colors.text.base,
|
|
54
|
+
minWidth: 0,
|
|
55
|
+
}),
|
|
56
|
+
icon: {
|
|
57
|
+
flexShrink: 0,
|
|
58
|
+
color: disabled ? t.colors.text.disabled : t.colors.text.base,
|
|
17
59
|
},
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
{
|
|
21
|
-
appearance: 'base',
|
|
22
|
-
disabled: true,
|
|
23
|
-
className: 'bg-disabled',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
appearance: 'base',
|
|
27
|
-
disabled: false,
|
|
28
|
-
className: 'bg-muted active:bg-muted-pressed',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
appearance: 'outline',
|
|
32
|
-
disabled: true,
|
|
33
|
-
className: 'bg-base-transparent outline-disabled',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
appearance: 'outline',
|
|
37
|
-
disabled: false,
|
|
38
|
-
className: 'bg-base-transparent outline-muted-subtle active:bg-base-transparent-pressed active:outline-muted-subtle-pressed',
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
defaultVariants: {
|
|
42
|
-
appearance: 'base',
|
|
43
|
-
disabled: false,
|
|
44
|
-
},
|
|
45
|
-
}),
|
|
46
|
-
title: cva('min-w-0 body-1-semi-bold', {
|
|
47
|
-
variants: {
|
|
48
|
-
disabled: {
|
|
49
|
-
true: 'text-disabled',
|
|
50
|
-
false: 'text-base',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
}),
|
|
54
|
-
description: cva('min-w-0 body-2', {
|
|
55
|
-
variants: {
|
|
56
|
-
disabled: {
|
|
57
|
-
true: 'text-disabled',
|
|
58
|
-
false: 'text-base',
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
}),
|
|
62
|
-
icon: cva('shrink-0', {
|
|
63
|
-
variants: {
|
|
64
|
-
disabled: {
|
|
65
|
-
true: 'text-disabled',
|
|
66
|
-
false: 'text-base',
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
}),
|
|
60
|
+
};
|
|
61
|
+
}, [appearance, disabled, pressed]);
|
|
70
62
|
};
|
|
71
63
|
/**
|
|
72
64
|
* A customizable card button component that displays an optional icon, a required title, an optional description, and an optional chevron arrow.
|
|
@@ -76,7 +68,7 @@ const cardButtonVariants = {
|
|
|
76
68
|
* @see {@link https://ldls.vercel.app/?path=/docs/react-native_action-cardbutton--docs Storybook}
|
|
77
69
|
* @see {@link https://ldls.vercel.app/?path=/docs/react-native_action-cardbutton--docs#dos-and-donts Guidelines}
|
|
78
70
|
*
|
|
79
|
-
* @warning The `
|
|
71
|
+
* @warning The `lx` prop should only be used for layout adjustments like margins or positioning.
|
|
80
72
|
* Do not use it to modify the card button's core appearance (colors, padding, etc). Use the `appearance` prop instead.
|
|
81
73
|
*
|
|
82
74
|
* @example
|
|
@@ -85,6 +77,7 @@ const cardButtonVariants = {
|
|
|
85
77
|
*
|
|
86
78
|
* <CardButton title="Click Me" onPress={() => console.log('Clicked!')} />
|
|
87
79
|
*
|
|
80
|
+
* @example
|
|
88
81
|
* // Card button with icon and description
|
|
89
82
|
* import { CardButton } from '@ledgerhq/lumen-ui-rnative';
|
|
90
83
|
* import { Info } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
@@ -96,11 +89,12 @@ const cardButtonVariants = {
|
|
|
96
89
|
* appearance="outline"
|
|
97
90
|
* />
|
|
98
91
|
*/
|
|
99
|
-
export const CardButton = React.forwardRef(({
|
|
100
|
-
|
|
101
|
-
return (_jsxs(Pressable, { ref: ref, className: cn(className, cardButtonVariants.root({
|
|
102
|
-
appearance,
|
|
103
|
-
disabled,
|
|
104
|
-
})), disabled: disabled ?? false, ...props, children: [IconComponent && (_jsx(IconComponent, { size: 24, className: cardButtonVariants.icon({ disabled }) })), _jsxs(View, { className: 'flex min-w-0 flex-1 flex-col gap-4 text-left body-1-semi-bold', children: [_jsx(Text, { className: cardButtonVariants.title({ disabled }), numberOfLines: 1, ellipsizeMode: 'tail', children: title }), description && (_jsx(Text, { className: cardButtonVariants.description({ disabled }), numberOfLines: 2, ellipsizeMode: 'tail', children: description }))] }), !hideChevron && (_jsx(ChevronRight, { size: 24, className: cardButtonVariants.icon({ disabled }) }))] }));
|
|
92
|
+
export const CardButton = React.forwardRef(({ lx, style, appearance = 'base', icon, title, description, hideChevron, disabled = false, ...props }, ref) => {
|
|
93
|
+
return (_jsx(Pressable, { ref: ref, lx: lx, style: [style, { flex: 1 }], disabled: disabled, accessibilityRole: 'button', accessibilityState: { disabled }, ...props, children: ({ pressed }) => (_jsx(CardButtonContent, { appearance: appearance, disabled: disabled, pressed: pressed, icon: icon, title: title, description: description, hideChevron: hideChevron })) }));
|
|
105
94
|
});
|
|
95
|
+
const CardButtonContent = ({ appearance, disabled, pressed, icon, title, description, hideChevron, }) => {
|
|
96
|
+
const IconComponent = icon;
|
|
97
|
+
const styles = useStyles({ appearance, disabled, pressed });
|
|
98
|
+
return (_jsxs(View, { style: styles.container, testID: 'card-button-content', children: [IconComponent && _jsx(IconComponent, { size: 24, style: styles.icon }), _jsxs(View, { style: styles.contentWrapper, children: [_jsx(Text, { style: styles.title, numberOfLines: 1, ellipsizeMode: 'tail', children: title }), description && (_jsx(Text, { style: styles.description, numberOfLines: 2, ellipsizeMode: 'tail', children: description }))] }), !hideChevron && _jsx(ChevronRight, { size: 24, style: styles.icon })] }));
|
|
99
|
+
};
|
|
106
100
|
CardButton.displayName = 'CardButton';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardButton.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/CardButton/CardButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CA6CjC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAC;AAGzC,eAAO,MAAM,IAAI,EAAE,KAkBlB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"CardButton.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/CardButton/CardButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CA6CjC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAC;AAGzC,eAAO,MAAM,IAAI,EAAE,KAkBlB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAmBtB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAmB7B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAmB5B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAqB1B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KA+B1B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KA+BhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAsC/B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAsC5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAkC9B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { View, Text } from 'react-native';
|
|
3
2
|
import { Settings, Plus, Coins, CreditCard, Bank } from '../../Symbols';
|
|
3
|
+
import { Box, Text } from '../Utility';
|
|
4
4
|
import { CardButton } from './CardButton';
|
|
5
5
|
const meta = {
|
|
6
6
|
component: CardButton,
|
|
@@ -54,6 +54,7 @@ export const Base = {
|
|
|
54
54
|
appearance: 'base',
|
|
55
55
|
title: 'Basic Card Button',
|
|
56
56
|
},
|
|
57
|
+
render: (args) => _jsx(CardButton, { ...args }),
|
|
57
58
|
parameters: {
|
|
58
59
|
docs: {
|
|
59
60
|
source: {
|
|
@@ -61,7 +62,6 @@ export const Base = {
|
|
|
61
62
|
<CardButton
|
|
62
63
|
appearance="base"
|
|
63
64
|
title="Basic Card Button"
|
|
64
|
-
className="max-w-md"
|
|
65
65
|
/>
|
|
66
66
|
`,
|
|
67
67
|
},
|
|
@@ -73,7 +73,6 @@ export const WithIcon = {
|
|
|
73
73
|
appearance: 'base',
|
|
74
74
|
title: 'Settings',
|
|
75
75
|
icon: Settings,
|
|
76
|
-
className: 'max-w-md',
|
|
77
76
|
},
|
|
78
77
|
parameters: {
|
|
79
78
|
docs: {
|
|
@@ -83,7 +82,6 @@ export const WithIcon = {
|
|
|
83
82
|
appearance="base"
|
|
84
83
|
title="Settings"
|
|
85
84
|
icon={Settings}
|
|
86
|
-
className="max-w-md"
|
|
87
85
|
/>
|
|
88
86
|
`,
|
|
89
87
|
},
|
|
@@ -95,7 +93,6 @@ export const WithDescription = {
|
|
|
95
93
|
appearance: 'base',
|
|
96
94
|
title: 'Payment Method',
|
|
97
95
|
description: 'Add or manage your payment options',
|
|
98
|
-
className: 'max-w-md',
|
|
99
96
|
},
|
|
100
97
|
parameters: {
|
|
101
98
|
docs: {
|
|
@@ -105,7 +102,6 @@ export const WithDescription = {
|
|
|
105
102
|
appearance="base"
|
|
106
103
|
title="Payment Method"
|
|
107
104
|
description="Add or manage your payment options"
|
|
108
|
-
className="max-w-md"
|
|
109
105
|
/>
|
|
110
106
|
`,
|
|
111
107
|
},
|
|
@@ -117,7 +113,6 @@ export const WithoutChevron = {
|
|
|
117
113
|
appearance: 'base',
|
|
118
114
|
title: 'Navigate Forward',
|
|
119
115
|
hideChevron: true,
|
|
120
|
-
className: 'max-w-md',
|
|
121
116
|
},
|
|
122
117
|
parameters: {
|
|
123
118
|
docs: {
|
|
@@ -127,7 +122,6 @@ export const WithoutChevron = {
|
|
|
127
122
|
appearance="base"
|
|
128
123
|
title="Navigate Forward"
|
|
129
124
|
hideChevron
|
|
130
|
-
className="max-w-md"
|
|
131
125
|
/>
|
|
132
126
|
`,
|
|
133
127
|
},
|
|
@@ -140,7 +134,6 @@ export const FullFeatures = {
|
|
|
140
134
|
title: 'Account Settings',
|
|
141
135
|
description: 'Manage your account preferences and security',
|
|
142
136
|
icon: Settings,
|
|
143
|
-
className: 'max-w-md',
|
|
144
137
|
},
|
|
145
138
|
parameters: {
|
|
146
139
|
docs: {
|
|
@@ -151,7 +144,6 @@ export const FullFeatures = {
|
|
|
151
144
|
title="Account Settings"
|
|
152
145
|
description="Manage your account preferences and security"
|
|
153
146
|
icon={Settings}
|
|
154
|
-
className="max-w-md"
|
|
155
147
|
/>
|
|
156
148
|
`,
|
|
157
149
|
},
|
|
@@ -159,7 +151,7 @@ export const FullFeatures = {
|
|
|
159
151
|
},
|
|
160
152
|
};
|
|
161
153
|
export const NaturalWidth = {
|
|
162
|
-
render: () => (_jsxs(
|
|
154
|
+
render: () => (_jsxs(Box, { lx: { backgroundColor: 'mutedPressed', padding: 's16' }, children: [_jsx(Text, { typography: 'body4SemiBold', lx: { color: 'muted', marginBottom: 's16' }, children: "CardButton naturally flows to fill parent container width" }), _jsx(CardButton, { appearance: 'base', title: 'Natural Width Example', description: 'This card button demonstrates how it flows naturally to fill the full width of its parent container without any max-width constraints', icon: CreditCard })] })),
|
|
163
155
|
parameters: {
|
|
164
156
|
docs: {
|
|
165
157
|
source: {
|
|
@@ -181,15 +173,36 @@ export const AppearanceShowcase = {
|
|
|
181
173
|
{ name: 'Base', appearance: 'base' },
|
|
182
174
|
{ name: 'Outline', appearance: 'outline' },
|
|
183
175
|
];
|
|
184
|
-
return (_jsx(
|
|
176
|
+
return (_jsx(Box, { lx: {
|
|
177
|
+
flexDirection: 'column',
|
|
178
|
+
gap: 's16',
|
|
179
|
+
padding: 's8',
|
|
180
|
+
maxWidth: 's400',
|
|
181
|
+
}, children: appearances.map(({ name, appearance }) => (_jsx(CardButton, { appearance: appearance, title: `${name} Appearance`, description: 'This demonstrates the appearance variation', icon: Coins }, appearance))) }));
|
|
185
182
|
},
|
|
186
183
|
};
|
|
187
184
|
export const ContentVariations = {
|
|
188
|
-
render: () => (_jsxs(
|
|
185
|
+
render: () => (_jsxs(Box, { lx: {
|
|
186
|
+
flexDirection: 'column',
|
|
187
|
+
gap: 's16',
|
|
188
|
+
padding: 's8',
|
|
189
|
+
maxWidth: 's400',
|
|
190
|
+
}, children: [_jsx(CardButton, { appearance: 'base', title: 'With Description', description: 'This card has a description below the title', hideChevron: true }), _jsx(CardButton, { appearance: 'base', title: 'Icon and Description', description: 'This card has both an icon and description', icon: Settings, hideChevron: true }), _jsx(CardButton, { appearance: 'base', title: 'Description and Chevron', description: 'This card has description and chevron' }), _jsx(CardButton, { appearance: 'base', title: 'Complete Card', description: 'This card has all optional features', icon: CreditCard }), _jsx(CardButton, { appearance: 'base', title: 'With Icon', icon: Plus, hideChevron: true }), _jsx(CardButton, { appearance: 'base', title: 'With Chevron' })] })),
|
|
189
191
|
};
|
|
190
192
|
export const StatesShowcase = {
|
|
191
|
-
render: () => (_jsxs(
|
|
193
|
+
render: () => (_jsxs(Box, { lx: {
|
|
194
|
+
flexDirection: 'column',
|
|
195
|
+
gap: 's16',
|
|
196
|
+
padding: 's8',
|
|
197
|
+
maxWidth: 's400',
|
|
198
|
+
}, children: [_jsx(CardButton, { appearance: 'base', title: 'Base Default', description: 'This is the normal interactive state', icon: Settings }), _jsx(CardButton, { appearance: 'base', title: 'Base Disabled', description: 'This card button is disabled', icon: Settings, disabled: true }), _jsx(CardButton, { appearance: 'outline', title: 'Outline Default', description: 'This is the outline appearance', icon: Bank }), _jsx(CardButton, { appearance: 'outline', title: 'Outline Disabled', description: 'This is the disabled outline appearance', icon: Bank, disabled: true })] })),
|
|
192
199
|
};
|
|
193
200
|
export const ResponsiveLayout = {
|
|
194
|
-
render: () => (_jsxs(
|
|
201
|
+
render: () => (_jsxs(Box, { lx: {
|
|
202
|
+
width: 's320',
|
|
203
|
+
flexDirection: 'column',
|
|
204
|
+
gap: 's16',
|
|
205
|
+
backgroundColor: 'mutedPressed',
|
|
206
|
+
padding: 's16',
|
|
207
|
+
}, children: [_jsx(Text, { typography: 'body4SemiBold', lx: { color: 'muted' }, children: "Container: 320px wide" }), _jsx(CardButton, { appearance: 'base', title: 'Short Title', description: 'Short description', icon: Plus }), _jsx(CardButton, { appearance: 'base', title: 'Full Width', description: 'Short description', icon: Plus }), _jsx(CardButton, { appearance: 'base', title: 'Longer Title That Might Overflow When Container is Smaller', description: 'This is a longer description that demonstrates how the card handles longer content within its constraints', icon: Settings })] })),
|
|
195
208
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/CardButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/CardButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './CardButton';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './types';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { StyledPressableProps } from '../../../styles';
|
|
3
4
|
import { IconSize } from '../Icon';
|
|
4
5
|
export type CardButtonProps = {
|
|
5
6
|
/**
|
|
@@ -15,7 +16,7 @@ export type CardButtonProps = {
|
|
|
15
16
|
*/
|
|
16
17
|
icon?: React.ComponentType<{
|
|
17
18
|
size?: IconSize;
|
|
18
|
-
|
|
19
|
+
style?: StyleProp<ViewStyle>;
|
|
19
20
|
}>;
|
|
20
21
|
/**
|
|
21
22
|
* The main title of the card button.
|
|
@@ -29,5 +30,5 @@ export type CardButtonProps = {
|
|
|
29
30
|
* If true, hides the chevron arrow on the right side.
|
|
30
31
|
*/
|
|
31
32
|
hideChevron?: boolean;
|
|
32
|
-
} & Omit<
|
|
33
|
-
//# sourceMappingURL=
|
|
33
|
+
} & Omit<StyledPressableProps, 'disabled'>;
|
|
34
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/CardButton/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,IAAI,CAAC,EAAE,QAAQ,CAAC;QAAC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;KAAE,CAAC,CAAC;IAC9E;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC"}
|