@penn-libraries/web 0.0.1-dev.0
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 +21 -0
- package/package.json +35 -0
- package/readme.md +50 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018
|
|
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/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@penn-libraries/web",
|
|
3
|
+
"version": "0.0.1-dev.0",
|
|
4
|
+
"description": "University of Pennsylvania Libraries web components and assets.",
|
|
5
|
+
"main": "dist/index.cjs.js",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"es2015": "dist/esm/index.js",
|
|
8
|
+
"es2017": "dist/esm/index.js",
|
|
9
|
+
"types": "dist/types/index.d.ts",
|
|
10
|
+
"collection": "dist/collection/collection-manifest.json",
|
|
11
|
+
"collection:main": "dist/collection/index.js",
|
|
12
|
+
"unpkg": "dist/web/web.esm.js",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist/",
|
|
15
|
+
"loader/"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "stencil build --docs",
|
|
19
|
+
"start": "stencil build --dev --watch --serve",
|
|
20
|
+
"test": "stencil test --spec --e2e",
|
|
21
|
+
"test.watch": "stencil test --spec --e2e --watchAll",
|
|
22
|
+
"generate": "stencil generate"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@stencil/core": "^4.0.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/jest": "^27.5.2",
|
|
29
|
+
"@types/node": "^16.18.11",
|
|
30
|
+
"jest": "^27.5.1",
|
|
31
|
+
"jest-cli": "^27.5.1",
|
|
32
|
+
"puppeteer": "21.1.1"
|
|
33
|
+
},
|
|
34
|
+
"license": "MIT"
|
|
35
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# @penn-libraries/web
|
|
2
|
+
|
|
3
|
+
Reusable web designs for University of Pennsylvania Libraries websites. This repo contains our code for shared Web Components and Cascading Style Sheets (CSS).
|
|
4
|
+
|
|
5
|
+
## Get started
|
|
6
|
+
|
|
7
|
+
You can start using the components immediately by adding these tags to the `<head>`:
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<link href="https://cdn.jsdelivr.net/npm/@penn-libraries/web@1/web.css" rel="stylesheet"/>
|
|
11
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@penn-libraries/web@1/dist/web/web.esm.js"></script>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Once included, components can be used in your markup like any other regular HTML elements:
|
|
15
|
+
|
|
16
|
+
**HTML**
|
|
17
|
+
```html
|
|
18
|
+
<pennlibs-header service-name="Schoenberg Database of Manuscripts" service-lede="Keeping observations of manuscripts"></pennlibs-header>
|
|
19
|
+
<script>
|
|
20
|
+
document.querySelector('pennlibs-header').navigation = [
|
|
21
|
+
{ label: "About", href: "/about" },
|
|
22
|
+
{ label: "Help", href: "/help" }
|
|
23
|
+
];
|
|
24
|
+
</script>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Preview**
|
|
28
|
+

|
|
29
|
+
|
|
30
|
+
## What's a web component?
|
|
31
|
+
|
|
32
|
+
[Web components are evolving web platform technologies](https://developer.mozilla.org/en-US/docs/Web/API/Web_components). They allow us to create custom reusable HTML elements that use standard web technologies (HTML, CSS, and JavaScript). We use the term “web component” for both the platform and the custom element we’ve created. The end result is a custom element that you can drop into your websites and applications with no additional coding or styling required.
|
|
33
|
+
|
|
34
|
+
## Development
|
|
35
|
+
|
|
36
|
+
To start building a new web component using Stencil, clone this repo to a new directory and run:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm install
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
To start the local development server
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm start
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### What's Stencil?
|
|
49
|
+
|
|
50
|
+
[Stencil is a compiler for building fast web apps using Web Components](https://stenciljs.com/docs/). Stencil components are just Web Components, so they work in any major framework or with no framework at all.
|