UNPKG

@vaadin/avatar

Version:
388 lines (387 loc) 14.9 kB
{ "schemaVersion": "1.0.0", "readme": "", "modules": [ { "kind": "javascript-module", "path": "vaadin-avatar.js", "declarations": [], "exports": [ { "kind": "js", "name": "*", "declaration": { "name": "*", "module": "src/vaadin-avatar.js" } } ] }, { "kind": "javascript-module", "path": "src/vaadin-avatar-mixin.js", "declarations": [ { "kind": "mixin", "description": "A mixin providing common avatar functionality.", "name": "AvatarMixin", "members": [ { "kind": "field", "name": "abbr", "privacy": "public", "type": { "text": "string" }, "description": "A shortened form of name that is displayed\nin the avatar when `img` is not provided.", "attribute": "abbr" }, { "kind": "field", "name": "colorIndex", "privacy": "public", "type": { "text": "number" }, "description": "Color index used for avatar background.", "attribute": "color-index" }, { "kind": "field", "name": "i18n", "privacy": "public", "type": { "text": "Object" }, "description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following JSON structure and default values:\n```js\n{\n // Translation of the anonymous user avatar tooltip.\n anonymous: 'anonymous'\n}\n```", "attribute": "i18n", "inheritedFrom": { "name": "I18nMixin", "package": "@vaadin/component-base/src/i18n-mixin.js" } }, { "kind": "field", "name": "img", "privacy": "public", "type": { "text": "string" }, "description": "The path to the image", "attribute": "img" }, { "kind": "field", "name": "name", "privacy": "public", "type": { "text": "string" }, "description": "Full name of the user\nused for the tooltip of the avatar.", "attribute": "name" }, { "kind": "field", "name": "withTooltip", "privacy": "public", "type": { "text": "boolean" }, "description": "When true, the avatar has tooltip shown on hover and focus.\nThe tooltip text is based on the `name` and `abbr` properties.\nWhen neither is provided, `i18n.anonymous` is used instead.", "attribute": "with-tooltip" } ], "attributes": [ { "name": "abbr", "type": { "text": "string" }, "description": "A shortened form of name that is displayed\nin the avatar when `img` is not provided.", "fieldName": "abbr" }, { "name": "color-index", "type": { "text": "number" }, "description": "Color index used for avatar background.", "fieldName": "colorIndex" }, { "name": "i18n", "type": { "text": "Object" }, "description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nShould be overridden by subclasses to provide a custom JSDoc with the\ndefault I18N properties.", "fieldName": "i18n", "inheritedFrom": { "name": "I18nMixin", "package": "@vaadin/component-base/src/i18n-mixin.js" } }, { "name": "img", "type": { "text": "string" }, "description": "The path to the image", "fieldName": "img" }, { "name": "name", "type": { "text": "string" }, "description": "Full name of the user\nused for the tooltip of the avatar.", "fieldName": "name" }, { "name": "with-tooltip", "type": { "text": "boolean" }, "description": "When true, the avatar has tooltip shown on hover and focus.\nThe tooltip text is based on the `name` and `abbr` properties.\nWhen neither is provided, `i18n.anonymous` is used instead.", "fieldName": "withTooltip" } ], "mixins": [ { "name": "I18nMixin", "package": "@vaadin/component-base/src/i18n-mixin.js" }, { "name": "FocusMixin", "package": "@vaadin/a11y-base/src/focus-mixin.js" } ], "parameters": [ { "name": "superClass" } ] } ], "exports": [ { "kind": "js", "name": "AvatarMixin", "declaration": { "name": "AvatarMixin", "module": "src/vaadin-avatar-mixin.js" } } ] }, { "kind": "javascript-module", "path": "src/vaadin-avatar.js", "declarations": [ { "kind": "class", "description": "`<vaadin-avatar>` is a Web Component providing avatar displaying functionality.\n\n```html\n<vaadin-avatar img=\"avatars/avatar-1.jpg\"></vaadin-avatar>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n--------- | ---------------\n`abbr` | The abbreviation element\n`icon` | The icon element\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property | Description\n-------------------------------|-------------\n`--vaadin-avatar-background` | Background color of the avatar\n`--vaadin-avatar-border-color` | Border color of the avatar\n`--vaadin-avatar-border-width` | Border width of the avatar\n`--vaadin-avatar-font-size` | Font size of the avatar\n`--vaadin-avatar-font-weight` | Font weight of the avatar\n`--vaadin-avatar-size` | Size of the avatar\n`--vaadin-avatar-text-color` | Text color of the avatar\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n------------------|-------------\n`focus-ring` | Set when the avatar is focused using the keyboard.\n`focused` | Set when the avatar is focused.\n`has-color-index` | Set when the avatar has `colorIndex` and the corresponding custom CSS property exists.\n`has-tooltip` | Set when the element has a slotted tooltip.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.", "name": "Avatar", "members": [ { "kind": "field", "name": "abbr", "privacy": "public", "type": { "text": "string" }, "description": "A shortened form of name that is displayed\nin the avatar when `img` is not provided.", "attribute": "abbr", "inheritedFrom": { "name": "AvatarMixin", "module": "src/vaadin-avatar-mixin.js" } }, { "kind": "field", "name": "colorIndex", "privacy": "public", "type": { "text": "number" }, "description": "Color index used for avatar background.", "attribute": "color-index", "inheritedFrom": { "name": "AvatarMixin", "module": "src/vaadin-avatar-mixin.js" } }, { "kind": "field", "name": "i18n", "privacy": "public", "type": { "text": "Object" }, "description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following JSON structure and default values:\n```js\n{\n // Translation of the anonymous user avatar tooltip.\n anonymous: 'anonymous'\n}\n```", "attribute": "i18n", "inheritedFrom": { "name": "I18nMixin", "package": "@vaadin/component-base/src/i18n-mixin.js" } }, { "kind": "field", "name": "img", "privacy": "public", "type": { "text": "string" }, "description": "The path to the image", "attribute": "img", "inheritedFrom": { "name": "AvatarMixin", "module": "src/vaadin-avatar-mixin.js" } }, { "kind": "field", "name": "name", "privacy": "public", "type": { "text": "string" }, "description": "Full name of the user\nused for the tooltip of the avatar.", "attribute": "name", "inheritedFrom": { "name": "AvatarMixin", "module": "src/vaadin-avatar-mixin.js" } }, { "kind": "field", "name": "withTooltip", "privacy": "public", "type": { "text": "boolean" }, "description": "When true, the avatar has tooltip shown on hover and focus.\nThe tooltip text is based on the `name` and `abbr` properties.\nWhen neither is provided, `i18n.anonymous` is used instead.", "attribute": "with-tooltip", "inheritedFrom": { "name": "AvatarMixin", "module": "src/vaadin-avatar-mixin.js" } } ], "mixins": [ { "name": "AvatarMixin", "module": "src/vaadin-avatar-mixin.js" }, { "name": "ElementMixin", "package": "@vaadin/component-base/src/element-mixin.js" }, { "name": "ThemableMixin", "package": "@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js" }, { "name": "PolylitMixin", "package": "@vaadin/component-base/src/polylit-mixin.js" }, { "name": "LumoInjectionMixin", "package": "@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js" } ], "superclass": { "name": "LitElement", "package": "lit" }, "tagName": "vaadin-avatar", "customElement": true, "attributes": [ { "name": "abbr", "type": { "text": "string" }, "description": "A shortened form of name that is displayed\nin the avatar when `img` is not provided.", "fieldName": "abbr", "inheritedFrom": { "name": "AvatarMixin", "module": "src/vaadin-avatar-mixin.js" } }, { "name": "color-index", "type": { "text": "number" }, "description": "Color index used for avatar background.", "fieldName": "colorIndex", "inheritedFrom": { "name": "AvatarMixin", "module": "src/vaadin-avatar-mixin.js" } }, { "name": "i18n", "type": { "text": "Object" }, "description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nShould be overridden by subclasses to provide a custom JSDoc with the\ndefault I18N properties.", "fieldName": "i18n", "inheritedFrom": { "name": "I18nMixin", "package": "@vaadin/component-base/src/i18n-mixin.js" } }, { "name": "img", "type": { "text": "string" }, "description": "The path to the image", "fieldName": "img", "inheritedFrom": { "name": "AvatarMixin", "module": "src/vaadin-avatar-mixin.js" } }, { "name": "name", "type": { "text": "string" }, "description": "Full name of the user\nused for the tooltip of the avatar.", "fieldName": "name", "inheritedFrom": { "name": "AvatarMixin", "module": "src/vaadin-avatar-mixin.js" } }, { "name": "with-tooltip", "type": { "text": "boolean" }, "description": "When true, the avatar has tooltip shown on hover and focus.\nThe tooltip text is based on the `name` and `abbr` properties.\nWhen neither is provided, `i18n.anonymous` is used instead.", "fieldName": "withTooltip", "inheritedFrom": { "name": "AvatarMixin", "module": "src/vaadin-avatar-mixin.js" } } ], "events": [] } ], "exports": [ { "kind": "js", "name": "Avatar", "declaration": { "name": "Avatar", "module": "src/vaadin-avatar.js" } } ] } ] }