Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

@patternfly/pfe-avatar

Package Overview
Dependencies
10
Maintainers
16
Versions
71
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.12.3 to 2.0.0-next.0

custom-elements.json

96

package.json
{
"name": "@patternfly/pfe-avatar",
"pfelement": {
"className": "PfeAvatar",
"elementName": "pfe-avatar",
"preview": "squares.png"
"license": "MIT",
"version": "2.0.0-next.0",
"customElements": "custom-elements.json",
"type": "module",
"main": "./pfe-avatar.js",
"module": "./pfe-avatar.js",
"types": "./pfe-avatar.d.ts",
"exports": {
".": {
"esbuild": "./pfe-avatar.ts",
"default": "./pfe-avatar.js"
},
"./*": {
"esbuild": "./*.ts",
"default": "./*.js"
}
},
"version": "1.12.3",
"description": "Avatar for PatternFly Elements",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"scripts": {
"⚙️-----UTIL-------⚙️": "❓ Manages the repo",
"clean": "git clean -fX -e node_modules -e tsconfig.tsbuildinfo",
"🚚-----DIST-------🚚": "❓ Publish packages",
"prepublishOnly": "npm run build",
"👷‍♀️-----BUILD------👷‍♀️": "❓ Prepare dist artifacts",
"analyze": "cem analyze",
"build": "run-s build:*",
"build:clean": "npm run clean",
"build:esbuild": "node ../../scripts/build.js --include pfe-avatar",
"build:analyze": "npm run analyze",
"build:types": "tsc -b .",
"🧑‍🔬-----TEST-------🧑‍🔬": "❓ Test packages",
"test": "wtr --files './test/*.spec.ts' --config ../../web-test-runner.config.js",
"👷‍♀️-----DEV--------👷‍♀️": "❓ Development aids",
"test:watch": "npm test -- --watch",
"watch:analyze": "npm run analyze -- --watch",
"watch:types": "tsc -w"
},
"keywords": [
"web-components",
"avatar",
"html"

@@ -19,40 +53,26 @@ ],

},
"browserslist": [
"last 2 versions",
"Firefox >= 78",
"iOS >= 8",
"ie 11"
],
"publishConfig": {
"access": "public"
"bugs": {
"url": "https://github.com/patternfly/patternfly-elements/issues"
},
"main": "./dist/pfe-avatar.umd.js",
"module": "./dist/pfe-avatar.js",
"unpkg": "./dist/pfe-avatar.umd.min.js",
"files": [
"dist"
"!*.ts",
"custom-elements.json",
"**/*.LEGAL.txt",
"**/*.css",
"**/*.d.ts",
"**/*.js",
"**/*.js.map",
"!custom-elements-manifest.config.js",
"!demo/*",
"!docs/*",
"!test/*"
],
"scripts": {
"build": "../../node_modules/.bin/gulp && ../../node_modules/.bin/prettier --ignore-path ../../.prettierignore --write '**/*.{js,json}'",
"dev": "../../node_modules/.bin/gulp dev",
"watch": "../../node_modules/.bin/gulp watch",
"test": "../../node_modules/.bin/wct --configFile ../../wct.conf.json elements/pfe-avatar/test/"
},
"contributors": [
{
"name": "Michael Clayton"
}
"Michael Clayton <mclayton@redhat.com>",
"Benny Powers <bennyp@redhat.com>"
],
"license": "MIT",
"devDependencies": {
"@patternfly/pfe-sass": "^1.12.3"
},
"dependencies": {
"@patternfly/pfelement": "^1.12.3"
},
"generator-pfelement-version": "0.6.8",
"bugs": {
"url": "https://github.com/patternfly/patternfly-elements/issues"
},
"gitHead": "8cad71b1de7cb39aa77372fa8ae228b813e700c5"
"@patternfly/pfe-core": "^2.0.0-next.0",
"lit": "^2.1.2"
}
}

@@ -1,5 +0,26 @@

# PFElements Avatar Element
# PatternFly Elements Avatar
`<pfe-avatar>` is an element for displaying a user's avatar image. If the user in question has provided a custom avatar, provide it and it will be displayed. If they don't, a nice colored pattern will be generated based on their name. A specific name will always generate the same pattern, so users' avatars will stay static without the need for storing their generated image.
`pfe-avatar` is an element for displaying a user's avatar image. If the user in question has provided a custom avatar, provide it and it will be displayed. If they don't, a nice colored pattern will be generated based on their name. A specific name will always generate the same pattern, so users' avatars will stay static without the need for storing their generated image.
Read more about Avatar in the [PatternFly Elements Avatar documentation](https://patternflyelements.org/components/avatar)
## Installation
Load `<pfe-avatar>` via CDN:
```html
<script src="https://unpkg.com/@patternfly/pfe-avatar?module"></script>
```
Or, if you are using [NPM](https://npm.im), install it
```bash
npm install @patternfly/pfe-avatar
```
Then once installed, import it to your application:
```js
import '@patternfly/pfe-avatar';
```
## Usage

@@ -17,50 +38,1 @@

## Attributes
### pfe-name (observed) (required)
The user's name, either given name and family name, or username. When displaying a pattern, the name will be used to seed the pattern generator.
### pfe-src (observed)
The URL to the user's custom avatar image. It will be displayed instead of a random pattern.
### pfe-pattern (observed)
The type of pattern to display. Currently supported values are `"squares"` and `"triangles"`.
| squares | triangles |
| ------------------------------- | ----------------------------------- |
| ![squares image](./squares.png) | ![triangles image](./triangles.png) |
### pfe-shape (observed)
The shape of the avatar itself. Supported values are `"square"` (default), `"rounded"`, and `"circle"`.
## Styling
| Theme hook | Description | Default |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| `--pfe-avatar--colors` | A space-delimited list of colors to use for generated patterns. Only hex values are supported, ex: `#fc0` or `#0fcb41`. Any number of colors may be provided. | `#3B0083 #f0ab00 #007a87 #00b9e4 #92d400` |
## Test
npm run test
## Build
npm run build
## Demo
From the PFElements root directory, run:
npm start
## Code style
Avatar (and all PFElements) use [Prettier][prettier] to auto-format JS and JSON. The style rules get applied when you commit a change. If you choose to, you can [integrate your editor][prettier-ed] with Prettier to have the style rules applied on every save.
[prettier]: https://github.com/prettier/prettier/
[prettier-ed]: https://prettier.io/docs/en/editors.html
[web-component-tester]: https://github.com/Polymer/web-component-tester
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc