@ledgerhq/react-ui 0.2.0 → 0.5.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.
Files changed (135) hide show
  1. package/README.md +47 -4
  2. package/assets/logos/LedgerLiveAltRegular.d.ts +0 -1
  3. package/assets/logos/LedgerLiveRegular.d.ts +0 -1
  4. package/components/Chart/index.d.ts +0 -1
  5. package/components/Chart/index.js +1 -1
  6. package/components/Table/Columns.d.ts +62 -13
  7. package/components/Table/Columns.js +8 -18
  8. package/components/Table/index.d.ts +47 -14
  9. package/components/Table/index.js +37 -20
  10. package/components/Table/stories.helper.js +19 -18
  11. package/components/Tag/index.d.ts +18 -5
  12. package/components/Tag/index.js +54 -21
  13. package/components/animations/GlitchText/index.d.ts +6 -0
  14. package/components/animations/GlitchText/index.js +35 -0
  15. package/components/asorted/Divider/index.d.ts +0 -1
  16. package/components/asorted/Divider/index.js +2 -2
  17. package/components/asorted/Icon/BoxedIcon.d.ts +48 -0
  18. package/components/asorted/Icon/BoxedIcon.js +58 -0
  19. package/components/asorted/Icon/Icon.d.ts +0 -1
  20. package/components/asorted/Icon/index.d.ts +2 -0
  21. package/components/asorted/Icon/index.js +2 -0
  22. package/components/asorted/Text/index.d.ts +6 -22
  23. package/components/asorted/Text/index.js +7 -16
  24. package/components/asorted/Text/styles.d.ts +2 -1
  25. package/components/asorted/Text/styles.js +21 -9
  26. package/components/asorted/index.d.ts +1 -1
  27. package/components/asorted/index.js +1 -1
  28. package/components/cards/Carousel/Slide.js +3 -3
  29. package/components/cards/Carousel/index.js +8 -8
  30. package/components/cta/Button/index.d.ts +16 -8
  31. package/components/cta/Button/index.js +76 -65
  32. package/components/cta/Link/index.d.ts +59 -2
  33. package/components/cta/Link/index.js +17 -12
  34. package/components/cta/Toggle/index.d.ts +0 -1
  35. package/components/cta/Toggle/index.js +1 -1
  36. package/components/form/BaseInput/index.d.ts +81 -11
  37. package/components/form/BaseInput/index.js +42 -19
  38. package/components/form/Checkbox/Checkbox.js +12 -9
  39. package/components/form/Dropdown/index.d.ts +0 -1
  40. package/components/form/Dropdown/index.js +2 -2
  41. package/components/form/LegendInput/index.d.ts +26 -2
  42. package/components/form/LegendInput/index.js +5 -4
  43. package/components/form/NumberInput/index.d.ts +25 -3
  44. package/components/form/NumberInput/index.js +19 -7
  45. package/components/form/QrCodeInput/index.d.ts +25 -3
  46. package/components/form/QrCodeInput/index.js +7 -6
  47. package/components/form/QuantityInput/index.d.ts +26 -4
  48. package/components/form/QuantityInput/index.js +9 -8
  49. package/components/form/Radio/RadioElement.d.ts +5 -2
  50. package/components/form/Radio/RadioElement.js +15 -13
  51. package/components/form/Radio/RadioListElement.d.ts +22 -0
  52. package/components/form/Radio/RadioListElement.js +63 -0
  53. package/components/form/Radio/index.d.ts +8 -1
  54. package/components/form/Radio/index.js +2 -0
  55. package/components/form/SearchInput/index.d.ts +24 -2
  56. package/components/form/SearchInput/index.js +4 -3
  57. package/components/form/SelectInput/Control.d.ts +2 -2
  58. package/components/form/SelectInput/Control.js +3 -7
  59. package/components/form/SelectInput/DropdownIndicator.d.ts +0 -1
  60. package/components/form/SelectInput/DropdownIndicator.js +1 -1
  61. package/components/form/SelectInput/IndicatorsContainer.d.ts +0 -1
  62. package/components/form/SelectInput/MenuList.d.ts +0 -1
  63. package/components/form/SelectInput/MenuList.js +1 -1
  64. package/components/form/SelectInput/Option.js +11 -11
  65. package/components/form/SelectInput/ValueContainer.js +1 -1
  66. package/components/form/SelectInput/index.d.ts +3 -2
  67. package/components/form/SelectInput/index.js +5 -5
  68. package/components/form/SplitInput/index.js +5 -5
  69. package/components/form/Switch/Switch.js +8 -8
  70. package/components/helpers.d.ts +2 -2
  71. package/components/layout/Box/index.d.ts +8 -0
  72. package/components/layout/Box/index.js +3 -0
  73. package/components/layout/Drawer/index.d.ts +13 -0
  74. package/components/layout/{Side/Side.js → Drawer/index.js} +12 -12
  75. package/components/layout/Flex/index.d.ts +7 -7
  76. package/components/layout/Flex/index.js +2 -11
  77. package/components/layout/Grid/index.d.ts +3 -2
  78. package/components/layout/Grid/index.js +3 -6
  79. package/components/layout/Popin/index.d.ts +27 -6
  80. package/components/layout/Popin/index.js +65 -41
  81. package/components/layout/Side/index.d.ts +0 -1
  82. package/components/layout/Side/index.js +2 -2
  83. package/components/layout/index.d.ts +2 -0
  84. package/components/layout/index.js +2 -0
  85. package/components/loaders/ProgressLoader/index.d.ts +0 -1
  86. package/components/loaders/ProgressLoader/index.js +3 -3
  87. package/components/message/Alert/index.d.ts +22 -3
  88. package/components/message/Alert/index.js +31 -23
  89. package/components/message/Log/index.js +1 -1
  90. package/components/message/Notification/Badge.js +2 -2
  91. package/components/message/Notification/index.js +4 -6
  92. package/components/message/StatusNotification/index.d.ts +11 -0
  93. package/components/message/StatusNotification/index.js +33 -0
  94. package/components/message/Tip/index.d.ts +7 -0
  95. package/components/message/Tip/index.js +43 -0
  96. package/components/message/Tooltip/index.d.ts +3 -3
  97. package/components/message/Tooltip/index.js +1 -1
  98. package/components/message/Tooltip/styles.js +3 -3
  99. package/components/message/index.d.ts +3 -0
  100. package/components/message/index.js +3 -0
  101. package/components/navigation/Aside/index.d.ts +5 -1
  102. package/components/navigation/Breadcrumb/index.js +6 -6
  103. package/components/navigation/Header/index.d.ts +3 -3
  104. package/components/navigation/progress/ProgressBar/Onboarding.d.ts +0 -1
  105. package/components/navigation/progress/ProgressBar/Onboarding.js +6 -6
  106. package/components/navigation/progress/Stepper/index.js +9 -9
  107. package/components/navigation/sideBar/Item/Item.d.ts +4 -3
  108. package/components/navigation/sideBar/Item/Item.js +34 -16
  109. package/components/navigation/sideBar/Logo/Logo.d.ts +0 -1
  110. package/components/navigation/sideBar/SideBar/SideBar.d.ts +1 -2
  111. package/components/navigation/sideBar/SideBar/SideBar.js +14 -6
  112. package/components/navigation/sideBar/Toggle/Toggle.d.ts +0 -1
  113. package/components/navigation/sideBar/Toggle/Toggle.js +2 -2
  114. package/components/styled.d.ts +16 -0
  115. package/components/styled.js +13 -0
  116. package/components/tabs/Bar/index.js +4 -4
  117. package/components/tabs/Chip/index.d.ts +13 -0
  118. package/components/tabs/Chip/index.js +21 -0
  119. package/components/tabs/Pill/index.js +7 -7
  120. package/components/tabs/Tabs/index.js +8 -7
  121. package/components/tabs/index.d.ts +2 -0
  122. package/components/tabs/index.js +2 -0
  123. package/package.json +4 -4
  124. package/styles/InvertTheme.d.ts +1 -8
  125. package/styles/StyleProvider.d.ts +3 -3
  126. package/styles/StyleProvider.js +3 -3
  127. package/styles/global.d.ts +1 -0
  128. package/styles/global.js +15 -36
  129. package/styles/index.d.ts +0 -1
  130. package/styles/index.js +0 -1
  131. package/styles/theme.d.ts +5 -2
  132. package/styles/theme.js +7 -8
  133. package/components/layout/Side/Side.d.ts +0 -13
  134. package/styles/reset.d.ts +0 -2
  135. package/styles/reset.js +0 -62
