@ledgerhq/lumen-ui-rnative 0.0.46 → 0.0.48

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 (148) hide show
  1. package/dist/package.json +6 -2
  2. package/dist/src/lib/Components/Divider/Divider.d.ts +25 -0
  3. package/dist/src/lib/Components/Divider/Divider.d.ts.map +1 -0
  4. package/dist/src/lib/Components/Divider/Divider.js +40 -0
  5. package/dist/src/lib/Components/Divider/Divider.stories.d.ts +9 -0
  6. package/dist/src/lib/Components/Divider/Divider.stories.d.ts.map +1 -0
  7. package/dist/src/lib/Components/Divider/Divider.stories.js +51 -0
  8. package/dist/src/lib/Components/Divider/index.d.ts +3 -0
  9. package/dist/src/lib/Components/Divider/index.d.ts.map +1 -0
  10. package/dist/src/lib/Components/Divider/index.js +1 -0
  11. package/dist/src/lib/Components/Divider/types.d.ts +9 -0
  12. package/dist/src/lib/Components/Divider/types.d.ts.map +1 -0
  13. package/dist/src/lib/Components/Icon/Icon.d.ts.map +1 -1
  14. package/dist/src/lib/Components/Icon/Icon.js +3 -4
  15. package/dist/src/lib/Components/Icon/createIcon.d.ts.map +1 -1
  16. package/dist/src/lib/Components/Icon/createIcon.js +1 -1
  17. package/dist/src/lib/Components/ListItem/ListItem.d.ts +88 -34
  18. package/dist/src/lib/Components/ListItem/ListItem.d.ts.map +1 -1
  19. package/dist/src/lib/Components/ListItem/ListItem.js +248 -97
  20. package/dist/src/lib/Components/ListItem/ListItem.stories.d.ts +2 -3
  21. package/dist/src/lib/Components/ListItem/ListItem.stories.d.ts.map +1 -1
  22. package/dist/src/lib/Components/ListItem/ListItem.stories.js +63 -73
  23. package/dist/src/lib/Components/ListItem/index.d.ts +1 -1
  24. package/dist/src/lib/Components/ListItem/index.d.ts.map +1 -1
  25. package/dist/src/lib/Components/ListItem/index.js +1 -1
  26. package/dist/src/lib/Components/ListItem/types.d.ts +106 -0
  27. package/dist/src/lib/Components/ListItem/types.d.ts.map +1 -0
  28. package/dist/src/lib/Components/ListItem/types.js +1 -0
  29. package/dist/src/lib/Components/Select/GlobalSelectBottomSheet.d.ts.map +1 -1
  30. package/dist/src/lib/Components/Select/GlobalSelectBottomSheet.js +2 -7
  31. package/dist/src/lib/Components/Select/Select.d.ts.map +1 -1
  32. package/dist/src/lib/Components/Select/Select.js +4 -10
  33. package/dist/src/lib/Components/Select/types.d.ts.map +1 -1
  34. package/dist/src/lib/Components/Spot/types.d.ts +1 -1
  35. package/dist/src/lib/Components/Spot/types.d.ts.map +1 -1
  36. package/dist/src/lib/Components/Tile/Tile.d.ts +84 -19
  37. package/dist/src/lib/Components/Tile/Tile.d.ts.map +1 -1
  38. package/dist/src/lib/Components/Tile/Tile.figma.js +8 -18
  39. package/dist/src/lib/Components/Tile/Tile.js +160 -59
  40. package/dist/src/lib/Components/Tile/Tile.stories.d.ts +2 -2
  41. package/dist/src/lib/Components/Tile/Tile.stories.d.ts.map +1 -1
  42. package/dist/src/lib/Components/Tile/Tile.stories.js +30 -81
  43. package/dist/src/lib/Components/Tile/index.d.ts +1 -1
  44. package/dist/src/lib/Components/Tile/index.d.ts.map +1 -1
  45. package/dist/src/lib/Components/Tile/index.js +1 -1
  46. package/dist/src/lib/Components/Tile/types.d.ts +29 -19
  47. package/dist/src/lib/Components/Tile/types.d.ts.map +1 -1
  48. package/dist/src/lib/Components/index.d.ts +1 -0
  49. package/dist/src/lib/Components/index.d.ts.map +1 -1
  50. package/dist/src/lib/Components/index.js +1 -0
  51. package/dist/src/lib/utils/index.d.ts +3 -4
  52. package/dist/src/lib/utils/index.d.ts.map +1 -1
  53. package/dist/src/lib/utils/index.js +3 -4
  54. package/dist/src/lib/utils/react/{extract-text-from-children.d.ts → extractTextFromChildren.d.ts} +1 -1
  55. package/dist/src/lib/utils/react/extractTextFromChildren.d.ts.map +1 -0
  56. package/dist/src/lib/utils/react/index.d.ts +1 -1
  57. package/dist/src/lib/utils/react/index.d.ts.map +1 -1
  58. package/dist/src/lib/utils/react/index.js +1 -1
  59. package/dist/src/lib/utils/startTransition/index.d.ts +2 -0
  60. package/dist/src/lib/utils/startTransition/index.d.ts.map +1 -0
  61. package/dist/src/lib/utils/startTransition/index.js +1 -0
  62. package/dist/src/lib/utils/{start-transition/start-transition.d.ts → startTransition/startTransition.d.ts} +1 -1
  63. package/dist/src/lib/utils/startTransition/startTransition.d.ts.map +1 -0
  64. package/dist/src/lib/utils/useControllableState/index.d.ts +2 -0
  65. package/dist/src/lib/utils/useControllableState/index.d.ts.map +1 -0
  66. package/dist/src/lib/utils/useControllableState/index.js +1 -0
  67. package/dist/src/lib/utils/{use-controllable-state/use-controllable-state.d.ts → useControllableState/useControllableState.d.ts} +1 -1
  68. package/dist/src/lib/utils/useControllableState/useControllableState.d.ts.map +1 -0
  69. package/dist/src/lib/utils/{use-controllable-state/use-controllable-state.js → useControllableState/useControllableState.js} +2 -2
  70. package/dist/src/lib/utils/useEvent/index.d.ts +3 -0
  71. package/dist/src/lib/utils/useEvent/index.d.ts.map +1 -0
  72. package/dist/src/lib/utils/useEvent/index.js +2 -0
  73. package/dist/src/lib/utils/{use-event/use-event.d.ts → useEvent/useEvent.d.ts} +1 -1
  74. package/dist/src/lib/utils/useEvent/useEvent.d.ts.map +1 -0
  75. package/dist/src/lib/utils/{use-event/use-event.js → useEvent/useEvent.js} +1 -1
  76. package/dist/src/lib/utils/{use-event/use-get.d.ts → useEvent/useGet.d.ts} +1 -1
  77. package/dist/src/lib/utils/useEvent/useGet.d.ts.map +1 -0
  78. package/dist/src/styles/provider/LumenStyleSheetProvider.d.ts +1 -1
  79. package/dist/src/styles/provider/LumenStyleSheetProvider.d.ts.map +1 -1
  80. package/dist/src/styles/provider/LumenStyleSheetProvider.js +1 -2
  81. package/package.json +6 -2
  82. package/src/lib/Components/Checkbox/Checkbox.mdx +1 -0
  83. package/src/lib/Components/Divider/Divider.mdx +151 -0
  84. package/src/lib/Components/Divider/Divider.stories.tsx +140 -0
  85. package/src/lib/Components/Divider/Divider.test.tsx +92 -0
  86. package/src/lib/Components/Divider/Divider.tsx +52 -0
  87. package/src/lib/Components/Divider/index.ts +2 -0
  88. package/src/lib/Components/Divider/types.ts +9 -0
  89. package/src/lib/Components/Icon/Icon.tsx +3 -5
  90. package/src/lib/Components/Icon/createIcon.ts +1 -1
  91. package/src/lib/Components/ListItem/ListItem.mdx +402 -124
  92. package/src/lib/Components/ListItem/ListItem.stories.tsx +357 -228
  93. package/src/lib/Components/ListItem/ListItem.tsx +444 -181
  94. package/src/lib/Components/ListItem/index.ts +1 -1
  95. package/src/lib/Components/ListItem/types.ts +121 -0
  96. package/src/lib/Components/Select/GlobalSelectBottomSheet.tsx +5 -7
  97. package/src/lib/Components/Select/Select.tsx +4 -18
  98. package/src/lib/Components/Select/types.ts +1 -3
  99. package/src/lib/Components/Spot/types.ts +5 -1
  100. package/src/lib/Components/Switch/Switch.mdx +1 -0
  101. package/src/lib/Components/Tile/Tile.figma.tsx +24 -23
  102. package/src/lib/Components/Tile/Tile.mdx +128 -35
  103. package/src/lib/Components/Tile/Tile.stories.tsx +167 -146
  104. package/src/lib/Components/Tile/Tile.test.tsx +193 -221
  105. package/src/lib/Components/Tile/Tile.tsx +270 -123
  106. package/src/lib/Components/Tile/index.ts +7 -1
  107. package/src/lib/Components/Tile/types.ts +38 -19
  108. package/src/lib/Components/index.ts +1 -0
  109. package/src/lib/utils/index.ts +3 -4
  110. package/src/lib/utils/react/index.ts +1 -1
  111. package/src/lib/utils/startTransition/index.ts +1 -0
  112. package/src/lib/utils/useControllableState/index.ts +1 -0
  113. package/src/lib/utils/{use-controllable-state/use-controllable-state.ts → useControllableState/useControllableState.ts} +2 -2
  114. package/src/lib/utils/useEvent/index.ts +2 -0
  115. package/src/lib/utils/{use-event/use-event.ts → useEvent/useEvent.ts} +1 -1
  116. package/src/styles/provider/LumenStyleSheetProvider.tsx +2 -3
  117. package/dist/src/lib/Components/ListItem/ListItem.types.d.ts +0 -31
  118. package/dist/src/lib/Components/ListItem/ListItem.types.d.ts.map +0 -1
  119. package/dist/src/lib/utils/react/extract-text-from-children.d.ts.map +0 -1
  120. package/dist/src/lib/utils/start-transition/index.d.ts +0 -2
  121. package/dist/src/lib/utils/start-transition/index.d.ts.map +0 -1
  122. package/dist/src/lib/utils/start-transition/index.js +0 -1
  123. package/dist/src/lib/utils/start-transition/start-transition.d.ts.map +0 -1
  124. package/dist/src/lib/utils/string-utils.d.ts +0 -6
  125. package/dist/src/lib/utils/string-utils.d.ts.map +0 -1
  126. package/dist/src/lib/utils/string-utils.js +0 -12
  127. package/dist/src/lib/utils/use-controllable-state/index.d.ts +0 -2
  128. package/dist/src/lib/utils/use-controllable-state/index.d.ts.map +0 -1
  129. package/dist/src/lib/utils/use-controllable-state/index.js +0 -1
  130. package/dist/src/lib/utils/use-controllable-state/use-controllable-state.d.ts.map +0 -1
  131. package/dist/src/lib/utils/use-event/index.d.ts +0 -3
  132. package/dist/src/lib/utils/use-event/index.d.ts.map +0 -1
  133. package/dist/src/lib/utils/use-event/index.js +0 -2
  134. package/dist/src/lib/utils/use-event/use-event.d.ts.map +0 -1
  135. package/dist/src/lib/utils/use-event/use-get.d.ts.map +0 -1
  136. package/src/lib/Components/ListItem/ListItem.types.ts +0 -31
  137. package/src/lib/utils/start-transition/index.ts +0 -1
  138. package/src/lib/utils/string-utils.test.ts +0 -73
  139. package/src/lib/utils/string-utils.ts +0 -11
  140. package/src/lib/utils/use-controllable-state/index.ts +0 -1
  141. package/src/lib/utils/use-event/index.ts +0 -2
  142. /package/dist/src/lib/Components/{ListItem/ListItem.types.js → Divider/types.js} +0 -0
  143. /package/dist/src/lib/utils/react/{extract-text-from-children.js → extractTextFromChildren.js} +0 -0
  144. /package/dist/src/lib/utils/{start-transition/start-transition.js → startTransition/startTransition.js} +0 -0
  145. /package/dist/src/lib/utils/{use-event/use-get.js → useEvent/useGet.js} +0 -0
  146. /package/src/lib/utils/react/{extract-text-from-children.ts → extractTextFromChildren.ts} +0 -0
  147. /package/src/lib/utils/{start-transition/start-transition.ts → startTransition/startTransition.ts} +0 -0
  148. /package/src/lib/utils/{use-event/use-get.ts → useEvent/useGet.ts} +0 -0
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-rnative",
3
- "version": "0.0.45",
3
+ "version": "0.0.47",
4
4
  "license": "Apache-2.0",
