@ledgerhq/lumen-ui-rnative 0.1.35 → 0.1.37

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.
Files changed (191) hide show
  1. package/dist/module/lib/Animations/Pulse/Pulse.js +2 -2
  2. package/dist/module/lib/Animations/Pulse/Pulse.js.map +1 -1
  3. package/dist/module/lib/Animations/Pulse/Pulse.mdx +1 -1
  4. package/dist/module/lib/Animations/Spin/Spin.mdx +1 -1
  5. package/dist/module/lib/Components/AddressInput/AddressInput.mdx +1 -1
  6. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.js +68 -39
  7. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.js.map +1 -1
  8. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.mdx +7 -1
  9. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.stories.js +24 -0
  10. package/dist/module/lib/Components/AmountDisplay/AmountDisplay.stories.js.map +1 -1
  11. package/dist/module/lib/Components/AmountDisplay/types.js.map +1 -1
  12. package/dist/module/lib/Components/AmountInput/AmountInput.mdx +1 -1
  13. package/dist/module/lib/Components/Avatar/Avatar.mdx +1 -1
  14. package/dist/module/lib/Components/Banner/Banner.mdx +1 -1
  15. package/dist/module/lib/Components/BottomSheet/BottomSheet.mdx +1 -1
  16. package/dist/module/lib/Components/Button/Button.mdx +1 -1
  17. package/dist/module/lib/Components/Card/Card.stories.js +4 -9
  18. package/dist/module/lib/Components/Card/Card.stories.js.map +1 -1
  19. package/dist/module/lib/Components/CardButton/CardButton.mdx +1 -1
  20. package/dist/module/lib/Components/Checkbox/Checkbox.mdx +1 -1
  21. package/dist/module/lib/Components/DescriptionItem/DescriptionItem.js +184 -0
  22. package/dist/module/lib/Components/DescriptionItem/DescriptionItem.js.map +1 -0
  23. package/dist/module/lib/Components/DescriptionItem/DescriptionItem.mdx +139 -0
  24. package/dist/module/lib/Components/DescriptionItem/DescriptionItem.stories.js +258 -0
  25. package/dist/module/lib/Components/DescriptionItem/DescriptionItem.stories.js.map +1 -0
  26. package/dist/module/lib/Components/DescriptionItem/DescriptionItem.test.js +94 -0
  27. package/dist/module/lib/Components/DescriptionItem/DescriptionItem.test.js.map +1 -0
  28. package/dist/module/lib/Components/DescriptionItem/index.js +5 -0
  29. package/dist/module/lib/Components/DescriptionItem/index.js.map +1 -0
  30. package/dist/module/lib/Components/DescriptionItem/types.js +4 -0
  31. package/dist/module/lib/Components/DescriptionItem/types.js.map +1 -0
  32. package/dist/module/lib/Components/Divider/Divider.mdx +1 -1
  33. package/dist/module/lib/Components/DotIcon/DotIcon.js +44 -23
  34. package/dist/module/lib/Components/DotIcon/DotIcon.js.map +1 -1
  35. package/dist/module/lib/Components/DotIcon/DotIcon.mdx +92 -0
  36. package/dist/module/lib/Components/DotIcon/DotIcon.stories.js +47 -0
  37. package/dist/module/lib/Components/DotIcon/DotIcon.stories.js.map +1 -1
  38. package/dist/module/lib/Components/DotSymbol/DotSymbol.js +52 -30
  39. package/dist/module/lib/Components/DotSymbol/DotSymbol.js.map +1 -1
  40. package/dist/module/lib/Components/DotSymbol/DotSymbol.mdx +79 -2
  41. package/dist/module/lib/Components/DotSymbol/DotSymbol.stories.js +41 -0
  42. package/dist/module/lib/Components/DotSymbol/DotSymbol.stories.js.map +1 -1
  43. package/dist/module/lib/Components/IconButton/IconButton.mdx +1 -1
  44. package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.mdx +1 -1
  45. package/dist/module/lib/Components/Link/Link.mdx +1 -1
  46. package/dist/module/lib/Components/MediaBanner/MediaBanner.mdx +1 -1
  47. package/dist/module/lib/Components/MediaButton/MediaButton.js +17 -17
  48. package/dist/module/lib/Components/MediaButton/MediaButton.js.map +1 -1
  49. package/dist/module/lib/Components/MediaButton/MediaButton.mdx +3 -3
  50. package/dist/module/lib/Components/MediaButton/MediaButton.stories.js +17 -17
  51. package/dist/module/lib/Components/MediaButton/MediaButton.stories.js.map +1 -1
  52. package/dist/module/lib/Components/MediaButton/MediaButton.test.js +4 -4
  53. package/dist/module/lib/Components/MediaButton/MediaButton.test.js.map +1 -1
  54. package/dist/module/lib/Components/MediaImage/MediaImage.js +20 -4
  55. package/dist/module/lib/Components/MediaImage/MediaImage.js.map +1 -1
  56. package/dist/module/lib/Components/MediaImage/MediaImage.stories.js +35 -0
  57. package/dist/module/lib/Components/MediaImage/MediaImage.stories.js.map +1 -1
  58. package/dist/module/lib/Components/NavBar/CoinCapsule.js +3 -2
  59. package/dist/module/lib/Components/NavBar/CoinCapsule.js.map +1 -1
  60. package/dist/module/lib/Components/NavBar/NavBar.js +2 -2
  61. package/dist/module/lib/Components/NavBar/NavBar.js.map +1 -1
  62. package/dist/module/lib/Components/NavBar/NavBar.mdx +2 -2
  63. package/dist/module/lib/Components/NavBar/NavBar.stories.js +1 -1
  64. package/dist/module/lib/Components/NavBar/NavBar.stories.js.map +1 -1
  65. package/dist/module/lib/Components/NavBar/NavBar.test.js +3 -3
  66. package/dist/module/lib/Components/NavBar/NavBar.test.js.map +1 -1
  67. package/dist/module/lib/Components/OptionList/OptionList.stories.js +4 -4
  68. package/dist/module/lib/Components/OptionList/OptionList.stories.js.map +1 -1
  69. package/dist/module/lib/Components/PageIndicator/PageIndicator.js +13 -8
  70. package/dist/module/lib/Components/PageIndicator/PageIndicator.js.map +1 -1
  71. package/dist/module/lib/Components/PageIndicator/PageIndicator.test.js +58 -0
  72. package/dist/module/lib/Components/PageIndicator/PageIndicator.test.js.map +1 -1
  73. package/dist/module/lib/Components/SearchInput/SearchInput.mdx +1 -1
  74. package/dist/module/lib/Components/SegmentedControl/SegmentedControl.mdx +1 -1
  75. package/dist/module/lib/Components/Select/Select.mdx +1 -1
  76. package/dist/module/lib/Components/Spinner/Spinner.mdx +1 -1
  77. package/dist/module/lib/Components/Spot/Spot.mdx +1 -1
  78. package/dist/module/lib/Components/Stepper/Stepper.mdx +1 -1
  79. package/dist/module/lib/Components/Subheader/Subheader.mdx +1 -1
  80. package/dist/module/lib/Components/Switch/Switch.mdx +1 -1
  81. package/dist/module/lib/Components/TabBar/TabBar.mdx +1 -1
  82. package/dist/module/lib/Components/TextInput/TextInput.mdx +1 -1
  83. package/dist/module/lib/Components/Tile/Tile.mdx +1 -1
  84. package/dist/module/lib/Components/Tooltip/Tooltip.mdx +1 -1
  85. package/dist/module/lib/Components/index.js +1 -0
  86. package/dist/module/lib/Components/index.js.map +1 -1
  87. package/dist/typescript/src/lib/Animations/Pulse/Pulse.d.ts.map +1 -1
  88. package/dist/typescript/src/lib/Components/AmountDisplay/AmountDisplay.d.ts +1 -1
  89. package/dist/typescript/src/lib/Components/AmountDisplay/AmountDisplay.d.ts.map +1 -1
  90. package/dist/typescript/src/lib/Components/AmountDisplay/index.d.ts +1 -1
  91. package/dist/typescript/src/lib/Components/AmountDisplay/index.d.ts.map +1 -1
  92. package/dist/typescript/src/lib/Components/AmountDisplay/types.d.ts +10 -3
  93. package/dist/typescript/src/lib/Components/AmountDisplay/types.d.ts.map +1 -1
  94. package/dist/typescript/src/lib/Components/DescriptionItem/DescriptionItem.d.ts +42 -0
  95. package/dist/typescript/src/lib/Components/DescriptionItem/DescriptionItem.d.ts.map +1 -0
  96. package/dist/typescript/src/lib/Components/DescriptionItem/index.d.ts +3 -0
  97. package/dist/typescript/src/lib/Components/DescriptionItem/index.d.ts.map +1 -0
  98. package/dist/typescript/src/lib/Components/DescriptionItem/types.d.ts +39 -0
  99. package/dist/typescript/src/lib/Components/DescriptionItem/types.d.ts.map +1 -0
  100. package/dist/typescript/src/lib/Components/DotIcon/DotIcon.d.ts +1 -1
  101. package/dist/typescript/src/lib/Components/DotIcon/DotIcon.d.ts.map +1 -1
  102. package/dist/typescript/src/lib/Components/DotIcon/types.d.ts +6 -0
  103. package/dist/typescript/src/lib/Components/DotIcon/types.d.ts.map +1 -1
  104. package/dist/typescript/src/lib/Components/DotSymbol/DotSymbol.d.ts +1 -1
  105. package/dist/typescript/src/lib/Components/DotSymbol/DotSymbol.d.ts.map +1 -1
  106. package/dist/typescript/src/lib/Components/DotSymbol/types.d.ts +6 -0
  107. package/dist/typescript/src/lib/Components/DotSymbol/types.d.ts.map +1 -1
  108. package/dist/typescript/src/lib/Components/MediaButton/MediaButton.d.ts +3 -3
  109. package/dist/typescript/src/lib/Components/MediaButton/MediaButton.d.ts.map +1 -1
  110. package/dist/typescript/src/lib/Components/MediaButton/types.d.ts +6 -6
  111. package/dist/typescript/src/lib/Components/MediaButton/types.d.ts.map +1 -1
  112. package/dist/typescript/src/lib/Components/MediaImage/MediaImage.d.ts +1 -1
  113. package/dist/typescript/src/lib/Components/MediaImage/MediaImage.d.ts.map +1 -1
  114. package/dist/typescript/src/lib/Components/MediaImage/types.d.ts +6 -0
  115. package/dist/typescript/src/lib/Components/MediaImage/types.d.ts.map +1 -1
  116. package/dist/typescript/src/lib/Components/NavBar/CoinCapsule.d.ts +1 -1
  117. package/dist/typescript/src/lib/Components/NavBar/CoinCapsule.d.ts.map +1 -1
  118. package/dist/typescript/src/lib/Components/NavBar/NavBar.d.ts +1 -1
  119. package/dist/typescript/src/lib/Components/NavBar/NavBar.d.ts.map +1 -1
  120. package/dist/typescript/src/lib/Components/NavBar/types.d.ts +3 -3
  121. package/dist/typescript/src/lib/Components/NavBar/types.d.ts.map +1 -1
  122. package/dist/typescript/src/lib/Components/PageIndicator/PageIndicator.d.ts.map +1 -1
  123. package/dist/typescript/src/lib/Components/index.d.ts +1 -0
  124. package/dist/typescript/src/lib/Components/index.d.ts.map +1 -1
  125. package/package.json +3 -3
  126. package/src/lib/Animations/Pulse/Pulse.mdx +1 -1
  127. package/src/lib/Animations/Pulse/Pulse.tsx +6 -3
  128. package/src/lib/Animations/Spin/Spin.mdx +1 -1
  129. package/src/lib/Components/AddressInput/AddressInput.mdx +1 -1
  130. package/src/lib/Components/AmountDisplay/AmountDisplay.mdx +7 -1
  131. package/src/lib/Components/AmountDisplay/AmountDisplay.stories.tsx +18 -0
  132. package/src/lib/Components/AmountDisplay/AmountDisplay.tsx +71 -40
  133. package/src/lib/Components/AmountDisplay/index.ts +5 -1
  134. package/src/lib/Components/AmountDisplay/types.ts +12 -3
  135. package/src/lib/Components/AmountInput/AmountInput.mdx +1 -1
  136. package/src/lib/Components/Avatar/Avatar.mdx +1 -1
  137. package/src/lib/Components/Banner/Banner.mdx +1 -1
  138. package/src/lib/Components/BottomSheet/BottomSheet.mdx +1 -1
  139. package/src/lib/Components/Button/Button.mdx +1 -1
  140. package/src/lib/Components/Card/Card.stories.tsx +1 -3
  141. package/src/lib/Components/CardButton/CardButton.mdx +1 -1
  142. package/src/lib/Components/Checkbox/Checkbox.mdx +1 -1
  143. package/src/lib/Components/DescriptionItem/DescriptionItem.mdx +139 -0
  144. package/src/lib/Components/DescriptionItem/DescriptionItem.stories.tsx +234 -0
  145. package/src/lib/Components/DescriptionItem/DescriptionItem.test.tsx +112 -0
  146. package/src/lib/Components/DescriptionItem/DescriptionItem.tsx +224 -0
  147. package/src/lib/Components/DescriptionItem/index.ts +2 -0
  148. package/src/lib/Components/DescriptionItem/types.ts +44 -0
  149. package/src/lib/Components/Divider/Divider.mdx +1 -1
  150. package/src/lib/Components/DotIcon/DotIcon.mdx +92 -0
  151. package/src/lib/Components/DotIcon/DotIcon.stories.tsx +35 -0
  152. package/src/lib/Components/DotIcon/DotIcon.tsx +31 -14
  153. package/src/lib/Components/DotIcon/types.ts +6 -0
  154. package/src/lib/Components/DotSymbol/DotSymbol.mdx +79 -2
  155. package/src/lib/Components/DotSymbol/DotSymbol.stories.tsx +17 -0
  156. package/src/lib/Components/DotSymbol/DotSymbol.tsx +42 -24
  157. package/src/lib/Components/DotSymbol/types.ts +6 -0
  158. package/src/lib/Components/IconButton/IconButton.mdx +1 -1
  159. package/src/lib/Components/InteractiveIcon/InteractiveIcon.mdx +1 -1
  160. package/src/lib/Components/Link/Link.mdx +1 -1
  161. package/src/lib/Components/MediaBanner/MediaBanner.mdx +1 -1
  162. package/src/lib/Components/MediaButton/MediaButton.mdx +3 -3
  163. package/src/lib/Components/MediaButton/MediaButton.stories.tsx +29 -15
  164. package/src/lib/Components/MediaButton/MediaButton.test.tsx +4 -4
  165. package/src/lib/Components/MediaButton/MediaButton.tsx +33 -20
  166. package/src/lib/Components/MediaButton/types.ts +6 -6
  167. package/src/lib/Components/MediaImage/MediaImage.stories.tsx +18 -0
  168. package/src/lib/Components/MediaImage/MediaImage.tsx +12 -2
  169. package/src/lib/Components/MediaImage/types.ts +6 -0
  170. package/src/lib/Components/NavBar/CoinCapsule.tsx +3 -2
  171. package/src/lib/Components/NavBar/NavBar.mdx +2 -2
  172. package/src/lib/Components/NavBar/NavBar.stories.tsx +3 -1
  173. package/src/lib/Components/NavBar/NavBar.test.tsx +3 -3
  174. package/src/lib/Components/NavBar/NavBar.tsx +2 -2
  175. package/src/lib/Components/NavBar/types.ts +3 -3
  176. package/src/lib/Components/OptionList/OptionList.stories.tsx +4 -4
  177. package/src/lib/Components/PageIndicator/PageIndicator.test.tsx +78 -0
  178. package/src/lib/Components/PageIndicator/PageIndicator.tsx +15 -7
  179. package/src/lib/Components/SearchInput/SearchInput.mdx +1 -1
  180. package/src/lib/Components/SegmentedControl/SegmentedControl.mdx +1 -1
  181. package/src/lib/Components/Select/Select.mdx +1 -1
  182. package/src/lib/Components/Spinner/Spinner.mdx +1 -1
  183. package/src/lib/Components/Spot/Spot.mdx +1 -1
  184. package/src/lib/Components/Stepper/Stepper.mdx +1 -1
  185. package/src/lib/Components/Subheader/Subheader.mdx +1 -1
  186. package/src/lib/Components/Switch/Switch.mdx +1 -1
  187. package/src/lib/Components/TabBar/TabBar.mdx +1 -1
  188. package/src/lib/Components/TextInput/TextInput.mdx +1 -1
  189. package/src/lib/Components/Tile/Tile.mdx +1 -1
  190. package/src/lib/Components/Tooltip/Tooltip.mdx +1 -1
  191. package/src/lib/Components/index.ts +1 -0
