@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
@@ -13,29 +13,25 @@ import React, { useCallback } from "react";
13
13
  import ReactDOM from "react-dom";
14
14
  import styled from "styled-components";
15
15
  import FlexBox from "../Flex";
16
- import Close from "@ledgerhq/icons-ui/react/CloseRegular";
16
+ import Divider from "../../asorted/Divider";
17
+ import Close from "@ledgerhq/icons-ui/react/CloseMedium";
17
18
  import ArrowLeft from "@ledgerhq/icons-ui/react/ArrowLeftRegular";
18
19
  import TransitionSlide from "../../transitions/TransitionSlide";
19
20
  import TransitionInOut from "../../transitions/TransitionInOut";
20
21
  import Text from "../../asorted/Text";
22
+ export var Direction;
23
+ (function (Direction) {
24
+ Direction["Left"] = "left";
25
+ Direction["Right"] = "right";
26
+ })(Direction || (Direction = {}));
21
27
  const Container = styled(FlexBox) `
22
28
  width: 100%;
23
29
  height: 100%;
24
30
  flex-direction: column;
25
- background-color: ${(p) => p.theme.colors.neutral.c00};
26
- padding: ${(p) => p.theme.space[6]}px ${(p) => p.theme.space[12]}px;
27
31
  `;
28
- const Header = styled(FlexBox) `
29
- display: flex;
30
- flex-direction: row;
31
- justify-content: space-between;
32
- align-items: center;
33
- min-height: ${(p) => p.theme.space[15]}px;
34
- `;
35
- const Wrapper = styled.div `
32
+ const Wrapper = styled(FlexBox) `
36
33
  height: 100%;
37
34
  width: ${(p) => p.big ? p.theme.sizes.drawer.side.big.width : p.theme.sizes.drawer.side.small.width}px;
38
- display: flex;
39
35
  flex-direction: column;
40
36
  align-items: stretch;
41
37
  justify-content: space-between;
@@ -44,19 +40,15 @@ const Wrapper = styled.div `
44
40
  const Overlay = styled.div `
45
41
  display: flex;
46
42
  position: fixed;
47
- justify-content: flex-end;
43
+ justify-content: ${(p) => (p.direction === Direction.Left ? "flex-end" : "flex-start")};
48
44
  top: 0;
49
45
  left: 0;
50
46
  width: 100vw;
51
47
  height: 100vh;
52
48
  z-index: 999;
53
- background-color: ${(p) => p.theme.colors.neutral.c100a07};
49
+ background-color: ${(p) => p.theme.colors.constant.overlay};
54
50
  `;
55
- const ScrollWrapper = styled.div `
56
- overflow: scroll;
57
- position: relative;
58
- flex: 1;
59
-
51
+ const ScrollWrapper = styled(FlexBox) `
60
52
  &::-webkit-scrollbar {
61
53
  display: none;
62
54
  }
@@ -70,27 +62,44 @@ const Button = styled.button `
70
62
  cursor: pointer;
71
63
  color: ${(p) => p.theme.colors.neutral.c100};
