Files
dejanandClaude Opus 5 b8bf987d0e feat(dashboard): Analytics-Dashboard als Gestaltungsvorlage zur Übergabe
UI/UX-Prototyp der Analytics-Dashboards in HiveGrid, fachlich auf einen
SHK-/Handwerksbetrieb zugeschnitten. Ziel ist die Übergabe an die Entwicklung,
nicht der Produktivbetrieb.

Inhalt: sechs Seiten (Übersicht, Finanzen, Aufträge, Kunden, Team, Komponenten),
26 KPIs, neun Chart-Bausteine, Filtersystem mit seitenabhängiger Relevanz und ein
deterministischer Demo-Datensatz (420 Kunden, 1.900 Aufträge, Stichtag 30.07.2026).

Drei Quellen sind zusammengeführt: die fachliche Planung mit dem Branchenpartner
(Januar 2026), die Subframe-Komponentenbibliothek aus dem HiveGrid-Pitch und
IBM Carbon Data Visualization für die Diagrammregeln. Herkunft und bewusste
Abweichungen stehen in docs/HERKUNFT.md.

Dokumentation: README, HANDOVER (was echte Logik braucht), docs/DESIGN-SYSTEM,
KPI-KATALOG, DATENMODELL, NAVIGATION, HERKUNFT, ZIELSYSTEM (Einbauort in
HiveGrid Cloud) und LEITPLANKEN (welche Cloud-Screens als Vorbild taugen).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QPeZNwSeU7qG3RRCwaxEZX
2026-08-29 17:25:20 +02:00

141 lines
3.8 KiB
TypeScript

"use client";
/*
* Documentation:
* Accordion — https://app.subframe.com/f023064a5ca0/library?component=Accordion_d2e81e20-863a-4027-826a-991d8910efd9
* Tree View — https://app.subframe.com/f023064a5ca0/library?component=Tree+View_4ed46422-ecc3-41e8-8787-e55ee10cdc75
*/
import React from "react";
import { FeatherFile } from "@subframe/core";
import { FeatherFolder } from "@subframe/core";
import * as SubframeCore from "@subframe/core";
import * as SubframeUtils from "../../utils";
import { Accordion } from "../Accordion";
export interface FolderProps extends React.ComponentProps<typeof Accordion> {
children?: React.ReactNode;
label?: React.ReactNode;
icon?: React.ReactNode;
className?: string;
}
const Folder = React.forwardRef<
React.ElementRef<typeof Accordion>,
FolderProps
>(function Folder(
{
children,
label,
icon = <FeatherFolder />,
className,
...otherProps
}: FolderProps,
ref
) {
return (
<Accordion
className={SubframeUtils.twClassNames(
"group/c841484c cursor-pointer",
className
)}
defaultOpen={true}
variant="ghost"
trigger={
<div className="flex w-full items-center gap-2 rounded-md px-3 py-2">
{icon ? (
<SubframeCore.IconWrapper className="text-body-small-regular-150 font-body-small-regular-150 text-icon-neutral-primary">
{icon}
</SubframeCore.IconWrapper>
) : null}
{label ? (
<span className="line-clamp-1 grow shrink-0 basis-0 text-body-small-regular-150 font-body-small-regular-150 text-text-neutral-primary">
{label}
</span>
) : null}
<Accordion.Chevron />
</div>
}
ref={ref}
{...otherProps}
>
{children ? (
<div className="flex w-full flex-col items-start gap-1 pl-6 pt-1">
{children}
</div>
) : null}
</Accordion>
);
});
export interface ItemProps extends React.HTMLAttributes<HTMLDivElement> {
selected?: boolean;
label?: React.ReactNode;
icon?: React.ReactNode;
className?: string;
}
const Item = React.forwardRef<HTMLDivElement, ItemProps>(function Item(
{
selected = false,
label,
icon = <FeatherFile />,
className,
...otherProps
}: ItemProps,
ref
) {
return (
<div
className={SubframeUtils.twClassNames(
"group/42786044 flex w-full cursor-pointer items-center gap-2 rounded-md px-3 py-2 hover:bg-surface-neutral-tertiary hover:shadow-sm active:bg-surface-feedback-subtle-information focus-within:shadow-focus",
{ "bg-surface-feedback-subtle-information": selected },
className
)}
ref={ref}
{...otherProps}
>
{icon ? (
<SubframeCore.IconWrapper className="text-body-small-regular-150 font-body-small-regular-150 text-icon-neutral-primary">
{icon}
</SubframeCore.IconWrapper>
) : null}
{label ? (
<span className="line-clamp-1 grow shrink-0 basis-0 text-body-small-regular-150 font-body-small-regular-150 text-text-neutral-primary">
{label}
</span>
) : null}
</div>
);
});
export interface TreeViewRootProps
extends React.HTMLAttributes<HTMLDivElement> {
children?: React.ReactNode;
className?: string;
}
const TreeViewRoot = React.forwardRef<HTMLDivElement, TreeViewRootProps>(
function TreeViewRoot(
{ children, className, ...otherProps }: TreeViewRootProps,
ref
) {
return children ? (
<div
className={SubframeUtils.twClassNames(
"flex w-full flex-col items-start",
className
)}
ref={ref}
{...otherProps}
>
{children}
</div>
) : null;
}
);
export const TreeView = Object.assign(TreeViewRoot, {
Folder,
Item,
});