@djangocfg/ui-nextjs 1.4.45

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 (101) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +152 -0
  3. package/package.json +110 -0
  4. package/src/animations/AnimatedBackground.tsx +645 -0
  5. package/src/animations/index.ts +2 -0
  6. package/src/blocks/ArticleCard.tsx +94 -0
  7. package/src/blocks/ArticleList.tsx +95 -0
  8. package/src/blocks/CTASection.tsx +136 -0
  9. package/src/blocks/FeatureSection.tsx +104 -0
  10. package/src/blocks/Hero.tsx +102 -0
  11. package/src/blocks/NewsletterSection.tsx +119 -0
  12. package/src/blocks/StatsSection.tsx +103 -0
  13. package/src/blocks/SuperHero.tsx +328 -0
  14. package/src/blocks/TestimonialSection.tsx +122 -0
  15. package/src/blocks/index.ts +9 -0
  16. package/src/components/README.md +2018 -0
  17. package/src/components/breadcrumb-navigation.tsx +127 -0
  18. package/src/components/breadcrumb.tsx +132 -0
  19. package/src/components/button-download.tsx +275 -0
  20. package/src/components/dropdown-menu.tsx +219 -0
  21. package/src/components/index.ts +86 -0
  22. package/src/components/markdown/MarkdownMessage.tsx +338 -0
  23. package/src/components/markdown/index.ts +5 -0
  24. package/src/components/menubar.tsx +274 -0
  25. package/src/components/multi-select-pro/async.tsx +608 -0
  26. package/src/components/multi-select-pro/helpers.tsx +84 -0
  27. package/src/components/multi-select-pro/index.tsx +622 -0
  28. package/src/components/navigation-menu.tsx +153 -0
  29. package/src/components/pagination-static.tsx +348 -0
  30. package/src/components/pagination.tsx +138 -0
  31. package/src/components/phone-input.tsx +276 -0
  32. package/src/components/sidebar.tsx +866 -0
  33. package/src/components/sonner.tsx +31 -0
  34. package/src/components/ssr-pagination.tsx +237 -0
  35. package/src/hooks/index.ts +19 -0
  36. package/src/hooks/useCfgRouter.ts +153 -0
  37. package/src/hooks/useLocalStorage.ts +221 -0
  38. package/src/hooks/useQueryParams.ts +73 -0
  39. package/src/hooks/useSessionStorage.ts +188 -0
  40. package/src/hooks/useTheme.ts +57 -0
  41. package/src/index.ts +24 -0
  42. package/src/lib/index.ts +2 -0
  43. package/src/styles/index.css +2 -0
  44. package/src/theme/ForceTheme.tsx +115 -0
  45. package/src/theme/ThemeProvider.tsx +82 -0
  46. package/src/theme/ThemeToggle.tsx +52 -0
  47. package/src/theme/index.ts +3 -0
  48. package/src/tools/JsonForm/JsonSchemaForm.tsx +199 -0
  49. package/src/tools/JsonForm/examples/BotConfigExample.tsx +245 -0
  50. package/src/tools/JsonForm/examples/RealBotConfigExample.tsx +157 -0
  51. package/src/tools/JsonForm/index.ts +46 -0
  52. package/src/tools/JsonForm/templates/ArrayFieldItemTemplate.tsx +46 -0
  53. package/src/tools/JsonForm/templates/ArrayFieldTemplate.tsx +73 -0
  54. package/src/tools/JsonForm/templates/BaseInputTemplate.tsx +106 -0
  55. package/src/tools/JsonForm/templates/ErrorListTemplate.tsx +34 -0
  56. package/src/tools/JsonForm/templates/FieldTemplate.tsx +61 -0
  57. package/src/tools/JsonForm/templates/ObjectFieldTemplate.tsx +43 -0
  58. package/src/tools/JsonForm/templates/index.ts +12 -0
  59. package/src/tools/JsonForm/types.ts +83 -0
  60. package/src/tools/JsonForm/utils.ts +212 -0
  61. package/src/tools/JsonForm/widgets/CheckboxWidget.tsx +36 -0
  62. package/src/tools/JsonForm/widgets/NumberWidget.tsx +88 -0
  63. package/src/tools/JsonForm/widgets/SelectWidget.tsx +100 -0
  64. package/src/tools/JsonForm/widgets/SwitchWidget.tsx +34 -0
  65. package/src/tools/JsonForm/widgets/TextWidget.tsx +95 -0
  66. package/src/tools/JsonForm/widgets/index.ts +12 -0
  67. package/src/tools/JsonTree/index.tsx +252 -0
  68. package/src/tools/LottiePlayer/LottiePlayer.client.tsx +212 -0
  69. package/src/tools/LottiePlayer/index.tsx +54 -0
  70. package/src/tools/LottiePlayer/types.ts +108 -0
  71. package/src/tools/LottiePlayer/useLottie.ts +163 -0
  72. package/src/tools/Mermaid/Mermaid.client.tsx +341 -0
  73. package/src/tools/Mermaid/index.tsx +40 -0
  74. package/src/tools/OpenapiViewer/components/EndpointInfo.tsx +144 -0
  75. package/src/tools/OpenapiViewer/components/EndpointsLibrary.tsx +255 -0
  76. package/src/tools/OpenapiViewer/components/PlaygroundLayout.tsx +123 -0
  77. package/src/tools/OpenapiViewer/components/PlaygroundStepper.tsx +98 -0
  78. package/src/tools/OpenapiViewer/components/RequestBuilder.tsx +164 -0
  79. package/src/tools/OpenapiViewer/components/RequestParametersForm.tsx +253 -0
  80. package/src/tools/OpenapiViewer/components/ResponseViewer.tsx +169 -0
  81. package/src/tools/OpenapiViewer/components/VersionSelector.tsx +64 -0
  82. package/src/tools/OpenapiViewer/components/index.ts +14 -0
  83. package/src/tools/OpenapiViewer/constants.ts +39 -0
  84. package/src/tools/OpenapiViewer/context/PlaygroundContext.tsx +338 -0
  85. package/src/tools/OpenapiViewer/hooks/index.ts +8 -0
  86. package/src/tools/OpenapiViewer/hooks/useMobile.ts +10 -0
  87. package/src/tools/OpenapiViewer/hooks/useOpenApiSchema.ts +203 -0
  88. package/src/tools/OpenapiViewer/index.tsx +36 -0
  89. package/src/tools/OpenapiViewer/types.ts +152 -0
  90. package/src/tools/OpenapiViewer/utils/apiKeyManager.ts +149 -0
  91. package/src/tools/OpenapiViewer/utils/formatters.ts +71 -0
  92. package/src/tools/OpenapiViewer/utils/index.ts +9 -0
  93. package/src/tools/OpenapiViewer/utils/versionManager.ts +161 -0
  94. package/src/tools/PrettyCode/PrettyCode.client.tsx +217 -0
  95. package/src/tools/PrettyCode/index.tsx +43 -0
  96. package/src/tools/VideoPlayer/README.md +239 -0
  97. package/src/tools/VideoPlayer/VideoControls.tsx +138 -0
  98. package/src/tools/VideoPlayer/VideoPlayer.tsx +230 -0
  99. package/src/tools/VideoPlayer/index.ts +9 -0
  100. package/src/tools/VideoPlayer/types.ts +62 -0
  101. package/src/tools/index.ts +43 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Reforms.ai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,152 @@
