@ledgerhq/lumen-ui-rnative 0.1.16 → 0.1.18
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/dist/module/lib/Components/AddressInput/AddressInput.js +3 -5
- package/dist/module/lib/Components/AddressInput/AddressInput.js.map +1 -1
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.js +2 -1
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.js.map +1 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.js +0 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.js.map +1 -1
- package/dist/module/lib/Components/Banner/Banner.js +0 -1
- package/dist/module/lib/Components/Banner/Banner.js.map +1 -1
- package/dist/module/lib/Components/BaseInput/BaseInput.js +3 -5
- package/dist/module/lib/Components/BaseInput/BaseInput.js.map +1 -1
- package/dist/module/lib/Components/BottomSheet/BottomSheet.js +2 -3
- package/dist/module/lib/Components/BottomSheet/BottomSheet.js.map +1 -1
- package/dist/module/lib/Components/BottomSheet/BottomSheet.test.js +2 -6
- package/dist/module/lib/Components/BottomSheet/BottomSheet.test.js.map +1 -1
- package/dist/module/lib/Components/BottomSheet/BottomSheetHeader.js +0 -1
- package/dist/module/lib/Components/BottomSheet/BottomSheetHeader.js.map +1 -1
- package/dist/module/lib/Components/BottomSheet/CustomBackdrop.js +0 -1
- package/dist/module/lib/Components/BottomSheet/CustomBackdrop.js.map +1 -1
- package/dist/module/lib/Components/BottomSheet/CustomHandle.js +0 -1
- package/dist/module/lib/Components/BottomSheet/CustomHandle.js.map +1 -1
- package/dist/module/lib/Components/BottomSheet/Scrollables.js +0 -5
- package/dist/module/lib/Components/BottomSheet/Scrollables.js.map +1 -1
- package/dist/module/lib/Components/Button/BaseButton.js +0 -1
- package/dist/module/lib/Components/Button/BaseButton.js.map +1 -1
- package/dist/module/lib/Components/Button/Button.js +0 -1
- package/dist/module/lib/Components/Button/Button.js.map +1 -1
- package/dist/module/lib/Components/Card/Card.js +1 -11
- package/dist/module/lib/Components/Card/Card.js.map +1 -1
- package/dist/module/lib/Components/CardButton/CardButton.js +0 -1
- package/dist/module/lib/Components/CardButton/CardButton.js.map +1 -1
- package/dist/module/lib/Components/Checkbox/BaseCheckbox.js +0 -3
- package/dist/module/lib/Components/Checkbox/BaseCheckbox.js.map +1 -1
- package/dist/module/lib/Components/Checkbox/Checkbox.js +0 -1
- package/dist/module/lib/Components/Checkbox/Checkbox.js.map +1 -1
- package/dist/module/lib/Components/ContentBanner/ContentBanner.js +3 -8
- package/dist/module/lib/Components/ContentBanner/ContentBanner.js.map +1 -1
- package/dist/module/lib/Components/Divider/Divider.js +0 -1
- package/dist/module/lib/Components/Divider/Divider.js.map +1 -1
- package/dist/module/lib/Components/Icon/Icon.js +0 -1
- package/dist/module/lib/Components/Icon/Icon.js.map +1 -1
- package/dist/module/lib/Components/IconButton/IconButton.js +0 -1
- package/dist/module/lib/Components/IconButton/IconButton.js.map +1 -1
- package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.js +13 -23
- package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.js.map +1 -1
- package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.mdx +58 -90
- package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.stories.js +24 -29
- package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.stories.js.map +1 -1
- package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.test.js +30 -38
- package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.test.js.map +1 -1
- package/dist/module/lib/Components/Label/Label.js +0 -1
- package/dist/module/lib/Components/Label/Label.js.map +1 -1
- package/dist/module/lib/Components/Link/Link.js +0 -1
- package/dist/module/lib/Components/Link/Link.js.map +1 -1
- package/dist/module/lib/Components/ListItem/ListItem.js +5 -8
- package/dist/module/lib/Components/ListItem/ListItem.js.map +1 -1
- package/dist/module/lib/Components/MediaBanner/MediaBanner.js +3 -4
- package/dist/module/lib/Components/MediaBanner/MediaBanner.js.map +1 -1
- package/dist/module/lib/Components/MediaCard/MediaCard.js +3 -6
- package/dist/module/lib/Components/MediaCard/MediaCard.js.map +1 -1
- package/dist/module/lib/Components/MediaImage/MediaImage.js +0 -1
- package/dist/module/lib/Components/MediaImage/MediaImage.js.map +1 -1
- package/dist/module/lib/Components/NavBar/CoinCapsule.js +0 -1
- package/dist/module/lib/Components/NavBar/CoinCapsule.js.map +1 -1
- package/dist/module/lib/Components/NavBar/NavBar.js +0 -4
- package/dist/module/lib/Components/NavBar/NavBar.js.map +1 -1
- package/dist/module/lib/Components/PageIndicator/PageIndicator.js +0 -1
- package/dist/module/lib/Components/PageIndicator/PageIndicator.js.map +1 -1
- package/dist/module/lib/Components/SearchInput/SearchInput.js +2 -2
- package/dist/module/lib/Components/SearchInput/SearchInput.js.map +1 -1
- package/dist/module/lib/Components/SearchInput/SearchInput.test.js +41 -0
- package/dist/module/lib/Components/SearchInput/SearchInput.test.js.map +1 -0
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.js +0 -2
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/module/lib/Components/Select/Select.js +0 -9
- package/dist/module/lib/Components/Select/Select.js.map +1 -1
- package/dist/module/lib/Components/Skeleton/Skeleton.js +0 -4
- package/dist/module/lib/Components/Skeleton/Skeleton.js.map +1 -1
- package/dist/module/lib/Components/Slot/Slot.js +0 -4
- package/dist/module/lib/Components/Slot/Slot.js.map +1 -1
- package/dist/module/lib/Components/Spinner/Spinner.js +0 -1
- package/dist/module/lib/Components/Spinner/Spinner.js.map +1 -1
- package/dist/module/lib/Components/Spot/Spot.js +2 -1
- package/dist/module/lib/Components/Spot/Spot.js.map +1 -1
- package/dist/module/lib/Components/Stepper/Stepper.js +0 -1
- package/dist/module/lib/Components/Stepper/Stepper.js.map +1 -1
- package/dist/module/lib/Components/Subheader/Subheader.js +3 -4
- package/dist/module/lib/Components/Subheader/Subheader.js.map +1 -1
- package/dist/module/lib/Components/Switch/BaseSwitch.js +1 -3
- package/dist/module/lib/Components/Switch/BaseSwitch.js.map +1 -1
- package/dist/module/lib/Components/Switch/Switch.js +0 -1
- package/dist/module/lib/Components/Switch/Switch.js.map +1 -1
- package/dist/module/lib/Components/TabBar/TabBar.js +0 -1
- package/dist/module/lib/Components/TabBar/TabBar.js.map +1 -1
- package/dist/module/lib/Components/Tag/Tag.js +0 -1
- package/dist/module/lib/Components/Tag/Tag.js.map +1 -1
- package/dist/module/lib/Components/TextInput/TextInput.js +0 -1
- package/dist/module/lib/Components/TextInput/TextInput.js.map +1 -1
- package/dist/module/lib/Components/Tile/Tile.js +0 -5
- package/dist/module/lib/Components/Tile/Tile.js.map +1 -1
- package/dist/module/lib/Components/TileButton/TileButton.js +0 -1
- package/dist/module/lib/Components/TileButton/TileButton.js.map +1 -1
- package/dist/module/lib/Components/Tooltip/Tooltip.js +0 -3
- package/dist/module/lib/Components/Tooltip/Tooltip.js.map +1 -1
- package/dist/module/lib/Components/Tooltip/Tooltip.stories.js +2 -2
- package/dist/module/lib/Components/Tooltip/Tooltip.stories.js.map +1 -1
- package/dist/module/lib/Components/TriggerButton/TriggerButton.js +0 -1
- package/dist/module/lib/Components/TriggerButton/TriggerButton.js.map +1 -1
- package/dist/typescript/src/lib/Components/AddressInput/AddressInput.d.ts +1 -4
- package/dist/typescript/src/lib/Components/AddressInput/AddressInput.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/AmountDisplay/AmountDisplay.d.ts +1 -4
- package/dist/typescript/src/lib/Components/AmountDisplay/AmountDisplay.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts +1 -4
- package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Banner/Banner.d.ts +1 -4
- package/dist/typescript/src/lib/Components/Banner/Banner.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/BaseInput/BaseInput.d.ts +1 -4
- package/dist/typescript/src/lib/Components/BaseInput/BaseInput.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/BottomSheet/BottomSheet.d.ts +2 -5
- package/dist/typescript/src/lib/Components/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/BottomSheet/BottomSheetHeader.d.ts +1 -4
- package/dist/typescript/src/lib/Components/BottomSheet/BottomSheetHeader.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/BottomSheet/CustomBackdrop.d.ts +1 -4
- package/dist/typescript/src/lib/Components/BottomSheet/CustomBackdrop.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/BottomSheet/CustomHandle.d.ts +3 -6
- package/dist/typescript/src/lib/Components/BottomSheet/CustomHandle.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/BottomSheet/Scrollables.d.ts +5 -20
- package/dist/typescript/src/lib/Components/BottomSheet/Scrollables.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Button/BaseButton.d.ts +1 -4
- package/dist/typescript/src/lib/Components/Button/BaseButton.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Button/Button.d.ts +1 -4
- package/dist/typescript/src/lib/Components/Button/Button.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Card/Card.d.ts +26 -56
- package/dist/typescript/src/lib/Components/Card/Card.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/CardButton/CardButton.d.ts +1 -4
- package/dist/typescript/src/lib/Components/CardButton/CardButton.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Checkbox/BaseCheckbox.d.ts +2 -8
- package/dist/typescript/src/lib/Components/Checkbox/BaseCheckbox.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Checkbox/Checkbox.d.ts +1 -4
- package/dist/typescript/src/lib/Components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/ContentBanner/ContentBanner.d.ts +4 -16
- package/dist/typescript/src/lib/Components/ContentBanner/ContentBanner.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Divider/Divider.d.ts +1 -4
- package/dist/typescript/src/lib/Components/Divider/Divider.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Icon/Icon.d.ts +1 -4
- package/dist/typescript/src/lib/Components/Icon/Icon.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/IconButton/IconButton.d.ts +1 -4
- package/dist/typescript/src/lib/Components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/InteractiveIcon/InteractiveIcon.d.ts +4 -12
- package/dist/typescript/src/lib/Components/InteractiveIcon/InteractiveIcon.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/InteractiveIcon/types.d.ts +13 -4
- package/dist/typescript/src/lib/Components/InteractiveIcon/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Label/Label.d.ts +1 -4
- package/dist/typescript/src/lib/Components/Label/Label.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Link/Link.d.ts +1 -4
- package/dist/typescript/src/lib/Components/Link/Link.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/ListItem/ListItem.d.ts +19 -40
- package/dist/typescript/src/lib/Components/ListItem/ListItem.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/MediaCard/MediaCard.d.ts +2 -8
- package/dist/typescript/src/lib/Components/MediaCard/MediaCard.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/MediaImage/MediaImage.d.ts +1 -4
- package/dist/typescript/src/lib/Components/MediaImage/MediaImage.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/NavBar/CoinCapsule.d.ts +0 -3
- package/dist/typescript/src/lib/Components/NavBar/CoinCapsule.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/NavBar/NavBar.d.ts +0 -12
- package/dist/typescript/src/lib/Components/NavBar/NavBar.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/PageIndicator/PageIndicator.d.ts +1 -4
- package/dist/typescript/src/lib/Components/PageIndicator/PageIndicator.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/SearchInput/SearchInput.d.ts +1 -4
- package/dist/typescript/src/lib/Components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControl.d.ts +0 -6
- package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Select/Select.d.ts +9 -36
- package/dist/typescript/src/lib/Components/Select/Select.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Skeleton/Skeleton.d.ts +1 -4
- package/dist/typescript/src/lib/Components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Slot/Slot.d.ts +4 -16
- package/dist/typescript/src/lib/Components/Slot/Slot.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Spinner/Spinner.d.ts +1 -4
- package/dist/typescript/src/lib/Components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Spot/Spot.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Stepper/Stepper.d.ts +1 -4
- package/dist/typescript/src/lib/Components/Stepper/Stepper.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Subheader/types.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Subheader/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Switch/BaseSwitch.d.ts +2 -8
- package/dist/typescript/src/lib/Components/Switch/BaseSwitch.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Switch/Switch.d.ts +1 -4
- package/dist/typescript/src/lib/Components/Switch/Switch.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/TabBar/TabBar.d.ts +0 -3
- package/dist/typescript/src/lib/Components/TabBar/TabBar.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Tag/Tag.d.ts +1 -4
- package/dist/typescript/src/lib/Components/Tag/Tag.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/TextInput/TextInput.d.ts +1 -4
- package/dist/typescript/src/lib/Components/TextInput/TextInput.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Tile/Tile.d.ts +5 -20
- package/dist/typescript/src/lib/Components/Tile/Tile.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/TileButton/TileButton.d.ts +1 -4
- package/dist/typescript/src/lib/Components/TileButton/TileButton.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Tooltip/Tooltip.d.ts +3 -12
- package/dist/typescript/src/lib/Components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/TriggerButton/TriggerButton.d.ts +1 -4
- package/dist/typescript/src/lib/Components/TriggerButton/TriggerButton.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/lib/Components/AddressInput/AddressInput.tsx +3 -5
- package/src/lib/Components/AmountDisplay/AmountDisplay.tsx +2 -2
- package/src/lib/Components/AmountInput/AmountInput.tsx +0 -2
- package/src/lib/Components/Banner/Banner.tsx +0 -2
- package/src/lib/Components/BaseInput/BaseInput.tsx +3 -5
- package/src/lib/Components/BottomSheet/BottomSheet.test.tsx +2 -4
- package/src/lib/Components/BottomSheet/BottomSheet.tsx +2 -3
- package/src/lib/Components/BottomSheet/BottomSheetHeader.tsx +0 -1
- package/src/lib/Components/BottomSheet/CustomBackdrop.tsx +0 -1
- package/src/lib/Components/BottomSheet/CustomHandle.tsx +0 -1
- package/src/lib/Components/BottomSheet/Scrollables.tsx +0 -5
- package/src/lib/Components/Button/BaseButton.tsx +0 -2
- package/src/lib/Components/Button/Button.tsx +0 -1
- package/src/lib/Components/Card/Card.tsx +0 -10
- package/src/lib/Components/CardButton/CardButton.tsx +0 -2
- package/src/lib/Components/Checkbox/BaseCheckbox.tsx +0 -4
- package/src/lib/Components/Checkbox/Checkbox.tsx +0 -2
- package/src/lib/Components/ContentBanner/ContentBanner.tsx +3 -11
- package/src/lib/Components/Divider/Divider.tsx +0 -2
- package/src/lib/Components/Icon/Icon.tsx +0 -2
- package/src/lib/Components/IconButton/IconButton.tsx +0 -2
- package/src/lib/Components/InteractiveIcon/InteractiveIcon.mdx +58 -90
- package/src/lib/Components/InteractiveIcon/InteractiveIcon.stories.tsx +35 -34
- package/src/lib/Components/InteractiveIcon/InteractiveIcon.test.tsx +33 -29
- package/src/lib/Components/InteractiveIcon/InteractiveIcon.tsx +17 -28
- package/src/lib/Components/InteractiveIcon/types.ts +13 -5
- package/src/lib/Components/Label/Label.tsx +0 -2
- package/src/lib/Components/Link/Link.tsx +0 -2
- package/src/lib/Components/ListItem/ListItem.tsx +5 -15
- package/src/lib/Components/MediaBanner/MediaBanner.tsx +3 -3
- package/src/lib/Components/MediaCard/MediaCard.tsx +3 -7
- package/src/lib/Components/MediaImage/MediaImage.tsx +0 -2
- package/src/lib/Components/NavBar/CoinCapsule.tsx +0 -2
- package/src/lib/Components/NavBar/NavBar.tsx +0 -8
- package/src/lib/Components/PageIndicator/PageIndicator.tsx +0 -2
- package/src/lib/Components/SearchInput/SearchInput.test.tsx +40 -0
- package/src/lib/Components/SearchInput/SearchInput.tsx +8 -3
- package/src/lib/Components/SegmentedControl/SegmentedControl.tsx +0 -4
- package/src/lib/Components/Select/Select.tsx +0 -10
- package/src/lib/Components/Skeleton/Skeleton.tsx +0 -4
- package/src/lib/Components/Slot/Slot.tsx +0 -8
- package/src/lib/Components/Spinner/Spinner.tsx +0 -2
- package/src/lib/Components/Spot/Spot.tsx +1 -0
- package/src/lib/Components/Stepper/Stepper.tsx +0 -2
- package/src/lib/Components/Subheader/Subheader.tsx +3 -3
- package/src/lib/Components/Subheader/types.ts +1 -1
- package/src/lib/Components/Switch/BaseSwitch.tsx +0 -3
- package/src/lib/Components/Switch/Switch.tsx +0 -2
- package/src/lib/Components/TabBar/TabBar.tsx +0 -2
- package/src/lib/Components/Tag/Tag.tsx +0 -2
- package/src/lib/Components/TextInput/TextInput.tsx +0 -2
- package/src/lib/Components/Tile/Tile.tsx +0 -6
- package/src/lib/Components/TileButton/TileButton.tsx +0 -2
- package/src/lib/Components/Tooltip/Tooltip.stories.tsx +5 -3
- package/src/lib/Components/Tooltip/Tooltip.tsx +0 -3
- package/src/lib/Components/TriggerButton/TriggerButton.tsx +0 -2
|
@@ -46,8 +46,6 @@ export const ContentBannerContent = ({
|
|
|
46
46
|
);
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
-
ContentBannerContent.displayName = 'ContentBannerContent';
|
|
50
|
-
|
|
51
49
|
/**
|
|
52
50
|
* The main title of the content banner.
|
|
53
51
|
*/
|
|
@@ -91,8 +89,6 @@ export const ContentBannerTitle = ({
|
|
|
91
89
|
);
|
|
92
90
|
};
|
|
93
91
|
|
|
94
|
-
ContentBannerTitle.displayName = 'ContentBannerTitle';
|
|
95
|
-
|
|
96
92
|
/**
|
|
97
93
|
* Optional description text below the title.
|
|
98
94
|
*/
|
|
@@ -136,8 +132,6 @@ export const ContentBannerDescription = ({
|
|
|
136
132
|
);
|
|
137
133
|
};
|
|
138
134
|
|
|
139
|
-
ContentBannerDescription.displayName = 'ContentBannerDescription';
|
|
140
|
-
|
|
141
135
|
/**
|
|
142
136
|
* A content banner component for displaying a composable banner with an optional
|
|
143
137
|
* leading visual, title, description, and close button.
|
|
@@ -209,18 +203,16 @@ export const ContentBanner = ({
|
|
|
209
203
|
<View style={styles.closeButton}>
|
|
210
204
|
<InteractiveIcon
|
|
211
205
|
iconType='stroked'
|
|
206
|
+
icon={Close}
|
|
207
|
+
size={16}
|
|
212
208
|
testID='content-banner-close-button'
|
|
213
209
|
onPress={() => onClose()}
|
|
214
210
|
accessibilityLabel={
|
|
215
211
|
closeAccessibilityLabel || t('components.banner.closeAriaLabel')
|
|
216
212
|
}
|
|
217
|
-
|
|
218
|
-
<Close size={16} />
|
|
219
|
-
</InteractiveIcon>
|
|
213
|
+
/>
|
|
220
214
|
</View>
|
|
221
215
|
)}
|
|
222
216
|
</Box>
|
|
223
217
|
);
|
|
224
218
|
};
|
|
225
|
-
|
|
226
|
-
ContentBanner.displayName = 'ContentBanner';
|
|
@@ -44,19 +44,17 @@ InteractiveIcons come in two visual styles, each optimized for specific use case
|
|
|
44
44
|
|
|
45
45
|
### Icon Sizes
|
|
46
46
|
|
|
47
|
-
InteractiveIcons support various icon sizes
|
|
47
|
+
InteractiveIcons support various icon sizes via the `size` prop:
|
|
48
48
|
|
|
49
49
|
<Canvas of={InteractiveIconStories.SizesShowcase} />
|
|
50
50
|
|
|
51
51
|
Common sizes include:
|
|
52
52
|
|
|
53
53
|
- **16px**: Compact actions in dense interfaces
|
|
54
|
-
- **20px**: Standard size for most interactive icons
|
|
54
|
+
- **20px**: Standard size for most interactive icons (default)
|
|
55
55
|
- **24px**: Prominent actions in toolbars
|
|
56
56
|
- **40px**: Large touch targets for mobile interfaces
|
|
57
57
|
|
|
58
|
-
> **⚠️ Important**: Icon sizes are controlled by the icon component itself, not through InteractiveIcon.
|
|
59
|
-
|
|
60
58
|
### Icon States
|
|
61
59
|
|
|
62
60
|
InteractiveIcons have enabled or disabled states:
|
|
@@ -72,9 +70,12 @@ InteractiveIcons require special attention for accessibility since they contain
|
|
|
72
70
|
**Always provide an `accessibilityLabel` or `aria-label` prop** that clearly describes the action:
|
|
73
71
|
|
|
74
72
|
```tsx
|
|
75
|
-
<InteractiveIcon
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
<InteractiveIcon
|
|
74
|
+
iconType='filled'
|
|
75
|
+
icon={DeleteCircleFill}
|
|
76
|
+
size={20}
|
|
77
|
+
accessibilityLabel='Delete item'
|
|
78
|
+
/>
|
|
78
79
|
```
|
|
79
80
|
|
|
80
81
|
### Touch Interaction
|
|
@@ -105,20 +106,20 @@ function MyComponent() {
|
|
|
105
106
|
{/* Stroked interactive icon */}
|
|
106
107
|
<InteractiveIcon
|
|
107
108
|
iconType='stroked'
|
|
109
|
+
icon={Settings}
|
|
110
|
+
size={20}
|
|
108
111
|
accessibilityLabel='Open settings'
|
|
109
112
|
onPress={handleSettings}
|
|
110
|
-
|
|
111
|
-
<Settings size={20} />
|
|
112
|
-
</InteractiveIcon>
|
|
113
|
+
/>
|
|
113
114
|
|
|
114
115
|
{/* Filled interactive icon */}
|
|
115
116
|
<InteractiveIcon
|
|
116
117
|
iconType='filled'
|
|
118
|
+
icon={DeleteCircleFill}
|
|
119
|
+
size={20}
|
|
117
120
|
accessibilityLabel='Delete item'
|
|
118
121
|
onPress={handleDelete}
|
|
119
|
-
|
|
120
|
-
<DeleteCircleFill size={20} />
|
|
121
|
-
</InteractiveIcon>
|
|
122
|
+
/>
|
|
122
123
|
</Box>
|
|
123
124
|
);
|
|
124
125
|
}
|
|
@@ -137,15 +138,11 @@ function LikeButton({ isSelected, onToggle }) {
|
|
|
137
138
|
return (
|
|
138
139
|
<InteractiveIcon
|
|
139
140
|
iconType={isSelected ? 'filled' : 'stroked'}
|
|
141
|
+
icon={isSelected ? CheckmarkCircleFill : CheckmarkCircle}
|
|
142
|
+
size={20}
|
|
140
143
|
accessibilityLabel={isSelected ? 'Deselect' : 'Select'}
|
|
141
144
|
onPress={onToggle}
|
|
142
|
-
|
|
143
|
-
{isSelected ? (
|
|
144
|
-
<CheckmarkCircleFill size={20} />
|
|
145
|
-
) : (
|
|
146
|
-
<CheckmarkCircle size={20} />
|
|
147
|
-
)}
|
|
148
|
-
</InteractiveIcon>
|
|
145
|
+
/>
|
|
149
146
|
);
|
|
150
147
|
}
|
|
151
148
|
```
|
|
@@ -160,29 +157,16 @@ function SizeExamples() {
|
|
|
160
157
|
return (
|
|
161
158
|
<Box lx={{ alignItems: 'center', gap: 's4' }}>
|
|
162
159
|
{/* Compact size for dense interfaces */}
|
|
163
|
-
<InteractiveIcon iconType='stroked' accessibilityLabel='Settings'
|
|
164
|
-
<Settings size={16} />
|
|
165
|
-
</InteractiveIcon>
|
|
160
|
+
<InteractiveIcon iconType='stroked' icon={Settings} size={16} accessibilityLabel='Settings' />
|
|
166
161
|
|
|
167
|
-
{/* Standard size */}
|
|
168
|
-
<InteractiveIcon iconType='stroked' accessibilityLabel='Settings'
|
|
169
|
-
<Settings size={20} />
|
|
170
|
-
</InteractiveIcon>
|
|
162
|
+
{/* Standard size (default) */}
|
|
163
|
+
<InteractiveIcon iconType='stroked' icon={Settings} size={20} accessibilityLabel='Settings' />
|
|
171
164
|
|
|
172
165
|
{/* Prominent size */}
|
|
173
|
-
<InteractiveIcon iconType='stroked' accessibilityLabel='Settings'
|
|
174
|
-
<Settings size={24} />
|
|
175
|
-
</InteractiveIcon>
|
|
166
|
+
<InteractiveIcon iconType='stroked' icon={Settings} size={24} accessibilityLabel='Settings' />
|
|
176
167
|
|
|
177
168
|
{/* Large touch target for mobile */}
|
|
178
|
-
<InteractiveIcon iconType='stroked' accessibilityLabel='Settings'
|
|
179
|
-
<Settings size={40} />
|
|
180
|
-
</InteractiveIcon>
|
|
181
|
-
|
|
182
|
-
{/* Large touch target for mobile */}
|
|
183
|
-
<InteractiveIcon iconType='stroked' accessibilityLabel='Settings'>
|
|
184
|
-
<Settings size={64} />
|
|
185
|
-
</InteractiveIcon>
|
|
169
|
+
<InteractiveIcon iconType='stroked' icon={Settings} size={40} accessibilityLabel='Settings' />
|
|
186
170
|
</Box>
|
|
187
171
|
);
|
|
188
172
|
}
|
|
@@ -204,14 +188,20 @@ The following guidelines are based on our design system principles and accessibi
|
|
|
204
188
|
import { DeleteCircleFill, Settings } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
205
189
|
|
|
206
190
|
// Filled icon with filled variant
|
|
207
|
-
<InteractiveIcon
|
|
208
|
-
|
|
209
|
-
|
|
191
|
+
<InteractiveIcon
|
|
192
|
+
iconType='filled'
|
|
193
|
+
icon={DeleteCircleFill}
|
|
194
|
+
size={20}
|
|
195
|
+
accessibilityLabel='Delete'
|
|
196
|
+
/>
|
|
210
197
|
|
|
211
198
|
// Outlined icon with stroked variant
|
|
212
|
-
<InteractiveIcon
|
|
213
|
-
|
|
214
|
-
|
|
199
|
+
<InteractiveIcon
|
|
200
|
+
iconType='stroked'
|
|
201
|
+
icon={Settings}
|
|
202
|
+
size={20}
|
|
203
|
+
accessibilityLabel='Settings'
|
|
204
|
+
/>
|
|
215
205
|
```
|
|
216
206
|
|
|
217
207
|
</DoBlockItem>
|
|
@@ -225,14 +215,20 @@ import { DeleteCircleFill, Settings } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
|
225
215
|
import { DeleteCircleFill, Settings } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
226
216
|
|
|
227
217
|
// Filled icon with stroked variant (wrong)
|
|
228
|
-
<InteractiveIcon
|
|
229
|
-
|
|
230
|
-
|
|
218
|
+
<InteractiveIcon
|
|
219
|
+
iconType='stroked'
|
|
220
|
+
icon={DeleteCircleFill}
|
|
221
|
+
size={20}
|
|
222
|
+
accessibilityLabel='Delete'
|
|
223
|
+
/>
|
|
231
224
|
|
|
232
225
|
// Outlined icon with filled variant (wrong)
|
|
233
|
-
<InteractiveIcon
|
|
234
|
-
|
|
235
|
-
|
|
226
|
+
<InteractiveIcon
|
|
227
|
+
iconType='filled'
|
|
228
|
+
icon={Settings}
|
|
229
|
+
size={20}
|
|
230
|
+
accessibilityLabel='Settings'
|
|
231
|
+
/>
|
|
236
232
|
```
|
|
237
233
|
|
|
238
234
|
</DontBlockItem>
|
|
@@ -249,9 +245,12 @@ import { DeleteCircleFill, Settings } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
|
249
245
|
```tsx
|
|
250
246
|
import { Download } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
251
247
|
|
|
252
|
-
<InteractiveIcon
|
|
253
|
-
|
|
254
|
-
|
|
248
|
+
<InteractiveIcon
|
|
249
|
+
iconType='stroked'
|
|
250
|
+
icon={Download}
|
|
251
|
+
size={20}
|
|
252
|
+
accessibilityLabel='Download PDF document'
|
|
253
|
+
/>
|
|
255
254
|
```
|
|
256
255
|
|
|
257
256
|
</DoBlockItem>
|
|
@@ -264,43 +263,12 @@ import { Download } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
|
264
263
|
```tsx
|
|
265
264
|
import { Download } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
266
265
|
|
|
267
|
-
<InteractiveIcon
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
</DoVsDontRow>
|
|
275
|
-
|
|
276
|
-
<DoVsDontRow>
|
|
277
|
-
<DoBlockItem
|
|
278
|
-
title='Only render icon components as children'
|
|
279
|
-
description='InteractiveIcon expects icon components as children'
|
|
280
|
-
>
|
|
281
|
-
|
|
282
|
-
{/* prettier-ignore */}
|
|
283
|
-
```tsx
|
|
284
|
-
import { MoreVertical } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
285
|
-
|
|
286
|
-
<InteractiveIcon iconType='stroked' accessibilityLabel='More actions'>
|
|
287
|
-
<MoreVertical size={20} />
|
|
288
|
-
</InteractiveIcon>
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
</DoBlockItem>
|
|
292
|
-
<DontBlockItem
|
|
293
|
-
title="Don't render arbitrary content as children"
|
|
294
|
-
description='Avoid using text, views, or other non-icon content as children'
|
|
295
|
-
>
|
|
296
|
-
|
|
297
|
-
{/* prettier-ignore */}
|
|
298
|
-
```tsx
|
|
299
|
-
import { MoreVertical } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
300
|
-
|
|
301
|
-
<InteractiveIcon iconType='stroked' accessibilityLabel='More actions'>
|
|
302
|
-
Settings
|
|
303
|
-
</InteractiveIcon>
|
|
266
|
+
<InteractiveIcon
|
|
267
|
+
iconType='stroked'
|
|
268
|
+
icon={Download}
|
|
269
|
+
size={20}
|
|
270
|
+
accessibilityLabel='Click here'
|
|
271
|
+
/>
|
|
304
272
|
```
|
|
305
273
|
|
|
306
274
|
</DontBlockItem>
|
|
@@ -21,13 +21,13 @@ const meta: Meta<typeof InteractiveIcon> = {
|
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
23
|
argTypes: {
|
|
24
|
-
|
|
24
|
+
icon: {
|
|
25
25
|
control: 'select',
|
|
26
26
|
options: ['Settings', 'PenEdit', 'DeleteCircleFill'],
|
|
27
27
|
mapping: {
|
|
28
|
-
Settings
|
|
29
|
-
PenEdit
|
|
30
|
-
DeleteCircleFill
|
|
28
|
+
Settings,
|
|
29
|
+
PenEdit,
|
|
30
|
+
DeleteCircleFill,
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
},
|
|
@@ -39,16 +39,14 @@ type Story = StoryObj<typeof InteractiveIcon>;
|
|
|
39
39
|
export const Base: Story = {
|
|
40
40
|
args: {
|
|
41
41
|
iconType: 'filled',
|
|
42
|
-
|
|
42
|
+
icon: DeleteCircleFill,
|
|
43
43
|
accessibilityLabel: 'Delete',
|
|
44
44
|
},
|
|
45
45
|
parameters: {
|
|
46
46
|
docs: {
|
|
47
47
|
source: {
|
|
48
48
|
code: `
|
|
49
|
-
<InteractiveIcon iconType="filled" accessibilityLabel="Delete"
|
|
50
|
-
<DeleteCircleFill />
|
|
51
|
-
</InteractiveIcon>
|
|
49
|
+
<InteractiveIcon iconType="filled" icon={DeleteCircleFill} accessibilityLabel="Delete" />
|
|
52
50
|
`,
|
|
53
51
|
},
|
|
54
52
|
},
|
|
@@ -58,16 +56,14 @@ export const Base: Story = {
|
|
|
58
56
|
export const Stroked: Story = {
|
|
59
57
|
args: {
|
|
60
58
|
iconType: 'stroked',
|
|
61
|
-
|
|
59
|
+
icon: MoreVertical,
|
|
62
60
|
accessibilityLabel: 'More actions',
|
|
63
61
|
},
|
|
64
62
|
parameters: {
|
|
65
63
|
docs: {
|
|
66
64
|
source: {
|
|
67
65
|
code: `
|
|
68
|
-
<InteractiveIcon iconType="stroked" accessibilityLabel="More actions"
|
|
69
|
-
<MoreVertical />
|
|
70
|
-
</InteractiveIcon>
|
|
66
|
+
<InteractiveIcon iconType="stroked" icon={MoreVertical} accessibilityLabel="More actions" />
|
|
71
67
|
`,
|
|
72
68
|
},
|
|
73
69
|
},
|
|
@@ -82,17 +78,21 @@ export const IconTypeShowcase: Story = {
|
|
|
82
78
|
<Text lx={{ color: 'muted' }} typography='body3'>
|
|
83
79
|
Filled
|
|
84
80
|
</Text>
|
|
85
|
-
<InteractiveIcon
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
<InteractiveIcon
|
|
82
|
+
iconType='filled'
|
|
83
|
+
icon={DeleteCircleFill}
|
|
84
|
+
accessibilityLabel='Delete'
|
|
85
|
+
/>
|
|
88
86
|
</Box>
|
|
89
87
|
<Box lx={{ flexDirection: 'column', alignItems: 'center', gap: 's4' }}>
|
|
90
88
|
<Text lx={{ color: 'muted' }} typography='body3'>
|
|
91
89
|
Stroked
|
|
92
90
|
</Text>
|
|
93
|
-
<InteractiveIcon
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
<InteractiveIcon
|
|
92
|
+
iconType='stroked'
|
|
93
|
+
icon={MoreVertical}
|
|
94
|
+
accessibilityLabel='More actions'
|
|
95
|
+
/>
|
|
96
96
|
</Box>
|
|
97
97
|
</Box>
|
|
98
98
|
);
|
|
@@ -114,12 +114,11 @@ export const SizesShowcase: Story = {
|
|
|
114
114
|
}}
|
|
115
115
|
>
|
|
116
116
|
<InteractiveIcon
|
|
117
|
-
key={size}
|
|
118
117
|
iconType='stroked'
|
|
118
|
+
icon={DeleteCircleFill}
|
|
119
|
+
size={size}
|
|
119
120
|
accessibilityLabel='More'
|
|
120
|
-
|
|
121
|
-
<DeleteCircleFill size={size} />
|
|
122
|
-
</InteractiveIcon>
|
|
121
|
+
/>
|
|
123
122
|
</Box>
|
|
124
123
|
<Text lx={{ textAlign: 'center' }} typography='body3'>
|
|
125
124
|
{size}px
|
|
@@ -146,17 +145,21 @@ export const StatesShowcase: Story = {
|
|
|
146
145
|
<Text lx={{ color: 'muted' }} typography='body3'>
|
|
147
146
|
Filled enabled
|
|
148
147
|
</Text>
|
|
149
|
-
<InteractiveIcon
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
<InteractiveIcon
|
|
149
|
+
iconType='filled'
|
|
150
|
+
icon={DeleteCircleFill}
|
|
151
|
+
accessibilityLabel='Delete'
|
|
152
|
+
/>
|
|
152
153
|
</Box>
|
|
153
154
|
<Box lx={{ flexDirection: 'column', alignItems: 'center', gap: 's4' }}>
|
|
154
155
|
<Text lx={{ color: 'muted' }} typography='body3'>
|
|
155
156
|
Stroked enabled
|
|
156
157
|
</Text>
|
|
157
|
-
<InteractiveIcon
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
<InteractiveIcon
|
|
159
|
+
iconType='stroked'
|
|
160
|
+
icon={MoreVertical}
|
|
161
|
+
accessibilityLabel='More actions'
|
|
162
|
+
/>
|
|
160
163
|
</Box>
|
|
161
164
|
<Box lx={{ flexDirection: 'column', alignItems: 'center', gap: 's4' }}>
|
|
162
165
|
<Text lx={{ color: 'muted' }} typography='body3'>
|
|
@@ -164,11 +167,10 @@ export const StatesShowcase: Story = {
|
|
|
164
167
|
</Text>
|
|
165
168
|
<InteractiveIcon
|
|
166
169
|
iconType='filled'
|
|
170
|
+
icon={DeleteCircleFill}
|
|
167
171
|
accessibilityLabel='Delete'
|
|
168
172
|
disabled
|
|
169
|
-
|
|
170
|
-
<DeleteCircleFill />
|
|
171
|
-
</InteractiveIcon>
|
|
173
|
+
/>
|
|
172
174
|
</Box>
|
|
173
175
|
<Box lx={{ flexDirection: 'column', alignItems: 'center', gap: 's4' }}>
|
|
174
176
|
<Text lx={{ color: 'muted' }} typography='body3'>
|
|
@@ -176,11 +178,10 @@ export const StatesShowcase: Story = {
|
|
|
176
178
|
</Text>
|
|
177
179
|
<InteractiveIcon
|
|
178
180
|
iconType='stroked'
|
|
181
|
+
icon={MoreVertical}
|
|
179
182
|
accessibilityLabel='More actions'
|
|
180
183
|
disabled
|
|
181
|
-
|
|
182
|
-
<MoreVertical />
|
|
183
|
-
</InteractiveIcon>
|
|
184
|
+
/>
|
|
184
185
|
</Box>
|
|
185
186
|
</Box>
|
|
186
187
|
);
|
|
@@ -15,15 +15,14 @@ const renderWithProvider = (component: React.ReactElement) => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
describe('InteractiveIcon Component', () => {
|
|
18
|
-
it('should render correctly with
|
|
18
|
+
it('should render correctly with icon prop', () => {
|
|
19
19
|
renderWithProvider(
|
|
20
20
|
<InteractiveIcon
|
|
21
21
|
iconType='filled'
|
|
22
|
+
icon={Settings}
|
|
22
23
|
accessibilityLabel='Settings'
|
|
23
24
|
testID='icon-button'
|
|
24
|
-
|
|
25
|
-
<Settings size={20} />
|
|
26
|
-
</InteractiveIcon>,
|
|
25
|
+
/>,
|
|
27
26
|
);
|
|
28
27
|
const buttonElement = screen.getByTestId('icon-button');
|
|
29
28
|
expect(buttonElement).toBeTruthy();
|
|
@@ -33,11 +32,10 @@ describe('InteractiveIcon Component', () => {
|
|
|
33
32
|
renderWithProvider(
|
|
34
33
|
<InteractiveIcon
|
|
35
34
|
iconType='filled'
|
|
35
|
+
icon={Plus}
|
|
36
36
|
accessibilityLabel='Add item'
|
|
37
37
|
testID='filled-icon'
|
|
38
|
-
|
|
39
|
-
<Plus size={20} />
|
|
40
|
-
</InteractiveIcon>,
|
|
38
|
+
/>,
|
|
41
39
|
);
|
|
42
40
|
const buttonElement = screen.getByTestId('filled-icon');
|
|
43
41
|
expect(buttonElement).toBeTruthy();
|
|
@@ -48,11 +46,10 @@ describe('InteractiveIcon Component', () => {
|
|
|
48
46
|
renderWithProvider(
|
|
49
47
|
<InteractiveIcon
|
|
50
48
|
iconType='stroked'
|
|
49
|
+
icon={Settings}
|
|
51
50
|
accessibilityLabel='Settings'
|
|
52
51
|
testID='stroked-icon'
|
|
53
|
-
|
|
54
|
-
<Settings size={20} />
|
|
55
|
-
</InteractiveIcon>,
|
|
52
|
+
/>,
|
|
56
53
|
);
|
|
57
54
|
const buttonElement = screen.getByTestId('stroked-icon');
|
|
58
55
|
expect(buttonElement).toBeTruthy();
|
|
@@ -63,11 +60,10 @@ describe('InteractiveIcon Component', () => {
|
|
|
63
60
|
renderWithProvider(
|
|
64
61
|
<InteractiveIcon
|
|
65
62
|
iconType='filled'
|
|
63
|
+
icon={Settings}
|
|
66
64
|
accessibilityLabel='Open menu'
|
|
67
65
|
testID='menu-icon'
|
|
68
|
-
|
|
69
|
-
<Settings size={20} />
|
|
70
|
-
</InteractiveIcon>,
|
|
66
|
+
/>,
|
|
71
67
|
);
|
|
72
68
|
const buttonElement = screen.getByTestId('menu-icon');
|
|
73
69
|
expect(buttonElement.props.accessibilityLabel).toBe('Open menu');
|
|
@@ -77,12 +73,11 @@ describe('InteractiveIcon Component', () => {
|
|
|
77
73
|
renderWithProvider(
|
|
78
74
|
<InteractiveIcon
|
|
79
75
|
iconType='filled'
|
|
76
|
+
icon={Settings}
|
|
80
77
|
accessibilityLabel='Disabled button'
|
|
81
78
|
disabled
|
|
82
79
|
testID='disabled-icon'
|
|
83
|
-
|
|
84
|
-
<Settings size={20} />
|
|
85
|
-
</InteractiveIcon>,
|
|
80
|
+
/>,
|
|
86
81
|
);
|
|
87
82
|
const buttonElement = screen.getByTestId('disabled-icon');
|
|
88
83
|
expect(buttonElement.props.accessibilityState.disabled).toBe(true);
|
|
@@ -93,12 +88,11 @@ describe('InteractiveIcon Component', () => {
|
|
|
93
88
|
renderWithProvider(
|
|
94
89
|
<InteractiveIcon
|
|
95
90
|
iconType='filled'
|
|
91
|
+
icon={Plus}
|
|
96
92
|
accessibilityLabel='Pressable'
|
|
97
93
|
onPress={handlePress}
|
|
98
94
|
testID='pressable-icon'
|
|
99
|
-
|
|
100
|
-
<Plus size={20} />
|
|
101
|
-
</InteractiveIcon>,
|
|
95
|
+
/>,
|
|
102
96
|
);
|
|
103
97
|
|
|
104
98
|
const buttonElement = screen.getByTestId('pressable-icon');
|
|
@@ -112,13 +106,12 @@ describe('InteractiveIcon Component', () => {
|
|
|
112
106
|
renderWithProvider(
|
|
113
107
|
<InteractiveIcon
|
|
114
108
|
iconType='filled'
|
|
109
|
+
icon={Settings}
|
|
115
110
|
accessibilityLabel='Disabled'
|
|
116
111
|
onPress={handlePress}
|
|
117
112
|
disabled
|
|
118
113
|
testID='disabled-pressable'
|
|
119
|
-
|
|
120
|
-
<Settings size={20} />
|
|
121
|
-
</InteractiveIcon>,
|
|
114
|
+
/>,
|
|
122
115
|
);
|
|
123
116
|
|
|
124
117
|
const buttonElement = screen.getByTestId('disabled-pressable');
|
|
@@ -132,12 +125,11 @@ describe('InteractiveIcon Component', () => {
|
|
|
132
125
|
renderWithProvider(
|
|
133
126
|
<InteractiveIcon
|
|
134
127
|
iconType='stroked'
|
|
128
|
+
icon={Plus}
|
|
135
129
|
accessibilityLabel='Long pressable'
|
|
136
130
|
onLongPress={handleLongPress}
|
|
137
131
|
testID='long-pressable-icon'
|
|
138
|
-
|
|
139
|
-
<Plus size={20} />
|
|
140
|
-
</InteractiveIcon>,
|
|
132
|
+
/>,
|
|
141
133
|
);
|
|
142
134
|
|
|
143
135
|
const buttonElement = screen.getByTestId('long-pressable-icon');
|
|
@@ -151,15 +143,27 @@ describe('InteractiveIcon Component', () => {
|
|
|
151
143
|
renderWithProvider(
|
|
152
144
|
<InteractiveIcon
|
|
153
145
|
iconType='filled'
|
|
146
|
+
icon={Settings}
|
|
154
147
|
accessibilityLabel='Custom'
|
|
155
148
|
style={customStyle}
|
|
156
149
|
testID='custom-icon'
|
|
157
|
-
|
|
158
|
-
<Settings size={20} />
|
|
159
|
-
</InteractiveIcon>,
|
|
150
|
+
/>,
|
|
160
151
|
);
|
|
161
152
|
const buttonElement = screen.getByTestId('custom-icon');
|
|
162
|
-
// Style is merged as an array [resolvedStyle, customStyle]
|
|
163
153
|
expect(buttonElement.props.style).toMatchObject(customStyle);
|
|
164
154
|
});
|
|
155
|
+
|
|
156
|
+
it('should render with custom size', () => {
|
|
157
|
+
renderWithProvider(
|
|
158
|
+
<InteractiveIcon
|
|
159
|
+
iconType='filled'
|
|
160
|
+
icon={Settings}
|
|
161
|
+
size={24}
|
|
162
|
+
accessibilityLabel='Custom size'
|
|
163
|
+
testID='custom-size-icon'
|
|
164
|
+
/>,
|
|
165
|
+
);
|
|
166
|
+
const buttonElement = screen.getByTestId('custom-size-icon');
|
|
167
|
+
expect(buttonElement).toBeTruthy();
|
|
168
|
+
});
|
|
165
169
|
});
|