clear-react-router 1.2.0 → 1.2.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/dist/index.js CHANGED
@@ -283,6 +283,31 @@ var useLoader = (routeList) => {
283
283
  //#endregion
284
284
  //#region hooks/useApplyCustomAnimation.ts
285
285
  var useApplyCustomAnimation = (animationOptions) => {
286
+ useEffect(() => {
287
+ const style = document.createElement("style");
288
+ style.id = "spinner-style";
289
+ style.textContent = `
290
+ @keyframes cr-spin {
291
+ 0% { transform: rotate(0deg); }
292
+ 100% { transform: rotate(360deg); }
293
+ }
294
+
295
+ .cr-spinner {
296
+ position: fixed;
297
+ top: 5px;
298
+ left: 5px;
299
+ z-index: 9999;
300
+ width: 1rem;
301
+ height: 1rem;
302
+ border: 2px solid gray;
303
+ border-bottom-color: transparent;
304
+ border-radius: 50%;
305
+ animation: cr-spin 1s linear infinite;
306
+ }
307
+ `;
308
+ document.head.appendChild(style);
309
+ return () => style.remove();
310
+ }, []);
286
311
  useEffect(() => {
287
312
  if (!animationOptions?.duration) return;
288
313
  const style = document.createElement("style");
@@ -330,13 +355,9 @@ var useApplyCustomAnimation = (animationOptions) => {
330
355
  return () => style.remove();
331
356
  }, [animationOptions]);
332
357
  };
333
- var Spinner_module_default = {
334
- spinner: "_spinner_1tekw_1",
335
- rotation: "_rotation_1tekw_1"
336
- };
337
358
  //#endregion
338
- //#region components/Spinner/Spinner.tsx
339
- var Spinner = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: Spinner_module_default.spinner });
359
+ //#region components/Spinner.tsx
360
+ var Spinner = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "cr-spinner" });
340
361
  //#endregion
341
362
  //#region utils/renderElement.tsx
342
363
  var renderElement = (Component) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clear-react-router",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "A lightweight, type-safe routing library for React applications",
5
5
  "author": "Andrew Bubnov",
6
6
  "scripts": {
@@ -1,23 +0,0 @@
1
- ._spinner_1tekw_1 {
2
- position: fixed;
3
- top: 5px;
4
- left: 5px;
5
- z-index: 9999;
6
- width: 1rem;
7
- height: 1rem;
8
- border: 2px solid gray;
9
- border-bottom-color: transparent;
10
- border-radius: 50%;
11
- display: inline-block;
12
- box-sizing: border-box;
13
- animation: _rotation_1tekw_1 1s linear infinite;
14
- }
15
-
16
- @keyframes _rotation_1tekw_1 {
17
- 0% {
18
- transform: rotate(0deg);
19
- }
20
- 100% {
21
- transform: rotate(360deg);
22
- }
23
- }/*$vite$:1*/