@djangocfg/layouts 2.1.267 → 2.1.270

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": "@djangocfg/layouts",
3
- "version": "2.1.267",
3
+ "version": "2.1.270",
4
4
  "description": "Simple, straightforward layout components for Next.js - import and use with props",
5
5
  "keywords": [
6
6
  "layouts",
@@ -74,14 +74,14 @@
74
74
  "check": "tsc --noEmit"
75
75
  },
76
76
  "peerDependencies": {
77
- "@djangocfg/api": "^2.1.267",
78
- "@djangocfg/centrifugo": "^2.1.267",
79
- "@djangocfg/debuger": "^2.1.267",
80
- "@djangocfg/i18n": "^2.1.267",
81
- "@djangocfg/monitor": "^2.1.267",
82
- "@djangocfg/ui-core": "^2.1.267",
83
- "@djangocfg/ui-nextjs": "^2.1.267",
84
- "@djangocfg/ui-tools": "^2.1.267",
77
+ "@djangocfg/api": "^2.1.270",
78
+ "@djangocfg/centrifugo": "^2.1.270",
79
+ "@djangocfg/debuger": "^2.1.270",
80
+ "@djangocfg/i18n": "^2.1.270",
81
+ "@djangocfg/monitor": "^2.1.270",
82
+ "@djangocfg/ui-core": "^2.1.270",
83
+ "@djangocfg/ui-nextjs": "^2.1.270",
84
+ "@djangocfg/ui-tools": "^2.1.270",
85
85
  "@hookform/resolvers": "^5.2.2",
86
86
  "consola": "^3.4.2",
87
87
  "lucide-react": "^0.545.0",
@@ -110,15 +110,15 @@
110
110
  "uuid": "^11.1.0"
111
111
  },
