@morphika/andami 0.1.2
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/LICENSE +21 -0
- package/README.md +50 -0
- package/admin/assets.ts +4 -0
- package/admin/database.ts +4 -0
- package/admin/index.ts +6 -0
- package/admin/login.ts +4 -0
- package/admin/navigation.ts +4 -0
- package/admin/pages-editor.ts +4 -0
- package/admin/pages.ts +4 -0
- package/admin/projects-editor.ts +4 -0
- package/admin/projects.ts +4 -0
- package/admin/settings.ts +4 -0
- package/admin/setup.ts +4 -0
- package/admin/storage.ts +4 -0
- package/admin/styles.ts +4 -0
- package/app/(site)/[slug]/loading.tsx +20 -0
- package/app/(site)/[slug]/page.tsx +83 -0
- package/app/(site)/error.tsx +32 -0
- package/app/(site)/layout.tsx +53 -0
- package/app/(site)/loading.tsx +20 -0
- package/app/(site)/not-found.tsx +41 -0
- package/app/(site)/page.tsx +43 -0
- package/app/(site)/preview/page.tsx +99 -0
- package/app/(site)/work/[slug]/loading.tsx +23 -0
- package/app/(site)/work/[slug]/page.tsx +84 -0
- package/app/admin/assets/page.tsx +573 -0
- package/app/admin/database/page.tsx +302 -0
- package/app/admin/error.tsx +53 -0
- package/app/admin/layout.tsx +273 -0
- package/app/admin/login/page.tsx +88 -0
- package/app/admin/navigation/page.tsx +157 -0
- package/app/admin/page.tsx +17 -0
- package/app/admin/pages/[slug]/page.tsx +849 -0
- package/app/admin/pages/page.tsx +588 -0
- package/app/admin/projects/[slug]/page.tsx +3 -0
- package/app/admin/projects/page.tsx +669 -0
- package/app/admin/settings/page.tsx +132 -0
- package/app/admin/setup/page.tsx +64 -0
- package/app/admin/storage/page.tsx +518 -0
- package/app/admin/styles/page.tsx +243 -0
- package/app/api/admin/assets/file/route.ts +81 -0
- package/app/api/admin/assets/health/route.ts +170 -0
- package/app/api/admin/assets/register/route.ts +163 -0
- package/app/api/admin/assets/registry/route.ts +98 -0
- package/app/api/admin/assets/relink/confirm/route.ts +242 -0
- package/app/api/admin/assets/relink/route.ts +202 -0
- package/app/api/admin/assets/scan/route.ts +271 -0
- package/app/api/admin/auth/route.ts +160 -0
- package/app/api/admin/custom-sections/[slug]/route.ts +159 -0
- package/app/api/admin/custom-sections/route.ts +127 -0
- package/app/api/admin/database/route.ts +53 -0
- package/app/api/admin/pages/[slug]/duplicate/route.ts +91 -0
- package/app/api/admin/pages/[slug]/route.ts +617 -0
- package/app/api/admin/pages/[slug]/set-home/route.ts +76 -0
- package/app/api/admin/pages/route.ts +129 -0
- package/app/api/admin/preview/route.ts +53 -0
- package/app/api/admin/r2/connect/route.ts +181 -0
- package/app/api/admin/r2/delete/route.ts +198 -0
- package/app/api/admin/r2/disconnect/route.ts +42 -0
- package/app/api/admin/r2/rename/route.ts +265 -0
- package/app/api/admin/r2/status/route.ts +106 -0
- package/app/api/admin/r2/upload-url/route.ts +148 -0
- package/app/api/admin/revalidate/route.ts +55 -0
- package/app/api/admin/settings/route.ts +279 -0
- package/app/api/admin/setup/complete/route.ts +51 -0
- package/app/api/admin/setup/route.ts +118 -0
- package/app/api/admin/storage/switch/route.ts +117 -0
- package/app/api/admin/styles/fonts/route.ts +97 -0
- package/app/api/admin/styles/route.ts +304 -0
- package/app/api/assets/[...path]/route.ts +98 -0
- package/app/api/custom-sections/[id]/route.ts +43 -0
- package/app/api/draft-mode/disable/route.ts +10 -0
- package/app/api/draft-mode/enable/route.ts +26 -0
- package/app/api/projects/route.ts +42 -0
- package/app/api/styles/route.ts +88 -0
- package/app/favicon.ico +0 -0
- package/app/globals.css +7 -0
- package/app/layout.tsx +53 -0
- package/app/robots.ts +17 -0
- package/app/sitemap.ts +48 -0
- package/app/studio/[[...index]]/page.tsx +8 -0
- package/components/admin/MetadataEditor.tsx +173 -0
- package/components/admin/PublishToggle.tsx +130 -0
- package/components/admin/icons.tsx +40 -0
- package/components/admin/nav-builder/NavBuilder.tsx +182 -0
- package/components/admin/nav-builder/NavBuilderGrid.tsx +326 -0
- package/components/admin/nav-builder/NavGeneralSettings.tsx +275 -0
- package/components/admin/nav-builder/NavGridCell.tsx +48 -0
- package/components/admin/nav-builder/NavGridItem.tsx +189 -0
- package/components/admin/nav-builder/NavItemSettings.tsx +288 -0
- package/components/admin/nav-builder/NavItemTypePicker.tsx +102 -0
- package/components/admin/nav-builder/NavLivePreview.tsx +125 -0
- package/components/admin/nav-builder/NavSettingsFields.tsx +248 -0
- package/components/admin/nav-builder/NavSettingsPanel.tsx +127 -0
- package/components/admin/nav-builder/index.ts +10 -0
- package/components/admin/nav-builder/nav-builder-utils.ts +238 -0
- package/components/admin/setup-wizard/BrandingStep.tsx +218 -0
- package/components/admin/setup-wizard/DatabaseStep.tsx +331 -0
- package/components/admin/setup-wizard/DoneStep.tsx +187 -0
- package/components/admin/setup-wizard/SetupWizard.tsx +166 -0
- package/components/admin/setup-wizard/StorageStep.tsx +308 -0
- package/components/admin/setup-wizard/WelcomeStep.tsx +96 -0
- package/components/admin/setup-wizard/index.ts +9 -0
- package/components/admin/styles/ColorsEditor.tsx +214 -0
- package/components/admin/styles/FontsEditor.tsx +258 -0
- package/components/admin/styles/GridLayoutEditor.tsx +292 -0
- package/components/admin/styles/LinksButtonsEditor.tsx +120 -0
- package/components/admin/styles/TypographyEditor.tsx +266 -0
- package/components/admin/styles/index.ts +9 -0
- package/components/admin/styles/shared.tsx +68 -0
- package/components/blocks/BlockRenderer.tsx +404 -0
- package/components/blocks/ButtonBlockRenderer.tsx +52 -0
- package/components/blocks/CoverBlockRenderer.tsx +239 -0
- package/components/blocks/CustomSectionInstanceRenderer.tsx +82 -0
- package/components/blocks/EnterAnimationWrapper.tsx +140 -0
- package/components/blocks/HoverAnimationWrapper.tsx +308 -0
- package/components/blocks/ImageBlockRenderer.tsx +61 -0
- package/components/blocks/ImageGridBlockRenderer.tsx +545 -0
- package/components/blocks/PageBackground.tsx +28 -0
- package/components/blocks/PageNavAnimation.tsx +35 -0
- package/components/blocks/PageNavColor.tsx +24 -0
- package/components/blocks/PageRenderer.tsx +142 -0
- package/components/blocks/ParallaxGroupRenderer.tsx +448 -0
- package/components/blocks/ParallaxSlideRenderer.tsx +175 -0
- package/components/blocks/ProjectGridBlockRenderer.tsx +556 -0
- package/components/blocks/SectionRenderer.tsx +170 -0
- package/components/blocks/SectionV2Renderer.tsx +330 -0
- package/components/blocks/ShaderCanvas.tsx +392 -0
- package/components/blocks/SpacerBlockRenderer.tsx +17 -0
- package/components/blocks/TextBlockRenderer.tsx +87 -0
- package/components/blocks/TypewriterRichText.tsx +464 -0
- package/components/blocks/TypewriterWrapper.tsx +149 -0
- package/components/blocks/VideoBlockRenderer.tsx +304 -0
- package/components/blocks/index.ts +2 -0
- package/components/builder/AssetBrowser.tsx +2 -0
- package/components/builder/BlockLivePreview.tsx +101 -0
- package/components/builder/BlockTypePicker.tsx +178 -0
- package/components/builder/BuilderCanvas.tsx +354 -0
- package/components/builder/CanvasMinimap.tsx +200 -0
- package/components/builder/CanvasToolbar.tsx +202 -0
- package/components/builder/ColorPicker.tsx +243 -0
- package/components/builder/ColorSwatchPicker.tsx +274 -0
- package/components/builder/ColumnDragContext.tsx +51 -0
- package/components/builder/ColumnDragOverlay.tsx +110 -0
- package/components/builder/CustomSectionInstanceCard.tsx +97 -0
- package/components/builder/DeviceFrame.tsx +123 -0
- package/components/builder/DndWrapper.tsx +337 -0
- package/components/builder/InsertionLines.tsx +186 -0
- package/components/builder/ParallaxGroupCanvas.tsx +228 -0
- package/components/builder/ParallaxSlideHeader.tsx +113 -0
- package/components/builder/ReadOnlyFrame.tsx +417 -0
- package/components/builder/SectionEditorBar.tsx +288 -0
- package/components/builder/SectionTypePicker.tsx +422 -0
- package/components/builder/SectionV2Canvas.tsx +297 -0
- package/components/builder/SectionV2Column.tsx +488 -0
- package/components/builder/SettingsPanel.tsx +911 -0
- package/components/builder/SortableBlock.tsx +230 -0
- package/components/builder/SortableRow.tsx +362 -0
- package/components/builder/VirtualAssetGrid.tsx +397 -0
- package/components/builder/asset-browser/AssetBrowser.tsx +178 -0
- package/components/builder/asset-browser/FileLightbox.tsx +116 -0
- package/components/builder/asset-browser/FolderTreeItem.tsx +55 -0
- package/components/builder/asset-browser/R2BrowserContent.tsx +436 -0
- package/components/builder/asset-browser/R2ContextMenu.tsx +98 -0
- package/components/builder/asset-browser/VideoThumbnail.tsx +63 -0
- package/components/builder/asset-browser/helpers.ts +88 -0
- package/components/builder/asset-browser/index.ts +1 -0
- package/components/builder/asset-browser/types.ts +49 -0
- package/components/builder/asset-browser/useAssetBrowser.ts +344 -0
- package/components/builder/asset-browser/useR2DragDrop.ts +116 -0
- package/components/builder/asset-browser/useR2Operations.ts +189 -0
- package/components/builder/blockStyles.tsx +295 -0
- package/components/builder/editors/ButtonBlockEditor.tsx +184 -0
- package/components/builder/editors/CoverBlockEditor.tsx +488 -0
- package/components/builder/editors/EnterAnimationPicker.tsx +297 -0
- package/components/builder/editors/HoverEffectPicker.tsx +209 -0
- package/components/builder/editors/ImageBlockEditor.tsx +206 -0
- package/components/builder/editors/ImageGridBlockEditor.tsx +386 -0
- package/components/builder/editors/ProjectGridEditor.tsx +648 -0
- package/components/builder/editors/SpacerBlockEditor.tsx +167 -0
- package/components/builder/editors/StaggerSettings.tsx +108 -0
- package/components/builder/editors/TextAlignmentIcons.tsx +39 -0
- package/components/builder/editors/TextBlockEditor.tsx +462 -0
- package/components/builder/editors/TextStylePicker.tsx +183 -0
- package/components/builder/editors/VideoBlockEditor.tsx +278 -0
- package/components/builder/editors/index.ts +10 -0
- package/components/builder/editors/shared.tsx +345 -0
- package/components/builder/hooks/useColumnDrag.ts +472 -0
- package/components/builder/hooks/useColumnResize.ts +221 -0
- package/components/builder/index.ts +12 -0
- package/components/builder/live-preview/LiveButtonPreview.tsx +38 -0
- package/components/builder/live-preview/LiveCoverPreview.tsx +146 -0
- package/components/builder/live-preview/LiveImageGridPreview.tsx +123 -0
- package/components/builder/live-preview/LiveImagePreview.tsx +107 -0
- package/components/builder/live-preview/LiveProjectGridPreview.tsx +1010 -0
- package/components/builder/live-preview/LiveSpacerPreview.tsx +9 -0
- package/components/builder/live-preview/LiveTextEditor.tsx +198 -0
- package/components/builder/live-preview/LiveVideoPreview.tsx +98 -0
- package/components/builder/live-preview/index.ts +10 -0
- package/components/builder/live-preview/shared.tsx +153 -0
- package/components/builder/settings-panel/BlockLayoutTab.tsx +532 -0
- package/components/builder/settings-panel/BlockSettings.tsx +94 -0
- package/components/builder/settings-panel/ColumnV2Settings.tsx +160 -0
- package/components/builder/settings-panel/LayoutTab.tsx +310 -0
- package/components/builder/settings-panel/PageSettings.tsx +200 -0
- package/components/builder/settings-panel/ParallaxGroupSettings.tsx +118 -0
- package/components/builder/settings-panel/ParallaxSlideSettings.tsx +178 -0
- package/components/builder/settings-panel/SectionV2AnimationTab.tsx +103 -0
- package/components/builder/settings-panel/SectionV2LayoutTab.tsx +312 -0
- package/components/builder/settings-panel/SectionV2Settings.tsx +323 -0
- package/components/builder/settings-panel/TRBLInputs.tsx +51 -0
- package/components/builder/settings-panel/index.ts +19 -0
- package/components/builder/settings-panel/responsive-helpers.ts +524 -0
- package/components/ui/CustomCursor.tsx +118 -0
- package/components/ui/NavContentLightbox.tsx +152 -0
- package/components/ui/Navbar.tsx +582 -0
- package/components/ui/PortfolioTracker.tsx +87 -0
- package/components/ui/ScrollToTop.tsx +47 -0
- package/lib/animation/enter-presets.ts +147 -0
- package/lib/animation/enter-resolve.ts +90 -0
- package/lib/animation/enter-types.ts +128 -0
- package/lib/animation/hover-effect-presets.ts +210 -0
- package/lib/animation/hover-effect-types.ts +126 -0
- package/lib/asset-retry.ts +111 -0
- package/lib/assets.ts +92 -0
- package/lib/audit.ts +35 -0
- package/lib/auth-token.ts +94 -0
- package/lib/auth.ts +13 -0
- package/lib/builder/cascade-helpers.ts +51 -0
- package/lib/builder/cascade.ts +533 -0
- package/lib/builder/constants.ts +103 -0
- package/lib/builder/defaults.ts +182 -0
- package/lib/builder/history.ts +48 -0
- package/lib/builder/index.ts +21 -0
- package/lib/builder/layout-styles.ts +344 -0
- package/lib/builder/masonry.ts +166 -0
- package/lib/builder/responsive.ts +156 -0
- package/lib/builder/serializer.ts +845 -0
- package/lib/builder/store-blocks.ts +193 -0
- package/lib/builder/store-canvas.ts +319 -0
- package/lib/builder/store-helpers.ts +490 -0
- package/lib/builder/store-sections.ts +709 -0
- package/lib/builder/store.ts +333 -0
- package/lib/builder/templates.ts +297 -0
- package/lib/builder/types.ts +374 -0
- package/lib/builder/utils.ts +37 -0
- package/lib/color-utils.ts +116 -0
- package/lib/config/index.ts +57 -0
- package/lib/config/types.ts +122 -0
- package/lib/contexts/AssetContext.tsx +79 -0
- package/lib/contexts/NavAnimationContext.tsx +44 -0
- package/lib/contexts/NavColorContext.tsx +38 -0
- package/lib/contexts/PageExitContext.tsx +194 -0
- package/lib/contexts/ThumbStatusContext.tsx +83 -0
- package/lib/csrf-client.ts +34 -0
- package/lib/csrf.ts +68 -0
- package/lib/format-utils.ts +24 -0
- package/lib/hooks/useViewport.ts +42 -0
- package/lib/logger.ts +81 -0
- package/lib/revalidate.ts +23 -0
- package/lib/sanitize.ts +91 -0
- package/lib/sanity/client.ts +8 -0
- package/lib/sanity/queries.ts +486 -0
- package/lib/sanity/types.ts +869 -0
- package/lib/sanity/writeClient.ts +24 -0
- package/lib/security.ts +402 -0
- package/lib/setup/detect.ts +156 -0
- package/lib/shader/glsl/index.ts +27 -0
- package/lib/shader/glsl/pixelate.ts +51 -0
- package/lib/shader/glsl/rgb-shift.ts +45 -0
- package/lib/shader/glsl/ripple.ts +46 -0
- package/lib/shader/glsl/vertex.ts +14 -0
- package/lib/storage/index.ts +211 -0
- package/lib/storage/r2-adapter.ts +286 -0
- package/lib/storage/types.ts +125 -0
- package/lib/styles/provider.tsx +267 -0
- package/lib/thumbnails/generate.ts +151 -0
- package/lib/utils.ts +6 -0
- package/package.json +212 -0
- package/sanity/compose.ts +65 -0
- package/sanity/sanity.config.ts +126 -0
- package/sanity/schemas/assetRegistry.ts +301 -0
- package/sanity/schemas/blocks/blockLayout.ts +90 -0
- package/sanity/schemas/blocks/buttonBlock.ts +82 -0
- package/sanity/schemas/blocks/coverBlock.ts +229 -0
- package/sanity/schemas/blocks/imageBlock.ts +58 -0
- package/sanity/schemas/blocks/imageGridBlock.ts +112 -0
- package/sanity/schemas/blocks/index.ts +9 -0
- package/sanity/schemas/blocks/projectGridBlock.ts +251 -0
- package/sanity/schemas/blocks/spacerBlock.ts +41 -0
- package/sanity/schemas/blocks/textBlock.ts +139 -0
- package/sanity/schemas/blocks/videoBlock.ts +80 -0
- package/sanity/schemas/customSection.ts +69 -0
- package/sanity/schemas/customSectionInstance.ts +163 -0
- package/sanity/schemas/index.ts +111 -0
- package/sanity/schemas/objects/enterAnimationConfig.ts +72 -0
- package/sanity/schemas/objects/hoverEffectConfig.ts +90 -0
- package/sanity/schemas/objects/parallaxGroup.ts +66 -0
- package/sanity/schemas/objects/parallaxSlide.ts +217 -0
- package/sanity/schemas/objects/typewriterConfig.ts +38 -0
- package/sanity/schemas/page.ts +162 -0
- package/sanity/schemas/pageSection.ts +157 -0
- package/sanity/schemas/pageSectionV2.ts +269 -0
- package/sanity/schemas/siteSettings.ts +256 -0
- package/sanity/schemas/siteStyles.ts +212 -0
- package/site/error.ts +4 -0
- package/site/index.ts +8 -0
- package/site/not-found.ts +4 -0
- package/site/page.ts +4 -0
- package/site/preview.ts +4 -0
- package/site/robots.ts +4 -0
- package/site/sitemap.ts +4 -0
- package/site/work.ts +4 -0
- package/studio/index.ts +4 -0
- package/styles/admin.css +85 -0
- package/styles/animations.css +237 -0
- package/styles/base.css +148 -0
- package/styles/globals.css +10 -0
- package/tsconfig.json +25 -0
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useState, useCallback, useRef } from "react";
|
|
4
|
+
import {
|
|
5
|
+
DndContext,
|
|
6
|
+
DragOverlay,
|
|
7
|
+
PointerSensor,
|
|
8
|
+
useSensor,
|
|
9
|
+
useSensors,
|
|
10
|
+
closestCenter,
|
|
11
|
+
type DragStartEvent,
|
|
12
|
+
type DragEndEvent,
|
|
13
|
+
} from "@dnd-kit/core";
|
|
14
|
+
import { useSortable } from "@dnd-kit/sortable";
|
|
15
|
+
import type { NavItem } from "../../../lib/sanity/types";
|
|
16
|
+
import {
|
|
17
|
+
TOTAL_COLUMNS,
|
|
18
|
+
getOccupiedColumns,
|
|
19
|
+
getMaxSpan,
|
|
20
|
+
canPlace,
|
|
21
|
+
} from "./nav-builder-utils";
|
|
22
|
+
import NavGridCell from "./NavGridCell";
|
|
23
|
+
import NavGridItem from "./NavGridItem";
|
|
24
|
+
import NavItemTypePicker from "./NavItemTypePicker";
|
|
25
|
+
|
|
26
|
+
// ── Draggable item wrapper ──
|
|
27
|
+
|
|
28
|
+
function DraggableNavItem({
|
|
29
|
+
item,
|
|
30
|
+
allItems,
|
|
31
|
+
isSelected,
|
|
32
|
+
isDragActive,
|
|
33
|
+
onSelect,
|
|
34
|
+
onDelete,
|
|
35
|
+
onSpanChange,
|
|
36
|
+
}: {
|
|
37
|
+
item: NavItem;
|
|
38
|
+
allItems: NavItem[];
|
|
39
|
+
isSelected: boolean;
|
|
40
|
+
isDragActive: boolean;
|
|
41
|
+
onSelect: (key: string) => void;
|
|
42
|
+
onDelete: (key: string) => void;
|
|
43
|
+
onSpanChange: (key: string, newSpan: number) => void;
|
|
44
|
+
}) {
|
|
45
|
+
const {
|
|
46
|
+
attributes,
|
|
47
|
+
listeners,
|
|
48
|
+
setNodeRef,
|
|
49
|
+
isDragging,
|
|
50
|
+
} = useSortable({
|
|
51
|
+
id: item._key,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<div ref={setNodeRef} style={{ gridColumn: `${item.grid_column} / span ${item.column_span}`, gridRow: 1 }}>
|
|
56
|
+
<NavGridItem
|
|
57
|
+
item={item}
|
|
58
|
+
allItems={allItems}
|
|
59
|
+
isSelected={isSelected}
|
|
60
|
+
onSelect={onSelect}
|
|
61
|
+
onDelete={onDelete}
|
|
62
|
+
onSpanChange={onSpanChange}
|
|
63
|
+
dragHandleProps={{ ...attributes, ...listeners }}
|
|
64
|
+
isDragging={isDragging}
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// ── Droppable empty cell ──
|
|
71
|
+
|
|
72
|
+
function DroppableCell({
|
|
73
|
+
column,
|
|
74
|
+
onAddItem,
|
|
75
|
+
isDragOver,
|
|
76
|
+
}: {
|
|
77
|
+
column: number;
|
|
78
|
+
onAddItem: (column: number) => void;
|
|
79
|
+
isDragOver: boolean;
|
|
80
|
+
}) {
|
|
81
|
+
const { setNodeRef } = useSortable({
|
|
82
|
+
id: `cell-${column}`,
|
|
83
|
+
disabled: true, // Cells aren't draggable, only drop targets
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<div ref={setNodeRef} style={{ gridColumn: column, gridRow: 1 }}>
|
|
88
|
+
<NavGridCell column={column} onAddItem={onAddItem} />
|
|
89
|
+
{isDragOver && (
|
|
90
|
+
<div className="absolute inset-0 rounded-lg ring-2 ring-[#076bff] bg-[#076bff]/10 pointer-events-none" />
|
|
91
|
+
)}
|
|
92
|
+
</div>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// ── Main grid ──
|
|
97
|
+
|
|
98
|
+
interface NavBuilderGridProps {
|
|
99
|
+
items: NavItem[];
|
|
100
|
+
selectedKey: string | null;
|
|
101
|
+
onSelect: (key: string | null) => void;
|
|
102
|
+
onAddItem: (item: NavItem) => void;
|
|
103
|
+
onDeleteItem: (key: string) => void;
|
|
104
|
+
onUpdateItem: (updated: NavItem) => void;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export default function NavBuilderGrid({
|
|
108
|
+
items,
|
|
109
|
+
selectedKey,
|
|
110
|
+
onSelect,
|
|
111
|
+
onAddItem,
|
|
112
|
+
onDeleteItem,
|
|
113
|
+
onUpdateItem,
|
|
114
|
+
}: NavBuilderGridProps) {
|
|
115
|
+
const [pickerColumn, setPickerColumn] = useState<number | null>(null);
|
|
116
|
+
const [activeId, setActiveId] = useState<string | null>(null);
|
|
117
|
+
const gridRef = useRef<HTMLDivElement>(null);
|
|
118
|
+
|
|
119
|
+
const occupied = getOccupiedColumns(items);
|
|
120
|
+
const hasLogo = items.some((i) => i.type === "logo");
|
|
121
|
+
|
|
122
|
+
// Free columns
|
|
123
|
+
const freeColumns: number[] = [];
|
|
124
|
+
for (let c = 1; c <= TOTAL_COLUMNS; c++) {
|
|
125
|
+
if (!occupied.has(c)) freeColumns.push(c);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// dnd-kit sensors
|
|
129
|
+
const sensors = useSensors(
|
|
130
|
+
useSensor(PointerSensor, {
|
|
131
|
+
activationConstraint: { distance: 8 },
|
|
132
|
+
})
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
const handleAddClick = useCallback((column: number) => {
|
|
136
|
+
setPickerColumn(column);
|
|
137
|
+
}, []);
|
|
138
|
+
|
|
139
|
+
const handlePickerSelect = useCallback(
|
|
140
|
+
(type: "logo" | "menu-item", defaultSpan: number) => {
|
|
141
|
+
if (pickerColumn === null) return;
|
|
142
|
+
const maxAvailable = getMaxSpan(items, pickerColumn);
|
|
143
|
+
const span = Math.min(defaultSpan, maxAvailable);
|
|
144
|
+
if (span < 1) return;
|
|
145
|
+
|
|
146
|
+
const newItem: NavItem = {
|
|
147
|
+
_key: crypto.randomUUID().slice(0, 8),
|
|
148
|
+
type,
|
|
149
|
+
label: type === "logo" ? "LOGO" : "NEW ITEM",
|
|
150
|
+
link_type: "internal",
|
|
151
|
+
visible: true,
|
|
152
|
+
grid_column: pickerColumn,
|
|
153
|
+
column_span: span,
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
onAddItem(newItem);
|
|
157
|
+
onSelect(newItem._key);
|
|
158
|
+
setPickerColumn(null);
|
|
159
|
+
},
|
|
160
|
+
[items, pickerColumn, onAddItem, onSelect]
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
const handleSpanChange = useCallback(
|
|
164
|
+
(key: string, newSpan: number) => {
|
|
165
|
+
const item = items.find((i) => i._key === key);
|
|
166
|
+
if (!item) return;
|
|
167
|
+
onUpdateItem({ ...item, column_span: newSpan });
|
|
168
|
+
},
|
|
169
|
+
[items, onUpdateItem]
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
// ── Drag handlers ──
|
|
173
|
+
|
|
174
|
+
const handleDragStart = useCallback((event: DragStartEvent) => {
|
|
175
|
+
setActiveId(event.active.id as string);
|
|
176
|
+
}, []);
|
|
177
|
+
|
|
178
|
+
const handleDragEnd = useCallback(
|
|
179
|
+
(event: DragEndEvent) => {
|
|
180
|
+
const { active, over } = event;
|
|
181
|
+
setActiveId(null);
|
|
182
|
+
|
|
183
|
+
if (!over) return;
|
|
184
|
+
const activeKey = active.id as string;
|
|
185
|
+
const overId = over.id as string;
|
|
186
|
+
|
|
187
|
+
// Dropped on itself
|
|
188
|
+
if (activeKey === overId) return;
|
|
189
|
+
|
|
190
|
+
const dragItem = items.find((i) => i._key === activeKey);
|
|
191
|
+
if (!dragItem) return;
|
|
192
|
+
|
|
193
|
+
// Determine target column
|
|
194
|
+
let targetColumn: number;
|
|
195
|
+
|
|
196
|
+
if (overId.startsWith("cell-")) {
|
|
197
|
+
// Dropped on empty cell
|
|
198
|
+
targetColumn = parseInt(overId.replace("cell-", ""), 10);
|
|
199
|
+
} else {
|
|
200
|
+
// Dropped on another item — swap columns
|
|
201
|
+
const overItem = items.find((i) => i._key === overId);
|
|
202
|
+
if (!overItem) return;
|
|
203
|
+
targetColumn = overItem.grid_column;
|
|
204
|
+
|
|
205
|
+
// Swap: move the other item to where the dragged item was
|
|
206
|
+
if (canPlace(items, dragItem.grid_column, overItem.column_span, overItem._key)) {
|
|
207
|
+
onUpdateItem({ ...overItem, grid_column: dragItem.grid_column });
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Check if the dragged item can be placed at target
|
|
212
|
+
if (canPlace(items, targetColumn, dragItem.column_span, dragItem._key)) {
|
|
213
|
+
onUpdateItem({ ...dragItem, grid_column: targetColumn });
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
[items, onUpdateItem]
|
|
217
|
+
);
|
|
218
|
+
|
|
219
|
+
const activeItem = activeId ? items.find((i) => i._key === activeId) : null;
|
|
220
|
+
|
|
221
|
+
return (
|
|
222
|
+
<>
|
|
223
|
+
<DndContext
|
|
224
|
+
sensors={sensors}
|
|
225
|
+
collisionDetection={closestCenter}
|
|
226
|
+
onDragStart={handleDragStart}
|
|
227
|
+
onDragEnd={handleDragEnd}
|
|
228
|
+
>
|
|
229
|
+
<div
|
|
230
|
+
ref={gridRef}
|
|
231
|
+
className="flex-1 p-5 overflow-auto"
|
|
232
|
+
onClick={() => onSelect(null)}
|
|
233
|
+
>
|
|
234
|
+
{/* Column numbers */}
|
|
235
|
+
<div
|
|
236
|
+
className="mb-1.5"
|
|
237
|
+
style={{
|
|
238
|
+
display: "grid",
|
|
239
|
+
gridTemplateColumns: `repeat(${TOTAL_COLUMNS}, 1fr)`,
|
|
240
|
+
gap: "4px",
|
|
241
|
+
}}
|
|
242
|
+
>
|
|
243
|
+
{Array.from({ length: TOTAL_COLUMNS }, (_, i) => (
|
|
244
|
+
<div
|
|
245
|
+
key={i}
|
|
246
|
+
className="text-center text-[9px] text-neutral-400 font-medium"
|
|
247
|
+
>
|
|
248
|
+
{i + 1}
|
|
249
|
+
</div>
|
|
250
|
+
))}
|
|
251
|
+
</div>
|
|
252
|
+
|
|
253
|
+
{/* Grid */}
|
|
254
|
+
<div
|
|
255
|
+
style={{
|
|
256
|
+
display: "grid",
|
|
257
|
+
gridTemplateColumns: `repeat(${TOTAL_COLUMNS}, 1fr)`,
|
|
258
|
+
gap: "4px",
|
|
259
|
+
}}
|
|
260
|
+
>
|
|
261
|
+
{/* Placed items (draggable) */}
|
|
262
|
+
{items.map((item) => (
|
|
263
|
+
<DraggableNavItem
|
|
264
|
+
key={item._key}
|
|
265
|
+
item={item}
|
|
266
|
+
allItems={items}
|
|
267
|
+
isSelected={selectedKey === item._key}
|
|
268
|
+
isDragActive={activeId !== null}
|
|
269
|
+
onSelect={onSelect}
|
|
270
|
+
onDelete={onDeleteItem}
|
|
271
|
+
onSpanChange={handleSpanChange}
|
|
272
|
+
/>
|
|
273
|
+
))}
|
|
274
|
+
|
|
275
|
+
{/* Empty cells (drop targets + add buttons) */}
|
|
276
|
+
{freeColumns.map((col) => (
|
|
277
|
+
<DroppableCell
|
|
278
|
+
key={`empty-${col}`}
|
|
279
|
+
column={col}
|
|
280
|
+
onAddItem={handleAddClick}
|
|
281
|
+
isDragOver={false}
|
|
282
|
+
/>
|
|
283
|
+
))}
|
|
284
|
+
</div>
|
|
285
|
+
|
|
286
|
+
{/* Helper hints */}
|
|
287
|
+
<div className="mt-4 flex gap-4 text-[10px] text-neutral-400">
|
|
288
|
+
<span>
|
|
289
|
+
<span className="text-[#076bff]">+</span> Click empty column to add
|
|
290
|
+
</span>
|
|
291
|
+
<span>
|
|
292
|
+
<span className="text-neutral-500">⠇</span> Drag to move
|
|
293
|
+
</span>
|
|
294
|
+
<span>
|
|
295
|
+
<span className="text-neutral-500">|</span> Drag edge to resize
|
|
296
|
+
</span>
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
|
|
300
|
+
{/* Drag overlay */}
|
|
301
|
+
<DragOverlay>
|
|
302
|
+
{activeItem ? (
|
|
303
|
+
<div
|
|
304
|
+
className="h-14 flex items-center px-3 gap-2 rounded-lg ring-2 ring-[#076bff] bg-white shadow-xl"
|
|
305
|
+
style={{ width: 120, opacity: 0.9 }}
|
|
306
|
+
>
|
|
307
|
+
<div className="text-xs font-mono text-neutral-900 uppercase tracking-wider truncate">
|
|
308
|
+
{activeItem.label || "Untitled"}
|
|
309
|
+
</div>
|
|
310
|
+
</div>
|
|
311
|
+
) : null}
|
|
312
|
+
</DragOverlay>
|
|
313
|
+
</DndContext>
|
|
314
|
+
|
|
315
|
+
{/* Type picker modal */}
|
|
316
|
+
{pickerColumn !== null && (
|
|
317
|
+
<NavItemTypePicker
|
|
318
|
+
column={pickerColumn}
|
|
319
|
+
hasLogo={hasLogo}
|
|
320
|
+
onSelect={handlePickerSelect}
|
|
321
|
+
onClose={() => setPickerColumn(null)}
|
|
322
|
+
/>
|
|
323
|
+
)}
|
|
324
|
+
</>
|
|
325
|
+
);
|
|
326
|
+
}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type { NavDesign } from "../../../lib/sanity/types";
|
|
4
|
+
import { getSiteConfig } from "../../../lib/config";
|
|
5
|
+
import {
|
|
6
|
+
Field,
|
|
7
|
+
TextInput,
|
|
8
|
+
SelectInput,
|
|
9
|
+
SegmentedControl,
|
|
10
|
+
Toggle,
|
|
11
|
+
RangeSlider,
|
|
12
|
+
Section,
|
|
13
|
+
ColorInput,
|
|
14
|
+
} from "./NavSettingsFields";
|
|
15
|
+
|
|
16
|
+
interface NavGeneralSettingsProps {
|
|
17
|
+
design: NavDesign;
|
|
18
|
+
activeTab: "settings" | "layout";
|
|
19
|
+
onChange: (design: NavDesign) => void;
|
|
20
|
+
fonts: string[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default function NavGeneralSettings({
|
|
24
|
+
design,
|
|
25
|
+
activeTab,
|
|
26
|
+
onChange,
|
|
27
|
+
fonts,
|
|
28
|
+
}: NavGeneralSettingsProps) {
|
|
29
|
+
const update = (partial: Partial<NavDesign>) =>
|
|
30
|
+
onChange({ ...design, ...partial });
|
|
31
|
+
|
|
32
|
+
if (activeTab === "settings") {
|
|
33
|
+
return (
|
|
34
|
+
<>
|
|
35
|
+
<Section title="POSITION">
|
|
36
|
+
<Field label="Position">
|
|
37
|
+
<SegmentedControl
|
|
38
|
+
value={design.position || "fixed"}
|
|
39
|
+
onChange={(v) => update({ position: v as NavDesign["position"] })}
|
|
40
|
+
options={[
|
|
41
|
+
{ value: "fixed", label: "Fixed" },
|
|
42
|
+
{ value: "sticky", label: "Sticky" },
|
|
43
|
+
{ value: "static", label: "Static" },
|
|
44
|
+
]}
|
|
45
|
+
/>
|
|
46
|
+
</Field>
|
|
47
|
+
<Field label="Hide scroll">
|
|
48
|
+
<Toggle
|
|
49
|
+
value={design.hide_on_scroll ?? true}
|
|
50
|
+
onChange={(v) => update({ hide_on_scroll: v })}
|
|
51
|
+
/>
|
|
52
|
+
</Field>
|
|
53
|
+
</Section>
|
|
54
|
+
|
|
55
|
+
<Section title="TYPOGRAPHY">
|
|
56
|
+
<Field label="Font">
|
|
57
|
+
<SelectInput
|
|
58
|
+
value={design.font_family || ""}
|
|
59
|
+
onChange={(v) => update({ font_family: v })}
|
|
60
|
+
options={[
|
|
61
|
+
{ value: "", label: `Default (${getSiteConfig().typography.defaultFont})` },
|
|
62
|
+
...fonts.map((f) => ({ value: f, label: f })),
|
|
63
|
+
]}
|
|
64
|
+
/>
|
|
65
|
+
</Field>
|
|
66
|
+
<Field label="Size">
|
|
67
|
+
<TextInput
|
|
68
|
+
value={design.font_size ?? 14}
|
|
69
|
+
onChange={(v) => update({ font_size: Math.max(8, Math.min(48, parseInt(v) || 14)) })}
|
|
70
|
+
type="number"
|
|
71
|
+
/>
|
|
72
|
+
</Field>
|
|
73
|
+
<Field label="Weight">
|
|
74
|
+
<SelectInput
|
|
75
|
+
value={design.font_weight || "400"}
|
|
76
|
+
onChange={(v) => update({ font_weight: v })}
|
|
77
|
+
options={[
|
|
78
|
+
{ value: "100", label: "100 · Thin" },
|
|
79
|
+
{ value: "200", label: "200 · Extra Light" },
|
|
80
|
+
{ value: "300", label: "300 · Light" },
|
|
81
|
+
{ value: "400", label: "400 · Normal" },
|
|
82
|
+
{ value: "500", label: "500 · Medium" },
|
|
83
|
+
{ value: "600", label: "600 · Semi Bold" },
|
|
84
|
+
{ value: "700", label: "700 · Bold" },
|
|
85
|
+
{ value: "800", label: "800 · Extra Bold" },
|
|
86
|
+
{ value: "900", label: "900 · Black" },
|
|
87
|
+
]}
|
|
88
|
+
/>
|
|
89
|
+
</Field>
|
|
90
|
+
<Field label="Transform">
|
|
91
|
+
<SelectInput
|
|
92
|
+
value={design.text_transform || "uppercase"}
|
|
93
|
+
onChange={(v) => update({ text_transform: v as NavDesign["text_transform"] })}
|
|
94
|
+
options={[
|
|
95
|
+
{ value: "uppercase", label: "UPPERCASE" },
|
|
96
|
+
{ value: "none", label: "None" },
|
|
97
|
+
{ value: "lowercase", label: "lowercase" },
|
|
98
|
+
{ value: "capitalize", label: "Capitalize" },
|
|
99
|
+
]}
|
|
100
|
+
/>
|
|
101
|
+
</Field>
|
|
102
|
+
<Field label="Align">
|
|
103
|
+
<SegmentedControl
|
|
104
|
+
value={design.text_align || "left"}
|
|
105
|
+
onChange={(v) => update({ text_align: v as NavDesign["text_align"] })}
|
|
106
|
+
options={[
|
|
107
|
+
{ value: "left", label: "Left" },
|
|
108
|
+
{ value: "center", label: "Center" },
|
|
109
|
+
{ value: "right", label: "Right" },
|
|
110
|
+
]}
|
|
111
|
+
/>
|
|
112
|
+
</Field>
|
|
113
|
+
<Field label="V. Align">
|
|
114
|
+
<SegmentedControl
|
|
115
|
+
value={design.vertical_align || "top"}
|
|
116
|
+
onChange={(v) => update({ vertical_align: v as NavDesign["vertical_align"] })}
|
|
117
|
+
options={[
|
|
118
|
+
{ value: "top", label: "Top" },
|
|
119
|
+
{ value: "middle", label: "Middle" },
|
|
120
|
+
{ value: "bottom", label: "Bottom" },
|
|
121
|
+
]}
|
|
122
|
+
/>
|
|
123
|
+
</Field>
|
|
124
|
+
<Field label="Color">
|
|
125
|
+
<SelectInput
|
|
126
|
+
value={design.color || "yellow-lime"}
|
|
127
|
+
onChange={(v) => update({ color: v as NavDesign["color"] })}
|
|
128
|
+
options={[
|
|
129
|
+
{ value: "yellow-lime", label: "Yellow-Lime" },
|
|
130
|
+
{ value: "yellow", label: "Yellow" },
|
|
131
|
+
{ value: "red-coral", label: "Red / Coral" },
|
|
132
|
+
{ value: "blue", label: "Blue" },
|
|
133
|
+
{ value: "green", label: "Green" },
|
|
134
|
+
{ value: "white", label: "White" },
|
|
135
|
+
]}
|
|
136
|
+
/>
|
|
137
|
+
</Field>
|
|
138
|
+
</Section>
|
|
139
|
+
|
|
140
|
+
<Section title="ANIMATION">
|
|
141
|
+
<Field label="Entrance">
|
|
142
|
+
<SelectInput
|
|
143
|
+
value={design.entrance_animation || ""}
|
|
144
|
+
onChange={(v) => update({ entrance_animation: v as NavDesign["entrance_animation"] })}
|
|
145
|
+
options={[
|
|
146
|
+
{ value: "", label: "None" },
|
|
147
|
+
{ value: "fade-in", label: "Fade In" },
|
|
148
|
+
{ value: "slide-down", label: "Slide Down" },
|
|
149
|
+
{ value: "blur-in", label: "Blur In" },
|
|
150
|
+
]}
|
|
151
|
+
/>
|
|
152
|
+
</Field>
|
|
153
|
+
{design.entrance_animation && (
|
|
154
|
+
<>
|
|
155
|
+
<Field label="Duration">
|
|
156
|
+
<RangeSlider
|
|
157
|
+
value={design.entrance_duration ?? 600}
|
|
158
|
+
onChange={(v) => update({ entrance_duration: v })}
|
|
159
|
+
min={200}
|
|
160
|
+
max={5000}
|
|
161
|
+
suffix="ms"
|
|
162
|
+
/>
|
|
163
|
+
</Field>
|
|
164
|
+
<Field label="Delay">
|
|
165
|
+
<RangeSlider
|
|
166
|
+
value={design.entrance_delay ?? 0}
|
|
167
|
+
onChange={(v) => update({ entrance_delay: v })}
|
|
168
|
+
min={0}
|
|
169
|
+
max={5000}
|
|
170
|
+
suffix="ms"
|
|
171
|
+
/>
|
|
172
|
+
</Field>
|
|
173
|
+
<Field label="Stagger">
|
|
174
|
+
<Toggle
|
|
175
|
+
value={design.entrance_stagger ?? false}
|
|
176
|
+
onChange={(v) => update({ entrance_stagger: v })}
|
|
177
|
+
/>
|
|
178
|
+
</Field>
|
|
179
|
+
{design.entrance_stagger && (
|
|
180
|
+
<Field label="Stagger delay">
|
|
181
|
+
<RangeSlider
|
|
182
|
+
value={design.entrance_stagger_delay ?? 80}
|
|
183
|
+
onChange={(v) => update({ entrance_stagger_delay: v })}
|
|
184
|
+
min={20}
|
|
185
|
+
max={300}
|
|
186
|
+
suffix="ms"
|
|
187
|
+
/>
|
|
188
|
+
</Field>
|
|
189
|
+
)}
|
|
190
|
+
</>
|
|
191
|
+
)}
|
|
192
|
+
</Section>
|
|
193
|
+
|
|
194
|
+
<Section title="SPACING">
|
|
195
|
+
<Field label="Pad H">
|
|
196
|
+
<RangeSlider
|
|
197
|
+
value={design.padding_h ?? 24}
|
|
198
|
+
onChange={(v) => update({ padding_h: v })}
|
|
199
|
+
min={0}
|
|
200
|
+
max={120}
|
|
201
|
+
suffix="px"
|
|
202
|
+
/>
|
|
203
|
+
</Field>
|
|
204
|
+
<Field label="Pad V">
|
|
205
|
+
<RangeSlider
|
|
206
|
+
value={design.padding_v ?? 27}
|
|
207
|
+
onChange={(v) => update({ padding_v: v })}
|
|
208
|
+
min={0}
|
|
209
|
+
max={80}
|
|
210
|
+
suffix="px"
|
|
211
|
+
/>
|
|
212
|
+
</Field>
|
|
213
|
+
<Field label="Margin H">
|
|
214
|
+
<RangeSlider
|
|
215
|
+
value={design.margin_h ?? 0}
|
|
216
|
+
onChange={(v) => update({ margin_h: v })}
|
|
217
|
+
min={0}
|
|
218
|
+
max={120}
|
|
219
|
+
suffix="px"
|
|
220
|
+
/>
|
|
221
|
+
</Field>
|
|
222
|
+
<Field label="Margin V">
|
|
223
|
+
<RangeSlider
|
|
224
|
+
value={design.margin_v ?? 0}
|
|
225
|
+
onChange={(v) => update({ margin_v: v })}
|
|
226
|
+
min={0}
|
|
227
|
+
max={80}
|
|
228
|
+
suffix="px"
|
|
229
|
+
/>
|
|
230
|
+
</Field>
|
|
231
|
+
<Field label="Items gap">
|
|
232
|
+
<RangeSlider
|
|
233
|
+
value={design.items_gap ?? 32}
|
|
234
|
+
onChange={(v) => update({ items_gap: v })}
|
|
235
|
+
min={4}
|
|
236
|
+
max={80}
|
|
237
|
+
suffix="px"
|
|
238
|
+
/>
|
|
239
|
+
</Field>
|
|
240
|
+
</Section>
|
|
241
|
+
</>
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// Layout tab
|
|
246
|
+
return (
|
|
247
|
+
<>
|
|
248
|
+
<Section title="BACKGROUND">
|
|
249
|
+
<Field label="Color">
|
|
250
|
+
<ColorInput
|
|
251
|
+
value={design.background_color || ""}
|
|
252
|
+
onChange={(v) => update({ background_color: v })}
|
|
253
|
+
/>
|
|
254
|
+
</Field>
|
|
255
|
+
{design.background_color && (
|
|
256
|
+
<Field label="Opacity">
|
|
257
|
+
<RangeSlider
|
|
258
|
+
value={design.background_opacity ?? 100}
|
|
259
|
+
onChange={(v) => update({ background_opacity: v })}
|
|
260
|
+
min={0}
|
|
261
|
+
max={100}
|
|
262
|
+
suffix="%"
|
|
263
|
+
/>
|
|
264
|
+
</Field>
|
|
265
|
+
)}
|
|
266
|
+
<Field label="Blur">
|
|
267
|
+
<Toggle
|
|
268
|
+
value={design.backdrop_blur ?? false}
|
|
269
|
+
onChange={(v) => update({ backdrop_blur: v })}
|
|
270
|
+
/>
|
|
271
|
+
</Field>
|
|
272
|
+
</Section>
|
|
273
|
+
</>
|
|
274
|
+
);
|
|
275
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
|
|
5
|
+
interface NavGridCellProps {
|
|
6
|
+
column: number;
|
|
7
|
+
onAddItem: (column: number) => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default function NavGridCell({ column, onAddItem }: NavGridCellProps) {
|
|
11
|
+
const [hovered, setHovered] = useState(false);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
onMouseEnter={() => setHovered(true)}
|
|
16
|
+
onMouseLeave={() => setHovered(false)}
|
|
17
|
+
onClick={(e) => {
|
|
18
|
+
e.stopPropagation();
|
|
19
|
+
onAddItem(column);
|
|
20
|
+
}}
|
|
21
|
+
className={`h-14 flex items-center justify-center cursor-pointer transition-all rounded-lg border border-dashed ${
|
|
22
|
+
hovered
|
|
23
|
+
? "border-[#076bff]/50 bg-[#076bff]/[0.03]"
|
|
24
|
+
: "border-neutral-200 bg-transparent"
|
|
25
|
+
}`}
|
|
26
|
+
data-nav-cell={column}
|
|
27
|
+
>
|
|
28
|
+
<div
|
|
29
|
+
className={`flex flex-col items-center gap-0.5 transition-all ${
|
|
30
|
+
hovered ? "text-[#076bff]" : "text-neutral-300"
|
|
31
|
+
}`}
|
|
32
|
+
style={{
|
|
33
|
+
opacity: hovered ? 1 : 0.5,
|
|
34
|
+
transform: hovered ? "scale(1)" : "scale(0.9)",
|
|
35
|
+
}}
|
|
36
|
+
>
|
|
37
|
+
<svg width="14" height="14" viewBox="0 0 16 16" fill="none">
|
|
38
|
+
<path
|
|
39
|
+
d="M8 3v10M3 8h10"
|
|
40
|
+
stroke="currentColor"
|
|
41
|
+
strokeWidth="1.5"
|
|
42
|
+
strokeLinecap="round"
|
|
43
|
+
/>
|
|
44
|
+
</svg>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
}
|