@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
@@ -0,0 +1,151 @@
1
+ import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks';
2
+ import * as DividerStories from './Divider.stories';
3
+ import { Divider } from './Divider';
4
+ import {
5
+ CustomTabs,
6
+ Tab,
7
+ } from '../../../../.storybook/components';
8
+ import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
9
+
10
+ <Meta title='Layout/Divider' of={DividerStories} />
11
+
12
+ # ➖ Divider
13
+
14
+ <CustomTabs>
15
+ <Tab label="Overview ">
16
+
17
+ ## Introduction
18
+
19
+ The Divider component provides a simple, semantic way to visually separate content sections in your interface. It creates a horizontal or vertical line that helps organize information and improve content hierarchy.
20
+
21
+ > View in [Figma](https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7/2.-Components-Library?node-id=285-5969&m=dev).
22
+
23
+ > ⚠️ **Note on Web Preview:** The Storybook preview below may display visual inconsistencies as certain React Native APIs cannot be fully translated to web environments. For the complete native experience, please refer to the component on an actual iOS or Android device.
24
+
25
+ ## Anatomy
26
+
27
+ <Canvas of={DividerStories.Base} />
28
+
29
+ The Divider is a simple component consisting of a single line that uses design system tokens for consistent styling.
30
+
31
+ ## Properties
32
+
33
+ ### Overview
34
+
35
+ <Canvas of={DividerStories.Base} />
36
+ <Controls of={DividerStories.Base} />
37
+
38
+ ### Orientation
39
+
40
+ Dividers support both horizontal and vertical orientations to accommodate different layout needs:
41
+
42
+ - `horizontal` (default): Creates a horizontal line spanning the full width of its container
43
+ - `vertical`: Creates a vertical line with a height determined by its container or custom styling via `lx` props
44
+
45
+ <Canvas of={DividerStories.OrientationShowcase} />
46
+
47
+ ## Usage Examples
48
+
49
+ ### In Lists
50
+
51
+ A common use case is separating list items or sections within a card:
52
+
53
+ <Canvas of={DividerStories.InList} />
54
+
55
+ ## Responsive Layout
56
+
57
+ Dividers automatically adapt to their container's dimensions. For horizontal dividers, they span the full width. For vertical dividers, set an explicit height using the `lx` prop.
58
+
59
+ ## Accessibility
60
+
61
+ The Divider component uses `accessibilityRole='none'` as it's purely decorative and doesn't require accessibility announcements.
62
+
63
+ </Tab>
64
+
65
+ <Tab label="Implementation">
66
+
67
+ ## Installation
68
+
69
+ ```bash
70
+ npm install @ledgerhq/lumen-ui-rnative
71
+ ```
72
+
73
+ > **Note**: `@ledgerhq/lumen-design-core` and other peer dependencies (`react-native`, etc.) are required. See our Setup Guide for complete installation.
74
+
75
+ ## Basic Usage
76
+
77
+ ```tsx
78
+ import { Divider } from '@ledgerhq/lumen-ui-rnative';
79
+
80
+ function MyComponent() {
81
+ return (
82
+ <Box>
83
+ <Text>Content above the divider</Text>
84
+ <Divider />
85
+ <Text>Content below the divider</Text>
86
+ </Box>
87
+ );
88
+ }
89
+ ```
90
+
91
+ ### Vertical Divider
92
+
93
+ For vertical separation between content:
94
+
95
+ ```tsx
96
+ import { Divider, Box, Text } from '@ledgerhq/lumen-ui-rnative';
97
+
98
+ function MyComponent() {
99
+ return (
100
+ <Box lx={{ flexDirection: 'row', alignItems: 'center', gap: 's16' }}>
101
+ <Text>Left content</Text>
102
+ <Divider orientation='vertical' lx={{ height: 's48' }} />
103
+ <Text>Right content</Text>
104
+ </Box>
105
+ );
106
+ }
107
+ ```
108
+
109
+ Note: For vertical dividers, you typically need to set an explicit height using the `lx` prop.
110
+
111
+ ### In List Components
112
+
113
+ Dividers are perfect for separating items in lists, menus, or cards:
114
+
115
+ ```tsx
116
+ import { Divider, Box, Text } from '@ledgerhq/lumen-ui-rnative';
117
+
118
+ function MyList() {
119
+ return (
120
+ <Box
121
+ lx={{
122
+ borderRadius: 'lg',
123
+ borderWidth: 's1',
124
+ borderColor: 'muted',
125
+ }}
126
+ >
127
+ <Box lx={{ padding: 's16' }}>
128
+ <Text>Item 1</Text>
129
+ </Box>
130
+ <Divider />
131
+ <Box lx={{ padding: 's16' }}>
132
+ <Text>Item 2</Text>
133
+ </Box>
134
+ <Divider />
135
+ <Box lx={{ padding: 's16' }}>
136
+ <Text>Item 3</Text>
137
+ </Box>
138
+ </Box>
139
+ );
140
+ }
141
+ ```
142
+
143
+ <CommonRulesDoAndDont />
144
+
145
+ ## Performance Considerations
146
+
147
+ The Divider component is extremely lightweight with minimal performance impact. It renders a simple `Box` component with border styling, making it suitable for use in FlatLists and ScrollViews with many items.
148
+
149
+ </Tab>
150
+ </CustomTabs>
151
+
@@ -0,0 +1,140 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
2
+ import { Box } from '../Utility/Box';
3
+ import { Text } from '../Utility/Text';
4
+ import { Divider } from './Divider';
5
+
6
+ const meta: Meta<typeof Divider> = {
7
+ component: Divider,
8
+ title: 'Layout/Divider',
9
+ parameters: {
10
+ actions: { disable: true },
11
+ },
12
+ };
13
+
14
+ export default meta;
15
+ type Story = StoryObj<typeof Divider>;
16
+
17
+ export const Base: Story = {
18
+ args: {
19
+ orientation: 'horizontal',
20
+ },
21
+ render: (args) => {
22
+ const isVertical = args.orientation === 'vertical';
23
+ return (
24
+ <Box
25
+ lx={
26
+ isVertical
27
+ ? { flexDirection: 'row', alignItems: 'center', gap: 's16' }
28
+ : { width: 'full', gap: 's16' }
29
+ }
30
+ >
31
+ <Text typography='body2' lx={{ color: 'base' }}>
32
+ {isVertical ? 'Left content' : 'Content above'}
33
+ </Text>
34
+ <Divider {...args} lx={isVertical ? { height: 's48' } : undefined} />
35
+ <Text typography='body2' lx={{ color: 'base' }}>
36
+ {isVertical ? 'Right content' : 'Content below'}
37
+ </Text>
38
+ </Box>
39
+ );
40
+ },
41
+ };
42
+
43
+ export const OrientationShowcase: Story = {
44
+ render: () => (
45
+ <Box lx={{ gap: 's32' }}>
46
+ <Box lx={{ gap: 's8' }}>
47
+ <Text typography='body3' lx={{ color: 'muted' }}>
48
+ Horizontal (default)
49
+ </Text>
50
+ <Box lx={{ width: 'full', gap: 's16' }}>
51
+ <Text typography='body2' lx={{ color: 'base' }}>
52
+ Content above
53
+ </Text>
54
+ <Divider orientation='horizontal' />
55
+ <Text typography='body2' lx={{ color: 'base' }}>
56
+ Content below
57
+ </Text>
58
+ </Box>
59
+ </Box>
60
+
61
+ <Box lx={{ gap: 's8' }}>
62
+ <Text typography='body3' lx={{ color: 'muted' }}>
63
+ Vertical
64
+ </Text>
65
+ <Box lx={{ flexDirection: 'row', alignItems: 'center', gap: 's16' }}>
66
+ <Text typography='body2' lx={{ color: 'base' }}>
67
+ Left content
68
+ </Text>
69
+ <Divider orientation='vertical' lx={{ height: 's48' }} />
70
+ <Text typography='body2' lx={{ color: 'base' }}>
71
+ Right content
72
+ </Text>
73
+ </Box>
74
+ </Box>
75
+ </Box>
76
+ ),
77
+ };
78
+
79
+ export const InList: Story = {
80
+ render: () => (
81
+ <Box
82
+ lx={{
83
+ width: 'full',
84
+ maxWidth: 's400',
85
+ backgroundColor: 'canvas',
86
+ borderRadius: 'lg',
87
+ borderWidth: 's1',
88
+ borderColor: 'muted',
89
+ }}
90
+ >
91
+ <Box
92
+ lx={{
93
+ flexDirection: 'row',
94
+ justifyContent: 'space-between',
95
+ alignItems: 'center',
96
+ padding: 's16',
97
+ }}
98
+ >
99
+ <Text typography='body2' lx={{ color: 'base' }}>
100
+ Item 1
101
+ </Text>
102
+ <Text typography='body3' lx={{ color: 'muted' }}>
103
+ $100
104
+ </Text>
105
+ </Box>
106
+ <Divider />
107
+ <Box
108
+ lx={{
109
+ flexDirection: 'row',
110
+ justifyContent: 'space-between',
111
+ alignItems: 'center',
112
+ padding: 's16',
113
+ }}
114
+ >
115
+ <Text typography='body2' lx={{ color: 'base' }}>
116
+ Item 2
117
+ </Text>
118
+ <Text typography='body3' lx={{ color: 'muted' }}>
119
+ $200
120
+ </Text>
121
+ </Box>
122
+ <Divider />
123
+ <Box
124
+ lx={{
125
+ flexDirection: 'row',
126
+ justifyContent: 'space-between',
127
+ alignItems: 'center',
128
+ padding: 's16',
129
+ }}
130
+ >
131
+ <Text typography='body2' lx={{ color: 'base' }}>
132
+ Item 3
133
+ </Text>
134
+ <Text typography='body3' lx={{ color: 'muted' }}>
135
+ $300
136
+ </Text>
137
+ </Box>
138
+ </Box>
139
+ ),
140
+ };
@@ -0,0 +1,92 @@
1
+ import { describe, it, expect } from '@jest/globals';
2
+ import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
3
+ import { render } from '@testing-library/react-native';
4
+ import React from 'react';
5
+ import { ThemeProvider } from '../ThemeProvider/ThemeProvider';
6
+ import { Divider } from './Divider';
7
+
8
+ const { colors } = ledgerLiveThemes.dark;
9
+
10
+ const TestWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => (
11
+ <ThemeProvider themes={ledgerLiveThemes} colorScheme='dark' locale='en'>
12
+ {children}
13
+ </ThemeProvider>
14
+ );
15
+
16
+ describe('Divider Component', () => {
17
+ it('should render with horizontal orientation by default', () => {
18
+ const { getByTestId } = render(
19
+ <TestWrapper>
20
+ <Divider testID='divider' />
21
+ </TestWrapper>,
22
+ );
23
+ const divider = getByTestId('divider');
24
+ expect(divider).toBeTruthy();
25
+ const style = divider.props.style;
26
+ // Style might be an array or object after flattening
27
+ const flatStyle = Array.isArray(style)
28
+ ? Object.assign({}, ...style)
29
+ : style;
30
+ expect(flatStyle.borderTopWidth).toBe(1);
31
+ expect(flatStyle.borderTopColor).toBe(colors.border.mutedSubtle);
32
+ });
33
+
34
+ it('should render with vertical orientation', () => {
35
+ const { getByTestId } = render(
36
+ <TestWrapper>
37
+ <Divider testID='divider' orientation='vertical' />
38
+ </TestWrapper>,
39
+ );
40
+ const divider = getByTestId('divider');
41
+ const style = divider.props.style;
42
+ // Style might be an array or object after flattening
43
+ const flatStyle = Array.isArray(style)
44
+ ? Object.assign({}, ...style)
45
+ : style;
46
+ expect(flatStyle.borderLeftWidth).toBe(1);
47
+ expect(flatStyle.borderLeftColor).toBe(colors.border.mutedSubtle);
48
+ });
49
+
50
+ it('should apply custom lx props', () => {
51
+ const { getByTestId } = render(
52
+ <TestWrapper>
53
+ <Divider testID='divider' lx={{ marginVertical: 's16' }} />
54
+ </TestWrapper>,
55
+ );
56
+ const divider = getByTestId('divider');
57
+ const style = divider.props.style;
58
+ const flatStyle = Array.isArray(style)
59
+ ? Object.assign({}, ...style)
60
+ : style;
61
+ expect(flatStyle.marginVertical).toBe(16);
62
+ });
63
+
64
+ it('should pass through additional props', () => {
65
+ const { getByTestId } = render(
66
+ <TestWrapper>
67
+ <Divider testID='custom-divider' />
68
+ </TestWrapper>,
69
+ );
70
+ const divider = getByTestId('custom-divider');
71
+ expect(divider).toBeTruthy();
72
+ });
73
+
74
+ it('should handle style merging with lx props', () => {
75
+ const { getByTestId } = render(
76
+ <TestWrapper>
77
+ <Divider
78
+ testID='divider'
79
+ lx={{ marginTop: 's8' }}
80
+ style={{ opacity: 0.5 }}
81
+ />
82
+ </TestWrapper>,
83
+ );
84
+ const divider = getByTestId('divider');
85
+ const style = divider.props.style;
86
+ const flatStyle = Array.isArray(style)
87
+ ? Object.assign({}, ...style)
88
+ : style;
89
+ expect(flatStyle.marginTop).toBe(8);
90
+ expect(flatStyle.opacity).toBe(0.5);
91
+ });
92
+ });
@@ -0,0 +1,52 @@
1
+ import { forwardRef } from 'react';
2
+ import { View } from 'react-native';
3
+ import { Box } from '../Utility';
4
+ import { DividerProps } from './types';
5
+
6
+ /**
7
+ * A simple divider component for separating content sections.
8
+ *
9
+ * The Divider renders a horizontal or vertical line to create visual separation
10
+ * between content areas. It uses design system tokens for consistent styling.
11
+ *
12
+ * @see {@link https://ldls.vercel.app/?path=/docs/layout-divider--docs Storybook}
13
+ *
14
+ * @example
15
+ * // Horizontal divider (default)
16
+ * <Divider />
17
+ *
18
+ * @example
19
+ * // Vertical divider
20
+ * <Divider orientation="vertical" />
21
+ *
22
+ * @example
23
+ * // With custom styling using lx props
24
+ * <Divider lx={{ marginVertical: 's16' }} />
25
+ */
26
+ export const Divider = forwardRef<View, DividerProps>(
27
+ ({ lx = {}, orientation = 'horizontal', ...props }, ref) => {
28
+ return (
29
+ <Box
30
+ ref={ref}
31
+ accessibilityRole='none'
32
+ lx={{
33
+ ...(orientation === 'horizontal'
34
+ ? {
35
+ alignSelf: 'stretch',
36
+ borderTopWidth: 's1',
37
+ borderTopColor: 'mutedSubtle',
38
+ }
39
+ : {
40
+ alignSelf: 'stretch',
41
+ borderLeftWidth: 's1',
42
+ borderLeftColor: 'mutedSubtle',
43
+ }),
44
+ ...lx,
45
+ }}
46
+ {...props}
47
+ />
48
+ );
49
+ },
50
+ );
51
+
52
+ Divider.displayName = 'Divider';
@@ -0,0 +1,2 @@
1
+ export { Divider } from './Divider';
2
+ export type { DividerProps } from './types';
@@ -0,0 +1,9 @@
1
+ import { BoxProps } from '../Utility';
2
+
3
+ export type DividerProps = {
4
+ /**
5
+ * The orientation of the divider
6
+ * @default 'horizontal'
7
+ */
8
+ orientation?: 'horizontal' | 'vertical';
9
+ } & Omit<BoxProps, 'children'>;
@@ -20,8 +20,7 @@ const useStyles = (
20
20
  color: IconProps['color'],
21
21
  ) => {
22
22
  const { theme } = useTheme();
23
- const resolvedStyle = useResolveTextStyle(lx || {});
24
- const resolvedColor = useResolveTextStyle({ color });
23
+ const resolvedStyle = useResolveTextStyle({ ...(lx || {}), color });
25
24
 
26
25
  return useMemo(() => {
27
26
  return {
@@ -31,10 +30,9 @@ const useStyles = (
31
30
  height: theme.icon.height[iconSizeMap[size]],
32
31
  strokeWidth: theme.icon.borderWidth[iconSizeMap[size]],
33
32
  },
34
- color:
35
- resolvedColor.color || resolvedStyle.color || theme.colors.text.base,
33
+ color: resolvedStyle.color || theme.colors.text.base,
36
34
  };
37
- }, [size, theme, resolvedStyle, resolvedColor.color]);
35
+ }, [size, theme, resolvedStyle]);
38
36
  };
39
37
 
40
38
  export const Icon = forwardRef<Svg, IconProps>(
@@ -1,6 +1,6 @@
1
+ import { toPascalCase } from '@ledgerhq/lumen-utils-shared';
1
2
  import React, { forwardRef } from 'react';
2
3
  import { Svg, SvgProps } from 'react-native-svg';
3
- import { toPascalCase } from '../../utils';
4
4
  import { Icon } from './Icon';
5
5
  import { IconProps } from './types';
6
6