@ledgerhq/react-ui 0.2.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/README.md +47 -4
  2. package/assets/logos/LedgerLiveAltRegular.d.ts +0 -1
  3. package/assets/logos/LedgerLiveRegular.d.ts +0 -1
  4. package/components/Chart/index.d.ts +0 -1
  5. package/components/Chart/index.js +1 -1
  6. package/components/Table/Columns.d.ts +62 -13
  7. package/components/Table/Columns.js +8 -18
  8. package/components/Table/index.d.ts +47 -14
  9. package/components/Table/index.js +37 -20
  10. package/components/Table/stories.helper.js +19 -18
  11. package/components/Tag/index.d.ts +18 -5
  12. package/components/Tag/index.js +54 -21
  13. package/components/animations/GlitchText/index.d.ts +6 -0
  14. package/components/animations/GlitchText/index.js +35 -0
  15. package/components/asorted/Divider/index.d.ts +0 -1
  16. package/components/asorted/Divider/index.js +2 -2
  17. package/components/asorted/Icon/BoxedIcon.d.ts +48 -0
  18. package/components/asorted/Icon/BoxedIcon.js +58 -0
  19. package/components/asorted/Icon/Icon.d.ts +0 -1
  20. package/components/asorted/Icon/index.d.ts +2 -0
  21. package/components/asorted/Icon/index.js +2 -0
  22. package/components/asorted/Text/index.d.ts +6 -22
  23. package/components/asorted/Text/index.js +7 -16
  24. package/components/asorted/Text/styles.d.ts +2 -1
  25. package/components/asorted/Text/styles.js +21 -9
  26. package/components/asorted/index.d.ts +1 -1
  27. package/components/asorted/index.js +1 -1
  28. package/components/cards/Carousel/Slide.js +3 -3
  29. package/components/cards/Carousel/index.js +8 -8
  30. package/components/cta/Button/index.d.ts +16 -8
  31. package/components/cta/Button/index.js +76 -65
  32. package/components/cta/Link/index.d.ts +59 -2
  33. package/components/cta/Link/index.js +17 -12
  34. package/components/cta/Toggle/index.d.ts +0 -1
  35. package/components/cta/Toggle/index.js +1 -1
  36. package/components/form/BaseInput/index.d.ts +81 -11
  37. package/components/form/BaseInput/index.js +42 -19
  38. package/components/form/Checkbox/Checkbox.js +12 -9
  39. package/components/form/Dropdown/index.d.ts +0 -1
  40. package/components/form/Dropdown/index.js +2 -2
  41. package/components/form/LegendInput/index.d.ts +26 -2
  42. package/components/form/LegendInput/index.js +5 -4
  43. package/components/form/NumberInput/index.d.ts +25 -3
  44. package/components/form/NumberInput/index.js +19 -7
  45. package/components/form/QrCodeInput/index.d.ts +25 -3
  46. package/components/form/QrCodeInput/index.js +7 -6
  47. package/components/form/QuantityInput/index.d.ts +26 -4
  48. package/components/form/QuantityInput/index.js +9 -8
  49. package/components/form/Radio/RadioElement.d.ts +5 -2
  50. package/components/form/Radio/RadioElement.js +15 -13
  51. package/components/form/Radio/RadioListElement.d.ts +22 -0
  52. package/components/form/Radio/RadioListElement.js +63 -0
  53. package/components/form/Radio/index.d.ts +8 -1
  54. package/components/form/Radio/index.js +2 -0
  55. package/components/form/SearchInput/index.d.ts +24 -2
  56. package/components/form/SearchInput/index.js +4 -3
  57. package/components/form/SelectInput/Control.d.ts +2 -2
  58. package/components/form/SelectInput/Control.js +3 -7
  59. package/components/form/SelectInput/DropdownIndicator.d.ts +0 -1
  60. package/components/form/SelectInput/DropdownIndicator.js +1 -1
  61. package/components/form/SelectInput/IndicatorsContainer.d.ts +0 -1
  62. package/components/form/SelectInput/MenuList.d.ts +0 -1
  63. package/components/form/SelectInput/MenuList.js +1 -1
  64. package/components/form/SelectInput/Option.js +11 -11
  65. package/components/form/SelectInput/ValueContainer.js +1 -1
  66. package/components/form/SelectInput/index.d.ts +3 -2
  67. package/components/form/SelectInput/index.js +5 -5
  68. package/components/form/SplitInput/index.js +5 -5
  69. package/components/form/Switch/Switch.js +8 -8
  70. package/components/helpers.d.ts +2 -2
  71. package/components/layout/Box/index.d.ts +8 -0
  72. package/components/layout/Box/index.js +3 -0
  73. package/components/layout/Drawer/index.d.ts +13 -0
  74. package/components/layout/{Side/Side.js → Drawer/index.js} +12 -12
  75. package/components/layout/Flex/index.d.ts +7 -7
  76. package/components/layout/Flex/index.js +2 -11
  77. package/components/layout/Grid/index.d.ts +3 -2
  78. package/components/layout/Grid/index.js +3 -6
  79. package/components/layout/Popin/index.d.ts +27 -6
  80. package/components/layout/Popin/index.js +65 -41
  81. package/components/layout/Side/index.d.ts +0 -1
  82. package/components/layout/Side/index.js +2 -2
  83. package/components/layout/index.d.ts +2 -0
  84. package/components/layout/index.js +2 -0
  85. package/components/loaders/ProgressLoader/index.d.ts +0 -1
  86. package/components/loaders/ProgressLoader/index.js +3 -3
  87. package/components/message/Alert/index.d.ts +22 -3
  88. package/components/message/Alert/index.js +31 -23
  89. package/components/message/Log/index.js +1 -1
  90. package/components/message/Notification/Badge.js +2 -2
  91. package/components/message/Notification/index.js +4 -6
  92. package/components/message/StatusNotification/index.d.ts +11 -0
  93. package/components/message/StatusNotification/index.js +33 -0
  94. package/components/message/Tip/index.d.ts +7 -0
  95. package/components/message/Tip/index.js +43 -0
  96. package/components/message/Tooltip/index.d.ts +3 -3
  97. package/components/message/Tooltip/index.js +1 -1
  98. package/components/message/Tooltip/styles.js +3 -3
  99. package/components/message/index.d.ts +3 -0
  100. package/components/message/index.js +3 -0
  101. package/components/navigation/Aside/index.d.ts +5 -1
  102. package/components/navigation/Breadcrumb/index.js +6 -6
  103. package/components/navigation/Header/index.d.ts +3 -3
  104. package/components/navigation/progress/ProgressBar/Onboarding.d.ts +0 -1
  105. package/components/navigation/progress/ProgressBar/Onboarding.js +6 -6
  106. package/components/navigation/progress/Stepper/index.js +9 -9
  107. package/components/navigation/sideBar/Item/Item.d.ts +4 -3
  108. package/components/navigation/sideBar/Item/Item.js +34 -16
  109. package/components/navigation/sideBar/Logo/Logo.d.ts +0 -1
  110. package/components/navigation/sideBar/SideBar/SideBar.d.ts +1 -2
  111. package/components/navigation/sideBar/SideBar/SideBar.js +14 -6
  112. package/components/navigation/sideBar/Toggle/Toggle.d.ts +0 -1
  113. package/components/navigation/sideBar/Toggle/Toggle.js +2 -2
  114. package/components/styled.d.ts +16 -0
  115. package/components/styled.js +13 -0
  116. package/components/tabs/Bar/index.js +4 -4
  117. package/components/tabs/Chip/index.d.ts +13 -0
  118. package/components/tabs/Chip/index.js +21 -0
  119. package/components/tabs/Pill/index.js +7 -7
  120. package/components/tabs/Tabs/index.js +8 -7
  121. package/components/tabs/index.d.ts +2 -0
  122. package/components/tabs/index.js +2 -0
  123. package/package.json +4 -4
  124. package/styles/InvertTheme.d.ts +1 -8
  125. package/styles/StyleProvider.d.ts +3 -3
  126. package/styles/StyleProvider.js +3 -3
  127. package/styles/global.d.ts +1 -0
  128. package/styles/global.js +15 -36
  129. package/styles/index.d.ts +0 -1
  130. package/styles/index.js +0 -1
  131. package/styles/theme.d.ts +5 -2
  132. package/styles/theme.js +7 -8
  133. package/components/layout/Side/Side.d.ts +0 -13
  134. package/styles/reset.d.ts +0 -2
  135. package/styles/reset.js +0 -62
