@ledgerhq/native-ui 0.43.1-nightly.0 → 0.44.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.
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ export declare const ApyIndicator: ({ value, type }: {
3
+ value: number;
4
+ type: "NRR" | "APY" | "APR";
5
+ }) => React.JSX.Element;
6
+ //# sourceMappingURL=ApyIndicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApyIndicator.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/ApyIndicator/ApyIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,YAAY;WAA8B,MAAM;UAAQ,KAAK,GAAG,KAAK,GAAG,KAAK;uBAEzF,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { Tag } from "../Tag/Tag";
3
+ export const ApyIndicator = ({ value, type }) => {
4
+ return React.createElement(Tag, { spacing: "md" }, `~ ${value}% ${type}`);
5
+ };
@@ -0,0 +1,11 @@
1
+ import { type Meta, type StoryObj } from "@storybook/react";
2
+ import { ApyIndicator } from "./ApyIndicator";
3
+ declare const meta: Meta<typeof ApyIndicator>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof ApyIndicator>;
6
+ export declare const Default: Story;
7
+ export declare const APY: Story;
8
+ export declare const APR: Story;
9
+ export declare const NRR: Story;
10
+ export declare const TestApyIndicator: Story;
11
+ //# sourceMappingURL=ApyIndicator.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApyIndicator.stories.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/ApyIndicator/ApyIndicator.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAKnC,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAC;AAE3C,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,GAAG,EAAE,KAA4C,CAAC;AAC/D,eAAO,MAAM,GAAG,EAAE,KAA4C,CAAC;AAC/D,eAAO,MAAM,GAAG,EAAE,KAA4C,CAAC;AAE/D,eAAO,MAAM,gBAAgB,EAAE,KAM9B,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { ApyIndicator } from "./ApyIndicator";
2
+ import { expect } from "@storybook/jest";
3
+ import { within } from "@storybook/testing-library";
4
+ const meta = {
5
+ component: ApyIndicator,
6
+ title: "PreLdls/Components/ApyIndicator",
7
+ tags: ["autodocs"],
8
+ args: { value: 30, type: "APY" },
9
+ };
10
+ export default meta;
11
+ export const Default = {};
12
+ export const APY = { args: { value: 30, type: "APY" } };
13
+ export const APR = { args: { value: 20, type: "APR" } };
14
+ export const NRR = { args: { value: 10, type: "NRR" } };
15
+ export const TestApyIndicator = {
16
+ play: async ({ canvasElement }) => {
17
+ const canvas = within(canvasElement);
18
+ const input = canvas.getByTestId("tag");
19
+ await expect(input).toHaveTextContent("~ 30% APY");
20
+ },
21
+ };
@@ -1,7 +1,8 @@
1
1
  import React, { ReactNode } from "react";
2
2
  import { TextStyle } from "react-native";
3
- export declare const Tag: ({ textTransform, children, }: {
3
+ export declare const Tag: ({ textTransform, children, spacing, }: {
4
4
  textTransform?: TextStyle["textTransform"];
5
5
  children: ReactNode;
6
+ spacing?: "sm" | "md" | undefined;
6
7
  }) => React.JSX.Element;
7
8
  //# sourceMappingURL=Tag.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/Tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAWzC,eAAO,MAAM,GAAG;oBAIE,SAAS,CAAC,eAAe,CAAC;cAChC,SAAS;uBAcpB,CAAC"}
1
+ {"version":3,"file":"Tag.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/Tag/Tag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAWzC,eAAO,MAAM,GAAG;oBAKE,SAAS,CAAC,eAAe,CAAC;cAChC,SAAS;;uBAepB,CAAC"}
@@ -2,13 +2,13 @@ import React from "react";
2
2
  import styled from "styled-components/native";
3
3
  import { Text } from "../../../components";
4
4
  const Wrapper = styled.View `
5
- padding: 1px 4px;
6
5
  border-radius: 4px;
7
- background-color: ${(props) => props.theme.colors.palette.neutral.c30};
6
+ background-color: ${(props) => props.theme.colors.neutral.c30};
8
7
  flex-shrink: 0;
9
8
  align-self: flex-start;
9
+ padding: ${(props) => (props.$spacing === "sm" ? "1px 4px" : "2px 6px")};
10
10
  `;
11
- export const Tag = ({ textTransform = "none", children, }) => {
12
- return (React.createElement(Wrapper, { testID: "tag" },
11
+ export const Tag = ({ textTransform = "none", children, spacing = "sm", }) => {
12
+ return (React.createElement(Wrapper, { testID: "tag", "$spacing": spacing },
13
13
  React.createElement(Text, { color: "palette.neutral.c70", fontSize: "10px", lineHeight: "16px", textTransform: textTransform }, children)));
14
14
  };
@@ -0,0 +1,9 @@
1
+ import { type Meta, type StoryObj } from "@storybook/react";
2
+ import { Tag } from "./Tag";
3
+ declare const meta: Meta<typeof Tag>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Tag>;
6
+ export declare const Default: Story;
7
+ export declare const VariantMd: Story;
8
+ export declare const TestTag: Story;
9
+ //# sourceMappingURL=Tag.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tag.stories.d.ts","sourceRoot":"","sources":["../../../../src/pre-ldls/components/Tag/Tag.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAI5B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,GAAG,CAM1B,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,GAAG,CAAC,CAAC;AAElC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,SAAS,EAAE,KAAmC,CAAC;AAE5D,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Tag } from "./Tag";
2
+ import { expect } from "@storybook/jest";
3
+ import { within } from "@storybook/testing-library";
4
+ const meta = {
5
+ component: Tag,
6
+ title: "PreLdls/Components/Tag",
7
+ tags: ["autodocs"],
8
+ args: { children: "Native Segwit", spacing: "sm" },
9
+ argTypes: { spacing: { control: "select", options: ["sm", "md"] } },
10
+ };
11
+ export default meta;
12
+ export const Default = {};
13
+ export const VariantMd = { args: { spacing: "md" } };
14
+ export const TestTag = {
15
+ play: async ({ canvasElement }) => {
16
+ const canvas = within(canvasElement);
17
+ const input = canvas.getByTestId("tag");
18
+ await expect(input).toHaveTextContent("Native Segwit");
19
+ },
20
+ };
@@ -1,6 +1,7 @@
1
1
  export * from "./Input/Input";
2
2
  export * from "./AssetItem/AssetItem";
3
3
  export * from "./AssetTypeList/AssetList";
4
+ export * from "./ApyIndicator/ApyIndicator";
4
5
  export * from "./NetworkItem/NetworkItem";
5
6
  export * from "./NetworkList/NetworkList";
6
7
  export * from "./Tag/Tag";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pre-ldls/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pre-ldls/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qCAAqC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  export * from "./Input/Input";
2
2
  export * from "./AssetItem/AssetItem";
3
3
  export * from "./AssetTypeList/AssetList";
4
+ export * from "./ApyIndicator/ApyIndicator";
4
5
  export * from "./NetworkItem/NetworkItem";
5
6
  export * from "./NetworkList/NetworkList";
6
7
  export * from "./Tag/Tag";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/native-ui",
3
- "version": "0.43.1-nightly.0",
3
+ "version": "0.44.0-nightly.1",
4
4
  "description": "Ledger Live - Mobile UI",
5
5
  "repository": {
6
6
  "type": "git",