@djangocfg/ui-nextjs 2.1.41 → 2.1.43

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.
Files changed (70) hide show
  1. package/package.json +4 -4
  2. package/src/animations/AnimatedBackground.tsx +1 -0
  3. package/src/blocks/ArticleCard.tsx +6 -7
  4. package/src/blocks/ArticleList.tsx +14 -13
  5. package/src/blocks/FeatureSection.tsx +87 -15
  6. package/src/blocks/SuperHero.tsx +10 -4
  7. package/src/components/breadcrumb-navigation.tsx +6 -9
  8. package/src/components/breadcrumb.tsx +6 -5
  9. package/src/components/button-download.tsx +7 -5
  10. package/src/components/dropdown-menu.tsx +6 -5
  11. package/src/components/markdown/MarkdownMessage.tsx +5 -2
  12. package/src/components/menubar.tsx +6 -5
  13. package/src/components/multi-select-pro/async.tsx +8 -18
  14. package/src/components/multi-select-pro/index.tsx +8 -18
  15. package/src/components/navigation-menu.tsx +7 -6
  16. package/src/components/otp/index.tsx +7 -9
  17. package/src/components/otp/use-otp-input.ts +2 -1
  18. package/src/components/pagination-static.tsx +7 -10
  19. package/src/components/pagination.tsx +6 -5
  20. package/src/components/phone-input.tsx +11 -10
  21. package/src/components/sidebar.tsx +11 -21
  22. package/src/components/sonner.tsx +2 -2
  23. package/src/components/ssr-pagination.tsx +6 -9
  24. package/src/hooks/useDeviceDetect.ts +1 -1
  25. package/src/hooks/useHotkey.ts +2 -1
  26. package/src/hooks/useLocalStorage.ts +1 -1
  27. package/src/hooks/useQueryParams.ts +1 -1
  28. package/src/theme/ForceTheme.tsx +1 -0
  29. package/src/theme/ThemeProvider.tsx +1 -0
  30. package/src/theme/ThemeToggle.tsx +4 -2
  31. package/src/tools/JsonForm/JsonSchemaForm.tsx +12 -21
  32. package/src/tools/JsonForm/examples/BotConfigExample.tsx +7 -3
  33. package/src/tools/JsonForm/examples/RealBotConfigExample.tsx +7 -3
  34. package/src/tools/JsonForm/templates/ArrayFieldItemTemplate.tsx +2 -1
  35. package/src/tools/JsonForm/templates/ArrayFieldTemplate.tsx +3 -2
  36. package/src/tools/JsonForm/templates/BaseInputTemplate.tsx +3 -2
  37. package/src/tools/JsonForm/templates/ErrorListTemplate.tsx +3 -2
  38. package/src/tools/JsonForm/templates/FieldTemplate.tsx +2 -1
  39. package/src/tools/JsonForm/templates/ObjectFieldTemplate.tsx +4 -7
  40. package/src/tools/JsonForm/utils.ts +2 -1
  41. package/src/tools/JsonForm/widgets/CheckboxWidget.tsx +2 -1
  42. package/src/tools/JsonForm/widgets/ColorWidget.tsx +3 -2
  43. package/src/tools/JsonForm/widgets/NumberWidget.tsx +3 -2
  44. package/src/tools/JsonForm/widgets/SelectWidget.tsx +4 -7
  45. package/src/tools/JsonForm/widgets/SliderWidget.tsx +4 -3
  46. package/src/tools/JsonForm/widgets/SwitchWidget.tsx +2 -1
  47. package/src/tools/JsonForm/widgets/TextWidget.tsx +3 -2
  48. package/src/tools/JsonTree/index.tsx +2 -1
  49. package/src/tools/LottiePlayer/LottiePlayer.client.tsx +1 -0
  50. package/src/tools/LottiePlayer/index.tsx +1 -0
  51. package/src/tools/LottiePlayer/useLottie.ts +2 -1
  52. package/src/tools/Mermaid/Mermaid.client.tsx +3 -2
  53. package/src/tools/Mermaid/components/MermaidFullscreenModal.tsx +1 -0
  54. package/src/tools/Mermaid/hooks/useMermaidFullscreen.ts +1 -1
  55. package/src/tools/Mermaid/hooks/useMermaidRenderer.ts +3 -2
  56. package/src/tools/OpenapiViewer/components/EndpointInfo.tsx +22 -16
  57. package/src/tools/OpenapiViewer/components/EndpointsLibrary.tsx +12 -4
  58. package/src/tools/OpenapiViewer/components/PlaygroundLayout.tsx +4 -2
  59. package/src/tools/OpenapiViewer/components/PlaygroundStepper.tsx +3 -1
  60. package/src/tools/OpenapiViewer/components/RequestBuilder.tsx +9 -6
  61. package/src/tools/OpenapiViewer/components/RequestParametersForm.tsx +7 -7
  62. package/src/tools/OpenapiViewer/components/ResponseViewer.tsx +8 -4
  63. package/src/tools/OpenapiViewer/components/VersionSelector.tsx +7 -3
  64. package/src/tools/OpenapiViewer/context/PlaygroundContext.tsx +9 -3
  65. package/src/tools/OpenapiViewer/hooks/useOpenApiSchema.ts +3 -7
  66. package/src/tools/OpenapiViewer/index.tsx +3 -1
  67. package/src/tools/PrettyCode/PrettyCode.client.tsx +2 -0
  68. package/src/tools/PrettyCode/index.tsx +1 -0
  69. package/src/tools/VideoPlayer/VideoControls.tsx +4 -3
  70. package/src/tools/VideoPlayer/VideoPlayer.tsx +9 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/ui-nextjs",