@@ -10,50 +10,83 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import React from "react";
13
- import styled from "styled-components";
14
- import { border, space, color } from "styled-system";
13
+ import { border } from "styled-system";
15
14
  import Text from "../asorted/Text";
16
- function getColor({ type, active }) {
15
+ import baseStyled from "../styled";
16
+ function getColor({ type, active, disabled }) {
17
17
  switch (type) {
18
- case "opacity":
19
- case "outlined":
20
- return "palette.primary.c90";
18
+ case "plain":
19
+ if (disabled)
20
+ return active ? "neutral.c00" : "neutral.c70";
21
+ return active ? "neutral.c00" : "primary.c90";
21
22
  default:
22
- return active ? "palette.neutral.c00" : "palette.primary.c90";
23
+ return disabled ? "neutral.c70" : "primary.c90";
23
24
  }
24
25
  }
25
- function getBgColor({ type, active }) {
26
+ function getBgColor({ type, active, disabled }) {
26
27
  switch (type) {
28
+ case "plain":
29
+ return active ? (disabled ? "neutral.c70" : "primary.c90") : undefined;
27
30
  case "opacity":
28
- return active ? "palette.primary.c20" : undefined;
29
- case "outlined":
31
+ return active ? (disabled ? "neutral.c30" : "primary.c20") : undefined;
32
+ default:
30
33
  return;
34
+ }
35
+ }
36
+ function getBorderColor({ type, active, disabled }) {
37
+ if (!active)
38
+ return;
39
+ switch (type) {
40
+ case "outlined":
41
+ return disabled ? "neutral.c70" : "primary.c90";
42
+ case "outlinedOpacity":
43
+ return disabled ? "neutral.c40" : "primary.c40";
44
+ }
45
+ }
46
+ function getPadding({ size }) {
47
+ switch (size) {
48
+ case "small":
49
+ return "3px 5px";
50
+ case "medium":
51
+ return "6px 8px";
52
+ case "large":
31
53
  default:
32
- return active ? "palette.primary.c90" : undefined;
54
+ return "9px 10px 10px";
33
55
  }
34
56
  }
35
- function getBorderColor({ type, active }) {
36
- if (type === "outlined" && active) {
37
- return "palette.primary.c90";
57
+ function getTextProps({ size }) {
58
+ switch (size) {
59
+ case "small":
60
+ case "medium":
61
+ return {
62
+ variant: "tiny",
63
+ fontWeight: "semiBold",
64
+ uppercase: true,
65
+ };
66
+ case "large":
67
+ default:
68
+ return {
69
+ variant: "extraSmall",
70
+ fontWeight: "semiBold",
71
+ };
38
72
  }
39
73
  }
40
- const TagContainer = styled.div.attrs((props) => ({
74
+ const TagContainer = baseStyled.div.attrs((props) => ({
41
75
  backgroundColor: props.bg || props.backgroundColor || getBgColor(props),
42
76
  color: props.color || getColor(props),
43
77
  borderColor: getBorderColor(props),
44
- p: "7px", // TODO: use spacing from the theme when it gets updated
45
78
  })) `
46
79
  display: inline-flex;
47
80
  justify-content: center;
48
81
  border: 1px solid transparent;
49
82
  border-radius: ${(p) => `${p.theme.radii[1]}px`};
83
+ padding: ${(p) => getPadding(p)};
50
84
  ${border}
51
- ${space}
52
- ${color}
53
85
  `;
54
86
  export default function Tag(_a) {
55
- var { children } = _a, props = __rest(_a, ["children"]);
87
+ var { children, textProps, size = "large" } = _a, props = __rest(_a, ["children", "textProps", "size"]);
56
88
  const textColor = getColor(props);
57
- return (React.createElement(TagContainer, Object.assign({}, props),
58
- React.createElement(Text, { variant: "tiny", color: textColor }, children)));
89
+ const baseTextProps = getTextProps(Object.assign({ size }, props));
90
+ return (React.createElement(TagContainer, Object.assign({ size: size }, props),
91
+ React.createElement(Text, Object.assign({}, baseTextProps, { color: textColor }, (textProps ? textProps : {})), children)));
59
92
  }
@@ -0,0 +1,6 @@
1
+ export interface GlitchTextProps {
2
+ text: string;
3
+ duration?: number;
4
+ delay?: number;
5
+ }
6
+ export default function GlitchText({ text, duration, delay }: GlitchTextProps): JSX.Element;
@@ -0,0 +1,35 @@
1
+ import React, { useEffect, useState } from "react";
2
+ function makeRandomString(length) {
3
+ let result = "";
4
+ const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
5
+ const charactersLength = characters.length;
6
+ for (let i = 0; i < length; i++) {
7
+ result += characters.charAt(Math.floor(Math.random() * charactersLength));
8
+ }
9
+ return result;
10
+ }
11
+ const INTERVAL = 77;
12
+ export default function GlitchText({ text, duration = 800, delay = 500 }) {
13
+ const [shownText, setShownText] = useState(text);
14
+ useEffect(() => {
15
+ let frameT = 0;
16
+ const startFrame = Math.floor((1 + delay) / INTERVAL);
17
+ const totalFrames = Math.floor((delay + duration) / INTERVAL);
18
+ const interval = setInterval(() => {
19
+ if (frameT >= startFrame) {
20
+ if (frameT >= totalFrames) {
21
+ setShownText(text);
22
+ clearInterval(interval);
23
+ frameT = 0;
24
+ return;
25
+ }
26
+ const t1 = text.substr(0, -totalFrames + frameT + text.length);
27
+ const t2 = t1.length > 0 ? text.substr(t1.length, text.length) : text;
28
+ setShownText(t1 + makeRandomString(t2.length));
29
+ }
30
+ frameT++;
31
+ }, INTERVAL);
32
+ return () => interval && clearInterval(interval);
33
+ }, [delay, duration, text]);
34
+ return React.createElement(React.Fragment, null, shownText);
35
+ }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare type Props = {
3
2
  variant: "default" | "light";
4
3
  };
@@ -2,11 +2,11 @@ import React from "react";
2
2
  import styled from "styled-components";
3
3
  const Divider = styled.div `
4
4
  display: block;
5
- background: ${(p) => p.theme.colors.palette.neutral.c90};
5
+ background: ${(p) => p.theme.colors.neutral.c90};
6
6
  height: 1px;
7
7
 
8
8
  &[data-variant="light"] {
9
- background: ${(p) => p.theme.colors.palette.neutral.c40};
9
+ background: ${(p) => p.theme.colors.neutral.c40};
10
10
  }
11
11
  `;
12
12
  export default ({ variant = "default" }) => React.createElement(Divider, { "data-variant": variant });
@@ -0,0 +1,48 @@
1
+ import React from "react";
2
+ export declare const DEFAULT_BOX_SIZE = 40;
3
+ export declare const DEFAULT_ICON_SIZE = 16;
4
+ export declare const DEFAULT_BADGE_SIZE = 20;
5
+ export declare type IconProps = {
6
+ size?: number;
7
+ color?: string;
8
+ };
9
+ export declare type IconBoxProps = {
10
+ /**
11
+ * Component that takes `{size?: number; color?: string}` as props. Will be rendered at the top right with the size provided in `badgeSize` or a default size.
12
+ */
13
+ Badge?: React.ComponentType<IconProps> | ((props: IconProps) => JSX.Element);
14
+ /**
15
+ * Color of the border
16
+ */
17
+ borderColor?: string;
18
+ /**
19
+ * Badge color, will be applied to the component provided in the `Badge` prop
20
+ */
21
+ badgeColor?: string;
22
+ /**
23
+ * Badge size, will be applied to the component provided in the `Badge` prop
24
+ */
25
+ badgeSize?: number;
26
+ children?: JSX.Element;
27
+ /**
28
+ * Box size for preview
29
+ */
30
+ size?: number;
31
+ };
32
+ export declare type BoxedIconProps = IconBoxProps & {
33
+ /**
34
+ * Component that takes `{size?: number; color?: string}` as props. Will be rendered at the top right with the size provided in `iconSize` or a default size.
35
+ */
36
+ Icon: React.ComponentType<IconProps> | ((props: IconProps) => JSX.Element);
37
+ /**
38
+ * Icon size, will be applied to the component provided in the `Icon` prop
39
+ */
40
+ iconSize?: number;
41
+ /**
42
+ * Icon color, will be applied to the component provided in the `Icon` prop
43
+ */
44
+ iconColor?: string;
45
+ };
46
+ export declare const IconBox: ({ Badge, size, children, borderColor, badgeColor, badgeSize, }: IconBoxProps) => JSX.Element;
47
+ declare const BoxedIcon: ({ Icon, iconSize, iconColor, ...iconBoxProps }: BoxedIconProps) => JSX.Element;
48
+ export default BoxedIcon;
@@ -0,0 +1,58 @@
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 Flex from "../../layout/Flex";
15
+ export const DEFAULT_BOX_SIZE = 40;
16
+ export const DEFAULT_ICON_SIZE = 16;
17
+ export const DEFAULT_BADGE_SIZE = 20;
18
+ const getTopRightSquareClippedPolygon = (boxSize, rectangleSize) => {
19
+ // clipping path that hides top right square of size `${rectangleSize}px`
20
+ const diff = boxSize - rectangleSize;
21
+ return `polygon(0 0, 0 0, 0 0, ${diff}px 0, ${diff}px ${rectangleSize}px, 100% ${rectangleSize}px, 100% 100%, 100% 100%, 100% 100%, 0 100%, 0 100%, 0 100%)`;
22
+ };
23
+ const Container = styled(Flex).attrs((p) => ({
24
+ heigth: p.size,
25
+ width: p.size,
26
+ alignItems: "center",
27
+ justifyContent: "center",
28
+ position: "relative",
29
+ })) ``;
30
+ const IconBoxBackground = styled(Flex) `
31
+ position: absolute;
32
+ height: ${(p) => p.size}px;
33
+ width: ${(p) => p.size}px;
34
+ ${(p) => {
35
+ return p.hasBadge && `clip-path: ${getTopRightSquareClippedPolygon(p.size, 15)};`;
36
+ }};
37
+ border-radius: ${(p) => p.theme.radii[2]}px;
38
+ `;
39
+ const BadgeContainer = styled.div `
40
+ position: absolute;
41
+ ${(p) => `
42
+ top: -${p.badgeSize / 2 - 2}px;
43
+ right: -${p.badgeSize / 2 - 2}px;`}
44
+ `;
45
+ export const IconBox = ({ Badge, size = DEFAULT_BOX_SIZE, children, borderColor = "neutral.c40", badgeColor, badgeSize = DEFAULT_BADGE_SIZE, }) => {
46
+ const hasBadge = !!Badge;
47
+ return (React.createElement(Container, { size: size },
48
+ React.createElement(IconBoxBackground, { size: size, hasBadge: hasBadge, border: "1px solid", borderColor: borderColor }),
49
+ children,
50
+ hasBadge && (React.createElement(BadgeContainer, { badgeSize: badgeSize },
51
+ React.createElement(Badge, { size: badgeSize, color: badgeColor })))));
52
+ };
53
+ const BoxedIcon = (_a) => {
54
+ var { Icon, iconSize = DEFAULT_ICON_SIZE, iconColor } = _a, iconBoxProps = __rest(_a, ["Icon", "iconSize", "iconColor"]);
55
+ return (React.createElement(IconBox, Object.assign({}, iconBoxProps),
56
+ React.createElement(Icon, { size: iconSize || DEFAULT_ICON_SIZE, color: iconColor })));
57
+ };
58
+ export default BoxedIcon;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare type Props = {
3
2
  name: string;
4
3
  size?: number;
@@ -1,2 +1,4 @@
1
1
  export { default, iconNames } from "./Icon";
2
+ import BoxedIcon, { IconBox } from "./BoxedIcon";
3
+ export { BoxedIcon, IconBox };
2
4
  export type { Props } from "./Icon";
@@ -1 +1,3 @@
1
1
  export { default, iconNames } from "./Icon";
2
+ import BoxedIcon, { IconBox } from "./BoxedIcon";
3
+ export { BoxedIcon, IconBox };
@@ -1,35 +1,19 @@
1
- import React from "react";
2
- import { SpaceProps, LayoutProps } from "styled-system";
1
+ import { BaseStyledProps } from "../../styled";
3
2
  import { TextVariants } from "../../../styles/theme";
4
3
  declare type FontFamilies = "Inter|ExtraLight" | "Inter|Light" | "Inter|Regular" | "Inter|Medium" | "Inter|SemiBold" | "Inter|Bold" | "Inter|ExtraBold" | "Alpha|Medium";
5
- export interface TextProps {
4
+ declare type WhiteSpace = "normal" | "nowrap" | "pre" | "pre-line" | "pre-wrap";
5
+ export interface TextProps extends BaseStyledProps {
6
6
  fontFamily?: string;
7
7
  ff?: FontFamilies;
8
8
  fontSize?: number | string | TextVariants;
9
9
  variant?: TextVariants;
10
10
  textAlign?: string;
11
- textTransform?: string;
12
- color?: string;
13
- fontWeight?: string;
14
- mt?: number | string;
15
- mb?: number | string;
16
- ml?: number | string;
17
- mr?: number | string;
18
- lineHeight?: string;
19
- bracket?: boolean;
20
- children: React.ReactNode;
21
- }
22
- export interface BaseTextProps extends SpaceProps, LayoutProps {
23
- fontFamily?: string;
24
- ff?: FontFamilies;
25
- fontSize?: number | string | TextVariants;
26
- variant?: TextVariants;
27
- textAlign?: string;
28
- color?: string;
29
11
  fontWeight?: string;
30
12
  lineHeight?: string;
31
13
  textTransform?: string;
32
14
  textOverflow?: string;
15
+ uppercase?: boolean;
16
+ whiteSpace?: WhiteSpace;
33
17
  }
34
- declare const Text: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, BaseTextProps, never>;
18
+ declare const Text: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, TextProps, keyof TextProps>;
35
19
  export default Text;
@@ -1,5 +1,5 @@
1
- import styled from "styled-components";
2
- import { fontSize, fontWeight, textAlign, color, space, lineHeight, letterSpacing, system, layout, } from "styled-system";
1
+ import baseStyled from "../../styled";
2
+ import { compose, fontSize, fontWeight, textAlign, lineHeight, letterSpacing, system, } from "styled-system";
3
3
  import fontFamily from "../../../styles/styled/fontFamily";
4
4
  import { textVariantStyle } from "./styles";
5
5
  const uppercase = system({
@@ -8,25 +8,16 @@ const uppercase = system({
8
8
  transform: (value) => (value ? "uppercase" : "none"),
9
9
  },
10
10
  });
11
- const Text = styled.span.attrs(({ variant = "body", fontSize, color }) => ({
11
+ const Text = baseStyled.span.attrs(({ variant = "body", fontSize, color }) => ({
12
12
  fontSize: fontSize ? fontSize : variant,
13
- color: color || "palette.neutral.c100",
13
+ color: color || "neutral.c100",
14
14
  })) `
15
15
  font-weight: 500;
16
+ white-space: ${(props) => { var _a; return (_a = props.whiteSpace) !== null && _a !== void 0 ? _a : "normal"; }};
16
17
  ${(p) => textVariantStyle[p.variant || "body"]}
17
- ${uppercase};
18
- ${lineHeight};
19
- ${fontFamily};
20
- ${fontSize};
21
- ${textAlign};
22
- ${color};
23
- ${fontWeight};
24
- ${space};
25
- ${letterSpacing};
26
- ${layout}
27
- ${system({
18
+ ${compose(uppercase, lineHeight, fontFamily, fontSize, textAlign, fontWeight, letterSpacing, system({
28
19
  textOverflow: true,
29
- })}
20
+ }))}
30
21
  ${(p) => (p.textTransform ? `text-transform: ${p.textTransform};` : "")}
31
22
  `;
32
23
  export default Text;
@@ -3,6 +3,7 @@ import { TextVariants } from "../../../styles/theme";
3
3
  export declare const fontStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemedStyledProps<GlobalStyleProps, import("styled-components").DefaultTheme>>;
4
4
  export declare const textVariantStyle: Record<TextVariants, {
5
5
  fontFamily: string;
6
- lineHeight?: string;
6
+ lineHeight?: string | number;
7
7
  fontWeight?: number;
8
+ "text-transform"?: string;
8
9
  }>;
@@ -1,7 +1,9 @@
1
1
  import { css } from "styled-components";
2
2
  const getFontSource = (name) => (props) => {
3
- const fontsPath = props.fontsPath || "assets/fonts";
4
- return `url("${fontsPath}/${name}.woff2") format("woff2")`;
3
+ var _a;
4
+ const fontsPath = (_a = props.fontsPath) !== null && _a !== void 0 ? _a : "assets/fonts";
5
+ const fontName = (props.fontMappings && props.fontMappings(name)) || `${name}.woff2`;
6
+ return `url("${fontsPath}/${fontName}") format("woff2")`;
5
7
  };
6
8
  export const fontStyles = css `
7
9
  @font-face {
@@ -57,39 +59,48 @@ export const textVariantStyle = {
57
59
  h1: {
58
60
  fontFamily: "Alpha",
59
61
  fontWeight: 500,
62
+ "text-transform": "uppercase",
60
63
  },
61
64
  h2: {
62
65
  fontFamily: "Alpha",
63
66
  fontWeight: 500,
67
+ "text-transform": "uppercase",
64
68
  },
65
69
  h3: {
66
70
  fontFamily: "Alpha",
67
71
  fontWeight: 500,
72
+ "text-transform": "uppercase",
68
73
  },
69
74
  h4: {
70
- fontFamily: "Inter",
75
+ fontFamily: "Alpha",
71
76
  fontWeight: 500,
77
+ "text-transform": "uppercase",
72
78
  },
73
79
  h5: {
74
80
  fontFamily: "Alpha",
75
81
  fontWeight: 500,
82
+ "text-transform": "uppercase",
76
83
  },
77
84
  large: {
78
85
  fontFamily: "Inter",
79
86
  },
87
+ largeLineHeight: {
88
+ fontFamily: "Inter",
89
+ lineHeight: 1.7,
90
+ },
80
91
  body: {
81
92
  fontFamily: "Inter",
82
93
  },
83
94
  bodyLineHeight: {
84
95
  fontFamily: "Inter",
85
- lineHeight: "20px",
96
+ lineHeight: 1.7,
86
97
  },
87
98
  paragraph: {
88
99
  fontFamily: "Inter",
89
100
  },
90
101
  paragraphLineHeight: {
91
102
  fontFamily: "Inter",
92
- lineHeight: "18px",
103
+ lineHeight: 1.7,
93
104
  },
94
105
  small: {
95
106
  fontFamily: "Inter",
@@ -97,14 +108,15 @@ export const textVariantStyle = {
97
108
  extraSmall: {
98
109
  fontFamily: "Inter",
99
110
  },
100
- subtitle: {
101
- fontFamily: "Inter",
102
- fontWeight: 600,
103
- },
104
111
  tiny: {
105
112
  fontFamily: "Inter",
106
113
  },
107
114
  micro: {
108
115
  fontFamily: "Inter",
109
116
  },
117
+ subtitle: {
118
+ fontFamily: "Inter",
119
+ fontWeight: 600,
120
+ "text-transform": "uppercase",
121
+ },
110
122
  };
@@ -1,3 +1,3 @@
1
1
  export { default as Divider } from "./Divider";
2
- export { default as Icon } from "./Icon";
2
+ export { default as Icon, IconBox } from "./Icon";
3
3
  export { default as Text } from "./Text";
@@ -1,3 +1,3 @@
1
1
  export { default as Divider } from "./Divider";
2
- export { default as Icon } from "./Icon";
2
+ export { default as Icon, IconBox } from "./Icon";
3
3
  export { default as Text } from "./Text";
@@ -10,13 +10,13 @@ const Wrapper = styled(Flex) `
10
10
  padding: ${(p) => p.theme.space[8]}px ${(p) => p.theme.space[10]}px;
11
11
  padding-right: 280px; // Nb gives air to not overlap the illustration
12
12
  z-index: ${(p) => p.theme.zIndexes[8]};
13
- background: url(${(p) => p.image}) no-repeat ${(p) => p.theme.colors.palette.neutral.c100};
13
+ background: url(${(p) => p.image}) no-repeat ${(p) => p.theme.colors.neutral.c100};
14
14
  background-size: contain;
15
15
  background-position: right 60px bottom;
16
16
  `;
17
17
  const Slide = ({ title, description, image, onClick }) => {
18
18
  return (React.createElement(Wrapper, { key: "key", image: image, onClick: onClick },
19
- React.createElement(Text, { variant: "tiny", color: "palette.neutral.c00", fontWeight: "regular" }, title),
20
- React.createElement(Text, { variant: "h5", color: "palette.neutral.c00", textTransform: "uppercase" }, description)));
19
+ React.createElement(Text, { variant: "tiny", color: "neutral.c00", fontWeight: "regular" }, title),
20
+ React.createElement(Text, { variant: "h5", color: "neutral.c00", textTransform: "uppercase" }, description)));
21
21
  };
22
22
  export default Slide;
@@ -17,7 +17,7 @@ const CarouselWrapper = styled.div `
17
17
  cursor: pointer;
18
18
  position: relative;
19
19
  flex: 1;
20
- background: ${(p) => p.theme.colors.palette.neutral.c100};
20
+ background: ${(p) => p.theme.colors.neutral.c100};
21
21
  `;
22
22
  const Controllers = styled(Flex) `
23
23
  position: absolute;
@@ -25,7 +25,7 @@ const Controllers = styled(Flex) `
25
25
  right: ${(p) => p.theme.space[5]}px;
26
26
  bottom: ${(p) => p.theme.space[4]}px;
27
27
  column-gap: ${(p) => p.theme.space[4]}px;
28
- color: ${(p) => p.theme.colors.palette.neutral.c00};
28
+ color: ${(p) => p.theme.colors.neutral.c00};
29
29
 
30
30
  > div {
31
31
  &:hover {
@@ -45,7 +45,7 @@ const Bullets = styled.div `
45
45
  position: relative;
46
46
  height: ${(p) => p.theme.space[1]}px;
47
47
  width: ${(p) => p.theme.space[8]}px;
48
- background: ${(p) => p.theme.colors.palette.neutral.c00};
48
+ background: ${(p) => p.theme.colors.neutral.c00};
49
49
  opacity: 0.5;
50
50
  &:hover {
51
51
  opacity: 0.75;
@@ -71,7 +71,7 @@ const Close = styled.div `
71
71
  position: absolute;
72
72
  top: ${(p) => p.theme.space[7]}px;
73
73
  right: ${(p) => p.theme.space[5]}px;
74
- color: ${(p) => p.theme.colors.palette.neutral.c00};
74
+ color: ${(p) => p.theme.colors.neutral.c00};
75
75
  &:hover {
76
76
  opacity: 0.5;
77
77
  }
@@ -124,10 +124,10 @@ const Carousel = ({ timeout = DEFAULT_TIMEOUT, queue, isDismissed, onDismiss, di
124
124
  if (!(queue === null || queue === void 0 ? void 0 : queue.length) || isDismissed)
125
125
  return null;
126
126
  return (React.createElement(CarouselWrapper, { id: "carousel", onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave }, wantToDismiss ? (React.createElement(DismissWrapper, null,
127
- React.createElement(Text, { color: "palette.neutral.c00", fontWeight: "medium", variant: "paragraph" }, dismissText),
128
- React.createElement(Flex, null,
129
- React.createElement(Button, { color: "palette.neutral.c00", type: "color", onClick: onDismiss }, dismissConfirmText),
130
- React.createElement(Button, { color: "palette.neutral.c00", type: "main", outline: true, onClick: onCancelDismiss }, dismissCancelText)))) : (React.createElement("div", null,
127
+ React.createElement(Text, { color: "neutral.c00", fontWeight: "medium", variant: "paragraph" }, dismissText),
128
+ React.createElement(Flex, { columnGap: 5 },
129
+ React.createElement(Button, { color: "neutral.c100", backgroundColor: "neutral.c00", onClick: onDismiss }, dismissConfirmText),
130
+ React.createElement(Button, { outline: true, color: "neutral.c00", backgroundColor: "neutral.c100", borderColor: "neutral.c00", onClick: onCancelDismiss }, dismissCancelText)))) : (React.createElement("div", null,
131
131
  React.createElement(TransitionGroup, { component: null, childFactory: childFactory },
132
132
  React.createElement(TransitionSlide, { key: index, direction: direction },
133
133
  React.createElement(Slide, Object.assign({}, queue[index])))),
@@ -1,12 +1,16 @@
1
1
  import React from "react";
2
- declare type ButtonTypes = "main" | "shade" | "error" | "color";
3
- interface BaseProps {
2
+ import { BaseStyledProps } from "../../styled";
3
+ import { BordersProps } from "styled-system";
4
+ export declare type ButtonVariants = "main" | "shade" | "error" | "color";
5
+ export declare type IconPosition = "right" | "left";
6
+ interface BaseProps extends BaseStyledProps, BordersProps {
4
7
  ff?: string;
5
8
  color?: string;
9
+ backgroundColor?: string;
6
10
  fontSize?: number;
7
- type?: ButtonTypes;
11
+ variant?: ButtonVariants;
8
12
  outline?: boolean;
9
- iconPosition?: "right" | "left";
13
+ iconPosition?: IconPosition;
10
14
  iconButton?: boolean;
11
15
  disabled?: boolean;
12
16
  }
@@ -18,13 +22,17 @@ export interface ButtonProps extends BaseProps {
18
22
  children?: React.ReactNode;
19
23
  onClick: (event?: React.SyntheticEvent<HTMLButtonElement>) => void;
20
24
  iconSize?: number;
25
+ style?: React.CSSProperties;
21
26
  }
27
+ export declare const ButtonUnstyled: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
22
28
  export declare const Base: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
23
- ff: string;
24
- color: string;
29
+ fontFamily: string;
25
30
  fontSize: number;
26
- } & BaseProps, "color" | "fontSize" | "ff">;
27
- declare const Button: ({ Icon, iconPosition, iconSize, children, onClick, ...props }: ButtonProps) => React.ReactElement;
31
+ } & BaseProps, "fontFamily" | "fontSize">;
32
+ declare const Button: {
33
+ ({ Icon, iconPosition, iconSize, children, onClick, ...props }: ButtonProps): React.ReactElement;
34
+ Unstyled: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
35
+ };
28
36
  export declare type ExpandButtonProps = React.PropsWithChildren<{
29
37
  onToggle?: (arg0: boolean) => void;
30
38
  onClick?: (arg0: React.SyntheticEvent<HTMLButtonElement>) => void;