1
+ # @djangocfg/ui-nextjs
2
+
3
+ Next.js UI library extending `@djangocfg/ui-core` with 70+ components built on Radix UI + Tailwind CSS v4.
4
+
5
+ **Part of [DjangoCFG](https://djangocfg.com)** — modern Django framework for production-ready SaaS applications.
6
+
7
+ **[Live Demo & Props](https://djangocfg.com/demo/ui/)**
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ pnpm add @djangocfg/ui-nextjs
13
+ ```
14
+
15
+ ## Architecture
16
+
17
+ ```
18
+ @djangocfg/ui-nextjs
19
+ ├── Re-exports everything from @djangocfg/ui-core (61 components, 10 hooks)
20
+ ├── + Next.js specific components (10)
21
+ ├── + Browser storage hooks (5)
22
+ ├── + Blocks, Tools, Theme, Animations
23
+ ```
24
+
25
+ | Package | Use Case |
26
+ |---------|----------|
27
+ | `@djangocfg/ui-core` | Electron, Vite, CRA, any React app |
28
+ | `@djangocfg/ui-nextjs` | Next.js apps (includes ui-core + extras) |
29
+
30
+ ## Components
31
+
32
+ ### From ui-core (61)
33
+ All components from `@djangocfg/ui-core` are re-exported.
34
+
35
+ ### Next.js Specific (10)
36
+
37
+ | Component | Why Next.js |
38
+ |-----------|-------------|
39
+ | `Sidebar` | Uses `next/link` for navigation |
40
+ | `Breadcrumb` | Uses `next/link` |
41
+ | `BreadcrumbNavigation` | Uses `next/link` |
42
+ | `NavigationMenu` | Uses `next/link` |
43
+ | `Menubar` | Uses `next/link` |
44
+ | `DropdownMenu` | Uses `next/link` |
45
+ | `Pagination` | Uses `next/link` |
46
+ | `SSRPagination` | Uses `next/link` + server components |
47
+ | `DownloadButton` | Uses `localStorage` for auth |
48
+ | `SonnerToaster` | Sonner toast integration |
49
+
50
+ ### MultiSelect Pro
51
+ `MultiSelectPro` `MultiSelectProAsync` — Advanced multi-select with async loading
52
+
53
+ ### Blocks (7)
54
+ `Hero` `SuperHero` `FeatureSection` `CTASection` `NewsletterSection` `StatsSection` `TestimonialSection`
55
+
56
+ ```tsx
57
+ import { Hero } from '@djangocfg/ui-nextjs/blocks';
58
+ ```
59
+
60
+ ### Tools (4)
61
+ `JsonTree` `PrettyCode` `Mermaid` `LottiePlayer`
62
+
63
+ ```tsx
64
+ import { PrettyCode } from '@djangocfg/ui-nextjs/tools';
65
+ ```
66
+
67
+ ## Hooks
68
+
69
+ ### From ui-core (10)
70
+ `useMediaQuery` `useIsMobile` `useCopy` `useCountdown` `useDebounce` `useDebouncedCallback` `useImageLoader` `useToast` `useEventListener` `useDebugTools`
71
+
72
+ ### Next.js/Browser Specific (5)
73
+
74
+ | Hook | Description |
75
+ |------|-------------|
76
+ | `useLocalStorage` | Persistent state in localStorage |
77
+ | `useSessionStorage` | Session-scoped state |
78
+ | `useTheme` | Light/dark theme (next-themes) |
79
+ | `useQueryParams` | URL query params (next/router) |
80
+ | `useCfgRouter` | Enhanced Next.js router |
81
+
82
+ ## Usage
83
+
84
+ ```tsx
85
+ import {
86
+ Button, Card, Input, // from ui-core
87
+ Sidebar, useLocalStorage // Next.js specific
88
+ } from '@djangocfg/ui-nextjs';
89
+
90
+ function Example() {
91
+ const [saved, setSaved] = useLocalStorage('form', null);
92
+
93
+ return (
94
+ <Sidebar>
95
+ <Card>
96
+ <Input placeholder="Email" />
97
+ <Button>Submit</Button>
98
+ </Card>
99
+ </Sidebar>
100
+ );
101
+ }
102
+ ```
103
+
104
+ ## Styling
105
+
106
+ ```tsx
107
+ // Import global styles
108
+ import '@djangocfg/ui-nextjs/styles/globals';
109
+ ```
110
+
111
+ ## Exports
112
+
113
+ | Path | Content |
114
+ |------|---------|
115
+ | `@djangocfg/ui-nextjs` | All components & hooks |
116
+ | `@djangocfg/ui-nextjs/components` | Components only |
117
+ | `@djangocfg/ui-nextjs/hooks` | Hooks only |
118
+ | `@djangocfg/ui-nextjs/blocks` | Landing page blocks |
119
+ | `@djangocfg/ui-nextjs/tools` | JsonTree, Mermaid, etc. |
120
+ | `@djangocfg/ui-nextjs/theme` | ThemeProvider, ThemeToggle |
121
+ | `@djangocfg/ui-nextjs/styles` | CSS |
122
+
123
+ ## Theme
124
+
125
+ ```tsx
126
+ import { ThemeProvider, ThemeToggle } from '@djangocfg/ui-nextjs/theme';
127
+
128
+ function App({ children }) {
129
+ return (
130
+ <ThemeProvider>
131
+ {children}
132
+ <ThemeToggle />
133
+ </ThemeProvider>
134
+ );
135
+ }
136
+ ```
137
+
138
+ ## Tailwind v4 Notes
139
+
140
+ - Arbitrary values (`h-[80px]`) may not work — use inline styles
141
+ - Opacity modifiers (`bg-background/80`) broken with HSL — use inline styles
142
+ - Define spacing/z-index in `@theme` block
143
+
144
+ ## Requirements
145
+
146
+ - Next.js >= 15
147
+ - React >= 19
148
+ - Tailwind CSS >= 4
149
+
150
+ ---
151
+
152
+ **[Full documentation & examples](https://djangocfg.com/demo/ui/)**
package/package.json ADDED
@@ -0,0 +1,110 @@
1
+ {
2
+ "name": "@djangocfg/ui-nextjs",
3
+ "version": "1.4.45",
4
+ "description": "Next.js UI component library with Radix UI primitives, Tailwind CSS styling, charts, and form components",
5
+ "keywords": [
6
+ "ui-components",
7
+ "react",
8
+ "radix-ui",
9
+ "tailwindcss",
10
+ "design-system",
11
+ "component-library",
12
+ "typescript",
13
+ "nextjs",
14
+ "django",
15
+ "shadcn",
16
+ "charts",
17
+ "forms"
18
+ ],
19
+ "author": {
20
+ "name": "DjangoCFG",
21
+ "url": "https://djangocfg.com"
22
+ },
23
+ "homepage": "https://djangocfg.com",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/markolofsen/django-cfg.git",
27
+ "directory": "packages/ui"
28
+ },
29
+ "bugs": {
30
+ "url": "https://github.com/markolofsen/django-cfg/issues"
31
+ },
32
+ "license": "MIT",
33
+ "main": "./src/index.ts",
34
+ "types": "./src/index.ts",
35
+ "exports": {
36
+ ".": "./src/index.ts",
37
+ "./components": "./src/components/index.ts",
38
+ "./hooks": "./src/hooks/index.ts",
39
+ "./layouts": "./src/layouts/index.ts",
40
+ "./blocks": "./src/blocks/index.ts",
41
+ "./lib": "./src/lib/index.ts",
42
+ "./tools": "./src/tools/index.ts",
43
+ "./animations": "./src/animations/index.ts",
44
+ "./theme": "./src/theme/index.ts",
45
+ "./types": "./src/types/index.ts",
46
+ "./types/*": "./src/types/*",
47
+ "./global": "./src/global.d.ts",
48
+ "./styles": "./src/styles/index.css"
49
+ },
50
+ "files": [
51
+ "src",
52
+ "tailwind.config.js",
53
+ "README.md",
54
+ "LICENSE"
55
+ ],
56
+ "scripts": {
57
+ "lint": "eslint .",
58
+ "check": "tsc --noEmit"
59
+ },
60
+ "peerDependencies": {
61
+ "@djangocfg/api": "^1.4.45",
62
+ "lucide-react": "^0.545.0",
63
+ "moment": "^2.30.1",
64
+ "next": "^15.5.7",
65
+ "react": "^19.2.0",
66
+ "react-dom": "^19.2.0",
67
+ "react-hook-form": "7.65.0",
68
+ "tailwindcss": "^4.1.14",
69
+ "zod": "^4.1.13",
70
+ "consola": "^3.4.2"
71
+ },
72
+ "dependencies": {
73
+ "@djangocfg/ui-core": "^1.0.1",
74
+ "@radix-ui/react-dropdown-menu": "^2.1.16",
75
+ "@radix-ui/react-menubar": "^1.1.16",
76
+ "@radix-ui/react-navigation-menu": "^1.2.14",
77
+ "@rjsf/core": "^6.1.2",
78
+ "@rjsf/utils": "^6.1.2",
79
+ "@rjsf/validator-ajv8": "^6.1.2",
80
+ "@web3icons/react": "^4.0.26",
81
+ "chart.js": "^4.5.0",
82
+ "cytoscape": "^3.33.1",
83
+ "cytoscape-cose-bilkent": "^4.1.0",
84
+ "mermaid": "^11.12.0",
85
+ "next-themes": "^0.4.6",
86
+ "prism-react-renderer": "^2.4.1",
87
+ "react-chartjs-2": "^5.3.0",
88
+ "react-json-tree": "^0.20.0",
89
+ "react-lottie-player": "^2.1.0",
90
+ "react-markdown": "10.1.0",
91
+ "remark-gfm": "4.0.1",
92
+ "react-sticky-box": "^2.0.5",
93
+ "recharts": "2.15.4",
94
+ "@vidstack/react": "next",
95
+ "media-icons": "next",
96
+ "vidstack": "next"
97
+ },
98
+ "devDependencies": {
99
+ "@djangocfg/typescript-config": "^1.4.45",
100
+ "@types/node": "^24.7.2",
101
+ "@types/react": "19.2.2",
102
+ "@types/react-dom": "19.2.1",
103
+ "eslint": "^9.37.0",
104
+ "tailwindcss-animate": "1.0.7",
105
+ "typescript": "^5.9.3"
106
+ },
107
+ "publishConfig": {
108
+ "access": "public"
109
+ }
110
+ }