@thebuoyant-tsdev/mui-ts-library 1.3.1 → 1.3.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/README.de.md CHANGED
@@ -22,42 +22,13 @@ Eine typsichere React-Komponentenbibliothek auf Basis von **TypeScript** und **M
22
22
 
23
23
  ## Installation
24
24
 
25
- ### Schritt 1 — Paketdatei erstellen
26
-
27
- Dieses Repository klonen und ausführen:
28
-
29
- ```bash
30
- npm install
31
- npm run pack-release
32
- ```
33
-
34
- Dieser Befehl baut die Bibliothek und legt eine fertige Paketdatei im Ordner `releases/` ab:
35
-
36
- ```
37
- releases/thebuoyant-tsdev-mui-ts-library-1.3.0.tgz
38
- ```
39
-
40
- Diese Datei per Slack, E-Mail oder Netzlaufwerk an das Team weitergeben.
41
-
42
- ### Schritt 2 — Im eigenen Projekt installieren
43
-
44
- Ein Terminal im **eigenen React-Projekt** öffnen und ausführen:
45
-
46
- ```bash
47
- npm install /pfad/zur/thebuoyant-tsdev-mui-ts-library-1.3.0.tgz
48
- ```
49
-
50
- **Beispiele:**
25
+ ### Schritt 1 — Bibliothek installieren
51
26
 
52
27
  ```bash
53
- # Datei liegt im Downloads-Ordner
54
- npm install ~/Downloads/thebuoyant-tsdev-mui-ts-library-1.3.0.tgz
55
-
56
- # Datei liegt im Nachbarordner des Projekts
57
- npm install ../thebuoyant-tsdev-mui-ts-library-1.3.0.tgz
28
+ npm install @thebuoyant-tsdev/mui-ts-library
58
29
  ```
59
30
 
60
- ### Schritt 3 — Peer-Dependencies installieren
31
+ ### Schritt 2 — Peer-Dependencies installieren
61
32
 
62
33
  Falls MUI noch nicht im Projekt vorhanden ist:
63
34
 
@@ -65,7 +36,7 @@ Falls MUI noch nicht im Projekt vorhanden ist:
65
36
  npm install react@^19 react-dom@^19 @mui/material@^9 @emotion/react @emotion/styled @mui/icons-material@^9
66
37
  ```
67
38
 
68
- ### Schritt 4 — Fertig
39
+ ### Schritt 3 — Fertig
69
40
 
70
41
  Beliebige Komponente importieren — TypeScript-Typen sind automatisch verfügbar:
71
42
 
package/README.md CHANGED
@@ -22,42 +22,13 @@ A type-safe React component library built on **TypeScript** and **MUI (Material
22
22
 
23
23
  ## Installation
24
24
 
25
- ### Step 1 — Get the package file
26
-
27
- Clone this repository and run:
28
-
29
- ```bash
30
- npm install
31
- npm run pack-release
32
- ```
33
-
34
- This builds the library and places a ready-to-use package file in the `releases/` folder:
35
-
36
- ```
37
- releases/thebuoyant-tsdev-mui-ts-library-1.3.0.tgz
38
- ```
39
-
40
- Share this file with your team via Slack, email, or a network drive.
41
-
42
- ### Step 2 — Install in your project
43
-
44
- Open a terminal in **your own React project** and run:
45
-
46
- ```bash
47
- npm install /path/to/thebuoyant-tsdev-mui-ts-library-1.3.0.tgz
48
- ```
49
-
50
- **Examples:**
25
+ ### Step 1 — Install the library
51
26
 
52
27
  ```bash
53
- # File is in your Downloads folder
54
- npm install ~/Downloads/thebuoyant-tsdev-mui-ts-library-1.3.0.tgz
55
-
56
- # File is next to your project folder
57
- npm install ../thebuoyant-tsdev-mui-ts-library-1.3.0.tgz
28
+ npm install @thebuoyant-tsdev/mui-ts-library
58
29
  ```
59
30
 
60
- ### Step 3 — Install peer dependencies
31
+ ### Step 2 — Install peer dependencies
61
32
 
62
33
  If your project doesn't have MUI set up yet:
63
34
 
@@ -65,9 +36,9 @@ If your project doesn't have MUI set up yet:
65
36
  npm install react@^19 react-dom@^19 @mui/material@^9 @emotion/react @emotion/styled @mui/icons-material@^9
66
37
  ```
67
38
 
68
- ### Step 4 — Done
39
+ ### Step 3 — Done
69
40
 
70
- Import any component and TypeScript types are included automatically:
41
+ Import any component TypeScript types are included automatically:
71
42
 
72
43
  ```tsx
73
44
  import { GanttChart, JsonEditor, useConfirm } from '@thebuoyant-tsdev/mui-ts-library';
@@ -0,0 +1,24 @@
1
+ import type { GanttTask, GanttTaskNode } from "./GanttChart.types";
2
+ import type { TimelineRange } from "./util/gantt-chart.util";
3
+ import type { ActiveDrag, DragType } from "./hooks/useGanttDrag";
4
+ type GanttBarRowProps = {
5
+ task: GanttTaskNode;
6
+ virtualTop?: number;
7
+ activeDrag: ActiveDrag | null;
8
+ displayRange: TimelineRange;
9
+ totalWidth: number;
10
+ gridColumnWidth: number;
11
+ criticalTaskIds: Set<string>;
12
+ draggable?: boolean;
13
+ resizable?: boolean;
14
+ progressDraggable?: boolean;
15
+ onTaskClick?: (task: GanttTask) => void;
16
+ onMilestoneClick?: (task: GanttTask) => void;
17
+ onContextMenu: (task: GanttTaskNode, mouseX: number, mouseY: number) => void;
18
+ suppressClickRef: React.MutableRefObject<boolean>;
19
+ handleBarMouseDown: (e: React.MouseEvent, task: GanttTaskNode, type: DragType) => void;
20
+ handleProgressMouseDown: (e: React.MouseEvent, task: GanttTaskNode, initialProgress: number, barWidthPx: number) => void;
21
+ formatDragDate: (d: Date) => string;
22
+ };
23
+ export declare function GanttBarRow({ task, virtualTop, activeDrag, displayRange, totalWidth, gridColumnWidth, criticalTaskIds, draggable, resizable, progressDraggable, onTaskClick, onMilestoneClick, onContextMenu, suppressClickRef, handleBarMouseDown, handleProgressMouseDown, formatDragDate, }: GanttBarRowProps): import("react/jsx-runtime").JSX.Element;
24
+ export {};
@@ -9,3 +9,7 @@ export declare const BAR_HEIGHT = 16;
9
9
  export declare const STATUS_COL_WIDTH = 90;
10
10
  export declare const ACTIONS_COL_WIDTH = 96;
11
11
  export declare const DIVIDER_WIDTH = 4;
12
+ /** MUI-Farb-Token für Balken und Status-Punkte (bgcolor-kompatibel) */
13
+ export declare const STATUS_BAR_COLOR: Record<string, string>;
14
+ /** MUI-Chip-Color-Werte für den Status-Chip im Task-Panel */
15
+ export declare const STATUS_CHIP_COLOR: Record<string, "default" | "warning" | "info" | "success" | "error">;
@@ -0,0 +1,22 @@
1
+ type DependencyLine = {
2
+ key: string;
3
+ d: string;
4
+ };
5
+ type GanttDependencyArrowsProps = {
6
+ dependencyLines: DependencyLine[];
7
+ todayX: number | null;
8
+ totalWidth: number;
9
+ height: number;
10
+ top: number;
11
+ arrowMarkerId: string;
12
+ };
13
+ /**
14
+ * SVG-Layer über allen Gantt-Balken. Zeichnet:
15
+ * - Z-förmige Abhängigkeitspfeile zwischen Vorgänger und Nachfolger
16
+ * - Vertikale Today-Line am heutigen Datum
17
+ *
18
+ * pointerEvents: none — Klicks auf Balken und Zeilen gehen durch.
19
+ * Farben werden intern via useTheme() / useGanttTheme() gelesen.
20
+ */
21
+ export declare function GanttDependencyArrows({ dependencyLines, todayX, totalWidth, height, top, arrowMarkerId, }: GanttDependencyArrowsProps): import("react/jsx-runtime").JSX.Element | null;
22
+ export {};
@@ -0,0 +1,19 @@
1
+ import type { GanttTaskNode, GanttTaskStatus } from "./GanttChart.types";
2
+ type ContextMenuState = {
3
+ task: GanttTaskNode;
4
+ mouseX: number;
5
+ mouseY: number;
6
+ };
7
+ type GanttStatusContextMenuProps = {
8
+ contextMenu: ContextMenuState | null;
9
+ onClose: () => void;
10
+ /** Wird aufgerufen wenn der User einen Status wählt. Business-Logik (Store-Update,
11
+ * Callbacks) bleibt in GanttTimeline — diese Komponente ist rein präsentational. */
12
+ onSelect: (task: GanttTaskNode, status: GanttTaskStatus) => void;
13
+ };
14
+ /**
15
+ * Rechtsklick-Kontextmenü für schnellen Statuswechsel eines Gantt-Balkens.
16
+ * Übersetzungen werden intern via useGanttTranslations() gelesen.
17
+ */
18
+ export declare function GanttStatusContextMenu({ contextMenu, onClose, onSelect }: GanttStatusContextMenuProps): import("react/jsx-runtime").JSX.Element;
19
+ export {};
@@ -0,0 +1,17 @@
1
+ type WeekendStrip = {
2
+ key: string;
3
+ left: number;
4
+ };
5
+ type GanttWeekendStripsProps = {
6
+ strips: WeekendStrip[];
7
+ totalWidth: number;
8
+ height: number;
9
+ top: number;
10
+ };
11
+ /**
12
+ * Zeichnet halbtransparente Hintergrundstreifen für Wochenend-Spalten
13
+ * in der Tages-Skala. Eigener Layer (pointerEvents: none) damit Klicks
14
+ * auf Balken und Zeilen durchgehen.
15
+ */
16
+ export declare function GanttWeekendStrips({ strips, totalWidth, height, top }: GanttWeekendStripsProps): import("react/jsx-runtime").JSX.Element | null;
17
+ export {};
@@ -0,0 +1,44 @@
1
+ /**
2
+ * useGanttDrag — Kapselt die gesamte Drag & Drop / Resize / Progress-Logik des GanttCharts.
3
+ *
4
+ * Muster für komplexe Interaktions-Hooks (auch für zukünftige Komponenten):
5
+ *
6
+ * 1. STABLE CALLBACK REFS — Callbacks (onTaskMoved, onTaskResized, …) werden in Refs
7
+ * gespiegelt. So können document-Event-Listener immer die aktuellen Props lesen,
8
+ * ohne bei jeder Prop-Änderung neu registriert werden zu müssen.
9
+ *
10
+ * 2. ZWEI-EBENEN STATE — dragInitRef + activeDragRef halten stabile Werte (kein Re-render),
11
+ * setActiveDrag(state) löst nur dann einen Re-render aus wenn die UI aktualisiert
12
+ * werden soll (Balken-Position während des Ziehens). Dadurch kein unnötiges Rendering.
13
+ *
14
+ * 3. DOCUMENT-LEVEL LISTENERS — mousemove/mouseup auf document statt auf dem Element,
15
+ * damit Drag auch funktioniert wenn der Mauszeiger den Balken verlässt.
16
+ *
17
+ * 4. SUPPRESS-CLICK — suppressClickRef verhindert dass ein onClick ausgelöst wird
18
+ * wenn der User eigentlich gezogen hat (≥ 5px Bewegung).
19
+ */
20
+ import type { GanttTask, GanttTaskNode } from "../GanttChart.types";
21
+ import type { TimelineRange } from "../util/gantt-chart.util";
22
+ export type DragType = "move" | "resize" | "progress";
23
+ export type ActiveDrag = {
24
+ taskId: string;
25
+ type: DragType;
26
+ deltaDays: number;
27
+ newProgress?: number;
28
+ };
29
+ type UseGanttDragOptions = {
30
+ totalWidth: number;
31
+ displayRange: TimelineRange;
32
+ onTaskMoved?: (task: GanttTask, newStart: Date, newEnd: Date) => void;
33
+ onTaskResized?: (task: GanttTask, newEnd: Date) => void;
34
+ onTasksChange?: (tasks: GanttTask[]) => void;
35
+ };
36
+ type UseGanttDragReturn = {
37
+ activeDrag: ActiveDrag | null;
38
+ suppressClickRef: React.MutableRefObject<boolean>;
39
+ handleBarMouseDown: (e: React.MouseEvent, task: GanttTaskNode, type: DragType) => void;
40
+ handleProgressMouseDown: (e: React.MouseEvent, task: GanttTaskNode, initialProgress: number, barWidthPx: number) => void;
41
+ formatDragDate: (d: Date) => string;
42
+ };
43
+ export declare function useGanttDrag({ totalWidth, displayRange, onTaskMoved, onTaskResized, onTasksChange, }: UseGanttDragOptions): UseGanttDragReturn;
44
+ export {};
@@ -0,0 +1,12 @@
1
+ type PasswordStrengthBarProps = {
2
+ percent: number;
3
+ color: string;
4
+ ariaLabel: string;
5
+ };
6
+ /**
7
+ * Visuelle Fortschrittsleiste für die Passwortstärke.
8
+ * role="progressbar" macht die Anzeige für Screenreader zugänglich —
9
+ * ohne aria-Attribute wäre sie für assistive Technologien unsichtbar.
10
+ */
11
+ export declare function PasswordStrengthBar({ percent, color, ariaLabel }: PasswordStrengthBarProps): import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -0,0 +1,13 @@
1
+ export type ToolbarButtonProps = {
2
+ label: string;
3
+ icon: React.ReactNode;
4
+ onClick: () => void;
5
+ active?: boolean;
6
+ disabled?: boolean;
7
+ };
8
+ /**
9
+ * Gemeinsamer Toolbar-Button für SqlEditor, JsonEditor und RichTextEditor.
10
+ * Tooltip mit Arrow, kleines Icon-Format, optionaler Active-State (primary color).
11
+ * onMouseDown preventDefault verhindert Fokus-Verlust im Editor beim Klick.
12
+ */
13
+ export declare function ToolbarButton({ label, icon, onClick, active, disabled }: ToolbarButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Wandelt numerische Strings in Zahlen um (für Storybook-Controls),
3
+ * lässt alle anderen Werte unverändert durch.
4
+ *
5
+ * Beispiele:
6
+ * "300" → 300
7
+ * "auto" → "auto"
8
+ * 300 → 300
9
+ * undefined → undefined
10
+ */
11
+ export declare function normalizeSize(val: number | string | undefined): number | string | undefined;