techsaraz-loader 1.0.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/README.md ADDED
@@ -0,0 +1,102 @@
1
+ # TechSaraZ Loader
2
+
3
+ An animated full-screen React loader with rotating inspirational quotes. Fully customizable with dynamic brand name, logo, and quotes.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @techsaraz/core-loader
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### Basic Usage (with TechSaraZ defaults)
14
+
15
+ ```tsx
16
+ import TechSaraZLoader from '@techsaraz/core-loader';
17
+
18
+ function App() {
19
+ return <TechSaraZLoader />;
20
+ }
21
+ ```
22
+
23
+ ### Custom Brand Name
24
+
25
+ ```tsx
26
+ import TechSaraZLoader from '@techsaraz/core-loader';
27
+
28
+ function App() {
29
+ return <TechSaraZLoader brandName="MyBrand" />;
30
+ }
31
+ ```
32
+
33
+ ### With Brand Logo
34
+
35
+ ```tsx
36
+ import TechSaraZLoader from '@techsaraz/core-loader';
37
+
38
+ function App() {
39
+ return (
40
+ <TechSaraZLoader
41
+ brandName="MyCompany"
42
+ brandLogo="/logo.png"
43
+ logoWidth={100}
44
+ logoHeight={100}
45
+ />
46
+ );
47
+ }
48
+ ```
49
+
50
+ ### Custom Quotes
51
+
52
+ ```tsx
53
+ import TechSaraZLoader from '@techsaraz/core-loader';
54
+
55
+ function App() {
56
+ const customQuotes = [
57
+ 'Loading your experience...',
58
+ 'Almost there...',
59
+ 'Preparing something awesome...',
60
+ ];
61
+
62
+ return (
63
+ <TechSaraZLoader
64
+ brandName="MyApp"
65
+ quotes={customQuotes}
66
+ quoteInterval={3000}
67
+ />
68
+ );
69
+ }
70
+ ```
71
+
72
+ ### Without Braces
73
+
74
+ ```tsx
75
+ import TechSaraZLoader from '@techsaraz/core-loader';
76
+
77
+ function App() {
78
+ return <TechSaraZLoader brandName="MyBrand" showBraces={false} />;
79
+ }
80
+ ```
81
+
82
+ ## Props
83
+
84
+ | Prop | Type | Default | Description |
85
+ |------|------|---------|-------------|
86
+ | `brandName` | `string` | `"TechSaraZ"` | Brand name to display in the loader |
87
+ | `brandLogo` | `string` | `undefined` | URL of the brand logo to display above the brand name |
88
+ | `brandLogoAlt` | `string` | `brandName` | Alt text for the brand logo |
89
+ | `logoWidth` | `number` | `80` | Logo width in pixels |
90
+ | `logoHeight` | `number` | `80` | Logo height in pixels |
91
+ | `quotes` | `string[]` | Default TechSaraZ quotes | Custom quotes to cycle through |
92
+ | `quoteInterval` | `number` | `4000` | Interval in milliseconds between quote changes |
93
+ | `showBraces` | `boolean` | `true` | Whether to show curly braces around the brand name |
94
+ | `className` | `string` | `undefined` | Custom class name for the container |
95
+
96
+ ## Styling
97
+
98
+ The loader uses Tailwind CSS classes. Make sure you have Tailwind CSS configured in your project for proper styling.
99
+
100
+ ## License
101
+
102
+ MIT
package/dist/index.js ADDED
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ const defaultQuotes = [
4
+ 'Crafting Future-Ready Digital Experiences...',
5
+ 'Integrity in Every Line of Code.',
6
+ 'Designing With Purpose. Building With Precision.',
7
+ 'Where Creativity Meets Technology.',
8
+ 'Delivering Trust Through Technology.',
9
+ 'Innovating at the Speed of Thought.',
10
+ 'Smart Solutions. Real Impact.',
11
+ 'Pixels with Purpose. Code with Character.',
12
+ "We Don't Just Build, We Engineer.",
13
+ ];
14
+ const TechSaraZLoader = ({ brandName = 'TechSaraZ', brandLogo, brandLogoAlt, logoWidth = 80, logoHeight = 80, quotes = defaultQuotes, quoteInterval = 4000, showBraces = true, className, }) => {
15
+ const [quoteIndex, setQuoteIndex] = useState(0);
16
+ useEffect(() => {
17
+ if (quotes.length === 0)
18
+ return;
19
+ const interval = setInterval(() => {
20
+ setQuoteIndex((prev) => (prev + 1) % quotes.length);
21
+ }, quoteInterval);
22
+ return () => clearInterval(interval);
23
+ }, [quotes.length, quoteInterval]);
24
+ return (_jsxs("div", { className: `fixed inset-0 z-50 flex flex-col items-center justify-center bg-white/70 text-center px-4 ${className || ''}`, children: [brandLogo && (_jsx("img", { src: brandLogo, alt: brandLogoAlt || brandName, width: logoWidth, height: logoHeight, className: "mb-4 object-contain" })), _jsxs("div", { className: "text-2xl sm:text-3xl font-mono text-blue-800 mb-6", children: [showBraces && '{', brandName, _jsx("span", { className: "dots" }), showBraces && '}'] }), quotes.length > 0 && (_jsx("p", { className: "text-lg text-blue-900 font-medium transition-opacity duration-700 ease-in-out", children: quotes[quoteIndex] })), _jsx("style", { children: `
25
+ .dots::after {
26
+ content: '';
27
+ animation: dots 1.5s steps(4, end) infinite;
28
+ }
29
+ @keyframes dots {
30
+ 0% { content: ''; }
31
+ 25% { content: '.'; }
32
+ 50% { content: '..'; }
33
+ 75% { content: '...'; }
34
+ 100% { content: ''; }
35
+ }
36
+ ` })] }));
37
+ };
38
+ export default TechSaraZLoader;
39
+ export { TechSaraZLoader };
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ export interface TechSaraZLoaderProps {
3
+ /** Brand name to display in the loader. Defaults to "TechSaraZ" */
4
+ brandName?: string;
5
+ /** Brand logo URL to display above the brand name */
6
+ brandLogo?: string;
7
+ /** Alt text for the brand logo. Defaults to brandName value */
8
+ brandLogoAlt?: string;
9
+ /** Logo width in pixels. Defaults to 80 */
10
+ logoWidth?: number;
11
+ /** Logo height in pixels. Defaults to 80 */
12
+ logoHeight?: number;
13
+ /** Custom quotes to cycle through. Defaults to TechSaraZ quotes */
14
+ quotes?: string[];
15
+ /** Interval in milliseconds between quote changes. Defaults to 4000 */
16
+ quoteInterval?: number;
17
+ /** Whether to show curly braces around the brand name. Defaults to true */
18
+ showBraces?: boolean;
19
+ /** Custom class name for the container */
20
+ className?: string;
21
+ }
22
+ declare const TechSaraZLoader: React.FC<TechSaraZLoaderProps>;
23
+ export default TechSaraZLoader;
24
+ export { TechSaraZLoader };
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "techsaraz-loader",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.js",
7
+ "types": "dist/types/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.js",
14
+ "types": "./dist/types/index.d.ts"
15
+ }
16
+ },
17
+ "scripts": {
18
+ "build": "tsc"
19
+ },
20
+ "peerDependencies": {
21
+ "react": "^18.0.0",
22
+ "react-dom": "^18.0.0"
23
+ }
24
+ }