{"id":21131352,"url":"https://github.com/jrop/react-toolbox-dialogs","last_synced_at":"2025-07-09T02:30:42.423Z","repository":{"id":57346557,"uuid":"69704489","full_name":"jrop/react-toolbox-dialogs","owner":"jrop","description":null,"archived":false,"fork":false,"pushed_at":"2017-09-01T17:30:11.000Z","size":2631,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-12-25T16:28:34.360Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jrop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-30T21:48:29.000Z","updated_at":"2018-05-10T20:50:47.000Z","dependencies_parsed_at":"2022-09-11T16:33:16.652Z","dependency_job_id":null,"html_url":"https://github.com/jrop/react-toolbox-dialogs","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrop%2Freact-toolbox-dialogs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrop%2Freact-toolbox-dialogs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrop%2Freact-toolbox-dialogs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrop%2Freact-toolbox-dialogs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jrop","download_url":"https://codeload.github.com/jrop/react-toolbox-dialogs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225476313,"owners_count":17480220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T05:54:51.896Z","updated_at":"2024-11-20T05:54:52.529Z","avatar_url":"https://github.com/jrop.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React-Toolbox Dialogs\n\nA Promise-API for common dialogs (alert/confirm/prompt)\n\n![demo](https://raw.githubusercontent.com/jrop/react-toolbox-dialogs/master/example/demo.gif)\n\n# Installation\n\n```sh\nnpm install --save-dev react-toolbox-dialogs\n```\n\n# Usage\n\n```js\nimport 'normalize.css'\nimport 'react-toolbox/lib/commons.scss'\nimport 'babel-polyfill'\nimport React from 'react'\nimport ReactDOM from 'react-dom'\n\nimport AppBar from 'react-toolbox/lib/app_bar'\nimport { Button } from 'react-toolbox/lib/button'\n\nimport * as dialogs from 'react-toolbox-dialogs'\n\nclass App extends React.Component {\n\tconstructor(props) {\n\t\tsuper(props)\n\t\tthis.state = { result: null }\n\t}\n\tasync onAlert() {\n\t\tawait dialogs.alert('My Alert', 'My message.')\n\t\tthis.setState({ result: 'Alert closed' })\n\t}\n\tasync onConfirm() {\n\t\tconst result = await dialogs.confirm('My Confirm', 'Are you sure?')\n\t\tthis.setState({ result: result ? 'Confirmed' : 'Canceled' })\n\t}\n\tasync onPrompt() {\n\t\tconst result = await dialogs.prompt('My Prompt', 'Enter a string:', 'default')\n\t\tthis.setState({ result: result ? `\"${result}\"` : 'Canceled' })\n\t}\n\trender() {\n\t\treturn \u003cdiv\u003e\n\t\t\t\u003cAppBar title=\"Dialogs\" /\u003e\n\n\t\t\t\u003cdiv style={{ padding: '15px '}}\u003e\n\t\t\t\t\u003cButton raised primary label=\"Alert\" onClick={this.onAlert.bind(this)} /\u003e\u003cbr /\u003e\u003cbr /\u003e\n\t\t\t\t\u003cButton raised primary label=\"Confirm\" onClick={this.onConfirm.bind(this)} /\u003e\u003cbr /\u003e\u003cbr /\u003e\n\t\t\t\t\u003cButton raised primary label=\"Prompt\" onClick={this.onPrompt.bind(this)} /\u003e\u003cbr /\u003e\u003cbr /\u003e\n\n\t\t\t\t{this.state.result \u0026\u0026 \u003cdiv\u003eResult: {this.state.result}\u003c/div\u003e}\n\t\t\t\u003c/div\u003e\n\t\t\u003c/div\u003e\n\t}\n}\n\nwindow.addEventListener('load', function () {\n\tReactDOM.render(\u003cApp /\u003e, document.getElementById('react'))\n})\n```\n\n# License (ISC)\nCopyright (c) 2016, Company or Person's Name \u003cjrapodaca@gmail.com\u003e\n\nPermission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjrop%2Freact-toolbox-dialogs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjrop%2Freact-toolbox-dialogs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjrop%2Freact-toolbox-dialogs/lists"}