72
64
  `;
73
- const DrawerContent = ({ isOpen, title, children, big, onClose, setTransitionsEnabled = () => 0, onBack, hideNavigation = true, }) => {
65
+ const DrawerContent = React.forwardRef(({ isOpen, title, children, footer, big, onClose, backgroundColor, setTransitionsEnabled = () => 0, onBack, extraContainerProps, extraHeaderProps, extraFooterProps, extraFooterDividerProps, ignoreBackdropClick = false, hideNavigation = true, direction = Direction.Left, }, ref) => {
74
66
  const disableChildAnimations = useCallback(() => setTransitionsEnabled(false), [setTransitionsEnabled]);
75
67
  const enableChildAnimations = useCallback(() => setTransitionsEnabled(true), [setTransitionsEnabled]);
68
+ const handleBackdropClick = useCallback(() => {
69
+ if (!ignoreBackdropClick) {
70
+ onClose();
71
+ }
72
+ }, [onClose, ignoreBackdropClick]);
73
+ const stopClickPropagation = useCallback((e) => {
74
+ e.stopPropagation();
75
+ }, []);
76
76
  return (React.createElement(TransitionInOut, { in: isOpen, appear: true, mountOnEnter: true, unmountOnExit: true, onEntering: disableChildAnimations, onEntered: enableChildAnimations, onExiting: disableChildAnimations },
77
- React.createElement(Overlay, null,
78
- React.createElement(TransitionSlide, { in: isOpen, fixed: true, reverseExit: true, appear: true, mountOnEnter: true, unmountOnExit: true },
79
- React.createElement(Wrapper, { big: big },
77
+ React.createElement(Overlay, { direction: direction, onClick: handleBackdropClick, ref: ref },
78
+ React.createElement(TransitionSlide, { in: isOpen, direction: direction, fixed: true, reverseExit: true, appear: true, mountOnEnter: true, unmountOnExit: true },
79
+ React.createElement(Wrapper, { big: big, onClick: stopClickPropagation, backgroundColor: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : "neutral.c00" },
80
80
  React.createElement(Container, null,
81
- React.createElement(Header, null,
81
+ React.createElement(FlexBox, Object.assign({ justifyContent: "space-between", alignItems: "center", p: 12, pb: 10 }, extraHeaderProps),
82
82
  !hideNavigation && (React.createElement(React.Fragment, null, onBack != null ? (React.createElement(Button, { onClick: onBack },
83
83
  React.createElement(ArrowLeft, { size: 21 }))) : (React.createElement(ButtonPlaceholder, null)))),
84
- (React.createElement(Text, { variant: "h5", flexShrink: 1 }, title)) || React.createElement("div", null),
85
- React.createElement(Button, { onClick: onClose },
86
- React.createElement(Close, null))),
87
- React.createElement(ScrollWrapper, null, children)))))));
88
- };
89
- const Drawer = (_a) => {
90
- var { children } = _a, sideProps = __rest(_a, ["children"]);
91
- const $root = React.useMemo(() => document.querySelector("#ll-side-root"), []);
92
- if ($root === null)
93
- throw new Error("side root cannot be found");
94
- return ReactDOM.createPortal(React.createElement(DrawerContent, Object.assign({}, sideProps), children), $root);
84
+ (React.createElement(Text, { variant: "h3", flex: 1, textAlign: "center" }, title)) || React.createElement("div", null),
85
+ React.createElement(FlexBox, { alignSelf: "flex-start" },
86
+ React.createElement(Button, { onClick: onClose },
87
+ React.createElement(Close, null)))),
88
+ React.createElement(ScrollWrapper, Object.assign({ flexDirection: "column", alignItems: "stretch", overflow: "scroll", position: "relative", p: 12, pt: 0, flex: 1 }, extraContainerProps), children),
89
+ footer && (React.createElement(React.Fragment, null,
90
+ React.createElement(Divider, Object.assign({ variant: "light" }, extraFooterDividerProps)),
91
+ React.createElement(FlexBox, Object.assign({ alignItems: "center", py: 8, px: 12 }, extraFooterProps), footer)))))))));
92
+ });
93
+ const Drawer = (_a, ref) => {
94
+ var { children, menuPortalTarget } = _a, sideProps = __rest(_a, ["children", "menuPortalTarget"]);
95
+ const $root = React.useMemo(() => menuPortalTarget === undefined && typeof document !== undefined
96
+ ? document.querySelector("body")
97
+ : menuPortalTarget, [menuPortalTarget]);
98
+ if (!$root) {
99
+ return (React.createElement(DrawerContent, Object.assign({ ref: ref }, sideProps), children));
100
+ }
101
+ else {
102
+ return ReactDOM.createPortal(React.createElement(DrawerContent, Object.assign({ ref: ref }, sideProps), children), $root);
103
+ }
95
104
  };
96
- export default Drawer;
105
+ export default React.forwardRef(Drawer);
@@ -1,11 +1,8 @@
1
1
  import { BaseStyledProps } from "../../styled";
2
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").OverflowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & {
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
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
- }, "overflow" | "p" | "color" | "left" | "right" | "bottom" | "top" | "size" | "flex" | "padding" | "rowGap" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "verticalAlign" | "width" | "zIndex" | "margin" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "bg">;
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">;
11
8
  export default FlexBox;
@@ -3,6 +3,7 @@ import { BaseStyledProps } from "../../styled";
3
3
  export interface PopinProps extends BaseStyledProps {
4
4
  isOpen: boolean;
5
5
  children: React.ReactNode;
6
+ menuPortalTarget?: Element | null;
6
7
  }
7
8
  export declare type PopinHeaderProps = BaseStyledProps & {
8
9
  onClose?: () => void;
@@ -10,30 +11,24 @@ export declare type PopinHeaderProps = BaseStyledProps & {
10
11
  children: React.ReactNode;
11
12
  };
12
13
  declare const PopinWrapper: {
13
- ({ children, ...popinProps }: PopinProps): React.ReactElement;
14
+ ({ children, menuPortalTarget, ...popinProps }: PopinProps): React.ReactElement;
14
15
  Header: ({ children, onClose, onBack, ...props }: PopinHeaderProps) => JSX.Element;
15
- Body: 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>>> & {
16
+ Body: 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>>> & {
16
17
  columnGap?: string | number | undefined;
17
18
  rowGap?: string | number | undefined;
18
19
  color?: string | undefined;
19
- display?: string | undefined;
20
- position?: string | undefined;
21
- maxHeight?: number | undefined;
22
20
  } & {
23
21
  as: string;
24
22
  flexDirection: string;
25
23
  flex: number;
26
24
  overflow: string;
27
- }, "overflow" | "p" | "color" | "left" | "right" | "bottom" | "top" | "size" | "flex" | "padding" | "as" | "rowGap" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "verticalAlign" | "width" | "zIndex" | "margin" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "bg">;
28
- Footer: 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>>> & {
25
+ }, "overflow" | "p" | "color" | "as" | "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">;
26
+ Footer: 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>>> & {
29
27
  columnGap?: string | number | undefined;
30
28
  rowGap?: string | number | undefined;
31
29
  color?: string | undefined;
32
- display?: string | undefined;
33
- position?: string | undefined;
34
- maxHeight?: number | undefined;
35
30
  } & {
36
31
  as: string;
37
- }, "overflow" | "p" | "color" | "left" | "right" | "bottom" | "top" | "size" | "flex" | "padding" | "as" | "rowGap" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "verticalAlign" | "width" | "zIndex" | "margin" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "bg">;
32
+ }, "overflow" | "p" | "color" | "as" | "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">;
38
33
  };
39
34
  export default PopinWrapper;
@@ -82,11 +82,16 @@ const Popin = (_a) => {
82
82
  React.createElement(Wrapper, Object.assign({ width: width, height: height }, props), children)))));
83
83
  };
84
84
  const PopinWrapper = (_a) => {
85
- var { children } = _a, popinProps = __rest(_a, ["children"]);
86
- const $root = React.useMemo(() => document.querySelector("#ll-popin-root"), []);
87
- if ($root === null)
88
- throw new Error("popin root cannot be found");
89
- return ReactDOM.createPortal(React.createElement(Popin, Object.assign({}, popinProps), children), $root);
85
+ var { children, menuPortalTarget } = _a, popinProps = __rest(_a, ["children", "menuPortalTarget"]);
86
+ const $root = React.useMemo(() => menuPortalTarget === undefined && typeof document !== undefined
87
+ ? document.querySelector("body")
88
+ : menuPortalTarget, [menuPortalTarget]);
89
+ if (!$root) {
90
+ return React.createElement(Popin, Object.assign({}, popinProps), children);
91
+ }
92
+ else {
93
+ return ReactDOM.createPortal(React.createElement(Popin, Object.assign({}, popinProps), children), $root);
94
+ }
90
95
  };
91
96
  PopinWrapper.Header = PopinHeader;
92
97
  PopinWrapper.Body = PopinBody;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface SideProps {
3
2
  onBack?: () => void;
4
3
  }
@@ -1,7 +1,8 @@
1
- declare const InfiniteLoader: import("styled-components").StyledComponent<"img", import("styled-components").DefaultTheme, {
2
- alt: "loading...";
3
- src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAYAAAA4E5OyAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABGvSURBVHgB1Vx9jB3Vdf+dO/Pe2w/veo3jYFQcsJvEmIJUgiMaEtE4xh9AsE0Dq6pVK/VDLeGvqpUqRVUbo/bfqlWiVrRqFZKoquSgYDvEwRhiSClSUqQ0KHECiQifAWPir9317r73Zk7OuffcO/PWNt61d23vsWbvf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4MA0KO4bhGwg2dHi7Ted7C7FOtsB1CaSl8pa4W8g0XIlCj8JbWE3ZLDbu2rynraizDOU58fBvGz5ZnLCggKs/t4v7xBtaKkiuihaToUloFLguWEZX2uQk8KXtlJY8oMwNB+xTeKDTSSFSBJFs6jVqq8qp4w8DQUNyMwEjbyjE58DqOr/9z6uAC5IIBieJ/ktbBGulwJOUnXIXctG1vXa+JgOS2L1lKGFB618q6ZhUKRt5rJU1tp4RFJnB8tlHkXDJvgEQ5uIuXdHOsktXlolDmwSmCktFq6i6lYTfui27iATEw4jnat253BRCaRiEWdTJbhokN8/xp+bwDEuXgTs6Lm7BcRpkjOh8s4bmlirZFwZarrEctJGaqXnmu+EO3s76wLsl2MdzAyaNjmPzezzC+cyeVWABZMEBmiv4EVQYVLWHW4ZzRX4afo2USKRreLcxShAqndV3C3ykhzPbxdzC16kZMrF9/YdwwW/kVde7c2j1PF5EAAAAASUVORK5CYII=";
4
- width: "28";
5
- height: "28";
6
- }, "height" | "width" | "alt" | "src">;
7
- export default InfiniteLoader;
1
+ import React from "react";
2
+ import { SizeProps } from "styled-system";
3
+ declare const Loader: import("styled-components").StyledComponent<"svg", import("styled-components").DefaultTheme, SizeProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Height<import("styled-system").TLengthStyledSystem>>, never>;
4
+ export declare type Props = React.ComponentProps<typeof Loader> & {
5
+ color?: string;
6
+ };
7
+ export default function InfiniteLoader({ size, color, ...extraProps }: Props): JSX.Element;
8
+ export {};
@@ -1,5 +1,17 @@
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 from "react";
1
13
  import styled, { keyframes } from "styled-components";
2
- import image from "./image";
14
+ import { system, size } from "styled-system";
3
15
  const rotate = keyframes `
