@ledgerhq/react-ui 0.4.0 → 0.7.1

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.
Files changed (102) hide show
  1. package/assets/logos/LedgerLiveAltRegular.d.ts +0 -1
  2. package/assets/logos/LedgerLiveRegular.d.ts +0 -1
  3. package/components/Chart/index.d.ts +0 -1
  4. package/components/Table/Columns.d.ts +60 -11
  5. package/components/Table/Columns.js +6 -16
  6. package/components/Table/index.d.ts +44 -12
  7. package/components/Table/index.js +36 -16
  8. package/components/Table/stories.helper.js +13 -12
  9. package/components/animations/GlitchText/index.d.ts +0 -1
  10. package/components/asorted/Divider/index.d.ts +1 -2
  11. package/components/asorted/Icon/BoxedIcon.d.ts +48 -0
  12. package/components/asorted/Icon/BoxedIcon.js +62 -0
  13. package/components/asorted/Icon/Icon.d.ts +0 -2
  14. package/components/asorted/Icon/Icon.js +0 -7
  15. package/components/asorted/Icon/index.d.ts +3 -1
  16. package/components/asorted/Icon/index.js +3 -1
  17. package/components/asorted/index.d.ts +1 -1
  18. package/components/asorted/index.js +1 -1
  19. package/components/cta/Button/index.d.ts +11 -8
  20. package/components/cta/Button/index.js +34 -23
  21. package/components/cta/Link/index.d.ts +53 -4
  22. package/components/cta/Link/index.js +15 -11
  23. package/components/cta/Toggle/index.d.ts +0 -1
  24. package/components/form/BaseInput/index.d.ts +8 -14
  25. package/components/form/BaseInput/index.js +1 -1
  26. package/components/form/Dropdown/index.d.ts +3 -3
  27. package/components/form/Dropdown/index.js +9 -8
  28. package/components/form/DropdownGeneric/index.d.ts +36 -0
  29. package/components/form/DropdownGeneric/index.js +95 -0
  30. package/components/form/LegendInput/index.d.ts +26 -2
  31. package/components/form/LegendInput/index.js +3 -2
  32. package/components/form/NumberInput/index.d.ts +25 -3
  33. package/components/form/NumberInput/index.js +3 -2
  34. package/components/form/QrCodeInput/index.d.ts +25 -3
  35. package/components/form/QrCodeInput/index.js +3 -2
  36. package/components/form/QuantityInput/index.d.ts +26 -4
  37. package/components/form/QuantityInput/index.js +3 -2
  38. package/components/form/Radio/RadioElement.d.ts +3 -2
  39. package/components/form/Radio/RadioElement.js +72 -3
  40. package/components/form/Radio/index.d.ts +1 -1
  41. package/components/form/SearchInput/index.d.ts +24 -2
  42. package/components/form/SearchInput/index.js +3 -2
  43. package/components/form/SelectInput/Control.d.ts +4 -10
  44. package/components/form/SelectInput/Control.js +5 -8
  45. package/components/form/SelectInput/DropdownIndicator.d.ts +3 -10
  46. package/components/form/SelectInput/IndicatorsContainer.d.ts +2 -6
  47. package/components/form/SelectInput/IndicatorsContainer.js +1 -1
  48. package/components/form/SelectInput/MenuList.d.ts +3 -10
  49. package/components/form/SelectInput/MenuList.js +2 -1
  50. package/components/form/SelectInput/Option.d.ts +6 -18
  51. package/components/form/SelectInput/ValueContainer.d.ts +5 -14
  52. package/components/form/SelectInput/ValueContainer.js +1 -1
  53. package/components/form/SelectInput/VirtualMenuList.d.ts +2 -5
  54. package/components/form/SelectInput/VirtualMenuList.js +2 -1
  55. package/components/form/SelectInput/index.d.ts +7 -16
  56. package/components/form/SelectInput/index.js +10 -2
  57. package/components/form/index.d.ts +1 -0
  58. package/components/form/index.js +1 -0
  59. package/components/layout/Box/index.d.ts +1 -4
  60. package/components/layout/Drawer/index.d.ts +17 -2
  61. package/components/layout/Drawer/index.js +45 -36
  62. package/components/layout/Flex/index.d.ts +2 -5
  63. package/components/layout/Popin/index.d.ts +6 -11
  64. package/components/layout/Popin/index.js +10 -5
  65. package/components/layout/Side/index.d.ts +0 -1
  66. package/components/loaders/InfiniteLoader/index.d.ts +8 -7
  67. package/components/loaders/InfiniteLoader/index.js +35 -9
  68. package/components/loaders/ProgressLoader/index.d.ts +22 -2
  69. package/components/loaders/ProgressLoader/index.js +10 -12
  70. package/components/message/Alert/index.d.ts +31 -3
  71. package/components/message/Alert/index.js +30 -23
  72. package/components/message/Log/index.d.ts +5 -2
  73. package/components/message/Log/index.js +3 -4
  74. package/components/message/Tip/index.d.ts +0 -1
  75. package/components/message/Tooltip/index.d.ts +0 -1
  76. package/components/navigation/Aside/index.d.ts +2 -5
  77. package/components/navigation/Breadcrumb/index.js +1 -1
  78. package/components/navigation/FlowStepper/index.d.ts +77 -0
  79. package/components/navigation/FlowStepper/index.js +35 -0
  80. package/components/navigation/index.d.ts +1 -0
  81. package/components/navigation/index.js +1 -0
  82. package/components/navigation/progress/ProgressBar/Onboarding.d.ts +0 -1
  83. package/components/navigation/progress/Stepper/index.d.ts +27 -10
  84. package/components/navigation/progress/Stepper/index.js +37 -18
  85. package/components/navigation/sideBar/Item/Item.d.ts +0 -1
  86. package/components/navigation/sideBar/Logo/Logo.d.ts +0 -1
  87. package/components/navigation/sideBar/SideBar/SideBar.d.ts +0 -1
  88. package/components/navigation/sideBar/SideBar/SideBar.js +9 -7
  89. package/components/navigation/sideBar/Toggle/Toggle.d.ts +0 -1
  90. package/components/styled.d.ts +8 -5
  91. package/components/styled.js +2 -2
  92. package/index.d.ts +1 -1
  93. package/index.js +1 -1
  94. package/package.json +6 -6
  95. package/styles/InvertTheme.d.ts +4 -1
  96. package/styles/InvertTheme.js +5 -5
  97. package/styles/index.d.ts +1 -0
  98. package/styles/index.js +1 -0
  99. package/styles/theme.d.ts +1 -1
  100. package/styles/theme.js +8 -8
  101. package/components/loaders/InfiniteLoader/image.d.ts +0 -2
  102. package/components/loaders/InfiniteLoader/image.js +0 -1
