@wordpress/components 32.3.1-next.v.202602271551.0 → 32.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.
- package/CHANGELOG.md +22 -1
- package/build/alignment-matrix-control/cell.cjs +2 -2
- package/build/alignment-matrix-control/cell.cjs.map +1 -1
- package/build/alignment-matrix-control/index.cjs +2 -2
- package/build/alignment-matrix-control/index.cjs.map +1 -1
- package/build/angle-picker-control/angle-circle.cjs +2 -2
- package/build/angle-picker-control/angle-circle.cjs.map +1 -1
- package/build/calendar/utils/constants.cjs +1 -0
- package/build/calendar/utils/constants.cjs.map +2 -2
- package/build/date-time/date/styles.cjs +9 -9
- package/build/date-time/date/styles.cjs.map +2 -2
- package/build/date-time/time/index.cjs +1 -1
- package/build/date-time/time/index.cjs.map +2 -2
- package/build/date-time/utils.cjs +9 -0
- package/build/date-time/utils.cjs.map +2 -2
- package/build/menu/radio-item.cjs +1 -1
- package/build/menu/radio-item.cjs.map +2 -2
- package/build/private-apis.cjs +0 -4
- package/build/private-apis.cjs.map +3 -3
- package/build/tooltip/index.cjs +1 -1
- package/build/tooltip/index.cjs.map +1 -1
- package/build/visually-hidden/styles.cjs +2 -1
- package/build/visually-hidden/styles.cjs.map +2 -2
- package/build-module/alignment-matrix-control/cell.mjs +2 -2
- package/build-module/alignment-matrix-control/cell.mjs.map +1 -1
- package/build-module/alignment-matrix-control/index.mjs +2 -2
- package/build-module/alignment-matrix-control/index.mjs.map +1 -1
- package/build-module/angle-picker-control/angle-circle.mjs +2 -2
- package/build-module/angle-picker-control/angle-circle.mjs.map +1 -1
- package/build-module/calendar/utils/constants.mjs +1 -0
- package/build-module/calendar/utils/constants.mjs.map +2 -2
- package/build-module/date-time/date/styles.mjs +9 -9
- package/build-module/date-time/date/styles.mjs.map +2 -2
- package/build-module/date-time/time/index.mjs +2 -2
- package/build-module/date-time/time/index.mjs.map +2 -2
- package/build-module/date-time/utils.mjs +8 -0
- package/build-module/date-time/utils.mjs.map +2 -2
- package/build-module/menu/radio-item.mjs +1 -1
- package/build-module/menu/radio-item.mjs.map +2 -2
- package/build-module/private-apis.mjs +0 -4
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/tooltip/index.mjs +1 -1
- package/build-module/tooltip/index.mjs.map +1 -1
- package/build-module/visually-hidden/styles.mjs +2 -1
- package/build-module/visually-hidden/styles.mjs.map +2 -2
- package/build-style/style-rtl.css +11 -184
- package/build-style/style.css +11 -184
- package/build-types/alignment-matrix-control/stories/index.story.d.ts +1 -1
- package/build-types/alignment-matrix-control/stories/index.story.d.ts.map +1 -1
- package/build-types/angle-picker-control/stories/index.story.d.ts +1 -1
- package/build-types/animate/stories/index.story.d.ts +7 -7
- package/build-types/animate/stories/index.story.d.ts.map +1 -1
- package/build-types/base-control/stories/index.story.d.ts +1 -1
- package/build-types/border-box-control/stories/index.story.d.ts +1 -1
- package/build-types/border-control/stories/index.story.d.ts +5 -5
- package/build-types/box-control/stories/index.story.d.ts +7 -7
- package/build-types/box-control/stories/index.story.d.ts.map +1 -1
- package/build-types/button/stories/e2e/index.story.d.ts +1 -1
- package/build-types/button/stories/e2e/index.story.d.ts.map +1 -1
- package/build-types/button/stories/index.story.d.ts +7 -7
- package/build-types/button/stories/index.story.d.ts.map +1 -1
- package/build-types/calendar/stories/date-calendar.story.d.ts +5 -0
- package/build-types/calendar/stories/date-calendar.story.d.ts.map +1 -1
- package/build-types/calendar/stories/date-range-calendar.story.d.ts +5 -0
- package/build-types/calendar/stories/date-range-calendar.story.d.ts.map +1 -1
- package/build-types/calendar/types.d.ts +12 -0
- package/build-types/calendar/types.d.ts.map +1 -1
- package/build-types/calendar/utils/constants.d.ts +1 -0
- package/build-types/calendar/utils/constants.d.ts.map +1 -1
- package/build-types/circular-option-picker/stories/index.story.d.ts +5 -5
- package/build-types/circular-option-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/combobox-control/stories/index.story.d.ts +4 -4
- package/build-types/confirm-dialog/stories/index.story.d.ts +2 -2
- package/build-types/confirm-dialog/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-gradient-picker/stories/index.story.d.ts +1 -1
- package/build-types/custom-gradient-picker/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-select-control/stories/index.story.d.ts +3 -3
- package/build-types/custom-select-control/stories/index.story.d.ts.map +1 -1
- package/build-types/custom-select-control-v2/stories/index.story.d.ts +3 -3
- package/build-types/date-time/date/styles.d.ts.map +1 -1
- package/build-types/date-time/stories/time.story.d.ts +1 -1
- package/build-types/date-time/stories/time.story.d.ts.map +1 -1
- package/build-types/date-time/time/index.d.ts.map +1 -1
- package/build-types/date-time/utils.d.ts +9 -0
- package/build-types/date-time/utils.d.ts.map +1 -1
- package/build-types/drop-zone/stories/index.story.d.ts +1 -1
- package/build-types/drop-zone/stories/index.story.d.ts.map +1 -1
- package/build-types/duotone-picker/stories/duotone-picker.story.d.ts +1 -1
- package/build-types/duotone-picker/stories/duotone-picker.story.d.ts.map +1 -1
- package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts +3 -3
- package/build-types/duotone-picker/stories/duotone-swatch.story.d.ts.map +1 -1
- package/build-types/focal-point-picker/stories/index.story.d.ts +4 -4
- package/build-types/form-file-upload/stories/index.story.d.ts +5 -5
- package/build-types/form-file-upload/stories/index.story.d.ts.map +1 -1
- package/build-types/guide/stories/index.story.d.ts +1 -1
- package/build-types/guide/stories/index.story.d.ts.map +1 -1
- package/build-types/icon/stories/index.story.d.ts +4 -4
- package/build-types/icon/stories/index.story.d.ts.map +1 -1
- package/build-types/input-control/stories/index.story.d.ts +7 -7
- package/build-types/input-control/stories/index.story.d.ts.map +1 -1
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts +1 -1
- package/build-types/keyboard-shortcuts/stories/index.story.d.ts.map +1 -1
- package/build-types/menu/radio-item.d.ts.map +1 -1
- package/build-types/menu-group/stories/index.story.d.ts +1 -1
- package/build-types/menu-group/stories/index.story.d.ts.map +1 -1
- package/build-types/menu-item/stories/index.story.d.ts +4 -4
- package/build-types/navigation/stories/index.story.d.ts +6 -6
- package/build-types/navigation/stories/index.story.d.ts.map +1 -1
- package/build-types/notice/stories/index.story.d.ts +5 -5
- package/build-types/notice/stories/index.story.d.ts.map +1 -1
- package/build-types/number-control/stories/index.story.d.ts +1 -1
- package/build-types/palette-edit/stories/index.story.d.ts +2 -2
- package/build-types/palette-edit/stories/index.story.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/progress-bar/stories/index.story.d.ts +1 -1
- package/build-types/progress-bar/stories/index.story.d.ts.map +1 -1
- package/build-types/query-controls/stories/index.story.d.ts +1 -1
- package/build-types/query-controls/stories/index.story.d.ts.map +1 -1
- package/build-types/resizable-box/stories/index.story.d.ts +2 -2
- package/build-types/responsive-wrapper/stories/index.story.d.ts +1 -1
- package/build-types/responsive-wrapper/stories/index.story.d.ts.map +1 -1
- package/build-types/sandbox/stories/index.story.d.ts +1 -1
- package/build-types/sandbox/stories/index.story.d.ts.map +1 -1
- package/build-types/search-control/stories/index.story.d.ts +1 -1
- package/build-types/select-control/stories/index.story.d.ts +5 -5
- package/build-types/shortcut/stories/index.story.d.ts +1 -1
- package/build-types/shortcut/stories/index.story.d.ts.map +1 -1
- package/build-types/tab-panel/stories/index.story.d.ts +4 -4
- package/build-types/tab-panel/stories/index.story.d.ts.map +1 -1
- package/build-types/tabs/stories/index.story.d.ts +7 -7
- package/build-types/tabs/stories/index.story.d.ts.map +1 -1
- package/build-types/text/stories/index.story.d.ts +3 -3
- package/build-types/theme/stories/index.story.d.ts +1 -1
- package/build-types/toggle-control/stories/index.story.d.ts +2 -2
- package/build-types/toolbar/stories/index.story.d.ts +3 -3
- package/build-types/toolbar/stories/index.story.d.ts.map +1 -1
- package/build-types/tools-panel/tools-panel/hook.d.ts +1 -1
- package/build-types/tools-panel/types.d.ts +1 -1
- package/build-types/tools-panel/types.d.ts.map +1 -1
- package/build-types/tooltip/stories/index.story.d.ts +1 -1
- package/build-types/tooltip/stories/index.story.d.ts.map +1 -1
- package/build-types/tooltip/types.d.ts +2 -2
- package/build-types/tree-grid/stories/index.story.d.ts +1 -1
- package/build-types/tree-grid/stories/index.story.d.ts.map +1 -1
- package/build-types/tree-select/stories/index.story.d.ts +1 -1
- package/build-types/tree-select/stories/index.story.d.ts.map +1 -1
- package/build-types/v-stack/stories/index.story.d.ts +1 -1
- package/build-types/visually-hidden/styles.d.ts.map +1 -1
- package/package.json +25 -25
- package/src/button-group/stories/index.story.tsx +1 -1
- package/src/calendar/stories/date-calendar.story.tsx +11 -0
- package/src/calendar/stories/date-range-calendar.story.tsx +11 -0
- package/src/calendar/style.scss +5 -0
- package/src/calendar/types.ts +12 -0
- package/src/calendar/utils/constants.ts +1 -0
- package/src/composite/legacy/stories/index.story.tsx +1 -1
- package/src/date-time/date/styles.ts +1 -0
- package/src/date-time/test/utils.test.ts +8 -11
- package/src/date-time/time/index.tsx +2 -12
- package/src/date-time/time/test/index.tsx +69 -0
- package/src/date-time/utils.ts +18 -0
- package/src/guide/style.scss +3 -0
- package/src/menu/radio-item.tsx +1 -1
- package/src/modal/style.scss +4 -7
- package/src/navigation/stories/index.story.tsx +1 -1
- package/src/notice/test/__snapshots__/index.tsx.snap +1 -1
- package/src/private-apis.ts +0 -4
- package/src/radio-group/stories/index.story.tsx +1 -1
- package/src/snackbar/style.scss +1 -0
- package/src/style.scss +0 -2
- package/src/tools-panel/types.ts +4 -1
- package/src/tooltip/README.md +2 -2
- package/src/tooltip/index.tsx +2 -2
- package/src/tooltip/types.ts +2 -2
- package/src/visually-hidden/styles.ts +1 -0
- package/src/visually-hidden/test/__snapshots__/index.tsx.snap +1 -1
- package/build/avatar/component.cjs +0 -99
- package/build/avatar/component.cjs.map +0 -7
- package/build/avatar/index.cjs +0 -37
- package/build/avatar/index.cjs.map +0 -7
- package/build/avatar/types.cjs +0 -19
- package/build/avatar/types.cjs.map +0 -7
- package/build/avatar-group/component.cjs +0 -60
- package/build/avatar-group/component.cjs.map +0 -7
- package/build/avatar-group/index.cjs +0 -37
- package/build/avatar-group/index.cjs.map +0 -7
- package/build/avatar-group/types.cjs +0 -19
- package/build/avatar-group/types.cjs.map +0 -7
- package/build-module/avatar/component.mjs +0 -68
- package/build-module/avatar/component.mjs.map +0 -7
- package/build-module/avatar/index.mjs +0 -6
- package/build-module/avatar/index.mjs.map +0 -7
- package/build-module/avatar/types.mjs +0 -1
- package/build-module/avatar/types.mjs.map +0 -7
- package/build-module/avatar-group/component.mjs +0 -29
- package/build-module/avatar-group/component.mjs.map +0 -7
- package/build-module/avatar-group/index.mjs +0 -6
- package/build-module/avatar-group/index.mjs.map +0 -7
- package/build-module/avatar-group/types.mjs +0 -1
- package/build-module/avatar-group/types.mjs.map +0 -7
- package/build-types/avatar/component.d.ts +0 -5
- package/build-types/avatar/component.d.ts.map +0 -1
- package/build-types/avatar/index.d.ts +0 -3
- package/build-types/avatar/index.d.ts.map +0 -1
- package/build-types/avatar/types.d.ts +0 -59
- package/build-types/avatar/types.d.ts.map +0 -1
- package/build-types/avatar-group/component.d.ts +0 -8
- package/build-types/avatar-group/component.d.ts.map +0 -1
- package/build-types/avatar-group/index.d.ts +0 -3
- package/build-types/avatar-group/index.d.ts.map +0 -1
- package/build-types/avatar-group/types.d.ts +0 -14
- package/build-types/avatar-group/types.d.ts.map +0 -1
- package/src/avatar/component.tsx +0 -82
- package/src/avatar/index.ts +0 -2
- package/src/avatar/styles.scss +0 -152
- package/src/avatar/types.ts +0 -59
- package/src/avatar-group/component.tsx +0 -46
- package/src/avatar-group/index.ts +0 -2
- package/src/avatar-group/styles.scss +0 -32
- package/src/avatar-group/types.ts +0 -13
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// packages/components/src/avatar-group/index.ts
|
|
31
|
-
var avatar_group_exports = {};
|
|
32
|
-
__export(avatar_group_exports, {
|
|
33
|
-
default: () => import_component.default
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(avatar_group_exports);
|
|
36
|
-
var import_component = __toESM(require("./component.cjs"));
|
|
37
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// packages/components/src/avatar-group/types.ts
|
|
17
|
-
var types_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(types_exports);
|
|
19
|
-
//# sourceMappingURL=types.cjs.map
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
// packages/components/src/avatar/component.tsx
|
|
2
|
-
import clsx from "clsx";
|
|
3
|
-
import Icon from "../icon/index.mjs";
|
|
4
|
-
import Tooltip from "../tooltip/index.mjs";
|
|
5
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
-
function Avatar({
|
|
7
|
-
className,
|
|
8
|
-
src,
|
|
9
|
-
name,
|
|
10
|
-
label,
|
|
11
|
-
badge = false,
|
|
12
|
-
size = "default",
|
|
13
|
-
borderColor,
|
|
14
|
-
status,
|
|
15
|
-
statusIndicator,
|
|
16
|
-
style,
|
|
17
|
-
...props
|
|
18
|
-
}) {
|
|
19
|
-
const showBadge = badge && !!name;
|
|
20
|
-
const initials = name ? name.split(/\s+/).slice(0, 2).map((word) => word[0]).join("").toUpperCase() : void 0;
|
|
21
|
-
const customProperties = {
|
|
22
|
-
...style,
|
|
23
|
-
...src ? {
|
|
24
|
-
"--components-avatar-url": `url(${src})`
|
|
25
|
-
} : {},
|
|
26
|
-
...borderColor ? {
|
|
27
|
-
"--components-avatar-outline-color": borderColor
|
|
28
|
-
} : {}
|
|
29
|
-
};
|
|
30
|
-
const avatar = /* @__PURE__ */ _jsxs("div", {
|
|
31
|
-
className: clsx("components-avatar", className, {
|
|
32
|
-
"has-avatar-border-color": !!borderColor,
|
|
33
|
-
"has-src": !!src,
|
|
34
|
-
"has-badge": showBadge,
|
|
35
|
-
"is-small": size === "small",
|
|
36
|
-
"has-status": !!status,
|
|
37
|
-
[`is-${status}`]: !!status
|
|
38
|
-
}),
|
|
39
|
-
style: customProperties,
|
|
40
|
-
role: "img",
|
|
41
|
-
"aria-label": name,
|
|
42
|
-
...props,
|
|
43
|
-
children: [/* @__PURE__ */ _jsxs("span", {
|
|
44
|
-
className: "components-avatar__image",
|
|
45
|
-
children: [!src && initials, !!status && !!statusIndicator && /* @__PURE__ */ _jsx("span", {
|
|
46
|
-
className: "components-avatar__status-indicator",
|
|
47
|
-
children: /* @__PURE__ */ _jsx(Icon, {
|
|
48
|
-
icon: statusIndicator
|
|
49
|
-
})
|
|
50
|
-
})]
|
|
51
|
-
}), showBadge && /* @__PURE__ */ _jsx("span", {
|
|
52
|
-
className: "components-avatar__name",
|
|
53
|
-
children: label || name
|
|
54
|
-
})]
|
|
55
|
-
});
|
|
56
|
-
if (name && (!showBadge || label)) {
|
|
57
|
-
return /* @__PURE__ */ _jsx(Tooltip, {
|
|
58
|
-
text: name,
|
|
59
|
-
children: avatar
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
return avatar;
|
|
63
|
-
}
|
|
64
|
-
var component_default = Avatar;
|
|
65
|
-
export {
|
|
66
|
-
component_default as default
|
|
67
|
-
};
|
|
68
|
-
//# sourceMappingURL=component.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/avatar/component.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport Icon from '../icon';\nimport Tooltip from '../tooltip';\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction Avatar({\n className,\n src,\n name,\n label,\n badge = false,\n size = 'default',\n borderColor,\n status,\n statusIndicator,\n style,\n ...props\n}) {\n const showBadge = badge && !!name;\n const initials = name ? name.split(/\\s+/).slice(0, 2).map(word => word[0]).join('').toUpperCase() : undefined;\n const customProperties = {\n ...style,\n ...(src ? {\n '--components-avatar-url': `url(${src})`\n } : {}),\n ...(borderColor ? {\n '--components-avatar-outline-color': borderColor\n } : {})\n };\n const avatar = /*#__PURE__*/_jsxs(\"div\", {\n className: clsx('components-avatar', className, {\n 'has-avatar-border-color': !!borderColor,\n 'has-src': !!src,\n 'has-badge': showBadge,\n 'is-small': size === 'small',\n 'has-status': !!status,\n [`is-${status}`]: !!status\n }),\n style: customProperties,\n role: \"img\",\n \"aria-label\": name,\n ...props,\n children: [/*#__PURE__*/_jsxs(\"span\", {\n className: \"components-avatar__image\",\n children: [!src && initials, !!status && !!statusIndicator && /*#__PURE__*/_jsx(\"span\", {\n className: \"components-avatar__status-indicator\",\n children: /*#__PURE__*/_jsx(Icon, {\n icon: statusIndicator\n })\n })]\n }), showBadge && /*#__PURE__*/_jsx(\"span\", {\n className: \"components-avatar__name\",\n children: label || name\n })]\n });\n if (name && (!showBadge || label)) {\n return /*#__PURE__*/_jsx(Tooltip, {\n text: name,\n children: avatar\n });\n }\n return avatar;\n}\nexport default Avatar;"],
|
|
5
|
-
"mappings": ";AAGA,OAAO,UAAU;AAKjB,OAAO,UAAU;AACjB,OAAO,aAAa;AACpB,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC3C,SAAS,OAAO;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAG;AACD,QAAM,YAAY,SAAS,CAAC,CAAC;AAC7B,QAAM,WAAW,OAAO,KAAK,MAAM,KAAK,EAAE,MAAM,GAAG,CAAC,EAAE,IAAI,UAAQ,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,YAAY,IAAI;AACpG,QAAM,mBAAmB;AAAA,IACvB,GAAG;AAAA,IACH,GAAI,MAAM;AAAA,MACR,2BAA2B,OAAO,GAAG;AAAA,IACvC,IAAI,CAAC;AAAA,IACL,GAAI,cAAc;AAAA,MAChB,qCAAqC;AAAA,IACvC,IAAI,CAAC;AAAA,EACP;AACA,QAAM,SAAsB,sBAAM,OAAO;AAAA,IACvC,WAAW,KAAK,qBAAqB,WAAW;AAAA,MAC9C,2BAA2B,CAAC,CAAC;AAAA,MAC7B,WAAW,CAAC,CAAC;AAAA,MACb,aAAa;AAAA,MACb,YAAY,SAAS;AAAA,MACrB,cAAc,CAAC,CAAC;AAAA,MAChB,CAAC,MAAM,MAAM,EAAE,GAAG,CAAC,CAAC;AAAA,IACtB,CAAC;AAAA,IACD,OAAO;AAAA,IACP,MAAM;AAAA,IACN,cAAc;AAAA,IACd,GAAG;AAAA,IACH,UAAU,CAAc,sBAAM,QAAQ;AAAA,MACpC,WAAW;AAAA,MACX,UAAU,CAAC,CAAC,OAAO,UAAU,CAAC,CAAC,UAAU,CAAC,CAAC,mBAAgC,qBAAK,QAAQ;AAAA,QACtF,WAAW;AAAA,QACX,UAAuB,qBAAK,MAAM;AAAA,UAChC,MAAM;AAAA,QACR,CAAC;AAAA,MACH,CAAC,CAAC;AAAA,IACJ,CAAC,GAAG,aAA0B,qBAAK,QAAQ;AAAA,MACzC,WAAW;AAAA,MACX,UAAU,SAAS;AAAA,IACrB,CAAC,CAAC;AAAA,EACJ,CAAC;AACD,MAAI,SAAS,CAAC,aAAa,QAAQ;AACjC,WAAoB,qBAAK,SAAS;AAAA,MAChC,MAAM;AAAA,MACN,UAAU;AAAA,IACZ,CAAC;AAAA,EACH;AACA,SAAO;AACT;AACA,IAAO,oBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=types.mjs.map
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// packages/components/src/avatar-group/component.tsx
|
|
2
|
-
import clsx from "clsx";
|
|
3
|
-
import { Children } from "@wordpress/element";
|
|
4
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
-
function AvatarGroup({
|
|
6
|
-
className,
|
|
7
|
-
max = 3,
|
|
8
|
-
children,
|
|
9
|
-
...props
|
|
10
|
-
}) {
|
|
11
|
-
const childArray = Children.toArray(children);
|
|
12
|
-
const visible = childArray.slice(0, max);
|
|
13
|
-
const overflowCount = childArray.length - max;
|
|
14
|
-
return /* @__PURE__ */ _jsxs("div", {
|
|
15
|
-
role: "group",
|
|
16
|
-
className: clsx("components-avatar-group", className),
|
|
17
|
-
...props,
|
|
18
|
-
children: [visible, overflowCount > 0 && /* @__PURE__ */ _jsx("span", {
|
|
19
|
-
className: "components-avatar-group__overflow",
|
|
20
|
-
"aria-label": `${overflowCount} more`,
|
|
21
|
-
children: `+${overflowCount}`
|
|
22
|
-
})]
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
var component_default = AvatarGroup;
|
|
26
|
-
export {
|
|
27
|
-
component_default as default
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=component.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/avatar-group/component.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Children } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nfunction AvatarGroup({\n className,\n max = 3,\n children,\n ...props\n}) {\n const childArray = Children.toArray(children);\n const visible = childArray.slice(0, max);\n const overflowCount = childArray.length - max;\n return /*#__PURE__*/_jsxs(\"div\", {\n role: \"group\",\n className: clsx('components-avatar-group', className),\n ...props,\n children: [visible, overflowCount > 0 && /*#__PURE__*/_jsx(\"span\", {\n className: \"components-avatar-group__overflow\",\n \"aria-label\": `${overflowCount} more`,\n children: `+${overflowCount}`\n })]\n });\n}\nexport default AvatarGroup;"],
|
|
5
|
-
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,gBAAgB;AAKzB,SAAS,OAAO,MAAM,QAAQ,aAAa;AAC3C,SAAS,YAAY;AAAA,EACnB;AAAA,EACA,MAAM;AAAA,EACN;AAAA,EACA,GAAG;AACL,GAAG;AACD,QAAM,aAAa,SAAS,QAAQ,QAAQ;AAC5C,QAAM,UAAU,WAAW,MAAM,GAAG,GAAG;AACvC,QAAM,gBAAgB,WAAW,SAAS;AAC1C,SAAoB,sBAAM,OAAO;AAAA,IAC/B,MAAM;AAAA,IACN,WAAW,KAAK,2BAA2B,SAAS;AAAA,IACpD,GAAG;AAAA,IACH,UAAU,CAAC,SAAS,gBAAgB,KAAkB,qBAAK,QAAQ;AAAA,MACjE,WAAW;AAAA,MACX,cAAc,GAAG,aAAa;AAAA,MAC9B,UAAU,IAAI,aAAa;AAAA,IAC7B,CAAC,CAAC;AAAA,EACJ,CAAC;AACH;AACA,IAAO,oBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=types.mjs.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { AvatarProps } from './types';
|
|
2
|
-
import type { WordPressComponentProps } from '../context';
|
|
3
|
-
declare function Avatar({ className, src, name, label, badge, size, borderColor, status, statusIndicator, style, ...props }: WordPressComponentProps<AvatarProps, 'div', false>): import("react").JSX.Element;
|
|
4
|
-
export default Avatar;
|
|
5
|
-
//# sourceMappingURL=component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/avatar/component.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D,iBAAS,MAAM,CAAE,EAChB,SAAS,EACT,GAAG,EACH,IAAI,EACJ,KAAK,EACL,KAAa,EACb,IAAgB,EAChB,WAAW,EACX,MAAM,EACN,eAAe,EACf,KAAK,EACL,GAAG,KAAK,EACR,EAAE,uBAAuB,CAAE,WAAW,EAAE,KAAK,EAAE,KAAK,CAAE,+BAsDtD;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { IconType } from '../icon';
|
|
2
|
-
export type AvatarProps = {
|
|
3
|
-
/**
|
|
4
|
-
* URL of the avatar image.
|
|
5
|
-
*
|
|
6
|
-
* When not provided, initials derived from `name` are shown.
|
|
7
|
-
*/
|
|
8
|
-
src?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Name of the user. Used as an accessible label and to generate
|
|
11
|
-
* initials when no image is provided.
|
|
12
|
-
*/
|
|
13
|
-
name?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Visible text shown in the hover badge. When not provided, `name`
|
|
16
|
-
* is used instead. Use this to provide contextual labels like "You"
|
|
17
|
-
* without affecting the accessible name or initials.
|
|
18
|
-
*/
|
|
19
|
-
label?: string;
|
|
20
|
-
/**
|
|
21
|
-
* Whether to show the hover-expand badge that reveals the user's
|
|
22
|
-
* name (or `label`) on hover. Requires `name` to be set.
|
|
23
|
-
*
|
|
24
|
-
* @default false
|
|
25
|
-
*/
|
|
26
|
-
badge?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Size of the avatar.
|
|
29
|
-
*
|
|
30
|
-
* - `'default'`: 32px
|
|
31
|
-
* - `'small'`: 24px
|
|
32
|
-
*
|
|
33
|
-
* @default 'default'
|
|
34
|
-
*/
|
|
35
|
-
size?: 'default' | 'small';
|
|
36
|
-
/**
|
|
37
|
-
* CSS color value for an accent border ring around the avatar.
|
|
38
|
-
*
|
|
39
|
-
* When not provided, no border is rendered and the hover badge
|
|
40
|
-
* and avatar status uses the admin theme color as its background.
|
|
41
|
-
*/
|
|
42
|
-
borderColor?: string;
|
|
43
|
-
/**
|
|
44
|
-
* A status string applied to the avatar. When set, the image is
|
|
45
|
-
* dimmed to indicate a non-default state. A corresponding
|
|
46
|
-
* `is-{status}` class is added for custom styling.
|
|
47
|
-
*/
|
|
48
|
-
status?: string;
|
|
49
|
-
/**
|
|
50
|
-
* An icon or custom component rendered as a centered overlay on the
|
|
51
|
-
* avatar image. Only visible when `status` is set.
|
|
52
|
-
*
|
|
53
|
-
* Accepts any value supported by the `Icon` component: an icon from
|
|
54
|
-
* `@wordpress/icons`, a Dashicon name string, a component, or a
|
|
55
|
-
* JSX element.
|
|
56
|
-
*/
|
|
57
|
-
statusIndicator?: IconType | null;
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,MAAM,WAAW,GAAG;IACzB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC3B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CAClC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal dependencies
|
|
3
|
-
*/
|
|
4
|
-
import type { AvatarGroupProps } from './types';
|
|
5
|
-
import type { WordPressComponentProps } from '../context';
|
|
6
|
-
declare function AvatarGroup({ className, max, children, ...props }: WordPressComponentProps<AvatarGroupProps, 'div', false>): import("react").JSX.Element;
|
|
7
|
-
export default AvatarGroup;
|
|
8
|
-
//# sourceMappingURL=component.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/avatar-group/component.tsx"],"names":[],"mappings":"AAUA;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1D,iBAAS,WAAW,CAAE,EACrB,SAAS,EACT,GAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACR,EAAE,uBAAuB,CAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,CAAE,+BAsB3D;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/avatar-group/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export type AvatarGroupProps = {
|
|
2
|
-
/**
|
|
3
|
-
* Maximum number of avatars to display before showing an
|
|
4
|
-
* overflow indicator.
|
|
5
|
-
*
|
|
6
|
-
* @default 3
|
|
7
|
-
*/
|
|
8
|
-
max?: number;
|
|
9
|
-
/**
|
|
10
|
-
* Avatar elements to display in the group.
|
|
11
|
-
*/
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/avatar-group/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC9B;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,CAAC"}
|
package/src/avatar/component.tsx
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import Icon from '../icon';
|
|
10
|
-
import Tooltip from '../tooltip';
|
|
11
|
-
import type { AvatarProps } from './types';
|
|
12
|
-
import type { WordPressComponentProps } from '../context';
|
|
13
|
-
|
|
14
|
-
function Avatar( {
|
|
15
|
-
className,
|
|
16
|
-
src,
|
|
17
|
-
name,
|
|
18
|
-
label,
|
|
19
|
-
badge = false,
|
|
20
|
-
size = 'default',
|
|
21
|
-
borderColor,
|
|
22
|
-
status,
|
|
23
|
-
statusIndicator,
|
|
24
|
-
style,
|
|
25
|
-
...props
|
|
26
|
-
}: WordPressComponentProps< AvatarProps, 'div', false > ) {
|
|
27
|
-
const showBadge = badge && !! name;
|
|
28
|
-
const initials = name
|
|
29
|
-
? name
|
|
30
|
-
.split( /\s+/ )
|
|
31
|
-
.slice( 0, 2 )
|
|
32
|
-
.map( ( word ) => word[ 0 ] )
|
|
33
|
-
.join( '' )
|
|
34
|
-
.toUpperCase()
|
|
35
|
-
: undefined;
|
|
36
|
-
const customProperties = {
|
|
37
|
-
...style,
|
|
38
|
-
...( src ? { '--components-avatar-url': `url(${ src })` } : {} ),
|
|
39
|
-
...( borderColor
|
|
40
|
-
? { '--components-avatar-outline-color': borderColor }
|
|
41
|
-
: {} ),
|
|
42
|
-
} as React.CSSProperties;
|
|
43
|
-
|
|
44
|
-
const avatar = (
|
|
45
|
-
<div
|
|
46
|
-
className={ clsx( 'components-avatar', className, {
|
|
47
|
-
'has-avatar-border-color': !! borderColor,
|
|
48
|
-
'has-src': !! src,
|
|
49
|
-
'has-badge': showBadge,
|
|
50
|
-
'is-small': size === 'small',
|
|
51
|
-
'has-status': !! status,
|
|
52
|
-
[ `is-${ status }` ]: !! status,
|
|
53
|
-
} ) }
|
|
54
|
-
style={ customProperties }
|
|
55
|
-
role="img"
|
|
56
|
-
aria-label={ name }
|
|
57
|
-
{ ...props }
|
|
58
|
-
>
|
|
59
|
-
<span className="components-avatar__image">
|
|
60
|
-
{ ! src && initials }
|
|
61
|
-
{ !! status && !! statusIndicator && (
|
|
62
|
-
<span className="components-avatar__status-indicator">
|
|
63
|
-
<Icon icon={ statusIndicator } />
|
|
64
|
-
</span>
|
|
65
|
-
) }
|
|
66
|
-
</span>
|
|
67
|
-
{ showBadge && (
|
|
68
|
-
<span className="components-avatar__name">
|
|
69
|
-
{ label || name }
|
|
70
|
-
</span>
|
|
71
|
-
) }
|
|
72
|
-
</div>
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
if ( name && ( ! showBadge || label ) ) {
|
|
76
|
-
return <Tooltip text={ name }>{ avatar }</Tooltip>;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return avatar;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export default Avatar;
|
package/src/avatar/index.ts
DELETED
package/src/avatar/styles.scss
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
@use "@wordpress/base-styles/colors" as *;
|
|
2
|
-
@use "@wordpress/base-styles/variables" as *;
|
|
3
|
-
@use "../utils/theme-variables" as *;
|
|
4
|
-
|
|
5
|
-
.components-avatar {
|
|
6
|
-
display: inline-flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
border-radius: $radius-full;
|
|
9
|
-
overflow: clip;
|
|
10
|
-
flex-shrink: 0;
|
|
11
|
-
background-color: $components-color-accent;
|
|
12
|
-
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) $white, $elevation-x-small;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.components-avatar__image {
|
|
16
|
-
box-sizing: border-box;
|
|
17
|
-
position: relative;
|
|
18
|
-
width: $button-size-compact;
|
|
19
|
-
height: $button-size-compact;
|
|
20
|
-
border-radius: $radius-full;
|
|
21
|
-
border: 0;
|
|
22
|
-
background-color: $components-color-accent;
|
|
23
|
-
overflow: clip;
|
|
24
|
-
flex-shrink: 0;
|
|
25
|
-
font-size: 0;
|
|
26
|
-
color: $white;
|
|
27
|
-
|
|
28
|
-
.is-small > & {
|
|
29
|
-
width: $button-size-small;
|
|
30
|
-
height: $button-size-small;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.has-src > & {
|
|
34
|
-
background-image: var(--components-avatar-url);
|
|
35
|
-
background-size: cover;
|
|
36
|
-
background-position: center;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.has-avatar-border-color > & {
|
|
40
|
-
border: var(--wp-admin-border-width-focus) solid var(--components-avatar-outline-color);
|
|
41
|
-
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) $white;
|
|
42
|
-
background-clip: padding-box;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Initials fallback: show name characters when no image.
|
|
47
|
-
.components-avatar:not(.has-src) > .components-avatar__image {
|
|
48
|
-
display: flex;
|
|
49
|
-
align-items: center;
|
|
50
|
-
justify-content: center;
|
|
51
|
-
font-size: $font-size-x-small;
|
|
52
|
-
font-weight: $font-weight-medium;
|
|
53
|
-
border: 0;
|
|
54
|
-
box-shadow: none;
|
|
55
|
-
background-clip: border-box;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.components-avatar:not(.has-src).has-avatar-border-color > .components-avatar__image {
|
|
59
|
-
background-color: var(--components-avatar-outline-color);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.components-avatar__name {
|
|
63
|
-
font-size: $font-size-medium;
|
|
64
|
-
line-height: $font-line-height-small;
|
|
65
|
-
color: $white;
|
|
66
|
-
min-width: 0;
|
|
67
|
-
padding-bottom: calc($grid-unit-05 / 2);
|
|
68
|
-
overflow: hidden;
|
|
69
|
-
opacity: 0;
|
|
70
|
-
white-space: nowrap;
|
|
71
|
-
transition: opacity 0.15s cubic-bezier(0.15, 0, 0.15, 1);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Badge mode: use grid so the name column animates from 0 to natural width.
|
|
75
|
-
// Spacing is on the container (column-gap + padding-inline-end) so it
|
|
76
|
-
// transitions alongside grid-template-columns instead of causing a bump.
|
|
77
|
-
.components-avatar.has-badge {
|
|
78
|
-
display: inline-grid;
|
|
79
|
-
grid-template-columns: min-content 0fr;
|
|
80
|
-
column-gap: 0;
|
|
81
|
-
padding-inline-end: 0;
|
|
82
|
-
transition:
|
|
83
|
-
grid-template-columns 0.3s cubic-bezier(0.15, 0, 0.15, 1),
|
|
84
|
-
column-gap 0.3s cubic-bezier(0.15, 0, 0.15, 1),
|
|
85
|
-
padding-inline-end 0.3s cubic-bezier(0.15, 0, 0.15, 1);
|
|
86
|
-
|
|
87
|
-
&:hover {
|
|
88
|
-
grid-template-columns: min-content 1fr;
|
|
89
|
-
column-gap: $grid-unit-05;
|
|
90
|
-
padding-inline-end: $grid-unit-10;
|
|
91
|
-
transition-timing-function: cubic-bezier(0.85, 0, 0.85, 1);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
&:hover .components-avatar__name {
|
|
95
|
-
opacity: 1;
|
|
96
|
-
transition-timing-function: cubic-bezier(0.85, 0, 0.85, 1);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.components-avatar.has-badge.has-avatar-border-color {
|
|
101
|
-
background-color: var(--components-avatar-outline-color);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Status: dim and desaturate content so the background color shows through.
|
|
105
|
-
// Images: move to ::before with luminosity blend over the solid bg color.
|
|
106
|
-
// Initials: reduce text opacity.
|
|
107
|
-
.components-avatar.has-status.has-src > .components-avatar__image {
|
|
108
|
-
background-image: none;
|
|
109
|
-
|
|
110
|
-
&::before {
|
|
111
|
-
content: "";
|
|
112
|
-
position: absolute;
|
|
113
|
-
inset: 0;
|
|
114
|
-
border-radius: inherit;
|
|
115
|
-
background-image: var(--components-avatar-url);
|
|
116
|
-
background-size: cover;
|
|
117
|
-
background-position: center;
|
|
118
|
-
mix-blend-mode: luminosity;
|
|
119
|
-
opacity: 0.3;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.components-avatar.has-status:not(.has-src) > .components-avatar__image {
|
|
124
|
-
color: rgba($white, 0.3);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.components-avatar.has-status.has-avatar-border-color > .components-avatar__image {
|
|
128
|
-
background-color: var(--components-avatar-outline-color);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.components-avatar__status-indicator {
|
|
132
|
-
position: absolute;
|
|
133
|
-
inset: 0;
|
|
134
|
-
display: flex;
|
|
135
|
-
align-items: center;
|
|
136
|
-
justify-content: center;
|
|
137
|
-
z-index: 1;
|
|
138
|
-
color: $white;
|
|
139
|
-
fill: $white;
|
|
140
|
-
|
|
141
|
-
svg {
|
|
142
|
-
width: 75%;
|
|
143
|
-
height: 75%;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
@media (prefers-reduced-motion: reduce) {
|
|
148
|
-
.components-avatar.has-badge,
|
|
149
|
-
.components-avatar__name {
|
|
150
|
-
transition: none;
|
|
151
|
-
}
|
|
152
|
-
}
|