@djangocfg/nextjs 2.1.111 → 2.1.113

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/README.md CHANGED
@@ -390,12 +390,27 @@ function MyComponent() {
390
390
 
391
391
  #### Locale Switcher
392
392
 
393
+ Smart wrapper around `@djangocfg/layouts` LocaleSwitcher with automatic next-intl hooks:
394
+
393
395
  ```tsx
394
396
  import { LocaleSwitcher } from '@djangocfg/nextjs/i18n/components';
395
397
 
396
- <LocaleSwitcher variant="outline" size="sm" />
398
+ // Basic usage (automatically gets locale from next-intl)
399
+ <LocaleSwitcher />
400
+
401
+ // With custom locales (override routing config)
402
+ <LocaleSwitcher locales={['en', 'ru']} />
403
+
404
+ // With custom labels and styling
405
+ <LocaleSwitcher
406
+ labels={{ en: 'English', ru: 'Русский' }}
407
+ variant="outline"
408
+ size="sm"
409
+ />
397
410
  ```
398
411
 
412
+ > **Note:** This component wraps `@djangocfg/layouts` LocaleSwitcher with `useLocaleSwitcher()` hook. For a presentational version that accepts locale data via props, use `LocaleSwitcher` from `@djangocfg/layouts` directly.
413
+
399
414
  ### Sitemap Generation
400
415
 
401
416
  Generate dynamic XML sitemaps with i18n hreflang support:
@@ -625,18 +640,35 @@ import { I18nProvider } from '@djangocfg/nextjs/i18n';
625
640
 
626
641
  #### `LocaleSwitcher`
627
642
 
628
- Ready-to-use locale switcher component.
643
+ Smart locale switcher that wraps `@djangocfg/layouts` LocaleSwitcher with next-intl hooks.
629
644
 
630
645
  ```tsx
631
646
  import { LocaleSwitcher } from '@djangocfg/nextjs/i18n/components';
632
647
 
648
+ // Automatically gets locale from next-intl routing
649
+ <LocaleSwitcher />
650
+
651
+ // With custom options
633
652
  <LocaleSwitcher
653
+ locales={['en', 'ru']} // Override available locales
654
+ labels={{ en: 'EN', ru: 'RU' }} // Custom locale labels
634
655
  variant="outline"
635
656
  size="sm"
657
+ showIcon={true}
636
658
  className="w-full"
637
659
  />
638
660
  ```
639
661
 
662
+ **Props** (extends `@djangocfg/layouts` LocaleSwitcherProps):
663
+ | Prop | Type | Default | Description |
664
+ |------|------|---------|-------------|
665
+ | `locales` | `string[]` | From routing | Override available locales |
666
+ | `labels` | `Record<string, string>` | Built-in | Custom locale labels |
667
+ | `showCode` | `boolean` | `false` | Show locale code with label |
668
+ | `variant` | `'ghost' \| 'outline' \| 'default'` | `'ghost'` | Button variant |
669
+ | `size` | `'sm' \| 'default' \| 'lg' \| 'icon'` | `'sm'` | Button size |
670
+ | `showIcon` | `boolean` | `true` | Show globe icon |
671
+
640
672
  ### Sitemap
641
673
 
642
674
  #### `createSitemapHandler(options)`
@@ -14,7 +14,7 @@ var require_package = __commonJS({
14
14
  "package.json"(exports, module) {
15
15
  module.exports = {
16
16
  name: "@djangocfg/nextjs",
17
- version: "2.1.111",
17
+ version: "2.1.113",
18
18
  description: "Next.js server utilities: sitemap, health, OG images, contact forms, navigation, config",
19
19
  keywords: [
20
20
  "nextjs",