112
112
  "devDependencies": {
113
- "@djangocfg/api": "^2.1.267",
114
- "@djangocfg/centrifugo": "^2.1.267",
115
- "@djangocfg/debuger": "^2.1.267",
116
- "@djangocfg/i18n": "^2.1.267",
117
- "@djangocfg/monitor": "^2.1.267",
118
- "@djangocfg/typescript-config": "^2.1.267",
119
- "@djangocfg/ui-core": "^2.1.267",
120
- "@djangocfg/ui-nextjs": "^2.1.267",
121
- "@djangocfg/ui-tools": "^2.1.267",
113
+ "@djangocfg/api": "^2.1.270",
114
+ "@djangocfg/centrifugo": "^2.1.270",
115
+ "@djangocfg/debuger": "^2.1.270",
116
+ "@djangocfg/i18n": "^2.1.270",
117
+ "@djangocfg/monitor": "^2.1.270",
118
+ "@djangocfg/typescript-config": "^2.1.270",
119
+ "@djangocfg/ui-core": "^2.1.270",
120
+ "@djangocfg/ui-nextjs": "^2.1.270",
121
+ "@djangocfg/ui-tools": "^2.1.270",
122
122
  "@types/node": "^24.7.2",
123
123
  "@types/react": "^19.1.0",
124
124
  "@types/react-dom": "^19.1.0",
@@ -81,7 +81,7 @@ export const SetupQRCode: React.FC<SetupQRCodeProps> = ({
81
81
  </div>
82
82
  </div>
83
83
 
84
- <Collapsible>
84
+ <Collapsible className="auth-collapsible-centered">
85
85
  <CollapsibleTrigger asChild>
86
86
  <AuthLink>{content.manualEntry}</AuthLink>
87
87
  </CollapsibleTrigger>
@@ -509,6 +509,13 @@
509
509
  box-shadow: 0 2px 12px hsl(0 0% 0% / 0.1);
510
510
  }
511
511
 
512
+ /* Collapsible with centered trigger (e.g. "Can't scan? Enter manually") */
513
+ .auth-collapsible-centered {
514
+ display: flex;
515
+ flex-direction: column;
516
+ align-items: center;
517
+ }
518
+
512
519
  /* ===== SECRET CODE ===== */
513
520
 
514
521
  .auth-secret-container {
@@ -215,7 +215,7 @@ export const TwoFactorSection: React.FC = () => {
215
215
  Scan the QR code with your authenticator app (Google Authenticator, Authy, etc.)
216
216
  </CardDescription>
217
217
  </CardHeader>
218
- <CardContent>
218
+ <CardContent className="flex justify-center">
219
219
  <SetupStepStandalone
220
220
  onComplete={handleSetupDone}
221
221
  onSkip={() => setView('status')}
@@ -0,0 +1,48 @@
1
+ 'use client';
2
+
3
+ import React from 'react';
4
+
5
+ import {
6
+ Avatar,
7
+ AvatarFallback,
8
+ AvatarImage,
9
+ } from '@djangocfg/ui-core/components';
10
+ import { cn } from '@djangocfg/ui-core/lib';
11
+
12
+ export interface UserAvatarProps {
13
+ src?: string;
14
+ name: string;
15
+ /** 'sm' = 32px (navbar), 'md' = 44px (drawer header). Defaults to 'sm'. */
16
+ size?: 'sm' | 'md';
17
+ className?: string;
18
+ }
19
+
20
+ const SIZE = {
21
+ sm: { avatar: 'h-8 w-8', text: 'text-sm' },
22
+ md: { avatar: 'h-11 w-11', text: 'text-base' },
23
+ } as const;
24
+
25
+ export function UserAvatar({ src, name, size = 'sm', className }: UserAvatarProps) {
26
+ const initial = name.charAt(0).toUpperCase();
27
+ const s = SIZE[size];
28
+
29
+ return (
30
+ <Avatar
31
+ className={cn(
32
+ s.avatar,
33
+ 'ring-2 ring-border/60 hover:ring-primary/70 transition-all shrink-0',
34
+ className,
35
+ )}
36
+ >
37
+ <AvatarImage src={src} alt={name} />
38
+ <AvatarFallback
39
+ className={cn(
40
+ 'bg-primary text-primary-foreground font-semibold',
41
+ s.text,
42
+ )}
43
+ >
44
+ {initial}
45
+ </AvatarFallback>
46
+ </Avatar>
47
+ );
48
+ }
@@ -39,9 +39,6 @@ import { useAppT } from '@djangocfg/i18n';
39
39
 
40
40
  import { useLogout } from '../../hooks';
41
41
  import {
42
- Avatar,
43
- AvatarFallback,
44
- AvatarImage,
45
42
  Button,
46
43
  DropdownMenu,
47
44
  DropdownMenuContent,
@@ -57,6 +54,7 @@ import {
57
54
  } from '@djangocfg/ui-core/components';
58
55
 
59
56
  import { LOCALE_LABELS } from './LocaleSwitcher';
57
+ import { UserAvatar } from './UserAvatar';
60
58
 
61
59
  import type { UserMenuGroup, UserMenuLocaleConfig } from '../types';
62
60
 
@@ -163,13 +161,10 @@ export function UserMenu({
163
161
  if (variant === 'mobile') {
164
162
  return (
165
163
  <div className="space-y-3">
166
- <div className="flex items-center gap-3 px-4 py-3">
167
- <Avatar className="h-10 w-10">
168
- <AvatarImage src={userAvatar} alt={displayName} />
169
- <AvatarFallback>{userInitial}</AvatarFallback>
170
- </Avatar>
164
+ <div className="flex items-center gap-3 px-4 py-3 rounded-xl bg-accent/30">
165
+ <UserAvatar src={userAvatar} name={displayName} size="md" />
171
166
  <div className="flex-1 min-w-0">
172
- <p className="text-sm font-medium text-foreground truncate">
167
+ <p className="text-sm font-semibold text-foreground truncate">
173
168
  {displayName}
174
169
  </p>
175
170
  <p className="text-xs text-muted-foreground truncate">
@@ -269,11 +264,8 @@ export function UserMenu({
269
264
  return (
270
265
  <DropdownMenu>
271
266
  <DropdownMenuTrigger asChild>
272
- <Button variant="ghost" size="icon" className="rounded-full">
273
- <Avatar className="h-8 w-8">
274
- <AvatarImage src={userAvatar} alt={displayName} />
275
- <AvatarFallback>{userInitial}</AvatarFallback>
276
- </Avatar>
267
+ <Button variant="ghost" size="icon" className="rounded-full p-0">
268
+ <UserAvatar src={userAvatar} name={displayName} size="sm" />
277
269
  <span className="sr-only">{labels.userMenu}</span>
278
270
  </Button>
279
271
  </DropdownMenuTrigger>
@@ -8,3 +8,6 @@ export type { LocaleSwitcherProps } from './LocaleSwitcher';
8
8
  export { UserMenu } from './UserMenu';
9
9
  export type { UserMenuProps } from './UserMenu';
10
10
 
11
+ export { UserAvatar } from './UserAvatar';
12
+ export type { UserAvatarProps } from './UserAvatar';
13
+