@ledgerhq/react-ui 0.3.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/assets/logos/LedgerLiveAltRegular.d.ts +0 -1
- package/assets/logos/LedgerLiveRegular.d.ts +0 -1
- package/components/Chart/index.d.ts +0 -1
- package/components/Chart/index.js +1 -1
- package/components/Table/Columns.d.ts +60 -11
- package/components/Table/Columns.js +8 -18
- package/components/Table/index.d.ts +44 -12
- package/components/Table/index.js +36 -16
- package/components/Table/stories.helper.js +19 -18
- package/components/Tag/index.js +7 -7
- package/components/animations/GlitchText/index.d.ts +0 -1
- package/components/asorted/Divider/index.d.ts +0 -1
- package/components/asorted/Divider/index.js +2 -2
- package/components/asorted/Icon/BoxedIcon.d.ts +48 -0
- package/components/asorted/Icon/BoxedIcon.js +58 -0
- package/components/asorted/Icon/Icon.d.ts +0 -1
- package/components/asorted/Icon/index.d.ts +2 -0
- package/components/asorted/Icon/index.js +2 -0
- package/components/asorted/Text/index.d.ts +2 -0
- package/components/asorted/Text/index.js +2 -1
- package/components/asorted/index.d.ts +1 -1
- package/components/asorted/index.js +1 -1
- package/components/cards/Carousel/Slide.js +3 -3
- package/components/cards/Carousel/index.js +7 -7
- package/components/cta/Button/index.d.ts +12 -10
- package/components/cta/Button/index.js +52 -46
- package/components/cta/Link/index.d.ts +53 -4
- package/components/cta/Link/index.js +15 -11
- package/components/cta/Toggle/index.d.ts +0 -1
- package/components/form/BaseInput/index.d.ts +8 -14
- package/components/form/BaseInput/index.js +13 -13
- package/components/form/Checkbox/Checkbox.js +7 -7
- package/components/form/Dropdown/index.d.ts +3 -3
- package/components/form/Dropdown/index.js +4 -3
- package/components/form/LegendInput/index.d.ts +26 -2
- package/components/form/LegendInput/index.js +5 -4
- package/components/form/NumberInput/index.d.ts +25 -3
- package/components/form/NumberInput/index.js +7 -6
- package/components/form/QrCodeInput/index.d.ts +25 -3
- package/components/form/QrCodeInput/index.js +7 -6
- package/components/form/QuantityInput/index.d.ts +26 -4
- package/components/form/QuantityInput/index.js +9 -8
- package/components/form/Radio/RadioElement.d.ts +3 -2
- package/components/form/Radio/RadioElement.js +84 -15
- package/components/form/Radio/RadioListElement.js +7 -8
- package/components/form/Radio/index.d.ts +1 -1
- package/components/form/SearchInput/index.d.ts +24 -2
- package/components/form/SearchInput/index.js +4 -3
- package/components/form/SelectInput/Control.d.ts +4 -10
- package/components/form/SelectInput/Control.js +5 -8
- package/components/form/SelectInput/DropdownIndicator.d.ts +3 -10
- package/components/form/SelectInput/DropdownIndicator.js +1 -1
- package/components/form/SelectInput/IndicatorsContainer.d.ts +2 -6
- package/components/form/SelectInput/IndicatorsContainer.js +1 -1
- package/components/form/SelectInput/MenuList.d.ts +3 -10
- package/components/form/SelectInput/MenuList.js +1 -1
- package/components/form/SelectInput/Option.d.ts +6 -18
- package/components/form/SelectInput/Option.js +11 -11
- package/components/form/SelectInput/ValueContainer.d.ts +5 -14
- package/components/form/SelectInput/ValueContainer.js +2 -2
- package/components/form/SelectInput/VirtualMenuList.d.ts +2 -5
- package/components/form/SelectInput/VirtualMenuList.js +2 -1
- package/components/form/SelectInput/index.d.ts +7 -15
- package/components/form/SelectInput/index.js +14 -6
- package/components/form/SplitInput/index.js +5 -5
- package/components/form/Switch/Switch.js +8 -8
- package/components/helpers.d.ts +2 -2
- package/components/layout/Box/index.d.ts +1 -4
- package/components/layout/Drawer/index.d.ts +3 -1
- package/components/layout/Drawer/index.js +32 -15
- package/components/layout/Flex/index.d.ts +2 -5
- package/components/layout/Popin/index.d.ts +5 -13
- package/components/layout/Popin/index.js +13 -18
- package/components/layout/Side/index.d.ts +0 -1
- package/components/loaders/InfiniteLoader/index.d.ts +8 -7
- package/components/loaders/InfiniteLoader/index.js +35 -9
- package/components/loaders/ProgressLoader/index.d.ts +22 -2
- package/components/loaders/ProgressLoader/index.js +10 -12
- package/components/message/Alert/index.d.ts +31 -3
- package/components/message/Alert/index.js +30 -23
- package/components/message/Log/index.js +1 -1
- package/components/message/Notification/Badge.js +2 -2
- package/components/message/Notification/index.js +4 -6
- package/components/message/StatusNotification/index.d.ts +11 -0
- package/components/message/StatusNotification/index.js +33 -0
- package/components/message/Tip/index.d.ts +0 -1
- package/components/message/Tip/index.js +7 -7
- package/components/message/Tooltip/index.d.ts +0 -1
- package/components/message/Tooltip/index.js +1 -1
- package/components/message/Tooltip/styles.js +3 -3
- package/components/message/index.d.ts +2 -0
- package/components/message/index.js +2 -0
- package/components/navigation/Aside/index.d.ts +2 -5
- package/components/navigation/Breadcrumb/index.js +6 -6
- package/components/navigation/progress/ProgressBar/Onboarding.d.ts +0 -1
- package/components/navigation/progress/ProgressBar/Onboarding.js +6 -6
- package/components/navigation/progress/Stepper/index.js +9 -9
- package/components/navigation/sideBar/Item/Item.d.ts +0 -1
- package/components/navigation/sideBar/Item/Item.js +10 -10
- package/components/navigation/sideBar/Logo/Logo.d.ts +0 -1
- package/components/navigation/sideBar/SideBar/SideBar.d.ts +0 -1
- package/components/navigation/sideBar/SideBar/SideBar.js +3 -3
- package/components/navigation/sideBar/Toggle/Toggle.d.ts +0 -1
- package/components/navigation/sideBar/Toggle/Toggle.js +2 -2
- package/components/styled.d.ts +8 -5
- package/components/styled.js +2 -2
- package/components/tabs/Bar/index.js +3 -3
- package/components/tabs/Chip/index.d.ts +13 -0
- package/components/tabs/Chip/index.js +21 -0
- package/components/tabs/Pill/index.js +6 -6
- package/components/tabs/Tabs/index.js +7 -7
- package/components/tabs/index.d.ts +1 -0
- package/components/tabs/index.js +1 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +5 -6
- package/styles/InvertTheme.js +1 -1
- package/styles/StyleProvider.js +1 -1
- package/styles/global.js +15 -36
- package/styles/index.d.ts +1 -1
- package/styles/index.js +1 -1
- package/styles/theme.d.ts +5 -2
- package/styles/theme.js +13 -15
- package/components/loaders/InfiniteLoader/image.d.ts +0 -2
- package/components/loaders/InfiniteLoader/image.js +0 -1
- package/styles/reset.d.ts +0 -2
- package/styles/reset.js +0 -62
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { default as Alert } from "./Alert";
|
|
2
2
|
export { default as Log } from "./Log";
|
|
3
3
|
export { default as Notification } from "./Notification";
|
|
4
|
+
export { default as Badge } from "./Notification/Badge";
|
|
4
5
|
export { default as Tooltip } from "./Tooltip";
|
|
5
6
|
export { default as Tip } from "./Tip";
|
|
7
|
+
export { default as StatusNotification } from "./StatusNotification";
|
|
@@ -6,13 +6,10 @@ export declare type Props = React.PropsWithChildren<{
|
|
|
6
6
|
}> & React.ComponentProps<typeof Wrapper>;
|
|
7
7
|
interface ExtraWrapperProps extends ColorProps, LayoutProps, TypographyProps {
|
|
8
8
|
}
|
|
9
|
-
declare const Wrapper: 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>>> & ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").OverflowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & {
|
|
9
|
+
declare const Wrapper: 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>>> & ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").BorderProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").OverflowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & {
|
|
10
10
|
columnGap?: string | number | undefined;
|
|
11
11
|
rowGap?: string | number | undefined;
|
|
12
12
|
color?: string | undefined;
|
|
13
|
-
|
|
14
|
-
position?: string | undefined;
|
|
15
|
-
maxHeight?: number | undefined;
|
|
16
|
-
} & ExtraWrapperProps, "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">;
|
|
13
|
+
} & ExtraWrapperProps, "overflow" | "p" | "color" | "size" | "rowGap" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "top" | "verticalAlign" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "margin" | "padding" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "bg" | "borderX" | "borderY">;
|
|
17
14
|
export default function Aside({ header, footer, children, ...props }: Props): JSX.Element;
|
|
18
15
|
export {};
|
|
@@ -7,14 +7,14 @@ import * as ControlModule from "../../form/SelectInput/Control";
|
|
|
7
7
|
const Link = styled(Text).attrs({
|
|
8
8
|
ff: "Inter|SemiBold",
|
|
9
9
|
fontSize: 3,
|
|
10
|
-
color: "
|
|
10
|
+
color: "neutral.c80",
|
|
11
11
|
tabIndex: 0,
|
|
12
12
|
}) `
|
|
13
13
|
cursor: pointer;
|
|
14
14
|
:hover,
|
|
15
15
|
:active,
|
|
16
16
|
:focus {
|
|
17
|
-
color: ${(p) => p.theme.colors.
|
|
17
|
+
color: ${(p) => p.theme.colors.neutral.c100};
|
|
18
18
|
text-decoration: underline;
|
|
19
19
|
}
|
|
20
20
|
`;
|
|
@@ -26,11 +26,11 @@ export default memo(function Breadcrumb({ segments, onChange }) {
|
|
|
26
26
|
const [contents] = segments.reduce(([renderArray, valuesArray], segment, index) => {
|
|
27
27
|
const values = [...valuesArray];
|
|
28
28
|
renderArray.push(React.createElement(React.Fragment, null,
|
|
29
|
-
index > 0 ? (React.createElement(Text, { fontWeight: "semiBold", color: "
|
|
29
|
+
index > 0 ? (React.createElement(Text, { fontWeight: "semiBold", color: "neutral.c40", variant: "paragraph" }, "/")) : null,
|
|
30
30
|
isMultiSegment(segment) ? (React.createElement(Dropdown, { label: "", options: segment.options, value: segment.value, onChange: (elt) => elt && onChange([...values, elt.value]), styles: {
|
|
31
|
-
control: (provided, state) => (Object.assign(Object.assign({}, ControlModule.getStyles()(provided, state)), { cursor: "pointer" })),
|
|
32
|
-
singleValue: (provided) => (Object.assign(Object.assign({}, provided), { margin: 0, top: undefined, position: undefined, overflow: undefined, maxWidth: undefined, transform: undefined, color: theme.colors.
|
|
33
|
-
color: theme.colors.
|
|
31
|
+
control: (provided, state) => (Object.assign(Object.assign({}, ControlModule.getStyles(theme)(provided, state)), { cursor: "pointer" })),
|
|
32
|
+
singleValue: (provided) => (Object.assign(Object.assign({}, provided), { margin: 0, top: undefined, position: undefined, overflow: undefined, maxWidth: undefined, transform: undefined, color: theme.colors.neutral.c80, ":hover": {
|
|
33
|
+
color: theme.colors.neutral.c100,
|
|
34
34
|
textDecoration: "underline",
|
|
35
35
|
} })),
|
|
36
36
|
} })) : (React.createElement(Link, { onKeyDown: (event) => ["Enter", " "].includes(event.key) && onChange([...values, segment.value]), onClick: () => onChange([...values, segment.value]) }, segment.label))));
|
|
@@ -15,12 +15,12 @@ const Bar = styled.div `
|
|
|
15
15
|
border-top-${(p) => (p.on ? "right" : "left")}-radius: 0;
|
|
16
16
|
border-bottom-${(p) => (p.on ? "right" : "left")}-radius: 0;
|
|
17
17
|
flex: ${(p) => p.fill};
|
|
18
|
-
background: ${(p) => p.on ? p.theme.colors.
|
|
18
|
+
background: ${(p) => (p.on ? p.theme.colors.neutral.c100 : p.theme.colors.neutral.c40)};
|
|
19
19
|
`;
|
|
20
20
|
const Handler = styled.div `
|
|
21
21
|
transition: all 600ms linear;
|
|
22
22
|
padding: 4px;
|
|
23
|
-
background: ${(p) => p.theme.colors.
|
|
23
|
+
background: ${(p) => p.theme.colors.neutral.c100};
|
|
24
24
|
border-radius: ${(p) => `${p.theme.radii[1]}px`};
|
|
25
25
|
|
|
26
26
|
display: flex;
|
|
@@ -35,8 +35,8 @@ const Handler = styled.div `
|
|
|
35
35
|
width: 16px;
|
|
36
36
|
justify-content: center;
|
|
37
37
|
align-items: center;
|
|
38
|
-
color: ${(p) => p.theme.colors.
|
|
39
|
-
background: ${(p) => p.theme.colors.
|
|
38
|
+
color: ${(p) => p.theme.colors.neutral.c100};
|
|
39
|
+
background: ${(p) => p.theme.colors.neutral.c00};
|
|
40
40
|
}
|
|
41
41
|
`;
|
|
42
42
|
const Onboarding = ({ steps, currentIndex }) => {
|
|
@@ -45,8 +45,8 @@ const Onboarding = ({ steps, currentIndex }) => {
|
|
|
45
45
|
return (React.createElement(Container, null,
|
|
46
46
|
React.createElement(Bar, { on: true, fill: fill }),
|
|
47
47
|
React.createElement(Handler, { key: currentStep.key },
|
|
48
|
-
React.createElement(Text, { className: "index", color: "
|
|
49
|
-
React.createElement(Text, { color: "
|
|
48
|
+
React.createElement(Text, { className: "index", color: "neutral.c00", fontWeight: "medium", variant: "micro" }, currentIndex + 1),
|
|
49
|
+
React.createElement(Text, { color: "neutral.c00", fontWeight: "medium", textTransform: "uppercase", variant: "micro" }, currentStep.label)),
|
|
50
50
|
React.createElement(Bar, { fill: 100 - Number(fill) })));
|
|
51
51
|
};
|
|
52
52
|
export default Onboarding;
|
|
@@ -24,7 +24,7 @@ export const Item = {
|
|
|
24
24
|
${space}
|
|
25
25
|
`,
|
|
26
26
|
Current: styled.div.attrs({
|
|
27
|
-
backgroundColor: "
|
|
27
|
+
backgroundColor: "primary.c90",
|
|
28
28
|
}) `
|
|
29
29
|
width: 6px;
|
|
30
30
|
height: 6px;
|
|
@@ -32,7 +32,7 @@ export const Item = {
|
|
|
32
32
|
${color}
|
|
33
33
|
`,
|
|
34
34
|
Pending: styled.div.attrs({
|
|
35
|
-
backgroundColor: "
|
|
35
|
+
backgroundColor: "neutral.c70",
|
|
36
36
|
}) `
|
|
37
37
|
width: ${(p) => p.theme.space[2]}px;
|
|
38
38
|
height: ${(p) => p.theme.space[2]}px;
|
|
@@ -45,19 +45,19 @@ export const Item = {
|
|
|
45
45
|
const StepText = styled(Text) `
|
|
46
46
|
color: ${(p) => {
|
|
47
47
|
if (p.errored) {
|
|
48
|
-
return p.theme.colors.
|
|
48
|
+
return p.theme.colors.error.c100;
|
|
49
49
|
}
|
|
50
50
|
if (p.inactive) {
|
|
51
|
-
return p.theme.colors.
|
|
51
|
+
return p.theme.colors.neutral.c70;
|
|
52
52
|
}
|
|
53
|
-
return p.theme.colors.
|
|
53
|
+
return p.theme.colors.neutral.c100;
|
|
54
54
|
}};
|
|
55
55
|
`;
|
|
56
56
|
const BaseSeparator = styled.div `
|
|
57
57
|
flex: 1;
|
|
58
58
|
position: relative;
|
|
59
59
|
overflow-x: hidden;
|
|
60
|
-
background-color: ${(p) => p.theme.colors.
|
|
60
|
+
background-color: ${(p) => p.theme.colors.neutral.c40};
|
|
61
61
|
height: 1px;
|
|
62
62
|
top: ${(p) => p.theme.space[5]}px;
|
|
63
63
|
`;
|
|
@@ -68,11 +68,11 @@ const Separator = {
|
|
|
68
68
|
const stepContentsByState = {
|
|
69
69
|
pending: (React.createElement(Item.Container, null,
|
|
70
70
|
React.createElement(Item.Pending, null))),
|
|
71
|
-
current: (React.createElement(Item.Container, { backgroundColor: "
|
|
71
|
+
current: (React.createElement(Item.Container, { backgroundColor: "primary.c20", borderRadius: "8px" },
|
|
72
72
|
React.createElement(Item.Current, null))),
|
|
73
|
-
completed: (React.createElement(Item.Container, { color: "
|
|
73
|
+
completed: (React.createElement(Item.Container, { color: "primary.c90", backgroundColor: "primary.c20", borderRadius: "8px" },
|
|
74
74
|
React.createElement(Item.Completed, null))),
|
|
75
|
-
errored: (React.createElement(Item.Container, { color: "
|
|
75
|
+
errored: (React.createElement(Item.Container, { color: "error.c100", backgroundColor: "warning.c30", borderRadius: "8px" },
|
|
76
76
|
React.createElement(Item.Errored, null))),
|
|
77
77
|
};
|
|
78
78
|
export const Step = memo(function Step({ state, label, hideLeftSeparator, nextState, }) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const ItemLabel: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, import("../../../asorted/Text").TextProps, keyof import("../../../asorted/Text").TextProps>;
|
|
3
2
|
export declare type ItemType = {
|
|
4
3
|
label: string;
|
|
@@ -6,8 +6,8 @@ import TransitionInOut from "../../../transitions/TransitionInOut";
|
|
|
6
6
|
import Flex from "../../../layout/Flex";
|
|
7
7
|
const ItemWrapper = styled.li `
|
|
8
8
|
/** DEFAULT VARIANT **/
|
|
9
|
-
--ll-sidebar-item-label-color: ${(props) => props.theme.colors.
|
|
10
|
-
--ll-sidebar-item-icon-color: ${(props) => props.theme.colors.
|
|
9
|
+
--ll-sidebar-item-label-color: ${(props) => props.theme.colors.neutral.c80};
|
|
10
|
+
--ll-sidebar-item-icon-color: ${(props) => props.theme.colors.neutral.c80};
|
|
11
11
|
--ll-sidebar-item-background-color: unset;
|
|
12
12
|
|
|
13
13
|
display: flex;
|
|
@@ -26,8 +26,8 @@ const ItemWrapper = styled.li `
|
|
|
26
26
|
|
|
27
27
|
/** HOVER VARIANT **/
|
|
28
28
|
&:hover {
|
|
29
|
-
--ll-sidebar-item-label-color: ${(props) => props.theme.colors.
|
|
30
|
-
--ll-sidebar-item-icon-color: ${(props) => props.theme.colors.
|
|
29
|
+
--ll-sidebar-item-label-color: ${(props) => props.theme.colors.neutral.c100};
|
|
30
|
+
--ll-sidebar-item-icon-color: ${(props) => props.theme.colors.primary.c80};
|
|
31
31
|
--ll-sidebar-item-background-color: unset;
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -39,15 +39,15 @@ const ItemWrapper = styled.li `
|
|
|
39
39
|
|
|
40
40
|
/** ACTIVE VARIANT **/
|
|
41
41
|
&[data-active="true"] {
|
|
42
|
-
--ll-sidebar-item-label-color: ${(props) => props.theme.colors.
|
|
43
|
-
--ll-sidebar-item-icon-color: ${(props) => props.theme.colors.
|
|
44
|
-
--ll-sidebar-item-background-color: ${(props) => props.theme.colors.
|
|
42
|
+
--ll-sidebar-item-label-color: ${(props) => props.theme.colors.neutral.c100};
|
|
43
|
+
--ll-sidebar-item-icon-color: ${(props) => props.theme.colors.primary.c80};
|
|
44
|
+
--ll-sidebar-item-background-color: ${(props) => props.theme.colors.primary.c20};
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/** DISABLE VARIANT **/
|
|
48
48
|
&[data-disable="true"] {
|
|
49
|
-
--ll-sidebar-item-label-color: ${(props) => props.theme.colors.
|
|
50
|
-
--ll-sidebar-item-icon-color: ${(props) => props.theme.colors.
|
|
49
|
+
--ll-sidebar-item-label-color: ${(props) => props.theme.colors.neutral.c80};
|
|
50
|
+
--ll-sidebar-item-icon-color: ${(props) => props.theme.colors.neutral.c80};
|
|
51
51
|
--ll-sidebar-item-background-color: unset;
|
|
52
52
|
opacity: 0.3;
|
|
53
53
|
cursor: unset;
|
|
@@ -63,7 +63,7 @@ const DefaultBadge = styled.div `
|
|
|
63
63
|
height: ${(p) => p.theme.space[4]}px;
|
|
64
64
|
width: ${(p) => p.theme.space[4]}px;
|
|
65
65
|
border-radius: ${(p) => p.theme.radii[2]}px;
|
|
66
|
-
background-color: ${(p) => p.theme.colors.
|
|
66
|
+
background-color: ${(p) => p.theme.colors.primary.c80};
|
|
67
67
|
`;
|
|
68
68
|
export const ItemLabel = styled(Text) `
|
|
69
69
|
display: inline-block;
|
|
@@ -12,9 +12,9 @@ const Nav = styled(Flex) `
|
|
|
12
12
|
row-gap: 1.5rem;
|
|
13
13
|
height: 100vh;
|
|
14
14
|
max-width: 14.875rem;
|
|
15
|
-
color: ${(props) => props.theme.colors.
|
|
16
|
-
border-right: 1px solid ${(props) => props.theme.colors.
|
|
17
|
-
background-color: ${(props) => props.theme.colors.
|
|
15
|
+
color: ${(props) => props.theme.colors.neutral.c100};
|
|
16
|
+
border-right: 1px solid ${(props) => props.theme.colors.neutral.c40};
|
|
17
|
+
background-color: ${(props) => props.theme.colors.background.main};
|
|
18
18
|
transition: max-width 200ms;
|
|
19
19
|
will-change: max-width;
|
|
20
20
|
|
|
@@ -15,8 +15,8 @@ const ToggleButtonContainer = styled(TransitionInOut) `
|
|
|
15
15
|
right: calc(var(--ll-side-bar-toggle-button-size) / -2);
|
|
16
16
|
cursor: pointer;
|
|
17
17
|
|
|
18
|
-
background: ${(p) => p.theme.colors.
|
|
19
|
-
border: 1px solid ${(p) => p.theme.colors.
|
|
18
|
+
background: ${(p) => p.theme.colors.neutral.c20};
|
|
19
|
+
border: 1px solid ${(p) => p.theme.colors.neutral.c100};
|
|
20
20
|
border-radius: 50%;
|
|
21
21
|
width: var(--ll-side-bar-toggle-button-size);
|
|
22
22
|
height: var(--ll-side-bar-toggle-button-size);
|
package/components/styled.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { StyledInterface, InterpolationFunction } from "styled-components";
|
|
2
|
-
import { FlexboxProps, SpaceProps, PositionProps, ColorProps, LayoutProps, OverflowProps } from "styled-system";
|
|
3
|
-
export declare type BaseStyledProps = SpaceProps & FlexboxProps & PositionProps & ColorProps & LayoutProps & OverflowProps & {
|
|
2
|
+
import { FlexboxProps, SpaceProps, PositionProps, ColorProps, LayoutProps, OverflowProps, BorderProps } from "styled-system";
|
|
3
|
+
export declare type BaseStyledProps = SpaceProps & FlexboxProps & PositionProps & ColorProps & LayoutProps & BorderProps & OverflowProps & {
|
|
4
|
+
/**
|
|
5
|
+
* The columnGap CSS property sets the size of the gap (gutter) between an element's grid columns.
|
|
6
|
+
*/
|
|
4
7
|
columnGap?: string | number;
|
|
8
|
+
/**
|
|
9
|
+
* The rowGap CSS property sets the size of the gap (gutter) between an element's grid rows.
|
|
10
|
+
*/
|
|
5
11
|
rowGap?: string | number;
|
|
6
12
|
color?: string;
|
|
7
|
-
display?: string;
|
|
8
|
-
position?: string;
|
|
9
|
-
maxHeight?: number;
|
|
10
13
|
};
|
|
11
14
|
export declare const baseStyles: InterpolationFunction<unknown>;
|
|
12
15
|
declare const _default: StyledInterface;
|
package/components/styled.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import gaps from "../styles/system/gaps";
|
|
2
2
|
import styled from "styled-components";
|
|
3
|
-
import { compose, flexbox, space, position, color, layout, overflow, } from "styled-system";
|
|
4
|
-
export const baseStyles = compose(flexbox, space, position, color, layout, overflow, gaps);
|
|
3
|
+
import { compose, flexbox, space, position, color, layout, overflow, border, } from "styled-system";
|
|
4
|
+
export const baseStyles = compose(flexbox, space, position, color, layout, overflow, gaps, border);
|
|
5
5
|
const proxyStyled = new Proxy(styled, {
|
|
6
6
|
apply(target, thisArg, argumentsList) {
|
|
7
7
|
return styled(target.apply(thisArg, argumentsList)(baseStyles));
|
|
@@ -3,7 +3,7 @@ import styled from "styled-components";
|
|
|
3
3
|
import Flex from "../../layout/Flex";
|
|
4
4
|
const Bar = styled.div `
|
|
5
5
|
display: inline-flex;
|
|
6
|
-
border: 1px solid ${(p) => p.theme.colors.
|
|
6
|
+
border: 1px solid ${(p) => p.theme.colors.neutral.c40};
|
|
7
7
|
border-radius: 33px;
|
|
8
8
|
padding: 2px;
|
|
9
9
|
`;
|
|
@@ -15,8 +15,8 @@ const Item = styled(Flex).attrs({
|
|
|
15
15
|
cursor: pointer;
|
|
16
16
|
padding: 8px 12px 8px 12px;
|
|
17
17
|
border-radius: 33px;
|
|
18
|
-
color: ${(p) => p.active ? p.theme.colors.
|
|
19
|
-
background-color: ${(p) => (p.active ? p.theme.colors.
|
|
18
|
+
color: ${(p) => (p.active ? p.theme.colors.neutral.c00 : p.theme.colors.neutral.c80)};
|
|
19
|
+
background-color: ${(p) => (p.active ? p.theme.colors.neutral.c100 : "unset")};
|
|
20
20
|
`;
|
|
21
21
|
export default function BarTabs({ children, onTabChange, initialActiveIndex }) {
|
|
22
22
|
const [activeIndex, setActiveIndex] = useState(initialActiveIndex);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare type Props = React.PropsWithChildren<{
|
|
3
|
+
/**
|
|
4
|
+
* An optional callback that will be called when the active tab changes.
|
|
5
|
+
*/
|
|
6
|
+
onTabChange?: (activeIndex: number) => void;
|
|
7
|
+
/**
|
|
8
|
+
* The tab index to mark as active when rendering for the first time.
|
|
9
|
+
* If omitted, then initially no tabs will be selected.
|
|
10
|
+
*/
|
|
11
|
+
initialActiveIndex?: number;
|
|
12
|
+
}>;
|
|
13
|
+
export default function BarTabs({ children, onTabChange, initialActiveIndex }: Props): JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import Flex from "../../layout/Flex";
|
|
4
|
+
const Item = styled(Flex).attrs({
|
|
5
|
+
flex: 1,
|
|
6
|
+
justifyContent: "center",
|
|
7
|
+
alignItems: "center",
|
|
8
|
+
}) `
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
padding: 8px 12px 8px 12px;
|
|
11
|
+
border-radius: ${(p) => p.theme.radii[2]}px;
|
|
12
|
+
color: ${(p) => p.theme.colors.neutral.c100};
|
|
13
|
+
background-color: ${(p) => (p.active ? p.theme.colors.primary.c30 : "unset")};
|
|
14
|
+
`;
|
|
15
|
+
export default function BarTabs({ children, onTabChange, initialActiveIndex }) {
|
|
16
|
+
const [activeIndex, setActiveIndex] = useState(initialActiveIndex);
|
|
17
|
+
return (React.createElement(Flex, { justifyContent: "space-between", flex: 1, columnGap: 5 }, React.Children.toArray(children).map((child, index) => (React.createElement(Item, { key: index, active: index === activeIndex, onClick: () => {
|
|
18
|
+
setActiveIndex(index);
|
|
19
|
+
onTabChange && onTabChange(index);
|
|
20
|
+
} }, child)))));
|
|
21
|
+
}
|
|
@@ -24,14 +24,14 @@ const Item = styled(Flex).attrs({ flex: 1, justifyContent: "center", alignItems:
|
|
|
24
24
|
padding: 8px 10px 8px 10px;
|
|
25
25
|
border: 1px solid;
|
|
26
26
|
&[data-active="false"] {
|
|
27
|
-
color: ${(p) => p.theme.colors.
|
|
28
|
-
background-color: ${(p) => p.theme.colors.
|
|
29
|
-
border-color: ${(p) => p.theme.colors.
|
|
27
|
+
color: ${(p) => p.theme.colors.neutral.c80};
|
|
28
|
+
background-color: ${(p) => p.theme.colors.neutral.c00};
|
|
29
|
+
border-color: ${(p) => p.theme.colors.neutral.c40};
|
|
30
30
|
}
|
|
31
31
|
&[data-active="true"] {
|
|
32
|
-
color: ${(p) => p.theme.colors.
|
|
33
|
-
background-color: ${(p) => p.theme.colors.
|
|
34
|
-
border-color: ${(p) => p.theme.colors.
|
|
32
|
+
color: ${(p) => p.theme.colors.neutral.c00};
|
|
33
|
+
background-color: ${(p) => p.theme.colors.neutral.c100};
|
|
34
|
+
border-color: ${(p) => p.theme.colors.neutral.c100};
|
|
35
35
|
|
|
36
36
|
&:not(:last-child) {
|
|
37
37
|
border-right-width: 0;
|
|
@@ -32,7 +32,7 @@ const HeaderTitle = styled(Text).attrs({
|
|
|
32
32
|
fontWeight: "600",
|
|
33
33
|
}) `
|
|
34
34
|
margin-inline: 12px;
|
|
35
|
-
color: ${(p) => p.selected ? p.theme.colors.
|
|
35
|
+
color: ${(p) => (p.selected ? p.theme.colors.neutral.c100 : p.theme.colors.neutral.c80)};
|
|
36
36
|
`;
|
|
37
37
|
const HeaderBottomBarFixed = styled(Flex).attrs({
|
|
38
38
|
flex: 1,
|
|
@@ -40,7 +40,7 @@ const HeaderBottomBarFixed = styled(Flex).attrs({
|
|
|
40
40
|
width: 100%;
|
|
41
41
|
position: relative;
|
|
42
42
|
top: 3px;
|
|
43
|
-
border-bottom: 1px solid ${(p) => p.theme.colors.
|
|
43
|
+
border-bottom: 1px solid ${(p) => p.theme.colors.neutral.c40};
|
|
44
44
|
`;
|
|
45
45
|
const HeaderBottomBarMoving = styled.div `
|
|
46
46
|
position: relative;
|
|
@@ -48,12 +48,12 @@ const HeaderBottomBarMoving = styled.div `
|
|
|
48
48
|
width: ${(p) => p.width}px;
|
|
49
49
|
transition: all 400ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
|
|
50
50
|
border-bottom: solid 3px;
|
|
51
|
-
border-bottom-color: ${(p) => p.theme.colors.
|
|
51
|
+
border-bottom-color: ${(p) => p.theme.colors.primary.c70};
|
|
52
52
|
`;
|
|
53
53
|
const Badge = styled(Tag).attrs((p) => ({
|
|
54
54
|
borderRadius: p.theme.radii[3],
|
|
55
|
-
backgroundColor: p.theme.colors.
|
|
56
|
-
color: p.theme.colors.
|
|
55
|
+
backgroundColor: p.theme.colors.primary.c70,
|
|
56
|
+
color: p.theme.colors.neutral.c00,
|
|
57
57
|
})) `
|
|
58
58
|
padding: 5px;
|
|
59
59
|
min-width: 24px;
|
|
@@ -74,8 +74,8 @@ const MainContent = styled(Flex).attrs({
|
|
|
74
74
|
flex: 1,
|
|
75
75
|
}) `
|
|
76
76
|
width: 100%;
|
|
77
|
-
color: ${(p) => p.active ? p.theme.colors.
|
|
78
|
-
background-color: ${(p) => p.active ? p.theme.colors.
|
|
77
|
+
color: ${(p) => (p.active ? p.theme.colors.neutral.c00 : p.theme.colors.neutral.c70)};
|
|
78
|
+
background-color: ${(p) => (p.active ? p.theme.colors.neutral.c100 : p.theme.colors.neutral.c00)};
|
|
79
79
|
`;
|
|
80
80
|
export default function Tabs(props) {
|
|
81
81
|
const { tabs, onTabChange } = props;
|
package/components/tabs/index.js
CHANGED
package/index.d.ts
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/react-ui",
|
|
3
3
|
"description": "Ledger Live - Desktop UI",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"author": "Ledger Live Team <team-live@ledger.fr>",
|
|
6
6
|
"repository": "https://github.com/LedgerHQ/ui",
|
|
7
7
|
"license": "MIT",
|
|
@@ -27,13 +27,12 @@
|
|
|
27
27
|
"index.js"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@ledgerhq/icons-ui": "^0.2.
|
|
31
|
-
"@ledgerhq/ui-shared": "^0.1.
|
|
30
|
+
"@ledgerhq/icons-ui": "^0.2.1",
|
|
31
|
+
"@ledgerhq/ui-shared": "^0.1.4",
|
|
32
32
|
"@tippyjs/react": "^4.2.6",
|
|
33
33
|
"@types/color": "^3.0.2",
|
|
34
|
-
"@types/react": "~17.0.
|
|
34
|
+
"@types/react": "~17.0.37",
|
|
35
35
|
"@types/react-dom": "^17.0.11",
|
|
36
|
-
"@types/react-select": "^4.0.18",
|
|
37
36
|
"@types/react-transition-group": "^4.4.2",
|
|
38
37
|
"@types/react-window": "^1.8.5",
|
|
39
38
|
"@types/styled-components": "^5.1.14",
|
|
@@ -44,7 +43,7 @@
|
|
|
44
43
|
"moment": "^2.29.1",
|
|
45
44
|
"react-chartjs-2": "^3.0.5",
|
|
46
45
|
"react-is": "^17.0.2",
|
|
47
|
-
"react-select": "^
|
|
46
|
+
"react-select": "^5.2.1",
|
|
48
47
|
"react-transition-group": "^4.4.2",
|
|
49
48
|
"react-window": "^1.8.6",
|
|
50
49
|
"styled-system": "^5.1.5"
|
package/styles/InvertTheme.js
CHANGED
|
@@ -5,6 +5,6 @@ import { palettes } from "@ledgerhq/ui-shared";
|
|
|
5
5
|
export const InvertTheme = ({ children }) => {
|
|
6
6
|
const { theme } = useTheme();
|
|
7
7
|
const revertTheme = theme === "light" ? "dark" : "light";
|
|
8
|
-
const newTheme = useMemo(() => (Object.assign(Object.assign({}, defaultTheme), { colors: Object.assign(Object.assign({},
|
|
8
|
+
const newTheme = useMemo(() => (Object.assign(Object.assign({}, defaultTheme), { colors: Object.assign(Object.assign({}, palettes[revertTheme]), { palette: palettes[revertTheme] }), theme: revertTheme })), [revertTheme]);
|
|
9
9
|
return React.createElement(ThemeProvider, { theme: newTheme }, children);
|
|
10
10
|
};
|
package/styles/StyleProvider.js
CHANGED
|
@@ -3,7 +3,7 @@ import { ThemeProvider } from "styled-components";
|
|
|
3
3
|
import { defaultTheme, GlobalStyle } from ".";
|
|
4
4
|
import { palettes } from "@ledgerhq/ui-shared";
|
|
5
5
|
export const StyleProvider = ({ children, fontsPath, fontMappings, selectedPalette = "light", }) => {
|
|
6
|
-
const theme = useMemo(() => (Object.assign(Object.assign({}, defaultTheme), { colors: Object.assign(Object.assign({}, defaultTheme.colors), { palette: palettes[selectedPalette] }), theme: selectedPalette })), [selectedPalette]);
|
|
6
|
+
const theme = useMemo(() => (Object.assign(Object.assign({}, defaultTheme), { colors: Object.assign(Object.assign(Object.assign({}, defaultTheme.colors), palettes[selectedPalette]), { palette: palettes[selectedPalette] }), theme: selectedPalette })), [selectedPalette]);
|
|
7
7
|
return (React.createElement(ThemeProvider, { theme: theme },
|
|
8
8
|
React.createElement(GlobalStyle, { fontsPath: fontsPath, fontMappings: fontMappings }),
|
|
9
9
|
children));
|
package/styles/global.js
CHANGED
|
@@ -1,59 +1,38 @@
|
|
|
1
1
|
import { createGlobalStyle } from "styled-components";
|
|
2
2
|
import { rgba } from "./helpers";
|
|
3
|
-
import reset from "./reset";
|
|
4
3
|
import tippyStyles from "../components/message/Tooltip/styles";
|
|
5
4
|
import { fontStyles } from "../components/asorted/Text/styles";
|
|
6
5
|
export const GlobalStyle = createGlobalStyle `
|
|
7
|
-
|
|
6
|
+
html {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
8
9
|
|
|
9
10
|
body {
|
|
10
11
|
font-family: Inter;
|
|
11
12
|
font-size: 100%;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
.spectron-run canvas:not(.visible-for-spectron) {
|
|
17
|
-
visibility: hidden;
|
|
15
|
+
*, *:before, *:after {
|
|
16
|
+
box-sizing: inherit;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
* {
|
|
20
|
+
margin: 0;
|
|
21
|
+
padding: 0;
|
|
22
|
+
font: inherit;
|
|
23
|
+
color: inherit;
|
|
24
|
+
user-select: inherit;
|
|
25
|
+
cursor: inherit;
|
|
26
|
+
outline: none;
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
::selection {
|
|
31
|
-
background: ${(p) => rgba(p.theme.colors.
|
|
30
|
+
background: ${(p) => rgba(p.theme.colors.primary.c100, 0.1)};
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
--track-color: rgba(0,0,0,0);
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
width: ${(p) => p.theme.overflow.trackSize}px;
|
|
38
|
-
height: ${(p) => p.theme.overflow.trackSize}px;
|
|
39
|
-
background-color: rgba(0,0,0,0);
|
|
40
|
-
}
|
|
41
|
-
::-webkit-scrollbar-button {
|
|
42
|
-
opacity: 0;
|
|
43
|
-
height: 0;
|
|
44
|
-
width: 0;
|
|
45
|
-
}
|
|
46
|
-
::-webkit-scrollbar-track {
|
|
47
|
-
background-color: rgba(0,0,0,0);
|
|
48
|
-
}
|
|
49
|
-
::-webkit-scrollbar-thumb {
|
|
50
|
-
box-shadow: inset 0 0 0 ${(p) => p.theme.overflow.trackSize}px var(--track-color);
|
|
51
|
-
border: 2px solid rgba(0,0,0,0);
|
|
52
|
-
border-radius: ${(p) => p.theme.overflow.trackSize}px;
|
|
53
|
-
}
|
|
54
|
-
::-webkit-scrollbar-corner {
|
|
55
|
-
opacity: 0;
|
|
56
|
-
}
|
|
35
|
+
${(props) => (typeof props.fontsPath === "string" ? fontStyles : "")}
|
|
57
36
|
|
|
58
37
|
${tippyStyles}
|
|
59
38
|
`;
|
package/styles/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as defaultTheme } from "./theme";
|
|
2
2
|
export * from "./helpers";
|
|
3
3
|
export * from "./global";
|
|
4
|
-
export { default as resetCss } from "./reset";
|
|
5
4
|
export * from "./StyleProvider";
|
|
5
|
+
export { InvertTheme } from "./InvertTheme";
|
|
6
6
|
export type { ThemeNames, ColorPalette } from "@ledgerhq/ui-shared";
|
|
7
7
|
export { palettes } from "@ledgerhq/ui-shared";
|
package/styles/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as defaultTheme } from "./theme";
|
|
2
2
|
export * from "./helpers";
|
|
3
3
|
export * from "./global";
|
|
4
|
-
export { default as resetCss } from "./reset";
|
|
5
4
|
export * from "./StyleProvider";
|
|
5
|
+
export { InvertTheme } from "./InvertTheme";
|
|
6
6
|
export { palettes } from "@ledgerhq/ui-shared";
|
package/styles/theme.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export declare const fontFamilies: {
|
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
|
-
declare const transition: (properties?: string[]) => FlattenSimpleInterpolation;
|
|
48
|
+
declare const transition: (properties?: string[], duration?: string, easing?: string) => FlattenSimpleInterpolation;
|
|
49
49
|
declare const animations: {
|
|
50
50
|
fadeIn: () => FlattenSimpleInterpolation;
|
|
51
51
|
fadeOut: () => FlattenSimpleInterpolation;
|
|
@@ -98,7 +98,10 @@ declare module "styled-components" {
|
|
|
98
98
|
fontSizes: number[];
|
|
99
99
|
space: number[];
|
|
100
100
|
shadows: string[];
|
|
101
|
-
colors: {
|
|
101
|
+
colors: ColorPalette & {
|
|
102
|
+
/**
|
|
103
|
+
* @deprecated Do not use the .palette prefix anymore!
|
|
104
|
+
*/
|
|
102
105
|
palette: ColorPalette;
|
|
103
106
|
};
|
|
104
107
|
fontWeights: Record<string, string>;
|