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

@lightspeed/cirrus-dialog

v5.0.2

Published

Cirrus Dialog Component

Downloads

330

Readme

Dialog

Reusable and structured dialog box.

Installation

First, make sure you have been through the Getting Started steps of adding Cirrus in your application.

If using Yarn:

yarn add @lightspeed/cirrus-dialog

Or using npm:

npm i -S @lightspeed/cirrus-dialog

Usage

Import required styles in your .scss:

@import '@lightspeed/cirrus-dialog/Dialog.scss';

React Component

Props

| Prop | Type | Default | Required | Description | | ------------- | ------ | ---------- | -------- | --------------------------------------------------------------------------------------------------- | | type | string | default | no | One of default, primary, secondary, danger | | message | string | | yes | String shown in the ModalBody as the message, required | | title | string | | no | String shown in the ModalHeader as title | | isOpen | bool | false | no | State to determine if <Dialog> should be displayed | | isLoading | bool | false | no | State to determine if the actions buttons should be disabled while some promise is getting resolved | | scroll | bool | false | no | State to determine if the body of the modal should be scrollable or not | | onCancel | func | | yes | Function called when the cancel button is clicked, required | | onConfirm | func | | yes | Function called when the confirm button is clicked, required | | cancelText | string | 'Cancel' | no | String shown on the cancel button | | confirmText | string | 'Ok' | no | String shown on the confirm button | | cancelRest | object | | no | Shape with any object pass to the cancel button, e.g({data-test: 'dialog-cancel-button'}) | | confirmRest | object | | no | Shape with any object pass to the confirm button, e.g({data-test: 'dialog-cancel-button'}) |

Example

import React from 'react';
import Dialog from '@lightspeed/cirrus-dialog';

const MyComponent = () => (
  <Dialog
    title="Title"
    message="Messsage"
    isOpen={this.state.isOpen}
    isLoading={this.state.isLoading}
    onCancel={this.onCancel}
    onConfirm={this.onConfirm}
    cancelText="No"
    confirmText="Yes"
    type="danger"
  />
);

export default MyComponent;

CSS Component

Classes

| Type | Class | | ---- | --------------------- | | base | .cr-dialog | | base | .cr-dialog__actions |

Example

<div class="cr-dialog">
    <div class="cr-modal__header">
        <div class="cr-modal__header__content-wrap">Dialog Prompt ''</div>
        <div class="cr-modal__close-wrap"></div>
    </div>
    <div class="cr-modal__body">
        <p class="cr-text-base cr-text--body">Are you sure, are you really really sure? It's your call. </p>
    </div>
    <div class="cr-modal__footer">
        <div class="cr-group cr-dialog__actions">
            <div class="cr-group__item">
                <button type="button" class="cr-button"><span class="cr-button__content">No</span></button>
            </div>
            <div class="cr-group__item">
                <button type="button" class="cr-button cr-button--fill"><span class="cr-button__content">Yes</span></button>
            </div>
        </div>
    </div>
</div>