@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,31 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,51 +0,0 @@
|
|
|
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
|
-
});
|