@ledgerhq/lumen-ui-rnative 0.1.28 → 0.1.30

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 (93) hide show
  1. package/dist/module/i18n/locales/de.json +2 -1
  2. package/dist/module/i18n/locales/en.json +2 -1
  3. package/dist/module/i18n/locales/es.json +2 -1
  4. package/dist/module/i18n/locales/fr.json +2 -1
  5. package/dist/module/i18n/locales/ja.json +3 -2
  6. package/dist/module/i18n/locales/ko.json +3 -2
  7. package/dist/module/i18n/locales/pt.json +2 -1
  8. package/dist/module/i18n/locales/ru.json +2 -1
  9. package/dist/module/i18n/locales/th.json +2 -1
  10. package/dist/module/i18n/locales/tr.json +3 -2
  11. package/dist/module/i18n/locales/zh.json +3 -2
  12. package/dist/module/lib/Components/Avatar/Avatar.figma.js +2 -1
  13. package/dist/module/lib/Components/Avatar/Avatar.figma.js.map +1 -1
  14. package/dist/module/lib/Components/Avatar/Avatar.js +8 -2
  15. package/dist/module/lib/Components/Avatar/Avatar.js.map +1 -1
  16. package/dist/module/lib/Components/Avatar/Avatar.mdx +3 -2
  17. package/dist/module/lib/Components/Avatar/Avatar.stories.js +16 -0
  18. package/dist/module/lib/Components/Avatar/Avatar.stories.js.map +1 -1
  19. package/dist/module/lib/Components/Avatar/Avatar.test.js +17 -0
  20. package/dist/module/lib/Components/Avatar/Avatar.test.js.map +1 -1
  21. package/dist/module/lib/Components/Card/Card.stories.js +19 -19
  22. package/dist/module/lib/Components/Card/Card.stories.js.map +1 -1
  23. package/dist/module/lib/Components/DotIcon/DotIcon.js +1 -1
  24. package/dist/module/lib/Components/DotIndicator/DotIndicator.js +2 -1
  25. package/dist/module/lib/Components/DotIndicator/DotIndicator.js.map +1 -1
  26. package/dist/module/lib/Components/DotIndicator/DotIndicator.mdx +3 -2
  27. package/dist/module/lib/Components/DotIndicator/DotIndicator.stories.js +20 -4
  28. package/dist/module/lib/Components/DotIndicator/DotIndicator.stories.js.map +1 -1
  29. package/dist/module/lib/Components/DotIndicator/DotIndicator.test.js +10 -0
  30. package/dist/module/lib/Components/DotIndicator/DotIndicator.test.js.map +1 -1
  31. package/dist/module/lib/Components/ListItem/ListItem.stories.js +3 -3
  32. package/dist/module/lib/Components/ListItem/ListItem.stories.js.map +1 -1
  33. package/dist/module/lib/Components/MediaButton/MediaButton.stories.js +4 -4
  34. package/dist/module/lib/Components/MediaButton/MediaButton.stories.js.map +1 -1
  35. package/dist/module/lib/Components/MediaCard/MediaCard.stories.js +3 -3
  36. package/dist/module/lib/Components/MediaCard/MediaCard.stories.js.map +1 -1
  37. package/dist/module/lib/Components/MediaImage/MediaImage.js +41 -7
  38. package/dist/module/lib/Components/MediaImage/MediaImage.js.map +1 -1
  39. package/dist/module/lib/Components/MediaImage/MediaImage.mdx +38 -5
  40. package/dist/module/lib/Components/MediaImage/MediaImage.stories.js +92 -0
  41. package/dist/module/lib/Components/MediaImage/MediaImage.stories.js.map +1 -1
  42. package/dist/module/lib/Components/MediaImage/MediaImage.test.js +117 -0
  43. package/dist/module/lib/Components/MediaImage/MediaImage.test.js.map +1 -1
  44. package/dist/module/lib/Components/NavBar/NavBar.mdx +0 -1
  45. package/dist/module/lib/Components/NavBar/NavBar.stories.js +2 -2
  46. package/dist/module/lib/Components/NavBar/NavBar.stories.js.map +1 -1
  47. package/dist/module/lib/Components/OptionList/OptionList.stories.js +7 -7
  48. package/dist/module/lib/Components/OptionList/OptionList.stories.js.map +1 -1
  49. package/dist/typescript/src/lib/Components/Avatar/Avatar.d.ts.map +1 -1
  50. package/dist/typescript/src/lib/Components/Avatar/types.d.ts +1 -1
  51. package/dist/typescript/src/lib/Components/Avatar/types.d.ts.map +1 -1
  52. package/dist/typescript/src/lib/Components/DotIndicator/types.d.ts +1 -1
  53. package/dist/typescript/src/lib/Components/DotIndicator/types.d.ts.map +1 -1
  54. package/dist/typescript/src/lib/Components/MediaImage/MediaImage.d.ts +9 -3
  55. package/dist/typescript/src/lib/Components/MediaImage/MediaImage.d.ts.map +1 -1
  56. package/dist/typescript/src/lib/Components/MediaImage/types.d.ts +12 -0
  57. package/dist/typescript/src/lib/Components/MediaImage/types.d.ts.map +1 -1
  58. package/package.json +1 -1
  59. package/src/i18n/locales/de.json +2 -1
  60. package/src/i18n/locales/en.json +2 -1
  61. package/src/i18n/locales/es.json +2 -1
  62. package/src/i18n/locales/fr.json +2 -1
  63. package/src/i18n/locales/ja.json +3 -2
  64. package/src/i18n/locales/ko.json +3 -2
  65. package/src/i18n/locales/pt.json +2 -1
  66. package/src/i18n/locales/ru.json +2 -1
  67. package/src/i18n/locales/th.json +2 -1
  68. package/src/i18n/locales/tr.json +3 -2
  69. package/src/i18n/locales/zh.json +3 -2
  70. package/src/lib/Components/Avatar/Avatar.figma.tsx +1 -0
  71. package/src/lib/Components/Avatar/Avatar.mdx +3 -2
  72. package/src/lib/Components/Avatar/Avatar.stories.tsx +9 -0
  73. package/src/lib/Components/Avatar/Avatar.test.tsx +17 -0
  74. package/src/lib/Components/Avatar/Avatar.tsx +4 -1
  75. package/src/lib/Components/Avatar/types.ts +1 -1
  76. package/src/lib/Components/Card/Card.stories.tsx +19 -19
  77. package/src/lib/Components/DotIcon/DotIcon.tsx +1 -1
  78. package/src/lib/Components/DotIndicator/DotIndicator.mdx +3 -2
  79. package/src/lib/Components/DotIndicator/DotIndicator.stories.tsx +11 -1
  80. package/src/lib/Components/DotIndicator/DotIndicator.test.tsx +10 -0
  81. package/src/lib/Components/DotIndicator/DotIndicator.tsx +2 -1
  82. package/src/lib/Components/DotIndicator/types.ts +1 -1
  83. package/src/lib/Components/ListItem/ListItem.stories.tsx +3 -3
  84. package/src/lib/Components/MediaButton/MediaButton.stories.tsx +4 -4
  85. package/src/lib/Components/MediaCard/MediaCard.stories.tsx +3 -3
  86. package/src/lib/Components/MediaImage/MediaImage.mdx +38 -5
  87. package/src/lib/Components/MediaImage/MediaImage.stories.tsx +32 -0
  88. package/src/lib/Components/MediaImage/MediaImage.test.tsx +108 -0
  89. package/src/lib/Components/MediaImage/MediaImage.tsx +37 -3
  90. package/src/lib/Components/MediaImage/types.ts +12 -0
  91. package/src/lib/Components/NavBar/NavBar.mdx +0 -1
  92. package/src/lib/Components/NavBar/NavBar.stories.tsx +2 -2
  93. package/src/lib/Components/OptionList/OptionList.stories.tsx +11 -11
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/Avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC"}
@@ -5,7 +5,7 @@ export type DotIndicatorProps = {
5
5
  * The size of the dot indicator.
6
6
  * @default sm
7
7
  */
8
- size?: 'xs' | 'sm' | 'md';
8
+ size?: 'xs' | 'sm' | 'md' | 'lg';
9
9
  /**
10
10
  * The appearance of the dot indicator.
11
11
  * @default base
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/DotIndicator/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/DotIndicator/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC"}
@@ -1,14 +1,20 @@
1
- import type { MediaImageProps } from './types';
1
+ import type { MediaImageProps, MediaImageSize } from './types';
2
+ export declare const fontSizeMap: Record<MediaImageSize, number>;
2
3
  /**
3
4
  * A generic media image component that displays an image with optional shape variants.
4
5
  * Supports square and circular appearances with consistent sizing.
5
6
  *
6
- * When the image fails to load or no src is provided, displays a background placeholder.
7
+ * When the image fails to load or no src is provided, displays a fallback letter (if `fallback`
8
+ * is provided) or a muted background placeholder.
9
+ *
10
+ * While `loading` is true, a pulsing skeleton overlay is shown regardless of `src`.
7
11
  *
8
12
  * @example
9
13
  * import { MediaImage } from '@ledgerhq/lumen-ui-rnative';
10
14
  *
11
15
  * <MediaImage src="https://example.com/icon.png" alt="Bitcoin" size={32} />
16
+ * <MediaImage fallback="Bitcoin" size={32} />
17
+ * <MediaImage loading size={32} />
12
18
  */
13
- export declare const MediaImage: ({ src, alt, size, shape, lx, style, ref, ...props }: MediaImageProps) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const MediaImage: ({ src, alt, size, shape, fallback, loading, lx, style, ref, ...props }: MediaImageProps) => import("react/jsx-runtime").JSX.Element;
14
20
  //# sourceMappingURL=MediaImage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MediaImage.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/MediaImage/MediaImage.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAmC,MAAM,SAAS,CAAC;AAmDhF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,GAAI,qDASxB,eAAe,4CA6BjB,CAAC"}
1
+ {"version":3,"file":"MediaImage.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/MediaImage/MediaImage.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAmB,MAAM,SAAS,CAAC;AAgBhF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAUtD,CAAC;AAyCF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,UAAU,GAAI,wEAWxB,eAAe,4CAuCjB,CAAC"}
@@ -21,5 +21,17 @@ export type MediaImageProps = {
21
21
  * Alternative text for the image, used for accessibility.
22
22
  */
23
23
  alt?: string;
24
+ /**
25
+ * Text used to derive a single-letter fallback when no `src` is provided or the image fails to load.
26
+ * The first character is displayed, uppercased.
27
+ * @optional
28
+ */
29
+ fallback?: string;
30
+ /**
31
+ * When true, displays a pulsing skeleton placeholder instead of the image or fallback.
32
+ * @optional
33
+ * @default false
34
+ */
35
+ loading?: boolean;
24
36
  } & Omit<StyledViewProps, 'children'>;
25
37
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/MediaImage/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAExE,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAElD,MAAM,MAAM,eAAe,GAAG;IAC5B;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/MediaImage/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAExE,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAElD,MAAM,MAAM,eAAe,GAAG;IAC5B;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-rnative",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
4
4
  "license": "Apache-2.0",
5
5
  "keywords": [
6
6
  "react-native",
@@ -11,7 +11,8 @@
11
11
  },
12
12
  "avatar": {
13
13
  "defaultAlt": "Benutzer-Avatar",
14
- "notificationAriaLabel": "Hat Benachrichtigung"
14
+ "notificationAriaLabel": "Hat Benachrichtigung",
15
+ "fallbackIconAriaLabel": "Fallback-Icon"
15
16
  },
16
17
  "baseInput": {
17
18
  "clearInputAriaLabel": "Eingabe löschen"
@@ -11,7 +11,8 @@
11
11
  },
12
12
  "avatar": {
13
13
  "defaultAlt": "User avatar",
14
- "notificationAriaLabel": "Has notification"
14
+ "notificationAriaLabel": "Has notification",
15
+ "fallbackIconAriaLabel": "Fallback Icon"
15
16
  },
16
17
  "baseInput": {
17
18
  "clearInputAriaLabel": "Clear input"
@@ -11,7 +11,8 @@
11
11
  },
12
12
  "avatar": {
13
13
  "defaultAlt": "Avatar de usuario",
14
- "notificationAriaLabel": "Tiene notificación"
14
+ "notificationAriaLabel": "Tiene notificación",
15
+ "fallbackIconAriaLabel": "Ícono alternativo"
15
16
  },
16
17
  "baseInput": {
17
18
  "clearInputAriaLabel": "Borrar entrada"
@@ -11,7 +11,8 @@
11
11
  },
12
12
  "avatar": {
13
13
  "defaultAlt": "Avatar de l'utilisateur",
14
- "notificationAriaLabel": "A une notification"
14
+ "notificationAriaLabel": "A une notification",
15
+ "fallbackIconAriaLabel": "Icône par défaut"
15
16
  },
16
17
  "baseInput": {
17
18
  "clearInputAriaLabel": "Effacer la saisie"
@@ -11,7 +11,8 @@
11
11
  },
12
12
  "avatar": {
13
13
  "defaultAlt": "ユーザーアバター",
14
- "notificationAriaLabel": "通知あり"
14
+ "notificationAriaLabel": "通知あり",
15
+ "fallbackIconAriaLabel": "フォールバックアイコン"
15
16
  },
16
17
  "baseInput": {
17
18
  "clearInputAriaLabel": "インプットを削除"
@@ -30,7 +31,7 @@
30
31
  "opensInNewTabAriaLabel": "(新しいタブで開く)"
31
32
  },
32
33
  "stepper": {
33
- "progressAriaLabel": "ステップ {{currentStep}}/{{totalSteps}}"
34
+ "progressAriaLabel": "ステップ{{currentStep}}/{{totalSteps}}"
34
35
  }
35
36
  }
36
37
  }
@@ -11,7 +11,8 @@
11
11
  },
12
12
  "avatar": {
13
13
  "defaultAlt": "사용자 아바타",
14
- "notificationAriaLabel": "알림 있음"
14
+ "notificationAriaLabel": "알림 있음",
15
+ "fallbackIconAriaLabel": "대체 아이콘"
15
16
  },
16
17
  "baseInput": {
17
18
  "clearInputAriaLabel": "입력 값 지우기"
@@ -30,7 +31,7 @@
30
31
  "opensInNewTabAriaLabel": "(새 탭에서 열기)"
31
32
  },
32
33
  "stepper": {
33
- "progressAriaLabel": "{{totalSteps}}단계 중 {{currentStep}}단계"
34
+ "progressAriaLabel": "{{totalSteps}} 중 {{currentStep}} 단계"
34
35
  }
35
36
  }
36
37
  }
@@ -11,7 +11,8 @@
11
11
  },
12
12
  "avatar": {
13
13
  "defaultAlt": "Avatar do usuário",
14
- "notificationAriaLabel": "Tem notificação"
14
+ "notificationAriaLabel": "Tem notificação",
15
+ "fallbackIconAriaLabel": "Ícone fallback"
15
16
  },
16
17
  "baseInput": {
17
18
  "clearInputAriaLabel": "Limpar input"
@@ -11,7 +11,8 @@
11
11
  },
