From b8e4bb9ab3f49cc4b2f2166eeec3781739c28208 Mon Sep 17 00:00:00 2001 From: azabroflovski Date: Sat, 4 May 2024 22:35:01 +0500 Subject: [PATCH] feat: rename native-modal => tiny-dialogue --- README.md | 16 +++--- docs/.vitepress/config.ts | 6 +-- docs/index.md | 4 +- docs/introduction.md | 8 +-- docs/quick-start.md | 20 +++---- package-lock.json | 4 +- package.json | 13 +++-- src/lib/index.ts | 106 +------------------------------------- src/lib/plain.ts | 99 +++++++++++++++++++++++++++++++++++ src/lib/types.ts | 3 ++ src/main.ts | 4 +- 11 files changed, 142 insertions(+), 141 deletions(-) create mode 100644 src/lib/plain.ts create mode 100644 src/lib/types.ts diff --git a/README.md b/README.md index 78a161d..aba214b 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ Package is available on npm and can be installed from the command line. ```shell -$ npm i native-modal +$ npm i tiny-dialogue ``` ### via CDN You can also download or link to the latest compiled version using the CDN. ```shell -https://unpkg.com/native-modal/dist/native-modal.min.js +https://unpkg.com/tiny-dialogue/dist/tiny-dialogue.min.js ``` ## Usage @@ -18,9 +18,9 @@ https://unpkg.com/native-modal/dist/native-modal.min.js See simple usage with attribute based modals. ```typescript -import { initNativeModal } from 'native-modal' +import { initSimpleDialogues } from 'tiny-dialogue' -initNativeModal() // register attrs handling +initSimpleDialogues() // enable simple mode (attrs handling) ``` ```html @@ -30,7 +30,7 @@ initNativeModal() // register attrs handling ... -

NativeModal

+

Dialogue

Hello, click on OK to close modal.

@@ -132,7 +132,7 @@ First, we need to define the modal structure of the DOM Next, we need to create a Modal instance: ```typescript -import { Modal } from 'native-modal' +import { Modal } from 'tiny-dialogue' const modal = new Modal('#modal') @@ -143,9 +143,9 @@ modal.close() // easy to close! Okay, how do I apply the parameters? Let's look at an example: ```typescript -import { Modal } from 'native-modal' +import { Modal } from 'tiny-dialogue' -const modal = new Modal('#modal', { +const modal = new Dialogue('#modal', { animation: true, // enable open/close animation disableEsc: true, // prevent esc closing }) diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index cce23e2..216be51 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -2,8 +2,8 @@ import { defineConfig } from 'vitepress' // https://vitepress.dev/reference/site-config export default defineConfig({ - base: '/native-modal/', - title: 'NativeModal', + base: '/tiny-dialogue/', + title: 'Dialogue', description: 'Tiny wrapper over ', themeConfig: { // https://vitepress.dev/reference/default-theme-config @@ -30,7 +30,7 @@ export default defineConfig({ ], socialLinks: [ - { icon: 'github', link: 'https://github.com/azabroflovski/native-modal' }, + { icon: 'github', link: 'https://github.com/azabroflovski/tiny-dialogue' }, ], }, }) diff --git a/docs/index.md b/docs/index.md index 497222c..b557c92 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,7 +3,7 @@ layout: home hero: - name: "NativeModal" + name: "Dialogue" text: "Tiny wrapper over the <dialog />" tagline: No overhead scripts. Just modal. actions: @@ -15,7 +15,7 @@ hero: link: /demos image: src: /logo.png - alt: NativeModal + alt: Dialogue features: - title: 0.1 kb diff --git a/docs/introduction.md b/docs/introduction.md index 9a15d48..1e9dd69 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -1,14 +1,14 @@ # Introduction -These are the core concepts you need to know about `native-modal` and its approach to modals management. +These are the core concepts you need to know about `tiny-dialogue` and its approach to modals management. -## What is NativeModal ? +## What is Dialogue ? -NativeModal is a streamlined and efficient library designed to provide +Dialogue is a streamlined and efficient library designed to provide a simple and direct wrapper around the native HTML [``]() element, providing an effortless way to implement modals without the need for bulky scripts or complex dependencies. -In summary, `native-modal` is an elegant, performance-oriented solution for implementing modals in web applications. +In summary, `tiny-dialogue` is an elegant, performance-oriented solution for implementing modals in web applications. Its combination of minimal overhead, native browser integration, speed, broad compatibility, framework flexibility, and strong typing makes it an excellent choice for developers. diff --git a/docs/quick-start.md b/docs/quick-start.md index 2e873d3..f043e55 100644 --- a/docs/quick-start.md +++ b/docs/quick-start.md @@ -1,9 +1,9 @@