@ledgerhq/lumen-ui-rnative 0.0.46 → 0.0.47
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 +5 -1
- 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 +242 -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/Spot/types.d.ts +1 -1
- package/dist/src/lib/Components/Spot/types.d.ts.map +1 -1
- 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/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 +437 -181
- package/src/lib/Components/ListItem/index.ts +1 -1
- package/src/lib/Components/ListItem/types.ts +121 -0
- package/src/lib/Components/Spot/types.ts +5 -1
- package/src/lib/Components/Switch/Switch.mdx +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 → 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
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Settings, ChevronRight, Wallet } from '../../Symbols';
|
|
4
|
+
import { Switch } from '../Switch/Switch';
|
|
4
5
|
import { Tag } from '../Tag/Tag';
|
|
5
|
-
import { Box
|
|
6
|
-
import { ListItem } from './ListItem';
|
|
7
|
-
const Balance = ({ disabled }) => {
|
|
8
|
-
return (_jsxs(Box, { lx: { alignItems: 'flex-end' }, children: [_jsx(Text, { typography: 'body2SemiBold', lx: { color: disabled ? 'disabled' : 'base' }, children: "42.00" }), _jsx(Text, { typography: 'body3', lx: { color: disabled ? 'disabled' : 'muted' }, children: "USD" })] }));
|
|
9
|
-
};
|
|
6
|
+
import { Box } from '../Utility';
|
|
7
|
+
import { ListItem, ListItemLeading, ListItemContent, ListItemTitle, ListItemDescription, ListItemTrailing, ListItemSpot, ListItemIcon, ListItemTruncate, } from './ListItem';
|
|
10
8
|
const meta = {
|
|
11
9
|
component: ListItem,
|
|
12
10
|
title: 'Containment/ListItem',
|
|
11
|
+
subcomponents: {
|
|
12
|
+
ListItemLeading,
|
|
13
|
+
ListItemContent,
|
|
14
|
+
ListItemTitle,
|
|
15
|
+
ListItemDescription,
|
|
16
|
+
ListItemTrailing,
|
|
17
|
+
ListItemSpot,
|
|
18
|
+
ListItemIcon,
|
|
19
|
+
ListItemTruncate,
|
|
20
|
+
},
|
|
13
21
|
parameters: {
|
|
22
|
+
layout: 'padded',
|
|
23
|
+
backgrounds: { default: 'light' },
|
|
14
24
|
docs: {
|
|
15
25
|
source: {
|
|
16
26
|
language: 'tsx',
|
|
@@ -20,43 +30,9 @@ const meta = {
|
|
|
20
30
|
},
|
|
21
31
|
},
|
|
22
32
|
argTypes: {
|
|
23
|
-
|
|
24
|
-
control: '
|
|
25
|
-
description: '
|
|
26
|
-
},
|
|
27
|
-
description: {
|
|
28
|
-
control: 'text',
|
|
29
|
-
description: 'Optional description',
|
|
30
|
-
},
|
|
31
|
-
descriptionTag: {
|
|
32
|
-
control: 'select',
|
|
33
|
-
options: ['None', 'Tag'],
|
|
34
|
-
mapping: {
|
|
35
|
-
None: undefined,
|
|
36
|
-
Tag: _jsx(Tag, { label: 'New', appearance: 'accent', icon: Bolt, size: 'sm' }),
|
|
37
|
-
},
|
|
38
|
-
if: { arg: 'description', exists: true },
|
|
39
|
-
},
|
|
40
|
-
leadingContent: {
|
|
41
|
-
control: 'select',
|
|
42
|
-
options: ['None', 'Settings', 'Plus'],
|
|
43
|
-
mapping: {
|
|
44
|
-
None: undefined,
|
|
45
|
-
Settings: _jsx(Spot, { appearance: 'icon', icon: Settings }),
|
|
46
|
-
Plus: _jsx(Spot, { appearance: 'icon', icon: Plus }),
|
|
47
|
-
},
|
|
48
|
-
description: 'Optional leading content',
|
|
49
|
-
},
|
|
50
|
-
trailingContent: {
|
|
51
|
-
control: 'select',
|
|
52
|
-
description: 'Optional trailing content to display on the right side',
|
|
53
|
-
options: ['icon', 'value', 'tag', 'none'],
|
|
54
|
-
mapping: {
|
|
55
|
-
icon: _jsx(PenEdit, { size: 24 }),
|
|
56
|
-
value: _jsx(Balance, {}),
|
|
57
|
-
tag: _jsx(Tag, { label: 'New', appearance: 'accent' }),
|
|
58
|
-
none: undefined,
|
|
59
|
-
},
|
|
33
|
+
disabled: {
|
|
34
|
+
control: 'boolean',
|
|
35
|
+
description: 'Whether the list item is disabled',
|
|
60
36
|
},
|
|
61
37
|
onPress: {
|
|
62
38
|
action: 'pressed',
|
|
@@ -67,50 +43,64 @@ const meta = {
|
|
|
67
43
|
export default meta;
|
|
68
44
|
export const Base = {
|
|
69
45
|
args: {
|
|
70
|
-
title: 'Item with Icon and Description',
|
|
71
|
-
leadingContent: _jsx(Spot, { appearance: 'icon', icon: Settings }),
|
|
72
|
-
description: 'Additional information',
|
|
73
46
|
lx: { maxWidth: 's320' },
|
|
74
47
|
},
|
|
48
|
+
render: (args) => (_jsx(ListItem, { ...args, children: _jsxs(ListItemLeading, { children: [_jsx(ListItemSpot, { appearance: 'icon', icon: Settings }), _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "Item with Icon and Description" }), _jsx(ListItemDescription, { children: "Additional information" })] })] }) })),
|
|
75
49
|
parameters: {
|
|
76
50
|
docs: {
|
|
77
51
|
source: {
|
|
78
52
|
code: `
|
|
79
|
-
<ListItem
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
53
|
+
<ListItem>
|
|
54
|
+
<ListItemLeading>
|
|
55
|
+
<ListItemSpot appearance="icon" icon={Settings} />
|
|
56
|
+
<ListItemContent>
|
|
57
|
+
<ListItemTitle>Item with Icon and Description</ListItemTitle>
|
|
58
|
+
<ListItemDescription>Additional information</ListItemDescription>
|
|
59
|
+
</ListItemContent>
|
|
60
|
+
</ListItemLeading>
|
|
61
|
+
</ListItem>
|
|
84
62
|
`,
|
|
85
63
|
},
|
|
86
64
|
},
|
|
87
65
|
},
|
|
88
66
|
};
|
|
89
|
-
export const
|
|
90
|
-
args: {
|
|
91
|
-
title: 'Item with Description Tag',
|
|
92
|
-
leadingContent: _jsx(Spot, { appearance: 'icon', icon: Settings }),
|
|
93
|
-
description: 'Additional information',
|
|
94
|
-
descriptionTag: (_jsx(Tag, { label: 'New', appearance: 'accent', icon: Bolt, size: 'sm' })),
|
|
95
|
-
},
|
|
96
|
-
render: (args) => (_jsx(Box, { lx: { maxWidth: 's320' }, children: _jsx(ListItem, { ...args }) })),
|
|
97
|
-
};
|
|
98
|
-
export const TrailingContentVariantsShowcase = {
|
|
67
|
+
export const VariantsShowcase = {
|
|
99
68
|
render: () => {
|
|
100
|
-
|
|
69
|
+
const [selected, setSelected] = useState(false);
|
|
70
|
+
return (_jsxs(Box, { lx: { flexDirection: 'column', maxWidth: 's320', gap: 's8' }, children: [_jsx(ListItem, { children: _jsxs(ListItemLeading, { children: [_jsx(ListItemSpot, { appearance: 'icon', icon: Settings }), _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "Simple composition" }), _jsx(ListItemDescription, { children: "With description" })] })] }) }), _jsxs(ListItem, { onPress: () => setSelected(!selected), children: [_jsxs(ListItemLeading, { children: [_jsx(ListItemSpot, { appearance: 'icon', icon: Wallet }), _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "Switch Variant" }), _jsx(ListItemDescription, { children: "With description" })] })] }), _jsx(ListItemTrailing, { children: _jsx(Switch, { checked: selected, onCheckedChange: setSelected }) })] }), _jsxs(ListItem, { children: [_jsxs(ListItemLeading, { children: [_jsx(ListItemSpot, { appearance: 'icon', icon: Wallet }), _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "Content Variant" }), _jsx(ListItemDescription, { children: "With description" })] })] }), _jsx(ListItemTrailing, { children: _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "42.10" }), _jsx(ListItemDescription, { children: "USD" })] }) })] }), _jsxs(ListItem, { children: [_jsxs(ListItemLeading, { children: [_jsx(ListItemSpot, { appearance: 'icon', icon: Wallet }), _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "Content Variant" }), _jsx(ListItemDescription, { children: "Custom style" })] })] }), _jsx(ListItemTrailing, { children: _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "USD" }), _jsx(ListItemDescription, { lx: { color: 'error' }, children: "-7.53%" })] }) })] }), _jsxs(ListItem, { children: [_jsxs(ListItemLeading, { children: [_jsx(ListItemSpot, { appearance: 'icon', icon: Wallet }), _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "Content Variant" }), _jsx(ListItemDescription, { children: "Custom style" })] })] }), _jsx(ListItemTrailing, { children: _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "USD" }), _jsx(ListItemDescription, { lx: { color: 'success' }, children: "+7.53%" })] }) })] }), _jsxs(ListItem, { children: [_jsxs(ListItemLeading, { children: [_jsx(ListItemSpot, { appearance: 'icon', icon: Settings }), _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "Tag Variant" }), _jsx(ListItemDescription, { children: "Custom style" })] })] }), _jsx(ListItemTrailing, { children: _jsx(Tag, { size: 'sm', label: 'New', appearance: 'accent' }) })] }), _jsxs(ListItem, { children: [_jsxs(ListItemLeading, { children: [_jsx(ListItemSpot, { appearance: 'icon', icon: Settings }), _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "Icon Variant" }), _jsx(ListItemDescription, { children: "With description" })] })] }), _jsx(ListItemTrailing, { children: _jsx(ListItemIcon, { icon: ChevronRight }) })] }), _jsxs(ListItem, { children: [_jsxs(ListItemLeading, { children: [_jsx(ListItemIcon, { icon: Wallet }), _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "Icon without Spot" }), _jsx(ListItemDescription, { children: "Using ListItemIcon" })] })] }), _jsx(ListItemTrailing, { children: _jsx(ListItemIcon, { icon: ChevronRight }) })] }), _jsxs(ListItem, { children: [_jsxs(ListItemLeading, { children: [_jsx(ListItemSpot, { appearance: 'icon', icon: Wallet }), _jsxs(ListItemContent, { children: [_jsxs(ListItemTitle, { children: [_jsx(ListItemTruncate, { variant: 'title', children: "Complex 1" }), _jsx(Tag, { size: 'sm', label: 'New', appearance: 'base' })] }), _jsxs(ListItemDescription, { children: [_jsx(ListItemTruncate, { children: "With description" }), _jsx(Tag, { size: 'sm', label: 'Custom Tag', appearance: 'gray' })] })] })] }), _jsx(ListItemTrailing, { children: _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "42.10" }), _jsx(ListItemDescription, { children: "USD" })] }) })] }), _jsxs(ListItem, { children: [_jsxs(ListItemLeading, { children: [_jsx(ListItemSpot, { appearance: 'icon', icon: Wallet }), _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "Complex 2" }), _jsx(ListItemDescription, { children: "With description" })] })] }), _jsx(ListItemTrailing, { children: _jsxs(ListItemContent, { children: [_jsxs(ListItemTitle, { children: [_jsx(Tag, { size: 'sm', label: 'New', appearance: 'base' }), _jsx(ListItemTruncate, { variant: 'title', children: "1200.12" })] }), _jsx(ListItemDescription, { children: _jsx(Tag, { size: 'sm', label: 'BTC', appearance: 'gray' }) })] }) })] })] }));
|
|
101
71
|
},
|
|
102
72
|
};
|
|
103
|
-
export const
|
|
104
|
-
|
|
105
|
-
|
|
73
|
+
export const DisabledState = {
|
|
74
|
+
args: {
|
|
75
|
+
disabled: true,
|
|
76
|
+
},
|
|
77
|
+
render: (args) => (_jsxs(Box, { lx: { flexDirection: 'column', width: 's320' }, children: [_jsxs(ListItem, { ...args, children: [_jsxs(ListItemLeading, { children: [_jsx(ListItemSpot, { appearance: 'icon', icon: Settings }), _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "Disabled Item" }), _jsx(ListItemDescription, { children: "This item is disabled" })] })] }), _jsx(ListItemTrailing, { children: _jsx(Switch, { checked: false, disabled: args.disabled }) })] }), _jsxs(ListItem, { ...args, children: [_jsxs(ListItemLeading, { children: [_jsx(ListItemSpot, { appearance: 'icon', icon: Settings }), _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "Disabled Item" }), _jsx(ListItemDescription, { children: "This item is disabled" })] })] }), _jsx(ListItemTrailing, { children: _jsx(ListItemIcon, { icon: ChevronRight }) })] }), _jsxs(ListItem, { ...args, children: [_jsxs(ListItemLeading, { children: [_jsx(ListItemSpot, { appearance: 'icon', icon: Wallet }), _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "Content Variant" }), _jsx(ListItemDescription, { children: "With description" })] })] }), _jsx(ListItemTrailing, { children: _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "42.10" }), _jsx(ListItemDescription, { children: "USD" })] }) })] }), _jsx(ListItem, { ...args, children: _jsxs(ListItemLeading, { children: [_jsx(ListItemIcon, { icon: Wallet }), _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "Icon without Spot" }), _jsx(ListItemDescription, { children: "Using ListItemIcon" })] })] }) })] })),
|
|
78
|
+
parameters: {
|
|
79
|
+
docs: {
|
|
80
|
+
source: {
|
|
81
|
+
code: `
|
|
82
|
+
<ListItem disabled>
|
|
83
|
+
<ListItemLeading>
|
|
84
|
+
<ListItemSpot appearance="icon" icon={Settings} />
|
|
85
|
+
<ListItemContent>
|
|
86
|
+
<ListItemTitle>Disabled Item</ListItemTitle>
|
|
87
|
+
<ListItemDescription>This item is disabled</ListItemDescription>
|
|
88
|
+
</ListItemContent>
|
|
89
|
+
</ListItemLeading>
|
|
90
|
+
<ListItemTrailing>
|
|
91
|
+
<ChevronRight size={24} />
|
|
92
|
+
</ListItemTrailing>
|
|
93
|
+
</ListItem>
|
|
94
|
+
`,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
106
97
|
},
|
|
107
98
|
};
|
|
108
99
|
export const ResponsiveLayout = {
|
|
109
|
-
render: () => {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
},
|
|
100
|
+
render: () => (_jsx(Box, { lx: {
|
|
101
|
+
width: 's400',
|
|
102
|
+
borderWidth: 's1',
|
|
103
|
+
borderColor: 'mutedSubtle',
|
|
104
|
+
padding: 's16',
|
|
105
|
+
}, children: _jsxs(Box, { lx: { flexDirection: 'column' }, children: [_jsxs(ListItem, { children: [_jsxs(ListItemLeading, { children: [_jsx(ListItemSpot, { appearance: 'icon', icon: Settings }), _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "Short Title" }), _jsx(ListItemDescription, { children: "Short description" })] })] }), _jsx(ListItemTrailing, { children: _jsx(ListItemIcon, { icon: ChevronRight }) })] }), _jsxs(ListItem, { children: [_jsxs(ListItemLeading, { children: [_jsx(ListItemSpot, { appearance: 'icon', icon: Settings }), _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "Long Title that should truncate appropriately" }), _jsx(ListItemDescription, { children: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, quos." })] })] }), _jsx(ListItemTrailing, { children: _jsx(ListItemIcon, { icon: ChevronRight }) })] }), _jsxs(ListItem, { children: [_jsxs(ListItemLeading, { children: [_jsx(ListItemSpot, { appearance: 'icon', icon: Wallet }), _jsxs(ListItemContent, { children: [_jsxs(ListItemTitle, { children: [_jsx(ListItemTruncate, { variant: 'title', children: "Long Title that should truncate appropriately" }), _jsx(Tag, { size: 'sm', label: 'New', appearance: 'base' })] }), _jsxs(ListItemDescription, { children: [_jsx(ListItemTruncate, { children: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam, quos." }), _jsx(Tag, { size: 'sm', label: 'Custom Tag', appearance: 'gray' })] })] })] }), _jsx(ListItemTrailing, { children: _jsxs(ListItemContent, { children: [_jsx(ListItemTitle, { children: "42.10" }), _jsx(ListItemDescription, { children: "USD" })] }) })] })] }) })),
|
|
116
106
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/ListItem/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/ListItem/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './ListItem';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './types';
|
|
@@ -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.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/ListItem/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,eAAe,EAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;CAC3C,GAAG,IAAI,CAAC,oBAAoB,EAAE,UAAU,GAAG,UAAU,CAAC,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,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"}
|
|
@@ -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":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,WAAW,GACX,OAAO,GACP,OAAO,GACP,SAAS,GACT,MAAM,GACN,QAAQ,GACR,QAAQ,CAAC;AAEb,KAAK,aAAa,GAAG;IACnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,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,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Spot/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,WAAW,GACX,OAAO,GACP,OAAO,GACP,SAAS,GACT,MAAM,GACN,QAAQ,GACR,QAAQ,CAAC;AAEb,KAAK,aAAa,GAAG;IACnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,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,8 +1,7 @@
|
|
|
1
1
|
export * from './constants';
|
|
2
2
|
export * from './components';
|
|
3
3
|
export * from './react';
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './start-transition';
|
|
4
|
+
export * from './useControllableState';
|
|
5
|
+
export * from './useEvent';
|
|
6
|
+
export * from './startTransition';
|
|
8
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from './constants';
|
|
2
2
|
export * from './components';
|
|
3
3
|
export * from './react';
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './start-transition';
|
|
4
|
+
export * from './useControllableState';
|
|
5
|
+
export * from './useEvent';
|
|
6
|
+
export * from './startTransition';
|
package/dist/src/lib/utils/react/{extract-text-from-children.d.ts → extractTextFromChildren.d.ts}
RENAMED
|
@@ -5,4 +5,4 @@ import React from 'react';
|
|
|
5
5
|
* ignoring complex React components that don't have text children.
|
|
6
6
|
*/
|
|
7
7
|
export declare function extractTextFromChildren(children: React.ReactNode, textComponentType?: React.ComponentType<any>): string;
|
|
8
|
-
//# sourceMappingURL=
|
|
8
|
+
//# sourceMappingURL=extractTextFromChildren.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractTextFromChildren.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/react/extractTextFromChildren.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GAC3C,MAAM,CAoBR"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './extractTextFromChildren';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/react/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/react/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './extractTextFromChildren';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/startTransition/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './startTransition';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const startTransition: (callback: React.TransitionFunction) => void;
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=startTransition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"startTransition.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/startTransition/startTransition.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,GAAI,UAAU,KAAK,CAAC,kBAAkB,KAAG,IAQpE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/useControllableState/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useControllableState';
|
|
@@ -12,4 +12,4 @@ export declare function useControllableState<T>({ prop, defaultProp, onChange, s
|
|
|
12
12
|
transition?: boolean;
|
|
13
13
|
}): [T, React.Dispatch<React.SetStateAction<T>>];
|
|
14
14
|
export {};
|
|
15
|
-
//# sourceMappingURL=
|
|
15
|
+
//# sourceMappingURL=useControllableState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useControllableState.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/useControllableState/useControllableState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,KAAK,QAAQ,CAAC,CAAC,IACX,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC,GACnB,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AAI5C;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,EACtC,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,QAAsB,EACtB,UAAU,GACX,EAAE;IACD,IAAI,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;IACrB,WAAW,EAAE,CAAC,CAAC;IACf,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACvB,QAAQ,CAAC,EAAE,WAAW,GAAG,kBAAkB,CAAC;IAC5C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAsC/C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { startTransition } from '../
|
|
3
|
-
import { useEvent } from '../
|
|
2
|
+
import { startTransition } from '../startTransition';
|
|
3
|
+
import { useEvent } from '../useEvent';
|
|
4
4
|
const emptyCallbackFn = (_) => _();
|
|
5
5
|
/**
|
|
6
6
|
* Allow to use a controlled or uncontrolled state.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/useEvent/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEvent.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/useEvent/useEvent.ts"],"names":[],"mappings":"AAEA,KAAK,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAE3C,wBAAgB,QAAQ,CAAC,CAAC,SAAS,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAE/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGet.d.ts","sourceRoot":"","sources":["../../../../../src/lib/utils/useEvent/useGet.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,EACtB,YAAY,EAAE,CAAC,EACf,YAAY,CAAC,EAAE,GAAG,EAClB,iBAAiB,CAAC,EAAE,OAAO,GAC1B,MAAM,CAAC,CAYT"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { ColorSchemeName } from 'react-native';
|
|
3
3
|
import { type LumenStyleSheetTheme } from '../types';
|
|
4
|
-
import { LumenStyleSheetProviderProps } from './types';
|
|
4
|
+
import { type LumenStyleSheetProviderProps } from './types';
|
|
5
5
|
export type LumenStyleSheetContextValue = {
|
|
6
6
|
theme: LumenStyleSheetTheme;
|
|
7
7
|
colorScheme: ColorSchemeName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LumenStyleSheetProvider.d.ts","sourceRoot":"","sources":["../../../../src/styles/provider/LumenStyleSheetProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAsB,MAAM,OAAO,CAAC;AAC/C,OAAO,EAEL,eAAe,EAEhB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"LumenStyleSheetProvider.d.ts","sourceRoot":"","sources":["../../../../src/styles/provider/LumenStyleSheetProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAsB,MAAM,OAAO,CAAC;AAC/C,OAAO,EAEL,eAAe,EAEhB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAM5D,MAAM,MAAM,2BAA2B,GAAG;IACxC,KAAK,EAAE,oBAAoB,CAAC;IAC5B,WAAW,EAAE,eAAe,CAAC;IAC7B,cAAc,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;IAClD,iBAAiB,EAAE,MAAM,IAAI,CAAC;CAC/B,CAAC;AAKF,eAAO,MAAM,yBAAyB;;;uGAA6B,CAAC;AAEpE,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC,4BAA4B,CA+CpE,CAAC"}
|
|
@@ -2,8 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { createSafeContext } from '@ledgerhq/lumen-utils-shared';
|
|
3
3
|
import { useEffect, useMemo } from 'react';
|
|
4
4
|
import { Appearance, useColorScheme as useReactNativeColorScheme, } from 'react-native';
|
|
5
|
-
import { RuntimeConstants } from '../../lib/utils';
|
|
6
|
-
import { useControllableState } from '../../lib/utils/use-controllable-state/use-controllable-state';
|
|
5
|
+
import { RuntimeConstants, useControllableState } from '../../lib/utils';
|
|
7
6
|
import { createStylesheetTheme } from '../theme/createStylesheetTheme';
|
|
8
7
|
const DARK_MODE = 'dark';
|
|
9
8
|
const LIGHT_MODE = 'light';
|
package/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": {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Meta, Story, Canvas, Controls } from '@storybook/addon-docs/blocks';
|
|
2
2
|
import * as CheckboxStories from './Checkbox.stories';
|
|
3
3
|
import { Checkbox } from './Checkbox';
|
|
4
|
+
import { Box } from '../Utility';
|
|
4
5
|
import { CustomTabs, Tab } from '../../../../.storybook/components';
|
|
5
6
|
import { DoVsDontRow, DoBlockItem, DontBlockItem } from '../../../../.storybook/components/DoVsDont';
|
|
6
7
|
import CommonRulesDoAndDont from '../../../../.storybook/components/DoVsDont/CommonRulesDoAndDont.mdx';
|
|
@@ -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
|
|
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
|
|