@camunda/design-system 0.36.0 → 0.38.0
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/dist/carbon-compat/modal.d.ts +9 -1
- package/dist/carbon-compat/modal.d.ts.map +1 -1
- package/dist/carbon-compat/modal.js.map +1 -1
- package/dist/src/components/ui/app-header.d.ts +23 -3
- package/dist/src/components/ui/app-header.d.ts.map +1 -1
- package/dist/src/components/ui/app-header.js +12 -3
- package/dist/src/components/ui/app-header.js.map +1 -1
- package/dist/src/components/ui/app-sidebar.d.ts +44 -12
- package/dist/src/components/ui/app-sidebar.d.ts.map +1 -1
- package/dist/src/components/ui/app-sidebar.js +42 -15
- package/dist/src/components/ui/app-sidebar.js.map +1 -1
- package/dist/src/components/ui/avatar.d.ts +7 -0
- package/dist/src/components/ui/avatar.d.ts.map +1 -1
- package/dist/src/components/ui/avatar.js +1 -1
- package/dist/src/components/ui/avatar.js.map +1 -1
- package/dist/src/components/ui/bar-chart.d.ts.map +1 -1
- package/dist/src/components/ui/bar-chart.js +29 -4
- package/dist/src/components/ui/bar-chart.js.map +1 -1
- package/dist/src/components/ui/chart.d.ts +14 -3
- package/dist/src/components/ui/chart.d.ts.map +1 -1
- package/dist/src/components/ui/chart.js +35 -8
- package/dist/src/components/ui/chart.js.map +1 -1
- package/dist/src/components/ui/data-table.d.ts +6 -0
- package/dist/src/components/ui/data-table.d.ts.map +1 -1
- package/dist/src/components/ui/data-table.js +6 -5
- package/dist/src/components/ui/data-table.js.map +1 -1
- package/dist/src/components/ui/line-chart.d.ts.map +1 -1
- package/dist/src/components/ui/line-chart.js +12 -2
- package/dist/src/components/ui/line-chart.js.map +1 -1
- package/dist/src/components/ui/nav-breadcrumb.d.ts +120 -2
- package/dist/src/components/ui/nav-breadcrumb.d.ts.map +1 -1
- package/dist/src/components/ui/nav-breadcrumb.js +54 -7
- package/dist/src/components/ui/nav-breadcrumb.js.map +1 -1
- package/dist/src/components/ui/nav-data.d.ts +46 -0
- package/dist/src/components/ui/nav-data.d.ts.map +1 -0
- package/dist/src/components/ui/nav-data.js +66 -0
- package/dist/src/components/ui/nav-data.js.map +1 -0
- package/dist/src/components/ui/nav-icon.assignability.d.ts +30 -0
- package/dist/src/components/ui/nav-icon.assignability.d.ts.map +1 -0
- package/dist/src/components/ui/nav-icon.assignability.js +28 -0
- package/dist/src/components/ui/nav-icon.assignability.js.map +1 -0
- package/dist/src/components/ui/nav-icon.d.ts +33 -0
- package/dist/src/components/ui/nav-icon.d.ts.map +1 -0
- package/dist/src/components/ui/nav-icon.js +20 -0
- package/dist/src/components/ui/nav-icon.js.map +1 -0
- package/dist/src/components/ui/nav-tools.assignability.d.ts +10 -0
- package/dist/src/components/ui/nav-tools.assignability.d.ts.map +1 -0
- package/dist/src/components/ui/nav-tools.assignability.js +35 -0
- package/dist/src/components/ui/nav-tools.assignability.js.map +1 -0
- package/dist/src/components/ui/nav-tools.d.ts +95 -0
- package/dist/src/components/ui/nav-tools.d.ts.map +1 -0
- package/dist/src/components/ui/nav-tools.js +130 -0
- package/dist/src/components/ui/nav-tools.js.map +1 -0
- package/dist/src/components/ui/notifications.d.ts +72 -0
- package/dist/src/components/ui/notifications.d.ts.map +1 -0
- package/dist/src/components/ui/notifications.js +53 -0
- package/dist/src/components/ui/notifications.js.map +1 -0
- package/dist/src/components/ui/pie-chart.d.ts +24 -0
- package/dist/src/components/ui/pie-chart.d.ts.map +1 -0
- package/dist/src/components/ui/pie-chart.js +69 -0
- package/dist/src/components/ui/pie-chart.js.map +1 -0
- package/dist/src/components/ui/scorecard.d.ts.map +1 -1
- package/dist/src/components/ui/scorecard.js +9 -3
- package/dist/src/components/ui/scorecard.js.map +1 -1
- package/dist/src/components/ui/sheet.d.ts +1 -1
- package/dist/src/components/ui/sparkline.d.ts.map +1 -1
- package/dist/src/components/ui/sparkline.js +11 -1
- package/dist/src/components/ui/sparkline.js.map +1 -1
- package/dist/src/examples/agent-control-plane-processes/DashboardPage.d.ts +3 -0
- package/dist/src/examples/agent-control-plane-processes/DashboardPage.d.ts.map +1 -0
- package/dist/src/examples/agent-control-plane-processes/DashboardPage.js +114 -0
- package/dist/src/examples/agent-control-plane-processes/DashboardPage.js.map +1 -0
- package/dist/src/examples/agent-control-plane-processes/derive.d.ts +65 -0
- package/dist/src/examples/agent-control-plane-processes/derive.d.ts.map +1 -0
- package/dist/src/examples/agent-control-plane-processes/derive.js +234 -0
- package/dist/src/examples/agent-control-plane-processes/derive.js.map +1 -0
- package/dist/src/examples/agent-control-plane-processes/mock-data.d.ts +37 -0
- package/dist/src/examples/agent-control-plane-processes/mock-data.d.ts.map +1 -0
- package/dist/src/examples/agent-control-plane-processes/mock-data.js +206 -0
- package/dist/src/examples/agent-control-plane-processes/mock-data.js.map +1 -0
- package/dist/src/examples/agent-control-plane-processes/summary-mock-data.d.ts +37 -0
- package/dist/src/examples/agent-control-plane-processes/summary-mock-data.d.ts.map +1 -0
- package/dist/src/examples/agent-control-plane-processes/summary-mock-data.js +53 -0
- package/dist/src/examples/agent-control-plane-processes/summary-mock-data.js.map +1 -0
- package/dist/src/examples/shared/DashboardSection.d.ts +9 -0
- package/dist/src/examples/shared/DashboardSection.d.ts.map +1 -0
- package/dist/src/examples/shared/DashboardSection.js +5 -0
- package/dist/src/examples/shared/DashboardSection.js.map +1 -0
- package/dist/src/examples/shared/DateRangePopover.d.ts +3 -0
- package/dist/src/examples/shared/DateRangePopover.d.ts.map +1 -0
- package/dist/src/examples/shared/DateRangePopover.js +35 -0
- package/dist/src/examples/shared/DateRangePopover.js.map +1 -0
- package/dist/src/examples/shared/agent-control-plane-nav.d.ts +4 -0
- package/dist/src/examples/shared/agent-control-plane-nav.d.ts.map +1 -0
- package/dist/src/examples/shared/agent-control-plane-nav.js +25 -0
- package/dist/src/examples/shared/agent-control-plane-nav.js.map +1 -0
- package/dist/src/examples/shared/date-range-utils.d.ts +10 -0
- package/dist/src/examples/shared/date-range-utils.d.ts.map +1 -0
- package/dist/src/examples/shared/date-range-utils.js +75 -0
- package/dist/src/examples/shared/date-range-utils.js.map +1 -0
- package/dist/src/icons/camunda-app-icons.d.ts +19 -0
- package/dist/src/icons/camunda-app-icons.d.ts.map +1 -0
- package/dist/src/icons/camunda-app-icons.js +26 -0
- package/dist/src/icons/camunda-app-icons.js.map +1 -0
- package/dist/src/icons/index.d.ts +1 -0
- package/dist/src/icons/index.d.ts.map +1 -1
- package/dist/src/icons/index.js +1 -0
- package/dist/src/icons/index.js.map +1 -1
- package/dist/src/index.d.ts +8 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +5 -2
- package/dist/src/index.js.map +1 -1
- package/dist/styles.css +70 -5
- package/package.json +1 -1
- package/dist/src/examples/cost-dashboard/CostBreakdownChart.d.ts +0 -2
- package/dist/src/examples/cost-dashboard/CostBreakdownChart.d.ts.map +0 -1
- package/dist/src/examples/cost-dashboard/CostBreakdownChart.js +0 -21
- package/dist/src/examples/cost-dashboard/CostBreakdownChart.js.map +0 -1
- package/dist/src/examples/cost-dashboard/CostDashboardPage.d.ts +0 -2
- package/dist/src/examples/cost-dashboard/CostDashboardPage.d.ts.map +0 -1
- package/dist/src/examples/cost-dashboard/CostDashboardPage.js +0 -56
- package/dist/src/examples/cost-dashboard/CostDashboardPage.js.map +0 -1
- package/dist/src/examples/cost-dashboard/TrendChart.d.ts +0 -2
- package/dist/src/examples/cost-dashboard/TrendChart.d.ts.map +0 -1
- package/dist/src/examples/cost-dashboard/TrendChart.js +0 -19
- package/dist/src/examples/cost-dashboard/TrendChart.js.map +0 -1
- package/dist/src/examples/cost-dashboard/mock-data.d.ts +0 -34
- package/dist/src/examples/cost-dashboard/mock-data.d.ts.map +0 -1
- package/dist/src/examples/cost-dashboard/mock-data.js +0 -120
- package/dist/src/examples/cost-dashboard/mock-data.js.map +0 -1
- package/dist/src/examples/projects-list/ProjectsListPage.d.ts +0 -4
- package/dist/src/examples/projects-list/ProjectsListPage.d.ts.map +0 -1
- package/dist/src/examples/projects-list/ProjectsListPage.js +0 -58
- package/dist/src/examples/projects-list/ProjectsListPage.js.map +0 -1
- package/dist/src/examples/projects-list/mock-data.d.ts +0 -10
- package/dist/src/examples/projects-list/mock-data.d.ts.map +0 -1
- package/dist/src/examples/projects-list/mock-data.js +0 -83
- package/dist/src/examples/projects-list/mock-data.js.map +0 -1
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Portal } from "radix-ui";
|
|
5
|
+
import { DismissableLayer } from "radix-ui/internal";
|
|
6
|
+
import { cn } from "../../lib/utils.js";
|
|
7
|
+
import { markFocusVisibleOnClose } from "../../lib/focus-visible-on-close.js";
|
|
8
|
+
import { useSidebar } from "./sidebar-provider.js";
|
|
9
|
+
const DEFAULT_PANEL_WIDTH = "20rem";
|
|
10
|
+
const TABBABLE_SELECTOR = [
|
|
11
|
+
"a[href]",
|
|
12
|
+
"button:not([disabled])",
|
|
13
|
+
"input:not([disabled])",
|
|
14
|
+
"select:not([disabled])",
|
|
15
|
+
"textarea:not([disabled])",
|
|
16
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
17
|
+
].join(",");
|
|
18
|
+
/**
|
|
19
|
+
* Owns which tool is open.
|
|
20
|
+
*
|
|
21
|
+
* `activeToolKey` has three states, not two: `undefined` is uncontrolled, `null` is controlled
|
|
22
|
+
* with nothing open, and a string is controlled with that tool open. A consumer passing `null`
|
|
23
|
+
* to mean "you decide" enters controlled mode permanently, so that distinction has to survive.
|
|
24
|
+
*/
|
|
25
|
+
export function useHeaderTools({ tools, activeToolKey, onActiveToolChange, idPrefix, }) {
|
|
26
|
+
const isControlled = activeToolKey !== undefined;
|
|
27
|
+
const [internalKey, setInternalKey] = React.useState(null);
|
|
28
|
+
const requestedKey = isControlled ? activeToolKey : internalKey;
|
|
29
|
+
const sidebar = useSidebar();
|
|
30
|
+
const mobileNavOpen = sidebar?.mobileOpen ?? false;
|
|
31
|
+
// Two guards, both derived rather than reconciled in an effect.
|
|
32
|
+
//
|
|
33
|
+
// Only a key resolving to a tool that actually HAS a panel counts as open. C3 skips this and
|
|
34
|
+
// registers dismissal listeners for a panel it never rendered, so every outside click closes
|
|
35
|
+
// nothing visible and Escape moves focus to a stale trigger.
|
|
36
|
+
//
|
|
37
|
+
// And nothing is open while the mobile navigation is: that navigation is a modal Sheet, which
|
|
38
|
+
// sets `pointer-events: none` on the body, so a panel portaled there would render but not
|
|
39
|
+
// respond. Suspending it here rather than clearing the key means closing the navigation brings
|
|
40
|
+
// back the panel the user never dismissed.
|
|
41
|
+
const activeTool = mobileNavOpen
|
|
42
|
+
? null
|
|
43
|
+
: (tools?.find((tool) => tool.key === requestedKey && tool.panel !== undefined) ?? null);
|
|
44
|
+
const activeKey = activeTool?.key ?? null;
|
|
45
|
+
const setActiveKey = React.useCallback((key) => {
|
|
46
|
+
if (!isControlled)
|
|
47
|
+
setInternalKey(key);
|
|
48
|
+
// Fires in both modes. C3 documents this but only implements it when controlled, so an
|
|
49
|
+
// uncontrolled consumer wiring analytics to it silently receives nothing.
|
|
50
|
+
onActiveToolChange?.(key);
|
|
51
|
+
}, [isControlled, onActiveToolChange]);
|
|
52
|
+
const toggleTool = React.useCallback((tool) => {
|
|
53
|
+
// A tool with no panel has nothing to open; C3 puts its action in `renderButton`.
|
|
54
|
+
if (tool.panel === undefined)
|
|
55
|
+
return;
|
|
56
|
+
if (mobileNavOpen)
|
|
57
|
+
sidebar?.setMobileOpen(false);
|
|
58
|
+
setActiveKey(activeKey === tool.key ? null : tool.key);
|
|
59
|
+
}, [activeKey, mobileNavOpen, setActiveKey, sidebar]);
|
|
60
|
+
const panelId = `${idPrefix}-tool-panel`;
|
|
61
|
+
const triggerId = React.useCallback((key) => `${idPrefix}-tool-${key}`, [idPrefix]);
|
|
62
|
+
return {
|
|
63
|
+
activeTool,
|
|
64
|
+
activeKey,
|
|
65
|
+
toggleTool,
|
|
66
|
+
setActiveKey,
|
|
67
|
+
panelId,
|
|
68
|
+
triggerId,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** Moves focus back to a trigger and makes the restored focus ring visible. */
|
|
72
|
+
function restoreFocusToTrigger(id) {
|
|
73
|
+
const trigger = document.getElementById(id);
|
|
74
|
+
if (trigger === null)
|
|
75
|
+
return;
|
|
76
|
+
trigger.focus();
|
|
77
|
+
markFocusVisibleOnClose(new Event("toolpanelclose"));
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The trigger row plus, when a tool is open, its portaled panel.
|
|
81
|
+
*
|
|
82
|
+
* Tab from an expanded trigger moves focus into the panel. Without it a disclosure whose panel
|
|
83
|
+
* is portaled to the end of `<body>` is reachable only by tabbing the whole page — the panel
|
|
84
|
+
* sits beside its trigger visually but nowhere near it in the tab sequence.
|
|
85
|
+
*/
|
|
86
|
+
export function HeaderTools({ tools, activeTool, activeKey, toggleTool, setActiveKey, panelId, triggerId, }) {
|
|
87
|
+
const triggerRowRef = React.useRef(null);
|
|
88
|
+
const close = React.useCallback(() => setActiveKey(null), [setActiveKey]);
|
|
89
|
+
const handleTriggerRowKeyDown = (event) => {
|
|
90
|
+
if (event.key !== "Tab" || event.shiftKey || event.defaultPrevented)
|
|
91
|
+
return;
|
|
92
|
+
if (activeKey === null)
|
|
93
|
+
return;
|
|
94
|
+
const target = event.target;
|
|
95
|
+
if (target.getAttribute("aria-controls") !== panelId)
|
|
96
|
+
return;
|
|
97
|
+
const panel = document.getElementById(panelId);
|
|
98
|
+
if (panel === null)
|
|
99
|
+
return;
|
|
100
|
+
const first = panel.querySelector(TABBABLE_SELECTOR);
|
|
101
|
+
event.preventDefault();
|
|
102
|
+
(first ?? panel).focus();
|
|
103
|
+
};
|
|
104
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { ref: triggerRowRef, onKeyDown: handleTriggerRowKeyDown, "data-slot": "app-header-tools", className: "flex items-center gap-2", children: tools.map((tool) => {
|
|
105
|
+
const RenderButton = tool.renderButton;
|
|
106
|
+
const isActive = activeKey === tool.key;
|
|
107
|
+
return (_jsx(RenderButton, { onClick: () => toggleTool(tool), isActive: isActive, buttonProps: {
|
|
108
|
+
id: triggerId(tool.key),
|
|
109
|
+
"aria-expanded": isActive,
|
|
110
|
+
...(isActive ? { "aria-controls": panelId } : {}),
|
|
111
|
+
} }, tool.key));
|
|
112
|
+
}) }), activeTool !== null && (_jsx(ToolPanel, { tool: activeTool, panelId: panelId, triggerId: triggerId(activeTool.key), triggerRowRef: triggerRowRef, close: close }))] }));
|
|
113
|
+
}
|
|
114
|
+
function ToolPanel({ tool, panelId, triggerId, triggerRowRef, close, }) {
|
|
115
|
+
const content = typeof tool.panel === "function" ? tool.panel({ close }) : tool.panel;
|
|
116
|
+
return (_jsx(Portal.Root, { children: _jsx(DismissableLayer.DismissableLayer, { asChild: true, onEscapeKeyDown: () => restoreFocusToTrigger(triggerId), onPointerDownOutside: (event) => {
|
|
117
|
+
// Clicking another tool's trigger should switch panels, not close then reopen. The
|
|
118
|
+
// exclusion is the trigger row, not the whole header as in C3 — so clicking the logo
|
|
119
|
+
// or a breadcrumb now closes the panel, which under C3 it did not.
|
|
120
|
+
if (triggerRowRef.current?.contains(event.target) === true) {
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
// A disclosure does not close when focus leaves it. C3 closes here and, on a forward
|
|
125
|
+
// Tab out of the last focusable, leaves focus past the end of the body.
|
|
126
|
+
onFocusOutside: (event) => event.preventDefault(), onDismiss: close, children: _jsx("div", { id: panelId, role: "region", "aria-label": tool.label, tabIndex: -1, "data-slot": "app-header-tool-panel", style: {
|
|
127
|
+
"--tool-panel-width": tool.panelWidth ?? DEFAULT_PANEL_WIDTH,
|
|
128
|
+
}, className: cn("fixed inset-x-0 top-12 z-50 flex h-[calc(100dvh-3rem)] flex-col overflow-y-auto", "border-l border-border bg-background shadow-lg outline-hidden", "sm:inset-x-auto sm:right-0 sm:w-(--tool-panel-width)"), children: content }) }) }));
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=nav-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nav-tools.js","sourceRoot":"","sources":["../../../../src/components/ui/nav-tools.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AA2DhD,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAEpC,MAAM,iBAAiB,GAAG;IACxB,SAAS;IACT,wBAAwB;IACxB,uBAAuB;IACvB,wBAAwB;IACxB,0BAA0B;IAC1B,iCAAiC;CAClC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAUZ;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,KAAK,EACL,aAAa,EACb,kBAAkB,EAClB,QAAQ,GACc;IACtB,MAAM,YAAY,GAAG,aAAa,KAAK,SAAS,CAAC;IACjD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAC1E,MAAM,YAAY,GAAG,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC;IAEhE,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,aAAa,GAAG,OAAO,EAAE,UAAU,IAAI,KAAK,CAAC;IAEnD,gEAAgE;IAChE,EAAE;IACF,6FAA6F;IAC7F,6FAA6F;IAC7F,6DAA6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AC,CAAC,IAAI,CAAC,KAAK,CAAC;IAExE,OAAO,CACL,KAAC,MAAM,CAAC,IAAI,cACV,KAAC,gBAAgB,CAAC,gBAAgB,IAChC,OAAO,QACP,eAAe,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,SAAS,CAAC,EACvD,oBAAoB,EAAE,CAAC,KAAK,EAAE,EAAE;gBAC9B,mFAAmF;gBACnF,qFAAqF;gBACrF,mEAAmE;gBACnE,IAAI,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAc,CAAC,KAAK,IAAI,EAAE,CAAC;oBACnE,KAAK,CAAC,cAAc,EAAE,CAAC;gBACzB,CAAC;YACH,CAAC;YACD,qFAAqF;YACrF,wEAAwE;YACxE,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,EACjD,SAAS,EAAE,KAAK,YAEhB,cACE,EAAE,EAAE,OAAO,EACX,IAAI,EAAC,QAAQ,gBACD,IAAI,CAAC,KAAK,EACtB,QAAQ,EAAE,CAAC,CAAC,eACF,uBAAuB,EACjC,KAAK,EACH;oBACE,oBAAoB,EAAE,IAAI,CAAC,UAAU,IAAI,mBAAmB;iBACtC,EAE1B,SAAS,EAAE,EAAE,CACX,iFAAiF,EACjF,+DAA+D,EAC/D,sDAAsD,CACvD,YAEA,OAAO,GACJ,GAC4B,GACxB,CACf,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* One notification, as the consumer already has it.
|
|
4
|
+
*
|
|
5
|
+
* Presentational only: `timestamp` is a pre-formatted string, not a Date, because relative
|
|
6
|
+
* formatting is locale and library work that belongs with the consumer — the design system has
|
|
7
|
+
* no opinion on whether "2h ago" or "14:32" is right for a product.
|
|
8
|
+
*/
|
|
9
|
+
export interface NavNotification {
|
|
10
|
+
key: string;
|
|
11
|
+
title: string;
|
|
12
|
+
description?: React.ReactNode;
|
|
13
|
+
/** Pre-formatted by the consumer. */
|
|
14
|
+
timestamp?: string;
|
|
15
|
+
/** Unread notifications carry a marker and count toward the bell's badge. */
|
|
16
|
+
isRead?: boolean;
|
|
17
|
+
href?: string;
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
}
|
|
20
|
+
export interface NotificationBellProps {
|
|
21
|
+
/**
|
|
22
|
+
* Unread notifications. Rendered as a badge; counts above `maxCount` show as `9+`. The bell
|
|
23
|
+
* owns no state — pass the count you already hold.
|
|
24
|
+
*/
|
|
25
|
+
unreadCount?: number;
|
|
26
|
+
/** Highest number rendered literally. Default 9. */
|
|
27
|
+
maxCount?: number;
|
|
28
|
+
/** Accessible name for the trigger. Default "Notifications". */
|
|
29
|
+
label?: string;
|
|
30
|
+
/** Reflected as `aria-expanded`, for when the bell toggles a panel. */
|
|
31
|
+
isActive?: boolean;
|
|
32
|
+
onClick?: () => void;
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Notification bell, for `AppHeader.globalActions` (as an `element`) or anywhere a trigger fits.
|
|
37
|
+
*
|
|
38
|
+
* Split from the panel on purpose: the trigger belongs in the header's action row while the
|
|
39
|
+
* panel is an overlay, and a consumer may already own one of the two.
|
|
40
|
+
*/
|
|
41
|
+
export declare function NotificationBell({ unreadCount, maxCount, label, isActive, onClick, className, }: NotificationBellProps): React.JSX.Element;
|
|
42
|
+
export interface NotificationsPanelProps {
|
|
43
|
+
notifications: NavNotification[];
|
|
44
|
+
open: boolean;
|
|
45
|
+
onOpenChange: (open: boolean) => void;
|
|
46
|
+
/** Omit to render notifications without a per-item dismiss control. */
|
|
47
|
+
onDismiss?: (key: string) => void;
|
|
48
|
+
/** Panel heading. Default "Notifications". */
|
|
49
|
+
title?: string;
|
|
50
|
+
/** Shown when there is nothing to list. */
|
|
51
|
+
emptyMessage?: React.ReactNode;
|
|
52
|
+
/** Rendered in the panel header — e.g. a "Mark all as read" button. */
|
|
53
|
+
headerAction?: React.ReactNode;
|
|
54
|
+
/** Component used for notifications carrying an `href`. Default: a plain anchor. */
|
|
55
|
+
linkComponent?: React.ElementType;
|
|
56
|
+
className?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Notification panel — a right-hand overlay listing what the consumer passes.
|
|
60
|
+
*
|
|
61
|
+
* Fetches nothing and stores nothing: `open` is controlled, because the trigger usually lives in
|
|
62
|
+
* the header and the panel does not, so one of the two has to own the state and it cannot be
|
|
63
|
+
* this one.
|
|
64
|
+
*
|
|
65
|
+
* **Mark notifications read from `onOpenChange(true)`.** The panel does not fire that write —
|
|
66
|
+
* it is a persisted mutation and the transport differs per product — but it is the agreed
|
|
67
|
+
* moment. Console's notification runtime deliberately leaves the timing here, and the same feed
|
|
68
|
+
* appears in several products: if one marks on open, another on click and a third only on an
|
|
69
|
+
* explicit action, the unread count means something different in each app.
|
|
70
|
+
*/
|
|
71
|
+
export declare function NotificationsPanel({ notifications, open, onOpenChange, onDismiss, title, emptyMessage, headerAction, linkComponent, className, }: NotificationsPanelProps): React.JSX.Element;
|
|
72
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/notifications.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACp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|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Bell, X } from "lucide-react";
|
|
5
|
+
import { cn } from "../../lib/utils.js";
|
|
6
|
+
import { Button } from "./button.js";
|
|
7
|
+
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, } from "./sheet.js";
|
|
8
|
+
/**
|
|
9
|
+
* Notification bell, for `AppHeader.globalActions` (as an `element`) or anywhere a trigger fits.
|
|
10
|
+
*
|
|
11
|
+
* Split from the panel on purpose: the trigger belongs in the header's action row while the
|
|
12
|
+
* panel is an overlay, and a consumer may already own one of the two.
|
|
13
|
+
*/
|
|
14
|
+
export function NotificationBell({ unreadCount = 0, maxCount = 9, label = "Notifications", isActive, onClick, className, }) {
|
|
15
|
+
const hasUnread = unreadCount > 0;
|
|
16
|
+
const badgeText = unreadCount > maxCount ? `${maxCount}+` : `${unreadCount}`;
|
|
17
|
+
return (
|
|
18
|
+
// inline-flex, not block: the badge is positioned against this box, so it has to
|
|
19
|
+
// shrink-wrap the button or it anchors to the container's right edge instead.
|
|
20
|
+
_jsxs("div", { className: cn("relative inline-flex", className), children: [_jsx(Button, { variant: "ghost", size: "icon", "aria-label": hasUnread
|
|
21
|
+
? `${label}, ${unreadCount} unread`
|
|
22
|
+
: `${label}, none unread`, "aria-expanded": isActive, onClick: onClick, "data-slot": "notification-bell", children: _jsx(Bell, { "aria-hidden": true, className: "size-4" }) }), hasUnread ? (_jsx("span", { "aria-hidden": true, "data-slot": "notification-bell-badge", className: "pointer-events-none absolute -right-0.5 -top-0.5 flex size-4 items-center justify-center rounded-full bg-primary-action-default text-[0.625rem] leading-none text-primary-action-foreground", children: badgeText })) : null, _jsx("span", { "aria-live": "polite", className: "sr-only", children: hasUnread ? `${unreadCount} unread notifications` : "" })] }));
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Notification panel — a right-hand overlay listing what the consumer passes.
|
|
26
|
+
*
|
|
27
|
+
* Fetches nothing and stores nothing: `open` is controlled, because the trigger usually lives in
|
|
28
|
+
* the header and the panel does not, so one of the two has to own the state and it cannot be
|
|
29
|
+
* this one.
|
|
30
|
+
*
|
|
31
|
+
* **Mark notifications read from `onOpenChange(true)`.** The panel does not fire that write —
|
|
32
|
+
* it is a persisted mutation and the transport differs per product — but it is the agreed
|
|
33
|
+
* moment. Console's notification runtime deliberately leaves the timing here, and the same feed
|
|
34
|
+
* appears in several products: if one marks on open, another on click and a third only on an
|
|
35
|
+
* explicit action, the unread count means something different in each app.
|
|
36
|
+
*/
|
|
37
|
+
export function NotificationsPanel({ notifications, open, onOpenChange, onDismiss, title = "Notifications", emptyMessage = "You have no notifications.", headerAction, linkComponent, className, }) {
|
|
38
|
+
const isEmpty = notifications.length === 0;
|
|
39
|
+
return (_jsx(Sheet, { open: open, onOpenChange: onOpenChange, children: _jsxs(SheetContent, { side: "right", "data-slot": "notifications-panel", className: cn("w-full sm:max-w-sm", className), children: [_jsxs(SheetHeader, { children: [_jsx(SheetTitle, { children: title }), isEmpty ? (_jsx(SheetDescription, { children: emptyMessage })) : (_jsx(SheetDescription, { className: "sr-only", children: `${notifications.length} notifications` })), headerAction] }), isEmpty ? null : (_jsx("ul", { className: "m-0 flex list-none flex-col gap-1 overflow-y-auto p-4 pt-0", children: notifications.map((notification) => (_jsx(NotificationRow, { notification: notification, onDismiss: onDismiss, linkComponent: linkComponent }, notification.key))) }))] }) }));
|
|
40
|
+
}
|
|
41
|
+
function NotificationRow({ notification, onDismiss, linkComponent, }) {
|
|
42
|
+
const { key, title, description, timestamp, isRead, href, onClick } = notification;
|
|
43
|
+
const isInteractive = href !== undefined || onClick !== undefined;
|
|
44
|
+
const LinkEl = linkComponent ?? "a";
|
|
45
|
+
const Body = href
|
|
46
|
+
? LinkEl
|
|
47
|
+
: isInteractive
|
|
48
|
+
? "button"
|
|
49
|
+
: "div";
|
|
50
|
+
return (_jsxs("li", { "data-slot": "notification-item", "data-read": isRead ? "true" : "false", className: "flex items-start gap-2 rounded-md p-2 hover:bg-neutral-background-medium", children: [_jsx("span", { "aria-hidden": true, className: cn("mt-1.5 size-2 shrink-0 rounded-full", isRead ? "bg-transparent" : "bg-primary-action-default") }), _jsxs(Body, { ...(href ? { href } : isInteractive ? { type: "button" } : {}), onClick: onClick, className: cn("min-w-0 flex-1 text-left", isInteractive &&
|
|
51
|
+
"rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"), children: [_jsxs("span", { className: "block text-sm text-neutral-foreground-strong", children: [isRead ? null : _jsx("span", { className: "sr-only", children: "Unread. " }), title] }), description ? (_jsx("span", { className: "block text-sm text-neutral-foreground-subtle", children: description })) : null, timestamp ? (_jsx("span", { className: "block text-xs text-neutral-foreground-subtle", children: timestamp })) : null] }), onDismiss ? (_jsx(Button, { variant: "ghost", size: "icon-xs", "aria-label": `Dismiss ${title}`, onClick: () => onDismiss(key), className: "shrink-0 text-neutral-foreground-subtle", children: _jsx(X, {}) })) : null] }));
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=notifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../../src/components/ui/notifications.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EACL,KAAK,EACL,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,UAAU,GACX,MAAM,SAAS,CAAC;AAqCjB;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAC/B,WAAW,GAAG,CAAC,EACf,QAAQ,GAAG,CAAC,EACZ,KAAK,GAAG,eAAe,EACvB,QAAQ,EACR,OAAO,EACP,SAAS,GACa;IACtB,MAAM,SAAS,GAAG,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CAAC,CAAC,CAAC,2BAA2B,CACxD,GACD,EACF,MAAC,IAAI,OACC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAC/D,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,EAAE,CACX,0BAA0B,EAC1B,aAAa;oBACX,oFAAoF,CACvF,aAED,gBAAM,SAAS,EAAC,8CAA8C,aAC3D,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,SAAS,yBAAgB,EACzD,KAAK,IACD,EACN,WAAW,CAAC,CAAC,CAAC,CACb,eAAM,SAAS,EAAC,8CAA8C,YAC3D,WAAW,GACP,CACR,CAAC,CAAC,CAAC,IAAI,EACP,SAAS,CAAC,CAAC,CAAC,CACX,eAAM,SAAS,EAAC,8CAA8C,YAC3D,SAAS,GACL,CACR,CAAC,CAAC,CAAC,IAAI,IACH,EACN,SAAS,CAAC,CAAC,CAAC,CACX,KAAC,MAAM,IACL,OAAO,EAAC,OAAO,EACf,IAAI,EAAC,SAAS,gBACF,WAAW,KAAK,EAAE,EAC9B,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,EAC7B,SAAS,EAAC,yCAAyC,YAEnD,KAAC,CAAC,KAAG,GACE,CACV,CAAC,CAAC,CAAC,IAAI,IACL,CACN,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ChartConfig } from "./chart.js";
|
|
2
|
+
interface PieChartProps {
|
|
3
|
+
data: Record<string, unknown>[];
|
|
4
|
+
nameKey: string;
|
|
5
|
+
valueKey: string;
|
|
6
|
+
config: ChartConfig;
|
|
7
|
+
variant?: "pie" | "donut";
|
|
8
|
+
showLabels?: boolean;
|
|
9
|
+
legend?: boolean;
|
|
10
|
+
legendPosition?: "bottom" | "right";
|
|
11
|
+
highlightActive?: boolean;
|
|
12
|
+
activeIndex?: number | undefined;
|
|
13
|
+
onActiveIndexChange?: (index: number | undefined) => void;
|
|
14
|
+
centerLabel?: string | number;
|
|
15
|
+
centerValue?: string | number;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
empty?: boolean;
|
|
18
|
+
emptyMessage?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
declare function PieChart({ data, nameKey, valueKey, config, variant, showLabels, legend, legendPosition, highlightActive, activeIndex, onActiveIndexChange, centerLabel, centerValue, loading, empty, emptyMessage, className, }: PieChartProps): import("react").JSX.Element;
|
|
22
|
+
export { PieChart };
|
|
23
|
+
export type { PieChartProps };
|
|
24
|
+
//# sourceMappingURL=pie-chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pie-chart.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/pie-chart.tsx"],"names":[],"mappings":"AASA,OAAO,EAML,KAAK,WAAW,EACjB,MAAM,SAAS,CAAC;AAEjB,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IACpC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC1D,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA8CD,iBAAS,QAAQ,CAAC,EAChB,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,MAAM,EACN,OAAe,EACf,UAAkB,EAClB,MAAc,EACd,cAAyB,EACzB,eAAuB,EACvB,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,OAAe,EACf,KAAa,EACb,YAAY,EACZ,SAAS,GACV,EAAE,aAAa,+BAwHf;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Cell, Label, Pie, PieChart as RechartsPieChart, Sector, } from "recharts";
|
|
3
|
+
import { ChartContainer, ChartLegend, ChartLegendContent, ChartTooltip, ChartTooltipContent, } from "./chart.js";
|
|
4
|
+
// Recharts v3's <Pie> has no controllable `activeIndex` prop (unlike the
|
|
5
|
+
// v2 API vanilla shadcn's own docs assume) — `isActive` on each sector is
|
|
6
|
+
// derived entirely from Recharts' own internal hover/keyboard state
|
|
7
|
+
// (`selectActiveTooltipIndex`). `activeShape`/`inactiveShape` only ever key
|
|
8
|
+
// off that same internal state, so they can't express a controlled,
|
|
9
|
+
// hover-independent active slice either. `shape` is the one render path that
|
|
10
|
+
// receives the sector's own `index`, so it's the only way to compare against
|
|
11
|
+
// our *own* controlled `activeIndex` prop instead of Recharts' hover state —
|
|
12
|
+
// also the mechanism Recharts' own `activeShape` doc comment now points to
|
|
13
|
+
// ("Use the `shape` prop... `isActive` designates the active shape").
|
|
14
|
+
function createPieShape(controlledActiveIndex, nameKey) {
|
|
15
|
+
return function PieSliceShape(shapeProps) {
|
|
16
|
+
const isSliceActive = controlledActiveIndex !== undefined
|
|
17
|
+
? shapeProps.index === controlledActiveIndex
|
|
18
|
+
: shapeProps.isActive;
|
|
19
|
+
if (!isSliceActive) {
|
|
20
|
+
return _jsx(Sector, { ...shapeProps });
|
|
21
|
+
}
|
|
22
|
+
return (
|
|
23
|
+
// data-active-slice/data-slice-name: the play() test's assertion hook.
|
|
24
|
+
// Recharts' own `.recharts-active-shape` class only ever reflects its
|
|
25
|
+
// internal hover state, never our controlled activeIndex, so it can't
|
|
26
|
+
// be asserted on here.
|
|
27
|
+
_jsxs("g", { "data-active-slice": "true", "data-slice-name": String(shapeProps.payload?.[nameKey] ?? ""), children: [_jsx(Sector, { ...shapeProps, outerRadius: shapeProps.outerRadius + 10 }), _jsx(Sector, { ...shapeProps, innerRadius: shapeProps.outerRadius + 12, outerRadius: shapeProps.outerRadius + 25 })] }));
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function PieChart({ data, nameKey, valueKey, config, variant = "pie", showLabels = false, legend = false, legendPosition = "bottom", highlightActive = false, activeIndex, onActiveIndexChange, centerLabel, centerValue, loading = false, empty = false, emptyMessage, className, }) {
|
|
31
|
+
const innerRadius = variant === "donut" ? "60%" : 0;
|
|
32
|
+
const showActiveHighlight = highlightActive || activeIndex !== undefined;
|
|
33
|
+
const hasCenterContent = variant === "donut" &&
|
|
34
|
+
(centerLabel !== undefined || centerValue !== undefined);
|
|
35
|
+
const hasBothCenterContent = centerLabel !== undefined && centerValue !== undefined;
|
|
36
|
+
return (_jsx(ChartContainer, { config: config, loading: loading, empty: empty, emptyMessage: emptyMessage, className: className, children: _jsxs(RechartsPieChart, { accessibilityLayer: true, children: [_jsx(ChartTooltip, { content: _jsx(ChartTooltipContent, { nameKey: nameKey }) }), legend && legendPosition === "right" && (
|
|
37
|
+
// layout="vertical" is read by ChartLegendContent automatically:
|
|
38
|
+
// Recharts' <Legend> merges its own resolved `layout` onto the
|
|
39
|
+
// `content` element via cloneElement (component/Legend.js), so it
|
|
40
|
+
// doesn't need to be threaded through as a separate prop here.
|
|
41
|
+
// `entryAlign` is intentionally omitted — it only controls
|
|
42
|
+
// horizontal-row justification and is meaningless in vertical mode.
|
|
43
|
+
_jsx(ChartLegend, { itemSorter: null, layout: "vertical", verticalAlign: "middle", align: "right", content: _jsx(ChartLegendContent, { nameKey: nameKey }) })), legend && legendPosition === "bottom" && (
|
|
44
|
+
// itemSorter={null}: Recharts' <Legend> defaults to sorting entries
|
|
45
|
+
// alphabetically by label (itemSorter: "value" in legendSlice.js),
|
|
46
|
+
// independent of any custom `content` renderer — order the legend
|
|
47
|
+
// matches the pie's own slice order (the `data` array) instead, so
|
|
48
|
+
// scanning the ring and the legend left-to-right/top-to-bottom agree.
|
|
49
|
+
//
|
|
50
|
+
// entryAlign="center" (not align — collides with <Legend>'s own
|
|
51
|
+
// `align`, which sets the legend *box*'s position, defaults to
|
|
52
|
+
// "left" in ChartLegend, and is merged onto this element via
|
|
53
|
+
// cloneElement, silently overwriting a same-named prop).
|
|
54
|
+
_jsx(ChartLegend, { itemSorter: null, content: _jsx(ChartLegendContent, { nameKey: nameKey, entryAlign: "center" }) })), _jsxs(Pie, { data: data, dataKey: valueKey, nameKey: nameKey, innerRadius: innerRadius, isAnimationActive: false, stroke: "var(--neutral-background-subtle)", label: showLabels ? { className: "fill-neutral-foreground-strong" } : false, onClick: (_data, index) => onActiveIndexChange?.(index), ...(showActiveHighlight
|
|
55
|
+
? { shape: createPieShape(activeIndex, nameKey) }
|
|
56
|
+
: {}), children: [data.map((row) => (_jsx(Cell, { fill: `var(--color-${String(row[nameKey])})` }, String(row[nameKey])))), hasCenterContent && (_jsx(Label, { content: (props) => {
|
|
57
|
+
const viewBox = props.viewBox;
|
|
58
|
+
if (viewBox == null ||
|
|
59
|
+
!("cx" in viewBox) ||
|
|
60
|
+
viewBox.cx == null ||
|
|
61
|
+
viewBox.cy == null) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
const { cx, cy } = viewBox;
|
|
65
|
+
return (_jsxs("text", { x: cx, y: cy, textAnchor: "middle", dominantBaseline: "middle", children: [centerValue !== undefined && (_jsx("tspan", { x: cx, y: hasBothCenterContent ? cy - 4 : cy, className: "fill-neutral-foreground-strong text-2xl font-semibold", children: centerValue })), centerLabel !== undefined && (_jsx("tspan", { x: cx, y: hasBothCenterContent ? cy + 20 : cy, className: "fill-neutral-foreground-subtle text-xs", children: centerLabel }))] }));
|
|
66
|
+
} }))] })] }) }));
|
|
67
|
+
}
|
|
68
|
+
export { PieChart };
|
|
69
|
+
//# sourceMappingURL=pie-chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pie-chart.js","sourceRoot":"","sources":["../../../../src/components/ui/pie-chart.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,IAAI,EACJ,KAAK,EACL,GAAG,EACH,QAAQ,IAAI,gBAAgB,EAC5B,MAAM,GAEP,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,GAEpB,MAAM,SAAS,CAAC;AAsBjB,yEAAyE;AACzE,0EAA0E;AAC1E,oEAAoE;AACpE,4EAA4E;AAC5E,oEAAoE;AACpE,6EAA6E;AAC7E,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAC3E,sEAAsE;AACtE,SAAS,cAAc,CACrB,qBAAyC,EACzC,OAAe;IAEf,OAAO,SAAS,aAAa,CAAC,UAA+B;QAC3D,MAAM,aAAa,GACjB,qBAAqB,KAAK,SAAS;YACjC,CAAC,CAAC,UAAU,CAAC,KAAK,KAAK,qBAAqB;YAC5C,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC;QAE1B,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,OAAO,KAAC,MAAM,OAAK,UAAU,GAAI,CAAC;QACpC,CAAC;QAED,OAAO;QACL,uEAA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,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scorecard.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/scorecard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,UAAU,GAAG,UAAU,CAAC;IACnC,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;CAC5C;AAED,UAAU,sBAAsB;IAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,cAAc;IACtB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,SAAS,CAAC,EAAE,sBAAsB,CAAC;IACnC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"scorecard.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/scorecard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,UAAU,GAAG,UAAU,CAAC;IACnC,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;CAC5C;AAED,UAAU,sBAAsB;IAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,cAAc;IACtB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,SAAS,CAAC,EAAE,sBAAsB,CAAC;IACnC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAiFD,iBAAS,SAAS,CAAC,EACjB,KAAK,EACL,OAAO,EACP,KAAK,EACL,KAAK,EACL,SAAS,EACT,MAAa,EACb,IAAgB,EAChB,OAAe,EACf,KAAa,EACb,YAAwB,EACxB,SAAS,GACV,EAAE,cAAc,qBAwDhB;AAED,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { Badge } from "./badge.js";
|
|
|
6
6
|
import { Card, CardHeader, CardTitle } from "./card.js";
|
|
7
7
|
import { Skeleton } from "./skeleton.js";
|
|
8
8
|
import { Sparkline } from "./sparkline.js";
|
|
9
|
-
function ScorecardBody({ label, tooltip, value, delta, sparkline, size, loading, empty, emptyMessage, }) {
|
|
9
|
+
function ScorecardBody({ label, tooltip, value, delta, sparkline, size, loading, empty, emptyMessage, asCard, }) {
|
|
10
10
|
if (loading) {
|
|
11
11
|
return (_jsxs(_Fragment, { children: [_jsx(Skeleton, { className: "h-4 w-24" }), _jsx(Skeleton, { className: cn("h-7 w-20", size === "sm" && "h-6 w-16") })] }));
|
|
12
12
|
}
|
|
@@ -14,13 +14,19 @@ function ScorecardBody({ label, tooltip, value, delta, sparkline, size, loading,
|
|
|
14
14
|
// `loading` is always false here — the branch above already returned
|
|
15
15
|
// before this point, so Sparkline never renders its own skeleton; the
|
|
16
16
|
// fixed two-block skeleton above is what represents loading for the tile.
|
|
17
|
-
|
|
17
|
+
// Bled flush to the Card's own edges via negative margins that cancel
|
|
18
|
+
// CardHeader's `px-4`/`px-3` and Card's own `py-4`/`py-3` — only correct
|
|
19
|
+
// when `asCard` actually wraps this content in that padding; the bare
|
|
20
|
+
// `<div>` (`asCard={false}`) has no padding of its own to cancel.
|
|
21
|
+
const sparklineElement = sparkline ? (_jsx(Sparkline, { data: sparkline.data, dataKey: sparkline.dataKey, loading: false, className: asCard
|
|
22
|
+
? "w-auto -mx-4 -mb-4 group-data-[size=sm]/card:-mx-3 group-data-[size=sm]/card:-mb-3"
|
|
23
|
+
: undefined })) : null;
|
|
18
24
|
return (_jsxs(_Fragment, { children: [_jsx(CardTitle, { tooltip: tooltip, className: "text-sm font-normal", children: label }), _jsx("div", { className: "flex min-w-0 items-center", children: _jsxs("span", { className: "inline-flex min-w-0 max-w-full items-center gap-2", children: [_jsx("span", { className: cn("min-w-0 truncate text-2xl font-semibold text-neutral-foreground-strong", size === "sm" && "text-xl"), children: empty ? emptyMessage : value }), !empty && delta && (_jsxs(Badge, { variant: delta.variant, className: "shrink-0", children: [_jsx(DeltaIcon, { "data-icon": "inline-start", "aria-hidden": "true" }), _jsx("span", { className: "sr-only", children: delta.direction === "increase"
|
|
19
25
|
? "Increased by "
|
|
20
26
|
: "Decreased by " }), delta.value] }))] }) }), !empty && sparklineElement] }));
|
|
21
27
|
}
|
|
22
28
|
function Scorecard({ label, tooltip, value, delta, sparkline, asCard = true, size = "default", loading = false, empty = false, emptyMessage = "No data", className, }) {
|
|
23
|
-
const content = (_jsx(ScorecardBody, { label: label, tooltip: tooltip, value: value, delta: delta, sparkline: sparkline, size: size, loading: loading, empty: empty, emptyMessage: emptyMessage }));
|
|
29
|
+
const content = (_jsx(ScorecardBody, { label: label, tooltip: tooltip, value: value, delta: delta, sparkline: sparkline, size: size, loading: loading, empty: empty, emptyMessage: emptyMessage, asCard: asCard }));
|
|
24
30
|
// Loading removes the title from the accessible tree (it becomes a
|
|
25
31
|
// Skeleton), so `aria-busy` alone would leave the busy region unnamed.
|
|
26
32
|
// `aria-label` alone isn't enough either: the root is a plain `<div>`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scorecard.js","sourceRoot":"","sources":["../../../../src/components/ui/scorecard.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AA2BxC,SAAS,aAAa,CAAC,EACrB,KAAK,EACL,OAAO,EACP,KAAK,EACL,KAAK,EACL,SAAS,EACT,IAAI,EACJ,OAAO,EACP,KAAK,EACL,YAAY,
|
|
1
|
+
{"version":3,"file":"scorecard.js","sourceRoot":"","sources":["../../../../src/components/ui/scorecard.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OA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7D,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,CACL,KAAC,IAAI,IACH,IAAI,EAAE,IAAI,eACC,OAAO,IAAI,SAAS,EAC/B,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,eACzB,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,gBAC7B,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EAC9C,SAAS,EAAE,EAAE,CAAC,gCAAgC,EAAE,SAAS,CAAC,YAE1D,KAAC,UAAU,cAAE,OAAO,GAAc,GAC7B,CACR,CAAC;IACJ,CAAC;IAED,OAAO,CACL,2BACY,WAAW,eACV,OAAO,IAAI,SAAS,EAC/B,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,eACzB,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,gBAC7B,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EAC9C,SAAS,EAAE,EAAE,CACX,qEAAqE,EACrE,SAAS,CACV,YAEA,OAAO,GACJ,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -7,7 +7,7 @@ declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimi
|
|
|
7
7
|
declare function SheetPortal({ ...props }: React.ComponentProps<typeof SheetPrimitive.Portal>): React.JSX.Element;
|
|
8
8
|
declare function SheetOverlay({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Overlay>): React.JSX.Element;
|
|
9
9
|
declare const sheetVariants: (props?: ({
|
|
10
|
-
side?: "
|
|
10
|
+
side?: "bottom" | "left" | "right" | "top" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
12
|
declare function SheetContent({ className, children, side, showCloseButton, onOpenAutoFocus, onCloseAutoFocus, restoreFocusRef, ...props }: React.ComponentProps<typeof SheetPrimitive.Content> & VariantProps<typeof sheetVariants> & {
|
|
13
13
|
showCloseButton?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sparkline.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sparkline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,SAAS,CAAC,EACjB,IAAI,EACJ,OAAO,EACP,OAAe,EACf,SAAS,GACV,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"sparkline.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/sparkline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,SAAS,CAAC,EACjB,IAAI,EACJ,OAAO,EACP,OAAe,EACf,SAAS,GACV,EAAE,cAAc,qBA0DhB;AAED,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,YAAY,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -13,7 +13,17 @@ function Sparkline({ data, dataKey, loading = false, className, }) {
|
|
|
13
13
|
// BarChart/LineChart, which enable this unconditionally, the
|
|
14
14
|
// default `true` here would otherwise make the SVG an unexpected
|
|
15
15
|
// tab stop (role="application", tabIndex=0) with nothing to do.
|
|
16
|
-
accessibilityLayer: false,
|
|
16
|
+
accessibilityLayer: false,
|
|
17
|
+
// Recharts' own default chart margin otherwise leaves ~5px of
|
|
18
|
+
// gutter on every side — invisible when Scorecard's Card padding
|
|
19
|
+
// dwarfed it, but exactly the gap that kept the trend from truly
|
|
20
|
+
// reaching the card's edges once that padding was canceled.
|
|
21
|
+
// Left/right stay at 0 for a true edge-to-edge bleed. Top/bottom
|
|
22
|
+
// keep a sliver matching the stroke's half-width: with
|
|
23
|
+
// domain=["dataMin", "dataMax"] the highest/lowest point's line
|
|
24
|
+
// is centered exactly on the plot's top/bottom edge, so zero
|
|
25
|
+
// margin there clips half the stroke at that point.
|
|
26
|
+
margin: { top: 2, right: 0, bottom: 2, left: 0 }, children: [_jsx("defs", { children: _jsxs("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [_jsx("stop", { offset: "0%", stopColor: "var(--chart-1)", stopOpacity: "var(--chart-area-fill-opacity)" }), _jsx("stop", { offset: "100%", stopColor: "var(--chart-1)", stopOpacity: 0 })] }) }), _jsx(YAxis, { hide: true, domain: ["dataMin", "dataMax"] }), _jsx(Area, { dataKey: dataKey, stroke: "var(--chart-1)", strokeWidth: 2, fill: `url(#${gradientId})`, isAnimationActive: false })] }) })) }));
|
|
17
27
|
}
|
|
18
28
|
export { Sparkline };
|
|
19
29
|
//# sourceMappingURL=sparkline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sparkline.js","sourceRoot":"","sources":["../../../../src/components/ui/sparkline.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,IAAI,EACJ,SAAS,IAAI,iBAAiB,EAC9B,mBAAmB,EACnB,KAAK,GACN,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAStC,SAAS,SAAS,CAAC,EACjB,I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.ts","sourceRoot":"","sources":["../../../../src/examples/agent-control-plane-processes/DashboardPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAwF/B,wBAAgB,aAAa,sBAmW5B"}
|