@ledgerhq/react-ui 0.1.1 → 0.4.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 (121) hide show
  1. package/README.md +54 -13
  2. package/assets/icons.d.ts +1 -0
  3. package/assets/icons.js +1 -0
  4. package/components/Chart/index.js +1 -1
  5. package/components/Table/Columns.d.ts +2 -2
  6. package/components/Table/Columns.js +2 -2
  7. package/components/Table/index.d.ts +3 -2
  8. package/components/Table/index.js +1 -4
  9. package/components/Table/stories.helper.js +6 -6
  10. package/components/Tag/index.d.ts +18 -5
  11. package/components/Tag/index.js +54 -21
  12. package/components/animations/GlitchText/index.d.ts +7 -0
  13. package/components/animations/GlitchText/index.js +35 -0
  14. package/components/asorted/Divider/index.js +2 -2
  15. package/components/asorted/Icon/Icon.d.ts +1 -0
  16. package/components/asorted/Icon/Icon.js +8 -1
  17. package/components/asorted/Icon/index.d.ts +1 -1
  18. package/components/asorted/Icon/index.js +1 -1
  19. package/components/asorted/Text/index.d.ts +9 -31
  20. package/components/asorted/Text/index.js +11 -17
  21. package/components/asorted/Text/styles.d.ts +7 -2
  22. package/components/asorted/Text/styles.js +69 -85
  23. package/components/asorted/index.d.ts +1 -1
  24. package/components/asorted/index.js +1 -1
  25. package/components/cards/Carousel/Slide.js +3 -3
  26. package/components/cards/Carousel/index.js +8 -8
  27. package/components/cta/Button/index.d.ts +26 -14
  28. package/components/cta/Button/index.js +77 -66
  29. package/components/cta/Link/index.d.ts +12 -4
  30. package/components/cta/Link/index.js +4 -3
  31. package/components/cta/Toggle/index.js +1 -1
  32. package/components/cta/getCtaStyle.d.ts +2 -2
  33. package/components/cta/index.d.ts +1 -0
  34. package/components/cta/index.js +1 -0
  35. package/components/form/BaseInput/index.d.ts +86 -15
  36. package/components/form/BaseInput/index.js +47 -20
  37. package/components/form/Checkbox/Checkbox.js +12 -9
  38. package/components/form/Dropdown/index.js +3 -3
  39. package/components/form/LegendInput/index.js +3 -3
  40. package/components/form/NumberInput/index.d.ts +1 -1
  41. package/components/form/NumberInput/index.js +18 -7
  42. package/components/form/QrCodeInput/index.js +4 -4
  43. package/components/form/QuantityInput/index.js +8 -8
  44. package/components/form/Radio/RadioElement.d.ts +5 -2
  45. package/components/form/Radio/RadioElement.js +16 -14
  46. package/components/form/Radio/RadioListElement.d.ts +22 -0
  47. package/components/form/Radio/RadioListElement.js +63 -0
  48. package/components/form/Radio/index.d.ts +8 -1
  49. package/components/form/Radio/index.js +2 -0
  50. package/components/form/SearchInput/index.js +1 -1
  51. package/components/form/SelectInput/DropdownIndicator.js +1 -1
  52. package/components/form/SelectInput/MenuList.js +1 -1
  53. package/components/form/SelectInput/Option.js +12 -12
  54. package/components/form/SelectInput/ValueContainer.js +2 -2
  55. package/components/form/SelectInput/index.d.ts +3 -2
  56. package/components/form/SelectInput/index.js +5 -5
  57. package/components/form/SplitInput/index.js +5 -5
  58. package/components/form/Switch/Switch.js +9 -9
  59. package/components/helpers.d.ts +2 -2
  60. package/components/layout/Box/index.d.ts +11 -0
  61. package/components/layout/Box/index.js +3 -0
  62. package/components/layout/Drawer/index.d.ts +13 -0
  63. package/components/layout/{Side/Side.js → Drawer/index.js} +12 -12
  64. package/components/layout/Flex/index.d.ts +10 -7
  65. package/components/layout/Flex/index.js +2 -11
  66. package/components/layout/Grid/index.d.ts +3 -2
  67. package/components/layout/Grid/index.js +3 -3
  68. package/components/layout/Popin/index.d.ts +33 -6
  69. package/components/layout/Popin/index.js +65 -41
  70. package/components/layout/Side/Provider.d.ts +9 -8
  71. package/components/layout/Side/Provider.js +1 -3
  72. package/components/layout/Side/index.js +7 -10
  73. package/components/layout/index.d.ts +2 -0
  74. package/components/layout/index.js +2 -0
  75. package/components/loaders/ProgressLoader/index.js +4 -4
  76. package/components/message/Alert/index.js +7 -7
  77. package/components/message/Log/index.js +2 -2
  78. package/components/message/Notification/Badge.js +2 -2
  79. package/components/message/Notification/index.d.ts +8 -14
  80. package/components/message/Notification/index.js +9 -29
  81. package/components/message/StatusNotification/index.d.ts +11 -0
  82. package/components/message/StatusNotification/index.js +33 -0
  83. package/components/message/Tip/index.d.ts +8 -0
  84. package/components/message/Tip/index.js +43 -0
  85. package/components/message/Tooltip/index.d.ts +3 -2
  86. package/components/message/Tooltip/index.js +26 -3
  87. package/components/message/Tooltip/styles.js +3 -3
  88. package/components/message/index.d.ts +3 -0
  89. package/components/message/index.js +3 -0
  90. package/components/navigation/Aside/index.d.ts +8 -1
  91. package/components/navigation/Breadcrumb/index.js +5 -5
  92. package/components/navigation/Header/index.d.ts +3 -3
  93. package/components/navigation/progress/ProgressBar/Onboarding.js +6 -6
  94. package/components/navigation/progress/Stepper/index.js +10 -10
  95. package/components/navigation/sideBar/Item/Item.d.ts +4 -7
  96. package/components/navigation/sideBar/Item/Item.js +34 -16
  97. package/components/navigation/sideBar/SideBar/SideBar.d.ts +1 -1
  98. package/components/navigation/sideBar/SideBar/SideBar.js +14 -6
  99. package/components/navigation/sideBar/Toggle/Toggle.js +2 -2
  100. package/components/styled.d.ts +13 -0
  101. package/components/styled.js +13 -0
  102. package/components/tabs/Bar/index.js +4 -4
  103. package/components/tabs/Chip/index.d.ts +13 -0
  104. package/components/tabs/Chip/index.js +21 -0
  105. package/components/tabs/Pill/index.js +7 -7
  106. package/components/tabs/Tabs/index.js +8 -7
  107. package/components/tabs/index.d.ts +2 -0
  108. package/components/tabs/index.js +2 -0
  109. package/package.json +19 -8
  110. package/styles/InvertTheme.d.ts +1 -8
  111. package/styles/StyleProvider.d.ts +3 -3
  112. package/styles/StyleProvider.js +3 -3
  113. package/styles/global.d.ts +1 -0
  114. package/styles/global.js +16 -38
  115. package/styles/index.d.ts +0 -1
  116. package/styles/index.js +0 -1
  117. package/styles/theme.d.ts +63 -39
  118. package/styles/theme.js +34 -8
  119. package/components/layout/Side/Side.d.ts +0 -13
  120. package/styles/reset.d.ts +0 -2
  121. package/styles/reset.js +0 -62
