@ledgerhq/native-ui 0.6.0 → 0.6.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.
- package/assets/fonts/.DS_Store +0 -0
- package/assets/fonts/alpha/.DS_Store +0 -0
- package/components/Form/SelectableList.d.ts +11 -7
- package/components/Form/SelectableList.js +5 -3
- package/components/Form/Switch/index.js +1 -1
- package/components/Icon/BoxedIcon.d.ts +48 -0
- package/components/Icon/BoxedIcon.js +87 -0
- package/components/Icon/IconBox/index.d.ts +2 -4
- package/components/Icon/IconBox/index.js +1 -2
- package/components/Icon/index.d.ts +1 -0
- package/components/Icon/index.js +1 -0
- package/components/Icon/type.d.ts +7 -0
- package/components/Icon/type.js +1 -0
- package/components/Layout/List/IconBoxList/index.d.ts +10 -0
- package/components/Layout/List/IconBoxList/index.js +19 -0
- package/components/Layout/List/List/index.d.ts +13 -0
- package/components/Layout/List/List/index.js +29 -0
- package/components/Layout/List/NumberedList/index.d.ts +9 -0
- package/components/Layout/List/NumberedList/index.js +20 -0
- package/components/Layout/List/TipList/index.d.ts +9 -0
- package/components/Layout/List/TipList/index.js +20 -0
- package/components/Layout/List/index.d.ts +4 -0
- package/components/Layout/List/index.js +4 -0
- package/components/Layout/index.d.ts +1 -0
- package/components/Layout/index.js +1 -0
- package/components/Loader/InfiniteLoader/index.d.ts +9 -0
- package/components/Loader/InfiniteLoader/index.js +62 -0
- package/components/Loader/ProgressLoader/index.d.ts +11 -0
- package/components/Loader/ProgressLoader/index.js +24 -0
- package/components/Loader/index.d.ts +2 -11
- package/components/Loader/index.js +2 -24
- package/components/Navigation/FlowStepper/index.d.ts +7 -1
- package/components/Navigation/FlowStepper/index.js +2 -2
- package/components/Text/getTextStyle.d.ts +1 -0
- package/components/Text/getTextStyle.js +5 -0
- package/components/Text/index.d.ts +6 -8
- package/components/Text/index.js +15 -8
- package/components/index.d.ts +1 -1
- package/components/index.js +1 -1
- package/components/message/Alert/index.js +1 -1
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { ComponentType } from "react";
|
|
2
2
|
import { GestureResponderEvent } from "react-native";
|
|
3
|
-
|
|
3
|
+
import { IconType } from "../Icon/type";
|
|
4
|
+
declare type BaseElementProps<V> = {
|
|
4
5
|
first?: boolean;
|
|
5
6
|
selected?: boolean;
|
|
6
7
|
disabled?: boolean;
|
|
7
8
|
value?: V;
|
|
8
9
|
onPress?: ((event: GestureResponderEvent) => void) | undefined;
|
|
9
|
-
Icon?:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
Icon?: IconType;
|
|
11
|
+
};
|
|
12
|
+
export declare type ElementProps<V> = React.PropsWithChildren<BaseElementProps<V> & {
|
|
13
|
+
/**
|
|
14
|
+
* A function that will render some content on the right side of the input.
|
|
15
|
+
*/
|
|
16
|
+
renderRight?: ComponentType<BaseElementProps<V>> | React.ReactElement;
|
|
13
17
|
}>;
|
|
14
18
|
export declare type Props<V> = React.PropsWithChildren<{
|
|
15
19
|
currentValue?: V;
|
|
@@ -17,6 +21,6 @@ export declare type Props<V> = React.PropsWithChildren<{
|
|
|
17
21
|
}>;
|
|
18
22
|
declare function SelectableList<V>({ currentValue, onChange, children }: Props<V>): JSX.Element;
|
|
19
23
|
declare namespace SelectableList {
|
|
20
|
-
var Element: <V>(
|
|
24
|
+
var Element: <V>(props: ElementProps<V>) => JSX.Element;
|
|
21
25
|
}
|
|
22
26
|
export default SelectableList;
|
|
@@ -7,12 +7,14 @@ const ElementContainer = styled(Flex).attrs({
|
|
|
7
7
|
accessible: true,
|
|
8
8
|
accessibilityRole: "radio",
|
|
9
9
|
}) ``;
|
|
10
|
-
function Element(
|
|
10
|
+
function Element(props) {
|
|
11
|
+
const { first, value, selected, disabled, onPress, children, Icon, renderRight: RenderRight, } = props;
|
|
11
12
|
return (React.createElement(TouchableOpacity, { onPress: onPress, disabled: disabled },
|
|
12
13
|
React.createElement(ElementContainer, { p: 6, mt: first ? 0 : 4, backgroundColor: selected ? "primary.c20" : "neutral.c00", border: "1px solid", borderColor: selected ? "primary.c100" : "neutral.c40", borderRadius: 1, flexDirection: "row", alignItems: "center" },
|
|
13
|
-
Icon && (React.createElement(Flex, { mr: 6 },
|
|
14
|
+
Icon && (React.createElement(Flex, { mr: 6, flexShrink: 0 },
|
|
14
15
|
React.createElement(Icon, { size: 24, color: disabled ? "neutral.c50" : "neutral.c100" }))),
|
|
15
|
-
React.createElement(Text, { variant: "large", color: disabled ? "neutral.c50" : "neutral.c100" }, children || value)
|
|
16
|
+
React.createElement(Text, { variant: "large", flex: 1, color: disabled ? "neutral.c50" : "neutral.c100" }, children || value),
|
|
17
|
+
RenderRight && (React.createElement(Flex, { pl: 6, flexShrink: 0 }, React.isValidElement(RenderRight) ? (RenderRight) : (React.createElement(RenderRight, Object.assign({}, props))))))));
|
|
16
18
|
}
|
|
17
19
|
function SelectableList({ currentValue, onChange, children }) {
|
|
18
20
|
return (React.createElement(Flex, { accessible: true, accessibilityRole: "radiogroup" }, React.Children.map(children, (child, index) => {
|
|
@@ -10,6 +10,6 @@ const Switch = ({ checked, onChange, disabled, label, }) => {
|
|
|
10
10
|
false: colors.neutral.c50,
|
|
11
11
|
true: colors.primary.c80,
|
|
12
12
|
}, thumbColor: colors.neutral.c00, onValueChange: onChange, value: checked, disabled: disabled, ios_backgroundColor: colors.neutral.c50 }),
|
|
13
|
-
label ? (React.createElement(Text, { variant: "body", color: checked ? colors.primary.c90 : colors.neutral.c100, style: { marginLeft: space[3] } }, label)) : null));
|
|
13
|
+
label ? (React.createElement(Text, { variant: "body", color: checked ? colors.primary.c90 : colors.neutral.c100, style: { marginLeft: space[3], flexShrink: 1 } }, label)) : null));
|
|
14
14
|
};
|
|
15
15
|
export default Switch;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const DEFAULT_BOX_SIZE = 40;
|
|
3
|
+
export declare const DEFAULT_ICON_SIZE = 16;
|
|
4
|
+
export declare const DEFAULT_BADGE_SIZE = 20;
|
|
5
|
+
export declare type IconProps = {
|
|
6
|
+
size?: number;
|
|
7
|
+
color?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare type IconBoxProps = {
|
|
10
|
+
/**
|
|
11
|
+
* Component that takes `{size?: number; color?: string}` as props. Will be rendered at the top right with the size provided in `badgeSize` or a default size.
|
|
12
|
+
*/
|
|
13
|
+
Badge?: React.ComponentType<IconProps>;
|
|
14
|
+
/**
|
|
15
|
+
* Color of the border
|
|
16
|
+
*/
|
|
17
|
+
borderColor?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Badge color, will be applied to the component provided in the `Badge` prop
|
|
20
|
+
*/
|
|
21
|
+
badgeColor?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Badge size, will be applied to the component provided in the `Badge` prop
|
|
24
|
+
*/
|
|
25
|
+
badgeSize?: number;
|
|
26
|
+
children?: JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* Box size for preview
|
|
29
|
+
*/
|
|
30
|
+
size?: number;
|
|
31
|
+
};
|
|
32
|
+
export declare type BoxedIconProps = IconBoxProps & {
|
|
33
|
+
/**
|
|
34
|
+
* Component that takes `{size?: number; color?: string}` as props. Will be rendered at the top right with the size provided in `iconSize` or a default size.
|
|
35
|
+
*/
|
|
36
|
+
Icon: React.ComponentType<IconProps> | ((props: IconProps) => JSX.Element);
|
|
37
|
+
/**
|
|
38
|
+
* Icon size, will be applied to the component provided in the `Icon` prop
|
|
39
|
+
*/
|
|
40
|
+
iconSize?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Icon color, will be applied to the component provided in the `Icon` prop
|
|
43
|
+
*/
|
|
44
|
+
iconColor?: string;
|
|
45
|
+
};
|
|
46
|
+
export declare const IconBox: ({ Badge, size, children, borderColor, badgeColor, badgeSize, }: IconBoxProps) => JSX.Element;
|
|
47
|
+
declare const BoxedIcon: ({ Icon, iconSize, iconColor, ...iconBoxProps }: BoxedIconProps) => JSX.Element;
|
|
48
|
+
export default BoxedIcon;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React from "react";
|
|
13
|
+
import styled, { useTheme } from "styled-components/native";
|
|
14
|
+
import { PixelRatio } from "react-native";
|
|
15
|
+
import { Rect, ClipPath, Svg, Defs } from "react-native-svg";
|
|
16
|
+
import Flex from "../Layout/Flex";
|
|
17
|
+
import Box from "../Layout/Box";
|
|
18
|
+
export const DEFAULT_BOX_SIZE = 40;
|
|
19
|
+
export const DEFAULT_ICON_SIZE = 16;
|
|
20
|
+
export const DEFAULT_BADGE_SIZE = 20;
|
|
21
|
+
const BORDER_RADIUS = 2;
|
|
22
|
+
function getClipRectangleSize(badgeSize) {
|
|
23
|
+
return (3 / 4) * badgeSize;
|
|
24
|
+
}
|
|
25
|
+
const Container = styled(Flex).attrs((p) => ({
|
|
26
|
+
heigth: p.size,
|
|
27
|
+
width: p.size,
|
|
28
|
+
alignItems: "center",
|
|
29
|
+
justifyContent: "center",
|
|
30
|
+
position: "relative",
|
|
31
|
+
overflow: "visible",
|
|
32
|
+
})) ``;
|
|
33
|
+
const IconBoxBackground = styled(Flex) `
|
|
34
|
+
position: absolute;
|
|
35
|
+
height: ${(p) => p.size}px;
|
|
36
|
+
width: ${(p) => p.size}px;
|
|
37
|
+
border-radius: ${(p) => p.theme.radii[BORDER_RADIUS]}px;
|
|
38
|
+
`;
|
|
39
|
+
const BadgeContainer = styled.View `
|
|
40
|
+
position: absolute;
|
|
41
|
+
overflow: visible;
|
|
42
|
+
${(p) => `
|
|
43
|
+
top: -${p.badgeSize / 2 - 2}px;
|
|
44
|
+
right: -${p.badgeSize / 2 - 2}px;
|
|
45
|
+
height: ${p.badgeSize}px;
|
|
46
|
+
width: ${p.badgeSize}px;`}
|
|
47
|
+
`;
|
|
48
|
+
/** This component is needed to draw a border that is clipped behind the badge icon */
|
|
49
|
+
const IconBoxBackgroundSVG = ({ size, borderColor, badgeSize, }) => {
|
|
50
|
+
const { colors, radii } = useTheme();
|
|
51
|
+
const borderRadius = radii[BORDER_RADIUS];
|
|
52
|
+
const borderWidth = 1;
|
|
53
|
+
const paletteStr = borderColor.split(".")[0];
|
|
54
|
+
// @ts-expect-error idk how to handle this properly pls help
|
|
55
|
+
const palette = colors[paletteStr];
|
|
56
|
+
const strokeColor = (palette ? palette[borderColor.split(".")[1]] : borderColor) ||
|
|
57
|
+
colors.neutral.c40;
|
|
58
|
+
const squareSize = getClipRectangleSize(badgeSize);
|
|
59
|
+
/**
|
|
60
|
+
* The following adjustments are necessary to have visual consistency
|
|
61
|
+
* between RN (native) Views with border and this component
|
|
62
|
+
*/
|
|
63
|
+
const svgSize = size + borderWidth;
|
|
64
|
+
const rectSize = size - borderWidth;
|
|
65
|
+
const rectRadius = borderRadius - borderWidth / 2;
|
|
66
|
+
return (React.createElement(Box, { position: "absolute", overflow: "hidden" },
|
|
67
|
+
React.createElement(Svg, { height: svgSize, width: svgSize },
|
|
68
|
+
React.createElement(Defs, null,
|
|
69
|
+
React.createElement(ClipPath, { id: "clip" },
|
|
70
|
+
React.createElement(Rect, { x: "0", y: "0", width: svgSize - squareSize, height: squareSize }),
|
|
71
|
+
React.createElement(Rect, { x: "0", y: squareSize, width: "100%", height: svgSize - squareSize }))),
|
|
72
|
+
React.createElement(Rect, { strokeWidth: PixelRatio.roundToNearestPixel(borderWidth), stroke: strokeColor, x: borderWidth, y: borderWidth, rx: rectRadius, ry: rectRadius, width: rectSize, height: rectSize, fill: "transparent", clipPath: "url(#clip)" }))));
|
|
73
|
+
};
|
|
74
|
+
export const IconBox = ({ Badge, size = DEFAULT_BOX_SIZE, children, borderColor = "neutral.c40", badgeColor, badgeSize = DEFAULT_BADGE_SIZE, }) => {
|
|
75
|
+
const hasBadge = !!Badge;
|
|
76
|
+
return (React.createElement(Container, { size: size },
|
|
77
|
+
hasBadge ? (React.createElement(IconBoxBackgroundSVG, { size: size, badgeSize: badgeSize, borderColor: borderColor })) : (React.createElement(IconBoxBackground, { border: "1px solid", size: size, borderColor: borderColor })),
|
|
78
|
+
children,
|
|
79
|
+
hasBadge && (React.createElement(BadgeContainer, { badgeSize: badgeSize },
|
|
80
|
+
React.createElement(Badge, { size: badgeSize, color: badgeColor })))));
|
|
81
|
+
};
|
|
82
|
+
const BoxedIcon = (_a) => {
|
|
83
|
+
var { Icon, iconSize = DEFAULT_ICON_SIZE, iconColor } = _a, iconBoxProps = __rest(_a, ["Icon", "iconSize", "iconColor"]);
|
|
84
|
+
return (React.createElement(IconBox, Object.assign({}, iconBoxProps),
|
|
85
|
+
React.createElement(Icon, { size: iconSize || DEFAULT_ICON_SIZE, color: iconColor })));
|
|
86
|
+
};
|
|
87
|
+
export default BoxedIcon;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { IconOrElementType } from "../type";
|
|
2
3
|
declare type Props = {
|
|
3
|
-
Icon:
|
|
4
|
-
size?: number;
|
|
5
|
-
color?: string;
|
|
6
|
-
}) => React.ReactElement;
|
|
4
|
+
Icon: IconOrElementType;
|
|
7
5
|
color?: string;
|
|
8
6
|
boxSize?: number;
|
|
9
7
|
iconSize?: number;
|
|
@@ -14,6 +14,5 @@ const IconContainer = styled.View `
|
|
|
14
14
|
`;
|
|
15
15
|
export default function IconBox({ Icon, color, boxSize = DEFAULT_BOX_SIZE, iconSize = DEFAULT_ICON_SIZE, }) {
|
|
16
16
|
const { colors } = useTheme();
|
|
17
|
-
return (React.createElement(IconContainer, { size: boxSize },
|
|
18
|
-
React.createElement(Icon, { size: iconSize, color: color || colors.neutral.c100 })));
|
|
17
|
+
return (React.createElement(IconContainer, { size: boxSize }, React.isValidElement(Icon) ? (Icon) : (React.createElement(Icon, { size: iconSize, color: color || colors.neutral.c100 }))));
|
|
19
18
|
}
|
package/components/Icon/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BaseListItemProps, BaseListProps } from "../List";
|
|
3
|
+
import { IconType } from "../../../Icon/type";
|
|
4
|
+
export declare type IconBoxListItemProps = Omit<BaseListItemProps, "bullet"> & {
|
|
5
|
+
Icon: IconType;
|
|
6
|
+
};
|
|
7
|
+
export declare type IconBoxListProps = Omit<BaseListProps, "items"> & {
|
|
8
|
+
items: IconBoxListItemProps[];
|
|
9
|
+
};
|
|
10
|
+
export default function IconBoxList({ items, ...props }: IconBoxListProps): React.ReactElement;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { useMemo } from "react";
|
|
13
|
+
import List from "../List";
|
|
14
|
+
import { IconBox } from "../../../Icon";
|
|
15
|
+
export default function IconBoxList(_a) {
|
|
16
|
+
var { items } = _a, props = __rest(_a, ["items"]);
|
|
17
|
+
const iconBoxItems = useMemo(() => items.map((item) => (Object.assign(Object.assign({}, item), { bullet: React.createElement(IconBox, { Icon: item.Icon, boxSize: 48, iconSize: 20 }) }))), [items]);
|
|
18
|
+
return React.createElement(List, Object.assign({ items: iconBoxItems }, props));
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BaseStyledProps } from "../../../styled";
|
|
3
|
+
export declare type BaseListItemProps = {
|
|
4
|
+
title?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
bullet?: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare type BaseListProps = {
|
|
9
|
+
items: BaseListItemProps[];
|
|
10
|
+
itemContainerProps?: BaseStyledProps;
|
|
11
|
+
};
|
|
12
|
+
export declare const ListItem: ({ title, description, bullet, ...props }: BaseStyledProps & BaseListItemProps) => React.ReactElement;
|
|
13
|
+
export default function List({ items, itemContainerProps, ...props }: BaseListProps): React.ReactElement;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { useCallback } from "react";
|
|
13
|
+
import Text from "../../../Text";
|
|
14
|
+
import { Box, Flex } from "../../index";
|
|
15
|
+
import { FlatList } from "react-native";
|
|
16
|
+
export const ListItem = (_a) => {
|
|
17
|
+
var { title, description, bullet = null } = _a, props = __rest(_a, ["title", "description", "bullet"]);
|
|
18
|
+
return (React.createElement(Flex, Object.assign({ flexDirection: "row", alignItems: "center" }, props),
|
|
19
|
+
bullet && (React.createElement(Box, { mr: 7, flexShrink: 0 }, bullet)),
|
|
20
|
+
React.createElement(Flex, { flexDirection: "column", flexShrink: 1, flexWrap: "nowrap" },
|
|
21
|
+
title && (React.createElement(Text, { variant: "body", fontWeight: "semiBold", color: "neutral.c100", flexShrink: 1, mb: description ? 2 : null }, title)),
|
|
22
|
+
description && (React.createElement(Text, { variant: "body", fontWeight: "medium", color: "neutral.c80", flexShrink: 1 }, description)))));
|
|
23
|
+
};
|
|
24
|
+
export default function List(_a) {
|
|
25
|
+
var { items, itemContainerProps } = _a, props = __rest(_a, ["items", "itemContainerProps"]);
|
|
26
|
+
const renderItem = useCallback(({ item }) => (React.createElement(ListItem, Object.assign({}, item, { mb: 6, pb: 2 }, itemContainerProps))), [itemContainerProps]);
|
|
27
|
+
return (React.createElement(Flex, Object.assign({ flexDirection: "column" }, props),
|
|
28
|
+
React.createElement(FlatList, { data: items, renderItem: renderItem })));
|
|
29
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BaseListItemProps, BaseListProps } from "../List";
|
|
3
|
+
export declare type NumberedListItemProps = Omit<BaseListItemProps, "bullet"> & {
|
|
4
|
+
number?: number;
|
|
5
|
+
};
|
|
6
|
+
export declare type NumberedListProps = Omit<BaseListProps, "items"> & {
|
|
7
|
+
items: NumberedListItemProps[];
|
|
8
|
+
};
|
|
9
|
+
export default function NumberedList({ items, ...props }: NumberedListProps): React.ReactElement;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { useMemo } from "react";
|
|
13
|
+
import List from "../List";
|
|
14
|
+
import { IconBox } from "../../../Icon";
|
|
15
|
+
import Text from "../../../Text";
|
|
16
|
+
export default function NumberedList(_a) {
|
|
17
|
+
var { items } = _a, props = __rest(_a, ["items"]);
|
|
18
|
+
const numberedItems = useMemo(() => items.map((item, index) => (Object.assign(Object.assign({}, item), { bullet: (React.createElement(IconBox, { Icon: React.createElement(Text, { variant: "body", fontWeight: "medium", color: "neutral.c100" }, item.number ? item.number : index), boxSize: 36 })) }))), [items]);
|
|
19
|
+
return React.createElement(List, Object.assign({ items: numberedItems }, props));
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BaseListItemProps, BaseListProps } from "../List";
|
|
3
|
+
export declare type TipListItemProps = Omit<BaseListItemProps, "bullet"> & {
|
|
4
|
+
isPositive: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare type TipListProps = Omit<BaseListProps, "items"> & {
|
|
7
|
+
items: TipListItemProps[];
|
|
8
|
+
};
|
|
9
|
+
export default function TipList({ items, ...props }: TipListProps): React.ReactElement;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { useMemo } from "react";
|
|
13
|
+
import List from "../List";
|
|
14
|
+
import Check from "@ledgerhq/icons-ui/native/CheckAloneMedium";
|
|
15
|
+
import Close from "@ledgerhq/icons-ui/native/CloseMedium";
|
|
16
|
+
export default function TipList(_a) {
|
|
17
|
+
var { items } = _a, props = __rest(_a, ["items"]);
|
|
18
|
+
const tipItems = useMemo(() => items.map((item) => (Object.assign(Object.assign({}, item), { bullet: item.isPositive ? (React.createElement(Check, { size: 20, color: "success.c100" })) : (React.createElement(Close, { size: 20, color: "error.c100" })) }))), [items]);
|
|
19
|
+
return React.createElement(List, Object.assign({ items: tipItems }, props));
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="styled-components-react-native" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { SizeProps } from "styled-system";
|
|
4
|
+
declare const Loader: import("styled-components").StyledComponent<import("react").ComponentClass<import("react-native-svg").SvgProps, any>, import("styled-components").DefaultTheme, SizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Height<import("styled-system").TLengthStyledSystem>>, never>;
|
|
5
|
+
export declare type Props = React.ComponentProps<typeof Loader> & {
|
|
6
|
+
color?: string;
|
|
7
|
+
};
|
|
8
|
+
export default function InfiniteLoader({ size, color, ...extraProps }: Props): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React, { useEffect } from "react";
|
|
13
|
+
import Svg, { LinearGradient, Stop, Mask, Path, Rect } from "react-native-svg";
|
|
14
|
+
import styled from "styled-components/native";
|
|
15
|
+
import { system, size } from "styled-system";
|
|
16
|
+
import Animated, { useAnimatedStyle, useSharedValue, withRepeat, withTiming, cancelAnimation, Easing, } from "react-native-reanimated";
|
|
17
|
+
const strokeSystem = system({
|
|
18
|
+
stroke: {
|
|
19
|
+
property: "stroke",
|
|
20
|
+
scale: "colors",
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
const Loader = styled(Svg).attrs((props) => (Object.assign({}, strokeSystem(props)))) `
|
|
24
|
+
${size}
|
|
25
|
+
`;
|
|
26
|
+
export default function InfiniteLoader(_a) {
|
|
27
|
+
var { size = 38, color = "primary.c50" } = _a, extraProps = __rest(_a, ["size", "color"]);
|
|
28
|
+
const rotation = useSharedValue(0);
|
|
29
|
+
const animatedStyles = useAnimatedStyle(() => {
|
|
30
|
+
return {
|
|
31
|
+
transform: [
|
|
32
|
+
{
|
|
33
|
+
rotateZ: `${rotation.value}deg`,
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
}, [rotation.value]);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
rotation.value = withRepeat(withTiming(360, {
|
|
40
|
+
duration: 1000,
|
|
41
|
+
easing: Easing.linear,
|
|
42
|
+
}), -1 //Infinite
|
|
43
|
+
);
|
|
44
|
+
return () => cancelAnimation(rotation);
|
|
45
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
46
|
+
}, []);
|
|
47
|
+
return (React.createElement(Animated.View, { style: [
|
|
48
|
+
{ display: "flex", justifyContent: "center", alignItems: "center" },
|
|
49
|
+
animatedStyles,
|
|
50
|
+
] },
|
|
51
|
+
React.createElement(Loader, Object.assign({ size: size, stroke: color, viewBox: "0 0 38 38", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, extraProps),
|
|
52
|
+
React.createElement(LinearGradient, { id: "gradient-start", gradientUnits: "userSpaceOnUse", gradientTransform: "rotate(-20)" },
|
|
53
|
+
React.createElement(Stop, { offset: 0, stopColor: "white", stopOpacity: 0.5 }),
|
|
54
|
+
React.createElement(Stop, { offset: 1, stopColor: "white", stopOpacity: 1 })),
|
|
55
|
+
React.createElement(LinearGradient, { id: "gradient-end", gradientUnits: "userSpaceOnUse", gradientTransform: "rotate(-20)" },
|
|
56
|
+
React.createElement(Stop, { offset: 0, stopColor: "white", stopOpacity: 0.5 }),
|
|
57
|
+
React.createElement(Stop, { offset: 1, stopColor: "white", stopOpacity: 0 })),
|
|
58
|
+
React.createElement(Mask, { id: "gradient-mask" },
|
|
59
|
+
React.createElement(Rect, { x: 0, y: -4, width: 44, height: 22, strokeWidth: 0, fill: "url(#gradient-start)", transform: "rotate(10)" }),
|
|
60
|
+
React.createElement(Rect, { x: 0, y: 18, width: 44, height: 21, strokeWidth: 0, fill: "url(#gradient-end)", transform: "rotate(10)" })),
|
|
61
|
+
React.createElement(Path, { d: "M34.8807 20.9499C35.3608 17.0398 34.3815 13.09 32.1304 9.85712C29.8793 6.6242 26.5146 4.33541 22.6808 3.42914C18.847 2.52287 14.8136 3.06283 11.3532 4.94559C7.89277 6.82836 5.24858 9.92158 3.92708 13.6328C2.60558 17.344 2.69968 21.4123 4.19135 25.0584C5.68302 28.7045 8.4674 31.6722 12.0112 33.3929C15.5549 35.1137 19.609 35.4666 23.3968 34.384C27.1846 33.3015 30.4398 30.8596 32.5391 27.526", strokeWidth: 6, strokeLinecap: "round", strokeLinejoin: "round", mask: "url(#gradient-mask)" }))));
|
|
62
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare type Props = {
|
|
3
|
+
progress?: number;
|
|
4
|
+
onPress?: () => void;
|
|
5
|
+
Icon?: React.ComponentType<{
|
|
6
|
+
color: string;
|
|
7
|
+
size: number;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
declare const ProgressLoader: ({ progress, onPress, Icon, }: Props) => React.ReactElement;
|
|
11
|
+
export default ProgressLoader;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Svg, Circle, G } from "react-native-svg";
|
|
3
|
+
import { useTheme } from "styled-components/native";
|
|
4
|
+
import { TouchableOpacity } from "react-native";
|
|
5
|
+
const radius = 25;
|
|
6
|
+
const strokeWidth = 2;
|
|
7
|
+
const normalizedRadius = radius - strokeWidth / 2;
|
|
8
|
+
const circumference = normalizedRadius * 2 * Math.PI;
|
|
9
|
+
const iconSize = radius * 0.88;
|
|
10
|
+
const iconOffset = radius - iconSize / 2;
|
|
11
|
+
const ProgressLoader = ({ progress = 0, onPress, Icon, }) => {
|
|
12
|
+
const { colors } = useTheme();
|
|
13
|
+
const backgroundColor = colors.primary.c20;
|
|
14
|
+
const progressColor = colors.primary.c90;
|
|
15
|
+
const strokeDashoffset = circumference - progress * circumference;
|
|
16
|
+
return (React.createElement(TouchableOpacity, { disabled: !onPress, onPress: onPress },
|
|
17
|
+
React.createElement(Svg, { width: radius * 2, height: radius * 2 },
|
|
18
|
+
React.createElement(Circle, { cx: radius, cy: radius, r: radius * 0.92, fill: "transparent", stroke: backgroundColor, strokeDashoffset: 0, strokeWidth: strokeWidth }),
|
|
19
|
+
React.createElement(G, { transform: `rotate(-90) translate(-${radius * 2}, 0)` },
|
|
20
|
+
React.createElement(Circle, { cx: radius, cy: radius, r: radius * 0.92, fill: "transparent", stroke: progressColor, strokeWidth: strokeWidth, strokeDasharray: `${circumference} ${circumference}`, strokeDashoffset: strokeDashoffset })),
|
|
21
|
+
Icon ? (React.createElement(G, { transform: `translate(${iconOffset}, ${iconOffset})` },
|
|
22
|
+
React.createElement(Icon, { color: progressColor, size: iconSize }))) : null)));
|
|
23
|
+
};
|
|
24
|
+
export default ProgressLoader;
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
progress?: number;
|
|
4
|
-
onPress?: () => void;
|
|
5
|
-
Icon?: React.ComponentType<{
|
|
6
|
-
color: string;
|
|
7
|
-
size: number;
|
|
8
|
-
}>;
|
|
9
|
-
};
|
|
10
|
-
declare const ProgressLoader: ({ progress, onPress, Icon, }: Props) => React.ReactElement;
|
|
11
|
-
export default ProgressLoader;
|
|
1
|
+
export { default as Loader } from "./ProgressLoader";
|
|
2
|
+
export { default as InfiniteLoader } from "./InfiniteLoader";
|
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { useTheme } from "styled-components/native";
|
|
4
|
-
import { TouchableOpacity } from "react-native";
|
|
5
|
-
const radius = 25;
|
|
6
|
-
const strokeWidth = 2;
|
|
7
|
-
const normalizedRadius = radius - strokeWidth / 2;
|
|
8
|
-
const circumference = normalizedRadius * 2 * Math.PI;
|
|
9
|
-
const iconSize = radius * 0.88;
|
|
10
|
-
const iconOffset = radius - iconSize / 2;
|
|
11
|
-
const ProgressLoader = ({ progress = 0, onPress, Icon, }) => {
|
|
12
|
-
const { colors } = useTheme();
|
|
13
|
-
const backgroundColor = colors.primary.c20;
|
|
14
|
-
const progressColor = colors.primary.c90;
|
|
15
|
-
const strokeDashoffset = circumference - progress * circumference;
|
|
16
|
-
return (React.createElement(TouchableOpacity, { disabled: !onPress, onPress: onPress },
|
|
17
|
-
React.createElement(Svg, { width: radius * 2, height: radius * 2 },
|
|
18
|
-
React.createElement(Circle, { cx: radius, cy: radius, r: radius * 0.92, fill: "transparent", stroke: backgroundColor, strokeDashoffset: 0, strokeWidth: strokeWidth }),
|
|
19
|
-
React.createElement(G, { transform: `rotate(-90) translate(-${radius * 2}, 0)` },
|
|
20
|
-
React.createElement(Circle, { cx: radius, cy: radius, r: radius * 0.92, fill: "transparent", stroke: progressColor, strokeWidth: strokeWidth, strokeDasharray: `${circumference} ${circumference}`, strokeDashoffset: strokeDashoffset })),
|
|
21
|
-
Icon ? (React.createElement(G, { transform: `translate(${iconOffset}, ${iconOffset})` },
|
|
22
|
-
React.createElement(Icon, { color: progressColor, size: iconSize }))) : null)));
|
|
23
|
-
};
|
|
24
|
-
export default ProgressLoader;
|
|
1
|
+
export { default as Loader } from "./ProgressLoader";
|
|
2
|
+
export { default as InfiniteLoader } from "./InfiniteLoader";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { Props as ProgressBarProps } from "../../ProgressBar";
|
|
2
3
|
import { TransitionProps } from "../../transitions";
|
|
3
4
|
interface InnerProps {
|
|
4
5
|
/**
|
|
@@ -37,6 +38,11 @@ export interface Props<ExtraProps> {
|
|
|
37
38
|
* Extra props that are passed to the header and footer render functions.
|
|
38
39
|
*/
|
|
39
40
|
extraProps?: ExtraProps;
|
|
41
|
+
/**
|
|
42
|
+
* Additional props to pass to the progressbar component.
|
|
43
|
+
* This component is a Flex element.
|
|
44
|
+
*/
|
|
45
|
+
progressBarProps?: ProgressBarProps;
|
|
40
46
|
/**
|
|
41
47
|
* **Use this prop in combination with `transitionDuration`.**
|
|
42
48
|
*
|
|
@@ -60,5 +66,5 @@ export interface Props<ExtraProps> {
|
|
|
60
66
|
*/
|
|
61
67
|
children: React.ReactNode;
|
|
62
68
|
}
|
|
63
|
-
declare function FlowStepper<ExtraProps>({ activeIndex, header, footer, extraProps, renderTransition, transitionDuration, children, }: Props<ExtraProps>): JSX.Element;
|
|
69
|
+
declare function FlowStepper<ExtraProps>({ activeIndex, header, footer, extraProps, progressBarProps, renderTransition, transitionDuration, children, }: Props<ExtraProps>): JSX.Element;
|
|
64
70
|
export default FlowStepper;
|
|
@@ -3,7 +3,7 @@ import { SafeAreaView } from "react-native";
|
|
|
3
3
|
import Flex from "../../Layout/Flex";
|
|
4
4
|
import ProgressBar from "../../ProgressBar";
|
|
5
5
|
import { Transition, } from "../../transitions";
|
|
6
|
-
function FlowStepper({ activeIndex, header, footer, extraProps, renderTransition, transitionDuration = 0, children, }) {
|
|
6
|
+
function FlowStepper({ activeIndex, header, footer, extraProps, progressBarProps, renderTransition, transitionDuration = 0, children, }) {
|
|
7
7
|
const previousActiveIndex = useRef(null);
|
|
8
8
|
const stepsLength = React.Children.count(children);
|
|
9
9
|
useEffect(() => () => {
|
|
@@ -13,7 +13,7 @@ function FlowStepper({ activeIndex, header, footer, extraProps, renderTransition
|
|
|
13
13
|
header &&
|
|
14
14
|
header(Object.assign(Object.assign({}, extraProps), { activeIndex, stepsLength })),
|
|
15
15
|
React.createElement(SafeAreaView, { style: { flex: 1 } },
|
|
16
|
-
React.createElement(ProgressBar, { index: activeIndex, length: stepsLength }),
|
|
16
|
+
React.createElement(ProgressBar, Object.assign({ index: activeIndex, length: stepsLength }, progressBarProps)),
|
|
17
17
|
React.createElement(Flex, { flex: 1 }, React.Children.map(children, (child, index) => {
|
|
18
18
|
if (renderTransition && transitionDuration) {
|
|
19
19
|
return (React.createElement(Transition, { in: index === activeIndex, timeout: transitionDuration, mountOnEnter: true, unmountOnExit: true }, (status) => {
|
|
@@ -7,6 +7,7 @@ export declare function getTextTypeStyle({ bracket }: {
|
|
|
7
7
|
fontFamily: string;
|
|
8
8
|
lineHeight?: number;
|
|
9
9
|
paddingTop?: number;
|
|
10
|
+
textTransform?: string;
|
|
10
11
|
}>;
|
|
11
12
|
export declare function getTextStyle({ variant, bracket, fontWeight, }: Partial<BaseTextProps>): {
|
|
12
13
|
fontFamily: string;
|
|
@@ -4,19 +4,23 @@ export function getTextTypeStyle({ bracket }) {
|
|
|
4
4
|
fontFamily: "Alpha",
|
|
5
5
|
lineHeight: 32,
|
|
6
6
|
paddingTop: bracket ? 15 : 0,
|
|
7
|
+
textTransform: "uppercase",
|
|
7
8
|
},
|
|
8
9
|
h2: {
|
|
9
10
|
fontFamily: "Alpha",
|
|
10
11
|
lineHeight: 28,
|
|
11
12
|
paddingTop: bracket ? 10 : 0,
|
|
13
|
+
textTransform: "uppercase",
|
|
12
14
|
},
|
|
13
15
|
h3: {
|
|
14
16
|
fontFamily: "Alpha",
|
|
15
17
|
lineHeight: 20,
|
|
16
18
|
paddingTop: bracket ? 5 : 0,
|
|
19
|
+
textTransform: "uppercase",
|
|
17
20
|
},
|
|
18
21
|
h4: {
|
|
19
22
|
fontFamily: "Inter",
|
|
23
|
+
textTransform: "uppercase",
|
|
20
24
|
},
|
|
21
25
|
large: {
|
|
22
26
|
fontFamily: "Inter",
|
|
@@ -40,6 +44,7 @@ export function getTextTypeStyle({ bracket }) {
|
|
|
40
44
|
},
|
|
41
45
|
subtitle: {
|
|
42
46
|
fontFamily: "Inter",
|
|
47
|
+
textTransform: "uppercase",
|
|
43
48
|
},
|
|
44
49
|
tiny: {
|
|
45
50
|
fontFamily: "Inter",
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { TextProps } from "react-native";
|
|
3
|
-
import { FontSizeProps, TextAlignProps,
|
|
2
|
+
import { TextProps, TextStyle } from "react-native";
|
|
3
|
+
import { FontSizeProps, TextAlignProps, LineHeightProps } from "styled-system";
|
|
4
|
+
import { BaseStyledProps } from "../styled";
|
|
4
5
|
import { FontWeightTypes } from "./getTextStyle";
|
|
5
6
|
import { TextVariants } from "../../styles/theme";
|
|
6
|
-
export interface BaseTextProps extends TextProps, FontSizeProps, TextAlignProps,
|
|
7
|
+
export interface BaseTextProps extends TextProps, BaseStyledProps, FontSizeProps, TextAlignProps, LineHeightProps {
|
|
7
8
|
variant?: TextVariants;
|
|
8
9
|
fontWeight?: FontWeightTypes;
|
|
9
10
|
fontFamily?: string;
|
|
10
11
|
fontSize?: number | string | TextVariants;
|
|
11
12
|
color?: string;
|
|
12
|
-
mt?: number | string;
|
|
13
|
-
mb?: number | string;
|
|
14
|
-
ml?: number | string;
|
|
15
|
-
mr?: number | string;
|
|
16
|
-
paddingTop?: number;
|
|
17
13
|
lineHeight?: number;
|
|
18
14
|
bracket?: boolean;
|
|
15
|
+
textTransform?: TextStyle["textTransform"];
|
|
16
|
+
uppercase?: boolean;
|
|
19
17
|
children: React.ReactNode;
|
|
20
18
|
}
|
|
21
19
|
declare const Text: ({ children, bracket, ...props }: BaseTextProps) => JSX.Element;
|
package/components/Text/index.js
CHANGED
|
@@ -11,12 +11,24 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import React from "react";
|
|
13
13
|
import styled, { useTheme } from "styled-components/native";
|
|
14
|
-
import { fontSize, textAlign,
|
|
14
|
+
import { compose, fontSize, textAlign, lineHeight, system, } from "styled-system";
|
|
15
|
+
import baseStyled from "../styled";
|
|
15
16
|
import BracketRight from "../../icons/BracketLeft";
|
|
16
17
|
import BracketLeft from "../../icons/BracketRight";
|
|
17
18
|
import { getColor } from "../../styles";
|
|
18
19
|
import { getTextStyle } from "./getTextStyle";
|
|
19
|
-
const
|
|
20
|
+
const uppercase = system({
|
|
21
|
+
uppercase: {
|
|
22
|
+
property: "textTransform",
|
|
23
|
+
transform: (value) => (value ? "uppercase" : "none"),
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
const textTransform = system({
|
|
27
|
+
textTransform: {
|
|
28
|
+
property: "textTransform",
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
const Base = baseStyled.Text.attrs((p) => {
|
|
20
32
|
var _a;
|
|
21
33
|
return ({
|
|
22
34
|
fontSize: p.fontSize ? p.fontSize : (_a = p.variant) !== null && _a !== void 0 ? _a : "paragraph",
|
|
@@ -24,12 +36,7 @@ const Base = styled.Text.attrs((p) => {
|
|
|
24
36
|
});
|
|
25
37
|
}) `
|
|
26
38
|
${(p) => getTextStyle(p)}
|
|
27
|
-
${lineHeight}
|
|
28
|
-
${fontSize};
|
|
29
|
-
${textAlign};
|
|
30
|
-
${color};
|
|
31
|
-
${space};
|
|
32
|
-
${border};
|
|
39
|
+
${compose(lineHeight, fontSize, textAlign, uppercase, textTransform)}
|
|
33
40
|
justify-content: center;
|
|
34
41
|
align-items: center;
|
|
35
42
|
`;
|
package/components/index.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ export * from "./cta";
|
|
|
2
2
|
export * from "./Form";
|
|
3
3
|
export * from "./Icon";
|
|
4
4
|
export * from "./Layout";
|
|
5
|
-
export { default as Loader } from "./Loader";
|
|
6
5
|
export * from "./message";
|
|
7
6
|
export * from "./Navigation";
|
|
8
7
|
export * from "./tags";
|
|
9
8
|
export { default as Text } from "./Text";
|
|
10
9
|
export { default as Carousel } from "./Carousel";
|
|
11
10
|
export * from "./Tabs";
|
|
11
|
+
export * from "./Loader";
|
|
12
12
|
export { default as ProgressBar } from "./ProgressBar";
|
|
13
13
|
export * as Transitions from "./transitions";
|
package/components/index.js
CHANGED
|
@@ -2,13 +2,13 @@ export * from "./cta";
|
|
|
2
2
|
export * from "./Form";
|
|
3
3
|
export * from "./Icon";
|
|
4
4
|
export * from "./Layout";
|
|
5
|
-
export { default as Loader } from "./Loader";
|
|
6
5
|
export * from "./message";
|
|
7
6
|
export * from "./Navigation";
|
|
8
7
|
export * from "./tags";
|
|
9
8
|
export { default as Text } from "./Text";
|
|
10
9
|
export { default as Carousel } from "./Carousel";
|
|
11
10
|
export * from "./Tabs";
|
|
11
|
+
export * from "./Loader";
|
|
12
12
|
export { default as ProgressBar } from "./ProgressBar";
|
|
13
13
|
import * as Transitions_1 from "./transitions";
|
|
14
14
|
export { Transitions_1 as Transitions };
|
|
@@ -44,5 +44,5 @@ export default function Alert({ type = "info", title, showIcon = true, }) {
|
|
|
44
44
|
const textColor = getColor(theme, alertColors[type || "info"].color);
|
|
45
45
|
return (React.createElement(StyledAlertContainer, { type: type },
|
|
46
46
|
showIcon && !!icons[type] && (React.createElement(StyledIconContainer, null, icons[type || "info"]({ size: 20, color: textColor }))),
|
|
47
|
-
React.createElement(Text, { color: textColor }, title)));
|
|
47
|
+
React.createElement(Text, { color: textColor, flexShrink: 1 }, title)));
|
|
48
48
|
}
|