@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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { LUMEN_VIEW_STYLE_PROPS } from '../../../styles/resolveStyle/resolveConfig';
|
|
3
3
|
import { Settings, PenEdit, DeleteCircleFill, MoreVertical, } from '../../Symbols';
|
|
4
|
+
import { Box, Text } from '../Utility';
|
|
4
5
|
import { InteractiveIcon } from './InteractiveIcon';
|
|
5
6
|
const meta = {
|
|
6
7
|
component: InteractiveIcon,
|
|
@@ -13,6 +14,9 @@ const meta = {
|
|
|
13
14
|
type: 'code',
|
|
14
15
|
},
|
|
15
16
|
},
|
|
17
|
+
controls: {
|
|
18
|
+
exclude: Array.from(LUMEN_VIEW_STYLE_PROPS),
|
|
19
|
+
},
|
|
16
20
|
},
|
|
17
21
|
argTypes: {
|
|
18
22
|
children: {
|
|
@@ -27,17 +31,17 @@ const meta = {
|
|
|
27
31
|
},
|
|
28
32
|
};
|
|
29
33
|
export default meta;
|
|
30
|
-
export const
|
|
34
|
+
export const Base = {
|
|
31
35
|
args: {
|
|
32
36
|
iconType: 'filled',
|
|
33
37
|
children: _jsx(DeleteCircleFill, {}),
|
|
34
|
-
|
|
38
|
+
accessibilityLabel: 'Delete',
|
|
35
39
|
},
|
|
36
40
|
parameters: {
|
|
37
41
|
docs: {
|
|
38
42
|
source: {
|
|
39
43
|
code: `
|
|
40
|
-
<InteractiveIcon iconType="filled"
|
|
44
|
+
<InteractiveIcon iconType="filled" accessibilityLabel="Delete">
|
|
41
45
|
<DeleteCircleFill />
|
|
42
46
|
</InteractiveIcon>
|
|
43
47
|
`,
|
|
@@ -49,13 +53,13 @@ export const Stroked = {
|
|
|
49
53
|
args: {
|
|
50
54
|
iconType: 'stroked',
|
|
51
55
|
children: _jsx(MoreVertical, {}),
|
|
52
|
-
|
|
56
|
+
accessibilityLabel: 'More actions',
|
|
53
57
|
},
|
|
54
58
|
parameters: {
|
|
55
59
|
docs: {
|
|
56
60
|
source: {
|
|
57
61
|
code: `
|
|
58
|
-
<InteractiveIcon iconType="stroked"
|
|
62
|
+
<InteractiveIcon iconType="stroked" accessibilityLabel="More actions">
|
|
59
63
|
<MoreVertical />
|
|
60
64
|
</InteractiveIcon>
|
|
61
65
|
`,
|
|
@@ -65,17 +69,26 @@ export const Stroked = {
|
|
|
65
69
|
};
|
|
66
70
|
export const IconTypeShowcase = {
|
|
67
71
|
render: () => {
|
|
68
|
-
return (_jsxs(
|
|
72
|
+
return (_jsxs(Box, { lx: { flexDirection: 'row', gap: 's16', padding: 's8' }, children: [_jsxs(Box, { lx: { flexDirection: 'column', alignItems: 'center', gap: 's4' }, children: [_jsx(Text, { lx: { color: 'muted' }, typography: 'body3', children: "Filled" }), _jsx(InteractiveIcon, { iconType: 'filled', accessibilityLabel: 'Delete', children: _jsx(DeleteCircleFill, {}) })] }), _jsxs(Box, { lx: { flexDirection: 'column', alignItems: 'center', gap: 's4' }, children: [_jsx(Text, { lx: { color: 'muted' }, typography: 'body3', children: "Stroked" }), _jsx(InteractiveIcon, { iconType: 'stroked', accessibilityLabel: 'More actions', children: _jsx(MoreVertical, {}) })] })] }));
|
|
69
73
|
},
|
|
70
74
|
};
|
|
71
75
|
export const SizesShowcase = {
|
|
72
76
|
render: () => {
|
|
73
77
|
const iconSizes = [16, 20, 24, 40];
|
|
74
|
-
return (_jsx(
|
|
78
|
+
return (_jsx(Box, { lx: { flexDirection: 'row', gap: 's12', padding: 's8' }, children: iconSizes.map((size) => (_jsxs(Box, { lx: { flexDirection: 'column', gap: 's16' }, children: [_jsx(Box, { lx: {
|
|
79
|
+
width: 's72',
|
|
80
|
+
alignItems: 'center',
|
|
81
|
+
justifyContent: 'center',
|
|
82
|
+
}, children: _jsx(InteractiveIcon, { iconType: 'stroked', accessibilityLabel: 'More', children: _jsx(DeleteCircleFill, { size: size }) }, size) }), _jsxs(Text, { lx: { textAlign: 'center' }, typography: 'body3', children: [size, "px"] })] }, size))) }));
|
|
75
83
|
},
|
|
76
84
|
};
|
|
77
85
|
export const StatesShowcase = {
|
|
78
86
|
render: () => {
|
|
79
|
-
return (_jsxs(
|
|
87
|
+
return (_jsxs(Box, { lx: {
|
|
88
|
+
flexDirection: 'row',
|
|
89
|
+
gap: 's16',
|
|
90
|
+
backgroundColor: 'base',
|
|
91
|
+
padding: 's8',
|
|
92
|
+
}, children: [_jsxs(Box, { lx: { flexDirection: 'column', alignItems: 'center', gap: 's4' }, children: [_jsx(Text, { lx: { color: 'muted' }, typography: 'body3', children: "Filled enabled" }), _jsx(InteractiveIcon, { iconType: 'filled', accessibilityLabel: 'Delete', children: _jsx(DeleteCircleFill, {}) })] }), _jsxs(Box, { lx: { flexDirection: 'column', alignItems: 'center', gap: 's4' }, children: [_jsx(Text, { lx: { color: 'muted' }, typography: 'body3', children: "Stroked enabled" }), _jsx(InteractiveIcon, { iconType: 'stroked', accessibilityLabel: 'More actions', children: _jsx(MoreVertical, {}) })] }), _jsxs(Box, { lx: { flexDirection: 'column', alignItems: 'center', gap: 's4' }, children: [_jsx(Text, { lx: { color: 'muted' }, typography: 'body3', children: "Filled disabled" }), _jsx(InteractiveIcon, { iconType: 'filled', accessibilityLabel: 'Delete', disabled: true, children: _jsx(DeleteCircleFill, {}) })] }), _jsxs(Box, { lx: { flexDirection: 'column', alignItems: 'center', gap: 's4' }, children: [_jsx(Text, { lx: { color: 'muted' }, typography: 'body3', children: "Stroked disabled" }), _jsx(InteractiveIcon, { iconType: 'stroked', accessibilityLabel: 'More actions', disabled: true, children: _jsx(MoreVertical, {}) })] })] }));
|
|
80
93
|
},
|
|
81
94
|
};
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { StyledPressableProps } from '../../../styles';
|
|
3
3
|
export type InteractiveIconProps = {
|
|
4
4
|
/**
|
|
5
5
|
* The visual style of the icon button.
|
|
6
6
|
* Choose 'filled' for icons with solid backgrounds or 'stroked' for outlined icons.
|
|
7
7
|
*/
|
|
8
8
|
iconType: 'filled' | 'stroked';
|
|
9
|
-
|
|
10
|
-
* The icon component to display inside the button. Should be a single icon element from the design system.
|
|
11
|
-
*/
|
|
12
|
-
children: ReactNode;
|
|
13
|
-
} & PressableProps;
|
|
9
|
+
} & PropsWithChildren & Omit<StyledPressableProps, 'children'>;
|
|
14
10
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/InteractiveIcon/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/InteractiveIcon/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;OAGG;IACH,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;CAChC,GAAG,iBAAiB,GACnB,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -1,48 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { View } from 'react-native';
|
|
3
3
|
import { IconSize } from '../Icon';
|
|
4
|
-
export type LinkProps = Omit<PressableProps, 'onPress' | 'children'> & {
|
|
5
|
-
/**
|
|
6
|
-
* The visual style of the link.
|
|
7
|
-
* @default base
|
|
8
|
-
*/
|
|
9
|
-
appearance?: 'base' | 'accent';
|
|
10
|
-
/**
|
|
11
|
-
* The size variant of the link.
|
|
12
|
-
* @default md
|
|
13
|
-
*/
|
|
14
|
-
size?: 'sm' | 'md';
|
|
15
|
-
/**
|
|
16
|
-
* Whether to underline the link text.
|
|
17
|
-
* @default true
|
|
18
|
-
*/
|
|
19
|
-
underline?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* An optional icon component to render inside the link.
|
|
22
|
-
* The icon styles are defined by the link. Please do not override them.
|
|
23
|
-
*/
|
|
24
|
-
icon?: React.ComponentType<{
|
|
25
|
-
size?: IconSize;
|
|
26
|
-
className?: string;
|
|
27
|
-
}>;
|
|
28
|
-
/**
|
|
29
|
-
* If true, displays an external link icon next to the link text.
|
|
30
|
-
* @default false
|
|
31
|
-
*/
|
|
32
|
-
isExternal?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* The URL to navigate to
|
|
35
|
-
*/
|
|
36
|
-
href?: string;
|
|
37
|
-
/**
|
|
38
|
-
* Custom press handler (overrides default href navigation)
|
|
39
|
-
*/
|
|
40
|
-
onPress?: () => void;
|
|
41
|
-
/**
|
|
42
|
-
* The link's content, typically text.
|
|
43
|
-
*/
|
|
44
|
-
children: React.ReactNode;
|
|
45
|
-
};
|
|
46
4
|
/**
|
|
47
5
|
* A customizable link component that supports base and accent color appearances, optional underline, sizes, icons, and external link handling.
|
|
48
6
|
* Opens URLs using React Native's Linking API.
|
|
@@ -50,7 +8,7 @@ export type LinkProps = Omit<PressableProps, 'onPress' | 'children'> & {
|
|
|
50
8
|
* @see {@link https://ldls.vercel.app/?path=/docs/components-link-overview--docs Storybook}
|
|
51
9
|
* @see {@link https://ldls.vercel.app/?path=/docs/components-link-implementation--docs#dos-and-donts Guidelines}
|
|
52
10
|
*
|
|
53
|
-
* @warning The `
|
|
11
|
+
* @warning The `lx` prop should only be used for layout adjustments like margins or positioning.
|
|
54
12
|
* Do not use it to modify the link's core appearance (colors, padding, etc). Use the `appearance` and `underline` props instead.
|
|
55
13
|
*
|
|
56
14
|
* @example
|
|
@@ -78,46 +36,18 @@ export type LinkProps = Omit<PressableProps, 'onPress' | 'children'> & {
|
|
|
78
36
|
* Dashboard
|
|
79
37
|
* </Link>
|
|
80
38
|
*/
|
|
81
|
-
export declare const Link: React.ForwardRefExoticComponent<
|
|
82
|
-
/**
|
|
83
|
-
* The visual style of the link.
|
|
84
|
-
* @default base
|
|
85
|
-
*/
|
|
39
|
+
export declare const Link: React.ForwardRefExoticComponent<{
|
|
86
40
|
appearance?: "base" | "accent";
|
|
87
|
-
/**
|
|
88
|
-
* The size variant of the link.
|
|
89
|
-
* @default md
|
|
90
|
-
*/
|
|
91
41
|
size?: "sm" | "md";
|
|
92
|
-
/**
|
|
93
|
-
* Whether to underline the link text.
|
|
94
|
-
* @default true
|
|
95
|
-
*/
|
|
96
42
|
underline?: boolean;
|
|
97
|
-
/**
|
|
98
|
-
* An optional icon component to render inside the link.
|
|
99
|
-
* The icon styles are defined by the link. Please do not override them.
|
|
100
|
-
*/
|
|
101
43
|
icon?: React.ComponentType<{
|
|
102
44
|
size?: IconSize;
|
|
103
|
-
|
|
45
|
+
style?: import("react-native").StyleProp<import("react-native").ViewStyle>;
|
|
104
46
|
}>;
|
|
105
|
-
/**
|
|
106
|
-
* If true, displays an external link icon next to the link text.
|
|
107
|
-
* @default false
|
|
108
|
-
*/
|
|
109
47
|
isExternal?: boolean;
|
|
110
|
-
/**
|
|
111
|
-
* The URL to navigate to
|
|
112
|
-
*/
|
|
113
48
|
href?: string;
|
|
114
|
-
/**
|
|
115
|
-
* Custom press handler (overrides default href navigation)
|
|
116
|
-
*/
|
|
117
49
|
onPress?: () => void;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
children: React.ReactNode;
|
|
122
|
-
} & React.RefAttributes<View>>;
|
|
50
|
+
} & {
|
|
51
|
+
children?: React.ReactNode | undefined;
|
|
52
|
+
} & Omit<import("../../../styles").StyledPressableProps, "children" | "onPress"> & React.RefAttributes<View>>;
|
|
123
53
|
//# sourceMappingURL=Link.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Link/Link.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Link/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAiB,IAAI,EAAE,MAAM,cAAc,CAAC;AAGnD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAiEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,IAAI;;;;;YAhFI,CAAC;aACd,CAAA;;;;;;;6GAmIP,CAAC"}
|
|
@@ -1,57 +1,51 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from '@ledgerhq/lumen-utils-shared';
|
|
3
|
-
import { cva } from 'class-variance-authority';
|
|
4
2
|
import React from 'react';
|
|
5
|
-
import { Linking,
|
|
3
|
+
import { Linking, Text, View } from 'react-native';
|
|
4
|
+
import { LumenStyleSheet, mergeStyles } from '../../../styles';
|
|
6
5
|
import { ExternalLink } from '../../Symbols';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
size: 'md',
|
|
51
|
-
underline: true,
|
|
52
|
-
pressed: false,
|
|
53
|
-
},
|
|
54
|
-
});
|
|
6
|
+
import { Pressable } from '../Utility';
|
|
7
|
+
const iconSizeMap = {
|
|
8
|
+
sm: 16,
|
|
9
|
+
md: 20,
|
|
10
|
+
};
|
|
11
|
+
const useStyles = ({ appearance, size, underline, pressed }) => {
|
|
12
|
+
return LumenStyleSheet.useCreate((t) => {
|
|
13
|
+
const textColors = {
|
|
14
|
+
base: t.colors.text.base,
|
|
15
|
+
accent: t.colors.text.interactive,
|
|
16
|
+
};
|
|
17
|
+
const pressedTextColors = {
|
|
18
|
+
base: t.colors.text.basePressed,
|
|
19
|
+
accent: t.colors.text.interactivePressed,
|
|
20
|
+
};
|
|
21
|
+
const typography = size === 'sm'
|
|
22
|
+
? t.typographies.body2SemiBold
|
|
23
|
+
: t.typographies.body1SemiBold;
|
|
24
|
+
const gap = size === 'sm' ? t.spacings.s4 : t.spacings.s8;
|
|
25
|
+
return {
|
|
26
|
+
container: {
|
|
27
|
+
flexDirection: 'row',
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
gap,
|
|
30
|
+
},
|
|
31
|
+
textWrapper: {
|
|
32
|
+
flexShrink: 1,
|
|
33
|
+
},
|
|
34
|
+
text: mergeStyles(typography, {
|
|
35
|
+
color: pressed
|
|
36
|
+
? pressedTextColors[appearance]
|
|
37
|
+
: textColors[appearance],
|
|
38
|
+
textDecorationLine: underline ? 'underline' : 'none',
|
|
39
|
+
}),
|
|
40
|
+
icon: {
|
|
41
|
+
flexShrink: 0,
|
|
42
|
+
color: pressed
|
|
43
|
+
? pressedTextColors[appearance]
|
|
44
|
+
: textColors[appearance],
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
}, [appearance, size, underline, pressed]);
|
|
48
|
+
};
|
|
55
49
|
/**
|
|
56
50
|
* A customizable link component that supports base and accent color appearances, optional underline, sizes, icons, and external link handling.
|
|
57
51
|
* Opens URLs using React Native's Linking API.
|
|
@@ -59,7 +53,7 @@ const linkTextVariants = cva('', {
|
|
|
59
53
|
* @see {@link https://ldls.vercel.app/?path=/docs/components-link-overview--docs Storybook}
|
|
60
54
|
* @see {@link https://ldls.vercel.app/?path=/docs/components-link-implementation--docs#dos-and-donts Guidelines}
|
|
61
55
|
*
|
|
62
|
-
* @warning The `
|
|
56
|
+
* @warning The `lx` prop should only be used for layout adjustments like margins or positioning.
|
|
63
57
|
* Do not use it to modify the link's core appearance (colors, padding, etc). Use the `appearance` and `underline` props instead.
|
|
64
58
|
*
|
|
65
59
|
* @example
|
|
@@ -87,13 +81,7 @@ const linkTextVariants = cva('', {
|
|
|
87
81
|
* Dashboard
|
|
88
82
|
* </Link>
|
|
89
83
|
*/
|
|
90
|
-
export const Link = React.forwardRef(({
|
|
91
|
-
const iconSizeMap = {
|
|
92
|
-
sm: 16,
|
|
93
|
-
md: 20,
|
|
94
|
-
};
|
|
95
|
-
const calculatedIconSize = size ? iconSizeMap[size] : 20;
|
|
96
|
-
const IconComponent = icon;
|
|
84
|
+
export const Link = React.forwardRef(({ lx, style, children, appearance = 'base', size = 'md', underline = true, icon, isExternal = false, href, onPress, ...props }, ref) => {
|
|
97
85
|
const handlePress = async () => {
|
|
98
86
|
if (onPress) {
|
|
99
87
|
onPress();
|
|
@@ -102,21 +90,17 @@ export const Link = React.forwardRef(({ className, children, appearance, size, u
|
|
|
102
90
|
await Linking.openURL(href);
|
|
103
91
|
}
|
|
104
92
|
};
|
|
105
|
-
return (_jsx(Pressable, { ref: ref,
|
|
106
|
-
appearance,
|
|
107
|
-
size,
|
|
108
|
-
underline,
|
|
109
|
-
pressed,
|
|
110
|
-
})), size: calculatedIconSize })), _jsx(View, { className: 'shrink', children: _jsx(Text, { numberOfLines: 1, className: linkTextVariants({
|
|
111
|
-
appearance,
|
|
112
|
-
size,
|
|
113
|
-
underline,
|
|
114
|
-
pressed,
|
|
115
|
-
}), children: children }) }), isExternal && (_jsx(ExternalLink, { size: calculatedIconSize, className: cn('flex-shrink-0', linkTextVariants({
|
|
116
|
-
appearance,
|
|
117
|
-
size,
|
|
118
|
-
underline,
|
|
119
|
-
pressed,
|
|
120
|
-
})), accessible: false }))] })) }));
|
|
93
|
+
return (_jsx(Pressable, { ref: ref, lx: lx, style: [style, { flexShrink: 1 }], onPress: handlePress, accessibilityRole: 'link', ...props, children: ({ pressed }) => (_jsx(LinkContent, { appearance: appearance, size: size, underline: underline, pressed: pressed, icon: icon, isExternal: isExternal, children: children })) }));
|
|
121
94
|
});
|
|
95
|
+
const LinkContent = ({ appearance, size, underline, pressed, icon, isExternal, children, }) => {
|
|
96
|
+
const calculatedIconSize = iconSizeMap[size];
|
|
97
|
+
const IconComponent = icon;
|
|
98
|
+
const styles = useStyles({
|
|
99
|
+
appearance,
|
|
100
|
+
size,
|
|
101
|
+
underline,
|
|
102
|
+
pressed,
|
|
103
|
+
});
|
|
104
|
+
return (_jsxs(View, { style: styles.container, testID: 'link-content', children: [IconComponent && (_jsx(IconComponent, { size: calculatedIconSize, style: styles.icon })), _jsx(View, { style: styles.textWrapper, children: _jsx(Text, { style: styles.text, numberOfLines: 1, children: children }) }), isExternal && (_jsx(ExternalLink, { size: calculatedIconSize, style: styles.icon, accessible: false }))] }));
|
|
105
|
+
};
|
|
122
106
|
Link.displayName = 'Link';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Link/Link.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,CA+C3B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAGnC,eAAO,MAAM,IAAI,EAAE,KAkBlB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAsBtB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAsBtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KA0BlC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAwBhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAgB/B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"Link.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Link/Link.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,CA+C3B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAGnC,eAAO,MAAM,IAAI,EAAE,KAkBlB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAsBtB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAsBtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KA0BlC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAwBhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAgB/B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KA2D3B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAkB5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KA8B9B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAyDlC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KA2EzB,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, Information, ArrowRight } from '../../Symbols';
|
|
3
|
+
import { Box, Text } from '../Utility';
|
|
4
4
|
import { Link } from './Link';
|
|
5
5
|
const meta = {
|
|
6
6
|
component: Link,
|
|
@@ -149,20 +149,43 @@ export const AppearanceShowcase = {
|
|
|
149
149
|
{ name: 'Base', appearance: 'base' },
|
|
150
150
|
{ name: 'Accent', appearance: 'accent' },
|
|
151
151
|
];
|
|
152
|
-
return (_jsx(
|
|
152
|
+
return (_jsx(Box, { lx: { flexDirection: 'row', gap: 's32', padding: 's8' }, children: appearances.map(({ name, appearance }) => (_jsx(Link, { size: 'md', appearance: appearance, href: 'https://ledger.com', icon: Information, isExternal: true, children: name }, appearance))) }));
|
|
153
153
|
},
|
|
154
154
|
};
|
|
155
155
|
export const UnderlineShowcase = {
|
|
156
|
-
render: () => (_jsxs(
|
|
156
|
+
render: () => (_jsxs(Box, { lx: { flexDirection: 'column', gap: 's16', padding: 's8' }, children: [_jsx(Link, { appearance: 'accent', size: 'md', href: 'https://ledger.com', children: "With underline" }), _jsx(Link, { appearance: 'accent', size: 'md', underline: false, href: 'https://ledger.com', children: "Without underline" })] })),
|
|
157
157
|
};
|
|
158
158
|
export const SizesShowcase = {
|
|
159
|
-
render: () => (_jsxs(
|
|
159
|
+
render: () => (_jsxs(Box, { lx: { flexDirection: 'column', gap: 's16' }, children: [_jsxs(Box, { lx: {
|
|
160
|
+
flexDirection: 'row',
|
|
161
|
+
alignItems: 'center',
|
|
162
|
+
gap: 's32',
|
|
163
|
+
padding: 's8',
|
|
164
|
+
}, children: [_jsx(Link, { appearance: 'base', size: 'sm', href: 'https://ledger.com', icon: Information, isExternal: true, children: "Small" }), _jsx(Link, { appearance: 'base', size: 'md', href: 'https://ledger.com', icon: Information, isExternal: true, children: "Medium" })] }), _jsxs(Box, { lx: {
|
|
165
|
+
flexDirection: 'row',
|
|
166
|
+
alignItems: 'center',
|
|
167
|
+
gap: 's32',
|
|
168
|
+
padding: 's8',
|
|
169
|
+
}, children: [_jsx(Link, { appearance: 'accent', size: 'sm', href: 'https://ledger.com', icon: Information, isExternal: true, children: "Small Accent" }), _jsx(Link, { appearance: 'accent', size: 'md', href: 'https://ledger.com', icon: Information, isExternal: true, children: "Medium Accent" })] })] })),
|
|
160
170
|
};
|
|
161
171
|
export const StatesShowcase = {
|
|
162
|
-
render: () => (_jsxs(
|
|
172
|
+
render: () => (_jsxs(Box, { lx: {
|
|
173
|
+
flexDirection: 'row',
|
|
174
|
+
alignItems: 'center',
|
|
175
|
+
gap: 's16',
|
|
176
|
+
padding: 's8',
|
|
177
|
+
}, children: [_jsx(Link, { appearance: 'base', href: 'https://ledger.com', children: "Default" }), _jsx(Link, { appearance: 'accent', href: 'https://ledger.com', icon: ArrowRight, children: "With Icon" })] })),
|
|
163
178
|
};
|
|
164
179
|
export const ResponsiveLayout = {
|
|
165
|
-
render: () => (_jsxs(
|
|
180
|
+
render: () => (_jsxs(Box, { lx: {
|
|
181
|
+
width: 's256',
|
|
182
|
+
flexDirection: 'column',
|
|
183
|
+
gap: 's8',
|
|
184
|
+
borderRadius: 'sm',
|
|
185
|
+
borderColor: 'mutedSubtle',
|
|
186
|
+
borderWidth: 's1',
|
|
187
|
+
padding: 's8',
|
|
188
|
+
}, children: [_jsx(Link, { underline: true, href: 'https://ledger.com', children: "Short Link" }), _jsx(Link, { appearance: 'base', href: 'https://ledger.com', children: "This is a longer link text that will be truncated with ellipsis when it exceeds the container width" }), _jsx(Link, { appearance: 'base', href: 'https://ledger.com', icon: Information, isExternal: true, children: "Base with long text that is cut off" })] })),
|
|
166
189
|
};
|
|
167
190
|
export const WithCustomNavigation = {
|
|
168
191
|
render: () => {
|
|
@@ -170,7 +193,7 @@ export const WithCustomNavigation = {
|
|
|
170
193
|
console.log('Custom navigation triggered');
|
|
171
194
|
// In a real app: navigation.navigate('Dashboard')
|
|
172
195
|
};
|
|
173
|
-
return (_jsxs(
|
|
196
|
+
return (_jsxs(Box, { lx: { flexDirection: 'column', gap: 's16', padding: 's8' }, children: [_jsx(Link, { appearance: 'base', size: 'md', onPress: handlePress, children: "Navigate to Dashboard" }), _jsx(Link, { appearance: 'accent', size: 'md', icon: ArrowRight, onPress: handlePress, children: "Continue to Next Screen" })] }));
|
|
174
197
|
},
|
|
175
198
|
parameters: {
|
|
176
199
|
docs: {
|
|
@@ -208,13 +231,13 @@ function MyComponent() {
|
|
|
208
231
|
},
|
|
209
232
|
};
|
|
210
233
|
export const InTextUsage = {
|
|
211
|
-
render: () => (_jsxs(
|
|
234
|
+
render: () => (_jsxs(Box, { lx: { flexDirection: 'column', gap: 's32', padding: 's8' }, children: [_jsxs(Text, { typography: 'body2', lx: { color: 'base' }, children: ["By continuing, you agree to our", ' ', _jsx(Link, { appearance: 'base', size: 'sm', href: 'https://ledger.com/terms', children: "Terms & Conditions" }), ' ', "and", ' ', _jsx(Link, { appearance: 'base', size: 'sm', href: 'https://ledger.com/privacy', children: "Privacy Policy" }), "."] }), _jsxs(Text, { typography: 'body1SemiBold', lx: { color: 'interactive' }, children: ["Need help?", ' ', _jsx(Link, { appearance: 'accent', size: 'md', href: 'https://ledger.com/support', children: "Contact Support" })] }), _jsxs(Text, { typography: 'body1SemiBold', lx: { color: 'base' }, children: ["Already have an account?", ' ', _jsx(Link, { appearance: 'accent', size: 'md', underline: false, href: 'https://ledger.com/signin', children: "Sign in" })] })] })),
|
|
212
235
|
parameters: {
|
|
213
236
|
docs: {
|
|
214
237
|
source: {
|
|
215
238
|
code: `
|
|
216
239
|
// Links within text content
|
|
217
|
-
<Text
|
|
240
|
+
<Text typography='body2' lx={{ color: 'base' }}>
|
|
218
241
|
By continuing, you agree to our{' '}
|
|
219
242
|
<Link appearance='base' size='sm' href='https://ledger.com/terms'>
|
|
220
243
|
Terms & Conditions
|
|
@@ -226,7 +249,7 @@ export const InTextUsage = {
|
|
|
226
249
|
</Text>
|
|
227
250
|
|
|
228
251
|
// Heading with inline link
|
|
229
|
-
<Text
|
|
252
|
+
<Text typography='body1SemiBold' lx={{ color: 'interactive' }}>
|
|
230
253
|
Need help?{' '}
|
|
231
254
|
<Link appearance='accent' size='md' href='https://ledger.com/support'>
|
|
232
255
|
Contact Support
|
|
@@ -234,7 +257,7 @@ export const InTextUsage = {
|
|
|
234
257
|
</Text>
|
|
235
258
|
|
|
236
259
|
// Bold text with ununderlined link
|
|
237
|
-
<Text
|
|
260
|
+
<Text typography='body1SemiBold' lx={{ color: 'base' }}>
|
|
238
261
|
Already have an account?{' '}
|
|
239
262
|
<Link
|
|
240
263
|
appearance='accent'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Link/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Link/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { StyledPressableProps } from '../../../styles';
|
|
4
|
+
import { IconSize } from '../Icon';
|
|
5
|
+
export type LinkProps = {
|
|
6
|
+
/**
|
|
7
|
+
* The visual style of the link.
|
|
8
|
+
* @default base
|
|
9
|
+
*/
|
|
10
|
+
appearance?: 'base' | 'accent';
|
|
11
|
+
/**
|
|
12
|
+
* The size variant of the link.
|
|
13
|
+
* @default md
|
|
14
|
+
*/
|
|
15
|
+
size?: 'sm' | 'md';
|
|
16
|
+
/**
|
|
17
|
+
* Whether to underline the link text.
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
underline?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* An optional icon component to render inside the link.
|
|
23
|
+
* The icon styles are defined by the link. Please do not override them.
|
|
24
|
+
*/
|
|
25
|
+
icon?: React.ComponentType<{
|
|
26
|
+
size?: IconSize;
|
|
27
|
+
style?: StyleProp<ViewStyle>;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* If true, displays an external link icon next to the link text.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
isExternal?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The URL to navigate to
|
|
36
|
+
*/
|
|
37
|
+
href?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Custom press handler (overrides default href navigation)
|
|
40
|
+
*/
|
|
41
|
+
onPress?: () => void;
|
|
42
|
+
} & PropsWithChildren & Omit<StyledPressableProps, 'onPress' | 'children'>;
|
|
43
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Link/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC1C,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,SAAS,GAAG;IACtB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC/B;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QACzB,IAAI,CAAC,EAAE,QAAQ,CAAC;QAChB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KAC9B,CAAC,CAAC;IACH;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,GAAG,iBAAiB,GACnB,IAAI,CAAC,oBAAoB,EAAE,SAAS,GAAG,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,5 +3,10 @@ import { Search } from './Search';
|
|
|
3
3
|
declare const meta: Meta<typeof Search>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof Search>;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const Base: Story;
|
|
7
|
+
export declare const WithContent: Story;
|
|
8
|
+
export declare const WithError: Story;
|
|
9
|
+
export declare const DisabledSearch: Story;
|
|
10
|
+
export declare const WithHiddenClearButton: Story;
|
|
11
|
+
export declare const WithClearCallback: Story;
|
|
7
12
|
//# sourceMappingURL=Search.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Search.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Search/Search.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"Search.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Search/Search.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAC;AAEpD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CA8B7B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAC;AAmBrC,eAAO,MAAM,IAAI,EAAE,KAOlB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAOzB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAQvB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAO5B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,KAOnC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAa/B,CAAC"}
|