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

@nozzlegear/react-win-dialog

v1.8.0

Published

An attempt to recreate the Dialog element from WinJS.

Downloads

6

Readme

@nozzlegear/react-win-dialog

An attempt to recreate the Dialog element from WinJS, with full TypeScript definitions.

Screeshot of React Win Dialog

Installation

With Yarn:

yarn install @nozzlegear/react-win-dialog

Or from NPM:

npm install @nozzlegear/react-win-dialog --save

Importing

Import React-Win-Dialog via ES6 default import:

import Dialog from "@nozzlegear/react-win-dialog";

Or via Node's require:

const Dialog = require("@nozzlegear/react-win-dialog").default;

Example

import Dialog from "@nozzlegear/react-win-dialog";

render() {
    return (
        <Dialog
            open={this.state.dialogOpen}
            title={`React Win Dialog`}
            primaryText={`Save Changes`}
            secondaryText={`Close`}
            onSecondaryClick={e => this.setState({dialogOpen: false})}>
            <p>{`Wolf kogi whatever cold-pressed.  Nihil artisan semiotics williamsburg nulla.`}</p>
            <div className={`control-group`}>
                <label>{`Username`}</label>
                <input type={`text`} placeholder={`[email protected]`} />
            </div>
            <div className={`control-group`}>
                <label>{`Password`}</label>
                <input type={`password`} />
            </div>
        </Dialog>
    )
}

Props

Note: React-Win-Dialog has full TypeScript definitions! You should automatically receive intellisense for all of the props documented below:

| Name | Type | Required | Description | |------|------|----------|-------------| | title | string | true | The dialog's title. | | open | boolean | true | Whether the dialog is open or not. | | children | element | true | The dialog's content body. | | danger | boolean | false | Change's the dialog's outline and primary button color to red when true. | | primaryText | string | false | The dialog's primary (right) button text. | | secondaryText | string | false | The dialog's secondary (left) button text. | | onPrimaryClick | function | false | Event handler called when the primary (right) button is clicked. | | onSecondaryClick | function | false | Event handler called when the secondary (left) button is clicked. | | loading | boolean | false | Indicates that data is being loaded or saved. Default false. | | loadingComponent | React.ReactNode | false | A custom component to use as the loading indicator when loading is true. Defaults to a <progress /> element. | | loadingHidesButtons | boolean | false | Whether the dialog should hide its primary and secondary buttons when loading is true. Defaults to true.| | overlayStyle | object | false | CSS style object applied to the overlay container. | | overlayPreventsScrolling | boolean | true | Whether the dialog should prevent scrolling of the body elements under/behind the dialog when the dialog is open. | | containerStyle | object| false | CSS style object applied to the dialog container. | | dialogStyle | object | false | CSS style object applied to the dialog. | | id | string | false | Element id applied to the dialog container. | | className | string | false | CSS classnames applied to the dialog container. |

Styling

If you'd like to style the modal buttons yourself, just use the following CSS rules:

.react-win-dialog-overlay {
    /* This styles the semi-transparent background overlay.
     * Note that the dialog itself is *not* a child of this element.
     */
}

.react-win-dialog-container .react-win-dialog .btn.react-win-dialog-secondary-command {
    /* This styles the secondary (left) button. */
}

.react-win-dialog-container .react-win-dialog .btn.primary.react-win-dialog-primary-command {
    /* This styles the primary (primary) button. */
}

.react-win-dialog-container .react-win-dialog.danger {
    /* This styles the dialog when `danger=true` is passed to the component. */
}

.react-win-dialog-container .react-win-dialog.danger .btn.danger.react-win-dialog-primary-command {
    /* This styles the primary (right) button when `danger=true` is passed to the component. */
}

.react-win-dialog-container .react-win-dialog .react-win-dialog-content .react-win-dialog-loading-container {
    /* This styles the loading indicator container when `loading=true` is passed to the component. */
}

.react-win-dialog-container .react-win-dialog .react-win-dialog-content .react-win-dialog-loading-container progress.react-win-dialog-loading-bar {
    /* This styles the default progress bar used as the loading indicator when `loading=true` is passed to the component without a custom loading indicator component. */
}