@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,10 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
FlexStyle,
|
|
4
|
-
TextStyle,
|
|
5
|
-
ViewProps,
|
|
6
|
-
TextProps,
|
|
7
|
-
} from 'react-native';
|
|
1
|
+
import type { ViewStyle, TextStyle } from 'react-native';
|
|
2
|
+
|
|
8
3
|
import type { LumenStyleSheetTheme } from './theme.types';
|
|
9
4
|
|
|
10
5
|
/**
|
|
@@ -20,7 +15,28 @@ type BorderRadiusToken = keyof LumenStyleSheetTheme['borderRadius'];
|
|
|
20
15
|
type ShadowToken = keyof LumenStyleSheetTheme['shadows'];
|
|
21
16
|
type TypographyToken = keyof LumenStyleSheetTheme['typographies'];
|
|
22
17
|
|
|
23
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Main public types - combine token props with RN props
|
|
20
|
+
*/
|
|
21
|
+
export type LumenViewStyle = {
|
|
22
|
+
/**
|
|
23
|
+
* Flex layout
|
|
24
|
+
*/
|
|
25
|
+
flex?: ViewStyle['flex'];
|
|
26
|
+
flexDirection?: ViewStyle['flexDirection'];
|
|
27
|
+
flexWrap?: ViewStyle['flexWrap'];
|
|
28
|
+
justifyContent?: ViewStyle['justifyContent'];
|
|
29
|
+
alignItems?: ViewStyle['alignItems'];
|
|
30
|
+
alignSelf?: ViewStyle['alignSelf'];
|
|
31
|
+
alignContent?: ViewStyle['alignContent'];
|
|
32
|
+
flexGrow?: ViewStyle['flexGrow'];
|
|
33
|
+
flexShrink?: ViewStyle['flexShrink'];
|
|
34
|
+
flexBasis?: ViewStyle['flexBasis'];
|
|
35
|
+
position?: ViewStyle['position'];
|
|
36
|
+
zIndex?: ViewStyle['zIndex'];
|
|
37
|
+
overflow?: ViewStyle['overflow'];
|
|
38
|
+
display?: ViewStyle['display'];
|
|
39
|
+
aspectRatio?: ViewStyle['aspectRatio'];
|
|
24
40
|
/**
|
|
25
41
|
* Padding
|
|
26
42
|
*/
|
|
@@ -46,33 +62,37 @@ type SpacingProps = {
|
|
|
46
62
|
marginHorizontal?: SpacingToken;
|
|
47
63
|
marginVertical?: SpacingToken;
|
|
48
64
|
/**
|
|
49
|
-
*
|
|
65
|
+
* Position
|
|
66
|
+
*/
|
|
67
|
+
top?: SpacingToken;
|
|
68
|
+
bottom?: SpacingToken;
|
|
69
|
+
left?: SpacingToken;
|
|
70
|
+
right?: SpacingToken;
|
|
71
|
+
start?: SpacingToken;
|
|
72
|
+
end?: SpacingToken;
|
|
73
|
+
/**
|
|
74
|
+
* Gap
|
|
50
75
|
*/
|
|
51
76
|
gap?: SpacingToken;
|
|
52
77
|
rowGap?: SpacingToken;
|
|
53
78
|
columnGap?: SpacingToken;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
* Size props - use size tokens only
|
|
58
|
-
*/
|
|
59
|
-
type SizeProps = {
|
|
79
|
+
/**
|
|
80
|
+
* Size
|
|
81
|
+
*/
|
|
60
82
|
width?: SizeToken;
|
|
61
83
|
height?: SizeToken;
|
|
62
84
|
minWidth?: SizeToken;
|
|
63
85
|
minHeight?: SizeToken;
|
|
64
86
|
maxWidth?: SizeToken;
|
|
65
87
|
maxHeight?: SizeToken;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
* Background color props - use background color tokens only
|
|
70
|
-
*/
|
|
71
|
-
type BackgroundColorProps = {
|
|
88
|
+
/**
|
|
89
|
+
* Background color
|
|
90
|
+
*/
|
|
72
91
|
backgroundColor?: BackgroundColorToken;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
92
|
+
/**
|
|
93
|
+
* Shadow
|
|
94
|
+
*/
|
|
95
|
+
boxShadow?: ShadowToken;
|
|
76
96
|
/**
|
|
77
97
|
* Border width
|
|
78
98
|
*/
|
|
@@ -93,7 +113,6 @@ type BorderProps = {
|
|
|
93
113
|
borderRightColor?: BorderColorToken;
|
|
94
114
|
borderStartColor?: BorderColorToken;
|
|
95
115
|
borderEndColor?: BorderColorToken;
|
|
96
|
-
|
|
97
116
|
/**
|
|
98
117
|
* Border Radius
|
|
99
118
|
*/
|
|
@@ -102,91 +121,40 @@ type BorderProps = {
|
|
|
102
121
|
borderTopRightRadius?: BorderRadiusToken;
|
|
103
122
|
borderBottomLeftRadius?: BorderRadiusToken;
|
|
104
123
|
borderBottomRightRadius?: BorderRadiusToken;
|
|
124
|
+
/**
|
|
125
|
+
* Other styles
|
|
126
|
+
*/
|
|
127
|
+
opacity?: ViewStyle['opacity'];
|
|
128
|
+
borderStyle?: ViewStyle['borderStyle'];
|
|
129
|
+
transform?: ViewStyle['transform'];
|
|
105
130
|
};
|
|
106
131
|
|
|
107
|
-
|
|
108
|
-
* Shadow props - use shadow tokens
|
|
109
|
-
*/
|
|
110
|
-
type ShadowProps = {
|
|
111
|
-
boxShadow?: ShadowToken;
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Flex layout props - passthrough from React Native
|
|
116
|
-
*/
|
|
117
|
-
type FlexLayoutProps = Pick<
|
|
118
|
-
FlexStyle,
|
|
119
|
-
| 'flex'
|
|
120
|
-
| 'flexDirection'
|
|
121
|
-
| 'flexWrap'
|
|
122
|
-
| 'justifyContent'
|
|
123
|
-
| 'alignItems'
|
|
124
|
-
| 'alignSelf'
|
|
125
|
-
| 'alignContent'
|
|
126
|
-
| 'flexGrow'
|
|
127
|
-
| 'flexShrink'
|
|
128
|
-
| 'flexBasis'
|
|
129
|
-
| 'position'
|
|
130
|
-
| 'top'
|
|
131
|
-
| 'bottom'
|
|
132
|
-
| 'left'
|
|
133
|
-
| 'right'
|
|
134
|
-
| 'start'
|
|
135
|
-
| 'end'
|
|
136
|
-
| 'zIndex'
|
|
137
|
-
| 'overflow'
|
|
138
|
-
| 'display'
|
|
139
|
-
| 'aspectRatio'
|
|
140
|
-
>;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Other view style props - passthrough from React Native
|
|
144
|
-
*/
|
|
145
|
-
type OtherViewStyleProps = Pick<
|
|
146
|
-
ViewStyle,
|
|
147
|
-
'opacity' | 'borderStyle' | 'transform'
|
|
148
|
-
>;
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Text color props - use text color tokens only
|
|
152
|
-
*/
|
|
153
|
-
type TextColorProps = {
|
|
132
|
+
export type LumenTextStyle = LumenViewStyle & {
|
|
154
133
|
color?: TextColorToken;
|
|
134
|
+
typography?: TypographyToken;
|
|
135
|
+
textAlign?: TextStyle['textAlign'];
|
|
136
|
+
textTransform?: TextStyle['textTransform'];
|
|
137
|
+
textDecorationLine?: TextStyle['textDecorationLine'];
|
|
155
138
|
};
|
|
156
139
|
|
|
157
|
-
/**
|
|
158
|
-
* Typography prop
|
|
159
|
-
*/
|
|
160
|
-
type TypographyProps = {
|
|
161
|
-
typo?: TypographyToken;
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Text style props - passthrough from React Native
|
|
166
|
-
*/
|
|
167
|
-
type OtherTextStyleProps = Pick<
|
|
168
|
-
TextStyle,
|
|
169
|
-
'textAlign' | 'textTransform' | 'textDecorationLine'
|
|
170
|
-
>;
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Main public types - combine token props with RN props
|
|
174
|
-
*/
|
|
175
|
-
export type LumenViewStyleProps = SpacingProps &
|
|
176
|
-
SizeProps &
|
|
177
|
-
BackgroundColorProps &
|
|
178
|
-
BorderProps &
|
|
179
|
-
ShadowProps &
|
|
180
|
-
FlexLayoutProps &
|
|
181
|
-
OtherViewStyleProps;
|
|
182
|
-
|
|
183
|
-
export type LumenTextStyleProps = LumenViewStyleProps &
|
|
184
|
-
TextColorProps &
|
|
185
|
-
TypographyProps &
|
|
186
|
-
OtherTextStyleProps;
|
|
187
|
-
|
|
188
140
|
/**
|
|
189
141
|
* Derived style-only types (for internal resolver use)
|
|
190
142
|
*/
|
|
191
|
-
export type
|
|
192
|
-
|
|
143
|
+
export type LumenViewStyleLX = {
|
|
144
|
+
/**
|
|
145
|
+
* Support LX property - [see documentation](/?path=/docs/style-system-lx--docs).
|
|
146
|
+
*/
|
|
147
|
+
lx?: LumenViewStyle;
|
|
148
|
+
};
|
|
149
|
+
export type LumenPressableStyleLX = {
|
|
150
|
+
/**
|
|
151
|
+
* Support LX property - [see documentation](/?path=/docs/style-system-lx--docs).
|
|
152
|
+
*/
|
|
153
|
+
lx?: LumenViewStyle;
|
|
154
|
+
};
|
|
155
|
+
export type LumenTextStyleLX = {
|
|
156
|
+
/**
|
|
157
|
+
* Support LX property - [see documentation](/?path=/docs/style-system-lx--docs).
|
|
158
|
+
*/
|
|
159
|
+
lx?: LumenTextStyle;
|
|
160
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './mergeStyles';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { describe, it, expect } from '@jest/globals';
|
|
2
|
+
|
|
3
|
+
import { mergeStyles } from './mergeStyles';
|
|
4
|
+
|
|
5
|
+
describe('mergeStyles', () => {
|
|
6
|
+
it('should return empty object when no styles provided', () => {
|
|
7
|
+
expect(mergeStyles()).toEqual({});
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('should merge multiple style objects', () => {
|
|
11
|
+
expect(
|
|
12
|
+
mergeStyles({ padding: 16 }, { margin: 8 }, { borderRadius: 4 }),
|
|
13
|
+
).toEqual({
|
|
14
|
+
padding: 16,
|
|
15
|
+
margin: 8,
|
|
16
|
+
borderRadius: 4,
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should filter out falsy values', () => {
|
|
21
|
+
expect(
|
|
22
|
+
mergeStyles({ padding: 16 }, false, null, undefined, { margin: 8 }),
|
|
23
|
+
).toEqual({
|
|
24
|
+
padding: 16,
|
|
25
|
+
margin: 8,
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('should override earlier styles with later ones', () => {
|
|
30
|
+
expect(
|
|
31
|
+
mergeStyles({ padding: 16, margin: 8 }, { padding: 24 }, { padding: 32 }),
|
|
32
|
+
).toEqual({
|
|
33
|
+
padding: 32,
|
|
34
|
+
margin: 8,
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('should work with && conditional pattern', () => {
|
|
39
|
+
const disabled = true;
|
|
40
|
+
expect(mergeStyles({ padding: 16 }, disabled && { opacity: 0.5 })).toEqual({
|
|
41
|
+
padding: 16,
|
|
42
|
+
opacity: 0.5,
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ImageStyle, TextStyle, ViewStyle } from 'react-native';
|
|
2
|
+
|
|
3
|
+
type StyleValue = ViewStyle & TextStyle & ImageStyle;
|
|
4
|
+
type StyleInput = StyleValue | false | null | undefined;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Merges multiple style objects, filtering out falsy values.
|
|
8
|
+
* Use with conditional expressions for variant-based styling.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const style = mergeStyles(
|
|
12
|
+
* baseStyle,
|
|
13
|
+
* disabled && disabledStyle,
|
|
14
|
+
* );
|
|
15
|
+
*/
|
|
16
|
+
export const mergeStyles = (...styles: StyleInput[]): StyleValue => {
|
|
17
|
+
const result: StyleValue = {};
|
|
18
|
+
for (let i = 0; i < styles.length; i++) {
|
|
19
|
+
const style = styles[i];
|
|
20
|
+
if (style) {
|
|
21
|
+
Object.assign(result, style);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { Meta } from '@storybook/addon-docs/blocks';
|
|
2
|
-
|
|
3
|
-
<Meta title="Getting Started/Style System" />
|
|
4
|
-
|
|
5
|
-
# Style System
|
|
6
|
-
|
|
7
|
-
The Ledger Design System provides `LumenStyleSheet` for creating theme-aware styles in React Native.
|
|
8
|
-
|
|
9
|
-
## LumenStyleSheet.useCreate
|
|
10
|
-
|
|
11
|
-
Use `LumenStyleSheet.useCreate` to create styles that automatically adapt to the current theme (light/dark mode).
|
|
12
|
-
|
|
13
|
-
```tsx
|
|
14
|
-
import { LumenStyleSheet } from '@ledgerhq/lumen-ui-rnative/styles';
|
|
15
|
-
import { View, Text } from 'react-native';
|
|
16
|
-
|
|
17
|
-
const MyComponent = () => {
|
|
18
|
-
const styles = LumenStyleSheet.useCreate((theme) => ({
|
|
19
|
-
container: {
|
|
20
|
-
backgroundColor: theme.colors.bg.base,
|
|
21
|
-
padding: theme.spacings.s16,
|
|
22
|
-
borderRadius: theme.borderRadius.md,
|
|
23
|
-
},
|
|
24
|
-
text: {
|
|
25
|
-
...theme.typographies.body1,
|
|
26
|
-
color: theme.colors.text.base,
|
|
27
|
-
},
|
|
28
|
-
}));
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<View style={styles.container}>
|
|
32
|
-
<Text style={styles.text}>Hello World</Text>
|
|
33
|
-
</View>
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## Dynamic Styles
|
|
39
|
-
|
|
40
|
-
Create dynamic style functions that adapt to props or state:
|
|
41
|
-
|
|
42
|
-
```tsx
|
|
43
|
-
import { LumenStyleSheet } from '@ledgerhq/lumen-ui-rnative/styles';
|
|
44
|
-
import { View, Text } from 'react-native';
|
|
45
|
-
|
|
46
|
-
const Button = ({ appearance, disabled }) => {
|
|
47
|
-
const styles = LumenStyleSheet.useCreate((theme) => {
|
|
48
|
-
const getBackgroundColor = () => {
|
|
49
|
-
if (disabled) return theme.colors.bg.muted;
|
|
50
|
-
if (appearance === 'accent') return theme.colors.bg.accent;
|
|
51
|
-
return theme.colors.bg.base;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
return {
|
|
55
|
-
button: {
|
|
56
|
-
backgroundColor: getBackgroundColor(),
|
|
57
|
-
padding: theme.spacings.s16,
|
|
58
|
-
opacity: disabled ? 0.5 : 1,
|
|
59
|
-
},
|
|
60
|
-
text: {
|
|
61
|
-
...theme.typographies.body2,
|
|
62
|
-
color: appearance === 'accent'
|
|
63
|
-
? theme.colors.text.onAccent
|
|
64
|
-
: theme.colors.text.base,
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
return (
|
|
70
|
-
<View style={styles.button}>
|
|
71
|
-
<Text style={styles.text}>Press me</Text>
|
|
72
|
-
</View>
|
|
73
|
-
);
|
|
74
|
-
};
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## Theme Integration
|
|
78
|
-
|
|
79
|
-
`LumenStyleSheet.useCreate` automatically receives the current theme from the [ThemeProvider](/docs/getting-started-theme--docs).
|
|
80
|
-
When the theme mode changes (light/dark), your styles update automatically.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
## Theme Tokens Reference
|
|
84
|
-
|
|
85
|
-
### Typographies
|
|
86
|
-
|
|
87
|
-
Typography semantic tokens are available in the theme.
|
|
88
|
-
It provides a preset of font size, weight, line height and letter spacing.
|
|
89
|
-
|
|
90
|
-
```tsx
|
|
91
|
-
const styles = LumenStyleSheet.useCreate((theme) => ({
|
|
92
|
-
title: {
|
|
93
|
-
alignItems: 'center',
|
|
94
|
-
...theme.typographies.heading1
|
|
95
|
-
},
|
|
96
|
-
body: {
|
|
97
|
-
flex: 1,
|
|
98
|
-
...theme.typographies.body1
|
|
99
|
-
},
|
|
100
|
-
}));
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Spacing
|
|
104
|
-
|
|
105
|
-
Use for width, height, padding, margin, and gap.
|
|
106
|
-
|
|
107
|
-
```tsx
|
|
108
|
-
const styles = LumenStyleSheet.useCreate((theme) => ({
|
|
109
|
-
container: {
|
|
110
|
-
padding: theme.spacings.s16,
|
|
111
|
-
marginBottom: theme.spacings.s24,
|
|
112
|
-
gap: theme.spacings.s8,
|
|
113
|
-
},
|
|
114
|
-
}));
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### Colors & Shadows
|
|
118
|
-
|
|
119
|
-
Apply semantic colors for backgrounds, text, borders, and elevation.
|
|
120
|
-
|
|
121
|
-
```tsx
|
|
122
|
-
const styles = LumenStyleSheet.useCreate((theme) => ({
|
|
123
|
-
card: {
|
|
124
|
-
backgroundColor: theme.colors.bg.surface,
|
|
125
|
-
borderColor: theme.colors.border.base,
|
|
126
|
-
...theme.shadows.md,
|
|
127
|
-
},
|
|
128
|
-
label: {
|
|
129
|
-
color: theme.colors.text.muted,
|
|
130
|
-
},
|
|
131
|
-
}));
|
|
132
|
-
```
|
|
133
|
-
|