@ledgerhq/react-ui 0.3.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/README.md +4 -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 +60 -11
  7. package/components/Table/Columns.js +8 -18
  8. package/components/Table/index.d.ts +44 -12
  9. package/components/Table/index.js +36 -16
  10. package/components/Table/stories.helper.js +19 -18
  11. package/components/Tag/index.js +7 -7
  12. package/components/animations/GlitchText/index.d.ts +0 -1
  13. package/components/asorted/Divider/index.d.ts +0 -1
  14. package/components/asorted/Divider/index.js +2 -2
  15. package/components/asorted/Icon/BoxedIcon.d.ts +48 -0
  16. package/components/asorted/Icon/BoxedIcon.js +58 -0
  17. package/components/asorted/Icon/Icon.d.ts +0 -1
  18. package/components/asorted/Icon/index.d.ts +2 -0
  19. package/components/asorted/Icon/index.js +2 -0
  20. package/components/asorted/Text/index.d.ts +2 -0
  21. package/components/asorted/Text/index.js +2 -1
  22. package/components/asorted/index.d.ts +1 -1
  23. package/components/asorted/index.js +1 -1
  24. package/components/cards/Carousel/Slide.js +3 -3
  25. package/components/cards/Carousel/index.js +7 -7
  26. package/components/cta/Button/index.d.ts +12 -10
  27. package/components/cta/Button/index.js +52 -46
  28. package/components/cta/Link/index.d.ts +53 -4
  29. package/components/cta/Link/index.js +15 -11
  30. package/components/cta/Toggle/index.d.ts +0 -1
  31. package/components/form/BaseInput/index.d.ts +8 -14
  32. package/components/form/BaseInput/index.js +13 -13
  33. package/components/form/Checkbox/Checkbox.js +7 -7
  34. package/components/form/Dropdown/index.d.ts +3 -3
  35. package/components/form/Dropdown/index.js +4 -3
  36. package/components/form/LegendInput/index.d.ts +26 -2
  37. package/components/form/LegendInput/index.js +5 -4
  38. package/components/form/NumberInput/index.d.ts +25 -3
  39. package/components/form/NumberInput/index.js +7 -6
  40. package/components/form/QrCodeInput/index.d.ts +25 -3
  41. package/components/form/QrCodeInput/index.js +7 -6
  42. package/components/form/QuantityInput/index.d.ts +26 -4
  43. package/components/form/QuantityInput/index.js +9 -8
  44. package/components/form/Radio/RadioElement.d.ts +3 -2
  45. package/components/form/Radio/RadioElement.js +84 -15
  46. package/components/form/Radio/RadioListElement.js +7 -8
  47. package/components/form/Radio/index.d.ts +1 -1
  48. package/components/form/SearchInput/index.d.ts +24 -2
  49. package/components/form/SearchInput/index.js +4 -3
  50. package/components/form/SelectInput/Control.d.ts +4 -10
  51. package/components/form/SelectInput/Control.js +5 -8
  52. package/components/form/SelectInput/DropdownIndicator.d.ts +3 -10
  53. package/components/form/SelectInput/DropdownIndicator.js +1 -1
  54. package/components/form/SelectInput/IndicatorsContainer.d.ts +2 -6
  55. package/components/form/SelectInput/IndicatorsContainer.js +1 -1
  56. package/components/form/SelectInput/MenuList.d.ts +3 -10
  57. package/components/form/SelectInput/MenuList.js +1 -1
  58. package/components/form/SelectInput/Option.d.ts +6 -18
  59. package/components/form/SelectInput/Option.js +11 -11
  60. package/components/form/SelectInput/ValueContainer.d.ts +5 -14
  61. package/components/form/SelectInput/ValueContainer.js +2 -2
  62. package/components/form/SelectInput/VirtualMenuList.d.ts +2 -5
  63. package/components/form/SelectInput/VirtualMenuList.js +2 -1
  64. package/components/form/SelectInput/index.d.ts +7 -15
  65. package/components/form/SelectInput/index.js +14 -6
  66. package/components/form/SplitInput/index.js +5 -5
  67. package/components/form/Switch/Switch.js +8 -8
  68. package/components/helpers.d.ts +2 -2
  69. package/components/layout/Box/index.d.ts +1 -4
  70. package/components/layout/Drawer/index.d.ts +3 -1
  71. package/components/layout/Drawer/index.js +32 -15
  72. package/components/layout/Flex/index.d.ts +2 -5
  73. package/components/layout/Popin/index.d.ts +5 -13
  74. package/components/layout/Popin/index.js +13 -18
  75. package/components/layout/Side/index.d.ts +0 -1
  76. package/components/loaders/InfiniteLoader/index.d.ts +8 -7
  77. package/components/loaders/InfiniteLoader/index.js +35 -9
  78. package/components/loaders/ProgressLoader/index.d.ts +22 -2
  79. package/components/loaders/ProgressLoader/index.js +10 -12
  80. package/components/message/Alert/index.d.ts +31 -3
  81. package/components/message/Alert/index.js +30 -23
  82. package/components/message/Log/index.js +1 -1
  83. package/components/message/Notification/Badge.js +2 -2
  84. package/components/message/Notification/index.js +4 -6
  85. package/components/message/StatusNotification/index.d.ts +11 -0
  86. package/components/message/StatusNotification/index.js +33 -0
  87. package/components/message/Tip/index.d.ts +0 -1
  88. package/components/message/Tip/index.js +7 -7
  89. package/components/message/Tooltip/index.d.ts +0 -1
  90. package/components/message/Tooltip/index.js +1 -1
  91. package/components/message/Tooltip/styles.js +3 -3
  92. package/components/message/index.d.ts +2 -0
  93. package/components/message/index.js +2 -0
  94. package/components/navigation/Aside/index.d.ts +2 -5
  95. package/components/navigation/Breadcrumb/index.js +6 -6
  96. package/components/navigation/progress/ProgressBar/Onboarding.d.ts +0 -1
  97. package/components/navigation/progress/ProgressBar/Onboarding.js +6 -6
  98. package/components/navigation/progress/Stepper/index.js +9 -9
  99. package/components/navigation/sideBar/Item/Item.d.ts +0 -1
  100. package/components/navigation/sideBar/Item/Item.js +10 -10
  101. package/components/navigation/sideBar/Logo/Logo.d.ts +0 -1
  102. package/components/navigation/sideBar/SideBar/SideBar.d.ts +0 -1
  103. package/components/navigation/sideBar/SideBar/SideBar.js +3 -3
  104. package/components/navigation/sideBar/Toggle/Toggle.d.ts +0 -1
  105. package/components/navigation/sideBar/Toggle/Toggle.js +2 -2
  106. package/components/styled.d.ts +8 -5
  107. package/components/styled.js +2 -2
  108. package/components/tabs/Bar/index.js +3 -3
  109. package/components/tabs/Chip/index.d.ts +13 -0
  110. package/components/tabs/Chip/index.js +21 -0
  111. package/components/tabs/Pill/index.js +6 -6
  112. package/components/tabs/Tabs/index.js +7 -7
  113. package/components/tabs/index.d.ts +1 -0
  114. package/components/tabs/index.js +1 -0
  115. package/index.d.ts +1 -1
  116. package/index.js +1 -1
  117. package/package.json +5 -6
  118. package/styles/InvertTheme.js +1 -1
  119. package/styles/StyleProvider.js +1 -1
  120. package/styles/global.js +15 -36
  121. package/styles/index.d.ts +1 -1
  122. package/styles/index.js +1 -1
  123. package/styles/theme.d.ts +5 -2
  124. package/styles/theme.js +13 -15
  125. package/components/loaders/InfiniteLoader/image.d.ts +0 -2
  126. package/components/loaders/InfiniteLoader/image.js +0 -1
  127. package/styles/reset.d.ts +0 -2
  128. package/styles/reset.js +0 -62