@@ -0,0 +1,63 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React, { useContext } from "react";
13
+ import styled from "styled-components";
14
+ import Text from "../../asorted/Text";
15
+ import Flex from "../../layout/Flex";
16
+ import { rgba } from "../../../styles/helpers";
17
+ import { RadioContext } from "./index";
18
+ export const Label = styled(Text) `
19
+ color: ${(p) => p.disabled
20
+ ? p.theme.colors.neutral.c50
21
+ : p.checked
22
+ ? p.theme.colors.primary.c90
23
+ : p.theme.colors.neutral.c100};
24
+ `;
25
+ const Container = styled(Flex) `
26
+ cursor: ${(p) => (p.disabled ? "" : "pointer")};
27
+ justify-content: center;
28
+ align-items: center;
29
+ background-color: ${(p) => (p.checked ? p.theme.colors.primary.c20 : "")};
30
+ border: 1px solid ${(p) => (p.checked ? p.theme.colors.primary.c50 : p.theme.colors.neutral.c40)};
31
+ border-radius: ${(p) => `${p.theme.radii[2]}px`};
32
+ padding: ${(p) => p.theme.space[6]}px;
33
+
34
+ :hover {
35
+ border-color: ${(p) => (p.disabled || p.checked ? "" : p.theme.colors.primary.c80)};
36
+ }
37
+ `;
38
+ const Input = styled.input `
39
+ position: relative;
40
+ appearance: none;
41
+ &:focus ~ ${Container} {
42
+ box-shadow: 0px 0px 0px 4px ${(p) => rgba(p.theme.colors.primary.c60, 0.48)};
43
+ }
44
+ `;
45
+ const RadioListElement = styled.label.attrs({ tabIndex: -1 }) `
46
+ display: inline-flex;
47
+ align-items: center;
48
+ `;
49
+ const ListElement = (_a) => {
50
+ var { label, value, disabled, containerProps } = _a, props = __rest(_a, ["label", "value", "disabled", "containerProps"]);
51
+ const context = useContext(RadioContext);
52
+ if (context === undefined)
53
+ throw new Error("RadioElement must be used within a RadioProvider");
54
+ const isChecked = context.currentValue === value;
55
+ const handleChange = (event) => {
56
+ context.onChange(event.target.value);
57
+ };
58
+ return (React.createElement(RadioListElement, null,
59
+ React.createElement(Input, Object.assign({ type: "radio", checked: isChecked, disabled: disabled, onChange: handleChange, value: value, name: context.name }, props)),
60
+ React.createElement(Container, Object.assign({ checked: isChecked, disabled: disabled }, containerProps), typeof label === "string" ? (React.createElement(Label, { checked: isChecked, disabled: disabled, variant: "paragraph" }, label)) : (React.createElement(label, { checked: isChecked, disabled })))));
61
+ };
62
+ ListElement.displayName = "Radio.ListElement"; // For easy identification in the React devtools & in storybook
63
+ export default ListElement;
@@ -10,6 +10,13 @@ export declare type RadioProps = {
10
10
  export declare const RadioContext: React.Context<Omit<RadioProps, "children" | "containerProps">>;
11
11
  declare const Radio: {
12
12
  ({ currentValue, name, onChange, children, containerProps, }: RadioProps): JSX.Element;
13
- Element: ({ label, value, disabled, variant, ...props }: import("./RadioElement").RadioElementProps) => JSX.Element;
13
+ Element: {
14
+ ({ label, value, disabled, variant, ...props }: import("./RadioElement").RadioElementProps): JSX.Element;
15
+ displayName: string;
16
+ };
17
+ ListElement: {
18
+ ({ label, value, disabled, containerProps, ...props }: import("./RadioListElement").RadioListElementProps): JSX.Element;
19
+ displayName: string;
20
+ };
14
21
  };
15
22
  export default Radio;
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import RadioElement from "./RadioElement";
3
+ import RadioListElement from "./RadioListElement";
3
4
  import Flex from "../../layout/Flex";
4
5
  export const RadioContext = React.createContext({
5
6
  name: "",
@@ -10,4 +11,5 @@ const Radio = ({ currentValue, name, onChange, children, containerProps, }) => {
10
11
  React.createElement(RadioContext.Provider, { value: { currentValue, name, onChange } }, children)));
11
12
  };
12
13
  Radio.Element = RadioElement;
14
+ Radio.ListElement = RadioListElement;
13
15
  export default Radio;
@@ -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,
8
- React.createElement(SearchMedium, { color: props.disabled ? theme.colors.palette.neutral.c50 : theme.colors.palette.neutral.c70 })) })));
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,9 +1,9 @@
1
- /// <reference types="react" />
2
1
  import { Styles, ControlProps, OptionTypeBase } from "react-select";
2
+ import { DefaultTheme } from "styled-components";
3
3
  export declare function getStyles<T extends OptionTypeBase = {
4
4
  label: string;
5
5
  value: string;
6
- }, M extends boolean = false>(): NonNullable<Styles<T, M>["control"]>;
6
+ }, M extends boolean = false>(theme: DefaultTheme): NonNullable<Styles<T, M>["control"]>;
7
7
  export declare function Control<T extends OptionTypeBase = {
8
8
  label: string;
9
9
  value: string;
@@ -1,16 +1,12 @@
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
8
  const { isFocused, selectProps: { isDisabled, error, renderLeft }, children, } = props;
13
- return (React.createElement(Container, { disabled: isDisabled, error: error, focus: isFocused },
9
+ return (React.createElement(InputContainer, { disabled: isDisabled, error: error, focus: isFocused },
14
10
  React.createElement(components.Control, Object.assign({}, props),
15
11
  renderLeft ? renderLeft(props) : null,
16
12
  children)));
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Styles, IndicatorProps, OptionTypeBase } from "react-select";
3
2
  export declare function getStyles<T extends OptionTypeBase = {
4
3
  label: string;
@@ -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.palette.neutral.c60 : theme.colors.palette.neutral.c100;
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,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IndicatorContainerProps, OptionTypeBase } from "react-select";
3
2
  export declare function IndicatorsContainer<T extends OptionTypeBase = {
4
3
  label: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Styles, MenuListComponentProps, OptionTypeBase } from "react-select";
3
2
  import { DefaultTheme } from "styled-components";
4
3
  export declare function getStyles<T extends OptionTypeBase = {
@@ -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.palette.neutral.c20}`, borderRadius: "8px", boxShadow: `0px 2px 12px rgba(0, 0, 0, 0.04)`, background: theme.colors.palette.neutral.c00, color: theme.colors.palette.neutral.c80 }));
4
+ return (provided) => (Object.assign(Object.assign({}, provided), { display: "flex", flexDirection: "column", gap: theme.space[2], padding: theme.space[3], border: `1px solid ${theme.colors.neutral.c20}`, borderRadius: "8px", boxShadow: `0px 2px 12px rgba(0, 0, 0, 0.04)`, background: theme.colors.neutral.c00, color: theme.colors.neutral.c80 }));
5
5
  }
6
6
  export function MenuList(props) {
7
7
  return React.createElement(components.MenuList, Object.assign({}, props), props.children);
@@ -26,34 +26,34 @@ const Wrapper = styled(Text).attrs({ as: "div" }) `
26
26
  const { theme, selected, focus, disabled } = props;
27
27
  if (selected) {
28
28
  return `
29
- color: ${theme.colors.palette.primary.c90};
30
- background: ${theme.colors.palette.primary.c20};
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.palette.neutral.c50};
35
+ color: ${theme.colors.neutral.c50};
36
36
  ${focus
37
37
  ? `&:not(:active) {
38
- background: ${theme.colors.palette.neutral.c20};
38
+ background: ${theme.colors.neutral.c20};
39
39
  }`
40
40
  : ""}
41
41
  `;
42
42
  }
43
43
  return `
44
- color: ${theme.colors.palette.neutral.c80};
44
+ color: ${theme.colors.neutral.c80};
45
45
  &:hover {
46
- color: ${theme.colors.palette.neutral.c100};
47
- background: ${theme.colors.palette.primary.c10};
46
+ color: ${theme.colors.neutral.c100};
47
+ background: ${theme.colors.primary.c10};
48
48
  }
49
49
  &:active {
50
- color: ${theme.colors.palette.neutral.c100};
51
- background: ${theme.colors.palette.primary.c30};
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.palette.neutral.c100};
56
- background: ${theme.colors.palette.primary.c10};
55
+ color: ${theme.colors.neutral.c100};
56
+ background: ${theme.colors.primary.c10};
57
57
  }`
58
58
  : ""}
59
59
  `;
@@ -5,7 +5,7 @@ export function getStyles() {
5
5
  return (provided) => (Object.assign(Object.assign({}, provided), { padding: 0 }));
6
6
  }
7
7
  export function ValueContainer(props) {
8
- const color = props.selectProps.isDisabled ? "palette.neutral.c60" : "palette.neutral.c100";
8
+ const color = props.selectProps.isDisabled ? "neutral.c60" : "neutral.c100";
9
9
  return (React.createElement(components.ValueContainer, Object.assign({}, props),
10
10
  React.createElement(Text, { as: "div", variant: "paragraph", color: color }, props.render ? props.render(props) : props.children)));
11
11
  }
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { Props as SelectProps, OptionTypeBase } from "react-select";
2
+ import { Props as SelectProps, OptionTypeBase, Styles } from "react-select";
3
3
  export declare type SelfProps<T extends OptionTypeBase = {
4
4
  label: string;
5
5
  value: string;
@@ -9,6 +9,7 @@ export declare type SelfProps<T extends OptionTypeBase = {
9
9
  renderRight?: (props: Props<T, M>) => React.ReactNode;
10
10
  rowHeight?: number;
11
11
  unwrapped?: boolean;
12
+ extendStyles?: (styles: Styles<T, M>) => Styles<T, M>;
12
13
  };
13
14
  export declare type Props<T extends OptionTypeBase = {
14
15
  label: string;
@@ -17,6 +18,6 @@ export declare type Props<T extends OptionTypeBase = {
17
18
  declare function SelectInput<T extends OptionTypeBase = {
18
19
  label: string;
19
20
  value: string;
20
- }, M extends boolean = false>({ error, rowHeight, unwrapped, ...props }: Props<T, M>): JSX.Element;
21
+ }, M extends boolean = false>({ error, rowHeight, unwrapped, extendStyles, ...props }: Props<T, M>): JSX.Element;
21
22
  declare const _default: typeof SelectInput;
22
23
  export default _default;
@@ -20,20 +20,20 @@ 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.palette.neutral.c100 })),
29
- placeholder: (provided) => (Object.assign(Object.assign({}, provided), { color: theme.colors.palette.neutral.c60 })),
28
+ input: (provided) => (Object.assign(Object.assign({}, provided), { color: theme.colors.neutral.c100 })),
29
+ placeholder: (provided) => (Object.assign(Object.assign({}, provided), { color: theme.colors.neutral.c60 })),
30
30
  singleValue: (provided) => (Object.assign(Object.assign({}, provided), { color: "inherit" })),
31
31
  menu: (provided) => (Object.assign(Object.assign({}, provided), { border: 0, boxShadow: "none", background: "none" })),
32
32
  });
33
33
  function SelectInput(_a) {
34
- var { error, rowHeight = 48, unwrapped } = _a, props = __rest(_a, ["error", "rowHeight", "unwrapped"]);
34
+ var { error, rowHeight = 48, unwrapped, extendStyles } = _a, props = __rest(_a, ["error", "rowHeight", "unwrapped", "extendStyles"]);
35
35
  const theme = useTheme();
36
- const styles = useMemo(() => stylesFn(theme), [theme]);
36
+ const styles = useMemo(() => (extendStyles ? extendStyles(stylesFn(theme)) : stylesFn(theme)), [theme, extendStyles]);
37
37
  const { isDisabled, components = {} } = props;
38
38
  const innerContent = (React.createElement(Select, Object.assign({}, props, { error: error, styles: Object.assign(Object.assign({}, styles), props.styles), classNamePrefix: "react-select", rowHeight: rowHeight, components: Object.assign({ Control: ControlModule.Control, ValueContainer: ValueContainerModule.ValueContainer, IndicatorsContainer, DropdownIndicator: DropdownIndicatorModule.DropdownIndicator, MenuList: MenuListModule.MenuList, Option: OptionModule.Option, IndicatorSeparator: null }, components) })));
39
39
  if (unwrapped)
@@ -4,19 +4,19 @@ import { InputContainer, InputErrorContainer } from "../BaseInput";
4
4
  function getDividerColor(props) {
5
5
  var _a, _b, _c, _d;
6
6
  if (props.disabled) {
7
- return (_a = props.theme) === null || _a === void 0 ? void 0 : _a.colors.palette.neutral.c40;
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.palette.error.c100;
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.palette.primary.c80;
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.palette.neutral.c40;
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.palette.primary.c80;
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.palette.neutral.c60};
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.palette.neutral.c90};
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.palette.constant.white};
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.palette.neutral.c70};
75
+ background-color: ${(props) => props.theme.colors.neutral.c70};
76
76
  }
77
77
 
78
78
  &:active {
79
- background-color: ${(props) => props.theme.colors.palette.neutral.c80};
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.palette.primary.c80};
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.palette.primary.c90};
91
+ background: ${(props) => props.theme.colors.primary.c90};
92
92
  }
93
93
 
94
94
  :active {
95
- background: ${(props) => props.theme.colors.palette.primary.c100};
95
+ background: ${(props) => props.theme.colors.primary.c100};
96
96
  }
97
97
  }
98
98
  `;
@@ -1,7 +1,7 @@
1
- /// <reference types="react" />
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): JSX.Element;
4
+ (args: Args): React.ReactNode;
5
5
  args?: Partial<Args>;
6
6
  parameters?: unknown;
7
7
  };
@@ -0,0 +1,8 @@
1
+ import { BaseStyledProps } from "../../styled";
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").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
+ columnGap?: string | number | undefined;
5
+ rowGap?: string | number | undefined;
6
+ color?: string | undefined;
7
+ }, never>;
8
+ export default Box;
@@ -0,0 +1,3 @@
1
+ import baseStyled from "../../styled";
2
+ const Box = baseStyled.div ``;
3
+ export default Box;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ export interface DrawerProps {
3
+ isOpen: boolean;
4
+ children: React.ReactNode;
5
+ title?: React.ReactNode;
6
+ big?: boolean;
7
+ onClose: () => void;
8
+ onBack?: () => void;
9
+ setTransitionsEnabled?: (arg0: boolean) => void;
10
+ hideNavigation?: boolean;
11
+ }
12
+ declare const Drawer: ({ children, ...sideProps }: DrawerProps) => React.ReactElement;
13
+ export default Drawer;
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import React, { useCallback } from "react";
13
13
  import ReactDOM from "react-dom";
14
14
  import styled from "styled-components";
15
- import FlexBox from "../../layout/Flex";
15
+ import FlexBox from "../Flex";
16
16
  import Close from "@ledgerhq/icons-ui/react/CloseRegular";