@@ -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 {
@@ -53,86 +55,68 @@ export const fontStyles = css `
53
55
  font-style: normal;
54
56
  }
55
57
  `;
56
- export default css `
57
- .ll-text_h1 {
58
- font-family: Alpha, Arial;
59
- font-size: 36px;
60
- line-height: 43.2px;
61
- }
62
- .ll-text_h2 {
63
- font-family: Alpha, Arial;
64
- font-size: 28px;
65
- line-height: 33.6px;
66
- }
67
- .ll-text_h3 {
68
- font-family: Alpha, Arial;
69
- font-size: 20px;
70
- line-height: 24px;
71
- }
72
- .ll-text_h3 {
73
- font-family: Alpha, Arial;
74
- font-size: 20px;
75
- line-height: 24px;
76
- }
77
- .ll-text_large {
78
- font-family: Inter, Arial;
79
- font-size: 16px;
80
- line-height: normal;
81
- }
82
- .ll-text_highlight {
83
- font-family: Inter, Arial;
84
- font-size: 16px;
85
- line-height: 19.36px;
86
- }
87
- .ll-text_emphasis {
88
- font-family: Inter, Arial;
89
- font-size: 14px;
90
- line-height: 20px;
91
- }
92
- .ll-text_body {
93
- font-family: Inter, Arial;
94
- font-size: 13px;
95
- line-height: 20px;
96
- }
97
- .ll-text_cta {
98
- font-family: Inter, Arial;
99
- font-size: 13px;
100
- line-height: 15.73px;
101
- }
102
- .ll-text_link {
103
- font-family: Inter, Arial;
104
- font-size: 13px;
105
- line-height: 16px;
106
- text-decoration: underline;
107
- cursor: pointer;
108
- }
109
- .ll-text_small {
110
- font-family: Inter, Arial;
111
- font-size: 12px;
112
- line-height: normal;
113
- }
114
- .ll-text_tiny {
115
- font-family: Inter, Arial;
116
- font-size: 12px;
117
- line-height: 16px;
118
- }
119
- .ll-text_navigation {
120
- font-family: Inter, Arial;
121
- font-size: 12px;
122
- line-height: 14.52px;
123
- }
124
- .ll-text_subTitle {
125
- font-family: Inter, Arial;
126
- font-size: 11px;
127
- line-height: 13.31px;
128
- }
129
- .ll-text_tag {
130
- font-family: Inter, Arial;
131
- font-size: 10px;
132
- line-height: 12.1px;
133
- }
134
- .ll-text_paragraph {
135
- font-family: Inter, Arial;
136
- font-size: 13px;
137
- }
138
- `;
58
+ export const textVariantStyle = {
59
+ h1: {
60
+ fontFamily: "Alpha",
61
+ fontWeight: 500,
62
+ "text-transform": "uppercase",
63
+ },
64
+ h2: {
65
+ fontFamily: "Alpha",
66
+ fontWeight: 500,
67
+ "text-transform": "uppercase",
68
+ },
69
+ h3: {
70
+ fontFamily: "Alpha",
71
+ fontWeight: 500,
72
+ "text-transform": "uppercase",
73
+ },
74
+ h4: {
75
+ fontFamily: "Alpha",
76
+ fontWeight: 500,
77
+ "text-transform": "uppercase",
78
+ },
79
+ h5: {
80
+ fontFamily: "Alpha",
81
+ fontWeight: 500,
82
+ "text-transform": "uppercase",
83
+ },
84
+ large: {
85
+ fontFamily: "Inter",
86
+ },
87
+ largeLineHeight: {
88
+ fontFamily: "Inter",
89
+ lineHeight: 1.7,
90
+ },
91
+ body: {
92
+ fontFamily: "Inter",
93
+ },
94
+ bodyLineHeight: {
95
+ fontFamily: "Inter",
96
+ lineHeight: 1.7,
97
+ },
98
+ paragraph: {
99
+ fontFamily: "Inter",
100
+ },
101
+ paragraphLineHeight: {
102
+ fontFamily: "Inter",
103
+ lineHeight: 1.7,
104
+ },
105
+ small: {
106
+ fontFamily: "Inter",
107
+ },
108
+ extraSmall: {
109
+ fontFamily: "Inter",
110
+ },
111
+ tiny: {
112
+ fontFamily: "Inter",
113
+ },
114
+ micro: {
115
+ fontFamily: "Inter",
116
+ },
117
+ subtitle: {
118
+ fontFamily: "Inter",
119
+ fontWeight: 600,
120
+ "text-transform": "uppercase",
121
+ },
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, { color: "palette.neutral.c00", ff: "Inter|Regular", fontSize: 10 }, title),
20
- React.createElement(Text, { color: "palette.neutral.c00", ff: "Alpha|Medium", textTransform: "uppercase", fontSize: 20 }, 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", type: "cta" }, 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,29 +1,41 @@
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
  }
13
- export interface ButtonProps<I = any> extends BaseProps {
14
- Icon?: React.ComponentType<I>;
17
+ export interface ButtonProps extends BaseProps {
18
+ Icon?: React.ComponentType<{
19
+ size: number;
20
+ color?: string;
21
+ }>;
15
22
  children?: React.ReactNode;
16
23
  onClick: (event?: React.SyntheticEvent<HTMLButtonElement>) => void;
17
24
  iconSize?: number;
25
+ style?: React.CSSProperties;
18
26
  }
27
+ export declare const ButtonUnstyled: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
19
28
  export declare const Base: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
20
- ff: string;
21
- color: string;
29
+ fontFamily: string;
22
30
  fontSize: number;
23
- } & BaseProps, "color" | "fontSize" | "ff">;
24
- declare const Button: ({ Icon, iconPosition, iconSize, children, onClick, ...props }: ButtonProps) => React.ReactElement;
25
- export declare const ExpandButton: ({ onToggle, onClick, ...props }: React.PropsWithChildren<{
26
- onToggle?: ((arg0: boolean) => void) | undefined;
27
- onClick?: ((arg0: React.SyntheticEvent<HTMLButtonElement>) => void) | undefined;
28
- }>) => 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
+ };
36
+ export declare type ExpandButtonProps = React.PropsWithChildren<{
37
+ onToggle?: (arg0: boolean) => void;
38
+ onClick?: (arg0: React.SyntheticEvent<HTMLButtonElement>) => void;
39
+ }>;
40
+ export declare const ExpandButton: ({ onToggle, onClick, ...props }: ExpandButtonProps) => React.ReactElement;
29
41
  export default Button;
@@ -11,145 +11,161 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import React, { useState } from "react";
13
13
  import styled, { css } from "styled-components";
14
- import { fontSize, color } from "styled-system";
14
+ import baseStyled from "../../styled";
15
+ import { fontSize, border, compose } from "styled-system";
15
16
  import fontFamily from "../../../styles/styled/fontFamily";
16
17
  import { fontSizes } from "../../../styles/theme";
17
18
  import ChevronBottom from "@ledgerhq/icons-ui/react/ChevronBottomRegular";
18
19
  const IconContainer = styled.div `
19
20
  display: inline-block;
20
- margin-${(p) => (p.iconPosition === "left" ? "right" : "left")}: ${(p) => p.theme.space[4]}px;
21
+ ${(p) => `${p.iconPosition === "left" ? "margin-right" : "margin-left"}: ${p.theme.space[4]}px;`}
21
22
  padding-top: 0.2em;
22
23
  `;
23
24
  const getVariantColors = (p) => ({
24
25
  main: {
25
26
  outline: `
26
- border-color: ${p.theme.colors.palette.neutral.c100};
27
- color: ${p.theme.colors.palette.neutral.c100};
28
- background-color: ${p.theme.colors.palette.neutral.c00};
29
- &:hover {
30
- background-color: ${p.theme.colors.palette.neutral.c20};
27
+ border-color: ${p.theme.colors.neutral.c100};
28
+ color: ${p.theme.colors.neutral.c100};
29
+ background-color: ${p.theme.colors.neutral.c00};
30
+ &:hover, &:focus {
31
+ background-color: ${p.theme.colors.neutral.c20};
31
32
  }
32
33
  &:active {
33
- background-color: ${p.theme.colors.palette.neutral.c30};
34
+ background-color: ${p.theme.colors.neutral.c30};
34
35
  }
35
36
  `,
36
37
  filled: `
37
- color: ${p.theme.colors.palette.neutral.c00};
38
- background-color: ${p.theme.colors.palette.neutral.c100};
39
- &:hover {
40
- background-color: ${p.theme.colors.palette.neutral.c90};
38
+ color: ${p.theme.colors.neutral.c00};
39
+ background-color: ${p.theme.colors.neutral.c100};
40
+ &:hover, &:focus {
41
+ background-color: ${p.theme.colors.neutral.c90};
41
42
  }
42
43
  `,
43
44
  },
44
45
  shade: `
45
- border-color: ${p.theme.colors.palette.neutral.c40};
46
- color: ${p.theme.colors.palette.neutral.c100};
47
- background-color: ${p.theme.colors.palette.neutral.c00};
46
+ border-color: ${p.theme.colors.neutral.c40};
47
+ color: ${p.theme.colors.neutral.c100};
48
+ background-color: ${p.theme.colors.neutral.c00};
48
49
  &:focus {
49
- border-color: ${p.theme.colors.palette.primary.c80};
50
+ border-color: ${p.theme.colors.primary.c80};
50
51
  }
51
52
 
52
- &:hover {
53
- background-color: ${p.theme.colors.palette.neutral.c20};
53
+ &:hover, &:focus {
54
+ background-color: ${p.theme.colors.neutral.c20};
54
55
  }
55
56
 
56
57
  &:active {
57
- background-color: ${p.theme.colors.palette.neutral.c30};
58
- }
58
+ background-color: ${p.theme.colors.neutral.c30};
59
+ }
59
60
  `,
60
61
  error: {
61
62
  outline: `
62
- border-color: ${p.theme.colors.palette.error.c100};
63
- color: ${p.theme.colors.palette.error.c100};
64
- background-color: ${p.theme.colors.palette.neutral.c00};
63
+ border-color: ${p.theme.colors.error.c100};
64
+ color: ${p.theme.colors.error.c100};
65
+ background-color: ${p.theme.colors.neutral.c00};
65
66
  &:hover {
66
- background-color: ${p.theme.colors.palette.error.c10};
67
+ background-color: ${p.theme.colors.error.c10};
67
68
  }
68
69
  &:active {
69
- background-color: ${p.theme.colors.palette.error.c30};
70
+ background-color: ${p.theme.colors.error.c30};
70
71
  }
71
72
  `,
72
73
  filled: `
73
- color: ${p.theme.colors.palette.neutral.c00};
74
- background-color: ${p.theme.colors.palette.error.c100};
74
+ color: ${p.theme.colors.neutral.c00};
75
+ background-color: ${p.theme.colors.error.c100};
75
76
  &:hover {
76
- background-color: ${p.theme.colors.palette.error.c80};
77
+ background-color: ${p.theme.colors.error.c80};
77
78
  }
78
79
  `,
79
80
  },
80
81
  color: {
81
82
  outline: `
82
- border-color: ${p.theme.colors.palette.primary.c80};
83
- color: ${p.theme.colors.palette.primary.c80};
84
- background-color: ${p.theme.colors.palette.neutral.c00};
83
+ border-color: ${p.theme.colors.primary.c80};
84
+ color: ${p.theme.colors.primary.c80};
85
+ background-color: ${p.theme.colors.neutral.c00};
85
86
  &:hover {
86
- background-color: ${p.theme.colors.palette.primary.c10};
87
+ background-color: ${p.theme.colors.primary.c10};
87
88
  }
88
89
  &:active {
89
- background-color: ${p.theme.colors.palette.primary.c20};
90
+ background-color: ${p.theme.colors.primary.c20};
90
91
  }
91
92
  `,
92
93
  filled: `
93
- color: ${p.theme.colors.palette.neutral.c00};
94
- background-color: ${p.theme.colors.palette.primary.c80};
94
+ color: ${p.theme.colors.neutral.c00};
95
+ background-color: ${p.theme.colors.primary.c80};
95
96
  &:hover {
96
- background-color: ${p.theme.colors.palette.primary.c70};
97
+ background-color: ${p.theme.colors.primary.c70};
97
98
  }
98
99
  `,
99
100
  },
100
101
  disabled: {
101
102
  outline: `
102
- border-color: ${p.theme.colors.palette.neutral.c50};
103
- color: ${p.theme.colors.palette.neutral.c50};
104
- background-color: ${p.theme.colors.palette.neutral.c00};
103
+ border-color: ${p.theme.colors.neutral.c50};
104
+ color: ${p.theme.colors.neutral.c50};
105
+ background-color: ${p.theme.colors.neutral.c00};
105
106
  `,
106
107
  filled: `
107
- color: ${p.theme.colors.palette.neutral.c50};
108
- background-color: ${p.theme.colors.palette.neutral.c30};
108
+ color: ${p.theme.colors.neutral.c50};
109
+ background-color: ${p.theme.colors.neutral.c30};
109
110
  `,
110
111
  },
112
+ default: `
113
+ color: ${p.theme.colors.neutral.c100};
114
+ background-color: transparent;
115
+ &:hover {
116
+ text-decoration: underline;
117
+ }
118
+ `,
111
119
  });
112
- export const Base = styled.button.attrs((p) => {
113
- var _a, _b;
120
+ export const ButtonUnstyled = styled.button `
121
+ all: unset;
122
+ cursor: pointer;
123
+
124
+ &:disabled {
125
+ cursor: default;
126
+ }
127
+ `;
128
+ export const Base = baseStyled.button.attrs((p) => {
129
+ var _a;
114
130
  return ({
115
- ff: "Inter|SemiBold",
116
- color: (_a = p.color) !== null && _a !== void 0 ? _a : "palette.neutral.c100",
117
- fontSize: (_b = p.fontSize) !== null && _b !== void 0 ? _b : 4,
131
+ fontFamily: "Inter",
132
+ fontSize: (_a = p.fontSize) !== null && _a !== void 0 ? _a : 4,
118
133
  });
119
134
  }) `
120
- ${fontFamily};
121
- ${fontSize};
122
- ${color};
135
+ background-color: transparent;
136
+ border-color: transparent;
123
137
  border-radius: ${(p) => p.theme.space[13]}px;
138
+ border-style: solid;
139
+ border-width: ${(p) => (p.outline || p.variant === "shade" ? 1 : 0)}px;
140
+ font-weight: 600;
141
+ ${compose(fontFamily, fontSize, border)};
124
142
  height: ${(p) => p.theme.space[13]}px;
125
143
  line-height: ${(p) => p.theme.fontSizes[p.fontSize]}px;
126
- border-style: solid;
127
- border-width: ${(p) => (p.outline || p.type === "shade" ? 1 : 0)}px;
128
144
  text-align: center;
129
145
  display: inline-flex;
130
146
  align-items: center;
131
147
  justify-content: center;
132
148
  padding: 0 2em;
133
- background-color: transparent;
134
- border-color: transparent;
135
149
  overflow: hidden;
136
150
  text-overflow: ellipsis;
137
151
  white-space: nowrap;
138
152
  max-width: 100%;
139
153
  position: relative;
140
154
  cursor: ${(p) => (p.disabled ? "default" : "pointer")};
141
- &:focus {
142
- box-shadow: 0 0 0 4px ${(p) => p.theme.colors.palette.primary.c60};
155
+ &:active {
156
+ box-shadow: 0 0 0 4px ${(p) => p.theme.colors.primary.c60};
143
157
  }
144
158
 
145
159
  ${(p) => {
146
160
  var _a;
147
161
  const variants = getVariantColors(p);
148
162
  if (p.disabled) {
149
- return p.outline || p.type === "shade" ? variants.disabled.outline : variants.disabled.filled;
163
+ return p.outline || p.variant === "shade"
164
+ ? variants.disabled.outline
165
+ : variants.disabled.filled;
150
166
  }
151
- const type = (_a = p.type) !== null && _a !== void 0 ? _a : "default";
152
- switch (type) {
167
+ const variant = (_a = p.variant) !== null && _a !== void 0 ? _a : "default";
168
+ switch (variant) {
153
169
  case "main":
154
170
  return p.outline ? variants.main.outline : variants.main.filled;
155
171
  case "shade":
@@ -160,11 +176,7 @@ export const Base = styled.button.attrs((p) => {
160
176
  return p.outline ? variants.color.outline : variants.color.filled;
161
177
  case "default":
162
178
  default:
163
- return `
164
- &:hover {
165
- text-decoration: underline;
166
- }
167
- `;
179
+ return variants.default;
168
180
  }
169
181
  }}
170
182
  ${(p) => p.iconButton
@@ -182,9 +194,7 @@ const ContentContainer = styled.div ``;
182
194
  const Button = (_a) => {
183
195
  var _b;
184
196
  var { Icon, iconPosition = "right", iconSize = 16, children, onClick } = _a, props = __rest(_a, ["Icon", "iconPosition", "iconSize", "children", "onClick"]);
185
- return (
186
- // @ts-expect-error FIXME type button conflict
187
- React.createElement(Base, Object.assign({}, props, { iconButton: !(Icon == null) && !children, onClick: onClick }),
197
+ return (React.createElement(Base, Object.assign({}, props, { iconButton: !(Icon == null) && !children, onClick: onClick }),
188
198
  iconPosition === "right" ? React.createElement(ContentContainer, null, children) : null,
189
199
  Icon != null ? (React.createElement(IconContainer, { iconPosition: iconPosition },
190
200
  React.createElement(Icon, { size: iconSize || fontSizes[(_b = props.fontSize) !== null && _b !== void 0 ? _b : 4] }))) : null,
@@ -208,4 +218,5 @@ export const ExpandButton = function ExpandButton(_a) {
208
218
  onClick != null && onClick(event);
209
219
  } })));
210
220
  };
221
+ Button.Unstyled = ButtonUnstyled;
211
222
  export default Button;
@@ -1,8 +1,9 @@
1
1
  import React from "react";
2
- export declare type LinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & {
2
+ import { BaseStyledProps } from "../../styled";
3
+ export declare type LinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> & BaseStyledProps & {
3
4
  Icon?: React.ComponentType<{
4
5
  size: number;
5
- color: string;
6
+ color?: string;
6
7
  }>;
7
8
  type?: "main" | "shade" | "color";
8
9
  size?: "small" | "medium" | "large";
@@ -10,10 +11,17 @@ export declare type LinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> &
10
11
  disabled?: boolean;
11
12
  children?: React.ReactNode;
12
13
  };
13
- export declare const Base: import("styled-components").StyledComponent<"a", import("styled-components").DefaultTheme, React.AnchorHTMLAttributes<HTMLAnchorElement> & {
14
+ export declare const Base: import("styled-components").StyledComponent<"a", import("styled-components").DefaultTheme, React.AnchorHTMLAttributes<HTMLAnchorElement> & 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
+ columnGap?: string | number | undefined;
16
+ rowGap?: string | number | undefined;
17
+ color?: string | undefined;
18
+ display?: string | undefined;
19
+ position?: string | undefined;
20
+ maxHeight?: number | undefined;
21
+ } & {
14
22
  Icon?: React.ComponentType<{
15
23
  size: number;
16
- color: string;
24
+ color?: string | undefined;
17
25
  }> | undefined;
18
26
  type?: "main" | "color" | "shade" | undefined;
19
27
  size?: "small" | "medium" | "large" | undefined;
@@ -3,13 +3,14 @@ import styled from "styled-components";
3
3
  import { getLinkColors } from "./getLinkStyle";
4
4
  import { ctaIconSize, ctaTextType } from "../getCtaStyle";
5
5
  import { Text } from "../../asorted";
6
+ import baseStyled from "../../styled";
6
7
  const IconContainer = styled.div `
7
8
  ${(p) => p.iconLink ? "" : p.iconPosition === "left" ? `margin-right: 6px;` : `margin-left: 6px;`}
8
9
  display: flex;
9
10
  align-items: center;
10
11
  justify-content: center;
11
12
  `;
12
- export const Base = styled.a `
13
+ export const Base = baseStyled.a `
13
14
  color: ${({ theme, disabled, type = "main" }) => getLinkColors(theme.colors)[disabled ? "disabled" : type]["default"]};
14
15
  cursor: pointer;
15
16
  display: inline-flex;
@@ -31,10 +32,10 @@ export const Base = styled.a `
31
32
  const LinkContainer = (props) => {
32
33
  const { Icon, iconPosition = "right", children, size = "medium" } = props;
33
34
  return (React.createElement(React.Fragment, null,
34
- iconPosition === "right" && children ? (React.createElement(Text, { type: ctaTextType[size], fontWeight: "semibold", color: "inherit" }, children)) : null,
35
+ iconPosition === "right" && children ? (React.createElement(Text, { variant: ctaTextType[size], fontWeight: "semiBold", color: "inherit" }, children)) : null,
35
36
  Icon ? (React.createElement(IconContainer, { iconLink: !children, iconPosition: iconPosition },
36
37
  React.createElement(Icon, { size: ctaIconSize[size], color: "currentcolor" }))) : null,
37
- iconPosition === "left" && children ? (React.createElement(Text, { type: ctaTextType[size], fontWeight: "semibold", color: "inherit" }, children)) : null));
38
+ iconPosition === "left" && children ? (React.createElement(Text, { variant: ctaTextType[size], fontWeight: "semiBold", color: "inherit" }, children)) : null));
38
39
  };
39
40
  const Link = (props) => {
40
41
  const { type = "main", size = "medium" } = props;
@@ -19,6 +19,6 @@ var TypeEnum;
19
19
  const Toggle = (_a) => {
20
20
  var { checked = true } = _a, buttonProps = __rest(_a, ["checked"]);
21
21
  const type = useMemo(() => (checked ? TypeEnum.ENABLED : TypeEnum.DISABLED), [checked]);
22
- return React.createElement(Button, Object.assign({ type: type, outline: type === TypeEnum.ENABLED }, buttonProps));
22
+ return React.createElement(Button, Object.assign({ variant: type, outline: type === TypeEnum.ENABLED }, buttonProps));
23
23
  };
24
24
  export default Toggle;
@@ -1,6 +1,6 @@
1
- import { TextTypes } from "../asorted/Text";
1
+ import { TextVariants } from "../../styles/theme";
2
2
  export declare const ctaTextType: {
3
- [index: string]: TextTypes;
3
+ [index: string]: TextVariants;
4
4
  };
5
5
  export declare const ctaIconSize: {
6
6
  [index: string]: number;
@@ -1,2 +1,3 @@
1
1
  export { default as Button } from "./Button";
2
2
  export { default as Toggle } from "./Toggle";
3
+ export { default as Link } from "./Link";
@@ -1,2 +1,3 @@
1
1
  export { default as Button } from "./Button";
2
2
  export { default as Toggle } from "./Toggle";
3
+ export { default as Link } from "./Link";