4
16
  0% {
5
17
  transform: rotate(0deg);
@@ -8,13 +20,27 @@ const rotate = keyframes `
8
20
  transform: rotate(360deg);
9
21
  }
10
22
  `;
11
- const InfiniteLoader = styled.img.attrs({
12
- alt: "loading...",
13
- src: `data:image/png;base64,${image}`,
14
- width: "28",
15
- height: "28",
16
- }) `
23
+ const Loader = styled.svg `
17
24
  animation: ${rotate} 1s linear infinite;
18
- transition: 100ms linear transform;
25
+ ${size}
26
+ ${system({
27
+ stroke: {
28
+ property: "stroke",
29
+ scale: "colors",
30
+ },
31
+ })}
19
32
  `;
20
- export default InfiniteLoader;
33
+ export default function InfiniteLoader(_a) {
34
+ var { size = 38, color = "primary.c50" } = _a, extraProps = __rest(_a, ["size", "color"]);
35
+ return (React.createElement(Loader, Object.assign({ size: size, stroke: color, viewBox: "0 0 38 38", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, extraProps),
36
+ React.createElement("linearGradient", { id: "gradient-start", gradientUnits: "userSpaceOnUse", gradientTransform: "rotate(-20)" },
37
+ React.createElement("stop", { offset: "0", stopColor: "white", stopOpacity: "0.5" }),
38
+ React.createElement("stop", { offset: "1", stopColor: "white", stopOpacity: "1" })),
39
+ React.createElement("linearGradient", { id: "gradient-end", gradientUnits: "userSpaceOnUse", gradientTransform: "rotate(-20)" },
40
+ React.createElement("stop", { offset: "0", stopColor: "white", stopOpacity: "0.5" }),
41
+ React.createElement("stop", { offset: "1", stopColor: "white", stopOpacity: "0" })),
42
+ React.createElement("mask", { id: "gradient-mask", maskUnits: "userSpaceOnUse" },
43
+ React.createElement("rect", { x: "-0", y: "-4", width: "44", height: "22", strokeWidth: "0", fill: "url(#gradient-start)", transform: "rotate(10)" }),
44
+ React.createElement("rect", { x: "0", y: "18", width: "44", height: "21", strokeWidth: "0", fill: "url(#gradient-end)", transform: "rotate(10)" })),
45
+ React.createElement("path", { d: "M34.8807 20.9499C35.3608 17.0398 34.3815 13.09 32.1304 9.85712C29.8793 6.6242 26.5146 4.33541 22.6808 3.42914C18.847 2.52287 14.8136 3.06283 11.3532 4.94559C7.89277 6.82836 5.24858 9.92158 3.92708 13.6328C2.60558 17.344 2.69968 21.4123 4.19135 25.0584C5.68302 28.7045 8.4674 31.6722 12.0112 33.3929C15.5549 35.1137 19.609 35.4666 23.3968 34.384C27.1846 33.3015 30.4398 30.8596 32.5391 27.526", strokeWidth: "6", strokeLinecap: "round", strokeLinejoin: "round", mask: "url(#gradient-mask)" })));
46
+ }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface Props {
3
2
  /**
4
3
  * Radius of the progress ring.
@@ -12,5 +11,26 @@ export interface Props {
12
11
  * Progress of the loader, in percent, between 0 and 100.
13
12
  */
14
13
  progress?: number;
14
+ /**
15
+ * Whether to display the progress, defaults to true.
16
+ */
17
+ showPercentage?: boolean;
18
+ /**
19
+ * Percentage text color
20
+ */
21
+ textColor?: string;
22
+ /**
23
+ * Front stroke color.
24
+ */
25
+ frontStrokeColor?: string;
26
+ /**
27
+ * Front stroke linecap.
28
+ * https://developer.mozilla.org/fr/docs/Web/SVG/Attribute/stroke-linecap
29
+ */
30
+ frontStrokeLinecap?: "butt" | "round";
31
+ /**
32
+ * Background stroke color.
33
+ */
34
+ backgroundStrokeColor?: string;
15
35
  }
16
- export default function ProgressLoader({ radius, stroke, progress, }: Props): JSX.Element;
36
+ export default function ProgressLoader({ radius, stroke, progress, showPercentage, textColor, frontStrokeColor, frontStrokeLinecap, backgroundStrokeColor, }: Props): JSX.Element;
@@ -11,14 +11,12 @@ const StyledCircle = styled.circle.attrs({
11
11
  transform-origin: 50% 50%;
12
12
  `;
13
13
  const StyledCircleBackground = styled(StyledCircle).attrs((props) => ({
14
- stroke: props.theme.colors.primary.c20,
14
+ stroke: props.stroke || props.theme.colors.primary.c20,
15
15
  })) ``;
16
16
  const StyledCircleFront = styled(StyledCircle).attrs((props) => ({
17
- stroke: props.theme.colors.primary.c60,
17
+ stroke: props.stroke || props.theme.colors.primary.c60,
18
18
  })) ``;
19
- const StyledCenteredText = styled(Text).attrs({
20
- color: "primary.c80",
21
- }) `
19
+ const StyledCenteredText = styled(Text) `
22
20
  position: absolute;
23
21
  top: 50%;
24
22
  left: 50%;
@@ -29,18 +27,18 @@ const StyledProgressLoaderContainer = styled.div `
29
27
  display: flex;
30
28
  position: absolute;
31
29
  `;
32
- function ProgressCircleSvg({ radius, stroke, progress, }) {
30
+ function ProgressCircleSvg({ radius, stroke, progress, backgroundStrokeColor, frontStrokeColor, frontStrokeLinecap, }) {
33
31
  const normalizedRadius = radius - stroke / 2;
34
32
  const circumference = normalizedRadius * 2 * Math.PI;
35
33
  const strokeDashoffset = circumference - (progress / 100) * circumference;
36
34
  return (React.createElement("svg", { height: radius * 2, width: radius * 2 },
37
- React.createElement(StyledCircleBackground, { strokeWidth: stroke, strokeDasharray: circumference + " " + circumference, style: { strokeDashoffset: 0 }, r: normalizedRadius }),
38
- React.createElement(StyledCircleFront, { strokeWidth: stroke, strokeDasharray: circumference + " " + circumference, style: { strokeDashoffset }, r: normalizedRadius })));
35
+ React.createElement(StyledCircleBackground, { strokeWidth: stroke, strokeDasharray: circumference + " " + circumference, style: { strokeDashoffset: 0 }, stroke: backgroundStrokeColor, r: normalizedRadius }),
36
+ React.createElement(StyledCircleFront, { strokeWidth: stroke, strokeDasharray: circumference + " " + circumference, style: { strokeDashoffset }, stroke: frontStrokeColor, strokeLinecap: frontStrokeLinecap, r: normalizedRadius })));
39
37
  }
40
- export default function ProgressLoader({ radius = 32, stroke = 6, progress = 0, }) {
38
+ export default function ProgressLoader({ radius = 32, stroke = 6, progress = 0, showPercentage = true, textColor, frontStrokeColor, frontStrokeLinecap, backgroundStrokeColor, }) {
41
39
  return (React.createElement(StyledProgressLoaderContainer, null,
42
- React.createElement(StyledCenteredText, { variant: "body" },
40
+ showPercentage && (React.createElement(StyledCenteredText, { variant: "body", color: textColor || "primary.c80" },
43
41
  progress,
44
- "%"),
45
- React.createElement(ProgressCircleSvg, { radius: radius, stroke: stroke, progress: progress })));
42
+ "%")),
43
+ React.createElement(ProgressCircleSvg, { radius: radius, stroke: stroke, progress: progress, frontStrokeColor: frontStrokeColor, frontStrokeLinecap: frontStrokeLinecap, backgroundStrokeColor: backgroundStrokeColor })));
46
44
  }
@@ -1,9 +1,37 @@
1
- /// <reference types="react" />
1
+ import { TextVariants } from "../../../styles/theme";
2
2
  declare type AlertType = "info" | "warning" | "error";
3
+ declare type RenderProps = (props: {
4
+ color: string;
5
+ textProps: {
6
+ variant?: TextVariants;
7
+ fontWeight?: string;
8
+ };
9
+ }) => JSX.Element;
3
10
  export interface AlertProps {
11
+ /**
12
+ * Affects the colors of the background & text and what icon can be displayed.
13
+ */
4
14
  type?: AlertType;
5
- title: string;
15
+ /**
16
+ * Title of the Alert.
17
+ */
18
+ title?: string;
19
+ /**
20
+ * Method for rendering additional content under the title. `{ color: string; textProps: { variant?: TextVariants; fontWeight?: string } }` is passed as props to easily style text elements.
21
+ */
22
+ renderContent?: RenderProps;
23
+ /**
24
+ * Method for rendering additional content to the right. `{ color: string; textProps: { variant?: TextVariants; fontWeight?: string } }` is passed as props to easily style text elements.
25
+ */
26
+ renderRight?: RenderProps;
27
+ /**
28
+ * Additional props to be passed to the top level container (containing icon + content).
29
+ */
30
+ containerProps?: Record<string, unknown>;
31
+ /**
32
+ * Whether or not to display an icon
33
+ */
6
34
  showIcon?: boolean;
7
35
  }
