@ledgerhq/lumen-ui-rnative 0.1.60 → 0.1.62

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 (227) hide show
  1. package/dist/module/lib/Components/core/Avatar/Avatar.js +17 -6
  2. package/dist/module/lib/Components/core/Avatar/Avatar.js.map +1 -1
  3. package/dist/module/lib/Components/core/Avatar/Avatar.mdx +10 -6
  4. package/dist/module/lib/Components/core/Avatar/Avatar.stories.js +15 -6
  5. package/dist/module/lib/Components/core/Avatar/Avatar.stories.js.map +1 -1
  6. package/dist/module/lib/Components/core/Avatar/Avatar.test.js +56 -0
  7. package/dist/module/lib/Components/core/Avatar/Avatar.test.js.map +1 -1
  8. package/dist/module/lib/Components/core/Avatar/index.js +1 -1
  9. package/dist/module/lib/Components/core/Avatar/index.js.map +1 -1
  10. package/dist/module/lib/Components/core/Avatar/useResolveAvatarColor.js +21 -0
  11. package/dist/module/lib/Components/core/Avatar/useResolveAvatarColor.js.map +1 -0
  12. package/dist/module/lib/Components/core/Avatar/useResolveAvatarColor.test.js +88 -0
  13. package/dist/module/lib/Components/core/Avatar/useResolveAvatarColor.test.js.map +1 -0
  14. package/dist/module/lib/Components/core/Banner/Banner.js +3 -3
  15. package/dist/module/lib/Components/core/Banner/Banner.js.map +1 -1
  16. package/dist/module/lib/Components/core/Banner/Banner.test.js +3 -3
  17. package/dist/module/lib/Components/core/Banner/Banner.test.js.map +1 -1
  18. package/dist/module/lib/Components/core/DotIcon/DotIcon.js +0 -13
  19. package/dist/module/lib/Components/core/DotIcon/DotIcon.js.map +1 -1
  20. package/dist/module/lib/Components/core/DotIcon/DotIcon.mdx +3 -3
  21. package/dist/module/lib/Components/core/DotIcon/DotIcon.stories.js +14 -13
  22. package/dist/module/lib/Components/core/DotIcon/DotIcon.stories.js.map +1 -1
  23. package/dist/module/lib/Components/core/DotIcon/DotIcon.test.js +22 -0
  24. package/dist/module/lib/Components/core/DotIcon/DotIcon.test.js.map +1 -1
  25. package/dist/module/lib/Components/core/DotIcon/getDotIconProps.js +37 -0
  26. package/dist/module/lib/Components/core/DotIcon/getDotIconProps.js.map +1 -0
  27. package/dist/module/lib/Components/core/DotIcon/getDotIconProps.test.js +38 -0
  28. package/dist/module/lib/Components/core/DotIcon/getDotIconProps.test.js.map +1 -0
  29. package/dist/module/lib/Components/core/DotIcon/index.js +2 -1
  30. package/dist/module/lib/Components/core/DotIcon/index.js.map +1 -1
  31. package/dist/module/lib/Components/core/DotSymbol/DotSymbol.js +0 -19
  32. package/dist/module/lib/Components/core/DotSymbol/DotSymbol.js.map +1 -1
  33. package/dist/module/lib/Components/core/DotSymbol/DotSymbol.mdx +3 -3
  34. package/dist/module/lib/Components/core/DotSymbol/DotSymbol.stories.js +18 -17
  35. package/dist/module/lib/Components/core/DotSymbol/DotSymbol.stories.js.map +1 -1
  36. package/dist/module/lib/Components/core/DotSymbol/getDotSymbolProps.js +55 -0
  37. package/dist/module/lib/Components/core/DotSymbol/getDotSymbolProps.js.map +1 -0
  38. package/dist/module/lib/Components/core/DotSymbol/getDotSymbolProps.test.js +56 -0
  39. package/dist/module/lib/Components/core/DotSymbol/getDotSymbolProps.test.js.map +1 -0
  40. package/dist/module/lib/Components/core/DotSymbol/index.js +2 -1
  41. package/dist/module/lib/Components/core/DotSymbol/index.js.map +1 -1
  42. package/dist/module/lib/Components/core/MediaButton/MediaButton.js +2 -2
  43. package/dist/module/lib/Components/core/MediaButton/MediaButton.mdx +2 -2
  44. package/dist/module/lib/Components/core/MenuList/MenuList.figma.js +21 -0
  45. package/dist/module/lib/Components/core/MenuList/MenuList.figma.js.map +1 -0
  46. package/dist/module/lib/Components/core/MenuList/MenuList.js +143 -0
  47. package/dist/module/lib/Components/core/MenuList/MenuList.js.map +1 -0
  48. package/dist/module/lib/Components/core/MenuList/MenuList.mdx +66 -0
  49. package/dist/module/lib/Components/core/MenuList/MenuList.stories.js +139 -0
  50. package/dist/module/lib/Components/core/MenuList/MenuList.stories.js.map +1 -0
  51. package/dist/module/lib/Components/core/MenuList/MenuList.test.js +146 -0
  52. package/dist/module/lib/Components/core/MenuList/MenuList.test.js.map +1 -0
  53. package/dist/module/lib/Components/core/MenuList/index.js +5 -0
  54. package/dist/module/lib/Components/core/MenuList/index.js.map +1 -0
  55. package/dist/module/lib/Components/core/MenuList/types.js.map +1 -0
  56. package/dist/module/lib/Components/core/SelectList/SelectList.figma.js +28 -0
  57. package/dist/module/lib/Components/core/{OptionList/OptionList.figma.js.map → SelectList/SelectList.figma.js.map} +1 -1
  58. package/dist/module/lib/Components/core/{OptionList/OptionList.js → SelectList/SelectList.js} +46 -46
  59. package/dist/module/lib/Components/core/{OptionList/OptionList.js.map → SelectList/SelectList.js.map} +1 -1
  60. package/dist/module/lib/Components/core/{OptionList/OptionList.mdx → SelectList/SelectList.mdx} +81 -81
  61. package/dist/module/lib/Components/core/{OptionList/OptionList.stories.js → SelectList/SelectList.stories.js} +130 -130
  62. package/dist/module/lib/Components/core/{OptionList/OptionList.stories.js.map → SelectList/SelectList.stories.js.map} +1 -1
  63. package/dist/module/lib/Components/core/{OptionList/OptionList.test.js → SelectList/SelectList.test.js} +83 -83
  64. package/dist/module/lib/Components/core/{OptionList/OptionList.test.js.map → SelectList/SelectList.test.js.map} +1 -1
  65. package/dist/module/lib/Components/core/SelectList/index.js +5 -0
  66. package/dist/module/lib/Components/core/{OptionList → SelectList}/index.js.map +1 -1
  67. package/dist/module/lib/Components/core/SelectList/types.js +4 -0
  68. package/dist/module/lib/Components/core/{OptionList → SelectList}/types.js.map +1 -1
  69. package/dist/module/lib/Components/core/{OptionList/useOptionList/useOptionListItems.js → SelectList/useSelectList/useSelectListItems.js} +2 -2
  70. package/dist/module/lib/Components/core/{OptionList/useOptionList/useOptionListItems.js.map → SelectList/useSelectList/useSelectListItems.js.map} +1 -1
  71. package/dist/module/lib/Components/core/{OptionList/useOptionList/useOptionListItems.test.js → SelectList/useSelectList/useSelectListItems.test.js} +17 -17
  72. package/dist/module/lib/Components/core/{OptionList/useOptionList/useOptionListItems.test.js.map → SelectList/useSelectList/useSelectListItems.test.js.map} +1 -1
  73. package/dist/module/lib/Components/core/index.js +2 -1
  74. package/dist/module/lib/Components/core/index.js.map +1 -1
  75. package/dist/module/lib/Components/internal/BaseButton/BaseButton.js +2 -2
  76. package/dist/module/lib/Components/internal/BaseButton/BaseButton.js.map +1 -1
  77. package/dist/module/lib/Components/internal/BaseInput/BaseInputLabel.js +2 -2
  78. package/dist/module/lib/Components/internal/BaseInput/BaseInputLabel.js.map +1 -1
  79. package/dist/module/lib/Components/internal/BaseTag/BaseTag.js +3 -3
  80. package/dist/module/lib/Components/internal/BaseTag/BaseTag.js.map +1 -1
  81. package/dist/module/lib/Components/internal/BaseTag/BaseTag.test.js +1 -1
  82. package/dist/module/lib/Components/internal/BaseTag/BaseTag.test.js.map +1 -1
  83. package/dist/module/lib/Components/symbols/Icon/Icon.test.js +1 -1
  84. package/dist/module/lib/Components/symbols/icons/CloudSync.js +50 -0
  85. package/dist/module/lib/Components/symbols/icons/CloudSync.js.map +1 -0
  86. package/dist/module/lib/Components/symbols/icons/Dollar.js +11 -5
  87. package/dist/module/lib/Components/symbols/icons/Dollar.js.map +1 -1
  88. package/dist/module/lib/Components/symbols/icons/DollarConvert.js +1 -1
  89. package/dist/module/lib/Components/symbols/icons/DollarConvert.js.map +1 -1
  90. package/dist/module/lib/Components/symbols/icons/DollarFill.js +47 -0
  91. package/dist/module/lib/Components/symbols/icons/DollarFill.js.map +1 -0
  92. package/dist/module/lib/Components/symbols/icons/FaceId.js +50 -0
  93. package/dist/module/lib/Components/symbols/icons/FaceId.js.map +1 -0
  94. package/dist/module/lib/Components/symbols/icons/Fingerprint.js +50 -0
  95. package/dist/module/lib/Components/symbols/icons/Fingerprint.js.map +1 -0
  96. package/dist/module/lib/Components/symbols/icons/Pause.js +2 -1
  97. package/dist/module/lib/Components/symbols/icons/Pause.js.map +1 -1
  98. package/dist/module/lib/Components/symbols/icons/Range.js +2 -5
  99. package/dist/module/lib/Components/symbols/icons/Range.js.map +1 -1
  100. package/dist/module/lib/Components/symbols/icons/Telegram.js +20 -9
  101. package/dist/module/lib/Components/symbols/icons/Telegram.js.map +1 -1
  102. package/dist/module/lib/Components/symbols/icons/Usb.js +1 -1
  103. package/dist/module/lib/Components/symbols/index.js +4 -0
  104. package/dist/module/lib/Components/symbols/index.js.map +1 -1
  105. package/dist/typescript/src/lib/Components/core/Avatar/Avatar.d.ts.map +1 -1
  106. package/dist/typescript/src/lib/Components/core/Avatar/index.d.ts +1 -1
  107. package/dist/typescript/src/lib/Components/core/Avatar/index.d.ts.map +1 -1
  108. package/dist/typescript/src/lib/Components/core/Avatar/types.d.ts +1 -1
  109. package/dist/typescript/src/lib/Components/core/Avatar/useResolveAvatarColor.d.ts +10 -0
  110. package/dist/typescript/src/lib/Components/core/Avatar/useResolveAvatarColor.d.ts.map +1 -0
  111. package/dist/typescript/src/lib/Components/core/DotIcon/DotIcon.d.ts +0 -13
  112. package/dist/typescript/src/lib/Components/core/DotIcon/DotIcon.d.ts.map +1 -1
  113. package/dist/typescript/src/lib/Components/core/DotIcon/getDotIconProps.d.ts +66 -0
  114. package/dist/typescript/src/lib/Components/core/DotIcon/getDotIconProps.d.ts.map +1 -0
  115. package/dist/typescript/src/lib/Components/core/DotIcon/index.d.ts +2 -1
  116. package/dist/typescript/src/lib/Components/core/DotIcon/index.d.ts.map +1 -1
  117. package/dist/typescript/src/lib/Components/core/DotSymbol/DotSymbol.d.ts +1 -5
  118. package/dist/typescript/src/lib/Components/core/DotSymbol/DotSymbol.d.ts.map +1 -1
  119. package/dist/typescript/src/lib/Components/core/DotSymbol/getDotSymbolProps.d.ts +102 -0
  120. package/dist/typescript/src/lib/Components/core/DotSymbol/getDotSymbolProps.d.ts.map +1 -0
  121. package/dist/typescript/src/lib/Components/core/DotSymbol/index.d.ts +2 -1
  122. package/dist/typescript/src/lib/Components/core/DotSymbol/index.d.ts.map +1 -1
  123. package/dist/typescript/src/lib/Components/core/MediaButton/MediaButton.d.ts +2 -2
  124. package/dist/typescript/src/lib/Components/core/MenuList/MenuList.d.ts +29 -0
  125. package/dist/typescript/src/lib/Components/core/MenuList/MenuList.d.ts.map +1 -0
  126. package/dist/typescript/src/lib/Components/core/MenuList/index.d.ts +3 -0
  127. package/dist/typescript/src/lib/Components/core/MenuList/index.d.ts.map +1 -0
  128. package/dist/typescript/src/lib/Components/core/MenuList/types.d.ts +42 -0
  129. package/dist/typescript/src/lib/Components/core/MenuList/types.d.ts.map +1 -0
  130. package/dist/typescript/src/lib/Components/core/SelectList/SelectList.d.ts +27 -0
  131. package/dist/typescript/src/lib/Components/core/{OptionList/OptionList.d.ts.map → SelectList/SelectList.d.ts.map} +1 -1
  132. package/dist/typescript/src/lib/Components/core/SelectList/index.d.ts +3 -0
  133. package/dist/typescript/src/lib/Components/core/{OptionList → SelectList}/index.d.ts.map +1 -1
  134. package/dist/typescript/src/lib/Components/core/{OptionList → SelectList}/types.d.ts +24 -24
  135. package/dist/typescript/src/lib/Components/core/{OptionList → SelectList}/types.d.ts.map +1 -1
  136. package/dist/typescript/src/lib/Components/core/SelectList/useSelectList/useSelectListItems.d.ts +20 -0
  137. package/dist/typescript/src/lib/Components/core/{OptionList/useOptionList/useOptionListItems.d.ts.map → SelectList/useSelectList/useSelectListItems.d.ts.map} +1 -1
  138. package/dist/typescript/src/lib/Components/core/index.d.ts +2 -1
  139. package/dist/typescript/src/lib/Components/core/index.d.ts.map +1 -1
  140. package/dist/typescript/src/lib/Components/internal/BaseInput/BaseInputLabel.d.ts.map +1 -1
  141. package/dist/typescript/src/lib/Components/symbols/icons/CloudSync.d.ts +35 -0
  142. package/dist/typescript/src/lib/Components/symbols/icons/CloudSync.d.ts.map +1 -0
  143. package/dist/typescript/src/lib/Components/symbols/icons/Dollar.d.ts.map +1 -1
  144. package/dist/typescript/src/lib/Components/symbols/icons/DollarFill.d.ts +35 -0
  145. package/dist/typescript/src/lib/Components/symbols/icons/DollarFill.d.ts.map +1 -0
  146. package/dist/typescript/src/lib/Components/symbols/icons/FaceId.d.ts +35 -0
  147. package/dist/typescript/src/lib/Components/symbols/icons/FaceId.d.ts.map +1 -0
  148. package/dist/typescript/src/lib/Components/symbols/icons/Fingerprint.d.ts +35 -0
  149. package/dist/typescript/src/lib/Components/symbols/icons/Fingerprint.d.ts.map +1 -0
  150. package/dist/typescript/src/lib/Components/symbols/icons/Pause.d.ts.map +1 -1
  151. package/dist/typescript/src/lib/Components/symbols/icons/Range.d.ts.map +1 -1
  152. package/dist/typescript/src/lib/Components/symbols/icons/Telegram.d.ts.map +1 -1
  153. package/dist/typescript/src/lib/Components/symbols/index.d.ts +4 -0
  154. package/dist/typescript/src/lib/Components/symbols/index.d.ts.map +1 -1
  155. package/package.json +3 -3
  156. package/src/lib/Components/core/Avatar/Avatar.mdx +10 -6
  157. package/src/lib/Components/core/Avatar/Avatar.stories.tsx +16 -9
  158. package/src/lib/Components/core/Avatar/Avatar.test.tsx +64 -0
  159. package/src/lib/Components/core/Avatar/Avatar.tsx +41 -8
  160. package/src/lib/Components/core/Avatar/index.ts +1 -1
  161. package/src/lib/Components/core/Avatar/types.ts +1 -1
  162. package/src/lib/Components/core/Avatar/useResolveAvatarColor.test.tsx +106 -0
  163. package/src/lib/Components/core/Avatar/useResolveAvatarColor.ts +25 -0
  164. package/src/lib/Components/core/Banner/Banner.test.tsx +3 -3
  165. package/src/lib/Components/core/Banner/Banner.tsx +3 -3
  166. package/src/lib/Components/core/DotIcon/DotIcon.mdx +3 -3
  167. package/src/lib/Components/core/DotIcon/DotIcon.stories.tsx +14 -13
  168. package/src/lib/Components/core/DotIcon/DotIcon.test.tsx +20 -0
  169. package/src/lib/Components/core/DotIcon/DotIcon.tsx +0 -15
  170. package/src/lib/Components/core/DotIcon/getDotIconProps.test.ts +19 -0
  171. package/src/lib/Components/core/DotIcon/getDotIconProps.ts +20 -0
  172. package/src/lib/Components/core/DotIcon/index.ts +2 -5
  173. package/src/lib/Components/core/DotSymbol/DotSymbol.mdx +3 -3
  174. package/src/lib/Components/core/DotSymbol/DotSymbol.stories.tsx +18 -17
  175. package/src/lib/Components/core/DotSymbol/DotSymbol.tsx +0 -23
  176. package/src/lib/Components/core/DotSymbol/getDotSymbolProps.test.ts +25 -0
  177. package/src/lib/Components/core/DotSymbol/getDotSymbolProps.ts +26 -0
  178. package/src/lib/Components/core/DotSymbol/index.ts +2 -1
  179. package/src/lib/Components/core/MediaButton/MediaButton.mdx +2 -2
  180. package/src/lib/Components/core/MediaButton/MediaButton.tsx +2 -2
  181. package/src/lib/Components/core/MenuList/MenuList.figma.tsx +23 -0
  182. package/src/lib/Components/core/MenuList/MenuList.mdx +66 -0
  183. package/src/lib/Components/core/MenuList/MenuList.stories.tsx +114 -0
  184. package/src/lib/Components/core/MenuList/MenuList.test.tsx +135 -0
  185. package/src/lib/Components/core/MenuList/MenuList.tsx +162 -0
  186. package/src/lib/Components/core/MenuList/index.ts +2 -0
  187. package/src/lib/Components/core/MenuList/types.ts +49 -0
  188. package/src/lib/Components/core/SelectList/SelectList.figma.tsx +37 -0
  189. package/src/lib/Components/core/{OptionList/OptionList.mdx → SelectList/SelectList.mdx} +81 -81
  190. package/src/lib/Components/core/{OptionList/OptionList.stories.tsx → SelectList/SelectList.stories.tsx} +227 -227
  191. package/src/lib/Components/core/{OptionList/OptionList.test.tsx → SelectList/SelectList.test.tsx} +138 -138
  192. package/src/lib/Components/core/{OptionList/OptionList.tsx → SelectList/SelectList.tsx} +92 -92
  193. package/src/lib/Components/core/SelectList/index.ts +2 -0
  194. package/src/lib/Components/core/{OptionList → SelectList}/types.ts +28 -28
  195. package/src/lib/Components/core/{OptionList/useOptionList/useOptionListItems.test.ts → SelectList/useSelectList/useSelectListItems.test.ts} +24 -24
  196. package/src/lib/Components/core/{OptionList/useOptionList/useOptionListItems.ts → SelectList/useSelectList/useSelectListItems.ts} +21 -21
  197. package/src/lib/Components/core/Spot/Spot.tsx +1 -1
  198. package/src/lib/Components/core/index.ts +2 -1
  199. package/src/lib/Components/internal/BaseButton/BaseButton.tsx +2 -2
  200. package/src/lib/Components/internal/BaseInput/BaseInputLabel.tsx +5 -2
  201. package/src/lib/Components/internal/BaseTag/BaseTag.test.tsx +3 -3
  202. package/src/lib/Components/internal/BaseTag/BaseTag.tsx +3 -3
  203. package/src/lib/Components/symbols/Icon/Icon.test.tsx +1 -1
  204. package/src/lib/Components/symbols/icons/CloudSync.tsx +45 -0
  205. package/src/lib/Components/symbols/icons/Dollar.tsx +8 -1
  206. package/src/lib/Components/symbols/icons/DollarConvert.tsx +1 -1
  207. package/src/lib/Components/symbols/icons/DollarFill.tsx +42 -0
  208. package/src/lib/Components/symbols/icons/FaceId.tsx +45 -0
  209. package/src/lib/Components/symbols/icons/Fingerprint.tsx +45 -0
  210. package/src/lib/Components/symbols/icons/Pause.tsx +2 -1
  211. package/src/lib/Components/symbols/icons/Range.tsx +2 -5
  212. package/src/lib/Components/symbols/icons/Telegram.tsx +14 -7
  213. package/src/lib/Components/symbols/icons/Usb.tsx +1 -1
  214. package/src/lib/Components/symbols/index.ts +4 -0
  215. package/dist/module/lib/Components/core/Avatar/resolveAvatarColor.js +0 -18
  216. package/dist/module/lib/Components/core/Avatar/resolveAvatarColor.js.map +0 -1
  217. package/dist/module/lib/Components/core/OptionList/OptionList.figma.js +0 -28
  218. package/dist/module/lib/Components/core/OptionList/index.js +0 -5
  219. package/dist/typescript/src/lib/Components/core/Avatar/resolveAvatarColor.d.ts +0 -8
  220. package/dist/typescript/src/lib/Components/core/Avatar/resolveAvatarColor.d.ts.map +0 -1
  221. package/dist/typescript/src/lib/Components/core/OptionList/OptionList.d.ts +0 -27
  222. package/dist/typescript/src/lib/Components/core/OptionList/index.d.ts +0 -3
  223. package/dist/typescript/src/lib/Components/core/OptionList/useOptionList/useOptionListItems.d.ts +0 -20
  224. package/src/lib/Components/core/Avatar/resolveAvatarColor.ts +0 -19
  225. package/src/lib/Components/core/OptionList/OptionList.figma.tsx +0 -37
  226. package/src/lib/Components/core/OptionList/index.ts +0 -2
  227. /package/dist/module/lib/Components/core/{OptionList → MenuList}/types.js +0 -0
