@schandlergarcia/sf-web-components 1.9.6 → 1.9.8

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.
@@ -1,11 +1,11 @@
1
1
  import * as React from "react";
2
2
  declare const VARIANT_CLASSES: {
3
- readonly primary: "bg-brand-600 text-white hover:bg-brand-500 dark:bg-brand-500 dark:hover:bg-brand-400 border-transparent";
3
+ readonly primary: "bg-blue-600 text-white hover:bg-blue-500 dark:bg-blue-500 dark:hover:bg-blue-400 border-transparent";
4
4
  readonly secondary: "bg-slate-900 text-white hover:bg-slate-800 dark:bg-slate-100 dark:text-slate-900 dark:hover:bg-slate-200 border-transparent";
5
5
  readonly destructive: "bg-red-600 text-white hover:bg-red-500 dark:bg-red-500 dark:hover:bg-red-400 border-transparent";
6
6
  readonly outline: "bg-transparent text-slate-900 hover:bg-slate-50 dark:text-slate-50 dark:hover:bg-slate-900 border-slate-200 dark:border-slate-800";
7
7
  readonly ghost: "bg-transparent text-slate-900 hover:bg-slate-100 dark:text-slate-50 dark:hover:bg-slate-900 border-transparent";
8
- readonly link: "text-brand-600 underline-offset-4 hover:underline dark:text-brand-400 border-transparent";
8
+ readonly link: "text-blue-600 underline-offset-4 hover:underline dark:text-blue-400 border-transparent";
9
9
  };