8
- export default function Alert({ type, title, showIcon }: AlertProps): JSX.Element;
36
+ export default function Alert({ type, title, showIcon, renderContent, renderRight, containerProps, }: AlertProps): JSX.Element;
9
37
  export {};
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
- import styled, { css } from "styled-components";
2
+ import styled, { useTheme } from "styled-components";
3
3
  import Text from "../../asorted/Text";
4
+ import Flex from "../../layout/Flex";
4
5
  import ShieldSecurityMedium from "@ledgerhq/icons-ui/react/ShieldSecurityMedium";
5
6
  import CircledCrossMedium from "@ledgerhq/icons-ui/react/CircledCrossMedium";
6
7
  import CircledAlertMedium from "@ledgerhq/icons-ui/react/CircledAlertMedium";
@@ -14,35 +15,41 @@ const icons = {
14
15
  warning: React.createElement(CircledAlertMedium, { size: 20 }),
15
16
  error: React.createElement(CircledCrossMedium, { size: 20 }),
16
17
  };
17
- const StyledAlertContainer = styled.div `
18
- ${(p) => {
19
- switch (p.type) {
18
+ const getColors = ({ theme, type }) => {
19
+ switch (type) {
20
20
  case "warning":
21
- return css `
22
- background: ${p.theme.colors.warning.c30};
23
- color: ${p.theme.colors.warning.c100};
24
- `;
21
+ return {
22
+ background: theme.colors.warning.c30,
23
+ color: theme.colors.warning.c100,
24
+ };
25
25
  case "error":
26
- return css `
27
- background: ${p.theme.colors.error.c30};
28
- color: ${p.theme.colors.error.c100};
29
- `;
26
+ return {
27
+ background: theme.colors.error.c30,
28
+ color: theme.colors.error.c100,
29
+ };
30
30
  case "info":
31
31
  default:
32
- return css `
33
- background: ${p.theme.colors.primary.c20};
34
- color: ${p.theme.colors.primary.c90};
35
- `;
32
+ return {
33
+ background: theme.colors.primary.c20,
34
+ color: theme.colors.primary.c90,
35
+ };
36
36
  }
37
- }}
38
-
37
+ };
38
+ const StyledAlertContainer = styled(Flex) `
39
39
  border-radius: ${(p) => `${p.theme.radii[1]}px`};
