+<!DOCTYPE html>
<html>
<head>
<title>PatternFly webcomponents example</title>
<meta charset="utf-8">
- <link rel="stylesheet" href="node_modules/patternfly/dist/css/patternfly.min.css">
- <link rel="stylesheet" href="node_modules/patternfly-webcomponents/dist/css/patternfly-webcomponents.css">
+ <!-- make `import` statement work without a bundler
+ https://patternflyelements.org/docs/develop/import-maps/ and
+ https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script/type/importmap -->
+ <script type="importmap">
+ {
+ "imports": {
+ "@patternfly/": "./node_modules/@patternfly/",
+ "@lit/": "./node_modules/@lit/",
+ "@lit/reactive-element": "./node_modules/@lit/reactive-element/reactive-element.js",
+ "@lit/reactive-element/": "./node_modules/@lit/reactive-element/",
+ "lit": "./node_modules/lit/index.js",
+ "lit/": "./node_modules/lit/",
+ "lit/reactive-element/": "./node_modules/@lit/reactive-element/",
+ "lit-element/": "./node_modules/lit-element/",
+ "lit-html": "./node_modules/lit-html/lit-html.js",
+ "lit-html/": "./node_modules/lit-html/",
+ "tslib": "./node_modules/tslib/tslib.es6.js"
+ }
+ }
+ </script>
- <script src="//rawgit.com/webcomponents/custom-elements/master/src/native-shim.js"></script>
- <script src="node_modules/patternfly-webcomponents/dist/js/pf-alert.js"></script>
+ <script type="module">import "@patternfly/elements/pf-button/pf-button.js"</script>
</head>
<body>
+<pf-button id="do_something">Do something!</pf-button>
-<h1>Alert</h1>
-
-<pf-alert type="success">Success Alert message.</pf-alert>
-
+<script>
+document.getElementById("do_something").addEventListener("click", () => alert("Clicked!"));
+</script>
</body>
</html>
{
- "name": "patternfly-webcomponents-demo",
+ "name": "patternfly-elements-demo",
"version": "0.0.1",
- "description": "PatternFly webcomponents demo",
+ "description": "PatternFly elements demo",
"main": "index.js",
"scripts": {
"run": "python3 -m http.server -b localhost"
"author": "Martin Pitt",
"license": "ISC",
"dependencies": {
- "patternfly-webcomponents": "^0.3.0"
+ "@patternfly/elements": "^4.0.2"
}
}