@djangocfg/layouts 2.1.165 → 2.1.167

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.165",
3
+ "version": "2.1.167",
4
4
  "description": "Simple, straightforward layout components for Next.js - import and use with props",
5
5
  "keywords": [
6
6
  "layouts",
@@ -74,12 +74,12 @@
74
74
  "check": "tsc --noEmit"
75
75
  },
76
76
  "peerDependencies": {
77
- "@djangocfg/api": "^2.1.165",
78
- "@djangocfg/centrifugo": "^2.1.165",
79
- "@djangocfg/i18n": "^2.1.165",
80
- "@djangocfg/ui-core": "^2.1.165",
81
- "@djangocfg/ui-nextjs": "^2.1.165",
82
- "@djangocfg/ui-tools": "^2.1.165",
77
+ "@djangocfg/api": "^2.1.167",
78
+ "@djangocfg/centrifugo": "^2.1.167",
79
+ "@djangocfg/i18n": "^2.1.167",
80
+ "@djangocfg/ui-core": "^2.1.167",
81
+ "@djangocfg/ui-nextjs": "^2.1.167",
82
+ "@djangocfg/ui-tools": "^2.1.167",
83
83
  "@hookform/resolvers": "^5.2.2",
84
84
  "consola": "^3.4.2",
85
85
  "lucide-react": "^0.545.0",
@@ -102,13 +102,13 @@
102
102
  "uuid": "^11.1.0"
103
103
  },
104
104
  "devDependencies": {
105
- "@djangocfg/api": "^2.1.165",
106
- "@djangocfg/i18n": "^2.1.165",
107
- "@djangocfg/centrifugo": "^2.1.165",
108
- "@djangocfg/typescript-config": "^2.1.165",
109
- "@djangocfg/ui-core": "^2.1.165",
110
- "@djangocfg/ui-nextjs": "^2.1.165",
111
- "@djangocfg/ui-tools": "^2.1.165",
105
+ "@djangocfg/api": "^2.1.167",
106
+ "@djangocfg/i18n": "^2.1.167",
107
+ "@djangocfg/centrifugo": "^2.1.167",
108
+ "@djangocfg/typescript-config": "^2.1.167",
109
+ "@djangocfg/ui-core": "^2.1.167",
110
+ "@djangocfg/ui-nextjs": "^2.1.167",
111
+ "@djangocfg/ui-tools": "^2.1.167",
112
112
  "@types/node": "^24.7.2",
113
113
  "@types/react": "^19.1.0",
114
114
  "@types/react-dom": "^19.1.0",
@@ -27,8 +27,9 @@ import {
27
27
  getLanguageFlag,
28
28
  } from '@djangocfg/ui-core/components';
29
29
 
30
- // Default locale labels
30
+ // Default locale labels (supports both simple codes and regional variants)
31
31
  const DEFAULT_LABELS: Record<string, string> = {
32
+ // Major languages
32
33
  en: 'English',
33
34
  ru: 'Русский',
34
35
  ko: '한국어',
@@ -45,6 +46,57 @@ const DEFAULT_LABELS: Record<string, string> = {
45
46
  pl: 'Polski',
46
47
  nl: 'Nederlands',
47
48
  uk: 'Українська',
49
+
50
+ // Regional variants
51
+ 'pt-br': 'Português (Brasil)',
52
+ 'pt-BR': 'Português (Brasil)',
53
+ 'pt-pt': 'Português (Portugal)',
54
+ 'pt-PT': 'Português (Portugal)',
55
+ 'zh-cn': '简体中文',
56
+ 'zh-CN': '简体中文',
57
+ 'zh-tw': '繁體中文',
58
+ 'zh-TW': '繁體中文',
59
+ 'en-us': 'English (US)',
60
+ 'en-US': 'English (US)',
61
+ 'en-gb': 'English (UK)',
62
+ 'en-GB': 'English (UK)',
63
+ 'es-mx': 'Español (México)',
64
+ 'es-MX': 'Español (México)',
65
+ 'es-es': 'Español (España)',
66
+ 'es-ES': 'Español (España)',
67
+ 'fr-ca': 'Français (Canada)',
68
+ 'fr-CA': 'Français (Canada)',
69
+
70
+ // Scandinavian languages
71
+ sv: 'Svenska',
72
+ no: 'Norsk',
73
+ nb: 'Norsk Bokmål',
74
+ nn: 'Norsk Nynorsk',
75
+ da: 'Dansk',
76
+ fi: 'Suomi',
77
+ is: 'Íslenska',
78
+
79
+ // Other European
80
+ cs: 'Čeština',
81
+ sk: 'Slovenčina',
82
+ hu: 'Magyar',
83
+ ro: 'Română',
84
+ bg: 'Български',
85
+ hr: 'Hrvatski',
86
+ sr: 'Српски',
87
+ sl: 'Slovenščina',
88
+ et: 'Eesti',
89
+ lv: 'Latviešu',
90
+ lt: 'Lietuvių',
91
+ el: 'Ελληνικά',
92
+
93
+ // Other
94
+ th: 'ไทย',
95
+ vi: 'Tiếng Việt',
96
+ id: 'Indonesia',
97
+ ms: 'Bahasa Melayu',
98
+ he: 'עברית',
99
+ fa: 'فارسی',
48
100
  };
49
101
 
50
102
  export interface LocaleSwitcherProps {
@@ -66,6 +118,8 @@ export interface LocaleSwitcherProps {
66
118
  showIcon?: boolean;
67
119
  /** Show flag emoji (default: true) */
68
120
  showFlag?: boolean;
121
+ /** Show label text in trigger button (default: true) */
122
+ showTriggerLabel?: boolean;
69
123
  /** Custom className */
70
124
  className?: string;
71
125
  }
@@ -80,6 +134,7 @@ export function LocaleSwitcher({
80
134
  size = 'sm',
81
135
  showIcon = true,
82
136
  showFlag = true,
137
+ showTriggerLabel = true,
83
138
  className,
84
139
  }: LocaleSwitcherProps) {
85
140
  const allLabels = { ...DEFAULT_LABELS, ...labels };
@@ -105,9 +160,9 @@ export function LocaleSwitcher({
105
160
  <DropdownMenu>
106
161
  <DropdownMenuTrigger asChild>
107
162
  <Button variant={variant} size={size} className={className}>
108
- {showIcon && !currentFlag && <Globe className="h-4 w-4 mr-1" />}
109
- {currentFlag && <span className="mr-1">{currentFlag}</span>}
110
- <span>{currentLabel}</span>
163
+ {showIcon && !currentFlag && <Globe className={showTriggerLabel ? "h-4 w-4 mr-1" : "h-4 w-4"} />}
164
+ {currentFlag && <span className={showTriggerLabel ? "mr-1" : ""}>{currentFlag}</span>}
165
+ {showTriggerLabel && <span>{currentLabel}</span>}
111
166
  </Button>
112
167
  </DropdownMenuTrigger>
113
168
  <DropdownMenuContent align="end">