@snapdragonsnursery/react-components 1.0.7 → 1.0.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapdragonsnursery/react-components",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -25,7 +25,8 @@
25
25
  "react-dom": "^18.3.1"
26
26
  },
27
27
  "peerDependencies": {
28
- "@azure/msal-react": ">=1.0.0"
28
+ "@azure/msal-react": ">=1.0.0",
29
+ "react": "^18.0.0 || ^19.0.0"
29
30
  },
30
31
  "module": "src/index.js",
31
32
  "files": [
@@ -0,0 +1,102 @@
1
+ // LandingPage.jsx
2
+ //
3
+ // A reusable landing page component for Microsoft authentication
4
+ // Designed to work across different applications with customizable branding
5
+ // Compatible with shadcn/ui styling system
6
+ //
7
+ // Example usage:
8
+ // import LandingPage from './LandingPage';
9
+ // <LandingPage
10
+ // logoUrl="https://your-logo-url.png"
11
+ // appName="Your App Name"
12
+ // appDescription="Your app description"
13
+ // onSignIn={handleSignIn}
14
+ // companyName="Your Company"
15
+ // />
16
+ //
17
+ // Props:
18
+ // - logoUrl: URL to the company logo (required)
19
+ // - appName: Name of the application (required)
20
+ // - appDescription: Description of the application (optional)
21
+ // - onSignIn: Function to handle sign-in click (optional)
22
+ // - companyName: Company name for footer text (optional)
23
+ // - backgroundColor: Custom background gradient (optional)
24
+ // - cardClassName: Additional CSS classes for the card (optional)
25
+
26
+ import React from 'react';
27
+
28
+ const LandingPage = ({
29
+ logoUrl,
30
+ appName,
31
+ appDescription = "Manage your application efficiently",
32
+ onSignIn,
33
+ companyName = "Your Company",
34
+ backgroundColor = "bg-gradient-to-br from-blue-50 to-indigo-100",
35
+ cardClassName = ""
36
+ }) => {
37
+ const handleSignInClick = () => {
38
+ if (onSignIn) {
39
+ onSignIn();
40
+ } else {
41
+ console.log('Sign in with Microsoft clicked');
42
+ }
43
+ };
44
+
45
+ return (
46
+ <div className={`min-h-screen ${backgroundColor} flex items-center justify-center p-4`}>
47
+ <div className={`max-w-md w-full bg-card text-card-foreground rounded-2xl shadow-xl p-8 border ${cardClassName}`}>
48
+ {/* Logo Section */}
49
+ <div className="text-center mb-8">
50
+ <img
51
+ src={logoUrl}
52
+ alt={`${companyName} Logo`}
53
+ className="h-16 mx-auto mb-4"
54
+ />
55
+ <h1 className="text-2xl font-bold text-foreground mb-2">
56
+ {appName}
57
+ </h1>
58
+ <p className="text-muted-foreground">
59
+ {appDescription}
60
+ </p>
61
+ </div>
62
+
63
+ {/* Sign In Section */}
64
+ <div className="space-y-6">
65
+ <div className="text-center">
66
+ <svg className="h-12 w-12 text-primary mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
67
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4" />
68
+ </svg>
69
+ <h2 className="text-xl font-semibold text-foreground mb-2">
70
+ Welcome Back
71
+ </h2>
72
+ <p className="text-sm text-muted-foreground">
73
+ Sign in with your Microsoft account to access the system
74
+ </p>
75
+ </div>
76
+
77
+ {/* Microsoft Sign In Button */}
78
+ <button
79
+ onClick={handleSignInClick}
80
+ className="w-full bg-primary text-primary-foreground hover:bg-primary/90 font-medium py-3 px-4 rounded-lg transition-colors duration-200 flex items-center justify-center space-x-2"
81
+ >
82
+ {/* Official Microsoft logo SVG */}
83
+ <svg className="w-5 h-5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
84
+ <rect x="2" y="2" width="9" height="9" fill="#F35325"/>
85
+ <rect x="13" y="2" width="9" height="9" fill="#81BC06"/>
86
+ <rect x="2" y="13" width="9" height="9" fill="#05A6F0"/>
87
+ <rect x="13" y="13" width="9" height="9" fill="#FFBA08"/>
88
+ </svg>
89
+ <span>Sign in with Microsoft</span>
90
+ </button>
91
+
92
+ {/* Additional Info */}
93
+ <div className="text-center text-xs text-muted-foreground">
94
+ <p>This application is for {companyName} employees only</p>
95
+ </div>
96
+ </div>
97
+ </div>
98
+ </div>
99
+ );
100
+ };
101
+
102
+ export default LandingPage;
package/src/index.js CHANGED
@@ -2,4 +2,5 @@ export { default as AuthButtons } from "./AuthButtons";
2
2
  export { default as ThemeToggle } from "./ThemeToggle";
3
3
  export { default as ChildSearchModal } from "./ChildSearchModal";
4
4
  export { default as ThemeToggleTest } from "./ThemeToggleTest";
5
+ export { default as LandingPage } from "./LandingPage";
5
6
  export { configureTelemetry } from "./telemetry";