@@ -0,0 +1,25 @@
1
+ import {
2
+ capitalize,
3
+ resolveAvatarColorKey,
4
+ type AvatarColorKey,
5
+ } from '@ledgerhq/lumen-utils-shared';
6
+ import { useTheme, type LumenStyleSheetTheme } from '../../../../styles';
7
+
8
+ type DecorativeBgKey = keyof LumenStyleSheetTheme['colors']['bg'];
9
+
10
+ const decorativeBgKey = (key: AvatarColorKey): DecorativeBgKey =>
11
+ `decorative${capitalize(key)}` as DecorativeBgKey;
12
+
13
+ /**
14
+ * Resolves a stable identifier (e.g. a user id) to one of the avatar pastel
15
+ * color keys, then to that key's value in the current theme. The same
16
+ * identifier always resolves to the same key, but its resolved color value
17
+ * follows the active theme.
18
+ *
19
+ * Pass the result directly to `<Avatar fallbackColor={useResolveAvatarColor(id)} />`.
20
+ */
21
+ export function useResolveAvatarColor(identifier: string): string {
22
+ const { theme } = useTheme();
23
+
24
+ return theme.colors.bg[decorativeBgKey(resolveAvatarColorKey(identifier))];
25
+ }
@@ -44,7 +44,7 @@ describe('Banner Component', () => {
44
44
  </TestWrapper>,
45
45
  );
46
46
  expect(getByTestId('banner-id').props.style.backgroundColor).toBe(
47
- colors.bg.success,
47
+ colors.bg.successTransparent,
48
48
  );
49
49
 
50
50
  rerender(
@@ -57,7 +57,7 @@ describe('Banner Component', () => {
57
57
  </TestWrapper>,
58
58
  );
59
59
  expect(getByTestId('banner-id').props.style.backgroundColor).toBe(
60
- colors.bg.warning,
60
+ colors.bg.warningTransparent,
61
61
  );
62
62
 
63
63
  rerender(
@@ -66,7 +66,7 @@ describe('Banner Component', () => {
66
66
  </TestWrapper>,
67
67
  );
68
68
  expect(getByTestId('banner-id').props.style.backgroundColor).toBe(
69
- colors.bg.error,
69
+ colors.bg.errorTransparent,
70
70
  );
71
71
  });
72
72
 
@@ -32,9 +32,9 @@ const useStyles = ({ appearance }: { appearance: Appearance }) => {
32
32
  (t) => {
33
33
  const bgColors: Record<Appearance, string> = {
34
34
  info: t.colors.bg.surface,
35
- success: t.colors.bg.success,
36
- warning: t.colors.bg.warning,
37
- error: t.colors.bg.error,
35
+ success: t.colors.bg.successTransparent,
36
+ warning: t.colors.bg.warningTransparent,
37
+ error: t.colors.bg.errorTransparent,
38
38
  };
39
39
 
40
40
  return {
@@ -51,7 +51,7 @@ The `appearance` prop controls the semantic background color of the dot: `succes
51
51
 
52
52
  ### Sizes
53
53
 
54
- The dot size is driven by the parent MediaImage or Spot size via the mapping helpers `mediaImageDotIconSizeMap` and `spotDotIconSizeMap`. Allowed sizes are `16`, `20`, and `24`. The icon size is handled internally by the component.
54
+ The dot size is driven by the parent MediaImage or Spot size via the `getDotIconProps` helper. Allowed sizes are `16`, `20`, `24`, and `32`. The icon size is handled internally by the component.
55
55
 
56
56
  <Canvas of={DotIconStories.SizeShowcase} />
57
57
 
@@ -123,12 +123,12 @@ Pick a semantic color via `appearance`:
123
123
  The dot size is driven by the parent's size via the mapping helpers:
124
124
 
125
125
  ```tsx
126
- import { DotIcon, mediaImageDotIconSizeMap, MediaImage } from '@ledgerhq/lumen-ui-rnative';
126
+ import { DotIcon, getDotIconProps, MediaImage } from '@ledgerhq/lumen-ui-rnative';
127
127
 
128
128
  <DotIcon
129
129
  appearance='success'
130
130
  icon={ArrowDown}
131
- size={mediaImageDotIconSizeMap[48]}
131
+ {...getDotIconProps('mediaImage', 48)}
132
132
  >
133
133
  <MediaImage src='https://example.com/ada.png' alt='Cardano' size={48} />
134
134
  </DotIcon>;
@@ -3,7 +3,8 @@ import { Box } from '../../primitives';
3
3
  import { ArrowDown, ArrowUp, Close, Link, Star } from '../../symbols';
4
4
  import { MediaImage } from '../MediaImage';
5
5
  import { Spinner } from '../Spinner';
6
- import { DotIcon, mediaImageDotIconSizeMap } from './DotIcon';
6
+ import { DotIcon } from './DotIcon';
7
+ import { getDotIconProps } from '.';
7
8
 
8
9
  const meta = {
9
10
  component: DotIcon,
@@ -30,7 +31,7 @@ export const Base: Story = {
30
31
  appearance: 'success',
31
32
  icon: ArrowDown,
32
33
  pin: 'bottom-end',
33
- size: mediaImageDotIconSizeMap[48],
34
+ ...getDotIconProps('mediaImage', 48),
34
35
  shape: 'circle',
35
36
  children: (
36
37
  <MediaImage src={parentSrc} alt='Cardano' size={48} shape='circle' />
@@ -89,24 +90,24 @@ export const AppearanceShowcase: Story = {
89
90
  <DotIcon
90
91
  appearance='success'
91
92
  icon={ArrowDown}
92
- size={mediaImageDotIconSizeMap[48]}
93
93
  pin='bottom-end'
94
+ {...getDotIconProps('mediaImage', 48)}
94
95
  >
95
96
  <MediaImage src={parentSrc} size={48} shape='circle' />
96
97
  </DotIcon>
97
98
  <DotIcon
98
99
  appearance='muted'
99
100
  icon={ArrowUp}
100
- size={mediaImageDotIconSizeMap[48]}
101
101
  pin='bottom-end'
102
+ {...getDotIconProps('mediaImage', 48)}
102
103
  >
103
104
  <MediaImage src={parentSrc} size={48} shape='circle' />
104
105
  </DotIcon>
105
106
  <DotIcon
106
107
  appearance='error'
107
108
  icon={Close}
108
- size={mediaImageDotIconSizeMap[48]}
109
109
  pin='bottom-end'
110
+ {...getDotIconProps('mediaImage', 48)}
110
111
  >
111
112
  <MediaImage src={parentSrc} size={48} shape='circle' />
112
113
  </DotIcon>
@@ -121,27 +122,27 @@ export const DisabledShowcase: Story = {
121
122
  <DotIcon
122
123
  appearance='success'
123
124
  icon={ArrowDown}
124
- size={mediaImageDotIconSizeMap[48]}
125
125
  pin='bottom-end'
126
126
  disabled
127
+ {...getDotIconProps('mediaImage', 48)}
127
128
  >
128
129
  <MediaImage src={parentSrc} size={48} shape='circle' />
129
130
  </DotIcon>
130
131
  <DotIcon
131
132
  appearance='muted'
132
133
  icon={ArrowUp}
133
- size={mediaImageDotIconSizeMap[48]}
134
134
  pin='bottom-end'
135
135
  disabled
136
+ {...getDotIconProps('mediaImage', 48)}
136
137
  >
137
138
  <MediaImage src={parentSrc} size={48} shape='circle' />
138
139
  </DotIcon>
139
140
  <DotIcon
140
141
  appearance='error'
141
142
  icon={Close}
142
- size={mediaImageDotIconSizeMap[48]}
143
143
  pin='bottom-end'
144
144
  disabled
145
+ {...getDotIconProps('mediaImage', 48)}
145
146
  >
146
147
  <MediaImage src={parentSrc} size={48} shape='circle' />
147
148
  </DotIcon>
@@ -156,40 +157,40 @@ export const SizeShowcase: Story = {
156
157
  <DotIcon
157
158
  appearance='muted'
158
159
  icon={Link}
159
- size={mediaImageDotIconSizeMap[40]}
160
160
  pin='bottom-end'
161
+ {...getDotIconProps('mediaImage', 40)}
161
162
  >
162
163
  <MediaImage src={parentSrc} size={40} shape='circle' />
163
164
  </DotIcon>
164
165
  <DotIcon
165
166
  appearance='success'
166
167
  icon={Star}
167
- size={mediaImageDotIconSizeMap[48]}
168
168
  pin='bottom-end'
169
+ {...getDotIconProps('mediaImage', 48)}
169
170
  >
170
171
  <MediaImage src={parentSrc} size={48} shape='circle' />
171
172
  </DotIcon>
172
173
  <DotIcon
173
174
  appearance='success'
174
175
  icon={ArrowDown}
175
- size={mediaImageDotIconSizeMap[56]}
176
176
  pin='bottom-end'
177
+ {...getDotIconProps('mediaImage', 56)}
177
178
  >
178
179
  <MediaImage src={parentSrc} size={56} shape='circle' />
179
180
  </DotIcon>
180
181
  <DotIcon
181
182
  appearance='muted'
182
183
  icon={Spinner}
183
- size={mediaImageDotIconSizeMap[64]}
184
184
  pin='bottom-end'
185
+ {...getDotIconProps('mediaImage', 64)}
185
186
  >
186
187
  <MediaImage src={parentSrc} size={64} shape='circle' />
187
188
  </DotIcon>
188
189
  <DotIcon
189
190
  appearance='muted'
190
191
  icon={Spinner}
191
- size={mediaImageDotIconSizeMap[72]}
192
192
  pin='bottom-end'
193
+ {...getDotIconProps('mediaImage', 72)}
193
194
  >
194
195
  <MediaImage src={parentSrc} size={72} shape='circle' />
195
196
  </DotIcon>
@@ -77,6 +77,7 @@ describe('DotIcon Component', () => {
77
77
  { size: 16 as const, expectedSize: sizes.s16 },
78
78
  { size: 20 as const, expectedSize: sizes.s20 },
79
79
  { size: 24 as const, expectedSize: sizes.s24 },
80
+ { size: 32 as const, expectedSize: sizes.s32 },
80
81
  ])(
81
82
  'should apply correct width and height for size $size',
82
83
  ({ size, expectedSize }) => {
@@ -159,6 +160,7 @@ describe('DotIcon Component', () => {
159
160
  { size: 16 as const, expectedRadius: 5 },
160
161
  { size: 20 as const, expectedRadius: 6 },
161
162
  { size: 24 as const, expectedRadius: 8 },
163
+ { size: 32 as const, expectedRadius: 10 },
162
164
  ])(
163
165
  'should apply correct border radius for square shape at size $size',
164
166
  ({ size, expectedRadius }) => {
@@ -194,6 +196,24 @@ describe('DotIcon Component', () => {
194
196
  });
195
197
  });
196
198
 
199
+ describe('Disabled', () => {
200
+ it('should apply opacity when disabled', () => {
201
+ const { getByTestId } = render(
202
+ <TestWrapper>
203
+ <DotIcon
204
+ testID='dot-icon'
205
+ appearance='success'
206
+ icon={ArrowDown}
207
+ disabled
208
+ />
209
+ </TestWrapper>,
210
+ );
211
+
212
+ const root = getByTestId('dot-icon');
213
+ expect(root.props.style.opacity).toBe(0.3);
214
+ });
215
+ });
216
+
197
217
  describe('Styling', () => {
198
218
  it('should apply custom styles', () => {
199
219
  const { getByTestId } = render(
@@ -26,21 +26,6 @@ const dotSquareRadiusMap: Record<DotIconSize, number> = {
26
26
  32: 10,
27
27
  };
28
28
 
29
- export const mediaImageDotIconSizeMap = {
30
- 40: 16,
31
- 48: 20,
32
- 56: 24,
33
- 64: 24,
34
- 72: 32,
35
- } as const satisfies Record<number, DotIconSize>;
36
-
37
- export const spotDotIconSizeMap = {
38
- 40: 16,
39
- 48: 20,
40
- 56: 24,
41
- 72: 32,
42
- } as const satisfies Record<number, DotIconSize>;
43
-
44
29
  const pinAxisMap: Record<DotIconPin, [vertical: string, horizontal: string]> = {
45
30
  'top-start': ['top', 'left'],
46
31
  'top-end': ['top', 'right'],
@@ -0,0 +1,19 @@
1
+ import { describe, it, expect } from '@jest/globals';
2
+ import { getDotIconProps } from './index';
3
+
4
+ describe('getDotIconProps', () => {
5
+ it('resolves mediaImage dot icon props', () => {
6
+ expect(getDotIconProps('mediaImage', 40)).toEqual({ size: 16 });
7
+ expect(getDotIconProps('mediaImage', 48)).toEqual({ size: 20 });
8
+ expect(getDotIconProps('mediaImage', 56)).toEqual({ size: 24 });
9
+ expect(getDotIconProps('mediaImage', 64)).toEqual({ size: 24 });
10
+ expect(getDotIconProps('mediaImage', 72)).toEqual({ size: 32 });
11
+ });
12
+
13
+ it('resolves spot dot icon props', () => {
14
+ expect(getDotIconProps('spot', 40)).toEqual({ size: 16 });
15
+ expect(getDotIconProps('spot', 48)).toEqual({ size: 20 });
16
+ expect(getDotIconProps('spot', 56)).toEqual({ size: 24 });
17
+ expect(getDotIconProps('spot', 72)).toEqual({ size: 32 });
18
+ });
19
+ });
@@ -0,0 +1,20 @@
1
+ import { createPropsResolver } from '@ledgerhq/lumen-utils-shared';
2
+ import type { MediaImageSize } from '../MediaImage';
3
+ import type { SpotSize } from '../Spot';
4
+ import type { DotIconProps } from './types';
5
+
6
+ export const getDotIconProps = createPropsResolver({
7
+ mediaImage: {
8
+ 40: { size: 16 },
9
+ 48: { size: 20 },
10
+ 56: { size: 24 },
11
+ 64: { size: 24 },
12
+ 72: { size: 32 },
13
+ } satisfies Partial<Record<MediaImageSize, Partial<DotIconProps>>>,
14
+ spot: {
15
+ 40: { size: 16 },
16
+ 48: { size: 20 },
17
+ 56: { size: 24 },
18
+ 72: { size: 32 },
19
+ } satisfies Partial<Record<SpotSize, Partial<DotIconProps>>>,
20
+ });
@@ -1,6 +1,3 @@
1
- export {
2
- DotIcon,
3
- mediaImageDotIconSizeMap,
4
- spotDotIconSizeMap,
5
- } from './DotIcon';
1
+ export { DotIcon } from './DotIcon';
2
+ export * from './getDotIconProps';
6
3
  export * from './types';
@@ -45,7 +45,7 @@ Four corner placements are available: `bottom-end` (default), `top-end`, `bottom
45
45
 
46
46
  ### Sizes
47
47
 
48
- The dot size is driven by the parent MediaImage or Spot size via the mapping helpers `mediaImageDotSizeMap` and `spotDotSizeMap`.
48
+ The dot size is driven by the parent MediaImage or Spot size via the `getDotSymbolProps` helper.
49
49
 
50
50
  <Canvas of={DotSymbolStories.SizeShowcase} />
51
51
 
@@ -106,12 +106,12 @@ Use `shape='square'` to match a square child element:
106
106
  The dot size is driven by the parent's size via the mapping helpers:
107
107
 
108
108
  ```tsx
109
- import { DotSymbol, mediaImageDotSizeMap, MediaImage } from '@ledgerhq/lumen-ui-rnative';
109
+ import { DotSymbol, getDotSymbolProps, MediaImage } from '@ledgerhq/lumen-ui-rnative';
110
110
 
111
111
  <DotSymbol
112
112
  src='https://example.com/btc.png'
113
113
  alt='Bitcoin'
114
- size={mediaImageDotSizeMap[48]}
114
+ {...getDotSymbolProps('mediaImage', 48)}
115
115
  >
116
116
  <MediaImage src='https://example.com/ada.png' alt='Cardano' size={48} />
117
117
  </DotSymbol>;
@@ -3,7 +3,8 @@ import { Box } from '../../primitives';
3
3
  import { CoinAlert } from '../../symbols';
4
4
  import { MediaImage } from '../MediaImage';
5
5
  import { Spot } from '../Spot';
6
- import { DotSymbol, mediaImageDotSizeMap } from './DotSymbol';
6
+ import { DotSymbol } from './DotSymbol';
7
+ import { getDotSymbolProps } from '.';
7
8
 
8
9
  const meta = {
9
10
  component: DotSymbol,
@@ -117,57 +118,57 @@ export const SizeShowcase: Story = {
117
118
  <Box lx={{ flexDirection: 'row', alignItems: 'flex-end', gap: 's24' }}>
118
119
  <DotSymbol
119
120
  src={dotSrc}
120
- size={mediaImageDotSizeMap[20]}
121
121
  pin='bottom-end'
122
+ {...getDotSymbolProps('mediaImage', 20)}
122
123
  >
123
124
  <MediaImage src={parentSrc} size={20} shape='circle' />
124
125
  </DotSymbol>
125
126
  <DotSymbol
126
127
  src={dotSrc}
127
- size={mediaImageDotSizeMap[24]}
128
128
  pin='bottom-end'
129
+ {...getDotSymbolProps('mediaImage', 24)}
129
130
  >
130
131
  <MediaImage src={parentSrc} size={24} shape='circle' />
131
132
  </DotSymbol>
132
133
  <DotSymbol
133
134
  src={dotSrc}
134
- size={mediaImageDotSizeMap[32]}
135
135
  pin='bottom-end'
136
+ {...getDotSymbolProps('mediaImage', 32)}
136
137
  >
137
138
  <MediaImage src={parentSrc} size={32} shape='circle' />
138
139
  </DotSymbol>
139
140
  <DotSymbol
140
141
  src={dotSrc}
141
- size={mediaImageDotSizeMap[40]}
142
142
  pin='bottom-end'
143
+ {...getDotSymbolProps('mediaImage', 40)}
143
144
  >
144
145
  <MediaImage src={parentSrc} size={40} shape='circle' />
145
146
  </DotSymbol>
146
147
  <DotSymbol
147
148
  src={dotSrc}
148
- size={mediaImageDotSizeMap[48]}
149
149
  pin='bottom-end'
150
+ {...getDotSymbolProps('mediaImage', 48)}
150
151
  >
151
152
  <MediaImage src={parentSrc} size={48} shape='circle' />
152
153
  </DotSymbol>
153
154
  <DotSymbol
154
155
  src={dotSrc}
155
- size={mediaImageDotSizeMap[56]}
156
156
  pin='bottom-end'
157
+ {...getDotSymbolProps('mediaImage', 56)}
157
158
  >
158
159
  <MediaImage src={parentSrc} size={56} shape='circle' />
159
160
  </DotSymbol>
160
161
  <DotSymbol
161
162
  src={dotSrc}
162
- size={mediaImageDotSizeMap[64]}
163
163
  pin='bottom-end'
164
+ {...getDotSymbolProps('mediaImage', 64)}
164
165
  >
165
166
  <MediaImage src={parentSrc} size={64} shape='circle' />
166
167
  </DotSymbol>
167
168
  <DotSymbol
168
169
  src={dotSrc}
169
- size={mediaImageDotSizeMap[72]}
170
170
  pin='bottom-end'
171
+ {...getDotSymbolProps('mediaImage', 72)}
171
172
  >
172
173
  <MediaImage src={parentSrc} size={72} shape='circle' />
173
174
  </DotSymbol>
@@ -176,64 +177,64 @@ export const SizeShowcase: Story = {
176
177
  <DotSymbol
177
178
  shape='square'
178
179
  src={dotSrc}
179
- size={mediaImageDotSizeMap[20]}
180
180
  pin='bottom-end'
181
+ {...getDotSymbolProps('mediaImage', 20)}
181
182
  >
182
183
  <MediaImage src={parentSrc} size={20} shape='square' />
183
184
  </DotSymbol>
184
185
  <DotSymbol
185
186
  shape='square'
186
187
  src={dotSrc}
187
- size={mediaImageDotSizeMap[24]}
188
188
  pin='bottom-end'
189
+ {...getDotSymbolProps('mediaImage', 24)}
189
190
  >
190
191
  <MediaImage src={parentSrc} size={24} shape='square' />
191
192
  </DotSymbol>
192
193
  <DotSymbol
193
194
  shape='square'
194
195
  src={dotSrc}
195
- size={mediaImageDotSizeMap[32]}
196
196
  pin='bottom-end'
197
+ {...getDotSymbolProps('mediaImage', 32)}
197
198
  >
198
199
  <MediaImage src={parentSrc} size={32} shape='square' />
199
200
  </DotSymbol>
200
201
  <DotSymbol
201
202
  shape='square'
202
203
  src={dotSrc}
203
- size={mediaImageDotSizeMap[40]}
204
204
  pin='bottom-end'
205
+ {...getDotSymbolProps('mediaImage', 40)}
205
206
  >
206
207
  <MediaImage src={parentSrc} size={40} shape='square' />
207
208
  </DotSymbol>
208
209
  <DotSymbol
209
210
  shape='square'
210
211
  src={dotSrc}
211
- size={mediaImageDotSizeMap[48]}
212
212
  pin='bottom-end'
213
+ {...getDotSymbolProps('mediaImage', 48)}
213
214
  >
214
215
  <MediaImage src={parentSrc} size={48} shape='square' />
215
216
  </DotSymbol>
216
217
  <DotSymbol
217
218
  shape='square'
218
219
  src={dotSrc}
219
- size={mediaImageDotSizeMap[56]}
220
220
  pin='bottom-end'
221
+ {...getDotSymbolProps('mediaImage', 56)}
221
222
  >
222
223
  <MediaImage src={parentSrc} size={56} shape='square' />
223
224
  </DotSymbol>
224
225
  <DotSymbol
225
226
  shape='square'
226
227
  src={dotSrc}
227
- size={mediaImageDotSizeMap[64]}
228
228
  pin='bottom-end'
229
+ {...getDotSymbolProps('mediaImage', 64)}
229
230
  >
230
231
  <MediaImage src={parentSrc} size={64} shape='square' />
231
232
  </DotSymbol>
232
233
  <DotSymbol
233
234
  shape='square'
234
235
  src={dotSrc}
235
- size={mediaImageDotSizeMap[72]}
236
236
  pin='bottom-end'
237
+ {...getDotSymbolProps('mediaImage', 72)}
237
238
  >
238
239
  <MediaImage src={parentSrc} size={72} shape='square' />
239
240
  </DotSymbol>
@@ -6,8 +6,6 @@ import { useEffect, useState } from 'react';
6
6
  import { Image } from 'react-native';
7
7
  import { useStyleSheet } from '../../../../styles';
8
8
  import { Box } from '../../primitives';
9
- import type { MediaImageSize } from '../MediaImage';
10
- import type { SpotSize } from '../Spot';
11
9
  import type { DotSymbolPin, DotSymbolProps, DotSymbolSize } from './types';
12
10
 
13
11
  const dotSquareRadiusMap: Record<DotSymbolSize, number> = {
@@ -30,27 +28,6 @@ const offsetBySize: Record<DotSymbolSize, number> = {
30
28
  32: -3,
31
29
  };
32
30
 
33
- export const mediaImageDotSizeMap: Record<MediaImageSize, DotSymbolSize> = {
34
- 12: 8,
35
- 16: 8,
36
- 20: 8,
37
- 24: 10,
38
- 32: 12,
39
- 40: 16,
40
- 48: 20,
41
- 56: 24,
42
- 64: 24,
43
- 72: 32,
44
- };
45
-
46
- export const spotDotSizeMap: Record<SpotSize, DotSymbolSize> = {
47
- 32: 12,
48
- 40: 16,
49
- 48: 20,
50
- 56: 24,
51
- 72: 32,
52
- };
53
-
54
31
  const pinAxisMap: Record<DotSymbolPin, [vertical: string, horizontal: string]> =
55
32
  {
56
33
  'top-start': ['top', 'left'],
@@ -0,0 +1,25 @@
1
+ import { describe, it, expect } from '@jest/globals';
2
+ import { getDotSymbolProps } from './index';
3
+
4
+ describe('getDotSymbolProps', () => {
5
+ it('resolves mediaImage dot symbol props', () => {
6
+ expect(getDotSymbolProps('mediaImage', 12)).toEqual({ size: 8 });
7
+ expect(getDotSymbolProps('mediaImage', 16)).toEqual({ size: 8 });
8
+ expect(getDotSymbolProps('mediaImage', 20)).toEqual({ size: 8 });
9
+ expect(getDotSymbolProps('mediaImage', 24)).toEqual({ size: 10 });
10
+ expect(getDotSymbolProps('mediaImage', 32)).toEqual({ size: 12 });
11
+ expect(getDotSymbolProps('mediaImage', 40)).toEqual({ size: 16 });
12
+ expect(getDotSymbolProps('mediaImage', 48)).toEqual({ size: 20 });
13
+ expect(getDotSymbolProps('mediaImage', 56)).toEqual({ size: 24 });
14
+ expect(getDotSymbolProps('mediaImage', 64)).toEqual({ size: 24 });
15
+ expect(getDotSymbolProps('mediaImage', 72)).toEqual({ size: 32 });
16
+ });
17
+
18
+ it('resolves spot dot symbol props', () => {
19
+ expect(getDotSymbolProps('spot', 32)).toEqual({ size: 12 });
20
+ expect(getDotSymbolProps('spot', 40)).toEqual({ size: 16 });
21
+ expect(getDotSymbolProps('spot', 48)).toEqual({ size: 20 });
22
+ expect(getDotSymbolProps('spot', 56)).toEqual({ size: 24 });
23
+ expect(getDotSymbolProps('spot', 72)).toEqual({ size: 32 });
24
+ });
25
+ });
@@ -0,0 +1,26 @@
1
+ import { createPropsResolver } from '@ledgerhq/lumen-utils-shared';
2
+ import type { MediaImageSize } from '../MediaImage';
3
+ import type { SpotSize } from '../Spot';
4
+ import type { DotSymbolProps } from './types';
5
+
6
+ export const getDotSymbolProps = createPropsResolver({
7
+ mediaImage: {
8
+ 12: { size: 8 },
9
+ 16: { size: 8 },
10
+ 20: { size: 8 },
11
+ 24: { size: 10 },
12
+ 32: { size: 12 },
13
+ 40: { size: 16 },
14
+ 48: { size: 20 },
15
+ 56: { size: 24 },
16
+ 64: { size: 24 },
17
+ 72: { size: 32 },
18
+ } satisfies Record<MediaImageSize, Partial<DotSymbolProps>>,
19
+ spot: {
20
+ 32: { size: 12 },
21
+ 40: { size: 16 },
22
+ 48: { size: 20 },
23
+ 56: { size: 24 },
24
+ 72: { size: 32 },
25
+ } satisfies Record<SpotSize, Partial<DotSymbolProps>>,
26
+ });
@@ -1,2 +1,3 @@
1
- export { DotSymbol, mediaImageDotSizeMap, spotDotSizeMap } from './DotSymbol';
1
+ export { DotSymbol } from './DotSymbol';
2
+ export * from './getDotSymbolProps';
2
3
  export * from './types';
@@ -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 option list and dropdown patterns. It displays a label with an optional leading icon and a permanent trailing chevron indicator.
14
+ A specialized media button designed exclusively for select 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 an OptionList or dropdown. For standalone actions, use [Button](/docs/rnative-button--docs) or [IconButton](/docs/rnative-iconbutton--docs) instead.
18
+ > **Important**: This component should only be used as a trigger inside a SelectList or dropdown. For standalone actions, use [Button](/docs/rnative-button--docs) or [IconButton](/docs/rnative-iconbutton--docs) instead.
19
19
 
20
20
  ## Properties
21
21
 
@@ -127,10 +127,10 @@ const useStyles = ({
127
127
  };
128
128
 
129
129
  /**
130
- * Media button for option list/dropdown components. Displays a label with an optional
130
+ * Media button for select list/dropdown components. Displays a label with an optional
131
131
  * leading content and a trailing chevron indicator.
132
132
  *
133
- * This component is intended to be used exclusively as the trigger inside an OptionList or
133
+ * This component is intended to be used exclusively as the trigger inside a SelectList or
134
134
  * dropdown pattern. It should not be used as a standalone action button — use `Button`
135
135
  * or `IconButton` instead.
136
136
  *
@@ -0,0 +1,23 @@
1
+ import figma from '@figma/code-connect';
2
+ import { MenuList, MenuListItem } from './MenuList';
3
+
4
+ figma.connect(
5
+ MenuListItem,
6
+ 'https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7?node-id=7897-7037',
7
+ {
8
+ imports: [
9
+ "import { MenuList, MenuListItem } from '@ledgerhq/lumen-ui-rnative'",
10
+ ],
11
+ props: {
12
+ label: figma.string('title'),
13
+ disabled: figma.enum('state', {
14
+ disabled: true,
15
+ }),
16
+ },
17
+ example: (props) => (
18
+ <MenuList>
19
+ <MenuListItem label={props.label} disabled={props.disabled} />
20
+ </MenuList>
21
+ ),
22
+ },
23
+ );