@@ -42,10 +42,11 @@ function deserialize(value) {
42
42
  return undefined;
43
43
  }
44
44
  }
45
- export default function NumberInput(_a) {
45
+ function NumberInput(_a, ref) {
46
46
  var { value, onPercentClick, max, disabled } = _a, inputProps = __rest(_a, ["value", "onPercentClick", "max", "disabled"]);
47
- return (React.createElement(Input, Object.assign({ serialize: serialize, deserialize: deserialize }, inputProps, { type: "number", value: value, max: max, disabled: disabled, renderRight: React.createElement(FlexBox, { alignItems: "center", justifyContent: "center", py: "3px", mr: "8px" }, [0.25, 0.5, 0.75, 1].map((percent) => (React.createElement(MaxButton, { key: percent, onClick: () => onPercentClick(percent), active: !!value && !!max && Number(value) === percent * Number(max), disabled: disabled },
47
+ return (React.createElement(Input, Object.assign({ ref: ref, serialize: serialize, deserialize: deserialize }, inputProps, { type: "number", value: value, max: max, disabled: disabled, renderRight: React.createElement(FlexBox, { alignItems: "center", justifyContent: "center", py: "3px", mr: "8px" }, [0.25, 0.5, 0.75, 1].map((percent) => (React.createElement(MaxButton, { key: percent, onClick: () => onPercentClick(percent), active: !!value && !!max && Number(value) === percent * Number(max), disabled: disabled },
48
48
  React.createElement(Text, { variant: "tiny", color: "inherit" },
49
49
  percent * 100,
50
50
  "%"))))) })));
51
51
  }
52
+ export default React.forwardRef(NumberInput);
@@ -1,5 +1,27 @@
1
1
  import React from "react";
2
2
  import { InputProps } from "../BaseInput";
3
- export default function QrCodeInput({ onQrCodeClick, ...inputProps }: InputProps & {
4
- onQrCodeClick?: (e: React.FormEvent<HTMLButtonElement>) => void;
5
- }): JSX.Element;
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
+ } & {
25
+ onQrCodeClick?: ((e: React.FormEvent<HTMLButtonElement>) => void) | undefined;
26
+ } & React.RefAttributes<HTMLInputElement>>;
27
+ export default _default;
@@ -32,9 +32,10 @@ const QrCodeButton = styled.button `
32
32
  cursor: unset;
33
33
  }
34
34
  `;
35
- export default function QrCodeInput(_a) {
35
+ function QrCodeInput(_a, ref) {
36
36
  var { onQrCodeClick } = _a, inputProps = __rest(_a, ["onQrCodeClick"]);
37
- return (React.createElement(Input, Object.assign({}, inputProps, { renderRight: React.createElement(FlexBox, { alignItems: "center", justifyContent: "center", pr: "8px" },
37
+ return (React.createElement(Input, Object.assign({ ref: ref }, inputProps, { renderRight: React.createElement(FlexBox, { alignItems: "center", justifyContent: "center", pr: "8px" },
38
38
  React.createElement(QrCodeButton, { onClick: onQrCodeClick, disabled: inputProps.disabled },
39
39
  React.createElement(QrCodeMedium, { size: "20px" }))) })));
40
40
  }
41
+ export default React.forwardRef(QrCodeInput);
@@ -1,6 +1,28 @@
1
1
  import React from "react";
2
2
  import { InputProps } from "../BaseInput";
3
- export default function QuantityInput({ onMaxClick, price, ...inputProps }: InputProps & {
4
- onMaxClick?: (e: React.FormEvent<HTMLButtonElement>) => void;
5
- price?: string;
6
- }): JSX.Element;
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
+ } & {
25
+ onMaxClick?: ((e: React.FormEvent<HTMLButtonElement>) => void) | undefined;
26
+ price?: string | undefined;
27
+ } & React.RefAttributes<HTMLInputElement>>;
28
+ export default _default;
@@ -37,10 +37,11 @@ const Legend = styled(Text) `
37
37
  color: ${(p) => p.theme.colors.neutral.c50};
38
38
  }
39
39
  `;
40
- export default function QuantityInput(_a) {
40
+ function QuantityInput(_a, ref) {
41
41
  var { onMaxClick, price } = _a, inputProps = __rest(_a, ["onMaxClick", "price"]);
42
- return (React.createElement(Input, Object.assign({}, inputProps, { type: "number", renderRight: React.createElement(FlexBox, { alignItems: "center", justifyContent: "center", pr: "3px", py: "3px" },
42
+ return (React.createElement(Input, Object.assign({ ref: ref }, inputProps, { type: "number", renderRight: React.createElement(FlexBox, { alignItems: "center", justifyContent: "center", pr: "3px", py: "3px" },
43
43
  price && (React.createElement(Legend, { variant: "body", pr: "12px", "data-disabled": inputProps.disabled }, price)),
44
44
  React.createElement(MaxButton, { onClick: onMaxClick, disabled: inputProps.disabled },
45
45
  React.createElement(Text, { variant: "tiny", color: "currentColor" }, "Max"))) })));
46
46
  }
47
+ export default React.forwardRef(QuantityInput);
@@ -1,11 +1,12 @@
1
1
  import { InputHTMLAttributes } from "react";
2
2
  declare type InputAttributes = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "onChange" | "name">;
3
3
  export declare type RadioElementProps = InputAttributes & {
4
- variant?: "default" | "success" | "error";
4
+ variant?: "default" | "main" | "success" | "error";
5
5
  label: string;
6
+ outlined?: boolean;
6
7
  };
7
8
  declare const Element: {
8
- ({ label, value, disabled, variant, ...props }: RadioElementProps): JSX.Element;
9
+ ({ label, value, disabled, outlined, variant, ...props }: RadioElementProps): JSX.Element;
9
10
  displayName: string;
10
11
  };
11
12
  export default Element;
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import React, { useContext, useMemo } from "react";
13
- import styled from "styled-components";
13
+ import styled, { css } from "styled-components";
14
14
  import { rgba } from "../../../styles/helpers";
15
15
  import Text from "../../asorted/Text";
16
16
  import { RadioContext } from "./index";
@@ -25,6 +25,7 @@ const Input = styled.input `
25
25
  appearance: none;
26
26
  width: var(--ledger-ui-checkbox-size);
27
27
  height: var(--ledger-ui-checkbox-size);
28
+ flex-shrink: 0;
28
29
  border-radius: ${(p) => `${p.theme.radii[1]}px`};
29
30
  border: 1px solid var(--ledger-ui-checkbox-color);
30
31
  cursor: pointer;
@@ -60,6 +61,20 @@ const Input = styled.input `
60
61
  }
61
62
  }
62
63
 
64
+ &[data-variant="main"] {
65
+ :hover {
66
+ --ledger-ui-checkbox-color: ${(p) => p.theme.colors.neutral.c90};
67
+ }
68
+ :active,
69
+ :checked,
70
+ :focus {
71
+ --ledger-ui-checkbox-color: ${(p) => p.theme.colors.neutral.c100};
72
+ }
73
+ :focus {
74
+ box-shadow: 0px 0px 0px 4px ${(p) => rgba(p.theme.colors.neutral.c60, 0.48)};
75
+ }
76
+ }
77
+
63
78
  &[data-variant="success"] {
64
79
  :hover,
65
80
  :checked:not([disabled]),
@@ -88,13 +103,67 @@ const Input = styled.input `
88
103
  background-color: ${(p) => p.theme.colors.neutral.c30};
89
104
  }
90
105
  `;
106
+ const outlinedCSS = css `
107
+ padding: 20px;
108
+ border: 1px solid ${(p) => p.theme.colors.neutral.c50};
109
+ border-radius: ${(p) => p.theme.radii[2]}px;
110
+ &[data-variant="default"] {
111
+ :hover {
112
+ border-color: ${(p) => p.theme.colors.primary.c90};
113
+ }
114
+ &[data-checked] :active {
115
+ border-color: ${(p) => p.theme.colors.primary.c100};
116
+ }
117
+ :focus {
118
+ border-color: ${(p) => p.theme.colors.primary.c80};
119
+ }
120
+ }
121
+
122
+ &[data-variant="main"] {
123
+ :hover {
124
+ border-color: ${(p) => p.theme.colors.neutral.c90};
125
+ }
126
+ &[data-checked],
127
+ :active :focus {
128
+ border-color: ${(p) => p.theme.colors.neutral.c100};
129
+ }
130
+ }
131
+
132
+ &[data-variant="success"] {
133
+ &[data-checked]:not([disabled]) {
134
+ border-color: ${(p) => p.theme.colors.success.c100};
135
+ }
136
+ :hover {
137
+ border-color: ${(p) => p.theme.colors.success.c100};
138
+ }
139
+ }
140
+
141
+ &[data-variant="error"] {
142
+ &[data-checked]:not([disabled]) {
143
+ border-color: ${(p) => p.theme.colors.error.c100};
144
+ }
145
+ :hover {
146
+ border-color: ${(p) => p.theme.colors.error.c100};
147
+ }
148
+ }
149
+
150
+ &[data-variant]:disabled {
151
+ border-color: ${(p) => p.theme.colors.neutral.c40};
152
+ cursor: unset;
153
+ }
154
+ `;
91
155
  const RadioElement = styled.label.attrs({ tabIndex: -1 }) `
92
156
  display: inline-flex;
93
157
  column-gap: 0.75rem;
94
158
  align-items: center;
159
+ cursor: pointer;
160
+ &[data-variant]:disabled {
161
+ cursor: unset;
162
+ }
163
+ ${(p) => p.outlined && outlinedCSS}
95
164
  `;
96
165
  const Element = (_a) => {
97
- var { label, value, disabled, variant = "default" } = _a, props = __rest(_a, ["label", "value", "disabled", "variant"]);
166
+ var { label, value, disabled, outlined, variant = "default" } = _a, props = __rest(_a, ["label", "value", "disabled", "outlined", "variant"]);
98
167
  const context = useContext(RadioContext);
99
168
  if (context === undefined)
100
169
  throw new Error("RadioElement must be used within a RadioProvider");
@@ -103,7 +172,7 @@ const Element = (_a) => {
103
172
  const handleChange = (event) => {
104
173
  context.onChange(event.target.value);
105
174
  };
106
- return (React.createElement(RadioElement, null,
175
+ return (React.createElement(RadioElement, Object.assign({ "data-variant": variant }, (isChecked ? { "data-checked": true } : {}), { outlined: outlined }),
107
176
  React.createElement(Input, Object.assign({ type: "radio", "data-variant": variant, checked: isChecked, disabled: disabled, onChange: handleChange, value: value, name: context.name }, props)),
108
177
  React.createElement(Label, { variant: "paragraph" }, label)));
109
178
  };
@@ -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
- /// <reference types="react" />
1
+ import React from "react";
2
2
  import { InputProps } from "../BaseInput";
3
- export default function SearchInput(props: InputProps): JSX.Element;
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
- export default function SearchInput(props) {
5
+ function SearchInput(props, ref) {
6
6
  const theme = useTheme();
7
- return (React.createElement(Input, Object.assign({}, props, { renderLeft: React.createElement(InputRenderLeftContainer, null,
7
+ return (React.createElement(Input, Object.assign({ ref: ref }, props, { renderLeft: React.createElement(InputRenderLeftContainer, null,
8
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
- /// <reference types="react" />
2
- import { Styles, ControlProps, OptionTypeBase } from "react-select";
3
- export declare function getStyles<T extends OptionTypeBase = {
4
- label: string;
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: { isDisabled, error, renderLeft }, children, } = props;
13
- return (React.createElement(Container, { disabled: isDisabled, error: error, focus: isFocused },
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
- /// <reference types="react" />
2
- import { Styles, IndicatorProps, OptionTypeBase } from "react-select";
3
- export declare function getStyles<T extends OptionTypeBase = {
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;
@@ -1,6 +1,2 @@
1
- /// <reference types="react" />
2
- import { IndicatorContainerProps, OptionTypeBase } from "react-select";
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 { selectProps: { renderRight }, } = props;
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
- /// <reference types="react" />
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<T extends OptionTypeBase = {
5
- label: string;
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,8 @@
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.neutral.c20}`, borderRadius: "8px", boxShadow: `0px 2px 12px rgba(0, 0, 0, 0.04)`, background: theme.colors.neutral.c00, color: theme.colors.neutral.c80 }));
4
+ const isLight = theme.colors.type === "light";
5
+ 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[isLight ? "c20" : "c30"]}`, borderRadius: "8px", boxShadow: `0px 6px 12px rgba(0, 0, 0, ${isLight ? 0.04 : 0.08})`, background: theme.colors.neutral[isLight ? "c00" : "c20"], color: theme.colors.neutral.c80 }));
5
6
  }
6
7
  export function MenuList(props) {
7
8
  return React.createElement(components.MenuList, Object.assign({}, props), props.children);
@@ -1,20 +1,8 @@
1
1
  import React from "react";
2
- import { Styles, OptionProps, OptionTypeBase } from "react-select";
3
- export declare function getStyles<T extends OptionTypeBase = {
4
- label: string;
5
- value: string;
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<T extends OptionTypeBase = {
14
- label: string;
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;
@@ -1,17 +1,8 @@
1
1
  import React from "react";
2
- import { Styles, ValueContainerProps, OptionTypeBase } from "react-select";
3
- export declare function getStyles<T extends OptionTypeBase = {
4
- label: string;
5
- value: string;
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<T extends OptionTypeBase = {
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 {};
@@ -7,5 +7,5 @@ export function getStyles() {
7
7
  export function ValueContainer(props) {
8
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 { MenuListComponentProps, OptionTypeBase } from "react-select";
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<T extends OptionTypeBase = {
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: { noOptionsMessage, rowHeight }, } = props;
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,23 +1,14 @@
1
1
  import React from "react";
2
- import { Props as SelectProps, OptionTypeBase, Styles } from "react-select";
3
- export declare type SelfProps<T extends OptionTypeBase = {
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: Props<T, M>) => React.ReactNode;
9
- renderRight?: (props: Props<T, M>) => React.ReactNode;
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;
12
- extendStyles?: (styles: Styles<T, M>) => Styles<T, M>;
9
+ extendStyles?: (styles: StylesConfig<O, M, G>) => StylesConfig<O, M, G>;
13
10
  };
14
- export declare type Props<T extends OptionTypeBase = {
15
- label: string;
16
- value: string;
17
- }, M extends boolean = false> = SelectProps<T, M> & SelfProps<T, M>;
18
- declare function SelectInput<T extends OptionTypeBase = {
19
- label: string;
20
- value: string;
21
- }, M extends boolean = false>({ error, rowHeight, unwrapped, extendStyles, ...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;
22
13
  declare const _default: typeof SelectInput;
23
14
  export default _default;
@@ -20,7 +20,7 @@ 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),
@@ -28,6 +28,12 @@ const stylesFn = (theme) => ({
28
28
  input: (provided) => (Object.assign(Object.assign({}, provided), { color: theme.colors.neutral.c100 })),
29
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) {
@@ -35,7 +41,9 @@ function SelectInput(_a) {
35
41
  const theme = useTheme();
36
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, { error: error, styles: Object.assign(Object.assign({}, styles), props.styles), classNamePrefix: "react-select", rowHeight: rowHeight, components: Object.assign({ Control: ControlModule.Control, ValueContainer: ValueContainerModule.ValueContainer, IndicatorsContainer, DropdownIndicator: DropdownIndicatorModule.DropdownIndicator, MenuList: MenuListModule.MenuList, Option: OptionModule.Option, IndicatorSeparator: null }, components) })));
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,
@@ -1,6 +1,7 @@
1
1
  export { default as Input } from "./BaseInput";
2
2
  export { default as Checkbox } from "./Checkbox";
3
3
  export { default as Dropdown } from "./Dropdown";
4
+ export { default as DropdownGeneric } from "./DropdownGeneric";
4
5
  export { default as LegendInput } from "./LegendInput";
5
6
  export { default as NumberInput } from "./NumberInput";
6
7
  export { default as QrCodeInput } from "./QrCodeInput";
@@ -1,6 +1,7 @@
1
1
  export { default as Input } from "./BaseInput";
2
2
  export { default as Checkbox } from "./Checkbox";
3
3
  export { default as Dropdown } from "./Dropdown";
4
+ export { default as DropdownGeneric } from "./DropdownGeneric";
4
5
  export { default as LegendInput } from "./LegendInput";
5
6
  export { default as NumberInput } from "./NumberInput";
6
7
  export { default as QrCodeInput } from "./QrCodeInput";
@@ -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,13 +1,28 @@
1
1
  import React from "react";
2
+ import { FlexBoxProps } from "../Flex";
3
+ import { Props as DividerProps } from "../../asorted/Divider";
4
+ export declare enum Direction {
5
+ Left = "left",
6
+ Right = "right"
7
+ }
2
8
  export interface DrawerProps {
3
9
  isOpen: boolean;
4
10
  children: React.ReactNode;
5
11
  title?: React.ReactNode;
12
+ footer?: React.ReactNode;
6
13
  big?: boolean;
14
+ ignoreBackdropClick?: boolean;
15
+ backgroundColor?: string;
7
16
  onClose: () => void;
8
17
  onBack?: () => void;
9
18
  setTransitionsEnabled?: (arg0: boolean) => void;
10
19
  hideNavigation?: boolean;
20
+ menuPortalTarget?: Element | null;
21
+ direction?: Direction;
22
+ extraContainerProps?: Partial<FlexBoxProps>;
23
+ extraHeaderProps?: Partial<FlexBoxProps>;
24
+ extraFooterProps?: Partial<FlexBoxProps>;
25
+ extraFooterDividerProps?: Partial<DividerProps>;
11
26
  }
12
- declare const Drawer: ({ children, ...sideProps }: DrawerProps) => React.ReactElement;
13
- export default Drawer;
27
+ declare const _default: React.ForwardRefExoticComponent<DrawerProps & React.RefAttributes<HTMLDivElement>>;
28
+ export default _default;