17
17
  import ArrowLeft from "@ledgerhq/icons-ui/react/ArrowLeftRegular";
18
18
  import TransitionSlide from "../../transitions/TransitionSlide";
@@ -22,7 +22,7 @@ const Container = styled(FlexBox) `
22
22
  width: 100%;
23
23
  height: 100%;
24
24
  flex-direction: column;
25
- background-color: ${(p) => p.theme.colors.palette.neutral.c00};
25
+ background-color: ${(p) => p.theme.colors.neutral.c00};
26
26
  padding: ${(p) => p.theme.space[6]}px ${(p) => p.theme.space[12]}px;
27
27
  `;
28
28
  const Header = styled(FlexBox) `
@@ -30,7 +30,7 @@ const Header = styled(FlexBox) `
30
30
  flex-direction: row;
31
31
  justify-content: space-between;
32
32
  align-items: center;
33
- height: ${(p) => p.theme.space[15]}px;
33
+ min-height: ${(p) => p.theme.space[15]}px;
34
34
  `;
35
35
  const Wrapper = styled.div `
36
36
  height: 100%;
@@ -50,7 +50,7 @@ const Overlay = styled.div `
50
50
  width: 100vw;
51
51
  height: 100vh;
52
52
  z-index: 999;
53
- background-color: ${(p) => p.theme.colors.palette.neutral.c100a07};
53
+ background-color: ${(p) => p.theme.colors.neutral.c100a07};
54
54
  `;
