@ledgerhq/react-ui 0.3.0 → 0.6.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.
- package/README.md +4 -4
- package/assets/logos/LedgerLiveAltRegular.d.ts +0 -1
- package/assets/logos/LedgerLiveRegular.d.ts +0 -1
- package/components/Chart/index.d.ts +0 -1
- package/components/Chart/index.js +1 -1
- package/components/Table/Columns.d.ts +60 -11
- package/components/Table/Columns.js +8 -18
- package/components/Table/index.d.ts +44 -12
- package/components/Table/index.js +36 -16
- package/components/Table/stories.helper.js +19 -18
- package/components/Tag/index.js +7 -7
- package/components/animations/GlitchText/index.d.ts +0 -1
- package/components/asorted/Divider/index.d.ts +0 -1
- package/components/asorted/Divider/index.js +2 -2
- package/components/asorted/Icon/BoxedIcon.d.ts +48 -0
- package/components/asorted/Icon/BoxedIcon.js +58 -0
- package/components/asorted/Icon/Icon.d.ts +0 -1
- package/components/asorted/Icon/index.d.ts +2 -0
- package/components/asorted/Icon/index.js +2 -0
- package/components/asorted/Text/index.d.ts +2 -0
- package/components/asorted/Text/index.js +2 -1
- package/components/asorted/index.d.ts +1 -1
- package/components/asorted/index.js +1 -1
- package/components/cards/Carousel/Slide.js +3 -3
- package/components/cards/Carousel/index.js +7 -7
- package/components/cta/Button/index.d.ts +12 -10
- package/components/cta/Button/index.js +52 -46
- package/components/cta/Link/index.d.ts +53 -4
- package/components/cta/Link/index.js +15 -11
- package/components/cta/Toggle/index.d.ts +0 -1
- package/components/form/BaseInput/index.d.ts +8 -14
- package/components/form/BaseInput/index.js +13 -13
- package/components/form/Checkbox/Checkbox.js +7 -7
- package/components/form/Dropdown/index.d.ts +3 -3
- package/components/form/Dropdown/index.js +4 -3
- package/components/form/LegendInput/index.d.ts +26 -2
- package/components/form/LegendInput/index.js +5 -4
- package/components/form/NumberInput/index.d.ts +25 -3
- package/components/form/NumberInput/index.js +7 -6
- package/components/form/QrCodeInput/index.d.ts +25 -3
- package/components/form/QrCodeInput/index.js +7 -6
- package/components/form/QuantityInput/index.d.ts +26 -4
- package/components/form/QuantityInput/index.js +9 -8
- package/components/form/Radio/RadioElement.d.ts +3 -2
- package/components/form/Radio/RadioElement.js +84 -15
- package/components/form/Radio/RadioListElement.js +7 -8
- package/components/form/Radio/index.d.ts +1 -1
- package/components/form/SearchInput/index.d.ts +24 -2
- package/components/form/SearchInput/index.js +4 -3
- package/components/form/SelectInput/Control.d.ts +4 -10
- package/components/form/SelectInput/Control.js +5 -8
- package/components/form/SelectInput/DropdownIndicator.d.ts +3 -10
- package/components/form/SelectInput/DropdownIndicator.js +1 -1
- package/components/form/SelectInput/IndicatorsContainer.d.ts +2 -6
- package/components/form/SelectInput/IndicatorsContainer.js +1 -1
- package/components/form/SelectInput/MenuList.d.ts +3 -10
- package/components/form/SelectInput/MenuList.js +1 -1
- package/components/form/SelectInput/Option.d.ts +6 -18
- package/components/form/SelectInput/Option.js +11 -11
- package/components/form/SelectInput/ValueContainer.d.ts +5 -14
- package/components/form/SelectInput/ValueContainer.js +2 -2
- package/components/form/SelectInput/VirtualMenuList.d.ts +2 -5
- package/components/form/SelectInput/VirtualMenuList.js +2 -1
- package/components/form/SelectInput/index.d.ts +7 -15
- package/components/form/SelectInput/index.js +14 -6
- package/components/form/SplitInput/index.js +5 -5
- package/components/form/Switch/Switch.js +8 -8
- package/components/helpers.d.ts +2 -2
- package/components/layout/Box/index.d.ts +1 -4
- package/components/layout/Drawer/index.d.ts +3 -1
- package/components/layout/Drawer/index.js +32 -15
- package/components/layout/Flex/index.d.ts +2 -5
- package/components/layout/Popin/index.d.ts +5 -13
- package/components/layout/Popin/index.js +13 -18
- package/components/layout/Side/index.d.ts +0 -1
- package/components/loaders/InfiniteLoader/index.d.ts +8 -7
- package/components/loaders/InfiniteLoader/index.js +35 -9
- package/components/loaders/ProgressLoader/index.d.ts +22 -2
- package/components/loaders/ProgressLoader/index.js +10 -12
- package/components/message/Alert/index.d.ts +31 -3
- package/components/message/Alert/index.js +30 -23
- package/components/message/Log/index.js +1 -1
- package/components/message/Notification/Badge.js +2 -2
- package/components/message/Notification/index.js +4 -6
- package/components/message/StatusNotification/index.d.ts +11 -0
- package/components/message/StatusNotification/index.js +33 -0
- package/components/message/Tip/index.d.ts +0 -1
- package/components/message/Tip/index.js +7 -7
- package/components/message/Tooltip/index.d.ts +0 -1
- package/components/message/Tooltip/index.js +1 -1
- package/components/message/Tooltip/styles.js +3 -3
- package/components/message/index.d.ts +2 -0
- package/components/message/index.js +2 -0
- package/components/navigation/Aside/index.d.ts +2 -5
- package/components/navigation/Breadcrumb/index.js +6 -6
- package/components/navigation/progress/ProgressBar/Onboarding.d.ts +0 -1
- package/components/navigation/progress/ProgressBar/Onboarding.js +6 -6
- package/components/navigation/progress/Stepper/index.js +9 -9
- package/components/navigation/sideBar/Item/Item.d.ts +0 -1
- package/components/navigation/sideBar/Item/Item.js +10 -10
- package/components/navigation/sideBar/Logo/Logo.d.ts +0 -1
- package/components/navigation/sideBar/SideBar/SideBar.d.ts +0 -1
- package/components/navigation/sideBar/SideBar/SideBar.js +3 -3
- package/components/navigation/sideBar/Toggle/Toggle.d.ts +0 -1
- package/components/navigation/sideBar/Toggle/Toggle.js +2 -2
- package/components/styled.d.ts +8 -5
- package/components/styled.js +2 -2
- package/components/tabs/Bar/index.js +3 -3
- package/components/tabs/Chip/index.d.ts +13 -0
- package/components/tabs/Chip/index.js +21 -0
- package/components/tabs/Pill/index.js +6 -6
- package/components/tabs/Tabs/index.js +7 -7
- package/components/tabs/index.d.ts +1 -0
- package/components/tabs/index.js +1 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +5 -6
- package/styles/InvertTheme.js +1 -1
- package/styles/StyleProvider.js +1 -1
- package/styles/global.js +15 -36
- package/styles/index.d.ts +1 -1
- package/styles/index.js +1 -1
- package/styles/theme.d.ts +5 -2
- package/styles/theme.js +13 -15
- package/components/loaders/InfiniteLoader/image.d.ts +0 -2
- package/components/loaders/InfiniteLoader/image.js +0 -1
- package/styles/reset.d.ts +0 -2
- package/styles/reset.js +0 -62
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { BaseStyledProps } from "../../styled";
|
|
2
2
|
export declare type FlexBoxProps = BaseStyledProps;
|
|
3
|
-
declare const FlexBox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").OverflowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & {
|
|
3
|
+
declare const FlexBox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").BorderProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").OverflowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & {
|
|
4
4
|
columnGap?: string | number | undefined;
|
|
5
5
|
rowGap?: string | number | undefined;
|
|
6
6
|
color?: string | undefined;
|
|
7
|
-
|
|
8
|
-
position?: string | undefined;
|
|
9
|
-
maxHeight?: number | undefined;
|
|
10
|
-
}, "overflow" | "p" | "color" | "left" | "right" | "bottom" | "top" | "size" | "flex" | "padding" | "rowGap" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "verticalAlign" | "width" | "zIndex" | "margin" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "bg">;
|
|
7
|
+
}, "overflow" | "p" | "color" | "size" | "rowGap" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "top" | "verticalAlign" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "margin" | "padding" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "bg" | "borderX" | "borderY">;
|
|
11
8
|
export default FlexBox;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { BaseStyledProps } from "../../styled";
|
|
3
|
-
export interface PopinProps {
|
|
4
|
-
width?: number;
|
|
5
|
-
height?: number;
|
|
3
|
+
export interface PopinProps extends BaseStyledProps {
|
|
6
4
|
isOpen: boolean;
|
|
7
5
|
children: React.ReactNode;
|
|
8
6
|
}
|
|
@@ -14,28 +12,22 @@ export declare type PopinHeaderProps = BaseStyledProps & {
|
|
|
14
12
|
declare const PopinWrapper: {
|
|
15
13
|
({ children, ...popinProps }: PopinProps): React.ReactElement;
|
|
16
14
|
Header: ({ children, onClose, onBack, ...props }: PopinHeaderProps) => JSX.Element;
|
|
17
|
-
Body: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").OverflowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & {
|
|
15
|
+
Body: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").BorderProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").OverflowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & {
|
|
18
16
|
columnGap?: string | number | undefined;
|
|
19
17
|
rowGap?: string | number | undefined;
|
|
20
18
|
color?: string | undefined;
|
|
21
|
-
display?: string | undefined;
|
|
22
|
-
position?: string | undefined;
|
|
23
|
-
maxHeight?: number | undefined;
|
|
24
19
|
} & {
|
|
25
20
|
as: string;
|
|
26
21
|
flexDirection: string;
|
|
27
22
|
flex: number;
|
|
28
23
|
overflow: string;
|
|
29
|
-
}, "overflow" | "p" | "color" | "
|
|
30
|
-
Footer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").OverflowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & {
|
|
24
|
+
}, "overflow" | "p" | "color" | "as" | "size" | "rowGap" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "top" | "verticalAlign" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "margin" | "padding" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "bg" | "borderX" | "borderY">;
|
|
25
|
+
Footer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").BorderProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").OverflowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & {
|
|
31
26
|
columnGap?: string | number | undefined;
|
|
32
27
|
rowGap?: string | number | undefined;
|
|
33
28
|
color?: string | undefined;
|
|
34
|
-
display?: string | undefined;
|
|
35
|
-
position?: string | undefined;
|
|
36
|
-
maxHeight?: number | undefined;
|
|
37
29
|
} & {
|
|
38
30
|
as: string;
|
|
39
|
-
}, "overflow" | "p" | "color" | "
|
|
31
|
+
}, "overflow" | "p" | "color" | "as" | "size" | "rowGap" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "top" | "verticalAlign" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "margin" | "padding" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "bg" | "borderX" | "borderY">;
|
|
40
32
|
};
|
|
41
33
|
export default PopinWrapper;
|
|
@@ -20,16 +20,6 @@ import Button from "../../cta/Button";
|
|
|
20
20
|
import TransitionInOut from "../../transitions/TransitionInOut";
|
|
21
21
|
import TransitionScale from "../../transitions/TransitionScale";
|
|
22
22
|
const ICON_SIZE = 20;
|
|
23
|
-
const Container = styled(Flex).attrs((p) => ({
|
|
24
|
-
position: "relative",
|
|
25
|
-
flexDirection: "column",
|
|
26
|
-
rowGap: 6,
|
|
27
|
-
width: "100%",
|
|
28
|
-
height: "100%",
|
|
29
|
-
paddingY: p.theme.space[10],
|
|
30
|
-
paddingX: p.theme.space[12],
|
|
31
|
-
backgroundColor: p.theme.colors.palette.neutral.c00,
|
|
32
|
-
})) ``;
|
|
33
23
|
const Wrapper = styled(Flex).attrs((p) => ({
|
|
34
24
|
flexDirection: "column",
|
|
35
25
|
alignItems: "stretch",
|
|
@@ -41,6 +31,9 @@ const Wrapper = styled(Flex).attrs((p) => ({
|
|
|
41
31
|
maxHeight: `${p.theme.sizes.drawer.popin.max.height}px`,
|
|
42
32
|
maxWidth: `${p.theme.sizes.drawer.popin.max.width}px`,
|
|
43
33
|
zIndex: p.theme.zIndexes[8],
|
|
34
|
+
p: p.p !== undefined ? p.p : p.theme.space[10],
|
|
35
|
+
rowGap: 6,
|
|
36
|
+
backgroundColor: p.theme.colors.neutral.c00,
|
|
44
37
|
})) ``;
|
|
45
38
|
const Overlay = styled(Flex).attrs((p) => ({
|
|
46
39
|
justifyContent: "center",
|
|
@@ -51,7 +44,7 @@ const Overlay = styled(Flex).attrs((p) => ({
|
|
|
51
44
|
position: "fixed",
|
|
52
45
|
top: 0,
|
|
53
46
|
left: 0,
|
|
54
|
-
backgroundColor: p.theme.colors.
|
|
47
|
+
backgroundColor: p.theme.colors.neutral.c100a07,
|
|
55
48
|
})) ``;
|
|
56
49
|
const Header = baseStyled.section `
|
|
57
50
|
display: grid;
|
|
@@ -76,16 +69,18 @@ const PopinHeader = (_a) => {
|
|
|
76
69
|
var { children, onClose, onBack } = _a, props = __rest(_a, ["children", "onClose", "onBack"]);
|
|
77
70
|
return (React.createElement(Header, Object.assign({}, props),
|
|
78
71
|
React.createElement(Flex, null, onBack ? (React.createElement(IconContainer, { onClick: onBack },
|
|
79
|
-
React.createElement(ArrowLeftIcon, { size: ICON_SIZE, color: "
|
|
72
|
+
React.createElement(ArrowLeftIcon, { size: ICON_SIZE, color: "neutral.c100" }))) : null),
|
|
80
73
|
React.createElement(HeaderTitleContainer, null, children),
|
|
81
74
|
React.createElement(Flex, null, onClose ? (React.createElement(IconContainer, { onClick: onClose },
|
|
82
|
-
React.createElement(CloseIcon, { size: ICON_SIZE, color: "
|
|
75
|
+
React.createElement(CloseIcon, { size: ICON_SIZE, color: "neutral.c100" }))) : null)));
|
|
76
|
+
};
|
|
77
|
+
const Popin = (_a) => {
|
|
78
|
+
var { isOpen, children, width, height } = _a, props = __rest(_a, ["isOpen", "children", "width", "height"]);
|
|
79
|
+
return (React.createElement(TransitionInOut, { in: isOpen, appear: true, mountOnEnter: true, unmountOnExit: true },
|
|
80
|
+
React.createElement(Overlay, null,
|
|
81
|
+
React.createElement(TransitionScale, { in: isOpen, appear: true },
|
|
82
|
+
React.createElement(Wrapper, Object.assign({ width: width, height: height }, props), children)))));
|
|
83
83
|
};
|
|
84
|
-
const Popin = ({ isOpen, children, width, height }) => (React.createElement(TransitionInOut, { in: isOpen, appear: true, mountOnEnter: true, unmountOnExit: true },
|
|
85
|
-
React.createElement(Overlay, null,
|
|
86
|
-
React.createElement(TransitionScale, { in: isOpen, appear: true },
|
|
87
|
-
React.createElement(Wrapper, { width: width, height: height },
|
|
88
|
-
React.createElement(Container, null, children))))));
|
|
89
84
|
const PopinWrapper = (_a) => {
|
|
90
85
|
var { children } = _a, popinProps = __rest(_a, ["children"]);
|
|
91
86
|
const $root = React.useMemo(() => document.querySelector("#ll-popin-root"), []);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
export default InfiniteLoader;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SizeProps } from "styled-system";
|
|
3
|
+
declare const Loader: import("styled-components").StyledComponent<"svg", import("styled-components").DefaultTheme, SizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Height<import("styled-system").TLengthStyledSystem>>, never>;
|
|
4
|
+
export declare type Props = React.ComponentProps<typeof Loader> & {
|
|
5
|
+
color?: string;
|
|
6
|
+
};
|
|
7
|
+
export default function InfiniteLoader({ size, color, ...extraProps }: Props): JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -1,5 +1,17 @@
|
|
|
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";
|
|
1
13
|
import styled, { keyframes } from "styled-components";
|
|
2
|
-
import
|
|
14
|
+
import { system, size } from "styled-system";
|
|
3
15
|
const rotate = keyframes `
|
|
4
16
|
0% {
|
|
5
17
|
transform: rotate(0deg);
|
|
@@ -8,13 +20,27 @@ const rotate = keyframes `
|
|
|
8
20
|
transform: rotate(360deg);
|
|
9
21
|
}
|
|
10
22
|
`;
|
|
11
|
-
const
|
|
12
|
-
alt: "loading...",
|
|
13
|
-
src: `data:image/png;base64,${image}`,
|
|
14
|
-
width: "28",
|
|
15
|
-
height: "28",
|
|
16
|
-
}) `
|
|
23
|
+
const Loader = styled.svg `
|
|
17
24
|
animation: ${rotate} 1s linear infinite;
|
|
18
|
-
|
|
25
|
+
${size}
|
|
26
|
+
${system({
|
|
27
|
+
stroke: {
|
|
28
|
+
property: "stroke",
|
|
29
|
+
scale: "colors",
|
|
30
|
+
},
|
|
31
|
+
})}
|
|
19
32
|
`;
|
|
20
|
-
export default InfiniteLoader
|
|
33
|
+
export default function InfiniteLoader(_a) {
|
|
34
|
+
var { size = 38, color = "primary.c50" } = _a, extraProps = __rest(_a, ["size", "color"]);
|
|
35
|
+
return (React.createElement(Loader, Object.assign({ size: size, stroke: color, viewBox: "0 0 38 38", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, extraProps),
|
|
36
|
+
React.createElement("linearGradient", { id: "gradient-start", gradientUnits: "userSpaceOnUse", gradientTransform: "rotate(-20)" },
|
|
37
|
+
React.createElement("stop", { offset: "0", stopColor: "white", stopOpacity: "0.5" }),
|
|
38
|
+
React.createElement("stop", { offset: "1", stopColor: "white", stopOpacity: "1" })),
|
|
39
|
+
React.createElement("linearGradient", { id: "gradient-end", gradientUnits: "userSpaceOnUse", gradientTransform: "rotate(-20)" },
|
|
40
|
+
React.createElement("stop", { offset: "0", stopColor: "white", stopOpacity: "0.5" }),
|
|
41
|
+
React.createElement("stop", { offset: "1", stopColor: "white", stopOpacity: "0" })),
|
|
42
|
+
React.createElement("mask", { id: "gradient-mask", maskUnits: "userSpaceOnUse" },
|
|
43
|
+
React.createElement("rect", { x: "-0", y: "-4", width: "44", height: "22", strokeWidth: "0", fill: "url(#gradient-start)", transform: "rotate(10)" }),
|
|
44
|
+
React.createElement("rect", { x: "0", y: "18", width: "44", height: "21", strokeWidth: "0", fill: "url(#gradient-end)", transform: "rotate(10)" })),
|
|
45
|
+
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)" })));
|
|
46
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface Props {
|
|
3
2
|
/**
|
|
4
3
|
* Radius of the progress ring.
|
|
@@ -12,5 +11,26 @@ export interface Props {
|
|
|
12
11
|
* Progress of the loader, in percent, between 0 and 100.
|
|
13
12
|
*/
|
|
14
13
|
progress?: number;
|
|
14
|
+
/**
|
|
15
|
+
* Whether to display the progress, defaults to true.
|
|
16
|
+
*/
|
|
17
|
+
showPercentage?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Percentage text color
|
|
20
|
+
*/
|
|
21
|
+
textColor?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Front stroke color.
|
|
24
|
+
*/
|
|
25
|
+
frontStrokeColor?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Front stroke linecap.
|
|
28
|
+
* https://developer.mozilla.org/fr/docs/Web/SVG/Attribute/stroke-linecap
|
|
29
|
+
*/
|
|
30
|
+
frontStrokeLinecap?: "butt" | "round";
|
|
31
|
+
/**
|
|
32
|
+
* Background stroke color.
|
|
33
|
+
*/
|
|
34
|
+
backgroundStrokeColor?: string;
|
|
15
35
|
}
|
|
16
|
-
export default function ProgressLoader({ radius, stroke, progress, }: Props): JSX.Element;
|
|
36
|
+
export default function ProgressLoader({ radius, stroke, progress, showPercentage, textColor, frontStrokeColor, frontStrokeLinecap, backgroundStrokeColor, }: Props): JSX.Element;
|
|
@@ -11,14 +11,12 @@ const StyledCircle = styled.circle.attrs({
|
|
|
11
11
|
transform-origin: 50% 50%;
|
|
12
12
|
`;
|
|
13
13
|
const StyledCircleBackground = styled(StyledCircle).attrs((props) => ({
|
|
14
|
-
stroke: props.theme.colors.
|
|
14
|
+
stroke: props.stroke || props.theme.colors.primary.c20,
|
|
15
15
|
})) ``;
|
|
16
16
|
const StyledCircleFront = styled(StyledCircle).attrs((props) => ({
|
|
17
|
-
stroke: props.theme.colors.
|
|
17
|
+
stroke: props.stroke || props.theme.colors.primary.c60,
|
|
18
18
|
})) ``;
|
|
19
|
-
const StyledCenteredText = styled(Text)
|
|
20
|
-
color: "palette.primary.c80",
|
|
21
|
-
}) `
|
|
19
|
+
const StyledCenteredText = styled(Text) `
|
|
22
20
|
position: absolute;
|
|
23
21
|
top: 50%;
|
|
24
22
|
left: 50%;
|
|
@@ -29,18 +27,18 @@ const StyledProgressLoaderContainer = styled.div `
|
|
|
29
27
|
display: flex;
|
|
30
28
|
position: absolute;
|
|
31
29
|
`;
|
|
32
|
-
function ProgressCircleSvg({ radius, stroke, progress, }) {
|
|
30
|
+
function ProgressCircleSvg({ radius, stroke, progress, backgroundStrokeColor, frontStrokeColor, frontStrokeLinecap, }) {
|
|
33
31
|
const normalizedRadius = radius - stroke / 2;
|
|
34
32
|
const circumference = normalizedRadius * 2 * Math.PI;
|
|
35
33
|
const strokeDashoffset = circumference - (progress / 100) * circumference;
|
|
36
34
|
return (React.createElement("svg", { height: radius * 2, width: radius * 2 },
|
|
37
|
-
React.createElement(StyledCircleBackground, { strokeWidth: stroke, strokeDasharray: circumference + " " + circumference, style: { strokeDashoffset: 0 }, r: normalizedRadius }),
|
|
38
|
-
React.createElement(StyledCircleFront, { strokeWidth: stroke, strokeDasharray: circumference + " " + circumference, style: { strokeDashoffset }, r: normalizedRadius })));
|
|
35
|
+
React.createElement(StyledCircleBackground, { strokeWidth: stroke, strokeDasharray: circumference + " " + circumference, style: { strokeDashoffset: 0 }, stroke: backgroundStrokeColor, r: normalizedRadius }),
|
|
36
|
+
React.createElement(StyledCircleFront, { strokeWidth: stroke, strokeDasharray: circumference + " " + circumference, style: { strokeDashoffset }, stroke: frontStrokeColor, strokeLinecap: frontStrokeLinecap, r: normalizedRadius })));
|
|
39
37
|
}
|
|
40
|
-
export default function ProgressLoader({ radius = 32, stroke = 6, progress = 0, }) {
|
|
38
|
+
export default function ProgressLoader({ radius = 32, stroke = 6, progress = 0, showPercentage = true, textColor, frontStrokeColor, frontStrokeLinecap, backgroundStrokeColor, }) {
|
|
41
39
|
return (React.createElement(StyledProgressLoaderContainer, null,
|
|
42
|
-
React.createElement(StyledCenteredText, { variant: "body" },
|
|
40
|
+
showPercentage && (React.createElement(StyledCenteredText, { variant: "body", color: textColor || "primary.c80" },
|
|
43
41
|
progress,
|
|
44
|
-
"%"),
|
|
45
|
-
React.createElement(ProgressCircleSvg, { radius: radius, stroke: stroke, progress: progress })));
|
|
42
|
+
"%")),
|
|
43
|
+
React.createElement(ProgressCircleSvg, { radius: radius, stroke: stroke, progress: progress, frontStrokeColor: frontStrokeColor, frontStrokeLinecap: frontStrokeLinecap, backgroundStrokeColor: backgroundStrokeColor })));
|
|
46
44
|
}
|
|
@@ -1,9 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
import { TextVariants } from "../../../styles/theme";
|
|
2
2
|
declare type AlertType = "info" | "warning" | "error";
|
|
3
|
+
declare type RenderProps = (props: {
|
|
4
|
+
color: string;
|
|
5
|
+
textProps: {
|
|
6
|
+
variant?: TextVariants;
|
|
7
|
+
fontWeight?: string;
|
|
8
|
+
};
|
|
9
|
+
}) => JSX.Element;
|
|
3
10
|
export interface AlertProps {
|
|
11
|
+
/**
|
|
12
|
+
* Affects the colors of the background & text and what icon can be displayed.
|
|
13
|
+
*/
|
|
4
14
|
type?: AlertType;
|
|
5
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Title of the Alert.
|
|
17
|
+
*/
|
|
18
|
+
title?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Method for rendering additional content under the title. `{ color: string; textProps: { variant?: TextVariants; fontWeight?: string } }` is passed as props to easily style text elements.
|
|
21
|
+
*/
|
|
22
|
+
renderContent?: RenderProps;
|
|
23
|
+
/**
|
|
24
|
+
* Method for rendering additional content to the right. `{ color: string; textProps: { variant?: TextVariants; fontWeight?: string } }` is passed as props to easily style text elements.
|
|
25
|
+
*/
|
|
26
|
+
renderRight?: RenderProps;
|
|
27
|
+
/**
|
|
28
|
+
* Additional props to be passed to the top level container (containing icon + content).
|
|
29
|
+
*/
|
|
30
|
+
containerProps?: Record<string, unknown>;
|
|
31
|
+
/**
|
|
32
|
+
* Whether or not to display an icon
|
|
33
|
+
*/
|
|
6
34
|
showIcon?: boolean;
|
|
7
35
|
}
|
|
8
|
-
export default function Alert({ type, title, showIcon }: AlertProps): JSX.Element;
|
|
36
|
+
export default function Alert({ type, title, showIcon, renderContent, renderRight, containerProps, }: AlertProps): JSX.Element;
|
|
9
37
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import styled, {
|
|
2
|
+
import styled, { useTheme } from "styled-components";
|
|
3
3
|
import Text from "../../asorted/Text";
|
|
4
|
+
import Flex from "../../layout/Flex";
|
|
4
5
|
import ShieldSecurityMedium from "@ledgerhq/icons-ui/react/ShieldSecurityMedium";
|
|
5
6
|
import CircledCrossMedium from "@ledgerhq/icons-ui/react/CircledCrossMedium";
|
|
6
7
|
import CircledAlertMedium from "@ledgerhq/icons-ui/react/CircledAlertMedium";
|
|
@@ -14,35 +15,41 @@ const icons = {
|
|
|
14
15
|
warning: React.createElement(CircledAlertMedium, { size: 20 }),
|
|
15
16
|
error: React.createElement(CircledCrossMedium, { size: 20 }),
|
|
16
17
|
};
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
switch (p.type) {
|
|
18
|
+
const getColors = ({ theme, type }) => {
|
|
19
|
+
switch (type) {
|
|
20
20
|
case "warning":
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
return {
|
|
22
|
+
background: theme.colors.warning.c30,
|
|
23
|
+
color: theme.colors.warning.c100,
|
|
24
|
+
};
|
|
25
25
|
case "error":
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
return {
|
|
27
|
+
background: theme.colors.error.c30,
|
|
28
|
+
color: theme.colors.error.c100,
|
|
29
|
+
};
|
|
30
30
|
case "info":
|
|
31
31
|
default:
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
return {
|
|
33
|
+
background: theme.colors.primary.c20,
|
|
34
|
+
color: theme.colors.primary.c90,
|
|
35
|
+
};
|
|
36
36
|
}
|
|
37
|
-
}
|
|
38
|
-
|
|
37
|
+
};
|
|
38
|
+
const StyledAlertContainer = styled(Flex) `
|
|
39
39
|
border-radius: ${(p) => `${p.theme.radii[1]}px`};
|
|
40
|
-
padding: 16px;
|
|
41
|
-
display: flex;
|
|
42
40
|
align-items: center;
|
|
43
41
|
`;
|
|
44
|
-
export default function Alert({ type = "info", title, showIcon = true }) {
|
|
45
|
-
|
|
42
|
+
export default function Alert({ type = "info", title, showIcon = true, renderContent, renderRight, containerProps, }) {
|
|
43
|
+
const theme = useTheme();
|
|
44
|
+
const { color, background } = getColors({ theme, type });
|
|
45
|
+
const textProps = {
|
|
46
|
+
variant: "paragraph",
|
|
47
|
+
fontWeight: "medium",
|
|
48
|
+
};
|
|
49
|
+
return (React.createElement(StyledAlertContainer, Object.assign({ color: color, backgroundColor: background, padding: 6 }, containerProps),
|
|
46
50
|
showIcon && !!icons[type] && React.createElement(StyledIconContainer, null, icons[type]),
|
|
47
|
-
React.createElement(
|
|
51
|
+
React.createElement(Flex, { flexDirection: "column", flex: 1, alignItems: "flex-start", rowGap: "6px" },
|
|
52
|
+
title && (React.createElement(Text, Object.assign({}, textProps, { color: "inherit" }), title)),
|
|
53
|
+
renderContent && renderContent({ color, textProps })),
|
|
54
|
+
React.createElement(Flex, null, renderRight && renderRight({ color, textProps }))));
|
|
48
55
|
}
|
|
@@ -19,7 +19,7 @@ const Container = styled(FlexBox) `
|
|
|
19
19
|
flex-wrap: wrap;
|
|
20
20
|
align-items: stretch;
|
|
21
21
|
min-height: ${(p) => p.theme.space[12]}px;
|
|
22
|
-
color: ${(p) => p.theme.colors.
|
|
22
|
+
color: ${(p) => p.theme.colors.neutral.c100};
|
|
23
23
|
`;
|
|
24
24
|
const TextContainer = styled(FlexBox).attrs(() => ({
|
|
25
25
|
flex: "1",
|
|
@@ -20,14 +20,14 @@ const ActiveCircle = styled.div `
|
|
|
20
20
|
width: 10px;
|
|
21
21
|
border-radius: 9999px;
|
|
22
22
|
box-sizing: content-box;
|
|
23
|
-
background-color: ${(p) => p.theme.colors.
|
|
23
|
+
background-color: ${(p) => p.theme.colors.error.c100};
|
|
24
24
|
|
|
25
25
|
border: 2px solid
|
|
26
26
|
var(
|
|
27
27
|
--notification-badge-border,
|
|
28
28
|
${(p) => {
|
|
29
29
|
/* The CSS variable is dynamically set by the Notification component */
|
|
30
|
-
return p.theme.colors.
|
|
30
|
+
return p.theme.colors.background.main;
|
|
31
31
|
}}
|
|
32
32
|
);
|
|
33
33
|
`;
|
|
@@ -23,11 +23,9 @@ const Container = styled(FlexBox).attrs({
|
|
|
23
23
|
}) `
|
|
24
24
|
--notification-badge-border: ${(p) => {
|
|
25
25
|
/* Set a CSS variable that will be consumed by the Badge component */
|
|
26
|
-
return p.hasBackground
|
|
27
|
-
? p.theme.colors.palette.neutral.c30
|
|
28
|
-
: p.theme.colors.palette.background.main;
|
|
26
|
+
return p.hasBackground ? p.theme.colors.neutral.c30 : p.theme.colors.background.main;
|
|
29
27
|
}};
|
|
30
|
-
background-color: ${(p) => p.hasBackground ? p.theme.colors.
|
|
28
|
+
background-color: ${(p) => (p.hasBackground ? p.theme.colors.neutral.c30 : "transparent")};
|
|
31
29
|
|
|
32
30
|
border-radius: 8px;
|
|
33
31
|
`;
|
|
@@ -36,8 +34,8 @@ function Notification(_a) {
|
|
|
36
34
|
return (React.createElement(Container, Object.assign({ hasBackground: hasBackground }, containerProps),
|
|
37
35
|
badge,
|
|
38
36
|
React.createElement(FlexBox, { flexDirection: "column", rowGap: 3, flex: "auto" },
|
|
39
|
-
React.createElement(Text, { variant: "large", fontWeight: "medium", color: "
|
|
40
|
-
description && (React.createElement(Text, { variant: "paragraph", fontWeight: "medium", color: "
|
|
37
|
+
React.createElement(Text, { variant: "large", fontWeight: "medium", color: "neutral.c100" }, title),
|
|
38
|
+
description && (React.createElement(Text, { variant: "paragraph", fontWeight: "medium", color: "neutral.c80", whiteSpace: "pre-wrap" }, description)),
|
|
41
39
|
link && (React.createElement(FlexBox, { justifyContent: "flex-start" },
|
|
42
40
|
React.createElement(Link, { onClick: (event) => onLinkClick && onLinkClick(event), Icon: ExternalLinkMedium }, link))))));
|
|
43
41
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FlexBoxProps } from "../../layout/Flex";
|
|
3
|
+
interface ContainerProps extends FlexBoxProps {
|
|
4
|
+
hasBorder?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface Props extends ContainerProps {
|
|
7
|
+
text: string;
|
|
8
|
+
badge: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare function StatusNotification({ text, badge, hasBorder, ...containerProps }: Props): JSX.Element;
|
|
11
|
+
export default StatusNotification;
|
|
@@ -0,0 +1,33 @@
|
|
|
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 from "styled-components";
|
|
14
|
+
import FlexBox from "../../layout/Flex";
|
|
15
|
+
import Log from "../Log/";
|
|
16
|
+
const Container = styled(FlexBox).attrs({
|
|
17
|
+
p: 8,
|
|
18
|
+
rowGap: 9,
|
|
19
|
+
alignItems: "center",
|
|
20
|
+
flexDirection: "column",
|
|
21
|
+
}) `
|
|
22
|
+
border-width: 1px;
|
|
23
|
+
border-style: ${(p) => (p.hasBorder ? "solid" : "none")};
|
|
24
|
+
border-radius: 8px;
|
|
25
|
+
border-color: ${(p) => p.theme.colors.neutral.c40};
|
|
26
|
+
`;
|
|
27
|
+
function StatusNotification(_a) {
|
|
28
|
+
var { text, badge, hasBorder = false } = _a, containerProps = __rest(_a, ["text", "badge", "hasBorder"]);
|
|
29
|
+
return (React.createElement(Container, Object.assign({ hasBorder: hasBorder }, containerProps),
|
|
30
|
+
badge,
|
|
31
|
+
React.createElement(Log, null, text)));
|
|
32
|
+
}
|
|
33
|
+
export default StatusNotification;
|
|
@@ -13,19 +13,19 @@ const StyledIconContainer = styled.div `
|
|
|
13
13
|
switch (p.type) {
|
|
14
14
|
case "warning":
|
|
15
15
|
return css `
|
|
16
|
-
background: ${p.theme.colors.
|
|
17
|
-
color: ${p.theme.colors.
|
|
16
|
+
background: ${p.theme.colors.warning.c10};
|
|
17
|
+
color: ${p.theme.colors.warning.c100};
|
|
18
18
|
`;
|
|
19
19
|
case "error":
|
|
20
20
|
return css `
|
|
21
|
-
background: ${p.theme.colors.
|
|
22
|
-
color: ${p.theme.colors.
|
|
21
|
+
background: ${p.theme.colors.error.c10};
|
|
22
|
+
color: ${p.theme.colors.error.c100};
|
|
23
23
|
`;
|
|
24
24
|
case "success":
|
|
25
25
|
default:
|
|
26
26
|
return css `
|
|
27
|
-
background: ${p.theme.colors.
|
|
28
|
-
color: ${p.theme.colors.
|
|
27
|
+
background: ${p.theme.colors.success.c30};
|
|
28
|
+
color: ${p.theme.colors.success.c100};
|
|
29
29
|
`;
|
|
30
30
|
}
|
|
31
31
|
}}
|
|
@@ -39,5 +39,5 @@ const StyledIconContainer = styled.div `
|
|
|
39
39
|
export default function Tip({ type, label }) {
|
|
40
40
|
return (React.createElement(Flex, { alignItems: "center" },
|
|
41
41
|
type && React.createElement(StyledIconContainer, { type: type }, icons[type]),
|
|
42
|
-
React.createElement(Text, { variant: "paragraph", fontWeight: "medium", color: "
|
|
42
|
+
React.createElement(Text, { variant: "paragraph", fontWeight: "medium", color: "neutral.c100", flexShrink: 1 }, label)));
|
|
43
43
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { TippyProps } from "@tippyjs/react";
|
|
3
2
|
declare type Placement = "top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "auto" | "auto-start" | "auto-end";
|
|
4
3
|
export interface Props extends TippyProps {
|
|
@@ -36,6 +36,6 @@ const Wrapper = forwardRef((props, ref) => {
|
|
|
36
36
|
});
|
|
37
37
|
export default function Tooltip(props) {
|
|
38
38
|
const { content, placement = "auto", children } = props, rest = __rest(props, ["content", "placement", "children"]);
|
|
39
|
-
return (React.createElement(Tippy, Object.assign({}, rest, { placement: placement, content: React.createElement(Text, { fontWeight: "medium", variant: "paragraph", color: "
|
|
39
|
+
return (React.createElement(Tippy, Object.assign({}, rest, { placement: placement, content: React.createElement(Text, { fontWeight: "medium", variant: "paragraph", color: "neutral.c00" }, content) }),
|
|
40
40
|
React.createElement(Wrapper, { children: children })));
|
|
41
41
|
}
|
|
@@ -10,8 +10,8 @@ export default css `
|
|
|
10
10
|
|
|
11
11
|
.tippy-box {
|
|
12
12
|
position: relative;
|
|
13
|
-
background-color: ${(p) => p.theme.colors.
|
|
14
|
-
color: ${(p) => p.theme.colors.
|
|
13
|
+
background-color: ${(p) => p.theme.colors.neutral.c100};
|
|
14
|
+
color: ${(p) => p.theme.colors.neutral.c00};
|
|
15
15
|
border-radius: 4px;
|
|
16
16
|
font-size: 14px;
|
|
17
17
|
line-height: 1.4;
|
|
@@ -72,7 +72,7 @@ export default css `
|
|
|
72
72
|
.tippy-arrow {
|
|
73
73
|
width: 16px;
|
|
74
74
|
height: 16px;
|
|
75
|
-
color: ${(p) => p.theme.colors.
|
|
75
|
+
color: ${(p) => p.theme.colors.neutral.c100};
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
.tippy-arrow:before {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { default as Alert } from "./Alert";
|
|
2
2
|
export { default as Log } from "./Log";
|
|
3
3
|
export { default as Notification } from "./Notification";
|
|
4
|
+
export { default as Badge } from "./Notification/Badge";
|
|
4
5
|
export { default as Tooltip } from "./Tooltip";
|
|
5
6
|
export { default as Tip } from "./Tip";
|
|
7
|
+
export { default as StatusNotification } from "./StatusNotification";
|