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

@snack-uikit/modal

v0.9.21

Published

## Installation `npm i @snack-uikit/modal`

Downloads

329

Readme

Modal

Installation

npm i @snack-uikit/modal

Changelog

Пакет экспортирует 2 компонента:

  • Modal - компонент модального окна с определенным поведением и параметрами
  • ModalCustom - конструктор модального окна, позволяющий собрать компонент самостоятельно Содержит в себе дополнительные компоненты:
    • ModalCustom.Header
    • ModalCustom.Body
    • ModalCustom.Footer

ModalCustom

Props

| name | type | default value | description | |------|------|---------------|-------------| | children* | ReactNode | - | Контент | | onClose* | () => void | - | Колбек закрытия компонента. | | open* | boolean | - | Управляет состоянием показан/не показан. | | mode | enum Mode: "regular", "aggressive", "forced" | regular | Режим отображения модального окна: - Regular - есть кнопка закрытия, клик на оверлей и нажатие кнопки Esc закрывают модалку - Aggressive - есть кнопка закрытия, но выключен клик на оверлей и не работает закрытие по клавише Esc - Forced - закрыть модальное окно можно только по нажатию на кнопку действия в нижней части | | size | enum Size: "s", "m", "l" | s | Размер модального окна | | className | string | - | CSS-класс |

ModalCustom.Header

Props

| name | type | default value | description | |------|------|---------------|-------------| | title* | ReactNode | - | Заголовок модального окна | | titleTooltip | ReactNode | - | Тултип для заголовка | | subtitle | ReactNode | - | Подзаголовок | | picture | JSXElementConstructor<{ size?: number; className?: string; }> \| ModalHeaderImage | - | Можно передать иконку из пакета @snack-uikit/icon-predefined или путь к картинке и атрибут alt | | align | enum ContentAlign: "default", "center" | - | Выравнивание контента | | className | string | - | CSS-класс |

ModalCustom.Body

Props

| name | type | default value | description | |------|------|---------------|-------------| | content* | ReactNode | - | Содержимое модального окна | | align | enum ContentAlign: "default", "center" | - | Выравнивание контента | | className | string | - | CSS-класс |

ModalCustom.Footer

Props

| name | type | default value | description | |------|------|---------------|-------------| | actions* | ReactNode | - | Параметр для передачи кнопок | | disclaimer | ReactNode | - | Параметр для небольшого текста под кнопками | | align | enum Align: "vertical", "default", "center" | - | Выравнивание контента | | className | string | - | CSS-класс |

Modal

Props

| name | type | default value | description | |------|------|---------------|-------------| | approveButton* | Omit<ButtonFilledProps, "data-test-id" \| "size"> | - | Основная кнопка действия | | title* | string | - | Заголовок модального окна | | onClose* | () => void | - | Колбек закрытия компонента. | | open* | boolean | - | Управляет состоянием показан/не показан. | | mode | enum Mode: "regular", "aggressive", "forced" | regular | Режим отображения модального окна: - Regular - есть кнопка закрытия, клик на оверлей и нажатие кнопки Esc закрывают модалку - Aggressive - есть кнопка закрытия, но выключен клик на оверлей и не работает закрытие по клавише Esc - Forced - закрыть модальное окно можно только по нажатию на кнопку действия в нижней части | | className | string | - | CSS-класс | | titleTooltip | ReactNode | - | Всплывающая подсказка для заголовка | | subtitle | string | - | Подзаголовок | | content | ReactNode | - | Содержимое модального окна | | cancelButton | Omit<ButtonOutlineProps, "data-test-id" \| "size"> | - | Кнопка отмены | | additionalButton | Omit<ButtonSimpleProps, "data-test-id" \| "size"> | - | Вторая кнопка действия | | disclaimer | { text: string; link?: Pick<LinkProps, "text" \| "href" \| "target">; } | - | Небольшой текст под кнопками футера с возможностью передать дополнительно ссылку | | size | "s" | "m" | "l" | s | Размер | | align | enum Align: "vertical", "default", "center" | default | Выравнивание, для разных размеров доступны разные значения для size=s - все для size=m - align=default \| center для size=l - align=default | | picture | JSXElementConstructor<{ size?: number; className?: string; }> \| ModalHeaderImage | - | Можно передать иконку из пакета @snack-uikit/icon-predefined, или путь к картинке и атрибут alt |