create-nextjs-cms 0.8.0 → 0.8.1
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 +3 -3
- package/templates/default/components/SectionIcon.tsx +8 -0
- package/templates/default/components/SidebarDropdownItem.tsx +6 -3
- package/templates/default/components/SidebarItem.tsx +5 -1
- package/templates/default/components/form/helpers/_section-hot-reload.js +1 -1
- package/templates/default/package.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-nextjs-cms",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"tsx": "^4.20.6",
|
|
30
30
|
"typescript": "^5.9.2",
|
|
31
31
|
"@lzcms/eslint-config": "0.3.0",
|
|
32
|
-
"@lzcms/
|
|
33
|
-
"@lzcms/
|
|
32
|
+
"@lzcms/prettier-config": "0.1.0",
|
|
33
|
+
"@lzcms/tsconfig": "0.1.0"
|
|
34
34
|
},
|
|
35
35
|
"prettier": "@lzcms/prettier-config",
|
|
36
36
|
"scripts": {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import {DynamicIcon} from 'lucide-react/dynamic'
|
|
4
|
+
import type { IconName } from 'lucide-react/dynamic'
|
|
5
|
+
|
|
6
|
+
export default function SectionIcon({ name, className }: { name: string; className?: string }) {
|
|
7
|
+
return <DynamicIcon name={name as IconName} className={className} />
|
|
8
|
+
}
|
|
@@ -3,8 +3,9 @@ import classNames from 'classnames'
|
|
|
3
3
|
import { useState } from 'react'
|
|
4
4
|
import { SidebarItemProps } from 'nextjs-cms/core/types'
|
|
5
5
|
import { useAutoAnimate } from '@formkit/auto-animate/react'
|
|
6
|
-
import { ChevronDownIcon, ChevronUpIcon, FolderIcon,
|
|
6
|
+
import { ChevronDownIcon, ChevronUpIcon, FolderIcon, PlusIcon } from 'lucide-react'
|
|
7
7
|
import { useI18n } from 'nextjs-cms/translations/client'
|
|
8
|
+
import SectionIcon from '@/components/SectionIcon'
|
|
8
9
|
|
|
9
10
|
export default function SidebarDropdownItem({ item, closeSideBar }: SidebarItemProps) {
|
|
10
11
|
const t = useI18n()
|
|
@@ -22,8 +23,10 @@ export default function SidebarDropdownItem({ item, closeSideBar }: SidebarItemP
|
|
|
22
23
|
onClick={() => setOpen((prev) => !prev)}
|
|
23
24
|
>
|
|
24
25
|
<li className='relative flex w-full items-center justify-between gap-2'>
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
<span className='flex items-center gap-2 text-start'>
|
|
27
|
+
{item.icon && <SectionIcon name={item.icon} className='size-4' />}
|
|
28
|
+
<span>{item.title}</span>
|
|
29
|
+
</span>
|
|
27
30
|
<span>
|
|
28
31
|
{open ? (
|
|
29
32
|
<ChevronUpIcon className='h-5 w-5' />
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Link from 'next/link'
|
|
2
2
|
import classNames from 'classnames'
|
|
3
3
|
import { SidebarItemProps } from 'nextjs-cms/core/types'
|
|
4
|
+
import SectionIcon from '@/components/SectionIcon'
|
|
4
5
|
|
|
5
6
|
export default function SidebarItem({ item, closeSideBar }: SidebarItemProps) {
|
|
6
7
|
return (
|
|
@@ -14,7 +15,10 @@ export default function SidebarItem({ item, closeSideBar }: SidebarItemProps) {
|
|
|
14
15
|
'text-start': true, // RTL support
|
|
15
16
|
})}
|
|
16
17
|
>
|
|
17
|
-
<span>
|
|
18
|
+
<span className='flex items-center gap-2'>
|
|
19
|
+
{item.icon && <SectionIcon name={item.icon} className='size-4' />}
|
|
20
|
+
<span>{item.title}</span>
|
|
21
|
+
</span>
|
|
18
22
|
</Link>
|
|
19
23
|
)
|
|
20
24
|
}
|