cortex-react-components 1.0.1
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/README.md +132 -0
- package/dist/chunk-DRWCG3FW.mjs +1 -0
- package/dist/chunk-DSHGUZTY.mjs +1 -0
- package/dist/chunk-EUWFH5P5.mjs +1 -0
- package/dist/chunk-FQFHKJZP.mjs +1 -0
- package/dist/chunk-PRKLDM64.mjs +1 -0
- package/dist/chunk-TB5R2TDU.mjs +1 -0
- package/dist/chunk-W4KJCU6R.mjs +1 -0
- package/dist/chunk-WJ2SJVAM.mjs +1 -0
- package/dist/client/index.css +1 -0
- package/dist/client/index.d.ts +6 -0
- package/dist/client/index.js +2 -0
- package/dist/client/index.mjs +2 -0
- package/dist/client/loader-container/index.css +1 -0
- package/dist/client/loader-container/index.d.ts +1 -0
- package/dist/client/loader-container/index.js +2 -0
- package/dist/client/loader-container/index.mjs +2 -0
- package/dist/client/loader-container/loader-container.css +1 -0
- package/dist/client/loader-container/loader-container.d.ts +10 -0
- package/dist/client/loader-container/loader-container.js +1 -0
- package/dist/client/loader-container/loader-container.mjs +1 -0
- package/dist/client/loader-container/loader-container.module.mjs +1 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +1 -0
- package/dist/constants.mjs +1 -0
- package/dist/declaration.d.js +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/index.mjs +1 -0
- package/dist/hooks/use-loader.d.ts +8 -0
- package/dist/hooks/use-loader.js +1 -0
- package/dist/hooks/use-loader.mjs +1 -0
- package/dist/index.css +2 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +2 -0
- package/dist/index.mjs +2 -0
- package/dist/server/bars/bars1/bars1.css +1 -0
- package/dist/server/bars/bars1/bars1.d.ts +10 -0
- package/dist/server/bars/bars1/bars1.js +1 -0
- package/dist/server/bars/bars1/bars1.mjs +1 -0
- package/dist/server/bars/bars1/bars1.module.mjs +1 -0
- package/dist/server/bars/bars1/index.css +1 -0
- package/dist/server/bars/bars1/index.d.ts +1 -0
- package/dist/server/bars/bars1/index.js +1 -0
- package/dist/server/bars/bars1/index.mjs +1 -0
- package/dist/server/bars/bars2/bars2.css +1 -0
- package/dist/server/bars/bars2/bars2.d.ts +10 -0
- package/dist/server/bars/bars2/bars2.js +1 -0
- package/dist/server/bars/bars2/bars2.mjs +1 -0
- package/dist/server/bars/bars2/bars2.module.mjs +1 -0
- package/dist/server/bars/bars2/index.css +1 -0
- package/dist/server/bars/bars2/index.d.ts +1 -0
- package/dist/server/bars/bars2/index.js +1 -0
- package/dist/server/bars/bars2/index.mjs +1 -0
- package/dist/server/bars/index.css +1 -0
- package/dist/server/bars/index.d.ts +2 -0
- package/dist/server/bars/index.js +1 -0
- package/dist/server/bars/index.mjs +1 -0
- package/dist/server/common/base/base.d.ts +23 -0
- package/dist/server/common/base/base.js +1 -0
- package/dist/server/common/base/base.mjs +1 -0
- package/dist/server/common/base/index.d.ts +1 -0
- package/dist/server/common/base/index.js +1 -0
- package/dist/server/common/base/index.mjs +1 -0
- package/dist/server/common/index.d.ts +1 -0
- package/dist/server/common/index.js +1 -0
- package/dist/server/common/index.mjs +1 -0
- package/dist/server/dots/dots1/dots1.css +1 -0
- package/dist/server/dots/dots1/dots1.d.ts +10 -0
- package/dist/server/dots/dots1/dots1.js +1 -0
- package/dist/server/dots/dots1/dots1.mjs +1 -0
- package/dist/server/dots/dots1/dots1.module.mjs +1 -0
- package/dist/server/dots/dots1/index.css +1 -0
- package/dist/server/dots/dots1/index.d.ts +1 -0
- package/dist/server/dots/dots1/index.js +1 -0
- package/dist/server/dots/dots1/index.mjs +1 -0
- package/dist/server/dots/dots2/dots2.css +1 -0
- package/dist/server/dots/dots2/dots2.d.ts +15 -0
- package/dist/server/dots/dots2/dots2.js +1 -0
- package/dist/server/dots/dots2/dots2.mjs +1 -0
- package/dist/server/dots/dots2/dots2.module.mjs +1 -0
- package/dist/server/dots/dots2/index.css +1 -0
- package/dist/server/dots/dots2/index.d.ts +1 -0
- package/dist/server/dots/dots2/index.js +1 -0
- package/dist/server/dots/dots2/index.mjs +1 -0
- package/dist/server/dots/index.css +1 -0
- package/dist/server/dots/index.d.ts +2 -0
- package/dist/server/dots/index.js +1 -0
- package/dist/server/dots/index.mjs +1 -0
- package/dist/server/index.css +1 -0
- package/dist/server/index.d.ts +7 -0
- package/dist/server/index.js +1 -0
- package/dist/server/index.mjs +1 -0
- package/package.json +58 -0
package/README.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# React18 Loaders <img src="https://raw.githubusercontent.com/mayank1513/mayank1513/main/popper.png" style="height: 40px"/>
|
|
2
|
+
|
|
3
|
+
[](https://github.com/react18-tools/turborepo-template/actions/workflows/test.yml) [](https://codeclimate.com/github/react18-tools/turborepo-template/maintainability) [](https://codecov.io/gh/react18-tools/turborepo-template) [](https://www.npmjs.com/package/react18-loaders) [](https://www.npmjs.com/package/react18-loaders)  [](https://gitpod.io/from-referrer/)
|
|
4
|
+
|
|
5
|
+
React18 Loaders is a comprehensive library designed to unlock the full potential of React 18 server components. It provides customizable loading animation components and a fullscreen loader container, seamlessly integrating with React and Next.js.
|
|
6
|
+
|
|
7
|
+
✅ Fully Treeshakable (import from `react18-loaders/client/loader-container`)
|
|
8
|
+
|
|
9
|
+
✅ Fully TypeScript Supported
|
|
10
|
+
|
|
11
|
+
✅ Leverages the power of React 18 Server components
|
|
12
|
+
|
|
13
|
+
✅ Compatible with all React 18 build systems/tools/frameworks
|
|
14
|
+
|
|
15
|
+
✅ Documented with [Typedoc](https://react18-tools.github.io/turborepo-template) ([Docs](https://react18-tools.github.io/turborepo-template))
|
|
16
|
+
|
|
17
|
+
✅ Examples for Next.js, and Vite
|
|
18
|
+
|
|
19
|
+
> <img src="https://raw.githubusercontent.com/mayank1513/mayank1513/main/popper.png" style="height: 20px"/> Star [this repository](https://github.com/react18-tools/turborepo-template) and share it with your friends.
|
|
20
|
+
|
|
21
|
+
## Getting Started
|
|
22
|
+
|
|
23
|
+
### Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pnpm add react18-loaders
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**_or_**
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install react18-loaders
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**_or_**
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
yarn add react18-loaders
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Want Lite Version? [](https://www.npmjs.com/package/react18-loaders-lite) [](https://www.npmjs.com/package/react18-loaders-lite) [](https://www.npmjs.com/package/react18-loaders-lite)
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pnpm add react18-loaders-lite
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**or**
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm install react18-loaders-lite
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**or**
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
yarn add react18-loaders-lite
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
> You need `r18gs` as a peer-dependency
|
|
60
|
+
|
|
61
|
+
### Import Styles
|
|
62
|
+
|
|
63
|
+
You can import styles globally or within specific components.
|
|
64
|
+
|
|
65
|
+
```css
|
|
66
|
+
/* globals.css */
|
|
67
|
+
@import "react18-loaders/dist";
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
// layout.tsx
|
|
72
|
+
import "react18-loaders/dist/index.css";
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
For selective imports:
|
|
76
|
+
|
|
77
|
+
```css
|
|
78
|
+
/* globals.css */
|
|
79
|
+
@import "react18-loaders/dist/client"; /** required if you are using LoaderContainer */
|
|
80
|
+
@import "react18-loaders/dist/server/bars/bars1";
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Usage
|
|
84
|
+
|
|
85
|
+
Using loaders is straightforward.
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
import { Bars1 } from "react18-loaders/dist/server/bars/bars1";
|
|
89
|
+
|
|
90
|
+
export default function MyComponent() {
|
|
91
|
+
return someCondition ? <Bars1 /> : <>Something else...</>;
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
For detailed API and options, refer to [the API documentation](https://react18-tools.github.io/turborepo-template).
|
|
96
|
+
|
|
97
|
+
**Using LoaderContainer**
|
|
98
|
+
|
|
99
|
+
`LoaderContainer` is a fullscreen component. You can add this component directly in your layout and then use `useLoader` hook to toggle its visibility.
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
// layout.tsx
|
|
103
|
+
<LoaderContainer />
|
|
104
|
+
...
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
// some other page or component
|
|
109
|
+
import { useLoader } from "react18-loaders/dist/hooks";
|
|
110
|
+
|
|
111
|
+
export default MyComponent() {
|
|
112
|
+
const { setLoading } = useLoader();
|
|
113
|
+
useCallback(()=>{
|
|
114
|
+
setLoading(true);
|
|
115
|
+
...do some work
|
|
116
|
+
setLoading(false);
|
|
117
|
+
}, [])
|
|
118
|
+
...
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## License
|
|
123
|
+
|
|
124
|
+
This library is licensed under the MPL-2.0 open-source license.
|
|
125
|
+
|
|
126
|
+
> This package also serves as an example demonstrating how to build and publish a `React.js` library compatible with React Server Components.
|
|
127
|
+
|
|
128
|
+
> <img src="https://raw.githubusercontent.com/mayank1513/mayank1513/main/popper.png" style="height: 20px"/> Please enroll in [our courses](https://mayank-chaudhari.vercel.app/courses) or [sponsor](https://github.com/sponsors/mayank1513) our work.
|
|
129
|
+
|
|
130
|
+
<hr />
|
|
131
|
+
|
|
132
|
+
<p align="center" style="text-align:center">with 💖 by <a href="https://mayank-chaudhari.vercel.app" target="_blank">Mayank Kumar Chaudhari</a></p>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-TB5R2TDU.mjs";var r={loader:"dots1__loader",anim:"dots1__anim"};import{jsx as a}from"react/jsx-runtime";function m(s){return a(o,{...s,loaderClass:r.loader})}export{m as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-TB5R2TDU.mjs";var o={loader:"bars1__loader",l27:"bars1__l27"};import{jsx as s}from"react/jsx-runtime";function f(a){return s(r,{...a,loaderClass:o.loader})}export{f as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n}from"./chunk-FQFHKJZP.mjs";var e={container:"loader-container__container",loading:"loader-container__loading"};import{useRGS as i}from"r18gs";import{jsx as c}from"react/jsx-runtime";function _({children:r,loading:o}){let[t]=i(n,!1),a=o!=null?o:t;return c("div",{className:[e.container,a?e.loading:""].join(" "),children:r})}export{_ as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o="r18-loaders";export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-TB5R2TDU.mjs";var o={loader:"bars2__loader",l1:"bars2__l1"};import{jsx as s}from"react/jsx-runtime";function f(a){return s(r,{...a,loaderClass:o.loader})}export{f as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";function c({width:t,height:n,color:o,loaderClass:i,dotRadius:s,...e}){let r={...e.style,width:t,height:n,"--c":o};s&&(r["--r"]=s);let a=[e.className,i].filter(Boolean).join(" ");return l("div",{...e,className:a,style:r})}export{c as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-FQFHKJZP.mjs";import{useRGS as n}from"r18gs";function a(){let[r,e]=n(o);return{loading:r,setLoading:e}}export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-TB5R2TDU.mjs";var r={loader:"dots2__loader",anim:"dots2__anim"};import{jsx as t}from"react/jsx-runtime";function n(s){return t(o,{...s,loaderClass:r.loader})}export{n as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.loader-container__container{position:fixed;top:0;left:0;width:100vw;height:100vh;display:flex;align-items:center;justify-content:center;z-index:1000;pointer-events:none;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);background:radial-gradient(circle,#535bf200 0% 150%,#8489f685,#535bf255);opacity:0;transition:all .5s}.loader-container__container *{animation-play-state:paused!important}.loader-container__loading{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background:radial-gradient(circle,#535bf200 0% 0%,#8489f6b5 10%,#535bf255);pointer-events:all;opacity:1}.loader-container__loading *{animation-play-state:running!important}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server components and client components need to be exported from separate files as
|
|
3
|
+
* directive on top of the file from which component is imported takes effect.
|
|
4
|
+
* i.e., server component re-exported from file with "use client" will behave as client component
|
|
5
|
+
* */
|
|
6
|
+
export * from "./loader-container";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";var t=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var _=(a,e)=>{for(var n in e)t(a,n,{get:e[n],enumerable:!0})},b=(a,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of s(e))!g.call(a,r)&&r!==n&&t(a,r,{get:()=>e[r],enumerable:!(o=p(e,r))||o.enumerable});return a};var f=a=>b(t({},"__esModule",{value:!0}),a);var u={};_(u,{LoaderContainer:()=>m});module.exports=f(u);var i={container:"loader-container__container",loading:"loader-container__loading"};var c=require("r18gs");var l="r18-loaders";var d=require("react/jsx-runtime");function m({children:a,loading:e}){let[n]=(0,c.useRGS)(l,!1),o=e!=null?e:n;return(0,d.jsx)("div",{className:[i.container,o?i.loading:""].join(" "),children:a})}0&&(module.exports={LoaderContainer});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.loader-container__container{position:fixed;top:0;left:0;width:100vw;height:100vh;display:flex;align-items:center;justify-content:center;z-index:1000;pointer-events:none;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);background:radial-gradient(circle,#535bf200 0% 150%,#8489f685,#535bf255);opacity:0;transition:all .5s}.loader-container__container *{animation-play-state:paused!important}.loader-container__loading{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background:radial-gradient(circle,#535bf200 0% 0%,#8489f6b5 10%,#535bf255);pointer-events:all;opacity:1}.loader-container__loading *{animation-play-state:running!important}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./loader-container";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";var t=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var _=(a,e)=>{for(var n in e)t(a,n,{get:e[n],enumerable:!0})},b=(a,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of s(e))!g.call(a,r)&&r!==n&&t(a,r,{get:()=>e[r],enumerable:!(o=p(e,r))||o.enumerable});return a};var f=a=>b(t({},"__esModule",{value:!0}),a);var u={};_(u,{LoaderContainer:()=>m});module.exports=f(u);var i={container:"loader-container__container",loading:"loader-container__loading"};var c=require("r18gs");var l="r18-loaders";var d=require("react/jsx-runtime");function m({children:a,loading:e}){let[n]=(0,c.useRGS)(l,!1),o=e!=null?e:n;return(0,d.jsx)("div",{className:[i.container,o?i.loading:""].join(" "),children:a})}0&&(module.exports={LoaderContainer});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.loader-container__container{position:fixed;top:0;left:0;width:100vw;height:100vh;display:flex;align-items:center;justify-content:center;z-index:1000;pointer-events:none;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);background:radial-gradient(circle,#535bf200 0% 150%,#8489f685,#535bf255);opacity:0;transition:all .5s}.loader-container__container *{animation-play-state:paused!important}.loader-container__loading{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background:radial-gradient(circle,#535bf200 0% 0%,#8489f6b5 10%,#535bf255);pointer-events:all;opacity:1}.loader-container__loading *{animation-play-state:running!important}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface LoaderContainerProps extends React.HTMLProps<HTMLDivElement> {
|
|
2
|
+
children?: React.ReactNode;
|
|
3
|
+
loading?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* # LoaderContainer
|
|
7
|
+
* A full screen container for the loading animation.
|
|
8
|
+
*/
|
|
9
|
+
export declare function LoaderContainer({ children, loading }: LoaderContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var _=(n,a)=>{for(var e in a)t(n,e,{get:a[e],enumerable:!0})},b=(n,a,e,o)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of s(a))!g.call(n,r)&&r!==e&&t(n,r,{get:()=>a[r],enumerable:!(o=p(a,r))||o.enumerable});return n};var f=n=>b(t({},"__esModule",{value:!0}),n);var u={};_(u,{LoaderContainer:()=>m});module.exports=f(u);var i={container:"loader-container__container",loading:"loader-container__loading"};var c=require("r18gs");var l="r18-loaders";var d=require("react/jsx-runtime");function m({children:n,loading:a}){let[e]=(0,c.useRGS)(l,!1),o=a!=null?a:e;return(0,d.jsx)("div",{className:[i.container,o?i.loading:""].join(" "),children:n})}0&&(module.exports={LoaderContainer});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../chunk-EUWFH5P5.mjs";import"../../chunk-FQFHKJZP.mjs";export{a as LoaderContainer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o={container:"loader-container__container",loading:"loader-container__loading"};export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var c=(r,o)=>{for(var s in o)t(r,s,{get:o[s],enumerable:!0})},d=(r,o,s,E)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of _(o))!a.call(r,e)&&e!==s&&t(r,e,{get:()=>o[e],enumerable:!(E=R(o,e))||E.enumerable});return r};var l=r=>d(t({},"__esModule",{value:!0}),r);var p={};c(p,{LOADER_RGS_KEY:()=>n});module.exports=l(p);var n="r18-loaders";0&&(module.exports={LOADER_RGS_KEY});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-FQFHKJZP.mjs";export{a as LOADER_RGS_KEY};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./use-loader";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var d=(r,o)=>{for(var t in o)n(r,t,{get:o[t],enumerable:!0})},f=(r,o,t,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of p(o))!R.call(r,e)&&e!==t&&n(r,e,{get:()=>o[e],enumerable:!(s=m(o,e))||s.enumerable});return r};var u=r=>f(n({},"__esModule",{value:!0}),r);var L={};d(L,{useLoader:()=>E});module.exports=u(L);var i=require("r18gs");var a="r18-loaders";function E(){let[r,o]=(0,i.useRGS)(a);return{loading:r,setLoading:o}}0&&(module.exports={useLoader});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../chunk-W4KJCU6R.mjs";import"../chunk-FQFHKJZP.mjs";export{a as useLoader};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var p=(r,o)=>{for(var t in o)n(r,t,{get:o[t],enumerable:!0})},u=(r,o,t,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of d(o))!m.call(r,e)&&e!==t&&n(r,e,{get:()=>o[e],enumerable:!(s=R(o,e))||s.enumerable});return r};var E=r=>u(n({},"__esModule",{value:!0}),r);var _={};p(_,{useLoader:()=>L});module.exports=E(_);var i=require("r18gs");var a="r18-loaders";function L(){let[r,o]=(0,i.useRGS)(a);return{loading:r,setLoading:o}}0&&(module.exports={useLoader});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../chunk-W4KJCU6R.mjs";import"../chunk-FQFHKJZP.mjs";export{a as useLoader};
|
package/dist/index.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.loader-container__container{position:fixed;top:0;left:0;width:100vw;height:100vh;display:flex;align-items:center;justify-content:center;z-index:1000;pointer-events:none;-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);background:radial-gradient(circle,#535bf200 0% 150%,#8489f685,#535bf255);opacity:0;transition:all .5s}.loader-container__container *{animation-play-state:paused!important}.loader-container__loading{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background:radial-gradient(circle,#535bf200 0% 0%,#8489f6b5 10%,#535bf255);pointer-events:all;opacity:1}.loader-container__loading *{animation-play-state:running!important}
|
|
2
|
+
.dots1__loader{--c: #000;width:60px;aspect-ratio:4;background:radial-gradient(circle closest-side,var(--c) 90%,rgba(0,0,0,0)) 0/33.3333333333% 100% space;clip-path:inset(0 100% 0 0);animation:dots1__anim 1s steps(4) infinite}@keyframes dots1__anim{to{clip-path:inset(0 -34% 0 0)}}.dots2__loader{width:32px;aspect-ratio:1;--c: #000;--dot-radius: 20%;--_g: no-repeat radial-gradient(farthest-side, var(--c) 90%, #0000);background:var(--_g),var(--_g),var(--_g),var(--_g);background-size:calc(2 * var(--dot-radius)) calc(2 * var(--dot-radius));animation:dots2__anim 1s infinite}@keyframes dots2__anim{0%{background-position:0 0,100% 0,100% 100%,0 100%}40%,50%{background-position:100% 100%,100% 0,0 0,0 100%}90%,to{background-position:100% 100%,0 100%,0 0,100% 0}}.bars1__loader{width:45px;aspect-ratio:1;--c: #000;--b: no-repeat repeating-linear-gradient(90deg, var(--c) 0 calc(100% / 7), #0000 0 calc(200% / 7));background:var(--b),var(--b),var(--b),var(--b);background-size:140% 26%;animation:bars1__l27 .75s infinite linear}@keyframes bars1__l27{0%,20%{background-position:0 0%,100% 33.3333333333%,0 66.6666666667%,100% 100%}80%,to{background-position:100% 0%,0 33.3333333333%,100% 66.6666666667%,0 100%}}.bars2__loader{width:45px;aspect-ratio:1;--c: #000;--b: no-repeat linear-gradient(var(--c) 0 0);background:var(--b) 0% 50%,var(--b) 50% 50%,var(--b) 100% 50%;background-size:20% 100%;animation:bars2__l1 1s infinite linear}@keyframes bars2__l1{0%{background-size:20% 100%,20% 100%,20% 100%}33%{background-size:20% 10%,20% 100%,20% 100%}50%{background-size:20% 100%,20% 10%,20% 100%}66%{background-size:20% 100%,20% 100%,20% 10%}to{background-size:20% 100%,20% 100%,20% 100%}}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var m=(r,o)=>{for(var e in o)i(r,e,{get:o[e],enumerable:!0})},f=(r,o,e,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of g(o))!_.call(r,n)&&n!==e&&i(r,n,{get:()=>o[n],enumerable:!(a=s(o,n))||a.enumerable});return r};var b=r=>f(i({},"__esModule",{value:!0}),r);var R={};m(R,{LoaderContainer:()=>u,useLoader:()=>x});module.exports=b(R);var l={container:"loader-container__container",loading:"loader-container__loading"};var c=require("r18gs");var t="r18-loaders";var d=require("react/jsx-runtime");function u({children:r,loading:o}){let[e]=(0,c.useRGS)(t,!1),a=o!=null?o:e;return(0,d.jsx)("div",{className:[l.container,a?l.loading:""].join(" "),children:r})}function x(){let[r,o]=(0,c.useRGS)(t);return{loading:r,setLoading:o}}0&&(module.exports={LoaderContainer,useLoader});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.bars1__loader{width:45px;aspect-ratio:1;--c: #000;--b: no-repeat repeating-linear-gradient(90deg, var(--c) 0 calc(100% / 7), #0000 0 calc(200% / 7));background:var(--b),var(--b),var(--b),var(--b);background-size:140% 26%;animation:bars1__l27 .75s infinite linear}@keyframes bars1__l27{0%,20%{background-position:0 0%,100% 33.3333333333%,0 66.6666666667%,100% 100%}80%,to{background-position:100% 0%,0 33.3333333333%,100% 66.6666666667%,0 100%}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var u=(r,e)=>{for(var s in e)i(r,s,{get:e[s],enumerable:!0})},_=(r,e,s,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of g(e))!f.call(r,a)&&a!==s&&i(r,a,{get:()=>e[a],enumerable:!(o=m(e,a))||o.enumerable});return r};var v=r=>_(i({},"__esModule",{value:!0}),r);var P={};u(P,{Bars1:()=>B});module.exports=v(P);var l={loader:"bars1__loader",l27:"bars1__l27"};var d=require("react/jsx-runtime");function c({width:r,height:e,color:s,loaderClass:o,dotRadius:a,...t}){let n={...t.style,width:r,height:e,"--c":s};a&&(n["--r"]=a);let b=[t.className,o].filter(Boolean).join(" ");return(0,d.jsx)("div",{...t,className:b,style:n})}function B(r){return(0,d.jsx)(c,{...r,loaderClass:l.loader})}0&&(module.exports={Bars1});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../../chunk-DSHGUZTY.mjs";import"../../../chunk-TB5R2TDU.mjs";export{a as Bars1};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a={loader:"bars1__loader",l27:"bars1__l27"};export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.bars1__loader{width:45px;aspect-ratio:1;--c: #000;--b: no-repeat repeating-linear-gradient(90deg, var(--c) 0 calc(100% / 7), #0000 0 calc(200% / 7));background:var(--b),var(--b),var(--b),var(--b);background-size:140% 26%;animation:bars1__l27 .75s infinite linear}@keyframes bars1__l27{0%,20%{background-position:0 0%,100% 33.3333333333%,0 66.6666666667%,100% 100%}80%,to{background-position:100% 0%,0 33.3333333333%,100% 66.6666666667%,0 100%}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./bars1";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var u=(r,e)=>{for(var s in e)i(r,s,{get:e[s],enumerable:!0})},_=(r,e,s,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of f(e))!g.call(r,a)&&a!==s&&i(r,a,{get:()=>e[a],enumerable:!(o=m(e,a))||o.enumerable});return r};var v=r=>_(i({},"__esModule",{value:!0}),r);var P={};u(P,{Bars1:()=>B});module.exports=v(P);var l={loader:"bars1__loader",l27:"bars1__l27"};var d=require("react/jsx-runtime");function c({width:r,height:e,color:s,loaderClass:o,dotRadius:a,...t}){let n={...t.style,width:r,height:e,"--c":s};a&&(n["--r"]=a);let b=[t.className,o].filter(Boolean).join(" ");return(0,d.jsx)("div",{...t,className:b,style:n})}function B(r){return(0,d.jsx)(c,{...r,loaderClass:l.loader})}0&&(module.exports={Bars1});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../../chunk-DSHGUZTY.mjs";import"../../../chunk-TB5R2TDU.mjs";export{a as Bars1};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.bars2__loader{width:45px;aspect-ratio:1;--c: #000;--b: no-repeat linear-gradient(var(--c) 0 0);background:var(--b) 0% 50%,var(--b) 50% 50%,var(--b) 100% 50%;background-size:20% 100%;animation:bars2__l1 1s infinite linear}@keyframes bars2__l1{0%{background-size:20% 100%,20% 100%,20% 100%}33%{background-size:20% 10%,20% 100%,20% 100%}50%{background-size:20% 100%,20% 10%,20% 100%}66%{background-size:20% 100%,20% 100%,20% 10%}to{background-size:20% 100%,20% 100%,20% 100%}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var f=(r,e)=>{for(var s in e)t(r,s,{get:e[s],enumerable:!0})},_=(r,e,s,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of m(e))!u.call(r,a)&&a!==s&&t(r,a,{get:()=>e[a],enumerable:!(o=g(e,a))||o.enumerable});return r};var k=r=>_(t({},"__esModule",{value:!0}),r);var B={};f(B,{Bars2:()=>v});module.exports=k(B);var l={loader:"bars2__loader",l1:"bars2__l1"};var c=require("react/jsx-runtime");function d({width:r,height:e,color:s,loaderClass:o,dotRadius:a,...i}){let n={...i.style,width:r,height:e,"--c":s};a&&(n["--r"]=a);let p=[i.className,o].filter(Boolean).join(" ");return(0,c.jsx)("div",{...i,className:p,style:n})}function v(r){return(0,c.jsx)(d,{...r,loaderClass:l.loader})}0&&(module.exports={Bars2});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../../chunk-PRKLDM64.mjs";import"../../../chunk-TB5R2TDU.mjs";export{a as Bars2};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a={loader:"bars2__loader",l1:"bars2__l1"};export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.bars2__loader{width:45px;aspect-ratio:1;--c: #000;--b: no-repeat linear-gradient(var(--c) 0 0);background:var(--b) 0% 50%,var(--b) 50% 50%,var(--b) 100% 50%;background-size:20% 100%;animation:bars2__l1 1s infinite linear}@keyframes bars2__l1{0%{background-size:20% 100%,20% 100%,20% 100%}33%{background-size:20% 10%,20% 100%,20% 100%}50%{background-size:20% 100%,20% 10%,20% 100%}66%{background-size:20% 100%,20% 100%,20% 10%}to{background-size:20% 100%,20% 100%,20% 100%}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./bars2";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var u=(r,e)=>{for(var s in e)i(r,s,{get:e[s],enumerable:!0})},_=(r,e,s,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of g(e))!f.call(r,a)&&a!==s&&i(r,a,{get:()=>e[a],enumerable:!(o=m(e,a))||o.enumerable});return r};var k=r=>_(i({},"__esModule",{value:!0}),r);var B={};u(B,{Bars2:()=>v});module.exports=k(B);var l={loader:"bars2__loader",l1:"bars2__l1"};var c=require("react/jsx-runtime");function d({width:r,height:e,color:s,loaderClass:o,dotRadius:a,...t}){let n={...t.style,width:r,height:e,"--c":s};a&&(n["--r"]=a);let p=[t.className,o].filter(Boolean).join(" ");return(0,c.jsx)("div",{...t,className:p,style:n})}function v(r){return(0,c.jsx)(d,{...r,loaderClass:l.loader})}0&&(module.exports={Bars2});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../../chunk-PRKLDM64.mjs";import"../../../chunk-TB5R2TDU.mjs";export{a as Bars2};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.bars1__loader{width:45px;aspect-ratio:1;--c: #000;--b: no-repeat repeating-linear-gradient(90deg, var(--c) 0 calc(100% / 7), #0000 0 calc(200% / 7));background:var(--b),var(--b),var(--b),var(--b);background-size:140% 26%;animation:bars1__l27 .75s infinite linear}@keyframes bars1__l27{0%,20%{background-position:0 0%,100% 33.3333333333%,0 66.6666666667%,100% 100%}80%,to{background-position:100% 0%,0 33.3333333333%,100% 66.6666666667%,0 100%}}.bars2__loader{width:45px;aspect-ratio:1;--c: #000;--b: no-repeat linear-gradient(var(--c) 0 0);background:var(--b) 0% 50%,var(--b) 50% 50%,var(--b) 100% 50%;background-size:20% 100%;animation:bars2__l1 1s infinite linear}@keyframes bars2__l1{0%{background-size:20% 100%,20% 100%,20% 100%}33%{background-size:20% 10%,20% 100%,20% 100%}50%{background-size:20% 100%,20% 10%,20% 100%}66%{background-size:20% 100%,20% 100%,20% 10%}to{background-size:20% 100%,20% 100%,20% 100%}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var v=(r,a)=>{for(var o in a)n(r,o,{get:a[o],enumerable:!0})},k=(r,a,o,s)=>{if(a&&typeof a=="object"||typeof a=="function")for(let e of _(a))!u.call(r,e)&&e!==o&&n(r,e,{get:()=>a[e],enumerable:!(s=f(a,e))||s.enumerable});return r};var B=r=>k(n({},"__esModule",{value:!0}),r);var h={};v(h,{Bars1:()=>P,Bars2:()=>x});module.exports=B(h);var d={loader:"bars1__loader",l27:"bars1__l27"};var b=require("react/jsx-runtime");function i({width:r,height:a,color:o,loaderClass:s,dotRadius:e,...t}){let l={...t.style,width:r,height:a,"--c":o};e&&(l["--r"]=e);let g=[t.className,s].filter(Boolean).join(" ");return(0,b.jsx)("div",{...t,className:g,style:l})}function P(r){return(0,b.jsx)(i,{...r,loaderClass:d.loader})}var p={loader:"bars2__loader",l1:"bars2__l1"};function x(r){return(0,b.jsx)(i,{...r,loaderClass:p.loader})}0&&(module.exports={Bars1,Bars2});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../chunk-DSHGUZTY.mjs";import{a as b}from"../../chunk-PRKLDM64.mjs";import"../../chunk-TB5R2TDU.mjs";export{a as Bars1,b as Bars2};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HTMLProps } from "react";
|
|
2
|
+
/** Interface declaring the common properties of the loaders */
|
|
3
|
+
export interface BaseProps extends HTMLProps<HTMLDivElement> {
|
|
4
|
+
/** width of the loader element in pixels or a string with a length unit. */
|
|
5
|
+
width?: number | string;
|
|
6
|
+
/** height of the loader element in pixels or a string with a length unit. */
|
|
7
|
+
height?: number | string;
|
|
8
|
+
/** Color of the dots - CSS compatible color */
|
|
9
|
+
color?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Other props - loaderClass is included here as we will extend BaseProps for other loaders */
|
|
12
|
+
interface OtherProps {
|
|
13
|
+
/** Loader class name */
|
|
14
|
+
loaderClass: string;
|
|
15
|
+
dotRadius?: number | string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Base component to avoid code duplication
|
|
19
|
+
*
|
|
20
|
+
* default values should be specified in css files - so no need to set them in JSX
|
|
21
|
+
*/
|
|
22
|
+
export declare function Base({ width, height, color, loaderClass, dotRadius, ...props }: BaseProps & OtherProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var P=(s,e)=>{for(var t in e)i(s,t,{get:e[t],enumerable:!0})},h=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of f(e))!g.call(s,r)&&r!==t&&i(s,r,{get:()=>e[r],enumerable:!(n=m(e,r))||n.enumerable});return s};var p=s=>h(i({},"__esModule",{value:!0}),s);var u={};P(u,{Base:()=>d});module.exports=p(u);var l=require("react/jsx-runtime");function d({width:s,height:e,color:t,loaderClass:n,dotRadius:r,...o}){let a={...o.style,width:s,height:e,"--c":t};r&&(a["--r"]=r);let c=[o.className,n].filter(Boolean).join(" ");return(0,l.jsx)("div",{...o,className:c,style:a})}0&&(module.exports={Base});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../../chunk-TB5R2TDU.mjs";export{a as Base};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./base";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var p=(r,e)=>{for(var t in e)i(r,t,{get:e[t],enumerable:!0})},P=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of f(e))!g.call(r,s)&&s!==t&&i(r,s,{get:()=>e[s],enumerable:!(o=m(e,s))||o.enumerable});return r};var h=r=>P(i({},"__esModule",{value:!0}),r);var u={};p(u,{Base:()=>d});module.exports=h(u);var l=require("react/jsx-runtime");function d({width:r,height:e,color:t,loaderClass:o,dotRadius:s,...n}){let a={...n.style,width:r,height:e,"--c":t};s&&(a["--r"]=s);let c=[n.className,o].filter(Boolean).join(" ");return(0,l.jsx)("div",{...n,className:c,style:a})}0&&(module.exports={Base});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../../chunk-TB5R2TDU.mjs";export{a as Base};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./base";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var p=(r,e)=>{for(var t in e)i(r,t,{get:e[t],enumerable:!0})},P=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of f(e))!g.call(r,s)&&s!==t&&i(r,s,{get:()=>e[s],enumerable:!(o=m(e,s))||o.enumerable});return r};var h=r=>P(i({},"__esModule",{value:!0}),r);var u={};p(u,{Base:()=>d});module.exports=h(u);var l=require("react/jsx-runtime");function d({width:r,height:e,color:t,loaderClass:o,dotRadius:s,...n}){let a={...n.style,width:r,height:e,"--c":t};s&&(a["--r"]=s);let c=[n.className,o].filter(Boolean).join(" ");return(0,l.jsx)("div",{...n,className:c,style:a})}0&&(module.exports={Base});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../chunk-TB5R2TDU.mjs";export{a as Base};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.dots1__loader{--c: #000;width:60px;aspect-ratio:4;background:radial-gradient(circle closest-side,var(--c) 90%,rgba(0,0,0,0)) 0/33.3333333333% 100% space;clip-path:inset(0 100% 0 0);animation:dots1__anim 1s steps(4) infinite}@keyframes dots1__anim{to{clip-path:inset(0 -34% 0 0)}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var h=(s,e)=>{for(var r in e)i(s,r,{get:e[r],enumerable:!0})},P=(s,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of _(e))!g.call(s,t)&&t!==r&&i(s,t,{get:()=>e[t],enumerable:!(o=f(e,t))||o.enumerable});return s};var u=s=>P(i({},"__esModule",{value:!0}),s);var b={};h(b,{Dots1:()=>B});module.exports=u(b);var l={loader:"dots1__loader",anim:"dots1__anim"};var c=require("react/jsx-runtime");function d({width:s,height:e,color:r,loaderClass:o,dotRadius:t,...a}){let n={...a.style,width:s,height:e,"--c":r};t&&(n["--r"]=t);let m=[a.className,o].filter(Boolean).join(" ");return(0,c.jsx)("div",{...a,className:m,style:n})}function B(s){return(0,c.jsx)(d,{...s,loaderClass:l.loader})}0&&(module.exports={Dots1});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../../chunk-DRWCG3FW.mjs";import"../../../chunk-TB5R2TDU.mjs";export{a as Dots1};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a={loader:"dots1__loader",anim:"dots1__anim"};export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.dots1__loader{--c: #000;width:60px;aspect-ratio:4;background:radial-gradient(circle closest-side,var(--c) 90%,rgba(0,0,0,0)) 0/33.3333333333% 100% space;clip-path:inset(0 100% 0 0);animation:dots1__anim 1s steps(4) infinite}@keyframes dots1__anim{to{clip-path:inset(0 -34% 0 0)}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dots1";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var h=(e,s)=>{for(var t in s)i(e,t,{get:s[t],enumerable:!0})},P=(e,s,t,o)=>{if(s&&typeof s=="object"||typeof s=="function")for(let r of _(s))!g.call(e,r)&&r!==t&&i(e,r,{get:()=>s[r],enumerable:!(o=f(s,r))||o.enumerable});return e};var u=e=>P(i({},"__esModule",{value:!0}),e);var b={};h(b,{Dots1:()=>B});module.exports=u(b);var l={loader:"dots1__loader",anim:"dots1__anim"};var p=require("react/jsx-runtime");function d({width:e,height:s,color:t,loaderClass:o,dotRadius:r,...a}){let n={...a.style,width:e,height:s,"--c":t};r&&(n["--r"]=r);let m=[a.className,o].filter(Boolean).join(" ");return(0,p.jsx)("div",{...a,className:m,style:n})}function B(e){return(0,p.jsx)(d,{...e,loaderClass:l.loader})}0&&(module.exports={Dots1});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../../chunk-DRWCG3FW.mjs";import"../../../chunk-TB5R2TDU.mjs";export{a as Dots1};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.dots2__loader{width:32px;aspect-ratio:1;--c: #000;--dot-radius: 20%;--_g: no-repeat radial-gradient(farthest-side, var(--c) 90%, #0000);background:var(--_g),var(--_g),var(--_g),var(--_g);background-size:calc(2 * var(--dot-radius)) calc(2 * var(--dot-radius));animation:dots2__anim 1s infinite}@keyframes dots2__anim{0%{background-position:0 0,100% 0,100% 100%,0 100%}40%,50%{background-position:100% 100%,100% 0,0 0,0 100%}90%,to{background-position:100% 100%,0 100%,0 0,100% 0}}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseProps } from "../../common";
|
|
2
|
+
interface Dots2Props extends BaseProps {
|
|
3
|
+
/** Radius of the dots in pixels or a string with a length unit. */
|
|
4
|
+
dotRadius?: number | string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A simple loader with 3 dots.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* <Dots2 />
|
|
11
|
+
*
|
|
12
|
+
* @source
|
|
13
|
+
*/
|
|
14
|
+
export declare function Dots2(props: Dots2Props): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var _=Object.prototype.hasOwnProperty;var f=(r,o)=>{for(var a in o)i(r,a,{get:o[a],enumerable:!0})},v=(r,o,a,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of u(o))!_.call(r,s)&&s!==a&&i(r,s,{get:()=>o[s],enumerable:!(t=g(o,s))||t.enumerable});return r};var P=r=>v(i({},"__esModule",{value:!0}),r);var h={};f(h,{Dots2:()=>b});module.exports=P(h);var d={loader:"dots2__loader",anim:"dots2__anim"};var c=require("react/jsx-runtime");function l({width:r,height:o,color:a,loaderClass:t,dotRadius:s,...e}){let n={...e.style,width:r,height:o,"--c":a};s&&(n["--r"]=s);let m=[e.className,t].filter(Boolean).join(" ");return(0,c.jsx)("div",{...e,className:m,style:n})}function b(r){return(0,c.jsx)(l,{...r,loaderClass:d.loader})}0&&(module.exports={Dots2});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../../chunk-WJ2SJVAM.mjs";import"../../../chunk-TB5R2TDU.mjs";export{a as Dots2};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a={loader:"dots2__loader",anim:"dots2__anim"};export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.dots2__loader{width:32px;aspect-ratio:1;--c: #000;--dot-radius: 20%;--_g: no-repeat radial-gradient(farthest-side, var(--c) 90%, #0000);background:var(--_g),var(--_g),var(--_g),var(--_g);background-size:calc(2 * var(--dot-radius)) calc(2 * var(--dot-radius));animation:dots2__anim 1s infinite}@keyframes dots2__anim{0%{background-position:0 0,100% 0,100% 100%,0 100%}40%,50%{background-position:100% 100%,100% 0,0 0,0 100%}90%,to{background-position:100% 100%,0 100%,0 0,100% 0}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./dots2";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var _=(r,o)=>{for(var a in o)i(r,a,{get:o[a],enumerable:!0})},v=(r,o,a,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of u(o))!f.call(r,s)&&s!==a&&i(r,s,{get:()=>o[s],enumerable:!(t=g(o,s))||t.enumerable});return r};var P=r=>v(i({},"__esModule",{value:!0}),r);var h={};_(h,{Dots2:()=>b});module.exports=P(h);var d={loader:"dots2__loader",anim:"dots2__anim"};var c=require("react/jsx-runtime");function l({width:r,height:o,color:a,loaderClass:t,dotRadius:s,...e}){let n={...e.style,width:r,height:o,"--c":a};s&&(n["--r"]=s);let m=[e.className,t].filter(Boolean).join(" ");return(0,c.jsx)("div",{...e,className:m,style:n})}function b(r){return(0,c.jsx)(l,{...r,loaderClass:d.loader})}0&&(module.exports={Dots2});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../../chunk-WJ2SJVAM.mjs";import"../../../chunk-TB5R2TDU.mjs";export{a as Dots2};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.dots1__loader{--c: #000;width:60px;aspect-ratio:4;background:radial-gradient(circle closest-side,var(--c) 90%,rgba(0,0,0,0)) 0/33.3333333333% 100% space;clip-path:inset(0 100% 0 0);animation:dots1__anim 1s steps(4) infinite}@keyframes dots1__anim{to{clip-path:inset(0 -34% 0 0)}}.dots2__loader{width:32px;aspect-ratio:1;--c: #000;--dot-radius: 20%;--_g: no-repeat radial-gradient(farthest-side, var(--c) 90%, #0000);background:var(--_g),var(--_g),var(--_g),var(--_g);background-size:calc(2 * var(--dot-radius)) calc(2 * var(--dot-radius));animation:dots2__anim 1s infinite}@keyframes dots2__anim{0%{background-position:0 0,100% 0,100% 100%,0 100%}40%,50%{background-position:100% 100%,100% 0,0 0,0 100%}90%,to{background-position:100% 100%,0 100%,0 0,100% 0}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var P=(o,r)=>{for(var a in r)n(o,a,{get:r[a],enumerable:!0})},b=(o,r,a,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of u(r))!v.call(o,s)&&s!==a&&n(o,s,{get:()=>r[s],enumerable:!(t=g(r,s))||t.enumerable});return o};var h=o=>b(n({},"__esModule",{value:!0}),o);var k={};P(k,{Dots1:()=>B,Dots2:()=>x});module.exports=h(k);var l={loader:"dots1__loader",anim:"dots1__anim"};var p=require("react/jsx-runtime");function e({width:o,height:r,color:a,loaderClass:t,dotRadius:s,...i}){let d={...i.style,width:o,height:r,"--c":a};s&&(d["--r"]=s);let f=[i.className,t].filter(Boolean).join(" ");return(0,p.jsx)("div",{...i,className:f,style:d})}function B(o){return(0,p.jsx)(e,{...o,loaderClass:l.loader})}var m={loader:"dots2__loader",anim:"dots2__anim"};function x(o){return(0,p.jsx)(e,{...o,loaderClass:m.loader})}0&&(module.exports={Dots1,Dots2});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as b}from"../../chunk-WJ2SJVAM.mjs";import{a}from"../../chunk-DRWCG3FW.mjs";import"../../chunk-TB5R2TDU.mjs";export{a as Dots1,b as Dots2};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.dots1__loader{--c: #000;width:60px;aspect-ratio:4;background:radial-gradient(circle closest-side,var(--c) 90%,rgba(0,0,0,0)) 0/33.3333333333% 100% space;clip-path:inset(0 100% 0 0);animation:dots1__anim 1s steps(4) infinite}@keyframes dots1__anim{to{clip-path:inset(0 -34% 0 0)}}.dots2__loader{width:32px;aspect-ratio:1;--c: #000;--dot-radius: 20%;--_g: no-repeat radial-gradient(farthest-side, var(--c) 90%, #0000);background:var(--_g),var(--_g),var(--_g),var(--_g);background-size:calc(2 * var(--dot-radius)) calc(2 * var(--dot-radius));animation:dots2__anim 1s infinite}@keyframes dots2__anim{0%{background-position:0 0,100% 0,100% 100%,0 100%}40%,50%{background-position:100% 100%,100% 0,0 0,0 100%}90%,to{background-position:100% 100%,0 100%,0 0,100% 0}}.bars1__loader{width:45px;aspect-ratio:1;--c: #000;--b: no-repeat repeating-linear-gradient(90deg, var(--c) 0 calc(100% / 7), #0000 0 calc(200% / 7));background:var(--b),var(--b),var(--b),var(--b);background-size:140% 26%;animation:bars1__l27 .75s infinite linear}@keyframes bars1__l27{0%,20%{background-position:0 0%,100% 33.3333333333%,0 66.6666666667%,100% 100%}80%,to{background-position:100% 0%,0 33.3333333333%,100% 66.6666666667%,0 100%}}.bars2__loader{width:45px;aspect-ratio:1;--c: #000;--b: no-repeat linear-gradient(var(--c) 0 0);background:var(--b) 0% 50%,var(--b) 50% 50%,var(--b) 100% 50%;background-size:20% 100%;animation:bars2__l1 1s infinite linear}@keyframes bars2__l1{0%{background-size:20% 100%,20% 100%,20% 100%}33%{background-size:20% 10%,20% 100%,20% 100%}50%{background-size:20% 100%,20% 10%,20% 100%}66%{background-size:20% 100%,20% 100%,20% 10%}to{background-size:20% 100%,20% 100%,20% 100%}}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* need to export server components and client components from separate files as
|
|
3
|
+
* directive on top of the file from which component is imported takes effect.
|
|
4
|
+
* i.e., server component re-exported from file with "use client" will behave as client component
|
|
5
|
+
* */
|
|
6
|
+
export * from "./dots";
|
|
7
|
+
export * from "./bars";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var x=(r,a)=>{for(var e in a)n(r,e,{get:a[e],enumerable:!0})},h=(r,a,e,t)=>{if(a&&typeof a=="object"||typeof a=="function")for(let o of B(a))!P.call(r,o)&&o!==e&&n(r,o,{get:()=>a[o],enumerable:!(t=k(a,o))||t.enumerable});return r};var y=r=>h(n({},"__esModule",{value:!0}),r);var T={};x(T,{Bars1:()=>L,Bars2:()=>M,Dots1:()=>z,Dots2:()=>H});module.exports=y(T);var l={loader:"dots1__loader",anim:"dots1__anim"};var p=require("react/jsx-runtime");function s({width:r,height:a,color:e,loaderClass:t,dotRadius:o,...i}){let d={...i.style,width:r,height:a,"--c":e};o&&(d["--r"]=o);let v=[i.className,t].filter(Boolean).join(" ");return(0,p.jsx)("div",{...i,className:v,style:d})}function z(r){return(0,p.jsx)(s,{...r,loaderClass:l.loader})}var _={loader:"dots2__loader",anim:"dots2__anim"};function H(r){return(0,p.jsx)(s,{...r,loaderClass:_.loader})}var b={loader:"bars1__loader",l27:"bars1__l27"};function L(r){return(0,p.jsx)(s,{...r,loaderClass:b.loader})}var f={loader:"bars2__loader",l1:"bars2__l1"};function M(r){return(0,p.jsx)(s,{...r,loaderClass:f.loader})}0&&(module.exports={Bars1,Bars2,Dots1,Dots2});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"../chunk-DSHGUZTY.mjs";import{a as f}from"../chunk-PRKLDM64.mjs";import{a as r}from"../chunk-WJ2SJVAM.mjs";import{a as o}from"../chunk-DRWCG3FW.mjs";import"../chunk-TB5R2TDU.mjs";export{e as Bars1,f as Bars2,o as Dots1,r as Dots2};
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cortex-react-components",
|
|
3
|
+
"author": "Cortex Reply",
|
|
4
|
+
"private": false,
|
|
5
|
+
"version": "1.0.1",
|
|
6
|
+
"description": "A library of React components with styles. Designed to seamlessly integrate with React and Next.js.",
|
|
7
|
+
"license": "MPL-2.0",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"module": "./dist/index.mjs",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"repository": "github:cortex-reply/react-components",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"files": [
|
|
14
|
+
"dist/**"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsup && tsc -p tsconfig-build.json",
|
|
18
|
+
"clean": "rm -rf dist",
|
|
19
|
+
"dev": "tsup --watch && tsc -p tsconfig-build.json -w",
|
|
20
|
+
"typecheck": "tsc --noEmit",
|
|
21
|
+
"lint": "eslint src/",
|
|
22
|
+
"lint:fix": "eslint src/ --fix",
|
|
23
|
+
"test": "vitest run --coverage"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
27
|
+
"@testing-library/react": "^16.1.0",
|
|
28
|
+
"@types/node": "^22.10.2",
|
|
29
|
+
"@types/react": "^19.0.2",
|
|
30
|
+
"@types/react-dom": "^19.0.2",
|
|
31
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
32
|
+
"@vitest/coverage-v8": "^2.1.8",
|
|
33
|
+
"esbuild-plugin-rdi": "^0.0.0",
|
|
34
|
+
"esbuild-plugin-react18": "0.2.6",
|
|
35
|
+
"esbuild-plugin-react18-css": "^0.0.4",
|
|
36
|
+
"jsdom": "^25.0.1",
|
|
37
|
+
"react": "^19.0.0",
|
|
38
|
+
"react-dom": "^19.0.0",
|
|
39
|
+
"semantic-release": "^24.2.0",
|
|
40
|
+
"tsup": "^8.3.5",
|
|
41
|
+
"typescript": "^5.7.2",
|
|
42
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
43
|
+
"vitest": "^2.1.8"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"r18gs": "^3.0.1"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"@types/react": ">=16.8",
|
|
50
|
+
"next": ">=10",
|
|
51
|
+
"react": ">=16.8"
|
|
52
|
+
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"next": {
|
|
55
|
+
"optional": true
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|