@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.
- package/dist/package.json +6 -2
- package/dist/src/lib/Components/Divider/Divider.d.ts +25 -0
- package/dist/src/lib/Components/Divider/Divider.d.ts.map +1 -0
- package/dist/src/lib/Components/Divider/Divider.js +40 -0
- package/dist/src/lib/Components/Divider/Divider.stories.d.ts +9 -0
- package/dist/src/lib/Components/Divider/Divider.stories.d.ts.map +1 -0
- package/dist/src/lib/Components/Divider/Divider.stories.js +51 -0
- package/dist/src/lib/Components/Divider/index.d.ts +3 -0
- package/dist/src/lib/Components/Divider/index.d.ts.map +1 -0
- package/dist/src/lib/Components/Divider/index.js +1 -0
- package/dist/src/lib/Components/Divider/types.d.ts +9 -0
- package/dist/src/lib/Components/Divider/types.d.ts.map +1 -0
- package/dist/src/lib/Components/Icon/Icon.d.ts.map +1 -1
- package/dist/src/lib/Components/Icon/Icon.js +3 -4
- package/dist/src/lib/Components/Icon/createIcon.d.ts.map +1 -1
- package/dist/src/lib/Components/Icon/createIcon.js +1 -1
- package/dist/src/lib/Components/ListItem/ListItem.d.ts +88 -34
- package/dist/src/lib/Components/ListItem/ListItem.d.ts.map +1 -1
- package/dist/src/lib/Components/ListItem/ListItem.js +248 -97
- package/dist/src/lib/Components/ListItem/ListItem.stories.d.ts +2 -3
- package/dist/src/lib/Components/ListItem/ListItem.stories.d.ts.map +1 -1
- package/dist/src/lib/Components/ListItem/ListItem.stories.js +63 -73
- package/dist/src/lib/Components/ListItem/index.d.ts +1 -1
- package/dist/src/lib/Components/ListItem/index.d.ts.map +1 -1
- package/dist/src/lib/Components/ListItem/index.js +1 -1
- package/dist/src/lib/Components/ListItem/types.d.ts +106 -0
- package/dist/src/lib/Components/ListItem/types.d.ts.map +1 -0
- package/dist/src/lib/Components/ListItem/types.js +1 -0
- package/dist/src/lib/Components/Select/GlobalSelectBottomSheet.d.ts.map +1 -1
- package/dist/src/lib/Components/Select/GlobalSelectBottomSheet.js +2 -7
- package/dist/src/lib/Components/Select/Select.d.ts.map +1 -1
- package/dist/src/lib/Components/Select/Select.js +4 -10
- package/dist/src/lib/Components/Select/types.d.ts.map +1 -1
- package/dist/src/lib/Components/Spot/types.d.ts +1 -1
- package/dist/src/lib/Components/Spot/types.d.ts.map +1 -1
- package/dist/src/lib/Components/Tile/Tile.d.ts +84 -19
- package/dist/src/lib/Components/Tile/Tile.d.ts.map +1 -1
- package/dist/src/lib/Components/Tile/Tile.figma.js +8 -18
- package/dist/src/lib/Components/Tile/Tile.js +160 -59
- package/dist/src/lib/Components/Tile/Tile.stories.d.ts +2 -2
- package/dist/src/lib/Components/Tile/Tile.stories.d.ts.map +1 -1
- package/dist/src/lib/Components/Tile/Tile.stories.js +30 -81
- package/dist/src/lib/Components/Tile/index.d.ts +1 -1
- package/dist/src/lib/Components/Tile/index.d.ts.map +1 -1
- package/dist/src/lib/Components/Tile/index.js +1 -1
- package/dist/src/lib/Components/Tile/types.d.ts +29 -19
- package/dist/src/lib/Components/Tile/types.d.ts.map +1 -1
- package/dist/src/lib/Components/index.d.ts +1 -0
- package/dist/src/lib/Components/index.d.ts.map +1 -1
- package/dist/src/lib/Components/index.js +1 -0
- package/dist/src/lib/utils/index.d.ts +3 -4
- package/dist/src/lib/utils/index.d.ts.map +1 -1
- package/dist/src/lib/utils/index.js +3 -4
- package/dist/src/lib/utils/react/{extract-text-from-children.d.ts → extractTextFromChildren.d.ts} +1 -1
- package/dist/src/lib/utils/react/extractTextFromChildren.d.ts.map +1 -0
- package/dist/src/lib/utils/react/index.d.ts +1 -1
- package/dist/src/lib/utils/react/index.d.ts.map +1 -1
- package/dist/src/lib/utils/react/index.js +1 -1
- package/dist/src/lib/utils/startTransition/index.d.ts +2 -0
- package/dist/src/lib/utils/startTransition/index.d.ts.map +1 -0
- package/dist/src/lib/utils/startTransition/index.js +1 -0
- package/dist/src/lib/utils/{start-transition/start-transition.d.ts → startTransition/startTransition.d.ts} +1 -1
- package/dist/src/lib/utils/startTransition/startTransition.d.ts.map +1 -0
- package/dist/src/lib/utils/useControllableState/index.d.ts +2 -0
- package/dist/src/lib/utils/useControllableState/index.d.ts.map +1 -0
- package/dist/src/lib/utils/useControllableState/index.js +1 -0
- package/dist/src/lib/utils/{use-controllable-state/use-controllable-state.d.ts → useControllableState/useControllableState.d.ts} +1 -1
- package/dist/src/lib/utils/useControllableState/useControllableState.d.ts.map +1 -0
- package/dist/src/lib/utils/{use-controllable-state/use-controllable-state.js → useControllableState/useControllableState.js} +2 -2
- package/dist/src/lib/utils/useEvent/index.d.ts +3 -0
- package/dist/src/lib/utils/useEvent/index.d.ts.map +1 -0
- package/dist/src/lib/utils/useEvent/index.js +2 -0
- package/dist/src/lib/utils/{use-event/use-event.d.ts → useEvent/useEvent.d.ts} +1 -1
- package/dist/src/lib/utils/useEvent/useEvent.d.ts.map +1 -0
- package/dist/src/lib/utils/{use-event/use-event.js → useEvent/useEvent.js} +1 -1
- package/dist/src/lib/utils/{use-event/use-get.d.ts → useEvent/useGet.d.ts} +1 -1
- package/dist/src/lib/utils/useEvent/useGet.d.ts.map +1 -0
- package/dist/src/styles/provider/LumenStyleSheetProvider.d.ts +1 -1
- package/dist/src/styles/provider/LumenStyleSheetProvider.d.ts.map +1 -1
- package/dist/src/styles/provider/LumenStyleSheetProvider.js +1 -2
- package/package.json +6 -2
- package/src/lib/Components/Checkbox/Checkbox.mdx +1 -0
- package/src/lib/Components/Divider/Divider.mdx +151 -0
- package/src/lib/Components/Divider/Divider.stories.tsx +140 -0
- package/src/lib/Components/Divider/Divider.test.tsx +92 -0
- package/src/lib/Components/Divider/Divider.tsx +52 -0
- package/src/lib/Components/Divider/index.ts +2 -0
- package/src/lib/Components/Divider/types.ts +9 -0
- package/src/lib/Components/Icon/Icon.tsx +3 -5
- package/src/lib/Components/Icon/createIcon.ts +1 -1
- package/src/lib/Components/ListItem/ListItem.mdx +402 -124
- package/src/lib/Components/ListItem/ListItem.stories.tsx +357 -228
- package/src/lib/Components/ListItem/ListItem.tsx +444 -181
- package/src/lib/Components/ListItem/index.ts +1 -1
- package/src/lib/Components/ListItem/types.ts +121 -0
- package/src/lib/Components/Select/GlobalSelectBottomSheet.tsx +5 -7
- package/src/lib/Components/Select/Select.tsx +4 -18
- package/src/lib/Components/Select/types.ts +1 -3
- package/src/lib/Components/Spot/types.ts +5 -1
- package/src/lib/Components/Switch/Switch.mdx +1 -0
- package/src/lib/Components/Tile/Tile.figma.tsx +24 -23
- package/src/lib/Components/Tile/Tile.mdx +128 -35
- package/src/lib/Components/Tile/Tile.stories.tsx +167 -146
- package/src/lib/Components/Tile/Tile.test.tsx +193 -221
- package/src/lib/Components/Tile/Tile.tsx +270 -123
- package/src/lib/Components/Tile/index.ts +7 -1
- package/src/lib/Components/Tile/types.ts +38 -19
- package/src/lib/Components/index.ts +1 -0
- package/src/lib/utils/index.ts +3 -4
- package/src/lib/utils/react/index.ts +1 -1
- package/src/lib/utils/startTransition/index.ts +1 -0
- package/src/lib/utils/useControllableState/index.ts +1 -0
- package/src/lib/utils/{use-controllable-state/use-controllable-state.ts → useControllableState/useControllableState.ts} +2 -2
- package/src/lib/utils/useEvent/index.ts +2 -0
- package/src/lib/utils/{use-event/use-event.ts → useEvent/useEvent.ts} +1 -1
- package/src/styles/provider/LumenStyleSheetProvider.tsx +2 -3
- package/dist/src/lib/Components/ListItem/ListItem.types.d.ts +0 -31
- package/dist/src/lib/Components/ListItem/ListItem.types.d.ts.map +0 -1
- package/dist/src/lib/utils/react/extract-text-from-children.d.ts.map +0 -1
- package/dist/src/lib/utils/start-transition/index.d.ts +0 -2
- package/dist/src/lib/utils/start-transition/index.d.ts.map +0 -1
- package/dist/src/lib/utils/start-transition/index.js +0 -1
- package/dist/src/lib/utils/start-transition/start-transition.d.ts.map +0 -1
- package/dist/src/lib/utils/string-utils.d.ts +0 -6
- package/dist/src/lib/utils/string-utils.d.ts.map +0 -1
- package/dist/src/lib/utils/string-utils.js +0 -12
- package/dist/src/lib/utils/use-controllable-state/index.d.ts +0 -2
- package/dist/src/lib/utils/use-controllable-state/index.d.ts.map +0 -1
- package/dist/src/lib/utils/use-controllable-state/index.js +0 -1
- package/dist/src/lib/utils/use-controllable-state/use-controllable-state.d.ts.map +0 -1
- package/dist/src/lib/utils/use-event/index.d.ts +0 -3
- package/dist/src/lib/utils/use-event/index.d.ts.map +0 -1
- package/dist/src/lib/utils/use-event/index.js +0 -2
- package/dist/src/lib/utils/use-event/use-event.d.ts.map +0 -1
- package/dist/src/lib/utils/use-event/use-get.d.ts.map +0 -1
- package/src/lib/Components/ListItem/ListItem.types.ts +0 -31
- package/src/lib/utils/start-transition/index.ts +0 -1
- package/src/lib/utils/string-utils.test.ts +0 -73
- package/src/lib/utils/string-utils.ts +0 -11
- package/src/lib/utils/use-controllable-state/index.ts +0 -1
- package/src/lib/utils/use-event/index.ts +0 -2
- /package/dist/src/lib/Components/{ListItem/ListItem.types.js → Divider/types.js} +0 -0
- /package/dist/src/lib/utils/react/{extract-text-from-children.js → extractTextFromChildren.js} +0 -0
- /package/dist/src/lib/utils/{start-transition/start-transition.js → startTransition/startTransition.js} +0 -0
- /package/dist/src/lib/utils/{use-event/use-get.js → useEvent/useGet.js} +0 -0
- /package/src/lib/utils/react/{extract-text-from-children.ts → extractTextFromChildren.ts} +0 -0
- /package/src/lib/utils/{start-transition/start-transition.ts → startTransition/startTransition.ts} +0 -0
- /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.
|
|
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.
|
|
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 @@
|
|
|
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 @@
|
|
|
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;
|
|
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:
|
|
25
|
+
color: resolvedStyle.color || theme.colors.text.base,
|
|
27
26
|
};
|
|
28
|
-
}, [size, theme, resolvedStyle
|
|
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":"
|
|
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,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
|
|
5
|
-
*
|
|
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
|
-
*
|
|
15
|
-
*
|
|
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
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
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
|
-
|
|
44
|
-
description?: string;
|
|
45
|
-
leadingContent?: React.ReactNode;
|
|
46
|
-
descriptionTag?: React.ReactNode;
|
|
47
|
-
trailingContent?: React.ReactNode;
|
|
40
|
+
children: React.ReactNode;
|
|
48
41
|
disabled?: boolean;
|
|
49
|
-
|
|
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":"
|
|
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"}
|