40
- padding: 16px;
41
- display: flex;
42
40
  align-items: center;
43
41
  `;
44
- export default function Alert({ type = "info", title, showIcon = true }) {
45
- return (React.createElement(StyledAlertContainer, { type: type },
42
+ export default function Alert({ type = "info", title, showIcon = true, renderContent, renderRight, containerProps, }) {
43
+ const theme = useTheme();
44
+ const { color, background } = getColors({ theme, type });
45
+ const textProps = {
46
+ variant: "paragraph",
47
+ fontWeight: "medium",
48
+ };
49
+ return (React.createElement(StyledAlertContainer, Object.assign({ color: color, backgroundColor: background, padding: 6 }, containerProps),
46
50
  showIcon && !!icons[type] && React.createElement(StyledIconContainer, null, icons[type]),
47
- React.createElement(Text, { variant: "body", color: "inherit" }, title)));
51
+ React.createElement(Flex, { flexDirection: "column", flex: 1, alignItems: "flex-start", rowGap: "6px" },
52
+ title && (React.createElement(Text, Object.assign({}, textProps, { color: "inherit" }), title)),
53
+ renderContent && renderContent({ color, textProps })),
54
+ React.createElement(Flex, null, renderRight && renderRight({ color, textProps }))));
48
55
  }
@@ -1,6 +1,9 @@
1
1
  import React from "react";
2
+ import { TextProps } from "../../asorted/Text";
2
3
  import { FlexBoxProps } from "../../layout/Flex";
3
- export declare type Props = React.PropsWithChildren<FlexBoxProps>;
4
- declare function Log({ children, ...props }: Props): JSX.Element;
4
+ export declare type Props = React.PropsWithChildren<FlexBoxProps & {
5
+ extraTextProps?: TextProps;
6
+ }>;
7
+ declare function Log({ children, extraTextProps, ...props }: Props): JSX.Element;
5
8
  declare const _default: React.MemoExoticComponent<typeof Log>;
6
9
  export default _default;
@@ -19,7 +19,6 @@ const Container = styled(FlexBox) `
19
19
  flex-wrap: wrap;
