@djangocfg/ui-nextjs 2.1.42 → 2.1.44

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 (76) 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/SplitHero/SplitHero.tsx +95 -0
  7. package/src/blocks/SplitHero/SplitHeroContent.tsx +117 -0
  8. package/src/blocks/SplitHero/SplitHeroMedia.tsx +66 -0
  9. package/src/blocks/SplitHero/index.ts +13 -0
  10. package/src/blocks/SplitHero/types.ts +75 -0
  11. package/src/blocks/SuperHero.tsx +10 -4
  12. package/src/blocks/index.ts +1 -0
  13. package/src/components/breadcrumb-navigation.tsx +6 -9
  14. package/src/components/breadcrumb.tsx +6 -5
  15. package/src/components/button-download.tsx +7 -5
  16. package/src/components/dropdown-menu.tsx +6 -5
  17. package/src/components/markdown/MarkdownMessage.tsx +5 -2
  18. package/src/components/menubar.tsx +6 -5
  19. package/src/components/multi-select-pro/async.tsx +8 -18
  20. package/src/components/multi-select-pro/index.tsx +8 -18
  21. package/src/components/navigation-menu.tsx +7 -6
  22. package/src/components/otp/index.tsx +7 -9
  23. package/src/components/otp/use-otp-input.ts +2 -1
  24. package/src/components/pagination-static.tsx +7 -10
  25. package/src/components/pagination.tsx +6 -5
  26. package/src/components/phone-input.tsx +11 -10
  27. package/src/components/sidebar.tsx +11 -21
  28. package/src/components/sonner.tsx +2 -2
  29. package/src/components/ssr-pagination.tsx +6 -9
  30. package/src/hooks/useDeviceDetect.ts +1 -1
  31. package/src/hooks/useHotkey.ts +2 -1
  32. package/src/hooks/useLocalStorage.ts +1 -1
  33. package/src/hooks/useQueryParams.ts +1 -1
  34. package/src/theme/ForceTheme.tsx +1 -0
  35. package/src/theme/ThemeProvider.tsx +1 -0
  36. package/src/theme/ThemeToggle.tsx +4 -2
  37. package/src/tools/JsonForm/JsonSchemaForm.tsx +12 -21
  38. package/src/tools/JsonForm/examples/BotConfigExample.tsx +7 -3
  39. package/src/tools/JsonForm/examples/RealBotConfigExample.tsx +7 -3
  40. package/src/tools/JsonForm/templates/ArrayFieldItemTemplate.tsx +2 -1
  41. package/src/tools/JsonForm/templates/ArrayFieldTemplate.tsx +3 -2
  42. package/src/tools/JsonForm/templates/BaseInputTemplate.tsx +3 -2
  43. package/src/tools/JsonForm/templates/ErrorListTemplate.tsx +3 -2
  44. package/src/tools/JsonForm/templates/FieldTemplate.tsx +2 -1
  45. package/src/tools/JsonForm/templates/ObjectFieldTemplate.tsx +4 -7
  46. package/src/tools/JsonForm/utils.ts +2 -1
  47. package/src/tools/JsonForm/widgets/CheckboxWidget.tsx +2 -1
  48. package/src/tools/JsonForm/widgets/ColorWidget.tsx +3 -2
  49. package/src/tools/JsonForm/widgets/NumberWidget.tsx +3 -2
  50. package/src/tools/JsonForm/widgets/SelectWidget.tsx +4 -7
  51. package/src/tools/JsonForm/widgets/SliderWidget.tsx +4 -3
  52. package/src/tools/JsonForm/widgets/SwitchWidget.tsx +2 -1
  53. package/src/tools/JsonForm/widgets/TextWidget.tsx +3 -2
  54. package/src/tools/JsonTree/index.tsx +2 -1
  55. package/src/tools/LottiePlayer/LottiePlayer.client.tsx +1 -0
  56. package/src/tools/LottiePlayer/index.tsx +1 -0
  57. package/src/tools/LottiePlayer/useLottie.ts +2 -1
  58. package/src/tools/Mermaid/Mermaid.client.tsx +3 -2
  59. package/src/tools/Mermaid/components/MermaidFullscreenModal.tsx +1 -0
  60. package/src/tools/Mermaid/hooks/useMermaidFullscreen.ts +1 -1
  61. package/src/tools/Mermaid/hooks/useMermaidRenderer.ts +3 -2
  62. package/src/tools/OpenapiViewer/components/EndpointInfo.tsx +22 -16
  63. package/src/tools/OpenapiViewer/components/EndpointsLibrary.tsx +12 -4
  64. package/src/tools/OpenapiViewer/components/PlaygroundLayout.tsx +4 -2
  65. package/src/tools/OpenapiViewer/components/PlaygroundStepper.tsx +3 -1
  66. package/src/tools/OpenapiViewer/components/RequestBuilder.tsx +9 -6
  67. package/src/tools/OpenapiViewer/components/RequestParametersForm.tsx +7 -7
  68. package/src/tools/OpenapiViewer/components/ResponseViewer.tsx +8 -4
  69. package/src/tools/OpenapiViewer/components/VersionSelector.tsx +7 -3
  70. package/src/tools/OpenapiViewer/context/PlaygroundContext.tsx +9 -3
  71. package/src/tools/OpenapiViewer/hooks/useOpenApiSchema.ts +3 -7
  72. package/src/tools/OpenapiViewer/index.tsx +3 -1
  73. package/src/tools/PrettyCode/PrettyCode.client.tsx +2 -0
  74. package/src/tools/PrettyCode/index.tsx +1 -0
  75. package/src/tools/VideoPlayer/VideoControls.tsx +4 -3
  76. package/src/tools/VideoPlayer/VideoPlayer.tsx +9 -8