@@ -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;
@@ -1,8 +1,6 @@
1
1
  import React from "react";
2
2
  import { BaseStyledProps } from "../../styled";
3
- export interface PopinProps {
4
- width?: number;
5
- height?: number;
3
+ export interface PopinProps extends BaseStyledProps {
6
4
  isOpen: boolean;
7
5
  children: React.ReactNode;
8
6
  }
@@ -14,28 +12,22 @@ export declare type PopinHeaderProps = BaseStyledProps & {
14
12
  declare const PopinWrapper: {
15
13
  ({ children, ...popinProps }: PopinProps): React.ReactElement;
16
14
  Header: ({ children, onClose, onBack, ...props }: PopinHeaderProps) => JSX.Element;
17
- 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>>> & {
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").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>>> & {
18
16
  columnGap?: string | number | undefined;
19
17
  rowGap?: string | number | undefined;
20
18
  color?: string | undefined;
21
- display?: string | undefined;
22
- position?: string | undefined;
23
- maxHeight?: number | undefined;
24
19
  } & {
25
20
  as: string;
26
21
  flexDirection: string;
27
22
  flex: number;
28
23
  overflow: string;
29
- }, "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">;
30
- 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>>> & {
24
+ }, "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">;
25
+ 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>>> & {
31
26
  columnGap?: string | number | undefined;
32
27
  rowGap?: string | number | undefined;
33
28
  color?: string | undefined;
34
- display?: string | undefined;
35
- position?: string | undefined;
36
- maxHeight?: number | undefined;
37
29
  } & {
38
30
  as: string;
39
- }, "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">;
31
+ }, "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">;
40
32
  };
41
33
  export default PopinWrapper;
@@ -20,16 +20,6 @@ import Button from "../../cta/Button";
20
20
  import TransitionInOut from "../../transitions/TransitionInOut";
21
21
  import TransitionScale from "../../transitions/TransitionScale";
22
22
  const ICON_SIZE = 20;
23
- const Container = styled(Flex).attrs((p) => ({
24
- position: "relative",
25
- flexDirection: "column",
26
- rowGap: 6,
27
- width: "100%",
28
- height: "100%",
29
- paddingY: p.theme.space[10],
30
- paddingX: p.theme.space[12],
31
- backgroundColor: p.theme.colors.palette.neutral.c00,
32
- })) ``;
33
23
  const Wrapper = styled(Flex).attrs((p) => ({
34
24
  flexDirection: "column",
35
25
  alignItems: "stretch",
@@ -41,6 +31,9 @@ const Wrapper = styled(Flex).attrs((p) => ({
41
31
  maxHeight: `${p.theme.sizes.drawer.popin.max.height}px`,
42
32
  maxWidth: `${p.theme.sizes.drawer.popin.max.width}px`,
43
33
  zIndex: p.theme.zIndexes[8],
34
+ p: p.p !== undefined ? p.p : p.theme.space[10],
35
+ rowGap: 6,
36
+ backgroundColor: p.theme.colors.neutral.c00,
44
37
  })) ``;
45
38
  const Overlay = styled(Flex).attrs((p) => ({
46
39
  justifyContent: "center",
@@ -51,7 +44,7 @@ const Overlay = styled(Flex).attrs((p) => ({
51
44
  position: "fixed",
52
45
  top: 0,
53
46
  left: 0,
54
- backgroundColor: p.theme.colors.palette.neutral.c100a07,
47
+ backgroundColor: p.theme.colors.neutral.c100a07,
55
48
  })) ``;
56
49
  const Header = baseStyled.section `
57
50
  display: grid;
@@ -76,16 +69,18 @@ const PopinHeader = (_a) => {
76
69
  var { children, onClose, onBack } = _a, props = __rest(_a, ["children", "onClose", "onBack"]);
77
70
  return (React.createElement(Header, Object.assign({}, props),
78
71
  React.createElement(Flex, null, onBack ? (React.createElement(IconContainer, { onClick: onBack },
79
- React.createElement(ArrowLeftIcon, { size: ICON_SIZE, color: "palette.neutral.c100" }))) : null),
72
+ React.createElement(ArrowLeftIcon, { size: ICON_SIZE, color: "neutral.c100" }))) : null),
80
73
  React.createElement(HeaderTitleContainer, null, children),
81
74
  React.createElement(Flex, null, onClose ? (React.createElement(IconContainer, { onClick: onClose },
82
- React.createElement(CloseIcon, { size: ICON_SIZE, color: "palette.neutral.c100" }))) : null)));
75
+ React.createElement(CloseIcon, { size: ICON_SIZE, color: "neutral.c100" }))) : null)));
76
+ };
77
+ const Popin = (_a) => {
78
+ var { isOpen, children, width, height } = _a, props = __rest(_a, ["isOpen", "children", "width", "height"]);
79
+ return (React.createElement(TransitionInOut, { in: isOpen, appear: true, mountOnEnter: true, unmountOnExit: true },
80
+ React.createElement(Overlay, null,
81
+ React.createElement(TransitionScale, { in: isOpen, appear: true },
82
+ React.createElement(Wrapper, Object.assign({ width: width, height: height }, props), children)))));
83
83
  };
84
- const Popin = ({ isOpen, children, width, height }) => (React.createElement(TransitionInOut, { in: isOpen, appear: true, mountOnEnter: true, unmountOnExit: true },
85
- React.createElement(Overlay, null,
86
- React.createElement(TransitionScale, { in: isOpen, appear: true },
87
- React.createElement(Wrapper, { width: width, height: height },
88
- React.createElement(Container, null, children))))));
89
84
  const PopinWrapper = (_a) => {
90
85
  var { children } = _a, popinProps = __rest(_a, ["children"]);
91
86
  const $root = React.useMemo(() => document.querySelector("#ll-popin-root"), []);
@@ -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/PWNt61d23vsWbvfN6Z85tzfufcc+eZcJHkO7t4xVQfrkeB1bL5fiKsZoCkXQmWVtZl2zHjCAgTujjCy50uXsibOLzp0/QyLoIQFkj27uWBFmN9k7GuIHxUFF0idyNpnSrvQbBtPZ/J73cepNCFrrt4niyHyxIvSPuDY2387+gojWMBZN4B2b+Xr8sYN4syt4kyS1gVUpU5KOfvSZWiHJ7BA+EMILZjtl9XHOw8Ck89UZR4rl3gkbvvpZ9iHmXeAPn2Hl7bZeyQHtchWIFXRN+8PyEqqq5BoY0WoZbgosvMAEYOJCuSE/w5iH3ofsL3ZfnSpu30fcyDXDAg+3fzKlHgd0XhdWT9xYdOLkHeRTxIHqCyOq5tGc+PytbcyQCJylMNQPi+7bj0/6y41D9v/Qy9hQuQ8wbEc0SJjfJgd5v/e17wHEH2kDWlVQlVioPLeAWpV8FkITUX8W6CyrL8erSwxEkc1uFPxn9u3EH/gfOU8wLkucf5iolpPCAXr/IKGBAIWrmy4oDTrMS7zgxATGkXlRLJgArcWj96fuatI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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.palette.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.palette.primary.c60,
17
+ stroke: props.stroke || props.theme.colors.primary.c60,
18
18
  })) ``;
19
- const StyledCenteredText = styled(Text).attrs({
20
- color: "palette.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.palette.warning.c30};
23
- color: ${p.theme.colors.palette.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.palette.error.c30};
28
- color: ${p.theme.colors.palette.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.palette.primary.c20};
34
- color: ${p.theme.colors.palette.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
  }
@@ -19,7 +19,7 @@ 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.palette.neutral.c100};
22
+ color: ${(p) => p.theme.colors.neutral.c100};
23
23
  `;
24
24
  const TextContainer = styled(FlexBox).attrs(() => ({
25
25
  flex: "1",
@@ -20,14 +20,14 @@ const ActiveCircle = styled.div `
20
20
  width: 10px;
21
21
  border-radius: 9999px;
22
22
  box-sizing: content-box;
23
- background-color: ${(p) => p.theme.colors.palette.error.c100};
23
+ background-color: ${(p) => p.theme.colors.error.c100};
24
24
 
25
25
  border: 2px solid
26
26
  var(
27
27
  --notification-badge-border,
28
28
  ${(p) => {
29
29
  /* The CSS variable is dynamically set by the Notification component */
30
- return p.theme.colors.palette.background.main;
30
+ return p.theme.colors.background.main;
31
31
  }}
32
32
  );
33
33
  `;
@@ -23,11 +23,9 @@ const Container = styled(FlexBox).attrs({
23
23
  }) `
24
24
  --notification-badge-border: ${(p) => {
25
25
  /* Set a CSS variable that will be consumed by the Badge component */
26
- return p.hasBackground
27
- ? p.theme.colors.palette.neutral.c30
28
- : p.theme.colors.palette.background.main;
26
+ return p.hasBackground ? p.theme.colors.neutral.c30 : p.theme.colors.background.main;
29
27
  }};
30
- background-color: ${(p) => p.hasBackground ? p.theme.colors.palette.neutral.c30 : "transparent"};
28
+ background-color: ${(p) => (p.hasBackground ? p.theme.colors.neutral.c30 : "transparent")};
31
29
 
32
30
  border-radius: 8px;
33
31
  `;
@@ -36,8 +34,8 @@ function Notification(_a) {
36
34
  return (React.createElement(Container, Object.assign({ hasBackground: hasBackground }, containerProps),
37
35
  badge,
38
36
  React.createElement(FlexBox, { flexDirection: "column", rowGap: 3, flex: "auto" },
39
- React.createElement(Text, { variant: "large", fontWeight: "medium", color: "palette.neutral.c100" }, title),
40
- description && (React.createElement(Text, { variant: "paragraph", fontWeight: "medium", color: "palette.neutral.c80" }, description)),
37
+ React.createElement(Text, { variant: "large", fontWeight: "medium", color: "neutral.c100" }, title),
38
+ description && (React.createElement(Text, { variant: "paragraph", fontWeight: "medium", color: "neutral.c80", whiteSpace: "pre-wrap" }, description)),
41
39
  link && (React.createElement(FlexBox, { justifyContent: "flex-start" },
42
40
  React.createElement(Link, { onClick: (event) => onLinkClick && onLinkClick(event), Icon: ExternalLinkMedium }, link))))));
43
41
  }
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { FlexBoxProps } from "../../layout/Flex";
3
+ interface ContainerProps extends FlexBoxProps {
4
+ hasBorder?: boolean;
5
+ }
6
+ export interface Props extends ContainerProps {
7
+ text: string;
8
+ badge: React.ReactNode;
9
+ }
10
+ declare function StatusNotification({ text, badge, hasBorder, ...containerProps }: Props): JSX.Element;
11
+ export default StatusNotification;
@@ -0,0 +1,33 @@
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";
13
+ import styled from "styled-components";
14
+ import FlexBox from "../../layout/Flex";
15
+ import Log from "../Log/";
16
+ const Container = styled(FlexBox).attrs({
17
+ p: 8,
18
+ rowGap: 9,
19
+ alignItems: "center",
20
+ flexDirection: "column",
21
+ }) `
22
+ border-width: 1px;
23
+ border-style: ${(p) => (p.hasBorder ? "solid" : "none")};
24
+ border-radius: 8px;
25
+ border-color: ${(p) => p.theme.colors.neutral.c40};
26
+ `;
27
+ function StatusNotification(_a) {
28
+ var { text, badge, hasBorder = false } = _a, containerProps = __rest(_a, ["text", "badge", "hasBorder"]);
29
+ return (React.createElement(Container, Object.assign({ hasBorder: hasBorder }, containerProps),
30
+ badge,
31
+ React.createElement(Log, null, text)));
32
+ }
33
+ export default StatusNotification;
@@ -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;
@@ -13,19 +13,19 @@ const StyledIconContainer = styled.div `
13
13
  switch (p.type) {
14
14
  case "warning":
15
15
  return css `
16
- background: ${p.theme.colors.palette.warning.c10};
17
- color: ${p.theme.colors.palette.warning.c100};
16
+ background: ${p.theme.colors.warning.c10};
17
+ color: ${p.theme.colors.warning.c100};
18
18
  `;
19
19
  case "error":
20
20
  return css `
21
- background: ${p.theme.colors.palette.error.c10};
22
- color: ${p.theme.colors.palette.error.c100};
21
+ background: ${p.theme.colors.error.c10};
22
+ color: ${p.theme.colors.error.c100};
23
23
  `;
24
24
  case "success":
25
25
  default:
26
26
  return css `
27
- background: ${p.theme.colors.palette.success.c30};
28
- color: ${p.theme.colors.palette.success.c100};
27
+ background: ${p.theme.colors.success.c30};
28
+ color: ${p.theme.colors.success.c100};
29
29
  `;
30
30
  }
31
31
  }}
@@ -39,5 +39,5 @@ const StyledIconContainer = styled.div `
39
39
  export default function Tip({ type, label }) {
40
40
  return (React.createElement(Flex, { alignItems: "center" },
41
41
  type && React.createElement(StyledIconContainer, { type: type }, icons[type]),
42
- React.createElement(Text, { variant: "paragraph", fontWeight: "medium", color: "palette.neutral.c100", flexShrink: 1 }, label)));
42
+ React.createElement(Text, { variant: "paragraph", fontWeight: "medium", color: "neutral.c100", flexShrink: 1 }, label)));
43
43
  }
@@ -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 {
@@ -36,6 +36,6 @@ const Wrapper = forwardRef((props, ref) => {
36
36
  });
37
37
  export default function Tooltip(props) {
38
38
  const { content, placement = "auto", children } = props, rest = __rest(props, ["content", "placement", "children"]);
39
- return (React.createElement(Tippy, Object.assign({}, rest, { placement: placement, content: React.createElement(Text, { fontWeight: "medium", variant: "paragraph", color: "palette.neutral.c00" }, content) }),
39
+ return (React.createElement(Tippy, Object.assign({}, rest, { placement: placement, content: React.createElement(Text, { fontWeight: "medium", variant: "paragraph", color: "neutral.c00" }, content) }),
40
40
  React.createElement(Wrapper, { children: children })));
41
41
  }
@@ -10,8 +10,8 @@ export default css `
10
10
 
11
11
  .tippy-box {
12
12
  position: relative;
13
- background-color: ${(p) => p.theme.colors.palette.neutral.c100};
14
- color: ${(p) => p.theme.colors.palette.neutral.c00};
13
+ background-color: ${(p) => p.theme.colors.neutral.c100};
14
+ color: ${(p) => p.theme.colors.neutral.c00};
15
15
  border-radius: 4px;
16
16
  font-size: 14px;
17
17
  line-height: 1.4;
@@ -72,7 +72,7 @@ export default css `
72
72
  .tippy-arrow {
73
73
  width: 16px;
74
74
  height: 16px;
75
- color: ${(p) => p.theme.colors.palette.neutral.c100};
75
+ color: ${(p) => p.theme.colors.neutral.c100};
76
76
  }
77
77
 
78
78
  .tippy-arrow:before {
@@ -1,5 +1,7 @@
1
1
  export { default as Alert } from "./Alert";
2
2
  export { default as Log } from "./Log";
3
3
  export { default as Notification } from "./Notification";
4
+ export { default as Badge } from "./Notification/Badge";
4
5
  export { default as Tooltip } from "./Tooltip";
5
6
  export { default as Tip } from "./Tip";
7
+ export { default as StatusNotification } from "./StatusNotification";