@ledgerhq/lumen-ui-rnative 0.1.36 → 0.1.38
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/Animations/Pulse/Pulse.mdx +1 -1
- package/dist/module/lib/Animations/Spin/Spin.mdx +1 -1
- package/dist/module/lib/Components/AddressInput/AddressInput.mdx +1 -1
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.js +68 -39
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.js.map +1 -1
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.mdx +7 -1
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.stories.js +24 -0
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.stories.js.map +1 -1
- package/dist/module/lib/Components/AmountDisplay/types.js.map +1 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.js +109 -72
- package/dist/module/lib/Components/AmountInput/AmountInput.js.map +1 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.mdx +13 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.stories.js +53 -0
- package/dist/module/lib/Components/AmountInput/AmountInput.stories.js.map +1 -1
- package/dist/module/lib/Components/Avatar/Avatar.js +6 -5
- package/dist/module/lib/Components/Avatar/Avatar.js.map +1 -1
- package/dist/module/lib/Components/Avatar/Avatar.mdx +3 -1
- package/dist/module/lib/Components/Avatar/Avatar.test.js +10 -13
- package/dist/module/lib/Components/Avatar/Avatar.test.js.map +1 -1
- package/dist/module/lib/Components/Banner/Banner.mdx +1 -1
- package/dist/module/lib/Components/BottomSheet/BottomSheet.mdx +1 -1
- package/dist/module/lib/Components/Button/Button.mdx +1 -1
- package/dist/module/lib/Components/Card/Card.stories.js +4 -9
- package/dist/module/lib/Components/Card/Card.stories.js.map +1 -1
- package/dist/module/lib/Components/CardButton/CardButton.mdx +1 -1
- package/dist/module/lib/Components/Checkbox/Checkbox.mdx +1 -1
- package/dist/module/lib/Components/Divider/Divider.mdx +1 -1
- package/dist/module/lib/Components/DotIcon/DotIcon.js +51 -27
- package/dist/module/lib/Components/DotIcon/DotIcon.js.map +1 -1
- package/dist/module/lib/Components/DotIcon/DotIcon.mdx +92 -0
- package/dist/module/lib/Components/DotIcon/DotIcon.stories.js +57 -0
- package/dist/module/lib/Components/DotIcon/DotIcon.stories.js.map +1 -1
- package/dist/module/lib/Components/DotIndicator/DotIndicator.js +5 -5
- package/dist/module/lib/Components/DotIndicator/DotIndicator.js.map +1 -1
- package/dist/module/lib/Components/DotIndicator/DotIndicator.mdx +4 -4
- package/dist/module/lib/Components/DotIndicator/DotIndicator.stories.js +3 -3
- package/dist/module/lib/Components/DotIndicator/DotIndicator.test.js +12 -2
- package/dist/module/lib/Components/DotIndicator/DotIndicator.test.js.map +1 -1
- package/dist/module/lib/Components/DotSymbol/DotSymbol.js +59 -34
- package/dist/module/lib/Components/DotSymbol/DotSymbol.js.map +1 -1
- package/dist/module/lib/Components/DotSymbol/DotSymbol.mdx +79 -2
- package/dist/module/lib/Components/DotSymbol/DotSymbol.stories.js +60 -0
- package/dist/module/lib/Components/DotSymbol/DotSymbol.stories.js.map +1 -1
- package/dist/module/lib/Components/IconButton/IconButton.mdx +1 -1
- package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.mdx +1 -1
- package/dist/module/lib/Components/Label/Label.js +1 -1
- package/dist/module/lib/Components/Link/Link.mdx +1 -1
- package/dist/module/lib/Components/MediaBanner/MediaBanner.mdx +1 -1
- package/dist/module/lib/Components/MediaButton/MediaButton.js +19 -19
- package/dist/module/lib/Components/MediaButton/MediaButton.js.map +1 -1
- package/dist/module/lib/Components/MediaButton/MediaButton.mdx +5 -5
- package/dist/module/lib/Components/MediaButton/MediaButton.stories.js +17 -17
- package/dist/module/lib/Components/MediaButton/MediaButton.stories.js.map +1 -1
- package/dist/module/lib/Components/MediaButton/MediaButton.test.js +4 -4
- package/dist/module/lib/Components/MediaButton/MediaButton.test.js.map +1 -1
- package/dist/module/lib/Components/MediaImage/MediaImage.js +24 -6
- package/dist/module/lib/Components/MediaImage/MediaImage.js.map +1 -1
- package/dist/module/lib/Components/MediaImage/MediaImage.mdx +1 -1
- package/dist/module/lib/Components/MediaImage/MediaImage.stories.js +47 -0
- package/dist/module/lib/Components/MediaImage/MediaImage.stories.js.map +1 -1
- package/dist/module/lib/Components/NavBar/CoinCapsule.js +2 -2
- package/dist/module/lib/Components/NavBar/CoinCapsule.js.map +1 -1
- package/dist/module/lib/Components/NavBar/NavBar.js +2 -2
- package/dist/module/lib/Components/NavBar/NavBar.js.map +1 -1
- package/dist/module/lib/Components/NavBar/NavBar.mdx +2 -2
- package/dist/module/lib/Components/NavBar/NavBar.stories.js +1 -1
- package/dist/module/lib/Components/NavBar/NavBar.stories.js.map +1 -1
- package/dist/module/lib/Components/NavBar/NavBar.test.js +3 -3
- package/dist/module/lib/Components/NavBar/NavBar.test.js.map +1 -1
- package/dist/module/lib/Components/OptionList/OptionList.mdx +1 -1
- package/dist/module/lib/Components/OptionList/OptionList.stories.js +4 -4
- package/dist/module/lib/Components/OptionList/OptionList.stories.js.map +1 -1
- package/dist/module/lib/Components/PageIndicator/PageIndicator.js +13 -8
- package/dist/module/lib/Components/PageIndicator/PageIndicator.js.map +1 -1
- package/dist/module/lib/Components/PageIndicator/PageIndicator.test.js +58 -0
- package/dist/module/lib/Components/PageIndicator/PageIndicator.test.js.map +1 -1
- package/dist/module/lib/Components/SearchInput/SearchInput.mdx +1 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.mdx +1 -1
- package/dist/module/lib/Components/Spinner/Spinner.mdx +1 -1
- package/dist/module/lib/Components/Spot/Spot.mdx +1 -1
- package/dist/module/lib/Components/Stepper/Stepper.mdx +1 -1
- package/dist/module/lib/Components/Subheader/Subheader.mdx +1 -1
- package/dist/module/lib/Components/Switch/Switch.mdx +1 -1
- package/dist/module/lib/Components/TabBar/TabBar.mdx +1 -1
- package/dist/module/lib/Components/TextInput/TextInput.mdx +1 -1
- package/dist/module/lib/Components/ThemeProvider/ThemeProvider.js +2 -5
- package/dist/module/lib/Components/ThemeProvider/ThemeProvider.js.map +1 -1
- package/dist/module/lib/Components/Tile/Tile.mdx +1 -1
- package/dist/module/lib/Components/Tooltip/Tooltip.mdx +1 -1
- package/dist/module/lib/Components/index.js +0 -1
- package/dist/module/lib/Components/index.js.map +1 -1
- package/dist/module/lib/Symbols/Icons/Lightbulb.js +3 -3
- package/dist/module/lib/Symbols/Icons/Lightbulb.js.map +1 -1
- package/dist/typescript/src/lib/Components/AmountDisplay/AmountDisplay.d.ts +1 -1
- package/dist/typescript/src/lib/Components/AmountDisplay/AmountDisplay.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/AmountDisplay/index.d.ts +1 -1
- package/dist/typescript/src/lib/Components/AmountDisplay/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/AmountDisplay/types.d.ts +10 -3
- package/dist/typescript/src/lib/Components/AmountDisplay/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts +1 -1
- package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/AmountInput/types.d.ts +12 -0
- package/dist/typescript/src/lib/Components/AmountInput/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Avatar/Avatar.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/DotIcon/DotIcon.d.ts +3 -2
- package/dist/typescript/src/lib/Components/DotIcon/DotIcon.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/DotIcon/types.d.ts +7 -1
- package/dist/typescript/src/lib/Components/DotIcon/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/DotIndicator/types.d.ts +2 -2
- package/dist/typescript/src/lib/Components/DotSymbol/DotSymbol.d.ts +1 -1
- package/dist/typescript/src/lib/Components/DotSymbol/DotSymbol.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/DotSymbol/types.d.ts +7 -1
- package/dist/typescript/src/lib/Components/DotSymbol/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Label/Label.d.ts +1 -1
- package/dist/typescript/src/lib/Components/MediaButton/MediaButton.d.ts +5 -5
- package/dist/typescript/src/lib/Components/MediaButton/MediaButton.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/MediaButton/types.d.ts +6 -6
- package/dist/typescript/src/lib/Components/MediaButton/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/MediaImage/MediaImage.d.ts +1 -1
- package/dist/typescript/src/lib/Components/MediaImage/MediaImage.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/MediaImage/types.d.ts +7 -1
- package/dist/typescript/src/lib/Components/MediaImage/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/NavBar/CoinCapsule.d.ts +1 -1
- package/dist/typescript/src/lib/Components/NavBar/CoinCapsule.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/NavBar/NavBar.d.ts +1 -1
- package/dist/typescript/src/lib/Components/NavBar/NavBar.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/NavBar/types.d.ts +3 -3
- package/dist/typescript/src/lib/Components/NavBar/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/PageIndicator/PageIndicator.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/index.d.ts +0 -1
- package/dist/typescript/src/lib/Components/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/lib/Animations/Pulse/Pulse.mdx +1 -1
- package/src/lib/Animations/Spin/Spin.mdx +1 -1
- package/src/lib/Components/AddressInput/AddressInput.mdx +1 -1
- package/src/lib/Components/AmountDisplay/AmountDisplay.mdx +7 -1
- package/src/lib/Components/AmountDisplay/AmountDisplay.stories.tsx +18 -0
- package/src/lib/Components/AmountDisplay/AmountDisplay.tsx +71 -40
- package/src/lib/Components/AmountDisplay/index.ts +5 -1
- package/src/lib/Components/AmountDisplay/types.ts +12 -3
- package/src/lib/Components/AmountInput/AmountInput.mdx +13 -1
- package/src/lib/Components/AmountInput/AmountInput.stories.tsx +68 -1
- package/src/lib/Components/AmountInput/AmountInput.tsx +118 -75
- package/src/lib/Components/AmountInput/types.ts +14 -0
- package/src/lib/Components/Avatar/Avatar.mdx +3 -1
- package/src/lib/Components/Avatar/Avatar.test.tsx +16 -18
- package/src/lib/Components/Avatar/Avatar.tsx +9 -8
- package/src/lib/Components/Banner/Banner.mdx +1 -1
- package/src/lib/Components/BottomSheet/BottomSheet.mdx +1 -1
- package/src/lib/Components/Button/Button.mdx +1 -1
- package/src/lib/Components/Card/Card.stories.tsx +1 -3
- package/src/lib/Components/CardButton/CardButton.mdx +1 -1
- package/src/lib/Components/Checkbox/Checkbox.mdx +1 -1
- package/src/lib/Components/Divider/Divider.mdx +1 -1
- package/src/lib/Components/DotIcon/DotIcon.mdx +92 -0
- package/src/lib/Components/DotIcon/DotIcon.stories.tsx +43 -0
- package/src/lib/Components/DotIcon/DotIcon.tsx +35 -15
- package/src/lib/Components/DotIcon/types.ts +7 -1
- package/src/lib/Components/DotIndicator/DotIndicator.mdx +4 -4
- package/src/lib/Components/DotIndicator/DotIndicator.stories.tsx +2 -2
- package/src/lib/Components/DotIndicator/DotIndicator.test.tsx +12 -2
- package/src/lib/Components/DotIndicator/DotIndicator.tsx +5 -5
- package/src/lib/Components/DotIndicator/types.ts +2 -2
- package/src/lib/Components/DotSymbol/DotSymbol.mdx +79 -2
- package/src/lib/Components/DotSymbol/DotSymbol.stories.tsx +32 -0
- package/src/lib/Components/DotSymbol/DotSymbol.tsx +46 -25
- package/src/lib/Components/DotSymbol/types.ts +7 -1
- package/src/lib/Components/IconButton/IconButton.mdx +1 -1
- package/src/lib/Components/InteractiveIcon/InteractiveIcon.mdx +1 -1
- package/src/lib/Components/Label/Label.tsx +1 -1
- package/src/lib/Components/Link/Link.mdx +1 -1
- package/src/lib/Components/MediaBanner/MediaBanner.mdx +1 -1
- package/src/lib/Components/MediaButton/MediaButton.mdx +5 -5
- package/src/lib/Components/MediaButton/MediaButton.stories.tsx +29 -15
- package/src/lib/Components/MediaButton/MediaButton.test.tsx +4 -4
- package/src/lib/Components/MediaButton/MediaButton.tsx +35 -22
- package/src/lib/Components/MediaButton/types.ts +6 -6
- package/src/lib/Components/MediaImage/MediaImage.mdx +1 -1
- package/src/lib/Components/MediaImage/MediaImage.stories.tsx +21 -0
- package/src/lib/Components/MediaImage/MediaImage.tsx +14 -2
- package/src/lib/Components/MediaImage/types.ts +7 -1
- package/src/lib/Components/NavBar/CoinCapsule.tsx +2 -2
- package/src/lib/Components/NavBar/NavBar.mdx +2 -2
- package/src/lib/Components/NavBar/NavBar.stories.tsx +3 -1
- package/src/lib/Components/NavBar/NavBar.test.tsx +3 -3
- package/src/lib/Components/NavBar/NavBar.tsx +2 -2
- package/src/lib/Components/NavBar/types.ts +3 -3
- package/src/lib/Components/OptionList/OptionList.mdx +1 -1
- package/src/lib/Components/OptionList/OptionList.stories.tsx +4 -4
- package/src/lib/Components/PageIndicator/PageIndicator.test.tsx +78 -0
- package/src/lib/Components/PageIndicator/PageIndicator.tsx +15 -7
- package/src/lib/Components/SearchInput/SearchInput.mdx +1 -1
- package/src/lib/Components/SegmentedControl/SegmentedControl.mdx +1 -1
- package/src/lib/Components/Spinner/Spinner.mdx +1 -1
- package/src/lib/Components/Spot/Spot.mdx +1 -1
- package/src/lib/Components/Stepper/Stepper.mdx +1 -1
- package/src/lib/Components/Subheader/Subheader.mdx +1 -1
- package/src/lib/Components/Switch/Switch.mdx +1 -1
- package/src/lib/Components/TabBar/TabBar.mdx +1 -1
- package/src/lib/Components/TextInput/TextInput.mdx +1 -1
- package/src/lib/Components/ThemeProvider/ThemeProvider.tsx +1 -4
- package/src/lib/Components/Tile/Tile.mdx +1 -1
- package/src/lib/Components/Tooltip/Tooltip.mdx +1 -1
- package/src/lib/Components/index.ts +0 -1
- package/src/lib/Symbols/Icons/Lightbulb.tsx +3 -3
- package/dist/module/lib/Components/Select/GlobalSelectBottomSheet.js +0 -155
- package/dist/module/lib/Components/Select/GlobalSelectBottomSheet.js.map +0 -1
- package/dist/module/lib/Components/Select/GlobalSelectContext.js +0 -78
- package/dist/module/lib/Components/Select/GlobalSelectContext.js.map +0 -1
- package/dist/module/lib/Components/Select/Select.js +0 -366
- package/dist/module/lib/Components/Select/Select.js.map +0 -1
- package/dist/module/lib/Components/Select/Select.mdx +0 -596
- package/dist/module/lib/Components/Select/Select.stories.js +0 -304
- package/dist/module/lib/Components/Select/Select.stories.js.map +0 -1
- package/dist/module/lib/Components/Select/Select.test.js +0 -123
- package/dist/module/lib/Components/Select/Select.test.js.map +0 -1
- package/dist/module/lib/Components/Select/SelectContext.js +0 -38
- package/dist/module/lib/Components/Select/SelectContext.js.map +0 -1
- package/dist/module/lib/Components/Select/index.js +0 -6
- package/dist/module/lib/Components/Select/index.js.map +0 -1
- package/dist/module/lib/Components/Select/types.js +0 -4
- package/dist/module/lib/Components/Select/types.js.map +0 -1
- package/dist/typescript/src/lib/Components/Select/GlobalSelectBottomSheet.d.ts +0 -20
- package/dist/typescript/src/lib/Components/Select/GlobalSelectBottomSheet.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/Select/GlobalSelectContext.d.ts +0 -44
- package/dist/typescript/src/lib/Components/Select/GlobalSelectContext.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/Select/Select.d.ts +0 -52
- package/dist/typescript/src/lib/Components/Select/Select.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/Select/SelectContext.d.ts +0 -36
- package/dist/typescript/src/lib/Components/Select/SelectContext.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/Select/index.d.ts +0 -4
- package/dist/typescript/src/lib/Components/Select/index.d.ts.map +0 -1
- package/dist/typescript/src/lib/Components/Select/types.d.ts +0 -130
- package/dist/typescript/src/lib/Components/Select/types.d.ts.map +0 -1
- package/src/lib/Components/Select/GlobalSelectBottomSheet.tsx +0 -180
- package/src/lib/Components/Select/GlobalSelectContext.tsx +0 -103
- package/src/lib/Components/Select/Select.mdx +0 -596
- package/src/lib/Components/Select/Select.stories.tsx +0 -266
- package/src/lib/Components/Select/Select.test.tsx +0 -117
- package/src/lib/Components/Select/Select.tsx +0 -469
- package/src/lib/Components/Select/SelectContext.tsx +0 -68
- package/src/lib/Components/Select/index.ts +0 -3
- package/src/lib/Components/Select/types.ts +0 -149
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
DisabledProvider,
|
|
3
|
+
useDisabledContext,
|
|
4
|
+
} from '@ledgerhq/lumen-utils-shared';
|
|
2
5
|
import { useStyleSheet } from '../../../styles';
|
|
3
6
|
import type { IconSize } from '../Icon';
|
|
4
7
|
import { Box } from '../Utility';
|
|
@@ -13,12 +16,14 @@ const dotIconSizeMap: Record<DotIconSize, IconSize> = {
|
|
|
13
16
|
16: 12,
|
|
14
17
|
20: 16,
|
|
15
18
|
24: 16,
|
|
19
|
+
32: 20,
|
|
16
20
|
};
|
|
17
21
|
|
|
18
22
|
const dotSquareRadiusMap: Record<DotIconSize, number> = {
|
|
19
23
|
16: 5,
|
|
20
24
|
20: 6,
|
|
21
25
|
24: 8,
|
|
26
|
+
32: 10,
|
|
22
27
|
};
|
|
23
28
|
|
|
24
29
|
export const mediaImageDotIconSizeMap = {
|
|
@@ -26,13 +31,14 @@ export const mediaImageDotIconSizeMap = {
|
|
|
26
31
|
48: 20,
|
|
27
32
|
56: 24,
|
|
28
33
|
64: 24,
|
|
34
|
+
72: 32,
|
|
29
35
|
} as const satisfies Record<number, DotIconSize>;
|
|
30
36
|
|
|
31
37
|
export const spotDotIconSizeMap = {
|
|
32
38
|
40: 16,
|
|
33
39
|
48: 20,
|
|
34
40
|
56: 24,
|
|
35
|
-
72:
|
|
41
|
+
72: 32,
|
|
36
42
|
} as const satisfies Record<number, DotIconSize>;
|
|
37
43
|
|
|
38
44
|
const pinAxisMap: Record<DotIconPin, [vertical: string, horizontal: string]> = {
|
|
@@ -63,11 +69,13 @@ const useStyles = ({
|
|
|
63
69
|
shape,
|
|
64
70
|
pin,
|
|
65
71
|
appearance,
|
|
72
|
+
disabled,
|
|
66
73
|
}: {
|
|
67
74
|
size: DotIconSize;
|
|
68
75
|
shape: 'square' | 'circle';
|
|
69
76
|
pin: DotIconPin;
|
|
70
77
|
appearance: DotIconAppearance;
|
|
78
|
+
disabled: boolean;
|
|
71
79
|
}) => {
|
|
72
80
|
return useStyleSheet(
|
|
73
81
|
(t) => {
|
|
@@ -77,6 +85,10 @@ const useStyles = ({
|
|
|
77
85
|
const pinOffset = getPinOffset(pin);
|
|
78
86
|
|
|
79
87
|
return {
|
|
88
|
+
root: {
|
|
89
|
+
position: 'relative',
|
|
90
|
+
...(disabled && { opacity: 0.3 }),
|
|
91
|
+
},
|
|
80
92
|
dot: {
|
|
81
93
|
position: 'absolute',
|
|
82
94
|
zIndex: 10,
|
|
@@ -96,7 +108,7 @@ const useStyles = ({
|
|
|
96
108
|
},
|
|
97
109
|
};
|
|
98
110
|
},
|
|
99
|
-
[size, shape, pin, appearance],
|
|
111
|
+
[size, shape, pin, appearance, disabled],
|
|
100
112
|
);
|
|
101
113
|
};
|
|
102
114
|
|
|
@@ -119,27 +131,35 @@ export const DotIcon = ({
|
|
|
119
131
|
pin = 'bottom-end',
|
|
120
132
|
size = 20,
|
|
121
133
|
shape = 'circle',
|
|
134
|
+
disabled: disabledProp = false,
|
|
122
135
|
lx = {},
|
|
123
136
|
style,
|
|
124
137
|
ref,
|
|
125
138
|
...rest
|
|
126
139
|
}: DotIconProps) => {
|
|
127
|
-
const
|
|
140
|
+
const disabled = useDisabledContext({
|
|
141
|
+
consumerName: 'DotIcon',
|
|
142
|
+
mergeWith: { disabled: disabledProp },
|
|
143
|
+
});
|
|
144
|
+
const styles = useStyles({ size, shape, pin, appearance, disabled });
|
|
128
145
|
|
|
129
146
|
return (
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
<Box
|
|
139
|
-
|
|
147
|
+
<DisabledProvider value={{ disabled: false }}>
|
|
148
|
+
<Box
|
|
149
|
+
ref={ref}
|
|
150
|
+
lx={lx}
|
|
151
|
+
style={[styles.root, style]}
|
|
152
|
+
accessibilityState={{ disabled }}
|
|
153
|
+
{...rest}
|
|
154
|
+
>
|
|
155
|
+
<Box style={{ alignSelf: 'flex-start', position: 'relative' }}>
|
|
156
|
+
{children}
|
|
157
|
+
<Box testID='dot-icon-dot' style={styles.dot}>
|
|
158
|
+
<Icon size={dotIconSizeMap[size]} style={styles.icon} />
|
|
159
|
+
</Box>
|
|
140
160
|
</Box>
|
|
141
161
|
</Box>
|
|
142
|
-
</
|
|
162
|
+
</DisabledProvider>
|
|
143
163
|
);
|
|
144
164
|
};
|
|
145
165
|
|
|
@@ -3,7 +3,7 @@ import type { StyleProp, TextStyle } from 'react-native';
|
|
|
3
3
|
import type { StyledViewProps } from '../../../styles';
|
|
4
4
|
import type { IconSize } from '../Icon';
|
|
5
5
|
|
|
6
|
-
export type DotIconSize = 16 | 20 | 24;
|
|
6
|
+
export type DotIconSize = 16 | 20 | 24 | 32;
|
|
7
7
|
|
|
8
8
|
export type DotIconPin =
|
|
9
9
|
| 'top-start'
|
|
@@ -37,6 +37,12 @@ export type DotIconProps = {
|
|
|
37
37
|
* @default 'circle'
|
|
38
38
|
*/
|
|
39
39
|
shape?: 'square' | 'circle';
|
|
40
|
+
/**
|
|
41
|
+
* Shows a disabled appearance.
|
|
42
|
+
* @optional
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
disabled?: boolean;
|
|
40
46
|
/**
|
|
41
47
|
* The wrapped component (e.g. MediaImage or Spot).
|
|
42
48
|
*/
|
|
@@ -24,10 +24,10 @@ import { CustomTabs, Tab } from '../../../../.storybook/components';
|
|
|
24
24
|
|
|
25
25
|
DotIndicator comes in four sizes:
|
|
26
26
|
|
|
27
|
-
- **
|
|
28
|
-
- **
|
|
29
|
-
- **
|
|
30
|
-
- **
|
|
27
|
+
- **sm** - compact dot for tight layouts.
|
|
28
|
+
- **md** (default) - standard dot for most use cases.
|
|
29
|
+
- **lg** - large dot for prominent indicators.
|
|
30
|
+
- **xl** - extra-large dot for maximum visibility.
|
|
31
31
|
|
|
32
32
|
<Canvas of={DotIndicatorStories.SizeShowcase} />
|
|
33
33
|
|
|
@@ -21,7 +21,7 @@ const meta = {
|
|
|
21
21
|
argTypes: {
|
|
22
22
|
size: {
|
|
23
23
|
control: 'radio',
|
|
24
|
-
options: ['
|
|
24
|
+
options: ['sm', 'md', 'lg', 'xl'],
|
|
25
25
|
},
|
|
26
26
|
appearance: {
|
|
27
27
|
control: 'radio',
|
|
@@ -42,10 +42,10 @@ export const Base: Story = {
|
|
|
42
42
|
export const SizeShowcase: Story = {
|
|
43
43
|
render: () => (
|
|
44
44
|
<Box lx={{ flexDirection: 'row', alignItems: 'center', gap: 's12' }}>
|
|
45
|
-
<DotIndicator size='xs' />
|
|
46
45
|
<DotIndicator size='sm' />
|
|
47
46
|
<DotIndicator size='md' />
|
|
48
47
|
<DotIndicator size='lg' />
|
|
48
|
+
<DotIndicator size='xl' />
|
|
49
49
|
</Box>
|
|
50
50
|
),
|
|
51
51
|
};
|
|
@@ -77,10 +77,10 @@ describe('DotIndicator', () => {
|
|
|
77
77
|
expect(ref.current).toBeTruthy();
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
-
it('should render in
|
|
80
|
+
it('should render in sm size', () => {
|
|
81
81
|
const { toJSON } = render(
|
|
82
82
|
<TestWrapper>
|
|
83
|
-
<DotIndicator size='
|
|
83
|
+
<DotIndicator size='sm' />
|
|
84
84
|
</TestWrapper>,
|
|
85
85
|
);
|
|
86
86
|
|
|
@@ -107,6 +107,16 @@ describe('DotIndicator', () => {
|
|
|
107
107
|
expect(toJSON()).toBeTruthy();
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
+
it('should render in xl size', () => {
|
|
111
|
+
const { toJSON } = render(
|
|
112
|
+
<TestWrapper>
|
|
113
|
+
<DotIndicator size='xl' />
|
|
114
|
+
</TestWrapper>,
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
expect(toJSON()).toBeTruthy();
|
|
118
|
+
});
|
|
119
|
+
|
|
110
120
|
it('should render with red appearance', () => {
|
|
111
121
|
const { toJSON } = render(
|
|
112
122
|
<TestWrapper>
|
|
@@ -5,7 +5,7 @@ import { Box } from '../Utility';
|
|
|
5
5
|
import type { DotIndicatorProps } from './types';
|
|
6
6
|
|
|
7
7
|
export function DotIndicator({
|
|
8
|
-
size = '
|
|
8
|
+
size = 'md',
|
|
9
9
|
appearance = 'base',
|
|
10
10
|
disabled: disabledProp = false,
|
|
11
11
|
lx = {},
|
|
@@ -63,10 +63,10 @@ const useStyles = ({
|
|
|
63
63
|
return useStyleSheet(
|
|
64
64
|
(t) => {
|
|
65
65
|
const sizeMap = {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
sm: t.sizes.s6,
|
|
67
|
+
md: t.sizes.s8,
|
|
68
|
+
lg: t.sizes.s10,
|
|
69
|
+
xl: t.sizes.s12,
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
const bgColorMap = {
|
|
@@ -4,9 +4,9 @@ import type { StyledViewProps } from '../../../styles';
|
|
|
4
4
|
export type DotIndicatorProps = {
|
|
5
5
|
/**
|
|
6
6
|
* The size of the dot indicator.
|
|
7
|
-
* @default
|
|
7
|
+
* @default md
|
|
8
8
|
*/
|
|
9
|
-
size?: '
|
|
9
|
+
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
10
10
|
/**
|
|
11
11
|
* The appearance of the dot indicator.
|
|
12
12
|
* @default base
|
|
@@ -4,14 +4,17 @@ import { CustomTabs, Tab } from '../../../../.storybook/components';
|
|
|
4
4
|
|
|
5
5
|
<Meta title='Communication/DotSymbol' of={DotSymbolStories} />
|
|
6
6
|
|
|
7
|
+
# DotSymbol
|
|
8
|
+
|
|
7
9
|
<CustomTabs>
|
|
8
10
|
<Tab label="Overview">
|
|
9
|
-
# DotSymbol
|
|
10
11
|
|
|
11
12
|
## Introduction
|
|
12
13
|
|
|
13
14
|
DotSymbol positions a small image indicator at a configurable corner of a child element such as MediaImage or Spot. It is commonly used to show a network badge or secondary icon overlapping a primary symbol.
|
|
14
15
|
|
|
16
|
+
> View in [Figma](https://www.figma.com/design/zSkvGGiqcnhywp2l3HTHxA/1.-Symbol-Library?node-id=8602-380&m=dev).
|
|
17
|
+
|
|
15
18
|
## Anatomy
|
|
16
19
|
|
|
17
20
|
<Canvas of={DotSymbolStories.Base} />
|
|
@@ -46,9 +49,83 @@ The dot size is driven by the parent MediaImage or Spot size via the mapping hel
|
|
|
46
49
|
|
|
47
50
|
<Canvas of={DotSymbolStories.SizeShowcase} />
|
|
48
51
|
|
|
52
|
+
### Disabled
|
|
53
|
+
|
|
54
|
+
Only set `disabled` on `DotSymbol`. The state is propagated to the child via context. Passing it to both stacks the opacity overlay.
|
|
55
|
+
|
|
56
|
+
<Canvas of={DotSymbolStories.DisabledShowcase} />
|
|
57
|
+
|
|
49
58
|
## Accessibility
|
|
50
59
|
|
|
51
60
|
- Always provide a meaningful `alt` prop on the DotSymbol so the indicator image is announced by screen readers.
|
|
52
61
|
- The child element should carry its own accessibility label independently.
|
|
62
|
+
|
|
63
|
+
</Tab>
|
|
64
|
+
<Tab label="Implementation">
|
|
65
|
+
|
|
66
|
+
## Setup
|
|
67
|
+
|
|
68
|
+
Install and set up the library with our [Setup Guide →](?path=/docs/getting-started-setup--docs).
|
|
69
|
+
|
|
70
|
+
### Basic Usage
|
|
71
|
+
|
|
72
|
+
```tsx
|
|
73
|
+
import { DotSymbol, MediaImage } from '@ledgerhq/lumen-ui-rnative';
|
|
74
|
+
|
|
75
|
+
function MyComponent() {
|
|
76
|
+
return (
|
|
77
|
+
<DotSymbol src='https://example.com/btc.png' alt='Bitcoin network'>
|
|
78
|
+
<MediaImage src='https://example.com/ada.png' alt='Cardano' size={48} />
|
|
79
|
+
</DotSymbol>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Pin Placement
|
|
85
|
+
|
|
86
|
+
Position the dot at any of the four corners of the child:
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
<DotSymbol src='https://example.com/btc.png' alt='Bitcoin' pin='top-end'>
|
|
90
|
+
<MediaImage src='https://example.com/ada.png' alt='Cardano' size={48} />
|
|
91
|
+
</DotSymbol>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Shapes
|
|
95
|
+
|
|
96
|
+
Use `shape='square'` to match a square child element:
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
<DotSymbol src='https://example.com/btc.png' alt='Bitcoin' shape='square'>
|
|
100
|
+
<MediaImage src='https://example.com/ada.png' alt='Cardano' size={48} shape='square' />
|
|
101
|
+
</DotSymbol>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Sizing
|
|
105
|
+
|
|
106
|
+
The dot size is driven by the parent's size via the mapping helpers:
|
|
107
|
+
|
|
108
|
+
```tsx
|
|
109
|
+
import { DotSymbol, mediaImageDotSizeMap, MediaImage } from '@ledgerhq/lumen-ui-rnative';
|
|
110
|
+
|
|
111
|
+
<DotSymbol
|
|
112
|
+
src='https://example.com/btc.png'
|
|
113
|
+
alt='Bitcoin'
|
|
114
|
+
size={mediaImageDotSizeMap[48]}
|
|
115
|
+
>
|
|
116
|
+
<MediaImage src='https://example.com/ada.png' alt='Cardano' size={48} />
|
|
117
|
+
</DotSymbol>;
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Disabled State
|
|
121
|
+
|
|
122
|
+
Only set `disabled` on `DotSymbol`. The state is propagated to the child via context. Passing it to both stacks the opacity overlay.
|
|
123
|
+
|
|
124
|
+
```tsx
|
|
125
|
+
<DotSymbol src='https://example.com/btc.png' alt='Bitcoin' disabled>
|
|
126
|
+
<MediaImage src='https://example.com/ada.png' alt='Cardano' size={48} />
|
|
127
|
+
</DotSymbol>
|
|
128
|
+
```
|
|
129
|
+
|
|
53
130
|
</Tab>
|
|
54
|
-
</CustomTabs>
|
|
131
|
+
</CustomTabs>
|
|
@@ -92,6 +92,23 @@ export const ShapeShowcase: Story = {
|
|
|
92
92
|
),
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
+
export const DisabledShowcase: Story = {
|
|
96
|
+
args: { src: dotSrc, alt: 'Disabled showcase' },
|
|
97
|
+
render: () => (
|
|
98
|
+
<Box lx={{ flexDirection: 'row', alignItems: 'center', gap: 's32' }}>
|
|
99
|
+
<DotSymbol src={dotSrc} pin='bottom-end' disabled>
|
|
100
|
+
<MediaImage src={parentSrc} size={48} shape='circle' />
|
|
101
|
+
</DotSymbol>
|
|
102
|
+
<DotSymbol src={dotSrc} pin='bottom-end' shape='square' disabled>
|
|
103
|
+
<MediaImage src={parentSrc} size={48} shape='square' />
|
|
104
|
+
</DotSymbol>
|
|
105
|
+
<DotSymbol src={dotSrc} pin='bottom-end' disabled>
|
|
106
|
+
<Spot appearance='icon' icon={CoinAlert} />
|
|
107
|
+
</DotSymbol>
|
|
108
|
+
</Box>
|
|
109
|
+
),
|
|
110
|
+
};
|
|
111
|
+
|
|
95
112
|
export const SizeShowcase: Story = {
|
|
96
113
|
args: { src: dotSrc, alt: 'Size showcase' },
|
|
97
114
|
render: () => (
|
|
@@ -146,6 +163,13 @@ export const SizeShowcase: Story = {
|
|
|
146
163
|
>
|
|
147
164
|
<MediaImage src={parentSrc} size={64} shape='circle' />
|
|
148
165
|
</DotSymbol>
|
|
166
|
+
<DotSymbol
|
|
167
|
+
src={dotSrc}
|
|
168
|
+
size={mediaImageDotSizeMap[72]}
|
|
169
|
+
pin='bottom-end'
|
|
170
|
+
>
|
|
171
|
+
<MediaImage src={parentSrc} size={72} shape='circle' />
|
|
172
|
+
</DotSymbol>
|
|
149
173
|
</Box>
|
|
150
174
|
<Box lx={{ flexDirection: 'row', alignItems: 'flex-end', gap: 's24' }}>
|
|
151
175
|
<DotSymbol
|
|
@@ -204,6 +228,14 @@ export const SizeShowcase: Story = {
|
|
|
204
228
|
>
|
|
205
229
|
<MediaImage src={parentSrc} size={64} shape='square' />
|
|
206
230
|
</DotSymbol>
|
|
231
|
+
<DotSymbol
|
|
232
|
+
shape='square'
|
|
233
|
+
src={dotSrc}
|
|
234
|
+
size={mediaImageDotSizeMap[72]}
|
|
235
|
+
pin='bottom-end'
|
|
236
|
+
>
|
|
237
|
+
<MediaImage src={parentSrc} size={72} shape='square' />
|
|
238
|
+
</DotSymbol>
|
|
207
239
|
</Box>
|
|
208
240
|
</Box>
|
|
209
241
|
),
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DisabledProvider,
|
|
3
|
+
useDisabledContext,
|
|
4
|
+
} from '@ledgerhq/lumen-utils-shared';
|
|
1
5
|
import { useEffect, useState } from 'react';
|
|
2
|
-
import { Image
|
|
6
|
+
import { Image } from 'react-native';
|
|
3
7
|
import { useStyleSheet } from '../../../styles';
|
|
4
8
|
import type { MediaImageSize } from '../MediaImage';
|
|
5
9
|
import type { SpotSize } from '../Spot';
|
|
@@ -13,6 +17,7 @@ const dotSquareRadiusMap: Record<DotSymbolSize, number> = {
|
|
|
13
17
|
16: 5,
|
|
14
18
|
20: 6,
|
|
15
19
|
24: 8,
|
|
20
|
+
32: 10,
|
|
16
21
|
};
|
|
17
22
|
|
|
18
23
|
const offsetBySize: Record<DotSymbolSize, number> = {
|
|
@@ -22,6 +27,7 @@ const offsetBySize: Record<DotSymbolSize, number> = {
|
|
|
22
27
|
16: -3,
|
|
23
28
|
20: -3,
|
|
24
29
|
24: -3,
|
|
30
|
+
32: -3,
|
|
25
31
|
};
|
|
26
32
|
|
|
27
33
|
export const mediaImageDotSizeMap: Record<MediaImageSize, DotSymbolSize> = {
|
|
@@ -34,6 +40,7 @@ export const mediaImageDotSizeMap: Record<MediaImageSize, DotSymbolSize> = {
|
|
|
34
40
|
48: 20,
|
|
35
41
|
56: 24,
|
|
36
42
|
64: 24,
|
|
43
|
+
72: 32,
|
|
37
44
|
};
|
|
38
45
|
|
|
39
46
|
export const spotDotSizeMap: Record<SpotSize, DotSymbolSize> = {
|
|
@@ -41,7 +48,7 @@ export const spotDotSizeMap: Record<SpotSize, DotSymbolSize> = {
|
|
|
41
48
|
40: 16,
|
|
42
49
|
48: 20,
|
|
43
50
|
56: 24,
|
|
44
|
-
72:
|
|
51
|
+
72: 32,
|
|
45
52
|
};
|
|
46
53
|
|
|
47
54
|
const pinAxisMap: Record<DotSymbolPin, [vertical: string, horizontal: string]> =
|
|
@@ -65,10 +72,12 @@ const useStyles = ({
|
|
|
65
72
|
size,
|
|
66
73
|
shape,
|
|
67
74
|
pin,
|
|
75
|
+
disabled,
|
|
68
76
|
}: {
|
|
69
77
|
size: DotSymbolSize;
|
|
70
78
|
shape: 'square' | 'circle';
|
|
71
79
|
pin: DotSymbolPin;
|
|
80
|
+
disabled: boolean;
|
|
72
81
|
}) => {
|
|
73
82
|
return useStyleSheet(
|
|
74
83
|
(t) => {
|
|
@@ -78,6 +87,10 @@ const useStyles = ({
|
|
|
78
87
|
const pinOffset = getPinOffset(pin, size);
|
|
79
88
|
|
|
80
89
|
return {
|
|
90
|
+
root: {
|
|
91
|
+
position: 'relative',
|
|
92
|
+
...(disabled && { opacity: 0.3 }),
|
|
93
|
+
},
|
|
81
94
|
dot: {
|
|
82
95
|
position: 'absolute',
|
|
83
96
|
zIndex: 10,
|
|
@@ -96,7 +109,7 @@ const useStyles = ({
|
|
|
96
109
|
},
|
|
97
110
|
};
|
|
98
111
|
},
|
|
99
|
-
[size, shape, pin],
|
|
112
|
+
[size, shape, pin, disabled],
|
|
100
113
|
);
|
|
101
114
|
};
|
|
102
115
|
|
|
@@ -118,42 +131,50 @@ export const DotSymbol = ({
|
|
|
118
131
|
pin = 'bottom-end',
|
|
119
132
|
size = 20,
|
|
120
133
|
shape = 'circle',
|
|
134
|
+
disabled: disabledProp = false,
|
|
121
135
|
lx = {},
|
|
122
136
|
style,
|
|
123
137
|
ref,
|
|
124
138
|
...rest
|
|
125
139
|
}: DotSymbolProps) => {
|
|
126
|
-
const styles = useStyles({ size, shape, pin });
|
|
127
140
|
const [error, setError] = useState(false);
|
|
141
|
+
const disabled = useDisabledContext({
|
|
142
|
+
consumerName: 'DotSymbol',
|
|
143
|
+
mergeWith: { disabled: disabledProp },
|
|
144
|
+
});
|
|
145
|
+
const styles = useStyles({ size, shape, pin, disabled });
|
|
128
146
|
|
|
129
147
|
useEffect(() => {
|
|
130
148
|
setError(false);
|
|
131
149
|
}, [src]);
|
|
132
150
|
|
|
133
151
|
return (
|
|
134
|
-
<
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
<Box style={
|
|
145
|
-
{
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
<DisabledProvider value={{ disabled: false }}>
|
|
153
|
+
<Box
|
|
154
|
+
ref={ref}
|
|
155
|
+
lx={lx}
|
|
156
|
+
style={[styles.root, style]}
|
|
157
|
+
accessibilityRole='image'
|
|
158
|
+
accessibilityLabel={alt}
|
|
159
|
+
accessibilityState={{ disabled }}
|
|
160
|
+
{...rest}
|
|
161
|
+
>
|
|
162
|
+
<Box style={{ alignSelf: 'flex-start', position: 'relative' }}>
|
|
163
|
+
{children}
|
|
164
|
+
<Box style={styles.dot}>
|
|
165
|
+
{!error && (
|
|
166
|
+
<Image
|
|
167
|
+
source={{ uri: src }}
|
|
168
|
+
style={styles.image}
|
|
169
|
+
accessible={false}
|
|
170
|
+
onError={() => setError(true)}
|
|
171
|
+
testID='dot-symbol-img'
|
|
172
|
+
/>
|
|
173
|
+
)}
|
|
174
|
+
</Box>
|
|
154
175
|
</Box>
|
|
155
176
|
</Box>
|
|
156
|
-
</
|
|
177
|
+
</DisabledProvider>
|
|
157
178
|
);
|
|
158
179
|
};
|
|
159
180
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { StyledViewProps } from '../../../styles';
|
|
3
3
|
|
|
4
|
-
export type DotSymbolSize = 8 | 10 | 12 | 16 | 20 | 24;
|
|
4
|
+
export type DotSymbolSize = 8 | 10 | 12 | 16 | 20 | 24 | 32;
|
|
5
5
|
|
|
6
6
|
export type DotSymbolPin =
|
|
7
7
|
| 'top-start'
|
|
@@ -33,6 +33,12 @@ export type DotSymbolProps = {
|
|
|
33
33
|
* @default 'circle'
|
|
34
34
|
*/
|
|
35
35
|
shape?: 'square' | 'circle';
|
|
36
|
+
/**
|
|
37
|
+
* Shows a disabled appearance.
|
|
38
|
+
* @optional
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
disabled?: boolean;
|
|
36
42
|
/**
|
|
37
43
|
* The wrapped component (e.g. MediaImage or Spot).
|
|
38
44
|
*/
|
|
@@ -19,7 +19,7 @@ const useStyles = ({ disabled }: { disabled: boolean }) => {
|
|
|
19
19
|
* A label that should be used to describe a form field.
|
|
20
20
|
*
|
|
21
21
|
* Either choices fields like checkbox, switch or radio.
|
|
22
|
-
* Or text fields like input, textarea,
|
|
22
|
+
* Or text fields like input, textarea, option list, etc.
|
|
23
23
|
*/
|
|
24
24
|
export const Label = ({
|
|
25
25
|
style,
|
|
@@ -11,11 +11,11 @@ import * as MediaButtonStories from './MediaButton.stories';
|
|
|
11
11
|
|
|
12
12
|
## Introduction
|
|
13
13
|
|
|
14
|
-
A specialized media button designed exclusively for
|
|
14
|
+
A specialized media button designed exclusively for option list and dropdown patterns. It displays a label with an optional leading icon and a permanent trailing chevron indicator.
|
|
15
15
|
|
|
16
16
|
> View in [Figma](https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7/2.-Components-Library?node-id=6389-45680&m=dev).
|
|
17
17
|
|
|
18
|
-
> **Important**: This component should only be used as a trigger inside
|
|
18
|
+
> **Important**: This component should only be used as a trigger inside an OptionList or dropdown. For standalone actions, use [Button](/docs/action-button--docs) or [IconButton](/docs/action-iconbutton--docs) instead.
|
|
19
19
|
|
|
20
20
|
## Properties
|
|
21
21
|
|
|
@@ -32,13 +32,13 @@ Three appearances are available: `gray` (default), `transparent`, and `no-backgr
|
|
|
32
32
|
|
|
33
33
|
<Canvas of={MediaButtonStories.SizeShowcase} />
|
|
34
34
|
|
|
35
|
-
##
|
|
35
|
+
## Leading Content Shapes
|
|
36
36
|
|
|
37
|
-
The `
|
|
37
|
+
The `leadingContentShape` prop controls the padding scheme based on the leading content's shape:
|
|
38
38
|
|
|
39
39
|
- **`flat`**: Standard padding for interface icons (line icons without background).
|
|
40
40
|
- **`rounded`**: Tighter left padding for circular icons with their own background (e.g., crypto icons).
|
|
41
41
|
|
|
42
|
-
<Canvas of={MediaButtonStories.
|
|
42
|
+
<Canvas of={MediaButtonStories.LeadingContentShapeShowcase} />
|
|
43
43
|
</Tab>
|
|
44
44
|
</CustomTabs>
|