@@ -0,0 +1,2 @@
1
+ export * from './DescriptionItem';
2
+ export * from './types';
@@ -0,0 +1,44 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { StyledTextProps, StyledViewProps } from '../../../styles';
3
+
4
+ export type DescriptionItemSize = 'sm' | 'md';
5
+
6
+ export type DescriptionItemProps = {
7
+ /**
8
+ * The content of the description item (DescriptionItemLeading, DescriptionItemTrailing).
9
+ */
10
+ children: ReactNode;
11
+ /**
12
+ * The size of the description item.
13
+ * @default 'md'
14
+ */
15
+ size?: DescriptionItemSize;
16
+ } & Omit<StyledViewProps, 'children'>;
17
+
18
+ export type DescriptionItemLeadingProps = {
19
+ /**
20
+ * The leading content (DescriptionItemLabel + optional info icon sibling).
21
+ */
22
+ children: ReactNode;
23
+ } & Omit<StyledViewProps, 'children'>;
24
+
25
+ export type DescriptionItemLabelProps = {
26
+ /**
27
+ * The label text or custom content.
28
+ */
29
+ children: ReactNode;
30
+ } & Omit<StyledTextProps, 'children'>;
31
+
32
+ export type DescriptionItemTrailingProps = {
33
+ /**
34
+ * The trailing content (DescriptionItemValue, Tag, Link, etc.).
35
+ */
36
+ children: ReactNode;
37
+ } & Omit<StyledViewProps, 'children'>;
38
+
39
+ export type DescriptionItemValueProps = {
40
+ /**
41
+ * The value text or custom content.
42
+ */
43
+ children: ReactNode;
44
+ } & Omit<StyledTextProps, 'children'>;
@@ -9,7 +9,7 @@ import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/Com
9
9
 