20
20
  align-items: stretch;
21
21
  min-height: ${(p) => p.theme.space[12]}px;
22
- color: ${(p) => p.theme.colors.neutral.c100};
23
22
  `;
24
23
  const TextContainer = styled(FlexBox).attrs(() => ({
25
24
  flex: "1",
@@ -31,11 +30,11 @@ const TextContainer = styled(FlexBox).attrs(() => ({
31
30
  }
32
31
  `;
33
32
  function Log(_a) {
34
- var { children } = _a, props = __rest(_a, ["children"]);
35
- return (React.createElement(Container, Object.assign({}, props),
33
+ var { children, extraTextProps } = _a, props = __rest(_a, ["children", "extraTextProps"]);
34
+ return (React.createElement(Container, Object.assign({ color: "neutral.c100" }, props),
36
35
  React.createElement(BracketLeft, null),
37
36
  React.createElement(TextContainer, { flex: "1", alignItems: "center", justifyContent: "center" },
38
- React.createElement(Text, { variant: "h3", textTransform: "uppercase", textAlign: "center" }, children)),
37
+ React.createElement(Text, Object.assign({ variant: "h3", textTransform: "uppercase", textAlign: "center", color: "inherit" }, extraTextProps), children)),
39
38
  React.createElement(BracketRight, null)));
40
39
  }
41
40
  export default memo(Log);
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare type TipType = "success" | "warning" | "error";
3
2
  export interface TipProps {
4
3
  type?: TipType;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { TippyProps } from "@tippyjs/react";
3
2
  declare type Placement = "top" | "top-start" | "top-end" | "right" | "right-start" | "right-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "auto" | "auto-start" | "auto-end";
4
3
  export interface Props extends TippyProps {
@@ -6,13 +6,10 @@ export declare type Props = React.PropsWithChildren<{
6
6
  }> & React.ComponentProps<typeof Wrapper>;
7
7
  interface ExtraWrapperProps extends ColorProps, LayoutProps, TypographyProps {
8
8
  }
9
- declare const Wrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").OverflowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & {
9
+ declare const Wrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("styled-system").SpaceProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & import("styled-system").FlexboxProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").PositionProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & ColorProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, string | number | symbol> & LayoutProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & import("styled-system").BorderProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>, import("csstype").Property.Border<import("styled-system").TLengthStyledSystem>> & import("styled-system").OverflowProps<Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> & {
10
10
  columnGap?: string | number | undefined;
11
11
  rowGap?: string | number | undefined;
12
12
  color?: string | undefined;
13
- display?: string | undefined;
14
- position?: string | undefined;
15
- maxHeight?: number | undefined;
16
- } & ExtraWrapperProps, "overflow" | "p" | "color" | "left" | "right" | "bottom" | "top" | "size" | "flex" | "padding" | "rowGap" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "verticalAlign" | "width" | "zIndex" | "margin" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "bg">;
13
+ } & ExtraWrapperProps, "overflow" | "p" | "color" | "size" | "rowGap" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflowX" | "overflowY" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "top" | "verticalAlign" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderStyle" | "borderTop" | "borderWidth" | "flex" | "margin" | "padding" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "bg" | "borderX" | "borderY">;
17
14
  export default function Aside({ header, footer, children, ...props }: Props): JSX.Element;
18
15
  export {};
@@ -28,7 +28,7 @@ export default memo(function Breadcrumb({ segments, onChange }) {
28
28
  renderArray.push(React.createElement(React.Fragment, null,
29
29
  index > 0 ? (React.createElement(Text, { fontWeight: "semiBold", color: "neutral.c40", variant: "paragraph" }, "/")) : null,
30
30
  isMultiSegment(segment) ? (React.createElement(Dropdown, { label: "", options: segment.options, value: segment.value, onChange: (elt) => elt && onChange([...values, elt.value]), styles: {
31
- control: (provided, state) => (Object.assign(Object.assign({}, ControlModule.getStyles()(provided, state)), { cursor: "pointer" })),
31
+ control: (provided, state) => (Object.assign(Object.assign({}, ControlModule.getStyles(theme)(provided, state)), { cursor: "pointer" })),
32
32
  singleValue: (provided) => (Object.assign(Object.assign({}, provided), { margin: 0, top: undefined, position: undefined, overflow: undefined, maxWidth: undefined, transform: undefined, color: theme.colors.neutral.c80, ":hover": {
33
33
  color: theme.colors.neutral.c100,
34
34
  textDecoration: "underline",