12
12
  "avatar": {
13
13
  "defaultAlt": "Аватар пользователя",
14
- "notificationAriaLabel": "Есть уведомление"
14
+ "notificationAriaLabel": "Есть уведомление",
15
+ "fallbackIconAriaLabel": "Стандартная иконка"
15
16
  },
16
17
  "baseInput": {
17
18
  "clearInputAriaLabel": "Очистить поле"
@@ -11,7 +11,8 @@
11
11
  },
12
12
  "avatar": {
13
13
  "defaultAlt": "อวาตาร์ผู้ใช้",
14
- "notificationAriaLabel": "มีการแจ้งเตือน"
14
+ "notificationAriaLabel": "มีการแจ้งเตือน",
15
+ "fallbackIconAriaLabel": "ไอคอนสำรอง"
15
16
  },
16
17
  "baseInput": {
17
18
  "clearInputAriaLabel": "ล้างอินพุต"
@@ -11,7 +11,8 @@
11
11
  },
12
12
  "avatar": {
13
13
  "defaultAlt": "Kullanıcı avatarı",
14
- "notificationAriaLabel": "Bildirim var"
14
+ "notificationAriaLabel": "Bildirim var",
15
+ "fallbackIconAriaLabel": "Yedek simge"
15
16
  },
16
17
  "baseInput": {
17
18
  "clearInputAriaLabel": "Girdiyi temizle"
@@ -30,7 +31,7 @@
30
31
  "opensInNewTabAriaLabel": "(yeni sekmede açılır)"
31
32
  },
32
33
  "stepper": {
33
- "progressAriaLabel": "{{totalSteps}} adımdan {{currentStep}}. adım"
34
+ "progressAriaLabel": "Adım {{totalSteps}} / {{currentStep}}"
34
35
  }
35
36
  }
36
37
  }
@@ -11,7 +11,8 @@
11
11
  },
12
12
  "avatar": {
13
13
  "defaultAlt": "用户头像",
14
- "notificationAriaLabel": "有通知"
14
+ "notificationAriaLabel": "有通知",
15
+ "fallbackIconAriaLabel": "备用图标"
15
16
  },
16
17
  "baseInput": {
17
18
  "clearInputAriaLabel": "清空输入框"
@@ -30,7 +31,7 @@
30
31
  "opensInNewTabAriaLabel": "(在新选项卡中打开)"
31
32
  },
32
33
  "stepper": {
33
- "progressAriaLabel": "第 {{currentStep}} 步,共 {{totalSteps}} 步"
34
+ "progressAriaLabel": "第 {{currentStep}} / {{totalSteps}} 步"
34
35
  }
35
36
  }
36
37
  }
@@ -11,6 +11,7 @@ figma.connect(
11
11
  sm: 'sm',
12
12
  md: 'md',
13
13
  lg: 'lg',
14
+ xl: 'xl',
14
15
  }),
15
16
  showNotification: figma.boolean('show-notification', {
16
17
  true: true,
@@ -15,7 +15,7 @@ import { Box } from '../Utility';
15
15
 
16
16
  ## Introduction
17
17
 
18
- The Avatar component displays a circular user profile image with automatic fallback to a User icon when the image is unavailable or fails to load. It supports an optional notification indicator and three size variants. This React Native implementation ensures consistent behavior across mobile platforms while maintaining design system coherence.
18
+ The Avatar component displays a circular user profile image with automatic fallback to a User icon when the image is unavailable or fails to load. It supports an optional notification indicator and four size variants. This React Native implementation ensures consistent behavior across mobile platforms while maintaining design system coherence.
19
19
 
20
20
  > View in [Figma](https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7/2.-Components-Library?node-id=10546-614&p=f&m=dev).
21
21
 
@@ -36,7 +36,7 @@ The Avatar component displays a circular user profile image with automatic fallb
36
36
 
37
37
  ### Size
38
38
 
39
- Avatars come in three different sizes:
39
+ Avatars come in four different sizes:
40
40
 
41
41
  <Canvas of={AvatarStories.SizeShowcase} />
42
42
 
@@ -137,6 +137,7 @@ function MyComponent() {
137
137
  <Avatar src="https://example.com/photo.jpg" size="sm" />
138
138
  <Avatar src="https://example.com/photo.jpg" size="md" />
139
139
  <Avatar src="https://example.com/photo.jpg" size="lg" />
140
+ <Avatar src="https://example.com/photo.jpg" size="xl" />
140
141
  </Box>
141
142
  );
142
143
  }
@@ -77,6 +77,15 @@ export const SizeShowcase: Story = {
77
77
  />
78
78
  <Text style={{ marginTop: 4 }}>lg</Text>
79
79
  </View>
80
+ <View style={{ alignItems: 'center', justifyContent: 'flex-end' }}>
81
+ <Avatar
82
+ src={exampleSrc}
83
+ alt='avatar'
84
+ size='xl'
85
+ showNotification={false}
86
+ />
87
+ <Text style={{ marginTop: 4 }}>xl</Text>
88
+ </View>
80
89
  </Box>
81
90
  ),
82
91
  };
@@ -55,6 +55,14 @@ describe('Avatar Component', () => {
55
55
  <Avatar testID='avatar-id' size='lg' />
56
56
  </TestWrapper>,
57
57
  );
58
+ expect(getByTestId('avatar-id').props.style.width).toBe(sizes.s56);
59
+ expect(getByTestId('avatar-id').props.style.height).toBe(sizes.s56);
60
+
61
+ rerender(
62
+ <TestWrapper>
63
+ <Avatar testID='avatar-id' size='xl' />
64
+ </TestWrapper>,
65
+ );
58
66
  expect(getByTestId('avatar-id').props.style.width).toBe(sizes.s72);
59
67
  expect(getByTestId('avatar-id').props.style.height).toBe(sizes.s72);
60
68
  });
@@ -194,6 +202,15 @@ describe('Avatar Component', () => {
194
202
  </TestWrapper>,
195
203
  );
196
204
 
205
+ dot = toJSON().children[0];
206
+ expect(dot.props.style.height).toBe(sizes.s14);
207
+
208
+ rerender(
209
+ <TestWrapper>
210
+ <Avatar testID='avatar-id' size='xl' showNotification />
211
+ </TestWrapper>,
212
+ );
213
+
197
214
  dot = toJSON().children[0];
198
215
  expect(dot.props.style.height).toBe(sizes.s16);
199
216
  });
@@ -13,6 +13,7 @@ const fallbackSizes = {
13
13
  sm: 16,
14
14
  md: 24,
15
15
  lg: 32,
16
+ xl: 40,
16
17
  } as const;
17
18
 
18
19
  const dotSizeMap: Record<
@@ -22,6 +23,7 @@ const dotSizeMap: Record<
22
23
  sm: 'xs',
23
24
  md: 'sm',
24
25
  lg: 'md',
26
+ xl: 'lg',
25
27
  };
26
28
 
27
29
  const useStyles = ({ size }: { size: Size }) => {
@@ -30,7 +32,8 @@ const useStyles = ({ size }: { size: Size }) => {
30
32
  const sizeMap = {
31
33
  sm: { size: t.sizes.s40, padding: t.spacings.s4 },
32
34
  md: { size: t.sizes.s48, padding: t.spacings.s4 },
33
- lg: { size: t.sizes.s72, padding: t.spacings.s4 },
35
+ lg: { size: t.sizes.s56, padding: t.spacings.s4 },
36
+ xl: { size: t.sizes.s72, padding: t.spacings.s4 },
34
37
  };
35
38
 
36
39
  return {
@@ -16,7 +16,7 @@ export type AvatarProps = {
16
16
  * @optional
17
17
  * @default md
18
18
  */
19
- size?: 'sm' | 'md' | 'lg';
19
+ size?: 'sm' | 'md' | 'lg' | 'xl';
20
20
  /**
21
21
  * Whether to show the notifications indicator.
22
22
  * @optional
@@ -1,4 +1,4 @@
1
- import { CryptoIcon } from '@ledgerhq/crypto-icons';
1
+ import CryptoIcon from '@ledgerhq/crypto-icons/native';
2
2
  import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
3
3
  import { useState } from 'react';
4
4
  import { Wallet } from '../../Symbols';
@@ -71,7 +71,7 @@ export const Base: Story = {
71
71
  <Card {...args}>
72
72
  <CardHeader>
73
73
  <CardLeading>
74
- <CryptoIcon ledgerId='bitcoin' ticker='BTC' size='48px' />
74
+ <CryptoIcon ledgerId='bitcoin' ticker='BTC' size={48} />
75
75
  <CardContent>
76
76
  <CardContentTitle>Bitcoin</CardContentTitle>
77
77
  <CardContentDescription>BTC</CardContentDescription>
@@ -96,7 +96,7 @@ export const Base: Story = {
96
96
  <Card onPress={handlePress}>
97
97
  <CardHeader>
98
98
  <CardLeading>
99
- <CryptoIcon ledgerId="bitcoin" ticker="BTC" size="48px" />
99
+ <CryptoIcon ledgerId="bitcoin" ticker="BTC" size={48} />
100
100
  <CardContent>
101
101
  <CardContentTitle>Bitcoin</CardContentTitle>
102
102
  <CardContentDescription>BTC</CardContentDescription>
@@ -125,7 +125,7 @@ export const StatesShowcase: Story = {
125
125
  <Card {...args} lx={{ width: 's320' }}>
126
126
  <CardHeader>
127
127
  <CardLeading>
128
- <CryptoIcon ledgerId='bitcoin' ticker='BTC' size='48px' />
128
+ <CryptoIcon ledgerId='bitcoin' ticker='BTC' size={48} />
129
129
  <CardContent>
130
130
  <CardContentTitle>Interactive (default)</CardContentTitle>
131
131
  <CardContentDescription>
@@ -150,7 +150,7 @@ export const StatesShowcase: Story = {
150
150
  <Card {...args} lx={{ width: 's320' }} outlined>
151
151
  <CardHeader>
152
152
  <CardLeading>
153
- <CryptoIcon ledgerId='bitcoin' ticker='BTC' size='48px' />
153
+ <CryptoIcon ledgerId='bitcoin' ticker='BTC' size={48} />
154
154
  <CardContent>
155
155
  <CardContentTitle>Outlined</CardContentTitle>
156
156
  <CardContentDescription>Selected state</CardContentDescription>
@@ -173,7 +173,7 @@ export const StatesShowcase: Story = {
173
173
  <Card {...args} lx={{ width: 's320' }} type='info'>
174
174
  <CardHeader>
175
175
  <CardLeading>
176
- <CryptoIcon ledgerId='bitcoin' ticker='BTC' size='48px' />
176
+ <CryptoIcon ledgerId='bitcoin' ticker='BTC' size={48} />
177
177
  <CardContent>
178
178
  <CardContentTitle>Info</CardContentTitle>
179
179
  <CardContentDescription>Data display only</CardContentDescription>
@@ -197,7 +197,7 @@ export const StatesShowcase: Story = {
197
197
  <CardHeader>
198
198
  <CardLeading>
199
199
  <Box lx={{ opacity: 0.3 }}>
200
- <CryptoIcon ledgerId='bitcoin' ticker='BTC' size='48px' />
200
+ <CryptoIcon ledgerId='bitcoin' ticker='BTC' size={48} />
201
201
  </Box>
202
202
  <CardContent>
203
203
  <CardContentTitle>Disabled</CardContentTitle>
@@ -286,7 +286,7 @@ export const ExpandableShowcase: Story = {
286
286
  >
287
287
  <CardHeader>
288
288
  <CardLeading>
289
- <CryptoIcon ledgerId='bitcoin' ticker='BTC' size='48px' />
289
+ <CryptoIcon ledgerId='bitcoin' ticker='BTC' size={48} />
290
290
  <CardContent>
291
291
  <CardContentTitle>Expandable Card</CardContentTitle>
292
292
  <CardContentDescription>
@@ -332,7 +332,7 @@ export const LayoutShowcase: Story = {
332
332
  <Card {...args}>
333
333
  <CardHeader>
334
334
  <CardLeading>
335
- <CryptoIcon ledgerId='bitcoin' ticker='BTC' size='48px' />
335
+ <CryptoIcon ledgerId='bitcoin' ticker='BTC' size={48} />
336
336
  <CardContent>
337
337
  <CardContentTitle>Defined width (320px)</CardContentTitle>
338
338
  <CardContentDescription>BTC</CardContentDescription>
@@ -347,7 +347,7 @@ export const LayoutShowcase: Story = {
347
347
  <Card {...args} lx={{ width: 's320' }}>
348
348
  <CardHeader>
349
349
  <CardLeading>
350
- <CryptoIcon ledgerId='bitcoin' ticker='BTC' size='48px' />
350
+ <CryptoIcon ledgerId='bitcoin' ticker='BTC' size={48} />
351
351
  <CardContent>
352
352
  <CardContentRow>
353
353
  <CardContentTitle>With Tags</CardContentTitle>
@@ -370,7 +370,7 @@ export const LayoutShowcase: Story = {
370
370
  <Card {...args} lx={{ width: 's320' }}>
371
371
  <CardHeader>
372
372
  <CardLeading>
373
- <CryptoIcon ledgerId='bitcoin' ticker='BTC' size='48px' />
373
+ <CryptoIcon ledgerId='bitcoin' ticker='BTC' size={48} />
374
374
  <CardContent>
375
375
  <CardContentRow>
376
376
  <CardContentTitle>Trailing values</CardContentTitle>
@@ -403,7 +403,7 @@ export const LayoutShowcase: Story = {
403
403
  <Card {...args} lx={{ width: 'full' }}>
404
404
  <CardHeader>
405
405
  <CardLeading>
406
- <CryptoIcon ledgerId='bitcoin' ticker='BTC' size='48px' />
406
+ <CryptoIcon ledgerId='bitcoin' ticker='BTC' size={48} />
407
407
  <CardContent>
408
408
  <CardContentTitle>Full width (fills parent)</CardContentTitle>
409
409
  <CardContentDescription>BTC</CardContentDescription>
@@ -433,7 +433,7 @@ export const CompositionsShowcase: Story = {
433
433
  <Card type='info'>
434
434
  <CardHeader>
435
435
  <CardLeading>
436
- <CryptoIcon ledgerId='bitcoin' ticker='BTC' size='48px' />
436
+ <CryptoIcon ledgerId='bitcoin' ticker='BTC' size={48} />
437
437
  <CardContent>
438
438
  <CardContentTitle>Account 1</CardContentTitle>
439
439
  <CardContentDescription>Ethereum</CardContentDescription>
@@ -457,7 +457,7 @@ export const CompositionsShowcase: Story = {
457
457
  <Card>
458
458
  <CardHeader>
459
459
  <CardLeading>
460
- <CryptoIcon ledgerId='bitcoin' ticker='BTC' size='48px' />
460
+ <CryptoIcon ledgerId='bitcoin' ticker='BTC' size={48} />
461
461
  <CardContent>
462
462
  <CardContentTitle>Bitcoin</CardContentTitle>
463
463
  <CardContentDescription>BTC</CardContentDescription>
@@ -503,7 +503,7 @@ export const CompositionsShowcase: Story = {
503
503
  <Card>
504
504
  <CardHeader>
505
505
  <CardLeading>
506
- <CryptoIcon ledgerId='bitcoin' ticker='BTC' size='48px' />
506
+ <CryptoIcon ledgerId='bitcoin' ticker='BTC' size={48} />
507
507
  <CardContent>
508
508
  <CardContentTitle>My Wallet</CardContentTitle>
509
509
  <CardContentDescription>Ethereum</CardContentDescription>
@@ -523,7 +523,7 @@ export const CompositionsShowcase: Story = {
523
523
  <Card>
524
524
  <CardHeader>
525
525
  <CardLeading>
526
- <CryptoIcon ledgerId='bitcoin' ticker='BTC' size='48px' />
526
+ <CryptoIcon ledgerId='bitcoin' ticker='BTC' size={48} />
527
527
  <CardContent>
528
528
  <CardContentRow>
529
529
  <CardContentTitle>Bitcoin</CardContentTitle>
@@ -576,7 +576,7 @@ export const CompositionsShowcase: Story = {
576
576
  <Card type='info'>
577
577
  <CardHeader>
578
578
  <CardLeading>
579
- <CryptoIcon ledgerId='bitcoin' ticker='BTC' size='48px' />
579
+ <CryptoIcon ledgerId='bitcoin' ticker='BTC' size={48} />
580
580
  <CardContent>
581
581
  <CardContentTitle>Staking</CardContentTitle>
582
582
  <CardContentDescription>Earn rewards</CardContentDescription>
@@ -604,7 +604,7 @@ export const CompositionsShowcase: Story = {
604
604
  <Card type='info'>
605
605
  <CardHeader>
606
606
  <CardLeading>
607
- <CryptoIcon ledgerId='bitcoin' ticker='BTC' size='48px' />
607
+ <CryptoIcon ledgerId='bitcoin' ticker='BTC' size={48} />
608
608
  <CardContent>
609
609
  <CardContentTitle>My Wallet</CardContentTitle>
610
610
  <CardContentDescription>Ethereum</CardContentDescription>
@@ -630,7 +630,7 @@ export const CompositionsShowcase: Story = {
630
630
  >
631
631
  <CardHeader>
632
632
  <CardLeading>
633
- <CryptoIcon ledgerId='bitcoin' ticker='BTC' size='48px' />
633
+ <CryptoIcon ledgerId='bitcoin' ticker='BTC' size={48} />
634
634
  <CardContent>
635
635
  <CardContentTitle>Bitcoin</CardContentTitle>
636
636
  <CardContentDescription>BTC</CardContentDescription>
@@ -11,7 +11,7 @@ import type {
11
11
 
12
12
  const dotIconSizeMap: Record<DotIconSize, IconSize> = {
13
13
  16: 12,
14
- 20: 12,
14
+ 20: 16,
15
15
  24: 16,
16
16
  };
17
17
 
@@ -22,11 +22,12 @@ import { CustomTabs, Tab } from '../../../../.storybook/components';
22
22
 
23
23
  ## Sizes
24
24
 
25
- DotIndicator comes in three sizes:
25
+ DotIndicator comes in four sizes:
26
26
 
27
27
  - **xs** - compact dot for tight layouts.
28
28
  - **sm** (default) - standard dot for most use cases.
29
- - **md** - larger dot for prominent indicators.
29
+ - **md** - medium dot for prominent indicators.
30
+ - **lg** - large dot for maximum visibility.
30
31
 
31
32
  <Canvas of={DotIndicatorStories.SizeShowcase} />
32
33
 
@@ -1,5 +1,8 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
2
+ import { Settings } from '../../Symbols';
3
+ import { Avatar } from '../Avatar/Avatar';
2
4
  import { Button } from '../Button/Button';
5
+ import { IconButton } from '../IconButton/IconButton';
3
6
  import { Box } from '../Utility/Box';
4
7
  import { DotIndicator } from './DotIndicator';
5
8
 
@@ -18,7 +21,7 @@ const meta = {
18
21
  argTypes: {
19
22
  size: {
20
23
  control: 'radio',
21
- options: ['xs', 'sm', 'md'],
24
+ options: ['xs', 'sm', 'md', 'lg'],
22
25
  },
23
26
  appearance: {
24
27
  control: 'radio',
@@ -42,6 +45,7 @@ export const SizeShowcase: Story = {
42
45
  <DotIndicator size='xs' />
43
46
  <DotIndicator size='sm' />
44
47
  <DotIndicator size='md' />
48
+ <DotIndicator size='lg' />
45
49
  </Box>
46
50
  ),
47
51
  };
@@ -62,6 +66,12 @@ export const WithChildren: Story = {
62
66
  <DotIndicator appearance='red'>
63
67
  <Button size='sm'>Submit</Button>
64
68
  </DotIndicator>
69
+ <DotIndicator appearance='red'>
70
+ <Avatar size='md' />
71
+ </DotIndicator>
72
+ <DotIndicator appearance='red'>
73
+ <IconButton accessibilityLabel='Settings' icon={Settings} />
74
+ </DotIndicator>
65
75
  </Box>
66
76
  ),
67
77
  };
@@ -97,6 +97,16 @@ describe('DotIndicator', () => {
97
97
  expect(toJSON()).toBeTruthy();
98
98
  });
99
99
 
100
+ it('should render in lg size', () => {
101
+ const { toJSON } = render(
102
+ <TestWrapper>
103
+ <DotIndicator size='lg' />
104
+ </TestWrapper>,
105
+ );
106
+
107
+ expect(toJSON()).toBeTruthy();
108
+ });
109
+
100
110
  it('should render with red appearance', () => {
101
111
  const { toJSON } = render(
102
112
  <TestWrapper>
@@ -65,7 +65,8 @@ const useStyles = ({
65
65
  const sizeMap = {
66
66
  xs: t.sizes.s10,
67
67
  sm: t.sizes.s12,
68
- md: t.sizes.s16,
68
+ md: t.sizes.s14,
69
+ lg: t.sizes.s16,
69
70
  };
70
71
 
71
72
  const bgColorMap = {
@@ -6,7 +6,7 @@ export type DotIndicatorProps = {
6
6
  * The size of the dot indicator.
7
7
  * @default sm
8
8
  */
9
- size?: 'xs' | 'sm' | 'md';
9
+ size?: 'xs' | 'sm' | 'md' | 'lg';
10
10
  /**
11
11
  * The appearance of the dot indicator.
12
12
  * @default base