10
10
  <Meta title='Layout/Divider' of={DividerStories} />
11
11
 
12
- # Divider
12
+ # Divider
13
13
 
14
14
  <CustomTabs>
15
15
  <Tab label="Overview ">
@@ -1,13 +1,18 @@
1
1
  import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks';
2
2
  import * as DotIconStories from './DotIcon.stories';
3
+ import { CustomTabs, Tab } from '../../../../.storybook/components';
3
4
 
4
5
  <Meta title='Communication/DotIcon' of={DotIconStories} />
5
6
 
6
7
  # DotIcon
7
8
 
9
+ <CustomTabs>
10
+ <Tab label="Overview">
11
+
8
12
  ## Introduction
9
13
 
10
14
  DotIcon positions a small icon indicator at a configurable corner of a child element such as MediaImage or Spot. The dot background uses a semantic color (`success`, `muted`, or `error`) to convey meaning at a glance.
15
+
11
16
  > View in [Figma](https://www.figma.com/design/zSkvGGiqcnhywp2l3HTHxA/1.-Symbol-Library?node-id=6159-1866).
12
17
 
13
18
  ## Anatomy
@@ -50,7 +55,94 @@ The dot size is driven by the parent MediaImage or Spot size via the mapping hel
50
55
 
51
56
  <Canvas of={DotIconStories.SizeShowcase} />
52
57
 
58
+ ### Disabled
59
+
60
+ Only set `disabled` on `DotIcon`. The state is propagated to the child via context. Passing it to both stacks the opacity overlay.
61
+
62
+ <Canvas of={DotIconStories.DisabledShowcase} />
63
+
53
64
  ## Accessibility
54
65
 
55
66
  - The icon is purely decorative; the child element should carry its own accessibility label.
56
67
  - Pair semantic appearances with meaningful icons so the state can be understood without relying on color alone.
68
+
69
+ </Tab>
70
+ <Tab label="Implementation">
71
+
72
+ ## Setup
73
+
74
+ Install and set up the library with our [Setup Guide →](?path=/docs/getting-started-setup--docs).
75
+
76
+ ### Basic Usage
77
+
78
+ ```tsx
79
+ import { DotIcon, MediaImage } from '@ledgerhq/lumen-ui-rnative';
80
+ import { ArrowDown } from '@ledgerhq/lumen-ui-rnative/symbols';
81
+
82
+ function MyComponent() {
83
+ return (
84
+ <DotIcon appearance='success' icon={ArrowDown}>
85
+ <MediaImage src='https://example.com/ada.png' alt='Cardano' size={48} />
86
+ </DotIcon>
87
+ );
88
+ }
89
+ ```
90
+
91
+ ### Pin Placement
92
+
93
+ Position the dot at any of the four corners of the child:
94
+
95
+ ```tsx
96
+ <DotIcon appearance='success' icon={ArrowDown} pin='top-end'>
97
+ <MediaImage src='https://example.com/ada.png' alt='Cardano' size={48} />
98
+ </DotIcon>
99
+ ```
100
+
101
+ ### Shapes
102
+
103
+ Use `shape='square'` to match a square child element:
104
+
105
+ ```tsx
106
+ <DotIcon appearance='muted' icon={ArrowDown} shape='square'>
107
+ <MediaImage src='https://example.com/ada.png' alt='Cardano' size={48} shape='square' />
108
+ </DotIcon>
109
+ ```
110
+
111
+ ### Appearances
112
+
113
+ Pick a semantic color via `appearance`:
114
+
115
+ ```tsx
116
+ <DotIcon appearance='success' icon={ArrowDown}>...</DotIcon>
117
+ <DotIcon appearance='muted' icon={ArrowUp}>...</DotIcon>
118
+ <DotIcon appearance='error' icon={Close}>...</DotIcon>
119
+ ```
120
+
121
+ ### Sizing
122
+
123
+ The dot size is driven by the parent's size via the mapping helpers:
124
+
125
+ ```tsx
126
+ import { DotIcon, mediaImageDotIconSizeMap, MediaImage } from '@ledgerhq/lumen-ui-rnative';
127
+
128
+ <DotIcon
129
+ appearance='success'
130
+ icon={ArrowDown}
131
+ size={mediaImageDotIconSizeMap[48]}
132
+ >
133
+ <MediaImage src='https://example.com/ada.png' alt='Cardano' size={48} />
134
+ </DotIcon>;
135
+ ```
136
+
137
+ ### Disabled State
138
+
139
+ Only set `disabled` on `DotIcon`. The state is propagated to the child via context. Passing it to both stacks the opacity overlay.
140
+
141
+ ```tsx
142
+ <DotIcon appearance='success' icon={ArrowDown} disabled>
143
+ <MediaImage src='https://example.com/ada.png' alt='Cardano' size={48} />
144
+ </DotIcon>
145
+ ```
146
+
147
+ </Tab>
148
+ </CustomTabs>
@@ -113,6 +113,41 @@ export const AppearanceShowcase: Story = {
113
113
  ),
114
114
  };
115
115
 
116
+ export const DisabledShowcase: Story = {
117
+ args: { appearance: 'success', icon: ArrowDown },
118
+ render: () => (
119
+ <Box lx={{ flexDirection: 'row', alignItems: 'center', gap: 's32' }}>
120
+ <DotIcon
121
+ appearance='success'
122
+ icon={ArrowDown}
123
+ size={mediaImageDotIconSizeMap[48]}
124
+ pin='bottom-end'
125
+ disabled
126
+ >
127
+ <MediaImage src={parentSrc} size={48} shape='circle' />
128
+ </DotIcon>
129
+ <DotIcon
130
+ appearance='muted'
131
+ icon={ArrowUp}
132
+ size={mediaImageDotIconSizeMap[48]}
133
+ pin='bottom-end'
134
+ disabled
135
+ >
136
+ <MediaImage src={parentSrc} size={48} shape='circle' />
137
+ </DotIcon>
138
+ <DotIcon
139
+ appearance='error'
140
+ icon={Close}
141
+ size={mediaImageDotIconSizeMap[48]}
142
+ pin='bottom-end'
143
+ disabled
144
+ >
145
+ <MediaImage src={parentSrc} size={48} shape='circle' />
146
+ </DotIcon>
147
+ </Box>
148
+ ),
149
+ };
150
+
116
151
  export const SizeShowcase: Story = {
117
152
  args: { appearance: 'muted', icon: Link },
118
153
  render: () => (
@@ -1,4 +1,7 @@
1
- import { StyleSheet } from 'react-native';
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';
@@ -63,11 +66,13 @@ const useStyles = ({
63
66
  shape,
64
67
  pin,
65
68
  appearance,
69
+ disabled,
66
70
  }: {
67
71
  size: DotIconSize;
68
72
  shape: 'square' | 'circle';
69
73
  pin: DotIconPin;
70
74
  appearance: DotIconAppearance;
75
+ disabled: boolean;
71
76
  }) => {
72
77
  return useStyleSheet(
73
78
  (t) => {
@@ -77,6 +82,10 @@ const useStyles = ({
77
82
  const pinOffset = getPinOffset(pin);
78
83
 
79
84
  return {
85
+ root: {
86
+ position: 'relative',
87
+ ...(disabled && { opacity: 0.3 }),
88
+ },
80
89
  dot: {
81
90
  position: 'absolute',
82
91
  zIndex: 10,
@@ -96,7 +105,7 @@ const useStyles = ({
96
105
  },
97
106
  };
98
107
  },
99
- [size, shape, pin, appearance],
108
+ [size, shape, pin, appearance, disabled],
100
109
  );
101
110
  };
102
111
 
@@ -119,27 +128,35 @@ export const DotIcon = ({
119
128
  pin = 'bottom-end',
120
129
  size = 20,
121
130
  shape = 'circle',
131
+ disabled: disabledProp = false,
122
132
  lx = {},
123
133
  style,
124
134
  ref,
125
135
  ...rest
126
136
  }: DotIconProps) => {
127
- const styles = useStyles({ size, shape, pin, appearance });
137
+ const disabled = useDisabledContext({
138
+ consumerName: 'DotIcon',
139
+ mergeWith: { disabled: disabledProp },
140
+ });
141
+ const styles = useStyles({ size, shape, pin, appearance, disabled });
128
142
 
129
143
  return (
130
- <Box
131
- ref={ref}
132
- lx={lx}
133
- style={StyleSheet.flatten([{ position: 'relative' }, style])}
134
- {...rest}
135
- >
136
- <Box style={{ alignSelf: 'flex-start', position: 'relative' }}>
137
- {children}
138
- <Box testID='dot-icon-dot' style={styles.dot}>
139
- <Icon size={dotIconSizeMap[size]} style={styles.icon} />
144
+ <DisabledProvider value={{ disabled: false }}>
145
+ <Box
146
+ ref={ref}
147
+ lx={lx}
148
+ style={[styles.root, style]}
149
+ accessibilityState={{ disabled }}
150
+ {...rest}
151
+ >
152
+ <Box style={{ alignSelf: 'flex-start', position: 'relative' }}>
153
+ {children}
154
+ <Box testID='dot-icon-dot' style={styles.dot}>
155
+ <Icon size={dotIconSizeMap[size]} style={styles.icon} />
156
+ </Box>
140
157
  </Box>
141
158
  </Box>
142
- </Box>
159
+ </DisabledProvider>
143
160
  );
144
161
  };
145
162
 
@@ -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
  */
@@ -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: () => (
@@ -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, StyleSheet } from 'react-native';
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';
@@ -65,10 +69,12 @@ const useStyles = ({
65
69
  size,
66
70
  shape,
67
71
  pin,
72
+ disabled,
68
73
  }: {
69
74
  size: DotSymbolSize;
70
75
  shape: 'square' | 'circle';
71
76
  pin: DotSymbolPin;
77
+ disabled: boolean;
72
78
  }) => {
73
79
  return useStyleSheet(
74
80
  (t) => {
@@ -78,6 +84,10 @@ const useStyles = ({
78
84
  const pinOffset = getPinOffset(pin, size);
79
85
 
80
86
  return {
87
+ root: {
88
+ position: 'relative',
89
+ ...(disabled && { opacity: 0.3 }),
90
+ },
81
91
  dot: {
82
92
  position: 'absolute',
83
93
  zIndex: 10,
@@ -96,7 +106,7 @@ const useStyles = ({
96
106
  },
97
107
  };
98
108
  },
99
- [size, shape, pin],
109
+ [size, shape, pin, disabled],
100
110
  );
101
111
  };
102
112
 
@@ -118,42 +128,50 @@ export const DotSymbol = ({
118
128
  pin = 'bottom-end',
119
129
  size = 20,
120
130
  shape = 'circle',
131
+ disabled: disabledProp = false,
121
132
  lx = {},
122
133
  style,
123
134
  ref,
124
135
  ...rest
125
136
  }: DotSymbolProps) => {
126
- const styles = useStyles({ size, shape, pin });
127
137
  const [error, setError] = useState(false);
138
+ const disabled = useDisabledContext({
139
+ consumerName: 'DotSymbol',
140
+ mergeWith: { disabled: disabledProp },
141
+ });
142
+ const styles = useStyles({ size, shape, pin, disabled });
128
143
 
129
144
  useEffect(() => {
130
145
  setError(false);
131
146
  }, [src]);
132
147
 
133
148
  return (
134
- <Box
135
- ref={ref}
136
- lx={lx}
137
- style={StyleSheet.flatten([{ position: 'relative' }, style])}
138
- accessibilityRole='image'
139
- accessibilityLabel={alt}
140
- {...rest}
141
- >
142
- <Box style={{ alignSelf: 'flex-start', position: 'relative' }}>
143
- {children}
144
- <Box style={styles.dot}>
145
- {!error && (
146
- <Image
147
- source={{ uri: src }}
148
- style={styles.image}
149
- accessible={false}
150
- onError={() => setError(true)}
151
- testID='dot-symbol-img'
152
- />
153
- )}
149
+ <DisabledProvider value={{ disabled: false }}>
150
+ <Box
151
+ ref={ref}
152
+ lx={lx}
153
+ style={[styles.root, style]}
154
+ accessibilityRole='image'
155
+ accessibilityLabel={alt}
156
+ accessibilityState={{ disabled }}
157
+ {...rest}
158
+ >
159
+ <Box style={{ alignSelf: 'flex-start', position: 'relative' }}>
160
+ {children}
161
+ <Box style={styles.dot}>
162
+ {!error && (
163
+ <Image
164
+ source={{ uri: src }}
165
+ style={styles.image}
166
+ accessible={false}
167
+ onError={() => setError(true)}
168
+ testID='dot-symbol-img'
169
+ />
170
+ )}
171
+ </Box>
154
172
  </Box>
155
173
  </Box>
156
- </Box>
174
+ </DisabledProvider>
157
175
  );
158
176
  };
159
177
 
@@ -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
  */
@@ -8,7 +8,7 @@ import { Box } from '../Utility';
8
8
 
9
9
  <Meta title='Action/IconButton' of={IconButtonStories} />
10
10
 
11
- # 🔘 IconButton
11
+ # IconButton
12
12
 
13
13
  <CustomTabs>
14
14
  <Tab label="Overview">
@@ -8,7 +8,7 @@ import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/Com
8
8
 
9
9
  <Meta title='Components/InteractiveIcon' of={InteractiveIconStories} />
10
10
 
11
- # 🎯 InteractiveIcon
11
+ # InteractiveIcon
12
12
 
13
13
  <CustomTabs>
14
14
  <Tab label="Overview">
@@ -8,7 +8,7 @@ import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/Com
8
8
 
9
9
  <Meta title='Components/Link' of={LinkStories} />
10
10
 
11
- # 🔗 Link
11
+ # Link
12
12
 
13
13
  <CustomTabs>
14
14
  <Tab label="Overview">
@@ -12,7 +12,7 @@ import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/Com
12
12
 
13
13
  <Meta title='Components/MediaBanner' of={MediaBannerStories} />
14
14
 
15
- # 🖼️ MediaBanner
15
+ # MediaBanner
16
16
 
17
17
  <CustomTabs>
18
18
  <Tab label="Overview">
@@ -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
- ## Icon Types
35
+ ## Leading Content Shapes
36
36
 
37
- The `iconType` prop controls the padding scheme based on the leading icon's shape:
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.IconTypeShowcase} />
42
+ <Canvas of={MediaButtonStories.LeadingContentShapeShowcase} />
43
43
  </Tab>
44
44
  </CustomTabs>