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

@blockquote-web-components/blockquote-dialog

v1.1.8

Published

Webcomponent blockquote-dialog following open-wc recommendations

Downloads

112

Readme

Lit

ARIA patterns

A dialog is a window overlaid on either the primary window or another dialog window. Windows under a modal dialog are inert. That is, users cannot interact with content outside an active dialog window. Inert content outside an active dialog is typically visually obscured or dimmed so it is difficult to discern, and in some implementations, attempts to interact with the inert content cause the dialog to close.

Demo

Open in StackBlitz

Usage

<blockquote-dialog>
  <button form="form1" aria-label="close" formnovalidate>X</button>
  <p>Fill in your email address to receive our newsletter!</p>
  <form  id="form1 method="dialog">
    <label for="email">Email (required)</label>
    <input type="email" name="EMAIL" id="email" placeholder="[email protected]" required />
    <button type="submit" name="button">Sign up</button>
  </form>
</blockquote-dialog>

src/BlockquoteDialog.js:

class: BlockquoteDialog, blockquote-dialog

Fields

| Name | Privacy | Type | Default | Description | Inherited From | | ----------------------------- | ------- | --------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------- | | treewalker | | | | | | | dialogRef | | | | | | | open | public | boolean | | Opens the dialog when set to `true` and closes it when set to `false`. | | | _slotTpl | | | | | | | _labeledbyTpl | | | | | | | _contentTpl | | | | | | | _scrollerTpl | | | | | | | _firstNodeFocusTrapTpl | | | | | | | _lastNodeFocusTrapTpl | | | | | | | _isConnectedCallbackResolve | | | | | | | _isConnectedCallback | | | | | | | _firstFocusableChild | | | undefined | | | | _lastFocusableChild | | | undefined | | | | _nextClickIsFromContent | | boolean | false | | | | _overflowRoot | | | | | | | type | public | string | 'alert' | The type of dialog for accessibility. Set this to `alert` to announce a dialog as an alert dialog. | | | label | public | string | '' | The 'label' attribute will be used as the 'aria-label' for the dialog | | | labelledby | public | string | '' | The 'labelledby' attribute will be used as the 'aria-labelledby' for the dialog. It will also be used to create a slot with the same 'id' and 'name'. This slot is hidden by default and its 'name' and 'id' should correspond to the 'slot' attribute of an element in the Light DOM. This connects the 'slot', 'name', and 'id' attributes of a slot to be used with ARIA relationships. | | | labelledbyVisible | public | boolean | false | The 'labelledbyVisible' attribute will control the visibility of the slot created by 'labelledby'. By default, it is set to 'hidden'. | | | returnValue | public | | | Gets or sets the dialog's return value, usually to indicate which button a user pressed to close it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/returnValue returnValue | |

Methods

| Name | Privacy | Description | Parameters | Return | Inherited From | | ------------------------------- | ------- | ----------- | ------------------- | ------ | -------------- | | getIsConnectedCallbackResolve | | | | | | | show | | | | | | | close | | | | | | | _handleSubmit | | | ev: SubmitEvent | | | | _handleOpen | | | | | | | _handleClose | | | ev: Event | | | | _handleCancel | | | ev: Event | | | | _handleDialogClick | | | | | | | _handleContentClick | | | | | | | _firstFocusTrap | | | { relatedTarget } | | | | _lastFocusTrap | | | { relatedTarget } | | |

Events

| Name | Type | Description | Inherited From | | -------- | ---- | ----------- | -------------- | | open | | | | | close | | | | | cancel | | | |

Attributes

| Name | Field | Inherited From | | --------------------- | ----------------- | -------------- | | open | open | | | label | label | | | labelledby | labelledby | | | labelledbyVisible | | | | type | type | | | labelledby-visibile | labelledbyVisible | |

Slots

| Name | Description | | ---- | ----------------------- | | | This element has a slot |

Fields

| Name | Privacy | Type | Default | Description | Inherited From | | ------- | ------- | --------- | ------- | ----------- | -------------- | | #open | private | boolean | false | | |

Exports

| Kind | Name | Declaration | Module | Package | | ---- | ------------------ | ---------------- | ----------------------- | ------- | | js | BlockquoteDialog | BlockquoteDialog | src/BlockquoteDialog.js | |

src/index.js:

Exports

| Kind | Name | Declaration | Module | Package | | ---- | ------------------ | ---------------- | --------------------- | ------- | | js | BlockquoteDialog | BlockquoteDialog | ./BlockquoteDialog.js | |

src/styles/blockqoute-dialog-animations-styles.css.js:

Variables

| Name | Description | Type | | -------- | ----------- | ---- | | styles | | |

Exports

| Kind | Name | Declaration | Module | Package | | ---- | -------- | ----------- | ----------------------------------------------------- | ------- | | js | styles | styles | src/styles/blockqoute-dialog-animations-styles.css.js | |

src/styles/blockquote-dialog-styles.css.js:

Variables

| Name | Description | Type | | -------- | ----------- | ---- | | styles | | |

Exports

| Kind | Name | Declaration | Module | Package | | ---- | -------- | ----------- | ------------------------------------------ | ------- | | js | styles | styles | src/styles/blockquote-dialog-styles.css.js | |

define/blockquote-dialog.js:

Exports

| Kind | Name | Declaration | Module | Package | | --------------------------- | ------------------- | ---------------- | ------------------------ | ------- | | custom-element-definition | blockquote-dialog | BlockquoteDialog | /src/BlockquoteDialog.js | |