@ledgerhq/lumen-ui-rnative 0.1.35 → 0.1.36
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/module/lib/Animations/Pulse/Pulse.js +2 -2
- package/dist/module/lib/Animations/Pulse/Pulse.js.map +1 -1
- package/dist/module/lib/Components/DescriptionItem/DescriptionItem.js +184 -0
- package/dist/module/lib/Components/DescriptionItem/DescriptionItem.js.map +1 -0
- package/dist/module/lib/Components/DescriptionItem/DescriptionItem.mdx +139 -0
- package/dist/module/lib/Components/DescriptionItem/DescriptionItem.stories.js +258 -0
- package/dist/module/lib/Components/DescriptionItem/DescriptionItem.stories.js.map +1 -0
- package/dist/module/lib/Components/DescriptionItem/DescriptionItem.test.js +94 -0
- package/dist/module/lib/Components/DescriptionItem/DescriptionItem.test.js.map +1 -0
- package/dist/module/lib/Components/DescriptionItem/index.js +5 -0
- package/dist/module/lib/Components/DescriptionItem/index.js.map +1 -0
- package/dist/module/lib/Components/DescriptionItem/types.js +4 -0
- package/dist/module/lib/Components/DescriptionItem/types.js.map +1 -0
- package/dist/module/lib/Components/NavBar/CoinCapsule.js +1 -0
- package/dist/module/lib/Components/NavBar/CoinCapsule.js.map +1 -1
- package/dist/module/lib/Components/index.js +1 -0
- package/dist/module/lib/Components/index.js.map +1 -1
- package/dist/typescript/src/lib/Animations/Pulse/Pulse.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/DescriptionItem/DescriptionItem.d.ts +42 -0
- package/dist/typescript/src/lib/Components/DescriptionItem/DescriptionItem.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/DescriptionItem/index.d.ts +3 -0
- package/dist/typescript/src/lib/Components/DescriptionItem/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/DescriptionItem/types.d.ts +39 -0
- package/dist/typescript/src/lib/Components/DescriptionItem/types.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/index.d.ts +1 -0
- package/dist/typescript/src/lib/Components/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/lib/Animations/Pulse/Pulse.tsx +6 -3
- package/src/lib/Components/DescriptionItem/DescriptionItem.mdx +139 -0
- package/src/lib/Components/DescriptionItem/DescriptionItem.stories.tsx +234 -0
- package/src/lib/Components/DescriptionItem/DescriptionItem.test.tsx +112 -0
- package/src/lib/Components/DescriptionItem/DescriptionItem.tsx +224 -0
- package/src/lib/Components/DescriptionItem/index.ts +2 -0
- package/src/lib/Components/DescriptionItem/types.ts +44 -0
- package/src/lib/Components/NavBar/CoinCapsule.tsx +1 -0
- package/src/lib/Components/index.ts +1 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { describe, it, expect } from '@jest/globals';
|
|
4
|
+
import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
|
|
5
|
+
import { render, screen } from '@testing-library/react-native';
|
|
6
|
+
import { ThemeProvider } from "../ThemeProvider/ThemeProvider.js";
|
|
7
|
+
import { DescriptionItem, DescriptionItemLabel, DescriptionItemLeading, DescriptionItemTrailing, DescriptionItemValue } from "./DescriptionItem.js";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
const typographyTokens = ledgerLiveThemes.dark.typographies.sm;
|
|
10
|
+
const typographies = {
|
|
11
|
+
...typographyTokens.heading,
|
|
12
|
+
...typographyTokens.body
|
|
13
|
+
};
|
|
14
|
+
const TestWrapper = ({
|
|
15
|
+
children
|
|
16
|
+
}) => /*#__PURE__*/_jsx(ThemeProvider, {
|
|
17
|
+
themes: ledgerLiveThemes,
|
|
18
|
+
colorScheme: "dark",
|
|
19
|
+
locale: "en",
|
|
20
|
+
children: children
|
|
21
|
+
});
|
|
22
|
+
const renderDescriptionItem = (props = {}) => render(/*#__PURE__*/_jsx(TestWrapper, {
|
|
23
|
+
children: /*#__PURE__*/_jsxs(DescriptionItem, {
|
|
24
|
+
testID: "description-item",
|
|
25
|
+
...props,
|
|
26
|
+
children: [/*#__PURE__*/_jsx(DescriptionItemLeading, {
|
|
27
|
+
testID: "leading",
|
|
28
|
+
children: /*#__PURE__*/_jsx(DescriptionItemLabel, {
|
|
29
|
+
children: "Label"
|
|
30
|
+
})
|
|
31
|
+
}), /*#__PURE__*/_jsx(DescriptionItemTrailing, {
|
|
32
|
+
testID: "trailing",
|
|
33
|
+
children: /*#__PURE__*/_jsx(DescriptionItemValue, {
|
|
34
|
+
children: "Value"
|
|
35
|
+
})
|
|
36
|
+
})]
|
|
37
|
+
})
|
|
38
|
+
}));
|
|
39
|
+
describe('DescriptionItem', () => {
|
|
40
|
+
describe('Rendering', () => {
|
|
41
|
+
it('renders label and value', () => {
|
|
42
|
+
renderDescriptionItem();
|
|
43
|
+
expect(screen.getByText('Label')).toBeTruthy();
|
|
44
|
+
expect(screen.getByText('Value')).toBeTruthy();
|
|
45
|
+
});
|
|
46
|
+
it('forwards testID to sub-components', () => {
|
|
47
|
+
renderDescriptionItem();
|
|
48
|
+
expect(screen.getByTestId('description-item')).toBeTruthy();
|
|
49
|
+
expect(screen.getByTestId('leading')).toBeTruthy();
|
|
50
|
+
expect(screen.getByTestId('trailing')).toBeTruthy();
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
describe('DescriptionItemLabel', () => {
|
|
54
|
+
it.each([['md', typographies.body2], ['sm', typographies.body3]])('applies %s size typography', (size, expectedTypography) => {
|
|
55
|
+
renderDescriptionItem({
|
|
56
|
+
size: size
|
|
57
|
+
});
|
|
58
|
+
const labelStyle = screen.getByText('Label').props.style;
|
|
59
|
+
expect(labelStyle.fontSize).toBe(expectedTypography.fontSize);
|
|
60
|
+
expect(labelStyle.fontWeight).toBe(expectedTypography.fontWeight);
|
|
61
|
+
});
|
|
62
|
+
it('defaults to md typography when no size is provided', () => {
|
|
63
|
+
renderDescriptionItem();
|
|
64
|
+
const labelStyle = screen.getByText('Label').props.style;
|
|
65
|
+
expect(labelStyle.fontSize).toBe(typographies.body2.fontSize);
|
|
66
|
+
expect(labelStyle.fontWeight).toBe(typographies.body2.fontWeight);
|
|
67
|
+
});
|
|
68
|
+
it('truncates label to two lines by default', () => {
|
|
69
|
+
renderDescriptionItem();
|
|
70
|
+
expect(screen.getByText('Label').props.numberOfLines).toBe(2);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
describe('DescriptionItemValue', () => {
|
|
74
|
+
it.each([['md', typographies.body2SemiBold], ['sm', typographies.body3SemiBold]])('applies %s size typography', (size, expectedTypography) => {
|
|
75
|
+
renderDescriptionItem({
|
|
76
|
+
size: size
|
|
77
|
+
});
|
|
78
|
+
const valueStyle = screen.getByText('Value').props.style;
|
|
79
|
+
expect(valueStyle.fontSize).toBe(expectedTypography.fontSize);
|
|
80
|
+
expect(valueStyle.fontWeight).toBe(expectedTypography.fontWeight);
|
|
81
|
+
});
|
|
82
|
+
it('defaults to md typography when no size is provided', () => {
|
|
83
|
+
renderDescriptionItem();
|
|
84
|
+
const valueStyle = screen.getByText('Value').props.style;
|
|
85
|
+
expect(valueStyle.fontSize).toBe(typographies.body2SemiBold.fontSize);
|
|
86
|
+
expect(valueStyle.fontWeight).toBe(typographies.body2SemiBold.fontWeight);
|
|
87
|
+
});
|
|
88
|
+
it('truncates value to one line by default', () => {
|
|
89
|
+
renderDescriptionItem();
|
|
90
|
+
expect(screen.getByText('Value').props.numberOfLines).toBe(1);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
//# sourceMappingURL=DescriptionItem.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["describe","it","expect","ledgerLiveThemes","render","screen","ThemeProvider","DescriptionItem","DescriptionItemLabel","DescriptionItemLeading","DescriptionItemTrailing","DescriptionItemValue","jsx","_jsx","jsxs","_jsxs","typographyTokens","dark","typographies","sm","heading","body","TestWrapper","children","themes","colorScheme","locale","renderDescriptionItem","props","testID","getByText","toBeTruthy","getByTestId","each","body2","body3","size","expectedTypography","labelStyle","style","fontSize","toBe","fontWeight","numberOfLines","body2SemiBold","body3SemiBold","valueStyle"],"sourceRoot":"../../../../../src","sources":["lib/Components/DescriptionItem/DescriptionItem.test.tsx"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,EAAE,EAAEC,MAAM,QAAQ,eAAe;AACpD,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,MAAM,EAAEC,MAAM,QAAQ,+BAA+B;AAE9D,SAASC,aAAa,QAAQ,mCAAgC;AAC9D,SACEC,eAAe,EACfC,oBAAoB,EACpBC,sBAAsB,EACtBC,uBAAuB,EACvBC,oBAAoB,QACf,sBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG3B,MAAMC,gBAAgB,GAAGb,gBAAgB,CAACc,IAAI,CAACC,YAAY,CAACC,EAAE;AAC9D,MAAMD,YAAY,GAAG;EACnB,GAAGF,gBAAgB,CAACI,OAAO;EAC3B,GAAGJ,gBAAgB,CAACK;AACtB,CAAC;AAED,MAAMC,WAAW,GAAGA,CAAC;EAAEC;AAAwC,CAAC,kBAC9DV,IAAA,CAACP,aAAa;EAACkB,MAAM,EAAErB,gBAAiB;EAACsB,WAAW,EAAC,MAAM;EAACC,MAAM,EAAC,IAAI;EAAAH,QAAA,EACpEA;AAAQ,CACI,CAChB;AAED,MAAMI,qBAAqB,GAAGA,CAACC,KAAoC,GAAG,CAAC,CAAC,KACtExB,MAAM,cACJS,IAAA,CAACS,WAAW;EAAAC,QAAA,eACVR,KAAA,CAACR,eAAe;IAACsB,MAAM,EAAC,kBAAkB;IAAA,GAAKD,KAAK;IAAAL,QAAA,gBAClDV,IAAA,CAACJ,sBAAsB;MAACoB,MAAM,EAAC,SAAS;MAAAN,QAAA,eACtCV,IAAA,CAACL,oBAAoB;QAAAe,QAAA,EAAC;MAAK,CAAsB;IAAC,CAC5B,CAAC,eACzBV,IAAA,CAACH,uBAAuB;MAACmB,MAAM,EAAC,UAA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ACxDrC,MAAM,CAAC4C,UAAU,CAACN,QAAQ,CAAC,CAACC,IAAI,CAACJ,kBAAkB,CAACG,QAAQ,CAAC;MAC7DtC,MAAM,CAAC4C,UAAU,CAACJ,UAAU,CAAC,CAACD,IAAI,CAACJ,kBAAkB,CAACK,UAAU,CAAC;IACnE,CAAC,CAAC;IAEFzC,EAAE,CAAC,oDAAoD,EAAE,MAAM;MAC7D0B,qBAAqB,CAAC,CAAC;MAEvB,MAAMmB,UAAU,GAAGzC,MAAM,CAACyB,SAAS,CAAC,OAAO,CAAC,CAACF,KAAK,CAACW,KAAK;MACxDrC,MAAM,CAAC4C,UAAU,CAACN,QAAQ,CAAC,CAACC,IAAI,CAACvB,YAAY,CAAC0B,aAAa,CAACJ,QAAQ,CAAC;MACrEtC,MAAM,CAAC4C,UAAU,CAACJ,UAAU,CAAC,CAACD,IAAI,CAACvB,YAAY,CAAC0B,aAAa,CAACF,UAAU,CAAC;IAC3E,CAAC,CAAC;IAEFzC,EAAE,CAAC,wCAAwC,EAAE,MAAM;MACjD0B,qBAAqB,CAAC,CAAC;MAEvBzB,MAAM,CAACG,MAAM,CAACyB,SAAS,CAAC,OAAO,CAAC,CAACF,KAAK,CAACe,aAAa,CAAC,CAACF,IAAI,CAAC,CAAC,CAAC;IAC/D,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["lib/Components/DescriptionItem/index.ts"],"mappings":";;AAAA,cAAc,sBAAmB;AACjC,cAAc,YAAS","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["lib/Components/DescriptionItem/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useStyleSheet","Box","Text","jsx","_jsx","jsxs","_jsxs","CoinCapsule","ticker","icon","styles","useStyles","style","container","children","text","t","flexDirection","gap","spacings","s8","padding","justifyContent","alignItems","borderRadius","full","backgroundColor","colors","bg","mutedTransparent","typographies","body1","color","base"],"sourceRoot":"../../../../../src","sources":["lib/Components/NavBar/CoinCapsule.tsx"],"mappings":";;AAAA,SAASA,aAAa,QAAQ,0BAAiB;AAC/C,SAASC,GAAG,EAAEC,IAAI,QAAQ,qBAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAGvC,OAAO,SAASC,WAAWA,CAAC;EAAEC,MAAM;EAAEC;AAAuB,CAAC,EAAE;EAC9D,MAAMC,MAAM,GAAGC,SAAS,CAAC,CAAC;EAE1B,oBACEL,KAAA,CAACL,GAAG;IAACW,KAAK,EAAEF,MAAM,CAACG,SAAU;IAAAC,QAAA,GAC1BL,IAAI,eACLL,IAAA,CAACF,IAAI;MAACU,KAAK,EAAEF,MAAM,CAACK,IAAK;MAAAD,QAAA,EAAEN;IAAM,CAAO,CAAC;EAAA,CACtC,CAAC;AAEV;AAEA,MAAMG,SAAS,GAAGA,CAAA,KAChBX,aAAa,CACVgB,CAAC,KAAM;EACNH,SAAS,EAAE;IACTI,aAAa,EAAE,KAAK;IACpBC,GAAG,EAAEF,CAAC,CAACG,QAAQ,CAACC,EAAE;IAClBC,OAAO,EAAEL,CAAC,CAACG,QAAQ,CAACC,EAAE;IACtBE,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBC,YAAY,
|
|
1
|
+
{"version":3,"names":["useStyleSheet","Box","Text","jsx","_jsx","jsxs","_jsxs","CoinCapsule","ticker","icon","styles","useStyles","style","container","children","text","t","flexDirection","gap","spacings","s8","padding","paddingRight","s12","justifyContent","alignItems","borderRadius","full","backgroundColor","colors","bg","mutedTransparent","typographies","body1","color","base"],"sourceRoot":"../../../../../src","sources":["lib/Components/NavBar/CoinCapsule.tsx"],"mappings":";;AAAA,SAASA,aAAa,QAAQ,0BAAiB;AAC/C,SAASC,GAAG,EAAEC,IAAI,QAAQ,qBAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAGvC,OAAO,SAASC,WAAWA,CAAC;EAAEC,MAAM;EAAEC;AAAuB,CAAC,EAAE;EAC9D,MAAMC,MAAM,GAAGC,SAAS,CAAC,CAAC;EAE1B,oBACEL,KAAA,CAACL,GAAG;IAACW,KAAK,EAAEF,MAAM,CAACG,SAAU;IAAAC,QAAA,GAC1BL,IAAI,eACLL,IAAA,CAACF,IAAI;MAACU,KAAK,EAAEF,MAAM,CAACK,IAAK;MAAAD,QAAA,EAAEN;IAAM,CAAO,CAAC;EAAA,CACtC,CAAC;AAEV;AAEA,MAAMG,SAAS,GAAGA,CAAA,KAChBX,aAAa,CACVgB,CAAC,KAAM;EACNH,SAAS,EAAE;IACTI,aAAa,EAAE,KAAK;IACpBC,GAAG,EAAEF,CAAC,CAACG,QAAQ,CAACC,EAAE;IAClBC,OAAO,EAAEL,CAAC,CAACG,QAAQ,CAACC,EAAE;IACtBE,YAAY,EAAEN,CAAC,CAACG,QAAQ,CAACI,GAAG;IAC5BC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBC,YAAY,EAAEV,CAAC,CAACU,YAAY,CAACC,IAAI;IACjCC,eAAe,EAAEZ,CAAC,CAACa,MAAM,CAACC,EAAE,CAACC;EAC/B,CAAC;EACDhB,IAAI,EAAE;IACJ,GAAGC,CAAC,CAACgB,YAAY,CAACC,KAAK;IACvBC,KAAK,EAAElB,CAAC,CAACa,MAAM,CAACd,IAAI,CAACoB;EACvB;AACF,CAAC,CAAC,EACF,EACF,CAAC","ignoreList":[]}
|
|
@@ -11,6 +11,7 @@ export * from "./Card/index.js";
|
|
|
11
11
|
export * from "./CardButton/index.js";
|
|
12
12
|
export * from "./Checkbox/index.js";
|
|
13
13
|
export * from "./ContentBanner/index.js";
|
|
14
|
+
export * from "./DescriptionItem/index.js";
|
|
14
15
|
export * from "./Divider/index.js";
|
|
15
16
|
export * from "./DotCount/index.js";
|
|
16
17
|
export * from "./DotIcon/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["lib/Components/index.ts"],"mappings":";;AAAA,cAAc,yBAAgB;AAC9B,cAAc,0BAAiB;AAC/B,cAAc,wBAAe;AAC7B,cAAc,mBAAU;AACxB,cAAc,mBAAU;AACxB,cAAc,wBAAe;AAC7B,cAAc,mBAAU;AACxB,cAAc,iBAAQ;AACtB,cAAc,uBAAc;AAC5B,cAAc,qBAAY;AAC1B,cAAc,0BAAiB;AAC/B,cAAc,oBAAW;AACzB,cAAc,qBAAY;AAC1B,cAAc,oBAAW;AACzB,cAAc,yBAAgB;AAC9B,cAAc,sBAAa;AAC3B,cAAc,iBAAQ;AACtB,cAAc,uBAAc;AAC5B,cAAc,4BAAmB;AACjC,cAAc,iBAAQ;AACtB,cAAc,qBAAY;AAC1B,cAAc,wBAAe;AAC7B,cAAc,wBAAe;AAC7B,cAAc,sBAAa;AAC3B,cAAc,uBAAc;AAC5B,cAAc,qBAAY;AAC1B,cAAc,mBAAU;AACxB,cAAc,uBAAc;AAC5B,cAAc,0BAAiB;AAC/B,cAAc,wBAAe;AAC7B,cAAc,6BAAoB;AAClC,cAAc,mBAAU;AACxB,cAAc,qBAAY;AAC1B,cAAc,oBAAW;AACzB,cAAc,iBAAQ;AACtB,cAAc,oBAAW;AACzB,cAAc,sBAAa;AAC3B,cAAc,mBAAU;AACxB,cAAc,mBAAU;AACxB,cAAc,gBAAO;AACrB,cAAc,sBAAa;AAC3B,cAAc,0BAAiB;AAC/B,cAAc,iBAAQ;AACtB,cAAc,uBAAc;AAC5B,cAAc,oBAAW;AACzB,cAAc,kBAAS;AACvB,cAAc,oBAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["lib/Components/index.ts"],"mappings":";;AAAA,cAAc,yBAAgB;AAC9B,cAAc,0BAAiB;AAC/B,cAAc,wBAAe;AAC7B,cAAc,mBAAU;AACxB,cAAc,mBAAU;AACxB,cAAc,wBAAe;AAC7B,cAAc,mBAAU;AACxB,cAAc,iBAAQ;AACtB,cAAc,uBAAc;AAC5B,cAAc,qBAAY;AAC1B,cAAc,0BAAiB;AAC/B,cAAc,4BAAmB;AACjC,cAAc,oBAAW;AACzB,cAAc,qBAAY;AAC1B,cAAc,oBAAW;AACzB,cAAc,yBAAgB;AAC9B,cAAc,sBAAa;AAC3B,cAAc,iBAAQ;AACtB,cAAc,uBAAc;AAC5B,cAAc,4BAAmB;AACjC,cAAc,iBAAQ;AACtB,cAAc,qBAAY;AAC1B,cAAc,wBAAe;AAC7B,cAAc,wBAAe;AAC7B,cAAc,sBAAa;AAC3B,cAAc,uBAAc;AAC5B,cAAc,qBAAY;AAC1B,cAAc,mBAAU;AACxB,cAAc,uBAAc;AAC5B,cAAc,0BAAiB;AAC/B,cAAc,wBAAe;AAC7B,cAAc,6BAAoB;AAClC,cAAc,mBAAU;AACxB,cAAc,qBAAY;AAC1B,cAAc,oBAAW;AACzB,cAAc,iBAAQ;AACtB,cAAc,oBAAW;AACzB,cAAc,sBAAa;AAC3B,cAAc,mBAAU;AACxB,cAAc,mBAAU;AACxB,cAAc,gBAAO;AACrB,cAAc,sBAAa;AAC3B,cAAc,0BAAiB;AAC/B,cAAc,iBAAQ;AACtB,cAAc,uBAAc;AAC5B,cAAc,oBAAW;AACzB,cAAc,kBAAS;AACvB,cAAc,oBAAW","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pulse.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Animations/Pulse/Pulse.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAQ1C,eAAO,MAAM,KAAK,2FAC0C,UAAU,
|
|
1
|
+
{"version":3,"file":"Pulse.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Animations/Pulse/Pulse.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAQ1C,eAAO,MAAM,KAAK,2FAC0C,UAAU,6CAwCrE,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { DescriptionItemLabelProps, DescriptionItemLeadingProps, DescriptionItemProps, DescriptionItemTrailingProps, DescriptionItemValueProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* A compound component for displaying a key-value description row.
|
|
4
|
+
* Composed with DescriptionItemLeading / DescriptionItemLabel (key side)
|
|
5
|
+
* and DescriptionItemTrailing / DescriptionItemValue (value side).
|
|
6
|
+
*
|
|
7
|
+
* @see {@link https://ldls.vercel.app/?path=/docs/containment-descriptionitem--docs Storybook}
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <DescriptionItem size="md">
|
|
11
|
+
* <DescriptionItemLeading>
|
|
12
|
+
* <DescriptionItemLabel>Fees</DescriptionItemLabel>
|
|
13
|
+
* </DescriptionItemLeading>
|
|
14
|
+
* <DescriptionItemTrailing>
|
|
15
|
+
* <DescriptionItemValue>0.001 BTC</DescriptionItemValue>
|
|
16
|
+
* </DescriptionItemTrailing>
|
|
17
|
+
* </DescriptionItem>
|
|
18
|
+
*/
|
|
19
|
+
export declare const DescriptionItem: ({ children, lx, style, size, ...props }: DescriptionItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* Layout container for the leading (left) side of the description item.
|
|
22
|
+
* Contains DescriptionItemLabel and an optional info icon sibling.
|
|
23
|
+
*/
|
|
24
|
+
export declare const DescriptionItemLeading: ({ children, lx, style, ...props }: DescriptionItemLeadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
/**
|
|
26
|
+
* Typography-bearing label for the leading side.
|
|
27
|
+
* Reads size from DescriptionItemSizeContext to apply the correct typography
|
|
28
|
+
* based on the size of the parent `DescriptionItem`.
|
|
29
|
+
*/
|
|
30
|
+
export declare const DescriptionItemLabel: ({ children, lx, style, numberOfLines, ellipsizeMode, ...props }: DescriptionItemLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
/**
|
|
32
|
+
* Layout container for the trailing (right) side of the description item.
|
|
33
|
+
* Accepts DescriptionItemValue, Tag, Link, or any custom content.
|
|
34
|
+
*/
|
|
35
|
+
export declare const DescriptionItemTrailing: ({ children, lx, style, ...props }: DescriptionItemTrailingProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
/**
|
|
37
|
+
* Typography-bearing value for the trailing side.
|
|
38
|
+
* Reads size from DescriptionItemSizeContext to apply the correct typography
|
|
39
|
+
* based on the size of the parent `DescriptionItem`.
|
|
40
|
+
*/
|
|
41
|
+
export declare const DescriptionItemValue: ({ children, lx, style, numberOfLines, ellipsizeMode, ...props }: DescriptionItemValueProps) => import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
//# sourceMappingURL=DescriptionItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DescriptionItem.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/DescriptionItem/DescriptionItem.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,yBAAyB,EACzB,2BAA2B,EAC3B,oBAAoB,EAEpB,4BAA4B,EAC5B,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AAWjB;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,eAAe,GAAI,yCAM7B,oBAAoB,4CAoBtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAAI,mCAKpC,2BAA2B,4CAmB7B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,iEAOlC,yBAAyB,4CAgC3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAAI,mCAKrC,4BAA4B,4CAuB9B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,iEAOlC,yBAAyB,4CAkC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/DescriptionItem/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { StyledTextProps, StyledViewProps } from '../../../styles';
|
|
3
|
+
export type DescriptionItemSize = 'sm' | 'md';
|
|
4
|
+
export type DescriptionItemProps = {
|
|
5
|
+
/**
|
|
6
|
+
* The content of the description item (DescriptionItemLeading, DescriptionItemTrailing).
|
|
7
|
+
*/
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* The size of the description item.
|
|
11
|
+
* @default 'md'
|
|
12
|
+
*/
|
|
13
|
+
size?: DescriptionItemSize;
|
|
14
|
+
} & Omit<StyledViewProps, 'children'>;
|
|
15
|
+
export type DescriptionItemLeadingProps = {
|
|
16
|
+
/**
|
|
17
|
+
* The leading content (DescriptionItemLabel + optional info icon sibling).
|
|
18
|
+
*/
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
} & Omit<StyledViewProps, 'children'>;
|
|
21
|
+
export type DescriptionItemLabelProps = {
|
|
22
|
+
/**
|
|
23
|
+
* The label text or custom content.
|
|
24
|
+
*/
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
} & Omit<StyledTextProps, 'children'>;
|
|
27
|
+
export type DescriptionItemTrailingProps = {
|
|
28
|
+
/**
|
|
29
|
+
* The trailing content (DescriptionItemValue, Tag, Link, etc.).
|
|
30
|
+
*/
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
} & Omit<StyledViewProps, 'children'>;
|
|
33
|
+
export type DescriptionItemValueProps = {
|
|
34
|
+
/**
|
|
35
|
+
* The value text or custom content.
|
|
36
|
+
*/
|
|
37
|
+
children: ReactNode;
|
|
38
|
+
} & Omit<StyledTextProps, 'children'>;
|
|
39
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/Components/DescriptionItem/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAExE,MAAM,MAAM,mBAAmB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,mBAAmB,CAAC;CAC5B,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;AAEtC,MAAM,MAAM,2BAA2B,GAAG;IACxC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;AAEtC,MAAM,MAAM,yBAAyB,GAAG;IACtC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;AAEtC,MAAM,MAAM,4BAA4B,GAAG;IACzC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;AAEtC,MAAM,MAAM,yBAAyB,GAAG;IACtC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,c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
CHANGED
|
@@ -41,9 +41,12 @@ export const Pulse = memo(
|
|
|
41
41
|
};
|
|
42
42
|
}, [sv, animate, timingConfig]);
|
|
43
43
|
|
|
44
|
-
const animatedStyle = useAnimatedStyle(
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
const animatedStyle = useAnimatedStyle(
|
|
45
|
+
() => ({
|
|
46
|
+
opacity: sv.value,
|
|
47
|
+
}),
|
|
48
|
+
[sv],
|
|
49
|
+
);
|
|
47
50
|
|
|
48
51
|
return (
|
|
49
52
|
<Animated.View
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks';
|
|
2
|
+
import * as DescriptionItemStories from './DescriptionItem.stories';
|
|
3
|
+
import { CustomTabs, Tab } from '../../../../.storybook/components';
|
|
4
|
+
|
|
5
|
+
<Meta title='Containment/DescriptionItem' of={DescriptionItemStories} />
|
|
6
|
+
|
|
7
|
+
# DescriptionItem
|
|
8
|
+
|
|
9
|
+
> View in [Figma](https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7/2.-Components-Library?node-id=10311-11837&m=dev).
|
|
10
|
+
|
|
11
|
+
<CustomTabs>
|
|
12
|
+
<Tab label="Overview">
|
|
13
|
+
|
|
14
|
+
## Introduction
|
|
15
|
+
|
|
16
|
+
DescriptionItem is a compound component for displaying key-value rows — typically used inside a summary panel, transaction detail, or settings screen. It composes a leading label side and a trailing value side, with the trailing always taking priority over the leading when space is constrained.
|
|
17
|
+
|
|
18
|
+
## Anatomy
|
|
19
|
+
|
|
20
|
+
<Canvas of={DescriptionItemStories.Base} />
|
|
21
|
+
|
|
22
|
+
- **DescriptionItem**: Root row container. Accepts an optional `size` prop (`md` | `sm`).
|
|
23
|
+
- **DescriptionItemLeading**: Left section holding the label and any optional sibling (e.g. a tooltip icon).
|
|
24
|
+
- **DescriptionItemLabel**: Muted text label. Wraps to a second line before truncating (`numberOfLines={2}`).
|
|
25
|
+
- **DescriptionItemTrailing**: Right section holding the value or any inline element (Tag, Link, etc.). Never shrinks — always has layout priority.
|
|
26
|
+
- **DescriptionItemValue**: Semi-bold value text. Truncates to a single line (`numberOfLines={1}`).
|
|
27
|
+
|
|
28
|
+
## Properties
|
|
29
|
+
|
|
30
|
+
<Canvas of={DescriptionItemStories.Base} />
|
|
31
|
+
<Controls of={DescriptionItemStories.Base} />
|
|
32
|
+
|
|
33
|
+
### Trailing variants
|
|
34
|
+
|
|
35
|
+
The trailing section accepts any content — a plain value, a `Tag`, multiple `Tag`s, or a custom element. Use `DescriptionItemValue` for plain text; place other components directly in `DescriptionItemTrailing`.
|
|
36
|
+
|
|
37
|
+
<Canvas of={DescriptionItemStories.TrailingVariants} />
|
|
38
|
+
|
|
39
|
+
### Size
|
|
40
|
+
|
|
41
|
+
Two sizes are available — `md` (default) and `sm`.
|
|
42
|
+
|
|
43
|
+
- The size of `DescriptionItemValue` is inherited from the parent `DescriptionItem`.
|
|
44
|
+
- The size of additional trailing content (e.g. `Tag`) needs to be set explicitly.
|
|
45
|
+
|
|
46
|
+
<Canvas of={DescriptionItemStories.SizeShowcase} />
|
|
47
|
+
|
|
48
|
+
### With info tooltip
|
|
49
|
+
|
|
50
|
+
Pair a `Tooltip` with an info icon inside `DescriptionItemLeading` to surface additional context without cluttering the label.
|
|
51
|
+
|
|
52
|
+
<Canvas of={DescriptionItemStories.WithInfoIcon} />
|
|
53
|
+
|
|
54
|
+
### Truncation
|
|
55
|
+
|
|
56
|
+
The label can wrap to two lines before truncating. The trailing value truncates after one line. When both sides have long content, the trailing always gets layout priority.
|
|
57
|
+
|
|
58
|
+
<Canvas of={DescriptionItemStories.TruncationBehavior} />
|
|
59
|
+
|
|
60
|
+
</Tab>
|
|
61
|
+
<Tab label="Implementation">
|
|
62
|
+
|
|
63
|
+
## Setup
|
|
64
|
+
|
|
65
|
+
Install and set up the library with our [Setup Guide →](?path=/docs/getting-started-setup--docs).
|
|
66
|
+
|
|
67
|
+
## Basic Usage
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
import {
|
|
71
|
+
DescriptionItem,
|
|
72
|
+
DescriptionItemLabel,
|
|
73
|
+
DescriptionItemLeading,
|
|
74
|
+
DescriptionItemTrailing,
|
|
75
|
+
DescriptionItemValue,
|
|
76
|
+
} from '@ledgerhq/lumen-ui-rnative';
|
|
77
|
+
|
|
78
|
+
function MyComponent() {
|
|
79
|
+
return (
|
|
80
|
+
<DescriptionItem size='md'>
|
|
81
|
+
<DescriptionItemLeading>
|
|
82
|
+
<DescriptionItemLabel>Fees</DescriptionItemLabel>
|
|
83
|
+
</DescriptionItemLeading>
|
|
84
|
+
<DescriptionItemTrailing>
|
|
85
|
+
<DescriptionItemValue>0.001 BTC</DescriptionItemValue>
|
|
86
|
+
</DescriptionItemTrailing>
|
|
87
|
+
</DescriptionItem>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### With info tooltip
|
|
93
|
+
|
|
94
|
+
Use a `Tooltip` alongside the label to add contextual information:
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
import {
|
|
98
|
+
DescriptionItem,
|
|
99
|
+
DescriptionItemLabel,
|
|
100
|
+
DescriptionItemLeading,
|
|
101
|
+
DescriptionItemTrailing,
|
|
102
|
+
DescriptionItemValue,
|
|
103
|
+
InteractiveIcon,
|
|
104
|
+
Tooltip,
|
|
105
|
+
TooltipTrigger,
|
|
106
|
+
TooltipContent,
|
|
107
|
+
} from '@ledgerhq/lumen-ui-rnative';
|
|
108
|
+
import { Information } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
109
|
+
import { Text } from 'react-native';
|
|
110
|
+
|
|
111
|
+
function MyComponent() {
|
|
112
|
+
return (
|
|
113
|
+
<DescriptionItem>
|
|
114
|
+
<DescriptionItemLeading>
|
|
115
|
+
<DescriptionItemLabel>Fees</DescriptionItemLabel>
|
|
116
|
+
<Tooltip>
|
|
117
|
+
<TooltipTrigger>
|
|
118
|
+
<InteractiveIcon
|
|
119
|
+
icon={Information}
|
|
120
|
+
size={16}
|
|
121
|
+
iconType='stroked'
|
|
122
|
+
accessibilityLabel='More information'
|
|
123
|
+
/>
|
|
124
|
+
</TooltipTrigger>
|
|
125
|
+
<TooltipContent
|
|
126
|
+
content={<Text>Network fee paid to miners</Text>}
|
|
127
|
+
/>
|
|
128
|
+
</Tooltip>
|
|
129
|
+
</DescriptionItemLeading>
|
|
130
|
+
<DescriptionItemTrailing>
|
|
131
|
+
<DescriptionItemValue>0.001 BTC</DescriptionItemValue>
|
|
132
|
+
</DescriptionItemTrailing>
|
|
133
|
+
</DescriptionItem>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
</Tab>
|
|
139
|
+
</CustomTabs>
|