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
This commit is contained in:
commit
b8bf987d0e
250 files changed
+33153
No files matched your search
@@ -0,0 +1,212 @@
|
||||
// @subframe/sync-disable
|
||||
"use client";
|
||||
/*
|
||||
* Documentation:
|
||||
* Filter Bar — https://app.subframe.com/f023064a5ca0/library?component=Filter+Bar_f2cf6974-3297-4da8-8613-cd00dc1c228e
|
||||
*/
|
||||
|
||||
import React from "react";
|
||||
import { FeatherBriefcase } from "@subframe/core";
|
||||
import { FeatherChevronDown } from "@subframe/core";
|
||||
import { FeatherRotateCcw } from "@subframe/core";
|
||||
import { FeatherSearch } from "@subframe/core";
|
||||
import * as SubframeCore from "@subframe/core";
|
||||
import * as SubframeUtils from "../../utils";
|
||||
|
||||
export interface StatusFilterButtonProps
|
||||
extends React.HTMLAttributes<HTMLDivElement> {
|
||||
icon?: React.ReactNode;
|
||||
label?: React.ReactNode;
|
||||
showCount?: boolean;
|
||||
count?: React.ReactNode;
|
||||
dropdown?: React.ReactNode;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const StatusFilterButton = React.forwardRef<
|
||||
HTMLDivElement,
|
||||
StatusFilterButtonProps
|
||||
>(function StatusFilterButton(
|
||||
{
|
||||
icon = <FeatherBriefcase />,
|
||||
label,
|
||||
showCount = false,
|
||||
count,
|
||||
dropdown,
|
||||
className,
|
||||
...otherProps
|
||||
}: StatusFilterButtonProps,
|
||||
ref
|
||||
) {
|
||||
return (
|
||||
<SubframeCore.DropdownMenu.Root>
|
||||
<SubframeCore.DropdownMenu.Trigger asChild={true}>
|
||||
<div
|
||||
className={SubframeUtils.twClassNames(
|
||||
"group/4ad576dd flex h-6 cursor-pointer items-center gap-0.5 rounded-md border border-solid border-border-default pl-1 pr-0.5 py-1 hover:bg-surface-neutral-tertiary focus-within:shadow-focus",
|
||||
{
|
||||
"border border-solid border-brand-brand-secondary-border-subtle-default bg-surface-feedback-subtle-information-hover pl-px hover:border hover:border-solid hover:border-brand-brand-secondary-border-subtle-hover hover:bg-surface-feedback-subtle-information-hover active:border active:border-solid active:border-brand-brand-secondary-border-subtle-active active:bg-surface-feedback-subtle-information-active focus-within:border focus-within:border-solid focus-within:border-brand-brand-secondary-border-subtle-hover":
|
||||
showCount,
|
||||
},
|
||||
className
|
||||
)}
|
||||
ref={ref}
|
||||
{...otherProps}
|
||||
>
|
||||
<div className="flex items-center gap-1">
|
||||
<div
|
||||
className={SubframeUtils.twClassNames(
|
||||
"hidden h-5 grow shrink-0 basis-0 items-center gap-1 rounded-sm bg-surface-neutral-secondary px-1.5 py-0.5",
|
||||
{ flex: showCount }
|
||||
)}
|
||||
>
|
||||
<div className="flex h-1 w-1 flex-none flex-col items-start gap-2 rounded-round bg-icon-neutral-primary" />
|
||||
{count ? (
|
||||
<span className="text-body-small-medium-0 font-body-small-medium-0 text-text-neutral-primary">
|
||||
{count}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
{icon ? (
|
||||
<SubframeCore.IconWrapper
|
||||
className={SubframeUtils.twClassNames(
|
||||
"text-body-default-regular-150 font-body-default-regular-150 text-icon-neutral-tertiary",
|
||||
{ "text-icon-neutral-primary": showCount }
|
||||
)}
|
||||
>
|
||||
{icon}
|
||||
</SubframeCore.IconWrapper>
|
||||
) : null}
|
||||
{label ? (
|
||||
<span
|
||||
className={SubframeUtils.twClassNames(
|
||||
"text-body-small-regular-0 font-body-small-regular-0 text-text-neutral-tertiary",
|
||||
{ "text-text-neutral-primary": showCount }
|
||||
)}
|
||||
>
|
||||
{label}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
<div className="flex items-center pt-px">
|
||||
<FeatherChevronDown
|
||||
className={SubframeUtils.twClassNames(
|
||||
"text-body-small-regular-150 font-body-small-regular-150 text-icon-neutral-tertiary",
|
||||
{ "text-icon-neutral-primary": showCount }
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</SubframeCore.DropdownMenu.Trigger>
|
||||
<SubframeCore.DropdownMenu.Portal>
|
||||
<SubframeCore.DropdownMenu.Content
|
||||
side="bottom"
|
||||
align="start"
|
||||
sideOffset={4}
|
||||
asChild={true}
|
||||
>
|
||||
{dropdown ? (
|
||||
<div className="items-start contents">{dropdown}</div>
|
||||
) : null}
|
||||
</SubframeCore.DropdownMenu.Content>
|
||||
</SubframeCore.DropdownMenu.Portal>
|
||||
</SubframeCore.DropdownMenu.Root>
|
||||
);
|
||||
});
|
||||
|
||||
export interface FilterBarRootProps
|
||||
extends React.HTMLAttributes<HTMLDivElement> {
|
||||
hideSearch?: boolean;
|
||||
showActiveFilters?: boolean;
|
||||
searchValue?: string;
|
||||
onSearchChange?: (value: string) => void;
|
||||
onClearFilters?: () => void;
|
||||
children?: React.ReactNode;
|
||||
activeFilters?: React.ReactNode;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const FilterBarRoot = React.forwardRef<HTMLDivElement, FilterBarRootProps>(
|
||||
function FilterBarRoot(
|
||||
{
|
||||
hideSearch = false,
|
||||
showActiveFilters = false,
|
||||
searchValue,
|
||||
onSearchChange = () => {},
|
||||
onClearFilters = () => {},
|
||||
children,
|
||||
activeFilters,
|
||||
className,
|
||||
...otherProps
|
||||
}: FilterBarRootProps,
|
||||
ref
|
||||
) {
|
||||
return (
|
||||
<div
|
||||
className={SubframeUtils.twClassNames(
|
||||
"group/f2cf6974 flex w-full flex-col items-start gap-2 rounded-md bg-surface-neutral-secondary px-3 py-2",
|
||||
className
|
||||
)}
|
||||
ref={ref}
|
||||
{...otherProps}
|
||||
>
|
||||
<div className="flex w-full flex-wrap items-center gap-1">
|
||||
<div
|
||||
className={SubframeUtils.twClassNames("flex items-center gap-1.5", {
|
||||
hidden: hideSearch,
|
||||
})}
|
||||
>
|
||||
<FeatherSearch className="text-body-small-regular-150 font-body-small-regular-150 text-icon-neutral-tertiary" />
|
||||
<input
|
||||
className="w-40 flex-none text-body-small-regular-150 font-body-small-regular-150 text-text-neutral-secondary outline-none placeholder:text-text-neutral-subtle"
|
||||
placeholder="Freitext suchen..."
|
||||
value={searchValue}
|
||||
onChange={(event) => onSearchChange(event.target.value)}
|
||||
type="text"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
className={SubframeUtils.twClassNames(
|
||||
"flex h-5 w-px flex-none items-start bg-border-default",
|
||||
{ hidden: hideSearch }
|
||||
)}
|
||||
/>
|
||||
{children ? (
|
||||
<div className="items-start contents">{children}</div>
|
||||
) : null}
|
||||
</div>
|
||||
<div
|
||||
className={SubframeUtils.twClassNames(
|
||||
"hidden w-full flex-wrap items-center gap-1.5 border-t border-solid border-border-default pt-2",
|
||||
{ flex: showActiveFilters }
|
||||
)}
|
||||
>
|
||||
{activeFilters ? (
|
||||
<div className="items-start contents">{activeFilters}</div>
|
||||
) : null}
|
||||
<div
|
||||
className="flex h-6 items-center gap-1 rounded-md border border-solid border-border-negative-subtle bg-surface-feedback-subtle-negative px-1.5 py-1 cursor-pointer hover:bg-surface-feedback-subtle-negative-hover active:bg-surface-feedback-subtle-negative-active focus-within:shadow-focus"
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
onClick={onClearFilters}
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === "Enter" || event.key === " ") {
|
||||
event.preventDefault();
|
||||
onClearFilters();
|
||||
}
|
||||
}}
|
||||
>
|
||||
<FeatherRotateCcw className="text-body-small-regular-150 font-body-small-regular-150 text-icon-feedback-negative" />
|
||||
<span className="whitespace-nowrap text-body-small-regular-0 font-body-small-regular-0 text-text-feedback-negative">
|
||||
Zurücksetzen
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
export const FilterBar = Object.assign(FilterBarRoot, {
|
||||
StatusFilterButton,
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
"use client";
|
||||
import { FilterBar as FilterBarComponent } from "./FilterBar";
|
||||
|
||||
/**
|
||||
* Add wrapper components and business logic here.
|
||||
* If you modify this file, disable Subframe sync for it to prevent overwrites.
|
||||
* Learn more: https://docs.subframe.com/concepts/syncing-components#wrapping-components
|
||||
*/
|
||||
|
||||
export const FilterBar = FilterBarComponent;
|
||||
Reference in new issue
Block a user