@@ -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
 
@@ -1,18 +1,15 @@
1
1
  'use client';
2
2
 
3
- import React from 'react';
4
3
  import { usePathname } from 'next/navigation';
5
- import { cn } from '@djangocfg/ui-core/lib';
4
+ import React from 'react';
5
+
6
6
  import { useIsMobile } from '@djangocfg/ui-core/hooks';
7
+ import { cn } from '@djangocfg/ui-core/lib';
8
+
7
9
  import { useQueryParams } from '../hooks';
8
10
  import {
9
- Pagination,
10
- PaginationContent,
11
- PaginationEllipsis,
12
- PaginationItem,
13
- PaginationLink,
14
- PaginationNext,
15
- PaginationPrevious,
11
+ Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink,
12
+ PaginationNext, PaginationPrevious
16
13
  } from './pagination';
17
14
 
18
15
  interface SSRPaginationProps {
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { useMemo, useState, useEffect } from 'react';
3
+ import { useEffect, useMemo, useState } from 'react';
4
4
 
5
5
  // Safe defaults for SSR
6
6
  const defaultSelectors = {
@@ -1,7 +1,8 @@
1
1
  'use client';
2
2
 
3
3
  import type { RefObject } from 'react';
4
- import { useHotkeys, Options as HotkeysOptions } from 'react-hotkeys-hook';
4
+ import { Options as HotkeysOptions, useHotkeys } from 'react-hotkeys-hook';
5
+
5
6
  import type { HotkeyCallback, Keys } from 'react-hotkeys-hook';
6
7
 
7
8
  /**
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { useEffect, useState, useRef } from 'react';
3
+ import { useEffect, useRef, useState } from 'react';
4
4
 
5
5
  /**
6
6
  * Simple localStorage hook with better error handling
@@ -15,8 +15,8 @@
15
15
 
16
16
  'use client';
17
17
 
18
- import { useState, useEffect, useRef } from 'react';
19
18
  import { usePathname } from 'next/navigation';
19
+ import { useEffect, useRef, useState } from 'react';
20
20
 
21
21
  /**
22
22
  * Hook to safely access URL query parameters without useSearchParams()
@@ -9,6 +9,7 @@
9
9
  'use client';
10
10
 
11
11
  import React, { ReactNode } from 'react';
12
+
12
13
  import { cn } from '@djangocfg/ui-core/lib';
13
14
 
14
15
  interface ForceThemeProps {
@@ -22,6 +22,7 @@
22
22
  'use client';
23
23
 
24
24
  import { ThemeProvider as NextThemesProvider, useTheme as useNextTheme } from 'next-themes';
25
+
25
26
  import type { ThemeProviderProps as NextThemesProviderProps } from 'next-themes';
26
27
 
27
28
  // Re-export types
@@ -21,12 +21,14 @@
21
21
 
22
22
  'use client';
23
23
 
24
- import { useEffect, useState } from 'react';
25
24
  import { Moon, Sun } from 'lucide-react';
25
+ import { useEffect, useState } from 'react';
26
+
26
27
  import { Button } from '@djangocfg/ui-core/components';
27
28
  import { cn } from '@djangocfg/ui-core/lib';
28
- import { useThemeContext } from './ThemeProvider';
29
+
29
30
  import { useIsMobile } from '../hooks';
31
+ import { useThemeContext } from './ThemeProvider';
30
32
 
31
33
  export interface ThemeToggleProps {
32
34
  /** Custom className */
@@ -1,32 +1,23 @@
1
1
  'use client';
2
2
 
3
- import React, { useMemo, useCallback } from 'react';
3
+ import consola from 'consola';
4
+ import { AlertCircle } from 'lucide-react';
5
+ import React, { useCallback, useMemo } from 'react';
6
+
7
+ import { Alert, AlertDescription, Button } from '@djangocfg/ui-core/components';
4
8
  import Form from '@rjsf/core';
5
- import validator from '@rjsf/validator-ajv8';
6
9
  import { RegistryWidgetsType } from '@rjsf/utils';
7
- import { Button, Alert, AlertDescription } from '@djangocfg/ui-core/components';
8
- import { AlertCircle } from 'lucide-react';
9
- import consola from 'consola';
10
+ import validator from '@rjsf/validator-ajv8';
10
11
 
12
+ import {
13
+ ArrayFieldItemTemplate, ArrayFieldTemplate, BaseInputTemplate, ErrorListTemplate, FieldTemplate,
14
+ ObjectFieldTemplate
15
+ } from './templates';
11
16
  import { JsonSchemaFormProps } from './types';
17
+ import { normalizeFormData, validateSchema } from './utils';
12
18
  import {
13
- TextWidget,
14
- NumberWidget,
15
- CheckboxWidget,
16
- SelectWidget,
17
- SwitchWidget,
18
- ColorWidget,
19
- SliderWidget,
19
+ CheckboxWidget, ColorWidget, NumberWidget, SelectWidget, SliderWidget, SwitchWidget, TextWidget
20
20
  } from './widgets';
21
- import {
22
- FieldTemplate,
23
- ObjectFieldTemplate,
24
- ArrayFieldTemplate,
25
- ArrayFieldItemTemplate,
26
- ErrorListTemplate,
27
- BaseInputTemplate,
28
- } from './templates';
29
- import { validateSchema, normalizeFormData } from './utils';
30
21
 
31
22
  /**
32
23
  * JSON Schema Form Component
@@ -1,10 +1,14 @@
1
1
  'use client';
2
2
 
3
+ import consola from 'consola';
3
4
  import React, { useState } from 'react';
4
- import { JsonSchemaForm } from '../JsonSchemaForm';
5
- import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@djangocfg/ui-core/components';
5
+
6
+ import {
7
+ Card, CardContent, CardDescription, CardHeader, CardTitle
8
+ } from '@djangocfg/ui-core/components';
6
9
  import { RJSFSchema, UiSchema } from '@rjsf/utils';
7
- import consola from 'consola';
10
+
11
+ import { JsonSchemaForm } from '../JsonSchemaForm';
8
12
 
9
13
  /**
10
14
  * Example JSON Schema for Bot Configuration
@@ -1,10 +1,14 @@
1
1
  'use client';
2
2
 
3
+ import consola from 'consola';
3
4
  import React, { useState } from 'react';
4
- import { JsonSchemaForm } from '../JsonSchemaForm';
5
- import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@djangocfg/ui-core/components';
5
+
6
+ import {
7
+ Card, CardContent, CardDescription, CardHeader, CardTitle
8
+ } from '@djangocfg/ui-core/components';
6
9
  import { RJSFSchema } from '@rjsf/utils';
7
- import consola from 'consola';
10
+
11
+ import { JsonSchemaForm } from '../JsonSchemaForm';
8
12
 
9
13
  /**
10
14
  * Real Bot Config Schema from API
@@ -1,8 +1,9 @@
1
1
  "use client"
2
2
 
3
3
  import React from 'react';
4
- import { ArrayFieldItemTemplateProps, getTemplate, getUiOptions } from '@rjsf/utils';
4
+
5
5
  import { cn } from '@djangocfg/ui-core/lib';
6
+ import { ArrayFieldItemTemplateProps, getTemplate, getUiOptions } from '@rjsf/utils';
6
7
 
7
8
  /**
8
9
  * Array field item template for JSON Schema Form
@@ -1,9 +1,10 @@
1
1
  "use client"
2
2
 
3
+ import { Plus } from 'lucide-react';
3
4
  import React from 'react';
4
- import { ArrayFieldTemplateProps } from '@rjsf/utils';
5
+
5
6
  import { Button } from '@djangocfg/ui-core/components';
6
- import { Plus } from 'lucide-react';
7
+ import { ArrayFieldTemplateProps } from '@rjsf/utils';
7
8
 
8
9
  /**
9
10
  * Array field template for JSON Schema Form
@@ -1,8 +1,9 @@
1
1
  "use client"
2
2
 
3
- import React, { useCallback, useMemo, ChangeEvent, FocusEvent } from 'react';
4
- import { getInputProps, WidgetProps } from '@rjsf/utils';
3
+ import React, { ChangeEvent, FocusEvent, useCallback, useMemo } from 'react';
4
+
5
5
  import { Input } from '@djangocfg/ui-core/components';
6
+ import { getInputProps, WidgetProps } from '@rjsf/utils';
6
7
 
7
8
  /**
8
9
  * Base input template for JSON Schema Form
@@ -1,9 +1,10 @@
1
1
  "use client"
2
2
 
3
+ import { AlertCircle } from 'lucide-react';
3
4
  import React from 'react';
4
- import { ErrorListProps } from '@rjsf/utils';
5
+
5
6
  import { Alert, AlertDescription, AlertTitle } from '@djangocfg/ui-core/components';
6
- import { AlertCircle } from 'lucide-react';
7
+ import { ErrorListProps } from '@rjsf/utils';
7
8
 
8
9
  /**
9
10
  * Error list template for JSON Schema Form
@@ -1,9 +1,10 @@
1
1
  "use client"
2
2
 
3
3
  import React from 'react';
4
- import { FieldTemplateProps } from '@rjsf/utils';
4
+
5
5
  import { Label } from '@djangocfg/ui-core/components';
6
6
  import { cn } from '@djangocfg/ui-core/lib';
7
+ import { FieldTemplateProps } from '@rjsf/utils';
7
8
 
8
9
  /**
9
10
  * Field template for JSON Schema Form
@@ -1,14 +1,11 @@
1
1
  "use client"
2
2
 
3
+ import { ChevronDown } from 'lucide-react';
3
4
  import React, { useState } from 'react';
4
- import { ObjectFieldTemplateProps } from '@rjsf/utils';
5
+
6
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@djangocfg/ui-core/components';
5
7
  import { cn } from '@djangocfg/ui-core/lib';
6
- import {
7
- Collapsible,
8
- CollapsibleContent,
9
- CollapsibleTrigger,
10
- } from '@djangocfg/ui-core/components';
11
- import { ChevronDown } from 'lucide-react';
8
+ import { ObjectFieldTemplateProps } from '@rjsf/utils';
12
9
 
13
10
  /**
14
11
  * Object field template for JSON Schema Form
@@ -1,6 +1,7 @@
1
- import { RJSFSchema } from '@rjsf/utils';
2
1
  import consola from 'consola';
3
2
 
3
+ import { RJSFSchema } from '@rjsf/utils';
4
+
4
5
  /**
5
6
  * Utility functions for JSON Schema Form
6
7
  */
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
- import { WidgetProps } from '@rjsf/utils';
2
+
3
3
  import { Checkbox } from '@djangocfg/ui-core/components';
4
+ import { WidgetProps } from '@rjsf/utils';
4
5
 
5
6
  /**
6
7
  * Checkbox widget for JSON Schema Form
@@ -1,8 +1,9 @@
1
1
  "use client"
2
2
 
3
- import React, { useMemo, useCallback, useRef } from 'react';
4
- import { WidgetProps } from '@rjsf/utils';
3
+ import React, { useCallback, useMemo, useRef } from 'react';
4
+
5
5
  import { Input } from '@djangocfg/ui-core/components';
6
+ import { WidgetProps } from '@rjsf/utils';
6
7
 
7
8
  /**
8
9
  * Color input widget for JSON Schema Form