├── .gitignore ├── src └── modal-dialog.js ├── test └── index.test.js ├── tea.yaml ├── LICENSE ├── package.json └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Directories 2 | node_modules/ 3 | dist/ 4 | coverage/ 5 | .cache/ 6 | 7 | # Files 8 | .env 9 | .DS_Store -------------------------------------------------------------------------------- /src/modal-dialog.js: -------------------------------------------------------------------------------- 1 | // modal-dialog.js 2 | 3 | class ModalDialog { 4 | constructor(title, content) { 5 | this.title = title; 6 | this.content = content; 7 | } 8 | 9 | open() { 10 | // Logika untuk membuka modal dialog 11 | console.log('Modal opened:', this.title); 12 | } 13 | 14 | close() { 15 | // Logika untuk menutup modal dialog 16 | console.log('Modal closed:', this.title); 17 | } 18 | } 19 | 20 | // Export kelas ModalDialog agar dapat digunakan di luar modul 21 | module.exports = ModalDialog; 22 | -------------------------------------------------------------------------------- /test/index.test.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const ModalDialog = require('../src/modal-dialog'); 3 | 4 | describe('ModalDialog', function() { 5 | describe('#open()', function() { 6 | it('should open the modal dialog', function() { 7 | const modal = new ModalDialog('Test Modal', 'This is a test modal'); 8 | modal.open(); 9 | }); 10 | }); 11 | 12 | describe('#close()', function() { 13 | it('should close the modal dialog', function() { 14 | const modal = new ModalDialog('Test Modal', 'This is a test modal'); 15 | modal.close(); 16 | }); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /tea.yaml: -------------------------------------------------------------------------------- 1 | # https://tea.xyz/what-is-this-file 2 | --- 3 | version: 1.0.0 4 | codeOwners: 5 | - '0x9BAac40A197bbb110ae5B2f31342D8d15D734832' 6 | - '0xF7725452f90FaA6a9A71E472361EFf84c5692590' 7 | - '0x0B1A079db288F7A85Fb3C1A2377e1Ff269ee294C' 8 | - '0xe03582db8230714c9bD4333430292EB4b19D3D1B' 9 | - '0x62EAb235Abf5a22e3f20F5B7B951a57ccAA189fB' 10 | - '0xAa56e64aab202e55605fe7d8A792c0e8655d1381' 11 | - '0x754583D770e3B41C64A1114e5d291cCcD7c45C90' 12 | - '0xaB92968a3226A0e93b06631407241986F3E9609D' 13 | - '0xBd6F14a7A2Eb896c6F40808bf355d136409E210E' 14 | - '0x2043dEcdab0cBBda2D7413664459b56272400891' 15 | - '0xE40310fFC4A7FAc222Eb689C8dB095cf635c7A8f' 16 | - '0xe960002d32C4Cef1E9D1eB3b3a52725b33B84462' 17 | quorum: 1 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 ONE DIONYS 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "onedionys-modal-dialog-component", 3 | "version": "5.0.0", 4 | "description": "One Dionys (Modal Dialog Component) - A component to display a modal dialog with additional messages or content.", 5 | "main": "src/modal-dialog.js", 6 | "directories": { 7 | "test": "test" 8 | }, 9 | "scripts": { 10 | "test": "mocha" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/onedionys/onedionys-modal-dialog-component.git" 15 | }, 16 | "keywords": [ 17 | "onedionys", 18 | "tea", 19 | "package-manager", 20 | "modal-dialog-component" 21 | ], 22 | "author": "One Dionys", 23 | "license": "ISC", 24 | "bugs": { 25 | "url": "https://github.com/onedionys/onedionys-modal-dialog-component/issues" 26 | }, 27 | "homepage": "https://github.com/onedionys/onedionys-modal-dialog-component#readme", 28 | "dependencies": { 29 | "@types/chai": "^4.3.12", 30 | "@types/mocha": "^10.0.6", 31 | "chai": "^5.1.0", 32 | "mocha": "^10.3.0" 33 | }, 34 | "devDependencies": { 35 | "chai": "^5.1.0", 36 | "mocha": "^10.3.0" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
A component to display a modal dialog with additional messages or content. 💖
4 | 5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |