@trinityui/design-system 2.3.1 → 2.10.1
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/CHANGELOG.md +29 -454
- package/dist/{Legend.js → IllustratedMessage.js} +1247 -1204
- package/dist/app-shell.js +2138 -2055
- package/dist/assets/index.d.ts +1 -1
- package/dist/components/AI/InsightEngineInput.d.ts +10 -0
- package/dist/components/AI/InsightEngineInput.d.ts.map +1 -1
- package/dist/components/AI/QueryInput.d.ts +3 -3
- package/dist/components/AI/index.d.ts +1 -1
- package/dist/components/AI/index.d.ts.map +1 -1
- package/dist/components/AIDigestCard/AIDigestCard.d.ts +29 -0
- package/dist/components/AIDigestCard/AIDigestCard.d.ts.map +1 -0
- package/dist/components/AIDigestCard/index.d.ts +9 -0
- package/dist/components/AIDigestCard/index.d.ts.map +1 -0
- package/dist/components/AIDigestCard/types.d.ts +70 -0
- package/dist/components/AIDigestCard/types.d.ts.map +1 -0
- package/dist/components/AppLayout/AIFabLayout.deprecated.d.ts +1 -1
- package/dist/components/AssessmentDrawer/AssessmentDrawer.d.ts +23 -0
- package/dist/components/AssessmentDrawer/AssessmentDrawer.d.ts.map +1 -0
- package/dist/components/AssessmentDrawer/index.d.ts +9 -0
- package/dist/components/AssessmentDrawer/index.d.ts.map +1 -0
- package/dist/components/AssessmentDrawer/types.d.ts +88 -0
- package/dist/components/AssessmentDrawer/types.d.ts.map +1 -0
- package/dist/components/AuditDrawer/AuditDrawer.d.ts +37 -0
- package/dist/components/AuditDrawer/AuditDrawer.d.ts.map +1 -0
- package/dist/components/AuditDrawer/index.d.ts +9 -0
- package/dist/components/AuditDrawer/index.d.ts.map +1 -0
- package/dist/components/AuditDrawer/types.d.ts +116 -0
- package/dist/components/AuditDrawer/types.d.ts.map +1 -0
- package/dist/components/BulkActionDock/BulkActionDock.d.ts +30 -0
- package/dist/components/BulkActionDock/BulkActionDock.d.ts.map +1 -0
- package/dist/components/BulkActionDock/index.d.ts +9 -0
- package/dist/components/BulkActionDock/index.d.ts.map +1 -0
- package/dist/components/BulkActionDock/types.d.ts +71 -0
- package/dist/components/BulkActionDock/types.d.ts.map +1 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +20 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -0
- package/dist/components/DateRangePicker/index.d.ts +9 -0
- package/dist/components/DateRangePicker/index.d.ts.map +1 -0
- package/dist/components/DateRangePicker/types.d.ts +72 -0
- package/dist/components/DateRangePicker/types.d.ts.map +1 -0
- package/dist/components/EntityDetailPanel/EntityDetailPanel.d.ts +17 -0
- package/dist/components/EntityDetailPanel/EntityDetailPanel.d.ts.map +1 -0
- package/dist/components/EntityDetailPanel/index.d.ts +9 -0
- package/dist/components/EntityDetailPanel/index.d.ts.map +1 -0
- package/dist/components/EntityDetailPanel/types.d.ts +108 -0
- package/dist/components/EntityDetailPanel/types.d.ts.map +1 -0
- package/dist/components/GanttView/GanttView.d.ts +25 -0
- package/dist/components/GanttView/GanttView.d.ts.map +1 -0
- package/dist/components/GanttView/index.d.ts +9 -0
- package/dist/components/GanttView/index.d.ts.map +1 -0
- package/dist/components/GanttView/types.d.ts +110 -0
- package/dist/components/GanttView/types.d.ts.map +1 -0
- package/dist/components/GaugeCard/GaugeCard.d.ts +34 -0
- package/dist/components/GaugeCard/GaugeCard.d.ts.map +1 -0
- package/dist/components/GaugeCard/index.d.ts +9 -0
- package/dist/components/GaugeCard/index.d.ts.map +1 -0
- package/dist/components/GaugeCard/types.d.ts +85 -0
- package/dist/components/GaugeCard/types.d.ts.map +1 -0
- package/dist/components/GeoStatusMap/GeoStatusMap.d.ts +17 -0
- package/dist/components/GeoStatusMap/GeoStatusMap.d.ts.map +1 -0
- package/dist/components/GeoStatusMap/index.d.ts +9 -0
- package/dist/components/GeoStatusMap/index.d.ts.map +1 -0
- package/dist/components/GeoStatusMap/types.d.ts +117 -0
- package/dist/components/GeoStatusMap/types.d.ts.map +1 -0
- package/dist/components/HierarchicalDrillDown/HierarchicalDrillDown.d.ts +22 -0
- package/dist/components/HierarchicalDrillDown/HierarchicalDrillDown.d.ts.map +1 -0
- package/dist/components/HierarchicalDrillDown/index.d.ts +9 -0
- package/dist/components/HierarchicalDrillDown/index.d.ts.map +1 -0
- package/dist/components/HierarchicalDrillDown/types.d.ts +81 -0
- package/dist/components/HierarchicalDrillDown/types.d.ts.map +1 -0
- package/dist/components/HistoricalDataIndicator/HistoricalDataIndicator.d.ts +21 -0
- package/dist/components/HistoricalDataIndicator/HistoricalDataIndicator.d.ts.map +1 -0
- package/dist/components/HistoricalDataIndicator/index.d.ts +9 -0
- package/dist/components/HistoricalDataIndicator/index.d.ts.map +1 -0
- package/dist/components/HistoricalDataIndicator/types.d.ts +58 -0
- package/dist/components/HistoricalDataIndicator/types.d.ts.map +1 -0
- package/dist/components/InsightCard/InsightCard.d.ts +27 -0
- package/dist/components/InsightCard/InsightCard.d.ts.map +1 -0
- package/dist/components/InsightCard/index.d.ts +9 -0
- package/dist/components/InsightCard/index.d.ts.map +1 -0
- package/dist/components/InsightCard/types.d.ts +62 -0
- package/dist/components/InsightCard/types.d.ts.map +1 -0
- package/dist/components/NotificationCenter/NotificationCenter.d.ts +31 -0
- package/dist/components/NotificationCenter/NotificationCenter.d.ts.map +1 -0
- package/dist/components/NotificationCenter/index.d.ts +9 -0
- package/dist/components/NotificationCenter/index.d.ts.map +1 -0
- package/dist/components/NotificationCenter/types.d.ts +91 -0
- package/dist/components/NotificationCenter/types.d.ts.map +1 -0
- package/dist/components/OrgChart/OrgChart.d.ts +23 -0
- package/dist/components/OrgChart/OrgChart.d.ts.map +1 -0
- package/dist/components/OrgChart/index.d.ts +9 -0
- package/dist/components/OrgChart/index.d.ts.map +1 -0
- package/dist/components/OrgChart/types.d.ts +81 -0
- package/dist/components/OrgChart/types.d.ts.map +1 -0
- package/dist/components/PageTOC/PageTOC.d.ts +33 -0
- package/dist/components/PageTOC/PageTOC.d.ts.map +1 -0
- package/dist/components/PageTOC/index.d.ts +9 -0
- package/dist/components/PageTOC/index.d.ts.map +1 -0
- package/dist/components/PageTOC/types.d.ts +58 -0
- package/dist/components/PageTOC/types.d.ts.map +1 -0
- package/dist/components/StatusHero/StatusHero.d.ts +31 -0
- package/dist/components/StatusHero/StatusHero.d.ts.map +1 -0
- package/dist/components/StatusHero/index.d.ts +9 -0
- package/dist/components/StatusHero/index.d.ts.map +1 -0
- package/dist/components/StatusHero/types.d.ts +57 -0
- package/dist/components/StatusHero/types.d.ts.map +1 -0
- package/dist/components/SystemBanner/SystemBanner.d.ts +28 -0
- package/dist/components/SystemBanner/SystemBanner.d.ts.map +1 -0
- package/dist/components/SystemBanner/index.d.ts +9 -0
- package/dist/components/SystemBanner/index.d.ts.map +1 -0
- package/dist/components/SystemBanner/types.d.ts +58 -0
- package/dist/components/SystemBanner/types.d.ts.map +1 -0
- package/dist/components/TopRisksStrip/TopRisksStrip.d.ts +26 -0
- package/dist/components/TopRisksStrip/TopRisksStrip.d.ts.map +1 -0
- package/dist/components/TopRisksStrip/index.d.ts +9 -0
- package/dist/components/TopRisksStrip/index.d.ts.map +1 -0
- package/dist/components/TopRisksStrip/types.d.ts +61 -0
- package/dist/components/TopRisksStrip/types.d.ts.map +1 -0
- package/dist/components/templates/Auth/AuthTemplate.d.ts +28 -0
- package/dist/components/templates/Auth/AuthTemplate.d.ts.map +1 -0
- package/dist/components/templates/Auth/index.d.ts +3 -0
- package/dist/components/templates/Auth/index.d.ts.map +1 -0
- package/dist/components/templates/Auth/types.d.ts +67 -0
- package/dist/components/templates/Auth/types.d.ts.map +1 -0
- package/dist/components/templates/Catalog/CatalogTemplate.d.ts +19 -0
- package/dist/components/templates/Catalog/CatalogTemplate.d.ts.map +1 -0
- package/dist/components/templates/Catalog/index.d.ts +3 -0
- package/dist/components/templates/Catalog/index.d.ts.map +1 -0
- package/dist/components/templates/Catalog/types.d.ts +85 -0
- package/dist/components/templates/Catalog/types.d.ts.map +1 -0
- package/dist/components/templates/ConnectorWizard/ConnectorWizardTemplate.d.ts +83 -0
- package/dist/components/templates/ConnectorWizard/ConnectorWizardTemplate.d.ts.map +1 -0
- package/dist/components/templates/ConnectorWizard/index.d.ts +2 -0
- package/dist/components/templates/ConnectorWizard/index.d.ts.map +1 -0
- package/dist/components/templates/ErrorPage/ErrorPageTemplate.d.ts +53 -0
- package/dist/components/templates/ErrorPage/ErrorPageTemplate.d.ts.map +1 -0
- package/dist/components/templates/ErrorPage/index.d.ts +2 -0
- package/dist/components/templates/ErrorPage/index.d.ts.map +1 -0
- package/dist/components/templates/InsightsCenter/InsightsCenterTemplate.d.ts +64 -0
- package/dist/components/templates/InsightsCenter/InsightsCenterTemplate.d.ts.map +1 -0
- package/dist/components/templates/InsightsCenter/index.d.ts +2 -0
- package/dist/components/templates/InsightsCenter/index.d.ts.map +1 -0
- package/dist/components/templates/IntegrationDetail/IntegrationDetailTemplate.d.ts +60 -0
- package/dist/components/templates/IntegrationDetail/IntegrationDetailTemplate.d.ts.map +1 -0
- package/dist/components/templates/IntegrationDetail/index.d.ts +2 -0
- package/dist/components/templates/IntegrationDetail/index.d.ts.map +1 -0
- package/dist/components/templates/Onboarding/OnboardingTemplate.d.ts +63 -0
- package/dist/components/templates/Onboarding/OnboardingTemplate.d.ts.map +1 -0
- package/dist/components/templates/Onboarding/index.d.ts +2 -0
- package/dist/components/templates/Onboarding/index.d.ts.map +1 -0
- package/dist/components/templates/PlanHero/PlanHero.d.ts +20 -0
- package/dist/components/templates/PlanHero/PlanHero.d.ts.map +1 -0
- package/dist/components/templates/PlanHero/index.d.ts +3 -0
- package/dist/components/templates/PlanHero/index.d.ts.map +1 -0
- package/dist/components/templates/PlanHero/types.d.ts +69 -0
- package/dist/components/templates/PlanHero/types.d.ts.map +1 -0
- package/dist/components/templates/Report/ReportTemplate.d.ts +74 -0
- package/dist/components/templates/Report/ReportTemplate.d.ts.map +1 -0
- package/dist/components/templates/Report/index.d.ts +2 -0
- package/dist/components/templates/Report/index.d.ts.map +1 -0
- package/dist/components/templates/Wizard/WizardTemplate.d.ts +81 -0
- package/dist/components/templates/Wizard/WizardTemplate.d.ts.map +1 -0
- package/dist/components/templates/Wizard/index.d.ts +2 -0
- package/dist/components/templates/Wizard/index.d.ts.map +1 -0
- package/dist/components/templates/index.d.ts +10 -0
- package/dist/components/templates/index.d.ts.map +1 -1
- package/dist/essentials.js +1 -1
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49113 -41408
- package/dist/trinity.css +1 -1
- package/package.json +11 -4
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Types for BulkActionDock — floating dock that appears when
|
|
3
|
+
* users select rows in a DataTable (or similar list).
|
|
4
|
+
*/
|
|
5
|
+
import type { ReactNode } from 'react';
|
|
6
|
+
import type { SxProps, Theme } from '@mui/material';
|
|
7
|
+
/**
|
|
8
|
+
* A single action button shown in the dock.
|
|
9
|
+
*
|
|
10
|
+
* Variants:
|
|
11
|
+
* - default — primary action button
|
|
12
|
+
* - subtle — quieter outlined button (e.g. "Export")
|
|
13
|
+
* - destructive — error-tinted (e.g. "Delete")
|
|
14
|
+
*/
|
|
15
|
+
export interface BulkAction {
|
|
16
|
+
/** Stable id for analytics + tests. */
|
|
17
|
+
id: string;
|
|
18
|
+
/** Button label. */
|
|
19
|
+
label: string;
|
|
20
|
+
/** Optional leading icon (react-feather component). */
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
/** Called when the action button is clicked. Receives the selected ids. */
|
|
23
|
+
onClick: (selectedIds: ReadonlyArray<string>) => void;
|
|
24
|
+
/** Disabled state. */
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/** Visual treatment. Default `default`. */
|
|
27
|
+
variant?: 'default' | 'subtle' | 'destructive';
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Position of the dock relative to its container.
|
|
31
|
+
*
|
|
32
|
+
* - `bottom-center` (default) — common chrome pattern; floats above table
|
|
33
|
+
* - `bottom-right` — for layouts where the right side is more discoverable
|
|
34
|
+
* - `inline` — sits in document flow instead of fixed-positioning (use when the
|
|
35
|
+
* parent already manages absolute layout, e.g. inside a custom sheet)
|
|
36
|
+
*/
|
|
37
|
+
export type BulkActionDockPosition = 'bottom-center' | 'bottom-right' | 'inline';
|
|
38
|
+
/**
|
|
39
|
+
* Props for BulkActionDock.
|
|
40
|
+
*
|
|
41
|
+
* Standard pattern: render this directly under a DataTable, controlled by the
|
|
42
|
+
* table's selection state. The dock auto-hides when `selectedIds.length === 0`
|
|
43
|
+
* unless `alwaysVisible` is set.
|
|
44
|
+
*/
|
|
45
|
+
export interface BulkActionDockProps {
|
|
46
|
+
/** Currently selected row ids. Drives count display and is forwarded to each action handler. */
|
|
47
|
+
selectedIds: ReadonlyArray<string>;
|
|
48
|
+
/** Bulk actions exposed in the dock. Order = display order. Keep to 1-4 for readability. */
|
|
49
|
+
actions: ReadonlyArray<BulkAction>;
|
|
50
|
+
/** Custom label override. Default `"{count} selected"`. */
|
|
51
|
+
selectionLabel?: (count: number) => string;
|
|
52
|
+
/** Called when the X clear button is clicked. */
|
|
53
|
+
onClearSelection?: () => void;
|
|
54
|
+
/** Position of the dock. Default `bottom-center`. */
|
|
55
|
+
position?: BulkActionDockPosition;
|
|
56
|
+
/** Force dock visibility even when no rows are selected. Default `false`. */
|
|
57
|
+
alwaysVisible?: boolean;
|
|
58
|
+
/** Width of the dock (px). Default `auto` — sizes to content. */
|
|
59
|
+
width?: number | string;
|
|
60
|
+
/** Maximum dock width before content wraps / scrolls. Default `720`. */
|
|
61
|
+
maxWidth?: number | string;
|
|
62
|
+
/** Optional left slot — typically a status indicator or summary chip. */
|
|
63
|
+
leadingSlot?: ReactNode;
|
|
64
|
+
/** Optional trailing slot rendered before the clear button. */
|
|
65
|
+
trailingSlot?: ReactNode;
|
|
66
|
+
/** sx for the root dock container. */
|
|
67
|
+
sx?: SxProps<Theme>;
|
|
68
|
+
/** Accessible label override for the dock region. Falls back to "Bulk actions". */
|
|
69
|
+
ariaLabel?: string;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/BulkActionDock/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,2EAA2E;IAC3E,OAAO,EAAE,CAAC,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACtD,sBAAsB;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,aAAa,CAAC;CAChD;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,sBAAsB,GAAG,eAAe,GAAG,cAAc,GAAG,QAAQ,CAAC;AAEjF;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,gGAAgG;IAChG,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACnC,4FAA4F;IAC5F,OAAO,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IACnC,2DAA2D;IAC3D,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,iDAAiD;IACjD,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,qDAAqD;IACrD,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,6EAA6E;IAC7E,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,yEAAyE;IACzE,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,+DAA+D;IAC/D,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,sCAAsC;IACtC,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,mFAAmF;IACnF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview DateRangePicker — compact two-date range input with calendar popover.
|
|
3
|
+
*
|
|
4
|
+
* Built from MUI primitives (no @mui/x-date-pickers dependency). Designed for
|
|
5
|
+
* dashboard filter bars where space is tight and quick presets are essential.
|
|
6
|
+
*
|
|
7
|
+
* @module components/DateRangePicker
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* import { DateRangePicker, type DateRange } from '@trinityui/design-system';
|
|
11
|
+
* const [range, setRange] = useState<DateRange>({ start: null, end: null });
|
|
12
|
+
*
|
|
13
|
+
* <DateRangePicker value={range} onChange={setRange} label="Reporting period" />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
import * as React from 'react';
|
|
17
|
+
import type { DateRangePickerProps } from './types';
|
|
18
|
+
export declare const DateRangePicker: React.ForwardRefExoticComponent<DateRangePickerProps & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
export default DateRangePicker;
|
|
20
|
+
//# sourceMappingURL=DateRangePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateRangePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/DateRangePicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAqB/B,OAAO,KAAK,EAEV,oBAAoB,EAErB,MAAM,SAAS,CAAC;AAySjB,eAAO,MAAM,eAAe,6FA+T1B,CAAC;AAEH,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* DateRangePicker barrel.
|
|
4
|
+
*
|
|
5
|
+
* PUBLIC API: Import from '@trinityui/design-system' instead.
|
|
6
|
+
*/
|
|
7
|
+
export { DateRangePicker, default as DateRangePickerDefault, } from './DateRangePicker';
|
|
8
|
+
export type { DateRange, DateRangePickerProps, DateRangePickerSize, DateRangePreset, } from './types';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,eAAe,EACf,OAAO,IAAI,sBAAsB,GAClC,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,SAAS,EACT,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,GAChB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Types for DateRangePicker — compact two-date range input with calendar popover.
|
|
3
|
+
*/
|
|
4
|
+
import type { SxProps, Theme } from '@mui/material';
|
|
5
|
+
/**
|
|
6
|
+
* A simple range tuple. Either end can be `null` while the user is mid-selection.
|
|
7
|
+
*/
|
|
8
|
+
export interface DateRange {
|
|
9
|
+
start: Date | null;
|
|
10
|
+
end: Date | null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Pre-defined quick-pick options shown in the popover sidebar.
|
|
14
|
+
*/
|
|
15
|
+
export interface DateRangePreset {
|
|
16
|
+
/** Display label (e.g. "Last 7 days") */
|
|
17
|
+
label: string;
|
|
18
|
+
/** Resolver that returns the start/end pair for "today". */
|
|
19
|
+
getRange: (today: Date) => DateRange;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Visual sizing.
|
|
23
|
+
*/
|
|
24
|
+
export type DateRangePickerSize = 'small' | 'medium';
|
|
25
|
+
/**
|
|
26
|
+
* Props for DateRangePicker.
|
|
27
|
+
*/
|
|
28
|
+
export interface DateRangePickerProps {
|
|
29
|
+
/** The currently selected range. */
|
|
30
|
+
value: DateRange;
|
|
31
|
+
/** Called when the user commits a new range. */
|
|
32
|
+
onChange: (value: DateRange) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Pre-defined quick-pick presets shown alongside the calendar.
|
|
35
|
+
* If omitted, sensible defaults are provided (Today / Last 7 / Last 30 / This month / Last month).
|
|
36
|
+
*/
|
|
37
|
+
presets?: DateRangePreset[];
|
|
38
|
+
/** Optional minimum selectable date. */
|
|
39
|
+
minDate?: Date;
|
|
40
|
+
/** Optional maximum selectable date. Defaults to the user's "today". */
|
|
41
|
+
maxDate?: Date;
|
|
42
|
+
/** Field label rendered above the trigger. */
|
|
43
|
+
label?: string;
|
|
44
|
+
/** Placeholder shown when no range is selected. Default `"Select date range"`. */
|
|
45
|
+
placeholder?: string;
|
|
46
|
+
/** Input size. Default `medium`. */
|
|
47
|
+
size?: DateRangePickerSize;
|
|
48
|
+
/** Mark the field as disabled. */
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
/** Mark the field as required. */
|
|
51
|
+
required?: boolean;
|
|
52
|
+
/** Error message; renders the input in error state. */
|
|
53
|
+
error?: string;
|
|
54
|
+
/** Helper text shown below when there's no error. */
|
|
55
|
+
helperText?: string;
|
|
56
|
+
/** Display the dates using this format string. Default `"MMM d, yyyy"`. */
|
|
57
|
+
format?: 'short' | 'medium' | 'long' | 'iso';
|
|
58
|
+
/** Locale used for month names and day-of-week labels. Default the browser's. */
|
|
59
|
+
locale?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Number of months rendered side-by-side. Default `2`.
|
|
62
|
+
* Use `1` for tighter layouts.
|
|
63
|
+
*/
|
|
64
|
+
numberOfMonths?: 1 | 2;
|
|
65
|
+
/** sx overrides for the root container. */
|
|
66
|
+
sx?: SxProps<Theme>;
|
|
67
|
+
/** Field id for label association. */
|
|
68
|
+
id?: string;
|
|
69
|
+
/** Accessible label override for the trigger button. */
|
|
70
|
+
ariaLabel?: string;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/DateRangePicker/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,GAAG,EAAE,IAAI,GAAG,IAAI,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,SAAS,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,oCAAoC;IACpC,KAAK,EAAE,SAAS,CAAC;IACjB,gDAAgD;IAChD,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,wCAAwC;IACxC,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,wEAAwE;IACxE,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,kCAAkC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;IAC7C,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACvB,2CAA2C;IAC3C,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,sCAAsC;IACtC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview EntityDetailPanel — right-side drawer for full entity detail.
|
|
3
|
+
*
|
|
4
|
+
* Visual: sticky header with title + subtitle + status pill + actions,
|
|
5
|
+
* optional tab strip, scrollable body with one tab's content visible,
|
|
6
|
+
* optional sticky footer slot.
|
|
7
|
+
*
|
|
8
|
+
* Field sections render as a 2-column grid (label left, value right) at
|
|
9
|
+
* desktop width; collapse to single column on narrow viewports.
|
|
10
|
+
*
|
|
11
|
+
* @module components/EntityDetailPanel
|
|
12
|
+
*/
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import type { EntityDetailPanelProps } from './types';
|
|
15
|
+
export declare const EntityDetailPanel: React.ForwardRefExoticComponent<EntityDetailPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export default EntityDetailPanel;
|
|
17
|
+
//# sourceMappingURL=EntityDetailPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EntityDetailPanel.d.ts","sourceRoot":"","sources":["../../../src/components/EntityDetailPanel/EntityDetailPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B,OAAO,KAAK,EACV,sBAAsB,EAKvB,MAAM,SAAS,CAAC;AA0KjB,eAAO,MAAM,iBAAiB,+FAkO5B,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* EntityDetailPanel barrel.
|
|
4
|
+
*
|
|
5
|
+
* PUBLIC API: Import from '@trinityui/design-system' instead.
|
|
6
|
+
*/
|
|
7
|
+
export { EntityDetailPanel, default as EntityDetailPanelDefault, } from './EntityDetailPanel';
|
|
8
|
+
export type { EntityDetailPanelProps, EntityDetailTab, EntityFieldSection, EntityField, EntityStatus, EntityStatusVariant, } from './types';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/EntityDetailPanel/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,iBAAiB,EACjB,OAAO,IAAI,wBAAwB,GACpC,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACV,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,mBAAmB,GACpB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Types for EntityDetailPanel — right-side drawer showing
|
|
3
|
+
* full detail for a single entity (subject, study, site, document, etc.).
|
|
4
|
+
*/
|
|
5
|
+
import type { ReactNode } from 'react';
|
|
6
|
+
import type { SxProps, Theme } from '@mui/material';
|
|
7
|
+
/**
|
|
8
|
+
* A field/value pair rendered in a section.
|
|
9
|
+
*
|
|
10
|
+
* Trinity convention: `label` is short (1-3 words) and value is short-ish
|
|
11
|
+
* (a status chip, a number, a name). Long-form content belongs in the
|
|
12
|
+
* tab content slot, not in a field list.
|
|
13
|
+
*/
|
|
14
|
+
export interface EntityField {
|
|
15
|
+
/** Stable id for React keys. */
|
|
16
|
+
id: string;
|
|
17
|
+
/** Field name. Short. */
|
|
18
|
+
label: ReactNode;
|
|
19
|
+
/** Field value. Plain text or rendered chip / link / etc. */
|
|
20
|
+
value: ReactNode;
|
|
21
|
+
/** Optional tooltip or helper text shown beside the label. */
|
|
22
|
+
helperText?: string;
|
|
23
|
+
/** When true, render full-width (label above value). Default false. */
|
|
24
|
+
fullWidth?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A grouped section of fields rendered inside a tab.
|
|
28
|
+
*/
|
|
29
|
+
export interface EntityFieldSection {
|
|
30
|
+
/** Stable id. */
|
|
31
|
+
id: string;
|
|
32
|
+
/** Section heading. */
|
|
33
|
+
title: ReactNode;
|
|
34
|
+
/** Field rows. */
|
|
35
|
+
fields: ReadonlyArray<EntityField>;
|
|
36
|
+
/** Optional section action — typically an edit button. */
|
|
37
|
+
action?: ReactNode;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A tab definition. The body of each tab is content-flexible — pass field
|
|
41
|
+
* sections via `fieldSections` for the standard label/value layout, or
|
|
42
|
+
* pass a custom `content` slot for full layout control.
|
|
43
|
+
*/
|
|
44
|
+
export interface EntityDetailTab {
|
|
45
|
+
/** Stable id. Used as React key and as the tab value. */
|
|
46
|
+
id: string;
|
|
47
|
+
/** Tab label. */
|
|
48
|
+
label: ReactNode;
|
|
49
|
+
/** Optional count badge to show beside the label. */
|
|
50
|
+
count?: number;
|
|
51
|
+
/** Optional icon shown left of the label. */
|
|
52
|
+
icon?: ReactNode;
|
|
53
|
+
/** Field sections to render inside this tab. */
|
|
54
|
+
fieldSections?: ReadonlyArray<EntityFieldSection>;
|
|
55
|
+
/** Custom content (overrides `fieldSections` if both supplied). */
|
|
56
|
+
content?: ReactNode;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Status pill displayed in the header below the title.
|
|
60
|
+
*
|
|
61
|
+
* Color maps via:
|
|
62
|
+
* - `success` → palette.success.main
|
|
63
|
+
* - `warning` → palette.warning.main
|
|
64
|
+
* - `error` → palette.error.main
|
|
65
|
+
* - `info` → palette.info.main
|
|
66
|
+
* - `neutral` → palette.text.disabled (muted)
|
|
67
|
+
*/
|
|
68
|
+
export type EntityStatusVariant = 'success' | 'warning' | 'error' | 'info' | 'neutral';
|
|
69
|
+
export interface EntityStatus {
|
|
70
|
+
label: ReactNode;
|
|
71
|
+
variant?: EntityStatusVariant;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Props for EntityDetailPanel.
|
|
75
|
+
*/
|
|
76
|
+
export interface EntityDetailPanelProps {
|
|
77
|
+
/** Open state. Controlled. */
|
|
78
|
+
open: boolean;
|
|
79
|
+
/** Close handler. */
|
|
80
|
+
onClose: () => void;
|
|
81
|
+
/** Entity title — primary identifier (e.g. "Subject 042"). */
|
|
82
|
+
title: ReactNode;
|
|
83
|
+
/** Secondary label below title (e.g. "TX-204 · Site 022"). */
|
|
84
|
+
subtitle?: ReactNode;
|
|
85
|
+
/** Optional status pill. */
|
|
86
|
+
status?: EntityStatus;
|
|
87
|
+
/** Optional leading slot — typically an Avatar. */
|
|
88
|
+
leadingSlot?: ReactNode;
|
|
89
|
+
/** Optional header action slot (e.g. Edit button). */
|
|
90
|
+
headerActions?: ReactNode;
|
|
91
|
+
/** Tabs to render. Pass at least one. */
|
|
92
|
+
tabs: ReadonlyArray<EntityDetailTab>;
|
|
93
|
+
/** Currently active tab id. Defaults to the first tab. */
|
|
94
|
+
activeTabId?: string;
|
|
95
|
+
/** Called when the active tab changes. */
|
|
96
|
+
onTabChange?: (id: string) => void;
|
|
97
|
+
/** Footer slot — typically related-entity chips or "View audit" link. */
|
|
98
|
+
footer?: ReactNode;
|
|
99
|
+
/** Drawer width. Default 520. */
|
|
100
|
+
width?: number | string;
|
|
101
|
+
/** Hide tab strip (single-tab panels). Default false — auto-hides if tabs.length === 1. */
|
|
102
|
+
hideTabs?: boolean;
|
|
103
|
+
/** sx for the drawer paper. */
|
|
104
|
+
paperSx?: SxProps<Theme>;
|
|
105
|
+
/** Accessible label override. */
|
|
106
|
+
ariaLabel?: string;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/EntityDetailPanel/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEpD;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,gCAAgC;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,yBAAyB;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,6DAA6D;IAC7D,KAAK,EAAE,SAAS,CAAC;IACjB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,iBAAiB;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,uBAAuB;IACvB,KAAK,EAAE,SAAS,CAAC;IACjB,kBAAkB;IAClB,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IACnC,0DAA0D;IAC1D,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,iBA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;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACzB,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview GanttView — horizontal timeline with task bars.
|
|
3
|
+
*
|
|
4
|
+
* Layout: 2-column grid. Left column is a fixed-width task list; right column
|
|
5
|
+
* is a horizontally-scrollable timeline. Both columns share row heights so
|
|
6
|
+
* each bar visually aligns to its label row.
|
|
7
|
+
*
|
|
8
|
+
* Time math: a single horizontal coordinate per task is computed from
|
|
9
|
+
* `(taskStart - rangeStart) / msPerTick * tickWidth`. No external date lib
|
|
10
|
+
* needed — Date arithmetic is sufficient for day/week/month/quarter grids.
|
|
11
|
+
*
|
|
12
|
+
* Dependencies: rendered as SVG paths in an overlay layer above the bars.
|
|
13
|
+
* Each arrow goes from one task's right edge to the dependent's left edge
|
|
14
|
+
* via an L-shaped elbow (right → down → right).
|
|
15
|
+
*
|
|
16
|
+
* @module components/GanttView
|
|
17
|
+
*/
|
|
18
|
+
import * as React from 'react';
|
|
19
|
+
import type { GanttViewProps } from './types';
|
|
20
|
+
/**
|
|
21
|
+
* Render task list + timeline as a synchronized two-pane layout.
|
|
22
|
+
*/
|
|
23
|
+
export declare const GanttView: React.ForwardRefExoticComponent<GanttViewProps & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
export default GanttView;
|
|
25
|
+
//# sourceMappingURL=GanttView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GanttView.d.ts","sourceRoot":"","sources":["../../../src/components/GanttView/GanttView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B,OAAO,KAAK,EACV,cAAc,EAKf,MAAM,SAAS,CAAC;AA2IjB;;GAEG;AACH,eAAO,MAAM,SAAS,uFAwmBrB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* GanttView barrel.
|
|
4
|
+
*
|
|
5
|
+
* PUBLIC API: Import from '@trinityui/design-system' instead.
|
|
6
|
+
*/
|
|
7
|
+
export { GanttView, default as GanttViewDefault } from './GanttView';
|
|
8
|
+
export type { GanttViewProps, GanttTask, GanttGroup, GanttGranularity, GanttSeverity, } from './types';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/GanttView/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAErE,YAAY,EACV,cAAc,EACd,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,aAAa,GACd,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Types for GanttView — horizontal timeline with task bars,
|
|
3
|
+
* groupings, milestones, dependencies, and today line.
|
|
4
|
+
*/
|
|
5
|
+
import type { ReactNode } from 'react';
|
|
6
|
+
import type { SxProps, Theme } from '@mui/material';
|
|
7
|
+
/**
|
|
8
|
+
* Severity for task bars + milestones.
|
|
9
|
+
*
|
|
10
|
+
* Maps to `theme.palette.<severity>.main`.
|
|
11
|
+
* - `success` — completed / on track
|
|
12
|
+
* - `warning` — at-risk / approaching threshold
|
|
13
|
+
* - `error` — off-track / overdue
|
|
14
|
+
* - `info` — informational / neutral
|
|
15
|
+
* - `neutral` — pending / not started
|
|
16
|
+
*/
|
|
17
|
+
export type GanttSeverity = 'success' | 'warning' | 'error' | 'info' | 'neutral';
|
|
18
|
+
/**
|
|
19
|
+
* A single task rendered as a horizontal bar.
|
|
20
|
+
*/
|
|
21
|
+
export interface GanttTask {
|
|
22
|
+
/** Stable id. */
|
|
23
|
+
id: string;
|
|
24
|
+
/** Display label in the left-hand task list. */
|
|
25
|
+
label: ReactNode;
|
|
26
|
+
/** Optional secondary text shown under the label. */
|
|
27
|
+
description?: ReactNode;
|
|
28
|
+
/** Start (inclusive). Date or ISO string. */
|
|
29
|
+
start: Date | string;
|
|
30
|
+
/** End (exclusive). Date or ISO string. */
|
|
31
|
+
end: Date | string;
|
|
32
|
+
/** Optional severity (drives bar color). Default `info`. */
|
|
33
|
+
severity?: GanttSeverity;
|
|
34
|
+
/** Optional completion 0..1 — when set, shows a darker fill from start to that fraction. */
|
|
35
|
+
progress?: number;
|
|
36
|
+
/** Optional ids of tasks this depends on — renders arrow from each dependency's end to this task's start. */
|
|
37
|
+
dependsOn?: ReadonlyArray<string>;
|
|
38
|
+
/** Optional assignee — rendered as short text on the bar. */
|
|
39
|
+
assignee?: string;
|
|
40
|
+
/** Marked as a milestone — renders as a diamond marker instead of a bar (uses `start` only). */
|
|
41
|
+
milestone?: boolean;
|
|
42
|
+
/** Disabled — dim out the bar. */
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Optional grouping — render a group header row above its children.
|
|
47
|
+
*
|
|
48
|
+
* Groups span the full date range of their children (or the explicit
|
|
49
|
+
* `start`/`end` if provided). Clicking the chevron collapses the group.
|
|
50
|
+
*/
|
|
51
|
+
export interface GanttGroup {
|
|
52
|
+
/** Stable id. */
|
|
53
|
+
id: string;
|
|
54
|
+
/** Group label. */
|
|
55
|
+
label: ReactNode;
|
|
56
|
+
/** Members. */
|
|
57
|
+
tasks: ReadonlyArray<GanttTask>;
|
|
58
|
+
/** Optional explicit start (overrides auto-derived span). */
|
|
59
|
+
start?: Date | string;
|
|
60
|
+
/** Optional explicit end (overrides auto-derived span). */
|
|
61
|
+
end?: Date | string;
|
|
62
|
+
/** When true, group is collapsed (members hidden). Default false. */
|
|
63
|
+
collapsed?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Timeline tick granularity.
|
|
67
|
+
*
|
|
68
|
+
* Drives header label format + vertical grid spacing.
|
|
69
|
+
*/
|
|
70
|
+
export type GanttGranularity = 'day' | 'week' | 'month' | 'quarter';
|
|
71
|
+
/**
|
|
72
|
+
* Props for GanttView.
|
|
73
|
+
*/
|
|
74
|
+
export interface GanttViewProps {
|
|
75
|
+
/** Tasks (top-level — use \`groups\` to render hierarchical structure). */
|
|
76
|
+
tasks?: ReadonlyArray<GanttTask>;
|
|
77
|
+
/** Optional groups — group header + member tasks. Mutually exclusive with top-level \`tasks\`. */
|
|
78
|
+
groups?: ReadonlyArray<GanttGroup>;
|
|
79
|
+
/** Timeline start. Defaults to earliest task start (rounded down to granularity). */
|
|
80
|
+
rangeStart?: Date | string;
|
|
81
|
+
/** Timeline end. Defaults to latest task end (rounded up to granularity). */
|
|
82
|
+
rangeEnd?: Date | string;
|
|
83
|
+
/** Header granularity. Default `week`. */
|
|
84
|
+
granularity?: GanttGranularity;
|
|
85
|
+
/** Pixel width per granularity tick. Default 80. */
|
|
86
|
+
tickWidth?: number;
|
|
87
|
+
/** Row height. Default 36. */
|
|
88
|
+
rowHeight?: number;
|
|
89
|
+
/** Left-side label column width. Default 220. */
|
|
90
|
+
labelColumnWidth?: number;
|
|
91
|
+
/** Maximum visible height before vertical scroll engages. Default 480. */
|
|
92
|
+
maxHeight?: number | string;
|
|
93
|
+
/** Show today line (vertical dashed). Default true. */
|
|
94
|
+
showToday?: boolean;
|
|
95
|
+
/** Currently selected task id. */
|
|
96
|
+
selectedId?: string;
|
|
97
|
+
/** Called when a task or milestone is clicked. */
|
|
98
|
+
onSelect?: (task: GanttTask) => void;
|
|
99
|
+
/** Called when a group chevron is clicked. */
|
|
100
|
+
onGroupToggle?: (group: GanttGroup) => void;
|
|
101
|
+
/** Render custom task content (overrides default label rendering inside the bar). */
|
|
102
|
+
renderTaskBar?: (task: GanttTask) => ReactNode;
|
|
103
|
+
/** Hide the dependency arrows. Default false (arrows drawn when `dependsOn` is set). */
|
|
104
|
+
hideDependencies?: boolean;
|
|
105
|
+
/** sx for the root container. */
|
|
106
|
+
sx?: SxProps<Theme>;
|
|
107
|
+
/** Accessible label override. Default "Gantt timeline". */
|
|
108
|
+
ariaLabel?: string;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/GanttView/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEpD;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAEjF;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,iBAAiB;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,gDAAgD;IAChD,KAAK,EAAE,SAAS,CAAC;IACjB,qDAAqD;IACrD,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,6CAA6C;IAC7C,KAAK,EAAE,IAAI,GAAG,MAAM,CAAC;IACrB,2CAA2C;IAC3C,GAAG,EAAE,IAAI,GAAG,MAAM,CAAC;IACnB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,4FAA4F;IAC5F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6GAA6G;IAC7G,SAAS,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAClC,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gGAAgG;IAChG,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED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CAA8C;IAC9C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAC5C,qFAAqF;IACrF,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,SAAS,CAAC;IAC/C,wFAAwF;IACxF,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iCAAiC;IACjC,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview GaugeCard — KPI card with arc gauge visualization.
|
|
3
|
+
*
|
|
4
|
+
* Visual: 220° arc (speedometer style) sweeping from 7 o'clock to 5 o'clock,
|
|
5
|
+
* with the value text + label below. Track is rendered with semantic border
|
|
6
|
+
* color; the fill arc uses the severity color from `theme.palette`.
|
|
7
|
+
*
|
|
8
|
+
* Why SVG and not Highcharts: a single gauge can be drawn in ~5 path lines
|
|
9
|
+
* with no chart dependency. Avoids bundle bloat for a primitive that's used
|
|
10
|
+
* in many KPI dashboard tiles.
|
|
11
|
+
*
|
|
12
|
+
* @module components/GaugeCard
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <GaugeCard
|
|
16
|
+
* label="Protocol adherence"
|
|
17
|
+
* value={87.2}
|
|
18
|
+
* unit="%"
|
|
19
|
+
* precision={1}
|
|
20
|
+
* target={90}
|
|
21
|
+
* thresholds={[
|
|
22
|
+
* { from: 0, to: 70, severity: 'error' },
|
|
23
|
+
* { from: 70, to: 90, severity: 'warning' },
|
|
24
|
+
* { from: 90, to: 100, severity: 'success' },
|
|
25
|
+
* ]}
|
|
26
|
+
* caption="vs 84.1% last period"
|
|
27
|
+
* />
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
import * as React from 'react';
|
|
31
|
+
import type { GaugeCardProps } from './types';
|
|
32
|
+
export declare const GaugeCard: React.ForwardRefExoticComponent<GaugeCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
export default GaugeCard;
|
|
34
|
+
//# sourceMappingURL=GaugeCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GaugeCard.d.ts","sourceRoot":"","sources":["../../../src/components/GaugeCard/GaugeCard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EACV,cAAc,EAIf,MAAM,SAAS,CAAC;AAoNjB,eAAO,MAAM,SAAS,uFAgLrB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* GaugeCard barrel.
|
|
4
|
+
*
|
|
5
|
+
* PUBLIC API: Import from '@trinityui/design-system' instead.
|
|
6
|
+
*/
|
|
7
|
+
export { GaugeCard, default as GaugeCardDefault } from './GaugeCard';
|
|
8
|
+
export type { GaugeCardProps, GaugeSeverity, GaugeSize, GaugeThreshold, } from './types';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/GaugeCard/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAErE,YAAY,EACV,cAAc,EACd,aAAa,EACb,SAAS,EACT,cAAc,GACf,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Types for GaugeCard — composite chart card with arc gauge
|
|
3
|
+
* visualization, value, label, optional target line, and severity coloring.
|
|
4
|
+
*/
|
|
5
|
+
import type { ReactNode } from 'react';
|
|
6
|
+
import type { SxProps, Theme } from '@mui/material';
|
|
7
|
+
/**
|
|
8
|
+
* Severity drives the gauge arc color + optional value text color.
|
|
9
|
+
*
|
|
10
|
+
* Map to `theme.palette.<severity>.main`:
|
|
11
|
+
* - `success` → green (good metrics, on-target)
|
|
12
|
+
* - `warning` → amber (approaching threshold)
|
|
13
|
+
* - `error` → red (out of range)
|
|
14
|
+
* - `info` → blue (neutral / informational)
|
|
15
|
+
* - `neutral` → muted gray
|
|
16
|
+
*/
|
|
17
|
+
export type GaugeSeverity = 'success' | 'warning' | 'error' | 'info' | 'neutral';
|
|
18
|
+
/**
|
|
19
|
+
* Gauge size preset.
|
|
20
|
+
*
|
|
21
|
+
* - `sm` — 100px diameter — for grid tiles or compact dashboards
|
|
22
|
+
* - `md` — 160px diameter (default) — standard KPI card
|
|
23
|
+
* - `lg` — 220px diameter — hero metric on detail pages
|
|
24
|
+
*/
|
|
25
|
+
export type GaugeSize = 'sm' | 'md' | 'lg';
|
|
26
|
+
/**
|
|
27
|
+
* Optional severity threshold for auto-coloring.
|
|
28
|
+
*
|
|
29
|
+
* When supplied, GaugeCard picks the matching severity based on which range
|
|
30
|
+
* the current `value` falls in. Mutually exclusive with explicit `severity`.
|
|
31
|
+
*/
|
|
32
|
+
export interface GaugeThreshold {
|
|
33
|
+
/** Inclusive lower bound. */
|
|
34
|
+
from: number;
|
|
35
|
+
/** Exclusive upper bound. */
|
|
36
|
+
to: number;
|
|
37
|
+
/** Severity applied when value is in [from, to). */
|
|
38
|
+
severity: GaugeSeverity;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Props for GaugeCard.
|
|
42
|
+
*
|
|
43
|
+
* Computes the arc gauge from `value` (normalized against `min`/`max`).
|
|
44
|
+
* The arc sweeps from 220° (bottom-left) to 320° (bottom-right) — i.e. a
|
|
45
|
+
* standard 220° span — giving a visually balanced "speedometer" look.
|
|
46
|
+
*/
|
|
47
|
+
export interface GaugeCardProps {
|
|
48
|
+
/** Metric label (e.g. "Protocol adherence"). */
|
|
49
|
+
label: ReactNode;
|
|
50
|
+
/** Current value. Clamped to [min, max] before rendering. */
|
|
51
|
+
value: number;
|
|
52
|
+
/** Lower bound. Default 0. */
|
|
53
|
+
min?: number;
|
|
54
|
+
/** Upper bound. Default 100. */
|
|
55
|
+
max?: number;
|
|
56
|
+
/** Optional target line (rendered as a tick on the arc). */
|
|
57
|
+
target?: number;
|
|
58
|
+
/** Value suffix (e.g. "%"). */
|
|
59
|
+
unit?: string;
|
|
60
|
+
/** Number of decimal places to render. Default 0. */
|
|
61
|
+
precision?: number;
|
|
62
|
+
/** Severity (drives arc color). Mutually exclusive with `thresholds`. */
|
|
63
|
+
severity?: GaugeSeverity;
|
|
64
|
+
/** Auto-color the gauge based on which threshold range `value` falls in. */
|
|
65
|
+
thresholds?: ReadonlyArray<GaugeThreshold>;
|
|
66
|
+
/** Optional sub-text below the value (e.g. previous period comparison). */
|
|
67
|
+
caption?: ReactNode;
|
|
68
|
+
/** Optional eyebrow text above the label (e.g. "Q2 2026"). */
|
|
69
|
+
eyebrow?: ReactNode;
|
|
70
|
+
/** Optional trailing slot (e.g. action menu or info tooltip). */
|
|
71
|
+
headerSlot?: ReactNode;
|
|
72
|
+
/** Optional footer slot below the gauge. */
|
|
73
|
+
footerSlot?: ReactNode;
|
|
74
|
+
/** Render the card without a Paper surround (for embedding in custom shells). Default false. */
|
|
75
|
+
bare?: boolean;
|
|
76
|
+
/** Gauge size. Default `md`. */
|
|
77
|
+
size?: GaugeSize;
|
|
78
|
+
/** Loading state — renders a skeleton arc. Default false. */
|
|
79
|
+
loading?: boolean;
|
|
80
|
+
/** sx for the root container. */
|
|
81
|
+
sx?: SxProps<Theme>;
|
|
82
|
+
/** Accessible label override. Falls back to `${label}: ${value}${unit}`. */
|
|
83
|
+
ariaLabel?: string;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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