@ledgerhq/native-ui 0.13.0-nightly.3 → 0.14.0-nightly.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.
@@ -5,6 +5,7 @@ export type SwitchProps = {
5
5
  onChange?: (value: boolean) => void;
6
6
  disabled?: boolean;
7
7
  label?: string;
8
+ testID?: string;
8
9
  } & Omit<Partial<NativeSwitchProps>, "onChange">;
9
- declare const Switch: ({ checked, onChange, disabled, label }: SwitchProps) => JSX.Element;
10
+ declare const Switch: ({ checked, onChange, disabled, label, testID }: SwitchProps) => JSX.Element;
10
11
  export default Switch;
@@ -7,7 +7,7 @@ const Pressable = proxyStyled(BasePressable).attrs({
7
7
  flexDirection: "row",
8
8
  alignItems: "center",
9
9
  }) ``;
10
- const Switch = ({ checked, onChange, disabled, label }) => {
10
+ const Switch = ({ checked, onChange, disabled, label, testID }) => {
11
11
  const { colors, space } = useTheme();
12
12
  const handlePress = useCallback(() => {
13
13
  if (disabled)
@@ -18,7 +18,7 @@ const Switch = ({ checked, onChange, disabled, label }) => {
18
18
  React.createElement(NativeSwitch, { trackColor: {
19
19
  false: colors.neutral.c50,
20
20
  true: colors.primary.c80,
21
- }, thumbColor: colors.neutral.c00, onValueChange: onChange, value: checked, disabled: disabled, ios_backgroundColor: colors.neutral.c50 }),
21
+ }, thumbColor: colors.neutral.c00, onValueChange: onChange, value: checked, disabled: disabled, ios_backgroundColor: colors.neutral.c50, testID: testID }),
22
22
  label ? (React.createElement(Text, { variant: "body", color: checked ? colors.primary.c90 : colors.neutral.c100, style: { marginLeft: space[3], flexShrink: 1 } }, label)) : null));
23
23
  };
24
24
  export default Switch;
@@ -6,9 +6,5 @@ declare const Divider: import("styled-components").StyledComponent<typeof import
6
6
  display?: string | undefined;
7
7
  position?: string | undefined;
8
8
  maxHeight?: string | number | undefined;
9
- } & {
10
- my: number;
11
- height: number;
12
- backgroundColor: string;
13
- }, "height" | "backgroundColor" | "my">;
9
+ }, never>;
14
10
  export default Divider;
@@ -1,7 +1,7 @@
1
- import { Flex } from "../index";
1
+ import Flex from "../Flex";
2
2
  import styled from "styled-components/native";
3
- const Divider = styled(Flex).attrs(() => ({
4
- my: 4,
3
+ const Divider = styled(Flex).attrs((p) => ({
4
+ my: p.my || 4,
5
5
  height: 1,
6
6
  backgroundColor: "neutral.c40",
7
7
  })) ``;
@@ -4,10 +4,12 @@ import { IconType } from "../../Icon/type";
4
4
  export interface TagProps extends FlexBoxProps {
5
5
  type?: "shade" | "color" | "warning";
6
6
  size?: "small" | "medium";
7
+ color?: string;
8
+ textColor?: string;
7
9
  Icon?: IconType;
8
10
  uppercase?: boolean;
9
11
  children?: React.ReactNode;
10
12
  numberOfLines?: number;
11
13
  ellipsizeMode?: "head" | "middle" | "tail" | "clip";
12
14
  }
13
- export default function Tag({ type, size, uppercase, Icon, children, numberOfLines, ellipsizeMode, ...props }: TagProps): JSX.Element;
15
+ export default function Tag({ type, size, color, textColor, uppercase, Icon, children, numberOfLines, ellipsizeMode, ...props }: TagProps): JSX.Element;
@@ -19,9 +19,9 @@ const typeColor = {
19
19
  warning: "warning.c100",
20
20
  };
21
21
  export default function Tag(_a) {
22
- var { type = "shade", size = "small", uppercase, Icon, children, numberOfLines, ellipsizeMode } = _a, props = __rest(_a, ["type", "size", "uppercase", "Icon", "children", "numberOfLines", "ellipsizeMode"]);
23
- return (React.createElement(Flex, Object.assign({ px: size === "small" ? "6px" : 3, alignItems: "center", justifyContent: "center", flexDirection: "row", borderRadius: 6, bg: typeColor[type], height: size === "small" ? "18px" : "28px" }, props),
22
+ var { type = "shade", size = "small", color, textColor, uppercase, Icon, children, numberOfLines, ellipsizeMode } = _a, props = __rest(_a, ["type", "size", "color", "textColor", "uppercase", "Icon", "children", "numberOfLines", "ellipsizeMode"]);
23
+ return (React.createElement(Flex, Object.assign({ px: size === "small" ? "6px" : 3, alignItems: "center", justifyContent: "center", flexDirection: "row", borderRadius: 6, bg: color || typeColor[type], height: size === "small" ? "18px" : "28px" }, props),
24
24
  Icon && (React.createElement(Box, { pr: 2 },
25
25
  React.createElement(Icon, { size: size === "small" ? 16 : 20, color: type === "shade" ? "neutral.c90" : "neutral.c00" }))),
26
- React.createElement(Text, { variant: size === "small" ? "subtitle" : "small", fontWeight: "bold", uppercase: uppercase !== false, textAlign: "center", color: type === "shade" ? "neutral.c90" : "neutral.c00", numberOfLines: numberOfLines, ellipsizeMode: ellipsizeMode }, children)));
26
+ React.createElement(Text, { variant: size === "small" ? "subtitle" : "small", fontWeight: "bold", uppercase: uppercase !== false, textAlign: "center", color: textColor || (type === "shade" ? "neutral.c90" : "neutral.c00"), numberOfLines: numberOfLines, ellipsizeMode: ellipsizeMode }, children)));
27
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/native-ui",
3
- "version": "0.13.0-nightly.3",
3
+ "version": "0.14.0-nightly.0",
4
4
  "description": "Ledger Live - Mobile UI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,7 +43,7 @@
43
43
  "styled-system": "^5.1.5",
44
44
  "victory-native": "^35.5.5",
45
45
  "@ledgerhq/crypto-icons-ui": "^0.2.1",
46
- "@ledgerhq/icons-ui": "^0.3.1-nightly.3",
46
+ "@ledgerhq/icons-ui": "^0.3.2",
47
47
  "@ledgerhq/ui-shared": "^0.1.10"
48
48
  },
49
49
  "peerDependencies": {