@ledgerhq/react-ui 0.1.1 → 0.4.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 +54 -13
- package/assets/icons.d.ts +1 -0
- package/assets/icons.js +1 -0
- package/components/Chart/index.js +1 -1
- package/components/Table/Columns.d.ts +2 -2
- package/components/Table/Columns.js +2 -2
- package/components/Table/index.d.ts +3 -2
- package/components/Table/index.js +1 -4
- package/components/Table/stories.helper.js +6 -6
- package/components/Tag/index.d.ts +18 -5
- package/components/Tag/index.js +54 -21
- package/components/animations/GlitchText/index.d.ts +7 -0
- package/components/animations/GlitchText/index.js +35 -0
- package/components/asorted/Divider/index.js +2 -2
- package/components/asorted/Icon/Icon.d.ts +1 -0
- package/components/asorted/Icon/Icon.js +8 -1
- package/components/asorted/Icon/index.d.ts +1 -1
- package/components/asorted/Icon/index.js +1 -1
- package/components/asorted/Text/index.d.ts +9 -31
- package/components/asorted/Text/index.js +11 -17
- package/components/asorted/Text/styles.d.ts +7 -2
- package/components/asorted/Text/styles.js +69 -85
- 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 +8 -8
- package/components/cta/Button/index.d.ts +26 -14
- package/components/cta/Button/index.js +77 -66
- package/components/cta/Link/index.d.ts +12 -4
- package/components/cta/Link/index.js +4 -3
- package/components/cta/Toggle/index.js +1 -1
- package/components/cta/getCtaStyle.d.ts +2 -2
- package/components/cta/index.d.ts +1 -0
- package/components/cta/index.js +1 -0
- package/components/form/BaseInput/index.d.ts +86 -15
- package/components/form/BaseInput/index.js +47 -20
- package/components/form/Checkbox/Checkbox.js +12 -9
- package/components/form/Dropdown/index.js +3 -3
- package/components/form/LegendInput/index.js +3 -3
- package/components/form/NumberInput/index.d.ts +1 -1
- package/components/form/NumberInput/index.js +18 -7
- package/components/form/QrCodeInput/index.js +4 -4
- package/components/form/QuantityInput/index.js +8 -8
- package/components/form/Radio/RadioElement.d.ts +5 -2
- package/components/form/Radio/RadioElement.js +16 -14
- package/components/form/Radio/RadioListElement.d.ts +22 -0
- package/components/form/Radio/RadioListElement.js +63 -0
- package/components/form/Radio/index.d.ts +8 -1
- package/components/form/Radio/index.js +2 -0
- package/components/form/SearchInput/index.js +1 -1
- package/components/form/SelectInput/DropdownIndicator.js +1 -1
- package/components/form/SelectInput/MenuList.js +1 -1
- package/components/form/SelectInput/Option.js +12 -12
- package/components/form/SelectInput/ValueContainer.js +2 -2
- package/components/form/SelectInput/index.d.ts +3 -2
- package/components/form/SelectInput/index.js +5 -5
- package/components/form/SplitInput/index.js +5 -5
- package/components/form/Switch/Switch.js +9 -9
- package/components/helpers.d.ts +2 -2
- package/components/layout/Box/index.d.ts +11 -0
- package/components/layout/Box/index.js +3 -0
- package/components/layout/Drawer/index.d.ts +13 -0
- package/components/layout/{Side/Side.js → Drawer/index.js} +12 -12
- package/components/layout/Flex/index.d.ts +10 -7
- package/components/layout/Flex/index.js +2 -11
- package/components/layout/Grid/index.d.ts +3 -2
- package/components/layout/Grid/index.js +3 -3
- package/components/layout/Popin/index.d.ts +33 -6
- package/components/layout/Popin/index.js +65 -41
- package/components/layout/Side/Provider.d.ts +9 -8
- package/components/layout/Side/Provider.js +1 -3
- package/components/layout/Side/index.js +7 -10
- package/components/layout/index.d.ts +2 -0
- package/components/layout/index.js +2 -0
- package/components/loaders/ProgressLoader/index.js +4 -4
- package/components/message/Alert/index.js +7 -7
- package/components/message/Log/index.js +2 -2
- package/components/message/Notification/Badge.js +2 -2
- package/components/message/Notification/index.d.ts +8 -14
- package/components/message/Notification/index.js +9 -29
- package/components/message/StatusNotification/index.d.ts +11 -0
- package/components/message/StatusNotification/index.js +33 -0
- package/components/message/Tip/index.d.ts +8 -0
- package/components/message/Tip/index.js +43 -0
- package/components/message/Tooltip/index.d.ts +3 -2
- package/components/message/Tooltip/index.js +26 -3
- package/components/message/Tooltip/styles.js +3 -3
- package/components/message/index.d.ts +3 -0
- package/components/message/index.js +3 -0
- package/components/navigation/Aside/index.d.ts +8 -1
- package/components/navigation/Breadcrumb/index.js +5 -5
- package/components/navigation/Header/index.d.ts +3 -3
- package/components/navigation/progress/ProgressBar/Onboarding.js +6 -6
- package/components/navigation/progress/Stepper/index.js +10 -10
- package/components/navigation/sideBar/Item/Item.d.ts +4 -7
- package/components/navigation/sideBar/Item/Item.js +34 -16
- package/components/navigation/sideBar/SideBar/SideBar.d.ts +1 -1
- package/components/navigation/sideBar/SideBar/SideBar.js +14 -6
- package/components/navigation/sideBar/Toggle/Toggle.js +2 -2
- package/components/styled.d.ts +13 -0
- package/components/styled.js +13 -0
- package/components/tabs/Bar/index.js +4 -4
- package/components/tabs/Chip/index.d.ts +13 -0
- package/components/tabs/Chip/index.js +21 -0
- package/components/tabs/Pill/index.js +7 -7
- package/components/tabs/Tabs/index.js +8 -7
- package/components/tabs/index.d.ts +2 -0
- package/components/tabs/index.js +2 -0
- package/package.json +19 -8
- package/styles/InvertTheme.d.ts +1 -8
- package/styles/StyleProvider.d.ts +3 -3
- package/styles/StyleProvider.js +3 -3
- package/styles/global.d.ts +1 -0
- package/styles/global.js +16 -38
- package/styles/index.d.ts +0 -1
- package/styles/index.js +0 -1
- package/styles/theme.d.ts +63 -39
- package/styles/theme.js +34 -8
- package/components/layout/Side/Side.d.ts +0 -13
- package/styles/reset.d.ts +0 -2
- package/styles/reset.js +0 -62
|
@@ -1,33 +1,104 @@
|
|
|
1
1
|
import { TypographyProps } from "styled-system";
|
|
2
2
|
import React, { InputHTMLAttributes } from "react";
|
|
3
|
+
declare type ValueType = HTMLInputElement["value"];
|
|
3
4
|
export declare type CommonProps = InputHTMLAttributes<HTMLInputElement> & TypographyProps & {
|
|
4
5
|
disabled?: boolean;
|
|
5
6
|
error?: string;
|
|
7
|
+
warning?: string;
|
|
6
8
|
};
|
|
7
|
-
export declare type InputProps = CommonProps & {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
export declare type InputProps<T = ValueType> = Omit<CommonProps, "value" | "onChange"> & {
|
|
10
|
+
value: T;
|
|
11
|
+
onChange?: (value: T) => void;
|
|
12
|
+
onChangeEvent?: InputHTMLAttributes<HTMLInputElement>["onChange"];
|
|
13
|
+
renderLeft?: ((props: InputProps<T>) => React.ReactNode) | React.ReactNode;
|
|
14
|
+
renderRight?: ((props: InputProps<T>) => React.ReactNode) | React.ReactNode;
|
|
11
15
|
unwrapped?: boolean;
|
|
16
|
+
containerProps?: InputContainerProps;
|
|
17
|
+
/**
|
|
18
|
+
* A function can be provided to serialize a value of any type to a string.
|
|
19
|
+
*
|
|
20
|
+
* This can be useful to wrap the `<BaseInput />` component (which expects a string)
|
|
21
|
+
* and create higher-level components that will automatically perform the input/output
|
|
22
|
+
* conversion to other types.
|
|
23
|
+
*
|
|
24
|
+
* *A serializer function should always be used in conjunction with a deserializer function.*
|
|
25
|
+
*/
|
|
26
|
+
serialize?: (value: T) => ValueType;
|
|
27
|
+
/**
|
|
28
|
+
* A deserializer can be provided to convert the html input value from a string to any other type.
|
|
29
|
+
*
|
|
30
|
+
* *A deserializer function should always be used in conjunction with a serializer function.*
|
|
31
|
+
*/
|
|
32
|
+
deserialize?: (value: ValueType) => T;
|
|
12
33
|
};
|
|
34
|
+
export declare type InputContainerProps = React.ComponentProps<typeof InputContainer>;
|
|
13
35
|
export declare const InputContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Partial<CommonProps> & {
|
|
14
36
|
focus?: boolean | undefined;
|
|
15
37
|
}, never>;
|
|
16
38
|
export declare const BaseInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, Partial<CommonProps> & {
|
|
17
39
|
focus?: boolean | undefined;
|
|
18
40
|
} & TypographyProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>>, never>;
|
|
19
|
-
export declare const InputErrorContainer: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
41
|
+
export declare const InputErrorContainer: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, import("../../asorted/Text").TextProps, keyof import("../../asorted/Text").TextProps>;
|
|
42
|
+
export declare const InputWarningContainer: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, import("../../asorted/Text").TextProps, keyof import("../../asorted/Text").TextProps>;
|
|
43
|
+
export declare const InputRenderLeftContainer: 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>>> & {
|
|
44
|
+
columnGap?: string | number | undefined;
|
|
45
|
+
rowGap?: string | number | undefined;
|
|
46
|
+
color?: string | undefined;
|
|
47
|
+
display?: string | undefined;
|
|
48
|
+
position?: string | undefined;
|
|
49
|
+
maxHeight?: number | undefined;
|
|
50
|
+
} & {
|
|
26
51
|
alignItems: string;
|
|
27
52
|
pl: string;
|
|
28
|
-
}, "alignItems" | "pl">;
|
|
29
|
-
export declare const InputRenderRightContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("
|
|
53
|
+
}, "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">;
|
|
54
|
+
export declare const InputRenderRightContainer: 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>>> & {
|
|
55
|
+
columnGap?: string | number | undefined;
|
|
56
|
+
rowGap?: string | number | undefined;
|
|
57
|
+
color?: string | undefined;
|
|
58
|
+
display?: string | undefined;
|
|
59
|
+
position?: string | undefined;
|
|
60
|
+
maxHeight?: number | undefined;
|
|
61
|
+
} & {
|
|
30
62
|
alignItems: string;
|
|
31
63
|
pr: string;
|
|
32
|
-
}, "alignItems" | "pr">;
|
|
33
|
-
|
|
64
|
+
}, "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">;
|
|
65
|
+
declare function Input<T = ValueType>(props: InputProps<T>, ref: React.ForwardedRef<HTMLInputElement>): JSX.Element;
|
|
66
|
+
declare const _default: <T>(props: Omit<CommonProps, "onChange" | "value"> & {
|
|
67
|
+
value: T;
|
|
68
|
+
onChange?: ((value: T) => void) | undefined;
|
|
69
|
+
onChangeEvent?: React.ChangeEventHandler<HTMLInputElement> | undefined;
|
|
70
|
+
renderLeft?: React.ReactNode | ((props: InputProps<T>) => React.ReactNode);
|
|
71
|
+
renderRight?: React.ReactNode | ((props: InputProps<T>) => React.ReactNode);
|
|
72
|
+
unwrapped?: boolean | undefined;
|
|
73
|
+
containerProps?: (({
|
|
74
|
+
[x: string]: any;
|
|
75
|
+
[x: number]: any;
|
|
76
|
+
[x: symbol]: any;
|
|
77
|
+
} & {
|
|
78
|
+
theme?: import("styled-components").DefaultTheme | undefined;
|
|
79
|
+
} & ({} | {
|
|
80
|
+
children?: React.ReactNode;
|
|
81
|
+
})) & {
|
|
82
|
+
as?: string | React.ComponentType<any> | undefined;
|
|
83
|
+
forwardedAs?: string | React.ComponentType<any> | undefined;
|
|
84
|
+
}) | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* A function can be provided to serialize a value of any type to a string.
|
|
87
|
+
*
|
|
88
|
+
* This can be useful to wrap the `<BaseInput />` component (which expects a string)
|
|
89
|
+
* and create higher-level components that will automatically perform the input/output
|
|
90
|
+
* conversion to other types.
|
|
91
|
+
*
|
|
92
|
+
* *A serializer function should always be used in conjunction with a deserializer function.*
|
|
93
|
+
*/
|
|
94
|
+
serialize?: ((value: T) => string) | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* A deserializer can be provided to convert the html input value from a string to any other type.
|
|
97
|
+
*
|
|
98
|
+
* *A deserializer function should always be used in conjunction with a serializer function.*
|
|
99
|
+
*/
|
|
100
|
+
deserialize?: ((value: string) => T) | undefined;
|
|
101
|
+
} & {
|
|
102
|
+
ref?: React.ForwardedRef<HTMLInputElement> | undefined;
|
|
103
|
+
}) => ReturnType<typeof Input>;
|
|
104
|
+
export default _default;
|
|
@@ -11,50 +11,62 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import styled, { css } from "styled-components";
|
|
13
13
|
import { typography } from "styled-system";
|
|
14
|
-
import React from "react";
|
|
14
|
+
import React, { useState, useMemo, useCallback } from "react";
|
|
15
15
|
import FlexBox from "../../layout/Flex";
|
|
16
16
|
import Text from "../../asorted/Text";
|
|
17
17
|
import { rgba } from "../../../styles/helpers";
|
|
18
18
|
export const InputContainer = styled.div `
|
|
19
19
|
display: flex;
|
|
20
20
|
height: 48px;
|
|
21
|
-
border: ${(p) => `1px solid ${p.theme.colors.
|
|
21
|
+
border: ${(p) => `1px solid ${p.theme.colors.neutral.c40}`};
|
|
22
22
|
border-radius: 24px;
|
|
23
23
|
transition: all 0.2s ease;
|
|
24
|
-
color: ${(p) => p.theme.colors.
|
|
24
|
+
color: ${(p) => p.theme.colors.neutral.c100};
|
|
25
25
|
|
|
26
26
|
${(p) => p.focus &&
|
|
27
27
|
!p.error &&
|
|
28
|
+
!p.warning &&
|
|
28
29
|
css `
|
|
29
|
-
border: 1px solid ${p.theme.colors.
|
|
30
|
-
box-shadow: 0 0 0 4px ${rgba(p.theme.colors.
|
|
30
|
+
border: 1px solid ${p.theme.colors.primary.c80};
|
|
31
|
+
box-shadow: 0 0 0 4px ${rgba(p.theme.colors.primary.c60, 0.48)};
|
|
31
32
|
`};
|
|
32
33
|
|
|
33
34
|
${(p) => p.error &&
|
|
34
35
|
!p.disabled &&
|
|
35
36
|
css `
|
|
36
|
-
border: 1px solid ${p.theme.colors.
|
|
37
|
+
border: 1px solid ${p.theme.colors.error.c100};
|
|
37
38
|
`};
|
|
38
39
|
|
|
39
40
|
${(p) => !p.error &&
|
|
41
|
+
p.warning &&
|
|
42
|
+
!p.disabled &&
|
|
43
|
+
css `
|
|
44
|
+
border: 1px solid ${p.theme.colors.warning.c80};
|
|
45
|
+
`};
|
|
46
|
+
|
|
47
|
+
${(p) => !p.error &&
|
|
48
|
+
!p.warning &&
|
|
40
49
|
!p.disabled &&
|
|
41
50
|
css `
|
|
42
51
|
&:hover {
|
|
43
|
-
border: ${!p.disabled && `1px solid ${p.theme.colors.
|
|
52
|
+
border: ${!p.disabled && `1px solid ${p.theme.colors.primary.c80}`};
|
|
44
53
|
}
|
|
45
54
|
`};
|
|
46
55
|
|
|
47
56
|
${(p) => p.disabled &&
|
|
48
57
|
css `
|
|
49
|
-
color: ${p.theme.colors.
|
|
50
|
-
background: ${(p) => p.theme.colors.
|
|
58
|
+
color: ${p.theme.colors.neutral.c60};
|
|
59
|
+
background: ${(p) => p.theme.colors.neutral.c20};
|
|
51
60
|
`};
|
|
52
61
|
`;
|
|
53
|
-
export const BaseInput = styled.input
|
|
62
|
+
export const BaseInput = styled.input.attrs({
|
|
63
|
+
fontSize: "paragraph",
|
|
64
|
+
fontWeight: "medium",
|
|
65
|
+
}) `
|
|
54
66
|
height: 100%;
|
|
55
67
|
width: 100%;
|
|
56
68
|
border: 0;
|
|
57
|
-
caret-color: ${(p) => p.error ? p.theme.colors.
|
|
69
|
+
caret-color: ${(p) => (p.error ? p.theme.colors.error.c100 : p.theme.colors.primary.c80)};
|
|
58
70
|
background: none;
|
|
59
71
|
outline: none;
|
|
60
72
|
cursor: ${(p) => (p.disabled ? "not-allowed" : "text")};
|
|
@@ -64,7 +76,7 @@ export const BaseInput = styled.input `
|
|
|
64
76
|
padding-left: 20px;
|
|
65
77
|
padding-right: 20px;
|
|
66
78
|
&::placeholder {
|
|
67
|
-
color: ${(p) => p.disabled ? p.theme.colors.
|
|
79
|
+
color: ${(p) => (p.disabled ? p.theme.colors.neutral.c50 : p.theme.colors.neutral.c70)};
|
|
68
80
|
}
|
|
69
81
|
|
|
70
82
|
/* Hide type=number arrow for Chrome, Safari, Edge, Opera */
|
|
@@ -82,7 +94,11 @@ export const BaseInput = styled.input `
|
|
|
82
94
|
${typography}
|
|
83
95
|
`;
|
|
84
96
|
export const InputErrorContainer = styled(Text) `
|
|
85
|
-
color: ${(p) => p.theme.colors.
|
|
97
|
+
color: ${(p) => p.theme.colors.error.c100};
|
|
98
|
+
margin-left: 12px;
|
|
99
|
+
`;
|
|
100
|
+
export const InputWarningContainer = styled(Text) `
|
|
101
|
+
color: ${(p) => p.theme.colors.warning.c80};
|
|
86
102
|
margin-left: 12px;
|
|
87
103
|
`;
|
|
88
104
|
export const InputRenderLeftContainer = styled(FlexBox).attrs(() => ({
|
|
@@ -93,23 +109,34 @@ export const InputRenderRightContainer = styled(FlexBox).attrs(() => ({
|
|
|
93
109
|
alignItems: "center",
|
|
94
110
|
pr: "16px",
|
|
95
111
|
})) ``;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
112
|
+
// Yes, this is dirty. If you can figure out a better way please change the code :).
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
114
|
+
const IDENTITY = (_) => _;
|
|
115
|
+
function Input(props, ref) {
|
|
116
|
+
const { value, disabled, error, warning, onChange, onChangeEvent, renderLeft, renderRight, unwrapped, containerProps, serialize = IDENTITY, deserialize = IDENTITY } = props, htmlInputProps = __rest(props, ["value", "disabled", "error", "warning", "onChange", "onChangeEvent", "renderLeft", "renderRight", "unwrapped", "containerProps", "serialize", "deserialize"]);
|
|
117
|
+
const [focus, setFocus] = useState(false);
|
|
118
|
+
const inputValue = useMemo(() => serialize(value), [serialize, value]);
|
|
119
|
+
const handleChange = useCallback((e) => {
|
|
120
|
+
onChange && onChange(deserialize(e.target.value));
|
|
121
|
+
onChangeEvent && onChangeEvent(e);
|
|
122
|
+
}, [onChange, onChangeEvent, deserialize]);
|
|
99
123
|
const inner = (React.createElement(React.Fragment, null,
|
|
100
124
|
typeof renderLeft === "function" ? renderLeft(props) : renderLeft,
|
|
101
|
-
React.createElement(BaseInput, Object.assign({}, htmlInputProps, { disabled: disabled, error: error, onChange:
|
|
125
|
+
React.createElement(BaseInput, Object.assign({ ref: ref }, htmlInputProps, { disabled: disabled, error: error, warning: warning, onChange: handleChange, value: inputValue, onFocus: (event) => {
|
|
102
126
|
setFocus(true);
|
|
103
127
|
htmlInputProps.onFocus && htmlInputProps.onFocus(event);
|
|
104
128
|
}, onBlur: (event) => {
|
|
105
129
|
setFocus(false);
|
|
106
130
|
htmlInputProps.onBlur && htmlInputProps.onBlur(event);
|
|
107
|
-
}
|
|
131
|
+
} })),
|
|
108
132
|
typeof renderRight === "function" ? renderRight(props) : renderRight));
|
|
109
133
|
if (unwrapped) {
|
|
110
134
|
return (React.createElement(FlexBox, { alignItems: "stretch", style: { height: "100%" } }, inner));
|
|
111
135
|
}
|
|
112
136
|
return (React.createElement("div", null,
|
|
113
|
-
React.createElement(InputContainer, { disabled: disabled, focus: focus, error: error }, inner),
|
|
114
|
-
error && !disabled && React.createElement(
|
|
137
|
+
React.createElement(InputContainer, Object.assign({ disabled: disabled, focus: focus, error: error, warning: warning }, containerProps), inner),
|
|
138
|
+
(error || warning) && !disabled && (React.createElement(FlexBox, { flexDirection: "column", rowGap: 2, mt: 2 },
|
|
139
|
+
error && React.createElement(InputErrorContainer, { variant: "small" }, error),
|
|
140
|
+
warning && React.createElement(InputWarningContainer, { variant: "small" }, warning)))));
|
|
115
141
|
}
|
|
142
|
+
export default React.forwardRef(Input);
|
|
@@ -3,7 +3,10 @@ import styled from "styled-components";
|
|
|
3
3
|
import Text from "../../asorted/Text";
|
|
4
4
|
import CheckAloneRegular from "@ledgerhq/icons-ui/react/CheckAloneRegular";
|
|
5
5
|
import { renderToStaticMarkup } from "react-dom/server";
|
|
6
|
-
const Icon =
|
|
6
|
+
const Icon = () => React.cloneElement(CheckAloneRegular({ size: 13, color: "white" }), {
|
|
7
|
+
// the xmlns attribute is required to properly display the checkbox
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
+
});
|
|
7
10
|
const CheckMarkIcon = encodeURIComponent(renderToStaticMarkup(React.createElement(Icon, null)));
|
|
8
11
|
const Input = styled.input `
|
|
9
12
|
background-color: transparent;
|
|
@@ -14,7 +17,7 @@ const Input = styled.input `
|
|
|
14
17
|
width: ${(p) => p.theme.space[7]}px;
|
|
15
18
|
height: ${(p) => p.theme.space[7]}px;
|
|
16
19
|
appearance: none;
|
|
17
|
-
border: 1px solid ${(props) => props.theme.colors.
|
|
20
|
+
border: 1px solid ${(props) => props.theme.colors.neutral.c90};
|
|
18
21
|
box-shadow: none;
|
|
19
22
|
|
|
20
23
|
&:checked {
|
|
@@ -39,7 +42,7 @@ const Input = styled.input `
|
|
|
39
42
|
}
|
|
40
43
|
`;
|
|
41
44
|
const Label = styled(Text).attrs({ type: "body", fontWeight: "500" }) `
|
|
42
|
-
color: ${(props) => props.theme.colors.
|
|
45
|
+
color: ${(props) => props.theme.colors.neutral.c80};
|
|
43
46
|
|
|
44
47
|
/* Version when the input is checked */
|
|
45
48
|
${Input}:checked + & {
|
|
@@ -52,7 +55,7 @@ const Label = styled(Text).attrs({ type: "body", fontWeight: "500" }) `
|
|
|
52
55
|
`;
|
|
53
56
|
const Container = styled.div `
|
|
54
57
|
--ll-checkbox-color: unset;
|
|
55
|
-
color: var(--ll-checkbox-color, ${(props) => props.theme.colors.
|
|
58
|
+
color: var(--ll-checkbox-color, ${(props) => props.theme.colors.primary.c90});
|
|
56
59
|
|
|
57
60
|
display: inline-flex;
|
|
58
61
|
column-gap: ${(p) => p.theme.space[5]}px;
|
|
@@ -60,23 +63,23 @@ const Container = styled.div `
|
|
|
60
63
|
cursor: pointer;
|
|
61
64
|
|
|
62
65
|
&[data-variant="default"] {
|
|
63
|
-
--ll-checkbox-color: ${(props) => props.theme.colors.
|
|
66
|
+
--ll-checkbox-color: ${(props) => props.theme.colors.primary.c90};
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
&[data-variant="success"] {
|
|
67
|
-
--ll-checkbox-color: ${(props) => props.theme.colors.
|
|
70
|
+
--ll-checkbox-color: ${(props) => props.theme.colors.success.c100};
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
&[data-variant="error"] {
|
|
71
|
-
--ll-checkbox-color: ${(props) => props.theme.colors.
|
|
74
|
+
--ll-checkbox-color: ${(props) => props.theme.colors.error.c100};
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
&[data-disabled="true"] {
|
|
75
|
-
--ll-checkbox-color: ${(props) => props.theme.colors.
|
|
78
|
+
--ll-checkbox-color: ${(props) => props.theme.colors.neutral.c80};
|
|
76
79
|
cursor: unset;
|
|
77
80
|
}
|
|
78
81
|
`;
|
|
79
82
|
const Checkbox = ({ isDisabled = false, variant = "default", label, isChecked, name, onChange, }) => (React.createElement(Container, { "data-variant": variant, "data-disabled": isDisabled },
|
|
80
83
|
React.createElement(Input, { type: "checkbox", name: name, id: name, checked: isChecked, disabled: isDisabled, onChange: onChange }),
|
|
81
|
-
label ? (React.createElement(Label, {
|
|
84
|
+
label ? (React.createElement(Label, { as: "label", htmlFor: name }, label)) : null));
|
|
82
85
|
export default Checkbox;
|
|
@@ -20,13 +20,13 @@ import FlexBox from "../../layout/Flex";
|
|
|
20
20
|
function DropdownControl(props) {
|
|
21
21
|
const { selectProps: { label }, children, } = props;
|
|
22
22
|
return (React.createElement(components.Control, Object.assign({}, props),
|
|
23
|
-
React.createElement(Text, {
|
|
23
|
+
React.createElement(Text, { fontWeight: "semiBold", variant: "paragraph", color: "neutral.c80", mr: 2 }, label),
|
|
24
24
|
children));
|
|
25
25
|
}
|
|
26
26
|
function DropdownValueContainer(props) {
|
|
27
27
|
const ChevronIcon = props.selectProps.menuIsOpen ? ChevronTopMedium : ChevronBottomMedium;
|
|
28
28
|
return (React.createElement(ValueContainer, Object.assign({}, props, { render: () => (React.createElement(FlexBox, null,
|
|
29
|
-
React.createElement(Text, {
|
|
29
|
+
React.createElement(Text, { fontWeight: "semiBold", variant: "paragraph", mr: 2 },
|
|
30
30
|
React.createElement(FlexBox, null, props.children)),
|
|
31
31
|
React.createElement(FlexBox, { alignItems: "center" },
|
|
32
32
|
React.createElement(ChevronIcon, { size: 12 })))) })));
|
|
@@ -37,7 +37,7 @@ function DropdownIndicatorsContainer() {
|
|
|
37
37
|
export default function Dropdown(props) {
|
|
38
38
|
const theme = useTheme();
|
|
39
39
|
const { styles } = props, rest = __rest(props, ["styles"]);
|
|
40
|
-
return (React.createElement(SelectInput, Object.assign({ placeholder: "", isSearchable: false, styles: Object.assign({ singleValue: (provided) => (Object.assign(Object.assign({}, provided), { color: theme.colors.
|
|
40
|
+
return (React.createElement(SelectInput, Object.assign({ placeholder: "", isSearchable: false, styles: Object.assign({ singleValue: (provided) => (Object.assign(Object.assign({}, provided), { color: theme.colors.neutral.c100, margin: 0, top: undefined, position: undefined, overflow: undefined, maxWidth: undefined, transform: undefined })), input: () => ({ display: "none" }), menu: (provided) => (Object.assign(Object.assign({}, provided), { border: 0, boxShadow: "none", background: "none", width: "auto", minWidth: "200px" })) }, styles) }, rest, { components: {
|
|
41
41
|
Control: DropdownControl,
|
|
42
42
|
ValueContainer: DropdownValueContainer,
|
|
43
43
|
IndicatorsContainer: DropdownIndicatorsContainer,
|
|
@@ -14,14 +14,14 @@ import Input, { InputRenderRightContainer } from "../BaseInput";
|
|
|
14
14
|
import Text from "../../asorted/Text";
|
|
15
15
|
import styled from "styled-components";
|
|
16
16
|
const Legend = styled(Text) `
|
|
17
|
-
color: ${(props) => props.theme.colors.
|
|
17
|
+
color: ${(props) => props.theme.colors.neutral.c70};
|
|
18
18
|
|
|
19
19
|
&[data-disabled="true"] {
|
|
20
|
-
color: ${(props) => props.theme.colors.
|
|
20
|
+
color: ${(props) => props.theme.colors.neutral.c50};
|
|
21
21
|
}
|
|
22
22
|
`;
|
|
23
23
|
export default function LegendInput(_a) {
|
|
24
24
|
var { legend } = _a, inputProps = __rest(_a, ["legend"]);
|
|
25
25
|
return (React.createElement(Input, Object.assign({}, inputProps, { renderRight: React.createElement(InputRenderRightContainer, null,
|
|
26
|
-
React.createElement(Legend, {
|
|
26
|
+
React.createElement(Legend, { variant: "body", "data-disabled": inputProps.disabled }, legend)) })));
|
|
27
27
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { InputProps } from "../BaseInput";
|
|
3
|
-
export default function NumberInput({ onPercentClick, max,
|
|
3
|
+
export default function NumberInput({ value, onPercentClick, max, disabled, ...inputProps }: InputProps<number | undefined> & {
|
|
4
4
|
onPercentClick: (percent: number) => void;
|
|
5
5
|
}): JSX.Element;
|
|
@@ -16,8 +16,8 @@ import Text from "../../asorted/Text";
|
|
|
16
16
|
import styled from "styled-components";
|
|
17
17
|
// TODO: Replace me with a real button as soon as they are designed
|
|
18
18
|
const MaxButton = styled.button `
|
|
19
|
-
color: ${(p) => p.active ? p.theme.colors.
|
|
20
|
-
background-color: ${(p) => p.active ? p.theme.colors.
|
|
19
|
+
color: ${(p) => (p.active ? p.theme.colors.neutral.c00 : p.theme.colors.neutral.c70)};
|
|
20
|
+
background-color: ${(p) => (p.active ? p.theme.colors.neutral.c100 : p.theme.colors.neutral.c00)};
|
|
21
21
|
border-radius: 100px;
|
|
22
22
|
border-width: 0;
|
|
23
23
|
height: 31px;
|
|
@@ -26,15 +26,26 @@ const MaxButton = styled.button `
|
|
|
26
26
|
cursor: pointer;
|
|
27
27
|
|
|
28
28
|
&:disabled {
|
|
29
|
-
color: ${(p) => p.theme.colors.
|
|
30
|
-
background-color: ${(p) => (p.active ? p.theme.colors.
|
|
29
|
+
color: ${(p) => p.theme.colors.neutral.c50};
|
|
30
|
+
background-color: ${(p) => (p.active ? p.theme.colors.neutral.c30 : "transparent")};
|
|
31
31
|
cursor: unset;
|
|
32
32
|
}
|
|
33
33
|
`;
|
|
34
|
+
function serialize(value) {
|
|
35
|
+
return value ? "" + value : "";
|
|
36
|
+
}
|
|
37
|
+
function deserialize(value) {
|
|
38
|
+
try {
|
|
39
|
+
return parseFloat(value);
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
34
45
|
export default function NumberInput(_a) {
|
|
35
|
-
var { onPercentClick, max,
|
|
36
|
-
return (React.createElement(Input, Object.assign({}, inputProps, { value: value, max: max, disabled: disabled,
|
|
37
|
-
React.createElement(Text, {
|
|
46
|
+
var { value, onPercentClick, max, disabled } = _a, inputProps = __rest(_a, ["value", "onPercentClick", "max", "disabled"]);
|
|
47
|
+
return (React.createElement(Input, Object.assign({ serialize: serialize, deserialize: deserialize }, inputProps, { type: "number", value: value, max: max, disabled: disabled, renderRight: React.createElement(FlexBox, { alignItems: "center", justifyContent: "center", py: "3px", mr: "8px" }, [0.25, 0.5, 0.75, 1].map((percent) => (React.createElement(MaxButton, { key: percent, onClick: () => onPercentClick(percent), active: !!value && !!max && Number(value) === percent * Number(max), disabled: disabled },
|
|
48
|
+
React.createElement(Text, { variant: "tiny", color: "inherit" },
|
|
38
49
|
percent * 100,
|
|
39
50
|
"%"))))) })));
|
|
40
51
|
}
|
|
@@ -22,13 +22,13 @@ const QrCodeButton = styled.button `
|
|
|
22
22
|
height: 32px;
|
|
23
23
|
border-radius: 50%;
|
|
24
24
|
border-width: 0;
|
|
25
|
-
color: ${(p) => p.theme.colors.
|
|
26
|
-
background-color: ${(p) => p.theme.colors.
|
|
25
|
+
color: ${(p) => p.theme.colors.neutral.c00};
|
|
26
|
+
background-color: ${(p) => p.theme.colors.neutral.c100};
|
|
27
27
|
cursor: pointer;
|
|
28
28
|
|
|
29
29
|
&:disabled {
|
|
30
|
-
background-color: ${(p) => p.theme.colors.
|
|
31
|
-
color: ${(p) => p.theme.colors.
|
|
30
|
+
background-color: ${(p) => p.theme.colors.neutral.c30};
|
|
31
|
+
color: ${(p) => p.theme.colors.neutral.c50};
|
|
32
32
|
cursor: unset;
|
|
33
33
|
}
|
|
34
34
|
`;
|
|
@@ -15,8 +15,8 @@ import FlexBox from "../../layout/Flex";
|
|
|
15
15
|
import Text from "../../asorted/Text";
|
|
16
16
|
import styled from "styled-components";
|
|
17
17
|
const MaxButton = styled.button `
|
|
18
|
-
color: ${(p) => p.theme.colors.
|
|
19
|
-
background-color: ${(p) => p.theme.colors.
|
|
18
|
+
color: ${(p) => p.theme.colors.neutral.c00};
|
|
19
|
+
background-color: ${(p) => p.theme.colors.neutral.c100};
|
|
20
20
|
border-radius: 100px;
|
|
21
21
|
border-width: 0;
|
|
22
22
|
padding-left: 14px;
|
|
@@ -25,22 +25,22 @@ const MaxButton = styled.button `
|
|
|
25
25
|
cursor: pointer;
|
|
26
26
|
|
|
27
27
|
&:disabled {
|
|
28
|
-
background-color: ${(p) => p.theme.colors.
|
|
29
|
-
color: ${(p) => p.theme.colors.
|
|
28
|
+
background-color: ${(p) => p.theme.colors.neutral.c30};
|
|
29
|
+
color: ${(p) => p.theme.colors.neutral.c50};
|
|
30
30
|
cursor: unset;
|
|
31
31
|
}
|
|
32
32
|
`;
|
|
33
33
|
const Legend = styled(Text) `
|
|
34
|
-
color: ${(p) => p.theme.colors.
|
|
34
|
+
color: ${(p) => p.theme.colors.neutral.c70};
|
|
35
35
|
|
|
36
36
|
&[data-disabled="true"] {
|
|
37
|
-
color: ${(p) => p.theme.colors.
|
|
37
|
+
color: ${(p) => p.theme.colors.neutral.c50};
|
|
38
38
|
}
|
|
39
39
|
`;
|
|
40
40
|
export default function QuantityInput(_a) {
|
|
41
41
|
var { onMaxClick, price } = _a, inputProps = __rest(_a, ["onMaxClick", "price"]);
|
|
42
42
|
return (React.createElement(Input, Object.assign({}, inputProps, { type: "number", renderRight: React.createElement(FlexBox, { alignItems: "center", justifyContent: "center", pr: "3px", py: "3px" },
|
|
43
|
-
price && (React.createElement(Legend, {
|
|
43
|
+
price && (React.createElement(Legend, { variant: "body", pr: "12px", "data-disabled": inputProps.disabled }, price)),
|
|
44
44
|
React.createElement(MaxButton, { onClick: onMaxClick, disabled: inputProps.disabled },
|
|
45
|
-
React.createElement(Text, {
|
|
45
|
+
React.createElement(Text, { variant: "tiny", color: "currentColor" }, "Max"))) })));
|
|
46
46
|
}
|
|
@@ -4,5 +4,8 @@ export declare type RadioElementProps = InputAttributes & {
|
|
|
4
4
|
variant?: "default" | "success" | "error";
|
|
5
5
|
label: string;
|
|
6
6
|
};
|
|
7
|
-
declare const
|
|
8
|
-
|
|
7
|
+
declare const Element: {
|
|
8
|
+
({ label, value, disabled, variant, ...props }: RadioElementProps): JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export default Element;
|
|
@@ -15,10 +15,10 @@ import { rgba } from "../../../styles/helpers";
|
|
|
15
15
|
import Text from "../../asorted/Text";
|
|
16
16
|
import { RadioContext } from "./index";
|
|
17
17
|
const Label = styled(Text) `
|
|
18
|
-
color: var(--ledger-ui-checkbox-color, ${(p) => p.theme.colors.
|
|
18
|
+
color: var(--ledger-ui-checkbox-color, ${(p) => p.theme.colors.neutral.c100});
|
|
19
19
|
`;
|
|
20
20
|
const Input = styled.input `
|
|
21
|
-
--ledger-ui-checkbox-color: ${(p) => p.theme.colors.
|
|
21
|
+
--ledger-ui-checkbox-color: ${(p) => p.theme.colors.neutral.c50};
|
|
22
22
|
--ledger-ui-checkbox-size: 1.25rem;
|
|
23
23
|
|
|
24
24
|
position: relative;
|
|
@@ -46,17 +46,17 @@ const Input = styled.input `
|
|
|
46
46
|
|
|
47
47
|
&[data-variant="default"] {
|
|
48
48
|
:hover {
|
|
49
|
-
--ledger-ui-checkbox-color: ${(p) => p.theme.colors.
|
|
49
|
+
--ledger-ui-checkbox-color: ${(p) => p.theme.colors.primary.c90};
|
|
50
50
|
}
|
|
51
51
|
:active {
|
|
52
|
-
--ledger-ui-checkbox-color: ${(p) => p.theme.colors.
|
|
52
|
+
--ledger-ui-checkbox-color: ${(p) => p.theme.colors.primary.c100};
|
|
53
53
|
}
|
|
54
54
|
:checked,
|
|
55
55
|
:focus {
|
|
56
|
-
--ledger-ui-checkbox-color: ${(p) => p.theme.colors.
|
|
56
|
+
--ledger-ui-checkbox-color: ${(p) => p.theme.colors.primary.c80};
|
|
57
57
|
}
|
|
58
58
|
:focus {
|
|
59
|
-
box-shadow: 0px 0px 0px 4px ${(p) => rgba(p.theme.colors.
|
|
59
|
+
box-shadow: 0px 0px 0px 4px ${(p) => rgba(p.theme.colors.primary.c60, 0.48)};
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -64,10 +64,10 @@ const Input = styled.input `
|
|
|
64
64
|
:hover,
|
|
65
65
|
:checked:not([disabled]),
|
|
66
66
|
:checked:not([disabled]) + ${Label}, :focus {
|
|
67
|
-
--ledger-ui-checkbox-color: ${(p) => p.theme.colors.
|
|
67
|
+
--ledger-ui-checkbox-color: ${(p) => p.theme.colors.success.c100};
|
|
68
68
|
}
|
|
69
69
|
:focus {
|
|
70
|
-
box-shadow: 0px 0px 0px 4px ${(p) => rgba(p.theme.colors.
|
|
70
|
+
box-shadow: 0px 0px 0px 4px ${(p) => rgba(p.theme.colors.success.c100, 0.48)};
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -75,17 +75,17 @@ const Input = styled.input `
|
|
|
75
75
|
:hover,
|
|
76
76
|
:checked:not([disabled]),
|
|
77
77
|
:checked:not([disabled]) + ${Label}, :focus {
|
|
78
|
-
--ledger-ui-checkbox-color: ${(p) => p.theme.colors.
|
|
78
|
+
--ledger-ui-checkbox-color: ${(p) => p.theme.colors.error.c100};
|
|
79
79
|
}
|
|
80
80
|
:focus {
|
|
81
|
-
box-shadow: 0px 0px 0px 4px ${(p) => rgba(p.theme.colors.
|
|
81
|
+
box-shadow: 0px 0px 0px 4px ${(p) => rgba(p.theme.colors.error.c100, 0.48)};
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
&[data-variant]:disabled {
|
|
86
|
-
--ledger-ui-checkbox-color: ${(p) => p.theme.colors.
|
|
86
|
+
--ledger-ui-checkbox-color: ${(p) => p.theme.colors.neutral.c40};
|
|
87
87
|
cursor: unset;
|
|
88
|
-
background-color: ${(p) => p.theme.colors.
|
|
88
|
+
background-color: ${(p) => p.theme.colors.neutral.c30};
|
|
89
89
|
}
|
|
90
90
|
`;
|
|
91
91
|
const RadioElement = styled.label.attrs({ tabIndex: -1 }) `
|
|
@@ -93,7 +93,7 @@ const RadioElement = styled.label.attrs({ tabIndex: -1 }) `
|
|
|
93
93
|
column-gap: 0.75rem;
|
|
94
94
|
align-items: center;
|
|
95
95
|
`;
|
|
96
|
-
|
|
96
|
+
const Element = (_a) => {
|
|
97
97
|
var { label, value, disabled, variant = "default" } = _a, props = __rest(_a, ["label", "value", "disabled", "variant"]);
|
|
98
98
|
const context = useContext(RadioContext);
|
|
99
99
|
if (context === undefined)
|
|
@@ -105,5 +105,7 @@ export default (_a) => {
|
|
|
105
105
|
};
|
|
106
106
|
return (React.createElement(RadioElement, null,
|
|
107
107
|
React.createElement(Input, Object.assign({ type: "radio", "data-variant": variant, checked: isChecked, disabled: disabled, onChange: handleChange, value: value, name: context.name }, props)),
|
|
108
|
-
React.createElement(Label, {
|
|
108
|
+
React.createElement(Label, { variant: "paragraph" }, label)));
|
|
109
109
|
};
|
|
110
|
+
Element.displayName = "Radio.Element"; // For easy identification in the React devtools & in storybook
|
|
111
|
+
export default Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { InputHTMLAttributes } from "react";
|
|
2
|
+
import { FlexBoxProps } from "../../layout/Flex";
|
|
3
|
+
declare type ElementState = {
|
|
4
|
+
checked: boolean;
|
|
5
|
+
disabled: boolean | undefined;
|
|
6
|
+
};
|
|
7
|
+
export declare const Label: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, import("../../asorted/Text").TextProps & ElementState, keyof import("../../asorted/Text").TextProps>;
|
|
8
|
+
declare type InputAttributes = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "onChange" | "name">;
|
|
9
|
+
export declare type RadioListElementProps = InputAttributes & {
|
|
10
|
+
/**
|
|
11
|
+
* The string or component that will be rendered as label of this radio element
|
|
12
|
+
* If it's a component, it's rendered with these props: { checked:boolean; disabled:boolean }
|
|
13
|
+
* */
|
|
14
|
+
label: string | React.ComponentType<ElementState> | ((arg1: ElementState) => JSX.Element);
|
|
15
|
+
/** Flex props to pass to the container */
|
|
16
|
+
containerProps?: FlexBoxProps;
|
|
17
|
+
};
|
|
18
|
+
declare const ListElement: {
|
|
19
|
+
({ label, value, disabled, containerProps, ...props }: RadioListElementProps): JSX.Element;
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
22
|
+
export default ListElement;
|