@schandlergarcia/sf-web-components 1.0.13 → 1.0.14

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": "@schandlergarcia/sf-web-components",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "Reusable Salesforce web components library with Tailwind CSS v4 and shadcn/ui",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -27,6 +27,7 @@
27
27
  "files": [
28
28
  "dist",
29
29
  "scripts",
30
+ "src/templates",
30
31
  "README.md",
31
32
  ".a4drules"
32
33
  ],
@@ -116,8 +116,46 @@ for (const pathToRemove of pathsToRemove) {
116
116
  }
117
117
  }
118
118
 
119
+ // Copy page templates
120
+ const templatesDir = path.join(path.dirname(__dirname), 'src/templates/pages');
121
+ const targetPagesDir = path.join(cwd, 'src/pages');
122
+
123
+ console.log('\nšŸ“„ Installing page templates...\n');
124
+
125
+ let templatesInstalled = 0;
126
+
127
+ if (fs.existsSync(templatesDir)) {
128
+ // Create target pages directory if it doesn't exist
129
+ if (!fs.existsSync(targetPagesDir)) {
130
+ fs.mkdirSync(targetPagesDir, { recursive: true });
131
+ }
132
+
133
+ const templates = fs.readdirSync(templatesDir).filter(f => f.endsWith('.template'));
134
+
135
+ for (const template of templates) {
136
+ const sourcePath = path.join(templatesDir, template);
137
+ const targetFileName = template.replace('.template', '');
138
+ const targetPath = path.join(targetPagesDir, targetFileName);
139
+
140
+ // Only copy if target doesn't exist (don't overwrite user's pages)
141
+ if (!fs.existsSync(targetPath)) {
142
+ try {
143
+ const content = fs.readFileSync(sourcePath, 'utf-8');
144
+ fs.writeFileSync(targetPath, content, 'utf-8');
145
+ console.log(` āœ“ Installed ${targetFileName}`);
146
+ templatesInstalled++;
147
+ } catch (error) {
148
+ console.error(` āœ— Failed to install ${targetFileName}: ${error.message}`);
149
+ }
150
+ } else {
151
+ console.log(` ⊘ Skipped ${targetFileName} (already exists)`);
152
+ }
153
+ }
154
+ }
155
+
119
156
  console.log('\nšŸ“Š Summary:');
120
157
  console.log(` - Updated ${filesUpdated} files`);
121
158
  console.log(` - Migrated ${importsUpdated} imports`);
122
159
  console.log(` - Removed ${removedCount} local items`);
160
+ console.log(` - Installed ${templatesInstalled} page templates`);
123
161
  console.log('\nāœ… Migration complete! All imports now use @schandlergarcia/sf-web-components\n');
@@ -0,0 +1,46 @@
1
+ import { useState } from "react";
2
+ import { useNavigate } from "react-router";
3
+ import { Button } from '@schandlergarcia/sf-web-components';
4
+
5
+ export default function HomePage() {
6
+ const navigate = useNavigate();
7
+ const [searchText, setSearchText] = useState("");
8
+
9
+ const handleSearch = (e: React.FormEvent) => {
10
+ e.preventDefault();
11
+ // Navigate to your search results page
12
+ console.log("Search:", searchText);
13
+ };
14
+
15
+ return (
16
+ <div className="flex min-h-[80vh] items-center justify-center px-4 sm:px-6 lg:px-8">
17
+ <div className="w-full max-w-4xl">
18
+ <div className="text-center mb-8">
19
+ <h1 className="text-4xl font-bold text-slate-900 dark:text-slate-50 mb-4">
20
+ Welcome
21
+ </h1>
22
+ <p className="text-lg text-slate-600 dark:text-slate-300">
23
+ Your application is ready to go.
24
+ </p>
25
+ </div>
26
+ <form onSubmit={handleSearch} className="flex flex-col gap-4 items-center">
27
+ <div className="flex gap-2 w-full max-w-2xl">
28
+ <input
29
+ type="text"
30
+ value={searchText}
31
+ onChange={(e) => setSearchText(e.target.value)}
32
+ placeholder="Search..."
33
+ className="flex-1 px-4 py-2 border border-slate-300 dark:border-slate-700 rounded-lg bg-white dark:bg-slate-900 text-slate-900 dark:text-slate-50 focus:outline-none focus:ring-2 focus:ring-slate-400"
34
+ />
35
+ <Button type="submit">Search</Button>
36
+ </div>
37
+ <div className="flex gap-2">
38
+ <Button variant="outline" onClick={() => navigate("/about")}>
39
+ Learn More
40
+ </Button>
41
+ </div>
42
+ </form>
43
+ </div>
44
+ </div>
45
+ );
46
+ }
@@ -0,0 +1,19 @@
1
+ import { useNavigate } from "react-router";
2
+ import { Button } from '@schandlergarcia/sf-web-components';
3
+
4
+ export default function NotFound() {
5
+ const navigate = useNavigate();
6
+
7
+ return (
8
+ <div className="flex min-h-[80vh] items-center justify-center px-4 sm:px-6 lg:px-8">
9
+ <div className="w-full max-w-2xl text-center">
10
+ <h1 className="text-6xl font-bold text-slate-900 dark:text-slate-50 mb-4">404</h1>
11
+ <h2 className="text-2xl font-semibold text-slate-700 dark:text-slate-300 mb-4">Page Not Found</h2>
12
+ <p className="text-lg text-slate-600 dark:text-slate-400 mb-8">
13
+ The page you're looking for doesn't exist.
14
+ </p>
15
+ <Button onClick={() => navigate("/")}>Go Home</Button>
16
+ </div>
17
+ </div>
18
+ );
19
+ }
@@ -0,0 +1,22 @@
1
+ export default function Search() {
2
+ return (
3
+ <div className="flex min-h-[80vh] items-center justify-center px-4 sm:px-6 lg:px-8">
4
+ <div className="w-full max-w-4xl">
5
+ <div className="text-center mb-8">
6
+ <h1 className="text-4xl font-bold text-slate-900 dark:text-slate-50 mb-4">Search</h1>
7
+ <p className="text-lg text-slate-600 dark:text-slate-300">Find records across your organization.</p>
8
+ </div>
9
+ <div className="flex gap-2">
10
+ <input
11
+ type="text"
12
+ placeholder="Search..."
13
+ className="flex-1 px-4 py-2 border border-slate-300 dark:border-slate-700 rounded-lg bg-white dark:bg-slate-900 text-slate-900 dark:text-slate-50 focus:outline-none focus:ring-2 focus:ring-slate-400"
14
+ />
15
+ <button className="px-4 py-2 bg-slate-900 dark:bg-slate-50 text-white dark:text-slate-900 rounded-lg hover:bg-slate-700 dark:hover:bg-slate-200 transition-colors">
16
+ Search
17
+ </button>
18
+ </div>
19
+ </div>
20
+ </div>
21
+ );
22
+ }