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

@aegisjsproject/aegis-modal

v0.0.3

Published

An `<aegis-modal>` component built using [`@aegisjsproject/component`](https://npmjs.org/package/@aegisjsproject/component)

Downloads

127

Readme

@aegisjsproject/aegis-modal

An <aegis-modal> component built using @aegisjsproject/component, offering full built-in accessibility, customization, and enhanced security.

CodeQL Node CI Lint Code Base

GitHub license GitHub last commit GitHub release GitHub Sponsors

npm node-current NPM Unpacked Size npm

GitHub followers GitHub forks GitHub stars Twitter Follow

Donate using Liberapay


Important differences compared to <dialog>

  • <aegis-modal> is modal-only
  • <aegis-modal> SHOULD only be appended as a direct child of <body>
  • <aegis-modal> automatically adds a sticky header and close button
  • Provides simple open/close animations
  • Has an autoremove attribute to automatically remove the element once closed
  • Supports an optional AbortController in the show({ signal }) method
  • Adds whenOpened and whenClosed getter methods, returning relevant promises
  • Adds a static create() method, which creates and optionally appends and opens if given a signal

Compatibility / polyfills

The entire AegisJSProject ecosystem requires support for Element.prototype.setHTML() and Constructable Stylesheets. Additionally, Promise.withResolvers() as well as inert are also required for proper functionality.

Such polyfills are not included to avoid the bloat/duplication of polyfills. However, an extensive polyfill script that ensures compatibility is available via:

<script type="application/javascript" defer="" referrerpolicy="no-referrer" crossorigin="anonymous" integrity="sha384-Shkrmxly5RI9mCU8DQr6l4VLVJzjPzgx9KP/f5i7pEcl7ZUt0wHiAweGjbpjU2d5" src="https://unpkg.com/@shgysk8zer0/[email protected]/all.min.js" fetchpriority="auto"></script>

Installation

Via CDN:

<script type="module" src="https://unpkg.com/@aegisjsproject/aegis-modal[@:version]/aegis-modal.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

Via npm

npm i @aegisjsproject/aegis-markdown

Via Git Submodule

git subomdule add https://github.com/AegisJSProject/aegis-modal [:destination]

Using <script type="importmap">

All @aegisjsproject/* libraries are available and ready to use without a build process such as webpack, but will require a <script type="importmap"> that includes all dependencies:

Short & Basic

<script type="importmap">
{
  "imports": {
    "@aegisjsproject/": "https://unpkg.com/@aegisjsproject/"
  }
}
</script>

More detailed & with versions

{
  "imports": {
    "@aegisjsproject/core/": "https://unpkg.com/@aegisjsproject/[email protected]/",
    "@aegisjsproject/styles/": "https://unpkg.com/@aegisjsproject/[email protected]/",
    "@aegisjsproject/component/": "https://unpkg.com/@aegisjsproject/[email protected]/",
    "@aegisjsproject/aegis-modal/": "https://unpkg.com/@aegisjsproject/[email protected]/"
  }
}

... or ...

<script type="importmap">
{
  "imports": {
    "@aegisjsproject/": "/node_modules/@aegisjsproject/"
  }
}
</script>

Example

<aegis-modal>
  <h1 slot="heading">Lorem Ipsum</h1>
  <p>Error aut mollitia qui alias aut. Temporibus vitae impedit deserunt repellat voluptatibus et. Minima aut et tempore. Ut officiis sed consectetur. Voluptas praesentium ipsam rerum eligendi dolorum. Voluptatem similique omnis quis quidem.</p>
</aegis-modal>