@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,7 +1,10 @@
|
|
|
1
1
|
import { Svg } from 'react-native-svg';
|
|
2
|
+
import { IconSize } from './types';
|
|
2
3
|
export declare const Icon: import("react").ForwardRefExoticComponent<{
|
|
3
|
-
size?:
|
|
4
|
-
|
|
4
|
+
size?: IconSize;
|
|
5
|
+
style?: import("react-native").StyleProp<import("react-native").ViewStyle & {
|
|
6
|
+
color?: string;
|
|
7
|
+
}>;
|
|
5
8
|
children: React.ReactNode;
|
|
6
|
-
} & import("react-native-svg").SvgProps & import("react").RefAttributes<Svg>>;
|
|
9
|
+
} & Omit<import("react-native-svg").SvgProps, "style"> & import("react").RefAttributes<Svg>>;
|
|
7
10
|
//# sourceMappingURL=Icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Icon/Icon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Icon/Icon.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEvC,OAAO,EAAa,QAAQ,EAAE,MAAM,SAAS,CAAC;AAwB9C,eAAO,MAAM,IAAI;;;aAZD,CAAA;;;4FAiCf,CAAC"}
|
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { forwardRef } from 'react';
|
|
2
|
+
import { forwardRef, useMemo } from 'react';
|
|
3
|
+
import { StyleSheet } from 'react-native';
|
|
5
4
|
import { Svg } from 'react-native-svg';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return (_jsx(Svg, { ref: ref, width:
|
|
5
|
+
import { LumenStyleSheet } from '../../../styles';
|
|
6
|
+
const iconSizeMap = {
|
|
7
|
+
12: 's12',
|
|
8
|
+
16: 's16',
|
|
9
|
+
20: 's20',
|
|
10
|
+
24: 's24',
|
|
11
|
+
40: 's40',
|
|
12
|
+
48: 's48',
|
|
13
|
+
56: 's56',
|
|
14
|
+
};
|
|
15
|
+
const useStyles = (size) => {
|
|
16
|
+
const { theme } = LumenStyleSheet.useTheme();
|
|
17
|
+
return useMemo(() => ({
|
|
18
|
+
width: theme.icon.width[iconSizeMap[size]],
|
|
19
|
+
height: theme.icon.height[iconSizeMap[size]],
|
|
20
|
+
strokeWidth: theme.icon.borderWidth[iconSizeMap[size]],
|
|
21
|
+
}), [size, theme]);
|
|
22
|
+
};
|
|
23
|
+
export const Icon = forwardRef(({ size = 24, style, children, viewBox, ...props }, ref) => {
|
|
24
|
+
const styles = useStyles(size);
|
|
25
|
+
const flatStyle = StyleSheet.flatten(style);
|
|
26
|
+
return (_jsx(Svg, { ref: ref, width: styles.width, height: styles.height, strokeWidth: styles.strokeWidth, viewBox: viewBox, color: flatStyle?.color ?? 'currentColor', fill: 'none', pointerEvents: 'none', ...props, children: children }));
|
|
28
27
|
});
|
|
29
28
|
Icon.displayName = 'Icon';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
|
|
2
2
|
import * as Icons from '../../Symbols';
|
|
3
|
-
import { IconSize } from './
|
|
3
|
+
import type { IconSize } from './types';
|
|
4
4
|
declare const meta: Meta;
|
|
5
5
|
export default meta;
|
|
6
6
|
type IconName = keyof typeof Icons;
|
|
7
7
|
type IconStoryProps = {
|
|
8
8
|
size: IconSize;
|
|
9
9
|
name: IconName;
|
|
10
|
-
|
|
10
|
+
color?: string;
|
|
11
11
|
};
|
|
12
12
|
export declare const Icon: StoryObj<IconStoryProps>;
|
|
13
13
|
export declare const IconSizes: StoryObj;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Icon/Icon.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"Icon.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Icon/Icon.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAIvE,OAAO,KAAK,KAAK,MAAM,eAAe,CAAC;AAGvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,QAAA,MAAM,IAAI,EAAE,IAEX,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,KAAK,QAAQ,GAAG,MAAM,OAAO,KAAK,CAAC;AAGnC,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAoEF,eAAO,MAAM,IAAI,EAAE,QAAQ,CAAC,cAAc,CA4CzC,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,QA0CvB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,QA+ErB,CAAC"}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { LumenStyleSheet } from '../../../styles';
|
|
3
5
|
import * as Icons from '../../Symbols';
|
|
4
6
|
import { Search } from '../Search/Search';
|
|
7
|
+
import { Box, Text, Pressable } from '../Utility';
|
|
5
8
|
const meta = {
|
|
6
9
|
title: 'Symbols/Interface Icons',
|
|
7
10
|
};
|
|
8
11
|
export default meta;
|
|
9
12
|
const sizes = [12, 16, 20, 24, 40, 48, 56];
|
|
10
13
|
const iconNames = Object.keys(Icons);
|
|
11
|
-
const IconCard = ({ name, size = 24,
|
|
14
|
+
const IconCard = ({ name, size = 24, color }) => {
|
|
15
|
+
const { theme } = LumenStyleSheet.useTheme();
|
|
12
16
|
const [copied, setCopied] = useState(false);
|
|
13
17
|
const IconComponent = Icons[name];
|
|
18
|
+
const iconColor = color ?? theme.colors.text.base;
|
|
14
19
|
const handleClick = async () => {
|
|
15
20
|
try {
|
|
16
21
|
await navigator.clipboard.writeText(name);
|
|
@@ -21,13 +26,32 @@ const IconCard = ({ name, size = 24, className = 'text-base', }) => {
|
|
|
21
26
|
console.error('Failed to copy:', err);
|
|
22
27
|
}
|
|
23
28
|
};
|
|
24
|
-
return (_jsxs(
|
|
29
|
+
return (_jsxs(Pressable, { onPress: handleClick, lx: {
|
|
30
|
+
position: 'relative',
|
|
31
|
+
flexDirection: 'column',
|
|
32
|
+
alignItems: 'center',
|
|
33
|
+
gap: 's8',
|
|
34
|
+
borderRadius: 'sm',
|
|
35
|
+
padding: 's16',
|
|
36
|
+
width: 's144',
|
|
37
|
+
}, style: ({ pressed }) => ({
|
|
38
|
+
backgroundColor: pressed ? theme.colors.bg.mutedPressed : 'transparent',
|
|
39
|
+
}), children: [_jsx(IconComponent, { size: size, style: { color: iconColor } }), _jsx(Text, { typography: 'body4', lx: { color: 'muted' }, children: name }), copied && (_jsx(View, { style: {
|
|
40
|
+
position: 'absolute',
|
|
41
|
+
top: 0,
|
|
42
|
+
left: 0,
|
|
43
|
+
right: 0,
|
|
44
|
+
bottom: 0,
|
|
45
|
+
alignItems: 'center',
|
|
46
|
+
justifyContent: 'center',
|
|
47
|
+
borderRadius: theme.borderRadius.sm,
|
|
48
|
+
backgroundColor: theme.colors.bg.muted,
|
|
49
|
+
}, children: _jsx(Text, { typography: 'body4', lx: { color: 'onAccent' }, children: "Copied!" }) }))] }, name));
|
|
25
50
|
};
|
|
26
51
|
export const Icon = {
|
|
27
52
|
args: {
|
|
28
53
|
size: 24,
|
|
29
54
|
name: 'Home',
|
|
30
|
-
className: 'text-base',
|
|
31
55
|
},
|
|
32
56
|
argTypes: {
|
|
33
57
|
size: {
|
|
@@ -40,45 +64,75 @@ export const Icon = {
|
|
|
40
64
|
options: iconNames,
|
|
41
65
|
description: 'The name of the icon to display',
|
|
42
66
|
},
|
|
43
|
-
|
|
44
|
-
control: '
|
|
45
|
-
description: '
|
|
67
|
+
color: {
|
|
68
|
+
control: 'color',
|
|
69
|
+
description: 'The color of the icon',
|
|
46
70
|
},
|
|
47
71
|
},
|
|
48
72
|
render: (args) => {
|
|
73
|
+
const { theme } = LumenStyleSheet.useTheme();
|
|
49
74
|
const IconComponent = Icons[args.name];
|
|
50
|
-
|
|
75
|
+
const iconColor = args.color ?? theme.colors.text.base;
|
|
76
|
+
return (_jsx(Box, { lx: { padding: 's8' }, children: _jsxs(Box, { lx: { flexDirection: 'column', alignItems: 'center', gap: 's4' }, children: [_jsx(IconComponent, { size: args.size, style: { color: iconColor } }), _jsx(Text, { lx: { color: 'base' }, children: args.name })] }) }));
|
|
51
77
|
},
|
|
52
78
|
parameters: {
|
|
53
79
|
docs: {
|
|
54
80
|
source: {
|
|
55
81
|
code: `
|
|
56
|
-
<Information size={24}
|
|
82
|
+
<Information size={24} style={{ color: theme.colors.text.base }} />
|
|
57
83
|
`,
|
|
58
84
|
},
|
|
59
85
|
},
|
|
60
86
|
},
|
|
61
87
|
};
|
|
62
88
|
export const IconSizes = {
|
|
63
|
-
render: () =>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
89
|
+
render: () => {
|
|
90
|
+
const { theme } = LumenStyleSheet.useTheme();
|
|
91
|
+
return (_jsx(Box, { lx: { flexDirection: 'column', gap: 's16' }, children: sizes.map((size) => (_jsxs(Box, { lx: { flexDirection: 'column' }, children: [_jsxs(Text, { typography: 'heading3', lx: { marginBottom: 's16' }, children: ["Size ", size, "px"] }), _jsx(Box, { lx: {
|
|
92
|
+
flexDirection: 'row',
|
|
93
|
+
flexWrap: 'wrap',
|
|
94
|
+
gap: 's16',
|
|
95
|
+
borderRadius: 'sm',
|
|
96
|
+
padding: 's16',
|
|
97
|
+
}, style: {
|
|
98
|
+
borderWidth: 1,
|
|
99
|
+
borderColor: theme.colors.border.mutedSubtle,
|
|
100
|
+
}, children: [
|
|
101
|
+
'Home',
|
|
102
|
+
'Settings',
|
|
103
|
+
'Heart',
|
|
104
|
+
'Star',
|
|
105
|
+
'ArrowDown',
|
|
106
|
+
'ArrowLeft',
|
|
107
|
+
'ArrowRight',
|
|
108
|
+
'ArrowUp',
|
|
109
|
+
].map((iconName) => (_jsx(IconCard, { name: iconName, size: size }, iconName))) })] }, size))) }));
|
|
110
|
+
},
|
|
73
111
|
};
|
|
74
112
|
export const Gallery = {
|
|
75
113
|
parameters: {
|
|
76
114
|
layout: 'fullscreen',
|
|
77
115
|
},
|
|
78
116
|
render: () => {
|
|
117
|
+
const { theme } = LumenStyleSheet.useTheme();
|
|
79
118
|
const [searchTerm, setSearchTerm] = useState('');
|
|
80
119
|
// Filter icons based on search term
|
|
81
120
|
const filteredIcons = Object.entries(Icons).filter(([name]) => name.toLowerCase().includes(searchTerm.toLowerCase()));
|
|
82
|
-
return (_jsxs(
|
|
121
|
+
return (_jsxs(Box, { lx: {
|
|
122
|
+
width: 'full',
|
|
123
|
+
flexDirection: 'column',
|
|
124
|
+
alignItems: 'stretch',
|
|
125
|
+
padding: 's8',
|
|
126
|
+
}, children: [_jsxs(Box, { lx: { marginBottom: 's32' }, children: [_jsx(Box, { lx: { marginBottom: 's8', maxWidth: 's320' }, children: _jsx(Search, { placeholder: 'Search icons...', value: searchTerm, onChangeText: setSearchTerm }) }), _jsx(Box, { lx: { marginBottom: 's4' }, children: _jsxs(Text, { typography: 'body3', lx: { marginLeft: 's8', color: 'muted' }, children: [filteredIcons.length, " of ", Object.keys(Icons).length, " icons", searchTerm && ` matching "${searchTerm}"`] }) })] }), _jsx(Box, { lx: { flexDirection: 'row', flexWrap: 'wrap', gap: 's8' }, children: filteredIcons.map(([name]) => (_jsx(IconCard, { name: name }, name))) }), filteredIcons.length === 0 && searchTerm && (_jsxs(Box, { lx: {
|
|
127
|
+
flexDirection: 'column',
|
|
128
|
+
alignItems: 'center',
|
|
129
|
+
justifyContent: 'center',
|
|
130
|
+
paddingVertical: 's16',
|
|
131
|
+
}, children: [_jsxs(Text, { typography: 'body2', lx: { color: 'muted' }, children: ["No icons found matching \"", searchTerm, "\""] }), _jsx(Pressable, { onPress: () => setSearchTerm(''), style: ({ pressed }) => ({
|
|
132
|
+
marginTop: 16,
|
|
133
|
+
color: pressed
|
|
134
|
+
? theme.colors.text.interactivePressed
|
|
135
|
+
: theme.colors.text.interactive,
|
|
136
|
+
}), children: _jsx(Text, { typography: 'body2', lx: { color: 'interactive' }, children: "Clear search" }) })] }))] }));
|
|
83
137
|
},
|
|
84
138
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createIcon.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Icon/createIcon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"createIcon.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Icon/createIcon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC;;;;;GAKG;AACH,QAAA,MAAM,UAAU,GACd,UAAU,MAAM,EAChB,SAAS,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,4FAetC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -8,9 +8,8 @@ import { Icon } from './Icon';
|
|
|
8
8
|
* @returns {ForwardRefExoticComponent} Icon component
|
|
9
9
|
*/
|
|
10
10
|
const createIcon = (iconName, iconJsx) => {
|
|
11
|
-
const Component = forwardRef(({
|
|
11
|
+
const Component = forwardRef(({ ...props }, ref) => React.createElement(Icon, {
|
|
12
12
|
ref,
|
|
13
|
-
className,
|
|
14
13
|
viewBox: iconJsx.props.viewBox,
|
|
15
14
|
...props,
|
|
16
15
|
children: iconJsx.props.children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Icon/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Icon/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './Icon';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './types';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
1
2
|
import { SvgProps } from 'react-native-svg';
|
|
2
3
|
export type IconSize = 12 | 16 | 20 | 24 | 40 | 48 | 56;
|
|
3
4
|
export type IconProps = {
|
|
@@ -6,12 +7,14 @@ export type IconProps = {
|
|
|
6
7
|
*/
|
|
7
8
|
size?: IconSize;
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
+
* Style object to apply to the icon (supports color via color property).
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
style?: StyleProp<ViewStyle & {
|
|
13
|
+
color?: string;
|
|
14
|
+
}>;
|
|
12
15
|
/**
|
|
13
16
|
* The children of the icon.
|
|
14
17
|
*/
|
|
15
18
|
children: React.ReactNode;
|
|
16
|
-
} & SvgProps
|
|
17
|
-
//# sourceMappingURL=
|
|
19
|
+
} & Omit<SvgProps, 'style'>;
|
|
20
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Icon/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,MAAM,QAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAExD,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,GAAG;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClD;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -1,23 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BaseButtonProps } from '../Button';
|
|
3
|
-
export type IconButtonProps = {
|
|
4
|
-
/**
|
|
5
|
-
* Accessible label for the IconButton
|
|
6
|
-
*/
|
|
7
|
-
accessibilityLabel: string;
|
|
8
|
-
/**
|
|
9
|
-
* The icon to display in the button
|
|
10
|
-
*/
|
|
11
|
-
icon: NonNullable<BaseButtonProps['icon']>;
|
|
12
|
-
} & Omit<BaseButtonProps, 'isFull'>;
|
|
13
2
|
export declare const IconButton: React.ForwardRefExoticComponent<{
|
|
14
|
-
/**
|
|
15
|
-
* Accessible label for the IconButton
|
|
16
|
-
*/
|
|
17
3
|
accessibilityLabel: string;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*/
|
|
21
|
-
icon: NonNullable<BaseButtonProps["icon"]>;
|
|
22
|
-
} & Omit<BaseButtonProps, "isFull"> & React.RefAttributes<import("react-native").View>>;
|
|
4
|
+
icon: NonNullable<import("..").BaseButtonProps["icon"]>;
|
|
5
|
+
} & Omit<import("..").BaseButtonProps, "isFull"> & React.RefAttributes<import("react-native").View>>;
|
|
23
6
|
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/IconButton/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/IconButton/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,UAAU;;;oGAKrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/IconButton/IconButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"IconButton.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/IconButton/IconButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAU1C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAyCjC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAC;AAEzC,eAAO,MAAM,IAAI,EAAE,KAOlB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAmBhC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAyB3B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAoB5B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Close, Heart, Plus, Settings, Share } from '../../Symbols';
|
|
3
|
+
import { Box } from '../Utility';
|
|
3
4
|
import { IconButton } from './IconButton';
|
|
4
5
|
const iconMap = {
|
|
5
6
|
Heart,
|
|
@@ -11,9 +12,6 @@ const iconMap = {
|
|
|
11
12
|
const meta = {
|
|
12
13
|
title: 'Action/IconButton',
|
|
13
14
|
component: IconButton,
|
|
14
|
-
parameters: {
|
|
15
|
-
layout: 'centered',
|
|
16
|
-
},
|
|
17
15
|
argTypes: {
|
|
18
16
|
icon: {
|
|
19
17
|
options: Object.keys(iconMap),
|
|
@@ -21,11 +19,11 @@ const meta = {
|
|
|
21
19
|
control: {
|
|
22
20
|
type: 'select',
|
|
23
21
|
labels: {
|
|
24
|
-
Heart: '
|
|
25
|
-
Plus: '
|
|
26
|
-
Settings: '
|
|
27
|
-
Share: '
|
|
28
|
-
Close: '
|
|
22
|
+
Heart: 'Heart',
|
|
23
|
+
Plus: 'Plus',
|
|
24
|
+
Settings: 'Settings',
|
|
25
|
+
Share: 'Share',
|
|
26
|
+
Close: 'Close',
|
|
29
27
|
},
|
|
30
28
|
},
|
|
31
29
|
},
|
|
@@ -63,14 +61,14 @@ export const Base = {
|
|
|
63
61
|
},
|
|
64
62
|
};
|
|
65
63
|
export const AppearanceShowcase = {
|
|
66
|
-
render: () => (_jsxs(
|
|
64
|
+
render: () => (_jsxs(Box, { lx: { flexDirection: 'row', gap: 's8' }, children: [_jsx(IconButton, { accessibilityLabel: 'Add', icon: Plus, appearance: 'accent' }), _jsx(IconButton, { accessibilityLabel: 'Add', icon: Plus, appearance: 'base' }), _jsx(IconButton, { accessibilityLabel: 'Add', icon: Plus, appearance: 'gray' }), _jsx(IconButton, { accessibilityLabel: 'Add', icon: Plus, appearance: 'transparent' }), _jsx(IconButton, { accessibilityLabel: 'Add', icon: Plus, appearance: 'no-background' }), _jsx(IconButton, { accessibilityLabel: 'Add', icon: Plus, appearance: 'red' })] })),
|
|
67
65
|
};
|
|
68
66
|
export const SizesShowcase = {
|
|
69
|
-
render: () => (_jsxs(
|
|
67
|
+
render: () => (_jsxs(Box, { lx: { flexDirection: 'row', alignItems: 'center', gap: 's8' }, children: [_jsx(IconButton, { accessibilityLabel: 'Add to favorites', icon: Heart, size: 'xs' }), _jsx(IconButton, { accessibilityLabel: 'Add to favorites', icon: Heart, size: 'sm' }), _jsx(IconButton, { accessibilityLabel: 'Add to favorites', icon: Heart, size: 'md' }), _jsx(IconButton, { accessibilityLabel: 'Add to favorites', icon: Heart, size: 'lg' })] })),
|
|
70
68
|
};
|
|
71
69
|
export const StatesShowcase = {
|
|
72
70
|
args: {
|
|
73
71
|
appearance: 'base',
|
|
74
72
|
},
|
|
75
|
-
render: ({ appearance }) => (_jsxs(
|
|
73
|
+
render: ({ appearance }) => (_jsxs(Box, { lx: { flexDirection: 'row', alignItems: 'flex-start', gap: 's8' }, children: [_jsx(IconButton, { accessibilityLabel: 'Settings', appearance: appearance, icon: Settings, disabled: true }), _jsx(IconButton, { accessibilityLabel: 'Settings', appearance: appearance, icon: Settings, loading: true })] })),
|
|
76
74
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/IconButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/IconButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseButtonProps } from '../Button';
|
|
2
|
+
export type IconButtonProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Accessible label for the IconButton
|
|
5
|
+
*/
|
|
6
|
+
accessibilityLabel: string;
|
|
7
|
+
/**
|
|
8
|
+
* The icon to display in the button
|
|
9
|
+
*/
|
|
10
|
+
icon: NonNullable<BaseButtonProps['icon']>;
|
|
11
|
+
} & Omit<BaseButtonProps, 'isFull'>;
|
|
12
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/IconButton/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,IAAI,EAAE,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;CAC5C,GAAG,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -20,12 +20,12 @@ import { InteractiveIconProps } from './types';
|
|
|
20
20
|
* import { DeleteCircleFill, Settings } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
21
21
|
*
|
|
22
22
|
* // Filled interactive icon for destructive actions
|
|
23
|
-
* <InteractiveIcon iconType="filled"
|
|
23
|
+
* <InteractiveIcon iconType="filled" accessibilityLabel="Delete item" onPress={handleDelete}>
|
|
24
24
|
* <DeleteCircleFill size={20} />
|
|
25
25
|
* </InteractiveIcon>
|
|
26
26
|
*
|
|
27
27
|
* // Stroked interactive icon for secondary actions
|
|
28
|
-
* <InteractiveIcon iconType="stroked"
|
|
28
|
+
* <InteractiveIcon iconType="stroked" accessibilityLabel="Open settings" onPress={handleSettings}>
|
|
29
29
|
* <Settings size={20} />
|
|
30
30
|
* </InteractiveIcon>
|
|
31
31
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractiveIcon.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/InteractiveIcon/InteractiveIcon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InteractiveIcon.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/InteractiveIcon/InteractiveIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAqB,MAAM,OAAO,CAAC;AAM9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AA0C/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA4BpD,CAAC"}
|
|
@@ -22,5 +22,5 @@ figma.connect(InteractiveIcon, 'https://www.figma.com/design/JxaLVMTWirCpU0rsbZ3
|
|
|
22
22
|
url: 'https://ldls.vercel.app/?path=/docs/components-interactiveicon-overview--docs',
|
|
23
23
|
},
|
|
24
24
|
],
|
|
25
|
-
example: (props) => (_jsx(InteractiveIcon, { iconType: props.iconType, disabled: props.disabled,
|
|
25
|
+
example: (props) => (_jsx(InteractiveIcon, { iconType: props.iconType, disabled: props.disabled, accessibilityLabel: 'Interactive icon', children: props.children })),
|
|
26
26
|
});
|
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
filled:
|
|
10
|
-
stroked:
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
],
|
|
28
|
-
});
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { LumenStyleSheet, mergeStyles } from '../../../styles';
|
|
4
|
+
import { InjectStylesIntoChildren } from '../../utils/components/InjectStylesIntoChildren';
|
|
5
|
+
import { Pressable } from '../Utility';
|
|
6
|
+
const useStyles = ({ iconType, pressed, disabled, }) => {
|
|
7
|
+
return LumenStyleSheet.useCreate((t) => {
|
|
8
|
+
const backgroundStyle = {
|
|
9
|
+
filled: { backgroundColor: t.colors.bg.base },
|
|
10
|
+
stroked: { backgroundColor: t.colors.bg.baseTransparent },
|
|
11
|
+
};
|
|
12
|
+
return {
|
|
13
|
+
container: mergeStyles({
|
|
14
|
+
borderRadius: t.borderRadius.full,
|
|
15
|
+
}, backgroundStyle[iconType], iconType === 'stroked' &&
|
|
16
|
+
pressed && { backgroundColor: t.colors.bg.baseTransparentPressed }),
|
|
17
|
+
icon: {
|
|
18
|
+
color: disabled
|
|
19
|
+
? t.colors.text.disabled
|
|
20
|
+
: pressed
|
|
21
|
+
? t.colors.text.mutedPressed
|
|
22
|
+
: t.colors.text.muted,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
}, [iconType, pressed, disabled]);
|
|
26
|
+
};
|
|
29
27
|
/**
|
|
30
28
|
* A specialized interactive component designed specifically for displaying pressable icons.
|
|
31
29
|
*
|
|
@@ -46,18 +44,20 @@ const buttonVariants = cva('inline-flex size-fit items-center justify-center rou
|
|
|
46
44
|
* import { DeleteCircleFill, Settings } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
47
45
|
*
|
|
48
46
|
* // Filled interactive icon for destructive actions
|
|
49
|
-
* <InteractiveIcon iconType="filled"
|
|
47
|
+
* <InteractiveIcon iconType="filled" accessibilityLabel="Delete item" onPress={handleDelete}>
|
|
50
48
|
* <DeleteCircleFill size={20} />
|
|
51
49
|
* </InteractiveIcon>
|
|
52
50
|
*
|
|
53
51
|
* // Stroked interactive icon for secondary actions
|
|
54
|
-
* <InteractiveIcon iconType="stroked"
|
|
52
|
+
* <InteractiveIcon iconType="stroked" accessibilityLabel="Open settings" onPress={handleSettings}>
|
|
55
53
|
* <Settings size={20} />
|
|
56
54
|
* </InteractiveIcon>
|
|
57
55
|
*/
|
|
58
|
-
export const InteractiveIcon = ({ iconType, children, disabled = false, ...props }) => {
|
|
59
|
-
return (_jsx(Pressable, { accessibilityRole: 'button', accessibilityState: { disabled: !!disabled }, disabled: disabled, ...props, children: ({ pressed }) => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
export const InteractiveIcon = ({ iconType, children, disabled = false, style, lx, ...props }) => {
|
|
57
|
+
return (_jsx(Pressable, { lx: lx, style: [style, { alignItems: 'center', justifyContent: 'center' }], accessibilityRole: 'button', accessibilityState: { disabled: !!disabled }, disabled: disabled, ...props, children: ({ pressed }) => (_jsx(InteractiveIconContent, { iconType: iconType, pressed: pressed, disabled: !!disabled, children: children })) }));
|
|
58
|
+
};
|
|
59
|
+
const InteractiveIconContent = ({ iconType, pressed, disabled, children }) => {
|
|
60
|
+
const styles = useStyles({ iconType, pressed, disabled });
|
|
61
|
+
return (_jsx(View, { style: styles.container, children: _jsx(InjectStylesIntoChildren, { style: styles.icon, children: children }) }));
|
|
63
62
|
};
|
|
63
|
+
InteractiveIcon.displayName = 'InteractiveIcon';
|
|
@@ -3,7 +3,7 @@ import { InteractiveIcon } from './InteractiveIcon';
|
|
|
3
3
|
declare const meta: Meta<typeof InteractiveIcon>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof InteractiveIcon>;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const Base: Story;
|
|
7
7
|
export declare const Stroked: Story;
|
|
8
8
|
export declare const IconTypeShowcase: Story;
|
|
9
9
|
export declare const SizesShowcase: Story;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractiveIcon.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/InteractiveIcon/InteractiveIcon.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"InteractiveIcon.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/InteractiveIcon/InteractiveIcon.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAS9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,eAAe,CA0BtC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9C,eAAO,MAAM,IAAI,EAAE,KAiBlB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAiBrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAuB9B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KA8B3B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,KAsD5B,CAAC"}
|