55
55
  const ScrollWrapper = styled.div `
56
56
  overflow: scroll;
@@ -68,9 +68,9 @@ const Button = styled.button `
68
68
  background: unset;
69
69
  border: unset;
70
70
  cursor: pointer;
71
- color: ${(p) => p.theme.colors.palette.neutral.c100};
71
+ color: ${(p) => p.theme.colors.neutral.c100};
72
72
  `;
73
- const Drawer = ({ isOpen, title, children, big, onClose, setTransitionsEnabled, onBack, }) => {
73
+ const DrawerContent = ({ isOpen, title, children, big, onClose, setTransitionsEnabled = () => 0, onBack, hideNavigation = true, }) => {
74
74
  const disableChildAnimations = useCallback(() => setTransitionsEnabled(false), [setTransitionsEnabled]);
75
75
  const enableChildAnimations = useCallback(() => setTransitionsEnabled(true), [setTransitionsEnabled]);
76
76
  return (React.createElement(TransitionInOut, { in: isOpen, appear: true, mountOnEnter: true, unmountOnExit: true, onEntering: disableChildAnimations, onEntered: enableChildAnimations, onExiting: disableChildAnimations },
@@ -79,18 +79,18 @@ const Drawer = ({ isOpen, title, children, big, onClose, setTransitionsEnabled,
79
79
  React.createElement(Wrapper, { big: big },
80
80
  React.createElement(Container, null,
81
81
  React.createElement(Header, null,
82
- onBack != null ? (React.createElement(Button, { onClick: onBack },
83
- React.createElement(ArrowLeft, { size: 21 }))) : (React.createElement(ButtonPlaceholder, null)),
84
- React.createElement(Text, null, title) || React.createElement("div", null),
82
+ !hideNavigation && (React.createElement(React.Fragment, null, onBack != null ? (React.createElement(Button, { onClick: onBack },
83
+ React.createElement(ArrowLeft, { size: 21 }))) : (React.createElement(ButtonPlaceholder, null)))),
84
+ (React.createElement(Text, { variant: "h5", flexShrink: 1 }, title)) || React.createElement("div", null),
85
85
  React.createElement(Button, { onClick: onClose },
86
86
  React.createElement(Close, null))),
87
87
  React.createElement(ScrollWrapper, null, children)))))));
88
88
  };
89
- const DrawerWrapper = (_a) => {
89
+ const Drawer = (_a) => {
90
90
  var { children } = _a, sideProps = __rest(_a, ["children"]);
91
91
  const $root = React.useMemo(() => document.querySelector("#ll-side-root"), []);
92
92
  if ($root === null)
93
93
  throw new Error("side root cannot be found");
94
- return ReactDOM.createPortal(React.createElement(Drawer, Object.assign({}, sideProps), children), $root);
94
+ return ReactDOM.createPortal(React.createElement(DrawerContent, Object.assign({}, sideProps), children), $root);
95
95
  };
96
- export default DrawerWrapper;
96
+ export default Drawer;
@@ -1,8 +1,8 @@
1
- import { SpaceProps, FlexboxProps as FlexProps, PositionProps, ColorProps } from "styled-system";
2
- export interface FlexBoxProps extends FlexProps, SpaceProps, PositionProps, ColorProps {
3
- columnGap?: string | number;
4
- rowGap?: string | number;
5
- color?: string;
6
- }
7
- declare const FlexBox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, FlexBoxProps, never>;
1
+ import { BaseStyledProps } from "../../styled";
2
+ export declare type FlexBoxProps = BaseStyledProps;
3
+ declare const FlexBox: 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
+ columnGap?: string | number | undefined;
5
+ rowGap?: string | number | undefined;
6
+ color?: string | undefined;
7
+ }, "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">;
8
8
  export default FlexBox;
@@ -1,12 +1,3 @@
1
- import { flexbox, compose, space, position, color, } from "styled-system";
2
- import styled from "styled-components";
3
- import gapsSystem from "../../../styles/system/gaps";
4
- const FlexBox = styled.div `
5
- display: flex;
6
- ${flexbox};
7
- ${space};
8
- ${position};
9
- ${compose(gapsSystem, flexbox)};
10
- ${color};
11
- `;
1
+ import baseStyled from "../../styled";
2
+ const FlexBox = baseStyled.div.attrs({ display: "flex" }) ``;
12
3
  export default FlexBox;
@@ -1,5 +1,6 @@
1
- import { GridProps, SpaceProps, PositionProps, ColorProps } from "styled-system";
2
- export interface Props extends GridProps, SpaceProps, PositionProps, ColorProps {
1
+ import { GridProps } from "styled-system";
2
+ import { BaseStyledProps } from "../../styled";
3
+ export interface Props extends GridProps, BaseStyledProps {
3
4
  columns?: number | string;
4
5
  rows?: number | string;
5
6
  }
@@ -1,5 +1,5 @@
1
- import styled from "styled-components";
2
- import { grid, space, position, color, } from "styled-system";
1
+ import { grid } from "styled-system";
2
+ import baseStyled from "../../styled";
3
3
  function getColumns(props) {
4
4
  const { columns } = props;
5
5
  return columns === "none" ? columns : `repeat(${columns || 12}, minmax(0, 1fr));`;
@@ -8,13 +8,10 @@ function getRows(props) {
8
8
  const { rows } = props;
9
9
  return !rows ? "initial" : rows === "none" ? rows : `repeat(${rows}, minmax(0, 1fr));`;
10
10
  }
11
- const Grid = styled.div `
11
+ const Grid = baseStyled.div `
12
12
  display: grid;
13
13
  grid-template-columns: ${getColumns};
14
14
  grid-template-rows: ${getRows};
15
15
  ${grid};
16
- ${space};
17
- ${position};
18
- ${color};
19
16
  `;
20
17
  export default Grid;