5
5
  "keywords": [
6
6
  "react-native",
@@ -27,13 +27,17 @@
27
27
  "./styles": "./src/styles/index.ts"
28
28
  },
29
29
  "dependencies": {
30
- "@ledgerhq/lumen-utils-shared": "0.0.12",
30
+ "@ledgerhq/lumen-utils-shared": "0.0.13",
31
31
  "i18next": "^23.7.0",
32
32
  "react-i18next": "^14.0.0"
33
33
  },
34
34
  "peerDependencies": {
35
+ "@gorhom/bottom-sheet": "^5.0.0",
36
+ "@ledgerhq/lumen-design-core": "0.0.37",
35
37
  "react": "~18.3.1",
36
38
  "react-native": "~0.77.3",
39
+ "react-native-reanimated": "^3.0.0",
40
+ "react-native-safe-area-context": "^4.0.0 || ^5.0.0",
37
41
  "react-native-svg": "^15.0.0"
38
42
  },
39
43
  "nx": {
@@ -0,0 +1,25 @@
1
+ import { View } from 'react-native';
2
+ /**
3
+ * A simple divider component for separating content sections.
4
+ *
5
+ * The Divider renders a horizontal or vertical line to create visual separation
6
+ * between content areas. It uses design system tokens for consistent styling.
7
+ *
8
+ * @see {@link https://ldls.vercel.app/?path=/docs/layout-divider--docs Storybook}
9
+ *
10
+ * @example
11
+ * // Horizontal divider (default)
12
+ * <Divider />
13
+ *
14
+ * @example
15
+ * // Vertical divider
16
+ * <Divider orientation="vertical" />
17
+ *
18
+ * @example
19
+ * // With custom styling using lx props
20
+ * <Divider lx={{ marginVertical: 's16' }} />
21
+ */
22
+ export declare const Divider: import("react").ForwardRefExoticComponent<{
23
+ orientation?: "horizontal" | "vertical";
24
+ } & Omit<import("../../../styles").StyledViewProps, "children"> & import("react").RefAttributes<View>>;
25
+ //# sourceMappingURL=Divider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Divider/Divider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAIpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,OAAO;;sGAwBnB,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ import { Box } from '../Utility';
4
+ /**
5
+ * A simple divider component for separating content sections.
6
+ *
7
+ * The Divider renders a horizontal or vertical line to create visual separation
8
+ * between content areas. It uses design system tokens for consistent styling.
9
+ *
10
+ * @see {@link https://ldls.vercel.app/?path=/docs/layout-divider--docs Storybook}
11
+ *
12
+ * @example
13
+ * // Horizontal divider (default)
14
+ * <Divider />
15
+ *
16
+ * @example
17
+ * // Vertical divider
18
+ * <Divider orientation="vertical" />
19
+ *
20
+ * @example
21
+ * // With custom styling using lx props
22
+ * <Divider lx={{ marginVertical: 's16' }} />
23
+ */
24
+ export const Divider = forwardRef(({ lx = {}, orientation = 'horizontal', ...props }, ref) => {
25
+ return (_jsx(Box, { ref: ref, accessibilityRole: 'none', lx: {
26
+ ...(orientation === 'horizontal'
27
+ ? {
28
+ alignSelf: 'stretch',
29
+ borderTopWidth: 's1',
30
+ borderTopColor: 'mutedSubtle',
31
+ }
32
+ : {
33
+ alignSelf: 'stretch',
34
+ borderLeftWidth: 's1',
35
+ borderLeftColor: 'mutedSubtle',
36
+ }),
37
+ ...lx,
38
+ }, ...props }));
39
+ });
40
+ Divider.displayName = 'Divider';
@@ -0,0 +1,9 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
2
+ import { Divider } from './Divider';
3
+ declare const meta: Meta<typeof Divider>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Divider>;
6
+ export declare const Base: Story;
7
+ export declare const OrientationShowcase: Story;
8
+ export declare const InList: Story;
9
+ //# sourceMappingURL=Divider.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Divider.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Divider/Divider.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CAM9B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,OAAO,CAAC,CAAC;AAEtC,eAAO,MAAM,IAAI,EAAE,KAwBlB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAkCjC,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KA6DpB,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box } from '../Utility/Box';
3
+ import { Text } from '../Utility/Text';
4
+ import { Divider } from './Divider';
5
+ const meta = {
6
+ component: Divider,
7
+ title: 'Layout/Divider',
8
+ parameters: {
9
+ actions: { disable: true },
10
+ },
11
+ };
12
+ export default meta;
13
+ export const Base = {
14
+ args: {
15
+ orientation: 'horizontal',
16
+ },
17
+ render: (args) => {
18
+ const isVertical = args.orientation === 'vertical';
19
+ return (_jsxs(Box, { lx: isVertical
20
+ ? { flexDirection: 'row', alignItems: 'center', gap: 's16' }
21
+ : { width: 'full', gap: 's16' }, children: [_jsx(Text, { typography: 'body2', lx: { color: 'base' }, children: isVertical ? 'Left content' : 'Content above' }), _jsx(Divider, { ...args, lx: isVertical ? { height: 's48' } : undefined }), _jsx(Text, { typography: 'body2', lx: { color: 'base' }, children: isVertical ? 'Right content' : 'Content below' })] }));
22
+ },
23
+ };
24
+ export const OrientationShowcase = {
25
+ render: () => (_jsxs(Box, { lx: { gap: 's32' }, children: [_jsxs(Box, { lx: { gap: 's8' }, children: [_jsx(Text, { typography: 'body3', lx: { color: 'muted' }, children: "Horizontal (default)" }), _jsxs(Box, { lx: { width: 'full', gap: 's16' }, children: [_jsx(Text, { typography: 'body2', lx: { color: 'base' }, children: "Content above" }), _jsx(Divider, { orientation: 'horizontal' }), _jsx(Text, { typography: 'body2', lx: { color: 'base' }, children: "Content below" })] })] }), _jsxs(Box, { lx: { gap: 's8' }, children: [_jsx(Text, { typography: 'body3', lx: { color: 'muted' }, children: "Vertical" }), _jsxs(Box, { lx: { flexDirection: 'row', alignItems: 'center', gap: 's16' }, children: [_jsx(Text, { typography: 'body2', lx: { color: 'base' }, children: "Left content" }), _jsx(Divider, { orientation: 'vertical', lx: { height: 's48' } }), _jsx(Text, { typography: 'body2', lx: { color: 'base' }, children: "Right content" })] })] })] })),
26
+ };
27
+ export const InList = {
28
+ render: () => (_jsxs(Box, { lx: {
29
+ width: 'full',
30
+ maxWidth: 's400',
31
+ backgroundColor: 'canvas',
32
+ borderRadius: 'lg',
33
+ borderWidth: 's1',
34
+ borderColor: 'muted',
35
+ }, children: [_jsxs(Box, { lx: {
36
+ flexDirection: 'row',
37
+ justifyContent: 'space-between',
38
+ alignItems: 'center',
39
+ padding: 's16',
40
+ }, children: [_jsx(Text, { typography: 'body2', lx: { color: 'base' }, children: "Item 1" }), _jsx(Text, { typography: 'body3', lx: { color: 'muted' }, children: "$100" })] }), _jsx(Divider, {}), _jsxs(Box, { lx: {
41
+ flexDirection: 'row',
42
+ justifyContent: 'space-between',
43
+ alignItems: 'center',
44
+ padding: 's16',
45
+ }, children: [_jsx(Text, { typography: 'body2', lx: { color: 'base' }, children: "Item 2" }), _jsx(Text, { typography: 'body3', lx: { color: 'muted' }, children: "$200" })] }), _jsx(Divider, {}), _jsxs(Box, { lx: {
46
+ flexDirection: 'row',
47
+ justifyContent: 'space-between',
48
+ alignItems: 'center',
49
+ padding: 's16',
50
+ }, children: [_jsx(Text, { typography: 'body2', lx: { color: 'base' }, children: "Item 3" }), _jsx(Text, { typography: 'body3', lx: { color: 'muted' }, children: "$300" })] })] })),
51
+ };
@@ -0,0 +1,3 @@
1
+ export { Divider } from './Divider';
2
+ export type { DividerProps } from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Divider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1 @@
1
+ export { Divider } from './Divider';
@@ -0,0 +1,9 @@
1
+ import { BoxProps } from '../Utility';
2
+ export type DividerProps = {
3
+ /**
4
+ * The orientation of the divider
5
+ * @default 'horizontal'
6
+ */
7
+ orientation?: 'horizontal' | 'vertical';
8
+ } & Omit<BoxProps, 'children'>;
9
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Divider/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,MAAM,YAAY,GAAG;IACzB;;;OAGG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACzC,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Icon/Icon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAGvC,OAAO,EAAa,QAAQ,EAAE,MAAM,SAAS,CAAC;AAmC9C,eAAO,MAAM,IAAI;;;;;;uBAHsB,8DAGxB;+HAoBd,CAAC"}
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Icon/Icon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAGvC,OAAO,EAAa,QAAQ,EAAE,MAAM,SAAS,CAAC;AAiC9C,eAAO,MAAM,IAAI;;;;;;uBACM,8DAAoC;+HAmB1D,CAAC"}
@@ -13,8 +13,7 @@ const iconSizeMap = {
13
13
  };
14
14
  const useStyles = (lx, size, color) => {
15
15
  const { theme } = useTheme();
16
- const resolvedStyle = useResolveTextStyle(lx || {});
17
- const resolvedColor = useResolveTextStyle({ color });
16
+ const resolvedStyle = useResolveTextStyle({ ...(lx || {}), color });
18
17
  return useMemo(() => {
19
18
  return {
20
19
  container: {
@@ -23,9 +22,9 @@ const useStyles = (lx, size, color) => {
23
22
  height: theme.icon.height[iconSizeMap[size]],
24
23
  strokeWidth: theme.icon.borderWidth[iconSizeMap[size]],
25
24
  },
26
- color: resolvedColor.color || resolvedStyle.color || theme.colors.text.base,
25
+ color: resolvedStyle.color || theme.colors.text.base,
27
26
  };
28
- }, [size, theme, resolvedStyle, resolvedColor.color]);
27
+ }, [size, theme, resolvedStyle]);
29
28
  };
30
29
  export const Icon = forwardRef(({ size = 24, color, lx = {}, children, viewBox, ...props }, ref) => {
31
30
  const styles = useStyles(lx, size, color);
@@ -1 +1 @@
1
- {"version":3,"file":"createIcon.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Icon/createIcon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC;;;;;GAKG;AACH,QAAA,MAAM,UAAU,GACd,UAAU,MAAM,EAChB,SAAS,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,4FAetC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"createIcon.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Icon/createIcon.ts"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC;;;;;GAKG;AACH,QAAA,MAAM,UAAU,GACd,UAAU,MAAM,EAChB,SAAS,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,4FAetC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,5 +1,5 @@
1
+ import { toPascalCase } from '@ledgerhq/lumen-utils-shared';
1
2
  import React, { forwardRef } from 'react';
2
- import { toPascalCase } from '../../utils';
3
3
  import { Icon } from './Icon';
4
4
  /**
5
5
  * Create an Icon component for React Native
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import { View } from 'react-native';
3
+ import { ListItemIconProps, ListItemSpotProps } from './types';
3
4
  /**
4
- * A flexible list item component that displays a required title and optional description (with possible tag), leading and trailing content.
5
- * It functions as a clickable button with hover and active states.
5
+ * A flexible list item component that provides a composable structure for displaying
6
+ * interactive list items with leading content, title, description, and trailing content.
6
7
  *
7
8
  * @see {@link https://ldls.vercel.app/?path=/docs/react-native_containment-listitem--docs Storybook}
8
9
  * @see {@link https://ldls.vercel.app/?path=/docs/react-native_containment-listitem--docs#dos-and-donts Guidelines}
@@ -11,40 +12,93 @@ import { View } from 'react-native';
11
12
  * Do not use it to modify the list item's core appearance (colors, padding, etc).
12
13
  *
13
14
  * @example
14
- * // Basic item
15
- * import { ListItem } from '@ledgerhq/lumen-ui-rnative';
15
+ * import {
16
+ * ListItem,
17
+ * ListItemLeading,
18
+ * ListItemSpot,
19
+ * ListItemContent,
20
+ * ListItemTitle,
21
+ * ListItemDescription,
22
+ * ListItemTrailing,
23
+ * } from '@ledgerhq/lumen-ui-rnative';
24
+ * import { Wallet, ChevronRight } from '@ledgerhq/lumen-ui-rnative/symbols';
16
25
  *
17
- * <ListItem
18
- * title="Basic Item"
19
- * description="Optional description"
20
- * onPress={() => console.log('Clicked!')}
21
- * />
22
- *
23
- * // Icon trailing content with leading Spot
24
- * import { ListItem, Spot } from '@ledgerhq/lumen-ui-rnative';
25
- * import { Wallet, Settings } from '@ledgerhq/lumen-ui-rnative/symbols';
26
- *
27
- * <ListItem
28
- * title="Balance"
29
- * leadingContent={<Spot appearance="icon" icon={Wallet} />}
30
- * trailingContent={<Settings />}
31
- * />
32
- *
33
- * // Chevron trailing content
34
- * import { ListItem } from '@ledgerhq/lumen-ui-rnative';
35
- * import { ChevronRight } from '@ledgerhq/lumen-ui-rnative/symbols';
36
- *
37
- * <ListItem
38
- * title="Settings"
39
- * trailingContent={<ChevronRight size={24} />}
40
- * />
26
+ * <ListItem onPress={() => console.log('Clicked!')}>
27
+ * <ListItemLeading>
28
+ * <ListItemSpot appearance="icon" icon={Wallet} />
29
+ * <ListItemContent>
30
+ * <ListItemTitle>Balance</ListItemTitle>
31
+ * <ListItemDescription>Optional description</ListItemDescription>
32
+ * </ListItemContent>
33
+ * </ListItemLeading>
34
+ * <ListItemTrailing>
35
+ * <ChevronRight size={24} />
36
+ * </ListItemTrailing>
37
+ * </ListItem>
41
38
  */
42
39
  export declare const ListItem: React.ForwardRefExoticComponent<{
43
- title: string;
44
- description?: string;
45
- leadingContent?: React.ReactNode;
46
- descriptionTag?: React.ReactNode;
47
- trailingContent?: React.ReactNode;
40
+ children: React.ReactNode;
48
41
  disabled?: boolean;
49
- } & Omit<import("../../../styles").StyledPressableProps, "disabled"> & React.RefAttributes<View>>;
42
+ onPress?: import("../../../styles").StyledPressableProps["onPress"];
43
+ } & Omit<import("../../../styles").StyledPressableProps, "children" | "disabled"> & React.RefAttributes<View>>;
44
+ /**
45
+ * Container for the leading (left) part of the list item.
46
+ * Contains the visual element (ListItemSpot, Avatar, Icon) and the content (title + description).
47
+ */
48
+ export declare const ListItemLeading: React.ForwardRefExoticComponent<{
49
+ children: React.ReactNode;
50
+ } & Omit<import("../../../styles").StyledViewProps, "children"> & React.RefAttributes<View>>;
51
+ /**
52
+ * Container for the text content (title and description) within the leading area.
53
+ */
54
+ export declare const ListItemContent: React.ForwardRefExoticComponent<{
55
+ children: React.ReactNode;
56
+ } & Omit<import("../../../styles").StyledViewProps, "children"> & React.RefAttributes<View>>;
57
+ /**
58
+ * The main title of the list item. Can contain text directly or
59
+ * ListItemTruncate + Tag for more complex layouts.
60
+ */
61
+ export declare const ListItemTitle: React.ForwardRefExoticComponent<{
62
+ children: React.ReactNode;
63
+ } & Omit<import("../../../styles").StyledTextProps, "children"> & React.RefAttributes<View>>;
64
+ /**
65
+ * Optional description below the title. Can contain text directly or
66
+ * ListItemTruncate + Tag for more complex layouts.
67
+ * Automatically applies disabled styling when the parent ListItem is disabled.
68
+ */
69
+ export declare const ListItemDescription: React.ForwardRefExoticComponent<{
70
+ children: React.ReactNode;
71
+ } & Omit<import("../../../styles").StyledTextProps, "children"> & React.RefAttributes<View>>;
72
+ /**
73
+ * Container for the trailing (right) content of the list item.
74
+ * Used for icons, switches, values, tags, chevrons, etc.
75
+ */
76
+ export declare const ListItemTrailing: React.ForwardRefExoticComponent<{
77
+ children: React.ReactNode;
78
+ } & Omit<import("../../../styles").StyledViewProps, "children"> & React.RefAttributes<View>>;
79
+ /**
80
+ * Spot adapter for ListItem. Automatically inherits disabled state from parent ListItem.
81
+ * Fixed at size 48 for consistent list item appearance.
82
+ */
83
+ export declare const ListItemSpot: {
84
+ (props: ListItemSpotProps): import("react/jsx-runtime").JSX.Element;
85
+ displayName: string;
86
+ };
87
+ /**
88
+ * Icon adapter for ListItem. Automatically inherits disabled state from parent ListItem.
89
+ * Fixed at size 24 for consistent list item appearance.
90
+ */
91
+ export declare const ListItemIcon: {
92
+ ({ icon: Icon, color, lx, style, ...viewProps }: ListItemIconProps): import("react/jsx-runtime").JSX.Element;
93
+ displayName: string;
94
+ };
95
+ /**
96
+ * Text wrapper that truncates when space is limited.
97
+ * Use inside ListItemTitle or ListItemDescription when combining text with a Tag.
98
+ * Set variant='title' for title styling or variant='description' (default) for description styling.
99
+ */
100
+ export declare const ListItemTruncate: React.ForwardRefExoticComponent<{
101
+ children: string;
102
+ variant?: "title" | "description";
103
+ } & Omit<import("../../../styles").StyledTextProps, "children"> & React.RefAttributes<import("react-native").Text>>;
50
104
  //# sourceMappingURL=ListItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/ListItem/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAoB,IAAI,EAAE,MAAM,cAAc,CAAC;AAsFtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,QAAQ;;;;;;;iGA0CpB,CAAC"}
1
+ {"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/ListItem/ListItem.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAc,IAAI,EAAE,MAAM,cAAc,CAAC;AAIhD,OAAO,EAIL,iBAAiB,EAGjB,iBAAiB,EAIlB,MAAM,SAAS,CAAC;AAkCjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,QAAQ;;;;8GAqBnB,CAAC;AAsBH;;;GAGG;AACH,eAAO,MAAM,eAAe;;4FA0B3B,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,eAAe;;4FA8B3B,CAAC;AAIF;;;GAGG;AACH,eAAO,MAAM,aAAa;;4FAiEzB,CAAC;AAIF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;4FAkE9B,CAAC;AAIH;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;4FA0B5B,CAAC;AAIF;;;GAGG;AACH,eAAO,MAAM,YAAY;YAAW,iBAAiB;;CAOpD,CAAC;AAIF;;;GAGG;AACH,eAAO,MAAM,YAAY;qDAMtB,iBAAiB;;CAuBnB,CAAC;AAIF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;mHA8C5B,CAAC"}