@teselagen/bounce-loader 0.0.2

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/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export function BounceLoader({ style, className }: {
2
+ style: any;
3
+ className: any;
4
+ }): import("react/jsx-runtime").JSX.Element;
package/index.html ADDED
@@ -0,0 +1,13 @@
1
+
2
+ <!DOCTYPE html>
3
+ <html lang="en">
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <title>bounce-loader demo</title>
7
+
8
+ <script type="module" crossorigin src="/index.js"></script>
9
+ </head>
10
+ <body>
11
+ <div id="app"><div id="demo"></div></div>
12
+ </body>
13
+ </html>
package/index.js ADDED
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
4
+ const React$1 = require("react");
5
+ const reactDom = require("react-dom");
6
+ function getDefaultExportFromCjs(x) {
7
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
8
+ }
9
+ __name(getDefaultExportFromCjs, "getDefaultExportFromCjs");
10
+ var classnames = { exports: {} };
11
+ /*!
12
+ Copyright (c) 2018 Jed Watson.
13
+ Licensed under the MIT License (MIT), see
14
+ http://jedwatson.github.io/classnames
15
+ */
16
+ (function(module2) {
17
+ (function() {
18
+ var hasOwn = {}.hasOwnProperty;
19
+ function classNames2() {
20
+ var classes = [];
21
+ for (var i = 0; i < arguments.length; i++) {
22
+ var arg = arguments[i];
23
+ if (!arg)
24
+ continue;
25
+ var argType = typeof arg;
26
+ if (argType === "string" || argType === "number") {
27
+ classes.push(arg);
28
+ } else if (Array.isArray(arg)) {
29
+ if (arg.length) {
30
+ var inner = classNames2.apply(null, arg);
31
+ if (inner) {
32
+ classes.push(inner);
33
+ }
34
+ }
35
+ } else if (argType === "object") {
36
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
37
+ classes.push(arg.toString());
38
+ continue;
39
+ }
40
+ for (var key in arg) {
41
+ if (hasOwn.call(arg, key) && arg[key]) {
42
+ classes.push(key);
43
+ }
44
+ }
45
+ }
46
+ }
47
+ return classes.join(" ");
48
+ }
49
+ __name(classNames2, "classNames");
50
+ if (module2.exports) {
51
+ classNames2.default = classNames2;
52
+ module2.exports = classNames2;
53
+ } else {
54
+ window.classNames = classNames2;
55
+ }
56
+ })();
57
+ })(classnames);
58
+ var classnamesExports = classnames.exports;
59
+ const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
60
+ const style = "";
61
+ function BounceLoader({ style: style2, className }) {
62
+ return /* @__PURE__ */ React$1.createElement("div", { className: classNames("tg-bounce-loader", className), style: style2 }, /* @__PURE__ */ React$1.createElement("div", { className: "rect1" }), /* @__PURE__ */ React$1.createElement("div", { className: "rect2" }), /* @__PURE__ */ React$1.createElement("div", { className: "rect3" }), /* @__PURE__ */ React$1.createElement("div", { className: "rect4" }), /* @__PURE__ */ React$1.createElement("div", { className: "rect5" }));
63
+ }
64
+ __name(BounceLoader, "BounceLoader");
65
+ const renderDemo = /* @__PURE__ */ __name((Demo) => reactDom.render(/* @__PURE__ */ React.createElement(Demo, null), document.querySelector("#demo")), "renderDemo");
66
+ renderDemo(() => {
67
+ return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(BounceLoader, null));
68
+ });
package/index.mjs ADDED
@@ -0,0 +1,110 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+ import React$1 from "react";
4
+ import { render } from "react-dom";
5
+ (/* @__PURE__ */ __name(function polyfill() {
6
+ const relList = document.createElement("link").relList;
7
+ if (relList && relList.supports && relList.supports("modulepreload")) {
8
+ return;
9
+ }
10
+ for (const link of document.querySelectorAll('link[rel="modulepreload"]')) {
11
+ processPreload(link);
12
+ }
13
+ new MutationObserver((mutations) => {
14
+ for (const mutation of mutations) {
15
+ if (mutation.type !== "childList") {
16
+ continue;
17
+ }
18
+ for (const node of mutation.addedNodes) {
19
+ if (node.tagName === "LINK" && node.rel === "modulepreload")
20
+ processPreload(node);
21
+ }
22
+ }
23
+ }).observe(document, { childList: true, subtree: true });
24
+ function getFetchOpts(link) {
25
+ const fetchOpts = {};
26
+ if (link.integrity)
27
+ fetchOpts.integrity = link.integrity;
28
+ if (link.referrerPolicy)
29
+ fetchOpts.referrerPolicy = link.referrerPolicy;
30
+ if (link.crossOrigin === "use-credentials")
31
+ fetchOpts.credentials = "include";
32
+ else if (link.crossOrigin === "anonymous")
33
+ fetchOpts.credentials = "omit";
34
+ else
35
+ fetchOpts.credentials = "same-origin";
36
+ return fetchOpts;
37
+ }
38
+ __name(getFetchOpts, "getFetchOpts");
39
+ function processPreload(link) {
40
+ if (link.ep)
41
+ return;
42
+ link.ep = true;
43
+ const fetchOpts = getFetchOpts(link);
44
+ fetch(link.href, fetchOpts);
45
+ }
46
+ __name(processPreload, "processPreload");
47
+ }, "polyfill"))();
48
+ function getDefaultExportFromCjs(x) {
49
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
50
+ }
51
+ __name(getDefaultExportFromCjs, "getDefaultExportFromCjs");
52
+ var classnames = { exports: {} };
53
+ /*!
54
+ Copyright (c) 2018 Jed Watson.
55
+ Licensed under the MIT License (MIT), see
56
+ http://jedwatson.github.io/classnames
57
+ */
58
+ (function(module) {
59
+ (function() {
60
+ var hasOwn = {}.hasOwnProperty;
61
+ function classNames2() {
62
+ var classes = [];
63
+ for (var i = 0; i < arguments.length; i++) {
64
+ var arg = arguments[i];
65
+ if (!arg)
66
+ continue;
67
+ var argType = typeof arg;
68
+ if (argType === "string" || argType === "number") {
69
+ classes.push(arg);
70
+ } else if (Array.isArray(arg)) {
71
+ if (arg.length) {
72
+ var inner = classNames2.apply(null, arg);
73
+ if (inner) {
74
+ classes.push(inner);
75
+ }
76
+ }
77
+ } else if (argType === "object") {
78
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
79
+ classes.push(arg.toString());
80
+ continue;
81
+ }
82
+ for (var key in arg) {
83
+ if (hasOwn.call(arg, key) && arg[key]) {
84
+ classes.push(key);
85
+ }
86
+ }
87
+ }
88
+ }
89
+ return classes.join(" ");
90
+ }
91
+ __name(classNames2, "classNames");
92
+ if (module.exports) {
93
+ classNames2.default = classNames2;
94
+ module.exports = classNames2;
95
+ } else {
96
+ window.classNames = classNames2;
97
+ }
98
+ })();
99
+ })(classnames);
100
+ var classnamesExports = classnames.exports;
101
+ const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
102
+ const style = "";
103
+ function BounceLoader({ style: style2, className }) {
104
+ return /* @__PURE__ */ React$1.createElement("div", { className: classNames("tg-bounce-loader", className), style: style2 }, /* @__PURE__ */ React$1.createElement("div", { className: "rect1" }), /* @__PURE__ */ React$1.createElement("div", { className: "rect2" }), /* @__PURE__ */ React$1.createElement("div", { className: "rect3" }), /* @__PURE__ */ React$1.createElement("div", { className: "rect4" }), /* @__PURE__ */ React$1.createElement("div", { className: "rect5" }));
105
+ }
106
+ __name(BounceLoader, "BounceLoader");
107
+ const renderDemo = /* @__PURE__ */ __name((Demo) => render(/* @__PURE__ */ React.createElement(Demo, null), document.querySelector("#demo")), "renderDemo");
108
+ renderDemo(() => {
109
+ return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(BounceLoader, null));
110
+ });
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@teselagen/bounce-loader",
3
+ "version": "0.0.2",
4
+ "main": "./index.js",
5
+ "types": "./index.d.ts",
6
+ "type": "commonjs",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./index.mjs",
10
+ "require": "./index.js"
11
+ }
12
+ }
13
+ }
package/style.css ADDED
@@ -0,0 +1,45 @@
1
+ .tg-bounce-loader {
2
+ width: 50px;
3
+ height: 40px;
4
+ text-align: center;
5
+ font-size: 10px;
6
+ display: flex;
7
+ align-items: center;
8
+ }
9
+
10
+ .tg-bounce-loader > div {
11
+ background-color: #006cab;
12
+ height: 100%;
13
+ max-height: 30px;
14
+ width: 6px;
15
+ display: inline-block;
16
+ margin-right: 3px;
17
+ animation: sk-stretchdelay 1.2s infinite ease-in-out;
18
+ }
19
+
20
+ .tg-bounce-loader .rect2 {
21
+ animation-delay: -1.1s;
22
+ }
23
+
24
+ .tg-bounce-loader .rect3 {
25
+ animation-delay: -1s;
26
+ }
27
+
28
+ .tg-bounce-loader .rect4 {
29
+ animation-delay: -0.9s;
30
+ }
31
+
32
+ .tg-bounce-loader .rect5 {
33
+ animation-delay: -0.8s;
34
+ }
35
+
36
+ @keyframes sk-stretchdelay {
37
+ 0%,
38
+ 40%,
39
+ 100% {
40
+ transform: scaleY(0.4);
41
+ }
42
+ 20% {
43
+ transform: scaleY(1);
44
+ }
45
+ }