@ledgerhq/native-ui 0.36.0-next.0 → 0.36.0-nightly.1
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 +3 -6
- package/lib/pre-ldls/components/Input/Input.d.ts +11 -0
- package/lib/pre-ldls/components/Input/Input.d.ts.map +1 -0
- package/lib/pre-ldls/components/Input/Input.js +38 -0
- package/lib/pre-ldls/components/Input/Input.stories.d.ts +9 -0
- package/lib/pre-ldls/components/Input/Input.stories.d.ts.map +1 -0
- package/lib/pre-ldls/components/Input/Input.stories.js +32 -0
- package/lib/pre-ldls/components/index.d.ts +2 -0
- package/lib/pre-ldls/components/index.d.ts.map +1 -0
- package/lib/pre-ldls/components/index.js +1 -0
- package/lib/pre-ldls/index.d.ts +2 -0
- package/lib/pre-ldls/index.d.ts.map +1 -0
- package/lib/pre-ldls/index.js +1 -0
- package/lib/pre-ldls/libs/design-tokens.d.ts +776 -0
- package/lib/pre-ldls/libs/design-tokens.d.ts.map +1 -0
- package/lib/pre-ldls/libs/design-tokens.js +961 -0
- package/lib/pre-ldls/libs/index.d.ts +31 -0
- package/lib/pre-ldls/libs/index.d.ts.map +1 -0
- package/lib/pre-ldls/libs/index.js +51 -0
- package/package.json +24 -11
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import { ModeColors, SpacingScale } from "./design-tokens";
|
|
3
|
+
declare const overrideOther: {
|
|
4
|
+
readonly "radius-s": "8px";
|
|
5
|
+
readonly "radius-xs": "4px";
|
|
6
|
+
readonly "border-width-default": "1px";
|
|
7
|
+
readonly "border-width-focus": "2px";
|
|
8
|
+
readonly "margin-xs": "8px";
|
|
9
|
+
readonly "margin-s": "16px";
|
|
10
|
+
readonly "margin-m": "24px";
|
|
11
|
+
readonly "margin-l": "32px";
|
|
12
|
+
readonly "spacing-xs": "12px";
|
|
13
|
+
readonly "spacing-xxs": "8px";
|
|
14
|
+
};
|
|
15
|
+
declare const overrideColor: {
|
|
16
|
+
readonly light: {
|
|
17
|
+
readonly "surface-transparent-hover": "#0000000D";
|
|
18
|
+
readonly "surface-transparent-pressed": "#0000001A";
|
|
19
|
+
readonly "border-subdued-default-hover": "#D5D5D5";
|
|
20
|
+
readonly "border-subdued-default-pressed": "#C1C1C1";
|
|
21
|
+
};
|
|
22
|
+
readonly dark: {
|
|
23
|
+
readonly "opacity-default-10": "#FFFFFF1A";
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export type Tokens = Record<string, string | number>;
|
|
27
|
+
type ColorToken = `colors-${keyof ModeColors}` | `colors-${keyof typeof overrideColor.light}` | `colors-${keyof typeof overrideColor.dark}`;
|
|
28
|
+
type OtherToken = keyof (SpacingScale & typeof overrideOther);
|
|
29
|
+
export declare const useTokens: ((theme: "dark" | "light", usedTokens: Array<ColorToken | OtherToken>) => Tokens) & import("lodash").MemoizedFunction;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pre-ldls/libs/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAe,UAAU,EAAW,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAGjF,QAAA,MAAM,aAAa;;;;;;;;;;;CAWT,CAAC;AAEX,QAAA,MAAM,aAAa;;;;;;;;;;CAUT,CAAC;AAEX,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAErD,KAAK,UAAU,GACX,UAAU,MAAM,UAAU,EAAE,GAC5B,UAAU,MAAM,OAAO,aAAa,CAAC,KAAK,EAAE,GAC5C,UAAU,MAAM,OAAO,aAAa,CAAC,IAAI,EAAE,CAAC;AAChD,KAAK,UAAU,GAAG,MAAM,CAAC,YAAY,GAAG,OAAO,aAAa,CAAC,CAAC;AAM9D,eAAO,MAAM,SAAS,WACZ,MAAM,GAAG,OAAO,cAAc,MAAM,UAAU,GAAG,UAAU,CAAC,gDA2BrE,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import memoize from "lodash/memoize";
|
|
2
|
+
import { dark, light, spacing } from "./design-tokens";
|
|
3
|
+
// Override manquants
|
|
4
|
+
const overrideOther = {
|
|
5
|
+
"radius-s": "8px",
|
|
6
|
+
"radius-xs": "4px",
|
|
7
|
+
"border-width-default": "1px",
|
|
8
|
+
"border-width-focus": "2px",
|
|
9
|
+
"margin-xs": "8px",
|
|
10
|
+
"margin-s": "16px",
|
|
11
|
+
"margin-m": "24px",
|
|
12
|
+
"margin-l": "32px",
|
|
13
|
+
"spacing-xs": "12px",
|
|
14
|
+
"spacing-xxs": "8px",
|
|
15
|
+
};
|
|
16
|
+
const overrideColor = {
|
|
17
|
+
light: {
|
|
18
|
+
"surface-transparent-hover": "#0000000D",
|
|
19
|
+
"surface-transparent-pressed": "#0000001A",
|
|
20
|
+
"border-subdued-default-hover": "#D5D5D5",
|
|
21
|
+
"border-subdued-default-pressed": "#C1C1C1",
|
|
22
|
+
},
|
|
23
|
+
dark: {
|
|
24
|
+
"opacity-default-10": "#FFFFFF1A",
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
function pxToNumber(value) {
|
|
28
|
+
return Number(value.replace("px", ""));
|
|
29
|
+
}
|
|
30
|
+
export const useTokens = memoize((theme, usedTokens) => {
|
|
31
|
+
const usedSet = new Set(usedTokens);
|
|
32
|
+
const colors = {
|
|
33
|
+
dark: { ...dark, ...overrideColor.dark },
|
|
34
|
+
light: { ...light, ...overrideColor.light },
|
|
35
|
+
}[theme];
|
|
36
|
+
const tokens = {};
|
|
37
|
+
Object.entries(colors).forEach(([key, value]) => {
|
|
38
|
+
const colorKey = `colors-${key}`;
|
|
39
|
+
if (usedSet.has(colorKey)) {
|
|
40
|
+
tokens[colorKey] = value;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
[spacing, overrideOther].forEach((obj) => {
|
|
44
|
+
Object.entries(obj).forEach(([key, value]) => {
|
|
45
|
+
if (usedSet.has(key)) {
|
|
46
|
+
tokens[key] = pxToNumber(value);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
return tokens;
|
|
51
|
+
});
|
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-nightly.1",
|
|
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-nightly.0",
|
|
43
|
+
"@ledgerhq/icons-ui": "^0.11.0-nightly.0",
|
|
44
44
|
"@ledgerhq/ui-shared": "^0.3.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
@@ -64,6 +64,7 @@
|
|
|
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",
|
|
67
68
|
"@expo/metro-config": "^0.19.11",
|
|
68
69
|
"@expo/webpack-config": "19.0.1",
|
|
69
70
|
"@react-native-async-storage/async-storage": "2.1.2",
|
|
@@ -74,23 +75,31 @@
|
|
|
74
75
|
"@storybook/addon-actions": "^7.6.18",
|
|
75
76
|
"@storybook/addon-controls": "^7.6.18",
|
|
76
77
|
"@storybook/addon-essentials": "^7.6.18",
|
|
78
|
+
"@storybook/addon-interactions": "^7.6.18",
|
|
77
79
|
"@storybook/addon-links": "^7.6.18",
|
|
78
|
-
"@storybook/addon-ondevice-actions": "6.
|
|
79
|
-
"@storybook/addon-ondevice-backgrounds": "6.
|
|
80
|
-
"@storybook/addon-ondevice-controls": "6.
|
|
81
|
-
"@storybook/addon-ondevice-notes": "6.
|
|
80
|
+
"@storybook/addon-ondevice-actions": "^7.6.10",
|
|
81
|
+
"@storybook/addon-ondevice-backgrounds": "^7.6.10",
|
|
82
|
+
"@storybook/addon-ondevice-controls": "^7.6.10",
|
|
83
|
+
"@storybook/addon-ondevice-notes": "^7.6.10",
|
|
82
84
|
"@storybook/addon-react-native-web": "^0.0.21",
|
|
83
85
|
"@storybook/blocks": "^7.6.18",
|
|
84
86
|
"@storybook/docs-tools": "^7.6.18",
|
|
87
|
+
"@storybook/jest": "0.2.3",
|
|
85
88
|
"@storybook/manager-api": "7.6.18",
|
|
86
|
-
"@storybook/react": "^7.6.
|
|
87
|
-
"@storybook/react-native": "6.
|
|
89
|
+
"@storybook/react": "^7.6.20",
|
|
90
|
+
"@storybook/react-native": "^7.6.10",
|
|
88
91
|
"@storybook/react-webpack5": "^7.6.18",
|
|
92
|
+
"@storybook/test": "7.6.20",
|
|
93
|
+
"@storybook/testing-library": "0.2.2",
|
|
89
94
|
"@svgr/core": "^5.5.0",
|
|
90
95
|
"@svgr/plugin-jsx": "^5.5.0",
|
|
91
96
|
"@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",
|
|
92
100
|
"@types/color": "^3.0.3",
|
|
93
101
|
"@types/hoist-non-react-statics": "^3.3.1",
|
|
102
|
+
"@types/lodash": "4.17.18",
|
|
94
103
|
"@types/node": "^22.10.10",
|
|
95
104
|
"@types/prop-types": "^15.7.5",
|
|
96
105
|
"@types/react": "^18.2.21",
|
|
@@ -108,7 +117,7 @@
|
|
|
108
117
|
"csstype": "^3.0.11",
|
|
109
118
|
"eslint-plugin-react": "^7.33.2",
|
|
110
119
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
111
|
-
"eslint-plugin-storybook": "^0.
|
|
120
|
+
"eslint-plugin-storybook": "^0.12.0",
|
|
112
121
|
"expo": "52.0.46",
|
|
113
122
|
"expo-asset": "8.10.1",
|
|
114
123
|
"expo-constants": "17.1.6",
|
|
@@ -116,6 +125,7 @@
|
|
|
116
125
|
"expo-modules-core": "2.2.3",
|
|
117
126
|
"fs-extra": "^10.0.1",
|
|
118
127
|
"glob": "^7.2.0",
|
|
128
|
+
"lodash": "4.17.21",
|
|
119
129
|
"metro": "0.81.5",
|
|
120
130
|
"metro-config": "0.81.5",
|
|
121
131
|
"metro-core": "0.81.5",
|
|
@@ -127,6 +137,7 @@
|
|
|
127
137
|
"metro-source-map": "0.81.5",
|
|
128
138
|
"metro-transform-worker": "0.81.5",
|
|
129
139
|
"minimatch": "^5.1.0",
|
|
140
|
+
"os-browserify": "0.3.0",
|
|
130
141
|
"prop-types": "^15.8.1",
|
|
131
142
|
"react": "^18.2.0",
|
|
132
143
|
"react-dom": "^18.2.0",
|
|
@@ -145,6 +156,7 @@
|
|
|
145
156
|
"stylelint-config-recommended": "^13.0.0",
|
|
146
157
|
"stylelint-config-styled-components": "^0.1.1",
|
|
147
158
|
"stylelint-processor-styled-components": "^1.10.0",
|
|
159
|
+
"tty-browserify": "0.0.1",
|
|
148
160
|
"util": "^0.12.5",
|
|
149
161
|
"webpack": "^5.76.1",
|
|
150
162
|
"webpack-dev-server": "^4.12.0"
|
|
@@ -167,6 +179,7 @@
|
|
|
167
179
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
168
180
|
"test": "exit 0",
|
|
169
181
|
"web": "expo start --web",
|
|
170
|
-
"unimported": "pnpm knip --directory ../../../.. -W libs/ui/packages/native"
|
|
182
|
+
"unimported": "pnpm knip --directory ../../../.. -W libs/ui/packages/native",
|
|
183
|
+
"storybook-generate": "sb-rn-get-stories"
|
|
171
184
|
}
|
|
172
185
|
}
|