3
- "version": "2.1.41",
3
+ "version": "2.1.43",
4
4
  "description": "Next.js UI component library with Radix UI primitives, Tailwind CSS styling, charts, and form components",
5
5
  "keywords": [
6
6
  "ui-components",
@@ -58,8 +58,8 @@
58
58
  "check": "tsc --noEmit"
59
59
  },
60
60
  "peerDependencies": {
61
- "@djangocfg/api": "^2.1.41",
62
- "@djangocfg/ui-core": "^2.1.41",
61
+ "@djangocfg/api": "^2.1.43",
62
+ "@djangocfg/ui-core": "^2.1.43",
63
63
  "@types/react": "^19.1.0",
64
64
  "@types/react-dom": "^19.1.0",
65
65
  "consola": "^3.4.2",
@@ -106,7 +106,7 @@
106
106
  "vidstack": "next"
107
107
  },
108
108
  "devDependencies": {
109
- "@djangocfg/typescript-config": "^2.1.41",
109
+ "@djangocfg/typescript-config": "^2.1.43",
110
110
  "@types/node": "^24.7.2",
111
111
  "eslint": "^9.37.0",
112
112
  "tailwindcss-animate": "1.0.7",
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import React, { useMemo } from 'react';
4
+
4
5
  import { cn } from '@djangocfg/ui-core/lib';
5
6
 
6
7
  export type BackgroundVariant =
@@ -1,6 +1,10 @@
1
1
  import React from 'react';
2
+ import moment from 'moment';
3
+
4
+ import {
5
+ Badge, ButtonLink, Card, CardContent, CardDescription, CardHeader, CardTitle
6
+ } from '@djangocfg/ui-core/components';
2
7
  import { cn } from '@djangocfg/ui-core/lib';
3
- import { Badge, Card, CardContent, CardDescription, CardHeader, CardTitle, ButtonLink } from '@djangocfg/ui-core/components';
4
8
 
5
9
  export type ArticleType = 'security' | 'release' | 'announcement' | 'feature';
6
10
 
@@ -35,12 +39,7 @@ export const ArticleCard: React.FC<ArticleCardProps> = ({
35
39
  className,
36
40
  }) => {
37
41
  const config = typeConfig[type];
38
-
39
- const formattedDate = new Date(date).toLocaleDateString('en-US', {
40
- year: 'numeric',
41
- month: 'long',
42
- day: 'numeric',
43
- });
42
+ const formattedDate = moment(date).format('MMMM D, YYYY');
44
43
 
45
44
  return (
46
45
  <Card className={cn(
@@ -1,5 +1,8 @@
1
- import React from 'react';
1
+ import React, { useMemo } from 'react';
2
+ import moment from 'moment';
3
+
2
4
  import { cn } from '@djangocfg/ui-core/lib';
5
+
3
6
  import { ArticleCard, ArticleType } from './ArticleCard';
4
7
 
5
8
  export interface Article {
@@ -30,18 +33,16 @@ export const ArticleList: React.FC<ArticleListProps> = ({
30
33
  columns = 2,
31
34
  className,
32
35
  }) => {
33
- // Sort by date, newest first
34
- const sortedArticles = [...articles].sort(
35
- (a, b) => new Date(b.date).getTime() - new Date(a.date).getTime()
36
- );
37
-
38
- // Separate featured and regular articles
39
- const featuredArticles = showFeatured
40
- ? sortedArticles.filter((a) => a.featured)
41
- : [];
42
- const regularArticles = showFeatured
43
- ? sortedArticles.filter((a) => !a.featured)
44
- : sortedArticles;
36
+ // Sort by date, newest first, and separate featured/regular articles
37
+ const { featuredArticles, regularArticles } = useMemo(() => {
38
+ const sorted = [...articles].sort(
39
+ (a, b) => moment(b.date).valueOf() - moment(a.date).valueOf()
40
+ );
41
+ return {
42
+ featuredArticles: showFeatured ? sorted.filter((a) => a.featured) : [],
43
+ regularArticles: showFeatured ? sorted.filter((a) => !a.featured) : sorted,
44
+ };
45
+ }, [articles, showFeatured]);
45
46
 
46
47
  const gridCols = {
47
48
  1: 'grid-cols-1',
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
 
3
- import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@djangocfg/ui-core/components';
3
+ import {
4
+ Card, CardContent, CardDescription, CardHeader, CardTitle
5
+ } from '@djangocfg/ui-core/components';
4
6
  import { cn } from '@djangocfg/ui-core/lib';
5
7
 
6
8
  interface Feature {
@@ -11,12 +13,14 @@ interface Feature {
11
13
  }
12
14
 
13
15
  interface FeatureSectionProps {
14
- title: string;
16
+ title?: string;
15
17
  subtitle?: string;
16
18
  features: Feature[];
17
- columns?: 1 | 2 | 3 | 4;
19
+ columns?: 1 | 2 | 3 | 4 | 6;
18
20
  className?: string;
19
- background?: 'dark' | 'card' | 'gradient';
21
+ background?: 'dark' | 'card' | 'gradient' | 'none';
22
+ /** Compact variant: smaller icons, no cards, minimal spacing */
23
+ variant?: 'default' | 'compact';
20
24
  }
21
25
 
22
26
  export const FeatureSection: React.FC<FeatureSectionProps> = ({
@@ -25,9 +29,24 @@ export const FeatureSection: React.FC<FeatureSectionProps> = ({
25
29
  features,
26
30
  columns = 3,
27
31
  className,
28
- background = 'dark'
32
+ background = 'dark',
33
+ variant = 'default'
29
34
  }) => {
30
35
  const getGridClasses = () => {
36
+ if (variant === 'compact') {
37
+ switch (columns) {
38
+ case 2:
39
+ return 'grid-cols-2';
40
+ case 3:
41
+ return 'grid-cols-2 md:grid-cols-3';
42
+ case 4:
43
+ return 'grid-cols-2 md:grid-cols-4';
44
+ case 6:
45
+ return 'grid-cols-2 md:grid-cols-3 lg:grid-cols-6';
46
+ default:
47
+ return 'grid-cols-2 md:grid-cols-3';
48
+ }
49
+ }
31
50
  switch (columns) {
32
51
  case 1:
33
52
  return 'grid-cols-1 max-w-2xl mx-auto';
@@ -37,6 +56,8 @@ export const FeatureSection: React.FC<FeatureSectionProps> = ({
37
56
  return 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-3';
38
57
  case 4:
39
58
  return 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-4';
59
+ case 6:
60
+ return 'grid-cols-2 sm:grid-cols-3 lg:grid-cols-6';
40
61
  default:
41
62
  return 'grid-cols-1 sm:grid-cols-2 lg:grid-cols-3';
42
63
  }
@@ -50,24 +71,75 @@ export const FeatureSection: React.FC<FeatureSectionProps> = ({
50
71
  return 'bg-card';
51
72
  case 'gradient':
52
73
  return 'bg-gradient-to-b from-background to-muted/20';
74
+ case 'none':
75
+ return '';
53
76
  default:
54
77
  return 'bg-background';
55
78
  }
56
79
  };
57
80
 
81
+ // Compact variant render
82
+ if (variant === 'compact') {
83
+ return (
84
+ <section className={cn('py-12 md:py-16', getBackgroundClasses(), className)}>
85
+ <div className="container max-w-5xl mx-auto px-4">
86
+ {(title || subtitle) && (
87
+ <div className="text-center mb-8">
88
+ {title && (
89
+ <h2 className="text-xl sm:text-2xl font-bold text-foreground mb-2">
90
+ {title}
91
+ </h2>
92
+ )}
93
+ {subtitle && (
94
+ <p className="text-sm text-muted-foreground max-w-2xl mx-auto">
95
+ {subtitle}
96
+ </p>
97
+ )}
98
+ </div>
99
+ )}
100
+ <div className={cn('grid gap-4', getGridClasses())}>
101
+ {features.map((feature, index) => (
102
+ <div key={index} className="text-center p-4">
103
+ {feature.icon && (
104
+ <div
105
+ className={cn(
106
+ 'w-10 h-10 mx-auto mb-3 rounded-lg flex items-center justify-center',
107
+ feature.gradient || 'bg-primary/10 text-primary'
108
+ )}
109
+ >
110
+ <div className="[&>svg]:w-5 [&>svg]:h-5">
111
+ {feature.icon}
112
+ </div>
113
+ </div>
114
+ )}
115
+ <h3 className="font-medium text-sm mb-1">{feature.title}</h3>
116
+ <p className="text-xs text-muted-foreground">{feature.description}</p>
117
+ </div>
118
+ ))}
119
+ </div>
120
+ </div>
121
+ </section>
122
+ );
123
+ }
124
+
125
+ // Default variant render
58
126
  return (
59
127
  <section className={cn('py-12 sm:py-16 lg:py-24', getBackgroundClasses(), className)}>
60
128
  <div className="w-full px-4 sm:px-6 lg:px-8">
61
- <div className="text-center mb-12 sm:mb-16">
62
- <h2 className="text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-bold text-foreground mb-4 sm:mb-6">
63
- {title}
64
- </h2>
65
- {subtitle && (
66
- <p className="text-base sm:text-lg md:text-xl text-muted-foreground max-w-3xl mx-auto px-2">
67
- {subtitle}
68
- </p>
69
- )}
70
- </div>
129
+ {(title || subtitle) && (
130
+ <div className="text-center mb-12 sm:mb-16">
131
+ {title && (
132
+ <h2 className="text-2xl sm:text-3xl md:text-4xl lg:text-5xl font-bold text-foreground mb-4 sm:mb-6">
133
+ {title}
134
+ </h2>
135
+ )}
136
+ {subtitle && (
137
+ <p className="text-base sm:text-lg md:text-xl text-muted-foreground max-w-3xl mx-auto px-2">
138
+ {subtitle}
139
+ </p>
140
+ )}
141
+ </div>
142
+ )}
71
143
 
72
144
  <div className={cn('grid gap-6 sm:gap-8', getGridClasses())}>
73
145
  {features.map((feature, index) => (
@@ -3,9 +3,12 @@
3
3
  import { ArrowRight, Sparkles, Wand2 } from 'lucide-react';
4
4
  import React from 'react';
5
5
 
6
+ import {
7
+ Button, ButtonLink, CopyButton, Sticky, Tooltip, TooltipContent, TooltipTrigger
8
+ } from '@djangocfg/ui-core/components';
6
9
  import { cn } from '@djangocfg/ui-core/lib';
7
- import { Button, ButtonLink, Sticky, Tooltip, TooltipTrigger, TooltipContent, CopyButton } from '@djangocfg/ui-core/components';
8
- import { AnimatedBackground, type BackgroundVariant } from '../animations';
10
+
11
+ import { AnimatedBackground, BackgroundVariant} from '../animations';
9
12
  import { ForceTheme } from '../theme';
10
13
 
11
14
  interface HeroFeature {
@@ -105,6 +108,9 @@ export const SuperHero: React.FC<SuperHeroProps> = ({
105
108
  if (codeCommand) return [codeCommand];
106
109
  return [];
107
110
  }, [codeCommand, codeCommands]);
111
+
112
+ // Pre-compute title lines to avoid repeated split in JSX
113
+ const titleLines = React.useMemo(() => title.split('\n'), [title]);
108
114
 
109
115
  // Show background switcher in development mode or if explicitly enabled
110
116
  const isDevelopment = process.env.NODE_ENV === 'development';
@@ -141,10 +147,10 @@ export const SuperHero: React.FC<SuperHeroProps> = ({
141
147
 
142
148
  {/* Enhanced Main Title */}
143
149
  <h1 className="text-4xl sm:text-5xl lg:text-6xl xl:text-7xl font-bold text-foreground mb-6 leading-tight">
144
- {title.split('\n').map((line, index) => (
150
+ {titleLines.map((line, index) => (
145
151
  <React.Fragment key={index}>
146
152
  {line}
147
- {index < title.split('\n').length - 1 && <br />}
153
+ {index < titleLines.length - 1 && <br />}
148
154
  </React.Fragment>
149
155
  ))}
150
156
  {titleGradient && (
@@ -1,15 +1,12 @@
1
- import React from 'react';
2
1
  import Link from 'next/link';
2
+ import React from 'react';
3
+
4
+ import { cn } from '@djangocfg/ui-core/lib';
5
+
3
6
  import {
4
- Breadcrumb,
5
- BreadcrumbList,
6
- BreadcrumbItem,
7
- BreadcrumbLink,
8
- BreadcrumbPage,
9
- BreadcrumbSeparator,
10
- BreadcrumbEllipsis,
7
+ Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage,
8
+ BreadcrumbSeparator
11
9
  } from './breadcrumb';
12
- import { cn } from '@djangocfg/ui-core/lib';
13
10
 
14
11
  export interface BreadcrumbItem {
15
12
  /** Display text for the breadcrumb */
@@ -1,10 +1,11 @@
1
1
  "use client"
2
2
 
3
- import * as React from "react"
4
- import { Slot } from "@radix-ui/react-slot"
5
- import { cn } from "@djangocfg/ui-core/lib"
6
- import { ChevronRight, MoreHorizontal } from "lucide-react"
7
- import Link from "next/link"
3
+ import { ChevronRight, MoreHorizontal } from 'lucide-react';
4
+ import Link from 'next/link';
5
+ import * as React from 'react';
6
+
7
+ import { cn } from '@djangocfg/ui-core/lib';
8
+ import { Slot } from '@radix-ui/react-slot';
8
9
 
9
10
  const Breadcrumb = React.forwardRef<
10
11
  HTMLElement,
@@ -1,10 +1,12 @@
1
1
  "use client"
2
2
 
3
- import * as React from "react"
4
- import { Loader2, Download, CheckCircle2, AlertCircle } from "lucide-react"
5
- import { Button, type ButtonProps } from "@djangocfg/ui-core/components"
6
- import { cn } from "@djangocfg/ui-core/lib"
7
- import { useLocalStorage } from "../hooks/useLocalStorage"
3
+ import { AlertCircle, CheckCircle2, Download, Loader2 } from 'lucide-react';
4
+ import * as React from 'react';
5
+
6
+ import { Button, ButtonProps} from '@djangocfg/ui-core/components';
7
+ import { cn } from '@djangocfg/ui-core/lib';
8
+
9
+ import { useLocalStorage } from '../hooks/useLocalStorage';
8
10
 
9
11
  // Token key used by the API client
10
12
  const TOKEN_KEY = "auth_token"
@@ -1,10 +1,11 @@
1
1
  "use client"
2
2
 
3
- import * as React from "react"
4
- import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
5
- import { cn } from "@djangocfg/ui-core/lib"
6
- import { Check, ChevronRight, Circle } from "lucide-react"
7
- import Link from "next/link"
3
+ import { Check, ChevronRight, Circle } from 'lucide-react';
4
+ import Link from 'next/link';
5
+ import * as React from 'react';
6
+
7
+ import { cn } from '@djangocfg/ui-core/lib';
8
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
8
9
 
9
10
  const DropdownMenu = DropdownMenuPrimitive.Root
10
11
 
@@ -3,10 +3,13 @@
3
3
  import React from 'react';
4
4
  import ReactMarkdown from 'react-markdown';
5
5
  import remarkGfm from 'remark-gfm';
6
- import Mermaid from '../../tools/Mermaid';
7
- import PrettyCode from '../../tools/PrettyCode';
6
+
8
7
  import { CopyButton } from '@djangocfg/ui-core/components';
8
+
9
9
  import { useResolvedTheme } from '../../hooks/useResolvedTheme';
10
+ import Mermaid from '../../tools/Mermaid';
11
+ import PrettyCode from '../../tools/PrettyCode';
12
+
10
13
  import type { Components } from 'react-markdown';
11
14
 
12
15
  // Helper function to extract text content from React children
@@ -1,10 +1,11 @@
1
1
  "use client"
2
2
 
3
- import * as React from "react"
4
- import * as MenubarPrimitive from "@radix-ui/react-menubar"
5
- import { cn } from "@djangocfg/ui-core/lib"
6
- import { Check, ChevronRight, Circle } from "lucide-react"
7
- import Link from "next/link"
3
+ import { Check, ChevronRight, Circle } from 'lucide-react';
4
+ import Link from 'next/link';
5
+ import * as React from 'react';
6
+
7
+ import { cn } from '@djangocfg/ui-core/lib';
8
+ import * as MenubarPrimitive from '@radix-ui/react-menubar';
8
9
 
9
10
  function MenubarMenu({
10
11
  ...props
@@ -13,25 +13,15 @@
13
13
 
14
14
  "use client"
15
15
 
16
- import * as React from "react"
17
- import { Check, ChevronsUpDown, X, XCircle, Loader2 } from "lucide-react"
18
- import { cva } from "class-variance-authority"
19
- import { cn } from "@djangocfg/ui-core/lib"
16
+ import { cva } from 'class-variance-authority';
17
+ import { Check, ChevronsUpDown, Loader2, X, XCircle } from 'lucide-react';
18
+ import * as React from 'react';
19
+
20
20
  import {
21
- Button,
22
- Command,
23
- CommandEmpty,
24
- CommandGroup,
25
- CommandInput,
26
- CommandItem,
27
- CommandList,
28
- CommandSeparator,
29
- Popover,
30
- PopoverContent,
31
- PopoverTrigger,
32
- Badge,
33
- Separator,
34
- } from "@djangocfg/ui-core/components"
21
+ Badge, Button, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList,
22
+ CommandSeparator, Popover, PopoverContent, PopoverTrigger, Separator
23
+ } from '@djangocfg/ui-core/components';
24
+ import { cn } from '@djangocfg/ui-core/lib';
35
25
 
36
26
  // ==================== TYPES ====================
37
27
 
@@ -1,24 +1,14 @@
1
1
  "use client"
2
2
 
3
- import * as React from "react"
4
- import { cva, type VariantProps } from "class-variance-authority"
5
- import { Check, ChevronsUpDown, X, XCircle } from "lucide-react"
6
- import { cn } from "@djangocfg/ui-core/lib"
3
+ import { cva, type VariantProps } from 'class-variance-authority';
4
+ import { Check, ChevronsUpDown, X, XCircle } from 'lucide-react';
5
+ import * as React from 'react';
6
+
7
7
  import {
8
- Button,
9
- Command,
10
- CommandEmpty,
11
- CommandGroup,
12
- CommandInput,
13
- CommandItem,
14
- CommandList,
15
- CommandSeparator,
16
- Popover,
17
- PopoverContent,
18
- PopoverTrigger,
19
- Badge,
20
- Separator,
21
- } from "@djangocfg/ui-core/components"
8
+ Badge, Button, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList,
9
+ CommandSeparator, Popover, PopoverContent, PopoverTrigger, Separator
10
+ } from '@djangocfg/ui-core/components';
11
+ import { cn } from '@djangocfg/ui-core/lib';
22
12
 
23
13
  // ==================== TYPES ====================
24
14
 
@@ -1,11 +1,12 @@
1
1
  "use client"
2
2
 
3
- import * as React from "react"
4
- import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
5
- import { cva } from "class-variance-authority"
6
- import { cn } from "@djangocfg/ui-core/lib"
7
- import { ChevronDown } from "lucide-react"
8
- import Link from "next/link"
3
+ import { cva } from 'class-variance-authority';
4
+ import { ChevronDown } from 'lucide-react';
5
+ import Link from 'next/link';
6
+ import * as React from 'react';
7
+
8
+ import { cn } from '@djangocfg/ui-core/lib';
9
+ import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
9
10
 
10
11
  const NavigationMenu = React.forwardRef<
11
12
  React.ElementRef<typeof NavigationMenuPrimitive.Root>,
@@ -1,14 +1,12 @@
1
1
  'use client'
2
2
 
3
- import * as React from 'react'
4
- import { cn } from '@djangocfg/ui-core'
5
- import {
6
- InputOTP,
7
- InputOTPGroup,
8
- InputOTPSlot,
9
- } from '@djangocfg/ui-core'
10
- import { MinusIcon } from 'lucide-react'
11
- import { useSmartOTP, createPasteHandler } from './use-otp-input'
3
+ import { MinusIcon } from 'lucide-react';
4
+ import * as React from 'react';
5
+
6
+ import { cn, InputOTP, InputOTPGroup, InputOTPSlot } from '@djangocfg/ui-core';
7
+
8
+ import { createPasteHandler, useSmartOTP } from './use-otp-input';
9
+
12
10
  import type { SmartOTPProps } from './types'
13
11
 
14
12
  /**
@@ -1,6 +1,7 @@
1
1
  'use client'
2
2
 
3
- import { useState, useCallback, useMemo, useEffect } from 'react'
3
+ import { useCallback, useEffect, useMemo, useState } from 'react';
4
+
4
5
  import type {
5
6
  SmartOTPProps,
6
7
  UseSmartOTPReturn,
@@ -37,20 +37,17 @@
37
37
 
38
38
  "use client"
39
39
 
40
+ import { ChevronLeft, ChevronRight } from 'lucide-react';
40
41
  import React from 'react';
41
- import { cn } from '@djangocfg/ui-core/lib';
42
- import { useIsMobile } from '@djangocfg/ui-core/hooks';
42
+
43
43
  import { Button } from '@djangocfg/ui-core/components';
44
+ import { useIsMobile } from '@djangocfg/ui-core/hooks';
45
+ import { cn } from '@djangocfg/ui-core/lib';
46
+
44
47
  import {
45
- Pagination,
46
- PaginationContent,
47
- PaginationEllipsis,
48
- PaginationItem,
49
- PaginationLink,
50
- PaginationNext,
51
- PaginationPrevious,
48
+ Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink,
49
+ PaginationNext, PaginationPrevious
52
50
  } from './pagination';
53
- import { ChevronLeft, ChevronRight } from 'lucide-react';
54
51
 
55
52
  /**
56
53
  * DRF Pagination Response type
@@ -1,8 +1,9 @@
1
- import * as React from "react"
2
- import { cn } from "@djangocfg/ui-core/lib"
3
- import { type ButtonProps, buttonVariants } from "@djangocfg/ui-core/components"
4
- import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"
5
- import Link from "next/link"
1
+ import { ChevronLeft, ChevronRight, MoreHorizontal } from 'lucide-react';
2
+ import Link from 'next/link';
3
+ import * as React from 'react';
4
+
5
+ import { ButtonProps, buttonVariants} from '@djangocfg/ui-core/components';
6
+ import { cn } from '@djangocfg/ui-core/lib';
6
7
 
7
8
  const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
8
9
  <nav
@@ -1,16 +1,17 @@
1
1
  "use client"
2
2
 
3
- import * as React from "react"
4
- import { AsYouType, parsePhoneNumberFromString, CountryCode, getCountries, getCountryCallingCode } from 'libphonenumber-js'
5
- import { Input, Button } from "@djangocfg/ui-core/components"
6
- import { cn } from "@djangocfg/ui-core/lib"
7
3
  import {
8
- DropdownMenu,
9
- DropdownMenuContent,
10
- DropdownMenuItem,
11
- DropdownMenuTrigger,
12
- } from "./dropdown-menu"
13
- import { ChevronDown, Search } from "lucide-react"
4
+ AsYouType, CountryCode, getCountries, getCountryCallingCode, parsePhoneNumberFromString
5
+ } from 'libphonenumber-js';
6
+ import { ChevronDown, Search } from 'lucide-react';
7
+ import * as React from 'react';
8
+
9
+ import { Button, Input } from '@djangocfg/ui-core/components';
10
+ import { cn } from '@djangocfg/ui-core/lib';
11
+
12
+ import {
13
+ DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger
14
+ } from './dropdown-menu';
14
15
 
15
16
  // Generate country flag emoji from country code
16
17
  const getCountryFlag = (countryCode: CountryCode): string => {
@@ -1,27 +1,17 @@
1
1
  "use client"
2
2
 
3
- import * as React from "react"
4
- import { Slot } from "@radix-ui/react-slot"
5
- import { VariantProps, cva } from "class-variance-authority"
6
- import { useIsMobile } from "@djangocfg/ui-core/hooks"
7
- import { cn } from "@djangocfg/ui-core/lib"
3
+ import { cva, VariantProps } from 'class-variance-authority';
4
+ import { PanelLeft } from 'lucide-react';
5
+ import Link from 'next/link';
6
+ import * as React from 'react';
7
+
8
8
  import {
9
- Button,
10
- Input,
11
- Separator,
12
- Sheet,
13
- SheetContent,
14
- SheetDescription,
15
- SheetHeader,
16
- SheetTitle,
17
- Skeleton,
18
- Tooltip,
19
- TooltipContent,
20
- TooltipProvider,
21
- TooltipTrigger,
22
- } from "@djangocfg/ui-core/components"
23
- import { PanelLeft } from "lucide-react"
24
- import Link from "next/link"
9
+ Button, Input, Separator, Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle,
10
+ Skeleton, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger
11
+ } from '@djangocfg/ui-core/components';
12
+ import { useIsMobile } from '@djangocfg/ui-core/hooks';
13
+ import { cn } from '@djangocfg/ui-core/lib';
14
+ import { Slot } from '@radix-ui/react-slot';
25
15
 
26
16
  const SIDEBAR_COOKIE_NAME = "sidebar_state"
27
17
  const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
 
3
- import { useTheme } from "next-themes"
4
- import { Toaster as Sonner } from "sonner"
3
+ import { useTheme } from 'next-themes';
4
+ import { Toaster as Sonner } from 'sonner';
5
5
 
6
6
  type ToasterProps = React.ComponentProps<typeof Sonner>
7
7