@ledgerhq/react-ui 0.3.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 +4 -4
- package/components/Chart/index.js +1 -1
- package/components/Table/Columns.js +2 -2
- package/components/Table/stories.helper.js +6 -6
- package/components/Tag/index.js +7 -7
- package/components/asorted/Divider/index.js +2 -2
- package/components/asorted/Icon/Icon.d.ts +1 -0
- package/components/asorted/Icon/Icon.js +7 -0
- package/components/asorted/Icon/index.d.ts +1 -1
- package/components/asorted/Icon/index.js +1 -1
- 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 +2 -2
- package/components/cta/Button/index.js +39 -38
- package/components/form/BaseInput/index.js +13 -13
- package/components/form/Checkbox/Checkbox.js +7 -7
- package/components/form/Dropdown/index.js +2 -2
- package/components/form/LegendInput/index.js +2 -2
- package/components/form/NumberInput/index.js +4 -4
- package/components/form/QrCodeInput/index.js +4 -4
- package/components/form/QuantityInput/index.js +6 -6
- package/components/form/Radio/RadioElement.js +12 -12
- package/components/form/Radio/RadioListElement.js +7 -8
- 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 +11 -11
- package/components/form/SelectInput/ValueContainer.js +1 -1
- package/components/form/SelectInput/index.d.ts +3 -2
- package/components/form/SelectInput/index.js +4 -4
- 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/Drawer/index.d.ts +0 -1
- package/components/layout/Drawer/index.js +3 -3
- package/components/layout/Popin/index.js +4 -4
- package/components/loaders/ProgressLoader/index.js +3 -3
- package/components/message/Alert/index.js +6 -6
- 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.js +7 -7
- 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/Breadcrumb/index.js +5 -5
- package/components/navigation/progress/ProgressBar/Onboarding.js +6 -6
- package/components/navigation/progress/Stepper/index.js +9 -9
- package/components/navigation/sideBar/Item/Item.js +10 -10
- package/components/navigation/sideBar/SideBar/SideBar.js +3 -3
- package/components/navigation/sideBar/Toggle/Toggle.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/package.json +1 -1
- package/styles/StyleProvider.js +1 -1
- package/styles/global.js +15 -36
- package/styles/index.d.ts +0 -1
- package/styles/index.js +0 -1
- package/styles/theme.d.ts +4 -1
- package/styles/theme.js +5 -7
- package/styles/reset.d.ts +0 -2
- package/styles/reset.js +0 -62
|
@@ -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,8 +26,8 @@ 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
|
`;
|
|
@@ -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,16 +25,16 @@ 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) {
|
|
@@ -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 }) `
|
|
@@ -17,30 +17,29 @@ import { rgba } from "../../../styles/helpers";
|
|
|
17
17
|
import { RadioContext } from "./index";
|
|
18
18
|
export const Label = styled(Text) `
|
|
19
19
|
color: ${(p) => p.disabled
|
|
20
|
-
? p.theme.colors.
|
|
20
|
+
? p.theme.colors.neutral.c50
|
|
21
21
|
: p.checked
|
|
22
|
-
? p.theme.colors.
|
|
23
|
-
: p.theme.colors.
|
|
22
|
+
? p.theme.colors.primary.c90
|
|
23
|
+
: p.theme.colors.neutral.c100};
|
|
24
24
|
`;
|
|
25
25
|
const Container = styled(Flex) `
|
|
26
26
|
cursor: ${(p) => (p.disabled ? "" : "pointer")};
|
|
27
27
|
justify-content: center;
|
|
28
28
|
align-items: center;
|
|
29
|
-
background-color: ${(p) => (p.checked ? p.theme.colors.
|
|
30
|
-
border: 1px solid
|
|
31
|
-
${(p) => (p.checked ? p.theme.colors.palette.primary.c50 : p.theme.colors.palette.neutral.c40)};
|
|
29
|
+
background-color: ${(p) => (p.checked ? p.theme.colors.primary.c20 : "")};
|
|
30
|
+
border: 1px solid ${(p) => (p.checked ? p.theme.colors.primary.c50 : p.theme.colors.neutral.c40)};
|
|
32
31
|
border-radius: ${(p) => `${p.theme.radii[2]}px`};
|
|
33
32
|
padding: ${(p) => p.theme.space[6]}px;
|
|
34
33
|
|
|
35
34
|
:hover {
|
|
36
|
-
border-color: ${(p) => (p.disabled || p.checked ? "" : p.theme.colors.
|
|
35
|
+
border-color: ${(p) => (p.disabled || p.checked ? "" : p.theme.colors.primary.c80)};
|
|
37
36
|
}
|
|
38
37
|
`;
|
|
39
38
|
const Input = styled.input `
|
|
40
39
|
position: relative;
|
|
41
40
|
appearance: none;
|
|
42
41
|
&:focus ~ ${Container} {
|
|
43
|
-
box-shadow: 0px 0px 0px 4px ${(p) => rgba(p.theme.colors.
|
|
42
|
+
box-shadow: 0px 0px 0px 4px ${(p) => rgba(p.theme.colors.primary.c60, 0.48)};
|
|
44
43
|
}
|
|
45
44
|
`;
|
|
46
45
|
const RadioListElement = styled.label.attrs({ tabIndex: -1 }) `
|
|
@@ -5,5 +5,5 @@ import SearchMedium from "@ledgerhq/icons-ui/react/SearchMedium";
|
|
|
5
5
|
export default function SearchInput(props) {
|
|
6
6
|
const theme = useTheme();
|
|
7
7
|
return (React.createElement(Input, Object.assign({}, props, { renderLeft: React.createElement(InputRenderLeftContainer, null,
|
|
8
|
-
React.createElement(SearchMedium, { color: props.disabled ? theme.colors.
|
|
8
|
+
React.createElement(SearchMedium, { color: props.disabled ? theme.colors.neutral.c50 : theme.colors.neutral.c70 })) })));
|
|
9
9
|
}
|
|
@@ -10,7 +10,7 @@ export function DropdownIndicator(props) {
|
|
|
10
10
|
const theme = useTheme();
|
|
11
11
|
const { isDisabled } = props.selectProps;
|
|
12
12
|
const ChevronIcon = props.selectProps.menuIsOpen ? ChevronTopMedium : ChevronBottomMedium;
|
|
13
|
-
const color = isDisabled ? theme.colors.
|
|
13
|
+
const color = isDisabled ? theme.colors.neutral.c60 : theme.colors.neutral.c100;
|
|
14
14
|
return (React.createElement(components.DropdownIndicator, Object.assign({}, props),
|
|
15
15
|
React.createElement(Text, { as: "div", color: color, style: { display: "flex" } },
|
|
16
16
|
React.createElement(ChevronIcon, { size: 12 }))));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { components } from "react-select";
|
|
3
3
|
export function getStyles(theme) {
|
|
4
|
-
return (provided) => (Object.assign(Object.assign({}, provided), { display: "flex", flexDirection: "column", gap: theme.space[2], padding: theme.space[3], border: `1px solid ${theme.colors.
|
|
4
|
+
return (provided) => (Object.assign(Object.assign({}, provided), { display: "flex", flexDirection: "column", gap: theme.space[2], padding: theme.space[3], border: `1px solid ${theme.colors.neutral.c20}`, borderRadius: "8px", boxShadow: `0px 2px 12px rgba(0, 0, 0, 0.04)`, background: theme.colors.neutral.c00, color: theme.colors.neutral.c80 }));
|
|
5
5
|
}
|
|
6
6
|
export function MenuList(props) {
|
|
7
7
|
return React.createElement(components.MenuList, Object.assign({}, props), props.children);
|
|
@@ -26,34 +26,34 @@ const Wrapper = styled(Text).attrs({ as: "div" }) `
|
|
|
26
26
|
const { theme, selected, focus, disabled } = props;
|
|
27
27
|
if (selected) {
|
|
28
28
|
return `
|
|
29
|
-
color: ${theme.colors.
|
|
30
|
-
background: ${theme.colors.
|
|
29
|
+
color: ${theme.colors.primary.c90};
|
|
30
|
+
background: ${theme.colors.primary.c20};
|
|
31
31
|
`;
|
|
32
32
|
}
|
|
33
33
|
if (disabled) {
|
|
34
34
|
return `
|
|
35
|
-
color: ${theme.colors.
|
|
35
|
+
color: ${theme.colors.neutral.c50};
|
|
36
36
|
${focus
|
|
37
37
|
? `&:not(:active) {
|
|
38
|
-
background: ${theme.colors.
|
|
38
|
+
background: ${theme.colors.neutral.c20};
|
|
39
39
|
}`
|
|
40
40
|
: ""}
|
|
41
41
|
`;
|
|
42
42
|
}
|
|
43
43
|
return `
|
|
44
|
-
color: ${theme.colors.
|
|
44
|
+
color: ${theme.colors.neutral.c80};
|
|
45
45
|
&:hover {
|
|
46
|
-
color: ${theme.colors.
|
|
47
|
-
background: ${theme.colors.
|
|
46
|
+
color: ${theme.colors.neutral.c100};
|
|
47
|
+
background: ${theme.colors.primary.c10};
|
|
48
48
|
}
|
|
49
49
|
&:active {
|
|
50
|
-
color: ${theme.colors.
|
|
51
|
-
background: ${theme.colors.
|
|
50
|
+
color: ${theme.colors.neutral.c100};
|
|
51
|
+
background: ${theme.colors.primary.c30};
|
|
52
52
|
}
|
|
53
53
|
${focus
|
|
54
54
|
? `&:not(:active) {
|
|
55
|
-
color: ${theme.colors.
|
|
56
|
-
background: ${theme.colors.
|
|
55
|
+
color: ${theme.colors.neutral.c100};
|
|
56
|
+
background: ${theme.colors.primary.c10};
|
|
57
57
|
}`
|
|
58
58
|
: ""}
|
|
59
59
|
`;
|
|
@@ -5,7 +5,7 @@ export function getStyles() {
|
|
|
5
5
|
return (provided) => (Object.assign(Object.assign({}, provided), { padding: 0 }));
|
|
6
6
|
}
|
|
7
7
|
export function ValueContainer(props) {
|
|
8
|
-
const color = props.selectProps.isDisabled ? "
|
|
8
|
+
const color = props.selectProps.isDisabled ? "neutral.c60" : "neutral.c100";
|
|
9
9
|
return (React.createElement(components.ValueContainer, Object.assign({}, props),
|
|
10
10
|
React.createElement(Text, { as: "div", variant: "paragraph", color: color }, props.render ? props.render(props) : props.children)));
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Props as SelectProps, OptionTypeBase } from "react-select";
|
|
2
|
+
import { Props as SelectProps, OptionTypeBase, Styles } from "react-select";
|
|
3
3
|
export declare type SelfProps<T extends OptionTypeBase = {
|
|
4
4
|
label: string;
|
|
5
5
|
value: string;
|
|
@@ -9,6 +9,7 @@ export declare type SelfProps<T extends OptionTypeBase = {
|
|
|
9
9
|
renderRight?: (props: Props<T, M>) => React.ReactNode;
|
|
10
10
|
rowHeight?: number;
|
|
11
11
|
unwrapped?: boolean;
|
|
12
|
+
extendStyles?: (styles: Styles<T, M>) => Styles<T, M>;
|
|
12
13
|
};
|
|
13
14
|
export declare type Props<T extends OptionTypeBase = {
|
|
14
15
|
label: string;
|
|
@@ -17,6 +18,6 @@ export declare type Props<T extends OptionTypeBase = {
|
|
|
17
18
|
declare function SelectInput<T extends OptionTypeBase = {
|
|
18
19
|
label: string;
|
|
19
20
|
value: string;
|
|
20
|
-
}, M extends boolean = false>({ error, rowHeight, unwrapped, ...props }: Props<T, M>): JSX.Element;
|
|
21
|
+
}, M extends boolean = false>({ error, rowHeight, unwrapped, extendStyles, ...props }: Props<T, M>): JSX.Element;
|
|
21
22
|
declare const _default: typeof SelectInput;
|
|
22
23
|
export default _default;
|
|
@@ -25,15 +25,15 @@ const stylesFn = (theme) => ({
|
|
|
25
25
|
dropdownIndicator: DropdownIndicatorModule.getStyles(),
|
|
26
26
|
menuList: MenuListModule.getStyles(theme),
|
|
27
27
|
option: OptionModule.getStyles(),
|
|
28
|
-
input: (provided) => (Object.assign(Object.assign({}, provided), { color: theme.colors.
|
|
29
|
-
placeholder: (provided) => (Object.assign(Object.assign({}, provided), { color: theme.colors.
|
|
28
|
+
input: (provided) => (Object.assign(Object.assign({}, provided), { color: theme.colors.neutral.c100 })),
|
|
29
|
+
placeholder: (provided) => (Object.assign(Object.assign({}, provided), { color: theme.colors.neutral.c60 })),
|
|
30
30
|
singleValue: (provided) => (Object.assign(Object.assign({}, provided), { color: "inherit" })),
|
|
31
31
|
menu: (provided) => (Object.assign(Object.assign({}, provided), { border: 0, boxShadow: "none", background: "none" })),
|
|
32
32
|
});
|
|
33
33
|
function SelectInput(_a) {
|
|
34
|
-
var { error, rowHeight = 48, unwrapped } = _a, props = __rest(_a, ["error", "rowHeight", "unwrapped"]);
|
|
34
|
+
var { error, rowHeight = 48, unwrapped, extendStyles } = _a, props = __rest(_a, ["error", "rowHeight", "unwrapped", "extendStyles"]);
|
|
35
35
|
const theme = useTheme();
|
|
36
|
-
const styles = useMemo(() => stylesFn(theme), [theme]);
|
|
36
|
+
const styles = useMemo(() => (extendStyles ? extendStyles(stylesFn(theme)) : stylesFn(theme)), [theme, extendStyles]);
|
|
37
37
|
const { isDisabled, components = {} } = props;
|
|
38
38
|
const innerContent = (React.createElement(Select, Object.assign({}, props, { error: error, styles: Object.assign(Object.assign({}, styles), props.styles), classNamePrefix: "react-select", rowHeight: rowHeight, components: Object.assign({ Control: ControlModule.Control, ValueContainer: ValueContainerModule.ValueContainer, IndicatorsContainer, DropdownIndicator: DropdownIndicatorModule.DropdownIndicator, MenuList: MenuListModule.MenuList, Option: OptionModule.Option, IndicatorSeparator: null }, components) })));
|
|
39
39
|
if (unwrapped)
|
|
@@ -4,19 +4,19 @@ import { InputContainer, InputErrorContainer } from "../BaseInput";
|
|
|
4
4
|
function getDividerColor(props) {
|
|
5
5
|
var _a, _b, _c, _d;
|
|
6
6
|
if (props.disabled) {
|
|
7
|
-
return (_a = props.theme) === null || _a === void 0 ? void 0 : _a.colors.
|
|
7
|
+
return (_a = props.theme) === null || _a === void 0 ? void 0 : _a.colors.neutral.c40;
|
|
8
8
|
}
|
|
9
9
|
if (props.error) {
|
|
10
|
-
return (_b = props.theme) === null || _b === void 0 ? void 0 : _b.colors.
|
|
10
|
+
return (_b = props.theme) === null || _b === void 0 ? void 0 : _b.colors.error.c100;
|
|
11
11
|
}
|
|
12
12
|
if (props.focus) {
|
|
13
|
-
return (_c = props.theme) === null || _c === void 0 ? void 0 : _c.colors.
|
|
13
|
+
return (_c = props.theme) === null || _c === void 0 ? void 0 : _c.colors.primary.c80;
|
|
14
14
|
}
|
|
15
|
-
return (_d = props.theme) === null || _d === void 0 ? void 0 : _d.colors.
|
|
15
|
+
return (_d = props.theme) === null || _d === void 0 ? void 0 : _d.colors.neutral.c40;
|
|
16
16
|
}
|
|
17
17
|
function getHoverBolderColor(props) {
|
|
18
18
|
var _a;
|
|
19
|
-
return props.disabled || props.error ? "inherit" : (_a = props.theme) === null || _a === void 0 ? void 0 : _a.colors.
|
|
19
|
+
return props.disabled || props.error ? "inherit" : (_a = props.theme) === null || _a === void 0 ? void 0 : _a.colors.primary.c80;
|
|
20
20
|
}
|
|
21
21
|
const Divider = styled.div `
|
|
22
22
|
border-right: 1px solid;
|
|
@@ -33,7 +33,7 @@ const Switcher = styled.div `
|
|
|
33
33
|
position: relative;
|
|
34
34
|
display: inline-block;
|
|
35
35
|
|
|
36
|
-
background: ${(props) => props.theme.colors.
|
|
36
|
+
background: ${(props) => props.theme.colors.neutral.c60};
|
|
37
37
|
border-radius: ${(p) => p.theme.space[6]}px;
|
|
38
38
|
width: var(--ll-switch-width);
|
|
39
39
|
height: var(--ll-switch-height);
|
|
@@ -47,7 +47,7 @@ const Switcher = styled.div `
|
|
|
47
47
|
|
|
48
48
|
&:focus {
|
|
49
49
|
outline-style: auto;
|
|
50
|
-
outline: 1px solid ${(props) => props.theme.colors.
|
|
50
|
+
outline: 1px solid ${(props) => props.theme.colors.neutral.c90};
|
|
51
51
|
outline-offset: ${(p) => p.theme.space[1]}px;
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -55,7 +55,7 @@ const Switcher = styled.div `
|
|
|
55
55
|
&:before {
|
|
56
56
|
position: absolute;
|
|
57
57
|
display: block;
|
|
58
|
-
background: ${(props) => props.theme.colors.
|
|
58
|
+
background: ${(props) => props.theme.colors.constant.white};
|
|
59
59
|
border-radius: ${(p) => p.theme.space[12]}px;
|
|
60
60
|
|
|
61
61
|
width: calc(calc(var(--ll-switch-width) / 2) - var(--ll-switch-padding));
|
|
@@ -72,27 +72,27 @@ const Switcher = styled.div `
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
&:hover {
|
|
75
|
-
background-color: ${(props) => props.theme.colors.
|
|
75
|
+
background-color: ${(props) => props.theme.colors.neutral.c70};
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
&:active {
|
|
79
|
-
background-color: ${(props) => props.theme.colors.
|
|
79
|
+
background-color: ${(props) => props.theme.colors.neutral.c80};
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
/* CHECKED VARIANT */
|
|
83
83
|
${Input}:checked ~ & {
|
|
84
|
-
background: ${(props) => props.theme.colors.
|
|
84
|
+
background: ${(props) => props.theme.colors.primary.c80};
|
|
85
85
|
|
|
86
86
|
&:before {
|
|
87
87
|
transform: translateX(calc(var(--ll-switch-width) / 2));
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
&:hover {
|
|
91
|
-
background: ${(props) => props.theme.colors.
|
|
91
|
+
background: ${(props) => props.theme.colors.primary.c90};
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
:active {
|
|
95
|
-
background: ${(props) => props.theme.colors.
|
|
95
|
+
background: ${(props) => props.theme.colors.primary.c100};
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
`;
|
package/components/helpers.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
export declare const lipsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi varius sollicitudin lectus vel finibus. Praesent eu leo nec libero interdum sodales et eget nulla. Donec tincidunt posuere sem vel porttitor. Nullam maximus urna non elit tempor, ut fermentum metus euismod. Quisque et rutrum arcu. Etiam nisl elit, tincidunt volutpat libero sed, imperdiet mollis risus. Maecenas imperdiet lectus id sapien tempus, eget fringilla nisl lacinia. Sed sem velit, egestas nec imperdiet ac, lobortis vel lectus. Curabitur dui orci, aliquam sit amet metus ut, sollicitudin fermentum erat. Curabitur id purus eget lectus varius congue. Donec eu auctor augue. Ut eleifend arcu nisl, volutpat fringilla quam cursus sit amet. Praesent leo enim, cursus vel egestas sed, vestibulum imperdiet diam. Etiam a diam lectus. Suspendisse aliquam imperdiet ultrices. Phasellus eget nulla eros. Nullam semper porta pulvinar. Duis maximus, lectus ac fringilla interdum, lacus ex cursus tellus, et dapibus est nisi id dolor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla gravida elit turpis, ac condimentum velit placerat at. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In dolor tellus, semper id pulvinar eget, ornare bibendum justo. Sed in libero nisl. Morbi tincidunt sollicitudin nunc, vel imperdiet nisi iaculis vel. Nam viverra lorem vel ligula varius, lacinia maximus metus porta. Sed vitae vehicula leo. Proin sed lectus in lorem laoreet iaculis sed ut eros. Pellentesque et rhoncus sapien. Nam fringilla mauris nec tellus vestibulum, vel convallis mauris sagittis. Vivamus et lacinia dui. Sed pharetra vitae lacus vel facilisis. Nullam et sollicitudin risus. Curabitur egestas bibendum neque, sed lacinia nisi cursus nec. Quisque sed diam congue, luctus magna eget, convallis lectus. Cras ut tellus imperdiet, blandit magna non, auctor felis. Suspendisse potenti. Nulla volutpat felis vitae ante blandit tempor. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nulla sagittis scelerisque magna quis ultrices";
|
|
3
3
|
export declare type StoryTemplate<Args> = {
|
|
4
|
-
(args: Args):
|
|
4
|
+
(args: Args): React.ReactNode;
|
|
5
5
|
args?: Partial<Args>;
|
|
6
6
|
parameters?: unknown;
|
|
7
7
|
};
|
|
@@ -22,7 +22,7 @@ const Container = styled(FlexBox) `
|
|
|
22
22
|
width: 100%;
|
|
23
23
|
height: 100%;
|
|
24
24
|
flex-direction: column;
|
|
25
|
-
background-color: ${(p) => p.theme.colors.
|
|
25
|
+
background-color: ${(p) => p.theme.colors.neutral.c00};
|
|
26
26
|
padding: ${(p) => p.theme.space[6]}px ${(p) => p.theme.space[12]}px;
|
|
27
27
|
`;
|
|
28
28
|
const Header = styled(FlexBox) `
|
|
@@ -50,7 +50,7 @@ const Overlay = styled.div `
|
|
|
50
50
|
width: 100vw;
|
|
51
51
|
height: 100vh;
|
|
52
52
|
z-index: 999;
|
|
53
|
-
background-color: ${(p) => p.theme.colors.
|
|
53
|
+
background-color: ${(p) => p.theme.colors.neutral.c100a07};
|
|
54
54
|
`;
|
|
55
55
|
const ScrollWrapper = styled.div `
|
|
56
56
|
overflow: scroll;
|
|
@@ -68,7 +68,7 @@ const Button = styled.button `
|
|
|
68
68
|
background: unset;
|
|
69
69
|
border: unset;
|
|
70
70
|
cursor: pointer;
|
|
71
|
-
color: ${(p) => p.theme.colors.
|
|
71
|
+
color: ${(p) => p.theme.colors.neutral.c100};
|
|
72
72
|
`;
|
|
73
73
|
const DrawerContent = ({ isOpen, title, children, big, onClose, setTransitionsEnabled = () => 0, onBack, hideNavigation = true, }) => {
|
|
74
74
|
const disableChildAnimations = useCallback(() => setTransitionsEnabled(false), [setTransitionsEnabled]);
|
|
@@ -33,7 +33,7 @@ const Wrapper = styled(Flex).attrs((p) => ({
|
|
|
33
33
|
zIndex: p.theme.zIndexes[8],
|
|
34
34
|
p: p.p !== undefined ? p.p : p.theme.space[10],
|
|
35
35
|
rowGap: 6,
|
|
36
|
-
backgroundColor: p.theme.colors.
|
|
36
|
+
backgroundColor: p.theme.colors.neutral.c00,
|
|
37
37
|
})) ``;
|
|
38
38
|
const Overlay = styled(Flex).attrs((p) => ({
|
|
39
39
|
justifyContent: "center",
|
|
@@ -44,7 +44,7 @@ const Overlay = styled(Flex).attrs((p) => ({
|
|
|
44
44
|
position: "fixed",
|
|
45
45
|
top: 0,
|
|
46
46
|
left: 0,
|
|
47
|
-
backgroundColor: p.theme.colors.
|
|
47
|
+
backgroundColor: p.theme.colors.neutral.c100a07,
|
|
48
48
|
})) ``;
|
|
49
49
|
const Header = baseStyled.section `
|
|
50
50
|
display: grid;
|
|
@@ -69,10 +69,10 @@ const PopinHeader = (_a) => {
|
|
|
69
69
|
var { children, onClose, onBack } = _a, props = __rest(_a, ["children", "onClose", "onBack"]);
|
|
70
70
|
return (React.createElement(Header, Object.assign({}, props),
|
|
71
71
|
React.createElement(Flex, null, onBack ? (React.createElement(IconContainer, { onClick: onBack },
|
|
72
|
-
React.createElement(ArrowLeftIcon, { size: ICON_SIZE, color: "
|
|
72
|
+
React.createElement(ArrowLeftIcon, { size: ICON_SIZE, color: "neutral.c100" }))) : null),
|
|
73
73
|
React.createElement(HeaderTitleContainer, null, children),
|
|
74
74
|
React.createElement(Flex, null, onClose ? (React.createElement(IconContainer, { onClick: onClose },
|
|
75
|
-
React.createElement(CloseIcon, { size: ICON_SIZE, color: "
|
|
75
|
+
React.createElement(CloseIcon, { size: ICON_SIZE, color: "neutral.c100" }))) : null)));
|
|
76
76
|
};
|
|
77
77
|
const Popin = (_a) => {
|
|
78
78
|
var { isOpen, children, width, height } = _a, props = __rest(_a, ["isOpen", "children", "width", "height"]);
|
|
@@ -11,13 +11,13 @@ 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.theme.colors.primary.c20,
|
|
15
15
|
})) ``;
|
|
16
16
|
const StyledCircleFront = styled(StyledCircle).attrs((props) => ({
|
|
17
|
-
stroke: props.theme.colors.
|
|
17
|
+
stroke: props.theme.colors.primary.c60,
|
|
18
18
|
})) ``;
|
|
19
19
|
const StyledCenteredText = styled(Text).attrs({
|
|
20
|
-
color: "
|
|
20
|
+
color: "primary.c80",
|
|
21
21
|
}) `
|
|
22
22
|
position: absolute;
|
|
23
23
|
top: 50%;
|
|
@@ -19,19 +19,19 @@ const StyledAlertContainer = styled.div `
|
|
|
19
19
|
switch (p.type) {
|
|
20
20
|
case "warning":
|
|
21
21
|
return css `
|
|
22
|
-
background: ${p.theme.colors.
|
|
23
|
-
color: ${p.theme.colors.
|
|
22
|
+
background: ${p.theme.colors.warning.c30};
|
|
23
|
+
color: ${p.theme.colors.warning.c100};
|
|
24
24
|
`;
|
|
25
25
|
case "error":
|
|
26
26
|
return css `
|
|
27
|
-
background: ${p.theme.colors.
|
|
28
|
-
color: ${p.theme.colors.
|
|
27
|
+
background: ${p.theme.colors.error.c30};
|
|
28
|
+
color: ${p.theme.colors.error.c100};
|
|
29
29
|
`;
|
|
30
30
|
case "info":
|
|
31
31
|
default:
|
|
32
32
|
return css `
|
|
33
|
-
background: ${p.theme.colors.
|
|
34
|
-
color: ${p.theme.colors.
|
|
33
|
+
background: ${p.theme.colors.primary.c20};
|
|
34
|
+
color: ${p.theme.colors.primary.c90};
|
|
35
35
|
`;
|
|
36
36
|
}
|
|
37
37
|
}}
|
|
@@ -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;
|