@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
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LumenTextStyle, StyledPressableProps, StyledTextProps, StyledViewProps } from '../../../styles';
|
|
3
|
+
import { DiscriminatedSpotProps } from '../Spot';
|
|
4
|
+
/**
|
|
5
|
+
* Context value for passing state to sub-components
|
|
6
|
+
*/
|
|
7
|
+
export type ListItemContextValue = {
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Props for the ListItem root component
|
|
12
|
+
*/
|
|
13
|
+
export type ListItemProps = {
|
|
14
|
+
/**
|
|
15
|
+
* The content of the list item (ListItemLeading, ListItemTrailing)
|
|
16
|
+
*/
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the list item is disabled.
|
|
20
|
+
*/
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Callback function when the list item is pressed.
|
|
24
|
+
*/
|
|
25
|
+
onPress?: StyledPressableProps['onPress'];
|
|
26
|
+
} & Omit<StyledPressableProps, 'disabled' | 'children'>;
|
|
27
|
+
/**
|
|
28
|
+
* Props for the ListItemLeading component
|
|
29
|
+
*/
|
|
30
|
+
export type ListItemLeadingProps = {
|
|
31
|
+
/**
|
|
32
|
+
* The content of the leading area (visual element + ListItemContent)
|
|
33
|
+
*/
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
} & Omit<StyledViewProps, 'children'>;
|
|
36
|
+
/**
|
|
37
|
+
* Props for the ListItemContent component
|
|
38
|
+
*/
|
|
39
|
+
export type ListItemContentProps = {
|
|
40
|
+
/**
|
|
41
|
+
* The content (ListItemTitle, ListItemDescription)
|
|
42
|
+
*/
|
|
43
|
+
children: React.ReactNode;
|
|
44
|
+
} & Omit<StyledViewProps, 'children'>;
|
|
45
|
+
/**
|
|
46
|
+
* Props for the ListItemTitle component
|
|
47
|
+
*/
|
|
48
|
+
export type ListItemTitleProps = {
|
|
49
|
+
/**
|
|
50
|
+
* The title text or custom content
|
|
51
|
+
*/
|
|
52
|
+
children: React.ReactNode;
|
|
53
|
+
} & Omit<StyledTextProps, 'children'>;
|
|
54
|
+
/**
|
|
55
|
+
* Props for the ListItemDescription component
|
|
56
|
+
*/
|
|
57
|
+
export type ListItemDescriptionProps = {
|
|
58
|
+
/**
|
|
59
|
+
* The description text or custom content
|
|
60
|
+
*/
|
|
61
|
+
children: React.ReactNode;
|
|
62
|
+
} & Omit<StyledTextProps, 'children'>;
|
|
63
|
+
/**
|
|
64
|
+
* Props for the ListItemTrailing component
|
|
65
|
+
*/
|
|
66
|
+
export type ListItemTrailingProps = {
|
|
67
|
+
/**
|
|
68
|
+
* The trailing content (icons, switches, values, etc.)
|
|
69
|
+
*/
|
|
70
|
+
children: React.ReactNode;
|
|
71
|
+
} & Omit<StyledViewProps, 'children'>;
|
|
72
|
+
/**
|
|
73
|
+
* Props for the ListItemTruncate component
|
|
74
|
+
* Used to truncate text that should when ListItemDescription or ListItemTitle contain custom content
|
|
75
|
+
*/
|
|
76
|
+
export type ListItemTruncateProps = {
|
|
77
|
+
/**
|
|
78
|
+
* The text content to truncate
|
|
79
|
+
*/
|
|
80
|
+
children: string;
|
|
81
|
+
/**
|
|
82
|
+
* The variant determines typography and color styling.
|
|
83
|
+
* Use 'title' inside ListItemTitle and 'description' inside ListItemDescription.
|
|
84
|
+
* @default 'description'
|
|
85
|
+
*/
|
|
86
|
+
variant?: 'title' | 'description';
|
|
87
|
+
} & Omit<StyledTextProps, 'children'>;
|
|
88
|
+
/**
|
|
89
|
+
* Props for the ListItemSpot component
|
|
90
|
+
* Spot adapter that inherits disabled state from parent ListItem
|
|
91
|
+
*/
|
|
92
|
+
export type ListItemSpotProps = DiscriminatedSpotProps & Omit<StyledViewProps, 'children'>;
|
|
93
|
+
/**
|
|
94
|
+
* Props for the ListItemIcon component
|
|
95
|
+
*/
|
|
96
|
+
export type ListItemIconProps = {
|
|
97
|
+
/**
|
|
98
|
+
* The icon component to render
|
|
99
|
+
*/
|
|
100
|
+
icon: React.ComponentType<any>;
|
|
101
|
+
/**
|
|
102
|
+
* Optional color override. If not provided, uses theme color with disabled state handling.
|
|
103
|
+
*/
|
|
104
|
+
color?: LumenTextStyle['color'];
|
|
105
|
+
} & Omit<StyledViewProps, 'children'>;
|
|
106
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d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CAAC,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;AAEtC;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;CACnC,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;AAEtC;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,GACpD,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;AAEpC;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC/B;;OAEG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;CACjC,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalSelectBottomSheet.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Select/GlobalSelectBottomSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GlobalSelectBottomSheet.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Select/GlobalSelectBottomSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiC,MAAM,OAAO,CAAC;AAqDtD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EA4G3C,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { Pressable } from 'react-native';
|
|
|
4
4
|
import { useStyleSheet } from '../../../styles';
|
|
5
5
|
import { Check } from '../../Symbols';
|
|
6
6
|
import { BottomSheet, BottomSheetHeader, BottomSheetView, useBottomSheetRef, } from '../BottomSheet';
|
|
7
|
+
import { Divider } from '../Divider';
|
|
7
8
|
import { Box, Text } from '../Utility';
|
|
8
9
|
import { useGlobalSelectSafeContext } from './GlobalSelectContext';
|
|
9
10
|
const useStyles = () => {
|
|
@@ -11,12 +12,6 @@ const useStyles = () => {
|
|
|
11
12
|
bottomSheetView: {
|
|
12
13
|
paddingHorizontal: t.spacings.s8,
|
|
13
14
|
},
|
|
14
|
-
separator: {
|
|
15
|
-
marginVertical: t.spacings.s4,
|
|
16
|
-
marginHorizontal: t.spacings.s8,
|
|
17
|
-
height: 1,
|
|
18
|
-
backgroundColor: t.colors.bg.muted,
|
|
19
|
-
},
|
|
20
15
|
groupLabel: {
|
|
21
16
|
marginBottom: t.spacings.s4,
|
|
22
17
|
paddingHorizontal: t.spacings.s8,
|
|
@@ -97,7 +92,7 @@ export const GlobalSelectBottomSheet = () => {
|
|
|
97
92
|
}, [currentSelect, hideSelectRef]);
|
|
98
93
|
return (_jsx(BottomSheet, { ref: bottomSheetRef, snapPoints: null, backdropPressBehavior: 'close', onClose: handleClose, maxDynamicContentSize: 'fullWithOffset', enableDynamicSizing: true, enablePanDownToClose: true, children: _jsx(BottomSheetView, { style: styles.bottomSheetView, children: currentSelect && (_jsxs(_Fragment, { children: [currentSelect.label && (_jsx(BottomSheetHeader, { title: currentSelect.label, appearance: 'compact' })), _jsx(Box, { lx: { gap: 's4' }, children: currentSelect.items.map((item, index) => {
|
|
99
94
|
if (item.type === 'separator') {
|
|
100
|
-
return (_jsx(
|
|
95
|
+
return (_jsx(Divider, { lx: { marginVertical: 's4', marginHorizontal: 's8' } }, `separator-${index}`));
|
|
101
96
|
}
|
|
102
97
|
if (item.type === 'group-label') {
|
|
103
98
|
return (_jsx(Text, { style: styles.groupLabel, children: item.label }, `label-${index}`));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AASvE,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EAErB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA8DxC,CAAC;AAGF,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA2EtD,CAAC;AAmFF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAgC/B,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAkDtD,CAAC;AAGF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAqBlD,CAAC;AAGF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA2BlD,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAIhD,CAAC;AAGF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAuBxD,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AASvE,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EAErB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA8DxC,CAAC;AAGF,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA2EtD,CAAC;AAmFF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAgC/B,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAkDtD,CAAC;AAGF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAqBlD,CAAC;AAGF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA2BlD,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAIhD,CAAC;AAGF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAuBxD,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAI1D,CAAC"}
|
|
@@ -297,15 +297,9 @@ export const SelectItemText = ({ children, lx, style, ...props }) => {
|
|
|
297
297
|
return (_jsx(Text, { lx: lx, style: [styles.text, style], ...props, children: children }));
|
|
298
298
|
};
|
|
299
299
|
SelectItemText.displayName = 'SelectItemText';
|
|
300
|
-
export const SelectSeparator = (
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
marginVertical: t.spacings.s4,
|
|
305
|
-
height: t.sizes.s1,
|
|
306
|
-
backgroundColor: t.colors.border.mutedSubtle,
|
|
307
|
-
},
|
|
308
|
-
}), []);
|
|
309
|
-
return _jsx(Box, { lx: lx, style: [styles.separator, style], ...props });
|
|
300
|
+
export const SelectSeparator = () => {
|
|
301
|
+
// This component doesn't render anything - it's used for structure
|
|
302
|
+
// The actual separators are rendered in GlobalSelectBottomSheet
|
|
303
|
+
return null;
|
|
310
304
|
};
|
|
311
305
|
SelectSeparator.displayName = 'SelectSeparator';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Select/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,eAAe,EAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,IAAI,CAAC,oBAAoB,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G,eAAe,CAAC;AAEpB,MAAM,MAAM,oBAAoB,GAAG,EAAE,GAAG,QAAQ,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,WAAW,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GACzB,cAAc,GACd,eAAe,GACf,mBAAmB,CAAC;AAExB,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
@@ -28,7 +28,7 @@ type StatusSpotProps = {
|
|
|
28
28
|
*/
|
|
29
29
|
appearance: Exclude<SpotAppearance, 'icon' | 'number'>;
|
|
30
30
|
};
|
|
31
|
-
type DiscriminatedSpotProps = IconSpotProps | NumberSpotProps | StatusSpotProps;
|
|
31
|
+
export type DiscriminatedSpotProps = IconSpotProps | NumberSpotProps | StatusSpotProps;
|
|
32
32
|
export type SpotSize = 48 | 56 | 72;
|
|
33
33
|
export type SpotProps = {
|
|
34
34
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Spot/types.ts"],"names":[],"mappings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AAC,SAAS,CAAC,CAAC;CACtC,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB;;OAEG;IACH,UAAU,EAAE,QAAQ,CAAC;IACrB;;OAEG;IACH,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC/C,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC,cAAc,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC;CACxD,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAC9B,aAAa,GACb,eAAe,GACf,eAAe,CAAC;AAEpB,MAAM,MAAM,QAAQ,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAEpC,MAAM,MAAM,SAAS,GAAG;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB,GAAG,sBAAsB,GACxB,eAAe,CAAC"}
|
|
@@ -1,37 +1,102 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
+
import { TileContentProps, TileDescriptionProps, TileSpotProps, TileTitleProps } from './types';
|
|
3
4
|
/**
|
|
4
|
-
* A tile
|
|
5
|
-
*
|
|
6
|
-
* and supports long press actions.
|
|
5
|
+
* A flexible tile component that uses a composite pattern for maximum customization.
|
|
6
|
+
* Displays content in a vertical layout with support for spots, text, and custom content.
|
|
7
7
|
*
|
|
8
|
-
* @see {@link https://ldls.vercel.app/?path=/docs/
|
|
9
|
-
* @see {@link https://ldls.vercel.app/?path=/docs/
|
|
8
|
+
* @see {@link https://ldls.vercel.app/?path=/docs/react-native_containment-tile--docs Storybook}
|
|
9
|
+
* @see {@link https://ldls.vercel.app/?path=/docs/react-native_containment-tile--docs#dos-and-donts Guidelines}
|
|
10
10
|
*
|
|
11
11
|
* @warning The `lx` prop should only be used for layout adjustments like margins or positioning.
|
|
12
12
|
* Do not use it to modify the tile's core appearance (colors, padding, etc). Use the `appearance` prop instead.
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
|
-
* // Basic tile
|
|
16
|
-
* import { Tile,
|
|
15
|
+
* // Basic tile with spot and content
|
|
16
|
+
* import { Tile, TileSpot, TileContent, TileTitle, TileDescription } from '@ledgerhq/lumen-ui-rnative';
|
|
17
17
|
* import { Wallet } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
18
18
|
*
|
|
19
|
-
* <Tile
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
19
|
+
* <Tile appearance="card" onPress={() => console.log('Pressed!')}>
|
|
20
|
+
* <TileSpot appearance="icon" icon={Wallet} />
|
|
21
|
+
* <TileContent>
|
|
22
|
+
* <TileTitle>My Wallet</TileTitle>
|
|
23
|
+
* <TileDescription>Description</TileDescription>
|
|
24
|
+
* </TileContent>
|
|
25
|
+
* </Tile>
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // With custom content and long press
|
|
29
|
+
* import { Tile, TileSpot, TileContent, TileTitle, Tag } from '@ledgerhq/lumen-ui-rnative';
|
|
30
|
+
* import { Bitcoin } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
31
|
+
*
|
|
32
|
+
* <Tile appearance="card" onLongPress={() => console.log('Long pressed')}>
|
|
33
|
+
* <TileSpot appearance="icon" icon={Bitcoin} />
|
|
34
|
+
* <TileContent>
|
|
35
|
+
* <TileTitle>Bitcoin</TileTitle>
|
|
36
|
+
* </TileContent>
|
|
37
|
+
* <Tag label="Active" />
|
|
38
|
+
* </Tile>
|
|
26
39
|
*/
|
|
27
40
|
export declare const Tile: React.ForwardRefExoticComponent<{
|
|
28
|
-
leadingContent: React.ReactNode;
|
|
29
|
-
title: string;
|
|
30
|
-
description?: string;
|
|
31
|
-
trailingContent?: React.ReactNode;
|
|
32
41
|
appearance?: "no-background" | "card";
|
|
33
42
|
disabled?: boolean;
|
|
34
43
|
onPress?: import("../../../styles").StyledPressableProps["onPress"];
|
|
35
44
|
onLongPress?: import("../../../styles").StyledPressableProps["onLongPress"];
|
|
45
|
+
children: ReactNode;
|
|
36
46
|
} & Omit<import("../../../styles").StyledPressableProps, "disabled" | "onPress" | "onLongPress"> & React.RefAttributes<View>>;
|
|
47
|
+
/**
|
|
48
|
+
* A spot adapter for use within Tile. Automatically inherits the disabled state from the parent Tile.
|
|
49
|
+
* Always renders at a fixed size of 48.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* <Tile>
|
|
53
|
+
* <TileSpot appearance="icon" icon={Settings} />
|
|
54
|
+
* </Tile>
|
|
55
|
+
*/
|
|
56
|
+
export declare const TileSpot: {
|
|
57
|
+
(props: TileSpotProps): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
displayName: string;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* A container for grouping TileTitle and TileDescription with consistent spacing.
|
|
62
|
+
* Use this to wrap text content within a Tile.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* <Tile>
|
|
66
|
+
* <TileContent>
|
|
67
|
+
* <TileTitle>My Title</TileTitle>
|
|
68
|
+
* <TileDescription>My Description</TileDescription>
|
|
69
|
+
* </TileContent>
|
|
70
|
+
* </Tile>
|
|
71
|
+
*/
|
|
72
|
+
export declare const TileContent: {
|
|
73
|
+
({ children, lx, style }: TileContentProps): import("react/jsx-runtime").JSX.Element;
|
|
74
|
+
displayName: string;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* The primary text label for a Tile. Automatically inherits the disabled state from the parent Tile.
|
|
78
|
+
* Text will truncate with ellipsis if it exceeds the available width.
|
|
79
|
+
* If children is a string, it will be automatically wrapped in a Text component.
|
|
80
|
+
*/
|
|
81
|
+
export declare const TileTitle: {
|
|
82
|
+
({ children, lx, style }: TileTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
displayName: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* The secondary text label for a Tile. Automatically inherits the disabled state from the parent Tile.
|
|
87
|
+
* Text will truncate with ellipsis if it exceeds the available width.
|
|
88
|
+
* If children is a string, it will be automatically wrapped in a Text component.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* <Tile>
|
|
92
|
+
* <TileContent>
|
|
93
|
+
* <TileTitle>My Title</TileTitle>
|
|
94
|
+
* <TileDescription>My Description</TileDescription>
|
|
95
|
+
* </TileContent>
|
|
96
|
+
* </Tile>
|
|
97
|
+
*/
|
|
98
|
+
export declare const TileDescription: {
|
|
99
|
+
({ children, lx, style, }: TileDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
100
|
+
displayName: string;
|
|
101
|
+
};
|
|
37
102
|
//# sourceMappingURL=Tile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Tile/Tile.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Tile/Tile.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAc,IAAI,EAAE,MAAM,cAAc,CAAC;AAIhD,OAAO,EACL,gBAAgB,EAEhB,oBAAoB,EAEpB,aAAa,EACb,cAAc,EACf,MAAM,SAAS,CAAC;AAoDjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,IAAI;;;;;;6HAoChB,CAAC;AAkBF;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ;YAAW,aAAa;;CAM5C,CAAC;AAgBF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW;8BAA6B,gBAAgB;;CAWpE,CAAC;AAwBF;;;;GAIG;AACH,eAAO,MAAM,SAAS;8BAA6B,cAAc;;CA6BhE,CAAC;AAwBF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe;+BAIzB,oBAAoB;;CA6BtB,CAAC"}
|
|
@@ -1,27 +1,19 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import figma from '@figma/code-connect';
|
|
3
3
|
import { Settings } from '../../Symbols';
|
|
4
|
-
import {
|
|
5
|
-
import { Tile } from './Tile';
|
|
6
|
-
/**
|
|
7
|
-
* -- This file was auto-generated by Code Connect --
|
|
8
|
-
* `props` includes a mapping from your code props to Figma properties.
|
|
9
|
-
* You should check this is correct, and update the `example` function
|
|
10
|
-
* to return the code example you'd like to see in Figma
|
|
11
|
-
*/
|
|
4
|
+
import { Tile, TileSpot, TileContent, TileTitle, TileDescription, } from './Tile';
|
|
12
5
|
figma.connect(Tile, 'https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7?node-id=5783-1328', {
|
|
13
|
-
imports: [
|
|
6
|
+
imports: [
|
|
7
|
+
"import { Tile, TileSpot, TileContent, TileTitle, TileDescription } from '@ledgerhq/lumen-ui-rnative'",
|
|
8
|
+
],
|
|
14
9
|
props: {
|
|
15
10
|
title: figma.string('title'),
|
|
16
11
|
description: figma.boolean('show-description', {
|
|
17
12
|
true: figma.string('description'),
|
|
18
13
|
false: undefined,
|
|
19
14
|
}),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
true: figma.instance('tag'),
|
|
23
|
-
false: undefined,
|
|
24
|
-
}),
|
|
15
|
+
showTag: figma.boolean('show-tag'),
|
|
16
|
+
tag: figma.instance('tag'),
|
|
25
17
|
disabled: figma.enum('state', {
|
|
26
18
|
disabled: true,
|
|
27
19
|
}),
|
|
@@ -32,7 +24,5 @@ figma.connect(Tile, 'https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7?node-id
|
|
|
32
24
|
url: 'https://ldls.vercel.app/?path=/docs/components-Tile-overview--docs',
|
|
33
25
|
},
|
|
34
26
|
],
|
|
35
|
-
example: (props) => (
|
|
36
|
-
console.log('Tile pressed');
|
|
37
|
-
} })),
|
|
27
|
+
example: (props) => (_jsxs(Tile, { disabled: props.disabled, onPress: () => console.log('Tile pressed'), onLongPress: () => console.log('Long press - secondary action'), children: [_jsx(TileSpot, { appearance: 'icon', icon: Settings }), _jsxs(TileContent, { children: [_jsx(TileTitle, { children: props.title }), props.description && (_jsx(TileDescription, { children: props.description }))] }), props.showTag && props.tag] })),
|
|
38
28
|
});
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createSafeContext, isTextChildren, } from '@ledgerhq/lumen-utils-shared';
|
|
2
3
|
import { forwardRef } from 'react';
|
|
3
|
-
import { StyleSheet, View
|
|
4
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
5
|
import { useStyleSheet } from '../../../styles';
|
|
5
|
-
import {
|
|
6
|
-
|
|
6
|
+
import { Spot } from '../Spot';
|
|
7
|
+
import { Box, Pressable, Text } from '../Utility';
|
|
8
|
+
const [TileProvider, useTileContext] = createSafeContext('Tile');
|
|
9
|
+
const useRootStyles = ({ appearance, disabled, pressed, }) => {
|
|
7
10
|
return useStyleSheet((t) => {
|
|
8
11
|
const bgColors = {
|
|
9
12
|
'no-background': t.colors.bg.baseTransparent,
|
|
@@ -21,7 +24,8 @@ const useStyles = ({ appearance, disabled, pressed, }) => {
|
|
|
21
24
|
width: '100%',
|
|
22
25
|
alignItems: 'center',
|
|
23
26
|
gap: t.spacings.s8,
|
|
24
|
-
|
|
27
|
+
paddingHorizontal: t.spacings.s8,
|
|
28
|
+
paddingVertical: t.spacings.s12,
|
|
25
29
|
borderRadius: t.borderRadius.sm,
|
|
26
30
|
backgroundColor: bgColors[appearance],
|
|
27
31
|
},
|
|
@@ -30,72 +34,169 @@ const useStyles = ({ appearance, disabled, pressed, }) => {
|
|
|
30
34
|
backgroundColor: pressedBgColors[appearance],
|
|
31
35
|
},
|
|
32
36
|
]),
|
|
33
|
-
contentWrapper: {
|
|
34
|
-
width: t.sizes.full,
|
|
35
|
-
alignItems: 'center',
|
|
36
|
-
gap: t.spacings.s8,
|
|
37
|
-
},
|
|
38
|
-
leadingWrapper: {
|
|
39
|
-
alignItems: 'center',
|
|
40
|
-
justifyContent: 'center',
|
|
41
|
-
},
|
|
42
|
-
textWrapper: {
|
|
43
|
-
width: t.sizes.full,
|
|
44
|
-
alignItems: 'center',
|
|
45
|
-
gap: t.spacings.s4,
|
|
46
|
-
},
|
|
47
|
-
titleWrapper: {
|
|
48
|
-
width: t.sizes.full,
|
|
49
|
-
alignItems: 'center',
|
|
50
|
-
},
|
|
51
|
-
title: StyleSheet.flatten([
|
|
52
|
-
t.typographies.body3SemiBold,
|
|
53
|
-
{
|
|
54
|
-
width: t.sizes.full,
|
|
55
|
-
textAlign: 'center',
|
|
56
|
-
color: disabled ? t.colors.text.disabled : t.colors.text.base,
|
|
57
|
-
},
|
|
58
|
-
]),
|
|
59
|
-
description: StyleSheet.flatten([
|
|
60
|
-
t.typographies.body3,
|
|
61
|
-
{
|
|
62
|
-
width: t.sizes.full,
|
|
63
|
-
textAlign: 'center',
|
|
64
|
-
color: disabled ? t.colors.text.disabled : t.colors.text.muted,
|
|
65
|
-
},
|
|
66
|
-
]),
|
|
67
37
|
};
|
|
68
38
|
}, [appearance, disabled, pressed]);
|
|
69
39
|
};
|
|
70
|
-
const TileContent = ({ appearance, disabled, pressed, leadingContent, title, description, trailingContent, }) => {
|
|
71
|
-
const styles = useStyles({ appearance, disabled, pressed });
|
|
72
|
-
return (_jsx(View, { style: styles.container, children: _jsxs(View, { style: styles.contentWrapper, children: [_jsx(View, { style: styles.leadingWrapper, children: leadingContent }), _jsxs(View, { style: styles.textWrapper, children: [_jsxs(View, { style: styles.titleWrapper, children: [_jsx(Text, { numberOfLines: 1, style: styles.title, children: title }), description && (_jsx(Text, { numberOfLines: 1, style: styles.description, children: description }))] }), trailingContent] })] }) }));
|
|
73
|
-
};
|
|
74
40
|
/**
|
|
75
|
-
* A tile
|
|
76
|
-
*
|
|
77
|
-
* and supports long press actions.
|
|
41
|
+
* A flexible tile component that uses a composite pattern for maximum customization.
|
|
42
|
+
* Displays content in a vertical layout with support for spots, text, and custom content.
|
|
78
43
|
*
|
|
79
|
-
* @see {@link https://ldls.vercel.app/?path=/docs/
|
|
80
|
-
* @see {@link https://ldls.vercel.app/?path=/docs/
|
|
44
|
+
* @see {@link https://ldls.vercel.app/?path=/docs/react-native_containment-tile--docs Storybook}
|
|
45
|
+
* @see {@link https://ldls.vercel.app/?path=/docs/react-native_containment-tile--docs#dos-and-donts Guidelines}
|
|
81
46
|
*
|
|
82
47
|
* @warning The `lx` prop should only be used for layout adjustments like margins or positioning.
|
|
83
48
|
* Do not use it to modify the tile's core appearance (colors, padding, etc). Use the `appearance` prop instead.
|
|
84
49
|
*
|
|
85
50
|
* @example
|
|
86
|
-
* // Basic tile
|
|
87
|
-
* import { Tile,
|
|
51
|
+
* // Basic tile with spot and content
|
|
52
|
+
* import { Tile, TileSpot, TileContent, TileTitle, TileDescription } from '@ledgerhq/lumen-ui-rnative';
|
|
88
53
|
* import { Wallet } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
89
54
|
*
|
|
90
|
-
* <Tile
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
55
|
+
* <Tile appearance="card" onPress={() => console.log('Pressed!')}>
|
|
56
|
+
* <TileSpot appearance="icon" icon={Wallet} />
|
|
57
|
+
* <TileContent>
|
|
58
|
+
* <TileTitle>My Wallet</TileTitle>
|
|
59
|
+
* <TileDescription>Description</TileDescription>
|
|
60
|
+
* </TileContent>
|
|
61
|
+
* </Tile>
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* // With custom content and long press
|
|
65
|
+
* import { Tile, TileSpot, TileContent, TileTitle, Tag } from '@ledgerhq/lumen-ui-rnative';
|
|
66
|
+
* import { Bitcoin } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
67
|
+
*
|
|
68
|
+
* <Tile appearance="card" onLongPress={() => console.log('Long pressed')}>
|
|
69
|
+
* <TileSpot appearance="icon" icon={Bitcoin} />
|
|
70
|
+
* <TileContent>
|
|
71
|
+
* <TileTitle>Bitcoin</TileTitle>
|
|
72
|
+
* </TileContent>
|
|
73
|
+
* <Tag label="Active" />
|
|
74
|
+
* </Tile>
|
|
97
75
|
*/
|
|
98
|
-
export const Tile = forwardRef(({ lx = {}, style,
|
|
99
|
-
return (_jsx(Pressable, { ref: ref, lx: lx, style: style, disabled: disabled, accessibilityRole: 'button', accessibilityState: { disabled }, ...props, children: ({ pressed }) => (_jsx(
|
|
76
|
+
export const Tile = forwardRef(({ lx = {}, style, appearance = 'no-background', disabled = false, children, ...props }, ref) => {
|
|
77
|
+
return (_jsx(TileProvider, { value: { disabled }, children: _jsx(Pressable, { ref: ref, lx: lx, style: StyleSheet.flatten([{ width: '100%' }, style]), disabled: disabled, accessibilityRole: 'button', accessibilityState: { disabled }, ...props, children: ({ pressed }) => (_jsx(TilePressableContent, { appearance: appearance, disabled: disabled, pressed: pressed, children: children })) }) }));
|
|
100
78
|
});
|
|
101
79
|
Tile.displayName = 'Tile';
|
|
80
|
+
const TilePressableContent = ({ appearance, disabled, pressed, children, }) => {
|
|
81
|
+
const styles = useRootStyles({ appearance, disabled, pressed });
|
|
82
|
+
return _jsx(View, { style: styles.container, children: children });
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* A spot adapter for use within Tile. Automatically inherits the disabled state from the parent Tile.
|
|
86
|
+
* Always renders at a fixed size of 48.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* <Tile>
|
|
90
|
+
* <TileSpot appearance="icon" icon={Settings} />
|
|
91
|
+
* </Tile>
|
|
92
|
+
*/
|
|
93
|
+
export const TileSpot = (props) => {
|
|
94
|
+
const { disabled } = useTileContext({
|
|
95
|
+
consumerName: 'TileSpot',
|
|
96
|
+
contextRequired: true,
|
|
97
|
+
});
|
|
98
|
+
return _jsx(Spot, { ...props, size: 48, disabled: disabled });
|
|
99
|
+
};
|
|
100
|
+
const useContentStyles = () => {
|
|
101
|
+
return useStyleSheet((t) => ({
|
|
102
|
+
container: {
|
|
103
|
+
width: t.sizes.full,
|
|
104
|
+
alignItems: 'center',
|
|
105
|
+
gap: t.spacings.s4,
|
|
106
|
+
},
|
|
107
|
+
}), []);
|
|
108
|
+
};
|
|
109
|
+
TileSpot.displayName = 'TileSpot';
|
|
110
|
+
/**
|
|
111
|
+
* A container for grouping TileTitle and TileDescription with consistent spacing.
|
|
112
|
+
* Use this to wrap text content within a Tile.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* <Tile>
|
|
116
|
+
* <TileContent>
|
|
117
|
+
* <TileTitle>My Title</TileTitle>
|
|
118
|
+
* <TileDescription>My Description</TileDescription>
|
|
119
|
+
* </TileContent>
|
|
120
|
+
* </Tile>
|
|
121
|
+
*/
|
|
122
|
+
export const TileContent = ({ children, lx, style }) => {
|
|
123
|
+
const styles = useContentStyles();
|
|
124
|
+
return (_jsx(Box, { lx: lx, style: StyleSheet.flatten([styles.container, style]), testID: 'tile-content', children: children }));
|
|
125
|
+
};
|
|
126
|
+
TileContent.displayName = 'TileContent';
|
|
127
|
+
const useTitleStyles = ({ disabled }) => {
|
|
128
|
+
return useStyleSheet((t) => ({
|
|
129
|
+
container: {
|
|
130
|
+
width: t.sizes.full,
|
|
131
|
+
alignItems: 'center',
|
|
132
|
+
},
|
|
133
|
+
text: StyleSheet.flatten([
|
|
134
|
+
t.typographies.body3SemiBold,
|
|
135
|
+
{
|
|
136
|
+
alignItems: 'center',
|
|
137
|
+
width: t.sizes.full,
|
|
138
|
+
textAlign: 'center',
|
|
139
|
+
color: disabled ? t.colors.text.disabled : t.colors.text.base,
|
|
140
|
+
},
|
|
141
|
+
]),
|
|
142
|
+
}), [disabled]);
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* The primary text label for a Tile. Automatically inherits the disabled state from the parent Tile.
|
|
146
|
+
* Text will truncate with ellipsis if it exceeds the available width.
|
|
147
|
+
* If children is a string, it will be automatically wrapped in a Text component.
|
|
148
|
+
*/
|
|
149
|
+
export const TileTitle = ({ children, lx, style }) => {
|
|
150
|
+
const { disabled } = useTileContext({
|
|
151
|
+
consumerName: 'TileTitle',
|
|
152
|
+
contextRequired: true,
|
|
153
|
+
});
|
|
154
|
+
const styles = useTitleStyles({ disabled });
|
|
155
|
+
if (isTextChildren(children)) {
|
|
156
|
+
return (_jsx(Text, { testID: 'tile-title', numberOfLines: 1, lx: lx, style: StyleSheet.flatten([styles.text, style]), children: children }));
|
|
157
|
+
}
|
|
158
|
+
return (_jsx(Box, { lx: lx, style: StyleSheet.flatten([styles.container, style]), testID: 'tile-title', children: children }));
|
|
159
|
+
};
|
|
160
|
+
TileTitle.displayName = 'TileTitle';
|
|
161
|
+
const useDescriptionStyles = ({ disabled }) => {
|
|
162
|
+
return useStyleSheet((t) => ({
|
|
163
|
+
container: {
|
|
164
|
+
width: t.sizes.full,
|
|
165
|
+
alignItems: 'center',
|
|
166
|
+
},
|
|
167
|
+
text: StyleSheet.flatten([
|
|
168
|
+
t.typographies.body3,
|
|
169
|
+
{
|
|
170
|
+
width: t.sizes.full,
|
|
171
|
+
alignItems: 'center',
|
|
172
|
+
textAlign: 'center',
|
|
173
|
+
color: disabled ? t.colors.text.disabled : t.colors.text.muted,
|
|
174
|
+
},
|
|
175
|
+
]),
|
|
176
|
+
}), [disabled]);
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* The secondary text label for a Tile. Automatically inherits the disabled state from the parent Tile.
|
|
180
|
+
* Text will truncate with ellipsis if it exceeds the available width.
|
|
181
|
+
* If children is a string, it will be automatically wrapped in a Text component.
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* <Tile>
|
|
185
|
+
* <TileContent>
|
|
186
|
+
* <TileTitle>My Title</TileTitle>
|
|
187
|
+
* <TileDescription>My Description</TileDescription>
|
|
188
|
+
* </TileContent>
|
|
189
|
+
* </Tile>
|
|
190
|
+
*/
|
|
191
|
+
export const TileDescription = ({ children, lx, style, }) => {
|
|
192
|
+
const { disabled } = useTileContext({
|
|
193
|
+
consumerName: 'TileDescription',
|
|
194
|
+
contextRequired: true,
|
|
195
|
+
});
|
|
196
|
+
const styles = useDescriptionStyles({ disabled });
|
|
197
|
+
if (isTextChildren(children)) {
|
|
198
|
+
return (_jsx(Text, { lx: lx, numberOfLines: 1, style: StyleSheet.flatten([styles.text, style]), testID: 'tile-description', children: children }));
|
|
199
|
+
}
|
|
200
|
+
return (_jsx(Box, { lx: lx, style: StyleSheet.flatten([styles.container, style]), testID: 'tile-description', children: children }));
|
|
201
|
+
};
|
|
202
|
+
TileDescription.displayName = 'TileDescription';
|
|
@@ -4,9 +4,9 @@ declare const meta: Meta<typeof Tile>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof Tile>;
|
|
6
6
|
export declare const Base: Story;
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const VariantsShowcase: Story;
|
|
8
8
|
export declare const WithSecondaryAction: Story;
|
|
9
|
-
export declare const LeadingContentVariantsShowcase: Story;
|
|
10
9
|
export declare const HorizontalList: Story;
|
|
11
10
|
export declare const ResponsiveLayout: Story;
|
|
11
|
+
export declare const AppearanceShowcase: Story;
|
|
12
12
|
//# sourceMappingURL=Tile.stories.d.ts.map
|