@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
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
## Reference
|
|
12
12
|
|
|
13
|
-
[
|
|
13
|
+
**[🔗 Storybook](https://ledger-live-ui-react.vercel.app/)**
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
@@ -22,7 +22,7 @@ npm i @ledgerhq/react-ui
|
|
|
22
22
|
|
|
23
23
|
### Peer dependencies
|
|
24
24
|
|
|
25
|
-
This library uses [styled components](https://styled-components.com/) heavily relies on it being installed separately (to avoid package duplication).
|
|
25
|
+
This library uses [styled components](https://styled-components.com/) heavily and relies on it being installed separately (to avoid package duplication).
|
|
26
26
|
|
|
27
27
|
```sh
|
|
28
28
|
npm i styled-components
|
|
@@ -59,7 +59,7 @@ import { Text, Flex, Logos } from "@ledgerhq/react-ui";
|
|
|
59
59
|
function Hello() {
|
|
60
60
|
return (
|
|
61
61
|
<Flex flexDirection="column" alignItems="center" rowGap={12} p={12}>
|
|
62
|
-
<Text color="
|
|
62
|
+
<Text color="neutral.c100">
|
|
63
63
|
<Logos.LedgerLiveRegular />
|
|
64
64
|
</Text>
|
|
65
65
|
<Text variant="h1">Hello, world!</Text>
|
|
@@ -172,7 +172,7 @@ function Root() {
|
|
|
172
172
|
return (
|
|
173
173
|
<StyleProvider fontsPath="assets" selectedPalette={palette}>
|
|
174
174
|
<Flex flexDirection="column" alignItems="center" rowGap={12} p={12}>
|
|
175
|
-
<Text color="
|
|
175
|
+
<Text color="neutral.c100">
|
|
176
176
|
<Logos.LedgerLiveRegular />
|
|
177
177
|
</Text>
|
|
178
178
|
<Text variant="h1">Hello, world!</Text>
|
|
@@ -72,7 +72,7 @@ const defaultValue = {
|
|
|
72
72
|
export default (_a) => {
|
|
73
73
|
var { data, color, variant = defaultValue.variant, valueKey = defaultValue.valueKey, timeOptions = defaultValue.timeOptions } = _a, chartProps = __rest(_a, ["data", "color", "variant", "valueKey", "timeOptions"]);
|
|
74
74
|
const theme = useTheme();
|
|
75
|
-
const config = useMemo(() => getConfig(variant, { gridColor: theme.colors.
|
|
75
|
+
const config = useMemo(() => getConfig(variant, { gridColor: theme.colors.neutral.c40, timeOptions }), [variant, theme.colors.neutral.c40, timeOptions]);
|
|
76
76
|
// inject default font configuration at mount
|
|
77
77
|
useEffect(() => {
|
|
78
78
|
defaults.font = fontConfig;
|
|
@@ -46,8 +46,8 @@ subtitleProps, }) {
|
|
|
46
46
|
return {
|
|
47
47
|
layout: layout || "auto",
|
|
48
48
|
render: ({ elt }) => (React.createElement(FlexBox, { flexDirection: "column" },
|
|
49
|
-
title && (React.createElement(Text, Object.assign({ fontWeight: "medium", variant: "body", textOverflow: "ellipsis", overflow: "hidden", color: "
|
|
50
|
-
subtitle && (React.createElement(Text, Object.assign({ fontWeight: "medium", variant: "paragraph", textOverflow: "ellipsis", overflow: "hidden", color: "
|
|
49
|
+
title && (React.createElement(Text, Object.assign({ fontWeight: "medium", variant: "body", textOverflow: "ellipsis", overflow: "hidden", color: "neutral.c100" }, ((titleProps && titleProps(elt)) || {})), title(elt))),
|
|
50
|
+
subtitle && (React.createElement(Text, Object.assign({ fontWeight: "medium", variant: "paragraph", textOverflow: "ellipsis", overflow: "hidden", color: "neutral.c80" }, ((subtitleProps && subtitleProps(elt)) || {})), subtitle(elt))))),
|
|
51
51
|
header,
|
|
52
52
|
};
|
|
53
53
|
}
|
|
@@ -4,7 +4,7 @@ import Text from "../asorted/Text";
|
|
|
4
4
|
import { IconColumn, TextColumn } from "./Columns";
|
|
5
5
|
function Header({ children }) {
|
|
6
6
|
const theme = useTheme();
|
|
7
|
-
return (React.createElement(Text, { fontWeight: "semiBold", variant: "paragraph", style: { borderBottom: `1px solid ${theme.colors.
|
|
7
|
+
return (React.createElement(Text, { fontWeight: "semiBold", variant: "paragraph", style: { borderBottom: `1px solid ${theme.colors.neutral.c40}` }, mx: -4, px: 4, pb: 8 }, children));
|
|
8
8
|
}
|
|
9
9
|
export const balance = {
|
|
10
10
|
data: [
|
|
@@ -59,14 +59,14 @@ export const balance = {
|
|
|
59
59
|
header: () => React.createElement(Header, null, "Evolution"),
|
|
60
60
|
subtitle: (elt) => (elt.evolution > 0 ? "+" : "") + elt.evolution,
|
|
61
61
|
subtitleProps: (elt) => ({
|
|
62
|
-
color: elt.evolution < 0 ? "
|
|
62
|
+
color: elt.evolution < 0 ? "error.c100" : "success.c100",
|
|
63
63
|
}),
|
|
64
64
|
}),
|
|
65
65
|
IconColumn({
|
|
66
66
|
header: () => React.createElement(Header, null, "\u00A0"),
|
|
67
67
|
props: (elt) => ({
|
|
68
68
|
name: "StarSolid",
|
|
69
|
-
color: elt.starred ? "
|
|
69
|
+
color: elt.starred ? "neutral.c100" : "neutral.c70",
|
|
70
70
|
}),
|
|
71
71
|
}),
|
|
72
72
|
],
|
|
@@ -145,7 +145,7 @@ export const accounts = {
|
|
|
145
145
|
IconColumn({
|
|
146
146
|
props: (elt) => ({
|
|
147
147
|
name: elt.synchronized ? "CircledCheck" : "Clock",
|
|
148
|
-
color: elt.synchronized ? "
|
|
148
|
+
color: elt.synchronized ? "success.c100" : "neutral.c80",
|
|
149
149
|
}),
|
|
150
150
|
}),
|
|
151
151
|
TextColumn({
|
|
@@ -160,13 +160,13 @@ export const accounts = {
|
|
|
160
160
|
layout: "1fr",
|
|
161
161
|
subtitle: (elt) => (elt.evolution > 0 ? "+" : "") + elt.evolution,
|
|
162
162
|
subtitleProps: (elt) => ({
|
|
163
|
-
color: elt.evolution < 0 ? "
|
|
163
|
+
color: elt.evolution < 0 ? "error.c100" : "success.c100",
|
|
164
164
|
}),
|
|
165
165
|
}),
|
|
166
166
|
IconColumn({
|
|
167
167
|
props: (elt) => ({
|
|
168
168
|
name: "StarSolid",
|
|
169
|
-
color: elt.starred ? "
|
|
169
|
+
color: elt.starred ? "neutral.c100" : "neutral.c70",
|
|
170
170
|
}),
|
|
171
171
|
}),
|
|
172
172
|
],
|
package/components/Tag/index.js
CHANGED
|
@@ -17,18 +17,18 @@ function getColor({ type, active, disabled }) {
|
|
|
17
17
|
switch (type) {
|
|
18
18
|
case "plain":
|
|
19
19
|
if (disabled)
|
|
20
|
-
return active ? "
|
|
21
|
-
return active ? "
|
|
20
|
+
return active ? "neutral.c00" : "neutral.c70";
|
|
21
|
+
return active ? "neutral.c00" : "primary.c90";
|
|
22
22
|
default:
|
|
23
|
-
return disabled ? "
|
|
23
|
+
return disabled ? "neutral.c70" : "primary.c90";
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
function getBgColor({ type, active, disabled }) {
|
|
27
27
|
switch (type) {
|
|
28
28
|
case "plain":
|
|
29
|
-
return active ? (disabled ? "
|
|
29
|
+
return active ? (disabled ? "neutral.c70" : "primary.c90") : undefined;
|
|
30
30
|
case "opacity":
|
|
31
|
-
return active ? (disabled ? "
|
|
31
|
+
return active ? (disabled ? "neutral.c30" : "primary.c20") : undefined;
|
|
32
32
|
default:
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
@@ -38,9 +38,9 @@ function getBorderColor({ type, active, disabled }) {
|
|
|
38
38
|
return;
|
|
39
39
|
switch (type) {
|
|
40
40
|
case "outlined":
|
|
41
|
-
return disabled ? "
|
|
41
|
+
return disabled ? "neutral.c70" : "primary.c90";
|
|
42
42
|
case "outlinedOpacity":
|
|
43
|
-
return disabled ? "
|
|
43
|
+
return disabled ? "neutral.c40" : "primary.c40";
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
function getPadding({ size }) {
|
|
@@ -2,11 +2,11 @@ import React from "react";
|
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
const Divider = styled.div `
|
|
4
4
|
display: block;
|
|
5
|
-
background: ${(p) => p.theme.colors.
|
|
5
|
+
background: ${(p) => p.theme.colors.neutral.c90};
|
|
6
6
|
height: 1px;
|
|
7
7
|
|
|
8
8
|
&[data-variant="light"] {
|
|
9
|
-
background: ${(p) => p.theme.colors.
|
|
9
|
+
background: ${(p) => p.theme.colors.neutral.c40};
|
|
10
10
|
}
|
|
11
11
|
`;
|
|
12
12
|
export default ({ variant = "default" }) => React.createElement(Divider, { "data-variant": variant });
|
|
@@ -7,4 +7,5 @@ export declare type Props = {
|
|
|
7
7
|
};
|
|
8
8
|
export declare const iconNames: string[];
|
|
9
9
|
declare const Icon: ({ name, size, color, weight, }: Props) => JSX.Element | null;
|
|
10
|
+
export declare const IconBox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
10
11
|
export default Icon;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as icons from "@ledgerhq/icons-ui/react";
|
|
2
2
|
import React from "react";
|
|
3
|
+
import styled from "styled-components";
|
|
3
4
|
export const iconNames = Array.from(Object.keys(icons).reduce((set, rawKey) => {
|
|
4
5
|
const key = rawKey
|
|
5
6
|
.replace(/(.+)(Regular|Light|UltraLight|Thin|Medium)+$/g, "$1")
|
|
@@ -17,4 +18,10 @@ const Icon = ({ name, size = 16, color = "currentColor", weight = "Medium", }) =
|
|
|
17
18
|
}
|
|
18
19
|
return null;
|
|
19
20
|
};
|
|
21
|
+
export const IconBox = styled.div `
|
|
22
|
+
padding: ${(p) => p.theme.space[6]}px;
|
|
23
|
+
border: 1px solid ${(p) => p.theme.colors.neutral.c40};
|
|
24
|
+
border-radius: ${(p) => p.theme.radii[2]}px;
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
`;
|
|
20
27
|
export default Icon;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default, iconNames } from "./Icon";
|
|
1
|
+
export { default, iconNames, IconBox } from "./Icon";
|
|
2
2
|
export type { Props } from "./Icon";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default, iconNames } from "./Icon";
|
|
1
|
+
export { default, iconNames, IconBox } from "./Icon";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseStyledProps } from "../../styled";
|
|
2
2
|
import { TextVariants } from "../../../styles/theme";
|
|
3
3
|
declare type FontFamilies = "Inter|ExtraLight" | "Inter|Light" | "Inter|Regular" | "Inter|Medium" | "Inter|SemiBold" | "Inter|Bold" | "Inter|ExtraBold" | "Alpha|Medium";
|
|
4
|
+
declare type WhiteSpace = "normal" | "nowrap" | "pre" | "pre-line" | "pre-wrap";
|
|
4
5
|
export interface TextProps extends BaseStyledProps {
|
|
5
6
|
fontFamily?: string;
|
|
6
7
|
ff?: FontFamilies;
|
|
@@ -12,6 +13,7 @@ export interface TextProps extends BaseStyledProps {
|
|
|
12
13
|
textTransform?: string;
|
|
13
14
|
textOverflow?: string;
|
|
14
15
|
uppercase?: boolean;
|
|
16
|
+
whiteSpace?: WhiteSpace;
|
|
15
17
|
}
|
|
16
18
|
declare const Text: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, TextProps, keyof TextProps>;
|
|
17
19
|
export default Text;
|
|
@@ -10,9 +10,10 @@ const uppercase = system({
|
|
|
10
10
|
});
|
|
11
11
|
const Text = baseStyled.span.attrs(({ variant = "body", fontSize, color }) => ({
|
|
12
12
|
fontSize: fontSize ? fontSize : variant,
|
|
13
|
-
color: color || "
|
|
13
|
+
color: color || "neutral.c100",
|
|
14
14
|
})) `
|
|
15
15
|
font-weight: 500;
|
|
16
|
+
white-space: ${(props) => { var _a; return (_a = props.whiteSpace) !== null && _a !== void 0 ? _a : "normal"; }};
|
|
16
17
|
${(p) => textVariantStyle[p.variant || "body"]}
|
|
17
18
|
${compose(uppercase, lineHeight, fontFamily, fontSize, textAlign, fontWeight, letterSpacing, system({
|
|
18
19
|
textOverflow: true,
|
|
@@ -10,13 +10,13 @@ const Wrapper = styled(Flex) `
|
|
|
10
10
|
padding: ${(p) => p.theme.space[8]}px ${(p) => p.theme.space[10]}px;
|
|
11
11
|
padding-right: 280px; // Nb gives air to not overlap the illustration
|
|
12
12
|
z-index: ${(p) => p.theme.zIndexes[8]};
|
|
13
|
-
background: url(${(p) => p.image}) no-repeat ${(p) => p.theme.colors.
|
|
13
|
+
background: url(${(p) => p.image}) no-repeat ${(p) => p.theme.colors.neutral.c100};
|
|
14
14
|
background-size: contain;
|
|
15
15
|
background-position: right 60px bottom;
|
|
16
16
|
`;
|
|
17
17
|
const Slide = ({ title, description, image, onClick }) => {
|
|
18
18
|
return (React.createElement(Wrapper, { key: "key", image: image, onClick: onClick },
|
|
19
|
-
React.createElement(Text, { variant: "tiny", color: "
|
|
20
|
-
React.createElement(Text, { variant: "h5", color: "
|
|
19
|
+
React.createElement(Text, { variant: "tiny", color: "neutral.c00", fontWeight: "regular" }, title),
|
|
20
|
+
React.createElement(Text, { variant: "h5", color: "neutral.c00", textTransform: "uppercase" }, description)));
|
|
21
21
|
};
|
|
22
22
|
export default Slide;
|
|
@@ -17,7 +17,7 @@ const CarouselWrapper = styled.div `
|
|
|
17
17
|
cursor: pointer;
|
|
18
18
|
position: relative;
|
|
19
19
|
flex: 1;
|
|
20
|
-
background: ${(p) => p.theme.colors.
|
|
20
|
+
background: ${(p) => p.theme.colors.neutral.c100};
|
|
21
21
|
`;
|
|
22
22
|
const Controllers = styled(Flex) `
|
|
23
23
|
position: absolute;
|
|
@@ -25,7 +25,7 @@ const Controllers = styled(Flex) `
|
|
|
25
25
|
right: ${(p) => p.theme.space[5]}px;
|
|
26
26
|
bottom: ${(p) => p.theme.space[4]}px;
|
|
27
27
|
column-gap: ${(p) => p.theme.space[4]}px;
|
|
28
|
-
color: ${(p) => p.theme.colors.
|
|
28
|
+
color: ${(p) => p.theme.colors.neutral.c00};
|
|
29
29
|
|
|
30
30
|
> div {
|
|
31
31
|
&:hover {
|
|
@@ -45,7 +45,7 @@ const Bullets = styled.div `
|
|
|
45
45
|
position: relative;
|
|
46
46
|
height: ${(p) => p.theme.space[1]}px;
|
|
47
47
|
width: ${(p) => p.theme.space[8]}px;
|
|
48
|
-
background: ${(p) => p.theme.colors.
|
|
48
|
+
background: ${(p) => p.theme.colors.neutral.c00};
|
|
49
49
|
opacity: 0.5;
|
|
50
50
|
&:hover {
|
|
51
51
|
opacity: 0.75;
|
|
@@ -71,7 +71,7 @@ const Close = styled.div `
|
|
|
71
71
|
position: absolute;
|
|
72
72
|
top: ${(p) => p.theme.space[7]}px;
|
|
73
73
|
right: ${(p) => p.theme.space[5]}px;
|
|
74
|
-
color: ${(p) => p.theme.colors.
|
|
74
|
+
color: ${(p) => p.theme.colors.neutral.c00};
|
|
75
75
|
&:hover {
|
|
76
76
|
opacity: 0.5;
|
|
77
77
|
}
|
|
@@ -124,10 +124,10 @@ const Carousel = ({ timeout = DEFAULT_TIMEOUT, queue, isDismissed, onDismiss, di
|
|
|
124
124
|
if (!(queue === null || queue === void 0 ? void 0 : queue.length) || isDismissed)
|
|
125
125
|
return null;
|
|
126
126
|
return (React.createElement(CarouselWrapper, { id: "carousel", onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave }, wantToDismiss ? (React.createElement(DismissWrapper, null,
|
|
127
|
-
React.createElement(Text, { color: "
|
|
127
|
+
React.createElement(Text, { color: "neutral.c00", fontWeight: "medium", variant: "paragraph" }, dismissText),
|
|
128
128
|
React.createElement(Flex, { columnGap: 5 },
|
|
129
|
-
React.createElement(Button, { color: "
|
|
130
|
-
React.createElement(Button, { outline: true, color: "
|
|
129
|
+
React.createElement(Button, { color: "neutral.c100", backgroundColor: "neutral.c00", onClick: onDismiss }, dismissConfirmText),
|
|
130
|
+
React.createElement(Button, { outline: true, color: "neutral.c00", backgroundColor: "neutral.c100", borderColor: "neutral.c00", onClick: onCancelDismiss }, dismissCancelText)))) : (React.createElement("div", null,
|
|
131
131
|
React.createElement(TransitionGroup, { component: null, childFactory: childFactory },
|
|
132
132
|
React.createElement(TransitionSlide, { key: index, direction: direction },
|
|
133
133
|
React.createElement(Slide, Object.assign({}, queue[index])))),
|
|
@@ -26,9 +26,9 @@ export interface ButtonProps extends BaseProps {
|
|
|
26
26
|
}
|
|
27
27
|
export declare const ButtonUnstyled: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
28
28
|
export declare const Base: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
29
|
-
|
|
29
|
+
fontFamily: string;
|
|
30
30
|
fontSize: number;
|
|
31
|
-
} & BaseProps, "
|
|
31
|
+
} & BaseProps, "fontFamily" | "fontSize">;
|
|
32
32
|
declare const Button: {
|
|
33
33
|
({ Icon, iconPosition, iconSize, children, onClick, ...props }: ButtonProps): React.ReactElement;
|
|
34
34
|
Unstyled: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -24,93 +24,93 @@ const IconContainer = styled.div `
|
|
|
24
24
|
const getVariantColors = (p) => ({
|
|
25
25
|
main: {
|
|
26
26
|
outline: `
|
|
27
|
-
border-color: ${p.theme.colors.
|
|
28
|
-
color: ${p.theme.colors.
|
|
29
|
-
background-color: ${p.theme.colors.
|
|
27
|
+
border-color: ${p.theme.colors.neutral.c100};
|
|
28
|
+
color: ${p.theme.colors.neutral.c100};
|
|
29
|
+
background-color: ${p.theme.colors.neutral.c00};
|
|
30
30
|
&:hover, &:focus {
|
|
31
|
-
background-color: ${p.theme.colors.
|
|
31
|
+
background-color: ${p.theme.colors.neutral.c20};
|
|
32
32
|
}
|
|
33
33
|
&:active {
|
|
34
|
-
background-color: ${p.theme.colors.
|
|
34
|
+
background-color: ${p.theme.colors.neutral.c30};
|
|
35
35
|
}
|
|
36
36
|
`,
|
|
37
37
|
filled: `
|
|
38
|
-
color: ${p.theme.colors.
|
|
39
|
-
background-color: ${p.theme.colors.
|
|
38
|
+
color: ${p.theme.colors.neutral.c00};
|
|
39
|
+
background-color: ${p.theme.colors.neutral.c100};
|
|
40
40
|
&:hover, &:focus {
|
|
41
|
-
background-color: ${p.theme.colors.
|
|
41
|
+
background-color: ${p.theme.colors.neutral.c90};
|
|
42
42
|
}
|
|
43
43
|
`,
|
|
44
44
|
},
|
|
45
45
|
shade: `
|
|
46
|
-
border-color: ${p.theme.colors.
|
|
47
|
-
color: ${p.theme.colors.
|
|
48
|
-
background-color: ${p.theme.colors.
|
|
46
|
+
border-color: ${p.theme.colors.neutral.c40};
|
|
47
|
+
color: ${p.theme.colors.neutral.c100};
|
|
48
|
+
background-color: ${p.theme.colors.neutral.c00};
|
|
49
49
|
&:focus {
|
|
50
|
-
border-color: ${p.theme.colors.
|
|
50
|
+
border-color: ${p.theme.colors.primary.c80};
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
&:hover, &:focus {
|
|
54
|
-
background-color: ${p.theme.colors.
|
|
54
|
+
background-color: ${p.theme.colors.neutral.c20};
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
&:active {
|
|
58
|
-
background-color: ${p.theme.colors.
|
|
58
|
+
background-color: ${p.theme.colors.neutral.c30};
|
|
59
59
|
}
|
|
60
60
|
`,
|
|
61
61
|
error: {
|
|
62
62
|
outline: `
|
|
63
|
-
border-color: ${p.theme.colors.
|
|
64
|
-
color: ${p.theme.colors.
|
|
65
|
-
background-color: ${p.theme.colors.
|
|
63
|
+
border-color: ${p.theme.colors.error.c100};
|
|
64
|
+
color: ${p.theme.colors.error.c100};
|
|
65
|
+
background-color: ${p.theme.colors.neutral.c00};
|
|
66
66
|
&:hover {
|
|
67
|
-
background-color: ${p.theme.colors.
|
|
67
|
+
background-color: ${p.theme.colors.error.c10};
|
|
68
68
|
}
|
|
69
69
|
&:active {
|
|
70
|
-
background-color: ${p.theme.colors.
|
|
70
|
+
background-color: ${p.theme.colors.error.c30};
|
|
71
71
|
}
|
|
72
72
|
`,
|
|
73
73
|
filled: `
|
|
74
|
-
color: ${p.theme.colors.
|
|
75
|
-
background-color: ${p.theme.colors.
|
|
74
|
+
color: ${p.theme.colors.neutral.c00};
|
|
75
|
+
background-color: ${p.theme.colors.error.c100};
|
|
76
76
|
&:hover {
|
|
77
|
-
background-color: ${p.theme.colors.
|
|
77
|
+
background-color: ${p.theme.colors.error.c80};
|
|
78
78
|
}
|
|
79
79
|
`,
|
|
80
80
|
},
|
|
81
81
|
color: {
|
|
82
82
|
outline: `
|
|
83
|
-
border-color: ${p.theme.colors.
|
|
84
|
-
color: ${p.theme.colors.
|
|
85
|
-
background-color: ${p.theme.colors.
|
|
83
|
+
border-color: ${p.theme.colors.primary.c80};
|
|
84
|
+
color: ${p.theme.colors.primary.c80};
|
|
85
|
+
background-color: ${p.theme.colors.neutral.c00};
|
|
86
86
|
&:hover {
|
|
87
|
-
background-color: ${p.theme.colors.
|
|
87
|
+
background-color: ${p.theme.colors.primary.c10};
|
|
88
88
|
}
|
|
89
89
|
&:active {
|
|
90
|
-
background-color: ${p.theme.colors.
|
|
90
|
+
background-color: ${p.theme.colors.primary.c20};
|
|
91
91
|
}
|
|
92
92
|
`,
|
|
93
93
|
filled: `
|
|
94
|
-
color: ${p.theme.colors.
|
|
95
|
-
background-color: ${p.theme.colors.
|
|
94
|
+
color: ${p.theme.colors.neutral.c00};
|
|
95
|
+
background-color: ${p.theme.colors.primary.c80};
|
|
96
96
|
&:hover {
|
|
97
|
-
background-color: ${p.theme.colors.
|
|
97
|
+
background-color: ${p.theme.colors.primary.c70};
|
|
98
98
|
}
|
|
99
99
|
`,
|
|
100
100
|
},
|
|
101
101
|
disabled: {
|
|
102
102
|
outline: `
|
|
103
|
-
border-color: ${p.theme.colors.
|
|
104
|
-
color: ${p.theme.colors.
|
|
105
|
-
background-color: ${p.theme.colors.
|
|
103
|
+
border-color: ${p.theme.colors.neutral.c50};
|
|
104
|
+
color: ${p.theme.colors.neutral.c50};
|
|
105
|
+
background-color: ${p.theme.colors.neutral.c00};
|
|
106
106
|
`,
|
|
107
107
|
filled: `
|
|
108
|
-
color: ${p.theme.colors.
|
|
109
|
-
background-color: ${p.theme.colors.
|
|
108
|
+
color: ${p.theme.colors.neutral.c50};
|
|
109
|
+
background-color: ${p.theme.colors.neutral.c30};
|
|
110
110
|
`,
|
|
111
111
|
},
|
|
112
112
|
default: `
|
|
113
|
-
color: ${p.theme.colors.
|
|
113
|
+
color: ${p.theme.colors.neutral.c100};
|
|
114
114
|
background-color: transparent;
|
|
115
115
|
&:hover {
|
|
116
116
|
text-decoration: underline;
|
|
@@ -128,7 +128,7 @@ export const ButtonUnstyled = styled.button `
|
|
|
128
128
|
export const Base = baseStyled.button.attrs((p) => {
|
|
129
129
|
var _a;
|
|
130
130
|
return ({
|
|
131
|
-
|
|
131
|
+
fontFamily: "Inter",
|
|
132
132
|
fontSize: (_a = p.fontSize) !== null && _a !== void 0 ? _a : 4,
|
|
133
133
|
});
|
|
134
134
|
}) `
|
|
@@ -137,6 +137,7 @@ export const Base = baseStyled.button.attrs((p) => {
|
|
|
137
137
|
border-radius: ${(p) => p.theme.space[13]}px;
|
|
138
138
|
border-style: solid;
|
|
139
139
|
border-width: ${(p) => (p.outline || p.variant === "shade" ? 1 : 0)}px;
|
|
140
|
+
font-weight: 600;
|
|
140
141
|
${compose(fontFamily, fontSize, border)};
|
|
141
142
|
height: ${(p) => p.theme.space[13]}px;
|
|
142
143
|
line-height: ${(p) => p.theme.fontSizes[p.fontSize]}px;
|
|
@@ -152,7 +153,7 @@ export const Base = baseStyled.button.attrs((p) => {
|
|
|
152
153
|
position: relative;
|
|
153
154
|
cursor: ${(p) => (p.disabled ? "default" : "pointer")};
|
|
154
155
|
&:active {
|
|
155
|
-
box-shadow: 0 0 0 4px ${(p) => p.theme.colors.
|
|
156
|
+
box-shadow: 0 0 0 4px ${(p) => p.theme.colors.primary.c60};
|
|
156
157
|
}
|
|
157
158
|
|
|
158
159
|
${(p) => {
|
|
@@ -18,30 +18,30 @@ 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
28
|
!p.warning &&
|
|
29
29
|
css `
|
|
30
|
-
border: 1px solid ${p.theme.colors.
|
|
31
|
-
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)};
|
|
32
32
|
`};
|
|
33
33
|
|
|
34
34
|
${(p) => p.error &&
|
|
35
35
|
!p.disabled &&
|
|
36
36
|
css `
|
|
37
|
-
border: 1px solid ${p.theme.colors.
|
|
37
|
+
border: 1px solid ${p.theme.colors.error.c100};
|
|
38
38
|
`};
|
|
39
39
|
|
|
40
40
|
${(p) => !p.error &&
|
|
41
41
|
p.warning &&
|
|
42
42
|
!p.disabled &&
|
|
43
43
|
css `
|
|
44
|
-
border: 1px solid ${p.theme.colors.
|
|
44
|
+
border: 1px solid ${p.theme.colors.warning.c80};
|
|
45
45
|
`};
|
|
46
46
|
|
|
47
47
|
${(p) => !p.error &&
|
|
@@ -49,14 +49,14 @@ export const InputContainer = styled.div `
|
|
|
49
49
|
!p.disabled &&
|
|
50
50
|
css `
|
|
51
51
|
&:hover {
|
|
52
|
-
border: ${!p.disabled && `1px solid ${p.theme.colors.
|
|
52
|
+
border: ${!p.disabled && `1px solid ${p.theme.colors.primary.c80}`};
|
|
53
53
|
}
|
|
54
54
|
`};
|
|
55
55
|
|
|
56
56
|
${(p) => p.disabled &&
|
|
57
57
|
css `
|
|
58
|
-
color: ${p.theme.colors.
|
|
59
|
-
background: ${(p) => p.theme.colors.
|
|
58
|
+
color: ${p.theme.colors.neutral.c60};
|
|
59
|
+
background: ${(p) => p.theme.colors.neutral.c20};
|
|
60
60
|
`};
|
|
61
61
|
`;
|
|
62
62
|
export const BaseInput = styled.input.attrs({
|
|
@@ -66,7 +66,7 @@ export const BaseInput = styled.input.attrs({
|
|
|
66
66
|
height: 100%;
|
|
67
67
|
width: 100%;
|
|
68
68
|
border: 0;
|
|
69
|
-
caret-color: ${(p) => p.error ? p.theme.colors.
|
|
69
|
+
caret-color: ${(p) => (p.error ? p.theme.colors.error.c100 : p.theme.colors.primary.c80)};
|
|
70
70
|
background: none;
|
|
71
71
|
outline: none;
|
|
72
72
|
cursor: ${(p) => (p.disabled ? "not-allowed" : "text")};
|
|
@@ -76,7 +76,7 @@ export const BaseInput = styled.input.attrs({
|
|
|
76
76
|
padding-left: 20px;
|
|
77
77
|
padding-right: 20px;
|
|
78
78
|
&::placeholder {
|
|
79
|
-
color: ${(p) => p.disabled ? p.theme.colors.
|
|
79
|
+
color: ${(p) => (p.disabled ? p.theme.colors.neutral.c50 : p.theme.colors.neutral.c70)};
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
/* Hide type=number arrow for Chrome, Safari, Edge, Opera */
|
|
@@ -94,11 +94,11 @@ export const BaseInput = styled.input.attrs({
|
|
|
94
94
|
${typography}
|
|
95
95
|
`;
|
|
96
96
|
export const InputErrorContainer = styled(Text) `
|
|
97
|
-
color: ${(p) => p.theme.colors.
|
|
97
|
+
color: ${(p) => p.theme.colors.error.c100};
|
|
98
98
|
margin-left: 12px;
|
|
99
99
|
`;
|
|
100
100
|
export const InputWarningContainer = styled(Text) `
|
|
101
|
-
color: ${(p) => p.theme.colors.
|
|
101
|
+
color: ${(p) => p.theme.colors.warning.c80};
|
|
102
102
|
margin-left: 12px;
|
|
103
103
|
`;
|
|
104
104
|
export const InputRenderLeftContainer = styled(FlexBox).attrs(() => ({
|
|
@@ -17,7 +17,7 @@ const Input = styled.input `
|
|
|
17
17
|
width: ${(p) => p.theme.space[7]}px;
|
|
18
18
|
height: ${(p) => p.theme.space[7]}px;
|
|
19
19
|
appearance: none;
|
|
20
|
-
border: 1px solid ${(props) => props.theme.colors.
|
|
20
|
+
border: 1px solid ${(props) => props.theme.colors.neutral.c90};
|
|
21
21
|
box-shadow: none;
|
|
22
22
|
|
|
23
23
|
&:checked {
|
|
@@ -42,7 +42,7 @@ const Input = styled.input `
|
|
|
42
42
|
}
|
|
43
43
|
`;
|
|
44
44
|
const Label = styled(Text).attrs({ type: "body", fontWeight: "500" }) `
|
|
45
|
-
color: ${(props) => props.theme.colors.
|
|
45
|
+
color: ${(props) => props.theme.colors.neutral.c80};
|
|
46
46
|
|
|
47
47
|
/* Version when the input is checked */
|
|
48
48
|
${Input}:checked + & {
|
|
@@ -55,7 +55,7 @@ const Label = styled(Text).attrs({ type: "body", fontWeight: "500" }) `
|
|
|
55
55
|
`;
|
|
56
56
|
const Container = styled.div `
|
|
57
57
|
--ll-checkbox-color: unset;
|
|
58
|
-
color: var(--ll-checkbox-color, ${(props) => props.theme.colors.
|
|
58
|
+
color: var(--ll-checkbox-color, ${(props) => props.theme.colors.primary.c90});
|
|
59
59
|
|
|
60
60
|
display: inline-flex;
|
|
61
61
|
column-gap: ${(p) => p.theme.space[5]}px;
|
|
@@ -63,19 +63,19 @@ const Container = styled.div `
|
|
|
63
63
|
cursor: pointer;
|
|
64
64
|
|
|
65
65
|
&[data-variant="default"] {
|
|
66
|
-
--ll-checkbox-color: ${(props) => props.theme.colors.
|
|
66
|
+
--ll-checkbox-color: ${(props) => props.theme.colors.primary.c90};
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
&[data-variant="success"] {
|
|
70
|
-
--ll-checkbox-color: ${(props) => props.theme.colors.
|
|
70
|
+
--ll-checkbox-color: ${(props) => props.theme.colors.success.c100};
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
&[data-variant="error"] {
|
|
74
|
-
--ll-checkbox-color: ${(props) => props.theme.colors.
|
|
74
|
+
--ll-checkbox-color: ${(props) => props.theme.colors.error.c100};
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
&[data-disabled="true"] {
|
|
78
|
-
--ll-checkbox-color: ${(props) => props.theme.colors.
|
|
78
|
+
--ll-checkbox-color: ${(props) => props.theme.colors.neutral.c80};
|
|
79
79
|
cursor: unset;
|
|
80
80
|
}
|
|
81
81
|
`;
|
|
@@ -20,7 +20,7 @@ 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, { fontWeight: "semiBold", variant: "paragraph", color: "
|
|
23
|
+
React.createElement(Text, { fontWeight: "semiBold", variant: "paragraph", color: "neutral.c80", mr: 2 }, label),
|
|
24
24
|
children));
|
|
25
25
|
}
|
|
26
26
|
function DropdownValueContainer(props) {
|
|
@@ -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,10 +14,10 @@ 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) {
|