@inventage-web-components/avatar-image
Version:
An avatar image based on user initials.
230 lines (229 loc) • 6.02 kB
JSON
{
"schemaVersion": "1.0.0",
"readme": "",
"modules": [
{
"kind": "javascript-module",
"path": "src/AvatarImage.js",
"declarations": [
{
"kind": "class",
"description": "An avatar image based on user initials.",
"name": "AvatarImage",
"cssProperties": [
{
"type": {
"text": "length"
},
"description": "Primary color used for text elements",
"name": "--avatar-image-avatar-max-width",
"default": "100%"
}
],
"cssParts": [
{
"description": "The wrapper element around the avatar image",
"name": "avatar"
},
{
"description": "The avatar image as SVG",
"name": "avatar-image"
}
],
"members": [
{
"kind": "field",
"name": "input",
"type": {
"text": "string | undefined"
},
"description": "The string input to use for generating the avatar image",
"attribute": "input"
}
],
"attributes": [
{
"name": "input",
"type": {
"text": "string | undefined"
},
"description": "The string input to use for generating the avatar image",
"fieldName": "input"
}
],
"superclass": {
"name": "LitElement",
"package": "@inventage-web-components/common"
},
"tagName": "avatar-image",
"customElement": true
}
],
"exports": [
{
"kind": "js",
"name": "AvatarImage",
"declaration": {
"name": "AvatarImage",
"module": "src/AvatarImage.js"
}
}
]
},
{
"kind": "javascript-module",
"path": "src/avatar-image.js",
"declarations": [],
"exports": [
{
"kind": "custom-element-definition",
"name": "avatar-image",
"declaration": {
"name": "AvatarImage",
"module": "/src/AvatarImage.js"
}
}
]
},
{
"kind": "javascript-module",
"path": "src/index.js",
"declarations": [],
"exports": [
{
"kind": "js",
"name": "AvatarImage",
"declaration": {
"name": "AvatarImage",
"module": "./AvatarImage.js"
}
}
]
},
{
"kind": "javascript-module",
"path": "src/styles-css.js",
"declarations": [
{
"kind": "variable",
"name": "styles",
"default": "css`\n.avatar {\n max-width: var(--avatar-image-avatar-max-width, 100%);\n}\n`"
}
],
"exports": [
{
"kind": "js",
"name": "styles",
"declaration": {
"name": "styles",
"module": "src/styles-css.js"
}
}
]
},
{
"kind": "javascript-module",
"path": "src/utils.js",
"declarations": [
{
"kind": "function",
"name": "stringHash",
"parameters": [
{
"name": "string",
"type": {
"text": "string"
},
"description": "the string to generate the hash from"
},
{
"name": "tableSize",
"default": "1000",
"description": "the size of the hash table and is used to limit the range of output values"
}
],
"description": "Simple hash function that generates an integer from a string. It uses bitwise operations and a prime number\nto ensure a relatively even distribution of hash values and to minimize collisions."
},
{
"kind": "function",
"name": "getInitialsFromString",
"parameters": [
{
"name": "string",
"type": {
"text": "string"
}
}
]
},
{
"kind": "variable",
"name": "svgImageDefaultOptions",
"type": {
"text": "Pick<SvgImageOptions, 'backgroundColor' | 'textColor' | 'fontSize' | 'round'>"
},
"default": "{\n backgroundColor: '#000',\n textColor: '#fff',\n fontSize: 0.5,\n round: true,\n}"
},
{
"kind": "function",
"name": "svgImage",
"parameters": [
{
"name": "text",
"type": {
"text": "string"
}
},
{
"name": "size",
"type": {
"text": "number"
}
},
{
"name": "options",
"default": "{}",
"type": {
"text": "Partial<SvgImageOptions>"
}
}
]
}
],
"exports": [
{
"kind": "js",
"name": "stringHash",
"declaration": {
"name": "stringHash",
"module": "src/utils.js"
}
},
{
"kind": "js",
"name": "getInitialsFromString",
"declaration": {
"name": "getInitialsFromString",
"module": "src/utils.js"
}
},
{
"kind": "js",
"name": "svgImageDefaultOptions",
"declaration": {
"name": "svgImageDefaultOptions",
"module": "src/utils.js"
}
},
{
"kind": "js",
"name": "svgImage",
"declaration": {
"name": "svgImage",
"module": "src/utils.js"
}
}
]
}
]
}