@gunjo/ui 0.0.1-alpha.1 → 0.0.1-alpha.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.ja.md +90 -0
- package/README.md +52 -91
- package/package.json +47 -6
- package/src/components/display/Accordion.tsx +185 -0
- package/src/components/display/AccordionGroup.tsx +155 -0
- package/src/components/display/ActionDataTable.tsx +413 -0
- package/src/components/display/ActivityTimelineCard.tsx +483 -0
- package/src/components/display/AnalyticsCard.tsx +167 -0
- package/src/components/display/AssetCard.tsx +242 -0
- package/src/components/display/AssetGrid.tsx +164 -0
- package/src/components/display/Avatar.tsx +127 -0
- package/src/components/display/AvatarGroup.tsx +131 -0
- package/src/components/{atoms → display}/Badge.tsx +3 -3
- package/src/components/display/BarChart.tsx +247 -0
- package/src/components/{molecules → display}/Card.tsx +1 -1
- package/src/components/display/Carousel.tsx +593 -0
- package/src/components/display/ChartLegend.tsx +124 -0
- package/src/components/display/ChatMessage.tsx +382 -0
- package/src/components/display/ChoroplethMap.tsx +613 -0
- package/src/components/display/Code.tsx +42 -0
- package/src/components/display/CodeBlock.tsx +338 -0
- package/src/components/display/ColorSwatch.tsx +71 -0
- package/src/components/display/ConcentricProgressCard.tsx +545 -0
- package/src/components/display/DataTable.tsx +522 -0
- package/src/components/display/DistributionBar.tsx +102 -0
- package/src/components/display/DocNote.tsx +36 -0
- package/src/components/display/DonutChart.tsx +257 -0
- package/src/components/display/EmptyState.tsx +44 -0
- package/src/components/display/FileTree.tsx +180 -0
- package/src/components/display/GaugeChart.tsx +219 -0
- package/src/components/display/HeatmapChart.tsx +266 -0
- package/src/components/display/Icon.tsx +66 -0
- package/src/components/display/ImagePreview.tsx +140 -0
- package/src/components/{atoms → display}/Img.tsx +46 -12
- package/src/components/display/LabeledDonutCard.tsx +475 -0
- package/src/components/display/LineChart.tsx +464 -0
- package/src/components/{molecules → display}/List.tsx +20 -13
- package/src/components/display/MarkdownRenderer.tsx +157 -0
- package/src/components/display/MetadataList.tsx +81 -0
- package/src/components/display/MiniDistributionBarCard.tsx +314 -0
- package/src/components/display/PieChart.tsx +234 -0
- package/src/components/display/QuadrantMatrix.tsx +330 -0
- package/src/components/display/RadarChart.tsx +335 -0
- package/src/components/display/RadialBarChart.tsx +264 -0
- package/src/components/display/RetentionCohortCard.tsx +350 -0
- package/src/components/display/RibbonChart.tsx +618 -0
- package/src/components/display/SearchableAccordion.tsx +270 -0
- package/src/components/display/SegmentTimelineCard.tsx +452 -0
- package/src/components/display/SegmentedGaugeCard.tsx +607 -0
- package/src/components/display/Spacer.tsx +51 -0
- package/src/components/display/SparklineChart.tsx +394 -0
- package/src/components/display/StackedBarChart.tsx +393 -0
- package/src/components/display/Statistic.tsx +70 -0
- package/src/components/{molecules → display}/Table.tsx +22 -7
- package/src/components/display/Tag.tsx +80 -0
- package/src/components/display/TagEditor.tsx +141 -0
- package/src/components/display/Timeline.tsx +121 -0
- package/src/components/{atoms → display}/ToolPill.tsx +42 -18
- package/src/components/display/TreeView.tsx +226 -0
- package/src/components/display/chart-tooltip.tsx +423 -0
- package/src/components/display/chart-utils.ts +71 -0
- package/src/components/display/circular-chart-utils.ts +147 -0
- package/src/components/display/generated/default-variant-keys.ts +90 -0
- package/src/components/display/generated/variant-keys.ts +169 -0
- package/src/components/{atoms → feedback}/Alert.tsx +12 -5
- package/src/components/feedback/Banner.tsx +90 -0
- package/src/components/{molecules → feedback}/NotificationCenter.tsx +64 -31
- package/src/components/feedback/ProgressWidget.tsx +44 -0
- package/src/components/{atoms → feedback}/Spinner.tsx +2 -2
- package/src/components/{molecules → feedback}/StatusBar.tsx +4 -4
- package/src/components/feedback/StatusScreen.tsx +148 -0
- package/src/components/{molecules → feedback}/Stepper.tsx +10 -5
- package/src/components/feedback/Toast.tsx +108 -0
- package/src/components/feedback/ToastProvider.tsx +78 -0
- package/src/components/feedback/generated/default-variant-keys.ts +16 -0
- package/src/components/feedback/generated/variant-keys.ts +21 -0
- package/src/components/generated/component-manifest.ts +1568 -454
- package/src/components/generated/component-style-hints.ts +1958 -718
- package/src/components/{atoms → inputs}/ButtonVariants.ts +13 -3
- package/src/components/inputs/Calendar.tsx +212 -0
- package/src/components/inputs/ChatComposer.tsx +75 -0
- package/src/components/inputs/ChatInput.tsx +528 -0
- package/src/components/{atoms → inputs}/Checkbox.tsx +2 -2
- package/src/components/inputs/Combobox.tsx +175 -0
- package/src/components/inputs/CopyButton.tsx +187 -0
- package/src/components/inputs/DatePicker.tsx +519 -0
- package/src/components/inputs/DateRangePicker.tsx +878 -0
- package/src/components/inputs/EditableField.tsx +182 -0
- package/src/components/{organisms → inputs}/FileUploader.tsx +24 -9
- package/src/components/inputs/FilterButton.tsx +163 -0
- package/src/components/{molecules → inputs}/Form.tsx +20 -3
- package/src/components/{atoms → inputs}/Input.tsx +2 -0
- package/src/components/inputs/InputOTP.tsx +75 -0
- package/src/components/inputs/Mention.tsx +279 -0
- package/src/components/inputs/NumberInput.tsx +109 -0
- package/src/components/inputs/PasswordGroup.tsx +138 -0
- package/src/components/inputs/PasswordInput.tsx +74 -0
- package/src/components/inputs/PasswordRequirementList.tsx +96 -0
- package/src/components/inputs/PasswordStrengthMeter.tsx +93 -0
- package/src/components/inputs/PhoneInput.tsx +99 -0
- package/src/components/inputs/PostalCodeInput.tsx +98 -0
- package/src/components/inputs/RangeSlider.tsx +129 -0
- package/src/components/inputs/SearchInput.tsx +76 -0
- package/src/components/inputs/Select.tsx +39 -0
- package/src/components/{atoms → inputs}/Slider.tsx +18 -5
- package/src/components/{molecules → inputs}/SortButton.tsx +5 -2
- package/src/components/{atoms → inputs}/Switch.tsx +15 -4
- package/src/components/inputs/TagInput.tsx +114 -0
- package/src/components/{atoms → inputs}/Textarea.tsx +1 -0
- package/src/components/inputs/TimePicker.tsx +150 -0
- package/src/components/inputs/Toggle.tsx +48 -0
- package/src/components/{atoms → inputs}/ToggleGroup.tsx +2 -2
- package/src/components/inputs/TooltipButton.tsx +148 -0
- package/src/components/inputs/VoiceInputButton.tsx +317 -0
- package/src/components/inputs/calendar-holidays.ts +56 -0
- package/src/components/inputs/generated/default-variant-keys.ts +32 -0
- package/src/components/{atoms → inputs}/generated/variant-keys.ts +19 -27
- package/src/components/layout/AspectRatio.tsx +12 -0
- package/src/components/layout/AssetInspectorPanel.tsx +416 -0
- package/src/components/layout/Cluster.tsx +56 -0
- package/src/components/layout/CollapsiblePanelToggle.tsx +94 -0
- package/src/components/layout/Container.tsx +43 -0
- package/src/components/layout/DeviceFrame.tsx +227 -0
- package/src/components/layout/Grid.tsx +65 -0
- package/src/components/layout/HStack.tsx +73 -0
- package/src/components/{organisms → layout}/InspectorPanel.tsx +6 -5
- package/src/components/layout/MarqueeFrame.tsx +158 -0
- package/src/components/layout/Resizable.tsx +94 -0
- package/src/components/layout/ScrollArea.tsx +71 -0
- package/src/components/{organisms → layout}/SpatialCanvas.tsx +12 -7
- package/src/components/layout/VStack.tsx +69 -0
- package/src/components/layout/generated/default-variant-keys.ts +16 -0
- package/src/components/layout/generated/variant-keys.ts +21 -0
- package/src/components/{molecules → navigation}/Breadcrumb.tsx +5 -4
- package/src/components/navigation/Command.tsx +266 -0
- package/src/components/navigation/CommandPalette.tsx +83 -0
- package/src/components/navigation/DocumentPager.tsx +171 -0
- package/src/components/navigation/Footer.tsx +88 -0
- package/src/components/navigation/Header.tsx +80 -0
- package/src/components/{molecules → navigation}/Menubar.tsx +45 -12
- package/src/components/navigation/NavigationMenu.tsx +128 -0
- package/src/components/navigation/PageAside.tsx +84 -0
- package/src/components/{molecules → navigation}/Pagination.tsx +60 -7
- package/src/components/{organisms → navigation}/RightRail.tsx +1 -1
- package/src/components/navigation/Sidebar.tsx +223 -0
- package/src/components/navigation/SidebarItem.tsx +160 -0
- package/src/components/{molecules → navigation}/Tabs.tsx +2 -2
- package/src/components/navigation/TextLink.tsx +71 -0
- package/src/components/navigation/generated/default-variant-keys.ts +12 -0
- package/src/components/navigation/generated/variant-keys.ts +13 -0
- package/src/components/overlay/AIChatInput.tsx +5 -0
- package/src/components/overlay/AIChatMessage.tsx +6 -0
- package/src/components/overlay/AlertDialog.tsx +145 -0
- package/src/components/overlay/ChatPanel.tsx +180 -0
- package/src/components/{molecules → overlay}/ContextMenu.tsx +65 -29
- package/src/components/{molecules → overlay}/Dialog.tsx +21 -13
- package/src/components/overlay/Drawer.tsx +131 -0
- package/src/components/{molecules → overlay}/DropdownMenu.tsx +52 -17
- package/src/components/overlay/FloatingPanel.tsx +90 -0
- package/src/components/overlay/HoverCard.tsx +36 -0
- package/src/components/overlay/MediaLightbox.tsx +403 -0
- package/src/components/overlay/MediaPickerDialog.tsx +198 -0
- package/src/components/overlay/Modal.tsx +103 -0
- package/src/components/overlay/OnboardingFlow.tsx +172 -0
- package/src/components/overlay/Popover.tsx +36 -0
- package/src/components/overlay/ShareModal.tsx +324 -0
- package/src/components/{molecules → overlay}/Sheet.tsx +76 -19
- package/src/components/overlay/Tooltip.tsx +130 -0
- package/src/components/overlay/generated/default-variant-keys.ts +14 -0
- package/src/components/overlay/generated/variant-keys.ts +17 -0
- package/src/components/patterns/BlogTemplate.tsx +46 -0
- package/src/components/{templates → patterns}/DashboardTemplate.tsx +2 -2
- package/src/components/patterns/DocsTemplate.tsx +41 -0
- package/src/components/{templates → patterns}/MediaLibraryTemplate.tsx +1 -1
- package/src/components/patterns/OnboardingTemplate.tsx +32 -0
- package/src/components/patterns/PricingTemplate.tsx +106 -0
- package/src/globals.css +173 -22
- package/src/index.ts +177 -76
- package/tailwind-theme-extend.cjs +48 -3
- package/design/atoms-metadata.json +0 -82
- package/design/molecules-metadata.json +0 -130
- package/design/organisms-metadata.json +0 -38
- package/design/templates-metadata.json +0 -38
- package/src/components/atoms/Avatar.tsx +0 -57
- package/src/components/atoms/Select.tsx +0 -28
- package/src/components/atoms/generated/default-variant-keys.ts +0 -36
- package/src/components/molecules/AIChatInput.tsx +0 -140
- package/src/components/molecules/AIChatMessage.tsx +0 -109
- package/src/components/molecules/Accordion.tsx +0 -99
- package/src/components/molecules/Calendar.tsx +0 -60
- package/src/components/molecules/Carousel.tsx +0 -261
- package/src/components/molecules/Command.tsx +0 -152
- package/src/components/molecules/FilterButton.tsx +0 -133
- package/src/components/molecules/HoverCard.tsx +0 -29
- package/src/components/molecules/Modal.tsx +0 -66
- package/src/components/molecules/Popover.tsx +0 -31
- package/src/components/molecules/ProgressWidget.tsx +0 -40
- package/src/components/molecules/Resizable.tsx +0 -47
- package/src/components/molecules/ScrollArea.tsx +0 -48
- package/src/components/molecules/SidebarItem.tsx +0 -134
- package/src/components/molecules/Toast.tsx +0 -57
- package/src/components/molecules/Tooltip.tsx +0 -30
- package/src/components/molecules/generated/default-variant-keys.ts +0 -22
- package/src/components/molecules/generated/variant-keys.ts +0 -33
- package/src/components/organisms/CommandPalette.tsx +0 -58
- package/src/components/organisms/FloatingPanel.tsx +0 -46
- package/src/components/organisms/ShareModal.tsx +0 -182
- package/src/components/organisms/ToastProvider.tsx +0 -49
- /package/src/components/{atoms → display}/Kbd.tsx +0 -0
- /package/src/components/{atoms → display}/Separator.tsx +0 -0
- /package/src/components/{atoms → display}/Skeleton.tsx +0 -0
- /package/src/components/{atoms → feedback}/Progress.tsx +0 -0
- /package/src/components/{atoms → inputs}/Button.tsx +0 -0
- /package/src/components/{atoms → inputs}/Label.tsx +0 -0
- /package/src/components/{atoms → inputs}/RadioGroup.tsx +0 -0
- /package/src/components/{organisms → navigation}/AppRail.tsx +0 -0
- /package/src/components/{templates → patterns}/AuthTemplate.tsx +0 -0
- /package/src/components/{templates → patterns}/BannalyzeTemplate.tsx +0 -0
- /package/src/components/{templates → patterns}/ChatTemplate.tsx +0 -0
- /package/src/components/{templates → patterns}/EditorTemplate.tsx +0 -0
- /package/src/components/{templates → patterns}/KanbanTemplate.tsx +0 -0
- /package/src/components/{templates → patterns}/LandingTemplate.tsx +0 -0
- /package/src/components/{templates → patterns}/SettingsTemplate.tsx +0 -0
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { cn } from "../../lib/utils"
|
|
5
|
-
import { Progress } from "../atoms/Progress"
|
|
6
|
-
import { Card, CardContent, CardHeader, CardTitle } from "./Card"
|
|
7
|
-
|
|
8
|
-
export interface ProgressWidgetProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
|
-
title: string
|
|
10
|
-
value: number
|
|
11
|
-
max?: number
|
|
12
|
-
label?: string
|
|
13
|
-
subtext?: string
|
|
14
|
-
icon?: React.ReactNode
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const ProgressWidget = React.forwardRef<HTMLDivElement, ProgressWidgetProps>(
|
|
18
|
-
({ className, title, value, max = 100, label, subtext, icon, ...props }, ref) => {
|
|
19
|
-
const percentage = Math.round((value / max) * 100);
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<Card ref={ref} className={cn("flex flex-col w-[320px] rounded-lg border overflow-hidden", className)} {...props}>
|
|
23
|
-
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
|
24
|
-
<CardTitle className="text-sm font-medium">{title}</CardTitle>
|
|
25
|
-
{icon && <div className="text-muted-foreground">{icon}</div>}
|
|
26
|
-
</CardHeader>
|
|
27
|
-
<CardContent>
|
|
28
|
-
<div className="text-2xl font-bold">{label || `${percentage}%`}</div>
|
|
29
|
-
<Progress value={percentage} className="mt-2 h-2" />
|
|
30
|
-
{subtext && (
|
|
31
|
-
<p className="text-xs text-muted-foreground mt-2">{subtext}</p>
|
|
32
|
-
)}
|
|
33
|
-
</CardContent>
|
|
34
|
-
</Card>
|
|
35
|
-
)
|
|
36
|
-
}
|
|
37
|
-
)
|
|
38
|
-
ProgressWidget.displayName = "ProgressWidget"
|
|
39
|
-
|
|
40
|
-
export { ProgressWidget }
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { GripVertical } from "lucide-react"
|
|
5
|
-
// @ts-ignore - Runtime inspection shows Group/Separator but types might verify PanelGroup
|
|
6
|
-
import { Panel, Group as PanelGroup, Separator as PanelResizeHandle } from "react-resizable-panels"
|
|
7
|
-
|
|
8
|
-
import { cn } from "../../lib/utils"
|
|
9
|
-
|
|
10
|
-
const ResizablePanelGroup = ({
|
|
11
|
-
className,
|
|
12
|
-
...props
|
|
13
|
-
}: React.HTMLAttributes<HTMLDivElement> & { direction: "vertical" | "horizontal"; autoSaveId?: string; onLayout?: (sizes: number[]) => void; id?: string }) => (
|
|
14
|
-
<PanelGroup
|
|
15
|
-
className={cn(
|
|
16
|
-
"flex h-full w-full data-[panel-group-direction=vertical]:flex-col flex-col w-[520px] h-[240px]",
|
|
17
|
-
className
|
|
18
|
-
)}
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
const ResizablePanel = Panel
|
|
24
|
-
|
|
25
|
-
const ResizableHandle = ({
|
|
26
|
-
withHandle,
|
|
27
|
-
className,
|
|
28
|
-
...props
|
|
29
|
-
}: React.ComponentProps<typeof PanelResizeHandle> & {
|
|
30
|
-
withHandle?: boolean
|
|
31
|
-
}) => (
|
|
32
|
-
<PanelResizeHandle
|
|
33
|
-
className={cn(
|
|
34
|
-
"relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",
|
|
35
|
-
className
|
|
36
|
-
)}
|
|
37
|
-
{...props}
|
|
38
|
-
>
|
|
39
|
-
{withHandle && (
|
|
40
|
-
<div className="z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border">
|
|
41
|
-
<GripVertical className="h-2.5 w-2.5" />
|
|
42
|
-
</div>
|
|
43
|
-
)}
|
|
44
|
-
</PanelResizeHandle>
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
export { ResizablePanelGroup, ResizablePanel, ResizableHandle }
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
|
|
5
|
-
|
|
6
|
-
import { cn } from "../../lib/utils"
|
|
7
|
-
|
|
8
|
-
const ScrollArea = React.forwardRef<
|
|
9
|
-
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
|
|
10
|
-
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
|
|
11
|
-
>(({ className, children, ...props }, ref) => (
|
|
12
|
-
<ScrollAreaPrimitive.Root
|
|
13
|
-
ref={ref}
|
|
14
|
-
className={cn("relative overflow-hidden flex flex-col w-[320px] h-[240px]", className)}
|
|
15
|
-
{...props}
|
|
16
|
-
>
|
|
17
|
-
<ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
|
|
18
|
-
{children}
|
|
19
|
-
</ScrollAreaPrimitive.Viewport>
|
|
20
|
-
<ScrollBar />
|
|
21
|
-
<ScrollAreaPrimitive.Corner />
|
|
22
|
-
</ScrollAreaPrimitive.Root>
|
|
23
|
-
))
|
|
24
|
-
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName
|
|
25
|
-
|
|
26
|
-
const ScrollBar = React.forwardRef<
|
|
27
|
-
React.ElementRef<typeof ScrollAreaPrimitive.Scrollbar>,
|
|
28
|
-
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Scrollbar>
|
|
29
|
-
>(({ className, orientation = "vertical", ...props }, ref) => (
|
|
30
|
-
<ScrollAreaPrimitive.Scrollbar
|
|
31
|
-
ref={ref}
|
|
32
|
-
orientation={orientation}
|
|
33
|
-
className={cn(
|
|
34
|
-
"flex touch-none select-none transition-colors",
|
|
35
|
-
orientation === "vertical" &&
|
|
36
|
-
"h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
37
|
-
orientation === "horizontal" &&
|
|
38
|
-
"h-2.5 border-t border-t-transparent p-[1px]",
|
|
39
|
-
className
|
|
40
|
-
)}
|
|
41
|
-
{...props}
|
|
42
|
-
>
|
|
43
|
-
<ScrollAreaPrimitive.Thumb className="relative flex-1 rounded-full bg-border" />
|
|
44
|
-
</ScrollAreaPrimitive.Scrollbar>
|
|
45
|
-
))
|
|
46
|
-
ScrollBar.displayName = ScrollAreaPrimitive.Scrollbar.displayName
|
|
47
|
-
|
|
48
|
-
export { ScrollArea, ScrollBar }
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import React, { memo } from 'react';
|
|
4
|
-
import { Trash2, ChevronRight } from 'lucide-react';
|
|
5
|
-
import { cn } from '../../lib/utils';
|
|
6
|
-
import type { SidebarItemVariantKey } from './generated/variant-keys';
|
|
7
|
-
import { sidebarItemDefaultVariantKey } from "./generated/default-variant-keys";
|
|
8
|
-
|
|
9
|
-
export interface SidebarItemProps {
|
|
10
|
-
icon: React.ReactNode;
|
|
11
|
-
label: string;
|
|
12
|
-
count?: number;
|
|
13
|
-
isActive: boolean;
|
|
14
|
-
onClick: () => void;
|
|
15
|
-
onDrop?: (e: React.DragEvent) => void;
|
|
16
|
-
onDragOver?: (e: React.DragEvent) => void;
|
|
17
|
-
dragOverId?: string | null;
|
|
18
|
-
dragAction?: 'nest' | 'reorder-above' | 'reorder-below' | null;
|
|
19
|
-
id: string;
|
|
20
|
-
level?: number;
|
|
21
|
-
hasChildren?: boolean;
|
|
22
|
-
isExpanded?: boolean;
|
|
23
|
-
onToggleExpand?: (e: React.MouseEvent) => void;
|
|
24
|
-
onDelete?: (e: React.MouseEvent) => void;
|
|
25
|
-
draggable?: boolean;
|
|
26
|
-
onDragStart?: (e: React.DragEvent) => void;
|
|
27
|
-
className?: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const SidebarItem = memo(({
|
|
31
|
-
icon,
|
|
32
|
-
label,
|
|
33
|
-
count,
|
|
34
|
-
isActive,
|
|
35
|
-
onClick,
|
|
36
|
-
onDrop,
|
|
37
|
-
onDragOver,
|
|
38
|
-
dragOverId,
|
|
39
|
-
dragAction,
|
|
40
|
-
id,
|
|
41
|
-
level = 0,
|
|
42
|
-
hasChildren = false,
|
|
43
|
-
isExpanded = false,
|
|
44
|
-
onToggleExpand,
|
|
45
|
-
onDelete,
|
|
46
|
-
draggable,
|
|
47
|
-
onDragStart,
|
|
48
|
-
className
|
|
49
|
-
}: SidebarItemProps) => {
|
|
50
|
-
const baseVariant: SidebarItemVariantKey = isActive ? "active" : sidebarItemDefaultVariantKey;
|
|
51
|
-
const variantClasses: Record<SidebarItemVariantKey, string> = {
|
|
52
|
-
active: "bg-secondary text-foreground",
|
|
53
|
-
default: "text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const dragNestClass =
|
|
57
|
-
dragOverId === id && dragAction === "nest"
|
|
58
|
-
? "bg-primary/20 text-primary ring-2 ring-primary shadow-lg shadow-primary/40 scale-[1.02] z-10"
|
|
59
|
-
: null;
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<button
|
|
63
|
-
onClick={(e) => {
|
|
64
|
-
onClick();
|
|
65
|
-
if (hasChildren && onToggleExpand) {
|
|
66
|
-
onToggleExpand(e);
|
|
67
|
-
}
|
|
68
|
-
}}
|
|
69
|
-
onDragOver={onDragOver}
|
|
70
|
-
onDrop={onDrop}
|
|
71
|
-
draggable={draggable}
|
|
72
|
-
onDragStart={onDragStart}
|
|
73
|
-
className={cn(
|
|
74
|
-
"w-[320px] w-full h-9 flex flex-col flex-row items-center justify-between px-4 py-1.5 rounded-md text-sm transition-colors group relative",
|
|
75
|
-
dragNestClass ?? variantClasses[baseVariant],
|
|
76
|
-
className
|
|
77
|
-
)}
|
|
78
|
-
style={{ paddingLeft: `${(level * 16) + 8}px` }}
|
|
79
|
-
>
|
|
80
|
-
{dragOverId === id && dragAction === 'reorder-above' && (
|
|
81
|
-
<div className="absolute top-0 left-0 right-0 h-0.5 bg-primary z-20 pointer-events-none" />
|
|
82
|
-
)}
|
|
83
|
-
{dragOverId === id && dragAction === 'reorder-below' && (
|
|
84
|
-
<div className="absolute bottom-0 left-0 right-0 h-0.5 bg-primary z-20 pointer-events-none" />
|
|
85
|
-
)}
|
|
86
|
-
<div className="flex items-center gap-2 overflow-hidden flex-1">
|
|
87
|
-
{/* Arrow / Spacer - Fixed Width for Alignment */}
|
|
88
|
-
<div
|
|
89
|
-
onClick={(e) => {
|
|
90
|
-
if (hasChildren && onToggleExpand) {
|
|
91
|
-
e.stopPropagation();
|
|
92
|
-
onToggleExpand(e);
|
|
93
|
-
}
|
|
94
|
-
}}
|
|
95
|
-
className={cn(
|
|
96
|
-
"w-5 h-5 flex items-center justify-center cursor-pointer transition-colors",
|
|
97
|
-
hasChildren ? "" : "pointer-events-none"
|
|
98
|
-
)}
|
|
99
|
-
>
|
|
100
|
-
{hasChildren && (
|
|
101
|
-
<ChevronRight size={12} className={cn("transition-transform", isExpanded ? "rotate-90" : "")} />
|
|
102
|
-
)}
|
|
103
|
-
</div>
|
|
104
|
-
|
|
105
|
-
<div className={cn("flex-shrink-0", isActive ? "text-primary" : "text-muted-foreground group-hover:text-foreground")}>
|
|
106
|
-
{icon}
|
|
107
|
-
</div>
|
|
108
|
-
<span className="truncate" title={label}>{label}</span>
|
|
109
|
-
</div>
|
|
110
|
-
|
|
111
|
-
{/* Right Side: Delete + Count */}
|
|
112
|
-
<div className="flex items-center -mr-1">
|
|
113
|
-
{/* Delete Button */}
|
|
114
|
-
<div
|
|
115
|
-
onClick={(e) => onDelete && onDelete(e)}
|
|
116
|
-
className={cn(
|
|
117
|
-
"w-6 h-6 flex items-center justify-center transition-opacity cursor-pointer mr-0.5",
|
|
118
|
-
onDelete
|
|
119
|
-
? (isActive
|
|
120
|
-
? "opacity-100 text-destructive"
|
|
121
|
-
: "text-muted-foreground/50 hover:text-destructive opacity-100 md:opacity-0 md:group-hover:opacity-100")
|
|
122
|
-
: "pointer-events-none"
|
|
123
|
-
)}
|
|
124
|
-
>
|
|
125
|
-
{onDelete && <Trash2 size={12} />}
|
|
126
|
-
</div>
|
|
127
|
-
|
|
128
|
-
{count !== undefined && (
|
|
129
|
-
<span className="text-xs opacity-60 w-6 text-center tabular-nums text-muted-foreground translate-y-[0.5px]">{count}</span>
|
|
130
|
-
)}
|
|
131
|
-
</div>
|
|
132
|
-
</button>
|
|
133
|
-
);
|
|
134
|
-
});
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
import React, { useEffect } from 'react';
|
|
3
|
-
import { CheckCircle, XCircle, Info, X } from 'lucide-react';
|
|
4
|
-
import { cn } from '../../lib/utils'; // Relative path to lib
|
|
5
|
-
import type { ToastVariantKey } from "./generated/variant-keys";
|
|
6
|
-
import { toastDefaultVariantKey } from "./generated/default-variant-keys";
|
|
7
|
-
|
|
8
|
-
export type ToastType = ToastVariantKey;
|
|
9
|
-
|
|
10
|
-
export interface ToastProps {
|
|
11
|
-
message: string;
|
|
12
|
-
type?: ToastType;
|
|
13
|
-
isVisible: boolean;
|
|
14
|
-
onClose: () => void;
|
|
15
|
-
duration?: number;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function Toast({ message, type = toastDefaultVariantKey, isVisible, onClose, duration = 3000 }: ToastProps) {
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
if (isVisible) {
|
|
21
|
-
const timer = setTimeout(() => {
|
|
22
|
-
onClose();
|
|
23
|
-
}, duration);
|
|
24
|
-
return () => clearTimeout(timer);
|
|
25
|
-
}
|
|
26
|
-
}, [isVisible, duration, onClose]);
|
|
27
|
-
|
|
28
|
-
if (!isVisible) return null;
|
|
29
|
-
|
|
30
|
-
const icons: Record<ToastVariantKey, React.ReactNode> = {
|
|
31
|
-
success: <CheckCircle className="text-success" size={20} />,
|
|
32
|
-
error: <XCircle className="text-destructive" size={20} />,
|
|
33
|
-
info: <Info className="text-info" size={20} />
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const bgColors: Record<ToastVariantKey, string> = {
|
|
37
|
-
success: 'bg-card border-success/20 text-foreground',
|
|
38
|
-
error: 'bg-card border-destructive/20 text-foreground',
|
|
39
|
-
info: 'bg-card border-info/20 text-foreground'
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<div className={cn(
|
|
44
|
-
"fixed top-4 right-4 z-[9999] flex flex-col flex-row items-center w-[384px] max-w-sm w-full md:w-auto gap-3 px-4 py-3 rounded-xl border shadow-2xl animate-in slide-in-from-top-5 fade-in duration-300 pointer-events-auto",
|
|
45
|
-
bgColors[type]
|
|
46
|
-
)}>
|
|
47
|
-
{icons[type]}
|
|
48
|
-
<p className="text-sm font-medium">{message}</p>
|
|
49
|
-
<button
|
|
50
|
-
onClick={onClose}
|
|
51
|
-
className="ml-2 p-1 text-muted-foreground hover:text-foreground rounded-lg transition-colors"
|
|
52
|
-
>
|
|
53
|
-
<X size={14} />
|
|
54
|
-
</button>
|
|
55
|
-
</div>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as TooltipPrimitive from "@radix-ui/react-tooltip"
|
|
5
|
-
|
|
6
|
-
import { cn } from "../../lib/utils"
|
|
7
|
-
|
|
8
|
-
const TooltipProvider = TooltipPrimitive.Provider
|
|
9
|
-
|
|
10
|
-
const Tooltip = TooltipPrimitive.Root
|
|
11
|
-
|
|
12
|
-
const TooltipTrigger = TooltipPrimitive.Trigger
|
|
13
|
-
|
|
14
|
-
const TooltipContent = React.forwardRef<
|
|
15
|
-
React.ElementRef<typeof TooltipPrimitive.Content>,
|
|
16
|
-
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
|
|
17
|
-
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
18
|
-
<TooltipPrimitive.Content
|
|
19
|
-
ref={ref}
|
|
20
|
-
sideOffset={sideOffset}
|
|
21
|
-
className={cn(
|
|
22
|
-
"z-50 flex flex-col w-[168px] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
23
|
-
className
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
27
|
-
))
|
|
28
|
-
TooltipContent.displayName = TooltipPrimitive.Content.displayName
|
|
29
|
-
|
|
30
|
-
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
// Generated by `npm run design:sync:components`. Do not edit manually.
|
|
3
|
-
|
|
4
|
-
import type { AccordionVariantKey, AiChatMessageVariantKey, FilterButtonVariantKey, ListVariantKey, SidebarItemVariantKey, SortButtonVariantKey, ToastVariantKey } from "./variant-keys";
|
|
5
|
-
|
|
6
|
-
export const accordionDefaultVariantKey: AccordionVariantKey = "collapsed";
|
|
7
|
-
export const aiChatMessageDefaultVariantKey: AiChatMessageVariantKey = "assistant";
|
|
8
|
-
export const filterButtonDefaultVariantKey: FilterButtonVariantKey = "default";
|
|
9
|
-
export const listDefaultVariantKey: ListVariantKey = "dot";
|
|
10
|
-
export const sidebarItemDefaultVariantKey: SidebarItemVariantKey = "default";
|
|
11
|
-
export const sortButtonDefaultVariantKey: SortButtonVariantKey = "none";
|
|
12
|
-
export const toastDefaultVariantKey: ToastVariantKey = "success";
|
|
13
|
-
|
|
14
|
-
export const moleculeDefaultVariantKeys = {
|
|
15
|
-
accordion: accordionDefaultVariantKey,
|
|
16
|
-
aiChatMessage: aiChatMessageDefaultVariantKey,
|
|
17
|
-
filterButton: filterButtonDefaultVariantKey,
|
|
18
|
-
list: listDefaultVariantKey,
|
|
19
|
-
sidebarItem: sidebarItemDefaultVariantKey,
|
|
20
|
-
sortButton: sortButtonDefaultVariantKey,
|
|
21
|
-
toast: toastDefaultVariantKey,
|
|
22
|
-
} as const;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
// Generated by `npm run design:sync:components`. Do not edit manually.
|
|
3
|
-
|
|
4
|
-
export const accordionVariantKeys = ["collapsed", "expanded"] as const;
|
|
5
|
-
export type AccordionVariantKey = (typeof accordionVariantKeys)[number];
|
|
6
|
-
|
|
7
|
-
export const aiChatMessageVariantKeys = ["assistant", "user"] as const;
|
|
8
|
-
export type AiChatMessageVariantKey = (typeof aiChatMessageVariantKeys)[number];
|
|
9
|
-
|
|
10
|
-
export const filterButtonVariantKeys = ["default", "popover", "selected"] as const;
|
|
11
|
-
export type FilterButtonVariantKey = (typeof filterButtonVariantKeys)[number];
|
|
12
|
-
|
|
13
|
-
export const listVariantKeys = ["check", "circle", "dot"] as const;
|
|
14
|
-
export type ListVariantKey = (typeof listVariantKeys)[number];
|
|
15
|
-
|
|
16
|
-
export const sidebarItemVariantKeys = ["active", "default"] as const;
|
|
17
|
-
export type SidebarItemVariantKey = (typeof sidebarItemVariantKeys)[number];
|
|
18
|
-
|
|
19
|
-
export const sortButtonVariantKeys = ["asc", "desc", "none"] as const;
|
|
20
|
-
export type SortButtonVariantKey = (typeof sortButtonVariantKeys)[number];
|
|
21
|
-
|
|
22
|
-
export const toastVariantKeys = ["error", "info", "success"] as const;
|
|
23
|
-
export type ToastVariantKey = (typeof toastVariantKeys)[number];
|
|
24
|
-
|
|
25
|
-
export const moleculeVariantKeys = {
|
|
26
|
-
accordion: accordionVariantKeys,
|
|
27
|
-
aiChatMessage: aiChatMessageVariantKeys,
|
|
28
|
-
filterButton: filterButtonVariantKeys,
|
|
29
|
-
list: listVariantKeys,
|
|
30
|
-
sidebarItem: sidebarItemVariantKeys,
|
|
31
|
-
sortButton: sortButtonVariantKeys,
|
|
32
|
-
toast: toastVariantKeys,
|
|
33
|
-
} as const;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import {
|
|
5
|
-
CommandDialog,
|
|
6
|
-
CommandEmpty,
|
|
7
|
-
CommandGroup,
|
|
8
|
-
CommandInput,
|
|
9
|
-
CommandItem,
|
|
10
|
-
CommandList,
|
|
11
|
-
CommandSeparator,
|
|
12
|
-
CommandShortcut,
|
|
13
|
-
} from "../molecules/Command"
|
|
14
|
-
|
|
15
|
-
import { DialogProps } from "@radix-ui/react-dialog"
|
|
16
|
-
|
|
17
|
-
interface ToggleAction {
|
|
18
|
-
id: string
|
|
19
|
-
label: string
|
|
20
|
-
icon?: React.ReactNode
|
|
21
|
-
shortcut?: string
|
|
22
|
-
action: () => void
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
interface CommandPaletteProps extends DialogProps {
|
|
26
|
-
groups: {
|
|
27
|
-
heading: string
|
|
28
|
-
items: ToggleAction[]
|
|
29
|
-
}[]
|
|
30
|
-
placeholder?: string
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function CommandPalette({ groups, placeholder = "Type a command or search...", ...props }: CommandPaletteProps) {
|
|
34
|
-
return (
|
|
35
|
-
<CommandDialog {...props}>
|
|
36
|
-
<div className="flex flex-col w-[480px] max-w-full rounded-lg border">
|
|
37
|
-
<CommandInput placeholder={placeholder} />
|
|
38
|
-
<CommandList>
|
|
39
|
-
<CommandEmpty>No results found.</CommandEmpty>
|
|
40
|
-
{groups.map((group) => (
|
|
41
|
-
<React.Fragment key={group.heading}>
|
|
42
|
-
<CommandGroup heading={group.heading}>
|
|
43
|
-
{group.items.map((item) => (
|
|
44
|
-
<CommandItem key={item.id} onSelect={item.action}>
|
|
45
|
-
{item.icon && <span className="mr-2 h-4 w-4">{item.icon}</span>}
|
|
46
|
-
<span>{item.label}</span>
|
|
47
|
-
{item.shortcut && <CommandShortcut>{item.shortcut}</CommandShortcut>}
|
|
48
|
-
</CommandItem>
|
|
49
|
-
))}
|
|
50
|
-
</CommandGroup>
|
|
51
|
-
<CommandSeparator />
|
|
52
|
-
</React.Fragment>
|
|
53
|
-
))}
|
|
54
|
-
</CommandList>
|
|
55
|
-
</div>
|
|
56
|
-
</CommandDialog>
|
|
57
|
-
)
|
|
58
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { cn } from '../../lib/utils';
|
|
3
|
-
import { motion, HTMLMotionProps } from 'framer-motion';
|
|
4
|
-
|
|
5
|
-
interface FloatingPanelProps extends HTMLMotionProps<"div"> {
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
className?: string;
|
|
8
|
-
variant?: 'glass' | 'solid' | 'ghost';
|
|
9
|
-
title?: string;
|
|
10
|
-
contentClassName?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const FloatingPanel: React.FC<FloatingPanelProps> = ({
|
|
14
|
-
children,
|
|
15
|
-
className,
|
|
16
|
-
variant = 'glass',
|
|
17
|
-
title,
|
|
18
|
-
contentClassName,
|
|
19
|
-
...props
|
|
20
|
-
}) => {
|
|
21
|
-
return (
|
|
22
|
-
<motion.div
|
|
23
|
-
initial={{ opacity: 0, y: 10, scale: 0.98 }}
|
|
24
|
-
animate={{ opacity: 1, y: 0, scale: 1 }}
|
|
25
|
-
exit={{ opacity: 0, y: 10, scale: 0.98 }}
|
|
26
|
-
transition={{ type: 'spring', stiffness: 300, damping: 30 }}
|
|
27
|
-
className={cn(
|
|
28
|
-
"w-[360px] rounded-2xl border flex flex-col overflow-hidden transition-all duration-300 hover:shadow-lg", // Reduced hover shadow intensity
|
|
29
|
-
variant === 'glass' && "bg-background/80 backdrop-blur-md border-border/70",
|
|
30
|
-
variant === 'solid' && "bg-background border-border",
|
|
31
|
-
variant === 'ghost' && "bg-transparent border-transparent shadow-none hover:shadow-none",
|
|
32
|
-
className
|
|
33
|
-
)}
|
|
34
|
-
{...props}
|
|
35
|
-
>
|
|
36
|
-
{title && (
|
|
37
|
-
<div className="px-4 py-3 border-b border-border/60 flex items-center justify-between shrink-0">
|
|
38
|
-
<h3 className="font-semibold text-sm text-foreground">{title}</h3>
|
|
39
|
-
</div>
|
|
40
|
-
)}
|
|
41
|
-
<div className={cn("flex-1 overflow-auto", contentClassName)}>
|
|
42
|
-
{children}
|
|
43
|
-
</div>
|
|
44
|
-
</motion.div>
|
|
45
|
-
);
|
|
46
|
-
};
|