@ledgerhq/react-ui 0.3.1 → 0.7.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 +62 -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 +11 -3
- package/components/layout/Drawer/index.js +52 -27
- package/components/layout/Flex/index.d.ts +2 -5
- package/components/layout/Popin/index.d.ts +6 -11
- package/components/layout/Popin/index.js +14 -9
- 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/FlowStepper/index.d.ts +76 -0
- package/components/navigation/FlowStepper/index.js +35 -0
- package/components/navigation/index.d.ts +1 -0
- package/components/navigation/index.js +1 -0
- 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.d.ts +25 -9
- package/components/navigation/progress/Stepper/index.js +46 -27
- 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 +12 -10
- 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
|
@@ -11,7 +11,7 @@ export declare const RadioContext: React.Context<Omit<RadioProps, "children" | "
|
|
|
11
11
|
declare const Radio: {
|
|
12
12
|
({ currentValue, name, onChange, children, containerProps, }: RadioProps): JSX.Element;
|
|
13
13
|
Element: {
|
|
14
|
-
({ label, value, disabled, variant, ...props }: import("./RadioElement").RadioElementProps): JSX.Element;
|
|
14
|
+
({ label, value, disabled, outlined, variant, ...props }: import("./RadioElement").RadioElementProps): JSX.Element;
|
|
15
15
|
displayName: string;
|
|
16
16
|
};
|
|
17
17
|
ListElement: {
|
|
@@ -1,3 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { InputProps } from "../BaseInput";
|
|
3
|
-
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<import("../BaseInput").CommonProps, "onChange" | "value"> & {
|
|
4
|
+
value: string;
|
|
5
|
+
onChange?: ((value: string) => void) | undefined;
|
|
6
|
+
onChangeEvent?: React.ChangeEventHandler<HTMLInputElement> | undefined;
|
|
7
|
+
renderLeft?: React.ReactNode | ((props: InputProps<string>) => React.ReactNode);
|
|
8
|
+
renderRight?: React.ReactNode | ((props: InputProps<string>) => React.ReactNode);
|
|
9
|
+
unwrapped?: boolean | undefined;
|
|
10
|
+
containerProps?: (({
|
|
11
|
+
[x: string]: any;
|
|
12
|
+
[x: number]: any;
|
|
13
|
+
[x: symbol]: any;
|
|
14
|
+
} & {
|
|
15
|
+
theme?: import("styled-components").DefaultTheme | undefined;
|
|
16
|
+
} & ({} | {
|
|
17
|
+
children?: import("react").ReactNode;
|
|
18
|
+
})) & {
|
|
19
|
+
as?: string | import("react").ComponentType<any> | undefined;
|
|
20
|
+
forwardedAs?: string | import("react").ComponentType<any> | undefined;
|
|
21
|
+
}) | undefined;
|
|
22
|
+
serialize?: ((value: string) => string) | undefined;
|
|
23
|
+
deserialize?: ((value: string) => string) | undefined;
|
|
24
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
25
|
+
export default _default;
|
|
@@ -2,8 +2,9 @@ import React from "react";
|
|
|
2
2
|
import { useTheme } from "styled-components";
|
|
3
3
|
import Input, { InputRenderLeftContainer } from "../BaseInput";
|
|
4
4
|
import SearchMedium from "@ledgerhq/icons-ui/react/SearchMedium";
|
|
5
|
-
|
|
5
|
+
function SearchInput(props, ref) {
|
|
6
6
|
const theme = useTheme();
|
|
7
|
-
return (React.createElement(Input, Object.assign({}, props, { renderLeft: React.createElement(InputRenderLeftContainer, null,
|
|
8
|
-
React.createElement(SearchMedium, { color: props.disabled ? theme.colors.
|
|
7
|
+
return (React.createElement(Input, Object.assign({ ref: ref }, props, { renderLeft: React.createElement(InputRenderLeftContainer, null,
|
|
8
|
+
React.createElement(SearchMedium, { color: props.disabled ? theme.colors.neutral.c50 : theme.colors.neutral.c70 })) })));
|
|
9
9
|
}
|
|
10
|
+
export default React.forwardRef(SearchInput);
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
export declare function getStyles<
|
|
4
|
-
|
|
5
|
-
value: string;
|
|
6
|
-
}, M extends boolean = false>(): NonNullable<Styles<T, M>["control"]>;
|
|
7
|
-
export declare function Control<T extends OptionTypeBase = {
|
|
8
|
-
label: string;
|
|
9
|
-
value: string;
|
|
10
|
-
}, M extends boolean = false>(props: ControlProps<T, M>): JSX.Element;
|
|
1
|
+
import { GroupBase, StylesConfig, ControlProps } from "react-select";
|
|
2
|
+
import { DefaultTheme } from "styled-components";
|
|
3
|
+
export declare function getStyles<O = unknown, M extends boolean = false, G extends GroupBase<O> = GroupBase<O>>(theme: DefaultTheme): NonNullable<StylesConfig<O, M, G>["control"]>;
|
|
4
|
+
export declare function Control<O = unknown, M extends boolean = false, G extends GroupBase<O> = GroupBase<O>>(props: ControlProps<O, M, G>): JSX.Element;
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { components } from "react-select";
|
|
3
|
-
import styled from "styled-components";
|
|
4
3
|
import { InputContainer } from "../BaseInput";
|
|
5
|
-
export function getStyles() {
|
|
6
|
-
return (provided) => (Object.assign(Object.assign({}, provided), { display: "flex", alignItems: "center", width: "100%", border: 0, boxShadow: "none", borderRadius: "inherit", background: "transparent" }));
|
|
4
|
+
export function getStyles(theme) {
|
|
5
|
+
return (provided) => (Object.assign(Object.assign({}, provided), { display: "flex", alignItems: "center", width: "100%", border: 0, padding: `0px ${theme.space[7]}px`, boxShadow: "none", borderRadius: "inherit", background: "transparent" }));
|
|
7
6
|
}
|
|
8
|
-
const Container = styled(InputContainer) `
|
|
9
|
-
padding: 0 ${(p) => p.theme.space[7]}px;
|
|
10
|
-
`;
|
|
11
7
|
export function Control(props) {
|
|
12
|
-
const { isFocused, selectProps
|
|
13
|
-
|
|
8
|
+
const { isFocused, selectProps, children } = props;
|
|
9
|
+
const { isDisabled, error, renderLeft } = selectProps;
|
|
10
|
+
return (React.createElement(InputContainer, { disabled: isDisabled, error: error, focus: isFocused },
|
|
14
11
|
React.createElement(components.Control, Object.assign({}, props),
|
|
15
12
|
renderLeft ? renderLeft(props) : null,
|
|
16
13
|
children)));
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare function
|
|
4
|
-
label: string;
|
|
5
|
-
value: string;
|
|
6
|
-
}, M extends boolean = false>(): NonNullable<Styles<T, M>["dropdownIndicator"]>;
|
|
7
|
-
export declare function DropdownIndicator<T extends OptionTypeBase = {
|
|
8
|
-
label: string;
|
|
9
|
-
value: string;
|
|
10
|
-
}, M extends boolean = false>(props: IndicatorProps<T, M>): JSX.Element;
|
|
1
|
+
import { GroupBase, StylesConfig, DropdownIndicatorProps } from "react-select";
|
|
2
|
+
export declare function getStyles<O = unknown, M extends boolean = false, G extends GroupBase<O> = GroupBase<O>>(): NonNullable<StylesConfig<O, M, G>["dropdownIndicator"]>;
|
|
3
|
+
export declare function DropdownIndicator<O = unknown, M extends boolean = false, G extends GroupBase<O> = GroupBase<O>>(props: DropdownIndicatorProps<O, M, G>): JSX.Element;
|
|
@@ -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,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare function IndicatorsContainer<T extends OptionTypeBase = {
|
|
4
|
-
label: string;
|
|
5
|
-
value: string;
|
|
6
|
-
}, M extends boolean = false>(props: IndicatorContainerProps<T, M>): JSX.Element;
|
|
1
|
+
import { GroupBase, IndicatorsContainerProps } from "react-select";
|
|
2
|
+
export declare function IndicatorsContainer<O = unknown, M extends boolean = false, G extends GroupBase<O> = GroupBase<O>>(props: IndicatorsContainerProps<O, M, G>): JSX.Element;
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { components } from "react-select";
|
|
3
3
|
import FlexBox from "../../layout/Flex";
|
|
4
4
|
export function IndicatorsContainer(props) {
|
|
5
|
-
const {
|
|
5
|
+
const { renderRight } = props.selectProps;
|
|
6
6
|
return (React.createElement(FlexBox, { alignItems: "center" },
|
|
7
7
|
renderRight ? renderRight(props) : null,
|
|
8
8
|
React.createElement(components.IndicatorsContainer, Object.assign({}, props))));
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { Styles, MenuListComponentProps, OptionTypeBase } from "react-select";
|
|
1
|
+
import { GroupBase, StylesConfig, MenuListProps } from "react-select";
|
|
3
2
|
import { DefaultTheme } from "styled-components";
|
|
4
|
-
export declare function getStyles<
|
|
5
|
-
|
|
6
|
-
value: string;
|
|
7
|
-
}, M extends boolean = false>(theme: DefaultTheme): NonNullable<Styles<T, M>["menuList"]>;
|
|
8
|
-
export declare function MenuList<T extends OptionTypeBase = {
|
|
9
|
-
label: string;
|
|
10
|
-
value: string;
|
|
11
|
-
}, M extends boolean = false>(props: MenuListComponentProps<T, M>): JSX.Element;
|
|
3
|
+
export declare function getStyles<O = unknown, M extends boolean = false, G extends GroupBase<O> = GroupBase<O>>(theme: DefaultTheme): NonNullable<StylesConfig<O, M, G>["menuList"]>;
|
|
4
|
+
export declare function MenuList<O = unknown, M extends boolean = false, G extends GroupBase<O> = GroupBase<O>>(props: MenuListProps<O, M, G>): JSX.Element;
|
|
@@ -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);
|
|
@@ -1,20 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
export declare function getStyles<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}, M extends boolean = false>(): NonNullable<Styles<T, M>["option"]>;
|
|
7
|
-
export declare type ExtraProps<T extends OptionTypeBase = {
|
|
8
|
-
label: string;
|
|
9
|
-
value: string;
|
|
10
|
-
}, M extends boolean = false> = {
|
|
11
|
-
render?: (props: React.PropsWithChildren<OptionProps<T, M>>) => React.ReactNode;
|
|
2
|
+
import { GroupBase, StylesConfig, OptionProps } from "react-select";
|
|
3
|
+
export declare function getStyles<O = unknown, M extends boolean = false, G extends GroupBase<O> = GroupBase<O>>(): NonNullable<StylesConfig<O, M, G>["option"]>;
|
|
4
|
+
export declare type ExtraProps<O = unknown, M extends boolean = false, G extends GroupBase<O> = GroupBase<O>> = {
|
|
5
|
+
render?: (props: React.PropsWithChildren<OptionProps<O, M, G>>) => React.ReactNode;
|
|
12
6
|
};
|
|
13
|
-
export declare type Props<
|
|
14
|
-
|
|
15
|
-
value: string;
|
|
16
|
-
}, M extends boolean = false> = OptionProps<T, M> & ExtraProps<T, M>;
|
|
17
|
-
export declare function Option<T extends OptionTypeBase = {
|
|
18
|
-
label: string;
|
|
19
|
-
value: string;
|
|
20
|
-
}, M extends boolean = false>(props: Props<T, M>): JSX.Element;
|
|
7
|
+
export declare type Props<O = unknown, M extends boolean = false, G extends GroupBase<O> = GroupBase<O>> = OptionProps<O, M, G> & ExtraProps<O, M, G>;
|
|
8
|
+
export declare function Option<O = unknown, M extends boolean = false, G extends GroupBase<O> = GroupBase<O>>(props: Props<O, M, G>): JSX.Element;
|
|
@@ -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
|
`;
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
export declare function getStyles<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}, M extends boolean = false>(): Styles<T, M>["valueContainer"];
|
|
7
|
-
declare type ExtraProps<T extends OptionTypeBase = {
|
|
8
|
-
label: string;
|
|
9
|
-
value: string;
|
|
10
|
-
}, M extends boolean = false> = {
|
|
11
|
-
render?: (props: React.PropsWithChildren<ValueContainerProps<T, M>>) => React.ReactNode;
|
|
2
|
+
import { GroupBase, StylesConfig, ValueContainerProps } from "react-select";
|
|
3
|
+
export declare function getStyles<O = unknown, M extends boolean = false, G extends GroupBase<O> = GroupBase<O>>(): StylesConfig<O, M, G>["valueContainer"];
|
|
4
|
+
declare type ExtraProps<O = unknown, M extends boolean = false, G extends GroupBase<O> = GroupBase<O>> = {
|
|
5
|
+
render?: (props: React.PropsWithChildren<ValueContainerProps<O, M, G>>) => React.ReactNode;
|
|
12
6
|
};
|
|
13
|
-
export declare function ValueContainer<
|
|
14
|
-
label: string;
|
|
15
|
-
value: string;
|
|
16
|
-
}, M extends boolean = false>(props: ValueContainerProps<T, M> & ExtraProps<T, M>): JSX.Element;
|
|
7
|
+
export declare function ValueContainer<O = unknown, M extends boolean = false, G extends GroupBase<O> = GroupBase<O>>(props: ValueContainerProps<O, M, G> & ExtraProps<O, M, G>): JSX.Element;
|
|
17
8
|
export {};
|
|
@@ -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
|
-
React.createElement(Text, { as: "div", variant: "paragraph", color: color }, props.render ? props.render(props) : props.children)));
|
|
10
|
+
React.createElement(Text, { as: "div", variant: "paragraph", color: color, style: { display: "inherit", alignItems: "center" } }, props.render ? props.render(props) : props.children)));
|
|
11
11
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { GroupBase, MenuListProps } from "react-select";
|
|
3
3
|
export declare type RowProps = React.PropsWithChildren<{
|
|
4
4
|
style: React.CSSProperties;
|
|
5
5
|
}>;
|
|
6
6
|
export declare const VirtualRow: React.MemoExoticComponent<({ style, children }: RowProps) => JSX.Element>;
|
|
7
|
-
export declare function VirtualMenuList<
|
|
8
|
-
label: string;
|
|
9
|
-
value: string;
|
|
10
|
-
}, M extends boolean = false>(props: MenuListComponentProps<T, M>): React.ReactElement;
|
|
7
|
+
export declare function VirtualMenuList<O = unknown, M extends boolean = false, G extends GroupBase<O> = GroupBase<O>>(props: MenuListProps<O, M, G>): React.ReactElement;
|
|
@@ -3,7 +3,8 @@ import { components } from "react-select";
|
|
|
3
3
|
import { FixedSizeList as List } from "react-window";
|
|
4
4
|
export const VirtualRow = memo(({ style, children }) => (React.createElement("div", { style: style }, children)));
|
|
5
5
|
export function VirtualMenuList(props) {
|
|
6
|
-
const { children, options, maxHeight, getValue, getStyles, selectProps
|
|
6
|
+
const { children, options, maxHeight, getValue, getStyles, selectProps } = props;
|
|
7
|
+
const { noOptionsMessage, rowHeight = 0 } = selectProps;
|
|
7
8
|
const listRef = useRef();
|
|
8
9
|
const [value] = getValue();
|
|
9
10
|
const initialOffset = options.indexOf(value) * rowHeight;
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Props as SelectProps,
|
|
3
|
-
export declare type SelfProps<
|
|
4
|
-
label: string;
|
|
5
|
-
value: string;
|
|
6
|
-
}, M extends boolean = false> = {
|
|
2
|
+
import { Props as SelectProps, ControlProps, IndicatorsContainerProps, GroupBase, StylesConfig } from "react-select";
|
|
3
|
+
export declare type SelfProps<O, M extends boolean, G extends GroupBase<O>> = {
|
|
7
4
|
error?: string;
|
|
8
|
-
renderLeft?: (props:
|
|
9
|
-
renderRight?: (props:
|
|
5
|
+
renderLeft?: (props: ControlProps<O, M, G>) => React.ReactNode;
|
|
6
|
+
renderRight?: (props: IndicatorsContainerProps<O, M, G>) => React.ReactNode;
|
|
10
7
|
rowHeight?: number;
|
|
11
8
|
unwrapped?: boolean;
|
|
9
|
+
extendStyles?: (styles: StylesConfig<O, M, G>) => StylesConfig<O, M, G>;
|
|
12
10
|
};
|
|
13
|
-
export declare type Props<
|
|
14
|
-
|
|
15
|
-
value: string;
|
|
16
|
-
}, M extends boolean = false> = SelectProps<T, M> & SelfProps<T, M>;
|
|
17
|
-
declare function SelectInput<T extends OptionTypeBase = {
|
|
18
|
-
label: string;
|
|
19
|
-
value: string;
|
|
20
|
-
}, M extends boolean = false>({ error, rowHeight, unwrapped, ...props }: Props<T, M>): JSX.Element;
|
|
11
|
+
export declare type Props<O = unknown, M extends boolean = false, G extends GroupBase<O> = GroupBase<O>> = SelectProps<O, M, G> & SelfProps<O, M, G>;
|
|
12
|
+
declare function SelectInput<O, M extends boolean, G extends GroupBase<O>>({ error, rowHeight, unwrapped, extendStyles, ...props }: Props<O, M, G>): JSX.Element;
|
|
21
13
|
declare const _default: typeof SelectInput;
|
|
22
14
|
export default _default;
|
|
@@ -20,22 +20,30 @@ import * as OptionModule from "./Option";
|
|
|
20
20
|
import { IndicatorsContainer } from "./IndicatorsContainer";
|
|
21
21
|
import { InputErrorContainer } from "../BaseInput";
|
|
22
22
|
const stylesFn = (theme) => ({
|
|
23
|
-
control: ControlModule.getStyles(),
|
|
23
|
+
control: ControlModule.getStyles(theme),
|
|
24
24
|
valueContainer: ValueContainerModule.getStyles(),
|
|
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
|
+
multiValue: (provided) => (Object.assign(Object.assign({}, provided), { backgroundColor: theme.colors.primary.c20, borderRadius: theme.radii[1] })),
|
|
32
|
+
multiValueLabel: (provided) => (Object.assign(Object.assign({}, provided), { color: theme.colors.neutral.c100 })),
|
|
33
|
+
multiValueRemove: (provided) => (Object.assign(Object.assign({}, provided), { cursor: "pointer", ":hover": {
|
|
34
|
+
color: theme.colors.error.c100,
|
|
35
|
+
backgroundColor: theme.colors.error.c30,
|
|
36
|
+
} })),
|
|
31
37
|
menu: (provided) => (Object.assign(Object.assign({}, provided), { border: 0, boxShadow: "none", background: "none" })),
|
|
32
38
|
});
|
|
33
39
|
function SelectInput(_a) {
|
|
34
|
-
var { error, rowHeight = 48, unwrapped } = _a, props = __rest(_a, ["error", "rowHeight", "unwrapped"]);
|
|
40
|
+
var { error, rowHeight = 48, unwrapped, extendStyles } = _a, props = __rest(_a, ["error", "rowHeight", "unwrapped", "extendStyles"]);
|
|
35
41
|
const theme = useTheme();
|
|
36
|
-
const styles = useMemo(() => stylesFn(theme), [theme]);
|
|
42
|
+
const styles = useMemo(() => (extendStyles ? extendStyles(stylesFn(theme)) : stylesFn(theme)), [theme, extendStyles]);
|
|
37
43
|
const { isDisabled, components = {} } = props;
|
|
38
|
-
const innerContent = (React.createElement(Select, Object.assign({}, props, {
|
|
44
|
+
const innerContent = (React.createElement(Select, Object.assign({}, props, { styles: Object.assign(Object.assign({}, styles), props.styles), classNamePrefix: "react-select", components: Object.assign({ Control: ControlModule.Control, ValueContainer: ValueContainerModule.ValueContainer, IndicatorsContainer, DropdownIndicator: DropdownIndicatorModule.DropdownIndicator, MenuList: MenuListModule.MenuList, Option: OptionModule.Option, IndicatorSeparator: null }, components),
|
|
45
|
+
// @ts-expect-error We want to be able to pass extra props here…
|
|
46
|
+
rowHeight: rowHeight })));
|
|
39
47
|
if (unwrapped)
|
|
40
48
|
return innerContent;
|
|
41
49
|
return (React.createElement("div", null,
|
|
@@ -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
|
};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { BaseStyledProps } from "../../styled";
|
|
2
2
|
export declare type BoxProps = BaseStyledProps;
|
|
3
|
-
declare const Box: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").OverflowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & {
|
|
3
|
+
declare const Box: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").BorderProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").OverflowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & {
|
|
4
4
|
columnGap?: string | number | undefined;
|
|
5
5
|
rowGap?: string | number | undefined;
|
|
6
6
|
color?: string | undefined;
|
|
7
|
-
display?: string | undefined;
|
|
8
|
-
position?: string | undefined;
|
|
9
|
-
maxHeight?: number | undefined;
|
|
10
7
|
}, never>;
|
|
11
8
|
export default Box;
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
export declare enum Direction {
|
|
3
|
+
Left = "left",
|
|
4
|
+
Right = "right"
|
|
5
|
+
}
|
|
2
6
|
export interface DrawerProps {
|
|
3
7
|
isOpen: boolean;
|
|
4
8
|
children: React.ReactNode;
|
|
5
9
|
title?: React.ReactNode;
|
|
10
|
+
footer?: React.ReactNode;
|
|
6
11
|
big?: boolean;
|
|
7
|
-
|
|
12
|
+
ignoreBackdropClick?: boolean;
|
|
13
|
+
backgroundColor?: string;
|
|
8
14
|
onClose: () => void;
|
|
9
15
|
onBack?: () => void;
|
|
10
16
|
setTransitionsEnabled?: (arg0: boolean) => void;
|
|
11
17
|
hideNavigation?: boolean;
|
|
18
|
+
menuPortalTarget?: Element | null;
|
|
19
|
+
direction?: Direction;
|
|
12
20
|
}
|
|
13
|
-
declare const
|
|
14
|
-
export default
|
|
21
|
+
declare const _default: React.ForwardRefExoticComponent<DrawerProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
export default _default;
|