@jobber/components 6.110.3 → 6.110.4
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/dist/Avatar-cjs.js +11 -4
- package/dist/Avatar-es.js +11 -4
- package/dist/styles.css +32 -4
- package/package.json +2 -2
package/dist/Avatar-cjs.js
CHANGED
|
@@ -5,7 +5,7 @@ var classnames = require('classnames');
|
|
|
5
5
|
var Color = require('color');
|
|
6
6
|
var Icon = require('./Icon-cjs.js');
|
|
7
7
|
|
|
8
|
-
var styles = {"avatar":"QJpdGzG71k8-","large":"bexrcoi1lZk-","small":"xytAyzEap3U-","isDark":"E0Pgej0H3YA-","initials":"_85roPa-UvXQ-","smallInitials":"meLH-BCeXWU-","hasBorder":"OsEsZnEnjLc-","spinning":"VkgQaQlBDig-"};
|
|
8
|
+
var styles = {"avatar":"QJpdGzG71k8-","large":"bexrcoi1lZk-","small":"xytAyzEap3U-","isDark":"E0Pgej0H3YA-","initials":"_85roPa-UvXQ-","hasCustomColor":"ym1UO0hxjD8-","smallInitials":"meLH-BCeXWU-","hasBorder":"OsEsZnEnjLc-","spinning":"VkgQaQlBDig-"};
|
|
9
9
|
|
|
10
10
|
function isDark(colorToCheck) {
|
|
11
11
|
if (colorToCheck == undefined) {
|
|
@@ -47,12 +47,19 @@ function Avatar({ imageUrl, name, initials, size = "base", color, UNSAFE_classNa
|
|
|
47
47
|
style.backgroundImage = `url(${imageUrl})`;
|
|
48
48
|
}
|
|
49
49
|
const shouldBeDark = color == undefined || isDark(color);
|
|
50
|
+
const hasCustomColor = color != undefined;
|
|
50
51
|
const className = classnames(styles.avatar, size !== "base" && styles[size], {
|
|
51
52
|
[styles.hasBorder]: imageUrl && color,
|
|
52
53
|
[styles.isDark]: shouldBeDark,
|
|
54
|
+
[styles.hasCustomColor]: hasCustomColor,
|
|
53
55
|
});
|
|
56
|
+
const iconColor = hasCustomColor
|
|
57
|
+
? shouldBeDark
|
|
58
|
+
? "white"
|
|
59
|
+
: "text"
|
|
60
|
+
: "textReverse";
|
|
54
61
|
const containerClassNames = classnames(className, UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.container);
|
|
55
|
-
return (React.createElement("div", { className: containerClassNames, style: style, role: imageUrl && "img", "aria-label": name }, !imageUrl && (React.createElement(Initials, { initials: initials,
|
|
62
|
+
return (React.createElement("div", { className: containerClassNames, style: style, role: imageUrl && "img", "aria-label": name }, !imageUrl && (React.createElement(Initials, { initials: initials, iconColor: iconColor, iconSize: size, UNSAFE_className: {
|
|
56
63
|
initials: UNSAFE_className.initials,
|
|
57
64
|
fallbackIcon: UNSAFE_className.fallbackIcon,
|
|
58
65
|
}, UNSAFE_style: {
|
|
@@ -60,9 +67,9 @@ function Avatar({ imageUrl, name, initials, size = "base", color, UNSAFE_classNa
|
|
|
60
67
|
fallbackIcon: UNSAFE_style.fallbackIcon,
|
|
61
68
|
} }))));
|
|
62
69
|
}
|
|
63
|
-
function Initials({ initials,
|
|
70
|
+
function Initials({ initials, iconColor = "textReverse", iconSize = "base", UNSAFE_className, UNSAFE_style, }) {
|
|
64
71
|
if (!initials) {
|
|
65
|
-
return (React.createElement(Icon.Icon, { name: "person", color:
|
|
72
|
+
return (React.createElement(Icon.Icon, { name: "person", color: iconColor, size: iconSize, UNSAFE_className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.fallbackIcon, UNSAFE_style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.fallbackIcon }));
|
|
66
73
|
}
|
|
67
74
|
const className = classnames(styles.initials, UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.initials, {
|
|
68
75
|
[styles.smallInitials]: initials.length > 2,
|
package/dist/Avatar-es.js
CHANGED
|
@@ -3,7 +3,7 @@ import classnames from 'classnames';
|
|
|
3
3
|
import Color from 'color';
|
|
4
4
|
import { I as Icon } from './Icon-es.js';
|
|
5
5
|
|
|
6
|
-
var styles = {"avatar":"QJpdGzG71k8-","large":"bexrcoi1lZk-","small":"xytAyzEap3U-","isDark":"E0Pgej0H3YA-","initials":"_85roPa-UvXQ-","smallInitials":"meLH-BCeXWU-","hasBorder":"OsEsZnEnjLc-","spinning":"VkgQaQlBDig-"};
|
|
6
|
+
var styles = {"avatar":"QJpdGzG71k8-","large":"bexrcoi1lZk-","small":"xytAyzEap3U-","isDark":"E0Pgej0H3YA-","initials":"_85roPa-UvXQ-","hasCustomColor":"ym1UO0hxjD8-","smallInitials":"meLH-BCeXWU-","hasBorder":"OsEsZnEnjLc-","spinning":"VkgQaQlBDig-"};
|
|
7
7
|
|
|
8
8
|
function isDark(colorToCheck) {
|
|
9
9
|
if (colorToCheck == undefined) {
|
|
@@ -45,12 +45,19 @@ function Avatar({ imageUrl, name, initials, size = "base", color, UNSAFE_classNa
|
|
|
45
45
|
style.backgroundImage = `url(${imageUrl})`;
|
|
46
46
|
}
|
|
47
47
|
const shouldBeDark = color == undefined || isDark(color);
|
|
48
|
+
const hasCustomColor = color != undefined;
|
|
48
49
|
const className = classnames(styles.avatar, size !== "base" && styles[size], {
|
|
49
50
|
[styles.hasBorder]: imageUrl && color,
|
|
50
51
|
[styles.isDark]: shouldBeDark,
|
|
52
|
+
[styles.hasCustomColor]: hasCustomColor,
|
|
51
53
|
});
|
|
54
|
+
const iconColor = hasCustomColor
|
|
55
|
+
? shouldBeDark
|
|
56
|
+
? "white"
|
|
57
|
+
: "text"
|
|
58
|
+
: "textReverse";
|
|
52
59
|
const containerClassNames = classnames(className, UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.container);
|
|
53
|
-
return (React__default.createElement("div", { className: containerClassNames, style: style, role: imageUrl && "img", "aria-label": name }, !imageUrl && (React__default.createElement(Initials, { initials: initials,
|
|
60
|
+
return (React__default.createElement("div", { className: containerClassNames, style: style, role: imageUrl && "img", "aria-label": name }, !imageUrl && (React__default.createElement(Initials, { initials: initials, iconColor: iconColor, iconSize: size, UNSAFE_className: {
|
|
54
61
|
initials: UNSAFE_className.initials,
|
|
55
62
|
fallbackIcon: UNSAFE_className.fallbackIcon,
|
|
56
63
|
}, UNSAFE_style: {
|
|
@@ -58,9 +65,9 @@ function Avatar({ imageUrl, name, initials, size = "base", color, UNSAFE_classNa
|
|
|
58
65
|
fallbackIcon: UNSAFE_style.fallbackIcon,
|
|
59
66
|
} }))));
|
|
60
67
|
}
|
|
61
|
-
function Initials({ initials,
|
|
68
|
+
function Initials({ initials, iconColor = "textReverse", iconSize = "base", UNSAFE_className, UNSAFE_style, }) {
|
|
62
69
|
if (!initials) {
|
|
63
|
-
return (React__default.createElement(Icon, { name: "person", color:
|
|
70
|
+
return (React__default.createElement(Icon, { name: "person", color: iconColor, size: iconSize, UNSAFE_className: UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.fallbackIcon, UNSAFE_style: UNSAFE_style === null || UNSAFE_style === void 0 ? void 0 : UNSAFE_style.fallbackIcon }));
|
|
64
71
|
}
|
|
65
72
|
const className = classnames(styles.initials, UNSAFE_className === null || UNSAFE_className === void 0 ? void 0 : UNSAFE_className.initials, {
|
|
66
73
|
[styles.smallInitials]: initials.length > 2,
|
package/dist/styles.css
CHANGED
|
@@ -2011,6 +2011,7 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
|
|
|
2011
2011
|
.QJpdGzG71k8- {
|
|
2012
2012
|
--avatar-size: var(--public--avatar-size);
|
|
2013
2013
|
--avatar-border-size: var(--border-base);
|
|
2014
|
+
--avatar-initials-size: var(--typography--fontSize-small);
|
|
2014
2015
|
|
|
2015
2016
|
display: -ms-flexbox;
|
|
2016
2017
|
|
|
@@ -2034,9 +2035,20 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
|
|
|
2034
2035
|
font-size: 32px;
|
|
2035
2036
|
font-size: var(--avatar-size);
|
|
2036
2037
|
-webkit-font-smoothing: antialiased;
|
|
2037
|
-
background: no-repeat center center hsl(
|
|
2038
|
-
background: no-repeat center center var(--color-
|
|
2038
|
+
background: no-repeat center center hsl(198, 35%, 21%);
|
|
2039
|
+
background: no-repeat center center var(--color-interactive--subtle);
|
|
2039
2040
|
background-size: cover;
|
|
2041
|
+
transition: box-shadow 100ms ease-out;
|
|
2042
|
+
transition: box-shadow var(--timing-quick) ease-out;
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
.QJpdGzG71k8-:hover {
|
|
2046
|
+
box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.1), 0px 4px 12px 0px rgba(0, 0, 0, 0.05);
|
|
2047
|
+
box-shadow: var(--shadow-base);
|
|
2048
|
+
background-color: hsl(197, 90%, 12%);
|
|
2049
|
+
background-color: var(--color-interactive--subtle--hover);
|
|
2050
|
+
transition: box-shadow 100ms ease-in;
|
|
2051
|
+
transition: box-shadow var(--timing-quick) ease-in;
|
|
2040
2052
|
}
|
|
2041
2053
|
|
|
2042
2054
|
.QJpdGzG71k8-:focus {
|
|
@@ -2048,10 +2060,12 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
|
|
|
2048
2060
|
.bexrcoi1lZk- {
|
|
2049
2061
|
--avatar-size: 72px;
|
|
2050
2062
|
--avatar-border-size: var(--border-thick);
|
|
2063
|
+
--avatar-initials-size: 28px;
|
|
2051
2064
|
}
|
|
2052
2065
|
|
|
2053
2066
|
.xytAyzEap3U- {
|
|
2054
2067
|
--avatar-size: 24px;
|
|
2068
|
+
--avatar-initials-size: 9px;
|
|
2055
2069
|
}
|
|
2056
2070
|
|
|
2057
2071
|
/* isDark is dynamic and applies only when background is dark */
|
|
@@ -2062,12 +2076,26 @@ a._7BLGtYNuJOU-.zgRx3ehZ2z8-:hover {
|
|
|
2062
2076
|
}
|
|
2063
2077
|
|
|
2064
2078
|
._85roPa-UvXQ- {
|
|
2065
|
-
|
|
2079
|
+
color: rgba(255, 255, 255, 1);
|
|
2080
|
+
color: var(--color-text--reverse);
|
|
2081
|
+
font-family: Inter, Helvetica, Arial, sans-serif;
|
|
2082
|
+
font-family: var(--typography--fontFamily-normal);
|
|
2083
|
+
font-size: var(--avatar-initials-size);
|
|
2066
2084
|
text-transform: uppercase;
|
|
2067
2085
|
}
|
|
2068
2086
|
|
|
2087
|
+
.QJpdGzG71k8-.ym1UO0hxjD8-.E0Pgej0H3YA- ._85roPa-UvXQ- {
|
|
2088
|
+
color: rgba(255, 255, 255, 1);
|
|
2089
|
+
color: var(--color-base-white);
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
.QJpdGzG71k8-.ym1UO0hxjD8-:not(.E0Pgej0H3YA-) ._85roPa-UvXQ- {
|
|
2093
|
+
color: hsl(198, 35%, 21%);
|
|
2094
|
+
color: var(--color-text);
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2069
2097
|
.meLH-BCeXWU- {
|
|
2070
|
-
font-size: calc(var(--avatar-size)
|
|
2098
|
+
font-size: calc(var(--avatar-initials-size) * 0.83);
|
|
2071
2099
|
}
|
|
2072
2100
|
|
|
2073
2101
|
.OsEsZnEnjLc- {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "6.110.
|
|
3
|
+
"version": "6.110.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -538,5 +538,5 @@
|
|
|
538
538
|
"> 1%",
|
|
539
539
|
"IE 10"
|
|
540
540
|
],
|
|
541
|
-
"gitHead": "
|
|
541
|
+
"gitHead": "da1c6df6c8957db8c84633605ea433e42172dcfc"
|
|
542
542
|
}
|