@manamerge/mana-atomic-ui 0.0.54 → 0.0.56
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.
- package/README.md +4 -1
- package/dist/index.d.ts +13 -4
- package/dist/index.js +155 -123
- package/dist/index.js.map +1 -1
- package/dist/themes/themes/Manamerge.js +19 -33
- package/dist/themes/themes/manamerge/images/icons/modal/closeicon.svg.js +2 -1
- package/dist/themes/themes/manamerge/images/icons/navigation/notification.svg.js +1 -0
- package/dist/themes/themes/manamerge/images/icons/navigation/profile.svg.js +1 -0
- package/dist/themes/themes/manamerge/images/icons/navigation/user.svg.js +3 -2
- package/dist/themes/themes/manamerge/images/misc/terraform.svg +33 -1
- package/dist/themes/themes/manamerge/styling/chat-theme.css.js +1 -1
- package/dist/themes/themes/manamerge/styling/filter-list-theme.css.js +1 -1
- package/dist/themes/themes/manamerge/styling/notification-theme.css.js +1 -1
- package/dist/themes/themes/manamerge/theme/checkbox.js +31 -31
- package/dist/themes/themes/manamerge/theme/icon.js +24 -0
- package/dist/types/components/Atoms/Button/Button.d.ts +1 -1
- package/dist/types/components/Atoms/Icon/Icon.css.d.ts +7 -0
- package/dist/types/components/Atoms/Icon/Icon.d.ts +9 -0
- package/dist/types/components/Atoms/Icon/Icon.stories.d.ts +9 -0
- package/dist/types/components/Atoms/Text/Text.d.ts +1 -1
- package/dist/types/components/Atoms/Text/Text.stories.d.ts +1 -1
- package/dist/types/components/index.d.ts +1 -0
- package/package.json +80 -56
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode, AnchorHTMLAttributes, ElementType } from 'react';
|
|
1
|
+
import React, { ReactNode, FunctionComponent, SVGProps, AnchorHTMLAttributes, ElementType } from 'react';
|
|
2
2
|
|
|
3
3
|
interface ButtonTypes {
|
|
4
4
|
disabled?: boolean;
|
|
@@ -7,7 +7,7 @@ interface ButtonTypes {
|
|
|
7
7
|
background?: string;
|
|
8
8
|
alt?: string;
|
|
9
9
|
children?: ReactNode;
|
|
10
|
-
onClick?:
|
|
10
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
11
11
|
type?: "button" | "submit" | "reset" | undefined;
|
|
12
12
|
color?: string;
|
|
13
13
|
altColor?: string;
|
|
@@ -42,7 +42,7 @@ interface TextTypes {
|
|
|
42
42
|
color?: string;
|
|
43
43
|
fontSize?: string;
|
|
44
44
|
lineHeight?: string;
|
|
45
|
-
fontWeight?: string;
|
|
45
|
+
fontWeight?: string | number;
|
|
46
46
|
tag?: keyof JSX.IntrinsicElements;
|
|
47
47
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
48
48
|
}
|
|
@@ -64,6 +64,15 @@ interface HeadingTypes {
|
|
|
64
64
|
}
|
|
65
65
|
declare const Heading: React.FC<HeadingTypes>;
|
|
66
66
|
|
|
67
|
+
interface IconTypes {
|
|
68
|
+
className?: string;
|
|
69
|
+
svg: FunctionComponent<SVGProps<SVGSVGElement>>;
|
|
70
|
+
color?: string;
|
|
71
|
+
size?: string;
|
|
72
|
+
stroke?: string;
|
|
73
|
+
}
|
|
74
|
+
declare const Icon: React.FC<IconTypes>;
|
|
75
|
+
|
|
67
76
|
interface LinkTypes extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
68
77
|
to?: string;
|
|
69
78
|
color?: string;
|
|
@@ -78,4 +87,4 @@ interface LinkTypes extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
|
78
87
|
}
|
|
79
88
|
declare const Link: React.FC<LinkTypes>;
|
|
80
89
|
|
|
81
|
-
export { Button, Heading, Link, LinkTypes, Text };
|
|
90
|
+
export { Button, Heading, Icon, Link, LinkTypes, Text };
|
package/dist/index.js
CHANGED
|
@@ -38,102 +38,106 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
const ButtonStyle = styled.button `
|
|
41
|
-
|
|
41
|
+
${(_a) => {
|
|
42
42
|
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
43
43
|
var { className, theme, disabled } = _a, props = __rest(_a, ["className", "theme", "disabled"]);
|
|
44
44
|
const buttonStyles = (theme === null || theme === void 0 ? void 0 : theme.button[className]) || {};
|
|
45
45
|
return css `
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
/* Default State */
|
|
47
|
+
background: ${disabled
|
|
48
48
|
? props.background ||
|
|
49
49
|
((_b = buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.disabled) === null || _b === void 0 ? void 0 : _b.background) ||
|
|
50
50
|
"transparent"
|
|
51
51
|
: props.background ||
|
|
52
52
|
((_c = buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.default) === null || _c === void 0 ? void 0 : _c.background) ||
|
|
53
53
|
"transparent"};
|
|
54
|
-
|
|
54
|
+
color: ${disabled
|
|
55
55
|
? props.color || ((_d = buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.disabled) === null || _d === void 0 ? void 0 : _d.text) || "inherit"
|
|
56
56
|
: props.color || ((_e = buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.default) === null || _e === void 0 ? void 0 : _e.text) || "inherit"};
|
|
57
|
-
|
|
57
|
+
border: ${disabled
|
|
58
58
|
? props.border || ((_f = buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.disabled) === null || _f === void 0 ? void 0 : _f.border) || "none"
|
|
59
59
|
: props.border || ((_g = buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.default) === null || _g === void 0 ? void 0 : _g.border) || "none"};
|
|
60
|
-
|
|
60
|
+
opacity: ${disabled
|
|
61
61
|
? (props === null || props === void 0 ? void 0 : props.opacity) || ((_h = buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.disabled) === null || _h === void 0 ? void 0 : _h.opacity) || 0.5
|
|
62
62
|
: 1};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
text-transform: ${(buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.textTransform) || "none"};
|
|
64
|
+
font-family: ${(buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.fontFamily) || "inherit"};
|
|
65
|
+
font-weight: ${props.fontWeight ||
|
|
66
|
+
(buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.fontWeight) ||
|
|
67
|
+
"normal"};
|
|
68
|
+
letter-spacing: ${props.letterSpacing ||
|
|
67
69
|
(buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.letterSpacing) ||
|
|
68
70
|
"normal"};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
font-size: ${props.text || (buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.fontSize) || "inherit"};
|
|
72
|
+
line-height: ${props.lineHeight ||
|
|
73
|
+
(buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.lineHeight) ||
|
|
74
|
+
"normal"};
|
|
75
|
+
padding: ${props.padding || (buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.padding) || "0"};
|
|
76
|
+
border-radius: ${props.radius || (buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.borderRadius) || "0"};
|
|
77
|
+
max-width: ${props.maxWidth || (buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.maxWidth) || "none"};
|
|
78
|
+
max-height: ${props.maxHeight || (buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.maxHeight) || "none"};
|
|
79
|
+
box-shadow: ${props.shadow || (buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.shadow) || "none"};
|
|
80
|
+
transition: ${props.transition ||
|
|
77
81
|
(buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.transition) ||
|
|
78
82
|
"all 0.2s ease"};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
display: ${props.display || (buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.display) || "inline-flex"};
|
|
84
|
+
justify-content: ${(buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.justifyContent) || "center"};
|
|
85
|
+
align-items: ${(buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.alignItems) || "center"};
|
|
86
|
+
cursor: ${disabled
|
|
83
87
|
? "not-allowed"
|
|
84
88
|
: props.cursor || (buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.cursor) || "pointer"};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
overflow: ${props.overflow || (buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.overflow) || "visible"};
|
|
90
|
+
position: ${props.position || (buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.position) || "relative"};
|
|
91
|
+
width: ${props.width || (buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.width) || "auto"};
|
|
92
|
+
height: ${props.height || (buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.height) || "auto"};
|
|
93
|
+
margin: ${props.margin || (buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.margin) || "0"};
|
|
94
|
+
gap: ${props.gap || (buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.gap) || "0"};
|
|
91
95
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
/* Hover State */
|
|
97
|
+
&:hover {
|
|
98
|
+
background: ${!disabled && ((_j = buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.hover) === null || _j === void 0 ? void 0 : _j.background)};
|
|
99
|
+
color: ${!disabled && ((_k = buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.hover) === null || _k === void 0 ? void 0 : _k.text)};
|
|
100
|
+
border: ${!disabled && ((_l = buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.hover) === null || _l === void 0 ? void 0 : _l.border)};
|
|
101
|
+
filter: ${!disabled && ((_m = buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.hover) === null || _m === void 0 ? void 0 : _m.filter)};
|
|
102
|
+
}
|
|
99
103
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
/* Active State */
|
|
105
|
+
&:active {
|
|
106
|
+
background: ${!disabled && ((_o = buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.active) === null || _o === void 0 ? void 0 : _o.background)};
|
|
107
|
+
color: ${!disabled && ((_p = buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.active) === null || _p === void 0 ? void 0 : _p.text)};
|
|
108
|
+
border: ${!disabled && ((_q = buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.active) === null || _q === void 0 ? void 0 : _q.border)};
|
|
109
|
+
filter: ${(!disabled && ((_r = buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.active) === null || _r === void 0 ? void 0 : _r.filter)) ||
|
|
106
110
|
"brightness(0.9)"};
|
|
107
|
-
|
|
111
|
+
}
|
|
108
112
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
/* Focus State */
|
|
114
|
+
&:focus-visible {
|
|
115
|
+
outline: 2px solid ${((_s = buttonStyles === null || buttonStyles === void 0 ? void 0 : buttonStyles.focus) === null || _s === void 0 ? void 0 : _s.outline) || "red"};
|
|
116
|
+
outline-offset: 2px;
|
|
117
|
+
}
|
|
118
|
+
`;
|
|
115
119
|
}}
|
|
116
120
|
|
|
117
|
-
|
|
121
|
+
/* Background as Image */
|
|
118
122
|
${({ background }) => background &&
|
|
119
123
|
css `
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
background: center/cover url(${background});
|
|
125
|
+
background-size: contain;
|
|
126
|
+
background-repeat: no-repeat;
|
|
127
|
+
`}
|
|
124
128
|
|
|
125
129
|
/* Effects */
|
|
126
130
|
${({ effects }) => effects &&
|
|
127
131
|
css `
|
|
128
|
-
|
|
129
|
-
|
|
132
|
+
${effects};
|
|
133
|
+
`}
|
|
130
134
|
`;
|
|
131
135
|
const ImgStyle = styled.svg `
|
|
132
|
-
|
|
133
|
-
|
|
136
|
+
width: 1em;
|
|
137
|
+
height: 1em;
|
|
134
138
|
`;
|
|
135
139
|
|
|
136
|
-
const Button = ({ className = "", disabled = false, image, opacity = "0", background, alt, children, onClick, type = "submit", color, altColor, frame, border, text, fill, effects, padding, flexbox, cursor, margin, display, radius, fontWeight, letterSpacing, shadow, transition, width, height, gap, align
|
|
140
|
+
const Button = ({ className = "", disabled = false, image, opacity = "0", background, alt, children, onClick, type = "submit", color, altColor, frame, border, text, fill, effects, padding, flexbox, cursor, margin, display, radius, fontWeight, letterSpacing, shadow, transition, width, height, gap, align }) => {
|
|
137
141
|
// Log a warning if both `children` and `alt` are missing for accessibility
|
|
138
142
|
if (!children && !alt) {
|
|
139
143
|
console.error(`Provide either "children" or "alt" property to the Button.`);
|
|
@@ -152,35 +156,39 @@ const Button = ({ className = "", disabled = false, image, opacity = "0", backgr
|
|
|
152
156
|
};
|
|
153
157
|
|
|
154
158
|
const TextContainer = styled.p `
|
|
155
|
-
|
|
159
|
+
${(_a) => {
|
|
156
160
|
var _b;
|
|
157
161
|
var { className, theme } = _a, props = __rest(_a, ["className", "theme"]);
|
|
158
162
|
const textStyles = ((_b = theme === null || theme === void 0 ? void 0 : theme.textStyles) === null || _b === void 0 ? void 0 : _b[className]) || {};
|
|
159
163
|
return css `
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
margin: ${props.margin || textStyles.margin};
|
|
165
|
+
font-size: ${props.fontSize || textStyles.fontSize};
|
|
166
|
+
line-height: ${props.lineHeight || textStyles.lineHeight};
|
|
167
|
+
font-weight: ${props.fontWeight ||
|
|
168
|
+
textStyles.fontWeight ||
|
|
169
|
+
"regular"};
|
|
170
|
+
color: ${props.color || textStyles.color};
|
|
171
|
+
`;
|
|
166
172
|
}};
|
|
167
173
|
`;
|
|
168
174
|
const TextContainerLabel = styled.label `
|
|
169
|
-
|
|
175
|
+
${(_a) => {
|
|
170
176
|
var _b;
|
|
171
177
|
var { className, theme } = _a, props = __rest(_a, ["className", "theme"]);
|
|
172
178
|
const textStyles = ((_b = theme === null || theme === void 0 ? void 0 : theme.textStyles) === null || _b === void 0 ? void 0 : _b[className]) || {};
|
|
173
179
|
return css `
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
+
margin: ${props.margin || textStyles.margin};
|
|
181
|
+
font-size: ${props.fontSize || textStyles.fontSize};
|
|
182
|
+
line-height: ${props.lineHeight || textStyles.lineHeight};
|
|
183
|
+
font-weight: ${props.fontWeight ||
|
|
184
|
+
textStyles.fontWeight ||
|
|
185
|
+
"regular"};
|
|
186
|
+
color: ${props.color || textStyles.color};
|
|
187
|
+
`;
|
|
180
188
|
}};
|
|
181
189
|
`;
|
|
182
190
|
|
|
183
|
-
const Text = ({ className, children, htmlFor, margin, color, fontSize, lineHeight, fontWeight, tag, onClick
|
|
191
|
+
const Text = ({ className, children, htmlFor, margin, color, fontSize, lineHeight, fontWeight, tag, onClick }) => {
|
|
184
192
|
// Determine which component to use
|
|
185
193
|
const Wrapper = htmlFor
|
|
186
194
|
? TextContainerLabel
|
|
@@ -189,72 +197,96 @@ const Text = ({ className, children, htmlFor, margin, color, fontSize, lineHeigh
|
|
|
189
197
|
};
|
|
190
198
|
|
|
191
199
|
const HeadingContainer = styled.h1 `
|
|
192
|
-
|
|
200
|
+
${({ className, theme, color, margin, fontSize, fontWeight, lineHeight }) => {
|
|
193
201
|
const { media, heading } = theme;
|
|
194
202
|
const { tinyMobileUp, largeMobileUp, superLargeDesktopUp } = media;
|
|
195
203
|
const headingStyles = (heading === null || heading === void 0 ? void 0 : heading[className]) || {};
|
|
196
204
|
const { mobile, tablet, desktop } = headingStyles;
|
|
197
205
|
return css `
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
206
|
+
${tinyMobileUp} {
|
|
207
|
+
font-size: ${(fontSize === null || fontSize === void 0 ? void 0 : fontSize.small) || mobile.fontSize};
|
|
208
|
+
font-weight: ${(fontWeight === null || fontWeight === void 0 ? void 0 : fontWeight.small) || mobile.fontWeight};
|
|
209
|
+
line-height: ${(lineHeight === null || lineHeight === void 0 ? void 0 : lineHeight.small) || mobile.lineHeight};
|
|
210
|
+
color: ${color || (mobile === null || mobile === void 0 ? void 0 : mobile.color)};
|
|
211
|
+
margin: ${(margin === null || margin === void 0 ? void 0 : margin.small) || mobile.margin};
|
|
212
|
+
}
|
|
213
|
+
${largeMobileUp} {
|
|
214
|
+
font-size: ${(fontSize === null || fontSize === void 0 ? void 0 : fontSize.medium) || tablet.fontSize};
|
|
215
|
+
font-weight: ${(fontWeight === null || fontWeight === void 0 ? void 0 : fontWeight.medium) || tablet.fontWeight};
|
|
216
|
+
line-height: ${(lineHeight === null || lineHeight === void 0 ? void 0 : lineHeight.medium) || tablet.lineHeight};
|
|
217
|
+
color: ${color || (tablet === null || tablet === void 0 ? void 0 : tablet.color)};
|
|
218
|
+
margin: ${(margin === null || margin === void 0 ? void 0 : margin.medium) || tablet.margin};
|
|
219
|
+
}
|
|
220
|
+
${superLargeDesktopUp} {
|
|
221
|
+
font-size: ${(fontSize === null || fontSize === void 0 ? void 0 : fontSize.big) || desktop.fontSize};
|
|
222
|
+
font-weight: ${(fontWeight === null || fontWeight === void 0 ? void 0 : fontWeight.big) || desktop.fontWeight};
|
|
223
|
+
line-height: ${(lineHeight === null || lineHeight === void 0 ? void 0 : lineHeight.big) || desktop.lineHeight};
|
|
224
|
+
color: ${color || (desktop === null || desktop === void 0 ? void 0 : desktop.color)};
|
|
225
|
+
margin: ${(margin === null || margin === void 0 ? void 0 : margin.big) || desktop.margin};
|
|
226
|
+
}
|
|
227
|
+
`;
|
|
228
|
+
}}
|
|
229
|
+
`;
|
|
230
|
+
|
|
231
|
+
const Heading = ({ className, children, margin, color, fontSize, lineHeight, fontWeight }) => (React.createElement(HeadingContainer, { className: classNames("Heading", className), as: className, margin: margin, color: color, fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight }, children));
|
|
232
|
+
|
|
233
|
+
const StyledSvg = styled.svg `
|
|
234
|
+
${(_a) => {
|
|
235
|
+
var { className, theme } = _a, props = __rest(_a, ["className", "theme"]);
|
|
236
|
+
const iconStyles = (theme === null || theme === void 0 ? void 0 : theme.icon[className]) || {};
|
|
237
|
+
return css `
|
|
238
|
+
width: ${props.size || (iconStyles === null || iconStyles === void 0 ? void 0 : iconStyles.size) || "auto"};
|
|
239
|
+
height: ${props.size || (iconStyles === null || iconStyles === void 0 ? void 0 : iconStyles.size) || "auto"};
|
|
240
|
+
fill: ${props.color || (iconStyles === null || iconStyles === void 0 ? void 0 : iconStyles.color)};
|
|
241
|
+
stroke: ${props.stroke || (iconStyles === null || iconStyles === void 0 ? void 0 : iconStyles.stroke)};
|
|
242
|
+
&:hover {
|
|
243
|
+
opacity: 0.8;
|
|
244
|
+
}
|
|
245
|
+
`;
|
|
220
246
|
}}
|
|
221
247
|
`;
|
|
222
248
|
|
|
223
|
-
const
|
|
249
|
+
const Icon = ({ className, svg: SvgIcon, color, size, stroke }) => {
|
|
250
|
+
if (!SvgIcon) {
|
|
251
|
+
console.error("No SVG provided to the Icon component.");
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
return (React.createElement(StyledSvg, { className: classNames("Icon", className), as: SvgIcon, size: size, color: color, stroke: stroke }));
|
|
255
|
+
};
|
|
224
256
|
|
|
225
257
|
const StyledLink = styled.a `
|
|
226
|
-
|
|
258
|
+
${({ className, theme, underline, hoverUnderline, color, hoverColor, fontSize, lineHeight, fontWeight }) => {
|
|
227
259
|
var _a;
|
|
228
260
|
const linkStyles = (theme === null || theme === void 0 ? void 0 : theme.link[className]) || {};
|
|
229
261
|
return css `
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
262
|
+
font-size: ${fontSize || linkStyles.fontSize};
|
|
263
|
+
line-height: ${lineHeight || linkStyles.lineHeight};
|
|
264
|
+
font-weight: ${fontWeight || linkStyles.fontWeight || "regular"};
|
|
265
|
+
color: ${color || (linkStyles === null || linkStyles === void 0 ? void 0 : linkStyles.color)};
|
|
266
|
+
display: inline-block;
|
|
267
|
+
text-decoration: ${underline ? "underline" : "none"};
|
|
268
|
+
cursor: pointer; // add to theme is ever needed
|
|
269
|
+
&:hover {
|
|
270
|
+
text-decoration: ${hoverUnderline !== undefined
|
|
239
271
|
? hoverUnderline
|
|
240
272
|
? "underline"
|
|
241
273
|
: "none"
|
|
242
274
|
: "underline"};
|
|
243
|
-
|
|
244
|
-
|
|
275
|
+
color: ${hoverColor || ((_a = linkStyles.hover) === null || _a === void 0 ? void 0 : _a.color)};
|
|
276
|
+
}
|
|
245
277
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
278
|
+
&:focus {
|
|
279
|
+
outline: 2px solid ${hoverColor || "darkblue"};
|
|
280
|
+
outline-offset: 2px;
|
|
281
|
+
}
|
|
250
282
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
283
|
+
&:disabled {
|
|
284
|
+
pointer-events: none;
|
|
285
|
+
color: gray;
|
|
286
|
+
text-decoration: none;
|
|
287
|
+
cursor: not-allowed;
|
|
288
|
+
}
|
|
289
|
+
`;
|
|
258
290
|
}};
|
|
259
291
|
`;
|
|
260
292
|
|
|
@@ -271,10 +303,10 @@ const Link = (_a) => {
|
|
|
271
303
|
: {
|
|
272
304
|
href,
|
|
273
305
|
target,
|
|
274
|
-
rel: target === "_blank" ? "noopener noreferrer" : undefined
|
|
306
|
+
rel: target === "_blank" ? "noopener noreferrer" : undefined
|
|
275
307
|
};
|
|
276
|
-
return (React.createElement(StyledLink, Object.assign({ className: classNames("Link", className), as: Component }, componentProps, props), children));
|
|
308
|
+
return (React.createElement(StyledLink, Object.assign({ className: classNames("Link", className), as: Component, fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight }, componentProps, props), children));
|
|
277
309
|
};
|
|
278
310
|
|
|
279
|
-
export { Button, Heading, Link, Text };
|
|
311
|
+
export { Button, Heading, Icon, Link, Text };
|
|
280
312
|
//# sourceMappingURL=index.js.map
|