@salesforce/ui-bundle-template-app-react-template-b2x 1.118.4 → 1.119.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/dist/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.119.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.118.4...v1.119.0) (2026-03-31)
7
+
8
+ **Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
9
+
10
+
11
+
12
+
13
+
6
14
  ## [1.118.4](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.118.3...v1.118.4) (2026-03-31)
7
15
 
8
16
  **Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
@@ -15,8 +15,8 @@
15
15
  "graphql:schema": "node scripts/get-graphql-schema.mjs"
16
16
  },
17
17
  "dependencies": {
18
- "@salesforce/sdk-data": "^1.118.4",
19
- "@salesforce/ui-bundle": "^1.118.4",
18
+ "@salesforce/sdk-data": "^1.119.0",
19
+ "@salesforce/ui-bundle": "^1.119.0",
20
20
  "@tailwindcss/vite": "^4.1.17",
21
21
  "class-variance-authority": "^0.7.1",
22
22
  "clsx": "^2.1.1",
@@ -43,7 +43,7 @@
43
43
  "@graphql-eslint/eslint-plugin": "^4.1.0",
44
44
  "@graphql-tools/utils": "^11.0.0",
45
45
  "@playwright/test": "^1.49.0",
46
- "@salesforce/vite-plugin-ui-bundle": "^1.118.4",
46
+ "@salesforce/vite-plugin-ui-bundle": "^1.119.0",
47
47
  "@testing-library/jest-dom": "^6.6.3",
48
48
  "@testing-library/react": "^16.1.0",
49
49
  "@testing-library/user-event": "^14.5.2",
@@ -1,83 +1,88 @@
1
- import { Outlet, Link, useLocation } from 'react-router';
2
- import { getAllRoutes } from './router-utils';
3
- import { useState } from 'react';
1
+ import { Outlet, Link, useLocation } from "react-router";
2
+ import { getAllRoutes } from "./router-utils";
3
+ import { useState } from "react";
4
+ import { AuthMenu } from "./features/authentication/menu/AuthMenu";
5
+ import { Button } from "./components/ui/button";
4
6
 
5
7
  export default function AppLayout() {
6
- const [isOpen, setIsOpen] = useState(false);
7
- const location = useLocation();
8
+ const [isOpen, setIsOpen] = useState(false);
9
+ const location = useLocation();
8
10
 
9
- const isActive = (path: string) => location.pathname === path;
11
+ const isActive = (path: string) => location.pathname === path;
10
12
 
11
- const toggleMenu = () => setIsOpen(!isOpen);
13
+ const toggleMenu = () => setIsOpen(!isOpen);
12
14
 
13
- const navigationRoutes: { path: string; label: string }[] = getAllRoutes()
14
- .filter(
15
- route =>
16
- route.handle?.showInNavigation === true &&
17
- route.fullPath !== undefined &&
18
- route.handle?.label !== undefined
19
- )
20
- .map(
21
- route =>
22
- ({
23
- path: route.fullPath,
24
- label: route.handle?.label,
25
- }) as { path: string; label: string }
26
- );
15
+ const navigationRoutes: { path: string; label: string }[] = getAllRoutes()
16
+ .filter(
17
+ (route) =>
18
+ route.handle?.showInNavigation === true &&
19
+ route.fullPath !== undefined &&
20
+ route.handle?.label !== undefined,
21
+ )
22
+ .map(
23
+ (route) =>
24
+ ({
25
+ path: route.fullPath,
26
+ label: route.handle?.label,
27
+ }) as { path: string; label: string },
28
+ );
27
29
 
28
- return (
29
- <>
30
- <nav className="bg-white border-b border-gray-200">
31
- <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
32
- <div className="flex justify-between items-center h-16">
33
- <Link to="/" className="text-xl font-semibold text-gray-900">
34
- React App
35
- </Link>
36
- <button
37
- onClick={toggleMenu}
38
- className="p-2 rounded-md text-gray-700 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-blue-500"
39
- aria-label="Toggle menu"
40
- >
41
- <div className="w-6 h-6 flex flex-col justify-center space-y-1.5">
42
- <span
43
- className={`block h-0.5 w-6 bg-current transition-all ${
44
- isOpen ? 'rotate-45 translate-y-2' : ''
45
- }`}
46
- />
47
- <span
48
- className={`block h-0.5 w-6 bg-current transition-all ${isOpen ? 'opacity-0' : ''}`}
49
- />
50
- <span
51
- className={`block h-0.5 w-6 bg-current transition-all ${
52
- isOpen ? '-rotate-45 -translate-y-2' : ''
53
- }`}
54
- />
55
- </div>
56
- </button>
57
- </div>
58
- {isOpen && (
59
- <div className="pb-4">
60
- <div className="flex flex-col space-y-2">
61
- {navigationRoutes.map(item => (
62
- <Link
63
- key={item.path}
64
- to={item.path}
65
- onClick={() => setIsOpen(false)}
66
- className={`px-3 py-2 rounded-md text-sm font-medium transition-colors ${
67
- isActive(item.path)
68
- ? 'bg-blue-100 text-blue-700'
69
- : 'text-gray-700 hover:bg-gray-100'
70
- }`}
71
- >
72
- {item.label}
73
- </Link>
74
- ))}
75
- </div>
76
- </div>
77
- )}
78
- </div>
79
- </nav>
80
- <Outlet />
81
- </>
82
- );
30
+ return (
31
+ <>
32
+ <nav className="bg-white border-b border-gray-200">
33
+ <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
34
+ <div className="flex justify-between items-center h-16">
35
+ <Link to="/" className="text-xl font-semibold text-gray-900">
36
+ React App
37
+ </Link>
38
+ <div className="flex items-center gap-2">
39
+ <AuthMenu />
40
+ <Button
41
+ variant="ghost"
42
+ size="icon"
43
+ onClick={toggleMenu}
44
+ aria-label="Toggle menu"
45
+ aria-expanded={isOpen}
46
+ >
47
+ <div className="w-6 h-6 flex flex-col justify-center space-y-1.5">
48
+ <span
49
+ className={`block h-0.5 w-6 bg-current transition-all ${
50
+ isOpen ? "rotate-45 translate-y-2" : ""
51
+ }`}
52
+ />
53
+ <span
54
+ className={`block h-0.5 w-6 bg-current transition-all ${isOpen ? "opacity-0" : ""}`}
55
+ />
56
+ <span
57
+ className={`block h-0.5 w-6 bg-current transition-all ${
58
+ isOpen ? "-rotate-45 -translate-y-2" : ""
59
+ }`}
60
+ />
61
+ </div>
62
+ </Button>
63
+ </div>
64
+ </div>
65
+ {isOpen && (
66
+ <div className="pb-4">
67
+ <div className="flex flex-col space-y-1">
68
+ {navigationRoutes.map((item) => (
69
+ <Button
70
+ key={item.path}
71
+ variant={isActive(item.path) ? "secondary" : "ghost"}
72
+ asChild
73
+ className="justify-start"
74
+ >
75
+ <Link to={item.path} onClick={() => setIsOpen(false)}>
76
+ {item.label}
77
+ </Link>
78
+ </Button>
79
+ ))}
80
+ </div>
81
+ </div>
82
+ )}
83
+ </div>
84
+ </nav>
85
+ <Outlet />
86
+ </>
87
+ );
83
88
  }
@@ -0,0 +1,109 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { Avatar as AvatarPrimitive } from 'radix-ui';
5
+
6
+ import { cn } from '@/lib/utils';
7
+
8
+ function Avatar({
9
+ className,
10
+ size = 'default',
11
+ ...props
12
+ }: React.ComponentProps<typeof AvatarPrimitive.Root> & {
13
+ size?: 'default' | 'sm' | 'lg';
14
+ }) {
15
+ return (
16
+ <AvatarPrimitive.Root
17
+ data-slot="avatar"
18
+ data-size={size}
19
+ className={cn(
20
+ 'group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6',
21
+ className
22
+ )}
23
+ {...props}
24
+ />
25
+ );
26
+ }
27
+
28
+ function AvatarImage({
29
+ className,
30
+ ...props
31
+ }: React.ComponentProps<typeof AvatarPrimitive.Image>) {
32
+ return (
33
+ <AvatarPrimitive.Image
34
+ data-slot="avatar-image"
35
+ className={cn('aspect-square size-full', className)}
36
+ {...props}
37
+ />
38
+ );
39
+ }
40
+
41
+ function AvatarFallback({
42
+ className,
43
+ ...props
44
+ }: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
45
+ return (
46
+ <AvatarPrimitive.Fallback
47
+ data-slot="avatar-fallback"
48
+ className={cn(
49
+ 'flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs',
50
+ className
51
+ )}
52
+ {...props}
53
+ />
54
+ );
55
+ }
56
+
57
+ function AvatarBadge({ className, ...props }: React.ComponentProps<'span'>) {
58
+ return (
59
+ <span
60
+ data-slot="avatar-badge"
61
+ className={cn(
62
+ 'absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground ring-2 ring-background select-none',
63
+ 'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden',
64
+ 'group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2',
65
+ 'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2',
66
+ className
67
+ )}
68
+ {...props}
69
+ />
70
+ );
71
+ }
72
+
73
+ function AvatarGroup({ className, ...props }: React.ComponentProps<'div'>) {
74
+ return (
75
+ <div
76
+ data-slot="avatar-group"
77
+ className={cn(
78
+ 'group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background',
79
+ className
80
+ )}
81
+ {...props}
82
+ />
83
+ );
84
+ }
85
+
86
+ function AvatarGroupCount({
87
+ className,
88
+ ...props
89
+ }: React.ComponentProps<'div'>) {
90
+ return (
91
+ <div
92
+ data-slot="avatar-group-count"
93
+ className={cn(
94
+ 'relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3',
95
+ className
96
+ )}
97
+ {...props}
98
+ />
99
+ );
100
+ }
101
+
102
+ export {
103
+ Avatar,
104
+ AvatarImage,
105
+ AvatarFallback,
106
+ AvatarBadge,
107
+ AvatarGroup,
108
+ AvatarGroupCount,
109
+ };
@@ -0,0 +1,257 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
5
+ import { DropdownMenu as DropdownMenuPrimitive } from 'radix-ui';
6
+
7
+ import { cn } from '@/lib/utils';
8
+
9
+ function DropdownMenu({
10
+ ...props
11
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
12
+ return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
13
+ }
14
+
15
+ function DropdownMenuPortal({
16
+ ...props
17
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
18
+ return (
19
+ <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
20
+ );
21
+ }
22
+
23
+ function DropdownMenuTrigger({
24
+ ...props
25
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
26
+ return (
27
+ <DropdownMenuPrimitive.Trigger
28
+ data-slot="dropdown-menu-trigger"
29
+ {...props}
30
+ />
31
+ );
32
+ }
33
+
34
+ function DropdownMenuContent({
35
+ className,
36
+ sideOffset = 4,
37
+ ...props
38
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
39
+ return (
40
+ <DropdownMenuPrimitive.Portal>
41
+ <DropdownMenuPrimitive.Content
42
+ data-slot="dropdown-menu-content"
43
+ sideOffset={sideOffset}
44
+ className={cn(
45
+ 'z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',
46
+ className
47
+ )}
48
+ {...props}
49
+ />
50
+ </DropdownMenuPrimitive.Portal>
51
+ );
52
+ }
53
+
54
+ function DropdownMenuGroup({
55
+ ...props
56
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
57
+ return (
58
+ <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
59
+ );
60
+ }
61
+
62
+ function DropdownMenuItem({
63
+ className,
64
+ inset,
65
+ variant = 'default',
66
+ ...props
67
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
68
+ inset?: boolean;
69
+ variant?: 'default' | 'destructive';
70
+ }) {
71
+ return (
72
+ <DropdownMenuPrimitive.Item
73
+ data-slot="dropdown-menu-item"
74
+ data-inset={inset}
75
+ data-variant={variant}
76
+ className={cn(
77
+ "relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",
78
+ className
79
+ )}
80
+ {...props}
81
+ />
82
+ );
83
+ }
84
+
85
+ function DropdownMenuCheckboxItem({
86
+ className,
87
+ children,
88
+ checked,
89
+ ...props
90
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
91
+ return (
92
+ <DropdownMenuPrimitive.CheckboxItem
93
+ data-slot="dropdown-menu-checkbox-item"
94
+ className={cn(
95
+ "relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
96
+ className
97
+ )}
98
+ checked={checked}
99
+ {...props}
100
+ >
101
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
102
+ <DropdownMenuPrimitive.ItemIndicator>
103
+ <CheckIcon className="size-4" />
104
+ </DropdownMenuPrimitive.ItemIndicator>
105
+ </span>
106
+ {children}
107
+ </DropdownMenuPrimitive.CheckboxItem>
108
+ );
109
+ }
110
+
111
+ function DropdownMenuRadioGroup({
112
+ ...props
113
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
114
+ return (
115
+ <DropdownMenuPrimitive.RadioGroup
116
+ data-slot="dropdown-menu-radio-group"
117
+ {...props}
118
+ />
119
+ );
120
+ }
121
+
122
+ function DropdownMenuRadioItem({
123
+ className,
124
+ children,
125
+ ...props
126
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
127
+ return (
128
+ <DropdownMenuPrimitive.RadioItem
129
+ data-slot="dropdown-menu-radio-item"
130
+ className={cn(
131
+ "relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
132
+ className
133
+ )}
134
+ {...props}
135
+ >
136
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
137
+ <DropdownMenuPrimitive.ItemIndicator>
138
+ <CircleIcon className="size-2 fill-current" />
139
+ </DropdownMenuPrimitive.ItemIndicator>
140
+ </span>
141
+ {children}
142
+ </DropdownMenuPrimitive.RadioItem>
143
+ );
144
+ }
145
+
146
+ function DropdownMenuLabel({
147
+ className,
148
+ inset,
149
+ ...props
150
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
151
+ inset?: boolean;
152
+ }) {
153
+ return (
154
+ <DropdownMenuPrimitive.Label
155
+ data-slot="dropdown-menu-label"
156
+ data-inset={inset}
157
+ className={cn(
158
+ 'px-2 py-1.5 text-sm font-medium data-[inset]:pl-8',
159
+ className
160
+ )}
161
+ {...props}
162
+ />
163
+ );
164
+ }
165
+
166
+ function DropdownMenuSeparator({
167
+ className,
168
+ ...props
169
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
170
+ return (
171
+ <DropdownMenuPrimitive.Separator
172
+ data-slot="dropdown-menu-separator"
173
+ className={cn('-mx-1 my-1 h-px bg-border', className)}
174
+ {...props}
175
+ />
176
+ );
177
+ }
178
+
179
+ function DropdownMenuShortcut({
180
+ className,
181
+ ...props
182
+ }: React.ComponentProps<'span'>) {
183
+ return (
184
+ <span
185
+ data-slot="dropdown-menu-shortcut"
186
+ className={cn(
187
+ 'ml-auto text-xs tracking-widest text-muted-foreground',
188
+ className
189
+ )}
190
+ {...props}
191
+ />
192
+ );
193
+ }
194
+
195
+ function DropdownMenuSub({
196
+ ...props
197
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
198
+ return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />;
199
+ }
200
+
201
+ function DropdownMenuSubTrigger({
202
+ className,
203
+ inset,
204
+ children,
205
+ ...props
206
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
207
+ inset?: boolean;
208
+ }) {
209
+ return (
210
+ <DropdownMenuPrimitive.SubTrigger
211
+ data-slot="dropdown-menu-sub-trigger"
212
+ data-inset={inset}
213
+ className={cn(
214
+ "flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
215
+ className
216
+ )}
217
+ {...props}
218
+ >
219
+ {children}
220
+ <ChevronRightIcon className="ml-auto size-4" />
221
+ </DropdownMenuPrimitive.SubTrigger>
222
+ );
223
+ }
224
+
225
+ function DropdownMenuSubContent({
226
+ className,
227
+ ...props
228
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
229
+ return (
230
+ <DropdownMenuPrimitive.SubContent
231
+ data-slot="dropdown-menu-sub-content"
232
+ className={cn(
233
+ 'z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',
234
+ className
235
+ )}
236
+ {...props}
237
+ />
238
+ );
239
+ }
240
+
241
+ export {
242
+ DropdownMenu,
243
+ DropdownMenuPortal,
244
+ DropdownMenuTrigger,
245
+ DropdownMenuContent,
246
+ DropdownMenuGroup,
247
+ DropdownMenuLabel,
248
+ DropdownMenuItem,
249
+ DropdownMenuCheckboxItem,
250
+ DropdownMenuRadioGroup,
251
+ DropdownMenuRadioItem,
252
+ DropdownMenuSeparator,
253
+ DropdownMenuShortcut,
254
+ DropdownMenuSub,
255
+ DropdownMenuSubTrigger,
256
+ DropdownMenuSubContent,
257
+ };
@@ -13,6 +13,14 @@
13
13
  */
14
14
 
15
15
  export { Alert, AlertTitle, AlertDescription, AlertAction } from './alert';
16
+ export {
17
+ Avatar,
18
+ AvatarImage,
19
+ AvatarFallback,
20
+ AvatarBadge,
21
+ AvatarGroup,
22
+ AvatarGroupCount,
23
+ } from './avatar';
16
24
  export { Button, buttonVariants } from './button';
17
25
  export {
18
26
  Card,
@@ -35,6 +43,23 @@ export {
35
43
  DialogTitle,
36
44
  DialogTrigger,
37
45
  } from './dialog';
46
+ export {
47
+ DropdownMenu,
48
+ DropdownMenuPortal,
49
+ DropdownMenuTrigger,
50
+ DropdownMenuContent,
51
+ DropdownMenuGroup,
52
+ DropdownMenuLabel,
53
+ DropdownMenuItem,
54
+ DropdownMenuCheckboxItem,
55
+ DropdownMenuRadioGroup,
56
+ DropdownMenuRadioItem,
57
+ DropdownMenuSeparator,
58
+ DropdownMenuShortcut,
59
+ DropdownMenuSub,
60
+ DropdownMenuSubTrigger,
61
+ DropdownMenuSubContent,
62
+ } from './dropdown-menu';
38
63
  export {
39
64
  Field,
40
65
  FieldDescription,
@@ -0,0 +1,93 @@
1
+ import { CircleUser, LogIn, LogOut, UserPen, UserPlus } from "lucide-react";
2
+ import { Link } from "react-router";
3
+ import { useAuth } from "../context/AuthContext";
4
+ import { ROUTES } from "../authenticationConfig";
5
+ import { Button } from "../../../components/ui/button";
6
+ import { Skeleton } from "../../../components/ui/skeleton";
7
+ import {
8
+ DropdownMenu,
9
+ DropdownMenuContent,
10
+ DropdownMenuItem,
11
+ DropdownMenuLabel,
12
+ DropdownMenuSeparator,
13
+ DropdownMenuTrigger,
14
+ } from "../../../components/ui/dropdown-menu";
15
+
16
+ interface User {
17
+ readonly id: string;
18
+ readonly name: string;
19
+ }
20
+
21
+ export interface AuthMenuProps {
22
+ /** Custom trigger button for the authenticated user's dropdown */
23
+ trigger?: (user: User) => React.ReactNode;
24
+ /** Content rendered instead of the dropdown when the user is not logged in (e.g. a standalone Sign In button) */
25
+ guestContent?: React.ReactNode;
26
+ /** Extra menu items inserted after "Edit Profile" and before "Sign Out" */
27
+ menuItems?: React.ReactNode;
28
+ /** CSS class applied to the DropdownMenuContent wrapper */
29
+ className?: string;
30
+ }
31
+
32
+ export function AuthMenu({ trigger, guestContent, menuItems, className }: AuthMenuProps) {
33
+ const { user, isAuthenticated, loading, logout } = useAuth();
34
+
35
+ if (loading) {
36
+ return <Skeleton className="size-8 rounded-full" />;
37
+ }
38
+
39
+ if (!isAuthenticated && guestContent) {
40
+ return <>{guestContent}</>;
41
+ }
42
+
43
+ const defaultTrigger = (
44
+ <Button variant="ghost" size="icon" aria-label="User menu">
45
+ <CircleUser className="size-6" />
46
+ </Button>
47
+ );
48
+
49
+ const triggerNode = (isAuthenticated && user && trigger?.(user)) || defaultTrigger;
50
+
51
+ return (
52
+ <DropdownMenu>
53
+ <DropdownMenuTrigger asChild>{triggerNode}</DropdownMenuTrigger>
54
+
55
+ <DropdownMenuContent align="end" className={className ?? "w-48"}>
56
+ {isAuthenticated ? (
57
+ <>
58
+ <DropdownMenuLabel className="truncate">{user?.name}</DropdownMenuLabel>
59
+ <DropdownMenuSeparator />
60
+ <DropdownMenuItem asChild>
61
+ <Link to={ROUTES.PROFILE.PATH}>
62
+ <UserPen className="size-4" />
63
+ Edit Profile
64
+ </Link>
65
+ </DropdownMenuItem>
66
+ {menuItems}
67
+ <DropdownMenuItem onClick={() => logout()}>
68
+ <LogOut className="size-4" />
69
+ Sign Out
70
+ </DropdownMenuItem>
71
+ </>
72
+ ) : (
73
+ <>
74
+ <DropdownMenuItem asChild>
75
+ <Link to={ROUTES.LOGIN.PATH}>
76
+ <LogIn className="size-4" />
77
+ Log In
78
+ </Link>
79
+ </DropdownMenuItem>
80
+ <DropdownMenuItem asChild>
81
+ <Link to={ROUTES.REGISTER.PATH}>
82
+ <UserPlus className="size-4" />
83
+ Register
84
+ </Link>
85
+ </DropdownMenuItem>
86
+ </>
87
+ )}
88
+ </DropdownMenuContent>
89
+ </DropdownMenu>
90
+ );
91
+ }
92
+
93
+ export default AuthMenu;
@@ -385,7 +385,16 @@ function buildSingleFilter<TFilter>(
385
385
  if (!value) return null;
386
386
  const searchFields = config?.searchFields ?? [];
387
387
  if (searchFields.length === 0) return null;
388
- const clauses = searchFields.map((f) => ({ [f]: { like: `%${value}%` } }) as TFilter);
388
+ // Supports dot-notation for relationship fields (e.g. "User__r.Name")
389
+ // by building nested filter objects: { User__r: { Name: { like: "%x%" } } }
390
+ const clauses = searchFields.map((f) => {
391
+ const parts = f.split(".");
392
+ let clause: Record<string, unknown> = { like: `%${value}%` };
393
+ for (let i = parts.length - 1; i >= 0; i--) {
394
+ clause = { [parts[i]]: clause };
395
+ }
396
+ return clause as TFilter;
397
+ });
389
398
  if (clauses.length === 1) return clauses[0];
390
399
  return { or: clauses } as TFilter;
391
400
  }
@@ -34,7 +34,7 @@ export const routes: RouteObject[] = [
34
34
  {
35
35
  path: ROUTES.LOGIN.PATH,
36
36
  element: <Login />,
37
- handle: { showInNavigation: true, label: "Login", title: ROUTES.LOGIN.TITLE }
37
+ handle: { showInNavigation: false, label: "Login", title: ROUTES.LOGIN.TITLE }
38
38
  },
39
39
  {
40
40
  path: ROUTES.REGISTER.PATH,
@@ -59,7 +59,7 @@ export const routes: RouteObject[] = [
59
59
  {
60
60
  path: ROUTES.PROFILE.PATH,
61
61
  element: <Profile />,
62
- handle: { showInNavigation: true, label: "Profile", title: ROUTES.PROFILE.TITLE }
62
+ handle: { showInNavigation: false, label: "Profile", title: ROUTES.PROFILE.TITLE }
63
63
  },
64
64
  {
65
65
  path: ROUTES.CHANGE_PASSWORD.PATH,
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@salesforce/webapp-template-base-sfdx-project-experimental",
3
- "version": "1.118.4",
3
+ "version": "1.119.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@salesforce/webapp-template-base-sfdx-project-experimental",
9
- "version": "1.118.4",
9
+ "version": "1.119.0",
10
10
  "license": "SEE LICENSE IN LICENSE.txt",
11
11
  "devDependencies": {
12
12
  "@lwc/eslint-plugin-lwc": "^3.3.0",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/ui-bundle-template-base-sfdx-project",
3
- "version": "1.118.4",
3
+ "version": "1.119.0",
4
4
  "description": "Base SFDX project template",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "publishConfig": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/ui-bundle-template-app-react-template-b2x",
3
- "version": "1.118.4",
3
+ "version": "1.119.0",
4
4
  "description": "Salesforce React external app template",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "",