@substrate-system/dialog 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,168 @@
1
+ # Big Time Public License
2
+
3
+ Version 2.0.2
4
+
5
+ <https://bigtimelicense.com/versions/2.0.2>
6
+
7
+ ## Purpose
8
+
9
+ These terms let you use and share this software for noncommercial purposes
10
+ and in small business for free, while also guaranteeing that paid licenses
11
+ for big businesses will be available on fair, reasonable, and
12
+ nondiscriminatory terms.
13
+
14
+ ## Acceptance
15
+
16
+ In order to get any license under these terms, you must agree to them as
17
+ both strict obligations and conditions to all your licenses.
18
+
19
+ ## Noncommercial Purposes
20
+
21
+ You may use the software for any noncommercial purpose.
22
+
23
+ ## Personal Uses
24
+
25
+ Personal use for research, experiment, and testing for the benefit of
26
+ public knowledge, personal study, private entertainment, hobby projects,
27
+ amateur pursuits, or religious observance, without any anticipated
28
+ commercial application, count as use for noncommercial purposes.
29
+
30
+ ## Noncommercial Organizations
31
+
32
+ Use by any charitable organization, educational institution, public
33
+ research organization, public safety or health organization, environmental
34
+ protection organization, or government institution counts as use for
35
+ noncommercial purposes, regardless of the source of funding or obligations
36
+ resulting from the funding.
37
+
38
+ ## Small Business
39
+
40
+ You may use the software for the benefit of your company if it meets all
41
+ these criteria:
42
+
43
+ 1. had fewer than 20 total individuals working as employees and
44
+ independent contractors at all times during the last tax year
45
+
46
+ 2. earned less than $1,000,000 total revenue in the last tax year
47
+
48
+ 3. received less than $1,000,000 total debt, equity, and other investment
49
+ in the last five tax years, counting investment in predecessor
50
+ companies that reorganized into, merged with, or spun out your company
51
+
52
+ All dollar figures are United States dollars as of 2019. Adjust for them
53
+ inflation according to the United States Bureau of Labor Statistics'
54
+ consumer price index for all urban consumers, United States city average,
55
+ for all items, not seasonally adjusted, with 1982–1984=100 reference base.
56
+
57
+ ## Big Business
58
+
59
+ You may use the software for the benefit of your company:
60
+
61
+ 1. for 128 days after your company stops qualifying under
62
+ [Small Business](#small-business)
63
+
64
+ 2. indefinitely, if the licensor or their legal successor does not offer
65
+ fair, reasonable, and nondiscriminatory terms for a commercial license for
66
+ the software within 32 days of [written request](#how-to-request) and
67
+ negotiate in good faith to conclude a deal
68
+
69
+ ## How to Request
70
+
71
+ If this software includes an address for the licensor or an agent of the
72
+ licensor in a standard place, such as in documentation, software package
73
+ metadata, or an "about" page or screen, try to request a fair commercial
74
+ license at that address. If this package includes both online and offline
75
+ addresses, try online before offline. If you can't deliver a request that
76
+ way, or this software doesn't include any addressees, spend one hour online
77
+ researching an address, recording all your searches and inquiries as you
78
+ go, and try any addresses that you find. If you can't find any addresses,
79
+ or if those addresses also fail, that counts as failure to offer a fair
80
+ commercial license by the licensor under [Big Business](#big-business).
81
+
82
+ ## Fair, Reasonable, and Nondiscriminatory Terms
83
+
84
+ Fair, reasonable, and nondiscriminatory terms may license the software
85
+ perpetually or for a term, and may or may not cover new versions of the
86
+ software. If the licensor advertises license terms and a pricing structure
87
+ for generally available commercial licenses, the licensor proposes license
88
+ terms and a price as advertised, and a customer not affiliated with the
89
+ licensor has bought a commercial license for the software on substantially
90
+ equivalent terms in the past year, the proposal is fair, reasonable, and
91
+ nondiscriminatory.
92
+
93
+ ## Copyright License
94
+
95
+ The licensor grants you a copyright license to do everything with the
96
+ software that would otherwise infringe the licensor's copyright in it for
97
+ any purpose allowed by these terms.
98
+
99
+ ## Notices
100
+
101
+ You must ensure that anyone who gets a copy of any part of the software
102
+ from you also gets a copy of these terms or the URL for them above, as well
103
+ as copies of any plain-text lines beginning with `Required Notice:` that
104
+ the licensor provided with the software. For example:
105
+
106
+ > Required Notice: Copyright Nick Thomas (https://nichoth.com)
107
+
108
+ ## Patent License
109
+
110
+ The licensor grants you a patent license for the software that covers
111
+ patent claims the licensor can license, or becomes able to license, that
112
+ you would infringe by using the software.
113
+
114
+ ## Fair Use
115
+
116
+ You may have "fair use" rights for the software under the law. These terms
117
+ do not limit them.
118
+
119
+ ## No Other Rights
120
+
121
+ These terms do not allow you to sublicense or transfer any of your licenses
122
+ to anyone else, or prevent the licensor from granting licenses to anyone
123
+ else. These terms do not imply any other licenses.
124
+
125
+ ## Patent Defense
126
+
127
+ If you make any written claim that the software infringes or contributes to
128
+ infringement of any patent, your patent license for the software granted
129
+ under these terms ends immediately. If your company makes such a claim,
130
+ your patent license ends immediately for work on behalf of your company.
131
+
132
+ ## Violations
133
+
134
+ The first time you are notified in writing that you have violated any of
135
+ these terms, or done anything with the software not covered by your
136
+ licenses, your licenses can nonetheless continue if you come into full
137
+ compliance with these terms, and take practical steps to correct past
138
+ violations, within 32 days of receiving notice. Otherwise, all your
139
+ licenses end immediately.
140
+
141
+ ## No Liability
142
+
143
+ ***As far as the law allows, the software comes as is, without any warranty
144
+ or condition, and the licensor will not be liable to you for any damages
145
+ arising out of these terms or the use or nature of the software, under any
146
+ kind of legal claim.***
147
+
148
+ ## Definitions
149
+
150
+ The **licensor** is the individual or entity offering these terms, and
151
+ the **software** is the software the licensor makes available under these
152
+ terms.
153
+
154
+ **You** refers to the individual or entity agreeing to these terms.
155
+
156
+ **Your company** is any legal entity, sole proprietorship, or other kind of
157
+ organization that you work for, plus all organizations that have control
158
+ over, are under the control of, or are under common control with that
159
+ organization. **Control** means ownership of substantially all the assets
160
+ of an entity, or the power to direct its management and policies by vote,
161
+ contract, or otherwise. Control can be direct or indirect.
162
+
163
+ **Your licenses** are all the licenses granted to you for the software
164
+ under these terms.
165
+
166
+ **Use** means anything you do with the software requiring one of your
167
+ licenses.
168
+
package/README.md ADDED
@@ -0,0 +1,122 @@
1
+ # modal
2
+ [![tests](https://img.shields.io/github/actions/workflow/status/substrate-system/route-event/nodejs.yml?style=flat-square)](https://github.com/substrate-system/route-event/actions/workflows/nodejs.yml)
3
+ [![types](https://img.shields.io/npm/types/@substrate-system/modal?style=flat-square)](README.md)
4
+ [![module](https://img.shields.io/badge/module-ESM%2FCJS-blue?style=flat-square)](README.md)
5
+ [![semantic versioning](https://img.shields.io/badge/semver-2.0.0-blue?logo=semver&style=flat-square)](https://semver.org/)
6
+ [![Common Changelog](https://nichoth.github.io/badge/common-changelog.svg)](https://common-changelog.org)
7
+ [![license](https://img.shields.io/badge/license-Big_Time-blue?style=flat-square)](LICENSE)
8
+
9
+
10
+ Modal dialog window
11
+
12
+ See [smashingmagazine.com article](https://www.smashingmagazine.com/2022/04/cta-modal-build-web-component/) and [nathansmith/cta-modal](https://github.com/nathansmith/cta-modal/tree/main).
13
+
14
+ <details><summary><h2>Contents</h2></summary>
15
+
16
+ <!-- toc -->
17
+
18
+ - [Demo](#demo)
19
+ - [Install](#install)
20
+ - [Use](#use)
21
+ * [Bundler](#bundler)
22
+ * [HTML only](#html-only)
23
+ - [API](#api)
24
+ * [attributes](#attributes)
25
+ - [example](#example)
26
+ - [credits](#credits)
27
+
28
+ <!-- tocstop -->
29
+
30
+ </details>
31
+
32
+ ## Demo
33
+
34
+ See [substrate-system.github.io/modal](https://substrate-system.github.io/modal/).
35
+
36
+ ## Install
37
+
38
+ ```sh
39
+ npm i -S @substrate-system/modal
40
+ ```
41
+
42
+ ## Use
43
+
44
+ ### Bundler
45
+
46
+ Just import; this calls the global function `window.customElements.define`.
47
+
48
+ ```js
49
+ import '@substrate-system/modal'
50
+ ```
51
+
52
+ Then use the tag in HTML:
53
+
54
+ ```html
55
+ <modal-window>
56
+ <div slot="button">
57
+ <p>
58
+ <button class="cta-modal-toggle" type="button">
59
+ Open modal
60
+ </button>
61
+ </p>
62
+ </div>
63
+
64
+ <div slot="modal">modal content?</div>
65
+ <div slot="modal">more modal content</div>
66
+ </modal-window>
67
+ ```
68
+
69
+ ### HTML only
70
+
71
+ First copy the file to a location accessible to your web server.
72
+
73
+ ```sh
74
+ cp ./node_modules/@substrate-system/modal/dist/index.min.js ./public/modal.js
75
+ ```
76
+
77
+ Then link to the file in HTML
78
+ ```html
79
+ <body>
80
+ <p>...content...</p>
81
+ <script type="module" src="/modal.js"></script>
82
+ </body>
83
+ ```
84
+
85
+ ## API
86
+
87
+ ### attributes
88
+
89
+ See [nathansmith/cta-modal](https://github.com/nathansmith/cta-modal/tree/main?tab=readme-ov-file#how-to-use-extras)
90
+
91
+ #### Plus
92
+
93
+ ##### closable
94
+
95
+ Take an attribute `closable`. If you pass in `closable="false"`, then it will
96
+ render without a 'close' button, and escape key and clicks will not close the
97
+ modal. You would need to open/close it via your application state.
98
+
99
+ ```html
100
+ <modal-window closable="false">
101
+ <div slot="button">
102
+ <p>
103
+ <button
104
+ class="cta-modal-toggle"
105
+ type="button"
106
+ >
107
+ Open a modal that can't be closed
108
+ </button>
109
+ </p>
110
+ </div>
111
+ <div slot="modal">modal content?</div>
112
+ <div slot="modal">more modal content</div>
113
+ </modal-window>
114
+ ```
115
+
116
+ ## example
117
+
118
+ [See `./example`](./example/).
119
+
120
+ ## credits
121
+
122
+ Thanks [@nathansmith](https://github.com/nathansmith) and [Smashing Magazine](https://www.smashingmagazine.com/2022/04/cta-modal-build-web-component/) for publishing this originally.