@ledgerhq/lumen-ui-rnative 0.1.10 → 0.1.12
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/i18n/locales/de.json +3 -0
- package/dist/module/i18n/locales/en.json +3 -0
- package/dist/module/i18n/locales/es.json +3 -0
- package/dist/module/i18n/locales/fr.json +3 -0
- package/dist/module/i18n/locales/ja.json +3 -0
- package/dist/module/i18n/locales/ko.json +3 -0
- package/dist/module/i18n/locales/pt.json +3 -0
- package/dist/module/i18n/locales/ru.json +3 -0
- package/dist/module/i18n/locales/th.json +3 -0
- package/dist/module/i18n/locales/tr.json +3 -0
- package/dist/module/i18n/locales/zh.json +3 -0
- package/dist/module/lib/Animations/Pulse/Pulse.js +1 -1
- package/dist/module/lib/Animations/Spin/Spin.js +1 -1
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.js +21 -21
- package/dist/module/lib/Components/AmountDisplay/AmountDisplay.js.map +1 -1
- package/dist/module/lib/Components/AmountInput/AmountInput.js +19 -13
- package/dist/module/lib/Components/AmountInput/AmountInput.js.map +1 -1
- package/dist/module/lib/Components/BaseInput/BaseInput.js +16 -9
- package/dist/module/lib/Components/BaseInput/BaseInput.js.map +1 -1
- package/dist/module/lib/Components/BottomSheet/BottomSheet.stories.js.map +1 -1
- package/dist/module/lib/Components/Button/BaseButton.js +8 -1
- package/dist/module/lib/Components/Button/BaseButton.js.map +1 -1
- package/dist/module/lib/Components/Card/Card.js +20 -14
- package/dist/module/lib/Components/Card/Card.js.map +1 -1
- package/dist/module/lib/Components/CardButton/CardButton.js +8 -1
- package/dist/module/lib/Components/CardButton/CardButton.js.map +1 -1
- package/dist/module/lib/Components/Checkbox/Checkbox.js +8 -1
- package/dist/module/lib/Components/Checkbox/Checkbox.js.map +1 -1
- package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.js +32 -5
- package/dist/module/lib/Components/InteractiveIcon/InteractiveIcon.js.map +1 -1
- package/dist/module/lib/Components/Label/Label.js +9 -2
- package/dist/module/lib/Components/Label/Label.js.map +1 -1
- package/dist/module/lib/Components/Link/Link.mdx +1 -0
- package/dist/module/lib/Components/ListItem/ListItem.js +14 -19
- package/dist/module/lib/Components/ListItem/ListItem.js.map +1 -1
- package/dist/module/lib/Components/MediaCard/MediaCard.js +183 -0
- package/dist/module/lib/Components/MediaCard/MediaCard.js.map +1 -0
- package/dist/module/lib/Components/MediaCard/MediaCard.mdx +111 -0
- package/dist/module/lib/Components/MediaCard/MediaCard.stories.js +199 -0
- package/dist/module/lib/Components/MediaCard/MediaCard.stories.js.map +1 -0
- package/dist/module/lib/Components/MediaCard/MediaCard.test.js +140 -0
- package/dist/module/lib/Components/MediaCard/MediaCard.test.js.map +1 -0
- package/dist/module/lib/Components/MediaCard/index.js +5 -0
- package/dist/module/lib/Components/MediaCard/index.js.map +1 -0
- package/dist/module/lib/Components/MediaCard/types.js +4 -0
- package/dist/module/lib/Components/MediaCard/types.js.map +1 -0
- package/dist/module/lib/Components/PageIndicator/PageIndicator.js +2 -2
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.js +8 -1
- package/dist/module/lib/Components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/module/lib/Components/SegmentedControl/usePillLayout.js +1 -1
- package/dist/module/lib/Components/Select/Select.js +8 -1
- package/dist/module/lib/Components/Select/Select.js.map +1 -1
- package/dist/module/lib/Components/Spot/Spot.js +4 -4
- package/dist/module/lib/Components/Spot/Spot.js.map +1 -1
- package/dist/module/lib/Components/Stepper/Stepper.js +10 -4
- package/dist/module/lib/Components/Stepper/Stepper.js.map +1 -1
- package/dist/module/lib/Components/Subheader/Subheader.js +1 -34
- package/dist/module/lib/Components/Subheader/Subheader.js.map +1 -1
- package/dist/module/lib/Components/Subheader/Subheader.mdx +26 -61
- package/dist/module/lib/Components/Subheader/Subheader.stories.js +23 -12
- package/dist/module/lib/Components/Subheader/Subheader.stories.js.map +1 -1
- package/dist/module/lib/Components/Subheader/Subheader.test.js +2 -26
- package/dist/module/lib/Components/Subheader/Subheader.test.js.map +1 -1
- package/dist/module/lib/Components/Subheader/index.js +1 -1
- package/dist/module/lib/Components/Subheader/index.js.map +1 -1
- package/dist/module/lib/Components/Switch/BaseSwitch.js +1 -1
- package/dist/module/lib/Components/Switch/Switch.js +8 -1
- package/dist/module/lib/Components/Switch/Switch.js.map +1 -1
- package/dist/module/lib/Components/TabBar/TabBar.js +8 -7
- package/dist/module/lib/Components/TabBar/TabBar.js.map +1 -1
- package/dist/module/lib/Components/Tag/Tag.js +9 -2
- package/dist/module/lib/Components/Tag/Tag.js.map +1 -1
- package/dist/module/lib/Components/ThemeProvider/ThemeProvider.test.js +22 -20
- package/dist/module/lib/Components/ThemeProvider/ThemeProvider.test.js.map +1 -1
- package/dist/module/lib/Components/Tile/Tile.js +27 -48
- package/dist/module/lib/Components/Tile/Tile.js.map +1 -1
- package/dist/module/lib/Components/Tile/Tile.mdx +34 -26
- package/dist/module/lib/Components/Tile/Tile.stories.js +31 -28
- package/dist/module/lib/Components/Tile/Tile.stories.js.map +1 -1
- package/dist/module/lib/Components/Tile/Tile.test.js +33 -188
- package/dist/module/lib/Components/Tile/Tile.test.js.map +1 -1
- package/dist/module/lib/Components/Tile/index.js +1 -1
- package/dist/module/lib/Components/Tile/index.js.map +1 -1
- package/dist/module/lib/Components/TileButton/TileButton.js +8 -2
- package/dist/module/lib/Components/TileButton/TileButton.js.map +1 -1
- package/dist/module/lib/Components/TriggerButton/TriggerButton.js +197 -0
- package/dist/module/lib/Components/TriggerButton/TriggerButton.js.map +1 -0
- package/dist/module/lib/Components/TriggerButton/TriggerButton.mdx +44 -0
- package/dist/module/lib/Components/TriggerButton/TriggerButton.stories.js +170 -0
- package/dist/module/lib/Components/TriggerButton/TriggerButton.stories.js.map +1 -0
- package/dist/module/lib/Components/TriggerButton/TriggerButton.test.js +146 -0
- package/dist/module/lib/Components/TriggerButton/TriggerButton.test.js.map +1 -0
- package/dist/module/lib/Components/TriggerButton/index.js +5 -0
- package/dist/module/lib/Components/TriggerButton/index.js.map +1 -0
- package/dist/module/lib/Components/TriggerButton/types.js +4 -0
- package/dist/module/lib/Components/TriggerButton/types.js.map +1 -0
- package/dist/module/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.stories.js.map +1 -1
- package/dist/module/lib/Components/index.js +2 -0
- package/dist/module/lib/Components/index.js.map +1 -1
- package/dist/module/lib/Symbols/Icons/NanoGen5.js +49 -0
- package/dist/module/lib/Symbols/Icons/NanoGen5.js.map +1 -0
- package/dist/module/lib/Symbols/index.js +1 -0
- package/dist/module/lib/Symbols/index.js.map +1 -1
- package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts +1 -1
- package/dist/typescript/src/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/BaseInput/BaseInput.d.ts +1 -1
- package/dist/typescript/src/lib/Components/BaseInput/BaseInput.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Button/BaseButton.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Button/BaseButton.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Card/Card.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Card/types.d.ts +1 -3
- package/dist/typescript/src/lib/Components/Card/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/CardButton/CardButton.d.ts +1 -1
- package/dist/typescript/src/lib/Components/CardButton/CardButton.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/InteractiveIcon/InteractiveIcon.d.ts +1 -1
- package/dist/typescript/src/lib/Components/InteractiveIcon/InteractiveIcon.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/InteractiveIcon/types.d.ts +14 -1
- package/dist/typescript/src/lib/Components/InteractiveIcon/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Label/Label.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Label/Label.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/ListItem/ListItem.d.ts +1 -1
- package/dist/typescript/src/lib/Components/ListItem/ListItem.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/MediaCard/MediaCard.d.ts +32 -0
- package/dist/typescript/src/lib/Components/MediaCard/MediaCard.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/MediaCard/index.d.ts +3 -0
- package/dist/typescript/src/lib/Components/MediaCard/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/MediaCard/types.d.ts +38 -0
- package/dist/typescript/src/lib/Components/MediaCard/types.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControlContext.d.ts +1 -1
- package/dist/typescript/src/lib/Components/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Select/Select.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Select/Select.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Stepper/Stepper.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Stepper/Stepper.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Subheader/Subheader.d.ts +2 -7
- package/dist/typescript/src/lib/Components/Subheader/Subheader.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Subheader/index.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Subheader/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Subheader/types.d.ts +1 -11
- package/dist/typescript/src/lib/Components/Subheader/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Switch/Switch.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Switch/Switch.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/TabBar/TabBar.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Tag/Tag.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Tag/Tag.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Tile/Tile.d.ts +17 -23
- package/dist/typescript/src/lib/Components/Tile/Tile.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Tile/index.d.ts +1 -1
- package/dist/typescript/src/lib/Components/Tile/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/Tile/types.d.ts +0 -9
- package/dist/typescript/src/lib/Components/Tile/types.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/TileButton/TileButton.d.ts +1 -1
- package/dist/typescript/src/lib/Components/TileButton/TileButton.d.ts.map +1 -1
- package/dist/typescript/src/lib/Components/TriggerButton/TriggerButton.d.ts +26 -0
- package/dist/typescript/src/lib/Components/TriggerButton/TriggerButton.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/TriggerButton/index.d.ts +3 -0
- package/dist/typescript/src/lib/Components/TriggerButton/index.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/TriggerButton/types.d.ts +38 -0
- package/dist/typescript/src/lib/Components/TriggerButton/types.d.ts.map +1 -0
- package/dist/typescript/src/lib/Components/index.d.ts +2 -0
- package/dist/typescript/src/lib/Components/index.d.ts.map +1 -1
- package/dist/typescript/src/lib/Symbols/Icons/NanoGen5.d.ts +35 -0
- package/dist/typescript/src/lib/Symbols/Icons/NanoGen5.d.ts.map +1 -0
- package/dist/typescript/src/lib/Symbols/index.d.ts +1 -0
- package/dist/typescript/src/lib/Symbols/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/i18n/locales/de.json +3 -0
- package/src/i18n/locales/en.json +3 -0
- package/src/i18n/locales/es.json +3 -0
- package/src/i18n/locales/fr.json +3 -0
- package/src/i18n/locales/ja.json +3 -0
- package/src/i18n/locales/ko.json +3 -0
- package/src/i18n/locales/pt.json +3 -0
- package/src/i18n/locales/ru.json +3 -0
- package/src/i18n/locales/th.json +3 -0
- package/src/i18n/locales/tr.json +3 -0
- package/src/i18n/locales/zh.json +3 -0
- package/src/lib/Components/AmountDisplay/AmountDisplay.tsx +20 -20
- package/src/lib/Components/AmountInput/AmountInput.tsx +15 -7
- package/src/lib/Components/BaseInput/BaseInput.tsx +12 -7
- package/src/lib/Components/BottomSheet/BottomSheet.stories.tsx +9 -9
- package/src/lib/Components/Button/BaseButton.tsx +6 -1
- package/src/lib/Components/Card/Card.tsx +16 -16
- package/src/lib/Components/Card/types.ts +1 -4
- package/src/lib/Components/CardButton/CardButton.tsx +7 -1
- package/src/lib/Components/Checkbox/Checkbox.tsx +7 -1
- package/src/lib/Components/InteractiveIcon/InteractiveIcon.tsx +34 -7
- package/src/lib/Components/InteractiveIcon/types.ts +14 -1
- package/src/lib/Components/Label/Label.tsx +7 -2
- package/src/lib/Components/Link/Link.mdx +1 -0
- package/src/lib/Components/ListItem/ListItem.tsx +15 -12
- package/src/lib/Components/MediaCard/MediaCard.mdx +111 -0
- package/src/lib/Components/MediaCard/MediaCard.stories.tsx +190 -0
- package/src/lib/Components/MediaCard/MediaCard.test.tsx +125 -0
- package/src/lib/Components/MediaCard/MediaCard.tsx +203 -0
- package/src/lib/Components/MediaCard/index.ts +2 -0
- package/src/lib/Components/MediaCard/types.ts +39 -0
- package/src/lib/Components/SegmentedControl/SegmentedControl.tsx +6 -1
- package/src/lib/Components/SegmentedControl/SegmentedControlContext.tsx +1 -1
- package/src/lib/Components/Select/Select.tsx +6 -1
- package/src/lib/Components/Spot/Spot.tsx +4 -4
- package/src/lib/Components/Stepper/Stepper.tsx +9 -2
- package/src/lib/Components/Subheader/Subheader.mdx +26 -61
- package/src/lib/Components/Subheader/Subheader.stories.tsx +16 -10
- package/src/lib/Components/Subheader/Subheader.test.tsx +0 -22
- package/src/lib/Components/Subheader/Subheader.tsx +1 -42
- package/src/lib/Components/Subheader/index.ts +0 -1
- package/src/lib/Components/Subheader/types.ts +1 -16
- package/src/lib/Components/Switch/Switch.tsx +6 -1
- package/src/lib/Components/TabBar/TabBar.tsx +5 -2
- package/src/lib/Components/Tag/Tag.tsx +7 -2
- package/src/lib/Components/ThemeProvider/ThemeProvider.test.tsx +16 -18
- package/src/lib/Components/Tile/Tile.mdx +34 -26
- package/src/lib/Components/Tile/Tile.stories.tsx +26 -26
- package/src/lib/Components/Tile/Tile.test.tsx +17 -137
- package/src/lib/Components/Tile/Tile.tsx +28 -40
- package/src/lib/Components/Tile/index.ts +0 -1
- package/src/lib/Components/Tile/types.ts +0 -11
- package/src/lib/Components/TileButton/TileButton.tsx +9 -2
- package/src/lib/Components/TriggerButton/TriggerButton.mdx +44 -0
- package/src/lib/Components/TriggerButton/TriggerButton.stories.tsx +132 -0
- package/src/lib/Components/TriggerButton/TriggerButton.test.tsx +157 -0
- package/src/lib/Components/TriggerButton/TriggerButton.tsx +228 -0
- package/src/lib/Components/TriggerButton/index.ts +2 -0
- package/src/lib/Components/TriggerButton/types.ts +38 -0
- package/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.stories.tsx +1 -1
- package/src/lib/Components/index.ts +2 -0
- package/src/lib/Symbols/Icons/NanoGen5.tsx +44 -0
- package/src/lib/Symbols/index.ts +1 -0
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { describe, expect, it } from '@jest/globals';
|
|
4
|
+
import { ledgerLiveThemes } from '@ledgerhq/lumen-design-core';
|
|
4
5
|
import { render, screen } from '@testing-library/react-native';
|
|
5
|
-
import {
|
|
6
|
+
import { ChevronBigLeft, Wallet } from "../../Symbols/index.js";
|
|
7
|
+
import { Button } from "../Button/index.js";
|
|
8
|
+
import { Spot } from "../Spot/index.js";
|
|
9
|
+
import { Tile } from "../Tile/Tile.js";
|
|
10
|
+
import { Box, Text } from "../Utility/index.js";
|
|
6
11
|
import { ThemeProvider } from "./ThemeProvider.js";
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
const themes = {
|
|
9
|
-
light: {
|
|
10
|
-
typographies: {
|
|
11
|
-
xs: {}
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
dark: {
|
|
15
|
-
typographies: {
|
|
16
|
-
xs: {}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
13
|
describe('ThemeProvider', () => {
|
|
21
14
|
it('renders children correctly', () => {
|
|
22
|
-
render(/*#__PURE__*/
|
|
23
|
-
themes:
|
|
24
|
-
children: /*#__PURE__*/_jsx(
|
|
15
|
+
render(/*#__PURE__*/_jsxs(ThemeProvider, {
|
|
16
|
+
themes: ledgerLiveThemes,
|
|
17
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
25
18
|
testID: "child",
|
|
26
19
|
children: "Hello World"
|
|
27
|
-
})
|
|
20
|
+
}), /*#__PURE__*/_jsx(Tile, {
|
|
21
|
+
children: "Tile"
|
|
22
|
+
}), /*#__PURE__*/_jsx(Spot, {
|
|
23
|
+
appearance: "icon",
|
|
24
|
+
icon: Wallet
|
|
25
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
26
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
27
|
+
children: "Text"
|
|
28
|
+
})
|
|
29
|
+
}), /*#__PURE__*/_jsx(ChevronBigLeft, {})]
|
|
28
30
|
}));
|
|
29
|
-
expect(screen.getByTestId('child'));
|
|
30
|
-
expect(screen.getByText('Hello World'));
|
|
31
|
+
expect(screen.getByTestId('child')).toBeTruthy();
|
|
32
|
+
expect(screen.getByText('Hello World')).toBeTruthy();
|
|
31
33
|
});
|
|
32
34
|
});
|
|
33
35
|
//# sourceMappingURL=ThemeProvider.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["describe","expect","it","render","screen","Text","ThemeProvider","jsx","_jsx","
|
|
1
|
+
{"version":3,"names":["describe","expect","it","ledgerLiveThemes","render","screen","ChevronBigLeft","Wallet","Button","Spot","Tile","Box","Text","ThemeProvider","jsx","_jsx","jsxs","_jsxs","themes","children","testID","appearance","icon","getByTestId","toBeTruthy","getByText"],"sourceRoot":"../../../../../src","sources":["lib/Components/ThemeProvider/ThemeProvider.test.tsx"],"mappings":";;AAAA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,eAAe;AACpD,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,MAAM,EAAEC,MAAM,QAAQ,+BAA+B;AAC9D,SAASC,cAAc,EAAEC,MAAM,QAAQ,wBAAe;AACtD,SAASC,MAAM,QAAQ,oBAAW;AAClC,SAASC,IAAI,QAAQ,kBAAS;AAC9B,SAASC,IAAI,QAAQ,iBAAc;AACnC,SAASC,GAAG,EAAEC,IAAI,QAAQ,qBAAY;AACtC,SAASC,aAAa,QAAQ,oBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhDjB,QAAQ,CAAC,eAAe,EAAE,MAAM;EAC9BE,EAAE,CAAC,4BAA4B,EAAE,MAAM;IACrCE,MAAM,cACJa,KAAA,CAACJ,aAAa;MAACK,MAAM,EAAEf,gBAAiB;MAAAgB,QAAA,gBACtCJ,IAAA,CAACP,MAAM;QAACY,MAAM,EAAC,OAAO;QAAAD,QAAA,EAAC;MAAW,CAAQ,CAAC,eAC3CJ,IAAA,CAACL,IAAI;QAAAS,QAAA,EAAC;MAAI,CAAM,CAAC,eACjBJ,IAAA,CAACN,IAAI;QAACY,UAAU,EAAC,MAAM;QAACC,IAAI,EAAEf;MAAO,CAAE,CAAC,eACxCQ,IAAA,CAACJ,GAAG;QAAAQ,QAAA,eACFJ,IAAA,CAACH,IAAI;UAAAO,QAAA,EAAC;QAAI,CAAM;MAAC,CACd,CAAC,eACNJ,IAAA,CAACT,cAAc,IAAE,CAAC;IAAA,CACL,CACjB,CAAC;IAEDL,MAAM,CAACI,MAAM,CAACkB,WAAW,CAAC,OAAO,CAAC,CAAC,CAACC,UAAU,CAAC,CAAC;IAChDvB,MAAM,CAACI,MAAM,CAACoB,SAAS,CAAC,aAAa,CAAC,CAAC,CAACD,UAAU,CAAC,CAAC;EACtD,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { DisabledProvider, isTextChildren, useDisabledContext } from '@ledgerhq/lumen-utils-shared';
|
|
4
4
|
import { StyleSheet, View } from 'react-native';
|
|
5
5
|
import { useStyleSheet } from "../../../styles/index.js";
|
|
6
|
-
import { Spot } from "../Spot/index.js";
|
|
7
6
|
import { Box, Pressable, Text } from "../Utility/index.js";
|
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
const [TileProvider, useTileContext] = createSafeContext('Tile');
|
|
10
8
|
const useRootStyles = ({
|
|
11
9
|
appearance,
|
|
12
10
|
disabled,
|
|
@@ -55,12 +53,13 @@ const useRootStyles = ({
|
|
|
55
53
|
* Do not use it to modify the tile's core appearance (colors, padding, etc). Use the `appearance` prop instead.
|
|
56
54
|
*
|
|
57
55
|
* @example
|
|
58
|
-
* // Basic tile with
|
|
59
|
-
* import { Tile,
|
|
56
|
+
* // Basic tile with icon and content
|
|
57
|
+
* import { Tile, TileContent, TileTitle, TileDescription } from '@ledgerhq/lumen-ui-rnative';
|
|
58
|
+
* import { Spot } from '@ledgerhq/lumen-ui-rnative';
|
|
60
59
|
* import { Wallet } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
61
60
|
*
|
|
62
61
|
* <Tile appearance="card" onPress={() => console.log('Pressed!')}>
|
|
63
|
-
* <
|
|
62
|
+
* <Spot appearance="icon" icon={Wallet} />
|
|
64
63
|
* <TileContent>
|
|
65
64
|
* <TileTitle>My Wallet</TileTitle>
|
|
66
65
|
* <TileDescription>Description</TileDescription>
|
|
@@ -68,29 +67,37 @@ const useRootStyles = ({
|
|
|
68
67
|
* </Tile>
|
|
69
68
|
*
|
|
70
69
|
* @example
|
|
71
|
-
* // With
|
|
72
|
-
* import { Tile,
|
|
70
|
+
* // With trailing content (Tags)
|
|
71
|
+
* import { Tile, TileContent, TileTitle, TileTrailingContent, Tag } from '@ledgerhq/lumen-ui-rnative';
|
|
73
72
|
* import { Bitcoin } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
74
73
|
*
|
|
75
74
|
* <Tile appearance="card" onLongPress={() => console.log('Long pressed')}>
|
|
76
|
-
* <
|
|
75
|
+
* <Spot appearance="icon" icon={Bitcoin} />
|
|
77
76
|
* <TileContent>
|
|
78
77
|
* <TileTitle>Bitcoin</TileTitle>
|
|
78
|
+
* <TileTrailingContent>
|
|
79
|
+
* <Tag label="Active" />
|
|
80
|
+
* </TileTrailingContent>
|
|
79
81
|
* </TileContent>
|
|
80
|
-
* <Tag label="Active" />
|
|
81
82
|
* </Tile>
|
|
82
83
|
*/
|
|
83
84
|
export const Tile = ({
|
|
84
85
|
lx = {},
|
|
85
86
|
style,
|
|
86
87
|
appearance = 'no-background',
|
|
87
|
-
disabled = false,
|
|
88
|
+
disabled: disabledProp = false,
|
|
88
89
|
centered = false,
|
|
89
90
|
children,
|
|
90
91
|
ref,
|
|
91
92
|
...props
|
|
92
93
|
}) => {
|
|
93
|
-
|
|
94
|
+
const disabled = useDisabledContext({
|
|
95
|
+
consumerName: 'Tile',
|
|
96
|
+
mergeWith: {
|
|
97
|
+
disabled: disabledProp
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
return /*#__PURE__*/_jsx(DisabledProvider, {
|
|
94
101
|
value: {
|
|
95
102
|
disabled
|
|
96
103
|
},
|
|
@@ -111,7 +118,7 @@ export const Tile = ({
|
|
|
111
118
|
pressed
|
|
112
119
|
}) => /*#__PURE__*/_jsx(TilePressableContent, {
|
|
113
120
|
appearance: appearance,
|
|
114
|
-
disabled: disabled,
|
|
121
|
+
disabled: !!disabled,
|
|
115
122
|
pressed: pressed,
|
|
116
123
|
centered: centered,
|
|
117
124
|
children: children
|
|
@@ -138,31 +145,6 @@ const TilePressableContent = ({
|
|
|
138
145
|
children: children
|
|
139
146
|
});
|
|
140
147
|
};
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* A spot adapter for use within Tile. Automatically inherits the disabled state from the parent Tile.
|
|
144
|
-
*
|
|
145
|
-
* @example
|
|
146
|
-
* <Tile>
|
|
147
|
-
* <TileSpot appearance="icon" icon={Settings} />
|
|
148
|
-
* </Tile>
|
|
149
|
-
*/
|
|
150
|
-
export const TileSpot = ({
|
|
151
|
-
size = 48,
|
|
152
|
-
...props
|
|
153
|
-
}) => {
|
|
154
|
-
const {
|
|
155
|
-
disabled
|
|
156
|
-
} = useTileContext({
|
|
157
|
-
consumerName: 'TileSpot',
|
|
158
|
-
contextRequired: true
|
|
159
|
-
});
|
|
160
|
-
return /*#__PURE__*/_jsx(Spot, {
|
|
161
|
-
...props,
|
|
162
|
-
size: size,
|
|
163
|
-
disabled: disabled
|
|
164
|
-
});
|
|
165
|
-
};
|
|
166
148
|
const useContentStyles = () => {
|
|
167
149
|
return useStyleSheet(t => ({
|
|
168
150
|
container: {
|
|
@@ -171,17 +153,18 @@ const useContentStyles = () => {
|
|
|
171
153
|
}
|
|
172
154
|
}), []);
|
|
173
155
|
};
|
|
174
|
-
TileSpot.displayName = 'TileSpot';
|
|
175
|
-
|
|
176
156
|
/**
|
|
177
|
-
* A container for grouping TileTitle and
|
|
157
|
+
* A container for grouping TileTitle, TileDescription and TileTrailingContent with consistent spacing.
|
|
178
158
|
* Use this to wrap text content within a Tile.
|
|
179
159
|
*
|
|
180
160
|
* @example
|
|
181
161
|
* <Tile>
|
|
182
162
|
* <TileContent>
|
|
183
163
|
* <TileTitle>My Title</TileTitle>
|
|
184
|
-
* <TileDescription>
|
|
164
|
+
* <TileDescription>Description</TileDescription>
|
|
165
|
+
* <TileTrailingContent>
|
|
166
|
+
* <Tag label="Active" />
|
|
167
|
+
* </TileTrailingContent>
|
|
185
168
|
* </TileContent>
|
|
186
169
|
* </Tile>
|
|
187
170
|
*/
|
|
@@ -226,9 +209,7 @@ export const TileTitle = ({
|
|
|
226
209
|
lx,
|
|
227
210
|
style
|
|
228
211
|
}) => {
|
|
229
|
-
const {
|
|
230
|
-
disabled
|
|
231
|
-
} = useTileContext({
|
|
212
|
+
const disabled = useDisabledContext({
|
|
232
213
|
consumerName: 'TileTitle',
|
|
233
214
|
contextRequired: true
|
|
234
215
|
});
|
|
@@ -287,9 +268,7 @@ export const TileDescription = ({
|
|
|
287
268
|
lx,
|
|
288
269
|
style
|
|
289
270
|
}) => {
|
|
290
|
-
const {
|
|
291
|
-
disabled
|
|
292
|
-
} = useTileContext({
|
|
271
|
+
const disabled = useDisabledContext({
|
|
293
272
|
consumerName: 'TileDescription',
|
|
294
273
|
contextRequired: true
|
|
295
274
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["DisabledProvider","isTextChildren","useDisabledContext","StyleSheet","View","useStyleSheet","Box","Pressable","Text","jsx","_jsx","useRootStyles","appearance","disabled","pressed","centered","t","bgColors","colors","bg","baseTransparent","card","surface","pressedBgColors","baseTransparentPressed","surfacePressed","container","flatten","position","flexDirection","overflow","width","flex","alignItems","gap","spacings","s8","paddingHorizontal","paddingVertical","s12","borderRadius","sm","backgroundColor","justifyContent","Tile","lx","style","disabledProp","children","ref","props","consumerName","mergeWith","value","accessibilityRole","accessibilityState","TilePressableContent","displayName","styles","useContentStyles","sizes","full","TileContent","testID","useTitleStyles","text","typographies","body2SemiBold","textAlign","color","base","TileTitle","contextRequired","numberOfLines","useDescriptionStyles","body3","muted","TileDescription","useTrailingContentStyles","marginTop","s4","TileTrailingContent"],"sourceRoot":"../../../../../src","sources":["lib/Components/Tile/Tile.tsx"],"mappings":";;AAAA,SACEA,gBAAgB,EAChBC,cAAc,EACdC,kBAAkB,QACb,8BAA8B;AAErC,SAASC,UAAU,EAAEC,IAAI,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AAC,CAAE;IACrDiB,MAAM,EAAC,uBAAuB;IAAAf,QAAA,EAE7BA;EAAQ,CACN,CAAC;AAEV,CAAC;AACDiC,mBAAmB,CAACxB,WAAW,GAAG,qBAAqB","ignoreList":[]}
|
|
@@ -26,11 +26,11 @@ Tile components are compact, card-like interactive elements designed for horizon
|
|
|
26
26
|
|
|
27
27
|
## Anatomy
|
|
28
28
|
|
|
29
|
-
- **
|
|
30
|
-
- **TileContent**: Container for title, description
|
|
29
|
+
- **Tile**: Root container; direct children are laid out vertically (e.g. Spot, TileContent)
|
|
30
|
+
- **TileContent**: Container for title, description and trailing content
|
|
31
31
|
- **TileTitle**: The main label of the item (required)
|
|
32
32
|
- **TileDescription (optional)**: Provides additional context
|
|
33
|
-
- **TileTrailingContent (optional)**: Container for
|
|
33
|
+
- **TileTrailingContent (optional)**: Container for Tags, labels, or other supplementary content
|
|
34
34
|
|
|
35
35
|
## Properties
|
|
36
36
|
|
|
@@ -94,10 +94,10 @@ Install and set up the library with our [Setup Guide →](?path=/docs/getting-st
|
|
|
94
94
|
```tsx
|
|
95
95
|
import {
|
|
96
96
|
Tile,
|
|
97
|
-
TileSpot,
|
|
98
97
|
TileContent,
|
|
99
98
|
TileTitle,
|
|
100
99
|
TileDescription,
|
|
100
|
+
Spot,
|
|
101
101
|
} from '@ledgerhq/lumen-ui-rnative';
|
|
102
102
|
import { Settings } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
103
103
|
|
|
@@ -108,7 +108,7 @@ function MyComponent() {
|
|
|
108
108
|
onPress={() => console.log('Primary action')}
|
|
109
109
|
onLongPress={() => console.log('Secondary action')}
|
|
110
110
|
>
|
|
111
|
-
<
|
|
111
|
+
<Spot appearance='icon' icon={Settings} />
|
|
112
112
|
<TileContent>
|
|
113
113
|
<TileTitle>Settings</TileTitle>
|
|
114
114
|
<TileDescription>Manage preferences</TileDescription>
|
|
@@ -122,20 +122,22 @@ function MyComponent() {
|
|
|
122
122
|
|
|
123
123
|
### With Trailing Content (Tags, etc.)
|
|
124
124
|
|
|
125
|
+
Use TileTrailingContent inside TileContent to wrap Tags or other supplementary content.
|
|
126
|
+
|
|
125
127
|
```tsx
|
|
126
128
|
import {
|
|
127
129
|
Tile,
|
|
128
|
-
TileSpot,
|
|
129
130
|
TileContent,
|
|
130
131
|
TileTitle,
|
|
131
132
|
TileDescription,
|
|
132
133
|
TileTrailingContent,
|
|
133
134
|
Tag,
|
|
135
|
+
Spot,
|
|
134
136
|
} from '@ledgerhq/lumen-ui-rnative';
|
|
135
137
|
import { Bitcoin } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
136
138
|
|
|
137
139
|
<Tile appearance='card'>
|
|
138
|
-
<
|
|
140
|
+
<Spot appearance='icon' icon={Bitcoin} />
|
|
139
141
|
<TileContent>
|
|
140
142
|
<TileTitle>Bitcoin</TileTitle>
|
|
141
143
|
<TileDescription>BTC</TileDescription>
|
|
@@ -150,7 +152,7 @@ import { Bitcoin } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
|
150
152
|
|
|
151
153
|
```tsx
|
|
152
154
|
<Tile disabled>
|
|
153
|
-
<
|
|
155
|
+
<Spot appearance='icon' icon={Settings} />
|
|
154
156
|
<TileContent>
|
|
155
157
|
<TileTitle>Settings</TileTitle>
|
|
156
158
|
<TileDescription>Unavailable</TileDescription>
|
|
@@ -163,13 +165,14 @@ import { Bitcoin } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
|
163
165
|
Use the `centered` prop to vertically center the tile content. This is useful when a tile has less content than its neighbors in a grid, like a "Show more" tile that needs to align with richer tiles.
|
|
164
166
|
|
|
165
167
|
```tsx
|
|
166
|
-
import { ChevronRight } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
168
|
+
import { ChevronRight, CryptoBitcoinCoin } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
169
|
+
import { Spot, Tile, TileContent, TileTitle, TileDescription, TileTrailingContent, Tag } from '@ledgerhq/lumen-ui-rnative';
|
|
167
170
|
import { View } from 'react-native';
|
|
168
171
|
|
|
169
172
|
// In a grid where other tiles have more content
|
|
170
173
|
<View style={{ flexDirection: 'row', gap: 8 }}>
|
|
171
174
|
<Tile appearance='card'>
|
|
172
|
-
<
|
|
175
|
+
<Spot appearance='icon' icon={CryptoBitcoinCoin} />
|
|
173
176
|
<TileContent>
|
|
174
177
|
<TileTitle>Title</TileTitle>
|
|
175
178
|
<TileDescription>Description</TileDescription>
|
|
@@ -181,7 +184,7 @@ import { View } from 'react-native';
|
|
|
181
184
|
|
|
182
185
|
{/* Show more tile with centered content */}
|
|
183
186
|
<Tile appearance='card' centered>
|
|
184
|
-
<
|
|
187
|
+
<Spot appearance='icon' icon={ChevronRight} />
|
|
185
188
|
<TileContent>
|
|
186
189
|
<TileTitle>Show more</TileTitle>
|
|
187
190
|
</TileContent>
|
|
@@ -194,14 +197,15 @@ import { View } from 'react-native';
|
|
|
194
197
|
```tsx
|
|
195
198
|
import {
|
|
196
199
|
Tile,
|
|
197
|
-
TileSpot,
|
|
198
200
|
TileContent,
|
|
199
201
|
TileTitle,
|
|
200
202
|
TileDescription,
|
|
203
|
+
Spot,
|
|
201
204
|
} from '@ledgerhq/lumen-ui-rnative';
|
|
205
|
+
import { CryptoBitcoinCoin } from '@ledgerhq/lumen-ui-rnative/symbols';
|
|
202
206
|
|
|
203
207
|
<Tile onPress={() => console.log('Clicked!')}>
|
|
204
|
-
<
|
|
208
|
+
<Spot appearance='icon' icon={CryptoBitcoinCoin} />
|
|
205
209
|
<TileContent>
|
|
206
210
|
<TileTitle>Bitcoin</TileTitle>
|
|
207
211
|
<TileDescription>BTC</TileDescription>
|
|
@@ -213,17 +217,21 @@ import {
|
|
|
213
217
|
|
|
214
218
|
```tsx
|
|
215
219
|
import { ScrollView } from 'react-native';
|
|
220
|
+
import { Tile, TileContent, TileTitle, TileDescription, Spot } from '@ledgerhq/lumen-ui-rnative';
|
|
216
221
|
|
|
217
222
|
<ScrollView horizontal>
|
|
218
|
-
{items.map((item) =>
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
<
|
|
222
|
-
<
|
|
223
|
-
<
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
223
|
+
{items.map((item) => {
|
|
224
|
+
const Icon = item.icon;
|
|
225
|
+
return (
|
|
226
|
+
<Tile key={item.id} lx={{ width: 's128', flexShrink: 0 }}>
|
|
227
|
+
<Spot appearance='icon' icon={Icon} />
|
|
228
|
+
<TileContent>
|
|
229
|
+
<TileTitle>{item.title}</TileTitle>
|
|
230
|
+
<TileDescription>{item.description}</TileDescription>
|
|
231
|
+
</TileContent>
|
|
232
|
+
</Tile>
|
|
233
|
+
);
|
|
234
|
+
})}
|
|
227
235
|
</ScrollView>;
|
|
228
236
|
```
|
|
229
237
|
|
|
@@ -234,7 +242,7 @@ import { ScrollView } from 'react-native';
|
|
|
234
242
|
onPress={() => console.log('Primary action')}
|
|
235
243
|
onLongPress={() => console.log('Secondary action - show menu')}
|
|
236
244
|
>
|
|
237
|
-
<
|
|
245
|
+
<Spot appearance='icon' icon={Settings} />
|
|
238
246
|
<TileContent>
|
|
239
247
|
<TileTitle>Settings</TileTitle>
|
|
240
248
|
<TileDescription>Long press for options</TileDescription>
|
|
@@ -251,13 +259,13 @@ import { ScrollView } from 'react-native';
|
|
|
251
259
|
<DoVsDontRow>
|
|
252
260
|
<DoBlockItem
|
|
253
261
|
title='Use TileTrailingContent for additional elements'
|
|
254
|
-
description='Wrap Tags, labels, or supplementary content inside TileTrailingContent within TileContent for proper
|
|
262
|
+
description='Wrap Tags, labels, or supplementary content inside TileTrailingContent within TileContent for proper spacing.'
|
|
255
263
|
>
|
|
256
264
|
|
|
257
265
|
```tsx
|
|
258
266
|
{/* prettier-ignore */}
|
|
259
267
|
<Tile>
|
|
260
|
-
<
|
|
268
|
+
<Spot appearance="icon" icon={Settings} />
|
|
261
269
|
<TileContent>
|
|
262
270
|
<TileTitle>Title</TileTitle>
|
|
263
271
|
<TileDescription>Description</TileDescription>
|
|
@@ -277,7 +285,7 @@ import { ScrollView } from 'react-native';
|
|
|
277
285
|
```tsx
|
|
278
286
|
{/* prettier-ignore */}
|
|
279
287
|
<Tile>
|
|
280
|
-
<
|
|
288
|
+
<Spot appearance="icon" icon={Settings} />
|
|
281
289
|
<TileContent>
|
|
282
290
|
<TileTitle>Title</TileTitle>
|
|
283
291
|
<TileDescription>Description</TileDescription>
|