npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tjb-auth-verify

v0.0.11

Published

awesome auth-verify webcomponent

Downloads

18

Readme

tjb-auth-verify

Webcomponents verify form field to verify with given credentials

Example

https://tjb-webcomponents.github.io/tjb-auth-verify/

Add to project

You might want to use a Polyfill for WebComponent:

<script src="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/1.2.0/webcomponents-lite.js"></script>

Include via HTML

Include it:

<script
  src="https://tjb-webcomponents.github.io/tjb-auth-verify/tjb-auth-verify.min.js"
  type="module"
></script>

Include via JavaScript

import 'https://tjb-webcomponents.github.io/tjb-auth-verify/tjb-auth-verify.min.js'

Include via NPM

Console:

npm i -S tjb-auth-verify

Then in your code:

import 'tjb-auth-verify';

Useage

<tjb-auth-verify></tjb-auth-verify>

Attributes

Example:

<tjb-auth-verify
  postbody="{ 'foo': 'bar' }"
  posturl="https://jsonplaceholder.typicode.com/users"
  mailurl="https://jsonplaceholder.typicode.com/users"
  email="[email protected]"
>
  <input value="verify" type="submit" slot="submit" />
</tjb-auth-verify>

All attributes:

| attribute | example | description | | --------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | | postbody | postbody="{ 'foo': 'bar' }" | JSON Object that will be added to the remote verify POSt call. | | posturl | posturl="https://jsonplaceholder.typicode.com/users" | URL that will be called with a POST call and credentials as application/json body | | mailurl | mailurl="https://jsonplaceholder.typicode.com/users" | URL that will be called with a POST call as application/json body. The component will send out a POST on initialization | | email | email="[email protected]" | E-Mail that will be used for calls |

Methods

| method | example | description | | ------- | ---------- | ---------------------------------- | | error | .error() | Sets the widget in an error state | | success | .success() | Sets the widget in a success state |

Events

| name | details | description | | ------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------ | | redirect | - href (@String) - target (@string) | triggered when user clicks on links. For instance verify link or forgor password link. | | success | - resp (@Object) | when the verify (post) call returned a success message | | success-email | - resp (@Object) | when the email call returned a success message | | error | - resp (@Object) | when the verify (post) call returned an error message | | sendmail | - body (@Object) | triggered on sendmail request. Hold the body of the potential request (email) | | verify | - body (@Object) | triggered on verification request. Hold the body of the potential request (email, key) |

You can listen to events like so: tjbVerify.addEventListener('verify/success', (e) => { /* do stuff */ }).

Styling

Default public values:

:host {
  --verify-color-info: grey;

  /* notify */
  --verify-notify-background-error: #fa354c;
  --verify-notify-background-success: limegreen;
  --verify-notify-color-error: white;
  --verify-notify-color-success: white;
  --verify-notify-margin: -55px -40px 20px;
  --verify-notify-padding: 15px 15px 15px 35px;

  /* input */
  --verify-input-color-error: #fa354c;
  --verify-input-color-success: limegreen;
  --verify-input-padding: 10px;
  --verify-input-margin: 0 0 30px 0;
  --verify-input-width: 100%;
  --verify-input-border: 1px solid transparent;
  --verify-input-border-bottom: 1px solid lightgrey;
  --verify-input-border-radius: 0;
  --verify-input-font-size: 1rem;
  --verify-input-info-color: grey;
  --verify-input-info-font-size: 0.8rem;
  --verify-input-label-margin: 0 0 5px 0;

  background: #fff;
  display: block;
  max-width: 350px;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  padding: 55px 40px 10px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
}

These can be overwritten easily by targetting the element. Example:

tjb-auth-verify {
  --veridy-input-border: 1px solid lightgrey;
}

Enjoy

Typewriter Gif