10
10
  declare const SIZE_CLASSES: {
11
11
  readonly sm: "h-8 px-3 text-sm";
@@ -1,47 +1,47 @@
1
- import { jsx as b } from "react/jsx-runtime";
1
+ import { jsx as d } from "react/jsx-runtime";
2
2
  const i = {
3
- primary: "bg-brand-600 text-white hover:bg-brand-500 dark:bg-brand-500 dark:hover:bg-brand-400 border-transparent",
3
+ primary: "bg-blue-600 text-white hover:bg-blue-500 dark:bg-blue-500 dark:hover:bg-blue-400 border-transparent",
4
4
  secondary: "bg-slate-900 text-white hover:bg-slate-800 dark:bg-slate-100 dark:text-slate-900 dark:hover:bg-slate-200 border-transparent",
5
5
  destructive: "bg-red-600 text-white hover:bg-red-500 dark:bg-red-500 dark:hover:bg-red-400 border-transparent",
6
6
  outline: "bg-transparent text-slate-900 hover:bg-slate-50 dark:text-slate-50 dark:hover:bg-slate-900 border-slate-200 dark:border-slate-800",
7
7
  ghost: "bg-transparent text-slate-900 hover:bg-slate-100 dark:text-slate-50 dark:hover:bg-slate-900 border-transparent",
8
- link: "text-brand-600 underline-offset-4 hover:underline dark:text-brand-400 border-transparent"
9
- }, g = {
8
+ link: "text-blue-600 underline-offset-4 hover:underline dark:text-blue-400 border-transparent"
9
+ }, u = {
10
10
  sm: "h-8 px-3 text-sm",
11
11
  md: "h-10 px-4 text-sm",
12
12
  lg: "h-12 px-5 text-base",
13
13
  icon: "h-10 w-10 p-0"
14
14
  };
15
- function u({
15
+ function f({
16
16
  variant: e = "primary",
17
17
  size: t = "md",
18
18
  fullWidth: r = !1,
19
19
  disabled: a = !1,
20
20
  className: s = "",
21
- children: n,
22
- ...o
21
+ children: o,
22
+ ...n
23
23
  }) {
24
- const d = i[e], l = g[t];
25
- return /* @__PURE__ */ b(
24
+ const l = i[e], b = u[t];
25
+ return /* @__PURE__ */ d(
26
26
  "button",
27
27
  {
28
28
  type: "button",
29
29
  disabled: a,
30
30
  className: [
31
31
  "inline-flex items-center justify-center gap-2 rounded-lg border font-medium shadow-sm transition",
32
- "focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-slate-950",
32
+ "focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-slate-950",
33
33
  "disabled:cursor-not-allowed disabled:opacity-60",
34
- d,
35
34
  l,
35
+ b,
36
36
  r ? "w-full" : "",
37
37
  s
38
38
  ].filter(Boolean).join(" "),
39
- ...o,
40
- children: n
39
+ ...n,
40
+ children: o
41
41
  }
42
42
  );
43
43
  }
44
44
  export {
45
- u as default
45
+ f as default
46
46
  };
47
47
  //# sourceMappingURL=UIButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UIButton.js","sources":["../../../../src/components/library/ui/UIButton.tsx"],"sourcesContent":["import * as React from \"react\";\n\nconst VARIANT_CLASSES = {\n primary:\n \"bg-brand-600 text-white hover:bg-brand-500 dark:bg-brand-500 dark:hover:bg-brand-400 border-transparent\",\n secondary:\n \"bg-slate-900 text-white hover:bg-slate-800 dark:bg-slate-100 dark:text-slate-900 dark:hover:bg-slate-200 border-transparent\",\n destructive:\n \"bg-red-600 text-white hover:bg-red-500 dark:bg-red-500 dark:hover:bg-red-400 border-transparent\",\n outline:\n \"bg-transparent text-slate-900 hover:bg-slate-50 dark:text-slate-50 dark:hover:bg-slate-900 border-slate-200 dark:border-slate-800\",\n ghost:\n \"bg-transparent text-slate-900 hover:bg-slate-100 dark:text-slate-50 dark:hover:bg-slate-900 border-transparent\",\n link: \"text-brand-600 underline-offset-4 hover:underline dark:text-brand-400 border-transparent\"\n} as const;\n\nconst SIZE_CLASSES = {\n sm: \"h-8 px-3 text-sm\",\n md: \"h-10 px-4 text-sm\",\n lg: \"h-12 px-5 text-base\",\n icon: \"h-10 w-10 p-0\"\n} as const;\n\nexport interface UIButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: keyof typeof VARIANT_CLASSES;\n size?: keyof typeof SIZE_CLASSES;\n fullWidth?: boolean;\n}\n\nexport default function UIButton({\n variant = \"primary\",\n size = \"md\",\n fullWidth = false,\n disabled = false,\n className = \"\",\n children,\n ...rest\n}: UIButtonProps) {\n const variantClass = VARIANT_CLASSES[variant];\n const sizeClass = SIZE_CLASSES[size];\n\n return (\n <button\n type=\"button\"\n disabled={disabled}\n className={[\n \"inline-flex items-center justify-center gap-2 rounded-lg border font-medium shadow-sm transition\",\n \"focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-slate-950\",\n \"disabled:cursor-not-allowed disabled:opacity-60\",\n variantClass,\n sizeClass,\n fullWidth ? \"w-full\" : \"\",\n className\n ]\n .filter(Boolean)\n .join(\" \")}\n {...rest}\n >\n {children}\n </button>\n );\n}\n"],"names":["VARIANT_CLASSES","SIZE_CLASSES","UIButton","variant","size","fullWidth","disabled","className","children","rest","variantClass","sizeClass","jsx"],"mappings":";AAEA,MAAMA,IAAkB;AAAA,EACtB,SACE;AAAA,EACF,WACE;AAAA,EACF,aACE;AAAA,EACF,SACE;AAAA,EACF,OACE;AAAA,EACF,MAAM;AACR,GAEMC,IAAe;AAAA,EACnB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;AAQA,SAAwBC,EAAS;AAAA,EAC/B,SAAAC,IAAU;AAAA,EACV,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,GAAGC;AACL,GAAkB;AAChB,QAAMC,IAAeV,EAAgBG,CAAO,GACtCQ,IAAYV,EAAaG,CAAI;AAEnC,SACE,gBAAAQ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,UAAAN;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACAI;AAAA,QACAC;AAAA,QACAN,IAAY,WAAW;AAAA,QACvBE;AAAA,MAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,MACV,GAAGE;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP;"}
1
+ {"version":3,"file":"UIButton.js","sources":["../../../../src/components/library/ui/UIButton.tsx"],"sourcesContent":["import * as React from \"react\";\n\nconst VARIANT_CLASSES = {\n primary:\n \"bg-blue-600 text-white hover:bg-blue-500 dark:bg-blue-500 dark:hover:bg-blue-400 border-transparent\",\n secondary:\n \"bg-slate-900 text-white hover:bg-slate-800 dark:bg-slate-100 dark:text-slate-900 dark:hover:bg-slate-200 border-transparent\",\n destructive:\n \"bg-red-600 text-white hover:bg-red-500 dark:bg-red-500 dark:hover:bg-red-400 border-transparent\",\n outline:\n \"bg-transparent text-slate-900 hover:bg-slate-50 dark:text-slate-50 dark:hover:bg-slate-900 border-slate-200 dark:border-slate-800\",\n ghost:\n \"bg-transparent text-slate-900 hover:bg-slate-100 dark:text-slate-50 dark:hover:bg-slate-900 border-transparent\",\n link: \"text-blue-600 underline-offset-4 hover:underline dark:text-blue-400 border-transparent\"\n} as const;\n\nconst SIZE_CLASSES = {\n sm: \"h-8 px-3 text-sm\",\n md: \"h-10 px-4 text-sm\",\n lg: \"h-12 px-5 text-base\",\n icon: \"h-10 w-10 p-0\"\n} as const;\n\nexport interface UIButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n variant?: keyof typeof VARIANT_CLASSES;\n size?: keyof typeof SIZE_CLASSES;\n fullWidth?: boolean;\n}\n\nexport default function UIButton({\n variant = \"primary\",\n size = \"md\",\n fullWidth = false,\n disabled = false,\n className = \"\",\n children,\n ...rest\n}: UIButtonProps) {\n const variantClass = VARIANT_CLASSES[variant];\n const sizeClass = SIZE_CLASSES[size];\n\n return (\n <button\n type=\"button\"\n disabled={disabled}\n className={[\n \"inline-flex items-center justify-center gap-2 rounded-lg border font-medium shadow-sm transition\",\n \"focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-slate-950\",\n \"disabled:cursor-not-allowed disabled:opacity-60\",\n variantClass,\n sizeClass,\n fullWidth ? \"w-full\" : \"\",\n className\n ]\n .filter(Boolean)\n .join(\" \")}\n {...rest}\n >\n {children}\n </button>\n );\n}\n"],"names":["VARIANT_CLASSES","SIZE_CLASSES","UIButton","variant","size","fullWidth","disabled","className","children","rest","variantClass","sizeClass","jsx"],"mappings":";AAEA,MAAMA,IAAkB;AAAA,EACtB,SACE;AAAA,EACF,WACE;AAAA,EACF,aACE;AAAA,EACF,SACE;AAAA,EACF,OACE;AAAA,EACF,MAAM;AACR,GAEMC,IAAe;AAAA,EACnB,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;AAQA,SAAwBC,EAAS;AAAA,EAC/B,SAAAC,IAAU;AAAA,EACV,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,WAAAC,IAAY;AAAA,EACZ,UAAAC;AAAA,EACA,GAAGC;AACL,GAAkB;AAChB,QAAMC,IAAeV,EAAgBG,CAAO,GACtCQ,IAAYV,EAAaG,CAAI;AAEnC,SACE,gBAAAQ;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,UAAAN;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACAI;AAAA,QACAC;AAAA,QACAN,IAAY,WAAW;AAAA,QACvBE;AAAA,MAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,MACV,GAAGE;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schandlergarcia/sf-web-components",
3
- "version": "1.9.6",
3
+ "version": "1.9.8",
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",
@@ -65,7 +65,7 @@
65
65
  "world-atlas": "^2.0.0"
66
66
  },
67
67
  "dependencies": {
68
- "@schandlergarcia/sf-web-components": "^1.9.0",
68
+ "@schandlergarcia/sf-web-components": "^1.9.6",
69
69
  "class-variance-authority": "^0.7.1",
70
70
  "clsx": "^2.1.1",
71
71
  "glob": "^13.0.6",
@@ -198,34 +198,19 @@ if (fs.existsSync(templatesDir)) {
198
198
  }
199
199
  }
200
200
 
201
- // Update routes.tsx to use the installed templates
201
+ // Copy routes.tsx template with full configuration
202
+ const routesTemplatePath = path.join(packageRoot, 'src/templates/config/routes.tsx.template');
202
203
  const routesPath = path.join(cwd, 'src/routes.tsx');
203
- if (fs.existsSync(routesPath) && installedTemplates.length > 0) {
204
- console.log('\nšŸ”„ Updating routes.tsx...\n');
205
204
 
206
- try {
207
- let routesContent = fs.readFileSync(routesPath, 'utf-8');
208
- let routesUpdated = false;
209
-
210
- for (const pageName of installedTemplates) {
211
- // Match import statements like: import Home from './features/.../Home' or import Home from './pages/Home'
212
- const importRegex = new RegExp(`import ${pageName} from ['"]\\./(features|pages)/[^'"]+/${pageName}['"];?`, 'g');
213
-
214
- if (importRegex.test(routesContent)) {
215
- routesContent = routesContent.replace(
216
- importRegex,
217
- `import ${pageName} from './pages/${pageName}';`
218
- );
219
- routesUpdated = true;
220
- console.log(` āœ“ Updated ${pageName} import`);
221
- }
222
- }
205
+ if (fs.existsSync(routesTemplatePath) && fs.existsSync(path.join(cwd, 'src'))) {
206
+ console.log('\nšŸ”„ Installing routes configuration...\n');
223
207
 
224
- if (routesUpdated) {
225
- fs.writeFileSync(routesPath, routesContent, 'utf-8');
226
- }
208
+ try {
209
+ const routesContent = fs.readFileSync(routesTemplatePath, 'utf-8');
210
+ fs.writeFileSync(routesPath, routesContent, 'utf-8');
211
+ console.log(' āœ“ Installed complete routes.tsx with Account search and detail pages');
227
212
  } catch (error) {
228
- console.error(` āœ— Failed to update routes.tsx: ${error.message}`);
213
+ console.error(` āœ— Failed to install routes.tsx: ${error.message}`);
229
214
  }
230
215
  }
231
216
 
@@ -2,7 +2,7 @@ import * as React from "react";
2
2
 
3
3
  const VARIANT_CLASSES = {
4
4
  primary:
5
- "bg-brand-600 text-white hover:bg-brand-500 dark:bg-brand-500 dark:hover:bg-brand-400 border-transparent",
5
+ "bg-blue-600 text-white hover:bg-blue-500 dark:bg-blue-500 dark:hover:bg-blue-400 border-transparent",
6
6
  secondary:
7
7
  "bg-slate-900 text-white hover:bg-slate-800 dark:bg-slate-100 dark:text-slate-900 dark:hover:bg-slate-200 border-transparent",
8
8
  destructive:
@@ -11,7 +11,7 @@ const VARIANT_CLASSES = {
11
11
  "bg-transparent text-slate-900 hover:bg-slate-50 dark:text-slate-50 dark:hover:bg-slate-900 border-slate-200 dark:border-slate-800",
12
12
  ghost:
13
13
  "bg-transparent text-slate-900 hover:bg-slate-100 dark:text-slate-50 dark:hover:bg-slate-900 border-transparent",
14
- link: "text-brand-600 underline-offset-4 hover:underline dark:text-brand-400 border-transparent"
14
+ link: "text-blue-600 underline-offset-4 hover:underline dark:text-blue-400 border-transparent"
15
15
  } as const;
16
16
 
17
17
  const SIZE_CLASSES = {
@@ -45,7 +45,7 @@ export default function UIButton({
45
45
  disabled={disabled}
46
46
  className={[
47
47
  "inline-flex items-center justify-center gap-2 rounded-lg border font-medium shadow-sm transition",
48
- "focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-slate-950",
48
+ "focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-slate-950",
49
49
  "disabled:cursor-not-allowed disabled:opacity-60",
50
50
  variantClass,
51
51
  sizeClass,
@@ -0,0 +1,33 @@
1
+ import type { RouteObject } from 'react-router';
2
+ import AppLayout from './appLayout';
3
+ import Home from './features/object-search/__examples__/pages/Home';
4
+ import AccountSearch from './features/object-search/__examples__/pages/AccountSearch';
5
+ import AccountObjectDetailPage from './features/object-search/__examples__/pages/AccountObjectDetailPage';
6
+ import NotFound from './pages/NotFound';
7
+
8
+ export const routes: RouteObject[] = [
9
+ {
10
+ path: "/",
11
+ element: <AppLayout />,
12
+ children: [
13
+ {
14
+ index: true,
15
+ element: <Home />,
16
+ handle: { showInNavigation: true, label: "Home" }
17
+ },
18
+ {
19
+ path: 'accounts',
20
+ element: <AccountSearch />,
21
+ handle: { showInNavigation: true, label: "Accounts" }
22
+ },
23
+ {
24
+ path: 'accounts/:recordId',
25
+ element: <AccountObjectDetailPage />
26
+ },
27
+ {
28
+ path: '*',
29
+ element: <NotFound />
30
+ }
31
+ ]
32
+ }
33
+ ];
@@ -1,4 +1,3 @@
1
- import * as React from "react";
2
1
  import { RocketLaunchIcon } from "@heroicons/react/24/outline";
3
2
  import { EmptyState } from "@/components/library";
4
3