@ledgerhq/native-ui 0.36.0-nightly.1 → 0.36.0
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/lib/components/cta/QuickAction/QuickActionList/index.d.ts.map +1 -1
- package/lib/components/cta/QuickAction/QuickActionList/index.js +6 -3
- package/package.json +11 -24
- package/lib/pre-ldls/components/Input/Input.d.ts +0 -11
- package/lib/pre-ldls/components/Input/Input.d.ts.map +0 -1
- package/lib/pre-ldls/components/Input/Input.js +0 -38
- package/lib/pre-ldls/components/Input/Input.stories.d.ts +0 -9
- package/lib/pre-ldls/components/Input/Input.stories.d.ts.map +0 -1
- package/lib/pre-ldls/components/Input/Input.stories.js +0 -32
- package/lib/pre-ldls/components/index.d.ts +0 -2
- package/lib/pre-ldls/components/index.d.ts.map +0 -1
- package/lib/pre-ldls/components/index.js +0 -1
- package/lib/pre-ldls/index.d.ts +0 -2
- package/lib/pre-ldls/index.d.ts.map +0 -1
- package/lib/pre-ldls/index.js +0 -1
- package/lib/pre-ldls/libs/design-tokens.d.ts +0 -776
- package/lib/pre-ldls/libs/design-tokens.d.ts.map +0 -1
- package/lib/pre-ldls/libs/design-tokens.js +0 -961
- package/lib/pre-ldls/libs/index.d.ts +0 -31
- package/lib/pre-ldls/libs/index.d.ts.map +0 -1
- package/lib/pre-ldls/libs/index.js +0 -51
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/cta/QuickAction/QuickActionList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAY,aAAa,EAAQ,MAAM,cAAc,CAAC;AAE7D,OAA0B,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEjF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,aAAa,CAAC,sBAAsB,CAAC,EAAE,YAAY,CAAC,GAAG;IAC7F,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,QAAA,MAAM,eAAe,8DAOlB,oBAAoB,KAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/cta/QuickAction/QuickActionList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAY,aAAa,EAAQ,MAAM,cAAc,CAAC;AAE7D,OAA0B,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEjF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,aAAa,CAAC,sBAAsB,CAAC,EAAE,YAAY,CAAC,GAAG;IAC7F,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,QAAA,MAAM,eAAe,8DAOlB,oBAAoB,KAAG,MAAM,YA6B/B,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -3,11 +3,14 @@ import { FlatList, View } from "react-native";
|
|
|
3
3
|
import QuickActionButton from "../QuickActionButton";
|
|
4
4
|
const QuickActionList = ({ numColumns = 3, data, id, testID, isActive = false, ...otherProps }) => {
|
|
5
5
|
const renderItem = useCallback(({ item, index }) => {
|
|
6
|
+
const isNotLastColumn = (index + 1) % numColumns > 0;
|
|
7
|
+
const isNotLastItem = data && index !== data.length - 1;
|
|
8
|
+
const hasButtonToItsRight = isNotLastColumn && isNotLastItem;
|
|
6
9
|
const hasRowBelow = data?.length && index + numColumns < data.length;
|
|
10
|
+
const mr = hasButtonToItsRight ? 4 : 0;
|
|
7
11
|
const mb = hasRowBelow ? 4 : 0;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
React.createElement(QuickActionButton, { ...item, isActive: isActive, mb: mb, testID: testID })));
|
|
12
|
+
return (React.createElement(View, { style: { flex: 1, minHeight: 30 } },
|
|
13
|
+
React.createElement(QuickActionButton, { ...item, isActive: isActive, mr: mr, mb: mb, testID: testID })));
|
|
11
14
|
}, []);
|
|
12
15
|
return (React.createElement(FlatList, { ...otherProps, data: data, keyExtractor: (_item, index) => `${id}${index}`, horizontal: false, renderItem: renderItem, numColumns: numColumns }));
|
|
13
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/native-ui",
|
|
3
|
-
"version": "0.36.0
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "Ledger Live - Mobile UI",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"react-native-modal": "14.0.0-rc.1",
|
|
40
40
|
"rn-range-slider": "2.1.1",
|
|
41
41
|
"styled-system": "^5.1.5",
|
|
42
|
-
"@ledgerhq/crypto-icons-ui": "^1.15.0
|
|
43
|
-
"@ledgerhq/icons-ui": "^0.11.0
|
|
42
|
+
"@ledgerhq/crypto-icons-ui": "^1.15.0",
|
|
43
|
+
"@ledgerhq/icons-ui": "^0.11.0",
|
|
44
44
|
"@ledgerhq/ui-shared": "^0.3.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
"@babel/runtime": "7.27.1",
|
|
65
65
|
"@emotion/core": "^11.0.0",
|
|
66
66
|
"@emotion/native": "^11.0.0",
|
|
67
|
-
"@expo/cli": "0.24.14",
|
|
68
67
|
"@expo/metro-config": "^0.19.11",
|
|
69
68
|
"@expo/webpack-config": "19.0.1",
|
|
70
69
|
"@react-native-async-storage/async-storage": "2.1.2",
|
|
@@ -75,31 +74,23 @@
|
|
|
75
74
|
"@storybook/addon-actions": "^7.6.18",
|
|
76
75
|
"@storybook/addon-controls": "^7.6.18",
|
|
77
76
|
"@storybook/addon-essentials": "^7.6.18",
|
|
78
|
-
"@storybook/addon-interactions": "^7.6.18",
|
|
79
77
|
"@storybook/addon-links": "^7.6.18",
|
|
80
|
-
"@storybook/addon-ondevice-actions": "
|
|
81
|
-
"@storybook/addon-ondevice-backgrounds": "
|
|
82
|
-
"@storybook/addon-ondevice-controls": "
|
|
83
|
-
"@storybook/addon-ondevice-notes": "
|
|
78
|
+
"@storybook/addon-ondevice-actions": "6.5.7",
|
|
79
|
+
"@storybook/addon-ondevice-backgrounds": "6.5.7",
|
|
80
|
+
"@storybook/addon-ondevice-controls": "6.5.7",
|
|
81
|
+
"@storybook/addon-ondevice-notes": "6.5.7",
|
|
84
82
|
"@storybook/addon-react-native-web": "^0.0.21",
|
|
85
83
|
"@storybook/blocks": "^7.6.18",
|
|
86
84
|
"@storybook/docs-tools": "^7.6.18",
|
|
87
|
-
"@storybook/jest": "0.2.3",
|
|
88
85
|
"@storybook/manager-api": "7.6.18",
|
|
89
|
-
"@storybook/react": "^7.6.
|
|
90
|
-
"@storybook/react-native": "
|
|
86
|
+
"@storybook/react": "^7.6.18",
|
|
87
|
+
"@storybook/react-native": "6.5.7",
|
|
91
88
|
"@storybook/react-webpack5": "^7.6.18",
|
|
92
|
-
"@storybook/test": "7.6.20",
|
|
93
|
-
"@storybook/testing-library": "0.2.2",
|
|
94
89
|
"@svgr/core": "^5.5.0",
|
|
95
90
|
"@svgr/plugin-jsx": "^5.5.0",
|
|
96
91
|
"@svgr/plugin-svgo": "^5.5.0",
|
|
97
|
-
"@testing-library/dom": "10.4.0",
|
|
98
|
-
"@testing-library/jest-dom": "6.6.3",
|
|
99
|
-
"@testing-library/user-event": "14.5.2",
|
|
100
92
|
"@types/color": "^3.0.3",
|
|
101
93
|
"@types/hoist-non-react-statics": "^3.3.1",
|
|
102
|
-
"@types/lodash": "4.17.18",
|
|
103
94
|
"@types/node": "^22.10.10",
|
|
104
95
|
"@types/prop-types": "^15.7.5",
|
|
105
96
|
"@types/react": "^18.2.21",
|
|
@@ -117,7 +108,7 @@
|
|
|
117
108
|
"csstype": "^3.0.11",
|
|
118
109
|
"eslint-plugin-react": "^7.33.2",
|
|
119
110
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
120
|
-
"eslint-plugin-storybook": "^0.
|
|
111
|
+
"eslint-plugin-storybook": "^0.6.15",
|
|
121
112
|
"expo": "52.0.46",
|
|
122
113
|
"expo-asset": "8.10.1",
|
|
123
114
|
"expo-constants": "17.1.6",
|
|
@@ -125,7 +116,6 @@
|
|
|
125
116
|
"expo-modules-core": "2.2.3",
|
|
126
117
|
"fs-extra": "^10.0.1",
|
|
127
118
|
"glob": "^7.2.0",
|
|
128
|
-
"lodash": "4.17.21",
|
|
129
119
|
"metro": "0.81.5",
|
|
130
120
|
"metro-config": "0.81.5",
|
|
131
121
|
"metro-core": "0.81.5",
|
|
@@ -137,7 +127,6 @@
|
|
|
137
127
|
"metro-source-map": "0.81.5",
|
|
138
128
|
"metro-transform-worker": "0.81.5",
|
|
139
129
|
"minimatch": "^5.1.0",
|
|
140
|
-
"os-browserify": "0.3.0",
|
|
141
130
|
"prop-types": "^15.8.1",
|
|
142
131
|
"react": "^18.2.0",
|
|
143
132
|
"react-dom": "^18.2.0",
|
|
@@ -156,7 +145,6 @@
|
|
|
156
145
|
"stylelint-config-recommended": "^13.0.0",
|
|
157
146
|
"stylelint-config-styled-components": "^0.1.1",
|
|
158
147
|
"stylelint-processor-styled-components": "^1.10.0",
|
|
159
|
-
"tty-browserify": "0.0.1",
|
|
160
148
|
"util": "^0.12.5",
|
|
161
149
|
"webpack": "^5.76.1",
|
|
162
150
|
"webpack-dev-server": "^4.12.0"
|
|
@@ -179,7 +167,6 @@
|
|
|
179
167
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
180
168
|
"test": "exit 0",
|
|
181
169
|
"web": "expo start --web",
|
|
182
|
-
"unimported": "pnpm knip --directory ../../../.. -W libs/ui/packages/native"
|
|
183
|
-
"storybook-generate": "sb-rn-get-stories"
|
|
170
|
+
"unimported": "pnpm knip --directory ../../../.. -W libs/ui/packages/native"
|
|
184
171
|
}
|
|
185
172
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { TextInput } from "react-native";
|
|
3
|
-
export type IconProps = {
|
|
4
|
-
size?: "XS" | "S" | "M" | "L" | "XL" | "XXL";
|
|
5
|
-
color?: string;
|
|
6
|
-
style?: object;
|
|
7
|
-
};
|
|
8
|
-
export declare const Input: React.ForwardRefExoticComponent<import("react-native").TextInputProps & {
|
|
9
|
-
icon?: (({ size }: IconProps) => JSX.Element) | undefined;
|
|
10
|
-
} & React.RefAttributes<TextInput>>;
|
|
11
|
-
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAQ,MAAM,cAAc,CAAC;AAI/C,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,KAAK,CAAC;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAkCF,eAAO,MAAM,KAAK;uBA/BE,SAAS,KAAK,WAAW;mCA2C3C,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React, { useContext } from "react";
|
|
2
|
-
import { TextInput, View } from "react-native";
|
|
3
|
-
import styled, { ThemeContext } from "styled-components/native";
|
|
4
|
-
import { useTokens } from "../../libs";
|
|
5
|
-
const Wrapper = styled(View) `
|
|
6
|
-
height: 40px;
|
|
7
|
-
min-width: 328px;
|
|
8
|
-
padding-horizontal: ${({ tokens }) => tokens["spacing-s"]}px;
|
|
9
|
-
align-items: center;
|
|
10
|
-
flex-direction: row;
|
|
11
|
-
gap: ${({ tokens }) => tokens["spacing-xxs"]}px;
|
|
12
|
-
border-radius: ${({ tokens }) => tokens["radius-s"]}px;
|
|
13
|
-
background-color: ${({ tokens }) => tokens["colors-surface-transparent-subdued-default"]};
|
|
14
|
-
overflow: hidden;
|
|
15
|
-
color: ${({ tokens }) => tokens["colors-content-subdued-default-default"]};
|
|
16
|
-
`;
|
|
17
|
-
const StyledInput = styled(TextInput) `
|
|
18
|
-
flex: 1;
|
|
19
|
-
background-color: transparent;
|
|
20
|
-
border-width: 0;
|
|
21
|
-
color: ${({ tokens }) => tokens["colors-content-subdued-default-default"]};
|
|
22
|
-
`;
|
|
23
|
-
const TOKEN_KEYS = [
|
|
24
|
-
"spacing-s",
|
|
25
|
-
"spacing-xxs",
|
|
26
|
-
"radius-s",
|
|
27
|
-
"colors-surface-transparent-subdued-default",
|
|
28
|
-
"colors-content-subdued-default-default",
|
|
29
|
-
];
|
|
30
|
-
export const Input = React.forwardRef(({ icon: Icon, ...props }, ref) => {
|
|
31
|
-
const theme = useContext(ThemeContext);
|
|
32
|
-
const themeType = theme?.colors?.type ?? "light";
|
|
33
|
-
const tokens = useTokens(themeType, [...TOKEN_KEYS]);
|
|
34
|
-
return (React.createElement(Wrapper, { tokens: tokens },
|
|
35
|
-
!!Icon && React.createElement(Icon, { color: String(tokens["colors-content-subdued-default-default"]) }),
|
|
36
|
-
React.createElement(StyledInput, { ...props, ref: ref, tokens: tokens })));
|
|
37
|
-
});
|
|
38
|
-
Input.displayName = "Input";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Input } from "./Input";
|
|
3
|
-
declare const meta: Meta<typeof Input>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof Input>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const Search: Story;
|
|
8
|
-
export declare const WithInteraction: Story;
|
|
9
|
-
//# sourceMappingURL=Input.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Input.stories.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/Input/Input.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,KAAK,EAAa,MAAM,SAAS,CAAC;AAE3C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,KAAK,CAK5B,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,KAAK,CAAC,CAAC;AAEpC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAKpB,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,KAU7B,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { within, userEvent } from "@storybook/testing-library";
|
|
3
|
-
import { expect } from "@storybook/jest";
|
|
4
|
-
import { Icons } from "../../../assets";
|
|
5
|
-
import { Input } from "./Input";
|
|
6
|
-
const meta = {
|
|
7
|
-
component: Input,
|
|
8
|
-
title: "PreLdls/Components/Input",
|
|
9
|
-
tags: ["autodocs"],
|
|
10
|
-
args: {},
|
|
11
|
-
};
|
|
12
|
-
export default meta;
|
|
13
|
-
export const Default = {
|
|
14
|
-
args: {},
|
|
15
|
-
};
|
|
16
|
-
export const Search = {
|
|
17
|
-
args: {
|
|
18
|
-
placeholder: "Search",
|
|
19
|
-
icon: (props) => React.createElement(Icons.Search, { size: "S", ...props }),
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
// Interaction Testing
|
|
23
|
-
export const WithInteraction = {
|
|
24
|
-
args: {},
|
|
25
|
-
controls: { expanded: true },
|
|
26
|
-
play: async ({ canvasElement }) => {
|
|
27
|
-
const canvas = within(canvasElement);
|
|
28
|
-
const input = canvas.getByRole("textbox");
|
|
29
|
-
await userEvent.type(input, "Write something");
|
|
30
|
-
expect(input).toHaveValue("Write something");
|
|
31
|
-
},
|
|
32
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pre-ldls/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./Input/Input";
|
package/lib/pre-ldls/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pre-ldls/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
package/lib/pre-ldls/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./components";
|